All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of/irq: lookup 'interrupts-extended' property first
@ 2014-06-19 23:33 Florian Fainelli
  2014-07-31 18:00   ` Florian Fainelli
  0 siblings, 1 reply; 13+ messages in thread
From: Florian Fainelli @ 2014-06-19 23:33 UTC (permalink / raw)
  To: devicetree
  Cc: grant.likely, robh+dt, computersforpeace, linux-kernel, Florian Fainelli

In case the Device Tree blob passed by the boot agent supplies both an
'interrupts-extended' and an 'interrupts' property in order to allow for
older kernels to be usable, prefer the new-style 'interrupts-extended'
property which convey a lot more information.

This allows us to have bootloaders willingly maintaining backwards
compatibility with older kernels without entirely deprecating the
'interrupts' property (although that is a clear violation of the binding
specified at
Documentation/devicetree/bindings/interrupt-controller/interrupts.txt)

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/of/irq.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 3e06a699352d..1af3be2396db 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -301,16 +301,17 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar
 	/* Get the reg property (if any) */
 	addr = of_get_property(device, "reg", NULL);
 
+	/* Try the new-style interrupts-extended */
+	res = of_parse_phandle_with_args(device, "interrupts-extended",
+					"#interrupt-cells", index, out_irq);
+	if (!res)
+		return of_irq_parse_raw(addr, out_irq);
+
 	/* Get the interrupts property */
 	intspec = of_get_property(device, "interrupts", &intlen);
-	if (intspec == NULL) {
-		/* Try the new-style interrupts-extended */
-		res = of_parse_phandle_with_args(device, "interrupts-extended",
-						"#interrupt-cells", index, out_irq);
-		if (res)
-			return -EINVAL;
-		return of_irq_parse_raw(addr, out_irq);
-	}
+	if (intspec == NULL)
+		return -EINVAL;
+
 	intlen /= sizeof(*intspec);
 
 	pr_debug(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
-- 
1.9.1


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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
@ 2014-07-31 18:00   ` Florian Fainelli
  0 siblings, 0 replies; 13+ messages in thread
From: Florian Fainelli @ 2014-07-31 18:00 UTC (permalink / raw)
  To: devicetree
  Cc: Grant Likely, Rob Herring, Brian Norris, linux-kernel, Florian Fainelli

2014-06-19 16:33 GMT-07:00 Florian Fainelli <f.fainelli@gmail.com>:
> In case the Device Tree blob passed by the boot agent supplies both an
> 'interrupts-extended' and an 'interrupts' property in order to allow for
> older kernels to be usable, prefer the new-style 'interrupts-extended'
> property which convey a lot more information.
>
> This allows us to have bootloaders willingly maintaining backwards
> compatibility with older kernels without entirely deprecating the
> 'interrupts' property (although that is a clear violation of the binding
> specified at
> Documentation/devicetree/bindings/interrupt-controller/interrupts.txt)

Any comments on this? Brian suggested that I update
interrupt-controller/interrupts.txt to specify the look up ordering
change as well.

Thanks!

