summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Nihalani <bnihalani@nvidia.com>2011-10-19 18:54:11 +0530
committerSimone Willett <swillett@nvidia.com>2011-10-25 13:20:10 -0700
commit40fdf3442dbe00f5b38e59b8948f229d1b6aeb78 (patch)
tree8df2dbc6687dae9be8de6c706494bd9472dd6bbd
parent80c58a1366e9b1874beacb791aabe5ae6c20b963 (diff)
Revert "ARM: tegra: power: Update Tegra3 LP2 time prediction"
This reverts commit 47450edc2d22b5561c9aebcf09ea7179d8162c18. Bug 889103 Change-Id: If9b0755835b400b1d926f5a0fcb29afcc58530e0 Reviewed-on: http://git-master/r/59116 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/cpuidle-t3.c12
-rw-r--r--arch/arm/mach-tegra/localtimer.c4
-rw-r--r--arch/arm/mach-tegra/power.h1
3 files changed, 2 insertions, 15 deletions
diff --git a/arch/arm/mach-tegra/cpuidle-t3.c b/arch/arm/mach-tegra/cpuidle-t3.c
index 5d8bb1903aa5..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_cnt;
s64 request;
s64 sleep_time;
ktime_t enter;
@@ -277,15 +275,7 @@ void tegra_idle_enter_lp2_cpu_n(struct cpuidle_device *dev,
if (need_resched())
return;
- request = 0;
- twd_ctrl = readl(twd_base + TWD_TIMER_CONTROL);
-
- if ((twd_ctrl & TWD_TIMER_CONTROL_ENABLE) &&
- (twd_ctrl & TWD_TIMER_CONTROL_IT_ENABLE)) {
- twd_cnt = readl(twd_base + TWD_TIMER_COUNTER);
- request = twd_cnt / TWD_MHZ;
- }
-
+ request = ktime_to_us(tick_nohz_get_sleep_length());
if (request < tegra_lp2_exit_latency) {
/*
* Not enough time left to enter LP2
diff --git a/arch/arm/mach-tegra/localtimer.c b/arch/arm/mach-tegra/localtimer.c
index 09d63343eddf..ead217b90eea 100644
--- a/arch/arm/mach-tegra/localtimer.c
+++ b/arch/arm/mach-tegra/localtimer.c
@@ -15,8 +15,6 @@
#include <asm/smp_twd.h>
#include <asm/localtimer.h>
-#include "power.h"
-
/*
* Setup the local clock events for a CPU.
*/
@@ -26,6 +24,6 @@ void __cpuinit local_timer_setup(struct clock_event_device *evt)
#ifdef CONFIG_ARCH_TEGRA_2x_SOC
twd_timer_setup_scalable(evt, 2500000, 4);
#else
- twd_timer_setup_scalable(evt, TWD_MHZ * 1000000, 2);
+ twd_timer_setup_scalable(evt, 4000000, 2);
#endif
}
diff --git a/arch/arm/mach-tegra/power.h b/arch/arm/mach-tegra/power.h
index 3b1b9dcc1a67..5e462aceef50 100644
--- a/arch/arm/mach-tegra/power.h
+++ b/arch/arm/mach-tegra/power.h
@@ -167,7 +167,6 @@ static inline bool tegra_lp2_is_allowed(struct cpuidle_device *dev,
#define INSTRUMENT_CLUSTER_SWITCH 1 /* Should be zero for shipping code */
#define DEBUG_CLUSTER_SWITCH 1 /* Should be zero for shipping code */
#define PARAMETERIZE_CLUSTER_SWITCH 1 /* Should be zero for shipping code */
-#define TWD_MHZ 4 /* Local TWD timers rate */
int tegra_cluster_control(unsigned int us, unsigned int flags);
void tegra_cluster_switch_prolog(unsigned int flags);
void tegra_cluster_switch_epilog(unsigned int flags);