All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP3: ack spurious IRQs in get_irqnr_and_base
@ 2008-10-15 11:51 Lauri Leukkunen
  2008-10-17  8:30 ` Paul Walmsley
  0 siblings, 1 reply; 4+ messages in thread
From: Lauri Leukkunen @ 2008-10-15 11:51 UTC (permalink / raw)
  To: linux-omap

This prevents spurious interrupts from repeating unacked and
thus locking the system, while still allowing the spurious
bad irq error message to be show on console.

Signed-off-by: Lauri Leukkunen <lauri.leukkunen@nokia.com>
---
 arch/arm/plat-omap/include/mach/entry-macro.S |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/include/mach/entry-macro.S b/arch/arm/plat-omap/include/mach/entry-macro.S
index a8fca9d..c88a4cb 100644
--- a/arch/arm/plat-omap/include/mach/entry-macro.S
+++ b/arch/arm/plat-omap/include/mach/entry-macro.S
@@ -87,7 +87,26 @@
 		ldr	\irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
 		cmp	\irqnr, #0x0
 2222:
-		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
+#if defined(CONFIG_ARCH_OMAP34XX)
+		mov	\tmp, \irqnr
+#endif
+ 		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
+#if defined(CONFIG_ARCH_OMAP34XX)
+		mov	\irqstat, \irqnr
+		bic	\irqstat, \irqstat, #0x7f /* check for spurious flag */
+		cmp	\irqstat, #0x0
+		beq	2223f
+		mov	\irqstat, #0x1 /* Ack the spurious irq, this lets it
+					* generate a bad irq error message,
+					* but prevents infinitely repeating
+					* irq.
+					*/
+		str	\irqstat, [\base, #0x48] /* INTC_CONTROL register */
+2223:
+		cmp	\tmp, #0x0 /* set conditional back to what it was
+				    * before spurious test
+				    */
+#endif
 
 		.endm
 
-- 
1.5.6.5


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

* Re: [PATCH] OMAP3: ack spurious IRQs in get_irqnr_and_base
  2008-10-15 11:51 [PATCH] OMAP3: ack spurious IRQs in get_irqnr_and_base Lauri Leukkunen
@ 2008-10-17  8:30 ` Paul Walmsley
  2008-10-17 21:17   ` Paul Walmsley
  2008-10-17 21:19   ` Tony Lindgren
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Walmsley @ 2008-10-17  8:30 UTC (permalink / raw)
  To: Lauri Leukkunen; +Cc: linux-omap, tony

Hi Lauri,

I think we should merge your patch along with the SO patch also, so in the 
event of a spurious interrupt, it won't wedge the whole system.   One 
question though:

On Wed, 15 Oct 2008, Lauri Leukkunen wrote:

> This prevents spurious interrupts from repeating unacked and
> thus locking the system, while still allowing the spurious
> bad irq error message to be show on console.
> 
> Signed-off-by: Lauri Leukkunen <lauri.leukkunen@nokia.com>
> ---
>  arch/arm/plat-omap/include/mach/entry-macro.S |   21 ++++++++++++++++++++-
>  1 files changed, 20 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/include/mach/entry-macro.S b/arch/arm/plat-omap/include/mach/entry-macro.S
> index a8fca9d..c88a4cb 100644
> --- a/arch/arm/plat-omap/include/mach/entry-macro.S
> +++ b/arch/arm/plat-omap/include/mach/entry-macro.S
> @@ -87,7 +87,26 @@
>  		ldr	\irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
>  		cmp	\irqnr, #0x0
>  2222:
> -		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
> +#if defined(CONFIG_ARCH_OMAP34XX)
> +		mov	\tmp, \irqnr
> +#endif
> + 		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
> +#if defined(CONFIG_ARCH_OMAP34XX)
> +		mov	\irqstat, \irqnr
> +		bic	\irqstat, \irqstat, #0x7f /* check for spurious flag */

According to Table 10-14 in the TRM, the spurious flag field is 25 bits 
wide, but the patch only checks for 7 bits.  This should probably be 
extended?

