xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V1 0/2] Add ability to handle nodes with interrupts-extended property
@ 2019-05-21 17:37 Oleksandr Tyshchenko
  2019-05-21 17:37 ` [Xen-devel] " Oleksandr Tyshchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Oleksandr Tyshchenko @ 2019-05-21 17:37 UTC (permalink / raw)
  To: xen-devel; +Cc: Oleksandr Tyshchenko, julien.grall, sstabellini

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Hello, all.

The purpose of this small series is to add minimal required support for Xen to be able
to handle device-tree nodes with "interrupts-extended" property [1].

The "interrupts-extended" property is a special form for use when a node needs
to reference multiple interrupt parents.

But, there are cases when "interrupts-extended" property is used for "outside /soc node"
with a single interrupt parent as an equivalent of pairs ("interrupt-parent" + "interrupts").

----------
Tested on R-Car Gen2 based board using current staging (commit 91f86f8634f99abd8f242943e62452211a09fa0a).
Log (with debug enabled) shows that Xen recognized ARCH timer interrupts represented with "interrupts-extended" property:

timer {
	compatible = "arm,armv7-timer";
	interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
			      <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
			      <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
			      <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
};

Xen 4.13-unstable
(XEN) Xen version 4.13-unstable (otyshchenko@) (arm-linux-gnueabi-gcc (Linaro GCC 7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]) debug=y  Tue May 21 17:08:47 E9
(XEN) Latest ChangeSet: Thu Feb 2 11:59:05 2017 +0200 git:85faf88
(XEN) build-id: f0739ad25a57b50d508afd5e22e93af3d052acbf
(XEN) Processor: 413fc0f2: "ARM Limited", variant: 0x3, part 0xc0f, rev 0x2
(XEN) 32-bit Execution:
(XEN)   Processor Features: 00001131:00011011
(XEN)     Instruction Sets: AArch32 A32 Thumb Thumb-2 ThumbEE Jazelle
(XEN)     Extensions: GenericTimer Security
(XEN)   Debug Features: 02010555
(XEN)   Auxiliary Features: 00000000
(XEN)   Memory Model Features: 10201105 40000000 01240000 02102211
(XEN)  ISA Features: 02101110 13112111 21232041 11112131 10011142 00000000
(XEN) Using SMC Calling Convention v1.0
(XEN) Using PSCI v1.0
(XEN) SMP: Allowing 8 CPUs
(XEN) dt_device_get_raw_irq: dev=/timer, index=0
(XEN)  using 'interrupts-extended' property
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1001000,intspec=[0x00000001 0x0000000d...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1001000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) dt_device_get_raw_irq: dev=/timer, index=1
(XEN)  using 'interrupts-extended' property
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1001000,intspec=[0x00000001 0x0000000e...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1001000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) dt_device_get_raw_irq: dev=/timer, index=2
(XEN)  using 'interrupts-extended' property
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1001000,intspec=[0x00000001 0x0000000b...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1001000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) dt_device_get_raw_irq: dev=/timer, index=3
(XEN)  using 'interrupts-extended' property
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1001000,intspec=[0x00000001 0x0000000a...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1001000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 10000 KHz
----------

[1] https://elixir.bootlin.com/linux/v5.2-rc1/source/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt

Oleksandr Tyshchenko (2):
  xen/device-tree: Add dt_count_phandle_with_args helper
  xen/device-tree: Add ability to handle nodes with interrupts-extended
    prop

 xen/common/device_tree.c      | 43 ++++++++++++++++++++++++++++++++++++++++---
 xen/include/xen/device_tree.h | 19 +++++++++++++++++++
 2 files changed, 59 insertions(+), 3 deletions(-)

-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH V1 0/2] Add ability to handle nodes with interrupts-extended property
  2019-05-21 17:37 [PATCH V1 0/2] Add ability to handle nodes with interrupts-extended property Oleksandr Tyshchenko
@ 2019-05-21 17:37 ` Oleksandr Tyshchenko
  2019-05-21 17:37 ` [PATCH V1 1/2] xen/device-tree: Add dt_count_phandle_with_args helper Oleksandr Tyshchenko
  2019-05-21 17:37 ` [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop Oleksandr Tyshchenko
  2 siblings, 0 replies; 16+ messages in thread
From: Oleksandr Tyshchenko @ 2019-05-21 17:37 UTC (permalink / raw)
  To: xen-devel; +Cc: Oleksandr Tyshchenko, julien.grall, sstabellini

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Hello, all.

The purpose of this small series is to add minimal required support for Xen to be able
to handle device-tree nodes with "interrupts-extended" property [1].

The "interrupts-extended" property is a special form for use when a node needs
to reference multiple interrupt parents.

But, there are cases when "interrupts-extended" property is used for "outside /soc node"
with a single interrupt parent as an equivalent of pairs ("interrupt-parent" + "interrupts").

----------
Tested on R-Car Gen2 based board using current staging (commit 91f86f8634f99abd8f242943e62452211a09fa0a).
Log (with debug enabled) shows that Xen recognized ARCH timer interrupts represented with "interrupts-extended" property:

timer {
	compatible = "arm,armv7-timer";
	interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
			      <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
			      <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
			      <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
};

Xen 4.13-unstable
(XEN) Xen version 4.13-unstable (otyshchenko@) (arm-linux-gnueabi-gcc (Linaro GCC 7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]) debug=y  Tue May 21 17:08:47 E9
(XEN) Latest ChangeSet: Thu Feb 2 11:59:05 2017 +0200 git:85faf88
(XEN) build-id: f0739ad25a57b50d508afd5e22e93af3d052acbf
(XEN) Processor: 413fc0f2: "ARM Limited", variant: 0x3, part 0xc0f, rev 0x2
(XEN) 32-bit Execution:
(XEN)   Processor Features: 00001131:00011011
(XEN)     Instruction Sets: AArch32 A32 Thumb Thumb-2 ThumbEE Jazelle
(XEN)     Extensions: GenericTimer Security
(XEN)   Debug Features: 02010555
(XEN)   Auxiliary Features: 00000000
(XEN)   Memory Model Features: 10201105 40000000 01240000 02102211
(XEN)  ISA Features: 02101110 13112111 21232041 11112131 10011142 00000000
(XEN) Using SMC Calling Convention v1.0
(XEN) Using PSCI v1.0
(XEN) SMP: Allowing 8 CPUs
(XEN) dt_device_get_raw_irq: dev=/timer, index=0
(XEN)  using 'interrupts-extended' property
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1001000,intspec=[0x00000001 0x0000000d...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1001000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) dt_device_get_raw_irq: dev=/timer, index=1
(XEN)  using 'interrupts-extended' property
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1001000,intspec=[0x00000001 0x0000000e...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1001000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) dt_device_get_raw_irq: dev=/timer, index=2
(XEN)  using 'interrupts-extended' property
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1001000,intspec=[0x00000001 0x0000000b...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1001000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) dt_device_get_raw_irq: dev=/timer, index=3
(XEN)  using 'interrupts-extended' property
(XEN)  intspec=1 intsize=3
(XEN) dt_irq_map_raw: par=/soc/interrupt-controller@f1001000,intspec=[0x00000001 0x0000000a...],ointsize=3
(XEN) dt_irq_map_raw: ipar=/soc/interrupt-controller@f1001000, size=3
(XEN)  -> addrsize=0
(XEN)  -> got it !
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 10000 KHz
----------

[1] https://elixir.bootlin.com/linux/v5.2-rc1/source/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt

Oleksandr Tyshchenko (2):
  xen/device-tree: Add dt_count_phandle_with_args helper
  xen/device-tree: Add ability to handle nodes with interrupts-extended
    prop

 xen/common/device_tree.c      | 43 ++++++++++++++++++++++++++++++++++++++++---
 xen/include/xen/device_tree.h | 19 +++++++++++++++++++
 2 files changed, 59 insertions(+), 3 deletions(-)

-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [PATCH V1 1/2] xen/device-tree: Add dt_count_phandle_with_args helper
  2019-05-21 17:37 [PATCH V1 0/2] Add ability to handle nodes with interrupts-extended property Oleksandr Tyshchenko
  2019-05-21 17:37 ` [Xen-devel] " Oleksandr Tyshchenko
@ 2019-05-21 17:37 ` Oleksandr Tyshchenko
  2019-05-21 17:37   ` [Xen-devel] " Oleksandr Tyshchenko
  2019-05-29 17:34   ` Julien Grall
  2019-05-21 17:37 ` [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop Oleksandr Tyshchenko
  2 siblings, 2 replies; 16+ messages in thread
From: Oleksandr Tyshchenko @ 2019-05-21 17:37 UTC (permalink / raw)
  To: xen-devel; +Cc: Oleksandr Tyshchenko, julien.grall, sstabellini

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Port Linux helper of_count_phandle_with_args for counting
number of phandles in a property.

Please note, this helper is ported from Linux v4.6.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

---
    Changes RFC -> V1:
        - Add Linux version which is used as the base.
---
 xen/common/device_tree.c      |  7 +++++++
 xen/include/xen/device_tree.h | 19 +++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 8fc401d..65862b5 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -1663,6 +1663,13 @@ int dt_parse_phandle_with_args(const struct dt_device_node *np,
                                         index, out_args);
 }
 
+int dt_count_phandle_with_args(const struct dt_device_node *np,
+                               const char *list_name,
+                               const char *cells_name)
+{
+    return __dt_parse_phandle_with_args(np, list_name, cells_name, 0, -1, NULL);
+}
+
 /**
  * unflatten_dt_node - Alloc and populate a device_node from the flat tree
  * @fdt: The parent device tree blob
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 7408a6c..8315629 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -738,6 +738,25 @@ int dt_parse_phandle_with_args(const struct dt_device_node *np,
                                const char *cells_name, int index,
                                struct dt_phandle_args *out_args);
 
+/**
+ * dt_count_phandle_with_args() - Find the number of phandles references in a property
+ * @np: pointer to a device tree node containing a list
+ * @list_name: property name that contains a list
+ * @cells_name: property name that specifies phandles' arguments count
+ *
+ * Returns the number of phandle + argument tuples within a property. It
+ * is a typical pattern to encode a list of phandle and variable
+ * arguments into a single property. The number of arguments is encoded
+ * by a property in the phandle-target node. For example, a gpios
+ * property would contain a list of GPIO specifies consisting of a
+ * phandle and 1 or more arguments. The number of arguments are
+ * determined by the #gpio-cells property in the node pointed to by the
+ * phandle.
+ */
+int dt_count_phandle_with_args(const struct dt_device_node *np,
+                               const char *list_name,
+                               const char *cells_name);
+
 #ifdef CONFIG_DEVICE_TREE_DEBUG
 #define dt_dprintk(fmt, args...)  \
     printk(XENLOG_DEBUG fmt, ## args)
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH V1 1/2] xen/device-tree: Add dt_count_phandle_with_args helper
  2019-05-21 17:37 ` [PATCH V1 1/2] xen/device-tree: Add dt_count_phandle_with_args helper Oleksandr Tyshchenko
@ 2019-05-21 17:37   ` Oleksandr Tyshchenko
  2019-05-29 17:34   ` Julien Grall
  1 sibling, 0 replies; 16+ messages in thread
From: Oleksandr Tyshchenko @ 2019-05-21 17:37 UTC (permalink / raw)
  To: xen-devel; +Cc: Oleksandr Tyshchenko, julien.grall, sstabellini

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Port Linux helper of_count_phandle_with_args for counting
number of phandles in a property.

Please note, this helper is ported from Linux v4.6.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

---
    Changes RFC -> V1:
        - Add Linux version which is used as the base.
---
 xen/common/device_tree.c      |  7 +++++++
 xen/include/xen/device_tree.h | 19 +++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 8fc401d..65862b5 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -1663,6 +1663,13 @@ int dt_parse_phandle_with_args(const struct dt_device_node *np,
                                         index, out_args);
 }
 
+int dt_count_phandle_with_args(const struct dt_device_node *np,
+                               const char *list_name,
+                               const char *cells_name)
+{
+    return __dt_parse_phandle_with_args(np, list_name, cells_name, 0, -1, NULL);
+}
+
 /**
  * unflatten_dt_node - Alloc and populate a device_node from the flat tree
  * @fdt: The parent device tree blob
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 7408a6c..8315629 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -738,6 +738,25 @@ int dt_parse_phandle_with_args(const struct dt_device_node *np,
                                const char *cells_name, int index,
                                struct dt_phandle_args *out_args);
 
+/**
+ * dt_count_phandle_with_args() - Find the number of phandles references in a property
+ * @np: pointer to a device tree node containing a list
+ * @list_name: property name that contains a list
+ * @cells_name: property name that specifies phandles' arguments count
+ *
+ * Returns the number of phandle + argument tuples within a property. It
+ * is a typical pattern to encode a list of phandle and variable
+ * arguments into a single property. The number of arguments is encoded
+ * by a property in the phandle-target node. For example, a gpios
+ * property would contain a list of GPIO specifies consisting of a
+ * phandle and 1 or more arguments. The number of arguments are
+ * determined by the #gpio-cells property in the node pointed to by the
+ * phandle.
+ */
+int dt_count_phandle_with_args(const struct dt_device_node *np,
+                               const char *list_name,
+                               const char *cells_name);
+
 #ifdef CONFIG_DEVICE_TREE_DEBUG
 #define dt_dprintk(fmt, args...)  \
     printk(XENLOG_DEBUG fmt, ## args)
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop
  2019-05-21 17:37 [PATCH V1 0/2] Add ability to handle nodes with interrupts-extended property Oleksandr Tyshchenko
  2019-05-21 17:37 ` [Xen-devel] " Oleksandr Tyshchenko
  2019-05-21 17:37 ` [PATCH V1 1/2] xen/device-tree: Add dt_count_phandle_with_args helper Oleksandr Tyshchenko
@ 2019-05-21 17:37 ` Oleksandr Tyshchenko
  2019-05-21 17:37   ` [Xen-devel] " Oleksandr Tyshchenko
  2019-05-29 17:44   ` Julien Grall
  2 siblings, 2 replies; 16+ messages in thread
From: Oleksandr Tyshchenko @ 2019-05-21 17:37 UTC (permalink / raw)
  To: xen-devel; +Cc: Oleksandr Tyshchenko, julien.grall, sstabellini

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

The "interrupts-extended" property is a special form for use when
a node needs to reference multiple interrupt parents.

According to the:
Linux/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt

But, there are cases when "interrupts-extended" property is used for
"outside /soc node" with a single interrupt parent as an equivalent of
pairs ("interrupt-parent" + "interrupts").

The good example here is ARCH timer node for R-Car Gen3/Gen2 family,
which is mandatory device for Xen usage on ARM. And without ability
to handle such nodes, Xen fails to operate.

So, this patch adds required support for Xen to be able to handle
nodes with that property.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

---
    Changes RFC -> V1:
        - Explain in the commit message regarding property usage, add a link
          to the bindings.
        - Don't try to look for "interrupts" property if "interrupts-extended"
          property is present, but doesn't contain any interrupts
          (dt_count_phandle_with_args returns 0).
        - Add messages to tell which property is used.
---
 xen/common/device_tree.c | 36 +++++++++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 65862b5..e107c6f 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -987,15 +987,27 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device)
     const struct dt_device_node *p;
     const __be32 *intspec, *tmp;
     u32 intsize, intlen;
+    int intnum;
 
     dt_dprintk("dt_irq_number: dev=%s\n", device->full_name);
 
+    /* Try the new-style interrupts-extended first */
+    intnum = dt_count_phandle_with_args(device, "interrupts-extended",
+                                        "#interrupt-cells");
+    if ( intnum >= 0 )
+    {
+        dt_dprintk(" using 'interrupts-extended' property\n");
+        dt_dprintk(" intnum=%d\n", intnum);
+        return intnum;
+    }
+
     /* Get the interrupts property */
     intspec = dt_get_property(device, "interrupts", &intlen);
     if ( intspec == NULL )
         return 0;
     intlen /= sizeof(*intspec);
 
+    dt_dprintk(" using 'interrupts' property\n");
     dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
 
     /* Look for the interrupt parent. */
@@ -1420,21 +1432,39 @@ int dt_device_get_raw_irq(const struct dt_device_node *device,
     const __be32 *intspec, *tmp, *addr;
     u32 intsize, intlen;
     int res = -EINVAL;
+    struct dt_phandle_args args;
+    int i;
 
     dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%u\n",
                device->full_name, index);
 
+    /* Get the reg property (if any) */
+    addr = dt_get_property(device, "reg", NULL);
+
+    /* Try the new-style interrupts-extended first */
+    res = dt_parse_phandle_with_args(device, "interrupts-extended",
+                                     "#interrupt-cells", index, &args);
+    if ( !res )
+    {
+        dt_dprintk(" using 'interrupts-extended' property\n");
+        dt_dprintk(" intspec=%d intsize=%d\n", args.args[0], args.args_count);
+
+        for ( i = 0; i < args.args_count; i++ )
+            args.args[i] = cpu_to_be32(args.args[i]);
+
+        return dt_irq_map_raw(args.np, args.args, args.args_count,
+                              addr, out_irq);
+    }
+
     /* Get the interrupts property */
     intspec = dt_get_property(device, "interrupts", &intlen);
     if ( intspec == NULL )
         return -EINVAL;
     intlen /= sizeof(*intspec);
 
+    dt_dprintk(" using 'interrupts' property\n");
     dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
 
-    /* Get the reg property (if any) */
-    addr = dt_get_property(device, "reg", NULL);
-
     /* Look for the interrupt parent. */
     p = dt_irq_find_parent(device);
     if ( p == NULL )
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop
  2019-05-21 17:37 ` [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop Oleksandr Tyshchenko
@ 2019-05-21 17:37   ` Oleksandr Tyshchenko
  2019-05-29 17:44   ` Julien Grall
  1 sibling, 0 replies; 16+ messages in thread
From: Oleksandr Tyshchenko @ 2019-05-21 17:37 UTC (permalink / raw)
  To: xen-devel; +Cc: Oleksandr Tyshchenko, julien.grall, sstabellini

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

The "interrupts-extended" property is a special form for use when
a node needs to reference multiple interrupt parents.

According to the:
Linux/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt

But, there are cases when "interrupts-extended" property is used for
"outside /soc node" with a single interrupt parent as an equivalent of
pairs ("interrupt-parent" + "interrupts").

The good example here is ARCH timer node for R-Car Gen3/Gen2 family,
which is mandatory device for Xen usage on ARM. And without ability
to handle such nodes, Xen fails to operate.

So, this patch adds required support for Xen to be able to handle
nodes with that property.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

---
    Changes RFC -> V1:
        - Explain in the commit message regarding property usage, add a link
          to the bindings.
        - Don't try to look for "interrupts" property if "interrupts-extended"
          property is present, but doesn't contain any interrupts
          (dt_count_phandle_with_args returns 0).
        - Add messages to tell which property is used.
---
 xen/common/device_tree.c | 36 +++++++++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 65862b5..e107c6f 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -987,15 +987,27 @@ unsigned int dt_number_of_irq(const struct dt_device_node *device)
     const struct dt_device_node *p;
     const __be32 *intspec, *tmp;
     u32 intsize, intlen;
+    int intnum;
 
     dt_dprintk("dt_irq_number: dev=%s\n", device->full_name);
 
+    /* Try the new-style interrupts-extended first */
+    intnum = dt_count_phandle_with_args(device, "interrupts-extended",
+                                        "#interrupt-cells");
+    if ( intnum >= 0 )
+    {
+        dt_dprintk(" using 'interrupts-extended' property\n");
+        dt_dprintk(" intnum=%d\n", intnum);
+        return intnum;
+    }
+
     /* Get the interrupts property */
     intspec = dt_get_property(device, "interrupts", &intlen);
     if ( intspec == NULL )
         return 0;
     intlen /= sizeof(*intspec);
 
+    dt_dprintk(" using 'interrupts' property\n");
     dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
 
     /* Look for the interrupt parent. */
@@ -1420,21 +1432,39 @@ int dt_device_get_raw_irq(const struct dt_device_node *device,
     const __be32 *intspec, *tmp, *addr;
     u32 intsize, intlen;
     int res = -EINVAL;
+    struct dt_phandle_args args;
+    int i;
 
     dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%u\n",
                device->full_name, index);
 
+    /* Get the reg property (if any) */
+    addr = dt_get_property(device, "reg", NULL);
+
+    /* Try the new-style interrupts-extended first */
+    res = dt_parse_phandle_with_args(device, "interrupts-extended",
+                                     "#interrupt-cells", index, &args);
+    if ( !res )
+    {
+        dt_dprintk(" using 'interrupts-extended' property\n");
+        dt_dprintk(" intspec=%d intsize=%d\n", args.args[0], args.args_count);
+
+        for ( i = 0; i < args.args_count; i++ )
+            args.args[i] = cpu_to_be32(args.args[i]);
+
+        return dt_irq_map_raw(args.np, args.args, args.args_count,
+                              addr, out_irq);
+    }
+
     /* Get the interrupts property */
     intspec = dt_get_property(device, "interrupts", &intlen);
     if ( intspec == NULL )
         return -EINVAL;
     intlen /= sizeof(*intspec);
 
+    dt_dprintk(" using 'interrupts' property\n");
     dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
 
-    /* Get the reg property (if any) */
-    addr = dt_get_property(device, "reg", NULL);
-
     /* Look for the interrupt parent. */
     p = dt_irq_find_parent(device);
     if ( p == NULL )
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH V1 1/2] xen/device-tree: Add dt_count_phandle_with_args helper
  2019-05-21 17:37 ` [PATCH V1 1/2] xen/device-tree: Add dt_count_phandle_with_args helper Oleksandr Tyshchenko
  2019-05-21 17:37   ` [Xen-devel] " Oleksandr Tyshchenko
@ 2019-05-29 17:34   ` Julien Grall
  2019-05-29 17:34     ` [Xen-devel] " Julien Grall
  1 sibling, 1 reply; 16+ messages in thread
From: Julien Grall @ 2019-05-29 17:34 UTC (permalink / raw)
  To: Oleksandr Tyshchenko, xen-devel; +Cc: Oleksandr Tyshchenko, sstabellini

Hi Oleksandr,

On 21/05/2019 18:37, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> Port Linux helper of_count_phandle_with_args for counting
> number of phandles in a property.
> 
> Please note, this helper is ported from Linux v4.6.
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

> 
> ---
>      Changes RFC -> V1:
>          - Add Linux version which is used as the base.
> ---
>   xen/common/device_tree.c      |  7 +++++++
>   xen/include/xen/device_tree.h | 19 +++++++++++++++++++
>   2 files changed, 26 insertions(+)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 8fc401d..65862b5 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -1663,6 +1663,13 @@ int dt_parse_phandle_with_args(const struct dt_device_node *np,
>                                           index, out_args);
>   }
>   
> +int dt_count_phandle_with_args(const struct dt_device_node *np,
> +                               const char *list_name,
> +                               const char *cells_name)
> +{
> +    return __dt_parse_phandle_with_args(np, list_name, cells_name, 0, -1, NULL);
> +}
> +
>   /**
>    * unflatten_dt_node - Alloc and populate a device_node from the flat tree
>    * @fdt: The parent device tree blob
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index 7408a6c..8315629 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -738,6 +738,25 @@ int dt_parse_phandle_with_args(const struct dt_device_node *np,
>                                  const char *cells_name, int index,
>                                  struct dt_phandle_args *out_args);
>   
> +/**
> + * dt_count_phandle_with_args() - Find the number of phandles references in a property
> + * @np: pointer to a device tree node containing a list
> + * @list_name: property name that contains a list
> + * @cells_name: property name that specifies phandles' arguments count
> + *
> + * Returns the number of phandle + argument tuples within a property. It
> + * is a typical pattern to encode a list of phandle and variable
> + * arguments into a single property. The number of arguments is encoded
> + * by a property in the phandle-target node. For example, a gpios
> + * property would contain a list of GPIO specifies consisting of a
> + * phandle and 1 or more arguments. The number of arguments are
> + * determined by the #gpio-cells property in the node pointed to by the
> + * phandle.
> + */
> +int dt_count_phandle_with_args(const struct dt_device_node *np,
> +                               const char *list_name,
> +                               const char *cells_name);
> +
>   #ifdef CONFIG_DEVICE_TREE_DEBUG
>   #define dt_dprintk(fmt, args...)  \
>       printk(XENLOG_DEBUG fmt, ## args)
> 

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH V1 1/2] xen/device-tree: Add dt_count_phandle_with_args helper
  2019-05-29 17:34   ` Julien Grall
@ 2019-05-29 17:34     ` Julien Grall
  0 siblings, 0 replies; 16+ messages in thread
