Linux USB
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: raoxu <raoxu@uniontech.com>, michal.pecio@gmail.com
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, mathias.nyman@intel.com,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] xhci: pci: Disable soft retry for Renesas uPD720201
Date: Mon, 22 Jun 2026 14:31:58 +0300	[thread overview]
Message-ID: <c4ef0081-fbe9-47a4-b5d5-60665564ca02@linux.intel.com> (raw)
In-Reply-To: <237BFC17C62D63DF+20260622062117.56278-1-raoxu@uniontech.com>

On 6/22/26 09:21, raoxu wrote:
> Hi Michal,
> 
>>>> The host reports a transaction error on the RTL8153 interrupt
>>>> endpoint, queues a soft reset, and later times out the Stop
>>>> Endpoint command while disconnecting the device:
>>>>
>>>>     Transfer error for slot 8 ep 6 on endpoint
>>>>     Soft-reset ep 6, slot 8
>>>>     Ignoring reset ep completion code of 1
>>>>     xHCI host not responding to stop endpoint command
>>>>     xHCI host controller not responding, assume dead
>>>>     HC died; cleaning up
>>
>> There is other stuff too, like concurrent teardown of a separate bulk
>> endpoint, not yet sure what exactly breaks these chips.
>>
>> Would you mind to apply the attached debug patch, reproduce and post
>> dmesg from your system for comparison?
> 
> I applied the debug patch and reproduced the issue.
> The XHCI_NO_SOFT_RETRY quirk was disabled during the test.
> 
> Short timeline from the log:
> 13:23:29 The USB hub with an integrated RTL8153 Ethernet adapter was
> 	 plugged in.
> 13:23:39 The USB hub was unplugged, and the endpoint error occurred.
> 13:23:44 The Stop Endpoint command timed out and the xHCI host was
>           declared dead.
> 
> The complete dmesg output follows:

Thanks,
I think there are some steps we could do to avoid soft retry, restart, and stopping
an endpoint we know is behind a disconnected parent.

> 
> ----- dmesg begin -----
> 2026-06-22T13:23:39.445959+08:00 uos-PC kernel: xhci_hcd:handle_port_status: xhci_hcd 0000:04:00.0: Port change event, 1-3, id 7, portsc: 0x202a0

usb2 part of hub disconnect now known by xhci driver

> 2026-06-22T13:23:39.449096+08:00 uos-PC kernel: xhci_hcd:handle_port_status: xhci_hcd 0000:04:00.0: Port change event, 2-3, id 3, portsc: 0x202c0

usb3 part of hub disconnect now known by xhci driver

> 2026-06-22T13:23:39.449108+08:00 uos-PC kernel: xhci_hcd 0000:04:00.0: 7/-1 (fff/f) [ffffffff/ffffffff/ffffffff] queue_disable_slot
> 2026-06-22T13:23:39.449111+08:00 uos-PC kernel: xhci_hcd 0000:04:00.0: 7/-1 (fff/f) [ffffffff/ffffffff/ffffffff] handle_cmd_completion cmd_type 10 comp_code 1

hub slot now disabled

> 2026-06-22T13:23:39.449112+08:00 uos-PC kernel: xhci_hcd:xhci_hub_control: xhci_hcd 0000:04:00.0: Get port status 1-3 read: 0x2a0, return 0x100
> 2026-06-22T13:23:39.457060+08:00 uos-PC kernel: xhci_hcd 0000:04:00.0: 8/6 (000/2) [200cb341b0/200cb341b1/200cb341c0] handle_tx_event comp_code 4 trb_dma 200cb341b0
> 2026-06-22T13:23:39.457070+08:00 uos-PC kernel: xhci_hcd 0000:04:00.0: 8/6 (000/2) [200cb341b0/200cb341b1/200cb341c0] handle_tx_event stream_id 0 trb_len 2 missing 2
> 2026-06-22T13:23:39.457071+08:00 uos-PC kernel: xhci_hcd:handle_tx_event: xhci_hcd 0000:04:00.0: Transfer error for slot 8 ep 6 on endpoint

transfer error on realtek ethernet child device behind the disconnected hub

> 2026-06-22T13:23:39.457072+08:00 uos-PC kernel: xhci_hcd:xhci_reset_halted_ep: xhci_hcd 0000:04:00.0: Soft-reset ep 6, slot 8

