[PATCH 1/2] wifi: ath9k_htc: derive the PHY error filter bits from software state
From: Nerijus Bendžiūnas
Date: Thu Sep 03 2026 - 13:24:30 EST
ath9k_htc_calcrxfilter() reads AR_RX_FILTER back from the device to keep
the PHY error bits the spectral trigger may have set. On USB that read is
a WMI round trip, and when it times out ath9k_regread() returns -1, so
the recalculated filter turns PHY error forwarding on with no scan
running and the device streams every PHY error frame at the host until
the next recalculation. The driver already knows whether a scan is
active, so set the two bits from spec_priv instead, the way ath9k
derives its filter from software state. This drops one round trip from
every filter recalculation, and the bits now go away when the scan is
disabled rather than lingering until the next reset.
Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@xxxxxxxxx>
---
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index bed7ea2425a0..299064a7fa49 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -868,14 +868,14 @@ int ath9k_htc_cabq_setup(struct ath9k_htc_priv *priv)
*/
u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv)
{
-#define RX_FILTER_PRESERVE (ATH9K_RX_FILTER_PHYERR | ATH9K_RX_FILTER_PHYRADAR)
-
struct ath_hw *ah = priv->ah;
u32 rfilt;
- rfilt = (ath9k_hw_getrxfilter(ah) & RX_FILTER_PRESERVE)
- | ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
- | ATH9K_RX_FILTER_MCAST;
+ rfilt = ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST |
+ ATH9K_RX_FILTER_MCAST;
+
+ if (priv->spec_priv.spectral_mode != SPECTRAL_DISABLED)
+ rfilt |= ATH9K_RX_FILTER_PHYRADAR | ATH9K_RX_FILTER_PHYERR;
if (priv->rxfilter & FIF_PROBE_REQ)
rfilt |= ATH9K_RX_FILTER_PROBEREQ;
@@ -906,8 +906,6 @@ u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv)
rfilt |= ATH9K_RX_FILTER_MCAST_BCAST_ALL;
return rfilt;
-
-#undef RX_FILTER_PRESERVE
}
/*
--
2.55.0