Skip to content

steam-input.rules: Only enable wakeup if the attribute exists#85

Open
smcv wants to merge 1 commit into
ValveSoftware:masterfrom
smcv:dont-wake-me-up
Open

steam-input.rules: Only enable wakeup if the attribute exists#85
smcv wants to merge 1 commit into
ValveSoftware:masterfrom
smcv:dont-wake-me-up

Conversation

@smcv

@smcv smcv commented Jun 12, 2026

Copy link
Copy Markdown

Not all USB device nodes have this attribute, so only enable it if it's there to be enabled. This avoids errors in the system log, like:

(udev-worker)[6167]: 1-9:1.0: /usr/lib/udev/rules.d/60-steam-input.rules:17 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9:1.0/power/wakeup}, ignoring: No such file or directory

(in this case when plugging in a Steam Controller (2015) USB dongle)

steamrt/tasks#948

Not all USB device nodes have this attribute, so only enable it if it's
there to be enabled. This avoids errors in the system log, like:

`(udev-worker)[6167]: 1-9:1.0:
/usr/lib/udev/rules.d/60-steam-input.rules:17 Failed to write
ATTR{/sys/devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9:1.0/power/wakeup},
ignoring: No such file or directory`

(in this case when plugging in a Steam Controller (2015) USB dongle)

steamrt/tasks#948

Signed-off-by: Simon McVittie <smcv@collabora.com>
@Plagman

Plagman commented Jun 16, 2026

Copy link
Copy Markdown
Member

The Steam Controller 2015 dongle does support wakeup, so I wonder why that's not showing up? Is it disabled system-wide in this case?

@smcv

smcv commented Jun 16, 2026

Copy link
Copy Markdown
Author

udev is notified about a single dongle several times, once for the USB device itself, plus one each for several logical devices representing USB endpoints, raw HID device nodes and evdev devices (ep_XX, hidrawXX, hiddevXX). They all match ATTRS{idVendor}=="28de" because ATTRS looks at the attributes of the current device plus the attributes of any single ancestor, and the physical USB device is an ancestor of all of the logical devices. We rely on that behaviour when setting permissions (MODE and TAG) in another rule: the rule matches the attributes of the USB device, but we want to set the mode on its children.

For the newer wakeup feature, the physical USB device does support waking the system (does have ./power/wakeup in sysfs), but the various logical devices that belong to it don't have configurable wakeup (no ./power/wakeup in sysfs), so attempting to configure it for the logical devices logs an error. That seems reasonable to me: the kernel probably only has control over enabling or disabling wakeup per physical object.

Unlike ATTRS, ATTR only looks at the attributes of the current device specifically. So when the kernel announces the physical USB device, udev sees that it (presumably) has power/wakeup = disabled, which matches the pattern *, so it still toggles it to enabled, as we want. But when the kernel announces the logical (child) devices, udev sees that the logical device doesn't have a ./power/wakeup, and because the rule I'm proposing uses ATTR and not ATTRS, it doesn't look for that attribute on the logical device's ancestors. So the rule I'm proposing no longer matches, and we don't try (and fail) to enable wakeup on the logical device.

I tried putting a test machine in suspend-to-RAM, and my Steam Controller successfully wakes it up (this is still with the 2015 dongle and a matching controller, I don't have the 2026 device yet).

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.

2 participants