Skip to content

Commit 2b070cc

Browse files
committed
csky: fixup abiv2 mmap(... O_SYNC) failed.
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>
1 parent d770b25 commit 2b070cc

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

arch/csky/abiv1/inc/abi/pgtable-bits.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#define _PAGE_CACHE (3<<9)
2828
#define _PAGE_UNCACHE (2<<9)
29+
#define _PAGE_SO _PAGE_UNCACHE
2930

3031
#define _CACHE_MASK (7<<9)
3132

arch/csky/abiv2/inc/abi/pgtable-bits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
#define _CACHE_MASK _PAGE_CACHE
3333

3434
#define _CACHE_CACHED (_PAGE_VALID | _PAGE_CACHE | _PAGE_BUF)
35-
#define _CACHE_UNCACHED (_PAGE_VALID | _PAGE_SO)
35+
#define _CACHE_UNCACHED (_PAGE_VALID)
3636

3737
#endif /* __ASM_CSKY_PGTABLE_BITS_H */

arch/csky/mm/ioremap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void __iomem *ioremap(phys_addr_t addr, size_t size)
3030
vaddr = (unsigned long)area->addr;
3131

3232
prot = __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE |
33-
_PAGE_GLOBAL | _CACHE_UNCACHED);
33+
_PAGE_GLOBAL | _CACHE_UNCACHED | _PAGE_SO);
3434

3535
if (ioremap_page_range(vaddr, vaddr + size, addr, prot)) {
3636
free_vm_area(area);

0 commit comments

Comments
 (0)