* [PATCH v2 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property
@ 2022-03-25  1:59 Minghao Xue
  2022-03-28 20:42 ` Michael S. Tsirkin
  0 siblings, 1 reply; 10+ messages in thread
From: Minghao Xue @ 2022-03-25  1:59 UTC (permalink / raw)
  To: mst, jasowang, robh+dt, jean-philippe, virtualization, devicetree,
	linux-kernel
  Cc: quic_ztu
Some systems want to set the interrupt of virtio_mmio device
as a wakeup source. On such systems, we'll use the existence
of the "wakeup-source" property as a signal of requirement.
Signed-off-by: Minghao Xue <quic_mingxue@quicinc.com>
---
v1 -> v2: rename property from "virtio,wakeup" to "wakeup-source"
 Documentation/devicetree/bindings/virtio/mmio.yaml | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/virtio/mmio.yaml b/Documentation/devicetree/bindings/virtio/mmio.yaml
index 4b7a027..160b21b 100644
--- a/Documentation/devicetree/bindings/virtio/mmio.yaml
+++ b/Documentation/devicetree/bindings/virtio/mmio.yaml
@@ -31,6 +31,10 @@ properties:
     description: Required for devices making accesses thru an IOMMU.
     maxItems: 1
 
+  wakeup-source:
+    type: boolean
+    description: Required for setting irq of a virtio_mmio device as wakeup source.
+
 required:
   - compatible
   - reg
-- 
2.7.4
^ permalink raw reply related	[flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property
  2022-03-25  1:59 [PATCH v2 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property Minghao Xue
@ 2022-03-28 20:42 ` Michael S. Tsirkin
  2022-03-29  7:46   ` Minghao Xue
  0 siblings, 1 reply; 10+ messages in thread
From: Michael S. Tsirkin @ 2022-03-28 20:42 UTC (permalink / raw)
  To: Minghao Xue
  Cc: jasowang, robh+dt, jean-philippe, virtualization, devicetree,
	linux-kernel, quic_ztu
On Fri, Mar 25, 2022 at 09:59:45AM +0800, Minghao Xue wrote:
> Some systems want to set the interrupt of virtio_mmio device
> as a wakeup source. On such systems, we'll use the existence
> of the "wakeup-source" property as a signal of requirement.
> 
> Signed-off-by: Minghao Xue <quic_mingxue@quicinc.com>
I don't have enough of a clue about dt to review this.
Pls get some acks from people with DT expertise.
> ---
> v1 -> v2: rename property from "virtio,wakeup" to "wakeup-source"
> 
>  Documentation/devicetree/bindings/virtio/mmio.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/virtio/mmio.yaml b/Documentation/devicetree/bindings/virtio/mmio.yaml
> index 4b7a027..160b21b 100644
> --- a/Documentation/devicetree/bindings/virtio/mmio.yaml
> +++ b/Documentation/devicetree/bindings/virtio/mmio.yaml
> @@ -31,6 +31,10 @@ properties:
>      description: Required for devices making accesses thru an IOMMU.
>      maxItems: 1
>  
> +  wakeup-source:
> +    type: boolean
> +    description: Required for setting irq of a virtio_mmio device as wakeup source.
> +
>  required:
>    - compatible
>    - reg
> -- 
> 2.7.4
^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property
  2022-03-28 20:42 ` Michael S. Tsirkin
@ 2022-03-29  7:46   ` Minghao Xue
  2022-03-29  7:59     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 10+ messages in thread
From: Minghao Xue @ 2022-03-29  7:46 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: jasowang, robh+dt, jean-philippe, virtualization, devicetree,
	linux-kernel, quic_ztu, krzk
On Mon, Mar 28, 2022 at 04:42:59PM -0400, Michael S. Tsirkin wrote:
> On Fri, Mar 25, 2022 at 09:59:45AM +0800, Minghao Xue wrote:
> > Some systems want to set the interrupt of virtio_mmio device
> > as a wakeup source. On such systems, we'll use the existence
> > of the "wakeup-source" property as a signal of requirement.
> > 
> > Signed-off-by: Minghao Xue <quic_mingxue@quicinc.com>
> 
> I don't have enough of a clue about dt to review this.
> Pls get some acks from people with DT expertise.
> 
Hi Michael,
I had a discussion with Krzysztof on the first version of patch. And we've
got aligned. 
Regards,
Minghao
> > ---
> > v1 -> v2: rename property from "virtio,wakeup" to "wakeup-source"
> > 
> >  Documentation/devicetree/bindings/virtio/mmio.yaml | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/virtio/mmio.yaml b/Documentation/devicetree/bindings/virtio/mmio.yaml
> > index 4b7a027..160b21b 100644
> > --- a/Documentation/devicetree/bindings/virtio/mmio.yaml
> > +++ b/Documentation/devicetree/bindings/virtio/mmio.yaml
> > @@ -31,6 +31,10 @@ properties:
> >      description: Required for devices making accesses thru an IOMMU.
> >      maxItems: 1
> >  
> > +  wakeup-source:
> > +    type: boolean
> > +    description: Required for setting irq of a virtio_mmio device as wakeup source.
> > +
> >  required:
> >    - compatible
> >    - reg
> > -- 
> > 2.7.4
> 
^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property
  2022-03-29  7:46   ` Minghao Xue
@ 2022-03-29  7:59     ` Krzysztof Kozlowski
  2022-04-25  8:58       ` Minghao Xue
  2022-05-19  7:23       ` Minghao Xue
  0 siblings, 2 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2022-03-29  7:59 UTC (permalink / raw)
  To: Minghao Xue, Michael S. Tsirkin
  Cc: jasowang, robh+dt, jean-philippe, virtualization, devicetree,
	linux-kernel, quic_ztu
On 29/03/2022 09:46, Minghao Xue wrote:
> On Mon, Mar 28, 2022 at 04:42:59PM -0400, Michael S. Tsirkin wrote:
>> On Fri, Mar 25, 2022 at 09:59:45AM +0800, Minghao Xue wrote:
>>> Some systems want to set the interrupt of virtio_mmio device
>>> as a wakeup source. On such systems, we'll use the existence
>>> of the "wakeup-source" property as a signal of requirement.
>>>
>>> Signed-off-by: Minghao Xue <quic_mingxue@quicinc.com>
>>
>> I don't have enough of a clue about dt to review this.
>> Pls get some acks from people with DT expertise.
>>
> Hi Michael,
> I had a discussion with Krzysztof on the first version of patch. And we've
> got aligned. 
> 
I thought I reviewed this and provided an ack, but apparently I did not.
Sorry for late response.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property
  2022-03-29  7:59     ` Krzysztof Kozlowski
@ 2022-04-25  8:58       ` Minghao Xue
  2022-05-19  7:23       ` Minghao Xue
  1 sibling, 0 replies; 10+ messages in thread
From: Minghao Xue @ 2022-04-25  8:58 UTC (permalink / raw)
  To: mst
  Cc: Michael S. Tsirkin, jasowang, robh+dt, jean-philippe,
	virtualization, devicetree, linux-kernel, quic_ztu
On Tue, Mar 29, 2022 at 09:59:31AM +0200, Krzysztof Kozlowski wrote:
> On 29/03/2022 09:46, Minghao Xue wrote:
> > On Mon, Mar 28, 2022 at 04:42:59PM -0400, Michael S. Tsirkin wrote:
> >> On Fri, Mar 25, 2022 at 09:59:45AM +0800, Minghao Xue wrote:
> >>> Some systems want to set the interrupt of virtio_mmio device
> >>> as a wakeup source. On such systems, we'll use the existence
> >>> of the "wakeup-source" property as a signal of requirement.
> >>>
> >>> Signed-off-by: Minghao Xue <quic_mingxue@quicinc.com>
> >>
> >> I don't have enough of a clue about dt to review this.
> >> Pls get some acks from people with DT expertise.
> >>
> > Hi Michael,
> > I had a discussion with Krzysztof on the first version of patch. And we've
> > got aligned. 
> > 
> 
> I thought I reviewed this and provided an ack, but apparently I did not.
> Sorry for late response.
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
Hi Michael,
I'm writting email to ask will you help upstream these two patches? And
how's the progress?
Thanks,
Minghao
^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property
  2022-03-29  7:59     ` Krzysztof Kozlowski
  2022-04-25  8:58       ` Minghao Xue
@ 2022-05-19  7:23       ` Minghao Xue
  2022-06-10  5:44         ` Michael S. Tsirkin
  1 sibling, 1 reply; 10+ messages in thread
From: Minghao Xue @ 2022-05-19  7:23 UTC (permalink / raw)
  To: krzysztof.kozlowski, mst, jasowang
  Cc: Michael S. Tsirkin, jasowang, robh+dt, jean-philippe,
	virtualization, devicetree, linux-kernel, quic_ztu
On Tue, Mar 29, 2022 at 09:59:31AM +0200, Krzysztof Kozlowski wrote:
> On 29/03/2022 09:46, Minghao Xue wrote:
> > On Mon, Mar 28, 2022 at 04:42:59PM -0400, Michael S. Tsirkin wrote:
> >> On Fri, Mar 25, 2022 at 09:59:45AM +0800, Minghao Xue wrote:
> >>> Some systems want to set the interrupt of virtio_mmio device
> >>> as a wakeup source. On such systems, we'll use the existence
> >>> of the "wakeup-source" property as a signal of requirement.
> >>>
> >>> Signed-off-by: Minghao Xue <quic_mingxue@quicinc.com>
> >>
> >> I don't have enough of a clue about dt to review this.
> >> Pls get some acks from people with DT expertise.
> >>
> > Hi Michael,
> > I had a discussion with Krzysztof on the first version of patch. And we've
> > got aligned. 
> > 
> 
> I thought I reviewed this and provided an ack, but apparently I did not.
> Sorry for late response.
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> Best regards,
> Krzysztof
Hi Michael and Jason,
As this patch has been reviewed by Krzysztof. Would you help upstream
these two patches? And is there any progress on it?
Regards,
Minghao
^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property
  2022-05-19  7:23       ` Minghao Xue
@ 2022-06-10  5:44         ` Michael S. Tsirkin
  0 siblings, 0 replies; 10+ messages in thread
From: Michael S. Tsirkin @ 2022-06-10  5:44 UTC (permalink / raw)
  To: Minghao Xue
  Cc: krzysztof.kozlowski, jasowang, robh+dt, jean-philippe,
	virtualization, devicetree, linux-kernel, quic_ztu
On Thu, May 19, 2022 at 03:23:02PM +0800, Minghao Xue wrote:
> On Tue, Mar 29, 2022 at 09:59:31AM +0200, Krzysztof Kozlowski wrote:
> > On 29/03/2022 09:46, Minghao Xue wrote:
> > > On Mon, Mar 28, 2022 at 04:42:59PM -0400, Michael S. Tsirkin wrote:
> > >> On Fri, Mar 25, 2022 at 09:59:45AM +0800, Minghao Xue wrote:
> > >>> Some systems want to set the interrupt of virtio_mmio device
> > >>> as a wakeup source. On such systems, we'll use the existence
> > >>> of the "wakeup-source" property as a signal of requirement.
> > >>>
> > >>> Signed-off-by: Minghao Xue <quic_mingxue@quicinc.com>
> > >>
> > >> I don't have enough of a clue about dt to review this.
> > >> Pls get some acks from people with DT expertise.
> > >>
> > > Hi Michael,
> > > I had a discussion with Krzysztof on the first version of patch. And we've
> > > got aligned. 
> > > 
> > 
> > I thought I reviewed this and provided an ack, but apparently I did not.
> > Sorry for late response.
> > 
> > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > 
> > Best regards,
> > Krzysztof
> 
> Hi Michael and Jason,
> As this patch has been reviewed by Krzysztof. Would you help upstream
> these two patches? And is there any progress on it?
> 
> Regards,
> Minghao
Hi!
Sorry about the delay - the issue with the patchset is it was not
threaded correctly and so can not get handled properly by
automated scripts. Can you please repost threading properly,
preferably with a cover letter?
-- 
MST
^ permalink raw reply	[flat|nested] 10+ 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 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property Minghao Xue
  2022-06-10  8:58 ` [PATCH v2 2/2] virtio_mmio: add support to set IRQ of a virtio device as wakeup source Minghao Xue
  0 siblings, 2 replies; 10+ 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] 10+ messages in thread
* [PATCH v2 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property
  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 ` Minghao Xue
  2022-06-10  8:58 ` [PATCH v2 2/2] virtio_mmio: add support to set IRQ of a virtio device as wakeup source Minghao Xue
  1 sibling, 0 replies; 10+ 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
Some systems want to set the interrupt of virtio_mmio device
as a wakeup source. On such systems, we'll use the existence
of the "wakeup-source" property as a signal of requirement.
Signed-off-by: Minghao Xue <quic_mingxue@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 Documentation/devicetree/bindings/virtio/mmio.yaml | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/virtio/mmio.yaml b/Documentation/devicetree/bindings/virtio/mmio.yaml
index 10c22b5..0aa8433 100644
--- a/Documentation/devicetree/bindings/virtio/mmio.yaml
+++ b/Documentation/devicetree/bindings/virtio/mmio.yaml
@@ -33,6 +33,10 @@ properties:
     description: Required for devices making accesses thru an IOMMU.
     maxItems: 1
 
+  wakeup-source:
+    type: boolean
+    description: Required for setting irq of a virtio_mmio device as wakeup source.
+
 required:
   - compatible
   - reg
-- 
2.7.4
^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH v2 2/2] virtio_mmio: add support to set IRQ of a virtio device as wakeup source
  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
  1 sibling, 0 replies; 10+ 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
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
^ permalink raw reply related	[flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-06-10  8:59 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2 2/2] virtio_mmio: add support to set IRQ of a virtio device as wakeup source Minghao Xue
  -- strict thread matches above, loose matches on Subject: below --
2022-03-25  1:59 [PATCH v2 1/2] dt-bindings: virtio: mmio: add optional wakeup-source property Minghao Xue
2022-03-28 20:42 ` Michael S. Tsirkin
2022-03-29  7:46   ` Minghao Xue
2022-03-29  7:59     ` Krzysztof Kozlowski
2022-04-25  8:58       ` Minghao Xue
2022-05-19  7:23       ` Minghao Xue
2022-06-10  5:44         ` Michael S. Tsirkin
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).