@@ -777,6 +777,7 @@ static void rpmsg_recv_done(struct virtqueue *rvq)
return;
}
+ virtqueue_disable_cb(rvq);
while (msg) {
err = rpmsg_recv_single(vrp, dev, msg, len);
if (err)
@@ -786,6 +787,19 @@ static void rpmsg_recv_done(struct virtqueue *rvq)
msg = virtqueue_get_buf(rvq, &len);
}
+ virtqueue_enable_cb(rvq);
+
+ /*
+ * Try to read message one more time in case a new message is submitted
+ * after virtqueue_get_buf() inside the while loop but before enabling
+ * callbacks
+ */
+ msg = virtqueue_get_buf(rvq, &len);
+ if (msg) {
+ err = rpmsg_recv_single(vrp, dev, msg, len);
+ if (!err)
+ msgs_received++;
+ }
dev_dbg(dev, "Received %u messages\n", msgs_received);
Since rpmsg_recv_done() reads messages in a while loop, disable callbacks until the while loop exits. This helps to get rid of the annoying "uhm, incoming signal, but no used buffer ?" message. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> --- drivers/rpmsg/virtio_rpmsg_bus.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)