linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Felix Fietkau <nbd@openwrt.org>
Cc: linux-wireless@vger.kernel.org, mcgrof@qca.qualcomm.com
Subject: Re: [PATCH 5/6] ath9k: simplify tx locking
Date: Tue, 13 Dec 2011 15:47:17 -0500	[thread overview]
Message-ID: <20111213204717.GD2613@tuxdriver.com> (raw)
In-Reply-To: <1323720386-46132-5-git-send-email-nbd@openwrt.org>

On Mon, Dec 12, 2011 at 09:06:25PM +0100, Felix Fietkau wrote:
> Instead of releasing and taking back the lock over and over again in the
> tx path, hold the lock a bit longer, requiring much fewer lock/unlock pairs.
> This makes locking much easier to review and should not have any noticeable
> performance/latency impact.
> 
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>

> @@ -2259,6 +2230,7 @@ void ath_tx_edma_tasklet(struct ath_softc *sc)
>  	struct list_head bf_head;
>  	int status;
>  
> +	spin_lock_bh(&txq->axq_lock);
>  	for (;;) {
>  		if (work_pending(&sc->hw_reset_work))
>  			break;

Pretty sure this is wrong -- gcc seems to agree:

  CC [M]  drivers/net/wireless/ath/ath9k/xmit.o
drivers/net/wireless/ath/ath9k/xmit.c: In function ‘ath_tx_edma_tasklet’:
drivers/net/wireless/ath/ath9k/xmit.c:2249:18: warning: ‘txq’ may be used uninitialized in this function

> @@ -2278,12 +2250,8 @@ void ath_tx_edma_tasklet(struct ath_softc *sc)
>  
>  		txq = &sc->tx.txq[ts.qid];
>  
> -		spin_lock_bh(&txq->axq_lock);
> -
> -		if (list_empty(&txq->txq_fifo[txq->txq_tailidx])) {
> -			spin_unlock_bh(&txq->axq_lock);
> -			return;
> -		}
> +		if (list_empty(&txq->txq_fifo[txq->txq_tailidx]))
> +			break;
>  
>  		bf = list_first_entry(&txq->txq_fifo[txq->txq_tailidx],
>  				      struct ath_buf, list);

Looks like txq doesn't get initialized until this loop?

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

      parent reply	other threads:[~2011-12-13 21:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12 20:06 [PATCH 1/6] ath9k: change maximum software retransmission handling Felix Fietkau
2011-12-12 20:06 ` [PATCH 2/6] ath9k: reduce the number of unnecessary BAR tx packets Felix Fietkau
2011-12-12 20:06   ` [PATCH 3/6] ath9k: reduce indentation level in a few places Felix Fietkau
2011-12-12 20:06     ` [PATCH 4/6] ath9k: remove bogus sequence number increment Felix Fietkau
2011-12-12 20:06       ` [PATCH 5/6] ath9k: simplify tx locking Felix Fietkau
2011-12-12 20:06         ` [PATCH 6/6] ath9k: avoid retransmitting aggregation frames that a BAR was sent for Felix Fietkau
2011-12-13 20:47         ` John W. Linville [this message]

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=20111213204717.GD2613@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@qca.qualcomm.com \
    --cc=nbd@openwrt.org \
    /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).