blob: f9749fef5c0ef124b16ba7756da94289fe7adc8c [file] [log] [blame]
From 708edcc15e55003da67d61157a905b9373f0772c Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Fri, 3 Jul 2009 08:29:27 -0500
Subject: [PATCH] genirq: prevent interrupt storm on irq migration
commit b87daa2884f9b0196621013731b2be2f736c962e in tip.
Migration maks/unmaks interrupts unconditionally. With forced irq
threading thats going to result in an interrupt storm when the
threaded handler has not finished yet.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c
index 2419622..4817563 100644
--- a/kernel/irq/migration.c
+++ b/kernel/irq/migration.c
@@ -54,6 +54,7 @@ void move_masked_irq(int irq)
void move_native_irq(int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
+ int mask = 1;
if (likely(!(desc->status & IRQ_MOVE_PENDING)))
return;
@@ -61,8 +62,17 @@ void move_native_irq(int irq)
if (unlikely(desc->status & IRQ_DISABLED))
return;
- desc->chip->mask(irq);
+ /*
+ * If the irq is already in progress, it should be masked.
+ * If we unmask it, we might cause an interrupt storm on RT.
+ */
+ if (unlikely(desc->status & IRQ_INPROGRESS))
+ mask = 0;
+
+ if (mask)
+ desc->chip->mask(irq);
move_masked_irq(irq);
- desc->chip->unmask(irq);
+ if (mask)
+ desc->chip->unmask(irq);
}
--
1.7.1.1