mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
To: Matthew Leach <matthew.leach@collabora.com>,
	Jeff Johnson <jjohnson@kernel.org>,
	Vasanthakumar Thiagarajan <quic_vthiagar@quicinc.com>,
	Baochen Qiang <quic_bqiang@quicinc.com>,
	Ramya Gnanasekar <quic_rgnanase@quicinc.com>,
	Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Cc: Kalle Valo <kvalo@kernel.org>,
	Pradeep Kumar Chitrapu <quic_pradeepc@quicinc.com>,
	P Praneesh <quic_ppranees@quicinc.com>,
	Sriram R <quic_srirrama@quicinc.com>,
	linux-wireless@vger.kernel.org, ath12k@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel@collabora.com
Subject: Re: [PATCH] wifi: ath12k: fix survey indexing across bands
Date: Mon, 22 Jun 2026 10:41:23 +0530	[thread overview]
Message-ID: <106a3e99-eebd-4c12-9677-11979a92c268@oss.qualcomm.com> (raw)
In-Reply-To: <20260617-ath12-survey-band-fix-v1-1-e7d9555bb478@collabora.com>

On 6/17/2026 3:48 PM, Matthew Leach wrote:
> When running 'iw dev wlan0 survey dump' the values for the channel busy
> time have the same sequence across bands. This is caused by indexing
> into the ath12k survey array using a band-local index rather than the
> global index passed by mac80211. This results in surveys for 5 GHz and 6
> GHz channels returning values from 2.4 GHz slots, making the survey
> unusable on those bands.
> 
> Fix by indexing into ar->survey[] using the original index passed by
> mac80211.
> 
> Band busy-times Before this fix:
> 
> 2.4 GHz: 9, 2, 2, 2, 4, 2, 10, 16, 4, 12, 5
> 5 GHz:   9, 2, 2, 2, 4, 2, 10, 16, 4, 12, 5
> 6 GHz:   9, 2, 2, 2, 4, 2, 10, 16, 4, 12, 5
> 
> After this fix, times are independent:
> 
> 2.4 GHz: 23, 5,  5,  12, 2,   12,  26,  5,   3,  1,  27
> 5 GHz:   30, 40, 29, 27, 118, 118, 112, 120, 11, 11, 11
> 6 GHz:   1,  0,  0,  0,  0,   0,   0,   0,   0,  0,  1
> 
> Tested-on: wcn7850 hw2.0 PCI WLAN.IOE_HMT.1.1-00018-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1
> 
> Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")


The Fixes: tag is probably too broad,

4f242b1d6996 ("wifi: ath12k: support get_survey mac op for single 
wiphy") changed ath12k_mac_op_get_survey() for single-wiphy handling and 
moved survey lookup after band index adjustment.


> Signed-off-by: Matthew Leach <matthew.leach@collabora.com>
> ---
>   drivers/net/wireless/ath/ath12k/mac.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
> index 2cff9485c95a..9474d7e70823 100644
> --- a/drivers/net/wireless/ath/ath12k/mac.c
> +++ b/drivers/net/wireless/ath/ath12k/mac.c
> @@ -13351,6 +13351,7 @@ int ath12k_mac_op_get_survey(struct ieee80211_hw *hw, int idx,
>   	struct ath12k *ar;
>   	struct ieee80211_supported_band *sband;
>   	struct survey_info *ar_survey;
> +	int survey_index = idx;
>   
>   	lockdep_assert_wiphy(hw->wiphy);
>   
> @@ -13385,7 +13386,7 @@ int ath12k_mac_op_get_survey(struct ieee80211_hw *hw, int idx,
>   		return -ENOENT;
>   	}
>   
> -	ar_survey = &ar->survey[idx];
> +	ar_survey = &ar->survey[survey_index];


There is an existing discussion on similar lines, see [1].

This could break survey dump on multi-radio/single-wiphy setups, for 
example split-radio QCN9274 configurations.

I would suggest to move the survey results from ar to ath12k_hw, since 
not all bands in ar->survey[] are effectively utilized for a multi‑radio 
wiphy. In that model, this patch's approach of preserving the original 
idx would make sense, and freq_to_idx() should also stop skipping bands 
based on ar->mac.sbands[] so that WMI population uses the same global index.

  -        if (!ar->mac.sbands[band].channels)
  -            continue;


[1] https://lore.kernel.org/linux-wireless/aYtRBg498h_aLPBK@pilgrim/

--
Ramesh

      reply	other threads:[~2026-06-22  5:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17 10:18 Matthew Leach
2026-06-22  5:11 ` Rameshkumar Sundaram [this message]

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=106a3e99-eebd-4c12-9677-11979a92c268@oss.qualcomm.com \
    --to=rameshkumar.sundaram@oss.qualcomm.com \
    --cc=ath12k@lists.infradead.org \
    --cc=jjohnson@kernel.org \
    --cc=kernel@collabora.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=matthew.leach@collabora.com \
    --cc=quic_bqiang@quicinc.com \
    --cc=quic_periyasa@quicinc.com \
    --cc=quic_ppranees@quicinc.com \
    --cc=quic_pradeepc@quicinc.com \
    --cc=quic_rgnanase@quicinc.com \
    --cc=quic_srirrama@quicinc.com \
    --cc=quic_vthiagar@quicinc.com \
    /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®