diff options
-rw-r--r-- | drivers/net/phy/phy_device.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index b9192ae92e40..f794ff3a10c2 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -1815,13 +1815,25 @@ EXPORT_SYMBOL(genphy_read_status); | |||
1815 | */ | 1815 | */ |
1816 | int genphy_soft_reset(struct phy_device *phydev) | 1816 | int genphy_soft_reset(struct phy_device *phydev) |
1817 | { | 1817 | { |
1818 | u16 res = BMCR_RESET; | ||
1818 | int ret; | 1819 | int ret; |
1819 | 1820 | ||
1820 | ret = phy_set_bits(phydev, MII_BMCR, BMCR_RESET); | 1821 | if (phydev->autoneg == AUTONEG_ENABLE) |
1822 | res |= BMCR_ANRESTART; | ||
1823 | |||
1824 | ret = phy_modify(phydev, MII_BMCR, BMCR_ISOLATE, res); | ||
1821 | if (ret < 0) | 1825 | if (ret < 0) |
1822 | return ret; | 1826 | return ret; |
1823 | 1827 | ||
1824 | return phy_poll_reset(phydev); | 1828 | ret = phy_poll_reset(phydev); |
1829 | if (ret) | ||
1830 | return ret; | ||
1831 | |||
1832 | /* BMCR may be reset to defaults */ | ||
1833 | if (phydev->autoneg == AUTONEG_DISABLE) | ||
1834 | ret = genphy_setup_forced(phydev); | ||
1835 | |||
1836 | return ret; | ||
1825 | } | 1837 | } |
1826 | EXPORT_SYMBOL(genphy_soft_reset); | 1838 | EXPORT_SYMBOL(genphy_soft_reset); |
1827 | 1839 | ||