Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.19 commit in: /
Date: Wed, 01 Jul 2020 12:14:46
Message-Id: 1593605671.106ad7a70dd251d2984bf8cc3ce3600b3bd224a4.mpagano@gentoo
1 commit: 106ad7a70dd251d2984bf8cc3ce3600b3bd224a4
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 1 12:14:31 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 1 12:14:31 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=106ad7a7
7
8 Linux patch 4.19.131
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1130_linux-4.19.131.patch | 3602 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 3606 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index d1af7f9..6975213 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -559,6 +559,10 @@ Patch: 1129_linux-4.19.130.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.19.130
23
24 +Patch: 1130_linux-4.19.131.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.19.131
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/1130_linux-4.19.131.patch b/1130_linux-4.19.131.patch
33 new file mode 100644
34 index 0000000..7356bd1
35 --- /dev/null
36 +++ b/1130_linux-4.19.131.patch
37 @@ -0,0 +1,3602 @@
38 +diff --git a/Makefile b/Makefile
39 +index 6443cbd51f70..605a6a2e03dc 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 19
46 +-SUBLEVEL = 130
47 ++SUBLEVEL = 131
48 + EXTRAVERSION =
49 + NAME = "People's Front"
50 +
51 +diff --git a/arch/arm/boot/dts/bcm-nsp.dtsi b/arch/arm/boot/dts/bcm-nsp.dtsi
52 +index 2b219addeb44..273a31604579 100644
53 +--- a/arch/arm/boot/dts/bcm-nsp.dtsi
54 ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi
55 +@@ -249,10 +249,10 @@
56 + status = "disabled";
57 + };
58 +
59 +- mailbox: mailbox@25000 {
60 ++ mailbox: mailbox@25c00 {
61 + compatible = "brcm,iproc-fa2-mbox";
62 +- reg = <0x25000 0x445>;
63 +- interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
64 ++ reg = <0x25c00 0x400>;
65 ++ interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>;
66 + #mbox-cells = <1>;
67 + brcm,rx-status-len = <32>;
68 + brcm,use-bcm-hdr;
69 +diff --git a/arch/arm/boot/dts/omap4-duovero-parlor.dts b/arch/arm/boot/dts/omap4-duovero-parlor.dts
70 +index cfcac0d73851..93d6fb6db578 100644
71 +--- a/arch/arm/boot/dts/omap4-duovero-parlor.dts
72 ++++ b/arch/arm/boot/dts/omap4-duovero-parlor.dts
73 +@@ -142,7 +142,7 @@
74 + ethernet@gpmc {
75 + reg = <5 0 0xff>;
76 + interrupt-parent = <&gpio2>;
77 +- interrupts = <12 IRQ_TYPE_EDGE_FALLING>; /* gpio_44 */
78 ++ interrupts = <12 IRQ_TYPE_LEVEL_LOW>; /* gpio_44 */
79 +
80 + phy-mode = "mii";
81 +
82 +diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c
83 +index 868781fd460c..14c630c899c5 100644
84 +--- a/arch/arm/mach-imx/pm-imx5.c
85 ++++ b/arch/arm/mach-imx/pm-imx5.c
86 +@@ -301,14 +301,14 @@ static int __init imx_suspend_alloc_ocram(
87 + if (!ocram_pool) {
88 + pr_warn("%s: ocram pool unavailable!\n", __func__);
89 + ret = -ENODEV;
90 +- goto put_node;
91 ++ goto put_device;
92 + }
93 +
94 + ocram_base = gen_pool_alloc(ocram_pool, size);
95 + if (!ocram_base) {
96 + pr_warn("%s: unable to alloc ocram!\n", __func__);
97 + ret = -ENOMEM;
98 +- goto put_node;
99 ++ goto put_device;
100 + }
101 +
102 + phys = gen_pool_virt_to_phys(ocram_pool, ocram_base);
103 +@@ -318,6 +318,8 @@ static int __init imx_suspend_alloc_ocram(
104 + if (virt_out)
105 + *virt_out = virt;
106 +
107 ++put_device:
108 ++ put_device(&pdev->dev);
109 + put_node:
110 + of_node_put(node);
111 +
112 +diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
113 +index 14fdbaa6ee3a..19c87b52c001 100644
114 +--- a/arch/arm64/kernel/fpsimd.c
115 ++++ b/arch/arm64/kernel/fpsimd.c
116 +@@ -304,7 +304,7 @@ static unsigned int find_supported_vector_length(unsigned int vl)
117 + return sve_vl_from_vq(bit_to_vq(bit));
118 + }
119 +
120 +-#ifdef CONFIG_SYSCTL
121 ++#if defined(CONFIG_ARM64_SVE) && defined(CONFIG_SYSCTL)
122 +
123 + static int sve_proc_do_default_vl(struct ctl_table *table, int write,
124 + void __user *buffer, size_t *lenp,
125 +@@ -350,9 +350,9 @@ static int __init sve_sysctl_init(void)
126 + return 0;
127 + }
128 +
129 +-#else /* ! CONFIG_SYSCTL */
130 ++#else /* ! (CONFIG_ARM64_SVE && CONFIG_SYSCTL) */
131 + static int __init sve_sysctl_init(void) { return 0; }
132 +-#endif /* ! CONFIG_SYSCTL */
133 ++#endif /* ! (CONFIG_ARM64_SVE && CONFIG_SYSCTL) */
134 +
135 + #define ZREG(sve_state, vq, n) ((char *)(sve_state) + \
136 + (SVE_SIG_ZREG_OFFSET(vq, n) - SVE_SIG_REGS_OFFSET))
137 +diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c
138 +index 0bbac612146e..666b225aeb3a 100644
139 +--- a/arch/arm64/kernel/perf_regs.c
140 ++++ b/arch/arm64/kernel/perf_regs.c
141 +@@ -15,15 +15,34 @@ u64 perf_reg_value(struct pt_regs *regs, int idx)
142 + return 0;
143 +
144 + /*
145 +- * Compat (i.e. 32 bit) mode:
146 +- * - PC has been set in the pt_regs struct in kernel_entry,
147 +- * - Handle SP and LR here.
148 ++ * Our handling of compat tasks (PERF_SAMPLE_REGS_ABI_32) is weird, but
149 ++ * we're stuck with it for ABI compatability reasons.
150 ++ *
151 ++ * For a 32-bit consumer inspecting a 32-bit task, then it will look at
152 ++ * the first 16 registers (see arch/arm/include/uapi/asm/perf_regs.h).
153 ++ * These correspond directly to a prefix of the registers saved in our
154 ++ * 'struct pt_regs', with the exception of the PC, so we copy that down
155 ++ * (x15 corresponds to SP_hyp in the architecture).
156 ++ *
157 ++ * So far, so good.
158 ++ *
159 ++ * The oddity arises when a 64-bit consumer looks at a 32-bit task and
160 ++ * asks for registers beyond PERF_REG_ARM_MAX. In this case, we return
161 ++ * SP_usr, LR_usr and PC in the positions where the AArch64 SP, LR and
162 ++ * PC registers would normally live. The initial idea was to allow a
163 ++ * 64-bit unwinder to unwind a 32-bit task and, although it's not clear
164 ++ * how well that works in practice, somebody might be relying on it.
165 ++ *
166 ++ * At the time we make a sample, we don't know whether the consumer is
167 ++ * 32-bit or 64-bit, so we have to cater for both possibilities.
168 + */
169 + if (compat_user_mode(regs)) {
170 + if ((u32)idx == PERF_REG_ARM64_SP)
171 + return regs->compat_sp;
172 + if ((u32)idx == PERF_REG_ARM64_LR)
173 + return regs->compat_lr;
174 ++ if (idx == 15)
175 ++ return regs->pc;
176 + }
177 +
178 + if ((u32)idx == PERF_REG_ARM64_SP)
179 +diff --git a/arch/riscv/include/asm/cmpxchg.h b/arch/riscv/include/asm/cmpxchg.h
180 +index c12833f7b6bd..42978aac99d5 100644
181 +--- a/arch/riscv/include/asm/cmpxchg.h
182 ++++ b/arch/riscv/include/asm/cmpxchg.h
183 +@@ -187,7 +187,7 @@
184 + " bnez %1, 0b\n" \
185 + "1:\n" \
186 + : "=&r" (__ret), "=&r" (__rc), "+A" (*__ptr) \
187 +- : "rJ" (__old), "rJ" (__new) \
188 ++ : "rJ" ((long)__old), "rJ" (__new) \
189 + : "memory"); \
190 + break; \
191 + case 8: \
192 +@@ -232,7 +232,7 @@
193 + RISCV_ACQUIRE_BARRIER \
194 + "1:\n" \
195 + : "=&r" (__ret), "=&r" (__rc), "+A" (*__ptr) \
196 +- : "rJ" (__old), "rJ" (__new) \
197 ++ : "rJ" ((long)__old), "rJ" (__new) \
198 + : "memory"); \
199 + break; \
200 + case 8: \
201 +@@ -278,7 +278,7 @@
202 + " bnez %1, 0b\n" \
203 + "1:\n" \
204 + : "=&r" (__ret), "=&r" (__rc), "+A" (*__ptr) \
205 +- : "rJ" (__old), "rJ" (__new) \
206 ++ : "rJ" ((long)__old), "rJ" (__new) \
207 + : "memory"); \
208 + break; \
209 + case 8: \
210 +@@ -324,7 +324,7 @@
211 + " fence rw, rw\n" \
212 + "1:\n" \
213 + : "=&r" (__ret), "=&r" (__rc), "+A" (*__ptr) \
214 +- : "rJ" (__old), "rJ" (__new) \
215 ++ : "rJ" ((long)__old), "rJ" (__new) \
216 + : "memory"); \
217 + break; \
218 + case 8: \
219 +diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c
220 +index fb03a4482ad6..db44da32701f 100644
221 +--- a/arch/riscv/kernel/sys_riscv.c
222 ++++ b/arch/riscv/kernel/sys_riscv.c
223 +@@ -16,6 +16,7 @@
224 + #include <linux/syscalls.h>
225 + #include <asm/unistd.h>
226 + #include <asm/cacheflush.h>
227 ++#include <asm-generic/mman-common.h>
228 +
229 + static long riscv_sys_mmap(unsigned long addr, unsigned long len,
230 + unsigned long prot, unsigned long flags,
231 +@@ -24,6 +25,11 @@ static long riscv_sys_mmap(unsigned long addr, unsigned long len,
232 + {
233 + if (unlikely(offset & (~PAGE_MASK >> page_shift_offset)))
234 + return -EINVAL;
235 ++
236 ++ if ((prot & PROT_WRITE) && (prot & PROT_EXEC))
237 ++ if (unlikely(!(prot & PROT_READ)))
238 ++ return -EINVAL;
239 ++
240 + return ksys_mmap_pgoff(addr, len, prot, flags, fd,
241 + offset >> (PAGE_SHIFT - page_shift_offset));
242 + }
243 +diff --git a/arch/s390/include/asm/vdso.h b/arch/s390/include/asm/vdso.h
244 +index 169d7604eb80..f3ba84fa9bd1 100644
245 +--- a/arch/s390/include/asm/vdso.h
246 ++++ b/arch/s390/include/asm/vdso.h
247 +@@ -36,6 +36,7 @@ struct vdso_data {
248 + __u32 tk_shift; /* Shift used for xtime_nsec 0x60 */
249 + __u32 ts_dir; /* TOD steering direction 0x64 */
250 + __u64 ts_end; /* TOD steering end 0x68 */
251 ++ __u32 hrtimer_res; /* hrtimer resolution 0x70 */
252 + };
253 +
254 + struct vdso_per_cpu_data {
255 +diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
256 +index 66e830f1c7bf..e9d09f6e81d2 100644
257 +--- a/arch/s390/kernel/asm-offsets.c
258 ++++ b/arch/s390/kernel/asm-offsets.c
259 +@@ -75,6 +75,7 @@ int main(void)
260 + OFFSET(__VDSO_TK_SHIFT, vdso_data, tk_shift);
261 + OFFSET(__VDSO_TS_DIR, vdso_data, ts_dir);
262 + OFFSET(__VDSO_TS_END, vdso_data, ts_end);
263 ++ OFFSET(__VDSO_CLOCK_REALTIME_RES, vdso_data, hrtimer_res);
264 + OFFSET(__VDSO_ECTG_BASE, vdso_per_cpu_data, ectg_timer_base);
265 + OFFSET(__VDSO_ECTG_USER, vdso_per_cpu_data, ectg_user_time);
266 + OFFSET(__VDSO_CPU_NR, vdso_per_cpu_data, cpu_nr);
267 +@@ -86,7 +87,6 @@ int main(void)
268 + DEFINE(__CLOCK_REALTIME_COARSE, CLOCK_REALTIME_COARSE);
269 + DEFINE(__CLOCK_MONOTONIC_COARSE, CLOCK_MONOTONIC_COARSE);
270 + DEFINE(__CLOCK_THREAD_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID);
271 +- DEFINE(__CLOCK_REALTIME_RES, MONOTONIC_RES_NSEC);
272 + DEFINE(__CLOCK_COARSE_RES, LOW_RES_NSEC);
273 + BLANK();
274 + /* idle data offsets */
275 +diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
276 +index cd3df5514552..65fefbf61e1c 100644
277 +--- a/arch/s390/kernel/ptrace.c
278 ++++ b/arch/s390/kernel/ptrace.c
279 +@@ -325,6 +325,25 @@ static inline void __poke_user_per(struct task_struct *child,
280 + child->thread.per_user.end = data;
281 + }
282 +
283 ++static void fixup_int_code(struct task_struct *child, addr_t data)
284 ++{
285 ++ struct pt_regs *regs = task_pt_regs(child);
286 ++ int ilc = regs->int_code >> 16;
287 ++ u16 insn;
288 ++
289 ++ if (ilc > 6)
290 ++ return;
291 ++
292 ++ if (ptrace_access_vm(child, regs->psw.addr - (regs->int_code >> 16),
293 ++ &insn, sizeof(insn), FOLL_FORCE) != sizeof(insn))
294 ++ return;
295 ++
296 ++ /* double check that tracee stopped on svc instruction */
297 ++ if ((insn >> 8) != 0xa)
298 ++ return;
299 ++
300 ++ regs->int_code = 0x20000 | (data & 0xffff);
301 ++}
302 + /*
303 + * Write a word to the user area of a process at location addr. This
304 + * operation does have an additional problem compared to peek_user.
305 +@@ -336,7 +355,9 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
306 + struct user *dummy = NULL;
307 + addr_t offset;
308 +
309 ++
310 + if (addr < (addr_t) &dummy->regs.acrs) {
311 ++ struct pt_regs *regs = task_pt_regs(child);
312 + /*
313 + * psw and gprs are stored on the stack
314 + */
315 +@@ -354,7 +375,11 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
316 + /* Invalid addressing mode bits */
317 + return -EINVAL;
318 + }
319 +- *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data;
320 ++
321 ++ if (test_pt_regs_flag(regs, PIF_SYSCALL) &&
322 ++ addr == offsetof(struct user, regs.gprs[2]))
323 ++ fixup_int_code(child, data);
324 ++ *(addr_t *)((addr_t) &regs->psw + addr) = data;
325 +
326 + } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) {
327 + /*
328 +@@ -720,6 +745,10 @@ static int __poke_user_compat(struct task_struct *child,
329 + regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) |
330 + (__u64)(tmp & PSW32_ADDR_AMODE);
331 + } else {
332 ++
333 ++ if (test_pt_regs_flag(regs, PIF_SYSCALL) &&
334 ++ addr == offsetof(struct compat_user, regs.gprs[2]))
335 ++ fixup_int_code(child, data);
336 + /* gpr 0-15 */
337 + *(__u32*)((addr_t) &regs->psw + addr*2 + 4) = tmp;
338 + }
339 +diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
340 +index e8766beee5ad..8ea9db599d38 100644
341 +--- a/arch/s390/kernel/time.c
342 ++++ b/arch/s390/kernel/time.c
343 +@@ -310,6 +310,7 @@ void update_vsyscall(struct timekeeper *tk)
344 +
345 + vdso_data->tk_mult = tk->tkr_mono.mult;
346 + vdso_data->tk_shift = tk->tkr_mono.shift;
347 ++ vdso_data->hrtimer_res = hrtimer_resolution;
348 + smp_wmb();
349 + ++vdso_data->tb_update_count;
350 + }
351 +diff --git a/arch/s390/kernel/vdso64/clock_getres.S b/arch/s390/kernel/vdso64/clock_getres.S
352 +index 081435398e0a..0c79caa32b59 100644
353 +--- a/arch/s390/kernel/vdso64/clock_getres.S
354 ++++ b/arch/s390/kernel/vdso64/clock_getres.S
355 +@@ -17,12 +17,14 @@
356 + .type __kernel_clock_getres,@function
357 + __kernel_clock_getres:
358 + CFI_STARTPROC
359 +- larl %r1,4f
360 ++ larl %r1,3f
361 ++ lg %r0,0(%r1)
362 + cghi %r2,__CLOCK_REALTIME_COARSE
363 + je 0f
364 + cghi %r2,__CLOCK_MONOTONIC_COARSE
365 + je 0f
366 +- larl %r1,3f
367 ++ larl %r1,_vdso_data
368 ++ llgf %r0,__VDSO_CLOCK_REALTIME_RES(%r1)
369 + cghi %r2,__CLOCK_REALTIME
370 + je 0f
371 + cghi %r2,__CLOCK_MONOTONIC
372 +@@ -36,7 +38,6 @@ __kernel_clock_getres:
373 + jz 2f
374 + 0: ltgr %r3,%r3
375 + jz 1f /* res == NULL */
376 +- lg %r0,0(%r1)
377 + xc 0(8,%r3),0(%r3) /* set tp->tv_sec to zero */
378 + stg %r0,8(%r3) /* store tp->tv_usec */
379 + 1: lghi %r2,0
380 +@@ -45,6 +46,5 @@ __kernel_clock_getres:
381 + svc 0
382 + br %r14
383 + CFI_ENDPROC
384 +-3: .quad __CLOCK_REALTIME_RES
385 +-4: .quad __CLOCK_COARSE_RES
386 ++3: .quad __CLOCK_COARSE_RES
387 + .size __kernel_clock_getres,.-__kernel_clock_getres
388 +diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c
389 +index 60f7205ebe40..646dd58169ec 100644
390 +--- a/arch/sparc/kernel/ptrace_32.c
391 ++++ b/arch/sparc/kernel/ptrace_32.c
392 +@@ -168,12 +168,17 @@ static int genregs32_set(struct task_struct *target,
393 + if (ret || !count)
394 + return ret;
395 + ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
396 +- &regs->y,
397 ++ &regs->npc,
398 + 34 * sizeof(u32), 35 * sizeof(u32));
399 + if (ret || !count)
400 + return ret;
401 ++ ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
402 ++ &regs->y,
403 ++ 35 * sizeof(u32), 36 * sizeof(u32));
404 ++ if (ret || !count)
405 ++ return ret;
406 + return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
407 +- 35 * sizeof(u32), 38 * sizeof(u32));
408 ++ 36 * sizeof(u32), 38 * sizeof(u32));
409 + }
410 +
411 + static int fpregs32_get(struct task_struct *target,
412 +diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
413 +index 33136395db8f..ce7b3b22ae86 100644
414 +--- a/arch/x86/include/asm/kvm_host.h
415 ++++ b/arch/x86/include/asm/kvm_host.h
416 +@@ -1099,7 +1099,7 @@ struct kvm_x86_ops {
417 + void (*enable_log_dirty_pt_masked)(struct kvm *kvm,
418 + struct kvm_memory_slot *slot,
419 + gfn_t offset, unsigned long mask);
420 +- int (*write_log_dirty)(struct kvm_vcpu *vcpu);
421 ++ int (*write_log_dirty)(struct kvm_vcpu *vcpu, gpa_t l2_gpa);
422 +
423 + /* pmu operations of sub-arch */
424 + const struct kvm_pmu_ops *pmu_ops;
425 +diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
426 +index cea7e01a346d..e62e416dd116 100644
427 +--- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
428 ++++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c
429 +@@ -1035,6 +1035,7 @@ static int rdt_cdp_peer_get(struct rdt_resource *r, struct rdt_domain *d,
430 + _d_cdp = rdt_find_domain(_r_cdp, d->id, NULL);
431 + if (WARN_ON(IS_ERR_OR_NULL(_d_cdp))) {
432 + _r_cdp = NULL;
433 ++ _d_cdp = NULL;
434 + ret = -EINVAL;
435 + }
436 +
437 +diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
438 +index 0679303e5f3d..712bc103ef3a 100644
439 +--- a/arch/x86/kvm/mmu.c
440 ++++ b/arch/x86/kvm/mmu.c
441 +@@ -1732,10 +1732,10 @@ void kvm_arch_mmu_enable_log_dirty_pt_masked(struct kvm *kvm,
442 + * Emulate arch specific page modification logging for the
443 + * nested hypervisor
444 + */
445 +-int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu)
446 ++int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu, gpa_t l2_gpa)
447 + {
448 + if (kvm_x86_ops->write_log_dirty)
449 +- return kvm_x86_ops->write_log_dirty(vcpu);
450 ++ return kvm_x86_ops->write_log_dirty(vcpu, l2_gpa);
451 +
452 + return 0;
453 + }
454 +diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h
455 +index f7b2de7b6382..0b62c817f63f 100644
456 +--- a/arch/x86/kvm/mmu.h
457 ++++ b/arch/x86/kvm/mmu.h
458 +@@ -215,7 +215,7 @@ void kvm_mmu_gfn_disallow_lpage(struct kvm_memory_slot *slot, gfn_t gfn);
459 + void kvm_mmu_gfn_allow_lpage(struct kvm_memory_slot *slot, gfn_t gfn);
460 + bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm,
461 + struct kvm_memory_slot *slot, u64 gfn);
462 +-int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu);
463 ++int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu, gpa_t l2_gpa);
464 +
465 + int kvm_mmu_post_init_vm(struct kvm *kvm);
466 + void kvm_mmu_pre_destroy_vm(struct kvm *kvm);
467 +diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
468 +index 61f10a4fd807..8220190b0605 100644
469 +--- a/arch/x86/kvm/paging_tmpl.h
470 ++++ b/arch/x86/kvm/paging_tmpl.h
471 +@@ -202,7 +202,7 @@ static inline unsigned FNAME(gpte_access)(u64 gpte)
472 + static int FNAME(update_accessed_dirty_bits)(struct kvm_vcpu *vcpu,
473 + struct kvm_mmu *mmu,
474 + struct guest_walker *walker,
475 +- int write_fault)
476 ++ gpa_t addr, int write_fault)
477 + {
478 + unsigned level, index;
479 + pt_element_t pte, orig_pte;
480 +@@ -227,7 +227,7 @@ static int FNAME(update_accessed_dirty_bits)(struct kvm_vcpu *vcpu,
481 + !(pte & PT_GUEST_DIRTY_MASK)) {
482 + trace_kvm_mmu_set_dirty_bit(table_gfn, index, sizeof(pte));
483 + #if PTTYPE == PTTYPE_EPT
484 +- if (kvm_arch_write_log_dirty(vcpu))
485 ++ if (kvm_arch_write_log_dirty(vcpu, addr))
486 + return -EINVAL;
487 + #endif
488 + pte |= PT_GUEST_DIRTY_MASK;
489 +@@ -424,7 +424,8 @@ retry_walk:
490 + (PT_GUEST_DIRTY_SHIFT - PT_GUEST_ACCESSED_SHIFT);
491 +
492 + if (unlikely(!accessed_dirty)) {
493 +- ret = FNAME(update_accessed_dirty_bits)(vcpu, mmu, walker, write_fault);
494 ++ ret = FNAME(update_accessed_dirty_bits)(vcpu, mmu, walker,
495 ++ addr, write_fault);
496 + if (unlikely(ret < 0))
497 + goto error;
498 + else if (ret)
499 +diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
500 +index 2c4baff7553b..f90a9d4d1641 100644
501 +--- a/arch/x86/kvm/vmx.c
502 ++++ b/arch/x86/kvm/vmx.c
503 +@@ -13845,11 +13845,10 @@ static void vmx_flush_log_dirty(struct kvm *kvm)
504 + kvm_flush_pml_buffers(kvm);
505 + }
506 +
507 +-static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu)
508 ++static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu, gpa_t gpa)
509 + {
510 + struct vmcs12 *vmcs12;
511 + struct vcpu_vmx *vmx = to_vmx(vcpu);
512 +- gpa_t gpa;
513 + struct page *page = NULL;
514 + u64 *pml_address;
515 +
516 +@@ -13870,7 +13869,7 @@ static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu)
517 + return 1;
518 + }
519 +
520 +- gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS) & ~0xFFFull;
521 ++ gpa &= ~0xFFFull;
522 +
523 + page = kvm_vcpu_gpa_to_page(vcpu, vmcs12->pml_address);
524 + if (is_error_page(page))
525 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
526 +index 50d59ad34619..0aa5c4134b90 100644
527 +--- a/arch/x86/kvm/x86.c
528 ++++ b/arch/x86/kvm/x86.c
529 +@@ -2499,7 +2499,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
530 + return kvm_mtrr_set_msr(vcpu, msr, data);
531 + case MSR_IA32_APICBASE:
532 + return kvm_set_apic_base(vcpu, msr_info);
533 +- case APIC_BASE_MSR ... APIC_BASE_MSR + 0x3ff:
534 ++ case APIC_BASE_MSR ... APIC_BASE_MSR + 0xff:
535 + return kvm_x2apic_msr_write(vcpu, msr, data);
536 + case MSR_IA32_TSCDEADLINE:
537 + kvm_set_lapic_tscdeadline_msr(vcpu, data);
538 +@@ -2797,7 +2797,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
539 + case MSR_IA32_APICBASE:
540 + msr_info->data = kvm_get_apic_base(vcpu);
541 + break;
542 +- case APIC_BASE_MSR ... APIC_BASE_MSR + 0x3ff:
543 ++ case APIC_BASE_MSR ... APIC_BASE_MSR + 0xff:
544 + return kvm_x2apic_msr_read(vcpu, msr_info->index, &msr_info->data);
545 + break;
546 + case MSR_IA32_TSCDEADLINE:
547 +diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c
548 +index 9c5606d88f61..7077b3e28241 100644
549 +--- a/arch/x86/lib/usercopy_64.c
550 ++++ b/arch/x86/lib/usercopy_64.c
551 +@@ -23,6 +23,7 @@ unsigned long __clear_user(void __user *addr, unsigned long size)
552 + asm volatile(
553 + " testq %[size8],%[size8]\n"
554 + " jz 4f\n"
555 ++ " .align 16\n"
556 + "0: movq $0,(%[dst])\n"
557 + " addq $8,%[dst]\n"
558 + " decl %%ecx ; jnz 0b\n"
559 +diff --git a/block/bio-integrity.c b/block/bio-integrity.c
560 +index 5bd90cd4b51e..a059fad53f1b 100644
561 +--- a/block/bio-integrity.c
562 ++++ b/block/bio-integrity.c
563 +@@ -293,7 +293,6 @@ bool bio_integrity_prep(struct bio *bio)
564 +
565 + if (ret == 0) {
566 + printk(KERN_ERR "could not attach integrity payload\n");
567 +- kfree(buf);
568 + status = BLK_STS_RESOURCE;
569 + goto err_end_io;
570 + }
571 +diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
572 +index 0a8eb8961770..39ee0ca636aa 100644
573 +--- a/drivers/acpi/sysfs.c
574 ++++ b/drivers/acpi/sysfs.c
575 +@@ -935,13 +935,13 @@ static void __exit interrupt_stats_exit(void)
576 + }
577 +
578 + static ssize_t
579 +-acpi_show_profile(struct device *dev, struct device_attribute *attr,
580 ++acpi_show_profile(struct kobject *kobj, struct kobj_attribute *attr,
581 + char *buf)
582 + {
583 + return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile);
584 + }
585 +
586 +-static const struct device_attribute pm_profile_attr =
587 ++static const struct kobj_attribute pm_profile_attr =
588 + __ATTR(pm_profile, S_IRUGO, acpi_show_profile, NULL);
589 +
590 + static ssize_t hotplug_enabled_show(struct kobject *kobj,
591 +diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
592 +index 0c1572a1cc5e..6c2c2b07f029 100644
593 +--- a/drivers/ata/libata-scsi.c
594 ++++ b/drivers/ata/libata-scsi.c
595 +@@ -3995,12 +3995,13 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
596 + {
597 + struct scsi_cmnd *scmd = qc->scsicmd;
598 + const u8 *cdb = scmd->cmnd;
599 +- const u8 *p;
600 + u8 pg, spg;
601 + unsigned six_byte, pg_len, hdr_len, bd_len;
602 + int len;
603 + u16 fp = (u16)-1;
604 + u8 bp = 0xff;
605 ++ u8 buffer[64];
606 ++ const u8 *p = buffer;
607 +
608 + VPRINTK("ENTER\n");
609 +
610 +@@ -4034,12 +4035,14 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
611 + if (!scsi_sg_count(scmd) || scsi_sglist(scmd)->length < len)
612 + goto invalid_param_len;
613 +
614 +- p = page_address(sg_page(scsi_sglist(scmd)));
615 +-
616 + /* Move past header and block descriptors. */
617 + if (len < hdr_len)
618 + goto invalid_param_len;
619 +
620 ++ if (!sg_copy_to_buffer(scsi_sglist(scmd), scsi_sg_count(scmd),
621 ++ buffer, sizeof(buffer)))
622 ++ goto invalid_param_len;
623 ++
624 + if (six_byte)
625 + bd_len = p[3];
626 + else
627 +diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
628 +index 03867f539f3a..50ebd779d975 100644
629 +--- a/drivers/ata/sata_rcar.c
630 ++++ b/drivers/ata/sata_rcar.c
631 +@@ -909,7 +909,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
632 + pm_runtime_enable(dev);
633 + ret = pm_runtime_get_sync(dev);
634 + if (ret < 0)
635 +- goto err_pm_disable;
636 ++ goto err_pm_put;
637 +
638 + host = ata_host_alloc(dev, 1);
639 + if (!host) {
640 +@@ -940,7 +940,6 @@ static int sata_rcar_probe(struct platform_device *pdev)
641 +
642 + err_pm_put:
643 + pm_runtime_put(dev);
644 +-err_pm_disable:
645 + pm_runtime_disable(dev);
646 + return ret;
647 + }
648 +@@ -994,8 +993,10 @@ static int sata_rcar_resume(struct device *dev)
649 + int ret;
650 +
651 + ret = pm_runtime_get_sync(dev);
652 +- if (ret < 0)
653 ++ if (ret < 0) {
654 ++ pm_runtime_put(dev);
655 + return ret;
656 ++ }
657 +
658 + if (priv->type == RCAR_GEN3_SATA) {
659 + sata_rcar_init_module(priv);
660 +@@ -1020,8 +1021,10 @@ static int sata_rcar_restore(struct device *dev)
661 + int ret;
662 +
663 + ret = pm_runtime_get_sync(dev);
664 +- if (ret < 0)
665 ++ if (ret < 0) {
666 ++ pm_runtime_put(dev);
667 + return ret;
668 ++ }
669 +
670 + sata_rcar_setup_port(host);
671 +
672 +diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
673 +index 6c9f6988bc09..b38b2d8c333d 100644
674 +--- a/drivers/base/regmap/regmap.c
675 ++++ b/drivers/base/regmap/regmap.c
676 +@@ -1336,6 +1336,7 @@ void regmap_exit(struct regmap *map)
677 + if (map->hwlock)
678 + hwspin_lock_free(map->hwlock);
679 + kfree_const(map->name);
680 ++ kfree(map->patch);
681 + kfree(map);
682 + }
683 + EXPORT_SYMBOL_GPL(regmap_exit);
684 +diff --git a/drivers/block/loop.c b/drivers/block/loop.c
685 +index c1341c86bcde..728681a20b7f 100644
686 +--- a/drivers/block/loop.c
687 ++++ b/drivers/block/loop.c
688 +@@ -1238,7 +1238,7 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
689 + if (lo->lo_offset != info->lo_offset ||
690 + lo->lo_sizelimit != info->lo_sizelimit) {
691 + sync_blockdev(lo->lo_device);
692 +- kill_bdev(lo->lo_device);
693 ++ invalidate_bdev(lo->lo_device);
694 + }
695 +
696 + /* I/O need to be drained during transfer transition */
697 +@@ -1512,12 +1512,12 @@ static int loop_set_block_size(struct loop_device *lo, unsigned long arg)
698 +
699 + if (lo->lo_queue->limits.logical_block_size != arg) {
700 + sync_blockdev(lo->lo_device);
701 +- kill_bdev(lo->lo_device);
702 ++ invalidate_bdev(lo->lo_device);
703 + }
704 +
705 + blk_mq_freeze_queue(lo->lo_queue);
706 +
707 +- /* kill_bdev should have truncated all the pages */
708 ++ /* invalidate_bdev should have truncated all the pages */
709 + if (lo->lo_queue->limits.logical_block_size != arg &&
710 + lo->lo_device->bd_inode->i_mapping->nrpages) {
711 + err = -EAGAIN;
712 +diff --git a/drivers/char/hw_random/ks-sa-rng.c b/drivers/char/hw_random/ks-sa-rng.c
713 +index 62c6696c1dbd..b6d7db362b21 100644
714 +--- a/drivers/char/hw_random/ks-sa-rng.c
715 ++++ b/drivers/char/hw_random/ks-sa-rng.c
716 +@@ -216,6 +216,7 @@ static int ks_sa_rng_probe(struct platform_device *pdev)
717 + ret = pm_runtime_get_sync(dev);
718 + if (ret < 0) {
719 + dev_err(dev, "Failed to enable SA power-domain\n");
720 ++ pm_runtime_put_noidle(dev);
721 + pm_runtime_disable(dev);
722 + return ret;
723 + }
724 +diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
725 +index 05d6f9c86ac3..268ada29cd98 100644
726 +--- a/drivers/edac/amd64_edac.c
727 ++++ b/drivers/edac/amd64_edac.c
728 +@@ -2209,6 +2209,15 @@ static struct amd64_family_type family_types[] = {
729 + .dbam_to_cs = f17_base_addr_to_cs_size,
730 + }
731 + },
732 ++ [F17_M30H_CPUS] = {
733 ++ .ctl_name = "F17h_M30h",
734 ++ .f0_id = PCI_DEVICE_ID_AMD_17H_M30H_DF_F0,
735 ++ .f6_id = PCI_DEVICE_ID_AMD_17H_M30H_DF_F6,
736 ++ .ops = {
737 ++ .early_channel_count = f17_early_channel_count,
738 ++ .dbam_to_cs = f17_base_addr_to_cs_size,
739 ++ }
740 ++ },
741 + };
742 +
743 + /*
744 +@@ -3212,6 +3221,10 @@ static struct amd64_family_type *per_family_init(struct amd64_pvt *pvt)
745 + fam_type = &family_types[F17_M10H_CPUS];
746 + pvt->ops = &family_types[F17_M10H_CPUS].ops;
747 + break;
748 ++ } else if (pvt->model >= 0x30 && pvt->model <= 0x3f) {
749 ++ fam_type = &family_types[F17_M30H_CPUS];
750 ++ pvt->ops = &family_types[F17_M30H_CPUS].ops;
751 ++ break;
752 + }
753 + fam_type = &family_types[F17_CPUS];
754 + pvt->ops = &family_types[F17_CPUS].ops;
755 +diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
756 +index 4242f8e39c18..de8dbb0b42b5 100644
757 +--- a/drivers/edac/amd64_edac.h
758 ++++ b/drivers/edac/amd64_edac.h
759 +@@ -117,6 +117,8 @@
760 + #define PCI_DEVICE_ID_AMD_17H_DF_F6 0x1466
761 + #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F0 0x15e8
762 + #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F6 0x15ee
763 ++#define PCI_DEVICE_ID_AMD_17H_M30H_DF_F0 0x1490
764 ++#define PCI_DEVICE_ID_AMD_17H_M30H_DF_F6 0x1496
765 +
766 + /*
767 + * Function 1 - Address Map
768 +@@ -284,6 +286,7 @@ enum amd_families {
769 + F16_M30H_CPUS,
770 + F17_CPUS,
771 + F17_M10H_CPUS,
772 ++ F17_M30H_CPUS,
773 + NUM_FAMILIES,
774 + };
775 +
776 +diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c
777 +index 5d06bd247d07..2f6204b2fdd3 100644
778 +--- a/drivers/firmware/efi/esrt.c
779 ++++ b/drivers/firmware/efi/esrt.c
780 +@@ -180,7 +180,7 @@ static int esre_create_sysfs_entry(void *esre, int entry_num)
781 + rc = kobject_init_and_add(&entry->kobj, &esre1_ktype, NULL,
782 + "entry%d", entry_num);
783 + if (rc) {
784 +- kfree(entry);
785 ++ kobject_put(&entry->kobj);
786 + return rc;
787 + }
788 + }
789 +diff --git a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
790 +index 962900932bee..11ea1a0e629b 100644
791 +--- a/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
792 ++++ b/drivers/gpu/drm/amd/display/modules/color/color_gamma.c
793 +@@ -1561,7 +1561,7 @@ bool calculate_user_regamma_ramp(struct dc_transfer_func *output_tf,
794 +
795 + kfree(rgb_regamma);
796 + rgb_regamma_alloc_fail:
797 +- kvfree(rgb_user);
798 ++ kfree(rgb_user);
799 + rgb_user_alloc_fail:
800 + return ret;
801 + }
802 +diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
803 +index 0fd8d6ba9828..f86ca163dcf3 100644
804 +--- a/drivers/gpu/drm/radeon/ni_dpm.c
805 ++++ b/drivers/gpu/drm/radeon/ni_dpm.c
806 +@@ -2126,7 +2126,7 @@ static int ni_init_smc_spll_table(struct radeon_device *rdev)
807 + if (clk_s & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_SHIFT))
808 + ret = -EINVAL;
809 +
810 +- if (clk_s & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_SHIFT))
811 ++ if (fb_div & ~(SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_SHIFT))
812 + ret = -EINVAL;
813 +
814 + if (clk_v & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_SHIFT))
815 +diff --git a/drivers/gpu/drm/rcar-du/Kconfig b/drivers/gpu/drm/rcar-du/Kconfig
816 +index edde8d4b87a3..ddda84cdeb47 100644
817 +--- a/drivers/gpu/drm/rcar-du/Kconfig
818 ++++ b/drivers/gpu/drm/rcar-du/Kconfig
819 +@@ -21,6 +21,7 @@ config DRM_RCAR_DW_HDMI
820 + config DRM_RCAR_LVDS
821 + tristate "R-Car DU LVDS Encoder Support"
822 + depends on DRM && DRM_BRIDGE && OF
823 ++ select DRM_KMS_HELPER
824 + select DRM_PANEL
825 + select OF_FLATTREE
826 + select OF_OVERLAY
827 +diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
828 +index 1e2be2219a60..46aef609fb70 100644
829 +--- a/drivers/i2c/busses/i2c-fsi.c
830 ++++ b/drivers/i2c/busses/i2c-fsi.c
831 +@@ -98,7 +98,7 @@
832 + #define I2C_STAT_DAT_REQ BIT(25)
833 + #define I2C_STAT_CMD_COMP BIT(24)
834 + #define I2C_STAT_STOP_ERR BIT(23)
835 +-#define I2C_STAT_MAX_PORT GENMASK(19, 16)
836 ++#define I2C_STAT_MAX_PORT GENMASK(22, 16)
837 + #define I2C_STAT_ANY_INT BIT(15)
838 + #define I2C_STAT_SCL_IN BIT(11)
839 + #define I2C_STAT_SDA_IN BIT(10)
840 +diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
841 +index 47d196c026ba..af06198851f1 100644
842 +--- a/drivers/i2c/busses/i2c-tegra.c
843 ++++ b/drivers/i2c/busses/i2c-tegra.c
844 +@@ -145,8 +145,8 @@ enum msg_end_type {
845 + * @has_continue_xfer_support: Continue transfer supports.
846 + * @has_per_pkt_xfer_complete_irq: Has enable/disable capability for transfer
847 + * complete interrupt per packet basis.
848 +- * @has_single_clk_source: The i2c controller has single clock source. Tegra30
849 +- * and earlier Socs has two clock sources i.e. div-clk and
850 ++ * @has_single_clk_source: The I2C controller has single clock source. Tegra30
851 ++ * and earlier SoCs have two clock sources i.e. div-clk and
852 + * fast-clk.
853 + * @has_config_load_reg: Has the config load register to load the new
854 + * configuration.
855 +@@ -154,8 +154,19 @@ enum msg_end_type {
856 + * @clk_divisor_std_fast_mode: Clock divisor in standard/fast mode. It is
857 + * applicable if there is no fast clock source i.e. single clock
858 + * source.
859 ++ * @clk_divisor_fast_plus_mode: Clock divisor in fast mode plus. It is
860 ++ * applicable if there is no fast clock source (i.e. single
861 ++ * clock source).
862 ++ * @has_multi_master_mode: The I2C controller supports running in single-master
863 ++ * or multi-master mode.
864 ++ * @has_slcg_override_reg: The I2C controller supports a register that
865 ++ * overrides the second level clock gating.
866 ++ * @has_mst_fifo: The I2C controller contains the new MST FIFO interface that
867 ++ * provides additional features and allows for longer messages to
868 ++ * be transferred in one go.
869 ++ * @quirks: i2c adapter quirks for limiting write/read transfer size and not
870 ++ * allowing 0 length transfers.
871 + */
872 +-
873 + struct tegra_i2c_hw_feature {
874 + bool has_continue_xfer_support;
875 + bool has_per_pkt_xfer_complete_irq;
876 +@@ -167,25 +178,31 @@ struct tegra_i2c_hw_feature {
877 + bool has_multi_master_mode;
878 + bool has_slcg_override_reg;
879 + bool has_mst_fifo;
880 ++ const struct i2c_adapter_quirks *quirks;
881 + };
882 +
883 + /**
884 +- * struct tegra_i2c_dev - per device i2c context
885 ++ * struct tegra_i2c_dev - per device I2C context
886 + * @dev: device reference for power management
887 +- * @hw: Tegra i2c hw feature.
888 +- * @adapter: core i2c layer adapter information
889 +- * @div_clk: clock reference for div clock of i2c controller.
890 +- * @fast_clk: clock reference for fast clock of i2c controller.
891 ++ * @hw: Tegra I2C HW feature
892 ++ * @adapter: core I2C layer adapter information
893 ++ * @div_clk: clock reference for div clock of I2C controller
894 ++ * @fast_clk: clock reference for fast clock of I2C controller
895 ++ * @rst: reset control for the I2C controller
896 + * @base: ioremapped registers cookie
897 +- * @cont_id: i2c controller id, used for for packet header
898 +- * @irq: irq number of transfer complete interrupt
899 +- * @is_dvc: identifies the DVC i2c controller, has a different register layout
900 ++ * @cont_id: I2C controller ID, used for packet header
901 ++ * @irq: IRQ number of transfer complete interrupt
902 ++ * @irq_disabled: used to track whether or not the interrupt is enabled
903 ++ * @is_dvc: identifies the DVC I2C controller, has a different register layout
904 + * @msg_complete: transfer completion notifier
905 + * @msg_err: error code for completed message
906 + * @msg_buf: pointer to current message data
907 + * @msg_buf_remaining: size of unsent data in the message buffer
908 + * @msg_read: identifies read transfers
909 +- * @bus_clk_rate: current i2c bus clock rate
910 ++ * @bus_clk_rate: current I2C bus clock rate
911 ++ * @clk_divisor_non_hs_mode: clock divider for non-high-speed modes
912 ++ * @is_multimaster_mode: track if I2C controller is in multi-master mode
913 ++ * @xfer_lock: lock to serialize transfer submission and processing
914 + */
915 + struct tegra_i2c_dev {
916 + struct device *dev;
917 +@@ -833,6 +850,10 @@ static const struct i2c_adapter_quirks tegra_i2c_quirks = {
918 + .max_write_len = 4096 - 12,
919 + };
920 +
921 ++static const struct i2c_adapter_quirks tegra194_i2c_quirks = {
922 ++ .flags = I2C_AQ_NO_ZERO_LEN,
923 ++};
924 ++
925 + static const struct tegra_i2c_hw_feature tegra20_i2c_hw = {
926 + .has_continue_xfer_support = false,
927 + .has_per_pkt_xfer_complete_irq = false,
928 +@@ -844,6 +865,7 @@ static const struct tegra_i2c_hw_feature tegra20_i2c_hw = {
929 + .has_multi_master_mode = false,
930 + .has_slcg_override_reg = false,
931 + .has_mst_fifo = false,
932 ++ .quirks = &tegra_i2c_quirks,
933 + };
934 +
935 + static const struct tegra_i2c_hw_feature tegra30_i2c_hw = {
936 +@@ -857,6 +879,7 @@ static const struct tegra_i2c_hw_feature tegra30_i2c_hw = {
937 + .has_multi_master_mode = false,
938 + .has_slcg_override_reg = false,
939 + .has_mst_fifo = false,
940 ++ .quirks = &tegra_i2c_quirks,
941 + };
942 +
943 + static const struct tegra_i2c_hw_feature tegra114_i2c_hw = {
944 +@@ -870,6 +893,7 @@ static const struct tegra_i2c_hw_feature tegra114_i2c_hw = {
945 + .has_multi_master_mode = false,
946 + .has_slcg_override_reg = false,
947 + .has_mst_fifo = false,
948 ++ .quirks = &tegra_i2c_quirks,
949 + };
950 +
951 + static const struct tegra_i2c_hw_feature tegra124_i2c_hw = {
952 +@@ -883,6 +907,7 @@ static const struct tegra_i2c_hw_feature tegra124_i2c_hw = {
953 + .has_multi_master_mode = false,
954 + .has_slcg_override_reg = true,
955 + .has_mst_fifo = false,
956 ++ .quirks = &tegra_i2c_quirks,
957 + };
958 +
959 + static const struct tegra_i2c_hw_feature tegra210_i2c_hw = {
960 +@@ -896,6 +921,7 @@ static const struct tegra_i2c_hw_feature tegra210_i2c_hw = {
961 + .has_multi_master_mode = true,
962 + .has_slcg_override_reg = true,
963 + .has_mst_fifo = false,
964 ++ .quirks = &tegra_i2c_quirks,
965 + };
966 +
967 + static const struct tegra_i2c_hw_feature tegra194_i2c_hw = {
968 +@@ -909,6 +935,7 @@ static const struct tegra_i2c_hw_feature tegra194_i2c_hw = {
969 + .has_multi_master_mode = true,
970 + .has_slcg_override_reg = true,
971 + .has_mst_fifo = true,
972 ++ .quirks = &tegra194_i2c_quirks,
973 + };
974 +
975 + /* Match table for of_platform binding */
976 +@@ -960,7 +987,6 @@ static int tegra_i2c_probe(struct platform_device *pdev)
977 + i2c_dev->base = base;
978 + i2c_dev->div_clk = div_clk;
979 + i2c_dev->adapter.algo = &tegra_i2c_algo;
980 +- i2c_dev->adapter.quirks = &tegra_i2c_quirks;
981 + i2c_dev->irq = irq;
982 + i2c_dev->cont_id = pdev->id;
983 + i2c_dev->dev = &pdev->dev;
984 +@@ -976,6 +1002,7 @@ static int tegra_i2c_probe(struct platform_device *pdev)
985 + i2c_dev->hw = of_device_get_match_data(&pdev->dev);
986 + i2c_dev->is_dvc = of_device_is_compatible(pdev->dev.of_node,
987 + "nvidia,tegra20-i2c-dvc");
988 ++ i2c_dev->adapter.quirks = i2c_dev->hw->quirks;
989 + init_completion(&i2c_dev->msg_complete);
990 + spin_lock_init(&i2c_dev->xfer_lock);
991 +
992 +diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c
993 +index 9cd66cabb84f..8d6fad05b0c7 100644
994 +--- a/drivers/i2c/i2c-core-smbus.c
995 ++++ b/drivers/i2c/i2c-core-smbus.c
996 +@@ -497,6 +497,13 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr,
997 + break;
998 + case I2C_SMBUS_BLOCK_DATA:
999 + case I2C_SMBUS_BLOCK_PROC_CALL:
1000 ++ if (msg[1].buf[0] > I2C_SMBUS_BLOCK_MAX) {
1001 ++ dev_err(&adapter->dev,
1002 ++ "Invalid block size returned: %d\n",
1003 ++ msg[1].buf[0]);
1004 ++ status = -EPROTO;
1005 ++ goto cleanup;
1006 ++ }
1007 + for (i = 0; i < msg[1].buf[0] + 1; i++)
1008 + data->block[i] = msg[1].buf[i];
1009 + break;
1010 +diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
1011 +index 5c03f4701ece..1f14cd4ce3db 100644
1012 +--- a/drivers/infiniband/core/cma.c
1013 ++++ b/drivers/infiniband/core/cma.c
1014 +@@ -1507,6 +1507,8 @@ static struct rdma_id_private *cma_find_listener(
1015 + {
1016 + struct rdma_id_private *id_priv, *id_priv_dev;
1017 +
1018 ++ lockdep_assert_held(&lock);
1019 ++
1020 + if (!bind_list)
1021 + return ERR_PTR(-EINVAL);
1022 +
1023 +@@ -1552,6 +1554,7 @@ cma_ib_id_from_event(struct ib_cm_id *cm_id,
1024 + }
1025 + }
1026 +
1027 ++ mutex_lock(&lock);
1028 + /*
1029 + * Net namespace might be getting deleted while route lookup,
1030 + * cm_id lookup is in progress. Therefore, perform netdevice
1031 +@@ -1593,6 +1596,7 @@ cma_ib_id_from_event(struct ib_cm_id *cm_id,
1032 + id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev);
1033 + err:
1034 + rcu_read_unlock();
1035 ++ mutex_unlock(&lock);
1036 + if (IS_ERR(id_priv) && *net_dev) {
1037 + dev_put(*net_dev);
1038 + *net_dev = NULL;
1039 +@@ -2346,6 +2350,8 @@ static void cma_listen_on_dev(struct rdma_id_private *id_priv,
1040 + struct net *net = id_priv->id.route.addr.dev_addr.net;
1041 + int ret;
1042 +
1043 ++ lockdep_assert_held(&lock);
1044 ++
1045 + if (cma_family(id_priv) == AF_IB && !rdma_cap_ib_cm(cma_dev->device, 1))
1046 + return;
1047 +
1048 +@@ -3081,6 +3087,8 @@ static void cma_bind_port(struct rdma_bind_list *bind_list,
1049 + u64 sid, mask;
1050 + __be16 port;
1051 +
1052 ++ lockdep_assert_held(&lock);
1053 ++
1054 + addr = cma_src_addr(id_priv);
1055 + port = htons(bind_list->port);
1056 +
1057 +@@ -3109,6 +3117,8 @@ static int cma_alloc_port(enum rdma_ucm_port_space ps,
1058 + struct rdma_bind_list *bind_list;
1059 + int ret;
1060 +
1061 ++ lockdep_assert_held(&lock);
1062 ++
1063 + bind_list = kzalloc(sizeof *bind_list, GFP_KERNEL);
1064 + if (!bind_list)
1065 + return -ENOMEM;
1066 +@@ -3135,6 +3145,8 @@ static int cma_port_is_unique(struct rdma_bind_list *bind_list,
1067 + struct sockaddr *saddr = cma_src_addr(id_priv);
1068 + __be16 dport = cma_port(daddr);
1069 +
1070 ++ lockdep_assert_held(&lock);
1071 ++
1072 + hlist_for_each_entry(cur_id, &bind_list->owners, node) {
1073 + struct sockaddr *cur_daddr = cma_dst_addr(cur_id);
1074 + struct sockaddr *cur_saddr = cma_src_addr(cur_id);
1075 +@@ -3174,6 +3186,8 @@ static int cma_alloc_any_port(enum rdma_ucm_port_space ps,
1076 + unsigned int rover;
1077 + struct net *net = id_priv->id.route.addr.dev_addr.net;
1078 +
1079 ++ lockdep_assert_held(&lock);
1080 ++
1081 + inet_get_local_port_range(net, &low, &high);
1082 + remaining = (high - low) + 1;
1083 + rover = prandom_u32() % remaining + low;
1084 +@@ -3221,6 +3235,8 @@ static int cma_check_port(struct rdma_bind_list *bind_list,
1085 + struct rdma_id_private *cur_id;
1086 + struct sockaddr *addr, *cur_addr;
1087 +
1088 ++ lockdep_assert_held(&lock);
1089 ++
1090 + addr = cma_src_addr(id_priv);
1091 + hlist_for_each_entry(cur_id, &bind_list->owners, node) {
1092 + if (id_priv == cur_id)
1093 +@@ -3251,6 +3267,8 @@ static int cma_use_port(enum rdma_ucm_port_space ps,
1094 + unsigned short snum;
1095 + int ret;
1096 +
1097 ++ lockdep_assert_held(&lock);
1098 ++
1099 + snum = ntohs(cma_port(cma_src_addr(id_priv)));
1100 + if (snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE))
1101 + return -EACCES;
1102 +diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
1103 +index 218411282069..a36b3b4f5c0a 100644
1104 +--- a/drivers/infiniband/core/mad.c
1105 ++++ b/drivers/infiniband/core/mad.c
1106 +@@ -615,10 +615,10 @@ static void unregister_mad_agent(struct ib_mad_agent_private *mad_agent_priv)
1107 + idr_unlock(&ib_mad_clients);
1108 +
1109 + flush_workqueue(port_priv->wq);
1110 +- ib_cancel_rmpp_recvs(mad_agent_priv);
1111 +
1112 + deref_mad_agent(mad_agent_priv);
1113 + wait_for_completion(&mad_agent_priv->comp);
1114 ++ ib_cancel_rmpp_recvs(mad_agent_priv);
1115 +
1116 + ib_mad_agent_security_cleanup(&mad_agent_priv->agent);
1117 +
1118 +@@ -2920,6 +2920,7 @@ static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info,
1119 + DMA_FROM_DEVICE);
1120 + if (unlikely(ib_dma_mapping_error(qp_info->port_priv->device,
1121 + sg_list.addr))) {
1122 ++ kfree(mad_priv);
1123 + ret = -ENOMEM;
1124 + break;
1125 + }
1126 +diff --git a/drivers/infiniband/hw/qedr/qedr_iw_cm.c b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
1127 +index 93b16237b767..256671577367 100644
1128 +--- a/drivers/infiniband/hw/qedr/qedr_iw_cm.c
1129 ++++ b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
1130 +@@ -128,8 +128,17 @@ qedr_iw_issue_event(void *context,
1131 + if (params->cm_info) {
1132 + event.ird = params->cm_info->ird;
1133 + event.ord = params->cm_info->ord;
1134 +- event.private_data_len = params->cm_info->private_data_len;
1135 +- event.private_data = (void *)params->cm_info->private_data;
1136 ++ /* Only connect_request and reply have valid private data
1137 ++ * the rest of the events this may be left overs from
1138 ++ * connection establishment. CONNECT_REQUEST is issued via
1139 ++ * qedr_iw_mpa_request
1140 ++ */
1141 ++ if (event_type == IW_CM_EVENT_CONNECT_REPLY) {
1142 ++ event.private_data_len =
1143 ++ params->cm_info->private_data_len;
1144 ++ event.private_data =
1145 ++ (void *)params->cm_info->private_data;
1146 ++ }
1147 + }
1148 +
1149 + if (ep->cm_id)
1150 +diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
1151 +index 4321c48eba6b..cc028353f9d5 100644
1152 +--- a/drivers/md/dm-writecache.c
1153 ++++ b/drivers/md/dm-writecache.c
1154 +@@ -281,6 +281,8 @@ static int persistent_memory_claim(struct dm_writecache *wc)
1155 + while (daa-- && i < p) {
1156 + pages[i++] = pfn_t_to_page(pfn);
1157 + pfn.val++;
1158 ++ if (!(i & 15))
1159 ++ cond_resched();
1160 + }
1161 + } while (i < p);
1162 + wc->memory_map = vmap(pages, p, VM_MAP, PAGE_KERNEL);
1163 +@@ -811,6 +813,8 @@ static void writecache_discard(struct dm_writecache *wc, sector_t start, sector_
1164 + writecache_wait_for_ios(wc, WRITE);
1165 + discarded_something = true;
1166 + }
1167 ++ if (!writecache_entry_is_committed(wc, e))
1168 ++ wc->uncommitted_blocks--;
1169 + writecache_free_entry(wc, e);
1170 + }
1171 +
1172 +diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c
1173 +index 3e542224dd11..a917bc242c9c 100644
1174 +--- a/drivers/mtd/nand/raw/marvell_nand.c
1175 ++++ b/drivers/mtd/nand/raw/marvell_nand.c
1176 +@@ -637,7 +637,7 @@ static int marvell_nfc_wait_op(struct nand_chip *chip, unsigned int timeout_ms)
1177 + * In case the interrupt was not served in the required time frame,
1178 + * check if the ISR was not served or if something went actually wrong.
1179 + */
1180 +- if (ret && !pending) {
1181 ++ if (!ret && !pending) {
1182 + dev_err(nfc->dev, "Timeout waiting for RB signal\n");
1183 + return -ETIMEDOUT;
1184 + }
1185 +diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
1186 +index 6d3221134927..dd63b993ce7b 100644
1187 +--- a/drivers/net/ethernet/atheros/alx/main.c
1188 ++++ b/drivers/net/ethernet/atheros/alx/main.c
1189 +@@ -1250,8 +1250,12 @@ out_disable_adv_intr:
1190 +
1191 + static void __alx_stop(struct alx_priv *alx)
1192 + {
1193 +- alx_halt(alx);
1194 + alx_free_irq(alx);
1195 ++
1196 ++ cancel_work_sync(&alx->link_check_wk);
1197 ++ cancel_work_sync(&alx->reset_wk);
1198 ++
1199 ++ alx_halt(alx);
1200 + alx_free_rings(alx);
1201 + alx_free_napis(alx);
1202 + }
1203 +@@ -1861,9 +1865,6 @@ static void alx_remove(struct pci_dev *pdev)
1204 + struct alx_priv *alx = pci_get_drvdata(pdev);
1205 + struct alx_hw *hw = &alx->hw;
1206 +
1207 +- cancel_work_sync(&alx->link_check_wk);
1208 +- cancel_work_sync(&alx->reset_wk);
1209 +-
1210 + /* restore permanent mac address */
1211 + alx_set_macaddr(hw, hw->perm_addr);
1212 +
1213 +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
1214 +index 40e8ef984b62..c7667017c1a3 100644
1215 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
1216 ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
1217 +@@ -1593,11 +1593,6 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
1218 + goto out;
1219 + }
1220 +
1221 +- if (skb_padto(skb, ETH_ZLEN)) {
1222 +- ret = NETDEV_TX_OK;
1223 +- goto out;
1224 +- }
1225 +-
1226 + /* Retain how many bytes will be sent on the wire, without TSB inserted
1227 + * by transmit checksum offload
1228 + */
1229 +@@ -1646,6 +1641,9 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
1230 + len_stat = (size << DMA_BUFLENGTH_SHIFT) |
1231 + (priv->hw_params->qtag_mask << DMA_TX_QTAG_SHIFT);
1232 +
1233 ++ /* Note: if we ever change from DMA_TX_APPEND_CRC below we
1234 ++ * will need to restore software padding of "runt" packets
1235 ++ */
1236 + if (!i) {
1237 + len_stat |= DMA_TX_APPEND_CRC | DMA_SOP;
1238 + if (skb->ip_summed == CHECKSUM_PARTIAL)
1239 +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
1240 +index b3596e0ee47b..57582efa362d 100644
1241 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
1242 ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
1243 +@@ -191,10 +191,6 @@ void bcmgenet_wol_power_up_cfg(struct bcmgenet_priv *priv,
1244 + reg &= ~MPD_EN;
1245 + bcmgenet_umac_writel(priv, reg, UMAC_MPD_CTRL);
1246 +
1247 +- reg = bcmgenet_hfb_reg_readl(priv, HFB_CTRL);
1248 +- reg &= ~(RBUF_HFB_EN | RBUF_ACPI_EN);
1249 +- bcmgenet_hfb_reg_writel(priv, reg, HFB_CTRL);
1250 +-
1251 + /* Disable CRC Forward */
1252 + reg = bcmgenet_umac_readl(priv, UMAC_CMD);
1253 + reg &= ~CMD_CRC_FWD;
1254 +diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
1255 +index a12962702611..be845df05039 100644
1256 +--- a/drivers/net/ethernet/broadcom/tg3.c
1257 ++++ b/drivers/net/ethernet/broadcom/tg3.c
1258 +@@ -18229,8 +18229,8 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev,
1259 +
1260 + rtnl_lock();
1261 +
1262 +- /* We probably don't have netdev yet */
1263 +- if (!netdev || !netif_running(netdev))
1264 ++ /* Could be second call or maybe we don't have netdev yet */
1265 ++ if (!netdev || tp->pcierr_recovery || !netif_running(netdev))
1266 + goto done;
1267 +
1268 + /* We needn't recover from permanent error */
1269 +diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
1270 +index 986277744611..08f4780e7fe7 100644
1271 +--- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c
1272 ++++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
1273 +@@ -507,41 +507,20 @@ u64 cxgb4_select_ntuple(struct net_device *dev,
1274 + }
1275 + EXPORT_SYMBOL(cxgb4_select_ntuple);
1276 +
1277 +-/*
1278 +- * Called when address resolution fails for an L2T entry to handle packets
1279 +- * on the arpq head. If a packet specifies a failure handler it is invoked,
1280 +- * otherwise the packet is sent to the device.
1281 +- */
1282 +-static void handle_failed_resolution(struct adapter *adap, struct l2t_entry *e)
1283 +-{
1284 +- struct sk_buff *skb;
1285 +-
1286 +- while ((skb = __skb_dequeue(&e->arpq)) != NULL) {
1287 +- const struct l2t_skb_cb *cb = L2T_SKB_CB(skb);
1288 +-
1289 +- spin_unlock(&e->lock);
1290 +- if (cb->arp_err_handler)
1291 +- cb->arp_err_handler(cb->handle, skb);
1292 +- else
1293 +- t4_ofld_send(adap, skb);
1294 +- spin_lock(&e->lock);
1295 +- }
1296 +-}
1297 +-
1298 + /*
1299 + * Called when the host's neighbor layer makes a change to some entry that is
1300 + * loaded into the HW L2 table.
1301 + */
1302 + void t4_l2t_update(struct adapter *adap, struct neighbour *neigh)
1303 + {
1304 +- struct l2t_entry *e;
1305 +- struct sk_buff_head *arpq = NULL;
1306 +- struct l2t_data *d = adap->l2t;
1307 + unsigned int addr_len = neigh->tbl->key_len;
1308 + u32 *addr = (u32 *) neigh->primary_key;
1309 +- int ifidx = neigh->dev->ifindex;
1310 +- int hash = addr_hash(d, addr, addr_len, ifidx);
1311 ++ int hash, ifidx = neigh->dev->ifindex;
1312 ++ struct sk_buff_head *arpq = NULL;
1313 ++ struct l2t_data *d = adap->l2t;
1314 ++ struct l2t_entry *e;
1315 +
1316 ++ hash = addr_hash(d, addr, addr_len, ifidx);
1317 + read_lock_bh(&d->lock);
1318 + for (e = d->l2tab[hash].first; e; e = e->next)
1319 + if (!addreq(e, addr) && e->ifindex == ifidx) {
1320 +@@ -574,8 +553,25 @@ void t4_l2t_update(struct adapter *adap, struct neighbour *neigh)
1321 + write_l2e(adap, e, 0);
1322 + }
1323 +
1324 +- if (arpq)
1325 +- handle_failed_resolution(adap, e);
1326 ++ if (arpq) {
1327 ++ struct sk_buff *skb;
1328 ++
1329 ++ /* Called when address resolution fails for an L2T
1330 ++ * entry to handle packets on the arpq head. If a
1331 ++ * packet specifies a failure handler it is invoked,
1332 ++ * otherwise the packet is sent to the device.
1333 ++ */
1334 ++ while ((skb = __skb_dequeue(&e->arpq)) != NULL) {
1335 ++ const struct l2t_skb_cb *cb = L2T_SKB_CB(skb);
1336 ++
1337 ++ spin_unlock(&e->lock);
1338 ++ if (cb->arp_err_handler)
1339 ++ cb->arp_err_handler(cb->handle, skb);
1340 ++ else
1341 ++ t4_ofld_send(adap, skb);
1342 ++ spin_lock(&e->lock);
1343 ++ }
1344 ++ }
1345 + spin_unlock_bh(&e->lock);
1346 + }
1347 +
1348 +diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
1349 +index 40ad1e503255..e2f6670d6eaf 100644
1350 +--- a/drivers/net/ethernet/ibm/ibmveth.c
1351 ++++ b/drivers/net/ethernet/ibm/ibmveth.c
1352 +@@ -1695,7 +1695,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)
1353 + }
1354 +
1355 + netdev->min_mtu = IBMVETH_MIN_MTU;
1356 +- netdev->max_mtu = ETH_MAX_MTU;
1357 ++ netdev->max_mtu = ETH_MAX_MTU - IBMVETH_BUFF_OH;
1358 +
1359 + memcpy(netdev->dev_addr, mac_addr_p, ETH_ALEN);
1360 +
1361 +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
1362 +index 645298628b6f..5e9e45befc87 100644
1363 +--- a/drivers/net/ethernet/ibm/ibmvnic.c
1364 ++++ b/drivers/net/ethernet/ibm/ibmvnic.c
1365 +@@ -792,12 +792,13 @@ static int ibmvnic_login(struct net_device *netdev)
1366 + struct ibmvnic_adapter *adapter = netdev_priv(netdev);
1367 + unsigned long timeout = msecs_to_jiffies(30000);
1368 + int retry_count = 0;
1369 ++ int retries = 10;
1370 + bool retry;
1371 + int rc;
1372 +
1373 + do {
1374 + retry = false;
1375 +- if (retry_count > IBMVNIC_MAX_QUEUES) {
1376 ++ if (retry_count > retries) {
1377 + netdev_warn(netdev, "Login attempts exceeded\n");
1378 + return -1;
1379 + }
1380 +@@ -812,11 +813,23 @@ static int ibmvnic_login(struct net_device *netdev)
1381 +
1382 + if (!wait_for_completion_timeout(&adapter->init_done,
1383 + timeout)) {
1384 +- netdev_warn(netdev, "Login timed out\n");
1385 +- return -1;
1386 ++ netdev_warn(netdev, "Login timed out, retrying...\n");
1387 ++ retry = true;
1388 ++ adapter->init_done_rc = 0;
1389 ++ retry_count++;
1390 ++ continue;
1391 + }
1392 +
1393 +- if (adapter->init_done_rc == PARTIALSUCCESS) {
1394 ++ if (adapter->init_done_rc == ABORTED) {
1395 ++ netdev_warn(netdev, "Login aborted, retrying...\n");
1396 ++ retry = true;
1397 ++ adapter->init_done_rc = 0;
1398 ++ retry_count++;
1399 ++ /* FW or device may be busy, so
1400 ++ * wait a bit before retrying login
1401 ++ */
1402 ++ msleep(500);
1403 ++ } else if (adapter->init_done_rc == PARTIALSUCCESS) {
1404 + retry_count++;
1405 + release_sub_crqs(adapter, 1);
1406 +
1407 +diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
1408 +index f1977aa440e5..f3d7c38f539a 100644
1409 +--- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c
1410 ++++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
1411 +@@ -397,7 +397,7 @@ static void qed_cxt_qm_iids(struct qed_hwfn *p_hwfn,
1412 + vf_tids += segs[NUM_TASK_PF_SEGMENTS].count;
1413 + }
1414 +
1415 +- iids->vf_cids += vf_cids * p_mngr->vf_count;
1416 ++ iids->vf_cids = vf_cids;
1417 + iids->tids += vf_tids * p_mngr->vf_count;
1418 +
1419 + DP_VERBOSE(p_hwfn, QED_MSG_ILT,
1420 +diff --git a/drivers/net/ethernet/qlogic/qed/qed_vf.c b/drivers/net/ethernet/qlogic/qed/qed_vf.c
1421 +index 5dda547772c1..93a0fbf6a132 100644
1422 +--- a/drivers/net/ethernet/qlogic/qed/qed_vf.c
1423 ++++ b/drivers/net/ethernet/qlogic/qed/qed_vf.c
1424 +@@ -81,12 +81,17 @@ static void qed_vf_pf_req_end(struct qed_hwfn *p_hwfn, int req_status)
1425 + mutex_unlock(&(p_hwfn->vf_iov_info->mutex));
1426 + }
1427 +
1428 ++#define QED_VF_CHANNEL_USLEEP_ITERATIONS 90
1429 ++#define QED_VF_CHANNEL_USLEEP_DELAY 100
1430 ++#define QED_VF_CHANNEL_MSLEEP_ITERATIONS 10
1431 ++#define QED_VF_CHANNEL_MSLEEP_DELAY 25
1432 ++
1433 + static int qed_send_msg2pf(struct qed_hwfn *p_hwfn, u8 *done, u32 resp_size)
1434 + {
1435 + union vfpf_tlvs *p_req = p_hwfn->vf_iov_info->vf2pf_request;
1436 + struct ustorm_trigger_vf_zone trigger;
1437 + struct ustorm_vf_zone *zone_data;
1438 +- int rc = 0, time = 100;
1439 ++ int iter, rc = 0;
1440 +
1441 + zone_data = (struct ustorm_vf_zone *)PXP_VF_BAR0_START_USDM_ZONE_B;
1442 +
1443 +@@ -126,11 +131,19 @@ static int qed_send_msg2pf(struct qed_hwfn *p_hwfn, u8 *done, u32 resp_size)
1444 + REG_WR(p_hwfn, (uintptr_t)&zone_data->trigger, *((u32 *)&trigger));
1445 +
1446 + /* When PF would be done with the response, it would write back to the
1447 +- * `done' address. Poll until then.
1448 ++ * `done' address from a coherent DMA zone. Poll until then.
1449 + */
1450 +- while ((!*done) && time) {
1451 +- msleep(25);
1452 +- time--;
1453 ++
1454 ++ iter = QED_VF_CHANNEL_USLEEP_ITERATIONS;
1455 ++ while (!*done && iter--) {
1456 ++ udelay(QED_VF_CHANNEL_USLEEP_DELAY);
1457 ++ dma_rmb();
1458 ++ }
1459 ++
1460 ++ iter = QED_VF_CHANNEL_MSLEEP_ITERATIONS;
1461 ++ while (!*done && iter--) {
1462 ++ msleep(QED_VF_CHANNEL_MSLEEP_DELAY);
1463 ++ dma_rmb();
1464 + }
1465 +
1466 + if (!*done) {
1467 +diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c
1468 +index aeafdb9ac015..b13ab4eee4c7 100644
1469 +--- a/drivers/net/ethernet/rocker/rocker_main.c
1470 ++++ b/drivers/net/ethernet/rocker/rocker_main.c
1471 +@@ -651,10 +651,10 @@ static int rocker_dma_rings_init(struct rocker *rocker)
1472 + err_dma_event_ring_bufs_alloc:
1473 + rocker_dma_ring_destroy(rocker, &rocker->event_ring);
1474 + err_dma_event_ring_create:
1475 ++ rocker_dma_cmd_ring_waits_free(rocker);
1476 ++err_dma_cmd_ring_waits_alloc:
1477 + rocker_dma_ring_bufs_free(rocker, &rocker->cmd_ring,
1478 + PCI_DMA_BIDIRECTIONAL);
1479 +-err_dma_cmd_ring_waits_alloc:
1480 +- rocker_dma_cmd_ring_waits_free(rocker);
1481 + err_dma_cmd_ring_bufs_alloc:
1482 + rocker_dma_ring_destroy(rocker, &rocker->cmd_ring);
1483 + return err;
1484 +diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
1485 +index 302d183beb9e..54ac599cffb4 100644
1486 +--- a/drivers/net/phy/phy_device.c
1487 ++++ b/drivers/net/phy/phy_device.c
1488 +@@ -606,8 +606,10 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id,
1489 +
1490 + /* Grab the bits from PHYIR2, and put them in the lower half */
1491 + phy_reg = mdiobus_read(bus, addr, MII_PHYSID2);
1492 +- if (phy_reg < 0)
1493 +- return -EIO;
1494 ++ if (phy_reg < 0) {
1495 ++ /* returning -ENODEV doesn't stop bus scanning */
1496 ++ return (phy_reg == -EIO || phy_reg == -ENODEV) ? -ENODEV : -EIO;
1497 ++ }
1498 +
1499 + *phy_id |= (phy_reg & 0xffff);
1500 +
1501 +diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
1502 +index 2207f7a7d1ff..8455f72007b9 100644
1503 +--- a/drivers/net/usb/ax88179_178a.c
1504 ++++ b/drivers/net/usb/ax88179_178a.c
1505 +@@ -1400,10 +1400,10 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
1506 + }
1507 +
1508 + if (pkt_cnt == 0) {
1509 +- /* Skip IP alignment psudo header */
1510 +- skb_pull(skb, 2);
1511 + skb->len = pkt_len;
1512 +- skb_set_tail_pointer(skb, pkt_len);
1513 ++ /* Skip IP alignment pseudo header */
1514 ++ skb_pull(skb, 2);
1515 ++ skb_set_tail_pointer(skb, skb->len);
1516 + skb->truesize = pkt_len + sizeof(struct sk_buff);
1517 + ax88179_rx_checksum(skb, pkt_hdr);
1518 + return 1;
1519 +@@ -1412,8 +1412,9 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
1520 + ax_skb = skb_clone(skb, GFP_ATOMIC);
1521 + if (ax_skb) {
1522 + ax_skb->len = pkt_len;
1523 +- ax_skb->data = skb->data + 2;
1524 +- skb_set_tail_pointer(ax_skb, pkt_len);
1525 ++ /* Skip IP alignment pseudo header */
1526 ++ skb_pull(ax_skb, 2);
1527 ++ skb_set_tail_pointer(ax_skb, ax_skb->len);
1528 + ax_skb->truesize = pkt_len + sizeof(struct sk_buff);
1529 + ax88179_rx_checksum(ax_skb, pkt_hdr);
1530 + usbnet_skb_return(dev, ax_skb);
1531 +diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
1532 +index 69a377ab2604..30e92a9cc97e 100644
1533 +--- a/drivers/regulator/pfuze100-regulator.c
1534 ++++ b/drivers/regulator/pfuze100-regulator.c
1535 +@@ -196,6 +196,19 @@ static const struct regulator_ops pfuze100_swb_regulator_ops = {
1536 +
1537 + };
1538 +
1539 ++static const struct regulator_ops pfuze3000_sw_regulator_ops = {
1540 ++ .enable = regulator_enable_regmap,
1541 ++ .disable = regulator_disable_regmap,
1542 ++ .is_enabled = regulator_is_enabled_regmap,
1543 ++ .list_voltage = regulator_list_voltage_table,
1544 ++ .map_voltage = regulator_map_voltage_ascend,
1545 ++ .set_voltage_sel = regulator_set_voltage_sel_regmap,
1546 ++ .get_voltage_sel = regulator_get_voltage_sel_regmap,
1547 ++ .set_voltage_time_sel = regulator_set_voltage_time_sel,
1548 ++ .set_ramp_delay = pfuze100_set_ramp_delay,
1549 ++
1550 ++};
1551 ++
1552 + #define PFUZE100_FIXED_REG(_chip, _name, base, voltage) \
1553 + [_chip ## _ ## _name] = { \
1554 + .desc = { \
1555 +@@ -305,23 +318,28 @@ static const struct regulator_ops pfuze100_swb_regulator_ops = {
1556 + .stby_mask = 0x20, \
1557 + }
1558 +
1559 +-
1560 +-#define PFUZE3000_SW2_REG(_chip, _name, base, min, max, step) { \
1561 +- .desc = { \
1562 +- .name = #_name,\
1563 +- .n_voltages = ((max) - (min)) / (step) + 1, \
1564 +- .ops = &pfuze100_sw_regulator_ops, \
1565 +- .type = REGULATOR_VOLTAGE, \
1566 +- .id = _chip ## _ ## _name, \
1567 +- .owner = THIS_MODULE, \
1568 +- .min_uV = (min), \
1569 +- .uV_step = (step), \
1570 +- .vsel_reg = (base) + PFUZE100_VOL_OFFSET, \
1571 +- .vsel_mask = 0x7, \
1572 +- }, \
1573 +- .stby_reg = (base) + PFUZE100_STANDBY_OFFSET, \
1574 +- .stby_mask = 0x7, \
1575 +-}
1576 ++/* No linar case for the some switches of PFUZE3000 */
1577 ++#define PFUZE3000_SW_REG(_chip, _name, base, mask, voltages) \
1578 ++ [_chip ## _ ## _name] = { \
1579 ++ .desc = { \
1580 ++ .name = #_name, \
1581 ++ .n_voltages = ARRAY_SIZE(voltages), \
1582 ++ .ops = &pfuze3000_sw_regulator_ops, \
1583 ++ .type = REGULATOR_VOLTAGE, \
1584 ++ .id = _chip ## _ ## _name, \
1585 ++ .owner = THIS_MODULE, \
1586 ++ .volt_table = voltages, \
1587 ++ .vsel_reg = (base) + PFUZE100_VOL_OFFSET, \
1588 ++ .vsel_mask = (mask), \
1589 ++ .enable_reg = (base) + PFUZE100_MODE_OFFSET, \
1590 ++ .enable_mask = 0xf, \
1591 ++ .enable_val = 0x8, \
1592 ++ .enable_time = 500, \
1593 ++ }, \
1594 ++ .stby_reg = (base) + PFUZE100_STANDBY_OFFSET, \
1595 ++ .stby_mask = (mask), \
1596 ++ .sw_reg = true, \
1597 ++ }
1598 +
1599 + #define PFUZE3000_SW3_REG(_chip, _name, base, min, max, step) { \
1600 + .desc = { \
1601 +@@ -377,9 +395,9 @@ static struct pfuze_regulator pfuze200_regulators[] = {
1602 + };
1603 +
1604 + static struct pfuze_regulator pfuze3000_regulators[] = {
1605 +- PFUZE100_SWB_REG(PFUZE3000, SW1A, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a),
1606 ++ PFUZE3000_SW_REG(PFUZE3000, SW1A, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a),
1607 + PFUZE100_SW_REG(PFUZE3000, SW1B, PFUZE100_SW1CVOL, 700000, 1475000, 25000),
1608 +- PFUZE100_SWB_REG(PFUZE3000, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo),
1609 ++ PFUZE3000_SW_REG(PFUZE3000, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo),
1610 + PFUZE3000_SW3_REG(PFUZE3000, SW3, PFUZE100_SW3AVOL, 900000, 1650000, 50000),
1611 + PFUZE100_SWB_REG(PFUZE3000, SWBST, PFUZE100_SWBSTCON1, 0x3, pfuze100_swbst),
1612 + PFUZE100_SWB_REG(PFUZE3000, VSNVS, PFUZE100_VSNVSVOL, 0x7, pfuze100_vsnvs),
1613 +@@ -393,8 +411,8 @@ static struct pfuze_regulator pfuze3000_regulators[] = {
1614 + };
1615 +
1616 + static struct pfuze_regulator pfuze3001_regulators[] = {
1617 +- PFUZE100_SWB_REG(PFUZE3001, SW1, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a),
1618 +- PFUZE100_SWB_REG(PFUZE3001, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo),
1619 ++ PFUZE3000_SW_REG(PFUZE3001, SW1, PFUZE100_SW1ABVOL, 0x1f, pfuze3000_sw1a),
1620 ++ PFUZE3000_SW_REG(PFUZE3001, SW2, PFUZE100_SW2VOL, 0x7, pfuze3000_sw2lo),
1621 + PFUZE3000_SW3_REG(PFUZE3001, SW3, PFUZE100_SW3AVOL, 900000, 1650000, 50000),
1622 + PFUZE100_SWB_REG(PFUZE3001, VSNVS, PFUZE100_VSNVSVOL, 0x7, pfuze100_vsnvs),
1623 + PFUZE100_VGEN_REG(PFUZE3001, VLDO1, PFUZE100_VGEN1VOL, 1800000, 3300000, 100000),
1624 +diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
1625 +index 7522aa06672d..b7afdb55a459 100644
1626 +--- a/drivers/s390/scsi/zfcp_erp.c
1627 ++++ b/drivers/s390/scsi/zfcp_erp.c
1628 +@@ -592,7 +592,10 @@ static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act)
1629 + ZFCP_STATUS_ERP_TIMEDOUT)) {
1630 + req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
1631 + zfcp_dbf_rec_run("erscf_1", act);
1632 +- req->erp_action = NULL;
1633 ++ /* lock-free concurrent access with
1634 ++ * zfcp_erp_timeout_handler()
1635 ++ */
1636 ++ WRITE_ONCE(req->erp_action, NULL);
1637 + }
1638 + if (act->status & ZFCP_STATUS_ERP_TIMEDOUT)
1639 + zfcp_dbf_rec_run("erscf_2", act);
1640 +@@ -628,8 +631,14 @@ void zfcp_erp_notify(struct zfcp_erp_action *erp_action, unsigned long set_mask)
1641 + void zfcp_erp_timeout_handler(struct timer_list *t)
1642 + {
1643 + struct zfcp_fsf_req *fsf_req = from_timer(fsf_req, t, timer);
1644 +- struct zfcp_erp_action *act = fsf_req->erp_action;
1645 ++ struct zfcp_erp_action *act;
1646 +
1647 ++ if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED)
1648 ++ return;
1649 ++ /* lock-free concurrent access with zfcp_erp_strategy_check_fsfreq() */
1650 ++ act = READ_ONCE(fsf_req->erp_action);
1651 ++ if (!act)
1652 ++ return;
1653 + zfcp_erp_notify(act, ZFCP_STATUS_ERP_TIMEDOUT);
1654 + }
1655 +
1656 +diff --git a/drivers/staging/erofs/unzip_vle.h b/drivers/staging/erofs/unzip_vle.h
1657 +index 684ff06fc7bf..630fd1f4f123 100644
1658 +--- a/drivers/staging/erofs/unzip_vle.h
1659 ++++ b/drivers/staging/erofs/unzip_vle.h
1660 +@@ -169,22 +169,22 @@ static inline void z_erofs_onlinepage_init(struct page *page)
1661 + static inline void z_erofs_onlinepage_fixup(struct page *page,
1662 + uintptr_t index, bool down)
1663 + {
1664 +- unsigned long *p, o, v, id;
1665 +-repeat:
1666 +- p = &page_private(page);
1667 +- o = READ_ONCE(*p);
1668 ++ union z_erofs_onlinepage_converter u = { .v = &page_private(page) };
1669 ++ int orig, orig_index, val;
1670 +
1671 +- id = o >> Z_EROFS_ONLINEPAGE_INDEX_SHIFT;
1672 +- if (id) {
1673 ++repeat:
1674 ++ orig = atomic_read(u.o);
1675 ++ orig_index = orig >> Z_EROFS_ONLINEPAGE_INDEX_SHIFT;
1676 ++ if (orig_index) {
1677 + if (!index)
1678 + return;
1679 +
1680 +- BUG_ON(id != index);
1681 ++ DBG_BUGON(orig_index != index);
1682 + }
1683 +
1684 +- v = (index << Z_EROFS_ONLINEPAGE_INDEX_SHIFT) |
1685 +- ((o & Z_EROFS_ONLINEPAGE_COUNT_MASK) + (unsigned)down);
1686 +- if (cmpxchg(p, o, v) != o)
1687 ++ val = (index << Z_EROFS_ONLINEPAGE_INDEX_SHIFT) |
1688 ++ ((orig & Z_EROFS_ONLINEPAGE_COUNT_MASK) + (unsigned int)down);
1689 ++ if (atomic_cmpxchg(u.o, orig, val) != orig)
1690 + goto repeat;
1691 + }
1692 +
1693 +diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
1694 +index 2c65af319a60..6c6bf03ac38a 100644
1695 +--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
1696 ++++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
1697 +@@ -1856,12 +1856,14 @@ int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie, uint var_ie_l
1698 + pIE = (struct ndis_80211_var_ie *)rtw_get_ie(pvar_ie, _SUPPORTEDRATES_IE_, &ie_len, var_ie_len);
1699 + if (!pIE)
1700 + return _FAIL;
1701 ++ if (ie_len > sizeof(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates))
1702 ++ return _FAIL;
1703 +
1704 + memcpy(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates, pIE->data, ie_len);
1705 + supportRateNum = ie_len;
1706 +
1707 + pIE = (struct ndis_80211_var_ie *)rtw_get_ie(pvar_ie, _EXT_SUPPORTEDRATES_IE_, &ie_len, var_ie_len);
1708 +- if (pIE)
1709 ++ if (pIE && (ie_len <= sizeof(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates) - supportRateNum))
1710 + memcpy((pmlmeinfo->FW_sta_info[cam_idx].SupportedRates + supportRateNum), pIE->data, ie_len);
1711 +
1712 + return _SUCCESS;
1713 +diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
1714 +index f8e43a6faea9..cdcc64ea2554 100644
1715 +--- a/drivers/tty/hvc/hvc_console.c
1716 ++++ b/drivers/tty/hvc/hvc_console.c
1717 +@@ -75,8 +75,6 @@ static LIST_HEAD(hvc_structs);
1718 + */
1719 + static DEFINE_MUTEX(hvc_structs_mutex);
1720 +
1721 +-/* Mutex to serialize hvc_open */
1722 +-static DEFINE_MUTEX(hvc_open_mutex);
1723 + /*
1724 + * This value is used to assign a tty->index value to a hvc_struct based
1725 + * upon order of exposure via hvc_probe(), when we can not match it to
1726 +@@ -348,24 +346,16 @@ static int hvc_install(struct tty_driver *driver, struct tty_struct *tty)
1727 + */
1728 + static int hvc_open(struct tty_struct *tty, struct file * filp)
1729 + {
1730 +- struct hvc_struct *hp;
1731 ++ struct hvc_struct *hp = tty->driver_data;
1732 + unsigned long flags;
1733 + int rc = 0;
1734 +
1735 +- mutex_lock(&hvc_open_mutex);
1736 +-
1737 +- hp = tty->driver_data;
1738 +- if (!hp) {
1739 +- rc = -EIO;
1740 +- goto out;
1741 +- }
1742 +-
1743 + spin_lock_irqsave(&hp->port.lock, flags);
1744 + /* Check and then increment for fast path open. */
1745 + if (hp->port.count++ > 0) {
1746 + spin_unlock_irqrestore(&hp->port.lock, flags);
1747 + hvc_kick();
1748 +- goto out;
1749 ++ return 0;
1750 + } /* else count == 0 */
1751 + spin_unlock_irqrestore(&hp->port.lock, flags);
1752 +
1753 +@@ -393,8 +383,6 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
1754 + /* Force wakeup of the polling thread */
1755 + hvc_kick();
1756 +
1757 +-out:
1758 +- mutex_unlock(&hvc_open_mutex);
1759 + return rc;
1760 + }
1761 +
1762 +diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
1763 +index e8b9b27937ed..ea7883e1fbe2 100644
1764 +--- a/drivers/usb/class/cdc-acm.c
1765 ++++ b/drivers/usb/class/cdc-acm.c
1766 +@@ -1721,6 +1721,8 @@ static int acm_pre_reset(struct usb_interface *intf)
1767 +
1768 + static const struct usb_device_id acm_ids[] = {
1769 + /* quirky and broken devices */
1770 ++ { USB_DEVICE(0x0424, 0x274e), /* Microchip Technology, Inc. (formerly SMSC) */
1771 ++ .driver_info = DISABLE_ECHO, }, /* DISABLE ECHO in termios flag */
1772 + { USB_DEVICE(0x076d, 0x0006), /* Denso Cradle CU-321 */
1773 + .driver_info = NO_UNION_NORMAL, },/* has no union descriptor */
1774 + { USB_DEVICE(0x17ef, 0x7000), /* Lenovo USB modem */
1775 +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
1776 +index 3e8efe759c3e..e0b77674869c 100644
1777 +--- a/drivers/usb/core/quirks.c
1778 ++++ b/drivers/usb/core/quirks.c
1779 +@@ -218,11 +218,12 @@ static const struct usb_device_id usb_quirk_list[] = {
1780 + /* Logitech HD Webcam C270 */
1781 + { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME },
1782 +
1783 +- /* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */
1784 ++ /* Logitech HD Pro Webcams C920, C920-C, C922, C925e and C930e */
1785 + { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT },
1786 + { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT },
1787 + { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT },
1788 + { USB_DEVICE(0x046d, 0x085b), .driver_info = USB_QUIRK_DELAY_INIT },
1789 ++ { USB_DEVICE(0x046d, 0x085c), .driver_info = USB_QUIRK_DELAY_INIT },
1790 +
1791 + /* Logitech ConferenceCam CC3000e */
1792 + { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT },
1793 +diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
1794 +index d8424834902d..f18aa3f59e51 100644
1795 +--- a/drivers/usb/dwc2/gadget.c
1796 ++++ b/drivers/usb/dwc2/gadget.c
1797 +@@ -4759,12 +4759,6 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg)
1798 + epnum, 0);
1799 + }
1800 +
1801 +- ret = usb_add_gadget_udc(dev, &hsotg->gadget);
1802 +- if (ret) {
1803 +- dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep,
1804 +- hsotg->ctrl_req);
1805 +- return ret;
1806 +- }
1807 + dwc2_hsotg_dump(hsotg);
1808 +
1809 + return 0;
1810 +diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
1811 +index 577642895b57..c3383f30b37a 100644
1812 +--- a/drivers/usb/dwc2/platform.c
1813 ++++ b/drivers/usb/dwc2/platform.c
1814 +@@ -492,6 +492,17 @@ static int dwc2_driver_probe(struct platform_device *dev)
1815 + if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)
1816 + dwc2_lowlevel_hw_disable(hsotg);
1817 +
1818 ++#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
1819 ++ IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
1820 ++ /* Postponed adding a new gadget to the udc class driver list */
1821 ++ if (hsotg->gadget_enabled) {
1822 ++ retval = usb_add_gadget_udc(hsotg->dev, &hsotg->gadget);
1823 ++ if (retval) {
1824 ++ dwc2_hsotg_remove(hsotg);
1825 ++ goto error;
1826 ++ }
1827 ++ }
1828 ++#endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */
1829 + return 0;
1830 +
1831 + error:
1832 +diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c
1833 +index 95f52232493b..83e98b59910e 100644
1834 +--- a/drivers/usb/gadget/udc/mv_udc_core.c
1835 ++++ b/drivers/usb/gadget/udc/mv_udc_core.c
1836 +@@ -2313,7 +2313,8 @@ static int mv_udc_probe(struct platform_device *pdev)
1837 + return 0;
1838 +
1839 + err_create_workqueue:
1840 +- destroy_workqueue(udc->qwork);
1841 ++ if (udc->qwork)
1842 ++ destroy_workqueue(udc->qwork);
1843 + err_destroy_dma:
1844 + dma_pool_destroy(udc->dtd_pool);
1845 + err_free_dma:
1846 +diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
1847 +index 8e3bab1e0c1f..f433883ca2bf 100644
1848 +--- a/drivers/usb/host/ehci-exynos.c
1849 ++++ b/drivers/usb/host/ehci-exynos.c
1850 +@@ -188,9 +188,8 @@ static int exynos_ehci_probe(struct platform_device *pdev)
1851 + hcd->rsrc_len = resource_size(res);
1852 +
1853 + irq = platform_get_irq(pdev, 0);
1854 +- if (!irq) {
1855 +- dev_err(&pdev->dev, "Failed to get IRQ\n");
1856 +- err = -ENODEV;
1857 ++ if (irq < 0) {
1858 ++ err = irq;
1859 + goto fail_io;
1860 + }
1861 +
1862 +diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
1863 +index fe9422d3bcdc..fcfad5c298a9 100644
1864 +--- a/drivers/usb/host/ehci-pci.c
1865 ++++ b/drivers/usb/host/ehci-pci.c
1866 +@@ -216,6 +216,13 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
1867 + ehci_info(ehci, "applying MosChip frame-index workaround\n");
1868 + ehci->frame_index_bug = 1;
1869 + break;
1870 ++ case PCI_VENDOR_ID_HUAWEI:
1871 ++ /* Synopsys HC bug */
1872 ++ if (pdev->device == 0xa239) {
1873 ++ ehci_info(ehci, "applying Synopsys HC workaround\n");
1874 ++ ehci->has_synopsys_hc_bug = 1;
1875 ++ }
1876 ++ break;
1877 + }
1878 +
1879 + /* optional debug port, normally in the first BAR */
1880 +diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
1881 +index c9233cddf9a2..0a39dc58f376 100644
1882 +--- a/drivers/usb/host/ohci-sm501.c
1883 ++++ b/drivers/usb/host/ohci-sm501.c
1884 +@@ -196,6 +196,7 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev)
1885 + struct resource *mem;
1886 +
1887 + usb_remove_hcd(hcd);
1888 ++ iounmap(hcd->regs);
1889 + release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
1890 + usb_put_hcd(hcd);
1891 + dma_release_declared_memory(&pdev->dev);
1892 +diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
1893 +index 60987c787e44..2c3b31109e16 100644
1894 +--- a/drivers/usb/host/xhci-mtk.c
1895 ++++ b/drivers/usb/host/xhci-mtk.c
1896 +@@ -592,6 +592,9 @@ static int xhci_mtk_remove(struct platform_device *dev)
1897 + struct xhci_hcd *xhci = hcd_to_xhci(hcd);
1898 + struct usb_hcd *shared_hcd = xhci->shared_hcd;
1899 +
1900 ++ pm_runtime_put_noidle(&dev->dev);
1901 ++ pm_runtime_disable(&dev->dev);
1902 ++
1903 + usb_remove_hcd(shared_hcd);
1904 + xhci->shared_hcd = NULL;
1905 + device_init_wakeup(&dev->dev, false);
1906 +@@ -602,8 +605,6 @@ static int xhci_mtk_remove(struct platform_device *dev)
1907 + xhci_mtk_sch_exit(mtk);
1908 + xhci_mtk_clks_disable(mtk);
1909 + xhci_mtk_ldos_disable(mtk);
1910 +- pm_runtime_put_sync(&dev->dev);
1911 +- pm_runtime_disable(&dev->dev);
1912 +
1913 + return 0;
1914 + }
1915 +diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
1916 +index b4177287d7d0..f8e71c7aba6e 100644
1917 +--- a/drivers/usb/host/xhci.c
1918 ++++ b/drivers/usb/host/xhci.c
1919 +@@ -1405,6 +1405,7 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id,
1920 + xhci->devs[slot_id]->out_ctx, ep_index);
1921 +
1922 + ep_ctx = xhci_get_ep_ctx(xhci, command->in_ctx, ep_index);
1923 ++ ep_ctx->ep_info &= cpu_to_le32(~EP_STATE_MASK);/* must clear */
1924 + ep_ctx->ep_info2 &= cpu_to_le32(~MAX_PACKET_MASK);
1925 + ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet_size));
1926 +
1927 +@@ -4304,6 +4305,9 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
1928 + int hird, exit_latency;
1929 + int ret;
1930 +
1931 ++ if (xhci->quirks & XHCI_HW_LPM_DISABLE)
1932 ++ return -EPERM;
1933 ++
1934 + if (hcd->speed >= HCD_USB3 || !xhci->hw_lpm_support ||
1935 + !udev->lpm_capable)
1936 + return -EPERM;
1937 +@@ -4326,7 +4330,7 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
1938 + xhci_dbg(xhci, "%s port %d USB2 hardware LPM\n",
1939 + enable ? "enable" : "disable", port_num + 1);
1940 +
1941 +- if (enable && !(xhci->quirks & XHCI_HW_LPM_DISABLE)) {
1942 ++ if (enable) {
1943 + /* Host supports BESL timeout instead of HIRD */
1944 + if (udev->usb2_hw_lpm_besl_capable) {
1945 + /* if device doesn't have a preferred BESL value use a
1946 +@@ -4385,6 +4389,9 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
1947 + mutex_lock(hcd->bandwidth_mutex);
1948 + xhci_change_max_exit_latency(xhci, udev, 0);
1949 + mutex_unlock(hcd->bandwidth_mutex);
1950 ++ readl_poll_timeout(ports[port_num]->addr, pm_val,
1951 ++ (pm_val & PORT_PLS_MASK) == XDEV_U0,
1952 ++ 100, 10000);
1953 + return 0;
1954 + }
1955 + }
1956 +diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
1957 +index 4dedc822237f..39efbcf63c11 100644
1958 +--- a/drivers/usb/host/xhci.h
1959 ++++ b/drivers/usb/host/xhci.h
1960 +@@ -716,7 +716,7 @@ struct xhci_ep_ctx {
1961 + * 4 - TRB error
1962 + * 5-7 - reserved
1963 + */
1964 +-#define EP_STATE_MASK (0xf)
1965 ++#define EP_STATE_MASK (0x7)
1966 + #define EP_STATE_DISABLED 0
1967 + #define EP_STATE_RUNNING 1
1968 + #define EP_STATE_HALTED 2
1969 +diff --git a/drivers/usb/typec/tcpci_rt1711h.c b/drivers/usb/typec/tcpci_rt1711h.c
1970 +index 017389021b96..b56a0880a044 100644
1971 +--- a/drivers/usb/typec/tcpci_rt1711h.c
1972 ++++ b/drivers/usb/typec/tcpci_rt1711h.c
1973 +@@ -179,26 +179,6 @@ out:
1974 + return tcpci_irq(chip->tcpci);
1975 + }
1976 +
1977 +-static int rt1711h_init_alert(struct rt1711h_chip *chip,
1978 +- struct i2c_client *client)
1979 +-{
1980 +- int ret;
1981 +-
1982 +- /* Disable chip interrupts before requesting irq */
1983 +- ret = rt1711h_write16(chip, TCPC_ALERT_MASK, 0);
1984 +- if (ret < 0)
1985 +- return ret;
1986 +-
1987 +- ret = devm_request_threaded_irq(chip->dev, client->irq, NULL,
1988 +- rt1711h_irq,
1989 +- IRQF_ONESHOT | IRQF_TRIGGER_LOW,
1990 +- dev_name(chip->dev), chip);
1991 +- if (ret < 0)
1992 +- return ret;
1993 +- enable_irq_wake(client->irq);
1994 +- return 0;
1995 +-}
1996 +-
1997 + static int rt1711h_sw_reset(struct rt1711h_chip *chip)
1998 + {
1999 + int ret;
2000 +@@ -260,7 +240,8 @@ static int rt1711h_probe(struct i2c_client *client,
2001 + if (ret < 0)
2002 + return ret;
2003 +
2004 +- ret = rt1711h_init_alert(chip, client);
2005 ++ /* Disable chip interrupts before requesting irq */
2006 ++ ret = rt1711h_write16(chip, TCPC_ALERT_MASK, 0);
2007 + if (ret < 0)
2008 + return ret;
2009 +
2010 +@@ -271,6 +252,14 @@ static int rt1711h_probe(struct i2c_client *client,
2011 + if (IS_ERR_OR_NULL(chip->tcpci))
2012 + return PTR_ERR(chip->tcpci);
2013 +
2014 ++ ret = devm_request_threaded_irq(chip->dev, client->irq, NULL,
2015 ++ rt1711h_irq,
2016 ++ IRQF_ONESHOT | IRQF_TRIGGER_LOW,
2017 ++ dev_name(chip->dev), chip);
2018 ++ if (ret < 0)
2019 ++ return ret;
2020 ++ enable_irq_wake(client->irq);
2021 ++
2022 + return 0;
2023 + }
2024 +
2025 +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
2026 +index 887f9ebc2bc2..8dd2702ce859 100644
2027 +--- a/fs/btrfs/inode.c
2028 ++++ b/fs/btrfs/inode.c
2029 +@@ -977,6 +977,7 @@ static noinline int cow_file_range(struct inode *inode,
2030 + u64 num_bytes;
2031 + unsigned long ram_size;
2032 + u64 cur_alloc_size = 0;
2033 ++ u64 min_alloc_size;
2034 + u64 blocksize = fs_info->sectorsize;
2035 + struct btrfs_key ins;
2036 + struct extent_map *em;
2037 +@@ -1028,10 +1029,26 @@ static noinline int cow_file_range(struct inode *inode,
2038 + btrfs_drop_extent_cache(BTRFS_I(inode), start,
2039 + start + num_bytes - 1, 0);
2040 +
2041 ++ /*
2042 ++ * Relocation relies on the relocated extents to have exactly the same
2043 ++ * size as the original extents. Normally writeback for relocation data
2044 ++ * extents follows a NOCOW path because relocation preallocates the
2045 ++ * extents. However, due to an operation such as scrub turning a block
2046 ++ * group to RO mode, it may fallback to COW mode, so we must make sure
2047 ++ * an extent allocated during COW has exactly the requested size and can
2048 ++ * not be split into smaller extents, otherwise relocation breaks and
2049 ++ * fails during the stage where it updates the bytenr of file extent
2050 ++ * items.
2051 ++ */
2052 ++ if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID)
2053 ++ min_alloc_size = num_bytes;
2054 ++ else
2055 ++ min_alloc_size = fs_info->sectorsize;
2056 ++
2057 + while (num_bytes > 0) {
2058 + cur_alloc_size = num_bytes;
2059 + ret = btrfs_reserve_extent(root, cur_alloc_size, cur_alloc_size,
2060 +- fs_info->sectorsize, 0, alloc_hint,
2061 ++ min_alloc_size, 0, alloc_hint,
2062 + &ins, 1, 1);
2063 + if (ret < 0)
2064 + goto out_unlock;
2065 +@@ -8639,9 +8656,6 @@ static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
2066 + dio_data.overwrite = 1;
2067 + inode_unlock(inode);
2068 + relock = true;
2069 +- } else if (iocb->ki_flags & IOCB_NOWAIT) {
2070 +- ret = -EAGAIN;
2071 +- goto out;
2072 + }
2073 + ret = btrfs_delalloc_reserve_space(inode, &data_reserved,
2074 + offset, count);
2075 +diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
2076 +index 6fc16329ceb4..2a523139a05f 100644
2077 +--- a/fs/cifs/smb2ops.c
2078 ++++ b/fs/cifs/smb2ops.c
2079 +@@ -2180,6 +2180,12 @@ static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
2080 + inode = d_inode(cfile->dentry);
2081 + cifsi = CIFS_I(inode);
2082 +
2083 ++ /*
2084 ++ * We zero the range through ioctl, so we need remove the page caches
2085 ++ * first, otherwise the data may be inconsistent with the server.
2086 ++ */
2087 ++ truncate_pagecache_range(inode, offset, offset + len - 1);
2088 ++
2089 + /* if file not oplocked can't be sure whether asking to extend size */
2090 + if (!CIFS_CACHE_READ(cifsi))
2091 + if (keep_size == false) {
2092 +@@ -2248,6 +2254,12 @@ static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon,
2093 + return rc;
2094 + }
2095 +
2096 ++ /*
2097 ++ * We implement the punch hole through ioctl, so we need remove the page
2098 ++ * caches first, otherwise the data may be inconsistent with the server.
2099 ++ */
2100 ++ truncate_pagecache_range(inode, offset, offset + len - 1);
2101 ++
2102 + cifs_dbg(FYI, "offset %lld len %lld", offset, len);
2103 +
2104 + fsctl_buf.FileOffset = cpu_to_le64(offset);
2105 +diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
2106 +index e5da9d7fb69e..1e883df26d4a 100644
2107 +--- a/fs/nfs/direct.c
2108 ++++ b/fs/nfs/direct.c
2109 +@@ -396,8 +396,6 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq)
2110 + {
2111 + struct inode *inode = dreq->inode;
2112 +
2113 +- inode_dio_end(inode);
2114 +-
2115 + if (dreq->iocb) {
2116 + long res = (long) dreq->error;
2117 + if (dreq->count != 0) {
2118 +@@ -409,7 +407,10 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq)
2119 +
2120 + complete(&dreq->completion);
2121 +
2122 ++ igrab(inode);
2123 + nfs_direct_req_release(dreq);
2124 ++ inode_dio_end(inode);
2125 ++ iput(inode);
2126 + }
2127 +
2128 + static void nfs_direct_read_completion(struct nfs_pgio_header *hdr)
2129 +@@ -539,8 +540,10 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq,
2130 + * generic layer handle the completion.
2131 + */
2132 + if (requested_bytes == 0) {
2133 +- inode_dio_end(inode);
2134 ++ igrab(inode);
2135 + nfs_direct_req_release(dreq);
2136 ++ inode_dio_end(inode);
2137 ++ iput(inode);
2138 + return result < 0 ? result : -EIO;
2139 + }
2140 +
2141 +@@ -957,8 +960,10 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
2142 + * generic layer handle the completion.
2143 + */
2144 + if (requested_bytes == 0) {
2145 +- inode_dio_end(inode);
2146 ++ igrab(inode);
2147 + nfs_direct_req_release(dreq);
2148 ++ inode_dio_end(inode);
2149 ++ iput(inode);
2150 + return result < 0 ? result : -EIO;
2151 + }
2152 +
2153 +diff --git a/fs/nfs/file.c b/fs/nfs/file.c
2154 +index 29553fdba8af..b2257fa209ac 100644
2155 +--- a/fs/nfs/file.c
2156 ++++ b/fs/nfs/file.c
2157 +@@ -82,6 +82,7 @@ nfs_file_release(struct inode *inode, struct file *filp)
2158 + dprintk("NFS: release(%pD2)\n", filp);
2159 +
2160 + nfs_inc_stats(inode, NFSIOS_VFSRELEASE);
2161 ++ inode_dio_wait(inode);
2162 + nfs_file_clear_open_context(filp);
2163 + return 0;
2164 + }
2165 +diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
2166 +index e0fe9a0f1bf1..d8cba46a9395 100644
2167 +--- a/fs/nfs/flexfilelayout/flexfilelayout.c
2168 ++++ b/fs/nfs/flexfilelayout/flexfilelayout.c
2169 +@@ -915,9 +915,8 @@ retry:
2170 + goto out_mds;
2171 +
2172 + /* Use a direct mapping of ds_idx to pgio mirror_idx */
2173 +- if (WARN_ON_ONCE(pgio->pg_mirror_count !=
2174 +- FF_LAYOUT_MIRROR_COUNT(pgio->pg_lseg)))
2175 +- goto out_mds;
2176 ++ if (pgio->pg_mirror_count != FF_LAYOUT_MIRROR_COUNT(pgio->pg_lseg))
2177 ++ goto out_eagain;
2178 +
2179 + for (i = 0; i < pgio->pg_mirror_count; i++) {
2180 + ds = nfs4_ff_layout_prepare_ds(pgio->pg_lseg, i, true);
2181 +@@ -936,11 +935,15 @@ retry:
2182 + }
2183 +
2184 + return;
2185 +-
2186 ++out_eagain:
2187 ++ pnfs_generic_pg_cleanup(pgio);
2188 ++ pgio->pg_error = -EAGAIN;
2189 ++ return;
2190 + out_mds:
2191 + pnfs_put_lseg(pgio->pg_lseg);
2192 + pgio->pg_lseg = NULL;
2193 + nfs_pageio_reset_write_mds(pgio);
2194 ++ pgio->pg_error = -EAGAIN;
2195 + }
2196 +
2197 + static unsigned int
2198 +diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
2199 +index a18b8d7a3075..ca3405f73264 100644
2200 +--- a/fs/notify/fanotify/fanotify.c
2201 ++++ b/fs/notify/fanotify/fanotify.c
2202 +@@ -114,6 +114,10 @@ static bool fanotify_should_send_event(struct fsnotify_iter_info *iter_info,
2203 + if (!fsnotify_iter_should_report_type(iter_info, type))
2204 + continue;
2205 + mark = iter_info->marks[type];
2206 ++
2207 ++ /* Apply ignore mask regardless of ISDIR and ON_CHILD flags */
2208 ++ marks_ignored_mask |= mark->ignored_mask;
2209 ++
2210 + /*
2211 + * If the event is for a child and this mark doesn't care about
2212 + * events on a child, don't send it!
2213 +@@ -124,7 +128,6 @@ static bool fanotify_should_send_event(struct fsnotify_iter_info *iter_info,
2214 + continue;
2215 +
2216 + marks_mask |= mark->mask;
2217 +- marks_ignored_mask |= mark->ignored_mask;
2218 + }
2219 +
2220 + if (d_is_dir(path->dentry) &&
2221 +diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
2222 +index 178cb9e6772a..c141b06811a6 100644
2223 +--- a/fs/ocfs2/dlmglue.c
2224 ++++ b/fs/ocfs2/dlmglue.c
2225 +@@ -682,6 +682,12 @@ static void ocfs2_nfs_sync_lock_res_init(struct ocfs2_lock_res *res,
2226 + &ocfs2_nfs_sync_lops, osb);
2227 + }
2228 +
2229 ++static void ocfs2_nfs_sync_lock_init(struct ocfs2_super *osb)
2230 ++{
2231 ++ ocfs2_nfs_sync_lock_res_init(&osb->osb_nfs_sync_lockres, osb);
2232 ++ init_rwsem(&osb->nfs_sync_rwlock);
2233 ++}
2234 ++
2235 + void ocfs2_trim_fs_lock_res_init(struct ocfs2_super *osb)
2236 + {
2237 + struct ocfs2_lock_res *lockres = &osb->osb_trim_fs_lockres;
2238 +@@ -2851,6 +2857,11 @@ int ocfs2_nfs_sync_lock(struct ocfs2_super *osb, int ex)
2239 + if (ocfs2_is_hard_readonly(osb))
2240 + return -EROFS;
2241 +
2242 ++ if (ex)
2243 ++ down_write(&osb->nfs_sync_rwlock);
2244 ++ else
2245 ++ down_read(&osb->nfs_sync_rwlock);
2246 ++
2247 + if (ocfs2_mount_local(osb))
2248 + return 0;
2249 +
2250 +@@ -2869,6 +2880,10 @@ void ocfs2_nfs_sync_unlock(struct ocfs2_super *osb, int ex)
2251 + if (!ocfs2_mount_local(osb))
2252 + ocfs2_cluster_unlock(osb, lockres,
2253 + ex ? LKM_EXMODE : LKM_PRMODE);
2254 ++ if (ex)
2255 ++ up_write(&osb->nfs_sync_rwlock);
2256 ++ else
2257 ++ up_read(&osb->nfs_sync_rwlock);
2258 + }
2259 +
2260 + int ocfs2_trim_fs_lock(struct ocfs2_super *osb,
2261 +@@ -3314,7 +3329,7 @@ int ocfs2_dlm_init(struct ocfs2_super *osb)
2262 + local:
2263 + ocfs2_super_lock_res_init(&osb->osb_super_lockres, osb);
2264 + ocfs2_rename_lock_res_init(&osb->osb_rename_lockres, osb);
2265 +- ocfs2_nfs_sync_lock_res_init(&osb->osb_nfs_sync_lockres, osb);
2266 ++ ocfs2_nfs_sync_lock_init(osb);
2267 + ocfs2_orphan_scan_lock_res_init(&osb->osb_orphan_scan.os_lockres, osb);
2268 +
2269 + osb->cconn = conn;
2270 +diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
2271 +index 4f86ac0027b5..231933618300 100644
2272 +--- a/fs/ocfs2/ocfs2.h
2273 ++++ b/fs/ocfs2/ocfs2.h
2274 +@@ -406,6 +406,7 @@ struct ocfs2_super
2275 + struct ocfs2_lock_res osb_super_lockres;
2276 + struct ocfs2_lock_res osb_rename_lockres;
2277 + struct ocfs2_lock_res osb_nfs_sync_lockres;
2278 ++ struct rw_semaphore nfs_sync_rwlock;
2279 + struct ocfs2_lock_res osb_trim_fs_lockres;
2280 + struct ocfs2_dlm_debug *osb_dlm_debug;
2281 +
2282 +diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
2283 +index 7071ad0dec90..d50b7f2c7395 100644
2284 +--- a/fs/ocfs2/ocfs2_fs.h
2285 ++++ b/fs/ocfs2/ocfs2_fs.h
2286 +@@ -303,7 +303,7 @@
2287 + #define OCFS2_MAX_SLOTS 255
2288 +
2289 + /* Slot map indicator for an empty slot */
2290 +-#define OCFS2_INVALID_SLOT -1
2291 ++#define OCFS2_INVALID_SLOT ((u16)-1)
2292 +
2293 + #define OCFS2_VOL_UUID_LEN 16
2294 + #define OCFS2_MAX_VOL_LABEL_LEN 64
2295 +@@ -339,8 +339,8 @@ struct ocfs2_system_inode_info {
2296 + enum {
2297 + BAD_BLOCK_SYSTEM_INODE = 0,
2298 + GLOBAL_INODE_ALLOC_SYSTEM_INODE,
2299 ++#define OCFS2_FIRST_ONLINE_SYSTEM_INODE GLOBAL_INODE_ALLOC_SYSTEM_INODE
2300 + SLOT_MAP_SYSTEM_INODE,
2301 +-#define OCFS2_FIRST_ONLINE_SYSTEM_INODE SLOT_MAP_SYSTEM_INODE
2302 + HEARTBEAT_SYSTEM_INODE,
2303 + GLOBAL_BITMAP_SYSTEM_INODE,
2304 + USER_QUOTA_SYSTEM_INODE,
2305 +diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
2306 +index f7c972fbed6a..15a89c513da2 100644
2307 +--- a/fs/ocfs2/suballoc.c
2308 ++++ b/fs/ocfs2/suballoc.c
2309 +@@ -2841,9 +2841,12 @@ int ocfs2_test_inode_bit(struct ocfs2_super *osb, u64 blkno, int *res)
2310 + goto bail;
2311 + }
2312 +
2313 +- inode_alloc_inode =
2314 +- ocfs2_get_system_file_inode(osb, INODE_ALLOC_SYSTEM_INODE,
2315 +- suballoc_slot);
2316 ++ if (suballoc_slot == (u16)OCFS2_INVALID_SLOT)
2317 ++ inode_alloc_inode = ocfs2_get_system_file_inode(osb,
2318 ++ GLOBAL_INODE_ALLOC_SYSTEM_INODE, suballoc_slot);
2319 ++ else
2320 ++ inode_alloc_inode = ocfs2_get_system_file_inode(osb,
2321 ++ INODE_ALLOC_SYSTEM_INODE, suballoc_slot);
2322 + if (!inode_alloc_inode) {
2323 + /* the error code could be inaccurate, but we are not able to
2324 + * get the correct one. */
2325 +diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
2326 +index e1c0c0d2f1b0..1eb7933dac83 100644
2327 +--- a/fs/xfs/libxfs/xfs_alloc.c
2328 ++++ b/fs/xfs/libxfs/xfs_alloc.c
2329 +@@ -2596,6 +2596,13 @@ xfs_agf_verify(
2330 + be32_to_cpu(agf->agf_flcount) <= xfs_agfl_size(mp)))
2331 + return __this_address;
2332 +
2333 ++ if (be32_to_cpu(agf->agf_length) > mp->m_sb.sb_dblocks)
2334 ++ return __this_address;
2335 ++
2336 ++ if (be32_to_cpu(agf->agf_freeblks) < be32_to_cpu(agf->agf_longest) ||
2337 ++ be32_to_cpu(agf->agf_freeblks) > be32_to_cpu(agf->agf_length))
2338 ++ return __this_address;
2339 ++
2340 + if (be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]) < 1 ||
2341 + be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]) < 1 ||
2342 + be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]) > XFS_BTREE_MAXLEVELS ||
2343 +@@ -2607,6 +2614,10 @@ xfs_agf_verify(
2344 + be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]) > XFS_BTREE_MAXLEVELS))
2345 + return __this_address;
2346 +
2347 ++ if (xfs_sb_version_hasrmapbt(&mp->m_sb) &&
2348 ++ be32_to_cpu(agf->agf_rmap_blocks) > be32_to_cpu(agf->agf_length))
2349 ++ return __this_address;
2350 ++
2351 + /*
2352 + * during growfs operations, the perag is not fully initialised,
2353 + * so we can't use it for any useful checking. growfs ensures we can't
2354 +@@ -2620,6 +2631,11 @@ xfs_agf_verify(
2355 + be32_to_cpu(agf->agf_btreeblks) > be32_to_cpu(agf->agf_length))
2356 + return __this_address;
2357 +
2358 ++ if (xfs_sb_version_hasreflink(&mp->m_sb) &&
2359 ++ be32_to_cpu(agf->agf_refcount_blocks) >
2360 ++ be32_to_cpu(agf->agf_length))
2361 ++ return __this_address;
2362 ++
2363 + if (xfs_sb_version_hasreflink(&mp->m_sb) &&
2364 + (be32_to_cpu(agf->agf_refcount_level) < 1 ||
2365 + be32_to_cpu(agf->agf_refcount_level) > XFS_BTREE_MAXLEVELS))
2366 +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
2367 +index 84bbdcbb199a..4e14926433ed 100644
2368 +--- a/include/linux/netdevice.h
2369 ++++ b/include/linux/netdevice.h
2370 +@@ -2620,14 +2620,6 @@ void netdev_freemem(struct net_device *dev);
2371 + void synchronize_net(void);
2372 + int init_dummy_netdev(struct net_device *dev);
2373 +
2374 +-DECLARE_PER_CPU(int, xmit_recursion);
2375 +-#define XMIT_RECURSION_LIMIT 10
2376 +-
2377 +-static inline int dev_recursion_level(void)
2378 +-{
2379 +- return this_cpu_read(xmit_recursion);
2380 +-}
2381 +-
2382 + struct net_device *dev_get_by_index(struct net *net, int ifindex);
2383 + struct net_device *__dev_get_by_index(struct net *net, int ifindex);
2384 + struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
2385 +@@ -2967,6 +2959,11 @@ struct softnet_data {
2386 + #ifdef CONFIG_XFRM_OFFLOAD
2387 + struct sk_buff_head xfrm_backlog;
2388 + #endif
2389 ++ /* written and read only by owning cpu: */
2390 ++ struct {
2391 ++ u16 recursion;
2392 ++ u8 more;
2393 ++ } xmit;
2394 + #ifdef CONFIG_RPS
2395 + /* input_queue_head should be written by cpu owning this struct,
2396 + * and only read by other cpus. Worth using a cache line.
2397 +@@ -3002,6 +2999,28 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd,
2398 +
2399 + DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
2400 +
2401 ++static inline int dev_recursion_level(void)
2402 ++{
2403 ++ return this_cpu_read(softnet_data.xmit.recursion);
2404 ++}
2405 ++
2406 ++#define XMIT_RECURSION_LIMIT 8
2407 ++static inline bool dev_xmit_recursion(void)
2408 ++{
2409 ++ return unlikely(__this_cpu_read(softnet_data.xmit.recursion) >
2410 ++ XMIT_RECURSION_LIMIT);
2411 ++}
2412 ++
2413 ++static inline void dev_xmit_recursion_inc(void)
2414 ++{
2415 ++ __this_cpu_inc(softnet_data.xmit.recursion);
2416 ++}
2417 ++
2418 ++static inline void dev_xmit_recursion_dec(void)
2419 ++{
2420 ++ __this_cpu_dec(softnet_data.xmit.recursion);
2421 ++}
2422 ++
2423 + void __netif_schedule(struct Qdisc *q);
2424 + void netif_schedule_queue(struct netdev_queue *txq);
2425 +
2426 +@@ -4314,6 +4333,11 @@ static inline netdev_tx_t __netdev_start_xmit(const struct net_device_ops *ops,
2427 + return ops->ndo_start_xmit(skb, dev);
2428 + }
2429 +
2430 ++static inline bool netdev_xmit_more(void)
2431 ++{
2432 ++ return __this_cpu_read(softnet_data.xmit.more);
2433 ++}
2434 ++
2435 + static inline netdev_tx_t netdev_start_xmit(struct sk_buff *skb, struct net_device *dev,
2436 + struct netdev_queue *txq, bool more)
2437 + {
2438 +diff --git a/include/linux/qed/qed_chain.h b/include/linux/qed/qed_chain.h
2439 +index 733fad7dfbed..6d15040c642c 100644
2440 +--- a/include/linux/qed/qed_chain.h
2441 ++++ b/include/linux/qed/qed_chain.h
2442 +@@ -207,28 +207,34 @@ static inline u32 qed_chain_get_cons_idx_u32(struct qed_chain *p_chain)
2443 +
2444 + static inline u16 qed_chain_get_elem_left(struct qed_chain *p_chain)
2445 + {
2446 ++ u16 elem_per_page = p_chain->elem_per_page;
2447 ++ u32 prod = p_chain->u.chain16.prod_idx;
2448 ++ u32 cons = p_chain->u.chain16.cons_idx;
2449 + u16 used;
2450 +
2451 +- used = (u16) (((u32)0x10000 +
2452 +- (u32)p_chain->u.chain16.prod_idx) -
2453 +- (u32)p_chain->u.chain16.cons_idx);
2454 ++ if (prod < cons)
2455 ++ prod += (u32)U16_MAX + 1;
2456 ++
2457 ++ used = (u16)(prod - cons);
2458 + if (p_chain->mode == QED_CHAIN_MODE_NEXT_PTR)
2459 +- used -= p_chain->u.chain16.prod_idx / p_chain->elem_per_page -
2460 +- p_chain->u.chain16.cons_idx / p_chain->elem_per_page;
2461 ++ used -= prod / elem_per_page - cons / elem_per_page;
2462 +
2463 + return (u16)(p_chain->capacity - used);
2464 + }
2465 +
2466 + static inline u32 qed_chain_get_elem_left_u32(struct qed_chain *p_chain)
2467 + {
2468 ++ u16 elem_per_page = p_chain->elem_per_page;
2469 ++ u64 prod = p_chain->u.chain32.prod_idx;
2470 ++ u64 cons = p_chain->u.chain32.cons_idx;
2471 + u32 used;
2472 +
2473 +- used = (u32) (((u64)0x100000000ULL +
2474 +- (u64)p_chain->u.chain32.prod_idx) -
2475 +- (u64)p_chain->u.chain32.cons_idx);
2476 ++ if (prod < cons)
2477 ++ prod += (u64)U32_MAX + 1;
2478 ++
2479 ++ used = (u32)(prod - cons);
2480 + if (p_chain->mode == QED_CHAIN_MODE_NEXT_PTR)
2481 +- used -= p_chain->u.chain32.prod_idx / p_chain->elem_per_page -
2482 +- p_chain->u.chain32.cons_idx / p_chain->elem_per_page;
2483 ++ used -= (u32)(prod / elem_per_page - cons / elem_per_page);
2484 +
2485 + return p_chain->capacity - used;
2486 + }
2487 +diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
2488 +index 1c296f370e46..f32fe7080d2e 100644
2489 +--- a/include/linux/virtio_net.h
2490 ++++ b/include/linux/virtio_net.h
2491 +@@ -109,16 +109,17 @@ retry:
2492 +
2493 + if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
2494 + u16 gso_size = __virtio16_to_cpu(little_endian, hdr->gso_size);
2495 ++ struct skb_shared_info *shinfo = skb_shinfo(skb);
2496 +
2497 +- if (skb->len - p_off <= gso_size)
2498 +- return -EINVAL;
2499 +-
2500 +- skb_shinfo(skb)->gso_size = gso_size;
2501 +- skb_shinfo(skb)->gso_type = gso_type;
2502 ++ /* Too small packets are not really GSO ones. */
2503 ++ if (skb->len - p_off > gso_size) {
2504 ++ shinfo->gso_size = gso_size;
2505 ++ shinfo->gso_type = gso_type;
2506 +
2507 +- /* Header must be checked, and gso_segs computed. */
2508 +- skb_shinfo(skb)->gso_type |= SKB_GSO_DODGY;
2509 +- skb_shinfo(skb)->gso_segs = 0;
2510 ++ /* Header must be checked, and gso_segs computed. */
2511 ++ shinfo->gso_type |= SKB_GSO_DODGY;
2512 ++ shinfo->gso_segs = 0;
2513 ++ }
2514 + }
2515 +
2516 + return 0;
2517 +diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
2518 +index 86f034b524d4..48d74674d5e9 100644
2519 +--- a/include/net/sctp/constants.h
2520 ++++ b/include/net/sctp/constants.h
2521 +@@ -361,11 +361,13 @@ enum {
2522 + ipv4_is_anycast_6to4(a))
2523 +
2524 + /* Flags used for the bind address copy functions. */
2525 +-#define SCTP_ADDR6_ALLOWED 0x00000001 /* IPv6 address is allowed by
2526 ++#define SCTP_ADDR4_ALLOWED 0x00000001 /* IPv4 address is allowed by
2527 + local sock family */
2528 +-#define SCTP_ADDR4_PEERSUPP 0x00000002 /* IPv4 address is supported by
2529 ++#define SCTP_ADDR6_ALLOWED 0x00000002 /* IPv6 address is allowed by
2530 ++ local sock family */
2531 ++#define SCTP_ADDR4_PEERSUPP 0x00000004 /* IPv4 address is supported by
2532 + peer */
2533 +-#define SCTP_ADDR6_PEERSUPP 0x00000004 /* IPv6 address is supported by
2534 ++#define SCTP_ADDR6_PEERSUPP 0x00000008 /* IPv6 address is supported by
2535 + peer */
2536 +
2537 + /* Reasons to retransmit. */
2538 +diff --git a/include/net/sock.h b/include/net/sock.h
2539 +index f359e5c94762..e2df102e669e 100644
2540 +--- a/include/net/sock.h
2541 ++++ b/include/net/sock.h
2542 +@@ -1775,7 +1775,6 @@ static inline int sk_rx_queue_get(const struct sock *sk)
2543 +
2544 + static inline void sk_set_socket(struct sock *sk, struct socket *sock)
2545 + {
2546 +- sk_tx_queue_clear(sk);
2547 + sk->sk_socket = sock;
2548 + }
2549 +
2550 +diff --git a/include/net/xfrm.h b/include/net/xfrm.h
2551 +index 48dc1ce2170d..f087c8d125b8 100644
2552 +--- a/include/net/xfrm.h
2553 ++++ b/include/net/xfrm.h
2554 +@@ -1083,6 +1083,7 @@ struct xfrm_offload {
2555 + #define XFRM_GRO 32
2556 + #define XFRM_ESP_NO_TRAILER 64
2557 + #define XFRM_DEV_RESUME 128
2558 ++#define XFRM_XMIT 256
2559 +
2560 + __u32 status;
2561 + #define CRYPTO_SUCCESS 1
2562 +diff --git a/kernel/sched/core.c b/kernel/sched/core.c
2563 +index 0325ccf3a8e4..843394d0ea42 100644
2564 +--- a/kernel/sched/core.c
2565 ++++ b/kernel/sched/core.c
2566 +@@ -3862,7 +3862,8 @@ void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task)
2567 + */
2568 + if (dl_prio(prio)) {
2569 + if (!dl_prio(p->normal_prio) ||
2570 +- (pi_task && dl_entity_preempt(&pi_task->dl, &p->dl))) {
2571 ++ (pi_task && dl_prio(pi_task->prio) &&
2572 ++ dl_entity_preempt(&pi_task->dl, &p->dl))) {
2573 + p->dl.dl_boosted = 1;
2574 + queue_flag |= ENQUEUE_REPLENISH;
2575 + } else
2576 +diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
2577 +index ebec37cb3be9..8aecfb143859 100644
2578 +--- a/kernel/sched/deadline.c
2579 ++++ b/kernel/sched/deadline.c
2580 +@@ -2688,6 +2688,7 @@ void __dl_clear_params(struct task_struct *p)
2581 + dl_se->dl_bw = 0;
2582 + dl_se->dl_density = 0;
2583 +
2584 ++ dl_se->dl_boosted = 0;
2585 + dl_se->dl_throttled = 0;
2586 + dl_se->dl_yielded = 0;
2587 + dl_se->dl_non_contending = 0;
2588 +diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
2589 +index b7e1e09a0bef..7a4ca2deb39b 100644
2590 +--- a/kernel/trace/blktrace.c
2591 ++++ b/kernel/trace/blktrace.c
2592 +@@ -3,6 +3,9 @@
2593 + * Copyright (C) 2006 Jens Axboe <axboe@××××××.dk>
2594 + *
2595 + */
2596 ++
2597 ++#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2598 ++
2599 + #include <linux/kernel.h>
2600 + #include <linux/blkdev.h>
2601 + #include <linux/blktrace_api.h>
2602 +@@ -495,6 +498,16 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
2603 + */
2604 + strreplace(buts->name, '/', '_');
2605 +
2606 ++ /*
2607 ++ * bdev can be NULL, as with scsi-generic, this is a helpful as
2608 ++ * we can be.
2609 ++ */
2610 ++ if (q->blk_trace) {
2611 ++ pr_warn("Concurrent blktraces are not allowed on %s\n",
2612 ++ buts->name);
2613 ++ return -EBUSY;
2614 ++ }
2615 ++
2616 + bt = kzalloc(sizeof(*bt), GFP_KERNEL);
2617 + if (!bt)
2618 + return -ENOMEM;
2619 +diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
2620 +index 805aef83b5cf..564d22691dd7 100644
2621 +--- a/kernel/trace/ring_buffer.c
2622 ++++ b/kernel/trace/ring_buffer.c
2623 +@@ -2333,7 +2333,7 @@ rb_update_event(struct ring_buffer_per_cpu *cpu_buffer,
2624 + if (unlikely(info->add_timestamp)) {
2625 + bool abs = ring_buffer_time_stamp_abs(cpu_buffer->buffer);
2626 +
2627 +- event = rb_add_time_stamp(event, info->delta, abs);
2628 ++ event = rb_add_time_stamp(event, abs ? info->delta : delta, abs);
2629 + length -= RB_LEN_TIME_EXTEND;
2630 + delta = 0;
2631 + }
2632 +diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
2633 +index 38a2a558e546..0c3b1551cfca 100644
2634 +--- a/kernel/trace/trace_events_trigger.c
2635 ++++ b/kernel/trace/trace_events_trigger.c
2636 +@@ -211,11 +211,17 @@ static int event_trigger_regex_open(struct inode *inode, struct file *file)
2637 +
2638 + static int trigger_process_regex(struct trace_event_file *file, char *buff)
2639 + {
2640 +- char *command, *next = buff;
2641 ++ char *command, *next;
2642 + struct event_command *p;
2643 + int ret = -EINVAL;
2644 +
2645 ++ next = buff = skip_spaces(buff);
2646 + command = strsep(&next, ": \t");
2647 ++ if (next) {
2648 ++ next = skip_spaces(next);
2649 ++ if (!*next)
2650 ++ next = NULL;
2651 ++ }
2652 + command = (command[0] != '!') ? command : command + 1;
2653 +
2654 + mutex_lock(&trigger_cmd_mutex);
2655 +@@ -624,8 +630,14 @@ event_trigger_callback(struct event_command *cmd_ops,
2656 + int ret;
2657 +
2658 + /* separate the trigger from the filter (t:n [if filter]) */
2659 +- if (param && isdigit(param[0]))
2660 ++ if (param && isdigit(param[0])) {
2661 + trigger = strsep(&param, " \t");
2662 ++ if (param) {
2663 ++ param = skip_spaces(param);
2664 ++ if (!*param)
2665 ++ param = NULL;
2666 ++ }
2667 ++ }
2668 +
2669 + trigger_ops = cmd_ops->get_trigger_ops(cmd, trigger);
2670 +
2671 +@@ -1361,6 +1373,11 @@ int event_enable_trigger_func(struct event_command *cmd_ops,
2672 + trigger = strsep(&param, " \t");
2673 + if (!trigger)
2674 + return -EINVAL;
2675 ++ if (param) {
2676 ++ param = skip_spaces(param);
2677 ++ if (!*param)
2678 ++ param = NULL;
2679 ++ }
2680 +
2681 + system = strsep(&trigger, ":");
2682 + if (!trigger)
2683 +diff --git a/mm/slab_common.c b/mm/slab_common.c
2684 +index 39e382acb0b8..b5776b1301f0 100644
2685 +--- a/mm/slab_common.c
2686 ++++ b/mm/slab_common.c
2687 +@@ -1540,7 +1540,7 @@ void kzfree(const void *p)
2688 + if (unlikely(ZERO_OR_NULL_PTR(mem)))
2689 + return;
2690 + ks = ksize(mem);
2691 +- memset(mem, 0, ks);
2692 ++ memzero_explicit(mem, ks);
2693 + kfree(mem);
2694 + }
2695 + EXPORT_SYMBOL(kzfree);
2696 +diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
2697 +index 11ed2029985f..33b8222db75c 100644
2698 +--- a/net/bridge/br_private.h
2699 ++++ b/net/bridge/br_private.h
2700 +@@ -202,8 +202,8 @@ struct net_bridge_port_group {
2701 + struct rcu_head rcu;
2702 + struct timer_list timer;
2703 + struct br_ip addr;
2704 ++ unsigned char eth_addr[ETH_ALEN] __aligned(2);
2705 + unsigned char flags;
2706 +- unsigned char eth_addr[ETH_ALEN];
2707 + };
2708 +
2709 + struct net_bridge_mdb_entry
2710 +diff --git a/net/core/dev.c b/net/core/dev.c
2711 +index 1618d5a676c4..4b1053057ca6 100644
2712 +--- a/net/core/dev.c
2713 ++++ b/net/core/dev.c
2714 +@@ -3534,9 +3534,6 @@ static void skb_update_prio(struct sk_buff *skb)
2715 + #define skb_update_prio(skb)
2716 + #endif
2717 +
2718 +-DEFINE_PER_CPU(int, xmit_recursion);
2719 +-EXPORT_SYMBOL(xmit_recursion);
2720 +-
2721 + /**
2722 + * dev_loopback_xmit - loop back @skb
2723 + * @net: network namespace this loopback is happening in
2724 +@@ -3827,8 +3824,7 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)
2725 + int cpu = smp_processor_id(); /* ok because BHs are off */
2726 +
2727 + if (txq->xmit_lock_owner != cpu) {
2728 +- if (unlikely(__this_cpu_read(xmit_recursion) >
2729 +- XMIT_RECURSION_LIMIT))
2730 ++ if (dev_xmit_recursion())
2731 + goto recursion_alert;
2732 +
2733 + skb = validate_xmit_skb(skb, dev, &again);
2734 +@@ -3838,9 +3834,9 @@ static int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)
2735 + HARD_TX_LOCK(dev, txq, cpu);
2736 +
2737 + if (!netif_xmit_stopped(txq)) {
2738 +- __this_cpu_inc(xmit_recursion);
2739 ++ dev_xmit_recursion_inc();
2740 + skb = dev_hard_start_xmit(skb, dev, txq, &rc);
2741 +- __this_cpu_dec(xmit_recursion);
2742 ++ dev_xmit_recursion_dec();
2743 + if (dev_xmit_complete(rc)) {
2744 + HARD_TX_UNLOCK(dev, txq);
2745 + goto out;
2746 +@@ -3903,10 +3899,12 @@ int dev_direct_xmit(struct sk_buff *skb, u16 queue_id)
2747 +
2748 + local_bh_disable();
2749 +
2750 ++ dev_xmit_recursion_inc();
2751 + HARD_TX_LOCK(dev, txq, smp_processor_id());
2752 + if (!netif_xmit_frozen_or_drv_stopped(txq))
2753 + ret = netdev_start_xmit(skb, dev, txq, false);
2754 + HARD_TX_UNLOCK(dev, txq);
2755 ++ dev_xmit_recursion_dec();
2756 +
2757 + local_bh_enable();
2758 +
2759 +@@ -8753,6 +8751,13 @@ int register_netdevice(struct net_device *dev)
2760 + rcu_barrier();
2761 +
2762 + dev->reg_state = NETREG_UNREGISTERED;
2763 ++ /* We should put the kobject that hold in
2764 ++ * netdev_unregister_kobject(), otherwise
2765 ++ * the net device cannot be freed when
2766 ++ * driver calls free_netdev(), because the
2767 ++ * kobject is being hold.
2768 ++ */
2769 ++ kobject_put(&dev->dev.kobj);
2770 + }
2771 + /*
2772 + * Prevent userspace races by waiting until the network
2773 +diff --git a/net/core/filter.c b/net/core/filter.c
2774 +index b5521b60a2d4..636e67a92847 100644
2775 +--- a/net/core/filter.c
2776 ++++ b/net/core/filter.c
2777 +@@ -2002,7 +2002,7 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb)
2778 + {
2779 + int ret;
2780 +
2781 +- if (unlikely(__this_cpu_read(xmit_recursion) > XMIT_RECURSION_LIMIT)) {
2782 ++ if (dev_xmit_recursion()) {
2783 + net_crit_ratelimited("bpf: recursion limit reached on datapath, buggy bpf program?\n");
2784 + kfree_skb(skb);
2785 + return -ENETDOWN;
2786 +@@ -2011,9 +2011,9 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb)
2787 + skb->dev = dev;
2788 + skb->tstamp = 0;
2789 +
2790 +- __this_cpu_inc(xmit_recursion);
2791 ++ dev_xmit_recursion_inc();
2792 + ret = dev_queue_xmit(skb);
2793 +- __this_cpu_dec(xmit_recursion);
2794 ++ dev_xmit_recursion_dec();
2795 +
2796 + return ret;
2797 + }
2798 +diff --git a/net/core/sock.c b/net/core/sock.c
2799 +index 8abfde0d28ee..8721264a2b39 100644
2800 +--- a/net/core/sock.c
2801 ++++ b/net/core/sock.c
2802 +@@ -640,7 +640,7 @@ bool sk_mc_loop(struct sock *sk)
2803 + return inet6_sk(sk)->mc_loop;
2804 + #endif
2805 + }
2806 +- WARN_ON(1);
2807 ++ WARN_ON_ONCE(1);
2808 + return true;
2809 + }
2810 + EXPORT_SYMBOL(sk_mc_loop);
2811 +@@ -1540,6 +1540,7 @@ struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
2812 + cgroup_sk_alloc(&sk->sk_cgrp_data);
2813 + sock_update_classid(&sk->sk_cgrp_data);
2814 + sock_update_netprioidx(&sk->sk_cgrp_data);
2815 ++ sk_tx_queue_clear(sk);
2816 + }
2817 +
2818 + return sk;
2819 +@@ -1747,6 +1748,7 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
2820 + */
2821 + sk_refcnt_debug_inc(newsk);
2822 + sk_set_socket(newsk, NULL);
2823 ++ sk_tx_queue_clear(newsk);
2824 + newsk->sk_wq = NULL;
2825 +
2826 + if (newsk->sk_prot->sockets_allocated)
2827 +diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
2828 +index a8fc4e83cd95..9573cd242b90 100644
2829 +--- a/net/ipv4/fib_semantics.c
2830 ++++ b/net/ipv4/fib_semantics.c
2831 +@@ -831,7 +831,7 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_nh *nh,
2832 + if (fl4.flowi4_scope < RT_SCOPE_LINK)
2833 + fl4.flowi4_scope = RT_SCOPE_LINK;
2834 +
2835 +- if (cfg->fc_table)
2836 ++ if (cfg->fc_table && cfg->fc_table != RT_TABLE_MAIN)
2837 + tbl = fib_get_table(net, cfg->fc_table);
2838 +
2839 + if (tbl)
2840 +diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
2841 +index b37abba3b369..375d0e516d85 100644
2842 +--- a/net/ipv4/ip_tunnel.c
2843 ++++ b/net/ipv4/ip_tunnel.c
2844 +@@ -98,9 +98,10 @@ struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
2845 + __be32 remote, __be32 local,
2846 + __be32 key)
2847 + {
2848 +- unsigned int hash;
2849 + struct ip_tunnel *t, *cand = NULL;
2850 + struct hlist_head *head;
2851 ++ struct net_device *ndev;
2852 ++ unsigned int hash;
2853 +
2854 + hash = ip_tunnel_hash(key, remote);
2855 + head = &itn->tunnels[hash];
2856 +@@ -175,8 +176,9 @@ struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
2857 + if (t && t->dev->flags & IFF_UP)
2858 + return t;
2859 +
2860 +- if (itn->fb_tunnel_dev && itn->fb_tunnel_dev->flags & IFF_UP)
2861 +- return netdev_priv(itn->fb_tunnel_dev);
2862 ++ ndev = READ_ONCE(itn->fb_tunnel_dev);
2863 ++ if (ndev && ndev->flags & IFF_UP)
2864 ++ return netdev_priv(ndev);
2865 +
2866 + return NULL;
2867 + }
2868 +@@ -1212,9 +1214,9 @@ void ip_tunnel_uninit(struct net_device *dev)
2869 + struct ip_tunnel_net *itn;
2870 +
2871 + itn = net_generic(net, tunnel->ip_tnl_net_id);
2872 +- /* fb_tunnel_dev will be unregisted in net-exit call. */
2873 +- if (itn->fb_tunnel_dev != dev)
2874 +- ip_tunnel_del(itn, netdev_priv(dev));
2875 ++ ip_tunnel_del(itn, netdev_priv(dev));
2876 ++ if (itn->fb_tunnel_dev == dev)
2877 ++ WRITE_ONCE(itn->fb_tunnel_dev, NULL);
2878 +
2879 + dst_cache_reset(&tunnel->dst_cache);
2880 + }
2881 +diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
2882 +index 78bfadfcf342..8b5ba0a5cd38 100644
2883 +--- a/net/ipv4/tcp_cubic.c
2884 ++++ b/net/ipv4/tcp_cubic.c
2885 +@@ -403,6 +403,8 @@ static void hystart_update(struct sock *sk, u32 delay)
2886 +
2887 + if (hystart_detect & HYSTART_DELAY) {
2888 + /* obtain the minimum delay of more than sampling packets */
2889 ++ if (ca->curr_rtt > delay)
2890 ++ ca->curr_rtt = delay;
2891 + if (ca->sample_cnt < HYSTART_MIN_SAMPLES) {
2892 + if (ca->curr_rtt == 0 || ca->curr_rtt > delay)
2893 + ca->curr_rtt = delay;
2894 +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
2895 +index 12e1ea7344d9..7441ecfc8320 100644
2896 +--- a/net/ipv4/tcp_input.c
2897 ++++ b/net/ipv4/tcp_input.c
2898 +@@ -254,7 +254,8 @@ static void tcp_ecn_accept_cwr(struct sock *sk, const struct sk_buff *skb)
2899 + * cwnd may be very low (even just 1 packet), so we should ACK
2900 + * immediately.
2901 + */
2902 +- inet_csk(sk)->icsk_ack.pending |= ICSK_ACK_NOW;
2903 ++ if (TCP_SKB_CB(skb)->seq != TCP_SKB_CB(skb)->end_seq)
2904 ++ inet_csk(sk)->icsk_ack.pending |= ICSK_ACK_NOW;
2905 + }
2906 + }
2907 +
2908 +@@ -3665,6 +3666,15 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
2909 + tcp_in_ack_event(sk, ack_ev_flags);
2910 + }
2911 +
2912 ++ /* This is a deviation from RFC3168 since it states that:
2913 ++ * "When the TCP data sender is ready to set the CWR bit after reducing
2914 ++ * the congestion window, it SHOULD set the CWR bit only on the first
2915 ++ * new data packet that it transmits."
2916 ++ * We accept CWR on pure ACKs to be more robust
2917 ++ * with widely-deployed TCP implementations that do this.
2918 ++ */
2919 ++ tcp_ecn_accept_cwr(sk, skb);
2920 ++
2921 + /* We passed data and got it acked, remove any soft error
2922 + * log. Something worked...
2923 + */
2924 +@@ -4518,7 +4528,11 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
2925 + if (tcp_ooo_try_coalesce(sk, tp->ooo_last_skb,
2926 + skb, &fragstolen)) {
2927 + coalesce_done:
2928 +- tcp_grow_window(sk, skb);
2929 ++ /* For non sack flows, do not grow window to force DUPACK
2930 ++ * and trigger fast retransmit.
2931 ++ */
2932 ++ if (tcp_is_sack(tp))
2933 ++ tcp_grow_window(sk, skb);
2934 + kfree_skb_partial(skb, fragstolen);
2935 + skb = NULL;
2936 + goto add_sack;
2937 +@@ -4602,7 +4616,11 @@ add_sack:
2938 + tcp_sack_new_ofo_skb(sk, seq, end_seq);
2939 + end:
2940 + if (skb) {
2941 +- tcp_grow_window(sk, skb);
2942 ++ /* For non sack flows, do not grow window to force DUPACK
2943 ++ * and trigger fast retransmit.
2944 ++ */
2945 ++ if (tcp_is_sack(tp))
2946 ++ tcp_grow_window(sk, skb);
2947 + skb_condense(skb);
2948 + skb_set_owner_r(skb, sk);
2949 + }
2950 +@@ -4703,8 +4721,6 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
2951 + skb_dst_drop(skb);
2952 + __skb_pull(skb, tcp_hdr(skb)->doff * 4);
2953 +
2954 +- tcp_ecn_accept_cwr(sk, skb);
2955 +-
2956 + tp->rx_opt.dsack = 0;
2957 +
2958 + /* Queue data for delivery to the user.
2959 +diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
2960 +index 90621d498fd1..f5144573c45c 100644
2961 +--- a/net/ipv6/ip6_gre.c
2962 ++++ b/net/ipv6/ip6_gre.c
2963 +@@ -132,6 +132,7 @@ static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev,
2964 + gre_proto == htons(ETH_P_ERSPAN2)) ?
2965 + ARPHRD_ETHER : ARPHRD_IP6GRE;
2966 + int score, cand_score = 4;
2967 ++ struct net_device *ndev;
2968 +
2969 + for_each_ip_tunnel_rcu(t, ign->tunnels_r_l[h0 ^ h1]) {
2970 + if (!ipv6_addr_equal(local, &t->parms.laddr) ||
2971 +@@ -243,9 +244,9 @@ static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev,
2972 + if (t && t->dev->flags & IFF_UP)
2973 + return t;
2974 +
2975 +- dev = ign->fb_tunnel_dev;
2976 +- if (dev && dev->flags & IFF_UP)
2977 +- return netdev_priv(dev);
2978 ++ ndev = READ_ONCE(ign->fb_tunnel_dev);
2979 ++ if (ndev && ndev->flags & IFF_UP)
2980 ++ return netdev_priv(ndev);
2981 +
2982 + return NULL;
2983 + }
2984 +@@ -418,6 +419,8 @@ static void ip6gre_tunnel_uninit(struct net_device *dev)
2985 +
2986 + ip6gre_tunnel_unlink_md(ign, t);
2987 + ip6gre_tunnel_unlink(ign, t);
2988 ++ if (ign->fb_tunnel_dev == dev)
2989 ++ WRITE_ONCE(ign->fb_tunnel_dev, NULL);
2990 + dst_cache_reset(&t->dst_cache);
2991 + dev_put(dev);
2992 + }
2993 +diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
2994 +index 2d80e913b82f..f2f8551416c3 100644
2995 +--- a/net/ipv6/mcast.c
2996 ++++ b/net/ipv6/mcast.c
2997 +@@ -2620,6 +2620,7 @@ void ipv6_mc_destroy_dev(struct inet6_dev *idev)
2998 + idev->mc_list = i->next;
2999 +
3000 + write_unlock_bh(&idev->lock);
3001 ++ ip6_mc_clear_src(i);
3002 + ma_put(i);
3003 + write_lock_bh(&idev->lock);
3004 + }
3005 +diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
3006 +index 21eb53f6d4fe..36ebc40a4313 100644
3007 +--- a/net/netfilter/ipset/ip_set_core.c
3008 ++++ b/net/netfilter/ipset/ip_set_core.c
3009 +@@ -385,6 +385,8 @@ ip_set_elem_len(struct ip_set *set, struct nlattr *tb[], size_t len,
3010 + for (id = 0; id < IPSET_EXT_ID_MAX; id++) {
3011 + if (!add_extension(id, cadt_flags, tb))
3012 + continue;
3013 ++ if (align < ip_set_extensions[id].align)
3014 ++ align = ip_set_extensions[id].align;
3015 + len = ALIGN(len, ip_set_extensions[id].align);
3016 + set->offset[id] = len;
3017 + set->extensions |= ip_set_extensions[id].type;
3018 +diff --git a/net/rxrpc/call_accept.c b/net/rxrpc/call_accept.c
3019 +index c5566bc4aaca..7778f0fb48cf 100644
3020 +--- a/net/rxrpc/call_accept.c
3021 ++++ b/net/rxrpc/call_accept.c
3022 +@@ -26,6 +26,11 @@
3023 + #include <net/ip.h>
3024 + #include "ar-internal.h"
3025 +
3026 ++static void rxrpc_dummy_notify(struct sock *sk, struct rxrpc_call *call,
3027 ++ unsigned long user_call_ID)
3028 ++{
3029 ++}
3030 ++
3031 + /*
3032 + * Preallocate a single service call, connection and peer and, if possible,
3033 + * give them a user ID and attach the user's side of the ID to them.
3034 +@@ -232,6 +237,8 @@ void rxrpc_discard_prealloc(struct rxrpc_sock *rx)
3035 + if (rx->discard_new_call) {
3036 + _debug("discard %lx", call->user_call_ID);
3037 + rx->discard_new_call(call, call->user_call_ID);
3038 ++ if (call->notify_rx)
3039 ++ call->notify_rx = rxrpc_dummy_notify;
3040 + rxrpc_put_call(call, rxrpc_call_put_kernel);
3041 + }
3042 + rxrpc_call_completed(call);
3043 +diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
3044 +index e65b230fce4c..58bd558a277a 100644
3045 +--- a/net/rxrpc/input.c
3046 ++++ b/net/rxrpc/input.c
3047 +@@ -735,13 +735,12 @@ static void rxrpc_input_ackinfo(struct rxrpc_call *call, struct sk_buff *skb,
3048 + ntohl(ackinfo->rxMTU), ntohl(ackinfo->maxMTU),
3049 + rwind, ntohl(ackinfo->jumbo_max));
3050 +
3051 ++ if (rwind > RXRPC_RXTX_BUFF_SIZE - 1)
3052 ++ rwind = RXRPC_RXTX_BUFF_SIZE - 1;
3053 + if (call->tx_winsize != rwind) {
3054 +- if (rwind > RXRPC_RXTX_BUFF_SIZE - 1)
3055 +- rwind = RXRPC_RXTX_BUFF_SIZE - 1;
3056 + if (rwind > call->tx_winsize)
3057 + wake = true;
3058 +- trace_rxrpc_rx_rwind_change(call, sp->hdr.serial,
3059 +- ntohl(ackinfo->rwind), wake);
3060 ++ trace_rxrpc_rx_rwind_change(call, sp->hdr.serial, rwind, wake);
3061 + call->tx_winsize = rwind;
3062 + }
3063 +
3064 +diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
3065 +index 824e3c37e5dd..d03f843647ae 100644
3066 +--- a/net/sched/sch_cake.c
3067 ++++ b/net/sched/sch_cake.c
3068 +@@ -1508,32 +1508,51 @@ static unsigned int cake_drop(struct Qdisc *sch, struct sk_buff **to_free)
3069 + return idx + (tin << 16);
3070 + }
3071 +
3072 +-static u8 cake_handle_diffserv(struct sk_buff *skb, u16 wash)
3073 ++static u8 cake_handle_diffserv(struct sk_buff *skb, bool wash)
3074 + {
3075 +- int wlen = skb_network_offset(skb);
3076 ++ const int offset = skb_network_offset(skb);
3077 ++ u16 *buf, buf_;
3078 + u8 dscp;
3079 +
3080 + switch (tc_skb_protocol(skb)) {
3081 + case htons(ETH_P_IP):
3082 +- wlen += sizeof(struct iphdr);
3083 +- if (!pskb_may_pull(skb, wlen) ||
3084 +- skb_try_make_writable(skb, wlen))
3085 ++ buf = skb_header_pointer(skb, offset, sizeof(buf_), &buf_);
3086 ++ if (unlikely(!buf))
3087 + return 0;
3088 +
3089 +- dscp = ipv4_get_dsfield(ip_hdr(skb)) >> 2;
3090 +- if (wash && dscp)
3091 ++ /* ToS is in the second byte of iphdr */
3092 ++ dscp = ipv4_get_dsfield((struct iphdr *)buf) >> 2;
3093 ++
3094 ++ if (wash && dscp) {
3095 ++ const int wlen = offset + sizeof(struct iphdr);
3096 ++
3097 ++ if (!pskb_may_pull(skb, wlen) ||
3098 ++ skb_try_make_writable(skb, wlen))
3099 ++ return 0;
3100 ++
3101 + ipv4_change_dsfield(ip_hdr(skb), INET_ECN_MASK, 0);
3102 ++ }
3103 ++
3104 + return dscp;
3105 +
3106 + case htons(ETH_P_IPV6):
3107 +- wlen += sizeof(struct ipv6hdr);
3108 +- if (!pskb_may_pull(skb, wlen) ||
3109 +- skb_try_make_writable(skb, wlen))
3110 ++ buf = skb_header_pointer(skb, offset, sizeof(buf_), &buf_);
3111 ++ if (unlikely(!buf))
3112 + return 0;
3113 +
3114 +- dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> 2;
3115 +- if (wash && dscp)
3116 ++ /* Traffic class is in the first and second bytes of ipv6hdr */
3117 ++ dscp = ipv6_get_dsfield((struct ipv6hdr *)buf) >> 2;
3118 ++
3119 ++ if (wash && dscp) {
3120 ++ const int wlen = offset + sizeof(struct ipv6hdr);
3121 ++
3122 ++ if (!pskb_may_pull(skb, wlen) ||
3123 ++ skb_try_make_writable(skb, wlen))
3124 ++ return 0;
3125 ++
3126 + ipv6_change_dsfield(ipv6_hdr(skb), INET_ECN_MASK, 0);
3127 ++ }
3128 ++
3129 + return dscp;
3130 +
3131 + case htons(ETH_P_ARP):
3132 +@@ -1550,13 +1569,16 @@ static struct cake_tin_data *cake_select_tin(struct Qdisc *sch,
3133 + {
3134 + struct cake_sched_data *q = qdisc_priv(sch);
3135 + u32 tin;
3136 ++ bool wash;
3137 + u8 dscp;
3138 +
3139 + /* Tin selection: Default to diffserv-based selection, allow overriding
3140 +- * using firewall marks or skb->priority.
3141 ++ * using firewall marks or skb->priority. Call DSCP parsing early if
3142 ++ * wash is enabled, otherwise defer to below to skip unneeded parsing.
3143 + */
3144 +- dscp = cake_handle_diffserv(skb,
3145 +- q->rate_flags & CAKE_FLAG_WASH);
3146 ++ wash = !!(q->rate_flags & CAKE_FLAG_WASH);
3147 ++ if (wash)
3148 ++ dscp = cake_handle_diffserv(skb, wash);
3149 +
3150 + if (q->tin_mode == CAKE_DIFFSERV_BESTEFFORT)
3151 + tin = 0;
3152 +@@ -1567,6 +1589,8 @@ static struct cake_tin_data *cake_select_tin(struct Qdisc *sch,
3153 + tin = q->tin_order[TC_H_MIN(skb->priority) - 1];
3154 +
3155 + else {
3156 ++ if (!wash)
3157 ++ dscp = cake_handle_diffserv(skb, wash);
3158 + tin = q->tin_index[dscp];
3159 +
3160 + if (unlikely(tin >= q->tin_cnt))
3161 +@@ -2630,7 +2654,7 @@ static int cake_init(struct Qdisc *sch, struct nlattr *opt,
3162 + qdisc_watchdog_init(&q->watchdog, sch);
3163 +
3164 + if (opt) {
3165 +- int err = cake_change(sch, opt, extack);
3166 ++ err = cake_change(sch, opt, extack);
3167 +
3168 + if (err)
3169 + return err;
3170 +@@ -2944,7 +2968,7 @@ static int cake_dump_class_stats(struct Qdisc *sch, unsigned long cl,
3171 + PUT_STAT_S32(BLUE_TIMER_US,
3172 + ktime_to_us(
3173 + ktime_sub(now,
3174 +- flow->cvars.blue_timer)));
3175 ++ flow->cvars.blue_timer)));
3176 + }
3177 + if (flow->cvars.dropping) {
3178 + PUT_STAT_S32(DROP_NEXT_US,
3179 +diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
3180 +index 8a4d01e427a2..119e20cad662 100644
3181 +--- a/net/sched/sch_generic.c
3182 ++++ b/net/sched/sch_generic.c
3183 +@@ -487,6 +487,7 @@ void __netdev_watchdog_up(struct net_device *dev)
3184 + dev_hold(dev);
3185 + }
3186 + }
3187 ++EXPORT_SYMBOL_GPL(__netdev_watchdog_up);
3188 +
3189 + static void dev_watchdog_up(struct net_device *dev)
3190 + {
3191 +diff --git a/net/sctp/associola.c b/net/sctp/associola.c
3192 +index f68ccd1f4860..d17708800652 100644
3193 +--- a/net/sctp/associola.c
3194 ++++ b/net/sctp/associola.c
3195 +@@ -1593,12 +1593,15 @@ void sctp_assoc_rwnd_decrease(struct sctp_association *asoc, unsigned int len)
3196 + int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc,
3197 + enum sctp_scope scope, gfp_t gfp)
3198 + {
3199 ++ struct sock *sk = asoc->base.sk;
3200 + int flags;
3201 +
3202 + /* Use scoping rules to determine the subset of addresses from
3203 + * the endpoint.
3204 + */
3205 +- flags = (PF_INET6 == asoc->base.sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0;
3206 ++ flags = (PF_INET6 == sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0;
3207 ++ if (!inet_v6_ipv6only(sk))
3208 ++ flags |= SCTP_ADDR4_ALLOWED;
3209 + if (asoc->peer.ipv4_address)
3210 + flags |= SCTP_ADDR4_PEERSUPP;
3211 + if (asoc->peer.ipv6_address)
3212 +diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
3213 +index 7df3704982f5..38d01cfb313e 100644
3214 +--- a/net/sctp/bind_addr.c
3215 ++++ b/net/sctp/bind_addr.c
3216 +@@ -453,6 +453,7 @@ static int sctp_copy_one_addr(struct net *net, struct sctp_bind_addr *dest,
3217 + * well as the remote peer.
3218 + */
3219 + if ((((AF_INET == addr->sa.sa_family) &&
3220 ++ (flags & SCTP_ADDR4_ALLOWED) &&
3221 + (flags & SCTP_ADDR4_PEERSUPP))) ||
3222 + (((AF_INET6 == addr->sa.sa_family) &&
3223 + (flags & SCTP_ADDR6_ALLOWED) &&
3224 +diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
3225 +index 787c59d798f4..af054f38341b 100644
3226 +--- a/net/sctp/protocol.c
3227 ++++ b/net/sctp/protocol.c
3228 +@@ -163,7 +163,8 @@ int sctp_copy_local_addr_list(struct net *net, struct sctp_bind_addr *bp,
3229 + * sock as well as the remote peer.
3230 + */
3231 + if (addr->a.sa.sa_family == AF_INET &&
3232 +- !(copy_flags & SCTP_ADDR4_PEERSUPP))
3233 ++ (!(copy_flags & SCTP_ADDR4_ALLOWED) ||
3234 ++ !(copy_flags & SCTP_ADDR4_PEERSUPP)))
3235 + continue;
3236 + if (addr->a.sa.sa_family == AF_INET6 &&
3237 + (!(copy_flags & SCTP_ADDR6_ALLOWED) ||
3238 +diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
3239 +index 4fda18d47e2c..285eab5b43c8 100644
3240 +--- a/net/sunrpc/rpc_pipe.c
3241 ++++ b/net/sunrpc/rpc_pipe.c
3242 +@@ -1331,6 +1331,7 @@ rpc_gssd_dummy_populate(struct dentry *root, struct rpc_pipe *pipe_data)
3243 + q.len = strlen(gssd_dummy_clnt_dir[0].name);
3244 + clnt_dentry = d_hash_and_lookup(gssd_dentry, &q);
3245 + if (!clnt_dentry) {
3246 ++ __rpc_depopulate(gssd_dentry, gssd_dummy_clnt_dir, 0, 1);
3247 + pipe_dentry = ERR_PTR(-ENOENT);
3248 + goto out;
3249 + }
3250 +diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
3251 +index ac16f509c95c..540e340e2565 100644
3252 +--- a/net/sunrpc/xdr.c
3253 ++++ b/net/sunrpc/xdr.c
3254 +@@ -1036,6 +1036,7 @@ xdr_buf_subsegment(struct xdr_buf *buf, struct xdr_buf *subbuf,
3255 + base = 0;
3256 + } else {
3257 + base -= buf->head[0].iov_len;
3258 ++ subbuf->head[0].iov_base = buf->head[0].iov_base;
3259 + subbuf->head[0].iov_len = 0;
3260 + }
3261 +
3262 +@@ -1048,6 +1049,8 @@ xdr_buf_subsegment(struct xdr_buf *buf, struct xdr_buf *subbuf,
3263 + base = 0;
3264 + } else {
3265 + base -= buf->page_len;
3266 ++ subbuf->pages = buf->pages;
3267 ++ subbuf->page_base = 0;
3268 + subbuf->page_len = 0;
3269 + }
3270 +
3271 +@@ -1059,6 +1062,7 @@ xdr_buf_subsegment(struct xdr_buf *buf, struct xdr_buf *subbuf,
3272 + base = 0;
3273 + } else {
3274 + base -= buf->tail[0].iov_len;
3275 ++ subbuf->tail[0].iov_base = buf->tail[0].iov_base;
3276 + subbuf->tail[0].iov_len = 0;
3277 + }
3278 +
3279 +diff --git a/net/xfrm/xfrm_device.c b/net/xfrm/xfrm_device.c
3280 +index 8634ce677142..e7a0ce98479f 100644
3281 +--- a/net/xfrm/xfrm_device.c
3282 ++++ b/net/xfrm/xfrm_device.c
3283 +@@ -33,7 +33,7 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur
3284 + netdev_features_t esp_features = features;
3285 + struct xfrm_offload *xo = xfrm_offload(skb);
3286 +
3287 +- if (!xo)
3288 ++ if (!xo || (xo->flags & XFRM_XMIT))
3289 + return skb;
3290 +
3291 + if (!(features & NETIF_F_HW_ESP))
3292 +@@ -53,6 +53,8 @@ struct sk_buff *validate_xmit_xfrm(struct sk_buff *skb, netdev_features_t featur
3293 + return skb;
3294 + }
3295 +
3296 ++ xo->flags |= XFRM_XMIT;
3297 ++
3298 + if (skb_is_gso(skb)) {
3299 + struct net_device *dev = skb->dev;
3300 +
3301 +diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
3302 +index ce53639a864a..c830750d725b 100644
3303 +--- a/scripts/Kbuild.include
3304 ++++ b/scripts/Kbuild.include
3305 +@@ -81,20 +81,21 @@ cc-cross-prefix = \
3306 + fi)))
3307 +
3308 + # output directory for tests below
3309 +-TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
3310 ++TMPOUT = $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_$$$$
3311 +
3312 + # try-run
3313 + # Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
3314 + # Exit code chooses option. "$$TMP" serves as a temporary file and is
3315 + # automatically cleaned up.
3316 + try-run = $(shell set -e; \
3317 +- TMP="$(TMPOUT).$$$$.tmp"; \
3318 +- TMPO="$(TMPOUT).$$$$.o"; \
3319 ++ TMP=$(TMPOUT)/tmp; \
3320 ++ TMPO=$(TMPOUT)/tmp.o; \
3321 ++ mkdir -p $(TMPOUT); \
3322 ++ trap "rm -rf $(TMPOUT)" EXIT; \
3323 + if ($(1)) >/dev/null 2>&1; \
3324 + then echo "$(2)"; \
3325 + else echo "$(3)"; \
3326 +- fi; \
3327 +- rm -f "$$TMP" "$$TMPO")
3328 ++ fi)
3329 +
3330 + # as-option
3331 + # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
3332 +diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
3333 +index 5e32fe434140..898752b818dc 100644
3334 +--- a/security/apparmor/lsm.c
3335 ++++ b/security/apparmor/lsm.c
3336 +@@ -130,11 +130,11 @@ static int apparmor_ptrace_traceme(struct task_struct *parent)
3337 + struct aa_label *tracer, *tracee;
3338 + int error;
3339 +
3340 +- tracee = begin_current_label_crit_section();
3341 ++ tracee = __begin_current_label_crit_section();
3342 + tracer = aa_get_task_label(parent);
3343 + error = aa_may_ptrace(tracer, tracee, AA_PTRACE_TRACE);
3344 + aa_put_label(tracer);
3345 +- end_current_label_crit_section(tracee);
3346 ++ __end_current_label_crit_section(tracee);
3347 +
3348 + return error;
3349 + }
3350 +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
3351 +index 1d83c3c59e1a..419d099b5582 100644
3352 +--- a/sound/pci/hda/patch_hdmi.c
3353 ++++ b/sound/pci/hda/patch_hdmi.c
3354 +@@ -3898,6 +3898,11 @@ HDA_CODEC_ENTRY(0x10de0095, "GPU 95 HDMI/DP", patch_nvhdmi),
3355 + HDA_CODEC_ENTRY(0x10de0097, "GPU 97 HDMI/DP", patch_nvhdmi),
3356 + HDA_CODEC_ENTRY(0x10de0098, "GPU 98 HDMI/DP", patch_nvhdmi),
3357 + HDA_CODEC_ENTRY(0x10de0099, "GPU 99 HDMI/DP", patch_nvhdmi),
3358 ++HDA_CODEC_ENTRY(0x10de009a, "GPU 9a HDMI/DP", patch_nvhdmi),
3359 ++HDA_CODEC_ENTRY(0x10de009d, "GPU 9d HDMI/DP", patch_nvhdmi),
3360 ++HDA_CODEC_ENTRY(0x10de009e, "GPU 9e HDMI/DP", patch_nvhdmi),
3361 ++HDA_CODEC_ENTRY(0x10de009f, "GPU 9f HDMI/DP", patch_nvhdmi),
3362 ++HDA_CODEC_ENTRY(0x10de00a0, "GPU a0 HDMI/DP", patch_nvhdmi),
3363 + HDA_CODEC_ENTRY(0x10de8001, "MCP73 HDMI", patch_nvhdmi_2ch),
3364 + HDA_CODEC_ENTRY(0x10de8067, "MCP67/68 HDMI", patch_nvhdmi_2ch),
3365 + HDA_CODEC_ENTRY(0x11069f80, "VX900 HDMI/DP", patch_via_hdmi),
3366 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
3367 +index 623ebe2e7db4..beec9e3b6205 100644
3368 +--- a/sound/pci/hda/patch_realtek.c
3369 ++++ b/sound/pci/hda/patch_realtek.c
3370 +@@ -2446,6 +2446,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
3371 + SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
3372 + SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_CLEVO_P950),
3373 + SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
3374 ++ SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
3375 + SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
3376 + SND_PCI_QUIRK(0x1462, 0x1275, "MSI-GL63", ALC1220_FIXUP_CLEVO_P950),
3377 + SND_PCI_QUIRK(0x1462, 0x1276, "MSI-GL73", ALC1220_FIXUP_CLEVO_P950),
3378 +@@ -3918,6 +3919,16 @@ static void alc269_fixup_hp_gpio_led(struct hda_codec *codec,
3379 + alc_fixup_hp_gpio_led(codec, action, 0x08, 0x10);
3380 + }
3381 +
3382 ++static void alc285_fixup_hp_gpio_led(struct hda_codec *codec,
3383 ++ const struct hda_fixup *fix, int action)
3384 ++{
3385 ++ struct alc_spec *spec = codec->spec;
3386 ++
3387 ++ spec->micmute_led_polarity = 1;
3388 ++
3389 ++ alc_fixup_hp_gpio_led(codec, action, 0x04, 0x01);
3390 ++}
3391 ++
3392 + static void alc286_fixup_hp_gpio_led(struct hda_codec *codec,
3393 + const struct hda_fixup *fix, int action)
3394 + {
3395 +@@ -5747,7 +5758,8 @@ enum {
3396 + ALC289_FIXUP_DUAL_SPK,
3397 + ALC294_FIXUP_SPK2_TO_DAC1,
3398 + ALC294_FIXUP_ASUS_DUAL_SPK,
3399 +-
3400 ++ ALC294_FIXUP_ASUS_HPE,
3401 ++ ALC285_FIXUP_HP_GPIO_LED,
3402 + };
3403 +
3404 + static const struct hda_fixup alc269_fixups[] = {
3405 +@@ -6836,7 +6848,21 @@ static const struct hda_fixup alc269_fixups[] = {
3406 + .chained = true,
3407 + .chain_id = ALC294_FIXUP_SPK2_TO_DAC1
3408 + },
3409 +-
3410 ++ [ALC294_FIXUP_ASUS_HPE] = {
3411 ++ .type = HDA_FIXUP_VERBS,
3412 ++ .v.verbs = (const struct hda_verb[]) {
3413 ++ /* Set EAPD high */
3414 ++ { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f },
3415 ++ { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 },
3416 ++ { }
3417 ++ },
3418 ++ .chained = true,
3419 ++ .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
3420 ++ },
3421 ++ [ALC285_FIXUP_HP_GPIO_LED] = {
3422 ++ .type = HDA_FIXUP_FUNC,
3423 ++ .v.func = alc285_fixup_hp_gpio_led,
3424 ++ },
3425 + };
3426 +
3427 + static const struct snd_pci_quirk alc269_fixup_tbl[] = {
3428 +@@ -6981,6 +7007,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
3429 + SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
3430 + SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3),
3431 + SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
3432 ++ SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_LED),
3433 + SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
3434 + SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
3435 + SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
3436 +@@ -6999,6 +7026,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
3437 + SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
3438 + SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK),
3439 + SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC),
3440 ++ SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE),
3441 + SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
3442 + SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC),
3443 + SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
3444 +diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
3445 +index d83be26d6446..0e2bdad373d6 100644
3446 +--- a/sound/soc/fsl/fsl_ssi.c
3447 ++++ b/sound/soc/fsl/fsl_ssi.c
3448 +@@ -678,8 +678,9 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream,
3449 + struct regmap *regs = ssi->regs;
3450 + u32 pm = 999, div2, psr, stccr, mask, afreq, factor, i;
3451 + unsigned long clkrate, baudrate, tmprate;
3452 +- unsigned int slots = params_channels(hw_params);
3453 +- unsigned int slot_width = 32;
3454 ++ unsigned int channels = params_channels(hw_params);
3455 ++ unsigned int slot_width = params_width(hw_params);
3456 ++ unsigned int slots = 2;
3457 + u64 sub, savesub = 100000;
3458 + unsigned int freq;
3459 + bool baudclk_is_used;
3460 +@@ -688,10 +689,14 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream,
3461 + /* Override slots and slot_width if being specifically set... */
3462 + if (ssi->slots)
3463 + slots = ssi->slots;
3464 +- /* ...but keep 32 bits if slots is 2 -- I2S Master mode */
3465 +- if (ssi->slot_width && slots != 2)
3466 ++ if (ssi->slot_width)
3467 + slot_width = ssi->slot_width;
3468 +
3469 ++ /* ...but force 32 bits for stereo audio using I2S Master Mode */
3470 ++ if (channels == 2 &&
3471 ++ (ssi->i2s_net & SSI_SCR_I2S_MODE_MASK) == SSI_SCR_I2S_MODE_MASTER)
3472 ++ slot_width = 32;
3473 ++
3474 + /* Generate bit clock based on the slot number and slot width */
3475 + freq = slots * slot_width * params_rate(hw_params);
3476 +
3477 +diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c
3478 +index 2b2c7233bb5f..1bdacf797613 100644
3479 +--- a/sound/soc/qcom/qdsp6/q6asm.c
3480 ++++ b/sound/soc/qcom/qdsp6/q6asm.c
3481 +@@ -25,6 +25,7 @@
3482 + #define ASM_STREAM_CMD_FLUSH 0x00010BCE
3483 + #define ASM_SESSION_CMD_PAUSE 0x00010BD3
3484 + #define ASM_DATA_CMD_EOS 0x00010BDB
3485 ++#define ASM_DATA_EVENT_RENDERED_EOS 0x00010C1C
3486 + #define ASM_NULL_POPP_TOPOLOGY 0x00010C68
3487 + #define ASM_STREAM_CMD_FLUSH_READBUFS 0x00010C09
3488 + #define ASM_STREAM_CMD_SET_ENCDEC_PARAM 0x00010C10
3489 +@@ -545,9 +546,6 @@ static int32_t q6asm_stream_callback(struct apr_device *adev,
3490 + case ASM_SESSION_CMD_SUSPEND:
3491 + client_event = ASM_CLIENT_EVENT_CMD_SUSPEND_DONE;
3492 + break;
3493 +- case ASM_DATA_CMD_EOS:
3494 +- client_event = ASM_CLIENT_EVENT_CMD_EOS_DONE;
3495 +- break;
3496 + case ASM_STREAM_CMD_FLUSH:
3497 + client_event = ASM_CLIENT_EVENT_CMD_FLUSH_DONE;
3498 + break;
3499 +@@ -650,6 +648,9 @@ static int32_t q6asm_stream_callback(struct apr_device *adev,
3500 + spin_unlock_irqrestore(&ac->lock, flags);
3501 + }
3502 +
3503 ++ break;
3504 ++ case ASM_DATA_EVENT_RENDERED_EOS:
3505 ++ client_event = ASM_CLIENT_EVENT_CMD_EOS_DONE;
3506 + break;
3507 + }
3508 +
3509 +diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c
3510 +index 8a2e3bbce3a1..ad16c8310dd3 100644
3511 +--- a/sound/soc/rockchip/rockchip_pdm.c
3512 ++++ b/sound/soc/rockchip/rockchip_pdm.c
3513 +@@ -478,8 +478,10 @@ static int rockchip_pdm_resume(struct device *dev)
3514 + int ret;
3515 +
3516 + ret = pm_runtime_get_sync(dev);
3517 +- if (ret < 0)
3518 ++ if (ret < 0) {
3519 ++ pm_runtime_put(dev);
3520 + return ret;
3521 ++ }
3522 +
3523 + ret = regcache_sync(pdm->regmap);
3524 +
3525 +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
3526 +index 8a0211131fc6..45bd3d54be54 100644
3527 +--- a/sound/usb/mixer.c
3528 ++++ b/sound/usb/mixer.c
3529 +@@ -591,8 +591,9 @@ static int check_matrix_bitmap(unsigned char *bmap,
3530 + * if failed, give up and free the control instance.
3531 + */
3532 +
3533 +-int snd_usb_mixer_add_control(struct usb_mixer_elem_list *list,
3534 +- struct snd_kcontrol *kctl)
3535 ++int snd_usb_mixer_add_list(struct usb_mixer_elem_list *list,
3536 ++ struct snd_kcontrol *kctl,
3537 ++ bool is_std_info)
3538 + {
3539 + struct usb_mixer_interface *mixer = list->mixer;
3540 + int err;
3541 +@@ -606,6 +607,7 @@ int snd_usb_mixer_add_control(struct usb_mixer_elem_list *list,
3542 + return err;
3543 + }
3544 + list->kctl = kctl;
3545 ++ list->is_std_info = is_std_info;
3546 + list->next_id_elem = mixer->id_elems[list->id];
3547 + mixer->id_elems[list->id] = list;
3548 + return 0;
3549 +@@ -3232,8 +3234,11 @@ void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid)
3550 + unitid = delegate_notify(mixer, unitid, NULL, NULL);
3551 +
3552 + for_each_mixer_elem(list, mixer, unitid) {
3553 +- struct usb_mixer_elem_info *info =
3554 +- mixer_elem_list_to_info(list);
3555 ++ struct usb_mixer_elem_info *info;
3556 ++
3557 ++ if (!list->is_std_info)
3558 ++ continue;
3559 ++ info = mixer_elem_list_to_info(list);
3560 + /* invalidate cache, so the value is read from the device */
3561 + info->cached = 0;
3562 + snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
3563 +@@ -3313,6 +3318,8 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer,
3564 +
3565 + if (!list->kctl)
3566 + continue;
3567 ++ if (!list->is_std_info)
3568 ++ continue;
3569 +
3570 + info = mixer_elem_list_to_info(list);
3571 + if (count > 1 && info->control != control)
3572 +diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h
3573 +index 15ec90e96d4d..f7e6fe1a96f9 100644
3574 +--- a/sound/usb/mixer.h
3575 ++++ b/sound/usb/mixer.h
3576 +@@ -59,6 +59,7 @@ struct usb_mixer_elem_list {
3577 + struct usb_mixer_elem_list *next_id_elem; /* list of controls with same id */
3578 + struct snd_kcontrol *kctl;
3579 + unsigned int id;
3580 ++ bool is_std_info;
3581 + usb_mixer_elem_dump_func_t dump;
3582 + usb_mixer_elem_resume_func_t resume;
3583 + };
3584 +@@ -96,8 +97,12 @@ void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid);
3585 + int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
3586 + int request, int validx, int value_set);
3587 +
3588 +-int snd_usb_mixer_add_control(struct usb_mixer_elem_list *list,
3589 +- struct snd_kcontrol *kctl);
3590 ++int snd_usb_mixer_add_list(struct usb_mixer_elem_list *list,
3591 ++ struct snd_kcontrol *kctl,
3592 ++ bool is_std_info);
3593 ++
3594 ++#define snd_usb_mixer_add_control(list, kctl) \
3595 ++ snd_usb_mixer_add_list(list, kctl, true)
3596 +
3597 + void snd_usb_mixer_elem_init_std(struct usb_mixer_elem_list *list,
3598 + struct usb_mixer_interface *mixer,
3599 +diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
3600 +index 983e8a3ebfcf..21c1135bb89b 100644
3601 +--- a/sound/usb/mixer_quirks.c
3602 ++++ b/sound/usb/mixer_quirks.c
3603 +@@ -168,7 +168,8 @@ static int add_single_ctl_with_resume(struct usb_mixer_interface *mixer,
3604 + return -ENOMEM;
3605 + }
3606 + kctl->private_free = snd_usb_mixer_elem_free;
3607 +- return snd_usb_mixer_add_control(list, kctl);
3608 ++ /* don't use snd_usb_mixer_add_control() here, this is a special list element */
3609 ++ return snd_usb_mixer_add_list(list, kctl, false);
3610 + }
3611 +
3612 + /*
3613 +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
3614 +index aac23acfdd36..8b5bc809efd3 100644
3615 +--- a/sound/usb/quirks.c
3616 ++++ b/sound/usb/quirks.c
3617 +@@ -1203,6 +1203,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip)
3618 + static bool is_itf_usb_dsd_dac(unsigned int id)
3619 + {
3620 + switch (id) {
3621 ++ case USB_ID(0x154e, 0x1002): /* Denon DCD-1500RE */
3622 + case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */
3623 + case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */
3624 + case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */
3625 +@@ -1344,6 +1345,14 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
3626 + chip->usb_id == USB_ID(0x0951, 0x16ad)) &&
3627 + (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
3628 + usleep_range(1000, 2000);
3629 ++
3630 ++ /*
3631 ++ * Samsung USBC Headset (AKG) need a tiny delay after each
3632 ++ * class compliant request. (Model number: AAM625R or AAM627R)
3633 ++ */
3634 ++ if (chip->usb_id == USB_ID(0x04e8, 0xa051) &&
3635 ++ (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)
3636 ++ usleep_range(5000, 6000);
3637 + }
3638 +
3639 + /*