Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1513570 > unrolled thread

[PATCH] dmaengine: pl330: Handle xferred count if DMAMOV hasn't finished

Started byStephen Barber <smbarber@chromium.org>
First post2016-11-02 00:50 +0100
Last post2016-11-02 00:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] dmaengine: pl330: Handle xferred count if DMAMOV hasn't finished Stephen Barber <smbarber@chromium.org> - 2016-11-02 00:50 +0100

#1513570 — [PATCH] dmaengine: pl330: Handle xferred count if DMAMOV hasn't finished

FromStephen Barber <smbarber@chromium.org>
Date2016-11-02 00:50 +0100
Subject[PATCH] dmaengine: pl330: Handle xferred count if DMAMOV hasn't finished
Message-ID<syQYx-6Tf-3@gated-at.bofh.it>
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>
---
 drivers/dma/pl330.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 030fe05..458a712 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;
 }
 
-- 
2.8.0.rc3.226.g39d4020

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web