[linux-next] [PATCH V2 4/4] introduce new kernel parameteracpi_sleep=s4_nvs_nosave

From: Zhang Rui
Date: Fri Jul 11 2008 - 01:31:31 EST



Introduce new kernel parameter acpi_sleep=s4_nvs_nosave.

This can be used to prevent OS from saving/restoring ACPI NVS memory.

Signed-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>
---
Documentation/kernel-parameters.txt | 5 ++++-
arch/x86/kernel/acpi/sleep.c | 3 +++
drivers/acpi/sleep/main.c | 3 +++
include/asm-x86/acpi.h | 3 +++
4 files changed, 13 insertions(+), 1 deletion(-)

Index: linux-next/Documentation/kernel-parameters.txt
===================================================================
--- linux-next.orig/Documentation/kernel-parameters.txt 2008-07-11 13:04:46.000000000 +0800
+++ linux-next/Documentation/kernel-parameters.txt 2008-07-11 13:05:15.000000000 +0800
@@ -147,7 +147,8 @@
default: 0

acpi_sleep= [HW,ACPI] Sleep options
- Format: { s3_bios, s3_mode, s3_beep, old_ordering }
+ Format: { s3_bios, s3_mode, s3_beep, old_ordering,
+ s4_nvs_nosave }
See Documentation/power/video.txt for s3_bios and s3_mode.
s3_beep is for debugging; it makes the PC's speaker beep
as soon as the kernel's real-mode entry point is called.
@@ -155,6 +156,8 @@
control method, wrt putting devices into low power
states, to be enforced (the ACPI 2.0 ordering of _PTS is
used by default).
+ s4_nvs_nosave prevents kernel from saving/restoring
+ ACPI NVS memory during hibernation.

acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode
Format: { level | edge | high | low }
Index: linux-next/arch/x86/kernel/acpi/sleep.c
===================================================================
--- linux-next.orig/arch/x86/kernel/acpi/sleep.c 2008-07-11 13:04:46.000000000 +0800
+++ linux-next/arch/x86/kernel/acpi/sleep.c 2008-07-11 13:05:15.000000000 +0800
@@ -15,6 +15,7 @@

unsigned long acpi_wakeup_address;
unsigned long acpi_realmode_flags;
+int acpi_sleep_flags;

/* address in low memory of the wakeup routine. */
static unsigned long acpi_realmode;
@@ -142,6 +143,8 @@
acpi_realmode_flags |= 4;
if (strncmp(str, "old_ordering", 12) == 0)
acpi_old_suspend_ordering();
+ if (strncmp(str, "s4_nvs_nosave", 13) == 0)
+ acpi_sleep_flags |= ACPI_HIBERNATION_NVS_NOSAVE;
str = strchr(str, ',');
if (str != NULL)
str += strspn(str, ", \t");
Index: linux-next/drivers/acpi/sleep/main.c
===================================================================
--- linux-next.orig/drivers/acpi/sleep/main.c 2008-07-11 13:04:46.000000000 +0800
+++ linux-next/drivers/acpi/sleep/main.c 2008-07-11 13:05:15.000000000 +0800
@@ -297,6 +297,9 @@
{
struct nvs_page *pos, *next;

+ if (acpi_sleep_flags & ACPI_HIBERNATION_NVS_NOSAVE)
+ return 0;
+
while (start <= end) {
pos = kzalloc(sizeof(struct nvs_page), GFP_KERNEL);
if (!pos)
Index: linux-next/include/asm-x86/acpi.h
===================================================================
--- linux-next.orig/include/asm-x86/acpi.h 2008-07-10 13:29:18.000000000 +0800
+++ linux-next/include/asm-x86/acpi.h 2008-07-11 13:05:15.000000000 +0800
@@ -94,6 +94,9 @@
extern int acpi_sci_override_gsi;
void acpi_pic_sci_set_trigger(unsigned int, u16);

+#define ACPI_HIBERNATION_NVS_NOSAVE 1
+extern int acpi_sleep_flags;
+
static inline void disable_acpi(void)
{
acpi_disabled = 1;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/