Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pckbc pckbd_enable is called during autoconfig. Usin...



details:   https://anonhg.NetBSD.org/src/rev/8fa02a64ebb0
branches:  trunk
changeset: 519019:8fa02a64ebb0
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Sun Dec 09 13:42:01 2001 +0000

description:
pckbd_enable is called during autoconfig. Using pckbc_enqueue_cmd at
that time will have bad results, such as queue corruption because
of multiple TAILQ_INSERTs, etc, because it's not designed to work
in an interrupt/context-free environment. Use pckbc_poll_cmd instead.

diffstat:

 sys/dev/pckbc/pckbd.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 0f8df9c16c85 -r 8fa02a64ebb0 sys/dev/pckbc/pckbd.c
--- a/sys/dev/pckbc/pckbd.c     Sun Dec 09 12:03:32 2001 +0000
+++ b/sys/dev/pckbc/pckbd.c     Sun Dec 09 13:42:01 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbd.c,v 1.28 2001/11/13 17:45:07 augustss Exp $ */
+/* $NetBSD: pckbd.c,v 1.29 2001/12/09 13:42:01 fvdl Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pckbd.c,v 1.28 2001/11/13 17:45:07 augustss Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pckbd.c,v 1.29 2001/12/09 13:42:01 fvdl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -383,8 +383,8 @@
                pckbc_slot_enable(sc->id->t_kbctag, sc->id->t_kbcslot, 1);
 
                cmd[0] = KBC_ENABLE;
-               res = pckbc_enqueue_cmd(sc->id->t_kbctag, sc->id->t_kbcslot,
-                                       cmd, 1, 0, 1, 0);
+               res = pckbc_poll_cmd(sc->id->t_kbctag, sc->id->t_kbcslot,
+                                       cmd, 1, 0, NULL, 0);
                if (res) {
                        printf("pckbd_enable: command error\n");
                        return (res);



Home | Main Index | Thread Index | Old Index