git: 9bdb559d9726 - stable/12 - ukbd: Fix handling of keyboard ErrorRollOver reports

Vladimir Kondratyev wulf at FreeBSD.org
Tue Feb 23 23:45:06 UTC 2021


The branch stable/12 has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=9bdb559d97268967e893b9f37dc556ae5dcd44fb

commit 9bdb559d97268967e893b9f37dc556ae5dcd44fb
Author:     Vladimir Kondratyev <wulf at FreeBSD.org>
AuthorDate: 2021-02-13 18:12:56 +0000
Commit:     Vladimir Kondratyev <wulf at FreeBSD.org>
CommitDate: 2021-02-23 23:43:28 +0000

    ukbd: Fix handling of keyboard ErrorRollOver reports
    
    Ignore fantom keyboard state reports entirelly rather than ignore
    RollOver states for each key separatelly.  Latter results in spurious
    release/push pairs of events on each fantom keyboard state report.
    
    Reported by:    Jan Martin Mikkelsen <janm_AT_transactionware_DOT_com>
    Submitted by:   Jan Martin Mikkelsen (initial version)
    PR:             253249
    MFC after:      1 week
    
    (cherry picked from commit 032d3153877ef1767c121bbdf8e00f4f93b30a5d)
---
 sys/dev/usb/input/ukbd.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c
index e438a1521f97..52b358c20324 100644
--- a/sys/dev/usb/input/ukbd.c
+++ b/sys/dev/usb/input/ukbd.c
@@ -721,11 +721,16 @@ ukbd_intr_callback(struct usb_xfer *xfer, usb_error_t error)
 					    hid_get_data_unsigned(sc->sc_buffer, len, &tmp_loc);
 					/* advance to next location */
 					tmp_loc.pos += tmp_loc.size;
+					if (key == KEY_ERROR) {
+						DPRINTF("KEY_ERROR\n");
+						sc->sc_ndata = sc->sc_odata;
+						goto tr_setup; /* ignore */
+					}
 					if (modifiers & MOD_FN)
 						key = ukbd_apple_fn(key);
 					if (sc->sc_flags & UKBD_FLAG_APPLE_SWAP)
 						key = ukbd_apple_swap(key);
-					if (key == KEY_NONE || key == KEY_ERROR || key >= UKBD_NKEYCODE)
+					if (key == KEY_NONE || key >= UKBD_NKEYCODE)
 						continue;
 					/* set key in bitmap */
 					sc->sc_ndata.bitmap[key / 64] |= 1ULL << (key % 64);


More information about the dev-commits-src-branches mailing list