summaryrefslogtreecommitdiff
path: root/drivers/xen/manage.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen/manage.c')
-rw-r--r--drivers/xen/manage.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 9b91617b9582..0d61db1e7b49 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -39,10 +39,11 @@ static int xen_suspend(void *data)
BUG_ON(!irqs_disabled());
- err = device_power_down(PMSG_SUSPEND);
+ err = sysdev_suspend(PMSG_SUSPEND);
if (err) {
- printk(KERN_ERR "xen_suspend: device_power_down failed: %d\n",
- err);
+ printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n",
+ err);
+ device_power_up(PMSG_RESUME);
return err;
}
@@ -61,7 +62,7 @@ static int xen_suspend(void *data)
gnttab_resume();
xen_mm_unpin_all();
- device_power_up(PMSG_RESUME);
+ sysdev_resume();
if (!*cancelled) {
xen_irq_resume();
@@ -100,7 +101,13 @@ static void do_suspend(void)
/* XXX use normal device tree? */
xenbus_suspend();
- err = stop_machine(xen_suspend, &cancelled, &cpumask_of_cpu(0));
+ err = device_power_down(PMSG_SUSPEND);
+ if (err) {
+ printk(KERN_ERR "device_power_down failed: %d\n", err);
+ goto resume_devices;
+ }
+
+ err = stop_machine(xen_suspend, &cancelled, cpumask_of(0));
if (err) {
printk(KERN_ERR "failed to start xen_suspend: %d\n", err);
goto out;
@@ -112,6 +119,9 @@ static void do_suspend(void)
} else
xenbus_suspend_cancel();
+ device_power_up(PMSG_RESUME);
+
+resume_devices:
device_resume(PMSG_RESUME);
/* Make sure timer events get retriggered on all CPUs */