Source-Changes-HG archive

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

[src/trunk]: src/sys When polling, raise priority level to tty, to block keyb...



details:   https://anonhg.NetBSD.org/src/rev/e01b60988472
branches:  trunk
changeset: 510583:e01b60988472
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Jun 02 00:01:04 2001 +0000

description:
When polling, raise priority level to tty, to block keyboard interrupts
when the system is "warm", i.e. interrupts are not blocked anymore.
This seems to be necessary on my PS/2 Model 70 keyboard - without this,
system ends up in endless loop calling the keyboard intr routine if a key
is pressed when polling. This _may_ be just specific to level-triggered
interrupts PS/2 MCA uses, though it's more likely it's just the way the
particular keyboard controller works.

Discussed on tech-kern@.

diffstat:

 sys/arch/i386/isa/pccons.c |  17 ++++++++++++++++-
 sys/dev/ic/pckbc.c         |  16 +++++++++++++++-
 2 files changed, 31 insertions(+), 2 deletions(-)

diffs (61 lines):

diff -r 220607a96d55 -r e01b60988472 sys/arch/i386/isa/pccons.c
--- a/sys/arch/i386/isa/pccons.c        Fri Jun 01 23:52:14 2001 +0000
+++ b/sys/arch/i386/isa/pccons.c        Sat Jun 02 00:01:04 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pccons.c,v 1.145 2001/05/02 10:32:17 scw Exp $ */
+/*     $NetBSD: pccons.c,v 1.146 2001/06/02 00:01:04 jdolecek Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -1160,6 +1160,21 @@
 #if (NPCCONSKBD > 0)
        pckbc_set_poll(kbctag, kbcslot, on);
 #else
+
+       /*
+        * Some kbd controllers seem to not clear the interrupt condition
+        * when the status word is read, which leads to loop calling
+        * pcintr(). Thus, raise interrupt level when polling.
+        */
+       if (!cold) {
+               static int s;
+
+               if (on)
+                       s = spltty();
+               else
+                       splx(s);
+       }
+
        if (!on) {
                int unit;
                struct pc_softc *sc;
diff -r 220607a96d55 -r e01b60988472 sys/dev/ic/pckbc.c
--- a/sys/dev/ic/pckbc.c        Fri Jun 01 23:52:14 2001 +0000
+++ b/sys/dev/ic/pckbc.c        Sat Jun 02 00:01:04 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbc.c,v 1.8 2001/05/17 10:48:39 drochner Exp $ */
+/* $NetBSD: pckbc.c,v 1.9 2001/06/02 00:01:04 jdolecek Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -527,6 +527,20 @@
 
        t->t_slotdata[slot]->polling = on;
 
+       /*
+        * Some kbd controllers seem to not clear the interrupt condition
+        * when the status word is read, which leads to loop calling
+        * pckbcintr(). Thus, raise interrupt level when polling.
+        */
+       if (!cold) {
+               static int s;
+
+               if (on)
+                       s = spltty();
+               else
+                       splx(s);
+       }
+
        if (!on) {
                 int s;
 



Home | Main Index | Thread Index | Old Index