acrn-kernel/drivers/tty
Jan Kundrát c94e5baa98 serial: max310x: fix IO data corruption in batched operations
commit 3f42b142ea upstream.

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>
2023-05-11 23:03:01 +09:00
..
hvc hvc/xen: prevent concurrent accesses to the shared ring 2023-03-30 12:49:09 +02:00
ipwireless
serdev
serial serial: max310x: fix IO data corruption in batched operations 2023-05-11 23:03:01 +09:00
vt
Kconfig
Makefile
amiserial.c
ehv_bytechan.c
goldfish.c
mips_ejtag_fdc.c
moxa.c
mxser.c
n_gsm.c
n_hdlc.c
n_null.c
n_tty.c
nozomi.c
pty.c
rpmsg_tty.c
synclink_gt.c
sysrq.c
tty.h tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH 2023-05-11 23:03:01 +09:00
tty_audit.c
tty_baudrate.c
tty_buffer.c
tty_io.c tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH 2023-05-11 23:03:01 +09:00
tty_ioctl.c tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH 2023-05-11 23:03:01 +09:00
tty_jobctrl.c
tty_ldisc.c
tty_ldsem.c
tty_mutex.c
tty_port.c
ttynull.c
vcc.c