* [PATCH v2] xhci: Handle missing USB2 resume events on Etron hosts
@ 2026-11-27 1:54 Kuangyi Chiang
2026-11-27 1:59 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Kuangyi Chiang @ 2026-11-27 1:54 UTC (permalink / raw)
To: mathias.nyman, gregkh
Cc: michal.pecio, stern, linux-usb, linux-kernel, ki.chiang65
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. Disable autosuspend for the USB2 root hub by setting its
power/control to "on".
2. Connect two USB2 hubs to the Etron xHC.
3. Wait for both USB2 hubs to autosuspend.
4. Connect a mouse to one of the USB2 hubs.
5. Connect another mouse to the other hub. The second 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 whether
other USB2 ports are also in the resume state and track them so
normal resume handling can complete.
Before the patch, the root hub status bitmap reported only port 2
(evt 0004), leaving port 1 in the resume state.
[ 4928.200011] xhci_hcd 0000:02:00.0: Port change event, 5-2, id 2, portsc: 0x400fe3
[ 4928.200087] xhci_hcd 0000:02:00.0: port resume event for port 2
[ 4928.200095] xhci_hcd 0000:02:00.0: resume HS port 2
[ 4928.241196] hub 5-0:1.0: state 7 ports 4 chg 0000 evt 0004
[ 4928.369244] usb usb5-port2: resume, status 0
After the patch, the bitmap includes both ports (evt 0006), allowing
port 1 to complete the normal resume process.
[ 6277.946923] xhci_hcd 0000:02:00.0: Port change event, 5-2, id 2, portsc: 0x400fe3
[ 6277.946998] xhci_hcd 0000:02:00.0: port resume event for port 2
[ 6277.947005] xhci_hcd 0000:02:00.0: resume HS port 2
[ 6277.947013] xhci_hcd 0000:02:00.0: HS port 1 in resume without event, portsc: 0xfe3
[ 6277.987265] hub 5-0:1.0: state 7 ports 4 chg 0000 evt 0006
[ 6278.010733] usb usb5-port1: resume, status 0
[ 6278.145273] usb usb5-port2: resume, status 0
Tested on Etron EJ168 (1b6f:7023) and EJ188 (1b6f:7052) with root hub
autosuspend disabled.
Signed-off-by: Kuangyi Chiang <ki.chiang65@gmail.com>
---
Changes in v2:
- Update the reproduction steps and logs in the commit message.
The issue can be reproduced with root hub autosuspend disabled,
as reported by Michal Pecio.
- No code changes.
- Link to v1: https://lore.kernel.org/all/20261123072320.5967-1-ki.chiang65@gmail.com/
drivers/usb/host/xhci-ring.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index fffd901..c640952 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1997,6 +1997,39 @@ static void xhci_cavium_reset_phy_quirk(struct xhci_hcd *xhci)
} while (!(pll_lock_check & 0x1) && --retry_count);
}
+/*
+ * Etron xHCs may resume other suspended USB2 ports without generating
+ * individual Port Status Change Events. Track those ports so the normal
+ * USB2 resume handling can finish.
+ */
+static void xhci_handle_etron_usb2_resume(struct xhci_hcd *xhci)
+{
+ struct xhci_hub *rhub = &xhci->usb2_rhub;
+ struct xhci_bus_state *bus_state = &rhub->bus_state;
+ struct xhci_port *port;
+ unsigned int i;
+ u32 portsc;
+
+ for (i = 0; i < rhub->num_ports; i++) {
+ if (test_bit(i, &bus_state->resuming_ports))
+ continue;
+
+ port = rhub->ports[i];
+ portsc = xhci_portsc_readl(port);
+ if ((portsc & PORT_RESET) || !(portsc & PORT_PE))
+ continue;
+
+ if ((portsc & PORT_PLS_MASK) == XDEV_RESUME) {
+ xhci_dbg(xhci, "HS port %d in resume without event, portsc: 0x%x\n",
+ port->hw_portnum + 1, portsc);
+ port->resume_timestamp = jiffies +
+ msecs_to_jiffies(USB_RESUME_TIMEOUT);
+ set_bit(i, &bus_state->resuming_ports);
+ usb_hcd_start_port_resume(&rhub->hcd->self, i);
+ }
+ }
+}
+
static void handle_port_status(struct xhci_hcd *xhci, union xhci_trb *event)
{
struct xhci_virt_device *vdev = NULL;
@@ -2103,6 +2136,8 @@ static void handle_port_status(struct xhci_hcd *xhci, union xhci_trb *event)
mod_timer(&hcd->rh_timer,
port->resume_timestamp);
usb_hcd_start_port_resume(&hcd->self, hcd_portnum);
+ if (xhci->quirks & XHCI_ETRON_HOST)
+ xhci_handle_etron_usb2_resume(xhci);
bogus_port_status = true;
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] xhci: Handle missing USB2 resume events on Etron hosts
2026-11-27 1:54 [PATCH v2] xhci: Handle missing USB2 resume events on Etron hosts Kuangyi Chiang
@ 2026-11-27 1:59 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-27 1:59 UTC (permalink / raw)
To: Kuangyi Chiang; +Cc: linux-usb
> 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. Disable autosuspend for the USB2 root hub by setting its
> power/control to "on".
> 2. Connect two USB2 hubs to the Etron xHC.
> 3. Wait for both USB2 hubs to autosuspend.
> 4. Connect a mouse to one of the USB2 hubs.
> 5. Connect another mouse to the other hub. The second mouse
> does not work.
>
> The affected USB2 ports may remain in the resume state, preventing
> [ ... ]
>
> Tested on Etron EJ168 (1b6f:7023) and EJ188 (1b6f:7052) with root hub
> autosuspend disabled.
>
> Signed-off-by: Kuangyi Chiang <ki.chiang65@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261127015407.3937-1-ki.chiang65@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-27 1:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 1:54 [PATCH v2] xhci: Handle missing USB2 resume events on Etron hosts Kuangyi Chiang
2026-11-27 1:59 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox