mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-07-06 08:17:06 +08:00
96 lines
2.9 KiB
Diff
96 lines
2.9 KiB
Diff
From 3e80fcbca37221cd1e5a33eea4b0f215f66a7a00 Mon Sep 17 00:00:00 2001
|
|
From: Kalle Valo <quic_kvalo@quicinc.com>
|
|
Date: Tue, 5 Apr 2022 11:26:39 +0300
|
|
Subject: [PATCH] ath11k: mhi: add error handling for suspend and resume
|
|
|
|
While reviewing the mhi.c I noticed we were just ignoring the errors coming
|
|
from MHI subsystem during suspend and resume. Add proper checks and warning
|
|
messages. Also pass the error value to callers.
|
|
|
|
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2
|
|
|
|
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
|
Link: https://lore.kernel.org/r/20220401173042.17467-3-kvalo@kernel.org
|
|
---
|
|
drivers/net/wireless/ath/ath11k/mhi.c | 26 ++++++++++++++++++++++----
|
|
drivers/net/wireless/ath/ath11k/mhi.h | 4 ++--
|
|
drivers/net/wireless/ath/ath11k/pci.c | 8 ++------
|
|
3 files changed, 26 insertions(+), 12 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/ath/ath11k/mhi.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/mhi.c
|
|
@@ -491,16 +491,34 @@ void ath11k_mhi_stop(struct ath11k_pci *
|
|
mhi_unprepare_after_power_down(ab_pci->mhi_ctrl);
|
|
}
|
|
|
|
-void ath11k_mhi_suspend(struct ath11k_pci *ab_pci)
|
|
+int ath11k_mhi_suspend(struct ath11k_pci *ab_pci)
|
|
{
|
|
- mhi_pm_suspend(ab_pci->mhi_ctrl);
|
|
+ struct ath11k_base *ab = ab_pci->ab;
|
|
+ int ret;
|
|
+
|
|
+ ret = mhi_pm_suspend(ab_pci->mhi_ctrl);
|
|
+ if (ret) {
|
|
+ ath11k_warn(ab, "failed to suspend mhi: %d", ret);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
}
|
|
|
|
-void ath11k_mhi_resume(struct ath11k_pci *ab_pci)
|
|
+int ath11k_mhi_resume(struct ath11k_pci *ab_pci)
|
|
{
|
|
+ struct ath11k_base *ab = ab_pci->ab;
|
|
+ int ret;
|
|
+
|
|
/* Do force MHI resume as some devices like QCA6390, WCN6855
|
|
* are not in M3 state but they are functional. So just ignore
|
|
* the MHI state while resuming.
|
|
*/
|
|
- mhi_pm_resume_force(ab_pci->mhi_ctrl);
|
|
+ ret = mhi_pm_resume_force(ab_pci->mhi_ctrl);
|
|
+ if (ret) {
|
|
+ ath11k_warn(ab, "failed to resume mhi: %d", ret);
|
|
+ return ret;
|
|
+ }
|
|
+
|
|
+ return 0;
|
|
}
|
|
--- a/drivers/net/wireless/ath/ath11k/mhi.h
|
|
+++ b/drivers/net/wireless/ath/ath11k/mhi.h
|
|
@@ -23,7 +23,7 @@ void ath11k_mhi_unregister(struct ath11k
|
|
void ath11k_mhi_set_mhictrl_reset(struct ath11k_base *ab);
|
|
void ath11k_mhi_clear_vector(struct ath11k_base *ab);
|
|
|
|
-void ath11k_mhi_suspend(struct ath11k_pci *ar_pci);
|
|
-void ath11k_mhi_resume(struct ath11k_pci *ar_pci);
|
|
+int ath11k_mhi_suspend(struct ath11k_pci *ar_pci);
|
|
+int ath11k_mhi_resume(struct ath11k_pci *ar_pci);
|
|
|
|
#endif
|
|
--- a/drivers/net/wireless/ath/ath11k/pci.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/pci.c
|
|
@@ -619,18 +619,14 @@ static int ath11k_pci_hif_suspend(struct
|
|
{
|
|
struct ath11k_pci *ar_pci = ath11k_pci_priv(ab);
|
|
|
|
- ath11k_mhi_suspend(ar_pci);
|
|
-
|
|
- return 0;
|
|
+ return ath11k_mhi_suspend(ar_pci);
|
|
}
|
|
|
|
static int ath11k_pci_hif_resume(struct ath11k_base *ab)
|
|
{
|
|
struct ath11k_pci *ar_pci = ath11k_pci_priv(ab);
|
|
|
|
- ath11k_mhi_resume(ar_pci);
|
|
-
|
|
- return 0;
|
|
+ return ath11k_mhi_resume(ar_pci);
|
|
}
|
|
|
|
static void ath11k_pci_hif_ce_irq_enable(struct ath11k_base *ab)
|