Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6330314c authored by Chris Lew's avatar Chris Lew Committed by Gerrit - the friendly Code Review server
Browse files

maibox: msm_qmp: Add timeout error handling



Return an error back to the mailbox framework if waiting for the remote
channel to connect fails to complete.

Change-Id: I29ab4011e9dbce075176b7045cc85800e5b3a06f
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent 76cd6ea2
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -310,6 +310,7 @@ static void set_mcore_ch(struct qmp_mbox *mbox, u32 state)
static int qmp_startup(struct mbox_chan *chan)
{
	struct qmp_mbox *mbox = chan->con_priv;
	unsigned long ret;

	if (!mbox)
		return -EINVAL;
@@ -325,8 +326,11 @@ static int qmp_startup(struct mbox_chan *chan)
	mutex_unlock(&mbox->state_lock);

	send_irq(mbox->mdev);
	wait_for_completion_interruptible_timeout(&mbox->ch_complete,
	ret = wait_for_completion_timeout(&mbox->ch_complete,
					msecs_to_jiffies(QMP_TOUT_MS));
	if (!ret)
		return -ETIME;

	return 0;
}