linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] libps2: be more tolerant when processing commands
@ 2023-05-11 18:52 Dmitry Torokhov
  2023-05-11 18:52 ` [PATCH 1/7] Input: libps2 - attach ps2dev instances as serio port's drvdata Dmitry Torokhov
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Dmitry Torokhov @ 2023-05-11 18:52 UTC (permalink / raw)
  To: linux-input; +Cc: Raul E Rangel, linux-kernel

Hi,

The main reason for this patch series is to deal with the case when
EC/keyboard controller has already latched a scancode in the output
buffer at the same time the host (kernel) is sending a PS/2 command to
the controller/device. The device should stop scanning (keyboard) or
sending coordinate data (mouse), and instead send acknowledge (0xfa) and
then potentially command response, but if the output buffer already
contains scancode byte it can not be substituted with an ACK byte.

The typical scenario for this is user activating a CapsLock function,
with host sending command to toggle CapsLock LED. If at the same time
the keyboard transmitting break code for the key the kernel may mistake
it for garbage command response and get confused.

To work around this scenario, instead of simply dropping the non-ACK/NAK
byte we will pass it on to atkbd/psmouse for normal processing.

In addition to the above there a couple more assorted cleanups and
fixes.

Thanks.

Dmitry Torokhov (7):
  Input: libps2 - attach ps2dev instances as serio port's drvdata
  Input: libps2 - remove special handling of ACK for command byte
  Input: libps2 - rework handling of command response
  Input: libps2 - fix NAK handling
  Input: libps2 - fix aborting PS/2 commands
  Input: libps2 - introduce common interrupt handler
  Input: libps2 - do not discard non-ack bytes when controlling LEDs

 drivers/input/keyboard/atkbd.c     |  94 ++++-----
 drivers/input/mouse/psmouse-base.c |  86 +++++----
 drivers/input/mouse/psmouse.h      |   2 +
 drivers/input/mouse/synaptics.c    |  10 +-
 drivers/input/mouse/trackpoint.c   |   2 +-
 drivers/input/serio/libps2.c       | 293 +++++++++++++++++++++--------
 include/linux/libps2.h             |  62 +++---
 7 files changed, 350 insertions(+), 199 deletions(-)

-- 
Dmitry


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-05-18 17:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-11 18:52 [PATCH 0/7] libps2: be more tolerant when processing commands Dmitry Torokhov
2023-05-11 18:52 ` [PATCH 1/7] Input: libps2 - attach ps2dev instances as serio port's drvdata Dmitry Torokhov
2023-05-18 17:20   ` Raul E Rangel
2023-05-11 18:52 ` [PATCH 2/7] Input: libps2 - remove special handling of ACK for command byte Dmitry Torokhov
2023-05-18 17:21   ` Raul E Rangel
2023-05-11 18:52 ` [PATCH 3/7] Input: libps2 - rework handling of command response Dmitry Torokhov
2023-05-18 17:21   ` Raul E Rangel
2023-05-11 18:52 ` [PATCH 4/7] Input: libps2 - fix NAK handling Dmitry Torokhov
2023-05-18 17:22   ` Raul E Rangel
2023-05-11 18:52 ` [PATCH 5/7] Input: libps2 - fix aborting PS/2 commands Dmitry Torokhov
2023-05-18 17:22   ` Raul E Rangel
2023-05-11 18:52 ` [PATCH 6/7] Input: libps2 - introduce common interrupt handler Dmitry Torokhov
2023-05-12  1:01   ` kernel test robot
2023-05-15  1:52   ` kernel test robot
2023-05-15 23:14   ` [PATCH v2 " Dmitry Torokhov
2023-05-18 17:22   ` [PATCH " Raul E Rangel
2023-05-11 18:52 ` [PATCH 7/7] Input: libps2 - do not discard non-ack bytes when controlling LEDs Dmitry Torokhov
2023-05-18 17:24   ` Raul E Rangel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).