diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2008-10-26 15:56:30 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-12-19 04:40:35 -0500 |
commit | ba84ed9546e91348fdf3ff2bff859b0ee53b407a (patch) | |
tree | f9ea9370416744de2fa80dbf7a4c25a2589c6a41 /drivers/acpi/sleep/main.c | |
parent | b69edc76539be6a4aa39a22f85365fd4a3b3b9d2 (diff) |
ACPI hibernate: Introduce new kernel parameter acpi_sleep=s4_nonvs
On some machines it may be necessary to disable the saving/restoring
of the ACPI NVS memory region during hibernation/resume. For this
purpose, introduce new ACPI kernel command line option
acpi_sleep=s4_nonvs.
Based on a patch by Zhang Rui.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Nigel Cunningham <nigel@tuxonice.net>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/sleep/main.c')
-rw-r--r-- | drivers/acpi/sleep/main.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 45a8015e4217..bef41fd4c877 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -101,6 +101,19 @@ void __init acpi_old_suspend_ordering(void) | |||
101 | * cases. | 101 | * cases. |
102 | */ | 102 | */ |
103 | static bool set_sci_en_on_resume; | 103 | static bool set_sci_en_on_resume; |
104 | /* | ||
105 | * The ACPI specification wants us to save NVS memory regions during hibernation | ||
106 | * and to restore them during the subsequent resume. However, it is not certain | ||
107 | * if this mechanism is going to work on all machines, so we allow the user to | ||
108 | * disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line | ||
109 | * option. | ||
110 | */ | ||
111 | static bool s4_no_nvs; | ||
112 | |||
113 | void __init acpi_s4_no_nvs(void) | ||
114 | { | ||
115 | s4_no_nvs = true; | ||
116 | } | ||
104 | 117 | ||
105 | /** | 118 | /** |
106 | * acpi_pm_disable_gpes - Disable the GPEs. | 119 | * acpi_pm_disable_gpes - Disable the GPEs. |
@@ -396,7 +409,7 @@ static int acpi_hibernation_begin(void) | |||
396 | { | 409 | { |
397 | int error; | 410 | int error; |
398 | 411 | ||
399 | error = hibernate_nvs_alloc(); | 412 | error = s4_no_nvs ? 0 : hibernate_nvs_alloc(); |
400 | if (!error) { | 413 | if (!error) { |
401 | acpi_target_sleep_state = ACPI_STATE_S4; | 414 | acpi_target_sleep_state = ACPI_STATE_S4; |
402 | acpi_sleep_tts_switch(acpi_target_sleep_state); | 415 | acpi_sleep_tts_switch(acpi_target_sleep_state); |
@@ -494,7 +507,8 @@ static int acpi_hibernation_begin_old(void) | |||
494 | error = acpi_sleep_prepare(ACPI_STATE_S4); | 507 | error = acpi_sleep_prepare(ACPI_STATE_S4); |
495 | 508 | ||
496 | if (!error) { | 509 | if (!error) { |
497 | error = hibernate_nvs_alloc(); | 510 | if (!s4_no_nvs) |
511 | error = hibernate_nvs_alloc(); | ||
498 | if (!error) | 512 | if (!error) |
499 | acpi_target_sleep_state = ACPI_STATE_S4; | 513 | acpi_target_sleep_state = ACPI_STATE_S4; |
500 | } | 514 | } |