Public bug reported:

With NumLock on, the system wakes up from suspend-to-RAM a few seconds
after entering S3, or aborts S3 entry with "Wakeup pending. Abort CPU
freeze". The wake source is a Logi Bolt receiver with an MX Keys S
keyboard. A usbmon capture shows that the wakeup is triggered by the
keyboard's reply to the LED change that the kernel itself sends during
suspend.

System
- Ubuntu 26.04.1 LTS, kernel 7.0.0-43-generic (Ubuntu 7.0.0-43.43-generic 
7.0.14)
- ASUS ROG Strix B650E-F (BIOS 4004), Ryzen 7 9700X, S3 (mem_sleep = deep)
- Logi Bolt receiver 046d:c548 on CPU xHCI 0000:0c:00.4 (behind on-board 
ASM107x hub)
- Paired device: MX Keys S (WPID B378, HID++ 4.5, firmware RBK 81.01.B0015)
- Receiver power/wakeup = enabled (default)
- Display on AMD iGPU (amdgpu), NVIDIA RTX 4060 with nvidia-driver-595-open 
loaded

Sequence (usbmon on bus 5, receiver = dev 3)
1. "PM: suspend entry (deep)"
2. pm_prepare_console() switches to the suspend console (the NVIDIA driver 
registers pm_vt_switch_required(dev, true)); keyboard LEDs follow tty63 -> 
SET_REPORT output report 00 (NumLock LED off) to the receiver.
3. USB devices are suspended: interrupt URBs killed, SET_FEATURE 
DEVICE_REMOTE_WAKEUP, hub port suspend.
4. 0.7-10 s later the idle keyboard answers with a HID++ 2.0 event on interface 
2: "11 01 0e 00 ..." - feature index 0x0e = LOCK KEY STATE (0x4220), function 0 
/ sw id 0 (unsolicited notification).
5. The receiver signals remote wakeup -> hub port C_SUSPEND -> PME on root port 
0000:00:08.1 -> "PM: Triggering wakeup from IRQ 30" -> the system resumes and 
the notification is delivered.

