• Sean Young's avatar
    media: rc: mce_kbd decoder: fix race condition · 53a62800
    Sean Young authored
    The MCE keyboard sends both key down and key up events. We have a timeout
    handler mce_kbd_rx_timeout() in case the keyup event is never received;
    however, this may race with new key down events from occurring.
    
    The race is that key down scancode arrives and key down events are
    generated. The timeout handler races this and generates key up events
    straight afterwards. Since the keyboard generates scancodes every 100ms,
    most likely the keys will be repeated 100ms later, and now we have new
    key down events and the user sees duplicate key presses.
    Reported-by: default avatarMatthias Reichl <hias@horus.com>
    Signed-off-by: default avatarSean Young <sean@mess.org>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
    53a62800
ir-mce_kbd-decoder.c 15 KB