Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phylink: always do a major config when attaching a SFP PHY

Background: https://lore.kernel.org/r/20250107123615.161095-1-ericwouds@gmail.com

Since adding negotiation of in-band capabilities, it is no longer
sufficient to just look at the MLO_AN_xxx mode and PHY interface to
decide whether to do a major configuration, since the result now
depends on the capabilities of the attaching PHY.

Always trigger a major configuration in this case.

Testing log: https://lore.kernel.org/r/f20c9744-3953-40e7-a9c9-5534b25d2e2a@gmail.com

Reported-by: Eric Woudstra <ericwouds@gmail.com>
Tested-by: Eric Woudstra <ericwouds@gmail.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Russell King (Oracle) and committed by
David S. Miller
af10e092 45bd1c5b

+5 -6
+5 -6
drivers/net/phy/phylink.c
··· 3541 3541 return interface; 3542 3542 } 3543 3543 3544 - static void phylink_sfp_set_config(struct phylink *pl, 3545 - unsigned long *supported, 3546 - struct phylink_link_state *state) 3544 + static void phylink_sfp_set_config(struct phylink *pl, unsigned long *supported, 3545 + struct phylink_link_state *state, 3546 + bool changed) 3547 3547 { 3548 3548 u8 mode = MLO_AN_INBAND; 3549 - bool changed = false; 3550 3549 3551 3550 phylink_dbg(pl, "requesting link mode %s/%s with support %*pb\n", 3552 3551 phylink_an_mode_str(mode), phy_modes(state->interface), ··· 3622 3623 3623 3624 pl->link_port = pl->sfp_port; 3624 3625 3625 - phylink_sfp_set_config(pl, support, &config); 3626 + phylink_sfp_set_config(pl, support, &config, true); 3626 3627 3627 3628 return 0; 3628 3629 } ··· 3697 3698 3698 3699 pl->link_port = pl->sfp_port; 3699 3700 3700 - phylink_sfp_set_config(pl, pl->sfp_support, &config); 3701 + phylink_sfp_set_config(pl, pl->sfp_support, &config, false); 3701 3702 3702 3703 return 0; 3703 3704 }