Re: [PATCH] USB: xhci - also free streams when resetting devices

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

 



On Wed, Apr 13, 2011 at 10:43:37AM -0400, Alan Stern wrote:
> On Tue, 12 Apr 2011, Dmitry Torokhov wrote:
> 
> > Currently, when resetting a device, xHCI driver disables all but one
> > endpoints and frees their rings, but leaves alone any streams that
> > might have been allocated. Later, when users try to free allocated
> > streams, we oops in xhci_setup_no_streams_ep_input_ctx() because
> > ep->ring is NULL.
> > 
> > Let's free not only rings but also stream data as well, so that
> > calling free_streams() on a device that was reset will be safe.
> 
> What happens when the driver that allocated the streams initially wants
> to use them after the reset?  Is this driver supposed to be responsible
> for re-allocating the streams in its post_reset method?

Yes.  This probably should be documented in
Documentation/usb/bulk-streams.txt.

> Wouldn't it make more sense to keep the streams around or 
> automatically re-allocate them?

No, I don't think the xHCI driver should do that.  The device may change
interfaces after the reset, and the endpoints may have a different
number of maximum streams they support.  For example, on UAS devices,
the first alternate interface is for bulk-only-transport and none of the
endpoints will support streams.  The second alternate interface setting
is USB attached SCSI, and those endpoints support streams.  So we'll go
back to endpoints without streams after the reset.  It's really up to
the driver to set the policy for what it wants to do with streams there.

Sarah Sharp
--
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