]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Add support for DMA_ATTR_FORCE_CONTIGUOUS to IOMMU
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 7 Mar 2017 17:43:32 +0000 (18:43 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 22 Mar 2017 17:21:37 +0000 (17:21 +0000)
commit8200b6ac5576f78c021dd68ccfc848af3a3600e0
treeb75296c63df365b8811c3235258d63d23b83b54d
parent076ec6441d823d030d6cf66a853bd6031d81eb14
arm64: Add support for DMA_ATTR_FORCE_CONTIGUOUS to IOMMU

Add support for allocating physically contiguous DMA buffers on arm64
systems with an IOMMU.  This can be useful when two or more devices
with different memory requirements are involved in buffer sharing.

Note that as this uses the CMA allocator, setting the
DMA_ATTR_FORCE_CONTIGUOUS attribute has a runtime-dependency on
CONFIG_DMA_CMA, just like on arm32.

For arm64 systems using swiotlb, no changes are needed to support the
allocation of physically contiguous DMA buffers:
  - swiotlb always uses physically contiguous buffers (up to
    IO_TLB_SEGSIZE = 128 pages),
  - arm64's __dma_alloc_coherent() already calls
    dma_alloc_from_contiguous() when CMA is available.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/dma-mapping.c