diff options
Diffstat (limited to 'kernel/power/disk.c')
| -rw-r--r-- | kernel/power/disk.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 81d4d982f3f0..d72234942798 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/cpu.h> | ||
| 21 | 22 | ||
| 22 | #include "power.h" | 23 | #include "power.h" |
| 23 | 24 | ||
| @@ -72,7 +73,10 @@ static int prepare_processes(void) | |||
| 72 | int error; | 73 | int error; |
| 73 | 74 | ||
| 74 | pm_prepare_console(); | 75 | pm_prepare_console(); |
| 75 | disable_nonboot_cpus(); | 76 | |
| 77 | error = disable_nonboot_cpus(); | ||
| 78 | if (error) | ||
| 79 | goto enable_cpus; | ||
| 76 | 80 | ||
| 77 | if (freeze_processes()) { | 81 | if (freeze_processes()) { |
| 78 | error = -EBUSY; | 82 | error = -EBUSY; |
| @@ -84,6 +88,7 @@ static int prepare_processes(void) | |||
| 84 | return 0; | 88 | return 0; |
| 85 | thaw: | 89 | thaw: |
| 86 | thaw_processes(); | 90 | thaw_processes(); |
| 91 | enable_cpus: | ||
| 87 | enable_nonboot_cpus(); | 92 | enable_nonboot_cpus(); |
| 88 | pm_restore_console(); | 93 | pm_restore_console(); |
| 89 | return error; | 94 | return error; |
| @@ -98,7 +103,7 @@ static void unprepare_processes(void) | |||
| 98 | } | 103 | } |
| 99 | 104 | ||
| 100 | /** | 105 | /** |
| 101 | * pm_suspend_disk - The granpappy of power management. | 106 | * pm_suspend_disk - The granpappy of hibernation power management. |
| 102 | * | 107 | * |
| 103 | * 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. |
| 104 | * | 109 | * |
| @@ -207,7 +212,7 @@ static int software_resume(void) | |||
| 207 | 212 | ||
| 208 | pr_debug("PM: Preparing devices for restore.\n"); | 213 | pr_debug("PM: Preparing devices for restore.\n"); |
| 209 | 214 | ||
| 210 | if ((error = device_suspend(PMSG_FREEZE))) { | 215 | if ((error = device_suspend(PMSG_PRETHAW))) { |
| 211 | printk("Some devices failed to suspend\n"); | 216 | printk("Some devices failed to suspend\n"); |
| 212 | swsusp_free(); | 217 | swsusp_free(); |
| 213 | goto Thaw; | 218 | goto Thaw; |
| @@ -231,7 +236,7 @@ static int software_resume(void) | |||
| 231 | late_initcall(software_resume); | 236 | late_initcall(software_resume); |
| 232 | 237 | ||
| 233 | 238 | ||
| 234 | static char * pm_disk_modes[] = { | 239 | static const char * const pm_disk_modes[] = { |
| 235 | [PM_DISK_FIRMWARE] = "firmware", | 240 | [PM_DISK_FIRMWARE] = "firmware", |
| 236 | [PM_DISK_PLATFORM] = "platform", | 241 | [PM_DISK_PLATFORM] = "platform", |
| 237 | [PM_DISK_SHUTDOWN] = "shutdown", | 242 | [PM_DISK_SHUTDOWN] = "shutdown", |
