From a59efd622ed9e4bdd02f6bd3c60b651c13c36ee8 Mon Sep 17 00:00:00 2001 From: Guiding Li Date: Fri, 10 Feb 2023 17:05:54 +0800 Subject: [PATCH] openamp: add error log when ept->cb return error add helpful log when rpmsg endpoint callback return error Signed-off-by: Guiding Li --- lib/rpmsg/rpmsg_virtio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/rpmsg/rpmsg_virtio.c b/lib/rpmsg/rpmsg_virtio.c index ea4cc0d9e..2a4ac4366 100644 --- a/lib/rpmsg/rpmsg_virtio.c +++ b/lib/rpmsg/rpmsg_virtio.c @@ -571,8 +571,12 @@ static void rpmsg_virtio_rx_callback(struct virtqueue *vq) status = ept->cb(ept, RPMSG_LOCATE_DATA(rp_hdr), rp_hdr->len, rp_hdr->src, ept->priv); - RPMSG_ASSERT(status >= 0, - "unexpected callback status\r\n"); + if (status < 0) { + metal_log(METAL_LOG_ERROR, + "ept %s, cb %p, return status %d\r\n", + ept->name, ept->cb, status); + RPMSG_ASSERT(0, "unexpected callback status\r\n"); + } } metal_mutex_acquire(&rdev->lock);