[PATCH v2 2/5] wifi: ath9k_htc: report a failed multi-read as all ones
From: Nerijus Bendžiūnas
Date: Thu Sep 03 2026 - 12:58:51 EST
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@xxxxxxxxx>
---
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