aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/phy/smsc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-09-28 10:09:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-09-28 10:09:33 -0700
commit6672d90fe779dc0dfffe027c3ede12609df091c2 (patch)
tree84e6984204030bf15685a5c26155f5731aaab244 /drivers/net/phy/smsc.c
parent7596824e6626c62557b9eb6411ee74fec68b8ff9 (diff)
parentdf555b665367f9de6c04826acc482096f17c243d (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David S Miller: 1) Netfilter xt_limit module can use uninitialized rules, from Jan Engelhardt. 2) Wei Yongjun has found several more spots where error pointers were treated as NULL/non-NULL and vice versa. 3) bnx2x was converted to pci_io{,un}map() but one remaining plain iounmap() got missed. From Neil Horman. 4) Due to a fence-post type error in initialization of inetpeer entries (which is where we store the ICMP rate limiting information), we can erroneously drop ICMPs if the inetpeer was created right around when jiffies wraps. Fix from Nicolas Dichtel. 5) smsc75xx resume fix from Steve Glendinnig. 6) LAN87xx smsc chips need an explicit hardware init, from Marek Vasut. 7) qlcnic uses msleep() with locks held, fix from Narendra K. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: netdev: octeon: fix return value check in octeon_mgmt_init_phy() inetpeer: fix token initialization qlcnic: Fix scheduling while atomic bug bnx2: Clean up remaining iounmap net: phy: smsc: Implement PHY config_init for LAN87xx smsc75xx: fix resume after device reset netdev: pasemi: fix return value check in pasemi_mac_phy_init() team: fix return value check l2tp: fix return value check netfilter: xt_limit: have r->cost != 0 case work
Diffstat (limited to 'drivers/net/phy/smsc.c')
-rw-r--r--drivers/net/phy/smsc.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index 6d6192316b3..88e3991464e 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)
return smsc_phy_ack_interrupt (phydev);
}
+static int lan87xx_config_init(struct phy_device *phydev)
+{
+ /*
+ * Make sure the EDPWRDOWN bit is NOT set. Setting this bit on
+ * LAN8710/LAN8720 PHY causes the PHY to misbehave, likely due
+ * to a bug on the chip.
+ *
+ * When the system is powered on with the network cable being
+ * disconnected all the way until after ifconfig ethX up is
+ * issued for the LAN port with this PHY, connecting the cable
+ * afterwards does not cause LINK change detection, while the
+ * expected behavior is the Link UP being detected.
+ */
+ int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
+ if (rc < 0)
+ return rc;
+
+ rc &= ~MII_LAN83C185_EDPWRDOWN;
+
+ rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS, rc);
+ if (rc < 0)
+ return rc;
+
+ return smsc_phy_ack_interrupt(phydev);
+}
+
static int lan911x_config_init(struct phy_device *phydev)
{
return smsc_phy_ack_interrupt(phydev);
@@ -162,7 +188,7 @@ static struct phy_driver smsc_phy_driver[] = {
/* basic functions */
.config_aneg = genphy_config_aneg,
.read_status = genphy_read_status,
- .config_init = smsc_phy_config_init,
+ .config_init = lan87xx_config_init,
/* IRQ related */
.ack_interrupt = smsc_phy_ack_interrupt,