>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/of/irq.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/of/irq.c b/drivers/of/irq.c
> index 3e06a699352d..1af3be2396db 100644
> --- a/drivers/of/irq.c
> +++ b/drivers/of/irq.c
> @@ -301,16 +301,17 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar
>         /* Get the reg property (if any) */
>         addr = of_get_property(device, "reg", NULL);
>
> +       /* Try the new-style interrupts-extended */
> +       res = of_parse_phandle_with_args(device, "interrupts-extended",
> +                                       "#interrupt-cells", index, out_irq);
> +       if (!res)
> +               return of_irq_parse_raw(addr, out_irq);
> +
>         /* Get the interrupts property */
>         intspec = of_get_property(device, "interrupts", &intlen);
> -       if (intspec == NULL) {
> -               /* Try the new-style interrupts-extended */
> -               res = of_parse_phandle_with_args(device, "interrupts-extended",
> -                                               "#interrupt-cells", index, out_irq);
> -               if (res)
> -                       return -EINVAL;
> -               return of_irq_parse_raw(addr, out_irq);
> -       }
> +       if (intspec == NULL)
> +               return -EINVAL;
> +
>         intlen /= sizeof(*intspec);
>
>         pr_debug(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
> --
> 1.9.1
>



-- 
Florian

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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
@ 2014-07-31 18:00   ` Florian Fainelli
  0 siblings, 0 replies; 13+ messages in thread
From: Florian Fainelli @ 2014-07-31 18:00 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA
  Cc: Grant Likely, Rob Herring, Brian Norris,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Florian Fainelli

2014-06-19 16:33 GMT-07:00 Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
> In case the Device Tree blob passed by the boot agent supplies both an
> 'interrupts-extended' and an 'interrupts' property in order to allow for
> older kernels to be usable, prefer the new-style 'interrupts-extended'
> property which convey a lot more information.
>
> This allows us to have bootloaders willingly maintaining backwards
> compatibility with older kernels without entirely deprecating the
> 'interrupts' property (although that is a clear violation of the binding
> specified at
> Documentation/devicetree/bindings/interrupt-controller/interrupts.txt)

Any comments on this? Brian suggested that I update
interrupt-controller/interrupts.txt to specify the look up ordering
change as well.

Thanks!

>
> Signed-off-by: Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/of/irq.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/of/irq.c b/drivers/of/irq.c
> index 3e06a699352d..1af3be2396db 100644
> --- a/drivers/of/irq.c
> +++ b/drivers/of/irq.c
> @@ -301,16 +301,17 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar
>         /* Get the reg property (if any) */
>         addr = of_get_property(device, "reg", NULL);
>
> +       /* Try the new-style interrupts-extended */
> +       res = of_parse_phandle_with_args(device, "interrupts-extended",
> +                                       "#interrupt-cells", index, out_irq);
> +       if (!res)
> +               return of_irq_parse_raw(addr, out_irq);
> +
>         /* Get the interrupts property */
>         intspec = of_get_property(device, "interrupts", &intlen);
> -       if (intspec == NULL) {
> -               /* Try the new-style interrupts-extended */
> -               res = of_parse_phandle_with_args(device, "interrupts-extended",
> -                                               "#interrupt-cells", index, out_irq);
> -               if (res)
> -                       return -EINVAL;
> -               return of_irq_parse_raw(addr, out_irq);
> -       }
> +       if (intspec == NULL)
> +               return -EINVAL;
> +
>         intlen /= sizeof(*intspec);
>
>         pr_debug(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
> --
> 1.9.1
>



-- 
Florian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
  2014-07-31 18:00   ` Florian Fainelli
  (?)
@ 2014-08-06 16:54   ` Brian Norris
  2014-08-06 18:42       ` Rob Herring
  -1 siblings, 1 reply; 13+ messages in thread
From: Brian Norris @ 2014-08-06 16:54 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: devicetree, Grant Likely, Rob Herring, linux-kernel

Hi Grant, et al,

Can we get a comment here?

On Thu, Jul 31, 2014 at 11:00:01AM -0700, Florian Fainelli wrote:
> 2014-06-19 16:33 GMT-07:00 Florian Fainelli <f.fainelli@gmail.com>:
> > In case the Device Tree blob passed by the boot agent supplies both an
> > 'interrupts-extended' and an 'interrupts' property in order to allow for
> > older kernels to be usable, prefer the new-style 'interrupts-extended'
> > property which convey a lot more information.
> >
> > This allows us to have bootloaders willingly maintaining backwards
> > compatibility with older kernels without entirely deprecating the
> > 'interrupts' property (although that is a clear violation of the binding
> > specified at
> > Documentation/devicetree/bindings/interrupt-controller/interrupts.txt)

For the patch:

Acked-by: Brian Norris <computersforpeace@gmail.com>

I think it is important that a device tree provide some flexibility on
kernel versions. We only invented 'interrupts-extended' in Linux 3.13,
so it's easy to have device trees that could work only on 3.13+.

Typically, we might say that new features require new kernels, but this
is a very basic piece of the DT infrastructure. In our case, we have
hardware whose basic features can be supported by a single interrupt
parent, and so we used the 'interrupts' property pre-3.13. But when we
want to add some power management features, there's an additional
interrupt parent. Under the current DT binding, we have to switch over
to using 'interrupts-extended' exclusively, and thus we must have a
completely new DTB for >=3.13, and this DTB no longer works with the old
kernels.

How's that for DT stability?

On the other hand, if we support this precedence concept, then a new DTB
can provide both the 'interrupts-extended' and 'interrupts' properties,
and thus be compatible with both pre-3.13 and
post-<whenever-this-is-accepted> kernels.

> Any comments on this? Brian suggested that I update
> interrupt-controller/interrupts.txt to specify the look up ordering
> change as well.

What do you think about the following DT binding doc update to accompany
this change?

Signed-off-by: Brian Norris <computersforpeace@gmail.com>

diff --git a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
index 1486497a24c1..ce6a1a072028 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
@@ -4,11 +4,13 @@ Specifying interrupt information for devices
 1) Interrupt client nodes
 -------------------------
 
