Date: Thu, 24 Dec 2020 19:11:56 GMT From: Vladimir Kondratyev <wulf@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 30f34a519372 - ukbd(4): Push LED events in ioctl handler rather than in xfer callback Message-ID: <202012241911.0BOJBuUN085180@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=30f34a519372ebce29c4439d0e6a7bc8c2df0566 commit 30f34a519372ebce29c4439d0e6a7bc8c2df0566 Author: Vladimir Kondratyev <wulf@FreeBSD.org> AuthorDate: 2020-12-24 19:08:04 +0000 Commit: Vladimir Kondratyev <wulf@FreeBSD.org> CommitDate: 2020-12-24 19:08:04 +0000 ukbd(4): Push LED events in ioctl handler rather than in xfer callback If LED state is set through evdev interface, than asynchronous nature of USB transfer callback can lead to change of order of events echoed back to userland as it causes LED events to be echoed with some lag. Fix that with echoing of LED events synchronously in ioctl handler. Reviewed by: hselasky Obtained from: sysutils/iichid MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D27750 --- sys/dev/usb/input/ukbd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 1ab26ccfb258..4f27bf95b948 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -845,11 +845,6 @@ ukbd_set_leds_callback(struct usb_xfer *xfer, usb_error_t error) if (!any) break; -#ifdef EVDEV_SUPPORT - if (sc->sc_evdev != NULL) - evdev_push_leds(sc->sc_evdev, sc->sc_leds); -#endif - /* range check output report length */ len = sc->sc_led_size; if (len > (UKBD_BUFFER_SIZE - 1)) @@ -1973,6 +1968,11 @@ ukbd_set_leds(struct ukbd_softc *sc, uint8_t leds) UKBD_LOCK_ASSERT(); DPRINTF("leds=0x%02x\n", leds); +#ifdef EVDEV_SUPPORT + if (sc->sc_evdev != NULL) + evdev_push_leds(sc->sc_evdev, leds); +#endif + sc->sc_leds = leds; sc->sc_flags |= UKBD_FLAG_SET_LEDS;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012241911.0BOJBuUN085180>