diff mbox series

[ath-next,v2] wifi: ath12k: Abort scan before removing link interface to prevent duplicate deletion

Message ID 20250226113118.7626-1-quic_lingbok@quicinc.com (mailing list archive)
State New
Delegated to: Jeff Johnson
Headers show
Series [ath-next,v2] wifi: ath12k: Abort scan before removing link interface to prevent duplicate deletion | expand

Checks

Context Check Description
jmberg/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
jmberg/series_format success Single patches do not need cover letters
jmberg/tree_selection success Clearly marked for ath-next
jmberg/ynl success Generated files up to date; no warnings/errors; no diff in generated;
jmberg/build_32bit success Errors and warnings before: 1 this patch: 1
jmberg/build_allmodconfig_warn success Errors and warnings before: 1 this patch: 1
jmberg/build_clang success Errors and warnings before: 1 this patch: 1
jmberg/build_clang_rust success No Rust files in patch. Skipping build
jmberg/build_tools success No tools touched, skip
jmberg/check_selftest success No net selftest shell script
jmberg/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
jmberg/deprecated_api success None detected
jmberg/header_inline success No static functions without inline keyword in header files
jmberg/kdoc success Errors and warnings before: 0 this patch: 0
jmberg/source_inline success Was 0 now: 0
jmberg/verify_fixes success No Fixes tag
jmberg/verify_signedoff success Signed-off-by tag matches author and committer

Commit Message

Lingbo Kong Feb. 26, 2025, 11:31 a.m. UTC
Currently, when ath12k performs the remove link interface operation, if
there is an ongoing scan operation on the arvif, ath12k may execute the
remove link interface operation multiple times on the same arvif. This
occurs because, during the remove link operation, if a scan operation is
present on the arvif, ath12k may receive a WMI_SCAN_EVENT_COMPLETED event
from the firmware. Upon receiving this event, ath12k will continue to
execute the ath12k_scan_vdev_clean_work() function, performing the remove
link interface operation on the same arvif again.

To address this issue, before executing the remove link interface
operation, ath12k needs to check if there is an ongoing scan operation on
the current arvif. If such an operation exists, it should be aborted.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Lingbo Kong <quic_lingbok@quicinc.com>
---
1.rebase to ath-next

 drivers/net/wireless/ath/ath12k/mac.c | 5 +++++
 1 file changed, 5 insertions(+)


base-commit: e180a01bf2c4a67db13d70d2d91410a8c6f74be3
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 3e3afdc56fc9..551133483f44 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -9578,6 +9578,11 @@  ath12k_mac_op_unassign_vif_chanctx(struct ieee80211_hw *hw,
 	if (ahvif->vdev_type != WMI_VDEV_TYPE_MONITOR &&
 	    ar->num_started_vdevs == 1 && ar->monitor_vdev_created)
 		ath12k_mac_monitor_stop(ar);
+
+	if (ar->scan.arvif == arvif && ar->scan.state == ATH12K_SCAN_RUNNING) {
+		ath12k_scan_abort(ar);
+		ar->scan.arvif = NULL;
+	}
 }
 
 static int