12

If I unplug my laptop from the AC adapter, I will get ACPI errors like these:

May 07 21:45:04 veritas root[7067]: ACPI group/action undefined: processor / LNXCPU:00
May 07 21:45:04 veritas root[7076]: ACPI group/action undefined: processor / LNXCPU:01
May 07 21:45:04 veritas root[7078]: ACPI group/action undefined: processor / LNXCPU:02
May 07 21:45:04 veritas root[7080]: ACPI group/action undefined: processor / LNXCPU:03

acpi_listen dumps

ac_adapter ACPI0003:00 00000080 00000000
battery PNP0C0A:00 00000080 00000001
processor LNXCPU:00 00000080 00000015
processor LNXCPU:01 00000080 00000015
processor LNXCPU:02 00000080 00000015
processor LNXCPU:03 00000080 00000015
processor LNXCPU:00 00000081 00000000
processor LNXCPU:01 00000081 00000000
processor LNXCPU:02 00000081 00000000
processor LNXCPU:03 00000081 00000000
...
processor LNXCPU:00 00000080 00000000
processor LNXCPU:01 00000080 00000000
processor LNXCPU:02 00000080 00000000
processor LNXCPU:03 00000080 00000000

/etc/acpi/handler.sh doesn't seem to handle processor / LNXCPU event...

#!/bin/bash
# Default acpi script that takes an entry for all actions

case "$1" in
    button/power)
        case "$2" in
            PBTN|PWRF)
                logger 'PowerButton pressed'
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;
    button/sleep)
        case "$2" in
            SLPB|SBTN)
                logger 'SleepButton pressed'
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;
    ac_adapter)
        case "$2" in
            AC|ACAD|ADP0)
                case "$4" in
                    00000000)
                        logger 'AC unpluged'
                        ;;
                    00000001)
                        logger 'AC pluged'
                        ;;
                esac
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;
    battery)
        case "$2" in
            BAT0)
                case "$4" in
                    00000000)
                        logger 'Battery online'
                        ;;
                    00000001)
                        logger 'Battery offline'
                        ;;
                esac
                ;;
            CPU0)
                ;;
            *)  logger "ACPI action undefined: $2" ;;
        esac
        ;;
    button/lid)
        case "$3" in
            close)
                logger 'LID closed'
                ;;
            open)
                logger 'LID opened'
                ;;
            *)
                logger "ACPI action undefined: $3"
                ;;
    esac
    ;;
    *)
        logger "ACPI group/action undefined: $1 / $2"
        ;;
esac

What's worse, I'll experience severe performance issues. (everything lags!) I suppose this is due to repeated attempts of processor/LNXCPU, because performance issues are strongly connected with errors of undefined ACPI action, and the performance will be normal again if reboot.

However, I couldn't find out what is the reason... I tried cpupower for controlling CPU mode (powersave or performance), and disabling tlp, but both didn't help.

How does this happen? What is responsible for this problem? And, more importantly, how can I solve this? Many thanks!

FOLLOW-UP: I noticed that the frequency of CPU is 400MHz (selecting performance mode doesn't work), but after rebooting it becomes 800MHz (selecting performance mode the freq will be 2.8GHz).

0

If I unplug my laptop from the AC adapter, I will get ACPI errors like these ...

This was suggested at: "ACPI AC adapter plugging in/off not recognized".

rzepaczyk - My handler.sh:

# Default acpi script that takes an entry for all actions

minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
setspeed1="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
setspeed2="/sys/devices/system/cpu/cpu1/cpufreq/scaling_setspeed"
setspeed3="/sys/devices/system/cpu/cpu2/cpufreq/scaling_setspeed"
setspeed4="/sys/devices/system/cpu/cpu3/cpufreq/scaling_setspeed"

set $*

case "$1" in
    button/power)
        #echo "PowerButton pressed!">/dev/tty5
        case "$2" in
            PBTN|PWRF)  logger "PowerButton pressed: $2" ;;
            *)          logger "ACPI action undefined: $2" ;;
        esac
        ;;
    button/sleep)
        case "$2" in
            SLPB)   echo -n mem >/sys/power/state ;;
            *)      logger "ACPI action undefined: $2" ;;
        esac
        ;;
    ac_adapter)
        case "$2" in
            AC*|ACAD*|ADP0*|AD*)
                case "$4" in
                    00000000)
                        echo -n $minspeed >$setspeed1
                        echo -n $minspeed >$setspeed2
                        echo -n $minspeed >$setspeed3
                        echo -n $minspeed >$setspeed4
                        #/etc/laptop-mode/laptop-mode start
                    ;;
                    00000001)
                        echo -n $maxspeed >$setspeed1
                        echo -n $maxspeed >$setspeed2
                        echo -n $maxspeed >$setspeed3
                        echo -n $maxspeed >$setspeed4
                        #/etc/laptop-mode/laptop-mode stop
                    ;;
                esac
                ;;
            *)  logger "ACPI action undefined: $2" ;;
        esac
        ;;
    battery)
        case "$2" in
            BAT0)
                case "$4" in
                    00000000)   #echo "offline" >/dev/tty5
                    ;;
                    00000001)   #echo "online"  >/dev/tty5
                    ;;
                esac
                ;;
            CPU0)
                ;;
            *)  logger "ACPI action undefined: $2" ;;
        esac
        ;;
    button/lid)
        case "$3" in
            close)
                #echo "LID closed!">/dev/tty5
                ;;
            open)
                #echo "LID opened!">/dev/tty5
                ;;
        esac
        ;;

    *)
        logger "ACPI group/action undefined: $1 / $2"
        ;;
esac

What I'm trying to do is to set cpu governor to ondemand when adapter is plugged in and powersave when adapter is unplugged. I saw that actions are undefined so I assumed that acpi is not recognizing actions (even with this:

ac_adapter)
           case "$2" in
           AC*|ACAD*|ADP0*|AD*)

)

entries in handler.sh .

Raynman - Looks like they are handled. acpi_listen shows ac_adapter events in addition to the undefined events that showed up in the log. These are handled by the case in your last quote. Then you have another case statement on $4 to distinguish between plugging (00000001) and unplugging (00000000). If you replace those echo statements by a call to cpufreq-set (or whatever else you can think of), it should work.

rzepaczyk - It's working, thanks for your help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.