Skip to content

Commit 477a0eb

Browse files
committed
LoongArch: Replace kmap_atomic() with kmap_local_page() in copy_user_highpage()
Replace kmap_atomic()/kunmap_atomic() calls with kmap_local_page()/ kunmap_local() in copy_user_highpage() which can be invoked from both preemptible and atomic context [1]. [1] https://lore.kernel.org/all/20201029222652.302358281@linutronix.de/ Suggested-by: Deepak R Varma <drv@mailo.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 449c275 commit 477a0eb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/loongarch/mm/init.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ void copy_user_highpage(struct page *to, struct page *from,
4343
{
4444
void *vfrom, *vto;
4545

46-
vto = kmap_atomic(to);
47-
vfrom = kmap_atomic(from);
46+
vfrom = kmap_local_page(from);
47+
vto = kmap_local_page(to);
4848
copy_page(vto, vfrom);
49-
kunmap_atomic(vfrom);
50-
kunmap_atomic(vto);
49+
kunmap_local(vfrom);
50+
kunmap_local(vto);
5151
/* Make sure this page is cleared on other CPU's too before using it */
5252
smp_wmb();
5353
}

0 commit comments

Comments
 (0)