[patch 07/75] genirq: Warn when handler enables interrupts

From: Thomas Gleixner
Date: Thu Feb 10 2011 - 18:36:27 EST


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@xxxxxxxxxxxxx>
---
kernel/irq/handle.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-2.6-tip/kernel/irq/handle.c
===================================================================
--- linux-2.6-tip.orig/kernel/irq/handle.c
+++ linux-2.6-tip/kernel/irq/handle.c
@@ -68,6 +68,9 @@ irqreturn_t handle_IRQ_event(unsigned in
ret = action->handler(irq, action->dev_id);
trace_irq_handler_exit(irq, action, ret);

+ if (WARN_ON_ONCE(!irqs_disabled()))
+ local_irq_disable();
+
switch (ret) {
case IRQ_WAKE_THREAD:
/*
@@ -114,7 +117,6 @@ irqreturn_t handle_IRQ_event(unsigned in

if (status & IRQF_SAMPLE_RANDOM)
add_interrupt_randomness(irq);
- local_irq_disable();

return retval;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/