kernel: sfp: add Nokia SFP fix from net-next
[openwrt/staging/wigyori.git] / target / linux / generic / pending-4.19 / 740-net-sfp-remove-incomplete-100BASE-FX-and-100BASE-LX-.patch
1 From 29cd215aaf6c2050c43e4de03aee436c16f90b96 Mon Sep 17 00:00:00 2001
2 From: Russell King <rmk+kernel@armlinux.org.uk>
3 Date: Thu, 21 Nov 2019 17:27:14 +0000
4 Subject: [PATCH 643/660] net: sfp: remove incomplete 100BASE-FX and 100BASE-LX
5 support
6
7 The 100BASE-FX and 100BASE-LX support assumes a PHY is present; this
8 is probably an incorrect assumption. In any case, sfp_parse_support()
9 will fail such a module. Let's stop pretending we support these
10 modules.
11
12 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
13 ---
14 drivers/net/phy/sfp-bus.c | 4 +---
15 drivers/net/phy/sfp.c | 13 +------------
16 2 files changed, 2 insertions(+), 15 deletions(-)
17
18 --- a/drivers/net/phy/sfp-bus.c
19 +++ b/drivers/net/phy/sfp-bus.c
20 @@ -341,9 +341,7 @@ phy_interface_t sfp_select_interface(str
21 if (phylink_test(link_modes, 2500baseX_Full))
22 return PHY_INTERFACE_MODE_2500BASEX;
23
24 - if (id->base.e1000_base_t ||
25 - id->base.e100_base_lx ||
26 - id->base.e100_base_fx)
27 + if (id->base.e1000_base_t)
28 return PHY_INTERFACE_MODE_SGMII;
29
30 if (phylink_test(link_modes, 1000baseX_Full))
31 --- a/drivers/net/phy/sfp.c
32 +++ b/drivers/net/phy/sfp.c
33 @@ -1424,18 +1424,7 @@ static void sfp_sm_fault(struct sfp *sfp
34
35 static void sfp_sm_probe_for_phy(struct sfp *sfp)
36 {
37 - /* Setting the serdes link mode is guesswork: there's no
38 - * field in the EEPROM which indicates what mode should
39 - * be used.
40 - *
41 - * If it's a gigabit-only fiber module, it probably does
42 - * not have a PHY, so switch to 802.3z negotiation mode.
43 - * Otherwise, switch to SGMII mode (which is required to
44 - * support non-gigabit speeds) and probe for a PHY.
45 - */
46 - if (sfp->id.base.e1000_base_t ||
47 - sfp->id.base.e100_base_lx ||
48 - sfp->id.base.e100_base_fx)
49 + if (sfp->id.base.e1000_base_t)
50 sfp_sm_probe_phy(sfp);
51 }
52