From c158e9a5b00edc6abfbfeab31236e382ae59bbc0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Thu, 13 Jan 2011 16:50:50 +0800 Subject: [PATCH] serial: rk29: rk29_console_setup add clear rx fifo --- drivers/serial/rk29_serial.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/serial/rk29_serial.c b/drivers/serial/rk29_serial.c index bd1fe6b515c7..8d896509cc7a 100755 --- a/drivers/serial/rk29_serial.c +++ b/drivers/serial/rk29_serial.c @@ -40,7 +40,7 @@ #if 0 #define DBG printk #else -#define DBG +#define DBG(...) #endif /* * We wrap our port structure around the generic uart_port. @@ -630,6 +630,10 @@ static int __init rk29_console_setup(struct console *co, char *options) printk(KERN_INFO "rk29_serial: console setup on port %d\n", port->line); + /* clear rx fifo, else will blocked on set_termios (always busy) */ + while ((rk29_uart_read(port, UART_USR) & UART_RECEIVE_FIFO_NOT_EMPTY) == UART_RECEIVE_FIFO_NOT_EMPTY) + rk29_uart_read(port, UART_RBR); + return uart_set_options(port, co, baud, parity, bits, flow); } -- 2.34.1