diff mbox

cpuidle: arm_big_little: route target residency to mcpm

Message ID 1368469744-25810-2-git-send-email-sebastian.capella@linaro.org
State New
Headers show

Commit Message

Sebastian Capella May 13, 2013, 6:29 p.m. UTC
Pass residency information to the mcpm_cpu_suspend.  The information
is taken from the target_residency of the intended C-state.

When a platform uses multiple powerdown cstates, the residency information
indicates which powerdown state is targeted.  Multiple powerdown cstate
information can be maintained in the device tree and the vendor specific
handling will then have enough information to determine what power state to
enter without needing additional changes to the big_little framework.

Signed-off-by: Sebastian Capella <sebastian.capella@linaro.org>
---
 drivers/cpuidle/arm_big_little.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/cpuidle/arm_big_little.c b/drivers/cpuidle/arm_big_little.c
index a430800..8332b05 100644
--- a/drivers/cpuidle/arm_big_little.c
+++ b/drivers/cpuidle/arm_big_little.c
@@ -89,7 +89,7 @@  static int notrace bl_powerdown_finisher(unsigned long arg)
 	unsigned int cpu = mpidr & 0xf;
 
 	mcpm_set_entry_vector(cpu, cluster, cpu_resume);
-	mcpm_cpu_suspend(0);  /* 0 should be replaced with better value here */
+	mcpm_cpu_suspend(arg);
 	return 1;
 }
 
@@ -107,6 +107,7 @@  static int bl_enter_powerdown(struct cpuidle_device *dev,
 {
 	struct timespec ts_preidle, ts_postidle, ts_idle;
 	int ret;
+	struct cpuidle_state *state = &drv->states[idx];
 
 	/* Used to keep track of the total time in idle */
 	getnstimeofday(&ts_preidle);
@@ -117,7 +118,8 @@  static int bl_enter_powerdown(struct cpuidle_device *dev,
 
 	clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &dev->cpu);
 
-	ret = cpu_suspend((unsigned long) dev, bl_powerdown_finisher);
+	ret = cpu_suspend((unsigned long) state->target_residency,
+					bl_powerdown_finisher);
 	if (ret)
 		BUG();