diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 19:01:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 19:01:57 -0400 |
commit | 431bf99d26157d56689e5de65bd27ce9f077fc3f (patch) | |
tree | b15e357039956fcdd0e0e6177d2fc99bb3cfa822 /kernel | |
parent | 72f96e0e38d7e29ba16dcfd824ecaebe38b8293e (diff) | |
parent | 7ae033cc0dfce68d8e0c83aca60837cf2bf0d2e6 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: (51 commits)
PM: Improve error code of pm_notifier_call_chain()
PM: Add "RTC" to PM trace time stamps to avoid confusion
PM / Suspend: Export suspend_set_ops, suspend_valid_only_mem
PM / Suspend: Add .suspend_again() callback to suspend_ops
PM / OPP: Introduce function to free cpufreq table
ARM / shmobile: Return -EBUSY from A4LC power off if A3RV is active
PM / Domains: Take .power_off() error code into account
ARM / shmobile: Use genpd_queue_power_off_work()
ARM / shmobile: Use pm_genpd_poweroff_unused()
PM / Domains: Introduce function to power off all unused PM domains
OMAP: PM: disable idle on suspend for GPIO and UART
OMAP: PM: omap_device: add API to disable idle on suspend
OMAP: PM: omap_device: add system PM methods for PM domain handling
OMAP: PM: omap_device: conditionally use PM domain runtime helpers
PM / Runtime: Add new helper function: pm_runtime_status_suspended()
PM / Domains: Queue up power off work only if it is not pending
PM / Domains: Improve handling of wakeup devices during system suspend
PM / Domains: Do not restore all devices on power off error
PM / Domains: Allow callbacks to execute all runtime PM helpers
PM / Domains: Do not execute device callbacks under locks
...
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/Kconfig | 8 | ||||
-rw-r--r-- | kernel/power/main.c | 5 | ||||
-rw-r--r-- | kernel/power/suspend.c | 20 |
3 files changed, 23 insertions, 10 deletions
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index 87f4d24b55b0..7b856b3458d2 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig | |||
@@ -224,6 +224,10 @@ config PM_OPP | |||
224 | implementations a ready to use framework to manage OPPs. | 224 | implementations a ready to use framework to manage OPPs. |
225 | For more information, read <file:Documentation/power/opp.txt> | 225 | For more information, read <file:Documentation/power/opp.txt> |
226 | 226 | ||
227 | config PM_RUNTIME_CLK | 227 | config PM_CLK |
228 | def_bool y | 228 | def_bool y |
229 | depends on PM_RUNTIME && HAVE_CLK | 229 | depends on PM && HAVE_CLK |
230 | |||
231 | config PM_GENERIC_DOMAINS | ||
232 | bool | ||
233 | depends on PM | ||
diff --git a/kernel/power/main.c b/kernel/power/main.c index 2981af4ce7cb..6c601f871964 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -37,8 +37,9 @@ EXPORT_SYMBOL_GPL(unregister_pm_notifier); | |||
37 | 37 | ||
38 | int pm_notifier_call_chain(unsigned long val) | 38 | int pm_notifier_call_chain(unsigned long val) |
39 | { | 39 | { |
40 | return (blocking_notifier_call_chain(&pm_chain_head, val, NULL) | 40 | int ret = blocking_notifier_call_chain(&pm_chain_head, val, NULL); |
41 | == NOTIFY_BAD) ? -EINVAL : 0; | 41 | |
42 | return notifier_to_errno(ret); | ||
42 | } | 43 | } |
43 | 44 | ||
44 | /* If set, devices may be suspended and resumed asynchronously. */ | 45 | /* If set, devices may be suspended and resumed asynchronously. */ |
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 1c41ba215419..b6b71ad2208f 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c | |||
@@ -44,6 +44,7 @@ void suspend_set_ops(const struct platform_suspend_ops *ops) | |||
44 | suspend_ops = ops; | 44 | suspend_ops = ops; |
45 | mutex_unlock(&pm_mutex); | 45 | mutex_unlock(&pm_mutex); |
46 | } | 46 | } |
47 | EXPORT_SYMBOL_GPL(suspend_set_ops); | ||
47 | 48 | ||
48 | bool valid_state(suspend_state_t state) | 49 | bool valid_state(suspend_state_t state) |
49 | { | 50 | { |
@@ -65,6 +66,7 @@ int suspend_valid_only_mem(suspend_state_t state) | |||
65 | { | 66 | { |
66 | return state == PM_SUSPEND_MEM; | 67 | return state == PM_SUSPEND_MEM; |
67 | } | 68 | } |
69 | EXPORT_SYMBOL_GPL(suspend_valid_only_mem); | ||
68 | 70 | ||
69 | static int suspend_test(int level) | 71 | static int suspend_test(int level) |
70 | { | 72 | { |
@@ -126,12 +128,13 @@ void __attribute__ ((weak)) arch_suspend_enable_irqs(void) | |||
126 | } | 128 | } |
127 | 129 | ||
128 | /** | 130 | /** |
129 | * suspend_enter - enter the desired system sleep state. | 131 | * suspend_enter - enter the desired system sleep state. |
130 | * @state: state to enter | 132 | * @state: State to enter |
133 | * @wakeup: Returns information that suspend should not be entered again. | ||
131 | * | 134 | * |
132 | * This function should be called after devices have been suspended. | 135 | * This function should be called after devices have been suspended. |
133 | */ | 136 | */ |
134 | static int suspend_enter(suspend_state_t state) | 137 | static int suspend_enter(suspend_state_t state, bool *wakeup) |
135 | { | 138 | { |
136 | int error; | 139 | int error; |
137 | 140 | ||
@@ -165,7 +168,8 @@ static int suspend_enter(suspend_state_t state) | |||
165 | 168 | ||
166 | error = syscore_suspend(); | 169 | error = syscore_suspend(); |
167 | if (!error) { | 170 | if (!error) { |
168 | if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) { | 171 | *wakeup = pm_wakeup_pending(); |
172 | if (!(suspend_test(TEST_CORE) || *wakeup)) { | ||
169 | error = suspend_ops->enter(state); | 173 | error = suspend_ops->enter(state); |
170 | events_check_enabled = false; | 174 | events_check_enabled = false; |
171 | } | 175 | } |
@@ -199,6 +203,7 @@ static int suspend_enter(suspend_state_t state) | |||
199 | int suspend_devices_and_enter(suspend_state_t state) | 203 | int suspend_devices_and_enter(suspend_state_t state) |
200 | { | 204 | { |
201 | int error; | 205 | int error; |
206 | bool wakeup = false; | ||
202 | 207 | ||
203 | if (!suspend_ops) | 208 | if (!suspend_ops) |
204 | return -ENOSYS; | 209 | return -ENOSYS; |
@@ -220,7 +225,10 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
220 | if (suspend_test(TEST_DEVICES)) | 225 | if (suspend_test(TEST_DEVICES)) |
221 | goto Recover_platform; | 226 | goto Recover_platform; |
222 | 227 | ||
223 | error = suspend_enter(state); | 228 | do { |
229 | error = suspend_enter(state, &wakeup); | ||
230 | } while (!error && !wakeup | ||
231 | && suspend_ops->suspend_again && suspend_ops->suspend_again()); | ||
224 | 232 | ||
225 | Resume_devices: | 233 | Resume_devices: |
226 | suspend_test_start(); | 234 | suspend_test_start(); |