[PATCH v3 5/5] wifi: ath9k: skip the old channel's noise floor on USB fast changes
From: Nerijus Bendžiūnas
Date: Fri Sep 04 2026 - 15:47:46 EST
ath9k_hw_reset() reads the noise floor of the channel it is leaving to
keep that channel's calibration history current. On a single-chain
AR9271 that is three register reads, and on the USB devices each one is
a synchronous WMI round trip paid on every channel change.
Skip the readout on a fast channel change over USB. The arriving
channel's noise floor is loaded as before, and periodic calibration
updates the history while a channel is in use. Only a channel that is
left and revisited without a calibration in between sees an older
history entry.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@xxxxxxxxx>
---
drivers/net/wireless/ath/ath9k/hw.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index d204cdf3fa8f..64fefbec46d5 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1878,7 +1878,13 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
return -EIO;
- if (ah->curchan && !ah->chip_fullsleep)
+ /*
+ * Over USB the departing channel's noise-floor readout costs several
+ * round trips and only feeds its history; the fast path reloads the
+ * arriving channel's noise floor regardless.
+ */
+ if (ah->curchan && !ah->chip_fullsleep &&
+ !(fastcc && common->bus_ops->ath_bus_type == ATH_USB))
ath9k_hw_getnf(ah, ah->curchan);
ah->caldata = caldata;
--
2.55.0