Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0eefd8b authored by Bhaumik Bhatt's avatar Bhaumik Bhatt
Browse files

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: default avatarBhaumik Bhatt <bbhatt@codeaurora.org>
parent cc96a973
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -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;
+3 −2
Original line number Diff line number Diff line
@@ -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,