From patchwork Sun Apr 18 14:46:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Knispel X-Patchwork-Id: 50400 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id DC1FFB7F9C for ; Mon, 19 Apr 2010 00:46:26 +1000 (EST) Received: from mx1.corp.avencall.com (mx1.corp.avencall.com [91.194.178.12]) by ozlabs.org (Postfix) with ESMTP id 09AB3B7D0B for ; Mon, 19 Apr 2010 00:46:19 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by mx1.corp.avencall.com (Postfix) with ESMTP id D2677506107; Sun, 18 Apr 2010 16:46:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at mx1.corp.avencall.com Received: from mx1.corp.avencall.com ([127.0.0.1]) by localhost (mx1.corp.avencall.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eFuWhtTEvHKP; Sun, 18 Apr 2010 16:46:15 +0200 (CEST) Received: from xilun.lan.proformatique.com (unknown [92.103.5.174]) by mx1.corp.avencall.com (Postfix) with ESMTPSA id 2F57E506014; Sun, 18 Apr 2010 16:46:15 +0200 (CEST) Date: Sun, 18 Apr 2010 16:46:14 +0200 From: Guillaume Knispel To: linux-kernel@vger.kernel.org, Linuxppc-dev@lists.ozlabs.org Subject: Re: Pending interrupts not always replayed Message-ID: <20100418164614.771d4f01@xilun.lan.proformatique.com> In-Reply-To: <20100418053439.4d2ffe11@xilun.lan.proformatique.com> References: <20100418053439.4d2ffe11@xilun.lan.proformatique.com> Organization: Proformatique X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.12; i486-pc-linux-gnu) Mime-Version: 1.0 Cc: Lars-Peter Clausen , Bartlomiej Zolnierkiewicz , Peter Zijlstra , Michael Buesch , Ingo Molnar , Linus Torvalds , Thomas Gleixner X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org On Sun, 18 Apr 2010 05:34:39 +0200 Guillaume Knispel wrote: > From reading the code (kernel/irq stuffs), it seems that at least some > handle_edge_irq based interrupts are not replayed when enabling if > desc->chip->retrigger == NULL and on a platform where > CONFIG_HARDIRQS_SW_RESEND is not set (which for now is only defined for > (some?) arm and avr32). Depending on the pic this problem might > be masked if multiple interrupts are received between disable_irq and > enable_irq (maybe other conditions exist with controllers i don't know). > > I happen to program a PPC SoC (MPC8555E to be precise), using some edge > interrupts on the PortC of the CPM2 pic (arch/powerpc/sysdev/cpm2_pic.c) > in a driver that does some enable_irq/disable_irq while various > patterns of interrupts are received and i think i've hit the problem. > > Is the behavior intended (not always replaying edge triggered interrupts) > or is it just a bug to fix? > > Anybody knows if it's safe to activate CONFIG_HARDIRQS_SW_RESEND for a > powerpc or are there some known dangerous interactions? > (I'll give it a try on my side in the meantime anyway) A follow up on this issue and on my CONFIG_HARDIRQS_SW_RESEND tests: I've basically done this: (yeah, I know, old kernel, but the code involved hasn't change much since) and of course +CONFIG_HARDIRQS_SW_RESEND=y in my .config Now everything seems to work fine: my device was not previously not interrupting anymore after typically 1 or 2 minutes (because the interrupt signal stays at level low until the device is served, so if one falling edge is missed no more interruption will ever be seen), and right now it has been running for 1 hour without any observable problem. Cheers! Index: linux-2.6.22.18/arch/powerpc/Kconfig =================================================================== --- linux-2.6.22.18.orig/arch/powerpc/Kconfig 2010-04-18 15:22:24.000000000 +0200 +++ linux-2.6.22.18/arch/powerpc/Kconfig 2010-04-18 15:23:21.000000000 +0200 @@ -35,6 +35,10 @@ bool default y +config HARDIRQS_SW_RESEND + bool + default y + config IRQ_PER_CPU bool default y