aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHuang Shijie <shijie8@gmail.com>2014-09-19 15:33:12 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-28 21:26:38 -0400
commit45564a6656b4944fa90aabd59f8ec082e8f7a969 (patch)
treeed78f64eb2e407b88adbb828a75d2280c15a0169 /drivers
parentserial: imx: fix throttle/unthrottle callbacks for hardware assisted flow control (diff)
downloadlinux-dev-45564a6656b4944fa90aabd59f8ec082e8f7a969.tar.xz
linux-dev-45564a6656b4944fa90aabd59f8ec082e8f7a969.zip
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> Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-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 c7683d747c18..db749f768ac4 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)
struct imx_port *sport = (struct imx_port *)port;
unsigned long temp;
- /*
- * We are maybe in the SMP context, so if the DMA TX thread is running
- * on other cpu, we have to wait for it to finish.
- */
- if (sport->dma_is_enabled && sport->dma_is_rxing)
- return;
+ if (sport->dma_is_enabled && sport->dma_is_rxing) {
+ if (sport->port.suspended) {
+ dmaengine_terminate_all(sport->dma_chan_rx);
+ sport->dma_is_rxing = 0;
+ } else {
+ return;
+ }
+ }
temp = readl(sport->port.membase + UCR2);
writel(temp & ~UCR2_RXEN, sport->port.membase + UCR2);