[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240813150615.3866759-1-Frank.Li@nxp.com>
Date: Tue, 13 Aug 2024 11:06:14 -0400
From: Frank Li <Frank.Li@....com>
To: Andrew Lunn <andrew@...n.ch>,
	Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Florian Fainelli <f.fainelli@...il.com>,
	netdev@...r.kernel.org (open list:ETHERNET PHY LIBRARY),
	devicetree@...r.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS),
	linux-kernel@...r.kernel.org (open list)
Cc: imx@...ts.linux.dev
Subject: [PATCH v2 1/1] dt-bindings: net: mdio: change nodename match pattern
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 exist.
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@....com>
---
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(-)
diff --git a/Documentation/devicetree/bindings/net/mdio.yaml b/Documentation/devicetree/bindings/net/mdio.yaml
index a266ade918ca7..2ed787e4fbbf2 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
-- 
2.34.1
Powered by blists - more mailing lists
 
