linux/drivers/tty
Hugo Villeneuve 133f4c00b8 serial: sc16is7xx: fix TX fifo corruption
Sometimes, when a packet is received on channel A at almost the same time
as a packet is about to be transmitted on channel B, we observe with a
logic analyzer that the received packet on channel A is transmitted on
channel B. In other words, the Tx buffer data on channel B is corrupted
with data from channel A.

The problem appeared since commit 4409df5866 ("serial: sc16is7xx: change
EFR lock to operate on each channels"), which changed the EFR locking to
operate on each channel instead of chip-wise.

This commit has introduced a regression, because the EFR lock is used not
only to protect the EFR registers access, but also, in a very obscure and
undocumented way, to protect access to the data buffer, which is shared by
the Tx and Rx handlers, but also by each channel of the IC.

Fix this regression first by switching to kfifo_out_linear_ptr() in
sc16is7xx_handle_tx() to eliminate the need for a shared Rx/Tx buffer.

Secondly, replace the chip-wise Rx buffer with a separate Rx buffer for
each channel.

Fixes: 4409df5866 ("serial: sc16is7xx: change EFR lock to operate on each channels")
Cc: stable@vger.kernel.org
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20240723125302.1305372-2-hugo@hugovil.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-31 12:31:19 +02:00
..
hvc TTY/Serial changes for 6.10-rc1 2024-05-22 11:53:02 -07:00
ipwireless tty: ipwireless: remove unused ipw_dev::attribute_memory 2023-11-23 19:16:03 +00:00
serdev driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
serial serial: sc16is7xx: fix TX fifo corruption 2024-07-31 12:31:19 +02:00
vt vt: keyboard: Use led_set_brightness() in LED trigger activate() callback 2024-06-04 14:00:53 +02:00
amiserial.c tty: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:10:11 +02:00
ehv_bytechan.c tty: ehv_bytechan: convert to u8 and size_t 2023-12-08 12:02:37 +01:00
goldfish.c tty: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:10:11 +02:00
Kconfig vt: remove superfluous CONFIG_HW_CONSOLE 2024-01-27 19:03:51 -08:00
Makefile
mips_ejtag_fdc.c tty: mips_ejtag_fdc: Fix passing incompatible pointer type warning 2024-02-23 10:14:16 +01:00
moxa.c tty: moxa: convert to u8 and size_t 2023-12-08 12:02:38 +01:00
mxser.c tty: mxser: Remove __counted_by from mxser_board.ports[] 2024-06-28 08:54:56 -07:00
n_gsm.c tty: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:10:11 +02:00
n_hdlc.c tty: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:10:11 +02:00
n_null.c tty: ldops: unify to u8 2023-08-11 21:12:47 +02:00
n_tty.c tty: n_tty: Fix buffer offsets when lookahead is used 2024-06-04 14:07:27 +02:00
nozomi.c tty: nozomi: convert to u8 and size_t 2023-12-08 12:02:38 +01:00
pty.c tty: make tty_operations::write()'s count size_t 2023-08-11 21:12:46 +02:00
rpmsg_tty.c tty: make tty_operations::write()'s count size_t 2023-08-11 21:12:46 +02:00
synclink_gt.c tty: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:10:11 +02:00
sysrq.c Devicetree fixes for 6.11, part 1 2024-07-27 12:46:16 -07:00
tty_audit.c tty: audit: unify to u8 2023-08-11 21:12:46 +02:00
tty_baudrate.c
tty_buffer.c tty: Don't include tty_buffer.h in tty.h 2024-02-18 18:59:59 +01:00
tty_io.c USB / Thunderbolt changes for 6.8-rc1 2024-01-18 11:43:55 -08:00
tty_ioctl.c tty: allow TIOCSLCKTRMIOS with CAP_CHECKPOINT_RESTORE 2023-12-15 14:20:03 +01:00
tty_jobctrl.c tty: tty_jobctrl: fix pid memleak in disassociate_ctty() 2023-09-18 11:14:43 +02:00
tty_ldisc.c tty: add the option to have a tty reject a new ldisc 2024-05-04 18:45:11 +02:00
tty_ldsem.c
tty_mutex.c
tty_port.c tty: switch tty_port::xmit_* to u8 2023-12-08 12:02:37 +01:00
tty.h tty: convert THROTTLE constants into enum 2023-10-03 14:31:16 +02:00
ttynull.c tty: add missing MODULE_DESCRIPTION() macros 2024-06-24 16:10:11 +02:00
vcc.c tty: vcc: Add check for kstrdup() in vcc_probe() 2023-09-18 11:14:42 +02:00