Skip to content

Commit af10e09

Browse files
Russell King (Oracle)davem330
authored andcommitted
net: phylink: always do a major config when attaching a SFP PHY
Background: https://lore.kernel.org/r/[email protected] 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/[email protected] Reported-by: Eric Woudstra <[email protected]> Tested-by: Eric Woudstra <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 45bd1c5 commit af10e09

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/net/phy/phylink.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3541,12 +3541,11 @@ static phy_interface_t phylink_choose_sfp_interface(struct phylink *pl,
35413541
return interface;
35423542
}
35433543

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)
35473547
{
35483548
u8 mode = MLO_AN_INBAND;
3549-
bool changed = false;
35503549

35513550
phylink_dbg(pl, "requesting link mode %s/%s with support %*pb\n",
35523551
phylink_an_mode_str(mode), phy_modes(state->interface),
@@ -3623,7 +3622,7 @@ static int phylink_sfp_config_phy(struct phylink *pl, struct phy_device *phy)
36233622

36243623
pl->link_port = pl->sfp_port;
36253624

3626-
phylink_sfp_set_config(pl, support, &config);
3625+
phylink_sfp_set_config(pl, support, &config, true);
36273626

36283627
return 0;
36293628
}
@@ -3698,7 +3697,7 @@ static int phylink_sfp_config_optical(struct phylink *pl)
36983697

36993698
pl->link_port = pl->sfp_port;
37003699

3701-
phylink_sfp_set_config(pl, pl->sfp_support, &config);
3700+
phylink_sfp_set_config(pl, pl->sfp_support, &config, false);
37023701

37033702
return 0;
37043703
}

0 commit comments

Comments
 (0)