summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-16 11:57:53 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-16 11:57:53 +0100
commita47b66da0380dd1ebcf2fbfa5fc41c4b6af8a460 (patch)
tree3e1e18183f2041d534a1a763af95df1ec460e044 /drivers/net/phy/phy.c
parent1129d270cbfbb7e2b1ec3dede4a13930bdd10e41 (diff)
parent49def1853334396f948dcb4cedb9347abb318df5 (diff)
Merge 4.10-rc4 into usb-next
We need the USB fixes in here to make merges easier/possible with the other sub-maintainer USB trees. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 25f93a98863b..48da6e93c3f7 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1065,6 +1065,15 @@ void phy_state_machine(struct work_struct *work)
if (old_link != phydev->link)
phydev->state = PHY_CHANGELINK;
}
+ /*
+ * Failsafe: check that nobody set phydev->link=0 between two
+ * poll cycles, otherwise we won't leave RUNNING state as long
+ * as link remains down.
+ */
+ if (!phydev->link && phydev->state == PHY_RUNNING) {
+ phydev->state = PHY_CHANGELINK;
+ phydev_err(phydev, "no link in PHY_RUNNING\n");
+ }
break;
case PHY_CHANGELINK:
err = phy_read_status(phydev);