linux-stable/drivers/tty
Sven Eckelmann 9e16682c94 tty: serial: msm_serial: Deactivate RX DMA for polling support
commit 7492ffc90f upstream.

The CONSOLE_POLLING mode is used for tools like k(g)db. In this kind of
setup, it is often sharing a serial device with the normal system console.
This is usually no problem because the polling helpers can consume input
values directly (when in kgdb context) and the normal Linux handlers can
only consume new input values after kgdb switched back.

This is not true anymore when RX DMA is enabled for UARTDM controllers.
Single input values can no longer be received correctly. Instead following
seems to happen:

* on 1. input, some old input is read (continuously)
* on 2. input, two old inputs are read (continuously)
* on 3. input, three old input values are read (continuously)
* on 4. input, 4 previous inputs are received

This repeats then for each group of 4 input values.

This behavior changes slightly depending on what state the controller was
when the first input was received. But this makes working with kgdb
basically impossible because control messages are always corrupted when
kgdboc tries to parse them.

RX DMA should therefore be off when CONSOLE_POLLING is enabled to avoid
these kind of problems. No such problem was noticed for TX DMA.

Fixes: 9969394501 ("tty: serial: msm: Add RX DMA support")
Cc: stable@vger.kernel.org
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://lore.kernel.org/r/20211113121050.7266-1-sven@narfation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-12-08 09:01:14 +01:00
..
hvc tty: hvc: replace BUG_ON() with negative return value 2021-12-01 09:23:36 +01:00
ipwireless
serdev
serial tty: serial: msm_serial: Deactivate RX DMA for polling support 2021-12-08 09:01:14 +01:00
vt tty: Fix out-of-bound vmalloc access in imageblit 2021-10-06 15:42:29 +02:00
amiserial.c tty: amiserial: fix TIOCSSERIAL permission check 2021-05-14 09:44:10 +02:00
cyclades.c
ehv_bytechan.c
goldfish.c
isicom.c
Kconfig
Makefile
mips_ejtag_fdc.c
moxa.c tty: moxa: fix TIOCSSERIAL permission check 2021-05-14 09:44:11 +02:00
moxa.h
mxser.c
mxser.h
n_gsm.c tty: n_gsm: check error while registering tty devices 2021-05-11 14:04:07 +02:00
n_hdlc.c
n_null.c
n_r3964.c
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c
nozomi.c tty: nozomi: Fix the error handling path of 'nozomi_card_init()' 2021-07-14 16:53:41 +02:00
pty.c
rocket.c
rocket.h
rocket_int.h
synclink.c
synclink_gt.c tty: synclink_gt: rename a conflicting function name 2021-09-30 10:09:23 +02:00
synclinkmp.c
sysrq.c
tty_audit.c
tty_baudrate.c
tty_buffer.c tty: tty_buffer: Fix the softlockup issue in flush_to_ldisc 2021-11-26 10:47:16 +01:00
tty_io.c tty: Fix data race between tiocsti() and flush_to_ldisc() 2021-09-15 09:47:39 +02:00
tty_ioctl.c
tty_jobctrl.c
tty_ldisc.c
tty_ldsem.c
tty_mutex.c
tty_port.c
ttynull.c
vcc.c