diff options
-rw-r--r-- | drivers/xen/manage.c | 16 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe_frontend.c | 8 |
2 files changed, 13 insertions, 11 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index ebb292859b59..95143dd6904d 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
@@ -61,7 +61,7 @@ static void xen_post_suspend(int cancelled) | |||
61 | xen_mm_unpin_all(); | 61 | xen_mm_unpin_all(); |
62 | } | 62 | } |
63 | 63 | ||
64 | #ifdef CONFIG_PM_SLEEP | 64 | #ifdef CONFIG_HIBERNATION |
65 | static int xen_suspend(void *data) | 65 | static int xen_suspend(void *data) |
66 | { | 66 | { |
67 | struct suspend_info *si = data; | 67 | struct suspend_info *si = data; |
@@ -69,7 +69,7 @@ static int xen_suspend(void *data) | |||
69 | 69 | ||
70 | BUG_ON(!irqs_disabled()); | 70 | BUG_ON(!irqs_disabled()); |
71 | 71 | ||
72 | err = sysdev_suspend(PMSG_SUSPEND); | 72 | err = sysdev_suspend(PMSG_FREEZE); |
73 | if (err) { | 73 | if (err) { |
74 | printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n", | 74 | printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n", |
75 | err); | 75 | err); |
@@ -118,7 +118,7 @@ static void do_suspend(void) | |||
118 | } | 118 | } |
119 | #endif | 119 | #endif |
120 | 120 | ||
121 | err = dpm_suspend_start(PMSG_SUSPEND); | 121 | err = dpm_suspend_start(PMSG_FREEZE); |
122 | if (err) { | 122 | if (err) { |
123 | printk(KERN_ERR "xen suspend: dpm_suspend_start %d\n", err); | 123 | printk(KERN_ERR "xen suspend: dpm_suspend_start %d\n", err); |
124 | goto out_thaw; | 124 | goto out_thaw; |
@@ -127,7 +127,7 @@ static void do_suspend(void) | |||
127 | printk(KERN_DEBUG "suspending xenstore...\n"); | 127 | printk(KERN_DEBUG "suspending xenstore...\n"); |
128 | xs_suspend(); | 128 | xs_suspend(); |
129 | 129 | ||
130 | err = dpm_suspend_noirq(PMSG_SUSPEND); | 130 | err = dpm_suspend_noirq(PMSG_FREEZE); |
131 | if (err) { | 131 | if (err) { |
132 | printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err); | 132 | printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err); |
133 | goto out_resume; | 133 | goto out_resume; |
@@ -147,7 +147,7 @@ static void do_suspend(void) | |||
147 | 147 | ||
148 | err = stop_machine(xen_suspend, &si, cpumask_of(0)); | 148 | err = stop_machine(xen_suspend, &si, cpumask_of(0)); |
149 | 149 | ||
150 | dpm_resume_noirq(PMSG_RESUME); | 150 | dpm_resume_noirq(si.cancelled ? PMSG_THAW : PMSG_RESTORE); |
151 | 151 | ||
152 | if (err) { | 152 | if (err) { |
153 | printk(KERN_ERR "failed to start xen_suspend: %d\n", err); | 153 | printk(KERN_ERR "failed to start xen_suspend: %d\n", err); |
@@ -161,7 +161,7 @@ out_resume: | |||
161 | } else | 161 | } else |
162 | xs_suspend_cancel(); | 162 | xs_suspend_cancel(); |
163 | 163 | ||
164 | dpm_resume_end(PMSG_RESUME); | 164 | dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE); |
165 | 165 | ||
166 | /* Make sure timer events get retriggered on all CPUs */ | 166 | /* Make sure timer events get retriggered on all CPUs */ |
167 | clock_was_set(); | 167 | clock_was_set(); |
@@ -173,7 +173,7 @@ out: | |||
173 | #endif | 173 | #endif |
174 | shutting_down = SHUTDOWN_INVALID; | 174 | shutting_down = SHUTDOWN_INVALID; |
175 | } | 175 | } |
176 | #endif /* CONFIG_PM_SLEEP */ | 176 | #endif /* CONFIG_HIBERNATION */ |
177 | 177 | ||
178 | struct shutdown_handler { | 178 | struct shutdown_handler { |
179 | const char *command; | 179 | const char *command; |
@@ -202,7 +202,7 @@ static void shutdown_handler(struct xenbus_watch *watch, | |||
202 | { "poweroff", do_poweroff }, | 202 | { "poweroff", do_poweroff }, |
203 | { "halt", do_poweroff }, | 203 | { "halt", do_poweroff }, |
204 | { "reboot", do_reboot }, | 204 | { "reboot", do_reboot }, |
205 | #ifdef CONFIG_PM_SLEEP | 205 | #ifdef CONFIG_HIBERNATION |
206 | { "suspend", do_suspend }, | 206 | { "suspend", do_suspend }, |
207 | #endif | 207 | #endif |
208 | {NULL, NULL}, | 208 | {NULL, NULL}, |
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c index ea83999c02f3..b6a2690c9d49 100644 --- a/drivers/xen/xenbus/xenbus_probe_frontend.c +++ b/drivers/xen/xenbus/xenbus_probe_frontend.c | |||
@@ -86,9 +86,11 @@ static struct device_attribute xenbus_frontend_dev_attrs[] = { | |||
86 | }; | 86 | }; |
87 | 87 | ||
88 | static const struct dev_pm_ops xenbus_pm_ops = { | 88 | static const struct dev_pm_ops xenbus_pm_ops = { |
89 | .suspend = xenbus_dev_suspend, | 89 | .suspend = xenbus_dev_suspend, |
90 | .resume = xenbus_dev_resume, | 90 | .resume = xenbus_dev_resume, |
91 | .thaw = xenbus_dev_cancel, | 91 | .freeze = xenbus_dev_suspend, |
92 | .thaw = xenbus_dev_cancel, | ||
93 | .restore = xenbus_dev_resume, | ||
92 | }; | 94 | }; |
93 | 95 | ||
94 | static struct xen_bus_type xenbus_frontend = { | 96 | static struct xen_bus_type xenbus_frontend = { |