# Turning off power automatically

## airflow

Hello,

I use Gentoo on a new desktop, which of course supports ACPI. When I command "shutdown -h now", I want the computer to shutdown completely, with automatic Power-off at the end. Therefore I compiled the kernel with ACPI-support.

The funny thing now is - it works! But only in about 75% of the cases. At first I thought I'm doing something differently all the time, but I'm now sure I'm not: It works most of the time, but sometimes the computer just stops while showing the last line "Power down". I then have to turn off the computer manually, which is a PITA, as a have to keep the button pressed for about 10 seconds until it really powers off. Anyone has an idea?

I just want to add that the computer uses a P4 with HT, I therefore compiled SMP in the kernel, too. Some people say that ACPI and SMP won't work flawlessly together. Could this be the reason?

regards,

airflow

----------

## mad man moon

SMP support is critical with ACPI. On my notebook it didn't work together, so I disabled SMP, now everything works perfectly.

----------

## airflow

Could you please state what exactly did not work? I ask because I have absolutely no problems with this configuration, apart from this power-off thing. I want to use hyperthreading. I also want to add that I don't need any power-saving features (it's a workstation), I just want that the machine is able to power-off itself.

regards,

airflow

----------

## steel300

You might want to consider the new mm-sources for HT. It's an option under processor features. SMP and ACPI have never played nice together. The whole common ACPI bus over multilpe procs is just a bad idea. Using the new mm sources will allow you to use SMT without SMP. That should fix the ACPI powerdown issue that you are experiencing.

----------

## mad man moon

Exactly nothing worked. I tried to use ACPI three or four times, compiled it in an then rebooted.

But my box froze during booting. After I followed the hint of disabling SMP everything works great.

----------

## airflow

Does anybody know if the problem with ACPI and SMP together still persists? I can't believe that those essential features are still not working in Linux... By the way, I can now say that the rate of working/non-working shutdowns is more like 50%-50%. This leads to the assumption, that one of the two processors (with hyperthreading you have two virtual processors, while in reality it is only one) is not able to shutdown the computer. So the chance that the "right" processor will try to shutdown the computer is exactly this rate (that's just an assumption, could be wrong)...

regards,

airflow

----------

## airflow

... Just for your information:

Seems that it works now (Kernel 2.6.7)!

 :Smile: 

airflow

----------

## ndarlow

I have an ASRock K7S41GX motherboard with Athlon XP 2200+ CPU. This motherboard doesn't support APM and reports itself as "ACPI Compliant".

I'm running 2.4.26 built with genkernel (because I operate a RAID-1 mirror and RAID in 2.6.x has some serious breakage) and am unable to powerdown from KDE or commandline.

Without acpid running (and ACPI modules loaded), a shutdown -h results in the following:

1) RAID superblocks are updated and devices set read-only

2) Power down is echoed to the console

3) The caches of IDE devices are flushed (hda, hde and cdrom)

4) USB drivers indicate going into S3 suspend state

5) The Caps Lock and Scroll lock keyboard LEDs flash

With acpid running (and ACPI modules loaded), a shutdown -h produces the following:

1) RAID superblocks are updated and devices set read-only

2) The Caps Lock and Scroll lock keyboard LEDs flash

In both cases the system is left in a powered state, i.e. the PSU fan can still be heard, and a press-and-hold of the Power Button results in the removal of power (the PSU fan stops) but the keyboard LEDs remain on permanently.

Just out of interest, and at the risk of not updating my RAID superblocks, I issued the command "halt -f -d -i -p" and the system was immediately powered-down correctly, keyboard included. Afterwards I had to resync the RAID and jfs_fsck the filesystems.

I suspect this is a kernel issue, and kernel-2.6.x behaves in the same way, but wondered if anyone has suggestions on how I should proceed now.

Regards,

Neil Darlow

----------

## thebigslide

Are you able to switch virtual terms and issue dmesg?  What's the last few lines.

edit: please also post your kernel power mgmt config.

----------

## ndarlow

 *thebigslide wrote:*   

> Are you able to switch virtual terms and issue dmesg?  What's the last few lines.
> 
> edit: please also post your kernel power mgmt config.

 

I guess you're looking for ACPI related stuff? Here's the output of dmesg:

SCSI subsystem driver Revision: 1.00

Initializing USB Mass Storage driver...

usb.c: registered new driver usb-storage

USB Mass Storage support registered.

ACPI: Power Button (FF) [PWRF]

ACPI: Processor [CPU1] (supports C1)

sis900.c: v1.08.06 9/24/2002

divert: allocating divert_blk for eth0

eth0: Realtek RTL8201 PHY transceiver found at address 1.

eth0: Using transceiver found at address 1 as default

eth0: SiS 900 PCI Fast Ethernet at 0xc000, IRQ 5, 00:0b:6a:4d:70:fd.

blk: queue 80186820, I/O limit 4095Mb (mask 0xffffffff)

blk: queue 801870d8, I/O limit 4095Mb (mask 0xffffffff)

intel8x0_measure_ac97_clock: measured 49918 usecs

intel8x0: clocking to 48000

eth0: Media Link On 100mbps full-duplex

parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE,EPP]

parport0: irq 7 detected

lp0: using parport0 (polling).

lp0: console ready

eth0: no IPv6 routers present

And my APM/ACPI related kernel configuration:

CONFIG_PM=y

CONFIG_APM=m

CONFIG_APM_IGNORE_USER_SUSPEND=y

CONFIG_APM_DO_ENABLE=y

CONFIG_APM_CPU_IDLE=y

CONFIG_APM_DISPLAY_BLANK=y

CONFIG_APM_RTC_IS_GMT=y

CONFIG_APM_ALLOW_INTS=y

CONFIG_APM_REAL_MODE_POWER_OFF=y

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=m

CONFIG_ACPI_BATTERY=m

CONFIG_ACPI_BUTTON=m

CONFIG_ACPI_FAN=m

CONFIG_ACPI_PROCESSOR=m

CONFIG_ACPI_THERMAL=m

CONFIG_ACPI_ASUS=m

CONFIG_ACPI_TOSHIBA=m

CONFIG_ACPI_DEBUG=y

CONFIG_ACPI_RELAXED_AML=y

dmesg indicates no APM BIOS detected and the apm.o module isn't loaded (it won't load).

I hope this helps in some manner.

Regards,

Neil Darlow

----------

