Skip to content

Commit

Permalink
Merge branch 'net-phy-disable-aneg-in-genphy_c45_pma_setup_forced'
Browse files Browse the repository at this point in the history
Heiner Kallweit says:

====================
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
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Feb 21, 2019
2 parents 8e4c076 + 30de65c commit 3468ea4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 2 additions & 7 deletions drivers/net/phy/marvell10g.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,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);

ret = genphy_c45_an_config_aneg(phydev);
if (ret < 0)
Expand Down
6 changes: 5 additions & 1 deletion drivers/net/phy/phy-c45.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 3468ea4

Please sign in to comment.