From 72f7f413c14b1ebf97f474488453128d638d3418 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Tue, 5 Nov 2019 18:01:01 -0800 Subject: [PATCH] mhi: core: Skip handling MSI0 if MHI register access is not allowed Driver continues handling of MSI0 interrupt even if MHI register access is not allowed. By doing so it calls the status call back and performs early notification for the MHI client. This is not needed when MHI register access is not allowed. Hence skip the handling in this case and return. Change-Id: I4639cedfd45166f28379539bccb25acd383faca5 Signed-off-by: Hemant Kumar --- drivers/bus/mhi/core/mhi_main.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/bus/mhi/core/mhi_main.c b/drivers/bus/mhi/core/mhi_main.c index 0cd40bf99786..7a559f5d8c68 100644 --- a/drivers/bus/mhi/core/mhi_main.c +++ b/drivers/bus/mhi/core/mhi_main.c @@ -1585,16 +1585,19 @@ irqreturn_t mhi_intvec_threaded_handlr(int irq_number, void *dev) MHI_VERB("Enter\n"); write_lock_irq(&mhi_cntrl->pm_lock); - if (MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) { - state = mhi_get_mhi_state(mhi_cntrl); - ee = mhi_cntrl->ee; - mhi_cntrl->ee = mhi_get_exec_env(mhi_cntrl); - MHI_LOG("local ee: %s device ee:%s dev_state:%s\n", - TO_MHI_EXEC_STR(ee), - TO_MHI_EXEC_STR(mhi_cntrl->ee), - TO_MHI_STATE_STR(state)); + if (!MHI_REG_ACCESS_VALID(mhi_cntrl->pm_state)) { + write_unlock_irq(&mhi_cntrl->pm_lock); + goto exit_intvec; } + state = mhi_get_mhi_state(mhi_cntrl); + ee = mhi_cntrl->ee; + mhi_cntrl->ee = mhi_get_exec_env(mhi_cntrl); + MHI_LOG("local ee: %s device ee:%s dev_state:%s\n", + TO_MHI_EXEC_STR(ee), + TO_MHI_EXEC_STR(mhi_cntrl->ee), + TO_MHI_STATE_STR(state)); + if (state == MHI_STATE_SYS_ERR) { MHI_ERR("MHI system error detected\n"); pm_state = mhi_tryset_pm_state(mhi_cntrl,