Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wifi: ath9k: restore background spectral scan after reset
@ 2026-09-15 19:43 Nick Hainke
  2026-10-13 17:56 ` nick
  2026-10-19 18:46 ` Toke Høiland-Jørgensen
  0 siblings, 2 replies; 3+ messages in thread
From: Nick Hainke @ 2026-09-15 19:43 UTC (permalink / raw)
  To: linux-wireless
  Cc: Nick Hainke, Toke Høiland-Jørgensen, linux-kernel

A reset leaves spectral_mode set to SPECTRAL_BACKGROUND, but resets the
spectral registers and receive filter. The driver therefore still reports
a background scan even though the hardware no longer produces FFT samples.

Re-trigger background spectral scanning after reset recovery so the
software and hardware state match again. Do not re-trigger spectral
scanning in disabled, manual, channel-scan, radar, or off-channel modes.

Assisted-by: Claude:opus-5
Signed-off-by: Nick Hainke <vincent@systemli.org>
---
 drivers/net/wireless/ath/ath9k/main.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 740a6fc7b067..00e587fe6ee3 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -231,6 +231,17 @@ static bool ath_prepare_reset(struct ath_softc *sc)
 	return ret;
 }
 
+static void ath_restore_spectral_scan(struct ath_softc *sc, bool start)
+{
+	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+
+	if (!start || sc->cur_chan->offchannel || sc->hw->conf.radar_enabled ||
+	    sc->spec_priv.spectral_mode != SPECTRAL_BACKGROUND)
+		return;
+
+	ath9k_cmn_spectral_scan_trigger(common, &sc->spec_priv);
+}
+
 static bool ath_complete_reset(struct ath_softc *sc, bool start)
 {
 	struct ath_hw *ah = sc->sc_ah;
@@ -269,6 +280,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
 		ath_restart_work(sc);
 		ath_txq_schedule_all(sc);
 	}
+	ath_restore_spectral_scan(sc, start);
 
 	sc->gtt_cnt = 0;
 
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-19 18:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 19:43 [PATCH] wifi: ath9k: restore background spectral scan after reset Nick Hainke
2026-10-13 17:56 ` nick
2026-10-19 18:46 ` Toke Høiland-Jørgensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox