diff options
author | Jonas Aaberg <jonas.aberg@stericsson.com> | 2011-04-17 13:53:43 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-09-19 15:15:09 +0200 |
commit | bbf9cb810d4aacf29f4712f0d0e1c5d3189cd419 (patch) | |
tree | f6ee5dccd03af42cef3db705955d301a222a6dd5 /arch/arm | |
parent | 72b0ece77074d7bc8711746562c2703a347312e1 (diff) |
ARM: ux500: cpuidle: Stop enabling and disabling prcmu wake-up cause
Only cpuidle and suspend/resume touches the wake-up causes. Change so
that cpuidle sets what it wants at start-up and suspend/resume changes
when it is executed.
ST-Ericsson Linux next: Not tested, ask SSM for ER
ST-Ericsson ID: ER329430
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: Ic53281eea0aace6019ead8e63d395a2fa6ca09b4
Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/21040
Reviewed-by: QATEST
Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-ux500/pm/cpuidle.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-ux500/pm/suspend.c | 4 |
2 files changed, 14 insertions, 13 deletions
diff --git a/arch/arm/mach-ux500/pm/cpuidle.c b/arch/arm/mach-ux500/pm/cpuidle.c index 5c12d0e4084..e2f5fd0b51f 100644 --- a/arch/arm/mach-ux500/pm/cpuidle.c +++ b/arch/arm/mach-ux500/pm/cpuidle.c @@ -61,7 +61,7 @@ static struct cstate cstates[] = { .desc = "Wait for interrupt ", }, { - .enter_latency = 50, + .enter_latency = 40, .exit_latency = 50, .threshold = 150, .power_usage = 5, @@ -76,7 +76,7 @@ static struct cstate cstates[] = { .desc = "ApIdle ", }, { - .enter_latency = 55, + .enter_latency = 45, .exit_latency = 50, .threshold = 160, .power_usage = 4, @@ -91,13 +91,13 @@ static struct cstate cstates[] = { .desc = "ApIdle, ARM PLL off ", }, { - .enter_latency = 140, + .enter_latency = 120, .exit_latency = SLEEP_WAKE_UP_LATENCY, /* * Note: Sleep time must be longer than 120 us or else * there might be issues with the RTC-RTT block. */ - .threshold = SLEEP_WAKE_UP_LATENCY + 140 + 50, + .threshold = SLEEP_WAKE_UP_LATENCY + 120 + 50, .power_usage = 3, .APE = APE_OFF, .ARM = ARM_RET, @@ -338,7 +338,7 @@ static int determine_sleep_state(void) } -static void enter_sleep_shallow(struct cpu_state *state) +static void enter_sleep_shallow(struct cpu_state *state, ktime_t t1) { int this_cpu = smp_processor_id(); @@ -350,11 +350,13 @@ static void enter_sleep_shallow(struct cpu_state *state) context_save_cpu_registers(); /* fall through */ case ARM_RET: + ux500_ci_dbg_log(CI_WFI, t1); context_save_to_sram_and_wfi(false); if (cstates[state->gov_cstate].ARM == ARM_OFF) context_restore_cpu_registers(); break; case ARM_ON: + ux500_ci_dbg_log(CI_WFI, t1); __asm__ __volatile__ ("dsb\n\t" "wfi\n\t" : : : "memory"); break; @@ -407,9 +409,8 @@ static int enter_sleep(struct cpuidle_device *dev, if (cstates[target].ARM == ARM_ON) { /* Handle first cpu to enter sleep state */ - ux500_ci_dbg_log(CI_WFI, t1); always_on_timer_migrated = true; - enter_sleep_shallow(state); + enter_sleep_shallow(state, t1); t3 = ktime_get(); slept_well = true; goto exit; @@ -422,9 +423,6 @@ static int enter_sleep(struct cpuidle_device *dev, /* Other CPU was not in WFI => abort */ goto exit; - prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | - PRCMU_WAKEUP(ABB)); - clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &this_cpu); always_on_timer_migrated = true; @@ -564,8 +562,6 @@ exit: time_zero); } - prcmu_disable_wakeups(); - exit_fast: if (target < 0) @@ -655,6 +651,9 @@ static int __init cpuidle_driver_init(void) /* Zero time used on a few places */ time_zero = ktime_set(0, 0); + prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | + PRCMU_WAKEUP(ABB)); + ux500_ci_dbg_init(); for_each_possible_cpu(cpu) diff --git a/arch/arm/mach-ux500/pm/suspend.c b/arch/arm/mach-ux500/pm/suspend.c index 3b00ce4519b..62391907889 100644 --- a/arch/arm/mach-ux500/pm/suspend.c +++ b/arch/arm/mach-ux500/pm/suspend.c @@ -138,7 +138,9 @@ static int suspend(bool do_deepsleep) context_gpio_mux_safe_switch(false); context_gpio_restore(); - prcmu_disable_wakeups(); + /* This is what cpuidle wants */ + prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | + PRCMU_WAKEUP(ABB)); nmk_gpio_wakeups_resume(); ux500_suspend_dbg_remove_wake_on_uart(); |