csky: fixup abiv2 mmap(... O_SYNC) failed.
authorGuo Ren <ren_guo@c-sky.com>
Sun, 30 Dec 2018 13:47:28 +0000 (21:47 +0800)
committerGuo Ren <ren_guo@c-sky.com>
Mon, 31 Dec 2018 02:56:45 +0000 (10:56 +0800)
Glibc function mmap(... O_SYNC) will make page to _PAGE_UNCACHE +
_PAGE_SO and strong-order page couldn't support unalignment access.
So remove _PAGE_SO from _PAGE_UNCACHE, also sync abiv1 with the macro
of _PAGE_SO.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Reported-by: Liu Renwei <Renwei.Liu@verisilicon.com>
Tested-by: Yuan Qiyun <qiyun_yuan@c-sky.com>
arch/csky/abiv1/inc/abi/pgtable-bits.h
arch/csky/abiv2/inc/abi/pgtable-bits.h
arch/csky/mm/ioremap.c

index 455075b5db0da5391a8d50b7d1d18409b613ab11..d605445aad9ad4362f51d3ad41f47707c1946a07 100644 (file)
@@ -26,6 +26,7 @@
 
 #define _PAGE_CACHE            (3<<9)
 #define _PAGE_UNCACHE          (2<<9)
+#define _PAGE_SO               _PAGE_UNCACHE
 
 #define _CACHE_MASK            (7<<9)
 
index b20ae19702e3c5fd1153f3215a3a052da09427bc..137f7932c83b3be191e9971da02bce7270b9ad62 100644 (file)
@@ -32,6 +32,6 @@
 #define _CACHE_MASK            _PAGE_CACHE
 
 #define _CACHE_CACHED          (_PAGE_VALID | _PAGE_CACHE | _PAGE_BUF)
-#define _CACHE_UNCACHED                (_PAGE_VALID | _PAGE_SO)
+#define _CACHE_UNCACHED                (_PAGE_VALID)
 
 #endif /* __ASM_CSKY_PGTABLE_BITS_H */
index 7ad3ff103f4a865ab48f533c1d721daef2d2ccf9..cb7c03e5cd218a4236d1cb686a2cc36f0e4f91ff 100644 (file)
@@ -30,7 +30,7 @@ void __iomem *ioremap(phys_addr_t addr, size_t size)
        vaddr = (unsigned long)area->addr;
 
        prot = __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE |
-                       _PAGE_GLOBAL | _CACHE_UNCACHED);
+                       _PAGE_GLOBAL | _CACHE_UNCACHED | _PAGE_SO);
 
        if (ioremap_page_range(vaddr, vaddr + size, addr, prot)) {
                free_vm_area(area);