From nobody Mon Feb 9 21:40:29 2026 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 8D3384BED3D for ; Thu, 8 Jan 2026 10:44:54 +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=1767869101; cv=none; b=LNkcKpCvrmPTp+xCnuomRgYEeaKCZAzEsYsoZJkeAQn3eur8TcaAYBE/6KcxaQ8Ic7geumYWbsRmQIrFs7t0vOJw6pHTU+/OPX8tvWBhqPW99X/5qCq/2XWaMbugSEHEjratRk/2wuQoG85R6puf7aDca7pd7StPcScmJQNBTEc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767869101; c=relaxed/simple; bh=EwMf8/8XcOKtjzN7bNffRXI5pnRCOFeRMZyrOgmLvms=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=Z34DktKn6vO6FVyo1ODO/zEX7pExmitBlll7mcyRYAZsYHeSRUFAAnkLMIIZc4uMmrmIzrUhTDZANKtJeuyz62UMXxyVrWx5WfYe9EkLR2StxmkAwLGH6RabdyroboOmZVXPcL4VshQ7mq3XhmNuiSOmSZbe7RXoyvccm/OGNwU= 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=Mxk/qZbK; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aNy+vwqX; 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="Mxk/qZbK"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aNy+vwqX" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6087Vbn31838799 for ; Thu, 8 Jan 2026 10:44:48 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=UCWf1GYG01oCNT5JUBK9ci QvOCCDtItp2wmBxL7jzC0=; b=Mxk/qZbKHvx7D01uSV2gX77Q8Yxwik9NgMLpPO JfnbL8MaYFcSY7oW2XdO3/KTOFHznoP0/E1I1oet6tifAG89lsQSUPK+dRFPhTC+ vtl35PnPRYH/aABf32FJHOTVkLuUCD9fwbi+cl0YKa28RZr2O3sLuXe8E8dYdqt/ AjGsFDE8qX6nOwCgymX1Cht9ihhHvQ7cBVOHxgiqYVCb1JWKas9TDacwLVr5YKPj Dc/tF5jQWS7UB3ZL+enG+G2pyOBi98VgVtqJXABTLnLTdTLpwOmKTFoFin3H/o2f Eb5mzpUf+Vn/kpHgRFq3eLV6uxpzaZMcWd2kfz4SlzLWuPEA== 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 4bj8920kts-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 08 Jan 2026 10:44:48 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2a0f47c0e60so67423295ad.3 for ; Thu, 08 Jan 2026 02:44:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767869088; x=1768473888; 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=UCWf1GYG01oCNT5JUBK9ciQvOCCDtItp2wmBxL7jzC0=; b=aNy+vwqXMDbCotp2cjLcbJ4KHt9Cs7uE+J5vzeqapFNz5fEsDlUNmtrEAUu/e3XbKN IuJ7Vhx67w5ymcaL8ZVV9W0PSAU7Agdar0bkUDSK8wW2TpUrKPQvXzalE1bMIWuzBxPP v10kR8Tqq1dt/Hpa7EVl7Lzp1eARfJtyj4ALplntBPct3R5NJSTGJm5EtZv+dra9erOy GZZ50IzqhiyWlhHsar6qfUNt5dV4KHpGIof7sJdHg3nt9RPSEExGFMGK5PooFsXAuEhg +DiM3W+PhuqJeT2JyCScLlcWrFeo2o9dR1Ub7on4QN/Lij+iHGIPBtNZhRlNOL8bsPNt sVxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767869088; x=1768473888; 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=UCWf1GYG01oCNT5JUBK9ciQvOCCDtItp2wmBxL7jzC0=; b=j3r/pXUnX7R5f4ZYIeCUbARBGFGswPZG1X2KO5By10+l03RLFDP86gPdxxQnHpaL+J IKB5NGr83NscXI3EieeASIhrNxIPLHcceBkuWr/T/ABeAQz4yie4x/P/uWqphnj0ycSU xmlpycD3gXJb4SXqybfOqfPCKNrjxErO1EFmrKf1nilFpMgv5o9tHpJb4TPOajPhf0xV ITZh75FXuKl6UBjj1u6sz2G+FcP5cyB8wCS4wJvHM/R3oj32l1wOZuQEGb8eKiBxipcQ kGcrTBppc8imB+73BBB+ebxFth9pP7R9+HpGocO9Ftly25q5HNOIeNy9BSQlM11A8T15 XBow== X-Forwarded-Encrypted: i=1; AJvYcCWu0iZUZbC5fOXwk6Xrz7AEK/aK2z0LE1xLm5MZwnIsiYTR+NaF6zJ9A37pUwjcTYi/igKGsh7J9CzTdyo=@vger.kernel.org X-Gm-Message-State: AOJu0YxAO0mAD1BUbaiBhi4FQ9MbFSzRxeCAMlbE/X0cXPAIWqYwQWry QLCQwlJCNITu7FWhx06XYrk9zsk6VH4/k2SRBQFjP0uMYZjzA9u3GiG70hkEbFtbrlvyFzzOFAr W2XwPNk3/Rcb5+NApt5R1joJ0QVyporJ495FrO6W3BxYGPoftY7IbgrYZAZg/GVS6IdA= X-Gm-Gg: AY/fxX5vvi0yzvt6YOdXU7WWVUcfhzFnrMkitudVE+hU/G/ZKG6GqfqcYpbS7mhJegK uYzFEuWARkqEwfhbYG2LtlBd7+F/a1ksfXcvkYmlzL4IpwEUDeQ940egKci1s2P9htuaR31VxtA rjoYjTBJYHGbjQ1s9Ed9nubJhJWvUunADlELMP8dXOjpgc8E8170OdHIiJPeWvTywfRGadiAYM8 Wvx4qCljFuZ5c9/r7iHfmABNiL13ssPoXO7/h9AfGeCh+hnMWFjlX2D92A0Uwiwa8AWb8HrxLOB xU1DSMIirgjtLUBU/PMuxzQ58jIDiWdj4N3wN2dNy8Tc0vd1+EpoDZcUFhskY+5YkLrM6UOM/rM uHgJyan8X4Fc/3T0jThh/0ieHJh4NQ/MVygbu4anFZVDOghk3SM7SGEanulcDok0= X-Received: by 2002:a17:903:3bad:b0:2a1:3ade:c351 with SMTP id d9443c01a7336-2a3ee41511cmr54527815ad.2.1767869087542; Thu, 08 Jan 2026 02:44:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpc/g1BOPk1bzcN24yJby/XQYHXCB9siaPmfawbd8NIOUuShpU+Y5E6VKaVqh0gWgtqd6Zyw== X-Received: by 2002:a17:903:3bad:b0:2a1:3ade:c351 with SMTP id d9443c01a7336-2a3ee41511cmr54527605ad.2.1767869087042; Thu, 08 Jan 2026 02:44:47 -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 d9443c01a7336-2a3e3c3ae21sm74364825ad.7.2026.01.08.02.44.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jan 2026 02:44:46 -0800 (PST) From: Baochen Qiang Date: Thu, 08 Jan 2026 18:44:34 +0800 Subject: [PATCH ath-current v2] 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-v2-1-33c0cca9d93f@oss.qualcomm.com> X-B4-Tracking: v=1; b=H4sIAJKKX2kC/32OzQ6CMBCEX4X07BK6/OrJ9zAcSmmlUai0hWAI7 +5KvBm9bDLZmW9mZV45ozw7RStzajbe2IEEHiImOzFcFZiWNMMEc468AhE6jjfQZgHt1AjBkmM BkUpdljpFjcgo/HCKLDv4wigDcnJODYHV9OyMD9Y999KZ75YP//iLP3Pg0DRtWhRpVrV5cbbex +Mk7tL2fUzn3UqUIuFJ9Z+CWV7RWiGS9ptSb9v2AhgC6nYWAQAA 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-Authority-Analysis: v=2.4 cv=M45A6iws c=1 sm=1 tr=0 ts=695f8aa0 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==: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=AXMgxrcyLYDzoHglUI4A:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-ORIG-GUID: 5jI23Za84qp8koHeUqKxz0wpy0i2smjq X-Proofpoint-GUID: 5jI23Za84qp8koHeUqKxz0wpy0i2smjq X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTA4MDA3MiBTYWx0ZWRfX4Ac6o86idkVK IhCfsh0iIaWYESo+V360L8pUIl7e6ArH8g3zXlnRrqVzyBuEnVUpVXTTDHalisBUmDrxgvRl082 NGqNcsXZN9R2W9zYX3zV3C7m8ZWdd4gSl8qDM+8Gd5+e8x13w7QhBJtknc56SVb46LAXsmyI4s3 omYiHMotkW7lfnGxuylM6jh9NMI57kKTqWUA4GA03MtgUYyrM3ypK0/j8fgmfDvgySyqSwBcQx/ JarL1a9fdxUidsVrc1eqvnsdPu/ywV2+NWCgCtRrDzGHoB1SEuHfY6fl7ESbDhzroorjMKsJhCF YHDQoGrxhpy0DsifJdt9hmmW2P3QTxbXGFI0qc/jisnrqS7d90VGQRs8ysO5uTsU+PjC8+KmseI 4ZQ8BLCxWuzdNOgP/ZpwBKoj2qjPoKMHz7RWwqDHu6ULJAF7F7sXYF8kwW/quFoBfAI606ph1yK MNXX0LOqv1+Kx5RuGLg== 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-08_02,2026-01-07_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 clxscore=1015 spamscore=0 malwarescore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601080072 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 --- Changes in v2: - change target branch to ath-current from ath-next - Link to v1: https://lore.kernel.org/r/20260108-ath12k-fix-freq-to-idx-v1-= 1-b2458cf7aa0d@oss.qualcomm.com --- 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 be8b2943094f..3ce5fcb0e460 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -6575,16 +6575,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: dbf8fe85a16a33d6b6bd01f2bc606fc017771465 change-id: 20251218-ath12k-fix-freq-to-idx-a3cf77f32f22 Best regards, --=20 Baochen Qiang