All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] dt-bindings: net: sunxi: Fix binding validation issues
@ 2022-11-25 20:20 ` Samuel Holland
  0 siblings, 0 replies; 28+ messages in thread
From: Samuel Holland @ 2022-11-25 20:20 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski
  Cc: Samuel Holland, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

These patches fix issues found when running `make dtbs_check` on sunxi
boards. I am not 100% sure about the change in the first two patches,
but I think I understand what is happening, and the change has the
desired effect. It fixes errors of the form:

  arch/arm/boot/dts/sun6i-a31s-colorfly-e708-q1.dtb: ethernet@1c30000:
  Unevaluated properties are not allowed ('mdio', 'reset-names',
  'resets', 'snps,fixed-burst', 'snps,force_sf_dma_mode', 'snps,pbl'
  were unexpected)

where all of the listed properties are defined in snps,dwmac.yaml.

The third patch fixes an unrelated omission in the sun8i-emac binding.


Samuel Holland (3):
  dt-bindings: net: sun7i-gmac: Fix snps,dwmac.yaml inheritance
  dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
  dt-bindings: net: sun8i-emac: Add phy-supply property

 .../devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml   | 5 ++---
 .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml  | 6 +++++-
 2 files changed, 7 insertions(+), 4 deletions(-)

-- 
2.37.4


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

* [PATCH 0/3] dt-bindings: net: sunxi: Fix binding validation issues
@ 2022-11-25 20:20 ` Samuel Holland
  0 siblings, 0 replies; 28+ messages in thread
From: Samuel Holland @ 2022-11-25 20:20 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski
  Cc: Samuel Holland, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

These patches fix issues found when running `make dtbs_check` on sunxi
boards. I am not 100% sure about the change in the first two patches,
but I think I understand what is happening, and the change has the
desired effect. It fixes errors of the form:

  arch/arm/boot/dts/sun6i-a31s-colorfly-e708-q1.dtb: ethernet@1c30000:
  Unevaluated properties are not allowed ('mdio', 'reset-names',
  'resets', 'snps,fixed-burst', 'snps,force_sf_dma_mode', 'snps,pbl'
  were unexpected)

where all of the listed properties are defined in snps,dwmac.yaml.

The third patch fixes an unrelated omission in the sun8i-emac binding.


Samuel Holland (3):
  dt-bindings: net: sun7i-gmac: Fix snps,dwmac.yaml inheritance
  dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
  dt-bindings: net: sun8i-emac: Add phy-supply property

 .../devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml   | 5 ++---
 .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml  | 6 +++++-
 2 files changed, 7 insertions(+), 4 deletions(-)

-- 
2.37.4


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

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

* [PATCH 1/3] dt-bindings: net: sun7i-gmac: Fix snps,dwmac.yaml inheritance
  2022-11-25 20:20 ` Samuel Holland
@ 2022-11-25 20:20   ` Samuel Holland
  -1 siblings, 0 replies; 28+ messages in thread
From: Samuel Holland @ 2022-11-25 20:20 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski
  Cc: Samuel Holland, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

The sun7i-gmac binding extends snps,dwmac.yaml, and should accept all
properties defined there, including "mdio", "resets", and "reset-names".
However, validation currently fails for these properties because the
local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
is only included inside an allOf block. Fix this by referencing
snps,dwmac.yaml at the top level.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---

 .../devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml    | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
index 3bd912ed7c7e..7d2c62b4ccad 100644
--- a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
+++ b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
@@ -6,13 +6,12 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: Allwinner A20 GMAC
 
-allOf:
-  - $ref: "snps,dwmac.yaml#"
-
 maintainers:
   - Chen-Yu Tsai <wens@csie.org>
   - Maxime Ripard <mripard@kernel.org>
 
+$ref: "snps,dwmac.yaml#"
+
 properties:
   compatible:
     const: allwinner,sun7i-a20-gmac
-- 
2.37.4


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

* [PATCH 1/3] dt-bindings: net: sun7i-gmac: Fix snps,dwmac.yaml inheritance
@ 2022-11-25 20:20   ` Samuel Holland
  0 siblings, 0 replies; 28+ messages in thread
From: Samuel Holland @ 2022-11-25 20:20 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski
  Cc: Samuel Holland, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

The sun7i-gmac binding extends snps,dwmac.yaml, and should accept all
properties defined there, including "mdio", "resets", and "reset-names".
However, validation currently fails for these properties because the
local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
is only included inside an allOf block. Fix this by referencing
snps,dwmac.yaml at the top level.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---

 .../devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml    | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
index 3bd912ed7c7e..7d2c62b4ccad 100644
--- a/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
+++ b/Documentation/devicetree/bindings/net/allwinner,sun7i-a20-gmac.yaml
@@ -6,13 +6,12 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
 
 title: Allwinner A20 GMAC
 
-allOf:
-  - $ref: "snps,dwmac.yaml#"
-
 maintainers:
   - Chen-Yu Tsai <wens@csie.org>
   - Maxime Ripard <mripard@kernel.org>
 
+$ref: "snps,dwmac.yaml#"
+
 properties:
   compatible:
     const: allwinner,sun7i-a20-gmac
-- 
2.37.4


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

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

* [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
  2022-11-25 20:20 ` Samuel Holland
