mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-21 03:13:17 +00:00
75 lines
2.3 KiB
Diff
75 lines
2.3 KiB
Diff
From df6b1dc739077b7f5715bda8cb9dc068d9a0409b Mon Sep 17 00:00:00 2001
|
|
From: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
|
|
Date: Thu, 26 May 2022 12:55:35 +0530
|
|
Subject: [PATCH] ath12k: disable spectral scan during spectral deinit
|
|
|
|
Fix target assert during rmmod with spectral scan enabled.
|
|
Disable spectral scan during spectral deinit if spectral scan is enabled.
|
|
|
|
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
|
|
---
|
|
drivers/net/wireless/ath/ath12k/core.h | 1 -
|
|
drivers/net/wireless/ath/ath12k/mac.c | 6 +++++-
|
|
drivers/net/wireless/ath/ath12k/spectral.c | 17 +++++++++--------
|
|
3 files changed, 14 insertions(+), 10 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
|
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
|
@@ -6892,6 +6892,11 @@ static void ath12k_mac_op_remove_interfa
|
|
ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n",
|
|
arvif->vdev_id);
|
|
|
|
+ ret = ath12k_spectral_vif_stop(arvif);
|
|
+ if (ret)
|
|
+ ath12k_warn(ab, "failed to stop spectral for vdev %i: %d\n",
|
|
+ arvif->vdev_id, ret);
|
|
+
|
|
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
|
|
ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr);
|
|
if (ret)
|
|
--- a/drivers/net/wireless/ath/ath12k/spectral.c
|
|
+++ b/drivers/net/wireless/ath/ath12k/spectral.c
|
|
@@ -215,7 +215,10 @@ static int ath12k_spectral_scan_config(s
|
|
return -ENODEV;
|
|
|
|
arvif->spectral_enabled = (mode != ATH12K_SPECTRAL_DISABLED);
|
|
+
|
|
+ spin_lock_bh(&ar->spectral.lock);
|
|
ar->spectral.mode = mode;
|
|
+ spin_unlock_bh(&ar->spectral.lock);
|
|
|
|
ret = ath12k_wmi_vdev_spectral_enable(ar, arvif->vdev_id,
|
|
ATH12K_WMI_SPECTRAL_TRIGGER_CMD_CLEAR,
|
|
@@ -830,9 +833,6 @@ static inline void ath12k_spectral_ring_
|
|
{
|
|
struct ath12k_spectral *sp = &ar->spectral;
|
|
|
|
- if (!sp->enabled)
|
|
- return;
|
|
-
|
|
ath12k_dbring_srng_cleanup(ar, &sp->rx_ring);
|
|
ath12k_dbring_buf_cleanup(ar, &sp->rx_ring);
|
|
}
|
|
@@ -884,15 +884,16 @@ void ath12k_spectral_deinit(struct ath12
|
|
if (!sp->enabled)
|
|
continue;
|
|
|
|
- ath12k_spectral_debug_unregister(ar);
|
|
- ath12k_spectral_ring_free(ar);
|
|
+ mutex_lock(&ar->conf_mutex);
|
|
+ ath12k_spectral_scan_config(ar, ATH12K_SPECTRAL_DISABLED);
|
|
+ mutex_unlock(&ar->conf_mutex);
|
|
|
|
spin_lock_bh(&sp->lock);
|
|
-
|
|
- sp->mode = ATH12K_SPECTRAL_DISABLED;
|
|
sp->enabled = false;
|
|
-
|
|
spin_unlock_bh(&sp->lock);
|
|
+
|
|
+ ath12k_spectral_debug_unregister(ar);
|
|
+ ath12k_spectral_ring_free(ar);
|
|
}
|
|
}
|
|
|