OSDN Git Service

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 1ee2587..a5e0f07 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.