]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
serial: qcom-geni: fix soft lockup on sw flow control and suspend
authorJohan Hovold <johan+linaro@kernel.org>
Thu, 4 Jul 2024 10:18:03 +0000 (12:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Jul 2024 10:30:30 +0000 (12:30 +0200)
commit947cc4ecc06cb80a2aa2cebbbbf0e546fbaf0238
treee3516d19c2ea6e99b292459f10b2195468f16406
parent1af2156e58f3af1216ce2f0456b3b8949faa5c7e
serial: qcom-geni: fix soft lockup on sw flow control and suspend

The stop_tx() callback is used to implement software flow control and
must not discard data as the Qualcomm GENI driver is currently doing
when there is an active TX command.

Cancelling an active command can also leave data in the hardware FIFO,
which prevents the watermark interrupt from being enabled when TX is
later restarted. This results in a soft lockup and is easily triggered
by stopping TX using software flow control in a serial console but this
can also happen after suspend.

Fix this by only stopping any active command, and effectively clearing
the hardware fifo, when shutting down the port. When TX is later
restarted, a transfer command may need to be issued to discard any stale
data that could prevent the watermark interrupt from firing.

Fixes: c4f528795d1a ("tty: serial: msm_geni_serial: Add serial driver support for GENI based QUP")
Cc: stable@vger.kernel.org # 4.17
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20240704101805.30612-2-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/qcom_geni_serial.c