aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2018-09-18 21:56:32 +0200
committerDavid S. Miller <davem@davemloft.net>2018-09-19 21:06:46 -0700
commite8cfd9d6c7727a067b38dbe7655ca02377fdb301 (patch)
treec92c9238c4f860eb6b7d2e44ee44023f47255222 /drivers/net/phy/phy.c
parentnet: linkwatch: add check for netdevice being present to linkwatch_do_dev (diff)
downloadlinux-dev-e8cfd9d6c7727a067b38dbe7655ca02377fdb301.tar.xz
linux-dev-e8cfd9d6c7727a067b38dbe7655ca02377fdb301.zip
net: phy: call state machine synchronously in phy_stop
phy_stop() may be called e.g. when suspending, therefore all needed actions should be performed synchronously. Therefore add a synchronous call to the state machine. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c2
1 files changed, 2 insertions, 0 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.