Commit 88c1d247 authored by Fugang Duan's avatar Fugang Duan Committed by Greg Kroah-Hartman
Browse files

tty: serial: fsl_lpuart: check dma_tx_in_progress in tx dma 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: default avatarFugang Duan <fugang.duan@nxp.com>
Signed-off-by: default avatarVipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: default avatarSherry Sun <sherry.sun@nxp.com>
Link: https://lore.kernel.org/r/20210817100203.21300-1-sherry.sun@nxp.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1143637f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -479,6 +479,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(chan->device->dev, sgl, sport->dma_tx_nents,
		     DMA_TO_DEVICE);