[PATCH 375/379][SRU][OEM-5.6] UBUNTU: SAUCE: ath11k: put target to wow state when suspend happens

You-Sheng Yang vicamo.yang at canonical.com
Wed Dec 23 08:51:48 UTC 2020


From: Carl Huang <cjhuang at codeaurora.org>

BugLink: https://bugs.launchpad.net/bugs/1879633

This change is to put QCA6390 to wow state instead of suspend state
when system suspend happens. It also disables CE irq and DP irq, and
then put MHI to suspend state.

When system resumes, driver resumes MHI firstly, then enables CE irq
and dp IRQ, and sends wow wakeup command to firmware.

Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1

Signed-off-by: Carl Huang <cjhuang at codeaurora.org>
Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
(backported from commit 0c214f7ebce5eadb589554611bb927517c7aa7ea
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git)
Signed-off-by: You-Sheng Yang <vicamo.yang at canonical.com>
---
 drivers/net/wireless/ath/ath11k/core.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index af1d1b1e097c..04bc4390b5cd 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -12,6 +12,7 @@
 #include "dp_rx.h"
 #include "debug.h"
 #include "hif.h"
+#include "wow.h"
 
 unsigned int ath11k_debug_mask;
 EXPORT_SYMBOL(ath11k_debug_mask);
@@ -952,21 +953,18 @@ int ath11k_core_suspend(struct ath11k_base *ab)
 	int ret = 0;
 
 	if (ab->hw_params.support_suspend) {
+		msleep(500);
 		ath11k_purge_rx_pktlog(ar, true);
+		ret = ath11k_wow_enable(ar);
+		if (ret)
+			return ret;
+
+		ath11k_purge_rx_pktlog(ar, false);
 		ath11k_ce_stop_shadow_timers(ab);
 		ath11k_dp_stop_shadow_timers(ab);
-		reinit_completion(&ar->target_suspend);
-		ath11k_wmi_pdev_suspend(ar, 1, 0);
-		ret = wait_for_completion_timeout(&ar->target_suspend, 3 * HZ);
-		if (ret == 0) {
-			ath11k_warn(ab,
-				    "timed out while waiting for suspend completion\n");
-			return -ETIMEDOUT;
-		} else if (!ar->target_suspend_ack) {
-			ath11k_warn(ab, "suspend failed\n");
-			return -EAGAIN;
-		}
-		ath11k_purge_rx_pktlog(ar, false);
+
+		ath11k_hif_irq_disable(ab);
+		ath11k_hif_ce_irq_disable(ab);
 		return ath11k_hif_suspend(ab);
 	}
 	return 0;
@@ -979,8 +977,10 @@ int ath11k_core_resume(struct ath11k_base *ab)
 
 	if (ab->hw_params.support_suspend) {
 		ath11k_hif_resume(ab);
+		ath11k_hif_ce_irq_enable(ab);
+		ath11k_hif_irq_enable(ab);
 		ath11k_enable_rx_pktlog(ar);
-		ath11k_wmi_pdev_resume(ab->pdevs[0].ar, 0);
+		ath11k_wow_wakeup(ar);
 	}
 
 	return 0;
-- 
2.29.2




More information about the kernel-team mailing list