summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2003-12-09 02:57:46 +0000
committernjl <njl@FreeBSD.org>2003-12-09 02:57:46 +0000
commit2ac2126b9f862458bf24ae1aa7d288b9e353712d (patch)
treecfaeb82faf192ca59b5ed84541b9be31a493dc86 /sys/contrib
parent91700601792d1b86bfec0b47cbfac99a1bfc8353 (diff)
downloadFreeBSD-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.
Diffstat (limited to 'sys/contrib')
-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