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

Commit e2bb50da authored by Bhaumik Bhatt's avatar Bhaumik Bhatt
Browse files

mhi: core: Move power down check within the RDDM image support



If a controller supports RDDM, there is no need to process a SYS_ERROR.
Hence, we can safely move the power down state check to reside within an
RDDM supported controller as it allows for other controllers to handle
scenarios such as receiving an early SYS_ERROR when in the PBL execution
environment.

Change-Id: I5c63a861b9dd178f5c967bdf252da9c47d3a2b56
Signed-off-by: default avatarBhaumik Bhatt <bbhatt@codeaurora.org>
parent 20aba7d1
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -1638,20 +1638,20 @@ irqreturn_t mhi_intvec_threaded_handlr(int irq_number, void *dev)
		TO_MHI_EXEC_STR(ee),
		TO_MHI_STATE_STR(state));

	if (mhi_cntrl->power_down) {
		write_unlock_irq(&mhi_cntrl->pm_lock);
		goto exit_intvec;
	}

	if (state == MHI_STATE_SYS_ERR) {
		MHI_ERR("MHI system error detected\n");
		pm_state = mhi_tryset_pm_state(mhi_cntrl,
					       MHI_PM_SYS_ERR_DETECT);
	}

	if (mhi_cntrl->rddm_supported) {
		/* exit as power down is already initiated */
		if (mhi_cntrl->power_down || ee != MHI_EE_RDDM) {
			write_unlock_irq(&mhi_cntrl->pm_lock);
			goto exit_intvec;
		}

	if (ee == MHI_EE_RDDM) {
		write_lock_irq(&mhi_cntrl->pm_lock);
		/* prevent multiple entries for RDDM execution environment */
		if (mhi_cntrl->ee == MHI_EE_RDDM) {
			write_unlock_irq(&mhi_cntrl->pm_lock);
			goto exit_intvec;
@@ -1670,6 +1670,8 @@ irqreturn_t mhi_intvec_threaded_handlr(int irq_number, void *dev)
		goto exit_intvec;
	}

	write_unlock_irq(&mhi_cntrl->pm_lock);

	/* if device is in RDDM, don't bother processing SYS_ERR */
	if (ee != MHI_EE_RDDM && pm_state == MHI_PM_SYS_ERR_DETECT) {
		wake_up_all(&mhi_cntrl->state_event);