From: Julien Grall @ 2019-05-29 17:34 UTC (permalink / raw)
  To: Oleksandr Tyshchenko, xen-devel; +Cc: Oleksandr Tyshchenko, sstabellini

Hi Oleksandr,

On 21/05/2019 18:37, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> Port Linux helper of_count_phandle_with_args for counting
> number of phandles in a property.
> 
> Please note, this helper is ported from Linux v4.6.
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

> 
> ---
>      Changes RFC -> V1:
>          - Add Linux version which is used as the base.
> ---
>   xen/common/device_tree.c      |  7 +++++++
>   xen/include/xen/device_tree.h | 19 +++++++++++++++++++
>   2 files changed, 26 insertions(+)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 8fc401d..65862b5 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -1663,6 +1663,13 @@ int dt_parse_phandle_with_args(const struct dt_device_node *np,
>                                           index, out_args);
>   }
>   
> +int dt_count_phandle_with_args(const struct dt_device_node *np,
> +                               const char *list_name,
> +                               const char *cells_name)
> +{
> +    return __dt_parse_phandle_with_args(np, list_name, cells_name, 0, -1, NULL);
> +}
> +
>   /**
>    * unflatten_dt_node - Alloc and populate a device_node from the flat tree
>    * @fdt: The parent device tree blob
> diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
> index 7408a6c..8315629 100644
> --- a/xen/include/xen/device_tree.h
> +++ b/xen/include/xen/device_tree.h
> @@ -738,6 +738,25 @@ int dt_parse_phandle_with_args(const struct dt_device_node *np,
>                                  const char *cells_name, int index,
>                                  struct dt_phandle_args *out_args);
>   
> +/**
> + * dt_count_phandle_with_args() - Find the number of phandles references in a property
> + * @np: pointer to a device tree node containing a list
> + * @list_name: property name that contains a list
> + * @cells_name: property name that specifies phandles' arguments count
> + *
> + * Returns the number of phandle + argument tuples within a property. It
> + * is a typical pattern to encode a list of phandle and variable
> + * arguments into a single property. The number of arguments is encoded
> + * by a property in the phandle-target node. For example, a gpios
> + * property would contain a list of GPIO specifies consisting of a
> + * phandle and 1 or more arguments. The number of arguments are
> + * determined by the #gpio-cells property in the node pointed to by the
> + * phandle.
> + */
> +int dt_count_phandle_with_args(const struct dt_device_node *np,
> +                               const char *list_name,
> +                               const char *cells_name);
> +
>   #ifdef CONFIG_DEVICE_TREE_DEBUG
>   #define dt_dprintk(fmt, args...)  \
>       printk(XENLOG_DEBUG fmt, ## args)
> 

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop
  2019-05-21 17:37 ` [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop Oleksandr Tyshchenko
  2019-05-21 17:37   ` [Xen-devel] " Oleksandr Tyshchenko
@ 2019-05-29 17:44   ` Julien Grall
  2019-05-29 17:44     ` [Xen-devel] " Julien Grall
  2019-05-29 17:58     ` Oleksandr
  1 sibling, 2 replies; 16+ messages in thread
From: Julien Grall @ 2019-05-29 17:44 UTC (permalink / raw)
  To: Oleksandr Tyshchenko, xen-devel, sstabellini; +Cc: Oleksandr Tyshchenko

Hi Oleksandr,

On 21/05/2019 18:37, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> The "interrupts-extended" property is a special form for use when
> a node needs to reference multiple interrupt parents. >
> According to the:

NIT: s/the//

> Linux/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> 
> But, there are cases when "interrupts-extended" property is used for
> "outside /soc node" with a single interrupt parent as an equivalent of
> pairs ("interrupt-parent" + "interrupts").
> 
> The good example here is ARCH timer node for R-Car Gen3/Gen2 family,

NIT: s/The/A/ I think

> which is mandatory device for Xen usage on ARM. And without ability
> to handle such nodes, Xen fails to operate.
> 
> So, this patch adds required support for Xen to be able to handle
> nodes with that property.
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

I will give an opportunity to Stefano to review it. If I don't hear anything by 
Monday, I will merge it.

Thank you!

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop
  2019-05-29 17:44   ` Julien Grall
@ 2019-05-29 17:44     ` Julien Grall
  2019-05-29 17:58     ` Oleksandr
  1 sibling, 0 replies; 16+ messages in thread
From: Julien Grall @ 2019-05-29 17:44 UTC (permalink / raw)
  To: Oleksandr Tyshchenko, xen-devel, sstabellini; +Cc: Oleksandr Tyshchenko

Hi Oleksandr,

On 21/05/2019 18:37, Oleksandr Tyshchenko wrote:
> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
> 
> The "interrupts-extended" property is a special form for use when
> a node needs to reference multiple interrupt parents. >
> According to the:

NIT: s/the//

> Linux/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> 
> But, there are cases when "interrupts-extended" property is used for
> "outside /soc node" with a single interrupt parent as an equivalent of
> pairs ("interrupt-parent" + "interrupts").
> 
> The good example here is ARCH timer node for R-Car Gen3/Gen2 family,

NIT: s/The/A/ I think

> which is mandatory device for Xen usage on ARM. And without ability
> to handle such nodes, Xen fails to operate.
> 
> So, this patch adds required support for Xen to be able to handle
> nodes with that property.
> 
> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

I will give an opportunity to Stefano to review it. If I don't hear anything by 
Monday, I will merge it.

Thank you!

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop
  2019-05-29 17:44   ` Julien Grall
  2019-05-29 17:44     ` [Xen-devel] " Julien Grall
@ 2019-05-29 17:58     ` Oleksandr
  2019-05-29 17:58       ` [Xen-devel] " Oleksandr
  2019-05-29 18:18       ` Julien Grall
  1 sibling, 2 replies; 16+ messages in thread
From: Oleksandr @ 2019-05-29 17:58 UTC (permalink / raw)
  To: Julien Grall, xen-devel, sstabellini; +Cc: Oleksandr Tyshchenko


On 29.05.19 20:44, Julien Grall wrote:
> Hi Oleksandr,

Hi, Julien


>
> On 21/05/2019 18:37, Oleksandr Tyshchenko wrote:
>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>
>> The "interrupts-extended" property is a special form for use when
>> a node needs to reference multiple interrupt parents. >
>> According to the:
>
> NIT: s/the//
>
>> Linux/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt 
>>
>>
>> But, there are cases when "interrupts-extended" property is used for
>> "outside /soc node" with a single interrupt parent as an equivalent of
>> pairs ("interrupt-parent" + "interrupts").
>>
>> The good example here is ARCH timer node for R-Car Gen3/Gen2 family,
>
> NIT: s/The/A/ I think
>
>> which is mandatory device for Xen usage on ARM. And without ability
>> to handle such nodes, Xen fails to operate.
>>
>> So, this patch adds required support for Xen to be able to handle
>> nodes with that property.
>>
>> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Thank you! I assume you meant Reviewed-by: Julien Grall 
<julien.grall@arm.com> )

Shall I send new version with proposed changes?


>
> I will give an opportunity to Stefano to review it. If I don't hear 
> anything by Monday, I will merge it.
>
> Thank you!
>
> Cheers,
>
-- 
Regards,

Oleksandr Tyshchenko


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop
  2019-05-29 17:58     ` Oleksandr
@ 2019-05-29 17:58       ` Oleksandr
  2019-05-29 18:18       ` Julien Grall
  1 sibling, 0 replies; 16+ messages in thread
From: Oleksandr @ 2019-05-29 17:58 UTC (permalink / raw)
  To: Julien Grall, xen-devel, sstabellini; +Cc: Oleksandr Tyshchenko


On 29.05.19 20:44, Julien Grall wrote:
> Hi Oleksandr,

Hi, Julien


>
> On 21/05/2019 18:37, Oleksandr Tyshchenko wrote:
>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>
>> The "interrupts-extended" property is a special form for use when
>> a node needs to reference multiple interrupt parents. >
>> According to the:
>
> NIT: s/the//
>
>> Linux/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt 
>>
>>
>> But, there are cases when "interrupts-extended" property is used for
>> "outside /soc node" with a single interrupt parent as an equivalent of
>> pairs ("interrupt-parent" + "interrupts").
>>
>> The good example here is ARCH timer node for R-Car Gen3/Gen2 family,
>
> NIT: s/The/A/ I think
>
>> which is mandatory device for Xen usage on ARM. And without ability
>> to handle such nodes, Xen fails to operate.
>>
>> So, this patch adds required support for Xen to be able to handle
>> nodes with that property.
>>
>> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Thank you! I assume you meant Reviewed-by: Julien Grall 
<julien.grall@arm.com> )

