Hi Wozi,
Following up on the ODI DFP-34X-2IY3 / HALNy HL-GSFP 2.5G quirk — good news and one open issue to report.
The quirk works. Using your sfp_quirk_2500basex machinery as a template, I added:
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -570,7 +570,8 @@
SFP_QUIRK_F("OEM","XGSPONST2001", sfp_fixup_halny_gsfp),
SFP_QUIRK_F("OEM","XGSPONST2000" , sfp_fixup_halny_gsfp),
- SFP_QUIRK_F("HALNy", "HL-GSFP", sfp_fixup_halny_gsfp),
+ SFP_QUIRK("HALNy", "HL-GSFP", sfp_quirk_2500basex, sfp_fixup_halny_gsfp),
+ SFP_QUIRK_S("ODI", "DFP-34X-2IY3", sfp_quirk_2500basex),
SFP_QUIRK_F("H-COM", "SPP425H-GAB4", sfp_fixup_potron),
(Note: your builder tree uses SFP_QUIRK_S for mode-only quirks, not upstream’s SFP_QUIRK_M — worth flagging in case anyone else copies from mainline docs like I initially did.)
With this patch, both modules confirmed Speed: 2500Mb/s, Duplex: Full, Link detected: yes via ethtool, repeatedly, across multiple clean boots. dmesg showed the expected sequence:
mtk_soc_eth ... eth1: requesting link mode inband/2500base-x with support ...
mtk_soc_eth ... eth1: switched to inband/2500base-x link mode
So the fix itself — forcing the interface mode instead of just declaring a speed — was exactly right, confirmed on real hardware with a live GPON signal (both modules fully ranged with the OLT, active laser, ~-25dBm Rx).
The open issue: after a lot of hot-swapping between the two modules during testing (rapid remove/insert cycles, plus one bad unbind on the Aeonsemi driver that left bind returning “No such device”), the port’s Aeonsemi AS21xxx PHY (mdio-bus:1c) ended up in a bad state. Even after full power-cycles (up to 10 min unplugged, module out), it stays there now:
Aeonsemi AS21xxx mdio-bus:1c: IPC sync failure: NOOP 3, sts: 0
Aeonsemi AS21xxx mdio-bus:1c: failed to send ipc msg for 1: -22
Aeonsemi AS21xxx mdio-bus:1c: aeon_ipc_send_cmd fail to polling status failed: -110
and the debugfs SerDes dump (echo sds > .../aeon_dbg_dump) shows everything zeroed out:
SerDes State:
PCS_STAT1 : 0x0000
PCS_STAT2 : 0x0000
PMA_INTR_FLAG: 0x0000
PMA_INTR_RAW : 0x0000
USXGMII_MII4 : 0x0000
USXGMII_MII5 : 0x0000
USXGMII_STAT : 0x0000
mtk_soc_eth still correctly requests/switches to inband/2500base-x, and the SFP-side state machine (/sys/kernel/debug/sfp2/state) looks completely healthy (Main state: link_up, Signalling rate: 3125 kBd, rx_los: 0), but Link detected stays no and the PCS never syncs. aeon_normal_retrain “succeeds” per the log but doesn’t actually restore it.
So: the quirk is solid and does what it should. What I’m less sure about is whether the AS21xxx driver (mainline since ~May 2025, so still fairly young) has a known issue with IPC parity-bit desync after repeated hotplug, or whether there’s a firmware-level reset command exposed elsewhere (I saw aeon_set_sys_reboot in debugfs but didn’t want to gamble with it without knowing the exact syntax).
Do you know of a clean way to force a full firmware reload on the AS21xxx (something more thorough than driver unbind, which just orphaned the mdio device for me), or is this something worth reporting upstream to Christian Marangi (the AS21xxx driver maintainer)?
Happy to test any suggested fix. Full session logs available if useful.
Thanks again for all the help getting this far — the underlying quirk fix was exactly on target.
Best,
Sebastian