public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2] net: sfp: improve Huawei MA5671a fixup
@ 2026-03-05 12:50 Álvaro Fernández Rojas
  2026-03-05 15:04 ` Andrew Lunn
  2026-03-05 15:21 ` Jakub Kicinski
  0 siblings, 2 replies; 5+ messages in thread
From: Álvaro Fernández Rojas @ 2026-03-05 12:50 UTC (permalink / raw)
  To: linux, andrew, hkallweit1, davem, edumazet, kuba, pabeni,
	mnhagan88, netdev, linux-kernel
  Cc: Álvaro Fernández Rojas

With the current sfp_fixup_ignore_tx_fault() fixup we ignore the TX_FAULT
signal, but we also need to apply sfp_fixup_ignore_los() in order to be
able to communicate with the module even if the fiber isn't connected for
configuration purposes.
This is needed for all the MA5671a firmwares, excluding the FS modded
firmware.

Fixes: 2069624dac19 ("net: sfp: Add tx-fault workaround for Huawei MA5671A SFP ONT")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 v2: rebase on top of net/main instead of linux/master

 drivers/net/phy/sfp.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index f4bf53da3d4f..34773cbbd811 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -372,6 +372,12 @@ static void sfp_fixup_ignore_hw(struct sfp *sfp, unsigned int mask)
 	sfp->state_hw_mask &= ~mask;
 }
 
+static void sfp_fixup_huawei(struct sfp *sfp)
+{
+	sfp_fixup_ignore_tx_fault(sfp);
+	sfp_fixup_ignore_los(sfp);
+}
+
 static void sfp_fixup_nokia(struct sfp *sfp)
 {
 	sfp_fixup_long_startup(sfp);
@@ -530,7 +536,7 @@ static const struct sfp_quirk sfp_quirks[] = {
 	// Huawei MA5671A can operate at 2500base-X, but report 1.2GBd NRZ in
 	// their EEPROM
 	SFP_QUIRK("HUAWEI", "MA5671A", sfp_quirk_2500basex,
-		  sfp_fixup_ignore_tx_fault),
+		  sfp_fixup_huawei),
 
 	// Lantech 8330-262D-E and 8330-265D can operate at 2500base-X, but
 	// incorrectly report 2500MBd NRZ in their EEPROM.
-- 
2.47.3


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

* Re: [PATCH net v2] net: sfp: improve Huawei MA5671a fixup
  2026-03-05 12:50 [PATCH net v2] net: sfp: improve Huawei MA5671a fixup Álvaro Fernández Rojas
@ 2026-03-05 15:04 ` Andrew Lunn
  2026-03-06 10:22   ` Álvaro Fernández Rojas
  2026-03-05 15:21 ` Jakub Kicinski
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2026-03-05 15:04 UTC (permalink / raw)
  To: Álvaro Fernández Rojas
  Cc: linux, hkallweit1, davem, edumazet, kuba, pabeni, mnhagan88,
	netdev, linux-kernel

> +static void sfp_fixup_huawei(struct sfp *sfp)

Please avoid using a vendor name. It is unlikely just this vendor
produces an SFP broken like this, other vendors will break their SFPs
in the same way. And then we will want to reuse this helper.

So maybe sfp_fixup_ignore_tx_fault_and_loss()?

   Andrew

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

* Re: [PATCH net v2] net: sfp: improve Huawei MA5671a fixup
  2026-03-05 12:50 [PATCH net v2] net: sfp: improve Huawei MA5671a fixup Álvaro Fernández Rojas
  2026-03-05 15:04 ` Andrew Lunn
@ 2026-03-05 15:21 ` Jakub Kicinski
  2026-03-06 10:23   ` Álvaro Fernández Rojas
  1 sibling, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2026-03-05 15:21 UTC (permalink / raw)
  To: Álvaro Fernández Rojas
  Cc: linux, andrew, hkallweit1, davem, edumazet, pabeni, mnhagan88,
	netdev, linux-kernel

On Thu,  5 Mar 2026 13:50:32 +0100 Álvaro Fernández Rojas wrote:
> With the current sfp_fixup_ignore_tx_fault() fixup we ignore the TX_FAULT
> signal, but we also need to apply sfp_fixup_ignore_los() in order to be
> able to communicate with the module even if the fiber isn't connected for
> configuration purposes.
> This is needed for all the MA5671a firmwares, excluding the FS modded
> firmware.

Also please don't repost things more than once in a 24h period per:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html

Andrew could have given you the same feedback on v1 :/

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

* Re: [PATCH net v2] net: sfp: improve Huawei MA5671a fixup
  2026-03-05 15:04 ` Andrew Lunn
@ 2026-03-06 10:22   ` Álvaro Fernández Rojas
  0 siblings, 0 replies; 5+ messages in thread
From: Álvaro Fernández Rojas @ 2026-03-06 10:22 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: linux, hkallweit1, davem, edumazet, kuba, pabeni, mnhagan88,
	netdev, linux-kernel

El jue, 5 mar 2026 a las 16:04, Andrew Lunn (<andrew@lunn.ch>) escribió:
>
> > +static void sfp_fixup_huawei(struct sfp *sfp)
>
> Please avoid using a vendor name. It is unlikely just this vendor
> produces an SFP broken like this, other vendors will break their SFPs
> in the same way. And then we will want to reuse this helper.

I just followed the same logic used for sfp_fixup_nokia()
https://github.com/torvalds/linux/blob/5ee8dbf54602dc340d6235b1d6aa17c0f283f48c/drivers/net/phy/sfp.c#L375-L379

>
> So maybe sfp_fixup_ignore_tx_fault_and_loss()?

Sure, I can change that in v3.

>
>    Andrew

Best regards,
Álvaro.

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

* Re: [PATCH net v2] net: sfp: improve Huawei MA5671a fixup
  2026-03-05 15:21 ` Jakub Kicinski
@ 2026-03-06 10:23   ` Álvaro Fernández Rojas
  0 siblings, 0 replies; 5+ messages in thread
From: Álvaro Fernández Rojas @ 2026-03-06 10:23 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: linux, andrew, hkallweit1, davem, edumazet, pabeni, mnhagan88,
	netdev, linux-kernel

El jue, 5 mar 2026 a las 16:21, Jakub Kicinski (<kuba@kernel.org>) escribió:
>
> On Thu,  5 Mar 2026 13:50:32 +0100 Álvaro Fernández Rojas wrote:
> > With the current sfp_fixup_ignore_tx_fault() fixup we ignore the TX_FAULT
> > signal, but we also need to apply sfp_fixup_ignore_los() in order to be
> > able to communicate with the module even if the fiber isn't connected for
> > configuration purposes.
> > This is needed for all the MA5671a firmwares, excluding the FS modded
> > firmware.
>
> Also please don't repost things more than once in a 24h period per:
> https://www.kernel.org/doc/html/next/process/maintainer-netdev.html
>
> Andrew could have given you the same feedback on v1 :/

I'm really sorry for the trouble.

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

end of thread, other threads:[~2026-03-06 10:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 12:50 [PATCH net v2] net: sfp: improve Huawei MA5671a fixup Álvaro Fernández Rojas
2026-03-05 15:04 ` Andrew Lunn
2026-03-06 10:22   ` Álvaro Fernández Rojas
2026-03-05 15:21 ` Jakub Kicinski
2026-03-06 10:23   ` Álvaro Fernández Rojas

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