Skip to content

Commit

Permalink
net: phy: don't reschedule state machine when PHY is halted
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed Sep 22, 2018
1 parent 7979472 commit 075ddeb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 075ddeb

Please sign in to comment.