From: "Nerijus Bendžiūnas" <nerijus.bendziunas@gmail.com>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>, linux-wireless@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/5] wifi: ath9k_htc: report a failed multi-read as all ones
Date: Thu, 3 Sep 2026 18:36:14 +0300 [thread overview]
Message-ID: <20260903153617.990995-3-nerijus.bendziunas@gmail.com> (raw)
In-Reply-To: <20260903153617.990995-1-nerijus.bendziunas@gmail.com>
ath9k_multi_regread() logs a WMI timeout and then copies its result
buffer out regardless, so the caller receives whatever the stack held for
every register it asked for: the ANI MIB counters grow by random amounts,
an EEPROM block read at probe turns into noise, and ath9k_hw_read_array()
hands back values that never came from the device. ath9k_regread() reports
the same failure as -1. Fill the caller's buffer with all ones instead, so
a failed multi-read looks like a failed single read and a register value
that means "busy" or "pending" is what a timeout produces. The next patch
relies on that for the tx queue status.
Fixes: 09a525d33870 ("ath9k_htc: Add multiple register read API")
Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@gmail.com>
---
drivers/net/wireless/ath/ath9k/htc_drv_init.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 7fdec25c76ef..bfde58c5965b 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -276,6 +276,9 @@ static void ath9k_multi_regread(void *hw_priv, u32 *addr,
if (unlikely(ret)) {
ath_dbg(common, WMI,
"Multiple REGISTER READ FAILED (count: %d)\n", count);
+ /* Callers expect what a failed single read returns. */
+ memset(val, 0xff, sizeof(*val) * count);
+ return;
}
for (i = 0; i < count; i++) {
--
2.55.0
next prev parent reply other threads:[~2026-09-03 15:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 15:36 [PATCH v2 0/5] wifi: ath9k: cut USB round trips on channel changes Nerijus Bendžiūnas
2026-09-03 15:36 ` [PATCH v2 1/5] wifi: ath9k: name the register multi-read limit Nerijus Bendžiūnas
2026-09-03 15:36 ` Nerijus Bendžiūnas [this message]
2026-09-03 15:36 ` [PATCH v2 3/5] wifi: ath9k: check all tx queues with one multi-read Nerijus Bendžiūnas
2026-09-03 15:36 ` [PATCH v2 4/5] wifi: ath9k: batch the read-modify-writes of a channel change Nerijus Bendžiūnas
2026-09-03 15:36 ` [PATCH v2 5/5] wifi: ath9k: skip the departing channel's noise floor on USB fast changes Nerijus Bendžiūnas
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=20260903153617.990995-3-nerijus.bendziunas@gmail.com \
--to=nerijus.bendziunas@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=toke@toke.dk \
/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
all inboxes | Powered by JetHome®