Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85247b2f authored by Laura Abbott's avatar Laura Abbott Committed by Charan Teja Reddy
Browse files

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: default avatarLaura Abbott <lauraa@codeaurora.org>
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent dcf5ac4c
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -662,9 +662,14 @@ 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);
	else if (attrs & DMA_ATTR_STRONGLY_ORDERED)
		prot = pgprot_stronglyordered(prot);
	/* if non-consistent just pass back what was given */
	else if ((attrs & DMA_ATTR_NON_CONSISTENT) == 0)
		prot = pgprot_dmacoherent(prot);

	return prot;
}