Skip to content

Commit 5cdfdd6

Browse files
committed
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"
2 parents ce86beb + 18365eb commit 5cdfdd6

File tree

8 files changed

+30
-23
lines changed

8 files changed

+30
-23
lines changed

drivers/tty/serdev/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static int of_serdev_register_devices(struct serdev_controller *ctrl)
534534
if (!serdev)
535535
continue;
536536

537-
serdev->dev.of_node = node;
537+
device_set_node(&serdev->dev, of_fwnode_handle(node));
538538

539539
err = serdev_device_add(serdev);
540540
if (err) {

drivers/tty/serial/8250/8250_em.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ static int serial8250_em_probe(struct platform_device *pdev)
106106
memset(&up, 0, sizeof(up));
107107
up.port.mapbase = regs->start;
108108
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;
111111
up.port.dev = &pdev->dev;
112112
up.port.private_data = priv;
113113

drivers/tty/serial/8250/8250_fsl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ int fsl8250_handle_irq(struct uart_port *port)
3434

3535
iir = port->serial_in(port, UART_IIR);
3636
if (iir & UART_IIR_NO_INT) {
37-
spin_unlock(&up->port.lock);
37+
spin_unlock_irqrestore(&up->port.lock, flags);
3838
return 0;
3939
}
4040

4141
/* This is the WAR; if last event was BRK, then read and return */
4242
if (unlikely(up->lsr_saved_flags & UART_LSR_BI)) {
4343
up->lsr_saved_flags &= ~UART_LSR_BI;
4444
port->serial_in(port, UART_RX);
45-
spin_unlock(&up->port.lock);
45+
spin_unlock_irqrestore(&up->port.lock, flags);
4646
return 1;
4747
}
4848

drivers/tty/serial/8250/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,9 @@ config SERIAL_8250_ASPEED_VUART
257257
tristate "Aspeed Virtual UART"
258258
depends on SERIAL_8250
259259
depends on OF
260-
depends on REGMAP && MFD_SYSCON
260+
depends on MFD_SYSCON
261261
depends on ARCH_ASPEED || COMPILE_TEST
262+
select REGMAP
262263
help
263264
If you want to use the virtual UART (VUART) device on Aspeed
264265
BMC platforms, enable this option. This enables the 16550A-
@@ -299,7 +300,6 @@ config SERIAL_8250_PCI1XXXX
299300
tristate "Microchip 8250 based serial port"
300301
depends on SERIAL_8250 && PCI
301302
select SERIAL_8250_PCILIB
302-
default SERIAL_8250
303303
help
304304
Select this option if you have a setup with Microchip PCIe
305305
Switch with serial port enabled and wish to enable 8250

drivers/tty/serial/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ config SERIAL_FSL_LPUART
13131313

13141314
config SERIAL_FSL_LPUART_CONSOLE
13151315
bool "Console on Freescale lpuart serial port"
1316-
depends on SERIAL_FSL_LPUART
1316+
depends on SERIAL_FSL_LPUART=y
13171317
select SERIAL_CORE_CONSOLE
13181318
select SERIAL_EARLYCON
13191319
help

drivers/tty/serial/fsl_lpuart.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,7 @@ static void lpuart_dma_rx_free(struct uart_port *port)
13541354
struct dma_chan *chan = sport->dma_rx_chan;
13551355

13561356
dmaengine_terminate_sync(chan);
1357+
del_timer_sync(&sport->lpuart_timer);
13571358
dma_unmap_sg(chan->device->dev, &sport->rx_sgl, 1, DMA_FROM_DEVICE);
13581359
kfree(sport->rx_ring.buf);
13591360
sport->rx_ring.tail = 0;
@@ -1813,7 +1814,6 @@ static int lpuart32_startup(struct uart_port *port)
18131814
static void lpuart_dma_shutdown(struct lpuart_port *sport)
18141815
{
18151816
if (sport->lpuart_dma_rx_use) {
1816-
del_timer_sync(&sport->lpuart_timer);
18171817
lpuart_dma_rx_free(&sport->port);
18181818
sport->lpuart_dma_rx_use = false;
18191819
}
@@ -1973,10 +1973,8 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios,
19731973
* Since timer function acqures sport->port.lock, need to stop before
19741974
* acquring same lock because otherwise del_timer_sync() can deadlock.
19751975
*/
1976-
if (old && sport->lpuart_dma_rx_use) {
1977-
del_timer_sync(&sport->lpuart_timer);
1976+
if (old && sport->lpuart_dma_rx_use)
19781977
lpuart_dma_rx_free(&sport->port);
1979-
}
19801978

19811979
spin_lock_irqsave(&sport->port.lock, flags);
19821980

@@ -2210,10 +2208,8 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
22102208
* Since timer function acqures sport->port.lock, need to stop before
22112209
* acquring same lock because otherwise del_timer_sync() can deadlock.
22122210
*/
2213-
if (old && sport->lpuart_dma_rx_use) {
2214-
del_timer_sync(&sport->lpuart_timer);
2211+
if (old && sport->lpuart_dma_rx_use)
22152212
lpuart_dma_rx_free(&sport->port);
2216-
}
22172213

22182214
spin_lock_irqsave(&sport->port.lock, flags);
22192215

@@ -2240,9 +2236,15 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
22402236
/* update the per-port timeout */
22412237
uart_update_timeout(port, termios->c_cflag, baud);
22422238

2243-
/* wait transmit engin complete */
2244-
lpuart32_write(&sport->port, 0, UARTMODIR);
2245-
lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC);
2239+
/*
2240+
* LPUART Transmission Complete Flag may never be set while queuing a break
2241+
* character, so skip waiting for transmission complete when UARTCTRL_SBK is
2242+
* asserted.
2243+
*/
2244+
if (!(old_ctrl & UARTCTRL_SBK)) {
2245+
lpuart32_write(&sport->port, 0, UARTMODIR);
2246+
lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC);
2247+
}
22462248