Shall I send new version with proposed changes?


>
> I will give an opportunity to Stefano to review it. If I don't hear 
> anything by Monday, I will merge it.
>
> Thank you!
>
> Cheers,
>
-- 
Regards,

Oleksandr Tyshchenko


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop
  2019-05-29 17:58     ` Oleksandr
  2019-05-29 17:58       ` [Xen-devel] " Oleksandr
@ 2019-05-29 18:18       ` Julien Grall
  2019-05-29 18:18         ` [Xen-devel] " Julien Grall
  2019-06-10 19:45         ` Julien Grall
  1 sibling, 2 replies; 16+ messages in thread
From: Julien Grall @ 2019-05-29 18:18 UTC (permalink / raw)
  To: Oleksandr, xen-devel, sstabellini; +Cc: Oleksandr Tyshchenko, nd



On 29/05/2019 18:58, Oleksandr wrote:
> 
> On 29.05.19 20:44, Julien Grall wrote:
>> Hi Oleksandr,
> 
> Hi, Julien
> 
> 
>>
>> On 21/05/2019 18:37, Oleksandr Tyshchenko wrote:
>>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>>
>>> The "interrupts-extended" property is a special form for use when
>>> a node needs to reference multiple interrupt parents. >
>>> According to the:
>>
>> NIT: s/the//
>>
>>> Linux/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt 
>>>
>>>
>>> But, there are cases when "interrupts-extended" property is used for
>>> "outside /soc node" with a single interrupt parent as an equivalent of
>>> pairs ("interrupt-parent" + "interrupts").
>>>
>>> The good example here is ARCH timer node for R-Car Gen3/Gen2 family,
>>
>> NIT: s/The/A/ I think
>>
>>> which is mandatory device for Xen usage on ARM. And without ability
>>> to handle such nodes, Xen fails to operate.
>>>
>>> So, this patch adds required support for Xen to be able to handle
>>> nodes with that property.
>>>
>>> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>
>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> Thank you! I assume you meant Reviewed-by: Julien Grall 
> <julien.grall@arm.com> )

Yes sorry, I was adding is reviewed-by on some of my patches and 
mechanically copied here. Apologies for the inconvenience.

> 
> Shall I send new version with proposed changes?

No need, I can do the change while committing (assuming Stefano has no 
other comments).

Cheers,

-- 
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop
  2019-05-29 18:18       ` Julien Grall
