All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin Foster <colin.foster@in-advantage.com>
To: "Arınç ÜNAL" <arinc.unal@arinc9.com>
Cc: linux-renesas-soc@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	netdev@vger.kernel.org, "John Crispin" <john@phrozen.org>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Manoil" <claudiu.manoil@nxp.com>,
	"Marek Vasut" <marex@denx.de>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"Clément Léger" <clement.leger@bootlin.com>,
	"Alvin Šipraga" <alsi@bang-olufsen.dk>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	UNGLinuxDriver@microchip.com,
	"Woojung Huh" <woojung.huh@microchip.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Kurt Kanzenbach" <kurt@linutronix.de>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Eric Dumazet" <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"George McCollister" <george.mccollister@gmail.com>,
	"Rob Herring" <robh@kernel.org>
Subject: Re: [PATCH v5 net-next 04/10] dt-bindings: net: dsa: utilize base definitions for standard dsa switches
Date: Sat, 10 Dec 2022 10:02:43 -0800	[thread overview]
Message-ID: <Y5TJw+zcEDf2ItZ5@euler> (raw)
In-Reply-To: <1df417b5-a924-33d4-a302-eb526f7124b4@arinc9.com>

Hi Arınç,
On Sat, Dec 10, 2022 at 07:24:42PM +0300, Arınç ÜNAL wrote:
> On 10.12.2022 06:30, Colin Foster wrote:
> > DSA 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$"?

I can't say for sure, but adding "type: object" here and removing it
from mediatek,mt7530.yaml still causes the same issue I mention below.

Rob's initial suggestion for this patch set (which was basically the
entire implementation... many thanks again Rob) can be found here:
https://lore.kernel.org/netdev/20221104200212.GA2315642-robh@kernel.org/

From what I can tell, the omission of "type: object" here was
intentional. At the very least, it doesn't seem to have any effect on
warnings.

> 
> > +
> >   ...
> > 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@lunn.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.

Without the 'object' type here, I get the following warning:

Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: patternProperties:^(ethernet-)?ports$:patternProperties:^(ethernet-)?port@[0-9]+$: 'anyOf' conditional failed, one must be fixed:
        'type' is a required property
        '$ref' is a required property
        hint: node schemas must have a type or $ref
        from schema $id: http://devicetree.org/meta-schemas/core.yaml#
./Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: Error in referenced schema matching $id: http://devicetree.org/schemas/net/dsa/mediatek,mt7530.yaml
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
/home/colin/src/work/linux_vsc/linux-imx/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: ignoring, error in schema: patternProperties: ^(ethernet-)?ports$: patternProperties: ^(ethernet-)?port@[0-9]+$


I'm testing this now and I'm noticing something is going on with the
"ref: dsa-port.yaml"


Everything seems to work fine (in that I don't see any warnings) when I
have this diff:


diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index 20312f5d1944..db0122020f98 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yam
@@ -156,8 +156,7 @@ patternProperties:

     patternProperties:
       "^(ethernet-)?port@[0-9]+$":
-        type: object
-
+        $ref: dsa-port.yaml#
         properties:
           reg:
             description:
@@ -165,7 +164,6 @@ patternProperties:
               for user ports.

         allOf:
-          - $ref: dsa-port.yaml#
           - if:
               required: [ ethernet ]
             then:



This one has me [still] scratching my head...



> 
> > -        description: Ethernet switch ports
> > -
> > -        unevaluatedProperties: false
> >           properties:
> >             reg:
> 
> Arınç


WARNING: multiple messages have this Message-ID (diff)
From: Colin Foster <colin.foster@in-advantage.com>
To: "Arınç ÜNAL" <arinc.unal@arinc9.com>
Cc: linux-renesas-soc@vger.kernel.org,
	linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	netdev@vger.kernel.org, "John Crispin" <john@phrozen.org>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Manoil" <claudiu.manoil@nxp.com>,
	"Marek Vasut" <marex@denx.de>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"Clément Léger" <clement.leger@bootlin.com>,
	"Alvin Šipraga" <alsi@bang-olufsen.dk>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	UNGLinuxDriver@microchip.com,
	"Woojung Huh" <woojung.huh@microchip.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Kurt Kanzenbach" <kurt@linutronix.de>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Eric Dumazet" <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"George McCollister" <george.mccollister@gmail.com>,
	"Rob Herring" <robh@kernel.org>
Subject: Re: [PATCH v5 net-next 04/10] dt-bindings: net: dsa: utilize base definitions for standard dsa switches
Date: Sat, 10 Dec 2022 10:02:43 -0800	[thread overview]
Message-ID: <Y5TJw+zcEDf2ItZ5@euler> (raw)
In-Reply-To: <1df417b5-a924-33d4-a302-eb526f7124b4@arinc9.com>

Hi Arınç,
On Sat, Dec 10, 2022 at 07:24:42PM +0300, Arınç ÜNAL wrote:
> On 10.12.2022 06:30, Colin Foster wrote:
> > DSA 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$"?

I can't say for sure, but adding "type: object" here and removing it
from mediatek,mt7530.yaml still causes the same issue I mention below.

Rob's initial suggestion for this patch set (which was basically the
entire implementation... many thanks again Rob) can be found here:
https://lore.kernel.org/netdev/20221104200212.GA2315642-robh@kernel.org/

