aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSalvatore Bonaccorso <carnil@debian.org>2021-11-03 15:06:54 +0100
committerSalvatore Bonaccorso <carnil@debian.org>2021-11-03 15:07:08 +0100
commit8c440112a20b3cb5c164b444ba90cc24e2aebd42 (patch)
tree2aa275d7aa1d96ad73ed1a00197b12f28a0f51c6
parentaf4eeb500fe058ee8ced5f91c302665deb77d3e5 (diff)
downloadkernel_replicant_linux-8c440112a20b3cb5c164b444ba90cc24e2aebd42.tar.gz
kernel_replicant_linux-8c440112a20b3cb5c164b444ba90cc24e2aebd42.tar.bz2
kernel_replicant_linux-8c440112a20b3cb5c164b444ba90cc24e2aebd42.zip
sfc: Fix reading non-legacy supported link modes
-rw-r--r--debian/changelog1
-rw-r--r--debian/patches/bugfix/all/sfc-Fix-reading-non-legacy-supported-link-modes.patch50
-rw-r--r--debian/patches/series1
3 files changed, 52 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 0d47e4868346..c1ae6019b3a4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -402,6 +402,7 @@ linux (5.14.16-1) UNRELEASED; urgency=medium
* [x86] media: ite-cir: IR receiver stop working after receive overflow
(Closes: #996672)
* scsi: core: Put LLD module refcnt after SCSI device is released
+ * sfc: Fix reading non-legacy supported link modes
-- Salvatore Bonaccorso <carnil@debian.org> Fri, 22 Oct 2021 08:51:00 +0200
diff --git a/debian/patches/bugfix/all/sfc-Fix-reading-non-legacy-supported-link-modes.patch b/debian/patches/bugfix/all/sfc-Fix-reading-non-legacy-supported-link-modes.patch
new file mode 100644
index 000000000000..29db50be25ea
--- /dev/null
+++ b/debian/patches/bugfix/all/sfc-Fix-reading-non-legacy-supported-link-modes.patch
@@ -0,0 +1,50 @@
+From: Erik Ekman <erik@kryo.se>
+Date: Sun, 17 Oct 2021 19:16:57 +0200
+Subject: sfc: Fix reading non-legacy supported link modes
+Origin: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit?id=05aac25fbf06b72c87bc5126e210714dcaac404e
+
+commit 041c61488236a5a84789083e3d9f0a51139b6edf upstream.
+
+Everything except the first 32 bits was lost when the pause flags were
+added. This makes the 50000baseCR2 mode flag (bit 34) not appear.
+
+I have tested this with a 10G card (SFN5122F-R7) by modifying it to
+return a non-legacy link mode (10000baseCR).
+
+Signed-off-by: Erik Ekman <erik@kryo.se>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/sfc/ethtool_common.c | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/net/ethernet/sfc/ethtool_common.c b/drivers/net/ethernet/sfc/ethtool_common.c
+index bf1443539a1a..bd552c7dffcb 100644
+--- a/drivers/net/ethernet/sfc/ethtool_common.c
++++ b/drivers/net/ethernet/sfc/ethtool_common.c
+@@ -563,20 +563,14 @@ int efx_ethtool_get_link_ksettings(struct net_device *net_dev,
+ {
+ struct efx_nic *efx = netdev_priv(net_dev);
+ struct efx_link_state *link_state = &efx->link_state;
+- u32 supported;
+
+ mutex_lock(&efx->mac_lock);
+ efx_mcdi_phy_get_link_ksettings(efx, cmd);
+ mutex_unlock(&efx->mac_lock);
+
+ /* Both MACs support pause frames (bidirectional and respond-only) */
+- ethtool_convert_link_mode_to_legacy_u32(&supported,
+- cmd->link_modes.supported);
+-
+- supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
+-
+- ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
+- supported);
++ ethtool_link_ksettings_add_link_mode(cmd, supported, Pause);
++ ethtool_link_ksettings_add_link_mode(cmd, supported, Asym_Pause);
+
+ if (LOOPBACK_INTERNAL(efx)) {
+ cmd->base.speed = link_state->speed;
+--
+2.33.1
+
diff --git a/debian/patches/series b/debian/patches/series
index 732b8f850846..57f3c1dd2a9f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -92,6 +92,7 @@ bugfix/all/HID-apple-Add-missing-scan-code-event-for-keys-handl.patch
bugfix/all/media-ir-kbd-i2c-improve-responsiveness-of-hauppauge.patch
bugfix/all/media-ite-cir-IR-receiver-stop-working-after-receive.patch
bugfix/all/scsi-core-Put-LLD-module-refcnt-after-SCSI-device-is.patch
+bugfix/all/sfc-Fix-reading-non-legacy-supported-link-modes.patch
# Miscellaneous features