Skip to contentSkip to conversation

local_bh_enable() is safe for irqs_disabled()

PATCH/RFC -rt Kevin Hilman 1 participant 1 message Dec 8, 2007

lore
Share & tools
lore
#0 lore raw

In local_bh_enable() there is a WARN_ON(irqs_disabled()), but looking at the rest of the code, it seems it expects to be used with interrupts off, so is this warning really necessary?

I hit this warning in the ads7846 touchscreen driver timer function where enable_irq() may be called with interrupts disabled. Since enable_irq now calls local_bh_disable/enable for IRQ resend, this warning is triggered.

Patch against 2.6.23.9-rt12

kernel/softirq.c +0 -1
index 4c19017..68149ae 100644
@@ -207,7 +207,6 @@ void local_bh_enable(void)
 
 	WARN_ON_ONCE(in_irq());
 #endif
-	WARN_ON_ONCE(irqs_disabled());
 
 #ifdef CONFIG_TRACE_IRQFLAGS
 	local_irq_save(flags);