summaryrefslogtreecommitdiffstats
path: root/arch/nds32/mm
diff options
context:
space:
mode:
authorVincent Chen <vincentc@andestech.com>2018-05-14 12:56:35 +0200
committerGreentime Hu <greentime@andestech.com>2018-05-23 07:26:22 +0200
commitaaaaba57509526ce924f997d8690ee9e0c93945a (patch)
treed91740ec7b04af9b924c205ccb8876dcb9c3f442 /arch/nds32/mm
parentnds32: Flush the cache of the page at vmaddr instead of kaddr in flush_anon_page (diff)
downloadlinux-aaaaba57509526ce924f997d8690ee9e0c93945a.tar.xz
linux-aaaaba57509526ce924f997d8690ee9e0c93945a.zip
nds32: Disable local irq before calling cpu_dcache_wb_page in copy_user_highpage
In order to ensure that all data in source page has been written back to memory before copy_page, the local irq shall be disabled before calling cpu_dcache_wb_page(). In addition, removing unneeded page invalidation for 'to' page. Signed-off-by: Vincent Chen <vincentc@andestech.com> Reviewed-by: Greentime Hu <greentime@andestech.com> Signed-off-by: Greentime Hu <greentime@andestech.com>
Diffstat (limited to 'arch/nds32/mm')
-rw-r--r--arch/nds32/mm/cacheflush.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/nds32/mm/cacheflush.c b/arch/nds32/mm/cacheflush.c
index ae31cd2c21be..ce8fd34497bf 100644
--- a/arch/nds32/mm/cacheflush.c
+++ b/arch/nds32/mm/cacheflush.c
@@ -175,11 +175,9 @@ void copy_user_highpage(struct page *to, struct page *from,
pto = page_to_phys(to);
pfrom = page_to_phys(from);
+ local_irq_save(flags);
if (aliasing(vaddr, (unsigned long)kfrom))
cpu_dcache_wb_page((unsigned long)kfrom);
- if (aliasing(vaddr, (unsigned long)kto))
- cpu_dcache_inval_page((unsigned long)kto);
- local_irq_save(flags);
vto = kremap0(vaddr, pto);
vfrom = kremap1(vaddr, pfrom);
copy_page((void *)vto, (void *)vfrom);