mailbox: msm_qmp: Wait for link up in mbox_startup
There is a chance a client probe can start before the link is established with the remote processor. Add a wait for link up in the mailbox startup to prevent extra probe deferrrals for clients. Change-Id: Idd53349cd91e810126be62bcf27adc53a98417ec Signed-off-by: Chris Lew <clew@codeaurora.org>
This commit is contained in:
parent
edcd9db1db
commit
6ae7336a4e
1 changed files with 5 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/io.h>
|
||||
|
@ -337,12 +337,12 @@ static int qmp_startup(struct mbox_chan *chan)
|
|||
if (!mbox)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&mbox->state_lock);
|
||||
if (!completion_done(&mbox->link_complete)) {
|
||||
mutex_unlock(&mbox->state_lock);
|
||||
ret = wait_for_completion_timeout(&mbox->link_complete,
|
||||
msecs_to_jiffies(QMP_TOUT_MS));
|
||||
if (!ret)
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
mutex_lock(&mbox->state_lock);
|
||||
if (mbox->local_state == LINK_CONNECTED) {
|
||||
set_mcore_ch(mbox, QMP_MBOX_CH_CONNECTED);
|
||||
mbox->local_state = LOCAL_CONNECTING;
|
||||
|
|
Loading…
Reference in a new issue