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: Bhaumik Bhatt <bbhatt@codeaurora.org>
This commit is contained in:
Bhaumik Bhatt 2020-05-21 15:13:03 -07:00
parent cf2ebfa082
commit f98fd69ff6

View file

@ -1637,20 +1637,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);
}
write_unlock_irq(&mhi_cntrl->pm_lock);
if (ee == MHI_EE_RDDM) {
write_lock_irq(&mhi_cntrl->pm_lock);
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;
}
/* 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);