Re: [PATCH] udev: add rules for qemu guests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/25/11 14:39, Kay Sievers wrote:
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?

No dependency at all.  What number do you suggest then?

+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"

That should work indeed.  Didn't know you can write sysfs files that way.

+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?

Yes, it is for older kernels.

That could go in the compat rules, udev does not ship rules for older
kernels in the default installation.

Ok. Is there some way to express "power/control doesn't exist but power/level does" as udev rule, so I can zap the shell script?

Anyway, why isn't all this done in the kernel? Can't this be made
working somehow?

As far I know the kernel doesn't do that by default because too much broken hardware is out there which breaks when autosuspend is enabled by default. I saw mentioned somewhere the plan is to have udev enable this for known-good devices, so I'm trying that route :)

Havn't checked whenever there is a in-kernel white list for that stuff which could be used instead.

cheers,
  Gerd

--
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


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux