Skip to content

Commit 11de40c

Browse files
committed
Merge tag 'tty-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull serial driver fixes from Greg KH: "Here are three small serial driver fixes for 6.19-rc7 that resolve some reported issues. They include: - tty->port race condition fix for a reported problem - qcom_geni serial driver fix - 8250_pci serial driver fix All of these have been in linux-next with no reported issues" * tag 'tty-6.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: serial: Fix not set tty->port race condition serial: 8250_pci: Fix broken RS485 for F81504/508/512 serial: qcom_geni: Fix BT failure regression on RB2 platform
2 parents 913fb06 + 32f37e5 commit 11de40c

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

drivers/tty/serial/8250/8250_pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,7 @@ static int pci_fintek_rs485_config(struct uart_port *port, struct ktermios *term
16581658
}
16591659

16601660
static const struct serial_rs485 pci_fintek_rs485_supported = {
1661-
.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND,
1661+
.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND,
16621662
/* F81504/508/512 does not support RTS delay before or after send */
16631663
};
16641664

drivers/tty/serial/qcom_geni_serial.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,24 +1888,23 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
18881888
if (ret)
18891889
goto error;
18901890

1891-
devm_pm_runtime_enable(port->se.dev);
1892-
1893-
ret = uart_add_one_port(drv, uport);
1894-
if (ret)
1895-
goto error;
1896-
18971891
if (port->wakeup_irq > 0) {
18981892
device_init_wakeup(&pdev->dev, true);
18991893
ret = dev_pm_set_dedicated_wake_irq(&pdev->dev,
19001894
port->wakeup_irq);
19011895
if (ret) {
19021896
device_init_wakeup(&pdev->dev, false);
19031897
ida_free(&port_ida, uport->line);
1904-
uart_remove_one_port(drv, uport);
19051898
goto error;
19061899
}
19071900
}
19081901

1902+
devm_pm_runtime_enable(port->se.dev);
1903+
1904+
ret = uart_add_one_port(drv, uport);
1905+
if (ret)
1906+
goto error;
1907+
19091908
return 0;
19101909

19111910
error:

drivers/tty/serial/serial_core.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3074,6 +3074,12 @@ static int serial_core_add_one_port(struct uart_driver *drv, struct uart_port *u
30743074
if (uport->cons && uport->dev)
30753075
of_console_check(uport->dev->of_node, uport->cons->name, uport->line);
30763076

3077+
/*
3078+
* TTY port has to be linked with the driver before register_console()
3079+
* in uart_configure_port(), because user-space could open the console
3080+
* immediately after.
3081+
*/
3082+
tty_port_link_device(port, drv->tty_driver, uport->line);
30773083
uart_configure_port(drv, state, uport);
30783084

30793085
port->console = uart_console(uport);

0 commit comments

Comments
 (0)