<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/input/evdev.c, branch v3.2.78</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.78</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.78'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2015-10-13T02:46:08Z</updated>
<entry>
<title>Input: evdev - do not report errors form flush()</title>
<updated>2015-10-13T02:46:08Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2015-09-04T05:20:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a6706174cfe9fa100651b5012aec9796006a884b'/>
<id>urn:sha1:a6706174cfe9fa100651b5012aec9796006a884b</id>
<content type='text'>
commit eb38f3a4f6e86f8bb10a3217ebd85ecc5d763aae upstream.

We've got bug reports showing the old systemd-logind (at least
system-210) aborting unexpectedly, and this turned out to be because
of an invalid error code from close() call to evdev devices.  close()
is supposed to return only either EINTR or EBADFD, while the device
returned ENODEV.  logind was overreacting to it and decided to kill
itself when an unexpected error code was received.  What a tragedy.

The bad error code comes from flush fops, and actually evdev_flush()
returns ENODEV when device is disconnected or client's access to it is
revoked. But in these cases the fact that flush did not actually happen is
not an error, but rather normal behavior. For non-disconnected devices
result of flush is also not that interesting as there is no potential of
data loss and even if it fails application has no way of handling the
error. Because of that we are better off always returning success from
evdev_flush().

Also returning EINTR from flush()/close() is discouraged (as it is not
clear how application should handle this error), so let's stop taking
evdev-&gt;mutex interruptibly.

