MLK-14980 tty: serial: fsl_lpuart: remove unnecessary .async_tx_ack()
authorFugang Duan <fugang.duan@nxp.com>
Fri, 26 May 2017 02:53:37 +0000 (10:53 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:22:26 +0000 (15:22 -0500)
lpuart only use NXP/FSL eDMA dmaengine in i.MX/Vybrid/LS1021a platform,
and eDMA driver don't reuse descriptor then no need to check the
flag DMA_CTRL_ACK. And current eDMA driver use virt chan mechanism and
free tx_descriptor memory after .callback(), but .lpuart_timer_func()
first to terminate the chans that free the tx_descriptor memory, then
access the tx->flags, which cause kmem_cache_alloc() failed to allocate
the freed memory. So remove the unnecessary .async_tx_ack().

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
drivers/tty/serial/fsl_lpuart.c

index 54f0aeb..ceaf709 100644 (file)
@@ -840,7 +840,6 @@ static void lpuart_dma_rx_complete(void *arg)
        struct dma_tx_state state;
        int count;
 
-       async_tx_ack(sport->dma_rx_desc);
        mod_timer(&sport->lpuart_timer, jiffies + sport->dma_rx_timeout);
 
        spin_lock_irqsave(&sport->port.lock, flags);
@@ -871,7 +870,6 @@ static void lpuart_timer_func(unsigned long data)
        dmaengine_tx_status(sport->dma_rx_chan, sport->dma_rx_cookie, &state);
        dmaengine_terminate_all(sport->dma_rx_chan);
        count = sport->rxdma_len - state.residue;
-       async_tx_ack(sport->dma_rx_desc);
 
        spin_lock_irqsave(&sport->port.lock, flags);