summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorFugang Duan <fugang.duan@nxp.com>2017-06-15 16:48:31 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:45:24 +0800
commitd44a60d517d962295164ec40c7e220ef61c0dc54 (patch)
tree29d11fe228f6481b6256b0ea98613e118b4c78b0 /drivers/tty
parent12ad8eef8490f897b674c16a96384da9789fd1f9 (diff)
MLK-15094 tty: serial: fsl_lpuart: check dma_tx_in_progress in callback
There have a corner case that tx DMA .callback() is coming after .flush_buffer(), then .callback() should check dma_tx_in_progress flag and return in directly. Signed-off-by: Fugang Duan <fugang.duan@nxp.com> Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/fsl_lpuart.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index b966e989ac2d..7f6c0c484c6f 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -489,6 +489,10 @@ static void lpuart_dma_tx_complete(void *arg)
unsigned long flags;
spin_lock_irqsave(&sport->port.lock, flags);
+ if (!sport->dma_tx_in_progress) {
+ spin_unlock_irqrestore(&sport->port.lock, flags);
+ return;
+ }
dma_unmap_sg(sport->port.dev, sgl, sport->dma_tx_nents, DMA_TO_DEVICE);