vserver 2.0 rc7
[linux-2.6.git] / arch / ppc64 / kernel / idle.c
index 398b468..f24ce2b 100644 (file)
@@ -75,13 +75,9 @@ static int iSeries_idle(void)
 {
        struct paca_struct *lpaca;
        long oldval;
-       unsigned long CTRL;
 
        /* ensure iSeries run light will be out when idle */
-       clear_thread_flag(TIF_RUN_LIGHT);
-       CTRL = mfspr(CTRLF);
-       CTRL &= ~RUNLATCH;
-       mtspr(CTRLT, CTRL);
+       ppc64_runlatch_off();
 
        lpaca = get_paca();
 
@@ -111,7 +107,9 @@ static int iSeries_idle(void)
                        }
                }
 
+               ppc64_runlatch_on();
                schedule();
+               ppc64_runlatch_off();
        }
 
        return 0;
@@ -293,6 +291,10 @@ static int native_idle(void)
                        power4_idle();
                if (need_resched())
                        schedule();
+
+               if (cpu_is_offline(_smp_processor_id()) &&
+                   system_state == SYSTEM_RUNNING)
+                       cpu_die();
        }
        return 0;
 }