From 514afee680f3f49484e5497e7cfe19b99c9fae73 Mon Sep 17 00:00:00 2001 From: Yongrong Wang Date: Wed, 31 Jul 2024 15:36:43 +0800 Subject: [PATCH] rpmsg_virtio.c: fix get_tx_payload_buffer error driver/rptun_notify_wait and driver/rpmsg_virtio_notify_wait may return -EAGAIN, so if only judge status == RPMSG_EOPNOTSUPP,it will cause busy loop in rpmsg_virtio_get_tx_payload_buffer; Signed-off-by: Yongrong Wang --- lib/rpmsg/rpmsg_virtio.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/rpmsg/rpmsg_virtio.c b/lib/rpmsg/rpmsg_virtio.c index 7baaedd5b..71d527ddd 100644 --- a/lib/rpmsg/rpmsg_virtio.c +++ b/lib/rpmsg/rpmsg_virtio.c @@ -390,11 +390,9 @@ static void *rpmsg_virtio_get_tx_payload_buffer(struct rpmsg_device *rdev, * use metal_sleep_usec() method by default. */ status = rpmsg_virtio_notify_wait(rvdev, rvdev->rvq); - if (status == RPMSG_EOPNOTSUPP) { + if (status != RPMSG_SUCCESS) { metal_sleep_usec(RPMSG_TICKS_PER_INTERVAL); tick_count--; - } else if (status == RPMSG_SUCCESS) { - break; } }