net: phy: atheros: Fix problem with phy_reset() clearing BMCR
authorAlison Wang <b18965@freescale.com>
Fri, 19 Feb 2016 07:52:28 +0000 (15:52 +0800)
committerJoe Hershberger <joe.hershberger@ni.com>
Fri, 26 Feb 2016 19:32:37 +0000 (13:32 -0600)
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.

Signed-off-by: Alison Wang <alison.wang@nxp.com>
Acked-by: Stefan Agner <stefan@agner.ch>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/phy/atheros.c

index ba57b1a4b935542d5ce908358eeb86ed4fe39a21..e57c4120a3e5b4a55f2b53e110bac70a857a39b8 100644 (file)
@@ -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;
 }