Aug 262013
 

I while ago I installed PowerTop on my server. PowerTop (Intel) is an awesome utility if you’re looking into the power consumption of you computer. It’s even cooler (literately) if you use it on a laptop because i says how much power you’re drawing from the battery in watt/hour and gives you ton’s of information what is causing that battery drain you’re experiencing. I used it on my server and back then in didn’t noticed it, but after updating it an hour ago to the latest release it caught my eye that the USB devices/Controller is consuming 100% of the power usage:

PM-USB100p

Not something really important because the USB power capacity is pretty limited anyway:

[21:41][martin@kvm:~]$ sudo lsusb -v|grep -i maxpower
MaxPower 0mA
MaxPower 0mA
MaxPower 0mA
MaxPower 0mA
MaxPower 100mA
MaxPower 100mA

But probably “irritating” at best for a guy in IT. How to fix this?

Okay, i started searching around and was a little bit putt off at first. But after reading the kernel Documentation on USB powermanagement: https://www.kernel.org/doc/Documentation/usb/power-management.txt (which is a pretty good read!). I came along the following paragraph:

autosuspend_delay_ms. (There may also be a file named "level"; this
file was deprecated as of the 2.6.35 kernel and replaced by the
"control" file. In 2.6.38 the "autosuspend" file will be deprecated
and replaced by the "autosuspend_delay_ms" file.

Since I’m running kernel version 2.6.32 I did a search for this “level” file (sudo find /proc/ /sys/ -name *level*). And found a about half a dozen. If we checked their status:

[21:50][martin@kvm:~]$ for i in /sys/bus/usb/devices/*/power/level; do echo $i; done
/sys/bus/usb/devices/1-1.2/power/level
/sys/bus/usb/devices/1-1/power/level
/sys/bus/usb/devices/2-1.4/power/level
/sys/bus/usb/devices/2-1/power/level
/sys/bus/usb/devices/usb1/power/level
/sys/bus/usb/devices/usb2/power/level
[21:50][martin@kvm:~]$ for i in /sys/bus/usb/devices/*/power/level; do cat $i; done
on
auto
on
auto
auto
auto
[21:50][martin@kvm:~]$ cat /sys/bus/usb/devices/1-1.2/product
Hermon USB hidmouse Device
[21:51][martin@kvm:~]$ cat /sys/bus/usb/devices/2-1.4/product
USB Keyboard

How about that! The documentation further states why this settings is not configured for auto (or was, but then changed back). This server has no printers/etc, I decided to configure it for auto:


[21:54][martin@kvm:~]$ sudo bash -c "for i in /sys/bus/usb/devices/*/power/level; do echo auto > $i; done"

And voila:
PM-USB0p
Woow pretty cool. The USB PowerManagement kicks in and it drops back to 0%! Looking at the power measurement device, it shaves of +-1 Watt (rough guesstimate).

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image