@ 2022-11-25 20:20   ` Samuel Holland
  -1 siblings, 0 replies; 28+ messages in thread
From: Samuel Holland @ 2022-11-25 20:20 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski
  Cc: Samuel Holland, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
properties defined there, including "mdio", "resets", and "reset-names".
However, validation currently fails for these properties because the
local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
is only included inside an allOf block. Fix this by referencing
snps,dwmac.yaml at the top level.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---

 .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
index 1432fda3b603..34a47922296d 100644
--- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
+++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
@@ -10,6 +10,8 @@ maintainers:
   - Chen-Yu Tsai <wens@csie.org>
   - Maxime Ripard <mripard@kernel.org>
 
+$ref: "snps,dwmac.yaml#"
+
 properties:
   compatible:
     oneOf:
@@ -60,7 +62,6 @@ required:
   - syscon
 
 allOf:
-  - $ref: "snps,dwmac.yaml#"
   - if:
       properties:
         compatible:
-- 
2.37.4


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

* [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
@ 2022-11-25 20:20   ` Samuel Holland
  0 siblings, 0 replies; 28+ messages in thread
From: Samuel Holland @ 2022-11-25 20:20 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski
  Cc: Samuel Holland, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
properties defined there, including "mdio", "resets", and "reset-names".
However, validation currently fails for these properties because the
local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
is only included inside an allOf block. Fix this by referencing
snps,dwmac.yaml at the top level.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---

 .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
index 1432fda3b603..34a47922296d 100644
--- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
+++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
@@ -10,6 +10,8 @@ maintainers:
   - Chen-Yu Tsai <wens@csie.org>
   - Maxime Ripard <mripard@kernel.org>
 
+$ref: "snps,dwmac.yaml#"
+
 properties:
   compatible:
     oneOf:
@@ -60,7 +62,6 @@ required:
   - syscon
 
 allOf:
-  - $ref: "snps,dwmac.yaml#"
   - if:
       properties:
         compatible:
-- 
2.37.4


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

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

* [PATCH 3/3] dt-bindings: net: sun8i-emac: Add phy-supply property
  2022-11-25 20:20 ` Samuel Holland
@ 2022-11-25 20:20   ` Samuel Holland
  -1 siblings, 0 replies; 28+ messages in thread
From: Samuel Holland @ 2022-11-25 20:20 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski
  Cc: Samuel Holland, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

This property has always been supported by the Linux driver; see
commit 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i"). In fact, the
original driver submission includes the phy-supply code but no mention
of it in the binding, so the omission appears to be accidental. In
addition, the property is documented in the binding for the previous
hardware generation, allwinner,sun7i-a20-gmac.

Document phy-supply in the binding to fix devicetree validation for the
25+ boards that already use this property.

Fixes: 0441bde003be ("dt-bindings: net-next: Add DT bindings documentation for Allwinner dwmac-sun8i")
Signed-off-by: Samuel Holland <samuel@sholland.org>
---

 .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
index 34a47922296d..4f671478b288 100644
--- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
+++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
@@ -42,6 +42,9 @@ properties:
   clock-names:
     const: stmmaceth
 
+  phy-supply:
+    description: PHY regulator
+
   syscon:
     $ref: /schemas/types.yaml#/definitions/phandle
     description:
-- 
2.37.4


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

* [PATCH 3/3] dt-bindings: net: sun8i-emac: Add phy-supply property
@ 2022-11-25 20:20   ` Samuel Holland
  0 siblings, 0 replies; 28+ messages in thread
From: Samuel Holland @ 2022-11-25 20:20 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski
  Cc: Samuel Holland, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

This property has always been supported by the Linux driver; see
commit 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i"). In fact, the
original driver submission includes the phy-supply code but no mention
of it in the binding, so the omission appears to be accidental. In
addition, the property is documented in the binding for the previous
hardware generation, allwinner,sun7i-a20-gmac.

Document phy-supply in the binding to fix devicetree validation for the
25+ boards that already use this property.

Fixes: 0441bde003be ("dt-bindings: net-next: Add DT bindings documentation for Allwinner dwmac-sun8i")
Signed-off-by: Samuel Holland <samuel@sholland.org>
---

 .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
index 34a47922296d..4f671478b288 100644
--- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
+++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
@@ -42,6 +42,9 @@ properties:
   clock-names:
     const: stmmaceth
 
+  phy-supply:
+    description: PHY regulator
+
   syscon:
     $ref: /schemas/types.yaml#/definitions/phandle
     description:
-- 
2.37.4


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

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

* Re: [PATCH 3/3] dt-bindings: net: sun8i-emac: Add phy-supply property
  2022-11-25 20:20   ` Samuel Holland
@ 2022-11-26  0:32     ` Andre Przywara
  -1 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2022-11-26  0:32 UTC (permalink / raw)
  To: Samuel Holland
  Cc: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	LABBE Corentin, Maxime Ripard, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, netdev

On Fri, 25 Nov 2022 14:20:08 -0600
Samuel Holland <samuel@sholland.org> wrote:

> This property has always been supported by the Linux driver; see
> commit 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i"). In fact, the
> original driver submission includes the phy-supply code but no mention
> of it in the binding, so the omission appears to be accidental. In
> addition, the property is documented in the binding for the previous
> hardware generation, allwinner,sun7i-a20-gmac.
> 
> Document phy-supply in the binding to fix devicetree validation for the
> 25+ boards that already use this property.
> 
> Fixes: 0441bde003be ("dt-bindings: net-next: Add DT bindings documentation for Allwinner dwmac-sun8i")
> Signed-off-by: Samuel Holland <samuel@sholland.org>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
> 
>  .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> index 34a47922296d..4f671478b288 100644
> --- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> +++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> @@ -42,6 +42,9 @@ properties:
>    clock-names:
>      const: stmmaceth
>  
> +  phy-supply:
> +    description: PHY regulator
> +
>    syscon:
>      $ref: /schemas/types.yaml#/definitions/phandle
>      description:


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

* Re: [PATCH 3/3] dt-bindings: net: sun8i-emac: Add phy-supply property
@ 2022-11-26  0:32     ` Andre Przywara
  0 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2022-11-26  0:32 UTC (permalink / raw)
  To: Samuel Holland
  Cc: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	LABBE Corentin, Maxime Ripard, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, netdev

