mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 13:44:15 +08:00
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>
This commit is contained in:
parent
2b05f6ae1e
commit
c0248c9663
@ -17,7 +17,6 @@
|
|||||||
#include <linux/export.h>
|
#include <linux/export.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/perf/arm_pmu.h>
|
#include <linux/perf/arm_pmu.h>
|
||||||
#include <linux/platform_device.h>
|
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/sched/clock.h>
|
#include <linux/sched/clock.h>
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
@ -320,17 +319,9 @@ validate_group(struct perf_event *event)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct arm_pmu_platdata *armpmu_get_platdata(struct arm_pmu *armpmu)
|
|
||||||
{
|
|
||||||
struct platform_device *pdev = armpmu->plat_device;
|
|
||||||
|
|
||||||
return pdev ? dev_get_platdata(&pdev->dev) : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
|
static irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
|
||||||
{
|
{
|
||||||
struct arm_pmu *armpmu;
|
struct arm_pmu *armpmu;
|
||||||
struct arm_pmu_platdata *plat;
|
|
||||||
int ret;
|
int ret;
|
||||||
u64 start_clock, finish_clock;
|
u64 start_clock, finish_clock;
|
||||||
|
|
||||||
@ -342,13 +333,8 @@ static irqreturn_t armpmu_dispatch_irq(int irq, void *dev)
|
|||||||
*/
|
*/
|
||||||
armpmu = *(void **)dev;
|
armpmu = *(void **)dev;
|
||||||
|
|
||||||
plat = armpmu_get_platdata(armpmu);
|
|
||||||
|
|
||||||
start_clock = sched_clock();
|
start_clock = sched_clock();
|
||||||
if (plat && plat->handle_irq)
|
ret = armpmu->handle_irq(irq, armpmu);
|
||||||
ret = plat->handle_irq(irq, armpmu, armpmu->handle_irq);
|
|
||||||
else
|
|
||||||
ret = armpmu->handle_irq(irq, armpmu);
|
|
||||||
finish_clock = sched_clock();
|
finish_clock = sched_clock();
|
||||||
|
|
||||||
perf_sample_event_took(finish_clock - start_clock);
|
perf_sample_event_took(finish_clock - start_clock);
|
||||||
@ -578,7 +564,6 @@ int armpmu_request_irq(struct arm_pmu *armpmu, int cpu)
|
|||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
struct arm_pmu_platdata *platdata = armpmu_get_platdata(armpmu);
|
|
||||||
unsigned long irq_flags;
|
unsigned long irq_flags;
|
||||||
|
|
||||||
err = irq_force_affinity(irq, cpumask_of(cpu));
|
err = irq_force_affinity(irq, cpumask_of(cpu));
|
||||||
@ -589,13 +574,9 @@ int armpmu_request_irq(struct arm_pmu *armpmu, int cpu)
|
|||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platdata && platdata->irq_flags) {
|
irq_flags = IRQF_PERCPU |
|
||||||
irq_flags = platdata->irq_flags;
|
IRQF_NOBALANCING |
|
||||||
} else {
|
IRQF_NO_THREAD;
|
||||||
irq_flags = IRQF_PERCPU |
|
|
||||||
IRQF_NOBALANCING |
|
|
||||||
IRQF_NO_THREAD;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = request_irq(irq, handler, irq_flags, "arm-pmu",
|
err = request_irq(irq, handler, irq_flags, "arm-pmu",
|
||||||
per_cpu_ptr(&hw_events->percpu_pmu, cpu));
|
per_cpu_ptr(&hw_events->percpu_pmu, cpu));
|
||||||
|
@ -17,23 +17,6 @@
|
|||||||
#include <linux/sysfs.h>
|
#include <linux/sysfs.h>
|
||||||
#include <asm/cputype.h>
|
#include <asm/cputype.h>
|
||||||
|
|
||||||
/*
|
|
||||||
* struct arm_pmu_platdata - ARM PMU platform data
|
|
||||||
*
|
|
||||||
* @handle_irq: an optional handler which will be called from the
|
|
||||||
* interrupt and passed the address of the low level handler,
|
|
||||||
* and can be used to implement any platform specific handling
|
|
||||||
* before or after calling it.
|
|
||||||
*
|
|
||||||
* @irq_flags: if non-zero, these flags will be passed to request_irq
|
|
||||||
* when requesting interrupts for this PMU device.
|
|
||||||
*/
|
|
||||||
struct arm_pmu_platdata {
|
|
||||||
irqreturn_t (*handle_irq)(int irq, void *dev,
|
|
||||||
irq_handler_t pmu_handler);
|
|
||||||
unsigned long irq_flags;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef CONFIG_ARM_PMU
|
#ifdef CONFIG_ARM_PMU
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user