Linux USB
 help / color / mirror / Atom feed
From: Michal Pecio <michal.pecio@gmail.com>
To: Kuangyi Chiang <ki.chiang65@gmail.com>
Cc: mathias.nyman@intel.com, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] xhci: Handle missing USB2 resume events on Etron hosts
Date: Mon, 23 Nov 2026 12:23:43 +0100	[thread overview]
Message-ID: <20261123122343.6d3f8866.michal.pecio@gmail.com> (raw)
In-Reply-To: <20261123072320.5967-1-ki.chiang65@gmail.com>

On Mon, 23 Nov 2026 15:23:20 +0800, Kuangyi Chiang wrote:
> On Etron xHCs, a USB2 remote wakeup may also move other suspended
> USB2 ports into the resume state without generating individual Port
> Status Change Events.
> 
> The issue can be reproduced as follows:
> 
> 1. Connect a USB2 hub to each downstream port of the Etron xHC.
> 2. Wait for all hubs, including the root hub, to autosuspend.
> 3. Connect a USB device, such as a mouse, to each USB2 hub in turn.
> 4. The last connected mouse does not work.
> 
> The affected USB2 ports may remain in the resume state, preventing
> newly connected devices from enumerating. Reconnecting an affected
> hub or mouse does not help. Reloading the xHCI driver restores
> normal operation.
> 
> When handling a USB2 resume event on an Etron xHC, check the other
> USB2 ports for the resume state and track them so the normal resume
> handling can complete.
> 
> Before the patch, the root hub status bitmap reported only port 2
> (evt 0004), leaving port 3 in the resume state.
> 
> [ 4621.396100] xhci_hcd 0000:01:00.0: Port change event, 3-2, id 2, portsc: 0x400fe3
> [ 4621.396158] xhci_hcd 0000:01:00.0: port resume event for port 2
> [ 4621.396164] xhci_hcd 0000:01:00.0: resume HS port 2
> [ 4621.437164] hub 3-0:1.0: state 7 ports 4 chg 0000 evt 0004
> [ 4621.569169] usb usb3-port2: resume, status 0
> 
> After the patch, the bitmap includes both ports (evt 000c), allowing
> port 3 to complete resume through the normal resume handling.
> 
> [ 4824.829350] xhci_hcd 0000:01:00.0: Port change event, 3-2, id 2, portsc: 0x400fe3
> [ 4824.829425] xhci_hcd 0000:01:00.0: port resume event for port 2
> [ 4824.829431] xhci_hcd 0000:01:00.0: resume HS port 2
> [ 4824.829439] xhci_hcd 0000:01:00.0: HS port 3 in resume without event, portsc: 0xfe3
> [ 4824.870180] hub 3-0:1.0: state 7 ports 4 chg 0000 evt 000c
> [ 4825.001183] usb usb3-port2: resume, status 0
> [ 4825.027484] usb usb3-port3: resume, status 0
> 
> Tested on Etron EJ168 (1b6f:7023) and EJ188 (1b6f:7052).
> 
> Signed-off-by: Kuangyi Chiang <ki.chiang65@gmail.com>

Hi,

This repro doesn't seem to work for me.

Etron Technology, Inc. EJ168 USB 3.0 Host Controller [1b6f:7023] (rev 01)
/:  Bus 008.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/2p, 480M
    |__ Port 001: Dev 040, If 0, Class=Hub, Driver=hub/4p, 480M
    |__ Port 002: Dev 034, If 0, Class=Hub, Driver=hub/4p, 480M

# connecting a mouse to hub 2 resumes the bus:
[ 8316.191894] xhci_hcd 0000:07:00.0: Port change event, 8-2, id 2, portsc: 0xc400fe3
[ 8316.191911] xhci_hcd 0000:07:00.0: resume root hub
[ 8316.191930] xhci_hcd 0000:07:00.0: port resume event for port 2
[ 8316.191936] xhci_hcd 0000:07:00.0: resume HS port 2
[ 8316.191992] usb usb8: usb wakeup-resume
[ 8316.192001] usb usb8: usb auto-resume
[ 8316.192015] hub 8-0:1.0: hub_resume

