To get the valid data, read DMA status before terminating the DMA. As
dmaengine_terminate_all() deletes the DMA desc.
Fixes: e9ea096dd225 ("serial: tegra: add serial driver")
Signed-off-by: Akhil R <akhilrajeev@xxxxxxxxxx>
Signed-off-by: Kartik <kkartik@xxxxxxxxxx>
---
drivers/tty/serial/serial-tegra.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index b7170cb9a544..2779b4491f02 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -619,8 +619,8 @@ static void tegra_uart_stop_tx(struct uart_port *u)
if (tup->tx_in_progress != TEGRA_UART_TX_DMA)
return;
- dmaengine_terminate_all(tup->tx_dma_chan);
dmaengine_tx_status(tup->tx_dma_chan, tup->tx_cookie, &state);
+ dmaengine_terminate_all(tup->tx_dma_chan);