@ 2019-05-29 18:18         ` Julien Grall
  2019-06-10 19:45         ` Julien Grall
  1 sibling, 0 replies; 16+ messages in thread
From: Julien Grall @ 2019-05-29 18:18 UTC (permalink / raw)
  To: Oleksandr, xen-devel, sstabellini; +Cc: Oleksandr Tyshchenko, nd



On 29/05/2019 18:58, Oleksandr wrote:
> 
> On 29.05.19 20:44, Julien Grall wrote:
>> Hi Oleksandr,
> 
> Hi, Julien
> 
> 
>>
>> On 21/05/2019 18:37, Oleksandr Tyshchenko wrote:
>>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>>
>>> The "interrupts-extended" property is a special form for use when
>>> a node needs to reference multiple interrupt parents. >
>>> According to the:
>>
>> NIT: s/the//
>>
>>> Linux/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt 
>>>
>>>
>>> But, there are cases when "interrupts-extended" property is used for
>>> "outside /soc node" with a single interrupt parent as an equivalent of
>>> pairs ("interrupt-parent" + "interrupts").
>>>
>>> The good example here is ARCH timer node for R-Car Gen3/Gen2 family,
>>
>> NIT: s/The/A/ I think
>>
>>> which is mandatory device for Xen usage on ARM. And without ability
>>> to handle such nodes, Xen fails to operate.
>>>
>>> So, this patch adds required support for Xen to be able to handle
>>> nodes with that property.
>>>
>>> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>
>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> Thank you! I assume you meant Reviewed-by: Julien Grall 
> <julien.grall@arm.com> )

