From patchwork Sun Dec 2 08:09:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 1830171 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id EC29BDF254 for ; Sun, 2 Dec 2012 08:13:41 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tf4cZ-0005GK-Cd; Sun, 02 Dec 2012 08:09:51 +0000 Received: from smtp35.i.mail.ru ([94.100.177.95]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tf4cU-0005Fk-TL for linux-arm-kernel@lists.infradead.org; Sun, 02 Dec 2012 08:09:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=EXjdkjRid3gCrhA8tfIMzVcndDK4eA7/bLEoNRdoPHg=; b=oCYwcvXmZsT1VKD93wO/H+5ajf9an53zg82NgQgzADI8s9mt1QifBspbDTu6ipubLMdBPdynbUHOTyYsPkmYi4RrBdiUT7H5V7JAdt8CC3E8oPIy7DIQyuKeOAGvtWT+; Received: from [188.134.40.128] (port=56648 helo=shc.zet) by smtp35.i.mail.ru with esmtpa (envelope-from ) id 1Tf4cR-0001fZ-IB; Sun, 02 Dec 2012 12:09:43 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] ARM: ixp4xx: Moving the timer flags control in ixp4xx_irq_ack() procedure Date: Sun, 2 Dec 2012 12:09:29 +0400 Message-Id: <1354435770-2719-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <201212020011.42105.arnd@arndb.de> References: <201212020011.42105.arnd@arndb.de> X-Spam: Not detected X-Mras: Ok X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121202_030947_427966_B1BC3AB4 X-CRM114-Status: GOOD ( 13.10 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (shc_work[at]mail.ru) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Jason Cooper , Alexander Shiyan , Arnd Bergmann , Olof Johansson , Imre Kaloz , Krzysztof Halasa X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Rather than modify the EOI flags directly in the timer interrupt, let's deal with these flags in the ixp4xx_irq_ack() procedure. Signed-off-by: Alexander Shiyan Acked-by: Arnd Bergmann --- arch/arm/mach-ixp4xx/common.c | 35 ++++++++++++++++++++++++++--------- drivers/input/misc/ixp4xx-beeper.c | 3 --- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 7443e1d..8e2a3b8 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c @@ -204,10 +204,28 @@ static void ixp4xx_irq_mask(struct irq_data *d) static void ixp4xx_irq_ack(struct irq_data *d) { - int line = (d->irq < 32) ? irq2gpio[d->irq] : -1; + int line; - if (line >= 0) - writel_relaxed(1 << line, IXP4XX_GPIO_GPISR); + switch (d->irq) { + case IRQ_IXP4XX_TIMER1: + writel_relaxed(IXP4XX_OSST_TIMER_1_PEND, IXP4XX_OSST); + break; + case IRQ_IXP4XX_TIMER2: + writel_relaxed(IXP4XX_OSST_TIMER_2_PEND, IXP4XX_OSST); + break; + case IRQ_IXP4XX_TIMESTAMP: + writel_relaxed(IXP4XX_OSST_TIMER_TS_PEND, IXP4XX_OSST); + break; + case IRQ_IXP4XX_WDOG: + writel_relaxed(IXP4XX_OSST_TIMER_WDOG_PEND, IXP4XX_OSST); + break; + default: + line = (d->irq < 32) ? irq2gpio[d->irq] : -1; + + if (line >= 0) + writel_relaxed(1 << line, IXP4XX_GPIO_GPISR); + break; + } } /* @@ -249,6 +267,11 @@ void __init ixp4xx_init_irq(void) /* Disable all interrupt */ writel_relaxed(0, IXP4XX_ICMR); + /* Clear Timer Pending Interrupts */ + writel_relaxed(IXP4XX_OSST_TIMER_1_PEND | IXP4XX_OSST_TIMER_2_PEND | + IXP4XX_OSST_TIMER_TS_PEND | IXP4XX_OSST_TIMER_WDOG_PEND, + IXP4XX_OSST); + if (cpu_is_ixp46x() || cpu_is_ixp43x()) { /* Route upper 32 sources to IRQ instead of FIQ */ writel_relaxed(0, IXP4XX_ICLR2); @@ -276,9 +299,6 @@ static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id) { struct clock_event_device *evt = dev_id; - /* Clear Pending Interrupt by writing '1' to it */ - writel_relaxed(IXP4XX_OSST_TIMER_1_PEND, IXP4XX_OSST); - evt->event_handler(evt); return IRQ_HANDLED; @@ -296,9 +316,6 @@ void __init ixp4xx_timer_init(void) /* Reset/disable counter */ writel_relaxed(0, IXP4XX_OSRT1); - /* Clear Pending Interrupt by writing '1' to it */ - writel_relaxed(IXP4XX_OSST_TIMER_1_PEND, IXP4XX_OSST); - /* Reset time-stamp counter */ writel_relaxed(0, IXP4XX_OSTS); diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c index eae50fe..6b40950 100644 --- a/drivers/input/misc/ixp4xx-beeper.c +++ b/drivers/input/misc/ixp4xx-beeper.c @@ -78,9 +78,6 @@ static int ixp4xx_spkr_event(struct input_dev *dev, unsigned int type, unsigned static irqreturn_t ixp4xx_spkr_interrupt(int irq, void *dev_id) { - /* clear interrupt */ - writel_relaxed(IXP4XX_OSST_TIMER_2_PEND, IXP4XX_OSST); - /* flip the beeper output */ writel_relaxed(readl_relaxed(IXP4XX_GPIO_GPOUTR) ^ (1 << (unsigned int) dev_id), IXP4XX_GPIO_GPOUTR);