diff mbox series

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

Message ID 20230723161029.1345-10-jszhang@kernel.org (mailing list archive)
State Changes Requested
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, 41 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 July 23, 2023, 4:10 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   | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

Comments

Conor Dooley July 24, 2023, 5:28 p.m. UTC | #1
Hey Jisheng,

On Mon, Jul 24, 2023 at 12:10:28AM +0800, Jisheng Zhang wrote:
> The IP supports per channel interrupt, add support for this usage case.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>

Silly question perhaps, but the commit message and description for this
property imply that this is an optional feature that software may choose
to make use of, but will function without. Is that the case?

> ---
>  .../devicetree/bindings/net/snps,dwmac.yaml   | 23 +++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index bb80ca205d26..525210c2c06c 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -101,6 +101,11 @@ properties:
>      minItems: 1
>      maxItems: 2
>  
> +  snps,per-channel-interrupt:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description:
> +      Indicates that Rx and Tx complete will generate a unique interrupt for each channel
> +
>    interrupts:
>      minItems: 1
>      items:
> @@ -109,6 +114,8 @@ 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 per-channel interrupts
> +      - description: All of the tx per-channel interrupts
>  
>    interrupt-names:
>      minItems: 1
> @@ -118,6 +125,22 @@ properties:
>        - const: eth_lpi
>        - const: sfty_ce_irq
>        - const: sfty_ue_irq
> +      - const: rx0
> +      - const: rx1
> +      - const: rx2
> +      - const: rx3
> +      - const: rx4
> +      - const: rx5
> +      - const: rx6
> +      - const: rx7
> +      - const: tx0
> +      - const: tx1
> +      - const: tx2
> +      - const: tx3
> +      - const: tx4
> +      - const: tx5
> +      - const: tx6
> +      - const: tx7
>  
>    clocks:
>      minItems: 1
> -- 
> 2.40.1
>
Rob Herring July 26, 2023, 3:24 p.m. UTC | #2
On Mon, Jul 24, 2023 at 12:10:28AM +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   | 23 +++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index bb80ca205d26..525210c2c06c 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -101,6 +101,11 @@ properties:
>      minItems: 1
>      maxItems: 2
>  
> +  snps,per-channel-interrupt:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description:
> +      Indicates that Rx and Tx complete will generate a unique interrupt for each channel

Can't you determine this based on the number of interrupts or interrupt 
names?

> +
>    interrupts:
>      minItems: 1
>      items:
> @@ -109,6 +114,8 @@ 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 per-channel interrupts
> +      - description: All of the tx per-channel interrupts

You added 2 interrupts here and...

>  
>    interrupt-names:
>      minItems: 1
> @@ -118,6 +125,22 @@ properties:
>        - const: eth_lpi
>        - const: sfty_ce_irq
>        - const: sfty_ue_irq
> +      - const: rx0
> +      - const: rx1
> +      - const: rx2
> +      - const: rx3
> +      - const: rx4
> +      - const: rx5
> +      - const: rx6
> +      - const: rx7
> +      - const: tx0
> +      - const: tx1
> +      - const: tx2
> +      - const: tx3
> +      - const: tx4
> +      - const: tx5
> +      - const: tx6
> +      - const: tx7

And 16 here?

>  
>    clocks:
>      minItems: 1
> -- 
> 2.40.1
>
Jisheng Zhang July 26, 2023, 3:47 p.m. UTC | #3
On Wed, Jul 26, 2023 at 09:24:39AM -0600, Rob Herring wrote:
> On Mon, Jul 24, 2023 at 12:10:28AM +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   | 23 +++++++++++++++++++
> >  1 file changed, 23 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > index bb80ca205d26..525210c2c06c 100644
> > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > @@ -101,6 +101,11 @@ properties:
> >      minItems: 1
> >      maxItems: 2
> >  
> > +  snps,per-channel-interrupt:
> > +    $ref: /schemas/types.yaml#/definitions/flag
> > +    description:
> > +      Indicates that Rx and Tx complete will generate a unique interrupt for each channel
> 
> Can't you determine this based on the number of interrupts or interrupt 
> names?

Good idea! this flag can be dynamically detected based on the interrupt names.
The driver code will be patched a bit ugly, I will try and send out for review.

> 
> > +
> >    interrupts:
> >      minItems: 1
> >      items:
> > @@ -109,6 +114,8 @@ 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 per-channel interrupts
> > +      - description: All of the tx per-channel interrupts
> 
> You added 2 interrupts here and...

I'm not sure how to write the description here, could it be one line
 "- description: All of the tx/rx per-channel interrupts"?

> 
> >  
> >    interrupt-names:
> >      minItems: 1
> > @@ -118,6 +125,22 @@ properties:
> >        - const: eth_lpi
> >        - const: sfty_ce_irq
> >        - const: sfty_ue_irq
> > +      - const: rx0
> > +      - const: rx1
> > +      - const: rx2
> > +      - const: rx3
> > +      - const: rx4
> > +      - const: rx5
> > +      - const: rx6
> > +      - const: rx7
> > +      - const: tx0
> > +      - const: tx1
> > +      - const: tx2
> > +      - const: tx3
> > +      - const: tx4
> > +      - const: tx5
> > +      - const: tx6
> > +      - const: tx7
> 
> And 16 here?
> 

oops, indeed HW supports up to 16 channels for tx and rx, thus
up to 16 interrupts.

> >  
> >    clocks:
> >      minItems: 1
> > -- 
> > 2.40.1
> >
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index bb80ca205d26..525210c2c06c 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -101,6 +101,11 @@  properties:
     minItems: 1
     maxItems: 2
 
+  snps,per-channel-interrupt:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Indicates that Rx and Tx complete will generate a unique interrupt for each channel
+
   interrupts:
     minItems: 1
     items:
@@ -109,6 +114,8 @@  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 per-channel interrupts
+      - description: All of the tx per-channel interrupts
 
   interrupt-names:
     minItems: 1
@@ -118,6 +125,22 @@  properties:
       - const: eth_lpi
       - const: sfty_ce_irq
       - const: sfty_ue_irq
+      - const: rx0
+      - const: rx1
+      - const: rx2
+      - const: rx3
+      - const: rx4
+      - const: rx5
+      - const: rx6
+      - const: rx7
+      - const: tx0
+      - const: tx1
+      - const: tx2
+      - const: tx3
+      - const: tx4
+      - const: tx5
+      - const: tx6
+      - const: tx7
 
   clocks:
     minItems: 1