Linus Torvalds Questions The Not So Glorious Driver For That Funky Looking RGB Mouse

Written by Michael Larabel in Hardware on 3 April 2020 at 07:40 AM EDT. 25 Comments
HARDWARE
Last month I noted a new Linux driver for a buggy and funky looking mouse. A special driver was created by a community developer due to not all the mice button working otherwise due to not abiding by HID specifications. Now that the driver was merged for Linux 5.7, Linus Torvalds had words to share on this open-source driver.

The hid-glorious driver is a basic HID Linux driver needed for PC Gaming Race's Glorious mice of at least some different models. Their HID behavior is not following spec resulting in some mouse buttons not working. This isn't some knock-off super cheap mouse either but the Glorious Model O for instance retails for $50 USD.


When Linux creator Linus Torvalds saw this driver as part of the HID changes for the ongoing Linux 5.7 merge window, he decided to comment on it. Additionally, questioning whether the generic HID Linux driver should be more robust for dealing with hardware like the Glorious mice as presumably the Windows driver works fine without any special quirks/drivers for non-compliant hardware like these products. Linus wrote:
What a glorious name for a piece of hardware. Even if it's apparently buggy and needs help to work right.

I felt bad saying I don't need that glorious driver when doing my oldconfig.

Anyway, because I noticed this due to the name, it does strike me that clearly Windows must be ignoring - or otherwise reacting differently to - the HID_MAIN_ITEM_CONSTANT flag. Because presumably those mice work under Windows without special drivers?

In fact, reading that driver, it looks like they report being *both* constant *and* variable in their report descriptors. Which sounds odd. Maybe we should do whatever Windows does, and not need a special driver for this maybe-bot-so-glorious-after-all mouse hardware?

Hmm?

The HID-Glorious driver isn't the first time a basic driver needed to be written for Linux to deal with quirky/non-compliant hardware. In response the HID subsystem maintainer Jiri Kosina of SUSE commented on the Linux driver behavior and not being sure at this point how the Windows driver behaves.

Red Hat developer Ben Tissoires followed up as well in that email thread with, "I'll need to check whether we have too many drivers that replace constant by variable. But I know it bit us in the past a few times (and the Surface covers are the ones I remember). But again, Windows is weird in a lot of ways, and I believe that they do not have one unified driver for everything, but some behaviour that depends on the application. So I am a little bit hesitant to toggle the switch to consider constant usages as variable ones. Luckily, we now have a regression test suite. It's not complete, but it can prevent such regressions with the devices we have in there."
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