From de79fc71eefd56f2969432b7dc7c7e8e8ac93afa Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Mon, 29 Oct 2012 11:54:38 -0700 Subject: [PATCH] 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 non consistent memory. Change-Id: I7585fe3ce804cf321a5585c3d93deb7a7c95045c Signed-off-by: Laura Abbott Signed-off-by: Charan Teja Reddy Signed-off-by: Vijayanand Jitta Signed-off-by: Qingqing Zhou --- arch/arm/mm/dma-mapping.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 3e86a63504f1..57f4f03abd7b 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -605,9 +605,12 @@ static void __free_from_contiguous(struct device *dev, struct page *page, static inline pgprot_t __get_dma_pgprot(unsigned long attrs, pgprot_t prot) { - prot = (attrs & DMA_ATTR_WRITE_COMBINE) ? - pgprot_writecombine(prot) : - pgprot_dmacoherent(prot); + if (attrs & DMA_ATTR_WRITE_COMBINE) + prot = pgprot_writecombine(prot); + /* if non-consistent just pass back what was given */ + else if ((attrs & DMA_ATTR_NON_CONSISTENT) == 0) + prot = pgprot_dmacoherent(prot); + return prot; }