You are not logged in.
I have been following up many of powertop's suggestions for saving energy and have successfully integrated many of them into a simple script that is run by pm-powersave alongside its provided hooks. However, there is one suggestion that powertop keeps producing, which I haven't been able to implement in a script yet:
Enable Device Power Management by pressing the P key
Does anyone know what this is referring to, or how to implement this in a script outside of powertop?
Or is this just a bug in powertop's output?
Thanks
Last edited by useradded (2010-12-01 11:47:11)
Offline
I too would be interested in that.
Offline
+1
is there any other way to enable this?
Last edited by jarryson (2010-12-01 08:11:02)
Offline
Sources reveal that on press of P powertop iterates over /sys/bus/{pci,spi,i2c}/devices/*/power/control and writes "auto\n" to each of these files.
Offline
Thanks Voins. That is very helpful.
Is this already implemented in laptop-mode?
Arch x64 on Thinkpad X200s/W530
Offline
@ Voins thanks a lot for that, no amount of googling could tell me the answer, but an Archer was right there. Great stuff. Marking as solved.
Last edited by useradded (2010-12-01 11:48:11)
Offline
I've just come across this thread via google, I was wondering exactly the same thing - thanks guys.
How have you all implemented this command? Do you run it at boot, and if so, with what?
This setting seems to affect my 6-cell netbook battery by around 1.5 hours. Seems like something which could be integrated into laptop mode.
Offline
As /sys/bus contains a number of symlinks, a "find" encounters some problems. Therefore, I'm doing a find over the symlink destination directory and run a script that adds the "auto" parameter accordingly:
cd /sys/devices
find pci* -name "control" -exec /root/energy/setauto.sh {} \;
setauto.sh contains nothing much but an additional check of the filename (as find can't test the name on "control/power"):
#!/bin/bash
file=$1
if [[ "$file" =~ 'power' ]]
then
echo "$file"
echo "auto" > "$file"
echo "Done."
fi
On my system, there is only one pci subdirectory called "pci0000:00". I have nevertheless used a wildcard in the find command, hoping that it would cycle through two or more subdirectories as well, but couldn't test it.
After running this script, powertop does no make the respective suggestion and powertop 1.97 beta lists all PCI devices in status "GOOD".
Hope that helps,
F.
Offline
something as rough as
for i in $(ls /sys/bus/{pci,spi,i2c}/devices/*/power/control);do echo auto > $i;done
as root (or in /etc.rc.local) should do the trick
Thanks for your finding
Last edited by vaquerito (2011-09-02 08:37:22)
Offline
I use pm-utils rather than laptop-mode-tools and this is what I have in my /etc/pm/power.d/device_pm:
#!/bin/sh
device_pm() {
for dpcontrol in /sys/bus/{pci,spi,i2c}/devices/*/power/control; do
[ -w "$dpcontrol" ] || continue
echo $1 > "$dpcontrol"
done
}
case "$1" in
true)
echo "**device power management ON"
device_pm auto
;;
false)
echo "**device power management OFF"
device_pm on
;;
esac
exit 0
Offline
I prefer to use tee:
echo auto | tee /sys/bus/{pci,spi,i2c}/devices/*/power/control > /dev/null
Last edited by orlandu63 (2011-12-09 01:43:22)
Offline