ACPI sleep: check error values and disable it on SMP
Hi!
Wakeup is hard to do on SMP, and freezer_processes is just not ready to work on SMP machine. As I have no SMP (hint hint ;-), it is better to disable it.
ACPI should really really check if freezing processes worked, and handle failure. Please apply,
Pavel
drivers/acpi/sleep/main.c +9 -1
@@ -214,6 +214,11 @@ {acpi_status status; +#ifdef CONFIG_SMP +/* Suspend is hard to get right on SMP. */ +return AE_ERROR ; +#endif +/* get out if state is invalid */ if (state <ACPI_STATE_S1 || state >ACPI_STATE_S5 )return AE_ERROR ;
@@ -226,7 +231,10 @@* TBD: S1 can be done without device_suspend. Make a CONFIG_XX * to handle however when S1 failed without device_suspend. */ -freeze_processes ();/* device_suspend needs processes to be stopped */ +if (freeze_processes ()) { +thaw_processes (); +return AE_ERROR ;/* device_suspend needs processes to be stopped */ + }/* do we have a wakeup address for S2 and S3? */ /* Here, we support only S4BIOS, those we set the wakeup address */
Signature · 8 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?] ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.
A message that is not in the archive (sent off-list or not yet received): 20030608203823.GA9415-I/[email protected]
In message <20030608203823.GA9415-I/[email protected]> you write:
Quoted 8 lines
Hi!
Wakeup is hard to do on SMP, and
freezer_processesis just not ready to work on SMP machine. As I have no SMP (hint hint ;-), it is better to disable it.ACPI should really really check if freezing processes worked, and handle failure. Please apply,
Gcc doesn't give any warnings about unreachable code?
Quoted 17 lines
drivers/acpi/sleep/main.c +5
-0@@ -214,6 +214,11 @@ {acpi_status status; +#ifdef CONFIG_SMP +/* Suspend is hard to get right on SMP. */ +return AE_ERROR ; +#endif +/* get out if state is invalid */ if (state <ACPI_STATE_S1 || state >ACPI_STATE_S5 )return AE_ERROR ;@@ -226,7 +231,10 @@* TBD: S1 can be done without device_suspend. Make a CONFIG_XX
drivers/acpi/sleep/main.c line 240
Quoted 10 lines
drivers/acpi/sleep/main.c +4
-1* to handle however when S1 failed without device_suspend. */ -freeze_processes ();/* device_suspend needs processes to be stopped */ +if (freeze_processes ()) { +thaw_processes (); +return AE_ERROR ;/* device_suspend needs processes to be stopped */ + }/* do we have a wakeup address for S2 and S3? */ /* Here, we support only S4BIOS, those we set the wakeup address */
Cheers,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.
A message that is not in the archive (sent off-list or not yet received): 20030610043633.4C3F02C05E-w/[email protected]
Hi!
Quoted 8 lines
Quoted 6 lines
Wakeup is hard to do on SMP, and
freezer_processesis just not ready to work on SMP machine. As I have no SMP (hint hint ;-), it is better to disable it.ACPI should really really check if freezing processes worked, and handle failure. Please apply,
Gcc doesn't give any warnings about unreachable code?
I've just tested it, and no warnings are given.
Pavel
Quoted 27 lines
Quoted 27 lines
drivers/acpi/sleep/main.c +9
-1@@ -214,6 +214,11 @@ {acpi_status status; +#ifdef CONFIG_SMP +/* Suspend is hard to get right on SMP. */ +return AE_ERROR ; +#endif +/* get out if state is invalid */ if (state <ACPI_STATE_S1 || state >ACPI_STATE_S5 )return AE_ERROR ;@@ -226,7 +231,10 @@* TBD: S1 can be done without device_suspend. Make a CONFIG_XX * to handle however when S1 failed without device_suspend. */ -freeze_processes ();/* device_suspend needs processes to be stopped */ +if (freeze_processes ()) { +thaw_processes (); +return AE_ERROR ;/* device_suspend needs processes to be stopped */ + }/* do we have a wakeup address for S2 and S3? */ /* Here, we support only S4BIOS, those we set the wakeup address */
Signature · 8 lines
When do you have a heart between your knees? [Johanka's followup: and *two* hearts?] ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.