Yes sorry, I was adding is reviewed-by on some of my patches and 
mechanically copied here. Apologies for the inconvenience.

> 
> Shall I send new version with proposed changes?

No need, I can do the change while committing (assuming Stefano has no 
other comments).

Cheers,

-- 
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop
  2019-05-29 18:18       ` Julien Grall
  2019-05-29 18:18         ` [Xen-devel] " Julien Grall
@ 2019-06-10 19:45         ` Julien Grall
  2019-06-11 16:15           ` Oleksandr
  1 sibling, 1 reply; 16+ messages in thread
From: Julien Grall @ 2019-06-10 19:45 UTC (permalink / raw)
  To: Oleksandr, xen-devel, sstabellini; +Cc: Oleksandr Tyshchenko, nd

Hi,

On 5/29/19 7:18 PM, Julien Grall wrote:
> 
> 
> On 29/05/2019 18:58, Oleksandr wrote:
>>
>> On 29.05.19 20:44, Julien Grall wrote:
>>> Hi Oleksandr,
>>
>> Hi, Julien
>>
>>
>>>
>>> On 21/05/2019 18:37, Oleksandr Tyshchenko wrote:
>>>> From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>>>
>>>> The "interrupts-extended" property is a special form for use when
>>>> a node needs to reference multiple interrupt parents. >
>>>> According to the:
>>>
>>> NIT: s/the//
>>>
>>>> Linux/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt 
>>>>
>>>>
>>>> But, there are cases when "interrupts-extended" property is used for
>>>> "outside /soc node" with a single interrupt parent as an equivalent of
>>>> pairs ("interrupt-parent" + "interrupts").
>>>>
>>>> The good example here is ARCH timer node for R-Car Gen3/Gen2 family,
>>>
>>> NIT: s/The/A/ I think
>>>
>>>> which is mandatory device for Xen usage on ARM. And without ability
>>>> to handle such nodes, Xen fails to operate.
>>>>
>>>> So, this patch adds required support for Xen to be able to handle
>>>> nodes with that property.
>>>>
>>>> Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
>>>
>>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
>>
>> Thank you! I assume you meant Reviewed-by: Julien Grall 
>> <julien.grall@arm.com> )
> 
> Yes sorry, I was adding is reviewed-by on some of my patches and 
> mechanically copied here. Apologies for the inconvenience.
> 
>>
>> Shall I send new version with proposed changes?
> 
> No need, I can do the change while committing (assuming Stefano has no 
> other comments).

