Thread (51 messages) flat view 51 messages, 3 authors, 2011-05-19

Re: [PATCH 30/37] powerpc: mpc62xx_pic: fix get_irq handling of NO_IRQ

From: Grant Likely <hidden>
Date: 2011-05-11 19:08:40

On Wed, May 11, 2011 at 7:30 AM, Milton Miller [off-list ref] wrote:
If none of irq category bits were set mpc52xx_get_irq() would pass
NO_IRQ_IGNORE (-1) to irq_linear_revmap, which does an unsigned compare
and declares the interrupt above the linear map range. =A0It then punts
to irq_find_mapping, which performs a linear search of all irqs,
which will likely miss and only then return NO_IRQ.

If no status bit is set, then we should return NO_IRQ directly.
The interrupt should not be suppressed from spurious counting, in fact
that is the definition of supurious.

Signed-off-by: Milton Miller <redacted>
Acked-by: Grant Likely <redacted>
quoted hunk ↗ jump to hunk
---
---
=A0arch/powerpc/platforms/52xx/mpc52xx_pic.c | =A0 =A04 +++-
=A01 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/pla=
tforms/52xx/mpc52xx_pic.c
quoted hunk ↗ jump to hunk
index bb61181..1a9a495 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -486,7 +486,7 @@ void __init mpc52xx_init_irq(void)
=A0unsigned int mpc52xx_get_irq(void)
=A0{
=A0 =A0 =A0 =A0u32 status;
- =A0 =A0 =A0 int irq =3D NO_IRQ_IGNORE;
+ =A0 =A0 =A0 int irq;

=A0 =A0 =A0 =A0status =3D in_be32(&intr->enc_status);
=A0 =A0 =A0 =A0if (status & 0x00000400) { =A0 =A0 =A0/* critical */
@@ -509,6 +509,8 @@ unsigned int mpc52xx_get_irq(void)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} else {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0irq |=3D (MPC52xx_IRQ_L1_P=
ERP << MPC52xx_IRQ_L1_OFFSET);
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0}
+ =A0 =A0 =A0 } else {
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 return NO_IRQ;
=A0 =A0 =A0 =A0}

=A0 =A0 =A0 =A0return irq_linear_revmap(mpc52xx_irqhost, irq);
--
1.7.0.4


--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help