diff options
author | Bhaumik Bhatt <bbhatt@codeaurora.org> | 2021-02-10 18:17:19 -0800 |
---|---|---|
committer | Loic Poulain <loic.poulain@linaro.org> | 2021-02-17 18:31:58 +0100 |
commit | c59686f3febccfd3cb0bfec423d58e549b3cc1e4 (patch) | |
tree | 591152ac38f48ca6491bd56e7b0b0293511c4834 | |
parent | 1ce6e69d35390bbfe0adf27ef4d009ee1a8e54bc (diff) |
bus: mhi: core: Move to MHI READY and initiate M0 in corner cases
When moving from SYS_ERROR transition to a different execution
environment, MHI host relies on the BHI register read to spawn
the next image download or wait for READY -> M0 states. The
device can at times move the execution environment to mission
mode when a pass through is expected, which can result in a
stall. Initiate a wait for MHI READY and write M0 such that the
device can proceed with state change event updates for the new
execution environment being entered.
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
-rw-r--r-- | drivers/bus/mhi/core/pm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c index 0c7f113c8849..edd77947bff7 100644 --- a/drivers/bus/mhi/core/pm.c +++ b/drivers/bus/mhi/core/pm.c @@ -764,6 +764,14 @@ void mhi_pm_st_worker(struct work_struct *work) write_unlock_irq(&mhi_cntrl->pm_lock); if (MHI_IN_PBL(mhi_cntrl->ee)) mhi_fw_load_handler(mhi_cntrl); + /* Expected PTHRU but device already transitioned */ + else if (MHI_IN_MISSION_MODE(mhi_cntrl->ee)) { + dev_dbg(dev, + "Moved from %s to %s. Do READY->M0.\n", + TO_MHI_EXEC_STR(MHI_EE_PTHRU), + TO_MHI_EXEC_STR(mhi_cntrl->ee)); + mhi_ready_state_transition(mhi_cntrl); + } break; case DEV_ST_TRANSITION_SBL: write_lock_irq(&mhi_cntrl->pm_lock); |