Now applied to my staging branch. It will be committed tonight.

Thank you for the patches.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop
  2019-06-10 19:45         ` Julien Grall
@ 2019-06-11 16:15           ` Oleksandr
  0 siblings, 0 replies; 16+ messages in thread
From: Oleksandr @ 2019-06-11 16:15 UTC (permalink / raw)
  To: Julien Grall, xen-devel, sstabellini; +Cc: Oleksandr Tyshchenko, nd


On 10.06.19 22:45, Julien Grall wrote:
> Hi,

Hi Julien


> Now applied to my staging branch. It will be committed tonight.
>
> Thank you for the patches.

Thank you for the review.


>
>
> Cheers,
>
-- 
Regards,

Oleksandr Tyshchenko


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2019-06-11 16:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-21 17:37 [PATCH V1 0/2] Add ability to handle nodes with interrupts-extended property Oleksandr Tyshchenko
2019-05-21 17:37 ` [Xen-devel] " Oleksandr Tyshchenko
2019-05-21 17:37 ` [PATCH V1 1/2] xen/device-tree: Add dt_count_phandle_with_args helper Oleksandr Tyshchenko
2019-05-21 17:37   ` [Xen-devel] " Oleksandr Tyshchenko
2019-05-29 17:34   ` Julien Grall
2019-05-29 17:34     ` [Xen-devel] " Julien Grall
2019-05-21 17:37 ` [PATCH V1 2/2] xen/device-tree: Add ability to handle nodes with interrupts-extended prop Oleksandr Tyshchenko
2019-05-21 17:37   ` [Xen-devel] " Oleksandr Tyshchenko
2019-05-29 17:44   ` Julien Grall
2019-05-29 17:44     ` [Xen-devel] " Julien Grall
2019-05-29 17:58     ` Oleksandr
2019-05-29 17:58       ` [Xen-devel] " Oleksandr
2019-05-29 18:18       ` Julien Grall
2019-05-29 18:18         ` [Xen-devel] " Julien Grall
2019-06-10 19:45         ` Julien Grall
2019-06-11 16:15           ` Oleksandr

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).