linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vasanthakumar Thiagarajan <vasanth@atheros.com>
To: Felix Fietkau <nbd@openwrt.org>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linville@tuxdriver.com" <linville@tuxdriver.com>,
	Luis Rodriguez <Luis.Rodriguez@Atheros.com>
Subject: Re: [PATCH 3/4] ath9k: fix the .flush driver op implementation
Date: Thu, 10 Mar 2011 14:55:59 +0530	[thread overview]
Message-ID: <20110310092559.GC28100@vasanth-laptop> (raw)
In-Reply-To: <1299717303-42430-3-git-send-email-nbd@openwrt.org>

On Thu, Mar 10, 2011 at 06:05:02AM +0530, Felix Fietkau wrote:
> ath9k has a timeout of 60ms for the flush, but instead waiting 60 ms for
> all tx activity to finish, it resets it for every single queue.

No, it does not do reset for every queue.

> +	for (j = 0; j < timeout; j++) {
> +		int npend = 0;
> +		for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
> +			if (!ATH_TXQ_SETUP(sc, i))
> +				continue;
>  
> -		if (drop || ath9k_has_pending_frames(sc, txq)) {
> -			ath_dbg(common, ATH_DBG_QUEUE, "Drop frames from hw queue:%d\n",
> -				txq->axq_qnum);
> -			spin_lock_bh(&txq->axq_lock);
> -			txq->txq_flush_inprogress = true;
> -			spin_unlock_bh(&txq->axq_lock);
> -
> -			ath9k_ps_wakeup(sc);
> -			ath9k_hw_stoptxdma(ah, txq->axq_qnum);
> -			npend = ath9k_hw_numtxpending(ah, txq->axq_qnum);
> -			ath9k_ps_restore(sc);
> -			if (npend)
> -				break;
> -
> -			ath_draintxq(sc, txq, false);
> -			txq->txq_flush_inprogress = false;
> +			npend += ath9k_has_pending_frames(sc, &sc->tx.txq[i]);
>  		}
> -	}
>  
> -	if (npend) {
> -		ath_reset(sc, false);
> -		txq->txq_flush_inprogress = false;
> +		if (!npend)
> +		    goto out;
> +
> +		usleep_range(1000, 2000);

Existing flush gives about 60ms for every q, that is reasonable
time, but this 60ms for all the queues is too small. This flush
is also called before sending null func in PS, so reset after
hw queue stuck is necessary to find the hang early on.
The usage of txq_flush_inprogress needs to be removed in other
places in xmit.

Vasanth

  parent reply	other threads:[~2011-03-10  9:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10  0:35 [PATCH 1/4] ath9k_hw: fix REG_SET_BIT and REG_CLR_BIT for multiple bits Felix Fietkau
2011-03-10  0:35 ` [PATCH 2/4] ath9k: fix stopping tx dma on reset Felix Fietkau
2011-03-10  0:35   ` [PATCH 3/4] ath9k: fix the .flush driver op implementation Felix Fietkau
2011-03-10  0:35     ` [PATCH 4/4] ath9k: improve reliability of beacon transmission and stuck beacon handling Felix Fietkau
2011-03-10  9:46       ` Vasanthakumar Thiagarajan
2011-03-10 13:04         ` Felix Fietkau
2011-03-10 13:15           ` Felix Fietkau
2011-03-10  9:25     ` Vasanthakumar Thiagarajan [this message]
2011-03-10 13:03       ` [PATCH 3/4] ath9k: fix the .flush driver op implementation Felix Fietkau
2011-03-10  8:58   ` [PATCH 2/4] ath9k: fix stopping tx dma on reset Vasanthakumar Thiagarajan
2011-03-10  9:32     ` Vasanthakumar Thiagarajan
2011-03-10 12:47     ` Felix Fietkau

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=20110310092559.GC28100@vasanth-laptop \
    --to=vasanth@atheros.com \
    --cc=Luis.Rodriguez@Atheros.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).