From what I can tell, the omission of "type: object" here was
intentional. At the very least, it doesn't seem to have any effect on
warnings.

> 
> > +
> >   ...
> > 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@lunn.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.

Without the 'object' type here, I get the following warning:

Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: patternProperties:^(ethernet-)?ports$:patternProperties:^(ethernet-)?port@[0-9]+$: 'anyOf' conditional failed, one must be fixed:
        'type' is a required property
        '$ref' is a required property
        hint: node schemas must have a type or $ref
        from schema $id: http://devicetree.org/meta-schemas/core.yaml#
./Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: Error in referenced schema matching $id: http://devicetree.org/schemas/net/dsa/mediatek,mt7530.yaml
  SCHEMA  Documentation/devicetree/bindings/processed-schema.json
/home/colin/src/work/linux_vsc/linux-imx/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml: ignoring, error in schema: patternProperties: ^(ethernet-)?ports$: patternProperties: ^(ethernet-)?port@[0-9]+$


I'm testing this now and I'm noticing something is going on with the
"ref: dsa-port.yaml"


Everything seems to work fine (in that I don't see any warnings) when I
have this diff:


diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index 20312f5d1944..db0122020f98 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yam
@@ -156,8 +156,7 @@ patternProperties:

     patternProperties:
       "^(ethernet-)?port@[0-9]+$":
-        type: object
-
+        $ref: dsa-port.yaml#
         properties:
           reg:
             description:
@@ -165,7 +164,6 @@ patternProperties:
               for user ports.

         allOf:
-          - $ref: dsa-port.yaml#
           - if:
               required: [ ethernet ]
             then:



This one has me [still] scratching my head...



> 
> > -        description: Ethernet switch ports
> > -
> > -        unevaluatedProperties: false
> >           properties:
> >             reg:
> 
> Arınç

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-12-10 18:03 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-10  3:30 [PATCH v5 net-next 00/10] dt-binding preparation for ocelot switches Colin Foster
2022-12-10  3:30 ` Colin Foster
2022-12-10  3:30 ` [PATCH v5 net-next 01/10] dt-bindings: dsa: sync with maintainers Colin Foster
2022-12-10  3:30   ` Colin Foster
2022-12-10 10:18   ` Kurt Kanzenbach
2022-12-10 10:18     ` Kurt Kanzenbach
2022-12-11 22:58     ` Vladimir Oltean
2022-12-11 22:58       ` Vladimir Oltean
2022-12-12  7:51       ` Kurt Kanzenbach
2022-12-12  7:51         ` Kurt Kanzenbach
2022-12-12 10:55   ` Vladimir Oltean
2022-12-12 10:55     ` Vladimir Oltean
2022-12-12 17:13   ` Rob Herring
2022-12-12 17:13     ` Rob Herring
2022-12-10  3:30 ` [PATCH v5 net-next 02/10] dt-bindings: net: dsa: sf2: fix brcm,use-bcm-hdr documentation Colin Foster
2022-12-10  3:30   ` Colin Foster
2022-12-12 18:46   ` Vladimir Oltean
2022-12-12 18:46     ` Vladimir Oltean
2022-12-10  3:30 ` [PATCH v5 net-next 03/10] dt-bindings: net: dsa: qca8k: remove address-cells and size-cells from switch node Colin Foster
2022-12-10  3:30   ` Colin Foster
2022-12-12 18:46   ` Vladimir Oltean
2022-12-12 18:46     ` Vladimir Oltean
2022-12-10  3:30 ` [PATCH v5 net-next 04/10] dt-bindings: net: dsa: utilize base definitions for standard dsa switches Colin Foster
2022-12-10  3:30   ` Colin Foster
2022-12-10 16:24   ` Arınç ÜNAL
2022-12-10 16:24     ` Arınç ÜNAL
2022-12-10 18:02     ` Colin Foster [this message]
2022-12-10 18:02       ` Colin Foster
2022-12-12  9:28       ` Arınç ÜNAL
2022-12-12  9:28         ` Arınç ÜNAL
2022-12-12 16:51         ` Rob Herring
2022-12-12 16:51           ` Rob Herring
2022-12-12 18:55           ` Colin Foster
2022-12-12 18:55             ` Colin Foster
2022-12-22 20:08             ` Colin Foster
2022-12-22 20:08               ` Colin Foster
2022-12-23  1:55               ` Jakub Kicinski
2022-12-23  1:55                 ` Jakub Kicinski
2022-12-12 18:48   ` Vladimir Oltean
2022-12-12 18:48     ` Vladimir Oltean
2022-12-10  3:30 ` [PATCH v5 net-next 05/10] dt-bindings: net: dsa: allow additional ethernet-port properties Colin Foster
2022-12-10  3:30   ` Colin Foster
2022-12-12 18:51   ` Vladimir Oltean
2022-12-12 18:51     ` Vladimir Oltean
2022-12-10  3:30 ` [PATCH v5 net-next 06/10] dt-bindings: net: dsa: qca8k: utilize shared dsa.yaml Colin Foster
2022-12-10  3:30   ` Colin Foster
2022-12-12 18:52   ` Vladimir Oltean
2022-12-12 18:52     ` Vladimir Oltean
2022-12-10  3:30 ` [PATCH v5 net-next 07/10] dt-bindings: net: dsa: mediatek,mt7530: remove unnecessary dsa-port reference Colin Foster
2022-12-10  3:30   ` Colin Foster
2022-12-12 18:53   ` Vladimir Oltean
2022-12-12 18:53     ` Vladimir Oltean
2022-12-10  3:30 ` [PATCH v5 net-next 08/10] dt-bindings: net: add generic ethernet-switch Colin Foster
2022-12-10  3:30   ` Colin Foster
2022-12-12 18:54   ` Vladimir Oltean
2022-12-12 18:54     ` Vladimir Oltean
2022-12-10  3:30 ` [PATCH v5 net-next 09/10] dt-bindings: net: add generic ethernet-switch-port binding Colin Foster
2022-12-10  3:30   ` Colin Foster
2022-12-10  3:30 ` [PATCH v5 net-next 10/10] dt-bindings: net: mscc,vsc7514-switch: utilize generic ethernet-switch.yaml Colin Foster
2022-12-10  3:30   ` Colin Foster
2022-12-12 18:29 ` [PATCH v5 net-next 00/10] dt-binding preparation for ocelot switches Jakub Kicinski
2022-12-12 18:29   ` Jakub Kicinski
2022-12-12 19:03   ` Colin Foster
2022-12-12 19:03     ` Colin Foster
2022-12-13  3:34     ` Jakub Kicinski
2022-12-13  3:34       ` Jakub Kicinski

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=Y5TJw+zcEDf2ItZ5@euler \
    --to=colin.foster@in-advantage.com \
    --cc=Landen.Chao@mediatek.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=arinc.unal@arinc9.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=clement.leger@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=george.mccollister@gmail.com \
    --cc=john@phrozen.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sean.wang@mediatek.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.