-Nodes that describe devices which generate interrupts must contain an either an
-"interrupts" property or an "interrupts-extended" property. These properties
-contain a list of interrupt specifiers, one per output interrupt. The format of
-the interrupt specifier is determined by the interrupt controller to which the
-interrupts are routed; see section 2 below for details.
+Nodes that describe devices which generate interrupts must contain an
+"interrupts" property, an "interrupts-extended" property, or both. If both are
+present, the latter should take precedence; the former may be provided simply
+for compatibility with software that does not recognize the latter. These
+properties contain a list of interrupt specifiers, one per output interrupt. The
+format of the interrupt specifier is determined by the interrupt controller to
+which the interrupts are routed; see section 2 below for details.
 
   Example:
 	interrupt-parent = <&intc1>;

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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
  2014-08-06 16:54   ` Brian Norris
@ 2014-08-06 18:42       ` Rob Herring
  0 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2014-08-06 18:42 UTC (permalink / raw)
  To: Brian Norris
  Cc: Florian Fainelli, devicetree, Grant Likely, Rob Herring, linux-kernel

On Wed, Aug 6, 2014 at 11:54 AM, Brian Norris
<computersforpeace@gmail.com> wrote:
> Hi Grant, et al,
>
> Can we get a comment here?
>
> On Thu, Jul 31, 2014 at 11:00:01AM -0700, Florian Fainelli wrote:
>> 2014-06-19 16:33 GMT-07:00 Florian Fainelli <f.fainelli@gmail.com>:
>> > In case the Device Tree blob passed by the boot agent supplies both an
>> > 'interrupts-extended' and an 'interrupts' property in order to allow for
>> > older kernels to be usable, prefer the new-style 'interrupts-extended'
>> > property which convey a lot more information.
>> >
>> > This allows us to have bootloaders willingly maintaining backwards
>> > compatibility with older kernels without entirely deprecating the
>> > 'interrupts' property (although that is a clear violation of the binding
>> > specified at
>> > Documentation/devicetree/bindings/interrupt-controller/interrupts.txt)
>
> For the patch:
>
> Acked-by: Brian Norris <computersforpeace@gmail.com>
>
> I think it is important that a device tree provide some flexibility on
> kernel versions. We only invented 'interrupts-extended' in Linux 3.13,
> so it's easy to have device trees that could work only on 3.13+.
>
> Typically, we might say that new features require new kernels, but this
> is a very basic piece of the DT infrastructure. In our case, we have
> hardware whose basic features can be supported by a single interrupt
> parent, and so we used the 'interrupts' property pre-3.13. But when we
> want to add some power management features, there's an additional
> interrupt parent. Under the current DT binding, we have to switch over
> to using 'interrupts-extended' exclusively, and thus we must have a
> completely new DTB for >=3.13, and this DTB no longer works with the old
> kernels.

"Must have" to enable the new features? I would expect a new kernel
and old dtb still works, right? That is the most important
compatibility issue to consider.

> How's that for DT stability?
>
> On the other hand, if we support this precedence concept, then a new DTB
> can provide both the 'interrupts-extended' and 'interrupts' properties,
> and thus be compatible with both pre-3.13 and
> post-<whenever-this-is-accepted> kernels.

Yes, this is what should be done. And I don't have any issue marking
this for stable if needed.

>> Any comments on this? Brian suggested that I update
>> interrupt-controller/interrupts.txt to specify the look up ordering
>> change as well.
>
> What do you think about the following DT binding doc update to accompany
> this change?

For both changes,

Acked-by: Rob Herring <robh@kernel.org>

Can you send a proper patch for the doc change or combine them.

Rob

>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
>
> diff --git a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> index 1486497a24c1..ce6a1a072028 100644
> --- a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> +++ b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> @@ -4,11 +4,13 @@ Specifying interrupt information for devices
>  1) Interrupt client nodes
>  -------------------------
>
> -Nodes that describe devices which generate interrupts must contain an either an
> -"interrupts" property or an "interrupts-extended" property. These properties
> -contain a list of interrupt specifiers, one per output interrupt. The format of
> -the interrupt specifier is determined by the interrupt controller to which the
> -interrupts are routed; see section 2 below for details.
> +Nodes that describe devices which generate interrupts must contain an
> +"interrupts" property, an "interrupts-extended" property, or both. If both are
> +present, the latter should take precedence; the former may be provided simply
> +for compatibility with software that does not recognize the latter. These
> +properties contain a list of interrupt specifiers, one per output interrupt. The
> +format of the interrupt specifier is determined by the interrupt controller to
> +which the interrupts are routed; see section 2 below for details.
>
>    Example:
>         interrupt-parent = <&intc1>;

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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
@ 2014-08-06 18:42       ` Rob Herring
  0 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2014-08-06 18:42 UTC (permalink / raw)
  To: Brian Norris
  Cc: Florian Fainelli, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Grant Likely, Rob Herring, linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Wed, Aug 6, 2014 at 11:54 AM, Brian Norris
<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi Grant, et al,
>
> Can we get a comment here?
>
> On Thu, Jul 31, 2014 at 11:00:01AM -0700, Florian Fainelli wrote:
>> 2014-06-19 16:33 GMT-07:00 Florian Fainelli <f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>> > In case the Device Tree blob passed by the boot agent supplies both an
>> > 'interrupts-extended' and an 'interrupts' property in order to allow for
>> > older kernels to be usable, prefer the new-style 'interrupts-extended'
>> > property which convey a lot more information.
>> >
>> > This allows us to have bootloaders willingly maintaining backwards
>> > compatibility with older kernels without entirely deprecating the
>> > 'interrupts' property (although that is a clear violation of the binding
>> > specified at
>> > Documentation/devicetree/bindings/interrupt-controller/interrupts.txt)
>
> For the patch:
>
> Acked-by: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> I think it is important that a device tree provide some flexibility on
> kernel versions. We only invented 'interrupts-extended' in Linux 3.13,
> so it's easy to have device trees that could work only on 3.13+.
>
> Typically, we might say that new features require new kernels, but this
> is a very basic piece of the DT infrastructure. In our case, we have
> hardware whose basic features can be supported by a single interrupt
> parent, and so we used the 'interrupts' property pre-3.13. But when we
> want to add some power management features, there's an additional
> interrupt parent. Under the current DT binding, we have to switch over
> to using 'interrupts-extended' exclusively, and thus we must have a
> completely new DTB for >=3.13, and this DTB no longer works with the old
> kernels.

"Must have" to enable the new features? I would expect a new kernel
and old dtb still works, right? That is the most important
compatibility issue to consider.

> How's that for DT stability?
>
> On the other hand, if we support this precedence concept, then a new DTB
> can provide both the 'interrupts-extended' and 'interrupts' properties,
> and thus be compatible with both pre-3.13 and
> post-<whenever-this-is-accepted> kernels.

Yes, this is what should be done. And I don't have any issue marking
this for stable if needed.

>> Any comments on this? Brian suggested that I update
>> interrupt-controller/interrupts.txt to specify the look up ordering
>> change as well.
>
> What do you think about the following DT binding doc update to accompany
> this change?

For both changes,

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

Can you send a proper patch for the doc change or combine them.

Rob

>
> Signed-off-by: Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> diff --git a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> index 1486497a24c1..ce6a1a072028 100644
> --- a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> +++ b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> @@ -4,11 +4,13 @@ Specifying interrupt information for devices
>  1) Interrupt client nodes
>  -------------------------
>
> -Nodes that describe devices which generate interrupts must contain an either an
> -"interrupts" property or an "interrupts-extended" property. These properties
> -contain a list of interrupt specifiers, one per output interrupt. The format of
> -the interrupt specifier is determined by the interrupt controller to which the
> -interrupts are routed; see section 2 below for details.
> +Nodes that describe devices which generate interrupts must contain an
> +"interrupts" property, an "interrupts-extended" property, or both. If both are
> +present, the latter should take precedence; the former may be provided simply
> +for compatibility with software that does not recognize the latter. These
> +properties contain a list of interrupt specifiers, one per output interrupt. The
> +format of the interrupt specifier is determined by the interrupt controller to
> +which the interrupts are routed; see section 2 below for details.
>
>    Example:
>         interrupt-parent = <&intc1>;
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
  2014-08-06 18:42       ` Rob Herring
  (?)
@ 2014-08-06 20:12       ` Brian Norris
  2014-08-06 21:50           ` Tim Bird
  -1 siblings, 1 reply; 13+ messages in thread
From: Brian Norris @ 2014-08-06 20:12 UTC (permalink / raw)
  To: Rob Herring
  Cc: Florian Fainelli, devicetree, Grant Likely, Rob Herring, linux-kernel

