serial: sirf: fix system hung on console log output
authorQipan Li <Qipan.Li@csr.com>
Tue, 26 May 2015 09:35:58 +0000 (09:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 May 2015 21:51:37 +0000 (06:51 +0900)
commit326707ed88028283cf04d86848a0436cb966b01e
treeec04b40bc8df095fb0009be9ce98e7a8ea6ecfb3
parentba02406e9bee5726a604a4c8628aac56cb076fef
serial: sirf: fix system hung on console log output

A corner case exists in the current driver. if an app opens the console
device, and before writing to console device, and there are huge kernel
ogs to print out, system will hang on
sirfsoc_uart_console_putchar:
while (rd_regl(port, ureg->sirfsoc_tx_fifo_status) &
ufifo_st->ff_full(port->line))
cpu_relax();
as in sirfsoc_uart_startup(), the driver assigns tx_fifo_op to 0 will stop
TX FIFO, this loop will be endless.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sirfsoc_uart.c