devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Minghao Xue <quic_mingxue@quicinc.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Rob Herring <robh+dt@kernel.org>
Cc: Minghao Xue <quic_mingxue@quicinc.com>,
	Jean-Philippe Brucker <jean-philippe@linaro.org>,
	<virtualization@lists.linux-foundation.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<quic_ztu@quicinc.com>
Subject: [PATCH v2 2/2] virtio_mmio: add support to set IRQ of a virtio device as wakeup source
Date: Fri, 10 Jun 2022 16:58:27 +0800	[thread overview]
Message-ID: <1654851507-13891-3-git-send-email-quic_mingxue@quicinc.com> (raw)
In-Reply-To: <1654851507-13891-1-git-send-email-quic_mingxue@quicinc.com>

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>
---
 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 f9a36bc..c144442 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -486,6 +486,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;
-- 
2.7.4


      parent reply	other threads:[~2022-06-10  8:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10  8:58 [PATCH v2 0/2] virtio_mmio: add support to set IRQ of a virtio device as wakeup source Minghao Xue
2022-06-10  8:58 ` [PATCH v2 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property Minghao Xue
2022-06-10  8:58 ` Minghao Xue [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1654851507-13891-3-git-send-email-quic_mingxue@quicinc.com \
    --to=quic_mingxue@quicinc.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jasowang@redhat.com \
    --cc=jean-philippe@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=quic_ztu@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).