summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPradeep Goudagunta <pgoudagunta@nvidia.com>2013-08-07 15:57:37 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 13:40:05 -0700
commitea3610a26f36637334724a0a08da639f88264e7b (patch)
tree211287e63c82d80e9c1ee14e7a71c426372b23ef /drivers
parentee50ab880b3481a6fe982c67b531c4997fc5aa95 (diff)
serial: tegra: Fix stop_tx
Update tx_circular buffer only when TX_DMA is pending. Bug 1332139 Change-Id: I9d94066ca209c153e92468e544d107b310ddf206 Signed-off-by: Pradeep Goudagunta <pgoudagunta@nvidia.com> Reviewed-on: http://git-master/r/259148 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/tty/serial/serial-tegra.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c
index 7ee455d9c47b..ac9763bb8336 100644
--- a/drivers/tty/serial/serial-tegra.c
+++ b/drivers/tty/serial/serial-tegra.c
@@ -483,12 +483,15 @@ static void tegra_uart_stop_tx(struct uart_port *u)
struct dma_tx_state state;
int count;
- 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;
- async_tx_ack(tup->tx_dma_desc);
- xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1);
- tup->tx_in_progress = 0;
+ if (tup->tx_in_progress == TEGRA_UART_TX_DMA) {
+ 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;
+ async_tx_ack(tup->tx_dma_desc);
+ xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1);
+ tup->tx_in_progress = 0;
+ }
+
return;
}