diff mbox series

[net-next,v2,09/10] dt-bindings: net: snps,dwmac: add per channel irq support

Message ID 20230807164151.1130-10-jszhang@kernel.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: stmmac: add new features to xgmac | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers success CCed 12 of 12 maintainers
netdev/build_clang success Errors and warnings before: 9 this patch: 9
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 45 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jisheng Zhang Aug. 7, 2023, 4:41 p.m. UTC
The IP supports per channel interrupt, add support for this usage case.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Conor Dooley Aug. 8, 2023, 7:39 a.m. UTC | #1
On Tue, Aug 08, 2023 at 12:41:50AM +0800, Jisheng Zhang wrote:
> The IP supports per channel interrupt, add support for this usage case.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
>  .../devicetree/bindings/net/snps,dwmac.yaml   | 33 +++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index 5d81042f5634..5a63302ad200 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -109,6 +109,7 @@ properties:
>        - description: The interrupt that occurs when Rx exits the LPI state
>        - description: The interrupt that occurs when Safety Feature Correctible Errors happen
>        - description: The interrupt that occurs when Safety Feature Uncorrectible Errors happen
> +      - description: All of the rx/tx per-channel interrupts
>  
>    interrupt-names:
>      minItems: 1
> @@ -118,6 +119,38 @@ properties:
>        - const: eth_lpi
>        - const: sfty_ce
>        - const: sfty_ue
> +      - const: rx0
> +      - const: rx1
> +      - const: rx2
> +      - const: rx3
> +      - const: rx4
> +      - const: rx5
> +      - const: rx6
> +      - const: rx7
> +      - const: rx8
> +      - const: rx9
> +      - const: rx10
> +      - const: rx11
> +      - const: rx12
> +      - const: rx13
> +      - const: rx14
> +      - const: rx15
> +      - const: tx0
> +      - const: tx1
> +      - const: tx2
> +      - const: tx3
> +      - const: tx4
> +      - const: tx5
> +      - const: tx6
> +      - const: tx7
> +      - const: tx8
> +      - const: tx9
> +      - const: tx10
> +      - const: tx11
> +      - const: tx12
> +      - const: tx13
> +      - const: tx14
> +      - const: tx15

I don't think Rob's comment about having added 2 interrupts but 32
interrupt names has been resolved.
Did you actually test putting this many interrupts into a node?
AFAICT, any more than 6 will cause complaints.

Thanks,
Conor.
Jisheng Zhang Aug. 10, 2023, 3:59 p.m. UTC | #2
On Tue, Aug 08, 2023 at 08:39:58AM +0100, Conor Dooley wrote:
> On Tue, Aug 08, 2023 at 12:41:50AM +0800, Jisheng Zhang wrote:
> > The IP supports per channel interrupt, add support for this usage case.
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > ---
> >  .../devicetree/bindings/net/snps,dwmac.yaml   | 33 +++++++++++++++++++
> >  1 file changed, 33 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > index 5d81042f5634..5a63302ad200 100644
> > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > @@ -109,6 +109,7 @@ properties:
> >        - description: The interrupt that occurs when Rx exits the LPI state
> >        - description: The interrupt that occurs when Safety Feature Correctible Errors happen
> >        - description: The interrupt that occurs when Safety Feature Uncorrectible Errors happen
> > +      - description: All of the rx/tx per-channel interrupts
> >  
> >    interrupt-names:
> >      minItems: 1
> > @@ -118,6 +119,38 @@ properties:
> >        - const: eth_lpi
> >        - const: sfty_ce
> >        - const: sfty_ue
> > +      - const: rx0
> > +      - const: rx1
> > +      - const: rx2
> > +      - const: rx3
> > +      - const: rx4
> > +      - const: rx5
> > +      - const: rx6
> > +      - const: rx7
> > +      - const: rx8
> > +      - const: rx9
> > +      - const: rx10
> > +      - const: rx11
> > +      - const: rx12
> > +      - const: rx13
> > +      - const: rx14
> > +      - const: rx15
> > +      - const: tx0
> > +      - const: tx1
> > +      - const: tx2
> > +      - const: tx3
> > +      - const: tx4
> > +      - const: tx5
> > +      - const: tx6
> > +      - const: tx7
> > +      - const: tx8
> > +      - const: tx9
> > +      - const: tx10
> > +      - const: tx11
> > +      - const: tx12
> > +      - const: tx13
> > +      - const: tx14
> > +      - const: tx15
> 
> I don't think Rob's comment about having added 2 interrupts but 32
> interrupt names has been resolved.

