All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports
@ 2022-07-31 15:00 Vladimir Oltean
  2022-07-31 16:02 ` Rob Herring
  2022-08-01 16:22 ` Jakub Kicinski
  0 siblings, 2 replies; 5+ messages in thread
From: Vladimir Oltean @ 2022-07-31 15:00 UTC (permalink / raw)
  To: netdev
  Cc: devicetree, Rob Herring, Krzysztof Kozlowski, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
	Vivien Didelot, Florian Fainelli, Oleksij Rempel,
	Christian Marangi, John Crispin, Kurt Kanzenbach, Mans Rullgard,
	Arun Ramadoss, Woojung Huh, UNGLinuxDriver, Claudiu Manoil,
	Alexandre Belloni, George McCollister, DENG Qingfang, Sean Wang,
	Landen Chao, Matthias Brugger, Hauke Mehrtens,
	Martin Blumenstingl, Aleksander Jan Bajkowski,
	Alvin Šipraga, Luiz Angelo Daros de Luca, Linus Walleij,
	Pawel Dembicki, Clément Léger, Geert Uytterhoeven,
	Russell King, Marek Behún, Marcin Wojtas

It is desirable that new DSA drivers are written to expect that all
their ports register with phylink, and not rely on the DSA core's
workarounds to skip this process.

To that end, DSA is being changed to warn existing drivers when such DT
blobs are in use:
https://patchwork.kernel.org/project/netdevbpf/cover/20220729132119.1191227-1-vladimir.oltean@nxp.com/

Introduce another layer of validation in the DSA DT schema, and assert
that CPU and DSA ports must have phylink-related properties present.

Suggested-by: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
I've sent this patch separately because at least right now I don't have
a reason to resend the other 4 patches linked above, and this has no
dependency on those.

 .../devicetree/bindings/net/dsa/dsa-port.yaml | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml b/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml
index 09317e16cb5d..a9420302c5d8 100644
--- a/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml
@@ -76,6 +76,28 @@ properties:
 required:
   - reg
 
+if:
+  oneOf:
+    - properties:
+        ethernet:
+          items:
+            $ref: /schemas/types.yaml#/definitions/phandle
+    - properties:
+        link:
+          items:
+            $ref: /schemas/types.yaml#/definitions/phandle-array
+then:
+  allOf:
+  - required:
+    - phy-mode
+  - oneOf:
+    - required:
+      - fixed-link
+    - required:
+      - phy-handle
+    - required:
+      - managed
+
 additionalProperties: true
 
 ...
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports
  2022-07-31 15:00 [PATCH net-next] dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports Vladimir Oltean
@ 2022-07-31 16:02 ` Rob Herring
  2022-08-01 16:22 ` Jakub Kicinski
  1 sibling, 0 replies; 5+ messages in thread
From: Rob Herring @ 2022-07-31 16:02 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: John Crispin, Jakub Kicinski, UNGLinuxDriver, Matthias Brugger,
	Rob Herring, Landen Chao, Clément Léger,
	Krzysztof Kozlowski, Martin Blumenstingl,
	Luiz Angelo Daros de Luca, Geert Uytterhoeven, devicetree,
	Hauke Mehrtens, Eric Dumazet, netdev, Marek Behún,
	Aleksander Jan Bajkowski, Alexandre Belloni, Marcin Wojtas,
	Paolo Abeni, Andrew Lunn, Vivien Didelot, Pawel Dembicki,
	David S. Miller, Florian Fainelli, Alvin Šipraga,
	Woojung Huh, Arun Ramadoss, Mans Rullgard, Sean Wang,
	DENG Qingfang, George McCollister, Christian Marangi,
	Linus Walleij, Oleksij Rempel, Claudiu Manoil, Russell King,
	Kurt Kanzenbach

