mhi: core: Dump more logs when invalid cookie is received

Dump event ring element, cookie value and bug_ring length
when invalid cookie is received.

Change-Id: I831f10f6e894326b17cb3a405b498cae8111b11d
Signed-off-by: Hemant Kumar <[email protected]>
This commit is contained in:
Hemant Kumar 2019-12-16 18:01:41 -08:00
commit c427eba1c5

View file

@ -1047,7 +1047,12 @@ 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");
if (cookie >= buf_ring->len) {
MHI_ERR("cookie 0x%08x bufring_len %zu", cookie, buf_ring->len);
MHI_ERR("Processing Event:0x%llx 0x%08x 0x%08x\n",
event->ptr, event->dword[0], event->dword[1]);
panic("invalid cookie");
}
buf_info = buf_ring->base + cookie;