diff options
| author | kochi <kochi@NetBSD.org> | 2003-12-21 07:51:18 +0000 |
|---|---|---|
| committer | kochi <kochi@NetBSD.org> | 2003-12-21 07:51:18 +0000 |
| commit | 2bd0af644b5c13f192fd5136a2417587de97b60c (patch) | |
| tree | be42e2f1cf735332227165d7a26f28e4e41882db /sys/dev | |
| parent | d4eea31ad8def6242d9875997a5139e2d0b84745 (diff) | |
Give up unresponding hardware when entering sleep state.
from FreeBSD's local changes.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/acpi/acpica/Subsystem/hwsleep.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpica/Subsystem/hwsleep.c b/sys/dev/acpi/acpica/Subsystem/hwsleep.c index 2dd9f564a2e..08a9420888f 100644 --- a/sys/dev/acpi/acpica/Subsystem/hwsleep.c +++ b/sys/dev/acpi/acpica/Subsystem/hwsleep.c @@ -116,7 +116,7 @@ *****************************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hwsleep.c,v 1.9 2003/12/13 18:11:01 kochi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hwsleep.c,v 1.10 2003/12/21 07:51:18 kochi Exp $"); #include "acpi.h" @@ -299,6 +299,7 @@ AcpiEnterSleepState ( ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo; ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo; UINT32 InValue; + UINT32 Retry; ACPI_STATUS Status; @@ -425,6 +426,7 @@ AcpiEnterSleepState ( /* Wait until we enter sleep state */ + Retry = 1000; do { Status = AcpiGetRegister (ACPI_BITREG_WAKE_STATUS, &InValue, ACPI_MTX_DO_NOT_LOCK); @@ -433,6 +435,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); |
