diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-01-11 14:03:45 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-01-12 22:48:03 -0500 |
commit | c478b58135e6c9b49c8b80bff8ef910f2ba9b313 (patch) | |
tree | fb5e53355a8b9973d6ae2a1b9ab0d6b86f2efeb9 /arch | |
parent | fc7a9feb9c9df50ed6d115514b48c49e8511a4de (diff) |
powerpc/powermac: Fix occasional SMP boot failure
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 9 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/smp.c | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index b4bcf5a930fa..ebaedafc8e67 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -1518,6 +1518,15 @@ _GLOBAL(pmac_secondary_start) | |||
1518 | /* turn on 64-bit mode */ | 1518 | /* turn on 64-bit mode */ |
1519 | bl .enable_64b_mode | 1519 | bl .enable_64b_mode |
1520 | 1520 | ||
1521 | li r0,0 | ||
1522 | mfspr r3,SPRN_HID4 | ||
1523 | rldimi r3,r0,40,23 /* clear bit 23 (rm_ci) */ | ||
1524 | sync | ||
1525 | mtspr SPRN_HID4,r3 | ||
1526 | isync | ||
1527 | sync | ||
1528 | slbia | ||
1529 | |||
1521 | /* get TOC pointer (real address) */ | 1530 | /* get TOC pointer (real address) */ |
1522 | bl .relative_toc | 1531 | bl .relative_toc |
1523 | 1532 | ||
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index 6b0711c15eca..bd8817b00fa4 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c | |||
@@ -53,7 +53,7 @@ | |||
53 | #include <asm/pmac_low_i2c.h> | 53 | #include <asm/pmac_low_i2c.h> |
54 | #include <asm/pmac_pfunc.h> | 54 | #include <asm/pmac_pfunc.h> |
55 | 55 | ||
56 | #define DEBUG | 56 | #undef DEBUG |
57 | 57 | ||
58 | #ifdef DEBUG | 58 | #ifdef DEBUG |
59 | #define DBG(fmt...) udbg_printf(fmt) | 59 | #define DBG(fmt...) udbg_printf(fmt) |