On Fri, 25 Nov 2022 14:20:08 -0600
Samuel Holland <samuel@sholland.org> wrote:

> This property has always been supported by the Linux driver; see
> commit 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i"). In fact, the
> original driver submission includes the phy-supply code but no mention
> of it in the binding, so the omission appears to be accidental. In
> addition, the property is documented in the binding for the previous
> hardware generation, allwinner,sun7i-a20-gmac.
> 
> Document phy-supply in the binding to fix devicetree validation for the
> 25+ boards that already use this property.
> 
> Fixes: 0441bde003be ("dt-bindings: net-next: Add DT bindings documentation for Allwinner dwmac-sun8i")
> Signed-off-by: Samuel Holland <samuel@sholland.org>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
> 
>  .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> index 34a47922296d..4f671478b288 100644
> --- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> +++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> @@ -42,6 +42,9 @@ properties:
>    clock-names:
>      const: stmmaceth
>  
> +  phy-supply:
> +    description: PHY regulator
> +
>    syscon:
>      $ref: /schemas/types.yaml#/definitions/phandle
>      description:


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

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

* Re: [PATCH 1/3] dt-bindings: net: sun7i-gmac: Fix snps,dwmac.yaml inheritance
  2022-11-25 20:20   ` Samuel Holland
@ 2022-11-26 13:25     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-26 13:25 UTC (permalink / raw)
  To: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski
  Cc: LABBE Corentin, Maxime Ripard, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, netdev

On 25/11/2022 21:20, Samuel Holland wrote:
> The sun7i-gmac binding extends snps,dwmac.yaml, and should accept all
> properties defined there, including "mdio", "resets", and "reset-names".
> However, validation currently fails for these properties because the
> local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
> is only included inside an allOf block. Fix this by referencing
> snps,dwmac.yaml at the top level.
> 

I don't understand where is the problem and how does your patch solve
it. The old syntax is correct and your change does nothing, no fixing,
no impact. It actually looks like noop with big explanation :(

> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---


Best regards,
Krzysztof


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

* Re: [PATCH 1/3] dt-bindings: net: sun7i-gmac: Fix snps,dwmac.yaml inheritance
@ 2022-11-26 13:25     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-26 13:25 UTC (permalink / raw)
  To: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski
  Cc: LABBE Corentin, Maxime Ripard, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, netdev

On 25/11/2022 21:20, Samuel Holland wrote:
> The sun7i-gmac binding extends snps,dwmac.yaml, and should accept all
> properties defined there, including "mdio", "resets", and "reset-names".
> However, validation currently fails for these properties because the
> local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
> is only included inside an allOf block. Fix this by referencing
> snps,dwmac.yaml at the top level.
> 

I don't understand where is the problem and how does your patch solve
it. The old syntax is correct and your change does nothing, no fixing,
no impact. It actually looks like noop with big explanation :(

> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---


Best regards,
Krzysztof


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

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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
  2022-11-25 20:20   ` Samuel Holland
@ 2022-11-26 13:26     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-26 13:26 UTC (permalink / raw)
  To: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski
  Cc: LABBE Corentin, Maxime Ripard, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, netdev

On 25/11/2022 21:20, Samuel Holland wrote:
> The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
> properties defined there, including "mdio", "resets", and "reset-names".
> However, validation currently fails for these properties because the

validation does not fail:
make dt_binding_check -> no problems

Maybe you meant that DTS do not pass dtbs_check?


> local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
> is only included inside an allOf block. Fix this by referencing
> snps,dwmac.yaml at the top level.

There is nothing being fixed here...

> 
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
> 
>  .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> index 1432fda3b603..34a47922296d 100644
> --- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> +++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> @@ -10,6 +10,8 @@ maintainers:
>    - Chen-Yu Tsai <wens@csie.org>
>    - Maxime Ripard <mripard@kernel.org>
>  
> +$ref: "snps,dwmac.yaml#"
> +
>  properties:
>    compatible:
>      oneOf:
> @@ -60,7 +62,6 @@ required:
>    - syscon
>  
>  allOf:
> -  - $ref: "snps,dwmac.yaml#"
>    - if:
>        properties:
>          compatible:

Best regards,
Krzysztof


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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
@ 2022-11-26 13:26     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-26 13:26 UTC (permalink / raw)
  To: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski
  Cc: LABBE Corentin, Maxime Ripard, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, netdev

On 25/11/2022 21:20, Samuel Holland wrote:
> The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
> properties defined there, including "mdio", "resets", and "reset-names".
> However, validation currently fails for these properties because the

validation does not fail:
make dt_binding_check -> no problems

Maybe you meant that DTS do not pass dtbs_check?


