Merge branch 'phy-improve-stopping-PHY'

Heiner Kallweit says:

====================
net: phy: improve stopping PHY

This patchset improves and simplifies stopping the PHY.

Heiner Kallweit (3):
  net: phy: stop PHY if needed when entering phy_disconnect
  net: phy: ensure phylib state machine is stopped after calling phy_stop
  net: phy: remove phy_stop_interrupts

v2:
- break down the patch to a patchset
v3:
- don't warn if driver didn't call phy_stop before phy_disconnect
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2019-01-18 14:12:25 -08:00
commit 209f94e618
3 changed files with 5 additions and 21 deletions

View File

@ -818,23 +818,6 @@ int phy_start_interrupts(struct phy_device *phydev)
}
EXPORT_SYMBOL(phy_start_interrupts);
/**
* phy_stop_interrupts - disable interrupts from a PHY device
* @phydev: target phy_device struct
*/
int phy_stop_interrupts(struct phy_device *phydev)
{
int err = phy_disable_interrupts(phydev);
if (err)
phy_error(phydev);
free_irq(phydev->irq, phydev);
return err;
}
EXPORT_SYMBOL(phy_stop_interrupts);
/**
* phy_stop - Bring down the PHY link, and stop checking the status
* @phydev: target phy_device struct
@ -858,6 +841,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

View File

@ -999,10 +999,11 @@ EXPORT_SYMBOL(phy_connect);
*/
void phy_disconnect(struct phy_device *phydev)
{
if (phydev->irq > 0)
phy_stop_interrupts(phydev);
if (phy_is_started(phydev))
phy_stop(phydev);
phy_stop_machine(phydev);
if (phy_interrupt_is_valid(phydev))
free_irq(phydev->irq, phydev);
phydev->adjust_link = NULL;

View File

@ -951,7 +951,6 @@ int phy_aneg_done(struct phy_device *phydev);
int phy_speed_down(struct phy_device *phydev, bool sync);
int phy_speed_up(struct phy_device *phydev);
int phy_stop_interrupts(struct phy_device *phydev);
int phy_restart_aneg(struct phy_device *phydev);
int phy_reset_after_clk_enable(struct phy_device *phydev);