On Wed, Aug 06, 2014 at 01:42:08PM -0500, Rob Herring wrote:
> On Wed, Aug 6, 2014 at 11:54 AM, Brian Norris <computersforpeace@gmail.com> wrote:
> > On Thu, Jul 31, 2014 at 11:00:01AM -0700, Florian Fainelli wrote:
> > I think it is important that a device tree provide some flexibility on
> > kernel versions. We only invented 'interrupts-extended' in Linux 3.13,
> > so it's easy to have device trees that could work only on 3.13+.
> >
> > Typically, we might say that new features require new kernels, but this
> > is a very basic piece of the DT infrastructure. In our case, we have
> > hardware whose basic features can be supported by a single interrupt
> > parent, and so we used the 'interrupts' property pre-3.13. But when we
> > want to add some power management features, there's an additional
> > interrupt parent. Under the current DT binding, we have to switch over
> > to using 'interrupts-extended' exclusively, and thus we must have a
> > completely new DTB for >=3.13, and this DTB no longer works with the old
> > kernels.
> 
> "Must have" to enable the new features?

Yes. The new feature requires an additional interrupt parent, and so it
requires interrupts-extended.

> I would expect a new kernel
> and old dtb still works, right? That is the most important
> compatibility issue to consider.

Yes, new kernels work with an old DTB.

The problem we are considering is that old kernels don't work with new
DTBs, unless you allow both interrupts and interrupts-extended in a new
DTB.

> > How's that for DT stability?
> >
> > On the other hand, if we support this precedence concept, then a new DTB
> > can provide both the 'interrupts-extended' and 'interrupts' properties,
> > and thus be compatible with both pre-3.13 and
> > post-<whenever-this-is-accepted> kernels.
> 
> Yes, this is what should be done. And I don't have any issue marking
> this for stable if needed.

Fine with me. We'll be porting it for our downstream kernels anyway.

> >> Any comments on this? Brian suggested that I update
> >> interrupt-controller/interrupts.txt to specify the look up ordering
> >> change as well.
> >
> > What do you think about the following DT binding doc update to accompany
> > this change?
> 
> For both changes,
> 
> Acked-by: Rob Herring <robh@kernel.org>
> 
> Can you send a proper patch for the doc change or combine them.

Florian just sent the combined version.

Brian

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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
  2014-08-06 20:12       ` Brian Norris
@ 2014-08-06 21:50           ` Tim Bird
  0 siblings, 0 replies; 13+ messages in thread
From: Tim Bird @ 2014-08-06 21:50 UTC (permalink / raw)
  To: Brian Norris
  Cc: Rob Herring, Florian Fainelli, devicetree, Grant Likely,
	Rob Herring, linux-kernel

On Wed, Aug 6, 2014 at 1:12 PM, Brian Norris
<computersforpeace@gmail.com> wrote:
> On Wed, Aug 06, 2014 at 01:42:08PM -0500, Rob Herring wrote:
>> On Wed, Aug 6, 2014 at 11:54 AM, Brian Norris <computersforpeace@gmail.com> wrote:
>> > On Thu, Jul 31, 2014 at 11:00:01AM -0700, Florian Fainelli wrote:
>> > I think it is important that a device tree provide some flexibility on
>> > kernel versions. We only invented 'interrupts-extended' in Linux 3.13,
>> > so it's easy to have device trees that could work only on 3.13+.
>> >
>> > Typically, we might say that new features require new kernels, but this
>> > is a very basic piece of the DT infrastructure. In our case, we have
>> > hardware whose basic features can be supported by a single interrupt
>> > parent, and so we used the 'interrupts' property pre-3.13. But when we
>> > want to add some power management features, there's an additional
>> > interrupt parent. Under the current DT binding, we have to switch over
>> > to using 'interrupts-extended' exclusively, and thus we must have a
>> > completely new DTB for >=3.13, and this DTB no longer works with the old
>> > kernels.
>>
>> "Must have" to enable the new features?
>
> Yes. The new feature requires an additional interrupt parent, and so it
> requires interrupts-extended.

Hold on there.  What about interrupt-map?  That was the traditional DT
feature for
supporting multi-parented interrupts.  Why couldn't the feature have been added
using that instead of interrupts-extended?

I know interrupts-extended is preferred, but has interrupt-map support been
removed from recent kernels?  I'm a bit confused.

 -- Tim Bird
Senior Software Engineer, Sony Mobile
Architecture Group Chair, CE Workgroup, Linux Foundation

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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
@ 2014-08-06 21:50           ` Tim Bird
  0 siblings, 0 replies; 13+ messages in thread
From: Tim Bird @ 2014-08-06 21:50 UTC (permalink / raw)
  To: Brian Norris
  Cc: Rob Herring, Florian Fainelli, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Grant Likely, Rob Herring, linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Wed, Aug 6, 2014 at 1:12 PM, Brian Norris
<computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Wed, Aug 06, 2014 at 01:42:08PM -0500, Rob Herring wrote:
>> On Wed, Aug 6, 2014 at 11:54 AM, Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> > On Thu, Jul 31, 2014 at 11:00:01AM -0700, Florian Fainelli wrote:
>> > I think it is important that a device tree provide some flexibility on
>> > kernel versions. We only invented 'interrupts-extended' in Linux 3.13,
>> > so it's easy to have device trees that could work only on 3.13+.
>> >
>> > Typically, we might say that new features require new kernels, but this
>> > is a very basic piece of the DT infrastructure. In our case, we have
>> > hardware whose basic features can be supported by a single interrupt
>> > parent, and so we used the 'interrupts' property pre-3.13. But when we
>> > want to add some power management features, there's an additional
>> > interrupt parent. Under the current DT binding, we have to switch over
>> > to using 'interrupts-extended' exclusively, and thus we must have a
>> > completely new DTB for >=3.13, and this DTB no longer works with the old
>> > kernels.
>>
>> "Must have" to enable the new features?
>
> Yes. The new feature requires an additional interrupt parent, and so it
> requires interrupts-extended.

Hold on there.  What about interrupt-map?  That was the traditional DT
feature for
supporting multi-parented interrupts.  Why couldn't the feature have been added
using that instead of interrupts-extended?

I know interrupts-extended is preferred, but has interrupt-map support been
removed from recent kernels?  I'm a bit confused.

 -- Tim Bird
Senior Software Engineer, Sony Mobile
Architecture Group Chair, CE Workgroup, Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
@ 2014-08-06 22:12             ` Florian Fainelli
  0 siblings, 0 replies; 13+ messages in thread
From: Florian Fainelli @ 2014-08-06 22:12 UTC (permalink / raw)
  To: Tim Bird, Brian Norris
  Cc: Rob Herring, devicetree, Grant Likely, Rob Herring, linux-kernel

On 08/06/2014 02:50 PM, Tim Bird wrote:
> On Wed, Aug 6, 2014 at 1:12 PM, Brian Norris
> <computersforpeace@gmail.com> wrote:
>> On Wed, Aug 06, 2014 at 01:42:08PM -0500, Rob Herring wrote:
>>> On Wed, Aug 6, 2014 at 11:54 AM, Brian Norris <computersforpeace@gmail.com> wrote:
>>>> On Thu, Jul 31, 2014 at 11:00:01AM -0700, Florian Fainelli wrote:
>>>> I think it is important that a device tree provide some flexibility on
>>>> kernel versions. We only invented 'interrupts-extended' in Linux 3.13,
>>>> so it's easy to have device trees that could work only on 3.13+.
>>>>
>>>> Typically, we might say that new features require new kernels, but this
>>>> is a very basic piece of the DT infrastructure. In our case, we have
>>>> hardware whose basic features can be supported by a single interrupt
>>>> parent, and so we used the 'interrupts' property pre-3.13. But when we
>>>> want to add some power management features, there's an additional
>>>> interrupt parent. Under the current DT binding, we have to switch over
>>>> to using 'interrupts-extended' exclusively, and thus we must have a
>>>> completely new DTB for >=3.13, and this DTB no longer works with the old
>>>> kernels.
>>>
>>> "Must have" to enable the new features?
>>
>> Yes. The new feature requires an additional interrupt parent, and so it
>> requires interrupts-extended.
> 
> Hold on there.  What about interrupt-map?  That was the traditional DT
> feature for
> supporting multi-parented interrupts.  Why couldn't the feature have been added
> using that instead of interrupts-extended?

As far as I read it from the ePAPR specification, you have a good point
here, it looks like 'interrupt-map' could have been used as-is instead
of 'interrupts-extended'. In fact it is a little more general than
'interrupts-extended' since it allows any sort of "child unit address",
whether that is an actual interrupt number, or something else, is
dependent on the type of node being used.

> 
> I know interrupts-extended is preferred, but has interrupt-map support been
> removed from recent kernels?  I'm a bit confused.

'interrupt-map' support has not been removed since that is heavily used
to cross interrupt domains, e.g: PCI relies heavily on it, other buses
as well most likely.

> 
>  -- Tim Bird
> Senior Software Engineer, Sony Mobile
> Architecture Group Chair, CE Workgroup, Linux Foundation
> 


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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
@ 2014-08-06 22:12             ` Florian Fainelli
  0 siblings, 0 replies; 13+ messages in thread
From: Florian Fainelli @ 2014-08-06 22:12 UTC (permalink / raw)
  To: Tim Bird, Brian Norris
  Cc: Rob Herring, devicetree-u79uwXL29TY76Z2rM5mHXA, Grant Likely,
	Rob Herring, linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 08/06/2014 02:50 PM, Tim Bird wrote:
> On Wed, Aug 6, 2014 at 1:12 PM, Brian Norris
> <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On Wed, Aug 06, 2014 at 01:42:08PM -0500, Rob Herring wrote:
>>> On Wed, Aug 6, 2014 at 11:54 AM, Brian Norris <computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> On Thu, Jul 31, 2014 at 11:00:01AM -0700, Florian Fainelli wrote:
>>>> I think it is important that a device tree provide some flexibility on
>>>> kernel versions. We only invented 'interrupts-extended' in Linux 3.13,
>>>> so it's easy to have device trees that could work only on 3.13+.
>>>>
>>>> Typically, we might say that new features require new kernels, but this
>>>> is a very basic piece of the DT infrastructure. In our case, we have
>>>> hardware whose basic features can be supported by a single interrupt
>>>> parent, and so we used the 'interrupts' property pre-3.13. But when we
>>>> want to add some power management features, there's an additional
>>>> interrupt parent. Under the current DT binding, we have to switch over
>>>> to using 'interrupts-extended' exclusively, and thus we must have a
>>>> completely new DTB for >=3.13, and this DTB no longer works with the old
>>>> kernels.
>>>
>>> "Must have" to enable the new features?
>>
>> Yes. The new feature requires an additional interrupt parent, and so it
>> requires interrupts-extended.
> 
> Hold on there.  What about interrupt-map?  That was the traditional DT
> feature for
> supporting multi-parented interrupts.  Why couldn't the feature have been added
> using that instead of interrupts-extended?

As far as I read it from the ePAPR specification, you have a good point
here, it looks like 'interrupt-map' could have been used as-is instead
of 'interrupts-extended'. In fact it is a little more general than
'interrupts-extended' since it allows any sort of "child unit address",
whether that is an actual interrupt number, or something else, is
dependent on the type of node being used.

> 
> I know interrupts-extended is preferred, but has interrupt-map support been
> removed from recent kernels?  I'm a bit confused.

'interrupt-map' support has not been removed since that is heavily used
to cross interrupt domains, e.g: PCI relies heavily on it, other buses
as well most likely.

> 
>  -- Tim Bird
> Senior Software Engineer, Sony Mobile
> Architecture Group Chair, CE Workgroup, Linux Foundation
> 

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
  2014-08-06 21:50           ` Tim Bird
  (?)
  (?)
@ 2014-08-06 22:24           ` Rob Herring
  -1 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2014-08-06 22:24 UTC (permalink / raw)
  To: Tim Bird
  Cc: Brian Norris, Florian Fainelli, devicetree, Grant Likely,
	Rob Herring, linux-kernel

On Wed, Aug 6, 2014 at 4:50 PM, Tim Bird <tbird20d@gmail.com> wrote:
> On Wed, Aug 6, 2014 at 1:12 PM, Brian Norris
> <computersforpeace@gmail.com> wrote:
>> On Wed, Aug 06, 2014 at 01:42:08PM -0500, Rob Herring wrote:
>>> On Wed, Aug 6, 2014 at 11:54 AM, Brian Norris <computersforpeace@gmail.com> wrote:
>>> > On Thu, Jul 31, 2014 at 11:00:01AM -0700, Florian Fainelli wrote:
>>> > I think it is important that a device tree provide some flexibility on
>>> > kernel versions. We only invented 'interrupts-extended' in Linux 3.13,
>>> > so it's easy to have device trees that could work only on 3.13+.
>>> >
>>> > Typically, we might say that new features require new kernels, but this
>>> > is a very basic piece of the DT infrastructure. In our case, we have
>>> > hardware whose basic features can be supported by a single interrupt
>>> > parent, and so we used the 'interrupts' property pre-3.13. But when we
>>> > want to add some power management features, there's an additional
>>> > interrupt parent. Under the current DT binding, we have to switch over
>>> > to using 'interrupts-extended' exclusively, and thus we must have a
>>> > completely new DTB for >=3.13, and this DTB no longer works with the old
>>> > kernels.
>>>
>>> "Must have" to enable the new features?
>>
>> Yes. The new feature requires an additional interrupt parent, and so it
>> requires interrupts-extended.
>
> Hold on there.  What about interrupt-map?  That was the traditional DT
> feature for
> supporting multi-parented interrupts.  Why couldn't the feature have been added
> using that instead of interrupts-extended?

It could have, but interrupts-extended is much more simple to express
for the simple case of a device's interrupts routed to more than one
parent.

> I know interrupts-extended is preferred, but has interrupt-map support been
> removed from recent kernels?  I'm a bit confused.

They are all still supported. It's just a question of order of parsing
if you have find both styles.

Rob

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

* Re: [PATCH] of/irq: lookup 'interrupts-extended' property first
  2014-08-06 22:12             ` Florian Fainelli
  (?)
