aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r--drivers/acpi/sleep.c69
1 files changed, 43 insertions, 26 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 7e3c609cbef2..00456fccfa38 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -90,31 +90,6 @@ void __init acpi_old_suspend_ordering(void)
90 old_suspend_ordering = true; 90 old_suspend_ordering = true;
91} 91}
92 92
93/*
94 * According to the ACPI specification the BIOS should make sure that ACPI is
95 * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still,
96 * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI
97 * on such systems during resume. Unfortunately that doesn't help in
98 * particularly pathological cases in which SCI_EN has to be set directly on
99 * resume, although the specification states very clearly that this flag is
100 * owned by the hardware. The set_sci_en_on_resume variable will be set in such
101 * cases.
102 */
103static bool set_sci_en_on_resume;
104/*
105 * The ACPI specification wants us to save NVS memory regions during hibernation
106 * and to restore them during the subsequent resume. However, it is not certain
107 * if this mechanism is going to work on all machines, so we allow the user to
108 * disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line
109 * option.
110 */
111static bool s4_no_nvs;
112
113void __init acpi_s4_no_nvs(void)
114{
115 s4_no_nvs = true;
116}
117
118/** 93/**
119 * acpi_pm_disable_gpes - Disable the GPEs. 94 * acpi_pm_disable_gpes - Disable the GPEs.
120 */ 95 */
@@ -193,6 +168,18 @@ static void acpi_pm_end(void)
193#endif /* CONFIG_ACPI_SLEEP */ 168#endif /* CONFIG_ACPI_SLEEP */
194 169
195#ifdef CONFIG_SUSPEND 170#ifdef CONFIG_SUSPEND
171/*
172 * According to the ACPI specification the BIOS should make sure that ACPI is
173 * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still,
174 * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI
175 * on such systems during resume. Unfortunately that doesn't help in
176 * particularly pathological cases in which SCI_EN has to be set directly on
177 * resume, although the specification states very clearly that this flag is
178 * owned by the hardware. The set_sci_en_on_resume variable will be set in such
179 * cases.
180 */
181static bool set_sci_en_on_resume;
182
196extern void do_suspend_lowlevel(void); 183extern void do_suspend_lowlevel(void);
197 184
198static u32 acpi_suspend_states[] = { 185static u32 acpi_suspend_states[] = {
@@ -391,11 +378,41 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
391 DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"), 378 DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
392 }, 379 },
393 }, 380 },
381 {
382 .callback = init_old_suspend_ordering,
383 .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)",
384 .matches = {
385 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."),
386 DMI_MATCH(DMI_BOARD_NAME, "M2N8L"),
387 },
388 },
389 {
390 .callback = init_set_sci_en_on_resume,
391 .ident = "Toshiba Satellite L300",
392 .matches = {
393 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
394 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L300"),
395 },
396 },
394 {}, 397 {},
395}; 398};
396#endif /* CONFIG_SUSPEND */ 399#endif /* CONFIG_SUSPEND */
397 400
398#ifdef CONFIG_HIBERNATION 401#ifdef CONFIG_HIBERNATION
402/*
403 * The ACPI specification wants us to save NVS memory regions during hibernation
404 * and to restore them during the subsequent resume. However, it is not certain
405 * if this mechanism is going to work on all machines, so we allow the user to
406 * disable this mechanism using the 'acpi_sleep=s4_nonvs' kernel command line
407 * option.
408 */
409static bool s4_no_nvs;
410
411void __init acpi_s4_no_nvs(void)
412{
413 s4_no_nvs = true;
414}
415
399static unsigned long s4_hardware_signature; 416static unsigned long s4_hardware_signature;
400static struct acpi_table_facs *facs; 417static struct acpi_table_facs *facs;
401static bool nosigcheck; 418static bool nosigcheck;
@@ -679,7 +696,7 @@ static void acpi_power_off_prepare(void)
679static void acpi_power_off(void) 696static void acpi_power_off(void)
680{ 697{
681 /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */ 698 /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
682 printk("%s called\n", __func__); 699 printk(KERN_DEBUG "%s called\n", __func__);
683 local_irq_disable(); 700 local_irq_disable();
684 acpi_enable_wakeup_device(ACPI_STATE_S5); 701 acpi_enable_wakeup_device(ACPI_STATE_S5);
685 acpi_enter_sleep_state(ACPI_STATE_S5); 702 acpi_enter_sleep_state(ACPI_STATE_S5);