net: sfp: Fix quirk for Ubiquiti U-Fiber Instant SFP module
Subsystems (4)
PATCH 1/1 net: sfp: Fix quirk for Ubiquiti U-Fiber Instant SFP module
Commit fd580c9830316eda ("net: sfp: augment SFP parsing with phy_interface_t bitmap") did not add augumentation for the interface bitmap in the quirk for Ubiquiti U-Fiber Instant.
The subsequent commit f81fa96d8a6c7a77 ("net: phylink: use phy_interface_t bitmaps for optical modules") then changed phylink code for selection of SFP interface: instead of using link mode bitmap, the interface bitmap is used, and the fastest interface mode supported by both SFP module and MAC is chosen.
Since the interface bitmap contains also modes faster than 1000base-x, this caused a regression wherein this module stopped working out-of-the-box.
Fix this.
--- drivers/net/phy/sfp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/phy/sfp.c +2 -0
@@ -479,6 +479,8 @@ static void sfp_quirk_ubnt_uf_instant(const struct sfp_eeprom_id *id,linkmode_zero (caps->link_modes);linkmode_set_bit (ETHTOOL_LINK_MODE_1000baseX_Full_BIT, caps->link_modes); +bitmap_zero (caps->interfaces,PHY_INTERFACE_MODE_MAX ); +__set_bit (PHY_INTERFACE_MODE_1000BASEX , caps->interfaces); }#define SFP_QUIRK (_v, _p, _s, _f) \
Signature · 1 line
2.52.0
Hi Marek,
Quoted 2 lines · Marek Behún
Commit
fd580c9830316eda("net: sfp: augment SFP parsing withphy_interface_tbitmap") did not add augumentation for the interface
^^^^^^^^^^^^^
augmentationQuoted 25 lines
bitmap in the quirk for Ubiquiti U-Fiber Instant.
The subsequent commit
f81fa96d8a6c7a77("net: phylink: usephy_interface_tbitmaps for optical modules") then changed phylink code for selection of SFP interface: instead of using link mode bitmap, the interface bitmap is used, and the fastest interface mode supported by both SFP module and MAC is chosen.Since the interface bitmap contains also modes faster than 1000base-x, this caused a regression wherein this module stopped working out-of-the-box.
Fix this.
Fixes fd580c9830316eda ("net: sfp: augment SFP parsing with phy_interface_t bitmap")Signed-off-by Marek Behún <[email protected]>--- drivers/net/phy/sfp.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/phy/sfp.c +0
-0
drivers/net/phy/sfp.c static void sfp_quirk_ubnt_uf_instant(const struct sfp_eeprom_id *id, · line 482
Quoted 4 lines
drivers/net/phy/sfp.c +1
-0@@ -479,6 +479,8 @@ static void sfp_quirk_ubnt_uf_instant(const struct sfp_eeprom_id *id,linkmode_zero (caps->link_modes);linkmode_set_bit (ETHTOOL_LINK_MODE_1000baseX_Full_BIT, caps->link_modes); +bitmap_zero (caps->interfaces,PHY_INTERFACE_MODE_MAX );
small nit, you can use phy_interface_zero() here.
drivers/net/phy/sfp.c static void sfp_quirk_ubnt_uf_instant(const struct sfp_eeprom_id *id, · line 486
Quoted 4 lines
drivers/net/phy/sfp.c +1
-0+__set_bit (PHY_INTERFACE_MODE_1000BASEX , caps->interfaces); }#define SFP_QUIRK (_v, _p, _s, _f) \
With that, it looks good to me,
Maxime
So I sent v2 with change as you suggested but forgot to add your R-b tag /o\ :-D