Skip to contentSkip to conversation

net: phy: atheros: Fix problem with phy_reset() clearing BMCR

PATCH In review Alison Wang 5 participants 5 messages Feb 19, 2016 – Feb 26, 2016

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

PATCH 1/1 net: phy: atheros: Fix problem with phy_reset() clearing BMCR

In commit <a058052c358c> [net: phy: do not read configuration register on reset], phy_reset() will clear the BMCR register. Bit 12(AUTO_NEGOTIATION) is cleared too. It causes auto-negotiation timeout error on Atheros's PHY AR8033.

To fix this problem, genphy_config_aneg() and genphy_restart_aneg() needs to be called in ar8035_config() to enable and restart auto-negotiation.

---
 drivers/net/phy/atheros.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/atheros.c +3 -0
index ba57b1a..e57c412 100644
@@ -33,6 +33,9 @@ static int ar8035_config(struct phy_device *phydev)
 
 	phydev->supported = phydev->drv->features;
 
+	genphy_config_aneg(phydev);
+	genphy_restart_aneg(phydev);
+
 	return 0;
 }
 
Signature · 1 line
2.1.0.27.g96db324
#1 lore raw

PATCH 1/1 net: phy: atheros: Fix problem with phy_reset() clearing BMCR

Quoted 8 lines · Alison Wang

In commit <a058052c358c> [net: phy: do not read configuration register on reset], phy_reset() will clear the BMCR register. Bit 12(AUTO_NEGOTIATION) is cleared too. It causes auto-negotiation timeout error on Atheros's PHY AR8033.

To fix this problem, genphy_config_aneg() and genphy_restart_aneg() needs to be called in ar8035_config() to enable and restart auto-negotiation.

It is always a good idea to put the author of the offending patch on Cc.

Added Stefan.

Quoted 27 lines
---
 drivers/net/phy/atheros.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/atheros.c +3 -1
index ba57b1a..e57c412 100644
@@ -33,6 +33,9 @@ static int ar8035_config(struct phy_device *phydev)
 
        phydev->supported = phydev->drv->features;
 
+       genphy_config_aneg(phydev);
+       genphy_restart_aneg(phydev);
+
        return 0;
 }
 
--

2.1.0.27.g96db324

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#2 lore raw

PATCH 1/1 net: phy: atheros: Fix problem with phy_reset() clearing BMCR

Quoted 6 lines · Fabio Estevam
Quoted 5 lines · Alison Wang

In commit <a058052c358c> [net: phy: do not read configuration register on reset], phy_reset() will clear the BMCR register. Bit 12(AUTO_NEGOTIATION) is cleared too. It causes auto-negotiation timeout error on Atheros's PHY AR8033.

Quoted 8 lines
Quoted 3 lines

To fix this problem, genphy_config_aneg() and genphy_restart_aneg() needs to be called in ar8035_config() to enable and restart auto-negotiation.

It is always a good idea to put the author of the offending patch on Cc.

Added Stefan.

Thanks.

Hm, even more fallout from my change, sorry about that.

I guess explicitly reconfigure and restart autonegotiation makes sense.

--
Stefan

Quoted 27 lines
Quoted 27 lines
---
 drivers/net/phy/atheros.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/atheros.c +3 -1
index ba57b1a..e57c412 100644
@@ -33,6 +33,9 @@ static int ar8035_config(struct phy_device *phydev)
 
        phydev->supported = phydev->drv->features;
 
+       genphy_config_aneg(phydev);
+       genphy_restart_aneg(phydev);
+
        return 0;
 }
 
--

2.1.0.27.g96db324

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#3 lore raw

PATCH 1/1 net: phy: atheros: Fix problem with phy_reset() clearing BMCR

In reply to Alison Wang
Quoted 10 lines · Alison Wang

In commit <a058052c358c> [net: phy: do not read configuration register on reset], phy_reset() will clear the BMCR register. Bit 12(AUTO_NEGOTIATION) is cleared too. It causes auto-negotiation timeout error on Atheros's PHY AR8033.

To fix this problem, genphy_config_aneg() and genphy_restart_aneg() needs to be called in ar8035_config() to enable and restart auto-negotiation.