Bugzilla – Bug 221667
smp/default kernel does not power off apm machines by default
Last modified: 2007-10-07 05:49:36 UTC
arch/i386/kernel/apm.c: 395-#ifdef CONFIG_SMP 396:static int power_off; 397-#else 398:static int power_off = 1; 399-#endif So after upgrading to 10.2 some machines don't power off anymore. Is there any reason to keep the above differentiation? The connection between not powering off anymore and the new default of having an SMP kernel on UP machines is really not obvious.
*** Bug 220716 has been marked as a duplicate of this bug. ***
Well... yes, this means power_off is disabled by default on CONFIG_SMP builds... that is because apm is often broken w.r.t. SMP. I guess it did not bite us before, because we used to avoid CONFIG_SMP kernels on UP machines. What about sticking power_off = (num_online_cpus() == 1); at begining of apm_setup()? Or maybe teaching installer to add "power_off" on UP machines running without ACPI? Ludwig, can you confirm that power_off on command line fixes your problem? ...actually, given mess apm.c is, I'd prefer to fix it by command line options. It looks power_off parameter can enable/disable APM....
*** Bug 223623 has been marked as a duplicate of this bug. ***
yes the command line parameter fixes the problem
I'd really prefer installer people to add "power_off" to the command line on UP machines... Who should I ask to do that?
Can you add power_off command line parameter to UP all uniprocessor kernels?
reassigned to yast2-bootloader maintainer
(In reply to comment #0) > arch/i386/kernel/apm.c: > 395-#ifdef CONFIG_SMP > 396:static int power_off; > 397-#else > 398:static int power_off = 1; > 399-#endif > > So after upgrading to 10.2 some machines don't power off anymore. Is there any > reason to keep the above differentiation? The connection between not powering > off anymore and the new default of having an SMP kernel on UP machines is > really not obvious. > ========== This bug doesn't seem to be only with smp kernels, as I am using the default kernel with the same problem. Changing the BIOS setting of the motherboard (ACPI Aware OS) to "yes" causes a proper power off. First SuSE version ever that required a bios adjustment.
Olaf, are you there? I'm getting duplicates of this one, already :-(.
Hello, what is the status on this? I am experiencing the same annoying problem on a UP desktop computer. Would be nice to know what can be done -- I am fine with a command line option.
booting with apm=power_off fixes it for me, on smirnow.suse.de.
*** Bug 231216 has been marked as a duplicate of this bug. ***
Yep, booting with apm=power_off fixes it, and it is the right fix => we need YaST or whatever component is responsible to add that parameter. I do not think that is hard to do, and I do not think it should take a month. Please someone take 5 minutes and add the parameter... (Raising severity to get on radar; we are getting too many duplicates of this one).
*** Bug 227384 has been marked as a duplicate of this bug. ***
*** Bug 233373 has been marked as a duplicate of this bug. ***
apm=power_off does not work for me: ASUS P3B-F (ACPI BIOS rev. 1006) it is the ATX motherboard. With acpi=force the power off button is dead (no reaction), without it the computer is turned off. So the apm=... does not make any difference. The problem is introduced with 10.x series, with 9.x suse it worked ok.
I understand that you want to set a kernel parameter ("apm=power_off"). It also seems that you only want to set this on uniprocessor machines. yast2-bootloader does not determine whether we are running on a UP or SMP machine. So it cannot decide whether this parameter needs to be set. The logic that decides when to set this parameter does not belong in yast2-bootloader. It needs to be maintained in a module that "knows" how to handle these parameters. Someone needs to take charge of this. That module can use the yast2-bootloader interface to get & set these parameters: Bootloader::getKernelParam (Bootloader::defaultSection(), "elevator"); Bootloader::setKernelParam (Bootloader::defaultSection(), "elevator", "cfg"); It can be used from other YaST2 modules. Please have a look at feature #110070 "Elevator Setting" for a related problem and discussion.
> I understand that you want to set a kernel parameter ("apm=power_off"). Me? No. I want to be able to use power off button (hardware) to shutdown the system. So I entered apm=power_off as a booting option (in grub) to check if this helps. > Please have a look at feature #110070 "Elevator Setting" I don't know where I should look -- I tried report with such number, but I cannot access it.
Maciej: That's ok, that message was probably directed at me. Feature# is FATE, you probably do not have access to it. Olaf: can we just set it unconditionaly (SMP or UP)? It is probably better than nothing...
I can report that booting with apm=power_off enables my computer to shut down completely (bug #233373).
Hmmm... need to put the default setup into a section that is run before the __setup() stuff. That means it should be something like this: ----------------------------------------------------------------- #ifdef CONFIG_SMP static __init apm_poweroff_init() { power_off = (num_online_cpus() == 1); } core_initcall(apm_poweroff); #endif ----------------------------------------------------------------- Checking...
Why to have different default behavior for acpi and apm? I can't see the advantage to set a boot-option with apm to power-off and no boot-option with acpi. When there is a rare reason not to power-off (I think most people want to power-off with "init 0"), why not to introduce a parameter apm=no_power_off ? The more boot-options we have to set, the more user-unfriendly grub will be to handle
mbra@gmx.ch, comment #24: yes, my current suggestion is to fix this in the kernel. BTW, apm=no_power_off does exist already.
There is a new fix in patches.suse/apm_setup_UP.diff. It seems there is no way to use num_online_cpus() earlier, because boot_cpu_init() is also called when the other __init functions are called. So, if necessary, we need to set the default value after all __init functions have run. I introduced a new function apm_poweroff_init() that is called later during the late_initcall phase. It will check if the kernel parameter was found and otherwise initialize power_off to (num_online_cpus() == 1).
Olaf: yes, that should do the trick. I was aware of num_online_cpus() not running early enough, and did not want to hack already ugly apm.c. Thanks for your work. Can interested parties checkout tommorow's kernel of the day? The problem should be fixed, even without adding command line parameter. (If apm=power_off did not fix the problem for you... you are probably experiencing another problem... and that report should be reopened because it was not really a duplicate).
Tested and submitted to kernel CVS head and SL102_BRANCH. linux-kernel still pending.
*** Bug 136742 has been marked as a duplicate of this bug. ***
Maybe it will help some readers -- acpi=force in opensuse 10.3 does the trick, instead of ignoring power off button (opensuse 10.2) now it enables normal shutdown.