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/Osd make AcpiOsStall always delay instea...



details:   https://anonhg.NetBSD.org/src/rev/05fd8273c815
branches:  trunk
changeset: 536419:05fd8273c815
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sun Sep 15 17:04:12 2002 +0000

description:
make AcpiOsStall always delay instead of sleep.
sleeping isn't safe because sometimes it's called with interrupt-disabled.
ok'ed by thorpej.

diffstat:

 sys/dev/acpi/acpica/Osd/OsdSchedule.c |  18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diffs (40 lines):

diff -r 2d030ff775c6 -r 05fd8273c815 sys/dev/acpi/acpica/Osd/OsdSchedule.c
--- a/sys/dev/acpi/acpica/Osd/OsdSchedule.c     Sun Sep 15 16:54:26 2002 +0000
+++ b/sys/dev/acpi/acpica/Osd/OsdSchedule.c     Sun Sep 15 17:04:12 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: OsdSchedule.c,v 1.3 2002/06/15 18:02:43 thorpej Exp $  */
+/*     $NetBSD: OsdSchedule.c,v 1.4 2002/09/15 17:04:12 yamt Exp $     */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.3 2002/06/15 18:02:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.4 2002/09/15 17:04:12 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -316,10 +316,18 @@
 
        ACPI_FUNCTION_TRACE(__FUNCTION__);
 
+       /*
+        * sleep(9) isn't safe because AcpiOsStall may be called
+        * with interrupt-disabled. (eg. by AcpiEnterSleepState)
+        * we should watch out for long stall requests.
+        */
+#ifdef ACPI_DEBUG
        if (Microseconds > 1000)
-               AcpiOsSleep(0, Microseconds / 1000);
-       else
-               delay(Microseconds);
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "long stall: %uus\n",
+                   Microseconds));
+#endif
+
+       delay(Microseconds);
 
        return_VOID;
 }



Home | Main Index | Thread Index | Old Index