Skip to content

Commit

Permalink
Input: evdev - try to wake up readers only if we have full packet
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov committed Jun 18, 2011
1 parent 8c127f0 commit da40b0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ static void evdev_event(struct input_handle *handle,

rcu_read_unlock();

wake_up_interruptible(&evdev->wait);
if (type == EV_SYN && code == SYN_REPORT)
wake_up_interruptible(&evdev->wait);
}

static int evdev_fasync(int fd, struct file *file, int on)
Expand Down

0 comments on commit da40b0b

Please sign in to comment.