From 033184aaa479208e8622d3919860d9f37217e920 Mon Sep 17 00:00:00 2001 From: Bhaumik Bhatt Date: Tue, 14 Jul 2020 16:06:57 -0700 Subject: [PATCH] mhi: core: Prevent extra votes for multiple timesync requests An extra vote is held and not released during cases of multiple or back to back time synchronization requests where the response is still pending and the doorbell is not rung. As only one response is expected, we can safely remove the latest vote placed. Change-Id: I551ac2721af79162959ca301a61657cdf17cf135 Signed-off-by: Bhaumik Bhatt --- drivers/bus/mhi/core/mhi_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/bus/mhi/core/mhi_main.c b/drivers/bus/mhi/core/mhi_main.c index 95678117f5c5..094791853e71 100644 --- a/drivers/bus/mhi/core/mhi_main.c +++ b/drivers/bus/mhi/core/mhi_main.c @@ -2685,8 +2685,11 @@ int mhi_get_remote_time(struct mhi_device *mhi_dev, tsync_node->cb_func = cb_func; tsync_node->mhi_dev = mhi_dev; - if (mhi_tsync->db_response_pending) + if (mhi_tsync->db_response_pending) { + mhi_device_put(mhi_cntrl->mhi_dev, + MHI_VOTE_DEVICE | MHI_VOTE_BUS); goto skip_tsync_db; + } mhi_tsync->int_sequence++; if (mhi_tsync->int_sequence == 0xFFFFFFFF)