aboutsummaryrefslogtreecommitdiffstats
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 88547a23825b1..3642508e88bb2 100644
--- a/drivers/dma/tegra186-gpc-dma.c
+++ b/drivers/dma/tegra186-gpc-dma.c
@@ -746,6 +746,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;