Skip to contentSkip to conversation

net: phy: Set ANRESTART in setup_forced

PATCH In review amessier.tyco at gmail.com 3 participants 3 messages Jan 22, 2016 – Jan 29, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: Set ANRESTART in setup_forced

From: Alexandre Messier <[email protected]>

When configuring a PHY in fixed (forced) link mode, in order for the changes to be applied, either one of these conditions must be triggered:
1- PHY is reset
2- Autoneg is restarted
3- PHY transitions from power-down to power-up

Neither of these is currently done, so effectively the fixed link configuration is not applied in the PHY.

Fix this by setting the Autoneg restart bit.

---
 drivers/net/phy/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/phy.c +1 -1
index a6023f1..1d8eed5 100644
@@ -116,7 +116,7 @@ static int genphy_config_advert(struct phy_device *phydev)
 static int genphy_setup_forced(struct phy_device *phydev)
 {
 	int err;
-	int ctl = 0;
+	int ctl = BMCR_ANRESTART;
 
 	phydev->pause = phydev->asym_pause = 0;
 
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 net: phy: Set ANRESTART in setup_forced

Quoted 9 lines · On Fri, Jan 22, 2016 at 1:16 PM, <[email protected]> wrote:

From: Alexandre Messier <[email protected]>

When configuring a PHY in fixed (forced) link mode, in order for the changes to be applied, either one of these conditions must be triggered:
1- PHY is reset
2- Autoneg is restarted
3- PHY transitions from power-down to power-up

Quoted 6 lines

Neither of these is currently done, so effectively the fixed link configuration is not applied in the PHY.

Fix this by setting the Autoneg restart bit.