kernel: bump 5.15 to 5.15.116
[openwrt/openwrt.git] / target / linux / generic / backport-5.15 / 785-v6.1-net-sfp-move-Alcatel-Lucent-3FE46541AA-fixup.patch
1 From 275416754e9a262c97a1ad6f806a4bc6e0464aa2 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:37 +0100
4 Subject: [PATCH 1/1] net: sfp: move Alcatel Lucent 3FE46541AA fixup
5
6 Add a new fixup mechanism to the SFP quirks, and use it for this
7 module.
8
9 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
10 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
11 ---
12 drivers/net/phy/sfp.c | 14 +++++++++-----
13 drivers/net/phy/sfp.h | 1 +
14 2 files changed, 10 insertions(+), 5 deletions(-)
15
16 --- a/drivers/net/phy/sfp.c
17 +++ b/drivers/net/phy/sfp.c
18 @@ -317,6 +317,11 @@ static const struct of_device_id sfp_of_
19 };
20 MODULE_DEVICE_TABLE(of, sfp_of_match);
21
22 +static void sfp_fixup_long_startup(struct sfp *sfp)
23 +{
24 + sfp->module_t_start_up = T_START_UP_BAD_GPON;
25 +}
26 +
27 static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id,
28 unsigned long *modes)
29 {
30 @@ -347,6 +352,7 @@ static const struct sfp_quirk sfp_quirks
31 .vendor = "ALCATELLUCENT",
32 .part = "3FE46541AA",
33 .modes = sfp_quirk_2500basex,
34 + .fixup = sfp_fixup_long_startup,
35 }, {
36 // Huawei MA5671A can operate at 2500base-X, but report 1.2GBd
37 // NRZ in their EEPROM
38 @@ -2043,11 +2049,7 @@ static int sfp_sm_mod_probe(struct sfp *
39 if (sfp->gpio[GPIO_LOS])
40 sfp->state_hw_mask |= SFP_F_LOS;
41
42 - if (!memcmp(id.base.vendor_name, "ALCATELLUCENT ", 16) &&
43 - !memcmp(id.base.vendor_pn, "3FE46541AA ", 16))
44 - sfp->module_t_start_up = T_START_UP_BAD_GPON;
45 - else
46 - sfp->module_t_start_up = T_START_UP;
47 + sfp->module_t_start_up = T_START_UP;
48
49 if (!memcmp(id.base.vendor_name, "HUAWEI ", 16) &&
50 !memcmp(id.base.vendor_pn, "MA5671A ", 16))
51 @@ -2056,6 +2058,8 @@ static int sfp_sm_mod_probe(struct sfp *
52 sfp->tx_fault_ignore = false;
53
54 sfp->quirk = sfp_lookup_quirk(&id);
55 + if (sfp->quirk && sfp->quirk->fixup)
56 + sfp->quirk->fixup(sfp);
57
58 return 0;
59 }
60 --- a/drivers/net/phy/sfp.h
61 +++ b/drivers/net/phy/sfp.h
62 @@ -10,6 +10,7 @@ struct sfp_quirk {
63 const char *vendor;
64 const char *part;
65 void (*modes)(const struct sfp_eeprom_id *id, unsigned long *modes);
66 + void (*fixup)(struct sfp *sfp);
67 };
68
69 struct sfp_socket_ops {