From: Felix Fietkau <nbd@openwrt.org>
To: Mark Mentovai <mark@moxienet.com>
Cc: linux-wireless@vger.kernel.org, linville@tuxdriver.com,
lrodriguez@atheros.com
Subject: Re: [PATCH 2/4] ath9k: fix stopping tx dma on reset
Date: Thu, 10 Mar 2011 14:20:28 +0100 [thread overview]
Message-ID: <4D78D01C.3020406@openwrt.org> (raw)
In-Reply-To: <5AF19632-CBB6-497C-8B47-1522BA6EA9F9@moxienet.com>
On 2011-03-10 5:21 AM, Mark Mentovai wrote:
>> --- a/drivers/net/wireless/ath/ath9k/mac.c
> [...]
>> +bool ath9k_hw_abort_tx_dma(struct ath_hw *ah)
> [...]
>> + for (q = 0; q < AR_NUM_QCU; q++) {
>> + for (i = 1000; i > 0; i--) {
>> + if (!ath9k_hw_numtxpending(ah, q))
>> + break;
>> +
>> + udelay(5);
>> + }
>> + }
>> + if (!i)
>> + return false;
>
> Awesome-looking patch set.
>
> What’s the return value of this function supposed to mean? As
> written, it only returns false there’s anything left pending on the
> final queue. Notably, if the inner loop ran for all 999 iterations
> and ath9k_hw_numtxpending never returned false, the code above would
> effectively ignore that condition.
Makes sense
> I’m less concerned about the return value (because it actually seems
> that the function could be declared void, you don’t use the return
> value anywhere) than I am about the REG_CLR_BIT and REG_WRITE
> operations that follow. It seems that you might be either missing
> those in cases where they should happen, or performing them in cases
> where they shouldn’t. Did you mean to leave AR_Q_TXD set when
> something is left pending on the final hardware queue?
I'll drop the return code and make the clearing of AR_Q_TXD and the
other bits unconditional.
- Felix
next prev parent reply other threads:[~2011-03-10 13:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-10 4:21 [PATCH 2/4] ath9k: fix stopping tx dma on reset Mark Mentovai
2011-03-10 13:20 ` Felix Fietkau [this message]
-- strict thread matches above, loose matches on Subject: below --
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 8:58 ` 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=4D78D01C.3020406@openwrt.org \
--to=nbd@openwrt.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=lrodriguez@atheros.com \
--cc=mark@moxienet.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).