<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/input/serio/libps2.c, branch v5.7</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.7</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.7'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2019-06-19T15:09:55Z</updated>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500</title>
<updated>2019-06-19T15:09:55Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-06-04T08:11:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d2912cb15bdda8ba4a5dd73396ad62641af2f520'/>
<id>urn:sha1:d2912cb15bdda8ba4a5dd73396ad62641af2f520</id>
<content type='text'>
Based on 2 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Enrico Weigelt &lt;info@metux.net&gt;
Reviewed-by: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Input: libps2 - mark expected switch fall-through</title>
<updated>2019-05-07T21:13:04Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2019-05-07T19:27:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0981949da8f7498b96c6e0ae60680865ca283bf1'/>
<id>urn:sha1:0981949da8f7498b96c6e0ae60680865ca283bf1</id>
<content type='text'>
In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/input/serio/libps2.c: In function ‘ps2_handle_ack’:
drivers/input/serio/libps2.c:407:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (ps2dev-&gt;flags &amp; PS2_FLAG_NAK) {
      ^
drivers/input/serio/libps2.c:417:2: note: here
  case 0x00:
  ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: libps2 - relax command byte ACK handling</title>
<updated>2018-02-03T00:50:28Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2018-01-17T20:00:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=29acc42e8e10a4721757af9ed8aec569d30ce39b'/>
<id>urn:sha1:29acc42e8e10a4721757af9ed8aec569d30ce39b</id>
<content type='text'>
When we probe PS/2 devices we first issue "Get ID" command and only if we
receive what we consider a valid keyboard or mouse ID we disable the device
and continue with protocol detection. That means that the device may be
transmitting motion or keystroke data, while we expect ACK response.

Instead of signaling failure if we see anything but ACK/NAK let's ignore
"garbage" response until we see ACK for the command byte (first byte). The
checks for subsequent ACKs of command parameters will continue be strict.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: libps2 - support retransmission of command data</title>
<updated>2018-02-03T00:50:27Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2018-01-05T06:01:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b99e1f2a1a3f4158bed9b9e9e97ac46678d8c2ac'/>
<id>urn:sha1:b99e1f2a1a3f4158bed9b9e9e97ac46678d8c2ac</id>
<content type='text'>
The devices are allowed to respond to either command byte or command
parameter with a NAK (0xfe), and the host is supposed to resend the
"correct" byte. The device then will either respond with ACK or ERR (0xfc).
Let's teach libps2 to handle the NAK responses properly, so that individual
drivers do not need to handle them.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: libps2 - add debugging statements</title>
<updated>2018-02-03T00:50:25Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2018-01-02T20:21:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=147b903da65daedc90dbeb66a75dd608a6a41ef2'/>
<id>urn:sha1:147b903da65daedc90dbeb66a75dd608a6a41ef2</id>
<content type='text'>
Debugging via i8042.debug and analyzing raw PS/2 data stream may be
cumbersome as you need to locate the boundaries of commands, decipher the
sliced commands, etc, etc. Let's add a bit more high level debug statements
for ps2_sendbyte(), ps2_command(), and ps2_sliced_command().

We do not introduce a new module parameter, but rater rely on the kernel
having dynamic debug facility enabled (which most everyone has nowadays).
Enable with:

echo "file libps2.c +pf" &gt; /sys/kernel/debug/dynamic_debug/control

or add "libps2.dyndbg=+pf" to the kernel command line.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: psmouse - move sliced command implementation to libps2</title>
<updated>2018-02-03T00:50:24Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2018-01-02T20:03:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=08be954b7a7de6742d3d47e4dc20e3b086410761'/>
<id>urn:sha1:08be954b7a7de6742d3d47e4dc20e3b086410761</id>
<content type='text'>
In preparation to adding some debugging statements to PS/2 control
sequences let's move psmouse_sliced_command() into libps2 and rename it
to ps2_sliced_command().

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: libps2 - use u8 for byte data</title>
<updated>2018-02-03T00:50:21Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2018-01-04T18:58:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b28bad65c1fec47076ebee88b51b0dafa31f5065'/>
<id>urn:sha1:b28bad65c1fec47076ebee88b51b0dafa31f5065</id>
<content type='text'>
Instead of using unsigned char for the byte data switch to using u8. Also
use unsigned int for the command codes and timeouts, and have
ps2_handle_ack() and ps2_handle_response() return bool instead of int, as
they do not return error codes but rather signal whether a byte was handled
or not handled. ps2_is_keyboard_id() now returns bool as well.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: libps2 - fix switch statement formatting</title>
<updated>2018-02-03T00:50:18Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2018-01-04T19:05:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d5e0d9187abd5e3ce23884c375c4b36f403e42be'/>
<id>urn:sha1:d5e0d9187abd5e3ce23884c375c4b36f403e42be</id>
<content type='text'>
Individual labels of switch statements should have the same indentation
level as the switch statement itself.

Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: i8042 - break load dependency between atkbd/psmouse and i8042</title>
<updated>2016-07-27T21:20:09Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2016-07-25T18:36:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4097461897df91041382ff6fcd2bfa7ee6b2448c'/>
<id>urn:sha1:4097461897df91041382ff6fcd2bfa7ee6b2448c</id>
<content type='text'>
As explained in 1407814240-4275-1-git-send-email-decui@microsoft.com we
have a hard load dependency between i8042 and atkbd which prevents
keyboard from working on Gen2 Hyper-V VMs.

&gt; hyperv_keyboard invokes serio_interrupt(), which needs a valid serio
&gt; driver like atkbd.c.  atkbd.c depends on libps2.c because it invokes
&gt; ps2_command().  libps2.c depends on i8042.c because it invokes
&gt; i8042_check_port_owner().  As a result, hyperv_keyboard actually
&gt; depends on i8042.c.
&gt;
&gt; For a Generation 2 Hyper-V VM (meaning no i8042 device emulated), if a
&gt; Linux VM (like Arch Linux) happens to configure CONFIG_SERIO_I8042=m
&gt; rather than =y, atkbd.ko can't load because i8042.ko can't load(due to
&gt; no i8042 device emulated) and finally hyperv_keyboard can't work and
&gt; the user can't input: https://bugs.archlinux.org/task/39820
&gt; (Ubuntu/RHEL/SUSE aren't affected since they use CONFIG_SERIO_I8042=y)

To break the dependency we move away from using i8042_check_port_owner()
and instead allow serio port owner specify a mutex that clients should use
to serialize PS/2 command stream.

Reported-by: Mark Laws &lt;mdl@60hz.org&gt;
Tested-by: Mark Laws &lt;mdl@60hz.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
<entry>
<title>Input: psmouse - fix data race in __ps2_command</title>
<updated>2015-09-29T23:08:29Z</updated>
<author>
<name>Dmitry Vyukov</name>
<email>dvyukov@google.com</email>
</author>
<published>2015-09-29T22:54:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=218c1f76b8b25d6dc9d01443f071cb618e206b0c'/>
<id>urn:sha1:218c1f76b8b25d6dc9d01443f071cb618e206b0c</id>
<content type='text'>
The data race happens on ps2dev-&gt;cmdcnt and ps2dev-&gt;cmdbuf contents.
__ps2_command reads that data concurrently with the interrupt handler. As
the result, for example, if a response arrives just after the timeout,
__ps2_command can copy out garbage from ps2dev-&gt;cmdbuf but then see that
ps2dev-&gt;cmdcnt is 0 and return success.

Stop the interrupt handler with serio_pause_rx() before reading the
results.

The data race was found with KernelThreadSanitizer (KTSAN).

Signed-off-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
</feed>
