Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'tty-5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Pull tty/serial driver fixes from Greg KH:
"Here are some small tty and serial driver fixes for 5.4-rc3 that
resolve a number of reported issues and regressions.

None of these are huge, full details are in the shortlog. There's also
a MAINTAINERS update that I think you might have already taken in your
tree already, but git should handle that merge easily.

All have been in linux-next with no reported issues"

* tag 'tty-5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
MAINTAINERS: kgdb: Add myself as a reviewer for kgdb/kdb
tty: serial: imx: Use platform_get_irq_optional() for optional IRQs
serial: fix kernel-doc warning in comments
serial: 8250_omap: Fix gpio check for auto RTS/CTS
serial: mctrl_gpio: Check for NULL pointer
tty: serial: fsl_lpuart: Fix lpuart_flush_buffer()
tty: serial: Fix PORT_LINFLEXUART definition
tty: n_hdlc: fix build on SPARC
serial: uartps: Fix uartps_major handling
serial: uartlite: fix exit path null pointer
tty: serial: linflexuart: Fix magic SysRq handling
serial: sh-sci: Use platform_get_irq_optional() for optional interrupts
dt-bindings: serial: sh-sci: Document r8a774b1 bindings
serial/sifive: select SERIAL_EARLYCON
tty: serial: rda: Fix the link time qualifier of 'rda_uart_exit()'
tty: serial: owl: Fix the link time qualifier of 'owl_uart_exit()'

