aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/disk.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2006-10-11 04:20:45 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:14 -0400
commit97c7801cd5b0bb6a38c16108a496235474dc6310 (patch)
tree04b17b411a39f23404bd58346156fda0055b945c /kernel/power/disk.c
parentdea20a3fbdd08e5ae2a0b33d2577c794a3764a11 (diff)
[PATCH] swsusp: Use suspend_console
Add suspend_console() and resume_console() to the suspend-to-disk code paths so that the users of netconsole can use swsusp with it. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power/disk.c')
-rw-r--r--kernel/power/disk.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index d72234942798..d3a158a60312 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -18,6 +18,7 @@
18#include <linux/fs.h> 18#include <linux/fs.h>
19#include <linux/mount.h> 19#include <linux/mount.h>
20#include <linux/pm.h> 20#include <linux/pm.h>
21#include <linux/console.h>
21#include <linux/cpu.h> 22#include <linux/cpu.h>
22 23
23#include "power.h" 24#include "power.h"
@@ -119,8 +120,10 @@ int pm_suspend_disk(void)
119 if (error) 120 if (error)
120 return error; 121 return error;
121 122
123 suspend_console();
122 error = device_suspend(PMSG_FREEZE); 124 error = device_suspend(PMSG_FREEZE);
123 if (error) { 125 if (error) {
126 resume_console();
124 printk("Some devices failed to suspend\n"); 127 printk("Some devices failed to suspend\n");
125 unprepare_processes(); 128 unprepare_processes();
126 return error; 129 return error;
@@ -133,6 +136,7 @@ int pm_suspend_disk(void)
133 136
134 if (in_suspend) { 137 if (in_suspend) {
135 device_resume(); 138 device_resume();
139 resume_console();
136 pr_debug("PM: writing image.\n"); 140 pr_debug("PM: writing image.\n");
137 error = swsusp_write(); 141 error = swsusp_write();
138 if (!error) 142 if (!error)
@@ -148,6 +152,7 @@ int pm_suspend_disk(void)
148 swsusp_free(); 152 swsusp_free();
149 Done: 153 Done:
150 device_resume(); 154 device_resume();
155 resume_console();
151 unprepare_processes(); 156 unprepare_processes();
152 return error; 157 return error;
153} 158}
@@ -212,7 +217,9 @@ static int software_resume(void)
212 217
213 pr_debug("PM: Preparing devices for restore.\n"); 218 pr_debug("PM: Preparing devices for restore.\n");
214 219
220 suspend_console();
215 if ((error = device_suspend(PMSG_PRETHAW))) { 221 if ((error = device_suspend(PMSG_PRETHAW))) {
222 resume_console();
216 printk("Some devices failed to suspend\n"); 223 printk("Some devices failed to suspend\n");
217 swsusp_free(); 224 swsusp_free();
218 goto Thaw; 225 goto Thaw;
@@ -224,6 +231,7 @@ static int software_resume(void)
224 swsusp_resume(); 231 swsusp_resume();
225 pr_debug("PM: Restore failed, recovering.n"); 232 pr_debug("PM: Restore failed, recovering.n");
226 device_resume(); 233 device_resume();
234 resume_console();
227 Thaw: 235 Thaw:
228 unprepare_processes(); 236 unprepare_processes();
229 Done: 237 Done: