summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/cpuidle44xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/cpuidle44xx.c')
-rw-r--r--arch/arm/mach-omap2/cpuidle44xx.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index 0d1bddff4d20..8a9adcd24eb4 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -27,10 +27,10 @@
#define OMAP4_STATE_C2 1 /* C2 - CPU0 CSWR + CPU1 OFF + MPU CSWR + Core active */
#define OMAP4_STATE_C3 2 /* C3 - CPU0 CSWR + CPU1 OFF + MPU CSWR + Core CSWR */
-extern int (*_omap_sram_idle)(void);
-
#define wfi() \
{ \
+ isb(); \
+ wmb(); \
__asm__ __volatile__ ("wfi"); \
}
@@ -77,7 +77,7 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
{
struct omap4_processor_cx *cx = cpuidle_get_statedata(state);
struct timespec ts_preidle, ts_postidle, ts_idle;
- u32 scu_pwr_st;
+ u32 scu_pwr_st, cpu1_state;
/* Used to keep track of the total time in idle */
getnstimeofday(&ts_preidle);
@@ -88,8 +88,10 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
goto return_sleep_time;
}
- /* Do only a wfi as long as any other core is active */
- if (num_online_cpus() > 1) {
+ /* Make sure cpu1 is offlined before cpu0 idle's */
+ cpu1_state = pwrdm_read_pwrst(cpu1_pd);
+ /* Do only a wfi as long as CPU1 is not in RET/OFF */
+ if (cpu1_state > PWRDM_POWER_RET) {
wfi();
goto return_sleep_time;
}
@@ -111,10 +113,7 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
}
pwrdm_set_next_pwrst(core_pd, cx->core_state);
- if (_omap_sram_idle)
- _omap_sram_idle();
- else
- wfi();
+ wfi();
if (cx->core_state < PWRDM_POWER_ON) {
omap2_gpio_resume_after_retention();