linux-stable/drivers/tty
Jan Kundrát 738845b022 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>
2024-03-15 10:48:23 -04:00
..
hvc hvc/xen: prevent concurrent accesses to the shared ring 2024-03-01 13:16:46 +01:00
ipwireless
serdev
serial serial: max310x: fix IO data corruption in batched operations 2024-03-15 10:48:23 -04:00
vt vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF 2023-05-30 12:57:55 +01:00
amiserial.c
cyclades.c
ehv_bytechan.c
goldfish.c
isicom.c
Kconfig
Makefile
mips_ejtag_fdc.c
moxa.c
moxa.h
mxser.c
mxser.h
n_gsm.c tty: n_gsm: add sanity check for gsm->receive in gsm_receive_buf() 2023-12-20 15:44:41 +01:00
n_hdlc.c tty: clean include/linux/tty.h up 2023-05-17 11:48:09 +02:00
n_null.c
n_r3964.c
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c tty: create internal tty.h file 2023-05-17 11:48:08 +02:00
nozomi.c
pty.c tty: create internal tty.h file 2023-05-17 11:48:08 +02:00
rocket.c
rocket.h
rocket_int.h
synclink.c
synclink_gt.c
synclinkmp.c
sysrq.c tty/sysrq: replace smp_processor_id() with get_cpu() 2023-11-28 16:54:56 +00:00
tty.h tty: change tty_write_lock()'s ndelay parameter to bool 2024-01-25 14:37:54 -08:00
tty_audit.c tty: audit: move some local functions out of tty.h 2023-05-17 11:48:08 +02:00
tty_baudrate.c tty: clean include/linux/tty.h up 2023-05-17 11:48:09 +02:00
tty_buffer.c tty: move some internal tty lock enums and functions out of tty.h 2023-05-17 11:48:08 +02:00
tty_io.c usb: cdc-acm: return correct error code on unsupported break 2024-01-25 14:37:54 -08:00
tty_ioctl.c tty: allow TIOCSLCKTRMIOS with CAP_CHECKPOINT_RESTORE 2024-02-23 08:42:14 +01:00
tty_jobctrl.c tty: tty_jobctrl: fix pid memleak in disassociate_ctty() 2023-11-20 11:06:52 +01:00
tty_ldisc.c tty: create internal tty.h file 2023-05-17 11:48:08 +02:00
tty_ldsem.c
tty_mutex.c tty: move some internal tty lock enums and functions out of tty.h 2023-05-17 11:48:08 +02:00
tty_port.c tty: create internal tty.h file 2023-05-17 11:48:08 +02:00
ttynull.c
vcc.c tty: vcc: Add check for kstrdup() in vcc_probe() 2023-11-28 16:54:52 +00:00