+51 -19
+2
Documentation/devicetree/bindings/serial/renesas,sci-serial.txt
··· 26 26 - "renesas,hscif-r8a77470" for R8A77470 (RZ/G1C) HSCIF compatible UART. 27 27 - "renesas,scif-r8a774a1" for R8A774A1 (RZ/G2M) SCIF compatible UART. 28 28 - "renesas,hscif-r8a774a1" for R8A774A1 (RZ/G2M) HSCIF compatible UART. 29 + - "renesas,scif-r8a774b1" for R8A774B1 (RZ/G2N) SCIF compatible UART. 30 + - "renesas,hscif-r8a774b1" for R8A774B1 (RZ/G2N) HSCIF compatible UART. 29 31 - "renesas,scif-r8a774c0" for R8A774C0 (RZ/G2E) SCIF compatible UART. 30 32 - "renesas,hscif-r8a774c0" for R8A774C0 (RZ/G2E) HSCIF compatible UART. 31 33 - "renesas,scif-r8a7778" for R8A7778 (R-Car M1) SCIF compatible UART.
+5
drivers/tty/n_hdlc.c
··· 968 968 969 969 } /* end of init_module() */ 970 970 971 + #ifdef CONFIG_SPARC 972 + #undef __exitdata 973 + #define __exitdata 974 + #endif 975 + 971 976 static const char hdlc_unregister_ok[] __exitdata = 972 977 KERN_INFO "N_HDLC: line discipline unregistered\n"; 973 978 static const char hdlc_unregister_fail[] __exitdata =
+3 -2
drivers/tty/serial/8250/8250_omap.c
··· 141 141 142 142 serial8250_do_set_mctrl(port, mctrl); 143 143 144 - if (!up->gpios) { 144 + if (!mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS)) { 145 145 /* 146 146 * Turn off autoRTS if RTS is lowered and restore autoRTS 147 147 * setting if RTS is raised ··· 456 456 up->port.status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF); 457 457 458 458 if (termios->c_cflag & CRTSCTS && up->port.flags & UPF_HARD_FLOW && 459 - !up->gpios) { 459 + !mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS) && 460 + !mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_CTS)) { 460 461 /* Enable AUTOCTS (autoRTS is enabled when RTS is raised) */ 461 462 up->port.status |= UPSTAT_AUTOCTS | UPSTAT_AUTORTS; 462 463 priv->efr |= UART_EFR_CTS;
+1
drivers/tty/serial/Kconfig
··· 1032 1032 bool "Console on SiFive UART" 1033 1033 depends on SERIAL_SIFIVE=y 1034 1034 select SERIAL_CORE_CONSOLE 1035 + select SERIAL_EARLYCON 1035 1036 help 1036 1037 Select this option if you would like to use a SiFive UART as the 1037 1038 system console.
+14 -7
drivers/tty/serial/fsl_linflexuart.c
··· 3 3 * Freescale linflexuart serial port driver 4 4 * 5 5 * Copyright 2012-2016 Freescale Semiconductor, Inc. 6 - * Copyright 2017-2018 NXP 6 + * Copyright 2017-2019 NXP 7 7 */ 8 8 9 9 #if defined(CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE) && \ ··· 246 246 struct tty_port *port = &sport->state->port; 247 247 unsigned long flags, status; 248 248 unsigned char rx; 249 + bool brk; 249 250 250 251 spin_lock_irqsave(&sport->lock, flags); 251 252 252 253 status = readl(sport->membase + UARTSR); 253 254 while (status & LINFLEXD_UARTSR_RMB) { 254 255 rx = readb(sport->membase + BDRM); 256 + brk = false; 255 257 flg = TTY_NORMAL; 256 258 sport->icount.rx++; 257 259 ··· 263 261 status |= LINFLEXD_UARTSR_SZF; 264 262 if (status & LINFLEXD_UARTSR_BOF) 265 263 status |= LINFLEXD_UARTSR_BOF; 266 - if (status & LINFLEXD_UARTSR_FEF) 264 + if (status & LINFLEXD_UARTSR_FEF) { 265 + if (!rx) 266 + brk = true; 267 267 status |= LINFLEXD_UARTSR_FEF; 268 + } 268 269 if (status & LINFLEXD_UARTSR_PE) 269 270 status |= LINFLEXD_UARTSR_PE; 270 271 } ··· 276 271 sport->membase + UARTSR); 277 272 status = readl(sport->membase + UARTSR); 278 273 279 - if (uart_handle_sysrq_char(sport, (unsigned char)rx)) 280 - continue; 281 - 274 + if (brk) { 275 + uart_handle_break(sport); 276 + } else { 282 277 #ifdef SUPPORT_SYSRQ 283 - sport->sysrq = 0; 278 + if (uart_handle_sysrq_char(sport, (unsigned char)rx)) 279 + continue; 284 280 #endif 285 - tty_insert_flip_char(port, rx, flg); 281 + tty_insert_flip_char(port, rx, flg); 282 + } 286 283 } 287 284 288 285 spin_unlock_irqrestore(&sport->lock, flags);
+1 -1
drivers/tty/serial/fsl_lpuart.c
··· 548 548 val |= UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH; 549 549 lpuart32_write(&sport->port, val, UARTFIFO); 550 550 } else { 551 - val = readb(sport->port.membase + UARTPFIFO); 551 + val = readb(sport->port.membase + UARTCFIFO); 552 552 val |= UARTCFIFO_TXFLUSH | UARTCFIFO_RXFLUSH; 553 553 writeb(val, sport->port.membase + UARTCFIFO); 554 554 }
+2 -2
drivers/tty/serial/imx.c
··· 2222 2222 return PTR_ERR(base); 2223 2223 2224 2224 rxirq = platform_get_irq(pdev, 0); 2225 - txirq = platform_get_irq(pdev, 1); 2226 - rtsirq = platform_get_irq(pdev, 2); 2225 + txirq = platform_get_irq_optional(pdev, 1); 2226 + rtsirq = platform_get_irq_optional(pdev, 2); 2227 2227 2228 2228 sport->port.dev = &pdev->dev; 2229 2229 sport->port.mapbase = res->start;
+1 -1
drivers/tty/serial/owl-uart.c
··· 740 740 return ret; 741 741 } 742 742 743 - static void __init owl_uart_exit(void) 743 + static void __exit owl_uart_exit(void) 744 744 { 745 745 platform_driver_unregister(&owl_uart_platform_driver); 746 746 uart_unregister_driver(&owl_uart_driver);
+1 -1
drivers/tty/serial/rda-uart.c
··· 815 815 return ret; 816 816 } 817 817 818 - static void __init rda_uart_exit(void) 818 + static void __exit rda_uart_exit(void) 819 819 { 820 820 platform_driver_unregister(&rda_uart_platform_driver); 821 821 uart_unregister_driver(&rda_uart_driver);
+2
drivers/tty/serial/serial_core.c
··· 1964 1964 * console=<name>,io|mmio|mmio16|mmio32|mmio32be|mmio32native,<addr>,<options> 1965 1965 * 1966 1966 * The optional form 1967 + * 1967 1968 * earlycon=<name>,0x<addr>,<options> 1968 1969 * console=<name>,0x<addr>,<options> 1970 + * 1969 1971 * is also accepted; the returned @iotype will be UPIO_MEM. 1970 1972 * 1971 1973 * Returns 0 on success or -EINVAL on failure
+3
drivers/tty/serial/serial_mctrl_gpio.c
··· 66 66 struct gpio_desc *mctrl_gpio_to_gpiod(struct mctrl_gpios *gpios, 67 67 enum mctrl_gpio_idx gidx) 68 68 { 69 + if (gpios == NULL) 70 + return NULL; 71 + 69 72 return gpios->gpio[gidx]; 70 73 } 71 74 EXPORT_SYMBOL_GPL(mctrl_gpio_to_gpiod);
+6 -2
drivers/tty/serial/sh-sci.c
··· 2894 2894 port->mapbase = res->start; 2895 2895 sci_port->reg_size = resource_size(res); 2896 2896 2897 - for (i = 0; i < ARRAY_SIZE(sci_port->irqs); ++i) 2898 - sci_port->irqs[i] = platform_get_irq(dev, i); 2897 + for (i = 0; i < ARRAY_SIZE(sci_port->irqs); ++i) { 2898 + if (i) 2899 + sci_port->irqs[i] = platform_get_irq_optional(dev, i); 2900 + else 2901 + sci_port->irqs[i] = platform_get_irq(dev, i); 2902 + } 2899 2903 2900 2904 /* The SCI generates several interrupts. They can be muxed together or 2901 2905 * connected to different interrupt lines. In the muxed case only one
+2 -1
drivers/tty/serial/uartlite.c
··· 897 897 static void __exit ulite_exit(void) 898 898 { 899 899 platform_driver_unregister(&ulite_platform_driver); 900 - uart_unregister_driver(&ulite_uart_driver); 900 + if (ulite_uart_driver.state) 901 + uart_unregister_driver(&ulite_uart_driver); 901 902 } 902 903 903 904 module_init(ulite_init);
+7 -1
drivers/tty/serial/xilinx_uartps.c
··· 1550 1550 goto err_out_id; 1551 1551 } 1552 1552 1553 - uartps_major = cdns_uart_uart_driver->tty_driver->major; 1554 1553 cdns_uart_data->cdns_uart_driver = cdns_uart_uart_driver; 1555 1554 1556 1555 /* ··· 1679 1680 console_port = NULL; 1680 1681 #endif 1681 1682 1683 + uartps_major = cdns_uart_uart_driver->tty_driver->major; 1682 1684 cdns_uart_data->cts_override = of_property_read_bool(pdev->dev.of_node, 1683 1685 "cts-override"); 1684 1686 return 0; ··· 1740 1740 if (console_port == port) 1741 1741 console_port = NULL; 1742 1742 #endif 1743 + 1744 + /* If this is last instance major number should be initialized */ 1745 + mutex_lock(&bitmap_lock); 1746 + if (bitmap_empty(bitmap, MAX_UART_INSTANCES)) 1747 + uartps_major = 0; 1748 + mutex_unlock(&bitmap_lock); 1743 1749 1744 1750 uart_unregister_driver(cdns_uart_data->cdns_uart_driver); 1745 1751 return rc;
+1 -1
include/uapi/linux/serial_core.h
··· 291 291 #define PORT_SUNIX 121 292 292 293 293 /* Freescale Linflex UART */ 294 - #define PORT_LINFLEXUART 121 294 + #define PORT_LINFLEXUART 122 295 295 296 296 #endif /* _UAPILINUX_SERIAL_CORE_H */