Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.4 commit in: /
Date: Wed, 05 Aug 2020 14:45:52
Message-Id: 1596638725.84f693cf79638d3350eda3ac45f50eebb618b0af.whissi@gentoo
1 commit: 84f693cf79638d3350eda3ac45f50eebb618b0af
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 5 14:45:25 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 5 14:45:25 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=84f693cf
7
8 Linux patch 5.4.56
9
10 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
11
12 0000_README | 4 +
13 1055_linux-5.4.56.patch | 2697 +++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2701 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 9289fff..0a219d2 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -263,6 +263,10 @@ Patch: 1054_linux-5.4.55.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.4.55
23
24 +Patch: 1055_linux-5.4.56.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.4.56
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/1055_linux-5.4.56.patch b/1055_linux-5.4.56.patch
33 new file mode 100644
34 index 0000000..fd7909a
35 --- /dev/null
36 +++ b/1055_linux-5.4.56.patch
37 @@ -0,0 +1,2697 @@
38 +diff --git a/Makefile b/Makefile
39 +index 072fe0eaa740..c33fb4eebd4d 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 5
45 + PATCHLEVEL = 4
46 +-SUBLEVEL = 55
47 ++SUBLEVEL = 56
48 + EXTRAVERSION =
49 + NAME = Kleptomaniac Octopus
50 +
51 +diff --git a/arch/arm/boot/dts/armada-38x.dtsi b/arch/arm/boot/dts/armada-38x.dtsi
52 +index 3f4bb44d85f0..669da3a33d82 100644
53 +--- a/arch/arm/boot/dts/armada-38x.dtsi
54 ++++ b/arch/arm/boot/dts/armada-38x.dtsi
55 +@@ -339,7 +339,8 @@
56 +
57 + comphy: phy@18300 {
58 + compatible = "marvell,armada-380-comphy";
59 +- reg = <0x18300 0x100>;
60 ++ reg-names = "comphy", "conf";
61 ++ reg = <0x18300 0x100>, <0x18460 4>;
62 + #address-cells = <1>;
63 + #size-cells = <0>;
64 +
65 +diff --git a/arch/arm/boot/dts/imx6qdl-icore.dtsi b/arch/arm/boot/dts/imx6qdl-icore.dtsi
66 +index 7814f1ef0804..fde56f98398d 100644
67 +--- a/arch/arm/boot/dts/imx6qdl-icore.dtsi
68 ++++ b/arch/arm/boot/dts/imx6qdl-icore.dtsi
69 +@@ -384,7 +384,7 @@
70 +
71 + pinctrl_usbotg: usbotggrp {
72 + fsl,pins = <
73 +- MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
74 ++ MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059
75 + >;
76 + };
77 +
78 +@@ -396,6 +396,7 @@
79 + MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17070
80 + MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17070
81 + MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17070
82 ++ MX6QDL_PAD_GPIO_1__GPIO1_IO01 0x1b0b0
83 + >;
84 + };
85 +
86 +diff --git a/arch/arm/boot/dts/imx6sx-sabreauto.dts b/arch/arm/boot/dts/imx6sx-sabreauto.dts
87 +index 315044ccd65f..e4719566133c 100644
88 +--- a/arch/arm/boot/dts/imx6sx-sabreauto.dts
89 ++++ b/arch/arm/boot/dts/imx6sx-sabreauto.dts
90 +@@ -99,7 +99,7 @@
91 + &fec2 {
92 + pinctrl-names = "default";
93 + pinctrl-0 = <&pinctrl_enet2>;
94 +- phy-mode = "rgmii";
95 ++ phy-mode = "rgmii-id";
96 + phy-handle = <&ethphy0>;
97 + fsl,magic-packet;
98 + status = "okay";
99 +diff --git a/arch/arm/boot/dts/imx6sx-sdb.dtsi b/arch/arm/boot/dts/imx6sx-sdb.dtsi
100 +index f6972deb5e39..865528b134d8 100644
101 +--- a/arch/arm/boot/dts/imx6sx-sdb.dtsi
102 ++++ b/arch/arm/boot/dts/imx6sx-sdb.dtsi
103 +@@ -213,7 +213,7 @@
104 + &fec2 {
105 + pinctrl-names = "default";
106 + pinctrl-0 = <&pinctrl_enet2>;
107 +- phy-mode = "rgmii";
108 ++ phy-mode = "rgmii-id";
109 + phy-handle = <&ethphy2>;
110 + status = "okay";
111 + };
112 +diff --git a/arch/arm/boot/dts/sun4i-a10.dtsi b/arch/arm/boot/dts/sun4i-a10.dtsi
113 +index 4c268b70b735..e0a9b371c248 100644
114 +--- a/arch/arm/boot/dts/sun4i-a10.dtsi
115 ++++ b/arch/arm/boot/dts/sun4i-a10.dtsi
116 +@@ -198,7 +198,7 @@
117 + default-pool {
118 + compatible = "shared-dma-pool";
119 + size = <0x6000000>;
120 +- alloc-ranges = <0x4a000000 0x6000000>;
121 ++ alloc-ranges = <0x40000000 0x10000000>;
122 + reusable;
123 + linux,cma-default;
124 + };
125 +diff --git a/arch/arm/boot/dts/sun5i.dtsi b/arch/arm/boot/dts/sun5i.dtsi
126 +index 6befa236ba99..fd31da8fd311 100644
127 +--- a/arch/arm/boot/dts/sun5i.dtsi
128 ++++ b/arch/arm/boot/dts/sun5i.dtsi
129 +@@ -117,7 +117,7 @@
130 + default-pool {
131 + compatible = "shared-dma-pool";
132 + size = <0x6000000>;
133 +- alloc-ranges = <0x4a000000 0x6000000>;
134 ++ alloc-ranges = <0x40000000 0x10000000>;
135 + reusable;
136 + linux,cma-default;
137 + };
138 +diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
139 +index 8aebefd6accf..1f8b45f07e58 100644
140 +--- a/arch/arm/boot/dts/sun7i-a20.dtsi
141 ++++ b/arch/arm/boot/dts/sun7i-a20.dtsi
142 +@@ -180,7 +180,7 @@
143 + default-pool {
144 + compatible = "shared-dma-pool";
145 + size = <0x6000000>;
146 +- alloc-ranges = <0x4a000000 0x6000000>;
147 ++ alloc-ranges = <0x40000000 0x10000000>;
148 + reusable;
149 + linux,cma-default;
150 + };
151 +diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c
152 +index b0c195e3a06d..5f95e4b911a0 100644
153 +--- a/arch/arm/kernel/hw_breakpoint.c
154 ++++ b/arch/arm/kernel/hw_breakpoint.c
155 +@@ -680,6 +680,12 @@ static void disable_single_step(struct perf_event *bp)
156 + arch_install_hw_breakpoint(bp);
157 + }
158 +
159 ++static int watchpoint_fault_on_uaccess(struct pt_regs *regs,
160 ++ struct arch_hw_breakpoint *info)
161 ++{
162 ++ return !user_mode(regs) && info->ctrl.privilege == ARM_BREAKPOINT_USER;
163 ++}
164 ++
165 + static void watchpoint_handler(unsigned long addr, unsigned int fsr,
166 + struct pt_regs *regs)
167 + {
168 +@@ -739,16 +745,27 @@ static void watchpoint_handler(unsigned long addr, unsigned int fsr,
169 + }
170 +
171 + pr_debug("watchpoint fired: address = 0x%x\n", info->trigger);
172 ++
173 ++ /*
174 ++ * If we triggered a user watchpoint from a uaccess routine,
175 ++ * then handle the stepping ourselves since userspace really
176 ++ * can't help us with this.
177 ++ */
178 ++ if (watchpoint_fault_on_uaccess(regs, info))
179 ++ goto step;
180 ++
181 + perf_bp_event(wp, regs);
182 +
183 + /*
184 +- * If no overflow handler is present, insert a temporary
185 +- * mismatch breakpoint so we can single-step over the
186 +- * watchpoint trigger.
187 ++ * Defer stepping to the overflow handler if one is installed.
188 ++ * Otherwise, insert a temporary mismatch breakpoint so that
189 ++ * we can single-step over the watchpoint trigger.
190 + */
191 +- if (is_default_overflow_handler(wp))
192 +- enable_single_step(wp, instruction_pointer(regs));
193 ++ if (!is_default_overflow_handler(wp))
194 ++ goto unlock;
195 +
196 ++step:
197 ++ enable_single_step(wp, instruction_pointer(regs));
198 + unlock:
199 + rcu_read_unlock();
200 + }
201 +diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h
202 +index 12f0eb56a1cc..619db9b4c9d5 100644
203 +--- a/arch/arm64/include/asm/alternative.h
204 ++++ b/arch/arm64/include/asm/alternative.h
205 +@@ -77,9 +77,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
206 + "663:\n\t" \
207 + newinstr "\n" \
208 + "664:\n\t" \
209 +- ".previous\n\t" \
210 + ".org . - (664b-663b) + (662b-661b)\n\t" \
211 +- ".org . - (662b-661b) + (664b-663b)\n" \
212 ++ ".org . - (662b-661b) + (664b-663b)\n\t" \
213 ++ ".previous\n" \
214 + ".endif\n"
215 +
216 + #define __ALTERNATIVE_CFG_CB(oldinstr, feature, cfg_enabled, cb) \
217 +diff --git a/arch/arm64/include/asm/checksum.h b/arch/arm64/include/asm/checksum.h
218 +index d064a50deb5f..5665a3fc14be 100644
219 +--- a/arch/arm64/include/asm/checksum.h
220 ++++ b/arch/arm64/include/asm/checksum.h
221 +@@ -19,16 +19,17 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
222 + {
223 + __uint128_t tmp;
224 + u64 sum;
225 ++ int n = ihl; /* we want it signed */
226 +
227 + tmp = *(const __uint128_t *)iph;
228 + iph += 16;
229 +- ihl -= 4;
230 ++ n -= 4;
231 + tmp += ((tmp >> 64) | (tmp << 64));
232 + sum = tmp >> 64;
233 + do {
234 + sum += *(const u32 *)iph;
235 + iph += 4;
236 +- } while (--ihl);
237 ++ } while (--n > 0);
238 +
239 + sum += ((sum >> 32) | (sum << 32));
240 + return csum_fold((__force u32)(sum >> 32));
241 +diff --git a/arch/parisc/include/asm/cmpxchg.h b/arch/parisc/include/asm/cmpxchg.h
242 +index ab5c215cf46c..068958575871 100644
243 +--- a/arch/parisc/include/asm/cmpxchg.h
244 ++++ b/arch/parisc/include/asm/cmpxchg.h
245 +@@ -60,6 +60,7 @@ extern void __cmpxchg_called_with_bad_pointer(void);
246 + extern unsigned long __cmpxchg_u32(volatile unsigned int *m, unsigned int old,
247 + unsigned int new_);
248 + extern u64 __cmpxchg_u64(volatile u64 *ptr, u64 old, u64 new_);
249 ++extern u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new_);
250 +
251 + /* don't worry...optimizer will get rid of most of this */
252 + static inline unsigned long
253 +@@ -71,6 +72,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
254 + #endif
255 + case 4: return __cmpxchg_u32((unsigned int *)ptr,
256 + (unsigned int)old, (unsigned int)new_);
257 ++ case 1: return __cmpxchg_u8((u8 *)ptr, (u8)old, (u8)new_);
258 + }
259 + __cmpxchg_called_with_bad_pointer();
260 + return old;
261 +diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c
262 +index 70ffbcf889b8..2e4d1f05a926 100644
263 +--- a/arch/parisc/lib/bitops.c
264 ++++ b/arch/parisc/lib/bitops.c
265 +@@ -79,3 +79,15 @@ unsigned long __cmpxchg_u32(volatile unsigned int *ptr, unsigned int old, unsign
266 + _atomic_spin_unlock_irqrestore(ptr, flags);
267 + return (unsigned long)prev;
268 + }
269 ++
270 ++u8 __cmpxchg_u8(volatile u8 *ptr, u8 old, u8 new)
271 ++{
272 ++ unsigned long flags;
273 ++ u8 prev;
274 ++
275 ++ _atomic_spin_lock_irqsave(ptr, flags);
276 ++ if ((prev = *ptr) == old)
277 ++ *ptr = new;
278 ++ _atomic_spin_unlock_irqrestore(ptr, flags);
279 ++ return prev;
280 ++}
281 +diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
282 +index 319812923012..b1eb6a041118 100644
283 +--- a/arch/riscv/mm/init.c
284 ++++ b/arch/riscv/mm/init.c
285 +@@ -115,9 +115,9 @@ void __init setup_bootmem(void)
286 + /* Reserve from the start of the kernel to the end of the kernel */
287 + memblock_reserve(vmlinux_start, vmlinux_end - vmlinux_start);
288 +
289 +- set_max_mapnr(PFN_DOWN(mem_size));
290 + max_pfn = PFN_DOWN(memblock_end_of_DRAM());
291 + max_low_pfn = max_pfn;
292 ++ set_max_mapnr(max_low_pfn);
293 +
294 + #ifdef CONFIG_BLK_DEV_INITRD
295 + setup_initrd();
296 +diff --git a/arch/sh/include/asm/pgalloc.h b/arch/sh/include/asm/pgalloc.h
297 +index 22d968bfe9bb..d770da3f8b6f 100644
298 +--- a/arch/sh/include/asm/pgalloc.h
299 ++++ b/arch/sh/include/asm/pgalloc.h
300 +@@ -12,6 +12,7 @@ extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
301 + extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd);
302 + extern pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address);
303 + extern void pmd_free(struct mm_struct *mm, pmd_t *pmd);
304 ++#define __pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, (pmdp))
305 + #endif
306 +
307 + static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
308 +@@ -33,13 +34,4 @@ do { \
309 + tlb_remove_page((tlb), (pte)); \
310 + } while (0)
311 +
312 +-#if CONFIG_PGTABLE_LEVELS > 2
313 +-#define __pmd_free_tlb(tlb, pmdp, addr) \
314 +-do { \
315 +- struct page *page = virt_to_page(pmdp); \
316 +- pgtable_pmd_page_dtor(page); \
317 +- tlb_remove_page((tlb), page); \
318 +-} while (0);
319 +-#endif
320 +-
321 + #endif /* __ASM_SH_PGALLOC_H */
322 +diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S
323 +index d31f66e82ce5..4a8ec9e40cc2 100644
324 +--- a/arch/sh/kernel/entry-common.S
325 ++++ b/arch/sh/kernel/entry-common.S
326 +@@ -199,7 +199,7 @@ syscall_trace_entry:
327 + mov.l @(OFF_R7,r15), r7 ! arg3
328 + mov.l @(OFF_R3,r15), r3 ! syscall_nr
329 + !
330 +- mov.l 2f, r10 ! Number of syscalls
331 ++ mov.l 6f, r10 ! Number of syscalls
332 + cmp/hs r10, r3
333 + bf syscall_call
334 + mov #-ENOSYS, r0
335 +@@ -353,7 +353,7 @@ ENTRY(system_call)
336 + tst r9, r8
337 + bf syscall_trace_entry
338 + !
339 +- mov.l 2f, r8 ! Number of syscalls
340 ++ mov.l 6f, r8 ! Number of syscalls
341 + cmp/hs r8, r3
342 + bt syscall_badsys
343 + !
344 +@@ -392,7 +392,7 @@ syscall_exit:
345 + #if !defined(CONFIG_CPU_SH2)
346 + 1: .long TRA
347 + #endif
348 +-2: .long NR_syscalls
349 ++6: .long NR_syscalls
350 + 3: .long sys_call_table
351 + 7: .long do_syscall_trace_enter
352 + 8: .long do_syscall_trace_leave
353 +diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
354 +index 519649ddf100..fe522691ac71 100644
355 +--- a/arch/x86/kernel/i8259.c
356 ++++ b/arch/x86/kernel/i8259.c
357 +@@ -207,7 +207,7 @@ spurious_8259A_irq:
358 + * lets ACK and report it. [once per IRQ]
359 + */
360 + if (!(spurious_irq_mask & irqmask)) {
361 +- printk(KERN_DEBUG
362 ++ printk_deferred(KERN_DEBUG
363 + "spurious 8259A interrupt: IRQ%d.\n", irq);
364 + spurious_irq_mask |= irqmask;
365 + }
366 +diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c
367 +index 2d6898c2cb64..6d83b4b857e6 100644
368 +--- a/arch/x86/kernel/stacktrace.c
369 ++++ b/arch/x86/kernel/stacktrace.c
370 +@@ -58,7 +58,6 @@ int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry,
371 + * or a page fault), which can make frame pointers
372 + * unreliable.
373 + */
374 +-
375 + if (IS_ENABLED(CONFIG_FRAME_POINTER))
376 + return -EINVAL;
377 + }
378 +@@ -81,10 +80,6 @@ int arch_stack_walk_reliable(stack_trace_consume_fn consume_entry,
379 + if (unwind_error(&state))
380 + return -EINVAL;
381 +
382 +- /* Success path for non-user tasks, i.e. kthreads and idle tasks */
383 +- if (!(task->flags & (PF_KTHREAD | PF_IDLE)))
384 +- return -EINVAL;
385 +-
386 + return 0;
387 + }
388 +
389 +diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
390 +index aa0f39dc8129..187a86e0e753 100644
391 +--- a/arch/x86/kernel/unwind_orc.c
392 ++++ b/arch/x86/kernel/unwind_orc.c
393 +@@ -431,8 +431,11 @@ bool unwind_next_frame(struct unwind_state *state)
394 + /*
395 + * Find the orc_entry associated with the text address.
396 + *
397 +- * Decrement call return addresses by one so they work for sibling
398 +- * calls and calls to noreturn functions.
399 ++ * For a call frame (as opposed to a signal frame), state->ip points to
400 ++ * the instruction after the call. That instruction's stack layout
401 ++ * could be different from the call instruction's layout, for example
402 ++ * if the call was to a noreturn function. So get the ORC data for the
403 ++ * call instruction itself.
404 + */
405 + orc = orc_find(state->signal ? state->ip : state->ip - 1);
406 + if (!orc) {
407 +@@ -653,6 +656,7 @@ void __unwind_start(struct unwind_state *state, struct task_struct *task,
408 + state->sp = task->thread.sp;
409 + state->bp = READ_ONCE_NOCHECK(frame->bp);
410 + state->ip = READ_ONCE_NOCHECK(frame->ret_addr);
411 ++ state->signal = (void *)state->ip == ret_from_fork;
412 + }
413 +
414 + if (get_stack_info((unsigned long *)state->sp, state->task,
415 +diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
416 +index 5d2587005d0e..6920f1d3b66f 100644
417 +--- a/arch/x86/kvm/lapic.c
418 ++++ b/arch/x86/kvm/lapic.c
419 +@@ -2085,7 +2085,7 @@ void kvm_set_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu, u64 data)
420 + {
421 + struct kvm_lapic *apic = vcpu->arch.apic;
422 +
423 +- if (!lapic_in_kernel(vcpu) || apic_lvtt_oneshot(apic) ||
424 ++ if (!kvm_apic_present(vcpu) || apic_lvtt_oneshot(apic) ||
425 + apic_lvtt_period(apic))
426 + return;
427 +
428 +diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
429 +index c8da8eb160da..422193690fd4 100644
430 +--- a/drivers/crypto/ccp/ccp-ops.c
431 ++++ b/drivers/crypto/ccp/ccp-ops.c
432 +@@ -1777,8 +1777,9 @@ ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
433 + LSB_ITEM_SIZE);
434 + break;
435 + default:
436 ++ kfree(hmac_buf);
437 + ret = -EINVAL;
438 +- goto e_ctx;
439 ++ goto e_data;
440 + }
441 +
442 + memset(&hmac_cmd, 0, sizeof(hmac_cmd));
443 +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
444 +index a73206784cba..2a7da26008a2 100644
445 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
446 ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
447 +@@ -667,9 +667,10 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
448 + return n ? -EFAULT : 0;
449 + }
450 + case AMDGPU_INFO_DEV_INFO: {
451 +- struct drm_amdgpu_info_device dev_info = {};
452 ++ struct drm_amdgpu_info_device dev_info;
453 + uint64_t vm_size;
454 +
455 ++ memset(&dev_info, 0, sizeof(dev_info));
456 + dev_info.device_id = dev->pdev->device;
457 + dev_info.chip_rev = adev->rev_id;
458 + dev_info.external_rev = adev->external_rev_id;
459 +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
460 +index b66554b40db4..3f744e72912f 100644
461 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
462 ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
463 +@@ -691,7 +691,8 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,
464 + tmp_str++;
465 + while (isspace(*++tmp_str));
466 +
467 +- while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
468 ++ while (tmp_str[0]) {
469 ++ sub_str = strsep(&tmp_str, delimiter);
470 + ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
471 + if (ret)
472 + return -EINVAL;
473 +@@ -882,7 +883,8 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask)
474 + memcpy(buf_cpy, buf, bytes);
475 + buf_cpy[bytes] = '\0';
476 + tmp = buf_cpy;
477 +- while ((sub_str = strsep(&tmp, delimiter)) != NULL) {
478 ++ while (tmp[0]) {
479 ++ sub_str = strsep(&tmp, delimiter);
480 + if (strlen(sub_str)) {
481 + ret = kstrtol(sub_str, 0, &level);
482 + if (ret)
483 +@@ -1298,7 +1300,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
484 + i++;
485 + memcpy(buf_cpy, buf, count-i);
486 + tmp_str = buf_cpy;
487 +- while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
488 ++ while (tmp_str[0]) {
489 ++ sub_str = strsep(&tmp_str, delimiter);
490 + ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
491 + if (ret) {
492 + count = -EINVAL;
493 +diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
494 +index c7d8edf450d3..6091194a3955 100644
495 +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
496 ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
497 +@@ -7464,20 +7464,38 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
498 + * the same resource. If we have a new DC context as part of
499 + * the DM atomic state from validation we need to free it and
500 + * retain the existing one instead.
501 ++ *
502 ++ * Furthermore, since the DM atomic state only contains the DC
503 ++ * context and can safely be annulled, we can free the state
504 ++ * and clear the associated private object now to free
505 ++ * some memory and avoid a possible use-after-free later.
506 + */
507 +- struct dm_atomic_state *new_dm_state, *old_dm_state;
508 +
509 +- new_dm_state = dm_atomic_get_new_state(state);
510 +- old_dm_state = dm_atomic_get_old_state(state);
511 ++ for (i = 0; i < state->num_private_objs; i++) {
512 ++ struct drm_private_obj *obj = state->private_objs[i].ptr;
513 +
514 +- if (new_dm_state && old_dm_state) {
515 +- if (new_dm_state->context)
516 +- dc_release_state(new_dm_state->context);
517 ++ if (obj->funcs == adev->dm.atomic_obj.funcs) {
518 ++ int j = state->num_private_objs-1;
519 +
520 +- new_dm_state->context = old_dm_state->context;
521 ++ dm_atomic_destroy_state(obj,
522 ++ state->private_objs[i].state);
523 ++
524 ++ /* If i is not at the end of the array then the
525 ++ * last element needs to be moved to where i was
526 ++ * before the array can safely be truncated.
527 ++ */
528 ++ if (i != j)
529 ++ state->private_objs[i] =
530 ++ state->private_objs[j];
531 +
532 +- if (old_dm_state->context)
533 +- dc_retain_state(old_dm_state->context);
534 ++ state->private_objs[j].ptr = NULL;
535 ++ state->private_objs[j].state = NULL;
536 ++ state->private_objs[j].old_state = NULL;
537 ++ state->private_objs[j].new_state = NULL;
538 ++
539 ++ state->num_private_objs = j;
540 ++ break;
541 ++ }
542 + }
543 + }
544 +
545 +diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c
546 +index 6854f5867d51..46ad14470d06 100644
547 +--- a/drivers/gpu/drm/drm_gem.c
548 ++++ b/drivers/gpu/drm/drm_gem.c
549 +@@ -872,9 +872,6 @@ err:
550 + * @file_priv: drm file-private structure
551 + *
552 + * Open an object using the global name, returning a handle and the size.
553 +- *
554 +- * This handle (of course) holds a reference to the object, so the object
555 +- * will not go away until the handle is deleted.
556 + */
557 + int
558 + drm_gem_open_ioctl(struct drm_device *dev, void *data,
559 +@@ -899,14 +896,15 @@ drm_gem_open_ioctl(struct drm_device *dev, void *data,
560 +
561 + /* drm_gem_handle_create_tail unlocks dev->object_name_lock. */
562 + ret = drm_gem_handle_create_tail(file_priv, obj, &handle);
563 +- drm_gem_object_put_unlocked(obj);
564 + if (ret)
565 +- return ret;
566 ++ goto err;
567 +
568 + args->handle = handle;
569 + args->size = obj->size;
570 +
571 +- return 0;
572 ++err:
573 ++ drm_gem_object_put_unlocked(obj);
574 ++ return ret;
575 + }
576 +
577 + /**
578 +diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
579 +index a05e64e3d80b..4042f5b39765 100644
580 +--- a/drivers/gpu/drm/drm_mipi_dbi.c
581 ++++ b/drivers/gpu/drm/drm_mipi_dbi.c
582 +@@ -937,7 +937,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *dbi, int dc,
583 + }
584 + }
585 +
586 +- tr.len = chunk;
587 ++ tr.len = chunk * 2;
588 + len -= chunk;
589 +
590 + ret = spi_sync(spi, &m);
591 +diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
592 +index 9d71ce15db05..a51d3b795770 100644
593 +--- a/drivers/i2c/busses/i2c-cadence.c
594 ++++ b/drivers/i2c/busses/i2c-cadence.c
595 +@@ -377,10 +377,8 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)
596 + * Check for the message size against FIFO depth and set the
597 + * 'hold bus' bit if it is greater than FIFO depth.
598 + */
599 +- if ((id->recv_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)
600 ++ if (id->recv_count > CDNS_I2C_FIFO_DEPTH)
601 + ctrl_reg |= CDNS_I2C_CR_HOLD;
602 +- else
603 +- ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
604 +
605 + cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
606 +
607 +@@ -437,11 +435,8 @@ static void cdns_i2c_msend(struct cdns_i2c *id)
608 + * Check for the message size against FIFO depth and set the
609 + * 'hold bus' bit if it is greater than FIFO depth.
610 + */
611 +- if ((id->send_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag)
612 ++ if (id->send_count > CDNS_I2C_FIFO_DEPTH)
613 + ctrl_reg |= CDNS_I2C_CR_HOLD;
614 +- else
615 +- ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD;
616 +-
617 + cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET);
618 +
619 + /* Clear the interrupts in interrupt status register. */
620 +diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
621 +index 19556c62c7ea..d14ad523f96c 100644
622 +--- a/drivers/infiniband/sw/rdmavt/qp.c
623 ++++ b/drivers/infiniband/sw/rdmavt/qp.c
624 +@@ -898,8 +898,6 @@ static void rvt_init_qp(struct rvt_dev_info *rdi, struct rvt_qp *qp,
625 + qp->s_tail_ack_queue = 0;
626 + qp->s_acked_ack_queue = 0;
627 + qp->s_num_rd_atomic = 0;
628 +- if (qp->r_rq.kwq)
629 +- qp->r_rq.kwq->count = qp->r_rq.size;
630 + qp->r_sge.num_sge = 0;
631 + atomic_set(&qp->s_reserved_used, 0);
632 + }
633 +@@ -2352,31 +2350,6 @@ bad_lkey:
634 + return 0;
635 + }
636 +
637 +-/**
638 +- * get_count - count numbers of request work queue entries
639 +- * in circular buffer
640 +- * @rq: data structure for request queue entry
641 +- * @tail: tail indices of the circular buffer
642 +- * @head: head indices of the circular buffer
643 +- *
644 +- * Return - total number of entries in the circular buffer
645 +- */
646 +-static u32 get_count(struct rvt_rq *rq, u32 tail, u32 head)
647 +-{
648 +- u32 count;
649 +-
650 +- count = head;
651 +-
652 +- if (count >= rq->size)
653 +- count = 0;
654 +- if (count < tail)
655 +- count += rq->size - tail;
656 +- else
657 +- count -= tail;
658 +-
659 +- return count;
660 +-}
661 +-
662 + /**
663 + * get_rvt_head - get head indices of the circular buffer
664 + * @rq: data structure for request queue entry
665 +@@ -2451,7 +2424,7 @@ int rvt_get_rwqe(struct rvt_qp *qp, bool wr_id_only)
666 +
667 + if (kwq->count < RVT_RWQ_COUNT_THRESHOLD) {
668 + head = get_rvt_head(rq, ip);
669 +- kwq->count = get_count(rq, tail, head);
670 ++ kwq->count = rvt_get_rq_count(rq, head, tail);
671 + }
672 + if (unlikely(kwq->count == 0)) {
673 + ret = 0;
674 +@@ -2486,7 +2459,9 @@ int rvt_get_rwqe(struct rvt_qp *qp, bool wr_id_only)
675 + * the number of remaining WQEs.
676 + */
677 + if (kwq->count < srq->limit) {
678 +- kwq->count = get_count(rq, tail, get_rvt_head(rq, ip));
679 ++ kwq->count =
680 ++ rvt_get_rq_count(rq,
681 ++ get_rvt_head(rq, ip), tail);
682 + if (kwq->count < srq->limit) {
683 + struct ib_event ev;
684 +
685 +diff --git a/drivers/infiniband/sw/rdmavt/rc.c b/drivers/infiniband/sw/rdmavt/rc.c
686 +index 890d7b760d2e..27415185d862 100644
687 +--- a/drivers/infiniband/sw/rdmavt/rc.c
688 ++++ b/drivers/infiniband/sw/rdmavt/rc.c
689 +@@ -127,9 +127,7 @@ __be32 rvt_compute_aeth(struct rvt_qp *qp)
690 + * not atomic, which is OK, since the fuzziness is
691 + * resolved as further ACKs go out.
692 + */
693 +- credits = head - tail;
694 +- if ((int)credits < 0)
695 +- credits += qp->r_rq.size;
696 ++ credits = rvt_get_rq_count(&qp->r_rq, head, tail);
697 + }
698 + /*
699 + * Binary search the credit table to find the code to
700 +diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c
701 +index e880afe37f15..d59ca3601785 100644
702 +--- a/drivers/media/pci/cx23885/cx23888-ir.c
703 ++++ b/drivers/media/pci/cx23885/cx23888-ir.c
704 +@@ -1167,8 +1167,11 @@ int cx23888_ir_probe(struct cx23885_dev *dev)
705 + return -ENOMEM;
706 +
707 + spin_lock_init(&state->rx_kfifo_lock);
708 +- if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE, GFP_KERNEL))
709 ++ if (kfifo_alloc(&state->rx_kfifo, CX23888_IR_RX_KFIFO_SIZE,
710 ++ GFP_KERNEL)) {
711 ++ kfree(state);
712 + return -ENOMEM;
713 ++ }
714 +
715 + state->dev = dev;
716 + sd = &state->sd;
717 +diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
718 +index 506170fe3a8b..049f1bbe27ab 100644
719 +--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
720 ++++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
721 +@@ -2441,6 +2441,7 @@ static inline int uld_send(struct adapter *adap, struct sk_buff *skb,
722 + txq_info = adap->sge.uld_txq_info[tx_uld_type];
723 + if (unlikely(!txq_info)) {
724 + WARN_ON(true);
725 ++ kfree_skb(skb);
726 + return NET_XMIT_DROP;
727 + }
728 +
729 +diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c
730 +index 2814b96751b4..01ae113f122a 100644
731 +--- a/drivers/net/ethernet/cortina/gemini.c
732 ++++ b/drivers/net/ethernet/cortina/gemini.c
733 +@@ -2445,6 +2445,7 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
734 + port->reset = devm_reset_control_get_exclusive(dev, NULL);
735 + if (IS_ERR(port->reset)) {
736 + dev_err(dev, "no reset\n");
737 ++ clk_disable_unprepare(port->pclk);
738 + return PTR_ERR(port->reset);
739 + }
740 + reset_control_reset(port->reset);
741 +@@ -2500,8 +2501,10 @@ static int gemini_ethernet_port_probe(struct platform_device *pdev)
742 + IRQF_SHARED,
743 + port_names[port->id],
744 + port);
745 +- if (ret)
746 ++ if (ret) {
747 ++ clk_disable_unprepare(port->pclk);
748 + return ret;
749 ++ }
750 +
751 + ret = register_netdev(netdev);
752 + if (!ret) {
753 +diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
754 +index 506381224559..a8ce6ca0f508 100644
755 +--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
756 ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
757 +@@ -4014,8 +4014,8 @@ static void hns3_link_status_change(struct hnae3_handle *handle, bool linkup)
758 + return;
759 +
760 + if (linkup) {
761 +- netif_carrier_on(netdev);
762 + netif_tx_wake_all_queues(netdev);
763 ++ netif_carrier_on(netdev);
764 + if (netif_msg_link(handle))
765 + netdev_info(netdev, "link up\n");
766 + } else {
767 +diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
768 +index d4652dea4569..6c3d13110993 100644
769 +--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
770 ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
771 +@@ -5627,9 +5627,9 @@ static int hclge_add_fd_entry(struct hnae3_handle *handle,
772 + /* to avoid rule conflict, when user configure rule by ethtool,
773 + * we need to clear all arfs rules
774 + */
775 ++ spin_lock_bh(&hdev->fd_rule_lock);
776 + hclge_clear_arfs_rules(handle);
777 +
778 +- spin_lock_bh(&hdev->fd_rule_lock);
779 + ret = hclge_fd_config_rule(hdev, rule);
780 +
781 + spin_unlock_bh(&hdev->fd_rule_lock);
782 +@@ -5672,6 +5672,7 @@ static int hclge_del_fd_entry(struct hnae3_handle *handle,
783 + return ret;
784 + }
785 +
786 ++/* make sure being called after lock up with fd_rule_lock */
787 + static void hclge_del_all_fd_entries(struct hnae3_handle *handle,
788 + bool clear_list)
789 + {
790 +@@ -5684,7 +5685,6 @@ static void hclge_del_all_fd_entries(struct hnae3_handle *handle,
791 + if (!hnae3_dev_fd_supported(hdev))
792 + return;
793 +
794 +- spin_lock_bh(&hdev->fd_rule_lock);
795 + for_each_set_bit(location, hdev->fd_bmap,
796 + hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1])
797 + hclge_fd_tcam_config(hdev, HCLGE_FD_STAGE_1, true, location,
798 +@@ -5701,8 +5701,6 @@ static void hclge_del_all_fd_entries(struct hnae3_handle *handle,
799 + bitmap_zero(hdev->fd_bmap,
800 + hdev->fd_cfg.rule_num[HCLGE_FD_STAGE_1]);
801 + }
802 +-
803 +- spin_unlock_bh(&hdev->fd_rule_lock);
804 + }
805 +
806 + static int hclge_restore_fd_entries(struct hnae3_handle *handle)
807 +@@ -6069,7 +6067,7 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id,
808 + u16 flow_id, struct flow_keys *fkeys)
809 + {
810 + struct hclge_vport *vport = hclge_get_vport(handle);
811 +- struct hclge_fd_rule_tuples new_tuples;
812 ++ struct hclge_fd_rule_tuples new_tuples = {};
813 + struct hclge_dev *hdev = vport->back;
814 + struct hclge_fd_rule *rule;
815 + u16 tmp_queue_id;
816 +@@ -6079,20 +6077,18 @@ static int hclge_add_fd_entry_by_arfs(struct hnae3_handle *handle, u16 queue_id,
817 + if (!hnae3_dev_fd_supported(hdev))
818 + return -EOPNOTSUPP;
819 +
820 +- memset(&new_tuples, 0, sizeof(new_tuples));
821 +- hclge_fd_get_flow_tuples(fkeys, &new_tuples);
822 +-
823 +- spin_lock_bh(&hdev->fd_rule_lock);
824 +-
825 + /* when there is already fd rule existed add by user,
826 + * arfs should not work
827 + */
828 ++ spin_lock_bh(&hdev->fd_rule_lock);
829 + if (hdev->fd_active_type == HCLGE_FD_EP_ACTIVE) {
830 + spin_unlock_bh(&hdev->fd_rule_lock);
831 +
832 + return -EOPNOTSUPP;
833 + }
834 +
835 ++ hclge_fd_get_flow_tuples(fkeys, &new_tuples);
836 ++
837 + /* check is there flow director filter existed for this flow,
838 + * if not, create a new filter for it;
839 + * if filter exist with different queue id, modify the filter;
840 +@@ -6177,6 +6173,7 @@ static void hclge_rfs_filter_expire(struct hclge_dev *hdev)
841 + #endif
842 + }
843 +
844 ++/* make sure being called after lock up with fd_rule_lock */
845 + static void hclge_clear_arfs_rules(struct hnae3_handle *handle)
846 + {
847 + #ifdef CONFIG_RFS_ACCEL
848 +@@ -6221,10 +6218,14 @@ static void hclge_enable_fd(struct hnae3_handle *handle, bool enable)
849 +
850 + hdev->fd_en = enable;
851 + clear = hdev->fd_active_type == HCLGE_FD_ARFS_ACTIVE;
852 +- if (!enable)
853 ++
854 ++ if (!enable) {
855 ++ spin_lock_bh(&hdev->fd_rule_lock);
856 + hclge_del_all_fd_entries(handle, clear);
857 +- else
858 ++ spin_unlock_bh(&hdev->fd_rule_lock);
859 ++ } else {
860 + hclge_restore_fd_entries(handle);
861 ++ }
862 + }
863 +
864 + static void hclge_cfg_mac_mode(struct hclge_dev *hdev, bool enable)
865 +@@ -6678,8 +6679,9 @@ static void hclge_ae_stop(struct hnae3_handle *handle)
866 + int i;
867 +
868 + set_bit(HCLGE_STATE_DOWN, &hdev->state);
869 +-
870 ++ spin_lock_bh(&hdev->fd_rule_lock);
871 + hclge_clear_arfs_rules(handle);
872 ++ spin_unlock_bh(&hdev->fd_rule_lock);
873 +
874 + /* If it is not PF reset, the firmware will disable the MAC,
875 + * so it only need to stop phy here.
876 +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
877 +index d58597360699..2d20a48f0ba0 100644
878 +--- a/drivers/net/ethernet/ibm/ibmvnic.c
879 ++++ b/drivers/net/ethernet/ibm/ibmvnic.c
880 +@@ -3086,7 +3086,7 @@ req_rx_irq_failed:
881 + req_tx_irq_failed:
882 + for (j = 0; j < i; j++) {
883 + free_irq(adapter->tx_scrq[j]->irq, adapter->tx_scrq[j]);
884 +- irq_dispose_mapping(adapter->rx_scrq[j]->irq);
885 ++ irq_dispose_mapping(adapter->tx_scrq[j]->irq);
886 + }
887 + release_sub_crqs(adapter, 1);
888 + return rc;
889 +diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
890 +index 87c2e8de6102..942646fb2256 100644
891 +--- a/drivers/net/ethernet/mellanox/mlx4/main.c
892 ++++ b/drivers/net/ethernet/mellanox/mlx4/main.c
893 +@@ -4354,12 +4354,14 @@ end:
894 + static void mlx4_shutdown(struct pci_dev *pdev)
895 + {
896 + struct mlx4_dev_persistent *persist = pci_get_drvdata(pdev);
897 ++ struct mlx4_dev *dev = persist->dev;
898 +
899 + mlx4_info(persist->dev, "mlx4_shutdown was called\n");
900 + mutex_lock(&persist->interface_state_mutex);
901 + if (persist->interface_state & MLX4_INTERFACE_STATE_UP)
902 + mlx4_unload_one(pdev);
903 + mutex_unlock(&persist->interface_state_mutex);
904 ++ mlx4_pci_disable_device(dev);
905 + }
906 +
907 + static const struct pci_error_handlers mlx4_err_handler = {
908 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
909 +index c133beb6a7a5..ee0d78f801af 100644
910 +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
911 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
912 +@@ -432,7 +432,7 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
913 + err = mlx5_wq_ll_create(mdev, &rqp->wq, rqc_wq, &rq->mpwqe.wq,
914 + &rq->wq_ctrl);
915 + if (err)
916 +- return err;
917 ++ goto err_rq_wq_destroy;
918 +
919 + rq->mpwqe.wq.db = &rq->mpwqe.wq.db[MLX5_RCV_DBR];
920 +
921 +@@ -485,7 +485,7 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
922 + err = mlx5_wq_cyc_create(mdev, &rqp->wq, rqc_wq, &rq->wqe.wq,
923 + &rq->wq_ctrl);
924 + if (err)
925 +- return err;
926 ++ goto err_rq_wq_destroy;
927 +
928 + rq->wqe.wq.db = &rq->wqe.wq.db[MLX5_RCV_DBR];
929 +
930 +@@ -3038,6 +3038,25 @@ void mlx5e_timestamp_init(struct mlx5e_priv *priv)
931 + priv->tstamp.rx_filter = HWTSTAMP_FILTER_NONE;
932 + }
933 +
934 ++static void mlx5e_modify_admin_state(struct mlx5_core_dev *mdev,
935 ++ enum mlx5_port_status state)
936 ++{
937 ++ struct mlx5_eswitch *esw = mdev->priv.eswitch;
938 ++ int vport_admin_state;
939 ++
940 ++ mlx5_set_port_admin_status(mdev, state);
941 ++
942 ++ if (!MLX5_ESWITCH_MANAGER(mdev) || mlx5_eswitch_mode(esw) == MLX5_ESWITCH_OFFLOADS)
943 ++ return;
944 ++
945 ++ if (state == MLX5_PORT_UP)
946 ++ vport_admin_state = MLX5_VPORT_ADMIN_STATE_AUTO;
947 ++ else
948 ++ vport_admin_state = MLX5_VPORT_ADMIN_STATE_DOWN;
949 ++
950 ++ mlx5_eswitch_set_vport_state(esw, MLX5_VPORT_UPLINK, vport_admin_state);
951 ++}
952 ++
953 + int mlx5e_open_locked(struct net_device *netdev)
954 + {
955 + struct mlx5e_priv *priv = netdev_priv(netdev);
956 +@@ -3070,7 +3089,7 @@ int mlx5e_open(struct net_device *netdev)
957 + mutex_lock(&priv->state_lock);
958 + err = mlx5e_open_locked(netdev);
959 + if (!err)
960 +- mlx5_set_port_admin_status(priv->mdev, MLX5_PORT_UP);
961 ++ mlx5e_modify_admin_state(priv->mdev, MLX5_PORT_UP);
962 + mutex_unlock(&priv->state_lock);
963 +
964 + if (mlx5_vxlan_allowed(priv->mdev->vxlan))
965 +@@ -3107,7 +3126,7 @@ int mlx5e_close(struct net_device *netdev)
966 + return -ENODEV;
967 +
968 + mutex_lock(&priv->state_lock);
969 +- mlx5_set_port_admin_status(priv->mdev, MLX5_PORT_DOWN);
970 ++ mlx5e_modify_admin_state(priv->mdev, MLX5_PORT_DOWN);
971 + err = mlx5e_close_locked(netdev);
972 + mutex_unlock(&priv->state_lock);
973 +
974 +@@ -5172,7 +5191,7 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv)
975 +
976 + /* Marking the link as currently not needed by the Driver */
977 + if (!netif_running(netdev))
978 +- mlx5_set_port_admin_status(mdev, MLX5_PORT_DOWN);
979 ++ mlx5e_modify_admin_state(mdev, MLX5_PORT_DOWN);
980 +
981 + mlx5e_set_netdev_mtu_boundaries(priv);
982 + mlx5e_set_dev_port_mtu(priv);
983 +@@ -5356,6 +5375,8 @@ err_cleanup_tx:
984 + profile->cleanup_tx(priv);
985 +
986 + out:
987 ++ set_bit(MLX5E_STATE_DESTROYING, &priv->state);
988 ++ cancel_work_sync(&priv->update_stats_work);
989 + return err;
990 + }
991 +
992 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
993 +index 9b232ef36d53..88b51f64a64e 100644
994 +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
995 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
996 +@@ -1736,6 +1736,8 @@ static void mlx5e_uplink_rep_enable(struct mlx5e_priv *priv)
997 + INIT_WORK(&rpriv->uplink_priv.reoffload_flows_work,
998 + mlx5e_tc_reoffload_flows_work);
999 +
1000 ++ mlx5_modify_vport_admin_state(mdev, MLX5_VPORT_STATE_OP_MOD_UPLINK,
1001 ++ 0, 0, MLX5_VPORT_ADMIN_STATE_AUTO);
1002 + mlx5_lag_add(mdev, netdev);
1003 + priv->events_nb.notifier_call = uplink_rep_async_event;
1004 + mlx5_notifier_register(mdev, &priv->events_nb);
1005 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
1006 +index c6ed4b7f4f97..8e6ab8201939 100644
1007 +--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
1008 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
1009 +@@ -1919,7 +1919,7 @@ abort:
1010 + mlx5_reload_interface(esw->dev, MLX5_INTERFACE_PROTOCOL_IB);
1011 + mlx5_reload_interface(esw->dev, MLX5_INTERFACE_PROTOCOL_ETH);
1012 + }
1013 +-
1014 ++ esw_destroy_tsar(esw);
1015 + return err;
1016 + }
1017 +
1018 +@@ -2094,6 +2094,8 @@ int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw,
1019 + u16 vport, int link_state)
1020 + {
1021 + struct mlx5_vport *evport = mlx5_eswitch_get_vport(esw, vport);
1022 ++ int opmod = MLX5_VPORT_STATE_OP_MOD_ESW_VPORT;
1023 ++ int other_vport = 1;
1024 + int err = 0;
1025 +
1026 + if (!ESW_ALLOWED(esw))
1027 +@@ -2101,15 +2103,17 @@ int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw,
1028 + if (IS_ERR(evport))
1029 + return PTR_ERR(evport);
1030 +
1031 ++ if (vport == MLX5_VPORT_UPLINK) {
1032 ++ opmod = MLX5_VPORT_STATE_OP_MOD_UPLINK;
1033 ++ other_vport = 0;
1034 ++ vport = 0;
1035 ++ }
1036 + mutex_lock(&esw->state_lock);
1037 +
1038 +- err = mlx5_modify_vport_admin_state(esw->dev,
1039 +- MLX5_VPORT_STATE_OP_MOD_ESW_VPORT,
1040 +- vport, 1, link_state);
1041 ++ err = mlx5_modify_vport_admin_state(esw->dev, opmod, vport, other_vport, link_state);
1042 + if (err) {
1043 +- mlx5_core_warn(esw->dev,
1044 +- "Failed to set vport %d link state, err = %d",
1045 +- vport, err);
1046 ++ mlx5_core_warn(esw->dev, "Failed to set vport %d link state, opmod = %d, err = %d",
1047 ++ vport, opmod, err);
1048 + goto unlock;
1049 + }
1050 +
1051 +@@ -2151,8 +2155,6 @@ int __mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw,
1052 + struct mlx5_vport *evport = mlx5_eswitch_get_vport(esw, vport);
1053 + int err = 0;
1054 +
1055 +- if (!ESW_ALLOWED(esw))
1056 +- return -EPERM;
1057 + if (IS_ERR(evport))
1058 + return PTR_ERR(evport);
1059 + if (vlan > 4095 || qos > 7)
1060 +@@ -2180,6 +2182,9 @@ int mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw,
1061 + u8 set_flags = 0;
1062 + int err;
1063 +
1064 ++ if (!ESW_ALLOWED(esw))
1065 ++ return -EPERM;
1066 ++
1067 + if (vlan || qos)
1068 + set_flags = SET_VLAN_STRIP | SET_VLAN_INSERT;
1069 +
1070 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
1071 +index 6bd6f5895244..0ddbae1e64fa 100644
1072 +--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
1073 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
1074 +@@ -606,6 +606,8 @@ static inline int mlx5_eswitch_enable(struct mlx5_eswitch *esw, int mode) { ret
1075 + static inline void mlx5_eswitch_disable(struct mlx5_eswitch *esw) {}
1076 + static inline bool mlx5_esw_lag_prereq(struct mlx5_core_dev *dev0, struct mlx5_core_dev *dev1) { return true; }
1077 + static inline bool mlx5_eswitch_is_funcs_handler(struct mlx5_core_dev *dev) { return false; }
1078 ++static inline
1079 ++int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw, u16 vport, int link_state) { return 0; }
1080 + static inline const u32 *mlx5_esw_query_functions(struct mlx5_core_dev *dev)
1081 + {
1082 + return ERR_PTR(-EOPNOTSUPP);
1083 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
1084 +index 43f97601b500..75fc283cacc3 100644
1085 +--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
1086 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
1087 +@@ -388,10 +388,31 @@ static int mlx5_ptp_enable(struct ptp_clock_info *ptp,
1088 + return 0;
1089 + }
1090 +
1091 ++enum {
1092 ++ MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_IN = BIT(0),
1093 ++ MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_OUT = BIT(1),
1094 ++};
1095 ++
1096 + static int mlx5_ptp_verify(struct ptp_clock_info *ptp, unsigned int pin,
1097 + enum ptp_pin_function func, unsigned int chan)
1098 + {
1099 +- return (func == PTP_PF_PHYSYNC) ? -EOPNOTSUPP : 0;
1100 ++ struct mlx5_clock *clock = container_of(ptp, struct mlx5_clock,
1101 ++ ptp_info);
1102 ++
1103 ++ switch (func) {
1104 ++ case PTP_PF_NONE:
1105 ++ return 0;
1106 ++ case PTP_PF_EXTTS:
1107 ++ return !(clock->pps_info.pin_caps[pin] &
1108 ++ MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_IN);
1109 ++ case PTP_PF_PEROUT:
1110 ++ return !(clock->pps_info.pin_caps[pin] &
1111 ++ MLX5_MTPPS_REG_CAP_PIN_X_MODE_SUPPORT_PPS_OUT);
1112 ++ default:
1113 ++ return -EOPNOTSUPP;
1114 ++ }
1115 ++
1116 ++ return -EOPNOTSUPP;
1117 + }
1118 +
1119 + static const struct ptp_clock_info mlx5_ptp_clock_info = {
1120 +diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
1121 +index 1b204ce30ee4..c7c3fc7d1126 100644
1122 +--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
1123 ++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
1124 +@@ -1577,7 +1577,7 @@ static int mlxsw_core_reg_access_emad(struct mlxsw_core *mlxsw_core,
1125 + err = mlxsw_emad_reg_access(mlxsw_core, reg, payload, type, trans,
1126 + bulk_list, cb, cb_priv, tid);
1127 + if (err) {
1128 +- kfree(trans);
1129 ++ kfree_rcu(trans, rcu);
1130 + return err;
1131 + }
1132 + return 0;
1133 +@@ -1802,11 +1802,13 @@ void mlxsw_core_skb_receive(struct mlxsw_core *mlxsw_core, struct sk_buff *skb,
1134 + break;
1135 + }
1136 + }
1137 +- rcu_read_unlock();
1138 +- if (!found)
1139 ++ if (!found) {
1140 ++ rcu_read_unlock();
1141 + goto drop;
1142 ++ }
1143 +
1144 + rxl->func(skb, local_port, rxl_item->priv);
1145 ++ rcu_read_unlock();
1146 + return;
1147 +
1148 + drop:
1149 +diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c
1150 +index 2761f3a3ae50..56f285985b43 100644
1151 +--- a/drivers/net/ethernet/ni/nixge.c
1152 ++++ b/drivers/net/ethernet/ni/nixge.c
1153 +@@ -1318,19 +1318,21 @@ static int nixge_probe(struct platform_device *pdev)
1154 + netif_napi_add(ndev, &priv->napi, nixge_poll, NAPI_POLL_WEIGHT);
1155 + err = nixge_of_get_resources(pdev);
1156 + if (err)
1157 +- return err;
1158 ++ goto free_netdev;
1159 + __nixge_hw_set_mac_address(ndev);
1160 +
1161 + priv->tx_irq = platform_get_irq_byname(pdev, "tx");
1162 + if (priv->tx_irq < 0) {
1163 + netdev_err(ndev, "could not find 'tx' irq");
1164 +- return priv->tx_irq;
1165 ++ err = priv->tx_irq;
1166 ++ goto free_netdev;
1167 + }
1168 +
1169 + priv->rx_irq = platform_get_irq_byname(pdev, "rx");
1170 + if (priv->rx_irq < 0) {
1171 + netdev_err(ndev, "could not find 'rx' irq");
1172 +- return priv->rx_irq;
1173 ++ err = priv->rx_irq;
1174 ++ goto free_netdev;
1175 + }
1176 +
1177 + priv->coalesce_count_rx = XAXIDMA_DFT_RX_THRESHOLD;
1178 +diff --git a/drivers/net/ethernet/qlogic/qed/qed_int.c b/drivers/net/ethernet/qlogic/qed/qed_int.c
1179 +index 8d106063e927..666e43748a5f 100644
1180 +--- a/drivers/net/ethernet/qlogic/qed/qed_int.c
1181 ++++ b/drivers/net/ethernet/qlogic/qed/qed_int.c
1182 +@@ -1180,7 +1180,8 @@ static int qed_int_attentions(struct qed_hwfn *p_hwfn)
1183 + index, attn_bits, attn_acks, asserted_bits,
1184 + deasserted_bits, p_sb_attn_sw->known_attn);
1185 + } else if (asserted_bits == 0x100) {
1186 +- DP_INFO(p_hwfn, "MFW indication via attention\n");
1187 ++ DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
1188 ++ "MFW indication via attention\n");
1189 + } else {
1190 + DP_VERBOSE(p_hwfn, NETIF_MSG_INTR,
1191 + "MFW indication [deassertion]\n");
1192 +diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
1193 +index 3f165c137236..30cdabf64ccc 100644
1194 +--- a/drivers/net/ethernet/renesas/ravb_main.c
1195 ++++ b/drivers/net/ethernet/renesas/ravb_main.c
1196 +@@ -1444,6 +1444,7 @@ static void ravb_tx_timeout_work(struct work_struct *work)
1197 + struct ravb_private *priv = container_of(work, struct ravb_private,
1198 + work);
1199 + struct net_device *ndev = priv->ndev;
1200 ++ int error;
1201 +
1202 + netif_tx_stop_all_queues(ndev);
1203 +
1204 +@@ -1452,15 +1453,36 @@ static void ravb_tx_timeout_work(struct work_struct *work)
1205 + ravb_ptp_stop(ndev);
1206 +
1207 + /* Wait for DMA stopping */
1208 +- ravb_stop_dma(ndev);
1209 ++ if (ravb_stop_dma(ndev)) {
1210 ++ /* If ravb_stop_dma() fails, the hardware is still operating
1211 ++ * for TX and/or RX. So, this should not call the following
1212 ++ * functions because ravb_dmac_init() is possible to fail too.
1213 ++ * Also, this should not retry ravb_stop_dma() again and again
1214 ++ * here because it's possible to wait forever. So, this just
1215 ++ * re-enables the TX and RX and skip the following
1216 ++ * re-initialization procedure.
1217 ++ */
1218 ++ ravb_rcv_snd_enable(ndev);
1219 ++ goto out;
1220 ++ }
1221 +
1222 + ravb_ring_free(ndev, RAVB_BE);
1223 + ravb_ring_free(ndev, RAVB_NC);
1224 +
1225 + /* Device init */
1226 +- ravb_dmac_init(ndev);
1227 ++ error = ravb_dmac_init(ndev);
1228 ++ if (error) {
1229 ++ /* If ravb_dmac_init() fails, descriptors are freed. So, this
1230 ++ * should return here to avoid re-enabling the TX and RX in
1231 ++ * ravb_emac_init().
1232 ++ */
1233 ++ netdev_err(ndev, "%s: ravb_dmac_init() failed, error %d\n",
1234 ++ __func__, error);
1235 ++ return;
1236 ++ }
1237 + ravb_emac_init(ndev);
1238 +
1239 ++out:
1240 + /* Initialise PTP Clock driver */
1241 + if (priv->chip_id == RCAR_GEN2)
1242 + ravb_ptp_init(ndev, priv->pdev);
1243 +diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
1244 +index 74849da031fa..66a8b835aa94 100644
1245 +--- a/drivers/net/usb/hso.c
1246 ++++ b/drivers/net/usb/hso.c
1247 +@@ -1389,8 +1389,9 @@ static void hso_serial_set_termios(struct tty_struct *tty, struct ktermios *old)
1248 + unsigned long flags;
1249 +
1250 + if (old)
1251 +- hso_dbg(0x16, "Termios called with: cflags new[%d] - old[%d]\n",
1252 +- tty->termios.c_cflag, old->c_cflag);
1253 ++ hso_dbg(0x16, "Termios called with: cflags new[%u] - old[%u]\n",
1254 ++ (unsigned int)tty->termios.c_cflag,
1255 ++ (unsigned int)old->c_cflag);
1256 +
1257 + /* the actual setup */
1258 + spin_lock_irqsave(&serial->serial_lock, flags);
1259 +diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
1260 +index 0170a441208a..1da99abc6ed1 100644
1261 +--- a/drivers/net/usb/lan78xx.c
1262 ++++ b/drivers/net/usb/lan78xx.c
1263 +@@ -3767,6 +3767,11 @@ static int lan78xx_probe(struct usb_interface *intf,
1264 + netdev->max_mtu = MAX_SINGLE_PACKET_SIZE;
1265 + netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER);
1266 +
1267 ++ if (intf->cur_altsetting->desc.bNumEndpoints < 3) {
1268 ++ ret = -ENODEV;
1269 ++ goto out3;
1270 ++ }
1271 ++
1272 + dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0;
1273 + dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1;
1274 + dev->ep_intr = (intf->cur_altsetting)->endpoint + 2;
1275 +@@ -3791,6 +3796,7 @@ static int lan78xx_probe(struct usb_interface *intf,
1276 + usb_fill_int_urb(dev->urb_intr, dev->udev,
1277 + dev->pipe_intr, buf, maxp,
1278 + intr_complete, dev, period);
1279 ++ dev->urb_intr->transfer_flags |= URB_FREE_BUFFER;
1280 + }
1281 + }
1282 +
1283 +diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
1284 +index 03434db36b5c..b49b6f0cee50 100644
1285 +--- a/drivers/net/vxlan.c
1286 ++++ b/drivers/net/vxlan.c
1287 +@@ -2863,8 +2863,10 @@ static void vxlan_flush(struct vxlan_dev *vxlan, bool do_all)
1288 + if (!do_all && (f->state & (NUD_PERMANENT | NUD_NOARP)))
1289 + continue;
1290 + /* the all_zeros_mac entry is deleted at vxlan_uninit */
1291 +- if (!is_zero_ether_addr(f->eth_addr))
1292 +- vxlan_fdb_destroy(vxlan, f, true, true);
1293 ++ if (is_zero_ether_addr(f->eth_addr) &&
1294 ++ f->vni == vxlan->cfg.vni)
1295 ++ continue;
1296 ++ vxlan_fdb_destroy(vxlan, f, true, true);
1297 + }
1298 + spin_unlock_bh(&vxlan->hash_lock[h]);
1299 + }
1300 +diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c
1301 +index bf78073ee7fd..e2a83f4cd3bb 100644
1302 +--- a/drivers/net/wan/hdlc_x25.c
1303 ++++ b/drivers/net/wan/hdlc_x25.c
1304 +@@ -62,8 +62,10 @@ static int x25_data_indication(struct net_device *dev, struct sk_buff *skb)
1305 + {
1306 + unsigned char *ptr;
1307 +
1308 +- if (skb_cow(skb, 1))
1309 ++ if (skb_cow(skb, 1)) {
1310 ++ kfree_skb(skb);
1311 + return NET_RX_DROP;
1312 ++ }
1313 +
1314 + skb_push(skb, 1);
1315 + skb_reset_network_header(skb);
1316 +diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
1317 +index 5a6f27298b90..134e4dd916c1 100644
1318 +--- a/drivers/net/wan/lapbether.c
1319 ++++ b/drivers/net/wan/lapbether.c
1320 +@@ -128,10 +128,12 @@ static int lapbeth_data_indication(struct net_device *dev, struct sk_buff *skb)
1321 + {
1322 + unsigned char *ptr;
1323 +
1324 +- skb_push(skb, 1);
1325 +-
1326 +- if (skb_cow(skb, 1))
1327 ++ if (skb_cow(skb, 1)) {
1328 ++ kfree_skb(skb);
1329 + return NET_RX_DROP;
1330 ++ }
1331 ++
1332 ++ skb_push(skb, 1);
1333 +
1334 + ptr = skb->data;
1335 + *ptr = X25_IFACE_DATA;
1336 +diff --git a/drivers/net/wireless/ath/ath10k/hw.c b/drivers/net/wireless/ath/ath10k/hw.c
1337 +index c415e971735b..004af89a02b8 100644
1338 +--- a/drivers/net/wireless/ath/ath10k/hw.c
1339 ++++ b/drivers/net/wireless/ath/ath10k/hw.c
1340 +@@ -1145,6 +1145,7 @@ static bool ath10k_qca99x0_rx_desc_msdu_limit_error(struct htt_rx_desc *rxd)
1341 + const struct ath10k_hw_ops qca99x0_ops = {
1342 + .rx_desc_get_l3_pad_bytes = ath10k_qca99x0_rx_desc_get_l3_pad_bytes,
1343 + .rx_desc_get_msdu_limit_error = ath10k_qca99x0_rx_desc_msdu_limit_error,
1344 ++ .is_rssi_enable = ath10k_htt_tx_rssi_enable,
1345 + };
1346 +
1347 + const struct ath10k_hw_ops qca6174_ops = {
1348 +diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
1349 +index 482c6c8b0fb7..88280057e032 100644
1350 +--- a/drivers/net/xen-netfront.c
1351 ++++ b/drivers/net/xen-netfront.c
1352 +@@ -63,6 +63,8 @@ module_param_named(max_queues, xennet_max_queues, uint, 0644);
1353 + MODULE_PARM_DESC(max_queues,
1354 + "Maximum number of queues per virtual interface");
1355 +
1356 ++#define XENNET_TIMEOUT (5 * HZ)
1357 ++
1358 + static const struct ethtool_ops xennet_ethtool_ops;
1359 +
1360 + struct netfront_cb {
1361 +@@ -1334,12 +1336,15 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)
1362 +
1363 + netif_carrier_off(netdev);
1364 +
1365 +- xenbus_switch_state(dev, XenbusStateInitialising);
1366 +- wait_event(module_wq,
1367 +- xenbus_read_driver_state(dev->otherend) !=
1368 +- XenbusStateClosed &&
1369 +- xenbus_read_driver_state(dev->otherend) !=
1370 +- XenbusStateUnknown);
1371 ++ do {
1372 ++ xenbus_switch_state(dev, XenbusStateInitialising);
1373 ++ err = wait_event_timeout(module_wq,
1374 ++ xenbus_read_driver_state(dev->otherend) !=
1375 ++ XenbusStateClosed &&
1376 ++ xenbus_read_driver_state(dev->otherend) !=
1377 ++ XenbusStateUnknown, XENNET_TIMEOUT);
1378 ++ } while (!err);
1379 ++
1380 + return netdev;
1381 +
1382 + exit:
1383 +@@ -2139,28 +2144,43 @@ static const struct attribute_group xennet_dev_group = {
1384 + };
1385 + #endif /* CONFIG_SYSFS */
1386 +
1387 +-static int xennet_remove(struct xenbus_device *dev)
1388 ++static void xennet_bus_close(struct xenbus_device *dev)
1389 + {
1390 +- struct netfront_info *info = dev_get_drvdata(&dev->dev);
1391 +-
1392 +- dev_dbg(&dev->dev, "%s\n", dev->nodename);
1393 ++ int ret;
1394 +
1395 +- if (xenbus_read_driver_state(dev->otherend) != XenbusStateClosed) {
1396 ++ if (xenbus_read_driver_state(dev->otherend) == XenbusStateClosed)
1397 ++ return;
1398 ++ do {
1399 + xenbus_switch_state(dev, XenbusStateClosing);
1400 +- wait_event(module_wq,
1401 +- xenbus_read_driver_state(dev->otherend) ==
1402 +- XenbusStateClosing ||
1403 +- xenbus_read_driver_state(dev->otherend) ==
1404 +- XenbusStateUnknown);
1405 ++ ret = wait_event_timeout(module_wq,
1406 ++ xenbus_read_driver_state(dev->otherend) ==
1407 ++ XenbusStateClosing ||
1408 ++ xenbus_read_driver_state(dev->otherend) ==
1409 ++ XenbusStateClosed ||
1410 ++ xenbus_read_driver_state(dev->otherend) ==
1411 ++ XenbusStateUnknown,
1412 ++ XENNET_TIMEOUT);
1413 ++ } while (!ret);
1414 ++
1415 ++ if (xenbus_read_driver_state(dev->otherend) == XenbusStateClosed)
1416 ++ return;
1417 +
1418 ++ do {
1419 + xenbus_switch_state(dev, XenbusStateClosed);
1420 +- wait_event(module_wq,
1421 +- xenbus_read_driver_state(dev->otherend) ==
1422 +- XenbusStateClosed ||
1423 +- xenbus_read_driver_state(dev->otherend) ==
1424 +- XenbusStateUnknown);
1425 +- }
1426 ++ ret = wait_event_timeout(module_wq,
1427 ++ xenbus_read_driver_state(dev->otherend) ==
1428 ++ XenbusStateClosed ||
1429 ++ xenbus_read_driver_state(dev->otherend) ==
1430 ++ XenbusStateUnknown,
1431 ++ XENNET_TIMEOUT);
1432 ++ } while (!ret);
1433 ++}
1434 ++
1435 ++static int xennet_remove(struct xenbus_device *dev)
1436 ++{
1437 ++ struct netfront_info *info = dev_get_drvdata(&dev->dev);
1438 +
1439 ++ xennet_bus_close(dev);
1440 + xennet_disconnect_backend(info);
1441 +
1442 + if (info->netdev->reg_state == NETREG_REGISTERED)
1443 +diff --git a/drivers/nfc/s3fwrn5/core.c b/drivers/nfc/s3fwrn5/core.c
1444 +index 91d4d5b28a7d..ba6c486d6465 100644
1445 +--- a/drivers/nfc/s3fwrn5/core.c
1446 ++++ b/drivers/nfc/s3fwrn5/core.c
1447 +@@ -198,6 +198,7 @@ int s3fwrn5_recv_frame(struct nci_dev *ndev, struct sk_buff *skb,
1448 + case S3FWRN5_MODE_FW:
1449 + return s3fwrn5_fw_recv_frame(ndev, skb);
1450 + default:
1451 ++ kfree_skb(skb);
1452 + return -ENODEV;
1453 + }
1454 + }
1455 +diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
1456 +index 7900814355c2..53e113a18a54 100644
1457 +--- a/drivers/nvme/host/tcp.c
1458 ++++ b/drivers/nvme/host/tcp.c
1459 +@@ -1319,6 +1319,9 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl,
1460 + }
1461 + }
1462 +
1463 ++ /* Set 10 seconds timeout for icresp recvmsg */
1464 ++ queue->sock->sk->sk_rcvtimeo = 10 * HZ;
1465 ++
1466 + queue->sock->sk->sk_allocation = GFP_ATOMIC;
1467 + if (!qid)
1468 + n = 0;
1469 +diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
1470 +index a1ec8a1977d3..4ac4b28e0ebb 100644
1471 +--- a/drivers/pci/quirks.c
1472 ++++ b/drivers/pci/quirks.c
1473 +@@ -2330,6 +2330,19 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f1, quirk_disable_aspm_l0s);
1474 + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x10f4, quirk_disable_aspm_l0s);
1475 + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1508, quirk_disable_aspm_l0s);
1476 +
1477 ++static void quirk_disable_aspm_l0s_l1(struct pci_dev *dev)
1478 ++{
1479 ++ pci_info(dev, "Disabling ASPM L0s/L1\n");
1480 ++ pci_disable_link_state(dev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1);
1481 ++}
1482 ++
1483 ++/*
1484 ++ * ASM1083/1085 PCIe-PCI bridge devices cause AER timeout errors on the
1485 ++ * upstream PCIe root port when ASPM is enabled. At least L0s mode is affected;
1486 ++ * disable both L0s and L1 for now to be safe.
1487 ++ */
1488 ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x1080, quirk_disable_aspm_l0s_l1);
1489 ++
1490 + /*
1491 + * Some Pericom PCIe-to-PCI bridges in reverse mode need the PCIe Retrain
1492 + * Link bit cleared after starting the link retrain process to allow this
1493 +diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
1494 +index 206c9f53e9e7..e6944e1cba2b 100644
1495 +--- a/drivers/scsi/scsi_lib.c
1496 ++++ b/drivers/scsi/scsi_lib.c
1497 +@@ -568,6 +568,15 @@ static void scsi_mq_uninit_cmd(struct scsi_cmnd *cmd)
1498 + scsi_del_cmd_from_list(cmd);
1499 + }
1500 +
1501 ++static void scsi_run_queue_async(struct scsi_device *sdev)
1502 ++{
1503 ++ if (scsi_target(sdev)->single_lun ||
1504 ++ !list_empty(&sdev->host->starved_list))
1505 ++ kblockd_schedule_work(&sdev->requeue_work);
1506 ++ else
1507 ++ blk_mq_run_hw_queues(sdev->request_queue, true);
1508 ++}
1509 ++
1510 + /* Returns false when no more bytes to process, true if there are more */
1511 + static bool scsi_end_request(struct request *req, blk_status_t error,
1512 + unsigned int bytes)
1513 +@@ -612,11 +621,7 @@ static bool scsi_end_request(struct request *req, blk_status_t error,
1514 +
1515 + __blk_mq_end_request(req, error);
1516 +
1517 +- if (scsi_target(sdev)->single_lun ||
1518 +- !list_empty(&sdev->host->starved_list))
1519 +- kblockd_schedule_work(&sdev->requeue_work);
1520 +- else
1521 +- blk_mq_run_hw_queues(q, true);
1522 ++ scsi_run_queue_async(sdev);
1523 +
1524 + percpu_ref_put(&q->q_usage_counter);
1525 + return false;
1526 +@@ -1729,6 +1734,7 @@ out_put_budget:
1527 + */
1528 + if (req->rq_flags & RQF_DONTPREP)
1529 + scsi_mq_uninit_cmd(cmd);
1530 ++ scsi_run_queue_async(sdev);
1531 + break;
1532 + }
1533 + return ret;
1534 +diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
1535 +index 88ce114790d7..f63f84a25725 100644
1536 +--- a/drivers/vhost/scsi.c
1537 ++++ b/drivers/vhost/scsi.c
1538 +@@ -1215,7 +1215,7 @@ vhost_scsi_ctl_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq)
1539 + continue;
1540 + }
1541 +
1542 +- switch (v_req.type) {
1543 ++ switch (vhost32_to_cpu(vq, v_req.type)) {
1544 + case VIRTIO_SCSI_T_TMF:
1545 + vc.req = &v_req.tmf;
1546 + vc.req_size = sizeof(struct virtio_scsi_ctrl_tmf_req);
1547 +diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
1548 +index 7aaf150f89ba..1e444826a66e 100644
1549 +--- a/drivers/virtio/virtio_balloon.c
1550 ++++ b/drivers/virtio/virtio_balloon.c
1551 +@@ -529,10 +529,14 @@ static int init_vqs(struct virtio_balloon *vb)
1552 + static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
1553 + {
1554 + if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
1555 +- &vb->config_read_bitmap))
1556 ++ &vb->config_read_bitmap)) {
1557 + virtio_cread(vb->vdev, struct virtio_balloon_config,
1558 + free_page_report_cmd_id,
1559 + &vb->cmd_id_received_cache);
1560 ++ /* Legacy balloon config space is LE, unlike all other devices. */
1561 ++ if (!virtio_has_feature(vb->vdev, VIRTIO_F_VERSION_1))
1562 ++ vb->cmd_id_received_cache = le32_to_cpu((__force __le32)vb->cmd_id_received_cache);
1563 ++ }
1564 +
1565 + return vb->cmd_id_received_cache;
1566 + }
1567 +diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
1568 +index acd859ea09d4..aba56077cfda 100644
1569 +--- a/include/linux/mlx5/mlx5_ifc.h
1570 ++++ b/include/linux/mlx5/mlx5_ifc.h
1571 +@@ -4177,6 +4177,7 @@ struct mlx5_ifc_query_vport_state_out_bits {
1572 + enum {
1573 + MLX5_VPORT_STATE_OP_MOD_VNIC_VPORT = 0x0,
1574 + MLX5_VPORT_STATE_OP_MOD_ESW_VPORT = 0x1,
1575 ++ MLX5_VPORT_STATE_OP_MOD_UPLINK = 0x2,
1576 + };
1577 +
1578 + struct mlx5_ifc_arm_monitor_counter_in_bits {
1579 +diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
1580 +index beb9a9da1699..c5bf21261bb1 100644
1581 +--- a/include/linux/rhashtable.h
1582 ++++ b/include/linux/rhashtable.h
1583 +@@ -349,11 +349,11 @@ static inline void rht_unlock(struct bucket_table *tbl,
1584 + local_bh_enable();
1585 + }
1586 +
1587 +-static inline struct rhash_head __rcu *__rht_ptr(
1588 +- struct rhash_lock_head *const *bkt)
1589 ++static inline struct rhash_head *__rht_ptr(
1590 ++ struct rhash_lock_head *p, struct rhash_lock_head __rcu *const *bkt)
1591 + {
1592 +- return (struct rhash_head __rcu *)
1593 +- ((unsigned long)*bkt & ~BIT(0) ?:
1594 ++ return (struct rhash_head *)
1595 ++ ((unsigned long)p & ~BIT(0) ?:
1596 + (unsigned long)RHT_NULLS_MARKER(bkt));
1597 + }
1598 +
1599 +@@ -365,25 +365,26 @@ static inline struct rhash_head __rcu *__rht_ptr(
1600 + * access is guaranteed, such as when destroying the table.
1601 + */
1602 + static inline struct rhash_head *rht_ptr_rcu(
1603 +- struct rhash_lock_head *const *bkt)
1604 ++ struct rhash_lock_head *const *p)
1605 + {
1606 +- struct rhash_head __rcu *p = __rht_ptr(bkt);
1607 +-
1608 +- return rcu_dereference(p);
1609 ++ struct rhash_lock_head __rcu *const *bkt = (void *)p;
1610 ++ return __rht_ptr(rcu_dereference(*bkt), bkt);
1611 + }
1612 +
1613 + static inline struct rhash_head *rht_ptr(
1614 +- struct rhash_lock_head *const *bkt,
1615 ++ struct rhash_lock_head *const *p,
1616 + struct bucket_table *tbl,
1617 + unsigned int hash)
1618 + {
1619 +- return rht_dereference_bucket(__rht_ptr(bkt), tbl, hash);
1620 ++ struct rhash_lock_head __rcu *const *bkt = (void *)p;
1621 ++ return __rht_ptr(rht_dereference_bucket(*bkt, tbl, hash), bkt);
1622 + }
1623 +
1624 + static inline struct rhash_head *rht_ptr_exclusive(
1625 +- struct rhash_lock_head *const *bkt)
1626 ++ struct rhash_lock_head *const *p)
1627 + {
1628 +- return rcu_dereference_protected(__rht_ptr(bkt), 1);
1629 ++ struct rhash_lock_head __rcu *const *bkt = (void *)p;
1630 ++ return __rht_ptr(rcu_dereference_protected(*bkt, 1), bkt);
1631 + }
1632 +
1633 + static inline void rht_assign_locked(struct rhash_lock_head **bkt,
1634 +diff --git a/include/net/xfrm.h b/include/net/xfrm.h
1635 +index fb391c00c19a..12aa6e15e43f 100644
1636 +--- a/include/net/xfrm.h
1637 ++++ b/include/net/xfrm.h
1638 +@@ -945,7 +945,7 @@ struct xfrm_dst {
1639 + static inline struct dst_entry *xfrm_dst_path(const struct dst_entry *dst)
1640 + {
1641 + #ifdef CONFIG_XFRM
1642 +- if (dst->xfrm) {
1643 ++ if (dst->xfrm || (dst->flags & DST_XFRM_QUEUE)) {
1644 + const struct xfrm_dst *xdst = (const struct xfrm_dst *) dst;
1645 +
1646 + return xdst->path;
1647 +@@ -957,7 +957,7 @@ static inline struct dst_entry *xfrm_dst_path(const struct dst_entry *dst)
1648 + static inline struct dst_entry *xfrm_dst_child(const struct dst_entry *dst)
1649 + {
1650 + #ifdef CONFIG_XFRM
1651 +- if (dst->xfrm) {
1652 ++ if (dst->xfrm || (dst->flags & DST_XFRM_QUEUE)) {
1653 + struct xfrm_dst *xdst = (struct xfrm_dst *) dst;
1654 + return xdst->child;
1655 + }
1656 +@@ -1636,13 +1636,16 @@ int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk,
1657 + void *);
1658 + void xfrm_policy_walk_done(struct xfrm_policy_walk *walk, struct net *net);
1659 + int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
1660 +-struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, u32 if_id,
1661 +- u8 type, int dir,
1662 ++struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net,
1663 ++ const struct xfrm_mark *mark,
1664 ++ u32 if_id, u8 type, int dir,
1665 + struct xfrm_selector *sel,
1666 + struct xfrm_sec_ctx *ctx, int delete,
1667 + int *err);
1668 +-struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u32 if_id, u8,
1669 +- int dir, u32 id, int delete, int *err);
1670 ++struct xfrm_policy *xfrm_policy_byid(struct net *net,
1671 ++ const struct xfrm_mark *mark, u32 if_id,
1672 ++ u8 type, int dir, u32 id, int delete,
1673 ++ int *err);
1674 + int xfrm_policy_flush(struct net *net, u8 type, bool task_valid);
1675 + void xfrm_policy_hash_rebuild(struct net *net);
1676 + u32 xfrm_get_acqseq(void);
1677 +diff --git a/include/rdma/rdmavt_qp.h b/include/rdma/rdmavt_qp.h
1678 +index b550ae89bf85..6dd3b5284fd1 100644
1679 +--- a/include/rdma/rdmavt_qp.h
1680 ++++ b/include/rdma/rdmavt_qp.h
1681 +@@ -278,6 +278,25 @@ struct rvt_rq {
1682 + spinlock_t lock ____cacheline_aligned_in_smp;
1683 + };
1684 +
1685 ++/**
1686 ++ * rvt_get_rq_count - count numbers of request work queue entries
1687 ++ * in circular buffer
1688 ++ * @rq: data structure for request queue entry
1689 ++ * @head: head indices of the circular buffer
1690 ++ * @tail: tail indices of the circular buffer
1691 ++ *
1692 ++ * Return - total number of entries in the Receive Queue
1693 ++ */
1694 ++
1695 ++static inline u32 rvt_get_rq_count(struct rvt_rq *rq, u32 head, u32 tail)
1696 ++{
1697 ++ u32 count = head - tail;
1698 ++
1699 ++ if ((s32)count < 0)
1700 ++ count += rq->size;
1701 ++ return count;
1702 ++}
1703 ++
1704 + /*
1705 + * This structure holds the information that the send tasklet needs
1706 + * to send a RDMA read response or atomic operation.
1707 +diff --git a/include/uapi/linux/wireless.h b/include/uapi/linux/wireless.h
1708 +index 86eca3208b6b..a2c006a364e0 100644
1709 +--- a/include/uapi/linux/wireless.h
1710 ++++ b/include/uapi/linux/wireless.h
1711 +@@ -74,6 +74,8 @@
1712 + #include <linux/socket.h> /* for "struct sockaddr" et al */
1713 + #include <linux/if.h> /* for IFNAMSIZ and co... */
1714 +
1715 ++#include <stddef.h> /* for offsetof */
1716 ++
1717 + /***************************** VERSION *****************************/
1718 + /*
1719 + * This constant is used to know the availability of the wireless
1720 +@@ -1090,8 +1092,7 @@ struct iw_event {
1721 + /* iw_point events are special. First, the payload (extra data) come at
1722 + * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second,
1723 + * we omit the pointer, so start at an offset. */
1724 +-#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \
1725 +- (char *) NULL)
1726 ++#define IW_EV_POINT_OFF offsetof(struct iw_point, length)
1727 + #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
1728 + IW_EV_POINT_OFF)
1729 +
1730 +diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
1731 +index 22066a62c8c9..039d64b1bfb7 100644
1732 +--- a/kernel/bpf/hashtab.c
1733 ++++ b/kernel/bpf/hashtab.c
1734 +@@ -675,15 +675,20 @@ static void htab_elem_free_rcu(struct rcu_head *head)
1735 + preempt_enable();
1736 + }
1737 +
1738 +-static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l)
1739 ++static void htab_put_fd_value(struct bpf_htab *htab, struct htab_elem *l)
1740 + {
1741 + struct bpf_map *map = &htab->map;
1742 ++ void *ptr;
1743 +
1744 + if (map->ops->map_fd_put_ptr) {
1745 +- void *ptr = fd_htab_map_get_ptr(map, l);
1746 +-
1747 ++ ptr = fd_htab_map_get_ptr(map, l);
1748 + map->ops->map_fd_put_ptr(ptr);
1749 + }
1750 ++}
1751 ++
1752 ++static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l)
1753 ++{
1754 ++ htab_put_fd_value(htab, l);
1755 +
1756 + if (htab_is_prealloc(htab)) {
1757 + __pcpu_freelist_push(&htab->freelist, &l->fnode);
1758 +@@ -735,6 +740,7 @@ static struct htab_elem *alloc_htab_elem(struct bpf_htab *htab, void *key,
1759 + */
1760 + pl_new = this_cpu_ptr(htab->extra_elems);
1761 + l_new = *pl_new;
1762 ++ htab_put_fd_value(htab, old_elem);
1763 + *pl_new = old_elem;
1764 + } else {
1765 + struct pcpu_freelist_node *l;
1766 +diff --git a/mm/filemap.c b/mm/filemap.c
1767 +index 1f5731768222..18c1f5830074 100644
1768 +--- a/mm/filemap.c
1769 ++++ b/mm/filemap.c
1770 +@@ -2438,7 +2438,7 @@ static struct file *do_async_mmap_readahead(struct vm_fault *vmf,
1771 + pgoff_t offset = vmf->pgoff;
1772 +
1773 + /* If we don't want any read-ahead, don't bother */
1774 +- if (vmf->vma->vm_flags & VM_RAND_READ)
1775 ++ if (vmf->vma->vm_flags & VM_RAND_READ || !ra->ra_pages)
1776 + return fpin;
1777 + if (ra->mmap_miss > 0)
1778 + ra->mmap_miss--;
1779 +diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
1780 +index 13cd683a658a..3f67803123be 100644
1781 +--- a/net/9p/trans_fd.c
1782 ++++ b/net/9p/trans_fd.c
1783 +@@ -362,6 +362,10 @@ static void p9_read_work(struct work_struct *work)
1784 + if (m->rreq->status == REQ_STATUS_SENT) {
1785 + list_del(&m->rreq->req_list);
1786 + p9_client_cb(m->client, m->rreq, REQ_STATUS_RCVD);
1787 ++ } else if (m->rreq->status == REQ_STATUS_FLSHD) {
1788 ++ /* Ignore replies associated with a cancelled request. */
1789 ++ p9_debug(P9_DEBUG_TRANS,
1790 ++ "Ignore replies associated with a cancelled request\n");
1791 + } else {
1792 + spin_unlock(&m->client->lock);
1793 + p9_debug(P9_DEBUG_ERROR,
1794 +@@ -703,11 +707,20 @@ static int p9_fd_cancelled(struct p9_client *client, struct p9_req_t *req)
1795 + {
1796 + p9_debug(P9_DEBUG_TRANS, "client %p req %p\n", client, req);
1797 +
1798 ++ spin_lock(&client->lock);
1799 ++ /* Ignore cancelled request if message has been received
1800 ++ * before lock.
1801 ++ */
1802 ++ if (req->status == REQ_STATUS_RCVD) {
1803 ++ spin_unlock(&client->lock);
1804 ++ return 0;
1805 ++ }
1806 ++
1807 + /* we haven't received a response for oldreq,
1808 + * remove it from the list.
1809 + */
1810 +- spin_lock(&client->lock);
1811 + list_del(&req->req_list);
1812 ++ req->status = REQ_STATUS_FLSHD;
1813 + spin_unlock(&client->lock);
1814 + p9_req_put(req);
1815 +
1816 +diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
1817 +index 88cd410e5728..44385252d7b6 100644
1818 +--- a/net/bluetooth/hci_event.c
1819 ++++ b/net/bluetooth/hci_event.c
1820 +@@ -1274,6 +1274,9 @@ static void store_pending_adv_report(struct hci_dev *hdev, bdaddr_t *bdaddr,
1821 + {
1822 + struct discovery_state *d = &hdev->discovery;
1823 +
1824 ++ if (len > HCI_MAX_AD_LENGTH)
1825 ++ return;
1826 ++
1827 + bacpy(&d->last_adv_addr, bdaddr);
1828 + d->last_adv_addr_type = bdaddr_type;
1829 + d->last_adv_rssi = rssi;
1830 +@@ -5231,7 +5234,8 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,
1831 +
1832 + static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
1833 + u8 bdaddr_type, bdaddr_t *direct_addr,
1834 +- u8 direct_addr_type, s8 rssi, u8 *data, u8 len)
1835 ++ u8 direct_addr_type, s8 rssi, u8 *data, u8 len,
1836 ++ bool ext_adv)
1837 + {
1838 + struct discovery_state *d = &hdev->discovery;
1839 + struct smp_irk *irk;
1840 +@@ -5253,6 +5257,11 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
1841 + return;
1842 + }
1843 +
1844 ++ if (!ext_adv && len > HCI_MAX_AD_LENGTH) {
1845 ++ bt_dev_err_ratelimited(hdev, "legacy adv larger than 31 bytes");
1846 ++ return;
1847 ++ }
1848 ++
1849 + /* Find the end of the data in case the report contains padded zero
1850 + * bytes at the end causing an invalid length value.
1851 + *
1852 +@@ -5312,7 +5321,7 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
1853 + */
1854 + conn = check_pending_le_conn(hdev, bdaddr, bdaddr_type, type,
1855 + direct_addr);
1856 +- if (conn && type == LE_ADV_IND) {
1857 ++ if (!ext_adv && conn && type == LE_ADV_IND && len <= HCI_MAX_AD_LENGTH) {
1858 + /* Store report for later inclusion by
1859 + * mgmt_device_connected
1860 + */
1861 +@@ -5366,7 +5375,7 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
1862 + * event or send an immediate device found event if the data
1863 + * should not be stored for later.
1864 + */
1865 +- if (!has_pending_adv_report(hdev)) {
1866 ++ if (!ext_adv && !has_pending_adv_report(hdev)) {
1867 + /* If the report will trigger a SCAN_REQ store it for
1868 + * later merging.
1869 + */
1870 +@@ -5401,7 +5410,8 @@ static void process_adv_report(struct hci_dev *hdev, u8 type, bdaddr_t *bdaddr,
1871 + /* If the new report will trigger a SCAN_REQ store it for
1872 + * later merging.
1873 + */
1874 +- if (type == LE_ADV_IND || type == LE_ADV_SCAN_IND) {
1875 ++ if (!ext_adv && (type == LE_ADV_IND ||
1876 ++ type == LE_ADV_SCAN_IND)) {
1877 + store_pending_adv_report(hdev, bdaddr, bdaddr_type,
1878 + rssi, flags, data, len);
1879 + return;
1880 +@@ -5441,7 +5451,7 @@ static void hci_le_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb)
1881 + rssi = ev->data[ev->length];
1882 + process_adv_report(hdev, ev->evt_type, &ev->bdaddr,
1883 + ev->bdaddr_type, NULL, 0, rssi,
1884 +- ev->data, ev->length);
1885 ++ ev->data, ev->length, false);
1886 + } else {
1887 + bt_dev_err(hdev, "Dropping invalid advertising data");
1888 + }
1889 +@@ -5515,7 +5525,8 @@ static void hci_le_ext_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb)
1890 + if (legacy_evt_type != LE_ADV_INVALID) {
1891 + process_adv_report(hdev, legacy_evt_type, &ev->bdaddr,
1892 + ev->bdaddr_type, NULL, 0, ev->rssi,
1893 +- ev->data, ev->length);
1894 ++ ev->data, ev->length,
1895 ++ !(evt_type & LE_EXT_ADV_LEGACY_PDU));
1896 + }
1897 +
1898 + ptr += sizeof(*ev) + ev->length;
1899 +@@ -5713,7 +5724,8 @@ static void hci_le_direct_adv_report_evt(struct hci_dev *hdev,
1900 +
1901 + process_adv_report(hdev, ev->evt_type, &ev->bdaddr,
1902 + ev->bdaddr_type, &ev->direct_addr,
1903 +- ev->direct_addr_type, ev->rssi, NULL, 0);
1904 ++ ev->direct_addr_type, ev->rssi, NULL, 0,
1905 ++ false);
1906 +
1907 + ptr += sizeof(*ev);
1908 + }
1909 +diff --git a/net/key/af_key.c b/net/key/af_key.c
1910 +index b67ed3a8486c..979c579afc63 100644
1911 +--- a/net/key/af_key.c
1912 ++++ b/net/key/af_key.c
1913 +@@ -2400,7 +2400,7 @@ static int pfkey_spddelete(struct sock *sk, struct sk_buff *skb, const struct sa
1914 + return err;
1915 + }
1916 +
1917 +- xp = xfrm_policy_bysel_ctx(net, DUMMY_MARK, 0, XFRM_POLICY_TYPE_MAIN,
1918 ++ xp = xfrm_policy_bysel_ctx(net, &dummy_mark, 0, XFRM_POLICY_TYPE_MAIN,
1919 + pol->sadb_x_policy_dir - 1, &sel, pol_ctx,
1920 + 1, &err);
1921 + security_xfrm_policy_free(pol_ctx);
1922 +@@ -2651,7 +2651,7 @@ static int pfkey_spdget(struct sock *sk, struct sk_buff *skb, const struct sadb_
1923 + return -EINVAL;
1924 +
1925 + delete = (hdr->sadb_msg_type == SADB_X_SPDDELETE2);
1926 +- xp = xfrm_policy_byid(net, DUMMY_MARK, 0, XFRM_POLICY_TYPE_MAIN,
1927 ++ xp = xfrm_policy_byid(net, &dummy_mark, 0, XFRM_POLICY_TYPE_MAIN,
1928 + dir, pol->sadb_x_policy_id, delete, &err);
1929 + if (xp == NULL)
1930 + return -ENOENT;
1931 +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
1932 +index 0daaf7e37a21..a9dda5c228f6 100644
1933 +--- a/net/mac80211/cfg.c
1934 ++++ b/net/mac80211/cfg.c
1935 +@@ -2140,6 +2140,7 @@ static int ieee80211_leave_mesh(struct wiphy *wiphy, struct net_device *dev)
1936 + ieee80211_stop_mesh(sdata);
1937 + mutex_lock(&sdata->local->mtx);
1938 + ieee80211_vif_release_channel(sdata);
1939 ++ kfree(sdata->u.mesh.ie);
1940 + mutex_unlock(&sdata->local->mtx);
1941 +
1942 + return 0;
1943 +diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
1944 +index 117519bf33d6..aca608ae313f 100644
1945 +--- a/net/mac80211/mesh_pathtbl.c
1946 ++++ b/net/mac80211/mesh_pathtbl.c
1947 +@@ -521,6 +521,7 @@ static void mesh_path_free_rcu(struct mesh_table *tbl,
1948 + del_timer_sync(&mpath->timer);
1949 + atomic_dec(&sdata->u.mesh.mpaths);
1950 + atomic_dec(&tbl->entries);
1951 ++ mesh_path_flush_pending(mpath);
1952 + kfree_rcu(mpath, rcu);
1953 + }
1954 +
1955 +diff --git a/net/rds/recv.c b/net/rds/recv.c
1956 +index c8404971d5ab..aba4afe4dfed 100644
1957 +--- a/net/rds/recv.c
1958 ++++ b/net/rds/recv.c
1959 +@@ -450,12 +450,13 @@ static int rds_still_queued(struct rds_sock *rs, struct rds_incoming *inc,
1960 + int rds_notify_queue_get(struct rds_sock *rs, struct msghdr *msghdr)
1961 + {
1962 + struct rds_notifier *notifier;
1963 +- struct rds_rdma_notify cmsg = { 0 }; /* fill holes with zero */
1964 ++ struct rds_rdma_notify cmsg;
1965 + unsigned int count = 0, max_messages = ~0U;
1966 + unsigned long flags;
1967 + LIST_HEAD(copy);
1968 + int err = 0;
1969 +
1970 ++ memset(&cmsg, 0, sizeof(cmsg)); /* fill holes with zero */
1971 +
1972 + /* put_cmsg copies to user space and thus may sleep. We can't do this
1973 + * with rs_lock held, so first grab as many notifications as we can stuff
1974 +diff --git a/net/sunrpc/sunrpc.h b/net/sunrpc/sunrpc.h
1975 +index c9bacb3c930f..82035fa65b8f 100644
1976 +--- a/net/sunrpc/sunrpc.h
1977 ++++ b/net/sunrpc/sunrpc.h
1978 +@@ -56,4 +56,5 @@ int svc_send_common(struct socket *sock, struct xdr_buf *xdr,
1979 +
1980 + int rpc_clients_notifier_register(void);
1981 + void rpc_clients_notifier_unregister(void);
1982 ++void auth_domain_cleanup(void);
1983 + #endif /* _NET_SUNRPC_SUNRPC_H */
1984 +diff --git a/net/sunrpc/sunrpc_syms.c b/net/sunrpc/sunrpc_syms.c
1985 +index f9edaa9174a4..236fadc4a439 100644
1986 +--- a/net/sunrpc/sunrpc_syms.c
1987 ++++ b/net/sunrpc/sunrpc_syms.c
1988 +@@ -23,6 +23,7 @@
1989 + #include <linux/sunrpc/rpc_pipe_fs.h>
1990 + #include <linux/sunrpc/xprtsock.h>
1991 +
1992 ++#include "sunrpc.h"
1993 + #include "netns.h"
1994 +
1995 + unsigned int sunrpc_net_id;
1996 +@@ -131,6 +132,7 @@ cleanup_sunrpc(void)
1997 + unregister_rpc_pipefs();
1998 + rpc_destroy_mempool();
1999 + unregister_pernet_subsys(&sunrpc_net_ops);
2000 ++ auth_domain_cleanup();
2001 + #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
2002 + rpc_unregister_sysctl();
2003 + #endif
2004 +diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c
2005 +index 550b214cb001..998b196b6176 100644
2006 +--- a/net/sunrpc/svcauth.c
2007 ++++ b/net/sunrpc/svcauth.c
2008 +@@ -19,6 +19,10 @@
2009 + #include <linux/err.h>
2010 + #include <linux/hash.h>
2011 +
2012 ++#include <trace/events/sunrpc.h>
2013 ++
2014 ++#include "sunrpc.h"
2015 ++
2016 + #define RPCDBG_FACILITY RPCDBG_AUTH
2017 +
2018 +
2019 +@@ -203,3 +207,26 @@ struct auth_domain *auth_domain_find(char *name)
2020 + return NULL;
2021 + }
2022 + EXPORT_SYMBOL_GPL(auth_domain_find);
2023 ++
2024 ++/**
2025 ++ * auth_domain_cleanup - check that the auth_domain table is empty
2026 ++ *
2027 ++ * On module unload the auth_domain_table must be empty. To make it
2028 ++ * easier to catch bugs which don't clean up domains properly, we
2029 ++ * warn if anything remains in the table at cleanup time.
2030 ++ *
2031 ++ * Note that we cannot proactively remove the domains at this stage.
2032 ++ * The ->release() function might be in a module that has already been
2033 ++ * unloaded.
2034 ++ */
2035 ++
2036 ++void auth_domain_cleanup(void)
2037 ++{
2038 ++ int h;
2039 ++ struct auth_domain *hp;
2040 ++
2041 ++ for (h = 0; h < DN_HASHMAX; h++)
2042 ++ hlist_for_each_entry(hp, &auth_domain_table[h], hash)
2043 ++ pr_warn("svc: domain %s still present at module unload.\n",
2044 ++ hp->name);
2045 ++}
2046 +diff --git a/net/x25/x25_subr.c b/net/x25/x25_subr.c
2047 +index 8aa415a38814..0285aaa1e93c 100644
2048 +--- a/net/x25/x25_subr.c
2049 ++++ b/net/x25/x25_subr.c
2050 +@@ -357,6 +357,12 @@ void x25_disconnect(struct sock *sk, int reason, unsigned char cause,
2051 + sk->sk_state_change(sk);
2052 + sock_set_flag(sk, SOCK_DEAD);
2053 + }
2054 ++ if (x25->neighbour) {
2055 ++ read_lock_bh(&x25_list_lock);
2056 ++ x25_neigh_put(x25->neighbour);
2057 ++ x25->neighbour = NULL;
2058 ++ read_unlock_bh(&x25_list_lock);
2059 ++ }
2060 + }
2061 +
2062 + /*
2063 +diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
2064 +index 6a1a21ae47bb..2917711ff8ab 100644
2065 +--- a/net/xfrm/xfrm_policy.c
2066 ++++ b/net/xfrm/xfrm_policy.c
2067 +@@ -1430,14 +1430,10 @@ static void xfrm_policy_requeue(struct xfrm_policy *old,
2068 + spin_unlock_bh(&pq->hold_queue.lock);
2069 + }
2070 +
2071 +-static bool xfrm_policy_mark_match(struct xfrm_policy *policy,
2072 +- struct xfrm_policy *pol)
2073 ++static inline bool xfrm_policy_mark_match(const struct xfrm_mark *mark,
2074 ++ struct xfrm_policy *pol)
2075 + {
2076 +- if (policy->mark.v == pol->mark.v &&
2077 +- policy->priority == pol->priority)
2078 +- return true;
2079 +-
2080 +- return false;
2081 ++ return mark->v == pol->mark.v && mark->m == pol->mark.m;
2082 + }
2083 +
2084 + static u32 xfrm_pol_bin_key(const void *data, u32 len, u32 seed)
2085 +@@ -1500,7 +1496,7 @@ static void xfrm_policy_insert_inexact_list(struct hlist_head *chain,
2086 + if (pol->type == policy->type &&
2087 + pol->if_id == policy->if_id &&
2088 + !selector_cmp(&pol->selector, &policy->selector) &&
2089 +- xfrm_policy_mark_match(policy, pol) &&
2090 ++ xfrm_policy_mark_match(&policy->mark, pol) &&
2091 + xfrm_sec_ctx_match(pol->security, policy->security) &&
2092 + !WARN_ON(delpol)) {
2093 + delpol = pol;
2094 +@@ -1535,7 +1531,7 @@ static struct xfrm_policy *xfrm_policy_insert_list(struct hlist_head *chain,
2095 + if (pol->type == policy->type &&
2096 + pol->if_id == policy->if_id &&
2097 + !selector_cmp(&pol->selector, &policy->selector) &&
2098 +- xfrm_policy_mark_match(policy, pol) &&
2099 ++ xfrm_policy_mark_match(&policy->mark, pol) &&
2100 + xfrm_sec_ctx_match(pol->security, policy->security) &&
2101 + !WARN_ON(delpol)) {
2102 + if (excl)
2103 +@@ -1607,9 +1603,8 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
2104 + EXPORT_SYMBOL(xfrm_policy_insert);
2105 +
2106 + static struct xfrm_policy *
2107 +-__xfrm_policy_bysel_ctx(struct hlist_head *chain, u32 mark, u32 if_id,
2108 +- u8 type, int dir,
2109 +- struct xfrm_selector *sel,
2110 ++__xfrm_policy_bysel_ctx(struct hlist_head *chain, const struct xfrm_mark *mark,
2111 ++ u32 if_id, u8 type, int dir, struct xfrm_selector *sel,
2112 + struct xfrm_sec_ctx *ctx)
2113 + {
2114 + struct xfrm_policy *pol;
2115 +@@ -1620,7 +1615,7 @@ __xfrm_policy_bysel_ctx(struct hlist_head *chain, u32 mark, u32 if_id,
2116 + hlist_for_each_entry(pol, chain, bydst) {
2117 + if (pol->type == type &&
2118 + pol->if_id == if_id &&
2119 +- (mark & pol->mark.m) == pol->mark.v &&
2120 ++ xfrm_policy_mark_match(mark, pol) &&
2121 + !selector_cmp(sel, &pol->selector) &&
2122 + xfrm_sec_ctx_match(ctx, pol->security))
2123 + return pol;
2124 +@@ -1629,11 +1624,10 @@ __xfrm_policy_bysel_ctx(struct hlist_head *chain, u32 mark, u32 if_id,
2125 + return NULL;
2126 + }
2127 +
2128 +-struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, u32 if_id,
2129 +- u8 type, int dir,
2130 +- struct xfrm_selector *sel,
2131 +- struct xfrm_sec_ctx *ctx, int delete,
2132 +- int *err)
2133 ++struct xfrm_policy *
2134 ++xfrm_policy_bysel_ctx(struct net *net, const struct xfrm_mark *mark, u32 if_id,
2135 ++ u8 type, int dir, struct xfrm_selector *sel,
2136 ++ struct xfrm_sec_ctx *ctx, int delete, int *err)
2137 + {
2138 + struct xfrm_pol_inexact_bin *bin = NULL;
2139 + struct xfrm_policy *pol, *ret = NULL;
2140 +@@ -1700,9 +1694,9 @@ struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, u32 if_id,
2141 + }
2142 + EXPORT_SYMBOL(xfrm_policy_bysel_ctx);
2143 +
2144 +-struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u32 if_id,
2145 +- u8 type, int dir, u32 id, int delete,
2146 +- int *err)
2147 ++struct xfrm_policy *
2148 ++xfrm_policy_byid(struct net *net, const struct xfrm_mark *mark, u32 if_id,
2149 ++ u8 type, int dir, u32 id, int delete, int *err)
2150 + {
2151 + struct xfrm_policy *pol, *ret;
2152 + struct hlist_head *chain;
2153 +@@ -1717,8 +1711,7 @@ struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u32 if_id,
2154 + ret = NULL;
2155 + hlist_for_each_entry(pol, chain, byidx) {
2156 + if (pol->type == type && pol->index == id &&
2157 +- pol->if_id == if_id &&
2158 +- (mark & pol->mark.m) == pol->mark.v) {
2159 ++ pol->if_id == if_id && xfrm_policy_mark_match(mark, pol)) {
2160 + xfrm_pol_hold(pol);
2161 + if (delete) {
2162 + *err = security_xfrm_policy_delete(
2163 +diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
2164 +index e6cfaa680ef3..fbb7d9d06478 100644
2165 +--- a/net/xfrm/xfrm_user.c
2166 ++++ b/net/xfrm/xfrm_user.c
2167 +@@ -1863,7 +1863,6 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
2168 + struct km_event c;
2169 + int delete;
2170 + struct xfrm_mark m;
2171 +- u32 mark = xfrm_mark_get(attrs, &m);
2172 + u32 if_id = 0;
2173 +
2174 + p = nlmsg_data(nlh);
2175 +@@ -1880,8 +1879,11 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
2176 + if (attrs[XFRMA_IF_ID])
2177 + if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
2178 +
2179 ++ xfrm_mark_get(attrs, &m);
2180 ++
2181 + if (p->index)
2182 +- xp = xfrm_policy_byid(net, mark, if_id, type, p->dir, p->index, delete, &err);
2183 ++ xp = xfrm_policy_byid(net, &m, if_id, type, p->dir,
2184 ++ p->index, delete, &err);
2185 + else {
2186 + struct nlattr *rt = attrs[XFRMA_SEC_CTX];
2187 + struct xfrm_sec_ctx *ctx;
2188 +@@ -1898,8 +1900,8 @@ static int xfrm_get_policy(struct sk_buff *skb, struct nlmsghdr *nlh,
2189 + if (err)
2190 + return err;
2191 + }
2192 +- xp = xfrm_policy_bysel_ctx(net, mark, if_id, type, p->dir, &p->sel,
2193 +- ctx, delete, &err);
2194 ++ xp = xfrm_policy_bysel_ctx(net, &m, if_id, type, p->dir,
2195 ++ &p->sel, ctx, delete, &err);
2196 + security_xfrm_policy_free(ctx);
2197 + }
2198 + if (xp == NULL)
2199 +@@ -2166,7 +2168,6 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
2200 + u8 type = XFRM_POLICY_TYPE_MAIN;
2201 + int err = -ENOENT;
2202 + struct xfrm_mark m;
2203 +- u32 mark = xfrm_mark_get(attrs, &m);
2204 + u32 if_id = 0;
2205 +
2206 + err = copy_from_user_policy_type(&type, attrs);
2207 +@@ -2180,8 +2181,11 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
2208 + if (attrs[XFRMA_IF_ID])
2209 + if_id = nla_get_u32(attrs[XFRMA_IF_ID]);
2210 +
2211 ++ xfrm_mark_get(attrs, &m);
2212 ++
2213 + if (p->index)
2214 +- xp = xfrm_policy_byid(net, mark, if_id, type, p->dir, p->index, 0, &err);
2215 ++ xp = xfrm_policy_byid(net, &m, if_id, type, p->dir, p->index,
2216 ++ 0, &err);
2217 + else {
2218 + struct nlattr *rt = attrs[XFRMA_SEC_CTX];
2219 + struct xfrm_sec_ctx *ctx;
2220 +@@ -2198,7 +2202,7 @@ static int xfrm_add_pol_expire(struct sk_buff *skb, struct nlmsghdr *nlh,
2221 + if (err)
2222 + return err;
2223 + }
2224 +- xp = xfrm_policy_bysel_ctx(net, mark, if_id, type, p->dir,
2225 ++ xp = xfrm_policy_bysel_ctx(net, &m, if_id, type, p->dir,
2226 + &p->sel, ctx, 0, &err);
2227 + security_xfrm_policy_free(ctx);
2228 + }
2229 +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
2230 +index 820f534a67b1..908b68fda24c 100644
2231 +--- a/sound/pci/hda/patch_hdmi.c
2232 ++++ b/sound/pci/hda/patch_hdmi.c
2233 +@@ -2483,6 +2483,7 @@ static void generic_acomp_notifier_set(struct drm_audio_component *acomp,
2234 + mutex_lock(&spec->bind_lock);
2235 + spec->use_acomp_notifier = use_acomp;
2236 + spec->codec->relaxed_resume = use_acomp;
2237 ++ spec->codec->bus->keep_power = 0;
2238 + /* reprogram each jack detection logic depending on the notifier */
2239 + if (spec->use_jack_detect) {
2240 + for (i = 0; i < spec->num_pins; i++)
2241 +@@ -2578,7 +2579,6 @@ static void generic_acomp_init(struct hda_codec *codec,
2242 + if (!snd_hdac_acomp_init(&codec->bus->core, &spec->drm_audio_ops,
2243 + match_bound_vga, 0)) {
2244 + spec->acomp_registered = true;
2245 +- codec->bus->keep_power = 0;
2246 + }
2247 + }
2248 +
2249 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
2250 +index bf205621d7ac..f50d71da1226 100644
2251 +--- a/sound/pci/hda/patch_realtek.c
2252 ++++ b/sound/pci/hda/patch_realtek.c
2253 +@@ -5940,6 +5940,16 @@ static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
2254 + snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ);
2255 + }
2256 +
2257 ++static void alc285_fixup_hp_gpio_amp_init(struct hda_codec *codec,
2258 ++ const struct hda_fixup *fix, int action)
2259 ++{
2260 ++ if (action != HDA_FIXUP_ACT_INIT)
2261 ++ return;
2262 ++
2263 ++ msleep(100);
2264 ++ alc_write_coef_idx(codec, 0x65, 0x0);
2265 ++}
2266 ++
2267 + /* for hda_fixup_thinkpad_acpi() */
2268 + #include "thinkpad_helper.c"
2269 +
2270 +@@ -6117,8 +6127,10 @@ enum {
2271 + ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS,
2272 + ALC269VC_FIXUP_ACER_HEADSET_MIC,
2273 + ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE,
2274 +- ALC289_FIXUP_ASUS_G401,
2275 ++ ALC289_FIXUP_ASUS_GA401,
2276 ++ ALC289_FIXUP_ASUS_GA502,
2277 + ALC256_FIXUP_ACER_MIC_NO_PRESENCE,
2278 ++ ALC285_FIXUP_HP_GPIO_AMP_INIT,
2279 + };
2280 +
2281 + static const struct hda_fixup alc269_fixups[] = {
2282 +@@ -7328,7 +7340,14 @@ static const struct hda_fixup alc269_fixups[] = {
2283 + .chained = true,
2284 + .chain_id = ALC269_FIXUP_HEADSET_MIC
2285 + },
2286 +- [ALC289_FIXUP_ASUS_G401] = {
2287 ++ [ALC289_FIXUP_ASUS_GA401] = {
2288 ++ .type = HDA_FIXUP_PINS,
2289 ++ .v.pins = (const struct hda_pintbl[]) {
2290 ++ { 0x19, 0x03a11020 }, /* headset mic with jack detect */
2291 ++ { }
2292 ++ },
2293 ++ },
2294 ++ [ALC289_FIXUP_ASUS_GA502] = {
2295 + .type = HDA_FIXUP_PINS,
2296 + .v.pins = (const struct hda_pintbl[]) {
2297 + { 0x19, 0x03a11020 }, /* headset mic with jack detect */
2298 +@@ -7344,6 +7363,12 @@ static const struct hda_fixup alc269_fixups[] = {
2299 + .chained = true,
2300 + .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE
2301 + },
2302 ++ [ALC285_FIXUP_HP_GPIO_AMP_INIT] = {
2303 ++ .type = HDA_FIXUP_FUNC,
2304 ++ .v.func = alc285_fixup_hp_gpio_amp_init,
2305 ++ .chained = true,
2306 ++ .chain_id = ALC285_FIXUP_HP_GPIO_LED
2307 ++ },
2308 + };
2309 +
2310 + static const struct snd_pci_quirk alc269_fixup_tbl[] = {
2311 +@@ -7494,7 +7519,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
2312 + SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3),
2313 + SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED),
2314 + SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED),
2315 +- SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_LED),
2316 ++ SND_PCI_QUIRK(0x103c, 0x8736, "HP", ALC285_FIXUP_HP_GPIO_AMP_INIT),
2317 + SND_PCI_QUIRK(0x103c, 0x877a, "HP", ALC285_FIXUP_HP_MUTE_LED),
2318 + SND_PCI_QUIRK(0x103c, 0x877d, "HP", ALC236_FIXUP_HP_MUTE_LED),
2319 + SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
2320 +@@ -7526,7 +7551,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
2321 + SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
2322 + SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
2323 + SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC),
2324 +- SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_G401),
2325 ++ SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502),
2326 ++ SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
2327 + SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
2328 + SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
2329 + SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
2330 +@@ -7546,7 +7572,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
2331 + SND_PCI_QUIRK(0x10cf, 0x1629, "Lifebook U7x7", ALC255_FIXUP_LIFEBOOK_U7x7_HEADSET_MIC),
2332 + SND_PCI_QUIRK(0x10cf, 0x1845, "Lifebook U904", ALC269_FIXUP_LIFEBOOK_EXTMIC),
2333 + SND_PCI_QUIRK(0x10ec, 0x10f2, "Intel Reference board", ALC700_FIXUP_INTEL_REFERENCE),
2334 +- SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC225_FIXUP_HEADSET_JACK),
2335 ++ SND_PCI_QUIRK(0x10ec, 0x1230, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
2336 + SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
2337 + SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
2338 + SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
2339 +diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
2340 +index 086244c70743..d11d00efc574 100644
2341 +--- a/sound/usb/pcm.c
2342 ++++ b/sound/usb/pcm.c
2343 +@@ -354,6 +354,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
2344 + ifnum = 0;
2345 + goto add_sync_ep_from_ifnum;
2346 + case USB_ID(0x07fd, 0x0008): /* MOTU M Series */
2347 ++ case USB_ID(0x31e9, 0x0001): /* Solid State Logic SSL2 */
2348 + case USB_ID(0x31e9, 0x0002): /* Solid State Logic SSL2+ */
2349 + case USB_ID(0x0d9a, 0x00df): /* RTX6001 */
2350 + ep = 0x81;
2351 +diff --git a/tools/lib/traceevent/plugins/Makefile b/tools/lib/traceevent/plugins/Makefile
2352 +index f440989fa55e..23c3535bcbd6 100644
2353 +--- a/tools/lib/traceevent/plugins/Makefile
2354 ++++ b/tools/lib/traceevent/plugins/Makefile
2355 +@@ -196,7 +196,7 @@ define do_generate_dynamic_list_file
2356 + xargs echo "U w W" | tr 'w ' 'W\n' | sort -u | xargs echo`;\
2357 + if [ "$$symbol_type" = "U W" ];then \
2358 + (echo '{'; \
2359 +- $(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u;\
2360 ++ $(NM) -u -D $1 | awk 'NF>1 {sub("@.*", "", $$2); print "\t"$$2";"}' | sort -u;\
2361 + echo '};'; \
2362 + ) > $2; \
2363 + else \
2364 +diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c
2365 +index 0a6e75b8777a..28a5d0c18b1d 100644
2366 +--- a/tools/perf/arch/arm/util/auxtrace.c
2367 ++++ b/tools/perf/arch/arm/util/auxtrace.c
2368 +@@ -56,7 +56,7 @@ struct auxtrace_record
2369 + struct perf_pmu *cs_etm_pmu;
2370 + struct evsel *evsel;
2371 + bool found_etm = false;
2372 +- bool found_spe = false;
2373 ++ struct perf_pmu *found_spe = NULL;
2374 + static struct perf_pmu **arm_spe_pmus = NULL;
2375 + static int nr_spes = 0;
2376 + int i = 0;
2377 +@@ -74,12 +74,12 @@ struct auxtrace_record
2378 + evsel->core.attr.type == cs_etm_pmu->type)
2379 + found_etm = true;
2380 +
2381 +- if (!nr_spes)
2382 ++ if (!nr_spes || found_spe)
2383 + continue;
2384 +
2385 + for (i = 0; i < nr_spes; i++) {
2386 + if (evsel->core.attr.type == arm_spe_pmus[i]->type) {
2387 +- found_spe = true;
2388 ++ found_spe = arm_spe_pmus[i];
2389 + break;
2390 + }
2391 + }
2392 +@@ -96,7 +96,7 @@ struct auxtrace_record
2393 +
2394 + #if defined(__aarch64__)
2395 + if (found_spe)
2396 +- return arm_spe_recording_init(err, arm_spe_pmus[i]);
2397 ++ return arm_spe_recording_init(err, found_spe);
2398 + #endif
2399 +
2400 + /*
2401 +diff --git a/tools/perf/bench/bench.h b/tools/perf/bench/bench.h
2402 +index fddb3ced9db6..4aa6de1aa67d 100644
2403 +--- a/tools/perf/bench/bench.h
2404 ++++ b/tools/perf/bench/bench.h
2405 +@@ -2,6 +2,10 @@
2406 + #ifndef BENCH_H
2407 + #define BENCH_H
2408 +
2409 ++#include <sys/time.h>
2410 ++
2411 ++extern struct timeval bench__start, bench__end, bench__runtime;
2412 ++
2413 + /*
2414 + * The madvise transparent hugepage constants were added in glibc
2415 + * 2.13. For compatibility with older versions of glibc, define these
2416 +diff --git a/tools/perf/bench/epoll-ctl.c b/tools/perf/bench/epoll-ctl.c
2417 +index bb617e568841..a7526c05df38 100644
2418 +--- a/tools/perf/bench/epoll-ctl.c
2419 ++++ b/tools/perf/bench/epoll-ctl.c
2420 +@@ -35,7 +35,6 @@
2421 +
2422 + static unsigned int nthreads = 0;
2423 + static unsigned int nsecs = 8;
2424 +-struct timeval start, end, runtime;
2425 + static bool done, __verbose, randomize;
2426 +
2427 + /*
2428 +@@ -94,8 +93,8 @@ static void toggle_done(int sig __maybe_unused,
2429 + {
2430 + /* inform all threads that we're done for the day */
2431 + done = true;
2432 +- gettimeofday(&end, NULL);
2433 +- timersub(&end, &start, &runtime);
2434 ++ gettimeofday(&bench__end, NULL);
2435 ++ timersub(&bench__end, &bench__start, &bench__runtime);
2436 + }
2437 +
2438 + static void nest_epollfd(void)
2439 +@@ -361,7 +360,7 @@ int bench_epoll_ctl(int argc, const char **argv)
2440 +
2441 + threads_starting = nthreads;
2442 +
2443 +- gettimeofday(&start, NULL);
2444 ++ gettimeofday(&bench__start, NULL);
2445 +
2446 + do_threads(worker, cpu);
2447 +
2448 +diff --git a/tools/perf/bench/epoll-wait.c b/tools/perf/bench/epoll-wait.c
2449 +index 7af694437f4e..d1c5cb526b9f 100644
2450 +--- a/tools/perf/bench/epoll-wait.c
2451 ++++ b/tools/perf/bench/epoll-wait.c
2452 +@@ -90,7 +90,6 @@
2453 +
2454 + static unsigned int nthreads = 0;
2455 + static unsigned int nsecs = 8;
2456 +-struct timeval start, end, runtime;
2457 + static bool wdone, done, __verbose, randomize, nonblocking;
2458 +
2459 + /*
2460 +@@ -276,8 +275,8 @@ static void toggle_done(int sig __maybe_unused,
2461 + {
2462 + /* inform all threads that we're done for the day */
2463 + done = true;
2464 +- gettimeofday(&end, NULL);
2465 +- timersub(&end, &start, &runtime);
2466 ++ gettimeofday(&bench__end, NULL);
2467 ++ timersub(&bench__end, &bench__start, &bench__runtime);
2468 + }
2469 +
2470 + static void print_summary(void)
2471 +@@ -287,7 +286,7 @@ static void print_summary(void)
2472 +
2473 + printf("\nAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n",
2474 + avg, rel_stddev_stats(stddev, avg),
2475 +- (int) runtime.tv_sec);
2476 ++ (int)bench__runtime.tv_sec);
2477 + }
2478 +
2479 + static int do_threads(struct worker *worker, struct perf_cpu_map *cpu)
2480 +@@ -479,7 +478,7 @@ int bench_epoll_wait(int argc, const char **argv)
2481 +
2482 + threads_starting = nthreads;
2483 +
2484 +- gettimeofday(&start, NULL);
2485 ++ gettimeofday(&bench__start, NULL);
2486 +
2487 + do_threads(worker, cpu);
2488 +
2489 +@@ -519,7 +518,7 @@ int bench_epoll_wait(int argc, const char **argv)
2490 + qsort(worker, nthreads, sizeof(struct worker), cmpworker);
2491 +
2492 + for (i = 0; i < nthreads; i++) {
2493 +- unsigned long t = worker[i].ops/runtime.tv_sec;
2494 ++ unsigned long t = worker[i].ops / bench__runtime.tv_sec;
2495 +
2496 + update_stats(&throughput_stats, t);
2497 +
2498 +diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c
2499 +index 8ba0c3330a9a..21776862e940 100644
2500 +--- a/tools/perf/bench/futex-hash.c
2501 ++++ b/tools/perf/bench/futex-hash.c
2502 +@@ -37,7 +37,7 @@ static unsigned int nfutexes = 1024;
2503 + static bool fshared = false, done = false, silent = false;
2504 + static int futex_flag = 0;
2505 +
2506 +-struct timeval start, end, runtime;
2507 ++struct timeval bench__start, bench__end, bench__runtime;
2508 + static pthread_mutex_t thread_lock;
2509 + static unsigned int threads_starting;
2510 + static struct stats throughput_stats;
2511 +@@ -103,8 +103,8 @@ static void toggle_done(int sig __maybe_unused,
2512 + {
2513 + /* inform all threads that we're done for the day */
2514 + done = true;
2515 +- gettimeofday(&end, NULL);
2516 +- timersub(&end, &start, &runtime);
2517 ++ gettimeofday(&bench__end, NULL);
2518 ++ timersub(&bench__end, &bench__start, &bench__runtime);
2519 + }
2520 +
2521 + static void print_summary(void)
2522 +@@ -114,7 +114,7 @@ static void print_summary(void)
2523 +
2524 + printf("%sAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n",
2525 + !silent ? "\n" : "", avg, rel_stddev_stats(stddev, avg),
2526 +- (int) runtime.tv_sec);
2527 ++ (int)bench__runtime.tv_sec);
2528 + }
2529 +
2530 + int bench_futex_hash(int argc, const char **argv)
2531 +@@ -161,7 +161,7 @@ int bench_futex_hash(int argc, const char **argv)
2532 +
2533 + threads_starting = nthreads;
2534 + pthread_attr_init(&thread_attr);
2535 +- gettimeofday(&start, NULL);
2536 ++ gettimeofday(&bench__start, NULL);
2537 + for (i = 0; i < nthreads; i++) {
2538 + worker[i].tid = i;
2539 + worker[i].futex = calloc(nfutexes, sizeof(*worker[i].futex));
2540 +@@ -204,7 +204,7 @@ int bench_futex_hash(int argc, const char **argv)
2541 + pthread_mutex_destroy(&thread_lock);
2542 +
2543 + for (i = 0; i < nthreads; i++) {
2544 +- unsigned long t = worker[i].ops/runtime.tv_sec;
2545 ++ unsigned long t = worker[i].ops / bench__runtime.tv_sec;
2546 + update_stats(&throughput_stats, t);
2547 + if (!silent) {
2548 + if (nfutexes == 1)
2549 +diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c
2550 +index d0cae8125423..30d97121dc4f 100644
2551 +--- a/tools/perf/bench/futex-lock-pi.c
2552 ++++ b/tools/perf/bench/futex-lock-pi.c
2553 +@@ -37,7 +37,6 @@ static bool silent = false, multi = false;
2554 + static bool done = false, fshared = false;
2555 + static unsigned int nthreads = 0;
2556 + static int futex_flag = 0;
2557 +-struct timeval start, end, runtime;
2558 + static pthread_mutex_t thread_lock;
2559 + static unsigned int threads_starting;
2560 + static struct stats throughput_stats;
2561 +@@ -64,7 +63,7 @@ static void print_summary(void)
2562 +
2563 + printf("%sAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n",
2564 + !silent ? "\n" : "", avg, rel_stddev_stats(stddev, avg),
2565 +- (int) runtime.tv_sec);
2566 ++ (int)bench__runtime.tv_sec);
2567 + }
2568 +
2569 + static void toggle_done(int sig __maybe_unused,
2570 +@@ -73,8 +72,8 @@ static void toggle_done(int sig __maybe_unused,
2571 + {
2572 + /* inform all threads that we're done for the day */
2573 + done = true;
2574 +- gettimeofday(&end, NULL);
2575 +- timersub(&end, &start, &runtime);
2576 ++ gettimeofday(&bench__end, NULL);
2577 ++ timersub(&bench__end, &bench__start, &bench__runtime);
2578 + }
2579 +
2580 + static void *workerfn(void *arg)
2581 +@@ -185,7 +184,7 @@ int bench_futex_lock_pi(int argc, const char **argv)
2582 +
2583 + threads_starting = nthreads;
2584 + pthread_attr_init(&thread_attr);
2585 +- gettimeofday(&start, NULL);
2586 ++ gettimeofday(&bench__start, NULL);
2587 +
2588 + create_threads(worker, thread_attr, cpu);
2589 + pthread_attr_destroy(&thread_attr);
2590 +@@ -211,7 +210,7 @@ int bench_futex_lock_pi(int argc, const char **argv)
2591 + pthread_mutex_destroy(&thread_lock);
2592 +
2593 + for (i = 0; i < nthreads; i++) {
2594 +- unsigned long t = worker[i].ops/runtime.tv_sec;
2595 ++ unsigned long t = worker[i].ops / bench__runtime.tv_sec;
2596 +
2597 + update_stats(&throughput_stats, t);
2598 + if (!silent)
2599 +diff --git a/tools/perf/tests/bp_account.c b/tools/perf/tests/bp_account.c
2600 +index 016bba2c142d..55a9de311d7b 100644
2601 +--- a/tools/perf/tests/bp_account.c
2602 ++++ b/tools/perf/tests/bp_account.c
2603 +@@ -23,7 +23,7 @@
2604 + #include "../perf-sys.h"
2605 + #include "cloexec.h"
2606 +
2607 +-volatile long the_var;
2608 ++static volatile long the_var;
2609 +
2610 + static noinline int test_function(void)
2611 + {
2612 +diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
2613 +index 3baca06786fb..018ecf7b6da9 100644
2614 +--- a/tools/perf/util/env.c
2615 ++++ b/tools/perf/util/env.c
2616 +@@ -326,11 +326,11 @@ static const char *normalize_arch(char *arch)
2617 +
2618 + const char *perf_env__arch(struct perf_env *env)
2619 + {
2620 +- struct utsname uts;
2621 + char *arch_name;
2622 +
2623 + if (!env || !env->arch) { /* Assume local operation */
2624 +- if (uname(&uts) < 0)
2625 ++ static struct utsname uts = { .machine[0] = '\0', };
2626 ++ if (uts.machine[0] == '\0' && uname(&uts) < 0)
2627 + return NULL;
2628 + arch_name = uts.machine;
2629 + } else
2630 +diff --git a/tools/testing/selftests/net/fib_nexthop_multiprefix.sh b/tools/testing/selftests/net/fib_nexthop_multiprefix.sh
2631 +index 9dc35a16e415..51df5e305855 100755
2632 +--- a/tools/testing/selftests/net/fib_nexthop_multiprefix.sh
2633 ++++ b/tools/testing/selftests/net/fib_nexthop_multiprefix.sh
2634 +@@ -144,7 +144,7 @@ setup()
2635 +
2636 + cleanup()
2637 + {
2638 +- for n in h1 r1 h2 h3 h4
2639 ++ for n in h0 r1 h1 h2 h3
2640 + do
2641 + ip netns del ${n} 2>/dev/null
2642 + done
2643 +diff --git a/tools/testing/selftests/net/ip_defrag.sh b/tools/testing/selftests/net/ip_defrag.sh
2644 +index 15d3489ecd9c..ceb7ad4dbd94 100755
2645 +--- a/tools/testing/selftests/net/ip_defrag.sh
2646 ++++ b/tools/testing/selftests/net/ip_defrag.sh
2647 +@@ -6,6 +6,8 @@
2648 + set +x
2649 + set -e
2650 +
2651 ++modprobe -q nf_defrag_ipv6
2652 ++
2653 + readonly NETNS="ns-$(mktemp -u XXXXXX)"
2654 +
2655 + setup() {
2656 +diff --git a/tools/testing/selftests/net/psock_fanout.c b/tools/testing/selftests/net/psock_fanout.c
2657 +index 8c8c7d79c38d..2c522f7a0aec 100644
2658 +--- a/tools/testing/selftests/net/psock_fanout.c
2659 ++++ b/tools/testing/selftests/net/psock_fanout.c
2660 +@@ -350,7 +350,8 @@ static int test_datapath(uint16_t typeflags, int port_off,
2661 + int fds[2], fds_udp[2][2], ret;
2662 +
2663 + fprintf(stderr, "\ntest: datapath 0x%hx ports %hu,%hu\n",
2664 +- typeflags, PORT_BASE, PORT_BASE + port_off);
2665 ++ typeflags, (uint16_t)PORT_BASE,
2666 ++ (uint16_t)(PORT_BASE + port_off));
2667 +
2668 + fds[0] = sock_fanout_open(typeflags, 0);
2669 + fds[1] = sock_fanout_open(typeflags, 0);
2670 +diff --git a/tools/testing/selftests/net/so_txtime.c b/tools/testing/selftests/net/so_txtime.c
2671 +index ceaad78e9667..3155fbbf644b 100644
2672 +--- a/tools/testing/selftests/net/so_txtime.c
2673 ++++ b/tools/testing/selftests/net/so_txtime.c
2674 +@@ -121,7 +121,7 @@ static bool do_recv_one(int fdr, struct timed_send *ts)
2675 + if (rbuf[0] != ts->data)
2676 + error(1, 0, "payload mismatch. expected %c", ts->data);
2677 +
2678 +- if (labs(tstop - texpect) > cfg_variance_us)
2679 ++ if (llabs(tstop - texpect) > cfg_variance_us)
2680 + error(1, 0, "exceeds variance (%d us)", cfg_variance_us);
2681 +
2682 + return false;
2683 +diff --git a/tools/testing/selftests/networking/timestamping/rxtimestamp.c b/tools/testing/selftests/networking/timestamping/rxtimestamp.c
2684 +index 422e7761254d..bcb79ba1f214 100644
2685 +--- a/tools/testing/selftests/networking/timestamping/rxtimestamp.c
2686 ++++ b/tools/testing/selftests/networking/timestamping/rxtimestamp.c
2687 +@@ -329,8 +329,7 @@ int main(int argc, char **argv)
2688 + bool all_tests = true;
2689 + int arg_index = 0;
2690 + int failures = 0;
2691 +- int s, t;
2692 +- char opt;
2693 ++ int s, t, opt;
2694 +
2695 + while ((opt = getopt_long(argc, argv, "", long_options,
2696 + &arg_index)) != -1) {
2697 +diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
2698 +index ce7fa37987e1..767ac4eab4fe 100644
2699 +--- a/virt/kvm/arm/mmu.c
2700 ++++ b/virt/kvm/arm/mmu.c
2701 +@@ -1199,7 +1199,7 @@ static bool stage2_get_leaf_entry(struct kvm *kvm, phys_addr_t addr,
2702 + return true;
2703 + }
2704 +
2705 +-static bool stage2_is_exec(struct kvm *kvm, phys_addr_t addr)
2706 ++static bool stage2_is_exec(struct kvm *kvm, phys_addr_t addr, unsigned long sz)
2707 + {
2708 + pud_t *pudp;
2709 + pmd_t *pmdp;
2710 +@@ -1211,11 +1211,11 @@ static bool stage2_is_exec(struct kvm *kvm, phys_addr_t addr)
2711 + return false;
2712 +
2713 + if (pudp)
2714 +- return kvm_s2pud_exec(pudp);
2715 ++ return sz <= PUD_SIZE && kvm_s2pud_exec(pudp);
2716 + else if (pmdp)
2717 +- return kvm_s2pmd_exec(pmdp);
2718 ++ return sz <= PMD_SIZE && kvm_s2pmd_exec(pmdp);
2719 + else
2720 +- return kvm_s2pte_exec(ptep);
2721 ++ return sz == PAGE_SIZE && kvm_s2pte_exec(ptep);
2722 + }
2723 +
2724 + static int stage2_set_pte(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
2725 +@@ -1805,7 +1805,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
2726 + * execute permissions, and we preserve whatever we have.
2727 + */
2728 + needs_exec = exec_fault ||
2729 +- (fault_status == FSC_PERM && stage2_is_exec(kvm, fault_ipa));
2730 ++ (fault_status == FSC_PERM &&
2731 ++ stage2_is_exec(kvm, fault_ipa, vma_pagesize));
2732 +
2733 + if (vma_pagesize == PUD_SIZE) {
2734 + pud_t new_pud = kvm_pfn_pud(pfn, mem_type);