Re: [PATCH v2 2/2] drm: remove drm_device_is_unplugged checks in common drm code.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

On Thu, Feb 11, 2016 at 12:18 AM, Haixia Shi <hshi@xxxxxxxxxxxx> wrote:
> When USB cable is disconnected, we mark udl device as unplugged so that
> udl_detect reports connector status as disconnected, but still keep
> the drm device alive until user-space closes it.
>
> Signed-off-by: Haixia Shi <hshi@xxxxxxxxxxxx>
> Reviewed-by: Stéphane Marchesin <marcheu@xxxxxxxxxxxx>

I assume this is based on the discussion I had with Stephane on IRC.
I'm fine with going this way and keeping the device fully alive, and
just treat the device removal as a connector-unplug. However, you
really must document all this in your commit message.

Anyway, if you want to keep the device alive, then please change the
code to entirely drop the "unplugged" flag and all related code. Then
make sure you somehow reset "udl->udev" to NULL and make sure no
code-path uses the usb-device after it was unplugged. I guess there
should be appropriate locks already.

This way, you end up with a fully functional UDL device, which just
happens to have to connector plugged. But you *really* have to be
careful that no-one touches the usb device, as the interface might be
re-used by some other device any time (or in case the usb-core
provides protection against this, please document it).

Thanks
David
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux