# ACPI: poweroff not working on shutdown (SMP) - SOLVED

## Luud

Hi All,

First of all, I did some searching, but couldn't find the solution to my problem. When calling shutdown -h now, I see the power off message, I hear the harddisks parking and the computers stays on power. Off course, I would like to see it power down.  :Wink: 

I'm running Gentoo on an SMP machine, dual athlon on an ASUS A7M266-D. In the past poweroff was working for me. However, due to a broken haddisk I had to reinstall from scratch. 

I'm using kernel 2.4.22-gentoo-r5 with SMP and ACPI enabled.

ACPI gets detected and I can find it in /proc. In DMESG I see an error, but I'm not sure it is related to my problem.

Lets give you some details:

```
# dmesg | grep ACPI

ACPI BALANCE SET

Using ACPI (MADT) for SMP configuration information

ACPI: Subsystem revision 20031002

    ACPI-0109: *** Error: No object was returned from [\_SB_.PCI0.UAR2._STA] (Node f651ff00), AE_NOT_EXIST

ACPI: Interpreter enabled

ACPI: Using IOAPIC for interrupt routing

ACPI: System [ACPI] (supports S0 S1 S4 S5)

ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)

ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 *10 11 12 14 15)

ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 9 10 11 12 14 15)

ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 *9 10 11 12 14 15)

ACPI: PCI Root Bridge [PCI0] (00:00)

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PCI1._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PCI2._PRT]

PCI: Using ACPI for IRQ routing

ACPI: Power Button (FF) [PWRF]

ACPI: Sleep Button (FF) [SLPF]

ACPI: Processor [CPU0] (supports C1)

ACPI: Processor [CPU1] (supports C1)
```

```
# ls -Rl /proc/acpi

/proc/acpi:

total 0

dr-xr-xr-x    2 root     root            0 Jan 18 02:29 ac_adapter

-rw-r--r--    1 root     root            0 Jan 18 02:29 alarm

dr-xr-xr-x    2 root     root            0 Jan 18 02:29 battery

dr-xr-xr-x    4 root     root            0 Jan 18 02:29 button

-r--------    1 root     root            0 Jan 18 02:29 dsdt

dr-xr-xr-x    2 root     root            0 Jan 18 02:29 embedded_controller

-r--------    1 root     root            0 Jan 18 02:19 event

-r--------    1 root     root            0 Jan 18 02:29 fadt

dr-xr-xr-x    2 root     root            0 Jan 18 02:29 fan

-r--r--r--    1 root     root            0 Jan 18 02:29 info

dr-xr-xr-x    2 root     root            0 Jan 18 02:29 power_resource

dr-xr-xr-x    4 root     root            0 Jan 18 02:29 processor

-rw-r--r--    1 root     root            0 Jan 18 02:29 sleep

dr-xr-xr-x    2 root     root            0 Jan 18 02:29 thermal_zone

/proc/acpi/ac_adapter:

total 0

/proc/acpi/battery:

total 0

/proc/acpi/button:

total 0

dr-xr-xr-x    3 root     root            0 Jan 18 02:29 power

dr-xr-xr-x    3 root     root            0 Jan 18 02:29 sleep

/proc/acpi/button/power:

total 0

dr-xr-xr-x    2 root     root            0 Jan 18 02:29 PWRF

/proc/acpi/button/power/PWRF:

total 0

-r--r--r--    1 root     root            0 Jan 18 02:29 info

/proc/acpi/button/sleep:

total 0

dr-xr-xr-x    2 root     root            0 Jan 18 02:29 SLPF

/proc/acpi/button/sleep/SLPF:

total 0

-r--r--r--    1 root     root            0 Jan 18 02:29 info

/proc/acpi/embedded_controller:

total 0

/proc/acpi/fan:

total 0

/proc/acpi/power_resource:

total 0

/proc/acpi/processor:

total 0

dr-xr-xr-x    2 root     root            0 Jan 18 02:29 CPU0

dr-xr-xr-x    2 root     root            0 Jan 18 02:29 CPU1

/proc/acpi/processor/CPU0:

total 0

-r--r--r--    1 root     root            0 Jan 18 02:29 info

-rw-r--r--    1 root     root            0 Jan 18 02:29 limit

-rw-r--r--    1 root     root            0 Jan 18 02:29 performance

-r--r--r--    1 root     root            0 Jan 18 02:29 power

-rw-r--r--    1 root     root            0 Jan 18 02:29 throttling

/proc/acpi/processor/CPU1:

total 0

-r--r--r--    1 root     root            0 Jan 18 02:29 info

-rw-r--r--    1 root     root            0 Jan 18 02:29 limit

-rw-r--r--    1 root     root            0 Jan 18 02:29 performance

-r--r--r--    1 root     root            0 Jan 18 02:29 power

-rw-r--r--    1 root     root            0 Jan 18 02:29 throttling

/proc/acpi/thermal_zone:

total 0
```

```
# cat /boot/grub/grub.conf

default 0

timeout 30

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Gentoo Linux r5-0

root (hd0,0)

kernel (hd0,0)/boot/vmlinuz-2.4.22-r5-0 root=/dev/hda3 acpi=force
```

```
# ls -Rl /etc/acpi/

/etc/acpi/:

total 5

-rwxr-xr-x    1 root     root          332 Jan 17 16:48 default.sh

drwxr-xr-x    2 root     root           72 Jan  5 20:21 events

/etc/acpi/events:

total 4

-rw-r--r--    1 root     root          630 Jan 17 16:48 default
```

I installed acpid and it is running. I can turn off my monitor using DPMS. I think you need ACPI (or apm, but that doesn't work on SMP) for that, but I'm not sure.

Am I missing scripts (/etc/acpi)? Do I need to emerge some base package(s) again, as I didn't have acpi in my USE flags. (I do have it now but that will only work on newly emerge packages that use this setting). I have had the acpi package installed as well (not any more), but that didn't make any difference.

All help is greatly appreciated.

----------

## Luud

Hi again,

Just checked if the power button triggers a shutdown, and it does.

ACPI seems to be working. My guess is it isn't called on shutdown (properly) to power off...

----------

## Luud

I figured out that the halt command is the one issueing the actual power off call.

So I decided to re-emerge the baselayout package, as that is where the halt command is located. (baselayout contains the sysVInit tools). Now I did have the acpi use flag set, but it makes no difference.

Next try is to compile in kernel support for the AMD 76x Native power management (hard compiled into the kernel, no module, as that results in an unused module when loading it into the kernel).

See if this helps...

----------

## Luud

Well, that didn't work.

It said that the native amd 76x power management is experimental, so I can't say I wasn't warned. When I use this, the systems falls asleep (or something similar) once in a while. Pressing a key triggers a wake or something and the system continues. This occurs during the starup of the various services when booting the system. Using acpi=nopci option to turn of IRQ handling via ACPI (as the kernel messages said) didn't help either.

And still the system won't power off.

Installing the acpi package doesn't seem to be related to poweroff. It seems to display system information such as battery status and thermal information (which isn't avaliable on my system).

I'm trying to use now both APM and ACPI in the kernel. This isn't exactly the proper way, yet I hope that ACPI keeps working and APM is turned off (I remember seeing a kernal message the APM will be turned off on SMP machines), except for poweroff...

----------

## Luud

SOLVED !

The last try (as described in the previous post) does work. For some reason, switching on APM also fixes the ACPI error.

The reason it works now is either (as I can think of):

1. APM is turned of for managing power resources, but is still used to power off

2. By turning of APM, the system turns into ACPI mode and therefore ACPI works correctly now (which removed the error message).

Either way. I'm happy now. I do have ACPI support and my computer shuts down properly!   :Very Happy: 

Just for your information, the current kernel messages from dmesg:

```
# dmesg | egrep -i "ACPI|APM"

ACPI: Subsystem revision 20031002

 tbxface-0117 [03] acpi_load_tables      : ACPI Tables successfully acquired

ACPI Namespace successfully loaded at root c017009c

evxfevnt-0093 [04] acpi_enable           : Transition to ACPI mode successful

ACPI: Interpreter enabled

ACPI: Using IOAPIC for interrupt routing

ACPI: System [ACPI] (supports S0 S1 S4 S5)

ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)

ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 *10 11 12 14 15)

ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 9 10 11 12 14 15)

ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 *9 10 11 12 14 15)

ACPI: PCI Root Bridge [PCI0] (00:00)

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PCI1._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PCI2._PRT]

PCI: Using ACPI for IRQ routing

PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off'

apm: BIOS version 1.2 Flags 0x03 (Driver version 1.16)

apm: disabled - APM is not SMP safe.

ACPI: Power Button (FF) [PWRF]

ACPI: Sleep Button (FF) [SLPF]

ACPI: Processor [CPU0] (supports C1)

ACPI: Processor [CPU1] (supports C1)
```

And an extraction from the .config kernel configuration

```
# cat /usr/src/linux/.config | egrep -i "ACPI|APM"

# CONFIG_HOTPLUG_PCI_ACPI is not set

CONFIG_APM=y

# CONFIG_APM_IGNORE_USER_SUSPEND is not set

# CONFIG_APM_DO_ENABLE is not set

# CONFIG_APM_CPU_IDLE is not set

# CONFIG_APM_DISPLAY_BLANK is not set

# CONFIG_APM_RTC_IS_GMT is not set

# CONFIG_APM_ALLOW_INTS is not set

# CONFIG_APM_REAL_MODE_POWER_OFF is not set

# ACPI Support

CONFIG_ACPI=y

CONFIG_ACPI_BOOT=y

CONFIG_ACPI_BUS=y

CONFIG_ACPI_INTERPRETER=y

CONFIG_ACPI_EC=y

CONFIG_ACPI_POWER=y

CONFIG_ACPI_PCI=y

CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_SYSTEM=y

CONFIG_ACPI_AC=y

CONFIG_ACPI_BATTERY=y

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_FAN=y

CONFIG_ACPI_PROCESSOR=y

CONFIG_ACPI_THERMAL=y

# CONFIG_ACPI_ASUS is not set

# CONFIG_ACPI_TOSHIBA is not set

CONFIG_ACPI_DEBUG=y

CONFIG_ACPI_RELAXED_AML=y
```

Maybe it helps others experiencing the same problem.

----------

## jhr0771

This worked for me to be able to see the power button events in a gento-dev-sources 2.6.2-r1. The problem is can't see any ac_adapter events. Any idea ?

----------

## jchomarat

I've done that too, but when I restart my box, my fglx driver does not load. I did not resintall it as i've never done a reintallation after a compile. I reinstall only alsa.

As you have a radeon 9700 (i have a 9800), you did not face any similar problems?

----------

## Luud

jhr0771

I don't have any of those either. I can see the power button and CPU specs. That's about it.

```
ls -Ra /proc/acpi/

/proc/acpi/:

.   alarm   debug_layer  dsdt                 event  info            processor

..  button  debug_level  embedded_controller  fadt   power_resource  sleep

 

/proc/acpi/button:

.  ..  power  sleep

 

/proc/acpi/button/power:

.  ..  PWRF

 

/proc/acpi/button/power/PWRF:

.  ..  info

 

/proc/acpi/button/sleep:

.  ..  SLPF

 

/proc/acpi/button/sleep/SLPF:

.  ..  info

 

/proc/acpi/embedded_controller:

.  ..

 

/proc/acpi/power_resource:

.  ..

 

/proc/acpi/processor:

.  ..  CPU0  CPU1

 

/proc/acpi/processor/CPU0:

.  ..  info  limit  performance  power  throttling

 

/proc/acpi/processor/CPU1:

.  ..  info  limit  performance  power  throttling
```

Good luck

----------

## Luud

jchomarat:

No, I haven't seen that problem. I don't even see that problem when upgrading XFree   :Very Happy: 

I can only say that the things I wrote work for me.

Success

----------

## bludger

As far as I am concerned, using APM instead of ACPI is a workaround and not a complete fix for this problem.  My system would poweroff with 2.4.22 without APM, but does not poweroff with 2.6.5.  Looking through the kernel mailing list, it seems to be a known problem.  There seems to be an open bug report at:

http://bugzilla.kernel.org/show_bug.cgi?id=1355

It seems that this was also broken in 2.4.23, but that is now a fix in 2.4.26 according to:

http://marc.theaimsgroup.com/?l=linux-kernel&m=108194865207510&w=2

----------

