[RFC PATCH v1 1/6] USB: HCD: support giveback of URB in tasklet context

Ming Lei ming.lei at canonical.com
Fri Jun 21 05:43:21 EDT 2013


On Fri, Jun 21, 2013 at 5:20 PM, Oliver Neukum <oneukum at suse.de> wrote:
>
> This is highly problematic. It is bound to cause resource leaks.
>
>> called.  The situation might happen when driver->remove() doesn't
>> kill the URBs with the patch applied.
>
> Well, there is no good way to handle this. But we have a simple rule.
> If usb_submit_urb() succeeds, complete() will be called.
> Breaking this rule is a bad idea.

The rule should be enhanced by calling complete() before
completing driver unbind.

>
> The best way is really to make sure that no URB survive.

Drivers may let usbcore to do that by not setting driver->soft_unbind.

I will fix the problem in v2, one solution I thought of is to flush
the endpoint's URBs which have been added to tasklet list
at the end of usb_hcd_flush_endpoint(). Any comments?

Thanks,
--
Ming Lei



More information about the linux-arm-kernel mailing list