Skip to content

Commit ce31225

Browse files
Jeffrey Hugogregkh
authored andcommitted
bus: mhi: core: Make sure to powerdown if mhi_sync_power_up fails
Powerdown is necessary if mhi_sync_power_up fails due to a timeout, to clean up the resources. Otherwise a BUG could be triggered when attempting to clean up MSIs because the IRQ is still active from a request_irq(). Signed-off-by: Jeffrey Hugo <[email protected]> Reviewed-by: Hemant Kumar <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 115f325 commit ce31225

File tree

1 file changed

+5
-1
lines changed
  • drivers/bus/mhi/core

1 file changed

+5
-1
lines changed

drivers/bus/mhi/core/pm.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,11 @@ int mhi_sync_power_up(struct mhi_controller *mhi_cntrl)
902902
MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state),
903903
msecs_to_jiffies(mhi_cntrl->timeout_ms));
904904

905-
return (MHI_IN_MISSION_MODE(mhi_cntrl->ee)) ? 0 : -EIO;
905+
ret = (MHI_IN_MISSION_MODE(mhi_cntrl->ee)) ? 0 : -ETIMEDOUT;
906+
if (ret)
907+
mhi_power_down(mhi_cntrl, false);
908+
909+
return ret;
906910
}
907911
EXPORT_SYMBOL(mhi_sync_power_up);
908912

0 commit comments

Comments
 (0)