I misunderstood Rob's comment. Now I'm not sure whether dt-binding
can support regex or something or not, or let ask for advice in the
following way: how could I write the dt-binding in this case? I didn't
find similar examples so far. I'm not sure listing possible
description and const properties for all channel interrupts is suitable.

> Did you actually test putting this many interrupts into a node?
> AFAICT, any more than 6 will cause complaints.

I tried 12rx and 12tx interrupts in a node, didn't see dtc warning.
so I guess the complaints are from dtb check? I will try to reproduce
them.

> 
> Thanks,
> Conor.
Conor Dooley Aug. 10, 2023, 4:15 p.m. UTC | #3
On Thu, Aug 10, 2023 at 11:59:06PM +0800, Jisheng Zhang wrote:
> On Tue, Aug 08, 2023 at 08:39:58AM +0100, Conor Dooley wrote:
> > On Tue, Aug 08, 2023 at 12:41:50AM +0800, Jisheng Zhang wrote:
> > > The IP supports per channel interrupt, add support for this usage case.
> > > 
> > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > > ---
> > >  .../devicetree/bindings/net/snps,dwmac.yaml   | 33 +++++++++++++++++++
> > >  1 file changed, 33 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > index 5d81042f5634..5a63302ad200 100644
> > > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > @@ -109,6 +109,7 @@ properties:
> > >        - description: The interrupt that occurs when Rx exits the LPI state
> > >        - description: The interrupt that occurs when Safety Feature Correctible Errors happen
> > >        - description: The interrupt that occurs when Safety Feature Uncorrectible Errors happen
> > > +      - description: All of the rx/tx per-channel interrupts
> > >  
> > >    interrupt-names:
> > >      minItems: 1
> > > @@ -118,6 +119,38 @@ properties:
> > >        - const: eth_lpi
> > >        - const: sfty_ce
> > >        - const: sfty_ue
> > > +      - const: rx0
> > > +      - const: rx1
> > > +      - const: rx2
> > > +      - const: rx3
> > > +      - const: rx4
> > > +      - const: rx5
> > > +      - const: rx6
> > > +      - const: rx7
> > > +      - const: rx8
> > > +      - const: rx9
> > > +      - const: rx10
> > > +      - const: rx11
> > > +      - const: rx12
> > > +      - const: rx13
> > > +      - const: rx14
> > > +      - const: rx15
> > > +      - const: tx0
> > > +      - const: tx1
> > > +      - const: tx2
> > > +      - const: tx3
> > > +      - const: tx4
> > > +      - const: tx5
> > > +      - const: tx6
> > > +      - const: tx7
> > > +      - const: tx8
> > > +      - const: tx9
> > > +      - const: tx10
> > > +      - const: tx11
> > > +      - const: tx12
> > > +      - const: tx13
> > > +      - const: tx14
> > > +      - const: tx15
> > 
> > I don't think Rob's comment about having added 2 interrupts but 32
> > interrupt names has been resolved.
> 
> I misunderstood Rob's comment. Now I'm not sure whether dt-binding
> can support regex or something or not, or let ask for advice in the
> following way: how could I write the dt-binding in this case? I didn't
> find similar examples so far. I'm not sure listing possible
> description and const properties for all channel interrupts is suitable.

I'm not sure that there is a better way. Rob maybe has a suggestion.

> > Did you actually test putting this many interrupts into a node?
> > AFAICT, any more than 6 will cause complaints.
> 
> I tried 12rx and 12tx interrupts in a node, didn't see dtc warning.
> so I guess the complaints are from dtb check? I will try to reproduce
> them.

