aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xenbus
diff options
context:
space:
mode:
authorShriram Rajagopalan <rshriram@cs.ubc.ca>2011-02-22 17:59:06 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-03-16 13:42:56 -0400
commitb3e96c0c756211e805c6941d4a6e5f6e1995cb6b (patch)
tree1e11a95ae6d234f98e20f40dcc89cf28df229ca4 /drivers/xen/xenbus
parentc7853aea57d8e850b0979e7bdcbcabdcbbdd9e37 (diff)
xen: use freeze/restore/thaw PM events for suspend/resume/chkpt
Use PM_FREEZE, PM_THAW and PM_RESTORE power events for suspend/resume/checkpoint functionality, instead of PM_SUSPEND and PM_RESUME. Use of these pm events fixes the Xen Guest hangup when taking checkpoints. When a suspend event is cancelled (while taking checkpoints once/continuously), we use PM_THAW instead of PM_RESUME. PM_RESTORE is used when suspend is not cancelled. See Documentation/power/devices.txt and linux/pm.h for more info about freeze, thaw and restore. The sequence of pm events in a suspend-resume scenario is shown below. dpm_suspend_start(PMSG_FREEZE); dpm_suspend_noirq(PMSG_FREEZE); sysdev_suspend(PMSG_FREEZE); cancelled = suspend_hypercall() sysdev_resume(); dpm_resume_noirq(cancelled ? PMSG_THAW : PMSG_RESTORE); dpm_resume_end(cancelled ? PMSG_THAW : PMSG_RESTORE); Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/xenbus')
-rw-r--r--drivers/xen/xenbus/xenbus_probe_frontend.c8
1 files changed, 5 insertions, 3 deletions
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
88static const struct dev_pm_ops xenbus_pm_ops = { 88static 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
94static struct xen_bus_type xenbus_frontend = { 96static struct xen_bus_type xenbus_frontend = {