From 50a54c9ea78f893e426bb8196c47386c4c5f8460 Mon Sep 17 00:00:00 2001 From: Bhaumik Bhatt Date: Mon, 8 Jun 2020 14:35:54 -0700 Subject: [PATCH] mhi: core: Move to error state as soon as RDDM is detected To reduce the chances of a race where error conditions may end up being missed, move MHI to an error detected state before issuing the RDDM entry callback to the controller. Change-Id: I1f52a87eb35ba944406ec226be6712f0d186ca11 Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/mhi_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/bus/mhi/core/mhi_main.c b/drivers/bus/mhi/core/mhi_main.c index 510867b8857a..3a875d0638e9 100644 --- a/drivers/bus/mhi/core/mhi_main.c +++ b/drivers/bus/mhi/core/mhi_main.c @@ -1660,13 +1660,14 @@ irqreturn_t mhi_intvec_threaded_handlr(int irq_number, void *dev) write_unlock_irq(&mhi_cntrl->pm_lock); MHI_ERR("RDDM event occurred!\n"); - mhi_cntrl->status_cb(mhi_cntrl, mhi_cntrl->priv_data, - MHI_CB_EE_RDDM); - wake_up_all(&mhi_cntrl->state_event); /* notify critical clients with early notifications */ mhi_control_error(mhi_cntrl); + mhi_cntrl->status_cb(mhi_cntrl, mhi_cntrl->priv_data, + MHI_CB_EE_RDDM); + wake_up_all(&mhi_cntrl->state_event); + goto exit_intvec; }