Date: Sat, 7 Oct 2006 09:26:46 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 107405 for review Message-ID: <200610070926.k979Qkau034574@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=107405 Change 107405 by hselasky@hselasky_mini_itx on 2006/10/07 09:26:28 Temporary workarounds to prevent the evident panic, when the keyboard layer is being called without Giant. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/ukbd.c#12 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/ukbd.c#12 (text+ko) ==== @@ -869,6 +869,10 @@ { struct ukbd_softc *sc = kbd->kb_data; + if (!mtx_owned(&Giant)) { + return 0; /* XXX */ + } + mtx_assert(&Giant, MA_OWNED); if (!KBD_IS_ACTIVE(kbd)) { @@ -891,6 +895,10 @@ { struct ukbd_softc *sc = kbd->kb_data; + if (!mtx_owned(&Giant)) { + return 0; /* XXX */ + } + mtx_assert(&Giant, MA_OWNED); if (!KBD_IS_ACTIVE(kbd)) { @@ -915,6 +923,10 @@ u_int32_t scancode; #endif + if (!mtx_owned(&Giant)) { + return -1; /* XXX */ + } + mtx_assert(&Giant, MA_OWNED); #ifdef UKBD_EMULATE_ATSCANCODE @@ -961,6 +973,9 @@ #ifdef UKBD_EMULATE_ATSCANCODE u_int32_t scancode; #endif + if (!mtx_owned(&Giant)) { + return NOKEY; /* XXX */ + } mtx_assert(&Giant, MA_OWNED); @@ -1272,6 +1287,10 @@ { struct ukbd_softc *sc = kbd->kb_data; + if (!mtx_owned(&Giant)) { + return; /* XXX */ + } + mtx_assert(&Giant, MA_OWNED); sc->sc_flags &= ~(UKBD_FLAG_COMPOSE|UKBD_FLAG_POLLING); @@ -1310,6 +1329,10 @@ { struct ukbd_softc *sc = kbd->kb_data; + if (!mtx_owned(&Giant)) { + return 0; /* XXX */ + } + mtx_assert(&Giant, MA_OWNED); if (on) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610070926.k979Qkau034574>