From c1386f095a2c25f928dcea19e356e6d87b41bd40 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 29 Oct 2012 13:08:03 -0700 Subject: [PATCH] common: DMA-mapping: Add strongly ordered memory attribute Strongly ordered memory is occasionally needed for some DMA allocations for specialized use cases. Add the corresponding DMA attribute. Change-Id: Idd9e756c242ef57d6fa6700e51cc38d0863b760d Signed-off-by: Laura Abbott Signed-off-by: Mitchel Humpherys --- Documentation/DMA-attributes.txt | 9 +++++++++ include/linux/dma-attrs.h | 1 + 2 files changed, 10 insertions(+) diff --git a/Documentation/DMA-attributes.txt b/Documentation/DMA-attributes.txt index 725580de75af..d62d0c6a2367 100644 --- a/Documentation/DMA-attributes.txt +++ b/Documentation/DMA-attributes.txt @@ -67,3 +67,12 @@ set on each call. Since it is optional for platforms to implement DMA_ATTR_NO_KERNEL_MAPPING, those that do not will simply ignore the attribute and exhibit default behavior. + +DMA_ATTR_STRONGLY_ORDERED +------------------------- + +DMA_ATTR_STRONGLY_ORDERED allocates memory with a very restrictive type +of mapping (no unaligned accesses, no re-ordering, no write merging, no +buffering, no pre-fetching). This has severe performance penalties and +should not be used for general purpose DMA allocations. It should only +be used if one of the restrictions on strongly ordered memory is required. diff --git a/include/linux/dma-attrs.h b/include/linux/dma-attrs.h index a37c10cc51c5..18513e37a854 100644 --- a/include/linux/dma-attrs.h +++ b/include/linux/dma-attrs.h @@ -16,6 +16,7 @@ enum dma_attr { DMA_ATTR_WRITE_COMBINE, DMA_ATTR_NON_CONSISTENT, DMA_ATTR_NO_KERNEL_MAPPING, + DMA_ATTR_STRONGLY_ORDERED, DMA_ATTR_MAX, };