linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com
Subject: Re: [rt2x00-users] [PATCH 3.3 v2] rt2x00: fix random stalls
Date: Fri, 9 Mar 2012 09:22:16 +0100	[thread overview]
Message-ID: <20120309082216.GA2339@redhat.com> (raw)
In-Reply-To: <4F59275B.2010309@gmail.com>

Hi Gertjan

On Thu, Mar 08, 2012 at 10:40:43PM +0100, Gertjan van Wingerde wrote:
> > @@ -152,13 +152,20 @@ void rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
> >  	if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false)))
> >  		goto exit_fail;
> >  
> > +	/*
> > +	 * Pausing queue has to be serialized with rt2x00lib_txdone() .
> > +	 */
> > +	spin_lock(&queue->tx_lock);
> >  	if (rt2x00queue_threshold(queue))
> >  		rt2x00queue_pause_queue(queue);
> > +	spin_unlock(&queue->tx_lock);
> >  
> >  	return;
> >  
> >   exit_fail:
> > +	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.

Additionally I ran patch with CONFIG_LOCKDEP which is capable to detect
locking context errors and no warning was printed.

Thanks
Stanislaw

  reply	other threads:[~2012-03-09  8:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 18:31 [PATCH 3.3 v2] rt2x00: fix random stalls Stanislaw Gruszka
2012-03-08 21:40 ` [rt2x00-users] " Gertjan van Wingerde
2012-03-09  8:22   ` Stanislaw Gruszka [this message]
2012-03-09  8:33     ` Johannes Berg
2012-03-09  9:46       ` Gertjan van Wingerde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120309082216.GA2339@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=gwingerde@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).