Author: hselasky Date: Mon Aug 15 09:03:05 2016 New Revision: 304129 URL: https://svnweb.freebsd.org/changeset/base/304129
Log: MFC r303765: Keep a reference count on USB keyboard polling to allow recursive cngrab() during a panic for example, similar to what the AT-keyboard driver is doing. Found by: Bruce Evans <b...@optusnet.com.au> Modified: stable/9/sys/dev/usb/input/ukbd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/9/sys/dev/usb/input/ukbd.c Mon Aug 15 09:02:09 2016 (r304128) +++ stable/9/sys/dev/usb/input/ukbd.c Mon Aug 15 09:03:05 2016 (r304129) @@ -197,6 +197,7 @@ struct ukbd_softc { int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ int sc_state; /* shift/lock key state */ int sc_accents; /* accent key index (> 0) */ + int sc_polling; /* polling recursion count */ int sc_led_size; int sc_kbd_size; @@ -1967,7 +1968,16 @@ ukbd_poll(keyboard_t *kbd, int on) struct ukbd_softc *sc = kbd->kb_data; UKBD_LOCK(); - if (on) { + /* + * Keep a reference count on polling to allow recursive + * cngrab() during a panic for example. + */ + if (on) + sc->sc_polling++; + else + sc->sc_polling--; + + if (sc->sc_polling != 0) { sc->sc_flags |= UKBD_FLAG_POLLING; sc->sc_poll_thread = curthread; } else { _______________________________________________ svn-src-stable-9@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-stable-9 To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"