Skip to content

Commit

Permalink
net: phy: ensure phylib state machine is stopped after calling phy_stop
Browse files Browse the repository at this point in the history
The call to the phylib state machine in phy_stop() just ensures that
the state machine isn't re-triggered, but a state machine call may
be scheduled already. So lets's call phy_stop_machine().
This also allows to get rid of the call to phy_stop_machine() in
phy_disconnect().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed Jan 18, 2019
1 parent 472115d commit cbfd12b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ void phy_stop(struct phy_device *phydev)
mutex_unlock(&phydev->lock);

phy_state_machine(&phydev->state_queue.work);
phy_stop_machine(phydev);

/* Cannot call flush_scheduled_work() here as desired because
* of rtnl_lock(), but PHY_HALTED shall guarantee irq handler
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,6 @@ void phy_disconnect(struct phy_device *phydev)
if (phydev->irq > 0)
phy_stop_interrupts(phydev);

phy_stop_machine(phydev);

phydev->adjust_link = NULL;

phy_detach(phydev);
Expand Down

0 comments on commit cbfd12b

Please sign in to comment.