[PATCH AUTOSEL 6.19-6.12] net: sfp: add quirk for Lantech 8330-265D

Sasha Levin
2026-02-14T21:27:24Z

From: Marek Behún <kabel@kernel.org>

[ Upstream commit 86a8e8e0ddbc3d14c799536eb888180b84d002f3 ]

Similar to Lantech 8330-262D-E, the Lantech 8330-265D also reports
2500MBd instead of 3125MBd.

Also, all 8330-265D report normal RX_LOS in EEPROM, but some signal
inverted RX_LOS. We therefore need to ignore RX_LOS on these modules.

Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://patch.msgid.link/20260128170044.15576-1-kabel@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

## Analysis of SFP Quirk Addition for Lantech 8330-265D

### Commit Message Analysis

The commit adds a hardware quirk for the Lantech 8330-265D SFP module.
It addresses two specific hardware issues:

1. **Incorrect speed reporting**: The module reports 2500MBd instead of
the correct 3125MBd in its EEPROM, preventing it from being
recognized as a 2500base-X capable module.
2. **Inverted RX_LOS signal**: Some units of this module report inverted
Loss-of-Signal, while the EEPROM claims normal LOS behavior. Since
the behavior is inconsistent across units, the fix ignores LOS
entirely.

The commit explicitly references similarity to an existing quirk
(Lantech 8330-262D-E), establishing a pattern.

### Code Change Analysis

The change is minimal and contained:
- **2 lines added**: A new `SFP_QUIRK()` entry for "Lantech" /
"8330-265D" with `sfp_quirk_2500basex` and `sfp_fixup_ignore_los`
- **Comment updated**: The existing comment for the 8330-262D-E is
expanded to cover the 8330-265D as well, and explains the LOS issue
- **No new functions or infrastructure**: Uses existing quirk macros
(`SFP_QUIRK`) and existing fixup functions (`sfp_quirk_2500basex`,
`sfp_fixup_ignore_los`)

### Classification: Hardware Quirk

This falls squarely into the **SFP/Network Quirks** exception category
explicitly mentioned in the stable backport guidelines. SFP quirks for
optical modules with broken behavior are specifically called out as
appropriate for stable trees.

### Risk Assessment

- **Risk: Extremely Low** — The quirk only triggers for modules with
vendor string "Lantech" and product string "8330-265D". It cannot
affect any other hardware.
- **Scope: Minimal** — Two lines of data-driven code in an existing
quirk table. No logic changes.
- **Dependencies: None** — The `SFP_QUIRK` macro, `sfp_quirk_2500basex`,
and `sfp_fixup_ignore_los` all already exist in the codebase. This
commit is fully self-contained.

### User Impact

Without this quirk:
- The Lantech 8330-265D SFP module **cannot operate at 2500base-X**
because the kernel misinterprets its EEPROM data
- Some units exhibit **random link drops or failure to establish link**
due to inverted RX_LOS being treated as actual signal loss

These are real, user-impacting hardware issues that make the SFP module
non-functional or unreliable.

### Stability Indicators

- Author is **Marek Behún**, the SFP subsystem maintainer — he deeply
understands this code
- Reviewed and merged by **Jakub Kicinski**, the networking subsystem
maintainer
- Follows an established pattern (identical approach to existing
8330-262D-E quirk)
- The fixup functions used (`sfp_quirk_2500basex`,
`sfp_fixup_ignore_los`) are well-tested and used by other quirk
entries

### Conclusion

This is a textbook example of a hardware quirk that belongs in stable
trees. It's a tiny, self-contained, zero-risk addition to an existing
quirk table that makes specific hardware work correctly. It uses only
pre-existing infrastructure, was authored and reviewed by the relevant
maintainers, and fixes real hardware issues (incorrect speed negotiation
and unreliable link due to inverted LOS).

**YES**

drivers/net/phy/sfp.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 3e023723887c4..43aefdd8b70f7 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -532,9 +532,13 @@ static const struct sfp_quirk sfp_quirks[] = {
SFP_QUIRK("HUAWEI", "MA5671A", sfp_quirk_2500basex,
sfp_fixup_ignore_tx_fault),

- // Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report
- // 2500MBd NRZ in their EEPROM
+ // Lantech 8330-262D-E and 8330-265D can operate at 2500base-X, but
+ // incorrectly report 2500MBd NRZ in their EEPROM.
+ // Some 8330-265D modules have inverted LOS, while all of them report
+ // normal LOS in EEPROM. Therefore we need to ignore LOS entirely.
SFP_QUIRK_S("Lantech", "8330-262D-E", sfp_quirk_2500basex),
+ SFP_QUIRK("Lantech", "8330-265D", sfp_quirk_2500basex,
+ sfp_fixup_ignore_los),

SFP_QUIRK_S("UBNT", "UF-INSTANT", sfp_quirk_ubnt_uf_instant),

--
2.51.0