net: phy: start state machine in phy_start only
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 23 Jan 2019 06:27:21 +0000 (07:27 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Jan 2019 06:15:15 +0000 (22:15 -0800)
The state machine is a no-op before phy_start() has been called.
Therefore let's enable it in phy_start() only. In phy_start()
let's call phy_start_machine() instead of phy_trigger_machine().
phy_start_machine is an alias for phy_trigger_machine but it makes
clearer that we start the state machine here instead of just
triggering a run.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c
drivers/net/phy/phy_device.c
drivers/net/phy/phylink.c

index 631ed33fe9d95b35a6e335d8a4893ecea590d125..a7fca15888b6f7664c31e7be9d5a5a78c43467d3 100644 (file)
@@ -878,7 +878,7 @@ void phy_start(struct phy_device *phydev)
        }
        mutex_unlock(&phydev->lock);
 
-       phy_trigger_machine(phydev);
+       phy_start_machine(phydev);
 }
 EXPORT_SYMBOL(phy_start);
 
index 509d9402fa9aa1b21ed738302cf46798547dfe55..64c25a0684ac5177c546af4e58cdd037e209f05b 100644 (file)
@@ -951,7 +951,6 @@ int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
                return rc;
 
        phy_prepare_link(phydev, handler);
-       phy_start_machine(phydev);
        if (phydev->irq > 0)
                phy_start_interrupts(phydev);
 
index 7d9910da5018b9d050e610be670d2f583337ed60..c1b6e05ba60cd8ca96877f57d78e296980c92a83 100644 (file)
@@ -676,7 +676,6 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy)
                   __ETHTOOL_LINK_MODE_MASK_NBITS, pl->supported,
                   __ETHTOOL_LINK_MODE_MASK_NBITS, phy->advertising);
 
-       phy_start_machine(phy);
        if (phy->irq > 0)
                phy_start_interrupts(phy);