]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge 5.5-rc3 into tty-next
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Dec 2019 11:59:19 +0000 (06:59 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Dec 2019 11:59:19 +0000 (06:59 -0500)
We need the tty/serial fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1  2 
drivers/tty/serial/atmel_serial.c
drivers/tty/serial/msm_serial.c
drivers/tty/serial/sprd_serial.c

index 4020fc8ceb4980699700814ccfea800915367a9c,1ba9bc667e13631328c590f484683188e7d74039..fa19eb360ed8490d7a53b4494a1ae4495301d382
  #define ATMEL_RTS_HIGH_OFFSET 16
  #define ATMEL_RTS_LOW_OFFSET  20
  
 -#if defined(CONFIG_SERIAL_ATMEL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 -#define SUPPORT_SYSRQ
 -#endif
 -
  #include <linux/serial_core.h>
  
  #include "serial_mctrl_gpio.h"
@@@ -192,6 -196,10 +192,6 @@@ struct atmel_uart_port 
  static struct atmel_uart_port atmel_ports[ATMEL_MAX_UART];
  static DECLARE_BITMAP(atmel_ports_in_use, ATMEL_MAX_UART);
  
 -#ifdef SUPPORT_SYSRQ
 -static struct console atmel_console;
 -#endif
 -
  #if defined(CONFIG_OF)
  static const struct of_device_id atmel_serial_dt_ids[] = {
        { .compatible = "atmel,at91rm9200-usart-serial" },
@@@ -2262,27 -2270,6 +2262,6 @@@ static void atmel_set_termios(struct ua
                mode |= ATMEL_US_USMODE_NORMAL;
        }
  
-       /* set the mode, clock divisor, parity, stop bits and data size */
-       atmel_uart_writel(port, ATMEL_US_MR, mode);
-       /*
-        * when switching the mode, set the RTS line state according to the
-        * new mode, otherwise keep the former state
-        */
-       if ((old_mode & ATMEL_US_USMODE) != (mode & ATMEL_US_USMODE)) {
-               unsigned int rts_state;
-               if ((mode & ATMEL_US_USMODE) == ATMEL_US_USMODE_HWHS) {
-                       /* let the hardware control the RTS line */
-                       rts_state = ATMEL_US_RTSDIS;
-               } else {
-                       /* force RTS line to low level */
-                       rts_state = ATMEL_US_RTSEN;
-               }
-               atmel_uart_writel(port, ATMEL_US_CR, rts_state);
-       }
        /*
         * Set the baud rate:
         * Fractional baudrate allows to setup output frequency more
  
        if (!(port->iso7816.flags & SER_ISO7816_ENABLED))
                atmel_uart_writel(port, ATMEL_US_BRGR, quot);
+       /* set the mode, clock divisor, parity, stop bits and data size */
+       atmel_uart_writel(port, ATMEL_US_MR, mode);
+       /*
+        * when switching the mode, set the RTS line state according to the
+        * new mode, otherwise keep the former state
+        */
+       if ((old_mode & ATMEL_US_USMODE) != (mode & ATMEL_US_USMODE)) {
+               unsigned int rts_state;
+               if ((mode & ATMEL_US_USMODE) == ATMEL_US_USMODE_HWHS) {
+                       /* let the hardware control the RTS line */
+                       rts_state = ATMEL_US_RTSDIS;
+               } else {
+                       /* force RTS line to low level */
+                       rts_state = ATMEL_US_RTSEN;
+               }
+               atmel_uart_writel(port, ATMEL_US_CR, rts_state);
+       }
        atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX);
        atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN);
        atmel_port->tx_stopped = false;
@@@ -2869,7 -2878,6 +2870,7 @@@ static int atmel_serial_probe(struct pl
        atmel_port = &atmel_ports[ret];
        atmel_port->backup_imr = 0;
        atmel_port->uart.line = ret;
 +      atmel_port->uart.has_sysrq = IS_ENABLED(CONFIG_SERIAL_ATMEL_CONSOLE);
        atmel_serial_probe_fifos(atmel_port, pdev);
  
        atomic_set(&atmel_port->tasklet_shutdown, 0);
index 375d6d3f17b24566ddaa3a261b4dae654b830b26,f6c45a796433de838949ccf8eb4ad5d0ae441ee6..19e897dad5fed745697c9049b936e63cea2dcb8d
@@@ -7,6 -7,10 +7,6 @@@
   * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
   */
  
 -#if defined(CONFIG_SERIAL_MSM_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 -# define SUPPORT_SYSRQ
 -#endif
 -
  #include <linux/kernel.h>
  #include <linux/atomic.h>
  #include <linux/dma-mapping.h>
@@@ -1576,6 -1580,7 +1576,7 @@@ static void __msm_console_write(struct 
        int num_newlines = 0;
        bool replaced = false;
        void __iomem *tf;
+       int locked = 1;
  
        if (is_uartdm)
                tf = port->membase + UARTDM_TF;
                        num_newlines++;
        count += num_newlines;
  
-       spin_lock(&port->lock);
+       if (port->sysrq)
+               locked = 0;
+       else if (oops_in_progress)
+               locked = spin_trylock(&port->lock);
+       else
+               spin_lock(&port->lock);
        if (is_uartdm)
                msm_reset_dm_count(port, count);
  
                iowrite32_rep(tf, buf, 1);
                i += num_chars;
        }
-       spin_unlock(&port->lock);
+       if (locked)
+               spin_unlock(&port->lock);
  }
  
  static void msm_console_write(struct console *co, const char *s,
@@@ -1797,7 -1810,6 +1806,7 @@@ static int msm_serial_probe(struct plat
        if (unlikely(irq < 0))
                return -ENXIO;
        port->irq = irq;
 +      port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MSM_CONSOLE);
  
        platform_set_drvdata(pdev, port);
  
index 0c3b7420b01ec991ebf412ce9740e8efac84ecdb,f60a59d9bf271074dfde293a695ea0d8558e91c9..3d3c70634589e737099393e0abc73b448453fb16
@@@ -3,6 -3,10 +3,6 @@@
   * Copyright (C) 2012-2015 Spreadtrum Communications Inc.
   */
  
 -#if defined(CONFIG_SERIAL_SPRD_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 -#define SUPPORT_SYSRQ
 -#endif
 -
  #include <linux/clk.h>
  #include <linux/console.h>
  #include <linux/delay.h>
@@@ -675,6 -679,9 +675,9 @@@ static irqreturn_t sprd_handle_irq(int 
        if (ims & SPRD_IMSR_TIMEOUT)
                serial_out(port, SPRD_ICLR, SPRD_ICLR_TIMEOUT);
  
+       if (ims & SPRD_IMSR_BREAK_DETECT)
+               serial_out(port, SPRD_ICLR, SPRD_IMSR_BREAK_DETECT);
        if (ims & (SPRD_IMSR_RX_FIFO_FULL | SPRD_IMSR_BREAK_DETECT |
                   SPRD_IMSR_TIMEOUT))
                sprd_rx(port);
@@@ -1223,7 -1230,6 +1226,7 @@@ static int sprd_probe(struct platform_d
        up->fifosize = SPRD_FIFO_SIZE;
        up->ops = &serial_sprd_ops;
        up->flags = UPF_BOOT_AUTOCONF;
 +      up->has_sysrq = IS_ENABLED(CONFIG_SERIAL_SPRD_CONSOLE);
  
        ret = sprd_clk_init(up);
        if (ret)