Skip to content

Commit 59ee97c

Browse files
GUIDINGLICV-Bowen
authored andcommitted
openamp: add error log when ept->cb return error
add helpful log when rpmsg endpoint callback return error Signed-off-by: Guiding Li <[email protected]>
1 parent 329fe10 commit 59ee97c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/rpmsg/rpmsg_virtio.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,12 @@ static void rpmsg_virtio_rx_callback(struct virtqueue *vq)
571571
status = ept->cb(ept, RPMSG_LOCATE_DATA(rp_hdr),
572572
rp_hdr->len, rp_hdr->src, ept->priv);
573573

574-
RPMSG_ASSERT(status >= 0,
575-
"unexpected callback status\r\n");
574+
if (status < 0) {
575+
metal_log(METAL_LOG_ERROR,
576+
"ept %s, cb %p, return status %d\r\n",
577+
ept->name, ept->cb, status);
578+
RPMSG_ASSERT(0, "unexpected callback status\r\n");
579+
}
576580
}
577581

578582
metal_mutex_acquire(&rdev->lock);

0 commit comments

Comments
 (0)