driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8BOB3 CVE: NA
----------------------------------------------------------------------
The mainline`s patch [1] add ARM TRBE device support, revert the private patch. This reverts commit 7709bf091738ff510807de7041e4c04193012771.
[1]: 1aa3d0274a4a "arm_pmu: acpi: Add a representative platform device for TRBE"
Signed-off-by: Junhao He hejunhao3@huawei.com --- arch/arm64/configs/openeuler_defconfig | 1 - arch/arm64/include/asm/acpi.h | 3 - arch/arm64/kernel/Makefile | 1 - arch/arm64/kernel/acpi_trbe.c | 81 -------------------------- drivers/hwtracing/coresight/Kconfig | 4 -- include/linux/coresight.h | 2 - 6 files changed, 92 deletions(-) delete mode 100644 arch/arm64/kernel/acpi_trbe.c
diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index c574ba82b7ad..b830008f1df2 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -7336,7 +7336,6 @@ CONFIG_ETM4X_IMPDEF_FEATURE=y # CONFIG_CORESIGHT_CTI is not set CONFIG_CORESIGHT_TRBE=m CONFIG_ULTRASOC_SMB=m -CONFIG_ACPI_TRBE=y # end of arm64 Debugging
# diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 8f67d367e381..df0ef7ec5b5b 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -42,9 +42,6 @@ #define ACPI_MADT_GICC_SPE (offsetof(struct acpi_madt_generic_interrupt, \ spe_interrupt) + sizeof(u16))
-#define ACPI_MADT_GICC_TRBE (offsetof(struct acpi_madt_generic_interrupt, \ - trbe_interrupt) + sizeof(u16)) - /* Basic configuration for ACPI */ #ifdef CONFIG_ACPI pgprot_t __acpi_get_mem_attribute(phys_addr_t addr); diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 05f0ed3ad1d8..312c164db2ed 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -54,7 +54,6 @@ obj-$(CONFIG_PCI) += pci.o obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o obj-$(CONFIG_ACPI) += acpi.o obj-$(CONFIG_ACPI_NUMA) += acpi_numa.o -obj-$(CONFIG_ACPI_TRBE) += acpi_trbe.o obj-$(CONFIG_ARM64_ACPI_PARKING_PROTOCOL) += acpi_parking_protocol.o obj-$(CONFIG_PARAVIRT) += paravirt.o paravirt-spinlocks.o obj-$(CONFIG_PARAVIRT_SPINLOCKS) += paravirt.o paravirt-spinlocks.o diff --git a/arch/arm64/kernel/acpi_trbe.c b/arch/arm64/kernel/acpi_trbe.c deleted file mode 100644 index 5d983ea8c812..000000000000 --- a/arch/arm64/kernel/acpi_trbe.c +++ /dev/null @@ -1,81 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * ACPI probing code for ARM Trace Buffer Extension. - * - * Copyright (C) 2022 ARM Ltd. - */ - -#include <linux/acpi.h> -#include <linux/coresight.h> -#include <linux/platform_device.h> -#include <linux/init.h> - -static struct resource trbe_resources[] = { - { - /* irq */ - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device trbe_dev = { - .name = ARMV9_TRBE_PDEV_NAME, - .id = -1, - .resource = trbe_resources, - .num_resources = ARRAY_SIZE(trbe_resources) -}; - -static void arm_trbe_acpi_register_device(void) -{ - int cpu, hetid, irq, ret; - bool first = true; - u16 gsi = 0; - - /* - * Sanity check all the GICC tables for the same interrupt number. - * For now, we only support homogeneous machines. - */ - for_each_possible_cpu(cpu) { - struct acpi_madt_generic_interrupt *gicc; - - gicc = acpi_cpu_get_madt_gicc(cpu); - if (gicc->header.length < ACPI_MADT_GICC_TRBE) - return; - - if (first) { - gsi = gicc->trbe_interrupt; - if (!gsi) - return; - hetid = find_acpi_cpu_topology_hetero_id(cpu); - first = false; - } else if ((gsi != gicc->trbe_interrupt) || - (hetid != find_acpi_cpu_topology_hetero_id(cpu))) { - pr_warn("ACPI: TRBE must be homogeneous\n"); - return; - } - } - - irq = acpi_register_gsi(NULL, gsi, ACPI_LEVEL_SENSITIVE, - ACPI_ACTIVE_HIGH); - if (irq < 0) { - pr_warn("ACPI: TRBE Unable to register interrupt: %d\n", gsi); - return; - } - - trbe_resources[0].start = irq; - ret = platform_device_register(&trbe_dev); - if (ret < 0) { - pr_warn("ACPI: TRBE: Unable to register device\n"); - acpi_unregister_gsi(gsi); - } -} - -static int arm_acpi_trbe_init(void) -{ - if (acpi_disabled) - return 0; - - arm_trbe_acpi_register_device(); - - return 0; -} -device_initcall(arm_acpi_trbe_init) diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresight/Kconfig index 70f289112a0b..5d178ed935ef 100644 --- a/drivers/hwtracing/coresight/Kconfig +++ b/drivers/hwtracing/coresight/Kconfig @@ -201,7 +201,3 @@ config ULTRASOC_SMB called ultrasoc-smb.
endif - -config ACPI_TRBE - depends on ARM64 && ACPI - def_bool y diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 960452544304..8970d6428d31 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -35,8 +35,6 @@
#define CORESIGHT_UNLOCK 0xc5acce55
-#define ARMV9_TRBE_PDEV_NAME "arm,trbe-v1" - extern struct bus_type coresight_bustype;
enum coresight_dev_type {