diff options
author | Jonas Aaberg <jonas.aberg@stericsson.com> | 2011-05-26 16:33:52 +0200 |
---|---|---|
committer | said m bagheri <ebgheri@steludxu2848.(none)> | 2011-06-17 13:42:06 +0200 |
commit | e0f58c0c1b17dbb4d6b483fc40f5868410b46130 (patch) | |
tree | 86cede34e2bb2988eb836909b47f08189e3e7a19 /arch | |
parent | 183e0092896aef114e50205f4407955967c36d05 (diff) |
ARM: ux500: cpuidle: Update enter/exit latencies
Update exit/enter latencies for ApDeepSleep, plus correct
latencies for ApSleep.
Also fix wake latency measurements.
ST-Ericsson Linux next: ER338824
ST-Ericsson ID: -
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: Ie24e591072ff50b2fd3c1570466f15c714aef154
Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/24042
Reviewed-by: QATEST
Reviewed-by: Rickard ANDERSSON <rickard.andersson@stericsson.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-ux500/pm/cpuidle.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-ux500/pm/cpuidle_dbg.c | 45 |
2 files changed, 38 insertions, 31 deletions
diff --git a/arch/arm/mach-ux500/pm/cpuidle.c b/arch/arm/mach-ux500/pm/cpuidle.c index ba02010a239..fe04634a5b2 100644 --- a/arch/arm/mach-ux500/pm/cpuidle.c +++ b/arch/arm/mach-ux500/pm/cpuidle.c @@ -44,15 +44,11 @@ * */ #define DEEP_SLEEP_WAKE_UP_LATENCY 8500 -/* Exit latency from ApSleep is measured to be around 1.0 to 1.5 ms */ +/* Wake latency from ApSleep is measured to be around 1.0 to 1.5 ms */ #define MIN_SLEEP_WAKE_UP_LATENCY 1000 #define MAX_SLEEP_WAKE_UP_LATENCY 1500 + #define UL_PLL_START_UP_LATENCY 8000 /* us */ -/* - * There must be at least 4 32 kHz cycles between each write to the RTC RTT - * CR register. - */ -#define RTC_LATENCY 120 static struct cstate cstates[] = { { @@ -117,12 +113,12 @@ static struct cstate cstates[] = { }, { .enter_latency = 250, - .exit_latency = MAX_SLEEP_WAKE_UP_LATENCY, + .exit_latency = MAX_SLEEP_WAKE_UP_LATENCY + 200, /* * Note: Sleep time must be longer than 120 us or else * there might be issues with the RTC-RTT block. */ - .threshold = MAX_SLEEP_WAKE_UP_LATENCY + 250 + RTC_LATENCY, + .threshold = MAX_SLEEP_WAKE_UP_LATENCY + 250 + 200, .power_usage = 3, .APE = APE_OFF, .ARM = ARM_RET, @@ -137,9 +133,9 @@ static struct cstate cstates[] = { { .enter_latency = 250, .exit_latency = (MAX_SLEEP_WAKE_UP_LATENCY + - UL_PLL_START_UP_LATENCY), + UL_PLL_START_UP_LATENCY + 200), .threshold = (MAX_SLEEP_WAKE_UP_LATENCY + - UL_PLL_START_UP_LATENCY + 250 + RTC_LATENCY), + UL_PLL_START_UP_LATENCY + 250 + 200), .power_usage = 2, .APE = APE_OFF, .ARM = ARM_RET, @@ -154,8 +150,8 @@ static struct cstate cstates[] = { #ifdef CONFIG_U8500_CPUIDLE_APDEEPIDLE { .enter_latency = 300, - .exit_latency = DEEP_SLEEP_WAKE_UP_LATENCY, - .threshold = DEEP_SLEEP_WAKE_UP_LATENCY + 300 + RTC_LATENCY, + .exit_latency = DEEP_SLEEP_WAKE_UP_LATENCY + 400, + .threshold = DEEP_SLEEP_WAKE_UP_LATENCY + 300 + 400, .power_usage = 2, .APE = APE_ON, .ARM = ARM_OFF, @@ -170,8 +166,8 @@ static struct cstate cstates[] = { #endif { .enter_latency = 310, - .exit_latency = DEEP_SLEEP_WAKE_UP_LATENCY, - .threshold = DEEP_SLEEP_WAKE_UP_LATENCY + 310 + RTC_LATENCY, + .exit_latency = DEEP_SLEEP_WAKE_UP_LATENCY + 420, + .threshold = DEEP_SLEEP_WAKE_UP_LATENCY + 310 + 420, .power_usage = 1, .APE = APE_OFF, .ARM = ARM_OFF, diff --git a/arch/arm/mach-ux500/pm/cpuidle_dbg.c b/arch/arm/mach-ux500/pm/cpuidle_dbg.c index 2639277d5be..5d3315dbf70 100644 --- a/arch/arm/mach-ux500/pm/cpuidle_dbg.c +++ b/arch/arm/mach-ux500/pm/cpuidle_dbg.c @@ -280,11 +280,11 @@ void ux500_ci_dbg_wake_latency(int ctarget, int sleep_time) zero_time = ktime_set(0, 0); sh = per_cpu(state_history, smp_processor_id()); - if (cstates[ctarget].state == CI_SLEEP) + if (cstates[ctarget].state >= CI_SLEEP) l = u8500_rtc_exit_latency_get(); if (cstates[ctarget].state == CI_IDLE) { - ktime_t d = ktime_set(0, sleep_time*1000); + ktime_t d = ktime_set(0, sleep_time * 1000); ktime_t now = ktime_get(); d = ktime_add(d, sh->start); @@ -447,7 +447,7 @@ static ssize_t set_deepest_state(struct file *file, i = cstates_len - 1; if (i == 0) - i = 1; + i = CI_WFI; deepest_allowed_state = i; @@ -502,10 +502,8 @@ static void stats_disp_one(struct seq_file *s, struct state_history *sh, memset(&avg, 0, sizeof(s64) * NUM_LATENCY); - if (measure_latency) { - for (j = 0; j < NUM_LATENCY; j++) - avg[j] = ktime_to_us(sh->states[i].latency_sum[j]); - } + for (j = 0; j < NUM_LATENCY; j++) + avg[j] = ktime_to_us(sh->states[i].latency_sum[j]); t_us = ktime_to_us(sh->states[i].time); perc = ktime_to_us(sh->states[i].time); @@ -514,11 +512,9 @@ static void stats_disp_one(struct seq_file *s, struct state_history *sh, if (total_us) do_div(perc, total_us); - if (measure_latency) { - for (j = 0; j < NUM_LATENCY; j++) { - if (sh->states[i].latency_count[j]) - do_div(avg[j], sh->states[i].latency_count[j]); - } + for (j = 0; j < NUM_LATENCY; j++) { + if (sh->states[i].latency_count[j]) + do_div(avg[j], sh->states[i].latency_count[j]); } seq_printf(s, "\n%d - %s: %u", @@ -542,28 +538,40 @@ static void stats_disp_one(struct seq_file *s, struct state_history *sh, 100 * sh->states[i].hit_rate / sh->states[i].counter); - if (i == CI_RUNNING || !measure_latency) + if (i == CI_RUNNING || !(measure_latency || wake_latency)) return; for (j = 0; j < NUM_LATENCY; j++) { - + bool show = false; if (!ktime_equal(sh->states[i].latency_min[j], init_time)) { seq_printf(s, "\n\t\t\t\t"); switch (j) { case LATENCY_ENTER: - seq_printf(s, "enter: "); + if (measure_latency) { + seq_printf(s, "enter: "); + show = true; + } break; case LATENCY_EXIT: - seq_printf(s, "exit: "); + if (measure_latency) { + seq_printf(s, "exit: "); + show = true; + } break; case LATENCY_WAKE: - seq_printf(s, "wake: "); + if (wake_latency) { + seq_printf(s, "wake: "); + show = true; + } break; default: seq_printf(s, "unknown!: "); break; } + if (!show) + continue; + if (ktime_equal(sh->states[i].latency_min[j], zero_time)) seq_printf(s, "min < 30"); @@ -778,6 +786,9 @@ void ux500_ci_dbg_init(void) cstates = ux500_ci_get_cstates(&cstates_len); + if (deepest_allowed_state > cstates_len) + deepest_allowed_state = cstates_len; + for_each_possible_cpu(cpu) { per_cpu(state_history, cpu) = kzalloc(sizeof(struct state_history), GFP_KERNEL); |