APM support for SMP Linux installs?

OS / Drivers / BIOS
Post Reply
merker19
Posts: 36
Joined: Thu May 22, 2003 8:46 pm

APM support for SMP Linux installs?

Post by merker19 »

Hi All:
I've been looking for some APM support (so my comp will powerdown when I issue the shutdown command) for my Linux installation of RH9 and I came across this from the Redhat site:

(x86 kernel) do NOT enable APM (advanced power management)! APM and SMP are not compatible, and your system will almost certainly (or at least probably ;)) crash while booting if APM is enabled (Jakob Oestergaard). Alan Cox confirms this : 2.1.x turns APM off for SMP boxes. Basically APM is undefined in the presence of SMP systems, and anything could occur.

Does anyone know if there's a fix for this or some other solution? It would be nice to see my comp powerdown when I tell it to shutdown.
Thx!
_merker19
tapeworm
Posts: 15
Joined: Thu Mar 06, 2003 10:44 am
Location: italy
Contact:

Post by tapeworm »

apm works ok for shutting down my bp6.
the only thing needed is to load the apm module with the parameter "power_off=1".
ImagePowered by Debian Sid/Unstable on 2.6.8-1-686-smp...
Homer S.
Posts: 20
Joined: Wed Aug 14, 2002 2:43 am
Location: Italy

Post by Homer S. »

Hi,

I knew there's a trouble with APM vs. SMP in that there's no safe way to shutdown system properly (i.e. sharply synchronizing both CPUs). I also read some explanation about that once, but don't remember where :oops:.
Older Red Hat releases installed only single-CPU kernel at start, so you could get APM work just because second CPU was totally ignored. If you recompiled kernel with SMP support, in fact, APM was automatically disabled for safety's sake.

But now that you pointed out the trouble again, I made some research and found this and this: it really sounds like there's actually no trouble with SMP in itself, but only with BP6's APIC, so that APM could work just fine. I'll have a look at mine and try (but now I'm using my BP6 PC as a little "server" with no monitor, keyboard and mouse, so I have to pay attention while modifying settings :wink:).
Homer S.
tapeworm
Posts: 15
Joined: Thu Mar 06, 2003 10:44 am
Location: italy
Contact:

Post by tapeworm »

look at this:

$ dmesg |grep apm
apm: BIOS version 1.2 Flags 0x07 (Driver version 1.16ac)
apm: disabled - APM is not SMP safe (power off active).


in effect apm IS disabled, but poweroff is kept active. and it just works.
ImagePowered by Debian Sid/Unstable on 2.6.8-1-686-smp...
merker19
Posts: 36
Joined: Thu May 22, 2003 8:46 pm

Post by merker19 »

thanks a lot for the replies, guys! I need some help to implement the solution. Should I edit the apm.c file or should I try to locate the apm module and download the patched version? Sorry, I'm new at this and I need a little push in the right direction.
TIA!
_merker19
merker19
Posts: 36
Joined: Thu May 22, 2003 8:46 pm

Post by merker19 »

Hi tapeworm:
I get the following response too.

apm: BIOS version 1.2 Flags 0x07 (Driver version 1.16)
apm: disabled - APM is not SMP safe.

_merker19
tapeworm
Posts: 15
Joined: Thu Mar 06, 2003 10:44 am
Location: italy
Contact:

Post by tapeworm »

you need to load the apm module with the parameter "power_off=1".

i found this solution (works with both 2.4 and 2.6 kernels) looking at how knoppix was able tu shutdown my bp6.

try knoppix and look for yourself if it works.

on debian and debian-based distributions you need to look at the file /etc/modules, it contains a list of modules that the operative system loads at startup. i put the line "apm power_off=1" there. done.
on redhat or others probably you need to look at /etc/modules.conf or a similar name, i don't know exactly.

oh, obviously you need to have apm support compiled as a module, and not directly in your kernel. if it is compiled directly in your kernel, it will load before looking at /etc/modules and therefore without the option power_off=1. in this case you probably need to pass it the option power_off=1 at boot time, but i don't know exacly how.
if you don't know if you have an apm module or not do this:

# modprobe -l |grep apm
/lib/modules/2.6.0-test9/kernel/arch/i386/kernel/apm.ko

here is mine.

or for example on a 2.4 kernel:

# modprobe -l |grep apm
/lib/modules/2.4.20-1-686/kernel/arch/i386/kernel/apm.o

to see if you currently have an apm module loaded, do:

# lsmod |grep apm
apm 17104 0

in this case you could unload it and reload it with the proper option:

#rmmod apm
#modprobe apm power_off=1

and this time your pc should power off correctly. putting the option in /etc/modules makes this happen at every boot.
ImagePowered by Debian Sid/Unstable on 2.6.8-1-686-smp...
merker19
Posts: 36
Joined: Thu May 22, 2003 8:46 pm

Post by merker19 »

wow! awesome! I can't wait to try this at home. Thanks tapeworm!
merker19
Posts: 36
Joined: Thu May 22, 2003 8:46 pm

Post by merker19 »

modprobe and lsmod weren't commands that my bash shell understood. I did locate the apm executable:

/usr/bin/apm

I tried to execute apm, but it returned:

"No APM support in kernel"

