From 5a1870bb6baddcd455329f190cbcf03244b99739 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Wed, 15 Jun 2022 16:01:20 -0700 Subject: [PATCH] mhi: host: Skip MHI reset if device is in RDDM In RDDM EE, device can not process MHI reset issued by host. In case of MHI power off, host is issuing MHI reset and polls for it to get cleared until it times out. Since this timeout can not be avoided in case of RDDM, skip the MHI reset in this scenarios. Change-Id: Ide4311ba8705861179bfbfef650f00fa0f97c062 Signed-off-by: Hemant Kumar Signed-off-by: Lazarus Motha --- drivers/bus/mhi/host/pm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/bus/mhi/host/pm.c b/drivers/bus/mhi/host/pm.c index 9755f9fe0667..78c2b483080a 100644 --- a/drivers/bus/mhi/host/pm.c +++ b/drivers/bus/mhi/host/pm.c @@ -473,8 +473,13 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl) mutex_lock(&mhi_cntrl->pm_mutex); - /* Trigger MHI RESET so that the device will not access host memory */ - if (!MHI_PM_IN_FATAL_STATE(mhi_cntrl->pm_state)) { + /* + * Trigger MHI RESET so that the device will not access host memory. + * skip MHI reset if device is in RDDM. + */ + if ((!MHI_PM_IN_FATAL_STATE(mhi_cntrl->pm_state)) && + (mhi_cntrl->rddm_image && + mhi_get_exec_env(mhi_cntrl) != MHI_EE_RDDM)) { dev_dbg(dev, "Triggering MHI Reset in device\n"); mhi_set_mhi_state(mhi_cntrl, MHI_STATE_RESET);