All of lore.kernel.org
 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

* Re: [PATCH] wifi: ath9k: restore background spectral scan after reset
  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
  1 sibling, 0 replies; 3+ messages in thread
From: nick @ 2026-10-13 17:56 UTC (permalink / raw)
  To: linux-wireless; +Cc: Toke Høiland-Jørgensen, linux-kernel

Hi, I did not get any feedback so far, so a friendly reminder. :)

Bests
Nick

On 9/15/26 9:43 PM, Nick Hainke wrote:
> 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;
>   

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

* Re: [PATCH] wifi: ath9k: restore background spectral scan after reset
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Toke Høiland-Jørgensen @ 2026-10-19 18:46 UTC (permalink / raw)
  To: Nick Hainke, linux-wireless; +Cc: Nick Hainke, linux-kernel

Nick Hainke <vincent@systemli.org> writes:

> 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.

What bug is this fixing, and how did you test the change?

-Toke

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.