]> git.baikalelectronics.ru Git - kernel.git/commit
tty: serial: fsl_lpuart: fix del_timer_sync() vs timer routine deadlock
authorNikita Yushchenko <nikita.yoush@cogentembedded.com>
Sun, 4 Dec 2016 15:49:28 +0000 (18:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2017 10:51:24 +0000 (11:51 +0100)
commit5a8256ea0099192490710fa3fd4cc8553f4f049b
treec0ea4f537ae797ba0354d0b7eefa5662c8d81591
parent705e25b33c1427700bc319b2602b6a56cd1891ba
tty: serial: fsl_lpuart: fix del_timer_sync() vs timer routine deadlock

Problem found via lockdep:

- lpuart_set_termios() calls del_timer_sync(&sport->lpuart_timer) while
  holding sport->port.lock

- sport->lpuart_timer routine is lpuart_timer_func() that calls
  lpuart_copy_rx_to_tty() that acquires same lock.

To fix, move Rx DMA stopping out of lock, as it already is in other places
in the same file.

While at it, also make Rx DMA start/stop code to look the same is in
other places in the same file.

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Tested-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/fsl_lpuart.c