Try to soft reset/retry. (xhci driver knows parent is disconnected, need a fix that avoids soft retry here)

> 2026-06-22T13:23:39.457072+08:00 uos-PC kernel: xhci_hcd 0000:04:00.0: 8/6 (000/2) [200cb341b0/200cb341b1/200cb341c0] queue_reset_endpoint tsp 1
> 2026-06-22T13:23:39.457082+08:00 uos-PC kernel: xhci_hcd 0000:04:00.0: 8/6 (002/3) [200cb341b0/200cb341b1/200cb341c0] handle_cmd_completion cmd_type 14 comp_code 1

> 2026-06-22T13:23:39.457084+08:00 uos-PC kernel: xhci_hcd 0000:04:00.0: 8/6 (000/3) [200cb341b0/200cb341b1/200cb341c0] ring_ep_doorbell stream 0

Tried to restart ring after soft retry, we know parent is gone, should write a fix that avoids restarting ring.


> 2026-06-22T13:23:39.477064+08:00 uos-PC kernel: xhci_hcd:xhci_hub_control: xhci_hcd 0000:04:00.0: Get port status 2-3 read: 0x2a0, return 0x2a0
> 2026-06-22T13:23:39.477069+08:00 uos-PC kernel: usbcore:port_event: usb usb2-port3: Wait for inactive link disconnect detect
> 2026-06-22T13:23:39.477070+08:00 uos-PC kernel: usbcore:hub_port_connect_change: usb usb2-port3: status 02a0, change 0001, 5.0 Gb/s
> 2026-06-22T13:23:39.477071+08:00 uos-PC kernel: usb 2-3: USB disconnect, device number 3
> 2026-06-22T13:23:39.477071+08:00 uos-PC kernel: r8152-cfgselector 2-3.1: USB disconnect, device number 4
> 2026-06-22T13:23:39.477072+08:00 uos-PC kernel: usbcore:usb_disconnect: r8152-cfgselector 2-3.1: unregistering device
> 2026-06-22T13:23:39.477079+08:00 uos-PC kernel: usbcore:usb_disable_device: r8152-cfgselector 2-3.1: unregistering interface 2-3.1:1.0
> 2026-06-22T13:23:39.477080+08:00 uos-PC kernel: xhci_hcd:xhci_dbg_trace: xhci_hcd 0000:04:00.0: Cancel URB 000000005c134e45, dev 3.1, ep 0x83, starting at offset 0x200cb341b0

Cancel the realtek URB we tried to soft retry earlier.

> 2026-06-22T13:23:39.477082+08:00 uos-PC kernel: xhci_hcd 0000:04:00.0: 8/6 (000/3) [200cb341b0/200cb341b1/200cb341c0] xhci_urb_dequeue cancel TD at 200cb341b0 stream 0
> 2026-06-22T13:23:39.477082+08:00 uos-PC kernel: xhci_hcd 0000:04:00.0: 8/6 (004/3) [200cb341b0/200cb341b1/200cb341c0] queue_stop_endpoint suspend 0

queue stop endpoint to cancel URB for realtek device.
Endpoint context still shows endpoint is in "stopped" state.
Note that we restarted the endpoint 20ms earlier, endpoint context might not have updated yet.

> 2026-06-22T13:23:44.565110+08:00 uos-PC kernel: xhci_hcd:xhci_handle_command_timeout: xhci_hcd 0000:04:00.0: Command timeout, USBSTS: 0x00000000

Stop endpoint command times out.

-Mathias

  reply	other threads:[~2026-06-22 11:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17 10:09 [PATCH v2] xhci: pci: Disable soft retry for Renesas uPD720201 raoxu
2026-06-18 14:03 ` Mathias Nyman
2026-06-19 10:42   ` Michal Pecio
2026-06-20 12:21     ` raoxu
2026-06-22  6:21     ` raoxu
2026-06-22 11:31       ` Mathias Nyman [this message]
2026-06-22 11:36     ` Mathias Nyman

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=c4ef0081-fbe9-47a4-b5d5-60665564ca02@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=michal.pecio@gmail.com \
    --cc=raoxu@uniontech.com \
    --cc=stable@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