I triggered some by putting more entries into the example in this
binding & doing dt binding check.
Jisheng Zhang Aug. 16, 2023, 3:36 p.m. UTC | #4
On Thu, Aug 10, 2023 at 05:15:26PM +0100, Conor Dooley wrote:
> On Thu, Aug 10, 2023 at 11:59:06PM +0800, Jisheng Zhang wrote:
> > On Tue, Aug 08, 2023 at 08:39:58AM +0100, Conor Dooley wrote:
> > > On Tue, Aug 08, 2023 at 12:41:50AM +0800, Jisheng Zhang wrote:
> > > > The IP supports per channel interrupt, add support for this usage case.
> > > > 
> > > > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > > > ---
> > > >  .../devicetree/bindings/net/snps,dwmac.yaml   | 33 +++++++++++++++++++
> > > >  1 file changed, 33 insertions(+)
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > index 5d81042f5634..5a63302ad200 100644
> > > > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > > > @@ -109,6 +109,7 @@ properties:
> > > >        - description: The interrupt that occurs when Rx exits the LPI state
> > > >        - description: The interrupt that occurs when Safety Feature Correctible Errors happen
> > > >        - description: The interrupt that occurs when Safety Feature Uncorrectible Errors happen
> > > > +      - description: All of the rx/tx per-channel interrupts
> > > >  
> > > >    interrupt-names:
> > > >      minItems: 1
> > > > @@ -118,6 +119,38 @@ properties:
> > > >        - const: eth_lpi
> > > >        - const: sfty_ce
> > > >        - const: sfty_ue
> > > > +      - const: rx0
> > > > +      - const: rx1
> > > > +      - const: rx2
> > > > +      - const: rx3
> > > > +      - const: rx4
> > > > +      - const: rx5
> > > > +      - const: rx6
> > > > +      - const: rx7
> > > > +      - const: rx8
> > > > +      - const: rx9
> > > > +      - const: rx10
> > > > +      - const: rx11
> > > > +      - const: rx12
> > > > +      - const: rx13
> > > > +      - const: rx14
> > > > +      - const: rx15
> > > > +      - const: tx0
> > > > +      - const: tx1
> > > > +      - const: tx2
> > > > +      - const: tx3
> > > > +      - const: tx4
> > > > +      - const: tx5
> > > > +      - const: tx6
> > > > +      - const: tx7
> > > > +      - const: tx8
> > > > +      - const: tx9
> > > > +      - const: tx10
> > > > +      - const: tx11
> > > > +      - const: tx12
> > > > +      - const: tx13
> > > > +      - const: tx14
> > > > +      - const: tx15
> > > 
> > > I don't think Rob's comment about having added 2 interrupts but 32
> > > interrupt names has been resolved.
> > 
> > I misunderstood Rob's comment. Now I'm not sure whether dt-binding
> > can support regex or something or not, or let ask for advice in the
> > following way: how could I write the dt-binding in this case? I didn't
> > find similar examples so far. I'm not sure listing possible
> > description and const properties for all channel interrupts is suitable.
> 
> I'm not sure that there is a better way. Rob maybe has a suggestion.
> 
> > > Did you actually test putting this many interrupts into a node?
> > > AFAICT, any more than 6 will cause complaints.
> > 
> > I tried 12rx and 12tx interrupts in a node, didn't see dtc warning.
> > so I guess the complaints are from dtb check? I will try to reproduce
> > them.
> 
> I triggered some by putting more entries into the example in this
> binding & doing dt binding check.

I reproduced the complaints and fixed them by adding additionalItems
and maxItems.

PS: those per-channel and safety irqs are optional.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 5d81042f5634..5a63302ad200 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -109,6 +109,7 @@  properties:
       - description: The interrupt that occurs when Rx exits the LPI state
       - description: The interrupt that occurs when Safety Feature Correctible Errors happen
       - description: The interrupt that occurs when Safety Feature Uncorrectible Errors happen
+      - description: All of the rx/tx per-channel interrupts
 
   interrupt-names:
     minItems: 1
@@ -118,6 +119,38 @@  properties:
       - const: eth_lpi
       - const: sfty_ce
       - const: sfty_ue
+      - const: rx0
+      - const: rx1
+      - const: rx2
+      - const: rx3
+      - const: rx4
+      - const: rx5
+      - const: rx6
+      - const: rx7
+      - const: rx8
+      - const: rx9
+      - const: rx10
+      - const: rx11
+      - const: rx12
+      - const: rx13
+      - const: rx14
+      - const: rx15
+      - const: tx0
+      - const: tx1
+      - const: tx2
+      - const: tx3
+      - const: tx4
+      - const: tx5
+      - const: tx6
+      - const: tx7
+      - const: tx8
+      - const: tx9
+      - const: tx10
+      - const: tx11
+      - const: tx12
+      - const: tx13
+      - const: tx14
+      - const: tx15
 
   clocks:
     minItems: 1