mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 2/2] virtio_mmio: add support to set IRQ of a virtio device as wakeup source
@ 2022-03-25  2:05 Minghao Xue
  0 siblings, 0 replies; 2+ messages in thread
From: Minghao Xue @ 2022-03-25  2:05 UTC (permalink / raw)
  To: mst, jasowang, virtualization, linux-kernel; +Cc: quic_ztu

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

Signed-off-by: Minghao Xue <quic_mingxue@quicinc.com>
---
v1 -> v2: rename property from "virtio,wakeup" to "wakeup-source"

 drivers/virtio/virtio_mmio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 56128b9..6637d85 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -474,6 +474,9 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned 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;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH v2 0/2] virtio_mmio: add support to set IRQ of a virtio device as wakeup source
@ 2022-06-10  8:58 Minghao Xue
  2022-06-10  8:58 ` [PATCH v2 2/2] " Minghao Xue
  0 siblings, 1 reply; 2+ messages in thread
From: Minghao Xue @ 2022-06-10  8:58 UTC (permalink / raw)
  To: Michael S. Tsirkin, Jason Wang, Rob Herring
  Cc: Minghao Xue, Jean-Philippe Brucker, virtualization, devicetree,
	linux-kernel, quic_ztu

Hi,
Some systems want to set the interrupt of virtio_mmio device as a wakeup source of system.
This patch series add support for such use case. And it can be enbaled by adding "wakeup-source" property to the device tree.

Patch 1: Add an optional "wakeup-source" property into binding file of virtio_mmio device.
Patch 2: Set IRQ of virtio_mmio device as wakeup source in virtqueue initialization, if "wakeup-source" is set in the device tree.

Version 2 changes (mostly feedback from Krzysztof Kozlowski)
-rename property from "virtio,wakeup" to "wakeup-source"

Minghao Xue (2):
  dt-bindings: virtio: mmio: add optional wakeup-source property
  virtio_mmio: add support to set IRQ of a virtio device as wakeup
    source

 Documentation/devicetree/bindings/virtio/mmio.yaml | 4 ++++
 drivers/virtio/virtio_mmio.c                       | 3 +++
 2 files changed, 7 insertions(+)

-- 
2.7.4


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

end of thread, other threads:[~2022-06-10  8:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-25  2:05 [PATCH v2 2/2] virtio_mmio: add support to set IRQ of a virtio device as wakeup source Minghao Xue
2022-06-10  8:58 [PATCH v2 0/2] " Minghao Xue
2022-06-10  8:58 ` [PATCH v2 2/2] " Minghao Xue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®