public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michał Pecio" <michal.pecio@gmail.com>
To: thinh.nguyen@synopsys.com
Cc: a1134123566@gmail.com, linux-usb@vger.kernel.org
Subject: Re: Inquiry about the f_tcm: Enhance UASP driver work
Date: Fri, 22 Nov 2024 08:57:55 +0100	[thread overview]
Message-ID: <20241122085755.29cebea1@foxbook> (raw)
In-Reply-To: <20241122022146.ykwhz4byhy645njg@synopsys.com>

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

Long delays I have seen mainly on some unfortunate pairings of HC and
device (HW bugs?) which trigger unusual error conditions poorly handled
by xhci_hcd. Try with dynamic debug on handle_transferless_tx_event(),
if your kernel is recent enough for that to be a separate function.

In those cases, UAS seems to wait for other streams to complete before
resetting, but the whole endpoint is stopped and nothing moves forward.
At least that's the impression I got, I was looking at other things.

If you aren't running into this case, I would say something may be wrong
with UAS implementation on one or the other side.

It looks like the transaction error was delivered to UAS by means of
-EPROTO status so xhci_hcd has done its job at least for this one URB.
No idea what happened later and why the device wasn't reset promptly.

Regards,
Michal

  reply	other threads:[~2024-11-22  7:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAC7i41MN9LAxy7FZh7nbo9zQ_hvmkZtzpGpXatyCVLQTde=RZA@mail.gmail.com>
2024-11-22  2:21 ` Inquiry about the f_tcm: Enhance UASP driver work Thinh Nguyen
2024-11-22  7:57   ` Michał Pecio [this message]
2024-11-23  0:02     ` Thinh Nguyen
2024-11-23  2:49       ` Alan Stern
2024-11-25  1:58         ` Homura Akemi
2024-11-23 14:25       ` Michał Pecio
2024-11-25 21:13         ` Thinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241122085755.29cebea1@foxbook \
    --to=michal.pecio@gmail.com \
    --cc=a1134123566@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=thinh.nguyen@synopsys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox