Re: [PATCH RESEND] xhci: Handle missing USB2 resume events on Etron hosts

From: Kuangyi Chiang

Date: Tue Nov 24 2026 - 20:33:58 EST


Hi,

Thanks for testing and sharing the detailed logs.

Michal Pecio <michal.pecio@xxxxxxxxx> 於 2026年11月23日週一 下午7:23寫道:
>
> This repro doesn't seem to work for me.
> [...]

I tested again on an EJ188 with three USB2 hubs connected, without the
proposed fix but with extra local debug messages to detect ports that
are in the resume state without a Port Status Change Event.

When I connected the first mouse to hub 3, I saw the same behavior as
in your test: the USB core checked all root hub ports, and all three
hubs completed resume (evt 000e).

However, when I connected a second mouse to hub 2, the root hub was
already active. Port 1 also entered the resume state without an event,
but only port 2 was reported in the status bitmap (evt 0004).

Both mice worked, but a third mouse connected to hub 1 had no effect.

So the issue seems to occur when another suspended port enters the
resume state while the root hub is already active.

Here are the test logs:

02:00.0 USB controller: Etron Technology, Inc. EJ188/EJ198 USB 3.0
Host Controller
/: Bus 005.Port 001: Dev 001, Class=root_hub, Driver=xhci_hcd/4p, 480M
|__ Port 001: Dev 004, If 0, Class=Hub, Driver=hub/7p, 480M
|__ Port 002: Dev 005, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 003: Dev 006, If 0, Class=Hub, Driver=hub/4p, 480M

# connecting a mouse to hub 3 resumes the bus:
[ 3613.057015] xhci_hcd 0000:02:00.0: Port change event, 5-3, id 3,
portsc: 0xc400fe3
[ 3613.057091] xhci_hcd 0000:02:00.0: resume root hub
[ 3613.057106] xhci_hcd 0000:02:00.0: port resume event for port 3
[ 3613.057114] xhci_hcd 0000:02:00.0: resume HS port 3
[ 3613.057122] xhci_hcd 0000:02:00.0: USB2 port 1 resumed without
event, portsc: 0xc000fe3
[ 3613.057129] xhci_hcd 0000:02:00.0: USB2 port 2 resumed without
event, portsc: 0xc000fe3
[ 3613.057170] usb usb5: usb wakeup-resume
[ 3613.057184] usb usb5: usb auto-resume
[ 3613.057206] hub 5-0:1.0: hub_resume

# core checks all RH ports; ports 1, 2 and 3 are resuming:
[ 3613.057221] xhci_hcd 0000:02:00.0: Get port status 5-1 read: 0xfe3,
return 0x507
[ 3613.057269] usb usb5-port1: status 0507 change 0000
[ 3613.057284] xhci_hcd 0000:02:00.0: Get port status 5-2 read: 0xfe3,
return 0x507
[ 3613.057317] usb usb5-port2: status 0507 change 0000
[ 3613.057331] xhci_hcd 0000:02:00.0: Get port status 5-3 read: 0xfe3,
return 0x507
[ 3613.057361] usb usb5-port3: status 0507 change 0000
[ 3613.057376] xhci_hcd 0000:02:00.0: Get port status 5-4 read: 0x2a0,
return 0x100
[ 3613.057416] hub 5-0:1.0: state 7 ports 4 chg 0000 evt 0000
[ 3613.057728] hub 5-0:1.0: state 7 ports 4 chg 0000 evt 0000
[ 3613.295602] hub 5-0:1.0: state 7 ports 4 chg 0000 evt 000e

# hub 1 is resumed, inspected and suspended again
[ 3613.295628] xhci_hcd 0000:02:00.0: resume USB2 port 5-1
[ 3613.295639] xhci_hcd 0000:02:00.0: Set port 5-1 link state, portsc:
0xfe3, write 0x10e01
[ 3613.295743] xhci_hcd 0000:02:00.0: Port change event, 5-1, id 1,
portsc: 0x400e03
[ 3613.295774] xhci_hcd 0000:02:00.0: Get port status 5-1 read: 0xfe3,
return 0x40503
[ 3613.295819] xhci_hcd 0000:02:00.0: clear port1 suspend/resume
change, portsc: 0xe03
[ 3613.306530] usb 5-1: usb wakeup-resume
[ 3613.306558] xhci_hcd 0000:02:00.0: Get port status 5-1 read: 0xe03,
return 0x503
[ 3613.317615] usb 5-1: Waited 0ms for CONNECT
[ 3613.317626] usb 5-1: finish resume
[ 3613.318018] hub 5-1:1.0: hub_resume
[ 3613.320288] usb usb5-port1: resume, status 0
[ 3613.320306] xhci_hcd 0000:02:00.0: resume USB2 port 5-2
[ 3613.320316] xhci_hcd 0000:02:00.0: Set port 5-2 link state, portsc:
0xfe3, write 0x10e01
[ 3613.320340] hub 5-1:1.0: state 7 ports 7 chg 0000 evt 0000
[ 3613.320381] hub 5-1:1.0: hub_suspend
[ 3613.321518] xhci_hcd 0000:02:00.0: Set port 5-1 link state, portsc:
0xe03, write 0x10e61

