lkml.org 
[lkml]   [2019]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] usb/hcd: Send a uevent signaling that the host controller has died
On Wed, Apr 17, 2019 at 02:24:06PM -0400, Alan Stern wrote:
> On Wed, 17 Apr 2019, Raul Rangel wrote:
>
> > > > Also where would be a good place to document this?
> > >
> > > Documentation/ABI/ is a good start.
> > I'll add something to Documentation/ABI/testing/xhci-uevent
>
> Your patch will apply to all host controllers, not just xhci. The
> documentation filename should reflect this. Perhaps "usb-uevent"?
I realized that after I had sent the email :) I'll do usb-uevent.
>
> > > Why do you need to lock something that is "dead"? And why is the idr
> > > lock the correct one here?
> > We need to ensure that root_hub is not null. Though I'm not sure the
> > lock is entirely necessary in this case. usb_remove_hcd stops the work
> > item before it sets the rhdev to null. The reason I picked
> > usb_bus_idr_lock was because it's the same lock that usb_remove_hcd uses
> > when setting rhdev = NULL.
> >
> > Alan, what do you think? Should I remove the lock?
>
> You're both right; the lock isn't needed because the work is stopped
> before the root hub gets removed. Acquiring the lock doesn't do any
> harm, but it isn't needed so you probably should remove it. In fact,
> you don't even need to test for whether hcd->self.root_hub is
> non-NULL.
Sounds good, I'll clean it up.
>
> Alan Stern
>
>

\
 
 \ /
  Last update: 2019-04-17 20:32    [W:0.046 / U:1.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site