Hello,

I noticed some issues with the power management setup I had when I
upgraded kernels over the last few months. This past weekend I decided
to crack down on this to see whether they could be fixed. I visited
the Gentoo Power Management Guide[1] again and re-traced the setup to
verify my system's behavior.
First issue is the runlevels are not switching properly when the AC
power adapter is un/plugged. When the power cable is unplugged, I see
the following entries in the syslog:

Jun 22 21:36:12 kitt logger: ACPI event unhandled: ac_adapter
ACPI0003:00 00000080 00000000
Jun 22 21:36:12 kitt logger: Switching to battery runlevel
Jun 22 21:36:13 kitt logger: ACPI event unhandled: processor
ACPI_CPU:00 00000081 00000000
Jun 22 21:36:13 kitt logger: ACPI event unhandled: processor
ACPI_CPU:01 00000081 00000000
Jun 22 21:36:13 kitt logger: ACPI event unhandled: battery PNP0C0A:00
00000080 00000001
Jun 22 21:36:13 kitt logger: Switching to battery runlevel

The syslog contains messages that the system is switching to runlevel
battery. These log messages are in
/etc/acpi/actions/pmg_switch_runlevel.sh. Unfortunately, the system
never changes from runlevel default; looking at
/var/lib/init.d/softlevel confirms this:

$ cat /var/lib/init.d/softlevel
default

When plugging the power back in, the syslog lacks the corresponding
"Switching to default runlevel" messages:

Jun 22 21:38:43 kitt logger: ACPI event unhandled: ac_adapter
ACPI0003:00 00000080 00000001
Jun 22 21:38:44 kitt logger: ACPI event unhandled: processor
ACPI_CPU:00 00000081 00000000
Jun 22 21:38:44 kitt logger: ACPI event unhandled: processor
ACPI_CPU:01 00000081 00000000
Jun 22 21:38:44 kitt logger: ACPI event unhandled: battery PNP0C0A:00
00000080 00000001

The second issue is with cpufreqd. When the power is unplugged, the
CPU scaling kicks in as expected, and the processors are cut to half
power (running at ~1GHz instead of their full capacity of ~2GHz). When
the AC adapter is plugged back in, the CPUs continue to operate at
only ~1GHz instead of being bumped back up to ~2GHz and I see messages
like this in my syslog:

Jun 22 21:38:44 kitt cpufreqd: cpufreqd_set_profile     : Couldn't set
profile "Performance High" set for cpu0 (1998000-1998000-performance)
Jun 22 21:38:44 kitt cpufreqd: cpufreqd_loop            : Cannot set
policy, Rule unchanged ("AC Off - High Power").

I pasted my /etc/cpufreqd.conf file at the end of this email.

The third issue seems to be with power management of my wireless card.
I have the iwl3945 wireless card. In older version of the kernel
(2.6.25 and before, I believe) this card was managed by a daemon in
userspace. After that the driver was merged into the kernel. I noticed
recently that the entry in /etc/conf.d/net (as per the Power
Management Guide) causes this error when the interface comes up:

 * Starting wlan0
Error for wireless request "Set Power Management" (8B2C) :
    SET failed on device wlan0 ; Operation not supported.
 *   wlan0 does not support the following configuration commands
 *     power on

I guess with the driver moving into the kernel, this setting has
changed as well. Is there another way to enable power management on my
wireless card? Is it still necessary?

Any input on these things would be much appreciated.

A few details:
I'm running gentoo-sources-2.6.30-r1
I updated a cpufreqd to version 2.3.4 by coping the version 2.2.1
.ebuild file into my local overlay and bumping the version
I updated the files installed by powermgmt-base with those in upstream
version 1.30

Thanks,
Mike


[1] http://www.gentoo.org/doc/en/power-management-guide.xml

# cat /etc/cpufreqd.conf
# this is a comment
# see CPUFREQD.CONF(5) manpage for a complete reference

[General]
pidfile=/var/run/cpufreqd.pid
poll_interval=2
enable_plugin=acpi_ac, acpi_battery
enable_remote=1
remote_group=wheel
verbosity=4
[/General]

[acpi]
acpid_socket=/var/run/acpid.socket
[/acpi]

#[nforce2_atxp1]
#vcore_path=/some/path
#vcore_default=1500
#[/nforce2_atxp1]

#[sensors_plugin]
#sensors_conf=/some/file
#[/sensors_plugin]

[Profile]
name=On Demand High
minfreq=40%
maxfreq=100%
policy=ondemand
[/Profile]

[Profile]
name=On Demand Low
minfreq=20%
maxfreq=80%
policy=ondemand
[/Profile]

[Profile]
name=Performance High
minfreq=100%
maxfreq=100%
policy=performance
#exec_post=echo 8 > /proc/acpi/sony/brightness
[/Profile]

[Profile]
name=Performance Low
minfreq=80%
maxfreq=80%
policy=performance
[/Profile]

[Profile]
name=Powersave High
minfreq=70%
maxfreq=70%
policy=powersave
[/Profile]

[Profile]
name=Powersave Low
minfreq=30%
maxfreq=30%
policy=powersave
[/Profile]

#[Profile]
#name=Conservative High
#minfreq=33%
#maxfreq=100%
#policy=conservative
#[/Profile]
#
#[Profile]
#name=Conservative Low
#minfreq=0%
#maxfreq=66%
#policy=conservative
#[/Profile]

##
# Basic states
##
# when AC use performance mode
[Rule]
name=AC Rule
ac=on                    # (on/off)
profile=Performance High
[/Rule]

# conservative mode when not AC
[Rule]
name=AC Off - Low Battery
ac=off                   # (on/off)
battery_interval=0-30
#exec_post=echo 5 > /proc/acpi/sony/brightness
profile=Powersave Low
[/Rule]

# conservative mode when not AC
[Rule]
name=AC Off - Medium Battery
ac=off                   # (on/off)
battery_interval=30-70
#exec_post=echo 5 > /proc/acpi/sony/brightness
profile=On Demand Low
[/Rule]

# stay in performance mode for the first minutes
[Rule]
name=AC Off - High Power
ac=off                   # (on/off)
battery_interval=70-100
#exec_post=echo 5 > /proc/acpi/sony/brightness
profile=On Demand High
[/Rule]

##
# Special Rules
##
# CPU Too hot!
[Rule]
name=CPU Too Hot
acpi_temperature=65-100
cpu_interval=50-100
profile=Performance Low
[/Rule]

# use performance mode if I'm watching a movie
# I don't care for batteries!
# But don't heat too much.
[Rule]
name=Movie Watcher
programs=xine,mplayer,gmplayer
battery_interval=0-100
acpi_temperature=0-60
profile=Performance High
[/Rule]

Reply via email to