current meaning of BUS_DMA_COHERENT

John Wehle john at feith.com
Fri Mar 20 05:35:52 UTC 2015


The bus_dmamap_create manual page says:

  Attempt to map the memory loaded with this map such that cache sync
  operations are as cheap as possible.
  ...
  Use of this flag does not remove the requirement of using bus_dmamap_sync()

However busdma_machdep-v6.c for ARM has the comment:

 * Create a cache of buffers in uncacheable memory, to implement the
 * BUS_DMA_COHERENT (and potentially BUS_DMA_NOCACHE) flag.

Is the manual page out of date?  Does FreeBSD now guarentee that memory
allocated by bus_dmamem_alloc using BUS_DMA_COHERENT doesn't require
bus_dmamap_sync operations?

Part of my concern is that there appears to be existing FreeBSD device
driver code that assumes BUS_DMA_COHERENT means uncacheable memory
(i.e. bus_dmamap_sync is unnecessary) which I thought was indicated
by BUS_DMA_NOCACHE, not BUS_DMA_COHERENT.

-- John



More information about the freebsd-arm mailing list