diff options
author | Andrei Warkentin <andreiw@motorola.com> | 2011-03-22 11:37:47 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:37:02 -0800 |
commit | 1acb3ddfeaf05647bae0d9a62ca14c7d2f2d5b9c (patch) | |
tree | 38bb19daf7fe69f9fc55347eb88c6df86841e31e | |
parent | 1fc2db526b66accd344239e168b5186eeb4755ad (diff) |
serial: tegra_hsuart: Make sure current byte rx complete in suspend
Make sure that the last byte has been received by the uart during
suspend after RTS is deasserted.
Change-Id: I3517ec058fdca912ff5ad8770d2b1c5015385385
Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
Signed-off-by: Colin Cross <ccross@android.com>
-rw-r--r-- | drivers/serial/tegra_hsuart.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/serial/tegra_hsuart.c b/drivers/serial/tegra_hsuart.c index a7c7220b854b..b3b8eeaf8cf6 100644 --- a/drivers/serial/tegra_hsuart.c +++ b/drivers/serial/tegra_hsuart.c @@ -599,16 +599,20 @@ static void tegra_stop_rx(struct uart_port *u) set_rts(t, false); if (t->rx_in_progress) { + wait_sym_time(t, 1); /* wait a character interval */ + ier = t->ier_shadow; ier &= ~(UART_IER_RDI | UART_IER_RLSI | UART_IER_RTOIE | UART_IER_EORD); t->ier_shadow = ier; uart_writeb(t, ier, UART_IER); t->rx_in_progress = 0; - } - if (t->use_rx_dma && t->rx_dma) { - if (!tegra_dma_dequeue_req(t->rx_dma, &t->rx_dma_req)) - tegra_rx_dma_complete_req(t, &t->rx_dma_req); + if (t->use_rx_dma && t->rx_dma) { + if (!tegra_dma_dequeue_req(t->rx_dma, &t->rx_dma_req)) + tegra_rx_dma_complete_req(t, &t->rx_dma_req); + } else { + do_handle_rx_pio(t); + } tty_flip_buffer_push(u->state->port.tty); } |