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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 10 Sep 2020 17:22:10 +0530
From:   Vikas Singh <vikas.singh@...esoftware.com>
To:     madalin.bucur@....nxp.com, linux@...linux.org.uk,
        netdev@...r.kernel.org
Cc:     calvin.johnson@....nxp.com, kuldip.dwivedi@...esoftware.com,
        vikas.singh@....com, Vikas Singh <vikas.singh@...esoftware.com>
Subject: [PATCH] net: ethernet: freescale: Add device "fwnode" while MDIO bus get registered

For DT case, auto-probe of c45 devices with extended scanning in xgmac_mdio
works well but scanning and registration of these devices (PHY's) fails in
case of ACPI mainly because of MDIO bus "fwnode" is not set appropriately.
This patch is based on https://www.spinics.net/lists/netdev/msg662173.html

This change will update the "fwnode" while MDIO bus get registered and allow
lookup for registered PHYs on MDIO bus from other drivers while probing.

Signed-off-by: Vikas Singh <vikas.singh@...esoftware.com>
---
 drivers/net/ethernet/freescale/xgmac_mdio.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
index 98be51d..8217d17 100644
--- a/drivers/net/ethernet/freescale/xgmac_mdio.c
+++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
@@ -268,6 +268,10 @@ static int xgmac_mdio_probe(struct platform_device *pdev)
 	bus->read = xgmac_mdio_read;
 	bus->write = xgmac_mdio_write;
 	bus->parent = &pdev->dev;
+
+	if (!is_of_node(pdev->dev.fwnode))
+		bus->dev.fwnode = bus->parent->fwnode;
+
 	bus->probe_capabilities = MDIOBUS_C22_C45;
 	snprintf(bus->id, MII_BUS_ID_SIZE, "%pa", &res->start);
 
-- 
2.7.4

Powered by blists - more mailing lists