diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-04-19 18:36:11 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-04-19 18:36:11 -0400 |
commit | 19234c0819da0e043a02710488dfd9b242b42eba (patch) | |
tree | c55331dd010e5fe257e001261f1a31f53f62dff4 /drivers/xen/manage.c | |
parent | 2ca6f62f595c01f689b269db6736de5544da7667 (diff) |
PM: Add missing syscore_suspend() and syscore_resume() calls
Device suspend/resume infrastructure is used not only by the suspend
and hibernate code in kernel/power, but also by APM, Xen and the
kexec jump feature. However, commit 40dc166cb5dddbd36aa4ad11c03915ea
(PM / Core: Introduce struct syscore_ops for core subsystems PM)
failed to add syscore_suspend() and syscore_resume() calls to that
code, which generally leads to breakage when the features in question
are used.
To fix this problem, add the missing syscore_suspend() and
syscore_resume() calls to arch/x86/kernel/apm_32.c, kernel/kexec.c
and drivers/xen/manage.c.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'drivers/xen/manage.c')
-rw-r--r-- | drivers/xen/manage.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 1ac94125bf93..a2eee574784e 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/sysrq.h> | 8 | #include <linux/sysrq.h> |
9 | #include <linux/stop_machine.h> | 9 | #include <linux/stop_machine.h> |
10 | #include <linux/freezer.h> | 10 | #include <linux/freezer.h> |
11 | #include <linux/syscore_ops.h> | ||
11 | 12 | ||
12 | #include <xen/xen.h> | 13 | #include <xen/xen.h> |
13 | #include <xen/xenbus.h> | 14 | #include <xen/xenbus.h> |
@@ -70,8 +71,13 @@ static int xen_suspend(void *data) | |||
70 | BUG_ON(!irqs_disabled()); | 71 | BUG_ON(!irqs_disabled()); |
71 | 72 | ||
72 | err = sysdev_suspend(PMSG_FREEZE); | 73 | err = sysdev_suspend(PMSG_FREEZE); |
74 | if (!err) { | ||
75 | err = syscore_suspend(); | ||
76 | if (err) | ||
77 | sysdev_resume(); | ||
78 | } | ||
73 | if (err) { | 79 | if (err) { |
74 | printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n", | 80 | printk(KERN_ERR "xen_suspend: system core suspend failed: %d\n", |
75 | err); | 81 | err); |
76 | return err; | 82 | return err; |
77 | } | 83 | } |
@@ -95,6 +101,7 @@ static int xen_suspend(void *data) | |||
95 | xen_timer_resume(); | 101 | xen_timer_resume(); |
96 | } | 102 | } |
97 | 103 | ||
104 | syscore_resume(); | ||
98 | sysdev_resume(); | 105 | sysdev_resume(); |
99 | 106 | ||
100 | return 0; | 107 | return 0; |