aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/manage.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 7b69a1aef877..2fb7d39b814c 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -86,32 +86,32 @@ static void do_suspend(void)
86 err = freeze_processes(); 86 err = freeze_processes();
87 if (err) { 87 if (err) {
88 printk(KERN_ERR "xen suspend: freeze failed %d\n", err); 88 printk(KERN_ERR "xen suspend: freeze failed %d\n", err);
89 return; 89 goto out;
90 } 90 }
91#endif 91#endif
92 92
93 err = dpm_suspend_start(PMSG_SUSPEND); 93 err = dpm_suspend_start(PMSG_SUSPEND);
94 if (err) { 94 if (err) {
95 printk(KERN_ERR "xen suspend: dpm_suspend_start %d\n", err); 95 printk(KERN_ERR "xen suspend: dpm_suspend_start %d\n", err);
96 goto out; 96 goto out_thaw;
97 } 97 }
98 98
99 printk(KERN_DEBUG "suspending xenstore...\n");
100 xs_suspend();
101
102 err = dpm_suspend_noirq(PMSG_SUSPEND); 99 err = dpm_suspend_noirq(PMSG_SUSPEND);
103 if (err) { 100 if (err) {
104 printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err); 101 printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err);
105 goto resume_devices; 102 goto out_resume;
106 } 103 }
107 104
105 printk(KERN_DEBUG "suspending xenstore...\n");
106 xs_suspend();
107
108 err = stop_machine(xen_suspend, &cancelled, cpumask_of(0)); 108 err = stop_machine(xen_suspend, &cancelled, cpumask_of(0));
109 109
110 dpm_resume_noirq(PMSG_RESUME); 110 dpm_resume_noirq(PMSG_RESUME);
111 111
112 if (err) { 112 if (err) {
113 printk(KERN_ERR "failed to start xen_suspend: %d\n", err); 113 printk(KERN_ERR "failed to start xen_suspend: %d\n", err);
114 goto out; 114 cancelled = 1;
115 } 115 }
116 116
117 if (!cancelled) { 117 if (!cancelled) {
@@ -120,15 +120,17 @@ static void do_suspend(void)
120 } else 120 } else
121 xs_suspend_cancel(); 121 xs_suspend_cancel();
122 122
123resume_devices: 123out_resume:
124 dpm_resume_end(PMSG_RESUME); 124 dpm_resume_end(PMSG_RESUME);
125 125
126 /* Make sure timer events get retriggered on all CPUs */ 126 /* Make sure timer events get retriggered on all CPUs */
127 clock_was_set(); 127 clock_was_set();
128out: 128
129out_thaw:
129#ifdef CONFIG_PREEMPT 130#ifdef CONFIG_PREEMPT
130 thaw_processes(); 131 thaw_processes();
131#endif 132#endif
133out:
132 shutting_down = SHUTDOWN_INVALID; 134 shutting_down = SHUTDOWN_INVALID;
133} 135}
134#endif /* CONFIG_PM_SLEEP */ 136#endif /* CONFIG_PM_SLEEP */