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-next>] [day] [month] [year] [list]
Message-Id: <20220420124053.853891-2-kai.heng.feng@canonical.com>
Date:   Wed, 20 Apr 2022 20:40:48 +0800
From:   Kai-Heng Feng <kai.heng.feng@...onical.com>
To:     andrew@...n.ch, hkallweit1@...il.com, linux@...linux.org.uk,
        peppe.cavallaro@...com, alexandre.torgue@...s.st.com,
        joabreu@...opsys.com, davem@...emloft.net, kuba@...nel.org,
        pabeni@...hat.com
Cc:     Kai-Heng Feng <kai.heng.feng@...onical.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/5] net: mdio: Mask PHY only when its ACPI node is present

Not all PHY has an ACPI node, for those nodes auto probing is still
needed.

So only mask those PHYs with ACPI nodes.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
---
 drivers/net/mdio/acpi_mdio.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mdio/acpi_mdio.c b/drivers/net/mdio/acpi_mdio.c
index d77c987fda9cd..f9369319ada19 100644
--- a/drivers/net/mdio/acpi_mdio.c
+++ b/drivers/net/mdio/acpi_mdio.c
@@ -33,8 +33,15 @@ int acpi_mdiobus_register(struct mii_bus *mdio, struct fwnode_handle *fwnode)
 	u32 addr;
 	int ret;
 
-	/* Mask out all PHYs from auto probing. */
-	mdio->phy_mask = GENMASK(31, 0);
+	/* Loop over the child nodes and mask out PHY from auto probing */
+	fwnode_for_each_child_node(fwnode, child) {
+		ret = acpi_get_local_address(ACPI_HANDLE_FWNODE(child), &addr);
+		if (ret || addr >= PHY_MAX_ADDR)
+			continue;
+
+		mdio->phy_mask |= BIT(addr);
+	}
+
 	ret = mdiobus_register(mdio);
 	if (ret)
 		return ret;
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