I guess I need to load this module or compile it into the kernel?

Any ideas? I'll look through RH's site to see if I can find an answer.
_merker19
Abit BP6 mobo (BIOS RU)
2 500Mhz Celeron CPU's
Voltage Regulator mod applied!
640MB RAM
3dfx Voodoo 3000 16MB
IBM 14Gig HD
Western Digital ATA/100 160Gig HD (on HPT366)
3Com 10/100 NIC
Pioneer 8x CD-ROM
Ricoh 2x CD-RW
Windows 2000 Server, SP4
hyperspace
Board Admin
Posts: 1395
Joined: Wed Jul 24, 2002 7:39 am
Location: Lincoln, NE USA
Contact:

Post by hyperspace »

merker19 wrote:modprobe and lsmod weren't commands that my bash shell understood. _merker19
They should be in the directory, /sbin.

You'll need to run these as root.
Quantum WormHole

Image
lost in hypertime...
merker19
Posts: 36
Joined: Thu May 22, 2003 8:46 pm

Post by merker19 »

affirmative. I'll give it a shot. thx hyper!
Abit BP6 mobo (BIOS RU)
2 500Mhz Celeron CPU's
Voltage Regulator mod applied!
640MB RAM
3dfx Voodoo 3000 16MB
IBM 14Gig HD
Western Digital ATA/100 160Gig HD (on HPT366)
3Com 10/100 NIC
Pioneer 8x CD-ROM
Ricoh 2x CD-RW
Windows 2000 Server, SP4
merker19
Posts: 36
Joined: Thu May 22, 2003 8:46 pm

Post by merker19 »

I went into the sbin directory and executed the suggested modprobe and lsmod commands, but they returned nothing --which means they ran correctly, but nothing returned. I did finally locate the apm module and it's called apmd and I did a rpm -q apmd and got:

apmd-3.0.2-18

When I execute apmd, I get:

No APM support in kernel

Any suggestions? Thx!
_merker19
tapeworm
Posts: 15
Joined: Thu Mar 06, 2003 10:44 am
Location: italy
Contact:

Post by tapeworm »

please became root and do everything as the root user, you can do that typing:
$ su -
and entering the root password
the bash prompt will change from $ to #

apmd is NOT the apm module. do NOT use it. you don't need it to shut down your pc, i assure you.
apmd is a program, more precisely a daemon, used to monitor and control apm features that will be disabled in any case on the bp6. leave that alone.

the apm module is NOT a program, you cannot execute it, and you don't need to execute it.
it is a file called apm.o (or apm.ko in 2.6 kernels) and it is located in /lib/modules/xxxxxx/kernel/arch/i386/kernel/apm.o
where xxxxx is the name of your kernel, you can find out it in this way:
# uname -r
you can do this with only one line:
# ls /lib/modules/`uname -r`/kernel/arch/i386/kernel
if apm.o is not located there, you can't load it because either it is included in the kernel or it is not included, in this case i cannot help you and the following will not apply. this problem is in any case solvable, you can change your kernel, you can recompile your kernel, but probably you need to learn some other things about your system before, so for now you could put the "shutdown issue" on hold.

now, what to do if the apm.o module is really there.
check if it is loaded with the command
# lsmod
if it is not listed you need to load it
if there is no list or the list is empy there is something wrong or strange and i cannot help.

if it is listed you need to unload it before. just type
# rmmod apm

to load (or reload) it you need to execute:
# modprobe apm poweroff=1
if there is no output it is probably ok
now you can check if it is really loaded, execute another:
# lsmod
and you shoud see it. and now the system should halt properly.

i don't have much to add, this is all i know. i think that a more appropriate way to deal with this kind of problems is speaking in realtime with the people, either using irc or some im like icq and the like. if you want to try this way you can find my icq uin below, just load gaim, register yourself and search for it. if you prefer irc just ask.

i would suggest that you post here the exact output of the commands below (commands and everything included and executed as the root user, just copy and paste here, probably you need to select the text in the console then press the middle mouse button to write out the content of the clipboard, sorry if you already know all of this but better be sure), this could help:

# /sbin/modprobe -l

# /sbin/lsmod

# uname

# ls /lib/modules/`uname -r`/kernel/arch/i386/kernel

# cat /etc/modules.conf

yes i know some of this commands gave you nothing on output, but a copy and paste of your console is often more rich of info.

sorry for the lenght...
ImagePowered by Debian Sid/Unstable on 2.6.8-1-686-smp...
merker19
Posts: 36
Joined: Thu May 22, 2003 8:46 pm

Post by merker19 »

thanks tapeworm. No problem about the length of your message. The more info, the better. I'll definitely give your suggestions a try. So far, its been really great hearing from everybody and the suggestions/help have been excellent. Thanks everyone.
_merker19

PS --Yes, I am doing everything as root. It's just easier. Thanks.
tomatoeboy
Posts: 73
Joined: Thu Jul 25, 2002 6:34 pm
Location: Salisbury, UK
Contact:

Post by tomatoeboy »

An easy way to make Mandrake (at least 9.0 anyway) shut down is to put append="apm=power-off" in the options line of the lilo.conf entry for the SMP image. Works for me. :)
Post Reply