diff options
| author | drochner <drochner@NetBSD.org> | 2008-06-04 16:29:14 +0000 |
|---|---|---|
| committer | drochner <drochner@NetBSD.org> | 2008-06-04 16:29:14 +0000 |
| commit | 54ccefda99d156e822303de1ff44896c552a48e7 (patch) | |
| tree | 3172fd4e872efcdf259715683e2065ff263b262e /sys/dev | |
| parent | 7a34cb95f0ebb26eaea9c6a3a31150fe6c66998e (diff) | |
Reduce polling of the keyboard controller status by a factor of 1000.
While on real hardware hardware a poll cycle takes time in the
microsecond order of magnitude, a "legacy-free" system which emulates
the KBC in BIOS code takes milliseconds -- I'm seeing a multi-minute
delay in booting where the KBC is probed. So poll less and use delay()
to compensate so that the total wait time stays about the same.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ic/pckbc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c index 3a264bcffac..a015c25aa55 100644 --- a/sys/dev/ic/pckbc.c +++ b/sys/dev/ic/pckbc.c @@ -1,4 +1,4 @@ -/* $NetBSD: pckbc.c,v 1.44 2008/04/26 12:03:43 cegger Exp $ */ +/* $NetBSD: pckbc.c,v 1.45 2008/06/04 16:29:14 drochner Exp $ */ /* * Copyright (c) 2004 Ben Harris. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.44 2008/04/26 12:03:43 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.45 2008/06/04 16:29:14 drochner Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -135,7 +135,7 @@ pckbc_poll_data1(void *pt, pckbc_slot_t slot) struct pckbc_slotdata *q = t->t_slotdata[slot]; int s; u_char stat, c; - int i = 100000; /* if 1 port read takes 1us (?), this polls for 100ms */ + int i = 100; /* polls for ~100ms */ int checkaux = t->t_haveaux; s = splhigh(); @@ -148,7 +148,7 @@ pckbc_poll_data1(void *pt, pckbc_slot_t slot) goto process; } - for (; i; i--) { + for (; i; i--, delay(1000)) { stat = bus_space_read_1(t->t_iot, t->t_ioh_c, 0); if (stat & KBS_DIB) { KBD_DELAY; |
