]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up some 4.9 serial patches I got wrong
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2020 07:26:45 +0000 (09:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2020 07:26:45 +0000 (09:26 +0200)
queue-4.9/serial-uartps-add-a-timeout-to-the-tx-empty-wait.patch
queue-4.9/serial-uartps-wait-for-tx_empty-in-console-setup.patch

index 8ebe5f851b07023ac6549eba38bccb0c431ea982..6e7bdf7f4ef6f2b017a639e613b0621f49df7435 100644 (file)
@@ -17,8 +17,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 ---
- 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 <gregkh@linuxfoundation.org>
  
  /* 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 <gregkh@linuxfoundation.org>
  
        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);
index a974a50599263cd1b89ac475d1e624496d1056ba..612878bb548b9892a01549dedef5e93ccb2a78ec 100644 (file)
@@ -25,7 +25,7 @@ Signed-off-by: Sasha Levin <sashal@kernel.org>
 
 --- 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 <sashal@kernel.org>
  
        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);