diff mbox series

[06/11] phylink: restart 802.3z negotiation when starting net device

Message ID E1eKiUs-0004zB-P8@rmk-PC.armlinux.org.uk
State Accepted, archived
Delegated to: David Miller
Headers show
Series SFP/phylink updates | expand

Commit Message

Russell King (Oracle) Dec. 1, 2017, 10:24 a.m. UTC
Restart 802.3z negotiation when the net device is brought up to ensure
that the link partner has our current link modes.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/phylink.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Florian Fainelli Dec. 1, 2017, 5:24 p.m. UTC | #1
On 12/01/2017 02:24 AM, Russell King wrote:
> Restart 802.3z negotiation when the net device is brought up to ensure
> that the link partner has our current link modes.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
diff mbox series

Patch

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 560486463930..40563c8d7352 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -751,6 +751,12 @@  void phylink_start(struct phylink *pl)
 	phylink_resolve_flow(pl, &pl->link_config);
 	phylink_mac_config(pl, &pl->link_config);
 
+	/* Restart autonegotiation if using 802.3z to ensure that the link
+	 * parameters are properly negotiated.  This is necessary for DSA
+	 * switches using 802.3z negotiation to ensure they see our modes.
+	 */
+	phylink_mac_an_restart(pl);
+
 	clear_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
 	phylink_run_resolve(pl);