diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2012-08-23 08:11:25 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2012-09-23 10:44:42 -0400 |
commit | 6a6c0272f17cc80a8286d915f2ddf31557c2d559 (patch) | |
tree | 3b4babe1cbfa3659d42d9ecf326f6169defe4730 /arch/alpha | |
parent | a10d206ef1a83121ab7430cb196e0376a7145b22 (diff) |
alpha: Fix preemption handling in idle loop
cpu_idle() is called on the boot CPU by the init code with
preemption disabled. But the cpu_idle() function in alpha
doesn't handle this when it calls schedule() directly.
Fix it by converting it into schedule_preempt_disabled().
Also disable preemption before calling cpu_idle() from
secondary CPU entry code to stay consistent with this
state.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Tested-by: Michael Cree <mcree@orcon.net.nz>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: alpha <linux-alpha@vger.kernel.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'arch/alpha')
-rw-r--r-- | arch/alpha/kernel/process.c | 3 | ||||
-rw-r--r-- | arch/alpha/kernel/smp.c | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index d6fde98b74b3..db56f31dbf70 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -56,7 +56,8 @@ cpu_idle(void) | |||
56 | 56 | ||
57 | while (!need_resched()) | 57 | while (!need_resched()) |
58 | cpu_relax(); | 58 | cpu_relax(); |
59 | schedule(); | 59 | |
60 | schedule_preempt_disabled(); | ||
60 | } | 61 | } |
61 | } | 62 | } |
62 | 63 | ||
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 35ddc02bfa4a..a41ad90a97a6 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c | |||
@@ -166,6 +166,7 @@ smp_callin(void) | |||
166 | DBGS(("smp_callin: commencing CPU %d current %p active_mm %p\n", | 166 | DBGS(("smp_callin: commencing CPU %d current %p active_mm %p\n", |
167 | cpuid, current, current->active_mm)); | 167 | cpuid, current, current->active_mm)); |
168 | 168 | ||
169 | preempt_disable(); | ||
169 | /* Do nothing. */ | 170 | /* Do nothing. */ |
170 | cpu_idle(); | 171 | cpu_idle(); |
171 | } | 172 | } |