]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge 3.12-rc3 into tty-next
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Sep 2013 01:44:13 +0000 (18:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Sep 2013 01:44:13 +0000 (18:44 -0700)
We want the tty/serial fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 files changed:
drivers/tty/hvc/hvc_dcc.c
drivers/tty/hvc/hvc_vio.c
drivers/tty/n_tty.c
drivers/tty/serial/8250/8250_core.c
drivers/tty/serial/8250/8250_dw.c
drivers/tty/serial/8250/8250_pci.c
drivers/tty/serial/Kconfig
drivers/tty/serial/arc_uart.c
drivers/tty/serial/bfin_sport_uart.c
drivers/tty/serial/bfin_uart.c
drivers/tty/serial/clps711x.c
drivers/tty/serial/ifx6x60.c
drivers/tty/serial/imx.c
drivers/tty/serial/mfd.c
drivers/tty/serial/mpc52xx_uart.c
drivers/tty/serial/mpsc.c
drivers/tty/serial/omap-serial.c
drivers/tty/serial/pch_uart.c
drivers/tty/serial/samsung.c
drivers/tty/serial/samsung.h
drivers/tty/serial/sccnxp.c
drivers/tty/serial/serial_txx9.c
drivers/tty/serial/sirfsoc_uart.c
drivers/tty/tty_port.c
drivers/tty/vt/vt.c
include/linux/tty.h

index 44fbebab5075f98f337d880288993b01ad9e7271..3502a7bbb69eee716f21b5b5b89c14fd3f9627fb 100644 (file)
@@ -86,6 +86,21 @@ static int hvc_dcc_get_chars(uint32_t vt, char *buf, int count)
        return i;
 }
 
