Re: USB: workqueues stuck in 'D' state?

Michał Pecio
2024-12-09T23:27:35Z

OK, I have no idea if it's the same bug or merely similar, but:

Linux v6.13-rc1. My hardware currently seems to insists that there is
overcurrent on all ports. It's an ASMedia chip, so nothing shocking.
This drives Linux nuts and it repeatedly hammers on hub_suspend() and
hub_resume(), apparently in a fairly tight loop, with no end in sight.

I have also seen short bursts of the same a few times while unplugging
some device from two ASMedia controllers (and not from one other HC),
but they stopped after a second. Maybe the HW came back to sanity?

It looks like something is very eager to retry things.

This shows up upon reloading xhci_hcd:

[613292.598841] usb usb8-port1: over-current condition
[613292.726843] usb usb8-port2: over-current condition
[613292.761832] usb usb9-port1: over-current condition
[613292.969830] usb usb9-port2: over-current condition

One core at 100% and junk like this repeats forever with dynamic debug:

[ +0.000001] hub 8-0:1.0: hub_resume
[ +0.000007] xhci_hcd 0000:02:00.0: Get port status 8-2 read: 0x288, return 0x108
[ +0.000005] hub 8-0:1.0: state 7 ports 2 chg 0006 evt 0000
[ +0.000006] usb usb8-port1: status 0108, change 0000, 12 Mb/s
[ +0.000003] xhci_hcd 0000:02:00.0: Get port status 8-2 read: 0x288, return 0x108
[ +0.000004] usb usb8-port2: status 0108, change 0000, 12 Mb/s
[ +0.000002] hub 8-0:1.0: hub_suspend
[ +0.000003] usb usb8: bus auto-suspend, wakeup 1
[ +0.000003] xhci_hcd 0000:02:00.0: Bus suspend bailout, port over-current detected
[ +0.000001] usb usb8: bus suspend fail, err -16
[ +0.000008] xhci_hcd 0000:02:00.0: Get port status 8-2 read: 0x288, return 0x108
[ +0.000004] hub 8-0:1.0: state 7 ports 2 chg 0006 evt 0000
[ +0.000003] xhci_hcd 0000:02:00.0: Get port status 8-1 read: 0x288, return 0x108
[ +0.000004] usb usb8-port1: status 0108, change 0000, 12 Mb/s
[ +0.000007] usb usb8-port2: status 0108, change 0000, 12 Mb/s
[ +0.000002] hub 8-0:1.0: hub_suspend
[ +0.000006] xhci_hcd 0000:02:00.0: Bus suspend bailout, port over-current detected
[ +0.000004] xhci_hcd 0000:02:00.0: Get port status 8-1 read: 0x288, return 0x108
[ +0.000009] hub 8-0:1.0: state 7 ports 2 chg 0006 evt 0000
[ +0.000003] xhci_hcd 0000:02:00.0: Get port status 8-1 read: 0x288, return 0x108
[ +0.000004] usb usb8-port1: status 0108, change 0000, 12 Mb/s
[ +0.000006] usb usb8-port2: status 0108, change 0000, 12 Mb/s
[ +0.000003] hub 8-0:1.0: hub_suspend
[ +0.000003] usb usb8: bus auto-suspend, wakeup 1
[ +0.000002] xhci_hcd 0000:02:00.0: Bus suspend bailout, port over-current detected
[ +0.000002] usb usb8: bus suspend fail, err -16
[ +0.000001] hub 8-0:1.0: hub_resume
[ +0.000007] xhci_hcd 0000:02:00.0: Get port status 8-2 read: 0x288, return 0x108
[ +0.000004] hub 8-0:1.0: state 7 ports 2 chg 0006 evt 0000
[ +0.000007] usb usb8-port1: status 0108, change 0000, 12 Mb/s
[ +0.000003] xhci_hcd 0000:02:00.0: Get port status 8-2 read: 0x288, return 0x108
[ +0.000003] usb usb8-port2: status 0108, change 0000, 12 Mb/s
[ +0.000003] hub 8-0:1.0: hub_suspend

Stack traces are similar: pm workqueue -> usbcore -> xhci.

Regards,
Michal