Linux wireless drivers development
 help / color / mirror / Atom feed
From: Sujith <Sujith.Manoharan@atheros.com>
To: <linville@tuxdriver.com>
Cc: <linux-wireless@vger.kernel.org>, <Jouni.Malinen@Atheros.com>,
	<Luis.Rodriguez@Atheros.com>
Subject: [PATCH 7/9] ath9k: Handle holding descriptor in TX completion properly
Date: Fri, 16 Jan 2009 21:38:51 +0530	[thread overview]
Message-ID: <18800.45331.603420.153148@gargle.gargle.HOWL> (raw)

If the current holding descriptor is the last one in the TX queue,
*and* it has been marked as STALE, then move it to the free list
and bail out, as it has already been processed.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
---
 drivers/net/wireless/ath9k/xmit.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c
index 841bd9c..d7cec0f 100644
--- a/drivers/net/wireless/ath9k/xmit.c
+++ b/drivers/net/wireless/ath9k/xmit.c
@@ -2082,16 +2082,23 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
 		if (bf->bf_status & ATH_BUFSTATUS_STALE) {
 			bf_held = bf;
 			if (list_is_last(&bf_held->list, &txq->axq_q)) {
-				/* FIXME:
+				txq->axq_link = NULL;
+				txq->axq_linkbuf = NULL;
+				spin_unlock_bh(&txq->axq_lock);
+
+				/*
 				 * The holding descriptor is the last
 				 * descriptor in queue. It's safe to remove
 				 * the last holding descriptor in BH context.
 				 */
-				spin_unlock_bh(&txq->axq_lock);
+				spin_lock_bh(&sc->tx.txbuflock);
+				list_move_tail(&bf_held->list, &sc->tx.txbuf);
+				spin_unlock_bh(&sc->tx.txbuflock);
+
 				break;
 			} else {
 				bf = list_entry(bf_held->list.next,
-					struct ath_buf, list);
+						struct ath_buf, list);
 			}
 		}
 
@@ -2115,24 +2122,20 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
 		 */
 		lastbf->bf_status |= ATH_BUFSTATUS_STALE;
 		INIT_LIST_HEAD(&bf_head);
-
 		if (!list_is_singular(&lastbf->list))
 			list_cut_position(&bf_head,
 				&txq->axq_q, lastbf->list.prev);
 
 		txq->axq_depth--;
-
 		if (bf_isaggr(bf))
 			txq->axq_aggr_depth--;
 
 		txok = (ds->ds_txstat.ts_status == 0);
-
 		spin_unlock_bh(&txq->axq_lock);
 
 		if (bf_held) {
-			list_del(&bf_held->list);
 			spin_lock_bh(&sc->tx.txbuflock);
-			list_add_tail(&bf_held->list, &sc->tx.txbuf);
+			list_move_tail(&bf_held->list, &sc->tx.txbuf);
 			spin_unlock_bh(&sc->tx.txbuflock);
 		}
 
-- 
1.6.0.3


                 reply	other threads:[~2009-01-16 16:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=18800.45331.603420.153148@gargle.gargle.HOWL \
    --to=sujith.manoharan@atheros.com \
    --cc=Jouni.Malinen@Atheros.com \
    --cc=Luis.Rodriguez@Atheros.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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