diff options
author | Mark Rutland <mark.rutland@arm.com> | 2018-02-05 11:41:56 -0500 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2018-02-20 06:34:53 -0500 |
commit | c0248c96631f38f02d58762fc018e316843acac8 (patch) | |
tree | 3a716695fa283979fbe6e73e77f18ce8b69ed2c8 | |
parent | 2b05f6ae1ee5a3c625478acd10b0966b66a3a017 (diff) |
arm_pmu: kill arm_pmu_platdata
Now that we have no platforms passing platform data to the arm_pmu code,
we can get rid of the platdata and associated hooks, paving the way for
rework of our IRQ handling.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | drivers/perf/arm_pmu.c | 27 | ||||
-rw-r--r-- | include/linux/perf/arm_pmu.h | 17 |
2 files changed, 4 insertions, 40 deletions
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index 7bc5eee96b31..82b09d1cb42c 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/export.h> | 17 | #include <linux/export.h> |
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/perf/arm_pmu.h> | 19 | #include <linux/perf/arm_pmu.h> |
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
22 | #include <linux/sched/clock.h> | 21 | #include <linux/sched/clock.h> |
23 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
@@ -320,17 +319,9 @@ validate_group(struct perf_event *event) | |||
320 | return 0; | 319 | return 0; |
321 | } | 320 | } |
322 | 321 | ||
323 | static struct arm_pmu_platdata *armpmu_get_platdata(struct arm_pmu *armpmu) | ||
324 | { | ||
325 | struct platform_device *pdev = armpmu->plat_device; | ||
326 | |||
327 | return pdev ? dev_get_platdata(&pdev->dev) : NULL; | ||
328 | } | ||
329 | |||
330 | static irqreturn_t armpmu_dispatch_irq(int irq, void *dev) | 322 | static irqreturn_t armpmu_dispatch_irq(int irq, void *dev) |
331 | { | 323 | { |
332 | struct arm_pmu *armpmu; | 324 | struct arm_pmu *armpmu; |
333 | struct arm_pmu_platdata *plat; | ||
334 | int ret; | 325 | int ret; |
335 | u64 start_clock, finish_clock; | 326 | u64 start_clock, finish_clock; |
336 | 327 | ||
@@ -342,13 +333,8 @@ static irqreturn_t armpmu_dispatch_irq(int irq, void *dev) | |||
342 | */ | 333 | */ |
343 | armpmu = *(void **)dev; | 334 | armpmu = *(void **)dev; |
344 | 335 | ||
345 | plat = armpmu_get_platdata(armpmu); | ||
346 | |||
347 | start_clock = sched_clock(); | 336 | start_clock = sched_clock(); |
348 | if (plat && plat->handle_irq) | 337 | ret = armpmu->handle_irq(irq, armpmu); |
349 | ret = plat->handle_irq(irq, armpmu, armpmu->handle_irq); | ||
350 | else | ||
351 | ret = armpmu->handle_irq(irq, armpmu); | ||
352 | finish_clock = sched_clock(); | 338 | finish_clock = sched_clock(); |
353 | 339 | ||
354 | perf_sample_event_took(finish_clock - start_clock); | 340 | perf_sample_event_took(finish_clock - start_clock); |
@@ -578,7 +564,6 @@ int armpmu_request_irq(struct arm_pmu *armpmu, int cpu) | |||
578 | goto err_out; | 564 | goto err_out; |
579 | } | 565 | } |
580 | } else { | 566 | } else { |
581 | struct arm_pmu_platdata *platdata = armpmu_get_platdata(armpmu); | ||
582 | unsigned long irq_flags; | 567 | unsigned long irq_flags; |
583 | 568 | ||
584 | err = irq_force_affinity(irq, cpumask_of(cpu)); | 569 | err = irq_force_affinity(irq, cpumask_of(cpu)); |
@@ -589,13 +574,9 @@ int armpmu_request_irq(struct arm_pmu *armpmu, int cpu) | |||
589 | goto err_out; | 574 | goto err_out; |
590 | } | 575 | } |
591 | 576 | ||
592 | if (platdata && platdata->irq_flags) { | 577 | irq_flags = IRQF_PERCPU | |
593 | irq_flags = platdata->irq_flags; | 578 | IRQF_NOBALANCING | |
594 | } else { | 579 | IRQF_NO_THREAD; |
595 | irq_flags = IRQF_PERCPU | | ||
596 | IRQF_NOBALANCING | | ||
597 | IRQF_NO_THREAD; | ||
598 | } | ||
599 | 580 | ||
600 | err = request_irq(irq, handler, irq_flags, "arm-pmu", | 581 | err = request_irq(irq, handler, irq_flags, "arm-pmu", |
601 | per_cpu_ptr(&hw_events->percpu_pmu, cpu)); | 582 | per_cpu_ptr(&hw_events->percpu_pmu, cpu)); |
diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h index af0f44effd44..712764b35c6a 100644 --- a/include/linux/perf/arm_pmu.h +++ b/include/linux/perf/arm_pmu.h | |||
@@ -17,23 +17,6 @@ | |||
17 | #include <linux/sysfs.h> | 17 | #include <linux/sysfs.h> |
18 | #include <asm/cputype.h> | 18 | #include <asm/cputype.h> |
19 | 19 | ||
20 | /* | ||
21 | * struct arm_pmu_platdata - ARM PMU platform data | ||
22 | * | ||
23 | * @handle_irq: an optional handler which will be called from the | ||
24 | * interrupt and passed the address of the low level handler, | ||
25 | * and can be used to implement any platform specific handling | ||
26 | * before or after calling it. | ||
27 | * | ||
28 | * @irq_flags: if non-zero, these flags will be passed to request_irq | ||
29 | * when requesting interrupts for this PMU device. | ||
30 | */ | ||
31 | struct arm_pmu_platdata { | ||
32 | irqreturn_t (*handle_irq)(int irq, void *dev, | ||
33 | irq_handler_t pmu_handler); | ||
34 | unsigned long irq_flags; | ||
35 | }; | ||
36 | |||
37 | #ifdef CONFIG_ARM_PMU | 20 | #ifdef CONFIG_ARM_PMU |
38 | 21 | ||
39 | /* | 22 | /* |