From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
To: Yu-Hsiang Tseng <asas1asas200@gmail.com>,
Jeff Johnson <jjohnson@kernel.org>,
ath12k@lists.infradead.org
Cc: Sriram R <quic_srirrama@quicinc.com>,
Rameshkumar Sundaram <quic_ramess@quicinc.com>,
Kalle Valo <kvalo@kernel.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH] wifi: ath12k: fix false positive RCU warning on PREEMPT_RT
Date: Tue, 21 Apr 2026 10:24:36 +0800 [thread overview]
Message-ID: <4cdf2e61-fe69-4168-9df7-55bb71585dfe@oss.qualcomm.com> (raw)
In-Reply-To: <20260420161049.695518-1-asas1asas200@gmail.com>
On 4/21/2026 12:10 AM, Yu-Hsiang Tseng wrote:
> ath12k_mac_get_arvif() asserts that the caller holds an RCU read lock:
>
> WARN_ON(!rcu_read_lock_any_held());
>
> On PREEMPT_RT kernels built with CONFIG_PROVE_RCU=n, this produces a
> false positive splat whenever firmware stats events are processed,
> even though the caller does hold the RCU read lock.
>
> Root cause:
>
> - On !PROVE_RCU, rcu_read_lock_any_held() is a static inline that
> returns !preemptible() as a proxy for "in an RCU read section".
>
> - On PREEMPT_RT, rcu_read_lock() does not disable preemption. A
> task can therefore be preemptible while legitimately holding an
> RCU read lock.
>
> - ath12k_wmi_tlv_rssi_chain_parse() holds the RCU read lock via
> guard(rcu)() before calling ath12k_mac_get_arvif(), so the
> warning is 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 the WARN_ON() with RCU_LOCKDEP_WARN(), which is gated on
> debug_lockdep_rcu_enabled() and therefore compiles out entirely
> when PROVE_RCU is disabled. PROVE_RCU kernels continue to get the
> full lockdep-based check.
>
> Fixes: 3dd2c68f206e ("wifi: ath12k: prepare vif data structure for MLO handling")
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3
> Signed-off-by: Yu-Hsiang Tseng <asas1asas200@gmail.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 fbdfe6424fd7..a772a5b6adc9 100644
> --- a/drivers/net/wireless/ath/ath12k/mac.c
> +++ b/drivers/net/wireless/ath/ath12k/mac.c
> @@ -788,7 +788,8 @@ struct ath12k_link_vif *ath12k_mac_get_arvif(struct ath12k *ar, u32 vdev_id)
>
> /* To use the arvif returned, caller must have held rcu read lock.
> */
> - WARN_ON(!rcu_read_lock_any_held());
> + RCU_LOCKDEP_WARN(!rcu_read_lock_any_held(),
> + "RCU read lock not held");
should the instance in ath12k_p2p_noa_update_vdev_iter() also need to be replaced?
> arvif_iter.vdev_id = vdev_id;
> arvif_iter.ar = ar;
>
next prev parent reply other threads:[~2026-04-21 2:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 16:10 [PATCH] wifi: ath12k: fix false positive RCU warning on PREEMPT_RT Yu-Hsiang Tseng
2026-04-21 2:24 ` Baochen Qiang [this message]
2026-04-21 17:25 ` [PATCH v2] wifi: ath12k: fix false positive RCU warnings " Yu-Hsiang Tseng
2026-04-21 17:32 ` Rameshkumar Sundaram
2026-04-21 21:27 ` Jeff Johnson
2026-04-22 13:33 ` Jeff Johnson
2026-04-22 18:29 ` 曾昱翔
2026-04-22 2:06 ` Baochen Qiang
2026-04-22 14:23 ` Sebastian Andrzej Siewior
2026-04-22 18:12 ` Yu-Hsiang Tseng
2026-04-21 17:37 ` [PATCH] wifi: ath12k: fix false positive RCU warning " Yu-Hsiang Tseng
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=4cdf2e61-fe69-4168-9df7-55bb71585dfe@oss.qualcomm.com \
--to=baochen.qiang@oss.qualcomm.com \
--cc=asas1asas200@gmail.com \
--cc=ath12k@lists.infradead.org \
--cc=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=jjohnson@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_ramess@quicinc.com \
--cc=quic_srirrama@quicinc.com \
--cc=rostedt@goodmis.org \
/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