swsusp2 should execute _WAK on resume
Subsystems (3)
PATCH 1/1 swsusp2 should execute _WAK on resume
Hi,
[CCing ACPI-devel in case someone wants to comment]
Using swsusp2 2.1.8 on a vanilla 2.6.11 kernel (but I have been seeing this since v2.1 on 2.6.9), my laptop (HP nc6000) doesn't generate any ACPI thermal events after resume. This means the fans only come on (screaming) if the CPU reaches 85 °C or so, which is not very healthy.
This is due to the fact that unlike swsusp and S3, swsusp2 does not call the ACPI _WAK method, which the ACPI spec says should be called when the machine comes out of a sleep state. If I hack swsusp2 so that it calls the _WAK method on resume, the fans work correctly after resume.
I do this via the attached hack, but I don't know much about the workings of swsusp2, so I don't know if it's the right approach. It does work for me though, and even if the details of the patch aren't right, based on my reading of the ACPI spec I think this should be done.
Comments? Is it fit to apply to the swsusp2 tree?
Cheers,
Lorenzo
P.S. I have been using swsusp2 since v2.1 for 2.6.9, and it works like a charm. A big thank you to the people that made it possible. :)
kernel/power/suspend2_core/suspend.c +9 -0
@@ -404,6 +404,10 @@* Called From : do_suspend2_lowlevel */ +#ifdef CONFIG_ACPI +extern u32 acpi_leave_sleep_state (u8 sleep_state); +#endif +static void do_suspend2_resume_2 (void ) {set_suspend_state (SUSPEND_NOW_RESUMING );
@@ -433,6 +437,11 @@suspend_checksum_print_differences ();prepare_status (0 ,0 ,"Cleaning up..." ); + +#ifdef CONFIG_ACPI +if (suspend_powerdown_method) +acpi_leave_sleep_state (suspend_powerdown_method); +#endif }/*
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi,
Just after resume, this following message is shown in my dmesg. I have the patch below applied. Does anyone know why a method would return AE_TIME?
ACPI-0405: *** Error: Handler for [EmbeddedControl] returned AE_TIME
ACPI-1138: *** Error: Method execution failed [\_SB_.C044.C057.C0E7.C12F] (Node c17efb80), AE_TIME
ACPI-1138: *** Error: Method execution failed [\_SB_.C12F] (Node c17f4500), AE_TIME
ACPI-1138: *** Error: Method execution failed [\_SB_.C137._BST] (Node c17f4440), AE_TIMEThanks,
Krristoffer Sjöberg
Netstar AB
Quoted 54 lines · Lorenzo Colitti
Hi,
[CCing ACPI-devel in case someone wants to comment]
Using swsusp2 2.1.8 on a vanilla 2.6.11 kernel (but I have been seeing this since v2.1 on 2.6.9), my laptop (HP nc6000) doesn't generate any ACPI thermal events after resume. This means the fans only come on (screaming) if the CPU reaches 85 °C or so, which is not very healthy.
This is due to the fact that unlike swsusp and S3, swsusp2 does not call the ACPI
_WAKmethod, which the ACPI spec says should be called when the machine comes out of a sleep state. If I hack swsusp2 so that it calls the_WAKmethod on resume, the fans work correctly after resume.I do this via the attached hack, but I don't know much about the workings of swsusp2, so I don't know if it's the right approach. It does work for me though, and even if the details of the patch aren't right, based on my reading of the ACPI spec I think this should be done.
Comments? Is it fit to apply to the swsusp2 tree?
Cheers,
Lorenzo
P.S. I have been using swsusp2 since v2.1 for 2.6.9, and it works like a
charm. A big thank you to the people that made it possible. :)
plain text document attachment (patch-swsusp2-acpiwakeonresume.diff)
diff -ulinux-2.6.11/kernel/power/suspend2_core/suspend.clinux-2.6.11-patched/kernel/power/suspend2_core/suspend.ckernel/power/suspend2_core/suspend.c +9
-0@@ -404,6 +404,10 @@* Called From : do_suspend2_lowlevel */ +#ifdef CONFIG_ACPI +extern u32 acpi_leave_sleep_state (u8 sleep_state); +#endif +static void do_suspend2_resume_2 (void ) {set_suspend_state (SUSPEND_NOW_RESUMING );@@ -433,6 +437,11 @@suspend_checksum_print_differences ();prepare_status (0 ,0 ,"Cleaning up..." ); + +#ifdef CONFIG_ACPI +if (suspend_powerdown_method) +acpi_leave_sleep_state (suspend_powerdown_method); +#endif }/*