From d84bdca2d83a691c52ec4069fd0569311f3c86c8 Mon Sep 17 00:00:00 2001 From: Wendy Liang Date: Fri, 27 Jan 2017 17:17:01 -0800 Subject: [PATCH 1/1] rpmsg: remote_device: notify remote it's resetted in ready(). If the firmware has been requested to reset, in _ready() funciton, notify the remote and set the vdev status to 0. Signed-off-by: Wendy Liang --- lib/rpmsg/remote_device.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/rpmsg/remote_device.c b/lib/rpmsg/remote_device.c index ebb170f..930c9e6 100644 --- a/lib/rpmsg/remote_device.c +++ b/lib/rpmsg/remote_device.c @@ -366,10 +366,14 @@ int rpmsg_rdev_remote_ready(struct remote_device *rdev) uint8_t status; if (rdev->role == RPMSG_MASTER) { while (1) { - /* Busy wait until the remote is ready */ status = vdev->func->get_status(vdev); - if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK) + /* Busy wait until the remote is ready */ + if (status & VIRTIO_CONFIG_STATUS_NEEDS_RESET) { + rpmsg_rdev_set_status(vdev, 0); + hil_vdev_notify(vdev); + } else if (status & VIRTIO_CONFIG_STATUS_DRIVER_OK) { return true; + } metal_cpu_yield(); } } else { @@ -556,3 +560,4 @@ void rpmsg_rdev_reset(struct virtio_device *dev) return; } + -- 2.39.2