Devicetree
 help / color / mirror / Atom feed
From: Vasilij Strassheim <v.strassheim@linutronix.de>
To: sashiko-reviews@lists.linux.dev
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH 2/4] dt-bindings: net: dsa: Add SoC-e switch IP and DSA bindings
Date: Mon, 03 Aug 2026 18:35:05 +0200	[thread overview]
Message-ID: <8bd5c543862fdb0083a218953b0db1937da2f320.camel@linutronix.de> (raw)
In-Reply-To: <20260730163757.B40901F00A3E@smtp.kernel.org>

On Thu, 2026-07-30 at 16:37 +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 7 potential issue(s) to consider:
> - [Medium] The `mdio` bus models a Linux software-synthetic topology rather than the actual hardware layout, misusing `reg` and inventing custom physical address properties.
> - [Medium] Setting `unevaluatedProperties: false` on the child `ethernet-phy` node breaks validation for vendor-specific PHY properties.
> - [Low] The device tree example in `soce,switch-dsa.yaml` fails to compile because it references undefined phandle labels (`&soce_switch_ip` and `&gem3`).
> - [Low] The device tree example in `soce,switch-ip.yaml` provides a 4-cell `reg` property without a parent node specifying `#address-cells` and `#size-cells`, leading to validation failures.
> - [Low] The `ports` sub-node pattern property description claims to define vendor-specific properties, but none are actually listed or defined.
> - [Low] Unnecessary `#address-cells` and `#size-cells` defined at the root node level, causing dtc warnings.
> - [Low] The `soce,num-ports` property is missing constraints that are explicitly stated in its description.
> --
> 
> --- Patch [2]: [PATCH 2/4] dt-bindings: net: dsa: Add SoC-e switch IP and DSA bindings ---
> commit 28c590589436788e107ab82bf7fbd0fdcad40087
> Author: Vasilij Strassheim <v.strassheim@linutronix.de>
> Subject: dt-bindings: net: dsa: Add SoC-e switch IP and DSA bindings
> 
> This commit adds DT schema documentation for SoC-e FPGA switch devices.
> The binding is split into a switch IP node describing the MMIO register
> block and a DSA MDIO node describing the DSA-facing switch instance.
> 
> > diff --git a/Documentation/devicetree/bindings/net/dsa/soce,switch-dsa.yaml b/Documentation/devicetree/bindings/net/dsa/soce,switch-dsa.yaml
> > new file mode 100644
> > index 0000000000000..a04e2838d14eb
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/dsa/soce,switch-dsa.yaml
> > @@ -0,0 +1,195 @@
> 
> [ ... ]
> 
> > +properties:
> > +  '#address-cells':
> > +    const: 1
> > +
> > +  '#size-cells':
> > +    const: 0
> 
> [Severity: Low]
> Are #address-cells and #size-cells necessary at the root node level?
> Since the only allowed sub-nodes (ports and mdio) do not use a @
> unit-address, compiling device trees conforming to this schema might emit
> avoid_unnecessary_addr_size dtc warnings.
> 

I will fix that.

> [ ... ]
> 
> > +  mdio:
> > +    $ref: /schemas/net/mdio.yaml#
> > +    description: |
> > +      Optional child MDIO bus exposing PHY devices attached to switch user
> > +      ports. PHY nodes referenced by port "phy-handle" properties should be
> > +      placed here. The PHY address seen by Linux on this bus is the switch port
> > +      index, not necessarily the hardware PHY address selected internally by
> > +      the switch IP.
> 
> [Severity: Medium]
> Does this model a Linux software-synthetic topology rather than the actual
> hardware layout? Device tree bindings are expected to describe the hardware,
> rather than modeling internal software abstractions like Linux's synthetic
> MDIO bus mapping. Using custom properties for the hardware bus index instead
> of natural mdio subnodes might violate core DT design principles.
> 
I will rewrite this.

> > +    unevaluatedProperties: false
> > +
> > +    patternProperties:
> > +      "^ethernet-phy@[0-9a-f]+$":
> > +        type: object
> > +        $ref: /schemas/net/ethernet-phy.yaml#
> > +        unevaluatedProperties: false
> 
> [Severity: Medium]
> Will setting unevaluatedProperties: false on the child ethernet-phy node
> break validation for valid vendor-specific PHY properties? Device trees using
> specific PHY hardware with valid vendor properties (like ti,rx-internal-delay)
> might fail schema validation because the parent schema strictly forbids them.
> 
Yes, I will fix that.

> [ ... ]
> 
> > +  ports:
> > +    type: object
> > +    description: Container node for the switch port sub-nodes.
> > +    properties:
> > +      '#address-cells':
> > +        const: 1
> > +      '#size-cells':
> > +        const: 0
> > +
> > +    patternProperties:
> > +      "^port@[0-9a-f]+$":
> > +        $ref: dsa-port.yaml#
> > +        unevaluatedProperties: false
> > +        description: |
> > +          Switch port. In addition to the standard DSA port properties
> > +          (label, phy-mode, ethernet, fixed-link) the following
> > +          vendor-specific properties are used for data ports connected to
> > +          external PHYs.
> 
> [Severity: Low]
> Could this description be updated? It claims to define vendor-specific
> properties used for data ports connected to external PHYs, but the description
> abruptly ends and no such properties are actually listed or defined.
> 

This will be updated in the next version.

