aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/suspend.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 /kernel/power/suspend.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 'kernel/power/suspend.c')
-rw-r--r--kernel/power/suspend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 4fd51beed879..560a639614a1 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -147,7 +147,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
147 goto Platform_finish; 147 goto Platform_finish;
148 } 148 }
149 149
150 error = dpm_suspend_noirq(PMSG_SUSPEND); 150 error = dpm_suspend_end(PMSG_SUSPEND);
151 if (error) { 151 if (error) {
152 printk(KERN_ERR "PM: Some devices failed to power down\n"); 152 printk(KERN_ERR "PM: Some devices failed to power down\n");
153 goto Platform_finish; 153 goto Platform_finish;
@@ -189,7 +189,7 @@ static int suspend_enter(suspend_state_t state, bool *wakeup)
189 if (suspend_ops->wake) 189 if (suspend_ops->wake)
190 suspend_ops->wake(); 190 suspend_ops->wake();
191 191
192 dpm_resume_noirq(PMSG_RESUME); 192 dpm_resume_start(PMSG_RESUME);
193 193
194 Platform_finish: 194 Platform_finish:
195 if (suspend_ops->finish) 195 if (suspend_ops->finish)