Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: libps2 - better handle bad scheduler decisions

Sometimes devices send us their responses in time but due to
unfortunate scheduling decisions the receiving thread does not
get scheduled till much later and we erroneously decide that
device timed out. Work around this problem by checking whether we
received the data we needed instead of checking timeout
condition.

Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

+1 -1
+1 -1
drivers/input/serio/libps2.c
··· 210 210 timeout = wait_event_timeout(ps2dev->wait, 211 211 !(ps2dev->flags & PS2_FLAG_CMD1), timeout); 212 212 213 - if (ps2dev->cmdcnt && timeout > 0) { 213 + if (ps2dev->cmdcnt && !(ps2dev->flags & PS2_FLAG_CMD1)) { 214 214 215 215 timeout = ps2_adjust_timeout(ps2dev, command, timeout); 216 216 wait_event_timeout(ps2dev->wait,