Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.14 commit in: /
Date: Wed, 08 May 2019 10:05:21
Message-Id: 1557309901.fa57465f22a779829144a4a6e30303af035636da.mpagano@gentoo
1 commit: fa57465f22a779829144a4a6e30303af035636da
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 8 10:05:01 2019 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed May 8 10:05:01 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=fa57465f
7
8 Linux patch 4.14.117
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1116_linux-4.14.117.patch | 3163 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 3167 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index d92953a..0096da3 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -507,6 +507,10 @@ Patch: 1115_4.14.116.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.14.116
23
24 +Patch: 1116_4.14.117.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.14.117
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/1116_linux-4.14.117.patch b/1116_linux-4.14.117.patch
33 new file mode 100644
34 index 0000000..cf377a4
35 --- /dev/null
36 +++ b/1116_linux-4.14.117.patch
37 @@ -0,0 +1,3163 @@
38 +diff --git a/Documentation/driver-api/usb/power-management.rst b/Documentation/driver-api/usb/power-management.rst
39 +index 79beb807996b..4a74cf6f2797 100644
40 +--- a/Documentation/driver-api/usb/power-management.rst
41 ++++ b/Documentation/driver-api/usb/power-management.rst
42 +@@ -370,11 +370,15 @@ autosuspend the interface's device. When the usage counter is = 0
43 + then the interface is considered to be idle, and the kernel may
44 + autosuspend the device.
45 +
46 +-Drivers need not be concerned about balancing changes to the usage
47 +-counter; the USB core will undo any remaining "get"s when a driver
48 +-is unbound from its interface. As a corollary, drivers must not call
49 +-any of the ``usb_autopm_*`` functions after their ``disconnect``
50 +-routine has returned.
51 ++Drivers must be careful to balance their overall changes to the usage
52 ++counter. Unbalanced "get"s will remain in effect when a driver is
53 ++unbound from its interface, preventing the device from going into
54 ++runtime suspend should the interface be bound to a driver again. On
55 ++the other hand, drivers are allowed to achieve this balance by calling
56 ++the ``usb_autopm_*`` functions even after their ``disconnect`` routine
57 ++has returned -- say from within a work-queue routine -- provided they
58 ++retain an active reference to the interface (via ``usb_get_intf`` and
59 ++``usb_put_intf``).
60 +
61 + Drivers using the async routines are responsible for their own
62 + synchronization and mutual exclusion.
63 +diff --git a/Makefile b/Makefile
64 +index 7dcaffff08a3..efe716372985 100644
65 +--- a/Makefile
66 ++++ b/Makefile
67 +@@ -1,7 +1,7 @@
68 + # SPDX-License-Identifier: GPL-2.0
69 + VERSION = 4
70 + PATCHLEVEL = 14
71 +-SUBLEVEL = 116
72 ++SUBLEVEL = 117
73 + EXTRAVERSION =
74 + NAME = Petit Gorille
75 +
76 +diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
77 +index f7a951afd281..5a7888581eea 100644
78 +--- a/arch/arm/boot/dts/rk3288.dtsi
79 ++++ b/arch/arm/boot/dts/rk3288.dtsi
80 +@@ -1181,27 +1181,27 @@
81 + gpu_opp_table: gpu-opp-table {
82 + compatible = "operating-points-v2";
83 +
84 +- opp@100000000 {
85 ++ opp-100000000 {
86 + opp-hz = /bits/ 64 <100000000>;
87 + opp-microvolt = <950000>;
88 + };
89 +- opp@200000000 {
90 ++ opp-200000000 {
91 + opp-hz = /bits/ 64 <200000000>;
92 + opp-microvolt = <950000>;
93 + };
94 +- opp@300000000 {
95 ++ opp-300000000 {
96 + opp-hz = /bits/ 64 <300000000>;
97 + opp-microvolt = <1000000>;
98 + };
99 +- opp@400000000 {
100 ++ opp-400000000 {
101 + opp-hz = /bits/ 64 <400000000>;
102 + opp-microvolt = <1100000>;
103 + };
104 +- opp@500000000 {
105 ++ opp-500000000 {
106 + opp-hz = /bits/ 64 <500000000>;
107 + opp-microvolt = <1200000>;
108 + };
109 +- opp@600000000 {
110 ++ opp-600000000 {
111 + opp-hz = /bits/ 64 <600000000>;
112 + opp-microvolt = <1250000>;
113 + };
114 +diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c
115 +index 53c316f7301e..fe4932fda01d 100644
116 +--- a/arch/arm/mach-iop13xx/setup.c
117 ++++ b/arch/arm/mach-iop13xx/setup.c
118 +@@ -300,7 +300,7 @@ static struct resource iop13xx_adma_2_resources[] = {
119 + }
120 + };
121 +
122 +-static u64 iop13xx_adma_dmamask = DMA_BIT_MASK(64);
123 ++static u64 iop13xx_adma_dmamask = DMA_BIT_MASK(32);
124 + static struct iop_adma_platform_data iop13xx_adma_0_data = {
125 + .hw_id = 0,
126 + .pool_size = PAGE_SIZE,
127 +@@ -324,7 +324,7 @@ static struct platform_device iop13xx_adma_0_channel = {
128 + .resource = iop13xx_adma_0_resources,
129 + .dev = {
130 + .dma_mask = &iop13xx_adma_dmamask,
131 +- .coherent_dma_mask = DMA_BIT_MASK(64),
132 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
133 + .platform_data = (void *) &iop13xx_adma_0_data,
134 + },
135 + };
136 +@@ -336,7 +336,7 @@ static struct platform_device iop13xx_adma_1_channel = {
137 + .resource = iop13xx_adma_1_resources,
138 + .dev = {
139 + .dma_mask = &iop13xx_adma_dmamask,
140 +- .coherent_dma_mask = DMA_BIT_MASK(64),
141 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
142 + .platform_data = (void *) &iop13xx_adma_1_data,
143 + },
144 + };
145 +@@ -348,7 +348,7 @@ static struct platform_device iop13xx_adma_2_channel = {
146 + .resource = iop13xx_adma_2_resources,
147 + .dev = {
148 + .dma_mask = &iop13xx_adma_dmamask,
149 +- .coherent_dma_mask = DMA_BIT_MASK(64),
150 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
151 + .platform_data = (void *) &iop13xx_adma_2_data,
152 + },
153 + };
154 +diff --git a/arch/arm/mach-iop13xx/tpmi.c b/arch/arm/mach-iop13xx/tpmi.c
155 +index db511ec2b1df..116feb6b261e 100644
156 +--- a/arch/arm/mach-iop13xx/tpmi.c
157 ++++ b/arch/arm/mach-iop13xx/tpmi.c
158 +@@ -152,7 +152,7 @@ static struct resource iop13xx_tpmi_3_resources[] = {
159 + }
160 + };
161 +
162 +-u64 iop13xx_tpmi_mask = DMA_BIT_MASK(64);
163 ++u64 iop13xx_tpmi_mask = DMA_BIT_MASK(32);
164 + static struct platform_device iop13xx_tpmi_0_device = {
165 + .name = "iop-tpmi",
166 + .id = 0,
167 +@@ -160,7 +160,7 @@ static struct platform_device iop13xx_tpmi_0_device = {
168 + .resource = iop13xx_tpmi_0_resources,
169 + .dev = {
170 + .dma_mask = &iop13xx_tpmi_mask,
171 +- .coherent_dma_mask = DMA_BIT_MASK(64),
172 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
173 + },
174 + };
175 +
176 +@@ -171,7 +171,7 @@ static struct platform_device iop13xx_tpmi_1_device = {
177 + .resource = iop13xx_tpmi_1_resources,
178 + .dev = {
179 + .dma_mask = &iop13xx_tpmi_mask,
180 +- .coherent_dma_mask = DMA_BIT_MASK(64),
181 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
182 + },
183 + };
184 +
185 +@@ -182,7 +182,7 @@ static struct platform_device iop13xx_tpmi_2_device = {
186 + .resource = iop13xx_tpmi_2_resources,
187 + .dev = {
188 + .dma_mask = &iop13xx_tpmi_mask,
189 +- .coherent_dma_mask = DMA_BIT_MASK(64),
190 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
191 + },
192 + };
193 +
194 +@@ -193,7 +193,7 @@ static struct platform_device iop13xx_tpmi_3_device = {
195 + .resource = iop13xx_tpmi_3_resources,
196 + .dev = {
197 + .dma_mask = &iop13xx_tpmi_mask,
198 +- .coherent_dma_mask = DMA_BIT_MASK(64),
199 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
200 + },
201 + };
202 +
203 +diff --git a/arch/arm/plat-iop/adma.c b/arch/arm/plat-iop/adma.c
204 +index a4d1f8de3b5b..d9612221e484 100644
205 +--- a/arch/arm/plat-iop/adma.c
206 ++++ b/arch/arm/plat-iop/adma.c
207 +@@ -143,7 +143,7 @@ struct platform_device iop3xx_dma_0_channel = {
208 + .resource = iop3xx_dma_0_resources,
209 + .dev = {
210 + .dma_mask = &iop3xx_adma_dmamask,
211 +- .coherent_dma_mask = DMA_BIT_MASK(64),
212 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
213 + .platform_data = (void *) &iop3xx_dma_0_data,
214 + },
215 + };
216 +@@ -155,7 +155,7 @@ struct platform_device iop3xx_dma_1_channel = {
217 + .resource = iop3xx_dma_1_resources,
218 + .dev = {
219 + .dma_mask = &iop3xx_adma_dmamask,
220 +- .coherent_dma_mask = DMA_BIT_MASK(64),
221 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
222 + .platform_data = (void *) &iop3xx_dma_1_data,
223 + },
224 + };
225 +@@ -167,7 +167,7 @@ struct platform_device iop3xx_aau_channel = {
226 + .resource = iop3xx_aau_resources,
227 + .dev = {
228 + .dma_mask = &iop3xx_adma_dmamask,
229 +- .coherent_dma_mask = DMA_BIT_MASK(64),
230 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
231 + .platform_data = (void *) &iop3xx_aau_data,
232 + },
233 + };
234 +diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c
235 +index a2399fd66e97..1e970873439c 100644
236 +--- a/arch/arm/plat-orion/common.c
237 ++++ b/arch/arm/plat-orion/common.c
238 +@@ -622,7 +622,7 @@ static struct platform_device orion_xor0_shared = {
239 + .resource = orion_xor0_shared_resources,
240 + .dev = {
241 + .dma_mask = &orion_xor_dmamask,
242 +- .coherent_dma_mask = DMA_BIT_MASK(64),
243 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
244 + .platform_data = &orion_xor0_pdata,
245 + },
246 + };
247 +@@ -683,7 +683,7 @@ static struct platform_device orion_xor1_shared = {
248 + .resource = orion_xor1_shared_resources,
249 + .dev = {
250 + .dma_mask = &orion_xor_dmamask,
251 +- .coherent_dma_mask = DMA_BIT_MASK(64),
252 ++ .coherent_dma_mask = DMA_BIT_MASK(32),
253 + .platform_data = &orion_xor1_pdata,
254 + },
255 + };
256 +diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h
257 +index d131501c6222..45e3da34bdc4 100644
258 +--- a/arch/arm64/include/asm/traps.h
259 ++++ b/arch/arm64/include/asm/traps.h
260 +@@ -37,6 +37,12 @@ void unregister_undef_hook(struct undef_hook *hook);
261 +
262 + void arm64_notify_segfault(struct pt_regs *regs, unsigned long addr);
263 +
264 ++/*
265 ++ * Move regs->pc to next instruction and do necessary setup before it
266 ++ * is executed.
267 ++ */
268 ++void arm64_skip_faulting_instruction(struct pt_regs *regs, unsigned long size);
269 ++
270 + static inline int __in_irqentry_text(unsigned long ptr)
271 + {
272 + return ptr >= (unsigned long)&__irqentry_text_start &&
273 +diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c
274 +index d06fbe4cd38d..a4dc115d7659 100644
275 +--- a/arch/arm64/kernel/armv8_deprecated.c
276 ++++ b/arch/arm64/kernel/armv8_deprecated.c
277 +@@ -431,7 +431,7 @@ ret:
278 + pr_warn_ratelimited("\"%s\" (%ld) uses obsolete SWP{B} instruction at 0x%llx\n",
279 + current->comm, (unsigned long)current->pid, regs->pc);
280 +
281 +- regs->pc += 4;
282 ++ arm64_skip_faulting_instruction(regs, 4);
283 + return 0;
284 +
285 + fault:
286 +@@ -512,7 +512,7 @@ ret:
287 + pr_warn_ratelimited("\"%s\" (%ld) uses deprecated CP15 Barrier instruction at 0x%llx\n",
288 + current->comm, (unsigned long)current->pid, regs->pc);
289 +
290 +- regs->pc += 4;
291 ++ arm64_skip_faulting_instruction(regs, 4);
292 + return 0;
293 + }
294 +
295 +@@ -586,14 +586,14 @@ static int compat_setend_handler(struct pt_regs *regs, u32 big_endian)
296 + static int a32_setend_handler(struct pt_regs *regs, u32 instr)
297 + {
298 + int rc = compat_setend_handler(regs, (instr >> 9) & 1);
299 +- regs->pc += 4;
300 ++ arm64_skip_faulting_instruction(regs, 4);
301 + return rc;
302 + }
303 +
304 + static int t16_setend_handler(struct pt_regs *regs, u32 instr)
305 + {
306 + int rc = compat_setend_handler(regs, (instr >> 3) & 1);
307 +- regs->pc += 2;
308 ++ arm64_skip_faulting_instruction(regs, 2);
309 + return rc;
310 + }
311 +
312 +diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
313 +index 003dd39225a0..29b5b72b7877 100644
314 +--- a/arch/arm64/kernel/cpufeature.c
315 ++++ b/arch/arm64/kernel/cpufeature.c
316 +@@ -1398,7 +1398,7 @@ static int emulate_mrs(struct pt_regs *regs, u32 insn)
317 + if (!rc) {
318 + dst = aarch64_insn_decode_register(AARCH64_INSN_REGTYPE_RT, insn);
319 + pt_regs_write_reg(regs, dst, val);
320 +- regs->pc += 4;
321 ++ arm64_skip_faulting_instruction(regs, AARCH64_INSN_SIZE);
322 + }
323 +
324 + return rc;
325 +diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
326 +index 4cacc33d07ce..74259ae9c7f2 100644
327 +--- a/arch/arm64/kernel/traps.c
328 ++++ b/arch/arm64/kernel/traps.c
329 +@@ -296,6 +296,18 @@ void arm64_notify_die(const char *str, struct pt_regs *regs,
330 + }
331 + }
332 +
333 ++void arm64_skip_faulting_instruction(struct pt_regs *regs, unsigned long size)
334 ++{
335 ++ regs->pc += size;
336 ++
337 ++ /*
338 ++ * If we were single stepping, we want to get the step exception after
339 ++ * we return from the trap.
340 ++ */
341 ++ if (user_mode(regs))
342 ++ user_fastforward_single_step(current);
343 ++}
344 ++
345 + static LIST_HEAD(undef_hook);
346 + static DEFINE_RAW_SPINLOCK(undef_lock);
347 +
348 +@@ -483,7 +495,7 @@ static void user_cache_maint_handler(unsigned int esr, struct pt_regs *regs)
349 + if (ret)
350 + arm64_notify_segfault(regs, address);
351 + else
352 +- regs->pc += 4;
353 ++ arm64_skip_faulting_instruction(regs, AARCH64_INSN_SIZE);
354 + }
355 +
356 + static void ctr_read_handler(unsigned int esr, struct pt_regs *regs)
357 +@@ -493,7 +505,7 @@ static void ctr_read_handler(unsigned int esr, struct pt_regs *regs)
358 +
359 + pt_regs_write_reg(regs, rt, val);
360 +
361 +- regs->pc += 4;
362 ++ arm64_skip_faulting_instruction(regs, AARCH64_INSN_SIZE);
363 + }
364 +
365 + static void cntvct_read_handler(unsigned int esr, struct pt_regs *regs)
366 +@@ -501,7 +513,7 @@ static void cntvct_read_handler(unsigned int esr, struct pt_regs *regs)
367 + int rt = (esr & ESR_ELx_SYS64_ISS_RT_MASK) >> ESR_ELx_SYS64_ISS_RT_SHIFT;
368 +
369 + pt_regs_write_reg(regs, rt, arch_counter_get_cntvct());
370 +- regs->pc += 4;
371 ++ arm64_skip_faulting_instruction(regs, AARCH64_INSN_SIZE);
372 + }
373 +
374 + static void cntfrq_read_handler(unsigned int esr, struct pt_regs *regs)
375 +@@ -509,7 +521,7 @@ static void cntfrq_read_handler(unsigned int esr, struct pt_regs *regs)
376 + int rt = (esr & ESR_ELx_SYS64_ISS_RT_MASK) >> ESR_ELx_SYS64_ISS_RT_SHIFT;
377 +
378 + pt_regs_write_reg(regs, rt, arch_timer_get_rate());
379 +- regs->pc += 4;
380 ++ arm64_skip_faulting_instruction(regs, AARCH64_INSN_SIZE);
381 + }
382 +
383 + struct sys64_hook {
384 +@@ -756,7 +768,7 @@ static int bug_handler(struct pt_regs *regs, unsigned int esr)
385 + }
386 +
387 + /* If thread survives, skip over the BUG instruction and continue: */
388 +- regs->pc += AARCH64_INSN_SIZE; /* skip BRK and resume */
389 ++ arm64_skip_faulting_instruction(regs, AARCH64_INSN_SIZE);
390 + return DBG_HOOK_HANDLED;
391 + }
392 +
393 +diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c
394 +index 9ad37f827a97..7b59cc853abf 100644
395 +--- a/arch/powerpc/kernel/kvm.c
396 ++++ b/arch/powerpc/kernel/kvm.c
397 +@@ -22,6 +22,7 @@
398 + #include <linux/kvm_host.h>
399 + #include <linux/init.h>
400 + #include <linux/export.h>
401 ++#include <linux/kmemleak.h>
402 + #include <linux/kvm_para.h>
403 + #include <linux/slab.h>
404 + #include <linux/of.h>
405 +@@ -712,6 +713,12 @@ static void kvm_use_magic_page(void)
406 +
407 + static __init void kvm_free_tmp(void)
408 + {
409 ++ /*
410 ++ * Inform kmemleak about the hole in the .bss section since the
411 ++ * corresponding pages will be unmapped with DEBUG_PAGEALLOC=y.
412 ++ */
413 ++ kmemleak_free_part(&kvm_tmp[kvm_tmp_index],
414 ++ ARRAY_SIZE(kvm_tmp) - kvm_tmp_index);
415 + free_reserved_area(&kvm_tmp[kvm_tmp_index],
416 + &kvm_tmp[ARRAY_SIZE(kvm_tmp)], -1, NULL);
417 + }
418 +diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
419 +index 8baaa6c6f21c..e4db715ebe06 100644
420 +--- a/arch/powerpc/mm/slice.c
421 ++++ b/arch/powerpc/mm/slice.c
422 +@@ -31,6 +31,7 @@
423 + #include <linux/spinlock.h>
424 + #include <linux/export.h>
425 + #include <linux/hugetlb.h>
426 ++#include <linux/security.h>
427 + #include <asm/mman.h>
428 + #include <asm/mmu.h>
429 + #include <asm/copro.h>
430 +@@ -328,6 +329,7 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm,
431 + int pshift = max_t(int, mmu_psize_defs[psize].shift, PAGE_SHIFT);
432 + unsigned long addr, found, prev;
433 + struct vm_unmapped_area_info info;
434 ++ unsigned long min_addr = max(PAGE_SIZE, mmap_min_addr);
435 +
436 + info.flags = VM_UNMAPPED_AREA_TOPDOWN;
437 + info.length = len;
438 +@@ -344,7 +346,7 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm,
439 + if (high_limit > DEFAULT_MAP_WINDOW)
440 + addr += mm->context.addr_limit - DEFAULT_MAP_WINDOW;
441 +
442 +- while (addr > PAGE_SIZE) {
443 ++ while (addr > min_addr) {
444 + info.high_limit = addr;
445 + if (!slice_scan_available(addr - 1, available, 0, &addr))
446 + continue;
447 +@@ -356,8 +358,8 @@ static unsigned long slice_find_area_topdown(struct mm_struct *mm,
448 + * Check if we need to reduce the range, or if we can
449 + * extend it to cover the previous available slice.
450 + */
451 +- if (addr < PAGE_SIZE)
452 +- addr = PAGE_SIZE;
453 ++ if (addr < min_addr)
454 ++ addr = min_addr;
455 + else if (slice_scan_available(addr - 1, available, 0, &prev)) {
456 + addr = prev;
457 + goto prev_slice;
458 +@@ -479,7 +481,7 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
459 + addr = _ALIGN_UP(addr, page_size);
460 + slice_dbg(" aligned addr=%lx\n", addr);
461 + /* Ignore hint if it's too large or overlaps a VMA */
462 +- if (addr > high_limit - len ||
463 ++ if (addr > high_limit - len || addr < mmap_min_addr ||
464 + !slice_area_is_free(mm, addr, len))
465 + addr = 0;
466 + }
467 +diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c
468 +index 4feb7c86f4ac..5e83ea12303b 100644
469 +--- a/arch/sh/boards/of-generic.c
470 ++++ b/arch/sh/boards/of-generic.c
471 +@@ -180,10 +180,10 @@ static struct sh_machine_vector __initmv sh_of_generic_mv = {
472 +
473 + struct sh_clk_ops;
474 +
475 +-void __init arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
476 ++void __init __weak arch_init_clk_ops(struct sh_clk_ops **ops, int idx)
477 + {
478 + }
479 +
480 +-void __init plat_irq_setup(void)
481 ++void __init __weak plat_irq_setup(void)
482 + {
483 + }
484 +diff --git a/arch/x86/events/amd/core.c b/arch/x86/events/amd/core.c
485 +index 263af6312329..27ade3cb6482 100644
486 +--- a/arch/x86/events/amd/core.c
487 ++++ b/arch/x86/events/amd/core.c
488 +@@ -116,6 +116,110 @@ static __initconst const u64 amd_hw_cache_event_ids
489 + },
490 + };
491 +
492 ++static __initconst const u64 amd_hw_cache_event_ids_f17h
493 ++ [PERF_COUNT_HW_CACHE_MAX]
494 ++ [PERF_COUNT_HW_CACHE_OP_MAX]
495 ++ [PERF_COUNT_HW_CACHE_RESULT_MAX] = {
496 ++[C(L1D)] = {
497 ++ [C(OP_READ)] = {
498 ++ [C(RESULT_ACCESS)] = 0x0040, /* Data Cache Accesses */
499 ++ [C(RESULT_MISS)] = 0xc860, /* L2$ access from DC Miss */
500 ++ },
501 ++ [C(OP_WRITE)] = {
502 ++ [C(RESULT_ACCESS)] = 0,
503 ++ [C(RESULT_MISS)] = 0,
504 ++ },
505 ++ [C(OP_PREFETCH)] = {
506 ++ [C(RESULT_ACCESS)] = 0xff5a, /* h/w prefetch DC Fills */
507 ++ [C(RESULT_MISS)] = 0,
508 ++ },
509 ++},
510 ++[C(L1I)] = {
511 ++ [C(OP_READ)] = {
512 ++ [C(RESULT_ACCESS)] = 0x0080, /* Instruction cache fetches */
513 ++ [C(RESULT_MISS)] = 0x0081, /* Instruction cache misses */
514 ++ },
515 ++ [C(OP_WRITE)] = {
516 ++ [C(RESULT_ACCESS)] = -1,
517 ++ [C(RESULT_MISS)] = -1,
518 ++ },
519 ++ [C(OP_PREFETCH)] = {
520 ++ [C(RESULT_ACCESS)] = 0,
521 ++ [C(RESULT_MISS)] = 0,
522 ++ },
523 ++},
524 ++[C(LL)] = {
525 ++ [C(OP_READ)] = {
526 ++ [C(RESULT_ACCESS)] = 0,
527 ++ [C(RESULT_MISS)] = 0,
528 ++ },
529 ++ [C(OP_WRITE)] = {
530 ++ [C(RESULT_ACCESS)] = 0,
531 ++ [C(RESULT_MISS)] = 0,
532 ++ },
533 ++ [C(OP_PREFETCH)] = {
534 ++ [C(RESULT_ACCESS)] = 0,
535 ++ [C(RESULT_MISS)] = 0,
536 ++ },
537 ++},
538 ++[C(DTLB)] = {
539 ++ [C(OP_READ)] = {
540 ++ [C(RESULT_ACCESS)] = 0xff45, /* All L2 DTLB accesses */
541 ++ [C(RESULT_MISS)] = 0xf045, /* L2 DTLB misses (PT walks) */
542 ++ },
543 ++ [C(OP_WRITE)] = {
544 ++ [C(RESULT_ACCESS)] = 0,
545 ++ [C(RESULT_MISS)] = 0,
546 ++ },
547 ++ [C(OP_PREFETCH)] = {
548 ++ [C(RESULT_ACCESS)] = 0,
549 ++ [C(RESULT_MISS)] = 0,
550 ++ },
551 ++},
552 ++[C(ITLB)] = {
553 ++ [C(OP_READ)] = {
554 ++ [C(RESULT_ACCESS)] = 0x0084, /* L1 ITLB misses, L2 ITLB hits */
555 ++ [C(RESULT_MISS)] = 0xff85, /* L1 ITLB misses, L2 misses */
556 ++ },
557 ++ [C(OP_WRITE)] = {
558 ++ [C(RESULT_ACCESS)] = -1,
559 ++ [C(RESULT_MISS)] = -1,
560 ++ },
561 ++ [C(OP_PREFETCH)] = {
562 ++ [C(RESULT_ACCESS)] = -1,
563 ++ [C(RESULT_MISS)] = -1,
564 ++ },
565 ++},
566 ++[C(BPU)] = {
567 ++ [C(OP_READ)] = {
568 ++ [C(RESULT_ACCESS)] = 0x00c2, /* Retired Branch Instr. */
569 ++ [C(RESULT_MISS)] = 0x00c3, /* Retired Mispredicted BI */
570 ++ },
571 ++ [C(OP_WRITE)] = {
572 ++ [C(RESULT_ACCESS)] = -1,
573 ++ [C(RESULT_MISS)] = -1,
574 ++ },
575 ++ [C(OP_PREFETCH)] = {
576 ++ [C(RESULT_ACCESS)] = -1,
577 ++ [C(RESULT_MISS)] = -1,
578 ++ },
579 ++},
580 ++[C(NODE)] = {
581 ++ [C(OP_READ)] = {
582 ++ [C(RESULT_ACCESS)] = 0,
583 ++ [C(RESULT_MISS)] = 0,
584 ++ },
585 ++ [C(OP_WRITE)] = {
586 ++ [C(RESULT_ACCESS)] = -1,
587 ++ [C(RESULT_MISS)] = -1,
588 ++ },
589 ++ [C(OP_PREFETCH)] = {
590 ++ [C(RESULT_ACCESS)] = -1,
591 ++ [C(RESULT_MISS)] = -1,
592 ++ },
593 ++},
594 ++};
595 ++
596 + /*
597 + * AMD Performance Monitor K7 and later, up to and including Family 16h:
598 + */
599 +@@ -861,9 +965,10 @@ __init int amd_pmu_init(void)
600 + x86_pmu.amd_nb_constraints = 0;
601 + }
602 +
603 +- /* Events are common for all AMDs */
604 +- memcpy(hw_cache_event_ids, amd_hw_cache_event_ids,
605 +- sizeof(hw_cache_event_ids));
606 ++ if (boot_cpu_data.x86 >= 0x17)
607 ++ memcpy(hw_cache_event_ids, amd_hw_cache_event_ids_f17h, sizeof(hw_cache_event_ids));
608 ++ else
609 ++ memcpy(hw_cache_event_ids, amd_hw_cache_event_ids, sizeof(hw_cache_event_ids));
610 +
611 + return 0;
612 + }
613 +diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c
614 +index c51353569492..20d133ec3ef9 100644
615 +--- a/arch/x86/kernel/cpu/mcheck/mce-severity.c
616 ++++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c
617 +@@ -148,6 +148,11 @@ static struct severity {
618 + SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR|MCI_ADDR|MCACOD, MCI_UC_SAR|MCI_ADDR|MCACOD_DATA),
619 + KERNEL
620 + ),
621 ++ MCESEV(
622 ++ PANIC, "Instruction fetch error in kernel",
623 ++ SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR|MCI_ADDR|MCACOD, MCI_UC_SAR|MCI_ADDR|MCACOD_INSTR),
624 ++ KERNEL
625 ++ ),
626 + #endif
627 + MCESEV(
628 + PANIC, "Action required: unknown MCACOD",
629 +diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
630 +index 14459d66ef0c..51ff7ee1b2b1 100644
631 +--- a/drivers/block/xsysace.c
632 ++++ b/drivers/block/xsysace.c
633 +@@ -1063,6 +1063,8 @@ static int ace_setup(struct ace_device *ace)
634 + return 0;
635 +
636 + err_read:
637 ++ /* prevent double queue cleanup */
638 ++ ace->gd->queue = NULL;
639 + put_disk(ace->gd);
640 + err_alloc_disk:
641 + blk_cleanup_queue(ace->queue);
642 +diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
643 +index b8dffe937f4f..dae8723dde8c 100644
644 +--- a/drivers/bluetooth/btusb.c
645 ++++ b/drivers/bluetooth/btusb.c
646 +@@ -2893,6 +2893,7 @@ static int btusb_config_oob_wake(struct hci_dev *hdev)
647 + return 0;
648 + }
649 +
650 ++ irq_set_status_flags(irq, IRQ_NOAUTOEN);
651 + ret = devm_request_irq(&hdev->dev, irq, btusb_oob_wake_handler,
652 + 0, "OOB Wake-on-BT", data);
653 + if (ret) {
654 +@@ -2907,7 +2908,6 @@ static int btusb_config_oob_wake(struct hci_dev *hdev)
655 + }
656 +
657 + data->oob_wake_irq = irq;
658 +- disable_irq(irq);
659 + bt_dev_info(hdev, "OOB Wake-on-BT configured at IRQ %u", irq);
660 + return 0;
661 + }
662 +diff --git a/drivers/clk/x86/clk-pmc-atom.c b/drivers/clk/x86/clk-pmc-atom.c
663 +index d977193842df..19174835693b 100644
664 +--- a/drivers/clk/x86/clk-pmc-atom.c
665 ++++ b/drivers/clk/x86/clk-pmc-atom.c
666 +@@ -165,7 +165,7 @@ static const struct clk_ops plt_clk_ops = {
667 + };
668 +
669 + static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id,
670 +- void __iomem *base,
671 ++ const struct pmc_clk_data *pmc_data,
672 + const char **parent_names,
673 + int num_parents)
674 + {
675 +@@ -184,9 +184,17 @@ static struct clk_plt *plt_clk_register(struct platform_device *pdev, int id,
676 + init.num_parents = num_parents;
677 +
678 + pclk->hw.init = &init;
679 +- pclk->reg = base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE;
680 ++ pclk->reg = pmc_data->base + PMC_CLK_CTL_OFFSET + id * PMC_CLK_CTL_SIZE;
681 + spin_lock_init(&pclk->lock);
682 +
683 ++ /*
684 ++ * On some systems, the pmc_plt_clocks already enabled by the
685 ++ * firmware are being marked as critical to avoid them being
686 ++ * gated by the clock framework.
687 ++ */
688 ++ if (pmc_data->critical && plt_clk_is_enabled(&pclk->hw))
689 ++ init.flags |= CLK_IS_CRITICAL;
690 ++
691 + ret = devm_clk_hw_register(&pdev->dev, &pclk->hw);
692 + if (ret) {
693 + pclk = ERR_PTR(ret);
694 +@@ -332,7 +340,7 @@ static int plt_clk_probe(struct platform_device *pdev)
695 + return PTR_ERR(parent_names);
696 +
697 + for (i = 0; i < PMC_CLK_NUM; i++) {
698 +- data->clks[i] = plt_clk_register(pdev, i, pmc_data->base,
699 ++ data->clks[i] = plt_clk_register(pdev, i, pmc_data,
700 + parent_names, data->nparents);
701 + if (IS_ERR(data->clks[i])) {
702 + err = PTR_ERR(data->clks[i]);
703 +diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
704 +index a90967cd4987..a0bcbb633b67 100644
705 +--- a/drivers/hid/hid-debug.c
706 ++++ b/drivers/hid/hid-debug.c
707 +@@ -1060,10 +1060,15 @@ static int hid_debug_rdesc_show(struct seq_file *f, void *p)
708 + seq_printf(f, "\n\n");
709 +
710 + /* dump parsed data and input mappings */
711 ++ if (down_interruptible(&hdev->driver_input_lock))
712 ++ return 0;
713 ++
714 + hid_dump_device(hdev, f);
715 + seq_printf(f, "\n");
716 + hid_dump_input_mapping(hdev, f);
717 +
718 ++ up(&hdev->driver_input_lock);
719 ++
720 + return 0;
721 + }
722 +
723 +diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
724 +index d146a9b545ee..1aa7d268686b 100644
725 +--- a/drivers/hid/hid-input.c
726 ++++ b/drivers/hid/hid-input.c
727 +@@ -973,6 +973,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
728 + case 0x1b8: map_key_clear(KEY_VIDEO); break;
729 + case 0x1bc: map_key_clear(KEY_MESSENGER); break;
730 + case 0x1bd: map_key_clear(KEY_INFO); break;
731 ++ case 0x1cb: map_key_clear(KEY_ASSISTANT); break;
732 + case 0x201: map_key_clear(KEY_NEW); break;
733 + case 0x202: map_key_clear(KEY_OPEN); break;
734 + case 0x203: map_key_clear(KEY_CLOSE); break;
735 +diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
736 +index 614054af904a..b83d4173fc7f 100644
737 +--- a/drivers/hid/hid-logitech-hidpp.c
738 ++++ b/drivers/hid/hid-logitech-hidpp.c
739 +@@ -1907,6 +1907,13 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
740 + kfree(data);
741 + return -ENOMEM;
742 + }
743 ++ data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue");
744 ++ if (!data->wq) {
745 ++ kfree(data->effect_ids);
746 ++ kfree(data);
747 ++ return -ENOMEM;
748 ++ }
749 ++
750 + data->hidpp = hidpp;
751 + data->feature_index = feature_index;
752 + data->version = version;
753 +@@ -1951,7 +1958,6 @@ static int hidpp_ff_init(struct hidpp_device *hidpp, u8 feature_index)
754 + /* ignore boost value at response.fap.params[2] */
755 +
756 + /* init the hardware command queue */
757 +- data->wq = create_singlethread_workqueue("hidpp-ff-sendqueue");
758 + atomic_set(&data->workqueue_size, 0);
759 +
760 + /* initialize with zero autocenter to get wheel in usable state */
761 +diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
762 +index 124f9b1cf1b0..d8cbe149925b 100644
763 +--- a/drivers/i2c/busses/i2c-stm32f7.c
764 ++++ b/drivers/i2c/busses/i2c-stm32f7.c
765 +@@ -340,7 +340,7 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev,
766 + STM32F7_I2C_ANALOG_FILTER_DELAY_MAX : 0);
767 + dnf_delay = setup->dnf * i2cclk;
768 +
769 +- sdadel_min = setup->fall_time - i2c_specs[setup->speed].hddat_min -
770 ++ sdadel_min = i2c_specs[setup->speed].hddat_min + setup->fall_time -
771 + af_delay_min - (setup->dnf + 3) * i2cclk;
772 +
773 + sdadel_max = i2c_specs[setup->speed].vddat_max - setup->rise_time -
774 +diff --git a/drivers/infiniband/core/security.c b/drivers/infiniband/core/security.c
775 +index 59b2f96d986a..a3dd88c57be7 100644
776 +--- a/drivers/infiniband/core/security.c
777 ++++ b/drivers/infiniband/core/security.c
778 +@@ -715,16 +715,20 @@ int ib_mad_agent_security_setup(struct ib_mad_agent *agent,
779 + agent->device->name,
780 + agent->port_num);
781 + if (ret)
782 +- return ret;
783 ++ goto free_security;
784 +
785 + agent->lsm_nb.notifier_call = ib_mad_agent_security_change;
786 + ret = register_lsm_notifier(&agent->lsm_nb);
787 + if (ret)
788 +- return ret;
789 ++ goto free_security;
790 +
791 + agent->smp_allowed = true;
792 + agent->lsm_nb_reg = true;
793 + return 0;
794 ++
795 ++free_security:
796 ++ security_ib_free_security(agent->security);
797 ++ return ret;
798 + }
799 +
800 + void ib_mad_agent_security_cleanup(struct ib_mad_agent *agent)
801 +@@ -732,9 +736,10 @@ void ib_mad_agent_security_cleanup(struct ib_mad_agent *agent)
802 + if (!rdma_protocol_ib(agent->device, agent->port_num))
803 + return;
804 +
805 +- security_ib_free_security(agent->security);
806 + if (agent->lsm_nb_reg)
807 + unregister_lsm_notifier(&agent->lsm_nb);
808 ++
809 ++ security_ib_free_security(agent->security);
810 + }
811 +
812 + int ib_mad_enforce_security(struct ib_mad_agent_private *map, u16 pkey_index)
813 +diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
814 +index 6d59af07d338..d21c86dd27d8 100644
815 +--- a/drivers/infiniband/core/verbs.c
816 ++++ b/drivers/infiniband/core/verbs.c
817 +@@ -766,8 +766,8 @@ struct ib_qp *ib_open_qp(struct ib_xrcd *xrcd,
818 + }
819 + EXPORT_SYMBOL(ib_open_qp);
820 +
821 +-static struct ib_qp *ib_create_xrc_qp(struct ib_qp *qp,
822 +- struct ib_qp_init_attr *qp_init_attr)
823 ++static struct ib_qp *create_xrc_qp(struct ib_qp *qp,
824 ++ struct ib_qp_init_attr *qp_init_attr)
825 + {
826 + struct ib_qp *real_qp = qp;
827 +
828 +@@ -782,10 +782,10 @@ static struct ib_qp *ib_create_xrc_qp(struct ib_qp *qp,
829 +
830 + qp = __ib_open_qp(real_qp, qp_init_attr->event_handler,
831 + qp_init_attr->qp_context);
832 +- if (!IS_ERR(qp))
833 +- __ib_insert_xrcd_qp(qp_init_attr->xrcd, real_qp);
834 +- else
835 +- real_qp->device->destroy_qp(real_qp);
836 ++ if (IS_ERR(qp))
837 ++ return qp;
838 ++
839 ++ __ib_insert_xrcd_qp(qp_init_attr->xrcd, real_qp);
840 + return qp;
841 + }
842 +
843 +@@ -816,10 +816,8 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd,
844 + return qp;
845 +
846 + ret = ib_create_qp_security(qp, device);
847 +- if (ret) {
848 +- ib_destroy_qp(qp);
849 +- return ERR_PTR(ret);
850 +- }
851 ++ if (ret)
852 ++ goto err;
853 +
854 + qp->device = device;
855 + qp->real_qp = qp;
856 +@@ -834,8 +832,15 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd,
857 + INIT_LIST_HEAD(&qp->sig_mrs);
858 + qp->port = 0;
859 +
860 +- if (qp_init_attr->qp_type == IB_QPT_XRC_TGT)
861 +- return ib_create_xrc_qp(qp, qp_init_attr);
862 ++ if (qp_init_attr->qp_type == IB_QPT_XRC_TGT) {
863 ++ struct ib_qp *xrc_qp = create_xrc_qp(qp, qp_init_attr);
864 ++
865 ++ if (IS_ERR(xrc_qp)) {
866 ++ ret = PTR_ERR(xrc_qp);
867 ++ goto err;
868 ++ }
869 ++ return xrc_qp;
870 ++ }
871 +
872 + qp->event_handler = qp_init_attr->event_handler;
873 + qp->qp_context = qp_init_attr->qp_context;
874 +@@ -863,11 +868,8 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd,
875 +
876 + if (qp_init_attr->cap.max_rdma_ctxs) {
877 + ret = rdma_rw_init_mrs(qp, qp_init_attr);
878 +- if (ret) {
879 +- pr_err("failed to init MR pool ret= %d\n", ret);
880 +- ib_destroy_qp(qp);
881 +- return ERR_PTR(ret);
882 +- }
883 ++ if (ret)
884 ++ goto err;
885 + }
886 +
887 + /*
888 +@@ -880,6 +882,11 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd,
889 + device->attrs.max_sge_rd);
890 +
891 + return qp;
892 ++
893 ++err:
894 ++ ib_destroy_qp(qp);
895 ++ return ERR_PTR(ret);
896 ++
897 + }
898 + EXPORT_SYMBOL(ib_create_qp);
899 +
900 +diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
901 +index 47f3f562d86f..94161ca526fc 100644
902 +--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
903 ++++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
904 +@@ -2381,8 +2381,19 @@ static void srpt_queue_tm_rsp(struct se_cmd *cmd)
905 + srpt_queue_response(cmd);
906 + }
907 +
908 ++/*
909 ++ * This function is called for aborted commands if no response is sent to the
910 ++ * initiator. Make sure that the credits freed by aborting a command are
911 ++ * returned to the initiator the next time a response is sent by incrementing
912 ++ * ch->req_lim_delta.
913 ++ */
914 + static void srpt_aborted_task(struct se_cmd *cmd)
915 + {
916 ++ struct srpt_send_ioctx *ioctx = container_of(cmd,
917 ++ struct srpt_send_ioctx, cmd);
918 ++ struct srpt_rdma_ch *ch = ioctx->ch;
919 ++
920 ++ atomic_inc(&ch->req_lim_delta);
921 + }
922 +
923 + static int srpt_queue_status(struct se_cmd *cmd)
924 +diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
925 +index 7544888c4749..b8dbde746b4e 100644
926 +--- a/drivers/input/keyboard/snvs_pwrkey.c
927 ++++ b/drivers/input/keyboard/snvs_pwrkey.c
928 +@@ -156,6 +156,9 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
929 + return error;
930 + }
931 +
932 ++ pdata->input = input;
933 ++ platform_set_drvdata(pdev, pdata);
934 ++
935 + error = devm_request_irq(&pdev->dev, pdata->irq,
936 + imx_snvs_pwrkey_interrupt,
937 + 0, pdev->name, pdev);
938 +@@ -171,9 +174,6 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
939 + return error;
940 + }
941 +
942 +- pdata->input = input;
943 +- platform_set_drvdata(pdev, pdata);
944 +-
945 + device_init_wakeup(&pdev->dev, pdata->wakeup);
946 +
947 + return 0;
948 +diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c
949 +index 025bae3853cc..c72662c979e7 100644
950 +--- a/drivers/input/touchscreen/stmfts.c
951 ++++ b/drivers/input/touchscreen/stmfts.c
952 +@@ -111,27 +111,29 @@ struct stmfts_data {
953 + bool running;
954 + };
955 +
956 +-static void stmfts_brightness_set(struct led_classdev *led_cdev,
957 ++static int stmfts_brightness_set(struct led_classdev *led_cdev,
958 + enum led_brightness value)
959 + {
960 + struct stmfts_data *sdata = container_of(led_cdev,
961 + struct stmfts_data, led_cdev);
962 + int err;
963 +
964 +- if (value == sdata->led_status || !sdata->ledvdd)
965 +- return;
966 +-
967 +- if (!value) {
968 +- regulator_disable(sdata->ledvdd);
969 +- } else {
970 +- err = regulator_enable(sdata->ledvdd);
971 +- if (err)
972 +- dev_warn(&sdata->client->dev,
973 +- "failed to disable ledvdd regulator: %d\n",
974 +- err);
975 ++ if (value != sdata->led_status && sdata->ledvdd) {
976 ++ if (!value) {
977 ++ regulator_disable(sdata->ledvdd);
978 ++ } else {
979 ++ err = regulator_enable(sdata->ledvdd);
980 ++ if (err) {
981 ++ dev_warn(&sdata->client->dev,
982 ++ "failed to disable ledvdd regulator: %d\n",
983 ++ err);
984 ++ return err;
985 ++ }
986 ++ }
987 ++ sdata->led_status = value;
988 + }
989 +
990 +- sdata->led_status = value;
991 ++ return 0;
992 + }
993 +
994 + static enum led_brightness stmfts_brightness_get(struct led_classdev *led_cdev)
995 +@@ -613,7 +615,7 @@ static int stmfts_enable_led(struct stmfts_data *sdata)
996 + sdata->led_cdev.name = STMFTS_DEV_NAME;
997 + sdata->led_cdev.max_brightness = LED_ON;
998 + sdata->led_cdev.brightness = LED_OFF;
999 +- sdata->led_cdev.brightness_set = stmfts_brightness_set;
1000 ++ sdata->led_cdev.brightness_set_blocking = stmfts_brightness_set;
1001 + sdata->led_cdev.brightness_get = stmfts_brightness_get;
1002 +
1003 + err = devm_led_classdev_register(&sdata->client->dev, &sdata->led_cdev);
1004 +diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
1005 +index 39ff73a6a807..6925749864a8 100644
1006 +--- a/drivers/media/i2c/ov7670.c
1007 ++++ b/drivers/media/i2c/ov7670.c
1008 +@@ -158,10 +158,10 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");
1009 + #define REG_GFIX 0x69 /* Fix gain control */
1010 +
1011 + #define REG_DBLV 0x6b /* PLL control an debugging */
1012 +-#define DBLV_BYPASS 0x00 /* Bypass PLL */
1013 +-#define DBLV_X4 0x01 /* clock x4 */
1014 +-#define DBLV_X6 0x10 /* clock x6 */
1015 +-#define DBLV_X8 0x11 /* clock x8 */
1016 ++#define DBLV_BYPASS 0x0a /* Bypass PLL */
1017 ++#define DBLV_X4 0x4a /* clock x4 */
1018 ++#define DBLV_X6 0x8a /* clock x6 */
1019 ++#define DBLV_X8 0xca /* clock x8 */
1020 +
1021 + #define REG_REG76 0x76 /* OV's name */
1022 + #define R76_BLKPCOR 0x80 /* Black pixel correction enable */
1023 +@@ -837,7 +837,7 @@ static int ov7675_set_framerate(struct v4l2_subdev *sd,
1024 + if (ret < 0)
1025 + return ret;
1026 +
1027 +- return ov7670_write(sd, REG_DBLV, DBLV_X4);
1028 ++ return 0;
1029 + }
1030 +
1031 + static void ov7670_get_framerate_legacy(struct v4l2_subdev *sd,
1032 +@@ -1601,11 +1601,7 @@ static int ov7670_probe(struct i2c_client *client,
1033 + if (config->clock_speed)
1034 + info->clock_speed = config->clock_speed;
1035 +
1036 +- /*
1037 +- * It should be allowed for ov7670 too when it is migrated to
1038 +- * the new frame rate formula.
1039 +- */
1040 +- if (config->pll_bypass && id->driver_data != MODEL_OV7670)
1041 ++ if (config->pll_bypass)
1042 + info->pll_bypass = true;
1043 +
1044 + if (config->pclk_hb_disable)
1045 +diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c
1046 +index 7d16c51e6913..641a532b67cb 100644
1047 +--- a/drivers/net/bonding/bond_sysfs_slave.c
1048 ++++ b/drivers/net/bonding/bond_sysfs_slave.c
1049 +@@ -55,7 +55,9 @@ static SLAVE_ATTR_RO(link_failure_count);
1050 +
1051 + static ssize_t perm_hwaddr_show(struct slave *slave, char *buf)
1052 + {
1053 +- return sprintf(buf, "%pM\n", slave->perm_hwaddr);
1054 ++ return sprintf(buf, "%*phC\n",
1055 ++ slave->dev->addr_len,
1056 ++ slave->perm_hwaddr);
1057 + }
1058 + static SLAVE_ATTR_RO(perm_hwaddr);
1059 +
1060 +diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c
1061 +index 8a1da7e67707..7f8d269dd75a 100644
1062 +--- a/drivers/net/dsa/bcm_sf2_cfp.c
1063 ++++ b/drivers/net/dsa/bcm_sf2_cfp.c
1064 +@@ -130,6 +130,9 @@ static int bcm_sf2_cfp_rule_set(struct dsa_switch *ds, int port,
1065 + (fs->m_ext.vlan_etype || fs->m_ext.data[1]))
1066 + return -EINVAL;
1067 +
1068 ++ if (fs->location != RX_CLS_LOC_ANY && fs->location >= CFP_NUM_RULES)
1069 ++ return -EINVAL;
1070 ++
1071 + if (fs->location != RX_CLS_LOC_ANY &&
1072 + test_bit(fs->location, priv->cfp.used))
1073 + return -EBUSY;
1074 +@@ -330,6 +333,9 @@ static int bcm_sf2_cfp_rule_del(struct bcm_sf2_priv *priv, int port,
1075 + int ret;
1076 + u32 reg;
1077 +
1078 ++ if (loc >= CFP_NUM_RULES)
1079 ++ return -EINVAL;
1080 ++
1081 + /* Refuse deletion of unused rules, and the default reserved rule */
1082 + if (!test_bit(loc, priv->cfp.used) || loc == 0)
1083 + return -EINVAL;
1084 +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
1085 +index 446577a1a6a5..687b01bf1ea9 100644
1086 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
1087 ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
1088 +@@ -6768,8 +6768,15 @@ static int bnxt_cfg_rx_mode(struct bnxt *bp)
1089 +
1090 + skip_uc:
1091 + rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);
1092 ++ if (rc && vnic->mc_list_count) {
1093 ++ netdev_info(bp->dev, "Failed setting MC filters rc: %d, turning on ALL_MCAST mode\n",
1094 ++ rc);
1095 ++ vnic->rx_mask |= CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST;
1096 ++ vnic->mc_list_count = 0;
1097 ++ rc = bnxt_hwrm_cfa_l2_set_rx_mask(bp, 0);
1098 ++ }
1099 + if (rc)
1100 +- netdev_err(bp->dev, "HWRM cfa l2 rx mask failure rc: %x\n",
1101 ++ netdev_err(bp->dev, "HWRM cfa l2 rx mask failure rc: %d\n",
1102 + rc);
1103 +
1104 + return rc;
1105 +@@ -8234,6 +8241,7 @@ init_err_cleanup_tc:
1106 + bnxt_clear_int_mode(bp);
1107 +
1108 + init_err_pci_clean:
1109 ++ bnxt_free_hwrm_short_cmd_req(bp);
1110 + bnxt_free_hwrm_resources(bp);
1111 + bnxt_cleanup_pci(bp);
1112 +
1113 +diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.c b/drivers/net/ethernet/hisilicon/hns/hnae.c
1114 +index 79d03f8ee7b1..c7fa97a7e1f4 100644
1115 +--- a/drivers/net/ethernet/hisilicon/hns/hnae.c
1116 ++++ b/drivers/net/ethernet/hisilicon/hns/hnae.c
1117 +@@ -150,7 +150,6 @@ out_buffer_fail:
1118 + /* free desc along with its attached buffer */
1119 + static void hnae_free_desc(struct hnae_ring *ring)
1120 + {
1121 +- hnae_free_buffers(ring);
1122 + dma_unmap_single(ring_to_dev(ring), ring->desc_dma_addr,
1123 + ring->desc_num * sizeof(ring->desc[0]),
1124 + ring_to_dma_dir(ring));
1125 +@@ -183,6 +182,9 @@ static int hnae_alloc_desc(struct hnae_ring *ring)
1126 + /* fini ring, also free the buffer for the ring */
1127 + static void hnae_fini_ring(struct hnae_ring *ring)
1128 + {
1129 ++ if (is_rx_ring(ring))
1130 ++ hnae_free_buffers(ring);
1131 ++
1132 + hnae_free_desc(ring);
1133 + kfree(ring->desc_cb);
1134 + ring->desc_cb = NULL;
1135 +diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
1136 +index 7e82dfbb4340..7d0f3cd8a002 100644
1137 +--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
1138 ++++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
1139 +@@ -2743,6 +2743,17 @@ int hns_dsaf_get_regs_count(void)
1140 + return DSAF_DUMP_REGS_NUM;
1141 + }
1142 +
1143 ++static int hns_dsaf_get_port_id(u8 port)
1144 ++{
1145 ++ if (port < DSAF_SERVICE_NW_NUM)
1146 ++ return port;
1147 ++
1148 ++ if (port >= DSAF_BASE_INNER_PORT_NUM)
1149 ++ return port - DSAF_BASE_INNER_PORT_NUM + DSAF_SERVICE_NW_NUM;
1150 ++
1151 ++ return -EINVAL;
1152 ++}
1153 ++
1154 + static void set_promisc_tcam_enable(struct dsaf_device *dsaf_dev, u32 port)
1155 + {
1156 + struct dsaf_tbl_tcam_ucast_cfg tbl_tcam_ucast = {0, 1, 0, 0, 0x80};
1157 +@@ -2808,23 +2819,33 @@ static void set_promisc_tcam_enable(struct dsaf_device *dsaf_dev, u32 port)
1158 + memset(&temp_key, 0x0, sizeof(temp_key));
1159 + mask_entry.addr[0] = 0x01;
1160 + hns_dsaf_set_mac_key(dsaf_dev, &mask_key, mask_entry.in_vlan_id,
1161 +- port, mask_entry.addr);
1162 ++ 0xf, mask_entry.addr);
1163 + tbl_tcam_mcast.tbl_mcast_item_vld = 1;
1164 + tbl_tcam_mcast.tbl_mcast_old_en = 0;
1165 +
1166 +- if (port < DSAF_SERVICE_NW_NUM) {
1167 +- mskid = port;
1168 +- } else if (port >= DSAF_BASE_INNER_PORT_NUM) {
1169 +- mskid = port - DSAF_BASE_INNER_PORT_NUM + DSAF_SERVICE_NW_NUM;
1170 +- } else {
1171 ++ /* set MAC port to handle multicast */
1172 ++ mskid = hns_dsaf_get_port_id(port);
1173 ++ if (mskid == -EINVAL) {
1174 + dev_err(dsaf_dev->dev, "%s,pnum(%d)error,key(%#x:%#x)\n",
1175 + dsaf_dev->ae_dev.name, port,
1176 + mask_key.high.val, mask_key.low.val);
1177 + return;
1178 + }
1179 ++ dsaf_set_bit(tbl_tcam_mcast.tbl_mcast_port_msk[mskid / 32],
1180 ++ mskid % 32, 1);
1181 +
1182 ++ /* set pool bit map to handle multicast */
1183 ++ mskid = hns_dsaf_get_port_id(port_num);
1184 ++ if (mskid == -EINVAL) {
1185 ++ dev_err(dsaf_dev->dev,
1186 ++ "%s, pool bit map pnum(%d)error,key(%#x:%#x)\n",
1187 ++ dsaf_dev->ae_dev.name, port_num,
1188 ++ mask_key.high.val, mask_key.low.val);
1189 ++ return;
1190 ++ }
1191 + dsaf_set_bit(tbl_tcam_mcast.tbl_mcast_port_msk[mskid / 32],
1192 + mskid % 32, 1);
1193 ++
1194 + memcpy(&temp_key, &mask_key, sizeof(mask_key));
1195 + hns_dsaf_tcam_mc_cfg_vague(dsaf_dev, entry_index, &tbl_tcam_data_mc,
1196 + (struct dsaf_tbl_tcam_data *)(&mask_key),
1197 +diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c
1198 +index 51e7e9f5af49..70de7b5d28af 100644
1199 +--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c
1200 ++++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_xgmac.c
1201 +@@ -129,7 +129,7 @@ static void hns_xgmac_lf_rf_control_init(struct mac_driver *mac_drv)
1202 + dsaf_set_bit(val, XGMAC_UNIDIR_EN_B, 0);
1203 + dsaf_set_bit(val, XGMAC_RF_TX_EN_B, 1);
1204 + dsaf_set_field(val, XGMAC_LF_RF_INSERT_M, XGMAC_LF_RF_INSERT_S, 0);
1205 +- dsaf_write_reg(mac_drv, XGMAC_MAC_TX_LF_RF_CONTROL_REG, val);
1206 ++ dsaf_write_dev(mac_drv, XGMAC_MAC_TX_LF_RF_CONTROL_REG, val);
1207 + }
1208 +
1209 + /**
1210 +diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
1211 +index d30c28fba249..8fd040817804 100644
1212 +--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
1213 ++++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
1214 +@@ -29,9 +29,6 @@
1215 +
1216 + #define SERVICE_TIMER_HZ (1 * HZ)
1217 +
1218 +-#define NIC_TX_CLEAN_MAX_NUM 256
1219 +-#define NIC_RX_CLEAN_MAX_NUM 64
1220 +-
1221 + #define RCB_IRQ_NOT_INITED 0
1222 + #define RCB_IRQ_INITED 1
1223 + #define HNS_BUFFER_SIZE_2048 2048
1224 +@@ -376,8 +373,6 @@ netdev_tx_t hns_nic_net_xmit_hw(struct net_device *ndev,
1225 + wmb(); /* commit all data before submit */
1226 + assert(skb->queue_mapping < priv->ae_handle->q_num);
1227 + hnae_queue_xmit(priv->ae_handle->qs[skb->queue_mapping], buf_num);
1228 +- ring->stats.tx_pkts++;
1229 +- ring->stats.tx_bytes += skb->len;
1230 +
1231 + return NETDEV_TX_OK;
1232 +
1233 +@@ -1099,6 +1094,9 @@ static int hns_nic_tx_poll_one(struct hns_nic_ring_data *ring_data,
1234 + /* issue prefetch for next Tx descriptor */
1235 + prefetch(&ring->desc_cb[ring->next_to_clean]);
1236 + }
1237 ++ /* update tx ring statistics. */
1238 ++ ring->stats.tx_pkts += pkts;
1239 ++ ring->stats.tx_bytes += bytes;
1240 +
1241 + NETIF_TX_UNLOCK(ring);
1242 +
1243 +@@ -2269,7 +2267,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
1244 + hns_nic_tx_fini_pro_v2;
1245 +
1246 + netif_napi_add(priv->netdev, &rd->napi,
1247 +- hns_nic_common_poll, NIC_TX_CLEAN_MAX_NUM);
1248 ++ hns_nic_common_poll, NAPI_POLL_WEIGHT);
1249 + rd->ring->irq_init_flag = RCB_IRQ_NOT_INITED;
1250 + }
1251 + for (i = h->q_num; i < h->q_num * 2; i++) {
1252 +@@ -2282,7 +2280,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
1253 + hns_nic_rx_fini_pro_v2;
1254 +
1255 + netif_napi_add(priv->netdev, &rd->napi,
1256 +- hns_nic_common_poll, NIC_RX_CLEAN_MAX_NUM);
1257 ++ hns_nic_common_poll, NAPI_POLL_WEIGHT);
1258 + rd->ring->irq_init_flag = RCB_IRQ_NOT_INITED;
1259 + }
1260 +
1261 +diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h
1262 +index 1de82f247312..d258a75c934b 100644
1263 +--- a/drivers/net/ethernet/intel/igb/e1000_defines.h
1264 ++++ b/drivers/net/ethernet/intel/igb/e1000_defines.h
1265 +@@ -214,6 +214,8 @@
1266 + /* enable link status from external LINK_0 and LINK_1 pins */
1267 + #define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */
1268 + #define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */
1269 ++#define E1000_CTRL_ADVD3WUC 0x00100000 /* D3 WUC */
1270 ++#define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000 /* PHY PM enable */
1271 + #define E1000_CTRL_SDP0_DIR 0x00400000 /* SDP0 Data direction */
1272 + #define E1000_CTRL_SDP1_DIR 0x00800000 /* SDP1 Data direction */
1273 + #define E1000_CTRL_RST 0x04000000 /* Global reset */
1274 +diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
1275 +index 8892ea5cbb01..71b235f935d9 100644
1276 +--- a/drivers/net/ethernet/intel/igb/igb_main.c
1277 ++++ b/drivers/net/ethernet/intel/igb/igb_main.c
1278 +@@ -7934,9 +7934,7 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,
1279 + struct e1000_hw *hw = &adapter->hw;
1280 + u32 ctrl, rctl, status;
1281 + u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol;
1282 +-#ifdef CONFIG_PM
1283 +- int retval = 0;
1284 +-#endif
1285 ++ bool wake;
1286 +
1287 + rtnl_lock();
1288 + netif_device_detach(netdev);
1289 +@@ -7949,14 +7947,6 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,
1290 + igb_clear_interrupt_scheme(adapter);
1291 + rtnl_unlock();
1292 +
1293 +-#ifdef CONFIG_PM
1294 +- if (!runtime) {
1295 +- retval = pci_save_state(pdev);
1296 +- if (retval)
1297 +- return retval;
1298 +- }
1299 +-#endif
1300 +-
1301 + status = rd32(E1000_STATUS);
1302 + if (status & E1000_STATUS_LU)
1303 + wufc &= ~E1000_WUFC_LNKC;
1304 +@@ -7973,10 +7963,6 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,
1305 + }
1306 +
1307 + ctrl = rd32(E1000_CTRL);
1308 +- /* advertise wake from D3Cold */
1309 +- #define E1000_CTRL_ADVD3WUC 0x00100000
1310 +- /* phy power management enable */
1311 +- #define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000
1312 + ctrl |= E1000_CTRL_ADVD3WUC;
1313 + wr32(E1000_CTRL, ctrl);
1314 +
1315 +@@ -7990,12 +7976,15 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,
1316 + wr32(E1000_WUFC, 0);
1317 + }
1318 +
1319 +- *enable_wake = wufc || adapter->en_mng_pt;
1320 +- if (!*enable_wake)
1321 ++ wake = wufc || adapter->en_mng_pt;
1322 ++ if (!wake)
1323 + igb_power_down_link(adapter);
1324 + else
1325 + igb_power_up_link(adapter);
1326 +
1327 ++ if (enable_wake)
1328 ++ *enable_wake = wake;
1329 ++
1330 + /* Release control of h/w to f/w. If f/w is AMT enabled, this
1331 + * would have already happened in close and is redundant.
1332 + */
1333 +@@ -8038,22 +8027,7 @@ static void igb_deliver_wake_packet(struct net_device *netdev)
1334 +
1335 + static int __maybe_unused igb_suspend(struct device *dev)
1336 + {
1337 +- int retval;
1338 +- bool wake;
1339 +- struct pci_dev *pdev = to_pci_dev(dev);
1340 +-
1341 +- retval = __igb_shutdown(pdev, &wake, 0);
1342 +- if (retval)
1343 +- return retval;
1344 +-
1345 +- if (wake) {
1346 +- pci_prepare_to_sleep(pdev);
1347 +- } else {
1348 +- pci_wake_from_d3(pdev, false);
1349 +- pci_set_power_state(pdev, PCI_D3hot);
1350 +- }
1351 +-
1352 +- return 0;
1353 ++ return __igb_shutdown(to_pci_dev(dev), NULL, 0);
1354 + }
1355 +
1356 + static int __maybe_unused igb_resume(struct device *dev)
1357 +@@ -8124,22 +8098,7 @@ static int __maybe_unused igb_runtime_idle(struct device *dev)
1358 +
1359 + static int __maybe_unused igb_runtime_suspend(struct device *dev)
1360 + {
1361 +- struct pci_dev *pdev = to_pci_dev(dev);
1362 +- int retval;
1363 +- bool wake;
1364 +-
1365 +- retval = __igb_shutdown(pdev, &wake, 1);
1366 +- if (retval)
1367 +- return retval;
1368 +-
1369 +- if (wake) {
1370 +- pci_prepare_to_sleep(pdev);
1371 +- } else {
1372 +- pci_wake_from_d3(pdev, false);
1373 +- pci_set_power_state(pdev, PCI_D3hot);
1374 +- }
1375 +-
1376 +- return 0;
1377 ++ return __igb_shutdown(to_pci_dev(dev), NULL, 1);
1378 + }
1379 +
1380 + static int __maybe_unused igb_runtime_resume(struct device *dev)
1381 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
1382 +index d2914116af8e..090d54275a7d 100644
1383 +--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
1384 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
1385 +@@ -79,8 +79,7 @@ static int arm_vport_context_events_cmd(struct mlx5_core_dev *dev, u16 vport,
1386 + opcode, MLX5_CMD_OP_MODIFY_NIC_VPORT_CONTEXT);
1387 + MLX5_SET(modify_nic_vport_context_in, in, field_select.change_event, 1);
1388 + MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport);
1389 +- if (vport)
1390 +- MLX5_SET(modify_nic_vport_context_in, in, other_vport, 1);
1391 ++ MLX5_SET(modify_nic_vport_context_in, in, other_vport, 1);
1392 + nic_vport_ctx = MLX5_ADDR_OF(modify_nic_vport_context_in,
1393 + in, nic_vport_context);
1394 +
1395 +@@ -108,8 +107,7 @@ static int modify_esw_vport_context_cmd(struct mlx5_core_dev *dev, u16 vport,
1396 + MLX5_SET(modify_esw_vport_context_in, in, opcode,
1397 + MLX5_CMD_OP_MODIFY_ESW_VPORT_CONTEXT);
1398 + MLX5_SET(modify_esw_vport_context_in, in, vport_number, vport);
1399 +- if (vport)
1400 +- MLX5_SET(modify_esw_vport_context_in, in, other_vport, 1);
1401 ++ MLX5_SET(modify_esw_vport_context_in, in, other_vport, 1);
1402 + return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
1403 + }
1404 +
1405 +diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
1406 +index acd65a4f94d4..f2150efddc88 100644
1407 +--- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
1408 ++++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
1409 +@@ -201,6 +201,11 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,
1410 + if (unlikely(rdes0 & RDES0_OWN))
1411 + return dma_own;
1412 +
1413 ++ if (unlikely(!(rdes0 & RDES0_LAST_DESCRIPTOR))) {
1414 ++ stats->rx_length_errors++;
1415 ++ return discard_frame;
1416 ++ }
1417 ++
1418 + if (unlikely(rdes0 & RDES0_ERROR_SUMMARY)) {
1419 + if (unlikely(rdes0 & RDES0_DESCRIPTOR_ERROR)) {
1420 + x->rx_desc++;
1421 +@@ -231,9 +236,10 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,
1422 + * It doesn't match with the information reported into the databook.
1423 + * At any rate, we need to understand if the CSUM hw computation is ok
1424 + * and report this info to the upper layers. */
1425 +- ret = enh_desc_coe_rdes0(!!(rdes0 & RDES0_IPC_CSUM_ERROR),
1426 +- !!(rdes0 & RDES0_FRAME_TYPE),
1427 +- !!(rdes0 & ERDES0_RX_MAC_ADDR));
1428 ++ if (likely(ret == good_frame))
1429 ++ ret = enh_desc_coe_rdes0(!!(rdes0 & RDES0_IPC_CSUM_ERROR),
1430 ++ !!(rdes0 & RDES0_FRAME_TYPE),
1431 ++ !!(rdes0 & ERDES0_RX_MAC_ADDR));
1432 +
1433 + if (unlikely(rdes0 & RDES0_DRIBBLING))
1434 + x->dribbling_bit++;
1435 +diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
1436 +index db4cee57bb24..66c17bab5997 100644
1437 +--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
1438 ++++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
1439 +@@ -91,8 +91,6 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x,
1440 + return dma_own;
1441 +
1442 + if (unlikely(!(rdes0 & RDES0_LAST_DESCRIPTOR))) {
1443 +- pr_warn("%s: Oversized frame spanned multiple buffers\n",
1444 +- __func__);
1445 + stats->rx_length_errors++;
1446 + return discard_frame;
1447 + }
1448 +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
1449 +index ecf3f8c1bc0e..0f85e540001f 100644
1450 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
1451 ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
1452 +@@ -3413,9 +3413,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
1453 + * ignored
1454 + */
1455 + if (frame_len > priv->dma_buf_sz) {
1456 +- netdev_err(priv->dev,
1457 +- "len %d larger than size (%d)\n",
1458 +- frame_len, priv->dma_buf_sz);
1459 ++ if (net_ratelimit())
1460 ++ netdev_err(priv->dev,
1461 ++ "len %d larger than size (%d)\n",
1462 ++ frame_len, priv->dma_buf_sz);
1463 + priv->dev->stats.rx_length_errors++;
1464 + break;
1465 + }
1466 +@@ -3473,9 +3474,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
1467 + } else {
1468 + skb = rx_q->rx_skbuff[entry];
1469 + if (unlikely(!skb)) {
1470 +- netdev_err(priv->dev,
1471 +- "%s: Inconsistent Rx chain\n",
1472 +- priv->dev->name);
1473 ++ if (net_ratelimit())
1474 ++ netdev_err(priv->dev,
1475 ++ "%s: Inconsistent Rx chain\n",
1476 ++ priv->dev->name);
1477 + priv->dev->stats.rx_dropped++;
1478 + break;
1479 + }
1480 +diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
1481 +index e9e67c22c8bb..727b991312a4 100644
1482 +--- a/drivers/net/phy/marvell.c
1483 ++++ b/drivers/net/phy/marvell.c
1484 +@@ -1497,9 +1497,10 @@ static int marvell_get_sset_count(struct phy_device *phydev)
1485 +
1486 + static void marvell_get_strings(struct phy_device *phydev, u8 *data)
1487 + {
1488 ++ int count = marvell_get_sset_count(phydev);
1489 + int i;
1490 +
1491 +- for (i = 0; i < ARRAY_SIZE(marvell_hw_stats); i++) {
1492 ++ for (i = 0; i < count; i++) {
1493 + memcpy(data + i * ETH_GSTRING_LEN,
1494 + marvell_hw_stats[i].string, ETH_GSTRING_LEN);
1495 + }
1496 +@@ -1536,9 +1537,10 @@ static u64 marvell_get_stat(struct phy_device *phydev, int i)
1497 + static void marvell_get_stats(struct phy_device *phydev,
1498 + struct ethtool_stats *stats, u64 *data)
1499 + {
1500 ++ int count = marvell_get_sset_count(phydev);
1501 + int i;
1502 +
1503 +- for (i = 0; i < ARRAY_SIZE(marvell_hw_stats); i++)
1504 ++ for (i = 0; i < count; i++)
1505 + data[i] = marvell_get_stat(phydev, i);
1506 + }
1507 +
1508 +diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
1509 +index 5fa7856f6b34..09a39f4aaf82 100644
1510 +--- a/drivers/nvme/target/core.c
1511 ++++ b/drivers/nvme/target/core.c
1512 +@@ -746,6 +746,15 @@ bool nvmet_host_allowed(struct nvmet_req *req, struct nvmet_subsys *subsys,
1513 + return __nvmet_host_allowed(subsys, hostnqn);
1514 + }
1515 +
1516 ++static void nvmet_fatal_error_handler(struct work_struct *work)
1517 ++{
1518 ++ struct nvmet_ctrl *ctrl =
1519 ++ container_of(work, struct nvmet_ctrl, fatal_err_work);
1520 ++
1521 ++ pr_err("ctrl %d fatal error occurred!\n", ctrl->cntlid);
1522 ++ ctrl->ops->delete_ctrl(ctrl);
1523 ++}
1524 ++
1525 + u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn,
1526 + struct nvmet_req *req, u32 kato, struct nvmet_ctrl **ctrlp)
1527 + {
1528 +@@ -785,6 +794,7 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn,
1529 +
1530 + INIT_WORK(&ctrl->async_event_work, nvmet_async_event_work);
1531 + INIT_LIST_HEAD(&ctrl->async_events);
1532 ++ INIT_WORK(&ctrl->fatal_err_work, nvmet_fatal_error_handler);
1533 +
1534 + memcpy(ctrl->subsysnqn, subsysnqn, NVMF_NQN_SIZE);
1535 + memcpy(ctrl->hostnqn, hostnqn, NVMF_NQN_SIZE);
1536 +@@ -887,21 +897,11 @@ void nvmet_ctrl_put(struct nvmet_ctrl *ctrl)
1537 + kref_put(&ctrl->ref, nvmet_ctrl_free);
1538 + }
1539 +
1540 +-static void nvmet_fatal_error_handler(struct work_struct *work)
1541 +-{
1542 +- struct nvmet_ctrl *ctrl =
1543 +- container_of(work, struct nvmet_ctrl, fatal_err_work);
1544 +-
1545 +- pr_err("ctrl %d fatal error occurred!\n", ctrl->cntlid);
1546 +- ctrl->ops->delete_ctrl(ctrl);
1547 +-}
1548 +-
1549 + void nvmet_ctrl_fatal_error(struct nvmet_ctrl *ctrl)
1550 + {
1551 + mutex_lock(&ctrl->lock);
1552 + if (!(ctrl->csts & NVME_CSTS_CFS)) {
1553 + ctrl->csts |= NVME_CSTS_CFS;
1554 +- INIT_WORK(&ctrl->fatal_err_work, nvmet_fatal_error_handler);
1555 + schedule_work(&ctrl->fatal_err_work);
1556 + }
1557 + mutex_unlock(&ctrl->lock);
1558 +diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c
1559 +index 77bac859342d..75f69cf0d45f 100644
1560 +--- a/drivers/platform/x86/pmc_atom.c
1561 ++++ b/drivers/platform/x86/pmc_atom.c
1562 +@@ -17,6 +17,7 @@
1563 +
1564 + #include <linux/debugfs.h>
1565 + #include <linux/device.h>
1566 ++#include <linux/dmi.h>
1567 + #include <linux/init.h>
1568 + #include <linux/io.h>
1569 + #include <linux/platform_data/x86/clk-pmc-atom.h>
1570 +@@ -421,11 +422,27 @@ static int pmc_dbgfs_register(struct pmc_dev *pmc)
1571 + }
1572 + #endif /* CONFIG_DEBUG_FS */
1573 +
1574 ++/*
1575 ++ * Some systems need one or more of their pmc_plt_clks to be
1576 ++ * marked as critical.
1577 ++ */
1578 ++static const struct dmi_system_id critclk_systems[] __initconst = {
1579 ++ {
1580 ++ .ident = "MPL CEC1x",
1581 ++ .matches = {
1582 ++ DMI_MATCH(DMI_SYS_VENDOR, "MPL AG"),
1583 ++ DMI_MATCH(DMI_PRODUCT_NAME, "CEC10 Family"),
1584 ++ },
1585 ++ },
1586 ++ { /*sentinel*/ }
1587 ++};
1588 ++
1589 + static int pmc_setup_clks(struct pci_dev *pdev, void __iomem *pmc_regmap,
1590 + const struct pmc_data *pmc_data)
1591 + {
1592 + struct platform_device *clkdev;
1593 + struct pmc_clk_data *clk_data;
1594 ++ const struct dmi_system_id *d = dmi_first_match(critclk_systems);
1595 +
1596 + clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL);
1597 + if (!clk_data)
1598 +@@ -433,6 +450,10 @@ static int pmc_setup_clks(struct pci_dev *pdev, void __iomem *pmc_regmap,
1599 +
1600 + clk_data->base = pmc_regmap; /* offset is added by client */
1601 + clk_data->clks = pmc_data->clks;
1602 ++ if (d) {
1603 ++ clk_data->critical = true;
1604 ++ pr_info("%s critclks quirk enabled\n", d->ident);
1605 ++ }
1606 +
1607 + clkdev = platform_device_register_data(&pdev->dev, "clk-pmc-atom",
1608 + PLATFORM_DEVID_NONE,
1609 +diff --git a/drivers/rtc/rtc-da9063.c b/drivers/rtc/rtc-da9063.c
1610 +index f85cae240f12..7e92e491c2e7 100644
1611 +--- a/drivers/rtc/rtc-da9063.c
1612 ++++ b/drivers/rtc/rtc-da9063.c
1613 +@@ -480,6 +480,13 @@ static int da9063_rtc_probe(struct platform_device *pdev)
1614 + da9063_data_to_tm(data, &rtc->alarm_time, rtc);
1615 + rtc->rtc_sync = false;
1616 +
1617 ++ /*
1618 ++ * TODO: some models have alarms on a minute boundary but still support
1619 ++ * real hardware interrupts. Add this once the core supports it.
1620 ++ */
1621 ++ if (config->rtc_data_start != RTC_SEC)
1622 ++ rtc->rtc_dev->uie_unsupported = 1;
1623 ++
1624 + irq_alarm = platform_get_irq_byname(pdev, "ALARM");
1625 + ret = devm_request_threaded_irq(&pdev->dev, irq_alarm, NULL,
1626 + da9063_alarm_event,
1627 +diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
1628 +index 6c2d3989f967..9b6a927149a4 100644
1629 +--- a/drivers/rtc/rtc-sh.c
1630 ++++ b/drivers/rtc/rtc-sh.c
1631 +@@ -462,7 +462,7 @@ static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm)
1632 + static inline int sh_rtc_read_alarm_value(struct sh_rtc *rtc, int reg_off)
1633 + {
1634 + unsigned int byte;
1635 +- int value = 0xff; /* return 0xff for ignored values */
1636 ++ int value = -1; /* return -1 for ignored values */
1637 +
1638 + byte = readb(rtc->regbase + reg_off);
1639 + if (byte & AR_ENB) {
1640 +diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
1641 +index 6b594bc7d94a..022fcd2e4702 100644
1642 +--- a/drivers/scsi/scsi_devinfo.c
1643 ++++ b/drivers/scsi/scsi_devinfo.c
1644 +@@ -248,6 +248,7 @@ static struct {
1645 + {"NETAPP", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
1646 + {"LSI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
1647 + {"ENGENIO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
1648 ++ {"LENOVO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH},
1649 + {"SMSC", "USB 2 HS-CF", NULL, BLIST_SPARSELUN | BLIST_INQUIRY_36},
1650 + {"SONY", "CD-ROM CDU-8001", NULL, BLIST_BORKEN},
1651 + {"SONY", "TSL", NULL, BLIST_FORCELUN}, /* DDS3 & DDS4 autoloaders */
1652 +diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c
1653 +index 375cede0c534..c9bc6f058424 100644
1654 +--- a/drivers/scsi/scsi_dh.c
1655 ++++ b/drivers/scsi/scsi_dh.c
1656 +@@ -75,6 +75,7 @@ static const struct scsi_dh_blist scsi_dh_blist[] = {
1657 + {"NETAPP", "INF-01-00", "rdac", },
1658 + {"LSI", "INF-01-00", "rdac", },
1659 + {"ENGENIO", "INF-01-00", "rdac", },
1660 ++ {"LENOVO", "DE_Series", "rdac", },
1661 + {NULL, NULL, NULL },
1662 + };
1663 +
1664 +diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
1665 +index beb585ddc07d..5adeb1e4b186 100644
1666 +--- a/drivers/scsi/storvsc_drv.c
1667 ++++ b/drivers/scsi/storvsc_drv.c
1668 +@@ -658,13 +658,22 @@ static void handle_sc_creation(struct vmbus_channel *new_sc)
1669 + static void handle_multichannel_storage(struct hv_device *device, int max_chns)
1670 + {
1671 + struct storvsc_device *stor_device;
1672 +- int num_cpus = num_online_cpus();
1673 + int num_sc;
1674 + struct storvsc_cmd_request *request;
1675 + struct vstor_packet *vstor_packet;
1676 + int ret, t;
1677 +
1678 +- num_sc = ((max_chns > num_cpus) ? num_cpus : max_chns);
1679 ++ /*
1680 ++ * If the number of CPUs is artificially restricted, such as
1681 ++ * with maxcpus=1 on the kernel boot line, Hyper-V could offer
1682 ++ * sub-channels >= the number of CPUs. These sub-channels
1683 ++ * should not be created. The primary channel is already created
1684 ++ * and assigned to one CPU, so check against # CPUs - 1.
1685 ++ */
1686 ++ num_sc = min((int)(num_online_cpus() - 1), max_chns);
1687 ++ if (!num_sc)
1688 ++ return;
1689 ++
1690 + stor_device = get_out_stor_device(device);
1691 + if (!stor_device)
1692 + return;
1693 +diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c
1694 +index b2bce26499f5..7378aa7730ef 100644
1695 +--- a/drivers/staging/iio/addac/adt7316.c
1696 ++++ b/drivers/staging/iio/addac/adt7316.c
1697 +@@ -47,6 +47,8 @@
1698 + #define ADT7516_MSB_AIN3 0xA
1699 + #define ADT7516_MSB_AIN4 0xB
1700 + #define ADT7316_DA_DATA_BASE 0x10
1701 ++#define ADT7316_DA_10_BIT_LSB_SHIFT 6
1702 ++#define ADT7316_DA_12_BIT_LSB_SHIFT 4
1703 + #define ADT7316_DA_MSB_DATA_REGS 4
1704 + #define ADT7316_LSB_DAC_A 0x10
1705 + #define ADT7316_MSB_DAC_A 0x11
1706 +@@ -1086,7 +1088,7 @@ static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev,
1707 + ldac_config = chip->ldac_config & (~ADT7516_DAC_IN_VREF_MASK);
1708 + if (data & 0x1)
1709 + ldac_config |= ADT7516_DAC_AB_IN_VREF;
1710 +- else if (data & 0x2)
1711 ++ if (data & 0x2)
1712 + ldac_config |= ADT7516_DAC_CD_IN_VREF;
1713 + } else {
1714 + ret = kstrtou8(buf, 16, &data);
1715 +@@ -1408,7 +1410,7 @@ static IIO_DEVICE_ATTR(ex_analog_temp_offset, 0644,
1716 + static ssize_t adt7316_show_DAC(struct adt7316_chip_info *chip,
1717 + int channel, char *buf)
1718 + {
1719 +- u16 data;
1720 ++ u16 data = 0;
1721 + u8 msb, lsb, offset;
1722 + int ret;
1723 +
1724 +@@ -1433,7 +1435,11 @@ static ssize_t adt7316_show_DAC(struct adt7316_chip_info *chip,
1725 + if (ret)
1726 + return -EIO;
1727 +
1728 +- data = (msb << offset) + (lsb & ((1 << offset) - 1));
1729 ++ if (chip->dac_bits == 12)
1730 ++ data = lsb >> ADT7316_DA_12_BIT_LSB_SHIFT;
1731 ++ else if (chip->dac_bits == 10)
1732 ++ data = lsb >> ADT7316_DA_10_BIT_LSB_SHIFT;
1733 ++ data |= msb << offset;
1734 +
1735 + return sprintf(buf, "%d\n", data);
1736 + }
1737 +@@ -1441,7 +1447,7 @@ static ssize_t adt7316_show_DAC(struct adt7316_chip_info *chip,
1738 + static ssize_t adt7316_store_DAC(struct adt7316_chip_info *chip,
1739 + int channel, const char *buf, size_t len)
1740 + {
1741 +- u8 msb, lsb, offset;
1742 ++ u8 msb, lsb, lsb_reg, offset;
1743 + u16 data;
1744 + int ret;
1745 +
1746 +@@ -1459,9 +1465,13 @@ static ssize_t adt7316_store_DAC(struct adt7316_chip_info *chip,
1747 + return -EINVAL;
1748 +
1749 + if (chip->dac_bits > 8) {
1750 +- lsb = data & (1 << offset);
1751 ++ lsb = data & ((1 << offset) - 1);
1752 ++ if (chip->dac_bits == 12)
1753 ++ lsb_reg = lsb << ADT7316_DA_12_BIT_LSB_SHIFT;
1754 ++ else
1755 ++ lsb_reg = lsb << ADT7316_DA_10_BIT_LSB_SHIFT;
1756 + ret = chip->bus.write(chip->bus.client,
1757 +- ADT7316_DA_DATA_BASE + channel * 2, lsb);
1758 ++ ADT7316_DA_DATA_BASE + channel * 2, lsb_reg);
1759 + if (ret)
1760 + return -EIO;
1761 + }
1762 +diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
1763 +index 79d2c0bf7870..687558e27c36 100644
1764 +--- a/drivers/usb/core/driver.c
1765 ++++ b/drivers/usb/core/driver.c
1766 +@@ -473,11 +473,6 @@ static int usb_unbind_interface(struct device *dev)
1767 + pm_runtime_disable(dev);
1768 + pm_runtime_set_suspended(dev);
1769 +
1770 +- /* Undo any residual pm_autopm_get_interface_* calls */
1771 +- for (r = atomic_read(&intf->pm_usage_cnt); r > 0; --r)
1772 +- usb_autopm_put_interface_no_suspend(intf);
1773 +- atomic_set(&intf->pm_usage_cnt, 0);
1774 +-
1775 + if (!error)
1776 + usb_autosuspend_device(udev);
1777 +
1778 +@@ -1628,7 +1623,6 @@ void usb_autopm_put_interface(struct usb_interface *intf)
1779 + int status;
1780 +
1781 + usb_mark_last_busy(udev);
1782 +- atomic_dec(&intf->pm_usage_cnt);
1783 + status = pm_runtime_put_sync(&intf->dev);
1784 + dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
1785 + __func__, atomic_read(&intf->dev.power.usage_count),
1786 +@@ -1657,7 +1651,6 @@ void usb_autopm_put_interface_async(struct usb_interface *intf)
1787 + int status;
1788 +
1789 + usb_mark_last_busy(udev);
1790 +- atomic_dec(&intf->pm_usage_cnt);
1791 + status = pm_runtime_put(&intf->dev);
1792 + dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
1793 + __func__, atomic_read(&intf->dev.power.usage_count),
1794 +@@ -1679,7 +1672,6 @@ void usb_autopm_put_interface_no_suspend(struct usb_interface *intf)
1795 + struct usb_device *udev = interface_to_usbdev(intf);
1796 +
1797 + usb_mark_last_busy(udev);
1798 +- atomic_dec(&intf->pm_usage_cnt);
1799 + pm_runtime_put_noidle(&intf->dev);
1800 + }
1801 + EXPORT_SYMBOL_GPL(usb_autopm_put_interface_no_suspend);
1802 +@@ -1710,8 +1702,6 @@ int usb_autopm_get_interface(struct usb_interface *intf)
1803 + status = pm_runtime_get_sync(&intf->dev);
1804 + if (status < 0)
1805 + pm_runtime_put_sync(&intf->dev);
1806 +- else
1807 +- atomic_inc(&intf->pm_usage_cnt);
1808 + dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
1809 + __func__, atomic_read(&intf->dev.power.usage_count),
1810 + status);
1811 +@@ -1745,8 +1735,6 @@ int usb_autopm_get_interface_async(struct usb_interface *intf)
1812 + status = pm_runtime_get(&intf->dev);
1813 + if (status < 0 && status != -EINPROGRESS)
1814 + pm_runtime_put_noidle(&intf->dev);
1815 +- else
1816 +- atomic_inc(&intf->pm_usage_cnt);
1817 + dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
1818 + __func__, atomic_read(&intf->dev.power.usage_count),
1819 + status);
1820 +@@ -1770,7 +1758,6 @@ void usb_autopm_get_interface_no_resume(struct usb_interface *intf)
1821 + struct usb_device *udev = interface_to_usbdev(intf);
1822 +
1823 + usb_mark_last_busy(udev);
1824 +- atomic_inc(&intf->pm_usage_cnt);
1825 + pm_runtime_get_noresume(&intf->dev);
1826 + }
1827 + EXPORT_SYMBOL_GPL(usb_autopm_get_interface_no_resume);
1828 +diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
1829 +index 1fe3c5d3be5f..c3f3f6370f64 100644
1830 +--- a/drivers/usb/core/message.c
1831 ++++ b/drivers/usb/core/message.c
1832 +@@ -818,9 +818,11 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
1833 +
1834 + if (dev->state == USB_STATE_SUSPENDED)
1835 + return -EHOSTUNREACH;
1836 +- if (size <= 0 || !buf || !index)
1837 ++ if (size <= 0 || !buf)
1838 + return -EINVAL;
1839 + buf[0] = 0;
1840 ++ if (index <= 0 || index >= 256)
1841 ++ return -EINVAL;
1842 + tbuf = kmalloc(256, GFP_NOIO);
1843 + if (!tbuf)
1844 + return -ENOMEM;
1845 +diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
1846 +index 4f48f5730e12..8ee98bc6c468 100644
1847 +--- a/drivers/usb/misc/yurex.c
1848 ++++ b/drivers/usb/misc/yurex.c
1849 +@@ -318,6 +318,7 @@ static void yurex_disconnect(struct usb_interface *interface)
1850 + usb_deregister_dev(interface, &yurex_class);
1851 +
1852 + /* prevent more I/O from starting */
1853 ++ usb_poison_urb(dev->urb);
1854 + mutex_lock(&dev->io_mutex);
1855 + dev->interface = NULL;
1856 + mutex_unlock(&dev->io_mutex);
1857 +diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
1858 +index ec83b3b5efa9..1a6df40f8b53 100644
1859 +--- a/drivers/usb/storage/realtek_cr.c
1860 ++++ b/drivers/usb/storage/realtek_cr.c
1861 +@@ -775,18 +775,16 @@ static void rts51x_suspend_timer_fn(unsigned long data)
1862 + break;
1863 + case RTS51X_STAT_IDLE:
1864 + case RTS51X_STAT_SS:
1865 +- usb_stor_dbg(us, "RTS51X_STAT_SS, intf->pm_usage_cnt:%d, power.usage:%d\n",
1866 +- atomic_read(&us->pusb_intf->pm_usage_cnt),
1867 ++ usb_stor_dbg(us, "RTS51X_STAT_SS, power.usage:%d\n",
1868 + atomic_read(&us->pusb_intf->dev.power.usage_count));
1869 +
1870 +- if (atomic_read(&us->pusb_intf->pm_usage_cnt) > 0) {
1871 ++ if (atomic_read(&us->pusb_intf->dev.power.usage_count) > 0) {
1872 + usb_stor_dbg(us, "Ready to enter SS state\n");
1873 + rts51x_set_stat(chip, RTS51X_STAT_SS);
1874 + /* ignore mass storage interface's children */
1875 + pm_suspend_ignore_children(&us->pusb_intf->dev, true);
1876 + usb_autopm_put_interface_async(us->pusb_intf);
1877 +- usb_stor_dbg(us, "RTS51X_STAT_SS 01, intf->pm_usage_cnt:%d, power.usage:%d\n",
1878 +- atomic_read(&us->pusb_intf->pm_usage_cnt),
1879 ++ usb_stor_dbg(us, "RTS51X_STAT_SS 01, power.usage:%d\n",
1880 + atomic_read(&us->pusb_intf->dev.power.usage_count));
1881 + }
1882 + break;
1883 +@@ -819,11 +817,10 @@ static void rts51x_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
1884 + int ret;
1885 +
1886 + if (working_scsi(srb)) {
1887 +- usb_stor_dbg(us, "working scsi, intf->pm_usage_cnt:%d, power.usage:%d\n",
1888 +- atomic_read(&us->pusb_intf->pm_usage_cnt),
1889 ++ usb_stor_dbg(us, "working scsi, power.usage:%d\n",
1890 + atomic_read(&us->pusb_intf->dev.power.usage_count));
1891 +
1892 +- if (atomic_read(&us->pusb_intf->pm_usage_cnt) <= 0) {
1893 ++ if (atomic_read(&us->pusb_intf->dev.power.usage_count) <= 0) {
1894 + ret = usb_autopm_get_interface(us->pusb_intf);
1895 + usb_stor_dbg(us, "working scsi, ret=%d\n", ret);
1896 + }
1897 +diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c
1898 +index 5b807185f79e..777a4058c407 100644
1899 +--- a/drivers/usb/usbip/stub_rx.c
1900 ++++ b/drivers/usb/usbip/stub_rx.c
1901 +@@ -383,16 +383,10 @@ static int get_pipe(struct stub_device *sdev, struct usbip_header *pdu)
1902 + }
1903 +
1904 + if (usb_endpoint_xfer_isoc(epd)) {
1905 +- /* validate packet size and number of packets */
1906 +- unsigned int maxp, packets, bytes;
1907 +-
1908 +- maxp = usb_endpoint_maxp(epd);
1909 +- maxp *= usb_endpoint_maxp_mult(epd);
1910 +- bytes = pdu->u.cmd_submit.transfer_buffer_length;
1911 +- packets = DIV_ROUND_UP(bytes, maxp);
1912 +-
1913 ++ /* validate number of packets */
1914 + if (pdu->u.cmd_submit.number_of_packets < 0 ||
1915 +- pdu->u.cmd_submit.number_of_packets > packets) {
1916 ++ pdu->u.cmd_submit.number_of_packets >
1917 ++ USBIP_MAX_ISO_PACKETS) {
1918 + dev_err(&sdev->udev->dev,
1919 + "CMD_SUBMIT: isoc invalid num packets %d\n",
1920 + pdu->u.cmd_submit.number_of_packets);
1921 +diff --git a/drivers/usb/usbip/usbip_common.h b/drivers/usb/usbip/usbip_common.h
1922 +index c81c44c13a56..59097145cfc0 100644
1923 +--- a/drivers/usb/usbip/usbip_common.h
1924 ++++ b/drivers/usb/usbip/usbip_common.h
1925 +@@ -135,6 +135,13 @@ extern struct device_attribute dev_attr_usbip_debug;
1926 + #define USBIP_DIR_OUT 0x00
1927 + #define USBIP_DIR_IN 0x01
1928 +
1929 ++/*
1930 ++ * Arbitrary limit for the maximum number of isochronous packets in an URB,
1931 ++ * compare for example the uhci_submit_isochronous function in
1932 ++ * drivers/usb/host/uhci-q.c
1933 ++ */
1934 ++#define USBIP_MAX_ISO_PACKETS 1024
1935 ++
1936 + /**
1937 + * struct usbip_header_basic - data pertinent to every request
1938 + * @command: the usbip request type
1939 +diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
1940 +index 695b9d1a1aae..6f5cc67e343e 100644
1941 +--- a/drivers/vfio/pci/vfio_pci.c
1942 ++++ b/drivers/vfio/pci/vfio_pci.c
1943 +@@ -1443,11 +1443,11 @@ static void __init vfio_pci_fill_ids(void)
1944 + rc = pci_add_dynid(&vfio_pci_driver, vendor, device,
1945 + subvendor, subdevice, class, class_mask, 0);
1946 + if (rc)
1947 +- pr_warn("failed to add dynamic id [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x (%d)\n",
1948 ++ pr_warn("failed to add dynamic id [%04x:%04x[%04x:%04x]] class %#08x/%08x (%d)\n",
1949 + vendor, device, subvendor, subdevice,
1950 + class, class_mask, rc);
1951 + else
1952 +- pr_info("add [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x\n",
1953 ++ pr_info("add [%04x:%04x[%04x:%04x]] class %#08x/%08x\n",
1954 + vendor, device, subvendor, subdevice,
1955 + class, class_mask);
1956 + }
1957 +diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c
1958 +index c423bdb982bb..2ec0dfcd5b97 100644
1959 +--- a/drivers/w1/masters/ds2490.c
1960 ++++ b/drivers/w1/masters/ds2490.c
1961 +@@ -1018,15 +1018,15 @@ static int ds_probe(struct usb_interface *intf,
1962 + /* alternative 3, 1ms interrupt (greatly speeds search), 64 byte bulk */
1963 + alt = 3;
1964 + err = usb_set_interface(dev->udev,
1965 +- intf->altsetting[alt].desc.bInterfaceNumber, alt);
1966 ++ intf->cur_altsetting->desc.bInterfaceNumber, alt);
1967 + if (err) {
1968 + dev_err(&dev->udev->dev, "Failed to set alternative setting %d "
1969 + "for %d interface: err=%d.\n", alt,
1970 +- intf->altsetting[alt].desc.bInterfaceNumber, err);
1971 ++ intf->cur_altsetting->desc.bInterfaceNumber, err);
1972 + goto err_out_clear;
1973 + }
1974 +
1975 +- iface_desc = &intf->altsetting[alt];
1976 ++ iface_desc = intf->cur_altsetting;
1977 + if (iface_desc->desc.bNumEndpoints != NUM_EP-1) {
1978 + pr_info("Num endpoints=%d. It is not DS9490R.\n",
1979 + iface_desc->desc.bNumEndpoints);
1980 +diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
1981 +index ccfe1e1cb6bc..f4df6feec271 100644
1982 +--- a/fs/debugfs/inode.c
1983 ++++ b/fs/debugfs/inode.c
1984 +@@ -170,19 +170,24 @@ static int debugfs_show_options(struct seq_file *m, struct dentry *root)
1985 + return 0;
1986 + }
1987 +
1988 +-static void debugfs_evict_inode(struct inode *inode)
1989 ++static void debugfs_i_callback(struct rcu_head *head)
1990 + {
1991 +- truncate_inode_pages_final(&inode->i_data);
1992 +- clear_inode(inode);
1993 ++ struct inode *inode = container_of(head, struct inode, i_rcu);
1994 + if (S_ISLNK(inode->i_mode))
1995 + kfree(inode->i_link);
1996 ++ free_inode_nonrcu(inode);
1997 ++}
1998 ++
1999 ++static void debugfs_destroy_inode(struct inode *inode)
2000 ++{
2001 ++ call_rcu(&inode->i_rcu, debugfs_i_callback);
2002 + }
2003 +
2004 + static const struct super_operations debugfs_super_operations = {
2005 + .statfs = simple_statfs,
2006 + .remount_fs = debugfs_remount,
2007 + .show_options = debugfs_show_options,
2008 +- .evict_inode = debugfs_evict_inode,
2009 ++ .destroy_inode = debugfs_destroy_inode,
2010 + };
2011 +
2012 + static struct vfsmount *debugfs_automount(struct path *path)
2013 +diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
2014 +index eb6f3de29f69..dd28a9b287da 100644
2015 +--- a/fs/hugetlbfs/inode.c
2016 ++++ b/fs/hugetlbfs/inode.c
2017 +@@ -730,11 +730,17 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,
2018 + umode_t mode, dev_t dev)
2019 + {
2020 + struct inode *inode;
2021 +- struct resv_map *resv_map;
2022 ++ struct resv_map *resv_map = NULL;
2023 +
2024 +- resv_map = resv_map_alloc();
2025 +- if (!resv_map)
2026 +- return NULL;
2027 ++ /*
2028 ++ * Reserve maps are only needed for inodes that can have associated
2029 ++ * page allocations.
2030 ++ */
2031 ++ if (S_ISREG(mode) || S_ISLNK(mode)) {
2032 ++ resv_map = resv_map_alloc();
2033 ++ if (!resv_map)
2034 ++ return NULL;
2035 ++ }
2036 +
2037 + inode = new_inode(sb);
2038 + if (inode) {
2039 +@@ -766,8 +772,10 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,
2040 + break;
2041 + }
2042 + lockdep_annotate_inode_mutex_key(inode);
2043 +- } else
2044 +- kref_put(&resv_map->refs, resv_map_release);
2045 ++ } else {
2046 ++ if (resv_map)
2047 ++ kref_put(&resv_map->refs, resv_map_release);
2048 ++ }
2049 +
2050 + return inode;
2051 + }
2052 +diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
2053 +index 389ea53ea487..bccfc40b3a74 100644
2054 +--- a/fs/jffs2/readinode.c
2055 ++++ b/fs/jffs2/readinode.c
2056 +@@ -1414,11 +1414,6 @@ void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f)
2057 +
2058 + jffs2_kill_fragtree(&f->fragtree, deleted?c:NULL);
2059 +
2060 +- if (f->target) {
2061 +- kfree(f->target);
2062 +- f->target = NULL;
2063 +- }
2064 +-
2065 + fds = f->dents;
2066 + while(fds) {
2067 + fd = fds;
2068 +diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
2069 +index 83340496645b..9a9f30eddbbb 100644
2070 +--- a/fs/jffs2/super.c
2071 ++++ b/fs/jffs2/super.c
2072 +@@ -47,7 +47,10 @@ static struct inode *jffs2_alloc_inode(struct super_block *sb)
2073 + static void jffs2_i_callback(struct rcu_head *head)
2074 + {
2075 + struct inode *inode = container_of(head, struct inode, i_rcu);
2076 +- kmem_cache_free(jffs2_inode_cachep, JFFS2_INODE_INFO(inode));
2077 ++ struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
2078 ++
2079 ++ kfree(f->target);
2080 ++ kmem_cache_free(jffs2_inode_cachep, f);
2081 + }
2082 +
2083 + static void jffs2_destroy_inode(struct inode *inode)
2084 +diff --git a/include/linux/platform_data/x86/clk-pmc-atom.h b/include/linux/platform_data/x86/clk-pmc-atom.h
2085 +index 3ab892208343..7a37ac27d0fb 100644
2086 +--- a/include/linux/platform_data/x86/clk-pmc-atom.h
2087 ++++ b/include/linux/platform_data/x86/clk-pmc-atom.h
2088 +@@ -35,10 +35,13 @@ struct pmc_clk {
2089 + *
2090 + * @base: PMC clock register base offset
2091 + * @clks: pointer to set of registered clocks, typically 0..5
2092 ++ * @critical: flag to indicate if firmware enabled pmc_plt_clks
2093 ++ * should be marked as critial or not
2094 + */
2095 + struct pmc_clk_data {
2096 + void __iomem *base;
2097 + const struct pmc_clk *clks;
2098 ++ bool critical;
2099 + };
2100 +
2101 + #endif /* __PLATFORM_DATA_X86_CLK_PMC_ATOM_H */
2102 +diff --git a/include/linux/usb.h b/include/linux/usb.h
2103 +index 8c7ba40cf021..a22a3e139e96 100644
2104 +--- a/include/linux/usb.h
2105 ++++ b/include/linux/usb.h
2106 +@@ -200,7 +200,6 @@ usb_find_last_int_out_endpoint(struct usb_host_interface *alt,
2107 + * @dev: driver model's view of this device
2108 + * @usb_dev: if an interface is bound to the USB major, this will point
2109 + * to the sysfs representation for that device.
2110 +- * @pm_usage_cnt: PM usage counter for this interface
2111 + * @reset_ws: Used for scheduling resets from atomic context.
2112 + * @resetting_device: USB core reset the device, so use alt setting 0 as
2113 + * current; needs bandwidth alloc after reset.
2114 +@@ -257,7 +256,6 @@ struct usb_interface {
2115 +
2116 + struct device dev; /* interface specific device info */
2117 + struct device *usb_dev;
2118 +- atomic_t pm_usage_cnt; /* usage counter for autosuspend */
2119 + struct work_struct reset_ws; /* for resets in atomic context */
2120 + };
2121 + #define to_usb_interface(d) container_of(d, struct usb_interface, dev)
2122 +diff --git a/include/net/caif/cfpkt.h b/include/net/caif/cfpkt.h
2123 +index fe328c52c46b..801489bb14c3 100644
2124 +--- a/include/net/caif/cfpkt.h
2125 ++++ b/include/net/caif/cfpkt.h
2126 +@@ -32,6 +32,33 @@ void cfpkt_destroy(struct cfpkt *pkt);
2127 + */
2128 + int cfpkt_extr_head(struct cfpkt *pkt, void *data, u16 len);
2129 +
2130 ++static inline u8 cfpkt_extr_head_u8(struct cfpkt *pkt)
2131 ++{
2132 ++ u8 tmp;
2133 ++
2134 ++ cfpkt_extr_head(pkt, &tmp, 1);
2135 ++
2136 ++ return tmp;
2137 ++}
2138 ++
2139 ++static inline u16 cfpkt_extr_head_u16(struct cfpkt *pkt)
2140 ++{
2141 ++ __le16 tmp;
2142 ++
2143 ++ cfpkt_extr_head(pkt, &tmp, 2);
2144 ++
2145 ++ return le16_to_cpu(tmp);
2146 ++}
2147 ++
2148 ++static inline u32 cfpkt_extr_head_u32(struct cfpkt *pkt)
2149 ++{
2150 ++ __le32 tmp;
2151 ++
2152 ++ cfpkt_extr_head(pkt, &tmp, 4);
2153 ++
2154 ++ return le32_to_cpu(tmp);
2155 ++}
2156 ++
2157 + /*
2158 + * Peek header from packet.
2159 + * Reads data from packet without changing packet.
2160 +diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
2161 +index b55c6a48a206..d44d17b29189 100644
2162 +--- a/include/net/sctp/command.h
2163 ++++ b/include/net/sctp/command.h
2164 +@@ -104,7 +104,6 @@ enum sctp_verb {
2165 + SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */
2166 + SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */
2167 + SCTP_CMD_SEND_MSG, /* Send the whole use message */
2168 +- SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */
2169 + SCTP_CMD_PURGE_ASCONF_QUEUE, /* Purge all asconf queues.*/
2170 + SCTP_CMD_SET_ASOC, /* Restore association context */
2171 + SCTP_CMD_LAST
2172 +diff --git a/lib/Makefile b/lib/Makefile
2173 +index b8f2c16fccaa..b1ac45032903 100644
2174 +--- a/lib/Makefile
2175 ++++ b/lib/Makefile
2176 +@@ -50,6 +50,7 @@ obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o
2177 + obj-$(CONFIG_TEST_SYSCTL) += test_sysctl.o
2178 + obj-$(CONFIG_TEST_HASH) += test_hash.o test_siphash.o
2179 + obj-$(CONFIG_TEST_KASAN) += test_kasan.o
2180 ++CFLAGS_test_kasan.o += -fno-builtin
2181 + obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o
2182 + obj-$(CONFIG_TEST_LIST_SORT) += test_list_sort.o
2183 + obj-$(CONFIG_TEST_LKM) += test_module.o
2184 +diff --git a/lib/test_kasan.c b/lib/test_kasan.c
2185 +index a25c9763fce1..d6e46dd1350b 100644
2186 +--- a/lib/test_kasan.c
2187 ++++ b/lib/test_kasan.c
2188 +@@ -389,7 +389,7 @@ static noinline void __init kasan_stack_oob(void)
2189 + static noinline void __init ksize_unpoisons_memory(void)
2190 + {
2191 + char *ptr;
2192 +- size_t size = 123, real_size = size;
2193 ++ size_t size = 123, real_size;
2194 +
2195 + pr_info("ksize() unpoisons the whole allocated chunk\n");
2196 + ptr = kmalloc(size, GFP_KERNEL);
2197 +diff --git a/mm/kmemleak.c b/mm/kmemleak.c
2198 +index d9e0be2a8189..71ba1c7f8892 100644
2199 +--- a/mm/kmemleak.c
2200 ++++ b/mm/kmemleak.c
2201 +@@ -1364,6 +1364,7 @@ static void scan_block(void *_start, void *_end,
2202 + /*
2203 + * Scan a large memory block in MAX_SCAN_SIZE chunks to reduce the latency.
2204 + */
2205 ++#ifdef CONFIG_SMP
2206 + static void scan_large_block(void *start, void *end)
2207 + {
2208 + void *next;
2209 +@@ -1375,6 +1376,7 @@ static void scan_large_block(void *start, void *end)
2210 + cond_resched();
2211 + }
2212 + }
2213 ++#endif
2214 +
2215 + /*
2216 + * Scan a memory block corresponding to a kmemleak_object. A condition is
2217 +@@ -1492,11 +1494,6 @@ static void kmemleak_scan(void)
2218 + }
2219 + rcu_read_unlock();
2220 +
2221 +- /* data/bss scanning */
2222 +- scan_large_block(_sdata, _edata);
2223 +- scan_large_block(__bss_start, __bss_stop);
2224 +- scan_large_block(__start_ro_after_init, __end_ro_after_init);
2225 +-
2226 + #ifdef CONFIG_SMP
2227 + /* per-cpu sections scanning */
2228 + for_each_possible_cpu(i)
2229 +@@ -2027,6 +2024,17 @@ void __init kmemleak_init(void)
2230 + }
2231 + local_irq_restore(flags);
2232 +
2233 ++ /* register the data/bss sections */
2234 ++ create_object((unsigned long)_sdata, _edata - _sdata,
2235 ++ KMEMLEAK_GREY, GFP_ATOMIC);
2236 ++ create_object((unsigned long)__bss_start, __bss_stop - __bss_start,
2237 ++ KMEMLEAK_GREY, GFP_ATOMIC);
2238 ++ /* only register .data..ro_after_init if not within .data */
2239 ++ if (__start_ro_after_init < _sdata || __end_ro_after_init > _edata)
2240 ++ create_object((unsigned long)__start_ro_after_init,
2241 ++ __end_ro_after_init - __start_ro_after_init,
2242 ++ KMEMLEAK_GREY, GFP_ATOMIC);
2243 ++
2244 + /*
2245 + * This is the point where tracking allocations is safe. Automatic
2246 + * scanning is started during the late initcall. Add the early logged
2247 +diff --git a/mm/vmscan.c b/mm/vmscan.c
2248 +index 9734e62654fa..99837e931f53 100644
2249 +--- a/mm/vmscan.c
2250 ++++ b/mm/vmscan.c
2251 +@@ -502,6 +502,15 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid,
2252 + sc.nid = 0;
2253 +
2254 + freed += do_shrink_slab(&sc, shrinker, nr_scanned, nr_eligible);
2255 ++ /*
2256 ++ * Bail out if someone want to register a new shrinker to
2257 ++ * prevent the regsitration from being stalled for long periods
2258 ++ * by parallel ongoing shrinking.
2259 ++ */
2260 ++ if (rwsem_is_contended(&shrinker_rwsem)) {
2261 ++ freed = freed ? : 1;
2262 ++ break;
2263 ++ }
2264 + }
2265 +
2266 + up_read(&shrinker_rwsem);
2267 +diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
2268 +index c3c848f64fdd..c761c0c233e4 100644
2269 +--- a/net/batman-adv/bridge_loop_avoidance.c
2270 ++++ b/net/batman-adv/bridge_loop_avoidance.c
2271 +@@ -803,6 +803,8 @@ static void batadv_bla_del_claim(struct batadv_priv *bat_priv,
2272 + const u8 *mac, const unsigned short vid)
2273 + {
2274 + struct batadv_bla_claim search_claim, *claim;
2275 ++ struct batadv_bla_claim *claim_removed_entry;
2276 ++ struct hlist_node *claim_removed_node;
2277 +
2278 + ether_addr_copy(search_claim.addr, mac);
2279 + search_claim.vid = vid;
2280 +@@ -813,10 +815,18 @@ static void batadv_bla_del_claim(struct batadv_priv *bat_priv,
2281 + batadv_dbg(BATADV_DBG_BLA, bat_priv, "%s(): %pM, vid %d\n", __func__,
2282 + mac, batadv_print_vid(vid));
2283 +
2284 +- batadv_hash_remove(bat_priv->bla.claim_hash, batadv_compare_claim,
2285 +- batadv_choose_claim, claim);
2286 +- batadv_claim_put(claim); /* reference from the hash is gone */
2287 ++ claim_removed_node = batadv_hash_remove(bat_priv->bla.claim_hash,
2288 ++ batadv_compare_claim,
2289 ++ batadv_choose_claim, claim);
2290 ++ if (!claim_removed_node)
2291 ++ goto free_claim;
2292 +
2293 ++ /* reference from the hash is gone */
2294 ++ claim_removed_entry = hlist_entry(claim_removed_node,
2295 ++ struct batadv_bla_claim, hash_entry);
2296 ++ batadv_claim_put(claim_removed_entry);
2297 ++
2298 ++free_claim:
2299 + /* don't need the reference from hash_find() anymore */
2300 + batadv_claim_put(claim);
2301 + }
2302 +diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
2303 +index 9da3455847ff..020a8adc4cce 100644
2304 +--- a/net/batman-adv/translation-table.c
2305 ++++ b/net/batman-adv/translation-table.c
2306 +@@ -614,14 +614,26 @@ static void batadv_tt_global_free(struct batadv_priv *bat_priv,
2307 + struct batadv_tt_global_entry *tt_global,
2308 + const char *message)
2309 + {
2310 ++ struct batadv_tt_global_entry *tt_removed_entry;
2311 ++ struct hlist_node *tt_removed_node;
2312 ++
2313 + batadv_dbg(BATADV_DBG_TT, bat_priv,
2314 + "Deleting global tt entry %pM (vid: %d): %s\n",
2315 + tt_global->common.addr,
2316 + batadv_print_vid(tt_global->common.vid), message);
2317 +
2318 +- batadv_hash_remove(bat_priv->tt.global_hash, batadv_compare_tt,
2319 +- batadv_choose_tt, &tt_global->common);
2320 +- batadv_tt_global_entry_put(tt_global);
2321 ++ tt_removed_node = batadv_hash_remove(bat_priv->tt.global_hash,
2322 ++ batadv_compare_tt,
2323 ++ batadv_choose_tt,
2324 ++ &tt_global->common);
2325 ++ if (!tt_removed_node)
2326 ++ return;
2327 ++
2328 ++ /* drop reference of remove hash entry */
2329 ++ tt_removed_entry = hlist_entry(tt_removed_node,
2330 ++ struct batadv_tt_global_entry,
2331 ++ common.hash_entry);
2332 ++ batadv_tt_global_entry_put(tt_removed_entry);
2333 + }
2334 +
2335 + /**
2336 +@@ -1313,9 +1325,10 @@ u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr,
2337 + unsigned short vid, const char *message,
2338 + bool roaming)
2339 + {
2340 ++ struct batadv_tt_local_entry *tt_removed_entry;
2341 + struct batadv_tt_local_entry *tt_local_entry;
2342 + u16 flags, curr_flags = BATADV_NO_FLAGS;
2343 +- void *tt_entry_exists;
2344 ++ struct hlist_node *tt_removed_node;
2345 +
2346 + tt_local_entry = batadv_tt_local_hash_find(bat_priv, addr, vid);
2347 + if (!tt_local_entry)
2348 +@@ -1344,15 +1357,18 @@ u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr,
2349 + */
2350 + batadv_tt_local_event(bat_priv, tt_local_entry, BATADV_TT_CLIENT_DEL);
2351 +
2352 +- tt_entry_exists = batadv_hash_remove(bat_priv->tt.local_hash,
2353 ++ tt_removed_node = batadv_hash_remove(bat_priv->tt.local_hash,
2354 + batadv_compare_tt,
2355 + batadv_choose_tt,
2356 + &tt_local_entry->common);
2357 +- if (!tt_entry_exists)
2358 ++ if (!tt_removed_node)
2359 + goto out;
2360 +
2361 +- /* extra call to free the local tt entry */
2362 +- batadv_tt_local_entry_put(tt_local_entry);
2363 ++ /* drop reference of remove hash entry */
2364 ++ tt_removed_entry = hlist_entry(tt_removed_node,
2365 ++ struct batadv_tt_local_entry,
2366 ++ common.hash_entry);
2367 ++ batadv_tt_local_entry_put(tt_removed_entry);
2368 +
2369 + out:
2370 + if (tt_local_entry)
2371 +diff --git a/net/caif/cfctrl.c b/net/caif/cfctrl.c
2372 +index f5afda1abc76..4dc82e9a855d 100644
2373 +--- a/net/caif/cfctrl.c
2374 ++++ b/net/caif/cfctrl.c
2375 +@@ -352,15 +352,14 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
2376 + u8 cmdrsp;
2377 + u8 cmd;
2378 + int ret = -1;
2379 +- u16 tmp16;
2380 + u8 len;
2381 + u8 param[255];
2382 +- u8 linkid;
2383 ++ u8 linkid = 0;
2384 + struct cfctrl *cfctrl = container_obj(layer);
2385 + struct cfctrl_request_info rsp, *req;
2386 +
2387 +
2388 +- cfpkt_extr_head(pkt, &cmdrsp, 1);
2389 ++ cmdrsp = cfpkt_extr_head_u8(pkt);
2390 + cmd = cmdrsp & CFCTRL_CMD_MASK;
2391 + if (cmd != CFCTRL_CMD_LINK_ERR
2392 + && CFCTRL_RSP_BIT != (CFCTRL_RSP_BIT & cmdrsp)
2393 +@@ -378,13 +377,12 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
2394 + u8 physlinkid;
2395 + u8 prio;
2396 + u8 tmp;
2397 +- u32 tmp32;
2398 + u8 *cp;
2399 + int i;
2400 + struct cfctrl_link_param linkparam;
2401 + memset(&linkparam, 0, sizeof(linkparam));
2402 +
2403 +- cfpkt_extr_head(pkt, &tmp, 1);
2404 ++ tmp = cfpkt_extr_head_u8(pkt);
2405 +
2406 + serv = tmp & CFCTRL_SRV_MASK;
2407 + linkparam.linktype = serv;
2408 +@@ -392,13 +390,13 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
2409 + servtype = tmp >> 4;
2410 + linkparam.chtype = servtype;
2411 +
2412 +- cfpkt_extr_head(pkt, &tmp, 1);
2413 ++ tmp = cfpkt_extr_head_u8(pkt);
2414 + physlinkid = tmp & 0x07;
2415 + prio = tmp >> 3;
2416 +
2417 + linkparam.priority = prio;
2418 + linkparam.phyid = physlinkid;
2419 +- cfpkt_extr_head(pkt, &endpoint, 1);
2420 ++ endpoint = cfpkt_extr_head_u8(pkt);
2421 + linkparam.endpoint = endpoint & 0x03;
2422 +
2423 + switch (serv) {
2424 +@@ -407,45 +405,43 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
2425 + if (CFCTRL_ERR_BIT & cmdrsp)
2426 + break;
2427 + /* Link ID */
2428 +- cfpkt_extr_head(pkt, &linkid, 1);
2429 ++ linkid = cfpkt_extr_head_u8(pkt);
2430 + break;
2431 + case CFCTRL_SRV_VIDEO:
2432 +- cfpkt_extr_head(pkt, &tmp, 1);
2433 ++ tmp = cfpkt_extr_head_u8(pkt);
2434 + linkparam.u.video.connid = tmp;
2435 + if (CFCTRL_ERR_BIT & cmdrsp)
2436 + break;
2437 + /* Link ID */
2438 +- cfpkt_extr_head(pkt, &linkid, 1);
2439 ++ linkid = cfpkt_extr_head_u8(pkt);
2440 + break;
2441 +
2442 + case CFCTRL_SRV_DATAGRAM:
2443 +- cfpkt_extr_head(pkt, &tmp32, 4);
2444 + linkparam.u.datagram.connid =
2445 +- le32_to_cpu(tmp32);
2446 ++ cfpkt_extr_head_u32(pkt);
2447 + if (CFCTRL_ERR_BIT & cmdrsp)
2448 + break;
2449 + /* Link ID */
2450 +- cfpkt_extr_head(pkt, &linkid, 1);
2451 ++ linkid = cfpkt_extr_head_u8(pkt);
2452 + break;
2453 + case CFCTRL_SRV_RFM:
2454 + /* Construct a frame, convert
2455 + * DatagramConnectionID
2456 + * to network format long and copy it out...
2457 + */
2458 +- cfpkt_extr_head(pkt, &tmp32, 4);
2459 + linkparam.u.rfm.connid =
2460 +- le32_to_cpu(tmp32);
2461 ++ cfpkt_extr_head_u32(pkt);
2462 + cp = (u8 *) linkparam.u.rfm.volume;
2463 +- for (cfpkt_extr_head(pkt, &tmp, 1);
2464 ++ for (tmp = cfpkt_extr_head_u8(pkt);
2465 + cfpkt_more(pkt) && tmp != '\0';
2466 +- cfpkt_extr_head(pkt, &tmp, 1))
2467 ++ tmp = cfpkt_extr_head_u8(pkt))
2468 + *cp++ = tmp;
2469 + *cp = '\0';
2470 +
2471 + if (CFCTRL_ERR_BIT & cmdrsp)
2472 + break;
2473 + /* Link ID */
2474 +- cfpkt_extr_head(pkt, &linkid, 1);
2475 ++ linkid = cfpkt_extr_head_u8(pkt);
2476 +
2477 + break;
2478 + case CFCTRL_SRV_UTIL:
2479 +@@ -454,13 +450,11 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
2480 + * to network format long and copy it out...
2481 + */
2482 + /* Fifosize KB */
2483 +- cfpkt_extr_head(pkt, &tmp16, 2);
2484 + linkparam.u.utility.fifosize_kb =
2485 +- le16_to_cpu(tmp16);
2486 ++ cfpkt_extr_head_u16(pkt);
2487 + /* Fifosize bufs */
2488 +- cfpkt_extr_head(pkt, &tmp16, 2);
2489 + linkparam.u.utility.fifosize_bufs =
2490 +- le16_to_cpu(tmp16);
2491 ++ cfpkt_extr_head_u16(pkt);
2492 + /* name */
2493 + cp = (u8 *) linkparam.u.utility.name;
2494 + caif_assert(sizeof(linkparam.u.utility.name)
2495 +@@ -468,24 +462,24 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
2496 + for (i = 0;
2497 + i < UTILITY_NAME_LENGTH
2498 + && cfpkt_more(pkt); i++) {
2499 +- cfpkt_extr_head(pkt, &tmp, 1);
2500 ++ tmp = cfpkt_extr_head_u8(pkt);
2501 + *cp++ = tmp;
2502 + }
2503 + /* Length */
2504 +- cfpkt_extr_head(pkt, &len, 1);
2505 ++ len = cfpkt_extr_head_u8(pkt);
2506 + linkparam.u.utility.paramlen = len;
2507 + /* Param Data */
2508 + cp = linkparam.u.utility.params;
2509 + while (cfpkt_more(pkt) && len--) {
2510 +- cfpkt_extr_head(pkt, &tmp, 1);
2511 ++ tmp = cfpkt_extr_head_u8(pkt);
2512 + *cp++ = tmp;
2513 + }
2514 + if (CFCTRL_ERR_BIT & cmdrsp)
2515 + break;
2516 + /* Link ID */
2517 +- cfpkt_extr_head(pkt, &linkid, 1);
2518 ++ linkid = cfpkt_extr_head_u8(pkt);
2519 + /* Length */
2520 +- cfpkt_extr_head(pkt, &len, 1);
2521 ++ len = cfpkt_extr_head_u8(pkt);
2522 + /* Param Data */
2523 + cfpkt_extr_head(pkt, &param, len);
2524 + break;
2525 +@@ -522,7 +516,7 @@ static int cfctrl_recv(struct cflayer *layer, struct cfpkt *pkt)
2526 + }
2527 + break;
2528 + case CFCTRL_CMD_LINK_DESTROY:
2529 +- cfpkt_extr_head(pkt, &linkid, 1);
2530 ++ linkid = cfpkt_extr_head_u8(pkt);
2531 + cfctrl->res.linkdestroy_rsp(cfctrl->serv.layer.up, linkid);
2532 + break;
2533 + case CFCTRL_CMD_LINK_ERR:
2534 +diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
2535 +index e2dd325bed9b..34d49f76d1a7 100644
2536 +--- a/net/ipv4/ip_output.c
2537 ++++ b/net/ipv4/ip_output.c
2538 +@@ -518,6 +518,7 @@ static void ip_copy_metadata(struct sk_buff *to, struct sk_buff *from)
2539 + to->pkt_type = from->pkt_type;
2540 + to->priority = from->priority;
2541 + to->protocol = from->protocol;
2542 ++ to->skb_iif = from->skb_iif;
2543 + skb_dst_drop(to);
2544 + skb_dst_copy(to, from);
2545 + to->dev = from->dev;
2546 +diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
2547 +index 15535ee327c5..6fa2bc236d9e 100644
2548 +--- a/net/ipv6/ip6_flowlabel.c
2549 ++++ b/net/ipv6/ip6_flowlabel.c
2550 +@@ -94,15 +94,21 @@ static struct ip6_flowlabel *fl_lookup(struct net *net, __be32 label)
2551 + return fl;
2552 + }
2553 +
2554 ++static void fl_free_rcu(struct rcu_head *head)
2555 ++{
2556 ++ struct ip6_flowlabel *fl = container_of(head, struct ip6_flowlabel, rcu);
2557 ++
2558 ++ if (fl->share == IPV6_FL_S_PROCESS)
2559 ++ put_pid(fl->owner.pid);
2560 ++ kfree(fl->opt);
2561 ++ kfree(fl);
2562 ++}
2563 ++
2564 +
2565 + static void fl_free(struct ip6_flowlabel *fl)
2566 + {
2567 +- if (fl) {
2568 +- if (fl->share == IPV6_FL_S_PROCESS)
2569 +- put_pid(fl->owner.pid);
2570 +- kfree(fl->opt);
2571 +- kfree_rcu(fl, rcu);
2572 +- }
2573 ++ if (fl)
2574 ++ call_rcu(&fl->rcu, fl_free_rcu);
2575 + }
2576 +
2577 + static void fl_release(struct ip6_flowlabel *fl)
2578 +@@ -634,9 +640,9 @@ recheck:
2579 + if (fl1->share == IPV6_FL_S_EXCL ||
2580 + fl1->share != fl->share ||
2581 + ((fl1->share == IPV6_FL_S_PROCESS) &&
2582 +- (fl1->owner.pid == fl->owner.pid)) ||
2583 ++ (fl1->owner.pid != fl->owner.pid)) ||
2584 + ((fl1->share == IPV6_FL_S_USER) &&
2585 +- uid_eq(fl1->owner.uid, fl->owner.uid)))
2586 ++ !uid_eq(fl1->owner.uid, fl->owner.uid)))
2587 + goto release;
2588 +
2589 + err = -ENOMEM;
2590 +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
2591 +index e8ca6aa3a32f..e522316a80c7 100644
2592 +--- a/net/packet/af_packet.c
2593 ++++ b/net/packet/af_packet.c
2594 +@@ -2641,8 +2641,8 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
2595 + void *ph;
2596 + DECLARE_SOCKADDR(struct sockaddr_ll *, saddr, msg->msg_name);
2597 + bool need_wait = !(msg->msg_flags & MSG_DONTWAIT);
2598 ++ unsigned char *addr = NULL;
2599 + int tp_len, size_max;
2600 +- unsigned char *addr;
2601 + void *data;
2602 + int len_sum = 0;
2603 + int status = TP_STATUS_AVAILABLE;
2604 +@@ -2653,7 +2653,6 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
2605 + if (likely(saddr == NULL)) {
2606 + dev = packet_cached_dev_get(po);
2607 + proto = po->num;
2608 +- addr = NULL;
2609 + } else {
2610 + err = -EINVAL;
2611 + if (msg->msg_namelen < sizeof(struct sockaddr_ll))
2612 +@@ -2663,10 +2662,13 @@ static int tpacket_snd(struct packet_sock *po, struct msghdr *msg)
2613 + sll_addr)))
2614 + goto out;
2615 + proto = saddr->sll_protocol;
2616 +- addr = saddr->sll_halen ? saddr->sll_addr : NULL;
2617 + dev = dev_get_by_index(sock_net(&po->sk), saddr->sll_ifindex);
2618 +- if (addr && dev && saddr->sll_halen < dev->addr_len)
2619 +- goto out_put;
2620 ++ if (po->sk.sk_socket->type == SOCK_DGRAM) {
2621 ++ if (dev && msg->msg_namelen < dev->addr_len +
2622 ++ offsetof(struct sockaddr_ll, sll_addr))
2623 ++ goto out_put;
2624 ++ addr = saddr->sll_addr;
2625 ++ }
2626 + }
2627 +
2628 + err = -ENXIO;
2629 +@@ -2838,7 +2840,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
2630 + struct sk_buff *skb;
2631 + struct net_device *dev;
2632 + __be16 proto;
2633 +- unsigned char *addr;
2634 ++ unsigned char *addr = NULL;
2635 + int err, reserve = 0;
2636 + struct sockcm_cookie sockc;
2637 + struct virtio_net_hdr vnet_hdr = { 0 };
2638 +@@ -2855,7 +2857,6 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
2639 + if (likely(saddr == NULL)) {
2640 + dev = packet_cached_dev_get(po);
2641 + proto = po->num;
2642 +- addr = NULL;
2643 + } else {
2644 + err = -EINVAL;
2645 + if (msg->msg_namelen < sizeof(struct sockaddr_ll))
2646 +@@ -2863,10 +2864,13 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
2647 + if (msg->msg_namelen < (saddr->sll_halen + offsetof(struct sockaddr_ll, sll_addr)))
2648 + goto out;
2649 + proto = saddr->sll_protocol;
2650 +- addr = saddr->sll_halen ? saddr->sll_addr : NULL;
2651 + dev = dev_get_by_index(sock_net(sk), saddr->sll_ifindex);
2652 +- if (addr && dev && saddr->sll_halen < dev->addr_len)
2653 +- goto out_unlock;
2654 ++ if (sock->type == SOCK_DGRAM) {
2655 ++ if (dev && msg->msg_namelen < dev->addr_len +
2656 ++ offsetof(struct sockaddr_ll, sll_addr))
2657 ++ goto out_unlock;
2658 ++ addr = saddr->sll_addr;
2659 ++ }
2660 + }
2661 +
2662 + err = -ENXIO;
2663 +diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c
2664 +index 8a5a42e8ec23..ddaa471a2607 100644
2665 +--- a/net/rxrpc/call_object.c
2666 ++++ b/net/rxrpc/call_object.c
2667 +@@ -684,27 +684,27 @@ void rxrpc_destroy_all_calls(struct rxrpc_net *rxnet)
2668 +
2669 + _enter("");
2670 +
2671 +- if (list_empty(&rxnet->calls))
2672 +- return;
2673 ++ if (!list_empty(&rxnet->calls)) {
2674 ++ write_lock(&rxnet->call_lock);
2675 +
2676 +- write_lock(&rxnet->call_lock);
2677 ++ while (!list_empty(&rxnet->calls)) {
2678 ++ call = list_entry(rxnet->calls.next,
2679 ++ struct rxrpc_call, link);
2680 ++ _debug("Zapping call %p", call);
2681 +
2682 +- while (!list_empty(&rxnet->calls)) {
2683 +- call = list_entry(rxnet->calls.next, struct rxrpc_call, link);
2684 +- _debug("Zapping call %p", call);
2685 ++ rxrpc_see_call(call);
2686 ++ list_del_init(&call->link);
2687 +
2688 +- rxrpc_see_call(call);
2689 +- list_del_init(&call->link);
2690 ++ pr_err("Call %p still in use (%d,%s,%lx,%lx)!\n",
2691 ++ call, atomic_read(&call->usage),
2692 ++ rxrpc_call_states[call->state],
2693 ++ call->flags, call->events);
2694 +
2695 +- pr_err("Call %p still in use (%d,%s,%lx,%lx)!\n",
2696 +- call, atomic_read(&call->usage),
2697 +- rxrpc_call_states[call->state],
2698 +- call->flags, call->events);
2699 ++ write_unlock(&rxnet->call_lock);
2700 ++ cond_resched();
2701 ++ write_lock(&rxnet->call_lock);
2702 ++ }
2703 +
2704 + write_unlock(&rxnet->call_lock);
2705 +- cond_resched();
2706 +- write_lock(&rxnet->call_lock);
2707 + }
2708 +-
2709 +- write_unlock(&rxnet->call_lock);
2710 + }
2711 +diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
2712 +index e2d9a4b49c9c..fb857cf09ecd 100644
2713 +--- a/net/sctp/sm_sideeffect.c
2714 ++++ b/net/sctp/sm_sideeffect.c
2715 +@@ -1092,32 +1092,6 @@ static void sctp_cmd_send_msg(struct sctp_association *asoc,
2716 + }
2717 +
2718 +
2719 +-/* Sent the next ASCONF packet currently stored in the association.
2720 +- * This happens after the ASCONF_ACK was succeffully processed.
2721 +- */
2722 +-static void sctp_cmd_send_asconf(struct sctp_association *asoc)
2723 +-{
2724 +- struct net *net = sock_net(asoc->base.sk);
2725 +-
2726 +- /* Send the next asconf chunk from the addip chunk
2727 +- * queue.
2728 +- */
2729 +- if (!list_empty(&asoc->addip_chunk_list)) {
2730 +- struct list_head *entry = asoc->addip_chunk_list.next;
2731 +- struct sctp_chunk *asconf = list_entry(entry,
2732 +- struct sctp_chunk, list);
2733 +- list_del_init(entry);
2734 +-
2735 +- /* Hold the chunk until an ASCONF_ACK is received. */
2736 +- sctp_chunk_hold(asconf);
2737 +- if (sctp_primitive_ASCONF(net, asoc, asconf))
2738 +- sctp_chunk_free(asconf);
2739 +- else
2740 +- asoc->addip_last_asconf = asconf;
2741 +- }
2742 +-}
2743 +-
2744 +-
2745 + /* These three macros allow us to pull the debugging code out of the
2746 + * main flow of sctp_do_sm() to keep attention focused on the real
2747 + * functionality there.
2748 +@@ -1763,9 +1737,6 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
2749 + }
2750 + sctp_cmd_send_msg(asoc, cmd->obj.msg, gfp);
2751 + break;
2752 +- case SCTP_CMD_SEND_NEXT_ASCONF:
2753 +- sctp_cmd_send_asconf(asoc);
2754 +- break;
2755 + case SCTP_CMD_PURGE_ASCONF_QUEUE:
2756 + sctp_asconf_queue_teardown(asoc);
2757 + break;
2758 +diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
2759 +index 01b078172306..a2e058127ef7 100644
2760 +--- a/net/sctp/sm_statefuns.c
2761 ++++ b/net/sctp/sm_statefuns.c
2762 +@@ -3756,6 +3756,29 @@ enum sctp_disposition sctp_sf_do_asconf(struct net *net,
2763 + return SCTP_DISPOSITION_CONSUME;
2764 + }
2765 +
2766 ++static enum sctp_disposition sctp_send_next_asconf(
2767 ++ struct net *net,
2768 ++ const struct sctp_endpoint *ep,
2769 ++ struct sctp_association *asoc,
2770 ++ const union sctp_subtype type,
2771 ++ struct sctp_cmd_seq *commands)
2772 ++{
2773 ++ struct sctp_chunk *asconf;
2774 ++ struct list_head *entry;
2775 ++
2776 ++ if (list_empty(&asoc->addip_chunk_list))
2777 ++ return SCTP_DISPOSITION_CONSUME;
2778 ++
2779 ++ entry = asoc->addip_chunk_list.next;
2780 ++ asconf = list_entry(entry, struct sctp_chunk, list);
2781 ++
2782 ++ list_del_init(entry);
2783 ++ sctp_chunk_hold(asconf);
2784 ++ asoc->addip_last_asconf = asconf;
2785 ++
2786 ++ return sctp_sf_do_prm_asconf(net, ep, asoc, type, asconf, commands);
2787 ++}
2788 ++
2789 + /*
2790 + * ADDIP Section 4.3 General rules for address manipulation
2791 + * When building TLV parameters for the ASCONF Chunk that will add or
2792 +@@ -3847,14 +3870,10 @@ enum sctp_disposition sctp_sf_do_asconf_ack(struct net *net,
2793 + SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
2794 +
2795 + if (!sctp_process_asconf_ack((struct sctp_association *)asoc,
2796 +- asconf_ack)) {
2797 +- /* Successfully processed ASCONF_ACK. We can
2798 +- * release the next asconf if we have one.
2799 +- */
2800 +- sctp_add_cmd_sf(commands, SCTP_CMD_SEND_NEXT_ASCONF,
2801 +- SCTP_NULL());
2802 +- return SCTP_DISPOSITION_CONSUME;
2803 +- }
2804 ++ asconf_ack))
2805 ++ return sctp_send_next_asconf(net, ep,
2806 ++ (struct sctp_association *)asoc,
2807 ++ type, commands);
2808 +
2809 + abort = sctp_make_abort(asoc, asconf_ack,
2810 + sizeof(struct sctp_errhdr));
2811 +diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
2812 +index b72aa48f6478..5f7bfc65c446 100644
2813 +--- a/security/selinux/hooks.c
2814 ++++ b/security/selinux/hooks.c
2815 +@@ -471,16 +471,10 @@ static int may_context_mount_inode_relabel(u32 sid,
2816 + return rc;
2817 + }
2818 +
2819 +-static int selinux_is_sblabel_mnt(struct super_block *sb)
2820 ++static int selinux_is_genfs_special_handling(struct super_block *sb)
2821 + {
2822 +- struct superblock_security_struct *sbsec = sb->s_security;
2823 +-
2824 +- return sbsec->behavior == SECURITY_FS_USE_XATTR ||
2825 +- sbsec->behavior == SECURITY_FS_USE_TRANS ||
2826 +- sbsec->behavior == SECURITY_FS_USE_TASK ||
2827 +- sbsec->behavior == SECURITY_FS_USE_NATIVE ||
2828 +- /* Special handling. Genfs but also in-core setxattr handler */
2829 +- !strcmp(sb->s_type->name, "sysfs") ||
2830 ++ /* Special handling. Genfs but also in-core setxattr handler */
2831 ++ return !strcmp(sb->s_type->name, "sysfs") ||
2832 + !strcmp(sb->s_type->name, "pstore") ||
2833 + !strcmp(sb->s_type->name, "debugfs") ||
2834 + !strcmp(sb->s_type->name, "tracefs") ||
2835 +@@ -490,6 +484,34 @@ static int selinux_is_sblabel_mnt(struct super_block *sb)
2836 + !strcmp(sb->s_type->name, "cgroup2")));
2837 + }
2838 +
2839 ++static int selinux_is_sblabel_mnt(struct super_block *sb)
2840 ++{
2841 ++ struct superblock_security_struct *sbsec = sb->s_security;
2842 ++
2843 ++ /*
2844 ++ * IMPORTANT: Double-check logic in this function when adding a new
2845 ++ * SECURITY_FS_USE_* definition!
2846 ++ */
2847 ++ BUILD_BUG_ON(SECURITY_FS_USE_MAX != 7);
2848 ++
2849 ++ switch (sbsec->behavior) {
2850 ++ case SECURITY_FS_USE_XATTR:
2851 ++ case SECURITY_FS_USE_TRANS:
2852 ++ case SECURITY_FS_USE_TASK:
2853 ++ case SECURITY_FS_USE_NATIVE:
2854 ++ return 1;
2855 ++
2856 ++ case SECURITY_FS_USE_GENFS:
2857 ++ return selinux_is_genfs_special_handling(sb);
2858 ++
2859 ++ /* Never allow relabeling on context mounts */
2860 ++ case SECURITY_FS_USE_MNTPOINT:
2861 ++ case SECURITY_FS_USE_NONE:
2862 ++ default:
2863 ++ return 0;
2864 ++ }
2865 ++}
2866 ++
2867 + static int sb_finish_set_opts(struct super_block *sb)
2868 + {
2869 + struct superblock_security_struct *sbsec = sb->s_security;
2870 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
2871 +index b9e720cb6f02..f44d08fe20fc 100644
2872 +--- a/sound/pci/hda/patch_realtek.c
2873 ++++ b/sound/pci/hda/patch_realtek.c
2874 +@@ -5294,6 +5294,8 @@ static void alc274_fixup_bind_dacs(struct hda_codec *codec,
2875 + return;
2876 +
2877 + spec->gen.preferred_dacs = preferred_pairs;
2878 ++ spec->gen.auto_mute_via_amp = 1;
2879 ++ codec->power_save_node = 0;
2880 + }
2881 +
2882 + static void alc_fixup_disable_mic_vref(struct hda_codec *codec,
2883 +@@ -6745,6 +6747,10 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
2884 + {0x21, 0x02211020}),
2885 + SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
2886 + {0x21, 0x02211020}),
2887 ++ SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
2888 ++ {0x12, 0x40000000},
2889 ++ {0x14, 0x90170110},
2890 ++ {0x21, 0x02211020}),
2891 + SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
2892 + {0x14, 0x90170110},
2893 + {0x21, 0x02211020}),
2894 +@@ -6985,6 +6991,9 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
2895 + SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
2896 + ALC292_STANDARD_PINS,
2897 + {0x13, 0x90a60140}),
2898 ++ SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
2899 ++ {0x14, 0x90170110},
2900 ++ {0x21, 0x04211020}),
2901 + SND_HDA_PIN_QUIRK(0x10ec0295, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
2902 + ALC295_STANDARD_PINS,
2903 + {0x17, 0x21014020},
2904 +diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
2905 +index 90d439613899..48b4286100d4 100644
2906 +--- a/sound/soc/stm/stm32_sai_sub.c
2907 ++++ b/sound/soc/stm/stm32_sai_sub.c
2908 +@@ -873,7 +873,6 @@ static int stm32_sai_sub_dais_init(struct platform_device *pdev,
2909 + if (!sai->cpu_dai_drv)
2910 + return -ENOMEM;
2911 +
2912 +- sai->cpu_dai_drv->name = dev_name(&pdev->dev);
2913 + if (STM_SAI_IS_PLAYBACK(sai)) {
2914 + memcpy(sai->cpu_dai_drv, &stm32_sai_playback_dai,
2915 + sizeof(stm32_sai_playback_dai));
2916 +@@ -883,6 +882,7 @@ static int stm32_sai_sub_dais_init(struct platform_device *pdev,
2917 + sizeof(stm32_sai_capture_dai));
2918 + sai->cpu_dai_drv->capture.stream_name = sai->cpu_dai_drv->name;
2919 + }
2920 ++ sai->cpu_dai_drv->name = dev_name(&pdev->dev);
2921 +
2922 + return 0;
2923 + }
2924 +diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c
2925 +index 167aebf8276e..b223de3defc4 100644
2926 +--- a/sound/usb/line6/driver.c
2927 ++++ b/sound/usb/line6/driver.c
2928 +@@ -344,12 +344,16 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,
2929 + {
2930 + struct usb_device *usbdev = line6->usbdev;
2931 + int ret;
2932 +- unsigned char len;
2933 ++ unsigned char *len;
2934 + unsigned count;
2935 +
2936 + if (address > 0xffff || datalen > 0xff)
2937 + return -EINVAL;
2938 +
2939 ++ len = kmalloc(sizeof(*len), GFP_KERNEL);
2940 ++ if (!len)
2941 ++ return -ENOMEM;
2942 ++
2943 + /* query the serial number: */
2944 + ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67,
2945 + USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
2946 +@@ -358,7 +362,7 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,
2947 +
2948 + if (ret < 0) {
2949 + dev_err(line6->ifcdev, "read request failed (error %d)\n", ret);
2950 +- return ret;
2951 ++ goto exit;
2952 + }
2953 +
2954 + /* Wait for data length. We'll get 0xff until length arrives. */
2955 +@@ -368,28 +372,29 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,
2956 + ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 0x67,
2957 + USB_TYPE_VENDOR | USB_RECIP_DEVICE |
2958 + USB_DIR_IN,
2959 +- 0x0012, 0x0000, &len, 1,
2960 ++ 0x0012, 0x0000, len, 1,
2961 + LINE6_TIMEOUT * HZ);
2962 + if (ret < 0) {
2963 + dev_err(line6->ifcdev,
2964 + "receive length failed (error %d)\n", ret);
2965 +- return ret;
2966 ++ goto exit;
2967 + }
2968 +
2969 +- if (len != 0xff)
2970 ++ if (*len != 0xff)
2971 + break;
2972 + }
2973 +
2974 +- if (len == 0xff) {
2975 ++ ret = -EIO;
2976 ++ if (*len == 0xff) {
2977 + dev_err(line6->ifcdev, "read failed after %d retries\n",
2978 + count);
2979 +- return -EIO;
2980 +- } else if (len != datalen) {
2981 ++ goto exit;
2982 ++ } else if (*len != datalen) {
2983 + /* should be equal or something went wrong */
2984 + dev_err(line6->ifcdev,
2985 + "length mismatch (expected %d, got %d)\n",
2986 +- (int)datalen, (int)len);
2987 +- return -EIO;
2988 ++ (int)datalen, (int)*len);
2989 ++ goto exit;
2990 + }
2991 +
2992 + /* receive the result: */
2993 +@@ -398,12 +403,12 @@ int line6_read_data(struct usb_line6 *line6, unsigned address, void *data,
2994 + 0x0013, 0x0000, data, datalen,
2995 + LINE6_TIMEOUT * HZ);
2996 +
2997 +- if (ret < 0) {
2998 ++ if (ret < 0)
2999 + dev_err(line6->ifcdev, "read failed (error %d)\n", ret);
3000 +- return ret;
3001 +- }
3002 +
3003 +- return 0;
3004 ++exit:
3005 ++ kfree(len);
3006 ++ return ret;
3007 + }
3008 + EXPORT_SYMBOL_GPL(line6_read_data);
3009 +
3010 +@@ -415,12 +420,16 @@ int line6_write_data(struct usb_line6 *line6, unsigned address, void *data,
3011 + {
3012 + struct usb_device *usbdev = line6->usbdev;
3013 + int ret;
3014 +- unsigned char status;
3015 ++ unsigned char *status;
3016 + int count;
3017 +
3018 + if (address > 0xffff || datalen > 0xffff)
3019 + return -EINVAL;
3020 +
3021 ++ status = kmalloc(sizeof(*status), GFP_KERNEL);
3022 ++ if (!status)
3023 ++ return -ENOMEM;
3024 ++
3025 + ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67,
3026 + USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
3027 + 0x0022, address, data, datalen,
3028 +@@ -429,7 +438,7 @@ int line6_write_data(struct usb_line6 *line6, unsigned address, void *data,
3029 + if (ret < 0) {
3030 + dev_err(line6->ifcdev,
3031 + "write request failed (error %d)\n", ret);
3032 +- return ret;
3033 ++ goto exit;
3034 + }
3035 +
3036 + for (count = 0; count < LINE6_READ_WRITE_MAX_RETRIES; count++) {
3037 +@@ -440,28 +449,29 @@ int line6_write_data(struct usb_line6 *line6, unsigned address, void *data,
3038 + USB_TYPE_VENDOR | USB_RECIP_DEVICE |
3039 + USB_DIR_IN,
3040 + 0x0012, 0x0000,
3041 +- &status, 1, LINE6_TIMEOUT * HZ);
3042 ++ status, 1, LINE6_TIMEOUT * HZ);
3043 +
3044 + if (ret < 0) {
3045 + dev_err(line6->ifcdev,
3046 + "receiving status failed (error %d)\n", ret);
3047 +- return ret;
3048 ++ goto exit;
3049 + }
3050 +
3051 +- if (status != 0xff)
3052 ++ if (*status != 0xff)
3053 + break;
3054 + }
3055 +
3056 +- if (status == 0xff) {
3057 ++ if (*status == 0xff) {
3058 + dev_err(line6->ifcdev, "write failed after %d retries\n",
3059 + count);
3060 +- return -EIO;
3061 +- } else if (status != 0) {
3062 ++ ret = -EIO;
3063 ++ } else if (*status != 0) {
3064 + dev_err(line6->ifcdev, "write failed (error %d)\n", ret);
3065 +- return -EIO;
3066 ++ ret = -EIO;
3067 + }
3068 +-
3069 +- return 0;
3070 ++exit:
3071 ++ kfree(status);
3072 ++ return ret;
3073 + }
3074 + EXPORT_SYMBOL_GPL(line6_write_data);
3075 +
3076 +diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c
3077 +index 451007c27743..ee6a68c6e1c1 100644
3078 +--- a/sound/usb/line6/podhd.c
3079 ++++ b/sound/usb/line6/podhd.c
3080 +@@ -224,28 +224,32 @@ static void podhd_startup_start_workqueue(unsigned long data)
3081 + static int podhd_dev_start(struct usb_line6_podhd *pod)
3082 + {
3083 + int ret;
3084 +- u8 init_bytes[8];
3085 ++ u8 *init_bytes;
3086 + int i;
3087 + struct usb_device *usbdev = pod->line6.usbdev;
3088 +
3089 ++ init_bytes = kmalloc(8, GFP_KERNEL);
3090 ++ if (!init_bytes)
3091 ++ return -ENOMEM;
3092 ++
3093 + ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0),
3094 + 0x67, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
3095 + 0x11, 0,
3096 + NULL, 0, LINE6_TIMEOUT * HZ);
3097 + if (ret < 0) {
3098 + dev_err(pod->line6.ifcdev, "read request failed (error %d)\n", ret);
3099 +- return ret;
3100 ++ goto exit;
3101 + }
3102 +
3103 + /* NOTE: looks like some kind of ping message */
3104 + ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev, 0), 0x67,
3105 + USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
3106 + 0x11, 0x0,
3107 +- &init_bytes, 3, LINE6_TIMEOUT * HZ);
3108 ++ init_bytes, 3, LINE6_TIMEOUT * HZ);
3109 + if (ret < 0) {
3110 + dev_err(pod->line6.ifcdev,
3111 + "receive length failed (error %d)\n", ret);
3112 +- return ret;
3113 ++ goto exit;
3114 + }
3115 +
3116 + pod->firmware_version =
3117 +@@ -254,7 +258,7 @@ static int podhd_dev_start(struct usb_line6_podhd *pod)
3118 + for (i = 0; i <= 16; i++) {
3119 + ret = line6_read_data(&pod->line6, 0xf000 + 0x08 * i, init_bytes, 8);
3120 + if (ret < 0)
3121 +- return ret;
3122 ++ goto exit;
3123 + }
3124 +
3125 + ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0),
3126 +@@ -262,10 +266,9 @@ static int podhd_dev_start(struct usb_line6_podhd *pod)
3127 + USB_TYPE_STANDARD | USB_RECIP_DEVICE | USB_DIR_OUT,
3128 + 1, 0,
3129 + NULL, 0, LINE6_TIMEOUT * HZ);
3130 +- if (ret < 0)
3131 +- return ret;
3132 +-
3133 +- return 0;
3134 ++exit:
3135 ++ kfree(init_bytes);
3136 ++ return ret;
3137 + }
3138 +
3139 + static void podhd_startup_workqueue(struct work_struct *work)
3140 +diff --git a/sound/usb/line6/toneport.c b/sound/usb/line6/toneport.c
3141 +index ba7975c0d03d..4bdedfa87487 100644
3142 +--- a/sound/usb/line6/toneport.c
3143 ++++ b/sound/usb/line6/toneport.c
3144 +@@ -365,15 +365,20 @@ static bool toneport_has_source_select(struct usb_line6_toneport *toneport)
3145 + /*
3146 + Setup Toneport device.
3147 + */
3148 +-static void toneport_setup(struct usb_line6_toneport *toneport)
3149 ++static int toneport_setup(struct usb_line6_toneport *toneport)
3150 + {
3151 +- int ticks;
3152 ++ int *ticks;
3153 + struct usb_line6 *line6 = &toneport->line6;
3154 + struct usb_device *usbdev = line6->usbdev;
3155 +
3156 ++ ticks = kmalloc(sizeof(*ticks), GFP_KERNEL);
3157 ++ if (!ticks)
3158 ++ return -ENOMEM;
3159 ++
3160 + /* sync time on device with host: */
3161 +- ticks = (int)get_seconds();
3162 +- line6_write_data(line6, 0x80c6, &ticks, 4);
3163 ++ *ticks = (int)get_seconds();
3164 ++ line6_write_data(line6, 0x80c6, ticks, 4);
3165 ++ kfree(ticks);
3166 +
3167 + /* enable device: */
3168 + toneport_send_cmd(usbdev, 0x0301, 0x0000);
3169 +@@ -388,6 +393,7 @@ static void toneport_setup(struct usb_line6_toneport *toneport)
3170 + toneport_update_led(toneport);
3171 +
3172 + mod_timer(&toneport->timer, jiffies + TONEPORT_PCM_DELAY * HZ);
3173 ++ return 0;
3174 + }
3175 +
3176 + /*
3177 +@@ -451,7 +457,9 @@ static int toneport_init(struct usb_line6 *line6,
3178 + return err;
3179 + }
3180 +
3181 +- toneport_setup(toneport);
3182 ++ err = toneport_setup(toneport);
3183 ++ if (err)
3184 ++ return err;
3185 +
3186 + /* register audio system: */
3187 + return snd_card_register(line6->card);
3188 +@@ -463,7 +471,11 @@ static int toneport_init(struct usb_line6 *line6,
3189 + */
3190 + static int toneport_reset_resume(struct usb_interface *interface)
3191 + {
3192 +- toneport_setup(usb_get_intfdata(interface));
3193 ++ int err;
3194 ++
3195 ++ err = toneport_setup(usb_get_intfdata(interface));
3196 ++ if (err)
3197 ++ return err;
3198 + return line6_resume(interface);
3199 + }
3200 + #endif