linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] GIC: Dont disable INT in ack callback
@ 2010-07-22 22:57 Jeff Ohlstein
  2010-07-24 10:30 ` Rabin Vincent
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Ohlstein @ 2010-07-22 22:57 UTC (permalink / raw)
  To: linux
  Cc: linux-arm-msm, Abhijeet Dharmapurikar, Jeff Ohlstein,
	linux-arm-kernel, linux-kernel

From: Abhijeet Dharmapurikar <adharmap@codeaurora.org>

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@codeaurora.org>
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
---
 arch/arm/common/gic.c |   31 ++++++++++++++++++-------------
 1 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 337741f..1ac2f31 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
+	u32 mask = 1 << (irq % 32);
+
+	 /*
+	  * 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.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] GIC: Dont disable INT in ack callback
  2010-07-22 22:57 [PATCH] GIC: Dont disable INT in ack callback Jeff Ohlstein
@ 2010-07-24 10:30 ` Rabin Vincent
  2010-07-27 18:46   ` [PATCH v2] " Jeff Ohlstein
  0 siblings, 1 reply; 3+ messages in thread
From: Rabin Vincent @ 2010-07-24 10:30 UTC (permalink / raw)
  To: Jeff Ohlstein
  Cc: linux, linux-arm-msm, Abhijeet Dharmapurikar, linux-arm-kernel,
	linux-kernel

On Thu, Jul 22, 2010 at 03:57:30PM -0700, Jeff Ohlstein wrote:
> 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.

The GIC doesn't use handle_edge_irq.

Anyway, this change is correct since gic_ack_irq is currently doing a
maskack, when it should be just an ack.  However, since
GENERIC_HARDIRQS_NO__DO_IRQ is always true on ARM, I don't see a need to
add the ifndef.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] GIC: Dont disable INT in ack callback
  2010-07-24 10:30 ` Rabin Vincent
@ 2010-07-27 18:46   ` Jeff Ohlstein
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Ohlstein @ 2010-07-27 18:46 UTC (permalink / raw)
  To: Russell King
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, dwalker,
	Abhijeet Dharmapurikar, Jeff Ohlstein

From: Abhijeet Dharmapurikar <adharmap@codeaurora.org>

Unless gic_ack_irq is called from __do_IRQ, interrupt should not
be disabled in the ack function.

Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
---
 arch/arm/common/gic.c |   15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 337741f..9bc6d88 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -67,25 +67,10 @@ 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);
-	writel(mask, gic_dist_base(irq) + GIC_DIST_ENABLE_CLEAR + (gic_irq(irq) / 32) * 4);
 	writel(gic_irq(irq), gic_cpu_base(irq) + GIC_CPU_EOI);
 	spin_unlock(&irq_controller_lock);
 }
-- 
1.7.1.1

Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-27 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-22 22:57 [PATCH] GIC: Dont disable INT in ack callback Jeff Ohlstein
2010-07-24 10:30 ` Rabin Vincent
2010-07-27 18:46   ` [PATCH v2] " Jeff Ohlstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).