summaryrefslogtreecommitdiff
path: root/drivers/bus/mhi/core/pm.c
diff options
context:
space:
mode:
authorJeffrey Hugo <jhugo@codeaurora.org>2021-02-12 14:27:23 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-11 14:47:11 +0200
commit542fd3e4fde61b8f911c1e999f1c721f03ca0927 (patch)
tree9b312efb8158d8ee9354c0dfecbc6a6d554a664b /drivers/bus/mhi/core/pm.c
parentf53a3a4808625f876aebc5a0bfb354480bbf0c21 (diff)
bus: mhi: core: Fix check for syserr at power_up
commit 6403298c58d4858d93648f553abf0bcbd2dfaca2 upstream. The check to see if we have reset the device after detecting syserr at power_up is inverted. wait_for_event_timeout() returns 0 on failure, and a positive value on success. The check is looking for non-zero as a failure, which is likely to incorrectly cause a device init failure if syserr was detected at power_up. Fix this. Fixes: e18d4e9fa79b ("bus: mhi: core: Handle syserr during power_up") Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org> Reviewed-by: Loic Poulain <loic.poulain@linaro.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Link: https://lore.kernel.org/r/1613165243-23359-1-git-send-email-jhugo@codeaurora.org Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/bus/mhi/core/pm.c')
-rw-r--r--drivers/bus/mhi/core/pm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c
index 3de7b1639ec6..ce2aafe33d53 100644
--- a/drivers/bus/mhi/core/pm.c
+++ b/drivers/bus/mhi/core/pm.c
@@ -992,7 +992,7 @@ int mhi_async_power_up(struct mhi_controller *mhi_cntrl)
&val) ||
!val,
msecs_to_jiffies(mhi_cntrl->timeout_ms));
- if (ret) {
+ if (!ret) {
ret = -EIO;
dev_info(dev, "Failed to reset MHI due to syserr state\n");
goto error_bhi_offset;