diff options
author | Russell King <linux@armlinux.org.uk> | 2019-11-27 11:45:25 +0000 |
---|---|---|
committer | Jonas Gorski <jonas.gorski@gmail.com> | 2020-01-21 22:32:48 +0100 |
commit | 1c16b574c4f77a30a0268acee30be96ae0dc5948 (patch) | |
tree | 716fd94ee81e332ba19e1af7bf98371120ea1856 /target/linux/generic/backport-4.19/713-v5.2-net-phylink-avoid-reducing-support-mask.patch | |
parent | a07638eb24b8310a35ea6c3b09f6db59bb31cd68 (diff) | |
download | upstream-1c16b574c4f77a30a0268acee30be96ae0dc5948.tar.gz upstream-1c16b574c4f77a30a0268acee30be96ae0dc5948.tar.bz2 upstream-1c16b574c4f77a30a0268acee30be96ae0dc5948.zip |
kernel: add backported phy/phylink/sfp patches
Backport the phy/phylink/sfp patches currently queued in netdev or in
mainline necessary to support GPON popular modules, specifically to
support Huawei and Nokia GPON modules.
Signed-off-by: Russell King <linux@armlinux.org.uk>
[jonas.gorski: include kernel version in file names, refresh patches]
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'target/linux/generic/backport-4.19/713-v5.2-net-phylink-avoid-reducing-support-mask.patch')
-rw-r--r-- | target/linux/generic/backport-4.19/713-v5.2-net-phylink-avoid-reducing-support-mask.patch | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/target/linux/generic/backport-4.19/713-v5.2-net-phylink-avoid-reducing-support-mask.patch b/target/linux/generic/backport-4.19/713-v5.2-net-phylink-avoid-reducing-support-mask.patch new file mode 100644 index 0000000000..3aa8d9e571 --- /dev/null +++ b/target/linux/generic/backport-4.19/713-v5.2-net-phylink-avoid-reducing-support-mask.patch @@ -0,0 +1,84 @@ +From 8ac1d3e5cf7d277769ba3403d99f643fab1e3fae Mon Sep 17 00:00:00 2001 +From: Russell King <rmk+kernel@armlinux.org.uk> +Date: Sat, 23 Nov 2019 14:19:54 +0000 +Subject: [PATCH 611/660] net: phylink: avoid reducing support mask + +Avoid reducing the support mask as a result of the interface type +selected for SFP modules, or when setting the link settings through +ethtool - this should only change when the supported link modes of +the hardware combination change. + +Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> +Signed-off-by: David S. Miller <davem@davemloft.net> +--- + drivers/net/phy/phylink.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -1137,6 +1137,7 @@ EXPORT_SYMBOL_GPL(phylink_ethtool_ksetti + int phylink_ethtool_ksettings_set(struct phylink *pl, + const struct ethtool_link_ksettings *kset) + { ++ __ETHTOOL_DECLARE_LINK_MODE_MASK(support); + struct ethtool_link_ksettings our_kset; + struct phylink_link_state config; + int ret; +@@ -1147,11 +1148,12 @@ int phylink_ethtool_ksettings_set(struct + kset->base.autoneg != AUTONEG_ENABLE) + return -EINVAL; + ++ linkmode_copy(support, pl->supported); + config = pl->link_config; + + /* Mask out unsupported advertisements */ + linkmode_and(config.advertising, kset->link_modes.advertising, +- pl->supported); ++ support); + + /* FIXME: should we reject autoneg if phy/mac does not support it? */ + if (kset->base.autoneg == AUTONEG_DISABLE) { +@@ -1161,7 +1163,7 @@ int phylink_ethtool_ksettings_set(struct + * duplex. + */ + s = phy_lookup_setting(kset->base.speed, kset->base.duplex, +- pl->supported, ++ support, + __ETHTOOL_LINK_MODE_MASK_NBITS, false); + if (!s) + return -EINVAL; +@@ -1191,7 +1193,7 @@ int phylink_ethtool_ksettings_set(struct + __set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, config.advertising); + } + +- if (phylink_validate(pl, pl->supported, &config)) ++ if (phylink_validate(pl, support, &config)) + return -EINVAL; + + /* If autonegotiation is enabled, we must have an advertisement */ +@@ -1633,6 +1635,7 @@ static int phylink_sfp_module_insert(voi + { + struct phylink *pl = upstream; + __ETHTOOL_DECLARE_LINK_MODE_MASK(support) = { 0, }; ++ __ETHTOOL_DECLARE_LINK_MODE_MASK(support1); + struct phylink_link_state config; + phy_interface_t iface; + int ret = 0; +@@ -1660,6 +1663,8 @@ static int phylink_sfp_module_insert(voi + return ret; + } + ++ linkmode_copy(support1, support); ++ + iface = sfp_select_interface(pl->sfp_bus, id, config.advertising); + if (iface == PHY_INTERFACE_MODE_NA) { + netdev_err(pl->netdev, +@@ -1669,7 +1674,7 @@ static int phylink_sfp_module_insert(voi + } + + config.interface = iface; +- ret = phylink_validate(pl, support, &config); ++ ret = phylink_validate(pl, support1, &config); + if (ret) { + netdev_err(pl->netdev, "validation of %s/%s with support %*pb failed: %d\n", + phylink_an_mode_str(MLO_AN_INBAND), |