Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi/acpica/Subsystem Give up unresponding hardware ...



details:   https://anonhg.NetBSD.org/src/rev/3243726051c2
branches:  trunk
changeset: 556583:3243726051c2
user:      kochi <kochi%NetBSD.org@localhost>
date:      Sun Dec 21 07:51:18 2003 +0000

description:
Give up unresponding hardware when entering sleep state.
from FreeBSD's local changes.

diffstat:

 sys/dev/acpi/acpica/Subsystem/hwsleep.c |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r 68d9370b5e7a -r 3243726051c2 sys/dev/acpi/acpica/Subsystem/hwsleep.c
--- a/sys/dev/acpi/acpica/Subsystem/hwsleep.c   Sun Dec 21 07:50:26 2003 +0000
+++ b/sys/dev/acpi/acpica/Subsystem/hwsleep.c   Sun Dec 21 07:51:18 2003 +0000
@@ -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 @@
     ACPI_BIT_REGISTER_INFO  *SleepTypeRegInfo;
     ACPI_BIT_REGISTER_INFO  *SleepEnableRegInfo;
     UINT32                  InValue;
+    UINT32                  Retry;
     ACPI_STATUS             Status;
 
 
@@ -425,6 +426,7 @@
 
     /* 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 @@
             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);



Home | Main Index | Thread Index | Old Index