# hub 2 is resumed, inspected and suspended again
[ 3613.331561] usb 5-2: usb wakeup-resume
[ 3613.331592] xhci_hcd 0000:02:00.0: Get port status 5-2 read: 0xe03,
return 0x503
[ 3613.332562] usb 5-1: usb auto-suspend, wakeup 1
[ 3613.342518] usb 5-2: Waited 0ms for CONNECT
[ 3613.342532] usb 5-2: finish resume
[ 3613.343274] hub 5-2:1.0: hub_resume
[ 3613.345374] usb usb5-port2: resume, status 0
[ 3613.345393] xhci_hcd 0000:02:00.0: resume USB2 port 5-3
[ 3613.345403] xhci_hcd 0000:02:00.0: Set port 5-3 link state, portsc:
0xfe3, write 0x10e01
[ 3613.345427] hub 5-2:1.0: state 7 ports 4 chg 0000 evt 0000
[ 3613.345439] xhci_hcd 0000:02:00.0: Port change event, 5-3, id 3,
portsc: 0x400e03
[ 3613.345497] xhci_hcd 0000:02:00.0: Get port status 5-3 read: 0xfe3,
return 0x40503
[ 3613.345548] xhci_hcd 0000:02:00.0: clear port3 suspend/resume
change, portsc: 0xe03
[ 3613.347649] hub 5-2:1.0: hub_suspend
[ 3613.348842] xhci_hcd 0000:02:00.0: Set port 5-2 link state, portsc:
0xe03, write 0x10e61

# hub 3 is resumed, inspected and the device enabled
[ 3613.356604] usb 5-3: usb wakeup-resume
[ 3613.356628] xhci_hcd 0000:02:00.0: Get port status 5-3 read: 0xe03,
return 0x503
[ 3613.359576] usb 5-2: usb auto-suspend, wakeup 1
[ 3613.368504] usb 5-3: Waited 0ms for CONNECT
[ 3613.368515] usb 5-3: finish resume
[ 3613.368981] hub 5-3:1.0: hub_resume
[ 3613.370094] usb 5-3-port4: status 0101 change 0001
[ 3613.471650] usb usb5-port3: resume, status 0
[ 3613.471671] hub 5-3:1.0: state 7 ports 4 chg 0010 evt 0000
[ 3613.472020] usb 5-3-port4: status 0101, change 0000, 12 Mb/s
[ 3613.543564] xhci_hcd 0000:02:00.0: xhci_hub_status_data: stopping
usb5 port polling
[ 3613.544505] usb 5-3.4: new full-speed USB device number 7 using xhci_hcd

# connecting a second mouse to hub 2 resumes port 2:
[ 3622.523436] xhci_hcd 0000:02:00.0: Port change event, 5-2, id 2,
portsc: 0x400fe3
[ 3622.523492] xhci_hcd 0000:02:00.0: port resume event for port 2
[ 3622.523499] xhci_hcd 0000:02:00.0: resume HS port 2
[ 3622.523507] xhci_hcd 0000:02:00.0: USB2 port 1 resumed without
event, portsc: 0xfe3
[ 3622.564503] hub 5-0:1.0: state 7 ports 4 chg 0000 evt 0004
[ 3622.564530] xhci_hcd 0000:02:00.0: resume USB2 port 5-2
[ 3622.564541] xhci_hcd 0000:02:00.0: Set port 5-2 link state, portsc:
0xfe3, write 0x10e01
[ 3622.564651] xhci_hcd 0000:02:00.0: Port change event, 5-2, id 2,
portsc: 0x400e03
[ 3622.564684] xhci_hcd 0000:02:00.0: Get port status 5-2 read: 0xfe3,
return 0x40503
[ 3622.564744] xhci_hcd 0000:02:00.0: clear port2 suspend/resume
change, portsc: 0xe03

# hub 2 is resumed, inspected and the device enabled
[ 3622.575423] usb 5-2: usb wakeup-resume
[ 3622.575451] xhci_hcd 0000:02:00.0: Get port status 5-2 read: 0xe03,
return 0x503
[ 3622.586477] usb 5-2: Waited 0ms for CONNECT
[ 3622.586487] usb 5-2: finish resume
[ 3622.587310] hub 5-2:1.0: hub_resume
[ 3622.588566] usb 5-2-port2: status 0301 change 0001
[ 3622.695551] usb usb5-port2: resume, status 0
[ 3622.695573] hub 5-2:1.0: state 7 ports 4 chg 0004 evt 0000
[ 3622.696175] usb 5-2-port2: status 0301, change 0000, 1.5 Mb/s
[ 3622.696661] usb 5-2-port2: indicator auto status 0
[ 3622.773415] usb 5-2.2: new low-speed USB device number 8 using xhci_hcd

# connecting a third mouse to hub 1 has no effect

Regards,
Kuangyi