> local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
> is only included inside an allOf block. Fix this by referencing
> snps,dwmac.yaml at the top level.

There is nothing being fixed here...

> 
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
> 
>  .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> index 1432fda3b603..34a47922296d 100644
> --- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> +++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> @@ -10,6 +10,8 @@ maintainers:
>    - Chen-Yu Tsai <wens@csie.org>
>    - Maxime Ripard <mripard@kernel.org>
>  
> +$ref: "snps,dwmac.yaml#"
> +
>  properties:
>    compatible:
>      oneOf:
> @@ -60,7 +62,6 @@ required:
>    - syscon
>  
>  allOf:
> -  - $ref: "snps,dwmac.yaml#"
>    - if:
>        properties:
>          compatible:

Best regards,
Krzysztof


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

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

* Re: [PATCH 3/3] dt-bindings: net: sun8i-emac: Add phy-supply property
  2022-11-25 20:20   ` Samuel Holland
@ 2022-11-26 13:37     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-26 13:37 UTC (permalink / raw)
  To: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski
  Cc: LABBE Corentin, Maxime Ripard, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, netdev

On 25/11/2022 21:20, Samuel Holland wrote:
> This property has always been supported by the Linux driver; see
> commit 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i"). In fact, the
> original driver submission includes the phy-supply code but no mention
> of it in the binding, so the omission appears to be accidental. In
> addition, the property is documented in the binding for the previous
> hardware generation, allwinner,sun7i-a20-gmac.
> 
> Document phy-supply in the binding to fix devicetree validation for the
> 25+ boards that already use this property.
> 
> Fixes: 0441bde003be ("dt-bindings: net-next: Add DT bindings documentation for Allwinner dwmac-sun8i")
> Signed-off-by: Samuel Holland <samuel@sholland.org>

This looks ok.

Best regards,
Krzysztof


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

* Re: [PATCH 3/3] dt-bindings: net: sun8i-emac: Add phy-supply property
@ 2022-11-26 13:37     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-26 13:37 UTC (permalink / raw)
  To: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski
  Cc: LABBE Corentin, Maxime Ripard, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, netdev

On 25/11/2022 21:20, Samuel Holland wrote:
> This property has always been supported by the Linux driver; see
> commit 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i"). In fact, the
> original driver submission includes the phy-supply code but no mention
> of it in the binding, so the omission appears to be accidental. In
> addition, the property is documented in the binding for the previous
> hardware generation, allwinner,sun7i-a20-gmac.
> 
> Document phy-supply in the binding to fix devicetree validation for the
> 25+ boards that already use this property.
> 
> Fixes: 0441bde003be ("dt-bindings: net-next: Add DT bindings documentation for Allwinner dwmac-sun8i")
> Signed-off-by: Samuel Holland <samuel@sholland.org>

This looks ok.

Best regards,
Krzysztof


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

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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
  2022-11-25 20:20   ` Samuel Holland
@ 2022-11-26 14:15     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-26 14:15 UTC (permalink / raw)
  To: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski
  Cc: LABBE Corentin, Maxime Ripard, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, netdev

On 25/11/2022 21:20, Samuel Holland wrote:
> The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
> properties defined there, including "mdio", "resets", and "reset-names".
> However, validation currently fails for these properties because the
> local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
> is only included inside an allOf block. Fix this by referencing
> snps,dwmac.yaml at the top level.
> 
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
> 
>  .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

I must admit you're right that this hides the warning from dtbs_check,
but not because something in allOf should not be included. The problem
is how disabled nodes are being parsed here by referenced schema
(snps,dwmac.yaml) and probably is a bug in dtschema package.


Best regards,
Krzysztof


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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
@ 2022-11-26 14:15     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-26 14:15 UTC (permalink / raw)
  To: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski
  Cc: LABBE Corentin, Maxime Ripard, devicetree, linux-arm-kernel,
	linux-kernel, linux-sunxi, netdev

On 25/11/2022 21:20, Samuel Holland wrote:
> The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
> properties defined there, including "mdio", "resets", and "reset-names".
> However, validation currently fails for these properties because the
> local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
> is only included inside an allOf block. Fix this by referencing
> snps,dwmac.yaml at the top level.
> 
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
> 
>  .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

I must admit you're right that this hides the warning from dtbs_check,
but not because something in allOf should not be included. The problem
is how disabled nodes are being parsed here by referenced schema
(snps,dwmac.yaml) and probably is a bug in dtschema package.


Best regards,
Krzysztof


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

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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
  2022-11-26 13:26     ` Krzysztof Kozlowski
@ 2022-11-26 14:28       ` Andre Przywara
  -1 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2022-11-26 14:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

On Sat, 26 Nov 2022 14:26:25 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

Hi,

> On 25/11/2022 21:20, Samuel Holland wrote:
> > The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
> > properties defined there, including "mdio", "resets", and "reset-names".
> > However, validation currently fails for these properties because the  
> 
> validation does not fail:
> make dt_binding_check -> no problems
> 
> Maybe you meant that DTS do not pass dtbs_check?

Yes, that's what he meant: If a board actually doesn't have Ethernet
configured, dt-validate complains. I saw this before, but didn't find
any solution.
An example is: $ dt-validate ... sun50i-a64-pinephone-1.2.dtb
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dtb:
  ethernet@1c30000: Unevaluated properties are not allowed ('resets', 'reset-names', 'mdio' were unexpected)
  From schema: Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml

