]> xenbits.xensource.com Git - xen.git/commitdiff
x86: Fix possible S3 suspend hangs
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 15 Mar 2010 13:17:38 +0000 (13:17 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 15 Mar 2010 13:17:38 +0000 (13:17 +0000)
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@intel.com>
Signed-off-by: Yu Ke <ke.yu@intel.com>
xen/arch/x86/acpi/cpu_idle.c
xen/arch/x86/domain.c

index f06580fbb4798afff5714ffc14abcaae16667e3d..51227842e4d719847b005d375eee4a206e7b67ad 100644 (file)
@@ -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();
index d20487f8d952ed7933a2762e904b0b6e4050850c..17f5c83c75fd0ecfee8ee6c35e67575749a6696a 100644 (file)
@@ -82,7 +82,8 @@ static void continue_nonidle_domain(struct vcpu *v)
 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();