Input: ps2-gpio - don't send rx data before the stop bit
authorDanilo Krummrich <danilokrummrich@dk-develop.de>
Tue, 15 Feb 2022 22:45:43 +0000 (14:45 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 16 Feb 2022 01:25:39 +0000 (17:25 -0800)
commit81b9fd6941ce6fc4b4127cc184e491adb615182e
treeb93652f1ba89efb64cf521007918b824eb939d3c
parent6283cc9e7785e3df6160dbce4940b3a5925cb728
Input: ps2-gpio - don't send rx data before the stop bit

Sending the data before processing the stop bit from the device already
saves the data of the current xfer in case the stop bit is missed.

However, when TX xfers are enabled this introduces a race condition when
a peripheral driver using the bus immediately requests a TX xfer from IRQ
context.

Therefore the data must be send after receiving the stop bit, although
it is possible the data is lost when missing the stop bit.

Signed-off-by: Danilo Krummrich <danilokrummrich@dk-develop.de>
Link: https://lore.kernel.org/r/20220215160208.34826-5-danilokrummrich@dk-develop.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/serio/ps2-gpio.c