diff options
Diffstat (limited to 'sys/contrib')
-rw-r--r-- | sys/contrib/dev/acpica/hwsleep.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/contrib/dev/acpica/hwsleep.c b/sys/contrib/dev/acpica/hwsleep.c index 7cbb6c8..29336b2 100644 --- a/sys/contrib/dev/acpica/hwsleep.c +++ b/sys/contrib/dev/acpica/hwsleep.c @@ -237,6 +237,7 @@ AcpiEnterSleepState ( UINT8 TypeB; UINT16 PM1AControl; UINT16 PM1BControl; + UINT32 Retry; FUNCTION_TRACE ("AcpiEnterSleepState"); @@ -318,9 +319,16 @@ AcpiEnterSleepState ( /* wait until we enter sleep state */ + Retry = 1000; do { - AcpiOsStall(10000); + /* + * Some BIOSes don't set WAK_STS at all, + * give up waiting for wakeup if we time out. + */ + if (Retry-- == 0) { + break; /* giving up */ + } } while (!AcpiHwRegisterBitAccess (ACPI_READ, ACPI_MTX_LOCK, WAK_STS)); |