diff options
author | David S. Miller <davem@davemloft.net> | 2013-12-09 20:39:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-09 20:39:05 -0500 |
commit | 65be6291c856bee0308c535287f813418402d8b3 (patch) | |
tree | bc291d4587494cd5419e672eaeb3e9682239c608 /drivers/net/ethernet/toshiba/tc35815.c | |
parent | tun: remove useless codes in tun_chr_aio_read() and tun_recvmsg() (diff) | |
parent | net: sh_eth: do not issue a wild PHY reset through BMCR (diff) | |
download | linux-dev-65be6291c856bee0308c535287f813418402d8b3.tar.xz linux-dev-65be6291c856bee0308c535287f813418402d8b3.zip |
Merge branch 'phy_reset'
Florian Fainelli says:
====================
net: phy: consolidate PHY reset
This patchset consolidates the PHY reset through the MII BMCR
register by using a central place were this is done.
This patchset resumes the work Kyle Moffett started here:
https://lkml.org/lkml/2011/10/20/301
Note that at this point, drivers doing funky things after issuing
a PHY reset using phy_init_hw() will still suffer from PHY state
machine problems, this will be taken care of later on.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/toshiba/tc35815.c')
-rw-r--r-- | drivers/net/ethernet/toshiba/tc35815.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/ethernet/toshiba/tc35815.c b/drivers/net/ethernet/toshiba/tc35815.c index 1322546d92ac..f6b3212ec339 100644 --- a/drivers/net/ethernet/toshiba/tc35815.c +++ b/drivers/net/ethernet/toshiba/tc35815.c @@ -1170,19 +1170,12 @@ static int tc35815_tx_full(struct net_device *dev) static void tc35815_restart(struct net_device *dev) { struct tc35815_local *lp = netdev_priv(dev); + int ret; if (lp->phy_dev) { - int timeout; - - phy_write(lp->phy_dev, MII_BMCR, BMCR_RESET); - timeout = 100; - while (--timeout) { - if (!(phy_read(lp->phy_dev, MII_BMCR) & BMCR_RESET)) - break; - udelay(1); - } - if (!timeout) - printk(KERN_ERR "%s: BMCR reset failed.\n", dev->name); + ret = phy_init_hw(lp->phy_dev); + if (ret) + printk(KERN_ERR "%s: PHY init failed.\n", dev->name); } spin_lock_bh(&lp->rx_lock); |