powerpc/mpic: Don't reset affinity for secondary MPIC on boot

Kexec/kdump currently fails on the IBM QS2x blades when the kexec happens
on a CPU other than the initial boot CPU. It turns out that this is the
result of mpic_init trying to set affinity of each interrupt vector to the
current boot CPU.

As far as I can tell, the same problem is likely to exist on any
secondary MPIC, because they have to deliver interrupts to the first
output all the time. There are two potential solutions for this: either
not set up affinity at all for secondary MPICs, or assume that a single
CPU output is connected to the upstream interrupt controller and hardcode
affinity to that per architecture.

This patch implements the second approach, defaulting to the first output.
Currently, all known secondary MPICs are routed to their upstream port
using the first destination, so we hardcode that.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by Arnd Bergmann and committed by Paul Mackerras cc353c30 d015fe99

+7 -2
+7 -2
arch/powerpc/sysdev/mpic.c
··· 1271 1271 void __init mpic_init(struct mpic *mpic) 1272 1272 { 1273 1273 int i; 1274 + int cpu; 1274 1275 1275 1276 BUG_ON(mpic->num_sources == 0); 1276 1277 ··· 1314 1313 1315 1314 mpic_pasemi_msi_init(mpic); 1316 1315 1316 + if (mpic->flags & MPIC_PRIMARY) 1317 + cpu = hard_smp_processor_id(); 1318 + else 1319 + cpu = 0; 1320 + 1317 1321 for (i = 0; i < mpic->num_sources; i++) { 1318 1322 /* start with vector = source number, and masked */ 1319 1323 u32 vecpri = MPIC_VECPRI_MASK | i | ··· 1329 1323 continue; 1330 1324 /* init hw */ 1331 1325 mpic_irq_write(i, MPIC_INFO(IRQ_VECTOR_PRI), vecpri); 1332 - mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION), 1333 - 1 << hard_smp_processor_id()); 1326 + mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION), 1 << cpu); 1334 1327 } 1335 1328 1336 1329 /* Init spurious vector */