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: <20250522131918.31454-1-yajun.deng@linux.dev>
Date: Thu, 22 May 2025 21:19:18 +0800
From: Yajun Deng <yajun.deng@...ux.dev>
To: andrew@...n.ch,
	hkallweit1@...il.com,
	linux@...linux.org.uk,
	davem@...emloft.net,
	edumazet@...gle.com,
	kuba@...nel.org,
	pabeni@...hat.com
Cc: netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Yajun Deng <yajun.deng@...ux.dev>
Subject: [PATCH net-next] net: phy: Synchronize c45_ids to phy_id

The phy_id_show() function emit the phy_id for the phy device. If the phy
device is a c45 device, the phy_id is empty. In other words, phy_id_show()
only works with the c22 device.

Synchronize c45_ids to phy_id, phy_id_show() will work with both the c22
and c45 devices.

Signed-off-by: Yajun Deng <yajun.deng@...ux.dev>
---
 drivers/net/phy/phy_device.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 2eb735e68dd8..6fed3e84e1a6 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -690,8 +690,12 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id,
 	dev->pma_extable = -ENODATA;
 	dev->is_c45 = is_c45;
 	dev->phy_id = phy_id;
-	if (c45_ids)
+	if (c45_ids) {
 		dev->c45_ids = *c45_ids;
+		dev->phy_id = dev->c45_ids.device_ids[MDIO_MMD_PMAPMD];
+		if (!dev->phy_id)
+			dev->phy_id = dev->c45_ids.device_ids[MDIO_MMD_PCS];
+	}
 	dev->irq = bus->irq[addr];
 
 	dev_set_name(&mdiodev->dev, PHY_ID_FMT, bus->id, addr);
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