]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Oct 2024 12:57:58 +0000 (14:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Oct 2024 12:57:58 +0000 (14:57 +0200)
added patches:
e1000e-fix-force-smbus-during-suspend-flow.patch
net-ethernet-cortina-restore-tso-support.patch
scsi-revert-scsi-sd-do-not-repeat-the-starting-disk-message.patch

queue-6.6/e1000e-fix-force-smbus-during-suspend-flow.patch [new file with mode: 0644]
queue-6.6/net-ethernet-cortina-restore-tso-support.patch [new file with mode: 0644]
queue-6.6/scsi-revert-scsi-sd-do-not-repeat-the-starting-disk-message.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/e1000e-fix-force-smbus-during-suspend-flow.patch b/queue-6.6/e1000e-fix-force-smbus-during-suspend-flow.patch
new file mode 100644 (file)
index 0000000..80f837b
--- /dev/null
@@ -0,0 +1,135 @@
+From 76a0a3f9cc2fbd0e56671706bb74a9a988397898 Mon Sep 17 00:00:00 2001
+From: Vitaly Lifshits <vitaly.lifshits@intel.com>
+Date: Tue, 9 Jul 2024 13:31:22 -0700
+Subject: e1000e: fix force smbus during suspend flow
+
+From: Vitaly Lifshits <vitaly.lifshits@intel.com>
+
+commit 76a0a3f9cc2fbd0e56671706bb74a9a988397898 upstream.
+
+Commit 861e8086029e ("e1000e: move force SMBUS from enable ulp function
+to avoid PHY loss issue") resolved a PHY access loss during suspend on
+Meteor Lake consumer platforms, but it affected corporate systems
+incorrectly.
+
+A better fix, working for both consumer and corporate systems, was
+proposed in commit bfd546a552e1 ("e1000e: move force SMBUS near the end
+of enable_ulp function"). However, it introduced a regression on older
+devices, such as [8086:15B8], [8086:15F9], [8086:15BE].
+
+This patch aims to fix the secondary regression, by limiting the scope of
+the changes to Meteor Lake platforms only.
+
+Fixes: bfd546a552e1 ("e1000e: move force SMBUS near the end of enable_ulp function")
+Reported-by: Todd Brandt <todd.e.brandt@intel.com>
+Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218940
+Reported-by: Dieter Mummenschanz <dmummenschanz@web.de>
+Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218936
+Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
+Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com> (A Contingent Worker at Intel)
+Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
+Reviewed-by: Simon Horman <horms@kernel.org>
+Link: https://patch.msgid.link/20240709203123.2103296-1-anthony.l.nguyen@intel.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/intel/e1000e/ich8lan.c |   73 ++++++++++++++++++++--------
+ 1 file changed, 53 insertions(+), 20 deletions(-)
+
+--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
++++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
+@@ -1109,6 +1109,46 @@ static s32 e1000_platform_pm_pch_lpt(str
+ }
+ /**
++ *  e1000e_force_smbus - Force interfaces to transition to SMBUS mode.
++ *  @hw: pointer to the HW structure
++ *
++ *  Force the MAC and the PHY to SMBUS mode. Assumes semaphore already
++ *  acquired.
++ *
++ * Return: 0 on success, negative errno on failure.
++ **/
++static s32 e1000e_force_smbus(struct e1000_hw *hw)
++{
++      u16 smb_ctrl = 0;
++      u32 ctrl_ext;
++      s32 ret_val;
++
++      /* Switching PHY interface always returns MDI error
++       * so disable retry mechanism to avoid wasting time
++       */
++      e1000e_disable_phy_retry(hw);
++
++      /* Force SMBus mode in the PHY */
++      ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &smb_ctrl);
++      if (ret_val) {
++              e1000e_enable_phy_retry(hw);
++              return ret_val;
++      }
++
++      smb_ctrl |= CV_SMB_CTRL_FORCE_SMBUS;
++      e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, smb_ctrl);
++
++      e1000e_enable_phy_retry(hw);
++
++      /* Force SMBus mode in the MAC */
++      ctrl_ext = er32(CTRL_EXT);
++      ctrl_ext |= E1000_CTRL_EXT_FORCE_SMBUS;
++      ew32(CTRL_EXT, ctrl_ext);
++
++      return 0;
++}
++
++/**
+  *  e1000_enable_ulp_lpt_lp - configure Ultra Low Power mode for LynxPoint-LP
+  *  @hw: pointer to the HW structure
+  *  @to_sx: boolean indicating a system power state transition to Sx
+@@ -1165,6 +1205,14 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000
+       if (ret_val)
+               goto out;
++      if (hw->mac.type != e1000_pch_mtp) {
++              ret_val = e1000e_force_smbus(hw);
++              if (ret_val) {
++                      e_dbg("Failed to force SMBUS: %d\n", ret_val);
++                      goto release;
++              }
++      }
++
+       /* Si workaround for ULP entry flow on i127/rev6 h/w.  Enable
+        * LPLU and disable Gig speed when entering ULP
+        */
+@@ -1225,27 +1273,12 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000
+       }
+ release:
+-      /* Switching PHY interface always returns MDI error
+-       * so disable retry mechanism to avoid wasting time
+-       */
+-      e1000e_disable_phy_retry(hw);
+-
+-      /* Force SMBus mode in PHY */
+-      ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
+-      if (ret_val) {
+-              e1000e_enable_phy_retry(hw);
+-              hw->phy.ops.release(hw);
+-              goto out;
++      if (hw->mac.type == e1000_pch_mtp) {
++              ret_val = e1000e_force_smbus(hw);
++              if (ret_val)
++                      e_dbg("Failed to force SMBUS over MTL system: %d\n",
++                            ret_val);
+       }
+-      phy_reg |= CV_SMB_CTRL_FORCE_SMBUS;
+-      e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
+-
+-      e1000e_enable_phy_retry(hw);
+-
+-      /* Force SMBus mode in MAC */
+-      mac_reg = er32(CTRL_EXT);
+-      mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS;
+-      ew32(CTRL_EXT, mac_reg);
+       hw->phy.ops.release(hw);
+ out:
diff --git a/queue-6.6/net-ethernet-cortina-restore-tso-support.patch b/queue-6.6/net-ethernet-cortina-restore-tso-support.patch
new file mode 100644 (file)
index 0000000..4f058bb
--- /dev/null
@@ -0,0 +1,130 @@
+From 2942dfab630444d46aaa37fb7d629b620abbf6ba Mon Sep 17 00:00:00 2001
+From: Linus Walleij <linus.walleij@linaro.org>
+Date: Mon, 27 May 2024 21:26:44 +0200
+Subject: net: ethernet: cortina: Restore TSO support
+
+From: Linus Walleij <linus.walleij@linaro.org>
+
+commit 2942dfab630444d46aaa37fb7d629b620abbf6ba upstream.
+
+An earlier commit deleted the TSO support in the Cortina Gemini
+driver because the driver was confusing gso_size and MTU,
+probably because what the Linux kernel calls "gso_size" was
+called "MTU" in the datasheet.
+
+Restore the functionality properly reading the gso_size from
+the skbuff.
+
+Tested with iperf3, running a server on a different machine
+and client on the device with the cortina gemini ethernet:
+
+Connecting to host 192.168.1.2, port 5201
+60008000.ethernet-port eth0: segment offloading mss = 05ea len=1c8a
+60008000.ethernet-port eth0: segment offloading mss = 05ea len=1c8a
+60008000.ethernet-port eth0: segment offloading mss = 05ea len=27da
+60008000.ethernet-port eth0: segment offloading mss = 05ea len=0b92
+60008000.ethernet-port eth0: segment offloading mss = 05ea len=2bda
+(...)
+
+(The hardware MSS 0x05ea here includes the ethernet headers.)
+
+If I disable all segment offloading on the receiving host and
+dump packets using tcpdump -xx like this:
+
+ethtool -K enp2s0 gro off gso off tso off
+tcpdump -xx -i enp2s0 host 192.168.1.136
+
+I get segmented packages such as this when running iperf3:
+
+23:16:54.024139 IP OpenWrt.lan.59168 > Fecusia.targus-getdata1:
+Flags [.], seq 1486:2934, ack 1, win 4198,
+options [nop,nop,TS val 3886192908 ecr 3601341877], length 1448
+0x0000:  fc34 9701 a0c6 14d6 4da8 3c4f 0800 4500
+0x0010:  05dc 16a0 4000 4006 9aa1 c0a8 0188 c0a8
+0x0020:  0102 e720 1451 ff25 9822 4c52 29cf 8010
+0x0030:  1066 ac8c 0000 0101 080a e7a2 990c d6a8
+(...)
+0x05c0:  5e49 e109 fe8c 4617 5e18 7a82 7eae d647
+0x05d0:  e8ee ae64 dc88 c897 3f8a 07a4 3a33 6b1b
+0x05e0:  3501 a30f 2758 cc44 4b4a
+
+Several such packets often follow after each other verifying
+the segmentation into 0x05a8 (1448) byte packages also on the
+reveiving end. As can be seen, the ethernet frames are
+0x05ea (1514) in size.
+
+Performance with iperf3 before this patch: ~15.5 Mbit/s
+Performance with iperf3 after this patch: ~175 Mbit/s
+
+This was running a 60 second test (twice) the best measurement
+was 179 Mbit/s.
+
+For comparison if I run iperf3 with UDP I get around 1.05 Mbit/s
+both before and after this patch.
+
+While this is a gigabit ethernet interface, the CPU is a cheap
+D-Link DIR-685 router (based on the ARMv5 Faraday FA526 at
+~50 MHz), and the software is not supposed to drive traffic,
+as the device has a DSA chip, so this kind of numbers can be
+expected.
+
+Fixes: ac631873c9e7 ("net: ethernet: cortina: Drop TSO support")
+Reviewed-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/cortina/gemini.c |   23 +++++++++++++++++++----
+ 1 file changed, 19 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/cortina/gemini.c
++++ b/drivers/net/ethernet/cortina/gemini.c
+@@ -79,7 +79,8 @@ MODULE_PARM_DESC(debug, "Debug level (0=
+ #define GMAC0_IRQ4_8 (GMAC0_MIB_INT_BIT | GMAC0_RX_OVERRUN_INT_BIT)
+ #define GMAC_OFFLOAD_FEATURES (NETIF_F_SG | NETIF_F_IP_CSUM | \
+-                             NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM)
++                             NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM | \
++                             NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
+ /**
+  * struct gmac_queue_page - page buffer per-page info
+@@ -1148,13 +1149,25 @@ static int gmac_map_tx_bufs(struct net_d
+       skb_frag_t *skb_frag;
+       dma_addr_t mapping;
+       void *buffer;
++      u16 mss;
+       int ret;
+-      /* TODO: implement proper TSO using MTU in word3 */
+       word1 = skb->len;
+       word3 = SOF_BIT;
+-      if (skb->len >= ETH_FRAME_LEN) {
++      mss = skb_shinfo(skb)->gso_size;
++      if (mss) {
++              /* This means we are dealing with TCP and skb->len is the
++               * sum total of all the segments. The TSO will deal with
++               * chopping this up for us.
++               */
++              /* The accelerator needs the full frame size here */
++              mss += skb_tcp_all_headers(skb);
++              netdev_dbg(netdev, "segment offloading mss = %04x len=%04x\n",
++                         mss, skb->len);
++              word1 |= TSS_MTU_ENABLE_BIT;
++              word3 |= mss;
++      } else if (skb->len >= ETH_FRAME_LEN) {
+               /* Hardware offloaded checksumming isn't working on frames
+                * bigger than 1514 bytes. A hypothesis about this is that the
+                * checksum buffer is only 1518 bytes, so when the frames get
+@@ -1169,7 +1182,9 @@ static int gmac_map_tx_bufs(struct net_d
+                               return ret;
+               }
+               word1 |= TSS_BYPASS_BIT;
+-      } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
++      }
++
++      if (skb->ip_summed == CHECKSUM_PARTIAL) {
+               int tcp = 0;
+               /* We do not switch off the checksumming on non TCP/UDP
diff --git a/queue-6.6/scsi-revert-scsi-sd-do-not-repeat-the-starting-disk-message.patch b/queue-6.6/scsi-revert-scsi-sd-do-not-repeat-the-starting-disk-message.patch
new file mode 100644 (file)
index 0000000..f16165f
--- /dev/null
@@ -0,0 +1,70 @@
+From da3e19ef0b3de0aa4b25595bdc214c02a04f19b8 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan+linaro@kernel.org>
+Date: Tue, 16 Jul 2024 18:11:01 +0200
+Subject: scsi: Revert "scsi: sd: Do not repeat the starting disk message"
+
+From: Johan Hovold <johan+linaro@kernel.org>
+
+commit da3e19ef0b3de0aa4b25595bdc214c02a04f19b8 upstream.
+
+This reverts commit 7a6bbc2829d4ab592c7e440a6f6f5deb3cd95db4.
+
+The offending commit tried to suppress a double "Starting disk" message for
+some drivers, but instead started spamming the log with bogus messages
+every five seconds:
+
+       [  311.798956] sd 0:0:0:0: [sda] Starting disk
+       [  316.919103] sd 0:0:0:0: [sda] Starting disk
+       [  322.040775] sd 0:0:0:0: [sda] Starting disk
+       [  327.161140] sd 0:0:0:0: [sda] Starting disk
+       [  332.281352] sd 0:0:0:0: [sda] Starting disk
+       [  337.401878] sd 0:0:0:0: [sda] Starting disk
+       [  342.521527] sd 0:0:0:0: [sda] Starting disk
+       [  345.850401] sd 0:0:0:0: [sda] Starting disk
+       [  350.967132] sd 0:0:0:0: [sda] Starting disk
+       [  356.090454] sd 0:0:0:0: [sda] Starting disk
+       ...
+
+on machines that do not actually stop the disk on runtime suspend (e.g.
+the Qualcomm sc8280xp CRD with UFS).
+
+Let's just revert for now to address the regression.
+
+Fixes: 7a6bbc2829d4 ("scsi: sd: Do not repeat the starting disk message")
+Cc: stable@vger.kernel.org
+Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
+Link: https://lore.kernel.org/r/20240716161101.30692-1-johan+linaro@kernel.org
+Reviewed-by: Bart Van Assche <bvanassche@acm.org>
+Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/sd.c |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/scsi/sd.c
++++ b/drivers/scsi/sd.c
+@@ -3955,6 +3955,8 @@ static int sd_resume(struct device *dev)
+ {
+       struct scsi_disk *sdkp = dev_get_drvdata(dev);
++      sd_printk(KERN_NOTICE, sdkp, "Starting disk\n");
++
+       if (opal_unlock_from_suspend(sdkp->opal_dev)) {
+               sd_printk(KERN_NOTICE, sdkp, "OPAL unlock failed\n");
+               return -EIO;
+@@ -3971,13 +3973,12 @@ static int sd_resume_common(struct devic
+       if (!sdkp)      /* E.g.: runtime resume at the start of sd_probe() */
+               return 0;
+-      sd_printk(KERN_NOTICE, sdkp, "Starting disk\n");
+-
+       if (!sd_do_start_stop(sdkp->device, runtime)) {
+               sdkp->suspended = false;
+               return 0;
+       }
++      sd_printk(KERN_NOTICE, sdkp, "Starting disk\n");
+       ret = sd_start_stop_device(sdkp, 1);
+       if (!ret) {
+               sd_resume(dev);
index 93ec498c61f0254a327032f391caaaa94ffd7c84..50cf29dd349d364ad338132b8707576fd3808b87 100644 (file)
@@ -208,3 +208,6 @@ btrfs-split-remaining-space-to-discard-in-chunks.patch
 kthread-unpark-only-parked-kthread.patch
 fs-proc-kcore.c-allow-translation-of-physical-memory-addresses.patch
 secretmem-disable-memfd_secret-if-arch-cannot-set-direct-map.patch
+net-ethernet-cortina-restore-tso-support.patch
+e1000e-fix-force-smbus-during-suspend-flow.patch
+scsi-revert-scsi-sd-do-not-repeat-the-starting-disk-message.patch