Bugzilla: http://bugzilla.suse.com/show_bug.cgi?id=939834
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
[bwh: Backported to 3.2: there's no revoked flag to test]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>Input: evdev - try to wake up readers only if we have full packet</title>
<updated>2011-06-18T09:54:02Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2011-06-18T09:50:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=da40b0b6b4d3a81c5051fe6ae0544c48c13261c4'/>
<id>urn:sha1:da40b0b6b4d3a81c5051fe6ae0544c48c13261c4</id>
<content type='text'>
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 &lt;jeffbrown@android.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Input: remove useless synchronize_rcu() calls</title>
<updated>2011-05-12T15:28:57Z</updated>
<author>
<name>Eric Dumazet</name>
<email>eric.dumazet@gmail.com</email>
</author>
<published>2011-05-11T22:38:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7cbbb758d3c93b24b45b169af55440d2e7d5b7f6'/>
<id>urn:sha1:7cbbb758d3c93b24b45b169af55440d2e7d5b7f6</id>
<content type='text'>
There is no need to call synchronize_rcu() after a list insertion,
or a NULL-&gt;ptr assignment.

However, the reverse operations do need this call.

Signed-off-by: Eric Dumazet &lt;eric.dumazet@gmail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Input: evdev - only signal polls on full packets</title>
<updated>2011-04-27T05:16:38Z</updated>
<author>
<name>Jeff Brown</name>
<email>jeffbrown@android.com</email>
</author>
<published>2011-04-27T05:16:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cdda911c34006f1089f3c87b1a1f31ab3a4722f2'/>
<id>urn:sha1:cdda911c34006f1089f3c87b1a1f31ab3a4722f2</id>
<content type='text'>
This patch modifies evdev so that it only becomes readable when
the buffer contains an EV_SYN/SYN_REPORT event.

On SMP systems, it is possible for an evdev client blocked on poll()
to wake up and read events from the evdev ring buffer at the same
rate as they are enqueued.  This can result in high CPU usage,
particularly for MT devices, because the client ends up reading
events one at a time instead of reading complete packets.

We eliminate this problem by making the device readable only when
the buffer contains at least one complete packet.  This causes
clients to block until the entire packet is available.

Signed-off-by: Jeff Brown &lt;jeffbrown@android.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Input: evdev - indicate buffer overrun with SYN_DROPPED</title>
<updated>2011-04-13T06:35:24Z</updated>
<author>
<name>Jeff Brown</name>
<email>jeffbrown@google.com</email>
</author>
<published>2011-04-13T06:29:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9fb0f14e31b6101a0cc69a333b43541044f9b0a6'/>
<id>urn:sha1:9fb0f14e31b6101a0cc69a333b43541044f9b0a6</id>
<content type='text'>
Add a new EV_SYN code, SYN_DROPPED, to inform the client when input
events have been dropped from the evdev input buffer due to a
buffer overrun.  The client should use this event as a hint to
reset its state or ignore all following events until the next
packet begins.

Signed-off-by: Jeff Brown &lt;jeffbrown@android.com&gt;
[dtor@mail.ru: Implement Henrik's suggestion and drop old events in
 case of overflow.]
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Input: evdev - fix evdev_write return value on partial writes</title>
<updated>2011-02-27T09:52:53Z</updated>
<author>
<name>Peter Korsgaard</name>
<email>jacmet@sunsite.dk</email>
</author>
<published>2011-02-25T17:30:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=439581ec07fa9cf3f519dd461a2cf41cfd3adcb4'/>
<id>urn:sha1:439581ec07fa9cf3f519dd461a2cf41cfd3adcb4</id>
<content type='text'>
As was recently brought up on the busybox list
(http://lists.busybox.net/pipermail/busybox/2011-January/074565.html),
evdev_write doesn't properly check the count argument, which will
lead to a return value &gt; count on partial writes if the remaining bytes
are accessible - causing userspace confusion.

Fix it by only handling each full input_event structure and return -EINVAL
if less than 1 struct was written, similar to how it is done in evdev_read.

Reported-by: Baruch Siach &lt;baruch@tkos.co.il&gt;
Signed-off-by: Peter Korsgaard &lt;jacmet@sunsite.dk&gt;
Acked-by: Henrik Rydberg &lt;rydberg@euromail.se&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Merge branch 'next' into for-linus</title>
<updated>2011-01-07T06:34:59Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2011-01-07T06:34:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=554738da71004d96e06fb75f4772dfc3b0f47810'/>
<id>urn:sha1:554738da71004d96e06fb75f4772dfc3b0f47810</id>
<content type='text'>
Conflicts:
	include/linux/input.h
</content>
</entry>
<entry>
<title>Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rydberg/input-mt into next</title>
<updated>2010-12-28T01:33:20Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2010-12-28T01:33:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5c461b913a16aed8afa285a1d00414791a9afe33'/>
<id>urn:sha1:5c461b913a16aed8afa285a1d00414791a9afe33</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Input: introduce device properties</title>
<updated>2010-12-20T08:37:33Z</updated>
<author>
<name>Henrik Rydberg</name>
<email>rydberg@euromail.se</email>
</author>
<published>2010-12-18T19:51:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=85b7720039fc000b561c20fe2aaa3b54cddae4a7'/>
<id>urn:sha1:85b7720039fc000b561c20fe2aaa3b54cddae4a7</id>
<content type='text'>
Today, userspace sets up an input device based on the data it emits.
This is not always enough; a tablet and a touchscreen may emit exactly
the same data, for instance, but the former should be set up with a
pointer whereas the latter does not need to. Recently, a new type of
touchpad has emerged where the buttons are under the pad, which
changes logic without changing the emitted data. This patch introduces
a new ioctl, EVIOCGPROP, which enables user access to a set of device
properties useful during setup. The properties are given as a bitmap
in the same fashion as the event types, and are also made available
via sysfs, uevent and /proc/bus/input/devices.

Acked-by: Ping Cheng &lt;pingc@wacom.com&gt;
Acked-by: Chase Douglas &lt;chase.douglas@canonical.com&gt;
Acked-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
Signed-off-by: Henrik Rydberg &lt;rydberg@euromail.se&gt;
</content>
</entry>
<entry>
<title>Input: define separate EVIOCGKEYCODE_V2/EVIOCSKEYCODE_V2</title>
<updated>2010-12-15T07:55:21Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2010-12-15T07:53:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ab4e0192196b8d4e43a3945742d4996da934a86f'/>
<id>urn:sha1:ab4e0192196b8d4e43a3945742d4996da934a86f</id>
<content type='text'>
The desire to keep old names for the EVIOCGKEYCODE/EVIOCSKEYCODE while
extending them to support large scancodes was a mistake. While we tried
to keep ABI intact (and we succeeded in doing that, programs compiled
on older kernels will work on newer ones) there is still a problem with
recompiling existing software with newer kernel headers.

New kernel headers will supply updated ioctl numbers and kernel will
expect that userspace will use struct input_keymap_entry to set and
retrieve keymap data. But since the names of ioctls are still the same
userspace will happily compile even if not adjusted to make use of the
new structure and will start miraculously fail in the field.

To avoid this issue let's revert EVIOCGKEYCODE/EVIOCSKEYCODE definitions
and add EVIOCGKEYCODE_V2/EVIOCSKEYCODE_V2 so that userspace can explicitly
select the style of ioctls it wants to employ.

Reviewed-by: Henrik Rydberg &lt;rydberg@euromail.se&gt;
Acked-by: Jarod Wilson &lt;jarod@redhat.com&gt;
Acked-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
</feed>
