[PATCH 08/10] wifi: ath12k: handle ath12k_core_restart() with hardware grouping

Aditya Kumar Singh
2025-01-09T04:26:14Z

Currently, when ath12k_core_restart() is called and the ab->is_reset flag
is set, it invokes ieee80211_restart_hw() for all hardware in the same
group. However, other hardware might still be in the recovery process,
making this call inappropriate with grouping into picture.

To address this, add a condition to check if the group is ready. If the
group is not ready, do not call ieee80211_restart_hw().

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
drivers/net/wireless/ath/ath12k/core.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index b67ef79e62b3fbb5667cb627cf565998a35f3c49..0a9e35695f760799273eeba32b889375232eedc0 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -1394,12 +1394,22 @@ static void ath12k_core_restart(struct work_struct *work)
ath12k_dbg(ab, ATH12K_DBG_BOOT, "reset success\n");
}

+ mutex_lock(&ab->ag->mutex);
+
+ if (!ath12k_core_hw_group_start_ready(ab->ag)) {
+ mutex_unlock(&ab->ag->mutex);
+ goto exit_restart;
+ }
+
for (i = 0; i < ath12k_get_num_hw(ab); i++) {
ah = ath12k_ab_to_ah(ab, i);
ieee80211_restart_hw(ah->hw);
}
+
+ mutex_unlock(&ab->ag->mutex);
}

+exit_restart:
complete(&ab->restart_completed);
}

--
2.34.1