On Sun, 31 Jul 2022 18:00:06 +0300, Vladimir Oltean wrote:
> It is desirable that new DSA drivers are written to expect that all
> their ports register with phylink, and not rely on the DSA core's
> workarounds to skip this process.
> 
> To that end, DSA is being changed to warn existing drivers when such DT
> blobs are in use:
> https://patchwork.kernel.org/project/netdevbpf/cover/20220729132119.1191227-1-vladimir.oltean@nxp.com/
> 
> Introduce another layer of validation in the DSA DT schema, and assert
> that CPU and DSA ports must have phylink-related properties present.
> 
> Suggested-by: Rob Herring <robh+dt@kernel.org>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
> I've sent this patch separately because at least right now I don't have
> a reason to resend the other 4 patches linked above, and this has no
> dependency on those.
> 
>  .../devicetree/bindings/net/dsa/dsa-port.yaml | 22 +++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 

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:
./Documentation/devicetree/bindings/net/dsa/dsa-port.yaml:91:3: [warning] wrong indentation: expected 4 but found 2 (indentation)
./Documentation/devicetree/bindings/net/dsa/dsa-port.yaml:92:5: [warning] wrong indentation: expected 6 but found 4 (indentation)
./Documentation/devicetree/bindings/net/dsa/dsa-port.yaml:94:5: [warning] wrong indentation: expected 6 but found 4 (indentation)
./Documentation/devicetree/bindings/net/dsa/dsa-port.yaml:95:7: [warning] wrong indentation: expected 8 but found 6 (indentation)
./Documentation/devicetree/bindings/net/dsa/dsa-port.yaml:97:7: [warning] wrong indentation: expected 8 but found 6 (indentation)
./Documentation/devicetree/bindings/net/dsa/dsa-port.yaml:99:7: [warning] wrong indentation: expected 8 but found 6 (indentation)

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.example.dtb: switch@8: ethernet-ports:ethernet-port@3: 'phy-mode' is a required property
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.example.dtb: switch@8: Unevaluated properties are not allowed ('ethernet-ports' was unexpected)
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.example.dtb: switch@ff240000: ethernet-ports:port@0: 'phy-mode' is a required property
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.example.dtb: switch@ff240000: ethernet-ports:port@0: 'oneOf' conditional failed, one must be fixed:
	'fixed-link' is a required property
	'phy-handle' is a required property
	'managed' is a required property
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.example.dtb: switch@ff240000: Unevaluated properties are not allowed ('dsa,member', 'ethernet-ports' were unexpected)
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/brcm,b53.example.dtb: switch@36000: ethernet-ports:port@8: 'phy-mode' is a required property
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/brcm,b53.example.dtb: switch@36000: Unevaluated properties are not allowed ('ethernet-ports' was unexpected)
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/microchip,ksz.example.dtb: switch@0: ethernet-ports:port@5: 'phy-mode' is a required property
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/microchip,ksz.example.dtb: switch@0: Unevaluated properties are not allowed ('ethernet-ports' was unexpected)
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/microchip,ksz.example.dtb: switch@1: ethernet-ports:port@6: 'phy-mode' is a required property
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/microchip,ksz.example.dtb: switch@1: Unevaluated properties are not allowed ('ethernet-ports' was unexpected)
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/net/dsa/microchip,ksz.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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports
  2022-07-31 15:00 [PATCH net-next] dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports Vladimir Oltean
  2022-07-31 16:02 ` Rob Herring
@ 2022-08-01 16:22 ` Jakub Kicinski
  2022-08-01 16:29   ` Vladimir Oltean
  1 sibling, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2022-08-01 16:22 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: netdev, devicetree, Rob Herring, Krzysztof Kozlowski,
	David S. Miller, Eric Dumazet, Paolo Abeni, Andrew Lunn,
	Vivien Didelot, Florian Fainelli, Oleksij Rempel,
	Christian Marangi, John Crispin, Kurt Kanzenbach, Mans Rullgard,
	Arun Ramadoss, Woojung Huh, UNGLinuxDriver, Claudiu Manoil,
	Alexandre Belloni, George McCollister, DENG Qingfang, Sean Wang,
	Landen Chao, Matthias Brugger, Hauke Mehrtens,
	Martin Blumenstingl, Aleksander Jan Bajkowski,
	Alvin Šipraga, Luiz Angelo Daros de Luca, Linus Walleij,
	Pawel Dembicki, Clément Léger, Geert Uytterhoeven,
	Russell King, Marek Behún, Marcin Wojtas

On Sun, 31 Jul 2022 18:00:06 +0300 Vladimir Oltean wrote:
> It is desirable that new DSA drivers are written to expect that all
> their ports register with phylink, and not rely on the DSA core's
> workarounds to skip this process.
> 
> To that end, DSA is being changed to warn existing drivers when such DT
> blobs are in use:
> https://patchwork.kernel.org/project/netdevbpf/cover/20220729132119.1191227-1-vladimir.oltean@nxp.com/
> 
> Introduce another layer of validation in the DSA DT schema, and assert
> that CPU and DSA ports must have phylink-related properties present.
> 
> Suggested-by: Rob Herring <robh+dt@kernel.org>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
> I've sent this patch separately because at least right now I don't have
> a reason to resend the other 4 patches linked above, and this has no
> dependency on those.

If I'm reading

https://lore.kernel.org/r/CAL_JsqKZ6cEny_xD8LUMQUR6AQ0q7JKZMmdP-9MUZxzzNxZ3JQ@mail.gmail.com/

correctly - the warnings are expected but there needs to be a change 
to properties, so CR? (FWIW I'd lean towards allowing it still, even
tho net-next got closed. Assuming v2 can get posted and acked today.)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports
  2022-08-01 16:22 ` Jakub Kicinski
