ARM: tegra: Don't include idle time in irqsoff/preemptoff tracers
authorTodd Poynor <toddpoynor@google.com>
Sat, 6 Nov 2010 01:22:08 +0000 (18:22 -0700)
committerTodd Poynor <toddpoynor@google.com>
Sat, 6 Nov 2010 02:10:28 +0000 (19:10 -0700)
Surprise bonus change: Rename tegra_enter_idle to more accurately reflect
what it does.

Change-Id: I1237e1271df693c109b9db8b47421f8a4c3043c3
Signed-off-by: Todd Poynor <toddpoynor@google.com>
arch/arm/mach-tegra/cpuidle.c
arch/arm/mach-tegra/suspend.c

index 765e368401aa158b5e4d56352e6635c9054a23d5..a063c34ecf60aa142df1652ecb6b274794fe528e 100644 (file)
@@ -131,12 +131,14 @@ static inline void tegra_flow_wfi(struct cpuidle_device *dev)
 
        flow_ctrl = flow_ctrl + FLOW_CTRL_HALT_CPUx_EVENTS(dev->cpu);
 
+       stop_critical_timings();
        dsb();
        __raw_writel(reg, flow_ctrl);
        reg = __raw_readl(flow_ctrl);
        __asm__ volatile ("wfi");
        __raw_writel(0, flow_ctrl);
        reg = __raw_readl(flow_ctrl);
+       start_critical_timings();
 }
 
 #ifdef CONFIG_SMP
@@ -377,6 +379,7 @@ static void tegra_idle_enter_lp2_cpu1(struct cpuidle_device *dev,
 
        /* Prepare CPU1 for LP2 by putting it in reset */
 
+       stop_critical_timings();
        gic_cpu_exit(0);
        barrier();
        twd_ctrl = readl(twd_base + 0x8);
@@ -398,6 +401,7 @@ static void tegra_idle_enter_lp2_cpu1(struct cpuidle_device *dev,
        tegra_legacy_force_irq_clr(TEGRA_CPUIDLE_BOTH_IDLE);
 
        writel(smp_processor_id(), EVP_CPU_RESET_VECTOR);
+       start_critical_timings();
 
        /*
         * TODO: is it worth going back to wfi if no interrupt is pending
@@ -474,7 +478,7 @@ static int tegra_idle_enter_lp2(struct cpuidle_device *dev,
        return (int)us;
 }
 
-static int tegra_idle_enter(unsigned int cpu)
+static int tegra_cpuidle_register_device(unsigned int cpu)
 {
        struct cpuidle_device *dev;
        struct cpuidle_state *state;
@@ -589,7 +593,7 @@ static int __init tegra_cpuidle_init(void)
                return ret;
 
        for_each_possible_cpu(cpu) {
-               if (tegra_idle_enter(cpu))
+               if (tegra_cpuidle_register_device(cpu))
                        pr_err("CPU%u: error initializing idle loop\n", cpu);
        }
 
index 8c7d0a9ffe93f02b67a73e808e7005899242d2a5..f691e906eb0e7cab261b3fa2ac50df68f7538d2d 100644 (file)
@@ -365,6 +365,7 @@ unsigned int tegra_suspend_lp2(unsigned int us)
                tegra_lp2_set_trigger(us);
 
        suspend_cpu_complex();
+       stop_critical_timings();
        flush_cache_all();
        /* structure is written by reset code, so the L2 lines
         * must be invalidated */
@@ -375,6 +376,7 @@ unsigned int tegra_suspend_lp2(unsigned int us)
        /* return from __cortex_a9_restore */
        barrier();
        restore_cpu_complex();
+       start_critical_timings();
 
        remain = tegra_lp2_timer_remain();
        if (us)