Skip to contentSkip to conversation

Suspend/Wake Numlock Handling and Unintended Rewakes

DISCUSSION Richard Aghassibake 1 participant 1 message Nov 28 HID

lore
Share & tools
lore
#0 lore raw

Hello,

I have recently been digging into an issue with a Fedora system that repeatedly wakes itself immediately after entering suspend. I have traced the root cause of the issue to an interaction between the keyboard's numlock behavior and the kernel's suspend actions.

In short, the keyboard echoes its lock state any time the lock state changes.  This is in support of software functionality to read and display the lock state on the host.  When the kernel calls a suspend, it fires a routine that disables a number of lock keys (numlock, capslock, scroll lock) as part of a process to turn off their associated LEDs.

When the suspend fires, the keyboard echoes the lock state change, which unsuspends the keyboard device and wakes the host. The echo on lock state is intended by the keyboard manufacturer since it hooks their software to provide lock state awareness on keyboards that do not have LEDs to indicate lock state.

While I understand the logic of wanting to turn off lights when the host is suspended, it seems like this is one of many potentially unintended interactions that might occur from changing a lock state as a means to turn off an LED.

Given the proliferation of LED-'enhanced' devices and software to integrate with them, and the increasing complexity of those devices and their associated functions, it seems probable that this will become more likely in the future.

I recommend adding parameters to allow the lock state behavior on suspend to be controlled more granularly, allowing such interactions to be avoided by inhibiting the lock state change. While the lock state change is itself not problematic, unexpected driver integrations by hardware manufacturers appear to have rendered it somewhat fragile.

Please let me know if any additional information is required to support this recommendation.

Thank you,

Richard Aghassibake