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

Commit a251e5e4 authored by Jay Jayanna's avatar Jay Jayanna
Browse files

mailbox: msm_qmp: Assert on timeout



Dropped messages to AOP are generally fatal. The general rule of thumb
is to let clients decide whether the dropped message is fatal.

There have been some cases where there are messages sent to AOP as
part of the device shutdown, effectively overwriting the error state.

Add an assert to when QMP detects timeout so the error state on AOP
is preserved.

Change-Id: I5eaf42a76b1298246351ec9d66fe32e7308233bd
Signed-off-by: default avatarJay Jayanna <jayanna@codeaurora.org>
parent 65a3cf72
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/io.h>
@@ -42,6 +42,12 @@ do { \
	ipc_log_string(ctxt, "%s[%s]: "x, "", __func__, ##__VA_ARGS__);	    \
} while (0)

#ifdef CONFIG_QMP_DEBUGFS_CLIENT
#define QMP_BUG(x) BUG_ON(x)
#else
#define QMP_BUG(x) do {} while (0)
#endif

/**
 * enum qmp_local_state - definition of the local state machine
 * @LINK_DISCONNECTED:		Init state, waiting for ucore to start
@@ -264,6 +270,7 @@ static void qmp_notify_timeout(struct work_struct *work)
		return;
	}
	QMP_ERR(mbox->mdev->ilc, "tx timeout for %d\n", mbox->idx_in_flight);
	QMP_BUG(mbox->tx_sent);
	iowrite32(0, mbox->desc + mbox->mcore_mbox_offset);
	mbox->tx_sent = false;
	spin_unlock_irqrestore(&mbox->tx_lock, flags);