linux/drivers/tty/serial
Lukas Wunner d85bf51058 serial: 8250: 8250_omap: Fix calculation of RS485 delays
Commit 801954d121 ("serial: 8250: 8250_omap: Support native RS485")
calculates RS485 delays from the baudrate.  The baudrate is generated
with either a 16x or 13x divisor.  The divisor is set in the Mode
Definition Register 1 (MDR1).

The commit erroneously assumes that the register stores the divisor as
a bitmask and uses a logical AND to differentiate between 16x and 13x
divisors.  However the divisor is really stored as a 3-bit mode
(see lines 363ff in include/uapi/linux/serial_reg.h).

The logical AND operation is performed with UART_OMAP_MDR1_16X_MODE,
which is defined as 0x0 and hence yields false.  So the commit always
assumes a 13x divisor.  Fix by using an equal comparison.  This works
because we never set any of the other 5 bits in the register.  (They
pertain to IrDA mode, which is not supported by the driver).

Fixes: 801954d121 ("serial: 8250: 8250_omap: Support native RS485")
Link: https://lore.kernel.org/linux-serial/202211070440.8hWunFUN-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/7d5b04da13d89b8708b9543a0b125f2b6062a77b.1667977259.git.lukas@wunner.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-09 13:03:55 +01:00
..
8250 serial: 8250: 8250_omap: Fix calculation of RS485 delays 2022-11-09 13:03:55 +01:00
cpm_uart serial: cpm_uart: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
jsm drivers: serial: jsm: fix some leaks in probe 2022-09-22 16:11:43 +02:00
21285.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
altera_jtaguart.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
altera_uart.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
amba-pl010.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
amba-pl011.c serial: pl011: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
apbuart.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
apbuart.h
ar933x_uart.c serial: ar933x: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
arc_uart.c serial: arc: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
atmel_serial.c serial: atmel: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
atmel_serial.h tty: serial: atmel: Use FIELD_PREP/FIELD_GET 2022-09-22 16:32:25 +02:00
bcm63xx_uart.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
clps711x.c serial: clps711x: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
digicolor-usart.c serial: digicolor: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
dz.c serial: dz: Use uart_xmit_advance() 2022-11-03 03:35:40 +01:00
dz.h
earlycon-arm-semihost.c serial: make uart_console_write->putchar()'s character an unsigned char 2022-03-03 15:06:31 +01:00
earlycon-riscv-sbi.c serial: make uart_console_write->putchar()'s character an unsigned char 2022-03-03 15:06:31 +01:00
earlycon.c tty: move from strlcpy with unused retval to strscpy 2022-08-30 14:21:59 +02:00
fsl_linflexuart.c serial: linflexuart: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
fsl_lpuart.c serial: fsl_lpuart: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
icom.c serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
imx.c tty: serial: imx: Handle RS485 DE signal active high 2022-11-03 03:52:29 +01:00
imx_earlycon.c serial: make uart_console_write->putchar()'s character an unsigned char 2022-03-03 15:06:31 +01:00
ip22zilog.c serial: ip22zilog: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
ip22zilog.h
Kconfig serial: sifive: select by default if SOC_CANAAN 2022-11-02 08:10:11 +01:00
kgdb_nmi.c tty: drop put_tty_driver 2021-07-27 12:17:21 +02:00
kgdboc.c serial: kgdboc: Fix typo in comment 2022-06-27 14:37:09 +02:00
lantiq.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
liteuart.c serial: liteuart: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
lpc32xx_hs.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
Makefile serial: remove VR41XX serial driver 2022-07-16 08:16:01 +02:00
max310x.c serial: max310x: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
max3100.c serial: max3100: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
mcf.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
men_z135_uart.c serial: men_z135_uart: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
meson_uart.c serial: meson: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
milbeaut_usio.c serial: milbeaut_usio: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
mpc52xx_uart.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
mps2-uart.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
msm_serial.c serial: Fix a typo ("ignorning") 2022-11-09 13:03:12 +01:00
mux.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
mvebu-uart.c serial: mvebu-uart: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
mxs-auart.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
omap-serial.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
owl-uart.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
pch_uart.c serial: pch_uart: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
pic32_uart.c serial: pic32: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
pmac_zilog.c serial: pmac_zilog: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
pmac_zilog.h serial: pmac_zilog: remove unused uart_pmac_port::termios_cache 2022-05-19 18:23:19 +02:00
pxa.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
qcom_geni_serial.c tty: serial: qcom-geni-serial: Add support for Hibernation feature 2022-11-03 03:33:48 +01:00
rda-uart.c serial: rda: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
rp2.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
sa1100.c tty: serial: use uart_port_tx() helper 2022-11-03 03:32:40 +01:00
samsung_tty.c serial: samsung_tty: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
sb1250-duart.c serial: sb1250-duart: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
sc16is7xx.c serial: sc16is7xx: Use uart_xmit_advance() 2022-11-03 03:35:41 +01:00
sccnxp.c serial: sccnxp: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
serial-tegra.c serial: tegra: Read DMA status before terminating 2022-11-03 03:43:03 +01:00
serial_core.c serial: Deassert Transmit Enable on probe in driver-specific way 2022-09-25 09:28:57 +02:00
serial_mctrl_gpio.c Documentation: serial: move GPIO kernel-doc to the functions 2022-07-28 10:37:42 +02:00
serial_mctrl_gpio.h serial: mctrl_gpio: add a new API to enable / disable wake_irq 2022-02-08 11:07:16 +01:00
serial_txx9.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
sh-sci.c serial: sh-sci: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
sh-sci.h serial: sh-sci: Add support for RZ/G2L SoC 2021-06-04 15:12:40 +02:00
sifive.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
sprd_serial.c serial: sprd: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
st-asc.c tty: serial: use uart_port_tx_limited() 2022-11-03 03:32:40 +01:00
stm32-usart.c serial: stm32: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
stm32-usart.h serial: stm32: make info structs static to avoid sparse warnings 2022-07-28 10:35:23 +02:00
suncore.c
sunhv.c serial: sunhv: Use uart_xmit_advance() 2022-11-03 03:35:42 +01:00
sunplus-uart.c serial: sunplus-uart: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
sunsab.c serial: sunsab: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
sunsab.h
sunsu.c serial: sunsu: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
sunzilog.c serial: sunzilog: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
sunzilog.h
tegra-tcu.c Merge 7e2cd21e02 ("Merge tag 'tty-6.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty") into tty-next 2022-09-25 09:22:13 +02:00
timbuart.c serial: timbuart: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
timbuart.h
uartlite.c serial: uartlite: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
ucc_uart.c serial: ucc_uart: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
vt8500_serial.c serial: Fix a typo ("ignorning") 2022-11-09 13:03:12 +01:00
xilinx_uartps.c serial: xuartps: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
zs.c serial: zs: Use uart_xmit_advance() 2022-11-03 03:35:43 +01:00
zs.h