Skip to contentSkip to conversation

dt-binding preparation for ocelot switches

PATCH Applied Colin Foster 5 participants 26 messages Oct 25, 2022 – Nov 1, 2022

Subsystems (8)

v1 of 7 Applied Latest is v7 →

lore
Share & tools
lore

Colin Foster

author maintainer
#0 lore raw

cover dt-binding preparation for ocelot switches

Ocelot switches have the abilitiy to be used internally via memory-mapped IO or externally via SPI or PCIe. This brings up issues for documentation, where the same chip might be accessed internally in a switchdev manner, or externally in a DSA configuration. This patch set is perparation to bring DSA functionality to the VSC7512, utilizing as much as possible with an almost identical VSC7514 chip.

During the most recent RFC for internal ethernet switch functionality to the VSC7512, there were 10 steps laid out to adequately prepare documentation:

https://lore.kernel.org/all/20221010174856.nd3n4soxk7zbmcm7@skbuf/

The full context is quoted below. This patch set represents steps 1-7 of the 10 steps, with the remaining steps to likely be part of what was the original RFC.

The first two patches are specifically rewording and fixing of the MFD bindings. I kept them in this patch set since they might cause conflicts with future documentation changes that will be part of the net-next tree. I can separate them if desired.

Context:

```
To end the discussion on a constructive note, I think if I were Colin,
I would do the following, in the following order, according to what was
expressed as a constraint:

1. Reword the "driver" word out of mscc,vsc7514-switch.yaml and express
   the description in terms of what the switch can do, not what the
   driver can do.

2. Make qca8k.yaml have "$ref: dsa.yaml#". Remove "$ref: dsa-port.yaml#"
   from the same schema.

3. Remove "- $ref: dsa-port.yaml#" from mediatek,mt7530.yaml. It doesn't
   seem to be needed, since dsa.yaml also has this. We need this because
   we want to make sure no one except dsa.yaml references dsa-port.yaml.

4. Move the DSA-unspecific portion from dsa.yaml into a new
   ethernet-switch.yaml. What remains in dsa.yaml is "dsa,member".
   The dsa.yaml schema will have "$ref: ethernet-switch.yaml#" for the
   "(ethernet-)switch" node, plus its custom additions.

5. Move the DSA-unspecific portion from dsa-port.yaml into a new
   ethernet-switch-port.yaml. What remains in dsa-port.yaml is:
   * ethernet phandle
   * link phandle
   * label property
   * dsa-tag-protocol property
   * the constraint that CPU and DSA ports must have phylink bindings

6. The ethernet-switch.yaml will have "$ref: ethernet-switch-port.yaml#"
   and "$ref: dsa-port.yaml". The dsa-port.yaml schema will *not* have
   "$ref: ethernet-switch-port.yaml#", just its custom additions.
   I'm not 100% on this, but I think there will be a problem if:
   - dsa.yaml references ethernet-switch.yaml
     - ethernet-switch.yaml references ethernet-switch-port.yaml
   - dsa.yaml also references dsa-port.yaml
     - dsa-port.yaml references ethernet-switch-port.yaml
   because ethernet-switch-port.yaml will be referenced twice. Again,
   not sure if this is a problem. If it isn't, things can be simpler,
   just make dsa-port.yaml reference ethernet-switch-port.yaml, and skip
   steps 2 and 3 since dsa-port.yaml containing just the DSA specifics
   is no longer problematic.

7. Make mscc,vsc7514-switch.yaml have "$ref: ethernet-switch.yaml#" for
   the "mscc,vsc7514-switch.yaml" compatible string. This will eliminate
   its own definitions for the generic properties: $nodename and
   ethernet-ports (~45 lines of code if I'm not mistaken).

8. Introduce the "mscc,vsc7512-switch" compatible string as part of
   mscc,vsc7514-switch.yaml, but this will have "$ref: dsa.yaml#" (this
   will have to be referenced by full path because they are in different
   folders) instead of "ethernet-switch.yaml". Doing this will include
   the common bindings for a switch, plus the DSA specifics.

9. Optional: rework ti,cpsw-switch.yaml, microchip,lan966x-switch.yaml,
   microchip,sparx5-switch.yaml to have "$ref: ethernet-switch.yaml#"
   which should reduce some duplication in existing schemas.

10. Question for future support of VSC7514 in DSA mode: how do we decide
    whether to $ref: ethernet-switch.yaml or dsa.yaml? If the parent MFD
    node has a compatible string similar to "mscc,vsc7512", then use DSA,
    otherwise use generic ethernet-switch?
```

Colin Foster (7):
dt-bindings: mfd: ocelot: remove spi-max-frequency from required
properties
dt-bindings: mfd: ocelot: remove unnecessary driver wording
dt-bindings: net: dsa: qca8k: utilize shared dsa.yaml
dt-bindings: net: dsa: mediatek,mt7530: remove unnecessary dsa-port
reference
dt-bindings: net: add generic ethernet-switch
dt-bindings: net: add generic ethernet-switch-port binding
dt-bindings: net: mscc,vsc7514-switch: utilize generic
ethernet-switch.yaml

 .../devicetree/bindings/mfd/mscc,ocelot.yaml  |  4 +-
 .../devicetree/bindings/net/dsa/dsa-port.yaml | 26 +---------
 .../devicetree/bindings/net/dsa/dsa.yaml      | 26 +---------
 .../bindings/net/dsa/mediatek,mt7530.yaml     |  3 --
 .../devicetree/bindings/net/dsa/qca8k.yaml    | 14 ++---
 .../bindings/net/ethernet-switch-port.yaml    | 44 ++++++++++++++++
 .../bindings/net/ethernet-switch.yaml         | 51 +++++++++++++++++++
 .../bindings/net/mscc,vsc7514-switch.yaml     | 36 +------------
 MAINTAINERS                                   |  2 +
 9 files changed, 107 insertions(+), 99 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/ethernet-switch-port.yaml
 create mode 100644 Documentation/devicetree/bindings/net/ethernet-switch.yaml
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 1/7 dt-bindings: mfd: ocelot: remove spi-max-frequency from required properties

The property spi-max-frequency was initially documented as a required property. It is not actually required, and will break bindings validation if other control mediums (e.g. PCIe) are used.

Remove this property from the required arguments.

