Преглед на файлове

net: phy: ensure phylib state machine is stopped after calling phy_stop

commit cbfd12b3e8c3542e8142aa041714ed614d3f67b0 upstream.

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>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Heiner Kallweit преди 6 години
родител
ревизия
530b94b80d
променени са 2 файла, в които са добавени 1 реда и са изтрити 2 реда
  1. 1 0
      drivers/net/phy/phy.c
  2. 0 2
      drivers/net/phy/phy_device.c

+ 1 - 0
drivers/net/phy/phy.c

@@ -862,6 +862,7 @@ out_unlock:
 	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 phy_change()

+ 0 - 2
drivers/net/phy/phy_device.c

@@ -822,8 +822,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);