From patchwork Fri Dec 12 19:19:50 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13764 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 911DEDE090 for ; Sat, 13 Dec 2008 06:24:29 +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.17.10]) by ozlabs.org (Postfix) with ESMTP id EB660DDF3D; Sat, 13 Dec 2008 06:20:38 +1100 (EST) Received: from dyn-9-152-222-92.boeblingen.de.ibm.com (blueice4n1.de.ibm.com [195.212.29.187]) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis) id 0MKwpI-1LBDYD3Zqn-0002S8; Fri, 12 Dec 2008 20:19:57 +0100 From: Arnd Bergmann To: paulus@samba.org, linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org, Michael Ellerman , benh@kernel.crashing.org Date: Fri, 12 Dec 2008 20:19:50 +0100 User-Agent: KMail/1.9.9 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: <200812122019.51191.arnd@arndb.de> X-Provags-ID: V01U2FsdGVkX1+Rh0Z935ro4MLe3zCPivdg4NBHg1uc8xN/ozs BmXznJpm1oXpcGNrHLcQc62NIy0byW02FztAmKRRQua9fMnuuo pdsrL6YgPLg8RQXNhtgNg== Subject: [Cbe-oss-dev] powerpc/cell/axon-msi: fix MSI after kexec 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 Commit d015fe995 'powerpc/cell/axon-msi: Retry on missing interrupt' has turned a rare failure to kexec on QS22 into a reproducible error, which we have now analysed. The problem is that after a kexec, the MSIC hardware still points into the middle of the old ring buffer. We set up the ring buffer during reboot, but not the offset into it. On older kernels, this would cause a storm of thousands of spurious interrupts after a kexec, which would most of the time get dropped silently. With the new code, we time out on each interrupt, waiting for it to become valid. If more interrupts come in that we time out on, this goes on indefinitely, which eventually leads to a hard crash. The solution in this patch is to read the current offset from the MSIC when reinitializing it. This now works correctly, as expected. Reported-by: Dirk Herrendoerfer Signed-off-by: Arnd Bergmann Acked-by: Michael Ellerman --- Please apply when Dirk and Michael have given their Ack. Should we have it in 2.6.28? Not sure if going from 'works sometimes' to 'works never' counts as a regression. Most users won't be impacted, because they don't use kexec on QS22. diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 442cf36..548fa4e 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c @@ -413,6 +422,9 @@ static int axon_msi_probe(struct of_device *device, MSIC_CTRL_IRQ_ENABLE | MSIC_CTRL_ENABLE | MSIC_CTRL_FIFO_SIZE); + msic->read_offset = dcr_read(msic->dcr_host, MSIC_WRITE_OFFSET_REG) + & MSIC_FIFO_SIZE_MASK; + device->dev.platform_data = msic; ppc_md.setup_msi_irqs = axon_msi_setup_msi_irqs;