Skip to contentSkip to conversation

genirq: spurious.c: fix regression that broke irqfixup,irqpoll

PATCH In review [email protected] 3 participants 3 messages Nov 1, 2011 – Nov 3, 2011 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 genirq: spurious.c: fix regression that broke irqfixup,irqpoll

From: Edward Donovan <[email protected]>

commit d05c65fff0 ("genirq: spurious: Run only one poller at a time") introduced a regression, leaving the boot options 'irqfixup' and 'irqpoll' non-functional. The patch placed tests in each function, to exit if the function is already running. The test in 'misrouted_irq' exited when it should have proceeded, effectively disabling 'misrouted_irq' and 'poll_spurious_irqs'. Reversing the "==" operator to "!=" fixes the regression.

---
 kernel/irq/spurious.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/irq/spurious.c +1 -1
index aa57d5d..b5f4742 100644
@@ -115,7 +115,7 @@ static int misrouted_irq(int irq)
 	struct irq_desc *desc;
 	int i, ok = 0;
 
-	if (atomic_inc_return(&irq_poll_active) == 1)
+	if (atomic_inc_return(&irq_poll_active) != 1)
 		goto out;
 
 	irq_poll_cpu = smp_processor_id();
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 11 lines · On Tue, 1 Nov 2011, [email protected] wrote:

From: Edward Donovan <[email protected]>

commit d05c65fff0 ("genirq: spurious: Run only one poller at a time") introduced a regression, leaving the boot options 'irqfixup' and 'irqpoll' non-functional. The patch placed tests in each function, to exit if the function is already running. The test in 'misrouted_irq' exited when it should have proceeded, effectively disabling 'misrouted_irq' and 'poll_spurious_irqs'. Reversing the "==" operator to "!=" fixes the regression.

Good catch! I was staring at it with my conference and flu damaged brain ....

Thanks,

tglx

Quoted 21 lines
---
 kernel/irq/spurious.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/irq/spurious.c +1 -1
index aa57d5d..b5f4742 100644
@@ -115,7 +115,7 @@ static int misrouted_irq(int irq)
 	struct irq_desc *desc;
 	int i, ok = 0;
 
-	if (atomic_inc_return(&irq_poll_active) == 1)
+	if (atomic_inc_return(&irq_poll_active) != 1)
 		goto out;
 
 	irq_poll_cpu = smp_processor_id();
Signature · 1 line
1.7.5.4
#2 lore raw
Quoted 4 lines · Thomas Gleixner

Good catch! I was staring at it with my conference and flu damaged brain ....

Thanks, Thomas. It had me running around for quite a while before I caught it. :)

I hoped this had nailed the failure of irqfixup/poll, since the .39 merge window. But I have one machine where this fix doesn't help. (With this patch, 2.6.39+ went from never handling that bad irq, to handling it in a fraction of bootups. I have to dig into that more.)

On my Ubuntu bug report I have asked the other reporters for testing, but haven't heard yet.

It may be back to the bisecting board for me, and I'll post again if I learn anything.

Ed