Skip to contentSkip to conversation

Subject: [tip:irq/genirq] genirq: assert that irq handlers are indeed running in hardirq context

DISCUSSION David Brownell 1 participant 1 message Apr 27, 2009

lore
Share & tools
lore
#0 lore raw
Quoted 8 lines

Commit-ID: 044d408409cc4e1bc75c886e27ca85c270db104c
Gitweb:
http://git.kernel.org/tip/044d408409cc4e1bc75c886e27ca85c270db104c Author:
Peter Zijlstra <[email protected]>

AuthorDate: Mon, 2 Mar 2009 16:13:32 +0100
Commit:     Ingo Molnar <[email protected]>
CommitDate: Tue, 3 Mar 2009 00:05:45 +0100
Quoted 5 lines

genirq: assert that irq handlers are indeed running in hardirq context

Make sure the genirq layer handlers are indeed running handlers in hardirq context. That is the genirq expectation and doing anything else is broken.

Actually, it's more like Peter Zijlstra's expectation. Genirq works perfectly well without this.

And ... this causes regressions, so I suggest it get reverted ASAP.

http://marc.info/?l=linux-kernel&m=124082644212584&w=2

Quoted 16 lines

LKML-Reference: <1236006812.5330.632.camel@laptop>

---
 kernel/irq/handle.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
kernel/irq/handle.c +0 -0
index 3aba8d1..a2ee682 100644

kernel/irq/handle.c irqreturn_t handle_IRQ_event(unsigned int irq, struct · line 331

Quoted 4 lines
kernel/irq/handle.c +1 -0
@@ -328,6 +328,8 @@ irqreturn_t handle_IRQ_event(unsigned int irq, struct
 irqaction *action) irqreturn_t ret, retval = IRQ_NONE;
 	unsigned int status = 0;
 
+	WARN_ONCE(!in_irq(), "BUG: IRQ handler called from non-hardirq context!");

Notice also: clearly untested. No newline on the message.

Quoted 3 lines
kernel/irq/handle.c +1 -0
+ 
 	if (!(action->flags & IRQF_DISABLED))
 		local_irq_enable_in_hardirq();