Skip to content

Commit b15d53d

Browse files
David HildenbrandRich Felker
authored andcommitted
sched/preempt, sh: kmap_coherent relies on disabled preemption
kmap_coherent needs disabled preemption to not schedule in the critical section, just like kmap_coherent on mips and kmap_atomic in general. Fixes: 8222dbe "sched/preempt, mm/fault: Decouple preemption from the page fault logic" Reported-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Tested-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Rich Felker <dalias@libc.org>
1 parent 044b81f commit b15d53d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/sh/mm/kmap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ void *kmap_coherent(struct page *page, unsigned long addr)
3636

3737
BUG_ON(!test_bit(PG_dcache_clean, &page->flags));
3838

39+
preempt_disable();
3940
pagefault_disable();
4041

4142
idx = FIX_CMAP_END -
@@ -64,4 +65,5 @@ void kunmap_coherent(void *kvaddr)
6465
}
6566

6667
pagefault_enable();
68+
preempt_enable();
6769
}

0 commit comments

Comments
 (0)