Skip to content

Commit

Permalink
Add autosuspend rules for emulated QEMU devices
Browse files Browse the repository at this point in the history
Partially reverts "rules: remove all power management from udev" /
e2452ee.

The rules for emulated QEMU hardware are restored. It seems that they
were removed in one fell swoop with other rules which were causing problems,
despite the qemu rules working properly (and being adjusted through patches
over time).

systemd#353 (comment)
  • Loading branch information
keszybz committed Jul 15, 2020
1 parent 4216531 commit 141ea1d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rules.d/60-autosuspend.rules
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ ACTION!="add", GOTO="autosuspend_end"
SUBSYSTEM=="i2c", ATTR{name}=="cyapa", \
ATTR{power/control}="on", GOTO="autosuspend_end"

# Enable autosuspend for qemu emulated usb hid devices
#
# Note that there are buggy qemu versions (0.13 & older) which
# advertise remote wakeup support but don't actually implement
# it correctly. This is the reason why we need a match for the
# serial number here. Old, broken versions have serial "1".
# It has been changed to "42" after fixing the bug to indicate
# remote wakeup is working.
SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Mouse", ATTR{serial}!="1", TEST=="power/control", ATTR{power/control}="auto"
SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Tablet", ATTR{serial}!="1", TEST=="power/control", ATTR{power/control}="auto"
SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Keyboard", ATTR{serial}!="1", TEST=="power/control", ATTR{power/control}="auto"

# Enable autosuspend if hwdb says so. Here we are relying on
# the hwdb import done earlier based on MODALIAS.
ENV{ID_AUTOSUSPEND}=="1", TEST=="power/control", \
Expand Down

0 comments on commit 141ea1d

Please sign in to comment.