ACPI poweroff fixes for 2.4.26-pre2]
A message that is not in the archive (sent off-list or not yet received): 1079031999.3679.1.camel@darkstar
A message that is not in the archive (sent off-list or not yet received): 1079031999.3679.1.camel-4/[email protected]
Thanks!
I tried to combine the two patches to apply to 2.4.25 and came up with
drivers/acpi/system.c Thu Mar 11 13:12:11 2004 renamed from drivers/acpi/system.c.orig Fri Nov 28 10:26:19 2003 +7 -0
@@ -40,6 +40,7 @@ #include <asm/acpi.h> #include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> +#include <linux/sched.h> #ifdef CONFIG_X86 #ifdef CONFIG_ACPI_SLEEP
@@ -95,6 +96,12 @@ { if (unlikely(in_interrupt())) BUG(); +#ifdef CONFIG_SMP + /* Some SMP machines only can poweroff in boot CPU */ + set_cpus_allowed(current, 1 << cpu_logical_map(0)); +#endif + pm_send_all(PM_SAVE_STATE, (void *)3); + pm_send_all(PM_SUSPEND, (void *)3); acpi_enter_sleep_state_prep(ACPI_STATE_S5); ACPI_DISABLE_IRQS(); acpi_enter_sleep_state(ACPI_STATE_S5);
however, this still fails to poweroff the box.
Furthermore, I found the patch
drivers/acpi/system.c 2004-03-08 09:36:19.813378040 +0800 renamed from drivers/acpi/system.c 2004-03-08 09:29:30.925538440 +0800 +3 -0
@@ -40,6 +40,7 @@ #include <asm/acpi.h> #include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> +#include <linux/sched.h> #ifdef CONFIG_X86 #ifdef CONFIG_ACPI_SLEEP
@@ -95,6 +96,8 @@ acpi_power_off (void) { if (unlikely(in_interrupt())) BUG(); + /* Some SMP machines only can poweroff in boot CPU */ + set_cpus_allowed(current, 1UL << cpu_logical_map(0)); acpi_enter_sleep_state_prep(ACPI_STATE_S5); ACPI_DISABLE_IRQS(); acpi_enter_sleep_state(ACPI_STATE_S5);
which does not poweroff the system either (although CONFIG_ACPI_SLEEP=y is set in .config).
Martin
Quoted 94 lines · Sérgio Monteiro Basto
you can try this one
-----Forwarded Message-----
Quoted 87 lines
From: Willy Tarreau <[email protected]>
To: Pavel Machek <[email protected]>
Cc: Marcelo Tosatti <marcelo.tosatti-3EexvZdKGZRWk0Htik3J/[email protected]>, [email protected], [email protected]
Subject: [ACPI] [PATCH] ACPI poweroff fixes for 2.4.26-pre2
Date: Wed, 10 Mar 2004 00:33:25 +0100Hi Pavel,
Quoted 10 lines · Pavel Machek
Can you replace
acpi_system_save_state()withpm_send_all(PM_SAVE_STATE, (void *)3); pm_send_all(PM_SUSPEND, (void *)3);?
That should fix it, too, and does not depend on
CONFIG_ACPI_SLEEP.Just checked, and I still can poweroff (which was a bit expected anyway, but now confirmed). So with this little patch against 2.4.26-pre2, poweroff does not depend on
CONFIG_ACPI_SLEEPanymore, as you fairly requested (thank you for having insisted).diff -urN
linux-2.4.26-pre2/drivers/acpi/system.clinux-2.4.26-pre2-pwoff/drivers/acpi/system.cdrivers/acpi/system.c +2
-8@@ -45,13 +45,6 @@#include <linux/mc146818rtc.h> #include <linux/irq.h> #include <asm/hw_irq.h> - -acpi_status acpi_system_save_state (u32 ); -#else -static inline acpi_status acpi_system_save_state (u32 state) -{ -return AE_OK ; -}#endif /* !CONFIG_ACPI_SLEEP */ #define _COMPONENT ACPI_SYSTEM_COMPONENT@@ -99,7 +92,8 @@ {if (unlikely (in_interrupt ()))BUG (); -acpi_system_save_state (ACPI_STATE_S5 ); +pm_send_all (PM_SAVE_STATE , (void *)3 ); +pm_send_all (PM_SUSPEND , (void *)3 );acpi_enter_sleep_state_prep (ACPI_STATE_S5 );ACPI_DISABLE_IRQS ();acpi_enter_sleep_state (ACPI_STATE_S5 );Len, do you have any objection against this one ? BTW, did you get the previous one dedicated to SMP ? Here it is rediffed after this one, just in case :
diff -urN
linux-2.4.26-pre2-pwoff/drivers/acpi/system.clinux-2.4.26-pre2-pwoff-smp/drivers/acpi/system.cdrivers/acpi/system.c +5
-0@@ -40,6 +40,7 @@#include <asm/acpi.h> #include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> +#include <linux/sched.h> #ifdef CONFIG_ACPI_SLEEP #include <linux/mc146818rtc.h> @@ -92,6 +93,10 @@ {if (unlikely (in_interrupt ()))BUG (); +#ifdef CONFIG_SMP +/* Some SMP machines only can poweroff in boot CPU */ +set_cpus_allowed (current,1 <<cpu_logical_map (0 )); +#endif pm_send_all (PM_SAVE_STATE , (void *)3 );pm_send_all (PM_SUSPEND , (void *)3 );acpi_enter_sleep_state_prep (ACPI_STATE_S5 );Cheers,
WillySignature · 1 line
Sérgio M. B.
Signature · 14 lines
Martin Siegert Manager, Research Services WestGrid Site Manager Academic Computing Services phone: (604) 291-4691 Simon Fraser University fax: (604) 291-4242 Burnaby, British Columbia email: [email protected] Canada V5A 1S6 ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
A message that is not in the archive (sent off-list or not yet received): 20040311230047.GA20345-0ze2hujOWYhqr3d4nwidZ7Dks+cytr/[email protected]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Salut Martin,
I first thought, that you went the right path, as you use a smp-system, to apply the mentioned patches for the smp-poweroff problem.
For my uni-processor (laptop) I had a different problem with poweroff, and a solution (patch):
http://bugme.osdl.org/show_bug.cgi?id=2183
Please do not be confused. Len thought, that it would be a dublicate to bug 2109, so I posted the patch there. Personally I don't think that the problems are the same, as they did start with different versions...but of the same file...
Ok. maybe you will have a try with my patch ("hwsleep.c revert part of v1.23 introduced cond. when S5") from 4th of march. I would think, that you will need the smp-patch anyway. But I am just guessing.
Cheers
hartwig
drivers/acpi/system.c 2004-03-08 09:36:19.813378040 +0800 acpi_power_off (void)
Quoted 11 lines · Martin Siegert
I tried to combine the two patches to apply to 2.4.25 and came up with
drivers/acpi/system.c Thu Mar 11 13:12:11 2004 renamed from drivers/acpi/system.c.orig Fri Nov 28 10:26:19 2003 +0
-0@@ -40,6 +40,7 @@@@ -95,6 +96,12 @@drivers/acpi/system.c 2004-03-08 09:36:19.813378040 +0800 renamed from drivers/acpi/system.c 2004-03-08 09:29:30.925538440 +0800 +0
-0@@ -40,6 +40,7 @@@@ -95,6 +96,8 @@ acpi_power_off (void)
Gruß
hartwig felger
Hartwig Felger informatics
- --
1024D/339FD693 Hartwig Felger <[email protected]> Key fingerprint = FB2F 3EE9 345A D55B 6FF2 0EC1 F5B0 684F 339F D693 For the pulic keys, please visit my page.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFAUYsF9bBoTzOf1pMRAlOZAKCvbR65c3pmiQPVfw4ZAlrg6NizZQCgiJjr 58hnH6PxL8IZPmf0/nNKZ+U=
=raJH
-----END PGP SIGNATURE-----
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
A message that is not in the archive (sent off-list or not yet received): Pine.LNX.4.58.0403121055010.1203-KnfdeQs3A3X/[email protected]
Hallo Hartwig:
thanks a million! Yes, your patch from
http://bugme.osdl.org/attachment.cgi?id=2286
indeed fixes my problem (I did install your patch in addition to the smp patches). The machine (sual Athlon MP) now powers off as it did under 2.4.24.
Viele Gruesse aus Vancouver,
Martin
Quoted 50 lines · On Fri, Mar 12, 2004 at 11:03:43AM +0100…
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Salut Martin,
I first thought, that you went the right path, as you use a smp-system, to apply the mentioned patches for the smp-poweroff problem.
For my uni-processor (laptop) I had a different problem with poweroff, and a solution (patch):
http://bugme.osdl.org/show_bug.cgi?id=2183
Please do not be confused. Len thought, that it would be a dublicate to bug 2109, so I posted the patch there. Personally I don't think that the problems are the same, as they did start with different versions...but of the same file...
Ok. maybe you will have a try with my patch ("hwsleep.crevert part of v1.23 introduced cond. when S5") from 4th of march. I would think, that you will need the smp-patch anyway. But I am just guessing.Cheers
hartwigdrivers/acpi/system.c 2004-03-08 09:36:19.813378040 +0800 acpi_power_off (void)
Quoted 11 lines · Martin Siegert
I tried to combine the two patches to apply to 2.4.25 and came up with
drivers/acpi/system.c Thu Mar 11 13:12:11 2004 renamed from drivers/acpi/system.c.orig Fri Nov 28 10:26:19 2003 +0
-0@@ -40,6 +40,7 @@@@ -95,6 +96,12 @@drivers/acpi/system.c 2004-03-08 09:36:19.813378040 +0800 renamed from drivers/acpi/system.c 2004-03-08 09:29:30.925538440 +0800 +0
-0@@ -40,6 +40,7 @@@@ -95,6 +96,8 @@ acpi_power_off (void)Gruß
hartwig felgerHartwig Felger informatics
- --
1024D/339FD693 Hartwig Felger <[email protected]> Key fingerprint = FB2F 3EE9 345A D55B 6FF2 0EC1 F5B0 684F 339F D693 For the pulic keys, please visit my page.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)iD8DBQFAUYsF9bBoTzOf1pMRAlOZAKCvbR65c3pmiQPVfw4ZAlrg6NizZQCgiJjr 58hnH6PxL8IZPmf0/nNKZ+U=
=raJH
-----END PGP SIGNATURE-----
Signature · 14 lines
Martin Siegert Manager, Research Services WestGrid Site Manager Academic Computing Services phone: (604) 291-4691 Simon Fraser University fax: (604) 291-4242 Burnaby, British Columbia email: [email protected] Canada V5A 1S6 ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
A message that is not in the archive (sent off-list or not yet received): 20040312193716.GC25056-0ze2hujOWYhqr3d4nwidZ7Dks+cytr/[email protected]
Please comment on poweroff-patch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Salut list,
I posted 10days ago a patch to this list. I have positive feedback from users who had the same problem as I had. But as I only traced down, which part of the change in the hwsleep.c (v 1.23) had broken powering-off, I would like verry much to hear, why this regressing changes were done in the first place. Please comment on my patch. I am verry intressted to hear, if the problems is BIOS-specific, or an Linux-acpi-issue.
http://bugme.osdl.org/show_bug.cgi?id=2183
Cheers
hartwig felger
Hartwig Felger informatics
- --
1024D/339FD693 Hartwig Felger <[email protected]> Key fingerprint = FB2F 3EE9 345A D55B 6FF2 0EC1 F5B0 684F 339F D693 For the pulic keys, please visit my page.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFAUuoF9bBoTzOf1pMRAjDcAJ95xcX26fblgMBkZ78A0XFUmobBPQCgmHpO hvFovkogRo5c31L6/WwOOBA=
=p5sx
-----END PGP SIGNATURE-----
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
A message that is not in the archive (sent off-list or not yet received): Pine.LNX.4.58.0403131152490.1228-KnfdeQs3A3X/[email protected]
Mandrake 10 weird acpi behaviour
Hi all,
I have recently installed Mandrake 10 on my ASUS M2400N laptop and have experienced some strange behaviour (perharps) originating from ACPI or acpid.
When the laptop boots, everything is fine. ACPI is working correct and acpid is started is on boot. When I hit the powerbutton, the laptop shuts down fine. However, althoug the acpi events are correctly reported when the hotkeys are pressed, the scripts/assigned applications are not executed.
If I issue a 'service acpid restartø to restart the acpid daemon, the applications assigned to the hotkeys are launched as supposed. However, in this case when I hit the powerbutton, the laptop immediately calls acpi_power_off and shuts down uncleanly without unmounting file systems or anything.
Any ideas to what can be causing this ??
The kernel is a mandrake 2.6.3-4mdk compiled from the mandrake source. I had to recompile to disable local apic (known problem for the ASUS M2400N). acpi i compiled into the kernel.
Regards,
Mads
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
A message that is not in the archive (sent off-list or not yet received): 1079429336.10065.8.camel-kIu+fQ4xpd9XnW97NowkO4MF2aZwyW4E@public.gmane.org
Re: Mandrake 10 weird acpi behaviour
Thus wrote Mads Paulin:
Quoted 5 lines
If I issue a 'service acpid restart? to restart the acpid daemon, the applications assigned to the hotkeys are launched as supposed. However, in this case when I hit the powerbutton, the laptop immediately calls
acpi_power_offand shuts down uncleanly without unmounting file systems or anything.
See what this 'service acpid restart' does, this must be a script of some sort.
Best regards,
Signature · 9 lines
Karol 'sziwan' Kozimor sziwan-DETuoxkZsSqrDJvtcaxF/[email protected] ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
A message that is not in the archive (sent off-list or not yet received): 20040316132759.GA12230-DETuoxkZsSqrDJvtcaxF/[email protected]
Re: Mandrake 10 weird acpi behaviour
it would appear that it (re)starts thet script in /etc/init.d/ called acpid. this in turn turns on the acpi even monitoring daemon.
At least thats what it does on my P2120 Debian/Testing machine.
TMC
Quoted 25 lines · Karol Kozimor
Thus wrote Mads Paulin:
Quoted 5 lines
If I issue a 'service acpid restart? to restart the acpid daemon, the applications assigned to the hotkeys are launched as supposed. However, in this case when I hit the powerbutton, the laptop immediately calls
acpi_power_offand shuts down uncleanly without unmounting file systems or anything.See what this 'service acpid restart' does, this must be a script of some sort.
Best regards,Signature · 13 lines
Karol 'sziwan' Kozimor sziwan-DETuoxkZsSqrDJvtcaxF/[email protected] ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Acpi-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/acpi-devel
Signature · 17 lines
Tomasz M. Ciolek ******************************************************************************* tmc at dreamcraft dot com dot au or tmc at goldweb dot com dot au ******************************************************************************* GPG Key ID: 0x41C4C2F0 Key available on www.pgp.net ******************************************************************************* Everything falls under the law of change; Like a dream, a phantom, a bubble, a shadow, like dew of flash of lightning. You should contemplate like this. ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
A message that is not in the archive (sent off-list or not yet received): 20040316134456.GA1396-+XVqjN4+fIJfbCVcMT5z6Ydd74u8MsAO@public.gmane.org
Re: Mandrake 10 weird acpi behaviour
- Correct - it just shuts down acpid and then starts it over again. I will look at the script and compare it to the old mandrake 9.1 scipt (which worked). My guess is that this is not a problem if the script, but rather the acpid daemon (if it has changed lately) or the newer version of acpi used in my new kernel..
Mads
Quoted 33 lines · Tomasz Ciolek
it would appear that it (re)starts thet script in
/etc/init.d/called acpid. this in turn turns on the acpi even monitoring daemon.At least thats what it does on my P2120 Debian/Testing machine.
TMC
Quoted 25 lines · Karol Kozimor
Thus wrote Mads Paulin:
Quoted 5 lines
If I issue a 'service acpid restart? to restart the acpid daemon, the applications assigned to the hotkeys are launched as supposed. However, in this case when I hit the powerbutton, the laptop immediately calls
acpi_power_offand shuts down uncleanly without unmounting file systems or anything.See what this 'service acpid restart' does, this must be a script of some sort.
Best regards,Signature · 13 lines
Karol 'sziwan' Kozimor sziwan-DETuoxkZsSqrDJvtcaxF/[email protected] ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Acpi-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/acpi-devel
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
A message that is not in the archive (sent off-list or not yet received): 1079444879.10067.19.camel-kIu+fQ4xpd9XnW97NowkO4MF2aZwyW4E@public.gmane.org
Re: Mandrake 10 weird acpi behaviour
Thus wrote Mads Paulin:
Quoted 4 lines
- Correct - it just shuts down acpid and then starts it over again. I will look at the script and compare it to the old mandrake 9.1 scipt (which worked). My guess is that this is not a problem if the script, but rather the acpid daemon (if it has changed lately) or the newer
There were no substantial changes, as far as I know. However, it is likely that your event helper scripts have changed if you experience such a behaviour.
Quoted 1 line
version of acpi used in my new kernel..
Might be.
Best regards,
Signature · 9 lines
Karol 'sziwan' Kozimor sziwan-DETuoxkZsSqrDJvtcaxF/[email protected] ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
A message that is not in the archive (sent off-list or not yet received): 20040316141734.GA2392-DETuoxkZsSqrDJvtcaxF/[email protected]
Re: Mandrake 10 weird acpi behaviour
Hi,
I have now tried to compare different acpi related scripts in mandrake 9.1 and 10.0.
the servcice script which is used to start and stop daemons have no differences.
The /etc/acpi/event/power script has changed from:
event=button/power PWR.
action=/sbin/poweroff
to
event=button/power (PWR.|PBTN)
action=/sbin/poweroff
I have tried to change it back, but this obviously didnt help anything.
Furthermore, I have investigated a little bit more.
the poweroff script is just a link to /sbin/halt. If I restart acpid and call halt myself, everything shuts down og.
If I restart acpid and pushes the powerbutton, the shutdown sequence is started, and the last thing output before poweroff is "Shutting down acpi daemon"
Don't know why this acpi event has something to do with the acpi daemon calling poweroff prematurely... ???
/Mads
Quoted 6 lines · Karol Kozimor
Thus wrote Mads Paulin:
Quoted 4 lines
- Correct - it just shuts down acpid and then starts it over again. I will look at the script and compare it to the old mandrake 9.1 scipt (which worked). My guess is that this is not a problem if the script, but rather the acpid daemon (if it has changed lately) or the newer
Quoted 8 lines
There were no substantial changes, as far as I know. However, it is likely that your event helper scripts have changed if you experience such a behaviour.
Quoted 1 line
version of acpi used in my new kernel..
Might be.
Best regards,
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: Mandrake 10 weird acpi behaviour
Thus wrote Mads Paulin:
Quoted 2 lines
I have now tried to compare different acpi related scripts in mandrake 9.1 and 10.0.
I'm unfortunately not familiar with Mandrake...
Quoted 11 lines
Furthermore, I have investigated a little bit more.
the poweroff script is just a link to
/sbin/halt. If I restart acpid and call halt myself, everything shuts down og.If I restart acpid and pushes the powerbutton, the shutdown sequence is started, and the last thing output before poweroff is "Shutting down acpi daemon"
Don't know why this acpi event has something to do with the acpi daemon calling poweroff prematurely... ???
Prepend the poweroff / halt calls with echo, see /var/log/acpid, see if /proc/acpi/events spits the same event each time...
Best regards,
Signature · 9 lines
Karol 'sziwan' Kozimor sziwan-DETuoxkZsSqrDJvtcaxF/[email protected] ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click