WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH]x86: Fix possible S3 suspend hangs

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH]x86: Fix possible S3 suspend hangs
From: "Wei, Gang" <gang.wei@xxxxxxxxx>
Date: Fri, 12 Mar 2010 11:42:11 +0800
Accept-language: zh-CN, en-US
Acceptlanguage: zh-CN, en-US
Cc: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, "Yu, Ke" <ke.yu@xxxxxxxxx>
Delivery-date: Thu, 11 Mar 2010 19:43:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcrBlf9043FPUcdKRIuVj4pFG/hDbQ==
Thread-topic: [PATCH]x86: Fix possible S3 suspend hangs
X86: Fix possible S3 suspend hangs

It is possible for cpu to become offlined before irq disabled in idle loop, 
which will cause this cpu stay in C state and can't wakeup to play dead.

Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>
Signed-off-by: Yu Ke <ke.yu@xxxxxxxxx> 

diff -r 132ac04cbdba xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c      Tue Mar 09 18:18:19 2010 +0000
+++ b/xen/arch/x86/acpi/cpu_idle.c      Fri Mar 12 11:07:43 2010 +0800
@@ -268,7 +268,8 @@ static void acpi_processor_idle(void)
      */
     local_irq_disable();
 
-    if ( softirq_pending(smp_processor_id()) )
+    if ( softirq_pending(smp_processor_id()) ||
+         cpu_is_offline(smp_processor_id()) )
     {
         local_irq_enable();
         sched_tick_resume();
diff -r 132ac04cbdba xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Tue Mar 09 18:18:19 2010 +0000
+++ b/xen/arch/x86/domain.c     Fri Mar 12 11:12:24 2010 +0800
@@ -82,7 +82,8 @@ static void default_idle(void)
 static void default_idle(void)
 {
     local_irq_disable();
-    if ( !softirq_pending(smp_processor_id()) )
+    if ( !softirq_pending(smp_processor_id()) &&
+         cpu_online(smp_processor_id()) )
         safe_halt();
     else
         local_irq_enable();

Attachment: fix-s3-deadloop.patch
Description: fix-s3-deadloop.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>