]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Sep 2021 11:02:21 +0000 (13:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Sep 2021 11:02:21 +0000 (13:02 +0200)
added patches:
edac-synopsys-fix-wrong-value-type-assignment-for-edac_mode.patch
thermal-drivers-int340x-do-not-set-a-wrong-tcc-offset-on-resume.patch

queue-5.4/edac-synopsys-fix-wrong-value-type-assignment-for-edac_mode.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/thermal-drivers-int340x-do-not-set-a-wrong-tcc-offset-on-resume.patch [new file with mode: 0644]

diff --git a/queue-5.4/edac-synopsys-fix-wrong-value-type-assignment-for-edac_mode.patch b/queue-5.4/edac-synopsys-fix-wrong-value-type-assignment-for-edac_mode.patch
new file mode 100644 (file)
index 0000000..df1dbe8
--- /dev/null
@@ -0,0 +1,39 @@
+From 5297cfa6bdf93e3889f78f9b482e2a595a376083 Mon Sep 17 00:00:00 2001
+From: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
+Date: Wed, 18 Aug 2021 12:53:14 +0530
+Subject: EDAC/synopsys: Fix wrong value type assignment for edac_mode
+
+From: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
+
+commit 5297cfa6bdf93e3889f78f9b482e2a595a376083 upstream.
+
+dimm->edac_mode contains values of type enum edac_type - not the
+corresponding capability flags. Fix that.
+
+Issue caught by Coverity check "enumerated type mixed with another
+type."
+
+ [ bp: Rewrite commit message, add tags. ]
+
+Fixes: ae9b56e3996d ("EDAC, synps: Add EDAC support for zynq ddr ecc controller")
+Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
+Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Cc: <stable@vger.kernel.org>
+Link: https://lkml.kernel.org/r/20210818072315.15149-1-shubhrajyoti.datta@xilinx.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/edac/synopsys_edac.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/edac/synopsys_edac.c
++++ b/drivers/edac/synopsys_edac.c
+@@ -782,7 +782,7 @@ static void init_csrows(struct mem_ctl_i
+               for (j = 0; j < csi->nr_channels; j++) {
+                       dimm            = csi->channels[j]->dimm;
+-                      dimm->edac_mode = EDAC_FLAG_SECDED;
++                      dimm->edac_mode = EDAC_SECDED;
+                       dimm->mtype     = p_data->get_mtype(priv->baseaddr);
+                       dimm->nr_pages  = (size >> PAGE_SHIFT) / csi->nr_channels;
+                       dimm->grain     = SYNPS_EDAC_ERR_GRAIN;
index 5815c826ae1b8a2d3c3d3a2eb8239783a7f47d1f..997257391a93d07d4fe63537f93f2983b4610bc4 100644 (file)
@@ -61,3 +61,5 @@ arm64-mark-__stack_chk_guard-as-__ro_after_init.patch
 alpha-declare-virt_to_phys-and-virt_to_bus-parameter.patch
 net-6pack-fix-tx-timeout-and-slot-time.patch
 spi-fix-tegra20-build-with-config_pm-n.patch
+edac-synopsys-fix-wrong-value-type-assignment-for-edac_mode.patch
+thermal-drivers-int340x-do-not-set-a-wrong-tcc-offset-on-resume.patch
diff --git a/queue-5.4/thermal-drivers-int340x-do-not-set-a-wrong-tcc-offset-on-resume.patch b/queue-5.4/thermal-drivers-int340x-do-not-set-a-wrong-tcc-offset-on-resume.patch
new file mode 100644 (file)
index 0000000..9313a13
--- /dev/null
@@ -0,0 +1,68 @@
+From 8b4bd256674720709a9d858a219fcac6f2f253b5 Mon Sep 17 00:00:00 2001
+From: Antoine Tenart <atenart@kernel.org>
+Date: Thu, 9 Sep 2021 10:56:12 +0200
+Subject: thermal/drivers/int340x: Do not set a wrong tcc offset on resume
+
+From: Antoine Tenart <atenart@kernel.org>
+
+commit 8b4bd256674720709a9d858a219fcac6f2f253b5 upstream.
+
+After upgrading to Linux 5.13.3 I noticed my laptop would shutdown due
+to overheat (when it should not). It turned out this was due to commit
+fe6a6de6692e ("thermal/drivers/int340x/processor_thermal: Fix tcc setting").
+
+What happens is this drivers uses a global variable to keep track of the
+tcc offset (tcc_offset_save) and uses it on resume. The issue is this
+variable is initialized to 0, but is only set in
+tcc_offset_degree_celsius_store, i.e. when the tcc offset is explicitly
+set by userspace. If that does not happen, the resume path will set the
+offset to 0 (in my case the h/w default being 3, the offset would become
+too low after a suspend/resume cycle).
+
+The issue did not arise before commit fe6a6de6692e, as the function
+setting the offset would return if the offset was 0. This is no longer
+the case (rightfully).
+
+Fix this by not applying the offset if it wasn't saved before, reverting
+back to the old logic. A better approach will come later, but this will
+be easier to apply to stable kernels.
+
+The logic to restore the offset after a resume was there long before
+commit fe6a6de6692e, but as a value of 0 was considered invalid I'm
+referencing the commit that made the issue possible in the Fixes tag
+instead.
+
+Fixes: fe6a6de6692e ("thermal/drivers/int340x/processor_thermal: Fix tcc setting")
+Cc: stable@vger.kernel.org
+Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+Signed-off-by: Antoine Tenart <atenart@kernel.org>
+Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
+Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+Tested-by: Srinivas Pandruvada <srinivas.pI andruvada@linux.intel.com>
+Link: https://lore.kernel.org/r/20210909085613.5577-2-atenart@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/thermal/intel/int340x_thermal/processor_thermal_device.c |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
++++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
+@@ -179,7 +179,7 @@ static int tcc_offset_update(unsigned in
+       return 0;
+ }
+-static unsigned int tcc_offset_save;
++static int tcc_offset_save = -1;
+ static ssize_t tcc_offset_degree_celsius_store(struct device *dev,
+                               struct device_attribute *attr, const char *buf,
+@@ -703,7 +703,8 @@ static int proc_thermal_resume(struct de
+       proc_dev = dev_get_drvdata(dev);
+       proc_thermal_read_ppcc(proc_dev);
+-      tcc_offset_update(tcc_offset_save);
++      if (tcc_offset_save >= 0)
++              tcc_offset_update(tcc_offset_save);
+       return 0;
+ }