diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-12-26 12:36:30 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-12-26 12:36:30 +0000 |
commit | d0974324b0cd4166afa7b9b8f78b82179563fd70 (patch) | |
tree | bff8fe43896113180709e9aabb18a7e94bbfa45f /target/linux/generic/patches-3.14/073-net-phy-resume-phydev-when-going-to-RESUMING.patch | |
parent | 11e487b22e4fee20fa2cafc48b82af6971fcabb5 (diff) | |
download | upstream-d0974324b0cd4166afa7b9b8f78b82179563fd70.tar.gz upstream-d0974324b0cd4166afa7b9b8f78b82179563fd70.tar.bz2 upstream-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/073-net-phy-resume-phydev-when-going-to-RESUMING.patch')
-rw-r--r-- | target/linux/generic/patches-3.14/073-net-phy-resume-phydev-when-going-to-RESUMING.patch | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/target/linux/generic/patches-3.14/073-net-phy-resume-phydev-when-going-to-RESUMING.patch b/target/linux/generic/patches-3.14/073-net-phy-resume-phydev-when-going-to-RESUMING.patch new file mode 100644 index 0000000000..bbe09f2b5d --- /dev/null +++ b/target/linux/generic/patches-3.14/073-net-phy-resume-phydev-when-going-to-RESUMING.patch @@ -0,0 +1,68 @@ +--- a/drivers/net/phy/phy.c ++++ b/drivers/net/phy/phy.c +@@ -690,7 +690,7 @@ void phy_state_machine(struct work_struc + struct delayed_work *dwork = to_delayed_work(work); + struct phy_device *phydev = + container_of(dwork, struct phy_device, state_queue); +- int needs_aneg = 0, do_suspend = 0; ++ bool needs_aneg = false, do_suspend = false, do_resume = false; + int err = 0; + + mutex_lock(&phydev->lock); +@@ -702,7 +702,7 @@ void phy_state_machine(struct work_struc + case PHY_PENDING: + break; + case PHY_UP: +- needs_aneg = 1; ++ needs_aneg = true; + + phydev->link_timeout = PHY_AN_TIMEOUT; + +@@ -732,7 +732,7 @@ void phy_state_machine(struct work_struc + phydev->adjust_link(phydev->attached_dev); + + } else if (0 == phydev->link_timeout--) { +- needs_aneg = 1; ++ needs_aneg = true; + /* If we have the magic_aneg bit, we try again */ + if (phydev->drv->flags & PHY_HAS_MAGICANEG) + break; +@@ -770,7 +770,7 @@ void phy_state_machine(struct work_struc + netif_carrier_on(phydev->attached_dev); + } else { + if (0 == phydev->link_timeout--) +- needs_aneg = 1; ++ needs_aneg = true; + } + + phydev->adjust_link(phydev->attached_dev); +@@ -806,7 +806,7 @@ void phy_state_machine(struct work_struc + phydev->link = 0; + netif_carrier_off(phydev->attached_dev); + phydev->adjust_link(phydev->attached_dev); +- do_suspend = 1; ++ do_suspend = true; + } + break; + case PHY_RESUMING: +@@ -855,6 +855,7 @@ void phy_state_machine(struct work_struc + } + phydev->adjust_link(phydev->attached_dev); + } ++ do_resume = true; + break; + } + +@@ -862,9 +863,10 @@ void phy_state_machine(struct work_struc + + if (needs_aneg) + err = phy_start_aneg(phydev); +- +- if (do_suspend) ++ else if (do_suspend) + phy_suspend(phydev); ++ else if (do_resume) ++ phy_resume(phydev); + + if (err < 0) + phy_error(phydev); |