Skip to content

Commit 12c2f77

Browse files
committed
Merge tag 'tty-6.4-rc5' 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/serial driver fixes for 6.4-rc5 that have all been in linux-next this past week with no reported problems. Included in here are: - 8250_tegra driver bugfix - fsl uart driver bugfixes - Kconfig fix for dependancy issue - dt-bindings fix for the 8250_omap driver" * tag 'tty-6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: dt-bindings: serial: 8250_omap: add rs485-rts-active-high serial: cpm_uart: Fix a COMPILE_TEST dependency soc: fsl: cpm1: Fix TSA and QMC dependencies in case of COMPILE_TEST tty: serial: fsl_lpuart: use UARTCTRL_TXINV to send break instead of UARTCTRL_SBK serial: 8250_tegra: Fix an error handling path in tegra_uart_probe()
2 parents 8b435e4 + 403e97d commit 12c2f77

File tree

6 files changed

+30
-27
lines changed

6 files changed

+30
-27
lines changed

Documentation/devicetree/bindings/serial/8250_omap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ properties:
7070
dsr-gpios: true
7171
rng-gpios: true
7272
dcd-gpios: true
73+
rs485-rts-active-high: true
7374
rts-gpio: true
7475
power-domains: true
7576
clock-frequency: true

drivers/soc/fsl/qe/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ config UCC
3636
config CPM_TSA
3737
tristate "CPM TSA support"
3838
depends on OF && HAS_IOMEM
39-
depends on CPM1 || COMPILE_TEST
39+
depends on CPM1 || (CPM && COMPILE_TEST)
4040
help
4141
Freescale CPM Time Slot Assigner (TSA)
4242
controller.
@@ -47,7 +47,7 @@ config CPM_TSA
4747
config CPM_QMC
4848
tristate "CPM QMC support"
4949
depends on OF && HAS_IOMEM
50-
depends on CPM1 || (FSL_SOC && COMPILE_TEST)
50+
depends on CPM1 || (FSL_SOC && CPM && COMPILE_TEST)
5151
depends on CPM_TSA
5252
help
5353
Freescale CPM QUICC Multichannel Controller

drivers/tty/serial/8250/8250_tegra.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,15 @@ static int tegra_uart_probe(struct platform_device *pdev)
113113

114114
ret = serial8250_register_8250_port(&port8250);
115115
if (ret < 0)
116-
goto err_clkdisable;
116+
goto err_ctrl_assert;
117117

118118
platform_set_drvdata(pdev, uart);
119119
uart->line = ret;
120120

121121
return 0;
122122

123+
err_ctrl_assert:
124+
reset_control_assert(uart->rst);
123125
err_clkdisable:
124126
clk_disable_unprepare(uart->clk);
125127

drivers/tty/serial/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ config SERIAL_PMACZILOG_CONSOLE
762762

763763
config SERIAL_CPM
764764
tristate "CPM SCC/SMC serial port support"
765-
depends on CPM2 || CPM1 || (PPC32 && COMPILE_TEST)
765+
depends on CPM2 || CPM1
766766
select SERIAL_CORE
767767
help
768768
This driver supports the SCC and SMC serial ports on Motorola

drivers/tty/serial/cpm_uart/cpm_uart.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ struct gpio_desc;
1919
#include "cpm_uart_cpm2.h"
2020
#elif defined(CONFIG_CPM1)
2121
#include "cpm_uart_cpm1.h"
22-
#elif defined(CONFIG_COMPILE_TEST)
23-
#include "cpm_uart_cpm2.h"
2422
#endif
2523

2624
#define SERIAL_CPM_MAJOR 204

drivers/tty/serial/fsl_lpuart.c

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,34 +1495,36 @@ static void lpuart_break_ctl(struct uart_port *port, int break_state)
14951495

14961496
static void lpuart32_break_ctl(struct uart_port *port, int break_state)
14971497
{
1498-
unsigned long temp, modem;
1499-
struct tty_struct *tty;
1500-
unsigned int cflag = 0;
1501-
1502-
tty = tty_port_tty_get(&port->state->port);
1503-
if (tty) {
1504-
cflag = tty->termios.c_cflag;
1505-
tty_kref_put(tty);
1506-
}
1498+
unsigned long temp;
15071499

1508-
temp = lpuart32_read(port, UARTCTRL) & ~UARTCTRL_SBK;
1509-
modem = lpuart32_read(port, UARTMODIR);
1500+
temp = lpuart32_read(port, UARTCTRL);
15101501

1502+
/*
1503+
* LPUART IP now has two known bugs, one is CTS has higher priority than the
1504+
* break signal, which causes the break signal sending through UARTCTRL_SBK
1505+
* may impacted by the CTS input if the HW flow control is enabled. It
1506+
* exists on all platforms we support in this driver.
1507+
* Another bug is i.MX8QM LPUART may have an additional break character
1508+
* being sent after SBK was cleared.
1509+
* To avoid above two bugs, we use Transmit Data Inversion function to send
1510+
* the break signal instead of UARTCTRL_SBK.
1511+
*/
15111512
if (break_state != 0) {
1512-
temp |= UARTCTRL_SBK;
15131513
/*
1514-
* LPUART CTS has higher priority than SBK, need to disable CTS before
1515-
* asserting SBK to avoid any interference if flow control is enabled.
1514+
* Disable the transmitter to prevent any data from being sent out
1515+
* during break, then invert the TX line to send break.
15161516
*/
1517-
if (cflag & CRTSCTS && modem & UARTMODIR_TXCTSE)
1518-
lpuart32_write(port, modem & ~UARTMODIR_TXCTSE, UARTMODIR);
1517+
temp &= ~UARTCTRL_TE;
1518+
lpuart32_write(port, temp, UARTCTRL);
1519+
temp |= UARTCTRL_TXINV;
1520+
lpuart32_write(port, temp, UARTCTRL);
15191521
} else {
1520-
/* Re-enable the CTS when break off. */
1521-
if (cflag & CRTSCTS && !(modem & UARTMODIR_TXCTSE))
1522-
lpuart32_write(port, modem | UARTMODIR_TXCTSE, UARTMODIR);
1522+
/* Disable the TXINV to turn off break and re-enable transmitter. */
1523+
temp &= ~UARTCTRL_TXINV;
1524+
lpuart32_write(port, temp, UARTCTRL);
1525+
temp |= UARTCTRL_TE;
1526+
lpuart32_write(port, temp, UARTCTRL);
15231527
}
1524-
1525-
lpuart32_write(port, temp, UARTCTRL);
15261528
}
15271529

15281530
static void lpuart_setup_watermark(struct lpuart_port *sport)

0 commit comments

Comments
 (0)