Skip to content

Commit bc1e3c4

Browse files
sudeep-hollawildea01
authored andcommitted
ARM: perf: replace arch_find_n_match_cpu_physical_id with of_cpu_device_node_get
arch_find_n_match_cpu_physical_id parses the device tree to get the device node for a given logical cpu index. However, since ARM PMUs get probed after the CPU device nodes are stashed while registering the cpus, we can use of_cpu_device_node_get to avoid another DT parse. This patch replaces arch_find_n_match_cpu_physical_id with of_cpu_device_node_get to reuse the stashed value directly instead. Cc: Will Deacon <will.deacon@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent b6c084d commit bc1e3c4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎arch/arm/kernel/perf_event.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <linux/cpumask.h>
1616
#include <linux/export.h>
1717
#include <linux/kernel.h>
18-
#include <linux/of.h>
18+
#include <linux/of_device.h>
1919
#include <linux/platform_device.h>
2020
#include <linux/slab.h>
2121
#include <linux/spinlock.h>
@@ -824,7 +824,7 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)
824824

825825
/* Now look up the logical CPU number */
826826
for_each_possible_cpu(cpu)
827-
if (arch_find_n_match_cpu_physical_id(dn, cpu, NULL))
827+
if (dn == of_cpu_device_node_get(cpu))
828828
break;
829829

830830
if (cpu >= nr_cpu_ids) {

0 commit comments

Comments
 (0)