From 847fe843c02a27b484c38366ab39edcc5b3e0228 Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Wed, 13 Jun 2018 10:56:08 -0700 Subject: [PATCH 1/6] arm64/acpi: Add fixup for HPE m400 quirks Adds a new ACPI init routine acpi_fixup_m400_quirks that adds a work-around for HPE ProLiant m400 APEI firmware problems. The work-around disables APEI when CONFIG_ACPI_APEI is set and m400 firmware is detected. Without this fixup m400 systems experience errors like these on startup: [Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 2 [Hardware Error]: event severity: fatal [Hardware Error]: Error 0, type: fatal [Hardware Error]: section_type: memory error [Hardware Error]: error_status: 0x0000000000001300 [Hardware Error]: error_type: 10, invalid address Kernel panic - not syncing: Fatal hardware error! Signed-off-by: Geoff Levand [bwh: Adjust context and indentation to apply to Linux 6.10] --- arch/arm64/kernel/acpi.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index 77d838055f7e6..b21781695b02f 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -34,6 +34,8 @@ #include #include +#include + int acpi_noirq = 1; /* skip ACPI IRQ initialization */ int acpi_disabled = 1; EXPORT_SYMBOL(acpi_disabled); @@ -172,6 +174,33 @@ static int __init acpi_fadt_sanity_check(void) return ret; } +/* + * acpi_fixup_m400_quirks - Work-around for HPE ProLiant m400 APEI firmware + * problems. + */ +static void __init acpi_fixup_m400_quirks(void) +{ + acpi_status status; + struct acpi_table_header *header; +#if !defined(CONFIG_ACPI_APEI) + int hest_disable = HEST_DISABLED; +#endif + + if (!IS_ENABLED(CONFIG_ACPI_APEI) || hest_disable != HEST_ENABLED) + return; + + status = acpi_get_table(ACPI_SIG_HEST, 0, &header); + + if (ACPI_SUCCESS(status) && !strncmp(header->oem_id, "HPE ", 6) && + !strncmp(header->oem_table_id, "ProLiant", 8) && + MIDR_IMPLEMENTOR(read_cpuid_id()) == ARM_CPU_IMP_APM) { + hest_disable = HEST_DISABLED; + pr_info("Disabled APEI for m400.\n"); + } + + acpi_put_table(header); +} + /* * acpi_boot_table_init() called from setup_arch(), always. * 1. find RSDP and get its address, and then find XSDT @@ -230,6 +259,8 @@ void __init acpi_boot_table_init(void) acpi_parse_spcr(earlycon_acpi_spcr_enable, true); if (IS_ENABLED(CONFIG_ACPI_BGRT)) acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt); + + acpi_fixup_m400_quirks(); } } From a670cd70738760b1725992d19f7f22a114fa3f07 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 17 Feb 2017 01:30:30 +0000 Subject: [PATCH 2/6] ARM: dts: kirkwood: Fix SATA pinmux-ing for TS419 The old board code for the TS419 assigns MPP pins 15 and 16 as SATA activity signals (and none as SATA presence signals). Currently the device tree assigns the SoC's default pinmux groups for SATA, which conflict with the second Ethernet port. Reported-by: gmbh@gazeta.pl Tested-by: gmbh@gazeta.pl References: https://bugs.debian.org/855017 Cc: stable@vger.kernel.org # 3.15+ Fixes: 934b524b3f49 ("ARM: Kirkwood: Add DT description of QNAP 419") Signed-off-by: Ben Hutchings --- arch/arm/boot/dts/marvell/kirkwood-ts419.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/marvell/kirkwood-ts419.dtsi b/arch/arm/boot/dts/marvell/kirkwood-ts419.dtsi index 717236853e458..7118223645e12 100644 --- a/arch/arm/boot/dts/marvell/kirkwood-ts419.dtsi +++ b/arch/arm/boot/dts/marvell/kirkwood-ts419.dtsi @@ -69,3 +69,11 @@ phy-handle = <ðphy1>; }; }; + +&pmx_sata0 { + marvell,pins = "mpp15"; +}; + +&pmx_sata1 { + marvell,pins = "mpp16"; +}; From 55ed70d8a2f6d61e368a024f6ca1624d20ce831f Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 11 Jul 2018 23:40:55 +0100 Subject: [PATCH 3/6] ARM: mm: Export __sync_icache_dcache() for xen-privcmd The xen-privcmd driver, which can be modular, calls set_pte_at() which in turn may call __sync_icache_dcache(). The call to __sync_icache_dcache() may be optimised out because it is conditional on !pte_special(), and xen-privcmd calls pte_mkspecial(). However, in a non-LPAE configuration there is no "special" bit and the call is really unconditional. Fixes: 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE") Signed-off-by: Ben Hutchings --- arch/arm/mm/flush.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c index 0749cf8a66371..b699fa7690178 100644 --- a/arch/arm/mm/flush.c +++ b/arch/arm/mm/flush.c @@ -310,6 +310,7 @@ void __sync_icache_dcache(pte_t pteval) if (pte_exec(pteval)) __flush_icache_all(); } +EXPORT_SYMBOL_GPL(__sync_icache_dcache); #endif /* From 0f9397a28cfa0ddb465bc07c8ca2e717e9ce1ba2 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 22 Jul 2017 17:37:33 +0100 Subject: [PATCH 4/6] perf tools: Fix unwind build on i386 EINVAL may not be defined when building unwind-libunwind.c with REMOTE_UNWIND_LIBUNWIND, resulting in a compiler error in LIBUNWIND__ARCH_REG_ID(). Its only caller, access_reg(), only checks for a negative return value and doesn't care what it is. So change -EINVAL to -1. Fixes: 52ffe0ff02fc ("Support x86(32-bit) cross platform callchain unwind.") Signed-off-by: Ben Hutchings --- tools/perf/arch/x86/util/unwind-libunwind.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/arch/x86/util/unwind-libunwind.c b/tools/perf/arch/x86/util/unwind-libunwind.c index 47357973b55b2..f233660539780 100644 --- a/tools/perf/arch/x86/util/unwind-libunwind.c +++ b/tools/perf/arch/x86/util/unwind-libunwind.c @@ -67,7 +67,7 @@ int LIBUNWIND__ARCH_REG_ID(int regnum) break; default: pr_err("unwind: invalid reg id %d\n", regnum); - return -EINVAL; + return -1; } return id; @@ -107,7 +107,7 @@ int LIBUNWIND__ARCH_REG_ID(int regnum) break; default: pr_err("unwind: invalid reg id %d\n", regnum); - return -EINVAL; + return -1; } return id; From c5e1d8550e9504b1f436486041234f10e5c73f9a Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 29 Aug 2018 09:32:23 +0200 Subject: [PATCH 5/6] powerpc/boot: Fix missing crc32poly.h when building with KERNEL_XZ After commit faa16bc404d7 ("lib: Use existing define with polynomial") the lib/xz/xz_crc32.c includes a header from include/linux directory thus any other user of this code should define proper include path. This fixes the build error on powerpc with CONFIG_KERNEL_XZ: In file included from ../arch/powerpc/boot/../../../lib/decompress_unxz.c:233:0, from ../arch/powerpc/boot/decompress.c:42: ../arch/powerpc/boot/../../../lib/xz/xz_crc32.c:18:29: fatal error: linux/crc32poly.h: No such file or directory Reported-by: Michal Kubecek Fixes: faa16bc404d7 ("lib: Use existing define with polynomial") Signed-off-by: Krzysztof Kozlowski Reported-by: kbuild test robot Reported-by: Meelis Roos Tested-by: Michal Kubecek --- arch/powerpc/boot/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 968aee2025b81..06bca53374f54 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -99,7 +99,7 @@ BOOTCFLAGS += -fno-stack-protector endif BOOTCFLAGS += -include $(srctree)/include/linux/compiler_attributes.h -BOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj) +BOOTCFLAGS += -I$(objtree)/$(obj) -I$(srctree)/$(obj) -I$(srctree)/include DTC_FLAGS ?= -p 1024 From 97321804042d17af160947922089f2ab33a20b50 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 7 Feb 2022 00:00:26 +0100 Subject: [PATCH 6/6] sh: Do not use hyphen in exported variable names arch/sh/Makefile defines and exports ld-bfd to be used by arch/sh/boot/Makefile and arch/sh/boot/compressed/Makefile. However some shells, including dash, will not pass through environment variables whose name includes a hyphen. Usually GNU make does not use a shell to recurse, but if e.g. $(srctree) contains '~' it will use a shell here. Rename the variable to ld_bfd. (Another instance of this problem was fixed upstream by commit 82977af93a0d "sh: rename suffix-y to suffix_y".) References: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=sh4&ver=4.13%7Erc5-1%7Eexp1&stamp=1502943967&raw=0 Fixes: ef9b542fce00 ("sh: bzip2/lzma uImage support.") Signed-off-by: Ben Hutchings --- arch/sh/Makefile | 10 +++++----- arch/sh/boot/compressed/Makefile | 4 ++-- arch/sh/boot/romimage/Makefile | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/sh/Makefile b/arch/sh/Makefile index cab2f9c011a8d..7b420424b6d7c 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -103,16 +103,16 @@ UTS_MACHINE := sh LDFLAGS_vmlinux += -e _stext ifdef CONFIG_CPU_LITTLE_ENDIAN -ld-bfd := elf32-sh-linux -LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd) +ld_bfd := elf32-sh-linux +LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld_bfd) KBUILD_LDFLAGS += -EL else -ld-bfd := elf32-shbig-linux -LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd) +ld_bfd := elf32-shbig-linux +LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld_bfd) KBUILD_LDFLAGS += -EB endif -export ld-bfd +export ld_bfd # Mach groups machdir-$(CONFIG_SOLUTION_ENGINE) += mach-se diff --git a/arch/sh/boot/compressed/Makefile b/arch/sh/boot/compressed/Makefile index b5e29f99c02c8..5d5b2da2a3f1f 100644 --- a/arch/sh/boot/compressed/Makefile +++ b/arch/sh/boot/compressed/Makefile @@ -29,7 +29,7 @@ endif ccflags-remove-$(CONFIG_MCOUNT) += -pg -LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \ +LDFLAGS_vmlinux := --oformat $(ld_bfd) -Ttext $(IMAGE_OFFSET) -e startup \ -T $(obj)/../../kernel/vmlinux.lds KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING @@ -53,7 +53,7 @@ $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE OBJCOPYFLAGS += -R .empty_zero_page -LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T +LDFLAGS_piggy.o := -r --format binary --oformat $(ld_bfd) -T $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE $(call if_changed,ld) diff --git a/arch/sh/boot/romimage/Makefile b/arch/sh/boot/romimage/Makefile index c7c8be58400cd..17b03df0a8de4 100644 --- a/arch/sh/boot/romimage/Makefile +++ b/arch/sh/boot/romimage/Makefile @@ -13,7 +13,7 @@ mmcif-obj-$(CONFIG_CPU_SUBTYPE_SH7724) := $(obj)/mmcif-sh7724.o load-$(CONFIG_ROMIMAGE_MMCIF) := $(mmcif-load-y) obj-$(CONFIG_ROMIMAGE_MMCIF) := $(mmcif-obj-y) -LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(load-y) -e romstart \ +LDFLAGS_vmlinux := --oformat $(ld_bfd) -Ttext $(load-y) -e romstart \ -T $(obj)/../../kernel/vmlinux.lds $(obj)/vmlinux: $(obj)/head.o $(obj-y) $(obj)/piggy.o FORCE @@ -24,7 +24,7 @@ OBJCOPYFLAGS += -j .empty_zero_page $(obj)/zeropage.bin: vmlinux FORCE $(call if_changed,objcopy) -LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T +LDFLAGS_piggy.o := -r --format binary --oformat $(ld_bfd) -T $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/zeropage.bin arch/sh/boot/zImage FORCE $(call if_changed,ld)