Why exactly is beyond me, but this patch removes this message.

Cheers,
Andre


> > local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
> > is only included inside an allOf block. Fix this by referencing
> > snps,dwmac.yaml at the top level.  
> 
> There is nothing being fixed here...
> 
> > 
> > Signed-off-by: Samuel Holland <samuel@sholland.org>
> > ---
> > 
> >  .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> > index 1432fda3b603..34a47922296d 100644
> > --- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> > +++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> > @@ -10,6 +10,8 @@ maintainers:
> >    - Chen-Yu Tsai <wens@csie.org>
> >    - Maxime Ripard <mripard@kernel.org>
> >  
> > +$ref: "snps,dwmac.yaml#"
> > +
> >  properties:
> >    compatible:
> >      oneOf:
> > @@ -60,7 +62,6 @@ required:
> >    - syscon
> >  
> >  allOf:
> > -  - $ref: "snps,dwmac.yaml#"
> >    - if:
> >        properties:
> >          compatible:  
> 
> Best regards,
> Krzysztof
> 
> 


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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
@ 2022-11-26 14:28       ` Andre Przywara
  0 siblings, 0 replies; 28+ messages in thread
From: Andre Przywara @ 2022-11-26 14:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

On Sat, 26 Nov 2022 14:26:25 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

Hi,

> On 25/11/2022 21:20, Samuel Holland wrote:
> > The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
> > properties defined there, including "mdio", "resets", and "reset-names".
> > However, validation currently fails for these properties because the  
> 
> validation does not fail:
> make dt_binding_check -> no problems
> 
> Maybe you meant that DTS do not pass dtbs_check?

Yes, that's what he meant: If a board actually doesn't have Ethernet
configured, dt-validate complains. I saw this before, but didn't find
any solution.
An example is: $ dt-validate ... sun50i-a64-pinephone-1.2.dtb
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dtb:
  ethernet@1c30000: Unevaluated properties are not allowed ('resets', 'reset-names', 'mdio' were unexpected)
  From schema: Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml

Why exactly is beyond me, but this patch removes this message.

Cheers,
Andre


> > local binding sets "unevaluatedProperties: false", and snps,dwmac.yaml
> > is only included inside an allOf block. Fix this by referencing
> > snps,dwmac.yaml at the top level.  
> 
> There is nothing being fixed here...
> 
> > 
> > Signed-off-by: Samuel Holland <samuel@sholland.org>
> > ---
> > 
> >  .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> > index 1432fda3b603..34a47922296d 100644
> > --- a/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> > +++ b/Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> > @@ -10,6 +10,8 @@ maintainers:
> >    - Chen-Yu Tsai <wens@csie.org>
> >    - Maxime Ripard <mripard@kernel.org>
> >  
> > +$ref: "snps,dwmac.yaml#"
> > +
> >  properties:
> >    compatible:
> >      oneOf:
> > @@ -60,7 +62,6 @@ required:
> >    - syscon
> >  
> >  allOf:
> > -  - $ref: "snps,dwmac.yaml#"
> >    - if:
> >        properties:
> >          compatible:  
> 
> Best regards,
> Krzysztof
> 
> 


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

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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
  2022-11-26 14:28       ` Andre Przywara
@ 2022-11-26 14:48         ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-26 14:48 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

On 26/11/2022 15:28, Andre Przywara wrote:
> On Sat, 26 Nov 2022 14:26:25 +0100
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> 
> Hi,
> 
>> On 25/11/2022 21:20, Samuel Holland wrote:
>>> The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
>>> properties defined there, including "mdio", "resets", and "reset-names".
>>> However, validation currently fails for these properties because the  
>>
>> validation does not fail:
>> make dt_binding_check -> no problems
>>
>> Maybe you meant that DTS do not pass dtbs_check?
> 
> Yes, that's what he meant: If a board actually doesn't have Ethernet
> configured, dt-validate complains. I saw this before, but didn't find
> any solution.
> An example is: $ dt-validate ... sun50i-a64-pinephone-1.2.dtb
> arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dtb:
>   ethernet@1c30000: Unevaluated properties are not allowed ('resets', 'reset-names', 'mdio' were unexpected)
>   From schema: Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> 
> Why exactly is beyond me, but this patch removes this message.

I don't think this should be fixed like this. That's the problem of
dtschema (not ignoring fully disabled nodes) and such patch only moves
from one correct syntax to another correct syntax, which fixes dtschema
problem, but changes nothing here.

Best regards,
Krzysztof


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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
@ 2022-11-26 14:48         ` Krzysztof Kozlowski
  0 siblings, 0 replies; 28+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-26 14:48 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Samuel Holland, Chen-Yu Tsai, Jernej Skrabec, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, LABBE Corentin, Maxime Ripard, devicetree,
	linux-arm-kernel, linux-kernel, linux-sunxi, netdev

On 26/11/2022 15:28, Andre Przywara wrote:
> On Sat, 26 Nov 2022 14:26:25 +0100
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> 
> Hi,
> 
>> On 25/11/2022 21:20, Samuel Holland wrote:
>>> The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
>>> properties defined there, including "mdio", "resets", and "reset-names".
>>> However, validation currently fails for these properties because the  
>>
>> validation does not fail:
>> make dt_binding_check -> no problems
>>
>> Maybe you meant that DTS do not pass dtbs_check?
> 
> Yes, that's what he meant: If a board actually doesn't have Ethernet
> configured, dt-validate complains. I saw this before, but didn't find
> any solution.
> An example is: $ dt-validate ... sun50i-a64-pinephone-1.2.dtb
> arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dtb:
>   ethernet@1c30000: Unevaluated properties are not allowed ('resets', 'reset-names', 'mdio' were unexpected)
>   From schema: Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> 
> Why exactly is beyond me, but this patch removes this message.

I don't think this should be fixed like this. That's the problem of
dtschema (not ignoring fully disabled nodes) and such patch only moves
from one correct syntax to another correct syntax, which fixes dtschema
problem, but changes nothing here.

Best regards,
Krzysztof


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

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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
  2022-11-26 14:48         ` Krzysztof Kozlowski
