summaryrefslogtreecommitdiff
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorVictor Ryabukhin <vryabukhin@nvidia.com>2011-03-07 18:23:03 +0900
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:43:17 -0800
commit3fad3d4755d8b65e5943e9ccb0ba8c29adf6b3e2 (patch)
tree3b8a7660338b2678bca178e2edcfc505329e4894 /drivers/tty/serial
parentc7f42a8b491370aba3f0e4019fe16552f15c02c8 (diff)
tegra hsuart: Clean tx_bytes in tegra_flush_buffer
tx_bytes might contain amount of bytes which should be transmitted after next "tx empty" interrupt. If we clear xmit circular buffer, tx_bytes should also be set to 0, otherwise it will lead to crash in fill_tx_fifo. Bug 794635 Original-Change-Id: Ia34aba33dd09730c8f91d19e5c103cf1060a357e Reviewed-on: http://git-master/r/21844 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R859c45ffc09b0558861536c6f2f64154cd56ea4e
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/tegra_hsuart.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/tty/serial/tegra_hsuart.c b/drivers/tty/serial/tegra_hsuart.c
index 0cb818731d4b..f95bfff57d87 100644
--- a/drivers/tty/serial/tegra_hsuart.c
+++ b/drivers/tty/serial/tegra_hsuart.c
@@ -1110,8 +1110,8 @@ static void tegra_set_termios(struct uart_port *u, struct ktermios *termios,
}
/*
- * Flush any TX data submitted for DMA. Called when the TX circular
- * buffer is reset.
+ * Flush any TX data submitted for DMA and PIO. Called when the
+ * TX circular buffer is reset.
*/
static void tegra_flush_buffer(struct uart_port *u)
{
@@ -1121,6 +1121,8 @@ static void tegra_flush_buffer(struct uart_port *u)
t = container_of(u, struct tegra_uart_port, uport);
+ t->tx_bytes = 0;
+
if (t->use_tx_dma) {
tegra_dma_dequeue_req(t->tx_dma, &t->tx_dma_req);
t->tx_dma_req.size = 0;