From: Daniel Vetter <daniel@ffwll.ch>
To: Simon Ser <contact@emersion.fr>
Cc: Sean Paul <sean@poorly.run>, Dave Airlie <airlied@redhat.com>,
Pekka Paalanen <pekka.paalanen@collabora.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/doc: device hot-unplug for userspace
Date: Wed, 20 May 2020 16:19:00 +0200 [thread overview]
Message-ID: <CAKMK7uFzk7UW7k8WTMSzKynGOypQeTzhf9Gqxb4maimG+QEdiQ@mail.gmail.com> (raw)
In-Reply-To: <4Qkv4p0V0uG4sZ8LjizVLq6bLbZ8U1xAwQ0riB72aHH3sT_ZJYz9QzDFPWCko8PfcA-VGBFkGtCn1n9YfKYqo_vwzvE3BVQUlxyBq61GZ08=@emersion.fr>
On Wed, May 20, 2020 at 3:20 PM Simon Ser <contact@emersion.fr> wrote:
>
> On Wednesday, May 20, 2020 2:55 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
>
> > Maybe we should add an explicit note that there's no guarantee about the
> > new chardev minor this new device will get, it could both inherit the
> > existing one (you can't open the old one anymore anyway) or get a new one?
> >
> > Or does userspace want a guarantee, i.e. as long as there's still a handle
> > open kernel guarantees to not recycle the chardev minor (which is what we
> > currently do). In that case better to add that to your list of guarantees
> > above.
>
> The are race conditions to consider too, e.g.
>
> - Compositor sends /dev/dri/card0 to a client
> - card0 goes away
> - Another device takes card0
> - Client receives /dev/dri/card0 and then starts using it, but it's the
> wrong device
Oh reminds me, what should we do about open() - that one will fail,
the chardev is going away after all, not failing kinda doesn't make
sense. And more tricky, about creating new leases?
I think reasonable semantics here would be that both of these "create
a new open drm fd" operations can fail as soon as the device is
unplugged. Userspace needs to be able to deal with that.
-Daniel
>
> At first glance these seem like edge-cases that almost never happen.
> However I've seen these happen in practice with connectors, especially
> with docks.
>
> One solution would be to number minor numbers like PIDs: don't recycle
> card0 before we've reached the upper minor number limit.
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-05-20 14:19 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 10:06 [PATCH] drm/doc: device hot-unplug for userspace Pekka Paalanen
2020-05-19 14:37 ` Andrey Grodzovsky
2020-05-20 11:19 ` Pekka Paalanen
2020-05-20 12:46 ` Daniel Vetter
2020-05-20 14:50 ` Andrey Grodzovsky
2020-05-25 12:13 ` Andrey Grodzovsky
2020-05-25 14:28 ` Daniel Vetter
2020-05-25 14:55 ` Pekka Paalanen
2020-05-25 15:09 ` Daniel Vetter
2020-05-28 12:27 ` Pekka Paalanen
2020-05-28 14:45 ` Daniel Vetter
2020-06-01 12:04 ` Pekka Paalanen
2020-05-20 12:55 ` Daniel Vetter
2020-05-20 13:20 ` Simon Ser
2020-05-20 14:19 ` Daniel Vetter [this message]
2020-05-22 9:54 ` Pekka Paalanen
2020-05-25 14:29 ` Daniel Vetter
2020-05-25 12:46 ` [PATCH v2] " Pekka Paalanen
2020-05-25 13:51 ` Andrey Grodzovsky
2020-05-25 14:30 ` Daniel Vetter
2020-05-25 15:02 ` Pekka Paalanen
2020-05-25 14:41 ` Pekka Paalanen
2020-05-26 14:30 ` [PATCH] " Andrey Grodzovsky
2020-05-27 6:44 ` Pekka Paalanen
2020-05-27 13:51 ` Andrey Grodzovsky
2020-05-27 14:39 ` Daniel Vetter
2020-05-27 15:23 ` Andrey Grodzovsky
2020-05-27 19:44 ` Christian König
2020-05-27 20:25 ` Daniel Vetter
2020-05-28 12:13 ` Pekka Paalanen
2020-05-28 21:28 ` Andrey Grodzovsky
2020-06-01 14:32 ` [PATCH v3] " Pekka Paalanen
2020-06-02 14:00 ` Andrey Grodzovsky
2020-06-03 8:19 ` Daniel Vetter
2020-06-08 16:05 ` Pekka Paalanen
2020-06-10 15:40 ` Daniel Vetter
2020-06-22 14:05 ` [PATCH v4] " Pekka Paalanen
2020-06-22 16:56 ` Alex Deucher
2020-06-27 10:02 ` Noralf Trønnes
2020-07-07 11:38 ` [PATCH v5] " Pekka Paalanen
2020-07-07 11:49 ` Karol Herbst
2020-07-07 12:13 ` Daniel Vetter
2020-07-07 12:59 ` Simon Ser
2020-07-30 13:35 ` drm/doc: missing SPDX license identifier (Was: Re: [PATCH v5] drm/doc: device hot-unplug for userspace) Emil Velikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKMK7uFzk7UW7k8WTMSzKynGOypQeTzhf9Gqxb4maimG+QEdiQ@mail.gmail.com \
--to=daniel@ffwll.ch \
--cc=airlied@redhat.com \
--cc=contact@emersion.fr \
--cc=dri-devel@lists.freedesktop.org \
--cc=pekka.paalanen@collabora.com \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).