From 4b09a3349878112a18d99d30ab37cd076843f79f Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 13 Apr 2023 20:16:05 +0100 Subject: [PATCH] generic: move accepted patch to backport-5.15 The patch adding SFP quirk for MXPD 483II was accepted upstream and will be part of Linux v6.3: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=ad651d68cee75e9ac20002254c4e5d09ee67a84b Move the patch from pending-5.15 to backport-5.15. Signed-off-by: Daniel Golle --- ...k-enabling-2500Base-x-for-HG-MXPD-48.patch | 37 +++++++++++++++++++ .../790-SFP-GE-T-ignore-TX_FAULT.patch | 6 +-- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 target/linux/generic/backport-5.15/789-v6.3-net-sfp-add-quirk-enabling-2500Base-x-for-HG-MXPD-48.patch diff --git a/target/linux/generic/backport-5.15/789-v6.3-net-sfp-add-quirk-enabling-2500Base-x-for-HG-MXPD-48.patch b/target/linux/generic/backport-5.15/789-v6.3-net-sfp-add-quirk-enabling-2500Base-x-for-HG-MXPD-48.patch new file mode 100644 index 000000000..a5a53bbc6 --- /dev/null +++ b/target/linux/generic/backport-5.15/789-v6.3-net-sfp-add-quirk-enabling-2500Base-x-for-HG-MXPD-48.patch @@ -0,0 +1,37 @@ +From ad651d68cee75e9ac20002254c4e5d09ee67a84b Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Sun, 2 Apr 2023 12:44:37 +0100 +Subject: [PATCH] net: sfp: add quirk enabling 2500Base-x for HG MXPD-483II + +The HG MXPD-483II 1310nm SFP module is meant to operate with 2500Base-X, +however, in their EEPROM they incorrectly specify: + Transceiver type : Ethernet: 1000BASE-LX + ... + BR, Nominal : 2600MBd + +Use sfp_quirk_2500basex for this module to allow 2500Base-X mode anyway. + +https://forum.banana-pi.org/t/bpi-r3-sfp-module-compatibility/14573/60 + +Reported-by: chowtom +Tested-by: chowtom +Signed-off-by: Daniel Golle +Reviewed-by: Russell King (Oracle) +Signed-off-by: David S. Miller +--- + drivers/net/phy/sfp.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/net/phy/sfp.c ++++ b/drivers/net/phy/sfp.c +@@ -366,6 +366,10 @@ static const struct sfp_quirk sfp_quirks + .part = "HL-GSFP", + .fixup = sfp_fixup_halny_gsfp, + }, { ++ .vendor = "HG GENUINE", ++ .part = "MXPD-483II", ++ .modes = sfp_quirk_2500basex, ++ }, { + // Huawei MA5671A can operate at 2500base-X, but report 1.2GBd + // NRZ in their EEPROM + .vendor = "HUAWEI", diff --git a/target/linux/generic/hack-5.15/790-SFP-GE-T-ignore-TX_FAULT.patch b/target/linux/generic/hack-5.15/790-SFP-GE-T-ignore-TX_FAULT.patch index 83b2c304e..8ad43c0fe 100644 --- a/target/linux/generic/hack-5.15/790-SFP-GE-T-ignore-TX_FAULT.patch +++ b/target/linux/generic/hack-5.15/790-SFP-GE-T-ignore-TX_FAULT.patch @@ -26,7 +26,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c -@@ -373,6 +373,11 @@ static const struct sfp_quirk sfp_quirks +@@ -377,6 +377,11 @@ static const struct sfp_quirk sfp_quirks .modes = sfp_quirk_2500basex, .fixup = sfp_fixup_ignore_tx_fault, }, { @@ -38,7 +38,7 @@ Signed-off-by: Daniel Golle // Lantech 8330-262D-E can operate at 2500base-X, but // incorrectly report 2500MBd NRZ in their EEPROM .vendor = "Lantech", -@@ -2306,7 +2311,8 @@ static void sfp_sm_main(struct sfp *sfp, +@@ -2310,7 +2315,8 @@ static void sfp_sm_main(struct sfp *sfp, * or t_start_up, so assume there is a fault. */ sfp_sm_fault(sfp, SFP_S_INIT_TX_FAULT, @@ -48,7 +48,7 @@ Signed-off-by: Daniel Golle } else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) { init_done: sfp->sm_phy_retries = R_PHY_RETRY; -@@ -2529,10 +2535,12 @@ static void sfp_check_state(struct sfp * +@@ -2533,10 +2539,12 @@ static void sfp_check_state(struct sfp * mutex_lock(&sfp->st_mutex); state = sfp_get_state(sfp); changed = state ^ sfp->state;