From: Vynnie Von Diktus via B4 Relay <devnull+vyndiktus.gmail.com@kernel.org>
To: linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Vynnie Von Diktus <vyndiktus@gmail.com>
Subject: [PATCH] tty: serial: qcom-geni: re-arm RX DMA on spurious zero-length interrupt
Date: Wed, 22 Apr 2026 16:13:03 +0000 [thread overview]
Message-ID: <20260422-qcom-geni-uart-dma-rearm-v1-1-76d13aac7fdf@gmail.com> (raw)
From: Vynnie Von Diktus <vyndiktus@gmail.com>
qcom_geni_serial_handle_rx_dma() returns early when SE_DMA_RX_LEN_IN
reads as zero, interpreting it as a spurious interrupt. The early return
skips geni_se_rx_dma_prep(), leaving the RX DMA descriptor permanently
unarmed. All subsequently received bytes are silently dropped until the
port is closed and reopened.
On cold boots, chip startup transients on the UART lines can produce a
genuine spurious DMA interrupt with a zero-length count. The bug is
invisible on warm reboots (the UART stays powered and stable, so no
spurious interrupt fires), which makes it appear as an intermittent
failure only on power-cycle reboots.
Fix by restructuring the zero-length check to fall through to
geni_se_rx_dma_prep() in all cases. Only the data processing
(handle_rx_uart) is skipped when no bytes arrived.
Tested on SM8150 (Snapdragon 855) with a WCN3990 BT UART — Bluetooth
firmware download now succeeds on every cold boot without
"Frame reassembly failed" errors.
The same GENI serial IP block is used across SDM845, SM8150, SM8250,
SM8350 and many other Snapdragon SoCs; the bug and fix are expected to
apply to all of them.
Signed-off-by: Vynnie Von Diktus <vyndiktus@gmail.com>
---
drivers/tty/serial/qcom_geni_serial.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index 69a632fef..3c950bdc0 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -837,11 +837,9 @@ static void qcom_geni_serial_handle_rx_dma(struct uart_port *uport, bool drop)
rx_in = readl(uport->membase + SE_DMA_RX_LEN_IN);
if (!rx_in) {
dev_warn(uport->dev, "serial engine reports 0 RX bytes in!\n");
- return;
- }
-
- if (!drop)
+ } else if (!drop) {
handle_rx_uart(uport, rx_in, drop);
+ }
ret = geni_se_rx_dma_prep(&port->se, port->rx_buf,
DMA_RX_BUF_SIZE,
---
base-commit: 4a8d8848356e9e4c41e22de9b1ef1507ea21734a
change-id: 20260422-qcom-geni-uart-dma-rearm-a5df83e164ff
Best regards,
--
Vynnie Von Diktus <vyndiktus@gmail.com>
next reply other threads:[~2026-04-22 16:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 16:13 Vynnie Von Diktus via B4 Relay [this message]
2026-05-11 15:21 ` [PATCH] tty: serial: qcom-geni: re-arm RX DMA on spurious zero-length interrupt Greg KH
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=20260422-qcom-geni-uart-dma-rearm-v1-1-76d13aac7fdf@gmail.com \
--to=devnull+vyndiktus.gmail.com@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=vyndiktus@gmail.com \
/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