net: sfp-bus: fix SFP mode detect from bitrate
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 15 Jan 2024 12:43:38 +0000 (12:43 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 17 Jan 2024 01:49:49 +0000 (17:49 -0800)
commit97eb5d51b4a584a60e5d096bdb6b33edc9f50d8d
tree21423e5ef5145a28ff2645f2c3ec2777d67211dc
parent776dac5a662774f07a876b650ba578d0a62d20db
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: 8110633db49d ("net: sfp-bus: allow SFP quirks to override Autoneg and pause bits")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://lore.kernel.org/r/E1rPMJW-001Ahf-L0@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/sfp-bus.c