diff options
author | Vivek Pernamitta <quic_vpernami@quicinc.com> | 2025-09-12 18:18:09 +0530 |
---|---|---|
committer | Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> | 2025-09-19 11:24:45 +0530 |
commit | aa1a0e93ed21a06acb7ca9d4a4a9fce75ea53d0c (patch) | |
tree | 937a1c1606e17aa9856f63bc9db01a1e253e0391 | |
parent | 12543f4405887da9f3e401e708ca0ff796a7b866 (diff) |
bus: mhi: core: Improve mhi_sync_power_up handling for SYS_ERR state
Allow mhi_sync_power_up to handle SYS_ERR during power-up, reboot,
or recovery. This is to avoid premature exit when MHI_PM_IN_ERROR_STATE is
observed during above mentioned system states.
To achieve this, treat SYS_ERR as a valid state and let its handler process
the error and queue the next transition to Mission Mode instead of aborting
early.
Signed-off-by: Vivek Pernamitta <quic_vpernami@quicinc.com>
[mani: reworded description]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Link: https://patch.msgid.link/20250912-uevent_vdev_next-20250911-v4-5-fa2f6ccd301b@quicinc.com
-rw-r--r-- | drivers/bus/mhi/host/internal.h | 2 | ||||
-rw-r--r-- | drivers/bus/mhi/host/pm.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bus/mhi/host/internal.h b/drivers/bus/mhi/host/internal.h index d455f0bf0013..7937bb1f742c 100644 --- a/drivers/bus/mhi/host/internal.h +++ b/drivers/bus/mhi/host/internal.h @@ -170,6 +170,8 @@ enum mhi_pm_state { MHI_PM_IN_ERROR_STATE(pm_state)) #define MHI_PM_IN_SUSPEND_STATE(pm_state) (pm_state & \ (MHI_PM_M3_ENTER | MHI_PM_M3)) +#define MHI_PM_FATAL_ERROR(pm_state) ((pm_state == MHI_PM_FW_DL_ERR) || \ + (pm_state >= MHI_PM_SYS_ERR_FAIL)) #define NR_OF_CMD_RINGS 1 #define CMD_EL_PER_RING 128 diff --git a/drivers/bus/mhi/host/pm.c b/drivers/bus/mhi/host/pm.c index 9a5ca903d758..b4ef115189b5 100644 --- a/drivers/bus/mhi/host/pm.c +++ b/drivers/bus/mhi/host/pm.c @@ -1287,7 +1287,7 @@ int mhi_sync_power_up(struct mhi_controller *mhi_cntrl) mhi_cntrl->ready_timeout_ms : mhi_cntrl->timeout_ms; wait_event_timeout(mhi_cntrl->state_event, MHI_IN_MISSION_MODE(mhi_cntrl->ee) || - MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state), + MHI_PM_FATAL_ERROR(mhi_cntrl->pm_state), msecs_to_jiffies(timeout_ms)); ret = (MHI_IN_MISSION_MODE(mhi_cntrl->ee)) ? 0 : -ETIMEDOUT; |