linux-kernel-test/drivers/tty
Stefan Agner 5f1437f61a serial: fsl_lpuart: avoid new transfer while DMA is running
When the UART is in DMA receive mode (RDMAS set) and one character
just arrived while another interrupt is handled (e.g. TX), the RDRF
(receiver data register full flag) is set due to the water level of
1. But since the DMA will take care of this character, there is no
need to handle it by calling lpuart_prepare_rx. Handling it leads to
adding the RX timeout timer twice:

[   74.336698] Kernel BUG at 80053070 [verbose debug info unavailable]
[   74.342999] Internal error: Oops - BUG: 0 [#1] ARM0:00.00 khungtaskd
[   74.347817] Modules linked in:    0 S  0.0  0.0   0:00.00 writeback
[   74.350926] CPU: 0 PID: 0 Comm: swapper Not tainted 3.19.0-rc3-00001-g39d78e2 #1788
[   74.358617] Hardware name: Freescale Vybrid VF610 (Device Tree)t
[   74.364563] task: 807a7678 ti: 8079c000 task.ti: 8079c000 kblockd
[   74.370002] PC is at add_timer+0x24/0x28.0  0.0   0:00.09 kworker/u2:1
[   74.373960] LR is at lpuart_int+0x15c/0x3d8
[   74.378171] pc : [<80053070>]    lr : [<802e0d88>]    psr: a0010193
[   74.378171] sp : 8079de10  ip : 8079de20  fp : 8079de1c
[   74.389694] r10: 807d44c0  r9 : 8688c300  r8 : 00000013
[   74.394943] r7 : 20010193  r6 : 00000000  r5 : 000000a0  r4 : 86997210
[   74.401498] r3 : ffffa7da  r2 : 80817868  r1 : 86997210  r0 : 86997344
[   74.408052] Flags: NzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[   74.415489] Control: 10c5387d  Table: 8611c059  DAC: 00000015
[   74.421265] Process swapper (pid: 0, stack limit = 0x8079c230)
...

Solve this by only execute the receiver path (lpuart_prepare_rx) if
the DMA receive mode (RDMAS) is not set. Also, make sure the flag is
cleared on initialization, in case it has been left set.

This can be best reproduced using UART as a serial console, then
running top while dd'ing data into the terminal.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Cc: stable <stable@vger.kernel.org> # 3.14
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-02 10:09:55 -08:00
..
hvc Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
ipwireless tty: ipwireless: Fix probable mask then right shift defects 2014-11-05 20:06:33 -08:00
serial serial: fsl_lpuart: avoid new transfer while DMA is running 2015-02-02 10:09:55 -08:00
vt vt: provide notifications on selection changes 2015-02-02 10:09:54 -08:00
amiserial.c TTY: fix misspelling of current function in string 2015-01-09 14:38:15 -08:00
bfin_jtag_comm.c sched, cleanup, treewide: Remove set_current_state(TASK_RUNNING) after schedule() 2014-09-19 12:35:17 +02:00
cyclades.c
ehv_bytechan.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
goldfish.c goldfish: off by one in goldfish_tty_console_setup() 2014-11-05 16:12:45 -08:00
isicom.c tty: pr_warning->pr_warn and logging neatening 2014-11-25 17:06:38 -08:00
Kconfig
Makefile
metag_da.c tty/metag_da: Add console_poll module parameter 2014-09-28 21:35:56 -04:00
moxa.c TTY: fix decimal printf format specifiers prefixed with 0x 2014-09-08 15:51:35 -07:00
moxa.h
mxser.c
mxser.h
n_gsm.c
n_hdlc.c
n_r3964.c
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c Revert "tty: Fix pty master poll() after slave closes v2" 2015-01-09 13:46:02 -08:00
nozomi.c drivers/tty/nozomi.c: Use 'nozomi_setup_memory' instead of 'setup_memory' 2014-09-08 16:09:23 -07:00
pty.c tty: Prevent untrappable signals from malicious program 2015-02-02 10:09:54 -08:00
rocket_int.h
rocket.c TTY: fix misspelling of current function in string 2015-01-09 14:38:15 -08:00
rocket.h
synclink_gt.c
synclink.c
synclinkmp.c
sysrq.c
tty_audit.c
tty_buffer.c tty: Flush ldisc buffer atomically with tty flip buffers 2014-11-05 18:50:43 -08:00
tty_io.c tty: Prevent hw state corruption in exclusive mode reopen 2015-01-09 13:46:02 -08:00
tty_ioctl.c tty: Call methods in modern style 2014-11-05 20:18:30 -08:00
tty_ldisc.c tty: Allow safe access to termios for set_ldisc() handlers 2014-11-06 14:57:27 -08:00
tty_ldsem.c
tty_mutex.c tty: Remove warning in tty_lock_slave() 2015-01-09 14:17:59 -08:00
tty_port.c tty: Deletion of unnecessary checks before two function calls 2014-11-26 19:35:49 -08:00