summaryrefslogtreecommitdiff
path: root/drivers/perf
diff options
context:
space:
mode:
authorMartin Fuzzey <mfuzzey@parkeon.com>2016-01-13 23:36:26 -0500
committerKyle Yan <kyan@codeaurora.org>2016-04-27 19:05:04 -0700
commita174566232c18182f9787ed19bbac681b2b755da (patch)
tree9e38d6229b3532da99ab2446c60a5cb29dce4cbc /drivers/perf
parent1c02e6eda9f41069e1813fa7cf656473a470d889 (diff)
ARM: perf: Set ARMv7 SDER SUNIDEN bit
ARMv7 counters other than the CPU cycle counter only work if the Secure Debug Enable Register (SDER) SUNIDEN bit is set. Since access to the SDER is only possible in secure state, it will only be done if the device tree property "secure-reg-access" is set. Without this: Performance counter stats for 'sleep 1': 14606094 cycles # 0.000 GHz 0 instructions # 0.00 insns per cycle After applying: Performance counter stats for 'sleep 1': 5843809 cycles 2566484 instructions # 0.44 insns per cycle 1.020144000 seconds time elapsed Some platforms (eg i.MX53) may also need additional platform specific setup. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com> Signed-off-by: Pooya Keshavarzi <Pooya.Keshavarzi@de.bosch.com> Signed-off-by: George G. Davis <george_davis@mentor.com> [will: add warning if property is found on arm64] Signed-off-by: Will Deacon <will.deacon@arm.com> Git-commit: 8d1a0ae724ad74ef7946a45e3b2d3e01f39df02b Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git CRs-Fixed: 1008368 Change-Id: Ic946deff2433ada458eb8040ddf40615a0a80959 Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Diffstat (limited to 'drivers/perf')
-rw-r--r--drivers/perf/arm_pmu.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
index 45b614014caa..54729f485b69 100644
--- a/drivers/perf/arm_pmu.c
+++ b/drivers/perf/arm_pmu.c
@@ -890,6 +890,15 @@ int arm_pmu_device_probe(struct platform_device *pdev,
if (node && (of_id = of_match_node(of_table, pdev->dev.of_node))) {
init_fn = of_id->data;
+ pmu->secure_access = of_property_read_bool(pdev->dev.of_node,
+ "secure-reg-access");
+
+ /* arm64 systems boot only as non-secure */
+ if (IS_ENABLED(CONFIG_ARM64) && pmu->secure_access) {
+ pr_warn("ignoring \"secure-reg-access\" property for arm64\n");
+ pmu->secure_access = false;
+ }
+
ret = of_pmu_irq_cfg(pmu);
if (!ret)
ret = init_fn(pmu);