summaryrefslogtreecommitdiffstats
path: root/sys/dev/atkbdc/atkbdc_ebus.c
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2010-04-29 06:16:00 +0000
committersobomax <sobomax@FreeBSD.org>2010-04-29 06:16:00 +0000
commit06a2ddb54d82ea81b21f69d0d0944d15949d6be3 (patch)
tree583264584a4cf4664197248680ba013d4951e4f0 /sys/dev/atkbdc/atkbdc_ebus.c
parenta101ef6559ba33feff4e60757b06a186082bc97d (diff)
downloadFreeBSD-src-06a2ddb54d82ea81b21f69d0d0944d15949d6be3.zip
FreeBSD-src-06a2ddb54d82ea81b21f69d0d0944d15949d6be3.tar.gz
On certain chipsets AT keyboard controller isn't present and is
emulated by BIOS using SMI interrupt. On those chipsets reading from the status port may be thousand times slower than usually. Sometimes this emilation is not working properly resulting in commands timing out and since we assume that inb() operation takes very little time to complete we need to adjust number of retries to keep waiting time within a designed limits (100ms). Measure time it takes to make read_status() call and adjust number of retries accordingly. To keep it simple, use TSC to measure inb() performance and keep it to amd64-only, since TSC may not available on older CPUs. Also enable detection of the AT controller absence on amd64. Reviewed by: jhb MFC after: 1 month
Diffstat (limited to 'sys/dev/atkbdc/atkbdc_ebus.c')
-rw-r--r--sys/dev/atkbdc/atkbdc_ebus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/atkbdc/atkbdc_ebus.c b/sys/dev/atkbdc/atkbdc_ebus.c
index 639203d..0dcb0a7 100644
--- a/sys/dev/atkbdc/atkbdc_ebus.c
+++ b/sys/dev/atkbdc/atkbdc_ebus.c
@@ -202,6 +202,7 @@ atkbdc_ebus_attach(device_t dev)
"cannot determine command/data port resource\n");
return (ENXIO);
}
+ sc->retry = 5000;
sc->port0 = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, start, start,
1, RF_ACTIVE);
if (sc->port0 == NULL) {
OpenPOWER on IntegriCloud