[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1526373963-12417-4-git-send-email-vincentc@andestech.com>
Date: Tue, 15 May 2018 16:46:03 +0800
From: Vincent Chen <vincentc@...estech.com>
To: <linux-kernel@...r.kernel.org>, <green.hu@...il.com>,
<greentime@...estech.com>, <arnd@...db.de>
CC: <deanbo422@...il.com>, <vincentc@...estech.com>
Subject: [PATCH 3/3] 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@...estech.com>
---
arch/nds32/mm/cacheflush.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/nds32/mm/cacheflush.c b/arch/nds32/mm/cacheflush.c
index acfdb45..c97caaf 100644
--- a/arch/nds32/mm/cacheflush.c
+++ b/arch/nds32/mm/cacheflush.c
@@ -156,11 +156,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);
--
1.7.1
Powered by blists - more mailing lists