diff options
Diffstat (limited to 'drivers/acpi/hardware/hwsleep.c')
-rw-r--r-- | drivers/acpi/hardware/hwsleep.c | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index dba3cfbe8cba..25dccdf179b9 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c | |||
@@ -78,19 +78,17 @@ acpi_set_firmware_waking_vector(acpi_physical_address physical_address) | |||
78 | return_ACPI_STATUS(status); | 78 | return_ACPI_STATUS(status); |
79 | } | 79 | } |
80 | 80 | ||
81 | /* Set the vector */ | 81 | /* |
82 | * According to the ACPI specification 2.0c and later, the 64-bit | ||
83 | * waking vector should be cleared and the 32-bit waking vector should | ||
84 | * be used, unless we want the wake-up code to be called by the BIOS in | ||
85 | * Protected Mode. Some systems (for example HP dv5-1004nr) are known | ||
86 | * to fail to resume if the 64-bit vector is used. | ||
87 | */ | ||
88 | if (facs->version >= 1) | ||
89 | facs->xfirmware_waking_vector = 0; | ||
82 | 90 | ||
83 | if ((facs->length < 32) || (!(facs->xfirmware_waking_vector))) { | 91 | facs->firmware_waking_vector = (u32)physical_address; |
84 | /* | ||
85 | * ACPI 1.0 FACS or short table or optional X_ field is zero | ||
86 | */ | ||
87 | facs->firmware_waking_vector = (u32) physical_address; | ||
88 | } else { | ||
89 | /* | ||
90 | * ACPI 2.0 FACS with valid X_ field | ||
91 | */ | ||
92 | facs->xfirmware_waking_vector = physical_address; | ||
93 | } | ||
94 | 92 | ||
95 | return_ACPI_STATUS(AE_OK); | 93 | return_ACPI_STATUS(AE_OK); |
96 | } | 94 | } |
@@ -134,20 +132,7 @@ acpi_get_firmware_waking_vector(acpi_physical_address * physical_address) | |||
134 | } | 132 | } |
135 | 133 | ||
136 | /* Get the vector */ | 134 | /* Get the vector */ |
137 | 135 | *physical_address = (acpi_physical_address)facs->firmware_waking_vector; | |
138 | if ((facs->length < 32) || (!(facs->xfirmware_waking_vector))) { | ||
139 | /* | ||
140 | * ACPI 1.0 FACS or short table or optional X_ field is zero | ||
141 | */ | ||
142 | *physical_address = | ||
143 | (acpi_physical_address) facs->firmware_waking_vector; | ||
144 | } else { | ||
145 | /* | ||
146 | * ACPI 2.0 FACS with valid X_ field | ||
147 | */ | ||
148 | *physical_address = | ||
149 | (acpi_physical_address) facs->xfirmware_waking_vector; | ||
150 | } | ||
151 | 136 | ||
152 | return_ACPI_STATUS(AE_OK); | 137 | return_ACPI_STATUS(AE_OK); |
153 | } | 138 | } |
@@ -627,6 +612,13 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) | |||
627 | } | 612 | } |
628 | /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */ | 613 | /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */ |
629 | 614 | ||
615 | /* | ||
616 | * Some BIOSes assume that WAK_STS will be cleared on resume and use | ||
617 | * it to determine whether the system is rebooting or resuming. Clear | ||
618 | * it for compatibility. | ||
619 | */ | ||
620 | acpi_set_register(ACPI_BITREG_WAKE_STATUS, 1); | ||
621 | |||
630 | acpi_gbl_system_awake_and_running = TRUE; | 622 | acpi_gbl_system_awake_and_running = TRUE; |
631 | 623 | ||
632 | /* Enable power button */ | 624 | /* Enable power button */ |