aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/Kconfig11
-rw-r--r--kernel/power/disk.c4
-rw-r--r--kernel/power/swsusp.c9
-rw-r--r--kernel/power/user.c2
4 files changed, 22 insertions, 4 deletions
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index 4b6e2f18e056..825068ca3479 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -64,6 +64,17 @@ config PM_TRACE
64 CAUTION: this option will cause your machine's real-time clock to be 64 CAUTION: this option will cause your machine's real-time clock to be
65 set to an invalid time after a resume. 65 set to an invalid time after a resume.
66 66
67config PM_SYSFS_DEPRECATED
68 bool "Driver model /sys/devices/.../power/state files (DEPRECATED)"
69 depends on PM && SYSFS
70 default n
71 help
72 The driver model started out with a sysfs file intended to provide
73 a userspace hook for device power management. This feature has never
74 worked very well, except for limited testing purposes, and so it will
75 be removed. It's not clear that a generic mechanism could really
76 handle the wide variability of device power states; any replacements
77 are likely to be bus or driver specific.
67 78
68config SOFTWARE_SUSPEND 79config SOFTWARE_SUSPEND
69 bool "Software Suspend" 80 bool "Software Suspend"
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 7c7b9b65e365..d72234942798 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -103,7 +103,7 @@ static void unprepare_processes(void)
103} 103}
104 104
105/** 105/**
106 * pm_suspend_disk - The granpappy of power management. 106 * pm_suspend_disk - The granpappy of hibernation power management.
107 * 107 *
108 * If we're going through the firmware, then get it over with quickly. 108 * If we're going through the firmware, then get it over with quickly.
109 * 109 *
@@ -212,7 +212,7 @@ static int software_resume(void)
212 212
213 pr_debug("PM: Preparing devices for restore.\n"); 213 pr_debug("PM: Preparing devices for restore.\n");
214 214
215 if ((error = device_suspend(PMSG_FREEZE))) { 215 if ((error = device_suspend(PMSG_PRETHAW))) {
216 printk("Some devices failed to suspend\n"); 216 printk("Some devices failed to suspend\n");
217 swsusp_free(); 217 swsusp_free();
218 goto Thaw; 218 goto Thaw;
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index 8ef677ea0cea..0b66659dc516 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -247,6 +247,9 @@ int swsusp_suspend(void)
247 restore_processor_state(); 247 restore_processor_state();
248Restore_highmem: 248Restore_highmem:
249 restore_highmem(); 249 restore_highmem();
250 /* NOTE: device_power_up() is just a resume() for devices
251 * that suspended with irqs off ... no overall powerup.
252 */
250 device_power_up(); 253 device_power_up();
251Enable_irqs: 254Enable_irqs:
252 local_irq_enable(); 255 local_irq_enable();
@@ -256,8 +259,12 @@ Enable_irqs:
256int swsusp_resume(void) 259int swsusp_resume(void)
257{ 260{
258 int error; 261 int error;
262
259 local_irq_disable(); 263 local_irq_disable();
260 if (device_power_down(PMSG_FREEZE)) 264 /* NOTE: device_power_down() is just a suspend() with irqs off;
265 * it has no special "power things down" semantics
266 */
267 if (device_power_down(PMSG_PRETHAW))
261 printk(KERN_ERR "Some devices failed to power down, very bad\n"); 268 printk(KERN_ERR "Some devices failed to power down, very bad\n");
262 /* We'll ignore saved state, but this gets preempt count (etc) right */ 269 /* We'll ignore saved state, but this gets preempt count (etc) right */
263 save_processor_state(); 270 save_processor_state();
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 2e4499f3e4d9..72825c853cd7 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -196,7 +196,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
196 snapshot_free_unused_memory(&data->handle); 196 snapshot_free_unused_memory(&data->handle);
197 down(&pm_sem); 197 down(&pm_sem);
198 pm_prepare_console(); 198 pm_prepare_console();
199 error = device_suspend(PMSG_FREEZE); 199 error = device_suspend(PMSG_PRETHAW);
200 if (!error) { 200 if (!error) {
201 error = swsusp_resume(); 201 error = swsusp_resume();
202 device_resume(); 202 device_resume();