summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2008-10-26 20:56:30 +0100
committerLen Brown <len.brown@intel.com>2008-12-19 04:40:35 -0500
commitba84ed9546e91348fdf3ff2bff859b0ee53b407a (patch)
treef9ea9370416744de2fa80dbf7a4c25a2589c6a41 /drivers/acpi
parentb69edc76539be6a4aa39a22f85365fd4a3b3b9d2 (diff)
downloadtalos-obmc-linux-ba84ed9546e91348fdf3ff2bff859b0ee53b407a.tar.gz
talos-obmc-linux-ba84ed9546e91348fdf3ff2bff859b0ee53b407a.zip
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')
-rw-r--r--drivers/acpi/sleep/main.c18
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)
* cases.
*/
static bool set_sci_en_on_resume;
+/*
+ * The ACPI specification wants us to save NVS memory regions during hibernation
+ * and to restore them during the subsequent resume. However, it is not certain
+ * if this mechanism is going to work on all machines, so we allow the user to
+ * disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line
+ * option.
+ */
+static bool s4_no_nvs;
+
+void __init acpi_s4_no_nvs(void)
+{
+ s4_no_nvs = true;
+}
/**
* acpi_pm_disable_gpes - Disable the GPEs.
@@ -396,7 +409,7 @@ static int acpi_hibernation_begin(void)
{
int error;
- error = hibernate_nvs_alloc();
+ error = s4_no_nvs ? 0 : hibernate_nvs_alloc();
if (!error) {
acpi_target_sleep_state = ACPI_STATE_S4;
acpi_sleep_tts_switch(acpi_target_sleep_state);
@@ -494,7 +507,8 @@ static int acpi_hibernation_begin_old(void)
error = acpi_sleep_prepare(ACPI_STATE_S4);
if (!error) {
- error = hibernate_nvs_alloc();
+ if (!s4_no_nvs)
+ error = hibernate_nvs_alloc();
if (!error)
acpi_target_sleep_state = ACPI_STATE_S4;
}
OpenPOWER on IntegriCloud