Commit b738a50a202639614c98b5763b01bf9201779e50
1 parent
1082687e8d
Exists in
master
and in
20 other branches
genirq: Warn when handler enables interrupts
We run all handlers with interrupts disabled and expect them not to enable them. Warn when we catch one who does. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff
kernel/irq/handle.c
... | ... | @@ -68,6 +68,9 @@ |
68 | 68 | ret = action->handler(irq, action->dev_id); |
69 | 69 | trace_irq_handler_exit(irq, action, ret); |
70 | 70 | |
71 | + if (WARN_ON_ONCE(!irqs_disabled())) | |
72 | + local_irq_disable(); | |
73 | + | |
71 | 74 | switch (ret) { |
72 | 75 | case IRQ_WAKE_THREAD: |
73 | 76 | /* |
... | ... | @@ -114,7 +117,6 @@ |
114 | 117 | |
115 | 118 | if (status & IRQF_SAMPLE_RANDOM) |
116 | 119 | add_interrupt_randomness(irq); |
117 | - local_irq_disable(); | |
118 | 120 | |
119 | 121 | return retval; |
120 | 122 | } |