forked from luck/tmp_suning_uos_patched
net phy: Check for aneg completion before setting state to PHY_RUNNING
phy_state_machine should check whether auto-negotiatin is completed before changing phydev->state from PHY_NOLINK to PHY_RUNNING. If auto-negotiation is not completed phydev->state should be set to PHY_AN. Signed-off-by: Balakumaran Kannan <kumaran.4353@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
22041fb05b
commit
e46e08b843
@ -765,6 +765,17 @@ void phy_state_machine(struct work_struct *work)
|
||||
break;
|
||||
|
||||
if (phydev->link) {
|
||||
if (AUTONEG_ENABLE == phydev->autoneg) {
|
||||
err = phy_aneg_done(phydev);
|
||||
if (err < 0)
|
||||
break;
|
||||
|
||||
if (!err) {
|
||||
phydev->state = PHY_AN;
|
||||
phydev->link_timeout = PHY_AN_TIMEOUT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
phydev->state = PHY_RUNNING;
|
||||
netif_carrier_on(phydev->attached_dev);
|
||||
phydev->adjust_link(phydev->attached_dev);
|
||||
|
Loading…
Reference in New Issue
Block a user