RCU read lock is missing in ath12k_dp_tx_free_txbuf() before calling
ath12k_dp_to_pdev_dp(), causing below warning:
WARNING: suspicious RCU usage
-----------------------------
drivers/net/wireless/ath/ath12k/dp.h:653 ath12k dp to dp pdev called without rcu lock!
Call Trace:
show_stack
dump_stack_lvl
dump_stack
lockdep_rcu_suspicious.cold
ath12k_dp_tx_free_txbuf
ath12k_wifi7_dp_tx_completion_handler
ath12k_wifi7_dp_service_srng
ath12k_pci_ext_grp_napi_poll
[...]
Invoke guard(rcu) to fix it.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3
Signed-off-by: Baochen Qiang
---
drivers/net/wireless/ath/ath12k/dp_tx.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/dp_tx.c b/drivers/net/wireless/ath/ath12k/dp_tx.c
index 1d4444f3936f..c10da6195c9c 100644
--- a/drivers/net/wireless/ath/ath12k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_tx.c
@@ -194,8 +194,6 @@ void ath12k_dp_tx_free_txbuf(struct ath12k_dp *dp,
skb_cb = ATH12K_SKB_CB(msdu);
- dp_pdev = ath12k_dp_to_pdev_dp(dp, pdev_idx);
-
dma_unmap_single(dp->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
if (skb_cb->paddr_ext_desc) {
dma_unmap_single(dp->dev, skb_cb->paddr_ext_desc,
@@ -203,6 +201,10 @@ void ath12k_dp_tx_free_txbuf(struct ath12k_dp *dp,
dev_kfree_skb_any(desc_params->skb_ext_desc);
}
+ guard(rcu)();
+
+ dp_pdev = ath12k_dp_to_pdev_dp(dp, pdev_idx);
+
ieee80211_free_txskb(ath12k_pdev_dp_to_hw(dp_pdev), msdu);
if (atomic_dec_and_test(&dp_pdev->num_tx_pending))
---
base-commit: 7cd7392a07782b8ad4aa6360e4be1967af2eab04
change-id: 20251118-ath12k-fix-missing-rcu-lock-51484e258da9
Best regards,
--
Baochen Qiang