diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-06-10 15:16:15 +0200 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2012-08-16 12:44:27 -0700 |
commit | 191b03260fc0241e355e5cb200d5a9497e67e67c (patch) | |
tree | 89feba34ca165fa88cb77d7f8602d775b2e1bc38 /block | |
parent | ef5006bca12286b1b92d0da4ab0d65973dc1f74d (diff) | |
download | kernel_samsung_tuna-191b03260fc0241e355e5cb200d5a9497e67e67c.zip kernel_samsung_tuna-191b03260fc0241e355e5cb200d5a9497e67e67c.tar.gz kernel_samsung_tuna-191b03260fc0241e355e5cb200d5a9497e67e67c.tar.bz2 |
HID: uhid: allow poll()'ing on uhid devices
As long as the internal buffer is not empty, we return POLLIN to
user-space.
uhid->head and uhid->tail are no atomics so the comparison may return
inexact results. However, this doesn't matter here as user-space would
need to poll() in two threads simultaneously to trigger this. And in this
case it doesn't matter if a cached result is returned or the exact new
result as user-space does not know which thread returns first from poll()
and the following read(). So it is safe to compare the values without
locking.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions