diff options
Diffstat (limited to 'kernel/power/user.c')
-rw-r--r-- | kernel/power/user.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c index 93b5dd283dea..d991d3b0e5a4 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/swapops.h> | 19 | #include <linux/swapops.h> |
20 | #include <linux/pm.h> | 20 | #include <linux/pm.h> |
21 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
22 | #include <linux/console.h> | ||
22 | #include <linux/cpu.h> | 23 | #include <linux/cpu.h> |
23 | 24 | ||
24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
@@ -173,12 +174,14 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, | |||
173 | /* Free memory before shutting down devices. */ | 174 | /* Free memory before shutting down devices. */ |
174 | error = swsusp_shrink_memory(); | 175 | error = swsusp_shrink_memory(); |
175 | if (!error) { | 176 | if (!error) { |
177 | suspend_console(); | ||
176 | error = device_suspend(PMSG_FREEZE); | 178 | error = device_suspend(PMSG_FREEZE); |
177 | if (!error) { | 179 | if (!error) { |
178 | in_suspend = 1; | 180 | in_suspend = 1; |
179 | error = swsusp_suspend(); | 181 | error = swsusp_suspend(); |
180 | device_resume(); | 182 | device_resume(); |
181 | } | 183 | } |
184 | resume_console(); | ||
182 | } | 185 | } |
183 | up(&pm_sem); | 186 | up(&pm_sem); |
184 | if (!error) | 187 | if (!error) |
@@ -196,11 +199,13 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, | |||
196 | snapshot_free_unused_memory(&data->handle); | 199 | snapshot_free_unused_memory(&data->handle); |
197 | down(&pm_sem); | 200 | down(&pm_sem); |
198 | pm_prepare_console(); | 201 | pm_prepare_console(); |
202 | suspend_console(); | ||
199 | error = device_suspend(PMSG_PRETHAW); | 203 | error = device_suspend(PMSG_PRETHAW); |
200 | if (!error) { | 204 | if (!error) { |
201 | error = swsusp_resume(); | 205 | error = swsusp_resume(); |
202 | device_resume(); | 206 | device_resume(); |
203 | } | 207 | } |
208 | resume_console(); | ||
204 | pm_restore_console(); | 209 | pm_restore_console(); |
205 | up(&pm_sem); | 210 | up(&pm_sem); |
206 | break; | 211 | break; |
@@ -289,6 +294,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, | |||
289 | } | 294 | } |
290 | 295 | ||
291 | /* Put devices to sleep */ | 296 | /* Put devices to sleep */ |
297 | suspend_console(); | ||
292 | error = device_suspend(PMSG_SUSPEND); | 298 | error = device_suspend(PMSG_SUSPEND); |
293 | if (error) { | 299 | if (error) { |
294 | printk(KERN_ERR "Failed to suspend some devices.\n"); | 300 | printk(KERN_ERR "Failed to suspend some devices.\n"); |
@@ -299,7 +305,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, | |||
299 | /* Wake up devices */ | 305 | /* Wake up devices */ |
300 | device_resume(); | 306 | device_resume(); |
301 | } | 307 | } |
302 | 308 | resume_console(); | |
303 | if (pm_ops->finish) | 309 | if (pm_ops->finish) |
304 | pm_ops->finish(PM_SUSPEND_MEM); | 310 | pm_ops->finish(PM_SUSPEND_MEM); |
305 | 311 | ||