Skip to content

USB devices are no longer present after waking from suspend #497

@mjm

Description

@mjm

Machine model: Apple MacBook Pro (16-inch, M2 Max, 2023)
Linux version 6.19.14
Distro: NixOS

Whenever I suspend my MacBook, any USB devices plugged in to it are not usable after waking the system. Mostly this comes up with the YubiKey that I keep connected to it, but I also tested a flash drive and it had the same behavior. If I disconnect a device and reconnect it, then I can use again until I suspend again.

In the kernel logs I see these messages on resume:

May 13 19:40:23 athena kernel: xhci-hcd xhci-hcd.0.auto: xHC error in resume, USBSTS 0x401, Reinit
May 13 19:40:23 athena kernel: usb usb1: root hub lost power or was reset
May 13 19:40:23 athena kernel: usb usb2: root hub lost power or was reset

xhci-hcd.0.auto appears to be the relevant host controller for the device that is plugged in:

May 13 19:31:14 athena kernel: xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
May 13 19:31:14 athena kernel: xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
May 13 19:31:14 athena kernel: xhci-hcd xhci-hcd.0.auto: hcc params 0x0238ffcd hci version 0x110 quirks 0x0000808000000010
May 13 19:31:14 athena kernel: xhci-hcd xhci-hcd.0.auto: irq 122, io mem 0x702280000
May 13 19:31:14 athena kernel: xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
May 13 19:31:14 athena kernel: xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
May 13 19:31:14 athena kernel: xhci-hcd xhci-hcd.0.auto: Host supports USB 3.1 Enhanced SuperSpeed
May 13 19:31:14 athena kernel: hub 1-0:1.0: USB hub found
May 13 19:31:14 athena kernel: hub 1-0:1.0: 1 port detected
May 13 19:31:14 athena kernel: usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
May 13 19:31:14 athena kernel: hub 2-0:1.0: USB hub found
May 13 19:31:14 athena kernel: hub 2-0:1.0: 1 port detected
May 13 19:31:14 athena kernel: usb 1-1: new full-speed USB device number 2 using xhci-hcd
May 13 19:31:14 athena kernel: input: Yubico YubiKey OTP+FIDO+CCID as /devices/platform/soc/702280000.usb/xhci-hcd.0.auto/usb1/1-1/1-1:1.0/0003:1050:0407.0006/input/input7
May 13 19:31:14 athena kernel: hid-generic 0003:1050:0407.0006: input,hidraw2: USB HID v1.10 Keyboard [Yubico YubiKey OTP+FIDO+CCID] on usb-xhci-hcd.0.auto-1/input0
May 13 19:31:14 athena kernel: hid-generic 0003:1050:0407.0007: hiddev96,hidraw3: USB HID v1.10 Device [Yubico YubiKey OTP+FIDO+CCID] on usb-xhci-hcd.0.auto-1/input1

And then when I disconnect and reconnect the device, I see these messages:

May 13 19:40:40 athena kernel: macsmc-power macsmc-power: Port 1 state change (charge port: 2)
May 13 19:40:40 athena kernel: macsmc-power macsmc-power: Connector event: Port 1 (status 0x02)
May 13 19:40:40 athena kernel: macsmc-power macsmc-power: Connector event: Port 1 (status 0x03)
May 13 19:40:40 athena kernel: macsmc 2a2400000.smc: RTKit: syslog message: aceElec.cpp:708:         Elec: Elec Cause 0x0
May 13 19:40:40 athena kernel: macsmc-power macsmc-power: Connector event: Port 1 (status 0x05)
May 13 19:40:41 athena kernel: xhci-hcd xhci-hcd.0.auto: remove, state 4
May 13 19:40:41 athena kernel: usb usb2: USB disconnect, device number 1
May 13 19:40:41 athena kernel: xhci-hcd xhci-hcd.0.auto: USB bus 2 deregistered
May 13 19:40:41 athena kernel: xhci-hcd xhci-hcd.0.auto: remove, state 4
May 13 19:40:41 athena kernel: usb usb1: USB disconnect, device number 1
May 13 19:40:41 athena kernel: xhci-hcd xhci-hcd.0.auto: Host halt failed, -110
May 13 19:40:41 athena kernel: xhci-hcd xhci-hcd.0.auto: Host controller not halted, aborting reset.
May 13 19:40:41 athena kernel: xhci-hcd xhci-hcd.0.auto: USB bus 1 deregistered
May 13 19:40:45 athena kernel: macsmc-power macsmc-power: Port 1 state change (charge port: 2)
May 13 19:40:45 athena kernel: macsmc-power macsmc-power: Connector event: Port 1 (status 0x05)
May 13 19:40:45 athena kernel: xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
May 13 19:40:45 athena kernel: xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
May 13 19:40:45 athena kernel: xhci-hcd xhci-hcd.0.auto: hcc params 0x0238ffcd hci version 0x110 quirks 0x0000808000000010
May 13 19:40:45 athena kernel: xhci-hcd xhci-hcd.0.auto: irq 122, io mem 0x702280000
May 13 19:40:45 athena kernel: xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
May 13 19:40:45 athena kernel: xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
May 13 19:40:45 athena kernel: xhci-hcd xhci-hcd.0.auto: Host supports USB 3.1 Enhanced SuperSpeed
May 13 19:40:45 athena kernel: hub 1-0:1.0: USB hub found
May 13 19:40:45 athena kernel: hub 1-0:1.0: 1 port detected
May 13 19:40:45 athena kernel: usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
May 13 19:40:45 athena kernel: hub 2-0:1.0: USB hub found
May 13 19:40:45 athena kernel: hub 2-0:1.0: 1 port detected
May 13 19:40:45 athena kernel: usb 1-1: new full-speed USB device number 2 using xhci-hcd
May 13 19:40:46 athena kernel: input: Yubico YubiKey OTP+FIDO+CCID as /devices/platform/soc/702280000.usb/xhci-hcd.0.auto/usb1/1-1/1-1:1.0/0003:1050:0407.0008/input/input10
May 13 19:40:46 athena kernel: hid-generic 0003:1050:0407.0008: input,hidraw2: USB HID v1.10 Keyboard [Yubico YubiKey OTP+FIDO+CCID] on usb-xhci-hcd.0.auto-1/input0
May 13 19:40:46 athena kernel: hid-generic 0003:1050:0407.0009: hiddev96,hidraw3: USB HID v1.10 Device [Yubico YubiKey OTP+FIDO+CCID] on usb-xhci-hcd.0.auto-1/input1

I tried updating m1n1 and recopying the peripheral firmware using the Asahi Installer, but neither of these fixed the issue. Please let me know if there is any other information that would be useful here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions