diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-06-18 05:50:11 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-06-18 05:54:02 -0400 |
commit | da40b0b6b4d3a81c5051fe6ae0544c48c13261c4 (patch) | |
tree | c54325034ac30742fa6d0a82bc49a5396e8e66f2 /drivers/input/evdev.c | |
parent | 8c127f0717b438e6abc3d92d4ae248c4224b9dcb (diff) |
Input: evdev - try to wake up readers only if we have full packet
We should only wake waiters on the event device when we actually post
an EV_SYN/SYN_REPORT to the queue. Otherwise we end up making waiting
threads runnable only to go right back to sleep because the device
still isn't readable.
Reported-by: Jeffrey Brown <jeffbrown@android.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r-- | drivers/input/evdev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index be0921ef6b52..4cf25347b015 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -111,7 +111,8 @@ static void evdev_event(struct input_handle *handle, | |||
111 | 111 | ||
112 | rcu_read_unlock(); | 112 | rcu_read_unlock(); |
113 | 113 | ||
114 | wake_up_interruptible(&evdev->wait); | 114 | if (type == EV_SYN && code == SYN_REPORT) |
115 | wake_up_interruptible(&evdev->wait); | ||
115 | } | 116 | } |
116 | 117 | ||
117 | static int evdev_fasync(int fd, struct file *file, int on) | 118 | static int evdev_fasync(int fd, struct file *file, int on) |