Unverified Commit 7f139733 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4730 coresight: trbe: Enable ACPI based devices

Merge Pull Request from: @ci-robot 
 
PR sync from: Junhao He <hejunhao3@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/U4H3F3ZKIE67EA6X6NRLJZDUVO4WN4CQ/ 
This series enables detection of ACPI based TRBE devices via a stand alone
purpose built representative platform device. But as a pre-requisite this
changes coresight_platform_data structure assignment for the TRBE device.

Anshuman Khandual (2):
  coresight: trbe: Add a representative coresight_platform_data for TRBE
  coresight: trbe: Enable ACPI based TRBE devices


-- 
2.33.0
 
https://gitee.com/openeuler/kernel/issues/I8BOB3 
 
Link:https://gitee.com/openeuler/kernel/pulls/4730

 

Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents 12359685 f85c334f
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -1253,8 +1253,18 @@ static void arm_trbe_register_coresight_cpu(struct trbe_drvdata *drvdata, int cp
	desc.name = devm_kasprintf(dev, GFP_KERNEL, "trbe%d", cpu);
	if (!desc.name)
		goto cpu_clear;

	desc.pdata = coresight_get_platform_data(dev);
	/*
	 * TRBE coresight devices do not need regular connections
	 * information, as the paths get built between all percpu
	 * source and their respective percpu sink devices. Though
	 * coresight_register() expect device connections via the
	 * platform_data, which TRBE devices do not have. As they
	 * are not real ACPI devices, coresight_get_platform_data()
	 * ends up failing. Instead let's allocate a dummy zeroed
	 * coresight_platform_data structure and assign that back
	 * into the device for that purpose.
	 */
	desc.pdata = devm_kzalloc(dev, sizeof(*desc.pdata), GFP_KERNEL);
	if (IS_ERR(desc.pdata))
		goto cpu_clear;

@@ -1536,7 +1546,16 @@ static const struct of_device_id arm_trbe_of_match[] = {
};
MODULE_DEVICE_TABLE(of, arm_trbe_of_match);

#ifdef CONFIG_ACPI
static const struct platform_device_id arm_trbe_acpi_match[] = {
	{ ARMV8_TRBE_PDEV_NAME, 0 },
	{ }
};
MODULE_DEVICE_TABLE(platform, arm_trbe_acpi_match);
#endif

static struct platform_driver arm_trbe_driver = {
	.id_table = ACPI_PTR(arm_trbe_acpi_match),
	.driver	= {
		.name = DRVNAME,
		.of_match_table = of_match_ptr(arm_trbe_of_match),
+2 −0
Original line number Diff line number Diff line
@@ -7,11 +7,13 @@
 *
 * Author: Anshuman Khandual <anshuman.khandual@arm.com>
 */
#include <linux/acpi.h>
#include <linux/coresight.h>
#include <linux/device.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/perf/arm_pmu.h>
#include <linux/platform_device.h>
#include <linux/smp.h>