sched/preempt, sh: kmap_coherent relies on disabled preemption
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Mon, 29 Feb 2016 08:19:24 +0000 (09:19 +0100)
committerRich Felker <dalias@libc.org>
Thu, 17 Mar 2016 19:46:14 +0000 (19:46 +0000)
kmap_coherent needs disabled preemption to not schedule in the critical
section, just like kmap_coherent on mips and kmap_atomic in general.

Fixes: 8222dbe21e79 "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>
arch/sh/mm/kmap.c

index ec29e14ec5a85643b600952b3140f013ada5d258..bf25d7c79a2d82d5dd6b26ca95b79a72643f2791 100644 (file)
@@ -36,6 +36,7 @@ void *kmap_coherent(struct page *page, unsigned long addr)
 
        BUG_ON(!test_bit(PG_dcache_clean, &page->flags));
 
+       preempt_disable();
        pagefault_disable();
 
        idx = FIX_CMAP_END -
@@ -64,4 +65,5 @@ void kunmap_coherent(void *kvaddr)
        }
 
        pagefault_enable();
+       preempt_enable();
 }
This page took 0.024884 seconds and 5 git commands to generate.