ARM: tegra: Clear PMU event overflow status
Bo Yan [Wed, 28 Nov 2012 04:10:15 +0000 (20:10 -0800)]
Change-Id: Ibae2f54f9fff94cc5b1778893c12dcd1808ac6a3
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/166766
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>

arch/arm/mach-tegra/common.c
arch/arm/mach-tegra/headsmp.S

index 88e7a1b..a5bc836 100644 (file)
@@ -541,7 +541,7 @@ static void __init tegra_perf_init(void)
 
        asm volatile("mrc p15, 0, %0, c9, c12, 0" : "=r"(reg));
        reg >>= 11;
-       reg &= 0x1f;
+       reg = (1 << (reg & 0x1f))-1;
        reg |= 0x80000000;
        asm volatile("mcr p15, 0, %0, c9, c14, 2" : : "r"(reg));
        reg = 1;
index d30644d..f9dc84b 100644 (file)
@@ -57,8 +57,11 @@ ENTRY(tegra_secondary_startup)
        mrc     p15, 0, r0, c9, c12, 0
        lsr     r0, #11
        and     r0, r0, #0x1f
-       movt    r0, #0x8000
-       mcr     p15, 0, r0, c9, c14, 2
+       mov     r1, #1
+       lsl     r1, r1, r0
+       sub     r1, r1, #1
+       movt    r1, #0x8000
+       mcr     p15, 0, r1, c9, c14, 2
        mov     r0, #1
        mcr     p15, 0, r0, c9, c14, 0