]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wifi: ath12k: enforce vdev limit in ath12k_mac_vdev_create()
authorRameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Sun, 26 Oct 2025 18:22:53 +0000 (23:52 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:02:45 +0000 (14:02 +0100)
commit41b6231291750e2caa9550cf2728e04fed255bda
tree1ca6c103b41fe7e5c93b912c114b2d498ffe32ab
parent4f93750fa58861abee4318115ef0023c8d3ba0c0
wifi: ath12k: enforce vdev limit in ath12k_mac_vdev_create()

[ Upstream commit 448bf7b51426bcca54b5ac1ddd1045a36c9d1dea ]

Currently, vdev limit check is performed only in
ath12k_mac_assign_vif_to_vdev(). If the host has already created
maximum number of vdevs for the radio (ar) and a scan request
arrives for the same radio, ath12k_mac_initiate_hw_scan() attempts
to create a vdev without checking the limit, causing firmware asserts.

Centralize the vdev limit guard by moving the check into
ath12k_mac_vdev_create() so that all callers obey the limit.
While doing this, update the condition from
`num_created_vdevs > (TARGET_NUM_VDEVS(ab) - 1)` to
`num_created_vdevs >= TARGET_NUM_VDEVS(ab)` for clarity and to
eliminate unnecessary arithmetic.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1

Fixes: 0d6e6736ed9f ("wifi: ath12k: scan statemachine changes for single wiphy")
Fixes: 4938ba733ee2 ("wifi: ath12k: modify remain on channel for single wiphy")
Signed-off-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20251026182254.1399650-2-rameshkumar.sundaram@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath12k/mac.c