Commit fc0f7e33 authored by Manfred Schlaegl's avatar Manfred Schlaegl Committed by David S. Miller

net: phy: smsc: reintroduced unconditional soft reset

We detected some problems using the smsc lan8720a in combination with
i.MX28 and tracked this down to commit 21009686 ("net: phy: smsc: move
smsc_phy_config_init reset part in a soft_reset function")
With 21009686 the generic soft reset is replaced by a specific function
which handles power down state correctly. But additionally the soft reset
itself got conditional and is therefore also only performed if the phy is
in power down state.

This patch keeps the conditional wake up from power down, but
re-introduces the unconditional soft reset using the generic soft reset
function.
It was tested on linux-4.1.25 and linux-4.7.0-rc2.
Signed-off-by: default avatarManfred Schlaegl <manfred.schlaegl@ginzinger.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 698ea54d
...@@ -75,22 +75,13 @@ static int smsc_phy_reset(struct phy_device *phydev) ...@@ -75,22 +75,13 @@ static int smsc_phy_reset(struct phy_device *phydev)
* in all capable mode before using it. * in all capable mode before using it.
*/ */
if ((rc & MII_LAN83C185_MODE_MASK) == MII_LAN83C185_MODE_POWERDOWN) { if ((rc & MII_LAN83C185_MODE_MASK) == MII_LAN83C185_MODE_POWERDOWN) {
int timeout = 50000; /* set "all capable" mode */
/* set "all capable" mode and reset the phy */
rc |= MII_LAN83C185_MODE_ALL; rc |= MII_LAN83C185_MODE_ALL;
phy_write(phydev, MII_LAN83C185_SPECIAL_MODES, rc); phy_write(phydev, MII_LAN83C185_SPECIAL_MODES, rc);
phy_write(phydev, MII_BMCR, BMCR_RESET);
/* wait end of reset (max 500 ms) */
do {
udelay(10);
if (timeout-- == 0)
return -1;
rc = phy_read(phydev, MII_BMCR);
} while (rc & BMCR_RESET);
} }
return 0;
/* reset the phy */
return genphy_soft_reset(phydev);
} }
static int lan911x_config_init(struct phy_device *phydev) static int lan911x_config_init(struct phy_device *phydev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment