|
@@ -283,6 +283,15 @@ static struct platform_suspend_ops acpi_suspend_ops_old = {
|
|
#endif /* CONFIG_SUSPEND */
|
|
#endif /* CONFIG_SUSPEND */
|
|
|
|
|
|
#ifdef CONFIG_HIBERNATION
|
|
#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)
|
|
static int acpi_hibernation_begin(void)
|
|
{
|
|
{
|
|
acpi_target_sleep_state = ACPI_STATE_S4;
|
|
acpi_target_sleep_state = ACPI_STATE_S4;
|
|
@@ -316,6 +325,12 @@ static void acpi_hibernation_leave(void)
|
|
acpi_enable();
|
|
acpi_enable();
|
|
/* Reprogram control registers and execute _BFS */
|
|
/* Reprogram control registers and execute _BFS */
|
|
acpi_leave_sleep_state_prep(ACPI_STATE_S4);
|
|
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)
|
|
static void acpi_pm_enable_gpes(void)
|
|
@@ -544,6 +559,13 @@ int __init acpi_sleep_init(void)
|
|
&acpi_hibernation_ops_old : &acpi_hibernation_ops);
|
|
&acpi_hibernation_ops_old : &acpi_hibernation_ops);
|
|
sleep_states[ACPI_STATE_S4] = 1;
|
|
sleep_states[ACPI_STATE_S4] = 1;
|
|
printk(" S4");
|
|
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
|
|
#endif
|
|
status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b);
|
|
status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b);
|