Module Name:    src
Committed By:   tsutsui
Date:           Sun Oct 23 13:21:54 UTC 2011

Modified Files:
        src/sys/arch/x68k/dev: kbd.c

Log Message:
Calling psignal(9) (via EV_WAKEUP()) in interrupt handlers
could cause mutex error panic, so defer it via softint(9).
This should fix panic on heavy key strokes during running Xserver.

Should be pulled up to netbsd-5.

XXX: amiga and atari might have the similar problem?


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x68k/dev/kbd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x68k/dev/kbd.c
diff -u src/sys/arch/x68k/dev/kbd.c:1.36 src/sys/arch/x68k/dev/kbd.c:1.37
--- src/sys/arch/x68k/dev/kbd.c:1.36	Sat Jan 17 03:26:31 2009
+++ src/sys/arch/x68k/dev/kbd.c	Sun Oct 23 13:21:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kbd.c,v 1.36 2009/01/17 03:26:31 isaki Exp $	*/
+/*	$NetBSD: kbd.c,v 1.37 2011/10/23 13:21:54 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.36 2009/01/17 03:26:31 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.37 2011/10/23 13:21:54 tsutsui Exp $");
 
 #include "ite.h"
 #include "bell.h"
@@ -350,7 +350,7 @@ kbdintr(void *arg)
 	fe->value = KEY_UP(c) ? VKEY_UP : VKEY_DOWN;
 	firm_gettime(fe);
 	sc->sc_events.ev_put = put;
-	EV_WAKEUP(&sc->sc_events);
+	softint_schedule(sc->sc_softintr_cookie);
 
 	return 0;
 }
@@ -358,10 +358,14 @@ kbdintr(void *arg)
 void
 kbdsoftint(void *arg)			/* what if ite is not configured? */
 {
+	struct kbd_softc *sc = arg;
 	int s;
 
 	s = spltty();
 
+	if (sc->sc_event_mode)
+		EV_WAKEUP(&sc->sc_events);
+
 	while(kbdgetoff < kbdputoff)
 		ite_filter(kbdbuf[kbdgetoff++ & KBDBUFMASK]);
 	kbdgetoff = kbdputoff = 0;

Reply via email to