<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/input/misc/uinput.c, branch v3.12.14</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/input/misc/uinput.c?h=v3.12.14</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/input/misc/uinput.c?h=v3.12.14'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-10-03T00:16:10Z</updated>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input</title>
<updated>2012-10-03T00:16:10Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-10-03T00:16:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fc47912d9cda50ae6bd9ca30e97e8c03de5b7b60'/>
<id>urn:sha1:fc47912d9cda50ae6bd9ca30e97e8c03de5b7b60</id>
<content type='text'>
Pull input updates from Dmitry Torokhov:
 "A few drivers were updated with device tree bindings and others got a
  few small cleanups and fixes."

Fix trivial conflict in drivers/input/keyboard/omap-keypad.c due to
changes clashing with a whitespace cleanup.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (28 commits)
  Input: wacom - mark Intuos5 pad as in-prox when touching buttons
  Input: synaptics - adjust threshold for treating position values as negative
  Input: hgpk - use %*ph to dump small buffer
  Input: gpio_keys_polled - fix dt pdata-&gt;nbuttons
  Input: Add KD[GS]KBDIACRUC ioctls to the compatible list
  Input: omap-keypad - fixed formatting
  Input: tegra - move platform data header
  Input: wacom - add support for EMR on Cintiq 24HD touch
  Input: s3c2410_ts - make s3c_ts_pmops const
  Input: samsung-keypad - use of_get_child_count() helper
  Input: samsung-keypad - use of_match_ptr()
  Input: uinput - fix formatting
  Input: uinput - specify exact bit sizes on userspace APIs
  Input: uinput - mark failed submission requests as free
  Input: uinput - fix race that can block nonblocking read
  Input: uinput - return -EINVAL when read buffer size is too small
  Input: uinput - take event lock when fetching events from buffer
  Input: get rid of MATCH_BIT() macro
  Input: rotary-encoder - add DT bindings
  Input: rotary-encoder - constify platform data pointers
  ...
</content>
</entry>
<entry>
<title>Input: MT - Add flags to input_mt_init_slots()</title>
<updated>2012-09-19T17:50:18Z</updated>
<author>
<name>Henrik Rydberg</name>
<email>rydberg@euromail.se</email>
</author>
<published>2012-08-11T20:07:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b4adbbefc2099476a4f1020041c99f52cf3cd67d'/>
<id>urn:sha1:b4adbbefc2099476a4f1020041c99f52cf3cd67d</id>
<content type='text'>
Preparing to move more repeated code into the mt core, add a flags
argument to the input_mt_slots_init() function.

Reviewed-and-tested-by: Benjamin Tissoires &lt;benjamin.tissoires@enac.fr&gt;
Tested-by: Ping Cheng &lt;pingc@wacom.com&gt;
Acked-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Henrik Rydberg &lt;rydberg@euromail.se&gt;
</content>
</entry>
<entry>
<title>Input: uinput - fix formatting</title>
<updated>2012-08-22T05:29:55Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2012-07-30T05:48:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=54ce165ebd9d9494b64149e0d1ab4ddbf5ea908b'/>
<id>urn:sha1:54ce165ebd9d9494b64149e0d1ab4ddbf5ea908b</id>
<content type='text'>
Reformat the code to keep it within 80 columns.

Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Input: uinput - specify exact bit sizes on userspace APIs</title>
<updated>2012-08-22T05:29:54Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2012-07-30T05:48:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c5b3533a82ef4b6ceae81b7675f8d6dadcc6f3ab'/>
<id>urn:sha1:c5b3533a82ef4b6ceae81b7675f8d6dadcc6f3ab</id>
<content type='text'>
Switch to using __u32/__s32 instead of ordinary 'int' in structures
forming userspace API.

