The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <stable@xxxxxxxxxxxxxxx>. To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x cabce92dd805945a090dc6fc73b001bb35ed083a # <resolve conflicts, build, test, etc.> git commit -s git send-email --to '<stable@xxxxxxxxxxxxxxx>' --in-reply-to '2023091350-mahogany-jump-02dd@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: cabce92dd805 ("bus: mhi: host: Skip MHI reset if device is in RDDM") a0f5a630668c ("bus: mhi: Move host MHI code to "host" directory") 44b1eba44dc5 ("bus: mhi: core: Fix power down latency") a03c7a86e127 ("bus: mhi: core: Mark and maintain device states early on after power down") 556bbb442bbb ("bus: mhi: core: Separate system error and power down handling") 855a70c12021 ("bus: mhi: Add MHI PCI support for WWAN modems") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From cabce92dd805945a090dc6fc73b001bb35ed083a Mon Sep 17 00:00:00 2001 From: Qiang Yu <quic_qianyu@xxxxxxxxxxx> Date: Thu, 18 May 2023 14:22:39 +0800 Subject: [PATCH] bus: 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. Cc: <stable@xxxxxxxxxxxxxxx> Fixes: a6e2e3522f29 ("bus: mhi: core: Add support for PM state transitions") Signed-off-by: Qiang Yu <quic_qianyu@xxxxxxxxxxx> Reviewed-by: Jeffrey Hugo <quic_jhugo@xxxxxxxxxxx> Reviewed-by: Manivannan Sadhasivam <mani@xxxxxxxxxx> Link: https://lore.kernel.org/r/1684390959-17836-1-git-send-email-quic_qianyu@xxxxxxxxxxx Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx> diff --git a/drivers/bus/mhi/host/pm.c b/drivers/bus/mhi/host/pm.c index 083459028a4b..8a4362d75fc4 100644 --- a/drivers/bus/mhi/host/pm.c +++ b/drivers/bus/mhi/host/pm.c @@ -470,6 +470,10 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl) /* Trigger MHI RESET so that the device will not access host memory */ if (!MHI_PM_IN_FATAL_STATE(mhi_cntrl->pm_state)) { + /* Skip MHI RESET if in RDDM state */ + if (mhi_cntrl->rddm_image && mhi_get_exec_env(mhi_cntrl) == MHI_EE_RDDM) + goto skip_mhi_reset; + dev_dbg(dev, "Triggering MHI Reset in device\n"); mhi_set_mhi_state(mhi_cntrl, MHI_STATE_RESET); @@ -495,6 +499,7 @@ static void mhi_pm_disable_transition(struct mhi_controller *mhi_cntrl) } } +skip_mhi_reset: dev_dbg(dev, "Waiting for all pending event ring processing to complete\n"); mhi_event = mhi_cntrl->mhi_event;