Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2010 16:35:18 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 172971 for review
Message-ID:  <201001111635.o0BGZIhn084467@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=172971

Change 172971 by hselasky@hselasky_laptop001 on 2010/01/11 16:34:59

	USB input:
		- first round of patches, problem partly solved.
	
	PR:		kern/141011

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/input/ukbd.c#39 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/input/ukbd.c#39 (text+ko) ====

@@ -1419,7 +1419,17 @@
 		 * keyboard system must get out of "Giant" first, before the
 		 * CPU can proceed here ...
 		 */
-		return (EINVAL);
+		switch (cmd) {
+		case KDGKBMODE:
+		case KDSKBMODE:
+			/* workaround for Geli */
+			mtx_lock(&Giant);
+			i = ukbd_ioctl(kbd, cmd, arg);
+			mtx_unlock(&Giant);
+			return (i);
+		default:
+			return (EINVAL);
+		}
 	}
 
 	switch (cmd) {
@@ -1552,7 +1562,11 @@
 	struct ukbd_softc *sc = kbd->kb_data;
 
 	if (!mtx_owned(&Giant)) {
-		return;			/* XXX */
+		/* XXX cludge */
+		mtx_lock(&Giant);
+		ukbd_clear_state(kbd);
+		mtx_unlock(&Giant);
+		return;
 	}
 
 	sc->sc_flags &= ~(UKBD_FLAG_COMPOSE | UKBD_FLAG_POLLING);
@@ -1563,10 +1577,10 @@
 	sc->sc_buffered_char[0] = 0;
 	sc->sc_buffered_char[1] = 0;
 #endif
-	bzero(&sc->sc_ndata, sizeof(sc->sc_ndata));
-	bzero(&sc->sc_odata, sizeof(sc->sc_odata));
-	bzero(&sc->sc_ntime, sizeof(sc->sc_ntime));
-	bzero(&sc->sc_otime, sizeof(sc->sc_otime));
+	memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata));
+	memset(&sc->sc_odata, 0, sizeof(sc->sc_odata));
+	memset(&sc->sc_ntime, 0, sizeof(sc->sc_ntime));
+	memset(&sc->sc_otime, 0, sizeof(sc->sc_otime));
 }
 
 /* save the internal state, not used */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001111635.o0BGZIhn084467>