summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura Abbott <lauraa@codeaurora.org>2012-10-29 11:54:38 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:10:56 -0700
commit2ccdb600581c6971db67c3572add391a9ac503ce (patch)
tree1de56d10f4d221b205dec09d8c16f96c87c4ef2c
parent86a828d8207435b6c2266c06ed6578c64b0afa9e (diff)
arm: dma: Expand the page protection attributes
Currently, the decision on which page protection to use is limited to writecombine and coherent. Expand to include strongly ordered memory and non consistent memory. Change-Id: I7585fe3ce804cf321a5585c3d93deb7a7c95045c Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
-rw-r--r--arch/arm/mm/dma-mapping.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 00e001424ab4..d049be34fcee 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -606,9 +606,14 @@ static void __free_from_contiguous(struct device *dev, struct page *page,
static inline pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot)
{
- prot = dma_get_attr(DMA_ATTR_WRITE_COMBINE, attrs) ?
- pgprot_writecombine(prot) :
- pgprot_dmacoherent(prot);
+ if (dma_get_attr(DMA_ATTR_WRITE_COMBINE, attrs))
+ prot = pgprot_writecombine(prot);
+ else if (dma_get_attr(DMA_ATTR_STRONGLY_ORDERED, attrs))
+ prot = pgprot_stronglyordered(prot);
+ /* if non-consistent just pass back what was given */
+ else if (!dma_get_attr(DMA_ATTR_NON_CONSISTENT, attrs))
+ prot = pgprot_dmacoherent(prot);
+
return prot;
}