wifi: ath12k: cancel scan only on active scan vdev
PATCH 1/1 wifi: ath12k: cancel scan only on active scan vdev
Cancel the scheduled scan request only on the vdev that has an active scan running. Currently, ahvif->links_map is used to obtain the links, but this includes links for which no scan is scheduled. In failure cases where the scan fails due to an invalid channel definition, other links which are not yet brought up (vdev not created) may also be accessed, leading to the following trace:
Unable to handle kernel paging request at virtual address 0000000000004c8c pc : _raw_spin_lock_bh+0x1c/0x54 lr : ath12k_scan_abort+0x20/0xc8 [ath12k] Call trace: _raw_spin_lock_bh+0x1c/0x54 (P) ath12k_mac_op_cancel_hw_scan+0xac/0xc4 [ath12k] ieee80211_scan_cancel+0xcc/0x12c [mac80211] ieee80211_do_stop+0x6c4/0x7a8 [mac80211] ieee80211_stop+0x60/0xd8 [mac80211]
Skip links that are not created or are not the current scan vdev. This ensures only the scan for the matching links is aborted and avoids aborting unrelated links during cancellation, thus aligning with how start/cleanup manage ar->scan.arvif.
Also, remove the redundant arvif->is_started check from ath12k_mac_op_cancel_hw_scan() that was introduced in commit 3863f014ad23 ("wifi: ath12k: symmetrize scan vdev creation and deletion during HW scan") to avoid deleting the scan interface if the scan is triggered on the existing AP vdev as this use case is already handled in ath12k_scan_vdev_clean_work().
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath12k/mac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/mac.c +2 -1
@@ -5606,7 +5606,8 @@ void ath12k_mac_op_cancel_hw_scan(struct ieee80211_hw *hw,for_each_set_bit (link_id, &links_map,ATH12K_NUM_MAX_LINKS ) { arvif =wiphy_dereference (hw->wiphy, ahvif->link[link_id]); -if (!arvif || arvif->is_started) +if (!arvif || !arvif->is_created || + arvif->ar->scan.arvif != arvif)continue ; ar = arvif->ar;
---
base-commit: 631ee338f04db713ba611883f28e94157ebb68e5
change-id: 20260106-scan_vdev-94d8cf5a667e
Quoted 30 lines · Manish Dharanenthiran
Cancel the scheduled scan request only on the vdev that has an active scan running. Currently,
ahvif->links_mapis used to obtain the links, but this includes links for which no scan is scheduled. In failure cases where the scan fails due to an invalid channel definition, other links which are not yet brought up (vdev not created) may also be accessed, leading to the following trace:Unable to handle kernel paging request at virtual address 0000000000004c8c pc : _raw_spin_lock_bh+0x1c/0x54 lr : ath12k_scan_abort+0x20/0xc8 [ath12k] Call trace: _raw_spin_lock_bh+0x1c/0x54 (P) ath12k_mac_op_cancel_hw_scan+0xac/0xc4 [ath12k] ieee80211_scan_cancel+0xcc/0x12c [mac80211] ieee80211_do_stop+0x6c4/0x7a8 [mac80211] ieee80211_stop+0x60/0xd8 [mac80211]Skip links that are not created or are not the current scan vdev. This ensures only the scan for the matching links is aborted and avoids aborting unrelated links during cancellation, thus aligning with how start/cleanup manage
ar->scan.arvif.Also, remove the redundant
arvif->is_startedcheck fromath12k_mac_op_cancel_hw_scan()that was introduced in commit3863f014ad23("wifi: ath12k: symmetrize scan vdev creation and deletion during HW scan") to avoid deleting the scan interface if the scan is triggered on the existing AP vdev as this use case is already handled inath12k_scan_vdev_clean_work().
Quoted 4 lines
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
Fixes feed05f1526e ("wifi: ath12k: Split scan request for split band device")Signed-off-by Manish Dharanenthiran <[email protected]>
Quoted 54 lines · Manish Dharanenthiran
Cancel the scheduled scan request only on the vdev that has an active scan running. Currently,
ahvif->links_mapis used to obtain the links, but this includes links for which no scan is scheduled. In failure cases where the scan fails due to an invalid channel definition, other links which are not yet brought up (vdev not created) may also be accessed, leading to the following trace:Unable to handle kernel paging request at virtual address 0000000000004c8c pc : _raw_spin_lock_bh+0x1c/0x54 lr : ath12k_scan_abort+0x20/0xc8 [ath12k] Call trace: _raw_spin_lock_bh+0x1c/0x54 (P) ath12k_mac_op_cancel_hw_scan+0xac/0xc4 [ath12k] ieee80211_scan_cancel+0xcc/0x12c [mac80211] ieee80211_do_stop+0x6c4/0x7a8 [mac80211] ieee80211_stop+0x60/0xd8 [mac80211]Skip links that are not created or are not the current scan vdev. This ensures only the scan for the matching links is aborted and avoids aborting unrelated links during cancellation, thus aligning with how start/cleanup manage
ar->scan.arvif.Also, remove the redundant
arvif->is_startedcheck fromath12k_mac_op_cancel_hw_scan()that was introduced in commit3863f014ad23("wifi: ath12k: symmetrize scan vdev creation and deletion during HW scan") to avoid deleting the scan interface if the scan is triggered on the existing AP vdev as this use case is already handled inath12k_scan_vdev_clean_work().Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
Fixes feed05f1526e ("wifi: ath12k: Split scan request for split band device")Signed-off-by Manish Dharanenthiran <[email protected]>--- drivers/net/wireless/ath/ath12k/mac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/wireless/ath/ath12k/mac.c +2
-2@@ -5606,7 +5606,8 @@ void ath12k_mac_op_cancel_hw_scan(struct ieee80211_hw *hw,for_each_set_bit (link_id, &links_map,ATH12K_NUM_MAX_LINKS ) { arvif =wiphy_dereference (hw->wiphy, ahvif->link[link_id]); -if (!arvif || arvif->is_started) +if (!arvif || !arvif->is_created || + arvif->ar->scan.arvif != arvif)continue ; ar = arvif->ar; ---
Quoted 4 lines
base-commit:
631ee338f04db713ba611883f28e94157ebb68e5
change-id: 20260106-scan_vdev-94d8cf5a667e
Quoted 30 lines · Manish Dharanenthiran
Cancel the scheduled scan request only on the vdev that has an active scan running. Currently,
ahvif->links_mapis used to obtain the links, but this includes links for which no scan is scheduled. In failure cases where the scan fails due to an invalid channel definition, other links which are not yet brought up (vdev not created) may also be accessed, leading to the following trace:Unable to handle kernel paging request at virtual address 0000000000004c8c pc : _raw_spin_lock_bh+0x1c/0x54 lr : ath12k_scan_abort+0x20/0xc8 [ath12k] Call trace: _raw_spin_lock_bh+0x1c/0x54 (P) ath12k_mac_op_cancel_hw_scan+0xac/0xc4 [ath12k] ieee80211_scan_cancel+0xcc/0x12c [mac80211] ieee80211_do_stop+0x6c4/0x7a8 [mac80211] ieee80211_stop+0x60/0xd8 [mac80211]Skip links that are not created or are not the current scan vdev. This ensures only the scan for the matching links is aborted and avoids aborting unrelated links during cancellation, thus aligning with how start/cleanup manage
ar->scan.arvif.Also, remove the redundant
arvif->is_startedcheck fromath12k_mac_op_cancel_hw_scan()that was introduced in commit3863f014ad23("wifi: ath12k: symmetrize scan vdev creation and deletion during HW scan") to avoid deleting the scan interface if the scan is triggered on the existing AP vdev as this use case is already handled inath12k_scan_vdev_clean_work().
Quoted 4 lines
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
Fixes feed05f1526e ("wifi: ath12k: Split scan request for split band device")Signed-off-by Manish Dharanenthiran <[email protected]>
Since this fixes an issue in released kernels I'm taking this through the ath-current branch.
/jeff
Jeff Johnson
AppliedQuoted 8 lines · Manish Dharanenthiran
Cancel the scheduled scan request only on the vdev that has an active scan running. Currently,
ahvif->links_mapis used to obtain the links, but this includes links for which no scan is scheduled. In failure cases where the scan fails due to an invalid channel definition, other links which are not yet brought up (vdev not created) may also be accessed, leading to the following trace:[...]
Applied, thanks!
[1/1] wifi: ath12k: cancel scan only on active scan vdev
commit: 39c90b1a1dbe6d7c49d19da6e5aec00980c55d8b
Best regards,
Signature · 1 line
Jeff Johnson <[email protected]>