Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-05-17 06:38:43 +0200
committerJiri Slaby <jslaby@suse.cz>2019-05-17 06:38:51 +0200
commit1193d2eca279527d19560119cce33359a1094098 (patch)
treef0212d4b01d35e562dfc71e266aba0702413534c
parentfe43b681f65a72d1635bfe88ee5e8af49c971bd3 (diff)
net: phy: fix phy_validate_pause (bnc#1012628).
-rw-r--r--patches.kernel.org/5.1.3-031-net-phy-fix-phy_validate_pause.patch55
-rw-r--r--series.conf1
2 files changed, 56 insertions, 0 deletions
diff --git a/patches.kernel.org/5.1.3-031-net-phy-fix-phy_validate_pause.patch b/patches.kernel.org/5.1.3-031-net-phy-fix-phy_validate_pause.patch
new file mode 100644
index 0000000000..112edd8002
--- /dev/null
+++ b/patches.kernel.org/5.1.3-031-net-phy-fix-phy_validate_pause.patch
@@ -0,0 +1,55 @@
+From: Heiner Kallweit <hkallweit1@gmail.com>
+Date: Wed, 1 May 2019 21:54:28 +0200
+Subject: [PATCH] net: phy: fix phy_validate_pause
+References: bnc#1012628
+Patch-mainline: 5.1.3
+Git-commit: b4010af981ac8cdf1f7f58eb6b131c482e5dee02
+
+[ Upstream commit b4010af981ac8cdf1f7f58eb6b131c482e5dee02 ]
+
+We have valid scenarios where ETHTOOL_LINK_MODE_Pause_BIT doesn't
+need to be supported. Therefore extend the first check to check
+for rx_pause being set.
+
+See also phy_set_asym_pause:
+rx=0 and tx=1: advertise asym pause only
+rx=0 and tx=0: stop advertising both pause modes
+
+The fixed commit isn't wrong, it's just the one that introduced the
+linkmode bitmaps.
+
+Fixes: 3c1bcc8614db ("net: ethernet: Convert phydev advertize and supported from u32 to link mode")
+Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/net/phy/phy_device.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
+index 77068c545de0..cd5966b0db57 100644
+--- a/drivers/net/phy/phy_device.c
++++ b/drivers/net/phy/phy_device.c
+@@ -2044,11 +2044,14 @@ bool phy_validate_pause(struct phy_device *phydev,
+ struct ethtool_pauseparam *pp)
+ {
+ if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
+- phydev->supported) ||
+- (!linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
+- phydev->supported) &&
+- pp->rx_pause != pp->tx_pause))
++ phydev->supported) && pp->rx_pause)
+ return false;
++
++ if (!linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
++ phydev->supported) &&
++ pp->rx_pause != pp->tx_pause)
++ return false;
++
+ return true;
+ }
+ EXPORT_SYMBOL(phy_validate_pause);
+--
+2.21.0
+
diff --git a/series.conf b/series.conf
index 872e8678e7..bd40ea3105 100644
--- a/series.conf
+++ b/series.conf
@@ -116,6 +116,7 @@
patches.kernel.org/5.1.3-028-vrf-sit-mtu-should-not-be-updated-when-vrf-netd.patch
patches.kernel.org/5.1.3-029-tuntap-fix-dividing-by-zero-in-ebpf-queue-selec.patch
patches.kernel.org/5.1.3-030-tuntap-synchronize-through-tfiles-array-instead.patch
+ patches.kernel.org/5.1.3-031-net-phy-fix-phy_validate_pause.patch
########################################################
# Build fixes that apply to the vanilla kernel too.