diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-03 17:10:15 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-03 17:10:15 -0400 |
commit | 97b80e685ffae9a6dc946ab08ed32f1eafda97d7 (patch) | |
tree | 96baa368706662230b1aa98b3f83d8425aef46b8 /kernel | |
parent | 91ab377ba3ab202c40a0da402d6c2f1507a15355 (diff) | |
parent | 9051785f6928456db0692b8ca972778b9bf42099 (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.c | 2 | ||||
-rw-r--r-- | kernel/sched/idle.c | 20 |
2 files changed, 9 insertions, 13 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 8233cd4047d7..155721f7f909 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c | |||
@@ -54,9 +54,11 @@ static void freeze_begin(void) | |||
54 | 54 | ||
55 | static void freeze_enter(void) | 55 | static void freeze_enter(void) |
56 | { | 56 | { |
57 | cpuidle_use_deepest_state(true); | ||
57 | cpuidle_resume(); | 58 | cpuidle_resume(); |
58 | wait_event(suspend_freeze_wait_head, suspend_freeze_wake); | 59 | wait_event(suspend_freeze_wait_head, suspend_freeze_wake); |
59 | cpuidle_pause(); | 60 | cpuidle_pause(); |
61 | cpuidle_use_deepest_state(false); | ||
60 | } | 62 | } |
61 | 63 | ||
62 | void freeze_wake(void) | 64 | void freeze_wake(void) |
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index 8f4390a079c7..a8f12247ce7c 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c | |||
@@ -101,19 +101,13 @@ static int cpuidle_idle_call(void) | |||
101 | rcu_idle_enter(); | 101 | rcu_idle_enter(); |
102 | 102 | ||
103 | /* | 103 | /* |
104 | * Check if the cpuidle framework is ready, otherwise fallback | 104 | * Ask the cpuidle framework to choose a convenient idle state. |
105 | * to the default arch specific idle method | 105 | * Fall back to the default arch specific idle method on errors. |
106 | */ | 106 | */ |
107 | ret = cpuidle_enabled(drv, dev); | 107 | next_state = cpuidle_select(drv, dev); |
108 | |||
109 | if (!ret) { | ||
110 | /* | ||
111 | * Ask the governor to choose an idle state it thinks | ||
112 | * it is convenient to go to. There is *always* a | ||
113 | * convenient idle state | ||
114 | */ | ||
115 | next_state = cpuidle_select(drv, dev); | ||
116 | 108 | ||
109 | ret = next_state; | ||
110 | if (ret >= 0) { | ||
117 | /* | 111 | /* |
118 | * The idle task must be scheduled, it is pointless to | 112 | * The idle task must be scheduled, it is pointless to |
119 | * go to idle, just update no idle residency and get | 113 | * go to idle, just update no idle residency and get |
@@ -140,7 +134,7 @@ static int cpuidle_idle_call(void) | |||
140 | CLOCK_EVT_NOTIFY_BROADCAST_ENTER, | 134 | CLOCK_EVT_NOTIFY_BROADCAST_ENTER, |
141 | &dev->cpu); | 135 | &dev->cpu); |
142 | 136 | ||
143 | if (!ret) { | 137 | if (ret >= 0) { |
144 | trace_cpu_idle_rcuidle(next_state, dev->cpu); | 138 | trace_cpu_idle_rcuidle(next_state, dev->cpu); |
145 | 139 | ||
146 | /* | 140 | /* |
@@ -175,7 +169,7 @@ static int cpuidle_idle_call(void) | |||
175 | * We can't use the cpuidle framework, let's use the default | 169 | * We can't use the cpuidle framework, let's use the default |
176 | * idle routine | 170 | * idle routine |
177 | */ | 171 | */ |
178 | if (ret) | 172 | if (ret < 0) |
179 | arch_cpu_idle(); | 173 | arch_cpu_idle(); |
180 | 174 | ||
181 | __current_set_polling(); | 175 | __current_set_polling(); |