[PATCH ath12k-ng] wifi: ath12k: move firmware stats request outside of atomic context

Vasanthakumar Thiagarajan vasanthakumar.thiagarajan at oss.qualcomm.com
Tue Nov 18 20:30:51 PST 2025



On 11/19/2025 7:54 AM, Baochen Qiang wrote:
> In ath12k_mac_op_link_sta_statistics(), the atomic context scope
> introduced by dp_lock also covers firmware stats request. Since that
> request could block, below issue is hit:
> 
> BUG: sleeping function called from invalid context at kernel/locking/mutex.c:575
> in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 6866, name: iw
> preempt_count: 201, expected: 0
> RCU nest depth: 0, expected: 0
> 3 locks held by iw/6866:
>   #0:[...]
>   #1:[...]
>   #2: ffff9748f43230c8 (&dp->dp_lock){+.-.}-{3:3}, at:
> ath12k_mac_op_link_sta_statistics+0xc6/0x380 [ath12k]
> Preemption disabled at:
> [<ffffffffc0349656>] ath12k_mac_op_link_sta_statistics+0xc6/0x380 [ath12k]
> Call Trace:
>   <TASK>
>   show_stack
>   dump_stack_lvl
>   dump_stack
>   __might_resched.cold
>   __might_sleep
>   __mutex_lock
>   mutex_lock_nested
>   ath12k_mac_get_fw_stats
>   ath12k_mac_op_link_sta_statistics
>   </TASK>
> 
> Since firmware stats request doesn't require protection from dp_lock, move
> it outside to fix this issue.
> 
> While moving, also refine that code hunk to make function parameters get
> populated when really necessary.
> 
> 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 <baochen.qiang at oss.qualcomm.com>

Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan at oss.qualcomm.com>



More information about the ath12k mailing list