You are not logged in.

#1 2010-11-30 17:24:05

useradded
Member
From: Edinburgh, UK
Registered: 2010-05-15
Posts: 77

[SOLVED] powertop suggestion: "enable device power management"

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

#2 2010-11-30 23:18:34

Arthenik
Member
Registered: 2010-02-13
Posts: 44

Re: [SOLVED] powertop suggestion: "enable device power management"

I too would be interested in that.

Offline

#3 2010-12-01 08:10:39

jarryson
Member
Registered: 2007-02-18
Posts: 298

Re: [SOLVED] powertop suggestion: "enable device power management"

+1

is there any other way to enable this?

Last edited by jarryson (2010-12-01 08:11:02)

Offline

#4 2010-12-01 08:16:12

Voins
Member
Registered: 2010-08-29
Posts: 3

Re: [SOLVED] powertop suggestion: "enable device power management"

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

#5 2010-12-01 10:35:25

Pank
Member
From: IT
Registered: 2009-06-13
Posts: 371

Re: [SOLVED] powertop suggestion: "enable device power management"

Thanks Voins. That is very helpful.
Is this already implemented in laptop-mode?


Arch x64 on Thinkpad X200s/W530

Offline

#6 2010-12-01 11:45:56

useradded
Member
From: Edinburgh, UK
Registered: 2010-05-15
Posts: 77

Re: [SOLVED] powertop suggestion: "enable device power management"

@ 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

#7 2010-12-29 13:07:03

saft
Member
Registered: 2010-03-04
Posts: 36

Re: [SOLVED] powertop suggestion: "enable device power management"

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

#8 2011-02-04 11:07:38

freetz
Member
Registered: 2009-12-05
Posts: 6

Re: [SOLVED] powertop suggestion: "enable device power management"

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

#9 2011-09-02 08:36:45

vaquerito
Member
Registered: 2008-04-09
Posts: 32

Re: [SOLVED] powertop suggestion: "enable device power management"

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 smile

Thanks for your finding

Last edited by vaquerito (2011-09-02 08:37:22)

Offline

#10 2011-09-02 12:13:46

laloch
Member
Registered: 2010-02-04
Posts: 182

Re: [SOLVED] powertop suggestion: "enable device power management"

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

#11 2011-12-09 01:41:40

orlandu63
Member
Registered: 2010-03-29
Posts: 29

Re: [SOLVED] powertop suggestion: "enable device power management"

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

Board footer

Powered by FluxBB