]> git.karo-electronics.de Git - mv-sheeva.git/commit
serial: bfin_5xx: split uart RX lock from uart port lock to avoid deadlock
authorSonic Zhang <sonic.zhang@analog.com>
Tue, 11 Jan 2011 05:16:43 +0000 (00:16 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 3 Feb 2011 22:44:54 +0000 (14:44 -0800)
commit0f66e50af53d39edebf4bc64ef90077e738c171f
treeb4983675b49343d1e6f7c21352b787168f57eac7
parent3e517f4b1de4787ecff87a73a9865a0b1aa2b10b
serial: bfin_5xx: split uart RX lock from uart port lock to avoid deadlock

The RX lock is used to protect the RX buffer from concurrent access in DMA
mode between the timer and RX interrupt routines.  It is independent from
the uart lock which is used to protect the TX buffer.  It is possible for
a uart TX transfer to be started up from the RX interrupt handler if low
latency is enabled.  So we need to split the locks to avoid deadlocking in
this situation.

In PIO mode, the RX lock is not necessary because the handle_simple_irq
and handle_level_irq functions ensure driver interrupt handlers are called
once on one core.

And now that the RX path has its own lock, the TX interrupt has nothing to
do with the RX path, so disabling it at the same time.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/blackfin/include/asm/bfin_serial.h
drivers/tty/serial/bfin_5xx.c