aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ppc64/kernel/idle.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index b8cfb37e5f14..954395d42636 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -20,18 +20,12 @@
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/cpu.h> 22#include <linux/cpu.h>
23#include <linux/module.h>
24#include <linux/sysctl.h> 23#include <linux/sysctl.h>
25#include <linux/smp.h>
26 24
27#include <asm/system.h> 25#include <asm/system.h>
28#include <asm/processor.h> 26#include <asm/processor.h>
29#include <asm/mmu.h>
30#include <asm/cputable.h> 27#include <asm/cputable.h>
31#include <asm/time.h> 28#include <asm/time.h>
32#include <asm/iSeries/HvCall.h>
33#include <asm/iSeries/ItLpQueue.h>
34#include <asm/plpar_wrappers.h>
35#include <asm/systemcfg.h> 29#include <asm/systemcfg.h>
36#include <asm/machdep.h> 30#include <asm/machdep.h>
37 31
@@ -49,7 +43,8 @@ int default_idle(void)
49 set_thread_flag(TIF_POLLING_NRFLAG); 43 set_thread_flag(TIF_POLLING_NRFLAG);
50 44
51 while (!need_resched() && !cpu_is_offline(cpu)) { 45 while (!need_resched() && !cpu_is_offline(cpu)) {
52 barrier(); 46 ppc64_runlatch_off();
47
53 /* 48 /*
54 * Go into low thread priority and possibly 49 * Go into low thread priority and possibly
55 * low power mode. 50 * low power mode.
@@ -64,6 +59,7 @@ int default_idle(void)
64 set_need_resched(); 59 set_need_resched();
65 } 60 }
66 61
62 ppc64_runlatch_on();
67 schedule(); 63 schedule();
68 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING) 64 if (cpu_is_offline(cpu) && system_state == SYSTEM_RUNNING)
69 cpu_die(); 65 cpu_die();
@@ -74,17 +70,22 @@ int default_idle(void)
74 70
75int native_idle(void) 71int native_idle(void)
76{ 72{
77 while(1) { 73 while (1) {
78 /* check CPU type here */ 74 ppc64_runlatch_off();
75
79 if (!need_resched()) 76 if (!need_resched())
80 power4_idle(); 77 power4_idle();
81 if (need_resched()) 78
79 if (need_resched()) {
80 ppc64_runlatch_on();
82 schedule(); 81 schedule();
82 }
83 83
84 if (cpu_is_offline(raw_smp_processor_id()) && 84 if (cpu_is_offline(smp_processor_id()) &&
85 system_state == SYSTEM_RUNNING) 85 system_state == SYSTEM_RUNNING)
86 cpu_die(); 86 cpu_die();
87 } 87 }
88
88 return 0; 89 return 0;
89} 90}
90 91