mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
serial: imx: get rid of unbounded busy-waiting loop
imx_set_termios(): remove busy-waiting "drain Tx FIFO" loop. Worse yet, it was potentially unbounded wait due to RTS/CTS (hardware) handshake. Let user space ensure draining is done before termios change, if draining is needed in the first place. Signed-off-by: Sergey Organov <sorganov@gmail.com> Link: https://lore.kernel.org/r/1567017475-11919-2-git-send-email-sorganov@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8016c3da0c
commit
2eda5345e4
1 changed files with 1 additions and 4 deletions
|
@ -1644,7 +1644,7 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios,
|
|||
uart_update_timeout(port, termios->c_cflag, baud);
|
||||
|
||||
/*
|
||||
* disable interrupts and drain transmitter
|
||||
* disable interrupts
|
||||
*/
|
||||
old_ucr1 = imx_uart_readl(sport, UCR1);
|
||||
imx_uart_writel(sport,
|
||||
|
@ -1652,9 +1652,6 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios,
|
|||
UCR1);
|
||||
imx_uart_writel(sport, old_ucr2 & ~UCR2_ATEN, UCR2);
|
||||
|
||||
while (!(imx_uart_readl(sport, USR2) & USR2_TXDC))
|
||||
barrier();
|
||||
|
||||
/* then, disable everything */
|
||||
imx_uart_writel(sport, old_ucr2 & ~(UCR2_TXEN | UCR2_RXEN | UCR2_ATEN), UCR2);
|
||||
|
||||
|
|
Loading…
Reference in a new issue