From nobody Wed Jun 17 05:13:08 2026 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E620E3C4557 for ; Wed, 22 Apr 2026 18:08:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776881310; cv=none; b=B5tyyDLHCZx3q3jILmpwDHAyNSesWV4xKlH67jfHa17/ROxKwi3P5qYGlAsH569f9br76jZjNFTNhWJI0LmyceaKAHPgLHhVmwphPOo6HKtNPWX2dlNtKiCGg8ZnEb8jEjl8g5LfGtMOVE+07dehT7AJiqKpBFGpKfKlJXHtPVA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776881310; c=relaxed/simple; bh=xR4VS+ANUEtgHiWt6wIQMm1UNiZmGqAkBG+YFkQwadw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=soCCNC93qxyvdr29NjdWzk74DXO9B1a16kK/9chq14T2te4at5FwvTdmuCF8oVBVJcfR/OxR0yyDu4m6vibG5D0qF/r4ZAkbfyMD7IR5O73dGavNjWJGNopZ0IdEKqSkFTBkdNNOeRa1crXVpgi6kj2Rmv4lgMOQ46Y+U2Li7rc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Nu813LOc; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Nu813LOc" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-362bb3260f1so1636053a91.2 for ; Wed, 22 Apr 2026 11:08:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776881308; x=1777486108; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dXm+cvPf8Xjp+Os3ArHn258/YE9KQwcLs3zxc5vFNZA=; b=Nu813LOcq1cmlfyUoC4f2ShjMT6BCw7VjRhoWIiy/5xkOWis6ezl96IXXsZX1LmtiK FSfi01BqP8w7VboNuwvplhvNUO1rgYuCGB/1ztiETrtTRRzbypYlyXy7aPliqXL0Zw/E YVhuUfpT6DZeVsywsVTYpv+1FWL2UKXtGYQXeAWf2VjKXcCqSeRXLxdCy2YiCL2RFeHe b46h7Bz0lz4Bz0uA2WEUnV5cuD1Di81mLSBrZ8B0L2a2p7TD1Ij0G17oLjEiiZRJticW 7zhmu0GnfOSUSIOhfUCTUop2B83zUSB1rFEMQqmUBzwPN7z73lBzXuHXbHZ/QqZhUm7i jdwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776881308; x=1777486108; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dXm+cvPf8Xjp+Os3ArHn258/YE9KQwcLs3zxc5vFNZA=; b=RkO8mT8H6cIHtB0sU9kUtRyUVuDaM/7JUZWqAfP643GKxesoW8MkcmOFPMxk4r5Ifz kqSqEWIEcHJr6nhyD78WI6BDXVeOIX8yXMDbpeZbi7SQV620LIrXwXXga+OhwDnNJfx6 440jpznys/Q/NxexJGFuJ0ORy0NL/k7nzWLo5IkJ4pTYE0LursCG32pP/kiHSt9lF+1t o0TkFWxLgjRdoX5sxSVLipNr5hJG1rowdWNqKHuCo1bZD4FWKb/G604qHeWuu466k57C VExNJDbMRpWdampNp1h9duEOZtBED+y+58Zb8ARlQnR0Tnp5xeIJYHh7NIgGlVz1COn2 qLuQ== X-Forwarded-Encrypted: i=1; AFNElJ8+pvQxmGW3UbojH0UvpDumaT4FyKQtJtqF14a/EjBNxBLqqXAxZeOJ4wL5GaLzhwC1pbR7nHbyZY4v9Hk=@vger.kernel.org X-Gm-Message-State: AOJu0YxvY0LBYPj8cwnlP2KhSucWZ07hMBVcJddHtWJzeu9nlICrPI/y otTQVH2jmDPeb3nDT56mXwUhbQRtSWw8ZvCcdbA+2tVpWPmGC/timZG5 X-Gm-Gg: AeBDietP+nX8a6EpIVZWIgCI+p9KGLoK6dhUCqBRQAQWSeB+GT92KpiG4oCfGSaYggM he+h9A9RqhdyCejQgs11c9nU0+GHDTgU+WXaRGfcvPKKYI5y6UA/Tp3zLtSkWqvrzH7+ciklNWf FExyUcwDYCRK8lOL+atcwvTnFTPlvOuww9mheyuxNP9p881cOtgYArq9d2j3DSmjkgGY8lmdlBN NbJlE17997HtTH3fjQujZHhrXIBxvIsKaOGxj07ZzjBkYuzyq7t89ED7YC4yugbTttywn16t+ym pM1d0amjTQJb888rPNKpSKnA6EmyUXbfHHX7wapapnWgigobpozfazoVju8luOEvxUad37LO+jg Zk6iYGDB+lLZzXe8eVCctURHIz7Ew0dqoN44KsNq91YCCdoGeX6UToQv1cToR+nAPY536IdNldn 4oGS0/iVuC3Q7GSWEVQq00Y0epCUJFmPiRp3YrdUulP7anq2laLhDeheYQcjf6P9jaZU8BOXm7s KGQjg== X-Received: by 2002:a17:90a:e704:b0:35f:b1ad:fdfc with SMTP id 98e67ed59e1d1-361404b0aaemr22056621a91.27.1776881308057; Wed, 22 Apr 2026 11:08:28 -0700 (PDT) Received: from lenovo.localdomain (211-23-53-87.hinet-ip.hinet.net. [211.23.53.87]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b5fab3a929sm166137985ad.72.2026.04.22.11.08.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2026 11:08:27 -0700 (PDT) From: Yu-Hsiang Tseng To: Jeff Johnson , ath12k@lists.infradead.org Cc: Baochen Qiang , Rameshkumar Sundaram , Kalle Valo , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev Subject: [PATCH v3] wifi: ath12k: use lockdep_assert_in_rcu_read_lock() for RCU assertions Date: Thu, 23 Apr 2026 02:08:14 +0800 Message-ID: <20260422180814.1938317-1-asas1asas200@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Two functions in ath12k assert that the caller holds an RCU read lock: ath12k_mac_get_arvif() and ath12k_p2p_noa_update_vdev_iter(). Both use: WARN_ON(!rcu_read_lock_any_held()); On kernels using preemptible RCU (CONFIG_PREEMPT=3Dy or CONFIG_PREEMPT_RT= =3Dy) without CONFIG_DEBUG_LOCK_ALLOC, this produces a false positive splat whenever these functions are invoked from paths that do hold the RCU read lock (e.g. firmware stats processing or mac80211 interface iteration). Root cause: - Without CONFIG_DEBUG_LOCK_ALLOC, rcu_read_lock_any_held() is a static inline that returns !preemptible() as a proxy for "in an RCU read section". - With preemptible RCU, rcu_read_lock() does not disable preemption. A task can therefore be preemptible while legitimately holding an RCU read lock, making the proxy unreliable. - Callers such as ath12k_wmi_tlv_rssi_chain_parse() (via guard(rcu)()) and ieee80211_iterate_active_interfaces_atomic() do hold the RCU read lock, so these warnings are incorrect. Typical splat seen on a WCN7850 station with periodic fw stats processing: WARNING: drivers/net/wireless/ath/ath12k/mac.c:791 at ath12k_mac_get_arvif+0x9e/0xd0 [ath12k] Tainted: G W O 6.19.13-rt #1 PREEMPT_RT Call Trace: ath12k_wmi_tlv_rssi_chain_parse+0x69/0x170 [ath12k] ath12k_wmi_tlv_iter+0x7f/0x120 [ath12k] ath12k_wmi_tlv_fw_stats_parse+0x342/0x6b0 [ath12k] ath12k_wmi_op_rx+0xe9e/0x3150 [ath12k] ath12k_htc_rx_completion_handler+0x3df/0x5b0 [ath12k] ath12k_ce_per_engine_service+0x325/0x3e0 [ath12k] ath12k_pci_ce_workqueue+0x20/0x40 [ath12k] Replace WARN_ON(!rcu_read_lock_any_held()) with lockdep_assert_in_rcu_read_lock(), which is gated on CONFIG_PROVE_RCU and therefore compiles out entirely when PROVE_RCU is disabled. PROVE_RCU kernels continue to get the full lockdep-based check, and the new helper precisely checks for rcu_read_lock() rather than any RCU variant, which better matches the callers' expectations. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SIL= ICONZ-1.115823.3 Fixes: 3dd2c68f206e ("wifi: ath12k: prepare vif data structure for MLO hand= ling") Suggested-by: Baochen Qiang Suggested-by: Sebastian Andrzej Siewior Reviewed-by: Baochen Qiang Reviewed-by: Rameshkumar Sundaram Signed-off-by: Yu-Hsiang Tseng Reviewed-by: Sebastian Andrzej Siewior --- Changes in v3: - Use lockdep_assert_in_rcu_read_lock() instead of RCU_LOCKDEP_WARN() for clearer intent and more precise semantics (suggested by Sebastian Andrzej Siewior) - Reword commit message: this affects preemptible RCU in general, not only PREEMPT_RT - Move Tested-on before the official tags per ath convention Changes in v2: - Also fix the same WARN_ON() in ath12k_p2p_noa_update_vdev_iter() (suggested by Baochen Qiang) - Update commit message to cover both call sites Link to v1: https://lore.kernel.org/ath12k/20260420161049.695518-1-asas1asa= s200@gmail.com/ Link to v2: https://lore.kernel.org/ath12k/20260421172500.1050754-1-asas1as= as200@gmail.com/ drivers/net/wireless/ath/ath12k/mac.c | 2 +- drivers/net/wireless/ath/ath12k/p2p.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/a= th/ath12k/mac.c index fbdfe6424fd7..df2334f3bad6 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -788,7 +788,7 @@ struct ath12k_link_vif *ath12k_mac_get_arvif(struct ath= 12k *ar, u32 vdev_id) =20 /* To use the arvif returned, caller must have held rcu read lock. */ - WARN_ON(!rcu_read_lock_any_held()); + lockdep_assert_in_rcu_read_lock(); arvif_iter.vdev_id =3D vdev_id; arvif_iter.ar =3D ar; =20 diff --git a/drivers/net/wireless/ath/ath12k/p2p.c b/drivers/net/wireless/a= th/ath12k/p2p.c index 59589748f1a8..19ebcd1d8eb2 100644 --- a/drivers/net/wireless/ath/ath12k/p2p.c +++ b/drivers/net/wireless/ath/ath12k/p2p.c @@ -123,7 +123,7 @@ static void ath12k_p2p_noa_update_vdev_iter(void *data,= u8 *mac, struct ath12k_p2p_noa_arg *arg =3D data; struct ath12k_link_vif *arvif; =20 - WARN_ON(!rcu_read_lock_any_held()); + lockdep_assert_in_rcu_read_lock(); arvif =3D &ahvif->deflink; if (!arvif->is_created || arvif->ar !=3D arg->ar || arvif->vdev_id !=3D a= rg->vdev_id) return; --=20 2.53.0