diff mbox series

[v4,1/1] dt-bindings: net: mdio: change nodename match pattern

Message ID 20240815163408.4184705-1-Frank.Li@nxp.com (mailing list archive)
State Accepted
Commit 02404bdb811dbea6ab523675ec98d9f815cfb3b2
Delegated to: Netdev Maintainers
Headers show
Series [v4,1/1] dt-bindings: net: mdio: change nodename match pattern | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Frank Li Aug. 15, 2024, 4:34 p.m. UTC
Change mdio.yaml nodename match pattern to
	'^mdio(-(bus|external))?(@.+|-([0-9]+))$'

Fix mdio.yaml wrong parser mdio controller's address instead phy's address
when mdio-mux exista.

For example:
mdio-mux-emi1@54 {
	compatible = "mdio-mux-mmioreg", "mdio-mux";

        mdio@20 {
		reg = <0x20>;
		       ^^^ This is mdio controller register

		ethernet-phy@2 {
			reg = <0x2>;
                              ^^^ This phy's address
		};
	};
};

Only phy's address is limited to 31 because MDIO bus definition.

But CHECK_DTBS report below warning:

arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dtb: mdio-mux-emi1@54:
	mdio@20:reg:0:0: 32 is greater than the maximum of 31

The reason is that "mdio-mux-emi1@54" match "nodename: '^mdio(@.*)?'" in
mdio.yaml.

Change to '^mdio(-(bus|external))?(@.+|-([0-9]+))?$' to avoid wrong match
mdio mux controller's node.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Change from v3 to v4
- add ? in end of pattern to allow mdio{}. not touch mdio-gpio.yaml.

Change from v2 to v3
- update mdio-gpio.yaml node name mdio to mdio-0 to fix dt_binding_check
error foud by rob's bot.

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mdio-gpio.example.dtb: mdio: $nodename:0: 'mdio' does not match '^mdio(-(bus|external))?(@.+|-([0-9]+))$'
	from schema $id: http://devicetree.org/schemas/net/mdio-gpio.yaml#

Change from v1 to v2
- use rob's suggest to fix node name pattern.
---
 Documentation/devicetree/bindings/net/mdio.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rob Herring Aug. 16, 2024, 8:58 p.m. UTC | #1
On Thu, 15 Aug 2024 12:34:07 -0400, Frank Li wrote:
> Change mdio.yaml nodename match pattern to
> 	'^mdio(-(bus|external))?(@.+|-([0-9]+))$'
> 
> Fix mdio.yaml wrong parser mdio controller's address instead phy's address
> when mdio-mux exista.
> 
> For example:
> mdio-mux-emi1@54 {
> 	compatible = "mdio-mux-mmioreg", "mdio-mux";
> 
>         mdio@20 {
> 		reg = <0x20>;
> 		       ^^^ This is mdio controller register
> 
> 		ethernet-phy@2 {
> 			reg = <0x2>;
>                               ^^^ This phy's address
> 		};
> 	};
> };
> 
> Only phy's address is limited to 31 because MDIO bus definition.
> 
> But CHECK_DTBS report below warning:
> 
> arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dtb: mdio-mux-emi1@54:
> 	mdio@20:reg:0:0: 32 is greater than the maximum of 31
> 
> The reason is that "mdio-mux-emi1@54" match "nodename: '^mdio(@.*)?'" in
> mdio.yaml.
> 
> Change to '^mdio(-(bus|external))?(@.+|-([0-9]+))?$' to avoid wrong match
> mdio mux controller's node.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> Change from v3 to v4
> - add ? in end of pattern to allow mdio{}. not touch mdio-gpio.yaml.
> 
> Change from v2 to v3
> - update mdio-gpio.yaml node name mdio to mdio-0 to fix dt_binding_check
> error foud by rob's bot.
> 
> dtschema/dtc warnings/errors:
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mdio-gpio.example.dtb: mdio: $nodename:0: 'mdio' does not match '^mdio(-(bus|external))?(@.+|-([0-9]+))$'
> 	from schema $id: http://devicetree.org/schemas/net/mdio-gpio.yaml#
> 
> Change from v1 to v2
> - use rob's suggest to fix node name pattern.
> ---
>  Documentation/devicetree/bindings/net/mdio.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
patchwork-bot+netdevbpf@kernel.org Aug. 16, 2024, 9:40 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 15 Aug 2024 12:34:07 -0400 you wrote:
> Change mdio.yaml nodename match pattern to
> 	'^mdio(-(bus|external))?(@.+|-([0-9]+))$'
> 
> Fix mdio.yaml wrong parser mdio controller's address instead phy's address
> when mdio-mux exista.
> 
> For example:
> mdio-mux-emi1@54 {
> 	compatible = "mdio-mux-mmioreg", "mdio-mux";
> 
> [...]

Here is the summary with links:
  - [v4,1/1] dt-bindings: net: mdio: change nodename match pattern
    https://git.kernel.org/netdev/net-next/c/02404bdb811d

You are awesome, thank you!
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/mdio.yaml b/Documentation/devicetree/bindings/net/mdio.yaml
index a266ade918ca7..bed3987a8fbf6 100644
--- a/Documentation/devicetree/bindings/net/mdio.yaml
+++ b/Documentation/devicetree/bindings/net/mdio.yaml
@@ -19,7 +19,7 @@  description:
 
 properties:
   $nodename:
-    pattern: "^mdio(@.*)?"
+    pattern: '^mdio(-(bus|external))?(@.+|-([0-9]+))?$'
 
   "#address-cells":
     const: 1