summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Ryabukhin <vryabukhin@nvidia.com>2011-03-07 18:23:03 +0900
committerVarun Colbert <vcolbert@nvidia.com>2011-03-08 21:06:36 -0800
commitba46e4d1b1a9c29df06baaa1f30442be4c37f99e (patch)
tree4475c258c92966bece6cf97664aea768b437aa85
parent12969307ec39ddaf913b84628d1c192eb2e59dc8 (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 Change-Id: Ia34aba33dd09730c8f91d19e5c103cf1060a357e Reviewed-on: http://git-master/r/21844 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r--drivers/serial/tegra_hsuart.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/serial/tegra_hsuart.c b/drivers/serial/tegra_hsuart.c
index 6c669cb613ec..f57ec8223492 100644
--- a/drivers/serial/tegra_hsuart.c
+++ b/drivers/serial/tegra_hsuart.c
@@ -1113,8 +1113,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)
{
@@ -1124,6 +1124,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;