From: Greg Kroah-Hartman Date: Mon, 27 Apr 2020 07:33:21 +0000 (+0200) Subject: Merge 5.7-rc3 into tty-next X-Git-Tag: v5.8-rc1~107^2~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e947861d0ccbc765af4512a395251e6af6857600;p=thirdparty%2Flinux.git Merge 5.7-rc3 into tty-next We need the tty/serial fixes in here too. Signed-off-by: Greg Kroah-Hartman --- e947861d0ccbc765af4512a395251e6af6857600 diff --cc drivers/tty/serial/xilinx_uartps.c index 042aa6f1c9c4e,ac137b6a1dc12..672cfa075e28f --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@@ -1269,15 -1272,18 +1271,25 @@@ static int cdns_uart_console_setup(stru if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); + /* Wait for tx_empty before setting up the console */ + time_out = jiffies + usecs_to_jiffies(TX_TIMEOUT); + + while (time_before(jiffies, time_out) && + cdns_uart_tx_empty(port) != TIOCSER_TEMT) + cpu_relax(); + return uart_set_options(port, co, baud, parity, bits, flow); } + + static struct console cdns_uart_console = { + .name = CDNS_UART_TTY_NAME, + .write = cdns_uart_console_write, + .device = uart_console_device, + .setup = cdns_uart_console_setup, + .flags = CON_PRINTBUFFER, + .index = -1, /* Specified on the cmdline (e.g. console=ttyPS ) */ + .data = &cdns_uart_uart_driver, + }; #endif /* CONFIG_SERIAL_XILINX_PS_UART_CONSOLE */ #ifdef CONFIG_PM_SLEEP