diff options
author | njl <njl@FreeBSD.org> | 2003-12-09 02:57:46 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2003-12-09 02:57:46 +0000 |
commit | 2ac2126b9f862458bf24ae1aa7d288b9e353712d (patch) | |
tree | cfaeb82faf192ca59b5ed84541b9be31a493dc86 | |
parent | 91700601792d1b86bfec0b47cbfac99a1bfc8353 (diff) | |
download | FreeBSD-src-2ac2126b9f862458bf24ae1aa7d288b9e353712d.zip FreeBSD-src-2ac2126b9f862458bf24ae1aa7d288b9e353712d.tar.gz |
Local change: In the resume path, give up after waiting for a while
for WAK_STS to be set. Some BIOSs never set it.
-rw-r--r-- | sys/contrib/dev/acpica/hwsleep.c | 11 |
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); |