Also internally make request_id unsigned int.

Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Input: uinput - mark failed submission requests as free</title>
<updated>2012-08-22T05:29:54Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2012-07-30T05:48:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=00ce756ce53acdb82d408346e6a7b734ca9e5bad'/>
<id>urn:sha1:00ce756ce53acdb82d408346e6a7b734ca9e5bad</id>
<content type='text'>
If uinput_request_submit() fails after new request ID was allocated
we need to mark that request ID as free, otherwise it will always
stay occupied and we may run out of available IDs.

Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Input: uinput - fix race that can block nonblocking read</title>
<updated>2012-08-22T05:29:53Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2012-07-30T05:48:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=22ae19c6e3c22b390952e90f452f26adad9b8687'/>
<id>urn:sha1:22ae19c6e3c22b390952e90f452f26adad9b8687</id>
<content type='text'>
Consider two threads calling read() on the same uinput-fd, both
non-blocking. Assume there is data-available so both will simultaneously
pass:
	udev-&gt;head == udev-&gt;tail

Then the first thread goes to sleep and the second one pops the message
from the queue. Now assume udev-&gt;head == udev-&gt;tail. If the first thread
wakes up it will call wait_event_*() and sleep in the waitq. This
effectively turns the non-blocking FD into a blocking one.

We fix this by attempting to fetch events from the queue first and only
if we fail to retrieve any events we either return -EAGAIN (in case of
non-blocing read) or wait until there are more events.

This also fixes incorrect return code (we were returning 0 instead of
 -EAGAIN for non-blocking reads) when an event is "stolen" by another
thread. Blocking reads will now continue to wait instead of returning 0
in this scenario.

Count of 0 continues to be a special case, as per spec: we will check for
device existence and whether there are events in the queue, but no events
will be actually retrieved.

Reported-by: David Herrmann &lt;dh.herrmann@googlemail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Input: uinput - return -EINVAL when read buffer size is too small</title>
<updated>2012-08-22T05:29:53Z</updated>
<author>
<name>David Herrmann</name>
<email>dh.herrmann@googlemail.com</email>
</author>
<published>2012-07-30T05:48:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f40033acc2d14acecd1b27a79dc8a0ad437e619a'/>
<id>urn:sha1:f40033acc2d14acecd1b27a79dc8a0ad437e619a</id>
<content type='text'>
Let's check whether the user-supplied buffer is actually big enough and
return -EINVAL if it is not. This differs from current behavior, which
caused 0 to be returned and actually does not make any sense, as
broken application will simply repeat the read getting into endless
loop.

Note that we treat 0 as a special case, according to the standard:

"Before any action described below is taken, and if nbyte is zero,
the read() function may detect and return errors as described below.
In the absence of errors, or if error detection is not performed,
the read() function shall return zero and have no other results."

Signed-off-by: David Herrmann &lt;dh.herrmann@googlemail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Input: uinput - take event lock when fetching events from buffer</title>
<updated>2012-08-22T05:29:52Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2012-07-30T05:48:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=929d1af5478dec82903e05aa9662a4ec12ad655b'/>
<id>urn:sha1:929d1af5478dec82903e05aa9662a4ec12ad655b</id>
<content type='text'>
When fetching events form device's buffer in uinput_read() we need to
take input device's event_lock to avoid racing with new event delivery.

Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Input: uinput - allow for 0/0 min/max on absolute axes.</title>
<updated>2011-03-31T07:02:39Z</updated>
<author>
<name>Peter Hutterer</name>
<email>peter.hutterer@who-t.net</email>
</author>
<published>2011-03-31T05:25:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a718d79cc0e0c2f0aa82ba2c54383a18f15b7738'/>
<id>urn:sha1:a718d79cc0e0c2f0aa82ba2c54383a18f15b7738</id>
<content type='text'>
Some devices provide absolute axes with min/max of 0/0 (e.g. wacom's
ABS_MISC axis). Current uinput restrictions do not allow duplication of
these devices and require hacks in userspace to work around this.

If the kernel accepts physical devices with a min/max of 0/0, uinput
shouldn't disallow the same range.

Signed-off-by: Peter Hutterer &lt;peter.hutterer@who-t.net&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
<entry>
<title>Input: uinput - reversed test in uinput_setup_device()</title>
<updated>2011-02-21T09:02:34Z</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2011-02-18T16:30:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=163d27706bb91a648cc292151fc072e1e8cd4b4d'/>
<id>urn:sha1:163d27706bb91a648cc292151fc072e1e8cd4b4d</id>
<content type='text'>
The test here is reversed. It should be if (IS_ERR()) instead of
if (!IS_ERR()).

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dtor@mail.ru&gt;
</content>
</entry>
</feed>
