1 |
commit: 6066aba76c5f1240fdb5cd93b959030a4f26c147 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 8 13:17:09 2018 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 8 13:17:09 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=6066aba7 |
7 |
|
8 |
proj/linux-patches: Linux patch 4.19.8 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1007_linux-4.19.8.patch | 1441 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1445 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 6c79837..79aa888 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -75,6 +75,10 @@ Patch: 1007_linux-4.19.8.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.19.8 |
23 |
|
24 |
+Patch: 1008_linux-4.19.9.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.19.9 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1007_linux-4.19.8.patch b/1007_linux-4.19.8.patch |
33 |
new file mode 100644 |
34 |
index 0000000..dbc8053 |
35 |
--- /dev/null |
36 |
+++ b/1007_linux-4.19.8.patch |
37 |
@@ -0,0 +1,1441 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index d2b4efcfb388..34bc4c752c49 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 19 |
46 |
+-SUBLEVEL = 7 |
47 |
++SUBLEVEL = 8 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = "People's Front" |
50 |
+ |
51 |
+diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig |
52 |
+index a045f3086047..a90c4f126050 100644 |
53 |
+--- a/arch/arc/Kconfig |
54 |
++++ b/arch/arc/Kconfig |
55 |
+@@ -111,7 +111,7 @@ endmenu |
56 |
+ |
57 |
+ choice |
58 |
+ prompt "ARC Instruction Set" |
59 |
+- default ISA_ARCOMPACT |
60 |
++ default ISA_ARCV2 |
61 |
+ |
62 |
+ config ISA_ARCOMPACT |
63 |
+ bool "ARCompact ISA" |
64 |
+diff --git a/arch/arc/Makefile b/arch/arc/Makefile |
65 |
+index 644815c0516e..16e6cc22e25c 100644 |
66 |
+--- a/arch/arc/Makefile |
67 |
++++ b/arch/arc/Makefile |
68 |
+@@ -6,7 +6,7 @@ |
69 |
+ # published by the Free Software Foundation. |
70 |
+ # |
71 |
+ |
72 |
+-KBUILD_DEFCONFIG := nsim_700_defconfig |
73 |
++KBUILD_DEFCONFIG := nsim_hs_defconfig |
74 |
+ |
75 |
+ cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__ |
76 |
+ cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7 |
77 |
+diff --git a/arch/arc/configs/axs101_defconfig b/arch/arc/configs/axs101_defconfig |
78 |
+index 41bc08be6a3b..020d4493edfd 100644 |
79 |
+--- a/arch/arc/configs/axs101_defconfig |
80 |
++++ b/arch/arc/configs/axs101_defconfig |
81 |
+@@ -14,6 +14,7 @@ CONFIG_PERF_EVENTS=y |
82 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
83 |
+ # CONFIG_SLUB_DEBUG is not set |
84 |
+ # CONFIG_COMPAT_BRK is not set |
85 |
++CONFIG_ISA_ARCOMPACT=y |
86 |
+ CONFIG_MODULES=y |
87 |
+ CONFIG_MODULE_FORCE_LOAD=y |
88 |
+ CONFIG_MODULE_UNLOAD=y |
89 |
+@@ -95,6 +96,7 @@ CONFIG_VFAT_FS=y |
90 |
+ CONFIG_NTFS_FS=y |
91 |
+ CONFIG_TMPFS=y |
92 |
+ CONFIG_NFS_FS=y |
93 |
++CONFIG_NFS_V3_ACL=y |
94 |
+ CONFIG_NLS_CODEPAGE_437=y |
95 |
+ CONFIG_NLS_ISO8859_1=y |
96 |
+ # CONFIG_ENABLE_WARN_DEPRECATED is not set |
97 |
+diff --git a/arch/arc/configs/axs103_defconfig b/arch/arc/configs/axs103_defconfig |
98 |
+index 1e1c4a8011b5..666314fffc60 100644 |
99 |
+--- a/arch/arc/configs/axs103_defconfig |
100 |
++++ b/arch/arc/configs/axs103_defconfig |
101 |
+@@ -94,6 +94,7 @@ CONFIG_VFAT_FS=y |
102 |
+ CONFIG_NTFS_FS=y |
103 |
+ CONFIG_TMPFS=y |
104 |
+ CONFIG_NFS_FS=y |
105 |
++CONFIG_NFS_V3_ACL=y |
106 |
+ CONFIG_NLS_CODEPAGE_437=y |
107 |
+ CONFIG_NLS_ISO8859_1=y |
108 |
+ # CONFIG_ENABLE_WARN_DEPRECATED is not set |
109 |
+diff --git a/arch/arc/configs/axs103_smp_defconfig b/arch/arc/configs/axs103_smp_defconfig |
110 |
+index 6b0c0cfd5c30..429832b8560b 100644 |
111 |
+--- a/arch/arc/configs/axs103_smp_defconfig |
112 |
++++ b/arch/arc/configs/axs103_smp_defconfig |
113 |
+@@ -97,6 +97,7 @@ CONFIG_VFAT_FS=y |
114 |
+ CONFIG_NTFS_FS=y |
115 |
+ CONFIG_TMPFS=y |
116 |
+ CONFIG_NFS_FS=y |
117 |
++CONFIG_NFS_V3_ACL=y |
118 |
+ CONFIG_NLS_CODEPAGE_437=y |
119 |
+ CONFIG_NLS_ISO8859_1=y |
120 |
+ # CONFIG_ENABLE_WARN_DEPRECATED is not set |
121 |
+diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig |
122 |
+index 1dec2b4bc5e6..2a1d2cbfee1a 100644 |
123 |
+--- a/arch/arc/configs/hsdk_defconfig |
124 |
++++ b/arch/arc/configs/hsdk_defconfig |
125 |
+@@ -65,6 +65,7 @@ CONFIG_EXT3_FS=y |
126 |
+ CONFIG_VFAT_FS=y |
127 |
+ CONFIG_TMPFS=y |
128 |
+ CONFIG_NFS_FS=y |
129 |
++CONFIG_NFS_V3_ACL=y |
130 |
+ CONFIG_NLS_CODEPAGE_437=y |
131 |
+ CONFIG_NLS_ISO8859_1=y |
132 |
+ # CONFIG_ENABLE_WARN_DEPRECATED is not set |
133 |
+diff --git a/arch/arc/configs/nps_defconfig b/arch/arc/configs/nps_defconfig |
134 |
+index 31ba224bbfb4..6e84060e7c90 100644 |
135 |
+--- a/arch/arc/configs/nps_defconfig |
136 |
++++ b/arch/arc/configs/nps_defconfig |
137 |
+@@ -15,6 +15,7 @@ CONFIG_SYSCTL_SYSCALL=y |
138 |
+ CONFIG_EMBEDDED=y |
139 |
+ CONFIG_PERF_EVENTS=y |
140 |
+ # CONFIG_COMPAT_BRK is not set |
141 |
++CONFIG_ISA_ARCOMPACT=y |
142 |
+ CONFIG_KPROBES=y |
143 |
+ CONFIG_MODULES=y |
144 |
+ CONFIG_MODULE_FORCE_LOAD=y |
145 |
+@@ -73,6 +74,7 @@ CONFIG_PROC_KCORE=y |
146 |
+ CONFIG_TMPFS=y |
147 |
+ # CONFIG_MISC_FILESYSTEMS is not set |
148 |
+ CONFIG_NFS_FS=y |
149 |
++CONFIG_NFS_V3_ACL=y |
150 |
+ CONFIG_ROOT_NFS=y |
151 |
+ CONFIG_DEBUG_INFO=y |
152 |
+ # CONFIG_ENABLE_WARN_DEPRECATED is not set |
153 |
+diff --git a/arch/arc/configs/nsim_700_defconfig b/arch/arc/configs/nsim_700_defconfig |
154 |
+index 8e0b8b134cd9..219c2a65294b 100644 |
155 |
+--- a/arch/arc/configs/nsim_700_defconfig |
156 |
++++ b/arch/arc/configs/nsim_700_defconfig |
157 |
+@@ -15,6 +15,7 @@ CONFIG_EMBEDDED=y |
158 |
+ CONFIG_PERF_EVENTS=y |
159 |
+ # CONFIG_SLUB_DEBUG is not set |
160 |
+ # CONFIG_COMPAT_BRK is not set |
161 |
++CONFIG_ISA_ARCOMPACT=y |
162 |
+ CONFIG_KPROBES=y |
163 |
+ CONFIG_MODULES=y |
164 |
+ # CONFIG_LBDAF is not set |
165 |
+diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig |
166 |
+index f14eeff7d308..35dfc6491a09 100644 |
167 |
+--- a/arch/arc/configs/nsimosci_defconfig |
168 |
++++ b/arch/arc/configs/nsimosci_defconfig |
169 |
+@@ -15,6 +15,7 @@ CONFIG_EMBEDDED=y |
170 |
+ CONFIG_PERF_EVENTS=y |
171 |
+ # CONFIG_SLUB_DEBUG is not set |
172 |
+ # CONFIG_COMPAT_BRK is not set |
173 |
++CONFIG_ISA_ARCOMPACT=y |
174 |
+ CONFIG_KPROBES=y |
175 |
+ CONFIG_MODULES=y |
176 |
+ # CONFIG_LBDAF is not set |
177 |
+@@ -66,5 +67,6 @@ CONFIG_EXT2_FS_XATTR=y |
178 |
+ CONFIG_TMPFS=y |
179 |
+ # CONFIG_MISC_FILESYSTEMS is not set |
180 |
+ CONFIG_NFS_FS=y |
181 |
++CONFIG_NFS_V3_ACL=y |
182 |
+ # CONFIG_ENABLE_WARN_DEPRECATED is not set |
183 |
+ # CONFIG_ENABLE_MUST_CHECK is not set |
184 |
+diff --git a/arch/arc/configs/nsimosci_hs_defconfig b/arch/arc/configs/nsimosci_hs_defconfig |
185 |
+index 025298a48305..1638e5bc9672 100644 |
186 |
+--- a/arch/arc/configs/nsimosci_hs_defconfig |
187 |
++++ b/arch/arc/configs/nsimosci_hs_defconfig |
188 |
+@@ -65,5 +65,6 @@ CONFIG_EXT2_FS_XATTR=y |
189 |
+ CONFIG_TMPFS=y |
190 |
+ # CONFIG_MISC_FILESYSTEMS is not set |
191 |
+ CONFIG_NFS_FS=y |
192 |
++CONFIG_NFS_V3_ACL=y |
193 |
+ # CONFIG_ENABLE_WARN_DEPRECATED is not set |
194 |
+ # CONFIG_ENABLE_MUST_CHECK is not set |
195 |
+diff --git a/arch/arc/configs/nsimosci_hs_smp_defconfig b/arch/arc/configs/nsimosci_hs_smp_defconfig |
196 |
+index df7b77b13b82..11cfbdb0f441 100644 |
197 |
+--- a/arch/arc/configs/nsimosci_hs_smp_defconfig |
198 |
++++ b/arch/arc/configs/nsimosci_hs_smp_defconfig |
199 |
+@@ -76,6 +76,7 @@ CONFIG_EXT2_FS_XATTR=y |
200 |
+ CONFIG_TMPFS=y |
201 |
+ # CONFIG_MISC_FILESYSTEMS is not set |
202 |
+ CONFIG_NFS_FS=y |
203 |
++CONFIG_NFS_V3_ACL=y |
204 |
+ # CONFIG_ENABLE_WARN_DEPRECATED is not set |
205 |
+ # CONFIG_ENABLE_MUST_CHECK is not set |
206 |
+ CONFIG_FTRACE=y |
207 |
+diff --git a/arch/arc/configs/tb10x_defconfig b/arch/arc/configs/tb10x_defconfig |
208 |
+index a7f65313f84a..e71ade3cf9c8 100644 |
209 |
+--- a/arch/arc/configs/tb10x_defconfig |
210 |
++++ b/arch/arc/configs/tb10x_defconfig |
211 |
+@@ -19,6 +19,7 @@ CONFIG_KALLSYMS_ALL=y |
212 |
+ # CONFIG_AIO is not set |
213 |
+ CONFIG_EMBEDDED=y |
214 |
+ # CONFIG_COMPAT_BRK is not set |
215 |
++CONFIG_ISA_ARCOMPACT=y |
216 |
+ CONFIG_SLAB=y |
217 |
+ CONFIG_MODULES=y |
218 |
+ CONFIG_MODULE_FORCE_LOAD=y |
219 |
+diff --git a/arch/arc/configs/vdk_hs38_defconfig b/arch/arc/configs/vdk_hs38_defconfig |
220 |
+index db47c3541f15..1e59a2e9c602 100644 |
221 |
+--- a/arch/arc/configs/vdk_hs38_defconfig |
222 |
++++ b/arch/arc/configs/vdk_hs38_defconfig |
223 |
+@@ -85,6 +85,7 @@ CONFIG_NTFS_FS=y |
224 |
+ CONFIG_TMPFS=y |
225 |
+ CONFIG_JFFS2_FS=y |
226 |
+ CONFIG_NFS_FS=y |
227 |
++CONFIG_NFS_V3_ACL=y |
228 |
+ CONFIG_NLS_CODEPAGE_437=y |
229 |
+ CONFIG_NLS_ISO8859_1=y |
230 |
+ # CONFIG_ENABLE_WARN_DEPRECATED is not set |
231 |
+diff --git a/arch/arc/configs/vdk_hs38_smp_defconfig b/arch/arc/configs/vdk_hs38_smp_defconfig |
232 |
+index a8ac5e917d9a..b5c3f6c54b03 100644 |
233 |
+--- a/arch/arc/configs/vdk_hs38_smp_defconfig |
234 |
++++ b/arch/arc/configs/vdk_hs38_smp_defconfig |
235 |
+@@ -90,6 +90,7 @@ CONFIG_NTFS_FS=y |
236 |
+ CONFIG_TMPFS=y |
237 |
+ CONFIG_JFFS2_FS=y |
238 |
+ CONFIG_NFS_FS=y |
239 |
++CONFIG_NFS_V3_ACL=y |
240 |
+ CONFIG_NLS_CODEPAGE_437=y |
241 |
+ CONFIG_NLS_ISO8859_1=y |
242 |
+ # CONFIG_ENABLE_WARN_DEPRECATED is not set |
243 |
+diff --git a/arch/arm64/include/asm/ftrace.h b/arch/arm64/include/asm/ftrace.h |
244 |
+index caa955f10e19..fac54fb050d0 100644 |
245 |
+--- a/arch/arm64/include/asm/ftrace.h |
246 |
++++ b/arch/arm64/include/asm/ftrace.h |
247 |
+@@ -56,6 +56,19 @@ static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs) |
248 |
+ { |
249 |
+ return is_compat_task(); |
250 |
+ } |
251 |
++ |
252 |
++#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME |
253 |
++ |
254 |
++static inline bool arch_syscall_match_sym_name(const char *sym, |
255 |
++ const char *name) |
256 |
++{ |
257 |
++ /* |
258 |
++ * Since all syscall functions have __arm64_ prefix, we must skip it. |
259 |
++ * However, as we described above, we decided to ignore compat |
260 |
++ * syscalls, so we don't care about __arm64_compat_ prefix here. |
261 |
++ */ |
262 |
++ return !strcmp(sym + 8, name); |
263 |
++} |
264 |
+ #endif /* ifndef __ASSEMBLY__ */ |
265 |
+ |
266 |
+ #endif /* __ASM_FTRACE_H */ |
267 |
+diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h |
268 |
+index 0170602a1e4e..6cf8ffb5367e 100644 |
269 |
+--- a/arch/mips/include/asm/syscall.h |
270 |
++++ b/arch/mips/include/asm/syscall.h |
271 |
+@@ -73,7 +73,7 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg, |
272 |
+ #ifdef CONFIG_64BIT |
273 |
+ case 4: case 5: case 6: case 7: |
274 |
+ #ifdef CONFIG_MIPS32_O32 |
275 |
+- if (test_thread_flag(TIF_32BIT_REGS)) |
276 |
++ if (test_tsk_thread_flag(task, TIF_32BIT_REGS)) |
277 |
+ return get_user(*arg, (int *)usp + n); |
278 |
+ else |
279 |
+ #endif |
280 |
+diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c |
281 |
+index 41b71c4352c2..c1ce6f43642b 100644 |
282 |
+--- a/arch/mips/ralink/mt7620.c |
283 |
++++ b/arch/mips/ralink/mt7620.c |
284 |
+@@ -84,7 +84,7 @@ static struct rt2880_pmx_func pcie_rst_grp[] = { |
285 |
+ }; |
286 |
+ static struct rt2880_pmx_func nd_sd_grp[] = { |
287 |
+ FUNC("nand", MT7620_GPIO_MODE_NAND, 45, 15), |
288 |
+- FUNC("sd", MT7620_GPIO_MODE_SD, 45, 15) |
289 |
++ FUNC("sd", MT7620_GPIO_MODE_SD, 47, 13) |
290 |
+ }; |
291 |
+ |
292 |
+ static struct rt2880_pmx_group mt7620a_pinmux_data[] = { |
293 |
+diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c |
294 |
+index 4397fa0c448f..f1d3fe5a0c65 100644 |
295 |
+--- a/arch/x86/kvm/svm.c |
296 |
++++ b/arch/x86/kvm/svm.c |
297 |
+@@ -1663,20 +1663,23 @@ static u64 *avic_get_physical_id_entry(struct kvm_vcpu *vcpu, |
298 |
+ static int avic_init_access_page(struct kvm_vcpu *vcpu) |
299 |
+ { |
300 |
+ struct kvm *kvm = vcpu->kvm; |
301 |
+- int ret; |
302 |
++ int ret = 0; |
303 |
+ |
304 |
++ mutex_lock(&kvm->slots_lock); |
305 |
+ if (kvm->arch.apic_access_page_done) |
306 |
+- return 0; |
307 |
++ goto out; |
308 |
+ |
309 |
+- ret = x86_set_memory_region(kvm, |
310 |
+- APIC_ACCESS_PAGE_PRIVATE_MEMSLOT, |
311 |
+- APIC_DEFAULT_PHYS_BASE, |
312 |
+- PAGE_SIZE); |
313 |
++ ret = __x86_set_memory_region(kvm, |
314 |
++ APIC_ACCESS_PAGE_PRIVATE_MEMSLOT, |
315 |
++ APIC_DEFAULT_PHYS_BASE, |
316 |
++ PAGE_SIZE); |
317 |
+ if (ret) |
318 |
+- return ret; |
319 |
++ goto out; |
320 |
+ |
321 |
+ kvm->arch.apic_access_page_done = true; |
322 |
+- return 0; |
323 |
++out: |
324 |
++ mutex_unlock(&kvm->slots_lock); |
325 |
++ return ret; |
326 |
+ } |
327 |
+ |
328 |
+ static int avic_init_backing_page(struct kvm_vcpu *vcpu) |
329 |
+diff --git a/block/blk-mq.c b/block/blk-mq.c |
330 |
+index e3c39ea8e17b..23a53b67cf0d 100644 |
331 |
+--- a/block/blk-mq.c |
332 |
++++ b/block/blk-mq.c |
333 |
+@@ -1747,7 +1747,7 @@ insert: |
334 |
+ if (bypass_insert) |
335 |
+ return BLK_STS_RESOURCE; |
336 |
+ |
337 |
+- blk_mq_sched_insert_request(rq, false, run_queue, false); |
338 |
++ blk_mq_request_bypass_insert(rq, run_queue); |
339 |
+ return BLK_STS_OK; |
340 |
+ } |
341 |
+ |
342 |
+@@ -1763,7 +1763,7 @@ static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, |
343 |
+ |
344 |
+ ret = __blk_mq_try_issue_directly(hctx, rq, cookie, false); |
345 |
+ if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE) |
346 |
+- blk_mq_sched_insert_request(rq, false, true, false); |
347 |
++ blk_mq_request_bypass_insert(rq, true); |
348 |
+ else if (ret != BLK_STS_OK) |
349 |
+ blk_mq_end_request(rq, ret); |
350 |
+ |
351 |
+@@ -1798,7 +1798,8 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx, |
352 |
+ if (ret != BLK_STS_OK) { |
353 |
+ if (ret == BLK_STS_RESOURCE || |
354 |
+ ret == BLK_STS_DEV_RESOURCE) { |
355 |
+- list_add(&rq->queuelist, list); |
356 |
++ blk_mq_request_bypass_insert(rq, |
357 |
++ list_empty(list)); |
358 |
+ break; |
359 |
+ } |
360 |
+ blk_mq_end_request(rq, ret); |
361 |
+diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c |
362 |
+index 4cc45a1d21db..59445c83f023 100644 |
363 |
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c |
364 |
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c |
365 |
+@@ -374,6 +374,8 @@ dm_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, |
366 |
+ master->connector_id); |
367 |
+ |
368 |
+ aconnector->mst_encoder = dm_dp_create_fake_mst_encoder(master); |
369 |
++ drm_connector_attach_encoder(&aconnector->base, |
370 |
++ &aconnector->mst_encoder->base); |
371 |
+ |
372 |
+ /* |
373 |
+ * TODO: understand why this one is needed |
374 |
+diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c |
375 |
+index dac355812adc..373700c05a00 100644 |
376 |
+--- a/drivers/gpu/drm/ast/ast_main.c |
377 |
++++ b/drivers/gpu/drm/ast/ast_main.c |
378 |
+@@ -583,7 +583,8 @@ void ast_driver_unload(struct drm_device *dev) |
379 |
+ drm_mode_config_cleanup(dev); |
380 |
+ |
381 |
+ ast_mm_fini(ast); |
382 |
+- pci_iounmap(dev->pdev, ast->ioregs); |
383 |
++ if (ast->ioregs != ast->regs + AST_IO_MM_OFFSET) |
384 |
++ pci_iounmap(dev->pdev, ast->ioregs); |
385 |
+ pci_iounmap(dev->pdev, ast->regs); |
386 |
+ kfree(ast); |
387 |
+ } |
388 |
+diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c |
389 |
+index d9c0f7573905..1669c42c40ed 100644 |
390 |
+--- a/drivers/gpu/drm/drm_auth.c |
391 |
++++ b/drivers/gpu/drm/drm_auth.c |
392 |
+@@ -142,6 +142,7 @@ static int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv) |
393 |
+ |
394 |
+ lockdep_assert_held_once(&dev->master_mutex); |
395 |
+ |
396 |
++ WARN_ON(fpriv->is_master); |
397 |
+ old_master = fpriv->master; |
398 |
+ fpriv->master = drm_master_create(dev); |
399 |
+ if (!fpriv->master) { |
400 |
+@@ -170,6 +171,7 @@ out_err: |
401 |
+ /* drop references and restore old master on failure */ |
402 |
+ drm_master_put(&fpriv->master); |
403 |
+ fpriv->master = old_master; |
404 |
++ fpriv->is_master = 0; |
405 |
+ |
406 |
+ return ret; |
407 |
+ } |
408 |
+diff --git a/drivers/gpu/drm/meson/meson_crtc.c b/drivers/gpu/drm/meson/meson_crtc.c |
409 |
+index 05520202c967..191b314f9e9e 100644 |
410 |
+--- a/drivers/gpu/drm/meson/meson_crtc.c |
411 |
++++ b/drivers/gpu/drm/meson/meson_crtc.c |
412 |
+@@ -45,6 +45,7 @@ struct meson_crtc { |
413 |
+ struct drm_crtc base; |
414 |
+ struct drm_pending_vblank_event *event; |
415 |
+ struct meson_drm *priv; |
416 |
++ bool enabled; |
417 |
+ }; |
418 |
+ #define to_meson_crtc(x) container_of(x, struct meson_crtc, base) |
419 |
+ |
420 |
+@@ -80,8 +81,7 @@ static const struct drm_crtc_funcs meson_crtc_funcs = { |
421 |
+ |
422 |
+ }; |
423 |
+ |
424 |
+-static void meson_crtc_atomic_enable(struct drm_crtc *crtc, |
425 |
+- struct drm_crtc_state *old_state) |
426 |
++static void meson_crtc_enable(struct drm_crtc *crtc) |
427 |
+ { |
428 |
+ struct meson_crtc *meson_crtc = to_meson_crtc(crtc); |
429 |
+ struct drm_crtc_state *crtc_state = crtc->state; |
430 |
+@@ -101,6 +101,22 @@ static void meson_crtc_atomic_enable(struct drm_crtc *crtc, |
431 |
+ writel_bits_relaxed(VPP_POSTBLEND_ENABLE, VPP_POSTBLEND_ENABLE, |
432 |
+ priv->io_base + _REG(VPP_MISC)); |
433 |
+ |
434 |
++ drm_crtc_vblank_on(crtc); |
435 |
++ |
436 |
++ meson_crtc->enabled = true; |
437 |
++} |
438 |
++ |
439 |
++static void meson_crtc_atomic_enable(struct drm_crtc *crtc, |
440 |
++ struct drm_crtc_state *old_state) |
441 |
++{ |
442 |
++ struct meson_crtc *meson_crtc = to_meson_crtc(crtc); |
443 |
++ struct meson_drm *priv = meson_crtc->priv; |
444 |
++ |
445 |
++ DRM_DEBUG_DRIVER("\n"); |
446 |
++ |
447 |
++ if (!meson_crtc->enabled) |
448 |
++ meson_crtc_enable(crtc); |
449 |
++ |
450 |
+ priv->viu.osd1_enabled = true; |
451 |
+ } |
452 |
+ |
453 |
+@@ -110,6 +126,8 @@ static void meson_crtc_atomic_disable(struct drm_crtc *crtc, |
454 |
+ struct meson_crtc *meson_crtc = to_meson_crtc(crtc); |
455 |
+ struct meson_drm *priv = meson_crtc->priv; |
456 |
+ |
457 |
++ drm_crtc_vblank_off(crtc); |
458 |
++ |
459 |
+ priv->viu.osd1_enabled = false; |
460 |
+ priv->viu.osd1_commit = false; |
461 |
+ |
462 |
+@@ -124,6 +142,8 @@ static void meson_crtc_atomic_disable(struct drm_crtc *crtc, |
463 |
+ |
464 |
+ crtc->state->event = NULL; |
465 |
+ } |
466 |
++ |
467 |
++ meson_crtc->enabled = false; |
468 |
+ } |
469 |
+ |
470 |
+ static void meson_crtc_atomic_begin(struct drm_crtc *crtc, |
471 |
+@@ -132,6 +152,9 @@ static void meson_crtc_atomic_begin(struct drm_crtc *crtc, |
472 |
+ struct meson_crtc *meson_crtc = to_meson_crtc(crtc); |
473 |
+ unsigned long flags; |
474 |
+ |
475 |
++ if (crtc->state->enable && !meson_crtc->enabled) |
476 |
++ meson_crtc_enable(crtc); |
477 |
++ |
478 |
+ if (crtc->state->event) { |
479 |
+ WARN_ON(drm_crtc_vblank_get(crtc) != 0); |
480 |
+ |
481 |
+diff --git a/drivers/gpu/drm/meson/meson_dw_hdmi.c b/drivers/gpu/drm/meson/meson_dw_hdmi.c |
482 |
+index df7247cd93f9..2cb2ad26d716 100644 |
483 |
+--- a/drivers/gpu/drm/meson/meson_dw_hdmi.c |
484 |
++++ b/drivers/gpu/drm/meson/meson_dw_hdmi.c |
485 |
+@@ -706,6 +706,7 @@ static const struct regmap_config meson_dw_hdmi_regmap_config = { |
486 |
+ .reg_read = meson_dw_hdmi_reg_read, |
487 |
+ .reg_write = meson_dw_hdmi_reg_write, |
488 |
+ .max_register = 0x10000, |
489 |
++ .fast_io = true, |
490 |
+ }; |
491 |
+ |
492 |
+ static bool meson_hdmi_connector_is_available(struct device *dev) |
493 |
+diff --git a/drivers/gpu/drm/meson/meson_venc.c b/drivers/gpu/drm/meson/meson_venc.c |
494 |
+index 514245e69b38..14aac661f38b 100644 |
495 |
+--- a/drivers/gpu/drm/meson/meson_venc.c |
496 |
++++ b/drivers/gpu/drm/meson/meson_venc.c |
497 |
+@@ -71,6 +71,7 @@ |
498 |
+ */ |
499 |
+ |
500 |
+ /* HHI Registers */ |
501 |
++#define HHI_GCLK_MPEG2 0x148 /* 0x52 offset in data sheet */ |
502 |
+ #define HHI_VDAC_CNTL0 0x2F4 /* 0xbd offset in data sheet */ |
503 |
+ #define HHI_VDAC_CNTL1 0x2F8 /* 0xbe offset in data sheet */ |
504 |
+ #define HHI_HDMI_PHY_CNTL0 0x3a0 /* 0xe8 offset in data sheet */ |
505 |
+@@ -1529,10 +1530,12 @@ unsigned int meson_venci_get_field(struct meson_drm *priv) |
506 |
+ void meson_venc_enable_vsync(struct meson_drm *priv) |
507 |
+ { |
508 |
+ writel_relaxed(2, priv->io_base + _REG(VENC_INTCTRL)); |
509 |
++ regmap_update_bits(priv->hhi, HHI_GCLK_MPEG2, BIT(25), BIT(25)); |
510 |
+ } |
511 |
+ |
512 |
+ void meson_venc_disable_vsync(struct meson_drm *priv) |
513 |
+ { |
514 |
++ regmap_update_bits(priv->hhi, HHI_GCLK_MPEG2, BIT(25), 0); |
515 |
+ writel_relaxed(0, priv->io_base + _REG(VENC_INTCTRL)); |
516 |
+ } |
517 |
+ |
518 |
+diff --git a/drivers/gpu/drm/meson/meson_viu.c b/drivers/gpu/drm/meson/meson_viu.c |
519 |
+index 6bcfa527c180..26a0857878bf 100644 |
520 |
+--- a/drivers/gpu/drm/meson/meson_viu.c |
521 |
++++ b/drivers/gpu/drm/meson/meson_viu.c |
522 |
+@@ -184,18 +184,18 @@ void meson_viu_set_osd_lut(struct meson_drm *priv, enum viu_lut_sel_e lut_sel, |
523 |
+ if (lut_sel == VIU_LUT_OSD_OETF) { |
524 |
+ writel(0, priv->io_base + _REG(addr_port)); |
525 |
+ |
526 |
+- for (i = 0; i < 20; i++) |
527 |
++ for (i = 0; i < (OSD_OETF_LUT_SIZE / 2); i++) |
528 |
+ writel(r_map[i * 2] | (r_map[i * 2 + 1] << 16), |
529 |
+ priv->io_base + _REG(data_port)); |
530 |
+ |
531 |
+ writel(r_map[OSD_OETF_LUT_SIZE - 1] | (g_map[0] << 16), |
532 |
+ priv->io_base + _REG(data_port)); |
533 |
+ |
534 |
+- for (i = 0; i < 20; i++) |
535 |
++ for (i = 0; i < (OSD_OETF_LUT_SIZE / 2); i++) |
536 |
+ writel(g_map[i * 2 + 1] | (g_map[i * 2 + 2] << 16), |
537 |
+ priv->io_base + _REG(data_port)); |
538 |
+ |
539 |
+- for (i = 0; i < 20; i++) |
540 |
++ for (i = 0; i < (OSD_OETF_LUT_SIZE / 2); i++) |
541 |
+ writel(b_map[i * 2] | (b_map[i * 2 + 1] << 16), |
542 |
+ priv->io_base + _REG(data_port)); |
543 |
+ |
544 |
+@@ -211,18 +211,18 @@ void meson_viu_set_osd_lut(struct meson_drm *priv, enum viu_lut_sel_e lut_sel, |
545 |
+ } else if (lut_sel == VIU_LUT_OSD_EOTF) { |
546 |
+ writel(0, priv->io_base + _REG(addr_port)); |
547 |
+ |
548 |
+- for (i = 0; i < 20; i++) |
549 |
++ for (i = 0; i < (OSD_EOTF_LUT_SIZE / 2); i++) |
550 |
+ writel(r_map[i * 2] | (r_map[i * 2 + 1] << 16), |
551 |
+ priv->io_base + _REG(data_port)); |
552 |
+ |
553 |
+ writel(r_map[OSD_EOTF_LUT_SIZE - 1] | (g_map[0] << 16), |
554 |
+ priv->io_base + _REG(data_port)); |
555 |
+ |
556 |
+- for (i = 0; i < 20; i++) |
557 |
++ for (i = 0; i < (OSD_EOTF_LUT_SIZE / 2); i++) |
558 |
+ writel(g_map[i * 2 + 1] | (g_map[i * 2 + 2] << 16), |
559 |
+ priv->io_base + _REG(data_port)); |
560 |
+ |
561 |
+- for (i = 0; i < 20; i++) |
562 |
++ for (i = 0; i < (OSD_EOTF_LUT_SIZE / 2); i++) |
563 |
+ writel(b_map[i * 2] | (b_map[i * 2 + 1] << 16), |
564 |
+ priv->io_base + _REG(data_port)); |
565 |
+ |
566 |
+diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c |
567 |
+index c414f3809e5c..50be240df331 100644 |
568 |
+--- a/drivers/infiniband/hw/mlx5/main.c |
569 |
++++ b/drivers/infiniband/hw/mlx5/main.c |
570 |
+@@ -1094,31 +1094,26 @@ enum mlx5_ib_width { |
571 |
+ MLX5_IB_WIDTH_12X = 1 << 4 |
572 |
+ }; |
573 |
+ |
574 |
+-static int translate_active_width(struct ib_device *ibdev, u8 active_width, |
575 |
++static void translate_active_width(struct ib_device *ibdev, u8 active_width, |
576 |
+ u8 *ib_width) |
577 |
+ { |
578 |
+ struct mlx5_ib_dev *dev = to_mdev(ibdev); |
579 |
+- int err = 0; |
580 |
+ |
581 |
+- if (active_width & MLX5_IB_WIDTH_1X) { |
582 |
++ if (active_width & MLX5_IB_WIDTH_1X) |
583 |
+ *ib_width = IB_WIDTH_1X; |
584 |
+- } else if (active_width & MLX5_IB_WIDTH_2X) { |
585 |
+- mlx5_ib_dbg(dev, "active_width %d is not supported by IB spec\n", |
586 |
+- (int)active_width); |
587 |
+- err = -EINVAL; |
588 |
+- } else if (active_width & MLX5_IB_WIDTH_4X) { |
589 |
++ else if (active_width & MLX5_IB_WIDTH_4X) |
590 |
+ *ib_width = IB_WIDTH_4X; |
591 |
+- } else if (active_width & MLX5_IB_WIDTH_8X) { |
592 |
++ else if (active_width & MLX5_IB_WIDTH_8X) |
593 |
+ *ib_width = IB_WIDTH_8X; |
594 |
+- } else if (active_width & MLX5_IB_WIDTH_12X) { |
595 |
++ else if (active_width & MLX5_IB_WIDTH_12X) |
596 |
+ *ib_width = IB_WIDTH_12X; |
597 |
+- } else { |
598 |
+- mlx5_ib_dbg(dev, "Invalid active_width %d\n", |
599 |
++ else { |
600 |
++ mlx5_ib_dbg(dev, "Invalid active_width %d, setting width to default value: 4x\n", |
601 |
+ (int)active_width); |
602 |
+- err = -EINVAL; |
603 |
++ *ib_width = IB_WIDTH_4X; |
604 |
+ } |
605 |
+ |
606 |
+- return err; |
607 |
++ return; |
608 |
+ } |
609 |
+ |
610 |
+ static int mlx5_mtu_to_ib_mtu(int mtu) |
611 |
+@@ -1225,10 +1220,8 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port, |
612 |
+ if (err) |
613 |
+ goto out; |
614 |
+ |
615 |
+- err = translate_active_width(ibdev, ib_link_width_oper, |
616 |
+- &props->active_width); |
617 |
+- if (err) |
618 |
+- goto out; |
619 |
++ translate_active_width(ibdev, ib_link_width_oper, &props->active_width); |
620 |
++ |
621 |
+ err = mlx5_query_port_ib_proto_oper(mdev, &props->active_speed, port); |
622 |
+ if (err) |
623 |
+ goto out; |
624 |
+diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c |
625 |
+index b686a4aaffe8..bee8c0b1d6a5 100644 |
626 |
+--- a/drivers/infiniband/ulp/iser/iser_verbs.c |
627 |
++++ b/drivers/infiniband/ulp/iser/iser_verbs.c |
628 |
+@@ -1123,7 +1123,9 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task, |
629 |
+ IB_MR_CHECK_SIG_STATUS, &mr_status); |
630 |
+ if (ret) { |
631 |
+ pr_err("ib_check_mr_status failed, ret %d\n", ret); |
632 |
+- goto err; |
633 |
++ /* Not a lot we can do, return ambiguous guard error */ |
634 |
++ *sector = 0; |
635 |
++ return 0x1; |
636 |
+ } |
637 |
+ |
638 |
+ if (mr_status.fail_status & IB_MR_CHECK_SIG_STATUS) { |
639 |
+@@ -1151,9 +1153,6 @@ u8 iser_check_task_pi_status(struct iscsi_iser_task *iser_task, |
640 |
+ } |
641 |
+ |
642 |
+ return 0; |
643 |
+-err: |
644 |
+- /* Not alot we can do here, return ambiguous guard error */ |
645 |
+- return 0x1; |
646 |
+ } |
647 |
+ |
648 |
+ void iser_err_comp(struct ib_wc *wc, const char *type) |
649 |
+diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c |
650 |
+index d4b9db487b16..cfc8b94527b9 100644 |
651 |
+--- a/drivers/input/joystick/xpad.c |
652 |
++++ b/drivers/input/joystick/xpad.c |
653 |
+@@ -480,18 +480,18 @@ static const u8 xboxone_hori_init[] = { |
654 |
+ }; |
655 |
+ |
656 |
+ /* |
657 |
+- * This packet is required for some of the PDP pads to start |
658 |
++ * This packet is required for most (all?) of the PDP pads to start |
659 |
+ * sending input reports. These pads include: (0x0e6f:0x02ab), |
660 |
+- * (0x0e6f:0x02a4). |
661 |
++ * (0x0e6f:0x02a4), (0x0e6f:0x02a6). |
662 |
+ */ |
663 |
+ static const u8 xboxone_pdp_init1[] = { |
664 |
+ 0x0a, 0x20, 0x00, 0x03, 0x00, 0x01, 0x14 |
665 |
+ }; |
666 |
+ |
667 |
+ /* |
668 |
+- * This packet is required for some of the PDP pads to start |
669 |
++ * This packet is required for most (all?) of the PDP pads to start |
670 |
+ * sending input reports. These pads include: (0x0e6f:0x02ab), |
671 |
+- * (0x0e6f:0x02a4). |
672 |
++ * (0x0e6f:0x02a4), (0x0e6f:0x02a6). |
673 |
+ */ |
674 |
+ static const u8 xboxone_pdp_init2[] = { |
675 |
+ 0x06, 0x20, 0x00, 0x02, 0x01, 0x00 |
676 |
+@@ -527,12 +527,8 @@ static const struct xboxone_init_packet xboxone_init_packets[] = { |
677 |
+ XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init), |
678 |
+ XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init), |
679 |
+ XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init), |
680 |
+- XBOXONE_INIT_PKT(0x0e6f, 0x02ab, xboxone_pdp_init1), |
681 |
+- XBOXONE_INIT_PKT(0x0e6f, 0x02ab, xboxone_pdp_init2), |
682 |
+- XBOXONE_INIT_PKT(0x0e6f, 0x02a4, xboxone_pdp_init1), |
683 |
+- XBOXONE_INIT_PKT(0x0e6f, 0x02a4, xboxone_pdp_init2), |
684 |
+- XBOXONE_INIT_PKT(0x0e6f, 0x02a6, xboxone_pdp_init1), |
685 |
+- XBOXONE_INIT_PKT(0x0e6f, 0x02a6, xboxone_pdp_init2), |
686 |
++ XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1), |
687 |
++ XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2), |
688 |
+ XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init), |
689 |
+ XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumblebegin_init), |
690 |
+ XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init), |
691 |
+diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c |
692 |
+index 81be6f781f0b..d56001181598 100644 |
693 |
+--- a/drivers/input/keyboard/cros_ec_keyb.c |
694 |
++++ b/drivers/input/keyboard/cros_ec_keyb.c |
695 |
+@@ -493,7 +493,8 @@ static int cros_ec_keyb_register_bs(struct cros_ec_keyb *ckdev) |
696 |
+ for (i = 0; i < ARRAY_SIZE(cros_ec_keyb_bs); i++) { |
697 |
+ const struct cros_ec_bs_map *map = &cros_ec_keyb_bs[i]; |
698 |
+ |
699 |
+- if (buttons & BIT(map->bit)) |
700 |
++ if ((map->ev_type == EV_KEY && (buttons & BIT(map->bit))) || |
701 |
++ (map->ev_type == EV_SW && (switches & BIT(map->bit)))) |
702 |
+ input_set_capability(idev, map->ev_type, map->code); |
703 |
+ } |
704 |
+ |
705 |
+diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c |
706 |
+index f51ae09596ef..403452ef00e6 100644 |
707 |
+--- a/drivers/input/keyboard/matrix_keypad.c |
708 |
++++ b/drivers/input/keyboard/matrix_keypad.c |
709 |
+@@ -407,7 +407,7 @@ matrix_keypad_parse_dt(struct device *dev) |
710 |
+ struct matrix_keypad_platform_data *pdata; |
711 |
+ struct device_node *np = dev->of_node; |
712 |
+ unsigned int *gpios; |
713 |
+- int i, nrow, ncol; |
714 |
++ int ret, i, nrow, ncol; |
715 |
+ |
716 |
+ if (!np) { |
717 |
+ dev_err(dev, "device lacks DT data\n"); |
718 |
+@@ -452,12 +452,19 @@ matrix_keypad_parse_dt(struct device *dev) |
719 |
+ return ERR_PTR(-ENOMEM); |
720 |
+ } |
721 |
+ |
722 |
+- for (i = 0; i < pdata->num_row_gpios; i++) |
723 |
+- gpios[i] = of_get_named_gpio(np, "row-gpios", i); |
724 |
++ for (i = 0; i < nrow; i++) { |
725 |
++ ret = of_get_named_gpio(np, "row-gpios", i); |
726 |
++ if (ret < 0) |
727 |
++ return ERR_PTR(ret); |
728 |
++ gpios[i] = ret; |
729 |
++ } |
730 |
+ |
731 |
+- for (i = 0; i < pdata->num_col_gpios; i++) |
732 |
+- gpios[pdata->num_row_gpios + i] = |
733 |
+- of_get_named_gpio(np, "col-gpios", i); |
734 |
++ for (i = 0; i < ncol; i++) { |
735 |
++ ret = of_get_named_gpio(np, "col-gpios", i); |
736 |
++ if (ret < 0) |
737 |
++ return ERR_PTR(ret); |
738 |
++ gpios[nrow + i] = ret; |
739 |
++ } |
740 |
+ |
741 |
+ pdata->row_gpios = gpios; |
742 |
+ pdata->col_gpios = &gpios[pdata->num_row_gpios]; |
743 |
+@@ -484,10 +491,8 @@ static int matrix_keypad_probe(struct platform_device *pdev) |
744 |
+ pdata = dev_get_platdata(&pdev->dev); |
745 |
+ if (!pdata) { |
746 |
+ pdata = matrix_keypad_parse_dt(&pdev->dev); |
747 |
+- if (IS_ERR(pdata)) { |
748 |
+- dev_err(&pdev->dev, "no platform data defined\n"); |
749 |
++ if (IS_ERR(pdata)) |
750 |
+ return PTR_ERR(pdata); |
751 |
+- } |
752 |
+ } else if (!pdata->keymap_data) { |
753 |
+ dev_err(&pdev->dev, "no keymap data defined\n"); |
754 |
+ return -EINVAL; |
755 |
+diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c |
756 |
+index b0f9d19b3410..a94b6494e71a 100644 |
757 |
+--- a/drivers/input/mouse/elan_i2c_core.c |
758 |
++++ b/drivers/input/mouse/elan_i2c_core.c |
759 |
+@@ -1348,6 +1348,9 @@ static const struct acpi_device_id elan_acpi_id[] = { |
760 |
+ { "ELAN0618", 0 }, |
761 |
+ { "ELAN061C", 0 }, |
762 |
+ { "ELAN061D", 0 }, |
763 |
++ { "ELAN061E", 0 }, |
764 |
++ { "ELAN0620", 0 }, |
765 |
++ { "ELAN0621", 0 }, |
766 |
+ { "ELAN0622", 0 }, |
767 |
+ { "ELAN1000", 0 }, |
768 |
+ { } |
769 |
+diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c |
770 |
+index 5e85f3cca867..c42813d50591 100644 |
771 |
+--- a/drivers/input/mouse/synaptics.c |
772 |
++++ b/drivers/input/mouse/synaptics.c |
773 |
+@@ -170,6 +170,7 @@ static const char * const smbus_pnp_ids[] = { |
774 |
+ "LEN0048", /* X1 Carbon 3 */ |
775 |
+ "LEN0046", /* X250 */ |
776 |
+ "LEN004a", /* W541 */ |
777 |
++ "LEN005b", /* P50 */ |
778 |
+ "LEN0071", /* T480 */ |
779 |
+ "LEN0072", /* X1 Carbon Gen 5 (2017) - Elan/ALPS trackpoint */ |
780 |
+ "LEN0073", /* X1 Carbon G5 (Elantech) */ |
781 |
+diff --git a/drivers/mtd/nand/bbt.c b/drivers/mtd/nand/bbt.c |
782 |
+index 56cde38b92c0..044adf913854 100644 |
783 |
+--- a/drivers/mtd/nand/bbt.c |
784 |
++++ b/drivers/mtd/nand/bbt.c |
785 |
+@@ -27,7 +27,8 @@ int nanddev_bbt_init(struct nand_device *nand) |
786 |
+ unsigned int nwords = DIV_ROUND_UP(nblocks * bits_per_block, |
787 |
+ BITS_PER_LONG); |
788 |
+ |
789 |
+- nand->bbt.cache = kzalloc(nwords, GFP_KERNEL); |
790 |
++ nand->bbt.cache = kcalloc(nwords, sizeof(*nand->bbt.cache), |
791 |
++ GFP_KERNEL); |
792 |
+ if (!nand->bbt.cache) |
793 |
+ return -ENOMEM; |
794 |
+ |
795 |
+diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c |
796 |
+index 6eccfa82ca94..3c342700bf5f 100644 |
797 |
+--- a/drivers/net/ethernet/intel/i40e/i40e_main.c |
798 |
++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c |
799 |
+@@ -1409,7 +1409,7 @@ void __i40e_del_filter(struct i40e_vsi *vsi, struct i40e_mac_filter *f) |
800 |
+ } |
801 |
+ |
802 |
+ vsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED; |
803 |
+- set_bit(__I40E_MACVLAN_SYNC_PENDING, vsi->state); |
804 |
++ set_bit(__I40E_MACVLAN_SYNC_PENDING, vsi->back->state); |
805 |
+ } |
806 |
+ |
807 |
+ /** |
808 |
+diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c |
809 |
+index f3cae733ae2d..9acb5b44ce4c 100644 |
810 |
+--- a/drivers/scsi/lpfc/lpfc_init.c |
811 |
++++ b/drivers/scsi/lpfc/lpfc_init.c |
812 |
+@@ -167,7 +167,11 @@ lpfc_config_port_prep(struct lpfc_hba *phba) |
813 |
+ sizeof(phba->wwpn)); |
814 |
+ } |
815 |
+ |
816 |
+- phba->sli3_options = 0x0; |
817 |
++ /* |
818 |
++ * Clear all option bits except LPFC_SLI3_BG_ENABLED, |
819 |
++ * which was already set in lpfc_get_cfgparam() |
820 |
++ */ |
821 |
++ phba->sli3_options &= (uint32_t)LPFC_SLI3_BG_ENABLED; |
822 |
+ |
823 |
+ /* Setup and issue mailbox READ REV command */ |
824 |
+ lpfc_read_rev(phba, pmb); |
825 |
+diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c |
826 |
+index a95c823cd1a4..be2bac9355cd 100644 |
827 |
+--- a/drivers/scsi/lpfc/lpfc_sli.c |
828 |
++++ b/drivers/scsi/lpfc/lpfc_sli.c |
829 |
+@@ -4969,7 +4969,6 @@ lpfc_sli_config_port(struct lpfc_hba *phba, int sli_mode) |
830 |
+ phba->sli3_options &= ~(LPFC_SLI3_NPIV_ENABLED | |
831 |
+ LPFC_SLI3_HBQ_ENABLED | |
832 |
+ LPFC_SLI3_CRP_ENABLED | |
833 |
+- LPFC_SLI3_BG_ENABLED | |
834 |
+ LPFC_SLI3_DSS_ENABLED); |
835 |
+ if (rc != MBX_SUCCESS) { |
836 |
+ lpfc_printf_log(phba, KERN_ERR, LOG_INIT, |
837 |
+diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c |
838 |
+index f4d0ef695225..8a111ab33b50 100644 |
839 |
+--- a/drivers/tty/serial/kgdboc.c |
840 |
++++ b/drivers/tty/serial/kgdboc.c |
841 |
+@@ -128,24 +128,6 @@ static void kgdboc_unregister_kbd(void) |
842 |
+ #define kgdboc_restore_input() |
843 |
+ #endif /* ! CONFIG_KDB_KEYBOARD */ |
844 |
+ |
845 |
+-static int kgdboc_option_setup(char *opt) |
846 |
+-{ |
847 |
+- if (!opt) { |
848 |
+- pr_err("kgdboc: config string not provided\n"); |
849 |
+- return -EINVAL; |
850 |
+- } |
851 |
+- |
852 |
+- if (strlen(opt) >= MAX_CONFIG_LEN) { |
853 |
+- printk(KERN_ERR "kgdboc: config string too long\n"); |
854 |
+- return -ENOSPC; |
855 |
+- } |
856 |
+- strcpy(config, opt); |
857 |
+- |
858 |
+- return 0; |
859 |
+-} |
860 |
+- |
861 |
+-__setup("kgdboc=", kgdboc_option_setup); |
862 |
+- |
863 |
+ static void cleanup_kgdboc(void) |
864 |
+ { |
865 |
+ if (kgdb_unregister_nmi_console()) |
866 |
+@@ -159,15 +141,13 @@ static int configure_kgdboc(void) |
867 |
+ { |
868 |
+ struct tty_driver *p; |
869 |
+ int tty_line = 0; |
870 |
+- int err; |
871 |
++ int err = -ENODEV; |
872 |
+ char *cptr = config; |
873 |
+ struct console *cons; |
874 |
+ |
875 |
+- err = kgdboc_option_setup(config); |
876 |
+- if (err || !strlen(config) || isspace(config[0])) |
877 |
++ if (!strlen(config) || isspace(config[0])) |
878 |
+ goto noconfig; |
879 |
+ |
880 |
+- err = -ENODEV; |
881 |
+ kgdboc_io_ops.is_console = 0; |
882 |
+ kgdb_tty_driver = NULL; |
883 |
+ |
884 |
+@@ -316,6 +296,25 @@ static struct kgdb_io kgdboc_io_ops = { |
885 |
+ }; |
886 |
+ |
887 |
+ #ifdef CONFIG_KGDB_SERIAL_CONSOLE |
888 |
++static int kgdboc_option_setup(char *opt) |
889 |
++{ |
890 |
++ if (!opt) { |
891 |
++ pr_err("config string not provided\n"); |
892 |
++ return -EINVAL; |
893 |
++ } |
894 |
++ |
895 |
++ if (strlen(opt) >= MAX_CONFIG_LEN) { |
896 |
++ pr_err("config string too long\n"); |
897 |
++ return -ENOSPC; |
898 |
++ } |
899 |
++ strcpy(config, opt); |
900 |
++ |
901 |
++ return 0; |
902 |
++} |
903 |
++ |
904 |
++__setup("kgdboc=", kgdboc_option_setup); |
905 |
++ |
906 |
++ |
907 |
+ /* This is only available if kgdboc is a built in for early debugging */ |
908 |
+ static int __init kgdboc_early_init(char *opt) |
909 |
+ { |
910 |
+diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c |
911 |
+index d385778b628c..3ec712cba58e 100644 |
912 |
+--- a/fs/btrfs/tree-checker.c |
913 |
++++ b/fs/btrfs/tree-checker.c |
914 |
+@@ -389,13 +389,11 @@ static int check_block_group_item(struct btrfs_fs_info *fs_info, |
915 |
+ |
916 |
+ /* |
917 |
+ * Here we don't really care about alignment since extent allocator can |
918 |
+- * handle it. We care more about the size, as if one block group is |
919 |
+- * larger than maximum size, it's must be some obvious corruption. |
920 |
++ * handle it. We care more about the size. |
921 |
+ */ |
922 |
+- if (key->offset > BTRFS_MAX_DATA_CHUNK_SIZE || key->offset == 0) { |
923 |
++ if (key->offset == 0) { |
924 |
+ block_group_err(fs_info, leaf, slot, |
925 |
+- "invalid block group size, have %llu expect (0, %llu]", |
926 |
+- key->offset, BTRFS_MAX_DATA_CHUNK_SIZE); |
927 |
++ "invalid block group size 0"); |
928 |
+ return -EUCLEAN; |
929 |
+ } |
930 |
+ |
931 |
+diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h |
932 |
+index 538ba1a58f5b..e9de8ad0bad7 100644 |
933 |
+--- a/include/linux/tracepoint.h |
934 |
++++ b/include/linux/tracepoint.h |
935 |
+@@ -166,7 +166,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) |
936 |
+ struct tracepoint_func *it_func_ptr; \ |
937 |
+ void *it_func; \ |
938 |
+ void *__data; \ |
939 |
+- int __maybe_unused idx = 0; \ |
940 |
++ int __maybe_unused __idx = 0; \ |
941 |
+ \ |
942 |
+ if (!(cond)) \ |
943 |
+ return; \ |
944 |
+@@ -182,7 +182,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) |
945 |
+ * doesn't work from the idle path. \ |
946 |
+ */ \ |
947 |
+ if (rcuidle) { \ |
948 |
+- idx = srcu_read_lock_notrace(&tracepoint_srcu); \ |
949 |
++ __idx = srcu_read_lock_notrace(&tracepoint_srcu);\ |
950 |
+ rcu_irq_enter_irqson(); \ |
951 |
+ } \ |
952 |
+ \ |
953 |
+@@ -198,7 +198,7 @@ static inline struct tracepoint *tracepoint_ptr_deref(tracepoint_ptr_t *p) |
954 |
+ \ |
955 |
+ if (rcuidle) { \ |
956 |
+ rcu_irq_exit_irqson(); \ |
957 |
+- srcu_read_unlock_notrace(&tracepoint_srcu, idx);\ |
958 |
++ srcu_read_unlock_notrace(&tracepoint_srcu, __idx);\ |
959 |
+ } \ |
960 |
+ \ |
961 |
+ preempt_enable_notrace(); \ |
962 |
+diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h |
963 |
+index 0be866c91f62..5e1a7578c9ed 100644 |
964 |
+--- a/include/trace/events/sched.h |
965 |
++++ b/include/trace/events/sched.h |
966 |
+@@ -107,6 +107,8 @@ DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new, |
967 |
+ #ifdef CREATE_TRACE_POINTS |
968 |
+ static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p) |
969 |
+ { |
970 |
++ unsigned int state; |
971 |
++ |
972 |
+ #ifdef CONFIG_SCHED_DEBUG |
973 |
+ BUG_ON(p != current); |
974 |
+ #endif /* CONFIG_SCHED_DEBUG */ |
975 |
+@@ -118,7 +120,15 @@ static inline long __trace_sched_switch_state(bool preempt, struct task_struct * |
976 |
+ if (preempt) |
977 |
+ return TASK_REPORT_MAX; |
978 |
+ |
979 |
+- return 1 << task_state_index(p); |
980 |
++ /* |
981 |
++ * task_state_index() uses fls() and returns a value from 0-8 range. |
982 |
++ * Decrement it by 1 (except TASK_RUNNING state i.e 0) before using |
983 |
++ * it for left shift operation to get the correct task->state |
984 |
++ * mapping. |
985 |
++ */ |
986 |
++ state = task_state_index(p); |
987 |
++ |
988 |
++ return state ? (1 << (state - 1)) : state; |
989 |
+ } |
990 |
+ #endif /* CREATE_TRACE_POINTS */ |
991 |
+ |
992 |
+diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c |
993 |
+index 3207a4d26849..578d4ac54484 100644 |
994 |
+--- a/kernel/events/uprobes.c |
995 |
++++ b/kernel/events/uprobes.c |
996 |
+@@ -616,7 +616,7 @@ static int prepare_uprobe(struct uprobe *uprobe, struct file *file, |
997 |
+ BUG_ON((uprobe->offset & ~PAGE_MASK) + |
998 |
+ UPROBE_SWBP_INSN_SIZE > PAGE_SIZE); |
999 |
+ |
1000 |
+- smp_wmb(); /* pairs with rmb() in find_active_uprobe() */ |
1001 |
++ smp_wmb(); /* pairs with the smp_rmb() in handle_swbp() */ |
1002 |
+ set_bit(UPROBE_COPY_INSN, &uprobe->flags); |
1003 |
+ |
1004 |
+ out: |
1005 |
+@@ -1914,10 +1914,18 @@ static void handle_swbp(struct pt_regs *regs) |
1006 |
+ * After we hit the bp, _unregister + _register can install the |
1007 |
+ * new and not-yet-analyzed uprobe at the same address, restart. |
1008 |
+ */ |
1009 |
+- smp_rmb(); /* pairs with wmb() in install_breakpoint() */ |
1010 |
+ if (unlikely(!test_bit(UPROBE_COPY_INSN, &uprobe->flags))) |
1011 |
+ goto out; |
1012 |
+ |
1013 |
++ /* |
1014 |
++ * Pairs with the smp_wmb() in prepare_uprobe(). |
1015 |
++ * |
1016 |
++ * Guarantees that if we see the UPROBE_COPY_INSN bit set, then |
1017 |
++ * we must also see the stores to &uprobe->arch performed by the |
1018 |
++ * prepare_uprobe() call. |
1019 |
++ */ |
1020 |
++ smp_rmb(); |
1021 |
++ |
1022 |
+ /* Tracing handlers use ->utask to communicate with fetch methods */ |
1023 |
+ if (!get_utask()) |
1024 |
+ goto out; |
1025 |
+diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h |
1026 |
+index 3b8c0e24ab30..447bd96ee658 100644 |
1027 |
+--- a/kernel/trace/trace.h |
1028 |
++++ b/kernel/trace/trace.h |
1029 |
+@@ -512,12 +512,44 @@ enum { |
1030 |
+ * can only be modified by current, we can reuse trace_recursion. |
1031 |
+ */ |
1032 |
+ TRACE_IRQ_BIT, |
1033 |
++ |
1034 |
++ /* Set if the function is in the set_graph_function file */ |
1035 |
++ TRACE_GRAPH_BIT, |
1036 |
++ |
1037 |
++ /* |
1038 |
++ * In the very unlikely case that an interrupt came in |
1039 |
++ * at a start of graph tracing, and we want to trace |
1040 |
++ * the function in that interrupt, the depth can be greater |
1041 |
++ * than zero, because of the preempted start of a previous |
1042 |
++ * trace. In an even more unlikely case, depth could be 2 |
1043 |
++ * if a softirq interrupted the start of graph tracing, |
1044 |
++ * followed by an interrupt preempting a start of graph |
1045 |
++ * tracing in the softirq, and depth can even be 3 |
1046 |
++ * if an NMI came in at the start of an interrupt function |
1047 |
++ * that preempted a softirq start of a function that |
1048 |
++ * preempted normal context!!!! Luckily, it can't be |
1049 |
++ * greater than 3, so the next two bits are a mask |
1050 |
++ * of what the depth is when we set TRACE_GRAPH_BIT |
1051 |
++ */ |
1052 |
++ |
1053 |
++ TRACE_GRAPH_DEPTH_START_BIT, |
1054 |
++ TRACE_GRAPH_DEPTH_END_BIT, |
1055 |
+ }; |
1056 |
+ |
1057 |
+ #define trace_recursion_set(bit) do { (current)->trace_recursion |= (1<<(bit)); } while (0) |
1058 |
+ #define trace_recursion_clear(bit) do { (current)->trace_recursion &= ~(1<<(bit)); } while (0) |
1059 |
+ #define trace_recursion_test(bit) ((current)->trace_recursion & (1<<(bit))) |
1060 |
+ |
1061 |
++#define trace_recursion_depth() \ |
1062 |
++ (((current)->trace_recursion >> TRACE_GRAPH_DEPTH_START_BIT) & 3) |
1063 |
++#define trace_recursion_set_depth(depth) \ |
1064 |
++ do { \ |
1065 |
++ current->trace_recursion &= \ |
1066 |
++ ~(3 << TRACE_GRAPH_DEPTH_START_BIT); \ |
1067 |
++ current->trace_recursion |= \ |
1068 |
++ ((depth) & 3) << TRACE_GRAPH_DEPTH_START_BIT; \ |
1069 |
++ } while (0) |
1070 |
++ |
1071 |
+ #define TRACE_CONTEXT_BITS 4 |
1072 |
+ |
1073 |
+ #define TRACE_FTRACE_START TRACE_FTRACE_BIT |
1074 |
+@@ -843,8 +875,9 @@ extern void __trace_graph_return(struct trace_array *tr, |
1075 |
+ extern struct ftrace_hash *ftrace_graph_hash; |
1076 |
+ extern struct ftrace_hash *ftrace_graph_notrace_hash; |
1077 |
+ |
1078 |
+-static inline int ftrace_graph_addr(unsigned long addr) |
1079 |
++static inline int ftrace_graph_addr(struct ftrace_graph_ent *trace) |
1080 |
+ { |
1081 |
++ unsigned long addr = trace->func; |
1082 |
+ int ret = 0; |
1083 |
+ |
1084 |
+ preempt_disable_notrace(); |
1085 |
+@@ -855,6 +888,14 @@ static inline int ftrace_graph_addr(unsigned long addr) |
1086 |
+ } |
1087 |
+ |
1088 |
+ if (ftrace_lookup_ip(ftrace_graph_hash, addr)) { |
1089 |
++ |
1090 |
++ /* |
1091 |
++ * This needs to be cleared on the return functions |
1092 |
++ * when the depth is zero. |
1093 |
++ */ |
1094 |
++ trace_recursion_set(TRACE_GRAPH_BIT); |
1095 |
++ trace_recursion_set_depth(trace->depth); |
1096 |
++ |
1097 |
+ /* |
1098 |
+ * If no irqs are to be traced, but a set_graph_function |
1099 |
+ * is set, and called by an interrupt handler, we still |
1100 |
+@@ -872,6 +913,13 @@ out: |
1101 |
+ return ret; |
1102 |
+ } |
1103 |
+ |
1104 |
++static inline void ftrace_graph_addr_finish(struct ftrace_graph_ret *trace) |
1105 |
++{ |
1106 |
++ if (trace_recursion_test(TRACE_GRAPH_BIT) && |
1107 |
++ trace->depth == trace_recursion_depth()) |
1108 |
++ trace_recursion_clear(TRACE_GRAPH_BIT); |
1109 |
++} |
1110 |
++ |
1111 |
+ static inline int ftrace_graph_notrace_addr(unsigned long addr) |
1112 |
+ { |
1113 |
+ int ret = 0; |
1114 |
+@@ -885,7 +933,7 @@ static inline int ftrace_graph_notrace_addr(unsigned long addr) |
1115 |
+ return ret; |
1116 |
+ } |
1117 |
+ #else |
1118 |
+-static inline int ftrace_graph_addr(unsigned long addr) |
1119 |
++static inline int ftrace_graph_addr(struct ftrace_graph_ent *trace) |
1120 |
+ { |
1121 |
+ return 1; |
1122 |
+ } |
1123 |
+@@ -894,6 +942,8 @@ static inline int ftrace_graph_notrace_addr(unsigned long addr) |
1124 |
+ { |
1125 |
+ return 0; |
1126 |
+ } |
1127 |
++static inline void ftrace_graph_addr_finish(struct ftrace_graph_ret *trace) |
1128 |
++{ } |
1129 |
+ #endif /* CONFIG_DYNAMIC_FTRACE */ |
1130 |
+ |
1131 |
+ extern unsigned int fgraph_max_depth; |
1132 |
+@@ -901,7 +951,8 @@ extern unsigned int fgraph_max_depth; |
1133 |
+ static inline bool ftrace_graph_ignore_func(struct ftrace_graph_ent *trace) |
1134 |
+ { |
1135 |
+ /* trace it when it is-nested-in or is a function enabled. */ |
1136 |
+- return !(trace->depth || ftrace_graph_addr(trace->func)) || |
1137 |
++ return !(trace_recursion_test(TRACE_GRAPH_BIT) || |
1138 |
++ ftrace_graph_addr(trace)) || |
1139 |
+ (trace->depth < 0) || |
1140 |
+ (fgraph_max_depth && trace->depth >= fgraph_max_depth); |
1141 |
+ } |
1142 |
+diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c |
1143 |
+index 2561460d7baf..086af4f5c3e8 100644 |
1144 |
+--- a/kernel/trace/trace_functions_graph.c |
1145 |
++++ b/kernel/trace/trace_functions_graph.c |
1146 |
+@@ -509,6 +509,8 @@ void trace_graph_return(struct ftrace_graph_ret *trace) |
1147 |
+ int cpu; |
1148 |
+ int pc; |
1149 |
+ |
1150 |
++ ftrace_graph_addr_finish(trace); |
1151 |
++ |
1152 |
+ local_irq_save(flags); |
1153 |
+ cpu = raw_smp_processor_id(); |
1154 |
+ data = per_cpu_ptr(tr->trace_buffer.data, cpu); |
1155 |
+@@ -532,6 +534,8 @@ void set_graph_array(struct trace_array *tr) |
1156 |
+ |
1157 |
+ static void trace_graph_thresh_return(struct ftrace_graph_ret *trace) |
1158 |
+ { |
1159 |
++ ftrace_graph_addr_finish(trace); |
1160 |
++ |
1161 |
+ if (tracing_thresh && |
1162 |
+ (trace->rettime - trace->calltime < tracing_thresh)) |
1163 |
+ return; |
1164 |
+diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c |
1165 |
+index b7357f9f82a3..98ea6d28df15 100644 |
1166 |
+--- a/kernel/trace/trace_irqsoff.c |
1167 |
++++ b/kernel/trace/trace_irqsoff.c |
1168 |
+@@ -208,6 +208,8 @@ static void irqsoff_graph_return(struct ftrace_graph_ret *trace) |
1169 |
+ unsigned long flags; |
1170 |
+ int pc; |
1171 |
+ |
1172 |
++ ftrace_graph_addr_finish(trace); |
1173 |
++ |
1174 |
+ if (!func_prolog_dec(tr, &data, &flags)) |
1175 |
+ return; |
1176 |
+ |
1177 |
+diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c |
1178 |
+index a86b303e6c67..7d04b9890755 100644 |
1179 |
+--- a/kernel/trace/trace_sched_wakeup.c |
1180 |
++++ b/kernel/trace/trace_sched_wakeup.c |
1181 |
+@@ -270,6 +270,8 @@ static void wakeup_graph_return(struct ftrace_graph_ret *trace) |
1182 |
+ unsigned long flags; |
1183 |
+ int pc; |
1184 |
+ |
1185 |
++ ftrace_graph_addr_finish(trace); |
1186 |
++ |
1187 |
+ if (!func_prolog_preempt_disable(tr, &data, &pc)) |
1188 |
+ return; |
1189 |
+ |
1190 |
+diff --git a/lib/test_hexdump.c b/lib/test_hexdump.c |
1191 |
+index 626f580b4ff7..5144899d3c6b 100644 |
1192 |
+--- a/lib/test_hexdump.c |
1193 |
++++ b/lib/test_hexdump.c |
1194 |
+@@ -99,7 +99,7 @@ static void __init test_hexdump_prepare_test(size_t len, int rowsize, |
1195 |
+ const char *q = *result++; |
1196 |
+ size_t amount = strlen(q); |
1197 |
+ |
1198 |
+- strncpy(p, q, amount); |
1199 |
++ memcpy(p, q, amount); |
1200 |
+ p += amount; |
1201 |
+ |
1202 |
+ *p++ = ' '; |
1203 |
+diff --git a/mm/hugetlb.c b/mm/hugetlb.c |
1204 |
+index 1931a3d9b282..309fb8c969af 100644 |
1205 |
+--- a/mm/hugetlb.c |
1206 |
++++ b/mm/hugetlb.c |
1207 |
+@@ -4080,7 +4080,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, |
1208 |
+ |
1209 |
+ /* fallback to copy_from_user outside mmap_sem */ |
1210 |
+ if (unlikely(ret)) { |
1211 |
+- ret = -EFAULT; |
1212 |
++ ret = -ENOENT; |
1213 |
+ *pagep = page; |
1214 |
+ /* don't free the page */ |
1215 |
+ goto out; |
1216 |
+diff --git a/mm/shmem.c b/mm/shmem.c |
1217 |
+index 0b02b539072e..b6cf0e8e685b 100644 |
1218 |
+--- a/mm/shmem.c |
1219 |
++++ b/mm/shmem.c |
1220 |
+@@ -2264,6 +2264,7 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm, |
1221 |
+ struct page *page; |
1222 |
+ pte_t _dst_pte, *dst_pte; |
1223 |
+ int ret; |
1224 |
++ pgoff_t offset, max_off; |
1225 |
+ |
1226 |
+ ret = -ENOMEM; |
1227 |
+ if (!shmem_inode_acct_block(inode, 1)) |
1228 |
+@@ -2286,7 +2287,7 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm, |
1229 |
+ *pagep = page; |
1230 |
+ shmem_inode_unacct_blocks(inode, 1); |
1231 |
+ /* don't free the page */ |
1232 |
+- return -EFAULT; |
1233 |
++ return -ENOENT; |
1234 |
+ } |
1235 |
+ } else { /* mfill_zeropage_atomic */ |
1236 |
+ clear_highpage(page); |
1237 |
+@@ -2301,6 +2302,12 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm, |
1238 |
+ __SetPageSwapBacked(page); |
1239 |
+ __SetPageUptodate(page); |
1240 |
+ |
1241 |
++ ret = -EFAULT; |
1242 |
++ offset = linear_page_index(dst_vma, dst_addr); |
1243 |
++ max_off = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE); |
1244 |
++ if (unlikely(offset >= max_off)) |
1245 |
++ goto out_release; |
1246 |
++ |
1247 |
+ ret = mem_cgroup_try_charge_delay(page, dst_mm, gfp, &memcg, false); |
1248 |
+ if (ret) |
1249 |
+ goto out_release; |
1250 |
+@@ -2318,9 +2325,25 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm, |
1251 |
+ _dst_pte = mk_pte(page, dst_vma->vm_page_prot); |
1252 |
+ if (dst_vma->vm_flags & VM_WRITE) |
1253 |
+ _dst_pte = pte_mkwrite(pte_mkdirty(_dst_pte)); |
1254 |
++ else { |
1255 |
++ /* |
1256 |
++ * We don't set the pte dirty if the vma has no |
1257 |
++ * VM_WRITE permission, so mark the page dirty or it |
1258 |
++ * could be freed from under us. We could do it |
1259 |
++ * unconditionally before unlock_page(), but doing it |
1260 |
++ * only if VM_WRITE is not set is faster. |
1261 |
++ */ |
1262 |
++ set_page_dirty(page); |
1263 |
++ } |
1264 |
+ |
1265 |
+- ret = -EEXIST; |
1266 |
+ dst_pte = pte_offset_map_lock(dst_mm, dst_pmd, dst_addr, &ptl); |
1267 |
++ |
1268 |
++ ret = -EFAULT; |
1269 |
++ max_off = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE); |
1270 |
++ if (unlikely(offset >= max_off)) |
1271 |
++ goto out_release_uncharge_unlock; |
1272 |
++ |
1273 |
++ ret = -EEXIST; |
1274 |
+ if (!pte_none(*dst_pte)) |
1275 |
+ goto out_release_uncharge_unlock; |
1276 |
+ |
1277 |
+@@ -2338,13 +2361,15 @@ static int shmem_mfill_atomic_pte(struct mm_struct *dst_mm, |
1278 |
+ |
1279 |
+ /* No need to invalidate - it was non-present before */ |
1280 |
+ update_mmu_cache(dst_vma, dst_addr, dst_pte); |
1281 |
+- unlock_page(page); |
1282 |
+ pte_unmap_unlock(dst_pte, ptl); |
1283 |
++ unlock_page(page); |
1284 |
+ ret = 0; |
1285 |
+ out: |
1286 |
+ return ret; |
1287 |
+ out_release_uncharge_unlock: |
1288 |
+ pte_unmap_unlock(dst_pte, ptl); |
1289 |
++ ClearPageDirty(page); |
1290 |
++ delete_from_page_cache(page); |
1291 |
+ out_release_uncharge: |
1292 |
+ mem_cgroup_cancel_charge(page, memcg, false); |
1293 |
+ out_release: |
1294 |
+diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c |
1295 |
+index f0af11b1cdf3..458acda96f20 100644 |
1296 |
+--- a/mm/userfaultfd.c |
1297 |
++++ b/mm/userfaultfd.c |
1298 |
+@@ -33,6 +33,8 @@ static int mcopy_atomic_pte(struct mm_struct *dst_mm, |
1299 |
+ void *page_kaddr; |
1300 |
+ int ret; |
1301 |
+ struct page *page; |
1302 |
++ pgoff_t offset, max_off; |
1303 |
++ struct inode *inode; |
1304 |
+ |
1305 |
+ if (!*pagep) { |
1306 |
+ ret = -ENOMEM; |
1307 |
+@@ -48,7 +50,7 @@ static int mcopy_atomic_pte(struct mm_struct *dst_mm, |
1308 |
+ |
1309 |
+ /* fallback to copy_from_user outside mmap_sem */ |
1310 |
+ if (unlikely(ret)) { |
1311 |
+- ret = -EFAULT; |
1312 |
++ ret = -ENOENT; |
1313 |
+ *pagep = page; |
1314 |
+ /* don't free the page */ |
1315 |
+ goto out; |
1316 |
+@@ -73,8 +75,17 @@ static int mcopy_atomic_pte(struct mm_struct *dst_mm, |
1317 |
+ if (dst_vma->vm_flags & VM_WRITE) |
1318 |
+ _dst_pte = pte_mkwrite(pte_mkdirty(_dst_pte)); |
1319 |
+ |
1320 |
+- ret = -EEXIST; |
1321 |
+ dst_pte = pte_offset_map_lock(dst_mm, dst_pmd, dst_addr, &ptl); |
1322 |
++ if (dst_vma->vm_file) { |
1323 |
++ /* the shmem MAP_PRIVATE case requires checking the i_size */ |
1324 |
++ inode = dst_vma->vm_file->f_inode; |
1325 |
++ offset = linear_page_index(dst_vma, dst_addr); |
1326 |
++ max_off = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE); |
1327 |
++ ret = -EFAULT; |
1328 |
++ if (unlikely(offset >= max_off)) |
1329 |
++ goto out_release_uncharge_unlock; |
1330 |
++ } |
1331 |
++ ret = -EEXIST; |
1332 |
+ if (!pte_none(*dst_pte)) |
1333 |
+ goto out_release_uncharge_unlock; |
1334 |
+ |
1335 |
+@@ -108,11 +119,22 @@ static int mfill_zeropage_pte(struct mm_struct *dst_mm, |
1336 |
+ pte_t _dst_pte, *dst_pte; |
1337 |
+ spinlock_t *ptl; |
1338 |
+ int ret; |
1339 |
++ pgoff_t offset, max_off; |
1340 |
++ struct inode *inode; |
1341 |
+ |
1342 |
+ _dst_pte = pte_mkspecial(pfn_pte(my_zero_pfn(dst_addr), |
1343 |
+ dst_vma->vm_page_prot)); |
1344 |
+- ret = -EEXIST; |
1345 |
+ dst_pte = pte_offset_map_lock(dst_mm, dst_pmd, dst_addr, &ptl); |
1346 |
++ if (dst_vma->vm_file) { |
1347 |
++ /* the shmem MAP_PRIVATE case requires checking the i_size */ |
1348 |
++ inode = dst_vma->vm_file->f_inode; |
1349 |
++ offset = linear_page_index(dst_vma, dst_addr); |
1350 |
++ max_off = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE); |
1351 |
++ ret = -EFAULT; |
1352 |
++ if (unlikely(offset >= max_off)) |
1353 |
++ goto out_unlock; |
1354 |
++ } |
1355 |
++ ret = -EEXIST; |
1356 |
+ if (!pte_none(*dst_pte)) |
1357 |
+ goto out_unlock; |
1358 |
+ set_pte_at(dst_mm, dst_addr, dst_pte, _dst_pte); |
1359 |
+@@ -275,7 +297,7 @@ retry: |
1360 |
+ |
1361 |
+ cond_resched(); |
1362 |
+ |
1363 |
+- if (unlikely(err == -EFAULT)) { |
1364 |
++ if (unlikely(err == -ENOENT)) { |
1365 |
+ up_read(&dst_mm->mmap_sem); |
1366 |
+ BUG_ON(!page); |
1367 |
+ |
1368 |
+@@ -381,7 +403,17 @@ static __always_inline ssize_t mfill_atomic_pte(struct mm_struct *dst_mm, |
1369 |
+ { |
1370 |
+ ssize_t err; |
1371 |
+ |
1372 |
+- if (vma_is_anonymous(dst_vma)) { |
1373 |
++ /* |
1374 |
++ * The normal page fault path for a shmem will invoke the |
1375 |
++ * fault, fill the hole in the file and COW it right away. The |
1376 |
++ * result generates plain anonymous memory. So when we are |
1377 |
++ * asked to fill an hole in a MAP_PRIVATE shmem mapping, we'll |
1378 |
++ * generate anonymous memory directly without actually filling |
1379 |
++ * the hole. For the MAP_PRIVATE case the robustness check |
1380 |
++ * only happens in the pagetable (to verify it's still none) |
1381 |
++ * and not in the radix tree. |
1382 |
++ */ |
1383 |
++ if (!(dst_vma->vm_flags & VM_SHARED)) { |
1384 |
+ if (!zeropage) |
1385 |
+ err = mcopy_atomic_pte(dst_mm, dst_pmd, dst_vma, |
1386 |
+ dst_addr, src_addr, page); |
1387 |
+@@ -486,7 +518,8 @@ retry: |
1388 |
+ * dst_vma. |
1389 |
+ */ |
1390 |
+ err = -ENOMEM; |
1391 |
+- if (vma_is_anonymous(dst_vma) && unlikely(anon_vma_prepare(dst_vma))) |
1392 |
++ if (!(dst_vma->vm_flags & VM_SHARED) && |
1393 |
++ unlikely(anon_vma_prepare(dst_vma))) |
1394 |
+ goto out_unlock; |
1395 |
+ |
1396 |
+ while (src_addr < src_start + len) { |
1397 |
+@@ -527,7 +560,7 @@ retry: |
1398 |
+ src_addr, &page, zeropage); |
1399 |
+ cond_resched(); |
1400 |
+ |
1401 |
+- if (unlikely(err == -EFAULT)) { |
1402 |
++ if (unlikely(err == -ENOENT)) { |
1403 |
+ void *page_kaddr; |
1404 |
+ |
1405 |
+ up_read(&dst_mm->mmap_sem); |
1406 |
+diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c |
1407 |
+index 2627b5d812e9..b84c0059214f 100644 |
1408 |
+--- a/net/tipc/topsrv.c |
1409 |
++++ b/net/tipc/topsrv.c |
1410 |
+@@ -657,7 +657,7 @@ int tipc_topsrv_start(struct net *net) |
1411 |
+ srv->max_rcvbuf_size = sizeof(struct tipc_subscr); |
1412 |
+ INIT_WORK(&srv->awork, tipc_topsrv_accept); |
1413 |
+ |
1414 |
+- strncpy(srv->name, name, strlen(name) + 1); |
1415 |
++ strscpy(srv->name, name, sizeof(srv->name)); |
1416 |
+ tn->topsrv = srv; |
1417 |
+ atomic_set(&tn->subscription_count, 0); |
1418 |
+ |
1419 |
+diff --git a/scripts/unifdef.c b/scripts/unifdef.c |
1420 |
+index 7493c0ee51cc..db00e3e30a59 100644 |
1421 |
+--- a/scripts/unifdef.c |
1422 |
++++ b/scripts/unifdef.c |
1423 |
+@@ -395,7 +395,7 @@ usage(void) |
1424 |
+ * When we have processed a group that starts off with a known-false |
1425 |
+ * #if/#elif sequence (which has therefore been deleted) followed by a |
1426 |
+ * #elif that we don't understand and therefore must keep, we edit the |
1427 |
+- * latter into a #if to keep the nesting correct. We use strncpy() to |
1428 |
++ * latter into a #if to keep the nesting correct. We use memcpy() to |
1429 |
+ * overwrite the 4 byte token "elif" with "if " without a '\0' byte. |
1430 |
+ * |
1431 |
+ * When we find a true #elif in a group, the following block will |
1432 |
+@@ -450,7 +450,7 @@ static void Idrop (void) { Fdrop(); ignoreon(); } |
1433 |
+ static void Itrue (void) { Ftrue(); ignoreon(); } |
1434 |
+ static void Ifalse(void) { Ffalse(); ignoreon(); } |
1435 |
+ /* modify this line */ |
1436 |
+-static void Mpass (void) { strncpy(keyword, "if ", 4); Pelif(); } |
1437 |
++static void Mpass (void) { memcpy(keyword, "if ", 4); Pelif(); } |
1438 |
+ static void Mtrue (void) { keywordedit("else"); state(IS_TRUE_MIDDLE); } |
1439 |
+ static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); } |
1440 |
+ static void Melse (void) { keywordedit("endif"); state(IS_FALSE_ELSE); } |
1441 |
+diff --git a/security/selinux/nlmsgtab.c b/security/selinux/nlmsgtab.c |
1442 |
+index 74b951f55608..9cec81209617 100644 |
1443 |
+--- a/security/selinux/nlmsgtab.c |
1444 |
++++ b/security/selinux/nlmsgtab.c |
1445 |
+@@ -80,6 +80,9 @@ static const struct nlmsg_perm nlmsg_route_perms[] = |
1446 |
+ { RTM_NEWSTATS, NETLINK_ROUTE_SOCKET__NLMSG_READ }, |
1447 |
+ { RTM_GETSTATS, NETLINK_ROUTE_SOCKET__NLMSG_READ }, |
1448 |
+ { RTM_NEWCACHEREPORT, NETLINK_ROUTE_SOCKET__NLMSG_READ }, |
1449 |
++ { RTM_NEWCHAIN, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, |
1450 |
++ { RTM_DELCHAIN, NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, |
1451 |
++ { RTM_GETCHAIN, NETLINK_ROUTE_SOCKET__NLMSG_READ }, |
1452 |
+ }; |
1453 |
+ |
1454 |
+ static const struct nlmsg_perm nlmsg_tcpdiag_perms[] = |
1455 |
+@@ -158,7 +161,11 @@ int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm) |
1456 |
+ |
1457 |
+ switch (sclass) { |
1458 |
+ case SECCLASS_NETLINK_ROUTE_SOCKET: |
1459 |
+- /* RTM_MAX always point to RTM_SETxxxx, ie RTM_NEWxxx + 3 */ |
1460 |
++ /* RTM_MAX always points to RTM_SETxxxx, ie RTM_NEWxxx + 3. |
1461 |
++ * If the BUILD_BUG_ON() below fails you must update the |
1462 |
++ * structures at the top of this file with the new mappings |
1463 |
++ * before updating the BUILD_BUG_ON() macro! |
1464 |
++ */ |
1465 |
+ BUILD_BUG_ON(RTM_MAX != (RTM_NEWCHAIN + 3)); |
1466 |
+ err = nlmsg_perm(nlmsg_type, perm, nlmsg_route_perms, |
1467 |
+ sizeof(nlmsg_route_perms)); |
1468 |
+@@ -170,6 +177,10 @@ int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm) |
1469 |
+ break; |
1470 |
+ |
1471 |
+ case SECCLASS_NETLINK_XFRM_SOCKET: |
1472 |
++ /* If the BUILD_BUG_ON() below fails you must update the |
1473 |
++ * structures at the top of this file with the new mappings |
1474 |
++ * before updating the BUILD_BUG_ON() macro! |
1475 |
++ */ |
1476 |
+ BUILD_BUG_ON(XFRM_MSG_MAX != XFRM_MSG_MAPPING); |
1477 |
+ err = nlmsg_perm(nlmsg_type, perm, nlmsg_xfrm_perms, |
1478 |
+ sizeof(nlmsg_xfrm_perms)); |