diff mbox series

[2/2] net: sfp: add quirk for FINISAR FTLF8536P4BCL SFP module

Message ID 20220913181009.13693-3-oleksandr.mazur@plvision.eu (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: sfp: add quirks for FINISTAR FTL* modules | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2 this patch: 2
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 5 this patch: 5
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
netdev/checkpatch fail ERROR: Remove Gerrit Change-Id's before submitting upstream WARNING: line length of 81 exceeds 80 columns WARNING: line length of 84 exceeds 80 columns
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Oleksandr Mazur Sept. 13, 2022, 6:10 p.m. UTC
The FINISAR FTLF8536P4BCL reports 25G & 100GBd SR in it's EEPROM,
but supports only 1000base-X and 10000base-SR modes.

Add quirk to clear unsupported modes, and set only the ones that
module actually supports: 1000base-X and 10000base-SR.

EEPROM content of this SFP module is (where XX is serial number):

00:  03 04 07 00 00 00 00 00  00 00 00 06 ff 00 00 00  |................|
10:  02 00 0a 07 46 49 4e 49  53 41 52 20 43 4f 52 50  |....FINISAR CORP|
20:  2e 20 20 20 02 00 90 65  46 54 4c 46 38 35 33 36  |.   ...eFTLF8536|
30:  50 34 42 43 4c 20 20 20  41 20 20 20 03 52 00 b8  |P4BCL   A   .R..|
40:  08 1a 70 00 55 55 XX XX  XX XX XX XX XX XX XX XX  |..p.UUXXXXXXXXXX|
50:  20 20 20 20 31 36 30 32  31 30 20 20 68 f0 08 62  |    160210  h..b|

Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu>
Change-Id: I320058dee38724d3564fc2500ae2e3abfe3d47bb
---
 drivers/net/phy/sfp-bus.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Russell King (Oracle) Sept. 13, 2022, 7:01 p.m. UTC | #1
On Tue, Sep 13, 2022 at 09:10:09PM +0300, Oleksandr Mazur wrote:
> The FINISAR FTLF8536P4BCL reports 25G & 100GBd SR in it's EEPROM,
> but supports only 1000base-X and 10000base-SR modes.
> 
> Add quirk to clear unsupported modes, and set only the ones that
> module actually supports: 1000base-X and 10000base-SR.

This description does not match what the patch is doing. I see no
modes being cleared.

Thanks.
diff mbox series

Patch

diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index c3df85501836..a7799162e3a7 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -61,6 +61,17 @@  static void sfp_quirk_ubnt_uf_instant(const struct sfp_eeprom_id *id,
 	phylink_set(modes, 1000baseX_Full);
 }
 
+static void sfp_quirk_finisar_ftlf8536p4bcl(const struct sfp_eeprom_id *id,
+					    unsigned long *modes)
+{
+	/* Finisar FTLF8536P4BCL module claims  25G & 100GBd SR support in it's
+	 * EEPROM, but can also support both 1000BaseX and 10000Base-SR modes.
+	 * Set additionally supported modes: 1000baseX_Full and 10000baseSR_Full.
+	 */
+	phylink_set(modes, 1000baseX_Full);
+	phylink_set(modes, 10000baseSR_Full);
+}
+
 static const struct sfp_quirk sfp_quirks[] = {
 	{
 		// Alcatel Lucent G-010S-P can operate at 2500base-X, but
@@ -100,6 +111,12 @@  static const struct sfp_quirk sfp_quirks[] = {
 		.vendor = "FINISAR CORP.",
 		.part = "FTLX8574D3BCL",
 		.modes = sfp_quirk_1000basex,
+	}, {
+		// Finisar FTLF8536P4BCL can operate at 1000base-X and 10000base-SR,
+		// but reports 25G & 100GBd SR in it's EEPROM
+		.vendor = "FINISAR CORP.",
+		.part = "FTLF8536P4BCL",
+		.modes = sfp_quirk_finisar_ftlf8536p4bcl,
 	},
 };