diff mbox

ARM: OMAP2+: INTC: Acknowledge stuck active interrupts

Message ID 1394119635-24194-1-git-send-email-stefan.sorensen@spectralink.com (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Sørensen March 6, 2014, 3:27 p.m. UTC
When an interrupt has become active on the INTC it will stay active
until it is acked, even if masked or de-asserted. The
INTC_PENDING_IRQn registers are however updated and since these are
used by omap_intc_handle_irq to determine which interrupt to handle,
it will never see the active interrupt. This will result in a storm of
useless interrupts that is only stopped when another higher priority
interrupt is asserted.

Fix by sending the INTC an acknowledge if we find no interrupts to
handle.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
---
 arch/arm/mach-omap2/irq.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Tony Lindgren March 6, 2014, 6:32 p.m. UTC | #1
* Stefan Sørensen <stefan.sorensen@spectralink.com> [140306 07:30]:
> When an interrupt has become active on the INTC it will stay active
> until it is acked, even if masked or de-asserted. The
> INTC_PENDING_IRQn registers are however updated and since these are
> used by omap_intc_handle_irq to determine which interrupt to handle,
> it will never see the active interrupt. This will result in a storm of
> useless interrupts that is only stopped when another higher priority
> interrupt is asserted.
> 
> Fix by sending the INTC an acknowledge if we find no interrupts to
> handle.

OK this makes more sense to me.

While playing with this, you may want to also do one more test and
forward port these two patches adding checks for spurious interrupts:

6ccc4c0d ARM: OMAP3: Warn about spurious interrupts
846c29f1 ARM: OMAP3: Clean up spurious interrupt check logic

Those got removed in commit:

667a11fa arm: omap2/3: Use generic irq chip

If you get warnings with those checks about spurious interrupts there's
also something else wrong or we're not understanding the problem fully.
So it might be good to check before we apply this patch.

Regards,

Tony
 
> Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
> ---
>  arch/arm/mach-omap2/irq.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
> index e022a86..6037a9a 100644
> --- a/arch/arm/mach-omap2/irq.c
> +++ b/arch/arm/mach-omap2/irq.c
> @@ -222,6 +222,7 @@ void __init ti81xx_init_irq(void)
>  static inline void omap_intc_handle_irq(void __iomem *base_addr, struct pt_regs *regs)
>  {
>  	u32 irqnr;
> +	int handled_irq = 0;
>  
>  	do {
>  		irqnr = readl_relaxed(base_addr + 0x98);
> @@ -249,8 +250,15 @@ out:
>  		if (irqnr) {
>  			irqnr = irq_find_mapping(domain, irqnr);
>  			handle_IRQ(irqnr, regs);
> +			handled_irq = 1;
>  		}
>  	} while (irqnr);
> +
> +	/* If an irq is masked or deasserted while active, we will
> +	 * keep ending up here with no irq handled. So remove it from
> +	 * the INTC with an ack.*/
> +	if (!handled_irq)
> +		omap_ack_irq(NULL);
>  }
>  
>  asmlinkage void __exception_irq_entry omap2_intc_handle_irq(struct pt_regs *regs)
> -- 
> 1.8.5.3
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stefan Sørensen March 7, 2014, 12:41 p.m. UTC | #2
On Thu, 2014-03-06 at 10:32 -0800, Tony Lindgren wrote:
> While playing with this, you may want to also do one more test and

> forward port these two patches adding checks for spurious interrupts:

> 

> 6ccc4c0d ARM: OMAP3: Warn about spurious interrupts

> 846c29f1 ARM: OMAP3: Clean up spurious interrupt check logic

> 

> Those got removed in commit:

> 

> 667a11fa arm: omap2/3: Use generic irq chip

> 

> If you get warnings with those checks about spurious interrupts there's

> also something else wrong or we're not understanding the problem fully.

> So it might be good to check before we apply this patch.


No warnings with those patches. I also tried watching the spuriousirq
field in various places - nothing showed up.

Stefan
Tony Lindgren March 7, 2014, 4:06 p.m. UTC | #3
* Sørensen, Stefan <Stefan.Sorensen@spectralink.com> [140307 04:44]:
> On Thu, 2014-03-06 at 10:32 -0800, Tony Lindgren wrote:
> > While playing with this, you may want to also do one more test and
> > forward port these two patches adding checks for spurious interrupts:
> > 
> > 6ccc4c0d ARM: OMAP3: Warn about spurious interrupts
> > 846c29f1 ARM: OMAP3: Clean up spurious interrupt check logic
> > 
> > Those got removed in commit:
> > 
> > 667a11fa arm: omap2/3: Use generic irq chip
> > 
> > If you get warnings with those checks about spurious interrupts there's
> > also something else wrong or we're not understanding the problem fully.
> > So it might be good to check before we apply this patch.
> 
> No warnings with those patches. I also tried watching the spuriousirq
> field in various places - nothing showed up.

OK thanks for testing, that's good to hear.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren March 13, 2014, 8:38 p.m. UTC | #4
* Tony Lindgren <tony@atomide.com> [140307 08:09]:
> * Sørensen, Stefan <Stefan.Sorensen@spectralink.com> [140307 04:44]:
> > On Thu, 2014-03-06 at 10:32 -0800, Tony Lindgren wrote:
> > > While playing with this, you may want to also do one more test and
> > > forward port these two patches adding checks for spurious interrupts:
> > > 
> > > 6ccc4c0d ARM: OMAP3: Warn about spurious interrupts
> > > 846c29f1 ARM: OMAP3: Clean up spurious interrupt check logic
> > > 
> > > Those got removed in commit:
> > > 
> > > 667a11fa arm: omap2/3: Use generic irq chip
> > > 
> > > If you get warnings with those checks about spurious interrupts there's
> > > also something else wrong or we're not understanding the problem fully.
> > > So it might be good to check before we apply this patch.
> > 
> > No warnings with those patches. I also tried watching the spuriousirq
> > field in various places - nothing showed up.
> 
> OK thanks for testing, that's good to hear.

Applying your patch into omap-for-v3.15/fixes with cc: stable.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index e022a86..6037a9a 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -222,6 +222,7 @@  void __init ti81xx_init_irq(void)
 static inline void omap_intc_handle_irq(void __iomem *base_addr, struct pt_regs *regs)
 {
 	u32 irqnr;
+	int handled_irq = 0;
 
 	do {
 		irqnr = readl_relaxed(base_addr + 0x98);
@@ -249,8 +250,15 @@  out:
 		if (irqnr) {
 			irqnr = irq_find_mapping(domain, irqnr);
 			handle_IRQ(irqnr, regs);
+			handled_irq = 1;
 		}
 	} while (irqnr);
+
+	/* If an irq is masked or deasserted while active, we will
+	 * keep ending up here with no irq handled. So remove it from
+	 * the INTC with an ack.*/
+	if (!handled_irq)
+		omap_ack_irq(NULL);
 }
 
 asmlinkage void __exception_irq_entry omap2_intc_handle_irq(struct pt_regs *regs)