@@ -122,6 +122,9 @@ extern pgprot_t pgprot_s2_device;
#define pgprot_writecombine(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE)
+#define pgprot_writeback(prot) \
+ __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_WRITEBACK)
+
#define pgprot_stronglyordered(prot) \
__pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED)
@@ -633,9 +633,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);
+ else if (attrs & DMA_ATTR_NON_CONSISTENT)
+ prot = pgprot_writeback(prot);
+ else
+ prot = pgprot_dmacoherent(prot);
return prot;
}
This is obviously a hack. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> --- arch/arm/include/asm/pgtable.h | 3 +++ arch/arm/mm/dma-mapping.c | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-)