summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 137a477..6066752 100644
--- a/sys/contrib/dev/acpica/hwsleep.c
+++ b/sys/contrib/dev/acpica/hwsleep.c
@@ -296,6 +296,7 @@ AcpiEnterSleepState (
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo;
UINT32 InValue;
+ UINT32 Retry;
ACPI_STATUS Status;
@@ -422,6 +423,7 @@ AcpiEnterSleepState (
/* Wait until we enter sleep state */
+ Retry = 1000;
do
{
Status = AcpiGetRegister (ACPI_BITREG_WAKE_STATUS, &InValue, ACPI_MTX_DO_NOT_LOCK);
@@ -430,6 +432,15 @@ AcpiEnterSleepState (
return_ACPI_STATUS (Status);
}
+ /*
+ * Some BIOSs don't set WAK_STS at all. Give up waiting after
+ * 1000 retries if it still isn't set.
+ */
+ if (Retry-- == 0)
+ {
+ break;
+ }
+
/* Spin until we wake */
} while (!InValue);
OpenPOWER on IntegriCloud