Put a DELAY in the AT-style keyboard detection loop to wait
authorYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Sun, 22 Apr 2007 10:54:43 +0000 (10:54 +0000)
committerYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Sun, 22 Apr 2007 10:54:43 +0000 (10:54 +0000)
certain amount of time without relying on ISA bus timing.

Suggested-by: Matt
DragonFly-Bug: http://bugs.dragonflybsd.org/issue573

sys/dev/misc/atkbdc_layer/atkbdc_isa.c
sys/dev/misc/kbd/atkbdc.c

index df76e8b..1456833 100644 (file)
@@ -24,7 +24,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/isa/atkbdc_isa.c,v 1.14.2.1 2000/03/31 12:52:05 yokota Exp $
- * $DragonFly: src/sys/dev/misc/atkbdc_layer/atkbdc_isa.c,v 1.8 2007/04/22 10:43:00 y0netan1 Exp $
+ * $DragonFly: src/sys/dev/misc/atkbdc_layer/atkbdc_isa.c,v 1.9 2007/04/22 10:54:42 y0netan1 Exp $
  */
 
 #include "opt_kbd.h"
@@ -145,6 +145,7 @@ atkbdc_probe(device_t dev)
        for (i = 65536; i != 0; --i) {
                if ((bus_space_read_1(tag, ioh1, 0) & 0x2) == 0)
                        break;
+               DELAY(16);
        }
        if (i == 0) {
                bus_release_resource(dev, SYS_RES_IOPORT, 0, port0);
index c3e579e..48e2da0 100644 (file)
@@ -28,7 +28,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/kbd/atkbdc.c,v 1.5.2.2 2002/03/31 11:02:02 murray Exp $
- * $DragonFly: src/sys/dev/misc/kbd/atkbdc.c,v 1.10 2007/04/22 10:43:00 y0netan1 Exp $
+ * $DragonFly: src/sys/dev/misc/kbd/atkbdc.c,v 1.11 2007/04/22 10:54:43 y0netan1 Exp $
  * from kbdio.c,v 1.13 1998/09/25 11:55:46 yokota Exp
  */
 
@@ -179,6 +179,7 @@ atkbdc_configure(void)
        for (i = 65536; i != 0; --i) {
                if ((bus_space_read_1(tag, h1, 0) & 0x2) == 0)
                        break;
+               DELAY(16);
        }
        if (i == 0)
                 return ENXIO;