You are not logged in.

#1 2010-07-01 23:10:20

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

cpufreq issues (can't set governor when AC is plugged)

Hello. I just installed cpufreq package to manage my laptop cpu speed when it's plugged to AC or not. The problem is that it won't change the governor unless I set it manually.

My modules:

MODULES=(!b43legacy b43 acpi-cpufreq cpufreq_ondemand !pcspk)

handler.sh (this file didn't exist, I created it with the wiki template. It's owned by root with permissions to be executed by everyone):

#!/bin/bash
case "$1" in
    ac_adapter)
         case "$2" in
             AC*)
                 case "$4" in
                     00000000)
                         echo "ondemand" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor    
                         echo -n $minspeed >$setspeed
                         #/etc/laptop-mode/laptop-mode start
                     ;;
                     00000001)
                         echo "performance" >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
                         echo -n $maxspeed >$setspeed
                         #/etc/laptop-mode/laptop-mode stop
                     ;;
                 esac
             ;;
            *) logger "ACPI action undefined: $2" ;;
        esac
    ;;
esac

cpufreq-info:

cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 10.0 us.
  hardware limits: 800 MHz - 1.40 GHz
  available frequency steps: 1.40 GHz, 1.20 GHz, 800 MHz
  available cpufreq governors: ondemand, performance
  current policy: frequency should be within 800 MHz and 1.40 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 1.40 GHz.

One thing that I found weird, is that when I do acpi -a there's no output.

The modules are running (at least lsmod tell me so). What I'm doing wrong?


Sorry for my English. Feel free to point out my errors.

Offline

#2 2010-07-02 01:20:53

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: cpufreq issues (can't set governor when AC is plugged)

It's one thing to load the cpuffreq_ondemand module, you still need to run the cpufreq service too. Configuration is done through the config file in /etc/conf.d/.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2010-07-02 06:09:49

rb
Member
From: Argentina
Registered: 2010-05-07
Posts: 143

Re: cpufreq issues (can't set governor when AC is plugged)

Do you mean this file?

#configuration for cpufreq control

# valid governors:
#  ondemand, performance, powersave,
#  conservative, userspace
governor="ondemand"

# limit frequency range (optional)
# valid suffixes: Hz, kHz (default), MHz, GHz, THz
#min_freq="800MHz"
#max_freq="1.4GHz"

# use freq to set up the exact cpu frequency using it with userspace governor
#freq=

I uncommented the governor="ondemand" line.

There's one thing I don't get: now acpi -a shows me 'Adapter 0: on line'. It seems that randomly in every reboot something happens, because sometimes I got that outout (or offline), and sometimes nothing at all.

Could be that the reason because the script don't work?

/Edit: I forgot to thanks for your reply. Sorry for my bad manners.

Last edited by rb (2010-07-02 06:10:37)


Sorry for my English. Feel free to point out my errors.

Offline

#4 2010-07-02 12:58:46

cantabile
Member
Registered: 2010-06-29
Posts: 33

Re: cpufreq issues (can't set governor when AC is plugged)

Did you install acpid? That package provides /etc/acpi/handler.sh.

Offline

#5 2010-07-02 13:15:55

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: cpufreq issues (can't set governor when AC is plugged)

Rb: yes, and you need to add it to your DAEMONS=() array in rc.conf. That's how you start a service at boot time.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB