summaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/libps2.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-05-28 18:51:31 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-05-28 19:34:02 +0200
commita3ce6ea46cc0d6397d1b92b1a5983bb2935306ed (patch)
tree290d6ca606ad960fda685992b6a087cc6b56c1e1 /drivers/input/serio/libps2.c
parentInput: usb1400_ts - fix access to "device data" in resume function (diff)
downloadlinux-a3ce6ea46cc0d6397d1b92b1a5983bb2935306ed.tar.xz
linux-a3ce6ea46cc0d6397d1b92b1a5983bb2935306ed.zip
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>
Diffstat (limited to 'drivers/input/serio/libps2.c')
-rw-r--r--drivers/input/serio/libps2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c
index 67248c31e19a..be5bbbb8ae4e 100644
--- a/drivers/input/serio/libps2.c
+++ b/drivers/input/serio/libps2.c
@@ -210,7 +210,7 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
timeout = wait_event_timeout(ps2dev->wait,
!(ps2dev->flags & PS2_FLAG_CMD1), timeout);
- if (ps2dev->cmdcnt && timeout > 0) {
+ if (ps2dev->cmdcnt && !(ps2dev->flags & PS2_FLAG_CMD1)) {
timeout = ps2_adjust_timeout(ps2dev, command, timeout);
wait_event_timeout(ps2dev->wait,