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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a6a0c244-f8da-4736-bb63-429a508d6993@lunn.ch>
Date: Wed, 17 Jul 2024 20:19:48 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Rayyan Ansari <rayyan.ansari@...aro.org>
Cc: devicetree@...r.kernel.org, linux-arm-msm@...r.kernel.org,
	"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>, Timur Tabi <timur@...nel.org>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dt-bindings: net: qcom,emac: convert to dtschema

On Wed, Jul 17, 2024 at 04:45:55PM +0100, Rayyan Ansari wrote:
> On Wed Jul 17, 2024 at 4:20 PM BST, Andrew Lunn wrote:
> > On Wed, Jul 17, 2024 at 10:09:27AM +0100, Rayyan Ansari wrote:
> > > Convert the bindings for the Qualcomm EMAC Ethernet Controller from the
> > > old text format to yaml.
> > > 
> > > Also move the phy node of the controller to be within an mdio block so
> > > we can use mdio.yaml.
> >
> > Does the MAC driver already support this?
> >
> > When i look at the emacs-phy.c there is
> >
> > 	struct device_node *np = pdev->dev.of_node;
> >
> >                 ret = of_mdiobus_register(mii_bus, np);
> >
> > I don't see anything looking for the mdio node in the tree.
> >
> > 	Andrew
> 
> Hi Andrew,
> 
> Yes, from my understanding an mdio node is not explicitly needed as it
> just uses "phy-handle".
> 
> However, I think it makes more sense to place the phy within an mdio
> node instead of directly under the controller node. This is based off
> of 5ecd39d1bc4b ("dt-bindings: net: convert emac_rockchip.txt to YAML"),
> in which the same decision was made ("Add mdio sub node"), also during a
> text -> yaml conversion.
 
Using an MDIO node is preferred, and is the modern way of doing
it. Placing the PHY directly in the MAC node is valid, but it is the
old way of doing it.

It is up to the driver to decide where it looks for the PHY nodes when
it registers the MDIO bus. The np in of_mdiobus_register(mii_bus, np);
points to the MAC node. So when you move the PHYs into the new MDIO
node, they will not be found when the MDIO bus is probed.

Take a look at:

commit 2c60c4c008d4b05b9b65bf88f784556208029333
Author: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
Date:   Mon Mar 25 16:34:51 2024 +0100

    ravb: Add support for an optional MDIO mode

as an example where support for such an MDIO node was added to a
driver.

    Andrew

---
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