Re: [PATCH/RFC] remove irqs_disabled warning from local_bh_enable

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Johannes Berg <johannes@...>
Cc: Linux Kernel list <linux-kernel@...>, Michael Buesch <mb@...>, David Ellingsworth <david@...>, linux-wireless <linux-wireless@...>, Ingo Molnar <mingo@...>
Date: Tuesday, June 17, 2008 - 7:55 pm

On Tue, 17 Jun 2008, Johannes Berg wrote:

Yes, it's a bug.

Why? Not because of the "spin_lock_bh()" itself, but because of the 
_unlock_, which does a "local_bh_enable_ip()", which in turn will check 
the whole "do_softirq()" if it was the last softirq_count.

And you must not do softirq's when hard-irq's were disabled!

So it should in theory be ok (but perhaps a bit odd) to do something like

	spin_lock_irq(&irq_lock);
	..do something..
	spin_lock_bh(&bh_lock);
	spin_unlock_irq(&irq_lock);
	.. do something else ..
	spin_unlock_bh(&bh_lock);

where the "spin_lock_bh()" itself is in an irq-locked context - as long as 
the "spin_unlock_bh()" is *not*.

See?

		Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH/RFC] remove irqs_disabled warning from local_bh_e..., Linus Torvalds, (Tue Jun 17, 7:55 pm)