All of lore.kernel.org
 help / color / mirror / Atom feed
From: adharmap@codeaurora.org
To: linux-arm-kernel@lists.infradead.org
Cc: Russell King <linux@arm.linux.org.uk>,
	Ingo Molnar <mingo@elte.hu>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Yinghai Lu <yinghai@kernel.org>, Tony Lindgren <tony@atomide.com>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Kevin Hilman <khilman@deeprootsystems.com>,
	Kalle Valo <kalle.valo@iki.fi>, Jean Pihet <jpihet@mvista.com>,
	Linus Walleij <linus.walleij@stericsson.com>,
	Colin Tuckley <colin.tuckley@arm.com>,
	Philby John <pjohn@in.mvista.com>,
	Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>,
	Alessandro Rubini <rubini@unipv.it>,
	Andrea Gallo <andrea.gallo@stericsson.com>,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	Abhijeet Dharmapurikar <adharmap@quicinc.com>
Subject: [PATCH 4/5] gic: dont disable INT in ack callback
Date: Wed, 27 Jan 2010 11:32:28 -0800	[thread overview]
Message-ID: <1264620749-24527-5-git-send-email-adharmap@codeaurora.org> (raw)
In-Reply-To: <1264620749-24527-1-git-send-email-adharmap@codeaurora.org>

From: Abhijeet Dharmapurikar <adharmap@quicinc.com>

Unless gic_ack_irq is called from __do_IRQ, interrupt should not
be disabled in the ack function. Disabling the interrupt causes
handle_edge_irq to never enable it again.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@quicinc.com>
---
 arch/arm/common/gic.c |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 709cf53..d47a1d7 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -67,25 +67,30 @@ static inline unsigned int gic_irq(unsigned int irq)
 
 /*
  * Routines to acknowledge, disable and enable interrupts
- *
- * Linux assumes that when we're done with an interrupt we need to
- * unmask it, in the same way we need to unmask an interrupt when
- * we first enable it.
- *
- * The GIC has a separate notion of "end of interrupt" to re-enable
- * an interrupt after handling, in order to support hardware
- * prioritisation.
- *
- * We can make the GIC behave in the way that Linux expects by making
- * our "acknowledge" routine disable the interrupt, then mark it as
- * complete.
  */
 static void gic_ack_irq(unsigned int irq)
 {
 	u32 mask = 1 << (irq % 32);
 
 	spin_lock(&irq_controller_lock);
+
+#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
+
+	 /*
+	  * Linux assumes that when we're done with an interrupt we need to
+	  * unmask it, in the same way we need to unmask an interrupt when
+	  * we first enable it.
+	  *
+	  * The GIC has a separate notion of "end of interrupt" to re-enable
+	  * an interrupt after handling, in order to support hardware
+	  * prioritisation.
+	  *
+	  * We can make the GIC behave in the way that Linux expects by making
+	  * our "acknowledge" routine disable the interrupt, then mark it as
+	  * complete.
+	  */
 	writel(mask, gic_dist_base(irq) + GIC_DIST_ENABLE_CLEAR + (gic_irq(irq) / 32) * 4);
+#endif
 	writel(gic_irq(irq), gic_cpu_base(irq) + GIC_CPU_EOI);
 	spin_unlock(&irq_controller_lock);
 }
-- 
1.5.6.3

WARNING: multiple messages have this Message-ID (diff)
From: adharmap@codeaurora.org (adharmap at codeaurora.org)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] gic: dont disable INT in ack callback
Date: Wed, 27 Jan 2010 11:32:28 -0800	[thread overview]
Message-ID: <1264620749-24527-5-git-send-email-adharmap@codeaurora.org> (raw)
In-Reply-To: <1264620749-24527-1-git-send-email-adharmap@codeaurora.org>

From: Abhijeet Dharmapurikar <adharmap@quicinc.com>

Unless gic_ack_irq is called from __do_IRQ, interrupt should not
be disabled in the ack function. Disabling the interrupt causes
handle_edge_irq to never enable it again.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@quicinc.com>
---
 arch/arm/common/gic.c |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 709cf53..d47a1d7 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -67,25 +67,30 @@ static inline unsigned int gic_irq(unsigned int irq)
 
 /*
  * Routines to acknowledge, disable and enable interrupts
- *
- * Linux assumes that when we're done with an interrupt we need to
- * unmask it, in the same way we need to unmask an interrupt when
- * we first enable it.
- *
- * The GIC has a separate notion of "end of interrupt" to re-enable
- * an interrupt after handling, in order to support hardware
- * prioritisation.
- *
- * We can make the GIC behave in the way that Linux expects by making
- * our "acknowledge" routine disable the interrupt, then mark it as
- * complete.
  */
 static void gic_ack_irq(unsigned int irq)
 {
 	u32 mask = 1 << (irq % 32);
 
 	spin_lock(&irq_controller_lock);
+
+#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
+
+	 /*
+	  * Linux assumes that when we're done with an interrupt we need to
+	  * unmask it, in the same way we need to unmask an interrupt when
+	  * we first enable it.
+	  *
+	  * The GIC has a separate notion of "end of interrupt" to re-enable
+	  * an interrupt after handling, in order to support hardware
+	  * prioritisation.
+	  *
+	  * We can make the GIC behave in the way that Linux expects by making
+	  * our "acknowledge" routine disable the interrupt, then mark it as
+	  * complete.
+	  */
 	writel(mask, gic_dist_base(irq) + GIC_DIST_ENABLE_CLEAR + (gic_irq(irq) / 32) * 4);
+#endif
 	writel(gic_irq(irq), gic_cpu_base(irq) + GIC_CPU_EOI);
 	spin_unlock(&irq_controller_lock);
 }
-- 
1.5.6.3

  parent reply	other threads:[~2010-01-27 19:32 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-27 19:32 [PATCH 0/5] Arm Gic Changes adharmap
2010-01-27 19:32 ` adharmap
2010-01-27 19:32 ` adharmap at codeaurora.org
2010-01-27 19:32 ` [PATCH 1/5] gic: prevent gic from crossing NR_IRQ adharmap
2010-01-27 19:32   ` adharmap at codeaurora.org
2010-01-27 22:43   ` Russell King - ARM Linux
2010-01-27 22:43     ` Russell King - ARM Linux
2010-01-27 22:43     ` Russell King - ARM Linux
2010-01-28 13:19     ` Catalin Marinas
2010-01-28 13:19       ` Catalin Marinas
2010-01-27 19:32 ` [PATCH 2/5] gic: add callback for mask_ack adharmap
2010-01-27 19:32   ` adharmap
2010-01-27 19:32   ` adharmap at codeaurora.org
2010-01-27 19:32 ` [PATCH 3/5] gic: Add set_type callback adharmap
2010-01-27 19:32   ` adharmap at codeaurora.org
2010-01-27 23:09   ` Russell King - ARM Linux
2010-01-27 23:09     ` Russell King - ARM Linux
2010-01-27 23:09     ` Russell King - ARM Linux
2010-01-27 23:18   ` Russell King - ARM Linux
2010-01-27 23:18     ` Russell King - ARM Linux
2010-01-27 23:18     ` Russell King - ARM Linux
2010-01-28  1:43     ` Abhijeet Dharmapurikar
2010-01-28  1:43       ` Abhijeet Dharmapurikar
2010-05-07 10:56   ` Linus Walleij
2010-05-07 10:56     ` Linus Walleij
2010-01-27 19:32 ` adharmap [this message]
2010-01-27 19:32   ` [PATCH 4/5] gic: dont disable INT in ack callback adharmap at codeaurora.org
2010-01-27 19:32 ` [RFC PATCH 5/5] gic: initialize interrupts as per argument adharmap
2010-01-27 19:32   ` adharmap at codeaurora.org
2010-01-27 23:29   ` Russell King - ARM Linux
2010-01-27 23:29     ` Russell King - ARM Linux
2010-01-27 23:29     ` Russell King - ARM Linux
2010-01-28  0:39 ` [PATCH 0/5] Arm Gic Changes Ben Dooks
2010-01-28  0:39   ` Ben Dooks
2010-01-28  0:39   ` Ben Dooks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1264620749-24527-5-git-send-email-adharmap@codeaurora.org \
    --to=adharmap@codeaurora.org \
    --cc=adharmap@quicinc.com \
    --cc=andrea.gallo@stericsson.com \
    --cc=catalin.marinas@arm.com \
    --cc=colin.tuckley@arm.com \
    --cc=jpihet@mvista.com \
    --cc=kalle.valo@iki.fi \
    --cc=khilman@deeprootsystems.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@elte.hu \
    --cc=pjohn@in.mvista.com \
    --cc=rubini@unipv.it \
    --cc=santosh.shilimkar@ti.com \
    --cc=srinidhi.kasagar@stericsson.com \
    --cc=tony@atomide.com \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.