summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-02 13:02:04 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-02 13:02:04 +0200
commit28da5099700af743e2303b65b61c3a2bc1668ebc (patch)
treeab7f2adb8d43939c4bcced1bfac3c6add57f9b1a /kernel
parenteb5a12a69ea8cd43f1d3887fe2559df35e0f1955 (diff)
parent9051785f6928456db0692b8ca972778b9bf42099 (diff)
Merge branch 'pm-cpuidle'
* pm-cpuidle: PM / suspend: Always use deepest C-state in the "freeze" sleep state cpuidle / menu: move repeated correction factor check to init cpuidle / menu: Return (-1) if there are no suitable states cpuidle: Combine cpuidle_enabled() with cpuidle_select() ARM: clps711x: Add cpuidle driver
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/suspend.c2
-rw-r--r--kernel/sched/idle.c20
2 files changed, 9 insertions, 13 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 8233cd4047d..155721f7f90 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -54,9 +54,11 @@ static void freeze_begin(void)
static void freeze_enter(void)
{
+ cpuidle_use_deepest_state(true);
cpuidle_resume();
wait_event(suspend_freeze_wait_head, suspend_freeze_wake);
cpuidle_pause();
+ cpuidle_use_deepest_state(false);
}
void freeze_wake(void)
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index 8f4390a079c..a8f12247ce7 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -101,19 +101,13 @@ static int cpuidle_idle_call(void)
rcu_idle_enter();
/*
- * Check if the cpuidle framework is ready, otherwise fallback
- * to the default arch specific idle method
+ * Ask the cpuidle framework to choose a convenient idle state.
+ * Fall back to the default arch specific idle method on errors.
*/
- ret = cpuidle_enabled(drv, dev);
-
- if (!ret) {
- /*
- * Ask the governor to choose an idle state it thinks
- * it is convenient to go to. There is *always* a
- * convenient idle state
- */
- next_state = cpuidle_select(drv, dev);
+ next_state = cpuidle_select(drv, dev);
+ ret = next_state;
+ if (ret >= 0) {
/*
* The idle task must be scheduled, it is pointless to
* go to idle, just update no idle residency and get
@@ -140,7 +134,7 @@ static int cpuidle_idle_call(void)
CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
&dev->cpu);
- if (!ret) {
+ if (ret >= 0) {
trace_cpu_idle_rcuidle(next_state, dev->cpu);
/*
@@ -175,7 +169,7 @@ static int cpuidle_idle_call(void)
* We can't use the cpuidle framework, let's use the default
* idle routine
*/
- if (ret)
+ if (ret < 0)
arch_cpu_idle();
__current_set_polling();