Skip to content

Commit 2ecd118

Browse files
Matthias Fesergregkh
authored andcommitted
serial: 8250_omap: clear rx_running on zero-length DMA completes
commit 061b627 upstream. On AM33xx RX DMA only triggers when the FIFO reaches the configured threshold (typically 48 bytes). For smaller bursts no DMA request is issued and the FIFO is drained by RX timeout. In this case __dma_rx_do_complete() can legitimately see count == 0. The current code exits early in this case and does not clear dma->rx_running, leaving the DMA state inconsistent. This can prevent RX DMA from restarting and may cause omap_8250_rx_dma_flush() to fail, marking DMA as broken. Fix this by clearing dma->rx_running once the DMA transfer has completed or been terminated, even if no data was transferred. Fixes: a5fd894 ("serial: 8250: 8250_omap.c: Clear DMA RX running status only after DMA termination is done") Cc: stable <stable@kernel.org> Signed-off-by: Matthias Feser <mfe@KBSgmbhfr.onmicrosoft.com> Reviewed-by: Moteen Shah <m-shah@ti.com> Link: https://patch.msgid.link/BE3P281MB55155F2F5795E411F5A65282EE0B2@BE3P281MB5515.DEUP281.PROD.OUTLOOK.COM Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c37095c commit 2ecd118

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/tty/serial/8250/8250_omap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,11 +960,12 @@ static void __dma_rx_do_complete(struct uart_8250_port *p)
960960
dev_err(p->port.dev, "teardown incomplete\n");
961961
}
962962
}
963+
964+
dma->rx_running = 0;
963965
if (!count)
964966
goto out;
965967
ret = tty_insert_flip_string(tty_port, dma->rx_buf, count);
966968

967-
dma->rx_running = 0;
968969
p->port.icount.rx += ret;
969970
p->port.icount.buf_overrun += count - ret;
970971
out:

0 commit comments

Comments
 (0)