# core polls both RH ports for status, both are resuming:
[ 8316.192030] xhci_hcd 0000:07:00.0: Get port status 8-1 read: 0xfe3, return 0x507
[ 8316.192059] usb usb8-port1: status 0507 change 0000
[ 8316.192069] xhci_hcd 0000:07:00.0: Get port status 8-2 read: 0xfe3, return 0x507
[ 8316.192079] usb usb8-port2: status 0507 change 0000
[ 8316.192094] hub 8-0:1.0: state 7 ports 2 chg 0000 evt 0000
[ 8316.232936] hub 8-0:1.0: state 7 ports 2 chg 0000 evt 0006

# hub 1 is resumend, inspected and suspended again
[ 8316.232961] xhci_hcd 0000:07:00.0: resume USB2 port 8-1
[ 8316.232970] xhci_hcd 0000:07:00.0: Set port 8-1 link state, portsc: 0xfe3, write 0x10e01
[ 8316.233017] xhci_hcd 0000:07:00.0: Port change event, 8-1, id 1, portsc: 0x400e03
[ 8316.233041] xhci_hcd 0000:07:00.0: Get port status 8-1 read: 0xfe3, return 0x40503
[ 8316.233061] xhci_hcd 0000:07:00.0: clear port1 suspend/resume change, portsc: 0xe03
[ 8316.244881] usb 8-1: usb wakeup-resume
[ 8316.244921] xhci_hcd 0000:07:00.0: Get port status 8-1 read: 0xe03, return 0x503
[ 8316.256001] usb 8-1: Waited 0ms for CONNECT
[ 8316.256014] usb 8-1: finish resume
[ 8316.256917] hub 8-1:1.0: hub_resume
[ 8316.259088] usb usb8-port1: resume, status 0
[ 8316.259122] xhci_hcd 0000:07:00.0: resume USB2 port 8-2
[ 8316.259131] xhci_hcd 0000:07:00.0: Set port 8-2 link state, portsc: 0xfe3, write 0x10e01
[ 8316.259158] hub 8-1:1.0: state 7 ports 4 chg 0000 evt 0000
[ 8316.259345] xhci_hcd 0000:07:00.0: Port change event, 8-2, id 2, portsc: 0x400e03
[ 8316.259410] xhci_hcd 0000:07:00.0: Get port status 8-2 read: 0xfe3, return 0x40503
[ 8316.259552] xhci_hcd 0000:07:00.0: clear port2 suspend/resume change, portsc: 0xe03
[ 8316.261302] hub 8-1:1.0: hub_suspend
[ 8316.262137] xhci_hcd 0000:07:00.0: Set port 8-1 link state, portsc: 0xe03, write 0x10e61

# hub 2 is resumend, inspected and the device enabled
[ 8316.270925] usb 8-2: usb wakeup-resume
[ 8316.270950] xhci_hcd 0000:07:00.0: Get port status 8-2 read: 0xe03, return 0x503
[ 8316.272785] usb 8-1: usb auto-suspend, wakeup 1
[ 8316.282855] usb 8-2: Waited 0ms for CONNECT
[ 8316.282867] usb 8-2: finish resume
[ 8316.283835] hub 8-2:1.0: hub_resume
[ 8316.284504] usb 8-2-port1: status 0301 change 0001
[ 8316.391951] usb usb8-port2: resume, status 0
[ 8316.391985] hub 8-2:1.0: state 7 ports 4 chg 0002 evt 0000
[ 8316.392650] usb 8-2-port1: status 0301, change 0000, 1.5 Mb/s
[ 8316.393099] usb 8-2-port1: indicator auto status 0
[ 8316.447829] xhci_hcd 0000:07:00.0: xhci_hub_status_data: stopping usb8 port polling
[ 8316.457913] usb 8-2.1: new low-speed USB device number 46 using xhci_hcd

# (not shown): hub 1 works normally, including wake on connection

Regards,
Michal

      parent reply	other threads:[~2026-11-23 11:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  7:23 [PATCH RESEND] xhci: Handle missing USB2 resume events on Etron hosts Kuangyi Chiang
2026-11-23  7:30 ` sashiko-bot
2026-11-23 11:23 ` Michal Pecio [this message]

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=20261123122343.6d3f8866.michal.pecio@gmail.com \
    --to=michal.pecio@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ki.chiang65@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.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