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 Print a warning if AcpiOsSleep() is call...



details:   https://anonhg.NetBSD.org/src/rev/eb71e0a3eca2
branches:  trunk
changeset: 754785:eb71e0a3eca2
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Wed May 12 17:03:11 2010 +0000

description:
Print a warning if AcpiOsSleep() is called with a value larger than two
seconds. It is known that there are systems in the field that pass bogus AML
values to the Sleep() operation code, possibly requesting delays that could
be measured in days.

Discussed with jmcneill@.

XXX: While the used mstohz(9) is documented to round to one second if the
     passed value is larger than 131072 ms, we may still need to force a
     sensible upper limit if this warning starts to appear.

diffstat:

 sys/dev/acpi/acpica/OsdSchedule.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 06410fdddcc8 -r eb71e0a3eca2 sys/dev/acpi/acpica/OsdSchedule.c
--- a/sys/dev/acpi/acpica/OsdSchedule.c Wed May 12 16:48:21 2010 +0000
+++ b/sys/dev/acpi/acpica/OsdSchedule.c Wed May 12 17:03:11 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: OsdSchedule.c,v 1.12 2009/08/23 15:16:16 jmcneill Exp $        */
+/*     $NetBSD: OsdSchedule.c,v 1.13 2010/05/12 17:03:11 jruoho Exp $  */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.12 2009/08/23 15:16:16 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdSchedule.c,v 1.13 2010/05/12 17:03:11 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -140,6 +140,13 @@
 void
 AcpiOsSleep(ACPI_INTEGER Milliseconds)
 {
+       static bool once = false;
+
+       if (Milliseconds > 2000 && once != true) {
+               aprint_error("acpi0: WARNING: long Sleep()\n");
+               once = true;
+       }
+
        if (cold || doing_shutdown || acpi_suspended)
                DELAY(Milliseconds * 1000);
        else {



Home | Main Index | Thread Index | Old Index