[PATCH 2/2] serial: mxs-auart: unmap the scatter list before we copy the data

From: Huang Shijie
Date: Thu Nov 22 2012 - 13:51:29 EST


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 <b32955@xxxxxxxxxxxxx>
Tested-by: Lauri Hintsala <lauri.hintsala@xxxxxxxxxxxx>
---
drivers/tty/serial/mxs-auart.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 2342b0d..6b51448 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);
--
1.7.0.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/