summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorRobin Gong <b38343@freescale.com>2014-12-08 17:30:40 +0800
committerNitin Garg <nitin.garg@nxp.com>2016-01-14 10:59:35 -0600
commit31b3d3d83de18570774d1173d9654836c8236930 (patch)
tree57dc6d647569af7c329cdf2cf4f4a63a0433f516 /drivers/dma
parentae254208a0079dbacee9acc14eb4a6369cd2ee1c (diff)
MLK-9768: dma: imx-sdma: fix UART loopback random failed
For UART, we need use old chn_real_count to know the real rx count even in cylic dma mode, because UART driver use cyclic mode to increase performance without any data loss. Signed-off-by: Robin Gong <b38343@freescale.com> (cherry picked from commit 398cee2ad110c4f183e553af0564fbdcbe8548cb)
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/imx-sdma.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index d2c1f873fca9..0e35d82c22c5 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1359,7 +1359,12 @@ static enum dma_status sdma_tx_status(struct dma_chan *chan,
struct sdma_channel *sdmac = to_sdma_chan(chan);
u32 residue;
- if (sdmac->flags & IMX_DMA_SG_LOOP)
+ /*
+ * For uart rx data may not receive fully, use old chn_real_count to
+ * know the real rx count.
+ */
+ if ((sdmac->flags & IMX_DMA_SG_LOOP) &&
+ (sdmac->peripheral_type != IMX_DMATYPE_UART))
residue = (sdmac->num_bd - sdmac->buf_tail) * sdmac->period_len;
else
residue = sdmac->chn_count - sdmac->chn_real_count;