Re: [PATCH 1/4] USB: UDC core: Add udc_async_callbacks gadget op

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

 



Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> writes:
> The Gadget API has a theoretical race when a gadget driver is unbound.
> Although the pull-up is turned off before the driver's ->unbind
> callback runs, if the USB cable were to be unplugged at just the wrong
> moment there would be nothing to prevent the UDC driver from invoking
> the ->disconnect callback after the unbind has finished.  In theory,
> other asynchronous callbacks could also happen during the time before
> the UDC driver's udc_stop routine is called, and the gadget driver
> would not be prepared to handle any of them.
>
> We need a way to tell UDC drivers to stop issuing asynchronous (that is,
> ->suspend, ->resume, ->disconnect, ->reset, or ->setup) callbacks at
> some point after the pull-up has been turned off and before the
> ->unbind callback runs.  This patch adds a new ->udc_async_callbacks
> callback to the usb_gadget_ops structure for precisely this purpose,
> and it adds the corresponding support to the UDC core.
>
> Later patches in this series add support for udc_async_callbacks to
> several UDC drivers.
>
> Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

Thank you for working on this, Alan.

Acked-by: Felipe Balbi <balbi@xxxxxxxxxx>

-- 
balbi

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux