diff mbox series

[1/3] dt-bindings: net: dwmac: Increase 'maxItems' for 'interrupts' and 'interrupt-names'

Message ID 20250302181808.728734-2-prabhakar.mahadev-lad.rj@bp.renesas.com (mailing list archive)
State New
Delegated to: Geert Uytterhoeven
Headers show
Series Add GBETH glue layer driver for Renesas RZ/V2H(P) SoC | expand

Commit Message

Lad, Prabhakar March 2, 2025, 6:18 p.m. UTC
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Increase the `maxItems` value for the `interrupts` and `interrupt-names`
properties to accommodate the Renesas RZ/V2H(P) SoC, which features the
`snps,dwmac-5.20` IP with 11 interrupts.

Also add `additionalItems: true` to allow specifying extra interrupts
beyond the predefined ones. Update the `interrupt-names` property to
allow specifying extra `interrupt-names`.

Also refactor the optional `interrupt-names` property by consolidating
repeated enums into a single enum list.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Rob Herring March 3, 2025, 3:26 p.m. UTC | #1
On Sun, Mar 02, 2025 at 06:18:06PM +0000, Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> 
> Increase the `maxItems` value for the `interrupts` and `interrupt-names`
> properties to accommodate the Renesas RZ/V2H(P) SoC, which features the
> `snps,dwmac-5.20` IP with 11 interrupts.
> 
> Also add `additionalItems: true` to allow specifying extra interrupts
> beyond the predefined ones. Update the `interrupt-names` property to
> allow specifying extra `interrupt-names`.
> 
> Also refactor the optional `interrupt-names` property by consolidating
> repeated enums into a single enum list.
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
>  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index 91e75eb3f329..85d499bd49b5 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -110,6 +110,8 @@ properties:
>  
>    interrupts:
>      minItems: 1
> +    maxItems: 11
> +    additionalItems: true

This just increased the number if interrupts for anyone that allowed 4 
interrupts. Rockchip and Intel are 2 though it is not clear if they 
support more than 1. So maybe not a new problem, but you are making it 
worse. Any of the ones in the 'select' in this file are affected as 
well.

>      items:
>        - description: Combined signal for various interrupt events
>        - description: The interrupt to manage the remote wake-up packet detection
> @@ -118,11 +120,11 @@ properties:
>  
>    interrupt-names:
>      minItems: 1
> +    maxItems: 11
> +    additionalItems: true
>      items:
>        - const: macirq
>        - enum: [eth_wake_irq, eth_lpi, sfty]
> -      - enum: [eth_wake_irq, eth_lpi, sfty]
> -      - enum: [eth_wake_irq, eth_lpi, sfty]
>  
>    clocks:
>      minItems: 1
> -- 
> 2.43.0
>
Lad, Prabhakar March 3, 2025, 3:58 p.m. UTC | #2
Hi Rob,

Thank you for the review.

On Mon, Mar 3, 2025 at 3:26 PM Rob Herring <robh@kernel.org> wrote:
>
> On Sun, Mar 02, 2025 at 06:18:06PM +0000, Prabhakar wrote:
> > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> >
> > Increase the `maxItems` value for the `interrupts` and `interrupt-names`
> > properties to accommodate the Renesas RZ/V2H(P) SoC, which features the
> > `snps,dwmac-5.20` IP with 11 interrupts.
> >
> > Also add `additionalItems: true` to allow specifying extra interrupts
> > beyond the predefined ones. Update the `interrupt-names` property to
> > allow specifying extra `interrupt-names`.
> >
> > Also refactor the optional `interrupt-names` property by consolidating
> > repeated enums into a single enum list.
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > ---
> >  Documentation/devicetree/bindings/net/snps,dwmac.yaml | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > index 91e75eb3f329..85d499bd49b5 100644
> > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > @@ -110,6 +110,8 @@ properties:
> >
> >    interrupts:
> >      minItems: 1
> > +    maxItems: 11
> > +    additionalItems: true
>
> This just increased the number if interrupts for anyone that allowed 4
> interrupts. Rockchip and Intel are 2 though it is not clear if they
> support more than 1. So maybe not a new problem, but you are making it
> worse. Any of the ones in the 'select' in this file are affected as
> well.
>
How do you want me to handle this case:
1] Update vendors binding
2] Duplicate snps,dwmac.yaml in vendors binding.

Cheers,
Prabhakar
Andrew Lunn March 3, 2025, 4:34 p.m. UTC | #3
> How do you want me to handle this case:
> 1] Update vendors binding
> 2] Duplicate snps,dwmac.yaml in vendors binding.

Not the second. The stmmac driver is a mess because vendors do their
own thing rather than try to be the same as all other
vendors. Duplicating it will just make it worse.

	Andrew
Lad, Prabhakar March 3, 2025, 8:40 p.m. UTC | #4
Hi Andrew,

On Mon, Mar 3, 2025 at 4:34 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> > How do you want me to handle this case:
> > 1] Update vendors binding
> > 2] Duplicate snps,dwmac.yaml in vendors binding.
>
> Not the second. The stmmac driver is a mess because vendors do their
> own thing rather than try to be the same as all other
> vendors. Duplicating it will just make it worse.
>
Thanks, I will update the vendor's binding to add the constraints.

Cheers,
Prabhakar
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 91e75eb3f329..85d499bd49b5 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -110,6 +110,8 @@  properties:
 
   interrupts:
     minItems: 1
+    maxItems: 11
+    additionalItems: true
     items:
       - description: Combined signal for various interrupt events
       - description: The interrupt to manage the remote wake-up packet detection
@@ -118,11 +120,11 @@  properties:
 
   interrupt-names:
     minItems: 1
+    maxItems: 11
+    additionalItems: true
     items:
       - const: macirq
       - enum: [eth_wake_irq, eth_lpi, sfty]
-      - enum: [eth_wake_irq, eth_lpi, sfty]
-      - enum: [eth_wake_irq, eth_lpi, sfty]
 
   clocks:
     minItems: 1