diff options
Diffstat (limited to 'kernel/power/disk.c')
| -rw-r--r-- | kernel/power/disk.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 4de2f69fe095..02e4fb69111a 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
| @@ -122,8 +122,6 @@ static int prepare_processes(void) | |||
| 122 | /** | 122 | /** |
| 123 | * pm_suspend_disk - The granpappy of hibernation power management. | 123 | * pm_suspend_disk - The granpappy of hibernation power management. |
| 124 | * | 124 | * |
| 125 | * If we're going through the firmware, then get it over with quickly. | ||
| 126 | * | ||
| 127 | * If not, then call swsusp to do its thing, then figure out how | 125 | * If not, then call swsusp to do its thing, then figure out how |
| 128 | * to power down the system. | 126 | * to power down the system. |
| 129 | */ | 127 | */ |
| @@ -292,7 +290,6 @@ late_initcall(software_resume); | |||
| 292 | 290 | ||
| 293 | 291 | ||
| 294 | static const char * const pm_disk_modes[] = { | 292 | static const char * const pm_disk_modes[] = { |
| 295 | [PM_DISK_FIRMWARE] = "firmware", | ||
| 296 | [PM_DISK_PLATFORM] = "platform", | 293 | [PM_DISK_PLATFORM] = "platform", |
| 297 | [PM_DISK_SHUTDOWN] = "shutdown", | 294 | [PM_DISK_SHUTDOWN] = "shutdown", |
| 298 | [PM_DISK_REBOOT] = "reboot", | 295 | [PM_DISK_REBOOT] = "reboot", |
| @@ -303,27 +300,25 @@ static const char * const pm_disk_modes[] = { | |||
| 303 | /** | 300 | /** |
| 304 | * disk - Control suspend-to-disk mode | 301 | * disk - Control suspend-to-disk mode |
| 305 | * | 302 | * |
| 306 | * Suspend-to-disk can be handled in several ways. The greatest | 303 | * Suspend-to-disk can be handled in several ways. We have a few options |
| 307 | * distinction is who writes memory to disk - the firmware or the OS. | 304 | * for putting the system to sleep - using the platform driver (e.g. ACPI |
| 308 | * If the firmware does it, we assume that it also handles suspending | 305 | * or other pm_ops), powering off the system or rebooting the system |
| 309 | * the system. | 306 | * (for testing) as well as the two test modes. |
| 310 | * If the OS does it, then we have three options for putting the system | ||
| 311 | * to sleep - using the platform driver (e.g. ACPI or other PM registers), | ||
| 312 | * powering off the system or rebooting the system (for testing). | ||
| 313 | * | 307 | * |
| 314 | * The system will support either 'firmware' or 'platform', and that is | 308 | * The system can support 'platform', and that is known a priori (and |
| 315 | * known a priori (and encoded in pm_ops). But, the user may choose | 309 | * encoded in pm_ops). However, the user may choose 'shutdown' or 'reboot' |
| 316 | * 'shutdown' or 'reboot' as alternatives. | 310 | * as alternatives, as well as the test modes 'test' and 'testproc'. |
| 317 | * | 311 | * |
| 318 | * show() will display what the mode is currently set to. | 312 | * show() will display what the mode is currently set to. |
| 319 | * store() will accept one of | 313 | * store() will accept one of |
| 320 | * | 314 | * |
| 321 | * 'firmware' | ||
| 322 | * 'platform' | 315 | * 'platform' |
| 323 | * 'shutdown' | 316 | * 'shutdown' |
| 324 | * 'reboot' | 317 | * 'reboot' |
| 318 | * 'test' | ||
| 319 | * 'testproc' | ||
| 325 | * | 320 | * |
| 326 | * It will only change to 'firmware' or 'platform' if the system | 321 | * It will only change to 'platform' if the system |
| 327 | * supports it (as determined from pm_ops->pm_disk_mode). | 322 | * supports it (as determined from pm_ops->pm_disk_mode). |
| 328 | */ | 323 | */ |
| 329 | 324 | ||
| @@ -345,7 +340,7 @@ static ssize_t disk_store(struct subsystem * s, const char * buf, size_t n) | |||
| 345 | len = p ? p - buf : n; | 340 | len = p ? p - buf : n; |
| 346 | 341 | ||
| 347 | mutex_lock(&pm_mutex); | 342 | mutex_lock(&pm_mutex); |
| 348 | for (i = PM_DISK_FIRMWARE; i < PM_DISK_MAX; i++) { | 343 | for (i = PM_DISK_PLATFORM; i < PM_DISK_MAX; i++) { |
| 349 | if (!strncmp(buf, pm_disk_modes[i], len)) { | 344 | if (!strncmp(buf, pm_disk_modes[i], len)) { |
| 350 | mode = i; | 345 | mode = i; |
| 351 | break; | 346 | break; |
