Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105367
b: refs/heads/master
c: bdfe6b7
h: refs/heads/master
i:
  105365: 09d63f2
  105363: b61c3af
  105359: bcfc075
v: v3
  • Loading branch information
Shaohua Li authored and Linus Torvalds committed Jul 24, 2008
1 parent faacac1 commit cbbdb0d
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f15fc4bdf91eb399da3f47a09c55831d9f22826
refs/heads/master: bdfe6b7c681669148dae4db27eb24ee5408ba371
4 changes: 3 additions & 1 deletion trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ and is between 256 and 4096 characters. It is defined in the file
default: 0

acpi_sleep= [HW,ACPI] Sleep options
Format: { s3_bios, s3_mode, s3_beep, old_ordering }
Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig, old_ordering }
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.
s4_nohwsig prevents ACPI hardware signature from being
used during resume from hibernation.
old_ordering causes the ACPI 1.0 ordering of the _PTS
control method, wrt putting devices into low power
states, to be enforced (the ACPI 2.0 ordering of _PTS is
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/x86/kernel/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ static int __init acpi_sleep_setup(char *str)
acpi_realmode_flags |= 2;
if (strncmp(str, "s3_beep", 7) == 0)
acpi_realmode_flags |= 4;
#ifdef CONFIG_HIBERNATION
if (strncmp(str, "s4_nohwsig", 10) == 0)
acpi_no_s4_hw_signature();
#endif
if (strncmp(str, "old_ordering", 12) == 0)
acpi_old_suspend_ordering();
str = strchr(str, ',');
Expand Down
22 changes: 22 additions & 0 deletions trunk/drivers/acpi/sleep/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,15 @@ static struct platform_suspend_ops acpi_suspend_ops_old = {
#endif /* CONFIG_SUSPEND */

#ifdef CONFIG_HIBERNATION
static unsigned long s4_hardware_signature;
static struct acpi_table_facs *facs;
static bool nosigcheck;

void __init acpi_no_s4_hw_signature(void)
{
nosigcheck = true;
}

static int acpi_hibernation_begin(void)
{
acpi_target_sleep_state = ACPI_STATE_S4;
Expand Down Expand Up @@ -316,6 +325,12 @@ static void acpi_hibernation_leave(void)
acpi_enable();
/* Reprogram control registers and execute _BFS */
acpi_leave_sleep_state_prep(ACPI_STATE_S4);
/* Check the hardware signature */
if (facs && s4_hardware_signature != facs->hardware_signature) {
printk(KERN_EMERG "ACPI: Hardware changed while hibernated, "
"cannot resume!\n");
panic("ACPI S4 hardware signature mismatch");
}
}

static void acpi_pm_enable_gpes(void)
Expand Down Expand Up @@ -544,6 +559,13 @@ int __init acpi_sleep_init(void)
&acpi_hibernation_ops_old : &acpi_hibernation_ops);
sleep_states[ACPI_STATE_S4] = 1;
printk(" S4");
if (!nosigcheck) {
acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS,
(struct acpi_table_header **)&facs);
if (facs)
s4_hardware_signature =
facs->hardware_signature;
}
}
#endif
status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n,
const char *name);

#ifdef CONFIG_PM_SLEEP
void __init acpi_no_s4_hw_signature(void);
void __init acpi_old_suspend_ordering(void);
#endif /* CONFIG_PM_SLEEP */
#else /* CONFIG_ACPI */
Expand Down

0 comments on commit cbbdb0d

Please sign in to comment.