Skip to content
Commit 9c05084c authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by Greg Kroah-Hartman
Browse files

tty: serial: qcom_geni_serial: Fix wrap around of TX buffer

[ Upstream commit 3c66eb4b ]

Before commit a1fee899 ("tty: serial: qcom_geni_serial: Fix
softlock") the size of TX transfers was limited to the TX FIFO size,
and wrap arounds of the UART circular buffer were split into two
transfers. With the commit wrap around are allowed within a transfer.
The TX FIFO of the geni serial port uses a word size of 4 bytes. In
case of a circular buffer wrap within a transfer the driver currently
may write an incomplete word to the FIFO, with some bytes containing
data from the circular buffer and others being zero. Since the
transfer isn't completed yet the zero bytes are sent as if they were
actual data.

Handle wrap arounds of the TX buffer properly and ensure that words
written to the TX FIFO always contain valid data (unless the transfer
is completed).

Fixes: a1fee899

 ("tty: serial: qcom_geni_serial: Fix softlock")
Signed-off-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Reviewed-by: default avatarEvan Green <evgreen@chromium.org>
Tested-by: default avatarRyan Case <ryandcase@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 7f76dcd7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment