udev: add rule to keep USB HID input devices out of runtime PM - #257
Open
VECTORG99 wants to merge 1 commit into
Open
udev: add rule to keep USB HID input devices out of runtime PM#257VECTORG99 wants to merge 1 commit into
VECTORG99 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
usr/lib/udev/rules.d/75-usb-hid-pm.rules, which disables USB runtime PM (autosuspend) for external, removable HID input devices so they stay fully awake while in use.Rationale
High-polling-rate input devices (gaming mice, fast keyboards, etc.) can suffer from measurable input latency and occasional missed events when their USB link autosuspend engages. CachyOS already favors performance over power draw in its existing udev rules (
20-audio-pm,50-sata,69-hdparm), so keeping external input devices out of runtime PM is consistent with that stance.Scope
The rule matches only external, removable HID interfaces:
ATTR{bInterfaceClass}=="03"— HID class, matched on the USB interface device.ATTRS{removable}=="removable"— only devices whose USB parent is flagged removable. Internal keyboards/touchpads reportfixed(orunknown) and stay on autosuspend.TEST=="../power/control"— guard for hosts/controllers without apower/controlattribute; the rule is a no-op there.ATTR{../power/control}="on"— writes the parent USB device's runtime PM control (the interface itself has nopower/control; the../relative path is the same mechanism used by upstream udev's42-usb-hid-pm.rules).Formatting follows the repo's existing multi-line backslash style (see
71-nvidia.rules,50-sata.rules).Verification
04D9:FC5Fmouse exposesbInterfaceClass=03on its interface andremovable="removable"on the USB device.../relative-path mechanism was cross-checked against the upstream udev reference rule (42-usb-hid-pm.rules) andudevadm verifypasses on the rule file.udevadm test --action=addon target hardware is still recommended in CI before merge (it requires the rule to be installed in arules.ddirectory).