diff options
-rw-r--r-- | arch/x86/kernel/acpi/sleep.c | 2 | ||||
-rw-r--r-- | drivers/acpi/sleep.c | 17 | ||||
-rw-r--r-- | include/linux/acpi.h | 1 |
3 files changed, 19 insertions, 1 deletions
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 11676cf65aee..d5e0d717005a 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -101,6 +101,8 @@ static int __init acpi_sleep_setup(char *str) | |||
101 | #endif | 101 | #endif |
102 | if (strncmp(str, "nonvs", 5) == 0) | 102 | if (strncmp(str, "nonvs", 5) == 0) |
103 | acpi_nvs_nosave(); | 103 | acpi_nvs_nosave(); |
104 | if (strncmp(str, "nonvs_s3", 8) == 0) | ||
105 | acpi_nvs_nosave_s3(); | ||
104 | if (strncmp(str, "old_ordering", 12) == 0) | 106 | if (strncmp(str, "old_ordering", 12) == 0) |
105 | acpi_old_suspend_ordering(); | 107 | acpi_old_suspend_ordering(); |
106 | str = strchr(str, ','); | 108 | str = strchr(str, ','); |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index fdcdbb652915..8640782944cc 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -98,6 +98,21 @@ void __init acpi_nvs_nosave(void) | |||
98 | } | 98 | } |
99 | 99 | ||
100 | /* | 100 | /* |
101 | * The ACPI specification wants us to save NVS memory regions during hibernation | ||
102 | * but says nothing about saving NVS during S3. Not all versions of Windows | ||
103 | * save NVS on S3 suspend either, and it is clear that not all systems need | ||
104 | * NVS to be saved at S3 time. To improve suspend/resume time, allow the | ||
105 | * user to disable saving NVS on S3 if their system does not require it, but | ||
106 | * continue to save/restore NVS for S4 as specified. | ||
107 | */ | ||
108 | static bool nvs_nosave_s3; | ||
109 | |||
110 | void __init acpi_nvs_nosave_s3(void) | ||
111 | { | ||
112 | nvs_nosave_s3 = true; | ||
113 | } | ||
114 | |||
115 | /* | ||
101 | * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the | 116 | * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the |
102 | * user to request that behavior by using the 'acpi_old_suspend_ordering' | 117 | * user to request that behavior by using the 'acpi_old_suspend_ordering' |
103 | * kernel command line option that causes the following variable to be set. | 118 | * kernel command line option that causes the following variable to be set. |
@@ -243,7 +258,7 @@ static int acpi_suspend_begin(suspend_state_t pm_state) | |||
243 | u32 acpi_state = acpi_suspend_states[pm_state]; | 258 | u32 acpi_state = acpi_suspend_states[pm_state]; |
244 | int error = 0; | 259 | int error = 0; |
245 | 260 | ||
246 | error = nvs_nosave ? 0 : suspend_nvs_alloc(); | 261 | error = (nvs_nosave || nvs_nosave_s3) ? 0 : suspend_nvs_alloc(); |
247 | if (error) | 262 | if (error) |
248 | return error; | 263 | return error; |
249 | 264 | ||
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 90be98981102..3cf93491125c 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -261,6 +261,7 @@ int acpi_resources_are_enforced(void); | |||
261 | void __init acpi_no_s4_hw_signature(void); | 261 | void __init acpi_no_s4_hw_signature(void); |
262 | void __init acpi_old_suspend_ordering(void); | 262 | void __init acpi_old_suspend_ordering(void); |
263 | void __init acpi_nvs_nosave(void); | 263 | void __init acpi_nvs_nosave(void); |
264 | void __init acpi_nvs_nosave_s3(void); | ||
264 | #endif /* CONFIG_PM_SLEEP */ | 265 | #endif /* CONFIG_PM_SLEEP */ |
265 | 266 | ||
266 | struct acpi_osc_context { | 267 | struct acpi_osc_context { |