diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2010-10-01 13:04:01 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2010-10-20 15:44:30 -0700 |
commit | a01b22145d0cb8fe4092fae4ab3595ab3470502f (patch) | |
tree | 36d520ad0ae3af01ad941ffb9076aaaeeb3e8b42 /drivers | |
parent | 24026696dcd728be545c07fcd3b4bd7e1483c553 (diff) |
[arm/tegra] serial: Stop rx dma only if transfer in progress.
If serial core driver request for the stop rx then dequeue
the dma request and read the rx fifo only if rx is in progress.
Change-Id: I8cd8a75a59773f0195ed876f7faeb89ac0f2cbec
Reviewed-on: http://git-master/r/7579
Reviewed-by: Pradeep Goudagunta <pgoudagunta@nvidia.com>
Tested-by: Pradeep Goudagunta <pgoudagunta@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers')
-rwxr-xr-x | drivers/serial/tegra_hsuart.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/serial/tegra_hsuart.c b/drivers/serial/tegra_hsuart.c index b965a00e6954..61ce3dbb9903 100755 --- a/drivers/serial/tegra_hsuart.c +++ b/drivers/serial/tegra_hsuart.c @@ -636,6 +636,7 @@ static void tegra_stop_rx(struct uart_port *u) { struct tegra_uart_port *t; unsigned char ier; + int read_count; t = container_of(u, struct tegra_uart_port, uport); @@ -652,13 +653,19 @@ static void tegra_stop_rx(struct uart_port *u) t->ier_shadow = ier; uart_writeb(t, ier, UART_IER); t->rx_in_progress = 0; - } - if ((t->use_rx_dma) && !IS_ERR_OR_NULL(t->rx_dma)) { - tegra_dma_dequeue(t->rx_dma); - tty_flip_buffer_push(u->state->port.tty); + /* read data from fifo/dma buffer */ + if ((t->use_rx_dma) && !IS_ERR_OR_NULL(t->rx_dma)) { + /* Wait for complete current burst transfer */ + udelay(100); + tegra_dma_dequeue(t->rx_dma); + tty_flip_buffer_push(u->state->port.tty); + } else { + read_count = do_handle_rx_pio(t); + if (read_count) + tty_flip_buffer_push(u->state->port.tty); + } } - return; } |