aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Hunter <jon-hunter@ti.com>2012-10-25 16:23:18 -0400
committerWill Deacon <will.deacon@arm.com>2012-11-09 06:37:26 -0500
commit2ac29a14a8b6b4a37c09c50db88dc893e6e7fc75 (patch)
tree8fdaf547b7080e3dd730e32451470eb8bcfa607f
parent0305230a3d92d6829db89c9e0c096d4d8733f317 (diff)
ARM: PMU: fix runtime PM enable
Commit 7be2958 (ARM: PMU: Add runtime PM Support) updated the ARM PMU code to use runtime PM which was prototyped and validated on the OMAP devices. In this commit, there is no call pm_runtime_enable() and for OMAP devices pm_runtime_enable() is currently being called from the OMAP PMU code when the PMU device is created. However, there are two problems with this: 1. For any other ARM device wishing to use runtime PM for PMU they will need to call pm_runtime_enable() for runtime PM to work. 2. When booting with device-tree and using device-tree to create the PMU device, pm_runtime_enable() needs to be called from within the ARM PERF driver as we are no longer calling any device specific code to create the device. Hence, PMU does not work on OMAP devices that use the runtime PM callbacks when using device-tree to create the PMU device. Therefore, call pm_runtime_enable() directly from the ARM PMU driver when registering the device. For platforms that do not use runtime PM, pm_runtime_enable() does nothing and for platforms that do use runtime PM but may not require it specifically for PMU, this will just add a little overhead when initialising and uninitialising the PMU device. Tested with PERF on OMAP2420, OMAP3430 and OMAP4460. Acked-by: Kevin Hilman <khilman@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Jon Hunter <jon-hunter@ti.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--arch/arm/kernel/perf_event.c1
-rw-r--r--arch/arm/mach-omap2/pmu.c2
2 files changed, 1 insertions, 2 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 1243deda5bbb..f9e8657dd241 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -514,6 +514,7 @@ static void __init armpmu_init(struct arm_pmu *armpmu)
514int armpmu_register(struct arm_pmu *armpmu, int type) 514int armpmu_register(struct arm_pmu *armpmu, int type)
515{ 515{
516 armpmu_init(armpmu); 516 armpmu_init(armpmu);
517 pm_runtime_enable(&armpmu->plat_device->dev);
517 pr_info("enabled with %s PMU driver, %d counters available\n", 518 pr_info("enabled with %s PMU driver, %d counters available\n",
518 armpmu->name, armpmu->num_events); 519 armpmu->name, armpmu->num_events);
519 return perf_pmu_register(&armpmu->pmu, armpmu->name, type); 520 return perf_pmu_register(&armpmu->pmu, armpmu->name, type);
diff --git a/arch/arm/mach-omap2/pmu.c b/arch/arm/mach-omap2/pmu.c
index 2a791766283d..031e2fbd0e19 100644
--- a/arch/arm/mach-omap2/pmu.c
+++ b/arch/arm/mach-omap2/pmu.c
@@ -57,8 +57,6 @@ static int __init omap2_init_pmu(unsigned oh_num, char *oh_names[])
57 if (IS_ERR(omap_pmu_dev)) 57 if (IS_ERR(omap_pmu_dev))
58 return PTR_ERR(omap_pmu_dev); 58 return PTR_ERR(omap_pmu_dev);
59 59
60 pm_runtime_enable(&omap_pmu_dev->dev);
61
62 return 0; 60 return 0;
63} 61}
64 62