Skip to content

Commit

Permalink
genirq: Prevent irq storm on migration
Browse files Browse the repository at this point in the history
move_native_irq() masks and unmasks the interrupt line
unconditionally, but the interrupt line might be masked due to a
threaded oneshot handler in progress. Unmasking the line in that case
can lead to interrupt storms. Observed on PREEMPT_RT.

Originally-from: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@kernel.org
  • Loading branch information
Thomas Gleixner committed Feb 2, 2011
1 parent afe8a88 commit f1a0639
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions kernel/irq/migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,23 @@ void move_masked_irq(int irq)
void move_native_irq(int irq)
{
struct irq_desc *desc = irq_to_desc(irq);
bool masked;

if (likely(!(desc->status & IRQ_MOVE_PENDING)))
return;

if (unlikely(desc->status & IRQ_DISABLED))
return;

desc->irq_data.chip->irq_mask(&desc->irq_data);
/*
* Be careful vs. already masked interrupts. If this is a
* threaded interrupt with ONESHOT set, we can end up with an
* interrupt storm.
*/
masked = desc->status & IRQ_MASKED;
if (!masked)
desc->irq_data.chip->irq_mask(&desc->irq_data);
move_masked_irq(irq);
desc->irq_data.chip->irq_unmask(&desc->irq_data);
if (!masked)
desc->irq_data.chip->irq_unmask(&desc->irq_data);
}

0 comments on commit f1a0639

Please sign in to comment.