From patchwork Wed Jan 22 22:12:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 313427 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 17A652C0092 for ; Thu, 23 Jan 2014 09:13:07 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W662c-0000zr-MC; Wed, 22 Jan 2014 22:12:58 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W662a-0006Ls-4j; Wed, 22 Jan 2014 22:12:56 +0000 Received: from top.free-electrons.com ([176.31.233.9] helo=mail.free-electrons.com) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W662W-0006Kx-VK for linux-arm-kernel@lists.infradead.org; Wed, 22 Jan 2014 22:12:53 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 6ECC0804; Wed, 22 Jan 2014 23:12:22 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.3.2 Received: from localhost (unknown [190.2.98.212]) by mail.free-electrons.com (Postfix) with ESMTPSA id 5C0257AF; Wed, 22 Jan 2014 23:12:18 +0100 (CET) Date: Wed, 22 Jan 2014 19:12:38 -0300 From: Ezequiel Garcia To: Jason Gunthorpe , Sebastian Hesselbarth , Thomas Gleixner Subject: Re: [PATCH v2 06/15] watchdog: orion: Remove unneeded BRIDGE_CAUSE clear Message-ID: <20140122221237.GA30763@localhost> References: <1390295561-3466-1-git-send-email-ezequiel.garcia@free-electrons.com> <1390295561-3466-7-git-send-email-ezequiel.garcia@free-electrons.com> <20140121233537.GS18269@obsidianresearch.com> <20140122164904.GB27273@localhost> <20140122173417.GT18269@obsidianresearch.com> <52E02AB6.7040104@gmail.com> <20140122205213.GW18269@obsidianresearch.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140122205213.GW18269@obsidianresearch.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140122_171253_103494_65D6C0A0 X-CRM114-Status: GOOD ( 15.17 ) X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Lior Amsalem , devicetree@vger.kernel.org, linux-watchdog@vger.kernel.org, Tawfik Bayouk , Andrew Lunn , Wim Van Sebroeck , Gregory Clement , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, Jason Cooper X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org On Wed, Jan 22, 2014 at 01:52:13PM -0700, Jason Gunthorpe wrote: > > Clearing BRIDGE_CAUSE will only clear all currently pending upstream > > IRQs, of course. If WDT IRQ will be re-raised right after that in > > BRIDGE_CAUSE depends on the actual HW implementation, i.e. we do no > > clear the causing IRQ itself but just what it raised in BRIDGE_CAUSE. > > Which is why it makes no sense to clear it one time at kernel start. > So, it seems we need to handle irq_startup(), as you suggested. I've just tested the attached patch, and it's working fine: the driver's probe() fully stops the watchdog, and then request_irq() acks and pending interrupts, through the added irq_startup(). How does it look? diff --git a/drivers/irqchip/irq-orion.c b/drivers/irqchip/irq-orion.c index e51d400..91a3955 100644 --- a/drivers/irqchip/irq-orion.c +++ b/drivers/irqchip/irq-orion.c @@ -108,6 +108,16 @@ IRQCHIP_DECLARE(orion_intc, "marvell,orion-intc", orion_irq_init); #define ORION_BRIDGE_IRQ_CAUSE 0x00 #define ORION_BRIDGE_IRQ_MASK 0x04 +static unsigned int orion_bridge_irq_startup(struct irq_data *data) +{ + /* Ack pending interrupts */ + data->chip->irq_ack(data); + + /* Unmask the interrupt */ + data->chip->irq_unmask(data); + return 0; +} + static void orion_bridge_irq_handler(unsigned int irq, struct irq_desc *desc) { struct irq_domain *d = irq_get_handler_data(irq); @@ -176,6 +186,7 @@ static int __init orion_bridge_irq_init(struct device_node *np, gc->chip_types[0].regs.ack = ORION_BRIDGE_IRQ_CAUSE; gc->chip_types[0].regs.mask = ORION_BRIDGE_IRQ_MASK; + gc->chip_types[0].chip.irq_startup = orion_bridge_irq_startup; gc->chip_types[0].chip.irq_ack = irq_gc_ack_clr_bit; gc->chip_types[0].chip.irq_mask = irq_gc_mask_clr_bit; gc->chip_types[0].chip.irq_unmask = irq_gc_mask_set_bit;