lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1df417b5-a924-33d4-a302-eb526f7124b4@arinc9.com>
Date:   Sat, 10 Dec 2022 19:24:42 +0300
From:   Arınç ÜNAL <arinc.unal@...nc9.com>
To:     Colin Foster <colin.foster@...advantage.com>,
        linux-renesas-soc@...r.kernel.org,
        linux-mediatek@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, netdev@...r.kernel.org
Cc:     John Crispin <john@...ozen.org>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Claudiu Manoil <claudiu.manoil@....com>,
        Marek Vasut <marex@...x.de>,
        Sean Wang <sean.wang@...iatek.com>,
        DENG Qingfang <dqfext@...il.com>,
        Landen Chao <Landen.Chao@...iatek.com>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Clément Léger <clement.leger@...tlin.com>,
        Alvin Šipraga <alsi@...g-olufsen.dk>,
        Linus Walleij <linus.walleij@...aro.org>,
        UNGLinuxDriver@...rochip.com,
        Woojung Huh <woojung.huh@...rochip.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Kurt Kanzenbach <kurt@...utronix.de>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Rob Herring <robh+dt@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        "David S. Miller" <davem@...emloft.net>,
        Vladimir Oltean <olteanv@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        George McCollister <george.mccollister@...il.com>,
        Rob Herring <robh@...nel.org>
Subject: Re: [PATCH v5 net-next 04/10] dt-bindings: net: dsa: utilize base
 definitions for standard dsa switches

On 10.12.2022 06:30, Colin Foster wrote:
> DSA switches can fall into one of two categories: switches where all ports
> follow standard '(ethernet-)?port' properties, and switches that have
> additional properties for the ports.
> 
> The scenario where DSA ports are all standardized can be handled by
> switches with a reference to the new 'dsa.yaml#/$defs/ethernet-ports'.
> 
> The scenario where DSA ports require additional properties can reference
> '$dsa.yaml#' directly. This will allow switches to reference these standard
> definitions of the DSA switch, but add additional properties under the port
> nodes.
> 
> Suggested-by: Rob Herring <robh@...nel.org>
> Signed-off-by: Colin Foster <colin.foster@...advantage.com>
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
> Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
> Reviewed-by: Rob Herring <robh@...nel.org>
> Acked-by: Alvin Šipraga <alsi@...g-olufsen.dk> # realtek
> Acked-by: Arınç ÜNAL <arinc.unal@...nc9.com>
> ---
> 
> v4 -> v5
>    * Add Rob Reviewed, Arınç Acked
>    * Defer the removal of "^(ethernet-)?switch(@.*)?$" in dsa.yaml until a
>      later patch
>    * Undo the move of ethernet switch ports description in mediatek,mt7530.yaml
>    * Fix typos in commit message
> 
> v3 -> v4
>    * Rename "$defs/base" to "$defs/ethernet-ports" to avoid implication of a
>      "base class" and fix commit message accordingly
>    * Add the following to the common etherent-ports node:
>        "additionalProperties: false"
>        "#address-cells" property
>        "#size-cells" property
>    * Fix "etherenet-ports@[0-9]+" to correctly be "ethernet-port@[0-9]+"
>    * Remove unnecessary newline
>    * Apply changes to mediatek,mt7530.yaml that were previously in a separate patch
>    * Add Reviewed and Acked tags
> 
> v3
>    * New patch
> 
> ---
>   .../bindings/net/dsa/arrow,xrs700x.yaml       |  2 +-
>   .../devicetree/bindings/net/dsa/brcm,b53.yaml |  2 +-
>   .../devicetree/bindings/net/dsa/dsa.yaml      | 22 +++++++++++++++++++
>   .../net/dsa/hirschmann,hellcreek.yaml         |  2 +-
>   .../bindings/net/dsa/mediatek,mt7530.yaml     |  5 +----
>   .../bindings/net/dsa/microchip,ksz.yaml       |  2 +-
>   .../bindings/net/dsa/microchip,lan937x.yaml   |  2 +-
>   .../bindings/net/dsa/mscc,ocelot.yaml         |  2 +-
>   .../bindings/net/dsa/nxp,sja1105.yaml         |  2 +-
>   .../devicetree/bindings/net/dsa/realtek.yaml  |  2 +-
>   .../bindings/net/dsa/renesas,rzn1-a5psw.yaml  |  2 +-
>   11 files changed, 32 insertions(+), 13 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml
> index 259a0c6547f3..5888e3a0169a 100644
> --- a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml
> @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
>   title: Arrow SpeedChips XRS7000 Series Switch Device Tree Bindings
>   
>   allOf:
> -  - $ref: dsa.yaml#
> +  - $ref: dsa.yaml#/$defs/ethernet-ports
>   
>   maintainers:
>     - George McCollister <george.mccollister@...il.com>
> diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
> index 1219b830b1a4..5bef4128d175 100644
> --- a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
> @@ -66,7 +66,7 @@ required:
>     - reg
>   
>   allOf:
> -  - $ref: dsa.yaml#
> +  - $ref: dsa.yaml#/$defs/ethernet-ports
>     - if:
>         properties:
>           compatible:
> diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml
> index 5efc0ee8edcb..9375cdcfbf96 100644
> --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml
> @@ -58,4 +58,26 @@ oneOf:
>   
>   additionalProperties: true
>   
> +$defs:
> +  ethernet-ports:
> +    description: A DSA switch without any extra port properties
> +    $ref: '#/'
> +
> +    patternProperties:
> +      "^(ethernet-)?ports$":
> +        type: object
> +        additionalProperties: false
> +
> +        properties:
> +          '#address-cells':
> +            const: 1
> +          '#size-cells':
> +            const: 0
> +
> +        patternProperties:
> +          "^(ethernet-)?port@[0-9]+$":
> +            description: Ethernet switch ports
> +            $ref: dsa-port.yaml#
> +            unevaluatedProperties: false

I've got moderate experience in json-schema but shouldn't you put 'type: 
object' here like you did for "^(ethernet-)?ports$"?

> +
>   ...
> diff --git a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml
> index 73b774eadd0b..748ef9983ce2 100644
> --- a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml
> @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
>   title: Hirschmann Hellcreek TSN Switch Device Tree Bindings
>   
>   allOf:
> -  - $ref: dsa.yaml#
> +  - $ref: dsa.yaml#/$defs/ethernet-ports
>   
>   maintainers:
>     - Andrew Lunn <andrew@...n.ch>
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index f2e9ff3f580b..20312f5d1944 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -157,9 +157,6 @@ patternProperties:
>       patternProperties:
>         "^(ethernet-)?port@[0-9]+$":
>           type: object

This line was being removed on the previous version. Must be related to 
above.

> -        description: Ethernet switch ports
> -
> -        unevaluatedProperties: false
>   
>           properties:
>             reg:

Arınç

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