generic: 5.15: move sfp HALNy patch from pending to backport
[openwrt/openwrt.git] / target / linux / generic / backport-5.15 / 786-v6.1-net-sfp-move-Huawei-MA5671A-fixup.patch
1 From 5029be761161374a3624aa7b4670174c35449bf5 Mon Sep 17 00:00:00 2001
2 From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
3 Date: Tue, 13 Sep 2022 20:06:42 +0100
4 Subject: [PATCH 1/1] net: sfp: move Huawei MA5671A fixup
5
6 Move this module over to the new fixup mechanism.
7
8 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
9 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
10 ---
11 drivers/net/phy/sfp.c | 12 +++++++-----
12 1 file changed, 7 insertions(+), 5 deletions(-)
13
14 --- a/drivers/net/phy/sfp.c
15 +++ b/drivers/net/phy/sfp.c
16 @@ -316,6 +316,11 @@ static void sfp_fixup_long_startup(struc
17 sfp->module_t_start_up = T_START_UP_BAD_GPON;
18 }
19
20 +static void sfp_fixup_ignore_tx_fault(struct sfp *sfp)
21 +{
22 + sfp->tx_fault_ignore = true;
23 +}
24 +
25 static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id,
26 unsigned long *modes)
27 {
28 @@ -353,6 +358,7 @@ static const struct sfp_quirk sfp_quirks
29 .vendor = "HUAWEI",
30 .part = "MA5671A",
31 .modes = sfp_quirk_2500basex,
32 + .fixup = sfp_fixup_ignore_tx_fault,
33 }, {
34 // Lantech 8330-262D-E can operate at 2500base-X, but
35 // incorrectly report 2500MBd NRZ in their EEPROM
36 @@ -2049,11 +2055,7 @@ static int sfp_sm_mod_probe(struct sfp *
37
38 sfp->module_t_start_up = T_START_UP;
39
40 - if (!memcmp(id.base.vendor_name, "HUAWEI ", 16) &&
41 - !memcmp(id.base.vendor_pn, "MA5671A ", 16))
42 - sfp->tx_fault_ignore = true;
43 - else
44 - sfp->tx_fault_ignore = false;
45 + sfp->tx_fault_ignore = false;
46
47 sfp->quirk = sfp_lookup_quirk(&id);
48 if (sfp->quirk && sfp->quirk->fixup)