On 2019 Feb 21 (Thu) at 16:19:22 +0100 (+0100), Patrick Wildt wrote:
:On Thu, Feb 21, 2019 at 03:56:57PM +0100, Stefan Sperling wrote:
:> On Thu, Feb 21, 2019 at 10:50:40AM +0100, Patrick Wildt wrote:
:> > Hi,
:> > 
:> > on my i.MX8M machine which features a DWC3 xHCI 1.10 controller I have
:> > seen this error while installing base64.tgz or running fsck:
:> > 
:> > umass0: Invalid CSW: sig 0x43425355 should be 0x53425355
:> > 
:> > As it turns out using a USB protocol analyzer, the transfers actually
:> > seem fine, the USB mass storage is not responding nonsense.  By further
:> > looking into it I realized that our xhci(4) is told the transfer was
:> > completed, even though the buffer had not been touched.
:> > 
:> > Further debugging revealed that the issue occured when a transfer that
:> > spans multiple TRBs loops over the ring.  This means one TRB is using
:> > idx 254, the next TRB is the link TRB which does not contain data and
:> > sits at idx 255, and the following data TRB is using idx 0.
:> > 
:> > Transfers that comprise of multiple TRBs must have the chain bit set in
:> > all but the last TRB.  Now in this case the link TRB which sits in the
:> > middle does not get the chain bit set, and thus processing stops.
:> > 
:> > Somewhere I have seen code that always sets the chain bit in the link
:> > TRB, so I'm wondering if we should follow that too.  For now I think the
:> > easiest fix for this is to set the chain bit in the link TRB if the
:> > transfer spans multiple TRBs.
:> > 
:> > Feedback?
:> 
:> Is this why the #if 0 isochronous transfer code doesn't work?
:> 
:
:That's possible.  Do you have a device you could test this with?
:

tested here with uvideo0:

xhci0 at pci0 dev 20 function 0 "Intel 100 Series xHCI" rev 0x21: msi, xHCI 1.0
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Intel xHCI root hub" rev 3.00/1.00 
addr 1
...
uvideo0 at uhub0 port 8 configuration 1 interface 0 "Chicony Electronics 
Co.,Ltd. Integrated Camera" rev 2.00/0.06 addr 3
video0 at uvideo0
...
xhci0: NULL xfer pointer
xhci0: wrong trb index (4227450112) max is 255
xhci0: wrong trb index (4227450112) max is 255
xhci0: NULL xfer pointer



-- 
Q:  How many Martians does it take to screw in a lightbulb?
A:  One and a half.

Reply via email to