diff options
Diffstat (limited to 'drivers/xen/manage.c')
-rw-r--r-- | drivers/xen/manage.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 5269bb4d2496..fddc2025dece 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
@@ -39,12 +39,6 @@ static int xen_suspend(void *data) | |||
39 | 39 | ||
40 | BUG_ON(!irqs_disabled()); | 40 | BUG_ON(!irqs_disabled()); |
41 | 41 | ||
42 | err = device_power_down(PMSG_SUSPEND); | ||
43 | if (err) { | ||
44 | printk(KERN_ERR "xen_suspend: device_power_down failed: %d\n", | ||
45 | err); | ||
46 | return err; | ||
47 | } | ||
48 | err = sysdev_suspend(PMSG_SUSPEND); | 42 | err = sysdev_suspend(PMSG_SUSPEND); |
49 | if (err) { | 43 | if (err) { |
50 | printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n", | 44 | printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n", |
@@ -107,6 +101,12 @@ static void do_suspend(void) | |||
107 | printk(KERN_DEBUG "suspending xenstore...\n"); | 101 | printk(KERN_DEBUG "suspending xenstore...\n"); |
108 | xs_suspend(); | 102 | xs_suspend(); |
109 | 103 | ||
104 | err = device_power_down(PMSG_SUSPEND); | ||
105 | if (err) { | ||
106 | printk(KERN_ERR "device_power_down failed: %d\n", err); | ||
107 | goto resume_devices; | ||
108 | } | ||
109 | |||
110 | err = stop_machine(xen_suspend, &cancelled, cpumask_of(0)); | 110 | err = stop_machine(xen_suspend, &cancelled, cpumask_of(0)); |
111 | if (err) { | 111 | if (err) { |
112 | printk(KERN_ERR "failed to start xen_suspend: %d\n", err); | 112 | printk(KERN_ERR "failed to start xen_suspend: %d\n", err); |
@@ -119,6 +119,9 @@ static void do_suspend(void) | |||
119 | } else | 119 | } else |
120 | xs_suspend_cancel(); | 120 | xs_suspend_cancel(); |
121 | 121 | ||
122 | device_power_up(PMSG_RESUME); | ||
123 | |||
124 | resume_devices: | ||
122 | device_resume(PMSG_RESUME); | 125 | device_resume(PMSG_RESUME); |
123 | 126 | ||
124 | /* Make sure timer events get retriggered on all CPUs */ | 127 | /* Make sure timer events get retriggered on all CPUs */ |