Skip to content

Commit aa1a0e9

Browse files
Vivek PernamittaManivannan Sadhasivam
authored andcommitted
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 <[email protected]> [mani: reworded description] Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 12543f4 commit aa1a0e9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/bus/mhi/host/internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ enum mhi_pm_state {
170170
MHI_PM_IN_ERROR_STATE(pm_state))
171171
#define MHI_PM_IN_SUSPEND_STATE(pm_state) (pm_state & \
172172
(MHI_PM_M3_ENTER | MHI_PM_M3))
173+
#define MHI_PM_FATAL_ERROR(pm_state) ((pm_state == MHI_PM_FW_DL_ERR) || \
174+
(pm_state >= MHI_PM_SYS_ERR_FAIL))
173175

174176
#define NR_OF_CMD_RINGS 1
175177
#define CMD_EL_PER_RING 128

drivers/bus/mhi/host/pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ int mhi_sync_power_up(struct mhi_controller *mhi_cntrl)
12871287
mhi_cntrl->ready_timeout_ms : mhi_cntrl->timeout_ms;
12881288
wait_event_timeout(mhi_cntrl->state_event,
12891289
MHI_IN_MISSION_MODE(mhi_cntrl->ee) ||
1290-
MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state),
1290+
MHI_PM_FATAL_ERROR(mhi_cntrl->pm_state),
12911291
msecs_to_jiffies(timeout_ms));
12921292

12931293
ret = (MHI_IN_MISSION_MODE(mhi_cntrl->ee)) ? 0 : -ETIMEDOUT;

0 commit comments

Comments
 (0)