Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4580871a authored by Bhaumik Bhatt's avatar Bhaumik Bhatt
Browse files

mhi: core: Make sure to powerdown if mhi_sync_power_up fails



Power down is necessary if mhi_sync_power_up fails due to any
timeout, to clean up the resources. Otherwise, an assert could
be triggered when attempting to clean up MSIs because the IRQ is
still active from a request_irq(). Do not allow this for RDDM
supported controllers, as ramdump collection prior to powering
down maybe needed.

Change-Id: I7469e6ad190d21ed69bb2a03fde56c969a672fa3
Signed-off-by: default avatarBhaumik Bhatt <bbhatt@codeaurora.org>
parent 1fa28c49
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1129,7 +1129,13 @@ 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 : -ETIMEDOUT;
	if (!MHI_IN_MISSION_MODE(mhi_cntrl->ee)) {
		if (!mhi_cntrl->rddm_supported)
			mhi_power_down(mhi_cntrl, false);
		return -ETIMEDOUT;
	}

	return 0;
}
EXPORT_SYMBOL(mhi_sync_power_up);