With the suspend console set to NumLock on ("setleds -D +num <
/dev/tty63") the early report from the VT switch disappears, but
input_dev_suspend() -> input_dev_toggle(dev, false) sends the same LED-
off report while the USB devices are being suspended (between the URB
kills of the receiver), and the same wakeup follows ~6.5 s later.

With NumLock off before suspend no LED report is sent, no notification
arrives, and the system stays asleep until a key is pressed.

Already tried
- usbhid.quirks=0x046d:0xc548:0x400 (HID_QUIRK_ALWAYS_POLL, as in upstream 
commit d4229fc0cb50 "HID: quirks: Set ALWAYS_POLL for LOGITECH_BOLT_RECEIVER", 
which is not in 7.0.0-43): quirk active, no change - the URBs are killed on 
system suspend regardless.
- The problem depends on timing: with the monitor on the NVIDIA dGPU the same 
setup did not wake up; with the monitor on the AMD iGPU it wakes up reliably. 
The device suspend order apparently decides whether the LED report reaches the 
keyboard (and its reply arrives) before the receiver is suspended.

Workaround
A oneshot service before sleep.target that switches the NumLock LED off itself 
(/sys/class/leds/inputN::numlock/brightness), waits on the receiver's hidraw 
nodes for the keyboard's LOCK KEY STATE notification and only then lets suspend 
continue (LED restored after resume). With it the keyboard acknowledges the LED 
change within ~0.5 s while USB is still active, no LED report is sent during 
suspend anymore, and the system stays in S3 until a key is pressed (remote 
wakeup from the keyboard still works).

Expected: suspend holds with NumLock on and keyboard wakeup enabled.
Actual: immediate/spontaneous wakeup.

Possible fixes
- input_dev_suspend() could avoid sending LED output reports to devices that 
are wakeup sources (or are already being suspended).
- hid-logitech-hidpp / hid-logitech-dj could keep a host-initiated LED change 
from producing a notification that triggers remote wakeup.

--
Investigated and drafted with the help of Claude (Anthropic's AI assistant, 
Claude Opus 5.5); reviewed and submitted by the reporter.

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  With NumLock on, the system wakes up from suspend-to-RAM a few seconds
  after entering S3, or aborts S3 entry with "Wakeup pending. Abort CPU
  freeze". The wake source is a Logi Bolt receiver with an MX Keys S
  keyboard. A usbmon capture shows that the wakeup is triggered by the
  keyboard's reply to the LED change that the kernel itself sends during
  suspend.
  
  System
  - Ubuntu 26.04.1 LTS, kernel 7.0.0-43-generic (Ubuntu 7.0.0-43.43-generic 
7.0.14)
  - ASUS ROG Strix B650E-F (BIOS 4004), Ryzen 7 9700X, S3 (mem_sleep = deep)
  - Logi Bolt receiver 046d:c548 on CPU xHCI 0000:0c:00.4 (behind on-board 
ASM107x hub)
  - Paired device: MX Keys S (WPID B378, HID++ 4.5, firmware RBK 81.01.B0015)
  - Receiver power/wakeup = enabled (default)
  - Display on AMD iGPU (amdgpu), NVIDIA RTX 4060 with nvidia-driver-595-open 
loaded
  
  Sequence (usbmon on bus 5, receiver = dev 3)
  1. "PM: suspend entry (deep)"
  2. pm_prepare_console() switches to the suspend console (the NVIDIA driver 
registers pm_vt_switch_required(dev, true)); keyboard LEDs follow tty63 -> 
SET_REPORT output report 00 (NumLock LED off) to the receiver.
  3. USB devices are suspended: interrupt URBs killed, SET_FEATURE 
DEVICE_REMOTE_WAKEUP, hub port suspend.
  4. 0.7-10 s later the idle keyboard answers with a HID++ 2.0 event on 
interface 2: "11 01 0e 00 ..." - feature index 0x0e = LOCK KEY STATE (0x4220), 
function 0 / sw id 0 (unsolicited notification).
  5. The receiver signals remote wakeup -> hub port C_SUSPEND -> PME on root 
port 0000:00:08.1 -> "PM: Triggering wakeup from IRQ 30" -> the system resumes 
and the notification is delivered.
  
  With the suspend console set to NumLock on ("setleds -D +num <
  /dev/tty63") the early report from the VT switch disappears, but
  input_dev_suspend() -> input_dev_toggle(dev, false) sends the same LED-
  off report while the USB devices are being suspended (between the URB
  kills of the receiver), and the same wakeup follows ~6.5 s later.
  
  With NumLock off before suspend no LED report is sent, no notification
  arrives, and the system stays asleep until a key is pressed.
  
  Already tried
  - usbhid.quirks=0x046d:0xc548:0x400 (HID_QUIRK_ALWAYS_POLL, as in upstream 
commit d4229fc0cb50 "HID: quirks: Set ALWAYS_POLL for LOGITECH_BOLT_RECEIVER", 
which is not in 7.0.0-43): quirk active, no change - the URBs are killed on 
system suspend regardless.
  - The problem depends on timing: with the monitor on the NVIDIA dGPU the same 
setup did not wake up; with the monitor on the AMD iGPU it wakes up reliably. 
The device suspend order apparently decides whether the LED report reaches the 
keyboard (and its reply arrives) before the receiver is suspended.
  
  Workaround
  A oneshot service before sleep.target that switches the NumLock LED off 
itself (/sys/class/leds/inputN::numlock/brightness), waits on the receiver's 
hidraw nodes for the keyboard's LOCK KEY STATE notification and only then lets 
suspend continue (LED restored after resume). With it the keyboard acknowledges 
the LED change within ~0.5 s while USB is still active, no LED report is sent 
during suspend anymore, and the system stays in S3 until a key is pressed 
(remote wakeup from the keyboard still works).
  
  Expected: suspend holds with NumLock on and keyboard wakeup enabled.
  Actual: immediate/spontaneous wakeup.
  
  Possible fixes
  - input_dev_suspend() could avoid sending LED output reports to devices that 
are wakeup sources (or are already being suspended).
  - hid-logitech-hidpp / hid-logitech-dj could keep a host-initiated LED change 
from producing a notification that triggers remote wakeup.
+ 
+ --
+ Investigated and drafted with the help of Claude (Anthropic's AI assistant, 
Claude Opus 5.5); reviewed and submitted by the reporter.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174611

Title:
  Logi Bolt keyboard (MX Keys S) wakes system from S3: LED-off report
  during suspend triggers HID++ LOCK KEY STATE notification

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2174611/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to