Skip to content

Commit d05c65f

Browse files
committed
genirq: spurious: Run only one poller at a time
No point in running concurrent pollers which confuse each other by setting PENDING. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent c7259cd commit d05c65f

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎kernel/irq/spurious.c‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ static int irqfixup __read_mostly;
2121
#define POLL_SPURIOUS_IRQ_INTERVAL (HZ/10)
2222
static void poll_spurious_irqs(unsigned long dummy);
2323
static DEFINE_TIMER(poll_spurious_irq_timer, poll_spurious_irqs, 0, 0);
24+
static int irq_poll_cpu;
25+
static atomic_t irq_poll_active;
2426

2527
/*
2628
* Recovery handler for misrouted interrupts.
@@ -92,6 +94,11 @@ static int misrouted_irq(int irq)
9294
struct irq_desc *desc;
9395
int i, ok = 0;
9496

97+
if (atomic_inc_return(&irq_poll_active) == 1)
98+
goto out;
99+
100+
irq_poll_cpu = smp_processor_id();
101+
95102
for_each_irq_desc(i, desc) {
96103
if (!i)
97104
continue;
@@ -102,6 +109,8 @@ static int misrouted_irq(int irq)
102109
if (try_one_irq(i, desc, false))
103110
ok = 1;
104111
}
112+
out:
113+
atomic_dec(&irq_poll_active);
105114
/* So the caller can adjust the irq error counts */
106115
return ok;
107116
}
@@ -111,6 +120,10 @@ static void poll_spurious_irqs(unsigned long dummy)
111120
struct irq_desc *desc;
112121
int i;
113122

123+
if (atomic_inc_return(&irq_poll_active) != 1)
124+
goto out;
125+
irq_poll_cpu = smp_processor_id();
126+
114127
for_each_irq_desc(i, desc) {
115128
unsigned int status;
116129

@@ -127,7 +140,8 @@ static void poll_spurious_irqs(unsigned long dummy)
127140
try_one_irq(i, desc, true);
128141
local_irq_enable();
129142
}
130-
143+
out:
144+
atomic_dec(&irq_poll_active);
131145
mod_timer(&poll_spurious_irq_timer,
132146
jiffies + POLL_SPURIOUS_IRQ_INTERVAL);
133147
}

0 commit comments

Comments
 (0)