On Fri, 27 Oct 2017, Mouse wrote: > >> But I'm not sure what sort of sync calls I need to make. [...] > > You want to do a bus_dmamap_sync(BUS_DMASYNC_POSTREAD) [...] > > In the NIC example above, you map the ring buffer with > > BUS_DMA_COHERENT, fill it up and do a > > bus_dmamap_sync(BUS_DMASYNC_PREREAD). When you want to read it > > (usually after getting an interrupt) you do > > bus_dmamap_sync(BUS_DMASYNC_POSTREAD) before doing the read. > > Don't you need to PREWRITE after filling it? Based on the mental > models I've formed, that feels necessary.
You'd want to do a PREWRITE and a POSTWRITE, but since writing wasn't part of your usage model I skipped that part. Eduardo
