mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
serial: tegra: Read DMA status before terminating
[ Upstream commit 109a951a9f1fd8a34ebd1896cbbd5d5cede880a7 ]
Read the DMA status before terminating the DMA, as doing so deletes
the DMA desc.
Also, to get the correct transfer status information, pause the DMA
using dmaengine_pause() before reading the DMA status.
Fixes: e9ea096dd2 ("serial: tegra: add serial driver")
Reviewed-by: Jon Hunter <[email protected]>
Reviewed-by: Ilpo Järvinen <[email protected]>
Acked-by: Thierry Reding <[email protected]>
Signed-off-by: Akhil R <[email protected]>
Signed-off-by: Kartik <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
dcb26ea75d
commit
0c44f584e3
1 changed files with 4 additions and 2 deletions
|
|
@ -613,8 +613,9 @@ 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_pause(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);
|
||||
|
|
@ -753,8 +754,9 @@ static void tegra_uart_terminate_rx_dma(struct tegra_uart_port *tup)
|
|||
if (!tup->rx_dma_active)
|
||||
return;
|
||||
|
||||
dmaengine_terminate_all(tup->rx_dma_chan);
|
||||
dmaengine_pause(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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue