public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: sfp: Fix quirk for Ubiquiti U-Fiber Instant SFP module
@ 2026-01-28 17:57 Marek Behún
  2026-01-28 20:25 ` Maxime Chevallier
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Behún @ 2026-01-28 17:57 UTC (permalink / raw)
  To: netdev, Russell King
  Cc: Paolo Abeni, Jakub Kicinski, Eric Dumazet, David S. Miller,
	Heiner Kallweit, Andrew Lunn, Marek Behún

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")
Signed-off-by: Marek Behún <kabel@kernel.org>
---
 drivers/net/phy/sfp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 47f095bd91ce..eb6fa98e5d71 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -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) \
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: sfp: Fix quirk for Ubiquiti U-Fiber Instant SFP module
  2026-01-28 17:57 [PATCH net] net: sfp: Fix quirk for Ubiquiti U-Fiber Instant SFP module Marek Behún
@ 2026-01-28 20:25 ` Maxime Chevallier
  2026-01-29  8:36   ` Marek Behún
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Chevallier @ 2026-01-28 20:25 UTC (permalink / raw)
  To: Marek Behún, netdev, Russell King
  Cc: Paolo Abeni, Jakub Kicinski, Eric Dumazet, David S. Miller,
	Heiner Kallweit, Andrew Lunn

Hi Marek,

On 28/01/2026 18:57, Marek Behún wrote:
> Commit fd580c9830316eda ("net: sfp: augment SFP parsing with
> phy_interface_t bitmap") did not add augumentation for the interface
                                       ^^^^^^^^^^^^^
                                       augmentation
> 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")
> Signed-off-by: Marek Behún <kabel@kernel.org>
> ---
>  drivers/net/phy/sfp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
> index 47f095bd91ce..eb6fa98e5d71 100644
> --- a/drivers/net/phy/sfp.c
> +++ b/drivers/net/phy/sfp.c
> @@ -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.

> +	__set_bit(PHY_INTERFACE_MODE_1000BASEX, caps->interfaces);
>  }
>  
>  #define SFP_QUIRK(_v, _p, _s, _f) \

With that, it looks good to me,

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: sfp: Fix quirk for Ubiquiti U-Fiber Instant SFP module
  2026-01-28 20:25 ` Maxime Chevallier
@ 2026-01-29  8:36   ` Marek Behún
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Behún @ 2026-01-29  8:36 UTC (permalink / raw)
  To: Maxime Chevallier
  Cc: Marek Behún, netdev, Russell King, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller, Heiner Kallweit,
	Andrew Lunn

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-29  8:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-28 17:57 [PATCH net] net: sfp: Fix quirk for Ubiquiti U-Fiber Instant SFP module Marek Behún
2026-01-28 20:25 ` Maxime Chevallier
2026-01-29  8:36   ` Marek Behún

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox