Skip to contentSkip to conversation

net: phy: disable aneg in genphy_c45_pma_setup_forced

PATCH Applied Heiner Kallweit 3 participants 6 messages Feb 16, 2019 – Feb 21, 2019

Subsystems (4)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

v2 cover net: phy: disable aneg in genphy_c45_pma_setup_forced

When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may still be set, therefore clear it. This is also in line with what genphy_setup_forced() does for Clause 22.

v2:
- fix a typo in patch 1

Heiner Kallweit (2):
net: phy: disable aneg in genphy_c45_pma_setup_forced
net: phy: marvell10g: improve mv3310_config_aneg

 drivers/net/phy/marvell10g.c | 9 ++-------
 drivers/net/phy/phy-c45.c    | 4 ++++
 2 files changed, 6 insertions(+), 7 deletions(-)
Signature · 1 line
2.20.1
author maintainer
#1 lore raw

PATCH v2 1/2 net: phy: disable aneg in genphy_c45_pma_setup_forced

When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may still be set, therefore clear it. This is also in line with what genphy_setup_forced() does for Clause 22.

v2:
- fix typo

---
 drivers/net/phy/phy-c45.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/phy/phy-c45.c +5 -1
index bef126344..98a04d4cd 100644
@@ -70,7 +70,11 @@ int genphy_c45_pma_setup_forced(struct phy_device *phydev)
 	if (ret < 0)
 		return ret;
 
-	return phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
+	ret = phy_write_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_CTRL2, ctrl2);
+	if (ret < 0)
+		return ret;
+
+	return genphy_c45_an_disable_aneg(phydev);
 }
 EXPORT_SYMBOL_GPL(genphy_c45_pma_setup_forced);
 
Signature · 1 line
2.20.1
author maintainer
#3 lore raw

PATCH v2 2/2 net: phy: marvell10g: improve mv3310_config_aneg

In reply to Heiner Kallweit

Now that genphy_c45_pma_setup_forced() makes sure the "aneg enabled" bit is cleared, the call to genphy_c45_an_disable_aneg() isn't needed any longer. And the code pattern is now the same as in genphy_config_aneg().

---
 drivers/net/phy/marvell10g.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/net/phy/marvell10g.c +2 -7
index 496805c0d..4a6ae63ab 100644
@@ -271,13 +271,8 @@ static int mv3310_config_aneg(struct phy_device *phydev)
 	/* We don't support manual MDI control */
 	phydev->mdix_ctrl = ETH_TP_MDI_AUTO;
 
-	if (phydev->autoneg == AUTONEG_DISABLE) {
-		ret = genphy_c45_pma_setup_forced(phydev);
-		if (ret < 0)
-			return ret;
-
-		return genphy_c45_an_disable_aneg(phydev);
-	}
+	if (phydev->autoneg == AUTONEG_DISABLE)
+		return genphy_c45_pma_setup_forced(phydev);
 
 	linkmode_and(phydev->advertising, phydev->advertising,
 		     phydev->supported);
Signature · 1 line
2.20.1
Reviewed-by on v2 2/2
#4 lore raw

Re: [PATCH v2 net-next 2/2] net: phy: marvell10g: improve mv3310_config_aneg

In reply to Heiner Kallweit
Quoted 6 lines · Heiner Kallweit

Now that genphy_c45_pma_setup_forced() makes sure the "aneg enabled" bit is cleared, the call to genphy_c45_an_disable_aneg() isn't needed any longer. And the code pattern is now the same as in genphy_config_aneg().

Signature · 1 line
Florian
maintainer Applied
#5 lore raw
In reply to Heiner Kallweit

From: Heiner Kallweit <[email protected]>
Date: Sat, 16 Feb 2019 20:39:57 +0100

Quoted 6 lines

When genphy_c45_pma_setup_forced() is called the "aneg enabled" bit may still be set, therefore clear it. This is also in line with what genphy_setup_forced() does for Clause 22.

v2:
- fix a typo in patch 1

Applied, thanks Heiner.