netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net PATCH 0/2] Orion MDIO DT binding fixes
@ 2022-12-27  1:05 Michał Grzelak
  2022-12-27  1:05 ` [net PATCH 1/2] dt-bindings: net: marvell,orion-mdio: Fix error Michał Grzelak
  2022-12-27  1:05 ` [net PATCH 2/2] dt-bindings: net: marvell,orion-mdio: Fix examples Michał Grzelak
  0 siblings, 2 replies; 7+ messages in thread
From: Michał Grzelak @ 2022-12-27  1:05 UTC (permalink / raw)
  To: devicetree
  Cc: davem, edumazet, kuba, pabeni, robh+dt, krzysztof.kozlowski+dt,
	andrew, chris.packham, netdev, upstream, linux-kernel,
	Michał Grzelak

Hi all,

This patchset fixes two small bugs in orion-mdio 
binding. I would be thankful for your review.

Best regards,
Michał Grzelak

Michał Grzelak (2):
  dt-bindings: net: marvell,orion-mdio: Fix error
  dt-bindings: net: marvell,orion-mdio: Fix examples

 .../bindings/net/marvell,orion-mdio.yaml         | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

-- 
2.34.1


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

* [net PATCH 1/2] dt-bindings: net: marvell,orion-mdio: Fix error
  2022-12-27  1:05 [net PATCH 0/2] Orion MDIO DT binding fixes Michał Grzelak
@ 2022-12-27  1:05 ` Michał Grzelak
  2022-12-27  8:06   ` Krzysztof Kozlowski
  2022-12-27  1:05 ` [net PATCH 2/2] dt-bindings: net: marvell,orion-mdio: Fix examples Michał Grzelak
  1 sibling, 1 reply; 7+ messages in thread
From: Michał Grzelak @ 2022-12-27  1:05 UTC (permalink / raw)
  To: devicetree
  Cc: davem, edumazet, kuba, pabeni, robh+dt, krzysztof.kozlowski+dt,
	andrew, chris.packham, netdev, upstream, linux-kernel,
	Michał Grzelak

Fix 'unevaluated properties error' during 'make dtbs_check' appearing on
arm device trees by defining generic 'ethernet-phy' subnode in
marvell,orion-mdio.yaml.

Fixes: 0781434af811f ("dt-bindings: net: orion-mdio: Convert to JSON
schema")
Signed-off-by: Michał Grzelak <mig@semihalf.com>
---
 Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
index d2906b4a0f59..2b2b3f8709fc 100644
--- a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
+++ b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
@@ -35,6 +35,10 @@ properties:
     minItems: 1
     maxItems: 4
 
+patternProperties:
+  '^ethernet-phy':
+    type: object
+
 required:
   - compatible
   - reg
-- 
2.34.1


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

* [net PATCH 2/2] dt-bindings: net: marvell,orion-mdio: Fix examples
  2022-12-27  1:05 [net PATCH 0/2] Orion MDIO DT binding fixes Michał Grzelak
  2022-12-27  1:05 ` [net PATCH 1/2] dt-bindings: net: marvell,orion-mdio: Fix error Michał Grzelak
@ 2022-12-27  1:05 ` Michał Grzelak
  2022-12-27  8:10   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 7+ messages in thread
From: Michał Grzelak @ 2022-12-27  1:05 UTC (permalink / raw)
  To: devicetree
  Cc: davem, edumazet, kuba, pabeni, robh+dt, krzysztof.kozlowski+dt,
	andrew, chris.packham, netdev, upstream, linux-kernel,
	Michał Grzelak

As stated in marvell-orion-mdio.txt deleted in 'commit 0781434af811f
("dt-bindings: net: orion-mdio: Convert to JSON schema")' if
'interrupts' property is present, width of 'reg' should be 0x84.
Otherwise, width of 'reg' should be 0x4. Fix 'examples:' and extend it
by second example from marvell-orion-mdio.txt.

Signed-off-by: Michał Grzelak <mig@semihalf.com>
---
 .../devicetree/bindings/net/marvell,orion-mdio.yaml  | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
index 2b2b3f8709fc..d260794e92c5 100644
--- a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
+++ b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
@@ -47,9 +47,10 @@ unevaluatedProperties: false
 
 examples:
   - |
+    // MDIO binding with interrupt
     mdio@d0072004 {
       compatible = "marvell,orion-mdio";
-      reg = <0xd0072004 0x4>;
+      reg = <0xd0072004 0x84>;
       #address-cells = <1>;
       #size-cells = <0>;
       interrupts = <30>;
@@ -62,3 +63,12 @@ examples:
         reg = <1>;
       };
     };
+
+  - |
+    // MDIO binding without interrupt
+    mdio@d0072004 {
+      compatible = "marvell,orion-mdio";
+      reg = <0xd0072004 0x4>;
+      #address-cells = <1>;
+      #size-cells = <0>;
+    };
-- 
2.34.1


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

* Re: [net PATCH 1/2] dt-bindings: net: marvell,orion-mdio: Fix error
  2022-12-27  1:05 ` [net PATCH 1/2] dt-bindings: net: marvell,orion-mdio: Fix error Michał Grzelak
