mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
virtio-mmio: ack the interrupt as soon as possible
Follow the linux does, avoid miss mmio interrupt Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
@@ -721,6 +721,7 @@ static int virtio_mmio_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||||||
uint32_t isr;
|
uint32_t isr;
|
||||||
|
|
||||||
isr = metal_io_read32(&vmdev->cfg_io, VIRTIO_MMIO_INTERRUPT_STATUS);
|
isr = metal_io_read32(&vmdev->cfg_io, VIRTIO_MMIO_INTERRUPT_STATUS);
|
||||||
|
metal_io_write32(&vmdev->cfg_io, VIRTIO_MMIO_INTERRUPT_ACK, isr);
|
||||||
if (isr & VIRTIO_MMIO_INTERRUPT_VRING)
|
if (isr & VIRTIO_MMIO_INTERRUPT_VRING)
|
||||||
{
|
{
|
||||||
for (i = 0; i < vmdev->vdev.vrings_num; i++)
|
for (i = 0; i < vmdev->vdev.vrings_num; i++)
|
||||||
@@ -734,7 +735,6 @@ static int virtio_mmio_interrupt(int irq, FAR void *context, FAR void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
metal_io_write32(&vmdev->cfg_io, VIRTIO_MMIO_INTERRUPT_ACK, isr);
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user