]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
powerpc/powermac: Fix occasional SMP boot failure
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Sun, 11 Jan 2009 19:03:45 +0000 (19:03 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 13 Jan 2009 03:48:03 +0000 (14:48 +1100)
The PowerMac kernel occasionally fails to bring up the secondary CPUs on
SMP, the trigger factor seem to be fairly random and related to location
of code and data.

This appears to be due to the initial loading of the TOC value by the
secondary processor which now happens before we clear HID4:RM_CI (Real
Mode Cache Invalidate). This bit should really be cleared before we do
any load or store other than fetching code.

This fix works based on the assumption that all SMP 64-bit PowerMacs use
variants of the 970, which fortunately is true, by explicitely clearing
that bit, adding an slbia for good measure as RM_CI mode is known to
create bogus ERAT entries.

I also removed some spurrious debug output that was left enabled by
mistake while at it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/head_64.S
arch/powerpc/platforms/powermac/smp.c

index b4bcf5a930fafd50a350d6e97bf8cf8cde833764..ebaedafc8e67403efe716703d6110825d589a77d 100644 (file)
@@ -1518,6 +1518,15 @@ _GLOBAL(pmac_secondary_start)
        /* turn on 64-bit mode */
        bl      .enable_64b_mode
 
+       li      r0,0
+       mfspr   r3,SPRN_HID4
+       rldimi  r3,r0,40,23     /* clear bit 23 (rm_ci) */
+       sync
+       mtspr   SPRN_HID4,r3
+       isync
+       sync
+       slbia
+
        /* get TOC pointer (real address) */
        bl      .relative_toc
 
index 6b0711c15ecaf9ad506e6b9dfd8eec61677dd978..bd8817b00fa4a80f3d2ab4649e6ef917ec9db8aa 100644 (file)
@@ -53,7 +53,7 @@
 #include <asm/pmac_low_i2c.h>
 #include <asm/pmac_pfunc.h>
 
-#define DEBUG
+#undef DEBUG
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)