serial: 8250: Fix thread unsafe __dma_tx_complete function
authorLoic Poulain <loic.poulain@intel.com>
Thu, 24 Apr 2014 09:34:48 +0000 (11:34 +0200)
committerJiri Slaby <jslaby@suse.cz>
Fri, 6 Jun 2014 09:40:21 +0000 (11:40 +0200)
commite5ffcda2cdc477940a4f86ff7f60316d4d3703f6
treed5cdbda1bd785f8dd7e0b3c4a9346dbcc263af0b
parentd214ff2381dcbe76574026cb1f8dd49910216bfe
serial: 8250: Fix thread unsafe __dma_tx_complete function

commit f8fd1b0350d3a4581125f5eda6528f5a2c5f9183 upstream.

__dma_tx_complete is not protected against concurrent
call of serial8250_tx_dma. it can lead to circular tail
index corruption or parallel call of serial_tx_dma on the
same data portion.

This patch fixes this issue by holding the port lock.

Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/tty/serial/8250/8250_dma.c