diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2018-09-20 22:34:25 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-21 18:59:29 -0700 |
commit | 075ddebc3283e83ac56fcc8f4bb44c15cef0d7ce (patch) | |
tree | 38f7cd5af1590e8a6f4880beffe2728ed303fb32 /drivers | |
parent | 7979472bba8bf63f0f76a37d48d59a26210d9bee (diff) |
net: phy: don't reschedule state machine when PHY is halted
When being in state PHY_HALTED we don't have to reschedule the
state machine, phy_start() will start it again.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/phy.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index a5e0f0721035..a1f8e4816f72 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -1123,9 +1123,13 @@ void phy_state_machine(struct work_struct *work) /* Only re-schedule a PHY state machine change if we are polling the * PHY, if PHY_IGNORE_INTERRUPT is set, then we will be moving - * between states from phy_mac_interrupt() + * between states from phy_mac_interrupt(). + * + * In state PHY_HALTED the PHY gets suspended, so rescheduling the + * state machine would be pointless and possibly error prone when + * called from phy_disconnect() synchronously. */ - if (phy_polling_mode(phydev)) + if (phy_polling_mode(phydev) && old_state != PHY_HALTED) queue_delayed_work(system_power_efficient_wq, &phydev->state_queue, PHY_STATE_TIME * HZ); } |