[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1666074311-12764-2-git-send-email-kkartik@nvidia.com>
Date: Tue, 18 Oct 2022 11:55:11 +0530
From: Kartik <kkartik@...dia.com>
To: <ldewangan@...dia.com>, <gregkh@...uxfoundation.org>,
<jirislaby@...nel.org>, <thierry.reding@...il.com>,
<jonathanh@...dia.com>, <swarren@...dia.com>,
<akhilrajeev@...dia.com>, <linux-serial@...r.kernel.org>,
<linux-tegra@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] serial: tegra: read DMA status before terminating
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@...dia.com>
Signed-off-by: Kartik <kkartik@...dia.com>
---
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);
count = tup->tx_bytes_requested - state.residue;
async_tx_ack(tup->tx_dma_desc);
uart_xmit_advance(&tup->uport, count);
@@ -763,8 +763,8 @@ static void tegra_uart_terminate_rx_dma(struct tegra_uart_port *tup)
return;
}
- dmaengine_terminate_all(tup->rx_dma_chan);
dmaengine_tx_status(tup->rx_dma_chan, tup->rx_cookie, &state);
+ dmaengine_terminate_all(tup->rx_dma_chan);
tegra_uart_rx_buffer_push(tup, state.residue);
tup->rx_dma_active = false;
--
2.17.1
Powered by blists - more mailing lists