Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee5e7c10 authored by Robin Gong's avatar Robin Gong Committed by Greg Kroah-Hartman
Browse files

serial: imx: start rx_dma once RXFIFO is not empty



Start rx_dma once RXFIFO is not empty that can avoid dma request lost
and causes data delay issue.

Signed-off-by: default avatarRobin Gong <b38343@freescale.com>
Signed-off-by: default avatarFugang Duan <B38611@freescale.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 068500e0
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -946,9 +946,22 @@ static void dma_rx_callback(void *data)
		tty_flip_buffer_push(port);

		start_rx_dma(sport);
	} else
	} else if (readl(sport->port.membase + USR2) & USR2_RDR) {
		/*
		 * start rx_dma directly once data in RXFIFO, more efficient
		 * than before:
		 *	1. call imx_rx_dma_done to stop dma if no data received
		 *	2. wait next  RDR interrupt to start dma transfer.
		 */
		start_rx_dma(sport);
	} else {
		/*
		 * stop dma to prevent too many IDLE event trigged if no data
		 * in RXFIFO
		 */
		imx_rx_dma_done(sport);
	}
}

static int start_rx_dma(struct imx_port *sport)
{