summarylogtreecommitdiffstats
path: root/0002-Revert-bus-mhi-core-Process-execution-environment-ch.patch
diff options
context:
space:
mode:
Diffstat (limited to '0002-Revert-bus-mhi-core-Process-execution-environment-ch.patch')
-rw-r--r--0002-Revert-bus-mhi-core-Process-execution-environment-ch.patch118
1 files changed, 118 insertions, 0 deletions
diff --git a/0002-Revert-bus-mhi-core-Process-execution-environment-ch.patch b/0002-Revert-bus-mhi-core-Process-execution-environment-ch.patch
new file mode 100644
index 00000000000..fb7ab212fd7
--- /dev/null
+++ b/0002-Revert-bus-mhi-core-Process-execution-environment-ch.patch
@@ -0,0 +1,118 @@
+From e3f30700184dbcf2378428ac3fac8a6fd889d8c2 Mon Sep 17 00:00:00 2001
+From: Steven Barrett <steven@liquorix.net>
+Date: Tue, 18 May 2021 11:35:29 -0500
+Subject: [PATCH 2/3] Revert "bus: mhi: core: Process execution environment
+ changes serially"
+
+Fix ath11k / QCA6390 initialization:
+https://bugzilla.kernel.org/show_bug.cgi?id=213055
+
+This reverts commit 29b9829718c5e9bd68fc1c652f5e0ba9b9a64fed.
+---
+ drivers/bus/mhi/core/main.c | 40 ++++++++++++++++++-------------------
+ drivers/bus/mhi/core/pm.c | 7 +++----
+ 2 files changed, 22 insertions(+), 25 deletions(-)
+
+diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c
+index 61c37b23dd71..bd71a2b6f984 100644
+--- a/drivers/bus/mhi/core/main.c
++++ b/drivers/bus/mhi/core/main.c
+@@ -444,7 +444,7 @@ irqreturn_t mhi_intvec_threaded_handler(int irq_number, void *priv)
+ struct device *dev = &mhi_cntrl->mhi_dev->dev;
+ enum mhi_state state = MHI_STATE_MAX;
+ enum mhi_pm_state pm_state = 0;
+- enum mhi_ee_type ee = MHI_EE_MAX;
++ enum mhi_ee_type ee = 0;
+
+ write_lock_irq(&mhi_cntrl->pm_lock);
+ if (!MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) {
+@@ -453,7 +453,8 @@ irqreturn_t mhi_intvec_threaded_handler(int irq_number, void *priv)
+ }
+
+ state = mhi_get_mhi_state(mhi_cntrl);
+- ee = mhi_get_exec_env(mhi_cntrl);
++ ee = mhi_cntrl->ee;
++ mhi_cntrl->ee = mhi_get_exec_env(mhi_cntrl);
+ dev_dbg(dev, "local ee:%s device ee:%s dev_state:%s\n",
+ TO_MHI_EXEC_STR(mhi_cntrl->ee), TO_MHI_EXEC_STR(ee),
+ TO_MHI_STATE_STR(state));
+@@ -465,30 +466,27 @@ irqreturn_t mhi_intvec_threaded_handler(int irq_number, void *priv)
+ }
+ write_unlock_irq(&mhi_cntrl->pm_lock);
+
+- if (pm_state != MHI_PM_SYS_ERR_DETECT || ee == mhi_cntrl->ee)
+- goto exit_intvec;
++ /* If device supports RDDM don't bother processing SYS error */
++ if (mhi_cntrl->rddm_image) {
++ /* host may be performing a device power down already */
++ if (!mhi_is_active(mhi_cntrl))
++ goto exit_intvec;
+
+- switch (ee) {
+- case MHI_EE_RDDM:
+- /* proceed if power down is not already in progress */
+- if (mhi_cntrl->rddm_image && mhi_is_active(mhi_cntrl)) {
++ if (mhi_cntrl->ee == MHI_EE_RDDM && mhi_cntrl->ee != ee) {
+ mhi_cntrl->status_cb(mhi_cntrl, MHI_CB_EE_RDDM);
+- mhi_cntrl->ee = ee;
+ wake_up_all(&mhi_cntrl->state_event);
+ }
+- break;
+- case MHI_EE_PBL:
+- case MHI_EE_EDL:
+- case MHI_EE_PTHRU:
+- mhi_cntrl->status_cb(mhi_cntrl, MHI_CB_FATAL_ERROR);
+- mhi_cntrl->ee = ee;
+- wake_up_all(&mhi_cntrl->state_event);
+- mhi_pm_sys_err_handler(mhi_cntrl);
+- break;
+- default:
++ goto exit_intvec;
++ }
++
++ if (pm_state == MHI_PM_SYS_ERR_DETECT) {
+ wake_up_all(&mhi_cntrl->state_event);
+- mhi_pm_sys_err_handler(mhi_cntrl);
+- break;
++
++ /* For fatal errors, we let controller decide next step */
++ if (MHI_IN_PBL(ee))
++ mhi_cntrl->status_cb(mhi_cntrl, MHI_CB_FATAL_ERROR);
++ else
++ mhi_pm_sys_err_handler(mhi_cntrl);
+ }
+
+ exit_intvec:
+diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c
+index 277704af7eb6..1edce7917b6b 100644
+--- a/drivers/bus/mhi/core/pm.c
++++ b/drivers/bus/mhi/core/pm.c
+@@ -377,22 +377,21 @@ static int mhi_pm_mission_mode_transition(struct mhi_controller *mhi_cntrl)
+ {
+ struct mhi_event *mhi_event;
+ struct device *dev = &mhi_cntrl->mhi_dev->dev;
+- enum mhi_ee_type ee = MHI_EE_MAX, current_ee = mhi_cntrl->ee;
++ enum mhi_ee_type current_ee = mhi_cntrl->ee;
+ int i, ret;
+
+ dev_dbg(dev, "Processing Mission Mode transition\n");
+
+ write_lock_irq(&mhi_cntrl->pm_lock);
+ if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state))
+- ee = mhi_get_exec_env(mhi_cntrl);
++ mhi_cntrl->ee = mhi_get_exec_env(mhi_cntrl);
+
+- if (!MHI_IN_MISSION_MODE(ee)) {
++ if (!MHI_IN_MISSION_MODE(mhi_cntrl->ee)) {
+ mhi_cntrl->pm_state = MHI_PM_LD_ERR_FATAL_DETECT;
+ write_unlock_irq(&mhi_cntrl->pm_lock);
+ wake_up_all(&mhi_cntrl->state_event);
+ return -EIO;
+ }
+- mhi_cntrl->ee = ee;
+ write_unlock_irq(&mhi_cntrl->pm_lock);
+
+ wake_up_all(&mhi_cntrl->state_event);
+--
+2.31.1
+