@ 2022-12-01  3:45           ` Rob Herring
  -1 siblings, 0 replies; 28+ messages in thread
From: Rob Herring @ 2022-12-01  3:45 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andre Przywara, Samuel Holland
  Cc: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Krzysztof Kozlowski, LABBE Corentin,
	Maxime Ripard, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi, netdev

On Sat, Nov 26, 2022 at 03:48:33PM +0100, Krzysztof Kozlowski wrote:
> On 26/11/2022 15:28, Andre Przywara wrote:
> > On Sat, 26 Nov 2022 14:26:25 +0100
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> > 
> > Hi,
> > 
> >> On 25/11/2022 21:20, Samuel Holland wrote:
> >>> The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
> >>> properties defined there, including "mdio", "resets", and "reset-names".
> >>> However, validation currently fails for these properties because the  
> >>
> >> validation does not fail:
> >> make dt_binding_check -> no problems
> >>
> >> Maybe you meant that DTS do not pass dtbs_check?
> > 
> > Yes, that's what he meant: If a board actually doesn't have Ethernet
> > configured, dt-validate complains. I saw this before, but didn't find
> > any solution.
> > An example is: $ dt-validate ... sun50i-a64-pinephone-1.2.dtb
> > arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dtb:
> >   ethernet@1c30000: Unevaluated properties are not allowed ('resets', 'reset-names', 'mdio' were unexpected)
> >   From schema: Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> > 
> > Why exactly is beyond me, but this patch removes this message.
> 
> I don't think this should be fixed like this. That's the problem of
> dtschema (not ignoring fully disabled nodes) and such patch only moves
> from one correct syntax to another correct syntax, which fixes dtschema
> problem, but changes nothing here.

Humm, it looks to me like the 'phy-mode' required in snps,dwmac.yaml 
causes the problem, but I can't get a minimized example to fail. 
Something in 'required' shouldn't matter. Definitely seems like an issue 
in the jsonschema package. I'll keep looking at it.

Rob

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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
@ 2022-12-01  3:45           ` Rob Herring
  0 siblings, 0 replies; 28+ messages in thread
From: Rob Herring @ 2022-12-01  3:45 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andre Przywara, Samuel Holland
  Cc: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Krzysztof Kozlowski, LABBE Corentin,
	Maxime Ripard, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi, netdev

On Sat, Nov 26, 2022 at 03:48:33PM +0100, Krzysztof Kozlowski wrote:
> On 26/11/2022 15:28, Andre Przywara wrote:
> > On Sat, 26 Nov 2022 14:26:25 +0100
> > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> > 
> > Hi,
> > 
> >> On 25/11/2022 21:20, Samuel Holland wrote:
> >>> The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
> >>> properties defined there, including "mdio", "resets", and "reset-names".
> >>> However, validation currently fails for these properties because the  
> >>
> >> validation does not fail:
> >> make dt_binding_check -> no problems
> >>
> >> Maybe you meant that DTS do not pass dtbs_check?
> > 
> > Yes, that's what he meant: If a board actually doesn't have Ethernet
> > configured, dt-validate complains. I saw this before, but didn't find
> > any solution.
> > An example is: $ dt-validate ... sun50i-a64-pinephone-1.2.dtb
> > arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dtb:
> >   ethernet@1c30000: Unevaluated properties are not allowed ('resets', 'reset-names', 'mdio' were unexpected)
> >   From schema: Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> > 
> > Why exactly is beyond me, but this patch removes this message.
> 
> I don't think this should be fixed like this. That's the problem of
> dtschema (not ignoring fully disabled nodes) and such patch only moves
> from one correct syntax to another correct syntax, which fixes dtschema
> problem, but changes nothing here.

Humm, it looks to me like the 'phy-mode' required in snps,dwmac.yaml 
causes the problem, but I can't get a minimized example to fail. 
Something in 'required' shouldn't matter. Definitely seems like an issue 
in the jsonschema package. I'll keep looking at it.

Rob

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

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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
  2022-12-01  3:45           ` Rob Herring
@ 2022-12-01 18:10             ` Rob Herring
  -1 siblings, 0 replies; 28+ messages in thread
From: Rob Herring @ 2022-12-01 18:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andre Przywara, Samuel Holland
  Cc: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Krzysztof Kozlowski, LABBE Corentin,
	Maxime Ripard, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi, netdev

