Commit e7457253494fff660a72bc0cedeee97491ccd173

Authored by Santosh Shilimkar
Committed by Kevin Hilman
1 parent eb495d3355

ARM: OMAP4+: CPUidle: Deprecate use of omap4_mpuss_read_prev_context_state()

Current OMAP4 CPUIdle driver is using omap4_mpuss_read_prev_context_state()
to check whether the MPU cluster lost context or not before calling
cpu_cluster_pm_exit().  This was initially done an optimization for
corner cases, where if the cluster low power entry fails for some
reason, the cluster context restore gets skipped.  However, since
reading the previous context is expensive (involving slow accesses to
the PRCM), it's better to avoid it and simply check the target cluster
state instead.

Moving forward, OMAP CPUidle drivers needs to be moved to drivers/idle/*
once the PRM/CM code gets moved to drivers. This patch also reduces one
dependency with platform code for idle driver movement.

Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[khilman@linaro.org: minor changelog edits]
Signed-off-by: Kevin Hilman <khilman@linaro.org>

Showing 3 changed files with 2 additions and 20 deletions Side-by-side Diff

arch/arm/mach-omap2/common.h
... ... @@ -249,7 +249,6 @@
249 249 extern int omap4_finish_suspend(unsigned long cpu_state);
250 250 extern void omap4_cpu_resume(void);
251 251 extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state);
252   -extern u32 omap4_mpuss_read_prev_context_state(void);
253 252 #else
254 253 static inline int omap4_enter_lowpower(unsigned int cpu,
255 254 unsigned int power_state)
... ... @@ -277,10 +276,6 @@
277 276 static inline void omap4_cpu_resume(void)
278 277 {}
279 278  
280   -static inline u32 omap4_mpuss_read_prev_context_state(void)
281   -{
282   - return 0;
283   -}
284 279 #endif
285 280  
286 281 struct omap_sdrc_params;
arch/arm/mach-omap2/cpuidle44xx.c
... ... @@ -145,7 +145,8 @@
145 145 * Call idle CPU cluster PM exit notifier chain
146 146 * to restore GIC and wakeupgen context.
147 147 */
148   - if (omap4_mpuss_read_prev_context_state())
  148 + if ((cx->mpu_state == PWRDM_POWER_RET) &&
  149 + (cx->mpu_logic_state == PWRDM_POWER_OFF))
149 150 cpu_cluster_pm_exit();
150 151  
151 152 fail:
arch/arm/mach-omap2/omap-mpuss-lowpower.c
... ... @@ -139,20 +139,6 @@
139 139 }
140 140 }
141 141  
142   -/**
143   - * omap4_mpuss_read_prev_context_state:
144   - * Function returns the MPUSS previous context state
145   - */
146   -u32 omap4_mpuss_read_prev_context_state(void)
147   -{
148   - u32 reg;
149   -
150   - reg = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
151   - OMAP4430_PRM_MPU_INST, OMAP4_RM_MPU_MPU_CONTEXT_OFFSET);
152   - reg &= OMAP4430_LOSTCONTEXT_DFF_MASK;
153   - return reg;
154   -}
155   -
156 142 /*
157 143 * Store the CPU cluster state for L2X0 low power operations.
158 144 */