Skip to content

Commit 259c95a

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
arm, OMAP2: Use WFI for omap2_pm_idle()
arch_cpu_idle() is a very simple idle interface and exposes only a single idle state and is expected to not require RCU and not do any tracing/instrumentation. As such, omap2_pm_idle() is not a valid implementation. Replace it with a simple (shallow) omap2_do_wfi() call. Omap2 doesn't have a cpuidle driver; but adding one would be the recourse to (re)gain the other idle states. Suggested-by: Tony Lindgren <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Tested-by: Tony Lindgren <[email protected]> Tested-by: Ulf Hansson <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Acked-by: Frederic Weisbecker <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a282e5e commit 259c95a

File tree

1 file changed

+2
-49
lines changed

1 file changed

+2
-49
lines changed

arch/arm/mach-omap2/pm24xx.c

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -116,50 +116,12 @@ static int omap2_enter_full_retention(void)
116116

117117
static int sti_console_enabled;
118118

119-
static int omap2_allow_mpu_retention(void)
120-
{
121-
if (!omap2xxx_cm_mpu_retention_allowed())
122-
return 0;
123-
if (sti_console_enabled)
124-
return 0;
125-
126-
return 1;
127-
}
128-
129-
static void omap2_enter_mpu_retention(void)
119+
static void omap2_do_wfi(void)
130120
{
131121
const int zero = 0;
132122

133-
/* The peripherals seem not to be able to wake up the MPU when
134-
* it is in retention mode. */
135-
if (omap2_allow_mpu_retention()) {
136-
/* REVISIT: These write to reserved bits? */
137-
omap_prm_clear_mod_irqs(CORE_MOD, PM_WKST1, ~0);
138-
omap_prm_clear_mod_irqs(CORE_MOD, OMAP24XX_PM_WKST2, ~0);
139-
omap_prm_clear_mod_irqs(WKUP_MOD, PM_WKST, ~0);
140-
141-
/* Try to enter MPU retention */
142-
pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET);
143-
144-
} else {
145-
/* Block MPU retention */
146-
pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
147-
}
148-
149123
/* WFI */
150124
asm("mcr p15, 0, %0, c7, c0, 4" : : "r" (zero) : "memory", "cc");
151-
152-
pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
153-
}
154-
155-
static int omap2_can_sleep(void)
156-
{
157-
if (omap2xxx_cm_fclks_active())
158-
return 0;
159-
if (__clk_is_enabled(osc_ck))
160-
return 0;
161-
162-
return 1;
163125
}
164126

165127
static void omap2_pm_idle(void)
@@ -169,16 +131,7 @@ static void omap2_pm_idle(void)
169131
if (omap_irq_pending())
170132
return;
171133

172-
error = cpu_cluster_pm_enter();
173-
if (error || !omap2_can_sleep()) {
174-
omap2_enter_mpu_retention();
175-
goto out_cpu_cluster_pm;
176-
}
177-
178-
omap2_enter_full_retention();
179-
180-
out_cpu_cluster_pm:
181-
cpu_cluster_pm_exit();
134+
omap2_do_wfi();
182135
}
183136

184137
static void __init prcm_setup_regs(void)

0 commit comments

Comments
 (0)