From: Greg Kroah-Hartman Date: Mon, 27 Sep 2021 11:02:21 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v5.4.150~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d2e4be5c5df31a9a7da19bfd82bc2734d052195;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches 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 --- 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 index 00000000000..df1dbe8246e --- /dev/null +++ b/queue-5.4/edac-synopsys-fix-wrong-value-type-assignment-for-edac_mode.patch @@ -0,0 +1,39 @@ +From 5297cfa6bdf93e3889f78f9b482e2a595a376083 Mon Sep 17 00:00:00 2001 +From: Sai Krishna Potthuri +Date: Wed, 18 Aug 2021 12:53:14 +0530 +Subject: EDAC/synopsys: Fix wrong value type assignment for edac_mode + +From: Sai Krishna Potthuri + +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 +Signed-off-by: Shubhrajyoti Datta +Signed-off-by: Borislav Petkov +Cc: +Link: https://lkml.kernel.org/r/20210818072315.15149-1-shubhrajyoti.datta@xilinx.com +Signed-off-by: Greg Kroah-Hartman +--- + 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; diff --git a/queue-5.4/series b/queue-5.4/series index 5815c826ae1..997257391a9 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -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 index 00000000000..9313a130614 --- /dev/null +++ b/queue-5.4/thermal-drivers-int340x-do-not-set-a-wrong-tcc-offset-on-resume.patch @@ -0,0 +1,68 @@ +From 8b4bd256674720709a9d858a219fcac6f2f253b5 Mon Sep 17 00:00:00 2001 +From: Antoine Tenart +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 + +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 +Signed-off-by: Antoine Tenart +Signed-off-by: Daniel Lezcano +Reviewed-by: Srinivas Pandruvada +Tested-by: Srinivas Pandruvada +Link: https://lore.kernel.org/r/20210909085613.5577-2-atenart@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + 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; + }