rpmsg: rdev_init: do not create rpmsg channels before remote is OK
authorWendy Liang <jliang@xilinx.com>
Sun, 15 Jan 2017 07:06:42 +0000 (23:06 -0800)
committerWendy Liang <jliang@xilinx.com>
Fri, 3 Feb 2017 21:41:22 +0000 (13:41 -0800)
It is the virtio master to allocate the vrings' memories, on the slave
side, it should not create channels before the master driver is OK.

Signed-off-by: Wendy Liang <jliang@xilinx.com>
lib/rpmsg/remote_device.c
lib/rpmsg/rpmsg_core.c

index 223e3cce59109fe44eff20469337262a12d35299..9ddfa93c0edb0718e3d254ef5e68a3de23c1492a 100644 (file)
@@ -151,6 +151,9 @@ int rpmsg_rdev_init(struct hil_proc *proc,
                }
        }
 
+       if (!rpmsg_rdev_remote_ready(rdev_loc))
+               return RPMSG_ERR_DEV_INIT;
+
        /* Initialize endpoints list */
        metal_list_init(&rdev_loc->rp_endpoints);
 
index 06faa053d938df346ecd54be1f39f3ca9587d8e8..2a63c2054d4f023b351931887b14d1427b8456f6 100644 (file)
@@ -52,6 +52,7 @@
 #include "metal/io.h"
 #include "metal/cache.h"
 #include "metal/alloc.h"
+#include "metal/cpu.h"
 
 /* Internal functions */
 static void rpmsg_rx_callback(struct virtqueue *vq);