]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/blob - rt-patches/0201-mm-rt-Fix-generic-kmap_atomic-for-RT.patch
Fix memguard and related syscalls
[hercules2020/nv-tegra/linux-4.4.git] / rt-patches / 0201-mm-rt-Fix-generic-kmap_atomic-for-RT.patch
1 From 6b8e29bf24760f62db2632f70a7aa0cda216a36e Mon Sep 17 00:00:00 2001
2 From: Thomas Gleixner <tglx@linutronix.de>
3 Date: Sat, 19 Sep 2015 10:15:00 +0200
4 Subject: [PATCH 201/366] mm: rt: Fix generic kmap_atomic for RT
5
6 The update to 4.1 brought in the mainline variant of the pagefault
7 disable distangling from preempt count. That introduced a
8 preempt_disable/enable pair in the generic kmap_atomic/kunmap_atomic
9 implementations which got not converted to the _nort() variant.
10
11 That results in massive 'scheduling while atomic/sleeping function
12 called from invalid context' splats.
13
14 Fix that up.
15
16 Reported-and-tested-by: Juergen Borleis <jbe@pengutronix.de>
17 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18 ---
19  include/linux/highmem.h | 4 ++--
20  1 file changed, 2 insertions(+), 2 deletions(-)
21
22 diff --git a/include/linux/highmem.h b/include/linux/highmem.h
23 index 396d5c4..2f56829 100644
24 --- a/include/linux/highmem.h
25 +++ b/include/linux/highmem.h
26 @@ -65,7 +65,7 @@ static inline void kunmap(struct page *page)
27  
28  static inline void *kmap_atomic(struct page *page)
29  {
30 -       preempt_disable();
31 +       preempt_disable_nort();
32         pagefault_disable();
33         return page_address(page);
34  }
35 @@ -74,7 +74,7 @@ static inline void *kmap_atomic(struct page *page)
36  static inline void __kunmap_atomic(void *addr)
37  {
38         pagefault_enable();
39 -       preempt_enable();
40 +       preempt_enable_nort();
41  }
42  
43  #define kmap_atomic_pfn(pfn)   kmap_atomic(pfn_to_page(pfn))
44 -- 
45 1.9.1
46