summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJingchang Lu <b35083@freescale.com>2012-08-14 16:02:02 +0800
committerJason Jin <Jason.jin@freescale.com>2012-08-14 16:26:46 +0800
commite6dc07fa62d4d4a7573b452af04f8b1da4b492a3 (patch)
tree7a94cff9391af7478473dc6597f213d348cf536f
parent8fc693b22fcadc9b722f1480e4cda4e321087218 (diff)
ENGR00220352: Fix reboot hung after set uart baudrate
Signed-off-by: Jingchang Lu <b35083@freescale.com>
-rw-r--r--drivers/tty/serial/mvf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/tty/serial/mvf.c b/drivers/tty/serial/mvf.c
index bd5643b90300..13aa8a9eef8a 100644
--- a/drivers/tty/serial/mvf.c
+++ b/drivers/tty/serial/mvf.c
@@ -751,13 +751,14 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
*/
uart_update_timeout(port, termios->c_cflag, baud);
- /* disable transmit and receive first */
- writeb(old_cr2 & ~(MXC_UARTCR2_TE | MXC_UARTCR2_RE),
- sport->port.membase + MXC_UARTCR2);
/* wait transmit engin complete */
while (!(readb(sport->port.membase + MXC_UARTSR1) & MXC_UARTSR1_TC))
barrier();
+ /* disable transmit and receive */
+ writeb(old_cr2 & ~(MXC_UARTCR2_TE | MXC_UARTCR2_RE),
+ sport->port.membase + MXC_UARTCR2);
+
sbr = sport->port.uartclk / (16 * baud);
brfa = ((sport->port.uartclk - (16 * sbr * baud)) * 2)/baud;