Skip to content

Commit

Permalink
arm64: perf: replace arch_find_n_match_cpu_physical_id with of_cpu_de…
Browse files Browse the repository at this point in the history
…vice_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>
  • Loading branch information
Sudeep Holla authored and Will Deacon committed Jul 27, 2015
1 parent 2d23ed0 commit d09ce83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm64/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/perf_event.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -1335,7 +1335,7 @@ static int armpmu_device_probe(struct platform_device *pdev)
}

for_each_possible_cpu(cpu)
if (arch_find_n_match_cpu_physical_id(dn, cpu, NULL))
if (dn == of_cpu_device_node_get(cpu))
break;

if (cpu >= nr_cpu_ids) {
Expand Down

0 comments on commit d09ce83

Please sign in to comment.