[net-next RFC PATCH 2/6] net: phy: fill phy_id with C45 PHY

Christian Marangi posted 6 patches 1 year, 11 months ago
There is a newer version of this series
[net-next RFC PATCH 2/6] net: phy: fill phy_id with C45 PHY
Posted by Christian Marangi 1 year, 11 months ago
With C45 PHYs that provide PHY ID in C45 Package regs, PHY device
.phy_id is not filled.

Correctly fill .phy_id from matching dev_id or phy_driver info.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/net/phy/phy_device.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 9b96357e4de8..60a60f182729 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -3476,6 +3476,10 @@ static int phy_probe(struct device *dev)
 		phy_dev_id->phy_id_mask = phydrv->phy_id_mask;
 	}
 
+	/* Fill PHY ID with dev_id if empty and PHY is C45 */
+	if (!phydev->phy_id && phydev->is_c45)
+		phydev->phy_id = phy_dev_id->phy_id;
+
 	/* Disable the interrupt if the PHY doesn't support it
 	 * but the interrupt is still a valid one
 	 */
-- 
2.43.0
Re: [net-next RFC PATCH 2/6] net: phy: fill phy_id with C45 PHY
Posted by Russell King (Oracle) 1 year, 11 months ago
On Sun, Feb 18, 2024 at 08:00:28PM +0100, Christian Marangi wrote:
> With C45 PHYs that provide PHY ID in C45 Package regs, PHY device
> .phy_id is not filled.

Intentionally so. Clause 45 PHYs don't have a single ID. Marvell
88X3310 is a case in point - there are at least two different vendor
IDs in this PHY.

Trying to squash Clause 45 PHY IDs down to a single identifier is
not sensible.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [net-next RFC PATCH 2/6] net: phy: fill phy_id with C45 PHY
Posted by Christian Marangi 1 year, 11 months ago
On Sun, Feb 18, 2024 at 07:35:30PM +0000, Russell King (Oracle) wrote:
> On Sun, Feb 18, 2024 at 08:00:28PM +0100, Christian Marangi wrote:
> > With C45 PHYs that provide PHY ID in C45 Package regs, PHY device
> > .phy_id is not filled.
> 
> Intentionally so. Clause 45 PHYs don't have a single ID. Marvell
> 88X3310 is a case in point - there are at least two different vendor
> IDs in this PHY.
> 
> Trying to squash Clause 45 PHY IDs down to a single identifier is
> not sensible.
>

As said in the cover letter was something I notice and was curious if it
was intentional or not. Thanks for the clarification, I will drop.

-- 
	Ansuel