summaryrefslogtreecommitdiff
path: root/drivers/xen/manage.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-12-11 17:12:17 -0800
committerDavid S. Miller <davem@davemloft.net>2009-12-11 17:12:17 -0800
commit501706565b2d4d2d40d0d301d5411ede099b8a6f (patch)
tree142a18bf1f1e74a09dbfa27540b893ade0fd797d /drivers/xen/manage.c
parente93737b0f0159a61772894943199fd3b6f315641 (diff)
parent2fe77b81c77eed92c4c0439f74c8148a295b4a86 (diff)
downloadlinux-3.10-501706565b2d4d2d40d0d301d5411ede099b8a6f.tar.gz
linux-3.10-501706565b2d4d2d40d0d301d5411ede099b8a6f.tar.bz2
linux-3.10-501706565b2d4d2d40d0d301d5411ede099b8a6f.zip
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts: include/net/tcp.h
Diffstat (limited to 'drivers/xen/manage.c')
-rw-r--r--drivers/xen/manage.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 10d03d7931c..c4997930afc 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -43,7 +43,6 @@ static int xen_suspend(void *data)
if (err) {
printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n",
err);
- dpm_resume_noirq(PMSG_RESUME);
return err;
}
@@ -69,7 +68,6 @@ static int xen_suspend(void *data)
}
sysdev_resume();
- dpm_resume_noirq(PMSG_RESUME);
return 0;
}
@@ -81,6 +79,12 @@ static void do_suspend(void)
shutting_down = SHUTDOWN_SUSPEND;
+ err = stop_machine_create();
+ if (err) {
+ printk(KERN_ERR "xen suspend: failed to setup stop_machine %d\n", err);
+ goto out;
+ }
+
#ifdef CONFIG_PREEMPT
/* If the kernel is preemptible, we need to freeze all the processes
to prevent them from being in the middle of a pagetable update
@@ -88,29 +92,32 @@ static void do_suspend(void)
err = freeze_processes();
if (err) {
printk(KERN_ERR "xen suspend: freeze failed %d\n", err);
- return;
+ goto out_destroy_sm;
}
#endif
err = dpm_suspend_start(PMSG_SUSPEND);
if (err) {
printk(KERN_ERR "xen suspend: dpm_suspend_start %d\n", err);
- goto out;
+ goto out_thaw;
}
- printk(KERN_DEBUG "suspending xenstore...\n");
- xs_suspend();
-
err = dpm_suspend_noirq(PMSG_SUSPEND);
if (err) {
printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err);
- goto resume_devices;
+ goto out_resume;
}
+ printk(KERN_DEBUG "suspending xenstore...\n");
+ xs_suspend();
+
err = stop_machine(xen_suspend, &cancelled, cpumask_of(0));
+
+ dpm_resume_noirq(PMSG_RESUME);
+
if (err) {
printk(KERN_ERR "failed to start xen_suspend: %d\n", err);
- goto out;
+ cancelled = 1;
}
if (!cancelled) {
@@ -119,17 +126,21 @@ static void do_suspend(void)
} else
xs_suspend_cancel();
- dpm_resume_noirq(PMSG_RESUME);
-
-resume_devices:
+out_resume:
dpm_resume_end(PMSG_RESUME);
/* Make sure timer events get retriggered on all CPUs */
clock_was_set();
-out:
+
+out_thaw:
#ifdef CONFIG_PREEMPT
thaw_processes();
+
+out_destroy_sm:
#endif
+ stop_machine_destroy();
+
+out:
shutting_down = SHUTDOWN_INVALID;
}
#endif /* CONFIG_PM_SLEEP */