Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

common: DMA-mapping: add DMA_ATTR_FORCE_CONTIGUOUS attribute

This patch adds DMA_ATTR_FORCE_CONTIGUOUS attribute to the DMA-mapping
subsystem.

By default DMA-mapping subsystem is allowed to assemble the buffer
allocated by dma_alloc_attrs() function from individual pages if it can
be mapped as contiguous chunk into device dma address space. By
specifing this attribute the allocated buffer is forced to be contiguous
also in physical memory.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

authored by

Marek Szyprowski and committed by
Inki Dae
4b9347dc e7783ba3

+10
+9
Documentation/DMA-attributes.txt
··· 91 91 dma_unmap_{single,page,sg} functions family to force buffer to stay in 92 92 device domain after releasing a mapping for it. Use this attribute with 93 93 care! 94 + 95 + DMA_ATTR_FORCE_CONTIGUOUS 96 + ------------------------- 97 + 98 + By default DMA-mapping subsystem is allowed to assemble the buffer 99 + allocated by dma_alloc_attrs() function from individual pages if it can 100 + be mapped as contiguous chunk into device dma address space. By 101 + specifing this attribute the allocated buffer is forced to be contiguous 102 + also in physical memory.
+1
include/linux/dma-attrs.h
··· 17 17 DMA_ATTR_NON_CONSISTENT, 18 18 DMA_ATTR_NO_KERNEL_MAPPING, 19 19 DMA_ATTR_SKIP_CPU_SYNC, 20 + DMA_ATTR_FORCE_CONTIGUOUS, 20 21 DMA_ATTR_MAX, 21 22 }; 22 23