From nobody Mon Feb 9 14:10:13 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 B96921EBA14 for ; Thu, 8 Jan 2026 03:22:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767842550; cv=none; b=pgJgU1drPJT4g0UKHQaQTdjsfCm26wmOVorwt6qXN+SMCEUugHXnnnJvhMfRBZeUmtEwHvgDupnqEQja9XFo0uS/zHkYDzVWw4m7gj4v8Kxqa9tBAWQRlsiFYpFbJq51ZWaQooEJA/g4W/IU4OGwTaIwu5CPEXRCxbmZoM7qlKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767842550; c=relaxed/simple; bh=fK060d3pmC1AJnx3mPozFG2gI3bYmcZajkokVubrU9Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=Px+cH5aN/ghbvyXaB/f0zZFS6/IMfwsSPBvJ4zapXOQ+Mep6hr4SsRK+vjKqnMZR0UqBlRtZXGCtDX+eHk45/uL8TFJvVHzMfpDURGzSaukIIuuldiIYHlJVTKcJMD3nFWjMUU6gPK5vBwDHSNUURRA2C+hZkdoEokTe832C2e8= 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=g/J1U6i6; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=RrDnG8Ik; arc=none smtp.client-ip=205.220.180.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="g/J1U6i6"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="RrDnG8Ik" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6081x1L2126050 for ; Thu, 8 Jan 2026 03:22:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=7PXwKV2N6Les3ztKmWoLYU uV1uMp/vFDg6/giSKNcK8=; b=g/J1U6i6gDNok/kzuvek3kexgPn+RkG1V6Dd55 yym/s1VZzUfdzrVajYfYI3HhwTV82jCBHdpmc6UAOK56OwGuAUSx2RTpigeMowUs fnIH4cuLdSTHQ2y/zYzKEYTtgaIwrs32yjHw63ByPDrZL8z+BunTBSwsIJ7O1E6B Xf+ISlyhuOk8x/w37JuKLK1oDZwlhw0SJGXGQBEoDou7M5SxQDW+ZVWQqjE/mP/V 721hzWcSfzqAwZwcJrG3Q6HnMpbohwNbuT7rw2RRqyOCfvVFGlxHh4rWhlhzpp20 gCPb8rrZvRveEKpncpcALrerHQzf1nJQ6Mz8XpmTa17hseWQ== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bj3d6889q-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 08 Jan 2026 03:22:26 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2a0f4822f77so54354295ad.2 for ; Wed, 07 Jan 2026 19:22:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767842545; x=1768447345; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=7PXwKV2N6Les3ztKmWoLYUuV1uMp/vFDg6/giSKNcK8=; b=RrDnG8IkIrxUTeQtx5gW5bVMS02Af2b/g3XGK4Xiz96uuxdHD1KNESWWQNh95ltTHf sMX2ZsgiM9lHiDj1gxmIMjGszjcAbl4KlKemZEZlic1v79VPAqHJ+X8mZ7dDfEXwFx6k CxTXf9lvl7OxbqeHaaXmeawu4H61Q4gCAIzHlCF6BH0al3RRHZzaoh1OpNukRfFkKz3O ZAFlpeLRNJDdgfGeNuvoulXt/lw5DR0n4BBXfLN38yQYMDx8/7Rb/V/7/OP1Y3cVTF6j cn5tp8Fs0if4C1LVebMRQE+QWC8f1jRM6MJFcbOzO2CMJ96fHoDXMzN5KFUi6qvyaacN MFDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767842545; x=1768447345; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7PXwKV2N6Les3ztKmWoLYUuV1uMp/vFDg6/giSKNcK8=; b=X8hRtMky7aGyS8yj1RZs8ueQt5FoGDBNEPsKmSqC7P9QfR6pa1chOqjP3TPd19OnXH /LMSd/0+JBy6JVP+mAqgoQloc/kNAHowWi92yUiEHaAst3o3iGHFJS8BvhyncwGLjayH gqWFmtzS49LWVRH/HdUf1XC2alFNYmIMAImtb7B9jo3TbraybUxxFwy/e7SRhUUNg1yc NJn7R3GDDTwzxgdInMXfD/ROL+XvItlcIM3sBFJuphdW2WhMzLfzSzjezspoaV0tS2La ic4PtDNOTmgs+z7z0NQ9I+eeXbRIaPzYc78+3IPrlTEyzRkReRfHP3/4p1pTq1QjBlwP ttfA== X-Forwarded-Encrypted: i=1; AJvYcCXFx2jWF5GL0MlZJvf5PmT2TWENZ3e7cogU0EuDM2POwefxvA4ENXiHpq4XuLkO1UxA0Fx2sXuCXRzC4Ac=@vger.kernel.org X-Gm-Message-State: AOJu0Yzi04KiA05fY341OtqnKEaFWbn1cfASgmvOGYOt8rKEK664IWWw zN+dBeVD6zJh6GkpCEES+lgvlQKsi8OAcQDeY3Sdch1F6QJVBCp3c6hKEmYl5WAS1lYXtUDxxF+ s9V7HvWBeoCfz399hmmI41mowNr1da2WeG23Eczolwh+MQyBdCMk07I5j1hONZCCB44XzbMZd6C 4NPw== X-Gm-Gg: AY/fxX7AA1geQ5q7BIANbnVOVR7I2f7OW/Z5WJYKJkD5jLg7Fh+HC0wTT/cD1gaW8+I 0d53k7Opj+7BjpLxKGVHT40G6947eFguOGyvb+02P4tfQUlW0jZ5AdFhVHFBLy83LQbBedKgZQD sjmeBZwiyyQQOo+uuEXaLAEiIif9XB4ZtwC2UhlLyBjuvBCC77TVYiD5U7PpbHuWZC5rSIw+PQG 8Fe+zaXHwua54DxKLbwXLNEZE3QBfso0LxkEs6YWiTwfeRXPekTyMgUxMWQF+qcqPYqV0C1ngTF KYG42QJtUpSbuMbNUhecKL+pidO6SQb2qf0Fav/QDNZywwqD0y2vL6+M7qxJ6Y2weMcbWbKOxRD FnOwC3oDQPwn+z94BuTD9Ag/ge7FDNcVByL4N/Jwuzfd4/KwTptwYBmcWN9NEsq0= X-Received: by 2002:a05:6a20:3947:b0:35d:2172:6010 with SMTP id adf61e73a8af0-3898f9904b1mr4702844637.51.1767842545107; Wed, 07 Jan 2026 19:22:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IGFVfouRyUmplzoXgfdGWuahXRjDDZ+DaSIRm+rneipYN8hW0cVcTS9EsNE1J7rHs/lITOURQ== X-Received: by 2002:a05:6a20:3947:b0:35d:2172:6010 with SMTP id adf61e73a8af0-3898f9904b1mr4702822637.51.1767842544518; Wed, 07 Jan 2026 19:22:24 -0800 (PST) Received: from [127.0.1.1] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c4cc9e7e824sm6339625a12.30.2026.01.07.19.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 19:22:24 -0800 (PST) From: Baochen Qiang Date: Thu, 08 Jan 2026 11:21:46 +0800 Subject: [PATCH ath-next] wifi: ath12k: don't force radio frequency check in freq_to_idx() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260108-ath12k-fix-freq-to-idx-v1-1-b2458cf7aa0d@oss.qualcomm.com> X-B4-Tracking: v=1; b=H4sIAMoiX2kC/3WNzQ6CMBCEX4Xs2SW2lR89+R6GQ4GtNEorbSUYw ru7IV69TDKZmW9WiBQsRbhkKwSabbTesRGHDLpBuzuh7dmDPMpCSFGjToOQDzR2QRNowuS5saB Wnakqo6SREnj8CsSVHXwD3qCjJUHDyWBj8uGzP85iz3/w8z/4LFBg2/aqLNWp7ovy6mPMp7d+d n4ccxZotm37AhFpElHNAAAA X-Change-ID: 20251218-ath12k-fix-freq-to-idx-a3cf77f32f22 To: Jeff Johnson Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Baochen Qiang X-Mailer: b4 0.14.3 X-Proofpoint-GUID: A3dN3qUXoGi3dC6sW-BVtZfYc5eEyu8_ X-Authority-Analysis: v=2.4 cv=APfYzRIR c=1 sm=1 tr=0 ts=695f22f2 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=VOO-gYkIs3c7SNGsfqsA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTA4MDAyMiBTYWx0ZWRfX/TTXAnSiv0/3 zz/WHfrxQfx1MoE/ePiyixra0/IU4biIzb6b6blBPKje7QinsZIL360aqOV4R7cHwZWaA9RsmH7 C7LsQ0A/snPBhEQcSviIsyF8WPH78J3w/19xdqMhMI/C75v3153MjnuyICJKzIS7LCNn3FPtZzX 8iV8GitmGCxEo9YCTQGhmN+EzPeUu/XAx3gNHWx7xM7I98lRThxNI3qk6dsjsS/4vFAU0fXRoGL X45nFSA23tXD3u+db4LqXScntUwRdRG82T8BvBfaADluhufzl6OTI2IZdvB12Up/rrdNhHMSVHP 6qkJySxrChi1yjhsLkObhf0e2m59lHDWLbFsP3T+1NX0bohRLpcHak5Vt5+Pk1UrUlo0R88dtW7 GaeoGH22QnMR8qqbMyDwjAd02eEeLiI4xFivkRyW2hJvZnYDffajuFLV7JhZaQYqKYd0eC2N+RS aXxlN7LTcUxU9YwTKjg== X-Proofpoint-ORIG-GUID: A3dN3qUXoGi3dC6sW-BVtZfYc5eEyu8_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-07_05,2026-01-07_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601080022 freq_to_idx() is used to map a channel to a survey index. Commit acc152f9be20 ("wifi: ath12k: combine channel list for split-phy devices in single-wiphy") adds radio specific frequency range check in this helper to make sure an invalid index is returned if the channel falls outside that range. However, this check introduces a race, resulting in below warnings as reported in [1]. ath12k_pci 0000:08:00.0: chan info: invalid frequency 6455 (idx 101 out of= bounds) ath12k_pci 0000:08:00.0: chan info: invalid frequency 6535 (idx 101 out of= bounds) ath12k_pci 0000:08:00.0: chan info: invalid frequency 6615 (idx 101 out of= bounds) ath12k_pci 0000:08:00.0: chan info: invalid frequency 6695 (idx 101 out of= bounds) ath12k_pci 0000:08:00.0: chan info: invalid frequency 6775 (idx 101 out of= bounds) ath12k_pci 0000:08:00.0: chan info: invalid frequency 6855 (idx 101 out of= bounds) ath12k_pci 0000:08:00.0: chan info: invalid frequency 6935 (idx 101 out of= bounds) ath12k_pci 0000:08:00.0: chan info: invalid frequency 7015 (idx 101 out of= bounds) ath12k_pci 0000:08:00.0: chan info: invalid frequency 7095 (idx 101 out of= bounds) ath12k_pci 0000:08:00.0: chan info: invalid frequency 6435 (idx 101 out of= bounds) Race scenario: 1) A regdomain covering below frequency range is uploaded to host via WMI_REG_CHAN_LIST_CC_EXT_EVENTID event: Country 00, CFG Regdomain UNSET FW Regdomain 0, num_reg_rules 6 1. (2402 - 2472 @ 40) (0, 20) (0 ms) (FLAGS 360448) (0, 0) 2. (2457 - 2477 @ 20) (0, 20) (0 ms) (FLAGS 360576) (0, 0) 3. (5170 - 5330 @ 160) (0, 20) (0 ms) (FLAGS 264320) (0, 0) 4. (5490 - 5730 @ 160) (0, 20) (0 ms) (FLAGS 264320) (0, 0) 5. (5735 - 5895 @ 160) (0, 20) (0 ms) (FLAGS 264320) (0, 0) 6. (5925 - 7125 @ 320) (0, 24) (0 ms) (FLAGS 2056) (0, 255) As a result, radio frequency range is updated as [2402, 7125] ath12k_pci 0000:08:00.0: mac pdev 0 freq limit updated. New range 2402->71= 25 MHz If no scan in progress or after scan finished, command WMI_SCAN_CHAN_LIST_CMDID is sent to firmware notifying that firmware is allowed to do scan on all channels within that range. The running path is: /* redomain uploaded */ 1. WMI_REG_CHAN_LIST_CC_EXT_EVENTID 2. ath12k_reg_chan_list_event() 3. ath12k_reg_handle_chan_list() 4. queue_work(..., &ar->regd_update_work) 5. ath12k_regd_update_work() 6. ath12k_regd_update() /* update radio frequency range */ 7. ath12k_mac_update_freq_range() 8. regulatory_set_wiphy_regd() 9. ath12k_reg_notifier() 10. ath12k_reg_update_chan_list() 11. queue_work(..., &ar->regd_channel_update_work) 12. ath12k_regd_update_chan_list_work() /* wait scan finishes */ 13. wait_for_completion_timeout(&ar->scan.complete= d, ...) /* command notifying list of valid channels */ 14. ath12k_wmi_send_scan_chan_list_cmd() 2) Hardware scan is triggered on all allowed channels. 3) Before scan completed, 11D mechanism detects a new country code ath12k_pci 0000:08:00.0: wmi 11d new cc GB With this code sent to firmware, firmware uploads a new regdomain Country GB, CFG Regdomain ETSI FW Regdomain 2, num_reg_rules 9 1. (2402 - 2482 @ 40) (0, 20) (0 ms) (FLAGS 360448) (0, 0) 2. (5170 - 5250 @ 80) (0, 23) (0 ms) (FLAGS 264192) (0, 0) 3. (5250 - 5330 @ 80) (0, 23) (0 ms) (FLAGS 264216) (0, 0) 4. (5490 - 5590 @ 80) (0, 30) (0 ms) (FLAGS 264208) 5. (5590 - 5650 @ 40) (0, 30) (600000 ms) (FLAGS 264208) 6. (5650 - 5730 @ 80) (0, 30) (0 ms) (FLAGS 264208) 7. (5735 - 5875 @ 80) (0, 14) (0 ms) (FLAGS 264192) (0, 0) 8. (5855 - 5875 @ 20) (0, 14) (0 ms) (FLAGS 264192) (0, 0) 9. (5945 - 6425 @ 320) (0, 24) (0 ms) (FLAGS 2056) (0, 11) Then radio frequency range is updated as [2402, 6425] ath12k_pci 0000:08:00.0: mac pdev 0 freq limit updated. New range 2402->64= 25 MHz Please note this is a smaller range than the previous one. Later host runs the same path for the purpose of notifying the new channel list. However since scan not completed, host just waits there. Meanwhile, firmware is possibly scanning channels outside the new range. As a result, WMI_CHAN_INFO_EVENTID events for those channels fail freq_to_idx() check and triggers warnings above. Fix this issue by removing radio frequency check in freq_to_idx(). This is valid because channels being scanned do not synchronize with frequency range update. Besides, this won't cause any problem, since freq_to_idx() is only used for survey data. Even out-of-range channels filled in the survey, they won't get delivered to userspace due to the range check already there in ath12k_mac_op_get_survey(). Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SIL= ICONZ-1.115823.3 Fixes: acc152f9be20 ("wifi: ath12k: combine channel list for split-phy devi= ces in single-wiphy") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=3D220871 # 1 Signed-off-by: Baochen Qiang --- drivers/net/wireless/ath/ath12k/wmi.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/a= th/ath12k/wmi.c index 150b04d0a21c..17ffc4822741 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -6479,16 +6479,9 @@ static int freq_to_idx(struct ath12k *ar, int freq) if (!sband) continue; =20 - for (ch =3D 0; ch < sband->n_channels; ch++, idx++) { - if (sband->channels[ch].center_freq < - KHZ_TO_MHZ(ar->freq_range.start_freq) || - sband->channels[ch].center_freq > - KHZ_TO_MHZ(ar->freq_range.end_freq)) - continue; - + for (ch =3D 0; ch < sband->n_channels; ch++, idx++) if (sband->channels[ch].center_freq =3D=3D freq) goto exit; - } } =20 exit: --- base-commit: e33fc1c6d54ee1569a57255e11c2978ba9a42ffc change-id: 20251218-ath12k-fix-freq-to-idx-a3cf77f32f22 Best regards, --=20 Baochen Qiang