summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-10-24 23:14:38 +0200
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-10-24 23:14:38 +0200
commit39125f647c27a19abf85b25c753fc97832708d38 (patch)
tree2556a8c897498802281d974909d0d36978303e0f
parent95b5fb80dbe71ef58d235c26c9e73849fb07f84c (diff)
downloadpcitool-39125f647c27a19abf85b25c753fc97832708d38.tar.gz
pcitool-39125f647c27a19abf85b25c753fc97832708d38.tar.bz2
pcitool-39125f647c27a19abf85b25c753fc97832708d38.tar.xz
pcitool-39125f647c27a19abf85b25c753fc97832708d38.zip
Fix DMA synchronization for writes as well
-rw-r--r--dma/nwl_engine.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dma/nwl_engine.c b/dma/nwl_engine.c
index 1fc147f..037ab02 100644
--- a/dma/nwl_engine.c
+++ b/dma/nwl_engine.c
@@ -242,7 +242,10 @@ int dma_nwl_write_fragment(pcilib_dma_context_t *vctx, pcilib_dma_engine_t dma,
}
void *buf = pcilib_kmem_get_block_ua(ctx->pcilib, info->pages, bufnum);
+
+ pcilib_kmem_sync_block(ctx->pcilib, info->pages, PCILIB_KMEM_SYNC_FROMDEVICE, bufnum);
memcpy(buf, data, block_size);
+ pcilib_kmem_sync_block(ctx->pcilib, info->pages, PCILIB_KMEM_SYNC_TODEVICE, bufnum);
err = dma_nwl_push_buffer(ctx, info, block_size, (flags&PCILIB_DMA_FLAG_EOP)&&((pos + block_size) == size), timeout);
if (err) {