From: Yu Kuai yukuai3@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I65K8D CVE: NA
--------------------------------
Prepare to add a flag while initializing request, there are no functional changes.
Signed-off-by: Yu Kuai yukuai3@huawei.com Reviewed-by: Hou Tao houtao1@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- drivers/ide/ide-cd_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c index 46f2df288c6a..932c4be4c88c 100644 --- a/drivers/ide/ide-cd_ioctl.c +++ b/drivers/ide/ide-cd_ioctl.c @@ -298,7 +298,7 @@ int ide_cdrom_reset(struct cdrom_device_info *cdi)
rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); ide_req(rq)->type = ATA_PRIV_MISC; - rq->rq_flags = RQF_QUIET; + rq->rq_flags |= RQF_QUIET; blk_execute_rq(drive->queue, cd->disk, rq, 0); ret = scsi_req(rq)->result ? -EIO : 0; blk_put_request(rq);
From: Yu Kuai yukuai3@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I65K8D CVE: NA
--------------------------------
Before commit f60df4a0a6ad ("blk-mq: fix kabi broken in struct request"), drivers will got cmd address right after request, however, after this commit, drivers will got cmd address after request_wrapper instead, which is bigger than request and will cause compatibility issues.
Fix the problem by placing request_wrapper behind cmd, so that the cmd address for drivers will stay the same.
Before commit: |request|cmd| After commit: |request|request_wrapper|cmd| With this patch: |request|cmd|request_wrapper|
Performance test: arm64 Kunpeng-920 96 core
1) null_blk setup: modprobe null_blk nr_devices=0 && udevadm settle && cd /sys/kernel/config/nullb && mkdir nullb0 && cd nullb0 && echo 0 > completion_nsec && echo 512 > blocksize && echo 0 > home_node && echo 0 > irqmode && echo 1024 > size && echo 0 > memory_backed && echo 2 > queue_mode && echo 4096 > hw_queue_depth && echo 96 > submit_queues && echo 1 > power
2) fio test script: [global] ioengine=libaio direct=1 numjobs=96 iodepth=32 bs=4k rw=randwrite allow_mounted_write=0 time_based runtime=60 group_reporting=1 ioscheduler=none cpus_allowed_policy=split cpus_allowed=0-95
[test] filename=/dev/nullb0
3) iops test result:
without this patch: 23.9M with this patch: 24.1M
Fixes: f60df4a0a6ad ("blk-mq: fix kabi broken in struct request") Signed-off-by: Yu Kuai yukuai3@huawei.com Reviewed-by: Hou Tao houtao1@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- block/blk-flush.c | 2 +- block/blk-mq.c | 5 +++-- block/blk-mq.h | 13 +++++++++++++ drivers/scsi/scsi_error.c | 2 +- include/linux/blk-mq.h | 13 ++----------- 5 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/block/blk-flush.c b/block/blk-flush.c index 71faf07a626f..767624910270 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -470,7 +470,7 @@ struct blk_flush_queue *blk_alloc_flush_queue(int node, int cmd_size, gfp_t flags) { struct blk_flush_queue *fq; - int rq_sz = sizeof(struct request_wrapper); + int rq_sz = sizeof(struct request) + sizeof(struct request_wrapper);
fq = kzalloc_node(sizeof(*fq), flags, node); if (!fq) diff --git a/block/blk-mq.c b/block/blk-mq.c index b9b2d9412b02..4c719469ba8e 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2601,8 +2601,9 @@ static int blk_mq_alloc_rqs(struct blk_mq_tag_set *set, * rq_size is the size of the request plus driver payload, rounded * to the cacheline size */ - rq_size = round_up(sizeof(struct request_wrapper) + set->cmd_size, - cache_line_size()); + rq_size = round_up(sizeof(struct request) + + sizeof(struct request_wrapper) + set->cmd_size, + cache_line_size()); left = rq_size * depth;
for (i = 0; i < depth; ) { diff --git a/block/blk-mq.h b/block/blk-mq.h index 1c86f7d56e72..6254abe9c112 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -37,6 +37,19 @@ struct blk_mq_ctx { struct kobject kobj; } ____cacheline_aligned_in_smp;
+struct request_wrapper { + /* Time that I/O was counted in part_get_stat_info(). */ + u64 stat_time_ns; +}; + +static inline struct request_wrapper *request_to_wrapper(struct request *rq) +{ + unsigned long addr = (unsigned long)rq; + + addr += sizeof(*rq) + rq->q->tag_set->cmd_size; + return (struct request_wrapper *)addr; +} + void blk_mq_exit_queue(struct request_queue *q); int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr); void blk_mq_wake_waiters(struct request_queue *q); diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index bcbeadb2d0f0..f11f51e2465f 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -2359,7 +2359,7 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg) return -EIO;
error = -EIO; - rq = kzalloc(sizeof(struct request_wrapper) + sizeof(struct scsi_cmnd) + + rq = kzalloc(sizeof(struct request) + sizeof(struct scsi_cmnd) + shost->hostt->cmd_size, GFP_KERNEL); if (!rq) goto out_put_autopm_host; diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index aa0c8ef9a50f..f3d78b939e01 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -303,15 +303,6 @@ struct blk_mq_queue_data { KABI_RESERVE(1) };
-struct request_wrapper { - struct request rq; - - /* Time that I/O was counted in part_get_stat_info(). */ - u64 stat_time_ns; -}; - -#define request_to_wrapper(_rq) container_of(_rq, struct request_wrapper, rq) - typedef bool (busy_iter_fn)(struct blk_mq_hw_ctx *, struct request *, void *, bool); typedef bool (busy_tag_iter_fn)(struct request *, void *, bool); @@ -606,7 +597,7 @@ static inline bool blk_should_fake_timeout(struct request_queue *q) */ static inline struct request *blk_mq_rq_from_pdu(void *pdu) { - return pdu - sizeof(struct request_wrapper); + return pdu - sizeof(struct request); }
/** @@ -620,7 +611,7 @@ static inline struct request *blk_mq_rq_from_pdu(void *pdu) */ static inline void *blk_mq_rq_to_pdu(struct request *rq) { - return request_to_wrapper(rq) + 1; + return rq + 1; }
static inline struct blk_mq_hw_ctx *queue_hctx(struct request_queue *q, int id)
From: Yu Kuai yukuai3@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I65K8D CVE: NA
--------------------------------
request_wrapper is used to fix kabi broken for request, it's only for internal use. This patch make sure out-of-tree drivers won't access request_wrapper if request is not managed by block layer.
Signed-off-by: Yu Kuai yukuai3@huawei.com Reviewed-by: Hou Tao houtao1@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- block/blk-core.c | 49 +++++++++++++++++++++++------------------- block/blk-flush.c | 2 +- block/blk-mq-debugfs.c | 5 +++-- block/blk-mq.c | 5 ++--- include/linux/blkdev.h | 2 ++ 5 files changed, 35 insertions(+), 28 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c index a18cfc467d41..df24a463f2ef 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1304,6 +1304,32 @@ static void blk_account_io_completion(struct request *req, unsigned int bytes) } }
+static void blk_account_io_latency(struct request *req, u64 now, const int sgrp) +{ + u64 stat_time; + struct request_wrapper *rq_wrapper; + + if (!IS_ENABLED(CONFIG_64BIT) || !(req->rq_flags & RQF_FROM_BLOCK)) { + part_stat_add(req->part, nsecs[sgrp], now - req->start_time_ns); + return; + } + + rq_wrapper = request_to_wrapper(req); + stat_time = READ_ONCE(rq_wrapper->stat_time_ns); + /* + * This might fail if 'stat_time_ns' is updated + * in blk_mq_check_inflight_with_stat(). + */ + if (likely(now > stat_time && + cmpxchg64(&rq_wrapper->stat_time_ns, stat_time, now) + == stat_time)) { + u64 duration = stat_time ? now - stat_time : + now - req->start_time_ns; + + part_stat_add(req->part, nsecs[sgrp], duration); + } +} + void blk_account_io_done(struct request *req, u64 now) { /* @@ -1315,36 +1341,15 @@ void blk_account_io_done(struct request *req, u64 now) !(req->rq_flags & RQF_FLUSH_SEQ)) { const int sgrp = op_stat_group(req_op(req)); struct hd_struct *part; -#ifdef CONFIG_64BIT - u64 stat_time; - struct request_wrapper *rq_wrapper = request_to_wrapper(req); -#endif
part_stat_lock(); part = req->part; update_io_ticks(part, jiffies, true); part_stat_inc(part, ios[sgrp]); -#ifdef CONFIG_64BIT - stat_time = READ_ONCE(rq_wrapper->stat_time_ns); - /* - * This might fail if 'stat_time_ns' is updated - * in blk_mq_check_inflight_with_stat(). - */ - if (likely(now > stat_time && - cmpxchg64(&rq_wrapper->stat_time_ns, stat_time, now) - == stat_time)) { - u64 duation = stat_time ? now - stat_time : - now - req->start_time_ns; - - part_stat_add(req->part, nsecs[sgrp], duation); - } -#else - part_stat_add(part, nsecs[sgrp], now - req->start_time_ns); -#endif + blk_account_io_latency(req, now, sgrp); if (precise_iostat) part_stat_local_dec(part, in_flight[rq_data_dir(req)]); part_stat_unlock(); - hd_struct_put(part); } } diff --git a/block/blk-flush.c b/block/blk-flush.c index 767624910270..65753f781c20 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c @@ -333,7 +333,7 @@ static void blk_kick_flush(struct request_queue *q, struct blk_flush_queue *fq,
flush_rq->cmd_flags = REQ_OP_FLUSH | REQ_PREFLUSH; flush_rq->cmd_flags |= (flags & REQ_DRV) | (flags & REQ_FAILFAST_MASK); - flush_rq->rq_flags |= RQF_FLUSH_SEQ; + flush_rq->rq_flags |= RQF_FLUSH_SEQ | RQF_FROM_BLOCK; flush_rq->rq_disk = first_rq->rq_disk; flush_rq->end_io = flush_end_io; /* diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 8a86fa590db1..a879f94782e4 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -360,8 +360,9 @@ int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq) blk_flags_show(m, rq->cmd_flags & ~REQ_OP_MASK, cmd_flag_name, ARRAY_SIZE(cmd_flag_name)); seq_puts(m, ", .rq_flags="); - blk_flags_show(m, (__force unsigned int)rq->rq_flags, rqf_name, - ARRAY_SIZE(rqf_name)); + blk_flags_show(m, + (__force unsigned int)(rq->rq_flags & ~RQF_FROM_BLOCK), + rqf_name, ARRAY_SIZE(rqf_name)); seq_printf(m, ", .state=%s", blk_mq_rq_state_name(blk_mq_rq_state(rq))); seq_printf(m, ", .tag=%d, .internal_tag=%d", rq->tag, rq->internal_tag); diff --git a/block/blk-mq.c b/block/blk-mq.c index 4c719469ba8e..1c4a4e197e65 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -115,9 +115,8 @@ static bool blk_mq_check_inflight_with_stat(struct blk_mq_hw_ctx *hctx, struct request_wrapper *rq_wrapper;
mi->inflight[rq_data_dir(rq)]++; - if (!rq->part) + if (!rq->part || !(rq->rq_flags & RQF_FROM_BLOCK)) return true; - /* * If the request is started after 'part->stat_time' is set, * don't update 'nsces' here. @@ -375,7 +374,7 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, rq->q = data->q; rq->mq_ctx = data->ctx; rq->mq_hctx = data->hctx; - rq->rq_flags = 0; + rq->rq_flags = RQF_FROM_BLOCK; rq->cmd_flags = data->cmd_flags; if (data->flags & BLK_MQ_REQ_PM) rq->rq_flags |= RQF_PM; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index e4bcb11d6202..eed319e5d192 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -115,6 +115,8 @@ typedef __u32 __bitwise req_flags_t; #define RQF_MQ_POLL_SLEPT ((__force req_flags_t)(1 << 20)) /* ->timeout has been called, don't expire again */ #define RQF_TIMED_OUT ((__force req_flags_t)(1 << 21)) +/* The rq is allocated from block layer */ +#define RQF_FROM_BLOCK ((__force req_flags_t)(1 << 22))
/* flags that prevent us from merging requests: */ #define RQF_NOMERGE_FLAGS \
From: Junhao He hejunhao3@huawei.com
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5YCYK
--------------------------------------------------------------------------
TRBE device can use the id_tabel to match driver. So if the CoreSight component does not use the device tree or ACPI to report devices (@fwnode is NULL), we need to return the pointer to the platform data @pdata.
Signed-off-by: Junhao He hejunhao3@huawei.com Reviewed-by: Xiongfeng Wang wangxiongfeng2@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- drivers/hwtracing/coresight/coresight-platform.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c index c594f45319fc..82b900076dbd 100644 --- a/drivers/hwtracing/coresight/coresight-platform.c +++ b/drivers/hwtracing/coresight/coresight-platform.c @@ -844,15 +844,15 @@ coresight_get_platform_data(struct device *dev) struct coresight_platform_data *pdata = NULL; struct fwnode_handle *fwnode = dev_fwnode(dev);
- if (IS_ERR_OR_NULL(fwnode)) - goto error; - pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); if (!pdata) { ret = -ENOMEM; goto error; }
+ if (IS_ERR_OR_NULL(fwnode)) + return pdata; + if (is_of_node(fwnode)) ret = of_get_coresight_platform_data(dev, pdata); else if (is_acpi_device_node(fwnode))
From: Xiongfeng Wang wangxiongfeng2@huawei.com
driver inclusion category: featurn bugzilla: https://gitee.com/openeuler/kernel/issues/I5YCYK
--------------------------------------------------------------------------
ACPI 6.5 spec introduce 'TRBE Interrupt' field in GICC structure. Add support for it in linux code.
Signed-off-by: Xiongfeng Wang wangxiongfeng2@huawei.com Signed-off-by: Junhao He hejunhao3@huawei.com Reviewed-by: Xiongfeng Wang wangxiongfeng2@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- include/acpi/actbl2.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 68591a476aed..b45040bdd541 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -647,7 +647,7 @@ struct acpi_madt_local_x2apic_nmi { u8 reserved[3]; /* reserved - must be zero */ };
-/* 11: Generic interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 changes) */ +/* 11: Generic interrupt - GICC (ACPI 5.0 + ACPI 6.0 + ACPI 6.3 + ACPI 6.5 changes) */
struct acpi_madt_generic_interrupt { struct acpi_subtable_header header; @@ -667,6 +667,7 @@ struct acpi_madt_generic_interrupt { u8 efficiency_class; u8 reserved2[1]; u16 spe_interrupt; /* ACPI 6.3 */ + u16 trbe_interrupt; /* ACPI 6.5 */ };
/* Masks for Flags field above */
From: Junhao He hejunhao3@huawei.com
driver inclusion category: featurn bugzilla: https://gitee.com/openeuler/kernel/issues/I5YCYK
--------------------------------------------------------------------------
ACPI 6.5 adds additional fields to the MADT GICC structure to describe TRBE PPI's. We pick these out of the cached reference to the madt_gicc structure similarly to the arm SPE code. We then create a platform device referring to the IRQ and let the user/module loader decide whether to load the TRBE driver.
Signed-off-by: Junhao He hejunhao3@huawei.com Reviewed-by: Xiongfeng Wang wangxiongfeng2@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@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 insertions(+) create mode 100644 arch/arm64/kernel/acpi_trbe.c
diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig index b276b14fc5c8..30384eacad4f 100644 --- a/arch/arm64/configs/openeuler_defconfig +++ b/arch/arm64/configs/openeuler_defconfig @@ -7299,6 +7299,7 @@ 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 df0ef7ec5b5b..8f67d367e381 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -42,6 +42,9 @@ #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 312c164db2ed..05f0ed3ad1d8 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -54,6 +54,7 @@ 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 new file mode 100644 index 000000000000..5d983ea8c812 --- /dev/null +++ b/arch/arm64/kernel/acpi_trbe.c @@ -0,0 +1,81 @@ +// 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 017551d9b89e..efb439fc0a32 100644 --- a/drivers/hwtracing/coresight/Kconfig +++ b/drivers/hwtracing/coresight/Kconfig @@ -200,3 +200,7 @@ 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 85008a65e21f..fdd2cdaaf898 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -33,6 +33,8 @@
#define CORESIGHT_UNLOCK 0xc5acce55
+#define ARMV9_TRBE_PDEV_NAME "arm,trbe-v1" + extern struct bus_type coresight_bustype;
enum coresight_dev_type {
From: Junhao He hejunhao3@huawei.com
driver inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5YCYK
--------------------------------------------------------------------------
Lets add the MODULE_TABLE and platform id_table entries so that the TRBE driver can attach to the ACPI platform device created by the acpi trbe code.
Signed-off-by: Junhao He hejunhao3@huawei.com Reviewed-by: Xiongfeng Wang wangxiongfeng2@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- drivers/hwtracing/coresight/coresight-trbe.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c index a84f4a51e08a..881a89e245fb 100644 --- a/drivers/hwtracing/coresight/coresight-trbe.c +++ b/drivers/hwtracing/coresight/coresight-trbe.c @@ -1189,7 +1189,14 @@ static const struct of_device_id arm_trbe_of_match[] = { }; MODULE_DEVICE_TABLE(of, arm_trbe_of_match);
+static const struct platform_device_id arm_trbe_match[] = { + { ARMV9_TRBE_PDEV_NAME, 0}, + {} +}; +MODULE_DEVICE_TABLE(platform, arm_trbe_match); + static struct platform_driver arm_trbe_driver = { + .id_table = arm_trbe_match, .driver = { .name = DRVNAME, .of_match_table = of_match_ptr(arm_trbe_of_match),