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

Commit d7903341 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

mhi: core: Dump cookie value upon assert



Upon assert cookie value does not seem to match
with the cookie present in the event ring. Hence
dump the value to compare the difference for
debugging purpose. Also update the assert macro
to allow printing values.

Change-Id: I19ad539d09084d55c154f5b2d927e1f9e91a671f
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent d5f60c07
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -938,16 +938,16 @@ void mhi_ev_task(unsigned long data);

#ifdef CONFIG_MHI_DEBUG

#define MHI_ASSERT(cond, msg) do { \
#define MHI_ASSERT(cond, fmt, ...) do { \
	if (cond) \
		panic(msg); \
		panic(fmt); \
} while (0)

#else

#define MHI_ASSERT(cond, msg) do { \
#define MHI_ASSERT(cond, fmt, ...) do { \
	if (cond) { \
		MHI_ERR(msg); \
		MHI_ERR(fmt); \
		WARN_ON(cond); \
	} \
} while (0)
+1 −1
Original line number Diff line number Diff line
@@ -1072,7 +1072,7 @@ static int parse_rsc_event(struct mhi_controller *mhi_cntrl,
	xfer_len = MHI_TRE_GET_EV_LEN(event);

	/* received out of bound cookie */
	MHI_ASSERT(cookie >= buf_ring->len, "Invalid Cookie\n");
	MHI_ASSERT(cookie >= buf_ring->len, "Invalid Cookie 0x%08x\n", cookie);

	buf_info = buf_ring->base + cookie;