2021-01-15 21:03:48

by Suman Anna

[permalink] [raw]
Subject: [PATCH] dt-bindings: irqchip: Add #address-cells to PRUSS INTC

The '#address-cells' property looks to be a required property for
interrupt controller nodes as indicated by a warning message seen
when building dtbs with W=2. Adding the property to the PRUSS INTC
dts nodes though fails the dtbs_check. Add this property to the
PRUSS INTC binding to make it compliant with both dtbs_check and
building dtbs.

Signed-off-by: Suman Anna <[email protected]>
---
Hi Rob,

This patch is also part of our effort to get rid of the warnings seen
around interrupt providers on TI K3 dtbs [1]. I needed this in the PRUSS
INTC bindings to not get a warning with dtbs_check while also ensuring
no warnings while building dtbs with W=2.

I would have expected the '#address-cells' requirement to be inherited
automatically. And looking through the schema files, I actually do not
see the interrupt-controller.yaml included automatically anywhere. You
had asked us to drop the inclusion in this binding in our first version
with YAML [3]. Am I missing something, and how do we ensure that this
is enforced automatically for everyone?

regards
Suman

[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/[email protected]/
[2] https://patchwork.kernel.org/project/linux-arm-kernel/cover/[email protected]/
[3] https://patchwork.kernel.org/comment/23484523/

.../bindings/interrupt-controller/ti,pruss-intc.yaml | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/interrupt-controller/ti,pruss-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/ti,pruss-intc.yaml
index c2ce215501a5..dcbfe08e997d 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/ti,pruss-intc.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/ti,pruss-intc.yaml
@@ -79,6 +79,9 @@ properties:
mapping and channels to host interrupts so through this property entire
mapping is provided.

+ "#address-cells":
+ const: 0
+
ti,irqs-reserved:
$ref: /schemas/types.yaml#/definitions/uint8
description: |
@@ -100,6 +103,7 @@ required:
- interrupt-names
- interrupt-controller
- "#interrupt-cells"
+ - "#address-cells"

additionalProperties: false

@@ -123,6 +127,7 @@ examples:
"host_intr6", "host_intr7";
interrupt-controller;
#interrupt-cells = <3>;
+ #address-cells = <0>;
};
};

@@ -142,6 +147,7 @@ examples:
reg = <0x20000 0x2000>;
interrupt-controller;
#interrupt-cells = <3>;
+ #address-cells = <0>;
interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>,
--
2.29.2


2021-01-26 02:45:47

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: irqchip: Add #address-cells to PRUSS INTC

On Fri, Jan 15, 2021 at 02:58:19PM -0600, Suman Anna wrote:
> The '#address-cells' property looks to be a required property for
> interrupt controller nodes as indicated by a warning message seen
> when building dtbs with W=2. Adding the property to the PRUSS INTC
> dts nodes though fails the dtbs_check. Add this property to the
> PRUSS INTC binding to make it compliant with both dtbs_check and
> building dtbs.
>
> Signed-off-by: Suman Anna <[email protected]>
> ---
> Hi Rob,
>
> This patch is also part of our effort to get rid of the warnings seen
> around interrupt providers on TI K3 dtbs [1]. I needed this in the PRUSS
> INTC bindings to not get a warning with dtbs_check while also ensuring
> no warnings while building dtbs with W=2.
>
> I would have expected the '#address-cells' requirement to be inherited
> automatically. And looking through the schema files, I actually do not
> see the interrupt-controller.yaml included automatically anywhere. You
> had asked us to drop the inclusion in this binding in our first version
> with YAML [3]. Am I missing something, and how do we ensure that this
> is enforced automatically for everyone?

interrupt-controller.yaml is applied to any node named
'interrupt-controller'. More generally, if 'compatible' is not present,
then we look at $nodename for the default 'select'. In your case, you
didn't name the node appropriately.

We can't check this in interrupt-controller.yaml because #address-cells
is not always 0. GICv3 is one notable exception.

>
> regards
> Suman
>
> [1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/[email protected]/

I've commented on this thread now in regards to #address-cells.

Rob

> [2] https://patchwork.kernel.org/project/linux-arm-kernel/cover/[email protected]/
> [3] https://patchwork.kernel.org/comment/23484523/
>
> .../bindings/interrupt-controller/ti,pruss-intc.yaml | 6 ++++++
> 1 file changed, 6 insertions(+)

2021-01-26 10:56:29

by Suman Anna

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: irqchip: Add #address-cells to PRUSS INTC

Hi Rob,

On 1/25/21 6:04 PM, Rob Herring wrote:
> On Fri, Jan 15, 2021 at 02:58:19PM -0600, Suman Anna wrote:
>> The '#address-cells' property looks to be a required property for
>> interrupt controller nodes as indicated by a warning message seen
>> when building dtbs with W=2. Adding the property to the PRUSS INTC
>> dts nodes though fails the dtbs_check. Add this property to the
>> PRUSS INTC binding to make it compliant with both dtbs_check and
>> building dtbs.
>>
>> Signed-off-by: Suman Anna <[email protected]>
>> ---
>> Hi Rob,
>>
>> This patch is also part of our effort to get rid of the warnings seen
>> around interrupt providers on TI K3 dtbs [1]. I needed this in the PRUSS
>> INTC bindings to not get a warning with dtbs_check while also ensuring
>> no warnings while building dtbs with W=2.
>>
>> I would have expected the '#address-cells' requirement to be inherited
>> automatically. And looking through the schema files, I actually do not
>> see the interrupt-controller.yaml included automatically anywhere. You
>> had asked us to drop the inclusion in this binding in our first version
>> with YAML [3]. Am I missing something, and how do we ensure that this
>> is enforced automatically for everyone?
>
> interrupt-controller.yaml is applied to any node named
> 'interrupt-controller'. More generally, if 'compatible' is not present,
> then we look at $nodename for the default 'select'. In your case, you
> didn't name the node appropriately.

Thanks for the clarification. Yeah, I didn't add anything specifically, since
the expectation is interrupt-controller. Should I be adding that to this binding?

>
> We can't check this in interrupt-controller.yaml because #address-cells
> is not always 0. GICv3 is one notable exception.
>
>>
>> regards
>> Suman
>>
>> [1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/[email protected]/
>
> I've commented on this thread now in regards to #address-cells.

I suppose I still need this patch to be defined to unblock the ICSSG nodes
getting accepted by our dts maintainer. Care to give your Reviewed-by for the
change? Or I can spin a v2 with $nodename added as well if that's needed too.

regards
Suman

>
> Rob
>
>> [2] https://patchwork.kernel.org/project/linux-arm-kernel/cover/[email protected]/
>> [3] https://patchwork.kernel.org/comment/23484523/
>>
>> .../bindings/interrupt-controller/ti,pruss-intc.yaml | 6 ++++++
>> 1 file changed, 6 insertions(+)

2021-01-26 10:57:52

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: irqchip: Add #address-cells to PRUSS INTC

On Mon, Jan 25, 2021 at 6:16 PM Suman Anna <[email protected]> wrote:
>
> Hi Rob,
>
> On 1/25/21 6:04 PM, Rob Herring wrote:
> > On Fri, Jan 15, 2021 at 02:58:19PM -0600, Suman Anna wrote:
> >> The '#address-cells' property looks to be a required property for
> >> interrupt controller nodes as indicated by a warning message seen
> >> when building dtbs with W=2. Adding the property to the PRUSS INTC
> >> dts nodes though fails the dtbs_check. Add this property to the
> >> PRUSS INTC binding to make it compliant with both dtbs_check and
> >> building dtbs.
> >>
> >> Signed-off-by: Suman Anna <[email protected]>
> >> ---
> >> Hi Rob,
> >>
> >> This patch is also part of our effort to get rid of the warnings seen
> >> around interrupt providers on TI K3 dtbs [1]. I needed this in the PRUSS
> >> INTC bindings to not get a warning with dtbs_check while also ensuring
> >> no warnings while building dtbs with W=2.
> >>
> >> I would have expected the '#address-cells' requirement to be inherited
> >> automatically. And looking through the schema files, I actually do not
> >> see the interrupt-controller.yaml included automatically anywhere. You
> >> had asked us to drop the inclusion in this binding in our first version
> >> with YAML [3]. Am I missing something, and how do we ensure that this
> >> is enforced automatically for everyone?
> >
> > interrupt-controller.yaml is applied to any node named
> > 'interrupt-controller'. More generally, if 'compatible' is not present,
> > then we look at $nodename for the default 'select'. In your case, you
> > didn't name the node appropriately.
>
> Thanks for the clarification. Yeah, I didn't add anything specifically, since
> the expectation is interrupt-controller. Should I be adding that to this binding?

No, either interrupt-controller.yaml needs to learn a new node name or
your node names need to be fixed. I prefer the latter, but if you have
more than 1 and don't have a unit-address (and in turn a 'reg' prop)
we'd have to do the former. How are the interrupts controllers
accessed if there's no way to address them?

>
> >
> > We can't check this in interrupt-controller.yaml because #address-cells
> > is not always 0. GICv3 is one notable exception.
> >
> >>
> >> regards
> >> Suman
> >>
> >> [1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/[email protected]/
> >
> > I've commented on this thread now in regards to #address-cells.
>
> I suppose I still need this patch to be defined to unblock the ICSSG nodes
> getting accepted by our dts maintainer. Care to give your Reviewed-by for the
> change? Or I can spin a v2 with $nodename added as well if that's needed too.

No, I don't think you have to add #address-cells. We need to fix the
warning in dtc.

Rob

2021-01-26 19:30:12

by Suman Anna

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: irqchip: Add #address-cells to PRUSS INTC

Hi Rob,

On 1/25/21 8:47 PM, Rob Herring wrote:
> On Mon, Jan 25, 2021 at 6:16 PM Suman Anna <[email protected]> wrote:
>>
>> Hi Rob,
>>
>> On 1/25/21 6:04 PM, Rob Herring wrote:
>>> On Fri, Jan 15, 2021 at 02:58:19PM -0600, Suman Anna wrote:
>>>> The '#address-cells' property looks to be a required property for
>>>> interrupt controller nodes as indicated by a warning message seen
>>>> when building dtbs with W=2. Adding the property to the PRUSS INTC
>>>> dts nodes though fails the dtbs_check. Add this property to the
>>>> PRUSS INTC binding to make it compliant with both dtbs_check and
>>>> building dtbs.
>>>>
>>>> Signed-off-by: Suman Anna <[email protected]>
>>>> ---
>>>> Hi Rob,
>>>>
>>>> This patch is also part of our effort to get rid of the warnings seen
>>>> around interrupt providers on TI K3 dtbs [1]. I needed this in the PRUSS
>>>> INTC bindings to not get a warning with dtbs_check while also ensuring
>>>> no warnings while building dtbs with W=2.
>>>>
>>>> I would have expected the '#address-cells' requirement to be inherited
>>>> automatically. And looking through the schema files, I actually do not
>>>> see the interrupt-controller.yaml included automatically anywhere. You
>>>> had asked us to drop the inclusion in this binding in our first version
>>>> with YAML [3]. Am I missing something, and how do we ensure that this
>>>> is enforced automatically for everyone?
>>>
>>> interrupt-controller.yaml is applied to any node named
>>> 'interrupt-controller'. More generally, if 'compatible' is not present,
>>> then we look at $nodename for the default 'select'. In your case, you
>>> didn't name the node appropriately.
>>
>> Thanks for the clarification. Yeah, I didn't add anything specifically, since
>> the expectation is interrupt-controller. Should I be adding that to this binding?
>
> No, either interrupt-controller.yaml needs to learn a new node name or
> your node names need to be fixed. I prefer the latter, but if you have
> more than 1 and don't have a unit-address (and in turn a 'reg' prop)
> we'd have to do the former. How are the interrupts controllers
> accessed if there's no way to address them?

The PRUSS INTC will always have a unit-address, so we won't have the issues with
having to maintain unique names. All my examples already have the nodes in the
form 'interrupt-controller@<addr>'. Anyway, I will drop this patch, and post a
new patch adding the $nodename to the binding.

>
>>
>>>
>>> We can't check this in interrupt-controller.yaml because #address-cells
>>> is not always 0. GICv3 is one notable exception.
>>>
>>>>
>>>> regards
>>>> Suman
>>>>
>>>> [1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/[email protected]/
>>>
>>> I've commented on this thread now in regards to #address-cells.
>>
>> I suppose I still need this patch to be defined to unblock the ICSSG nodes
>> getting accepted by our dts maintainer. Care to give your Reviewed-by for the
>> change? Or I can spin a v2 with $nodename added as well if that's needed too.
>
> No, I don't think you have to add #address-cells. We need to fix the
> warning in dtc.

Thank you for clarifying this.

regards
Suman