title: DMA cache coherent contiguous allocation
body: <p>I was looking at allocating a buffer for a DMA transaction. I read that there are two ways of doing this - coherent mappings or streaming mappings.</p>
  
  <p>Now, we want cache coherent buffers. However, we are not doing any scatter/gather so we want the benefits of the <code>dma_map_single</code> call. We have set aside some contiguous memory in the bootargs so we always have enough contiguous memory available.</p>
  
  <p>So I was wondering, can we call <code>dma_alloc_coherent</code> and then <code>dma_map_single</code> after it with the virtual address that <code>dma_alloc_coherent</code> returns? The returned physical address of the map single would then be set as the dma handle that <code>dma_alloc_coherent</code> returned in its call.</p>
  
  <p>Does this make sense? Or is it superfluous/incorrect to do it this way?</p>