From b7dfed82fbaff3fdcfe49563d88bc67414a39205 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Fri, 25 Oct 2019 16:44:27 -0700 Subject: [PATCH] mhi: core: Force PM state to M0 while processing BW scaling event Driver defers processing of BW scaling event if PM state is not in M0. This delays the BW scaling to take effect. Fix this issue by resuming the device if it was suspended state and assert wake DB. After changing the BW of the link de-assert the wake DB. Change-Id: Ibf827912a4de71d14f461382c28080157c65d6e0 Signed-off-by: Hemant Kumar --- drivers/bus/mhi/core/mhi_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/bus/mhi/core/mhi_main.c b/drivers/bus/mhi/core/mhi_main.c index 2b356b243dd6..59808866aab7 100644 --- a/drivers/bus/mhi/core/mhi_main.c +++ b/drivers/bus/mhi/core/mhi_main.c @@ -1450,6 +1450,9 @@ int mhi_process_bw_scale_ev_ring(struct mhi_controller *mhi_cntrl, if (ev_ring->rp == dev_rp) { spin_unlock_bh(&mhi_event->lock); + read_lock_bh(&mhi_cntrl->pm_lock); + mhi_cntrl->wake_put(mhi_cntrl, false); + read_unlock_bh(&mhi_cntrl->pm_lock); MHI_VERB("no pending event found\n"); goto exit_bw_process; }