summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/hwsleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/hwsleep.c')
-rw-r--r--sys/contrib/dev/acpica/hwsleep.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/contrib/dev/acpica/hwsleep.c b/sys/contrib/dev/acpica/hwsleep.c
index 50b0fa9..47c5155 100644
--- a/sys/contrib/dev/acpica/hwsleep.c
+++ b/sys/contrib/dev/acpica/hwsleep.c
@@ -288,6 +288,7 @@ AcpiEnterSleepState (
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo;
UINT32 InValue;
+ UINT32 Retry;
ACPI_STATUS Status;
@@ -410,6 +411,7 @@ AcpiEnterSleepState (
/* Wait until we enter sleep state */
+ Retry = 1000;
do
{
Status = AcpiGetRegister (ACPI_BITREG_WAKE_STATUS, &InValue, ACPI_MTX_DO_NOT_LOCK);
@@ -418,6 +420,15 @@ AcpiEnterSleepState (
return_ACPI_STATUS (Status);
}
+ /*
+ * Some BIOSes don't set WAK_STS at all,
+ * give up waiting for wakeup if we time out.
+ */
+ if (Retry-- == 0)
+ {
+ break; /* giving up */
+ }
+
/* Spin until we wake */
} while (!InValue);
OpenPOWER on IntegriCloud