Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic pckbc(4): Stop waiting 8us before reading each da...



details:   https://anonhg.NetBSD.org/src/rev/1af456b49ac4
branches:  trunk
changeset: 372363:1af456b49ac4
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Nov 17 23:57:20 2022 +0000

description:
pckbc(4): Stop waiting 8us before reading each data byte.

This appears to have copied from pccons(4), where it was introduced
by mycroft@ in 1994 in sys/arch/i386/isa/pccons.c rev. 1.63 with the
commit message `Rename two files.'.  No justification was given.

This delay was in a hard interrupt handler, and an MP-unsafe one to
boot, so it could hold up system responsiveness by delaying interrupt
handling and blocking other users of the legacy kernel lock.

The delay remains in the pckbc_wait_output loop to set a command
byte, which is not used in the interrupt path (and I suspect is used
only on boot during attach anyway).

diffstat:

 sys/dev/ic/pckbc.c |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (47 lines):

diff -r 3b421e60eb21 -r 1af456b49ac4 sys/dev/ic/pckbc.c
--- a/sys/dev/ic/pckbc.c        Thu Nov 17 23:54:44 2022 +0000
+++ b/sys/dev/ic/pckbc.c        Thu Nov 17 23:57:20 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbc.c,v 1.64 2022/10/28 23:44:38 riastradh Exp $ */
+/* $NetBSD: pckbc.c,v 1.65 2022/11/17 23:57:20 riastradh Exp $ */
 
 /*
  * Copyright (c) 2004 Ben Harris.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.64 2022/10/28 23:44:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbc.c,v 1.65 2022/11/17 23:57:20 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -146,7 +146,6 @@
        for (; i; i--, delay(1000)) {
                stat = bus_space_read_1(t->t_iot, t->t_ioh_c, 0);
                if (stat & KBS_DIB) {
-                       KBD_DELAY;
                        c = bus_space_read_1(t->t_iot, t->t_ioh_d, 0);
 
                    process:
@@ -512,12 +511,10 @@
                if (!q) {
                        /* XXX do something for live insertion? */
                        printf("pckbc: no dev for slot %d\n", slot);
-                       KBD_DELAY;
                        (void) bus_space_read_1(t->t_iot, t->t_ioh_d, 0);
                        continue;
                }
 
-               KBD_DELAY;
                data = bus_space_read_1(t->t_iot, t->t_ioh_d, 0);
 
                rnd_add_uint32(&q->rnd_source, (stat<<8)|data);
@@ -600,7 +597,6 @@
                        return 0;
 
                served = 1;
-               KBD_DELAY;
                data = bus_space_read_1(t->t_iot, t->t_ioh_d, 0);
 
                if (q != NULL)



Home | Main Index | Thread Index | Old Index