net: phy: call state machine synchronously in phy_stop
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 18 Sep 2018 19:56:32 +0000 (21:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Sep 2018 04:06:46 +0000 (21:06 -0700)
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>
drivers/net/phy/phy.c

index 1ee25877c4d163a15fb2d8c5e9f1c7f0d25389d2..a5e0f072103571d03f3219f3f677f4cde6ac01ee 100644 (file)
@@ -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.