[PATCH net-next v2 1/2] net: phy: phy-c45: Auto-negotiation restart status check for T1 phy

From: Tarun Alle
Date: Mon Dec 16 2024 - 11:05:40 EST


Add support for auto-negotiation restart status check for T1 phys.

Signed-off-by: Tarun Alle <Tarun.Alle@xxxxxxxxxxxxx>
---
v1 -> v2
- Separated out the fix patch.
- Changed the commit message.
---
drivers/net/phy/phy-c45.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 0dac08e85304..58be2d534b5c 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -418,11 +418,14 @@ EXPORT_SYMBOL_GPL(genphy_c45_aneg_done);
int genphy_c45_read_link(struct phy_device *phydev)
{
u32 mmd_mask = MDIO_DEVS_PMAPMD;
+ u16 reg = MDIO_CTRL1;
int val, devad;
bool link = true;

if (phydev->c45_ids.mmds_present & MDIO_DEVS_AN) {
- val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_CTRL1);
+ if (genphy_c45_baset1_able(phydev))
+ reg = MDIO_AN_T1_CTRL;
+ val = phy_read_mmd(phydev, MDIO_MMD_AN, reg);
if (val < 0)
return val;

--
2.34.1