[rt2x00-users] [PATCH 3.3 v2] rt2x00: fix random stalls

Johannes Berg johannes at sipsolutions.net
Fri Mar 9 19:33:07 EST 2012


On Fri, 2012-03-09 at 09:22 +0100, Stanislaw Gruszka wrote:

> > > +	spin_lock(&queue->tx_lock);
> > >  	rt2x00queue_pause_queue(queue);
> > > +	spin_unlock(&queue->tx_lock);
> > >   exit_free_skb:
> > >  	ieee80211_free_txskb(hw, skb);
> > >  }
> > 
> > I'm sorry, but I'm still not convinced that we can use spin_lock_bh in
> > one place of the code and then spin_lock in another place of the code,
> > using the *same* spinlock.
> > I always use the cheat sheet shown in:
> > http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/c214.html
> > 
> > which to me shows that by definition we should be using spin_lock_bh in
> > all cases now, the new ones and the existing cases where we lock tx_lock.
> 
> We have bh disabled here since ieee80211_xmit is always called with bh
> disabled (early on dev_queue_xmit() or in ieee80211_tx_skb_tid()). I can
> add comment about that.

And in fact if you were to use spin_unlock_bh() in that kind of context
it would be a bug :-)

johannes




More information about the users mailing list