On Sat, Nov 23, 2024 at 12:02:10AM +0000, Thinh Nguyen wrote: > On Fri, Nov 22, 2024, Michał Pecio wrote: > > Hi, > > > > > > I tried to use it on dwc3, though I fix some other problems, the host side xhci > > > > (ubuntu client) using fio for stress testing, and I encountered the following > > > > error on host: > > > > [18836.092159] xhci_hcd 0000:00:0d.0: Transfer error for slot 3 ep 1 on > > > > endpoint > > > > [18836.092211] sd 0:0:0:0: [sda] tag#11 data cmplt err -71 uas-tag 1 inflight: > > > > CMD > > > > [18836.092213] sd 0:0:0:0: [sda] tag#11 CDB: Write(10) 2a 00 02 5e 31 00 00 01 > > > > 00 00 > > > > .....more and mores.... > > > > [18867.369118] scsi host0: uas_eh_device_reset_handler start [18867.453796] usb > > > > 2-3.2: reset SuperSpeed USB device number 4 using xhci_hcd > > > > and the gadget side is keep resetting configfs and printing wait_for_completion > > > > timeout (since dwc3 have ) > > > > > > > > I am not sure whether this is due to the stream exception of dwc3 or some > > > > logical in f_tcm and target. Homura Akemi: You can try using usbmon to record the transfers between the host and the f_tcm target. Seeing that data might help explain what's going on. > > > > > > The error is -71. This is transaction error (could be a CRC error). It > > > could be due to the host, device hardware, electrical interference, or > > > even the cable. No logical issue from software. > > > > A transaction error is a transaction error, but waiting 30 seconds for > > UAS to reset the device afterwards looks wrong. I seem to recall seeing > > sporadic transaction errors which triggered the reset instantly. > > That's not what happening. I don't recall the storage class handles > transaction error as such. It just waits for the scsi command timeout. For what it's worth, usb-storage handles transaction errors right away, without waiting for the SCSI timeout. It initiates a USB port reset, which of course clears out all the messed-up state on both the device and the controller. I don't know about uas, though. Alan Stern