From: AMEET M. PARANJAPE <aparanja@redhat.com> Date: Tue, 20 Jan 2009 12:56:41 -0500 Subject: [ppc] don't reset affinity for secondary MPIC on boot Message-id: 20090120175532.23631.2659.sendpatchset@squad5-lp1.lab.bos.redhat.com O-Subject: [PATCH RHEL5.4 BZ480801] powerpc/mpic: Don't reset affinity for secondary MPIC on boot Bugzilla: 480801 RH-Acked-by: Neil Horman <nhorman@redhat.com> RH-Acked-by: Neil Horman <nhorman@redhat.com> RH-Acked-by: David Howells <dhowells@redhat.com> RHBZ#: ====== https://bugzilla.redhat.com/show_bug.cgi?id=480801 Description: =========== 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. 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. RHEL Version Found: ================ RHEL 5.3 kABI Status: ============ No symbols were harmed. Brew: ===== Built on all platforms. http://brewweb.devel.redhat.com/brew/taskinfo?taskID=1651553 Upstream Status: ================ Commit ID cc353c30bbdb84f4317a6c149ebb11cde2232e40 Test Status: ============ Running the kexec command with numactl will trigger the problem reliably: numactl --cpunodebind 1 kexec --ramdisk=/boot/initrd-2.6.18-128.el5.cell.20090116.img --append="ro rootdelay=10 root=/dev/sda2" /boot/vmlinuz-2.6.18-128.el5.cell.20090116 Without the patch the blade will fall into xmon, but with the patch the kexec kernel boots fine. =============================================================== Ameet Paranjape 978-392-3903 ext 23903 IBM on-site partner Proposed Patch: =============== diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 0c7e6e7..de96602 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -1083,6 +1083,7 @@ void __init mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count) void __init mpic_init(struct mpic *mpic) { int i; + int cpu; BUG_ON(mpic->num_sources == 0); WARN_ON(mpic->num_sources > MPIC_VEC_IPI_0); @@ -1147,6 +1148,11 @@ void __init mpic_init(struct mpic *mpic) } } + if (mpic->flags & MPIC_PRIMARY) + cpu = hard_smp_processor_id(); + else + cpu = 0; + for (i = 0; i < mpic->num_sources; i++) { /* start with vector = source number, and masked */ u32 vecpri = MPIC_VECPRI_MASK | i | @@ -1157,8 +1163,7 @@ void __init mpic_init(struct mpic *mpic) continue; /* init hw */ mpic_irq_write(i, MPIC_INFO(IRQ_VECTOR_PRI), vecpri); - mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION), - 1 << hard_smp_processor_id()); + mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION), 1 << cpu); } /* Init spurrious vector */