@ 2022-08-01 16:29   ` Vladimir Oltean
  2022-08-01 17:17     ` Rob Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Oltean @ 2022-08-01 16:29 UTC (permalink / raw)
  To: Jakub Kicinski, Rob Herring
  Cc: netdev, devicetree, Krzysztof Kozlowski, David S. Miller,
	Eric Dumazet, Paolo Abeni, Andrew Lunn, Vivien Didelot,
	Florian Fainelli, Oleksij Rempel, Christian Marangi,
	John Crispin, Kurt Kanzenbach, Mans Rullgard, Arun Ramadoss,
	Woojung Huh, UNGLinuxDriver, Claudiu Manoil, Alexandre Belloni,
	George McCollister, DENG Qingfang, Sean Wang, Landen Chao,
	Matthias Brugger, Hauke Mehrtens, Martin Blumenstingl,
	Aleksander Jan Bajkowski, Alvin Šipraga,
	Luiz Angelo Daros de Luca, Linus Walleij, Pawel Dembicki,
	Clément Léger, Geert Uytterhoeven, Russell King,
	Marek Behún, Marcin Wojtas

On Mon, Aug 01, 2022 at 09:22:56AM -0700, Jakub Kicinski wrote:
> If I'm reading
> 
> https://lore.kernel.org/r/CAL_JsqKZ6cEny_xD8LUMQUR6AQ0q7JKZMmdP-9MUZxzzNxZ3JQ@mail.gmail.com/
> 
> correctly - the warnings are expected but there needs to be a change 
> to properties, so CR? (FWIW I'd lean towards allowing it still, even
> tho net-next got closed. Assuming v2 can get posted and acked today.)

I can post the v2 of this patch today with Rob's indications and the
correct indentation spotted by yamllint. I'm not going to fix the newly
introduced warnings in drivers' examples - I don't know how, for one thing,
that's hardware specific knowledge.

Rob, given that you've said DSA shouldn't validate the DT and then
reconsidered, I'd appreciate if you could leave some acks on patches 1
and 4 of that series, which deal with the kernel side of things, rather
than the dt-schema.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports
  2022-08-01 16:29   ` Vladimir Oltean
@ 2022-08-01 17:17     ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2022-08-01 17:17 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Jakub Kicinski, netdev, devicetree, Krzysztof Kozlowski,
	David S. Miller, Eric Dumazet, Paolo Abeni, Andrew Lunn,
	Vivien Didelot, Florian Fainelli, Oleksij Rempel,
	Christian Marangi, John Crispin, Kurt Kanzenbach, Mans Rullgard,
	Arun Ramadoss, Woojung Huh, UNGLinuxDriver, Claudiu Manoil,
	Alexandre Belloni, George McCollister, DENG Qingfang, Sean Wang,
	Landen Chao, Matthias Brugger, Hauke Mehrtens,
	Martin Blumenstingl, Aleksander Jan Bajkowski,
	Alvin Šipraga, Luiz Angelo Daros de Luca, Linus Walleij,
	Pawel Dembicki, Clément Léger, Geert Uytterhoeven,
	Russell King, Marek Behún, Marcin Wojtas

On Mon, Aug 01, 2022 at 04:29:43PM +0000, Vladimir Oltean wrote:
> On Mon, Aug 01, 2022 at 09:22:56AM -0700, Jakub Kicinski wrote:
> > If I'm reading
> > 
> > https://lore.kernel.org/r/CAL_JsqKZ6cEny_xD8LUMQUR6AQ0q7JKZMmdP-9MUZxzzNxZ3JQ@mail.gmail.com/
> > 
> > correctly - the warnings are expected but there needs to be a change 
> > to properties, so CR? (FWIW I'd lean towards allowing it still, even
> > tho net-next got closed. Assuming v2 can get posted and acked today.)
> 
> I can post the v2 of this patch today with Rob's indications and the
> correct indentation spotted by yamllint. I'm not going to fix the newly
> introduced warnings in drivers' examples - I don't know how, for one thing,
> that's hardware specific knowledge.

Sorry, but we can't have a bunch of warnings added. The examples must be 
warning free.

> 
> Rob, given that you've said DSA shouldn't validate the DT and then
> reconsidered, I'd appreciate if you could leave some acks on patches 1
> and 4 of that series, which deal with the kernel side of things, rather
> than the dt-schema.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-01 17:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-31 15:00 [PATCH net-next] dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports Vladimir Oltean
2022-07-31 16:02 ` Rob Herring
2022-08-01 16:22 ` Jakub Kicinski
2022-08-01 16:29   ` Vladimir Oltean
2022-08-01 17:17     ` Rob Herring

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.