lkml.org 
[lkml]   [2015]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH v2 06/13] usb: hcd: Add hcd add/remove functions for OTG use
On 20/04/15 16:56, Alan Stern wrote:
> On Mon, 20 Apr 2015, Roger Quadros wrote:
>
>>> I don't understand this. Why do you want to defer the add/remove if
>>> the device is OTG? Don't host controller drivers expect these things
>>> to execute synchronously?
>>
>> Sorry for the wrong information. We actually defer only the add as the
>> OTG state machine might not yet be in Host ready mode.
>> The remove is always synchronous and we ensure that the HCD is removed
>> when usb_otg_unregister_hcd() returns.
>
> That's okay then, but it does leave one potential hole. What happens
> if usb_add_hcd() is deferred for so long that usb_remove_hcd() gets
> called before the add can complete?

We keep track of the HCD state in the OTG state machine and if it was not
yet added then _usb_remove_hcd() is not called during usb_otg_unregister_hcd()
in the usb_remove_hcd() call.

cheers,
-roger



\
 
 \ /
  Last update: 2015-04-21 09:41    [W:0.067 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site