aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2014-06-11 01:12:07 -0400
committerHuang Shijie <b32955@freescale.com>2014-06-18 00:58:33 -0400
commita7b22ac7f8c8f766d1df9bb45abeb45af5c66f6b (patch)
tree89643688ab5d5472ca5537851185b0d0e9a2fdaf /drivers/tty/serial
parent5ad668295aeee17b4bae21d8741252a843dce528 (diff)
ENGR00318938-2 serial: imx: terminate the RX DMA when the UART is suspending
When the uart port is suspending, the RX data is useless. So in this case, we can terminate the RX DMA right now. Signed-off-by: Huang Shijie <b32955@freescale.com>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/imx.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 62c0cd5fe7c7..7a33b1d53015 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -436,12 +436,14 @@ static void imx_stop_rx(struct uart_port *port)
436 struct imx_port *sport = (struct imx_port *)port; 436 struct imx_port *sport = (struct imx_port *)port;
437 unsigned long temp; 437 unsigned long temp;
438 438
439 /* 439 if (sport->dma_is_enabled && sport->dma_is_rxing) {
440 * We are maybe in the SMP context, so if the DMA TX thread is running 440 if (sport->port.suspended) {
441 * on other cpu, we have to wait for it to finish. 441 dmaengine_terminate_all(sport->dma_chan_rx);
442 */ 442 sport->dma_is_rxing = 0;
443 if (sport->dma_is_enabled && sport->dma_is_rxing) 443 } else {
444 return; 444 return;
445 }
446 }
445 447
446 temp = readl(sport->port.membase + UCR2); 448 temp = readl(sport->port.membase + UCR2);
447 writel(temp & ~UCR2_RXEN, sport->port.membase + UCR2); 449 writel(temp & ~UCR2_RXEN, sport->port.membase + UCR2);