diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/sleep/main.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 0489a7d1d42c..313507accf18 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -283,6 +283,15 @@ static struct platform_suspend_ops acpi_suspend_ops_old = { | |||
283 | #endif /* CONFIG_SUSPEND */ | 283 | #endif /* CONFIG_SUSPEND */ |
284 | 284 | ||
285 | #ifdef CONFIG_HIBERNATION | 285 | #ifdef CONFIG_HIBERNATION |
286 | static unsigned long s4_hardware_signature; | ||
287 | static struct acpi_table_facs *facs; | ||
288 | static bool nosigcheck; | ||
289 | |||
290 | void __init acpi_no_s4_hw_signature(void) | ||
291 | { | ||
292 | nosigcheck = true; | ||
293 | } | ||
294 | |||
286 | static int acpi_hibernation_begin(void) | 295 | static int acpi_hibernation_begin(void) |
287 | { | 296 | { |
288 | acpi_target_sleep_state = ACPI_STATE_S4; | 297 | acpi_target_sleep_state = ACPI_STATE_S4; |
@@ -316,6 +325,12 @@ static void acpi_hibernation_leave(void) | |||
316 | acpi_enable(); | 325 | acpi_enable(); |
317 | /* Reprogram control registers and execute _BFS */ | 326 | /* Reprogram control registers and execute _BFS */ |
318 | acpi_leave_sleep_state_prep(ACPI_STATE_S4); | 327 | acpi_leave_sleep_state_prep(ACPI_STATE_S4); |
328 | /* Check the hardware signature */ | ||
329 | if (facs && s4_hardware_signature != facs->hardware_signature) { | ||
330 | printk(KERN_EMERG "ACPI: Hardware changed while hibernated, " | ||
331 | "cannot resume!\n"); | ||
332 | panic("ACPI S4 hardware signature mismatch"); | ||
333 | } | ||
319 | } | 334 | } |
320 | 335 | ||
321 | static void acpi_pm_enable_gpes(void) | 336 | static void acpi_pm_enable_gpes(void) |
@@ -544,6 +559,13 @@ int __init acpi_sleep_init(void) | |||
544 | &acpi_hibernation_ops_old : &acpi_hibernation_ops); | 559 | &acpi_hibernation_ops_old : &acpi_hibernation_ops); |
545 | sleep_states[ACPI_STATE_S4] = 1; | 560 | sleep_states[ACPI_STATE_S4] = 1; |
546 | printk(" S4"); | 561 | printk(" S4"); |
562 | if (!nosigcheck) { | ||
563 | acpi_get_table_by_index(ACPI_TABLE_INDEX_FACS, | ||
564 | (struct acpi_table_header **)&facs); | ||
565 | if (facs) | ||
566 | s4_hardware_signature = | ||
567 | facs->hardware_signature; | ||
568 | } | ||
547 | } | 569 | } |
548 | #endif | 570 | #endif |
549 | status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b); | 571 | status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b); |