| From 3ce525d17e74d5b288b039382f39234d19c47189 Mon Sep 17 00:00:00 2001 |
| From: Florian Fainelli <f.fainelli@gmail.com> |
| Date: Fri, 6 Dec 2013 13:01:38 -0800 |
| Subject: net: sh_eth: do not issue a wild PHY reset through BMCR |
| |
| The sh_eth driver issues an uncontrolled PHY reset through the MII |
| register BMCR but fails to wait for the reset to complete, and will also |
| implicitely wipe out all possible PHY fixups applied. Use phy_init_hw() |
| which remedies both problems. |
| |
| Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> |
| Signed-off-by: David S. Miller <davem@davemloft.net> |
| (cherry picked from commit 0c9eb5b931c3da3a79faa889b903dc7bd318203c) |
| (Queued by David Miller for v3.14 but not yet in Linus's tree) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| drivers/net/ethernet/renesas/sh_eth.c | 5 ++++- |
| 1 file changed, 4 insertions(+), 1 deletion(-) |
| |
| diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c |
| index 8bced1c44378..be9b6ab11c94 100644 |
| --- a/drivers/net/ethernet/renesas/sh_eth.c |
| +++ b/drivers/net/ethernet/renesas/sh_eth.c |
| @@ -1704,7 +1704,10 @@ static int sh_eth_phy_start(struct net_device *ndev) |
| return ret; |
| |
| /* reset phy - this also wakes it from PDOWN */ |
| - phy_write(mdp->phydev, MII_BMCR, BMCR_RESET); |
| + ret = phy_init_hw(mdp->phydev); |
| + if (ret) |
| + return ret; |
| + |
| phy_start(mdp->phydev); |
| |
| return 0; |
| -- |
| 1.8.5.rc3 |
| |