diff options
| -rw-r--r-- | drivers/net/phy/smsc.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index 6d6192316b30..88e3991464e7 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c | |||
| @@ -56,6 +56,32 @@ static int smsc_phy_config_init(struct phy_device *phydev) | |||
| 56 | return smsc_phy_ack_interrupt (phydev); | 56 | return smsc_phy_ack_interrupt (phydev); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | static int lan87xx_config_init(struct phy_device *phydev) | ||
| 60 | { | ||
| 61 | /* | ||
| 62 | * Make sure the EDPWRDOWN bit is NOT set. Setting this bit on | ||
| 63 | * LAN8710/LAN8720 PHY causes the PHY to misbehave, likely due | ||
| 64 | * to a bug on the chip. | ||
| 65 | * | ||
| 66 | * When the system is powered on with the network cable being | ||
| 67 | * disconnected all the way until after ifconfig ethX up is | ||
| 68 | * issued for the LAN port with this PHY, connecting the cable | ||
| 69 | * afterwards does not cause LINK change detection, while the | ||
| 70 | * expected behavior is the Link UP being detected. | ||
| 71 | */ | ||
| 72 | int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); | ||
| 73 | if (rc < 0) | ||
| 74 | return rc; | ||
| 75 | |||
| 76 | rc &= ~MII_LAN83C185_EDPWRDOWN; | ||
| 77 | |||
| 78 | rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS, rc); | ||
| 79 | if (rc < 0) | ||
| 80 | return rc; | ||
| 81 | |||
| 82 | return smsc_phy_ack_interrupt(phydev); | ||
| 83 | } | ||
| 84 | |||
| 59 | static int lan911x_config_init(struct phy_device *phydev) | 85 | static int lan911x_config_init(struct phy_device *phydev) |
| 60 | { | 86 | { |
| 61 | return smsc_phy_ack_interrupt(phydev); | 87 | return smsc_phy_ack_interrupt(phydev); |
| @@ -162,7 +188,7 @@ static struct phy_driver smsc_phy_driver[] = { | |||
| 162 | /* basic functions */ | 188 | /* basic functions */ |
| 163 | .config_aneg = genphy_config_aneg, | 189 | .config_aneg = genphy_config_aneg, |
| 164 | .read_status = genphy_read_status, | 190 | .read_status = genphy_read_status, |
| 165 | .config_init = smsc_phy_config_init, | 191 | .config_init = lan87xx_config_init, |
| 166 | 192 | ||
| 167 | /* IRQ related */ | 193 | /* IRQ related */ |
| 168 | .ack_interrupt = smsc_phy_ack_interrupt, | 194 | .ack_interrupt = smsc_phy_ack_interrupt, |
