diff options
author | Scott Williams <scwilliams@nvidia.com> | 2011-07-22 13:15:39 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:46:51 -0800 |
commit | e90083c3acb65b0840e7c9060e764c773b89a302 (patch) | |
tree | 089ed0cd29ed1462ab4563a0e033f6c63398a4d8 /arch/arm/mach-tegra/cpuidle-t2.c | |
parent | 9967bd0823753a0a1413a557649c2f9cc3e3a308 (diff) |
ARM: tegra: Keep track of actual LP2 time
Change-Id: I570b771b67f76123fb81b41ceb27bebb9c9e011f
Signed-off-by: Scott Williams <scwilliams@nvidia.com>
DW: Split into logical changes
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
Rebase-Id: R5cace01cb03450d21fda2aca33ea806f13cc3015
Diffstat (limited to 'arch/arm/mach-tegra/cpuidle-t2.c')
-rw-r--r-- | arch/arm/mach-tegra/cpuidle-t2.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/cpuidle-t2.c b/arch/arm/mach-tegra/cpuidle-t2.c index 0fccb335e1cb..bda6a414cc4a 100644 --- a/arch/arm/mach-tegra/cpuidle-t2.c +++ b/arch/arm/mach-tegra/cpuidle-t2.c @@ -151,6 +151,8 @@ bool tegra2_lp2_is_allowed(struct cpuidle_device *dev, static int tegra2_idle_lp2_last(struct cpuidle_device *dev, struct cpuidle_state *state, s64 request) { + ktime_t entry_time; + ktime_t exit_time; bool sleep_completed = false; int i; @@ -166,6 +168,8 @@ static int tegra2_idle_lp2_last(struct cpuidle_device *dev, return -EBUSY; } + entry_time = ktime_get(); + if (tegra_idle_lp2_last(request, 0) == 0) sleep_completed = true; else @@ -178,11 +182,16 @@ static int tegra2_idle_lp2_last(struct cpuidle_device *dev, } } + exit_time = ktime_get(); if (sleep_completed) { /* * Stayed in LP2 for the full time until the next tick */ - pr_debug("%lld\n", request); + s64 actual_time = ktime_to_us(ktime_sub(exit_time, entry_time)); + long offset = (long)(actual_time - request); + + pr_debug("%lld %lld %ld\n", request, actual_time, + offset); } return 0; |