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 <bbhatt@codeaurora.org>
This commit is contained in:
Bhaumik Bhatt 2020-07-14 16:06:57 -07:00
commit 033184aaa4

View file

@ -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)