MLK-11665 tty: serial: imx: move dma init to .startup() function
authorAndy Duan <fugang.duan@nxp.com>
Tue, 21 Mar 2017 09:22:20 +0000 (17:22 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:21:38 +0000 (15:21 -0500)
Kernel upgrade to 4.1.8 from 4.1.4 has one conflict: commit:3cd6a7db4c2c and
commit:4eede03b97bf, and there introduces one issue during the merge. The issue
cause pio mode cannot work.

The patch fix the error that move the dma init function to .startup().

Signed-off-by: Fugang Duan <B38611@freescale.com>
drivers/tty/serial/imx.c

index 06ca338..07de4de 100644 (file)
@@ -1268,6 +1268,11 @@ static int imx_startup(struct uart_port *port)
        while (!(readl(sport->port.membase + UCR2) & UCR2_SRST) && (--i > 0))
                udelay(1);
 
+       /* Can we enable the DMA support? */
+       if (is_imx6q_uart(sport) && !uart_console(port)
+               && !sport->dma_is_inited)
+               imx_uart_dma_init(sport);
+
        spin_lock_irqsave(&sport->port.lock, flags);
 
        /*
@@ -1473,11 +1478,6 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
                        } else {
                                imx_port_rts_auto(sport, &ucr2);
                        }
-
-                       /* Can we enable the DMA support? */
-                       if (is_imx6q_uart(sport) && !uart_console(port)
-                               && !sport->dma_is_inited)
-                               imx_uart_dma_init(sport);
                } else {
                        termios->c_cflag &= ~CRTSCTS;
                }