diff options
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 | } |