Merge branch 'powernv-cpuidle' of git://git.kernel.org/pub/scm/linux/kernel/git/benh...
[linux-2.6-block.git] / drivers / cpuidle / cpuidle-powernv.c
index fdae1c476e2755e4fd76cb102bdbab83c77fb2ff..719f6fb5b1c35d00108c47a61918741200eae75d 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <asm/machdep.h>
 #include <asm/firmware.h>
+#include <asm/runlatch.h>
 
 /* Flags and constants used in PowerNV platform */
 
@@ -38,12 +39,14 @@ static int snooze_loop(struct cpuidle_device *dev,
        local_irq_enable();
        set_thread_flag(TIF_POLLING_NRFLAG);
 
+       ppc64_runlatch_off();
        while (!need_resched()) {
                HMT_low();
                HMT_very_low();
        }
 
        HMT_medium();
+       ppc64_runlatch_on();
        clear_thread_flag(TIF_POLLING_NRFLAG);
        smp_mb();
        return index;
@@ -53,7 +56,9 @@ static int nap_loop(struct cpuidle_device *dev,
                        struct cpuidle_driver *drv,
                        int index)
 {
+       ppc64_runlatch_off();
        power7_idle();
+       ppc64_runlatch_on();
        return index;
 }