From 11d1031e894c67145fb2bffee6f3af19ae4205d3 Mon Sep 17 00:00:00 2001 From: Alex Frid Date: Mon, 26 Sep 2011 14:16:32 -0700 Subject: ARM: tegra: power: Clean Tegra3 LP2 entry procedure - Do not save/restore local timer configuration across secondary CPU LP2 state. It is always preserved, since local timer is neither power gated nor reset when secondary CPU is in LP2. - Do not configure external timer for secondary CPU wake up, since we can and do use local timer instead. Moreover external timer interrupt in current code is not properly registered on secondary CPU, so timer is not waking up CPU, anyway. Change-Id: I702b31698708f1bed499d0e069dba08f447c73b6 Reviewed-on: http://git-master/r/54585 Reviewed-by: Rohan Somvanshi Tested-by: Rohan Somvanshi --- arch/arm/mach-tegra/cpuidle-t3.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-tegra/cpuidle-t3.c b/arch/arm/mach-tegra/cpuidle-t3.c index 386adf26b398..f45ae3e7fc9d 100644 --- a/arch/arm/mach-tegra/cpuidle-t3.c +++ b/arch/arm/mach-tegra/cpuidle-t3.c @@ -267,8 +267,6 @@ void tegra_idle_enter_lp2_cpu_0(struct cpuidle_device *dev, void tegra_idle_enter_lp2_cpu_n(struct cpuidle_device *dev, struct cpuidle_state *state) { - u32 twd_ctrl; - u32 twd_load; s64 request; s64 sleep_time; ktime_t enter; @@ -285,8 +283,6 @@ void tegra_idle_enter_lp2_cpu_n(struct cpuidle_device *dev, tegra_flow_wfi(dev); return; } - sleep_time = request - tegra_lp2_exit_latency; - tegra_lp2_set_trigger(sleep_time); idle_stats.tear_down_count[cpu_number(dev->cpu)]++; @@ -302,8 +298,6 @@ void tegra_idle_enter_lp2_cpu_n(struct cpuidle_device *dev, stop_critical_timings(); /* gic_cpu_exit(0); - we want to wake cpu_n on gic interrupt */ barrier(); - twd_ctrl = readl(twd_base + 0x8); - twd_load = readl(twd_base + 0); spin_lock(&lp2_map_lock); tegra_cpu_lp2_map |= (1 << dev->cpu); @@ -327,8 +321,6 @@ void tegra_idle_enter_lp2_cpu_n(struct cpuidle_device *dev, tegra_cpu_lp2_map &= ~(1 << dev->cpu); spin_unlock(&lp2_map_lock); - writel(twd_ctrl, twd_base + 0x8); - writel(twd_load, twd_base + 0); gic_cpu_init(0, IO_ADDRESS(TEGRA_ARM_PERIF_BASE) + 0x100); tegra_unmask_irq(IRQ_LOCALTIMER); @@ -336,16 +328,14 @@ void tegra_idle_enter_lp2_cpu_n(struct cpuidle_device *dev, writel(smp_processor_id(), EVP_CPU_RSVD_VECTOR); start_critical_timings(); - if (sleep_time) - tegra_lp2_set_trigger(0); /* * TODO: is it worth going back to wfi if no interrupt is pending * and the requested sleep time has not passed? */ exit = ktime_get(); - idle_stats.in_lp2_time[cpu_number(dev->cpu)] += - ktime_to_us(ktime_sub(exit, enter)); + sleep_time = ktime_to_us(ktime_sub(exit, enter)); + idle_stats.in_lp2_time[cpu_number(dev->cpu)] += sleep_time; return; } -- cgit v1.2.3