Re: [PATCH] Fix unplug of device with active streams

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

 



On Tue, Sep 28, 2010 at 02:35:12AM -0400, Matthew Wilcox wrote:
> On Mon, Sep 27, 2010 at 10:58:28PM -0700, Greg KH wrote:
> > On Tue, Sep 28, 2010 at 12:57:32AM -0400, Matthew Wilcox wrote:
> > > 
> > > If I unplug a device while the UAS driver is loaded, I get an oops
> > > in usb_free_streams().  This is because usb_unbind_interface() calls
> > > usb_disable_interface() which calls usb_disable_endpoint() which sets
> > > ep_out and ep_in to NULL.  Then the UAS driver calls usb_pipe_endpoint()
> > > which returns a NULL pointer and passes an array of NULL pointers to
> > > usb_free_streams().
> > > 
> > > I think the correct fix for this is to check for the NULL pointer
> > > in usb_free_streams() rather than making the driver check for this
> > > situation.  My original patch for this checked for dev->state ==
> > > USB_STATE_NOTATTACHED, but the call to usb_disable_interface() is
> > > conditional, so not all drivers would want this check.
> > > 
> > > [This should probably go into Sarah's xhci tree, not directly into Greg's
> > > usb tree]
> > 
> > Why?  Does Sarah have paches that I currently don't?  I thought we were
> > synced up now.
> 
> I want Sarah to agree that it's the correct fix ... I've convinced myself,
> but she might have a different opinion about how it should work.

I'll take a look at this, but it's probably the right fix.

I also need to send off the link TRB activation race patch[1].  I
haven't had time to verify that it's the only fix that's needed for
streams to work under an NEC xHCI host, as the branch contains a lot of
other guesses.  I won't be able to test until I get back from GHC next
week.

Sarah

[1] http://git.kernel.org/?p=linux/kernel/git/sarah/xhci.git;a=commit;h=cadfa20afb30f97fba1838ddac29333618c0c831
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux