aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig8
-rw-r--r--arch/arm/include/asm/pmu.h34
-rw-r--r--arch/arm/kernel/Makefile1
-rw-r--r--arch/arm/kernel/perf_event.c8
-rw-r--r--arch/arm/kernel/pmu.c36
5 files changed, 1 insertions, 86 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6d6e18fee9fe..1d5ce138b877 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1179,12 +1179,6 @@ config XSCALE_PMU
1179 depends on CPU_XSCALE 1179 depends on CPU_XSCALE
1180 default y 1180 default y
1181 1181
1182config CPU_HAS_PMU
1183 depends on (CPU_V6 || CPU_V6K || CPU_V7 || XSCALE_PMU) && \
1184 (!ARCH_OMAP3 || OMAP3_EMU)
1185 default y
1186 bool
1187
1188config MULTI_IRQ_HANDLER 1182config MULTI_IRQ_HANDLER
1189 bool 1183 bool
1190 help 1184 help
@@ -1757,7 +1751,7 @@ config HIGHPTE
1757 1751
1758config HW_PERF_EVENTS 1752config HW_PERF_EVENTS
1759 bool "Enable hardware performance counter support for perf events" 1753 bool "Enable hardware performance counter support for perf events"
1760 depends on PERF_EVENTS && CPU_HAS_PMU 1754 depends on PERF_EVENTS
1761 default y 1755 default y
1762 help 1756 help
1763 Enable hardware performance counter support for perf events. If 1757 Enable hardware performance counter support for perf events. If
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h
index 40d7dff8bc30..05e0401d7697 100644
--- a/arch/arm/include/asm/pmu.h
+++ b/arch/arm/include/asm/pmu.h
@@ -49,40 +49,6 @@ struct arm_pmu_platdata {
49 int (*runtime_suspend)(struct device *dev); 49 int (*runtime_suspend)(struct device *dev);
50}; 50};
51 51
52#ifdef CONFIG_CPU_HAS_PMU
53
54/**
55 * reserve_pmu() - reserve the hardware performance counters
56 *
57 * Reserve the hardware performance counters in the system for exclusive use.
58 * Returns 0 on success or -EBUSY if the lock is already held.
59 */
60extern int
61reserve_pmu(enum arm_pmu_type type);
62
63/**
64 * release_pmu() - Relinquish control of the performance counters
65 *
66 * Release the performance counters and allow someone else to use them.
67 */
68extern void
69release_pmu(enum arm_pmu_type type);
70
71#else /* CONFIG_CPU_HAS_PMU */
72
73#include <linux/err.h>
74
75static inline int
76reserve_pmu(enum arm_pmu_type type)
77{
78 return -ENODEV;
79}
80
81static inline void
82release_pmu(enum arm_pmu_type type) { }
83
84#endif /* CONFIG_CPU_HAS_PMU */
85
86#ifdef CONFIG_HW_PERF_EVENTS 52#ifdef CONFIG_HW_PERF_EVENTS
87 53
88/* The events for a given PMU register set. */ 54/* The events for a given PMU register set. */
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 7ad2d5cf7008..cfbe3b4d1d5e 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -69,7 +69,6 @@ obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o
69obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o 69obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
70obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o 70obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o
71obj-$(CONFIG_IWMMXT) += iwmmxt.o 71obj-$(CONFIG_IWMMXT) += iwmmxt.o
72obj-$(CONFIG_CPU_HAS_PMU) += pmu.o
73obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o 72obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o
74AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt 73AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
75obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o 74obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 3aa338849133..1ac1531dcfef 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -377,7 +377,6 @@ armpmu_release_hardware(struct arm_pmu *armpmu)
377 } 377 }
378 378
379 pm_runtime_put_sync(&pmu_device->dev); 379 pm_runtime_put_sync(&pmu_device->dev);
380 release_pmu(armpmu->type);
381} 380}
382 381
383static int 382static int
@@ -391,12 +390,6 @@ armpmu_reserve_hardware(struct arm_pmu *armpmu)
391 if (!pmu_device) 390 if (!pmu_device)
392 return -ENODEV; 391 return -ENODEV;
393 392
394 err = reserve_pmu(armpmu->type);
395 if (err) {
396 pr_warning("unable to reserve pmu\n");
397 return err;
398 }
399
400 plat = dev_get_platdata(&pmu_device->dev); 393 plat = dev_get_platdata(&pmu_device->dev);
401 if (plat && plat->handle_irq) 394 if (plat && plat->handle_irq)
402 handle_irq = armpmu_platform_irq; 395 handle_irq = armpmu_platform_irq;
@@ -706,7 +699,6 @@ static void __init cpu_pmu_init(struct arm_pmu *armpmu)
706 raw_spin_lock_init(&events->pmu_lock); 699 raw_spin_lock_init(&events->pmu_lock);
707 } 700 }
708 armpmu->get_hw_events = armpmu_get_cpu_events; 701 armpmu->get_hw_events = armpmu_get_cpu_events;
709 armpmu->type = ARM_PMU_DEVICE_CPU;
710} 702}
711 703
712/* 704/*
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c
deleted file mode 100644
index 2334bf8a650a..000000000000
--- a/arch/arm/kernel/pmu.c
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * linux/arch/arm/kernel/pmu.c
3 *
4 * Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles
5 * Copyright (C) 2010 ARM Ltd, Will Deacon
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#include <linux/err.h>
14#include <linux/kernel.h>
15#include <linux/module.h>
16
17#include <asm/pmu.h>
18
19/*
20 * PMU locking to ensure mutual exclusion between different subsystems.
21 */
22static unsigned long pmu_lock[BITS_TO_LONGS(ARM_NUM_PMU_DEVICES)];
23
24int
25reserve_pmu(enum arm_pmu_type type)
26{
27 return test_and_set_bit_lock(type, pmu_lock) ? -EBUSY : 0;
28}
29EXPORT_SYMBOL_GPL(reserve_pmu);
30
31void
32release_pmu(enum arm_pmu_type type)
33{
34 clear_bit_unlock(type, pmu_lock);
35}
36EXPORT_SYMBOL_GPL(release_pmu);