@ 2022-12-27  8:06   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-27  8:06 UTC (permalink / raw)
  To: Michał Grzelak, devicetree
  Cc: davem, edumazet, kuba, pabeni, robh+dt, krzysztof.kozlowski+dt,
	andrew, chris.packham, netdev, upstream, linux-kernel

On 27/12/2022 02:05, Michał Grzelak wrote:
> Fix 'unevaluated properties error' during 'make dtbs_check' appearing on
> arm device trees by defining generic 'ethernet-phy' subnode in
> marvell,orion-mdio.yaml.

Instead of long test just paste a bit of warning message. Much easier to
read.

> 
> Fixes: 0781434af811f ("dt-bindings: net: orion-mdio: Convert to JSON
> schema")

Don't wrap tags.

> Signed-off-by: Michał Grzelak <mig@semihalf.com>
> ---
>  Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
> index d2906b4a0f59..2b2b3f8709fc 100644
> --- a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
> +++ b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
> @@ -35,6 +35,10 @@ properties:
>      minItems: 1
>      maxItems: 4
>  
> +patternProperties:
> +  '^ethernet-phy':

ethernet-phy@ is already accepted via mdio, so this looks wrong. You
need to rather fix the DTS.


Best regards,
Krzysztof


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

* Re: [net PATCH 2/2] dt-bindings: net: marvell,orion-mdio: Fix examples
  2022-12-27  1:05 ` [net PATCH 2/2] dt-bindings: net: marvell,orion-mdio: Fix examples Michał Grzelak
@ 2022-12-27  8:10   ` Krzysztof Kozlowski
  2022-12-28  1:54     ` [PATCH v2] " Michał Grzelak
  0 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-27  8:10 UTC (permalink / raw)
  To: Michał Grzelak, devicetree
  Cc: davem, edumazet, kuba, pabeni, robh+dt, krzysztof.kozlowski+dt,
	andrew, chris.packham, netdev, upstream, linux-kernel

On 27/12/2022 02:05, Michał Grzelak wrote:
> As stated in marvell-orion-mdio.txt deleted in 'commit 0781434af811f
> ("dt-bindings: net: orion-mdio: Convert to JSON schema")' if

Drop '' quotes.

BTW, read the original binding to find the answer for your first patch.


> 'interrupts' property is present, width of 'reg' should be 0x84.
> Otherwise, width of 'reg' should be 0x4. Fix 'examples:' and extend it
> by second example from marvell-orion-mdio.txt.

The original binding did not say that, unless you mean giving different
examples? Examples are not a binding.

> 
> Signed-off-by: Michał Grzelak <mig@semihalf.com>
> ---
>  .../devicetree/bindings/net/marvell,orion-mdio.yaml  | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
> index 2b2b3f8709fc..d260794e92c5 100644
> --- a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
> +++ b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
> @@ -47,9 +47,10 @@ unevaluatedProperties: false
>  
>  examples:
>    - |
> +    // MDIO binding with interrupt
>      mdio@d0072004 {
>        compatible = "marvell,orion-mdio";
> -      reg = <0xd0072004 0x4>;
> +      reg = <0xd0072004 0x84>;
>        #address-cells = <1>;
>        #size-cells = <0>;
>        interrupts = <30>;
> @@ -62,3 +63,12 @@ examples:
>          reg = <1>;
>        };
>      };
> +
> +  - |
> +    // MDIO binding without interrupt
> +    mdio@d0072004 {
> +      compatible = "marvell,orion-mdio";
> +      reg = <0xd0072004 0x4>;
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +    };

Why? The same compatible, the same nodes. No differences. Missing pieces
is not a big difference justifying new example.

Best regards,
Krzysztof


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

* [PATCH v2] dt-bindings: net: marvell,orion-mdio: Fix examples
  2022-12-27  8:10   ` Krzysztof Kozlowski
@ 2022-12-28  1:54     ` Michał Grzelak
  2022-12-29  8:24       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 7+ messages in thread
From: Michał Grzelak @ 2022-12-28  1:54 UTC (permalink / raw)
  To: krzysztof.kozlowski
  Cc: andrew, chris.packham, davem, devicetree, edumazet,
	krzysztof.kozlowski+dt, kuba, linux-kernel, mig, netdev, pabeni,
	robh+dt, upstream

As stated in marvell-orion-mdio.txt deleted in commit 0781434af811f
("dt-bindings: net: orion-mdio: Convert to JSON schema") if
'interrupts' property is present, width of 'reg' should be 0x84.
Otherwise, width of 'reg' should be 0x4. Fix 'examples:' and add
constraints checking whether 'interrupts' property is present
and validate it against fixed values in reg.

Signed-off-by: Michał Grzelak <mig@semihalf.com>
---
Changelog:
v1->v2:
- remove second example
- add 'if:' constraint to 'allOf:'
- move 'allOf:' before 'examples:'

 .../bindings/net/marvell,orion-mdio.yaml      | 31 ++++++++++++++++---
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
index d2906b4a0f59..381cd8edebed 100644
--- a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
+++ b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
@@ -16,9 +16,6 @@ description: |
   8k has a second unit which provides an interface with the xMDIO bus. This
   driver handles these interfaces.
 
-allOf:
-  - $ref: "mdio.yaml#"
-
 properties:
   compatible:
     enum:
@@ -39,13 +36,39 @@ required:
   - compatible
   - reg
 
+allOf:
+
+  - $ref: "mdio.yaml#"
+
+  - if:
+      required:
+        - interrupts
+
+    then:
+      properties:
+        reg:
+          items:
+            - items:
+                - $ref: /schemas/types.yaml#/definitions/cell
+                - const: 0x84
+
+    else:
+      properties:
+        reg:
+          items:
+            - items:
+                - $ref: /schemas/types.yaml#/definitions/cell
+                - enum:
+                    - 0x4
+                    - 0x10
+
 unevaluatedProperties: false
 
 examples:
   - |
     mdio@d0072004 {
       compatible = "marvell,orion-mdio";
-      reg = <0xd0072004 0x4>;
+      reg = <0xd0072004 0x84>;
       #address-cells = <1>;
       #size-cells = <0>;
       interrupts = <30>;
-- 
2.34.1


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

* Re: [PATCH v2] dt-bindings: net: marvell,orion-mdio: Fix examples
  2022-12-28  1:54     ` [PATCH v2] " Michał Grzelak
@ 2022-12-29  8:24       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-12-29  8:24 UTC (permalink / raw)
  To: Michał Grzelak
  Cc: andrew, chris.packham, davem, devicetree, edumazet,
	krzysztof.kozlowski+dt, kuba, linux-kernel, netdev, pabeni,
	robh+dt, upstream

On 28/12/2022 02:54, Michał Grzelak wrote:
> As stated in marvell-orion-mdio.txt deleted in commit 0781434af811f
> ("dt-bindings: net: orion-mdio: Convert to JSON schema") if
> 'interrupts' property is present, width of 'reg' should be 0x84.
> Otherwise, width of 'reg' should be 0x4. Fix 'examples:' and add
> constraints checking whether 'interrupts' property is present
> and validate it against fixed values in reg.
> 
> Signed-off-by: Michał Grzelak <mig@semihalf.com>
> ---
> Changelog:
> v1->v2:
> - remove second example
> - add 'if:' constraint to 'allOf:'
> - move 'allOf:' before 'examples:'
> 
>  .../bindings/net/marvell,orion-mdio.yaml      | 31 ++++++++++++++++---
>  1 file changed, 27 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
> index d2906b4a0f59..381cd8edebed 100644
> --- a/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
> +++ b/Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
> @@ -16,9 +16,6 @@ description: |
>    8k has a second unit which provides an interface with the xMDIO bus. This
>    driver handles these interfaces.
>  
> -allOf:
> -  - $ref: "mdio.yaml#"
> -
>  properties:
>    compatible:
>      enum:
> @@ -39,13 +36,39 @@ required:
>    - compatible
>    - reg
>  
> +allOf:
> +

Drop blank line.

> +  - $ref: "mdio.yaml#"

Drop quotes while moving it.

> +
> +  - if:
> +      required:
> +        - interrupts
> +
> +    then:
> +      properties:
> +        reg:
> +          items:
> +            - items:
> +                - $ref: /schemas/types.yaml#/definitions/cell
> +                - const: 0x84
> +
> +    else:
> +      properties:
> +        reg:
> +          items:
> +            - items:
> +                - $ref: /schemas/types.yaml#/definitions/cell
> +                - enum:
> +                    - 0x4
> +                    - 0x10

Rest looks good.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

end of thread, other threads:[~2022-12-29  8:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-27  1:05 [net PATCH 0/2] Orion MDIO DT binding fixes Michał Grzelak
2022-12-27  1:05 ` [net PATCH 1/2] dt-bindings: net: marvell,orion-mdio: Fix error Michał Grzelak
2022-12-27  8:06   ` Krzysztof Kozlowski
2022-12-27  1:05 ` [net PATCH 2/2] dt-bindings: net: marvell,orion-mdio: Fix examples Michał Grzelak
2022-12-27  8:10   ` Krzysztof Kozlowski
2022-12-28  1:54     ` [PATCH v2] " Michał Grzelak
2022-12-29  8:24       ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).