Netdev List
 help / color / mirror / Atom feed
From: Yago <yago@yago.blog>
To: Russell King <linux@armlinux.org.uk>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@kernel.org>,
	Martino Dell'Ambrogio <tillo@tillo.ch>
Subject: [PATCH net] net: sfp: ignore soft LOS on FS XGS-SFP-ONT-MACI
Date: Sun,  4 Oct 2026 11:44:08 +0000	[thread overview]
Message-ID: <20261004114408.754312-1-yago@yago.blog> (raw)

The FS XGS-SFP-ONT-MACI (MaxLinear PRX126 XGS-PON ONU stick) got the
potron fixup, which masks the TX_FAULT and LOS hardware pins. That is
not enough for this module: it advertises soft RX_LOS
(SFP_ENHOPTS_SOFT_RX_LOS, enhanced options byte 0xf6) and its EEPROM is
bridged from the internal optics, so the diagnostics status byte carries
a real LOS bit. Because potron only clears the LOS bit in state_hw_mask
and does not set it in state_ignore_mask, sfp_soft_start_poll() adds
SFP_F_LOS to state_soft_mask and the LOS bit is polled from the
diagnostics page instead. The module asserts it whenever there is no PON
light.

The result is that without fibre the state machine stays in
SFP_S_WAIT_LOS and the host link never comes up, so the stick's
management interface (used to configure the ONU serial, MIB and VLANs
before the fibre is connected) is unreachable. Add a fixup that keeps
the potron behaviour and additionally ignores LOS, and use it for this
module.

Tested on a Banana Pi BPI-R4 (MT7988A). With the plain potron fixup and
no fibre, sfp-wan comes up and drops ~30 ms later and the stick is
unreachable. With this fixup and no fibre, the diagnostics LOS bit reads
asserted for the whole test while the host link stays up and the stick
stays reachable. With fibre connected, behaviour is unchanged and the
ONU registers with the OLT.

Fixes: 03fa69146f2f ("net: sfp: add quirks for OEM XGSPONST2001 and FS XGS-SFP-ONT-MACI")
Signed-off-by: Yago <yago@yago.blog>
---
 drivers/net/phy/sfp.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 96361584791b..345069b8a25b 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -472,6 +472,20 @@ static void sfp_fixup_potron(struct sfp *sfp)
 	sfp_fixup_ignore_hw(sfp, SFP_F_TX_FAULT | SFP_F_LOS);
 }
 
+static void sfp_fixup_potron_ignore_los(struct sfp *sfp)
+{
+	/*
+	 * In addition to the potron fixup, this module implements soft LOS
+	 * (enhanced options 0xf6), so masking the hardware pins is not enough:
+	 * the state machine would fall back to the LOS bit polled from the
+	 * diagnostics page, which the module asserts whenever there is no PON
+	 * light. Ignore LOS entirely so the host link, and thus the module's
+	 * management interface, stays up without fibre.
+	 */
+	sfp_fixup_potron(sfp);
+	sfp_fixup_ignore_los(sfp);
+}
+
 static void sfp_fixup_rollball_cc(struct sfp *sfp)
 {
 	sfp_fixup_rollball(sfp);
@@ -572,10 +586,11 @@ static const struct sfp_quirk sfp_quirks[] = {
 
 	// Fiberstore XGS-SFP-ONT-MACI is a MAC-mode XGS-PON ONT stick with
 	// ONT-class serial-passthrough TX_FAULT/LOS wiring and slow startup;
-	// mask both signals and extend T_START_UP via the potron fixup. The
+	// mask both signals and extend T_START_UP via the potron fixup. It
+	// also implements soft LOS, so ignore LOS entirely (see fixup). The
 	// PN is the product name (XGS-SFP-ONT-MAC-I) truncated at the 16-byte
 	// field width, so the field is fully occupied and matches exactly.
-	SFP_QUIRK_F("FS", "XGS-SFP-ONT-MACI", sfp_fixup_potron),
+	SFP_QUIRK_F("FS", "XGS-SFP-ONT-MACI", sfp_fixup_potron_ignore_los),
 
 	SFP_QUIRK_F("HALNy", "HL-GSFP", sfp_fixup_halny_gsfp),
 
-- 
2.53.0


             reply	other threads:[~2026-10-04 11:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-04 11:44 Yago [this message]
2026-10-08 16:47 ` [PATCH net] net: sfp: ignore soft LOS on FS XGS-SFP-ONT-MACI Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261004114408.754312-1-yago@yago.blog \
    --to=yago@yago.blog \
    --cc=andrew+netdev@lunn.ch \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tillo@tillo.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox