Skip to content

Commit

Permalink
csky: fixup abiv2 mmap(... O_SYNC) failed.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reported-by: Liu Renwei <[email protected]>
Tested-by: Yuan Qiyun <[email protected]>
  • Loading branch information
guoren83 committed Dec 31, 2018
1 parent d770b25 commit 2b070cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/csky/abiv1/inc/abi/pgtable-bits.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#define _PAGE_CACHE (3<<9)
#define _PAGE_UNCACHE (2<<9)
#define _PAGE_SO _PAGE_UNCACHE

#define _CACHE_MASK (7<<9)

Expand Down
2 changes: 1 addition & 1 deletion arch/csky/abiv2/inc/abi/pgtable-bits.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
2 changes: 1 addition & 1 deletion arch/csky/mm/ioremap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2b070cc

Please sign in to comment.