22472249
/* disable transmit and receive */
22482250
lpuart32_write(&sport->port, old_ctrl & ~(UARTCTRL_TE | UARTCTRL_RE),
@@ -3014,7 +3016,6 @@ static int lpuart_suspend(struct device *dev)
30143016
* cannot resume as expected, hence gracefully release the
30153017
* Rx DMA path before suspend and start Rx DMA path on resume.
30163018
*/
3017-
del_timer_sync(&sport->lpuart_timer);
30183019
lpuart_dma_rx_free(&sport->port);
30193020

30203021
/* Disable Rx DMA to use UART port as wakeup source */

drivers/tty/serial/qcom_geni_serial.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ static void qcom_geni_serial_stop_tx_dma(struct uart_port *uport)
596596
if (!qcom_geni_serial_main_active(uport))
597597
return;
598598

599-
if (port->rx_dma_addr) {
599+
if (port->tx_dma_addr) {
600600
geni_se_tx_dma_unprep(&port->se, port->tx_dma_addr,
601601
port->tx_remaining);
602602
port->tx_dma_addr = 0;
@@ -631,9 +631,8 @@ static void qcom_geni_serial_start_tx_dma(struct uart_port *uport)
631631
if (port->tx_dma_addr)
632632
return;
633633

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;
637636

638637
xmit_size = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
639638

@@ -1070,6 +1069,10 @@ static int setup_fifos(struct qcom_geni_serial_port *port)
10701069
static void qcom_geni_serial_shutdown(struct uart_port *uport)
10711070
{
10721071
disable_irq(uport->irq);
1072+
1073+
if (uart_console(uport))
1074+
return;
1075+
10731076
qcom_geni_serial_stop_tx(uport);
10741077
qcom_geni_serial_stop_rx(uport);
10751078
}

drivers/tty/vt/vt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4545,6 +4545,9 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op)
45454545
int c;
45464546
unsigned int vpitch = op->op == KD_FONT_OP_GET_TALL ? op->height : 32;
45474547

4548+
if (vpitch > max_font_height)
4549+
return -EINVAL;
4550+
45484551
if (op->data) {
45494552
font.data = kvmalloc(max_font_size, GFP_KERNEL);
45504553
if (!font.data)

0 commit comments

Comments
 (0)