aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-3.14/072-net-phy-Check-for-aneg-completion-before-setting-sta.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-12-26 12:36:30 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-12-26 12:36:30 +0000
commitd0974324b0cd4166afa7b9b8f78b82179563fd70 (patch)
treebff8fe43896113180709e9aabb18a7e94bbfa45f /target/linux/generic/patches-3.14/072-net-phy-Check-for-aneg-completion-before-setting-sta.patch
parent11e487b22e4fee20fa2cafc48b82af6971fcabb5 (diff)
downloadmaster-187ad058-d0974324b0cd4166afa7b9b8f78b82179563fd70.tar.gz
master-187ad058-d0974324b0cd4166afa7b9b8f78b82179563fd70.tar.bz2
master-187ad058-d0974324b0cd4166afa7b9b8f78b82179563fd70.zip
kernel: backport a few PHY layer fixes from upstream
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43776 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/patches-3.14/072-net-phy-Check-for-aneg-completion-before-setting-sta.patch')
-rw-r--r--target/linux/generic/patches-3.14/072-net-phy-Check-for-aneg-completion-before-setting-sta.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/target/linux/generic/patches-3.14/072-net-phy-Check-for-aneg-completion-before-setting-sta.patch b/target/linux/generic/patches-3.14/072-net-phy-Check-for-aneg-completion-before-setting-sta.patch
new file mode 100644
index 0000000000..8e25f8c1bb
--- /dev/null
+++ b/target/linux/generic/patches-3.14/072-net-phy-Check-for-aneg-completion-before-setting-sta.patch
@@ -0,0 +1,35 @@
+From: Balakumaran Kannan <kumaran.4353@gmail.com>
+Date: Thu, 24 Apr 2014 08:22:47 +0530
+Subject: [PATCH] net phy: Check for aneg completion before setting state to
+ PHY_RUNNING
+
+phy_state_machine should check whether auto-negotiatin is completed
+before changing phydev->state from PHY_NOLINK to PHY_RUNNING. If
+auto-negotiation is not completed phydev->state should be set to
+PHY_AN.
+
+Signed-off-by: Balakumaran Kannan <kumaran.4353@gmail.com>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+
+--- a/drivers/net/phy/phy.c
++++ b/drivers/net/phy/phy.c
+@@ -744,6 +744,17 @@ void phy_state_machine(struct work_struc
+ break;
+
+ if (phydev->link) {
++ if (AUTONEG_ENABLE == phydev->autoneg) {
++ err = phy_aneg_done(phydev);
++ if (err < 0)
++ break;
++
++ if (!err) {
++ phydev->state = PHY_AN;
++ phydev->link_timeout = PHY_AN_TIMEOUT;
++ break;
++ }
++ }
+ phydev->state = PHY_RUNNING;
+ netif_carrier_on(phydev->attached_dev);
+ phydev->adjust_link(phydev->attached_dev);