From 3bfc7a97b1824fcdfb738617d9a5450a20a22a0f Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Mon, 12 Mar 2012 15:45:26 -0400 Subject: [PATCH] rules: Enable USB autosuspend on more USB HID devices Many servers will be connected to KVMs or include iLO support, and this is often presented as a set of USB input devices. Enabling autosuspend on these allows the USB hardware to be powered down, avoiding unnecessary wakeups and power consumption. The input devices will be self powered, so there's no risk of losing input events as there would be for real input devices. The same is true of USB input devices that are built into the system. --- Makefile.am | 2 +- rules/42-qemu-usb.rules | 13 ----------- rules/42-usb-hid-pm.rules | 49 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 14 deletions(-) delete mode 100644 rules/42-qemu-usb.rules create mode 100644 rules/42-usb-hid-pm.rules diff --git a/Makefile.am b/Makefile.am index 7b84c1c7..5fb2c13a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -150,7 +150,7 @@ INSTALL_DATA_HOOKS += udev-confdirs udevrulesdir = $(libexecdir)/udev/rules.d dist_udevrules_DATA = \ - rules/42-qemu-usb.rules \ + rules/42-usb-hid-pm.rules \ rules/50-udev-default.rules \ rules/60-persistent-storage-tape.rules \ rules/60-persistent-serial.rules \ diff --git a/rules/42-qemu-usb.rules b/rules/42-qemu-usb.rules deleted file mode 100644 index a4e38647..00000000 --- a/rules/42-qemu-usb.rules +++ /dev/null @@ -1,13 +0,0 @@ -# -# Enable autosuspend for qemu emulated usb hid devices. -# -# Note that there are buggy qemu versions 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. -# The serial number "42" is used to tag the implementations where -# remote wakeup is working. -# - -ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Mouse", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto" -ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Tablet", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto" -ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Keyboard", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto" diff --git a/rules/42-usb-hid-pm.rules b/rules/42-usb-hid-pm.rules new file mode 100644 index 00000000..d5d5897c --- /dev/null +++ b/rules/42-usb-hid-pm.rules @@ -0,0 +1,49 @@ +# +# Enable autosuspend for qemu emulated usb hid devices. +# +# Note that there are buggy qemu versions 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. +# The serial number "42" is used to tag the implementations where +# remote wakeup is working. +# + +ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Mouse", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto" +ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Tablet", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto" +ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Keyboard", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto" + +# +# Enable autosuspend for KVM and iLO usb hid devices. These are +# effectively self-powered (despite what some claim in their USB +# profiles) and so it's safe to do so. +# + +# AMI 046b:ff10 +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="046b", ATTR{idProduct}=="ff10", TEST=="power/control", ATTR{power/control}="auto" + +# +# Catch-all for Avocent HID devices. Keyed off interface in order to only +# trigger on HID class devices. +# +ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0624", ATTR{bInterfaceClass}=="03", TEST=="../power/control", ATTR{../power/control}="auto" + +# Dell DRAC 4 +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="413c", ATTR{idProduct}=="2500", TEST=="power/control", ATTR{power/control}="auto" + +# Dell DRAC 5 +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="413c", ATTR{idProduct}=="0000", TEST=="power/control", ATTR{power/control}="auto" + +# Hewlett Packard iLO +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="03f0", ATTR{idProduct}=="7029", TEST=="power/control", ATTR{power/control}="auto" +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="03f0", ATTR{idProduct}=="1027", TEST=="power/control", ATTR{power/control}="auto" + +# IBM remote access +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="04b3", ATTR{idProduct}=="4001", TEST=="power/control", ATTR{power/control}="auto" +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="04b3", ATTR{idProduct}=="4002", TEST=="power/control", ATTR{power/control}="auto" +ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="04b3", ATTR{idProduct}=="4012", TEST=="power/control", ATTR{power/control}="auto" + +# Raritan Computer, Inc KVM. +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="14dd", ATTR{idProduct}="0002", TEST=="power/control", ATTR{power/control}="auto" + +# USB HID devices that are internal to the machine should also be safe to autosuspend +ACTION=="add", SUBSYSTEM=="usb", ATTR{bInterfaceClass}=="03", ATTRS{removable}=="fixed", TEST=="../power/control", ATTR{../power/control}="auto" -- 2.39.5