---
 Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml | 1 -
 1 file changed, 1 deletion(-)
Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml +0 -1
index 8bf45a5673a4..c6da91211a18 100644
@@ -61,7 +61,6 @@ required:
   - reg
   - '#address-cells'
   - '#size-cells'
-  - spi-max-frequency
 
 additionalProperties: false
 
Signature · 1 line
2.25.1
maintainer Applied
#2 lore raw

Re: [PATCH v1 net-next 1/7] dt-bindings: mfd: ocelot: remove spi-max-frequency from required properties

Quoted 11 lines · Colin Foster

The property spi-max-frequency was initially documented as a required property. It is not actually required, and will break bindings validation if other control mediums (e.g. PCIe) are used.

Remove this property from the required arguments.

---
 Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml | 1 -
 1 file changed, 1 deletion(-)

Applied, thanks.

Signature · 1 line
Lee Jones [李琼斯]
author maintainer
#3 lore raw

Re: [PATCH v1 net-next 1/7] dt-bindings: mfd: ocelot: remove spi-max-frequency from required properties

Quoted 8 lines · Lee Jones
Quoted 6 lines · Colin Foster

The property spi-max-frequency was initially documented as a required property. It is not actually required, and will break bindings validation if other control mediums (e.g. PCIe) are used.

Remove this property from the required arguments.

Quoted 7 lines
Quoted 5 lines
---
 Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml | 1 -
 1 file changed, 1 deletion(-)

Applied, thanks.

Thanks Lee

Quoted 3 lines
Signature · 2 lines
-- 
Lee Jones [李琼斯]
author maintainer
#4 lore raw

PATCH 2/7 dt-bindings: mfd: ocelot: remove unnecessary driver wording

In reply to Colin Foster

Initially there was unnecessary verbage around "this driver" in the documentation. It was unnecessary. Remove self references about it being a "driver" documentation and replace it with a more detailed description about external interfaces that are supported.

---
 Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml +2 -1
index c6da91211a18..1d1fee1a16c1 100644
@@ -12,7 +12,8 @@ maintainers:
 description: |
   The Ocelot ethernet switch family contains chips that have an internal CPU
   (VSC7513, VSC7514) and chips that don't (VSC7511, VSC7512). All switches have
-  the option to be controlled externally, which is the purpose of this driver.
+  the option to be controlled externally via external interfaces like SPI or
+  PCIe.
 
   The switch family is a multi-port networking switch that supports many
   interfaces. Additionally, the device can perform pin control, MDIO buses, and
Signature · 1 line
2.25.1
maintainer Applied
#5 lore raw

Re: [PATCH v1 net-next 2/7] dt-bindings: mfd: ocelot: remove unnecessary driver wording

Quoted 10 lines · Colin Foster

Initially there was unnecessary verbage around "this driver" in the documentation. It was unnecessary. Remove self references about it being a "driver" documentation and replace it with a more detailed description about external interfaces that are supported.

---
 Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks.

Signature · 1 line
Lee Jones [李琼斯]
author maintainer
#6 lore raw

PATCH 3/7 dt-bindings: net: dsa: qca8k: utilize shared dsa.yaml

In reply to Colin Foster

The dsa.yaml binding contains duplicated bindings for address and size cells, as well as the reference to dsa-port.yaml. Instead of duplicating this information, remove the reference to dsa-port.yaml and include the full reference to dsa.yaml.

---
 .../devicetree/bindings/net/dsa/qca8k.yaml         | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +3 -11
index 978162df51f7..7884f68cab73 100644
@@ -66,22 +66,16 @@ properties:
                  With the legacy mapping the reg corresponding to the internal
                  mdio is the switch reg with an offset of -1.
 
+$ref: "dsa.yaml#"
+
 patternProperties:
   "^(ethernet-)?ports$":
     type: object
-    properties:
-      '#address-cells':
-        const: 1
-      '#size-cells':
-        const: 0
-
     patternProperties:
       "^(ethernet-)?port@[0-6]$":
         type: object
         description: Ethernet switch ports
 
-        $ref: dsa-port.yaml#
-
         properties:
           qca,sgmii-rxclk-falling-edge:
             $ref: /schemas/types.yaml#/definitions/flag
@@ -104,8 +98,6 @@ patternProperties:
               SGMII on the QCA8337, it is advised to set this unless a communication
               issue is observed.
 
-        unevaluatedProperties: false
-
 oneOf:
   - required:
       - ports
@@ -116,7 +108,7 @@ required:
   - compatible
   - reg
 
-additionalProperties: true
+unevaluatedProperties: false
 
 examples:
   - |
Signature · 1 line
2.25.1
maintainer
#7 lore raw

Re: [PATCH v1 net-next 3/7] dt-bindings: net: dsa: qca8k: utilize shared dsa.yaml

Quoted 11 lines · Colin Foster

The dsa.yaml binding contains duplicated bindings for address and size cells, as well as the reference to dsa-port.yaml. Instead of duplicating this information, remove the reference to dsa-port.yaml and include the full reference to dsa.yaml.