@ 2014-08-15 12:56             ` Grant Likely
  -1 siblings, 0 replies; 13+ messages in thread
From: Grant Likely @ 2014-08-15 12:56 UTC (permalink / raw)
  To: Florian Fainelli, Tim Bird, Brian Norris
  Cc: Rob Herring, devicetree, Rob Herring, linux-kernel

On Wed, 06 Aug 2014 15:12:42 -0700, Florian Fainelli <f.fainelli@gmail.com> wrote:
> On 08/06/2014 02:50 PM, Tim Bird wrote:
> > On Wed, Aug 6, 2014 at 1:12 PM, Brian Norris
> > <computersforpeace@gmail.com> wrote:
> >> On Wed, Aug 06, 2014 at 01:42:08PM -0500, Rob Herring wrote:
> >>> On Wed, Aug 6, 2014 at 11:54 AM, Brian Norris <computersforpeace@gmail.com> wrote:
> >>>> On Thu, Jul 31, 2014 at 11:00:01AM -0700, Florian Fainelli wrote:
> >>>> I think it is important that a device tree provide some flexibility on
> >>>> kernel versions. We only invented 'interrupts-extended' in Linux 3.13,
> >>>> so it's easy to have device trees that could work only on 3.13+.
> >>>>
> >>>> Typically, we might say that new features require new kernels, but this
> >>>> is a very basic piece of the DT infrastructure. In our case, we have
> >>>> hardware whose basic features can be supported by a single interrupt
> >>>> parent, and so we used the 'interrupts' property pre-3.13. But when we
> >>>> want to add some power management features, there's an additional
> >>>> interrupt parent. Under the current DT binding, we have to switch over
> >>>> to using 'interrupts-extended' exclusively, and thus we must have a
> >>>> completely new DTB for >=3.13, and this DTB no longer works with the old
> >>>> kernels.
> >>>
> >>> "Must have" to enable the new features?
> >>
> >> Yes. The new feature requires an additional interrupt parent, and so it
> >> requires interrupts-extended.
> > 
> > Hold on there.  What about interrupt-map?  That was the traditional DT
> > feature for
> > supporting multi-parented interrupts.  Why couldn't the feature have been added
> > using that instead of interrupts-extended?
> 
> As far as I read it from the ePAPR specification, you have a good point
> here, it looks like 'interrupt-map' could have been used as-is instead
> of 'interrupts-extended'. In fact it is a little more general than
> 'interrupts-extended' since it allows any sort of "child unit address",
> whether that is an actual interrupt number, or something else, is
> dependent on the type of node being used.

Not really any more general. The child unit address is for filtering
which nodes get a particular map entry. That doesn't have any value when
the routing information is directly in the device node, which is what
interrupts-extended does.

interrupt-map certainly still works, but it is quite fiddly to use when
the use case is merely one device wired to multiple interrupt
controllers, and it is very easy to get wrong. interrupts-extended is
far more concise.

g.

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

end of thread, other threads:[~2014-08-15 12:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19 23:33 [PATCH] of/irq: lookup 'interrupts-extended' property first Florian Fainelli
2014-07-31 18:00 ` Florian Fainelli
2014-07-31 18:00   ` Florian Fainelli
2014-08-06 16:54   ` Brian Norris
2014-08-06 18:42     ` Rob Herring
2014-08-06 18:42       ` Rob Herring
2014-08-06 20:12       ` Brian Norris
2014-08-06 21:50         ` Tim Bird
2014-08-06 21:50           ` Tim Bird
2014-08-06 22:12           ` Florian Fainelli
2014-08-06 22:12             ` Florian Fainelli
2014-08-15 12:56             ` Grant Likely
2014-08-06 22:24           ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.