Merge tag 'tty-6.3-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 6.3-rc3 to resolve
some reported issues.

They include:

- 8250 driver Kconfig issue pointed out by you that showed up in -rc1

- qcom-geni serial driver fixes

- various 8250 driver fixes for reported problems

- fsl_lpuart driver fixes

- serdev fix for regression in -rc1

- vt.c bugfix

All have been in linux-next for over a week with no reported problems"

* tag 'tty-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
tty: vt: protect KD_FONT_OP_GET_TALL from unbound access
serial: qcom-geni: drop bogus uart_write_wakeup()
serial: qcom-geni: fix mapping of empty DMA buffer
serial: qcom-geni: fix DMA mapping leak on shutdown
serial: qcom-geni: fix console shutdown hang
serdev: Set fwnode for serdev devices
tty: serial: fsl_lpuart: fix race on RX DMA shutdown
serial: 8250_pci1xxxx: Disable SERIAL_8250_PCI1XXXX config by default
serial: 8250_fsl: fix handle_irq locking
serial: 8250_em: Fix UART port type
serial: 8250: ASPEED_VUART: select REGMAP instead of depending on it
tty: serial: fsl_lpuart: skip waiting for transmission complete when UARTCTRL_SBK is asserted
Revert "tty: serial: fsl_lpuart: adjust SERIAL_FSL_LPUART_CONSOLE config dependency"

