diff options
author | adrian <adrian@FreeBSD.org> | 2015-10-31 00:29:26 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2015-10-31 00:29:26 +0000 |
commit | 943c3df264903af110f281f5ae4a0bf569d540ea (patch) | |
tree | 0694e463babdf8f730366c62fd003a110f7bee5f | |
parent | f8c53f2a3446f356dff0b034465d632507ab44fc (diff) | |
download | FreeBSD-src-943c3df264903af110f281f5ae4a0bf569d540ea.zip FreeBSD-src-943c3df264903af110f281f5ae4a0bf569d540ea.tar.gz |
mips: do mips_sync() on sync operations to uncachable memory.
mips24k/mips74k document that we need an explicit SYNC so to order
things correctly, even with access to uncachable memory.
We were doing calls to SYNC in the cache ops (inv, wbinv) but we
weren't doing it for uncachable memory.
-rw-r--r-- | sys/mips/mips/busdma_machdep.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/mips/mips/busdma_machdep.c b/sys/mips/mips/busdma_machdep.c index 247335e..d9eb9d4 100644 --- a/sys/mips/mips/busdma_machdep.c +++ b/sys/mips/mips/busdma_machdep.c @@ -1220,11 +1220,12 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus_dmamap_t map, bus_dmasync_op_t op) if (STAILQ_FIRST(&map->bpages)) _bus_dmamap_sync_bp(dmat, map, op); - if (dmat->flags & BUS_DMA_COHERENT) - return; - - if (map->flags & DMAMAP_UNCACHEABLE) + if ((dmat->flags & BUS_DMA_COHERENT) || + (map->flags & DMAMAP_UNCACHEABLE)) { + if (op & BUS_DMASYNC_PREWRITE) + mips_sync(); return; + } aligned = (map->flags & DMAMAP_CACHE_ALIGNED) ? 1 : 0; |