Re: [virtio-dev] Re: [PATCH v1] virtio-mmio: Specify wait needed in driver during reset

From
Srivatsa Vaddagiri <>
Date
2021-08-17T12:48:20+00:00
ID
Thread
Re: [virtio-dev] Re: [PATCH v1] virtio-mmio: Specify wait needed in driver during reset
* Srivatsa Vaddagiri <> [2021-08-17 15:33:33]:

> Handling reset is the only open issue we have, as guest triggering reset has
> currently no provision to poll for reset completion and hypervisor itself cannot
> handle reset completly. This is where we observed discrepancy between PCI vs
> MMIO in handling reset, which we wanted to address with this discussion.
> 
> I think the option we discussed earlier of a new feature bit seems less
> intrusive than incrementing MMIO version?
> 
> https://lists.oasis-open.org/archives/virtio-dev/202107/msg00168.html

Alternately would it be fine to merge a change like this to Linux virtio_mmio
driver w/o requiring any further changes to spec?

diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 56128b9..9db81e6 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -262,6 +262,9 @@ static void vm_reset(struct virtio_device *vdev)
 
 	/* 0 status means a reset. */
 	writel(0, vm_dev->base + VIRTIO_MMIO_STATUS);
+
+	while (vm_get_status(vdev))
+		msleep(1);
 }
 
 

-- 
Qualcomm Innovation Center, Inc. is submitting the attached "feedback" as a
non-member to the virtio-dev mailing list for consideration and inclusion.