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>
}
/*
- * 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)
{
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;