Re: Tons of issues with xhci

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

 



On Tue, 11 Dec 2012, Sarah Sharp wrote:

> Hi Alan,
> 
> I'm finally revisiting the issue with active transfers when a device
> disconnects.  I'm trying to refresh my memory of the issue.
> 
> On Thu, Oct 18, 2012 at 03:54:06PM -0400, Alan Stern wrote:
> > Unfortunately the trace isn't termendously helpful.  It shows a bunch
> > of reads with a few writes sprinkled among them.  Then for no apparent
> > reason, in the middle of a read the device was disconnected.
> > 
> > Oddly, the bulk-IN URB that was in progress when the disconnect
> > occurred did not complete immediately with an error.  Instead it timed
> > out after 30 seconds and was cancelled.  Sarah, I thought you had fixed
> > that?
> 
> I don't remember what the fix for this was supposed to be.  I currently
> assume that when a USB device is logically disconnected by the USB core,
> either the driver's disconnect function is called and it should cancel
> all outstanding URBs, or the core goes and cancels all active URBs that
> are in the host queue.  Basically, I assume it's the USB core's job to
> flush out any URBs before destroying the xHCI endpoint rings when the
> struct usb_device is deallocated.  ISTR that this assumption was wrong,
> but I don't remember why.

No, your memory has gotten things mixed up.  The problem is not a 
logical disconnect.

The problem is a physical disconnect.  IIRC, the trace showed that the
root hub's Get-Port-Status reply had the connect status bit clear and
connect-change status bit set.  Nevertheless, the URB that was in
progress did not complete immediately with an error.

If the device is truly disconnected then it cannot send any packets.  
In particular, it can't send handshaking packets (or the USB-3
equivalent).  In the absence of these packets, the host hardware is
supposed to apply the "3-strikes" rule and abort the transfer.  But
this didn't happen.  _That_ was the problem.

> I vaguely recall that the fix was for the xHCI driver to not accept URBs
> when it knows a particular device is disconnected.  Is that correct?

No, not even close.

Alan Stern

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