+static bool hvc_dcc_check(void)
+{
+       unsigned long time = jiffies + (HZ / 10);
+
+       /* Write a test character to check if it is handled */
+       __dcc_putchar('\n');
+
+       while (time_is_after_jiffies(time)) {
+               if (!(__dcc_getstatus() & DCC_STATUS_TX))
+                       return true;
+       }
+
+       return false;
+}
+
 static const struct hv_ops hvc_dcc_get_put_ops = {
        .get_chars = hvc_dcc_get_chars,
        .put_chars = hvc_dcc_put_chars,
@@ -93,6 +108,9 @@ static const struct hv_ops hvc_dcc_get_put_ops = {
 
 static int __init hvc_dcc_console_init(void)
 {
+       if (!hvc_dcc_check())
+               return -ENODEV;
+
        hvc_instantiate(0, 0, &hvc_dcc_get_put_ops);
        return 0;
 }
@@ -100,6 +118,9 @@ console_initcall(hvc_dcc_console_init);
 
 static int __init hvc_dcc_init(void)
 {
+       if (!hvc_dcc_check())
+               return -ENODEV;
+
        hvc_alloc(0, 0, &hvc_dcc_get_put_ops, 128);
        return 0;
 }
index c791b18cdd086a1fa22b470ba8b9904dd0fc01e3..b594abfbf21e76d58acc1df534a30f603670fb5a 100644 (file)
@@ -48,6 +48,7 @@
 #include <asm/prom.h>
 #include <asm/hvsi.h>
 #include <asm/udbg.h>
+#include <asm/machdep.h>
 
 #include "hvc_console.h"
 
@@ -457,7 +458,9 @@ void __init hvc_vio_init_early(void)
        if (hvterm_priv0.proto == HV_PROTOCOL_HVSI)
                goto out;
 #endif
-       add_preferred_console("hvc", 0, NULL);
+       /* Check whether the user has requested a different console. */
+       if (!strstr(cmd_line, "console="))
+               add_preferred_console("hvc", 0, NULL);
        hvc_instantiate(0, 0, ops);
 out:
        of_node_put(stdout_node);
index 01bf5eb4f2384a66999157ddd855162c8e966f7a..09505ff4fb25b362d38155addce7d601313be591 100644 (file)
@@ -1752,20 +1752,14 @@ int is_ignored(int sig)
 static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
 {
        struct n_tty_data *ldata = tty->disc_data;
-       int canon_change = 1;
 
-       if (old)
-               canon_change = (old->c_lflag ^ tty->termios.c_lflag) & ICANON;
-       if (canon_change) {
+       if (!old || (old->c_lflag ^ tty->termios.c_lflag) & ICANON) {
                bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE);
                ldata->line_start = ldata->canon_head = ldata->read_tail;
                ldata->erasing = 0;
                ldata->lnext = 0;
        }
 
-       if (canon_change && !L_ICANON(tty) && read_cnt(ldata))
-               wake_up_interruptible(&tty->read_wait);
-
        ldata->icanon = (L_ICANON(tty) != 0);
 
        if (I_ISTRIP(tty) || I_IUCLC(tty) || I_IGNCR(tty) ||
@@ -1820,9 +1814,8 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old)
         * Fix tty hang when I_IXON(tty) is cleared, but the tty
         * been stopped by STOP_CHAR(tty) before it.
         */
-       if (!I_IXON(tty) && old && (old->c_iflag & IXON) && !tty->flow_stopped) {
+       if (!I_IXON(tty) && old && (old->c_iflag & IXON) && !tty->flow_stopped)
                start_tty(tty);
-       }
 
        /* The termios change make the tty ready for I/O */
        wake_up_interruptible(&tty->write_wait);
index 570df9d2a5d2f46afc72a23d1e373f2c5aa4f3ba..e33d38cb170f97e4055a0a17eb0f4e7bc0b45d0e 100644 (file)
@@ -2322,7 +2322,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
 
        if (up->capabilities & UART_CAP_FIFO && port->fifosize > 1) {
                fcr = uart_config[port->type].fcr;
-               if (baud < 2400 || fifo_bug) {
+               if ((baud < 2400 && !up->dma) || fifo_bug) {
                        fcr &= ~UART_FCR_TRIGGER_MASK;
                        fcr |= UART_FCR_TRIGGER_1;
                }
index daf710f5c3fc68e0197012ea129edf1a41a7ea14..d04a037d6b6fc11728f3aacbdbc0a2ae7a0bf18a 100644 (file)
 
 
 struct dw8250_data {
-       int             last_lcr;
-       int             last_mcr;
-       int             line;
-       struct clk      *clk;
-       u8              usr_reg;
+       u8                      usr_reg;
+       int                     last_lcr;
+       int                     last_mcr;
+       int                     line;
+       struct clk              *clk;
+       struct uart_8250_dma    dma;
 };
 
 static inline int dw8250_modify_msr(struct uart_port *p, int offset, int value)
@@ -153,6 +154,14 @@ dw8250_do_pm(struct uart_port *port, unsigned int state, unsigned int old)
                pm_runtime_put_sync_suspend(port->dev);
 }
 
+static bool dw8250_dma_filter(struct dma_chan *chan, void *param)
+{
+       struct dw8250_data *data = param;
+
+       return chan->chan_id == data->dma.tx_chan_id ||
+              chan->chan_id == data->dma.rx_chan_id;
+}
+
 static void dw8250_setup_port(struct uart_8250_port *up)
 {
        struct uart_port        *p = &up->port;
@@ -241,7 +250,8 @@ static int dw8250_probe_of(struct uart_port *p,
 }
 
 #ifdef CONFIG_ACPI
-static int dw8250_probe_acpi(struct uart_8250_port *up)
+static int dw8250_probe_acpi(struct uart_8250_port *up,
+                            struct dw8250_data *data)
 {
        const struct acpi_device_id *id;
        struct uart_port *p = &up->port;
@@ -260,9 +270,7 @@ static int dw8250_probe_acpi(struct uart_8250_port *up)
        if (!p->uartclk)
                p->uartclk = (unsigned int)id->driver_data;
 
-       up->dma = devm_kzalloc(p->dev, sizeof(*up->dma), GFP_KERNEL);
-       if (!up->dma)
-               return -ENOMEM;
+       up->dma = &data->dma;
 
        up->dma->rxconf.src_maxburst = p->fifosize / 4;
        up->dma->txconf.dst_maxburst = p->fifosize / 4;
@@ -270,7 +278,8 @@ static int dw8250_probe_acpi(struct uart_8250_port *up)
        return 0;
 }
 #else
-static inline int dw8250_probe_acpi(struct uart_8250_port *up)
+static inline int dw8250_probe_acpi(struct uart_8250_port *up,
+                                   struct dw8250_data *data)
 {
        return -ENODEV;
 }
@@ -314,6 +323,12 @@ static int dw8250_probe(struct platform_device *pdev)
                uart.port.uartclk = clk_get_rate(data->clk);
        }
 
+       data->dma.rx_chan_id = -1;
+       data->dma.tx_chan_id = -1;
+       data->dma.rx_param = data;
+       data->dma.tx_param = data;
+       data->dma.fn = dw8250_dma_filter;
+
        uart.port.iotype = UPIO_MEM;
        uart.port.serial_in = dw8250_serial_in;
        uart.port.serial_out = dw8250_serial_out;
@@ -324,7 +339,7 @@ static int dw8250_probe(struct platform_device *pdev)
                if (err)
                        return err;
        } else if (ACPI_HANDLE(&pdev->dev)) {
-               err = dw8250_probe_acpi(&uart);
+               err = dw8250_probe_acpi(&uart, data);
                if (err)
                        return err;
        } else {
index c810da7c7a8843d452ced857d64863993365b464..d917bbb3048412ed9d3f5fbf5b5cb187bdf033b4 100644 (file)
@@ -1324,6 +1324,120 @@ ce4100_serial_setup(struct serial_private *priv,
        return ret;
 }
 
+#define PCI_DEVICE_ID_INTEL_BYT_UART1  0x0f0a
+#define PCI_DEVICE_ID_INTEL_BYT_UART2  0x0f0c
+
+#define BYT_PRV_CLK                    0x800
+#define BYT_PRV_CLK_EN                 (1 << 0)
+#define BYT_PRV_CLK_M_VAL_SHIFT                1
+#define BYT_PRV_CLK_N_VAL_SHIFT                16
+#define BYT_PRV_CLK_UPDATE             (1 << 31)
+
+#define BYT_GENERAL_REG                        0x808
+#define BYT_GENERAL_DIS_RTS_N_OVERRIDE (1 << 3)
+
+#define BYT_TX_OVF_INT                 0x820
+#define BYT_TX_OVF_INT_MASK            (1 << 1)
+
+static void
+byt_set_termios(struct uart_port *p, struct ktermios *termios,
+               struct ktermios *old)
+{
+       unsigned int baud = tty_termios_baud_rate(termios);
+       unsigned int m = 6912;
+       unsigned int n = 15625;
+       u32 reg;
+
+       /* For baud rates 1M, 2M, 3M and 4M the dividers must be adjusted. */
+       if (baud == 1000000 || baud == 2000000 || baud == 4000000) {
+               m = 64;
+               n = 100;
+
+               p->uartclk = 64000000;
+       } else if (baud == 3000000) {
+               m = 48;
+               n = 100;
+
+               p->uartclk = 48000000;
+       } else {
+               p->uartclk = 44236800;
+       }
+
+       /* Reset the clock */
+       reg = (m << BYT_PRV_CLK_M_VAL_SHIFT) | (n << BYT_PRV_CLK_N_VAL_SHIFT);
+       writel(reg, p->membase + BYT_PRV_CLK);
+       reg |= BYT_PRV_CLK_EN | BYT_PRV_CLK_UPDATE;
+       writel(reg, p->membase + BYT_PRV_CLK);
+
+       /*
+        * If auto-handshake mechanism is not enabled,
+        * disable rts_n override
+        */
+       reg = readl(p->membase + BYT_GENERAL_REG);
+       reg &= ~BYT_GENERAL_DIS_RTS_N_OVERRIDE;
+       if (termios->c_cflag & CRTSCTS)
+               reg |= BYT_GENERAL_DIS_RTS_N_OVERRIDE;
+       writel(reg, p->membase + BYT_GENERAL_REG);
+
+       serial8250_do_set_termios(p, termios, old);
+}
+
+static bool byt_dma_filter(struct dma_chan *chan, void *param)
+{
+       return chan->chan_id == *(int *)param;
+}
+
+static int
+byt_serial_setup(struct serial_private *priv,
+                const struct pciserial_board *board,
+                struct uart_8250_port *port, int idx)
+{
+       struct uart_8250_dma *dma;
+       int ret;
+
+       dma = devm_kzalloc(port->port.dev, sizeof(*dma), GFP_KERNEL);
+       if (!dma)
+               return -ENOMEM;
+
+       switch (priv->dev->device) {
+       case PCI_DEVICE_ID_INTEL_BYT_UART1:
+               dma->rx_chan_id = 3;
+               dma->tx_chan_id = 2;
+               break;
+       case PCI_DEVICE_ID_INTEL_BYT_UART2:
+               dma->rx_chan_id = 5;
+               dma->tx_chan_id = 4;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       dma->rxconf.slave_id = dma->rx_chan_id;
+       dma->rxconf.src_maxburst = 16;
+
+       dma->txconf.slave_id = dma->tx_chan_id;
+       dma->txconf.dst_maxburst = 16;
+
+       dma->fn = byt_dma_filter;
+       dma->rx_param = &dma->rx_chan_id;
+       dma->tx_param = &dma->tx_chan_id;
+
+       ret = pci_default_setup(priv, board, port, idx);
+       port->port.iotype = UPIO_MEM;
+       port->port.type = PORT_16550A;
+       port->port.flags = (port->port.flags | UPF_FIXED_PORT | UPF_FIXED_TYPE);
+       port->port.set_termios = byt_set_termios;
+       port->port.fifosize = 64;
+       port->tx_loadsz = 64;
+       port->dma = dma;
+       port->capabilities = UART_CAP_FIFO | UART_CAP_AFE;
+
+       /* Disable Tx counter interrupts */
+       writel(BYT_TX_OVF_INT_MASK, port->port.membase + BYT_TX_OVF_INT);
+
+       return ret;
+}
+
 static int
 pci_omegapci_setup(struct serial_private *priv,
                      const struct pciserial_board *board,
@@ -1662,6 +1776,20 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = {
                .subdevice      = PCI_ANY_ID,
                .setup          = kt_serial_setup,
        },
+       {
+               .vendor         = PCI_VENDOR_ID_INTEL,
+               .device         = PCI_DEVICE_ID_INTEL_BYT_UART1,
+               .subvendor      = PCI_ANY_ID,
+               .subdevice      = PCI_ANY_ID,
+               .setup          = byt_serial_setup,
+       },
+       {
+               .vendor         = PCI_VENDOR_ID_INTEL,
+               .device         = PCI_DEVICE_ID_INTEL_BYT_UART2,
+               .subvendor      = PCI_ANY_ID,
+               .subdevice      = PCI_ANY_ID,
+               .setup          = byt_serial_setup,
+       },
        /*
         * ITE
         */
@@ -2449,6 +2577,7 @@ enum pci_board_num_t {
        pbn_ADDIDATA_PCIe_4_3906250,
        pbn_ADDIDATA_PCIe_8_3906250,
        pbn_ce4100_1_115200,
+       pbn_byt,
        pbn_omegapci,
        pbn_NETMOS9900_2s_115200,
        pbn_brcm_trumanage,
@@ -3185,6 +3314,13 @@ static struct pciserial_board pci_boards[] = {
                .base_baud      = 921600,
                .reg_shift      = 2,
        },
+       [pbn_byt] = {
+               .flags          = FL_BASE0,
+               .num_ports      = 1,
+               .base_baud      = 2764800,
+               .uart_offset    = 0x80,
+               .reg_shift      = 2,
+       },
        [pbn_omegapci] = {
                .flags          = FL_BASE0,
                .num_ports      = 8,
@@ -3520,8 +3656,6 @@ static void pciserial_remove_one(struct pci_dev *dev)
 {
        struct serial_private *priv = pci_get_drvdata(dev);
 
-       pci_set_drvdata(dev, NULL);
-
        pciserial_remove_ports(priv);
 
        pci_disable_device(dev);
@@ -4848,6 +4982,15 @@ static struct pci_device_id serial_pci_tbl[] = {
        {       PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CE4100_UART,
                PCI_ANY_ID,  PCI_ANY_ID, 0, 0,
                pbn_ce4100_1_115200 },
+       /* Intel BayTrail */
+       {       PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT_UART1,
+               PCI_ANY_ID,  PCI_ANY_ID,
+               PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
+               pbn_byt },
+       {       PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT_UART2,
+               PCI_ANY_ID,  PCI_ANY_ID,
+               PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xff0000,
+               pbn_byt },
 
        /*
         * Cronyx Omega PCI
index febd45cd50273532e99c1a4d790d2690c6ae750d..701ca60076ed80b537fcc32fe8fdce52ea6fd9dc 100644 (file)
@@ -1512,6 +1512,7 @@ config SERIAL_FSL_LPUART_CONSOLE
 config SERIAL_ST_ASC
        tristate "ST ASC serial port support"
        select SERIAL_CORE
+       depends on ARM || COMPILE_TEST
        help
          This driver is for the on-chip Asychronous Serial Controller on
          STMicroelectronics STi SoCs.
index 569872f4c9b848fea0f81eab72dd29865b0ded41..c9f5c9dcc15c48e7a15171db06f957bfe7fc6bfd 100644 (file)
@@ -533,7 +533,7 @@ arc_uart_init_one(struct platform_device *pdev, int dev_id)
        unsigned long *plat_data;
        struct arc_uart_port *uart = &arc_uart_ports[dev_id];
 
-       plat_data = (unsigned long *)dev_get_platdata(&pdev->dev);
+       plat_data = dev_get_platdata(&pdev->dev);
        if (!plat_data)
                return -ENODEV;
 
index 87636cc61a2130db719a4e8d92a277cf2cb52cd3..4f229703328b6e2be09e0cfb111e8e81f8be1c79 100644 (file)
@@ -766,9 +766,8 @@ static int sport_uart_probe(struct platform_device *pdev)
                        return -ENOMEM;
                }
 
-               ret = peripheral_request_list(
-                       (unsigned short *)dev_get_platdata(&pdev->dev),
-                       DRV_NAME);
+               ret = peripheral_request_list(dev_get_platdata(&pdev->dev),
+                                               DRV_NAME);
                if (ret) {
                        dev_err(&pdev->dev,
                                "Fail to request SPORT peripherals\n");
@@ -844,8 +843,7 @@ static int sport_uart_probe(struct platform_device *pdev)
 out_error_unmap:
                iounmap(sport->port.membase);
 out_error_free_peripherals:
-               peripheral_free_list(
-                       (unsigned short *)dev_get_platdata(&pdev->dev));
+               peripheral_free_list(dev_get_platdata(&pdev->dev));
 out_error_free_mem:
                kfree(sport);
                bfin_sport_uart_ports[pdev->id] = NULL;
@@ -864,8 +862,7 @@ static int sport_uart_remove(struct platform_device *pdev)
        if (sport) {
                uart_remove_one_port(&sport_uart_reg, &sport->port);
                iounmap(sport->port.membase);
-               peripheral_free_list(
-                       (unsigned short *)dev_get_platdata(&pdev->dev));
+               peripheral_free_list(dev_get_platdata(&pdev->dev));
                kfree(sport);
                bfin_sport_uart_ports[pdev->id] = NULL;
        }
index 3c75e8e0402831dc5a94dda760a2b31a9c7fd7da..74749a6d3565d2c628d26edad1f13fe95875ec87 100644 (file)
@@ -1240,7 +1240,7 @@ static int bfin_serial_probe(struct platform_device *pdev)
                         */
 #endif
                ret = peripheral_request_list(
-                       (unsigned short *)dev_get_platdata(&pdev->dev),
+                       dev_get_platdata(&pdev->dev),
                        DRIVER_NAME);
                if (ret) {
                        dev_err(&pdev->dev,
@@ -1358,8 +1358,7 @@ static int bfin_serial_probe(struct platform_device *pdev)
 out_error_unmap:
                iounmap(uart->port.membase);
 out_error_free_peripherals:
-               peripheral_free_list(
-                       (unsigned short *)dev_get_platdata(&pdev->dev));
+               peripheral_free_list(dev_get_platdata(&pdev->dev));
 out_error_free_mem:
                kfree(uart);
                bfin_serial_ports[pdev->id] = NULL;
@@ -1377,8 +1376,7 @@ static int bfin_serial_remove(struct platform_device *pdev)
        if (uart) {
                uart_remove_one_port(&bfin_serial_reg, &uart->port);
                iounmap(uart->port.membase);
-               peripheral_free_list(
-                       (unsigned short *)dev_get_platdata(&pdev->dev));
+               peripheral_free_list(dev_get_platdata(&pdev->dev));
                kfree(uart);
                bfin_serial_ports[pdev->id] = NULL;
        }
@@ -1432,8 +1430,8 @@ static int bfin_earlyprintk_probe(struct platform_device *pdev)
                return -ENOENT;
        }
 
-       ret = peripheral_request_list(
-               (unsigned short *)dev_get_platdata(&pdev->dev), DRIVER_NAME);
+       ret = peripheral_request_list(dev_get_platdata(&pdev->dev),
+                                       DRIVER_NAME);
        if (ret) {
                dev_err(&pdev->dev,
                                "fail to request bfin serial peripherals\n");
@@ -1463,8 +1461,7 @@ static int bfin_earlyprintk_probe(struct platform_device *pdev)
        return 0;
 
 out_error_free_peripherals:
-       peripheral_free_list(
-               (unsigned short *)dev_get_platdata(&pdev->dev));
+       peripheral_free_list(dev_get_platdata(&pdev->dev));
 
        return ret;
 }
index 7e4e4088471cea4cbd6a67c49917b5af2540edc2..8d0b994357c856319b2ffae055d1e605a7a40706 100644 (file)
@@ -459,7 +459,6 @@ static int uart_clps711x_probe(struct platform_device *pdev)
        ret = uart_register_driver(&s->uart);
        if (ret) {
                dev_err(&pdev->dev, "Registering UART driver failed\n");
-               devm_clk_put(&pdev->dev, s->uart_clk);
                return ret;
        }
 
@@ -487,7 +486,6 @@ static int uart_clps711x_remove(struct platform_device *pdev)
        for (i = 0; i < UART_CLPS711X_NR; i++)
                uart_remove_one_port(&s->uart, &s->port[i]);
 
-       devm_clk_put(&pdev->dev, s->uart_clk);
        uart_unregister_driver(&s->uart);
 
        return 0;
index af286e6713eb914ccf30f334b69706a6510b1b97..590390970996b78fb9f274bae440625f433c7a8b 100644 (file)
@@ -1008,7 +1008,7 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
                return -ENODEV;
        }
 
-       pl_data = (struct ifx_modem_platform_data *)dev_get_platdata(&spi->dev);
+       pl_data = dev_get_platdata(&spi->dev);
        if (!pl_data) {
                dev_err(&spi->dev, "missing platform data!");
                return -ENODEV;
index a0ebbc9ce5cdbacc69cc8c240f8d9fd76e43ec12..c07d9bb39695c999358f3c0c35eb51f5675a9260 100644 (file)
@@ -1539,7 +1539,7 @@ imx_verify_port(struct uart_port *port, struct serial_struct *ser)
                ret = -EINVAL;
        if (sport->port.uartclk / 16 != ser->baud_base)
                ret = -EINVAL;
-       if ((void *)sport->port.mapbase != ser->iomem_base)
+       if (sport->port.mapbase != (unsigned long)ser->iomem_base)
                ret = -EINVAL;
        if (sport->port.iobase != ser->port)
                ret = -EINVAL;
@@ -1913,7 +1913,8 @@ static int serial_imx_probe_dt(struct imx_port *sport,
        sport->devdata = of_id->data;
 
        if (of_device_is_stdout_path(np))
-               add_preferred_console(imx_reg.cons->name, sport->port.line, 0);
+               add_preferred_console(imx_reg.cons->name, sport->port.line,
+                                     NULL);
 
        return 0;
 }
index d3db042f649eda154bdbe1e7feb81dc5822f8653..503dcc77b2bd1285a8c3ae79e1ac6384b0392dbd 100644 (file)
@@ -1451,7 +1451,6 @@ static void serial_hsu_remove(struct pci_dev *pdev)
                uart_remove_one_port(&serial_hsu_reg, &up->port);
        }
 
-       pci_set_drvdata(pdev, NULL);
        free_irq(pdev->irq, priv);
        pci_disable_device(pdev);
 }
@@ -1504,4 +1503,4 @@ module_init(hsu_pci_init);
 module_exit(hsu_pci_exit);
 
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:medfield-hsu");
+MODULE_DEVICE_TABLE(pci, pci_ids);
index 5be1df39f9f5f6b8fe0671bba23ba8f566e685f4..e05a3b1a87c74f6a045f69baf0c1fff6ad18c14c 100644 (file)
@@ -1766,7 +1766,7 @@ mpc52xx_uart_of_remove(struct platform_device *op)
 static int
 mpc52xx_uart_of_suspend(struct platform_device *op, pm_message_t state)
 {
-       struct uart_port *port = (struct uart_port *) platform_get_drvdata(op);
+       struct uart_port *port = platform_get_drvdata(op);
 
        if (port)
                uart_suspend_port(&mpc52xx_uart_driver, port);
@@ -1777,7 +1777,7 @@ mpc52xx_uart_of_suspend(struct platform_device *op, pm_message_t state)
 static int
 mpc52xx_uart_of_resume(struct platform_device *op)
 {
-       struct uart_port *port = (struct uart_port *) platform_get_drvdata(op);
+       struct uart_port *port = platform_get_drvdata(op);
 
        if (port)
                uart_resume_port(&mpc52xx_uart_driver, port);
index 8d702677acc5911c002134f85236090eeb793d10..e30a3ca3cea39f8b34765401e1fad569265f7ebb 100644 (file)
@@ -2030,7 +2030,7 @@ static void mpsc_drv_get_platform_data(struct mpsc_port_info *pi,
 {
        struct mpsc_pdata       *pdata;
 
-       pdata = (struct mpsc_pdata *)dev_get_platdata(&pd->dev);
+       pdata = dev_get_platdata(&pd->dev);
 
        pi->port.uartclk = pdata->brg_clk_freq;
        pi->port.iotype = UPIO_MEM;
index 816d1a23f9d0ef725318afbf01448aa587a3371c..7b00520624f9a2cc2b0bbe478a14843a715b7687 100644 (file)
@@ -247,7 +247,7 @@ serial_omap_baud_is_mode16(struct uart_port *port, unsigned int baud)
        if(baudAbsDiff16 < 0)
                baudAbsDiff16 = -baudAbsDiff16;
 
-       return (baudAbsDiff13 > baudAbsDiff16);
+       return (baudAbsDiff13 >= baudAbsDiff16);
 }
 
 /*
@@ -258,13 +258,13 @@ serial_omap_baud_is_mode16(struct uart_port *port, unsigned int baud)
 static unsigned int
 serial_omap_get_divisor(struct uart_port *port, unsigned int baud)
 {
-       unsigned int divisor;
+       unsigned int mode;
 
        if (!serial_omap_baud_is_mode16(port, baud))
-               divisor = 13;
+               mode = 13;
        else
-               divisor = 16;
-       return port->uartclk/(baud * divisor);
+               mode = 16;
+       return port->uartclk/(mode * baud);
 }
 
 static void serial_omap_enable_ms(struct uart_port *port)
index 44077c0b7670075625650c9d00cc98a63bb90f5c..87f25def0b4105e3d1053dd11c166477bfa5c270 100644 (file)
@@ -1996,6 +1996,8 @@ module_exit(pch_uart_module_exit);
 
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("Intel EG20T PCH UART PCI Driver");
+MODULE_DEVICE_TABLE(pci, pch_uart_pci_id);
+
 module_param(default_baud, uint, S_IRUGO);
 MODULE_PARM_DESC(default_baud,
                  "Default BAUD for initial driver state and console (default 9600)");
index f3dfa19a1cb86eb4c8dd0b47ea8f23b8bab5f0e8..c1af04d46682657794b4893f3eac571a13acc685 100644 (file)
@@ -407,7 +407,14 @@ static unsigned int s3c24xx_serial_get_mctrl(struct uart_port *port)
 
 static void s3c24xx_serial_set_mctrl(struct uart_port *port, unsigned int mctrl)
 {
-       /* todo - possibly remove AFC and do manual CTS */
+       unsigned int umcon = rd_regl(port, S3C2410_UMCON);
+
+       if (mctrl & TIOCM_RTS)
+               umcon |= S3C2410_UMCOM_RTS_LOW;
+       else
+               umcon &= ~S3C2410_UMCOM_RTS_LOW;
+
+       wr_regl(port, S3C2410_UMCON, umcon);
 }
 
 static void s3c24xx_serial_break_ctl(struct uart_port *port, int break_state)
@@ -774,8 +781,6 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
        if (termios->c_cflag & CSTOPB)
                ulcon |= S3C2410_LCON_STOPB;
 
-       umcon = (termios->c_cflag & CRTSCTS) ? S3C2410_UMCOM_AFC : 0;
-
        if (termios->c_cflag & PARENB) {
                if (termios->c_cflag & PARODD)
                        ulcon |= S3C2410_LCON_PODD;
@@ -792,6 +797,15 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
 
        wr_regl(port, S3C2410_ULCON, ulcon);
        wr_regl(port, S3C2410_UBRDIV, quot);
+
+       umcon = rd_regl(port, S3C2410_UMCON);
+       if (termios->c_cflag & CRTSCTS) {
+               umcon |= S3C2410_UMCOM_AFC;
+               /* Disable RTS when RX FIFO contains 63 bytes */
+               umcon &= ~S3C2412_UMCON_AFC_8;
+       } else {
+               umcon &= ~S3C2410_UMCOM_AFC;
+       }
        wr_regl(port, S3C2410_UMCON, umcon);
 
        if (ourport->info->has_divslot)
@@ -1254,7 +1268,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
        ourport->baudclk = ERR_PTR(-EINVAL);
        ourport->info = ourport->drv_data->info;
        ourport->cfg = (dev_get_platdata(&pdev->dev)) ?
-                       (struct s3c2410_uartcfg *)dev_get_platdata(&pdev->dev) :
+                       dev_get_platdata(&pdev->dev) :
                        ourport->drv_data->def_cfg;
 
        ourport->port.fifosize = (ourport->info->fifosize) ?
index aaa617a6c4995e1d978ed88ab33878f232ba8b97..8827e5424cef7d13420114650bdcfa19cad91ea0 100644 (file)
@@ -63,7 +63,7 @@ struct s3c24xx_uart_port {
 
 /* conversion functions */
 
-#define s3c24xx_dev_to_port(__dev) (struct uart_port *)dev_get_drvdata(__dev)
+#define s3c24xx_dev_to_port(__dev) dev_get_drvdata(__dev)
 
 /* register access controls */
 
index 49e9bbfe6cab525454c5b4337b741cbd5fcafcd0..a447f71538ef2c07d77fa92f69247559fa83ebf1 100644 (file)
@@ -986,6 +986,7 @@ static int sccnxp_probe(struct platform_device *pdev)
                return 0;
        }
 
+       uart_unregister_driver(&s->uart);
 err_out:
        if (!IS_ERR(s->regulator))
                return regulator_disable(s->regulator);
index 440a962412da9251c10aa60ee6cf25cf2624474a..90a080b1f9ee13cd78d6647245ee91eb1c710da4 100644 (file)
@@ -1220,8 +1220,6 @@ static void pciserial_txx9_remove_one(struct pci_dev *dev)
 {
        struct uart_txx9_port *up = pci_get_drvdata(dev);
 
-       pci_set_drvdata(dev, NULL);
-
        if (up) {
                serial_txx9_unregister_port(up->port.line);
                pci_disable_device(dev);
index 61c1ad03db5b0159d6b7735838a2a0cb800d7bbd..f186a8fb8887119cd036625a129f515bb57f4210 100644 (file)
@@ -529,7 +529,7 @@ static void sirfsoc_rx_tmo_process_tl(unsigned long param)
        while (sirfport->rx_completed != sirfport->rx_issued) {
                sirfsoc_uart_insert_rx_buf_to_tty(sirfport,
                                        SIRFSOC_RX_DMA_BUF_SIZE);
-               sirfsoc_rx_submit_one_dma_desc(port, sirfport->rx_completed++);
+               sirfport->rx_completed++;
                sirfport->rx_completed %= SIRFSOC_RX_LOOP_BUF_CNT;
        }
        count = CIRC_CNT(sirfport->rx_dma_items[sirfport->rx_issued].xmit.head,
@@ -706,12 +706,19 @@ static void sirfsoc_uart_rx_dma_complete_tl(unsigned long param)
 {
        struct sirfsoc_uart_port *sirfport = (struct sirfsoc_uart_port *)param;
        struct uart_port *port = &sirfport->port;
+       struct sirfsoc_register *ureg = &sirfport->uart_reg->uart_reg;
+       struct sirfsoc_int_en *uint_en = &sirfport->uart_reg->uart_int_en;
        unsigned long flags;
        spin_lock_irqsave(&sirfport->rx_lock, flags);
        while (sirfport->rx_completed != sirfport->rx_issued) {
                sirfsoc_uart_insert_rx_buf_to_tty(sirfport,
                                        SIRFSOC_RX_DMA_BUF_SIZE);
-               sirfsoc_rx_submit_one_dma_desc(port, sirfport->rx_completed++);
+               if (rd_regl(port, ureg->sirfsoc_int_en_reg) &
+                               uint_en->sirfsoc_rx_timeout_en)
+                       sirfsoc_rx_submit_one_dma_desc(port,
+                                       sirfport->rx_completed++);
+               else
+                       sirfport->rx_completed++;
                sirfport->rx_completed %= SIRFSOC_RX_LOOP_BUF_CNT;
        }
        spin_unlock_irqrestore(&sirfport->rx_lock, flags);
index f597e88a705d1fa8e65cf36ae98a61f84f20b9a3..c94d2349dd0620dd183645ee37ddced4551e9ccd 100644 (file)
@@ -140,6 +140,10 @@ EXPORT_SYMBOL(tty_port_destroy);
 static void tty_port_destructor(struct kref *kref)
 {
        struct tty_port *port = container_of(kref, struct tty_port, kref);
+
+       /* check if last port ref was dropped before tty release */
+       if (WARN_ON(port->itty))
+               return;
        if (port->xmit_buf)
                free_page((unsigned long)port->xmit_buf);
        tty_port_destroy(port);
@@ -480,8 +484,6 @@ int tty_port_close_start(struct tty_port *port,
 
        if (port->count) {
                spin_unlock_irqrestore(&port->lock, flags);
-               if (port->ops->drop)
-                       port->ops->drop(port);
                return 0;
        }
        set_bit(ASYNCB_CLOSING, &port->flags);
@@ -500,9 +502,7 @@ int tty_port_close_start(struct tty_port *port,
        /* Flush the ldisc buffering */
        tty_ldisc_flush(tty);
 
-       /* Don't call port->drop for the last reference. Callers will want
-          to drop the last active reference in ->shutdown() or the tty
-          shutdown path */
+       /* Report to caller this is the last port reference */
        return 1;
 }
 EXPORT_SYMBOL(tty_port_close_start);
index 9a8e8c5a0c73a93420fc71b85637db4d510ae241..61b1137d7e56d877fad8b2339c368cd09a5419e1 100644 (file)
@@ -1300,21 +1300,30 @@ static void csi_m(struct vc_data *vc)
                        case 27:
                                vc->vc_reverse = 0;
                                break;
-                       case 38: /* ANSI X3.64-1979 (SCO-ish?)
-                                 * Enables underscore, white foreground
-                                 * with white underscore (Linux - use
-                                 * default foreground).
+                       case 38:
+                       case 48: /* ITU T.416
+                                 * Higher colour modes.
+                                 * They break the usual properties of SGR codes
+                                 * and thus need to be detected and ignored by
+                                 * hand.  Strictly speaking, that standard also
+                                 * wants : rather than ; as separators, contrary
+                                 * to ECMA-48, but no one produces such codes
+                                 * and almost no one accepts them.
                                  */
-                               vc->vc_color = (vc->vc_def_color & 0x0f) | (vc->vc_color & 0xf0);
-                               vc->vc_underline = 1;
+                               i++;
+                               if (i > vc->vc_npar)
+                                       break;
+                               if (vc->vc_par[i] == 5)      /* 256 colours */
+                                       i++;                 /* ubiquitous */
+                               else if (vc->vc_par[i] == 2) /* 24 bit colours */
+                                       i += 3;              /* extremely rare */
+                               /* Subcommands 3 (CMY) and 4 (CMYK) are so insane
+                                * that detecting them is not worth the few extra
+                                * bytes of kernel's size.
+                                */
                                break;
-                       case 39: /* ANSI X3.64-1979 (SCO-ish?)
-                                 * Disable underline option.
-                                 * Reset colour to default? It did this
-                                 * before...
-                                 */
+                       case 39:
                                vc->vc_color = (vc->vc_def_color & 0x0f) | (vc->vc_color & 0xf0);
-                               vc->vc_underline = 0;
                                break;
                        case 49:
                                vc->vc_color = (vc->vc_def_color & 0xf0) | (vc->vc_color & 0x0f);
index 64f864651d8696aa5cf8a93b931c78c06a23bfdc..2f47989d8288b2fce1c0e000a1020cecb9b73f54 100644 (file)
@@ -180,7 +180,6 @@ struct tty_port_operations {
           IFF the port was initialized. Do not use to free resources. Called
           under the port mutex to serialize against activate/shutdowns */
        void (*shutdown)(struct tty_port *port);
-       void (*drop)(struct tty_port *port);
        /* Called under the port mutex from tty_port_open, serialized using
           the port mutex */
         /* FIXME: long term getting the tty argument *out* of this would be