1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-23 16:01:42 +00:00

Local change: In the resume path, give up after waiting for a while

for WAK_STS to be set.  Some BIOSs never set it.
This commit is contained in:
Nate Lawson 2003-12-09 02:57:46 +00:00
parent 7fc6af078c
commit 3a3f40629a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=123323

View File

@ -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);