aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powermac/smp.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-02-21 00:49:58 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-04-01 00:37:25 -0400
commit62cc67b9df273be18fcb09a071592dedf751c90a (patch)
tree604363a8a8ea577b59c58e10ba7cf36a67ced624 /arch/powerpc/platforms/powermac/smp.c
parente872e41b79f61dbc22f85577613925a4a7de1c1a (diff)
powerpc/pmac/smp: Properly NAP offlined CPU on G5
The current code soft-disables, and then goes to NAP mode which turns interrupts on. That means that if an interrupt occurs, we will hit the masked interrupt code path which isn't what we want, as it will return with EE off, which will either get us out of NAP mode, or fail to enter it (according to spec). Instead, let's just rely on the fact that it is safe to take decrementer interrupts on an offline CPU and leave interrupts enabled. We can also get rid of the special case in asm for power4_cpu_offline_powersave() and just use power4_idle(). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/powermac/smp.c')
-rw-r--r--arch/powerpc/platforms/powermac/smp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index 53bee660ff3..837989e72ca 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -916,18 +916,20 @@ static void pmac_cpu_die(void)
916 preempt_enable(); 916 preempt_enable();
917 917
918 /* 918 /*
919 * hard-disable interrupts for the non-NAP case, the NAP code 919 * Re-enable interrupts. The NAP code needs to enable them
920 * needs to re-enable interrupts (but soft-disables them) 920 * anyways, do it now so we deal with the case where one already
921 * happened while soft-disabled.
922 * We shouldn't get any external interrupts, only decrementer, and the
923 * decrementer handler is safe for use on offline CPUs
921 */ 924 */
922 hard_irq_disable(); 925 local_irq_enable();
923 926
924 while (1) { 927 while (1) {
925 /* let's not take timer interrupts too often ... */ 928 /* let's not take timer interrupts too often ... */
926 set_dec(0x7fffffff); 929 set_dec(0x7fffffff);
927 930
928 /* should always be true at this point */ 931 /* Enter NAP mode */
929 if (cpu_has_feature(CPU_FTR_CAN_NAP)) 932 power4_idle();
930 power4_cpu_offline_powersave();
931 } 933 }
932} 934}
933 935