swiotlb: add support for non-coherent DMA
authorChristoph Hellwig <hch@lst.de>
Fri, 19 Oct 2018 06:51:53 +0000 (08:51 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 19 Oct 2018 06:53:05 +0000 (08:53 +0200)
commita4a4330db46a17289cf2ca5f9fb153d536267b97
treed3e807bd0fe1d8fb38c800f0696711b8423d57ff
parentfafadcd16595c1df82df399f62421718ec9bf70a
swiotlb: add support for non-coherent DMA

Handle architectures that are not cache coherent directly in the main
swiotlb code by calling arch_sync_dma_for_{device,cpu} in all the right
places from the various dma_map/unmap/sync methods when the device is
non-coherent.

Because swiotlb now uses dma_direct_alloc for the coherent allocation
that side is already taken care of by the dma-direct code calling into
arch_dma_{alloc,free} for devices that are non-coherent.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
kernel/dma/swiotlb.c