On Wed, Nov 30, 2022 at 9:45 PM Rob Herring <robh@kernel.org> wrote:
>
> On Sat, Nov 26, 2022 at 03:48:33PM +0100, Krzysztof Kozlowski wrote:
> > On 26/11/2022 15:28, Andre Przywara wrote:
> > > On Sat, 26 Nov 2022 14:26:25 +0100
> > > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> > >
> > > Hi,
> > >
> > >> On 25/11/2022 21:20, Samuel Holland wrote:
> > >>> The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
> > >>> properties defined there, including "mdio", "resets", and "reset-names".
> > >>> However, validation currently fails for these properties because the
> > >>
> > >> validation does not fail:
> > >> make dt_binding_check -> no problems
> > >>
> > >> Maybe you meant that DTS do not pass dtbs_check?
> > >
> > > Yes, that's what he meant: If a board actually doesn't have Ethernet
> > > configured, dt-validate complains. I saw this before, but didn't find
> > > any solution.
> > > An example is: $ dt-validate ... sun50i-a64-pinephone-1.2.dtb
> > > arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dtb:
> > >   ethernet@1c30000: Unevaluated properties are not allowed ('resets', 'reset-names', 'mdio' were unexpected)
> > >   From schema: Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> > >
> > > Why exactly is beyond me, but this patch removes this message.
> >
> > I don't think this should be fixed like this. That's the problem of
> > dtschema (not ignoring fully disabled nodes) and such patch only moves
> > from one correct syntax to another correct syntax, which fixes dtschema
> > problem, but changes nothing here.
>
> Humm, it looks to me like the 'phy-mode' required in snps,dwmac.yaml
> causes the problem, but I can't get a minimized example to fail.
> Something in 'required' shouldn't matter. Definitely seems like an issue
> in the jsonschema package. I'll keep looking at it.

TLDR: A fix in dtschema for this will be in place soon.

I've simplified this down to:
{
    "$schema": "https://json-schema.org/draft/2019-09/schema",

    "unevaluatedProperties": false,
    "allOf":[
        {
            "properties": {
                "foo": true,
                "bar": true
            },
            "required": [ "foo" ]
        }
    ]
}

