serial: tegra: update tx_circular buffer only when TX_DMA is in progress
authorPradeep Goudagunta <pgoudagunta@nvidia.com>
Fri, 6 Jun 2014 11:18:08 +0000 (16:48 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2014 22:53:20 +0000 (15:53 -0700)
When channel is require to stop transmit then update the Tx circular
buffer only when DMA based transfer is in progress. If there is no
DMA based transfer then no need to update the Tx buffer.

Signed-off-by: Pradeep Goudagunta <pgoudagunta@nvidia.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial-tegra.c

index d5c2a287b7e760728d0c38e58d08fb2361c670ee..117d8d1382f9fdcaa0a5ccf8194b232b26cf3848 100644 (file)
@@ -482,6 +482,9 @@ static void tegra_uart_stop_tx(struct uart_port *u)
        struct dma_tx_state state;
        int count;
 
+       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);
        count = tup->tx_bytes_requested - state.residue;