Skip to content

udev: add rule to keep USB HID input devices out of runtime PM - #257

Open
VECTORG99 wants to merge 1 commit into
CachyOS:masterfrom
VECTORG99:usb-hid-runtime-pm
Open

udev: add rule to keep USB HID input devices out of runtime PM#257
VECTORG99 wants to merge 1 commit into
CachyOS:masterfrom
VECTORG99:usb-hid-runtime-pm

Conversation

@VECTORG99

@VECTORG99 VECTORG99 commented Aug 20, 2026

Copy link
Copy Markdown

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 report fixed (or unknown) and stay on autosuspend.
  • TEST=="../power/control" — guard for hosts/controllers without a power/control attribute; the rule is a no-op there.
  • ATTR{../power/control}="on" — writes the parent USB device's runtime PM control (the interface itself has no power/control; the ../ relative path is the same mechanism used by upstream udev's 42-usb-hid-pm.rules).

Formatting follows the repo's existing multi-line backslash style (see 71-nvidia.rules, 50-sata.rules).

Verification

  • Attribute values verified on real hardware: a Holtek 04D9:FC5F mouse exposes bInterfaceClass=03 on its interface and removable="removable" on the USB device.
  • The ../ relative-path mechanism was cross-checked against the upstream udev reference rule (42-usb-hid-pm.rules) and udevadm verify passes on the rule file.
  • A full end-to-end udevadm test --action=add on target hardware is still recommended in CI before merge (it requires the rule to be installed in a rules.d directory).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant