aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/perf_event.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/perf_event.c')
-rw-r--r--arch/arm/kernel/perf_event.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index d150ad1ccb5d..22e194eb8536 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -377,9 +377,18 @@ validate_group(struct perf_event *event)
377 return 0; 377 return 0;
378} 378}
379 379
380static irqreturn_t armpmu_platform_irq(int irq, void *dev)
381{
382 struct arm_pmu_platdata *plat = dev_get_platdata(&pmu_device->dev);
383
384 return plat->handle_irq(irq, dev, armpmu->handle_irq);
385}
386
380static int 387static int
381armpmu_reserve_hardware(void) 388armpmu_reserve_hardware(void)
382{ 389{
390 struct arm_pmu_platdata *plat;
391 irq_handler_t handle_irq;
383 int i, err = -ENODEV, irq; 392 int i, err = -ENODEV, irq;
384 393
385 pmu_device = reserve_pmu(ARM_PMU_DEVICE_CPU); 394 pmu_device = reserve_pmu(ARM_PMU_DEVICE_CPU);
@@ -390,6 +399,12 @@ armpmu_reserve_hardware(void)
390 399
391 init_pmu(ARM_PMU_DEVICE_CPU); 400 init_pmu(ARM_PMU_DEVICE_CPU);
392 401
402 plat = dev_get_platdata(&pmu_device->dev);
403 if (plat && plat->handle_irq)
404 handle_irq = armpmu_platform_irq;
405 else
406 handle_irq = armpmu->handle_irq;
407
393 if (pmu_device->num_resources < 1) { 408 if (pmu_device->num_resources < 1) {
394 pr_err("no irqs for PMUs defined\n"); 409 pr_err("no irqs for PMUs defined\n");
395 return -ENODEV; 410 return -ENODEV;
@@ -400,7 +415,7 @@ armpmu_reserve_hardware(void)
400 if (irq < 0) 415 if (irq < 0)
401 continue; 416 continue;
402 417
403 err = request_irq(irq, armpmu->handle_irq, 418 err = request_irq(irq, handle_irq,
404 IRQF_DISABLED | IRQF_NOBALANCING, 419 IRQF_DISABLED | IRQF_NOBALANCING,
405 "armpmu", NULL); 420 "armpmu", NULL);
406 if (err) { 421 if (err) {