aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/manage.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-01-29 14:38:29 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2012-01-29 14:38:29 -0500
commitcf579dfb82550e34de7ccf3ef090d8b834ccd3a9 (patch)
tree764ed72670c18c86d3eb9650025c56d661a31315 /drivers/xen/manage.c
parent181e9bdef37bfcaa41f3ab6c948a2a0d60a268b5 (diff)
PM / Sleep: Introduce "late suspend" and "early resume" of devices
The current device suspend/resume phases during system-wide power transitions appear to be insufficient for some platforms that want to use the same callback routines for saving device states and related operations during runtime suspend/resume as well as during system suspend/resume. In principle, they could point their .suspend_noirq() and .resume_noirq() to the same callback routines as their .runtime_suspend() and .runtime_resume(), respectively, but at least some of them require device interrupts to be enabled while the code in those routines is running. It also makes sense to have device suspend-resume callbacks that will be executed with runtime PM disabled and with device interrupts enabled in case someone needs to run some special code in that context during system-wide power transitions. Apart from this, .suspend_noirq() and .resume_noirq() were introduced as a workaround for drivers using shared interrupts and failing to prevent their interrupt handlers from accessing suspended hardware. It appears to be better not to use them for other porposes, or we may have to deal with some serious confusion (which seems to be happening already). For the above reasons, introduce new device suspend/resume phases, "late suspend" and "early resume" (and analogously for hibernation) whose callback will be executed with runtime PM disabled and with device interrupts enabled and whose callback pointers generally may point to runtime suspend/resume routines. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/xen/manage.c')
-rw-r--r--drivers/xen/manage.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index ce4fa0831860..9e14ae6cd49c 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -129,9 +129,9 @@ static void do_suspend(void)
129 printk(KERN_DEBUG "suspending xenstore...\n"); 129 printk(KERN_DEBUG "suspending xenstore...\n");
130 xs_suspend(); 130 xs_suspend();
131 131
132 err = dpm_suspend_noirq(PMSG_FREEZE); 132 err = dpm_suspend_end(PMSG_FREEZE);
133 if (err) { 133 if (err) {
134 printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err); 134 printk(KERN_ERR "dpm_suspend_end failed: %d\n", err);
135 goto out_resume; 135 goto out_resume;
136 } 136 }
137 137
@@ -149,7 +149,7 @@ static void do_suspend(void)
149 149
150 err = stop_machine(xen_suspend, &si, cpumask_of(0)); 150 err = stop_machine(xen_suspend, &si, cpumask_of(0));
151 151
152 dpm_resume_noirq(si.cancelled ? PMSG_THAW : PMSG_RESTORE); 152 dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
153 153
154 if (err) { 154 if (err) {
155 printk(KERN_ERR "failed to start xen_suspend: %d\n", err); 155 printk(KERN_ERR "failed to start xen_suspend: %d\n", err);