Skip to content

Commit 07adbc9

Browse files
vdadhanimukesh-savaliya
authored andcommitted
FROMLIST: serial: qcom_geni: Fix RX DMA stall when SE_DMA_RX_LEN_IN is zero
In qcom_geni_serial_handle_rx_dma(), geni_se_rx_dma_unprep() clears port->rx_dma_addr before SE_DMA_RX_LEN_IN is read. If the register is zero, for example when the RX stale counter fires on an idle line, the handler returns without calling geni_se_rx_dma_prep(). The next RX DMA interrupt then hits the !port->rx_dma_addr guard and returns immediately, so the RX DMA buffer is never rearmed and later input is lost. Keep the handler on the rearm path when rx_in is zero. Warn about the unexpected zero-length DMA completion, skip received-data handling, and always call geni_se_rx_dma_prep(). Link: https://lore.kernel.org/all/20260528-serial-rx-0-byte-fix-v1-1-dc4e876c7368@oss.qualcomm.com/ Fixes: 2aaa43c ("tty: serial: qcom-geni-serial: add support for serial engine DMA") Signed-off-by: Viken Dadhaniya <viken.dadhaniya@oss.qualcomm.com>
1 parent 287f0f5 commit 07adbc9

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

drivers/tty/serial/qcom_geni_serial.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -905,12 +905,9 @@ static void qcom_geni_serial_handle_rx_dma(struct uart_port *uport, bool drop)
905905
port->rx_dma_addr = 0;
906906

907907
rx_in = readl(uport->membase + SE_DMA_RX_LEN_IN);
908-
if (!rx_in) {
909-
dev_warn(uport->dev, "serial engine reports 0 RX bytes in!\n");
910-
return;
911-
}
912-
913-
if (!drop)
908+
if (!rx_in)
909+
dev_warn_ratelimited(uport->dev, "serial engine reports 0 RX bytes in!\n");
910+
else if (!drop)
914911
handle_rx_uart(uport, rx_in);
915912

916913
ret = geni_se_rx_dma_prep(&port->se, port->rx_buf,

0 commit comments

Comments
 (0)