From 2f554490fcd189fd7a49d5dac95742a8e89b43d0 Mon Sep 17 00:00:00 2001 From: Heiner Kallweit Date: Wed, 30 Jun 2021 21:02:21 +0800 Subject: [PATCH] net: phy: call state machine synchronously in phy_stop mainline inclusion from mainline-v4.20-rc1 commit e8cfd9d6c7727a067b38dbe7655ca02377fdb301 category: bugfix bugzilla: NA CVE: NA ---------------------------------------------------- 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 Tested-by: Geert Uytterhoeven Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Reviewed-by: Weiwei Deng Reviewed-by: Zhaohui Zhong Reviewed-by: Yonglong Liu Signed-off-by: You Shengzui Reviewed-by: YueHaibing Signed-off-by: Yang Yingliang --- drivers/net/phy/phy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index e561ef1e842a..6019e0aba234 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. -- GitLab