Skip to content

Commit 82c87e7

Browse files
committed
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()'
2 parents 6c90bbd + 10deeac commit 82c87e7

File tree

15 files changed

+51
-19
lines changed

15 files changed

+51
-19
lines changed

Documentation/devicetree/bindings/serial/renesas,sci-serial.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Required properties:
2626
- "renesas,hscif-r8a77470" for R8A77470 (RZ/G1C) HSCIF compatible UART.
2727
- "renesas,scif-r8a774a1" for R8A774A1 (RZ/G2M) SCIF compatible UART.
2828
- "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.
2931
- "renesas,scif-r8a774c0" for R8A774C0 (RZ/G2E) SCIF compatible UART.
3032
- "renesas,hscif-r8a774c0" for R8A774C0 (RZ/G2E) HSCIF compatible UART.
3133
- "renesas,scif-r8a7778" for R8A7778 (R-Car M1) SCIF compatible UART.

drivers/tty/n_hdlc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,11 @@ static int __init n_hdlc_init(void)
968968

969969
} /* end of init_module() */
970970

971+
#ifdef CONFIG_SPARC
972+
#undef __exitdata
973+
#define __exitdata
974+
#endif
975+
971976
static const char hdlc_unregister_ok[] __exitdata =
972977
KERN_INFO "N_HDLC: line discipline unregistered\n";
973978
static const char hdlc_unregister_fail[] __exitdata =

drivers/tty/serial/8250/8250_omap.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
141141

142142
serial8250_do_set_mctrl(port, mctrl);
143143

144-
if (!up->gpios) {
144+
if (!mctrl_gpio_to_gpiod(up->gpios, UART_GPIO_RTS)) {
145145
/*
146146
* Turn off autoRTS if RTS is lowered and restore autoRTS
147147
* setting if RTS is raised
@@ -456,7 +456,8 @@ static void omap_8250_set_termios(struct uart_port *port,
456456
up->port.status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS | UPSTAT_AUTOXOFF);
457457

458458
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)) {
460461
/* Enable AUTOCTS (autoRTS is enabled when RTS is raised) */
461462
up->port.status |= UPSTAT_AUTOCTS | UPSTAT_AUTORTS;
462463
priv->efr |= UART_EFR_CTS;

drivers/tty/serial/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,7 @@ config SERIAL_SIFIVE_CONSOLE
10321032
bool "Console on SiFive UART"
10331033
depends on SERIAL_SIFIVE=y
10341034
select SERIAL_CORE_CONSOLE
1035+
select SERIAL_EARLYCON
10351036
help
10361037
Select this option if you would like to use a SiFive UART as the
10371038
system console.

drivers/tty/serial/fsl_linflexuart.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Freescale linflexuart serial port driver
44
*
55
* Copyright 2012-2016 Freescale Semiconductor, Inc.
6-
* Copyright 2017-2018 NXP
6+
* Copyright 2017-2019 NXP
77
*/
88

99
#if defined(CONFIG_SERIAL_FSL_LINFLEXUART_CONSOLE) && \
@@ -246,12 +246,14 @@ static irqreturn_t linflex_rxint(int irq, void *dev_id)
246246
struct tty_port *port = &sport->state->port;
247247
unsigned long flags, status;
248248
unsigned char rx;
249+
bool brk;
249250

250251
spin_lock_irqsave(&sport->lock, flags);
251252

252253
status = readl(sport->membase + UARTSR);
253254
while (status & LINFLEXD_UARTSR_RMB) {
254255
rx = readb(sport->membase + BDRM);
256+
brk = false;
255257
flg = TTY_NORMAL;
256258
sport->icount.rx++;
257259

@@ -261,8 +263,11 @@ static irqreturn_t linflex_rxint(int irq, void *dev_id)
261263
status |= LINFLEXD_UARTSR_SZF;
262264
if (status & LINFLEXD_UARTSR_BOF)
263265
status |= LINFLEXD_UARTSR_BOF;
264-
if (status & LINFLEXD_UARTSR_FEF)
266+
if (status & LINFLEXD_UARTSR_FEF) {
267+
if (!rx)
268+
brk = true;
265269
status |= LINFLEXD_UARTSR_FEF;
270+
}
266271
if (status & LINFLEXD_UARTSR_PE)
267272
status |= LINFLEXD_UARTSR_PE;
268273
}
@@ -271,13 +276,15 @@ static irqreturn_t linflex_rxint(int irq, void *dev_id)
271276
sport->membase + UARTSR);
272277
status = readl(sport->membase + UARTSR);
273278

274-
if (uart_handle_sysrq_char(sport, (unsigned char)rx))
275-
continue;
276-
279+
if (brk) {
280+
uart_handle_break(sport);
281+
} else {
277282
#ifdef SUPPORT_SYSRQ
278-
sport->sysrq = 0;
283+
if (uart_handle_sysrq_char(sport, (unsigned char)rx))
284+
continue;
279285
#endif
280-
tty_insert_flip_char(port, rx, flg);
286+
tty_insert_flip_char(port, rx, flg);
287+
}
281288
}
282289

283290
spin_unlock_irqrestore(&sport->lock, flags);

drivers/tty/serial/fsl_lpuart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ static void lpuart_flush_buffer(struct uart_port *port)
548548
val |= UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH;
549549
lpuart32_write(&sport->port, val, UARTFIFO);
550550
} else {
551-
val = readb(sport->port.membase + UARTPFIFO);
551+
val = readb(sport->port.membase + UARTCFIFO);
552552
val |= UARTCFIFO_TXFLUSH | UARTCFIFO_RXFLUSH;
553553
writeb(val, sport->port.membase + UARTCFIFO);
554554
}

drivers/tty/serial/imx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,8 +2222,8 @@ static int imx_uart_probe(struct platform_device *pdev)
22222222
return PTR_ERR(base);
22232223

22242224
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);
22272227

22282228
sport->port.dev = &pdev->dev;
22292229
sport->port.mapbase = res->start;

drivers/tty/serial/owl-uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ static int __init owl_uart_init(void)
740740
return ret;
741741
}
742742

743-
static void __init owl_uart_exit(void)
743+
static void __exit owl_uart_exit(void)
744744
{
745745
platform_driver_unregister(&owl_uart_platform_driver);
746746
uart_unregister_driver(&owl_uart_driver);

drivers/tty/serial/rda-uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ static int __init rda_uart_init(void)
815815
return ret;
816816
}
817817

818-
static void __init rda_uart_exit(void)
818+
static void __exit rda_uart_exit(void)
819819
{
820820
platform_driver_unregister(&rda_uart_platform_driver);
821821
uart_unregister_driver(&rda_uart_driver);

drivers/tty/serial/serial_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,8 +1964,10 @@ uart_get_console(struct uart_port *ports, int nr, struct console *co)
19641964
* console=<name>,io|mmio|mmio16|mmio32|mmio32be|mmio32native,<addr>,<options>
19651965
*
19661966
* The optional form
1967+
*
19671968
* earlycon=<name>,0x<addr>,<options>
19681969
* console=<name>,0x<addr>,<options>
1970+
*
19691971
* is also accepted; the returned @iotype will be UPIO_MEM.
19701972
*
19711973
* Returns 0 on success or -EINVAL on failure

0 commit comments

Comments
 (0)