Skip to content

Commit

Permalink
serial: mxs-auart: unmap the scatter list before we copy the data
Browse files Browse the repository at this point in the history
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@freescale.com>
Tested-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Huang Shijie authored and Greg Kroah-Hartman committed Nov 26, 2012
1 parent a591944 commit d7ffb93
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/tty/serial/mxs-auart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d7ffb93

Please sign in to comment.