diff options
author | David S. Miller <davem@davemloft.net> | 2018-09-20 06:06:46 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-20 06:06:46 +0200 |
commit | f46f33a6790c35f71ee95d47aef5fbc7590d7218 (patch) | |
tree | c92c9238c4f860eb6b7d2e44ee44023f47255222 | |
parent | Merge branch 'net-Use-FIELD_SIZEOF-directly-instead-of-reimplementing-its-fun... (diff) | |
parent | net: phy: call state machine synchronously in phy_stop (diff) | |
download | linux-f46f33a6790c35f71ee95d47aef5fbc7590d7218.tar.xz linux-f46f33a6790c35f71ee95d47aef5fbc7590d7218.zip |
Merge branch 'phy_stop-synchronous'
Heiner Kallweit says:
====================
net: phy: make phy_stop() synchronous
There have been few not that successful attempts in the past to make
phy_stop() a synchronous call instead of just changing the state.
Patch 1 of this series addresses an issue which prevented this change.
At least for me it works fine now. Would appreciate if Geert could
re-test as well that suspend doesn't throw an error.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/phy.c | 2 | ||||
-rw-r--r-- | net/core/link_watch.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 1ee25877c4d1..a5e0f0721035 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -861,6 +861,8 @@ void phy_stop(struct phy_device *phydev) out_unlock: mutex_unlock(&phydev->lock); + phy_state_machine(&phydev->state_queue.work); + /* Cannot call flush_scheduled_work() here as desired because * of rtnl_lock(), but PHY_HALTED shall guarantee phy_change() * will not reenable interrupts. diff --git a/net/core/link_watch.c b/net/core/link_watch.c index e38e641e98d5..7f51efb2b3ab 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c @@ -155,7 +155,7 @@ static void linkwatch_do_dev(struct net_device *dev) clear_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state); rfc2863_policy(dev); - if (dev->flags & IFF_UP) { + if (dev->flags & IFF_UP && netif_device_present(dev)) { if (netif_carrier_ok(dev)) dev_activate(dev); else |