Cause of Suspend2 resume failures on Toshiba laptops
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 10 lines · Dumitru Ciobarcianu
??n data de S??, 05-03-2005 la 01:50 +0800, Bernard Blackham a scris:
Quoted 5 lines
The attached patch more or less reverts the change in 2.6.9-rc1 that began this all. If you have a Toshiba or other laptop that's affected by this, I ask you to see if it helps your problems. (It hacks around the problem rather than fixing it, but I'm not entirely sure what functionality it disables).
You are on the right track , it does the trick, I did serveral suspend/resume cycles whitout problems.
Quoted 6 lines
But (yes, it's a but :) it is functionally equivalent with using the other workaround (booting at resume with acpi=off) meaning that I lose all the acpi events (AC events, LID events, etc). The system records the event (if I do an "watch cat
/proc/acpi/ac_adapter/ADP1/state" it shows the current state correctly) but acpid does not receive the event, and thus can not act accordingly :( (Toshiba Satellite Pro 6100)
Ahh, d'oh. Try this patch instead.
After more investigation, it seems that the issue is the GPE is fired but not serviced because kacpid is frozen. This in itself would be okay, however, the GPE isn't being disabled before the method executes (despite there being code there to do so), and hence fires continuously.
The attached patch makes kacpid NOFREEZE so the GPE does get serviced (eventually), but probably still isn't the correct solution. (A better solution being making sure the GPE gets disabled in the first place ... still looking into this).
Bernard.
Signature · 1 line
Bernard Blackham <bernard at blackham dot com dot au>
drivers/acpi/osl.c renamed from drivers/acpi/osl.c.orig +1 -1
@@ -87,7 +87,7 @@ return AE_NULL_ENTRY; }#endif - kacpid_wq =create_singlethread_workqueue ("kacpid" ,0 ); + kacpid_wq =create_singlethread_workqueue ("kacpid" ,PF_NOFREEZE );BUG_ON (!kacpid_wq);return AE_OK ;
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 20050305100254.GH4042-4vSAtV5O1nc0n/[email protected]
În data de Sî, 05-03-2005 la 18:02 +0800, Bernard Blackham a scris:
Quoted 8 lines
Ahh, d'oh. Try this patch instead.
After more investigation, it seems that the issue is the GPE is fired but not serviced because kacpid is frozen. This in itself would be okay, however, the GPE isn't being disabled before the method executes (despite there being code there to do so), and hence fires continuously.
Quoted 4 lines
The attached patch makes kacpid NOFREEZE so the GPE does get serviced (eventually), but probably still isn't the correct solution. (A better solution being making sure the GPE gets disabled in the first place ... still looking into this).
You got it this time!
Several successful suspend/resume cycles for me! And even the events are working! :)
Thanks,
Signature · 10 lines
Cioby ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
Hi!
Quoted 10 lines
Quoted 9 lines
You are on the right track , it does the trick, I did serveral suspend/resume cycles whitout problems.
But (yes, it's a but :) it is functionally equivalent with using the other workaround (booting at resume with acpi=off) meaning that I lose all the acpi events (AC events, LID events, etc). The system records the event (if I do an "watch cat
/proc/acpi/ac_adapter/ADP1/state" it shows the current state correctly) but acpid does not receive the event, and thus can not act accordingly :( (Toshiba Satellite Pro 6100)
Quoted 7 lines
Ahh, d'oh. Try this patch instead.
After more investigation, it seems that the issue is the GPE is fired but not serviced because kacpid is frozen. This in itself would be okay, however, the GPE isn't being disabled before the method executes (despite there being code there to do so), and hence fires continuously.
Perhaps you should fix that, too? It is going to cause ugly perfrmance problems.
Quoted 4 lines
The attached patch makes kacpid NOFREEZE so the GPE does get serviced (eventually), but probably still isn't the correct solution. (A better solution being making sure the GPE gets disabled in the first place ... still looking into this).
Looks good to me. It is good idea for other reasons, too: like we'll be able to fight overheat during writing pages.
Pavel
Quoted 11 lines
drivers/acpi/osl.c renamed from drivers/acpi/osl.c.orig +1
-1@@ -87,7 +87,7 @@ return AE_NULL_ENTRY; }#endif - kacpid_wq =create_singlethread_workqueue ("kacpid" ,0 ); + kacpid_wq =create_singlethread_workqueue ("kacpid" ,PF_NOFREEZE );BUG_ON (!kacpid_wq);return AE_OK ;
Signature · 9 lines
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Quoted 8 lines · Pavel Machek
Quoted 5 lines
After more investigation, it seems that the issue is the GPE is fired but not serviced because kacpid is frozen. This in itself would be okay, however, the GPE isn't being disabled before the method executes (despite there being code there to do so), and hence fires continuously.
Perhaps you should fix that, too? It is going to cause ugly perfrmance problems.
Yep, been looking into it, and I think I've got it. The GPE in question is fired periodically, about every 5 seconds. It fires when suspending but kacpid is stopped, so the GPE is simply disabled and never serviced. However, the state of it being disabled is recorded in the atomic copy.
Upon resume, after restoring the atomic copy, the code at the top of acpi_ev_disable_gpe believes that the GPE is already disabled (as it was when we suspended) even though it's not. Hardware state is out of sync with what the kernel thinks and badness ensues. The culprit difference between 2.6.8 and 2.6.9-rc1 is that 2.6.8 disabled the GPE unconditionally, 2.6.9-rc1 checks against its last known state which is incorrect upon resuming.
Removing the check resolves this issue (patch attached). Is this an adequate fix?
Quoted 2 lines
Looks good to me. It is good idea for other reasons, too: like we'll be able to fight overheat during writing pages.
Fair enough. Even with kacpid running, we may still potentially run into the same issue if a GPE occurs at the instant prior to the atomic copy (and gets disabled in the atomic copy).
So, combining this patch with the previous kacpid NOFREEZE patch... Does this make people happy? :) (And should it be submitted via Len or akpm?)
Bernard.
Signature · 1 line
Bernard Blackham <bernard at blackham dot com dot au>
drivers/acpi/events/evgpe.c renamed from drivers/acpi/events/evgpe.c.orig +0 -4
@@ -253,10 +253,6 @@ACPI_FUNCTION_TRACE ("ev_disable_gpe" ); -if (!(gpe_event_info->flags &ACPI_GPE_ENABLE_MASK )) { -return_ACPI_STATUS (AE_OK ); - } -/* Make sure HW enable masks are updated */ status =acpi_ev_update_gpe_enable_masks (gpe_event_info,ACPI_GPE_DISABLE );
_______________________________________________
Suspend2-devel mailing list
[email protected]
http://lists.suspend2.net/mailman/listinfo/suspend2-devel
Hi!
Quoted 17 lines
Quoted 2 lines
Perhaps you should fix that, too? It is going to cause ugly perfrmance problems.
Yep, been looking into it, and I think I've got it. The GPE in question is fired periodically, about every 5 seconds. It fires when suspending but kacpid is stopped, so the GPE is simply disabled and never serviced. However, the state of it being disabled is recorded in the atomic copy.
Upon resume, after restoring the atomic copy, the code at the top of
acpi_ev_disable_gpebelieves that the GPE is already disabled (as it was when we suspended) even though it's not. Hardware state is out of sync with what the kernel thinks and badness ensues. The culprit difference between 2.6.8 and 2.6.9-rc1 is that 2.6.8 disabled the GPE unconditionally, 2.6.9-rc1 checks against its last known state which is incorrect upon resuming.
Quoted 2 lines
Removing the check resolves this issue (patch attached). Is this an adequate fix?
Does not removing of the check cause problems elsewhere? Bring it up on linix-acpi lists...
Obvious solution would be to add suspend/resume routines to acpi, and properly set the flag during resume.
Quoted 3 lines
So, combining this patch with the previous kacpid NOFREEZE patch... Does this make people happy? :) (And should it be submitted via Len or akpm?)
Len.
Signature · 1 line
64 bytes from 195.113.31.123: icmp_seq=28 ttl=51 time=448769.1 ms
A message that is not in the archive (sent off-list or not yet received): 20050305203533.GI4042-4vSAtV5O1nc0n/[email protected]
Quoted 9 lines · Bernard Blackham
So, combining this patch with the previous kacpid NOFREEZE patch... Does this make people happy? :) (And should it be submitted via Len or akpm?)
Signature · 1 line
Bernard Blackham <bernard at blackham dot com dot au>
drivers/acpi/events/evgpe.c line 258
Quoted 10 lines
drivers/acpi/events/evgpe.c renamed from drivers/acpi/events/evgpe.c.orig +0
-4@@ -253,10 +253,6 @@ACPI_FUNCTION_TRACE ("ev_disable_gpe" ); -if (!(gpe_event_info->flags &ACPI_GPE_ENABLE_MASK )) { -return_ACPI_STATUS (AE_OK ); - } -/* Make sure HW enable masks are updated */ status =acpi_ev_update_gpe_enable_masks (gpe_event_info,ACPI_GPE_DISABLE );
I'm looking into your patches in hopes to eliminate system freezes related to ACPI and swsusp on my Thinkpad R40.
I can apply this patch to 2.6.11.1, but the previous PF_NOFREEZE patch won't compile. Would you mind providing a proper patch for 2.6.11.1 that makes all the changes you intend?
Thanks.
Signature · 2 lines
John M Flinchbaugh [email protected]
Quoted 19 lines · John M Flinchbaugh
Quoted 18 lines · Bernard Blackham
So, combining this patch with the previous kacpid NOFREEZE patch... Does this make people happy? :) (And should it be submitted via Len or akpm?)
Signature · 1 line
Bernard Blackham <bernard at blackham dot com dot au>drivers/acpi/events/evgpe.c renamed from drivers/acpi/events/evgpe.c.orig +0
-4@@ -253,10 +253,6 @@ACPI_FUNCTION_TRACE ("ev_disable_gpe" ); -if (!(gpe_event_info->flags &ACPI_GPE_ENABLE_MASK )) { -return_ACPI_STATUS (AE_OK ); - } -/* Make sure HW enable masks are updated */
Quoted 8 lines
drivers/acpi/events/evgpe.c line 258
Quoted 1 line
drivers/acpi/events/evgpe.c renamed from drivers/acpi/events/evgpe.c.orig +0
-0status =acpi_ev_update_gpe_enable_masks (gpe_event_info,ACPI_GPE_DISABLE );I'm looking into your patches in hopes to eliminate system freezes related to ACPI and swsusp on my Thinkpad R40.
I can apply this patch to 2.6.11.1, but the previous
PF_NOFREEZEpatch won't compile. Would you mind providing a proper patch for 2.6.11.1 that makes all the changes you intend?
The kacpid NOFREEZE patch is only relevant for Software Suspend 2.
Bernard.
Signature · 1 line
Bernard Blackham <bernard at blackham dot com dot au>