From: Johan Hovold <johan+linaro@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>
Cc: Konrad Dybcio <konrad.dybcio@linaro.org>,
Douglas Anderson <dianders@chromium.org>,
Bjorn Andersson <andersson@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org,
Johan Hovold <johan+linaro@kernel.org>,
stable@vger.kernel.org
Subject: [PATCH 3/3] serial: qcom-geni: fix garbage output after buffer flush
Date: Mon, 24 Jun 2024 15:31:35 +0200 [thread overview]
Message-ID: <20240624133135.7445-4-johan+linaro@kernel.org> (raw)
In-Reply-To: <20240624133135.7445-1-johan+linaro@kernel.org>
The Qualcomm GENI serial driver does not handle buffer flushing and
outputs garbage (or NUL) characters for the remainder of any active TX
command after the write buffer has been cleared.
Implement the flush_buffer() callback and use it to cancel any active TX
command when the write buffer has been emptied.
Fixes: a1fee899e5be ("tty: serial: qcom_geni_serial: Fix softlock")
Cc: stable@vger.kernel.org # 5.0
Reported-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
drivers/tty/serial/qcom_geni_serial.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 72addeb9f461..5fbb72f1c0c7 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1084,6 +1084,11 @@ static void qcom_geni_serial_shutdown(struct uart_port *uport)
qcom_geni_serial_clear_tx_fifo(uport);
}
+static void qcom_geni_serial_flush_buffer(struct uart_port *uport)
+{
+ qcom_geni_serial_clear_tx_fifo(uport);
+}
+
static int qcom_geni_serial_port_setup(struct uart_port *uport)
{
struct qcom_geni_serial_port *port = to_dev_port(uport);
@@ -1540,6 +1545,7 @@ static const struct uart_ops qcom_geni_console_pops = {
.request_port = qcom_geni_serial_request_port,
.config_port = qcom_geni_serial_config_port,
.shutdown = qcom_geni_serial_shutdown,
+ .flush_buffer = qcom_geni_serial_flush_buffer,
.type = qcom_geni_serial_get_type,
.set_mctrl = qcom_geni_serial_set_mctrl,
.get_mctrl = qcom_geni_serial_get_mctrl,
--
2.44.1
next prev parent reply other threads:[~2024-06-24 13:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-24 13:31 [PATCH 0/3] serial: qcom-geni: fix lockups Johan Hovold
2024-06-24 13:31 ` [PATCH 1/3] serial: qcom-geni: fix hard lockup on buffer flush Johan Hovold
2024-06-24 17:39 ` Doug Anderson
2024-06-24 20:45 ` Doug Anderson
2024-06-25 14:53 ` Johan Hovold
2024-06-25 16:27 ` Doug Anderson
2024-06-25 14:40 ` Johan Hovold
2024-07-04 9:59 ` Johan Hovold
2024-06-24 13:31 ` [PATCH 2/3] serial: qcom-geni: fix soft lockup on sw flow control and suspend Johan Hovold
2024-06-24 21:23 ` Doug Anderson
2024-06-24 21:58 ` Doug Anderson
2024-06-26 7:54 ` Johan Hovold
2024-07-04 10:08 ` Johan Hovold
2024-06-26 7:42 ` Johan Hovold
2024-06-24 13:31 ` Johan Hovold [this message]
2024-06-24 22:19 ` [PATCH 3/3] serial: qcom-geni: fix garbage output after buffer flush Doug Anderson
2024-06-26 8:01 ` Johan Hovold
2024-07-03 14:09 ` [PATCH 0/3] serial: qcom-geni: fix lockups Greg Kroah-Hartman
2024-07-03 14:13 ` Johan Hovold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240624133135.7445-4-johan+linaro@kernel.org \
--to=johan+linaro@kernel.org \
--cc=andersson@kernel.org \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox