From patchwork Thu Nov 20 17:23:24 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9855 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 939D4DDF01 for ; Fri, 21 Nov 2008 04:24:48 +1100 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by ozlabs.org (Postfix) with ESMTP id 7F291DDE08; Fri, 21 Nov 2008 04:23:39 +1100 (EST) Received: from dyn-9-152-222-41.boeblingen.de.ibm.com (blueice1n1.de.ibm.com [195.212.29.163]) by mrelayeu.kundenserver.de (node=mrelayeu2) with ESMTP (Nemesis) id 0MKwtQ-1L3DFY39a1-0004B4; Thu, 20 Nov 2008 18:23:32 +0100 From: Arnd Bergmann To: Benjamin Herrenschmidt Date: Thu, 20 Nov 2008 18:23:24 +0100 User-Agent: KMail/1.9.9 References: <200811191450.59361.arnd@arndb.de> <1227166240.7185.207.camel@pasglop> In-Reply-To: <1227166240.7185.207.camel@pasglop> X-Face: I@=L^?./?$U, EK.)V[4*>`zSqm0>65YtkOe>TFD'!aw?7OVv#~5xd\s, [~w]-J!)|%=]>=?utf-8?q?+=0A=09=7EohchhkRGW=3F=7C6=5FqTmkd=5Ft=3FLZC=23Q-=60=2E=60Y=2Ea=5E?= =?utf-8?q?3zb?=) =?utf-8?q?+U-JVN=5DWT=25cw=23=5BYo0=267C=26bL12wWGlZi=0A=09=7EJ=3B=5Cwg?= =?utf-8?q?=3B3zRnz?=, J"CT_)=\H'1/{?SR7GDu?WIopm.HaBG=QYj"NZD_[zrM\Gip^U MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200811201823.25263.arnd@arndb.de> X-Provags-ID: V01U2FsdGVkX19pBMa5ZYyq8gBeIkUzAdRnlr5eFe1FlOszRMz KZyO5FlQPUnUeGKRKJJwVRliwDR4JLD2qG4MC6qG/ceBqLKgJ6 rKa1fFCsFMsKsojnBbRwg== Cc: linuxppc-dev@ozlabs.org, kexec@lists.infradead.org, cbe-oss-dev@ozlabs.org, Max Krasnyansky Subject: Re: [Cbe-oss-dev] [PATCH] powerpc/mpic: don't reset affinity for secondary MPIC on boot X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org 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. An architecture that has a secondary MPIC connected upstream using a different output needs to set the mpic default_dest to the correct value before calling mpic_init. Signed-off-by: Arnd Bergmann --- include/asm/mpic.h | 3 +++ sysdev/mpic.c | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) On Thursday 20 November 2008, Benjamin Herrenschmidt wrote: > I would rather, for non primary, set it to a cpu provided as > either a new argument or an mpic struct member initially set to 1 with > an accessor to change it if necessary. How about this one? > Or should we define a flag to have it read it at init time from the chip ? I don't understand. This is init time, where we write it to the chip, what do you mean with reading from it? If I understand you correctly, we can't trust that value to start with. Arnd <>< diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h index fe566a3..543d51c 100644 --- a/arch/powerpc/include/asm/mpic.h +++ b/arch/powerpc/include/asm/mpic.h @@ -295,6 +295,9 @@ struct mpic /* Protected sources */ unsigned long *protected; + /* destination for non-primary MPICs */ + int default_dest; + #ifdef CONFIG_MPIC_WEIRD /* Pointer to HW info array */ u32 *hw_set; diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 8e3478c..cf154c9 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c @@ -1220,6 +1220,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); @@ -1262,6 +1263,11 @@ void __init mpic_init(struct mpic *mpic) mpic_pasemi_msi_init(mpic); + if (mpic->flags & MPIC_PRIMARY) + cpu = hard_smp_processor_id(); + else + cpu = mpic->default_dest; + for (i = 0; i < mpic->num_sources; i++) { /* start with vector = source number, and masked */ u32 vecpri = MPIC_VECPRI_MASK | i | @@ -1272,8 +1278,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 spurious vector */