]> Pileus Git - ~andy/linux/commitdiff
ARM: OMAP4+: CPUidle: Deprecate use of omap4_mpuss_read_prev_context_state()
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Mon, 25 Mar 2013 10:05:08 +0000 (15:35 +0530)
committerKevin Hilman <khilman@linaro.org>
Tue, 9 Apr 2013 16:45:46 +0000 (09:45 -0700)
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>
arch/arm/mach-omap2/common.h
arch/arm/mach-omap2/cpuidle44xx.c
arch/arm/mach-omap2/omap-mpuss-lowpower.c

index d6ba13e1c540f6ecc186a164f441ca48b2540a1e..14522d077c889e23a51b4ab11848639d90b1f086 100644 (file)
@@ -249,7 +249,6 @@ extern int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state);
 extern int omap4_finish_suspend(unsigned long cpu_state);
 extern void omap4_cpu_resume(void);
 extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state);
-extern u32 omap4_mpuss_read_prev_context_state(void);
 #else
 static inline int omap4_enter_lowpower(unsigned int cpu,
                                        unsigned int power_state)
@@ -277,10 +276,6 @@ static inline int omap4_finish_suspend(unsigned long cpu_state)
 static inline void omap4_cpu_resume(void)
 {}
 
-static inline u32 omap4_mpuss_read_prev_context_state(void)
-{
-       return 0;
-}
 #endif
 
 struct omap_sdrc_params;
index e48e26e3040976920a898aa2b8ff0d37f450f499..e72b55d8eac36c1448272b298a42b250bd2effe4 100644 (file)
@@ -145,7 +145,8 @@ static int omap4_enter_idle_coupled(struct cpuidle_device *dev,
         * Call idle CPU cluster PM exit notifier chain
         * to restore GIC and wakeupgen context.
         */
-       if (omap4_mpuss_read_prev_context_state())
+       if ((cx->mpu_state == PWRDM_POWER_RET) &&
+               (cx->mpu_logic_state == PWRDM_POWER_OFF))
                cpu_cluster_pm_exit();
 
 fail:
index 8bcb64bcdcdb37a5642b387a65fbd9dddc04b5f8..e80327b6c81f68520206e10058e7e4c18cc496ae 100644 (file)
@@ -139,20 +139,6 @@ static inline void cpu_clear_prev_logic_pwrst(unsigned int cpu_id)
        }
 }
 
-/**
- * omap4_mpuss_read_prev_context_state:
- * Function returns the MPUSS previous context state
- */
-u32 omap4_mpuss_read_prev_context_state(void)
-{
-       u32 reg;
-
-       reg = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION,
-               OMAP4430_PRM_MPU_INST, OMAP4_RM_MPU_MPU_CONTEXT_OFFSET);
-       reg &= OMAP4430_LOSTCONTEXT_DFF_MASK;
-       return reg;
-}
-
 /*
  * Store the CPU cluster state for L2X0 low power operations.
  */