virtio_mmio: add support to set IRQ of a virtio device as wakeup source

According to virtio_mmio wakeup flag in device trees, set its IRQ
as wakeup source in virtqueue initialization.

Signed-off-by: Minghao Xue <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
This commit is contained in:
Minghao Xue authored and Michael S. Tsirkin committed 2022-08-11 04:06:38 -04:00
1 parent 51ded7cdf2
commit 02213273f7
1 file changed
+3
+3
View File
@@ -487,6 +487,9 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned int nvqs,
if (err)
return err;
if (of_property_read_bool(vm_dev->pdev->dev.of_node, "wakeup-source"))
enable_irq_wake(irq);
for (i = 0; i < nvqs; ++i) {
if (!names[i]) {
vqs[i] = NULL;