Skip to content

Commit

Permalink
openamp: add error log when ept->cb return error
Browse files Browse the repository at this point in the history
add helpful log when rpmsg endpoint callback return error

Signed-off by: Guiding Li <liguiding1@xiaomi.com>
  • Loading branch information
GUIDINGLI authored and CV-Bowen committed Oct 16, 2023
1 parent bdf5f91 commit 6e00a17
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/rpmsg/rpmsg_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6e00a17

Please sign in to comment.