From d7ffb9329012a517575e4c4d49480b6ce0d1529e Mon Sep 17 00:00:00 2001 From: Huang Shijie Date: Thu, 22 Nov 2012 15:06:30 +0800 Subject: serial: mxs-auart: unmap the scatter list before we copy the data We should first unmap the DMA scatter list for receiving data, and then copy the data from the DMA buffer. The old code misses unmap the scatter list for RX. This patch fixes it. Signed-off-by: Huang Shijie Tested-by: Lauri Hintsala Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/mxs-auart.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c index f56d6b9..6db23b0 100644 --- a/drivers/tty/serial/mxs-auart.c +++ b/drivers/tty/serial/mxs-auart.c @@ -461,6 +461,8 @@ static void dma_rx_callback(void *arg) int count; u32 stat; + dma_unmap_sg(s->dev, &s->rx_sgl, 1, DMA_FROM_DEVICE); + stat = readl(s->port.membase + AUART_STAT); stat &= ~(AUART_STAT_OERR | AUART_STAT_BERR | AUART_STAT_PERR | AUART_STAT_FERR); -- cgit v1.1