diff options
author | njl <njl@FreeBSD.org> | 2005-12-06 14:47:28 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2005-12-06 14:47:28 +0000 |
commit | e5d54d616d4c7600d49de187fc0d990336730ad3 (patch) | |
tree | 598e49dfcdcdc91f6c48eab9ae6ad0e9513c28a8 /sys/dev/acpica | |
parent | 615d32b5e43b8dbf116e66bb3e9fe471c52ec082 (diff) | |
download | FreeBSD-src-e5d54d616d4c7600d49de187fc0d990336730ad3.zip FreeBSD-src-e5d54d616d4c7600d49de187fc0d990336730ad3.tar.gz |
Add KTR support and move some performance debugging variables in the EC
to KTR. We're reusing the KTR_DEV level.
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r-- | sys/dev/acpica/acpi_ec.c | 17 | ||||
-rw-r--r-- | sys/dev/acpica/acpivar.h | 6 |
2 files changed, 13 insertions, 10 deletions
diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c index 9fbb4ab..fe5fed7 100644 --- a/sys/dev/acpica/acpi_ec.c +++ b/sys/dev/acpica/acpi_ec.c @@ -706,6 +706,7 @@ EcGpeQueryHandler(void *Context) */ EcStatus = EC_GET_CSR(sc); if ((EcStatus & EC_EVENT_SCI) == 0) { + CTR1(KTR_ACPI, "ec event was not SCI, status %#x", EcStatus); sc->ec_csrvalue = EcStatus; wakeup(&sc->ec_csrvalue); EcUnlock(sc); @@ -728,6 +729,7 @@ EcGpeQueryHandler(void *Context) EcUnlock(sc); /* Ignore the value for "no outstanding event". (13.3.5) */ + CTR2(KTR_ACPI, "ec query ok,%s running _Q%02x", Data ? "" : " not", Data); if (Data == 0) goto re_enable; @@ -858,7 +860,6 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event) EC_STATUS EcStatus; ACPI_STATUS Status; int count, i, period, retval, slp_ival; - static int EcDbgMaxDelay; ACPI_SERIAL_ASSERT(ec); Status = AE_NO_HARDWARE_RESPONSE; @@ -909,18 +910,14 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event) if (!cold) retval = tsleep(&sc->ec_csrvalue, PZERO, "ecpoll", slp_ival); else - AcpiOsStall(10000); + AcpiOsStall(hz * 1000); // XXX too big } } - /* Calculate new delay and print it if it exceeds the max. */ + /* Calculate new delay and log it. */ if (slp_ival > 0) - period += i * 10000; - if (period > EcDbgMaxDelay) { - EcDbgMaxDelay = period; - ACPI_VPRINT(sc->ec_dev, acpi_device_get_parent_softc(sc->ec_dev), - "info: new max delay is %d us\n", period); - } + period += i * (hz * 1000); + CTR2(KTR_ACPI, "ec got event %#x after %d us", EcStatus, period); return (Status); } @@ -967,6 +964,7 @@ EcRead(struct acpi_ec_softc *sc, UINT8 Address, UINT8 *Data) ACPI_STATUS Status; ACPI_SERIAL_ASSERT(ec); + CTR1(KTR_ACPI, "ec read from %#x", Address); #ifdef notyet /* If we can't start burst mode, continue anyway. */ @@ -1004,6 +1002,7 @@ EcWrite(struct acpi_ec_softc *sc, UINT8 Address, UINT8 *Data) ACPI_STATUS Status; ACPI_SERIAL_ASSERT(ec); + CTR2(KTR_ACPI, "ec write to %#x, data %#x", Address, *Data); #ifdef notyet /* If we can't start burst mode, continue anyway. */ diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index eae6a40..69f3403 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -36,10 +36,11 @@ #include "acpi_if.h" #include "bus_if.h" #include <sys/eventhandler.h> -#include <sys/sysctl.h> +#include <sys/ktr.h> #include <sys/lock.h> #include <sys/mutex.h> #include <sys/sx.h> +#include <sys/sysctl.h> #include <machine/bus.h> #include <machine/resource.h> @@ -422,5 +423,8 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDLE scope, ACPI_OBJECT *obj); /* Default number of task queue threads to start. */ #define ACPI_MAX_THREADS 3 +/* Use the device logging level for ktr(4). */ +#define KTR_ACPI KTR_DEV + #endif /* _KERNEL */ #endif /* !_ACPIVAR_H_ */ |