1 |
Hello, |
2 |
|
3 |
I noticed some issues with the power management setup I had when I |
4 |
upgraded kernels over the last few months. This past weekend I decided |
5 |
to crack down on this to see whether they could be fixed. I visited |
6 |
the Gentoo Power Management Guide[1] again and re-traced the setup to |
7 |
verify my system's behavior. |
8 |
|
9 |
First issue is the runlevels are not switching properly when the AC |
10 |
power adapter is un/plugged. When the power cable is unplugged, I see |
11 |
the following entries in the syslog: |
12 |
|
13 |
Jun 22 21:36:12 kitt logger: ACPI event unhandled: ac_adapter |
14 |
ACPI0003:00 00000080 00000000 |
15 |
Jun 22 21:36:12 kitt logger: Switching to battery runlevel |
16 |
Jun 22 21:36:13 kitt logger: ACPI event unhandled: processor |
17 |
ACPI_CPU:00 00000081 00000000 |
18 |
Jun 22 21:36:13 kitt logger: ACPI event unhandled: processor |
19 |
ACPI_CPU:01 00000081 00000000 |
20 |
Jun 22 21:36:13 kitt logger: ACPI event unhandled: battery PNP0C0A:00 |
21 |
00000080 00000001 |
22 |
Jun 22 21:36:13 kitt logger: Switching to battery runlevel |
23 |
|
24 |
The syslog contains messages that the system is switching to runlevel |
25 |
battery. These log messages are in |
26 |
/etc/acpi/actions/pmg_switch_runlevel.sh. Unfortunately, the system |
27 |
never changes from runlevel default; looking at |
28 |
/var/lib/init.d/softlevel confirms this: |
29 |
|
30 |
$ cat /var/lib/init.d/softlevel |
31 |
default |
32 |
|
33 |
When plugging the power back in, the syslog lacks the corresponding |
34 |
"Switching to default runlevel" messages: |
35 |
|
36 |
Jun 22 21:38:43 kitt logger: ACPI event unhandled: ac_adapter |
37 |
ACPI0003:00 00000080 00000001 |
38 |
Jun 22 21:38:44 kitt logger: ACPI event unhandled: processor |
39 |
ACPI_CPU:00 00000081 00000000 |
40 |
Jun 22 21:38:44 kitt logger: ACPI event unhandled: processor |
41 |
ACPI_CPU:01 00000081 00000000 |
42 |
Jun 22 21:38:44 kitt logger: ACPI event unhandled: battery PNP0C0A:00 |
43 |
00000080 00000001 |
44 |
|
45 |
The second issue is with cpufreqd. When the power is unplugged, the |
46 |
CPU scaling kicks in as expected, and the processors are cut to half |
47 |
power (running at ~1GHz instead of their full capacity of ~2GHz). When |
48 |
the AC adapter is plugged back in, the CPUs continue to operate at |
49 |
only ~1GHz instead of being bumped back up to ~2GHz and I see messages |
50 |
like this in my syslog: |
51 |
|
52 |
Jun 22 21:38:44 kitt cpufreqd: cpufreqd_set_profile : Couldn't set |
53 |
profile "Performance High" set for cpu0 (1998000-1998000-performance) |
54 |
Jun 22 21:38:44 kitt cpufreqd: cpufreqd_loop : Cannot set |
55 |
policy, Rule unchanged ("AC Off - High Power"). |
56 |
|
57 |
I pasted my /etc/cpufreqd.conf file at the end of this email. |
58 |
|
59 |
The third issue seems to be with power management of my wireless card. |
60 |
I have the iwl3945 wireless card. In older version of the kernel |
61 |
(2.6.25 and before, I believe) this card was managed by a daemon in |
62 |
userspace. After that the driver was merged into the kernel. I noticed |
63 |
recently that the entry in /etc/conf.d/net (as per the Power |
64 |
Management Guide) causes this error when the interface comes up: |
65 |
|
66 |
* Starting wlan0 |
67 |
Error for wireless request "Set Power Management" (8B2C) : |
68 |
SET failed on device wlan0 ; Operation not supported. |
69 |
* wlan0 does not support the following configuration commands |
70 |
* power on |
71 |
|
72 |
I guess with the driver moving into the kernel, this setting has |
73 |
changed as well. Is there another way to enable power management on my |
74 |
wireless card? Is it still necessary? |
75 |
|
76 |
Any input on these things would be much appreciated. |
77 |
|
78 |
A few details: |
79 |
I'm running gentoo-sources-2.6.30-r1 |
80 |
I updated a cpufreqd to version 2.3.4 by coping the version 2.2.1 |
81 |
.ebuild file into my local overlay and bumping the version |
82 |
I updated the files installed by powermgmt-base with those in upstream |
83 |
version 1.30 |
84 |
|
85 |
Thanks, |
86 |
Mike |
87 |
|
88 |
|
89 |
[1] http://www.gentoo.org/doc/en/power-management-guide.xml |
90 |
|
91 |
# cat /etc/cpufreqd.conf |
92 |
# this is a comment |
93 |
# see CPUFREQD.CONF(5) manpage for a complete reference |
94 |
|
95 |
[General] |
96 |
pidfile=/var/run/cpufreqd.pid |
97 |
poll_interval=2 |
98 |
enable_plugin=acpi_ac, acpi_battery |
99 |
enable_remote=1 |
100 |
remote_group=wheel |
101 |
verbosity=4 |
102 |
[/General] |
103 |
|
104 |
[acpi] |
105 |
acpid_socket=/var/run/acpid.socket |
106 |
[/acpi] |
107 |
|
108 |
#[nforce2_atxp1] |
109 |
#vcore_path=/some/path |
110 |
#vcore_default=1500 |
111 |
#[/nforce2_atxp1] |
112 |
|
113 |
#[sensors_plugin] |
114 |
#sensors_conf=/some/file |
115 |
#[/sensors_plugin] |
116 |
|
117 |
[Profile] |
118 |
name=On Demand High |
119 |
minfreq=40% |
120 |
maxfreq=100% |
121 |
policy=ondemand |
122 |
[/Profile] |
123 |
|
124 |
[Profile] |
125 |
name=On Demand Low |
126 |
minfreq=20% |
127 |
maxfreq=80% |
128 |
policy=ondemand |
129 |
[/Profile] |
130 |
|
131 |
[Profile] |
132 |
name=Performance High |
133 |
minfreq=100% |
134 |
maxfreq=100% |
135 |
policy=performance |
136 |
#exec_post=echo 8 > /proc/acpi/sony/brightness |
137 |
[/Profile] |
138 |
|
139 |
[Profile] |
140 |
name=Performance Low |
141 |
minfreq=80% |
142 |
maxfreq=80% |
143 |
policy=performance |
144 |
[/Profile] |
145 |
|
146 |
[Profile] |
147 |
name=Powersave High |
148 |
minfreq=70% |
149 |
maxfreq=70% |
150 |
policy=powersave |
151 |
[/Profile] |
152 |
|
153 |
[Profile] |
154 |
name=Powersave Low |
155 |
minfreq=30% |
156 |
maxfreq=30% |
157 |
policy=powersave |
158 |
[/Profile] |
159 |
|
160 |
#[Profile] |
161 |
#name=Conservative High |
162 |
#minfreq=33% |
163 |
#maxfreq=100% |
164 |
#policy=conservative |
165 |
#[/Profile] |
166 |
# |
167 |
#[Profile] |
168 |
#name=Conservative Low |
169 |
#minfreq=0% |
170 |
#maxfreq=66% |
171 |
#policy=conservative |
172 |
#[/Profile] |
173 |
|
174 |
## |
175 |
# Basic states |
176 |
## |
177 |
# when AC use performance mode |
178 |
[Rule] |
179 |
name=AC Rule |
180 |
ac=on # (on/off) |
181 |
profile=Performance High |
182 |
[/Rule] |
183 |
|
184 |
# conservative mode when not AC |
185 |
[Rule] |
186 |
name=AC Off - Low Battery |
187 |
ac=off # (on/off) |
188 |
battery_interval=0-30 |
189 |
#exec_post=echo 5 > /proc/acpi/sony/brightness |
190 |
profile=Powersave Low |
191 |
[/Rule] |
192 |
|
193 |
# conservative mode when not AC |
194 |
[Rule] |
195 |
name=AC Off - Medium Battery |
196 |
ac=off # (on/off) |
197 |
battery_interval=30-70 |
198 |
#exec_post=echo 5 > /proc/acpi/sony/brightness |
199 |
profile=On Demand Low |
200 |
[/Rule] |
201 |
|
202 |
# stay in performance mode for the first minutes |
203 |
[Rule] |
204 |
name=AC Off - High Power |
205 |
ac=off # (on/off) |
206 |
battery_interval=70-100 |
207 |
#exec_post=echo 5 > /proc/acpi/sony/brightness |
208 |
profile=On Demand High |
209 |
[/Rule] |
210 |
|
211 |
## |
212 |
# Special Rules |
213 |
## |
214 |
# CPU Too hot! |
215 |
[Rule] |
216 |
name=CPU Too Hot |
217 |
acpi_temperature=65-100 |
218 |
cpu_interval=50-100 |
219 |
profile=Performance Low |
220 |
[/Rule] |
221 |
|
222 |
# use performance mode if I'm watching a movie |
223 |
# I don't care for batteries! |
224 |
# But don't heat too much. |
225 |
[Rule] |
226 |
name=Movie Watcher |
227 |
programs=xine,mplayer,gmplayer |
228 |
battery_interval=0-100 |
229 |
acpi_temperature=0-60 |
230 |
profile=Performance High |
231 |
[/Rule] |