Changed files
+30 -23
drivers
+1 -1
drivers/tty/serdev/core.c
··· 534 534 if (!serdev) 535 535 continue; 536 536 537 - serdev->dev.of_node = node; 537 + device_set_node(&serdev->dev, of_fwnode_handle(node)); 538 538 539 539 err = serdev_device_add(serdev); 540 540 if (err) {
+2 -2
drivers/tty/serial/8250/8250_em.c
··· 106 106 memset(&up, 0, sizeof(up)); 107 107 up.port.mapbase = regs->start; 108 108 up.port.irq = irq; 109 - up.port.type = PORT_UNKNOWN; 110 - up.port.flags = UPF_BOOT_AUTOCONF | UPF_FIXED_PORT | UPF_IOREMAP; 109 + up.port.type = PORT_16750; 110 + up.port.flags = UPF_FIXED_PORT | UPF_IOREMAP | UPF_FIXED_TYPE; 111 111 up.port.dev = &pdev->dev; 112 112 up.port.private_data = priv; 113 113
+2 -2
drivers/tty/serial/8250/8250_fsl.c
··· 34 34 35 35 iir = port->serial_in(port, UART_IIR); 36 36 if (iir & UART_IIR_NO_INT) { 37 - spin_unlock(&up->port.lock); 37 + spin_unlock_irqrestore(&up->port.lock, flags); 38 38 return 0; 39 39 } 40 40 ··· 42 42 if (unlikely(up->lsr_saved_flags & UART_LSR_BI)) { 43 43 up->lsr_saved_flags &= ~UART_LSR_BI; 44 44 port->serial_in(port, UART_RX); 45 - spin_unlock(&up->port.lock); 45 + spin_unlock_irqrestore(&up->port.lock, flags); 46 46 return 1; 47 47 } 48 48
+2 -2
drivers/tty/serial/8250/Kconfig
··· 257 257 tristate "Aspeed Virtual UART" 258 258 depends on SERIAL_8250 259 259 depends on OF 260 - depends on REGMAP && MFD_SYSCON 260 + depends on MFD_SYSCON 261 261 depends on ARCH_ASPEED || COMPILE_TEST 262 + select REGMAP 262 263 help 263 264 If you want to use the virtual UART (VUART) device on Aspeed 264 265 BMC platforms, enable this option. This enables the 16550A- ··· 300 299 tristate "Microchip 8250 based serial port" 301 300 depends on SERIAL_8250 && PCI 302 301 select SERIAL_8250_PCILIB 303 - default SERIAL_8250 304 302 help 305 303 Select this option if you have a setup with Microchip PCIe 306 304 Switch with serial port enabled and wish to enable 8250
+1 -1
drivers/tty/serial/Kconfig
··· 1313 1313 1314 1314 config SERIAL_FSL_LPUART_CONSOLE 1315 1315 bool "Console on Freescale lpuart serial port" 1316 - depends on SERIAL_FSL_LPUART 1316 + depends on SERIAL_FSL_LPUART=y 1317 1317 select SERIAL_CORE_CONSOLE 1318 1318 select SERIAL_EARLYCON 1319 1319 help
+12 -11
drivers/tty/serial/fsl_lpuart.c
··· 1354 1354 struct dma_chan *chan = sport->dma_rx_chan; 1355 1355 1356 1356 dmaengine_terminate_sync(chan); 1357 + del_timer_sync(&sport->lpuart_timer); 1357 1358 dma_unmap_sg(chan->device->dev, &sport->rx_sgl, 1, DMA_FROM_DEVICE); 1358 1359 kfree(sport->rx_ring.buf); 1359 1360 sport->rx_ring.tail = 0; ··· 1814 1813 static void lpuart_dma_shutdown(struct lpuart_port *sport) 1815 1814 { 1816 1815 if (sport->lpuart_dma_rx_use) { 1817 - del_timer_sync(&sport->lpuart_timer); 1818 1816 lpuart_dma_rx_free(&sport->port); 1819 1817 sport->lpuart_dma_rx_use = false; 1820 1818 } ··· 1973 1973 * Since timer function acqures sport->port.lock, need to stop before 1974 1974 * acquring same lock because otherwise del_timer_sync() can deadlock. 1975 1975 */ 1976 - if (old && sport->lpuart_dma_rx_use) { 1977 - del_timer_sync(&sport->lpuart_timer); 1976 + if (old && sport->lpuart_dma_rx_use) 1978 1977 lpuart_dma_rx_free(&sport->port); 1979 - } 1980 1978 1981 1979 spin_lock_irqsave(&sport->port.lock, flags); 1982 1980 ··· 2208 2210 * Since timer function acqures sport->port.lock, need to stop before 2209 2211 * acquring same lock because otherwise del_timer_sync() can deadlock. 2210 2212 */ 2211 - if (old && sport->lpuart_dma_rx_use) { 2212 - del_timer_sync(&sport->lpuart_timer); 2213 + if (old && sport->lpuart_dma_rx_use) 2213 2214 lpuart_dma_rx_free(&sport->port); 2214 - } 2215 2215 2216 2216 spin_lock_irqsave(&sport->port.lock, flags); 2217 2217 ··· 2236 2240 /* update the per-port timeout */ 2237 2241 uart_update_timeout(port, termios->c_cflag, baud); 2238 2242 2239 - /* wait transmit engin complete */ 2240 - lpuart32_write(&sport->port, 0, UARTMODIR); 2241 - lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC); 2243 + /* 2244 + * LPUART Transmission Complete Flag may never be set while queuing a break 2245 + * character, so skip waiting for transmission complete when UARTCTRL_SBK is 2246 + * asserted. 2247 + */ 2248 + if (!(old_ctrl & UARTCTRL_SBK)) { 2249 + lpuart32_write(&sport->port, 0, UARTMODIR); 2250 + lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC); 2251 + } 2242 2252 2243 2253 /* disable transmit and receive */ 2244 2254 lpuart32_write(&sport->port, old_ctrl & ~(UARTCTRL_TE | UARTCTRL_RE), ··· 3016 3014 * cannot resume as expected, hence gracefully release the 3017 3015 * Rx DMA path before suspend and start Rx DMA path on resume. 3018 3016 */ 3019 - del_timer_sync(&sport->lpuart_timer); 3020 3017 lpuart_dma_rx_free(&sport->port); 3021 3018 3022 3019 /* Disable Rx DMA to use UART port as wakeup source */
+7 -4
drivers/tty/serial/qcom_geni_serial.c
··· 596 596 if (!qcom_geni_serial_main_active(uport)) 597 597 return; 598 598 599 - if (port->rx_dma_addr) { 599 + if (port->tx_dma_addr) { 600 600 geni_se_tx_dma_unprep(&port->se, port->tx_dma_addr, 601 601 port->tx_remaining); 602 602 port->tx_dma_addr = 0; ··· 631 631 if (port->tx_dma_addr) 632 632 return; 633 633 634 - xmit_size = uart_circ_chars_pending(xmit); 635 - if (xmit_size < WAKEUP_CHARS) 636 - uart_write_wakeup(uport); 634 + if (uart_circ_empty(xmit)) 635 + return; 637 636 638 637 xmit_size = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE); 639 638 ··· 1069 1070 static void qcom_geni_serial_shutdown(struct uart_port *uport) 1070 1071 { 1071 1072 disable_irq(uport->irq); 1073 + 1074 + if (uart_console(uport)) 1075 + return; 1076 + 1072 1077 qcom_geni_serial_stop_tx(uport); 1073 1078 qcom_geni_serial_stop_rx(uport); 1074 1079 }
+3
drivers/tty/vt/vt.c
··· 4545 4545 int c; 4546 4546 unsigned int vpitch = op->op == KD_FONT_OP_GET_TALL ? op->height : 32; 4547 4547 4548 + if (vpitch > max_font_height) 4549 + return -EINVAL; 4550 + 4548 4551 if (op->data) { 4549 4552 font.data = kvmalloc(max_font_size, GFP_KERNEL); 4550 4553 if (!font.data)