> [ ... ]
> 
> > +examples:
> > +  - |
> > +    /* Excerpt from a Xilinx ZynqMP design (ARM64) */
> > +    mdio {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        soce_switch: switch@10 {
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +            compatible = "soce,switch-dsa";
> > +            reg = <0x10>;
> > +            soce,switch-ip = <&soce_switch_ip>;
> 
> [Severity: Low]
> Does this example fail to compile? The phandle label &soce_switch_ip
> does not appear to be defined in this example snippet, which might cause
> dt_binding_check to fail when dtc attempts to resolve it.
> 

Yes, this will be fixed.

> [ ... ]
> 
> > +                port@2 {
> > +                    reg = <0x2>;
> > +                    label = "INTERNAL_PORT";
> > +                    ethernet = <&gem3>;
> 
> [Severity: Low]
> Similar to &soce_switch_ip, the &gem3 ethernet controller label also
> appears to be undefined in this example.

Yes, this will be fixed.

> 
> > diff --git a/Documentation/devicetree/bindings/net/dsa/soce,switch-ip.yaml b/Documentation/devicetree/bindings/net/dsa/soce,switch-ip.yaml
> > new file mode 100644
> > index 0000000000000..ba9bb396235f2
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/dsa/soce,switch-ip.yaml
> > @@ -0,0 +1,54 @@
> 
> [ ... ]
> 
> > +  soce,num-ports:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description: |
> > +      Total number of switch ports (external/user ports plus the CPU uplink
> > +      port). Must be greater than zero and not exceed the selected IP variant.
> 
> [Severity: Low]
> Should there be explicit JSON schema constraints (such as minimum: 1)
> added for this property? The description mentions it must be greater than
> zero, but invalid device trees specifying soce,num-ports = <0>; might
> pass validation without the constraint.
> 
This will be removed in next version.

> [ ... ]
> 
> > +examples:
> > +  - |
> > +    switch_ip: switch@80020000 {
> > +        compatible = "soce,mrs-24-01";
> > +        reg = <0x0 0x80020000 0x0 0x10000>;
> 
> [Severity: Low]
> Will this 4-cell reg property cause a validation failure? The implicit
> parent provides #address-cells = <1>, so this might parse as 2 items and
> exceed the maxItems: 1 constraint. It likely requires a parent node
> (e.g., a bus node) defining #address-cells = <2> and #size-cells = <2>.
> 

I will fix the examples before resubmitting.



  reply	other threads:[~2026-08-03 16:35 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 16:36 [PATCH 0/4] net: dsa: Add SoC-e DSA driver Vasilij Strassheim
2026-07-29 16:36 ` [PATCH 1/4] dt-bindings: vendor-prefixes: Add soce Vasilij Strassheim
2026-07-30  8:50   ` Krzysztof Kozlowski
2026-08-03 16:03     ` Vasilij Strassheim
2026-07-29 16:36 ` [PATCH 2/4] dt-bindings: net: dsa: Add SoC-e switch IP and DSA bindings Vasilij Strassheim
2026-07-29 17:11   ` Andrew Lunn
2026-08-03 15:29     ` Vasilij Strassheim
2026-08-03 16:35       ` Andrew Lunn
2026-08-05 12:33         ` Vasilij Strassheim
2026-07-29 18:07   ` Rob Herring (Arm)
2026-08-03 15:47     ` Vasilij Strassheim
2026-07-30  8:56   ` Krzysztof Kozlowski
2026-08-03 16:15     ` Vasilij Strassheim
2026-08-03 16:43       ` Andrew Lunn
2026-08-05 12:40         ` Vasilij Strassheim
2026-08-05 12:53           ` Andrew Lunn
2026-08-05 13:17             ` Vasilij Strassheim
2026-08-05 13:32         ` Benedikt Spranger
2026-08-05 13:53           ` Andrew Lunn
2026-08-05 14:27             ` Benedikt Spranger
2026-08-06 13:35               ` Andrew Lunn
2026-08-06 15:25                 ` Benedikt Spranger
2026-08-09 16:52                   ` Andrew Lunn
2026-08-10  7:04                     ` Benedikt Spranger
2026-08-04  6:25       ` Krzysztof Kozlowski
2026-08-05 13:03         ` Vasilij Strassheim
2026-07-30  8:56   ` Krzysztof Kozlowski
2026-08-03 16:16     ` Vasilij Strassheim
2026-07-30 16:37   ` sashiko-bot
2026-08-03 16:35     ` Vasilij Strassheim [this message]
2026-07-29 16:36 ` [PATCH 3/4] net: dsa: Add support for SoC-e SDSA tags Vasilij Strassheim
2026-07-29 17:22   ` Andrew Lunn
2026-08-03 15:37     ` Vasilij Strassheim
2026-08-03 16:46       ` Andrew Lunn
2026-08-05 12:47         ` Vasilij Strassheim
2026-07-30 16:37   ` sashiko-bot
2026-08-03 16:52     ` Vasilij Strassheim
2026-07-29 16:36 ` [PATCH 4/4] net: dsa: soce: Add initial driver support for MRS switches Vasilij Strassheim
2026-07-29 17:31   ` Andrew Lunn
2026-08-03 15:40     ` Vasilij Strassheim
2026-07-29 20:05   ` Andrew Lunn
2026-08-03 16:01     ` Vasilij Strassheim
2026-08-03 16:49       ` Andrew Lunn
2026-08-05 12:48         ` Vasilij Strassheim
2026-07-30  9:01   ` Krzysztof Kozlowski
2026-08-03 16:23     ` Vasilij Strassheim
2026-07-30 16:37   ` sashiko-bot
2026-08-03 16:44     ` Vasilij Strassheim
2026-07-29 16:56 ` [PATCH 0/4] net: dsa: Add SoC-e DSA driver Andrew Lunn
2026-08-03 15:22   ` Vasilij Strassheim
2026-08-03 16:32     ` Andrew Lunn
2026-08-05 12:28       ` Vasilij Strassheim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bd5c543862fdb0083a218953b0db1937da2f320.camel@linutronix.de \
    --to=v.strassheim@linutronix.de \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox