lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZrqkagQ/8o+WvvTt@lizhi-Precision-Tower-5810>
Date: Mon, 12 Aug 2024 20:10:18 -0400
From: Frank Li <Frank.li@....com>
To: Rob Herring <robh@...nel.org>
Cc: 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>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Florian Fainelli <f.fainelli@...il.com>,
	"open list:ETHERNET PHY LIBRARY" <netdev@...r.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" <devicetree@...r.kernel.org>,
	open list <linux-kernel@...r.kernel.org>, imx@...ts.linux.dev
Subject: Re: [PATCH 1/1] dt-bindings: net: mdio: Add negative patten match
 for child node

On Mon, Aug 12, 2024 at 04:36:11PM -0600, Rob Herring wrote:
> On Sun, Aug 11, 2024 at 11:11:14PM -0400, Frank Li wrote:
> > 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 defination.
> >
> > 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@20" match "patternProperties: '@[0-9a-f]+$'" in
> > mdio.yaml.
> >
> > Change to '^(?!mdio@).*@[0-9a-f]+$' to avoid match parent's mdio
> > controller's address.
> >
> > Signed-off-by: Frank Li <Frank.Li@....com>
> > ---
> >  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..a7def3eb4674d 100644
> > --- a/Documentation/devicetree/bindings/net/mdio.yaml
> > +++ b/Documentation/devicetree/bindings/net/mdio.yaml
> > @@ -59,7 +59,7 @@ properties:
> >      type: boolean
> >
> >  patternProperties:
> > -  '@[0-9a-f]+$':
> > +  '^(?!mdio@).*@[0-9a-f]+$':
>
> This is at the wrong spot. The problem is up a level where the $nodename
> matched mdio-mux-emi1@54.
>
> I think what we want for the $nodename pattern is:
>
> '^mdio(-(bus|external))?(@.+|-([0-9]+))$'
>
> There's lots of pinctrl nodes named 'mdio...' we need to avoid and we
> aren't currently.
>
> I'd prefer not to support 'mdio-external', but there's already 1
> documented case. I think the only node name fix we'd need with this is
> 'mdio-gpio' which should be just 'mdio' or 'mdio-N' like all other
> bitbanged implementations.

--- 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]+))$'

You are right. Above patch can work.

Frank

>
> Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