1 |
commit: 112e032ffd1ab1fd8f367da3dd7aa1048a8f281f |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 27 11:21:48 2019 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 27 11:21:48 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=112e032f |
7 |
|
8 |
proj/linux-patches: Linux patch 4.14.104 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1103_linux-4.14.104.patch | 1953 +++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1957 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index f326b57..26d07a8 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -455,6 +455,10 @@ Patch: 1102_4.14.103.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.14.103 |
23 |
|
24 |
+Patch: 1103_4.14.104.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.14.104 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1103_linux-4.14.104.patch b/1103_linux-4.14.104.patch |
33 |
new file mode 100644 |
34 |
index 0000000..3db32e7 |
35 |
--- /dev/null |
36 |
+++ b/1103_linux-4.14.104.patch |
37 |
@@ -0,0 +1,1953 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 52d150b1f5efa..967692b8941fc 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 14 |
46 |
+-SUBLEVEL = 103 |
47 |
++SUBLEVEL = 104 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Petit Gorille |
50 |
+ |
51 |
+diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h |
52 |
+index ff7d3232764a2..db681cf4959c8 100644 |
53 |
+--- a/arch/arc/include/asm/cache.h |
54 |
++++ b/arch/arc/include/asm/cache.h |
55 |
+@@ -52,6 +52,17 @@ |
56 |
+ #define cache_line_size() SMP_CACHE_BYTES |
57 |
+ #define ARCH_DMA_MINALIGN SMP_CACHE_BYTES |
58 |
+ |
59 |
++/* |
60 |
++ * Make sure slab-allocated buffers are 64-bit aligned when atomic64_t uses |
61 |
++ * ARCv2 64-bit atomics (LLOCKD/SCONDD). This guarantess runtime 64-bit |
62 |
++ * alignment for any atomic64_t embedded in buffer. |
63 |
++ * Default ARCH_SLAB_MINALIGN is __alignof__(long long) which has a relaxed |
64 |
++ * value of 4 (and not 8) in ARC ABI. |
65 |
++ */ |
66 |
++#if defined(CONFIG_ARC_HAS_LL64) && defined(CONFIG_ARC_HAS_LLSC) |
67 |
++#define ARCH_SLAB_MINALIGN 8 |
68 |
++#endif |
69 |
++ |
70 |
+ extern void arc_cache_init(void); |
71 |
+ extern char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len); |
72 |
+ extern void read_decode_cache_bcr(void); |
73 |
+diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S |
74 |
+index 8b90d25a15cca..1f945d0f40daa 100644 |
75 |
+--- a/arch/arc/kernel/head.S |
76 |
++++ b/arch/arc/kernel/head.S |
77 |
+@@ -17,6 +17,7 @@ |
78 |
+ #include <asm/entry.h> |
79 |
+ #include <asm/arcregs.h> |
80 |
+ #include <asm/cache.h> |
81 |
++#include <asm/irqflags.h> |
82 |
+ |
83 |
+ .macro CPU_EARLY_SETUP |
84 |
+ |
85 |
+@@ -47,6 +48,15 @@ |
86 |
+ sr r5, [ARC_REG_DC_CTRL] |
87 |
+ |
88 |
+ 1: |
89 |
++ |
90 |
++#ifdef CONFIG_ISA_ARCV2 |
91 |
++ ; Unaligned access is disabled at reset, so re-enable early as |
92 |
++ ; gcc 7.3.1 (ARC GNU 2018.03) onwards generates unaligned access |
93 |
++ ; by default |
94 |
++ lr r5, [status32] |
95 |
++ bset r5, r5, STATUS_AD_BIT |
96 |
++ kflag r5 |
97 |
++#endif |
98 |
+ .endm |
99 |
+ |
100 |
+ .section .init.text, "ax",@progbits |
101 |
+@@ -93,9 +103,9 @@ ENTRY(stext) |
102 |
+ #ifdef CONFIG_ARC_UBOOT_SUPPORT |
103 |
+ ; Uboot - kernel ABI |
104 |
+ ; r0 = [0] No uboot interaction, [1] cmdline in r2, [2] DTB in r2 |
105 |
+- ; r1 = magic number (board identity, unused as of now |
106 |
++ ; r1 = magic number (always zero as of now) |
107 |
+ ; r2 = pointer to uboot provided cmdline or external DTB in mem |
108 |
+- ; These are handled later in setup_arch() |
109 |
++ ; These are handled later in handle_uboot_args() |
110 |
+ st r0, [@uboot_tag] |
111 |
+ st r2, [@uboot_arg] |
112 |
+ #endif |
113 |
+diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c |
114 |
+index fb83844daeea3..709649e5f9bc1 100644 |
115 |
+--- a/arch/arc/kernel/setup.c |
116 |
++++ b/arch/arc/kernel/setup.c |
117 |
+@@ -414,43 +414,80 @@ void setup_processor(void) |
118 |
+ arc_chk_core_config(); |
119 |
+ } |
120 |
+ |
121 |
+-static inline int is_kernel(unsigned long addr) |
122 |
++static inline bool uboot_arg_invalid(unsigned long addr) |
123 |
+ { |
124 |
+- if (addr >= (unsigned long)_stext && addr <= (unsigned long)_end) |
125 |
+- return 1; |
126 |
+- return 0; |
127 |
++ /* |
128 |
++ * Check that it is a untranslated address (although MMU is not enabled |
129 |
++ * yet, it being a high address ensures this is not by fluke) |
130 |
++ */ |
131 |
++ if (addr < PAGE_OFFSET) |
132 |
++ return true; |
133 |
++ |
134 |
++ /* Check that address doesn't clobber resident kernel image */ |
135 |
++ return addr >= (unsigned long)_stext && addr <= (unsigned long)_end; |
136 |
+ } |
137 |
+ |
138 |
+-void __init setup_arch(char **cmdline_p) |
139 |
++#define IGNORE_ARGS "Ignore U-boot args: " |
140 |
++ |
141 |
++/* uboot_tag values for U-boot - kernel ABI revision 0; see head.S */ |
142 |
++#define UBOOT_TAG_NONE 0 |
143 |
++#define UBOOT_TAG_CMDLINE 1 |
144 |
++#define UBOOT_TAG_DTB 2 |
145 |
++ |
146 |
++void __init handle_uboot_args(void) |
147 |
+ { |
148 |
++ bool use_embedded_dtb = true; |
149 |
++ bool append_cmdline = false; |
150 |
++ |
151 |
+ #ifdef CONFIG_ARC_UBOOT_SUPPORT |
152 |
+- /* make sure that uboot passed pointer to cmdline/dtb is valid */ |
153 |
+- if (uboot_tag && is_kernel((unsigned long)uboot_arg)) |
154 |
+- panic("Invalid uboot arg\n"); |
155 |
++ /* check that we know this tag */ |
156 |
++ if (uboot_tag != UBOOT_TAG_NONE && |
157 |
++ uboot_tag != UBOOT_TAG_CMDLINE && |
158 |
++ uboot_tag != UBOOT_TAG_DTB) { |
159 |
++ pr_warn(IGNORE_ARGS "invalid uboot tag: '%08x'\n", uboot_tag); |
160 |
++ goto ignore_uboot_args; |
161 |
++ } |
162 |
++ |
163 |
++ if (uboot_tag != UBOOT_TAG_NONE && |
164 |
++ uboot_arg_invalid((unsigned long)uboot_arg)) { |
165 |
++ pr_warn(IGNORE_ARGS "invalid uboot arg: '%px'\n", uboot_arg); |
166 |
++ goto ignore_uboot_args; |
167 |
++ } |
168 |
++ |
169 |
++ /* see if U-boot passed an external Device Tree blob */ |
170 |
++ if (uboot_tag == UBOOT_TAG_DTB) { |
171 |
++ machine_desc = setup_machine_fdt((void *)uboot_arg); |
172 |
+ |
173 |
+- /* See if u-boot passed an external Device Tree blob */ |
174 |
+- machine_desc = setup_machine_fdt(uboot_arg); /* uboot_tag == 2 */ |
175 |
+- if (!machine_desc) |
176 |
++ /* external Device Tree blob is invalid - use embedded one */ |
177 |
++ use_embedded_dtb = !machine_desc; |
178 |
++ } |
179 |
++ |
180 |
++ if (uboot_tag == UBOOT_TAG_CMDLINE) |
181 |
++ append_cmdline = true; |
182 |
++ |
183 |
++ignore_uboot_args: |
184 |
+ #endif |
185 |
+- { |
186 |
+- /* No, so try the embedded one */ |
187 |
++ |
188 |
++ if (use_embedded_dtb) { |
189 |
+ machine_desc = setup_machine_fdt(__dtb_start); |
190 |
+ if (!machine_desc) |
191 |
+ panic("Embedded DT invalid\n"); |
192 |
++ } |
193 |
+ |
194 |
+- /* |
195 |
+- * If we are here, it is established that @uboot_arg didn't |
196 |
+- * point to DT blob. Instead if u-boot says it is cmdline, |
197 |
+- * append to embedded DT cmdline. |
198 |
+- * setup_machine_fdt() would have populated @boot_command_line |
199 |
+- */ |
200 |
+- if (uboot_tag == 1) { |
201 |
+- /* Ensure a whitespace between the 2 cmdlines */ |
202 |
+- strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); |
203 |
+- strlcat(boot_command_line, uboot_arg, |
204 |
+- COMMAND_LINE_SIZE); |
205 |
+- } |
206 |
++ /* |
207 |
++ * NOTE: @boot_command_line is populated by setup_machine_fdt() so this |
208 |
++ * append processing can only happen after. |
209 |
++ */ |
210 |
++ if (append_cmdline) { |
211 |
++ /* Ensure a whitespace between the 2 cmdlines */ |
212 |
++ strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); |
213 |
++ strlcat(boot_command_line, uboot_arg, COMMAND_LINE_SIZE); |
214 |
+ } |
215 |
++} |
216 |
++ |
217 |
++void __init setup_arch(char **cmdline_p) |
218 |
++{ |
219 |
++ handle_uboot_args(); |
220 |
+ |
221 |
+ /* Save unparsed command line copy for /proc/cmdline */ |
222 |
+ *cmdline_p = boot_command_line; |
223 |
+diff --git a/arch/arm/probes/kprobes/opt-arm.c b/arch/arm/probes/kprobes/opt-arm.c |
224 |
+index 2c118a6ab3587..0dc23fc227ed2 100644 |
225 |
+--- a/arch/arm/probes/kprobes/opt-arm.c |
226 |
++++ b/arch/arm/probes/kprobes/opt-arm.c |
227 |
+@@ -247,7 +247,7 @@ int arch_prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *or |
228 |
+ } |
229 |
+ |
230 |
+ /* Copy arch-dep-instance from template. */ |
231 |
+- memcpy(code, (unsigned char *)optprobe_template_entry, |
232 |
++ memcpy(code, (unsigned long *)&optprobe_template_entry, |
233 |
+ TMPL_END_IDX * sizeof(kprobe_opcode_t)); |
234 |
+ |
235 |
+ /* Adjust buffer according to instruction. */ |
236 |
+diff --git a/arch/mips/configs/ath79_defconfig b/arch/mips/configs/ath79_defconfig |
237 |
+index 25ed914933e5c..8a22978be1e6d 100644 |
238 |
+--- a/arch/mips/configs/ath79_defconfig |
239 |
++++ b/arch/mips/configs/ath79_defconfig |
240 |
+@@ -72,6 +72,7 @@ CONFIG_SERIAL_8250_CONSOLE=y |
241 |
+ # CONFIG_SERIAL_8250_PCI is not set |
242 |
+ CONFIG_SERIAL_8250_NR_UARTS=1 |
243 |
+ CONFIG_SERIAL_8250_RUNTIME_UARTS=1 |
244 |
++CONFIG_SERIAL_OF_PLATFORM=y |
245 |
+ CONFIG_SERIAL_AR933X=y |
246 |
+ CONFIG_SERIAL_AR933X_CONSOLE=y |
247 |
+ # CONFIG_HW_RANDOM is not set |
248 |
+diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c |
249 |
+index d626a9a391cc9..e3c3d9483e140 100644 |
250 |
+--- a/arch/mips/jazz/jazzdma.c |
251 |
++++ b/arch/mips/jazz/jazzdma.c |
252 |
+@@ -72,14 +72,15 @@ static int __init vdma_init(void) |
253 |
+ get_order(VDMA_PGTBL_SIZE)); |
254 |
+ BUG_ON(!pgtbl); |
255 |
+ dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE); |
256 |
+- pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl); |
257 |
++ pgtbl = (VDMA_PGTBL_ENTRY *)CKSEG1ADDR((unsigned long)pgtbl); |
258 |
+ |
259 |
+ /* |
260 |
+ * Clear the R4030 translation table |
261 |
+ */ |
262 |
+ vdma_pgtbl_init(); |
263 |
+ |
264 |
+- r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, CPHYSADDR(pgtbl)); |
265 |
++ r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, |
266 |
++ CPHYSADDR((unsigned long)pgtbl)); |
267 |
+ r4030_write_reg32(JAZZ_R4030_TRSTBL_LIM, VDMA_PGTBL_SIZE); |
268 |
+ r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0); |
269 |
+ |
270 |
+diff --git a/arch/mips/net/ebpf_jit.c b/arch/mips/net/ebpf_jit.c |
271 |
+index 962b0259b4b6e..dd537cba44494 100644 |
272 |
+--- a/arch/mips/net/ebpf_jit.c |
273 |
++++ b/arch/mips/net/ebpf_jit.c |
274 |
+@@ -348,12 +348,15 @@ static int build_int_epilogue(struct jit_ctx *ctx, int dest_reg) |
275 |
+ const struct bpf_prog *prog = ctx->skf; |
276 |
+ int stack_adjust = ctx->stack_size; |
277 |
+ int store_offset = stack_adjust - 8; |
278 |
++ enum reg_val_type td; |
279 |
+ int r0 = MIPS_R_V0; |
280 |
+ |
281 |
+- if (dest_reg == MIPS_R_RA && |
282 |
+- get_reg_val_type(ctx, prog->len, BPF_REG_0) == REG_32BIT_ZERO_EX) |
283 |
++ if (dest_reg == MIPS_R_RA) { |
284 |
+ /* Don't let zero extended value escape. */ |
285 |
+- emit_instr(ctx, sll, r0, r0, 0); |
286 |
++ td = get_reg_val_type(ctx, prog->len, BPF_REG_0); |
287 |
++ if (td == REG_64BIT || td == REG_32BIT_ZERO_EX) |
288 |
++ emit_instr(ctx, sll, r0, r0, 0); |
289 |
++ } |
290 |
+ |
291 |
+ if (ctx->flags & EBPF_SAVE_RA) { |
292 |
+ emit_instr(ctx, ld, MIPS_R_RA, store_offset, MIPS_R_SP); |
293 |
+diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c |
294 |
+index 1a2be6e639b5a..eca5b2a1c7e10 100644 |
295 |
+--- a/arch/parisc/kernel/ptrace.c |
296 |
++++ b/arch/parisc/kernel/ptrace.c |
297 |
+@@ -312,15 +312,29 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, |
298 |
+ |
299 |
+ long do_syscall_trace_enter(struct pt_regs *regs) |
300 |
+ { |
301 |
+- if (test_thread_flag(TIF_SYSCALL_TRACE) && |
302 |
+- tracehook_report_syscall_entry(regs)) { |
303 |
++ if (test_thread_flag(TIF_SYSCALL_TRACE)) { |
304 |
++ int rc = tracehook_report_syscall_entry(regs); |
305 |
++ |
306 |
+ /* |
307 |
+- * Tracing decided this syscall should not happen or the |
308 |
+- * debugger stored an invalid system call number. Skip |
309 |
+- * the system call and the system call restart handling. |
310 |
++ * As tracesys_next does not set %r28 to -ENOSYS |
311 |
++ * when %r20 is set to -1, initialize it here. |
312 |
+ */ |
313 |
+- regs->gr[20] = -1UL; |
314 |
+- goto out; |
315 |
++ regs->gr[28] = -ENOSYS; |
316 |
++ |
317 |
++ if (rc) { |
318 |
++ /* |
319 |
++ * A nonzero return code from |
320 |
++ * tracehook_report_syscall_entry() tells us |
321 |
++ * to prevent the syscall execution. Skip |
322 |
++ * the syscall call and the syscall restart handling. |
323 |
++ * |
324 |
++ * Note that the tracer may also just change |
325 |
++ * regs->gr[20] to an invalid syscall number, |
326 |
++ * that is handled by tracesys_next. |
327 |
++ */ |
328 |
++ regs->gr[20] = -1UL; |
329 |
++ return -1; |
330 |
++ } |
331 |
+ } |
332 |
+ |
333 |
+ /* Do the secure computing check after ptrace. */ |
334 |
+@@ -344,7 +358,6 @@ long do_syscall_trace_enter(struct pt_regs *regs) |
335 |
+ regs->gr[24] & 0xffffffff, |
336 |
+ regs->gr[23] & 0xffffffff); |
337 |
+ |
338 |
+-out: |
339 |
+ /* |
340 |
+ * Sign extend the syscall number to 64bit since it may have been |
341 |
+ * modified by a compat ptrace call |
342 |
+diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c |
343 |
+index fd173e6425ccf..481d7920ea244 100644 |
344 |
+--- a/arch/x86/xen/enlighten_pv.c |
345 |
++++ b/arch/x86/xen/enlighten_pv.c |
346 |
+@@ -900,10 +900,7 @@ static u64 xen_read_msr_safe(unsigned int msr, int *err) |
347 |
+ val = native_read_msr_safe(msr, err); |
348 |
+ switch (msr) { |
349 |
+ case MSR_IA32_APICBASE: |
350 |
+-#ifdef CONFIG_X86_X2APIC |
351 |
+- if (!(cpuid_ecx(1) & (1 << (X86_FEATURE_X2APIC & 31)))) |
352 |
+-#endif |
353 |
+- val &= ~X2APIC_ENABLE; |
354 |
++ val &= ~X2APIC_ENABLE; |
355 |
+ break; |
356 |
+ } |
357 |
+ return val; |
358 |
+diff --git a/drivers/atm/he.c b/drivers/atm/he.c |
359 |
+index e58538c293777..7ba243691004e 100644 |
360 |
+--- a/drivers/atm/he.c |
361 |
++++ b/drivers/atm/he.c |
362 |
+@@ -717,7 +717,7 @@ static int he_init_cs_block_rcm(struct he_dev *he_dev) |
363 |
+ instead of '/ 512', use '>> 9' to prevent a call |
364 |
+ to divdu3 on x86 platforms |
365 |
+ */ |
366 |
+- rate_cps = (unsigned long long) (1 << exp) * (man + 512) >> 9; |
367 |
++ rate_cps = (unsigned long long) (1UL << exp) * (man + 512) >> 9; |
368 |
+ |
369 |
+ if (rate_cps < 10) |
370 |
+ rate_cps = 10; /* 2.2.1 minimum payload rate is 10 cps */ |
371 |
+diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c |
372 |
+index da2d309574ba9..14eb8a0645622 100644 |
373 |
+--- a/drivers/gpu/drm/i915/intel_fbdev.c |
374 |
++++ b/drivers/gpu/drm/i915/intel_fbdev.c |
375 |
+@@ -326,8 +326,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, |
376 |
+ bool *enabled, int width, int height) |
377 |
+ { |
378 |
+ struct drm_i915_private *dev_priv = to_i915(fb_helper->dev); |
379 |
+- unsigned long conn_configured, conn_seq, mask; |
380 |
+ unsigned int count = min(fb_helper->connector_count, BITS_PER_LONG); |
381 |
++ unsigned long conn_configured, conn_seq; |
382 |
+ int i, j; |
383 |
+ bool *save_enabled; |
384 |
+ bool fallback = true, ret = true; |
385 |
+@@ -345,10 +345,9 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, |
386 |
+ drm_modeset_backoff(&ctx); |
387 |
+ |
388 |
+ memcpy(save_enabled, enabled, count); |
389 |
+- mask = GENMASK(count - 1, 0); |
390 |
++ conn_seq = GENMASK(count - 1, 0); |
391 |
+ conn_configured = 0; |
392 |
+ retry: |
393 |
+- conn_seq = conn_configured; |
394 |
+ for (i = 0; i < count; i++) { |
395 |
+ struct drm_fb_helper_connector *fb_conn; |
396 |
+ struct drm_connector *connector; |
397 |
+@@ -361,7 +360,8 @@ retry: |
398 |
+ if (conn_configured & BIT(i)) |
399 |
+ continue; |
400 |
+ |
401 |
+- if (conn_seq == 0 && !connector->has_tile) |
402 |
++ /* First pass, only consider tiled connectors */ |
403 |
++ if (conn_seq == GENMASK(count - 1, 0) && !connector->has_tile) |
404 |
+ continue; |
405 |
+ |
406 |
+ if (connector->status == connector_status_connected) |
407 |
+@@ -465,8 +465,10 @@ retry: |
408 |
+ conn_configured |= BIT(i); |
409 |
+ } |
410 |
+ |
411 |
+- if ((conn_configured & mask) != mask && conn_configured != conn_seq) |
412 |
++ if (conn_configured != conn_seq) { /* repeat until no more are found */ |
413 |
++ conn_seq = conn_configured; |
414 |
+ goto retry; |
415 |
++ } |
416 |
+ |
417 |
+ /* |
418 |
+ * If the BIOS didn't enable everything it could, fall back to have the |
419 |
+diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c |
420 |
+index 4ad8223c60eae..5deb44ac67915 100644 |
421 |
+--- a/drivers/gpu/drm/meson/meson_drv.c |
422 |
++++ b/drivers/gpu/drm/meson/meson_drv.c |
423 |
+@@ -345,8 +345,10 @@ static int meson_probe_remote(struct platform_device *pdev, |
424 |
+ remote_node = of_graph_get_remote_port_parent(ep); |
425 |
+ if (!remote_node || |
426 |
+ remote_node == parent || /* Ignore parent endpoint */ |
427 |
+- !of_device_is_available(remote_node)) |
428 |
++ !of_device_is_available(remote_node)) { |
429 |
++ of_node_put(remote_node); |
430 |
+ continue; |
431 |
++ } |
432 |
+ |
433 |
+ count += meson_probe_remote(pdev, match, remote, remote_node); |
434 |
+ |
435 |
+@@ -365,10 +367,13 @@ static int meson_drv_probe(struct platform_device *pdev) |
436 |
+ |
437 |
+ for_each_endpoint_of_node(np, ep) { |
438 |
+ remote = of_graph_get_remote_port_parent(ep); |
439 |
+- if (!remote || !of_device_is_available(remote)) |
440 |
++ if (!remote || !of_device_is_available(remote)) { |
441 |
++ of_node_put(remote); |
442 |
+ continue; |
443 |
++ } |
444 |
+ |
445 |
+ count += meson_probe_remote(pdev, &match, np, remote); |
446 |
++ of_node_put(remote); |
447 |
+ } |
448 |
+ |
449 |
+ if (count && !match) |
450 |
+diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c |
451 |
+index e36399213324d..ceb3db6f3fdda 100644 |
452 |
+--- a/drivers/hwmon/tmp421.c |
453 |
++++ b/drivers/hwmon/tmp421.c |
454 |
+@@ -88,7 +88,7 @@ static const struct of_device_id tmp421_of_match[] = { |
455 |
+ .data = (void *)2 |
456 |
+ }, |
457 |
+ { |
458 |
+- .compatible = "ti,tmp422", |
459 |
++ .compatible = "ti,tmp442", |
460 |
+ .data = (void *)3 |
461 |
+ }, |
462 |
+ { }, |
463 |
+diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c |
464 |
+index ade98c234dcb3..3f5b5893792cd 100644 |
465 |
+--- a/drivers/infiniband/ulp/srp/ib_srp.c |
466 |
++++ b/drivers/infiniband/ulp/srp/ib_srp.c |
467 |
+@@ -2669,7 +2669,6 @@ static int srp_reset_device(struct scsi_cmnd *scmnd) |
468 |
+ { |
469 |
+ struct srp_target_port *target = host_to_target(scmnd->device->host); |
470 |
+ struct srp_rdma_ch *ch; |
471 |
+- int i, j; |
472 |
+ u8 status; |
473 |
+ |
474 |
+ shost_printk(KERN_ERR, target->scsi_host, "SRP reset_device called\n"); |
475 |
+@@ -2681,15 +2680,6 @@ static int srp_reset_device(struct scsi_cmnd *scmnd) |
476 |
+ if (status) |
477 |
+ return FAILED; |
478 |
+ |
479 |
+- for (i = 0; i < target->ch_count; i++) { |
480 |
+- ch = &target->ch[i]; |
481 |
+- for (j = 0; j < target->req_ring_size; ++j) { |
482 |
+- struct srp_request *req = &ch->req_ring[j]; |
483 |
+- |
484 |
+- srp_finish_req(ch, req, scmnd->device, DID_RESET << 16); |
485 |
+- } |
486 |
+- } |
487 |
+- |
488 |
+ return SUCCESS; |
489 |
+ } |
490 |
+ |
491 |
+diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c |
492 |
+index b1833d08a5fea..40a099f33bfc4 100644 |
493 |
+--- a/drivers/isdn/hardware/avm/b1.c |
494 |
++++ b/drivers/isdn/hardware/avm/b1.c |
495 |
+@@ -423,7 +423,7 @@ void b1_parse_version(avmctrl_info *cinfo) |
496 |
+ int i, j; |
497 |
+ |
498 |
+ for (j = 0; j < AVM_MAXVERSION; j++) |
499 |
+- cinfo->version[j] = "\0\0" + 1; |
500 |
++ cinfo->version[j] = ""; |
501 |
+ for (i = 0, j = 0; |
502 |
+ j < AVM_MAXVERSION && i < cinfo->versionlen; |
503 |
+ j++, i += cinfo->versionbuf[i] + 1) |
504 |
+diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c |
505 |
+index d30130c8d0f3d..b107452e16df7 100644 |
506 |
+--- a/drivers/isdn/i4l/isdn_tty.c |
507 |
++++ b/drivers/isdn/i4l/isdn_tty.c |
508 |
+@@ -1456,15 +1456,19 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) |
509 |
+ { |
510 |
+ modem_info *info = (modem_info *) tty->driver_data; |
511 |
+ |
512 |
++ mutex_lock(&modem_info_mutex); |
513 |
+ if (!old_termios) |
514 |
+ isdn_tty_change_speed(info); |
515 |
+ else { |
516 |
+ if (tty->termios.c_cflag == old_termios->c_cflag && |
517 |
+ tty->termios.c_ispeed == old_termios->c_ispeed && |
518 |
+- tty->termios.c_ospeed == old_termios->c_ospeed) |
519 |
++ tty->termios.c_ospeed == old_termios->c_ospeed) { |
520 |
++ mutex_unlock(&modem_info_mutex); |
521 |
+ return; |
522 |
++ } |
523 |
+ isdn_tty_change_speed(info); |
524 |
+ } |
525 |
++ mutex_unlock(&modem_info_mutex); |
526 |
+ } |
527 |
+ |
528 |
+ /* |
529 |
+diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c |
530 |
+index 924e50aefb003..13838d72e2971 100644 |
531 |
+--- a/drivers/leds/leds-lp5523.c |
532 |
++++ b/drivers/leds/leds-lp5523.c |
533 |
+@@ -318,7 +318,9 @@ static int lp5523_init_program_engine(struct lp55xx_chip *chip) |
534 |
+ |
535 |
+ /* Let the programs run for couple of ms and check the engine status */ |
536 |
+ usleep_range(3000, 6000); |
537 |
+- lp55xx_read(chip, LP5523_REG_STATUS, &status); |
538 |
++ ret = lp55xx_read(chip, LP5523_REG_STATUS, &status); |
539 |
++ if (ret) |
540 |
++ return ret; |
541 |
+ status &= LP5523_ENG_STATUS_MASK; |
542 |
+ |
543 |
+ if (status != LP5523_ENG_STATUS_MASK) { |
544 |
+diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c |
545 |
+index 30d09d1771717..11ab17f64c649 100644 |
546 |
+--- a/drivers/mfd/ab8500-core.c |
547 |
++++ b/drivers/mfd/ab8500-core.c |
548 |
+@@ -261,7 +261,7 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank, |
549 |
+ mutex_unlock(&ab8500->lock); |
550 |
+ dev_vdbg(ab8500->dev, "rd: addr %#x => data %#x\n", addr, ret); |
551 |
+ |
552 |
+- return ret; |
553 |
++ return (ret < 0) ? ret : 0; |
554 |
+ } |
555 |
+ |
556 |
+ static int ab8500_get_register(struct device *dev, u8 bank, |
557 |
+diff --git a/drivers/mfd/bd9571mwv.c b/drivers/mfd/bd9571mwv.c |
558 |
+index 64e088dfe7b05..98192d4863e4c 100644 |
559 |
+--- a/drivers/mfd/bd9571mwv.c |
560 |
++++ b/drivers/mfd/bd9571mwv.c |
561 |
+@@ -57,6 +57,7 @@ static const struct regmap_access_table bd9571mwv_writable_table = { |
562 |
+ }; |
563 |
+ |
564 |
+ static const struct regmap_range bd9571mwv_volatile_yes_ranges[] = { |
565 |
++ regmap_reg_range(BD9571MWV_DVFS_MONIVDAC, BD9571MWV_DVFS_MONIVDAC), |
566 |
+ regmap_reg_range(BD9571MWV_GPIO_IN, BD9571MWV_GPIO_IN), |
567 |
+ regmap_reg_range(BD9571MWV_GPIO_INT, BD9571MWV_GPIO_INT), |
568 |
+ regmap_reg_range(BD9571MWV_INT_INTREQ, BD9571MWV_INT_INTREQ), |
569 |
+diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c |
570 |
+index 5970b8def5487..aec20e1c7d3d5 100644 |
571 |
+--- a/drivers/mfd/db8500-prcmu.c |
572 |
++++ b/drivers/mfd/db8500-prcmu.c |
573 |
+@@ -2584,7 +2584,7 @@ static struct irq_chip prcmu_irq_chip = { |
574 |
+ .irq_unmask = prcmu_irq_unmask, |
575 |
+ }; |
576 |
+ |
577 |
+-static __init char *fw_project_name(u32 project) |
578 |
++static char *fw_project_name(u32 project) |
579 |
+ { |
580 |
+ switch (project) { |
581 |
+ case PRCMU_FW_PROJECT_U8500: |
582 |
+@@ -2732,7 +2732,7 @@ void __init db8500_prcmu_early_init(u32 phy_base, u32 size) |
583 |
+ INIT_WORK(&mb0_transfer.mask_work, prcmu_mask_work); |
584 |
+ } |
585 |
+ |
586 |
+-static void __init init_prcm_registers(void) |
587 |
++static void init_prcm_registers(void) |
588 |
+ { |
589 |
+ u32 val; |
590 |
+ |
591 |
+diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c |
592 |
+index d7f54e492aa61..6c16f170529f5 100644 |
593 |
+--- a/drivers/mfd/mc13xxx-core.c |
594 |
++++ b/drivers/mfd/mc13xxx-core.c |
595 |
+@@ -274,7 +274,9 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode, |
596 |
+ |
597 |
+ mc13xxx->adcflags |= MC13XXX_ADC_WORKING; |
598 |
+ |
599 |
+- mc13xxx_reg_read(mc13xxx, MC13XXX_ADC0, &old_adc0); |
600 |
++ ret = mc13xxx_reg_read(mc13xxx, MC13XXX_ADC0, &old_adc0); |
601 |
++ if (ret) |
602 |
++ goto out; |
603 |
+ |
604 |
+ adc0 = MC13XXX_ADC0_ADINC1 | MC13XXX_ADC0_ADINC2; |
605 |
+ adc1 = MC13XXX_ADC1_ADEN | MC13XXX_ADC1_ADTRIGIGN | MC13XXX_ADC1_ASC; |
606 |
+diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c |
607 |
+index 04a601f6aebe5..0afadea996bbd 100644 |
608 |
+--- a/drivers/mfd/mt6397-core.c |
609 |
++++ b/drivers/mfd/mt6397-core.c |
610 |
+@@ -309,8 +309,7 @@ static int mt6397_probe(struct platform_device *pdev) |
611 |
+ |
612 |
+ default: |
613 |
+ dev_err(&pdev->dev, "unsupported chip: %d\n", id); |
614 |
+- ret = -ENODEV; |
615 |
+- break; |
616 |
++ return -ENODEV; |
617 |
+ } |
618 |
+ |
619 |
+ if (ret) { |
620 |
+diff --git a/drivers/mfd/qcom_rpm.c b/drivers/mfd/qcom_rpm.c |
621 |
+index 52fafea06067e..8d420c37b2a61 100644 |
622 |
+--- a/drivers/mfd/qcom_rpm.c |
623 |
++++ b/drivers/mfd/qcom_rpm.c |
624 |
+@@ -638,6 +638,10 @@ static int qcom_rpm_probe(struct platform_device *pdev) |
625 |
+ return -EFAULT; |
626 |
+ } |
627 |
+ |
628 |
++ writel(fw_version[0], RPM_CTRL_REG(rpm, 0)); |
629 |
++ writel(fw_version[1], RPM_CTRL_REG(rpm, 1)); |
630 |
++ writel(fw_version[2], RPM_CTRL_REG(rpm, 2)); |
631 |
++ |
632 |
+ dev_info(&pdev->dev, "RPM firmware %u.%u.%u\n", fw_version[0], |
633 |
+ fw_version[1], |
634 |
+ fw_version[2]); |
635 |
+diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c |
636 |
+index 7dc1cbcd2fb89..5894d6c16fab8 100644 |
637 |
+--- a/drivers/mfd/ti_am335x_tscadc.c |
638 |
++++ b/drivers/mfd/ti_am335x_tscadc.c |
639 |
+@@ -265,8 +265,9 @@ static int ti_tscadc_probe(struct platform_device *pdev) |
640 |
+ cell->pdata_size = sizeof(tscadc); |
641 |
+ } |
642 |
+ |
643 |
+- err = mfd_add_devices(&pdev->dev, pdev->id, tscadc->cells, |
644 |
+- tscadc->used_cells, NULL, 0, NULL); |
645 |
++ err = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, |
646 |
++ tscadc->cells, tscadc->used_cells, NULL, |
647 |
++ 0, NULL); |
648 |
+ if (err < 0) |
649 |
+ goto err_disable_clk; |
650 |
+ |
651 |
+diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c |
652 |
+index 13834a0d28172..612f5ecda78fa 100644 |
653 |
+--- a/drivers/mfd/tps65218.c |
654 |
++++ b/drivers/mfd/tps65218.c |
655 |
+@@ -243,9 +243,9 @@ static int tps65218_probe(struct i2c_client *client, |
656 |
+ |
657 |
+ mutex_init(&tps->tps_lock); |
658 |
+ |
659 |
+- ret = regmap_add_irq_chip(tps->regmap, tps->irq, |
660 |
+- IRQF_ONESHOT, 0, &tps65218_irq_chip, |
661 |
+- &tps->irq_data); |
662 |
++ ret = devm_regmap_add_irq_chip(&client->dev, tps->regmap, tps->irq, |
663 |
++ IRQF_ONESHOT, 0, &tps65218_irq_chip, |
664 |
++ &tps->irq_data); |
665 |
+ if (ret < 0) |
666 |
+ return ret; |
667 |
+ |
668 |
+@@ -261,26 +261,9 @@ static int tps65218_probe(struct i2c_client *client, |
669 |
+ ARRAY_SIZE(tps65218_cells), NULL, 0, |
670 |
+ regmap_irq_get_domain(tps->irq_data)); |
671 |
+ |
672 |
+- if (ret < 0) |
673 |
+- goto err_irq; |
674 |
+- |
675 |
+- return 0; |
676 |
+- |
677 |
+-err_irq: |
678 |
+- regmap_del_irq_chip(tps->irq, tps->irq_data); |
679 |
+- |
680 |
+ return ret; |
681 |
+ } |
682 |
+ |
683 |
+-static int tps65218_remove(struct i2c_client *client) |
684 |
+-{ |
685 |
+- struct tps65218 *tps = i2c_get_clientdata(client); |
686 |
+- |
687 |
+- regmap_del_irq_chip(tps->irq, tps->irq_data); |
688 |
+- |
689 |
+- return 0; |
690 |
+-} |
691 |
+- |
692 |
+ static const struct i2c_device_id tps65218_id_table[] = { |
693 |
+ { "tps65218", TPS65218 }, |
694 |
+ { }, |
695 |
+@@ -293,7 +276,6 @@ static struct i2c_driver tps65218_driver = { |
696 |
+ .of_match_table = of_tps65218_match_table, |
697 |
+ }, |
698 |
+ .probe = tps65218_probe, |
699 |
+- .remove = tps65218_remove, |
700 |
+ .id_table = tps65218_id_table, |
701 |
+ }; |
702 |
+ |
703 |
+diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c |
704 |
+index d3133a371e277..8f993272901d5 100644 |
705 |
+--- a/drivers/mfd/twl-core.c |
706 |
++++ b/drivers/mfd/twl-core.c |
707 |
+@@ -979,7 +979,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned irq_base, |
708 |
+ * letting it generate the right frequencies for USB, MADC, and |
709 |
+ * other purposes. |
710 |
+ */ |
711 |
+-static inline int __init protect_pm_master(void) |
712 |
++static inline int protect_pm_master(void) |
713 |
+ { |
714 |
+ int e = 0; |
715 |
+ |
716 |
+@@ -988,7 +988,7 @@ static inline int __init protect_pm_master(void) |
717 |
+ return e; |
718 |
+ } |
719 |
+ |
720 |
+-static inline int __init unprotect_pm_master(void) |
721 |
++static inline int unprotect_pm_master(void) |
722 |
+ { |
723 |
+ int e = 0; |
724 |
+ |
725 |
+diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c |
726 |
+index 1ee68bd440fbc..16c6e2accfaa5 100644 |
727 |
+--- a/drivers/mfd/wm5110-tables.c |
728 |
++++ b/drivers/mfd/wm5110-tables.c |
729 |
+@@ -1618,6 +1618,7 @@ static const struct reg_default wm5110_reg_default[] = { |
730 |
+ { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */ |
731 |
+ { 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */ |
732 |
+ { 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */ |
733 |
++ { 0x00000EE3, 0x4000 }, /* R3811 - ASRC_RATE2 */ |
734 |
+ { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */ |
735 |
+ { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */ |
736 |
+ { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */ |
737 |
+@@ -2869,6 +2870,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) |
738 |
+ case ARIZONA_ASRC_ENABLE: |
739 |
+ case ARIZONA_ASRC_STATUS: |
740 |
+ case ARIZONA_ASRC_RATE1: |
741 |
++ case ARIZONA_ASRC_RATE2: |
742 |
+ case ARIZONA_ISRC_1_CTRL_1: |
743 |
+ case ARIZONA_ISRC_1_CTRL_2: |
744 |
+ case ARIZONA_ISRC_1_CTRL_3: |
745 |
+diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c |
746 |
+index a185a8be79993..53904f257b19d 100644 |
747 |
+--- a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c |
748 |
++++ b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c |
749 |
+@@ -147,12 +147,10 @@ static void hns_ae_put_handle(struct hnae_handle *handle) |
750 |
+ struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle); |
751 |
+ int i; |
752 |
+ |
753 |
+- vf_cb->mac_cb = NULL; |
754 |
+- |
755 |
+- kfree(vf_cb); |
756 |
+- |
757 |
+ for (i = 0; i < handle->q_num; i++) |
758 |
+ hns_ae_get_ring_pair(handle->qs[i])->used_by_vf = 0; |
759 |
++ |
760 |
++ kfree(vf_cb); |
761 |
+ } |
762 |
+ |
763 |
+ static int hns_ae_wait_flow_down(struct hnae_handle *handle) |
764 |
+diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
765 |
+index ab2a9dbb46c7f..8fcf9dd42740f 100644 |
766 |
+--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
767 |
++++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
768 |
+@@ -623,13 +623,27 @@ static int get_fixed_ipv6_csum(__wsum hw_checksum, struct sk_buff *skb, |
769 |
+ return 0; |
770 |
+ } |
771 |
+ #endif |
772 |
++ |
773 |
++#define short_frame(size) ((size) <= ETH_ZLEN + ETH_FCS_LEN) |
774 |
++ |
775 |
+ static int check_csum(struct mlx4_cqe *cqe, struct sk_buff *skb, void *va, |
776 |
+ netdev_features_t dev_features) |
777 |
+ { |
778 |
+ __wsum hw_checksum = 0; |
779 |
++ void *hdr; |
780 |
++ |
781 |
++ /* CQE csum doesn't cover padding octets in short ethernet |
782 |
++ * frames. And the pad field is appended prior to calculating |
783 |
++ * and appending the FCS field. |
784 |
++ * |
785 |
++ * Detecting these padded frames requires to verify and parse |
786 |
++ * IP headers, so we simply force all those small frames to skip |
787 |
++ * checksum complete. |
788 |
++ */ |
789 |
++ if (short_frame(skb->len)) |
790 |
++ return -EINVAL; |
791 |
+ |
792 |
+- void *hdr = (u8 *)va + sizeof(struct ethhdr); |
793 |
+- |
794 |
++ hdr = (u8 *)va + sizeof(struct ethhdr); |
795 |
+ hw_checksum = csum_unfold((__force __sum16)cqe->checksum); |
796 |
+ |
797 |
+ if (cqe->vlan_my_qpn & cpu_to_be32(MLX4_CQE_CVLAN_PRESENT_MASK) && |
798 |
+@@ -817,6 +831,11 @@ xdp_drop_no_cnt: |
799 |
+ skb_record_rx_queue(skb, cq_ring); |
800 |
+ |
801 |
+ if (likely(dev->features & NETIF_F_RXCSUM)) { |
802 |
++ /* TODO: For IP non TCP/UDP packets when csum complete is |
803 |
++ * not an option (not supported or any other reason) we can |
804 |
++ * actually check cqe IPOK status bit and report |
805 |
++ * CHECKSUM_UNNECESSARY rather than CHECKSUM_NONE |
806 |
++ */ |
807 |
+ if (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_TCP | |
808 |
+ MLX4_CQE_STATUS_UDP)) { |
809 |
+ if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) && |
810 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c |
811 |
+index 281911698f72f..e69674d38f167 100644 |
812 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c |
813 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c |
814 |
+@@ -125,6 +125,7 @@ static void mlx5e_rep_update_sw_counters(struct mlx5e_priv *priv) |
815 |
+ |
816 |
+ s->tx_packets += sq_stats->packets; |
817 |
+ s->tx_bytes += sq_stats->bytes; |
818 |
++ s->tx_queue_dropped += sq_stats->dropped; |
819 |
+ } |
820 |
+ } |
821 |
+ } |
822 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
823 |
+index 9e0be077df9c1..47003ea4ed651 100644 |
824 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
825 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
826 |
+@@ -81,6 +81,7 @@ struct mlx5e_tc_flow_parse_attr { |
827 |
+ struct ip_tunnel_info tun_info; |
828 |
+ struct mlx5_flow_spec spec; |
829 |
+ int num_mod_hdr_actions; |
830 |
++ int max_mod_hdr_actions; |
831 |
+ void *mod_hdr_actions; |
832 |
+ int mirred_ifindex; |
833 |
+ }; |
834 |
+@@ -1128,9 +1129,9 @@ static struct mlx5_fields fields[] = { |
835 |
+ OFFLOAD(UDP_DPORT, 2, udp.dest, 0), |
836 |
+ }; |
837 |
+ |
838 |
+-/* On input attr->num_mod_hdr_actions tells how many HW actions can be parsed at |
839 |
+- * max from the SW pedit action. On success, it says how many HW actions were |
840 |
+- * actually parsed. |
841 |
++/* On input attr->max_mod_hdr_actions tells how many HW actions can be parsed at |
842 |
++ * max from the SW pedit action. On success, attr->num_mod_hdr_actions |
843 |
++ * says how many HW actions were actually parsed. |
844 |
+ */ |
845 |
+ static int offload_pedit_fields(struct pedit_headers *masks, |
846 |
+ struct pedit_headers *vals, |
847 |
+@@ -1153,9 +1154,11 @@ static int offload_pedit_fields(struct pedit_headers *masks, |
848 |
+ add_vals = &vals[TCA_PEDIT_KEY_EX_CMD_ADD]; |
849 |
+ |
850 |
+ action_size = MLX5_UN_SZ_BYTES(set_action_in_add_action_in_auto); |
851 |
+- action = parse_attr->mod_hdr_actions; |
852 |
+- max_actions = parse_attr->num_mod_hdr_actions; |
853 |
+- nactions = 0; |
854 |
++ action = parse_attr->mod_hdr_actions + |
855 |
++ parse_attr->num_mod_hdr_actions * action_size; |
856 |
++ |
857 |
++ max_actions = parse_attr->max_mod_hdr_actions; |
858 |
++ nactions = parse_attr->num_mod_hdr_actions; |
859 |
+ |
860 |
+ for (i = 0; i < ARRAY_SIZE(fields); i++) { |
861 |
+ f = &fields[i]; |
862 |
+@@ -1260,7 +1263,7 @@ static int alloc_mod_hdr_actions(struct mlx5e_priv *priv, |
863 |
+ if (!parse_attr->mod_hdr_actions) |
864 |
+ return -ENOMEM; |
865 |
+ |
866 |
+- parse_attr->num_mod_hdr_actions = max_actions; |
867 |
++ parse_attr->max_mod_hdr_actions = max_actions; |
868 |
+ return 0; |
869 |
+ } |
870 |
+ |
871 |
+@@ -1304,9 +1307,11 @@ static int parse_tc_pedit_action(struct mlx5e_priv *priv, |
872 |
+ goto out_err; |
873 |
+ } |
874 |
+ |
875 |
+- err = alloc_mod_hdr_actions(priv, a, namespace, parse_attr); |
876 |
+- if (err) |
877 |
+- goto out_err; |
878 |
++ if (!parse_attr->mod_hdr_actions) { |
879 |
++ err = alloc_mod_hdr_actions(priv, a, namespace, parse_attr); |
880 |
++ if (err) |
881 |
++ goto out_err; |
882 |
++ } |
883 |
+ |
884 |
+ err = offload_pedit_fields(masks, vals, parse_attr); |
885 |
+ if (err < 0) |
886 |
+diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c |
887 |
+index f33fb95c41895..3ba9f2c079b2a 100644 |
888 |
+--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c |
889 |
++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c |
890 |
+@@ -1086,7 +1086,7 @@ mlxsw_sp_bridge_port_fdb_flush(struct mlxsw_sp *mlxsw_sp, |
891 |
+ static enum mlxsw_reg_sfd_rec_policy mlxsw_sp_sfd_rec_policy(bool dynamic) |
892 |
+ { |
893 |
+ return dynamic ? MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_INGRESS : |
894 |
+- MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY; |
895 |
++ MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_MLAG; |
896 |
+ } |
897 |
+ |
898 |
+ static enum mlxsw_reg_sfd_op mlxsw_sp_sfd_op(bool adding) |
899 |
+@@ -1098,7 +1098,7 @@ static enum mlxsw_reg_sfd_op mlxsw_sp_sfd_op(bool adding) |
900 |
+ static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port, |
901 |
+ const char *mac, u16 fid, bool adding, |
902 |
+ enum mlxsw_reg_sfd_rec_action action, |
903 |
+- bool dynamic) |
904 |
++ enum mlxsw_reg_sfd_rec_policy policy) |
905 |
+ { |
906 |
+ char *sfd_pl; |
907 |
+ u8 num_rec; |
908 |
+@@ -1109,8 +1109,7 @@ static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port, |
909 |
+ return -ENOMEM; |
910 |
+ |
911 |
+ mlxsw_reg_sfd_pack(sfd_pl, mlxsw_sp_sfd_op(adding), 0); |
912 |
+- mlxsw_reg_sfd_uc_pack(sfd_pl, 0, mlxsw_sp_sfd_rec_policy(dynamic), |
913 |
+- mac, fid, action, local_port); |
914 |
++ mlxsw_reg_sfd_uc_pack(sfd_pl, 0, policy, mac, fid, action, local_port); |
915 |
+ num_rec = mlxsw_reg_sfd_num_rec_get(sfd_pl); |
916 |
+ err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl); |
917 |
+ if (err) |
918 |
+@@ -1129,7 +1128,8 @@ static int mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port, |
919 |
+ bool dynamic) |
920 |
+ { |
921 |
+ return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, local_port, mac, fid, adding, |
922 |
+- MLXSW_REG_SFD_REC_ACTION_NOP, dynamic); |
923 |
++ MLXSW_REG_SFD_REC_ACTION_NOP, |
924 |
++ mlxsw_sp_sfd_rec_policy(dynamic)); |
925 |
+ } |
926 |
+ |
927 |
+ int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid, |
928 |
+@@ -1137,7 +1137,7 @@ int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid, |
929 |
+ { |
930 |
+ return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, 0, mac, fid, adding, |
931 |
+ MLXSW_REG_SFD_REC_ACTION_FORWARD_IP_ROUTER, |
932 |
+- false); |
933 |
++ MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY); |
934 |
+ } |
935 |
+ |
936 |
+ static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id, |
937 |
+diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c |
938 |
+index b73bcbeb5f279..cef619f0ce10b 100644 |
939 |
+--- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c |
940 |
++++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c |
941 |
+@@ -1487,6 +1487,10 @@ static void qed_ll2_post_rx_buffer_notify_fw(struct qed_hwfn *p_hwfn, |
942 |
+ cq_prod = qed_chain_get_prod_idx(&p_rx->rcq_chain); |
943 |
+ rx_prod.bd_prod = cpu_to_le16(bd_prod); |
944 |
+ rx_prod.cqe_prod = cpu_to_le16(cq_prod); |
945 |
++ |
946 |
++ /* Make sure chain element is updated before ringing the doorbell */ |
947 |
++ dma_wmb(); |
948 |
++ |
949 |
+ DIRECT_REG_WR(p_rx->set_prod_addr, *((u32 *)&rx_prod)); |
950 |
+ } |
951 |
+ |
952 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c |
953 |
+index c54a50dbd5ac2..d819e8eaba122 100644 |
954 |
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c |
955 |
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c |
956 |
+@@ -299,7 +299,17 @@ static int stmmac_pci_probe(struct pci_dev *pdev, |
957 |
+ */ |
958 |
+ static void stmmac_pci_remove(struct pci_dev *pdev) |
959 |
+ { |
960 |
++ int i; |
961 |
++ |
962 |
+ stmmac_dvr_remove(&pdev->dev); |
963 |
++ |
964 |
++ for (i = 0; i <= PCI_STD_RESOURCE_END; i++) { |
965 |
++ if (pci_resource_len(pdev, i) == 0) |
966 |
++ continue; |
967 |
++ pcim_iounmap_regions(pdev, BIT(i)); |
968 |
++ break; |
969 |
++ } |
970 |
++ |
971 |
+ pci_disable_device(pdev); |
972 |
+ } |
973 |
+ |
974 |
+diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c |
975 |
+index 70ce7da26d1ff..afe335583832b 100644 |
976 |
+--- a/drivers/net/phy/phylink.c |
977 |
++++ b/drivers/net/phy/phylink.c |
978 |
+@@ -487,6 +487,17 @@ static void phylink_run_resolve(struct phylink *pl) |
979 |
+ queue_work(system_power_efficient_wq, &pl->resolve); |
980 |
+ } |
981 |
+ |
982 |
++static void phylink_run_resolve_and_disable(struct phylink *pl, int bit) |
983 |
++{ |
984 |
++ unsigned long state = pl->phylink_disable_state; |
985 |
++ |
986 |
++ set_bit(bit, &pl->phylink_disable_state); |
987 |
++ if (state == 0) { |
988 |
++ queue_work(system_power_efficient_wq, &pl->resolve); |
989 |
++ flush_work(&pl->resolve); |
990 |
++ } |
991 |
++} |
992 |
++ |
993 |
+ static const struct sfp_upstream_ops sfp_phylink_ops; |
994 |
+ |
995 |
+ static int phylink_register_sfp(struct phylink *pl, struct device_node *np) |
996 |
+@@ -776,9 +787,7 @@ void phylink_stop(struct phylink *pl) |
997 |
+ if (pl->sfp_bus) |
998 |
+ sfp_upstream_stop(pl->sfp_bus); |
999 |
+ |
1000 |
+- set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); |
1001 |
+- queue_work(system_power_efficient_wq, &pl->resolve); |
1002 |
+- flush_work(&pl->resolve); |
1003 |
++ phylink_run_resolve_and_disable(pl, PHYLINK_DISABLE_STOPPED); |
1004 |
+ } |
1005 |
+ EXPORT_SYMBOL_GPL(phylink_stop); |
1006 |
+ |
1007 |
+@@ -1433,9 +1442,7 @@ static void phylink_sfp_link_down(void *upstream) |
1008 |
+ |
1009 |
+ WARN_ON(!lockdep_rtnl_is_held()); |
1010 |
+ |
1011 |
+- set_bit(PHYLINK_DISABLE_LINK, &pl->phylink_disable_state); |
1012 |
+- queue_work(system_power_efficient_wq, &pl->resolve); |
1013 |
+- flush_work(&pl->resolve); |
1014 |
++ phylink_run_resolve_and_disable(pl, PHYLINK_DISABLE_LINK); |
1015 |
+ } |
1016 |
+ |
1017 |
+ static void phylink_sfp_link_up(void *upstream) |
1018 |
+diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c |
1019 |
+index 7ae815bee52d5..be6016e21d877 100644 |
1020 |
+--- a/drivers/net/phy/sfp-bus.c |
1021 |
++++ b/drivers/net/phy/sfp-bus.c |
1022 |
+@@ -276,6 +276,7 @@ static int sfp_register_bus(struct sfp_bus *bus) |
1023 |
+ return ret; |
1024 |
+ } |
1025 |
+ } |
1026 |
++ bus->socket_ops->attach(bus->sfp); |
1027 |
+ if (bus->started) |
1028 |
+ bus->socket_ops->start(bus->sfp); |
1029 |
+ bus->registered = true; |
1030 |
+@@ -289,6 +290,7 @@ static void sfp_unregister_bus(struct sfp_bus *bus) |
1031 |
+ if (bus->registered) { |
1032 |
+ if (bus->started) |
1033 |
+ bus->socket_ops->stop(bus->sfp); |
1034 |
++ bus->socket_ops->detach(bus->sfp); |
1035 |
+ if (bus->phydev && ops && ops->disconnect_phy) |
1036 |
+ ops->disconnect_phy(bus->upstream); |
1037 |
+ } |
1038 |
+diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c |
1039 |
+index 3165bc7b8e1e4..a1b68b19d9124 100644 |
1040 |
+--- a/drivers/net/phy/sfp.c |
1041 |
++++ b/drivers/net/phy/sfp.c |
1042 |
+@@ -114,6 +114,7 @@ struct sfp { |
1043 |
+ |
1044 |
+ struct gpio_desc *gpio[GPIO_MAX]; |
1045 |
+ |
1046 |
++ bool attached; |
1047 |
+ unsigned int state; |
1048 |
+ struct delayed_work poll; |
1049 |
+ struct delayed_work timeout; |
1050 |
+@@ -500,7 +501,7 @@ static void sfp_sm_event(struct sfp *sfp, unsigned int event) |
1051 |
+ */ |
1052 |
+ switch (sfp->sm_mod_state) { |
1053 |
+ default: |
1054 |
+- if (event == SFP_E_INSERT) { |
1055 |
++ if (event == SFP_E_INSERT && sfp->attached) { |
1056 |
+ sfp_module_tx_disable(sfp); |
1057 |
+ sfp_sm_ins_next(sfp, SFP_MOD_PROBE, T_PROBE_INIT); |
1058 |
+ } |
1059 |
+@@ -628,6 +629,19 @@ static void sfp_sm_event(struct sfp *sfp, unsigned int event) |
1060 |
+ mutex_unlock(&sfp->sm_mutex); |
1061 |
+ } |
1062 |
+ |
1063 |
++static void sfp_attach(struct sfp *sfp) |
1064 |
++{ |
1065 |
++ sfp->attached = true; |
1066 |
++ if (sfp->state & SFP_F_PRESENT) |
1067 |
++ sfp_sm_event(sfp, SFP_E_INSERT); |
1068 |
++} |
1069 |
++ |
1070 |
++static void sfp_detach(struct sfp *sfp) |
1071 |
++{ |
1072 |
++ sfp->attached = false; |
1073 |
++ sfp_sm_event(sfp, SFP_E_REMOVE); |
1074 |
++} |
1075 |
++ |
1076 |
+ static void sfp_start(struct sfp *sfp) |
1077 |
+ { |
1078 |
+ sfp_sm_event(sfp, SFP_E_DEV_UP); |
1079 |
+@@ -687,6 +701,8 @@ static int sfp_module_eeprom(struct sfp *sfp, struct ethtool_eeprom *ee, |
1080 |
+ } |
1081 |
+ |
1082 |
+ static const struct sfp_socket_ops sfp_module_ops = { |
1083 |
++ .attach = sfp_attach, |
1084 |
++ .detach = sfp_detach, |
1085 |
+ .start = sfp_start, |
1086 |
+ .stop = sfp_stop, |
1087 |
+ .module_info = sfp_module_info, |
1088 |
+@@ -829,10 +845,6 @@ static int sfp_probe(struct platform_device *pdev) |
1089 |
+ sfp->set_state = sfp_gpio_set_state; |
1090 |
+ } |
1091 |
+ |
1092 |
+- sfp->sfp_bus = sfp_register_socket(sfp->dev, sfp, &sfp_module_ops); |
1093 |
+- if (!sfp->sfp_bus) |
1094 |
+- return -ENOMEM; |
1095 |
+- |
1096 |
+ /* Get the initial state, and always signal TX disable, |
1097 |
+ * since the network interface will not be up. |
1098 |
+ */ |
1099 |
+@@ -843,10 +855,6 @@ static int sfp_probe(struct platform_device *pdev) |
1100 |
+ sfp->state |= SFP_F_RATE_SELECT; |
1101 |
+ sfp_set_state(sfp, sfp->state); |
1102 |
+ sfp_module_tx_disable(sfp); |
1103 |
+- rtnl_lock(); |
1104 |
+- if (sfp->state & SFP_F_PRESENT) |
1105 |
+- sfp_sm_event(sfp, SFP_E_INSERT); |
1106 |
+- rtnl_unlock(); |
1107 |
+ |
1108 |
+ for (i = 0; i < GPIO_MAX; i++) { |
1109 |
+ if (gpio_flags[i] != GPIOD_IN || !sfp->gpio[i]) |
1110 |
+@@ -879,6 +887,10 @@ static int sfp_remove(struct platform_device *pdev) |
1111 |
+ |
1112 |
+ sfp_unregister_socket(sfp->sfp_bus); |
1113 |
+ |
1114 |
++ sfp->sfp_bus = sfp_register_socket(sfp->dev, sfp, &sfp_module_ops); |
1115 |
++ if (!sfp->sfp_bus) |
1116 |
++ return -ENOMEM; |
1117 |
++ |
1118 |
+ return 0; |
1119 |
+ } |
1120 |
+ |
1121 |
+diff --git a/drivers/net/phy/sfp.h b/drivers/net/phy/sfp.h |
1122 |
+index 31b0acf337e27..64f54b0bbd8c4 100644 |
1123 |
+--- a/drivers/net/phy/sfp.h |
1124 |
++++ b/drivers/net/phy/sfp.h |
1125 |
+@@ -7,6 +7,8 @@ |
1126 |
+ struct sfp; |
1127 |
+ |
1128 |
+ struct sfp_socket_ops { |
1129 |
++ void (*attach)(struct sfp *sfp); |
1130 |
++ void (*detach)(struct sfp *sfp); |
1131 |
+ void (*start)(struct sfp *sfp); |
1132 |
+ void (*stop)(struct sfp *sfp); |
1133 |
+ int (*module_info)(struct sfp *sfp, struct ethtool_modinfo *modinfo); |
1134 |
+diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c |
1135 |
+index bd455a6cc82cf..bb96153f496e0 100644 |
1136 |
+--- a/drivers/net/team/team.c |
1137 |
++++ b/drivers/net/team/team.c |
1138 |
+@@ -261,17 +261,6 @@ static void __team_option_inst_mark_removed_port(struct team *team, |
1139 |
+ } |
1140 |
+ } |
1141 |
+ |
1142 |
+-static bool __team_option_inst_tmp_find(const struct list_head *opts, |
1143 |
+- const struct team_option_inst *needle) |
1144 |
+-{ |
1145 |
+- struct team_option_inst *opt_inst; |
1146 |
+- |
1147 |
+- list_for_each_entry(opt_inst, opts, tmp_list) |
1148 |
+- if (opt_inst == needle) |
1149 |
+- return true; |
1150 |
+- return false; |
1151 |
+-} |
1152 |
+- |
1153 |
+ static int __team_options_register(struct team *team, |
1154 |
+ const struct team_option *option, |
1155 |
+ size_t option_count) |
1156 |
+@@ -2457,7 +2446,6 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) |
1157 |
+ int err = 0; |
1158 |
+ int i; |
1159 |
+ struct nlattr *nl_option; |
1160 |
+- LIST_HEAD(opt_inst_list); |
1161 |
+ |
1162 |
+ rtnl_lock(); |
1163 |
+ |
1164 |
+@@ -2477,6 +2465,7 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) |
1165 |
+ struct nlattr *opt_attrs[TEAM_ATTR_OPTION_MAX + 1]; |
1166 |
+ struct nlattr *attr; |
1167 |
+ struct nlattr *attr_data; |
1168 |
++ LIST_HEAD(opt_inst_list); |
1169 |
+ enum team_option_type opt_type; |
1170 |
+ int opt_port_ifindex = 0; /* != 0 for per-port options */ |
1171 |
+ u32 opt_array_index = 0; |
1172 |
+@@ -2581,23 +2570,17 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) |
1173 |
+ if (err) |
1174 |
+ goto team_put; |
1175 |
+ opt_inst->changed = true; |
1176 |
+- |
1177 |
+- /* dumb/evil user-space can send us duplicate opt, |
1178 |
+- * keep only the last one |
1179 |
+- */ |
1180 |
+- if (__team_option_inst_tmp_find(&opt_inst_list, |
1181 |
+- opt_inst)) |
1182 |
+- continue; |
1183 |
+- |
1184 |
+ list_add(&opt_inst->tmp_list, &opt_inst_list); |
1185 |
+ } |
1186 |
+ if (!opt_found) { |
1187 |
+ err = -ENOENT; |
1188 |
+ goto team_put; |
1189 |
+ } |
1190 |
+- } |
1191 |
+ |
1192 |
+- err = team_nl_send_event_options_get(team, &opt_inst_list); |
1193 |
++ err = team_nl_send_event_options_get(team, &opt_inst_list); |
1194 |
++ if (err) |
1195 |
++ break; |
1196 |
++ } |
1197 |
+ |
1198 |
+ team_put: |
1199 |
+ team_nl_team_put(team); |
1200 |
+diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c |
1201 |
+index 63e916d4d0696..11aa5902a9ac1 100644 |
1202 |
+--- a/drivers/phy/tegra/xusb.c |
1203 |
++++ b/drivers/phy/tegra/xusb.c |
1204 |
+@@ -418,7 +418,7 @@ tegra_xusb_port_find_lane(struct tegra_xusb_port *port, |
1205 |
+ { |
1206 |
+ struct tegra_xusb_lane *lane, *match = ERR_PTR(-ENODEV); |
1207 |
+ |
1208 |
+- for (map = map; map->type; map++) { |
1209 |
++ for (; map->type; map++) { |
1210 |
+ if (port->index != map->port) |
1211 |
+ continue; |
1212 |
+ |
1213 |
+diff --git a/drivers/pinctrl/pinctrl-max77620.c b/drivers/pinctrl/pinctrl-max77620.c |
1214 |
+index b8d2180a2bea4..baef91aaf9b87 100644 |
1215 |
+--- a/drivers/pinctrl/pinctrl-max77620.c |
1216 |
++++ b/drivers/pinctrl/pinctrl-max77620.c |
1217 |
+@@ -34,14 +34,12 @@ enum max77620_pin_ppdrv { |
1218 |
+ MAX77620_PIN_PP_DRV, |
1219 |
+ }; |
1220 |
+ |
1221 |
+-enum max77620_pinconf_param { |
1222 |
+- MAX77620_ACTIVE_FPS_SOURCE = PIN_CONFIG_END + 1, |
1223 |
+- MAX77620_ACTIVE_FPS_POWER_ON_SLOTS, |
1224 |
+- MAX77620_ACTIVE_FPS_POWER_DOWN_SLOTS, |
1225 |
+- MAX77620_SUSPEND_FPS_SOURCE, |
1226 |
+- MAX77620_SUSPEND_FPS_POWER_ON_SLOTS, |
1227 |
+- MAX77620_SUSPEND_FPS_POWER_DOWN_SLOTS, |
1228 |
+-}; |
1229 |
++#define MAX77620_ACTIVE_FPS_SOURCE (PIN_CONFIG_END + 1) |
1230 |
++#define MAX77620_ACTIVE_FPS_POWER_ON_SLOTS (PIN_CONFIG_END + 2) |
1231 |
++#define MAX77620_ACTIVE_FPS_POWER_DOWN_SLOTS (PIN_CONFIG_END + 3) |
1232 |
++#define MAX77620_SUSPEND_FPS_SOURCE (PIN_CONFIG_END + 4) |
1233 |
++#define MAX77620_SUSPEND_FPS_POWER_ON_SLOTS (PIN_CONFIG_END + 5) |
1234 |
++#define MAX77620_SUSPEND_FPS_POWER_DOWN_SLOTS (PIN_CONFIG_END + 6) |
1235 |
+ |
1236 |
+ struct max77620_pin_function { |
1237 |
+ const char *name; |
1238 |
+diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c |
1239 |
+index 922e3e56c90d9..c71e0f3b146ab 100644 |
1240 |
+--- a/drivers/scsi/isci/init.c |
1241 |
++++ b/drivers/scsi/isci/init.c |
1242 |
+@@ -591,6 +591,13 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id) |
1243 |
+ shost->max_lun = ~0; |
1244 |
+ shost->max_cmd_len = MAX_COMMAND_SIZE; |
1245 |
+ |
1246 |
++ /* turn on DIF support */ |
1247 |
++ scsi_host_set_prot(shost, |
1248 |
++ SHOST_DIF_TYPE1_PROTECTION | |
1249 |
++ SHOST_DIF_TYPE2_PROTECTION | |
1250 |
++ SHOST_DIF_TYPE3_PROTECTION); |
1251 |
++ scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC); |
1252 |
++ |
1253 |
+ err = scsi_add_host(shost, &pdev->dev); |
1254 |
+ if (err) |
1255 |
+ goto err_shost; |
1256 |
+@@ -678,13 +685,6 @@ static int isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
1257 |
+ goto err_host_alloc; |
1258 |
+ } |
1259 |
+ pci_info->hosts[i] = h; |
1260 |
+- |
1261 |
+- /* turn on DIF support */ |
1262 |
+- scsi_host_set_prot(to_shost(h), |
1263 |
+- SHOST_DIF_TYPE1_PROTECTION | |
1264 |
+- SHOST_DIF_TYPE2_PROTECTION | |
1265 |
+- SHOST_DIF_TYPE3_PROTECTION); |
1266 |
+- scsi_host_set_guard(to_shost(h), SHOST_DIX_GUARD_CRC); |
1267 |
+ } |
1268 |
+ |
1269 |
+ err = isci_setup_interrupts(pdev); |
1270 |
+diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c |
1271 |
+index a02b34ea5cab1..45f044f35cea8 100644 |
1272 |
+--- a/drivers/scsi/qedi/qedi_iscsi.c |
1273 |
++++ b/drivers/scsi/qedi/qedi_iscsi.c |
1274 |
+@@ -961,6 +961,7 @@ static int qedi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms) |
1275 |
+ |
1276 |
+ qedi_ep = ep->dd_data; |
1277 |
+ if (qedi_ep->state == EP_STATE_IDLE || |
1278 |
++ qedi_ep->state == EP_STATE_OFLDCONN_NONE || |
1279 |
+ qedi_ep->state == EP_STATE_OFLDCONN_FAILED) |
1280 |
+ return -1; |
1281 |
+ |
1282 |
+@@ -1043,6 +1044,7 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep) |
1283 |
+ |
1284 |
+ switch (qedi_ep->state) { |
1285 |
+ case EP_STATE_OFLDCONN_START: |
1286 |
++ case EP_STATE_OFLDCONN_NONE: |
1287 |
+ goto ep_release_conn; |
1288 |
+ case EP_STATE_OFLDCONN_FAILED: |
1289 |
+ break; |
1290 |
+@@ -1233,6 +1235,7 @@ static int qedi_set_path(struct Scsi_Host *shost, struct iscsi_path *path_data) |
1291 |
+ |
1292 |
+ if (!is_valid_ether_addr(&path_data->mac_addr[0])) { |
1293 |
+ QEDI_NOTICE(&qedi->dbg_ctx, "dst mac NOT VALID\n"); |
1294 |
++ qedi_ep->state = EP_STATE_OFLDCONN_NONE; |
1295 |
+ ret = -EIO; |
1296 |
+ goto set_path_exit; |
1297 |
+ } |
1298 |
+diff --git a/drivers/scsi/qedi/qedi_iscsi.h b/drivers/scsi/qedi/qedi_iscsi.h |
1299 |
+index 3247287cb0e7e..812b4b68e6e48 100644 |
1300 |
+--- a/drivers/scsi/qedi/qedi_iscsi.h |
1301 |
++++ b/drivers/scsi/qedi/qedi_iscsi.h |
1302 |
+@@ -59,6 +59,7 @@ enum { |
1303 |
+ EP_STATE_OFLDCONN_FAILED = 0x2000, |
1304 |
+ EP_STATE_CONNECT_FAILED = 0x4000, |
1305 |
+ EP_STATE_DISCONN_TIMEDOUT = 0x8000, |
1306 |
++ EP_STATE_OFLDCONN_NONE = 0x10000, |
1307 |
+ }; |
1308 |
+ |
1309 |
+ struct qedi_conn; |
1310 |
+diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c |
1311 |
+index a6aa08d9a171c..22dc70a2138e2 100644 |
1312 |
+--- a/drivers/scsi/qla4xxx/ql4_os.c |
1313 |
++++ b/drivers/scsi/qla4xxx/ql4_os.c |
1314 |
+@@ -7241,6 +7241,8 @@ static int qla4xxx_sysfs_ddb_tgt_create(struct scsi_qla_host *ha, |
1315 |
+ |
1316 |
+ rc = qla4xxx_copy_from_fwddb_param(fnode_sess, fnode_conn, |
1317 |
+ fw_ddb_entry); |
1318 |
++ if (rc) |
1319 |
++ goto free_sess; |
1320 |
+ |
1321 |
+ ql4_printk(KERN_INFO, ha, "%s: sysfs entry %s created\n", |
1322 |
+ __func__, fnode_sess->dev.kobj.name); |
1323 |
+diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c |
1324 |
+index 21c81c1feac59..66540491839ea 100644 |
1325 |
+--- a/drivers/scsi/ufs/ufshcd.c |
1326 |
++++ b/drivers/scsi/ufs/ufshcd.c |
1327 |
+@@ -7520,6 +7520,8 @@ out: |
1328 |
+ trace_ufshcd_system_resume(dev_name(hba->dev), ret, |
1329 |
+ ktime_to_us(ktime_sub(ktime_get(), start)), |
1330 |
+ hba->curr_dev_pwr_mode, hba->uic_link_state); |
1331 |
++ if (!ret) |
1332 |
++ hba->is_sys_suspended = false; |
1333 |
+ return ret; |
1334 |
+ } |
1335 |
+ EXPORT_SYMBOL(ufshcd_system_resume); |
1336 |
+diff --git a/drivers/xen/pvcalls-back.c b/drivers/xen/pvcalls-back.c |
1337 |
+index 169293c25a915..abd6dbc29ac28 100644 |
1338 |
+--- a/drivers/xen/pvcalls-back.c |
1339 |
++++ b/drivers/xen/pvcalls-back.c |
1340 |
+@@ -164,9 +164,10 @@ static void pvcalls_conn_back_read(void *opaque) |
1341 |
+ |
1342 |
+ /* write the data, then modify the indexes */ |
1343 |
+ virt_wmb(); |
1344 |
+- if (ret < 0) |
1345 |
++ if (ret < 0) { |
1346 |
++ atomic_set(&map->read, 0); |
1347 |
+ intf->in_error = ret; |
1348 |
+- else |
1349 |
++ } else |
1350 |
+ intf->in_prod = prod + ret; |
1351 |
+ /* update the indexes, then notify the other end */ |
1352 |
+ virt_wmb(); |
1353 |
+@@ -290,13 +291,11 @@ static int pvcalls_back_socket(struct xenbus_device *dev, |
1354 |
+ static void pvcalls_sk_state_change(struct sock *sock) |
1355 |
+ { |
1356 |
+ struct sock_mapping *map = sock->sk_user_data; |
1357 |
+- struct pvcalls_data_intf *intf; |
1358 |
+ |
1359 |
+ if (map == NULL) |
1360 |
+ return; |
1361 |
+ |
1362 |
+- intf = map->ring; |
1363 |
+- intf->in_error = -ENOTCONN; |
1364 |
++ atomic_inc(&map->read); |
1365 |
+ notify_remote_via_irq(map->irq); |
1366 |
+ } |
1367 |
+ |
1368 |
+diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c |
1369 |
+index 8a2ca41e4b97c..9b6207c84b689 100644 |
1370 |
+--- a/fs/ceph/snap.c |
1371 |
++++ b/fs/ceph/snap.c |
1372 |
+@@ -616,7 +616,8 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci, |
1373 |
+ capsnap->size); |
1374 |
+ |
1375 |
+ spin_lock(&mdsc->snap_flush_lock); |
1376 |
+- list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list); |
1377 |
++ if (list_empty(&ci->i_snap_flush_item)) |
1378 |
++ list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list); |
1379 |
+ spin_unlock(&mdsc->snap_flush_lock); |
1380 |
+ return 1; /* caller may want to ceph_flush_snaps */ |
1381 |
+ } |
1382 |
+diff --git a/fs/proc/base.c b/fs/proc/base.c |
1383 |
+index 9063738ff1f03..64695dcf89f3b 100644 |
1384 |
+--- a/fs/proc/base.c |
1385 |
++++ b/fs/proc/base.c |
1386 |
+@@ -1108,10 +1108,6 @@ static int __set_oom_adj(struct file *file, int oom_adj, bool legacy) |
1387 |
+ |
1388 |
+ task_lock(p); |
1389 |
+ if (!p->vfork_done && process_shares_mm(p, mm)) { |
1390 |
+- pr_info("updating oom_score_adj for %d (%s) from %d to %d because it shares mm with %d (%s). Report if this is unexpected.\n", |
1391 |
+- task_pid_nr(p), p->comm, |
1392 |
+- p->signal->oom_score_adj, oom_adj, |
1393 |
+- task_pid_nr(task), task->comm); |
1394 |
+ p->signal->oom_score_adj = oom_adj; |
1395 |
+ if (!legacy && has_capability_noaudit(current, CAP_SYS_RESOURCE)) |
1396 |
+ p->signal->oom_score_adj_min = (short)oom_adj; |
1397 |
+diff --git a/include/keys/user-type.h b/include/keys/user-type.h |
1398 |
+index e098cbe27db54..12babe9915944 100644 |
1399 |
+--- a/include/keys/user-type.h |
1400 |
++++ b/include/keys/user-type.h |
1401 |
+@@ -31,7 +31,7 @@ |
1402 |
+ struct user_key_payload { |
1403 |
+ struct rcu_head rcu; /* RCU destructor */ |
1404 |
+ unsigned short datalen; /* length of this data */ |
1405 |
+- char data[0]; /* actual data */ |
1406 |
++ char data[0] __aligned(__alignof__(u64)); /* actual data */ |
1407 |
+ }; |
1408 |
+ |
1409 |
+ extern struct key_type key_type_user; |
1410 |
+diff --git a/include/linux/qed/qed_chain.h b/include/linux/qed/qed_chain.h |
1411 |
+index 59ddf9af909e4..2dd0a9ed5b361 100644 |
1412 |
+--- a/include/linux/qed/qed_chain.h |
1413 |
++++ b/include/linux/qed/qed_chain.h |
1414 |
+@@ -663,6 +663,37 @@ out: |
1415 |
+ static inline void qed_chain_set_prod(struct qed_chain *p_chain, |
1416 |
+ u32 prod_idx, void *p_prod_elem) |
1417 |
+ { |
1418 |
++ if (p_chain->mode == QED_CHAIN_MODE_PBL) { |
1419 |
++ u32 cur_prod, page_mask, page_cnt, page_diff; |
1420 |
++ |
1421 |
++ cur_prod = is_chain_u16(p_chain) ? p_chain->u.chain16.prod_idx : |
1422 |
++ p_chain->u.chain32.prod_idx; |
1423 |
++ |
1424 |
++ /* Assume that number of elements in a page is power of 2 */ |
1425 |
++ page_mask = ~p_chain->elem_per_page_mask; |
1426 |
++ |
1427 |
++ /* Use "cur_prod - 1" and "prod_idx - 1" since producer index |
1428 |
++ * reaches the first element of next page before the page index |
1429 |
++ * is incremented. See qed_chain_produce(). |
1430 |
++ * Index wrap around is not a problem because the difference |
1431 |
++ * between current and given producer indices is always |
1432 |
++ * positive and lower than the chain's capacity. |
1433 |
++ */ |
1434 |
++ page_diff = (((cur_prod - 1) & page_mask) - |
1435 |
++ ((prod_idx - 1) & page_mask)) / |
1436 |
++ p_chain->elem_per_page; |
1437 |
++ |
1438 |
++ page_cnt = qed_chain_get_page_cnt(p_chain); |
1439 |
++ if (is_chain_u16(p_chain)) |
1440 |
++ p_chain->pbl.c.u16.prod_page_idx = |
1441 |
++ (p_chain->pbl.c.u16.prod_page_idx - |
1442 |
++ page_diff + page_cnt) % page_cnt; |
1443 |
++ else |
1444 |
++ p_chain->pbl.c.u32.prod_page_idx = |
1445 |
++ (p_chain->pbl.c.u32.prod_page_idx - |
1446 |
++ page_diff + page_cnt) % page_cnt; |
1447 |
++ } |
1448 |
++ |
1449 |
+ if (is_chain_u16(p_chain)) |
1450 |
+ p_chain->u.chain16.prod_idx = (u16) prod_idx; |
1451 |
+ else |
1452 |
+diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h |
1453 |
+index d6a18a3839cc2..1c1a1512ec553 100644 |
1454 |
+--- a/include/linux/sched/sysctl.h |
1455 |
++++ b/include/linux/sched/sysctl.h |
1456 |
+@@ -38,9 +38,9 @@ extern unsigned int sysctl_numa_balancing_scan_period_max; |
1457 |
+ extern unsigned int sysctl_numa_balancing_scan_size; |
1458 |
+ |
1459 |
+ #ifdef CONFIG_SCHED_DEBUG |
1460 |
+-extern unsigned int sysctl_sched_migration_cost; |
1461 |
+-extern unsigned int sysctl_sched_nr_migrate; |
1462 |
+-extern unsigned int sysctl_sched_time_avg; |
1463 |
++extern __read_mostly unsigned int sysctl_sched_migration_cost; |
1464 |
++extern __read_mostly unsigned int sysctl_sched_nr_migrate; |
1465 |
++extern __read_mostly unsigned int sysctl_sched_time_avg; |
1466 |
+ |
1467 |
+ int sched_proc_update_handler(struct ctl_table *table, int write, |
1468 |
+ void __user *buffer, size_t *length, |
1469 |
+diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h |
1470 |
+index 50a4a5968f3a1..3172e14d93984 100644 |
1471 |
+--- a/include/linux/skbuff.h |
1472 |
++++ b/include/linux/skbuff.h |
1473 |
+@@ -2377,7 +2377,7 @@ static inline void skb_probe_transport_header(struct sk_buff *skb, |
1474 |
+ return; |
1475 |
+ else if (skb_flow_dissect_flow_keys(skb, &keys, 0)) |
1476 |
+ skb_set_transport_header(skb, keys.control.thoff); |
1477 |
+- else |
1478 |
++ else if (offset_hint >= 0) |
1479 |
+ skb_set_transport_header(skb, offset_hint); |
1480 |
+ } |
1481 |
+ |
1482 |
+diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h |
1483 |
+index cb462f9ab7dd5..e0348cb0a1dd7 100644 |
1484 |
+--- a/include/linux/virtio_net.h |
1485 |
++++ b/include/linux/virtio_net.h |
1486 |
+@@ -57,6 +57,25 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, |
1487 |
+ |
1488 |
+ if (!skb_partial_csum_set(skb, start, off)) |
1489 |
+ return -EINVAL; |
1490 |
++ } else { |
1491 |
++ /* gso packets without NEEDS_CSUM do not set transport_offset. |
1492 |
++ * probe and drop if does not match one of the above types. |
1493 |
++ */ |
1494 |
++ if (gso_type && skb->network_header) { |
1495 |
++ if (!skb->protocol) |
1496 |
++ virtio_net_hdr_set_proto(skb, hdr); |
1497 |
++retry: |
1498 |
++ skb_probe_transport_header(skb, -1); |
1499 |
++ if (!skb_transport_header_was_set(skb)) { |
1500 |
++ /* UFO does not specify ipv4 or 6: try both */ |
1501 |
++ if (gso_type & SKB_GSO_UDP && |
1502 |
++ skb->protocol == htons(ETH_P_IP)) { |
1503 |
++ skb->protocol = htons(ETH_P_IPV6); |
1504 |
++ goto retry; |
1505 |
++ } |
1506 |
++ return -EINVAL; |
1507 |
++ } |
1508 |
++ } |
1509 |
+ } |
1510 |
+ |
1511 |
+ if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) { |
1512 |
+diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h |
1513 |
+index 817d807e9481d..f7df51ffd2a49 100644 |
1514 |
+--- a/include/uapi/linux/inet_diag.h |
1515 |
++++ b/include/uapi/linux/inet_diag.h |
1516 |
+@@ -135,15 +135,21 @@ enum { |
1517 |
+ INET_DIAG_TCLASS, |
1518 |
+ INET_DIAG_SKMEMINFO, |
1519 |
+ INET_DIAG_SHUTDOWN, |
1520 |
+- INET_DIAG_DCTCPINFO, |
1521 |
+- INET_DIAG_PROTOCOL, /* response attribute only */ |
1522 |
++ |
1523 |
++ /* |
1524 |
++ * Next extenstions cannot be requested in struct inet_diag_req_v2: |
1525 |
++ * its field idiag_ext has only 8 bits. |
1526 |
++ */ |
1527 |
++ |
1528 |
++ INET_DIAG_DCTCPINFO, /* request as INET_DIAG_VEGASINFO */ |
1529 |
++ INET_DIAG_PROTOCOL, /* response attribute only */ |
1530 |
+ INET_DIAG_SKV6ONLY, |
1531 |
+ INET_DIAG_LOCALS, |
1532 |
+ INET_DIAG_PEERS, |
1533 |
+ INET_DIAG_PAD, |
1534 |
+- INET_DIAG_MARK, |
1535 |
+- INET_DIAG_BBRINFO, |
1536 |
+- INET_DIAG_CLASS_ID, |
1537 |
++ INET_DIAG_MARK, /* only with CAP_NET_ADMIN */ |
1538 |
++ INET_DIAG_BBRINFO, /* request as INET_DIAG_VEGASINFO */ |
1539 |
++ INET_DIAG_CLASS_ID, /* request as INET_DIAG_TCLASS */ |
1540 |
+ INET_DIAG_MD5SIG, |
1541 |
+ __INET_DIAG_MAX, |
1542 |
+ }; |
1543 |
+diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c |
1544 |
+index e9cbb96cd99e4..bd6e6142473f2 100644 |
1545 |
+--- a/kernel/trace/trace.c |
1546 |
++++ b/kernel/trace/trace.c |
1547 |
+@@ -3381,6 +3381,8 @@ static void print_func_help_header_irq(struct trace_buffer *buf, struct seq_file |
1548 |
+ const char tgid_space[] = " "; |
1549 |
+ const char space[] = " "; |
1550 |
+ |
1551 |
++ print_event_info(buf, m); |
1552 |
++ |
1553 |
+ seq_printf(m, "# %s _-----=> irqs-off\n", |
1554 |
+ tgid ? tgid_space : space); |
1555 |
+ seq_printf(m, "# %s / _----=> need-resched\n", |
1556 |
+diff --git a/mm/mempolicy.c b/mm/mempolicy.c |
1557 |
+index 1b93535d875f3..1331645a3794e 100644 |
1558 |
+--- a/mm/mempolicy.c |
1559 |
++++ b/mm/mempolicy.c |
1560 |
+@@ -1325,7 +1325,7 @@ static int copy_nodes_to_user(unsigned long __user *mask, unsigned long maxnode, |
1561 |
+ nodemask_t *nodes) |
1562 |
+ { |
1563 |
+ unsigned long copy = ALIGN(maxnode-1, 64) / 8; |
1564 |
+- const int nbytes = BITS_TO_LONGS(MAX_NUMNODES) * sizeof(long); |
1565 |
++ unsigned int nbytes = BITS_TO_LONGS(nr_node_ids) * sizeof(long); |
1566 |
+ |
1567 |
+ if (copy > nbytes) { |
1568 |
+ if (copy > PAGE_SIZE) |
1569 |
+@@ -1486,7 +1486,7 @@ SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, |
1570 |
+ int uninitialized_var(pval); |
1571 |
+ nodemask_t nodes; |
1572 |
+ |
1573 |
+- if (nmask != NULL && maxnode < MAX_NUMNODES) |
1574 |
++ if (nmask != NULL && maxnode < nr_node_ids) |
1575 |
+ return -EINVAL; |
1576 |
+ |
1577 |
+ err = do_get_mempolicy(&pval, &nodes, addr, flags); |
1578 |
+@@ -1515,7 +1515,7 @@ COMPAT_SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, |
1579 |
+ unsigned long nr_bits, alloc_size; |
1580 |
+ DECLARE_BITMAP(bm, MAX_NUMNODES); |
1581 |
+ |
1582 |
+- nr_bits = min_t(unsigned long, maxnode-1, MAX_NUMNODES); |
1583 |
++ nr_bits = min_t(unsigned long, maxnode-1, nr_node_ids); |
1584 |
+ alloc_size = ALIGN(nr_bits, BITS_PER_LONG) / 8; |
1585 |
+ |
1586 |
+ if (nmask) |
1587 |
+diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c |
1588 |
+index 3a80beef247c3..7c883420485b8 100644 |
1589 |
+--- a/net/batman-adv/soft-interface.c |
1590 |
++++ b/net/batman-adv/soft-interface.c |
1591 |
+@@ -219,6 +219,8 @@ static int batadv_interface_tx(struct sk_buff *skb, |
1592 |
+ |
1593 |
+ switch (ntohs(ethhdr->h_proto)) { |
1594 |
+ case ETH_P_8021Q: |
1595 |
++ if (!pskb_may_pull(skb, sizeof(*vhdr))) |
1596 |
++ goto dropped; |
1597 |
+ vhdr = vlan_eth_hdr(skb); |
1598 |
+ |
1599 |
+ /* drop batman-in-batman packets to prevent loops */ |
1600 |
+diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c |
1601 |
+index a813dfe2dc2cf..8dc5c8d69bcd7 100644 |
1602 |
+--- a/net/bridge/br_multicast.c |
1603 |
++++ b/net/bridge/br_multicast.c |
1604 |
+@@ -1390,14 +1390,7 @@ static void br_multicast_query_received(struct net_bridge *br, |
1605 |
+ return; |
1606 |
+ |
1607 |
+ br_multicast_update_query_timer(br, query, max_delay); |
1608 |
+- |
1609 |
+- /* Based on RFC4541, section 2.1.1 IGMP Forwarding Rules, |
1610 |
+- * the arrival port for IGMP Queries where the source address |
1611 |
+- * is 0.0.0.0 should not be added to router port list. |
1612 |
+- */ |
1613 |
+- if ((saddr->proto == htons(ETH_P_IP) && saddr->u.ip4) || |
1614 |
+- saddr->proto == htons(ETH_P_IPV6)) |
1615 |
+- br_multicast_mark_router(br, port); |
1616 |
++ br_multicast_mark_router(br, port); |
1617 |
+ } |
1618 |
+ |
1619 |
+ static int br_ip4_multicast_query(struct net_bridge *br, |
1620 |
+diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c |
1621 |
+index 5fd222dc64b3e..081a41c753413 100644 |
1622 |
+--- a/net/ceph/messenger.c |
1623 |
++++ b/net/ceph/messenger.c |
1624 |
+@@ -2057,6 +2057,8 @@ static int process_connect(struct ceph_connection *con) |
1625 |
+ dout("process_connect on %p tag %d\n", con, (int)con->in_tag); |
1626 |
+ |
1627 |
+ if (con->auth) { |
1628 |
++ int len = le32_to_cpu(con->in_reply.authorizer_len); |
1629 |
++ |
1630 |
+ /* |
1631 |
+ * Any connection that defines ->get_authorizer() |
1632 |
+ * should also define ->add_authorizer_challenge() and |
1633 |
+@@ -2066,8 +2068,7 @@ static int process_connect(struct ceph_connection *con) |
1634 |
+ */ |
1635 |
+ if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) { |
1636 |
+ ret = con->ops->add_authorizer_challenge( |
1637 |
+- con, con->auth->authorizer_reply_buf, |
1638 |
+- le32_to_cpu(con->in_reply.authorizer_len)); |
1639 |
++ con, con->auth->authorizer_reply_buf, len); |
1640 |
+ if (ret < 0) |
1641 |
+ return ret; |
1642 |
+ |
1643 |
+@@ -2077,10 +2078,12 @@ static int process_connect(struct ceph_connection *con) |
1644 |
+ return 0; |
1645 |
+ } |
1646 |
+ |
1647 |
+- ret = con->ops->verify_authorizer_reply(con); |
1648 |
+- if (ret < 0) { |
1649 |
+- con->error_msg = "bad authorize reply"; |
1650 |
+- return ret; |
1651 |
++ if (len) { |
1652 |
++ ret = con->ops->verify_authorizer_reply(con); |
1653 |
++ if (ret < 0) { |
1654 |
++ con->error_msg = "bad authorize reply"; |
1655 |
++ return ret; |
1656 |
++ } |
1657 |
+ } |
1658 |
+ } |
1659 |
+ |
1660 |
+diff --git a/net/core/filter.c b/net/core/filter.c |
1661 |
+index 542fd04bc44da..41ede90fc28f5 100644 |
1662 |
+--- a/net/core/filter.c |
1663 |
++++ b/net/core/filter.c |
1664 |
+@@ -3102,7 +3102,10 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock, |
1665 |
+ sk->sk_rcvlowat = val ? : 1; |
1666 |
+ break; |
1667 |
+ case SO_MARK: |
1668 |
+- sk->sk_mark = val; |
1669 |
++ if (sk->sk_mark != val) { |
1670 |
++ sk->sk_mark = val; |
1671 |
++ sk_dst_reset(sk); |
1672 |
++ } |
1673 |
+ break; |
1674 |
+ default: |
1675 |
+ ret = -EINVAL; |
1676 |
+@@ -3128,7 +3131,7 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock, |
1677 |
+ /* Only some options are supported */ |
1678 |
+ switch (optname) { |
1679 |
+ case TCP_BPF_IW: |
1680 |
+- if (val <= 0 || tp->data_segs_out > 0) |
1681 |
++ if (val <= 0 || tp->data_segs_out > tp->syn_data) |
1682 |
+ ret = -EINVAL; |
1683 |
+ else |
1684 |
+ tp->snd_cwnd = val; |
1685 |
+diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c |
1686 |
+index 857ec3dbb742b..33edccfebc304 100644 |
1687 |
+--- a/net/ipv4/inet_diag.c |
1688 |
++++ b/net/ipv4/inet_diag.c |
1689 |
+@@ -109,6 +109,7 @@ static size_t inet_sk_attr_size(struct sock *sk, |
1690 |
+ + nla_total_size(1) /* INET_DIAG_TOS */ |
1691 |
+ + nla_total_size(1) /* INET_DIAG_TCLASS */ |
1692 |
+ + nla_total_size(4) /* INET_DIAG_MARK */ |
1693 |
++ + nla_total_size(4) /* INET_DIAG_CLASS_ID */ |
1694 |
+ + nla_total_size(sizeof(struct inet_diag_meminfo)) |
1695 |
+ + nla_total_size(sizeof(struct inet_diag_msg)) |
1696 |
+ + nla_total_size(SK_MEMINFO_VARS * sizeof(u32)) |
1697 |
+@@ -288,12 +289,19 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, |
1698 |
+ goto errout; |
1699 |
+ } |
1700 |
+ |
1701 |
+- if (ext & (1 << (INET_DIAG_CLASS_ID - 1))) { |
1702 |
++ if (ext & (1 << (INET_DIAG_CLASS_ID - 1)) || |
1703 |
++ ext & (1 << (INET_DIAG_TCLASS - 1))) { |
1704 |
+ u32 classid = 0; |
1705 |
+ |
1706 |
+ #ifdef CONFIG_SOCK_CGROUP_DATA |
1707 |
+ classid = sock_cgroup_classid(&sk->sk_cgrp_data); |
1708 |
+ #endif |
1709 |
++ /* Fallback to socket priority if class id isn't set. |
1710 |
++ * Classful qdiscs use it as direct reference to class. |
1711 |
++ * For cgroup2 classid is always zero. |
1712 |
++ */ |
1713 |
++ if (!classid) |
1714 |
++ classid = sk->sk_priority; |
1715 |
+ |
1716 |
+ if (nla_put_u32(skb, INET_DIAG_CLASS_ID, classid)) |
1717 |
+ goto errout; |
1718 |
+diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c |
1719 |
+index 1f8b1a433b5d6..a776fbc3b2a9f 100644 |
1720 |
+--- a/net/ipv6/netfilter.c |
1721 |
++++ b/net/ipv6/netfilter.c |
1722 |
+@@ -24,9 +24,11 @@ int ip6_route_me_harder(struct net *net, struct sk_buff *skb) |
1723 |
+ struct sock *sk = sk_to_full_sk(skb->sk); |
1724 |
+ unsigned int hh_len; |
1725 |
+ struct dst_entry *dst; |
1726 |
++ int strict = (ipv6_addr_type(&iph->daddr) & |
1727 |
++ (IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL)); |
1728 |
+ struct flowi6 fl6 = { |
1729 |
+ .flowi6_oif = sk && sk->sk_bound_dev_if ? sk->sk_bound_dev_if : |
1730 |
+- rt6_need_strict(&iph->daddr) ? skb_dst(skb)->dev->ifindex : 0, |
1731 |
++ strict ? skb_dst(skb)->dev->ifindex : 0, |
1732 |
+ .flowi6_mark = skb->mark, |
1733 |
+ .flowi6_uid = sock_net_uid(net, sk), |
1734 |
+ .daddr = iph->daddr, |
1735 |
+diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c |
1736 |
+index c814077709562..fdeb90dd1c824 100644 |
1737 |
+--- a/net/ipv6/seg6.c |
1738 |
++++ b/net/ipv6/seg6.c |
1739 |
+@@ -220,9 +220,7 @@ static int seg6_genl_get_tunsrc(struct sk_buff *skb, struct genl_info *info) |
1740 |
+ rcu_read_unlock(); |
1741 |
+ |
1742 |
+ genlmsg_end(msg, hdr); |
1743 |
+- genlmsg_reply(msg, info); |
1744 |
+- |
1745 |
+- return 0; |
1746 |
++ return genlmsg_reply(msg, info); |
1747 |
+ |
1748 |
+ nla_put_failure: |
1749 |
+ rcu_read_unlock(); |
1750 |
+diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c |
1751 |
+index 5d00a38cd1cbd..2e55f9894548e 100644 |
1752 |
+--- a/net/ipv6/sit.c |
1753 |
++++ b/net/ipv6/sit.c |
1754 |
+@@ -540,7 +540,8 @@ static int ipip6_err(struct sk_buff *skb, u32 info) |
1755 |
+ } |
1756 |
+ |
1757 |
+ err = 0; |
1758 |
+- if (!ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4, type, data_len)) |
1759 |
++ if (__in6_dev_get(skb->dev) && |
1760 |
++ !ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4, type, data_len)) |
1761 |
+ goto out; |
1762 |
+ |
1763 |
+ if (t->parms.iph.daddr == 0) |
1764 |
+diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c |
1765 |
+index 63558335e41ee..ebc8045ddee68 100644 |
1766 |
+--- a/net/mac80211/cfg.c |
1767 |
++++ b/net/mac80211/cfg.c |
1768 |
+@@ -884,6 +884,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, |
1769 |
+ BSS_CHANGED_P2P_PS | |
1770 |
+ BSS_CHANGED_TXPOWER; |
1771 |
+ int err; |
1772 |
++ int prev_beacon_int; |
1773 |
+ |
1774 |
+ old = sdata_dereference(sdata->u.ap.beacon, sdata); |
1775 |
+ if (old) |
1776 |
+@@ -906,6 +907,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, |
1777 |
+ |
1778 |
+ sdata->needed_rx_chains = sdata->local->rx_chains; |
1779 |
+ |
1780 |
++ prev_beacon_int = sdata->vif.bss_conf.beacon_int; |
1781 |
+ sdata->vif.bss_conf.beacon_int = params->beacon_interval; |
1782 |
+ |
1783 |
+ mutex_lock(&local->mtx); |
1784 |
+@@ -914,8 +916,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, |
1785 |
+ if (!err) |
1786 |
+ ieee80211_vif_copy_chanctx_to_vlans(sdata, false); |
1787 |
+ mutex_unlock(&local->mtx); |
1788 |
+- if (err) |
1789 |
++ if (err) { |
1790 |
++ sdata->vif.bss_conf.beacon_int = prev_beacon_int; |
1791 |
+ return err; |
1792 |
++ } |
1793 |
+ |
1794 |
+ /* |
1795 |
+ * Apply control port protocol, this allows us to |
1796 |
+diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c |
1797 |
+index 97269caafecd7..1ce068865629b 100644 |
1798 |
+--- a/net/mac80211/mesh_pathtbl.c |
1799 |
++++ b/net/mac80211/mesh_pathtbl.c |
1800 |
+@@ -448,17 +448,15 @@ struct mesh_path *mesh_path_add(struct ieee80211_sub_if_data *sdata, |
1801 |
+ |
1802 |
+ } while (unlikely(ret == -EEXIST && !mpath)); |
1803 |
+ |
1804 |
+- if (ret && ret != -EEXIST) |
1805 |
+- return ERR_PTR(ret); |
1806 |
+- |
1807 |
+- /* At this point either new_mpath was added, or we found a |
1808 |
+- * matching entry already in the table; in the latter case |
1809 |
+- * free the unnecessary new entry. |
1810 |
+- */ |
1811 |
+- if (ret == -EEXIST) { |
1812 |
++ if (ret) { |
1813 |
+ kfree(new_mpath); |
1814 |
++ |
1815 |
++ if (ret != -EEXIST) |
1816 |
++ return ERR_PTR(ret); |
1817 |
++ |
1818 |
+ new_mpath = mpath; |
1819 |
+ } |
1820 |
++ |
1821 |
+ sdata->u.mesh.mesh_paths_generation++; |
1822 |
+ return new_mpath; |
1823 |
+ } |
1824 |
+@@ -488,6 +486,9 @@ int mpp_path_add(struct ieee80211_sub_if_data *sdata, |
1825 |
+ &new_mpath->rhash, |
1826 |
+ mesh_rht_params); |
1827 |
+ |
1828 |
++ if (ret) |
1829 |
++ kfree(new_mpath); |
1830 |
++ |
1831 |
+ sdata->u.mesh.mpp_paths_generation++; |
1832 |
+ return ret; |
1833 |
+ } |
1834 |
+diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c |
1835 |
+index 623ec29ade26b..c445d57e3a5bc 100644 |
1836 |
+--- a/net/netfilter/nf_tables_api.c |
1837 |
++++ b/net/netfilter/nf_tables_api.c |
1838 |
+@@ -304,6 +304,9 @@ static int nft_delrule_by_chain(struct nft_ctx *ctx) |
1839 |
+ int err; |
1840 |
+ |
1841 |
+ list_for_each_entry(rule, &ctx->chain->rules, list) { |
1842 |
++ if (!nft_is_active_next(ctx->net, rule)) |
1843 |
++ continue; |
1844 |
++ |
1845 |
+ err = nft_delrule(ctx, rule); |
1846 |
+ if (err < 0) |
1847 |
+ return err; |
1848 |
+@@ -4046,6 +4049,8 @@ err6: |
1849 |
+ err5: |
1850 |
+ kfree(trans); |
1851 |
+ err4: |
1852 |
++ if (obj) |
1853 |
++ obj->use--; |
1854 |
+ kfree(elem.priv); |
1855 |
+ err3: |
1856 |
+ if (nla[NFTA_SET_ELEM_DATA] != NULL) |
1857 |
+diff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c |
1858 |
+index 7533c2fd6b769..7344ec7fff2a7 100644 |
1859 |
+--- a/net/netfilter/nft_compat.c |
1860 |
++++ b/net/netfilter/nft_compat.c |
1861 |
+@@ -277,6 +277,7 @@ nft_target_destroy(const struct nft_ctx *ctx, const struct nft_expr *expr) |
1862 |
+ { |
1863 |
+ struct xt_target *target = expr->ops->data; |
1864 |
+ void *info = nft_expr_priv(expr); |
1865 |
++ struct module *me = target->me; |
1866 |
+ struct xt_tgdtor_param par; |
1867 |
+ |
1868 |
+ par.net = ctx->net; |
1869 |
+@@ -287,7 +288,7 @@ nft_target_destroy(const struct nft_ctx *ctx, const struct nft_expr *expr) |
1870 |
+ par.target->destroy(&par); |
1871 |
+ |
1872 |
+ if (nft_xt_put(container_of(expr->ops, struct nft_xt, ops))) |
1873 |
+- module_put(target->me); |
1874 |
++ module_put(me); |
1875 |
+ } |
1876 |
+ |
1877 |
+ static int nft_target_dump(struct sk_buff *skb, const struct nft_expr *expr) |
1878 |
+diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c |
1879 |
+index 44a093c755677..a2bd5917a2a9b 100644 |
1880 |
+--- a/net/packet/af_packet.c |
1881 |
++++ b/net/packet/af_packet.c |
1882 |
+@@ -4313,7 +4313,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, |
1883 |
+ rb->frames_per_block = req->tp_block_size / req->tp_frame_size; |
1884 |
+ if (unlikely(rb->frames_per_block == 0)) |
1885 |
+ goto out; |
1886 |
+- if (unlikely(req->tp_block_size > UINT_MAX / req->tp_block_nr)) |
1887 |
++ if (unlikely(rb->frames_per_block > UINT_MAX / req->tp_block_nr)) |
1888 |
+ goto out; |
1889 |
+ if (unlikely((rb->frames_per_block * req->tp_block_nr) != |
1890 |
+ req->tp_frame_nr)) |
1891 |
+diff --git a/net/sctp/offload.c b/net/sctp/offload.c |
1892 |
+index 35bc7106d1827..055e1ab1e9630 100644 |
1893 |
+--- a/net/sctp/offload.c |
1894 |
++++ b/net/sctp/offload.c |
1895 |
+@@ -36,6 +36,7 @@ static __le32 sctp_gso_make_checksum(struct sk_buff *skb) |
1896 |
+ { |
1897 |
+ skb->ip_summed = CHECKSUM_NONE; |
1898 |
+ skb->csum_not_inet = 0; |
1899 |
++ gso_reset_checksum(skb, ~0); |
1900 |
+ return sctp_compute_cksum(skb, skb_transport_offset(skb)); |
1901 |
+ } |
1902 |
+ |
1903 |
+diff --git a/net/sctp/sctp_diag.c b/net/sctp/sctp_diag.c |
1904 |
+index a72a7d925d463..75274a60b77ab 100644 |
1905 |
+--- a/net/sctp/sctp_diag.c |
1906 |
++++ b/net/sctp/sctp_diag.c |
1907 |
+@@ -225,6 +225,7 @@ static size_t inet_assoc_attr_size(struct sctp_association *asoc) |
1908 |
+ + nla_total_size(1) /* INET_DIAG_TOS */ |
1909 |
+ + nla_total_size(1) /* INET_DIAG_TCLASS */ |
1910 |
+ + nla_total_size(4) /* INET_DIAG_MARK */ |
1911 |
++ + nla_total_size(4) /* INET_DIAG_CLASS_ID */ |
1912 |
+ + nla_total_size(addrlen * asoc->peer.transport_count) |
1913 |
+ + nla_total_size(addrlen * addrcnt) |
1914 |
+ + nla_total_size(sizeof(struct inet_diag_meminfo)) |
1915 |
+diff --git a/security/keys/key.c b/security/keys/key.c |
1916 |
+index 83bf4b4afd49d..87172f99f73e0 100644 |
1917 |
+--- a/security/keys/key.c |
1918 |
++++ b/security/keys/key.c |
1919 |
+@@ -265,8 +265,8 @@ struct key *key_alloc(struct key_type *type, const char *desc, |
1920 |
+ |
1921 |
+ spin_lock(&user->lock); |
1922 |
+ if (!(flags & KEY_ALLOC_QUOTA_OVERRUN)) { |
1923 |
+- if (user->qnkeys + 1 >= maxkeys || |
1924 |
+- user->qnbytes + quotalen >= maxbytes || |
1925 |
++ if (user->qnkeys + 1 > maxkeys || |
1926 |
++ user->qnbytes + quotalen > maxbytes || |
1927 |
+ user->qnbytes + quotalen < user->qnbytes) |
1928 |
+ goto no_quota; |
1929 |
+ } |
1930 |
+diff --git a/security/keys/keyring.c b/security/keys/keyring.c |
1931 |
+index 36f842ec87f04..359b9cba3d0de 100644 |
1932 |
+--- a/security/keys/keyring.c |
1933 |
++++ b/security/keys/keyring.c |
1934 |
+@@ -661,9 +661,6 @@ static bool search_nested_keyrings(struct key *keyring, |
1935 |
+ BUG_ON((ctx->flags & STATE_CHECKS) == 0 || |
1936 |
+ (ctx->flags & STATE_CHECKS) == STATE_CHECKS); |
1937 |
+ |
1938 |
+- if (ctx->index_key.description) |
1939 |
+- ctx->index_key.desc_len = strlen(ctx->index_key.description); |
1940 |
+- |
1941 |
+ /* Check to see if this top-level keyring is what we are looking for |
1942 |
+ * and whether it is valid or not. |
1943 |
+ */ |
1944 |
+@@ -921,6 +918,7 @@ key_ref_t keyring_search(key_ref_t keyring, |
1945 |
+ struct keyring_search_context ctx = { |
1946 |
+ .index_key.type = type, |
1947 |
+ .index_key.description = description, |
1948 |
++ .index_key.desc_len = strlen(description), |
1949 |
+ .cred = current_cred(), |
1950 |
+ .match_data.cmp = key_default_cmp, |
1951 |
+ .match_data.raw_data = description, |
1952 |
+diff --git a/security/keys/proc.c b/security/keys/proc.c |
1953 |
+index 6d1fcbba1e096..0ee9a36e68151 100644 |
1954 |
+--- a/security/keys/proc.c |
1955 |
++++ b/security/keys/proc.c |
1956 |
+@@ -188,8 +188,7 @@ static int proc_keys_show(struct seq_file *m, void *v) |
1957 |
+ int rc; |
1958 |
+ |
1959 |
+ struct keyring_search_context ctx = { |
1960 |
+- .index_key.type = key->type, |
1961 |
+- .index_key.description = key->description, |
1962 |
++ .index_key = key->index_key, |
1963 |
+ .cred = m->file->f_cred, |
1964 |
+ .match_data.cmp = lookup_user_key_possessed, |
1965 |
+ .match_data.raw_data = key, |
1966 |
+diff --git a/security/keys/request_key.c b/security/keys/request_key.c |
1967 |
+index 7dc7413821542..c707fdbb34294 100644 |
1968 |
+--- a/security/keys/request_key.c |
1969 |
++++ b/security/keys/request_key.c |
1970 |
+@@ -545,6 +545,7 @@ struct key *request_key_and_link(struct key_type *type, |
1971 |
+ struct keyring_search_context ctx = { |
1972 |
+ .index_key.type = type, |
1973 |
+ .index_key.description = description, |
1974 |
++ .index_key.desc_len = strlen(description), |
1975 |
+ .cred = current_cred(), |
1976 |
+ .match_data.cmp = key_default_cmp, |
1977 |
+ .match_data.raw_data = description, |
1978 |
+diff --git a/security/keys/request_key_auth.c b/security/keys/request_key_auth.c |
1979 |
+index 424e1d90412ea..6797843154f03 100644 |
1980 |
+--- a/security/keys/request_key_auth.c |
1981 |
++++ b/security/keys/request_key_auth.c |
1982 |
+@@ -246,7 +246,7 @@ struct key *key_get_instantiation_authkey(key_serial_t target_id) |
1983 |
+ struct key *authkey; |
1984 |
+ key_ref_t authkey_ref; |
1985 |
+ |
1986 |
+- sprintf(description, "%x", target_id); |
1987 |
++ ctx.index_key.desc_len = sprintf(description, "%x", target_id); |
1988 |
+ |
1989 |
+ authkey_ref = search_process_keyrings(&ctx); |
1990 |
+ |