From: "Michał Pecio" <michal.pecio@gmail.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: "a1134123566@gmail.com" <a1134123566@gmail.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: Inquiry about the f_tcm: Enhance UASP driver work
Date: Sat, 23 Nov 2024 15:25:12 +0100 [thread overview]
Message-ID: <20241123152512.68853a5a@foxbook> (raw)
In-Reply-To: <20241123000209.5qowmsx3dxianl64@synopsys.com>
On Sat, 23 Nov 2024 00:02:10 +0000, Thinh Nguyen wrote:
> > 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.
>
> No, this delay is not a HW bug. When there's transaction error, the
> xHCI driver will reset the endpoint. The packet sequence number is
> reset and out of sync with the device. The next packet cannot proceed
> until there's some sort of recovery. There's no usb_clear_halt() or
> port reset immediately after a -EPROTO. The only recovery (port
> reset) will happen is after a timeout.
I think you are right. I tried to repro and I got this:
[Nov23 14:01] xhci-pci-renesas 0000:03:00.0: Transfer error for slot 1 ep 6 on endpoint
[ +0.000380] xhci-pci-renesas 0000:03:00.0: Transfer error for slot 1 ep 6 on endpoint
[ +30.096820] sd 6:0:0:0: [sdb] tag#1 uas_eh_abort_handler 0 uas-tag 2 inflight: IN
[ +0.000006] sd 6:0:0:0: [sdb] tag#1 CDB: opcode=0x28 28 00 02 d0 30 08 00 02 00 00
[ +0.012009] scsi host6: uas_eh_device_reset_handler start
[ +0.114634] usb 13-2: reset SuperSpeed USB device number 6 using xhci-pci-renesas
[ +0.017603] scsi host6: uas_eh_device_reset_handler success
[ +0.000072] sd 6:0:0:0: [sdb] tag#1 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=DRIVER_OK cmd_age=30s
[ +0.000003] sd 6:0:0:0: [sdb] tag#1 CDB: opcode=0x28 28 00 02 d0 30 08 00 02 00 00
[ +0.000001] I/O error, dev sdb, sector 47198216 op 0x0:(READ) flags 0x80700 phys_seg 64 prio class 0
I will keep it running for a few more hours and if those timeouts
keep happening I will have to conclude that I remembered wrong.
> > 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.
But a completely stopped endpoint is *also* possible if you encounter
COMP_INVALID_STREAM_ID. I see it after some command errors on this chip:
13fd:5910 Initio Corporation
> Perhaps this can be enhanced in the future in the storage class
> driver regarding -EPROTO recovery.
It's a universal problem with xhci_hcd, it always resets the host
sequence state on every error, which is against Linux convention,
so nobody expects it and nobody handles it. It's nuts.
One thing I'm going to try is patch it to stop doing this and see
what happens.
Regards,
Michal
next prev parent reply other threads:[~2024-11-23 14:25 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
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 [this message]
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=20241123152512.68853a5a@foxbook \
--to=michal.pecio@gmail.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=a1134123566@gmail.com \
--cc=linux-usb@vger.kernel.org \
/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