Skip to content

Commit 97eb5d5

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: sfp-bus: fix SFP mode detect from bitrate
The referenced commit moved the setting of the Autoneg and pause bits early in sfp_parse_support(). However, we check whether the modes are empty before using the bitrate to set some modes. Setting these bits so early causes that test to always be false, preventing this working, and thus some modules that used to work no longer do. Move them just before the call to the quirk. Fixes: 8110633 ("net: sfp-bus: allow SFP quirks to override Autoneg and pause bits") Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Maxime Chevallier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 776dac5 commit 97eb5d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/phy/sfp-bus.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,6 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
151151
unsigned int br_min, br_nom, br_max;
152152
__ETHTOOL_DECLARE_LINK_MODE_MASK(modes) = { 0, };
153153

154-
phylink_set(modes, Autoneg);
155-
phylink_set(modes, Pause);
156-
phylink_set(modes, Asym_Pause);
157-
158154
/* Decode the bitrate information to MBd */
159155
br_min = br_nom = br_max = 0;
160156
if (id->base.br_nominal) {
@@ -339,6 +335,10 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
339335
}
340336
}
341337

338+
phylink_set(modes, Autoneg);
339+
phylink_set(modes, Pause);
340+
phylink_set(modes, Asym_Pause);
341+
342342
if (bus->sfp_quirk && bus->sfp_quirk->modes)
343343
bus->sfp_quirk->modes(id, modes, interfaces);
344344

0 commit comments

Comments
 (0)