From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6018F2C181 for ; Mon, 22 Jun 2026 05:11:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782105093; cv=none; b=MLuBM+9eNokOuT/MwqOWDYs9kEeN17JOdSdRHMOGx0LsL1muTCz58aHXPuvcVYj3+0KolbbahgSVReuHK6thUARYSascQ410jAvitXFap93KBsxTf+aXmYYfUlgZDOHkWJtU5C6M2zBBjARkb1nQEMVraUo/jVt6Ss+Jp6ppZqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782105093; c=relaxed/simple; bh=J690Tlpj02yje90WpI7kzHrjgdRxC+3O21IfvD1l2+A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HCf1ZWXxbhU7xQUsq9IYKWNqQ11YEi7oLRF72e6qwbD71jFFQRAYhIHAXyd4QltLmHmKR4Ckycl0NMMMPfY7z+3d0mvQhPsEYBgsQjS46UVYBrjpmb7EuUMn3YVj8FC8NxlEKeVHKrWTGVmZZpmZNvqbV92AU0N/TWBKTh9RsTo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=iT9FYQiE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=RmoOtfSr; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="iT9FYQiE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="RmoOtfSr" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65M59SJ33880376 for ; Mon, 22 Jun 2026 05:11:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 60bpPo7bB923QwBAsdBtArQLCaqk1Or+3USoOTjJavk=; b=iT9FYQiEkGN/7lRV E6xxiGQZ8xmGm70OwlpJLw/9EW6QFBhGQw2OP37aC154b1auSiXRUfmI0GtHXe8B nxxZ/vlZq6nM3kIwK7ecqAL1UQ2DCmY8vsmGvz03T+R7yNIcnihA3HS27gW3PJfV CSHiTGAwdXJP0ZXaQlqIlI7ZaU0EZzIW1qTWfy1+q49lLoX6HlczatzeZbh3Kzdt Az/Zdmdq1C5celIxD+6cR/87xwLD3UE2Egs2sPjHYZSkQMxAayhPSoiYs7X+gtnD UVUC70/NmMbYZgRIounxiF9NkBGIyeRw0KtFrcgiXE5V/BPt4GVyYV74UQ7gZzcq s+bqpw== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ewgjed2rq-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 22 Jun 2026 05:11:31 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2c6afd85980so40155875ad.0 for ; Sun, 21 Jun 2026 22:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782105091; x=1782709891; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=60bpPo7bB923QwBAsdBtArQLCaqk1Or+3USoOTjJavk=; b=RmoOtfSrmIcPlXK+BRzre5JkjeeKbDzoCzLUhxjHV1LcFl7FElFlD7PgBU5mAojR40 RQ2j3Yea2DV+u7+QwUm8bZHFjBZZrAtkOokMwGF4t0kw56tcjIywADWu/dapxhmM9bSv BzvdMwZwaeSRSe1+bGeHuMz6ZOKa1591IYexLucBrR42sdhvO44YNfConkKHLsT6C+9v cNiCzatXiQr3CGmeIk40dj2yaAQd/0e/mjuotn21yl5EHTm9WnVbyHj/2GaRZR+n31F+ zkD+C56m1wt/1B2J9d/JhnRW+89d82QIGMWpKqbjpJ2QywaNNpH4V9uSZLC8rs7eB4Xa 2ybA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782105091; x=1782709891; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=60bpPo7bB923QwBAsdBtArQLCaqk1Or+3USoOTjJavk=; b=Dx3iij5R2Y/fLjgPqCugmaW+Xpz99gyGMHyPH5XT5xUghTKfIWwIOkdkKWPuin+U9r ruGiK2XSikkqv9X5+qUDB379XzH8hsWK4yEjmgrSmo5FsB5NF+rEudWrt0ZXPRjNLYrz wmfxBfK+ZvoLYwae9xJfxHT/WUR2QFNa1uyTPnRyMnMfDTQ2424c1a8J8grf8REKsWsL H2X7N562CjdH4koVDl2CqgYzwwEME9e8QmTaeqyPRzRwpv4ggQElGJ/Br6VM31TcQFxZ hrCfXT4qzjNypD+ri4ZCxLhw5+7ZvvVQS4FDHJjNATGQBGYyZWoS1pV1Z8x0b8qU3SBg tuFw== X-Forwarded-Encrypted: i=1; AHgh+Rosj6wxJgrfVxQXJmVIeVIQQt0SZzF7LbTZ+EtU+gYCuyWqu/01q9KDazat0yjjI2UkLfm4LOFcU3qGsuk=@vger.kernel.org X-Gm-Message-State: AOJu0YxIW/uqQO6i0YgYQTgd7PiygcY7yPAMM5rd1J9BEOSHDMARYi45 uV/8k9jm1KEWAQQubRQWgAFNHjJnnvbcvxZDZl+DPhsuJ/KJwh3clutCN9wKbhMAQUmN8CAUUaf 2JlYtbpDpR8yYhmuoutioQGS/G3KBXoLimxr9FkLhj1Zjz8Vrgm+fG2iJr+HHEajSL+g= X-Gm-Gg: AfdE7cn0kW0DATuqLTJBVgZFze9F1Ov+ZG5nAEaWxk4FkeSqQbhxk6B6BcLuUVik2ui XjRsaWgQrhUovHch0HPIPPiZRFc5EHxl4pXn9J/TTdJhbVsyAUDoW7PSNWsZwbcnjS0ohXomDek l+SaNDfH5/93P63Uq//fiPKwKQu+43wrah8tkxmrmQFN0FDwyONkQcotqNqOTYLxouVaJSZ2tM6 OqjOB2PxccZRuqXMNT0VfZduSKAbEW0ZaN3ZC9HbBQUkOwELjRPae0E7Ds9FiOFIXa6Y/1L0uH8 jFLb/+BlCYSLx2l9Gh8Jy+gez1qvq69S4pf7KoEDWaHTL/mrUE9e0y4f+PL+2OTPULcRMk0cw/y SDVYksvKMDF0LZpHtuISHCXXQUOE/GAREIXrhgDhxY5H2conbFqg= X-Received: by 2002:a17:902:f68e:b0:2c2:9a1e:6099 with SMTP id d9443c01a7336-2c718f64b9amr133429515ad.23.1782105091061; Sun, 21 Jun 2026 22:11:31 -0700 (PDT) X-Received: by 2002:a17:902:f68e:b0:2c2:9a1e:6099 with SMTP id d9443c01a7336-2c718f64b9amr133429235ad.23.1782105090607; Sun, 21 Jun 2026 22:11:30 -0700 (PDT) Received: from [10.152.199.23] ([202.46.23.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c7436aff98sm63304345ad.3.2026.06.21.22.11.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 Jun 2026 22:11:30 -0700 (PDT) Message-ID: <106a3e99-eebd-4c12-9677-11979a92c268@oss.qualcomm.com> Date: Mon, 22 Jun 2026 10:41:23 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] wifi: ath12k: fix survey indexing across bands To: Matthew Leach , Jeff Johnson , Vasanthakumar Thiagarajan , Baochen Qiang , Ramya Gnanasekar , Karthikeyan Periyasamy Cc: Kalle Valo , Pradeep Kumar Chitrapu , P Praneesh , Sriram R , linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com References: <20260617-ath12-survey-band-fix-v1-1-e7d9555bb478@collabora.com> From: Rameshkumar Sundaram Content-Language: en-US In-Reply-To: <20260617-ath12-survey-band-fix-v1-1-e7d9555bb478@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: 8nYHqYwaZMzPM-BKzVCcQwG1z1AGZGfh X-Proofpoint-Spam-Info: AW1haW4tMjYwNjIyMDA0NyBTYWx0ZWRfXz9dACMLqHGmM i/BFH7yronUklHk/Wc01shO3e2EB4k1EvWLPKCTWIi/uRWd8XMnFCvVymLkoxsJttBWWrJrSWgI E2uoZLX4KMIhD5aWizyyAtRMyntzGkk= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjIyMDA0NyBTYWx0ZWRfX+Yxa/k71C2uD JROoJSWziHzy9MG13sAIzVi1qahhiLPPkm4A64zLGdpygDeABJRLYmoN0SnW8PLMniZr8gAE/XW dMJ+yK27yLv/RcOCUpgnm6iBOR7ybx8xnSB5y9qvKolV5+dwxK5D3Dn2tsjnaBsOI4Kg3WmlbiG 1zOn7Z9bJO6Cxf9K2cz1QRbBLQcVlhunMXH4P3oX8wPJSXBT/1dhj25NBLl8p+KjEa1qh14ZiTT v0iGVsYs25OyrEpuoV8Mq8sq5MgOLqV72Q8C+VEXTVZjBnIQzgvrbP78C7fdEJs3kZmNAn7sQaX rncHpLBmdRI1Cr9ortxBuiK8SYAfFu/ISoboyHsQQ/nNSlkq+HMt0a952cxacAPzcHiI9RK01/2 b6vAw5NzyVMurOzhUiVuty0vQGVcNuqEK5D6Dcjp5Y06ajFQirwIPHadDnywi8KL/wEHSdMURrH SY2U9rFilt3RNWxzg+w== X-Proofpoint-GUID: 8nYHqYwaZMzPM-BKzVCcQwG1z1AGZGfh X-Authority-Analysis: v=2.4 cv=TO51jVla c=1 sm=1 tr=0 ts=6a38c403 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=j4ogTh8yFefVWWEFDRgCtg==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=VwQbUJbxAAAA:8 a=QX4gbG5DAAAA:8 a=Se1BA6vDASlMqV_I0t4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 a=AbAUZ8qAyYyZVLSsDulk:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-22_01,2026-06-18_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 malwarescore=0 clxscore=1015 phishscore=0 spamscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606220047 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 > --- > 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