1 |
commit: 003f68bb0343eec1d19eec6a761fae1405ddad26 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 25 10:28:04 2018 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 25 10:28:04 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=003f68bb |
7 |
|
8 |
Linux patch 4.17.10 |
9 |
|
10 |
0000_README | 4 + |
11 |
1009_linux-4.17.10.patch | 2457 ++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 2461 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index 378d9da..148c985 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -79,6 +79,10 @@ Patch: 1008_linux-4.17.9.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.17.9 |
21 |
|
22 |
+Patch: 1009_linux-4.17.10.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.17.10 |
25 |
+ |
26 |
Patch: 1500_XATTR_USER_PREFIX.patch |
27 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
28 |
Desc: Support for namespace user.pax.* on tmpfs. |
29 |
|
30 |
diff --git a/1009_linux-4.17.10.patch b/1009_linux-4.17.10.patch |
31 |
new file mode 100644 |
32 |
index 0000000..dc09395 |
33 |
--- /dev/null |
34 |
+++ b/1009_linux-4.17.10.patch |
35 |
@@ -0,0 +1,2457 @@ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index 693fde3aa317..0ab689c38e82 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -1,7 +1,7 @@ |
41 |
+ # SPDX-License-Identifier: GPL-2.0 |
42 |
+ VERSION = 4 |
43 |
+ PATCHLEVEL = 17 |
44 |
+-SUBLEVEL = 9 |
45 |
++SUBLEVEL = 10 |
46 |
+ EXTRAVERSION = |
47 |
+ NAME = Merciless Moray |
48 |
+ |
49 |
+diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c |
50 |
+index 89faa6f4de47..6a92843c0699 100644 |
51 |
+--- a/arch/alpha/kernel/osf_sys.c |
52 |
++++ b/arch/alpha/kernel/osf_sys.c |
53 |
+@@ -1183,13 +1183,10 @@ SYSCALL_DEFINE2(osf_getrusage, int, who, struct rusage32 __user *, ru) |
54 |
+ SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options, |
55 |
+ struct rusage32 __user *, ur) |
56 |
+ { |
57 |
+- unsigned int status = 0; |
58 |
+ struct rusage r; |
59 |
+- long err = kernel_wait4(pid, &status, options, &r); |
60 |
++ long err = kernel_wait4(pid, ustatus, options, &r); |
61 |
+ if (err <= 0) |
62 |
+ return err; |
63 |
+- if (put_user(status, ustatus)) |
64 |
+- return -EFAULT; |
65 |
+ if (!ur) |
66 |
+ return err; |
67 |
+ if (put_tv_to_tv32(&ur->ru_utime, &r.ru_utime)) |
68 |
+diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig |
69 |
+index d76bf4a83740..bc0bcf01ec98 100644 |
70 |
+--- a/arch/arc/Kconfig |
71 |
++++ b/arch/arc/Kconfig |
72 |
+@@ -408,7 +408,7 @@ config ARC_HAS_DIV_REM |
73 |
+ |
74 |
+ config ARC_HAS_ACCL_REGS |
75 |
+ bool "Reg Pair ACCL:ACCH (FPU and/or MPY > 6)" |
76 |
+- default n |
77 |
++ default y |
78 |
+ help |
79 |
+ Depending on the configuration, CPU can contain accumulator reg-pair |
80 |
+ (also referred to as r58:r59). These can also be used by gcc as GPR so |
81 |
+diff --git a/arch/arc/configs/axs101_defconfig b/arch/arc/configs/axs101_defconfig |
82 |
+index 09f85154c5a4..a635ea972304 100644 |
83 |
+--- a/arch/arc/configs/axs101_defconfig |
84 |
++++ b/arch/arc/configs/axs101_defconfig |
85 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
86 |
+ # CONFIG_UTS_NS is not set |
87 |
+ # CONFIG_PID_NS is not set |
88 |
+ CONFIG_BLK_DEV_INITRD=y |
89 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/" |
90 |
+ CONFIG_EMBEDDED=y |
91 |
+ CONFIG_PERF_EVENTS=y |
92 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
93 |
+diff --git a/arch/arc/configs/axs103_defconfig b/arch/arc/configs/axs103_defconfig |
94 |
+index 09fed3ef22b6..aa507e423075 100644 |
95 |
+--- a/arch/arc/configs/axs103_defconfig |
96 |
++++ b/arch/arc/configs/axs103_defconfig |
97 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
98 |
+ # CONFIG_UTS_NS is not set |
99 |
+ # CONFIG_PID_NS is not set |
100 |
+ CONFIG_BLK_DEV_INITRD=y |
101 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
102 |
+ CONFIG_EMBEDDED=y |
103 |
+ CONFIG_PERF_EVENTS=y |
104 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
105 |
+diff --git a/arch/arc/configs/axs103_smp_defconfig b/arch/arc/configs/axs103_smp_defconfig |
106 |
+index ea2f6d817d1a..eba07f468654 100644 |
107 |
+--- a/arch/arc/configs/axs103_smp_defconfig |
108 |
++++ b/arch/arc/configs/axs103_smp_defconfig |
109 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
110 |
+ # CONFIG_UTS_NS is not set |
111 |
+ # CONFIG_PID_NS is not set |
112 |
+ CONFIG_BLK_DEV_INITRD=y |
113 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
114 |
+ CONFIG_EMBEDDED=y |
115 |
+ CONFIG_PERF_EVENTS=y |
116 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
117 |
+diff --git a/arch/arc/configs/haps_hs_defconfig b/arch/arc/configs/haps_hs_defconfig |
118 |
+index ab231c040efe..098b19fbaa51 100644 |
119 |
+--- a/arch/arc/configs/haps_hs_defconfig |
120 |
++++ b/arch/arc/configs/haps_hs_defconfig |
121 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
122 |
+ # CONFIG_UTS_NS is not set |
123 |
+ # CONFIG_PID_NS is not set |
124 |
+ CONFIG_BLK_DEV_INITRD=y |
125 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
126 |
+ CONFIG_EXPERT=y |
127 |
+ CONFIG_PERF_EVENTS=y |
128 |
+ # CONFIG_COMPAT_BRK is not set |
129 |
+diff --git a/arch/arc/configs/haps_hs_smp_defconfig b/arch/arc/configs/haps_hs_smp_defconfig |
130 |
+index cf449cbf440d..0104c404d897 100644 |
131 |
+--- a/arch/arc/configs/haps_hs_smp_defconfig |
132 |
++++ b/arch/arc/configs/haps_hs_smp_defconfig |
133 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
134 |
+ # CONFIG_UTS_NS is not set |
135 |
+ # CONFIG_PID_NS is not set |
136 |
+ CONFIG_BLK_DEV_INITRD=y |
137 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
138 |
+ CONFIG_EMBEDDED=y |
139 |
+ CONFIG_PERF_EVENTS=y |
140 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
141 |
+diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig |
142 |
+index 1b54c72f4296..6491be0ddbc9 100644 |
143 |
+--- a/arch/arc/configs/hsdk_defconfig |
144 |
++++ b/arch/arc/configs/hsdk_defconfig |
145 |
+@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y |
146 |
+ # CONFIG_UTS_NS is not set |
147 |
+ # CONFIG_PID_NS is not set |
148 |
+ CONFIG_BLK_DEV_INITRD=y |
149 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
150 |
+ CONFIG_EMBEDDED=y |
151 |
+ CONFIG_PERF_EVENTS=y |
152 |
+ # CONFIG_VM_EVENT_COUNTERS is not set |
153 |
+diff --git a/arch/arc/configs/nsim_700_defconfig b/arch/arc/configs/nsim_700_defconfig |
154 |
+index 31c2c70b34a1..99e05cf63fca 100644 |
155 |
+--- a/arch/arc/configs/nsim_700_defconfig |
156 |
++++ b/arch/arc/configs/nsim_700_defconfig |
157 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
158 |
+ # CONFIG_UTS_NS is not set |
159 |
+ # CONFIG_PID_NS is not set |
160 |
+ CONFIG_BLK_DEV_INITRD=y |
161 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/" |
162 |
+ CONFIG_KALLSYMS_ALL=y |
163 |
+ CONFIG_EMBEDDED=y |
164 |
+ CONFIG_PERF_EVENTS=y |
165 |
+diff --git a/arch/arc/configs/nsim_hs_defconfig b/arch/arc/configs/nsim_hs_defconfig |
166 |
+index a578c721d50f..0dc4f9b737e7 100644 |
167 |
+--- a/arch/arc/configs/nsim_hs_defconfig |
168 |
++++ b/arch/arc/configs/nsim_hs_defconfig |
169 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
170 |
+ # CONFIG_UTS_NS is not set |
171 |
+ # CONFIG_PID_NS is not set |
172 |
+ CONFIG_BLK_DEV_INITRD=y |
173 |
+-CONFIG_INITRAMFS_SOURCE="../../arc_initramfs_hs/" |
174 |
+ CONFIG_KALLSYMS_ALL=y |
175 |
+ CONFIG_EMBEDDED=y |
176 |
+ CONFIG_PERF_EVENTS=y |
177 |
+diff --git a/arch/arc/configs/nsim_hs_smp_defconfig b/arch/arc/configs/nsim_hs_smp_defconfig |
178 |
+index 37d7395f3272..be3c30a15e54 100644 |
179 |
+--- a/arch/arc/configs/nsim_hs_smp_defconfig |
180 |
++++ b/arch/arc/configs/nsim_hs_smp_defconfig |
181 |
+@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y |
182 |
+ # CONFIG_UTS_NS is not set |
183 |
+ # CONFIG_PID_NS is not set |
184 |
+ CONFIG_BLK_DEV_INITRD=y |
185 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/" |
186 |
+ CONFIG_KALLSYMS_ALL=y |
187 |
+ CONFIG_EMBEDDED=y |
188 |
+ CONFIG_PERF_EVENTS=y |
189 |
+diff --git a/arch/arc/configs/nsimosci_defconfig b/arch/arc/configs/nsimosci_defconfig |
190 |
+index 1e1470e2a7f0..3a74b9b21772 100644 |
191 |
+--- a/arch/arc/configs/nsimosci_defconfig |
192 |
++++ b/arch/arc/configs/nsimosci_defconfig |
193 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
194 |
+ # CONFIG_UTS_NS is not set |
195 |
+ # CONFIG_PID_NS is not set |
196 |
+ CONFIG_BLK_DEV_INITRD=y |
197 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs/" |
198 |
+ CONFIG_KALLSYMS_ALL=y |
199 |
+ CONFIG_EMBEDDED=y |
200 |
+ CONFIG_PERF_EVENTS=y |
201 |
+diff --git a/arch/arc/configs/nsimosci_hs_defconfig b/arch/arc/configs/nsimosci_hs_defconfig |
202 |
+index 084a6e42685b..ea2834b4dc1d 100644 |
203 |
+--- a/arch/arc/configs/nsimosci_hs_defconfig |
204 |
++++ b/arch/arc/configs/nsimosci_hs_defconfig |
205 |
+@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y |
206 |
+ # CONFIG_UTS_NS is not set |
207 |
+ # CONFIG_PID_NS is not set |
208 |
+ CONFIG_BLK_DEV_INITRD=y |
209 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/" |
210 |
+ CONFIG_KALLSYMS_ALL=y |
211 |
+ CONFIG_EMBEDDED=y |
212 |
+ CONFIG_PERF_EVENTS=y |
213 |
+diff --git a/arch/arc/configs/nsimosci_hs_smp_defconfig b/arch/arc/configs/nsimosci_hs_smp_defconfig |
214 |
+index f36d47990415..80a5a1b4924b 100644 |
215 |
+--- a/arch/arc/configs/nsimosci_hs_smp_defconfig |
216 |
++++ b/arch/arc/configs/nsimosci_hs_smp_defconfig |
217 |
+@@ -9,7 +9,6 @@ CONFIG_IKCONFIG_PROC=y |
218 |
+ # CONFIG_UTS_NS is not set |
219 |
+ # CONFIG_PID_NS is not set |
220 |
+ CONFIG_BLK_DEV_INITRD=y |
221 |
+-CONFIG_INITRAMFS_SOURCE="../arc_initramfs_hs/" |
222 |
+ CONFIG_PERF_EVENTS=y |
223 |
+ # CONFIG_COMPAT_BRK is not set |
224 |
+ CONFIG_KPROBES=y |
225 |
+diff --git a/arch/arc/include/asm/page.h b/arch/arc/include/asm/page.h |
226 |
+index 109baa06831c..09ddddf71cc5 100644 |
227 |
+--- a/arch/arc/include/asm/page.h |
228 |
++++ b/arch/arc/include/asm/page.h |
229 |
+@@ -105,7 +105,7 @@ typedef pte_t * pgtable_t; |
230 |
+ #define virt_addr_valid(kaddr) pfn_valid(virt_to_pfn(kaddr)) |
231 |
+ |
232 |
+ /* Default Permissions for stack/heaps pages (Non Executable) */ |
233 |
+-#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE) |
234 |
++#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) |
235 |
+ |
236 |
+ #define WANT_PAGE_VIRTUAL 1 |
237 |
+ |
238 |
+diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h |
239 |
+index 08fe33830d4b..77676e18da69 100644 |
240 |
+--- a/arch/arc/include/asm/pgtable.h |
241 |
++++ b/arch/arc/include/asm/pgtable.h |
242 |
+@@ -379,7 +379,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, |
243 |
+ |
244 |
+ /* Decode a PTE containing swap "identifier "into constituents */ |
245 |
+ #define __swp_type(pte_lookalike) (((pte_lookalike).val) & 0x1f) |
246 |
+-#define __swp_offset(pte_lookalike) ((pte_lookalike).val << 13) |
247 |
++#define __swp_offset(pte_lookalike) ((pte_lookalike).val >> 13) |
248 |
+ |
249 |
+ /* NOPs, to keep generic kernel happy */ |
250 |
+ #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) |
251 |
+diff --git a/arch/arc/plat-hsdk/Kconfig b/arch/arc/plat-hsdk/Kconfig |
252 |
+index 19ab3cf98f0f..fcc9a9e27e9c 100644 |
253 |
+--- a/arch/arc/plat-hsdk/Kconfig |
254 |
++++ b/arch/arc/plat-hsdk/Kconfig |
255 |
+@@ -7,5 +7,7 @@ |
256 |
+ |
257 |
+ menuconfig ARC_SOC_HSDK |
258 |
+ bool "ARC HS Development Kit SOC" |
259 |
++ depends on ISA_ARCV2 |
260 |
++ select ARC_HAS_ACCL_REGS |
261 |
+ select CLK_HSDK |
262 |
+ select RESET_HSDK |
263 |
+diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S |
264 |
+index e734f6e45abc..689306118b48 100644 |
265 |
+--- a/arch/powerpc/kernel/idle_book3s.S |
266 |
++++ b/arch/powerpc/kernel/idle_book3s.S |
267 |
+@@ -144,7 +144,9 @@ power9_restore_additional_sprs: |
268 |
+ mtspr SPRN_MMCR1, r4 |
269 |
+ |
270 |
+ ld r3, STOP_MMCR2(r13) |
271 |
++ ld r4, PACA_SPRG_VDSO(r13) |
272 |
+ mtspr SPRN_MMCR2, r3 |
273 |
++ mtspr SPRN_SPRG3, r4 |
274 |
+ blr |
275 |
+ |
276 |
+ /* |
277 |
+diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c |
278 |
+index 8a10a045b57b..8cf03f101938 100644 |
279 |
+--- a/arch/x86/events/intel/ds.c |
280 |
++++ b/arch/x86/events/intel/ds.c |
281 |
+@@ -408,9 +408,11 @@ static int alloc_bts_buffer(int cpu) |
282 |
+ ds->bts_buffer_base = (unsigned long) cea; |
283 |
+ ds_update_cea(cea, buffer, BTS_BUFFER_SIZE, PAGE_KERNEL); |
284 |
+ ds->bts_index = ds->bts_buffer_base; |
285 |
+- max = BTS_RECORD_SIZE * (BTS_BUFFER_SIZE / BTS_RECORD_SIZE); |
286 |
+- ds->bts_absolute_maximum = ds->bts_buffer_base + max; |
287 |
+- ds->bts_interrupt_threshold = ds->bts_absolute_maximum - (max / 16); |
288 |
++ max = BTS_BUFFER_SIZE / BTS_RECORD_SIZE; |
289 |
++ ds->bts_absolute_maximum = ds->bts_buffer_base + |
290 |
++ max * BTS_RECORD_SIZE; |
291 |
++ ds->bts_interrupt_threshold = ds->bts_absolute_maximum - |
292 |
++ (max / 16) * BTS_RECORD_SIZE; |
293 |
+ return 0; |
294 |
+ } |
295 |
+ |
296 |
+diff --git a/arch/x86/include/asm/apm.h b/arch/x86/include/asm/apm.h |
297 |
+index c356098b6fb9..4d4015ddcf26 100644 |
298 |
+--- a/arch/x86/include/asm/apm.h |
299 |
++++ b/arch/x86/include/asm/apm.h |
300 |
+@@ -7,8 +7,6 @@ |
301 |
+ #ifndef _ASM_X86_MACH_DEFAULT_APM_H |
302 |
+ #define _ASM_X86_MACH_DEFAULT_APM_H |
303 |
+ |
304 |
+-#include <asm/nospec-branch.h> |
305 |
+- |
306 |
+ #ifdef APM_ZERO_SEGS |
307 |
+ # define APM_DO_ZERO_SEGS \ |
308 |
+ "pushl %%ds\n\t" \ |
309 |
+@@ -34,7 +32,6 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in, |
310 |
+ * N.B. We do NOT need a cld after the BIOS call |
311 |
+ * because we always save and restore the flags. |
312 |
+ */ |
313 |
+- firmware_restrict_branch_speculation_start(); |
314 |
+ __asm__ __volatile__(APM_DO_ZERO_SEGS |
315 |
+ "pushl %%edi\n\t" |
316 |
+ "pushl %%ebp\n\t" |
317 |
+@@ -47,7 +44,6 @@ static inline void apm_bios_call_asm(u32 func, u32 ebx_in, u32 ecx_in, |
318 |
+ "=S" (*esi) |
319 |
+ : "a" (func), "b" (ebx_in), "c" (ecx_in) |
320 |
+ : "memory", "cc"); |
321 |
+- firmware_restrict_branch_speculation_end(); |
322 |
+ } |
323 |
+ |
324 |
+ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in, |
325 |
+@@ -60,7 +56,6 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in, |
326 |
+ * N.B. We do NOT need a cld after the BIOS call |
327 |
+ * because we always save and restore the flags. |
328 |
+ */ |
329 |
+- firmware_restrict_branch_speculation_start(); |
330 |
+ __asm__ __volatile__(APM_DO_ZERO_SEGS |
331 |
+ "pushl %%edi\n\t" |
332 |
+ "pushl %%ebp\n\t" |
333 |
+@@ -73,7 +68,6 @@ static inline bool apm_bios_call_simple_asm(u32 func, u32 ebx_in, |
334 |
+ "=S" (si) |
335 |
+ : "a" (func), "b" (ebx_in), "c" (ecx_in) |
336 |
+ : "memory", "cc"); |
337 |
+- firmware_restrict_branch_speculation_end(); |
338 |
+ return error; |
339 |
+ } |
340 |
+ |
341 |
+diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c |
342 |
+index dfcbe6924eaf..3dd661dcc3f7 100644 |
343 |
+--- a/arch/x86/kernel/apm_32.c |
344 |
++++ b/arch/x86/kernel/apm_32.c |
345 |
+@@ -240,6 +240,7 @@ |
346 |
+ #include <asm/olpc.h> |
347 |
+ #include <asm/paravirt.h> |
348 |
+ #include <asm/reboot.h> |
349 |
++#include <asm/nospec-branch.h> |
350 |
+ |
351 |
+ #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT) |
352 |
+ extern int (*console_blank_hook)(int); |
353 |
+@@ -614,11 +615,13 @@ static long __apm_bios_call(void *_call) |
354 |
+ gdt[0x40 / 8] = bad_bios_desc; |
355 |
+ |
356 |
+ apm_irq_save(flags); |
357 |
++ firmware_restrict_branch_speculation_start(); |
358 |
+ APM_DO_SAVE_SEGS; |
359 |
+ apm_bios_call_asm(call->func, call->ebx, call->ecx, |
360 |
+ &call->eax, &call->ebx, &call->ecx, &call->edx, |
361 |
+ &call->esi); |
362 |
+ APM_DO_RESTORE_SEGS; |
363 |
++ firmware_restrict_branch_speculation_end(); |
364 |
+ apm_irq_restore(flags); |
365 |
+ gdt[0x40 / 8] = save_desc_40; |
366 |
+ put_cpu(); |
367 |
+@@ -690,10 +693,12 @@ static long __apm_bios_call_simple(void *_call) |
368 |
+ gdt[0x40 / 8] = bad_bios_desc; |
369 |
+ |
370 |
+ apm_irq_save(flags); |
371 |
++ firmware_restrict_branch_speculation_start(); |
372 |
+ APM_DO_SAVE_SEGS; |
373 |
+ error = apm_bios_call_simple_asm(call->func, call->ebx, call->ecx, |
374 |
+ &call->eax); |
375 |
+ APM_DO_RESTORE_SEGS; |
376 |
++ firmware_restrict_branch_speculation_end(); |
377 |
+ apm_irq_restore(flags); |
378 |
+ gdt[0x40 / 8] = save_desc_40; |
379 |
+ put_cpu(); |
380 |
+diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c |
381 |
+index 6f7eda9d5297..79ae1423b619 100644 |
382 |
+--- a/arch/x86/kernel/cpu/mcheck/mce.c |
383 |
++++ b/arch/x86/kernel/cpu/mcheck/mce.c |
384 |
+@@ -2147,9 +2147,6 @@ static ssize_t store_int_with_restart(struct device *s, |
385 |
+ if (check_interval == old_check_interval) |
386 |
+ return ret; |
387 |
+ |
388 |
+- if (check_interval < 1) |
389 |
+- check_interval = 1; |
390 |
+- |
391 |
+ mutex_lock(&mce_sysfs_mutex); |
392 |
+ mce_restart(); |
393 |
+ mutex_unlock(&mce_sysfs_mutex); |
394 |
+diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c |
395 |
+index 8b26c9e01cc4..d79a18b4cf9d 100644 |
396 |
+--- a/arch/x86/kernel/kvmclock.c |
397 |
++++ b/arch/x86/kernel/kvmclock.c |
398 |
+@@ -319,6 +319,8 @@ void __init kvmclock_init(void) |
399 |
+ printk(KERN_INFO "kvm-clock: Using msrs %x and %x", |
400 |
+ msr_kvm_system_time, msr_kvm_wall_clock); |
401 |
+ |
402 |
++ pvclock_set_pvti_cpu0_va(hv_clock); |
403 |
++ |
404 |
+ if (kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE_STABLE_BIT)) |
405 |
+ pvclock_set_flags(PVCLOCK_TSC_STABLE_BIT); |
406 |
+ |
407 |
+@@ -366,14 +368,11 @@ int __init kvm_setup_vsyscall_timeinfo(void) |
408 |
+ vcpu_time = &hv_clock[cpu].pvti; |
409 |
+ flags = pvclock_read_flags(vcpu_time); |
410 |
+ |
411 |
+- if (!(flags & PVCLOCK_TSC_STABLE_BIT)) { |
412 |
+- put_cpu(); |
413 |
+- return 1; |
414 |
+- } |
415 |
+- |
416 |
+- pvclock_set_pvti_cpu0_va(hv_clock); |
417 |
+ put_cpu(); |
418 |
+ |
419 |
++ if (!(flags & PVCLOCK_TSC_STABLE_BIT)) |
420 |
++ return 1; |
421 |
++ |
422 |
+ kvm_clock.archdata.vclock_mode = VCLOCK_PVCLOCK; |
423 |
+ #endif |
424 |
+ return 0; |
425 |
+diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c |
426 |
+index dd4366edc200..a3bbac8ef4d0 100644 |
427 |
+--- a/arch/x86/kvm/vmx.c |
428 |
++++ b/arch/x86/kvm/vmx.c |
429 |
+@@ -2376,6 +2376,7 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu) |
430 |
+ struct vcpu_vmx *vmx = to_vmx(vcpu); |
431 |
+ #ifdef CONFIG_X86_64 |
432 |
+ int cpu = raw_smp_processor_id(); |
433 |
++ unsigned long fs_base, kernel_gs_base; |
434 |
+ #endif |
435 |
+ int i; |
436 |
+ |
437 |
+@@ -2391,12 +2392,20 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu) |
438 |
+ vmx->host_state.gs_ldt_reload_needed = vmx->host_state.ldt_sel; |
439 |
+ |
440 |
+ #ifdef CONFIG_X86_64 |
441 |
+- save_fsgs_for_kvm(); |
442 |
+- vmx->host_state.fs_sel = current->thread.fsindex; |
443 |
+- vmx->host_state.gs_sel = current->thread.gsindex; |
444 |
+-#else |
445 |
+- savesegment(fs, vmx->host_state.fs_sel); |
446 |
+- savesegment(gs, vmx->host_state.gs_sel); |
447 |
++ if (likely(is_64bit_mm(current->mm))) { |
448 |
++ save_fsgs_for_kvm(); |
449 |
++ vmx->host_state.fs_sel = current->thread.fsindex; |
450 |
++ vmx->host_state.gs_sel = current->thread.gsindex; |
451 |
++ fs_base = current->thread.fsbase; |
452 |
++ kernel_gs_base = current->thread.gsbase; |
453 |
++ } else { |
454 |
++#endif |
455 |
++ savesegment(fs, vmx->host_state.fs_sel); |
456 |
++ savesegment(gs, vmx->host_state.gs_sel); |
457 |
++#ifdef CONFIG_X86_64 |
458 |
++ fs_base = read_msr(MSR_FS_BASE); |
459 |
++ kernel_gs_base = read_msr(MSR_KERNEL_GS_BASE); |
460 |
++ } |
461 |
+ #endif |
462 |
+ if (!(vmx->host_state.fs_sel & 7)) { |
463 |
+ vmcs_write16(HOST_FS_SELECTOR, vmx->host_state.fs_sel); |
464 |
+@@ -2416,10 +2425,10 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu) |
465 |
+ savesegment(ds, vmx->host_state.ds_sel); |
466 |
+ savesegment(es, vmx->host_state.es_sel); |
467 |
+ |
468 |
+- vmcs_writel(HOST_FS_BASE, current->thread.fsbase); |
469 |
++ vmcs_writel(HOST_FS_BASE, fs_base); |
470 |
+ vmcs_writel(HOST_GS_BASE, cpu_kernelmode_gs_base(cpu)); |
471 |
+ |
472 |
+- vmx->msr_host_kernel_gs_base = current->thread.gsbase; |
473 |
++ vmx->msr_host_kernel_gs_base = kernel_gs_base; |
474 |
+ if (is_long_mode(&vmx->vcpu)) |
475 |
+ wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_guest_kernel_gs_base); |
476 |
+ #else |
477 |
+@@ -4110,11 +4119,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf) |
478 |
+ vmcs_conf->order = get_order(vmcs_conf->size); |
479 |
+ vmcs_conf->basic_cap = vmx_msr_high & ~0x1fff; |
480 |
+ |
481 |
+- /* KVM supports Enlightened VMCS v1 only */ |
482 |
+- if (static_branch_unlikely(&enable_evmcs)) |
483 |
+- vmcs_conf->revision_id = KVM_EVMCS_VERSION; |
484 |
+- else |
485 |
+- vmcs_conf->revision_id = vmx_msr_low; |
486 |
++ vmcs_conf->revision_id = vmx_msr_low; |
487 |
+ |
488 |
+ vmcs_conf->pin_based_exec_ctrl = _pin_based_exec_control; |
489 |
+ vmcs_conf->cpu_based_exec_ctrl = _cpu_based_exec_control; |
490 |
+@@ -4184,7 +4189,13 @@ static struct vmcs *alloc_vmcs_cpu(int cpu) |
491 |
+ return NULL; |
492 |
+ vmcs = page_address(pages); |
493 |
+ memset(vmcs, 0, vmcs_config.size); |
494 |
+- vmcs->revision_id = vmcs_config.revision_id; /* vmcs revision id */ |
495 |
++ |
496 |
++ /* KVM supports Enlightened VMCS v1 only */ |
497 |
++ if (static_branch_unlikely(&enable_evmcs)) |
498 |
++ vmcs->revision_id = KVM_EVMCS_VERSION; |
499 |
++ else |
500 |
++ vmcs->revision_id = vmcs_config.revision_id; |
501 |
++ |
502 |
+ return vmcs; |
503 |
+ } |
504 |
+ |
505 |
+@@ -4343,6 +4354,19 @@ static __init int alloc_kvm_area(void) |
506 |
+ return -ENOMEM; |
507 |
+ } |
508 |
+ |
509 |
++ /* |
510 |
++ * When eVMCS is enabled, alloc_vmcs_cpu() sets |
511 |
++ * vmcs->revision_id to KVM_EVMCS_VERSION instead of |
512 |
++ * revision_id reported by MSR_IA32_VMX_BASIC. |
513 |
++ * |
514 |
++ * However, even though not explictly documented by |
515 |
++ * TLFS, VMXArea passed as VMXON argument should |
516 |
++ * still be marked with revision_id reported by |
517 |
++ * physical CPU. |
518 |
++ */ |
519 |
++ if (static_branch_unlikely(&enable_evmcs)) |
520 |
++ vmcs->revision_id = vmcs_config.revision_id; |
521 |
++ |
522 |
+ per_cpu(vmxarea, cpu) = vmcs; |
523 |
+ } |
524 |
+ return 0; |
525 |
+diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c |
526 |
+index bd3f0a9d5e60..b357f81bfba6 100644 |
527 |
+--- a/drivers/cpufreq/intel_pstate.c |
528 |
++++ b/drivers/cpufreq/intel_pstate.c |
529 |
+@@ -2179,6 +2179,18 @@ static bool __init intel_pstate_no_acpi_pss(void) |
530 |
+ return true; |
531 |
+ } |
532 |
+ |
533 |
++static bool __init intel_pstate_no_acpi_pcch(void) |
534 |
++{ |
535 |
++ acpi_status status; |
536 |
++ acpi_handle handle; |
537 |
++ |
538 |
++ status = acpi_get_handle(NULL, "\\_SB", &handle); |
539 |
++ if (ACPI_FAILURE(status)) |
540 |
++ return true; |
541 |
++ |
542 |
++ return !acpi_has_method(handle, "PCCH"); |
543 |
++} |
544 |
++ |
545 |
+ static bool __init intel_pstate_has_acpi_ppc(void) |
546 |
+ { |
547 |
+ int i; |
548 |
+@@ -2238,7 +2250,10 @@ static bool __init intel_pstate_platform_pwr_mgmt_exists(void) |
549 |
+ |
550 |
+ switch (plat_info[idx].data) { |
551 |
+ case PSS: |
552 |
+- return intel_pstate_no_acpi_pss(); |
553 |
++ if (!intel_pstate_no_acpi_pss()) |
554 |
++ return false; |
555 |
++ |
556 |
++ return intel_pstate_no_acpi_pcch(); |
557 |
+ case PPC: |
558 |
+ return intel_pstate_has_acpi_ppc() && !force_load; |
559 |
+ } |
560 |
+diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c |
561 |
+index 3f0ce2ae35ee..0c56c9759672 100644 |
562 |
+--- a/drivers/cpufreq/pcc-cpufreq.c |
563 |
++++ b/drivers/cpufreq/pcc-cpufreq.c |
564 |
+@@ -580,6 +580,10 @@ static int __init pcc_cpufreq_init(void) |
565 |
+ { |
566 |
+ int ret; |
567 |
+ |
568 |
++ /* Skip initialization if another cpufreq driver is there. */ |
569 |
++ if (cpufreq_get_current_driver()) |
570 |
++ return 0; |
571 |
++ |
572 |
+ if (acpi_disabled) |
573 |
+ return 0; |
574 |
+ |
575 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c |
576 |
+index dc34b50e6b29..b11e9659e312 100644 |
577 |
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c |
578 |
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c |
579 |
+@@ -925,6 +925,10 @@ static int amdgpu_cs_ib_vm_chunk(struct amdgpu_device *adev, |
580 |
+ r = amdgpu_bo_vm_update_pte(p); |
581 |
+ if (r) |
582 |
+ return r; |
583 |
++ |
584 |
++ r = reservation_object_reserve_shared(vm->root.base.bo->tbo.resv); |
585 |
++ if (r) |
586 |
++ return r; |
587 |
+ } |
588 |
+ |
589 |
+ return amdgpu_cs_sync_rings(p); |
590 |
+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 |
591 |
+index 4304d9e408b8..ace9ad578ca0 100644 |
592 |
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c |
593 |
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c |
594 |
+@@ -83,22 +83,21 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux, |
595 |
+ enum i2c_mot_mode mot = (msg->request & DP_AUX_I2C_MOT) ? |
596 |
+ I2C_MOT_TRUE : I2C_MOT_FALSE; |
597 |
+ enum ddc_result res; |
598 |
+- uint32_t read_bytes = msg->size; |
599 |
++ ssize_t read_bytes; |
600 |
+ |
601 |
+ if (WARN_ON(msg->size > 16)) |
602 |
+ return -E2BIG; |
603 |
+ |
604 |
+ switch (msg->request & ~DP_AUX_I2C_MOT) { |
605 |
+ case DP_AUX_NATIVE_READ: |
606 |
+- res = dal_ddc_service_read_dpcd_data( |
607 |
++ read_bytes = dal_ddc_service_read_dpcd_data( |
608 |
+ TO_DM_AUX(aux)->ddc_service, |
609 |
+ false, |
610 |
+ I2C_MOT_UNDEF, |
611 |
+ msg->address, |
612 |
+ msg->buffer, |
613 |
+- msg->size, |
614 |
+- &read_bytes); |
615 |
+- break; |
616 |
++ msg->size); |
617 |
++ return read_bytes; |
618 |
+ case DP_AUX_NATIVE_WRITE: |
619 |
+ res = dal_ddc_service_write_dpcd_data( |
620 |
+ TO_DM_AUX(aux)->ddc_service, |
621 |
+@@ -109,15 +108,14 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux, |
622 |
+ msg->size); |
623 |
+ break; |
624 |
+ case DP_AUX_I2C_READ: |
625 |
+- res = dal_ddc_service_read_dpcd_data( |
626 |
++ read_bytes = dal_ddc_service_read_dpcd_data( |
627 |
+ TO_DM_AUX(aux)->ddc_service, |
628 |
+ true, |
629 |
+ mot, |
630 |
+ msg->address, |
631 |
+ msg->buffer, |
632 |
+- msg->size, |
633 |
+- &read_bytes); |
634 |
+- break; |
635 |
++ msg->size); |
636 |
++ return read_bytes; |
637 |
+ case DP_AUX_I2C_WRITE: |
638 |
+ res = dal_ddc_service_write_dpcd_data( |
639 |
+ TO_DM_AUX(aux)->ddc_service, |
640 |
+@@ -139,9 +137,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux, |
641 |
+ r == DDC_RESULT_SUCESSFULL); |
642 |
+ #endif |
643 |
+ |
644 |
+- if (res != DDC_RESULT_SUCESSFULL) |
645 |
+- return -EIO; |
646 |
+- return read_bytes; |
647 |
++ return msg->size; |
648 |
+ } |
649 |
+ |
650 |
+ static enum drm_connector_status |
651 |
+diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c |
652 |
+index ae48d603ebd6..49c2face1e7a 100644 |
653 |
+--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c |
654 |
++++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c |
655 |
+@@ -629,14 +629,13 @@ bool dal_ddc_service_query_ddc_data( |
656 |
+ return ret; |
657 |
+ } |
658 |
+ |
659 |
+-enum ddc_result dal_ddc_service_read_dpcd_data( |
660 |
++ssize_t dal_ddc_service_read_dpcd_data( |
661 |
+ struct ddc_service *ddc, |
662 |
+ bool i2c, |
663 |
+ enum i2c_mot_mode mot, |
664 |
+ uint32_t address, |
665 |
+ uint8_t *data, |
666 |
+- uint32_t len, |
667 |
+- uint32_t *read) |
668 |
++ uint32_t len) |
669 |
+ { |
670 |
+ struct aux_payload read_payload = { |
671 |
+ .i2c_over_aux = i2c, |
672 |
+@@ -653,8 +652,6 @@ enum ddc_result dal_ddc_service_read_dpcd_data( |
673 |
+ .mot = mot |
674 |
+ }; |
675 |
+ |
676 |
+- *read = 0; |
677 |
+- |
678 |
+ if (len > DEFAULT_AUX_MAX_DATA_SIZE) { |
679 |
+ BREAK_TO_DEBUGGER(); |
680 |
+ return DDC_RESULT_FAILED_INVALID_OPERATION; |
681 |
+@@ -664,8 +661,7 @@ enum ddc_result dal_ddc_service_read_dpcd_data( |
682 |
+ ddc->ctx->i2caux, |
683 |
+ ddc->ddc_pin, |
684 |
+ &command)) { |
685 |
+- *read = command.payloads->length; |
686 |
+- return DDC_RESULT_SUCESSFULL; |
687 |
++ return (ssize_t)command.payloads->length; |
688 |
+ } |
689 |
+ |
690 |
+ return DDC_RESULT_FAILED_OPERATION; |
691 |
+diff --git a/drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h b/drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h |
692 |
+index 30b3a08b91be..090b7a8dd67b 100644 |
693 |
+--- a/drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h |
694 |
++++ b/drivers/gpu/drm/amd/display/dc/inc/dc_link_ddc.h |
695 |
+@@ -102,14 +102,13 @@ bool dal_ddc_service_query_ddc_data( |
696 |
+ uint8_t *read_buf, |
697 |
+ uint32_t read_size); |
698 |
+ |
699 |
+-enum ddc_result dal_ddc_service_read_dpcd_data( |
700 |
++ssize_t dal_ddc_service_read_dpcd_data( |
701 |
+ struct ddc_service *ddc, |
702 |
+ bool i2c, |
703 |
+ enum i2c_mot_mode mot, |
704 |
+ uint32_t address, |
705 |
+ uint8_t *data, |
706 |
+- uint32_t len, |
707 |
+- uint32_t *read); |
708 |
++ uint32_t len); |
709 |
+ |
710 |
+ enum ddc_result dal_ddc_service_write_dpcd_data( |
711 |
+ struct ddc_service *ddc, |
712 |
+diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c |
713 |
+index d345563fdff3..ce281d651ae8 100644 |
714 |
+--- a/drivers/gpu/drm/drm_lease.c |
715 |
++++ b/drivers/gpu/drm/drm_lease.c |
716 |
+@@ -553,24 +553,13 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, |
717 |
+ |
718 |
+ /* Clone the lessor file to create a new file for us */ |
719 |
+ DRM_DEBUG_LEASE("Allocating lease file\n"); |
720 |
+- path_get(&lessor_file->f_path); |
721 |
+- lessee_file = alloc_file(&lessor_file->f_path, |
722 |
+- lessor_file->f_mode, |
723 |
+- fops_get(lessor_file->f_inode->i_fop)); |
724 |
+- |
725 |
++ lessee_file = filp_clone_open(lessor_file); |
726 |
+ if (IS_ERR(lessee_file)) { |
727 |
+ ret = PTR_ERR(lessee_file); |
728 |
+ goto out_lessee; |
729 |
+ } |
730 |
+ |
731 |
+- /* Initialize the new file for DRM */ |
732 |
+- DRM_DEBUG_LEASE("Initializing the file with %p\n", lessee_file->f_op->open); |
733 |
+- ret = lessee_file->f_op->open(lessee_file->f_inode, lessee_file); |
734 |
+- if (ret) |
735 |
+- goto out_lessee_file; |
736 |
+- |
737 |
+ lessee_priv = lessee_file->private_data; |
738 |
+- |
739 |
+ /* Change the file to a master one */ |
740 |
+ drm_master_put(&lessee_priv->master); |
741 |
+ lessee_priv->master = lessee; |
742 |
+@@ -588,9 +577,6 @@ int drm_mode_create_lease_ioctl(struct drm_device *dev, |
743 |
+ DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl succeeded\n"); |
744 |
+ return 0; |
745 |
+ |
746 |
+-out_lessee_file: |
747 |
+- fput(lessee_file); |
748 |
+- |
749 |
+ out_lessee: |
750 |
+ drm_master_put(&lessee); |
751 |
+ |
752 |
+diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c |
753 |
+index b25cc5aa8fbe..d793b2bbd6c2 100644 |
754 |
+--- a/drivers/gpu/drm/i915/i915_irq.c |
755 |
++++ b/drivers/gpu/drm/i915/i915_irq.c |
756 |
+@@ -1967,10 +1967,38 @@ static void valleyview_pipestat_irq_handler(struct drm_i915_private *dev_priv, |
757 |
+ |
758 |
+ static u32 i9xx_hpd_irq_ack(struct drm_i915_private *dev_priv) |
759 |
+ { |
760 |
+- u32 hotplug_status = I915_READ(PORT_HOTPLUG_STAT); |
761 |
++ u32 hotplug_status = 0, hotplug_status_mask; |
762 |
++ int i; |
763 |
++ |
764 |
++ if (IS_G4X(dev_priv) || |
765 |
++ IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) |
766 |
++ hotplug_status_mask = HOTPLUG_INT_STATUS_G4X | |
767 |
++ DP_AUX_CHANNEL_MASK_INT_STATUS_G4X; |
768 |
++ else |
769 |
++ hotplug_status_mask = HOTPLUG_INT_STATUS_I915; |
770 |
+ |
771 |
+- if (hotplug_status) |
772 |
++ /* |
773 |
++ * We absolutely have to clear all the pending interrupt |
774 |
++ * bits in PORT_HOTPLUG_STAT. Otherwise the ISR port |
775 |
++ * interrupt bit won't have an edge, and the i965/g4x |
776 |
++ * edge triggered IIR will not notice that an interrupt |
777 |
++ * is still pending. We can't use PORT_HOTPLUG_EN to |
778 |
++ * guarantee the edge as the act of toggling the enable |
779 |
++ * bits can itself generate a new hotplug interrupt :( |
780 |
++ */ |
781 |
++ for (i = 0; i < 10; i++) { |
782 |
++ u32 tmp = I915_READ(PORT_HOTPLUG_STAT) & hotplug_status_mask; |
783 |
++ |
784 |
++ if (tmp == 0) |
785 |
++ return hotplug_status; |
786 |
++ |
787 |
++ hotplug_status |= tmp; |
788 |
+ I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); |
789 |
++ } |
790 |
++ |
791 |
++ WARN_ONCE(1, |
792 |
++ "PORT_HOTPLUG_STAT did not clear (0x%08x)\n", |
793 |
++ I915_READ(PORT_HOTPLUG_STAT)); |
794 |
+ |
795 |
+ return hotplug_status; |
796 |
+ } |
797 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c |
798 |
+index debbbf0fd4bd..408b955e5c39 100644 |
799 |
+--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c |
800 |
++++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c |
801 |
+@@ -267,6 +267,7 @@ nouveau_backlight_init(struct drm_device *dev) |
802 |
+ struct nouveau_drm *drm = nouveau_drm(dev); |
803 |
+ struct nvif_device *device = &drm->client.device; |
804 |
+ struct drm_connector *connector; |
805 |
++ struct drm_connector_list_iter conn_iter; |
806 |
+ |
807 |
+ INIT_LIST_HEAD(&drm->bl_connectors); |
808 |
+ |
809 |
+@@ -275,7 +276,8 @@ nouveau_backlight_init(struct drm_device *dev) |
810 |
+ return 0; |
811 |
+ } |
812 |
+ |
813 |
+- list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
814 |
++ drm_connector_list_iter_begin(dev, &conn_iter); |
815 |
++ drm_for_each_connector_iter(connector, &conn_iter) { |
816 |
+ if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS && |
817 |
+ connector->connector_type != DRM_MODE_CONNECTOR_eDP) |
818 |
+ continue; |
819 |
+@@ -292,7 +294,7 @@ nouveau_backlight_init(struct drm_device *dev) |
820 |
+ break; |
821 |
+ } |
822 |
+ } |
823 |
+- |
824 |
++ drm_connector_list_iter_end(&conn_iter); |
825 |
+ |
826 |
+ return 0; |
827 |
+ } |
828 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c |
829 |
+index 6ed9cb053dfa..359fecce8cc0 100644 |
830 |
+--- a/drivers/gpu/drm/nouveau/nouveau_connector.c |
831 |
++++ b/drivers/gpu/drm/nouveau/nouveau_connector.c |
832 |
+@@ -1208,14 +1208,19 @@ nouveau_connector_create(struct drm_device *dev, int index) |
833 |
+ struct nouveau_display *disp = nouveau_display(dev); |
834 |
+ struct nouveau_connector *nv_connector = NULL; |
835 |
+ struct drm_connector *connector; |
836 |
++ struct drm_connector_list_iter conn_iter; |
837 |
+ int type, ret = 0; |
838 |
+ bool dummy; |
839 |
+ |
840 |
+- list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
841 |
++ drm_connector_list_iter_begin(dev, &conn_iter); |
842 |
++ nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) { |
843 |
+ nv_connector = nouveau_connector(connector); |
844 |
+- if (nv_connector->index == index) |
845 |
++ if (nv_connector->index == index) { |
846 |
++ drm_connector_list_iter_end(&conn_iter); |
847 |
+ return connector; |
848 |
++ } |
849 |
+ } |
850 |
++ drm_connector_list_iter_end(&conn_iter); |
851 |
+ |
852 |
+ nv_connector = kzalloc(sizeof(*nv_connector), GFP_KERNEL); |
853 |
+ if (!nv_connector) |
854 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h |
855 |
+index a4d1a059bd3d..dc7454e7f19a 100644 |
856 |
+--- a/drivers/gpu/drm/nouveau/nouveau_connector.h |
857 |
++++ b/drivers/gpu/drm/nouveau/nouveau_connector.h |
858 |
+@@ -33,6 +33,7 @@ |
859 |
+ #include <drm/drm_encoder.h> |
860 |
+ #include <drm/drm_dp_helper.h> |
861 |
+ #include "nouveau_crtc.h" |
862 |
++#include "nouveau_encoder.h" |
863 |
+ |
864 |
+ struct nvkm_i2c_port; |
865 |
+ |
866 |
+@@ -60,19 +61,46 @@ static inline struct nouveau_connector *nouveau_connector( |
867 |
+ return container_of(con, struct nouveau_connector, base); |
868 |
+ } |
869 |
+ |
870 |
++static inline bool |
871 |
++nouveau_connector_is_mst(struct drm_connector *connector) |
872 |
++{ |
873 |
++ const struct nouveau_encoder *nv_encoder; |
874 |
++ const struct drm_encoder *encoder; |
875 |
++ |
876 |
++ if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort) |
877 |
++ return false; |
878 |
++ |
879 |
++ nv_encoder = find_encoder(connector, DCB_OUTPUT_ANY); |
880 |
++ if (!nv_encoder) |
881 |
++ return false; |
882 |
++ |
883 |
++ encoder = &nv_encoder->base.base; |
884 |
++ return encoder->encoder_type == DRM_MODE_ENCODER_DPMST; |
885 |
++} |
886 |
++ |
887 |
++#define nouveau_for_each_non_mst_connector_iter(connector, iter) \ |
888 |
++ drm_for_each_connector_iter(connector, iter) \ |
889 |
++ for_each_if(!nouveau_connector_is_mst(connector)) |
890 |
++ |
891 |
+ static inline struct nouveau_connector * |
892 |
+ nouveau_crtc_connector_get(struct nouveau_crtc *nv_crtc) |
893 |
+ { |
894 |
+ struct drm_device *dev = nv_crtc->base.dev; |
895 |
+ struct drm_connector *connector; |
896 |
++ struct drm_connector_list_iter conn_iter; |
897 |
++ struct nouveau_connector *nv_connector = NULL; |
898 |
+ struct drm_crtc *crtc = to_drm_crtc(nv_crtc); |
899 |
+ |
900 |
+- list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
901 |
+- if (connector->encoder && connector->encoder->crtc == crtc) |
902 |
+- return nouveau_connector(connector); |
903 |
++ drm_connector_list_iter_begin(dev, &conn_iter); |
904 |
++ nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) { |
905 |
++ if (connector->encoder && connector->encoder->crtc == crtc) { |
906 |
++ nv_connector = nouveau_connector(connector); |
907 |
++ break; |
908 |
++ } |
909 |
+ } |
910 |
++ drm_connector_list_iter_end(&conn_iter); |
911 |
+ |
912 |
+- return NULL; |
913 |
++ return nv_connector; |
914 |
+ } |
915 |
+ |
916 |
+ struct drm_connector * |
917 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c |
918 |
+index 009713404cc4..4cba117e81fc 100644 |
919 |
+--- a/drivers/gpu/drm/nouveau/nouveau_display.c |
920 |
++++ b/drivers/gpu/drm/nouveau/nouveau_display.c |
921 |
+@@ -406,6 +406,7 @@ nouveau_display_init(struct drm_device *dev) |
922 |
+ struct nouveau_display *disp = nouveau_display(dev); |
923 |
+ struct nouveau_drm *drm = nouveau_drm(dev); |
924 |
+ struct drm_connector *connector; |
925 |
++ struct drm_connector_list_iter conn_iter; |
926 |
+ int ret; |
927 |
+ |
928 |
+ ret = disp->init(dev); |
929 |
+@@ -413,10 +414,12 @@ nouveau_display_init(struct drm_device *dev) |
930 |
+ return ret; |
931 |
+ |
932 |
+ /* enable hotplug interrupts */ |
933 |
+- list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
934 |
++ drm_connector_list_iter_begin(dev, &conn_iter); |
935 |
++ nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) { |
936 |
+ struct nouveau_connector *conn = nouveau_connector(connector); |
937 |
+ nvif_notify_get(&conn->hpd); |
938 |
+ } |
939 |
++ drm_connector_list_iter_end(&conn_iter); |
940 |
+ |
941 |
+ /* enable flip completion events */ |
942 |
+ nvif_notify_get(&drm->flip); |
943 |
+@@ -429,6 +432,7 @@ nouveau_display_fini(struct drm_device *dev, bool suspend) |
944 |
+ struct nouveau_display *disp = nouveau_display(dev); |
945 |
+ struct nouveau_drm *drm = nouveau_drm(dev); |
946 |
+ struct drm_connector *connector; |
947 |
++ struct drm_connector_list_iter conn_iter; |
948 |
+ |
949 |
+ if (!suspend) { |
950 |
+ if (drm_drv_uses_atomic_modeset(dev)) |
951 |
+@@ -441,10 +445,12 @@ nouveau_display_fini(struct drm_device *dev, bool suspend) |
952 |
+ nvif_notify_put(&drm->flip); |
953 |
+ |
954 |
+ /* disable hotplug interrupts */ |
955 |
+- list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
956 |
++ drm_connector_list_iter_begin(dev, &conn_iter); |
957 |
++ nouveau_for_each_non_mst_connector_iter(connector, &conn_iter) { |
958 |
+ struct nouveau_connector *conn = nouveau_connector(connector); |
959 |
+ nvif_notify_put(&conn->hpd); |
960 |
+ } |
961 |
++ drm_connector_list_iter_end(&conn_iter); |
962 |
+ |
963 |
+ drm_kms_helper_poll_disable(dev); |
964 |
+ disp->fini(dev); |
965 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c |
966 |
+index bbbf353682e1..0bffeb95b072 100644 |
967 |
+--- a/drivers/gpu/drm/nouveau/nouveau_drm.c |
968 |
++++ b/drivers/gpu/drm/nouveau/nouveau_drm.c |
969 |
+@@ -866,22 +866,11 @@ nouveau_pmops_runtime_resume(struct device *dev) |
970 |
+ static int |
971 |
+ nouveau_pmops_runtime_idle(struct device *dev) |
972 |
+ { |
973 |
+- struct pci_dev *pdev = to_pci_dev(dev); |
974 |
+- struct drm_device *drm_dev = pci_get_drvdata(pdev); |
975 |
+- struct nouveau_drm *drm = nouveau_drm(drm_dev); |
976 |
+- struct drm_crtc *crtc; |
977 |
+- |
978 |
+ if (!nouveau_pmops_runtime()) { |
979 |
+ pm_runtime_forbid(dev); |
980 |
+ return -EBUSY; |
981 |
+ } |
982 |
+ |
983 |
+- list_for_each_entry(crtc, &drm->dev->mode_config.crtc_list, head) { |
984 |
+- if (crtc->enabled) { |
985 |
+- DRM_DEBUG_DRIVER("failing to power off - crtc active\n"); |
986 |
+- return -EBUSY; |
987 |
+- } |
988 |
+- } |
989 |
+ pm_runtime_mark_last_busy(dev); |
990 |
+ pm_runtime_autosuspend(dev); |
991 |
+ /* we don't want the main rpm_idle to call suspend - we want to autosuspend */ |
992 |
+diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c |
993 |
+index 753b1a698fc4..6b16946f9b05 100644 |
994 |
+--- a/drivers/misc/cxl/api.c |
995 |
++++ b/drivers/misc/cxl/api.c |
996 |
+@@ -103,15 +103,15 @@ static struct file *cxl_getfile(const char *name, |
997 |
+ d_instantiate(path.dentry, inode); |
998 |
+ |
999 |
+ file = alloc_file(&path, OPEN_FMODE(flags), fops); |
1000 |
+- if (IS_ERR(file)) |
1001 |
+- goto err_dput; |
1002 |
++ if (IS_ERR(file)) { |
1003 |
++ path_put(&path); |
1004 |
++ goto err_fs; |
1005 |
++ } |
1006 |
+ file->f_flags = flags & (O_ACCMODE | O_NONBLOCK); |
1007 |
+ file->private_data = priv; |
1008 |
+ |
1009 |
+ return file; |
1010 |
+ |
1011 |
+-err_dput: |
1012 |
+- path_put(&path); |
1013 |
+ err_inode: |
1014 |
+ iput(inode); |
1015 |
+ err_fs: |
1016 |
+diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h b/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h |
1017 |
+index fc7383106946..91eb8910b1c9 100644 |
1018 |
+--- a/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h |
1019 |
++++ b/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h |
1020 |
+@@ -63,8 +63,6 @@ |
1021 |
+ |
1022 |
+ #define AQ_CFG_NAPI_WEIGHT 64U |
1023 |
+ |
1024 |
+-#define AQ_CFG_MULTICAST_ADDRESS_MAX 32U |
1025 |
+- |
1026 |
+ /*#define AQ_CFG_MAC_ADDR_PERMANENT {0x30, 0x0E, 0xE3, 0x12, 0x34, 0x56}*/ |
1027 |
+ |
1028 |
+ #define AQ_NIC_FC_OFF 0U |
1029 |
+diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h |
1030 |
+index a2d416b24ffc..2c6ebd91a9f2 100644 |
1031 |
+--- a/drivers/net/ethernet/aquantia/atlantic/aq_hw.h |
1032 |
++++ b/drivers/net/ethernet/aquantia/atlantic/aq_hw.h |
1033 |
+@@ -98,6 +98,8 @@ struct aq_stats_s { |
1034 |
+ #define AQ_HW_MEDIA_TYPE_TP 1U |
1035 |
+ #define AQ_HW_MEDIA_TYPE_FIBRE 2U |
1036 |
+ |
1037 |
++#define AQ_HW_MULTICAST_ADDRESS_MAX 32U |
1038 |
++ |
1039 |
+ struct aq_hw_s { |
1040 |
+ atomic_t flags; |
1041 |
+ u8 rbl_enabled:1; |
1042 |
+@@ -177,7 +179,7 @@ struct aq_hw_ops { |
1043 |
+ unsigned int packet_filter); |
1044 |
+ |
1045 |
+ int (*hw_multicast_list_set)(struct aq_hw_s *self, |
1046 |
+- u8 ar_mac[AQ_CFG_MULTICAST_ADDRESS_MAX] |
1047 |
++ u8 ar_mac[AQ_HW_MULTICAST_ADDRESS_MAX] |
1048 |
+ [ETH_ALEN], |
1049 |
+ u32 count); |
1050 |
+ |
1051 |
+diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_main.c b/drivers/net/ethernet/aquantia/atlantic/aq_main.c |
1052 |
+index ba5fe8c4125d..e3ae29e523f0 100644 |
1053 |
+--- a/drivers/net/ethernet/aquantia/atlantic/aq_main.c |
1054 |
++++ b/drivers/net/ethernet/aquantia/atlantic/aq_main.c |
1055 |
+@@ -135,17 +135,10 @@ static int aq_ndev_set_mac_address(struct net_device *ndev, void *addr) |
1056 |
+ static void aq_ndev_set_multicast_settings(struct net_device *ndev) |
1057 |
+ { |
1058 |
+ struct aq_nic_s *aq_nic = netdev_priv(ndev); |
1059 |
+- int err = 0; |
1060 |
+ |
1061 |
+- err = aq_nic_set_packet_filter(aq_nic, ndev->flags); |
1062 |
+- if (err < 0) |
1063 |
+- return; |
1064 |
++ aq_nic_set_packet_filter(aq_nic, ndev->flags); |
1065 |
+ |
1066 |
+- if (netdev_mc_count(ndev)) { |
1067 |
+- err = aq_nic_set_multicast_list(aq_nic, ndev); |
1068 |
+- if (err < 0) |
1069 |
+- return; |
1070 |
+- } |
1071 |
++ aq_nic_set_multicast_list(aq_nic, ndev); |
1072 |
+ } |
1073 |
+ |
1074 |
+ static const struct net_device_ops aq_ndev_ops = { |
1075 |
+diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c |
1076 |
+index 1a1a6380c128..7a22d0257e04 100644 |
1077 |
+--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c |
1078 |
++++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c |
1079 |
+@@ -563,34 +563,41 @@ int aq_nic_set_packet_filter(struct aq_nic_s *self, unsigned int flags) |
1080 |
+ |
1081 |
+ int aq_nic_set_multicast_list(struct aq_nic_s *self, struct net_device *ndev) |
1082 |
+ { |
1083 |
++ unsigned int packet_filter = self->packet_filter; |
1084 |
+ struct netdev_hw_addr *ha = NULL; |
1085 |
+ unsigned int i = 0U; |
1086 |
+ |
1087 |
+- self->mc_list.count = 0U; |
1088 |
+- |
1089 |
+- netdev_for_each_mc_addr(ha, ndev) { |
1090 |
+- ether_addr_copy(self->mc_list.ar[i++], ha->addr); |
1091 |
+- ++self->mc_list.count; |
1092 |
++ self->mc_list.count = 0; |
1093 |
++ if (netdev_uc_count(ndev) > AQ_HW_MULTICAST_ADDRESS_MAX) { |
1094 |
++ packet_filter |= IFF_PROMISC; |
1095 |
++ } else { |
1096 |
++ netdev_for_each_uc_addr(ha, ndev) { |
1097 |
++ ether_addr_copy(self->mc_list.ar[i++], ha->addr); |
1098 |
+ |
1099 |
+- if (i >= AQ_CFG_MULTICAST_ADDRESS_MAX) |
1100 |
+- break; |
1101 |
++ if (i >= AQ_HW_MULTICAST_ADDRESS_MAX) |
1102 |
++ break; |
1103 |
++ } |
1104 |
+ } |
1105 |
+ |
1106 |
+- if (i >= AQ_CFG_MULTICAST_ADDRESS_MAX) { |
1107 |
+- /* Number of filters is too big: atlantic does not support this. |
1108 |
+- * Force all multi filter to support this. |
1109 |
+- * With this we disable all UC filters and setup "all pass" |
1110 |
+- * multicast mask |
1111 |
+- */ |
1112 |
+- self->packet_filter |= IFF_ALLMULTI; |
1113 |
+- self->aq_nic_cfg.mc_list_count = 0; |
1114 |
+- return self->aq_hw_ops->hw_packet_filter_set(self->aq_hw, |
1115 |
+- self->packet_filter); |
1116 |
++ if (i + netdev_mc_count(ndev) > AQ_HW_MULTICAST_ADDRESS_MAX) { |
1117 |
++ packet_filter |= IFF_ALLMULTI; |
1118 |
+ } else { |
1119 |
+- return self->aq_hw_ops->hw_multicast_list_set(self->aq_hw, |
1120 |
+- self->mc_list.ar, |
1121 |
+- self->mc_list.count); |
1122 |
++ netdev_for_each_mc_addr(ha, ndev) { |
1123 |
++ ether_addr_copy(self->mc_list.ar[i++], ha->addr); |
1124 |
++ |
1125 |
++ if (i >= AQ_HW_MULTICAST_ADDRESS_MAX) |
1126 |
++ break; |
1127 |
++ } |
1128 |
++ } |
1129 |
++ |
1130 |
++ if (i > 0 && i < AQ_HW_MULTICAST_ADDRESS_MAX) { |
1131 |
++ packet_filter |= IFF_MULTICAST; |
1132 |
++ self->mc_list.count = i; |
1133 |
++ self->aq_hw_ops->hw_multicast_list_set(self->aq_hw, |
1134 |
++ self->mc_list.ar, |
1135 |
++ self->mc_list.count); |
1136 |
+ } |
1137 |
++ return aq_nic_set_packet_filter(self, packet_filter); |
1138 |
+ } |
1139 |
+ |
1140 |
+ int aq_nic_set_mtu(struct aq_nic_s *self, int new_mtu) |
1141 |
+diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h |
1142 |
+index faa533a0ec47..fecfc401f95d 100644 |
1143 |
+--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h |
1144 |
++++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h |
1145 |
+@@ -75,7 +75,7 @@ struct aq_nic_s { |
1146 |
+ struct aq_hw_link_status_s link_status; |
1147 |
+ struct { |
1148 |
+ u32 count; |
1149 |
+- u8 ar[AQ_CFG_MULTICAST_ADDRESS_MAX][ETH_ALEN]; |
1150 |
++ u8 ar[AQ_HW_MULTICAST_ADDRESS_MAX][ETH_ALEN]; |
1151 |
+ } mc_list; |
1152 |
+ |
1153 |
+ struct pci_dev *pdev; |
1154 |
+diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c |
1155 |
+index 67e2f9fb9402..8cc6abadc03b 100644 |
1156 |
+--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c |
1157 |
++++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c |
1158 |
+@@ -765,7 +765,7 @@ static int hw_atl_a0_hw_packet_filter_set(struct aq_hw_s *self, |
1159 |
+ |
1160 |
+ static int hw_atl_a0_hw_multicast_list_set(struct aq_hw_s *self, |
1161 |
+ u8 ar_mac |
1162 |
+- [AQ_CFG_MULTICAST_ADDRESS_MAX] |
1163 |
++ [AQ_HW_MULTICAST_ADDRESS_MAX] |
1164 |
+ [ETH_ALEN], |
1165 |
+ u32 count) |
1166 |
+ { |
1167 |
+diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c |
1168 |
+index 819f6bcf9b4e..956860a69797 100644 |
1169 |
+--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c |
1170 |
++++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c |
1171 |
+@@ -784,7 +784,7 @@ static int hw_atl_b0_hw_packet_filter_set(struct aq_hw_s *self, |
1172 |
+ |
1173 |
+ static int hw_atl_b0_hw_multicast_list_set(struct aq_hw_s *self, |
1174 |
+ u8 ar_mac |
1175 |
+- [AQ_CFG_MULTICAST_ADDRESS_MAX] |
1176 |
++ [AQ_HW_MULTICAST_ADDRESS_MAX] |
1177 |
+ [ETH_ALEN], |
1178 |
+ u32 count) |
1179 |
+ { |
1180 |
+@@ -812,7 +812,7 @@ static int hw_atl_b0_hw_multicast_list_set(struct aq_hw_s *self, |
1181 |
+ |
1182 |
+ hw_atl_rpfl2_uc_flr_en_set(self, |
1183 |
+ (self->aq_nic_cfg->is_mc_list_enabled), |
1184 |
+- HW_ATL_B0_MAC_MIN + i); |
1185 |
++ HW_ATL_B0_MAC_MIN + i); |
1186 |
+ } |
1187 |
+ |
1188 |
+ err = aq_hw_err_from_flags(self); |
1189 |
+diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c |
1190 |
+index f33b25fbca63..7db072fe5f22 100644 |
1191 |
+--- a/drivers/net/ethernet/broadcom/bcmsysport.c |
1192 |
++++ b/drivers/net/ethernet/broadcom/bcmsysport.c |
1193 |
+@@ -1946,8 +1946,8 @@ static int bcm_sysport_open(struct net_device *dev) |
1194 |
+ if (!priv->is_lite) |
1195 |
+ priv->crc_fwd = !!(umac_readl(priv, UMAC_CMD) & CMD_CRC_FWD); |
1196 |
+ else |
1197 |
+- priv->crc_fwd = !!(gib_readl(priv, GIB_CONTROL) & |
1198 |
+- GIB_FCS_STRIP); |
1199 |
++ priv->crc_fwd = !((gib_readl(priv, GIB_CONTROL) & |
1200 |
++ GIB_FCS_STRIP) >> GIB_FCS_STRIP_SHIFT); |
1201 |
+ |
1202 |
+ phydev = of_phy_connect(dev, priv->phy_dn, bcm_sysport_adj_link, |
1203 |
+ 0, priv->phy_interface); |
1204 |
+diff --git a/drivers/net/ethernet/broadcom/bcmsysport.h b/drivers/net/ethernet/broadcom/bcmsysport.h |
1205 |
+index d6e5d0cbf3a3..cf440b91fd04 100644 |
1206 |
+--- a/drivers/net/ethernet/broadcom/bcmsysport.h |
1207 |
++++ b/drivers/net/ethernet/broadcom/bcmsysport.h |
1208 |
+@@ -278,7 +278,8 @@ struct bcm_rsb { |
1209 |
+ #define GIB_GTX_CLK_EXT_CLK (0 << GIB_GTX_CLK_SEL_SHIFT) |
1210 |
+ #define GIB_GTX_CLK_125MHZ (1 << GIB_GTX_CLK_SEL_SHIFT) |
1211 |
+ #define GIB_GTX_CLK_250MHZ (2 << GIB_GTX_CLK_SEL_SHIFT) |
1212 |
+-#define GIB_FCS_STRIP (1 << 6) |
1213 |
++#define GIB_FCS_STRIP_SHIFT 6 |
1214 |
++#define GIB_FCS_STRIP (1 << GIB_FCS_STRIP_SHIFT) |
1215 |
+ #define GIB_LCL_LOOP_EN (1 << 7) |
1216 |
+ #define GIB_LCL_LOOP_TXEN (1 << 8) |
1217 |
+ #define GIB_RMT_LOOP_EN (1 << 9) |
1218 |
+diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c |
1219 |
+index 9f59b1270a7c..3e0e7f18ecf9 100644 |
1220 |
+--- a/drivers/net/ethernet/broadcom/tg3.c |
1221 |
++++ b/drivers/net/ethernet/broadcom/tg3.c |
1222 |
+@@ -9289,6 +9289,15 @@ static int tg3_chip_reset(struct tg3 *tp) |
1223 |
+ |
1224 |
+ tg3_restore_clk(tp); |
1225 |
+ |
1226 |
++ /* Increase the core clock speed to fix tx timeout issue for 5762 |
1227 |
++ * with 100Mbps link speed. |
1228 |
++ */ |
1229 |
++ if (tg3_asic_rev(tp) == ASIC_REV_5762) { |
1230 |
++ val = tr32(TG3_CPMU_CLCK_ORIDE_ENABLE); |
1231 |
++ tw32(TG3_CPMU_CLCK_ORIDE_ENABLE, val | |
1232 |
++ TG3_CPMU_MAC_ORIDE_ENABLE); |
1233 |
++ } |
1234 |
++ |
1235 |
+ /* Reprobe ASF enable state. */ |
1236 |
+ tg3_flag_clear(tp, ENABLE_ASF); |
1237 |
+ tp->phy_flags &= ~(TG3_PHYFLG_1G_ON_VAUX_OK | |
1238 |
+diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
1239 |
+index 5c613c6663da..2ca0f1dad54c 100644 |
1240 |
+--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
1241 |
++++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
1242 |
+@@ -474,10 +474,10 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, |
1243 |
+ { |
1244 |
+ const struct mlx4_en_frag_info *frag_info = priv->frag_info; |
1245 |
+ unsigned int truesize = 0; |
1246 |
++ bool release = true; |
1247 |
+ int nr, frag_size; |
1248 |
+ struct page *page; |
1249 |
+ dma_addr_t dma; |
1250 |
+- bool release; |
1251 |
+ |
1252 |
+ /* Collect used fragments while replacing them in the HW descriptors */ |
1253 |
+ for (nr = 0;; frags++) { |
1254 |
+@@ -500,7 +500,11 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, |
1255 |
+ release = page_count(page) != 1 || |
1256 |
+ page_is_pfmemalloc(page) || |
1257 |
+ page_to_nid(page) != numa_mem_id(); |
1258 |
+- } else { |
1259 |
++ } else if (!priv->rx_headroom) { |
1260 |
++ /* rx_headroom for non XDP setup is always 0. |
1261 |
++ * When XDP is set, the above condition will |
1262 |
++ * guarantee page is always released. |
1263 |
++ */ |
1264 |
+ u32 sz_align = ALIGN(frag_size, SMP_CACHE_BYTES); |
1265 |
+ |
1266 |
+ frags->page_offset += sz_align; |
1267 |
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c |
1268 |
+index c418113c6b20..c10ca3c20b36 100644 |
1269 |
+--- a/drivers/net/hyperv/netvsc.c |
1270 |
++++ b/drivers/net/hyperv/netvsc.c |
1271 |
+@@ -1291,6 +1291,7 @@ int netvsc_poll(struct napi_struct *napi, int budget) |
1272 |
+ struct hv_device *device = netvsc_channel_to_device(channel); |
1273 |
+ struct net_device *ndev = hv_get_drvdata(device); |
1274 |
+ int work_done = 0; |
1275 |
++ int ret; |
1276 |
+ |
1277 |
+ /* If starting a new interval */ |
1278 |
+ if (!nvchan->desc) |
1279 |
+@@ -1302,16 +1303,18 @@ int netvsc_poll(struct napi_struct *napi, int budget) |
1280 |
+ nvchan->desc = hv_pkt_iter_next(channel, nvchan->desc); |
1281 |
+ } |
1282 |
+ |
1283 |
+- /* If send of pending receive completions suceeded |
1284 |
+- * and did not exhaust NAPI budget this time |
1285 |
+- * and not doing busy poll |
1286 |
++ /* Send any pending receive completions */ |
1287 |
++ ret = send_recv_completions(ndev, net_device, nvchan); |
1288 |
++ |
1289 |
++ /* If it did not exhaust NAPI budget this time |
1290 |
++ * and not doing busy poll |
1291 |
+ * then re-enable host interrupts |
1292 |
+- * and reschedule if ring is not empty. |
1293 |
++ * and reschedule if ring is not empty |
1294 |
++ * or sending receive completion failed. |
1295 |
+ */ |
1296 |
+- if (send_recv_completions(ndev, net_device, nvchan) == 0 && |
1297 |
+- work_done < budget && |
1298 |
++ if (work_done < budget && |
1299 |
+ napi_complete_done(napi, work_done) && |
1300 |
+- hv_end_read(&channel->inbound) && |
1301 |
++ (ret || hv_end_read(&channel->inbound)) && |
1302 |
+ napi_schedule_prep(napi)) { |
1303 |
+ hv_begin_read(&channel->inbound); |
1304 |
+ __napi_schedule(napi); |
1305 |
+diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c |
1306 |
+index 9e4ba8e80a18..5aa081fda447 100644 |
1307 |
+--- a/drivers/net/phy/phy_device.c |
1308 |
++++ b/drivers/net/phy/phy_device.c |
1309 |
+@@ -1720,11 +1720,8 @@ EXPORT_SYMBOL(genphy_loopback); |
1310 |
+ |
1311 |
+ static int __set_phy_supported(struct phy_device *phydev, u32 max_speed) |
1312 |
+ { |
1313 |
+- /* The default values for phydev->supported are provided by the PHY |
1314 |
+- * driver "features" member, we want to reset to sane defaults first |
1315 |
+- * before supporting higher speeds. |
1316 |
+- */ |
1317 |
+- phydev->supported &= PHY_DEFAULT_FEATURES; |
1318 |
++ phydev->supported &= ~(PHY_1000BT_FEATURES | PHY_100BT_FEATURES | |
1319 |
++ PHY_10BT_FEATURES); |
1320 |
+ |
1321 |
+ switch (max_speed) { |
1322 |
+ default: |
1323 |
+diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c |
1324 |
+index 3d4f7959dabb..b1b3d8f7e67d 100644 |
1325 |
+--- a/drivers/net/usb/asix_devices.c |
1326 |
++++ b/drivers/net/usb/asix_devices.c |
1327 |
+@@ -642,10 +642,12 @@ static void ax88772_restore_phy(struct usbnet *dev) |
1328 |
+ priv->presvd_phy_advertise); |
1329 |
+ |
1330 |
+ /* Restore BMCR */ |
1331 |
++ if (priv->presvd_phy_bmcr & BMCR_ANENABLE) |
1332 |
++ priv->presvd_phy_bmcr |= BMCR_ANRESTART; |
1333 |
++ |
1334 |
+ asix_mdio_write_nopm(dev->net, dev->mii.phy_id, MII_BMCR, |
1335 |
+ priv->presvd_phy_bmcr); |
1336 |
+ |
1337 |
+- mii_nway_restart(&dev->mii); |
1338 |
+ priv->presvd_phy_advertise = 0; |
1339 |
+ priv->presvd_phy_bmcr = 0; |
1340 |
+ } |
1341 |
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c |
1342 |
+index 04c22f508ed9..f8f90d77cf0f 100644 |
1343 |
+--- a/drivers/net/usb/qmi_wwan.c |
1344 |
++++ b/drivers/net/usb/qmi_wwan.c |
1345 |
+@@ -1253,6 +1253,7 @@ static const struct usb_device_id products[] = { |
1346 |
+ {QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */ |
1347 |
+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0125, 4)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ |
1348 |
+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */ |
1349 |
++ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0191, 4)}, /* Quectel EG91 */ |
1350 |
+ {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */ |
1351 |
+ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0306, 4)}, /* Quectel EP06 Mini PCIe */ |
1352 |
+ |
1353 |
+diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c |
1354 |
+index 767c485af59b..522719b494f3 100644 |
1355 |
+--- a/drivers/ptp/ptp_chardev.c |
1356 |
++++ b/drivers/ptp/ptp_chardev.c |
1357 |
+@@ -89,6 +89,7 @@ int ptp_set_pinfunc(struct ptp_clock *ptp, unsigned int pin, |
1358 |
+ case PTP_PF_PHYSYNC: |
1359 |
+ if (chan != 0) |
1360 |
+ return -EINVAL; |
1361 |
++ break; |
1362 |
+ default: |
1363 |
+ return -EINVAL; |
1364 |
+ } |
1365 |
+diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h |
1366 |
+index eb2ec1fb07cb..209de7cd9358 100644 |
1367 |
+--- a/drivers/scsi/qla2xxx/qla_def.h |
1368 |
++++ b/drivers/scsi/qla2xxx/qla_def.h |
1369 |
+@@ -361,6 +361,8 @@ struct ct_arg { |
1370 |
+ dma_addr_t rsp_dma; |
1371 |
+ u32 req_size; |
1372 |
+ u32 rsp_size; |
1373 |
++ u32 req_allocated_size; |
1374 |
++ u32 rsp_allocated_size; |
1375 |
+ void *req; |
1376 |
+ void *rsp; |
1377 |
+ port_id_t id; |
1378 |
+diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c |
1379 |
+index 05abe5aaab7f..cbfbab5d9a59 100644 |
1380 |
+--- a/drivers/scsi/qla2xxx/qla_gs.c |
1381 |
++++ b/drivers/scsi/qla2xxx/qla_gs.c |
1382 |
+@@ -556,7 +556,7 @@ static void qla2x00_async_sns_sp_done(void *s, int rc) |
1383 |
+ /* please ignore kernel warning. otherwise, we have mem leak. */ |
1384 |
+ if (sp->u.iocb_cmd.u.ctarg.req) { |
1385 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1386 |
+- sizeof(struct ct_sns_pkt), |
1387 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size, |
1388 |
+ sp->u.iocb_cmd.u.ctarg.req, |
1389 |
+ sp->u.iocb_cmd.u.ctarg.req_dma); |
1390 |
+ sp->u.iocb_cmd.u.ctarg.req = NULL; |
1391 |
+@@ -564,7 +564,7 @@ static void qla2x00_async_sns_sp_done(void *s, int rc) |
1392 |
+ |
1393 |
+ if (sp->u.iocb_cmd.u.ctarg.rsp) { |
1394 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1395 |
+- sizeof(struct ct_sns_pkt), |
1396 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, |
1397 |
+ sp->u.iocb_cmd.u.ctarg.rsp, |
1398 |
+ sp->u.iocb_cmd.u.ctarg.rsp_dma); |
1399 |
+ sp->u.iocb_cmd.u.ctarg.rsp = NULL; |
1400 |
+@@ -617,6 +617,7 @@ static int qla_async_rftid(scsi_qla_host_t *vha, port_id_t *d_id) |
1401 |
+ sp->u.iocb_cmd.u.ctarg.req = dma_alloc_coherent(&vha->hw->pdev->dev, |
1402 |
+ sizeof(struct ct_sns_pkt), &sp->u.iocb_cmd.u.ctarg.req_dma, |
1403 |
+ GFP_KERNEL); |
1404 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size = sizeof(struct ct_sns_pkt); |
1405 |
+ if (!sp->u.iocb_cmd.u.ctarg.req) { |
1406 |
+ ql_log(ql_log_warn, vha, 0xd041, |
1407 |
+ "%s: Failed to allocate ct_sns request.\n", |
1408 |
+@@ -627,6 +628,7 @@ static int qla_async_rftid(scsi_qla_host_t *vha, port_id_t *d_id) |
1409 |
+ sp->u.iocb_cmd.u.ctarg.rsp = dma_alloc_coherent(&vha->hw->pdev->dev, |
1410 |
+ sizeof(struct ct_sns_pkt), &sp->u.iocb_cmd.u.ctarg.rsp_dma, |
1411 |
+ GFP_KERNEL); |
1412 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size = sizeof(struct ct_sns_pkt); |
1413 |
+ if (!sp->u.iocb_cmd.u.ctarg.rsp) { |
1414 |
+ ql_log(ql_log_warn, vha, 0xd042, |
1415 |
+ "%s: Failed to allocate ct_sns request.\n", |
1416 |
+@@ -712,6 +714,7 @@ static int qla_async_rffid(scsi_qla_host_t *vha, port_id_t *d_id, |
1417 |
+ sp->u.iocb_cmd.u.ctarg.req = dma_alloc_coherent(&vha->hw->pdev->dev, |
1418 |
+ sizeof(struct ct_sns_pkt), &sp->u.iocb_cmd.u.ctarg.req_dma, |
1419 |
+ GFP_KERNEL); |
1420 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size = sizeof(struct ct_sns_pkt); |
1421 |
+ if (!sp->u.iocb_cmd.u.ctarg.req) { |
1422 |
+ ql_log(ql_log_warn, vha, 0xd041, |
1423 |
+ "%s: Failed to allocate ct_sns request.\n", |
1424 |
+@@ -722,6 +725,7 @@ static int qla_async_rffid(scsi_qla_host_t *vha, port_id_t *d_id, |
1425 |
+ sp->u.iocb_cmd.u.ctarg.rsp = dma_alloc_coherent(&vha->hw->pdev->dev, |
1426 |
+ sizeof(struct ct_sns_pkt), &sp->u.iocb_cmd.u.ctarg.rsp_dma, |
1427 |
+ GFP_KERNEL); |
1428 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size = sizeof(struct ct_sns_pkt); |
1429 |
+ if (!sp->u.iocb_cmd.u.ctarg.rsp) { |
1430 |
+ ql_log(ql_log_warn, vha, 0xd042, |
1431 |
+ "%s: Failed to allocate ct_sns request.\n", |
1432 |
+@@ -802,6 +806,7 @@ static int qla_async_rnnid(scsi_qla_host_t *vha, port_id_t *d_id, |
1433 |
+ sp->u.iocb_cmd.u.ctarg.req = dma_alloc_coherent(&vha->hw->pdev->dev, |
1434 |
+ sizeof(struct ct_sns_pkt), &sp->u.iocb_cmd.u.ctarg.req_dma, |
1435 |
+ GFP_KERNEL); |
1436 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size = sizeof(struct ct_sns_pkt); |
1437 |
+ if (!sp->u.iocb_cmd.u.ctarg.req) { |
1438 |
+ ql_log(ql_log_warn, vha, 0xd041, |
1439 |
+ "%s: Failed to allocate ct_sns request.\n", |
1440 |
+@@ -812,6 +817,7 @@ static int qla_async_rnnid(scsi_qla_host_t *vha, port_id_t *d_id, |
1441 |
+ sp->u.iocb_cmd.u.ctarg.rsp = dma_alloc_coherent(&vha->hw->pdev->dev, |
1442 |
+ sizeof(struct ct_sns_pkt), &sp->u.iocb_cmd.u.ctarg.rsp_dma, |
1443 |
+ GFP_KERNEL); |
1444 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size = sizeof(struct ct_sns_pkt); |
1445 |
+ if (!sp->u.iocb_cmd.u.ctarg.rsp) { |
1446 |
+ ql_log(ql_log_warn, vha, 0xd042, |
1447 |
+ "%s: Failed to allocate ct_sns request.\n", |
1448 |
+@@ -909,6 +915,7 @@ static int qla_async_rsnn_nn(scsi_qla_host_t *vha) |
1449 |
+ sp->u.iocb_cmd.u.ctarg.req = dma_alloc_coherent(&vha->hw->pdev->dev, |
1450 |
+ sizeof(struct ct_sns_pkt), &sp->u.iocb_cmd.u.ctarg.req_dma, |
1451 |
+ GFP_KERNEL); |
1452 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size = sizeof(struct ct_sns_pkt); |
1453 |
+ if (!sp->u.iocb_cmd.u.ctarg.req) { |
1454 |
+ ql_log(ql_log_warn, vha, 0xd041, |
1455 |
+ "%s: Failed to allocate ct_sns request.\n", |
1456 |
+@@ -919,6 +926,7 @@ static int qla_async_rsnn_nn(scsi_qla_host_t *vha) |
1457 |
+ sp->u.iocb_cmd.u.ctarg.rsp = dma_alloc_coherent(&vha->hw->pdev->dev, |
1458 |
+ sizeof(struct ct_sns_pkt), &sp->u.iocb_cmd.u.ctarg.rsp_dma, |
1459 |
+ GFP_KERNEL); |
1460 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size = sizeof(struct ct_sns_pkt); |
1461 |
+ if (!sp->u.iocb_cmd.u.ctarg.rsp) { |
1462 |
+ ql_log(ql_log_warn, vha, 0xd042, |
1463 |
+ "%s: Failed to allocate ct_sns request.\n", |
1464 |
+@@ -3392,14 +3400,14 @@ void qla24xx_sp_unmap(scsi_qla_host_t *vha, srb_t *sp) |
1465 |
+ { |
1466 |
+ if (sp->u.iocb_cmd.u.ctarg.req) { |
1467 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1468 |
+- sizeof(struct ct_sns_pkt), |
1469 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size, |
1470 |
+ sp->u.iocb_cmd.u.ctarg.req, |
1471 |
+ sp->u.iocb_cmd.u.ctarg.req_dma); |
1472 |
+ sp->u.iocb_cmd.u.ctarg.req = NULL; |
1473 |
+ } |
1474 |
+ if (sp->u.iocb_cmd.u.ctarg.rsp) { |
1475 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1476 |
+- sizeof(struct ct_sns_pkt), |
1477 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, |
1478 |
+ sp->u.iocb_cmd.u.ctarg.rsp, |
1479 |
+ sp->u.iocb_cmd.u.ctarg.rsp_dma); |
1480 |
+ sp->u.iocb_cmd.u.ctarg.rsp = NULL; |
1481 |
+@@ -3600,14 +3608,14 @@ static void qla2x00_async_gpnid_sp_done(void *s, int res) |
1482 |
+ /* please ignore kernel warning. otherwise, we have mem leak. */ |
1483 |
+ if (sp->u.iocb_cmd.u.ctarg.req) { |
1484 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1485 |
+- sizeof(struct ct_sns_pkt), |
1486 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size, |
1487 |
+ sp->u.iocb_cmd.u.ctarg.req, |
1488 |
+ sp->u.iocb_cmd.u.ctarg.req_dma); |
1489 |
+ sp->u.iocb_cmd.u.ctarg.req = NULL; |
1490 |
+ } |
1491 |
+ if (sp->u.iocb_cmd.u.ctarg.rsp) { |
1492 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1493 |
+- sizeof(struct ct_sns_pkt), |
1494 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, |
1495 |
+ sp->u.iocb_cmd.u.ctarg.rsp, |
1496 |
+ sp->u.iocb_cmd.u.ctarg.rsp_dma); |
1497 |
+ sp->u.iocb_cmd.u.ctarg.rsp = NULL; |
1498 |
+@@ -3658,6 +3666,7 @@ int qla24xx_async_gpnid(scsi_qla_host_t *vha, port_id_t *id) |
1499 |
+ sp->u.iocb_cmd.u.ctarg.req = dma_alloc_coherent(&vha->hw->pdev->dev, |
1500 |
+ sizeof(struct ct_sns_pkt), &sp->u.iocb_cmd.u.ctarg.req_dma, |
1501 |
+ GFP_KERNEL); |
1502 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size = sizeof(struct ct_sns_pkt); |
1503 |
+ if (!sp->u.iocb_cmd.u.ctarg.req) { |
1504 |
+ ql_log(ql_log_warn, vha, 0xd041, |
1505 |
+ "Failed to allocate ct_sns request.\n"); |
1506 |
+@@ -3667,6 +3676,7 @@ int qla24xx_async_gpnid(scsi_qla_host_t *vha, port_id_t *id) |
1507 |
+ sp->u.iocb_cmd.u.ctarg.rsp = dma_alloc_coherent(&vha->hw->pdev->dev, |
1508 |
+ sizeof(struct ct_sns_pkt), &sp->u.iocb_cmd.u.ctarg.rsp_dma, |
1509 |
+ GFP_KERNEL); |
1510 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size = sizeof(struct ct_sns_pkt); |
1511 |
+ if (!sp->u.iocb_cmd.u.ctarg.rsp) { |
1512 |
+ ql_log(ql_log_warn, vha, 0xd042, |
1513 |
+ "Failed to allocate ct_sns request.\n"); |
1514 |
+@@ -4125,14 +4135,14 @@ static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res) |
1515 |
+ */ |
1516 |
+ if (sp->u.iocb_cmd.u.ctarg.req) { |
1517 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1518 |
+- sizeof(struct ct_sns_pkt), |
1519 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size, |
1520 |
+ sp->u.iocb_cmd.u.ctarg.req, |
1521 |
+ sp->u.iocb_cmd.u.ctarg.req_dma); |
1522 |
+ sp->u.iocb_cmd.u.ctarg.req = NULL; |
1523 |
+ } |
1524 |
+ if (sp->u.iocb_cmd.u.ctarg.rsp) { |
1525 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1526 |
+- sizeof(struct ct_sns_pkt), |
1527 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, |
1528 |
+ sp->u.iocb_cmd.u.ctarg.rsp, |
1529 |
+ sp->u.iocb_cmd.u.ctarg.rsp_dma); |
1530 |
+ sp->u.iocb_cmd.u.ctarg.rsp = NULL; |
1531 |
+@@ -4162,14 +4172,14 @@ static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res) |
1532 |
+ /* please ignore kernel warning. Otherwise, we have mem leak. */ |
1533 |
+ if (sp->u.iocb_cmd.u.ctarg.req) { |
1534 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1535 |
+- sizeof(struct ct_sns_pkt), |
1536 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size, |
1537 |
+ sp->u.iocb_cmd.u.ctarg.req, |
1538 |
+ sp->u.iocb_cmd.u.ctarg.req_dma); |
1539 |
+ sp->u.iocb_cmd.u.ctarg.req = NULL; |
1540 |
+ } |
1541 |
+ if (sp->u.iocb_cmd.u.ctarg.rsp) { |
1542 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1543 |
+- sizeof(struct ct_sns_pkt), |
1544 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, |
1545 |
+ sp->u.iocb_cmd.u.ctarg.rsp, |
1546 |
+ sp->u.iocb_cmd.u.ctarg.rsp_dma); |
1547 |
+ sp->u.iocb_cmd.u.ctarg.rsp = NULL; |
1548 |
+@@ -4264,14 +4274,14 @@ static int qla24xx_async_gnnft(scsi_qla_host_t *vha, struct srb *sp, |
1549 |
+ done_free_sp: |
1550 |
+ if (sp->u.iocb_cmd.u.ctarg.req) { |
1551 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1552 |
+- sizeof(struct ct_sns_pkt), |
1553 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size, |
1554 |
+ sp->u.iocb_cmd.u.ctarg.req, |
1555 |
+ sp->u.iocb_cmd.u.ctarg.req_dma); |
1556 |
+ sp->u.iocb_cmd.u.ctarg.req = NULL; |
1557 |
+ } |
1558 |
+ if (sp->u.iocb_cmd.u.ctarg.rsp) { |
1559 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1560 |
+- sizeof(struct ct_sns_pkt), |
1561 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, |
1562 |
+ sp->u.iocb_cmd.u.ctarg.rsp, |
1563 |
+ sp->u.iocb_cmd.u.ctarg.rsp_dma); |
1564 |
+ sp->u.iocb_cmd.u.ctarg.rsp = NULL; |
1565 |
+@@ -4332,6 +4342,7 @@ int qla24xx_async_gpnft(scsi_qla_host_t *vha, u8 fc4_type, srb_t *sp) |
1566 |
+ sp->u.iocb_cmd.u.ctarg.req = dma_zalloc_coherent( |
1567 |
+ &vha->hw->pdev->dev, sizeof(struct ct_sns_pkt), |
1568 |
+ &sp->u.iocb_cmd.u.ctarg.req_dma, GFP_KERNEL); |
1569 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size = sizeof(struct ct_sns_pkt); |
1570 |
+ if (!sp->u.iocb_cmd.u.ctarg.req) { |
1571 |
+ ql_log(ql_log_warn, vha, 0xffff, |
1572 |
+ "Failed to allocate ct_sns request.\n"); |
1573 |
+@@ -4349,6 +4360,7 @@ int qla24xx_async_gpnft(scsi_qla_host_t *vha, u8 fc4_type, srb_t *sp) |
1574 |
+ sp->u.iocb_cmd.u.ctarg.rsp = dma_zalloc_coherent( |
1575 |
+ &vha->hw->pdev->dev, rspsz, |
1576 |
+ &sp->u.iocb_cmd.u.ctarg.rsp_dma, GFP_KERNEL); |
1577 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size = sizeof(struct ct_sns_pkt); |
1578 |
+ if (!sp->u.iocb_cmd.u.ctarg.rsp) { |
1579 |
+ ql_log(ql_log_warn, vha, 0xffff, |
1580 |
+ "Failed to allocate ct_sns request.\n"); |
1581 |
+@@ -4408,14 +4420,14 @@ int qla24xx_async_gpnft(scsi_qla_host_t *vha, u8 fc4_type, srb_t *sp) |
1582 |
+ done_free_sp: |
1583 |
+ if (sp->u.iocb_cmd.u.ctarg.req) { |
1584 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1585 |
+- sizeof(struct ct_sns_pkt), |
1586 |
++ sp->u.iocb_cmd.u.ctarg.req_allocated_size, |
1587 |
+ sp->u.iocb_cmd.u.ctarg.req, |
1588 |
+ sp->u.iocb_cmd.u.ctarg.req_dma); |
1589 |
+ sp->u.iocb_cmd.u.ctarg.req = NULL; |
1590 |
+ } |
1591 |
+ if (sp->u.iocb_cmd.u.ctarg.rsp) { |
1592 |
+ dma_free_coherent(&vha->hw->pdev->dev, |
1593 |
+- sizeof(struct ct_sns_pkt), |
1594 |
++ sp->u.iocb_cmd.u.ctarg.rsp_allocated_size, |
1595 |
+ sp->u.iocb_cmd.u.ctarg.rsp, |
1596 |
+ sp->u.iocb_cmd.u.ctarg.rsp_dma); |
1597 |
+ sp->u.iocb_cmd.u.ctarg.rsp = NULL; |
1598 |
+diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c |
1599 |
+index 636960ad029a..0cb552268be3 100644 |
1600 |
+--- a/drivers/scsi/qla2xxx/qla_init.c |
1601 |
++++ b/drivers/scsi/qla2xxx/qla_init.c |
1602 |
+@@ -591,12 +591,14 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, |
1603 |
+ conflict_fcport = |
1604 |
+ qla2x00_find_fcport_by_wwpn(vha, |
1605 |
+ e->port_name, 0); |
1606 |
+- ql_dbg(ql_dbg_disc, vha, 0x20e6, |
1607 |
+- "%s %d %8phC post del sess\n", |
1608 |
+- __func__, __LINE__, |
1609 |
+- conflict_fcport->port_name); |
1610 |
+- qlt_schedule_sess_for_deletion |
1611 |
+- (conflict_fcport); |
1612 |
++ if (conflict_fcport) { |
1613 |
++ qlt_schedule_sess_for_deletion |
1614 |
++ (conflict_fcport); |
1615 |
++ ql_dbg(ql_dbg_disc, vha, 0x20e6, |
1616 |
++ "%s %d %8phC post del sess\n", |
1617 |
++ __func__, __LINE__, |
1618 |
++ conflict_fcport->port_name); |
1619 |
++ } |
1620 |
+ } |
1621 |
+ |
1622 |
+ /* FW already picked this loop id for another fcport */ |
1623 |
+diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c |
1624 |
+index 15eaa6dded04..2b0816dfe9bd 100644 |
1625 |
+--- a/drivers/scsi/qla2xxx/qla_os.c |
1626 |
++++ b/drivers/scsi/qla2xxx/qla_os.c |
1627 |
+@@ -3180,6 +3180,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) |
1628 |
+ "req->req_q_in=%p req->req_q_out=%p rsp->rsp_q_in=%p rsp->rsp_q_out=%p.\n", |
1629 |
+ req->req_q_in, req->req_q_out, rsp->rsp_q_in, rsp->rsp_q_out); |
1630 |
+ |
1631 |
++ ha->wq = alloc_workqueue("qla2xxx_wq", 0, 0); |
1632 |
++ |
1633 |
+ if (ha->isp_ops->initialize_adapter(base_vha)) { |
1634 |
+ ql_log(ql_log_fatal, base_vha, 0x00d6, |
1635 |
+ "Failed to initialize adapter - Adapter flags %x.\n", |
1636 |
+@@ -3216,8 +3218,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) |
1637 |
+ host->can_queue, base_vha->req, |
1638 |
+ base_vha->mgmt_svr_loop_id, host->sg_tablesize); |
1639 |
+ |
1640 |
+- ha->wq = alloc_workqueue("qla2xxx_wq", 0, 0); |
1641 |
+- |
1642 |
+ if (ha->mqenable) { |
1643 |
+ bool mq = false; |
1644 |
+ bool startit = false; |
1645 |
+diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c |
1646 |
+index 210407cd2341..da868f6c9638 100644 |
1647 |
+--- a/drivers/scsi/sd_zbc.c |
1648 |
++++ b/drivers/scsi/sd_zbc.c |
1649 |
+@@ -401,7 +401,8 @@ static int sd_zbc_check_capacity(struct scsi_disk *sdkp, unsigned char *buf) |
1650 |
+ * Check that all zones of the device are equal. The last zone can however |
1651 |
+ * be smaller. The zone size must also be a power of two number of LBAs. |
1652 |
+ * |
1653 |
+- * Returns the zone size in bytes upon success or an error code upon failure. |
1654 |
++ * Returns the zone size in number of blocks upon success or an error code |
1655 |
++ * upon failure. |
1656 |
+ */ |
1657 |
+ static s64 sd_zbc_check_zone_size(struct scsi_disk *sdkp) |
1658 |
+ { |
1659 |
+@@ -411,7 +412,7 @@ static s64 sd_zbc_check_zone_size(struct scsi_disk *sdkp) |
1660 |
+ unsigned char *rec; |
1661 |
+ unsigned int buf_len; |
1662 |
+ unsigned int list_length; |
1663 |
+- int ret; |
1664 |
++ s64 ret; |
1665 |
+ u8 same; |
1666 |
+ |
1667 |
+ /* Get a buffer */ |
1668 |
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c |
1669 |
+index 711da3306b14..61c3dc2f3be5 100644 |
1670 |
+--- a/drivers/usb/host/xhci.c |
1671 |
++++ b/drivers/usb/host/xhci.c |
1672 |
+@@ -844,6 +844,41 @@ static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci) |
1673 |
+ spin_unlock_irqrestore(&xhci->lock, flags); |
1674 |
+ } |
1675 |
+ |
1676 |
++static bool xhci_pending_portevent(struct xhci_hcd *xhci) |
1677 |
++{ |
1678 |
++ __le32 __iomem **port_array; |
1679 |
++ int port_index; |
1680 |
++ u32 status; |
1681 |
++ u32 portsc; |
1682 |
++ |
1683 |
++ status = readl(&xhci->op_regs->status); |
1684 |
++ if (status & STS_EINT) |
1685 |
++ return true; |
1686 |
++ /* |
1687 |
++ * Checking STS_EINT is not enough as there is a lag between a change |
1688 |
++ * bit being set and the Port Status Change Event that it generated |
1689 |
++ * being written to the Event Ring. See note in xhci 1.1 section 4.19.2. |
1690 |
++ */ |
1691 |
++ |
1692 |
++ port_index = xhci->num_usb2_ports; |
1693 |
++ port_array = xhci->usb2_ports; |
1694 |
++ while (port_index--) { |
1695 |
++ portsc = readl(port_array[port_index]); |
1696 |
++ if (portsc & PORT_CHANGE_MASK || |
1697 |
++ (portsc & PORT_PLS_MASK) == XDEV_RESUME) |
1698 |
++ return true; |
1699 |
++ } |
1700 |
++ port_index = xhci->num_usb3_ports; |
1701 |
++ port_array = xhci->usb3_ports; |
1702 |
++ while (port_index--) { |
1703 |
++ portsc = readl(port_array[port_index]); |
1704 |
++ if (portsc & PORT_CHANGE_MASK || |
1705 |
++ (portsc & PORT_PLS_MASK) == XDEV_RESUME) |
1706 |
++ return true; |
1707 |
++ } |
1708 |
++ return false; |
1709 |
++} |
1710 |
++ |
1711 |
+ /* |
1712 |
+ * Stop HC (not bus-specific) |
1713 |
+ * |
1714 |
+@@ -945,7 +980,7 @@ EXPORT_SYMBOL_GPL(xhci_suspend); |
1715 |
+ */ |
1716 |
+ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
1717 |
+ { |
1718 |
+- u32 command, temp = 0, status; |
1719 |
++ u32 command, temp = 0; |
1720 |
+ struct usb_hcd *hcd = xhci_to_hcd(xhci); |
1721 |
+ struct usb_hcd *secondary_hcd; |
1722 |
+ int retval = 0; |
1723 |
+@@ -1069,8 +1104,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) |
1724 |
+ done: |
1725 |
+ if (retval == 0) { |
1726 |
+ /* Resume root hubs only when have pending events. */ |
1727 |
+- status = readl(&xhci->op_regs->status); |
1728 |
+- if (status & STS_EINT) { |
1729 |
++ if (xhci_pending_portevent(xhci)) { |
1730 |
+ usb_hcd_resume_root_hub(xhci->shared_hcd); |
1731 |
+ usb_hcd_resume_root_hub(hcd); |
1732 |
+ } |
1733 |
+diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h |
1734 |
+index 6dfc4867dbcf..9751c1373fbb 100644 |
1735 |
+--- a/drivers/usb/host/xhci.h |
1736 |
++++ b/drivers/usb/host/xhci.h |
1737 |
+@@ -382,6 +382,10 @@ struct xhci_op_regs { |
1738 |
+ #define PORT_PLC (1 << 22) |
1739 |
+ /* port configure error change - port failed to configure its link partner */ |
1740 |
+ #define PORT_CEC (1 << 23) |
1741 |
++#define PORT_CHANGE_MASK (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \ |
1742 |
++ PORT_RC | PORT_PLC | PORT_CEC) |
1743 |
++ |
1744 |
++ |
1745 |
+ /* Cold Attach Status - xHC can set this bit to report device attached during |
1746 |
+ * Sx state. Warm port reset should be perfomed to clear this bit and move port |
1747 |
+ * to connected state. |
1748 |
+diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c |
1749 |
+index b423a309a6e0..125b58eff936 100644 |
1750 |
+--- a/drivers/vfio/pci/vfio_pci.c |
1751 |
++++ b/drivers/vfio/pci/vfio_pci.c |
1752 |
+@@ -28,6 +28,7 @@ |
1753 |
+ #include <linux/uaccess.h> |
1754 |
+ #include <linux/vfio.h> |
1755 |
+ #include <linux/vgaarb.h> |
1756 |
++#include <linux/nospec.h> |
1757 |
+ |
1758 |
+ #include "vfio_pci_private.h" |
1759 |
+ |
1760 |
+@@ -727,6 +728,9 @@ static long vfio_pci_ioctl(void *device_data, |
1761 |
+ if (info.index >= |
1762 |
+ VFIO_PCI_NUM_REGIONS + vdev->num_regions) |
1763 |
+ return -EINVAL; |
1764 |
++ info.index = array_index_nospec(info.index, |
1765 |
++ VFIO_PCI_NUM_REGIONS + |
1766 |
++ vdev->num_regions); |
1767 |
+ |
1768 |
+ i = info.index - VFIO_PCI_NUM_REGIONS; |
1769 |
+ |
1770 |
+diff --git a/drivers/vfio/vfio_iommu_spapr_tce.c b/drivers/vfio/vfio_iommu_spapr_tce.c |
1771 |
+index 759a5bdd40e1..2da5f054257a 100644 |
1772 |
+--- a/drivers/vfio/vfio_iommu_spapr_tce.c |
1773 |
++++ b/drivers/vfio/vfio_iommu_spapr_tce.c |
1774 |
+@@ -457,13 +457,13 @@ static void tce_iommu_unuse_page(struct tce_container *container, |
1775 |
+ } |
1776 |
+ |
1777 |
+ static int tce_iommu_prereg_ua_to_hpa(struct tce_container *container, |
1778 |
+- unsigned long tce, unsigned long size, |
1779 |
++ unsigned long tce, unsigned long shift, |
1780 |
+ unsigned long *phpa, struct mm_iommu_table_group_mem_t **pmem) |
1781 |
+ { |
1782 |
+ long ret = 0; |
1783 |
+ struct mm_iommu_table_group_mem_t *mem; |
1784 |
+ |
1785 |
+- mem = mm_iommu_lookup(container->mm, tce, size); |
1786 |
++ mem = mm_iommu_lookup(container->mm, tce, 1ULL << shift); |
1787 |
+ if (!mem) |
1788 |
+ return -EINVAL; |
1789 |
+ |
1790 |
+@@ -487,7 +487,7 @@ static void tce_iommu_unuse_page_v2(struct tce_container *container, |
1791 |
+ if (!pua) |
1792 |
+ return; |
1793 |
+ |
1794 |
+- ret = tce_iommu_prereg_ua_to_hpa(container, *pua, IOMMU_PAGE_SIZE(tbl), |
1795 |
++ ret = tce_iommu_prereg_ua_to_hpa(container, *pua, tbl->it_page_shift, |
1796 |
+ &hpa, &mem); |
1797 |
+ if (ret) |
1798 |
+ pr_debug("%s: tce %lx at #%lx was not cached, ret=%d\n", |
1799 |
+@@ -611,7 +611,7 @@ static long tce_iommu_build_v2(struct tce_container *container, |
1800 |
+ entry + i); |
1801 |
+ |
1802 |
+ ret = tce_iommu_prereg_ua_to_hpa(container, |
1803 |
+- tce, IOMMU_PAGE_SIZE(tbl), &hpa, &mem); |
1804 |
++ tce, tbl->it_page_shift, &hpa, &mem); |
1805 |
+ if (ret) |
1806 |
+ break; |
1807 |
+ |
1808 |
+diff --git a/fs/fat/inode.c b/fs/fat/inode.c |
1809 |
+index ffbbf0520d9e..6aa49dcaa938 100644 |
1810 |
+--- a/fs/fat/inode.c |
1811 |
++++ b/fs/fat/inode.c |
1812 |
+@@ -697,13 +697,21 @@ static void fat_set_state(struct super_block *sb, |
1813 |
+ brelse(bh); |
1814 |
+ } |
1815 |
+ |
1816 |
++static void fat_reset_iocharset(struct fat_mount_options *opts) |
1817 |
++{ |
1818 |
++ if (opts->iocharset != fat_default_iocharset) { |
1819 |
++ /* Note: opts->iocharset can be NULL here */ |
1820 |
++ kfree(opts->iocharset); |
1821 |
++ opts->iocharset = fat_default_iocharset; |
1822 |
++ } |
1823 |
++} |
1824 |
++ |
1825 |
+ static void delayed_free(struct rcu_head *p) |
1826 |
+ { |
1827 |
+ struct msdos_sb_info *sbi = container_of(p, struct msdos_sb_info, rcu); |
1828 |
+ unload_nls(sbi->nls_disk); |
1829 |
+ unload_nls(sbi->nls_io); |
1830 |
+- if (sbi->options.iocharset != fat_default_iocharset) |
1831 |
+- kfree(sbi->options.iocharset); |
1832 |
++ fat_reset_iocharset(&sbi->options); |
1833 |
+ kfree(sbi); |
1834 |
+ } |
1835 |
+ |
1836 |
+@@ -1118,7 +1126,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, |
1837 |
+ opts->fs_fmask = opts->fs_dmask = current_umask(); |
1838 |
+ opts->allow_utime = -1; |
1839 |
+ opts->codepage = fat_default_codepage; |
1840 |
+- opts->iocharset = fat_default_iocharset; |
1841 |
++ fat_reset_iocharset(opts); |
1842 |
+ if (is_vfat) { |
1843 |
+ opts->shortname = VFAT_SFN_DISPLAY_WINNT|VFAT_SFN_CREATE_WIN95; |
1844 |
+ opts->rodir = 0; |
1845 |
+@@ -1275,8 +1283,7 @@ static int parse_options(struct super_block *sb, char *options, int is_vfat, |
1846 |
+ |
1847 |
+ /* vfat specific */ |
1848 |
+ case Opt_charset: |
1849 |
+- if (opts->iocharset != fat_default_iocharset) |
1850 |
+- kfree(opts->iocharset); |
1851 |
++ fat_reset_iocharset(opts); |
1852 |
+ iocharset = match_strdup(&args[0]); |
1853 |
+ if (!iocharset) |
1854 |
+ return -ENOMEM; |
1855 |
+@@ -1867,8 +1874,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, |
1856 |
+ iput(fat_inode); |
1857 |
+ unload_nls(sbi->nls_io); |
1858 |
+ unload_nls(sbi->nls_disk); |
1859 |
+- if (sbi->options.iocharset != fat_default_iocharset) |
1860 |
+- kfree(sbi->options.iocharset); |
1861 |
++ fat_reset_iocharset(&sbi->options); |
1862 |
+ sb->s_fs_info = NULL; |
1863 |
+ kfree(sbi); |
1864 |
+ return error; |
1865 |
+diff --git a/fs/internal.h b/fs/internal.h |
1866 |
+index 980d005b21b4..5645b4ebf494 100644 |
1867 |
+--- a/fs/internal.h |
1868 |
++++ b/fs/internal.h |
1869 |
+@@ -127,7 +127,6 @@ int do_fchownat(int dfd, const char __user *filename, uid_t user, gid_t group, |
1870 |
+ |
1871 |
+ extern int open_check_o_direct(struct file *f); |
1872 |
+ extern int vfs_open(const struct path *, struct file *, const struct cred *); |
1873 |
+-extern struct file *filp_clone_open(struct file *); |
1874 |
+ |
1875 |
+ /* |
1876 |
+ * inode.c |
1877 |
+diff --git a/include/linux/fs.h b/include/linux/fs.h |
1878 |
+index 760d8da1b6c7..81fe0292a7ac 100644 |
1879 |
+--- a/include/linux/fs.h |
1880 |
++++ b/include/linux/fs.h |
1881 |
+@@ -2401,6 +2401,7 @@ extern struct file *filp_open(const char *, int, umode_t); |
1882 |
+ extern struct file *file_open_root(struct dentry *, struct vfsmount *, |
1883 |
+ const char *, int, umode_t); |
1884 |
+ extern struct file * dentry_open(const struct path *, int, const struct cred *); |
1885 |
++extern struct file *filp_clone_open(struct file *); |
1886 |
+ extern int filp_close(struct file *, fl_owner_t id); |
1887 |
+ |
1888 |
+ extern struct filename *getname_flags(const char __user *, int, int *); |
1889 |
+diff --git a/include/linux/sched/task.h b/include/linux/sched/task.h |
1890 |
+index 5be31eb7b266..108ede99e533 100644 |
1891 |
+--- a/include/linux/sched/task.h |
1892 |
++++ b/include/linux/sched/task.h |
1893 |
+@@ -75,7 +75,7 @@ extern long _do_fork(unsigned long, unsigned long, unsigned long, int __user *, |
1894 |
+ extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); |
1895 |
+ struct task_struct *fork_idle(int); |
1896 |
+ extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
1897 |
+-extern long kernel_wait4(pid_t, int *, int, struct rusage *); |
1898 |
++extern long kernel_wait4(pid_t, int __user *, int, struct rusage *); |
1899 |
+ |
1900 |
+ extern void free_task(struct task_struct *tsk); |
1901 |
+ |
1902 |
+diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h |
1903 |
+index 9065477ed255..15d8f9c84ca5 100644 |
1904 |
+--- a/include/linux/skbuff.h |
1905 |
++++ b/include/linux/skbuff.h |
1906 |
+@@ -628,6 +628,7 @@ typedef unsigned char *sk_buff_data_t; |
1907 |
+ * @hash: the packet hash |
1908 |
+ * @queue_mapping: Queue mapping for multiqueue devices |
1909 |
+ * @xmit_more: More SKBs are pending for this queue |
1910 |
++ * @pfmemalloc: skbuff was allocated from PFMEMALLOC reserves |
1911 |
+ * @ndisc_nodetype: router type (from link layer) |
1912 |
+ * @ooo_okay: allow the mapping of a socket to a queue to be changed |
1913 |
+ * @l4_hash: indicate hash is a canonical 4-tuple hash over transport |
1914 |
+@@ -733,7 +734,7 @@ struct sk_buff { |
1915 |
+ peeked:1, |
1916 |
+ head_frag:1, |
1917 |
+ xmit_more:1, |
1918 |
+- __unused:1; /* one bit hole */ |
1919 |
++ pfmemalloc:1; |
1920 |
+ |
1921 |
+ /* fields enclosed in headers_start/headers_end are copied |
1922 |
+ * using a single memcpy() in __copy_skb_header() |
1923 |
+@@ -752,31 +753,30 @@ struct sk_buff { |
1924 |
+ |
1925 |
+ __u8 __pkt_type_offset[0]; |
1926 |
+ __u8 pkt_type:3; |
1927 |
+- __u8 pfmemalloc:1; |
1928 |
+ __u8 ignore_df:1; |
1929 |
+- |
1930 |
+ __u8 nf_trace:1; |
1931 |
+ __u8 ip_summed:2; |
1932 |
+ __u8 ooo_okay:1; |
1933 |
++ |
1934 |
+ __u8 l4_hash:1; |
1935 |
+ __u8 sw_hash:1; |
1936 |
+ __u8 wifi_acked_valid:1; |
1937 |
+ __u8 wifi_acked:1; |
1938 |
+- |
1939 |
+ __u8 no_fcs:1; |
1940 |
+ /* Indicates the inner headers are valid in the skbuff. */ |
1941 |
+ __u8 encapsulation:1; |
1942 |
+ __u8 encap_hdr_csum:1; |
1943 |
+ __u8 csum_valid:1; |
1944 |
++ |
1945 |
+ __u8 csum_complete_sw:1; |
1946 |
+ __u8 csum_level:2; |
1947 |
+ __u8 csum_not_inet:1; |
1948 |
+- |
1949 |
+ __u8 dst_pending_confirm:1; |
1950 |
+ #ifdef CONFIG_IPV6_NDISC_NODETYPE |
1951 |
+ __u8 ndisc_nodetype:2; |
1952 |
+ #endif |
1953 |
+ __u8 ipvs_property:1; |
1954 |
++ |
1955 |
+ __u8 inner_protocol_type:1; |
1956 |
+ __u8 remcsum_offload:1; |
1957 |
+ #ifdef CONFIG_NET_SWITCHDEV |
1958 |
+diff --git a/include/net/ipv6.h b/include/net/ipv6.h |
1959 |
+index a406f2e8680a..aeebbbb9e0bd 100644 |
1960 |
+--- a/include/net/ipv6.h |
1961 |
++++ b/include/net/ipv6.h |
1962 |
+@@ -829,7 +829,7 @@ static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb, |
1963 |
+ * to minimize possbility that any useful information to an |
1964 |
+ * attacker is leaked. Only lower 20 bits are relevant. |
1965 |
+ */ |
1966 |
+- rol32(hash, 16); |
1967 |
++ hash = rol32(hash, 16); |
1968 |
+ |
1969 |
+ flowlabel = (__force __be32)hash & IPV6_FLOWLABEL_MASK; |
1970 |
+ |
1971 |
+diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h |
1972 |
+index 35498e613ff5..edfa9d0f6005 100644 |
1973 |
+--- a/include/net/sctp/sctp.h |
1974 |
++++ b/include/net/sctp/sctp.h |
1975 |
+@@ -609,10 +609,15 @@ static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport * |
1976 |
+ return t->dst; |
1977 |
+ } |
1978 |
+ |
1979 |
++static inline __u32 sctp_dst_mtu(const struct dst_entry *dst) |
1980 |
++{ |
1981 |
++ return SCTP_TRUNC4(max_t(__u32, dst_mtu(dst), |
1982 |
++ SCTP_DEFAULT_MINSEGMENT)); |
1983 |
++} |
1984 |
++ |
1985 |
+ static inline bool sctp_transport_pmtu_check(struct sctp_transport *t) |
1986 |
+ { |
1987 |
+- __u32 pmtu = max_t(size_t, SCTP_TRUNC4(dst_mtu(t->dst)), |
1988 |
+- SCTP_DEFAULT_MINSEGMENT); |
1989 |
++ __u32 pmtu = sctp_dst_mtu(t->dst); |
1990 |
+ |
1991 |
+ if (t->pathmtu == pmtu) |
1992 |
+ return true; |
1993 |
+diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c |
1994 |
+index 64c0291b579c..2f6fa95de2d8 100644 |
1995 |
+--- a/kernel/stop_machine.c |
1996 |
++++ b/kernel/stop_machine.c |
1997 |
+@@ -270,7 +270,11 @@ static int cpu_stop_queue_two_works(int cpu1, struct cpu_stop_work *work1, |
1998 |
+ goto retry; |
1999 |
+ } |
2000 |
+ |
2001 |
+- wake_up_q(&wakeq); |
2002 |
++ if (!err) { |
2003 |
++ preempt_disable(); |
2004 |
++ wake_up_q(&wakeq); |
2005 |
++ preempt_enable(); |
2006 |
++ } |
2007 |
+ |
2008 |
+ return err; |
2009 |
+ } |
2010 |
+diff --git a/lib/rhashtable.c b/lib/rhashtable.c |
2011 |
+index 2b2b79974b61..240a8b864d5b 100644 |
2012 |
+--- a/lib/rhashtable.c |
2013 |
++++ b/lib/rhashtable.c |
2014 |
+@@ -923,8 +923,16 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_stop); |
2015 |
+ |
2016 |
+ static size_t rounded_hashtable_size(const struct rhashtable_params *params) |
2017 |
+ { |
2018 |
+- return max(roundup_pow_of_two(params->nelem_hint * 4 / 3), |
2019 |
+- (unsigned long)params->min_size); |
2020 |
++ size_t retsize; |
2021 |
++ |
2022 |
++ if (params->nelem_hint) |
2023 |
++ retsize = max(roundup_pow_of_two(params->nelem_hint * 4 / 3), |
2024 |
++ (unsigned long)params->min_size); |
2025 |
++ else |
2026 |
++ retsize = max(HASH_DEFAULT_SIZE, |
2027 |
++ (unsigned long)params->min_size); |
2028 |
++ |
2029 |
++ return retsize; |
2030 |
+ } |
2031 |
+ |
2032 |
+ static u32 rhashtable_jhash2(const void *key, u32 length, u32 seed) |
2033 |
+@@ -981,8 +989,6 @@ int rhashtable_init(struct rhashtable *ht, |
2034 |
+ struct bucket_table *tbl; |
2035 |
+ size_t size; |
2036 |
+ |
2037 |
+- size = HASH_DEFAULT_SIZE; |
2038 |
+- |
2039 |
+ if ((!params->key_len && !params->obj_hashfn) || |
2040 |
+ (params->obj_hashfn && !params->obj_cmpfn)) |
2041 |
+ return -EINVAL; |
2042 |
+@@ -1009,8 +1015,7 @@ int rhashtable_init(struct rhashtable *ht, |
2043 |
+ |
2044 |
+ ht->p.min_size = max_t(u16, ht->p.min_size, HASH_MIN_SIZE); |
2045 |
+ |
2046 |
+- if (params->nelem_hint) |
2047 |
+- size = rounded_hashtable_size(&ht->p); |
2048 |
++ size = rounded_hashtable_size(&ht->p); |
2049 |
+ |
2050 |
+ if (params->locks_mul) |
2051 |
+ ht->p.locks_mul = roundup_pow_of_two(params->locks_mul); |
2052 |
+@@ -1102,13 +1107,14 @@ void rhashtable_free_and_destroy(struct rhashtable *ht, |
2053 |
+ void (*free_fn)(void *ptr, void *arg), |
2054 |
+ void *arg) |
2055 |
+ { |
2056 |
+- struct bucket_table *tbl; |
2057 |
++ struct bucket_table *tbl, *next_tbl; |
2058 |
+ unsigned int i; |
2059 |
+ |
2060 |
+ cancel_work_sync(&ht->run_work); |
2061 |
+ |
2062 |
+ mutex_lock(&ht->mutex); |
2063 |
+ tbl = rht_dereference(ht->tbl, ht); |
2064 |
++restart: |
2065 |
+ if (free_fn) { |
2066 |
+ for (i = 0; i < tbl->size; i++) { |
2067 |
+ struct rhash_head *pos, *next; |
2068 |
+@@ -1125,7 +1131,12 @@ void rhashtable_free_and_destroy(struct rhashtable *ht, |
2069 |
+ } |
2070 |
+ } |
2071 |
+ |
2072 |
++ next_tbl = rht_dereference(tbl->future_tbl, ht); |
2073 |
+ bucket_table_free(tbl); |
2074 |
++ if (next_tbl) { |
2075 |
++ tbl = next_tbl; |
2076 |
++ goto restart; |
2077 |
++ } |
2078 |
+ mutex_unlock(&ht->mutex); |
2079 |
+ } |
2080 |
+ EXPORT_SYMBOL_GPL(rhashtable_free_and_destroy); |
2081 |
+diff --git a/mm/huge_memory.c b/mm/huge_memory.c |
2082 |
+index b9f3dbd885bd..327e12679dd5 100644 |
2083 |
+--- a/mm/huge_memory.c |
2084 |
++++ b/mm/huge_memory.c |
2085 |
+@@ -2087,6 +2087,8 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, |
2086 |
+ if (vma_is_dax(vma)) |
2087 |
+ return; |
2088 |
+ page = pmd_page(_pmd); |
2089 |
++ if (!PageDirty(page) && pmd_dirty(_pmd)) |
2090 |
++ set_page_dirty(page); |
2091 |
+ if (!PageReferenced(page) && pmd_young(_pmd)) |
2092 |
+ SetPageReferenced(page); |
2093 |
+ page_remove_rmap(page, true); |
2094 |
+diff --git a/mm/memcontrol.c b/mm/memcontrol.c |
2095 |
+index 2bd3df3d101a..95c0980a6f7e 100644 |
2096 |
+--- a/mm/memcontrol.c |
2097 |
++++ b/mm/memcontrol.c |
2098 |
+@@ -850,7 +850,7 @@ static void invalidate_reclaim_iterators(struct mem_cgroup *dead_memcg) |
2099 |
+ int nid; |
2100 |
+ int i; |
2101 |
+ |
2102 |
+- while ((memcg = parent_mem_cgroup(memcg))) { |
2103 |
++ for (; memcg; memcg = parent_mem_cgroup(memcg)) { |
2104 |
+ for_each_node(nid) { |
2105 |
+ mz = mem_cgroup_nodeinfo(memcg, nid); |
2106 |
+ for (i = 0; i <= DEF_PRIORITY; i++) { |
2107 |
+diff --git a/net/core/gen_stats.c b/net/core/gen_stats.c |
2108 |
+index b2b2323bdc84..188d693cb251 100644 |
2109 |
+--- a/net/core/gen_stats.c |
2110 |
++++ b/net/core/gen_stats.c |
2111 |
+@@ -77,8 +77,20 @@ gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type, |
2112 |
+ d->lock = lock; |
2113 |
+ spin_lock_bh(lock); |
2114 |
+ } |
2115 |
+- if (d->tail) |
2116 |
+- return gnet_stats_copy(d, type, NULL, 0, padattr); |
2117 |
++ if (d->tail) { |
2118 |
++ int ret = gnet_stats_copy(d, type, NULL, 0, padattr); |
2119 |
++ |
2120 |
++ /* The initial attribute added in gnet_stats_copy() may be |
2121 |
++ * preceded by a padding attribute, in which case d->tail will |
2122 |
++ * end up pointing at the padding instead of the real attribute. |
2123 |
++ * Fix this so gnet_stats_finish_copy() adjusts the length of |
2124 |
++ * the right attribute. |
2125 |
++ */ |
2126 |
++ if (ret == 0 && d->tail->nla_type == padattr) |
2127 |
++ d->tail = (struct nlattr *)((char *)d->tail + |
2128 |
++ NLA_ALIGN(d->tail->nla_len)); |
2129 |
++ return ret; |
2130 |
++ } |
2131 |
+ |
2132 |
+ return 0; |
2133 |
+ } |
2134 |
+diff --git a/net/core/skbuff.c b/net/core/skbuff.c |
2135 |
+index 345b51837ca8..a84d69c047ac 100644 |
2136 |
+--- a/net/core/skbuff.c |
2137 |
++++ b/net/core/skbuff.c |
2138 |
+@@ -858,6 +858,7 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb) |
2139 |
+ n->cloned = 1; |
2140 |
+ n->nohdr = 0; |
2141 |
+ n->peeked = 0; |
2142 |
++ C(pfmemalloc); |
2143 |
+ n->destructor = NULL; |
2144 |
+ C(tail); |
2145 |
+ C(end); |
2146 |
+diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c |
2147 |
+index e66172aaf241..511d6748ea5f 100644 |
2148 |
+--- a/net/ipv4/fib_frontend.c |
2149 |
++++ b/net/ipv4/fib_frontend.c |
2150 |
+@@ -300,6 +300,7 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb) |
2151 |
+ if (!ipv4_is_zeronet(ip_hdr(skb)->saddr)) { |
2152 |
+ struct flowi4 fl4 = { |
2153 |
+ .flowi4_iif = LOOPBACK_IFINDEX, |
2154 |
++ .flowi4_oif = l3mdev_master_ifindex_rcu(dev), |
2155 |
+ .daddr = ip_hdr(skb)->saddr, |
2156 |
+ .flowi4_tos = RT_TOS(ip_hdr(skb)->tos), |
2157 |
+ .flowi4_scope = scope, |
2158 |
+diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c |
2159 |
+index 2f600f261690..61e42a3390ba 100644 |
2160 |
+--- a/net/ipv4/sysctl_net_ipv4.c |
2161 |
++++ b/net/ipv4/sysctl_net_ipv4.c |
2162 |
+@@ -187,8 +187,9 @@ static int ipv4_ping_group_range(struct ctl_table *table, int write, |
2163 |
+ if (write && ret == 0) { |
2164 |
+ low = make_kgid(user_ns, urange[0]); |
2165 |
+ high = make_kgid(user_ns, urange[1]); |
2166 |
+- if (!gid_valid(low) || !gid_valid(high) || |
2167 |
+- (urange[1] < urange[0]) || gid_lt(high, low)) { |
2168 |
++ if (!gid_valid(low) || !gid_valid(high)) |
2169 |
++ return -EINVAL; |
2170 |
++ if (urange[1] < urange[0] || gid_lt(high, low)) { |
2171 |
+ low = make_kgid(&init_user_ns, 1); |
2172 |
+ high = make_kgid(&init_user_ns, 0); |
2173 |
+ } |
2174 |
+diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
2175 |
+index c9d00ef54dec..58e316cf6607 100644 |
2176 |
+--- a/net/ipv4/tcp.c |
2177 |
++++ b/net/ipv4/tcp.c |
2178 |
+@@ -3524,8 +3524,7 @@ int tcp_abort(struct sock *sk, int err) |
2179 |
+ struct request_sock *req = inet_reqsk(sk); |
2180 |
+ |
2181 |
+ local_bh_disable(); |
2182 |
+- inet_csk_reqsk_queue_drop_and_put(req->rsk_listener, |
2183 |
+- req); |
2184 |
++ inet_csk_reqsk_queue_drop(req->rsk_listener, req); |
2185 |
+ local_bh_enable(); |
2186 |
+ return 0; |
2187 |
+ } |
2188 |
+diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig |
2189 |
+index 11e4e80cf7e9..0efb914695ac 100644 |
2190 |
+--- a/net/ipv6/Kconfig |
2191 |
++++ b/net/ipv6/Kconfig |
2192 |
+@@ -108,6 +108,7 @@ config IPV6_MIP6 |
2193 |
+ config IPV6_ILA |
2194 |
+ tristate "IPv6: Identifier Locator Addressing (ILA)" |
2195 |
+ depends on NETFILTER |
2196 |
++ select DST_CACHE |
2197 |
+ select LWTUNNEL |
2198 |
+ ---help--- |
2199 |
+ Support for IPv6 Identifier Locator Addressing (ILA). |
2200 |
+diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c |
2201 |
+index 458de353f5d9..1a4d6897d17f 100644 |
2202 |
+--- a/net/ipv6/ip6_gre.c |
2203 |
++++ b/net/ipv6/ip6_gre.c |
2204 |
+@@ -927,7 +927,6 @@ static netdev_tx_t ip6gre_tunnel_xmit(struct sk_buff *skb, |
2205 |
+ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb, |
2206 |
+ struct net_device *dev) |
2207 |
+ { |
2208 |
+- struct ipv6hdr *ipv6h = ipv6_hdr(skb); |
2209 |
+ struct ip6_tnl *t = netdev_priv(dev); |
2210 |
+ struct dst_entry *dst = skb_dst(skb); |
2211 |
+ struct net_device_stats *stats; |
2212 |
+@@ -998,6 +997,8 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb, |
2213 |
+ goto tx_err; |
2214 |
+ } |
2215 |
+ } else { |
2216 |
++ struct ipv6hdr *ipv6h = ipv6_hdr(skb); |
2217 |
++ |
2218 |
+ switch (skb->protocol) { |
2219 |
+ case htons(ETH_P_IP): |
2220 |
+ memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); |
2221 |
+diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c |
2222 |
+index 525051a886bc..3ff9316616d8 100644 |
2223 |
+--- a/net/ipv6/ndisc.c |
2224 |
++++ b/net/ipv6/ndisc.c |
2225 |
+@@ -811,7 +811,7 @@ static void ndisc_recv_ns(struct sk_buff *skb) |
2226 |
+ return; |
2227 |
+ } |
2228 |
+ } |
2229 |
+- if (ndopts.nd_opts_nonce) |
2230 |
++ if (ndopts.nd_opts_nonce && ndopts.nd_opts_nonce->nd_opt_len == 1) |
2231 |
+ memcpy(&nonce, (u8 *)(ndopts.nd_opts_nonce + 1), 6); |
2232 |
+ |
2233 |
+ inc = ipv6_addr_is_multicast(daddr); |
2234 |
+diff --git a/net/ipv6/route.c b/net/ipv6/route.c |
2235 |
+index b94345e657f7..3ed4de230830 100644 |
2236 |
+--- a/net/ipv6/route.c |
2237 |
++++ b/net/ipv6/route.c |
2238 |
+@@ -4274,6 +4274,13 @@ static int ip6_route_multipath_add(struct fib6_config *cfg, |
2239 |
+ err_nh = nh; |
2240 |
+ goto add_errout; |
2241 |
+ } |
2242 |
++ if (!rt6_qualify_for_ecmp(rt)) { |
2243 |
++ err = -EINVAL; |
2244 |
++ NL_SET_ERR_MSG(extack, |
2245 |
++ "Device only routes can not be added for IPv6 using the multipath API."); |
2246 |
++ dst_release_immediate(&rt->dst); |
2247 |
++ goto cleanup; |
2248 |
++ } |
2249 |
+ |
2250 |
+ /* Because each route is added like a single route we remove |
2251 |
+ * these flags after the first nexthop: if there is a collision, |
2252 |
+diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c |
2253 |
+index 22fa13cf5d8b..846883907cd4 100644 |
2254 |
+--- a/net/sched/sch_fq_codel.c |
2255 |
++++ b/net/sched/sch_fq_codel.c |
2256 |
+@@ -479,23 +479,27 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt, |
2257 |
+ q->cparams.mtu = psched_mtu(qdisc_dev(sch)); |
2258 |
+ |
2259 |
+ if (opt) { |
2260 |
+- int err = fq_codel_change(sch, opt, extack); |
2261 |
++ err = fq_codel_change(sch, opt, extack); |
2262 |
+ if (err) |
2263 |
+- return err; |
2264 |
++ goto init_failure; |
2265 |
+ } |
2266 |
+ |
2267 |
+ err = tcf_block_get(&q->block, &q->filter_list, sch, extack); |
2268 |
+ if (err) |
2269 |
+- return err; |
2270 |
++ goto init_failure; |
2271 |
+ |
2272 |
+ if (!q->flows) { |
2273 |
+ q->flows = kvzalloc(q->flows_cnt * |
2274 |
+ sizeof(struct fq_codel_flow), GFP_KERNEL); |
2275 |
+- if (!q->flows) |
2276 |
+- return -ENOMEM; |
2277 |
++ if (!q->flows) { |
2278 |
++ err = -ENOMEM; |
2279 |
++ goto init_failure; |
2280 |
++ } |
2281 |
+ q->backlogs = kvzalloc(q->flows_cnt * sizeof(u32), GFP_KERNEL); |
2282 |
+- if (!q->backlogs) |
2283 |
+- return -ENOMEM; |
2284 |
++ if (!q->backlogs) { |
2285 |
++ err = -ENOMEM; |
2286 |
++ goto alloc_failure; |
2287 |
++ } |
2288 |
+ for (i = 0; i < q->flows_cnt; i++) { |
2289 |
+ struct fq_codel_flow *flow = q->flows + i; |
2290 |
+ |
2291 |
+@@ -508,6 +512,13 @@ static int fq_codel_init(struct Qdisc *sch, struct nlattr *opt, |
2292 |
+ else |
2293 |
+ sch->flags &= ~TCQ_F_CAN_BYPASS; |
2294 |
+ return 0; |
2295 |
++ |
2296 |
++alloc_failure: |
2297 |
++ kvfree(q->flows); |
2298 |
++ q->flows = NULL; |
2299 |
++init_failure: |
2300 |
++ q->flows_cnt = 0; |
2301 |
++ return err; |
2302 |
+ } |
2303 |
+ |
2304 |
+ static int fq_codel_dump(struct Qdisc *sch, struct sk_buff *skb) |
2305 |
+diff --git a/net/sctp/associola.c b/net/sctp/associola.c |
2306 |
+index a47179da24e6..ef8adac1be83 100644 |
2307 |
+--- a/net/sctp/associola.c |
2308 |
++++ b/net/sctp/associola.c |
2309 |
+@@ -1446,11 +1446,9 @@ void sctp_assoc_sync_pmtu(struct sctp_association *asoc) |
2310 |
+ return; |
2311 |
+ |
2312 |
+ /* Get the lowest pmtu of all the transports. */ |
2313 |
+- list_for_each_entry(t, &asoc->peer.transport_addr_list, |
2314 |
+- transports) { |
2315 |
++ list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) { |
2316 |
+ if (t->pmtu_pending && t->dst) { |
2317 |
+- sctp_transport_update_pmtu( |
2318 |
+- t, SCTP_TRUNC4(dst_mtu(t->dst))); |
2319 |
++ sctp_transport_update_pmtu(t, sctp_dst_mtu(t->dst)); |
2320 |
+ t->pmtu_pending = 0; |
2321 |
+ } |
2322 |
+ if (!pmtu || (t->pathmtu < pmtu)) |
2323 |
+diff --git a/net/sctp/transport.c b/net/sctp/transport.c |
2324 |
+index 03fc2c427aca..e890ceb55939 100644 |
2325 |
+--- a/net/sctp/transport.c |
2326 |
++++ b/net/sctp/transport.c |
2327 |
+@@ -242,9 +242,9 @@ void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk) |
2328 |
+ &transport->fl, sk); |
2329 |
+ } |
2330 |
+ |
2331 |
+- if (transport->dst) { |
2332 |
+- transport->pathmtu = SCTP_TRUNC4(dst_mtu(transport->dst)); |
2333 |
+- } else |
2334 |
++ if (transport->dst) |
2335 |
++ transport->pathmtu = sctp_dst_mtu(transport->dst); |
2336 |
++ else |
2337 |
+ transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; |
2338 |
+ } |
2339 |
+ |
2340 |
+@@ -273,7 +273,7 @@ bool sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu) |
2341 |
+ |
2342 |
+ if (dst) { |
2343 |
+ /* Re-fetch, as under layers may have a higher minimum size */ |
2344 |
+- pmtu = SCTP_TRUNC4(dst_mtu(dst)); |
2345 |
++ pmtu = sctp_dst_mtu(dst); |
2346 |
+ change = t->pathmtu != pmtu; |
2347 |
+ } |
2348 |
+ t->pathmtu = pmtu; |
2349 |
+diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c |
2350 |
+index 69616d00481c..b53026a72e73 100644 |
2351 |
+--- a/sound/core/rawmidi.c |
2352 |
++++ b/sound/core/rawmidi.c |
2353 |
+@@ -635,7 +635,7 @@ static int snd_rawmidi_info_select_user(struct snd_card *card, |
2354 |
+ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, |
2355 |
+ struct snd_rawmidi_params * params) |
2356 |
+ { |
2357 |
+- char *newbuf; |
2358 |
++ char *newbuf, *oldbuf; |
2359 |
+ struct snd_rawmidi_runtime *runtime = substream->runtime; |
2360 |
+ |
2361 |
+ if (substream->append && substream->use_count > 1) |
2362 |
+@@ -648,13 +648,17 @@ int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream, |
2363 |
+ return -EINVAL; |
2364 |
+ } |
2365 |
+ if (params->buffer_size != runtime->buffer_size) { |
2366 |
+- newbuf = krealloc(runtime->buffer, params->buffer_size, |
2367 |
+- GFP_KERNEL); |
2368 |
++ newbuf = kmalloc(params->buffer_size, GFP_KERNEL); |
2369 |
+ if (!newbuf) |
2370 |
+ return -ENOMEM; |
2371 |
++ spin_lock_irq(&runtime->lock); |
2372 |
++ oldbuf = runtime->buffer; |
2373 |
+ runtime->buffer = newbuf; |
2374 |
+ runtime->buffer_size = params->buffer_size; |
2375 |
+ runtime->avail = runtime->buffer_size; |
2376 |
++ runtime->appl_ptr = runtime->hw_ptr = 0; |
2377 |
++ spin_unlock_irq(&runtime->lock); |
2378 |
++ kfree(oldbuf); |
2379 |
+ } |
2380 |
+ runtime->avail_min = params->avail_min; |
2381 |
+ substream->active_sensing = !params->no_active_sensing; |
2382 |
+@@ -665,7 +669,7 @@ EXPORT_SYMBOL(snd_rawmidi_output_params); |
2383 |
+ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, |
2384 |
+ struct snd_rawmidi_params * params) |
2385 |
+ { |
2386 |
+- char *newbuf; |
2387 |
++ char *newbuf, *oldbuf; |
2388 |
+ struct snd_rawmidi_runtime *runtime = substream->runtime; |
2389 |
+ |
2390 |
+ snd_rawmidi_drain_input(substream); |
2391 |
+@@ -676,12 +680,16 @@ int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream, |
2392 |
+ return -EINVAL; |
2393 |
+ } |
2394 |
+ if (params->buffer_size != runtime->buffer_size) { |
2395 |
+- newbuf = krealloc(runtime->buffer, params->buffer_size, |
2396 |
+- GFP_KERNEL); |
2397 |
++ newbuf = kmalloc(params->buffer_size, GFP_KERNEL); |
2398 |
+ if (!newbuf) |
2399 |
+ return -ENOMEM; |
2400 |
++ spin_lock_irq(&runtime->lock); |
2401 |
++ oldbuf = runtime->buffer; |
2402 |
+ runtime->buffer = newbuf; |
2403 |
+ runtime->buffer_size = params->buffer_size; |
2404 |
++ runtime->appl_ptr = runtime->hw_ptr = 0; |
2405 |
++ spin_unlock_irq(&runtime->lock); |
2406 |
++ kfree(oldbuf); |
2407 |
+ } |
2408 |
+ runtime->avail_min = params->avail_min; |
2409 |
+ return 0; |
2410 |
+diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c |
2411 |
+index ba9a7e552183..88ce2f1022e1 100644 |
2412 |
+--- a/sound/pci/hda/patch_conexant.c |
2413 |
++++ b/sound/pci/hda/patch_conexant.c |
2414 |
+@@ -965,6 +965,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = { |
2415 |
+ SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC), |
2416 |
+ SND_PCI_QUIRK(0x103c, 0x814f, "HP ZBook 15u G3", CXT_FIXUP_MUTE_LED_GPIO), |
2417 |
+ SND_PCI_QUIRK(0x103c, 0x822e, "HP ProBook 440 G4", CXT_FIXUP_MUTE_LED_GPIO), |
2418 |
++ SND_PCI_QUIRK(0x103c, 0x836e, "HP ProBook 455 G5", CXT_FIXUP_MUTE_LED_GPIO), |
2419 |
+ SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
2420 |
+ SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
2421 |
+ SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
2422 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
2423 |
+index 066efe783fe8..7bba415cb850 100644 |
2424 |
+--- a/sound/pci/hda/patch_realtek.c |
2425 |
++++ b/sound/pci/hda/patch_realtek.c |
2426 |
+@@ -2363,6 +2363,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
2427 |
+ SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), |
2428 |
+ SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), |
2429 |
+ SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
2430 |
++ SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), |
2431 |
+ SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), |
2432 |
+ SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), |
2433 |
+ SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), |
2434 |
+@@ -6543,6 +6544,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
2435 |
+ SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC), |
2436 |
+ SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC), |
2437 |
+ SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE), |
2438 |
++ SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), |
2439 |
+ SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), |
2440 |
+ SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), |
2441 |
+ SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), |
2442 |
+diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c |
2443 |
+index 6e865e8b5b10..fe6eb0fe07f6 100644 |
2444 |
+--- a/virt/kvm/eventfd.c |
2445 |
++++ b/virt/kvm/eventfd.c |
2446 |
+@@ -119,8 +119,12 @@ irqfd_shutdown(struct work_struct *work) |
2447 |
+ { |
2448 |
+ struct kvm_kernel_irqfd *irqfd = |
2449 |
+ container_of(work, struct kvm_kernel_irqfd, shutdown); |
2450 |
++ struct kvm *kvm = irqfd->kvm; |
2451 |
+ u64 cnt; |
2452 |
+ |
2453 |
++ /* Make sure irqfd has been initalized in assign path. */ |
2454 |
++ synchronize_srcu(&kvm->irq_srcu); |
2455 |
++ |
2456 |
+ /* |
2457 |
+ * Synchronize with the wait-queue and unhook ourselves to prevent |
2458 |
+ * further events. |
2459 |
+@@ -387,7 +391,6 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) |
2460 |
+ |
2461 |
+ idx = srcu_read_lock(&kvm->irq_srcu); |
2462 |
+ irqfd_update(kvm, irqfd); |
2463 |
+- srcu_read_unlock(&kvm->irq_srcu, idx); |
2464 |
+ |
2465 |
+ list_add_tail(&irqfd->list, &kvm->irqfds.items); |
2466 |
+ |
2467 |
+@@ -402,11 +405,6 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) |
2468 |
+ if (events & EPOLLIN) |
2469 |
+ schedule_work(&irqfd->inject); |
2470 |
+ |
2471 |
+- /* |
2472 |
+- * do not drop the file until the irqfd is fully initialized, otherwise |
2473 |
+- * we might race against the EPOLLHUP |
2474 |
+- */ |
2475 |
+- fdput(f); |
2476 |
+ #ifdef CONFIG_HAVE_KVM_IRQ_BYPASS |
2477 |
+ if (kvm_arch_has_irq_bypass()) { |
2478 |
+ irqfd->consumer.token = (void *)irqfd->eventfd; |
2479 |
+@@ -421,6 +419,13 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) |
2480 |
+ } |
2481 |
+ #endif |
2482 |
+ |
2483 |
++ srcu_read_unlock(&kvm->irq_srcu, idx); |
2484 |
++ |
2485 |
++ /* |
2486 |
++ * do not drop the file until the irqfd is fully initialized, otherwise |
2487 |
++ * we might race against the EPOLLHUP |
2488 |
++ */ |
2489 |
++ fdput(f); |
2490 |
+ return 0; |
2491 |
+ |
2492 |
+ fail: |