[PATCH/RFC] remove irqs_disabled warning from local_bh_enable



This warning has started to trigger with mac80211 because it can, under
some circumstances, use spin_lock_bh() protected sections within
irq-disabled sections. Is that a bug?

Interestingly, the warning was never noticed until somebody ran the code
on UP/NO-PREEMPT because local_bh_enable_ip() does not contain such a
warning. Also, because softirq disabling is refcounted (via the preempt
counter), it ought to be safe to nest it and even use within
irqs-disabled sections, as far as I can tell.

Also, if you're going to treat IRQs being enabled as a bug, there's no
point in disabling them right afterwards, is there?

If you're going to reject this patch, I'll post one that adds the
warning to local_bh_enable_ip() to allow detecting this for everybody
and not just those poor people running UP/NO-PREEMPT :)

(and why doesn't local_bh_enable just call local_bh_enable_ip anyway? or
both "call" a common static inline?)
---
kernel/softirq.c | 3 ---
1 file changed, 3 deletions(-)

--- everything.orig/kernel/softirq.c 2008-06-17 23:48:25.000000000 +0200
+++ everything/kernel/softirq.c 2008-06-17 23:48:56.000000000 +0200
@@ -137,10 +137,7 @@ void local_bh_enable(void)
unsigned long flags;

WARN_ON_ONCE(in_irq());
-#endif
- WARN_ON_ONCE(irqs_disabled());

-#ifdef CONFIG_TRACE_IRQFLAGS
local_irq_save(flags);
#endif
/*


--
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/



Relevant Pages

  • Re: A critique of cgi.escape
    ... considered a bug. ... It isn't like there have never been backwards _in_compatible changes to ... unit tests which include specific tests for that behaviour, ... it doesn't need to be fixed *immediately* without warning; ...
    (comp.lang.python)
  • Re: Beta anti spyware
    ... The irony here is that I've installed the beta on three computers here. ... I've had only one 'bug' that wasn't the fault of the application. ... As I read in here, I don't post often, I find complaints and that's about ... The warning is clearly there in the ...
    (microsoft.public.security)
  • Re: cciss: WARNING/BUG in do_cciss_intr (its back)
    ... Subject: cciss: WARNING/BUG in do_cciss_intr ... I think this is a different bug than the one you reported previously. ... The first warning that now triggers is: ... still using kexec for loading/testing the new kernel. ...
    (Linux-Kernel)
  • Warning: Possible Bug in BIOS DELL Latitude D400_A06 !
    ... Serious Warning - Possible Bug in BIOS update! ... that during both flashing operations no error or ... with DELL that the flashing operation had not been possible from XP. ...
    (Debian-User)
  • Re: cciss: WARNING/BUG in do_cciss_intr (its back)
    ... Subject: cciss: WARNING/BUG in do_cciss_intr ... I think this is a different bug than the one you reported previously. ... The first warning that now triggers is: ... PCI Interrupt Link enabled at IRQ 54 cciss ...
    (Linux-Kernel)