linux/drivers/tty/serial
Jan Kundrát a1211bbf78 serial: max310x: fix IO data corruption in batched operations
[ Upstream commit 3f42b142ea ]

After upgrading from 5.16 to 6.1, our board with a MAX14830 started
producing lots of garbage data over UART. Bisection pointed out commit
285e76fc04 as the culprit. That patch tried to replace hand-written
code which I added in 2b4bac48c1 ("serial: max310x: Use batched reads
when reasonably safe") with the generic regmap infrastructure for
batched operations.

Unfortunately, the `regmap_raw_read` and `regmap_raw_write` which were
used are actually functions which perform IO over *multiple* registers.
That's not what is needed for accessing these Tx/Rx FIFOs; the
appropriate functions are the `_noinc_` versions, not the `_raw_` ones.

Fix this regression by using `regmap_noinc_read()` and
`regmap_noinc_write()` along with the necessary `regmap_config` setup;
with this patch in place, our board communicates happily again. Since
our board uses SPI for talking to this chip, the I2C part is completely
untested.

Fixes: 285e76fc04 ("serial: max310x: use regmap methods for SPI batch operations")
Cc: stable@vger.kernel.org
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Link: https://lore.kernel.org/r/79db8e82aadb0e174bc82b9996423c3503c8fb37.1680732084.git.jan.kundrat@cesnet.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-03-15 10:48:24 -04:00
..
8250 serial: 8250: Remove serial_rs485 sanitization from em485 2024-03-01 13:21:53 +01:00
cpm_uart serial: cpm_uart: Avoid suspicious locking 2023-09-23 11:09:59 +02:00
jsm drivers: serial: jsm: fix some leaks in probe 2022-10-26 12:35:13 +02:00
21285.c tty: serial: 21285: fix lockup on open 2020-10-28 13:39:14 +01:00
altera_jtaguart.c serial: altera_jtaguart: drop low-latency workaround 2021-04-22 12:09:24 +02:00
altera_uart.c serial: altera_uart: fix locking in polling mode 2022-12-31 13:14:28 +01:00
amba-pl010.c serial: pl010: Drop CR register reset on set_termios 2022-01-27 11:04:54 +01:00
amba-pl011.c serial: amba-pl011: Fix DMA transmission in RS485 mode 2024-03-01 13:21:49 +01:00
amba-pl011.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
apbuart.c serial: apbuart: drop low-latency workaround 2021-04-22 12:09:25 +02:00
apbuart.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ar933x_uart.c serial: ar933x: Deassert Transmit Enable on ->rs485_config() 2022-11-10 18:15:24 +01:00
arc_uart.c serial: arc_uart: fix of_iomap leak in arc_serial_probe 2023-05-24 17:36:50 +01:00
atmel_serial.c serial: atmel: don't enable IRQs prematurely 2023-07-23 13:47:53 +02:00
atmel_serial.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
bcm63xx_uart.c serial: bcm63xx: drop low-latency workaround 2021-04-22 12:09:25 +02:00
clps711x.c tty/serial: Migrate clps711x to use has_sysrq 2019-12-18 15:04:46 +01:00
digicolor-usart.c serial: digicolor-usart: Don't allow CS5-6 2022-06-14 18:36:08 +02:00
dz.c tty: serial: dz: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:11 +02:00
dz.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
earlycon-arm-semihost.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
earlycon-riscv-sbi.c tty/serial: use uart_console_write in the RISC-V SBL early console 2019-01-23 15:41:50 -08:00
earlycon.c earlycon: simplify earlycon-table implementation 2020-12-04 15:49:48 +01:00
fsl_linflexuart.c tty: serial: linflexuart: Remove redundant check to simplify the code 2021-08-26 14:51:04 +02:00
fsl_lpuart.c tty: serial: fsl_lpuart: Clear the error flags by writing 1 for lpuart32 platforms 2023-08-26 14:23:31 +02:00
icom.c tty: Fix a possible resource leak in icom_probe 2022-06-14 18:36:20 +02:00
icom.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
imx.c serial: imx: Correct clock error message in function probe() 2024-01-25 14:52:52 -08:00
imx_earlycon.c tty: serial: imx: add imx earlycon driver 2020-07-29 17:11:02 +02:00
ip22zilog.c tty: serial: ip22zilog: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
ip22zilog.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig serial: omap: Only allow if 8250_omap is not selected 2021-07-29 17:03:04 +02:00
kgdb_nmi.c tty: drop put_tty_driver 2021-07-27 12:17:21 +02:00
kgdboc.c kgdboc: fix return value of __setup handler 2022-04-08 14:23:50 +02:00
lantiq.c serial: lantiq: add missing interrupt ack 2023-06-21 15:59:15 +02:00
liteuart.c serial: liteuart: fix MODULE_ALIAS 2022-01-27 11:03:55 +01:00
lpc32xx_hs.c tty: drivers/tty/, stop using tty_schedule_flip() 2022-07-29 17:25:31 +02:00
Makefile Revert "tty: serial: Add UART driver for Cortina-Access platform" 2021-06-24 14:46:32 +02:00
max310x.c serial: max310x: fix IO data corruption in batched operations 2024-03-15 10:48:24 -04:00
max3100.c tty_port: drop last traces of low_latency 2021-01-07 16:17:32 +01:00
mcf.c serial: mcf: drop low-latency workaround 2021-04-22 12:09:25 +02:00
men_z135_uart.c tty: serial, fix kernel-doc 2020-08-18 13:51:18 +02:00
meson_uart.c tty: serial: meson: fix hard LOCKUP on crtscts mode 2023-11-28 16:56:32 +00:00
milbeaut_usio.c tty/serial: Migrate milbeaut_usio to use has_sysrq 2019-12-18 15:04:51 +01:00
mpc52xx_uart.c serial: mpc52xx_uart: drop low-latency workaround 2021-04-22 12:09:25 +02:00
mps2-uart.c serial: mps2-uart: Add parentheses around conditional in mps2_uart_shutdown 2019-01-31 19:34:10 +01:00
msm_serial.c serial: msm_serial: disable interrupts in __msm_console_write() 2022-06-14 18:36:22 +02:00
mux.c parisc: Make struct parisc_driver::remove() return void 2021-08-30 10:18:25 +02:00
mvebu-uart.c serial: mvebu-uart: uart2 error bits clearing 2022-08-17 14:22:56 +02:00
mxs-auart.c tty: make use of tty_get_{char,frame}_size 2021-06-15 14:03:27 +02:00
omap-serial.c serial: omap: Disable PM runtime autoidle to remove pm_runtime_irq_safe() 2021-07-29 17:03:04 +02:00
owl-uart.c tty: serial: owl: Fix missing clk_disable_unprepare() in owl_uart_probe 2022-06-14 18:36:03 +02:00
pch_uart.c tty: pcn_uart: fix memory leak with using debugfs_lookup() 2023-03-11 13:57:37 +01:00
pic32_uart.c serial: pic32_uart: Use uart_console() helper 2020-03-12 10:00:22 +01:00
pic32_uart.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
pmac_zilog.c tty: serial: pmac_zilog: include <linux/io.h> insteiad of <asm/io.h> 2021-05-13 18:29:12 +02:00
pmac_zilog.h tty: serial: pmac_zilog: Remove unused disposable variable 'garbage' 2020-11-13 15:28:27 +01:00
pxa.c tty/serial: Migrate pxa to use has_sysrq 2019-12-18 15:04:57 +01:00
qcom_geni_serial.c serial: qcom-geni: fix opp vote on shutdown 2023-09-06 21:28:39 +01:00
rda-uart.c serial: rda-uart: Don't allow CS5-6 2022-06-14 18:36:08 +02:00
rp2.c serial: rp2: use 'request_firmware' instead of 'request_firmware_nowait' 2021-05-21 20:34:02 +02:00
sa1100.c drivers: tty: serial: Fix deadlock in sa1100_set_termios() 2022-06-14 18:36:21 +02:00
samsung_tty.c tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() when iterating clk 2023-07-23 13:47:53 +02:00
sb1250-duart.c tty: serial: sb1250-duart: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
sc16is7xx.c serial: sc16is7xx: set safe default SPI clock frequency 2024-01-25 14:52:49 -08:00
sccnxp.c tty/serial: Migrate sccnxp to use has_sysrq 2019-12-18 15:05:00 +01:00
serial-tegra.c serial: tegra: handle clk prepare error in tegra_uart_hw_init() 2023-09-19 12:22:47 +02:00
serial_core.c serial: fixup backport of "serial: Deassert Transmit Enable on probe in driver-specific way" 2023-01-14 10:23:28 +01:00
serial_mctrl_gpio.c serial: mctrl_gpio: Fix passing zero to 'ERR_PTR' warning 2020-11-06 17:12:05 +01:00
serial_mctrl_gpio.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
serial_txx9.c serial: txx9: Don't allow CS5-6 2022-06-14 18:36:08 +02:00
sh-sci.c tty: serial: sh-sci: Fix Rx on RZ/G2L SCI 2023-04-13 16:48:22 +02:00
sh-sci.h serial: sh-sci: Add support for RZ/G2L SoC 2021-06-04 15:12:40 +02:00
sifive.c serial: sifive: Fix sifive_serial_console_setup() section 2023-08-03 10:22:41 +02:00
sprd_serial.c serial: sprd: Fix DMA buffer leak issue 2023-09-19 12:22:45 +02:00
st-asc.c serial: st-asc: Sanitize CSIZE and correct PARENB for CS7 2022-06-14 18:36:08 +02:00
stm32-usart.c serial: stm32: Re-assert RTS/DE GPIO in RS485 mode only if more data are transmitted 2023-05-11 23:00:31 +09:00
stm32-usart.h serial: stm32: Use TC interrupt to deassert GPIO RTS in RS485 mode 2022-12-08 11:28:45 +01:00
suncore.c tty: Use of_node_name_{eq,prefix} for node name comparisons 2018-12-17 16:12:17 +01:00
sunhv.c Revert "serial: sunhv: Initialize lock for non-registered console" 2020-07-21 18:21:49 +02:00
sunsab.c serial: sunsab: Fix error handling in sunsab_init() 2022-12-31 13:14:28 +01:00
sunsab.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sunsu.c tty: serial: sunsu: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
sunzilog.c tty: serial: sunzilog: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
sunzilog.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tegra-tcu.c serial: tegra-tcu: Use uart_xmit_advance(), fixes icount.tx accounting 2022-09-28 11:11:54 +02:00
timbuart.c serial: timbuart: drop low-latency workaround 2021-04-22 12:09:26 +02:00
timbuart.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
uartlite.c tty: serial: uartlite: allow 64 bit address 2022-01-27 11:03:25 +01:00
ucc_uart.c tty: serial: Fix refcount leak bug in ucc_uart.c 2022-08-25 11:40:40 +02:00
vr41xx_siu.c tty: serial: vr41xx_siu: include <linux/io.h> instead of <asm/io.h> 2021-05-13 18:29:12 +02:00
vt8500_serial.c serial: vt8500: Use of_device_get_match_data 2021-08-26 14:51:10 +02:00
xilinx_uartps.c tty: xilinx_uartps: Fix the ignore_status 2022-10-26 12:35:05 +02:00
zs.c TTY/Serial driver updates for 5.6-rc1 2020-01-29 10:13:27 -08:00
zs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00