Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/vchiq/dist/interface/vchiq_arm Correct some...
details: https://anonhg.NetBSD.org/src/rev/43759576f7b6
branches: trunk
changeset: 328101:43759576f7b6
user: skrll <skrll%NetBSD.org@localhost>
date: Wed Mar 26 16:07:15 2014 +0000
description:
Correct some bus_dma operations.
diffstat:
sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c | 20 +++++-----
1 files changed, 10 insertions(+), 10 deletions(-)
diffs (58 lines):
diff -r cf7534af0276 -r 43759576f7b6 sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c
--- a/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c Wed Mar 26 15:55:43 2014 +0000
+++ b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_2835_arm.c Wed Mar 26 16:07:15 2014 +0000
@@ -100,7 +100,7 @@
dma_nsegs = __arraycount(dma_segs);
err = bus_dmamem_alloc(&bcm2835_bus_dma_tag,
g_slot_mem_size + frag_mem_size, PAGE_SIZE, 0,
- dma_segs, dma_nsegs, &dma_nsegs, BUS_DMA_COHERENT | BUS_DMA_WAITOK);
+ dma_segs, dma_nsegs, &dma_nsegs, BUS_DMA_WAITOK);
if (err) {
vchiq_log_error(vchiq_core_log_level, "Unable to allocate channel memory");
err = -ENOMEM;
@@ -289,7 +289,7 @@
goto fail1;
ret = bus_dmamem_map(&bcm2835_bus_dma_tag, bi->pagelist_sgs, nsegs,
- bi->pagelist_size, &bi->pagelist, BUS_DMA_WAITOK);
+ bi->pagelist_size, &bi->pagelist, BUS_DMA_COHERENT | BUS_DMA_WAITOK);
if (ret != 0)
goto fail2;
@@ -378,7 +378,7 @@
bulk->remote_data = bi;
bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->pagelist_map, 0,
- bi->pagelist_size, BUS_DMASYNC_PREREAD);
+ bi->pagelist_size, BUS_DMASYNC_PREWRITE);
bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->dmamap, 0, bi->size,
pagelist->type == PAGELIST_WRITE ?
@@ -420,6 +420,13 @@
BULKINFO_T *bi = bulk->remote_data;
PAGELIST_T *pagelist = bi->pagelist;
+ bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->pagelist_map, 0,
+ bi->pagelist_size, BUS_DMASYNC_POSTWRITE);
+
+ bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->dmamap, 0, bi->size,
+ pagelist->type == PAGELIST_WRITE ?
+ BUS_DMASYNC_POSTWRITE : BUS_DMASYNC_POSTREAD);
+
/* Deal with any partial cache lines (fragments) */
if (pagelist->type >= PAGELIST_READ_WITH_FRAGMENTS) {
FRAGMENTS_T *fragments = g_fragments_base +
@@ -469,13 +476,6 @@
up(&g_free_fragments_mutex);
up(&g_free_fragments_sema);
}
- bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->pagelist_map, 0,
- bi->pagelist_size, BUS_DMASYNC_POSTREAD);
-
- bus_dmamap_sync(&bcm2835_bus_dma_tag, bi->dmamap, 0, bi->size,
- pagelist->type == PAGELIST_WRITE ?
- BUS_DMASYNC_POSTWRITE : BUS_DMASYNC_POSTREAD);
-
bus_dmamap_unload(&bcm2835_bus_dma_tag, bi->dmamap);
bus_dmamap_destroy(&bcm2835_bus_dma_tag, bi->dmamap);
if (IS_USER_ADDRESS(bi->buf))
Home |
Main Index |
Thread Index |
Old Index