Skip to content

libps2: be more tolerant when processing commands

Dmitry Torokhov linux-input lkml llvm oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7Input: libps2 - attach ps2dev instances as serio port's drvdatadrivers/input/keyboard/atkbd.c drivers/input/mouse/psmouse-base.c drivers/input/mouse/psmouse.h +3 more+44 -291 reply
2/7Input: libps2 - remove special handling of ACK for command bytedrivers/input/serio/libps2.c include/linux/libps2.h+2 -81 reply
3/7Input: libps2 - rework handling of command responsedrivers/input/serio/libps2.c+10 -81 reply
4/7Input: libps2 - fix NAK handlingdrivers/input/serio/libps2.c+1 -11 reply
5/7Input: libps2 - fix aborting PS/2 commandsdrivers/input/serio/libps2.c+11 -41 reply
6/7Input: libps2 - introduce common interrupt handlerdrivers/input/keyboard/atkbd.c drivers/input/mouse/psmouse-base.c drivers/input/serio/libps2.c +1 more+259 -1542 replies
7/7Input: libps2 - do not discard non-ack bytes when controlling LEDsdrivers/input/serio/libps2.c+32 -41 reply

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchRaul Rangel
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/7] libps2: be more tolerant when processing commands

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(-)
Signature · 1 line
Dmitry