mhi: core: move PM state to SYS_ERROR if the event arrives before RDDM

Allow a move to SYS_ERROR if its arrival precedes that of an
RDDM entry notification so that the core driver remains inactive
for that period in its anticipation.

Change-Id: I6222430f34528f8b5f4c3d3d544ebc359ed05708
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
This commit is contained in:
Bhaumik Bhatt 2020-07-09 15:20:11 -07:00
commit c0eefd8b51
2 changed files with 13 additions and 10 deletions

View file

@ -1207,19 +1207,21 @@ int mhi_process_ctrl_ev_ring(struct mhi_controller *mhi_cntrl,
enum MHI_PM_STATE new_state;
/*
* Don't process sys error if device support
* rddm since we will be processing rddm ee
* event instead of sys error state change event
* Allow move to SYS_ERROR even if RDDM is
* supported so that core driver is inactive
* with anticipation of an upcoming RDDM event
*/
if (mhi_cntrl->ee == MHI_EE_RDDM ||
mhi_cntrl->rddm_supported)
break;
MHI_ERR("MHI system error detected\n");
write_lock_irq(&mhi_cntrl->pm_lock);
/* skip if RDDM event was already processed */
if (mhi_cntrl->ee == MHI_EE_RDDM) {
write_unlock_irq(&mhi_cntrl->pm_lock);
break;
}
new_state = mhi_tryset_pm_state(mhi_cntrl,
MHI_PM_SYS_ERR_DETECT);
write_unlock_irq(&mhi_cntrl->pm_lock);
MHI_ERR("MHI system error detected\n");
if (new_state == MHI_PM_SYS_ERR_DETECT)
mhi_process_sys_err(mhi_cntrl);
break;

View file

@ -102,8 +102,9 @@ static struct mhi_pm_transitions const mhi_state_transitions[] = {
},
{
MHI_PM_SYS_ERR_DETECT,
MHI_PM_SYS_ERR_PROCESS | MHI_PM_SHUTDOWN_PROCESS |
MHI_PM_LD_ERR_FATAL_DETECT | MHI_PM_SHUTDOWN_NO_ACCESS
MHI_PM_DEVICE_ERR_DETECT | MHI_PM_SYS_ERR_PROCESS |
MHI_PM_SHUTDOWN_PROCESS | MHI_PM_LD_ERR_FATAL_DETECT |
MHI_PM_SHUTDOWN_NO_ACCESS
},
{
MHI_PM_SYS_ERR_PROCESS,