From b86ac225037900963b1203344e5d129f5af6bbd2 Mon Sep 17 00:00:00 2001 From: Yixun Lan Date: Wed, 6 Sep 2017 21:52:39 +0800 Subject: serial: meson: add Magic SysRq support This dirver try to implement the Magic SysRq support[1] for Amlogic Inc's meson platfo >From the hardware perspective, the UART IP can't detect the 'BREAK' command clearly via the status register. Instead, we rely on the combination of 'FRAME_ERR bit && ch == 0', and it works fine. [1] Documentation/admin-guide/sysrq.rst Signed-off-by: Yixun Lan Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index 07c0f98..95d242a 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -14,6 +14,10 @@ * */ +#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +#define SUPPORT_SYSRQ +#endif + #include #include #include @@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port) { struct tty_port *tport = &port->state->port; char flag; - u32 status, ch, mode; + u32 ostatus, status, ch, mode; do { flag = TTY_NORMAL; port->icount.rx++; - status = readl(port->membase + AML_UART_STATUS); + ostatus = status = readl(port->membase + AML_UART_STATUS); if (status & AML_UART_ERR) { if (status & AML_UART_TX_FIFO_WERR) @@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port) ch = readl(port->membase + AML_UART_RFIFO); ch &= 0xff; + if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) { + port->icount.brk++; + flag = TTY_BREAK; + if (uart_handle_break(port)) + continue; + } + + if (uart_handle_sysrq_char(port, ch)) + continue; + if ((status & port->ignore_status_mask) == 0) tty_insert_flip_char(tport, ch, flag); -- cgit v1.1 From 1926e5d37bf8488e9b129abfdfab4c49598c9ee9 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Fri, 8 Sep 2017 08:59:42 +0200 Subject: ttyport: trivial fix for some typo in comments Fix some minor typo spotted in comments: - s/wit ha/with a/ - s/doestroyed/destroyed/ Signed-off-by: Antonio Borneo Signed-off-by: Greg Kroah-Hartman --- drivers/tty/tty_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index 6b13719..1286f24 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -78,7 +78,7 @@ EXPORT_SYMBOL(tty_port_init); * @driver: tty_driver for this device * @index: index of the tty * - * Provide the tty layer wit ha link from a tty (specified by @index) to a + * Provide the tty layer with a link from a tty (specified by @index) to a * tty_port (@port). Use this only if neither tty_port_register_device nor * tty_port_install is used in the driver. If used, this has to be called before * tty_register_driver. @@ -235,7 +235,7 @@ EXPORT_SYMBOL(tty_port_free_xmit_buf); /** * tty_port_destroy -- destroy inited port - * @port: tty port to be doestroyed + * @port: tty port to be destroyed * * When a port was initialized using tty_port_init, one has to destroy the * port by this function. Either indirectly by using tty_port refcounting -- cgit v1.1 From a9be92706edbebde6c50dac7e8e0d3f20ef151aa Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Thu, 14 Sep 2017 01:34:58 +0530 Subject: tty: serial: make sport_uart_ops static and const Make this const as it is only stored in the const field 'ops' of an uart_port structure. It is not referenced in any other file and therefore make it static too. Done using Coccinelle. Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/bfin_sport_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/bfin_sport_uart.c b/drivers/tty/serial/bfin_sport_uart.c index 6b03fb1..6525378 100644 --- a/drivers/tty/serial/bfin_sport_uart.c +++ b/drivers/tty/serial/bfin_sport_uart.c @@ -584,7 +584,7 @@ static void sport_set_termios(struct uart_port *port, spin_unlock_irqrestore(&up->port.lock, flags); } -struct uart_ops sport_uart_ops = { +static const struct uart_ops sport_uart_ops = { .tx_empty = sport_tx_empty, .set_mctrl = sport_set_mctrl, .get_mctrl = sport_get_mctrl, -- cgit v1.1 From f0a8d84fa1140a1c10bfcf0fb73664a85551512e Mon Sep 17 00:00:00 2001 From: Thomas Meyer Date: Sat, 16 Sep 2017 10:03:05 +0200 Subject: vt: Use bsearch library function in is_double_width Use bsearch library function instead of duplicated functionality. Signed-off-by: Thomas Meyer Signed-off-by: Greg Kroah-Hartman --- drivers/tty/vt/vt.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 2ebaba1..ca55004 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -102,6 +102,7 @@ #include #include #include +#include #define MAX_NR_CON_DRIVER 16 @@ -2142,22 +2143,15 @@ struct interval { uint32_t last; }; -static int bisearch(uint32_t ucs, const struct interval *table, int max) +static int ucs_cmp(const void *key, const void *elt) { - int min = 0; - int mid; + uint32_t ucs = *(uint32_t *)key; + struct interval e = *(struct interval *) elt; - if (ucs < table[0].first || ucs > table[max].last) - return 0; - while (max >= min) { - mid = (min + max) / 2; - if (ucs > table[mid].last) - min = mid + 1; - else if (ucs < table[mid].first) - max = mid - 1; - else - return 1; - } + if (ucs > e.last) + return 1; + else if (ucs < e.first) + return -1; return 0; } @@ -2169,7 +2163,12 @@ static int is_double_width(uint32_t ucs) { 0xFE10, 0xFE19 }, { 0xFE30, 0xFE6F }, { 0xFF00, 0xFF60 }, { 0xFFE0, 0xFFE6 }, { 0x20000, 0x2FFFD }, { 0x30000, 0x3FFFD } }; - return bisearch(ucs, double_width, ARRAY_SIZE(double_width) - 1); + if (ucs < double_width[0].first || + ucs > double_width[ARRAY_SIZE(double_width) - 1].last) + return 0; + + return bsearch(&ucs, double_width, ARRAY_SIZE(double_width), + sizeof(struct interval), ucs_cmp) != NULL; } static void con_flush(struct vc_data *vc, unsigned long draw_from, -- cgit v1.1 From 556c27806071d61e2b2e6da7c0a77b1efa4cd832 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sun, 17 Sep 2017 21:10:14 +0200 Subject: tty: synclink: Reuse an existing error handling path In order to avoid code duplication and to be more consistent with the other error handling paths in this function, we should 'goto errout'. Signed-off-by: Christophe JAILLET Signed-off-by: Greg Kroah-Hartman --- drivers/tty/synclink.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c index 3be9811..27db781 100644 --- a/drivers/tty/synclink.c +++ b/drivers/tty/synclink.c @@ -4098,8 +4098,7 @@ static int mgsl_claim_resources(struct mgsl_struct *info) if (request_dma(info->dma_level,info->device_name) < 0){ printk( "%s(%d):Can't request DMA channel on device %s DMA=%d\n", __FILE__,__LINE__,info->device_name, info->dma_level ); - mgsl_release_resources( info ); - return -ENODEV; + goto errout; } info->dma_requested = true; -- cgit v1.1 From c45e2d2547cb2ba0ee8391d8cb2fd2f7cdc016f5 Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Mon, 18 Sep 2017 08:33:28 -0300 Subject: serial: fsl_lpuart: Remove unused 'bd' variable Since commit a6d7514b14a6 ("tty: serial: lpuart: add a more accurate baud rate calculation method") the baud rate is now calculated inside the lpuart32_serial_setbrg() function, so we no longer need to read the UARTBAUD register inside lpuart32_set_termios(). The 'bd' variable can be simply removed. This fixes the following build warning with W=1: drivers/tty/serial/fsl_lpuart.c: In function 'lpuart32_set_termios': drivers/tty/serial/fsl_lpuart.c:1652:32: warning: variable 'bd' set but not used [-Wunused-but-set-variable] Fixes: a6d7514b14a6 ("tty: serial: lpuart: add a more accurate baud rate calculation method") Signed-off-by: Fabio Estevam Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/fsl_lpuart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 849c1f9..63f99a0 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1649,12 +1649,11 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, { struct lpuart_port *sport = container_of(port, struct lpuart_port, port); unsigned long flags; - unsigned long ctrl, old_ctrl, bd, modem; + unsigned long ctrl, old_ctrl, modem; unsigned int baud; unsigned int old_csize = old ? old->c_cflag & CSIZE : CS8; ctrl = old_ctrl = lpuart32_read(&sport->port, UARTCTRL); - bd = lpuart32_read(&sport->port, UARTBAUD); modem = lpuart32_read(&sport->port, UARTMODIR); /* * only support CS8 and CS7, and for CS7 must enable PE. -- cgit v1.1 From ef838a81dd4de1e08454406812e42d7b9b417c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 13 Sep 2017 10:18:27 +0200 Subject: serial: Add common rs485 device tree parsing function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Several drivers have the same device tree parsing code. Create a common helper function for it. This patch bases on work done by Sascha Hauer. Signed-off-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/serial_core.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 3a14ccc..f4e6c866 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3026,5 +3026,41 @@ EXPORT_SYMBOL(uart_resume_port); EXPORT_SYMBOL(uart_add_one_port); EXPORT_SYMBOL(uart_remove_one_port); +/** + * of_get_rs485_mode() - Implement parsing rs485 properties + * @np: uart node + * @rs485conf: output parameter + * + * This function implements the device tree binding described in + * Documentation/devicetree/bindings/serial/rs485.txt. + */ +void of_get_rs485_mode(struct device_node *np, struct serial_rs485 *rs485conf) +{ + u32 rs485_delay[2]; + int ret; + + ret = of_property_read_u32_array(np, "rs485-rts-delay", rs485_delay, 2); + if (!ret) { + rs485conf->delay_rts_before_send = rs485_delay[0]; + rs485conf->delay_rts_after_send = rs485_delay[1]; + } else { + rs485conf->delay_rts_before_send = 0; + rs485conf->delay_rts_after_send = 0; + } + + /* + * clear full-duplex and enabled flags to get to a defined state with + * the two following properties. + */ + rs485conf->flags &= ~(SER_RS485_RX_DURING_TX | SER_RS485_ENABLED); + + if (of_property_read_bool(np, "rs485-rx-during-tx")) + rs485conf->flags |= SER_RS485_RX_DURING_TX; + + if (of_property_read_bool(np, "linux,rs485-enabled-at-boot-time")) + rs485conf->flags |= SER_RS485_ENABLED; +} +EXPORT_SYMBOL_GPL(of_get_rs485_mode); + MODULE_DESCRIPTION("Serial driver core"); MODULE_LICENSE("GPL"); -- cgit v1.1 From 79d9e95a05c13647ccc68c5115b0ff6d21e53ab4 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 13 Sep 2017 10:18:28 +0200 Subject: serial: atmel: Use common rs485 device tree parsing function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We just got a common helper for parsing the rs485 specific device tree properties. Use it and drop the open coded parser. Note that there is a small difference between the removed and the now used implementation: The former cleared flags to 0 if rs485-rts-delay was given, the common helper clears SER_RS485_RX_DURING_TX and SER_RS485_ENABLED only but always which makes more sense. Signed-off-by: Sascha Hauer [ukleinek: point out semantic change in commit log] Acked-by: Nicolas Ferre Acked-by: Richard Genoud Signed-off-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/atmel_serial.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 7551cab..04e55f0 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -1667,29 +1667,6 @@ static void atmel_init_property(struct atmel_uart_port *atmel_port, } } -static void atmel_init_rs485(struct uart_port *port, - struct platform_device *pdev) -{ - struct device_node *np = pdev->dev.of_node; - - struct serial_rs485 *rs485conf = &port->rs485; - u32 rs485_delay[2]; - - /* rs485 properties */ - if (of_property_read_u32_array(np, "rs485-rts-delay", - rs485_delay, 2) == 0) { - rs485conf->delay_rts_before_send = rs485_delay[0]; - rs485conf->delay_rts_after_send = rs485_delay[1]; - rs485conf->flags = 0; - } - - if (of_get_property(np, "rs485-rx-during-tx", NULL)) - rs485conf->flags |= SER_RS485_RX_DURING_TX; - - if (of_get_property(np, "linux,rs485-enabled-at-boot-time", NULL)) - rs485conf->flags |= SER_RS485_ENABLED; -} - static void atmel_set_ops(struct uart_port *port) { struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); @@ -2373,7 +2350,7 @@ static int atmel_init_port(struct atmel_uart_port *atmel_port, atmel_init_property(atmel_port, pdev); atmel_set_ops(port); - atmel_init_rs485(port, pdev); + of_get_rs485_mode(pdev->dev.of_node, &port->rs485); port->iotype = UPIO_MEM; port->flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP; -- cgit v1.1 From dde18d53d72d06c30a925ca73986f711102b064e Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 13 Sep 2017 10:18:29 +0200 Subject: serial: fsl_lpuart: Use common rs485 device tree parsing function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We just got a common helper for parsing the rs485 specific device tree properties. Use it and drop the open coded parser. As a side effect this adds support for parsing rs485-rts-delay and rs485-rx-during-tx. As the driver doesn't support this though, probing fails if these are defined. Signed-off-by: Sascha Hauer Signed-off-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/fsl_lpuart.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 63f99a0..eac35d4 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -2222,6 +2222,24 @@ static int lpuart_probe(struct platform_device *pdev) return ret; } + of_get_rs485_mode(np, &sport->port.rs485); + + if (sport->port.rs485.flags & SER_RS485_RX_DURING_TX) { + dev_err(&pdev->dev, "driver doesn't support RX during TX\n"); + return -ENOSYS; + } + + if (sport->port.rs485.delay_rts_before_send || + sport->port.rs485.delay_rts_after_send) { + dev_err(&pdev->dev, "driver doesn't support RTS delays\n"); + return -ENOSYS; + } + + if (sport->port.rs485.flags & SER_RS485_ENABLED) { + sport->port.rs485.flags |= SER_RS485_RTS_ON_SEND; + writeb(UARTMODEM_TXRTSE, sport->port.membase + UARTMODEM); + } + sport->dma_tx_chan = dma_request_slave_channel(sport->port.dev, "tx"); if (!sport->dma_tx_chan) dev_info(sport->port.dev, "DMA tx channel request failed, " @@ -2232,12 +2250,6 @@ static int lpuart_probe(struct platform_device *pdev) dev_info(sport->port.dev, "DMA rx channel request failed, " "operating without rx DMA\n"); - if (of_property_read_bool(np, "linux,rs485-enabled-at-boot-time")) { - sport->port.rs485.flags |= SER_RS485_ENABLED; - sport->port.rs485.flags |= SER_RS485_RTS_ON_SEND; - writeb(UARTMODEM_TXRTSE, sport->port.membase + UARTMODEM); - } - return 0; } -- cgit v1.1 From af2f927676aa4e7635101350c0d1b17eb770a8d1 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 13 Sep 2017 10:18:30 +0200 Subject: serial: omap-serial: Use common rs485 device tree parsing function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We just got a common helper for parsing the rs485 specific device tree properties. Use it and drop the open coded parser. Signed-off-by: Sascha Hauer Signed-off-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/omap-serial.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 7754053..580f567 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1606,7 +1606,6 @@ static int serial_omap_probe_rs485(struct uart_omap_port *up, struct device_node *np) { struct serial_rs485 *rs485conf = &up->port.rs485; - u32 rs485_delay[2]; enum of_gpio_flags flags; int ret; @@ -1637,17 +1636,7 @@ static int serial_omap_probe_rs485(struct uart_omap_port *up, up->rts_gpio = -EINVAL; } - if (of_property_read_u32_array(np, "rs485-rts-delay", - rs485_delay, 2) == 0) { - rs485conf->delay_rts_before_send = rs485_delay[0]; - rs485conf->delay_rts_after_send = rs485_delay[1]; - } - - if (of_property_read_bool(np, "rs485-rx-during-tx")) - rs485conf->flags |= SER_RS485_RX_DURING_TX; - - if (of_property_read_bool(np, "linux,rs485-enabled-at-boot-time")) - rs485conf->flags |= SER_RS485_ENABLED; + of_get_rs485_mode(np, rs485conf); return 0; } -- cgit v1.1 From be7da1a2b714a387e6ac5e3db21a1760c9969ae0 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 13 Sep 2017 10:18:31 +0200 Subject: serial: imx: default to half duplex rs485 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The i.MX driver defaulted to full duplex rs485 which is rather unusual and doesn't match the default implemented in other drivers. So change the default to half duplex. Signed-off-by: Sascha Hauer Signed-off-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index dfeff39..fe368a4 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -2112,8 +2112,7 @@ static int serial_imx_probe(struct platform_device *pdev) sport->port.fifosize = 32; sport->port.ops = &imx_pops; sport->port.rs485_config = imx_rs485_config; - sport->port.rs485.flags = - SER_RS485_RTS_ON_SEND | SER_RS485_RX_DURING_TX; + sport->port.rs485.flags = SER_RS485_RTS_ON_SEND; sport->port.flags = UPF_BOOT_AUTOCONF; init_timer(&sport->timer); sport->timer.function = imx_timeout; -- cgit v1.1 From 8b25deb18ba3f9b1af1ff9395b8de2bdb9d9fdbf Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 21 Sep 2017 10:13:11 +0200 Subject: serial: imx: Use common rs485 device tree parsing function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds support for the rs485 specific properties defined in Documentation/devicetree/bindings/serial/rs485.txt. Signed-off-by: Sascha Hauer Signed-off-by: Uwe Kleine-König Forwarded: id:20170913081833.2740-7-u.kleine-koenig@pengutronix.de (v5) Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index fe368a4..283cfd9 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -2051,6 +2051,8 @@ static int serial_imx_probe_dt(struct imx_port *sport, if (of_get_property(np, "rts-gpios", NULL)) sport->have_rtsgpio = 1; + of_get_rs485_mode(np, &sport->port.rs485); + return 0; } #else @@ -2112,7 +2114,7 @@ static int serial_imx_probe(struct platform_device *pdev) sport->port.fifosize = 32; sport->port.ops = &imx_pops; sport->port.rs485_config = imx_rs485_config; - sport->port.rs485.flags = SER_RS485_RTS_ON_SEND; + sport->port.rs485.flags |= SER_RS485_RTS_ON_SEND; sport->port.flags = UPF_BOOT_AUTOCONF; init_timer(&sport->timer); sport->timer.function = imx_timeout; -- cgit v1.1 From a0983c742a5885f82afb282166f83f1d3d8addf4 Mon Sep 17 00:00:00 2001 From: Ian Jamison Date: Thu, 21 Sep 2017 10:13:12 +0200 Subject: serial: imx: Update cached mctrl value when changing RTS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UART core function uart_update_mctrl relies on a cached value of modem control lines. This was used but not updated by local RTS control functions within imx.c. These are used for RS485 line driver enable signalling. Having an out-of-date value in the cached mctrl can result in the transmitter being enabled when it shouldn't be. Fix this by updating the mctrl value before applying it. Signed-off-by: Ian Jamison Origin: id:8195c96e674517b82a6ff7fe914c7ba0f86e702b.1505375165.git.ian.dev@arkver.com Acked-by: Uwe Kleine-König Tested-by: Uwe Kleine-König Tested-by: Clemens Gruber Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 283cfd9..19253a6 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -334,7 +334,8 @@ static void imx_port_rts_active(struct imx_port *sport, unsigned long *ucr2) { *ucr2 &= ~(UCR2_CTSC | UCR2_CTS); - mctrl_gpio_set(sport->gpios, sport->port.mctrl | TIOCM_RTS); + sport->port.mctrl |= TIOCM_RTS; + mctrl_gpio_set(sport->gpios, sport->port.mctrl); } static void imx_port_rts_inactive(struct imx_port *sport, unsigned long *ucr2) @@ -342,7 +343,8 @@ static void imx_port_rts_inactive(struct imx_port *sport, unsigned long *ucr2) *ucr2 &= ~UCR2_CTSC; *ucr2 |= UCR2_CTS; - mctrl_gpio_set(sport->gpios, sport->port.mctrl & ~TIOCM_RTS); + sport->port.mctrl &= ~TIOCM_RTS; + mctrl_gpio_set(sport->gpios, sport->port.mctrl); } static void imx_port_rts_auto(struct imx_port *sport, unsigned long *ucr2) -- cgit v1.1 From 177b508f3c7694647e94509a1ef3f5a139deac50 Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 22 Sep 2017 13:56:44 +0530 Subject: drivers: tty: imx: use setup_timer() helper. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Allen Pais Acked-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 19253a6..20a8371 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -2118,9 +2118,7 @@ static int serial_imx_probe(struct platform_device *pdev) sport->port.rs485_config = imx_rs485_config; sport->port.rs485.flags |= SER_RS485_RTS_ON_SEND; sport->port.flags = UPF_BOOT_AUTOCONF; - init_timer(&sport->timer); - sport->timer.function = imx_timeout; - sport->timer.data = (unsigned long)sport; + setup_timer(&sport->timer, imx_timeout, (unsigned long)sport); sport->gpios = mctrl_gpio_init(&sport->port, 0); if (IS_ERR(sport->gpios)) -- cgit v1.1 From 4139fd76cd92b350114b102f1b40b02381b198cf Mon Sep 17 00:00:00 2001 From: Romain Perier Date: Thu, 28 Sep 2017 11:03:49 +0100 Subject: serial: imx: only set dma_is_rxing when DMA starts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The variable dma_is_rxing is currently set to 1 in imx_disable_rx_int(). This is problematic as: - whilst imx_disable_rx_int() is currently always called before start_rx_dma() this dependency isn't obvious. - start_rx_dma() does error checking and might exit without enabling DMA. Currently this will result in dma_is_rxing suggesting that DMA is being used for recieving. To avoid these issues, move the setting of dma_is_rxing to start_rx_dma() when appropriate. Signed-off-by: Romain Perier Signed-off-by: Martyn Welch Reviewed-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 20a8371..a42f386 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -716,8 +716,6 @@ static void imx_disable_rx_int(struct imx_port *sport) { unsigned long temp; - sport->dma_is_rxing = 1; - /* disable the receiver ready and aging timer interrupts */ temp = readl(sport->port.membase + UCR1); temp &= ~(UCR1_RRDYEN); @@ -1076,6 +1074,7 @@ static int start_rx_dma(struct imx_port *sport) desc->callback_param = sport; dev_dbg(dev, "RX: prepare for the DMA.\n"); + sport->dma_is_rxing = 1; sport->rx_cookie = dmaengine_submit(desc); dma_async_issue_pending(chan); return 0; -- cgit v1.1 From f654b23c173eb7081e1f5bd33710a53c11ea4b49 Mon Sep 17 00:00:00 2001 From: Martyn Welch Date: Thu, 28 Sep 2017 11:07:40 +0100 Subject: serial: imx: Use RX_BUF_SIZE to set size of RX buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The imx serial driver uses PAGE_SIZE when allocating rx_buf, but then uses RX_BUF_SIZE (which is currently defined as PAGE_SIZE) to describe the length of the buffer when initialising the scatter gather list. In order to ensure that this stays consistent, use RX_BUF_SIZE in both locations. Signed-off-by: Martyn Welch Acked-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index a42f386..9800fda 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1166,7 +1166,7 @@ static int imx_uart_dma_init(struct imx_port *sport) goto err; } - sport->rx_buf = kzalloc(PAGE_SIZE, GFP_KERNEL); + sport->rx_buf = kzalloc(RX_BUF_SIZE, GFP_KERNEL); if (!sport->rx_buf) { ret = -ENOMEM; goto err; -- cgit v1.1 From 0f7bdbd2b3518e2698048bb5346b542e7cbb542a Mon Sep 17 00:00:00 2001 From: Martyn Welch Date: Thu, 28 Sep 2017 11:38:51 +0100 Subject: serial: imx: Switch setting dma_is_txing from "false" to "0" The variable "dma_is_txing" is an unsigned int, set as either "0" or "1" in all but one location, where it is instead set to "false". For consistency, set dma_is_txing to "0" in this location too. Signed-off-by: Martyn Welch Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 9800fda..b697c1e 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1412,7 +1412,7 @@ static void imx_flush_buffer(struct uart_port *port) temp = readl(sport->port.membase + UCR1); temp &= ~UCR1_TDMAEN; writel(temp, sport->port.membase + UCR1); - sport->dma_is_txing = false; + sport->dma_is_txing = 0; } /* -- cgit v1.1 From 22b94d1d99a71e201b28f135b271cb63526f8bd1 Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 22 Sep 2017 13:56:43 +0530 Subject: drivers: tty: mux: use setup_timer() helper. Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Allen Pais Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mux.c b/drivers/tty/serial/mux.c index 2bff69e..a789837 100644 --- a/drivers/tty/serial/mux.c +++ b/drivers/tty/serial/mux.c @@ -576,8 +576,7 @@ static int __init mux_init(void) if(port_cnt > 0) { /* Start the Mux timer */ - init_timer(&mux_timer); - mux_timer.function = mux_poll; + setup_timer(&mux_timer, mux_poll, 0UL); mod_timer(&mux_timer, jiffies + MUX_POLL_DELAY); #ifdef CONFIG_SERIAL_MUX_CONSOLE -- cgit v1.1 From a386ab2b286476f4e87b974f917ec80cb9b87cab Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 22 Sep 2017 13:56:45 +0530 Subject: drivers: tty: vcc: use setup_timer() helper. Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Allen Pais Signed-off-by: Greg Kroah-Hartman --- drivers/tty/vcc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c index ef01d24..954b190 100644 --- a/drivers/tty/vcc.c +++ b/drivers/tty/vcc.c @@ -645,13 +645,8 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id) if (rv) goto free_domain; - init_timer(&port->rx_timer); - port->rx_timer.function = vcc_rx_timer; - port->rx_timer.data = port->index; - - init_timer(&port->tx_timer); - port->tx_timer.function = vcc_tx_timer; - port->tx_timer.data = port->index; + setup_timer(&port->rx_timer, vcc_rx_timer, port->index); + setup_timer(&port->tx_timer, vcc_tx_timer, port->index); dev_set_drvdata(&vdev->dev, port); -- cgit v1.1 From 71fa527290660c5fc6bdc63bcb7de66af4f3895f Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 22 Sep 2017 13:56:46 +0530 Subject: drivers: tty: max3100: use setup_timer() helper. Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Allen Pais Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/max3100.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index ace8264..b6b3453 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -787,9 +787,8 @@ static int max3100_probe(struct spi_device *spi) max3100s[i]->poll_time = 1; max3100s[i]->max3100_hw_suspend = pdata->max3100_hw_suspend; max3100s[i]->minor = i; - init_timer(&max3100s[i]->timer); - max3100s[i]->timer.function = max3100_timeout; - max3100s[i]->timer.data = (unsigned long) max3100s[i]; + setup_timer(&max3100s[i]->timer, max3100_timeout, + (unsigned long)max3100s[i]); dev_dbg(&spi->dev, "%s: adding port %d\n", __func__, i); max3100s[i]->port.irq = max3100s[i]->irq; -- cgit v1.1 From 305615127a277ffae7e120b0d88dcbf3c91f4d3f Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 22 Sep 2017 13:56:48 +0530 Subject: drivers: tty: 8250: use setup_timer() helper. Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Allen Pais Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index d29b512a..00d4b11 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -525,8 +525,7 @@ static void __init serial8250_isa_init_ports(void) base_ops = port->ops; port->ops = &univ8250_port_ops; - init_timer(&up->timer); - up->timer.function = serial8250_timeout; + setup_timer(&up->timer, serial8250_timeout, 0UL); up->ops = &univ8250_driver_ops; -- cgit v1.1 From 9b363c83c6c4d791af8b57b8c38bc11e57bd0927 Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 22 Sep 2017 13:56:47 +0530 Subject: drivers: tty: pnx8xxx: use setup_timer() helper. Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Allen Pais Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/pnx8xxx_uart.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/pnx8xxx_uart.c b/drivers/tty/serial/pnx8xxx_uart.c index dab2668..a05508a 100644 --- a/drivers/tty/serial/pnx8xxx_uart.c +++ b/drivers/tty/serial/pnx8xxx_uart.c @@ -666,9 +666,8 @@ static void __init pnx8xxx_init_ports(void) first = 0; for (i = 0; i < NR_PORTS; i++) { - init_timer(&pnx8xxx_ports[i].timer); - pnx8xxx_ports[i].timer.function = pnx8xxx_timeout; - pnx8xxx_ports[i].timer.data = (unsigned long)&pnx8xxx_ports[i]; + setup_timer(&pnx8xxx_ports[i].timer, pnx8xxx_timeout, + (unsigned long)&pnx8xxx_ports[i]); pnx8xxx_ports[i].port.ops = &pnx8xxx_pops; } } -- cgit v1.1 From 65f8824f557b5f9abdf4548f2255e4acdd1d2328 Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 22 Sep 2017 13:56:50 +0530 Subject: drivers: tty: n_gsm: use setup_timer() helper. Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Allen Pais Signed-off-by: Greg Kroah-Hartman --- drivers/tty/n_gsm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 0a3c966..33530d8 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -1646,9 +1646,7 @@ static struct gsm_dlci *gsm_dlci_alloc(struct gsm_mux *gsm, int addr) } skb_queue_head_init(&dlci->skb_list); - init_timer(&dlci->t1); - dlci->t1.function = gsm_dlci_t1; - dlci->t1.data = (unsigned long)dlci; + setup_timer(&dlci->t1, gsm_dlci_t1, (unsigned long)dlci); tty_port_init(&dlci->port); dlci->port.ops = &gsm_port_ops; dlci->gsm = gsm; -- cgit v1.1 From 0bf1e84ff00fe068833f0281fa3cfca1e5a40152 Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 22 Sep 2017 13:56:51 +0530 Subject: drivers: tty: sn_console: use setup_timer() helper. Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Allen Pais Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sn_console.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/sn_console.c b/drivers/tty/serial/sn_console.c index 9e0e658..81d506d2 100644 --- a/drivers/tty/serial/sn_console.c +++ b/drivers/tty/serial/sn_console.c @@ -687,9 +687,7 @@ static void __init sn_sal_switch_to_asynch(struct sn_cons_port *port) * timer to poll for input and push data from the console * buffer. */ - init_timer(&port->sc_timer); - port->sc_timer.function = sn_sal_timer_poll; - port->sc_timer.data = (unsigned long)port; + setup_timer(&port->sc_timer, sn_sal_timer_poll, (unsigned long)port); if (IS_RUNNING_ON_SIMULATOR()) port->sc_interrupt_timeout = 6; -- cgit v1.1 From 2876bb6d2c97eda0de00d4457d8fbb3067a41415 Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 22 Sep 2017 13:56:52 +0530 Subject: drivers: tty: ifx6x60: use setup_timer() helper. Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Allen Pais Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/ifx6x60.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c index f190a84..596b738 100644 --- a/drivers/tty/serial/ifx6x60.c +++ b/drivers/tty/serial/ifx6x60.c @@ -1029,9 +1029,8 @@ static int ifx_spi_spi_probe(struct spi_device *spi) spin_lock_init(&ifx_dev->write_lock); spin_lock_init(&ifx_dev->power_lock); ifx_dev->power_status = 0; - init_timer(&ifx_dev->spi_timer); - ifx_dev->spi_timer.function = ifx_spi_timeout; - ifx_dev->spi_timer.data = (unsigned long)ifx_dev; + setup_timer(&ifx_dev->spi_timer, ifx_spi_timeout, + (unsigned long)ifx_dev); ifx_dev->modem = pl_data->modem_type; ifx_dev->use_dma = pl_data->use_dma; ifx_dev->max_hz = pl_data->max_hz; -- cgit v1.1 From 3b837fa233254c7f8e46fbb72e4c126774fdb635 Mon Sep 17 00:00:00 2001 From: Allen Pais Date: Fri, 22 Sep 2017 13:56:49 +0530 Subject: drivers: tty: sa1100: use setup_timer() helper. Use setup_timer function instead of initializing timer with the function and data fields. Signed-off-by: Allen Pais Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sa1100.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c index fd3d132..75bd1e0 100644 --- a/drivers/tty/serial/sa1100.c +++ b/drivers/tty/serial/sa1100.c @@ -640,9 +640,8 @@ static void __init sa1100_init_ports(void) sa1100_ports[i].port.fifosize = 8; sa1100_ports[i].port.line = i; sa1100_ports[i].port.iotype = UPIO_MEM; - init_timer(&sa1100_ports[i].timer); - sa1100_ports[i].timer.function = sa1100_timeout; - sa1100_ports[i].timer.data = (unsigned long)&sa1100_ports[i]; + setup_timer(&sa1100_ports[i].timer, sa1100_timeout, + (unsigned long)&sa1100_ports[i]); } /* -- cgit v1.1 From 195638b6d44f22c5fcbd428ebfe4b7c012c576f2 Mon Sep 17 00:00:00 2001 From: "Ji-Ze Hong (Peter Hong)" Date: Tue, 3 Oct 2017 11:08:33 +0800 Subject: serial: 8250_fintek: UART dynamic clocksource on Fintek F81866 The F81866 had 4 clocksource 1.8432/18.432/14.769/24MHz and baud rates can be up to 1.5Mbits with 24MHz. We'll implements the dynamic clocksource in fintek_8250_set_termios(). Signed-off-by: Ji-Ze Hong (Peter Hong) Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_fintek.c | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index e500f7d..53ea353 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -287,6 +287,59 @@ static void fintek_8250_goto_highspeed(struct uart_8250_port *uart, } } +void fintek_8250_set_termios(struct uart_port *port, struct ktermios *termios, + struct ktermios *old) +{ + struct fintek_8250 *pdata = port->private_data; + unsigned int baud = tty_termios_baud_rate(termios); + int i; + static u32 baudrate_table[] = {115200, 921600, 1152000, 1500000}; + static u8 clock_table[] = { F81866_UART_CLK_1_8432MHZ, + F81866_UART_CLK_14_769MHZ, F81866_UART_CLK_18_432MHZ, + F81866_UART_CLK_24MHZ }; + + for (i = 0; i < ARRAY_SIZE(baudrate_table); ++i) { + if (baud > baudrate_table[i] || baudrate_table[i] % baud != 0) + continue; + + if (port->uartclk == baudrate_table[i] * 16) + break; + + if (fintek_8250_enter_key(pdata->base_port, pdata->key)) + continue; + + port->uartclk = baudrate_table[i] * 16; + + sio_write_reg(pdata, LDN, pdata->index); + sio_write_mask_reg(pdata, F81866_UART_CLK, + F81866_UART_CLK_MASK, clock_table[i]); + + fintek_8250_exit_key(pdata->base_port); + break; + } + + if (i == ARRAY_SIZE(baudrate_table)) { + baud = tty_termios_baud_rate(old); + tty_termios_encode_baud_rate(termios, baud, baud); + } + + serial8250_do_set_termios(port, termios, old); +} + +static void fintek_8250_set_termios_handler(struct uart_8250_port *uart) +{ + struct fintek_8250 *pdata = uart->port.private_data; + + switch (pdata->pid) { + case CHIP_ID_F81866: + uart->port.set_termios = fintek_8250_set_termios; + break; + + default: + break; + } +} + static int probe_setup_port(struct fintek_8250 *pdata, struct uart_8250_port *uart) { @@ -373,6 +426,7 @@ int fintek_8250_probe(struct uart_8250_port *uart) memcpy(pdata, &probe_data, sizeof(probe_data)); uart->port.private_data = pdata; fintek_8250_set_rs485_handler(uart); + fintek_8250_set_termios_handler(uart); return 0; } -- cgit v1.1 From 58178914ae5bad449d8e53e38c7171ec85ad2c9a Mon Sep 17 00:00:00 2001 From: "Ji-Ze Hong (Peter Hong)" Date: Tue, 3 Oct 2017 11:08:34 +0800 Subject: serial: 8250_fintek: UART dynamic clocksource on Fintek F81216H The F81216H had 4 clocksource 1.8432/18.432/14.769/24MHzand baud rates can be up to 1.5Mbits with 24MHz. The register value and mask is the same with F81866. But F81866 register address is F2h, F81216H is F0h. We'll implements the dynamic clocksource in fintek_8250_set_termios(). Signed-off-by: Ji-Ze Hong (Peter Hong) Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_fintek.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index 53ea353..f3b622f 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -40,6 +40,16 @@ #define IRQ_LEVEL_LOW 0 #define IRQ_EDGE_HIGH BIT(5) +/* + * F81216H clock source register, the value and mask is the same with F81866, + * but it's on F0h. + * + * Clock speeds for UART (register F0h) + * 00: 1.8432MHz. + * 01: 18.432MHz. + * 10: 24MHz. + * 11: 14.769MHz. + */ #define RS485 0xF0 #define RTS_INVERT BIT(5) #define RS485_URA BIT(4) @@ -293,11 +303,28 @@ void fintek_8250_set_termios(struct uart_port *port, struct ktermios *termios, struct fintek_8250 *pdata = port->private_data; unsigned int baud = tty_termios_baud_rate(termios); int i; + u8 reg; static u32 baudrate_table[] = {115200, 921600, 1152000, 1500000}; static u8 clock_table[] = { F81866_UART_CLK_1_8432MHZ, F81866_UART_CLK_14_769MHZ, F81866_UART_CLK_18_432MHZ, F81866_UART_CLK_24MHZ }; + switch (pdata->pid) { + case CHIP_ID_F81216H: + reg = RS485; + break; + case CHIP_ID_F81866: + reg = F81866_UART_CLK; + break; + default: + /* Don't change clocksource with unknown PID */ + dev_warn(port->dev, + "%s: pid: %x Not support. use default set_termios.\n", + __func__, pdata->pid); + serial8250_do_set_termios(port, termios, old); + return; + } + for (i = 0; i < ARRAY_SIZE(baudrate_table); ++i) { if (baud > baudrate_table[i] || baudrate_table[i] % baud != 0) continue; @@ -311,8 +338,8 @@ void fintek_8250_set_termios(struct uart_port *port, struct ktermios *termios, port->uartclk = baudrate_table[i] * 16; sio_write_reg(pdata, LDN, pdata->index); - sio_write_mask_reg(pdata, F81866_UART_CLK, - F81866_UART_CLK_MASK, clock_table[i]); + sio_write_mask_reg(pdata, reg, F81866_UART_CLK_MASK, + clock_table[i]); fintek_8250_exit_key(pdata->base_port); break; @@ -331,6 +358,7 @@ static void fintek_8250_set_termios_handler(struct uart_8250_port *uart) struct fintek_8250 *pdata = uart->port.private_data; switch (pdata->pid) { + case CHIP_ID_F81216H: case CHIP_ID_F81866: uart->port.set_termios = fintek_8250_set_termios; break; -- cgit v1.1 From 4c3897b1b0e3fffe964deb8b008da0623dfa2057 Mon Sep 17 00:00:00 2001 From: "Ji-Ze Hong (Peter Hong)" Date: Tue, 3 Oct 2017 11:08:35 +0800 Subject: serial: 8250_fintek: fix warning reported from smatch This patch is fix the warning reported by smatch as following: drivers/tty/serial/8250/8250_fintek.c:294 fintek_8250_goto_highspeed() warn: inconsistent indenting Signed-off-by: Ji-Ze Hong (Peter Hong) Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_fintek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index f3b622f..96cc45f 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -290,7 +290,7 @@ static void fintek_8250_goto_highspeed(struct uart_8250_port *uart, F81866_UART_CLK_MASK, F81866_UART_CLK_14_769MHZ); - uart->port.uartclk = 921600 * 16; + uart->port.uartclk = 921600 * 16; break; default: /* leave clock speed untouched */ break; -- cgit v1.1 From 62fadbd8f798331d56fdadd3503dc09026ae8d1f Mon Sep 17 00:00:00 2001 From: Gimcuan Hui Date: Mon, 2 Oct 2017 22:48:17 +0800 Subject: tty: serial: jsm: Add space before the open brace This patch fixes the checkpatch.pl error complain: ERROR: space required before the open brace '{' Signed-off-by: Gimcuan Hui Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/jsm/jsm_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c index ec7d838..e69227c 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c @@ -474,7 +474,7 @@ int jsm_uart_port_init(struct jsm_board *brd) set_bit(line, linemap); brd->channels[i]->uart_port.line = line; rc = uart_add_one_port (&jsm_uart_driver, &brd->channels[i]->uart_port); - if (rc){ + if (rc) { printk(KERN_INFO "jsm: Port %d failed. Aborting...\n", i); return rc; } -- cgit v1.1 From fa2abb03637a55288b22082d3d679db4fe74112a Mon Sep 17 00:00:00 2001 From: Ulrich Hecht Date: Fri, 29 Sep 2017 15:08:53 +0200 Subject: serial: sh-sci: Support for variable HSCIF hardware RX timeout HSCIF has facilities that allow changing the timeout after which an RX interrupt is triggered even if the FIFO is not filled. This patch allows changing the default (15 bits of silence) using the existing sysfs attribute "rx_fifo_timeout". Signed-off-by: Ulrich Hecht Reviewed-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sh-sci.c | 52 ++++++++++++++++++++++++++++++++------------- drivers/tty/serial/sh-sci.h | 3 +++ 2 files changed, 40 insertions(+), 15 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 784dd42..41bf910 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -152,6 +152,7 @@ struct sci_port { int rx_trigger; struct timer_list rx_fifo_timer; int rx_fifo_timeout; + u16 hscif_tot; bool has_rtscts; bool autorts; @@ -1107,8 +1108,14 @@ static ssize_t rx_fifo_timeout_show(struct device *dev, { struct uart_port *port = dev_get_drvdata(dev); struct sci_port *sci = to_sci_port(port); + int v; - return sprintf(buf, "%d\n", sci->rx_fifo_timeout); + if (port->type == PORT_HSCIF) + v = sci->hscif_tot >> HSSCR_TOT_SHIFT; + else + v = sci->rx_fifo_timeout; + + return sprintf(buf, "%d\n", v); } static ssize_t rx_fifo_timeout_store(struct device *dev, @@ -1124,11 +1131,19 @@ static ssize_t rx_fifo_timeout_store(struct device *dev, ret = kstrtol(buf, 0, &r); if (ret) return ret; - sci->rx_fifo_timeout = r; - scif_set_rtrg(port, 1); - if (r > 0) - setup_timer(&sci->rx_fifo_timer, rx_fifo_timer_fn, - (unsigned long)sci); + + if (port->type == PORT_HSCIF) { + if (r < 0 || r > 3) + return -EINVAL; + sci->hscif_tot = r << HSSCR_TOT_SHIFT; + } else { + sci->rx_fifo_timeout = r; + scif_set_rtrg(port, 1); + if (r > 0) + setup_timer(&sci->rx_fifo_timer, rx_fifo_timer_fn, + (unsigned long)sci); + } + return count; } @@ -2037,9 +2052,13 @@ static void sci_shutdown(struct uart_port *port) spin_lock_irqsave(&port->lock, flags); sci_stop_rx(port); sci_stop_tx(port); - /* Stop RX and TX, disable related interrupts, keep clock source */ + /* + * Stop RX and TX, disable related interrupts, keep clock source + * and HSCIF TOT bits + */ scr = serial_port_in(port, SCSCR); - serial_port_out(port, SCSCR, scr & (SCSCR_CKE1 | SCSCR_CKE0)); + serial_port_out(port, SCSCR, scr & + (SCSCR_CKE1 | SCSCR_CKE0 | s->hscif_tot)); spin_unlock_irqrestore(&port->lock, flags); #ifdef CONFIG_SERIAL_SH_SCI_DMA @@ -2186,7 +2205,7 @@ static void sci_reset(struct uart_port *port) unsigned int status; struct sci_port *s = to_sci_port(port); - serial_port_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ + serial_port_out(port, SCSCR, s->hscif_tot); /* TE=0, RE=0, CKE1=0 */ reg = sci_getreg(port, SCFCR); if (reg->size) @@ -2356,7 +2375,7 @@ done: dev_dbg(port->dev, "SCR 0x%x SMR 0x%x BRR %u CKS 0x%x DL %u SRR %u\n", scr_val, smr_val, brr, sccks, dl, srr); - serial_port_out(port, SCSCR, scr_val); + serial_port_out(port, SCSCR, scr_val | s->hscif_tot); serial_port_out(port, SCSMR, smr_val); serial_port_out(port, SCBRR, brr); if (sci_getreg(port, HSSRR)->size) @@ -2370,7 +2389,7 @@ done: smr_val |= serial_port_in(port, SCSMR) & (SCSMR_CKEDG | SCSMR_SRC_MASK | SCSMR_CKS); dev_dbg(port->dev, "SCR 0x%x SMR 0x%x\n", scr_val, smr_val); - serial_port_out(port, SCSCR, scr_val); + serial_port_out(port, SCSCR, scr_val | s->hscif_tot); serial_port_out(port, SCSMR, smr_val); } @@ -2407,7 +2426,7 @@ done: scr_val |= SCSCR_RE | SCSCR_TE | (s->cfg->scscr & ~(SCSCR_CKE1 | SCSCR_CKE0)); dev_dbg(port->dev, "SCSCR 0x%x\n", scr_val); - serial_port_out(port, SCSCR, scr_val); + serial_port_out(port, SCSCR, scr_val | s->hscif_tot); if ((srr + 1 == 5) && (port->type == PORT_SCIFA || port->type == PORT_SCIFB)) { /* @@ -2773,6 +2792,7 @@ static int sci_init_single(struct platform_device *dev, } sci_port->rx_fifo_timeout = 0; + sci_port->hscif_tot = 0; /* SCIFA on sh7723 and sh7724 need a custom sampling rate that doesn't * match the SoC datasheet, this should be investigated. Let platform @@ -2860,7 +2880,7 @@ static void serial_console_write(struct console *co, const char *s, ctrl_temp = SCSCR_RE | SCSCR_TE | (sci_port->cfg->scscr & ~(SCSCR_CKE1 | SCSCR_CKE0)) | (ctrl & (SCSCR_CKE1 | SCSCR_CKE0)); - serial_port_out(port, SCSCR, ctrl_temp); + serial_port_out(port, SCSCR, ctrl_temp | sci_port->hscif_tot); uart_console_write(port, s, count, serial_console_putchar); @@ -2988,7 +3008,8 @@ static int sci_remove(struct platform_device *dev) sysfs_remove_file(&dev->dev.kobj, &dev_attr_rx_fifo_trigger.attr); } - if (port->port.type == PORT_SCIFA || port->port.type == PORT_SCIFB) { + if (port->port.type == PORT_SCIFA || port->port.type == PORT_SCIFB || + port->port.type == PORT_HSCIF) { sysfs_remove_file(&dev->dev.kobj, &dev_attr_rx_fifo_timeout.attr); } @@ -3173,7 +3194,8 @@ static int sci_probe(struct platform_device *dev) if (ret) return ret; } - if (sp->port.type == PORT_SCIFA || sp->port.type == PORT_SCIFB) { + if (sp->port.type == PORT_SCIFA || sp->port.type == PORT_SCIFB || + sp->port.type == PORT_HSCIF) { ret = sysfs_create_file(&dev->dev.kobj, &dev_attr_rx_fifo_timeout.attr); if (ret) { diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h index 971b2ab..2b708cc 100644 --- a/drivers/tty/serial/sh-sci.h +++ b/drivers/tty/serial/sh-sci.h @@ -62,6 +62,9 @@ enum { #define SCSCR_TDRQE BIT(15) /* Tx Data Transfer Request Enable */ #define SCSCR_RDRQE BIT(14) /* Rx Data Transfer Request Enable */ +/* Serial Control Register, HSCIF-only bits */ +#define HSSCR_TOT_SHIFT 14 + /* SCxSR (Serial Status Register) on SCI */ #define SCI_TDRE BIT(7) /* Transmit Data Register Empty */ #define SCI_RDRF BIT(6) /* Receive Data Register Full */ -- cgit v1.1 From ea04f82a0c7f2739071cc9ac4a0ca57b3bddef7b Mon Sep 17 00:00:00 2001 From: Romain Izard Date: Thu, 28 Sep 2017 11:46:27 +0200 Subject: tty/serial: atmel: Prevent a warning on suspend The atmel serial port driver reported the following warning on suspend: atmel_usart f8020000.serial: ttyS1: Unable to drain transmitter As the ATMEL_US_TXEMPTY status bit in ATMEL_US_CSR is always cleared when the transmitter is disabled, we need to know the transmitter's state to return the real fifo state. And as ATMEL_US_CR is write-only, it is necessary to save the state of the transmitter in a local variable, and update the variable when TXEN and TXDIS is written in ATMEL_US_CR. After those changes, atmel_tx_empty can return "empty" on suspend, the warning in uart_suspend_port disappears, and suspending is 20ms shorter for each enabled Atmel serial port. Signed-off-by: Romain Izard Tested-by: Nicolas Ferre Acked-by: Nicolas Ferre Acked-by: Richard Genoud Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/atmel_serial.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 04e55f0..82d9c8e 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -171,6 +171,7 @@ struct atmel_uart_port { bool has_hw_timer; struct timer_list uart_timer; + bool tx_stopped; bool suspended; unsigned int pending; unsigned int pending_status; @@ -380,6 +381,10 @@ static int atmel_config_rs485(struct uart_port *port, */ static u_int atmel_tx_empty(struct uart_port *port) { + struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); + + if (atmel_port->tx_stopped) + return TIOCSER_TEMT; return (atmel_uart_readl(port, ATMEL_US_CSR) & ATMEL_US_TXEMPTY) ? TIOCSER_TEMT : 0; @@ -485,6 +490,7 @@ static void atmel_stop_tx(struct uart_port *port) * is fully transmitted. */ atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS); + atmel_port->tx_stopped = true; /* Disable interrupts */ atmel_uart_writel(port, ATMEL_US_IDR, atmel_port->tx_done_mask); @@ -521,6 +527,7 @@ static void atmel_start_tx(struct uart_port *port) /* re-enable the transmitter */ atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN); + atmel_port->tx_stopped = false; } /* @@ -1843,6 +1850,7 @@ static int atmel_startup(struct uart_port *port) atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_RSTSTA | ATMEL_US_RSTRX); /* enable xmit & rcvr */ atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN); + atmel_port->tx_stopped = false; setup_timer(&atmel_port->uart_timer, atmel_uart_timer_callback, @@ -2099,6 +2107,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, /* disable receiver and transmitter */ atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXDIS | ATMEL_US_RXDIS); + atmel_port->tx_stopped = true; /* mode */ if (port->rs485.flags & SER_RS485_ENABLED) { @@ -2184,6 +2193,7 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, atmel_uart_writel(port, ATMEL_US_BRGR, quot); 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; /* restore interrupts */ atmel_uart_writel(port, ATMEL_US_IER, imr); @@ -2427,6 +2437,7 @@ static void atmel_console_write(struct console *co, const char *s, u_int count) /* Make sure that tx path is actually able to send characters */ atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN); + atmel_port->tx_stopped = false; uart_console_write(port, s, count, atmel_console_putchar); @@ -2488,6 +2499,7 @@ static int __init atmel_console_setup(struct console *co, char *options) { int ret; struct uart_port *port = &atmel_ports[co->index].uart; + struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); int baud = 115200; int bits = 8; int parity = 'n'; @@ -2505,6 +2517,7 @@ static int __init atmel_console_setup(struct console *co, char *options) atmel_uart_writel(port, ATMEL_US_IDR, -1); 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; if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); -- cgit v1.1 From 6c7b841224ac09901e595ed20b3b1111c6adf812 Mon Sep 17 00:00:00 2001 From: Vikas Manocha Date: Thu, 28 Sep 2017 15:51:25 -0700 Subject: Arm: dts: stm32: remove extra compatible string from DT & driver This patch remove the extra compatibility string "st,stm32-usart" from driver & device tree. Signed-off-by: Vikas Manocha Reviewed-by: Patrice Chotard Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/stm32-usart.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 03a58326..46a1f86 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -736,11 +736,8 @@ static struct stm32_port *stm32_of_get_stm32_port(struct platform_device *pdev) #ifdef CONFIG_OF static const struct of_device_id stm32_match[] = { - { .compatible = "st,stm32-usart", .data = &stm32f4_info}, { .compatible = "st,stm32-uart", .data = &stm32f4_info}, - { .compatible = "st,stm32f7-usart", .data = &stm32f7_info}, { .compatible = "st,stm32f7-uart", .data = &stm32f7_info}, - { .compatible = "st,stm32h7-usart", .data = &stm32h7_info}, { .compatible = "st,stm32h7-uart", .data = &stm32h7_info}, {}, }; -- cgit v1.1 From 1d67243a8e77cdf63ee20bbd55c49771ff9c3090 Mon Sep 17 00:00:00 2001 From: Shubhrajyoti Datta Date: Wed, 20 Sep 2017 12:20:11 +0530 Subject: tty: xilinx_uartps: move to arch_initcall for earlier console move to arch_initcall to get the console up really early, it is quite helpful for spotting early boot problems. Signed-off-by: Shubhrajyoti Datta Tested-by: Michal Simek Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/xilinx_uartps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 31a630a..7c1c6fb9 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1673,7 +1673,7 @@ static void __exit cdns_uart_exit(void) uart_unregister_driver(&cdns_uart_uart_driver); } -module_init(cdns_uart_init); +arch_initcall(cdns_uart_init); module_exit(cdns_uart_exit); MODULE_DESCRIPTION("Driver for Cadence UART"); -- cgit v1.1 From 2799707fbeea103866b5d11b243e3c7b2a2d9b26 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Tue, 12 Sep 2017 12:39:55 +0200 Subject: mxser: remove unused parameters Remove * pdev from mxser_initbrd * old_termios from mxser_change_speed as they are unused and update the callers. Signed-off-by: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- drivers/tty/mxser.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 1c0c955..7f79684 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -636,8 +636,7 @@ static int mxser_set_baud(struct tty_struct *tty, long newspd) * This routine is called to set the UART divisor registers to match * the specified baud rate for a serial port. */ -static int mxser_change_speed(struct tty_struct *tty, - struct ktermios *old_termios) +static int mxser_change_speed(struct tty_struct *tty) { struct mxser_port *info = tty->driver_data; unsigned cflag, cval, fcr; @@ -939,7 +938,7 @@ static int mxser_activate(struct tty_port *port, struct tty_struct *tty) /* * and set the speed of the serial port */ - mxser_change_speed(tty, NULL); + mxser_change_speed(tty); spin_unlock_irqrestore(&info->slock, flags); return 0; @@ -1282,7 +1281,7 @@ static int mxser_set_serial_info(struct tty_struct *tty, if (tty_port_initialized(port)) { if (flags != (port->flags & ASYNC_SPD_MASK)) { spin_lock_irqsave(&info->slock, sl_flags); - mxser_change_speed(tty, NULL); + mxser_change_speed(tty); spin_unlock_irqrestore(&info->slock, sl_flags); } } else { @@ -1940,7 +1939,7 @@ static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termi unsigned long flags; spin_lock_irqsave(&info->slock, flags); - mxser_change_speed(tty, old_termios); + mxser_change_speed(tty); spin_unlock_irqrestore(&info->slock, flags); if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) { @@ -2369,8 +2368,7 @@ static void mxser_release_ISA_res(struct mxser_board *brd) mxser_release_vector(brd); } -static int mxser_initbrd(struct mxser_board *brd, - struct pci_dev *pdev) +static int mxser_initbrd(struct mxser_board *brd) { struct mxser_port *info; unsigned int i; @@ -2634,7 +2632,7 @@ static int mxser_probe(struct pci_dev *pdev, } /* mxser_initbrd will hook ISR. */ - retval = mxser_initbrd(brd, pdev); + retval = mxser_initbrd(brd); if (retval) goto err_rel3; @@ -2740,7 +2738,7 @@ static int __init mxser_module_init(void) brd->info->name, ioaddr[b]); /* mxser_initbrd will hook ISR. */ - if (mxser_initbrd(brd, NULL) < 0) { + if (mxser_initbrd(brd) < 0) { mxser_release_ISA_res(brd); brd->info = NULL; continue; -- cgit v1.1 From daf3930cf616792ec62c4b2ab0926525f1b5de4d Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Fri, 22 Sep 2017 15:11:56 +0300 Subject: serial: 8250_mid: Enable HSU on Intel Cedar Fork PCH Intel Cedar Fork PCH has similar HSU as has been used on Intel Denverton. Add PCI ID to get it enumerated. While here, remove DNV part form INTEL_MID_UART_DNV_FISR to show that is used not only on Intel Denverton from now on. Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_mid.c | 6 ++++-- drivers/tty/serial/8250/8250_pci.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_mid.c b/drivers/tty/serial/8250/8250_mid.c index ec957cc..b8f0b7f 100644 --- a/drivers/tty/serial/8250/8250_mid.c +++ b/drivers/tty/serial/8250/8250_mid.c @@ -23,10 +23,11 @@ #define PCI_DEVICE_ID_INTEL_PNW_UART2 0x081c #define PCI_DEVICE_ID_INTEL_PNW_UART3 0x081d #define PCI_DEVICE_ID_INTEL_TNG_UART 0x1191 +#define PCI_DEVICE_ID_INTEL_CDF_UART 0x18d8 #define PCI_DEVICE_ID_INTEL_DNV_UART 0x19d8 /* Intel MID Specific registers */ -#define INTEL_MID_UART_DNV_FISR 0x08 +#define INTEL_MID_UART_FISR 0x08 #define INTEL_MID_UART_PS 0x30 #define INTEL_MID_UART_MUL 0x34 #define INTEL_MID_UART_DIV 0x38 @@ -130,7 +131,7 @@ static int dnv_handle_irq(struct uart_port *p) { struct mid8250 *mid = p->private_data; struct uart_8250_port *up = up_to_u8250p(p); - unsigned int fisr = serial_port_in(p, INTEL_MID_UART_DNV_FISR); + unsigned int fisr = serial_port_in(p, INTEL_MID_UART_FISR); u32 status; int ret = 0; int err; @@ -377,6 +378,7 @@ static const struct pci_device_id pci_ids[] = { MID_DEVICE(PCI_DEVICE_ID_INTEL_PNW_UART2, pnw_board), MID_DEVICE(PCI_DEVICE_ID_INTEL_PNW_UART3, pnw_board), MID_DEVICE(PCI_DEVICE_ID_INTEL_TNG_UART, tng_board), + MID_DEVICE(PCI_DEVICE_ID_INTEL_CDF_UART, dnv_board), MID_DEVICE(PCI_DEVICE_ID_INTEL_DNV_UART, dnv_board), { }, }; diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index 0c101a7..a6bf59d 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -3368,6 +3368,7 @@ static const struct pci_device_id blacklist[] = { { PCI_VDEVICE(INTEL, 0x081c), }, { PCI_VDEVICE(INTEL, 0x081d), }, { PCI_VDEVICE(INTEL, 0x1191), }, + { PCI_VDEVICE(INTEL, 0x18d8), }, { PCI_VDEVICE(INTEL, 0x19d8), }, /* Intel platforms with DesignWare UART */ -- cgit v1.1 From 7464779fa8551b90d5797d4020b0bdb7e6422eb9 Mon Sep 17 00:00:00 2001 From: Andy Lowe Date: Fri, 22 Sep 2017 20:29:30 +0200 Subject: serial: sh-sci: suppress warning for ports without dma channels If a port has no dma channel defined in the device tree, then don't attempt to allocate a dma channel for the port. Also suppress the warning message concerning the failure to allocate a dma channel. Continue to emit the warning message if a dma channel is defined but cannot be allocated. Signed-off-by: Andy Lowe Signed-off-by: Eugeniu Rosca Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sh-sci.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 41bf910..9fde3df 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1506,6 +1506,14 @@ static void sci_request_dma(struct uart_port *port) return; s->cookie_tx = -EINVAL; + + /* + * Don't request a dma channel if no channel was specified + * in the device tree. + */ + if (!of_find_property(port->dev->of_node, "dmas", NULL)) + return; + chan = sci_request_dma_chan(port, DMA_MEM_TO_DEV); dev_dbg(port->dev, "%s: TX: got channel %p\n", __func__, chan); if (chan) { -- cgit v1.1 From 6263368c5b0b758d8639cad37a2a6493c9370425 Mon Sep 17 00:00:00 2001 From: Ed Blake Date: Tue, 26 Sep 2017 11:40:02 +0100 Subject: serial: Add define for max baud rate divisor Add a define for the maximum baud rate divisor, to improve code readability. Signed-off-by: Ed Blake Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_mtk.c | 2 +- drivers/tty/serial/8250/8250_omap.c | 4 ++-- drivers/tty/serial/8250/8250_port.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index fb45770..fef9823 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -61,7 +61,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, * registers to their default values. */ baud = uart_get_baud_rate(port, termios, old, - port->uartclk / 16 / 0xffff, + port->uartclk / 16 / UART_DIV_MAX, port->uartclk); if (baud <= 115200) { diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index 833771b..4938d338e0 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -199,7 +199,7 @@ static void omap_8250_get_divisor(struct uart_port *port, unsigned int baud, * Old custom speed handling. */ if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST) { - priv->quot = port->custom_divisor & 0xffff; + priv->quot = port->custom_divisor & UART_DIV_MAX; /* * I assume that nobody is using this. But hey, if somebody * would like to specify the divisor _and_ the mode then the @@ -358,7 +358,7 @@ static void omap_8250_set_termios(struct uart_port *port, * Ask the core to calculate the divisor for us. */ baud = uart_get_baud_rate(port, termios, old, - port->uartclk / 16 / 0xffff, + port->uartclk / 16 / UART_DIV_MAX, port->uartclk / 13); omap_8250_get_divisor(port, baud, priv); diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index f0cc04f..01ab218 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2601,7 +2601,7 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port, * causing transmission errors. */ return uart_get_baud_rate(port, termios, old, - port->uartclk / 16 / 0xffff, + port->uartclk / 16 / UART_DIV_MAX, port->uartclk); } -- cgit v1.1 From de9e33bdfa22e607a88494ff21e9196d00bf4550 Mon Sep 17 00:00:00 2001 From: Ed Blake Date: Tue, 26 Sep 2017 11:40:03 +0100 Subject: serial: 8250_dw: Improve clock rate setting Currently dw8250_set_termios sets the input clock to the nearest achievable rate to baudx16. If necessary, the input clock is then divided down to baudx16 using an integer divider within the UART device, with the divisor calculated in the 8250 core driver. However, the clock rate set by dw8250_set_termios and subsequently divided down could be considerably different to the target baudx16 rate, resulting in incorrect operation. This patch fixes this by iteratively searching for an input clock rate that is within +/-1.6% of an integer multiple of the target baudx16 rate. Signed-off-by: Ed Blake Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_dw.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 7e63899..10b0aca 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -256,25 +256,31 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios, struct ktermios *old) { unsigned int baud = tty_termios_baud_rate(termios); + unsigned int target_rate, min_rate, max_rate; struct dw8250_data *d = p->private_data; long rate; - int ret; + int i, ret; if (IS_ERR(d->clk) || !old) goto out; - clk_disable_unprepare(d->clk); - rate = clk_round_rate(d->clk, baud * 16); - if (rate < 0) - ret = rate; - else if (rate == 0) - ret = -ENOENT; - else - ret = clk_set_rate(d->clk, rate); - clk_prepare_enable(d->clk); + /* Find a clk rate within +/-1.6% of an integer multiple of baudx16 */ + target_rate = baud * 16; + min_rate = target_rate - (target_rate >> 6); + max_rate = target_rate + (target_rate >> 6); - if (!ret) - p->uartclk = rate; + for (i = 1; i <= UART_DIV_MAX; i++) { + rate = clk_round_rate(d->clk, i * target_rate); + if (rate >= i * min_rate && rate <= i * max_rate) + break; + } + if (i <= UART_DIV_MAX) { + clk_disable_unprepare(d->clk); + ret = clk_set_rate(d->clk, rate); + clk_prepare_enable(d->clk); + if (!ret) + p->uartclk = rate; + } out: p->status &= ~UPSTAT_AUTOCTS; -- cgit v1.1 From b00bebbc301c8e1f74f230dc82282e56b7e7a6db Mon Sep 17 00:00:00 2001 From: Jibin Xu Date: Sun, 10 Sep 2017 20:11:42 -0700 Subject: sysrq : fix Show Regs call trace on ARM When kernel configuration SMP,PREEMPT and DEBUG_PREEMPT are enabled, echo 1 >/proc/sys/kernel/sysrq echo p >/proc/sysrq-trigger kernel will print call trace as below: sysrq: SysRq : Show Regs BUG: using __this_cpu_read() in preemptible [00000000] code: sh/435 caller is __this_cpu_preempt_check+0x18/0x20 Call trace: [] dump_backtrace+0x0/0x1d0 [] show_stack+0x24/0x30 [] dump_stack+0x90/0xb0 [] check_preemption_disabled+0x100/0x108 [] __this_cpu_preempt_check+0x18/0x20 [] sysrq_handle_showregs+0x1c/0x40 [] __handle_sysrq+0x12c/0x1a0 [] write_sysrq_trigger+0x60/0x70 [] proc_reg_write+0x90/0xd0 [] __vfs_write+0x48/0x90 [] vfs_write+0xa4/0x190 [] SyS_write+0x54/0xb0 [] el0_svc_naked+0x24/0x28 This can be seen on a common board like an r-pi3. This happens because when echo p >/proc/sysrq-trigger, get_irq_regs() is called outside of IRQ context, if preemption is enabled in this situation,kernel will print the call trace. Since many prior discussions on the mailing lists have made it clear that get_irq_regs either just returns NULL or stale data when used outside of IRQ context,we simply avoid calling it outside of IRQ context. Signed-off-by: Jibin Xu Signed-off-by: Greg Kroah-Hartman --- drivers/tty/sysrq.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index 3ffc1ce..6ed8c47 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -245,8 +245,10 @@ static void sysrq_handle_showallcpus(int key) * architecture has no support for it: */ if (!trigger_all_cpu_backtrace()) { - struct pt_regs *regs = get_irq_regs(); + struct pt_regs *regs = NULL; + if (in_irq()) + regs = get_irq_regs(); if (regs) { pr_info("CPU%d:\n", smp_processor_id()); show_regs(regs); @@ -265,7 +267,10 @@ static struct sysrq_key_op sysrq_showallcpus_op = { static void sysrq_handle_showregs(int key) { - struct pt_regs *regs = get_irq_regs(); + struct pt_regs *regs = NULL; + + if (in_irq()) + regs = get_irq_regs(); if (regs) show_regs(regs); perf_event_print_debug(); -- cgit v1.1 From bccf1da3546cc7aeefadc63cd4356ab8dc04c1e3 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Mon, 2 Oct 2017 08:48:55 -0700 Subject: vt: Use consistent logging style vt has a mixture of pr_ and printk. Convert to using only pr_. Miscellanea: o Coalesce formats o Realign arguments o Add missing braces around an if/else with the printk conversion Signed-off-by: Joe Perches Signed-off-by: Greg Kroah-Hartman --- drivers/tty/vt/vt.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index ca55004..5e41fac 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -2204,7 +2204,7 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co console_lock(); vc = tty->driver_data; if (vc == NULL) { - printk(KERN_ERR "vt: argh, driver_data is NULL !\n"); + pr_err("vt: argh, driver_data is NULL !\n"); console_unlock(); return 0; } @@ -3189,20 +3189,21 @@ static int do_bind_con_driver(const struct consw *csw, int first, int last, pr_info("Console: switching "); if (!deflt) - printk(KERN_CONT "consoles %d-%d ", first+1, last+1); + pr_cont("consoles %d-%d ", first + 1, last + 1); if (j >= 0) { struct vc_data *vc = vc_cons[j].d; - printk(KERN_CONT "to %s %s %dx%d\n", - vc->vc_can_do_color ? "colour" : "mono", - desc, vc->vc_cols, vc->vc_rows); + pr_cont("to %s %s %dx%d\n", + vc->vc_can_do_color ? "colour" : "mono", + desc, vc->vc_cols, vc->vc_rows); if (k >= 0) { vc = vc_cons[k].d; update_screen(vc); } - } else - printk(KERN_CONT "to %s\n", desc); + } else { + pr_cont("to %s\n", desc); + } retval = 0; err: @@ -3621,9 +3622,8 @@ static int do_register_con_driver(const struct consw *csw, int first, int last) con_driver, con_dev_groups, "vtcon%i", con_driver->node); if (IS_ERR(con_driver->dev)) { - printk(KERN_WARNING "Unable to create device for %s; " - "errno = %ld\n", con_driver->desc, - PTR_ERR(con_driver->dev)); + pr_warn("Unable to create device for %s; errno = %ld\n", + con_driver->desc, PTR_ERR(con_driver->dev)); con_driver->dev = NULL; } else { vtconsole_init_device(con_driver); @@ -3760,8 +3760,8 @@ static int __init vtconsole_class_init(void) vtconsole_class = class_create(THIS_MODULE, "vtconsole"); if (IS_ERR(vtconsole_class)) { - printk(KERN_WARNING "Unable to create vt console class; " - "errno = %ld\n", PTR_ERR(vtconsole_class)); + pr_warn("Unable to create vt console class; errno = %ld\n", + PTR_ERR(vtconsole_class)); vtconsole_class = NULL; } @@ -3777,9 +3777,8 @@ static int __init vtconsole_class_init(void) "vtcon%i", con->node); if (IS_ERR(con->dev)) { - printk(KERN_WARNING "Unable to create " - "device for %s; errno = %ld\n", - con->desc, PTR_ERR(con->dev)); + pr_warn("Unable to create device for %s; errno = %ld\n", + con->desc, PTR_ERR(con->dev)); con->dev = NULL; } else { vtconsole_init_device(con); -- cgit v1.1 From 263763c1c5235b01b654b954d4a278c8cf5a0def Mon Sep 17 00:00:00 2001 From: Martyn Welch Date: Wed, 4 Oct 2017 17:13:27 +0100 Subject: serial: imx: Correct comment imx_flush_buffer() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comment in imx_flush_buffer() states that the state of 4 registers are to be saved/restored, then only saves and restores 3 registers. The missing register (UBRC) is read only and thus can't be restored. Update the comment to reflect reality. Signed-off-by: Martyn Welch Acked-by: Uwe Kleine-König Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index b697c1e..76818a2 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1417,10 +1417,14 @@ static void imx_flush_buffer(struct uart_port *port) /* * According to the Reference Manual description of the UART SRST bit: + * * "Reset the transmit and receive state machines, * all FIFOs and register USR1, USR2, UBIR, UBMR, UBRC, URXD, UTXD - * and UTS[6-3]". As we don't need to restore the old values from - * USR1, USR2, URXD, UTXD, only save/restore the other four registers + * and UTS[6-3]". + * + * We don't need to restore the old values from USR1, USR2, URXD and + * UTXD. UBRC is read only, so only save/restore the other three + * registers. */ ubir = readl(sport->port.membase + UBIR); ubmr = readl(sport->port.membase + UBMR); -- cgit v1.1 From 6e605a01501b20ba8ace196536899195c8d296f5 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 4 Oct 2017 14:21:56 +0200 Subject: serial: sh-sci: Use of_device_get_match_data() helper Use the of_device_get_match_data() helper instead of open coding. Note that when used with DT, there's always a valid match. Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sh-sci.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 9fde3df..c4af4c4 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -3073,17 +3074,15 @@ static struct plat_sci_port *sci_parse_dt(struct platform_device *pdev, unsigned int *dev_id) { struct device_node *np = pdev->dev.of_node; - const struct of_device_id *match; struct plat_sci_port *p; struct sci_port *sp; + const void *data; int id; if (!IS_ENABLED(CONFIG_OF) || !np) return NULL; - match = of_match_node(of_sci_match, np); - if (!match) - return NULL; + data = of_device_get_match_data(&pdev->dev); p = devm_kzalloc(&pdev->dev, sizeof(struct plat_sci_port), GFP_KERNEL); if (!p) @@ -3099,8 +3098,8 @@ static struct plat_sci_port *sci_parse_dt(struct platform_device *pdev, sp = &sci_ports[id]; *dev_id = id; - p->type = SCI_OF_TYPE(match->data); - p->regtype = SCI_OF_REGTYPE(match->data); + p->type = SCI_OF_TYPE(data); + p->regtype = SCI_OF_REGTYPE(data); sp->has_rtscts = of_property_read_bool(np, "uart-has-rtscts"); -- cgit v1.1 From dd076cffb8cd675a8973fc9b6cea0c04be6f0111 Mon Sep 17 00:00:00 2001 From: Matthias Kaehlcke Date: Mon, 9 Oct 2017 18:26:22 -0700 Subject: serial: sh-sci: Fix init data attribute for struct 'port_cfg' The __init attribute is meant to mark functions, use __initdata instead for the data structure. This fixes the following error when building with clang: drivers/tty/serial/sh-sci.c:3247:15: error: '__section__' attribute only applies to functions, methods, properties, and global variables static struct __init plat_sci_port port_cfg; Signed-off-by: Matthias Kaehlcke Reviewed-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sh-sci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index c4af4c4..d5714de 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -3273,7 +3273,7 @@ early_platform_init_buffer("earlyprintk", &sci_driver, early_serial_buf, ARRAY_SIZE(early_serial_buf)); #endif #ifdef CONFIG_SERIAL_SH_SCI_EARLYCON -static struct __init plat_sci_port port_cfg; +static struct plat_sci_port port_cfg __initdata; static int __init early_console_setup(struct earlycon_device *device, int type) -- cgit v1.1 From 8ffb82094be8ade4f5e60996edcc8afbbcb4f1f4 Mon Sep 17 00:00:00 2001 From: Meng Xu Date: Wed, 4 Oct 2017 10:38:37 -0400 Subject: tty: vt: remove multi-fetch, derive font.height from font.data In con_font_set(), when we need to guess font height (for compat reasons?), the current approach uses multiple userspace fetches, i.e., get_user(tmp, &charmap[32*i+h-1]), to derive the height. This has two drawbacks: 1. performance: accessing userspace memory is less efficient than directly de-reference the byte 2. security: a more critical problem is that the height derived might not match with the actual font.data. This is because a user thread might race condition to change the memory of op->data after the op->height guessing but before the second fetch: font.data = memdup_user(op->data, size). Leaving font.height = 32 while the actual height is 1 or vice-versa. This patch tries to resolve both issues by re-locating the height guessing part after the font.data is fetched in. In this way, the userspace data is fetched in one shot and we directly dereference the font.data in kernel space to probe for the height. Signed-off-by: Meng Xu Signed-off-by: Greg Kroah-Hartman --- drivers/tty/vt/vt.c | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 5e41fac..e504923 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -4119,37 +4119,45 @@ static int con_font_set(struct vc_data *vc, struct console_font_op *op) return -EINVAL; if (op->charcount > 512) return -EINVAL; + if (op->width <= 0 || op->width > 32 || op->height > 32) + return -EINVAL; + size = (op->width+7)/8 * 32 * op->charcount; + if (size > max_font_size) + return -ENOSPC; + + font.data = memdup_user(op->data, size); + if (IS_ERR(font.data)) + return PTR_ERR(font.data); + if (!op->height) { /* Need to guess font height [compat] */ int h, i; - u8 __user *charmap = op->data; - u8 tmp; - - /* If from KDFONTOP ioctl, don't allow things which can be done in userland, - so that we can get rid of this soon */ - if (!(op->flags & KD_FONT_FLAG_OLD)) + u8 *charmap = font.data; + + /* + * If from KDFONTOP ioctl, don't allow things which can be done + * in userland,so that we can get rid of this soon + */ + if (!(op->flags & KD_FONT_FLAG_OLD)) { + kfree(font.data); return -EINVAL; + } + for (h = 32; h > 0; h--) - for (i = 0; i < op->charcount; i++) { - if (get_user(tmp, &charmap[32*i+h-1])) - return -EFAULT; - if (tmp) + for (i = 0; i < op->charcount; i++) + if (charmap[32*i+h-1]) goto nonzero; - } + + kfree(font.data); return -EINVAL; + nonzero: op->height = h; } - if (op->width <= 0 || op->width > 32 || op->height > 32) - return -EINVAL; - size = (op->width+7)/8 * 32 * op->charcount; - if (size > max_font_size) - return -ENOSPC; + font.charcount = op->charcount; - font.height = op->height; font.width = op->width; - font.data = memdup_user(op->data, size); - if (IS_ERR(font.data)) - return PTR_ERR(font.data); + font.height = op->height; + console_lock(); if (vc->vc_mode != KD_TEXT) rc = -EINVAL; -- cgit v1.1 From 0ab84da2e076948c49d36197ee7d254125c53eab Mon Sep 17 00:00:00 2001 From: Aaron Sierra Date: Wed, 4 Oct 2017 10:01:28 -0500 Subject: serial: 8250: Preserve DLD[7:4] for PORT_XR17V35X The upper four bits of the XR17V35x fractional divisor register (DLD) control general chip function (RS-485 direction pin polarity, multidrop mode, XON/XOFF parity check, and fast IR mode). Don't allow these bits to be clobbered when setting the baudrate. Signed-off-by: Aaron Sierra Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_port.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 01ab218..c2fb92f 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2586,8 +2586,11 @@ static void serial8250_set_divisor(struct uart_port *port, unsigned int baud, serial_dl_write(up, quot); /* XR17V35x UARTs have an extra fractional divisor register (DLD) */ - if (up->port.type == PORT_XR17V35X) + if (up->port.type == PORT_XR17V35X) { + /* Preserve bits not related to baudrate; DLD[7:4]. */ + quot_frac |= serial_port_in(port, 0x2) & 0xf0; serial_port_out(port, 0x2, quot_frac); + } } static unsigned int serial8250_get_baud_rate(struct uart_port *port, -- cgit v1.1 From fd97e66c5529046e989a0879c3bb58fddb592c71 Mon Sep 17 00:00:00 2001 From: "Ji-Ze Hong (Peter Hong)" Date: Tue, 17 Oct 2017 14:23:08 +0800 Subject: serial: 8250_fintek: Fix finding base_port with activated SuperIO The SuperIO will be configured at boot time by BIOS, but some BIOS will not deactivate the SuperIO when the end of configuration. It'll lead to mismatch for pdata->base_port in probe_setup_port(). So we'll deactivate all SuperIO before activate special base_port in fintek_8250_enter_key(). Tested on iBASE MI802. Cc: stable@vger.kernel.org Tested-by: Ji-Ze Hong (Peter Hong) Signed-off-by: Ji-Ze Hong (Peter Hong) Reviewd-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_fintek.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index 96cc45f..b346239 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -128,6 +128,9 @@ static int fintek_8250_enter_key(u16 base_port, u8 key) if (!request_muxed_region(base_port, 2, "8250_fintek")) return -EBUSY; + /* Force to deactive all SuperIO in this base_port */ + outb(EXIT_KEY, base_port + ADDR_PORT); + outb(key, base_port + ADDR_PORT); outb(key, base_port + ADDR_PORT); return 0; -- cgit v1.1 From 54ff200e66f837da9b0b24570a02d95d67d1d42f Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Mon, 16 Oct 2017 16:28:36 -0700 Subject: tty: metag_da: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: James Hogan Cc: Jiri Slaby Cc: linux-metag@vger.kernel.org Signed-off-by: Kees Cook Acked-by: James Hogan Signed-off-by: Greg Kroah-Hartman --- drivers/tty/metag_da.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/metag_da.c b/drivers/tty/metag_da.c index 25ccef2..82ccf39 100644 --- a/drivers/tty/metag_da.c +++ b/drivers/tty/metag_da.c @@ -309,7 +309,7 @@ static int put_data(void *arg) /* * This gets called every DA_TTY_POLL and polls the channels for data */ -static void dashtty_timer(unsigned long ignored) +static void dashtty_timer(struct timer_list *poll_timer) { int channel; @@ -323,12 +323,12 @@ static void dashtty_timer(unsigned long ignored) if (channel >= 0) fetch_data(channel); - mod_timer(&poll_timer, jiffies + DA_TTY_POLL); + mod_timer(poll_timer, jiffies + DA_TTY_POLL); } static void add_poll_timer(struct timer_list *poll_timer) { - setup_pinned_timer(poll_timer, dashtty_timer, 0); + timer_setup(poll_timer, dashtty_timer, TIMER_PINNED); poll_timer->expires = jiffies + DA_TTY_POLL; /* @@ -461,7 +461,7 @@ static void dashtty_hangup(struct tty_struct *tty) * buffers. It is used to delay the expensive writeout until the writer has * stopped writing. */ -static void dashtty_put_timer(unsigned long ignored) +static void dashtty_put_timer(struct timer_list *unused) { if (atomic_read(&dashtty_xmit_cnt)) wake_up_interruptible(&dashtty_waitqueue); @@ -603,7 +603,7 @@ static int __init dashtty_init(void) complete(&dport->xmit_empty); } - setup_timer(&put_timer, dashtty_put_timer, 0); + timer_setup(&put_timer, dashtty_put_timer, 0); init_waitqueue_head(&dashtty_waitqueue); dashtty_thread = kthread_create(put_data, NULL, "ttyDA"); -- cgit v1.1 From f0f62c67dd53ce0ed26ad2940be1dfff5c3d7bd9 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Mon, 16 Oct 2017 16:27:37 -0700 Subject: serial: m32r_sio: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/m32r_sio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/m32r_sio.c index 5b3bd95..5f4003a 100644 --- a/drivers/tty/serial/m32r_sio.c +++ b/drivers/tty/serial/m32r_sio.c @@ -511,9 +511,9 @@ static void serial_unlink_irq_chain(struct uart_sio_port *up) /* * This function is used to handle ports that do not have an interrupt. */ -static void m32r_sio_timeout(unsigned long data) +static void m32r_sio_timeout(struct timer_list *t) { - struct uart_sio_port *up = (struct uart_sio_port *)data; + struct uart_sio_port *up = from_timer(up, t, timer); unsigned int timeout; unsigned int sts; @@ -907,8 +907,7 @@ static void __init m32r_sio_register_ports(struct uart_driver *drv) up->port.line = i; up->port.ops = &m32r_sio_pops; - init_timer(&up->timer); - up->timer.function = m32r_sio_timeout; + timer_setup(&up->timer, m32r_sio_timeout, 0); uart_add_one_port(drv, &up->port); } -- cgit v1.1 From 8c318fa93dfcd153e2f3c26cd4611238707b91cb Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Mon, 16 Oct 2017 16:28:51 -0700 Subject: tty/sysrq: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Jiri Slaby Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- drivers/tty/sysrq.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index 6ed8c47..ecee833 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -653,9 +653,9 @@ static void sysrq_parse_reset_sequence(struct sysrq_state *state) state->reset_seq_version = sysrq_reset_seq_version; } -static void sysrq_do_reset(unsigned long _state) +static void sysrq_do_reset(struct timer_list *t) { - struct sysrq_state *state = (struct sysrq_state *) _state; + struct sysrq_state *state = from_timer(state, t, keyreset_timer); state->reset_requested = true; @@ -672,7 +672,7 @@ static void sysrq_handle_reset_request(struct sysrq_state *state) mod_timer(&state->keyreset_timer, jiffies + msecs_to_jiffies(sysrq_reset_downtime_ms)); else - sysrq_do_reset((unsigned long)state); + sysrq_do_reset(&state->keyreset_timer); } static void sysrq_detect_reset_sequence(struct sysrq_state *state, @@ -908,8 +908,7 @@ static int sysrq_connect(struct input_handler *handler, sysrq->handle.handler = handler; sysrq->handle.name = "sysrq"; sysrq->handle.private = sysrq; - setup_timer(&sysrq->keyreset_timer, - sysrq_do_reset, (unsigned long)sysrq); + timer_setup(&sysrq->keyreset_timer, sysrq_do_reset, 0); error = input_register_handle(&sysrq->handle); if (error) { -- cgit v1.1 From 75d1760f4cd1b2dc9f41b4218bc78b5678a0f184 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Mon, 16 Oct 2017 16:29:33 -0700 Subject: tty: mips_ejtag_fdc: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Jiri Slaby Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- drivers/tty/mips_ejtag_fdc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/mips_ejtag_fdc.c b/drivers/tty/mips_ejtag_fdc.c index a2dab3f..51678f3 100644 --- a/drivers/tty/mips_ejtag_fdc.c +++ b/drivers/tty/mips_ejtag_fdc.c @@ -683,9 +683,9 @@ static irqreturn_t mips_ejtag_fdc_isr(int irq, void *dev_id) * It simply triggers the common FDC handler code and arranges for further * polling. */ -static void mips_ejtag_fdc_tty_timer(unsigned long opaque) +static void mips_ejtag_fdc_tty_timer(struct timer_list *t) { - struct mips_ejtag_fdc_tty *priv = (void *)opaque; + struct mips_ejtag_fdc_tty *priv = from_timer(priv, t, poll_timer); mips_ejtag_fdc_handle(priv); if (!priv->removing) @@ -1002,8 +1002,8 @@ static int mips_ejtag_fdc_tty_probe(struct mips_cdmm_device *dev) raw_spin_unlock_irq(&priv->lock); } else { /* If we didn't get an usable IRQ, poll instead */ - setup_pinned_timer(&priv->poll_timer, mips_ejtag_fdc_tty_timer, - (unsigned long)priv); + timer_setup(&priv->poll_timer, mips_ejtag_fdc_tty_timer, + TIMER_PINNED); priv->poll_timer.expires = jiffies + FDC_TTY_POLL; /* * Always attach the timer to the right CPU. The channels are -- cgit v1.1 From f7f730968264c142cf4de298f3d2ca89ede07aa9 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Mon, 16 Oct 2017 16:28:45 -0700 Subject: tty: amba-pl011: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Russell King Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/amba-pl011.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 111e6a9..dab3636 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1078,9 +1078,9 @@ static inline void pl011_dma_rx_stop(struct uart_amba_port *uap) * Every polling, It checks the residue in the dma buffer and transfer * data to the tty. Also, last_residue is updated for the next polling. */ -static void pl011_dma_rx_poll(unsigned long args) +static void pl011_dma_rx_poll(struct timer_list *t) { - struct uart_amba_port *uap = (struct uart_amba_port *)args; + struct uart_amba_port *uap = from_timer(uap, t, dmarx.timer); struct tty_port *port = &uap->port.state->port; struct pl011_dmarx_data *dmarx = &uap->dmarx; struct dma_chan *rxchan = uap->dmarx.chan; @@ -1192,9 +1192,7 @@ skip_rx: dev_dbg(uap->port.dev, "could not trigger initial " "RX DMA job, fall back to interrupt mode\n"); if (uap->dmarx.poll_rate) { - init_timer(&(uap->dmarx.timer)); - uap->dmarx.timer.function = pl011_dma_rx_poll; - uap->dmarx.timer.data = (unsigned long)uap; + timer_setup(&uap->dmarx.timer, pl011_dma_rx_poll, 0); mod_timer(&uap->dmarx.timer, jiffies + msecs_to_jiffies(uap->dmarx.poll_rate)); -- cgit v1.1 From 22b276a4072087e7b7f1723ccd8a1aa18fab8bbf Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Mon, 9 Oct 2017 11:41:33 +0200 Subject: serdev: enable TTY port controller support by default Amend the Serial device bus Kconfig entries to clarify that you most likely also want to enable TTY port controller support, and make SERIAL_DEV_CTRL_TTYPORT default to Y (when bus support is enabled). Note that the TTY port controller is currently the only in-kernel serdev controller implementation. Signed-off-by: Johan Hovold Reviewed-by: Sebastian Reichel Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serdev/Kconfig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serdev/Kconfig b/drivers/tty/serdev/Kconfig index cdc6b82..1dbc835 100644 --- a/drivers/tty/serdev/Kconfig +++ b/drivers/tty/serdev/Kconfig @@ -6,11 +6,19 @@ menuconfig SERIAL_DEV_BUS help Core support for devices connected via a serial port. + Note that you typically also want to enable TTY port controller support. + if SERIAL_DEV_BUS config SERIAL_DEV_CTRL_TTYPORT bool "Serial device TTY port controller" + help + Say Y here if you want to use the Serial device bus with common TTY + drivers (e.g. serial drivers). + + If unsure, say Y. depends on TTY depends on SERIAL_DEV_BUS != m + default y endif -- cgit v1.1 From bdff14808679ef913dc10611f1bfcc3276665967 Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Fri, 6 Oct 2017 17:04:18 +0530 Subject: serial-uartlite: pr_err() strings should end with newlines pr_err() messages should end with a new-line to avoid other messages being concatenated. Signed-off-by: Arvind Yadav Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/uartlite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index c9b8d70..1de9942 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -739,7 +739,7 @@ static int __init ulite_init(void) err_plat: uart_unregister_driver(&ulite_uart_driver); err_uart: - pr_err("registering uartlite driver failed: err=%i", ret); + pr_err("registering uartlite driver failed: err=%i\n", ret); return ret; } -- cgit v1.1 From 02c3333037be2d6d44bcef5462535a7411ef07c3 Mon Sep 17 00:00:00 2001 From: Yehuda Yitschak Date: Fri, 13 Oct 2017 11:01:47 +0200 Subject: serial: mvebu-uart: use driver name when requesting an interrupt Use the driver name when requesting an interrupt for consistency. Avoids possible confusion with DW8250 driver interrupt names in /proc/interrupts. Signed-off-by: Yehuda Yitschak Signed-off-by: Miquel Raynal Reviewed-by: Gregory CLEMENT Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 45b57c2..7e0a3e9 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -90,6 +90,7 @@ #define MVEBU_NR_UARTS 1 #define MVEBU_UART_TYPE "mvebu-uart" +#define DRIVER_NAME "mvebu_serial" static struct uart_port mvebu_uart_ports[MVEBU_NR_UARTS]; @@ -287,8 +288,8 @@ static int mvebu_uart_startup(struct uart_port *port) udelay(1); writel(CTRL_RX_INT, port->membase + UART_CTRL); - ret = request_irq(port->irq, mvebu_uart_isr, port->irqflags, "serial", - port); + ret = request_irq(port->irq, mvebu_uart_isr, port->irqflags, + DRIVER_NAME, port); if (ret) { dev_err(port->dev, "failed to request irq\n"); return ret; @@ -538,7 +539,7 @@ console_initcall(mvebu_uart_console_init); static struct uart_driver mvebu_uart_driver = { .owner = THIS_MODULE, - .driver_name = "mvebu_serial", + .driver_name = DRIVER_NAME, .dev_name = "ttyMV", .nr = MVEBU_NR_UARTS, #ifdef CONFIG_SERIAL_MVEBU_CONSOLE -- cgit v1.1 From 94228f9561bb6c7eb951e415f5497db52cca40f7 Mon Sep 17 00:00:00 2001 From: Allen Yan Date: Fri, 13 Oct 2017 11:01:48 +0200 Subject: serial: mvebu-uart: support probe of multiple ports Until now, the mvebu-uart driver only supported probing a single UART port. However, some platforms have multiple instances of this UART controller, and therefore the driver should support multiple ports. In order to achieve this, we make sure to assign port->line properly, instead of hardcoding it to zero. Signed-off-by: Allen Yan Signed-off-by: Miquel Raynal Acked-by: Gregory CLEMENT Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 7e0a3e9..f3c7271 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -547,20 +547,36 @@ static struct uart_driver mvebu_uart_driver = { #endif }; +/* Counter to keep track of each UART port id when not using CONFIG_OF */ +static int uart_num_counter; + static int mvebu_uart_probe(struct platform_device *pdev) { struct resource *reg = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct resource *irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); struct uart_port *port; struct mvebu_uart_data *data; - int ret; + int ret, id; if (!reg || !irq) { dev_err(&pdev->dev, "no registers/irq defined\n"); return -EINVAL; } - port = &mvebu_uart_ports[0]; + /* Assume that all UART ports have a DT alias or none has */ + id = of_alias_get_id(pdev->dev.of_node, "serial"); + if (!pdev->dev.of_node || id < 0) + pdev->id = uart_num_counter++; + else + pdev->id = id; + + if (pdev->id >= MVEBU_NR_UARTS) { + dev_err(&pdev->dev, "cannot have more than %d UART ports\n", + MVEBU_NR_UARTS); + return -EINVAL; + } + + port = &mvebu_uart_ports[pdev->id]; spin_lock_init(&port->lock); @@ -572,7 +588,7 @@ static int mvebu_uart_probe(struct platform_device *pdev) port->fifosize = 32; port->iotype = UPIO_MEM32; port->flags = UPF_FIXED_PORT; - port->line = 0; /* single port: force line number to 0 */ + port->line = pdev->id; port->irq = irq->start; port->irqflags = 0; -- cgit v1.1 From 5218d76958644aa06de5d9bc5bf62d5c503e6e35 Mon Sep 17 00:00:00 2001 From: Miquel Raynal Date: Fri, 13 Oct 2017 11:01:49 +0200 Subject: serial: mvebu-uart: use a generic way to access the registers There are two UART ports on Armada3700. The second UART is based on the first one, plus additional features, but it has a different register layout (some bit fields are also moved inside the registers). Clearly separate register offsets and bit fields that differ between the standard and the extended IP. Access them in a generic way. Rename the defines with the "STD" prefix for future distinction with "EXT" defines. Point to these defines in the main driver data structure. The early console only uses the standard port (not extended). Suggested-by: Wilson Ding Signed-off-by: Miquel Raynal Reviewed-by: Gregory CLEMENT Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 213 ++++++++++++++++++++++++++-------------- 1 file changed, 140 insertions(+), 73 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index f3c7271..900fe85 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -38,46 +38,32 @@ #include /* Register Map */ -#define UART_RBR 0x00 -#define RBR_BRK_DET BIT(15) -#define RBR_FRM_ERR_DET BIT(14) -#define RBR_PAR_ERR_DET BIT(13) -#define RBR_OVR_ERR_DET BIT(12) +#define UART_STD_RBR 0x00 -#define UART_TSH 0x04 +#define UART_STD_TSH 0x04 -#define UART_CTRL 0x08 +#define UART_STD_CTRL1 0x08 #define CTRL_SOFT_RST BIT(31) #define CTRL_TXFIFO_RST BIT(15) #define CTRL_RXFIFO_RST BIT(14) -#define CTRL_ST_MIRR_EN BIT(13) -#define CTRL_LPBK_EN BIT(12) #define CTRL_SND_BRK_SEQ BIT(11) -#define CTRL_PAR_EN BIT(10) -#define CTRL_TWO_STOP BIT(9) -#define CTRL_TX_HFL_INT BIT(8) -#define CTRL_RX_HFL_INT BIT(7) -#define CTRL_TX_EMP_INT BIT(6) -#define CTRL_TX_RDY_INT BIT(5) -#define CTRL_RX_RDY_INT BIT(4) #define CTRL_BRK_DET_INT BIT(3) #define CTRL_FRM_ERR_INT BIT(2) #define CTRL_PAR_ERR_INT BIT(1) #define CTRL_OVR_ERR_INT BIT(0) -#define CTRL_RX_INT (CTRL_RX_RDY_INT | CTRL_BRK_DET_INT |\ - CTRL_FRM_ERR_INT | CTRL_PAR_ERR_INT | CTRL_OVR_ERR_INT) +#define CTRL_BRK_INT (CTRL_BRK_DET_INT | CTRL_FRM_ERR_INT | \ + CTRL_PAR_ERR_INT | CTRL_OVR_ERR_INT) -#define UART_STAT 0x0c +#define UART_STD_CTRL2 UART_STD_CTRL1 +#define CTRL_STD_TX_RDY_INT BIT(5) +#define CTRL_STD_RX_RDY_INT BIT(4) + +#define UART_STAT 0x0C #define STAT_TX_FIFO_EMP BIT(13) -#define STAT_RX_FIFO_EMP BIT(12) #define STAT_TX_FIFO_FUL BIT(11) -#define STAT_TX_FIFO_HFL BIT(10) -#define STAT_RX_TOGL BIT(9) -#define STAT_RX_FIFO_FUL BIT(8) -#define STAT_RX_FIFO_HFL BIT(7) #define STAT_TX_EMP BIT(6) -#define STAT_TX_RDY BIT(5) -#define STAT_RX_RDY BIT(4) +#define STAT_STD_TX_RDY BIT(5) +#define STAT_STD_RX_RDY BIT(4) #define STAT_BRK_DET BIT(3) #define STAT_FRM_ERR BIT(2) #define STAT_PAR_ERR BIT(1) @@ -92,13 +78,55 @@ #define MVEBU_UART_TYPE "mvebu-uart" #define DRIVER_NAME "mvebu_serial" -static struct uart_port mvebu_uart_ports[MVEBU_NR_UARTS]; +/* Register offsets, different depending on the UART */ +struct uart_regs_layout { + unsigned int rbr; + unsigned int tsh; + unsigned int ctrl; + unsigned int intr; +}; + +/* Diverging flags */ +struct uart_flags { + unsigned int ctrl_tx_rdy_int; + unsigned int ctrl_rx_rdy_int; + unsigned int stat_tx_rdy; + unsigned int stat_rx_rdy; +}; + +/* Driver data, a structure for each UART port */ +struct mvebu_uart_driver_data { + bool is_ext; + struct uart_regs_layout regs; + struct uart_flags flags; +}; -struct mvebu_uart_data { +/* MVEBU UART driver structure */ +struct mvebu_uart { struct uart_port *port; - struct clk *clk; + struct clk *clk; + struct mvebu_uart_driver_data *data; }; +static struct mvebu_uart *to_mvuart(struct uart_port *port) +{ + return (struct mvebu_uart *)port->private_data; +} + +#define IS_EXTENDED(port) (to_mvuart(port)->data->is_ext) + +#define UART_RBR(port) (to_mvuart(port)->data->regs.rbr) +#define UART_TSH(port) (to_mvuart(port)->data->regs.tsh) +#define UART_CTRL(port) (to_mvuart(port)->data->regs.ctrl) +#define UART_INTR(port) (to_mvuart(port)->data->regs.intr) + +#define CTRL_TX_RDY_INT(port) (to_mvuart(port)->data->flags.ctrl_tx_rdy_int) +#define CTRL_RX_RDY_INT(port) (to_mvuart(port)->data->flags.ctrl_rx_rdy_int) +#define STAT_TX_RDY(port) (to_mvuart(port)->data->flags.stat_tx_rdy) +#define STAT_RX_RDY(port) (to_mvuart(port)->data->flags.stat_rx_rdy) + +static struct uart_port mvebu_uart_ports[MVEBU_NR_UARTS]; + /* Core UART Driver Operations */ static unsigned int mvebu_uart_tx_empty(struct uart_port *port) { @@ -128,26 +156,31 @@ static void mvebu_uart_set_mctrl(struct uart_port *port, static void mvebu_uart_stop_tx(struct uart_port *port) { - unsigned int ctl = readl(port->membase + UART_CTRL); + unsigned int ctl = readl(port->membase + UART_INTR(port)); - ctl &= ~CTRL_TX_RDY_INT; - writel(ctl, port->membase + UART_CTRL); + ctl &= ~CTRL_TX_RDY_INT(port); + writel(ctl, port->membase + UART_INTR(port)); } static void mvebu_uart_start_tx(struct uart_port *port) { - unsigned int ctl = readl(port->membase + UART_CTRL); + unsigned int ctl = readl(port->membase + UART_INTR(port)); - ctl |= CTRL_TX_RDY_INT; - writel(ctl, port->membase + UART_CTRL); + ctl |= CTRL_TX_RDY_INT(port); + writel(ctl, port->membase + UART_INTR(port)); } static void mvebu_uart_stop_rx(struct uart_port *port) { - unsigned int ctl = readl(port->membase + UART_CTRL); + unsigned int ctl; - ctl &= ~CTRL_RX_INT; - writel(ctl, port->membase + UART_CTRL); + ctl = readl(port->membase + UART_CTRL(port)); + ctl &= ~CTRL_BRK_INT; + writel(ctl, port->membase + UART_CTRL(port)); + + ctl = readl(port->membase + UART_INTR(port)); + ctl &= ~CTRL_RX_RDY_INT(port); + writel(ctl, port->membase + UART_INTR(port)); } static void mvebu_uart_break_ctl(struct uart_port *port, int brk) @@ -156,12 +189,12 @@ static void mvebu_uart_break_ctl(struct uart_port *port, int brk) unsigned long flags; spin_lock_irqsave(&port->lock, flags); - ctl = readl(port->membase + UART_CTRL); + ctl = readl(port->membase + UART_CTRL(port)); if (brk == -1) ctl |= CTRL_SND_BRK_SEQ; else ctl &= ~CTRL_SND_BRK_SEQ; - writel(ctl, port->membase + UART_CTRL); + writel(ctl, port->membase + UART_CTRL(port)); spin_unlock_irqrestore(&port->lock, flags); } @@ -172,8 +205,8 @@ static void mvebu_uart_rx_chars(struct uart_port *port, unsigned int status) char flag = 0; do { - if (status & STAT_RX_RDY) { - ch = readl(port->membase + UART_RBR); + if (status & STAT_RX_RDY(port)) { + ch = readl(port->membase + UART_RBR(port)); ch &= 0xff; flag = TTY_NORMAL; port->icount.rx++; @@ -199,7 +232,7 @@ static void mvebu_uart_rx_chars(struct uart_port *port, unsigned int status) goto ignore_char; if (status & port->ignore_status_mask & STAT_PAR_ERR) - status &= ~STAT_RX_RDY; + status &= ~STAT_RX_RDY(port); status &= port->read_status_mask; @@ -208,7 +241,7 @@ static void mvebu_uart_rx_chars(struct uart_port *port, unsigned int status) status &= ~port->ignore_status_mask; - if (status & STAT_RX_RDY) + if (status & STAT_RX_RDY(port)) tty_insert_flip_char(tport, ch, flag); if (status & STAT_BRK_DET) @@ -222,7 +255,7 @@ static void mvebu_uart_rx_chars(struct uart_port *port, unsigned int status) ignore_char: status = readl(port->membase + UART_STAT); - } while (status & (STAT_RX_RDY | STAT_BRK_DET)); + } while (status & (STAT_RX_RDY(port) | STAT_BRK_DET)); tty_flip_buffer_push(tport); } @@ -234,7 +267,7 @@ static void mvebu_uart_tx_chars(struct uart_port *port, unsigned int status) unsigned int st; if (port->x_char) { - writel(port->x_char, port->membase + UART_TSH); + writel(port->x_char, port->membase + UART_TSH(port)); port->icount.tx++; port->x_char = 0; return; @@ -246,7 +279,7 @@ static void mvebu_uart_tx_chars(struct uart_port *port, unsigned int status) } for (count = 0; count < port->fifosize; count++) { - writel(xmit->buf[xmit->tail], port->membase + UART_TSH); + writel(xmit->buf[xmit->tail], port->membase + UART_TSH(port)); xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; @@ -270,10 +303,11 @@ static irqreturn_t mvebu_uart_isr(int irq, void *dev_id) struct uart_port *port = (struct uart_port *)dev_id; unsigned int st = readl(port->membase + UART_STAT); - if (st & (STAT_RX_RDY | STAT_OVR_ERR | STAT_FRM_ERR | STAT_BRK_DET)) + if (st & (STAT_RX_RDY(port) | STAT_OVR_ERR | STAT_FRM_ERR | + STAT_BRK_DET)) mvebu_uart_rx_chars(port, st); - if (st & STAT_TX_RDY) + if (st & STAT_TX_RDY(port)) mvebu_uart_tx_chars(port, st); return IRQ_HANDLED; @@ -281,12 +315,17 @@ static irqreturn_t mvebu_uart_isr(int irq, void *dev_id) static int mvebu_uart_startup(struct uart_port *port) { + unsigned int ctl; int ret; writel(CTRL_TXFIFO_RST | CTRL_RXFIFO_RST, - port->membase + UART_CTRL); + port->membase + UART_CTRL(port)); udelay(1); - writel(CTRL_RX_INT, port->membase + UART_CTRL); + writel(CTRL_BRK_INT, port->membase + UART_CTRL(port)); + + ctl = readl(port->membase + UART_INTR(port)); + ctl |= CTRL_RX_RDY_INT(port); + writel(ctl, port->membase + UART_INTR(port)); ret = request_irq(port->irq, mvebu_uart_isr, port->irqflags, DRIVER_NAME, port); @@ -300,7 +339,7 @@ static int mvebu_uart_startup(struct uart_port *port) static void mvebu_uart_shutdown(struct uart_port *port) { - writel(0, port->membase + UART_CTRL); + writel(0, port->membase + UART_INTR(port)); free_irq(port->irq, port); } @@ -314,8 +353,8 @@ static void mvebu_uart_set_termios(struct uart_port *port, spin_lock_irqsave(&port->lock, flags); - port->read_status_mask = STAT_RX_RDY | STAT_OVR_ERR | - STAT_TX_RDY | STAT_TX_FIFO_FUL; + port->read_status_mask = STAT_RX_RDY(port) | STAT_OVR_ERR | + STAT_TX_RDY(port) | STAT_TX_FIFO_FUL; if (termios->c_iflag & INPCK) port->read_status_mask |= STAT_FRM_ERR | STAT_PAR_ERR; @@ -326,7 +365,7 @@ static void mvebu_uart_set_termios(struct uart_port *port, STAT_FRM_ERR | STAT_PAR_ERR | STAT_OVR_ERR; if ((termios->c_cflag & CREAD) == 0) - port->ignore_status_mask |= STAT_RX_RDY | STAT_BRK_ERR; + port->ignore_status_mask |= STAT_RX_RDY(port) | STAT_BRK_ERR; if (old) tty_termios_copy_hw(termios, old); @@ -357,10 +396,10 @@ static int mvebu_uart_get_poll_char(struct uart_port *port) { unsigned int st = readl(port->membase + UART_STAT); - if (!(st & STAT_RX_RDY)) + if (!(st & STAT_RX_RDY(port))) return NO_POLL_CHAR; - return readl(port->membase + UART_RBR); + return readl(port->membase + UART_RBR(port)); } static void mvebu_uart_put_poll_char(struct uart_port *port, unsigned char c) @@ -376,7 +415,7 @@ static void mvebu_uart_put_poll_char(struct uart_port *port, unsigned char c) udelay(1); } - writel(c, port->membase + UART_TSH); + writel(c, port->membase + UART_TSH(port)); } #endif @@ -414,7 +453,8 @@ static void mvebu_uart_putc(struct uart_port *port, int c) break; } - writel(c, port->membase + UART_TSH); + /* At early stage, DT is not parsed yet, only use UART0 */ + writel(c, port->membase + UART_STD_TSH); for (;;) { st = readl(port->membase + UART_STAT); @@ -459,7 +499,7 @@ static void wait_for_xmitr(struct uart_port *port) static void mvebu_uart_console_putchar(struct uart_port *port, int ch) { wait_for_xmitr(port); - writel(ch, port->membase + UART_TSH); + writel(ch, port->membase + UART_TSH(port)); } static void mvebu_uart_console_write(struct console *co, const char *s, @@ -467,7 +507,7 @@ static void mvebu_uart_console_write(struct console *co, const char *s, { struct uart_port *port = &mvebu_uart_ports[co->index]; unsigned long flags; - unsigned int ier; + unsigned int ier, intr, ctl; int locked = 1; if (oops_in_progress) @@ -475,16 +515,23 @@ static void mvebu_uart_console_write(struct console *co, const char *s, else spin_lock_irqsave(&port->lock, flags); - ier = readl(port->membase + UART_CTRL) & - (CTRL_RX_INT | CTRL_TX_RDY_INT); - writel(0, port->membase + UART_CTRL); + ier = readl(port->membase + UART_CTRL(port)) & CTRL_BRK_INT; + intr = readl(port->membase + UART_INTR(port)) & + (CTRL_RX_RDY_INT(port) | CTRL_TX_RDY_INT(port)); + writel(0, port->membase + UART_CTRL(port)); + writel(0, port->membase + UART_INTR(port)); uart_console_write(port, s, count, mvebu_uart_console_putchar); wait_for_xmitr(port); if (ier) - writel(ier, port->membase + UART_CTRL); + writel(ier, port->membase + UART_CTRL(port)); + + if (intr) { + ctl = intr | readl(port->membase + UART_INTR(port)); + writel(ctl, port->membase + UART_INTR(port)); + } if (locked) spin_unlock_irqrestore(&port->lock, flags); @@ -547,6 +594,8 @@ static struct uart_driver mvebu_uart_driver = { #endif }; +static const struct of_device_id mvebu_uart_of_match[]; + /* Counter to keep track of each UART port id when not using CONFIG_OF */ static int uart_num_counter; @@ -554,8 +603,10 @@ static int mvebu_uart_probe(struct platform_device *pdev) { struct resource *reg = platform_get_resource(pdev, IORESOURCE_MEM, 0); struct resource *irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + const struct of_device_id *match = of_match_device(mvebu_uart_of_match, + &pdev->dev); struct uart_port *port; - struct mvebu_uart_data *data; + struct mvebu_uart *mvuart; int ret, id; if (!reg || !irq) { @@ -598,15 +649,16 @@ static int mvebu_uart_probe(struct platform_device *pdev) if (IS_ERR(port->membase)) return -PTR_ERR(port->membase); - data = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_uart_data), - GFP_KERNEL); - if (!data) + mvuart = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_uart), + GFP_KERNEL); + if (!mvuart) return -ENOMEM; - data->port = port; + mvuart->data = (struct mvebu_uart_driver_data *)match->data; + mvuart->port = port; - port->private_data = data; - platform_set_drvdata(pdev, data); + port->private_data = mvuart; + platform_set_drvdata(pdev, mvuart); ret = uart_add_one_port(&mvebu_uart_driver, port); if (ret) @@ -614,9 +666,24 @@ static int mvebu_uart_probe(struct platform_device *pdev) return 0; } +static struct mvebu_uart_driver_data uart_std_driver_data = { + .is_ext = false, + .regs.rbr = UART_STD_RBR, + .regs.tsh = UART_STD_TSH, + .regs.ctrl = UART_STD_CTRL1, + .regs.intr = UART_STD_CTRL2, + .flags.ctrl_tx_rdy_int = CTRL_STD_TX_RDY_INT, + .flags.ctrl_rx_rdy_int = CTRL_STD_RX_RDY_INT, + .flags.stat_tx_rdy = STAT_STD_TX_RDY, + .flags.stat_rx_rdy = STAT_STD_RX_RDY, +}; + /* Match table for of_platform binding */ static const struct of_device_id mvebu_uart_of_match[] = { - { .compatible = "marvell,armada-3700-uart", }, + { + .compatible = "marvell,armada-3700-uart", + .data = (void *)&uart_std_driver_data, + }, {} }; -- cgit v1.1 From 9c3d3ee1239bab92d509f334530796d0ced4ca98 Mon Sep 17 00:00:00 2001 From: Allen Yan Date: Fri, 13 Oct 2017 11:01:50 +0200 Subject: serial: mvebu-uart: add soft reset at probe The existing UART driver relies on the bootloader to initialize the port(s). However, the secondary uart port may not be initialized properly in early boot stage. This patch adds the UART soft reset when probing, for all ports. Signed-off-by: Allen Yan Signed-off-by: Miquel Raynal Reviewed-by: Gregory CLEMENT Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 900fe85..e233f46 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -660,6 +660,11 @@ static int mvebu_uart_probe(struct platform_device *pdev) port->private_data = mvuart; platform_set_drvdata(pdev, mvuart); + /* UART Soft Reset*/ + writel(CTRL_SOFT_RST, port->membase + UART_CTRL(port)); + udelay(1); + writel(0, port->membase + UART_CTRL(port)); + ret = uart_add_one_port(&mvebu_uart_driver, port); if (ret) return ret; -- cgit v1.1 From 68a0db1d7da20fc99b64debddf71e7c6d1b9e334 Mon Sep 17 00:00:00 2001 From: Allen Yan Date: Fri, 13 Oct 2017 11:01:51 +0200 Subject: serial: mvebu-uart: add function to change baudrate Until now, the first UART port baudrate was set by the bootloader. Add a function allowing to change the baudrate. Changes may be done from userspace but also at probe time by the kernel. Use the simplest method: baudrate divisor. Works for all UART ports until 230400 baud. To achieve higher baudrates, software should implement the fractional divisor feature that allows more accuracy for higher rates. Signed-off-by: Allen Yan [: changed termios handling] Signed-off-by: Miquel Raynal Reviewed-by: Gregory CLEMENT Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 69 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 4 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index e233f46..5767196 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -72,6 +72,7 @@ | STAT_PAR_ERR | STAT_OVR_ERR) #define UART_BRDV 0x10 +#define BRDV_BAUD_MASK 0x3FF #define MVEBU_NR_UARTS 1 @@ -344,6 +345,31 @@ static void mvebu_uart_shutdown(struct uart_port *port) free_irq(port->irq, port); } +static int mvebu_uart_baud_rate_set(struct uart_port *port, unsigned int baud) +{ + struct mvebu_uart *mvuart = to_mvuart(port); + unsigned int baud_rate_div; + u32 brdv; + + if (IS_ERR(mvuart->clk)) + return -PTR_ERR(mvuart->clk); + + /* + * The UART clock is divided by the value of the divisor to generate + * UCLK_OUT clock, which is 16 times faster than the baudrate. + * This prescaler can achieve all standard baudrates until 230400. + * Higher baudrates could be achieved for the extended UART by using the + * programmable oversampling stack (also called fractional divisor). + */ + baud_rate_div = DIV_ROUND_UP(port->uartclk, baud * 16); + brdv = readl(port->membase + UART_BRDV); + brdv &= ~BRDV_BAUD_MASK; + brdv |= baud_rate_div; + writel(brdv, port->membase + UART_BRDV); + + return 0; +} + static void mvebu_uart_set_termios(struct uart_port *port, struct ktermios *termios, struct ktermios *old) @@ -367,11 +393,30 @@ static void mvebu_uart_set_termios(struct uart_port *port, if ((termios->c_cflag & CREAD) == 0) port->ignore_status_mask |= STAT_RX_RDY(port) | STAT_BRK_ERR; - if (old) - tty_termios_copy_hw(termios, old); + /* + * Maximum achievable frequency with simple baudrate divisor is 230400. + * Since the error per bit frame would be of more than 15%, achieving + * higher frequencies would require to implement the fractional divisor + * feature. + */ + baud = uart_get_baud_rate(port, termios, old, 0, 230400); + if (mvebu_uart_baud_rate_set(port, baud)) { + /* No clock available, baudrate cannot be changed */ + if (old) + baud = uart_get_baud_rate(port, old, NULL, 0, 230400); + } else { + tty_termios_encode_baud_rate(termios, baud, baud); + uart_update_timeout(port, termios->c_cflag, baud); + } - baud = uart_get_baud_rate(port, termios, old, 0, 460800); - uart_update_timeout(port, termios->c_cflag, baud); + /* Only the following flag changes are supported */ + if (old) { + termios->c_iflag &= INPCK | IGNPAR; + termios->c_iflag |= old->c_iflag & ~(INPCK | IGNPAR); + termios->c_cflag &= CREAD | CBAUD; + termios->c_cflag |= old->c_cflag & ~(CREAD | CBAUD); + termios->c_lflag = old->c_lflag; + } spin_unlock_irqrestore(&port->lock, flags); } @@ -654,12 +699,28 @@ static int mvebu_uart_probe(struct platform_device *pdev) if (!mvuart) return -ENOMEM; + /* Get controller data depending on the compatible string */ mvuart->data = (struct mvebu_uart_driver_data *)match->data; mvuart->port = port; port->private_data = mvuart; platform_set_drvdata(pdev, mvuart); + /* Get fixed clock frequency */ + mvuart->clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(mvuart->clk)) { + if (PTR_ERR(mvuart->clk) == -EPROBE_DEFER) + return PTR_ERR(mvuart->clk); + + if (IS_EXTENDED(port)) { + dev_err(&pdev->dev, "unable to get UART clock\n"); + return PTR_ERR(mvuart->clk); + } + } else { + if (!clk_prepare_enable(mvuart->clk)) + port->uartclk = clk_get_rate(mvuart->clk); + } + /* UART Soft Reset*/ writel(CTRL_SOFT_RST, port->membase + UART_CTRL(port)); udelay(1); -- cgit v1.1 From 2ff23c48028a77114757438f9a480c453f68d4b0 Mon Sep 17 00:00:00 2001 From: Allen Yan Date: Fri, 13 Oct 2017 11:01:52 +0200 Subject: serial: mvebu-uart: clear state register before IRQ request When receiving data on RX pin before ->uart_startup() is called, some error bits in the state register could be set up (like BRK_DET). This is harmless when using only the standard UART (error bits are read-only), but may procude an endless loop once in the extended UART RX interrupt handler (error bits must be cleared). Clear the status register in ->uart_startup() to avoid this situation. Signed-off-by: Allen Yan Signed-off-by: Miquel Raynal Reviewed-by: Gregory CLEMENT Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 5767196..6bd0c40 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -322,6 +322,12 @@ static int mvebu_uart_startup(struct uart_port *port) writel(CTRL_TXFIFO_RST | CTRL_RXFIFO_RST, port->membase + UART_CTRL(port)); udelay(1); + + /* Clear the error bits of state register before IRQ request */ + ret = readl(port->membase + UART_STAT); + ret |= STAT_BRK_ERR; + writel(ret, port->membase + UART_STAT); + writel(CTRL_BRK_INT, port->membase + UART_CTRL(port)); ctl = readl(port->membase + UART_INTR(port)); -- cgit v1.1 From 30434b0713a5f4ecf00e9ffd3d47053882b1909a Mon Sep 17 00:00:00 2001 From: Allen Yan Date: Fri, 13 Oct 2017 11:01:53 +0200 Subject: serial: mvebu-uart: add TX interrupt trigger for pulse interrupts Pulse interrupts (extended UART only) needs a change of state to trigger the TX interrupt. In addition to enabling the TX_READY_INT_EN flag, produce a FIFO state change from 'empty' to 'not full'. For this, write only one data byte in TX start, making the TX FIFO not empty, and wait for the TX interrupt to continue the transfer. Signed-off-by: Allen Yan Signed-off-by: Miquel Raynal Reviewed-by: Gregory CLEMENT Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 6bd0c40..e52248e 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -165,8 +165,16 @@ static void mvebu_uart_stop_tx(struct uart_port *port) static void mvebu_uart_start_tx(struct uart_port *port) { - unsigned int ctl = readl(port->membase + UART_INTR(port)); + unsigned int ctl; + struct circ_buf *xmit = &port->state->xmit; + if (IS_EXTENDED(port) && !uart_circ_empty(xmit)) { + writel(xmit->buf[xmit->tail], port->membase + UART_TSH(port)); + xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); + port->icount.tx++; + } + + ctl = readl(port->membase + UART_INTR(port)); ctl |= CTRL_TX_RDY_INT(port); writel(ctl, port->membase + UART_INTR(port)); } -- cgit v1.1 From 95f787685a224e86385545848efddb9df4393065 Mon Sep 17 00:00:00 2001 From: Miquel Raynal Date: Fri, 13 Oct 2017 11:01:54 +0200 Subject: serial: mvebu-uart: dissociate RX and TX interrupts While the standard UART port can use a single IRQ that 'sums' both RX and TX interrupts, the extended port cannot and has to use two different ISR, one for each direction. The standard port also has the hability to use two separate interrupts (one for each direction). The logic is then: either there is only one unnamed interrupt on the standard port and this interrupt must be used for both directions (this is legacy bindings); or all the interrupts must be described and named 'uart-sum' (if available), 'uart-rx', 'uart-tx' and two separate handlers for each direction will be used. Suggested-by: Allen Yan Signed-off-by: Miquel Raynal Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 131 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 119 insertions(+), 12 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index e52248e..d0e749f 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -79,7 +79,16 @@ #define MVEBU_UART_TYPE "mvebu-uart" #define DRIVER_NAME "mvebu_serial" -/* Register offsets, different depending on the UART */ +enum { + /* Either there is only one summed IRQ... */ + UART_IRQ_SUM = 0, + /* ...or there are two separate IRQ for RX and TX */ + UART_RX_IRQ = 0, + UART_TX_IRQ, + UART_IRQ_COUNT +}; + +/* Diverging register offsets */ struct uart_regs_layout { unsigned int rbr; unsigned int tsh; @@ -106,6 +115,8 @@ struct mvebu_uart_driver_data { struct mvebu_uart { struct uart_port *port; struct clk *clk; + int irq[UART_IRQ_COUNT]; + unsigned char __iomem *nb; struct mvebu_uart_driver_data *data; }; @@ -313,9 +324,32 @@ static irqreturn_t mvebu_uart_isr(int irq, void *dev_id) unsigned int st = readl(port->membase + UART_STAT); if (st & (STAT_RX_RDY(port) | STAT_OVR_ERR | STAT_FRM_ERR | + STAT_BRK_DET)) + mvebu_uart_rx_chars(port, st); + + if (st & STAT_TX_RDY(port)) + mvebu_uart_tx_chars(port, st); + + return IRQ_HANDLED; +} + +static irqreturn_t mvebu_uart_rx_isr(int irq, void *dev_id) +{ + struct uart_port *port = (struct uart_port *)dev_id; + unsigned int st = readl(port->membase + UART_STAT); + + if (st & (STAT_RX_RDY(port) | STAT_OVR_ERR | STAT_FRM_ERR | STAT_BRK_DET)) mvebu_uart_rx_chars(port, st); + return IRQ_HANDLED; +} + +static irqreturn_t mvebu_uart_tx_isr(int irq, void *dev_id) +{ + struct uart_port *port = (struct uart_port *)dev_id; + unsigned int st = readl(port->membase + UART_STAT); + if (st & STAT_TX_RDY(port)) mvebu_uart_tx_chars(port, st); @@ -324,6 +358,7 @@ static irqreturn_t mvebu_uart_isr(int irq, void *dev_id) static int mvebu_uart_startup(struct uart_port *port) { + struct mvebu_uart *mvuart = to_mvuart(port); unsigned int ctl; int ret; @@ -342,11 +377,38 @@ static int mvebu_uart_startup(struct uart_port *port) ctl |= CTRL_RX_RDY_INT(port); writel(ctl, port->membase + UART_INTR(port)); - ret = request_irq(port->irq, mvebu_uart_isr, port->irqflags, - DRIVER_NAME, port); - if (ret) { - dev_err(port->dev, "failed to request irq\n"); - return ret; + if (!mvuart->irq[UART_TX_IRQ]) { + /* Old bindings with just one interrupt (UART0 only) */ + ret = devm_request_irq(port->dev, mvuart->irq[UART_IRQ_SUM], + mvebu_uart_isr, port->irqflags, + dev_name(port->dev), port); + if (ret) { + dev_err(port->dev, "unable to request IRQ %d\n", + mvuart->irq[UART_IRQ_SUM]); + return ret; + } + } else { + /* New bindings with an IRQ for RX and TX (both UART) */ + ret = devm_request_irq(port->dev, mvuart->irq[UART_RX_IRQ], + mvebu_uart_rx_isr, port->irqflags, + dev_name(port->dev), port); + if (ret) { + dev_err(port->dev, "unable to request IRQ %d\n", + mvuart->irq[UART_RX_IRQ]); + return ret; + } + + ret = devm_request_irq(port->dev, mvuart->irq[UART_TX_IRQ], + mvebu_uart_tx_isr, port->irqflags, + dev_name(port->dev), + port); + if (ret) { + dev_err(port->dev, "unable to request IRQ %d\n", + mvuart->irq[UART_TX_IRQ]); + devm_free_irq(port->dev, mvuart->irq[UART_RX_IRQ], + port); + return ret; + } } return 0; @@ -354,9 +416,16 @@ static int mvebu_uart_startup(struct uart_port *port) static void mvebu_uart_shutdown(struct uart_port *port) { + struct mvebu_uart *mvuart = to_mvuart(port); + writel(0, port->membase + UART_INTR(port)); - free_irq(port->irq, port); + if (!mvuart->irq[UART_TX_IRQ]) { + devm_free_irq(port->dev, mvuart->irq[UART_IRQ_SUM], port); + } else { + devm_free_irq(port->dev, mvuart->irq[UART_RX_IRQ], port); + devm_free_irq(port->dev, mvuart->irq[UART_TX_IRQ], port); + } } static int mvebu_uart_baud_rate_set(struct uart_port *port, unsigned int baud) @@ -661,15 +730,14 @@ static int uart_num_counter; static int mvebu_uart_probe(struct platform_device *pdev) { struct resource *reg = platform_get_resource(pdev, IORESOURCE_MEM, 0); - struct resource *irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); const struct of_device_id *match = of_match_device(mvebu_uart_of_match, &pdev->dev); struct uart_port *port; struct mvebu_uart *mvuart; - int ret, id; + int ret, id, irq; - if (!reg || !irq) { - dev_err(&pdev->dev, "no registers/irq defined\n"); + if (!reg) { + dev_err(&pdev->dev, "no registers defined\n"); return -EINVAL; } @@ -700,7 +768,12 @@ static int mvebu_uart_probe(struct platform_device *pdev) port->flags = UPF_FIXED_PORT; port->line = pdev->id; - port->irq = irq->start; + /* + * IRQ number is not stored in this structure because we may have two of + * them per port (RX and TX). Instead, use the driver UART structure + * array so called ->irq[]. + */ + port->irq = 0; port->irqflags = 0; port->mapbase = reg->start; @@ -735,6 +808,40 @@ static int mvebu_uart_probe(struct platform_device *pdev) port->uartclk = clk_get_rate(mvuart->clk); } + /* Manage interrupts */ + memset(mvuart->irq, 0, UART_IRQ_COUNT); + if (platform_irq_count(pdev) == 1) { + /* Old bindings: no name on the single unamed UART0 IRQ */ + irq = platform_get_irq(pdev, 0); + if (irq < 0) { + dev_err(&pdev->dev, "unable to get UART IRQ\n"); + return irq; + } + + mvuart->irq[UART_IRQ_SUM] = irq; + } else { + /* + * New bindings: named interrupts (RX, TX) for both UARTS, + * only make use of uart-rx and uart-tx interrupts, do not use + * uart-sum of UART0 port. + */ + irq = platform_get_irq_byname(pdev, "uart-rx"); + if (irq < 0) { + dev_err(&pdev->dev, "unable to get 'uart-rx' IRQ\n"); + return irq; + } + + mvuart->irq[UART_RX_IRQ] = irq; + + irq = platform_get_irq_byname(pdev, "uart-tx"); + if (irq < 0) { + dev_err(&pdev->dev, "unable to get 'uart-tx' IRQ\n"); + return irq; + } + + mvuart->irq[UART_TX_IRQ] = irq; + } + /* UART Soft Reset*/ writel(CTRL_SOFT_RST, port->membase + UART_CTRL(port)); udelay(1); -- cgit v1.1 From 3a75e91b8eecf4de4eee13ddb3ccd82e7abe115d Mon Sep 17 00:00:00 2001 From: Miquel Raynal Date: Fri, 13 Oct 2017 11:01:55 +0200 Subject: serial: mvebu-uart: augment the maximum number of ports A3700 boards may have up to two UART ports. Set the new limit to two maximum UART ports. Signed-off-by: Miquel Raynal Reviewed-by: Gregory CLEMENT Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index d0e749f..1074054 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -74,7 +74,7 @@ #define UART_BRDV 0x10 #define BRDV_BAUD_MASK 0x3FF -#define MVEBU_NR_UARTS 1 +#define MVEBU_NR_UARTS 2 #define MVEBU_UART_TYPE "mvebu-uart" #define DRIVER_NAME "mvebu_serial" -- cgit v1.1 From 53501e0236295149fb984c4dafda2dfc8448ed26 Mon Sep 17 00:00:00 2001 From: Miquel Raynal Date: Fri, 13 Oct 2017 11:01:56 +0200 Subject: serial: mvebu-uart: support extended port registers layout Define the missing register offsets and bit fields for the extended UART port. Add a second driver data structure filled with its port data, selected with the right compatible (marvell,armada-3700-uart-ext). Signed-off-by: Miquel Raynal Reviewed-by: Gregory CLEMENT Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 1074054..16b0a5a 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -39,10 +39,13 @@ /* Register Map */ #define UART_STD_RBR 0x00 +#define UART_EXT_RBR 0x18 #define UART_STD_TSH 0x04 +#define UART_EXT_TSH 0x1C #define UART_STD_CTRL1 0x08 +#define UART_EXT_CTRL1 0x04 #define CTRL_SOFT_RST BIT(31) #define CTRL_TXFIFO_RST BIT(15) #define CTRL_RXFIFO_RST BIT(14) @@ -55,15 +58,20 @@ CTRL_PAR_ERR_INT | CTRL_OVR_ERR_INT) #define UART_STD_CTRL2 UART_STD_CTRL1 +#define UART_EXT_CTRL2 0x20 #define CTRL_STD_TX_RDY_INT BIT(5) +#define CTRL_EXT_TX_RDY_INT BIT(6) #define CTRL_STD_RX_RDY_INT BIT(4) +#define CTRL_EXT_RX_RDY_INT BIT(5) #define UART_STAT 0x0C #define STAT_TX_FIFO_EMP BIT(13) #define STAT_TX_FIFO_FUL BIT(11) #define STAT_TX_EMP BIT(6) #define STAT_STD_TX_RDY BIT(5) +#define STAT_EXT_TX_RDY BIT(15) #define STAT_STD_RX_RDY BIT(4) +#define STAT_EXT_RX_RDY BIT(14) #define STAT_BRK_DET BIT(3) #define STAT_FRM_ERR BIT(2) #define STAT_PAR_ERR BIT(1) @@ -865,12 +873,28 @@ static struct mvebu_uart_driver_data uart_std_driver_data = { .flags.stat_rx_rdy = STAT_STD_RX_RDY, }; +static struct mvebu_uart_driver_data uart_ext_driver_data = { + .is_ext = true, + .regs.rbr = UART_EXT_RBR, + .regs.tsh = UART_EXT_TSH, + .regs.ctrl = UART_EXT_CTRL1, + .regs.intr = UART_EXT_CTRL2, + .flags.ctrl_tx_rdy_int = CTRL_EXT_TX_RDY_INT, + .flags.ctrl_rx_rdy_int = CTRL_EXT_RX_RDY_INT, + .flags.stat_tx_rdy = STAT_EXT_TX_RDY, + .flags.stat_rx_rdy = STAT_EXT_RX_RDY, +}; + /* Match table for of_platform binding */ static const struct of_device_id mvebu_uart_of_match[] = { { .compatible = "marvell,armada-3700-uart", .data = (void *)&uart_std_driver_data, }, + { + .compatible = "marvell,armada-3700-uart-ext", + .data = (void *)&uart_ext_driver_data, + }, {} }; -- cgit v1.1 From 53c7626356c7584e82510d86394a6dcd80525614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= Date: Wed, 11 Oct 2017 10:32:13 +0200 Subject: serdev: Add ACPI support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch allows SerDev module to manage serial devices declared as attached to an UART in ACPI table. acpi_serdev_add_device() callback will only take into account entries without enumerated flag set. This flags is set for all entries during ACPI scan, except for SPI and I2C serial devices, and for UART with 2nd patch in the series. Check if a serdev device as been allocated during acpi_walk_namespace() to prevent serdev controller registration instead of the tty-class device. Signed-off-by: Frédéric Danis Reviewed-by: Rob Herring Reviewed-by: Sebastian Reichel Reviewed-by: Johan Hovold Acked-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serdev/core.c | 100 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 95 insertions(+), 5 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index c68fb3a..ec113e3 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -14,6 +14,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -49,13 +50,22 @@ static const struct device_type serdev_ctrl_type = { static int serdev_device_match(struct device *dev, struct device_driver *drv) { - /* TODO: ACPI and platform matching */ + /* TODO: platform matching */ + if (acpi_driver_match_device(dev, drv)) + return 1; + return of_driver_match_device(dev, drv); } static int serdev_uevent(struct device *dev, struct kobj_uevent_env *env) { - /* TODO: ACPI and platform modalias */ + int rc; + + /* TODO: platform modalias */ + rc = acpi_device_uevent_modalias(dev, env); + if (rc != -ENODEV) + return rc; + return of_device_uevent_modalias(dev, env); } @@ -260,6 +270,12 @@ static int serdev_drv_remove(struct device *dev) static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) { + int len; + + len = acpi_device_modalias(dev, buf, PAGE_SIZE - 1); + if (len != -ENODEV) + return len; + return of_device_modalias(dev, buf, PAGE_SIZE); } DEVICE_ATTR_RO(modalias); @@ -385,6 +401,75 @@ static int of_serdev_register_devices(struct serdev_controller *ctrl) return 0; } +#ifdef CONFIG_ACPI +static acpi_status acpi_serdev_register_device(struct serdev_controller *ctrl, + struct acpi_device *adev) +{ + struct serdev_device *serdev = NULL; + int err; + + if (acpi_bus_get_status(adev) || !adev->status.present || + acpi_device_enumerated(adev)) + return AE_OK; + + serdev = serdev_device_alloc(ctrl); + if (!serdev) { + dev_err(&ctrl->dev, "failed to allocate serdev device for %s\n", + dev_name(&adev->dev)); + return AE_NO_MEMORY; + } + + ACPI_COMPANION_SET(&serdev->dev, adev); + acpi_device_set_enumerated(adev); + + err = serdev_device_add(serdev); + if (err) { + dev_err(&serdev->dev, + "failure adding ACPI serdev device. status %d\n", err); + serdev_device_put(serdev); + } + + return AE_OK; +} + +static acpi_status acpi_serdev_add_device(acpi_handle handle, u32 level, + void *data, void **return_value) +{ + struct serdev_controller *ctrl = data; + struct acpi_device *adev; + + if (acpi_bus_get_device(handle, &adev)) + return AE_OK; + + return acpi_serdev_register_device(ctrl, adev); +} + +static int acpi_serdev_register_devices(struct serdev_controller *ctrl) +{ + acpi_status status; + acpi_handle handle; + + handle = ACPI_HANDLE(ctrl->dev.parent); + if (!handle) + return -ENODEV; + + status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1, + acpi_serdev_add_device, NULL, ctrl, NULL); + if (ACPI_FAILURE(status)) + dev_dbg(&ctrl->dev, "failed to enumerate serdev slaves\n"); + + if (!ctrl->serdev) + return -ENODEV; + + return 0; +} +#else +static inline int acpi_serdev_register_devices(struct serdev_controller *ctrl) +{ + return -ENODEV; +} +#endif /* CONFIG_ACPI */ + /** * serdev_controller_add() - Add an serdev controller * @ctrl: controller to be registered. @@ -394,7 +479,7 @@ static int of_serdev_register_devices(struct serdev_controller *ctrl) */ int serdev_controller_add(struct serdev_controller *ctrl) { - int ret; + int ret_of, ret_acpi, ret; /* Can't register until after driver model init */ if (WARN_ON(!is_registered)) @@ -404,9 +489,14 @@ int serdev_controller_add(struct serdev_controller *ctrl) if (ret) return ret; - ret = of_serdev_register_devices(ctrl); - if (ret) + ret_of = of_serdev_register_devices(ctrl); + ret_acpi = acpi_serdev_register_devices(ctrl); + if (ret_of && ret_acpi) { + dev_dbg(&ctrl->dev, "no devices registered: of:%d acpi:%d\n", + ret_of, ret_acpi); + ret = -ENODEV; goto out_dev_del; + } dev_dbg(&ctrl->dev, "serdev%d registered: dev:%p\n", ctrl->nr, &ctrl->dev); -- cgit v1.1 From e60f9fd03b8b5323a8569abc23c62396e0dfa9ad Mon Sep 17 00:00:00 2001 From: Martin Townsend Date: Fri, 20 Oct 2017 22:17:52 +0100 Subject: omap_serial: Removing superfluous check on no interrupt pending. The do .. while loop checks for interrupt pending at the start of the loop and exits if there is none, it then checks again for this condition at the end of the loop. Signed-off-by: Martin Townsend Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/omap-serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 580f567..7b183fc 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -610,7 +610,7 @@ static irqreturn_t serial_omap_irq(int irq, void *dev_id) default: break; } - } while (!(iir & UART_IIR_NO_INT) && max_count--); + } while (max_count--); spin_unlock(&up->port.lock); -- cgit v1.1 From 2a71de2f7366fb1aec632116d0549ec56d6a3940 Mon Sep 17 00:00:00 2001 From: Lukas Wunner Date: Sat, 21 Oct 2017 10:50:18 +0200 Subject: serial: omap: Fix EFR write on RTS deassertion Commit 348f9bb31c56 ("serial: omap: Fix RTS handling") sought to enable auto RTS upon manual RTS assertion and disable it on deassertion. However it seems the latter was done incorrectly, it clears all bits in the Extended Features Register *except* auto RTS. Fixes: 348f9bb31c56 ("serial: omap: Fix RTS handling") Cc: Peter Hurley Cc: stable Signed-off-by: Lukas Wunner Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/omap-serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 7b183fc..47ba917 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -693,7 +693,7 @@ static void serial_omap_set_mctrl(struct uart_port *port, unsigned int mctrl) if ((mctrl & TIOCM_RTS) && (port->status & UPSTAT_AUTORTS)) up->efr |= UART_EFR_RTS; else - up->efr &= UART_EFR_RTS; + up->efr &= ~UART_EFR_RTS; serial_out(up, UART_EFR, up->efr); serial_out(up, UART_LCR, lcr); -- cgit v1.1 From dee7d0f3b200c67c6ee96bd37c6e8fa52690ab56 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Mon, 16 Oct 2017 15:06:19 +0200 Subject: serdev: ttyport: enforce tty-driver open() requirement The tty-driver open routine is mandatory, but the serdev tty-port-controller implementation did not treat it as such and would instead fall back to calling tty_port_open() directly. Signed-off-by: Johan Hovold Acked-by: Rob Herring Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serdev/serdev-ttyport.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c index 302018d..404f3fd 100644 --- a/drivers/tty/serdev/serdev-ttyport.c +++ b/drivers/tty/serdev/serdev-ttyport.c @@ -102,10 +102,10 @@ static int ttyport_open(struct serdev_controller *ctrl) return PTR_ERR(tty); serport->tty = tty; - if (tty->ops->open) - tty->ops->open(serport->tty, NULL); - else - tty_port_open(serport->port, tty, NULL); + if (!tty->ops->open) + goto err_unlock; + + tty->ops->open(serport->tty, NULL); /* Bring the UART into a known 8 bits no parity hw fc state */ ktermios = tty->termios; @@ -122,6 +122,12 @@ static int ttyport_open(struct serdev_controller *ctrl) tty_unlock(serport->tty); return 0; + +err_unlock: + tty_unlock(tty); + tty_release_struct(tty, serport->tty_idx); + + return -ENODEV; } static void ttyport_close(struct serdev_controller *ctrl) -- cgit v1.1 From 7c63838ea5afb15a60c58a2f0fe8ac093fc9f1a5 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Mon, 16 Oct 2017 15:06:20 +0200 Subject: serdev: ttyport: add missing open() error handling Add missing error handling for tty-driver open() which may fail (e.g. if resource allocation fails or if a port is being disconnected). Note that close() must be called also in case of failed open() and that the operation sanity check is amended to catch buggy drivers. Signed-off-by: Johan Hovold Acked-by: Rob Herring Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serdev/serdev-ttyport.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c index 404f3fd..5b09ce9 100644 --- a/drivers/tty/serdev/serdev-ttyport.c +++ b/drivers/tty/serdev/serdev-ttyport.c @@ -96,16 +96,21 @@ static int ttyport_open(struct serdev_controller *ctrl) struct serport *serport = serdev_controller_get_drvdata(ctrl); struct tty_struct *tty; struct ktermios ktermios; + int ret; tty = tty_init_dev(serport->tty_drv, serport->tty_idx); if (IS_ERR(tty)) return PTR_ERR(tty); serport->tty = tty; - if (!tty->ops->open) + if (!tty->ops->open || !tty->ops->close) { + ret = -ENODEV; goto err_unlock; + } - tty->ops->open(serport->tty, NULL); + ret = tty->ops->open(serport->tty, NULL); + if (ret) + goto err_close; /* Bring the UART into a known 8 bits no parity hw fc state */ ktermios = tty->termios; @@ -123,11 +128,13 @@ static int ttyport_open(struct serdev_controller *ctrl) tty_unlock(serport->tty); return 0; +err_close: + tty->ops->close(tty, NULL); err_unlock: tty_unlock(tty); tty_release_struct(tty, serport->tty_idx); - return -ENODEV; + return ret; } static void ttyport_close(struct serdev_controller *ctrl) -- cgit v1.1 From 08fcee289f341786eb3b44e5f2d1dc850943238e Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Tue, 10 Oct 2017 18:09:49 +0200 Subject: serdev: fix registration of second slave Serdev currently only supports a single slave device, but the required sanity checks to prevent further registration attempts were missing. If a serial-port node has two child nodes with compatible properties, the OF code would try to register two slave devices using the same id and name. Driver core will not allow this (and there will be loud complaints), but the controller's slave pointer would already have been set to address of the soon to be deallocated second struct serdev_device. As the first slave device remains registered, this can lead to later use-after-free issues when the slave callbacks are accessed. Note that while the serdev registration helpers are exported, they are typically only called by serdev core. Any other (out-of-tree) callers must serialise registration and deregistration themselves. Fixes: cd6484e1830b ("serdev: Introduce new bus for serial attached devices") Cc: stable # 4.11 Cc: Rob Herring Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serdev/core.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index ec113e3..dde2ddc 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -75,21 +75,32 @@ static int serdev_uevent(struct device *dev, struct kobj_uevent_env *env) */ int serdev_device_add(struct serdev_device *serdev) { + struct serdev_controller *ctrl = serdev->ctrl; struct device *parent = serdev->dev.parent; int err; dev_set_name(&serdev->dev, "%s-%d", dev_name(parent), serdev->nr); + /* Only a single slave device is currently supported. */ + if (ctrl->serdev) { + dev_err(&serdev->dev, "controller busy\n"); + return -EBUSY; + } + ctrl->serdev = serdev; + err = device_add(&serdev->dev); if (err < 0) { dev_err(&serdev->dev, "Can't add %s, status %d\n", dev_name(&serdev->dev), err); - goto err_device_add; + goto err_clear_serdev; } dev_dbg(&serdev->dev, "device %s registered\n", dev_name(&serdev->dev)); -err_device_add: + return 0; + +err_clear_serdev: + ctrl->serdev = NULL; return err; } EXPORT_SYMBOL_GPL(serdev_device_add); @@ -100,7 +111,10 @@ EXPORT_SYMBOL_GPL(serdev_device_add); */ void serdev_device_remove(struct serdev_device *serdev) { + struct serdev_controller *ctrl = serdev->ctrl; + device_unregister(&serdev->dev); + ctrl->serdev = NULL; } EXPORT_SYMBOL_GPL(serdev_device_remove); @@ -311,7 +325,6 @@ struct serdev_device *serdev_device_alloc(struct serdev_controller *ctrl) return NULL; serdev->ctrl = ctrl; - ctrl->serdev = serdev; device_initialize(&serdev->dev); serdev->dev.parent = &ctrl->dev; serdev->dev.bus = &serdev_bus_type; -- cgit v1.1 From 978d6fac5d0617c9722ae1db1accee46776f4400 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Thu, 12 Oct 2017 15:28:18 +0200 Subject: serdev: fix controller-allocation error handling Reorder controller initialisation so that in the unlikely event that id allocation fails, we don't end up releasing id 0 in the destructor. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serdev/core.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index dde2ddc..4d662d1 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -358,26 +358,31 @@ struct serdev_controller *serdev_controller_alloc(struct device *parent, if (!ctrl) return NULL; - device_initialize(&ctrl->dev); - ctrl->dev.type = &serdev_ctrl_type; - ctrl->dev.bus = &serdev_bus_type; - ctrl->dev.parent = parent; - ctrl->dev.of_node = parent->of_node; - serdev_controller_set_drvdata(ctrl, &ctrl[1]); - id = ida_simple_get(&ctrl_ida, 0, 0, GFP_KERNEL); if (id < 0) { dev_err(parent, "unable to allocate serdev controller identifier.\n"); - serdev_controller_put(ctrl); - return NULL; + goto err_free; } ctrl->nr = id; + + device_initialize(&ctrl->dev); + ctrl->dev.type = &serdev_ctrl_type; + ctrl->dev.bus = &serdev_bus_type; + ctrl->dev.parent = parent; + ctrl->dev.of_node = parent->of_node; + serdev_controller_set_drvdata(ctrl, &ctrl[1]); + dev_set_name(&ctrl->dev, "serial%d", id); dev_dbg(&ctrl->dev, "allocated controller 0x%p id %d\n", ctrl, id); return ctrl; + +err_free: + kfree(ctrl); + + return NULL; } EXPORT_SYMBOL_GPL(serdev_controller_alloc); -- cgit v1.1 From 7c3356457aeb07d183dfe9c6bb69dceee5a06ca9 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 02:59:17 -0700 Subject: serial: 8250: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Jiri Slaby Cc: Vignesh R Cc: Ed Blake Cc: Matthias Brugger Cc: Sean Young Cc: linux-serial@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_core.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 00d4b11..ccfc42c 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -262,17 +262,17 @@ static void serial_unlink_irq_chain(struct uart_8250_port *up) * barely passable results for a 16550A. (Although at the expense * of much CPU overhead). */ -static void serial8250_timeout(unsigned long data) +static void serial8250_timeout(struct timer_list *t) { - struct uart_8250_port *up = (struct uart_8250_port *)data; + struct uart_8250_port *up = from_timer(up, t, timer); up->port.handle_irq(&up->port); mod_timer(&up->timer, jiffies + uart_poll_timeout(&up->port)); } -static void serial8250_backup_timeout(unsigned long data) +static void serial8250_backup_timeout(struct timer_list *t) { - struct uart_8250_port *up = (struct uart_8250_port *)data; + struct uart_8250_port *up = from_timer(up, t, timer); unsigned int iir, ier = 0, lsr; unsigned long flags; @@ -329,8 +329,7 @@ static int univ8250_setup_irq(struct uart_8250_port *up) if (up->bugs & UART_BUG_THRE) { pr_debug("ttyS%d - using backup timer\n", serial_index(port)); - up->timer.function = serial8250_backup_timeout; - up->timer.data = (unsigned long)up; + up->timer.function = (TIMER_FUNC_TYPE)serial8250_backup_timeout; mod_timer(&up->timer, jiffies + uart_poll_timeout(port) + HZ / 5); } @@ -341,7 +340,6 @@ static int univ8250_setup_irq(struct uart_8250_port *up) * driver used to do this with IRQ0. */ if (!port->irq) { - up->timer.data = (unsigned long)up; mod_timer(&up->timer, jiffies + uart_poll_timeout(port)); } else retval = serial_link_irq_chain(up); @@ -354,7 +352,7 @@ static void univ8250_release_irq(struct uart_8250_port *up) struct uart_port *port = &up->port; del_timer_sync(&up->timer); - up->timer.function = serial8250_timeout; + up->timer.function = (TIMER_FUNC_TYPE)serial8250_timeout; if (port->irq) serial_unlink_irq_chain(up); } @@ -525,7 +523,7 @@ static void __init serial8250_isa_init_ports(void) base_ops = port->ops; port->ops = &univ8250_port_ops; - setup_timer(&up->timer, serial8250_timeout, 0UL); + timer_setup(&up->timer, serial8250_timeout, 0); up->ops = &univ8250_driver_ops; -- cgit v1.1 From 1209a81369366b158e001d8a249693525c463eb0 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 02:59:31 -0700 Subject: serial: bfin_uart: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Jiri Slaby Cc: adi-buildroot-devel@lists.sourceforge.net Cc: linux-serial@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/bfin_uart.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c index 293ecbb..de5262a 100644 --- a/drivers/tty/serial/bfin_uart.c +++ b/drivers/tty/serial/bfin_uart.c @@ -456,8 +456,9 @@ static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) tty_flip_buffer_push(&uart->port.state->port); } -void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart) +void bfin_serial_rx_dma_timeout(struct timer_list *t) { + struct bfin_serial_port *uart = from_timer(uart, t, rx_dma_timer); int x_pos, pos; unsigned long flags; @@ -624,8 +625,6 @@ static int bfin_serial_startup(struct uart_port *port) set_dma_start_addr(uart->rx_dma_channel, (unsigned long)uart->rx_dma_buf.buf); enable_dma(uart->rx_dma_channel); - uart->rx_dma_timer.data = (unsigned long)(uart); - uart->rx_dma_timer.function = (void *)bfin_serial_rx_dma_timeout; uart->rx_dma_timer.expires = jiffies + DMA_RX_FLUSH_JIFFIES; add_timer(&(uart->rx_dma_timer)); #else @@ -1316,7 +1315,7 @@ static int bfin_serial_probe(struct platform_device *pdev) } uart->rx_dma_channel = res->start; - init_timer(&(uart->rx_dma_timer)); + timer_setup(&uart->rx_dma_timer, bfin_serial_rx_dma_timeout, 0); #endif #if defined(SERIAL_BFIN_CTSRTS) || \ -- cgit v1.1 From fc3b00d7dd7fe51e9315e5894c224132405e4499 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 02:59:49 -0700 Subject: serial: sccnxp: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sccnxp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c index b9c7a90..ba43ed1 100644 --- a/drivers/tty/serial/sccnxp.c +++ b/drivers/tty/serial/sccnxp.c @@ -465,9 +465,9 @@ static void sccnxp_handle_events(struct sccnxp_port *s) } while (1); } -static void sccnxp_timer(unsigned long data) +static void sccnxp_timer(struct timer_list *t) { - struct sccnxp_port *s = (struct sccnxp_port *)data; + struct sccnxp_port *s = from_timer(s, t, timer); unsigned long flags; spin_lock_irqsave(&s->lock, flags); @@ -987,8 +987,7 @@ static int sccnxp_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Unable to reguest IRQ %i\n", s->irq); } else { - init_timer(&s->timer); - setup_timer(&s->timer, sccnxp_timer, (unsigned long)s); + timer_setup(&s->timer, sccnxp_timer, 0); mod_timer(&s->timer, jiffies + usecs_to_jiffies(s->pdata.poll_time_us)); return 0; -- cgit v1.1 From ad0cda7a90f26970d65163095c5da39f541921bc Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 02:59:56 -0700 Subject: tty/serial: altera_uart: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Tobias Klauser Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Cc: nios2-dev@lists.rocketboards.org Signed-off-by: Kees Cook Acked-by: Tobias Klauser Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/altera_uart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c index 3e4b717..a0360e6 100644 --- a/drivers/tty/serial/altera_uart.c +++ b/drivers/tty/serial/altera_uart.c @@ -288,10 +288,10 @@ static irqreturn_t altera_uart_interrupt(int irq, void *data) return IRQ_RETVAL(isr); } -static void altera_uart_timer(unsigned long data) +static void altera_uart_timer(struct timer_list *t) { - struct uart_port *port = (void *)data; - struct altera_uart *pp = container_of(port, struct altera_uart, port); + struct altera_uart *pp = from_timer(pp, t, tmr); + struct uart_port *port = &pp->port; altera_uart_interrupt(0, port); mod_timer(&pp->tmr, jiffies + uart_poll_timeout(port)); @@ -314,7 +314,7 @@ static int altera_uart_startup(struct uart_port *port) int ret; if (!port->irq) { - setup_timer(&pp->tmr, altera_uart_timer, (unsigned long)port); + timer_setup(&pp->tmr, altera_uart_timer, 0); mod_timer(&pp->tmr, jiffies + uart_poll_timeout(port)); return 0; } -- cgit v1.1 From 4790b6dc7ad6c0f1eb71b94c4babe10a9c41c697 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 03:00:10 -0700 Subject: tty: vcc: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: "David S. Miller" Cc: Jiri Slaby Cc: sparclinux@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- drivers/tty/vcc.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c index 954b190..58b454c 100644 --- a/drivers/tty/vcc.c +++ b/drivers/tty/vcc.c @@ -361,17 +361,13 @@ done: return rv; } -static void vcc_rx_timer(unsigned long index) +static void vcc_rx_timer(struct timer_list *t) { + struct vcc_port *port = from_timer(port, t, rx_timer); struct vio_driver_state *vio; - struct vcc_port *port; unsigned long flags; int rv; - port = vcc_get_ne(index); - if (!port) - return; - spin_lock_irqsave(&port->lock, flags); port->rx_timer.expires = 0; @@ -391,18 +387,14 @@ done: vcc_put(port, false); } -static void vcc_tx_timer(unsigned long index) +static void vcc_tx_timer(struct timer_list *t) { - struct vcc_port *port; + struct vcc_port *port = from_timer(port, t, tx_timer); struct vio_vcc *pkt; unsigned long flags; int tosend = 0; int rv; - port = vcc_get_ne(index); - if (!port) - return; - spin_lock_irqsave(&port->lock, flags); port->tx_timer.expires = 0; @@ -645,8 +637,8 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id) if (rv) goto free_domain; - setup_timer(&port->rx_timer, vcc_rx_timer, port->index); - setup_timer(&port->tx_timer, vcc_tx_timer, port->index); + timer_setup(&port->rx_timer, vcc_rx_timer, 0); + timer_setup(&port->tx_timer, vcc_tx_timer, 0); dev_set_drvdata(&vdev->dev, port); -- cgit v1.1 From a8497b31fee650846fcc5a1e41f4ef22318a9925 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 03:00:18 -0700 Subject: tty: cyclades: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Moves timer structures from global to attached to struct cyclades_port. Cc: Jiri Slaby Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- drivers/tty/cyclades.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c index d272bc4..f30f7a9 100644 --- a/drivers/tty/cyclades.c +++ b/drivers/tty/cyclades.c @@ -286,8 +286,7 @@ static long cyz_polling_cycle = CZ_DEF_POLL; static DEFINE_TIMER(cyz_timerlist, cyz_poll, 0, 0); #else /* CONFIG_CYZ_INTR */ -static void cyz_rx_restart(unsigned long); -static struct timer_list cyz_rx_full_timer[NR_PORTS]; +static void cyz_rx_restart(struct timer_list *); #endif /* CONFIG_CYZ_INTR */ static void cyy_writeb(struct cyclades_port *port, u32 reg, u8 val) @@ -992,10 +991,8 @@ static void cyz_handle_rx(struct cyclades_port *info) else char_count = rx_put - rx_get + rx_bufsize; if (char_count >= readl(&buf_ctrl->rx_threshold) && - !timer_pending(&cyz_rx_full_timer[ - info->line])) - mod_timer(&cyz_rx_full_timer[info->line], - jiffies + 1); + !timer_pending(&info->rx_full_timer)) + mod_timer(&info->rx_full_timer, jiffies + 1); #endif info->idle_stats.recv_idle = jiffies; tty_schedule_flip(&info->port); @@ -1197,9 +1194,9 @@ static irqreturn_t cyz_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } /* cyz_interrupt */ -static void cyz_rx_restart(unsigned long arg) +static void cyz_rx_restart(struct timer_list *t) { - struct cyclades_port *info = (struct cyclades_port *)arg; + struct cyclades_port *info = from_timer(info, t, rx_full_timer); struct cyclades_card *card = info->card; int retval; __u32 channel = info->line - card->first_line; @@ -3097,8 +3094,7 @@ static int cy_init_card(struct cyclades_card *cinfo) else info->xmit_fifo_size = 4 * CYZ_FIFO_SIZE; #ifdef CONFIG_CYZ_INTR - setup_timer(&cyz_rx_full_timer[port], - cyz_rx_restart, (unsigned long)info); + timer_setup(&info->rx_full_timer, cyz_rx_restart, 0); #endif } else { unsigned short chip_number; -- cgit v1.1 From 026cb4329df6169eb820815d220a391d97550cc5 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 03:00:03 -0700 Subject: tty/serial: atmel: Convert timers to use timer_setup() In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Richard Genoud Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Signed-off-by: Kees Cook Acked-by: Richard Genoud Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/atmel_serial.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 82d9c8e..68d8685 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -1185,10 +1185,11 @@ chan_err: return -EINVAL; } -static void atmel_uart_timer_callback(unsigned long data) +static void atmel_uart_timer_callback(struct timer_list *t) { - struct uart_port *port = (void *)data; - struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); + struct atmel_uart_port *atmel_port = from_timer(atmel_port, t, + uart_timer); + struct uart_port *port = &atmel_port->uart; if (!atomic_read(&atmel_port->tasklet_shutdown)) { tasklet_schedule(&atmel_port->tasklet_rx); @@ -1852,9 +1853,7 @@ static int atmel_startup(struct uart_port *port) atmel_uart_writel(port, ATMEL_US_CR, ATMEL_US_TXEN | ATMEL_US_RXEN); atmel_port->tx_stopped = false; - setup_timer(&atmel_port->uart_timer, - atmel_uart_timer_callback, - (unsigned long)port); + timer_setup(&atmel_port->uart_timer, atmel_uart_timer_callback, 0); if (atmel_use_pdc_rx(port)) { /* set UART timeout */ -- cgit v1.1 From e7e51dcf3b8a5f65c5653a054ad57eb2492a90d0 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Fri, 3 Nov 2017 15:18:05 +0100 Subject: tty: fix tty_ldisc_receive_buf() documentation The tty_ldisc_receive_buf() helper returns the number of bytes processed so drop the bogus "not" from the kernel doc comment. Fixes: 8d082cd300ab ("tty: Unify receive_buf() code paths") Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/tty/tty_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index f8eba1c5..677fa99 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -446,7 +446,7 @@ EXPORT_SYMBOL_GPL(tty_prepare_flip_string); * Callers other than flush_to_ldisc() need to exclude the kworker * from concurrent use of the line discipline, see paste_selection(). * - * Returns the number of bytes not processed + * Returns the number of bytes processed */ int tty_ldisc_receive_buf(struct tty_ldisc *ld, const unsigned char *p, char *f, int count) -- cgit v1.1 From 5de15cc2526132440415209e12633636e206d531 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 2 Nov 2017 14:01:44 +0000 Subject: tty: max3100: remove unused variable rts and remove unused assignment Variable rts is being assigned but it is never read, hence it can be removed. The assignment to param_new to zero is redundant as it is being updates a few statements later, so remove this redundant assignment. Cleans up two clang warnings: drivers/tty/serial/max3100.c:277:3: warning: Value stored to 'rts' is never read drivers/tty/serial/max3100.c:439:2: warning: Value stored to 'param_new' is never read Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/max3100.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index b6b3453..f691f3c 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -263,7 +263,7 @@ static void max3100_work(struct work_struct *w) struct max3100_port *s = container_of(w, struct max3100_port, work); int rxchars; u16 tx, rx; - int conf, cconf, rts, crts; + int conf, cconf, crts; struct circ_buf *xmit = &s->port.state->xmit; dev_dbg(&s->spi->dev, "%s\n", __func__); @@ -274,7 +274,6 @@ static void max3100_work(struct work_struct *w) conf = s->conf; cconf = s->conf_commit; s->conf_commit = 0; - rts = s->rts; crts = s->rts_commit; s->rts_commit = 0; spin_unlock(&s->conf_lock); @@ -436,7 +435,6 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios, dev_dbg(&s->spi->dev, "%s\n", __func__); cflag = termios->c_cflag; - param_new = 0; param_mask = 0; baud = tty_termios_baud_rate(termios); -- cgit v1.1 From 0ea46e6e58ab7447222bcaa10be0adcd9f92284d Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Thu, 2 Nov 2017 12:34:24 +0100 Subject: serial: mvebu-uart: drop incorrect memset gcc points out that the length passed into memset here is wrong: drivers/tty/serial/mvebu-uart.c: In function 'mvebu_uart_probe': arch/x86/include/asm/string_32.h:324:29: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size] Moreover, the structure was allocated with kzalloc a few lines earlier, so that memset is also unnecessary. Let's drop it to shut up the compiler warning. Fixes: 95f787685a22 ("serial: mvebu-uart: dissociate RX and TX interrupts") Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mvebu-uart.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 16b0a5a..85eb5c8 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -817,7 +817,6 @@ static int mvebu_uart_probe(struct platform_device *pdev) } /* Manage interrupts */ - memset(mvuart->irq, 0, UART_IRQ_COUNT); if (platform_irq_count(pdev) == 1) { /* Old bindings: no name on the single unamed UART0 IRQ */ irq = platform_get_irq(pdev, 0); -- cgit v1.1 From 1be2266392196de82d1cfcc8a68e770cf8f48c60 Mon Sep 17 00:00:00 2001 From: Takatoshi Akiyama Date: Thu, 2 Nov 2017 11:14:55 +0100 Subject: serial: sh-sci: Fix unlocked access to SCSCR register The SCSCR register access in sci_break_ctl() is not locked. sci_start_tx() and sci_set_termios() changes the SCSCR register, but does not lock sci_port. Therefore, this patch adds lock during register access. Also, remove the log output that leads to a double lock. Some analysis of where locks are not taken is as follows. It appears that the lock is not taken in: - sci_start_tx(), sci_stop_tx() as this is installed as a callback. And all callers of the callback take the lock. - start_rx as callers take the lock. - stop_rx. this is both installed as a callback and called directly. In both cases the caller takes the lock. Signed-off-by: Takatoshi Akiyama Signed-off-by: Takeshi Kihara Signed-off-by: Simon Horman Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sh-sci.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index d5714de..d5e07dd 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1226,8 +1226,11 @@ static void sci_rx_dma_release(struct sci_port *s, bool enable_pio) dma_free_coherent(chan->device->dev, s->buf_len_rx * 2, s->rx_buf[0], sg_dma_address(&s->sg_rx[0])); dma_release_channel(chan); - if (enable_pio) + if (enable_pio) { + spin_lock_irqsave(&port->lock, flags); sci_start_rx(port); + spin_unlock_irqrestore(&port->lock, flags); + } } static void sci_dma_rx_complete(void *arg) @@ -1294,8 +1297,11 @@ static void sci_tx_dma_release(struct sci_port *s, bool enable_pio) dma_unmap_single(chan->device->dev, s->tx_dma_addr, UART_XMIT_SIZE, DMA_TO_DEVICE); dma_release_channel(chan); - if (enable_pio) + if (enable_pio) { + spin_lock_irqsave(&port->lock, flags); sci_start_tx(port); + spin_unlock_irqrestore(&port->lock, flags); + } } static void sci_submit_rx(struct sci_port *s) @@ -2004,6 +2010,7 @@ static void sci_enable_ms(struct uart_port *port) static void sci_break_ctl(struct uart_port *port, int break_state) { unsigned short scscr, scsptr; + unsigned long flags; /* check wheter the port has SCSPTR */ if (!sci_getreg(port, SCSPTR)->size) { @@ -2014,6 +2021,7 @@ static void sci_break_ctl(struct uart_port *port, int break_state) return; } + spin_lock_irqsave(&port->lock, flags); scsptr = serial_port_in(port, SCSPTR); scscr = serial_port_in(port, SCSCR); @@ -2027,6 +2035,7 @@ static void sci_break_ctl(struct uart_port *port, int break_state) serial_port_out(port, SCSPTR, scsptr); serial_port_out(port, SCSCR, scscr); + spin_unlock_irqrestore(&port->lock, flags); } static int sci_startup(struct uart_port *port) @@ -2255,6 +2264,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, int min_err = INT_MAX, err; unsigned long max_freq = 0; int best_clk = -1; + unsigned long flags; if ((termios->c_cflag & CSIZE) == CS7) smr_val |= SCSMR_CHR; @@ -2364,6 +2374,8 @@ done: serial_port_out(port, SCCKS, sccks); } + spin_lock_irqsave(&port->lock, flags); + sci_reset(port); uart_update_timeout(port, termios->c_cflag, baud); @@ -2381,9 +2393,6 @@ done: case 27: smr_val |= SCSMR_SRC_27; break; } smr_val |= cks; - dev_dbg(port->dev, - "SCR 0x%x SMR 0x%x BRR %u CKS 0x%x DL %u SRR %u\n", - scr_val, smr_val, brr, sccks, dl, srr); serial_port_out(port, SCSCR, scr_val | s->hscif_tot); serial_port_out(port, SCSMR, smr_val); serial_port_out(port, SCBRR, brr); @@ -2397,7 +2406,6 @@ done: scr_val = s->cfg->scscr & (SCSCR_CKE1 | SCSCR_CKE0); smr_val |= serial_port_in(port, SCSMR) & (SCSMR_CKEDG | SCSMR_SRC_MASK | SCSMR_CKS); - dev_dbg(port->dev, "SCR 0x%x SMR 0x%x\n", scr_val, smr_val); serial_port_out(port, SCSCR, scr_val | s->hscif_tot); serial_port_out(port, SCSMR, smr_val); } @@ -2434,7 +2442,6 @@ done: scr_val |= SCSCR_RE | SCSCR_TE | (s->cfg->scscr & ~(SCSCR_CKE1 | SCSCR_CKE0)); - dev_dbg(port->dev, "SCSCR 0x%x\n", scr_val); serial_port_out(port, SCSCR, scr_val | s->hscif_tot); if ((srr + 1 == 5) && (port->type == PORT_SCIFA || port->type == PORT_SCIFB)) { @@ -2481,8 +2488,6 @@ done: s->rx_frame = (100 * bits * HZ) / (baud / 10); #ifdef CONFIG_SERIAL_SH_SCI_DMA s->rx_timeout = DIV_ROUND_UP(s->buf_len_rx * 2 * s->rx_frame, 1000); - dev_dbg(port->dev, "DMA Rx t-out %ums, tty t-out %u jiffies\n", - s->rx_timeout * 1000 / HZ, port->timeout); if (s->rx_timeout < msecs_to_jiffies(20)) s->rx_timeout = msecs_to_jiffies(20); #endif @@ -2490,6 +2495,8 @@ done: if ((termios->c_cflag & CREAD) != 0) sci_start_rx(port); + spin_unlock_irqrestore(&port->lock, flags); + sci_port_disable(s); if (UART_ENABLE_MS(port, termios->c_cflag)) -- cgit v1.1 From 9356335faf9f65568dbdb9bba2a07117f69d34c5 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Wed, 1 Nov 2017 10:49:23 +0000 Subject: serial: core: remove redundant assignment to port The final assignment to port is never read, hence it is redundant and can be removed. Also move the declaration of port to a more local scope. Cleans up clang warning: drivers/tty/serial/serial_core.c:1498:2: warning: Value stored to 'port' is never read Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/serial_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index f4e6c866..cdac01f 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1482,10 +1482,10 @@ out: static void uart_close(struct tty_struct *tty, struct file *filp) { struct uart_state *state = tty->driver_data; - struct tty_port *port; if (!state) { struct uart_driver *drv = tty->driver->driver_state; + struct tty_port *port; state = drv->state + tty->index; port = &state->port; @@ -1495,7 +1495,6 @@ static void uart_close(struct tty_struct *tty, struct file *filp) return; } - port = &state->port; pr_debug("uart_close(%d) called\n", tty->index); tty_port_close(tty->port, tty, filp); -- cgit v1.1 From 3236a965486ba0c6043cf2c7b51943d8b382ae29 Mon Sep 17 00:00:00 2001 From: Lukas Wunner Date: Sat, 28 Oct 2017 11:35:49 +0200 Subject: serial: 8250_fintek: Fix rs485 disablement on invalid ioctl() This driver's ->rs485_config callback checks if SER_RS485_RTS_ON_SEND and SER_RS485_RTS_AFTER_SEND have the same value. If they do, it means the user has passed in invalid data with the TIOCSRS485 ioctl() since RTS must have a different polarity when sending and when not sending. In this case, rs485 mode is not enabled (the RS485_URA bit is not set in the RS485 Enable Register) and this is supposed to be signaled back to the user by clearing the SER_RS485_ENABLED bit in struct serial_rs485 ... except a missing tilde character is preventing that from happening. Fixes: 28e3fb6c4dce ("serial: Add support for Fintek F81216A LPC to 4 UART") Cc: Ricardo Ribalda Delgado Cc: "Ji-Ze Hong (Peter Hong)" Signed-off-by: Lukas Wunner Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_fintek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index b346239..c41cbb5 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -221,7 +221,7 @@ static int fintek_8250_rs485_config(struct uart_port *port, if ((!!(rs485->flags & SER_RS485_RTS_ON_SEND)) == (!!(rs485->flags & SER_RS485_RTS_AFTER_SEND))) - rs485->flags &= SER_RS485_ENABLED; + rs485->flags &= ~SER_RS485_ENABLED; else config |= RS485_URA; -- cgit v1.1 From 2a76fa2830981e15bfa33c2b0e5f2dfd35b0455c Mon Sep 17 00:00:00 2001 From: Lukas Wunner Date: Wed, 25 Oct 2017 10:06:33 +0200 Subject: serial: pl011: Adopt generic flag to store auto RTS status Back in 2010, commit 3b43816f685f ("ARM: 5933/1: amba-pl011: support hardware flow control") added an autorts flag to this driver to store whether automatic hardware flow control is requested. In 2015, commit 391f93f2ec9f ("serial: core: Rework hw-assisted flow control support") added a flag with identical functionality to generic code. Switch over to that flag and drop the driver-specific one. Cc: Rabin Vincent Cc: Peter Hurley Cc: Russell King Signed-off-by: Lukas Wunner Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/amba-pl011.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index dab3636..04f3534 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -281,7 +281,6 @@ struct uart_amba_port { unsigned int old_status; unsigned int fifosize; /* vendor-specific */ unsigned int old_cr; /* state during shutdown */ - bool autorts; unsigned int fixed_baud; /* vendor-set fixed baud rate */ char type[12]; #ifdef CONFIG_DMA_ENGINE @@ -1586,7 +1585,7 @@ static void pl011_set_mctrl(struct uart_port *port, unsigned int mctrl) TIOCMBIT(TIOCM_OUT2, UART011_CR_OUT2); TIOCMBIT(TIOCM_LOOP, UART011_CR_LBE); - if (uap->autorts) { + if (port->status & UPSTAT_AUTORTS) { /* We need to disable auto-RTS if we want to turn RTS off */ TIOCMBIT(TIOCM_RTS, UART011_CR_RTSEN); } @@ -1840,7 +1839,7 @@ static void pl011_disable_uart(struct uart_amba_port *uap) { unsigned int cr; - uap->autorts = false; + uap->port.status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS); spin_lock_irq(&uap->port.lock); cr = pl011_read(uap, REG_CR); uap->old_cr = cr; @@ -2026,10 +2025,10 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, old_cr |= UART011_CR_RTSEN; old_cr |= UART011_CR_CTSEN; - uap->autorts = true; + port->status |= UPSTAT_AUTOCTS | UPSTAT_AUTORTS; } else { old_cr &= ~(UART011_CR_CTSEN | UART011_CR_RTSEN); - uap->autorts = false; + port->status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS); } if (uap->vendor->oversampling) { -- cgit v1.1 From 94be6d74d040c614a332555f5b6d57c26dc272fc Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Wed, 1 Nov 2017 13:51:41 +0100 Subject: serial: imx: add hibernation support During hibernation, freeze/thaw/restore dev_pm_ops are called instead of suspend/resume. Hook up the hibernation ops. The _noirq parts are identical, but suspend/resume are replaced with variants that do not enable wakeup from i.MX UART. There is no need to restore register contents in thaw_noirq. Signed-off-by: Philipp Zabel Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 76818a2..2d042c6 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -2350,11 +2350,39 @@ static int imx_serial_port_resume(struct device *dev) return 0; } +static int imx_serial_port_freeze(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct imx_port *sport = platform_get_drvdata(pdev); + + uart_suspend_port(&imx_reg, &sport->port); + + /* Needed to enable clock in suspend_noirq */ + return clk_prepare(sport->clk_ipg); +} + +static int imx_serial_port_thaw(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct imx_port *sport = platform_get_drvdata(pdev); + + uart_resume_port(&imx_reg, &sport->port); + + clk_unprepare(sport->clk_ipg); + + return 0; +} + static const struct dev_pm_ops imx_serial_port_pm_ops = { .suspend_noirq = imx_serial_port_suspend_noirq, .resume_noirq = imx_serial_port_resume_noirq, + .freeze_noirq = imx_serial_port_suspend_noirq, + .restore_noirq = imx_serial_port_resume_noirq, .suspend = imx_serial_port_suspend, .resume = imx_serial_port_resume, + .freeze = imx_serial_port_freeze, + .thaw = imx_serial_port_thaw, + .restore = imx_serial_port_thaw, }; static struct platform_driver serial_imx_driver = { -- cgit v1.1 From 4fefcbff8be52c7e68feefa0c96fb8e06923aab3 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 02:59:40 -0700 Subject: serial: m32r_sio: Drop redundant .data assignment With the timer converted to using the new timer_setup()/from_timer() API, setting the .data field is redundant (and the field will be removed soon), so drop it. Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linux-serial@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/m32r_sio.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/m32r_sio.c index 5f4003a..0bc548a 100644 --- a/drivers/tty/serial/m32r_sio.c +++ b/drivers/tty/serial/m32r_sio.c @@ -576,7 +576,6 @@ static int m32r_sio_startup(struct uart_port *port) timeout = timeout > 6 ? (timeout / 2 - 2) : 1; - up->timer.data = (unsigned long)up; mod_timer(&up->timer, jiffies + timeout); } else { retval = serial_link_irq_chain(up); -- cgit v1.1 From b86f86e8e7c5264bb8f5835d60f9ec840d9f5a7a Mon Sep 17 00:00:00 2001 From: Tomas Melin Date: Fri, 27 Oct 2017 15:16:30 +0300 Subject: serial: 8250: fix potential deadlock in rs485-mode Canceling hrtimer when holding uart spinlock can deadlock. CPU0: syscall write -> get uart port spinlock -> write uart -> start_tx_rs485 -> hrtimer_cancel -> wait for hrtimer callback to finish CPU1: hrtimer IRQ -> run hrtimer -> em485_handle_stop_tx -> get uart port spinlock CPU0 is waiting for the hrtimer callback to finish, but the hrtimer callback running on CPU1 is waiting to get the uart port spinlock. This deadlock can be avoided by not canceling the hrtimers in these paths. Setting active_timer=NULL can be done without accessing hrtimer, and that will effectively cancel operations that would otherwise have been performed by the hrtimer callback. Signed-off-by: Tomas Melin Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_port.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index c2fb92f..d0d171b 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1516,7 +1516,6 @@ static inline void __stop_tx(struct uart_8250_port *p) return; em485->active_timer = NULL; - hrtimer_cancel(&em485->start_tx_timer); __stop_tx_rs485(p); } @@ -1580,8 +1579,6 @@ static inline void start_tx_rs485(struct uart_port *port) serial8250_stop_rx(&up->port); em485->active_timer = NULL; - if (hrtimer_is_queued(&em485->stop_tx_timer)) - hrtimer_cancel(&em485->stop_tx_timer); mcr = serial8250_in_MCR(up); if (!!(up->port.rs485.flags & SER_RS485_RTS_ON_SEND) != -- cgit v1.1 From 52108109fa125ffb11df178e1ac5eb9650f0743d Mon Sep 17 00:00:00 2001 From: Troy Kisky Date: Fri, 20 Oct 2017 14:20:19 -0700 Subject: tty: serial: imx: disable ageing timer interrupt if dma in use Since commit 4dec2f119e86 ("imx-serial: RX DMA startup latency") the interrupt routine no longer will start rx dma. So, we no longer need to enable this interrupt to start dma. Signed-off-by: Troy Kisky Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 2d042c6..bf3e981 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1208,10 +1208,6 @@ static void imx_enable_dma(struct imx_port *sport) temp |= UCR1_RDMAEN | UCR1_TDMAEN | UCR1_ATDMAEN; writel(temp, sport->port.membase + UCR1); - temp = readl(sport->port.membase + UCR2); - temp |= UCR2_ATEN; - writel(temp, sport->port.membase + UCR2); - imx_setup_ufcr(sport, TXTL_DMA, RXTL_DMA); sport->dma_is_enabled = 1; -- cgit v1.1 From 9ce99a3a9284cfb8d45a7abc43346f880da338cc Mon Sep 17 00:00:00 2001 From: Troy Kisky Date: Fri, 20 Oct 2017 14:20:20 -0700 Subject: tty: serial: imx: remove dead code imx_dma_rxint Since commit 4dec2f119e86 ("imx-serial: RX DMA startup latency") the interrupt routine no longer will start rx dma. imx_dma_rxint no longer needs to be called to try and start dma. It won't start dma because dma_is_rxing is already true meaning dma is already started. Signed-off-by: Troy Kisky Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index bf3e981..1b04ef5 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -732,29 +732,6 @@ static void imx_disable_rx_int(struct imx_port *sport) } static void clear_rx_errors(struct imx_port *sport); -static int start_rx_dma(struct imx_port *sport); -/* - * If the RXFIFO is filled with some data, and then we - * arise a DMA operation to receive them. - */ -static void imx_dma_rxint(struct imx_port *sport) -{ - unsigned long temp; - unsigned long flags; - - spin_lock_irqsave(&sport->port.lock, flags); - - temp = readl(sport->port.membase + USR2); - if ((temp & USR2_RDR) && !sport->dma_is_rxing) { - - imx_disable_rx_int(sport); - - /* tell the DMA to receive the data. */ - start_rx_dma(sport); - } - - spin_unlock_irqrestore(&sport->port.lock, flags); -} /* * We have a modem side uart, so the meanings of RTS and CTS are inverted. @@ -816,11 +793,8 @@ static irqreturn_t imx_int(int irq, void *dev_id) sts = readl(sport->port.membase + USR1); sts2 = readl(sport->port.membase + USR2); - if (sts & (USR1_RRDY | USR1_AGTIM)) { - if (sport->dma_is_enabled) - imx_dma_rxint(sport); - else - imx_rxint(irq, dev_id); + if (!sport->dma_is_enabled && (sts & (USR1_RRDY | USR1_AGTIM))) { + imx_rxint(irq, dev_id); ret = IRQ_HANDLED; } -- cgit v1.1 From c100a3f132e4981d4b2b874657b390a137c6c32e Mon Sep 17 00:00:00 2001 From: Gimcuan Hui Date: Sun, 5 Nov 2017 05:06:18 +0000 Subject: tty: serial: jsm: change the type of local variable The return type of jsm_get_mstat was int, and the local var result was for the return should be int, make the change. This patch fixes the checkpatch.pl warning: Prefer 'unsigned int' to bare use of 'unsigned'. Signed-off-by: Gimcuan Hui Acked-by: Guilherme G. Piccoli Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/jsm/jsm_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c index e69227c..729d2a08 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c @@ -36,7 +36,7 @@ static void jsm_carrier(struct jsm_channel *ch); static inline int jsm_get_mstat(struct jsm_channel *ch) { unsigned char mstat; - unsigned result; + int result; jsm_dbg(IOCTL, &ch->ch_bd->pci_dev, "start\n"); -- cgit v1.1 From d13551d1c9010b063a147839e29503ff8c632342 Mon Sep 17 00:00:00 2001 From: Gimcuan Hui Date: Sun, 5 Nov 2017 05:06:19 +0000 Subject: tty: serial: jsm: add blank line after declarations This patch fixes checkpatch.pl warning: Missing a blank line after declarations. Signed-off-by: Gimcuan Hui Acked-by: Guilherme G. Piccoli Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/jsm/jsm_tty.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c index 729d2a08..ed58dfc 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c @@ -124,6 +124,7 @@ static void jsm_tty_set_mctrl(struct uart_port *port, unsigned int mctrl) static void jsm_tty_write(struct uart_port *port) { struct jsm_channel *channel; + channel = container_of(port, struct jsm_channel, uart_port); channel->ch_bd->bd_ops->copy_data_from_queue_to_uart(channel); } -- cgit v1.1 From 24719a8dfa1999b4c7d5374480ca5fc6373536ff Mon Sep 17 00:00:00 2001 From: Gimcuan Hui Date: Sun, 5 Nov 2017 05:06:20 +0000 Subject: tty: serial: jsm: delete space between function name and '(' This patch fixes checkpatch.pl warning: space prohibited between function name and open parenthesis '('. Signed-off-by: Gimcuan Hui Acked-by: Guilherme G. Piccoli Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/jsm/jsm_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c index ed58dfc..53c3f53 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c @@ -474,7 +474,7 @@ int jsm_uart_port_init(struct jsm_board *brd) } else set_bit(line, linemap); brd->channels[i]->uart_port.line = line; - rc = uart_add_one_port (&jsm_uart_driver, &brd->channels[i]->uart_port); + rc = uart_add_one_port(&jsm_uart_driver, &brd->channels[i]->uart_port); if (rc) { printk(KERN_INFO "jsm: Port %d failed. Aborting...\n", i); return rc; -- cgit v1.1 From 67c6f4b660985f5754fa7c98bd53705020814d32 Mon Sep 17 00:00:00 2001 From: Gimcuan Hui Date: Sun, 5 Nov 2017 05:06:21 +0000 Subject: tty: serial: jsm: fix coding style This patch fixes the checkpatch.pl complain: ERROR: else should follow close brace '}'. Signed-off-by: Gimcuan Hui Acked-by: Guilherme G. Piccoli Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/jsm/jsm_tty.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c index 53c3f53..3853bfa 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c @@ -478,8 +478,7 @@ int jsm_uart_port_init(struct jsm_board *brd) if (rc) { printk(KERN_INFO "jsm: Port %d failed. Aborting...\n", i); return rc; - } - else + } else printk(KERN_INFO "jsm: Port %d added\n", i); } -- cgit v1.1 From 8191762a21a056faefb00a11eabe3d377ad88c39 Mon Sep 17 00:00:00 2001 From: Gimcuan Hui Date: Sun, 5 Nov 2017 05:06:22 +0000 Subject: tty: serial: jsm: add space before the open parenthesis '(' This patch fixes the checkpatch.pl complains: space required before the open parenthesis '('. Signed-off-by: Gimcuan Hui Acked-by: Guilherme G. Piccoli Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/jsm/jsm_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c index 3853bfa..cbbadaf 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c @@ -541,7 +541,7 @@ void jsm_input(struct jsm_channel *ch) tp = port->tty; bd = ch->ch_bd; - if(!bd) + if (!bd) return; spin_lock_irqsave(&ch->ch_lock, lock_flags); @@ -781,7 +781,7 @@ void jsm_check_queue_flow_control(struct jsm_channel *ch) if (qleft < 256) { /* HWFLOW */ if (ch->ch_c_cflag & CRTSCTS) { - if(!(ch->ch_flags & CH_RECEIVER_OFF)) { + if (!(ch->ch_flags & CH_RECEIVER_OFF)) { bd_ops->disable_receiver(ch); ch->ch_flags |= (CH_RECEIVER_OFF); jsm_dbg(READ, &ch->ch_bd->pci_dev, -- cgit v1.1 From 2e67c95022977a839c9c1c3acee19c4ec98a0d62 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 7 Nov 2017 11:41:07 +0000 Subject: tty: serial: jsm: remove redundant pointer ts Pointer ts is assigned a value that is never read, ts is therefore redundant and can be removed. Cleans up clang warning: drivers/tty/serial/jsm/jsm_tty.c:285:2: warning: Value stored to 'ts' is never read Signed-off-by: Colin Ian King Acked-by: Guilherme G. Piccoli Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/jsm/jsm_tty.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c index cbbadaf..b34def0 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c @@ -276,14 +276,12 @@ static int jsm_tty_open(struct uart_port *port) static void jsm_tty_close(struct uart_port *port) { struct jsm_board *bd; - struct ktermios *ts; struct jsm_channel *channel = container_of(port, struct jsm_channel, uart_port); jsm_dbg(CLOSE, &channel->ch_bd->pci_dev, "start\n"); bd = channel->ch_bd; - ts = &port->state->port.tty->termios; channel->ch_flags &= ~(CH_STOPI); -- cgit v1.1 From e3b3d0f549c1d19b94e6ac55c66643166ea649ef Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Nov 2017 18:11:51 +0100 Subject: tty: add SPDX identifiers to all remaining files in drivers/tty/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/tty files files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Jiri Slaby Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Chris Metcalf Cc: Jiri Kosina Cc: David Sterba Cc: James Hogan Cc: Rob Herring Cc: Eric Anholt Cc: Stefan Wahren Cc: Florian Fainelli Cc: Ray Jui Cc: Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Joachim Eastwood Cc: Matthias Brugger Cc: Masahiro Yamada Cc: Tobias Klauser Cc: Russell King Cc: Vineet Gupta Cc: Richard Genoud Cc: Alexander Shiyan Cc: Baruch Siach Cc: "Maciej W. Rozycki" Cc: "Uwe Kleine-König" Cc: Pat Gefre Cc: "Guilherme G. Piccoli" Cc: Jason Wessel Cc: Vladimir Zapolskiy Cc: Sylvain Lemieux Cc: Carlo Caione Cc: Kevin Hilman Cc: Liviu Dudau Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: Andy Gross Cc: David Brown Cc: "Andreas Färber" Cc: Kevin Cernekee Cc: Laxman Dewangan Cc: Thierry Reding Cc: Jonathan Hunter Cc: Barry Song Cc: Patrice Chotard Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: "David S. Miller" Cc: Peter Korsgaard Cc: Timur Tabi Cc: Tony Prisk Cc: Michal Simek Cc: "Sören Brinkmann" Cc: Thomas Gleixner Cc: Kate Stewart Cc: Philippe Ombredanne Cc: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- drivers/tty/amiserial.c | 1 + drivers/tty/bfin_jtag_comm.c | 1 + drivers/tty/cyclades.c | 1 + drivers/tty/ehv_bytechan.c | 1 + drivers/tty/goldfish.c | 1 + drivers/tty/hvc/hvc_bfin_jtag.c | 1 + drivers/tty/hvc/hvc_console.c | 1 + drivers/tty/hvc/hvc_console.h | 1 + drivers/tty/hvc/hvc_dcc.c | 1 + drivers/tty/hvc/hvc_opal.c | 1 + drivers/tty/hvc/hvc_rtas.c | 1 + drivers/tty/hvc/hvc_tile.c | 1 + drivers/tty/hvc/hvc_udbg.c | 1 + drivers/tty/hvc/hvc_vio.c | 1 + drivers/tty/hvc/hvc_xen.c | 1 + drivers/tty/hvc/hvcs.c | 1 + drivers/tty/hvc/hvsi.c | 1 + drivers/tty/ipwireless/main.c | 1 + drivers/tty/isicom.c | 1 + drivers/tty/metag_da.c | 1 + drivers/tty/mips_ejtag_fdc.c | 1 + drivers/tty/moxa.c | 1 + drivers/tty/mxser.c | 1 + drivers/tty/n_gsm.c | 1 + drivers/tty/n_hdlc.c | 1 + drivers/tty/n_null.c | 1 + drivers/tty/n_r3964.c | 1 + drivers/tty/n_tracerouter.c | 1 + drivers/tty/n_tracesink.c | 1 + drivers/tty/n_tracesink.h | 1 + drivers/tty/n_tty.c | 1 + drivers/tty/nozomi.c | 1 + drivers/tty/rocket.c | 1 + drivers/tty/serdev/core.c | 1 + drivers/tty/serdev/serdev-ttyport.c | 1 + drivers/tty/serial/21285.c | 1 + drivers/tty/serial/8250/8250.h | 1 + drivers/tty/serial/8250/8250_accent.c | 1 + drivers/tty/serial/8250/8250_acorn.c | 1 + drivers/tty/serial/8250/8250_aspeed_vuart.c | 1 + drivers/tty/serial/8250/8250_bcm2835aux.c | 1 + drivers/tty/serial/8250/8250_boca.c | 1 + drivers/tty/serial/8250/8250_core.c | 1 + drivers/tty/serial/8250/8250_dma.c | 1 + drivers/tty/serial/8250/8250_dw.c | 1 + drivers/tty/serial/8250/8250_early.c | 1 + drivers/tty/serial/8250/8250_em.c | 1 + drivers/tty/serial/8250/8250_exar.c | 1 + drivers/tty/serial/8250/8250_exar_st16c554.c | 1 + drivers/tty/serial/8250/8250_fintek.c | 1 + drivers/tty/serial/8250/8250_fourport.c | 1 + drivers/tty/serial/8250/8250_fsl.c | 1 + drivers/tty/serial/8250/8250_gsc.c | 1 + drivers/tty/serial/8250/8250_hp300.c | 1 + drivers/tty/serial/8250/8250_hub6.c | 1 + drivers/tty/serial/8250/8250_ingenic.c | 1 + drivers/tty/serial/8250/8250_lpc18xx.c | 1 + drivers/tty/serial/8250/8250_lpss.c | 1 + drivers/tty/serial/8250/8250_mid.c | 1 + drivers/tty/serial/8250/8250_moxa.c | 1 + drivers/tty/serial/8250/8250_mtk.c | 1 + drivers/tty/serial/8250/8250_of.c | 1 + drivers/tty/serial/8250/8250_omap.c | 1 + drivers/tty/serial/8250/8250_pci.c | 1 + drivers/tty/serial/8250/8250_pnp.c | 1 + drivers/tty/serial/8250/8250_port.c | 1 + drivers/tty/serial/8250/8250_pxa.c | 1 + drivers/tty/serial/8250/8250_uniphier.c | 1 + drivers/tty/serial/8250/serial_cs.c | 1 + drivers/tty/serial/altera_jtaguart.c | 1 + drivers/tty/serial/altera_uart.c | 1 + drivers/tty/serial/amba-pl010.c | 1 + drivers/tty/serial/amba-pl011.c | 1 + drivers/tty/serial/apbuart.c | 1 + drivers/tty/serial/ar933x_uart.c | 1 + drivers/tty/serial/arc_uart.c | 1 + drivers/tty/serial/atmel_serial.c | 1 + drivers/tty/serial/atmel_serial.h | 1 + drivers/tty/serial/bcm63xx_uart.c | 1 + drivers/tty/serial/bfin_sport_uart.c | 1 + drivers/tty/serial/bfin_sport_uart.h | 1 + drivers/tty/serial/bfin_uart.c | 1 + drivers/tty/serial/clps711x.c | 1 + drivers/tty/serial/cpm_uart/cpm_uart.h | 1 + drivers/tty/serial/cpm_uart/cpm_uart_core.c | 1 + drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c | 1 + drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c | 1 + drivers/tty/serial/digicolor-usart.c | 1 + drivers/tty/serial/dz.c | 1 + drivers/tty/serial/earlycon-arm-semihost.c | 1 + drivers/tty/serial/earlycon.c | 1 + drivers/tty/serial/efm32-uart.c | 1 + drivers/tty/serial/fsl_lpuart.c | 1 + drivers/tty/serial/icom.c | 1 + drivers/tty/serial/icom.h | 1 + drivers/tty/serial/ifx6x60.c | 1 + drivers/tty/serial/ifx6x60.h | 1 + drivers/tty/serial/imx.c | 1 + drivers/tty/serial/ioc3_serial.c | 1 + drivers/tty/serial/ioc4_serial.c | 1 + drivers/tty/serial/ip22zilog.c | 1 + drivers/tty/serial/jsm/jsm.h | 1 + drivers/tty/serial/jsm/jsm_cls.c | 1 + drivers/tty/serial/jsm/jsm_driver.c | 1 + drivers/tty/serial/jsm/jsm_neo.c | 1 + drivers/tty/serial/jsm/jsm_tty.c | 1 + drivers/tty/serial/kgdb_nmi.c | 1 + drivers/tty/serial/kgdboc.c | 1 + drivers/tty/serial/lantiq.c | 1 + drivers/tty/serial/lpc32xx_hs.c | 1 + drivers/tty/serial/m32r_sio.c | 1 + drivers/tty/serial/m32r_sio_reg.h | 1 + drivers/tty/serial/max3100.c | 1 + drivers/tty/serial/max310x.c | 1 + drivers/tty/serial/mcf.c | 1 + drivers/tty/serial/men_z135_uart.c | 1 + drivers/tty/serial/meson_uart.c | 1 + drivers/tty/serial/mpc52xx_uart.c | 1 + drivers/tty/serial/mps2-uart.c | 1 + drivers/tty/serial/mpsc.c | 1 + drivers/tty/serial/msm_serial.c | 1 + drivers/tty/serial/mux.c | 1 + drivers/tty/serial/mvebu-uart.c | 1 + drivers/tty/serial/mxs-auart.c | 1 + drivers/tty/serial/netx-serial.c | 1 + drivers/tty/serial/omap-serial.c | 1 + drivers/tty/serial/owl-uart.c | 1 + drivers/tty/serial/pch_uart.c | 1 + drivers/tty/serial/pic32_uart.c | 1 + drivers/tty/serial/pic32_uart.h | 1 + drivers/tty/serial/pmac_zilog.c | 1 + drivers/tty/serial/pnx8xxx_uart.c | 1 + drivers/tty/serial/pxa.c | 1 + drivers/tty/serial/rp2.c | 1 + drivers/tty/serial/sa1100.c | 1 + drivers/tty/serial/samsung.c | 1 + drivers/tty/serial/samsung.h | 1 + drivers/tty/serial/sb1250-duart.c | 1 + drivers/tty/serial/sc16is7xx.c | 1 + drivers/tty/serial/sccnxp.c | 1 + drivers/tty/serial/serial-tegra.c | 1 + drivers/tty/serial/serial_core.c | 1 + drivers/tty/serial/serial_ks8695.c | 1 + drivers/tty/serial/serial_mctrl_gpio.c | 1 + drivers/tty/serial/serial_mctrl_gpio.h | 1 + drivers/tty/serial/serial_txx9.c | 1 + drivers/tty/serial/sh-sci.c | 1 + drivers/tty/serial/sirfsoc_uart.c | 1 + drivers/tty/serial/sirfsoc_uart.h | 1 + drivers/tty/serial/sprd_serial.c | 1 + drivers/tty/serial/st-asc.c | 1 + drivers/tty/serial/stm32-usart.c | 1 + drivers/tty/serial/stm32-usart.h | 1 + drivers/tty/serial/suncore.c | 1 + drivers/tty/serial/sunhv.c | 1 + drivers/tty/serial/sunsab.c | 1 + drivers/tty/serial/sunsu.c | 1 + drivers/tty/serial/sunzilog.c | 1 + drivers/tty/serial/tilegx.c | 1 + drivers/tty/serial/timbuart.c | 1 + drivers/tty/serial/timbuart.h | 1 + drivers/tty/serial/uartlite.c | 1 + drivers/tty/serial/ucc_uart.c | 1 + drivers/tty/serial/vr41xx_siu.c | 1 + drivers/tty/serial/vt8500_serial.c | 1 + drivers/tty/serial/xilinx_uartps.c | 1 + drivers/tty/serial/zs.c | 1 + drivers/tty/synclink.c | 1 + drivers/tty/synclink_gt.c | 1 + drivers/tty/synclinkmp.c | 1 + drivers/tty/tty_audit.c | 1 + drivers/tty/tty_baudrate.c | 1 + drivers/tty/tty_buffer.c | 1 + drivers/tty/tty_io.c | 1 + drivers/tty/tty_ioctl.c | 1 + drivers/tty/tty_jobctrl.c | 1 + drivers/tty/tty_ldisc.c | 1 + drivers/tty/tty_ldsem.c | 1 + drivers/tty/tty_port.c | 1 + drivers/tty/vt/consolemap.c | 1 + drivers/tty/vt/keyboard.c | 1 + drivers/tty/vt/vt.c | 1 + 182 files changed, 182 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c index 9820e20..32d7ce4 100644 --- a/drivers/tty/amiserial.c +++ b/drivers/tty/amiserial.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Serial driver for the amiga builtin port. * diff --git a/drivers/tty/bfin_jtag_comm.c b/drivers/tty/bfin_jtag_comm.c index ce24182..d569692 100644 --- a/drivers/tty/bfin_jtag_comm.c +++ b/drivers/tty/bfin_jtag_comm.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * TTY over Blackfin JTAG Communication * diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c index f30f7a9..4f69f10 100644 --- a/drivers/tty/cyclades.c +++ b/drivers/tty/cyclades.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #undef BLOCKMOVE #define Z_WAKE #undef Z_EXT_CHARS_IN_BUFFER diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c index a1c7125..9637f34 100644 --- a/drivers/tty/ehv_bytechan.c +++ b/drivers/tty/ehv_bytechan.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* ePAPR hypervisor byte channel device driver * * Copyright 2009-2011 Freescale Semiconductor, Inc. diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c index 381e981..061f10d 100644 --- a/drivers/tty/goldfish.c +++ b/drivers/tty/goldfish.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2007 Google, Inc. * Copyright (C) 2012 Intel, Inc. diff --git a/drivers/tty/hvc/hvc_bfin_jtag.c b/drivers/tty/hvc/hvc_bfin_jtag.c index 31d6cc6..24ff4c4 100644 --- a/drivers/tty/hvc/hvc_bfin_jtag.c +++ b/drivers/tty/hvc/hvc_bfin_jtag.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Console via Blackfin JTAG Communication * diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index a8d3991..fed03a6 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2001 Anton Blanchard , IBM * Copyright (C) 2001 Paul Mackerras , IBM diff --git a/drivers/tty/hvc/hvc_console.h b/drivers/tty/hvc/hvc_console.h index 798c48d..74c9a20 100644 --- a/drivers/tty/hvc/hvc_console.h +++ b/drivers/tty/hvc/hvc_console.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * hvc_console.h * Copyright (C) 2005 IBM Corporation diff --git a/drivers/tty/hvc/hvc_dcc.c b/drivers/tty/hvc/hvc_dcc.c index 82f240f..3e4fb87 100644 --- a/drivers/tty/hvc/hvc_dcc.c +++ b/drivers/tty/hvc/hvc_dcc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c index 16331a9..4f361ba 100644 --- a/drivers/tty/hvc/hvc_opal.c +++ b/drivers/tty/hvc/hvc_opal.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * opal driver interface to hvc_console.c * diff --git a/drivers/tty/hvc/hvc_rtas.c b/drivers/tty/hvc/hvc_rtas.c index 08c8792..c168bd5 100644 --- a/drivers/tty/hvc/hvc_rtas.c +++ b/drivers/tty/hvc/hvc_rtas.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * IBM RTAS driver interface to hvc_console.c * diff --git a/drivers/tty/hvc/hvc_tile.c b/drivers/tty/hvc/hvc_tile.c index 9da1e84..cdd8fa7 100644 --- a/drivers/tty/hvc/hvc_tile.c +++ b/drivers/tty/hvc/hvc_tile.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright 2010 Tilera Corporation. All Rights Reserved. * diff --git a/drivers/tty/hvc/hvc_udbg.c b/drivers/tty/hvc/hvc_udbg.c index 9cf573d..d32929b 100644 --- a/drivers/tty/hvc/hvc_udbg.c +++ b/drivers/tty/hvc/hvc_udbg.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * udbg interface to hvc_console.c * diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c index a1d272a..287ccf6 100644 --- a/drivers/tty/hvc/hvc_vio.c +++ b/drivers/tty/hvc/hvc_vio.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * vio driver interface to hvc_console.c * diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index 5e87e48..e38a50d 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * xen console driver interface to hvc_console.c * diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index 63c29fe..fc5a12e 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * IBM eServer Hypervisor Virtual Console Server Device Driver * Copyright (C) 2003, 2004 IBM Corp. diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c index 2e578d6..63ebc73 100644 --- a/drivers/tty/hvc/hvsi.c +++ b/drivers/tty/hvc/hvsi.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2004 Hollis Blanchard , IBM * diff --git a/drivers/tty/ipwireless/main.c b/drivers/tty/ipwireless/main.c index 655c7948..3475e84 100644 --- a/drivers/tty/ipwireless/main.c +++ b/drivers/tty/ipwireless/main.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * IPWireless 3G PCMCIA Network Driver * diff --git a/drivers/tty/isicom.c b/drivers/tty/isicom.c index 61ecdd6..a598f79 100644 --- a/drivers/tty/isicom.c +++ b/drivers/tty/isicom.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/drivers/tty/metag_da.c b/drivers/tty/metag_da.c index 82ccf39..6c80496 100644 --- a/drivers/tty/metag_da.c +++ b/drivers/tty/metag_da.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * dashtty.c - tty driver for Dash channels interface. * diff --git a/drivers/tty/mips_ejtag_fdc.c b/drivers/tty/mips_ejtag_fdc.c index 51678f3..f0a2f19 100644 --- a/drivers/tty/mips_ejtag_fdc.c +++ b/drivers/tty/mips_ejtag_fdc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * TTY driver for MIPS EJTAG Fast Debug Channels. * diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 7f3d4cb..8223960 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /*****************************************************************************/ /* * moxa.c -- MOXA Intellio family multiport serial driver. diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 2497be8..4f4a54d 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * mxser.c -- MOXA Smartio/Industio family multiport serial driver. * diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 33530d8..df51d49 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * n_gsm.c GSM 0710 tty multiplexor * Copyright (c) 2009/10 Intel Corporation diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c index 7b2a466..e2af7b1 100644 --- a/drivers/tty/n_hdlc.c +++ b/drivers/tty/n_hdlc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-1.0+ /* generic HDLC line discipline for Linux * * Written by Paul Fulghum paulkf@microgate.com diff --git a/drivers/tty/n_null.c b/drivers/tty/n_null.c index d63261c..cf6dc0f 100644 --- a/drivers/tty/n_null.c +++ b/drivers/tty/n_null.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/drivers/tty/n_r3964.c b/drivers/tty/n_r3964.c index 305b649..d184115 100644 --- a/drivers/tty/n_r3964.c +++ b/drivers/tty/n_r3964.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-1.0+ /* r3964 linediscipline for linux * * ----------------------------------------------------------- diff --git a/drivers/tty/n_tracerouter.c b/drivers/tty/n_tracerouter.c index ac57169..717d0c1 100644 --- a/drivers/tty/n_tracerouter.c +++ b/drivers/tty/n_tracerouter.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * n_tracerouter.c - Trace data router through tty space * diff --git a/drivers/tty/n_tracesink.c b/drivers/tty/n_tracesink.c index 4616870..f907094 100644 --- a/drivers/tty/n_tracesink.c +++ b/drivers/tty/n_tracesink.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * n_tracesink.c - Trace data router and sink path through tty space. * diff --git a/drivers/tty/n_tracesink.h b/drivers/tty/n_tracesink.h index a68bb44..2c9efd3 100644 --- a/drivers/tty/n_tracesink.h +++ b/drivers/tty/n_tracesink.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * n_tracesink.h - Kernel driver API to route trace data in kernel space. * diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index bdf0e6e..385b6a5 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-1.0+ /* * n_tty.c --- implements the N_TTY line discipline. * diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c index 39b3723..ec3e1b2 100644 --- a/drivers/tty/nozomi.c +++ b/drivers/tty/nozomi.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) /* * nozomi.c -- HSDPA driver Broadband Wireless Data Card - Globe Trotter * diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c index 20d79a6..59cd4b2 100644 --- a/drivers/tty/rocket.c +++ b/drivers/tty/rocket.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) /* * RocketPort device driver for Linux * diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index 4d662d1..2aece10 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2016-2017 Linaro Ltd., Rob Herring * diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c index 5b09ce9..57ff05e 100644 --- a/drivers/tty/serdev/serdev-ttyport.c +++ b/drivers/tty/serdev/serdev-ttyport.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2016-2017 Linaro Ltd., Rob Herring * diff --git a/drivers/tty/serial/21285.c b/drivers/tty/serial/21285.c index 804632b..32b3acf 100644 --- a/drivers/tty/serial/21285.c +++ b/drivers/tty/serial/21285.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for the serial port on the 21285 StrongArm-110 core logic chip. * diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index b2bdc35..36e9ae1 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for 8250/16550-type serial ports * diff --git a/drivers/tty/serial/8250/8250_accent.c b/drivers/tty/serial/8250/8250_accent.c index 522aeae..2c11bc1 100644 --- a/drivers/tty/serial/8250/8250_accent.c +++ b/drivers/tty/serial/8250/8250_accent.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2005 Russell King. * Data taken from include/asm-i386/serial.h diff --git a/drivers/tty/serial/8250/8250_acorn.c b/drivers/tty/serial/8250/8250_acorn.c index 402dfdd..5395343 100644 --- a/drivers/tty/serial/8250/8250_acorn.c +++ b/drivers/tty/serial/8250/8250_acorn.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * linux/drivers/serial/acorn.c * diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c index 33a8013..c468bcc 100644 --- a/drivers/tty/serial/8250/8250_aspeed_vuart.c +++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Serial Port driver for Aspeed VUART device * diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c index a23c7da..242ec18 100644 --- a/drivers/tty/serial/8250/8250_bcm2835aux.c +++ b/drivers/tty/serial/8250/8250_bcm2835aux.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Serial port driver for BCM2835AUX UART * diff --git a/drivers/tty/serial/8250/8250_boca.c b/drivers/tty/serial/8250/8250_boca.c index a63b599..4123eb8 100644 --- a/drivers/tty/serial/8250/8250_boca.c +++ b/drivers/tty/serial/8250/8250_boca.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2005 Russell King. * Data taken from include/asm-i386/serial.h diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index ccfc42c..08db331 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Universal/legacy driver for 8250/16550-type serial ports * diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c index 26f1745..fe92593 100644 --- a/drivers/tty/serial/8250/8250_dma.c +++ b/drivers/tty/serial/8250/8250_dma.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * 8250_dma.c - DMA Engine API support for 8250.c * diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 10b0aca..3b4bc4d 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Synopsys DesignWare 8250 driver. * diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c index af72ec3..224f8c1 100644 --- a/drivers/tty/serial/8250/8250_early.c +++ b/drivers/tty/serial/8250/8250_early.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Early serial console for 8250/16550 devices * diff --git a/drivers/tty/serial/8250/8250_em.c b/drivers/tty/serial/8250/8250_em.c index 0b63812..36355b3 100644 --- a/drivers/tty/serial/8250/8250_em.c +++ b/drivers/tty/serial/8250/8250_em.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Renesas Emma Mobile 8250 driver * diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index c556247..4d668e2 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Probe module for 8250/16550-type Exar chips PCI serial ports. * diff --git a/drivers/tty/serial/8250/8250_exar_st16c554.c b/drivers/tty/serial/8250/8250_exar_st16c554.c index 3a7cb82..0b1318b 100644 --- a/drivers/tty/serial/8250/8250_exar_st16c554.c +++ b/drivers/tty/serial/8250/8250_exar_st16c554.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Written by Paul B Schroeder < pschroeder "at" uplogix "dot" com > * Based on 8250_boca. diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index c41cbb5..894763f 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Probe for F81216A LPC to 4 UART * diff --git a/drivers/tty/serial/8250/8250_fourport.c b/drivers/tty/serial/8250/8250_fourport.c index 4045180..1d8e936 100644 --- a/drivers/tty/serial/8250/8250_fourport.c +++ b/drivers/tty/serial/8250/8250_fourport.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2005 Russell King. * Data taken from include/asm-i386/serial.h diff --git a/drivers/tty/serial/8250/8250_fsl.c b/drivers/tty/serial/8250/8250_fsl.c index 910bfee..dafe7aa 100644 --- a/drivers/tty/serial/8250/8250_fsl.c +++ b/drivers/tty/serial/8250/8250_fsl.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include diff --git a/drivers/tty/serial/8250/8250_gsc.c b/drivers/tty/serial/8250/8250_gsc.c index df2931e..8eea662 100644 --- a/drivers/tty/serial/8250/8250_gsc.c +++ b/drivers/tty/serial/8250/8250_gsc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Serial Device Initialisation for Lasi/Asp/Wax/Dino * diff --git a/drivers/tty/serial/8250/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c index 115190b..3012ea0 100644 --- a/drivers/tty/serial/8250/8250_hp300.c +++ b/drivers/tty/serial/8250/8250_hp300.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for the 98626/98644/internal serial interface on hp300/hp400 * (based on the National Semiconductor INS8250/NS16550AF/WD16C552 UARTs) diff --git a/drivers/tty/serial/8250/8250_hub6.c b/drivers/tty/serial/8250/8250_hub6.c index 27124e2..f75c89e 100644 --- a/drivers/tty/serial/8250/8250_hub6.c +++ b/drivers/tty/serial/8250/8250_hub6.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2005 Russell King. * Data taken from include/asm-i386/serial.h diff --git a/drivers/tty/serial/8250/8250_ingenic.c b/drivers/tty/serial/8250/8250_ingenic.c index 464389b..5c993a3 100644 --- a/drivers/tty/serial/8250/8250_ingenic.c +++ b/drivers/tty/serial/8250/8250_ingenic.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2010 Lars-Peter Clausen * Copyright (C) 2015 Imagination Technologies diff --git a/drivers/tty/serial/8250/8250_lpc18xx.c b/drivers/tty/serial/8250/8250_lpc18xx.c index 99cd478..e340115 100644 --- a/drivers/tty/serial/8250/8250_lpc18xx.c +++ b/drivers/tty/serial/8250/8250_lpc18xx.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Serial port driver for NXP LPC18xx/43xx UART * diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c index 7dddd7e..f4b596d 100644 --- a/drivers/tty/serial/8250/8250_lpss.c +++ b/drivers/tty/serial/8250/8250_lpss.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * 8250_lpss.c - Driver for UART on Intel Braswell and various other Intel SoCs * diff --git a/drivers/tty/serial/8250/8250_mid.c b/drivers/tty/serial/8250/8250_mid.c index b8f0b7f..b6d326c 100644 --- a/drivers/tty/serial/8250/8250_mid.c +++ b/drivers/tty/serial/8250/8250_mid.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * 8250_mid.c - Driver for UART on Intel Penwell and various other Intel SOCs * diff --git a/drivers/tty/serial/8250/8250_moxa.c b/drivers/tty/serial/8250/8250_moxa.c index d5069b2..da18dd6 100644 --- a/drivers/tty/serial/8250/8250_moxa.c +++ b/drivers/tty/serial/8250/8250_moxa.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * 8250_moxa.c - MOXA Smartio/Industio MUE multiport serial driver. * diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index fef9823..34e0f5f 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Mediatek 8250 driver. * diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index 1222c00..851e5eb 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Serial Port driver for Open Firmware platform devices * diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index 4938d338e0..bd40ba4 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * 8250-core based driver for the OMAP internal UART * diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index a6bf59d..c8d6a11 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Probe module for 8250/16550-type PCI serial ports. * diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c index 34f05ed..b556f37 100644 --- a/drivers/tty/serial/8250/8250_pnp.c +++ b/drivers/tty/serial/8250/8250_pnp.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Probe for 8250/16550-type ISAPNP serial ports. * diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index d0d171b..745eda6 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Base port operations for 8250/16550-type serial ports * diff --git a/drivers/tty/serial/8250/8250_pxa.c b/drivers/tty/serial/8250/8250_pxa.c index 4d68731..5ca660c 100644 --- a/drivers/tty/serial/8250/8250_pxa.c +++ b/drivers/tty/serial/8250/8250_pxa.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * drivers/tty/serial/8250/8250_pxa.c -- driver for PXA on-board UARTS * Copyright: (C) 2013 Sergei Ianovich diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c index 8a10b10..b4114f5 100644 --- a/drivers/tty/serial/8250/8250_uniphier.c +++ b/drivers/tty/serial/8250/8250_uniphier.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2015 Masahiro Yamada * diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c index 933c268..9963a76 100644 --- a/drivers/tty/serial/8250/serial_cs.c +++ b/drivers/tty/serial/8250/serial_cs.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MPL-1.1) /*====================================================================== A driver for PCMCIA serial devices diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index 0475f5d..ef444af 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * altera_jtaguart.c -- Altera JTAG UART driver * diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c index a0360e6..f1efcfc 100644 --- a/drivers/tty/serial/altera_uart.c +++ b/drivers/tty/serial/altera_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * altera_uart.c -- Altera UART driver * diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c index 9ec4b8d..a64a20c 100644 --- a/drivers/tty/serial/amba-pl010.c +++ b/drivers/tty/serial/amba-pl010.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for AMBA serial ports * diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 04f3534..dac3a11 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for AMBA serial ports * diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c index dd60ed9..60cd133 100644 --- a/drivers/tty/serial/apbuart.c +++ b/drivers/tty/serial/apbuart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for GRLIB serial ports (APBUART) * diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index decc7f3..15cd1a3 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Atheros AR933X SoC built-in UART driver * diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c index 77fe306..54d979b 100644 --- a/drivers/tty/serial/arc_uart.c +++ b/drivers/tty/serial/arc_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * ARC On-Chip(fpga) UART Driver * diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 68d8685..a4baa0f 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for Atmel AT91 Serial ports * Copyright (C) 2003 Rick Bronson diff --git a/drivers/tty/serial/atmel_serial.h b/drivers/tty/serial/atmel_serial.h index bd25605..b4e0e57 100644 --- a/drivers/tty/serial/atmel_serial.h +++ b/drivers/tty/serial/atmel_serial.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * include/linux/atmel_serial.h * diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c index 8c48c37..474652d 100644 --- a/drivers/tty/serial/bcm63xx_uart.c +++ b/drivers/tty/serial/bcm63xx_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/drivers/tty/serial/bfin_sport_uart.c b/drivers/tty/serial/bfin_sport_uart.c index 6525378..3401d9d 100644 --- a/drivers/tty/serial/bfin_sport_uart.c +++ b/drivers/tty/serial/bfin_sport_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Blackfin On-Chip Sport Emulated UART Driver * diff --git a/drivers/tty/serial/bfin_sport_uart.h b/drivers/tty/serial/bfin_sport_uart.h index e4510ea..6d9237b 100644 --- a/drivers/tty/serial/bfin_sport_uart.h +++ b/drivers/tty/serial/bfin_sport_uart.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Blackfin On-Chip Sport Emulated UART Driver * diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c index de5262a..ca8e42e 100644 --- a/drivers/tty/serial/bfin_uart.c +++ b/drivers/tty/serial/bfin_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Blackfin On-Chip Serial Driver * diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index ac13286..64d58f2 100644 --- a/drivers/tty/serial/clps711x.c +++ b/drivers/tty/serial/clps711x.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for CLPS711x serial ports * diff --git a/drivers/tty/serial/cpm_uart/cpm_uart.h b/drivers/tty/serial/cpm_uart/cpm_uart.h index 0ad027b..79f1d11 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart.h +++ b/drivers/tty/serial/cpm_uart/cpm_uart.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for CPM (SCC/SMC) serial ports * diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c index 9ac142c..a98d3ab 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for CPM (SCC/SMC) serial ports; core driver * diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c index 6d3b22e..31e952f 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for CPM (SCC/SMC) serial ports; CPM1 definitions * diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c index f46d2ca..84f7c8d 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for CPM (SCC/SMC) serial ports; CPM2 definitions * diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c index 02ad695..c38a163 100644 --- a/drivers/tty/serial/digicolor-usart.c +++ b/drivers/tty/serial/digicolor-usart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for Conexant Digicolor serial ports (USART) * diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c index ff465ff..7b57e84 100644 --- a/drivers/tty/serial/dz.c +++ b/drivers/tty/serial/dz.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * dz.c: Serial port driver for DECstations equipped * with the DZ chipset. diff --git a/drivers/tty/serial/earlycon-arm-semihost.c b/drivers/tty/serial/earlycon-arm-semihost.c index 6bbeb69..84780c1 100644 --- a/drivers/tty/serial/earlycon-arm-semihost.c +++ b/drivers/tty/serial/earlycon-arm-semihost.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2012 ARM Ltd. * Author: Marc Zyngier diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index 98928f0..00d24fd 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2014 Linaro Ltd. * Author: Rob Herring diff --git a/drivers/tty/serial/efm32-uart.c b/drivers/tty/serial/efm32-uart.c index 9fff25b..d6b5e54 100644 --- a/drivers/tty/serial/efm32-uart.c +++ b/drivers/tty/serial/efm32-uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #if defined(CONFIG_SERIAL_EFM32_UART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ #endif diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 73d6a7c..6652af2 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Freescale lpuart serial port driver * diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c index fe92d74..a8fd690 100644 --- a/drivers/tty/serial/icom.c +++ b/drivers/tty/serial/icom.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * icom.c * diff --git a/drivers/tty/serial/icom.h b/drivers/tty/serial/icom.h index c8029e0..da6a389 100644 --- a/drivers/tty/serial/icom.h +++ b/drivers/tty/serial/icom.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * icom.h * diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c index 596b738..7075184 100644 --- a/drivers/tty/serial/ifx6x60.c +++ b/drivers/tty/serial/ifx6x60.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /**************************************************************************** * * Driver for the IFX 6x60 spi modem. diff --git a/drivers/tty/serial/ifx6x60.h b/drivers/tty/serial/ifx6x60.h index 4fbddc2..a5346e7 100644 --- a/drivers/tty/serial/ifx6x60.h +++ b/drivers/tty/serial/ifx6x60.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /**************************************************************************** * * Driver for the IFX spi modem. diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 1b04ef5..9d3a19b 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for Motorola/Freescale IMX serial ports * diff --git a/drivers/tty/serial/ioc3_serial.c b/drivers/tty/serial/ioc3_serial.c index 906ee77..fcc4bc8 100644 --- a/drivers/tty/serial/ioc3_serial.c +++ b/drivers/tty/serial/ioc3_serial.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c index 43d7d32..8804faa 100644 --- a/drivers/tty/serial/ioc4_serial.c +++ b/drivers/tty/serial/ioc4_serial.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive diff --git a/drivers/tty/serial/ip22zilog.c b/drivers/tty/serial/ip22zilog.c index 7ddddb4..8c81073 100644 --- a/drivers/tty/serial/ip22zilog.c +++ b/drivers/tty/serial/ip22zilog.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for Zilog serial chips found on SGI workstations and * servers. This driver could actually be made more generic. diff --git a/drivers/tty/serial/jsm/jsm.h b/drivers/tty/serial/jsm/jsm.h index 0b79b87..588080b 100644 --- a/drivers/tty/serial/jsm/jsm.h +++ b/drivers/tty/serial/jsm/jsm.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /************************************************************************ * Copyright 2003 Digi International (www.digi.com) * diff --git a/drivers/tty/serial/jsm/jsm_cls.c b/drivers/tty/serial/jsm/jsm_cls.c index 4eb12a9..7479323 100644 --- a/drivers/tty/serial/jsm/jsm_cls.c +++ b/drivers/tty/serial/jsm/jsm_cls.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c index 102d499..0ede867 100644 --- a/drivers/tty/serial/jsm/jsm_driver.c +++ b/drivers/tty/serial/jsm/jsm_driver.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /************************************************************************ * Copyright 2003 Digi International (www.digi.com) * diff --git a/drivers/tty/serial/jsm/jsm_neo.c b/drivers/tty/serial/jsm/jsm_neo.c index c6fdd63..b28a0a4 100644 --- a/drivers/tty/serial/jsm/jsm_neo.c +++ b/drivers/tty/serial/jsm/jsm_neo.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /************************************************************************ * Copyright 2003 Digi International (www.digi.com) * diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c index b34def0..251e00e 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /************************************************************************ * Copyright 2003 Digi International (www.digi.com) * diff --git a/drivers/tty/serial/kgdb_nmi.c b/drivers/tty/serial/kgdb_nmi.c index 117df15..b908d4a 100644 --- a/drivers/tty/serial/kgdb_nmi.c +++ b/drivers/tty/serial/kgdb_nmi.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * KGDB NMI serial console * diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c index a260cde..62d162a 100644 --- a/drivers/tty/serial/kgdboc.c +++ b/drivers/tty/serial/kgdboc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Based on the same principle as kgdboe using the NETPOLL api, this * driver uses a console polling api to implement a gdb serial inteface diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c index 22df94f..868abff 100644 --- a/drivers/tty/serial/lantiq.c +++ b/drivers/tty/serial/lantiq.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. * diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c index cea57ff..8b58256 100644 --- a/drivers/tty/serial/lpc32xx_hs.c +++ b/drivers/tty/serial/lpc32xx_hs.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * High Speed Serial Ports on NXP LPC32xx SoC * diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/m32r_sio.c index 0bc548a..62fdeab 100644 --- a/drivers/tty/serial/m32r_sio.c +++ b/drivers/tty/serial/m32r_sio.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * m32r_sio.c * diff --git a/drivers/tty/serial/m32r_sio_reg.h b/drivers/tty/serial/m32r_sio_reg.h index 4671473..0fd9727 100644 --- a/drivers/tty/serial/m32r_sio_reg.h +++ b/drivers/tty/serial/m32r_sio_reg.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-1.0+ /* * m32r_sio_reg.h * diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index f691f3c..ac88fc9 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * * Copyright (C) 2008 Christian Pellegrin diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 9dfedbe..bd626ec 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Maxim (Dallas) MAX3107/8/9, MAX14830 serial driver * diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c index 02eb322..9c77976 100644 --- a/drivers/tty/serial/mcf.c +++ b/drivers/tty/serial/mcf.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /****************************************************************************/ /* diff --git a/drivers/tty/serial/men_z135_uart.c b/drivers/tty/serial/men_z135_uart.c index e72ea61..9387b2c 100644 --- a/drivers/tty/serial/men_z135_uart.c +++ b/drivers/tty/serial/men_z135_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * MEN 16z135 High Speed UART * diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index 95d242a..fe2d12d 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Based on meson_uart.c, by AMLOGIC, INC. * diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c index 791c4c7..1c1febd 100644 --- a/drivers/tty/serial/mpc52xx_uart.c +++ b/drivers/tty/serial/mpc52xx_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for the PSC of the Freescale MPC52xx PSCs configured as UARTs. * diff --git a/drivers/tty/serial/mps2-uart.c b/drivers/tty/serial/mps2-uart.c index 492ec4b..5d789b5 100644 --- a/drivers/tty/serial/mps2-uart.c +++ b/drivers/tty/serial/mps2-uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * MPS2 UART driver * diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c index 67ffecc..21b28d8 100644 --- a/drivers/tty/serial/mpsc.c +++ b/drivers/tty/serial/mpsc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Generic driver for the MPSC (UART mode) on Marvell parts (e.g., GT64240, * GT64260, MV64340, MV64360, GT96100, ... ). diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index 1db79ee..76649fe 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for msm7k serial device and console * diff --git a/drivers/tty/serial/mux.c b/drivers/tty/serial/mux.c index a789837..14a2996 100644 --- a/drivers/tty/serial/mux.c +++ b/drivers/tty/serial/mux.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* ** mux.c: ** serial driver for the Mux console found in some PA-RISC servers. diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 85eb5c8..79926a4 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * *************************************************************************** * Marvell Armada-3700 Serial Driver diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index be94246..2b2b082 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Application UART driver for: * Freescale STMP37XX/STMP378X diff --git a/drivers/tty/serial/netx-serial.c b/drivers/tty/serial/netx-serial.c index 207a0a0..4201938 100644 --- a/drivers/tty/serial/netx-serial.c +++ b/drivers/tty/serial/netx-serial.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2005 Sascha Hauer , Pengutronix * diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 47ba917..b3bba7a 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for OMAP-UART controller. * Based on drivers/serial/8250.c diff --git a/drivers/tty/serial/owl-uart.c b/drivers/tty/serial/owl-uart.c index b9c85936..93fa309 100644 --- a/drivers/tty/serial/owl-uart.c +++ b/drivers/tty/serial/owl-uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Actions Semi Owl family serial console * diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index d9123f9..e2c04a3 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* *Copyright (C) 2011 LAPIS Semiconductor Co., Ltd. * diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c index 00a33eb..9f55c30 100644 --- a/drivers/tty/serial/pic32_uart.c +++ b/drivers/tty/serial/pic32_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * PIC32 Integrated Serial Driver. * diff --git a/drivers/tty/serial/pic32_uart.h b/drivers/tty/serial/pic32_uart.h index ec379da..43dc168 100644 --- a/drivers/tty/serial/pic32_uart.h +++ b/drivers/tty/serial/pic32_uart.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * PIC32 Integrated Serial Driver. * diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index 6ccdd01..3afba70 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for PowerMac Z85c30 based ESCC cell found in the * "macio" ASICs of various PowerMac models diff --git a/drivers/tty/serial/pnx8xxx_uart.c b/drivers/tty/serial/pnx8xxx_uart.c index a05508a..a014de6 100644 --- a/drivers/tty/serial/pnx8xxx_uart.c +++ b/drivers/tty/serial/pnx8xxx_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * UART driver for PNX8XXX SoCs * diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c index 905631d..dd82ecb 100644 --- a/drivers/tty/serial/pxa.c +++ b/drivers/tty/serial/pxa.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Based on drivers/serial/8250.c by Russell King. * diff --git a/drivers/tty/serial/rp2.c b/drivers/tty/serial/rp2.c index 056f91b..2108bf3 100644 --- a/drivers/tty/serial/rp2.c +++ b/drivers/tty/serial/rp2.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for Comtrol RocketPort EXPRESS/INFINITY cards * diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c index 75bd1e0..abb64ab 100644 --- a/drivers/tty/serial/sa1100.c +++ b/drivers/tty/serial/sa1100.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for SA11x0 serial ports * diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 8aca18c..3a2923c 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver core for Samsung SoC onboard UARTs. * diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h index 965199b..b0461c0 100644 --- a/drivers/tty/serial/samsung.h +++ b/drivers/tty/serial/samsung.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #ifndef __SAMSUNG_H #define __SAMSUNG_H diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c index 041625c..f3d5b4e 100644 --- a/drivers/tty/serial/sb1250-duart.c +++ b/drivers/tty/serial/sb1250-duart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Support for the asynchronous serial interface (DUART) included * in the BCM1250 and derived System-On-a-Chip (SOC) devices. diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index ca54ce0..f1e216e 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * SC16IS7xx tty serial driver - Copyright (C) 2014 GridPoint * Author: Jon Ringle diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c index ba43ed1..a470dbf 100644 --- a/drivers/tty/serial/sccnxp.c +++ b/drivers/tty/serial/sccnxp.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * NXP (Philips) SCC+++(SCN+++) serial driver * diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c index cf9b736..fae65e7 100644 --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * serial_tegra.c * diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index cdac01f..ab17428 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver core for serial ports * diff --git a/drivers/tty/serial/serial_ks8695.c b/drivers/tty/serial/serial_ks8695.c index 57f1523..9a894e8 100644 --- a/drivers/tty/serial/serial_ks8695.c +++ b/drivers/tty/serial/serial_ks8695.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for KS8695 serial ports * diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c index d2da6aa..302dda1 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.c +++ b/drivers/tty/serial/serial_mctrl_gpio.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Helpers for controlling modem lines via GPIO * diff --git a/drivers/tty/serial/serial_mctrl_gpio.h b/drivers/tty/serial/serial_mctrl_gpio.h index fa000bc..219eba0 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.h +++ b/drivers/tty/serial/serial_mctrl_gpio.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Helpers for controlling modem lines via GPIO * diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c index f80fead..256c61d 100644 --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Derived from many drivers using generic_serial interface, * especially serial_tx3912.c by Steven J. Hill and r39xx_serial.c diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index d5e07dd..af94049 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * SuperH on-chip serial module support. (SCI with no FIFO / with FIFO) * diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c index 684cb8d..3e3ea07 100644 --- a/drivers/tty/serial/sirfsoc_uart.c +++ b/drivers/tty/serial/sirfsoc_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for CSR SiRFprimaII onboard UARTs. * diff --git a/drivers/tty/serial/sirfsoc_uart.h b/drivers/tty/serial/sirfsoc_uart.h index 43756bd..6d62515 100644 --- a/drivers/tty/serial/sirfsoc_uart.h +++ b/drivers/tty/serial/sirfsoc_uart.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Drivers for CSR SiRFprimaII onboard UARTs. * diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index e902494..a06d50f 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2012-2015 Spreadtrum Communications Inc. * diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index b313a79..1f51eef 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * st-asc.c: ST Asynchronous serial controller (ASC) driver * diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 46a1f86..566cd85 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) Maxime Coquelin 2015 * Copyright (C) STMicroelectronics SA 2017 diff --git a/drivers/tty/serial/stm32-usart.h b/drivers/tty/serial/stm32-usart.h index ffc0c52..174be61 100644 --- a/drivers/tty/serial/stm32-usart.h +++ b/drivers/tty/serial/stm32-usart.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) Maxime Coquelin 2015 * Copyright (C) STMicroelectronics SA 2017 diff --git a/drivers/tty/serial/suncore.c b/drivers/tty/serial/suncore.c index 127472b..70a4ea4 100644 --- a/drivers/tty/serial/suncore.c +++ b/drivers/tty/serial/suncore.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* suncore.c * * Common SUN serial routines. Based entirely diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c index 46e4689..63e34d8 100644 --- a/drivers/tty/serial/sunhv.c +++ b/drivers/tty/serial/sunhv.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* sunhv.c: Serial driver for SUN4V hypervisor console. * * Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net) diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c index 653a076..b93d022 100644 --- a/drivers/tty/serial/sunsab.c +++ b/drivers/tty/serial/sunsab.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* sunsab.c: ASYNC Driver for the SIEMENS SAB82532 DUSCC. * * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c index 95d34d7..6cf3e9b 100644 --- a/drivers/tty/serial/sunsu.c +++ b/drivers/tty/serial/sunsu.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * su.c: Small serial driver for keyboard/mouse interface on sparc32/PCI * diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c index 252cea4..bc7af8b 100644 --- a/drivers/tty/serial/sunzilog.c +++ b/drivers/tty/serial/sunzilog.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* sunzilog.c: Zilog serial driver for Sparc systems. * * Driver for Zilog serial chips found on Sun workstations and diff --git a/drivers/tty/serial/tilegx.c b/drivers/tty/serial/tilegx.c index 453215f..311eea3 100644 --- a/drivers/tty/serial/tilegx.c +++ b/drivers/tty/serial/tilegx.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright 2013 Tilera Corporation. All Rights Reserved. * diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c index 5da7fe4..cdbc23f 100644 --- a/drivers/tty/serial/timbuart.c +++ b/drivers/tty/serial/timbuart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * timbuart.c timberdale FPGA UART driver * Copyright (c) 2009 Intel Corporation diff --git a/drivers/tty/serial/timbuart.h b/drivers/tty/serial/timbuart.h index 7e56676..6c642e9 100644 --- a/drivers/tty/serial/timbuart.h +++ b/drivers/tty/serial/timbuart.h @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * timbuart.c timberdale FPGA GPIO driver * Copyright (c) 2009 Intel Corporation diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index 1de9942..b7d66e9 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * uartlite.c: Serial driver for Xilinx uartlite serial controller * diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index 55b7027..b017727 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Freescale QUICC Engine UART device driver * diff --git a/drivers/tty/serial/vr41xx_siu.c b/drivers/tty/serial/vr41xx_siu.c index 439057e..fc100ea 100644 --- a/drivers/tty/serial/vr41xx_siu.c +++ b/drivers/tty/serial/vr41xx_siu.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Driver for NEC VR4100 series Serial Interface Unit. * diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c index 435a6f3..334f0f4 100644 --- a/drivers/tty/serial/vt8500_serial.c +++ b/drivers/tty/serial/vt8500_serial.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2010 Alexey Charkov * diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 7c1c6fb9..028ae96 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Cadence UART driver (found in Xilinx Zynq) * diff --git a/drivers/tty/serial/zs.c b/drivers/tty/serial/zs.c index d32bd49..b03d3e4 100644 --- a/drivers/tty/serial/zs.c +++ b/drivers/tty/serial/zs.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * zs.c: Serial port driver for IOASIC DECstations. * diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c index 27db781..15189ac 100644 --- a/drivers/tty/synclink.c +++ b/drivers/tty/synclink.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-1.0+ /* * $Id: synclink.c,v 4.38 2005/11/07 16:30:34 paulkf Exp $ * diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index 636b8ae..da9f2e5 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-1.0+ /* * Device driver for Microgate SyncLink GT serial adapters. * diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c index 4fed9e7..4cc73be 100644 --- a/drivers/tty/synclinkmp.c +++ b/drivers/tty/synclinkmp.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-1.0+ /* * $Id: synclinkmp.c,v 4.38 2005/07/15 13:29:44 paulkf Exp $ * diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c index df2d735..30b92c4 100644 --- a/drivers/tty/tty_audit.c +++ b/drivers/tty/tty_audit.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Creating audit events from TTY input. * diff --git a/drivers/tty/tty_baudrate.c b/drivers/tty/tty_baudrate.c index 5c33fd2..6ff8cdf 100644 --- a/drivers/tty/tty_baudrate.c +++ b/drivers/tty/tty_baudrate.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds */ diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 677fa99..c996b68 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Tty buffer allocation management */ diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 94cccb6..dc60aee 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 1991, 1992 Linus Torvalds */ diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index efa96e6..d9b561d 100644 --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds * diff --git a/drivers/tty/tty_jobctrl.c b/drivers/tty/tty_jobctrl.c index e703230..c4ecd66f 100644 --- a/drivers/tty/tty_jobctrl.c +++ b/drivers/tty/tty_jobctrl.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 1991, 1992 Linus Torvalds */ diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index 2fe216b..73598f2 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include #include #include diff --git a/drivers/tty/tty_ldsem.c b/drivers/tty/tty_ldsem.c index 52b7bae..3b40340 100644 --- a/drivers/tty/tty_ldsem.c +++ b/drivers/tty/tty_ldsem.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Ldisc rw semaphore * diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c index 1286f24..25d7368 100644 --- a/drivers/tty/tty_port.c +++ b/drivers/tty/tty_port.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Tty port functions */ diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c index a5f88cf..722a669 100644 --- a/drivers/tty/vt/consolemap.c +++ b/drivers/tty/vt/consolemap.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * consolemap.c * diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index f416626..749e5a5 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Written for linux by Johan Myreen as a translation from * the assembly version by Linus (with diacriticals added) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index e504923..60f509d 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 1991, 1992 Linus Torvalds */ -- cgit v1.1 From 4793f2ebff1c890386a514998606205a2948011c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Nov 2017 18:11:52 +0100 Subject: tty: serial: Remove redundant license text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that the SPDX tag is in all tty files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Jiri Slaby Cc: Eric Anholt Cc: Stefan Wahren Cc: Florian Fainelli Cc: Ray Jui Cc: Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: Joachim Eastwood Cc: Matthias Brugger Cc: Masahiro Yamada Cc: Tobias Klauser Cc: Russell King Cc: Vineet Gupta Cc: Richard Genoud Cc: Alexander Shiyan Cc: Baruch Siach Cc: Pat Gefre Cc: "Guilherme G. Piccoli" Cc: Jason Wessel Cc: Vladimir Zapolskiy Cc: Sylvain Lemieux Cc: Carlo Caione Cc: Kevin Hilman Cc: Liviu Dudau Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: Andy Gross Cc: David Brown Cc: "Andreas Färber" Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Kevin Cernekee Cc: Laxman Dewangan Cc: Thierry Reding Cc: Jonathan Hunter Cc: Barry Song Cc: Patrice Chotard Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: Chris Metcalf Cc: Peter Korsgaard Cc: Timur Tabi Cc: Tony Prisk Cc: Michal Simek Cc: "Sören Brinkmann" Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250.h | 5 ----- drivers/tty/serial/8250/8250_accent.c | 4 ---- drivers/tty/serial/8250/8250_acorn.c | 4 ---- drivers/tty/serial/8250/8250_aspeed_vuart.c | 5 ----- drivers/tty/serial/8250/8250_bcm2835aux.c | 5 ----- drivers/tty/serial/8250/8250_boca.c | 4 ---- drivers/tty/serial/8250/8250_core.c | 5 ----- drivers/tty/serial/8250/8250_dma.c | 5 ----- drivers/tty/serial/8250/8250_dw.c | 5 ----- drivers/tty/serial/8250/8250_early.c | 4 ---- drivers/tty/serial/8250/8250_em.c | 13 ------------- drivers/tty/serial/8250/8250_exar.c | 4 ---- drivers/tty/serial/8250/8250_exar_st16c554.c | 4 ---- drivers/tty/serial/8250/8250_fintek.c | 5 ----- drivers/tty/serial/8250/8250_fourport.c | 4 ---- drivers/tty/serial/8250/8250_fsl.c | 4 ---- drivers/tty/serial/8250/8250_gsc.c | 5 ----- drivers/tty/serial/8250/8250_hub6.c | 4 ---- drivers/tty/serial/8250/8250_ingenic.c | 9 --------- drivers/tty/serial/8250/8250_lpc18xx.c | 5 ----- drivers/tty/serial/8250/8250_lpss.c | 4 ---- drivers/tty/serial/8250/8250_mid.c | 4 ---- drivers/tty/serial/8250/8250_moxa.c | 4 ---- drivers/tty/serial/8250/8250_mtk.c | 10 ---------- drivers/tty/serial/8250/8250_of.c | 6 ------ drivers/tty/serial/8250/8250_pci.c | 4 ---- drivers/tty/serial/8250/8250_pnp.c | 4 ---- drivers/tty/serial/8250/8250_port.c | 5 ----- drivers/tty/serial/8250/8250_pxa.c | 6 ------ drivers/tty/serial/8250/8250_uniphier.c | 10 ---------- drivers/tty/serial/altera_jtaguart.c | 5 ----- drivers/tty/serial/altera_uart.c | 5 ----- drivers/tty/serial/amba-pl010.c | 14 -------------- drivers/tty/serial/amba-pl011.c | 14 -------------- drivers/tty/serial/ar933x_uart.c | 4 ---- drivers/tty/serial/arc_uart.c | 4 ---- drivers/tty/serial/atmel_serial.c | 15 --------------- drivers/tty/serial/atmel_serial.h | 5 ----- drivers/tty/serial/bcm63xx_uart.c | 4 ---- drivers/tty/serial/bfin_sport_uart.c | 2 -- drivers/tty/serial/bfin_sport_uart.h | 2 -- drivers/tty/serial/bfin_uart.c | 2 -- drivers/tty/serial/clps711x.c | 5 ----- drivers/tty/serial/cpm_uart/cpm_uart.h | 5 ----- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 15 --------------- drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c | 15 --------------- drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c | 15 --------------- drivers/tty/serial/digicolor-usart.c | 5 ----- drivers/tty/serial/earlycon-arm-semihost.c | 12 ------------ drivers/tty/serial/earlycon.c | 4 ---- drivers/tty/serial/fsl_lpuart.c | 5 ----- drivers/tty/serial/icom.c | 15 --------------- drivers/tty/serial/icom.h | 14 -------------- drivers/tty/serial/ifx6x60.c | 14 -------------- drivers/tty/serial/ifx6x60.h | 17 ----------------- drivers/tty/serial/imx.c | 10 ---------- drivers/tty/serial/ioc3_serial.c | 4 ---- drivers/tty/serial/ioc4_serial.c | 4 ---- drivers/tty/serial/jsm/jsm.h | 10 ---------- drivers/tty/serial/jsm/jsm_cls.c | 10 ---------- drivers/tty/serial/jsm/jsm_driver.c | 10 ---------- drivers/tty/serial/jsm/jsm_neo.c | 10 ---------- drivers/tty/serial/jsm/jsm_tty.c | 10 ---------- drivers/tty/serial/kgdb_nmi.c | 4 ---- drivers/tty/serial/kgdboc.c | 4 ---- drivers/tty/serial/lantiq.c | 13 ------------- drivers/tty/serial/lpc32xx_hs.c | 10 ---------- drivers/tty/serial/m32r_sio.c | 5 ----- drivers/tty/serial/m32r_sio_reg.h | 3 --- drivers/tty/serial/max3100.c | 6 ------ drivers/tty/serial/max310x.c | 5 ----- drivers/tty/serial/mcf.c | 5 ----- drivers/tty/serial/men_z135_uart.c | 4 ---- drivers/tty/serial/meson_uart.c | 10 ---------- drivers/tty/serial/mpc52xx_uart.c | 4 ---- drivers/tty/serial/mps2-uart.c | 4 ---- drivers/tty/serial/mpsc.c | 5 +---- drivers/tty/serial/msm_serial.c | 9 --------- drivers/tty/serial/mux.c | 5 ----- drivers/tty/serial/mvebu-uart.c | 12 ------------ drivers/tty/serial/mxs-auart.c | 4 ---- drivers/tty/serial/netx-serial.c | 13 ------------- drivers/tty/serial/omap-serial.c | 5 ----- drivers/tty/serial/owl-uart.c | 13 ------------- drivers/tty/serial/pch_uart.c | 13 ------------- drivers/tty/serial/pic32_uart.c | 2 -- drivers/tty/serial/pic32_uart.h | 2 -- drivers/tty/serial/pmac_zilog.c | 14 -------------- drivers/tty/serial/pnx8xxx_uart.c | 5 ----- drivers/tty/serial/pxa.c | 5 ----- drivers/tty/serial/rp2.c | 4 ---- drivers/tty/serial/sa1100.c | 14 -------------- drivers/tty/serial/samsung.c | 4 ---- drivers/tty/serial/samsung.h | 4 ---- drivers/tty/serial/sb1250-duart.c | 5 ----- drivers/tty/serial/sc16is7xx.c | 6 ------ drivers/tty/serial/sccnxp.c | 5 ----- drivers/tty/serial/serial-tegra.c | 12 ------------ drivers/tty/serial/serial_core.c | 14 -------------- drivers/tty/serial/serial_ks8695.c | 6 ------ drivers/tty/serial/serial_mctrl_gpio.c | 10 ---------- drivers/tty/serial/serial_mctrl_gpio.h | 11 ----------- drivers/tty/serial/serial_txx9.c | 4 ---- drivers/tty/serial/sh-sci.c | 4 ---- drivers/tty/serial/sirfsoc_uart.c | 2 -- drivers/tty/serial/sirfsoc_uart.h | 2 -- drivers/tty/serial/sn_console.c | 19 ------------------- drivers/tty/serial/sprd_serial.c | 9 --------- drivers/tty/serial/st-asc.c | 6 ------ drivers/tty/serial/stm32-usart.c | 1 - drivers/tty/serial/stm32-usart.h | 1 - drivers/tty/serial/tilegx.c | 10 ---------- drivers/tty/serial/timbuart.c | 13 ------------- drivers/tty/serial/timbuart.h | 13 ------------- drivers/tty/serial/uartlite.c | 4 ---- drivers/tty/serial/ucc_uart.c | 5 +---- drivers/tty/serial/vr41xx_siu.c | 14 -------------- drivers/tty/serial/vt8500_serial.c | 9 --------- drivers/tty/serial/xilinx_uartps.c | 6 ------ 119 files changed, 2 insertions(+), 844 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index 36e9ae1..ebfb0bd 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -5,11 +5,6 @@ * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. * * Copyright (C) 2001 Russell King. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #include diff --git a/drivers/tty/serial/8250/8250_accent.c b/drivers/tty/serial/8250/8250_accent.c index 2c11bc1..1691f1a 100644 --- a/drivers/tty/serial/8250/8250_accent.c +++ b/drivers/tty/serial/8250/8250_accent.c @@ -2,10 +2,6 @@ /* * Copyright (C) 2005 Russell King. * Data taken from include/asm-i386/serial.h - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include #include diff --git a/drivers/tty/serial/8250/8250_acorn.c b/drivers/tty/serial/8250/8250_acorn.c index 5395343..758c4aa 100644 --- a/drivers/tty/serial/8250/8250_acorn.c +++ b/drivers/tty/serial/8250/8250_acorn.c @@ -3,10 +3,6 @@ * linux/drivers/serial/acorn.c * * Copyright (C) 1996-2003 Russell King. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include #include diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c index c468bcc..74a408d 100644 --- a/drivers/tty/serial/8250/8250_aspeed_vuart.c +++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c @@ -4,11 +4,6 @@ * * Copyright (C) 2016 Jeremy Kerr , IBM Corp. * Copyright (C) 2006 Arnd Bergmann , IBM Corp. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. */ #include #include diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c index 242ec18..bd53661 100644 --- a/drivers/tty/serial/8250/8250_bcm2835aux.c +++ b/drivers/tty/serial/8250/8250_bcm2835aux.c @@ -6,11 +6,6 @@ * * Based on 8250_lpc18xx.c: * Copyright (C) 2015 Joachim Eastwood - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * */ #include diff --git a/drivers/tty/serial/8250/8250_boca.c b/drivers/tty/serial/8250/8250_boca.c index 4123eb8..a9b97c0 100644 --- a/drivers/tty/serial/8250/8250_boca.c +++ b/drivers/tty/serial/8250/8250_boca.c @@ -2,10 +2,6 @@ /* * Copyright (C) 2005 Russell King. * Data taken from include/asm-i386/serial.h - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include #include diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 08db331..d64afdd 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -12,11 +12,6 @@ * userspace-configurable "phantom" ports * "serial8250" platform devices * serial8250_register_8250_port() ports - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #include diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c index fe92593..bfa1a85 100644 --- a/drivers/tty/serial/8250/8250_dma.c +++ b/drivers/tty/serial/8250/8250_dma.c @@ -3,11 +3,6 @@ * 8250_dma.c - DMA Engine API support for 8250.c * * Copyright (C) 2013 Intel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #include #include diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 3b4bc4d..5bb0c42 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -5,11 +5,6 @@ * Copyright 2011 Picochip, Jamie Iles. * Copyright 2013 Intel Corporation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * * The Synopsys DesignWare 8250 has an extra feature whereby it detects if the * LCR is written whilst busy. If it is, then a busy detect interrupt is * raised, the LCR needs to be rewritten and the uart status register read. diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c index 224f8c1..362c25f 100644 --- a/drivers/tty/serial/8250/8250_early.c +++ b/drivers/tty/serial/8250/8250_early.c @@ -5,10 +5,6 @@ * (c) Copyright 2004 Hewlett-Packard Development Company, L.P. * Bjorn Helgaas * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * * Based on the 8250.c serial driver, Copyright (C) 2001 Russell King, * and on early_printk.c by Andi Kleen. * diff --git a/drivers/tty/serial/8250/8250_em.c b/drivers/tty/serial/8250/8250_em.c index 36355b3..f6a86f2 100644 --- a/drivers/tty/serial/8250/8250_em.c +++ b/drivers/tty/serial/8250/8250_em.c @@ -3,19 +3,6 @@ * Renesas Emma Mobile 8250 driver * * Copyright (C) 2012 Magnus Damm - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 4d668e2..a402878 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -5,10 +5,6 @@ * Based on drivers/tty/serial/8250/8250_pci.c, * * Copyright (C) 2017 Sudip Mukherjee, All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License. */ #include #include diff --git a/drivers/tty/serial/8250/8250_exar_st16c554.c b/drivers/tty/serial/8250/8250_exar_st16c554.c index 0b1318b..933811e 100644 --- a/drivers/tty/serial/8250/8250_exar_st16c554.c +++ b/drivers/tty/serial/8250/8250_exar_st16c554.c @@ -5,10 +5,6 @@ * * Copyright (C) 2005 Russell King. * Data taken from include/asm-i386/serial.h - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include #include diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index 894763f..be7029f 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -3,11 +3,6 @@ * Probe for F81216A LPC to 4 UART * * Copyright (C) 2014-2016 Ricardo Ribalda, Qtechnology A/S - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License. */ #include #include diff --git a/drivers/tty/serial/8250/8250_fourport.c b/drivers/tty/serial/8250/8250_fourport.c index 1d8e936..3215b9b 100644 --- a/drivers/tty/serial/8250/8250_fourport.c +++ b/drivers/tty/serial/8250/8250_fourport.c @@ -2,10 +2,6 @@ /* * Copyright (C) 2005 Russell King. * Data taken from include/asm-i386/serial.h - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include #include diff --git a/drivers/tty/serial/8250/8250_fsl.c b/drivers/tty/serial/8250/8250_fsl.c index dafe7aa..6640a4c 100644 --- a/drivers/tty/serial/8250/8250_fsl.c +++ b/drivers/tty/serial/8250/8250_fsl.c @@ -7,10 +7,6 @@ /* * Freescale 16550 UART "driver", Copyright (C) 2011 Paul Gortmaker. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * * This isn't a full driver; it just provides an alternate IRQ * handler to deal with an errata. Everything else is just * using the bog standard 8250 support. diff --git a/drivers/tty/serial/8250/8250_gsc.c b/drivers/tty/serial/8250/8250_gsc.c index 8eea662..0809ae2 100644 --- a/drivers/tty/serial/8250/8250_gsc.c +++ b/drivers/tty/serial/8250/8250_gsc.c @@ -3,11 +3,6 @@ * Serial Device Initialisation for Lasi/Asp/Wax/Dino * * (c) Copyright Matthew Wilcox 2001-2002 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #include diff --git a/drivers/tty/serial/8250/8250_hub6.c b/drivers/tty/serial/8250/8250_hub6.c index f75c89e..273f59b 100644 --- a/drivers/tty/serial/8250/8250_hub6.c +++ b/drivers/tty/serial/8250/8250_hub6.c @@ -2,10 +2,6 @@ /* * Copyright (C) 2005 Russell King. * Data taken from include/asm-i386/serial.h - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include #include diff --git a/drivers/tty/serial/8250/8250_ingenic.c b/drivers/tty/serial/8250/8250_ingenic.c index 5c993a3..6af8490 100644 --- a/drivers/tty/serial/8250/8250_ingenic.c +++ b/drivers/tty/serial/8250/8250_ingenic.c @@ -4,15 +4,6 @@ * Copyright (C) 2015 Imagination Technologies * * Ingenic SoC UART support - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. */ #include diff --git a/drivers/tty/serial/8250/8250_lpc18xx.c b/drivers/tty/serial/8250/8250_lpc18xx.c index e340115..eddf119 100644 --- a/drivers/tty/serial/8250/8250_lpc18xx.c +++ b/drivers/tty/serial/8250/8250_lpc18xx.c @@ -7,11 +7,6 @@ * Based on 8250_mtk.c: * Copyright (c) 2014 MundoReader S.L. * Matthias Brugger - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * */ #include diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c index f4b596d..98dbc79 100644 --- a/drivers/tty/serial/8250/8250_lpss.c +++ b/drivers/tty/serial/8250/8250_lpss.c @@ -4,10 +4,6 @@ * * Copyright (C) 2016 Intel Corporation * Author: Andy Shevchenko - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include diff --git a/drivers/tty/serial/8250/8250_mid.c b/drivers/tty/serial/8250/8250_mid.c index b6d326c..efa0515 100644 --- a/drivers/tty/serial/8250/8250_mid.c +++ b/drivers/tty/serial/8250/8250_mid.c @@ -4,10 +4,6 @@ * * Copyright (C) 2015 Intel Corporation * Author: Heikki Krogerus - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include diff --git a/drivers/tty/serial/8250/8250_moxa.c b/drivers/tty/serial/8250/8250_moxa.c index da18dd6..1ee4cd9 100644 --- a/drivers/tty/serial/8250/8250_moxa.c +++ b/drivers/tty/serial/8250/8250_moxa.c @@ -3,10 +3,6 @@ * 8250_moxa.c - MOXA Smartio/Industio MUE multiport serial driver. * * Author: Mathieu OTHACEHE - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c index 34e0f5f..dd5e1ce 100644 --- a/drivers/tty/serial/8250/8250_mtk.c +++ b/drivers/tty/serial/8250/8250_mtk.c @@ -4,16 +4,6 @@ * * Copyright (c) 2014 MundoReader S.L. * Author: Matthias Brugger - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #include #include diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c index 851e5eb..1e67a7e 100644 --- a/drivers/tty/serial/8250/8250_of.c +++ b/drivers/tty/serial/8250/8250_of.c @@ -3,12 +3,6 @@ * Serial Port driver for Open Firmware platform devices * * Copyright (C) 2006 Arnd Bergmann , IBM Corp. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * */ #include #include diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index c8d6a11..b7e0e34 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -5,10 +5,6 @@ * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. * * Copyright (C) 2001 Russell King, All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License. */ #undef DEBUG #include diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c index b556f37..431e69a 100644 --- a/drivers/tty/serial/8250/8250_pnp.c +++ b/drivers/tty/serial/8250/8250_pnp.c @@ -7,10 +7,6 @@ * Copyright (C) 2001 Russell King, All Rights Reserved. * * Ported to the Linux PnP Layer - (C) Adam Belay. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License. */ #include #include diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 745eda6..1143455 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -5,11 +5,6 @@ * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. * Split from 8250_core.c, Copyright (C) 2001 Russell King. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * * A note about mapbase / membase * * mapbase is the physical address of the IO port. diff --git a/drivers/tty/serial/8250/8250_pxa.c b/drivers/tty/serial/8250/8250_pxa.c index 5ca660c..b9bcbe2 100644 --- a/drivers/tty/serial/8250/8250_pxa.c +++ b/drivers/tty/serial/8250/8250_pxa.c @@ -8,12 +8,6 @@ * Copyright: (C) 2003 Monta Vista Software, Inc. * * Based on drivers/serial/8250.c by Russell King. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * */ #include diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c index b4114f5..45ef506 100644 --- a/drivers/tty/serial/8250/8250_uniphier.c +++ b/drivers/tty/serial/8250/8250_uniphier.c @@ -1,16 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2015 Masahiro Yamada - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #include diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c index ef444af..c90e503 100644 --- a/drivers/tty/serial/altera_jtaguart.c +++ b/drivers/tty/serial/altera_jtaguart.c @@ -7,11 +7,6 @@ * (C) Copyright 2003-2007, Greg Ungerer * (C) Copyright 2008, Thomas Chou * (C) Copyright 2010, Tobias Klauser - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #include diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c index f1efcfc..b88b05f 100644 --- a/drivers/tty/serial/altera_uart.c +++ b/drivers/tty/serial/altera_uart.c @@ -7,11 +7,6 @@ * (C) Copyright 2003-2007, Greg Ungerer * (C) Copyright 2008, Thomas Chou * (C) Copyright 2010, Tobias Klauser - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #include diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c index a64a20c..2c37d11 100644 --- a/drivers/tty/serial/amba-pl010.c +++ b/drivers/tty/serial/amba-pl010.c @@ -7,20 +7,6 @@ * Copyright 1999 ARM Limited * Copyright (C) 2000 Deep Blue Solutions Ltd. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * * This is a generic driver for ARM AMBA-type serial ports. They * have a lot of 16550-like features, but are not register compatible. * Note that although they do have CTS, DCD and DSR inputs, they do diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index dac3a11..04af8de 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -8,20 +8,6 @@ * Copyright (C) 2000 Deep Blue Solutions Ltd. * Copyright (C) 2010 ST-Ericsson SA * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * * This is a generic driver for ARM AMBA-type serial ports. They * have a lot of 16550-like features, but are not register compatible. * Note that although they do have CTS, DCD and DSR inputs, they do diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c index 15cd1a3..db5df3d 100644 --- a/drivers/tty/serial/ar933x_uart.c +++ b/drivers/tty/serial/ar933x_uart.c @@ -5,10 +5,6 @@ * Copyright (C) 2011 Gabor Juhos * * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. */ #include diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c index 54d979b..2599f9e 100644 --- a/drivers/tty/serial/arc_uart.c +++ b/drivers/tty/serial/arc_uart.c @@ -4,10 +4,6 @@ * * Copyright (C) 2010-2012 Synopsys, Inc. (www.synopsys.com) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * * vineetg: July 10th 2012 * -Decoupled the driver from arch/arc * +Using platform_get_resource() for irq/membase (thx to bfin_uart.c) diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index a4baa0f..efa2561 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -7,21 +7,6 @@ * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. * * DMA support added by Chip Coldwell. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #include #include diff --git a/drivers/tty/serial/atmel_serial.h b/drivers/tty/serial/atmel_serial.h index b4e0e57..ba3a243 100644 --- a/drivers/tty/serial/atmel_serial.h +++ b/drivers/tty/serial/atmel_serial.h @@ -7,11 +7,6 @@ * * USART registers. * Based on AT91RM9200 datasheet revision E. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #ifndef ATMEL_SERIAL_H diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c index 474652d..9d1b7bf 100644 --- a/drivers/tty/serial/bcm63xx_uart.c +++ b/drivers/tty/serial/bcm63xx_uart.c @@ -1,9 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 /* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * * Derived from many drivers using generic_serial interface. * * Copyright (C) 2008 Maxime Bizon diff --git a/drivers/tty/serial/bfin_sport_uart.c b/drivers/tty/serial/bfin_sport_uart.c index 3401d9d..4ccca5d 100644 --- a/drivers/tty/serial/bfin_sport_uart.c +++ b/drivers/tty/serial/bfin_sport_uart.c @@ -5,8 +5,6 @@ * Copyright 2006-2009 Analog Devices Inc. * * Enter bugs at http://blackfin.uclinux.org/ - * - * Licensed under the GPL-2 or later. */ /* diff --git a/drivers/tty/serial/bfin_sport_uart.h b/drivers/tty/serial/bfin_sport_uart.h index 6d9237b..4b12f45 100644 --- a/drivers/tty/serial/bfin_sport_uart.h +++ b/drivers/tty/serial/bfin_sport_uart.h @@ -5,8 +5,6 @@ * Copyright 2006-2008 Analog Devices Inc. * * Enter bugs at http://blackfin.uclinux.org/ - * - * Licensed under the GPL-2 or later. */ /* diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c index ca8e42e..4755fa6 100644 --- a/drivers/tty/serial/bfin_uart.c +++ b/drivers/tty/serial/bfin_uart.c @@ -5,8 +5,6 @@ * Copyright 2006-2011 Analog Devices Inc. * * Enter bugs at http://blackfin.uclinux.org/ - * - * Licensed under the GPL-2 or later. */ #if defined(CONFIG_SERIAL_BFIN_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index 64d58f2..98f193a 100644 --- a/drivers/tty/serial/clps711x.c +++ b/drivers/tty/serial/clps711x.c @@ -6,11 +6,6 @@ * * Copyright 1999 ARM Limited * Copyright (C) 2000 Deep Blue Solutions Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #if defined(CONFIG_SERIAL_CLPS711X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/cpm_uart/cpm_uart.h b/drivers/tty/serial/cpm_uart/cpm_uart.h index 79f1d11..9f175a9 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart.h +++ b/drivers/tty/serial/cpm_uart/cpm_uart.h @@ -6,11 +6,6 @@ * * 2006 (c) MontaVista Software, Inc. * Vitaly Bordug - * - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of any - * kind, whether express or implied. - * */ #ifndef CPM_UART_H #define CPM_UART_H diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_core.c b/drivers/tty/serial/cpm_uart/cpm_uart_core.c index a98d3ab..24a5f05 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c @@ -13,21 +13,6 @@ * (C) 2004 Intracom, S.A. * (C) 2005-2006 MontaVista Software, Inc. * Vitaly Bordug - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #include diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c index 31e952f..4eba17f 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_cpm1.c @@ -9,21 +9,6 @@ * (C) 2004 Intracom, S.A. * (C) 2006 MontaVista Software, Inc. * Vitaly Bordug - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #include diff --git a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c index 84f7c8d..e3bff06 100644 --- a/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c @@ -9,21 +9,6 @@ * (C) 2004 Intracom, S.A. * (C) 2006 MontaVista Software, Inc. * Vitaly Bordug - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #include diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c index c38a163..f460cca 100644 --- a/drivers/tty/serial/digicolor-usart.c +++ b/drivers/tty/serial/digicolor-usart.c @@ -5,11 +5,6 @@ * Author: Baruch Siach * * Copyright (C) 2014 Paradox Innovation Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #include diff --git a/drivers/tty/serial/earlycon-arm-semihost.c b/drivers/tty/serial/earlycon-arm-semihost.c index 84780c1..fa096c1 100644 --- a/drivers/tty/serial/earlycon-arm-semihost.c +++ b/drivers/tty/serial/earlycon-arm-semihost.c @@ -6,18 +6,6 @@ * Adapted for ARM and earlycon: * Copyright (C) 2014 Linaro Ltd. * Author: Rob Herring - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #include #include diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index 00d24fd..4c8b80f 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -6,10 +6,6 @@ * Based on 8250 earlycon: * (c) Copyright 2004 Hewlett-Packard Development Company, L.P. * Bjorn Helgaas - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 6652af2..c84e6f0 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -3,11 +3,6 @@ * Freescale lpuart serial port driver * * Copyright 2012-2014 Freescale Semiconductor, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #if defined(CONFIG_SERIAL_FSL_LPUART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c index a8fd690..ad374f7 100644 --- a/drivers/tty/serial/icom.c +++ b/drivers/tty/serial/icom.c @@ -7,21 +7,6 @@ * Serial device driver. * * Based on code from serial.c - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #include #include diff --git a/drivers/tty/serial/icom.h b/drivers/tty/serial/icom.h index da6a389..8a77e73 100644 --- a/drivers/tty/serial/icom.h +++ b/drivers/tty/serial/icom.h @@ -5,20 +5,6 @@ * Copyright (C) 2001 Michael Anderson, IBM Corporation * * Serial device driver include file. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c index 7075184..473f4f8 100644 --- a/drivers/tty/serial/ifx6x60.c +++ b/drivers/tty/serial/ifx6x60.c @@ -11,20 +11,6 @@ * Copyright (C) 2009, 2010 Intel Corp * Russ Gorby * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA - * * Driver modified by Intel from Option gtm501l_spi.c * * Notes diff --git a/drivers/tty/serial/ifx6x60.h b/drivers/tty/serial/ifx6x60.h index a5346e7..c5a2514 100644 --- a/drivers/tty/serial/ifx6x60.h +++ b/drivers/tty/serial/ifx6x60.h @@ -6,23 +6,6 @@ * Copyright (C) 2009, 2010 Intel Corp * Jim Stanley * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA - * - * - * *****************************************************************************/ #ifndef _IFX6X60_H #define _IFX6X60_H diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 9d3a19b..a67a606 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -6,16 +6,6 @@ * * Author: Sascha Hauer * Copyright (C) 2004 Pengutronix - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #if defined(CONFIG_SERIAL_IMX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/ioc3_serial.c b/drivers/tty/serial/ioc3_serial.c index fcc4bc8..d8a1cdd 100644 --- a/drivers/tty/serial/ioc3_serial.c +++ b/drivers/tty/serial/ioc3_serial.c @@ -1,9 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 /* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved. */ diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c index 8804faa..db5b979 100644 --- a/drivers/tty/serial/ioc4_serial.c +++ b/drivers/tty/serial/ioc4_serial.c @@ -1,9 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 /* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * * Copyright (C) 2003-2006 Silicon Graphics, Inc. All Rights Reserved. */ diff --git a/drivers/tty/serial/jsm/jsm.h b/drivers/tty/serial/jsm/jsm.h index 588080b..7a128aa 100644 --- a/drivers/tty/serial/jsm/jsm.h +++ b/drivers/tty/serial/jsm/jsm.h @@ -4,16 +4,6 @@ * * Copyright (C) 2004 IBM Corporation. All rights reserved. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * * Contact Information: * Scott H Kilau * Wendy Xiong diff --git a/drivers/tty/serial/jsm/jsm_cls.c b/drivers/tty/serial/jsm/jsm_cls.c index 7479323..c061a7b 100644 --- a/drivers/tty/serial/jsm/jsm_cls.c +++ b/drivers/tty/serial/jsm/jsm_cls.c @@ -3,16 +3,6 @@ * Copyright 2003 Digi International (www.digi.com) * Scott H Kilau * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * * NOTE TO LINUX KERNEL HACKERS: DO NOT REFORMAT THIS CODE! * * This is shared code between Digi's CVS archive and the diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c index 0ede867..592e51d 100644 --- a/drivers/tty/serial/jsm/jsm_driver.c +++ b/drivers/tty/serial/jsm/jsm_driver.c @@ -4,16 +4,6 @@ * * Copyright (C) 2004 IBM Corporation. All rights reserved. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * * Contact Information: * Scott H Kilau * Wendy Xiong diff --git a/drivers/tty/serial/jsm/jsm_neo.c b/drivers/tty/serial/jsm/jsm_neo.c index b28a0a4..4718560 100644 --- a/drivers/tty/serial/jsm/jsm_neo.c +++ b/drivers/tty/serial/jsm/jsm_neo.c @@ -4,16 +4,6 @@ * * Copyright (C) 2004 IBM Corporation. All rights reserved. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * * Contact Information: * Scott H Kilau * Wendy Xiong diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c index 251e00e..469927d 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c @@ -4,16 +4,6 @@ * * Copyright (C) 2004 IBM Corporation. All rights reserved. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * * Contact Information: * Scott H Kilau * Ananda Venkatarman diff --git a/drivers/tty/serial/kgdb_nmi.c b/drivers/tty/serial/kgdb_nmi.c index b908d4a..ed2b030 100644 --- a/drivers/tty/serial/kgdb_nmi.c +++ b/drivers/tty/serial/kgdb_nmi.c @@ -7,10 +7,6 @@ * Colin Cross * Copyright 2012 Linaro Ltd. * Anton Vorontsov - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. */ #include diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c index 62d162a..ddb46fa 100644 --- a/drivers/tty/serial/kgdboc.c +++ b/drivers/tty/serial/kgdboc.c @@ -7,10 +7,6 @@ * Maintainer: Jason Wessel * * 2007-2008 (c) Jason Wessel - Wind River Systems, Inc. - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. */ #include #include diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c index 868abff..0441282 100644 --- a/drivers/tty/serial/lantiq.c +++ b/drivers/tty/serial/lantiq.c @@ -2,19 +2,6 @@ /* * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * * Copyright (C) 2004 Infineon IFAP DC COM CPE * Copyright (C) 2007 Felix Fietkau * Copyright (C) 2007 John Crispin diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c index 8b58256..d1d7326 100644 --- a/drivers/tty/serial/lpc32xx_hs.c +++ b/drivers/tty/serial/lpc32xx_hs.c @@ -7,16 +7,6 @@ * * Copyright (C) 2010 NXP Semiconductors * Copyright (C) 2012 Roland Stigge - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #include diff --git a/drivers/tty/serial/m32r_sio.c b/drivers/tty/serial/m32r_sio.c index 62fdeab..7b83a8a 100644 --- a/drivers/tty/serial/m32r_sio.c +++ b/drivers/tty/serial/m32r_sio.c @@ -9,11 +9,6 @@ * * Copyright (C) 2001 Russell King. * Copyright (C) 2004 Hirokazu Takata - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ /* diff --git a/drivers/tty/serial/m32r_sio_reg.h b/drivers/tty/serial/m32r_sio_reg.h index 0fd9727..6eed488 100644 --- a/drivers/tty/serial/m32r_sio_reg.h +++ b/drivers/tty/serial/m32r_sio_reg.h @@ -5,9 +5,6 @@ * Copyright (C) 1992, 1994 by Theodore Ts'o. * Copyright (C) 2004 Hirokazu Takata * - * Redistribution of this file is permitted under the terms of the GNU - * Public License (GPL) - * * These are the UART port assignments, expressed as offsets from the base * register. These assignments should hold for any serial port based on * a 8250, 16450, or 16550(A). diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index ac88fc9..27d6049 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -3,12 +3,6 @@ * * Copyright (C) 2008 Christian Pellegrin * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * * Notes: the MAX3100 doesn't provide an interrupt on CTS so we have * to use polling for flow control. TX empty IRQ is unusable, since * writing conf clears FIFO buffer and we cannot have this interrupt diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index bd626ec..ecb6513 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -7,11 +7,6 @@ * Based on max3100.c, by Christian Pellegrin * Based on max3110.c, by Feng Tang * Based on max3107.c, by Aavamobile - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #include diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c index 9c77976..7dbfb4c 100644 --- a/drivers/tty/serial/mcf.c +++ b/drivers/tty/serial/mcf.c @@ -5,11 +5,6 @@ * mcf.c -- Freescale ColdFire UART driver * * (C) Copyright 2003-2007, Greg Ungerer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ /****************************************************************************/ diff --git a/drivers/tty/serial/men_z135_uart.c b/drivers/tty/serial/men_z135_uart.c index 9387b2c..ef89534 100644 --- a/drivers/tty/serial/men_z135_uart.c +++ b/drivers/tty/serial/men_z135_uart.c @@ -4,10 +4,6 @@ * * Copyright (C) 2014 MEN Mikroelektronik GmbH (www.men.de) * Author: Johannes Thumshirn - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; version 2 of the License. */ #define pr_fmt(fmt) KBUILD_MODNAME ":" fmt diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index fe2d12d..7bdd82df 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -3,16 +3,6 @@ * Based on meson_uart.c, by AMLOGIC, INC. * * Copyright (C) 2014 Carlo Caione - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ #if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c index 1c1febd..3a75ee0 100644 --- a/drivers/tty/serial/mpc52xx_uart.c +++ b/drivers/tty/serial/mpc52xx_uart.c @@ -24,10 +24,6 @@ * Grant Likely * Copyright (C) 2004-2006 Sylvain Munaut * Copyright (C) 2003 MontaVista, Software, Inc. - * - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of any - * kind, whether express or implied. */ #undef DEBUG diff --git a/drivers/tty/serial/mps2-uart.c b/drivers/tty/serial/mps2-uart.c index 5d789b5..9f8f637 100644 --- a/drivers/tty/serial/mps2-uart.c +++ b/drivers/tty/serial/mps2-uart.c @@ -6,10 +6,6 @@ * * Author: Vladimir Murzin * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * * TODO: support for SysRq */ diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c index 21b28d8..1f60d6f 100644 --- a/drivers/tty/serial/mpsc.c +++ b/drivers/tty/serial/mpsc.c @@ -11,10 +11,7 @@ * taken from PPCBoot (now U-Boot). Also based on drivers/serial/8250.c * by Russell King. * - * 2004 (c) MontaVista, Software, Inc. This file is licensed under - * the terms of the GNU General Public License version 2. This program - * is licensed "as is" without any warranty of any kind, whether express - * or implied. + * 2004 (c) MontaVista, Software, Inc. */ /* * The MPSC interface is much like a typical network controller's interface. diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c index 76649fe..ee96cf0 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -5,15 +5,6 @@ * Copyright (C) 2007 Google, Inc. * Author: Robert Love * Copyright (c) 2011, Code Aurora Forum. All rights reserved. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #if defined(CONFIG_SERIAL_MSM_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/mux.c b/drivers/tty/serial/mux.c index 14a2996..3b74369 100644 --- a/drivers/tty/serial/mux.c +++ b/drivers/tty/serial/mux.c @@ -6,11 +6,6 @@ ** (c) Copyright 2002 Ryan Bradetich ** (c) Copyright 2002 Hewlett-Packard Company ** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** ** This Driver currently only supports the console (port 0) on the MUX. ** Additional work will be needed on this driver to enable the full ** functionality of the MUX. diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c index 79926a4..a100e98 100644 --- a/drivers/tty/serial/mvebu-uart.c +++ b/drivers/tty/serial/mvebu-uart.c @@ -5,18 +5,6 @@ * Author: Wilson Ding * Copyright (C) 2015 Marvell International Ltd. * *************************************************************************** -* This program is free software: you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the Free -* Software Foundation, either version 2 of the License, or any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* *************************************************************************** */ #include diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index 2b2b082..efb4fd3 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -10,10 +10,6 @@ * Provide Alphascale ASM9260 support. * Copyright 2008-2010 Freescale Semiconductor, Inc. * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. - * - * The code contained herein is licensed under the GNU General Public - * License. You may obtain a copy of the GNU General Public License - * Version 2 or later at the following locations: */ #if defined(CONFIG_SERIAL_MXS_AUART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/netx-serial.c b/drivers/tty/serial/netx-serial.c index 4201938..b355686 100644 --- a/drivers/tty/serial/netx-serial.c +++ b/drivers/tty/serial/netx-serial.c @@ -1,19 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2005 Sascha Hauer , Pengutronix - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if defined(CONFIG_SERIAL_NETX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index b3bba7a..53d59e9 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -9,11 +9,6 @@ * Govindraj R * Thara Gopinath * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * * Note: This driver is made separate from 8250 driver as we cannot * over load 8250 driver with omap platform specific configuration for * features like DMA, it makes easier to implement features like DMA and diff --git a/drivers/tty/serial/owl-uart.c b/drivers/tty/serial/owl-uart.c index 93fa309..29a6dc6 100644 --- a/drivers/tty/serial/owl-uart.c +++ b/drivers/tty/serial/owl-uart.c @@ -6,19 +6,6 @@ * Author: Actions Semi, Inc. * * Copyright (c) 2016-2017 Andreas Färber - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #include diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index e2c04a3..760d5dd 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c @@ -1,19 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* *Copyright (C) 2011 LAPIS Semiconductor Co., Ltd. - * - *This program is free software; you can redistribute it and/or modify - *it under the terms of the GNU General Public License as published by - *the Free Software Foundation; version 2 of the License. - * - *This program is distributed in the hope that it will be useful, - *but WITHOUT ANY WARRANTY; without even the implied warranty of - *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - *GNU General Public License for more details. - * - *You should have received a copy of the GNU General Public License - *along with this program; if not, write to the Free Software - *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. */ #if defined(CONFIG_SERIAL_PCH_UART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c index 9f55c30..fd80d99 100644 --- a/drivers/tty/serial/pic32_uart.c +++ b/drivers/tty/serial/pic32_uart.c @@ -6,8 +6,6 @@ * * Authors: * Sorin-Andrei Pistirica - * - * Licensed under GPLv2 or later. */ #include diff --git a/drivers/tty/serial/pic32_uart.h b/drivers/tty/serial/pic32_uart.h index 43dc168..2f2b569 100644 --- a/drivers/tty/serial/pic32_uart.h +++ b/drivers/tty/serial/pic32_uart.h @@ -6,8 +6,6 @@ * * Authors: * Sorin-Andrei Pistirica - * - * Licensed under GPLv2 or later. */ #ifndef __DT_PIC32_UART_H__ #define __DT_PIC32_UART_H__ diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index 3afba70..3d21790 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c @@ -14,20 +14,6 @@ * and once done, I expect that driver to remain fairly stable in * the long term, unless we change the driver model again... * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * * 2004-08-06 Harald Welte * - Enable BREAK interrupt * - Add support for sysreq diff --git a/drivers/tty/serial/pnx8xxx_uart.c b/drivers/tty/serial/pnx8xxx_uart.c index a014de6..f881238 100644 --- a/drivers/tty/serial/pnx8xxx_uart.c +++ b/drivers/tty/serial/pnx8xxx_uart.c @@ -8,11 +8,6 @@ * * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. * Copyright (C) 2000 Deep Blue Solutions Ltd. - * - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of - * any kind, whether express or implied. - * */ #if defined(CONFIG_SERIAL_PNX8XXX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c index dd82ecb..baf5529 100644 --- a/drivers/tty/serial/pxa.c +++ b/drivers/tty/serial/pxa.c @@ -6,11 +6,6 @@ * Created: Feb 20, 2003 * Copyright: (C) 2003 Monta Vista Software, Inc. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * * Note 1: This driver is made separate from the already too overloaded * 8250.c because it needs some kirks of its own and that'll make it * easier to add DMA support. diff --git a/drivers/tty/serial/rp2.c b/drivers/tty/serial/rp2.c index 2108bf3..520b43b 100644 --- a/drivers/tty/serial/rp2.c +++ b/drivers/tty/serial/rp2.c @@ -11,10 +11,6 @@ * * rocketport_infinity_express-linux-1.20.tar.gz * Copyright (C) 2004-2011 Comtrol, Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 as published - * by the Free Software Foundation. */ #include diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c index abb64ab..4e3f169 100644 --- a/drivers/tty/serial/sa1100.c +++ b/drivers/tty/serial/sa1100.c @@ -5,20 +5,6 @@ * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o. * * Copyright (C) 2000 Deep Blue Solutions Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if defined(CONFIG_SERIAL_SA1100_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 3a2923c..f9fecc5 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -4,10 +4,6 @@ * * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics * http://armlinux.simtec.co.uk/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ /* Hote on 2410 error handling diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h index b0461c0..f930221 100644 --- a/drivers/tty/serial/samsung.h +++ b/drivers/tty/serial/samsung.h @@ -7,10 +7,6 @@ * * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics * http://armlinux.simtec.co.uk/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. */ #include diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c index f3d5b4e..329aced 100644 --- a/drivers/tty/serial/sb1250-duart.c +++ b/drivers/tty/serial/sb1250-duart.c @@ -10,11 +10,6 @@ * * Copyright (c) 2000, 2001, 2002, 2003, 2004 Broadcom Corporation * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * References: * * "BCM1250/BCM1125/BCM1125H User Manual", Broadcom Corporation diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index f1e216e..65792a3 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -4,12 +4,6 @@ * Author: Jon Ringle * * Based on max310x.c, by Alexander Shiyan - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c index a470dbf..d6ae308 100644 --- a/drivers/tty/serial/sccnxp.c +++ b/drivers/tty/serial/sccnxp.c @@ -5,11 +5,6 @@ * Copyright (C) 2012 Alexander Shiyan * * Based on sc26xx.c, by Thomas Bogendörfer (tsbogend@alpha.franken.de) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #if defined(CONFIG_SERIAL_SCCNXP_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c index fae65e7..af2a29c 100644 --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -7,18 +7,6 @@ * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved. * * Author: Laxman Dewangan - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ #include diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index ab17428..854995e 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -6,20 +6,6 @@ * * Copyright 1999 ARM Limited * Copyright (C) 2000-2001 Deep Blue Solutions Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include diff --git a/drivers/tty/serial/serial_ks8695.c b/drivers/tty/serial/serial_ks8695.c index 9a894e8..b461d79 100644 --- a/drivers/tty/serial/serial_ks8695.c +++ b/drivers/tty/serial/serial_ks8695.c @@ -5,12 +5,6 @@ * Based on drivers/serial/serial_amba.c, by Kam Lee. * * Copyright 2002-2005 Micrel Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * */ #include #include diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c index 302dda1..1c06325 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.c +++ b/drivers/tty/serial/serial_mctrl_gpio.c @@ -3,16 +3,6 @@ * Helpers for controlling modem lines via GPIO * * Copyright (C) 2014 Paratronic S.A. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #include diff --git a/drivers/tty/serial/serial_mctrl_gpio.h b/drivers/tty/serial/serial_mctrl_gpio.h index 219eba0..b7d3cca 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.h +++ b/drivers/tty/serial/serial_mctrl_gpio.h @@ -3,17 +3,6 @@ * Helpers for controlling modem lines via GPIO * * Copyright (C) 2014 Paratronic S.A. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ #ifndef __SERIAL_MCTRL_GPIO__ diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c index 256c61d..1b4008d 100644 --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c @@ -9,10 +9,6 @@ * Copyright (C) 2001 Steven J. Hill (sjhill@realitydiluted.com) * Copyright (C) 2000-2002 Toshiba Corporation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * * Serial driver for TX3927/TX4927/TX4925/TX4938 internal SIO controller */ diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index af94049..31fcc70 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -14,10 +14,6 @@ * Modified to support SecureEdge. David McCullough (2002) * Modified to support SH7300 SCIF. Takashi Kusuda (Jun 2003). * Removed SH7300 support (Jul 2007). - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. */ #if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c index 3e3ea07..9925b00 100644 --- a/drivers/tty/serial/sirfsoc_uart.c +++ b/drivers/tty/serial/sirfsoc_uart.c @@ -3,8 +3,6 @@ * Driver for CSR SiRFprimaII onboard UARTs. * * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. - * - * Licensed under GPLv2 or later. */ #include diff --git a/drivers/tty/serial/sirfsoc_uart.h b/drivers/tty/serial/sirfsoc_uart.h index 6d62515..004ca68 100644 --- a/drivers/tty/serial/sirfsoc_uart.h +++ b/drivers/tty/serial/sirfsoc_uart.h @@ -3,8 +3,6 @@ * Drivers for CSR SiRFprimaII onboard UARTs. * * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. - * - * Licensed under GPLv2 or later. */ #include #include diff --git a/drivers/tty/serial/sn_console.c b/drivers/tty/serial/sn_console.c index 81d506d2..ed78542 100644 --- a/drivers/tty/serial/sn_console.c +++ b/drivers/tty/serial/sn_console.c @@ -8,25 +8,6 @@ * * Copyright (c) 2004-2006 Silicon Graphics, Inc. All Rights Reserved. * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Further, this software is distributed without any warranty that it is - * free of the rightful claim of any third person regarding infringement - * or the like. Any license provided herein, whether implied or - * otherwise, applies only to this software file. Patent licenses, if - * any, provided herein do not apply to combinations of this program with - * other software, or any other product whatsoever. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. - * * Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, * Mountain View, CA 94043, or: * diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index a06d50f..828f114 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -1,15 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2012-2015 Spreadtrum Communications Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #if defined(CONFIG_SERIAL_SPRD_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index 1f51eef..c763253 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -3,12 +3,6 @@ * st-asc.c: ST Asynchronous serial controller (ASC) driver * * Copyright (C) 2003-2013 STMicroelectronics (R&D) Limited - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * */ #if defined(CONFIG_SERIAL_ST_ASC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 566cd85..0fa735b 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -4,7 +4,6 @@ * Copyright (C) STMicroelectronics SA 2017 * Authors: Maxime Coquelin * Gerald Baeza - * License terms: GNU General Public License (GPL), version 2 * * Inspired by st-asc.c from STMicroelectronics (c) */ diff --git a/drivers/tty/serial/stm32-usart.h b/drivers/tty/serial/stm32-usart.h index 174be61..8a5ff54 100644 --- a/drivers/tty/serial/stm32-usart.h +++ b/drivers/tty/serial/stm32-usart.h @@ -4,7 +4,6 @@ * Copyright (C) STMicroelectronics SA 2017 * Authors: Maxime Coquelin * Gerald Baeza - * License terms: GNU General Public License (GPL), version 2 */ #define DRIVER_NAME "stm32-usart" diff --git a/drivers/tty/serial/tilegx.c b/drivers/tty/serial/tilegx.c index 311eea3..f0a3ae5 100644 --- a/drivers/tty/serial/tilegx.c +++ b/drivers/tty/serial/tilegx.c @@ -2,16 +2,6 @@ /* * Copyright 2013 Tilera Corporation. All Rights Reserved. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or - * NON INFRINGEMENT. See the GNU General Public License for - * more details. - * * TILEGx UART driver. */ diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c index cdbc23f..19d38b5 100644 --- a/drivers/tty/serial/timbuart.c +++ b/drivers/tty/serial/timbuart.c @@ -2,19 +2,6 @@ /* * timbuart.c timberdale FPGA UART driver * Copyright (c) 2009 Intel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Supports: diff --git a/drivers/tty/serial/timbuart.h b/drivers/tty/serial/timbuart.h index 6c642e9..fb00b17 100644 --- a/drivers/tty/serial/timbuart.h +++ b/drivers/tty/serial/timbuart.h @@ -2,19 +2,6 @@ /* * timbuart.c timberdale FPGA GPIO driver * Copyright (c) 2009 Intel Corporation - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Supports: diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index b7d66e9..c47db78 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -4,10 +4,6 @@ * * Copyright (C) 2006 Peter Korsgaard * Copyright (C) 2007 Secret Lab Technologies Ltd. - * - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of any - * kind, whether express or implied. */ #include diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index b017727..2b6376e 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -4,10 +4,7 @@ * * Author: Timur Tabi * - * Copyright 2007 Freescale Semiconductor, Inc. This file is licensed under - * the terms of the GNU General Public License version 2. This program - * is licensed "as is" without any warranty of any kind, whether express - * or implied. + * Copyright 2007 Freescale Semiconductor, Inc. * * This driver adds support for UART devices via Freescale's QUICC Engine * found on some Freescale SOCs. diff --git a/drivers/tty/serial/vr41xx_siu.c b/drivers/tty/serial/vr41xx_siu.c index fc100ea..6d106e3 100644 --- a/drivers/tty/serial/vr41xx_siu.c +++ b/drivers/tty/serial/vr41xx_siu.c @@ -5,20 +5,6 @@ * Copyright (C) 2004-2008 Yoichi Yuasa * * Based on drivers/serial/8250.c, by Russell King. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if defined(CONFIG_SERIAL_VR41XX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c index 334f0f4..3d58e9b 100644 --- a/drivers/tty/serial/vt8500_serial.c +++ b/drivers/tty/serial/vt8500_serial.c @@ -5,15 +5,6 @@ * Based on msm_serial.c, which is: * Copyright (C) 2007 Google, Inc. * Author: Robert Love - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #if defined(CONFIG_SERIAL_VT8500_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 028ae96..b9b2bc7 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -4,12 +4,6 @@ * * 2011 - 2014 (C) Xilinx Inc. * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; - * either version 2 of the License, or (at your option) any - * later version. - * * This driver has originally been pushed by Xilinx using a Zynq-branding. This * still shows in the naming of this file, the kconfig symbols and some symbols * in the code. -- cgit v1.1 From a9f96f014f36cc872d6d235787963ba90e101448 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Nov 2017 18:11:53 +0100 Subject: tty: hvc: Remove redundant license text Now that the SPDX tag is in all tty files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Jiri Slaby Cc: Paul Mackerras Cc: Michael Ellerman Cc: Chris Metcalf Acked-by: Benjamin Herrenschmidt Signed-off-by: Greg Kroah-Hartman --- drivers/tty/hvc/hvc_bfin_jtag.c | 2 -- drivers/tty/hvc/hvc_console.c | 14 -------------- drivers/tty/hvc/hvc_console.h | 14 -------------- drivers/tty/hvc/hvc_dcc.c | 12 +----------- drivers/tty/hvc/hvc_opal.c | 15 --------------- drivers/tty/hvc/hvc_rtas.c | 14 -------------- drivers/tty/hvc/hvc_tile.c | 10 ---------- drivers/tty/hvc/hvc_udbg.c | 14 -------------- drivers/tty/hvc/hvc_vio.c | 14 -------------- drivers/tty/hvc/hvc_xen.c | 14 -------------- drivers/tty/hvc/hvcs.c | 14 -------------- drivers/tty/hvc/hvsi.c | 14 -------------- 12 files changed, 1 insertion(+), 150 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/hvc/hvc_bfin_jtag.c b/drivers/tty/hvc/hvc_bfin_jtag.c index 24ff4c4..dd7cae4 100644 --- a/drivers/tty/hvc/hvc_bfin_jtag.c +++ b/drivers/tty/hvc/hvc_bfin_jtag.c @@ -5,8 +5,6 @@ * Copyright 2008-2011 Analog Devices Inc. * * Enter bugs at http://blackfin.uclinux.org/ - * - * Licensed under the GPL-2 or later. */ #include diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index fed03a6..7709fcc 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c @@ -7,20 +7,6 @@ * * Additional Author(s): * Ryan S. Arnold - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include diff --git a/drivers/tty/hvc/hvc_console.h b/drivers/tty/hvc/hvc_console.h index 74c9a20..ea63090 100644 --- a/drivers/tty/hvc/hvc_console.h +++ b/drivers/tty/hvc/hvc_console.h @@ -9,20 +9,6 @@ * hvc_console header information: * moved here from arch/powerpc/include/asm/hvconsole.h * and drivers/char/hvc_console.c - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef HVC_CONSOLE_H diff --git a/drivers/tty/hvc/hvc_dcc.c b/drivers/tty/hvc/hvc_dcc.c index 3e4fb87..02629a1 100644 --- a/drivers/tty/hvc/hvc_dcc.c +++ b/drivers/tty/hvc/hvc_dcc.c @@ -1,15 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -/* Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +/* Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved. */ #include diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c index 4f361ba..2ed07ca 100644 --- a/drivers/tty/hvc/hvc_opal.c +++ b/drivers/tty/hvc/hvc_opal.c @@ -3,21 +3,6 @@ * opal driver interface to hvc_console.c * * Copyright 2011 Benjamin Herrenschmidt , IBM Corp. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #undef DEBUG diff --git a/drivers/tty/hvc/hvc_rtas.c b/drivers/tty/hvc/hvc_rtas.c index c168bd5..e8b8c64 100644 --- a/drivers/tty/hvc/hvc_rtas.c +++ b/drivers/tty/hvc/hvc_rtas.c @@ -12,20 +12,6 @@ * * inspired by drivers/char/hvc_console.c * written by Anton Blanchard and Paul Mackerras - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include diff --git a/drivers/tty/hvc/hvc_tile.c b/drivers/tty/hvc/hvc_tile.c index cdd8fa7..b517c06 100644 --- a/drivers/tty/hvc/hvc_tile.c +++ b/drivers/tty/hvc/hvc_tile.c @@ -2,16 +2,6 @@ /* * Copyright 2010 Tilera Corporation. All Rights Reserved. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, version 2. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or - * NON INFRINGEMENT. See the GNU General Public License for - * more details. - * * Tilera TILE Processor hypervisor console */ diff --git a/drivers/tty/hvc/hvc_udbg.c b/drivers/tty/hvc/hvc_udbg.c index d32929b..a4c9913 100644 --- a/drivers/tty/hvc/hvc_udbg.c +++ b/drivers/tty/hvc/hvc_udbg.c @@ -3,20 +3,6 @@ * udbg interface to hvc_console.c * * (C) Copyright David Gibson, IBM Corporation 2008. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c index 287ccf6..59eaa62 100644 --- a/drivers/tty/hvc/hvc_vio.c +++ b/drivers/tty/hvc/hvc_vio.c @@ -15,20 +15,6 @@ * Additional Author(s): * Ryan S. Arnold * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * * TODO: * * - handle error in sending hvsi protocol packets diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index e38a50d..dc43fa9 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c @@ -3,20 +3,6 @@ * xen console driver interface to hvc_console.c * * (c) 2007 Gerd Hoffmann - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index fc5a12e..1db1d97 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c @@ -4,20 +4,6 @@ * Copyright (C) 2003, 2004 IBM Corp. * Ryan S. Arnold (rsa@us.ibm.com) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * * Author(s) : Ryan S. Arnold * * This is the device driver for the IBM Hypervisor Virtual Console Server, diff --git a/drivers/tty/hvc/hvsi.c b/drivers/tty/hvc/hvsi.c index 63ebc73..66f95f7 100644 --- a/drivers/tty/hvc/hvsi.c +++ b/drivers/tty/hvc/hvsi.c @@ -1,20 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* * Copyright (C) 2004 Hollis Blanchard , IBM - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Host Virtual Serial Interface (HVSI) is a protocol between the hosted OS -- cgit v1.1 From 4e17ff37f185c4abba98afe372cadeac368cde89 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Nov 2017 18:11:54 +0100 Subject: tty: serdev: Remove redundant license text Now that the SPDX tag is in all tty files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Rob Herring Cc: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serdev/core.c | 9 --------- drivers/tty/serdev/serdev-ttyport.c | 9 --------- 2 files changed, 18 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c index 2aece10..1bef398 100644 --- a/drivers/tty/serdev/core.c +++ b/drivers/tty/serdev/core.c @@ -4,15 +4,6 @@ * * Based on drivers/spmi/spmi.c: * Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #include diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c index 57ff05e..ce7ad0a 100644 --- a/drivers/tty/serdev/serdev-ttyport.c +++ b/drivers/tty/serdev/serdev-ttyport.c @@ -1,15 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2016-2017 Linaro Ltd., Rob Herring - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ #include #include -- cgit v1.1 From e5656d43dce828bfcacbecd614e22355073e918b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Nov 2017 18:11:55 +0100 Subject: tty: Remove redundant license text Now that the SPDX tag is in all tty files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Jiri Slaby Cc: James Hogan Signed-off-by: Greg Kroah-Hartman --- drivers/tty/bfin_jtag_comm.c | 2 -- drivers/tty/ehv_bytechan.c | 4 ---- drivers/tty/goldfish.c | 10 ---------- drivers/tty/isicom.c | 5 ----- drivers/tty/metag_da.c | 5 ----- drivers/tty/mips_ejtag_fdc.c | 4 ---- drivers/tty/moxa.c | 5 ----- drivers/tty/mxser.c | 5 ----- drivers/tty/n_gsm.c | 13 ------------- drivers/tty/n_hdlc.c | 2 -- drivers/tty/n_null.c | 13 ------------- drivers/tty/n_r3964.c | 3 --- drivers/tty/n_tracerouter.c | 11 ----------- drivers/tty/n_tracesink.c | 11 ----------- drivers/tty/n_tracesink.h | 11 ----------- drivers/tty/n_tty.c | 3 --- drivers/tty/nozomi.c | 14 -------------- drivers/tty/rocket.c | 14 -------------- drivers/tty/synclink.c | 2 -- drivers/tty/synclink_gt.c | 2 -- drivers/tty/synclinkmp.c | 1 - drivers/tty/tty_audit.c | 5 +---- drivers/tty/tty_ldsem.c | 3 --- 23 files changed, 1 insertion(+), 147 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/bfin_jtag_comm.c b/drivers/tty/bfin_jtag_comm.c index d569692..c369bf2 100644 --- a/drivers/tty/bfin_jtag_comm.c +++ b/drivers/tty/bfin_jtag_comm.c @@ -5,8 +5,6 @@ * Copyright 2008-2009 Analog Devices Inc. * * Enter bugs at http://blackfin.uclinux.org/ - * - * Licensed under the GPL-2 or later. */ #define DRV_NAME "bfin-jtag-comm" diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c index 9637f34..e951e7a 100644 --- a/drivers/tty/ehv_bytechan.c +++ b/drivers/tty/ehv_bytechan.c @@ -5,10 +5,6 @@ * * Author: Timur Tabi * - * This file is licensed under the terms of the GNU General Public License - * version 2. This program is licensed "as is" without any warranty of any - * kind, whether express or implied. - * * This driver support three distinct interfaces, all of which are related to * ePAPR hypervisor byte channels. * diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c index 061f10d..7f657bb 100644 --- a/drivers/tty/goldfish.c +++ b/drivers/tty/goldfish.c @@ -3,16 +3,6 @@ * Copyright (C) 2007 Google, Inc. * Copyright (C) 2012 Intel, Inc. * Copyright (C) 2017 Imagination Technologies Ltd. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ #include diff --git a/drivers/tty/isicom.c b/drivers/tty/isicom.c index a598f79..d666fb1 100644 --- a/drivers/tty/isicom.c +++ b/drivers/tty/isicom.c @@ -1,10 +1,5 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * * Original driver code supplied by Multi-Tech * * Changes diff --git a/drivers/tty/metag_da.c b/drivers/tty/metag_da.c index 6c80496..99eaed4 100644 --- a/drivers/tty/metag_da.c +++ b/drivers/tty/metag_da.c @@ -3,11 +3,6 @@ * dashtty.c - tty driver for Dash channels interface. * * Copyright (C) 2007,2008,2012 Imagination Technologies - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - * */ #include diff --git a/drivers/tty/mips_ejtag_fdc.c b/drivers/tty/mips_ejtag_fdc.c index f0a2f19..4c1cd49 100644 --- a/drivers/tty/mips_ejtag_fdc.c +++ b/drivers/tty/mips_ejtag_fdc.c @@ -3,10 +3,6 @@ * TTY driver for MIPS EJTAG Fast Debug Channels. * * Copyright (C) 2007-2015 Imagination Technologies Ltd - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for more - * details. */ #include diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c index 8223960..687c091 100644 --- a/drivers/tty/moxa.c +++ b/drivers/tty/moxa.c @@ -8,11 +8,6 @@ * * This code is loosely based on the Linux serial driver, written by * Linus Torvalds, Theodore T'so and others. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ /* diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 4f4a54d..8bc15cb 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -9,11 +9,6 @@ * Linux serial driver, written by Linus Torvalds, Theodore T'so and * others. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * * Fed through a cleanup, indent and remove of non 2.6 code by Alan Cox * . The original 1.8 code is available on * www.moxa.com. diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index df51d49..3a39eb6 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -3,19 +3,6 @@ * n_gsm.c GSM 0710 tty multiplexor * Copyright (c) 2009/10 Intel Corporation * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * * * THIS IS A DEVELOPMENT SNAPSHOT IT IS NOT A FINAL RELEASE * * * TO DO: diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c index e2af7b1..eea7b6c 100644 --- a/drivers/tty/n_hdlc.c +++ b/drivers/tty/n_hdlc.c @@ -12,8 +12,6 @@ * * Original release 01/11/99 * - * This code is released under the GNU General Public License (GPL) - * * This module implements the tty line discipline N_HDLC for use with * tty device drivers that support bit-synchronous HDLC communications. * diff --git a/drivers/tty/n_null.c b/drivers/tty/n_null.c index cf6dc0f..96feaba 100644 --- a/drivers/tty/n_null.c +++ b/drivers/tty/n_null.c @@ -8,19 +8,6 @@ * n_null.c - Null line discipline used in the failure path * * Copyright (C) Intel 2017 - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ static int n_null_open(struct tty_struct *tty) diff --git a/drivers/tty/n_r3964.c b/drivers/tty/n_r3964.c index d184115..9f246d4 100644 --- a/drivers/tty/n_r3964.c +++ b/drivers/tty/n_r3964.c @@ -6,9 +6,6 @@ * Philips Automation Projects * Kassel (Germany) * ----------------------------------------------------------- - * This software may be used and distributed according to the terms of - * the GNU General Public License, incorporated herein by reference. - * * Author: * L. Haag * diff --git a/drivers/tty/n_tracerouter.c b/drivers/tty/n_tracerouter.c index 717d0c1..4479af4 100644 --- a/drivers/tty/n_tracerouter.c +++ b/drivers/tty/n_tracerouter.c @@ -6,17 +6,6 @@ * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * * This trace router uses the Linux line discipline framework to route * trace data coming from a HW Modem to a PTI (Parallel Trace Module) port. * The solution is not specific to a HW modem and this line disciple can diff --git a/drivers/tty/n_tracesink.c b/drivers/tty/n_tracesink.c index f907094..d96ba82 100644 --- a/drivers/tty/n_tracesink.c +++ b/drivers/tty/n_tracesink.c @@ -6,17 +6,6 @@ * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * * The trace sink uses the Linux line discipline framework to receive * trace data coming from the PTI source line discipline driver * to a user-desired tty port, like USB. diff --git a/drivers/tty/n_tracesink.h b/drivers/tty/n_tracesink.h index 2c9efd3..1b84633 100644 --- a/drivers/tty/n_tracesink.h +++ b/drivers/tty/n_tracesink.h @@ -6,17 +6,6 @@ * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * * The PTI (Parallel Trace Interface) driver directs trace data routed from * various parts in the system out through the Intel Penwell PTI port and * out of the mobile device for analysis with a debugging tool diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 385b6a5..427e0d5 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -16,9 +16,6 @@ * This file also contains code originally written by Linus Torvalds, * Copyright 1991, 1992, 1993, and by Julian Cowley, Copyright 1994. * - * This file may be redistributed under the terms of the GNU General Public - * License. - * * Reduced memory usage for older ARM systems - Russell King. * * 2000/01/20 Fixed SMP locking on put_tty_queue using bits of diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c index ec3e1b2..b57b350 100644 --- a/drivers/tty/nozomi.c +++ b/drivers/tty/nozomi.c @@ -22,20 +22,6 @@ * Copyright (c) 2006 Option Wireless n/v * All rights Reserved. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * * -------------------------------------------------------------------------- */ diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c index 59cd4b2..375afc3 100644 --- a/drivers/tty/rocket.c +++ b/drivers/tty/rocket.c @@ -5,20 +5,6 @@ * Written by Theodore Ts'o, 1995, 1996, 1997, 1998, 1999, 2000. * * Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003 by Comtrol, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c index 15189ac..f2c34d6 100644 --- a/drivers/tty/synclink.c +++ b/drivers/tty/synclink.c @@ -14,8 +14,6 @@ * * Original release 01/11/99 * - * This code is released under the GNU General Public License (GPL) - * * This driver is primarily intended for use in synchronous * HDLC mode. Asynchronous mode is also provided. * diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c index da9f2e5..06a0373 100644 --- a/drivers/tty/synclink_gt.c +++ b/drivers/tty/synclink_gt.c @@ -7,8 +7,6 @@ * * Microgate and SyncLink are trademarks of Microgate Corporation * - * This code is released under the GNU General Public License (GPL) - * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c index 4cc73be..d45f234 100644 --- a/drivers/tty/synclinkmp.c +++ b/drivers/tty/synclinkmp.c @@ -11,7 +11,6 @@ * Microgate and SyncLink are trademarks of Microgate Corporation * * Derived from serial.c written by Theodore Ts'o and Linus Torvalds - * This code is released under the GNU General Public License (GPL) * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c index 30b92c4..e30aa6b 100644 --- a/drivers/tty/tty_audit.c +++ b/drivers/tty/tty_audit.c @@ -2,10 +2,7 @@ /* * Creating audit events from TTY input. * - * Copyright (C) 2007 Red Hat, Inc. All rights reserved. This copyrighted - * material is made available to anyone wishing to use, modify, copy, or - * redistribute it subject to the terms and conditions of the GNU General - * Public License v.2. + * Copyright (C) 2007 Red Hat, Inc. All rights reserved. * * Authors: Miloslav Trmac */ diff --git a/drivers/tty/tty_ldsem.c b/drivers/tty/tty_ldsem.c index 3b40340..37a91b3 100644 --- a/drivers/tty/tty_ldsem.c +++ b/drivers/tty/tty_ldsem.c @@ -23,9 +23,6 @@ * Michel Lespinasse . * * Copyright (C) 2013 Peter Hurley - * - * This file may be redistributed under the terms of the GNU General Public - * License v2. */ #include -- cgit v1.1 From 7ecc77011c6fb40d3eef7c6a0ebcec61e69b3ec3 Mon Sep 17 00:00:00 2001 From: Ricardo Ribalda Delgado Date: Mon, 6 Nov 2017 11:49:12 +0100 Subject: serial: 8250_fintek: Return -EINVAL on invalid configuration Hardware does not support having the same RTS level during RX and TX when RS485 mode is on (URA in Fintek terminology). The manufacturer has also confirmed that the delays are not enabled if the RS485 mode is not enabled. Therefore we should return -EINVAL if the user wants to have the same value for RTS_ON_SEND and RTS_AFTER_SEND. Cc: "Ji-Ze Hong (Peter Hong)" Cc: Lukas Wunner Signed-off-by: Ricardo Ribalda Delgado Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_fintek.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index be7029f..6c7910d 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -197,10 +197,17 @@ static int fintek_8250_rs485_config(struct uart_port *port, if (!pdata) return -EINVAL; - if (rs485->flags & SER_RS485_ENABLED) + /* Hardware do not support same RTS level on send and receive */ + if (!(rs485->flags & SER_RS485_RTS_ON_SEND) == + !(rs485->flags & SER_RS485_RTS_AFTER_SEND)) + return -EINVAL; + + if (rs485->flags & SER_RS485_ENABLED) { memset(rs485->padding, 0, sizeof(rs485->padding)); - else + config |= RS485_URA; + } else { memset(rs485, 0, sizeof(*rs485)); + } rs485->flags &= SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND; @@ -215,12 +222,6 @@ static int fintek_8250_rs485_config(struct uart_port *port, config |= RXW4C_IRA; } - if ((!!(rs485->flags & SER_RS485_RTS_ON_SEND)) == - (!!(rs485->flags & SER_RS485_RTS_AFTER_SEND))) - rs485->flags &= ~SER_RS485_ENABLED; - else - config |= RS485_URA; - if (rs485->flags & SER_RS485_RTS_ON_SEND) config |= RTS_INVERT; -- cgit v1.1 From 21c4e7f255e38620bb4c5d1119c64114ab280e2e Mon Sep 17 00:00:00 2001 From: Ricardo Ribalda Delgado Date: Mon, 6 Nov 2017 11:49:13 +0100 Subject: serial: 8250_fintek: Disable delays for ports != 0 According to the datasheet, only the first port supports delay before send and delay after send. Reported-by: "Ji-Ze Hong (Peter Hong)" Signed-off-by: Ricardo Ribalda Delgado Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_fintek.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index 6c7910d..ae7d86e 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -212,6 +212,12 @@ static int fintek_8250_rs485_config(struct uart_port *port, rs485->flags &= SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND; + /* Only the first port supports delays */ + if (pdata->index) { + rs485->delay_rts_before_send = 0; + rs485->delay_rts_after_send = 0; + } + if (rs485->delay_rts_before_send) { rs485->delay_rts_before_send = 1; config |= TXW4C_IRA; -- cgit v1.1 From 07a708f0a16f040b319db647452bcb8884cd04be Mon Sep 17 00:00:00 2001 From: "Ji-Ze Hong (Peter Hong)" Date: Wed, 8 Nov 2017 11:05:46 +0800 Subject: serial: 8250_fintek: Fix crash with baud rate B0 The 8250_fintek.c is support the Fintek F81866/F81216 with dynamic clock. But It'll generate "division by zero" exception and crash in fintek_8250_set_termios() with baud rate 0 on baudrate_table[i] % baud. It can be tested with following C code: ... struct termios options; tcgetattr(fd, &options); ... options.c_cflag = CS8 | CREAD; /* baud rate 0 */ tcsetattr(fd, TCSANOW, &options); tcflush(fd, TCIOFLUSH); Fixes: 195638b6d44f ("serial: 8250_fintek: UART dynamic clocksource on Fintek F81866") Reported-by: Lukas Redlinger Cc: Lukas Redlinger Signed-off-by: Ji-Ze Hong (Peter Hong) Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_fintek.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c index ae7d86e..79a4958 100644 --- a/drivers/tty/serial/8250/8250_fintek.c +++ b/drivers/tty/serial/8250/8250_fintek.c @@ -315,6 +315,13 @@ void fintek_8250_set_termios(struct uart_port *port, struct ktermios *termios, F81866_UART_CLK_14_769MHZ, F81866_UART_CLK_18_432MHZ, F81866_UART_CLK_24MHZ }; + /* + * We'll use serial8250_do_set_termios() for baud = 0, otherwise It'll + * crash on baudrate_table[i] % baud with "division by zero". + */ + if (!baud) + goto exit; + switch (pdata->pid) { case CHIP_ID_F81216H: reg = RS485; @@ -327,8 +334,7 @@ void fintek_8250_set_termios(struct uart_port *port, struct ktermios *termios, dev_warn(port->dev, "%s: pid: %x Not support. use default set_termios.\n", __func__, pdata->pid); - serial8250_do_set_termios(port, termios, old); - return; + goto exit; } for (i = 0; i < ARRAY_SIZE(baudrate_table); ++i) { @@ -356,6 +362,7 @@ void fintek_8250_set_termios(struct uart_port *port, struct ktermios *termios, tty_termios_encode_baud_rate(termios, baud, baud); } +exit: serial8250_do_set_termios(port, termios, old); } -- cgit v1.1 From 9b11f19e414b1d1314ee581e8c1e084bced8e5cc Mon Sep 17 00:00:00 2001 From: Thomas Rohloff Date: Sun, 5 Nov 2017 20:36:30 +0100 Subject: tty: serial: meson: allow baud-rates lower than 9600 Devices like DCF77 receivers need the baud-rate to be as low as 50. I have tested this on a Meson GXL device with uart_A. Cc: Jiri Slaby Cc: Carlo Caione Cc: Kevin Hilman Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Thomas Rohloff Reviewed-by: Neil Armstrong Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/meson_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index 7bdd82df..daafe60 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -367,7 +367,7 @@ static void meson_uart_set_termios(struct uart_port *port, writel(val, port->membase + AML_UART_CONTROL); - baud = uart_get_baud_rate(port, termios, old, 9600, 4000000); + baud = uart_get_baud_rate(port, termios, old, 50, 4000000); meson_uart_change_speed(port, baud); port->read_status_mask = AML_UART_TX_FIFO_WERR; -- cgit v1.1 From 57f5d648c45c3d40a3257c06629c14fd53c383bc Mon Sep 17 00:00:00 2001 From: Arvind Yadav Date: Sun, 29 Oct 2017 12:20:10 +0530 Subject: tty: ehv_bytechan: fix spelling mistake Trivial fix to spelling mistakes "interupt" -> "interrupt". Signed-off-by: Arvind Yadav Signed-off-by: Greg Kroah-Hartman --- drivers/tty/ehv_bytechan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/tty') diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c index e951e7a..47ac568 100644 --- a/drivers/tty/ehv_bytechan.c +++ b/drivers/tty/ehv_bytechan.c @@ -325,7 +325,7 @@ console_initcall(ehv_bc_console_init); /******************************** TTY DRIVER ********************************/ /* - * byte channel receive interupt handler + * byte channel receive interrupt handler * * This ISR is called whenever data is available on a byte channel. */ @@ -425,7 +425,7 @@ static void ehv_bc_tx_dequeue(struct ehv_bc_data *bc) } /* - * byte channel transmit interupt handler + * byte channel transmit interrupt handler * * This ISR is called whenever space becomes available for transmitting * characters on a byte channel. -- cgit v1.1