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 <lauraa@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Signed-off-by: Qingqing Zhou <qqzhou@codeaurora.org>
This commit is contained in:
Laura Abbott 2012-10-29 11:54:38 -07:00 • committed by Gerrit - the friendly Code Review server
commit de79fc71ee

View file

@ -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;
}