On Tue, Jan 25, 2011 at 11:44, Gerd Hoffmann <kraxel@xxxxxxxxxx> wrote: > These patches enable usb autosuspend for the qemu emulated HID devices. > This reduces the cpu load for idle guests with a hid device attached > because the linux kernel will suspend the usb bus then and qemu can stop > running a 1000 Hz to emulate the (active) UHCI controller. > +dist_udevrules_DATA += extras/qemu/99-qemu-usb.rules The number should be 10-90 for the default things, or is there a dependency on anything else? > +ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Mouse", ATTR{serial}=="42", RUN+="qemu-usb-autosuspend %p" This should probably be a simple ATTR{power/control}="auto" > --- /dev/null > +++ b/extras/qemu/qemu-usb-autosuspend > @@ -0,0 +1,7 @@ > +#!/bin/sh If possible, we try to avoid shell scripts. > +path="$1" > +if test -f "/sys${path}/power/control"; then > + Â Â Â echo "auto" > "/sys${path}/power/control" > +elif test -f "/sys${path}/power/level"; then > + Â Â Â echo "auto" > "/sys${path}/power/level" > +fi Which one is the actual one? Is the second try only for older kernels? That could go in the compat rules, udev does not ship rules for older kernels in the default installation. Anyway, why isn't all this done in the kernel? Can't this be made working somehow? Carrying out configuration, and unconditionally applying it from udev rules, should be avoided if possible and if the kernel could do it itself. We ran into serious issues in the past when more recent kernels did not like the config anymore that udev applied. Cheers, Kay -- To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html