Bug Fixed: Bad Things Could Happen Unplugging Your External Backlit Keyboard On Linux

Written by Michael Larabel in Hardware on 4 June 2019 at 09:33 AM EDT. 18 Comments
HARDWARE
If you have an external keyboard that features a backlight, particularly on some gaming keyboards, some issues can come up with the current Linux stack if you unplug the keyboard.

There is no shortage of LED backlit/illuminated keyboards in the gaming segment and fortunately laptop keyboards aren't impacted but there was a rather awkward UPower bug that is now resolved in the latest Git code. UPower is the common power management abstraction layer on Linux systems used by most desktop distributions out there but had one oversight when it came to its keyboard backlight power management code.

Up until the newest code today, if you had an external keyboard with a backlight and unplugged it, a UPower function would get infinitely called and thus begin up using 100% CPU usage. Additionally, if running on the GNOME desktop, D-Bus events would get endlessly created and that would make GNOME Shell ultimately unresponsive. This only affects external keyboards with backlight functionality.

Fortunately, a small patch addresses the issue for the next release of UPower.
If an external keyboard with a backlight gets unplugged then up_kbd_backlight_event_io would constantly get called, burning 100% CPU.

To make things worse, up_kbd_backlight_event_io would also constantly post DBUS events, causing gnome-shell to also become very unresponsive.

This commit fixes this by returning FALSE from up_kbd_backlight_event_io on unplug.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week