Re: Bug: VHCI + USB 3.0

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

 



On Fri, 5 Apr 2019, Bollinger, Seth wrote:

> Hello All,
> 
> We recently have run into a problem using a USB 3.0 thumb drive over USBIP where the driver will unlink URBs when trying to mount a FAT partition.  This happens because of the remote XHCI controller returning errno 75 during IN URB processing.  I've traced the failure to the following steps:
> 
> 1. usb-storage sends a SCSI READ_10 request OUT URB to vhci
> 2. vhci forwards to remote workstation over USBIP and submits the URB
> 3. usb-storage sends a 32K IN URB using a SG table
> 4. usb_sg_init notices that vhci bus doesn't support SG (usb/core/message.c:399)
> 5. usb_sg_init breaks the SG table into an URB for each SG entry (usb/core/message.c:418)
> 6. vhci forwards to remote and submits the URBs
> 7. XHCI processes the first URB, but the buffer is too small to contain the bulk of the data and sets errno -75 when it would overflow the URB buffer (xhci-ring.c:2371)
> 
> It appears to me when the SG read is broken into multiple URBs, the latency in processing the remote URBs is causing XHCI to fail the IN.  A similar error sometimes occurs on OUTs as well.  I apologize, but I don't remember the errno off the top of my head for the OUT.

Latency doesn't seem to have anything to do with it.  You wrote just 
above that the remote buffer is too small.  That's the problem.

> I patched usb_sg_init to alloc/free a contiguous URB so as not to fragment INS/OUTS and this is working well so far.
> 
> 1. Does that seem like the correct fix?

No.

> 2. Is this fix something the community would be interested in?
> 
> I'm open to working on a more "correct" patch if prompted to do so (as long as we're not talking weeks of work...).

Why is the remote buffer too small?  If you can figure that out then 
you should be able to fix the problem pretty easily.

Alan Stern




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

  Powered by Linux