Skip to contentSkip to conversation

net: sfp: Fix quirk for Ubiquiti U-Fiber Instant SFP module

PATCH Superseded Marek Behún 2 participants 3 messages Jan 28 – Jan 29

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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.

Fixes fd580c9830316eda ("net: sfp: augment SFP parsing with phy_interface_t bitmap")
---
 drivers/net/phy/sfp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/phy/sfp.c +2 -0
index 47f095bd91ce..eb6fa98e5d71 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw

Hi Marek,

Quoted 2 lines · Marek Behún

Commit fd580c9830316eda ("net: sfp: augment SFP parsing with phy_interface_t bitmap") did not add augumentation for the interface

                                       ^^^^^^^^^^^^^
                                       augmentation
Quoted 25 lines

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.

Fixes fd580c9830316eda ("net: sfp: augment SFP parsing with phy_interface_t bitmap")
---
 drivers/net/phy/sfp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/phy/sfp.c +0 -0
index 47f095bd91ce..eb6fa98e5d71 100644

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

#2 lore raw

So I sent v2 with change as you suggested but forgot to add your R-b tag /o\ :-D