> +		cmp	\irqstat, #0x0
> +		beq	2223f
> +		mov	\irqstat, #0x1 /* Ack the spurious irq, this lets it
> +					* generate a bad irq error message,
> +					* but prevents infinitely repeating
> +					* irq.
> +					*/
> +		str	\irqstat, [\base, #0x48] /* INTC_CONTROL register */
> +2223:
> +		cmp	\tmp, #0x0 /* set conditional back to what it was
> +				    * before spurious test
> +				    */
> +#endif
>  
>  		.endm
>  

- Paul

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

* Re: [PATCH] OMAP3: ack spurious IRQs in get_irqnr_and_base
  2008-10-17  8:30 ` Paul Walmsley
@ 2008-10-17 21:17   ` Paul Walmsley
  2008-10-17 21:19   ` Tony Lindgren
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Walmsley @ 2008-10-17 21:17 UTC (permalink / raw)
  To: Lauri Leukkunen; +Cc: linux-omap, tony

On Fri, 17 Oct 2008, Paul Walmsley wrote:

> > + 		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
> > +#if defined(CONFIG_ARCH_OMAP34XX)
> > +		mov	\irqstat, \irqnr
> > +		bic	\irqstat, \irqstat, #0x7f /* check for spurious flag */
> 
> According to Table 10-14 in the TRM, the spurious flag field is 25 bits 
> wide, but the patch only checks for 7 bits.  This should probably be 
> extended?

eh never mind -- misread the insn.  


- Paul

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

* Re: [PATCH] OMAP3: ack spurious IRQs in get_irqnr_and_base
  2008-10-17  8:30 ` Paul Walmsley
  2008-10-17 21:17   ` Paul Walmsley
@ 2008-10-17 21:19   ` Tony Lindgren
  1 sibling, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2008-10-17 21:19 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Lauri Leukkunen, linux-omap

* Paul Walmsley <paul@pwsan.com> [081017 01:30]:
> Hi Lauri,
> 
> I think we should merge your patch along with the SO patch also, so in the 
> event of a spurious interrupt, it won't wedge the whole system.   One 
> question though:
> 
> On Wed, 15 Oct 2008, Lauri Leukkunen wrote:
> 
> > This prevents spurious interrupts from repeating unacked and
> > thus locking the system, while still allowing the spurious
> > bad irq error message to be show on console.
> > 
> > Signed-off-by: Lauri Leukkunen <lauri.leukkunen@nokia.com>
> > ---
> >  arch/arm/plat-omap/include/mach/entry-macro.S |   21 ++++++++++++++++++++-
> >  1 files changed, 20 insertions(+), 1 deletions(-)
> > 
> > diff --git a/arch/arm/plat-omap/include/mach/entry-macro.S b/arch/arm/plat-omap/include/mach/entry-macro.S
> > index a8fca9d..c88a4cb 100644
> > --- a/arch/arm/plat-omap/include/mach/entry-macro.S
> > +++ b/arch/arm/plat-omap/include/mach/entry-macro.S
> > @@ -87,7 +87,26 @@
> >  		ldr	\irqnr, [\base, #0xd8] /* IRQ pending reg 3 */
> >  		cmp	\irqnr, #0x0
> >  2222:
> > -		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
> > +#if defined(CONFIG_ARCH_OMAP34XX)
> > +		mov	\tmp, \irqnr
> > +#endif
> > + 		ldrne	\irqnr, [\base, #INTCPS_SIR_IRQ_OFFSET]
> > +#if defined(CONFIG_ARCH_OMAP34XX)
> > +		mov	\irqstat, \irqnr
> > +		bic	\irqstat, \irqstat, #0x7f /* check for spurious flag */
> 
> According to Table 10-14 in the TRM, the spurious flag field is 25 bits 
> wide, but the patch only checks for 7 bits.  This should probably be 
> extended?

That's OK, as the bic clears the non-spurious bits, so pushing.

Tony



> 
> > +		cmp	\irqstat, #0x0
> > +		beq	2223f
> > +		mov	\irqstat, #0x1 /* Ack the spurious irq, this lets it
> > +					* generate a bad irq error message,
> > +					* but prevents infinitely repeating
> > +					* irq.
> > +					*/
> > +		str	\irqstat, [\base, #0x48] /* INTC_CONTROL register */
> > +2223:
> > +		cmp	\tmp, #0x0 /* set conditional back to what it was
> > +				    * before spurious test
> > +				    */
> > +#endif
> >  
> >  		.endm
> >  
> 
> - Paul

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

end of thread, other threads:[~2008-10-17 21:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-15 11:51 [PATCH] OMAP3: ack spurious IRQs in get_irqnr_and_base Lauri Leukkunen
2008-10-17  8:30 ` Paul Walmsley
2008-10-17 21:17   ` Paul Walmsley
2008-10-17 21:19   ` Tony Lindgren

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.