diff options
| author | jruoho <jruoho@NetBSD.org> | 2010-05-12 17:03:11 +0000 |
|---|---|---|
| committer | jruoho <jruoho@NetBSD.org> | 2010-05-12 17:03:11 +0000 |
| commit | 2731b5ff2ff83dcb67fa1dadef509cabce73d8e0 (patch) | |
| tree | 064eba385a9fb08942c57e5635cf60e6edaa3a32 /sys/dev | |
| parent | dc34f0702264bf4c61c81d87adbc6227359feac1 (diff) | |
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 (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/acpi/acpica/OsdSchedule.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpica/OsdSchedule.c b/sys/dev/acpi/acpica/OsdSchedule.c index 2b212bb6ac6..6b90a14c702 100644 --- a/sys/dev/acpi/acpica/OsdSchedule.c +++ b/sys/dev/acpi/acpica/OsdSchedule.c @@ -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 @@ AcpiOsExecute(ACPI_EXECUTE_TYPE Type, ACPI_OSD_EXEC_CALLBACK Function, 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 { |
