summaryrefslogtreecommitdiffstats
path: root/drivers/dma/tegra186-gpc-dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/tegra186-gpc-dma.c')
-rw-r--r--drivers/dma/tegra186-gpc-dma.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/dma/tegra186-gpc-dma.c b/drivers/dma/tegra186-gpc-dma.c
index 75af3488a..e70b7c41d 100644
--- a/drivers/dma/tegra186-gpc-dma.c
+++ b/drivers/dma/tegra186-gpc-dma.c
@@ -742,6 +742,9 @@ static int tegra_dma_get_residual(struct tegra_dma_channel *tdc)
bytes_xfer = dma_desc->bytes_xfer +
sg_req[dma_desc->sg_idx].len - (wcount * 4);
+ if (dma_desc->bytes_req == bytes_xfer)
+ return 0;
+
residual = dma_desc->bytes_req - (bytes_xfer % dma_desc->bytes_req);
return residual;