An instance { "bar": 1 } will fail due to the 'required' failing. When
you have a subschema (what's under 'allOf'), then it all has to pass
to be 'evaluated'. This seems inconsistent to me, but the json-schema
folks say it is operating as intended.

I've got 2 possible fixes. One is to just ignore unevaluatedProperties
errors on disabled nodes like is already done for 'required'. This
means disabled nodes can have any unknown property or child node added
which isn't great. The other way overrides 'required' validation to
always pass on disabled nodes. This would be better, but there are
some exceptions we need to still fail. 'oneOf' with N entries of
'required' to say 1 of N properties must be present for example.
Excluding each one of these cases will be fragile, so probably going
with the first fix.

Rob

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

* Re: [PATCH 2/3] dt-bindings: net: sun8i-emac: Fix snps,dwmac.yaml inheritance
@ 2022-12-01 18:10             ` Rob Herring
  0 siblings, 0 replies; 28+ messages in thread
From: Rob Herring @ 2022-12-01 18:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Andre Przywara, Samuel Holland
  Cc: Chen-Yu Tsai, Jernej Skrabec, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Krzysztof Kozlowski, LABBE Corentin,
	Maxime Ripard, devicetree, linux-arm-kernel, linux-kernel,
	linux-sunxi, netdev

On Wed, Nov 30, 2022 at 9:45 PM Rob Herring <robh@kernel.org> wrote:
>
> On Sat, Nov 26, 2022 at 03:48:33PM +0100, Krzysztof Kozlowski wrote:
> > On 26/11/2022 15:28, Andre Przywara wrote:
> > > On Sat, 26 Nov 2022 14:26:25 +0100
> > > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> > >
> > > Hi,
> > >
> > >> On 25/11/2022 21:20, Samuel Holland wrote:
> > >>> The sun8i-emac binding extends snps,dwmac.yaml, and should accept all
> > >>> properties defined there, including "mdio", "resets", and "reset-names".
> > >>> However, validation currently fails for these properties because the
> > >>
> > >> validation does not fail:
> > >> make dt_binding_check -> no problems
> > >>
> > >> Maybe you meant that DTS do not pass dtbs_check?
> > >
> > > Yes, that's what he meant: If a board actually doesn't have Ethernet
> > > configured, dt-validate complains. I saw this before, but didn't find
> > > any solution.
> > > An example is: $ dt-validate ... sun50i-a64-pinephone-1.2.dtb
> > > arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dtb:
> > >   ethernet@1c30000: Unevaluated properties are not allowed ('resets', 'reset-names', 'mdio' were unexpected)
> > >   From schema: Documentation/devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml
> > >
> > > Why exactly is beyond me, but this patch removes this message.
> >
> > I don't think this should be fixed like this. That's the problem of
> > dtschema (not ignoring fully disabled nodes) and such patch only moves
> > from one correct syntax to another correct syntax, which fixes dtschema
> > problem, but changes nothing here.
>
> Humm, it looks to me like the 'phy-mode' required in snps,dwmac.yaml
> causes the problem, but I can't get a minimized example to fail.
> Something in 'required' shouldn't matter. Definitely seems like an issue
> in the jsonschema package. I'll keep looking at it.

TLDR: A fix in dtschema for this will be in place soon.

I've simplified this down to:
{
    "$schema": "https://json-schema.org/draft/2019-09/schema",

    "unevaluatedProperties": false,
    "allOf":[
        {
            "properties": {
                "foo": true,
                "bar": true
            },
            "required": [ "foo" ]
        }
    ]
}

An instance { "bar": 1 } will fail due to the 'required' failing. When
you have a subschema (what's under 'allOf'), then it all has to pass
to be 'evaluated'. This seems inconsistent to me, but the json-schema
folks say it is operating as intended.

I've got 2 possible fixes. One is to just ignore unevaluatedProperties
errors on disabled nodes like is already done for 'required'. This
means disabled nodes can have any unknown property or child node added
which isn't great. The other way overrides 'required' validation to
always pass on disabled nodes. This would be better, but there are
some exceptions we need to still fail. 'oneOf' with N entries of
'required' to say 1 of N properties must be present for example.
Excluding each one of these cases will be fragile, so probably going
with the first fix.

Rob

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

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

* Re: [PATCH 3/3] dt-bindings: net: sun8i-emac: Add phy-supply property
  2022-11-25 20:20   ` Samuel Holland
@ 2022-12-01 21:49     ` Rob Herring
  -1 siblings, 0 replies; 28+ messages in thread
From: Rob Herring @ 2022-12-01 21:49 UTC (permalink / raw)
  To: Samuel Holland
  Cc: LABBE Corentin, linux-sunxi, netdev, Jakub Kicinski,
	Jernej Skrabec, Paolo Abeni, devicetree, Krzysztof Kozlowski,
	linux-kernel, linux-arm-kernel, Chen-Yu Tsai, Maxime Ripard,
	Eric Dumazet, Rob Herring, David S . Miller


On Fri, 25 Nov 2022 14:20:08 -0600, Samuel Holland wrote:
> This property has always been supported by the Linux driver; see
> commit 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i"). In fact, the
> original driver submission includes the phy-supply code but no mention
> of it in the binding, so the omission appears to be accidental. In
> addition, the property is documented in the binding for the previous
> hardware generation, allwinner,sun7i-a20-gmac.
> 
> Document phy-supply in the binding to fix devicetree validation for the
> 25+ boards that already use this property.
> 
> Fixes: 0441bde003be ("dt-bindings: net-next: Add DT bindings documentation for Allwinner dwmac-sun8i")
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
> 
>  .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 +++
>  1 file changed, 3 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 3/3] dt-bindings: net: sun8i-emac: Add phy-supply property
@ 2022-12-01 21:49     ` Rob Herring
  0 siblings, 0 replies; 28+ messages in thread
From: Rob Herring @ 2022-12-01 21:49 UTC (permalink / raw)
  To: Samuel Holland
  Cc: LABBE Corentin, linux-sunxi, netdev, Jakub Kicinski,
	Jernej Skrabec, Paolo Abeni, devicetree, Krzysztof Kozlowski,
	linux-kernel, linux-arm-kernel, Chen-Yu Tsai, Maxime Ripard,
	Eric Dumazet, Rob Herring, David S . Miller


On Fri, 25 Nov 2022 14:20:08 -0600, Samuel Holland wrote:
> This property has always been supported by the Linux driver; see
> commit 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i"). In fact, the
> original driver submission includes the phy-supply code but no mention
> of it in the binding, so the omission appears to be accidental. In
> addition, the property is documented in the binding for the previous
> hardware generation, allwinner,sun7i-a20-gmac.
> 
> Document phy-supply in the binding to fix devicetree validation for the
> 25+ boards that already use this property.
> 
> Fixes: 0441bde003be ("dt-bindings: net-next: Add DT bindings documentation for Allwinner dwmac-sun8i")
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
> 
>  .../devicetree/bindings/net/allwinner,sun8i-a83t-emac.yaml     | 3 +++
>  1 file changed, 3 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

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

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

end of thread, other threads:[~2022-12-01 23:04 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-25 20:20 [PATCH 0/3] dt-bindings: net: sunxi: Fix binding validation issues Samuel Holland
2022-11-25 20:20 ` Samuel Holland
2022-11-25 20:20 ` [PATCH 1/3] dt-bindings: net: sun7i-gmac: Fix snps,dwmac.yaml inheritance Samuel Holland
2022-11-25 20:20   ` Samuel Holland
2022-11-26 13:25   ` Krzysztof Kozlowski
2022-11-26 13:25     ` Krzysztof Kozlowski
2022-11-25 20:20 ` [PATCH 2/3] dt-bindings: net: sun8i-emac: " Samuel Holland
2022-11-25 20:20   ` Samuel Holland
2022-11-26 13:26   ` Krzysztof Kozlowski
2022-11-26 13:26     ` Krzysztof Kozlowski
2022-11-26 14:28     ` Andre Przywara
2022-11-26 14:28       ` Andre Przywara
2022-11-26 14:48       ` Krzysztof Kozlowski
2022-11-26 14:48         ` Krzysztof Kozlowski
2022-12-01  3:45         ` Rob Herring
2022-12-01  3:45           ` Rob Herring
2022-12-01 18:10           ` Rob Herring
2022-12-01 18:10             ` Rob Herring
2022-11-26 14:15   ` Krzysztof Kozlowski
2022-11-26 14:15     ` Krzysztof Kozlowski
2022-11-25 20:20 ` [PATCH 3/3] dt-bindings: net: sun8i-emac: Add phy-supply property Samuel Holland
2022-11-25 20:20   ` Samuel Holland
2022-11-26  0:32   ` Andre Przywara
2022-11-26  0:32     ` Andre Przywara
2022-11-26 13:37   ` Krzysztof Kozlowski
2022-11-26 13:37     ` Krzysztof Kozlowski
2022-12-01 21:49   ` Rob Herring
2022-12-01 21:49     ` 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.