summaryrefslogtreecommitdiffstats
path: root/arch/csky/include/asm/pgtable.h
diff options
context:
space:
mode:
authorGuo Ren <ren_guo@c-sky.com>2019-07-30 08:43:22 +0200
committerGuo Ren <ren_guo@c-sky.com>2019-07-31 05:05:25 +0200
commit7f80fe207de9602aaff028c79345caa68c90cd31 (patch)
tree4052003f821439f67f8be27a26c016075cf48e7d /arch/csky/include/asm/pgtable.h
parentcsky: Fixup mb() synchronization problem (diff)
downloadlinux-7f80fe207de9602aaff028c79345caa68c90cd31.tar.xz
linux-7f80fe207de9602aaff028c79345caa68c90cd31.zip
csky: Fixup dma_alloc_coherent with PAGE_SO attribute
This bug is from commit: 2b070ccdf8c0 (fixup abiv2 mmap(... O_SYNC) failed). In that patch we remove the _PAGE_SO for memory noncache mapping and this will cause problem when drivers use dma descriptors to control the transcations without dma_w/rmb(). After referencing other archs' implementation, pgprot_writecombine is introduced for mmap(... O_SYNC). Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Diffstat (limited to 'arch/csky/include/asm/pgtable.h')
-rw-r--r--arch/csky/include/asm/pgtable.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/csky/include/asm/pgtable.h b/arch/csky/include/asm/pgtable.h
index c429a6f347de..fc19ba446d62 100644
--- a/arch/csky/include/asm/pgtable.h
+++ b/arch/csky/include/asm/pgtable.h
@@ -258,6 +258,16 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot)
{
unsigned long prot = pgprot_val(_prot);
+ prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED | _PAGE_SO;
+
+ return __pgprot(prot);
+}
+
+#define pgprot_writecombine pgprot_writecombine
+static inline pgprot_t pgprot_writecombine(pgprot_t _prot)
+{
+ unsigned long prot = pgprot_val(_prot);
+
prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED;
return __pgprot(prot);