Skip to content

Commit 514afee

Browse files
committed
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 <wangyongrong@xiaomi.com>
1 parent c468328 commit 514afee

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/rpmsg/rpmsg_virtio.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,9 @@ static void *rpmsg_virtio_get_tx_payload_buffer(struct rpmsg_device *rdev,
390390
* use metal_sleep_usec() method by default.
391391
*/
392392
status = rpmsg_virtio_notify_wait(rvdev, rvdev->rvq);
393-
if (status == RPMSG_EOPNOTSUPP) {
393+
if (status != RPMSG_SUCCESS) {
394394
metal_sleep_usec(RPMSG_TICKS_PER_INTERVAL);
395395
tick_count--;
396-
} else if (status == RPMSG_SUCCESS) {
397-
break;
398396
}
399397
}
400398

0 commit comments

Comments
 (0)