mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christopher Griffin via B4 Relay <devnull+christophergriffin05.gmail.com@kernel.org>
To: Jeff Johnson <jjohnson@kernel.org>
Cc: linux-wireless@vger.kernel.org, ath11k@lists.infradead.org,
	 linux-kernel@vger.kernel.org,
	 Christopher Griffin <christophergriffin05@gmail.com>
Subject: [PATCH ath-next] wifi: ath11k: update rx_channel on a channel switch
Date: Sat, 24 Oct 2026 19:32:35 -0500	[thread overview]
Message-ID: <20261024-ath11k-rx-channel-switch-v1-1-5fc2ba53ca8f@gmail.com> (raw)

From: Christopher Griffin <christophergriffin05@gmail.com>

ath11k keeps the radio's current channel in ar->rx_channel: survey dumps
flag that channel as in use, and only for it is the bss channel info
requested. ath11k_mac_op_add_chanctx() sets it, but a channel switch
(CSA, or hostapd's switch_chan) goes through ath11k_mac_update_vif_chan(),
which leaves it at the old channel ("TODO: Update ar->rx_channel"). After
a switch the survey keeps marking the old channel as in use and never
refreshes the new one.

Set it to the new context's channel, as ath10k does in its
ath10k_mac_update_vif_chan(). ath11k uses one channel context per radio,
so every vif in the switch moves to the same channel.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.9.0.1-02146-QCAHKSWPL_SILICONZ-1

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Christopher Griffin <christophergriffin05@gmail.com>
---
Found on an Arista C-260 (IPQ8074) while chasing a wrong survey noise
floor; the noise floor fix itself is sent separately ("wifi: ath11k:
report the measured noise floor of the channel in use") and relies on
this one after a channel switch.
---
 drivers/net/wireless/ath/ath11k/mac.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 1a237adaa..57873c875 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -7800,7 +7800,11 @@ ath11k_mac_update_vif_chan(struct ath11k *ar,
 	 * should be available for the channel switch now.
 	 */
 
-	/* TODO: Update ar->rx_channel */
+	if (n_vifs) {
+		spin_lock_bh(&ar->data_lock);
+		ar->rx_channel = vifs[0].new_ctx->def.chan;
+		spin_unlock_bh(&ar->data_lock);
+	}
 
 	for (i = 0; i < n_vifs; i++) {
 		arvif = ath11k_vif_to_arvif(vifs[i].vif);

---
base-commit: cd026e68fdbf88b9cc522b76c7a9d92c9a41f709
change-id: 20261024-ath11k-rx-channel-switch-4ae05c7a827c

Best regards,
--  
Christopher Griffin <christophergriffin05@gmail.com>



                 reply	other threads:[~2026-10-25  0:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261024-ath11k-rx-channel-switch-v1-1-5fc2ba53ca8f@gmail.com \
    --to=devnull+christophergriffin05.gmail.com@kernel.org \
    --cc=ath11k@lists.infradead.org \
    --cc=christophergriffin05@gmail.com \
    --cc=jjohnson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®