wifi: ath9k: restore background spectral scan after reset
PATCH 1/1 wifi: ath9k: restore background spectral scan after reset
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.
--- drivers/net/wireless/ath/ath9k/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/wireless/ath/ath9k/main.c +12 -0
@@ -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 ;
Signature · 1 line
2.55.0
Hi, I did not get any feedback so far, so a friendly reminder. :)
Bests
Nick
Quoted 44 lines · Nick Hainke
A reset leaves
spectral_modeset toSPECTRAL_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-5Signed-off-by Nick Hainke <[email protected]>--- drivers/net/wireless/ath/ath9k/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)drivers/net/wireless/ath/ath9k/main.c +12
-0@@ -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 ;
Toke Høiland-Jørgensen
maintainerQuoted 8 lines · Nick Hainke
A reset leaves
spectral_modeset toSPECTRAL_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.
What bug is this fixing, and how did you test the change?
-Toke
Toke Høiland-Jørgensen
maintainerQuoted 7 lines
A reset leaves
spectral_modeset toSPECTRAL_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.
Looking at this again, it's not obvious to me that the right thing to do here is to re-trigger the scan. Shouldn't the reset just set the state back to disabled instead?
-Toke