All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rpmsg: virtio: Fix broken rpmsg_probe()
@ 2022-06-08 17:13 Anup Patel
  2022-06-29 17:43 ` Mathieu Poirier
  2022-06-30 19:16 ` Michael S. Tsirkin
  0 siblings, 2 replies; 26+ messages in thread
From: Anup Patel @ 2022-06-08 17:13 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier
  Cc: Atish Patra, Alistair Francis, Anup Patel, linux-remoteproc,
	kvm-riscv, linux-kernel, Anup Patel

The rpmsg_probe() is broken at the moment because virtqueue_add_inbuf()
fails due to both virtqueues (Rx and Tx) marked as broken by the
__vring_new_virtqueue() function. To solve this, virtio_device_ready()
(which unbreaks queues) should be called before virtqueue_add_inbuf().

Fixes: 8b4ec69d7e09 ("virtio: harden vring IRQ")
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
---
 drivers/rpmsg/virtio_rpmsg_bus.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 905ac7910c98..71a64d2c7644 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -929,6 +929,9 @@ static int rpmsg_probe(struct virtio_device *vdev)
 	/* and half is dedicated for TX */
 	vrp->sbufs = bufs_va + total_buf_space / 2;
 
+	/* From this point on, we can notify and get callbacks. */
+	virtio_device_ready(vdev);
+
 	/* set up the receive buffers */
 	for (i = 0; i < vrp->num_bufs / 2; i++) {
 		struct scatterlist sg;
@@ -983,9 +986,6 @@ static int rpmsg_probe(struct virtio_device *vdev)
 	 */
 	notify = virtqueue_kick_prepare(vrp->rvq);
 
-	/* From this point on, we can notify and get callbacks. */
-	virtio_device_ready(vdev);
-
 	/* tell the remote processor it can start sending messages */
 	/*
 	 * this might be concurrent with callbacks, but we are only
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2022-07-12  8:23 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 17:13 [PATCH] rpmsg: virtio: Fix broken rpmsg_probe() Anup Patel
2022-06-29 17:43 ` Mathieu Poirier
2022-06-30  7:31   ` Anup Patel
2022-06-30 16:20   ` Arnaud POULIQUEN
2022-06-30 17:51     ` Mathieu Poirier
2022-06-30 19:20       ` Michael S. Tsirkin
2022-06-30 19:20         ` Michael S. Tsirkin
2022-07-01  1:22         ` Jason Wang
2022-07-01  1:22           ` Jason Wang
2022-07-01  6:16           ` Michael S. Tsirkin
2022-07-01  6:16             ` Michael S. Tsirkin
2022-07-04  4:35             ` Jason Wang
2022-07-04  4:35               ` Jason Wang
2022-07-04  9:44               ` Arnaud POULIQUEN
2022-07-06  4:03                 ` Jason Wang
2022-07-06  4:03                   ` Jason Wang
2022-07-06  6:56                   ` Arnaud POULIQUEN
2022-07-08  6:19                     ` Jason Wang
2022-07-08  6:19                       ` Jason Wang
2022-07-08  8:00                       ` Arnaud POULIQUEN
2022-07-12  8:21                         ` Jason Wang
2022-07-12  8:21                           ` Jason Wang
2022-06-30 19:19   ` Michael S. Tsirkin
2022-07-01  9:00     ` Arnaud POULIQUEN
2022-07-01  9:39       ` Michael S. Tsirkin
2022-06-30 19:16 ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.