From: Greg Kroah-Hartman Date: Sat, 12 Feb 2022 09:46:28 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v4.9.302~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce1fc2d6ea89a2dbbdc9b61a2fbe9d72c983317c;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: acpi-iort-check-node-revision-for-pmcg-resources.patch arm-dts-imx23-evk-remove-mx23_pad_ssp1_detect-from-hog-group.patch arm-socfpga-fix-missing-reset_controller.patch nvme-tcp-fix-bogus-request-completion-when-failing-to-send-aer.patch pm-s2idle-acpi-fix-wakeup-interrupts-handling.patch riscv-fix-build-with-binutils-2.38.patch --- diff --git a/queue-5.4/acpi-iort-check-node-revision-for-pmcg-resources.patch b/queue-5.4/acpi-iort-check-node-revision-for-pmcg-resources.patch new file mode 100644 index 00000000000..a3a9d3d1b74 --- /dev/null +++ b/queue-5.4/acpi-iort-check-node-revision-for-pmcg-resources.patch @@ -0,0 +1,55 @@ +From da5fb9e1ad3fbf632dce735f1bdad257ca528499 Mon Sep 17 00:00:00 2001 +From: Robin Murphy +Date: Thu, 3 Feb 2022 19:31:24 +0000 +Subject: ACPI/IORT: Check node revision for PMCG resources + +From: Robin Murphy + +commit da5fb9e1ad3fbf632dce735f1bdad257ca528499 upstream. + +The original version of the IORT PMCG definition had an oversight +wherein there was no way to describe the second register page for an +implementation using the recommended RELOC_CTRS feature. Although the +spec was fixed, and the final patches merged to ACPICA and Linux written +against the new version, it seems that some old firmware based on the +original revision has survived and turned up in the wild. + +Add a check for the original PMCG definition, and avoid filling in the +second memory resource with nonsense if so. Otherwise it is likely that +something horrible will happen when the PMCG driver attempts to probe. + +Reported-by: Michael Petlan +Fixes: 24e516049360 ("ACPI/IORT: Add support for PMCG") +Cc: # 5.2.x +Signed-off-by: Robin Murphy +Acked-by: Lorenzo Pieralisi +Link: https://lore.kernel.org/r/75628ae41c257fb73588f7bf1c4459160e04be2b.1643916258.git.robin.murphy@arm.com +Signed-off-by: Catalin Marinas +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/arm64/iort.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +--- a/drivers/acpi/arm64/iort.c ++++ b/drivers/acpi/arm64/iort.c +@@ -1373,9 +1373,17 @@ static void __init arm_smmu_v3_pmcg_init + res[0].start = pmcg->page0_base_address; + res[0].end = pmcg->page0_base_address + SZ_4K - 1; + res[0].flags = IORESOURCE_MEM; +- res[1].start = pmcg->page1_base_address; +- res[1].end = pmcg->page1_base_address + SZ_4K - 1; +- res[1].flags = IORESOURCE_MEM; ++ /* ++ * The initial version in DEN0049C lacked a way to describe register ++ * page 1, which makes it broken for most PMCG implementations; in ++ * that case, just let the driver fail gracefully if it expects to ++ * find a second memory resource. ++ */ ++ if (node->revision > 0) { ++ res[1].start = pmcg->page1_base_address; ++ res[1].end = pmcg->page1_base_address + SZ_4K - 1; ++ res[1].flags = IORESOURCE_MEM; ++ } + + if (pmcg->overflow_gsiv) + acpi_iort_register_irq(pmcg->overflow_gsiv, "overflow", diff --git a/queue-5.4/arm-dts-imx23-evk-remove-mx23_pad_ssp1_detect-from-hog-group.patch b/queue-5.4/arm-dts-imx23-evk-remove-mx23_pad_ssp1_detect-from-hog-group.patch new file mode 100644 index 00000000000..3713f13a613 --- /dev/null +++ b/queue-5.4/arm-dts-imx23-evk-remove-mx23_pad_ssp1_detect-from-hog-group.patch @@ -0,0 +1,41 @@ +From 42c9b28e6862d16db82a56f5667cf4d1f6658cf6 Mon Sep 17 00:00:00 2001 +From: Fabio Estevam +Date: Mon, 27 Dec 2021 13:14:02 -0300 +Subject: ARM: dts: imx23-evk: Remove MX23_PAD_SSP1_DETECT from hog group + +From: Fabio Estevam + +commit 42c9b28e6862d16db82a56f5667cf4d1f6658cf6 upstream. + +Currently, SD card fails to mount due to the following pinctrl error: + +[ 11.170000] imx23-pinctrl 80018000.pinctrl: pin SSP1_DETECT already requested by 80018000.pinctrl; cannot claim for 80010000.spi +[ 11.180000] imx23-pinctrl 80018000.pinctrl: pin-65 (80010000.spi) status -22 +[ 11.190000] imx23-pinctrl 80018000.pinctrl: could not request pin 65 (SSP1_DETECT) from group mmc0-pins-fixup.0 on device 80018000.pinctrl +[ 11.200000] mxs-mmc 80010000.spi: Error applying setting, reverse things back + +Fix it by removing the MX23_PAD_SSP1_DETECT pin from the hog group as it +is already been used by the mmc0-pins-fixup pinctrl group. + +With this change the rootfs can be mounted and the imx23-evk board can +boot successfully. + +Cc: +Fixes: bc3875f1a61e ("ARM: dts: mxs: modify mx23/mx28 dts files to use pinctrl headers") +Signed-off-by: Fabio Estevam +Signed-off-by: Shawn Guo +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/boot/dts/imx23-evk.dts | 1 - + 1 file changed, 1 deletion(-) + +--- a/arch/arm/boot/dts/imx23-evk.dts ++++ b/arch/arm/boot/dts/imx23-evk.dts +@@ -79,7 +79,6 @@ + MX23_PAD_LCD_RESET__GPIO_1_18 + MX23_PAD_PWM3__GPIO_1_29 + MX23_PAD_PWM4__GPIO_1_30 +- MX23_PAD_SSP1_DETECT__SSP1_DETECT + >; + fsl,drive-strength = ; + fsl,voltage = ; diff --git a/queue-5.4/arm-socfpga-fix-missing-reset_controller.patch b/queue-5.4/arm-socfpga-fix-missing-reset_controller.patch new file mode 100644 index 00000000000..7dd672d197d --- /dev/null +++ b/queue-5.4/arm-socfpga-fix-missing-reset_controller.patch @@ -0,0 +1,46 @@ +From 3037b174b1876aae6b2d1a27a878c681c78ccadc Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Mon, 7 Feb 2022 09:44:04 +0100 +Subject: ARM: socfpga: fix missing RESET_CONTROLLER + +From: Krzysztof Kozlowski + +commit 3037b174b1876aae6b2d1a27a878c681c78ccadc upstream. + +The SocFPGA machine since commit b3ca9888f35f ("reset: socfpga: add an +early reset driver for SoCFPGA") uses reset controller, so it should +select RESET_CONTROLLER explicitly. Selecting ARCH_HAS_RESET_CONTROLLER +is not enough because it affects only default choice still allowing a +non-buildable configuration: + + /usr/bin/arm-linux-gnueabi-ld: arch/arm/mach-socfpga/socfpga.o: in function `socfpga_init_irq': + arch/arm/mach-socfpga/socfpga.c:56: undefined reference to `socfpga_reset_init' + +Reported-by: kernel test robot +Cc: +Fixes: b3ca9888f35f ("reset: socfpga: add an early reset driver for SoCFPGA") +Signed-off-by: Krzysztof Kozlowski +Signed-off-by: Dinh Nguyen +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/mach-socfpga/Kconfig | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/arch/arm/mach-socfpga/Kconfig ++++ b/arch/arm/mach-socfpga/Kconfig +@@ -2,6 +2,7 @@ + menuconfig ARCH_SOCFPGA + bool "Altera SOCFPGA family" + depends on ARCH_MULTI_V7 ++ select ARCH_HAS_RESET_CONTROLLER + select ARCH_SUPPORTS_BIG_ENDIAN + select ARM_AMBA + select ARM_GIC +@@ -19,6 +20,7 @@ menuconfig ARCH_SOCFPGA + select PL310_ERRATA_727915 + select PL310_ERRATA_753970 if PL310 + select PL310_ERRATA_769419 ++ select RESET_CONTROLLER + + if ARCH_SOCFPGA + config SOCFPGA_SUSPEND diff --git a/queue-5.4/nvme-tcp-fix-bogus-request-completion-when-failing-to-send-aer.patch b/queue-5.4/nvme-tcp-fix-bogus-request-completion-when-failing-to-send-aer.patch new file mode 100644 index 00000000000..8ba518d93dd --- /dev/null +++ b/queue-5.4/nvme-tcp-fix-bogus-request-completion-when-failing-to-send-aer.patch @@ -0,0 +1,42 @@ +From 63573807b27e0faf8065a28b1bbe1cbfb23c0130 Mon Sep 17 00:00:00 2001 +From: Sagi Grimberg +Date: Mon, 7 Feb 2022 00:40:13 +0200 +Subject: nvme-tcp: fix bogus request completion when failing to send AER + +From: Sagi Grimberg + +commit 63573807b27e0faf8065a28b1bbe1cbfb23c0130 upstream. + +AER is not backed by a real request, hence we should not incorrectly +assume that when failing to send a nvme command, it is a normal request +but rather check if this is an aer and if so complete the aer (similar +to the normal completion path). + +Cc: stable@vger.kernel.org +Signed-off-by: Sagi Grimberg +Reviewed-by: Hannes Reinecke +Signed-off-by: Christoph Hellwig +Signed-off-by: Greg Kroah-Hartman +--- + drivers/nvme/host/tcp.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/nvme/host/tcp.c ++++ b/drivers/nvme/host/tcp.c +@@ -840,7 +840,15 @@ static inline void nvme_tcp_done_send_re + + static void nvme_tcp_fail_request(struct nvme_tcp_request *req) + { +- nvme_tcp_end_request(blk_mq_rq_from_pdu(req), NVME_SC_HOST_PATH_ERROR); ++ if (nvme_tcp_async_req(req)) { ++ union nvme_result res = {}; ++ ++ nvme_complete_async_event(&req->queue->ctrl->ctrl, ++ cpu_to_le16(NVME_SC_HOST_PATH_ERROR), &res); ++ } else { ++ nvme_tcp_end_request(blk_mq_rq_from_pdu(req), ++ NVME_SC_HOST_PATH_ERROR); ++ } + } + + static int nvme_tcp_try_send_data(struct nvme_tcp_request *req) diff --git a/queue-5.4/pm-s2idle-acpi-fix-wakeup-interrupts-handling.patch b/queue-5.4/pm-s2idle-acpi-fix-wakeup-interrupts-handling.patch new file mode 100644 index 00000000000..5c57f84d943 --- /dev/null +++ b/queue-5.4/pm-s2idle-acpi-fix-wakeup-interrupts-handling.patch @@ -0,0 +1,175 @@ +From cb1f65c1e1424a4b5e4a86da8aa3b8fd8459c8ec Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Fri, 4 Feb 2022 18:35:22 +0100 +Subject: PM: s2idle: ACPI: Fix wakeup interrupts handling + +From: Rafael J. Wysocki + +commit cb1f65c1e1424a4b5e4a86da8aa3b8fd8459c8ec upstream. + +After commit e3728b50cd9b ("ACPI: PM: s2idle: Avoid possible race +related to the EC GPE") wakeup interrupts occurring immediately after +the one discarded by acpi_s2idle_wake() may be missed. Moreover, if +the SCI triggers again immediately after the rearming in +acpi_s2idle_wake(), that wakeup may be missed too. + +The problem is that pm_system_irq_wakeup() only calls pm_system_wakeup() +when pm_wakeup_irq is 0, but that's not the case any more after the +interrupt causing acpi_s2idle_wake() to run until pm_wakeup_irq is +cleared by the pm_wakeup_clear() call in s2idle_loop(). However, +there may be wakeup interrupts occurring in that time frame and if +that happens, they will be missed. + +To address that issue first move the clearing of pm_wakeup_irq to +the point at which it is known that the interrupt causing +acpi_s2idle_wake() to tun will be discarded, before rearming the SCI +for wakeup. Moreover, because that only reduces the size of the +time window in which the issue may manifest itself, allow +pm_system_irq_wakeup() to register two second wakeup interrupts in +a row and, when discarding the first one, replace it with the second +one. [Of course, this assumes that only one wakeup interrupt can be +discarded in one go, but currently that is the case and I am not +aware of any plans to change that.] + +Fixes: e3728b50cd9b ("ACPI: PM: s2idle: Avoid possible race related to the EC GPE") +Cc: 5.4+ # 5.4+ +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/sleep.c | 1 + + drivers/base/power/wakeup.c | 41 ++++++++++++++++++++++++++++++++++------- + include/linux/suspend.h | 4 ++-- + kernel/power/main.c | 5 ++++- + kernel/power/process.c | 2 +- + kernel/power/suspend.c | 2 -- + 6 files changed, 42 insertions(+), 13 deletions(-) + +--- a/drivers/acpi/sleep.c ++++ b/drivers/acpi/sleep.c +@@ -1027,6 +1027,7 @@ static bool acpi_s2idle_wake(void) + if (pm_wakeup_pending()) + return true; + ++ pm_wakeup_clear(acpi_sci_irq); + rearm_wake_irq(acpi_sci_irq); + } + +--- a/drivers/base/power/wakeup.c ++++ b/drivers/base/power/wakeup.c +@@ -31,7 +31,8 @@ suspend_state_t pm_suspend_target_state; + bool events_check_enabled __read_mostly; + + /* First wakeup IRQ seen by the kernel in the last cycle. */ +-unsigned int pm_wakeup_irq __read_mostly; ++static unsigned int wakeup_irq[2] __read_mostly; ++static DEFINE_RAW_SPINLOCK(wakeup_irq_lock); + + /* If greater than 0 and the system is suspending, terminate the suspend. */ + static atomic_t pm_abort_suspend __read_mostly; +@@ -884,19 +885,45 @@ void pm_system_cancel_wakeup(void) + atomic_dec_if_positive(&pm_abort_suspend); + } + +-void pm_wakeup_clear(bool reset) ++void pm_wakeup_clear(unsigned int irq_number) + { +- pm_wakeup_irq = 0; +- if (reset) ++ raw_spin_lock_irq(&wakeup_irq_lock); ++ ++ if (irq_number && wakeup_irq[0] == irq_number) ++ wakeup_irq[0] = wakeup_irq[1]; ++ else ++ wakeup_irq[0] = 0; ++ ++ wakeup_irq[1] = 0; ++ ++ raw_spin_unlock_irq(&wakeup_irq_lock); ++ ++ if (!irq_number) + atomic_set(&pm_abort_suspend, 0); + } + + void pm_system_irq_wakeup(unsigned int irq_number) + { +- if (pm_wakeup_irq == 0) { +- pm_wakeup_irq = irq_number; ++ unsigned long flags; ++ ++ raw_spin_lock_irqsave(&wakeup_irq_lock, flags); ++ ++ if (wakeup_irq[0] == 0) ++ wakeup_irq[0] = irq_number; ++ else if (wakeup_irq[1] == 0) ++ wakeup_irq[1] = irq_number; ++ else ++ irq_number = 0; ++ ++ raw_spin_unlock_irqrestore(&wakeup_irq_lock, flags); ++ ++ if (irq_number) + pm_system_wakeup(); +- } ++} ++ ++unsigned int pm_wakeup_irq(void) ++{ ++ return wakeup_irq[0]; + } + + /** +--- a/include/linux/suspend.h ++++ b/include/linux/suspend.h +@@ -482,14 +482,14 @@ extern void ksys_sync_helper(void); + + /* drivers/base/power/wakeup.c */ + extern bool events_check_enabled; +-extern unsigned int pm_wakeup_irq; + extern suspend_state_t pm_suspend_target_state; + + extern bool pm_wakeup_pending(void); + extern void pm_system_wakeup(void); + extern void pm_system_cancel_wakeup(void); +-extern void pm_wakeup_clear(bool reset); ++extern void pm_wakeup_clear(unsigned int irq_number); + extern void pm_system_irq_wakeup(unsigned int irq_number); ++extern unsigned int pm_wakeup_irq(void); + extern bool pm_get_wakeup_count(unsigned int *count, bool block); + extern bool pm_save_wakeup_count(unsigned int count); + extern void pm_wakep_autosleep_enabled(bool set); +--- a/kernel/power/main.c ++++ b/kernel/power/main.c +@@ -472,7 +472,10 @@ static ssize_t pm_wakeup_irq_show(struct + struct kobj_attribute *attr, + char *buf) + { +- return pm_wakeup_irq ? sprintf(buf, "%u\n", pm_wakeup_irq) : -ENODATA; ++ if (!pm_wakeup_irq()) ++ return -ENODATA; ++ ++ return sprintf(buf, "%u\n", pm_wakeup_irq()); + } + + power_attr_ro(pm_wakeup_irq); +--- a/kernel/power/process.c ++++ b/kernel/power/process.c +@@ -134,7 +134,7 @@ int freeze_processes(void) + if (!pm_freezing) + atomic_inc(&system_freezing_cnt); + +- pm_wakeup_clear(true); ++ pm_wakeup_clear(0); + pr_info("Freezing user space processes ... "); + pm_freezing = true; + error = try_to_freeze_tasks(true); +--- a/kernel/power/suspend.c ++++ b/kernel/power/suspend.c +@@ -138,8 +138,6 @@ static void s2idle_loop(void) + break; + } + +- pm_wakeup_clear(false); +- + s2idle_enter(); + } + diff --git a/queue-5.4/riscv-fix-build-with-binutils-2.38.patch b/queue-5.4/riscv-fix-build-with-binutils-2.38.patch new file mode 100644 index 00000000000..a18a6499799 --- /dev/null +++ b/queue-5.4/riscv-fix-build-with-binutils-2.38.patch @@ -0,0 +1,50 @@ +From 6df2a016c0c8a3d0933ef33dd192ea6606b115e3 Mon Sep 17 00:00:00 2001 +From: Aurelien Jarno +Date: Wed, 26 Jan 2022 18:14:42 +0100 +Subject: riscv: fix build with binutils 2.38 + +From: Aurelien Jarno + +commit 6df2a016c0c8a3d0933ef33dd192ea6606b115e3 upstream. + +From version 2.38, binutils default to ISA spec version 20191213. This +means that the csr read/write (csrr*/csrw*) instructions and fence.i +instruction has separated from the `I` extension, become two standalone +extensions: Zicsr and Zifencei. As the kernel uses those instruction, +this causes the following build failure: + + CC arch/riscv/kernel/vdso/vgettimeofday.o + <>/arch/riscv/include/asm/vdso/gettimeofday.h: Assembler messages: + <>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01' + <>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01' + <>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01' + <>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01' + +The fix is to specify those extensions explicitely in -march. However as +older binutils version do not support this, we first need to detect +that. + +Signed-off-by: Aurelien Jarno +Tested-by: Alexandre Ghiti +Cc: stable@vger.kernel.org +Signed-off-by: Palmer Dabbelt +Signed-off-by: Greg Kroah-Hartman +--- + arch/riscv/Makefile | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/arch/riscv/Makefile ++++ b/arch/riscv/Makefile +@@ -48,6 +48,12 @@ riscv-march-$(CONFIG_ARCH_RV32I) := rv32 + riscv-march-$(CONFIG_ARCH_RV64I) := rv64ima + riscv-march-$(CONFIG_FPU) := $(riscv-march-y)fd + riscv-march-$(CONFIG_RISCV_ISA_C) := $(riscv-march-y)c ++ ++# Newer binutils versions default to ISA spec version 20191213 which moves some ++# instructions from the I extension to the Zicsr and Zifencei extensions. ++toolchain-need-zicsr-zifencei := $(call cc-option-yn, -march=$(riscv-march-y)_zicsr_zifencei) ++riscv-march-$(toolchain-need-zicsr-zifencei) := $(riscv-march-y)_zicsr_zifencei ++ + KBUILD_CFLAGS += -march=$(subst fd,,$(riscv-march-y)) + KBUILD_AFLAGS += -march=$(riscv-march-y) + diff --git a/queue-5.4/series b/queue-5.4/series index 0d26f21dc86..56fd2984747 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -24,3 +24,9 @@ usb-dwc2-gadget-don-t-try-to-disable-ep0-in-dwc2_hso.patch net-stmmac-dwmac-sun8i-use-return-val-of-readl_poll_.patch kvm-nvmx-evmcs-filter-out-vm_exit_save_vmx_preemptio.patch bpf-add-kconfig-knob-for-disabling-unpriv-bpf-by-default.patch +riscv-fix-build-with-binutils-2.38.patch +arm-dts-imx23-evk-remove-mx23_pad_ssp1_detect-from-hog-group.patch +arm-socfpga-fix-missing-reset_controller.patch +nvme-tcp-fix-bogus-request-completion-when-failing-to-send-aer.patch +acpi-iort-check-node-revision-for-pmcg-resources.patch +pm-s2idle-acpi-fix-wakeup-interrupts-handling.patch