Commit ea5968cd authored by Russell King (Oracle)'s avatar Russell King (Oracle) Committed by David S. Miller

net: phy: move call to start aneg

Move the call to start auto-negotiation inside the lock in the PHYLIB
state machine, calling the locked variant _phy_start_aneg(). This
avoids unnecessarily releasing and re-acquiring the lock.
Tested-by: default avatarJijie Shao <shaojijie@huawei.com>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ef113a60
...@@ -1489,14 +1489,15 @@ void phy_state_machine(struct work_struct *work) ...@@ -1489,14 +1489,15 @@ void phy_state_machine(struct work_struct *work)
break; break;
} }
if (needs_aneg) {
err = _phy_start_aneg(phydev);
func = &_phy_start_aneg;
}
mutex_unlock(&phydev->lock); mutex_unlock(&phydev->lock);
if (needs_aneg) { if (do_suspend)
err = phy_start_aneg(phydev);
func = &phy_start_aneg;
} else if (do_suspend) {
phy_suspend(phydev); phy_suspend(phydev);
}
if (err == -ENODEV) if (err == -ENODEV)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment