From: Greg Kroah-Hartman Date: Tue, 10 Mar 2020 11:20:13 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v4.4.216~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d92266ca34d3e64e909d417ee385c0bc6ca0bdb1;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: arm-imx-build-v7_cpu_resume-unconditionally.patch dmaengine-coh901318-fix-a-double-lock-bug-in-dma_tc_handle.patch hwmon-adt7462-fix-an-error-return-in-adt7462_reg_volt.patch powerpc-fix-hardware-pmu-exception-bug-on-powervm-compatibility-mode-systems.patch --- diff --git a/queue-4.9/arm-imx-build-v7_cpu_resume-unconditionally.patch b/queue-4.9/arm-imx-build-v7_cpu_resume-unconditionally.patch new file mode 100644 index 00000000000..dd0620741c2 --- /dev/null +++ b/queue-4.9/arm-imx-build-v7_cpu_resume-unconditionally.patch @@ -0,0 +1,119 @@ +From 512a928affd51c2dc631401e56ad5ee5d5dd68b6 Mon Sep 17 00:00:00 2001 +From: Ahmad Fatoum +Date: Thu, 16 Jan 2020 15:18:49 +0100 +Subject: ARM: imx: build v7_cpu_resume() unconditionally + +From: Ahmad Fatoum + +commit 512a928affd51c2dc631401e56ad5ee5d5dd68b6 upstream. + +This function is not only needed by the platform suspend code, but is also +reused as the CPU resume function when the ARM cores can be powered down +completely in deep idle, which is the case on i.MX6SX and i.MX6UL(L). + +Providing the static inline stub whenever CONFIG_SUSPEND is disabled means +that those platforms will hang on resume from cpuidle if suspend is disabled. + +So there are two problems: + + - The static inline stub masks the linker error + - The function is not available where needed + +Fix both by just building the function unconditionally, when +CONFIG_SOC_IMX6 is enabled. The actual code is three instructions long, +so it's arguably ok to just leave it in for all i.MX6 kernel configurations. + +Fixes: 05136f0897b5 ("ARM: imx: support arm power off in cpuidle for i.mx6sx") +Signed-off-by: Lucas Stach +Signed-off-by: Ahmad Fatoum +Signed-off-by: Rouven Czerwinski +Signed-off-by: Shawn Guo +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm/mach-imx/Makefile | 2 ++ + arch/arm/mach-imx/common.h | 4 ++-- + arch/arm/mach-imx/resume-imx6.S | 24 ++++++++++++++++++++++++ + arch/arm/mach-imx/suspend-imx6.S | 14 -------------- + 4 files changed, 28 insertions(+), 16 deletions(-) + +--- a/arch/arm/mach-imx/Makefile ++++ b/arch/arm/mach-imx/Makefile +@@ -86,6 +86,8 @@ AFLAGS_suspend-imx6.o :=-Wa,-march=armv7 + obj-$(CONFIG_SOC_IMX6) += suspend-imx6.o + obj-$(CONFIG_SOC_IMX53) += suspend-imx53.o + endif ++AFLAGS_resume-imx6.o :=-Wa,-march=armv7-a ++obj-$(CONFIG_SOC_IMX6) += resume-imx6.o + obj-$(CONFIG_SOC_IMX6) += pm-imx6.o + + obj-$(CONFIG_SOC_IMX1) += mach-imx1.o +--- a/arch/arm/mach-imx/common.h ++++ b/arch/arm/mach-imx/common.h +@@ -112,17 +112,17 @@ void imx_cpu_die(unsigned int cpu); + int imx_cpu_kill(unsigned int cpu); + + #ifdef CONFIG_SUSPEND +-void v7_cpu_resume(void); + void imx53_suspend(void __iomem *ocram_vbase); + extern const u32 imx53_suspend_sz; + void imx6_suspend(void __iomem *ocram_vbase); + #else +-static inline void v7_cpu_resume(void) {} + static inline void imx53_suspend(void __iomem *ocram_vbase) {} + static const u32 imx53_suspend_sz; + static inline void imx6_suspend(void __iomem *ocram_vbase) {} + #endif + ++void v7_cpu_resume(void); ++ + void imx6_pm_ccm_init(const char *ccm_compat); + void imx6q_pm_init(void); + void imx6dl_pm_init(void); +--- /dev/null ++++ b/arch/arm/mach-imx/resume-imx6.S +@@ -0,0 +1,24 @@ ++/* SPDX-License-Identifier: GPL-2.0-or-later */ ++/* ++ * Copyright 2014 Freescale Semiconductor, Inc. ++ */ ++ ++#include ++#include ++#include ++#include ++#include "hardware.h" ++ ++/* ++ * The following code must assume it is running from physical address ++ * where absolute virtual addresses to the data section have to be ++ * turned into relative ones. ++ */ ++ ++ENTRY(v7_cpu_resume) ++ bl v7_invalidate_l1 ++#ifdef CONFIG_CACHE_L2X0 ++ bl l2c310_early_resume ++#endif ++ b cpu_resume ++ENDPROC(v7_cpu_resume) +--- a/arch/arm/mach-imx/suspend-imx6.S ++++ b/arch/arm/mach-imx/suspend-imx6.S +@@ -333,17 +333,3 @@ resume: + + ret lr + ENDPROC(imx6_suspend) +- +-/* +- * The following code must assume it is running from physical address +- * where absolute virtual addresses to the data section have to be +- * turned into relative ones. +- */ +- +-ENTRY(v7_cpu_resume) +- bl v7_invalidate_l1 +-#ifdef CONFIG_CACHE_L2X0 +- bl l2c310_early_resume +-#endif +- b cpu_resume +-ENDPROC(v7_cpu_resume) diff --git a/queue-4.9/dmaengine-coh901318-fix-a-double-lock-bug-in-dma_tc_handle.patch b/queue-4.9/dmaengine-coh901318-fix-a-double-lock-bug-in-dma_tc_handle.patch new file mode 100644 index 00000000000..bae45a3129d --- /dev/null +++ b/queue-4.9/dmaengine-coh901318-fix-a-double-lock-bug-in-dma_tc_handle.patch @@ -0,0 +1,41 @@ +From 36d5d22090d13fd3a7a8c9663a711cbe6970aac8 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Mon, 17 Feb 2020 17:40:50 +0300 +Subject: dmaengine: coh901318: Fix a double lock bug in dma_tc_handle() + +From: Dan Carpenter + +commit 36d5d22090d13fd3a7a8c9663a711cbe6970aac8 upstream. + +The caller is already holding the lock so this will deadlock. + +Fixes: 0b58828c923e ("DMAENGINE: COH 901 318 remove irq counting") +Signed-off-by: Dan Carpenter +Link: https://lore.kernel.org/r/20200217144050.3i4ymbytogod4ijn@kili.mountain +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/dma/coh901318.c | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/drivers/dma/coh901318.c ++++ b/drivers/dma/coh901318.c +@@ -1944,8 +1944,6 @@ static void dma_tc_handle(struct coh9013 + return; + } + +- spin_lock(&cohc->lock); +- + /* + * When we reach this point, at least one queue item + * should have been moved over from cohc->queue to +@@ -1966,8 +1964,6 @@ static void dma_tc_handle(struct coh9013 + if (coh901318_queue_start(cohc) == NULL) + cohc->busy = 0; + +- spin_unlock(&cohc->lock); +- + /* + * This tasklet will remove items from cohc->active + * and thus terminates them. diff --git a/queue-4.9/hwmon-adt7462-fix-an-error-return-in-adt7462_reg_volt.patch b/queue-4.9/hwmon-adt7462-fix-an-error-return-in-adt7462_reg_volt.patch new file mode 100644 index 00000000000..c671ca7a9a3 --- /dev/null +++ b/queue-4.9/hwmon-adt7462-fix-an-error-return-in-adt7462_reg_volt.patch @@ -0,0 +1,36 @@ +From 44f2f882909fedfc3a56e4b90026910456019743 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Tue, 3 Mar 2020 13:16:08 +0300 +Subject: hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT() + +From: Dan Carpenter + +commit 44f2f882909fedfc3a56e4b90026910456019743 upstream. + +This is only called from adt7462_update_device(). The caller expects it +to return zero on error. I fixed a similar issue earlier in commit +a4bf06d58f21 ("hwmon: (adt7462) ADT7462_REG_VOLT_MAX() should return 0") +but I missed this one. + +Fixes: c0b4e3ab0c76 ("adt7462: new hwmon driver") +Signed-off-by: Dan Carpenter +Reviewed-by: Darrick J. Wong +Link: https://lore.kernel.org/r/20200303101608.kqjwfcazu2ylhi2a@kili.mountain +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hwmon/adt7462.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/hwmon/adt7462.c ++++ b/drivers/hwmon/adt7462.c +@@ -426,7 +426,7 @@ static int ADT7462_REG_VOLT(struct adt74 + return 0x95; + break; + } +- return -ENODEV; ++ return 0; + } + + /* Provide labels for sysfs */ diff --git a/queue-4.9/powerpc-fix-hardware-pmu-exception-bug-on-powervm-compatibility-mode-systems.patch b/queue-4.9/powerpc-fix-hardware-pmu-exception-bug-on-powervm-compatibility-mode-systems.patch new file mode 100644 index 00000000000..f1462dae173 --- /dev/null +++ b/queue-4.9/powerpc-fix-hardware-pmu-exception-bug-on-powervm-compatibility-mode-systems.patch @@ -0,0 +1,45 @@ +From fc37a1632d40c80c067eb1bc235139f5867a2667 Mon Sep 17 00:00:00 2001 +From: "Desnes A. Nunes do Rosario" +Date: Thu, 27 Feb 2020 10:47:15 -0300 +Subject: powerpc: fix hardware PMU exception bug on PowerVM compatibility mode systems + +From: Desnes A. Nunes do Rosario + +commit fc37a1632d40c80c067eb1bc235139f5867a2667 upstream. + +PowerVM systems running compatibility mode on a few Power8 revisions are +still vulnerable to the hardware defect that loses PMU exceptions arriving +prior to a context switch. + +The software fix for this issue is enabled through the CPU_FTR_PMAO_BUG +cpu_feature bit, nevertheless this bit also needs to be set for PowerVM +compatibility mode systems. + +Fixes: 68f2f0d431d9ea4 ("powerpc: Add a cpu feature CPU_FTR_PMAO_BUG") +Signed-off-by: Desnes A. Nunes do Rosario +Reviewed-by: Leonardo Bras +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200227134715.9715-1-desnesn@linux.ibm.com +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kernel/cputable.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/arch/powerpc/kernel/cputable.c ++++ b/arch/powerpc/kernel/cputable.c +@@ -2199,11 +2199,13 @@ static struct cpu_spec * __init setup_cp + * oprofile_cpu_type already has a value, then we are + * possibly overriding a real PVR with a logical one, + * and, in that case, keep the current value for +- * oprofile_cpu_type. ++ * oprofile_cpu_type. Futhermore, let's ensure that the ++ * fix for the PMAO bug is enabled on compatibility mode. + */ + if (old.oprofile_cpu_type != NULL) { + t->oprofile_cpu_type = old.oprofile_cpu_type; + t->oprofile_type = old.oprofile_type; ++ t->cpu_features |= old.cpu_features & CPU_FTR_PMAO_BUG; + } + } + diff --git a/queue-4.9/series b/queue-4.9/series index cc9fbb2e984..d1cd3947d1f 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -80,3 +80,7 @@ asoc-pcm512x-fix-unbalanced-regulator-enable-call-in-probe-error-path.patch asoc-dapm-correct-dapm-handling-of-active-widgets-during-shutdown.patch rdma-iwcm-fix-iwcm-work-deallocation.patch rmda-cm-fix-missing-ib_cm_destroy_id-in-ib_cm_insert_listen.patch +arm-imx-build-v7_cpu_resume-unconditionally.patch +hwmon-adt7462-fix-an-error-return-in-adt7462_reg_volt.patch +dmaengine-coh901318-fix-a-double-lock-bug-in-dma_tc_handle.patch +powerpc-fix-hardware-pmu-exception-bug-on-powervm-compatibility-mode-systems.patch