aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep.c
diff options
context:
space:
mode:
authorKristen Carlson Accardi <kristen@linux.intel.com>2012-10-26 07:39:15 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-14 18:16:02 -0500
commit1bad2f19f7f79d1ec9e6c48168fd7ce8dc1c305f (patch)
tree843ef81c4891196ccb995450d83fda7d478f8056 /drivers/acpi/sleep.c
parentf4fa0e018a175ea92a3187ade8f678599dc5980a (diff)
ACPI / Sleep: add acpi_sleep=nonvs_s3 parameter
The ACPI specificiation would like us to save NVS at hibernation time, but makes no mention of saving NVS over S3. Not all versions of Windows do this either, and it is clear that not all machines need NVS saved/restored over S3. Allow the user to improve their suspend/resume time by disabling the NVS save/restore at S3 time, but continue to do the NVS save/restore for S4 as specified. Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r--drivers/acpi/sleep.c17
1 files changed, 16 insertions, 1 deletions
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 */
108static bool nvs_nosave_s3;
109
110void __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