summaryrefslogtreecommitdiff
path: root/drivers/dma/pl330.c
diff options
context:
space:
mode:
authorStephen Barber <smbarber@chromium.org>2016-11-01 16:44:27 -0700
committerVinod Koul <vinod.koul@intel.com>2016-11-14 10:30:06 +0530
commitc44da03dd517c11c2b3525937b0a241fc1c69399 (patch)
treea20a9a2e69c0dfc232978911ee4ff480aeb8729c /drivers/dma/pl330.c
parent9a1a34f3c8612864f18a71febc134957a03eca64 (diff)
dmaengine: pl330: Handle xferred count if DMAMOV hasn't finished
After executing DMAGO it's possible that a request can come in for the current xferred count, but if that happens too soon then DMAMOV SAR/DAR may not have yet completed. If that happens, we should explicitly return 0 since nothing has been transferred yet. Signed-off-by: Stephen Barber <smbarber@chromium.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/pl330.c')
-rw-r--r--drivers/dma/pl330.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 030fe05ed43b..458a712a9da1 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2263,6 +2263,11 @@ static int pl330_get_current_xferred_count(struct dma_pl330_chan *pch,
}
pm_runtime_mark_last_busy(pch->dmac->ddma.dev);
pm_runtime_put_autosuspend(pl330->ddma.dev);
+
+ /* If DMAMOV hasn't finished yet, SAR/DAR can be zero */
+ if (!val)
+ return 0;
+
return val - addr;
}