summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0002-mm-Work-around-the-oops-below-by-disabling-split-ptl.patch
blob: 27e213748f47ed322794680f51982eab2f44fe7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
From e60420657d5f617d229c4a0969b48ad6ccb32391 Mon Sep 17 00:00:00 2001
From: Jacob Kroon <jacob.kroon@mikrodidakt.se>
Date: Wed, 24 Jan 2018 16:38:05 +0100
Subject: [PATCH 2/2] mm: Work around the oops below by disabling split ptlocks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[   12.468598] Unable to handle kernel NULL pointer dereference at virtual address 0000000c
[   12.476703] pgd = a9110000
[   12.479416] [0000000c] *pgd=390c2831, *pte=00000000, *ppte=00000000
[   12.485755] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
[   12.485761] Modules linked in:
[   12.485773] CPU: 2 PID: 625 Comm: X Not tainted 4.9.76-rt61-02456-g58db19f39d5a-dirty #187
[   12.485777] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[   12.485782] task: a8c48000 task.stack: a8ce6000
[   12.485804] PC is at rt_spin_lock+0x2c/0x60
[   12.485811] LR is at rt_spin_lock+0x14/0x60
[   12.485818] pc : [<8086bafc>]    lr : [<8086bae4>]    psr: 200c0013
[   12.485818] sp : a8ce7808  ip : a8ce7808  fp : a8ce781c
[   12.485823] r10: abfb9000  r9 : abfb9000  r8 : 00000000
[   12.485827] r7 : a8ce7878  r6 : 00000000  r5 : 00000000  r4 : 00000000
[   12.485831] r3 : 0000000c  r2 : a8c48000  r1 : 80a1c198  r0 : 00000000
[   12.485838] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   12.485844] Control: 10c5387d  Table: 3911004a  DAC: 00000051
[   12.485849] Process X (pid: 625, stack limit = 0xa8ce6210)
[   12.485853] Stack: (0xa8ce7808 to 0xa8ce8000)
[   12.485863] 7800:                   00000000 00000000 a8ce784c a8ce7820 80696ca8 8086badc
[   12.485872] 7820: 00000000 a8ce7878 b4a00000 a8708200 a8708200 a8715600 00000000 00000000
[   12.485880] 7840: a8ce7874 a8ce7850 80697f18 80696bf4 00000001 a8ce7850 a87082a0 a872e400
[   12.485889] 7860: 00000000 00000000 a8ce78ac a8ce7878 806bf0cc 80697ef8 8086bf38 8086a2e4
[   12.485897] 7880: a8ce78ac a8ce7890 80697ac0 8086bf34 a872e400 00000000 00000000 a8708200
[   12.485906] 78a0: a8ce78ec a8ce78b0 806bf520 806bf0a4 00070900 00140021 00008000 8086a2e4
[   12.485914] 78c0: a8ce78ec a8ce78d0 a872e400 00000000 00000000 a8708200 a8715600 00000000
[   12.485923] 78e0: a8ce7964 a8ce78f0 806c0650 806bf2d8 80a8671c 00000000 00000300 00000039
[   12.485931] 7900: 00000001 00000000 a8ce7964 00000000 806a7a5c 00000271 00000271 00070100
[   12.485939] 7920: 00000320 00005007 e02c7eca c1399eff 020fb2db 00000000 8086bf38 a872e400
[   12.485949] 7940: 00000000 00000000 a872e400 a8715600 a8ce7e98 00afe280 a8ce7984 a8ce7968
[   12.485955] 7960: 806996a0 806bfbec 00000000 00000000 00000000 a8715600 a8ce79a4 a8ce7988
[   12.485964] 7980: 806a5250 806995d4 a8715600 00000000 00000000 00000001 a8ce7c94 a8ce79a8
[   12.485972] 79a0: 806a5850 806a5214 a6037e9c a90cecb8 a8ce79ec a8ce79c0 8010a174 8010b6a0
[   12.485979] 79c0: 00000000 8016b848 a8ce7a3c a8ce7a28 80149d70 8016b848 00000001 a8ce79d8
[   12.485987] 79e0: 00000000 00000000 8010b6c4 8010a104 00000000 00000001 00000000 00000000
[   12.485995] 7a00: 024002c0 a8ce7b68 a8ce7a44 00000000 00000000 00000000 00000000 00000000
[   12.486003] 7a20: 00000000 00afe280 00000000 8020c418 a8ce7a4c ffffe000 a8ce7a64 a8ce7a48
[   12.486012] 7a40: 80149d78 80169cd0 a8000fc0 a8000fc0 a8ce7a84 a8ce7a60 8010b6c4 8010a104
[   12.486020] 7a60: 00000000 00000001 8086b758 2abc1000 ffffe000 a8ce7b68 a8ce7ab4 a8ce7a88
[   12.486028] 7a80: 8010a174 8010b6a0 00000000 8020c744 a8ce7b64 a8ce7af0 80149d70 8020c744
[   12.486038] 7aa0: a8ce7b74 ffffe000 a8ce7ad4 a8ce7ab8 80149d78 80169cd0 ab71708c 80b5608c
[   12.486048] 7ac0: ab71708c 2abc1000 a8ce7aec a8ce7ad8 8086b758 80149ca8 a929e7c0 80b5608c
[   12.486057] 7ae0: a8ce7b64 a8ce7af0 8020c794 80149bc0 024002c0 a8001f00 ffffe000 00000000
[   12.486067] 7b00: ffffe000 00400040 a8ce7b24 a8ce7b18 00000001 a8ce7b10 00000001 a8ce7b18
[   12.486077] 7b20: a96e3800 00400040 00000001 a8ce7b28 00000001 a8ce7b30 80b5ab00 80b5ab00
[   12.486087] 7b40: a8ce7b68 a8001f00 a929e7c0 a8ce7b68 a8001f00 60070013 a8ce7b94 a8ce7b68
[   12.486097] 7b60: 8020cb04 8020acfc 00000001 a8ce7b68 00000001 a8ce7b70 00000001 a8ce7b78
[   12.486106] 7b80: 00000001 a8ce7b80 a96e3800 a872e200 00000271 00000000 a8ce7bfc 00000008
[   12.486113] 7ba0: 00000001 a8ce7ba0 00000001 a8ce7ba8 a96d0080 00000005 a8708200 a8ce7c18
[   12.486120] 7bc0: 00000001 a8ce7bc0 00000001 a8ce7bc8 00000000 00000000 a872e200 00000006
[   12.486127] 7be0: 00000271 00000008 a8ce7c04 a8ce7bf8 8086bf38 8086a2e4 a8ce7c14 a8ce7c08
[   12.486134] 7c00: ffffe000 00000000 ffffe000 80c0471c a8ce7c2c a8ce7c20 8041f3b8 8041f22c
[   12.486140] 7c20: a8ce7c54 a8ce7c30 80127bd8 8041f3a4 80b522b0 00000000 ffffe000 00000190
[   12.486147] 7c40: a8ce7c5c a8ce7c50 ffffffff a870be80 a8ce7c6c a8ce7c60 8086a598 8086a4d4
[   12.486154] 7c60: a8ce7c7c a8ce7c70 8086befc a8ce7d48 a872e200 a8708600 00000001 a8715600
[   12.486160] 7c80: a8ce7e98 a871edb0 a8ce7d04 a8ce7c98 806a3bf0 806a57e4 00000000 00000271
[   12.486167] 7ca0: 00000000 00000000 a8ce7e90 a8ce7e98 a8ce7ccc a8ce7cc0 80169c98 a8ce7e90
[   12.486173] 7cc0: 00000000 00000000 00000000 00000271 a9066108 a8c3c768 a8ce7d1c 00000051
[   12.486180] 7ce0: a9099300 a86ec000 a8ce7d28 00000051 a8ce6000 a871edb0 a8ce7d1c a8ce7d08
[   12.486187] 7d00: 806a4648 806a317c 00000051 a9099300 a8ce7efc a8ce7d20 8069dac0 806a4524
[   12.486193] 7d20: ab71be2c a9164d80 7e846800 00000000 00000190 00000000 7e846800 00000000
[   12.486200] 7d40: 00000190 00000000 00000013 00000002 00000000 0ba2e8ba 0bb2ecbb 0bc2f0bc
[   12.486206] 7d60: 0bd2f4bd 0be2f8be 00000000 0c0300c0 7e846890 00000000 7e8468e0 00000000
[   12.486212] 7d80: 7e846840 00000000 00000000 00000000 00000001 76f6298c 00000001 76721a7c
[   12.486219] 7da0: 0000021b 7672376c 00af76b8 7e8468ac 7e8468a8 0d2348d2 0d334cd3 0e0ef440
[   12.486226] 7dc0: 7672376c 7671f8cc 007077a2 76721a7c 76724e4d 7e846918 00000000 00000000
[   12.486232] 7de0: aaaaaaab 00000000 00aee6f8 00000025 00000000 00000000 00000001 0e0ef440
[   12.486239] 7e00: 00000000 00af7870 7e846918 76724e4d 7e84698c 7e846920 7e846974 76f63424
[   12.486245] 7e20: 7e846920 76f8aa64 00afe280 00000000 00000001 00000000 00000001 00af76b8
[   12.486255] 7e40: 76f89fac 004e2000 aaaaaaab 00000000 00aee6f8 00000000 00af7870 00af76b8
[   12.486265] 7e60: 041a5454 2ce101bb 76721a7c 00af76b8 7e846980 766bd155 00000000 00000000
[   12.486274] 7e80: 00000000 00000000 00000000 00000001 0000001d 00000000 00000001 7671e000
[   12.486283] 7ea0: 0010b4d8 76a034d0 00000000 00000001 7e8469ec 00b14e24 00b14de8 76f68858
[   12.486292] 7ec0: 00000000 00000001 00000001 00000000 767220cc 76721a7c 0000081f a913c200
[   12.486301] 7ee0: 7e846798 0000000d 00007530 0000000d a8ce7f7c a8ce7f00 80225dec 8069d998
[   12.486310] 7f00: 80234f94 80234da0 a8ce7f54 a8ce7f18 8021549c 80234f74 00000020 00000000
[   12.486317] 7f20: 8014274c a904d508 a904d500 a8c484a0 80c5a460 a8c484d0 a8c48000 00000000
[   12.486324] 7f40: a8ce6000 00000000 a8ce7f64 a8ce7f58 8021559c a913c200 a913c200 0000000d
[   12.486330] 7f60: 00007530 7e846798 a8ce6000 00000000 a8ce7fa4 a8ce7f80 80226650 80225d50
[   12.486337] 7f80: 00002710 00007530 76839978 00000036 80107e44 a8ce6000 00000000 a8ce7fa8
[   12.486346] 7fa0: 80107c60 80226620 00002710 00007530 0000000d 00007530 7e846798 00afe400
[   12.486354] 7fc0: 00002710 00007530 76839978 00000036 00b3d518 7e8469ec 00000000 00b14de8
[   12.486360] 7fe0: 7682937c 7e846784 76812890 76bab84c 200c0010 0000000d 00000000 00000000
[   12.486364] Backtrace:
[   12.486379] [<8086bad0>] (rt_spin_lock) from [<80696ca8>] (_QueryProcessPageTable+0xc0/0x178)
[   12.486383]  r5:00000000 r4:00000000
[   12.486393] [<80696be8>] (_QueryProcessPageTable) from [<80697f18>] (gckOS_GetPhysicalAddress+0x2c/0xb8)
[   12.486400]  r10:00000000 r9:00000000 r8:a8715600 r7:a8708200 r6:a8708200 r5:b4a00000
[   12.486404]  r4:a8ce7878 r3:00000000
[   12.486416] [<80697eec>] (gckOS_GetPhysicalAddress) from [<806bf0cc>] (gckHARDWARE_SetMMU+0x34/0x234)
[   12.486421]  r6:00000000 r5:00000000 r4:a872e400
[   12.486429] [<806bf098>] (gckHARDWARE_SetMMU) from [<806bf520>] (gckHARDWARE_InitializeHardware+0x254/0x914)
[   12.486434]  r7:a8708200 r6:00000000 r5:00000000 r4:a872e400
[   12.486442] [<806bf2cc>] (gckHARDWARE_InitializeHardware) from [<806c0650>] (gckHARDWARE_SetPowerManagementState+0xa70/0xc44)
[   12.486448]  r9:00000000 r8:a8715600 r7:a8708200 r6:00000000 r5:00000000 r4:a872e400
[   12.486458] [<806bfbe0>] (gckHARDWARE_SetPowerManagementState) from [<806996a0>] (gckOS_Broadcast+0xd8/0x130)
[   12.486464]  r10:00afe280 r9:a8ce7e98 r8:a8715600 r7:a872e400 r6:00000000 r5:00000000
[   12.486467]  r4:a872e400
[   12.486479] [<806995c8>] (gckOS_Broadcast) from [<806a5250>] (gckCOMMAND_EnterCommit+0x48/0xcc)
[   12.486482]  r4:a8715600
[   12.486489] [<806a5208>] (gckCOMMAND_EnterCommit) from [<806a5850>] (gckCOMMAND_Commit+0x78/0xf60)
[   12.486494]  r7:00000001 r6:00000000 r5:00000000 r4:a8715600
[   12.486502] [<806a57d8>] (gckCOMMAND_Commit) from [<806a3bf0>] (gckKERNEL_Dispatch+0xa80/0x13a8)
[   12.486509]  r10:a871edb0 r9:a8ce7e98 r8:a8715600 r7:00000001 r6:a8708600 r5:a872e200
[   12.486511]  r4:a8ce7d48
[   12.486518] [<806a3170>] (gckKERNEL_Dispatch) from [<806a4648>] (gckDEVICE_Dispatch+0x130/0x134)
[   12.486525]  r10:a871edb0 r9:a8ce6000 r8:00000051 r7:a8ce7d28 r6:a86ec000 r5:a9099300
[   12.486527]  r4:00000051
[   12.486534] [<806a4518>] (gckDEVICE_Dispatch) from [<8069dac0>] (drv_ioctl+0x134/0x284)
[   12.486537]  r5:a9099300 r4:00000051
[   12.486548] [<8069d98c>] (drv_ioctl) from [<80225dec>] (do_vfs_ioctl+0xa8/0x8d0)
[   12.486554]  r8:0000000d r7:00007530 r6:0000000d r5:7e846798 r4:a913c200
[   12.486561] [<80225d44>] (do_vfs_ioctl) from [<80226650>] (SyS_ioctl+0x3c/0x60)
[   12.486568]  r10:00000000 r9:a8ce6000 r8:7e846798 r7:00007530 r6:0000000d r5:a913c200
[   12.486570]  r4:a913c200
[   12.486581] [<80226614>] (SyS_ioctl) from [<80107c60>] (ret_fast_syscall+0x0/0x50)
[   12.486587]  r9:a8ce6000 r8:80107e44 r7:00000036 r6:76839978 r5:00007530 r4:00002710
[   12.486594] Code: e284300c e3c2203f e5922010 f593f000 (e193cf9f)
[   13.331699] ---[ end trace 0000000000000002 ]---

Upstream-Status: Inappropriate [disable feature]

Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de> [updated for 3.14.28]
Signed-off-by: Stefan Agner <stefan.agner@toradex.com> [updated for 4.9]
---
 include/linux/mm_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 08bde1a7a987..c9e1a95814f9 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -25,7 +25,7 @@
 struct address_space;
 struct mem_cgroup;
 
-#define USE_SPLIT_PTE_PTLOCKS	(NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS)
+#define USE_SPLIT_PTE_PTLOCKS	(0)
 #define USE_SPLIT_PMD_PTLOCKS	(USE_SPLIT_PTE_PTLOCKS && \
 		IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK))
 #define ALLOC_SPLIT_PTLOCKS	(SPINLOCK_SIZE > BITS_PER_LONG/8)
-- 
2.15.1