diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-04-24 01:35:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-04-24 01:35:16 -0400 |
commit | 686c4cbb10fc0e75b29b097290b4f7fc3f010b9e (patch) | |
tree | 3361f14eee716d5512a0c423ec89631a5b976ef4 /kernel | |
parent | b07ad9967f40b164af77205027352ba53729cf5a (diff) | |
parent | 19234c0819da0e043a02710488dfd9b242b42eba (diff) |
Merge branch 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
PM: Add missing syscore_suspend() and syscore_resume() calls
PM: Fix error code paths executed after failing syscore_suspend()
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kexec.c | 7 | ||||
-rw-r--r-- | kernel/power/hibernate.c | 10 | ||||
-rw-r--r-- | kernel/power/suspend.c | 5 |
3 files changed, 19 insertions, 3 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index 55936f9cb251..87b77de03dd3 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/vmalloc.h> | 33 | #include <linux/vmalloc.h> |
34 | #include <linux/swap.h> | 34 | #include <linux/swap.h> |
35 | #include <linux/kmsg_dump.h> | 35 | #include <linux/kmsg_dump.h> |
36 | #include <linux/syscore_ops.h> | ||
36 | 37 | ||
37 | #include <asm/page.h> | 38 | #include <asm/page.h> |
38 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
@@ -1532,6 +1533,11 @@ int kernel_kexec(void) | |||
1532 | local_irq_disable(); | 1533 | local_irq_disable(); |
1533 | /* Suspend system devices */ | 1534 | /* Suspend system devices */ |
1534 | error = sysdev_suspend(PMSG_FREEZE); | 1535 | error = sysdev_suspend(PMSG_FREEZE); |
1536 | if (!error) { | ||
1537 | error = syscore_suspend(); | ||
1538 | if (error) | ||
1539 | sysdev_resume(); | ||
1540 | } | ||
1535 | if (error) | 1541 | if (error) |
1536 | goto Enable_irqs; | 1542 | goto Enable_irqs; |
1537 | } else | 1543 | } else |
@@ -1546,6 +1552,7 @@ int kernel_kexec(void) | |||
1546 | 1552 | ||
1547 | #ifdef CONFIG_KEXEC_JUMP | 1553 | #ifdef CONFIG_KEXEC_JUMP |
1548 | if (kexec_image->preserve_context) { | 1554 | if (kexec_image->preserve_context) { |
1555 | syscore_resume(); | ||
1549 | sysdev_resume(); | 1556 | sysdev_resume(); |
1550 | Enable_irqs: | 1557 | Enable_irqs: |
1551 | local_irq_enable(); | 1558 | local_irq_enable(); |
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index aeabd26e3342..50aae660174d 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
@@ -273,8 +273,11 @@ static int create_image(int platform_mode) | |||
273 | local_irq_disable(); | 273 | local_irq_disable(); |
274 | 274 | ||
275 | error = sysdev_suspend(PMSG_FREEZE); | 275 | error = sysdev_suspend(PMSG_FREEZE); |
276 | if (!error) | 276 | if (!error) { |
277 | error = syscore_suspend(); | 277 | error = syscore_suspend(); |
278 | if (error) | ||
279 | sysdev_resume(); | ||
280 | } | ||
278 | if (error) { | 281 | if (error) { |
279 | printk(KERN_ERR "PM: Some system devices failed to power down, " | 282 | printk(KERN_ERR "PM: Some system devices failed to power down, " |
280 | "aborting hibernation\n"); | 283 | "aborting hibernation\n"); |
@@ -407,8 +410,11 @@ static int resume_target_kernel(bool platform_mode) | |||
407 | local_irq_disable(); | 410 | local_irq_disable(); |
408 | 411 | ||
409 | error = sysdev_suspend(PMSG_QUIESCE); | 412 | error = sysdev_suspend(PMSG_QUIESCE); |
410 | if (!error) | 413 | if (!error) { |
411 | error = syscore_suspend(); | 414 | error = syscore_suspend(); |
415 | if (error) | ||
416 | sysdev_resume(); | ||
417 | } | ||
412 | if (error) | 418 | if (error) |
413 | goto Enable_irqs; | 419 | goto Enable_irqs; |
414 | 420 | ||
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 2814c32aed51..8935369d503a 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c | |||
@@ -164,8 +164,11 @@ static int suspend_enter(suspend_state_t state) | |||
164 | BUG_ON(!irqs_disabled()); | 164 | BUG_ON(!irqs_disabled()); |
165 | 165 | ||
166 | error = sysdev_suspend(PMSG_SUSPEND); | 166 | error = sysdev_suspend(PMSG_SUSPEND); |
167 | if (!error) | 167 | if (!error) { |
168 | error = syscore_suspend(); | 168 | error = syscore_suspend(); |
169 | if (error) | ||
170 | sysdev_resume(); | ||
171 | } | ||
169 | if (!error) { | 172 | if (!error) { |
170 | if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) { | 173 | if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) { |
171 | error = suspend_ops->enter(state); | 174 | error = suspend_ops->enter(state); |