* [virtio-dev] Re: virtio mmio reset - driver requirements
[not found] <75e7814a85767f111aefda0c173c83d4@codeaurora.org>
@ 2021-07-05 18:04 ` Michael S. Tsirkin
0 siblings, 0 replies; only message in thread
From: Michael S. Tsirkin @ 2021-07-05 18:04 UTC (permalink / raw)
To: Srivatsa Vaddagiri; +Cc: virtio-dev, vatsa.ml
On Mon, Jul 05, 2021 at 10:07:15PM +0530, Srivatsa Vaddagiri wrote:
> I noticed this in virtio spec for PCI transport based devices:
>
> "After writing 0 to device_status, the driver MUST wait for a read of
> device_status to return 0 before reinitializing the device."
>
> I was wondering why the spec does not recommend a similar "wait after
> writing 0
> to status register" for other transports such as MMIO.
>
> Even the Linux code for virtio_mmio does not have any such wait:
>
> static void vm_reset(struct virtio_device *vdev)
> {
> struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
>
> /* 0 status means a reset. */
> writel(0, vm_dev->base + VIRTIO_MMIO_STATUS);
> }
>
> Does that assume that backends are implemented in software when MMIO writes
> result in trap and backend synchronously does everything needed to handle
> reset
> as part of trap handling? Wouldn't it break if we were to have backends
> implemented in hardware device accessed via MMIO transport?
>
> Thanks
> vatsa
I guess yes.
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
^ permalink raw reply [flat|nested] only message in thread