# Power mgmt problems cpufreqd and init level changing script.

## LTsix

Fellas, I have setup the script from here http://www.gentoo.org/doc/en/power-management-guide.xml from section 2.6 thorugh 2.9 and it does not properly switch between my init levels default (ie fah is running but could be other things as well) and battery ( no fah etc).

I have also tried to setup cpufreqd and it looks like it is failing to switch the governors for the cpu.

/var/log/messages

```
Jul 28 08:42:49 tuxy [50947.310645] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

Jul 28 08:42:49 tuxy [50947.310653] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

Jul 28 08:42:49 tuxy logger: ACPI event unhandled: battery BAT1 00000081 00000000

Jul 28 08:42:56 tuxy logger: ACPI event unhandled: ac_adapter AC 00000080 00000000

Jul 28 08:42:56 tuxy logger: Switching to battery runlevel

Jul 28 08:43:03 tuxy logger: ACPI event unhandled: processor CPU0 00000080 00000005

Jul 28 08:43:03 tuxy logger: ACPI event unhandled: processor CPU1 00000080 00000005

Jul 28 08:43:03 tuxy logger: ACPI event unhandled: battery BAT0 00000080 00000001

Jul 28 08:43:12 tuxy logger: ACPI event unhandled: processor CPU0 00000080 00000000

Jul 28 08:43:13 tuxy logger: ACPI event unhandled: processor CPU1 00000080 00000000

Jul 28 08:43:13 tuxy logger: ACPI event unhandled: ac_adapter AC 00000080 00000001

Jul 28 08:43:14 tuxy logger: ACPI event unhandled: battery BAT0 00000080 00000001

Jul 28 08:43:50 tuxy [51008.237359] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

Jul 28 08:43:50 tuxy [51008.237367] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

Jul 28 08:43:50 tuxy logger: ACPI event unhandled: battery BAT1 00000081 00000001

Jul 28 08:44:09 tuxy logger: ACPI event unhandled: ac_adapter AC 00000080 00000000

Jul 28 08:44:09 tuxy logger: ACPI event unhandled: processor CPU0 00000080 00000005

Jul 28 08:44:09 tuxy logger: ACPI event unhandled: processor CPU1 00000080 00000005

Jul 28 08:44:09 tuxy cpufreqd: cpufreqd_set_profile     : Couldn't set profile "On Demand High" set for cpu0

Jul 28 08:44:09 tuxy logger: ACPI event unhandled: battery BAT1 00000080 00000001

Jul 28 08:44:10 tuxy logger: Switching to default runlevel

Jul 28 08:44:12 tuxy su[2276]: Successful su for foldingathome by root

Jul 28 08:44:12 tuxy su[2276]: + ??? root:foldingathome

Jul 28 08:44:12 tuxy su[2276]: pam_unix(su:session): session opened for user foldingathome by (uid=0)

Jul 28 08:44:12 tuxy su[2276]: pam_unix(su:session): session closed for user foldingathome

Jul 28 08:44:12 tuxy logger: ACPI event unhandled: ac_adapter AC 00000080 00000001

Jul 28 08:44:12 tuxy logger: ACPI event unhandled: processor CPU0 00000080 00000000

Jul 28 08:44:12 tuxy logger: ACPI event unhandled: processor CPU1 00000080 00000000

Jul 28 08:44:12 tuxy logger: ACPI event unhandled: battery BAT1 00000080 00000001

```

Cpufreqd-info after I unplugged my ac adapter and plugged it back in.[/glsa]

```
tuxy var # cpufreq-info

cpufrequtils 005: cpufreq-info (C) Dominik Brodowski 2004-2006

Report errors and bugs to cpufreq@vger.kernel.org, please.

analyzing CPU 0:

  driver: acpi-cpufreq

  CPUs which need to switch frequency at the same time: 0

  hardware limits: 800 MHz - 2.50 GHz

  available frequency steps: 2.50 GHz, 2.50 GHz, 2.00 GHz, 1.60 GHz, 1.20 GHz, 800 MHz

  available cpufreq governors: conservative, userspace, powersave, ondemand, performance

  current policy: frequency should be within 800 MHz and 800 MHz.

                  The governor "ondemand" may decide which speed to use

                  within this range.

  current CPU frequency is 800 MHz (asserted by call to hardware).

  cpufreq stats: 2.50 GHz:83.17%, 2.50 GHz:0.00%, 2.00 GHz:0.39%, 1.60 GHz:0.00%, 1.20 GHz:10.82%, 800 MHz:5.62%  (1453)

analyzing CPU 1:

  driver: acpi-cpufreq

  CPUs which need to switch frequency at the same time: 1

  hardware limits: 800 MHz - 2.50 GHz

  available frequency steps: 2.50 GHz, 2.50 GHz, 2.00 GHz, 1.60 GHz, 1.20 GHz, 800 MHz

  available cpufreq governors: conservative, userspace, powersave, ondemand, performance

  current policy: frequency should be within 800 MHz and 800 MHz.

                  The governor "ondemand" may decide which speed to use

                  within this range.

  current CPU frequency is 800 MHz (asserted by call to hardware).

  cpufreq stats: 2.50 GHz:30.84%, 2.50 GHz:0.00%, 2.00 GHz:0.07%, 1.60 GHz:0.00%, 1.20 GHz:0.14%, 800 MHz:68.96%  (13)
```

Looks like dmesg is barfing this out for every battery swap. This is probably normal for batteries.

```
[48996.028699] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

[48996.028702] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

[49156.962609] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

[49156.962617] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

[49595.078221] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

[49595.078229] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

[49621.437692] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

[49621.437700] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

[49645.923102] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

[49645.923109] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

[49783.205524] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

[49783.205532] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

[50947.310645] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

[50947.310653] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

[51008.237359] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

[51008.237367] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

[51321.983675] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

[51321.983678] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

[51325.870175] atkbd.c: Unknown key pressed (translated set 2, code 0x8e on isa0060/serio0).

[51325.870178] atkbd.c: Use 'setkeycodes e00e <keycode>' to make it known.

```

/etc/make.conf

```
# These settings were set by the catalyst build script that automatically

# built this stage.

# Please consult /usr/share/portage/config/make.conf.example for a more

# detailed example.

CFLAGS="-march=native -Os -pipe"

CXXFLAGS="-march=native -Os -pipe"

# WARNING: Changing your CHOST is not something that should be done lightly.

# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.

CHOST="x86_64-pc-linux-gnu"

# These are the USE flags that were used in addition to what is provided by the

# profile used for building.

USE="mmx sse sse2 multilib 

gtk gnome -kde dvd gnome-keyring hal avahi X branding dbus

alsa acpi lm_sensors nvidia pmu

cdr dvdr bluetooth dvd ffmpeg gimp networkmanager v4l v4l2

ldap kerberos"

MAKEOPTS="-j3"

GENTOO_MIRRORS="http://mirror.usu.edu/mirrors/gentoo/ "

SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"

INPUT_DEVICES="keyboard mouse"

VIDEO_CARDS="nvidia"

```

----------

## bandreabis

up?

----------

