From: Greg Kroah-Hartman Date: Tue, 29 Sep 2020 07:26:45 +0000 (+0200) Subject: fix up some 4.9 serial patches I got wrong X-Git-Tag: v4.4.238~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0b1a422ecb3a483b454149984ec1d46a9a2538a;p=thirdparty%2Fkernel%2Fstable-queue.git fix up some 4.9 serial patches I got wrong --- diff --git a/queue-4.9/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch b/queue-4.9/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch index 8ebe5f851b0..6e7bdf7f4ef 100644 --- a/queue-4.9/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch +++ b/queue-4.9/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch @@ -17,8 +17,8 @@ Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- - drivers/tty/serial/xilinx_uartps.c | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) + drivers/tty/serial/xilinx_uartps.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -38,7 +38,7 @@ Signed-off-by: Greg Kroah-Hartman /* Rx Trigger level */ static int rx_trigger_level = 56; -@@ -681,7 +683,8 @@ static void cdns_uart_set_termios(struct +@@ -681,16 +683,20 @@ static void cdns_uart_set_termios(struct unsigned int cval = 0; unsigned int baud, minbaud, maxbaud; unsigned long flags; @@ -48,10 +48,12 @@ Signed-off-by: Greg Kroah-Hartman spin_lock_irqsave(&port->lock, flags); -@@ -691,6 +694,12 @@ static void cdns_uart_set_termios(struct - while (!(readl(port->membase + CDNS_UART_SR) & - CDNS_UART_SR_TXEMPTY)) { - cpu_relax(); + /* Wait for the transmit FIFO to empty before making changes */ + if (!(readl(port->membase + CDNS_UART_CR) & + CDNS_UART_CR_TX_DIS)) { +- while (!(readl(port->membase + CDNS_UART_SR) & +- CDNS_UART_SR_TXEMPTY)) { +- cpu_relax(); + err = readl_poll_timeout(port->membase + CDNS_UART_SR, + val, (val & CDNS_UART_SR_TXEMPTY), + 1000, TX_TIMEOUT); diff --git a/queue-4.9/serial-uartps-wait-for-tx_empty-in-console-setup.patch b/queue-4.9/serial-uartps-wait-for-tx_empty-in-console-setup.patch index a974a505992..612878bb548 100644 --- a/queue-4.9/serial-uartps-wait-for-tx_empty-in-console-setup.patch +++ b/queue-4.9/serial-uartps-wait-for-tx_empty-in-console-setup.patch @@ -25,7 +25,7 @@ Signed-off-by: Sasha Levin --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c -@@ -1277,6 +1277,7 @@ static int cdns_uart_console_setup(struc +@@ -1274,6 +1274,7 @@ static int cdns_uart_console_setup(struc int bits = 8; int parity = 'n'; int flow = 'n'; @@ -33,7 +33,7 @@ Signed-off-by: Sasha Levin if (co->index < 0 || co->index >= CDNS_UART_NR_PORTS) return -EINVAL; -@@ -1290,6 +1291,13 @@ static int cdns_uart_console_setup(struc +@@ -1287,6 +1288,13 @@ static int cdns_uart_console_setup(struc if (options) uart_parse_options(options, &baud, &parity, &bits, &flow);