---
 .../devicetree/bindings/net/dsa/qca8k.yaml         | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/dsa/qca8k.example.dtb: switch@10: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/dsa/qca8k.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/dsa/qca8k.example.dtb: switch@10: ports:port@6: Unevaluated properties are not allowed ('qca,sgmii-rxclk-falling-edge' was unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/dsa/qca8k.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/dsa/qca8k.example.dtb: switch@10: Unevaluated properties are not allowed ('#address-cells', '#size-cells' were unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/dsa/qca8k.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.

maintainer
#8 lore raw

Re: [PATCH v1 net-next 3/7] dt-bindings: net: dsa: qca8k: utilize shared dsa.yaml

In reply to Colin Foster
Quoted 4 lines · Colin Foster

The dsa.yaml binding contains duplicated bindings for address and size cells, as well as the reference to dsa-port.yaml. Instead of duplicating this information, remove the reference to dsa-port.yaml and include the full reference to dsa.yaml.

I don't think this works without further restructuring. Essentially, 'unevaluatedProperties' on works on a single level. So every level has to define all properties at that level either directly in properties/patternProperties or within a $ref.

See how graph.yaml is structured and referenced for an example how this has to work.

Quoted 37 lines
---
 .../devicetree/bindings/net/dsa/qca8k.yaml         | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +2 -8
index 978162df51f7..7884f68cab73 100644
@@ -66,22 +66,16 @@ properties:
                  With the legacy mapping the reg corresponding to the internal
                  mdio is the switch reg with an offset of -1.
 
+$ref: "dsa.yaml#"
+
 patternProperties:
   "^(ethernet-)?ports$":
     type: object
-    properties:
-      '#address-cells':
-        const: 1
-      '#size-cells':
-        const: 0
-
     patternProperties:
       "^(ethernet-)?port@[0-6]$":
         type: object
         description: Ethernet switch ports
 
-        $ref: dsa-port.yaml#
-
         properties:
           qca,sgmii-rxclk-falling-edge:
             $ref: /schemas/types.yaml#/definitions/flag

Documentation/devicetree/bindings/net/dsa/qca8k.yaml patternProperties: · line 108

Quoted 5 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -2
@@ -104,8 +98,6 @@ patternProperties:
               SGMII on the QCA8337, it is advised to set this unless a communication
               issue is observed.
 
-        unevaluatedProperties: false
-

Dropping this means any undefined properties in port nodes won't be an error. Once I fix all the issues related to these missing, there will be a meta-schema checking for this (this could be one I fixed already).

Documentation/devicetree/bindings/net/dsa/qca8k.yaml required: · line 119

Quoted 8 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -1
 oneOf:
   - required:
       - ports
@@ -116,7 +108,7 @@ required:
   - compatible
   - reg
 
-additionalProperties: true

This should certainly be changed though. We should only have 'true' for incomplete collections of properties. IOW, for common bindings.

Quoted 8 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +1 -0
+unevaluatedProperties: false
 
 examples:
   - |
Signature · 1 line
2.25.1
maintainer
#9 lore raw

Re: [PATCH v1 net-next 3/7] dt-bindings: net: dsa: qca8k: utilize shared dsa.yaml

Hi Rob,

Quoted 18 lines · Rob Herring
Quoted 4 lines · Colin Foster

The dsa.yaml binding contains duplicated bindings for address and size cells, as well as the reference to dsa-port.yaml. Instead of duplicating this information, remove the reference to dsa-port.yaml and include the full reference to dsa.yaml.

I don't think this works without further restructuring. Essentially, 'unevaluatedProperties' on works on a single level. So every level has to define all properties at that level either directly in properties/patternProperties or within a $ref.

See how graph.yaml is structured and referenced for an example how this has to work.

Quoted 4 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -0
@@ -104,8 +98,6 @@ patternProperties:
               SGMII on the QCA8337, it is advised to set this unless a communication
               issue is observed.
 
Quoted 6 lines

Documentation/devicetree/bindings/net/dsa/qca8k.yaml patternProperties: · line 108

Quoted 2 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -2
-        unevaluatedProperties: false
-

Dropping this means any undefined properties in port nodes won't be an error. Once I fix all the issues related to these missing, there will be a meta-schema checking for this (this could be one I fixed already).

I may be misreading, but here, "unevaluatedProperties: false" from dsa.yaml (under patternProperties: "^(ethernet-)?port@[0-9]+$":) is on the same level as the "unevaluatedProperties: false" that Colin is deleting.

In fact, I believe that it is precisely due to the "unevaluatedProperties: false" from dsa.yaml that this is causing a failure now:

net/dsa/qca8k.example.dtb: switch@10: ports:port@6: Unevaluated properties are not allowed ('qca,sgmii-rxclk-falling-edge' was unexpected)

Could you please explain why is the 'qca,sgmii-rxclk-falling-edge' property not evaluated from the perspective of dsa.yaml in the example? It's a head scratcher to me.

May it have something to do with the fact that Colin's addition:

$ref: "dsa.yaml#"

is not expressed as:

allOf:
- $ref: "dsa.yaml#"

?

If yes, can you explain exactly what is the difference with respect to unevaluatedProperties?

Quoted 13 lines

Documentation/devicetree/bindings/net/dsa/qca8k.yaml required: · line 119

Quoted 8 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -1
 oneOf:
   - required:
       - ports
@@ -116,7 +108,7 @@ required:
   - compatible
   - reg
 
-additionalProperties: true

This should certainly be changed though. We should only have 'true' for incomplete collections of properties. IOW, for common bindings.

Quoted 1 line
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +1 -0
+unevaluatedProperties: false
author maintainer
#10 lore raw

Re: [PATCH v1 net-next 3/7] dt-bindings: net: dsa: qca8k: utilize shared dsa.yaml

Hi Rob and Vladimir,

Quoted 43 lines · Vladimir Oltean

Hi Rob,

Quoted 18 lines · Rob Herring
Quoted 4 lines · Colin Foster

The dsa.yaml binding contains duplicated bindings for address and size cells, as well as the reference to dsa-port.yaml. Instead of duplicating this information, remove the reference to dsa-port.yaml and include the full reference to dsa.yaml.

I don't think this works without further restructuring. Essentially, 'unevaluatedProperties' on works on a single level. So every level has to define all properties at that level either directly in properties/patternProperties or within a $ref.

See how graph.yaml is structured and referenced for an example how this has to work.

Quoted 4 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -0
@@ -104,8 +98,6 @@ patternProperties:
               SGMII on the QCA8337, it is advised to set this unless a communication
               issue is observed.
 
Quoted 6 lines

Documentation/devicetree/bindings/net/dsa/qca8k.yaml patternProperties: · line 108

Quoted 2 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -2
-        unevaluatedProperties: false
-

Dropping this means any undefined properties in port nodes won't be an error. Once I fix all the issues related to these missing, there will be a meta-schema checking for this (this could be one I fixed already).

I may be misreading, but here, "unevaluatedProperties: false" from dsa.yaml (under patternProperties: "^(ethernet-)?port@[0-9]+$":) is on the same level as the "unevaluatedProperties: false" that Colin is deleting.

In fact, I believe that it is precisely due to the "unevaluatedProperties: false" from dsa.yaml that this is causing a failure now:

net/dsa/qca8k.example.dtb: switch@10: ports:port@6: Unevaluated properties are not allowed ('qca,sgmii-rxclk-falling-edge' was unexpected)

Could you please explain why is the 'qca,sgmii-rxclk-falling-edge' property not evaluated from the perspective of dsa.yaml in the example? It's a head scratcher to me.

May it have something to do with the fact that Colin's addition:

Quoted 8 lines

$ref: "dsa.yaml#"

is not expressed as:

allOf:
- $ref: "dsa.yaml#"

?

Looking into documentation (I promise I did some reading / research to try to get a stronger understanding of the documentation yaml) I came across the history of ethernet-controller.yaml which suggests to me that the pattern:

allOf:
- $ref:

is frowned upon
commit 3d21a4609335: ("dt-bindings: Remove cases of 'allOf' containing a '$ref'")

I do have a knack for misinterpreting data, but I read that as:
allOf:
- $ref:
shouldn't be used unless there's more than one list entry.

All that aside, I did upgrade from 2022.5 to 2022.9 just now and do see these dtschema errors now. I'll be sure to use this before resubmitting.

Quoted 15 lines

If yes, can you explain exactly what is the difference with respect to unevaluatedProperties?

Quoted 11 lines

Documentation/devicetree/bindings/net/dsa/qca8k.yaml required: · line 119

Quoted 8 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -1
 oneOf:
   - required:
       - ports
@@ -116,7 +108,7 @@ required:
   - compatible
   - reg
 
-additionalProperties: true

This should certainly be changed though. We should only have 'true' for incomplete collections of properties. IOW, for common bindings.

That makes a lot of sense - and helps me understand why I had so much trouble understanding why it originally was "additionalProperties: true"

I'll obviously take another look at this. The nxp,sja1105.yaml seemed to be most akin to what the qca8k.yaml needed to be - that is "take dsa.yaml and add a couple extra properties to the ports nodes". But there's always subleties.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +1 -0
+unevaluatedProperties: false
maintainer
#11 lore raw

Re: [PATCH v1 net-next 3/7] dt-bindings: net: dsa: qca8k: utilize shared dsa.yaml

In reply to Vladimir Oltean
Quoted 32 lines · Vladimir Oltean

Hi Rob,

Quoted 18 lines · Rob Herring
Quoted 4 lines · Colin Foster

The dsa.yaml binding contains duplicated bindings for address and size cells, as well as the reference to dsa-port.yaml. Instead of duplicating this information, remove the reference to dsa-port.yaml and include the full reference to dsa.yaml.

I don't think this works without further restructuring. Essentially, 'unevaluatedProperties' on works on a single level. So every level has to define all properties at that level either directly in properties/patternProperties or within a $ref.

See how graph.yaml is structured and referenced for an example how this has to work.

Quoted 4 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -0
@@ -104,8 +98,6 @@ patternProperties:
               SGMII on the QCA8337, it is advised to set this unless a communication
               issue is observed.
 
Quoted 6 lines

Documentation/devicetree/bindings/net/dsa/qca8k.yaml patternProperties: · line 108

Quoted 2 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -2
-        unevaluatedProperties: false
-

Dropping this means any undefined properties in port nodes won't be an error. Once I fix all the issues related to these missing, there will be a meta-schema checking for this (this could be one I fixed already).

I may be misreading, but here, "unevaluatedProperties: false" from dsa.yaml (under patternProperties: "^(ethernet-)?port@[0-9]+$":) is on the same level as the "unevaluatedProperties: false" that Colin is deleting.

Quoted 8 lines

In fact, I believe that it is precisely due to the "unevaluatedProperties: false" from dsa.yaml that this is causing a failure now:

net/dsa/qca8k.example.dtb: switch@10: ports:port@6: Unevaluated properties are not allowed ('qca,sgmii-rxclk-falling-edge' was unexpected)

Could you please explain why is the 'qca,sgmii-rxclk-falling-edge' property not evaluated from the perspective of dsa.yaml in the example? It's a head scratcher to me.

A schema with unevaluatedProperties can "see" into a $ref, but the ref'ed schema having unevaluatedProperties can't see back to the referring schema for properties defined there.

So if a schema is referenced by other schemas which can define their own additional properties, that schema cannot have 'unevaluatedProperties:
false'. If both schemas have 'unevaluatedProperties: false', then it's just redundant. We may end up doing that just because it's not obvious when we have both or not, and no unevaluatedProperties/ additionalProperties at all is a bigger issue. I'm working on a meta-schema to check this.

Quoted 10 lines

May it have something to do with the fact that Colin's addition:

$ref: "dsa.yaml#"

is not expressed as:

allOf:
- $ref: "dsa.yaml#"

?

No. Either way behaves the same. We generally only use 'allOf' when there might be more than 1 entry. That is mostly just at the top-level.

Rob

author maintainer
#12 lore raw

Re: [PATCH v1 net-next 3/7] dt-bindings: net: dsa: qca8k: utilize shared dsa.yaml

Quoted 46 lines · Rob Herring
Quoted 32 lines · Vladimir Oltean

Hi Rob,

Quoted 18 lines · Rob Herring
Quoted 4 lines · Colin Foster

The dsa.yaml binding contains duplicated bindings for address and size cells, as well as the reference to dsa-port.yaml. Instead of duplicating this information, remove the reference to dsa-port.yaml and include the full reference to dsa.yaml.

I don't think this works without further restructuring. Essentially, 'unevaluatedProperties' on works on a single level. So every level has to define all properties at that level either directly in properties/patternProperties or within a $ref.

See how graph.yaml is structured and referenced for an example how this has to work.

Quoted 4 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -0
@@ -104,8 +98,6 @@ patternProperties:
               SGMII on the QCA8337, it is advised to set this unless a communication
               issue is observed.
 
Quoted 6 lines

Documentation/devicetree/bindings/net/dsa/qca8k.yaml patternProperties: · line 108

Quoted 2 lines
Documentation/devicetree/bindings/net/dsa/qca8k.yaml +0 -2
-        unevaluatedProperties: false
-

Dropping this means any undefined properties in port nodes won't be an error. Once I fix all the issues related to these missing, there will be a meta-schema checking for this (this could be one I fixed already).

I may be misreading, but here, "unevaluatedProperties: false" from dsa.yaml (under patternProperties: "^(ethernet-)?port@[0-9]+$":) is on the same level as the "unevaluatedProperties: false" that Colin is deleting.

Quoted 8 lines

In fact, I believe that it is precisely due to the "unevaluatedProperties: false" from dsa.yaml that this is causing a failure now:

net/dsa/qca8k.example.dtb: switch@10: ports:port@6: Unevaluated properties are not allowed ('qca,sgmii-rxclk-falling-edge' was unexpected)

Could you please explain why is the 'qca,sgmii-rxclk-falling-edge' property not evaluated from the perspective of dsa.yaml in the example? It's a head scratcher to me.

A schema with unevaluatedProperties can "see" into a $ref, but the ref'ed schema having unevaluatedProperties can't see back to the referring schema for properties defined there.

Quoted 7 lines

So if a schema is referenced by other schemas which can define their own additional properties, that schema cannot have 'unevaluatedProperties:
false'. If both schemas have 'unevaluatedProperties: false', then it's just redundant. We may end up doing that just because it's not obvious when we have both or not, and no unevaluatedProperties/ additionalProperties at all is a bigger issue. I'm working on a meta-schema to check this.

Thanks for this information. So if I'm understanding correctly:

- All DSA chips I'm modifying should reference dsa.yaml, as they currently are.
- As such, these all should have unevaluatedProperties: true, so they can see into dsa.yaml.
- dsa.yaml, and any schema that gets $ref:'d, can not have
unevaluatedProperties: false, unless the desire is to forbid any other properties to be added.

I'll get another patch set out this week with all these changes, and tested against the latest dt_bindings_check.

Quoted 17 lines
Quoted 4 lines

May it have something to do with the fact that Colin's addition:

Quoted 8 lines

$ref: "dsa.yaml#"

is not expressed as:

allOf:
- $ref: "dsa.yaml#"

?

No. Either way behaves the same. We generally only use 'allOf' when there might be more than 1 entry. That is mostly just at the top-level.

Rob

author maintainer
#13 lore raw

Re: [PATCH v1 net-next 3/7] dt-bindings: net: dsa: qca8k: utilize shared dsa.yaml

In reply to Rob Herring

Hi Rob,

Quoted 6 lines · Rob Herring
Quoted 4 lines · Colin Foster

The dsa.yaml binding contains duplicated bindings for address and size cells, as well as the reference to dsa-port.yaml. Instead of duplicating this information, remove the reference to dsa-port.yaml and include the full reference to dsa.yaml.

Quoted 7 lines

I don't think this works without further restructuring. Essentially, 'unevaluatedProperties' on works on a single level. So every level has to define all properties at that level either directly in properties/patternProperties or within a $ref.

See how graph.yaml is structured and referenced for an example how this has to work.

Thanks for pointing me to this. I didn't know about
https://github.com/devicetree-org/dt-schema until now, so I'll take a look. I was primarily reading the schemas in net/dsa/* to try to get a full understanding of the DT schema nuances, so these types of nudges really help me.

And I see that Vladimir Oltean has responded to other parts of the email, so I'll leave this as a simple "thanks" and keep that context going forward.

author maintainer
#14 lore raw

PATCH 4/7 dt-bindings: net: dsa: mediatek,mt7530: remove unnecessary dsa-port reference

In reply to Colin Foster

dsa.yaml contains a reference to dsa-port.yaml, so a duplicate reference to the binding isn't necessary. Remove this unnecessary reference.

---
 Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 3 ---
 1 file changed, 3 deletions(-)
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +0 -3
index f2e9ff3f580b..81f291105660 100644
@@ -159,8 +159,6 @@ patternProperties:
         type: object
         description: Ethernet switch ports
 
-        unevaluatedProperties: false
-
         properties:
           reg:
             description:
@@ -168,7 +166,6 @@ patternProperties:
               for user ports.
 
         allOf:
-          - $ref: dsa-port.yaml#
           - if:
               required: [ ethernet ]
             then:
Signature · 1 line
2.25.1
Reviewed-by on v1 4/7
#15 lore raw

Re: [PATCH v1 net-next 4/7] dt-bindings: net: dsa: mediatek,mt7530: remove unnecessary dsa-port reference

Quoted 5 lines · Colin Foster

dsa.yaml contains a reference to dsa-port.yaml, so a duplicate reference to the binding isn't necessary. Remove this unnecessary reference.

Thanks.
Arınç

author maintainer
#16 lore raw

Re: [PATCH v1 net-next 4/7] dt-bindings: net: dsa: mediatek,mt7530: remove unnecessary dsa-port reference

Quoted 8 lines · Arınç ÜNAL
Quoted 5 lines · Colin Foster

dsa.yaml contains a reference to dsa-port.yaml, so a duplicate reference to the binding isn't necessary. Remove this unnecessary reference.

Thanks!

Quoted 3 lines

Thanks.
Arınç

author maintainer
#17 lore raw

PATCH 5/7 dt-bindings: net: add generic ethernet-switch

In reply to Colin Foster

The dsa.yaml bindings had references that can apply to non-dsa switches. To prevent duplication of this information, keep the dsa-specific information inside dsa.yaml and move the remaining generic information to the newly created ethernet-switch.yaml.

---
 .../devicetree/bindings/net/dsa/dsa.yaml      | 26 +---------
 .../bindings/net/ethernet-switch.yaml         | 49 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 3 files changed, 52 insertions(+), 24 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/ethernet-switch.yaml
Documentation/devicetree/bindings/net/dsa/dsa.yaml +2 -24
index b9d48e357e77..2290a9d32b21 100644
@@ -18,6 +18,8 @@ description:
 
 select: false
 
+$ref: "/schemas/net/ethernet-switch.yaml#"
+
 properties:
   $nodename:
     pattern: "^(ethernet-)?switch(@.*)?$"
@@ -32,30 +34,6 @@ properties:
       (single device hanging off a CPU port) must not specify this property
     $ref: /schemas/types.yaml#/definitions/uint32-array
 
-patternProperties:
-  "^(ethernet-)?ports$":
-    type: object
-    properties:
-      '#address-cells':
-        const: 1
-      '#size-cells':
-        const: 0
-
-    patternProperties:
-      "^(ethernet-)?port@[0-9]+$":
-        type: object
-        description: Ethernet switch ports
-
-        $ref: dsa-port.yaml#
-
-        unevaluatedProperties: false
-
-oneOf:
-  - required:
-      - ports
-  - required:
-      - ethernet-ports
-
 additionalProperties: true
 
 ...
Documentation/devicetree/bindings/net/ethernet-switch.yaml new file +49 -0

49 lines not on this page · raw message

MAINTAINERS +1 -0
index 3106a9f0567a..3b6c3989c419 100644
@@ -14326,6 +14326,7 @@ M:	Florian Fainelli <[email protected]>
 M:	Vladimir Oltean <[email protected]>
 S:	Maintained
 F:	Documentation/devicetree/bindings/net/dsa/
+F:	Documentation/devicetree/bindings/net/ethernet-switch.yaml
 F:	drivers/net/dsa/
 F:	include/linux/dsa/
 F:	include/linux/platform_data/dsa.h
Signature · 1 line
2.25.1
author maintainer
#18 lore raw

PATCH 6/7 dt-bindings: net: add generic ethernet-switch-port binding

In reply to Colin Foster

The dsa-port.yaml binding had several references that can be common to all ethernet ports, not just dsa-specific ones. Break out the generic bindings to ethernet-switch-port.yaml they can be used by non-dsa drivers.

---
 .../devicetree/bindings/net/dsa/dsa-port.yaml | 26 +----------
 .../bindings/net/ethernet-switch-port.yaml    | 44 +++++++++++++++++++
 .../bindings/net/ethernet-switch.yaml         |  4 +-
 MAINTAINERS                                   |  1 +
 4 files changed, 50 insertions(+), 25 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/ethernet-switch-port.yaml
Documentation/devicetree/bindings/net/dsa/dsa-port.yaml +2 -24
index 10ad7e71097b..c5144e733511 100644
@@ -4,7 +4,7 @@
 $id: http://devicetree.org/schemas/net/dsa/dsa-port.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Ethernet Switch port Device Tree Bindings
+title: DSA Switch port Device Tree Bindings
 
 maintainers:
   - Andrew Lunn <[email protected]>
@@ -15,12 +15,9 @@ description:
   Ethernet switch port Description
 
 allOf:
-  - $ref: /schemas/net/ethernet-controller.yaml#
+  - $ref: /schemas/net/ethernet-switch-port.yaml#
 
 properties:
-  reg:
-    description: Port number
-
   label:
     description:
       Describes the label associated with this port, which will become
@@ -57,25 +54,6 @@ properties:
       - rtl8_4t
       - seville
 
-  phy-handle: true
-
-  phy-mode: true
-
-  fixed-link: true
-
-  mac-address: true
-
-  sfp: true
-
-  managed: true
-
-  rx-internal-delay-ps: true
-
-  tx-internal-delay-ps: true
-
-required:
-  - reg
-
 # CPU and DSA ports must have phylink-compatible link descriptions
 if:
   oneOf:
Documentation/devicetree/bindings/net/ethernet-switch-port.yaml new file +44 -0

44 lines not on this page · raw message

Documentation/devicetree/bindings/net/ethernet-switch.yaml +3 -1
index fbaac536673d..f698857619da 100644
@@ -36,7 +36,9 @@ patternProperties:
         type: object
         description: Ethernet switch ports
 
-        $ref: /schemas/net/dsa/dsa-port.yaml#
+        allOf:
+          - $ref: /schemas/net/dsa/dsa-port.yaml#
+          - $ref: ethernet-switch-port.yaml#
 
 oneOf:
   - required:
MAINTAINERS +1 -0
index 3b6c3989c419..d98fc1962874 100644
@@ -14326,6 +14326,7 @@ M:	Florian Fainelli <[email protected]>
 M:	Vladimir Oltean <[email protected]>
 S:	Maintained
 F:	Documentation/devicetree/bindings/net/dsa/
+F:	Documentation/devicetree/bindings/net/ethernet-switch-port.yaml
 F:	Documentation/devicetree/bindings/net/ethernet-switch.yaml
 F:	drivers/net/dsa/
 F:	include/linux/dsa/
Signature · 1 line
2.25.1
maintainer
#19 lore raw

Re: [PATCH v1 net-next 6/7] dt-bindings: net: add generic ethernet-switch-port binding

Quoted 122 lines · Colin Foster

The dsa-port.yaml binding had several references that can be common to all ethernet ports, not just dsa-specific ones. Break out the generic bindings to ethernet-switch-port.yaml they can be used by non-dsa drivers.

---
 .../devicetree/bindings/net/dsa/dsa-port.yaml | 26 +----------
 .../bindings/net/ethernet-switch-port.yaml    | 44 +++++++++++++++++++
 .../bindings/net/ethernet-switch.yaml         |  4 +-
 MAINTAINERS                                   |  1 +
 4 files changed, 50 insertions(+), 25 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/ethernet-switch-port.yaml
Documentation/devicetree/bindings/net/dsa/dsa-port.yaml +2 -24
index 10ad7e71097b..c5144e733511 100644
@@ -4,7 +4,7 @@
 $id: http://devicetree.org/schemas/net/dsa/dsa-port.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Ethernet Switch port Device Tree Bindings
+title: DSA Switch port Device Tree Bindings
 
 maintainers:
   - Andrew Lunn <[email protected]>
@@ -15,12 +15,9 @@ description:
   Ethernet switch port Description
 
 allOf:
-  - $ref: /schemas/net/ethernet-controller.yaml#
+  - $ref: /schemas/net/ethernet-switch-port.yaml#
 
 properties:
-  reg:
-    description: Port number
-
   label:
     description:
       Describes the label associated with this port, which will become
@@ -57,25 +54,6 @@ properties:
       - rtl8_4t
       - seville
 
-  phy-handle: true
-
-  phy-mode: true
-
-  fixed-link: true
-
-  mac-address: true
-
-  sfp: true
-
-  managed: true
-
-  rx-internal-delay-ps: true
-
-  tx-internal-delay-ps: true
-
-required:
-  - reg
-
 # CPU and DSA ports must have phylink-compatible link descriptions
 if:
   oneOf:
Documentation/devicetree/bindings/net/ethernet-switch-port.yaml new file +44 -0
new file mode 100644
index 000000000000..cb1e5e12bf0a
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/ethernet-switch-port.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Ethernet Switch port Device Tree Bindings
+
+maintainers:
+  - Andrew Lunn <[email protected]>
+  - Florian Fainelli <[email protected]>
+  - Vivien Didelot <[email protected]>
+
+description:
+  Ethernet switch port Description
+
+$ref: ethernet-controller.yaml#
+
+properties:
+  reg:
+    description: Port number
+
+  phy-handle: true
+
+  phy-mode: true
+
+  fixed-link: true
+
+  mac-address: true
+
+  sfp: true
+
+  managed: true
+
+  rx-internal-delay-ps: true
+
+  tx-internal-delay-ps: true
+
+required:
+  - reg
+
+additionalProperties: true
+
+...
Documentation/devicetree/bindings/net/ethernet-switch.yaml +0 -0
index fbaac536673d..f698857619da 100644

Documentation/devicetree/bindings/net/ethernet-switch.yaml patternProperties: · line 41

Quoted 7 lines
Documentation/devicetree/bindings/net/ethernet-switch.yaml +3 -1
@@ -36,7 +36,9 @@ patternProperties:
         type: object
         description: Ethernet switch ports
 
-        $ref: /schemas/net/dsa/dsa-port.yaml#
+        allOf:
+          - $ref: /schemas/net/dsa/dsa-port.yaml#
+          - $ref: ethernet-switch-port.yaml#

dsa-port.yaml references ethernet-switch-port.yaml, so you shouldn't need both here.

I imagine what you were trying to do here was say it is either one of these, not both. I don't think this is going work for the same reasons I mentioned with unevaluatedProperties.

Rob

author maintainer
#20 lore raw

Re: [PATCH v1 net-next 6/7] dt-bindings: net: add generic ethernet-switch-port binding

Quoted 134 lines · Rob Herring
Quoted 122 lines · Colin Foster

The dsa-port.yaml binding had several references that can be common to all ethernet ports, not just dsa-specific ones. Break out the generic bindings to ethernet-switch-port.yaml they can be used by non-dsa drivers.

---
 .../devicetree/bindings/net/dsa/dsa-port.yaml | 26 +----------
 .../bindings/net/ethernet-switch-port.yaml    | 44 +++++++++++++++++++
 .../bindings/net/ethernet-switch.yaml         |  4 +-
 MAINTAINERS                                   |  1 +
 4 files changed, 50 insertions(+), 25 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/ethernet-switch-port.yaml
Documentation/devicetree/bindings/net/dsa/dsa-port.yaml +2 -24
index 10ad7e71097b..c5144e733511 100644
@@ -4,7 +4,7 @@
 $id: http://devicetree.org/schemas/net/dsa/dsa-port.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Ethernet Switch port Device Tree Bindings
+title: DSA Switch port Device Tree Bindings
 
 maintainers:
   - Andrew Lunn <[email protected]>
@@ -15,12 +15,9 @@ description:
   Ethernet switch port Description
 
 allOf:
-  - $ref: /schemas/net/ethernet-controller.yaml#
+  - $ref: /schemas/net/ethernet-switch-port.yaml#
 
 properties:
-  reg:
-    description: Port number
-
   label:
     description:
       Describes the label associated with this port, which will become
@@ -57,25 +54,6 @@ properties:
       - rtl8_4t
       - seville
 
-  phy-handle: true
-
-  phy-mode: true
-
-  fixed-link: true
-
-  mac-address: true
-
-  sfp: true
-
-  managed: true
-
-  rx-internal-delay-ps: true
-
-  tx-internal-delay-ps: true
-
-required:
-  - reg
-
 # CPU and DSA ports must have phylink-compatible link descriptions
 if:
   oneOf:
Documentation/devicetree/bindings/net/ethernet-switch-port.yaml new file +44 -0
new file mode 100644
index 000000000000..cb1e5e12bf0a
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/ethernet-switch-port.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Ethernet Switch port Device Tree Bindings
+
+maintainers:
+  - Andrew Lunn <[email protected]>
+  - Florian Fainelli <[email protected]>
+  - Vivien Didelot <[email protected]>
+
+description:
+  Ethernet switch port Description
+
+$ref: ethernet-controller.yaml#
+
+properties:
+  reg:
+    description: Port number
+
+  phy-handle: true
+
+  phy-mode: true
+
+  fixed-link: true
+
+  mac-address: true
+
+  sfp: true
+
+  managed: true
+
+  rx-internal-delay-ps: true
+
+  tx-internal-delay-ps: true
+
+required:
+  - reg
+
+additionalProperties: true
+
+...
Documentation/devicetree/bindings/net/ethernet-switch.yaml +0 -0
index fbaac536673d..f698857619da 100644

Documentation/devicetree/bindings/net/ethernet-switch.yaml patternProperties: · line 41

Quoted 7 lines
Documentation/devicetree/bindings/net/ethernet-switch.yaml +3 -1
@@ -36,7 +36,9 @@ patternProperties:
         type: object
         description: Ethernet switch ports
 
-        $ref: /schemas/net/dsa/dsa-port.yaml#
+        allOf:
+          - $ref: /schemas/net/dsa/dsa-port.yaml#
+          - $ref: ethernet-switch-port.yaml#

dsa-port.yaml references ethernet-switch-port.yaml, so you shouldn't need both here.

Quoted 3 lines

I imagine what you were trying to do here was say it is either one of these, not both. I don't think this is going work for the same reasons I mentioned with unevaluatedProperties.

Oh, that was definitely a mistake for me to reference ethernet-switch-port.yaml. And that was exactly requested of me when Vladimir helped guide me down this path:

"""
6. The ethernet-switch.yaml will have "$ref: ethernet-switch-port.yaml#" and "$ref: dsa-port.yaml". The dsa-port.yaml schema will *not* have "$ref: ethernet-switch-port.yaml#", just its custom additions. I'm not 100% on this, but I think there will be a problem if:
- dsa.yaml references ethernet-switch.yaml
- ethernet-switch.yaml references ethernet-switch-port.yaml
- dsa.yaml also references dsa-port.yaml
- dsa-port.yaml references ethernet-switch-port.yaml
because ethernet-switch-port.yaml will be referenced twice. Again, not sure if this is a problem. If it isn't, things can be simpler, just make dsa-port.yaml reference ethernet-switch-port.yaml, and skip steps 2 and 3 since dsa-port.yaml containing just the DSA specifics is no longer problematic.
"""

I might have been testing to see if this was necessary and since I didn't notice any dt_binding_check errors this might have slipped into the patch set. But my intent was to reference both here and remove the reference in dsa-port.yaml.

Quoted 2 lines

Rob

author maintainer
#21 lore raw

PATCH 7/7 dt-bindings: net: mscc,vsc7514-switch: utilize generic ethernet-switch.yaml

In reply to Colin Foster

Several bindings for ethernet switches are available for non-dsa switches by way of ethernet-switch.yaml. Remove these duplicate entries and utilize the common bindings for the VSC7514.

---
 .../bindings/net/mscc,vsc7514-switch.yaml     | 36 +------------------
 1 file changed, 1 insertion(+), 35 deletions(-)
Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml +1 -35
index ee0a504bdb24..1703bd46c3ca 100644
@@ -19,11 +19,8 @@ description: |
   packet extraction/injection.
 
 properties:
-  $nodename:
-    pattern: "^switch@[0-9a-f]+$"
-
   compatible:
-    const: mscc,vsc7514-switch
+    $ref: ethernet-switch.yaml#
 
   reg:
     items:
@@ -88,47 +85,16 @@ properties:
       - const: fdma
 
   ethernet-ports:
-    type: object
-
-    properties:
-      '#address-cells':
-        const: 1
-      '#size-cells':
-        const: 0
 
     additionalProperties: false
 
     patternProperties:
       "^port@[0-9a-f]+$":
-        type: object
-        description: Ethernet ports handled by the switch
 
         $ref: ethernet-controller.yaml#
 
         unevaluatedProperties: false
 
-        properties:
-          reg:
-            description: Switch port number
-
-          phy-handle: true
-
-          phy-mode: true
-
-          fixed-link: true
-
-          mac-address: true
-
-        required:
-          - reg
-          - phy-mode
-
-        oneOf:
-          - required:
-              - phy-handle
-          - required:
-              - fixed-link
-
 required:
   - compatible
   - reg
Signature · 1 line
2.25.1
maintainer
#22 lore raw

Re: [PATCH v1 net-next 7/7] dt-bindings: net: mscc,vsc7514-switch: utilize generic ethernet-switch.yaml

Quoted 10 lines · Colin Foster

Several bindings for ethernet switches are available for non-dsa switches by way of ethernet-switch.yaml. Remove these duplicate entries and utilize the common bindings for the VSC7514.

---
 .../bindings/net/mscc,vsc7514-switch.yaml     | 36 +------------------
 1 file changed, 1 insertion(+), 35 deletions(-)

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
./Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/net/ethernet-switch.yaml
Documentation/devicetree/bindings/net/mscc,vsc7514-switch.example.dtb:0:0: /example-0/switch@1010000: failed to match any schema with compatible: ['mscc,vsc7514-switch']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.

maintainer
#23 lore raw

Re: [PATCH v1 net-next 7/7] dt-bindings: net: mscc,vsc7514-switch: utilize generic ethernet-switch.yaml

Quoted 12 lines · Rob Herring
Quoted 10 lines · Colin Foster

Several bindings for ethernet switches are available for non-dsa switches by way of ethernet-switch.yaml. Remove these duplicate entries and utilize the common bindings for the VSC7514.

---
 .../bindings/net/mscc,vsc7514-switch.yaml     | 36 +------------------
 1 file changed, 1 insertion(+), 35 deletions(-)
Quoted 8 lines

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
./Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/net/ethernet-switch.yaml
Documentation/devicetree/bindings/net/mscc,vsc7514-switch.example.dtb:0:0: /example-0/switch@1010000: failed to match any schema with compatible: ['mscc,vsc7514-switch']

This one you can ignore. The base tree is reset if a prior patch failed.

Rob

maintainer
#24 lore raw

Re: [PATCH v1 net-next 7/7] dt-bindings: net: mscc,vsc7514-switch: utilize generic ethernet-switch.yaml

In reply to Colin Foster
Quoted 15 lines · Colin Foster

Several bindings for ethernet switches are available for non-dsa switches by way of ethernet-switch.yaml. Remove these duplicate entries and utilize the common bindings for the VSC7514.

---
 .../bindings/net/mscc,vsc7514-switch.yaml     | 36 +------------------
 1 file changed, 1 insertion(+), 35 deletions(-)
Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml +0 -0
index ee0a504bdb24..1703bd46c3ca 100644

Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml description: | · line 23

Quoted 9 lines
Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml +1 -4
@@ -19,11 +19,8 @@ description: |
   packet extraction/injection.
 
 properties:
-  $nodename:
-    pattern: "^switch@[0-9a-f]+$"
-
   compatible:
-    const: mscc,vsc7514-switch
+    $ref: ethernet-switch.yaml#

??? 'compatible' is a node?

Rob

author maintainer
#25 lore raw

Re: [PATCH v1 net-next 7/7] dt-bindings: net: mscc,vsc7514-switch: utilize generic ethernet-switch.yaml

Quoted 18 lines · Rob Herring
Quoted 17 lines · Colin Foster

Several bindings for ethernet switches are available for non-dsa switches by way of ethernet-switch.yaml. Remove these duplicate entries and utilize the common bindings for the VSC7514.

---
 .../bindings/net/mscc,vsc7514-switch.yaml     | 36 +------------------
 1 file changed, 1 insertion(+), 35 deletions(-)
Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml +0 -0
index ee0a504bdb24..1703bd46c3ca 100644
@@ -19,11 +19,8 @@ description: |
   packet extraction/injection.
 
Quoted 9 lines

Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml description: | · line 23

Quoted 7 lines
Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml +1 -4
 properties:
-  $nodename:
-    pattern: "^switch@[0-9a-f]+$"
-
   compatible:
-    const: mscc,vsc7514-switch
+    $ref: ethernet-switch.yaml#

??? 'compatible' is a node?

I need to look more into this. The compatible string should remain mscc,vsc7514-switch, but I think the pattern properties should probably be updated to "^(ethernet-)switch@[0-9a-f]+$" to match ethernet-switch.yaml.

I didn't think the ethernet-switch.yaml could be at the top level for the 7514, but I must have been mistaken. Either way - not under compatible as you're pointing out. Much appreciated.

Quoted 2 lines

Rob