Message ID | 20240218190034.15447-3-ansuelsmth@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: phy: support multi PHY in phy_driver Was: net: phy: detach PHY driver OPs from phy_driver struct | expand |
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.
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.
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 */
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(+)