summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorQingtao Cao <qingtao.cao.au@gmail.com>2026-06-03 11:06:11 +1000
committerManivannan Sadhasivam <mani@kernel.org>2026-07-09 07:54:15 +0200
commit22568e8f13a42ab69b7d624741768cbf15dded74 (patch)
tree8fd374b859542c2c2864c5e8f1a0e01c24315dce /drivers
parentdc59e4fea9d83f03bad6bddf3fa2e52491777482 (diff)
downloadlinux-next-22568e8f13a42ab69b7d624741768cbf15dded74.tar.gz
linux-next-22568e8f13a42ab69b7d624741768cbf15dded74.zip
bus: mhi: core: Fix sys error transition latency
Bring forward the idea to fix the power down latency in mhi_pm_disable_transition() further to mhi_pm_sys_error_transition() so that the transition into system error (triggered by AT!RESET) in the modems won't have to return only after the timeout of up to 24 seconds. Once the device gets reset, there is no guarantee that it will send an interrupt to indicate the state transition. So polling is the sensible option here. Signed-off-by: Qingtao Cao <qingtao.cao.au@gmail.com> [mani: commit log] Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Reviewed-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com> Link: https://patch.msgid.link/20260603011333.3306102-2-qingtao.cao.au@gmail.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bus/mhi/host/pm.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/bus/mhi/host/pm.c b/drivers/bus/mhi/host/pm.c
index f799503c8f36..9d29f1591a45 100644
--- a/drivers/bus/mhi/host/pm.c
+++ b/drivers/bus/mhi/host/pm.c
@@ -651,21 +651,13 @@ static void mhi_pm_sys_error_transition(struct mhi_controller *mhi_cntrl)
/* Trigger MHI RESET so that the device will not access host memory */
if (reset_device) {
- u32 in_reset = -1;
- unsigned long timeout = msecs_to_jiffies(mhi_cntrl->timeout_ms);
-
dev_dbg(dev, "Triggering MHI Reset in device\n");
mhi_set_mhi_state(mhi_cntrl, MHI_STATE_RESET);
/* Wait for the reset bit to be cleared by the device */
- ret = wait_event_timeout(mhi_cntrl->state_event,
- mhi_read_reg_field(mhi_cntrl,
- mhi_cntrl->regs,
- MHICTRL,
- MHICTRL_RESET_MASK,
- &in_reset) ||
- !in_reset, timeout);
- if (!ret || in_reset) {
+ ret = mhi_poll_reg_field(mhi_cntrl, mhi_cntrl->regs, MHICTRL,
+ MHICTRL_RESET_MASK, 0, 25000, mhi_cntrl->timeout_ms);
+ if (ret) {
dev_err(dev, "Device failed to exit MHI Reset state\n");
write_lock_irq(&mhi_cntrl->pm_lock);
cur_state = mhi_tryset_pm_state(mhi_cntrl,