Skip to content

Commit 7e11577

Browse files
lynxeye-devgregkh
authored andcommitted
serial: imx: re-enable DMA support without hardware flow control
The commit enabling DMA support even if no flow control is present was reverted on the grounds that it uncovered a number of bugs in the code that lead to hanging tty devices and/or missing characters. After tracking down the issues it is clear that those were generic bugs and had nothing to do with flow control being present or not, only that allowing DMA without hardware flow control increased the exposure of that code a lot. Now that those bugs are fixed, it should be safe to re-enable DMA support. Signed-off-by: Lucas Stach <[email protected]> Acked-by: Jiada Wang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 905c0de commit 7e11577

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drivers/tty/serial/imx.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,11 @@ static int imx_startup(struct uart_port *port)
11251125

11261126
writel(temp & ~UCR4_DREN, sport->port.membase + UCR4);
11271127

1128+
/* Can we enable the DMA support? */
1129+
if (is_imx6q_uart(sport) && !uart_console(port) &&
1130+
!sport->dma_is_inited)
1131+
imx_uart_dma_init(sport);
1132+
11281133
spin_lock_irqsave(&sport->port.lock, flags);
11291134
/* Reset fifo's and state machines */
11301135
i = 100;
@@ -1142,6 +1147,9 @@ static int imx_startup(struct uart_port *port)
11421147
writel(USR1_RTSD, sport->port.membase + USR1);
11431148
writel(USR2_ORE, sport->port.membase + USR2);
11441149

1150+
if (sport->dma_is_inited && !sport->dma_is_enabled)
1151+
imx_enable_dma(sport);
1152+
11451153
temp = readl(sport->port.membase + UCR1);
11461154
temp |= UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN;
11471155

@@ -1312,11 +1320,6 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
13121320
} else {
13131321
ucr2 |= UCR2_CTSC;
13141322
}
1315-
1316-
/* Can we enable the DMA support? */
1317-
if (is_imx6q_uart(sport) && !uart_console(port)
1318-
&& !sport->dma_is_inited)
1319-
imx_uart_dma_init(sport);
13201323
} else {
13211324
termios->c_cflag &= ~CRTSCTS;
13221325
}
@@ -1433,8 +1436,6 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
14331436
if (UART_ENABLE_MS(&sport->port, termios->c_cflag))
14341437
imx_enable_ms(&sport->port);
14351438

1436-
if (sport->dma_is_inited && !sport->dma_is_enabled)
1437-
imx_enable_dma(sport);
14381439
spin_unlock_irqrestore(&sport->port.lock, flags);
14391440
}
14401441

0 commit comments

Comments
 (0)