Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux: Enable kernel config option for raw HID devices #63142

Merged
merged 1 commit into from
Jun 19, 2019
Merged

linux: Enable kernel config option for raw HID devices #63142

merged 1 commit into from
Jun 19, 2019

Conversation

duckfullstop
Copy link
Contributor

Motivation for this change

Uninterruptable Power Supplies (accessed via things like apcupsd and apctest) such as APC's USB models show up as HID devices, but are not explicitely HID devices (and need to be communicated to in RAW). Annoyingly, this requires a non-standard build flag to be set at kernel build time to get them to work, otherwise apcupsd just sits and complains about an unavailable UPS.

You also get some relevant scrollback in dmesg:

[  890.567023] usb 1-1.1.2: new low-speed USB device number 6 using dwc2
[  890.891728] hid-generic 0003:051D:0002.0002: device has no listeners, quitting
Things done

Set the USB_HIDDEV kernel build flag to yes. More information on this flag: https://cateee.net/lkddb/web-lkddb/USB_HIDDEV.html

I'm 99.9% confident that this won't have any adverse effect on any system; it's purely additive, and just exposes these devices on /dev/usb/hiddevX. The flag was added way back in 2.6.22 (and even earlier). Willing to be proved wrong.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

This flag allows for things like Uninterruptable Power Supplies to work properly. See https://cateee.net/lkddb/web-lkddb/USB_HIDDEV.html for more information.
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 501+ 10.rebuild-linux: 1001-2500 labels Jun 14, 2019
@teto
Copy link
Member

teto commented Jun 15, 2019

it's good practice to compare against other distributions. Is it enabled on debian/ubuntu for instance ?

@duckfullstop
Copy link
Contributor Author

it's good practice to compare against other distributions. Is it enabled on debian/ubuntu for instance ?

Here it is in Debian: https://salsa.debian.org/kernel-team/linux/blob/master/debian/config/config#L940

And in Ubuntu: https://kernel.ubuntu.com/git/ubuntu/ubuntu-cosmic.git/tree/arch/x86/configs/x86_64_defconfig#n242

And in CentOS: https://git.centos.org/rpms/kernel/blob/c7/f/SOURCES/kernel-3.10.0-x86_64.config#_4672

(It may be worth trawling some of these default configs at some point in the future to see if it would be beneficial enabling / allowing easy enablement of other flags)

@teto teto merged commit d81797a into NixOS:master Jun 19, 2019
@duckfullstop duckfullstop deleted the kernel-usbhiddev-pls branch June 25, 2019 15:08
@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 501+ 10.rebuild-linux: 1001-2500 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants