summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJeffrey Hugo <jhugo@codeaurora.org>2020-05-01 00:35:51 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-05 16:58:35 +0200
commitce312258084ea0c828e11c831c7b9e8b42b02ef8 (patch)
tree00e3f895952437f577283a78097074228e011c95 /drivers
parent115f32512f13c0280161908e9de45a97a87673bb (diff)
downloadlwn-ce312258084ea0c828e11c831c7b9e8b42b02ef8.tar.gz
lwn-ce312258084ea0c828e11c831c7b9e8b42b02ef8.zip
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 <jhugo@codeaurora.org> Reviewed-by: Hemant Kumar <hemantk@codeaurora.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Link: https://lore.kernel.org/r/20200430190555.32741-3-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bus/mhi/core/pm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c
index 52690cb5c89c..dc83d65f7784 100644
--- a/drivers/bus/mhi/core/pm.c
+++ b/drivers/bus/mhi/core/pm.c
@@ -902,7 +902,11 @@ int mhi_sync_power_up(struct mhi_controller *mhi_cntrl)
MHI_PM_IN_ERROR_STATE(mhi_cntrl->pm_state),
msecs_to_jiffies(mhi_cntrl->timeout_ms));
- return (MHI_IN_MISSION_MODE(mhi_cntrl->ee)) ? 0 : -EIO;
+ ret = (MHI_IN_MISSION_MODE(mhi_cntrl->ee)) ? 0 : -ETIMEDOUT;
+ if (ret)
+ mhi_power_down(mhi_cntrl, false);
+
+ return ret;
}
EXPORT_SYMBOL(mhi_sync_power_up);