Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.4 commit in: /
Date: Fri, 24 Apr 2020 11:59:26
Message-Id: 1587729542.89170834145b2968b25fb8a55b3201b4411cd338.mpagano@gentoo
1 commit: 89170834145b2968b25fb8a55b3201b4411cd338
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 24 11:59:02 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 24 11:59:02 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=89170834
7
8 Linux patch 4.4.220
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1219_linux-4.4.220.patch | 2453 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2457 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 3d36ad7..5399fb2 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -919,6 +919,10 @@ Patch: 1218_linux-4.4.219.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.4.219
23
24 +Patch: 1219_linux-4.4.220.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.4.220
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/1219_linux-4.4.220.patch b/1219_linux-4.4.220.patch
33 new file mode 100644
34 index 0000000..1189c08
35 --- /dev/null
36 +++ b/1219_linux-4.4.220.patch
37 @@ -0,0 +1,2453 @@
38 +diff --git a/Makefile b/Makefile
39 +index 738ef5d8ec0f..bbe2b37b2d23 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,6 +1,6 @@
43 + VERSION = 4
44 + PATCHLEVEL = 4
45 +-SUBLEVEL = 219
46 ++SUBLEVEL = 220
47 + EXTRAVERSION =
48 + NAME = Blurry Fish Butt
49 +
50 +diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c
51 +index 478a00b9732b..47d3ec6cd7ed 100644
52 +--- a/arch/arm64/kernel/armv8_deprecated.c
53 ++++ b/arch/arm64/kernel/armv8_deprecated.c
54 +@@ -605,7 +605,7 @@ static struct undef_hook setend_hooks[] = {
55 + },
56 + {
57 + /* Thumb mode */
58 +- .instr_mask = 0x0000fff7,
59 ++ .instr_mask = 0xfffffff7,
60 + .instr_val = 0x0000b650,
61 + .pstate_mask = (COMPAT_PSR_T_BIT | COMPAT_PSR_MODE_MASK),
62 + .pstate_val = (COMPAT_PSR_T_BIT | COMPAT_PSR_MODE_USR),
63 +diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
64 +index 63d35076722d..ed7c4f1fc6a0 100644
65 +--- a/arch/mips/cavium-octeon/octeon-irq.c
66 ++++ b/arch/mips/cavium-octeon/octeon-irq.c
67 +@@ -2168,6 +2168,9 @@ static int octeon_irq_cib_map(struct irq_domain *d,
68 + }
69 +
70 + cd = kzalloc(sizeof(*cd), GFP_KERNEL);
71 ++ if (!cd)
72 ++ return -ENOMEM;
73 ++
74 + cd->host_data = host_data;
75 + cd->bit = hw;
76 +
77 +diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
78 +index 8be659db0319..aaf784ad2853 100644
79 +--- a/arch/powerpc/kernel/signal_64.c
80 ++++ b/arch/powerpc/kernel/signal_64.c
81 +@@ -462,8 +462,10 @@ static long restore_tm_sigcontexts(struct pt_regs *regs,
82 + err |= __get_user(current->thread.ckpt_regs.ccr,
83 + &sc->gp_regs[PT_CCR]);
84 +
85 ++ /* Don't allow userspace to set the trap value */
86 ++ regs->trap = 0;
87 ++
88 + /* These regs are not checkpointed; they can go in 'regs'. */
89 +- err |= __get_user(regs->trap, &sc->gp_regs[PT_TRAP]);
90 + err |= __get_user(regs->dar, &sc->gp_regs[PT_DAR]);
91 + err |= __get_user(regs->dsisr, &sc->gp_regs[PT_DSISR]);
92 + err |= __get_user(regs->result, &sc->gp_regs[PT_RESULT]);
93 +diff --git a/arch/powerpc/mm/tlb_nohash_low.S b/arch/powerpc/mm/tlb_nohash_low.S
94 +index 68c477592e43..6e6a10bf3907 100644
95 +--- a/arch/powerpc/mm/tlb_nohash_low.S
96 ++++ b/arch/powerpc/mm/tlb_nohash_low.S
97 +@@ -400,7 +400,7 @@ _GLOBAL(set_context)
98 + * extern void loadcam_entry(unsigned int index)
99 + *
100 + * Load TLBCAM[index] entry in to the L2 CAM MMU
101 +- * Must preserve r7, r8, r9, and r10
102 ++ * Must preserve r7, r8, r9, r10 and r11
103 + */
104 + _GLOBAL(loadcam_entry)
105 + mflr r5
106 +@@ -436,6 +436,10 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS)
107 + */
108 + _GLOBAL(loadcam_multi)
109 + mflr r8
110 ++ /* Don't switch to AS=1 if already there */
111 ++ mfmsr r11
112 ++ andi. r11,r11,MSR_IS
113 ++ bne 10f
114 +
115 + /*
116 + * Set up temporary TLB entry that is the same as what we're
117 +@@ -461,6 +465,7 @@ _GLOBAL(loadcam_multi)
118 + mtmsr r6
119 + isync
120 +
121 ++10:
122 + mr r9,r3
123 + add r10,r3,r4
124 + 2: bl loadcam_entry
125 +@@ -469,6 +474,10 @@ _GLOBAL(loadcam_multi)
126 + mr r3,r9
127 + blt 2b
128 +
129 ++ /* Don't return to AS=0 if we were in AS=1 at function start */
130 ++ andi. r11,r11,MSR_IS
131 ++ bne 3f
132 ++
133 + /* Return to AS=0 and clear the temporary entry */
134 + mfmsr r6
135 + rlwinm. r6,r6,0,~(MSR_IS|MSR_DS)
136 +@@ -484,6 +493,7 @@ _GLOBAL(loadcam_multi)
137 + tlbwe
138 + isync
139 +
140 ++3:
141 + mtlr r8
142 + blr
143 + #endif
144 +diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c
145 +index 48b37b8357e6..1292b1dc5864 100644
146 +--- a/arch/s390/kernel/diag.c
147 ++++ b/arch/s390/kernel/diag.c
148 +@@ -76,7 +76,7 @@ static int show_diag_stat(struct seq_file *m, void *v)
149 +
150 + static void *show_diag_stat_start(struct seq_file *m, loff_t *pos)
151 + {
152 +- return *pos <= nr_cpu_ids ? (void *)((unsigned long) *pos + 1) : NULL;
153 ++ return *pos <= NR_DIAG_STAT ? (void *)((unsigned long) *pos + 1) : NULL;
154 + }
155 +
156 + static void *show_diag_stat_next(struct seq_file *m, void *v, loff_t *pos)
157 +diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
158 +index 0256064da8da..0eca7f2087b1 100644
159 +--- a/arch/x86/boot/compressed/head_32.S
160 ++++ b/arch/x86/boot/compressed/head_32.S
161 +@@ -170,7 +170,7 @@ preferred_addr:
162 + notl %eax
163 + andl %eax, %ebx
164 + cmpl $LOAD_PHYSICAL_ADDR, %ebx
165 +- jge 1f
166 ++ jae 1f
167 + #endif
168 + movl $LOAD_PHYSICAL_ADDR, %ebx
169 + 1:
170 +diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
171 +index b831e24f7168..ca8151ef3bfa 100644
172 +--- a/arch/x86/boot/compressed/head_64.S
173 ++++ b/arch/x86/boot/compressed/head_64.S
174 +@@ -104,7 +104,7 @@ ENTRY(startup_32)
175 + notl %eax
176 + andl %eax, %ebx
177 + cmpl $LOAD_PHYSICAL_ADDR, %ebx
178 +- jge 1f
179 ++ jae 1f
180 + #endif
181 + movl $LOAD_PHYSICAL_ADDR, %ebx
182 + 1:
183 +@@ -337,7 +337,7 @@ preferred_addr:
184 + notq %rax
185 + andq %rax, %rbp
186 + cmpq $LOAD_PHYSICAL_ADDR, %rbp
187 +- jge 1f
188 ++ jae 1f
189 + #endif
190 + movq $LOAD_PHYSICAL_ADDR, %rbp
191 + 1:
192 +diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
193 +index 49a8c9f7a379..575c9afeba9b 100644
194 +--- a/arch/x86/entry/entry_32.S
195 ++++ b/arch/x86/entry/entry_32.S
196 +@@ -1071,6 +1071,7 @@ ENTRY(int3)
197 + END(int3)
198 +
199 + ENTRY(general_protection)
200 ++ ASM_CLAC
201 + pushl $do_general_protection
202 + jmp error_code
203 + END(general_protection)
204 +diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
205 +index afb805b0148b..6b505d91cac5 100644
206 +--- a/arch/x86/entry/entry_64.S
207 ++++ b/arch/x86/entry/entry_64.S
208 +@@ -218,6 +218,8 @@ entry_SYSCALL_64_fastpath:
209 + testl $_TIF_ALLWORK_MASK, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS)
210 + jnz int_ret_from_sys_call_irqs_off /* Go to the slow path */
211 +
212 ++ call mds_user_clear_buffers
213 ++
214 + movq RIP(%rsp), %rcx
215 + movq EFLAGS(%rsp), %r11
216 + RESTORE_C_REGS_EXCEPT_RCX_R11
217 +diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h
218 +index 90343ba50485..92ce9c8a508b 100644
219 +--- a/arch/x86/include/asm/microcode_intel.h
220 ++++ b/arch/x86/include/asm/microcode_intel.h
221 +@@ -60,7 +60,7 @@ static inline u32 intel_get_microcode_revision(void)
222 + native_wrmsrl(MSR_IA32_UCODE_REV, 0);
223 +
224 + /* As documented in the SDM: Do a CPUID 1 here */
225 +- sync_core();
226 ++ native_cpuid_eax(1);
227 +
228 + /* get the current revision from MSR 0x8B */
229 + native_rdmsr(MSR_IA32_UCODE_REV, dummy, rev);
230 +diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
231 +index cac54e61c299..048942d53988 100644
232 +--- a/arch/x86/include/asm/processor.h
233 ++++ b/arch/x86/include/asm/processor.h
234 +@@ -212,6 +212,24 @@ static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
235 + : "memory");
236 + }
237 +
238 ++#define native_cpuid_reg(reg) \
239 ++static inline unsigned int native_cpuid_##reg(unsigned int op) \
240 ++{ \
241 ++ unsigned int eax = op, ebx, ecx = 0, edx; \
242 ++ \
243 ++ native_cpuid(&eax, &ebx, &ecx, &edx); \
244 ++ \
245 ++ return reg; \
246 ++}
247 ++
248 ++/*
249 ++ * Native CPUID functions returning a single datum.
250 ++ */
251 ++native_cpuid_reg(eax)
252 ++native_cpuid_reg(ebx)
253 ++native_cpuid_reg(ecx)
254 ++native_cpuid_reg(edx)
255 ++
256 + static inline void load_cr3(pgd_t *pgdir)
257 + {
258 + write_cr3(__pa(pgdir));
259 +diff --git a/arch/x86/include/asm/spec-ctrl.h b/arch/x86/include/asm/spec-ctrl.h
260 +index 5393babc0598..4a7acb4adc6b 100644
261 +--- a/arch/x86/include/asm/spec-ctrl.h
262 ++++ b/arch/x86/include/asm/spec-ctrl.h
263 +@@ -85,4 +85,6 @@ static inline void speculative_store_bypass_ht_init(void) { }
264 + extern void speculation_ctrl_update(unsigned long tif);
265 + extern void speculation_ctrl_update_current(void);
266 +
267 ++extern void mds_user_clear_buffers(void);
268 ++
269 + #endif
270 +diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h
271 +index 51e7533bbf79..ef342818fcf1 100644
272 +--- a/arch/x86/include/asm/vgtod.h
273 ++++ b/arch/x86/include/asm/vgtod.h
274 +@@ -86,7 +86,7 @@ static inline unsigned int __getcpu(void)
275 + *
276 + * If RDPID is available, use it.
277 + */
278 +- alternative_io ("lsl %[p],%[seg]",
279 ++ alternative_io ("lsl %[seg],%[p]",
280 + ".byte 0xf3,0x0f,0xc7,0xf8", /* RDPID %eax/rax */
281 + X86_FEATURE_RDPID,
282 + [p] "=a" (p), [seg] "r" (__PER_CPU_SEG));
283 +diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
284 +index a1e4a6c3f394..2222f39a6170 100644
285 +--- a/arch/x86/kernel/acpi/boot.c
286 ++++ b/arch/x86/kernel/acpi/boot.c
287 +@@ -1708,7 +1708,7 @@ int __acpi_acquire_global_lock(unsigned int *lock)
288 + new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
289 + val = cmpxchg(lock, old, new);
290 + } while (unlikely (val != old));
291 +- return (new < 3) ? -1 : 0;
292 ++ return ((new & 0x3) < 3) ? -1 : 0;
293 + }
294 +
295 + int __acpi_release_global_lock(unsigned int *lock)
296 +diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
297 +index e9aa50ba4f97..950e6bb21955 100644
298 +--- a/arch/x86/kernel/cpu/bugs.c
299 ++++ b/arch/x86/kernel/cpu/bugs.c
300 +@@ -263,6 +263,11 @@ static int __init mds_cmdline(char *str)
301 + }
302 + early_param("mds", mds_cmdline);
303 +
304 ++void mds_user_clear_buffers(void)
305 ++{
306 ++ mds_user_clear_cpu_buffers();
307 ++}
308 ++
309 + #undef pr_fmt
310 + #define pr_fmt(fmt) "TAA: " fmt
311 +
312 +diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
313 +index f876414ca8a3..13bda3fcf42b 100644
314 +--- a/arch/x86/kvm/cpuid.c
315 ++++ b/arch/x86/kvm/cpuid.c
316 +@@ -457,7 +457,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
317 + entry->edx |= F(SPEC_CTRL);
318 + if (boot_cpu_has(X86_FEATURE_STIBP))
319 + entry->edx |= F(INTEL_STIBP);
320 +- if (boot_cpu_has(X86_FEATURE_SSBD))
321 ++ if (boot_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) ||
322 ++ boot_cpu_has(X86_FEATURE_AMD_SSBD))
323 + entry->edx |= F(SPEC_CTRL_SSBD);
324 + /*
325 + * We emulate ARCH_CAPABILITIES in software even
326 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
327 +index 21fb707546b6..3adc255e69cb 100644
328 +--- a/arch/x86/kvm/x86.c
329 ++++ b/arch/x86/kvm/x86.c
330 +@@ -7982,6 +7982,13 @@ int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot,
331 + {
332 + int i;
333 +
334 ++ /*
335 ++ * Clear out the previous array pointers for the KVM_MR_MOVE case. The
336 ++ * old arrays will be freed by __kvm_set_memory_region() if installing
337 ++ * the new memslot is successful.
338 ++ */
339 ++ memset(&slot->arch, 0, sizeof(slot->arch));
340 ++
341 + for (i = 0; i < KVM_NR_PAGE_SIZES; ++i) {
342 + unsigned long ugfn;
343 + int lpages;
344 +@@ -8050,6 +8057,10 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
345 + const struct kvm_userspace_memory_region *mem,
346 + enum kvm_mr_change change)
347 + {
348 ++ if (change == KVM_MR_MOVE)
349 ++ return kvm_arch_create_memslot(kvm, memslot,
350 ++ mem->memory_size >> PAGE_SHIFT);
351 ++
352 + return 0;
353 + }
354 +
355 +diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
356 +index 85aa76116a30..7924d0635718 100644
357 +--- a/drivers/ata/libata-pmp.c
358 ++++ b/drivers/ata/libata-pmp.c
359 +@@ -764,6 +764,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
360 +
361 + if (dev->flags & ATA_DFLAG_DETACH) {
362 + detach = 1;
363 ++ rc = -ENODEV;
364 + goto fail;
365 + }
366 +
367 +diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
368 +index a44aeda57109..59dc033408be 100644
369 +--- a/drivers/ata/libata-scsi.c
370 ++++ b/drivers/ata/libata-scsi.c
371 +@@ -3720,22 +3720,19 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht)
372 + */
373 + shost->max_host_blocked = 1;
374 +
375 +- rc = scsi_add_host_with_dma(ap->scsi_host,
376 +- &ap->tdev, ap->host->dev);
377 ++ rc = scsi_add_host_with_dma(shost, &ap->tdev, ap->host->dev);
378 + if (rc)
379 +- goto err_add;
380 ++ goto err_alloc;
381 + }
382 +
383 + return 0;
384 +
385 +- err_add:
386 +- scsi_host_put(host->ports[i]->scsi_host);
387 + err_alloc:
388 + while (--i >= 0) {
389 + struct Scsi_Host *shost = host->ports[i]->scsi_host;
390 +
391 ++ /* scsi_host_put() is in ata_devres_release() */
392 + scsi_remove_host(shost);
393 +- scsi_host_put(shost);
394 + }
395 + return rc;
396 + }
397 +diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
398 +index 0ffb247b42d6..d45f48de42a0 100644
399 +--- a/drivers/bus/sunxi-rsb.c
400 ++++ b/drivers/bus/sunxi-rsb.c
401 +@@ -345,7 +345,7 @@ static int sunxi_rsb_read(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr,
402 + if (ret)
403 + goto unlock;
404 +
405 +- *buf = readl(rsb->regs + RSB_DATA);
406 ++ *buf = readl(rsb->regs + RSB_DATA) & GENMASK(len * 8 - 1, 0);
407 +
408 + unlock:
409 + mutex_unlock(&rsb->lock);
410 +diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
411 +index 5cb5e8ff0224..7b8c1a64a100 100644
412 +--- a/drivers/char/ipmi/ipmi_msghandler.c
413 ++++ b/drivers/char/ipmi/ipmi_msghandler.c
414 +@@ -2645,7 +2645,9 @@ get_guid(ipmi_smi_t intf)
415 + if (rv)
416 + /* Send failed, no GUID available. */
417 + intf->bmc->guid_set = 0;
418 +- wait_event(intf->waitq, intf->bmc->guid_set != 2);
419 ++ else
420 ++ wait_event(intf->waitq, intf->bmc->guid_set != 2);
421 ++
422 + intf->null_user_handler = NULL;
423 + }
424 +
425 +diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c
426 +index 8ab8502778a2..55e09641b491 100644
427 +--- a/drivers/clk/at91/clk-usb.c
428 ++++ b/drivers/clk/at91/clk-usb.c
429 +@@ -79,6 +79,9 @@ static int at91sam9x5_clk_usb_determine_rate(struct clk_hw *hw,
430 + tmp_parent_rate = req->rate * div;
431 + tmp_parent_rate = clk_hw_round_rate(parent,
432 + tmp_parent_rate);
433 ++ if (!tmp_parent_rate)
434 ++ continue;
435 ++
436 + tmp_rate = DIV_ROUND_CLOSEST(tmp_parent_rate, div);
437 + if (tmp_rate < req->rate)
438 + tmp_diff = req->rate - tmp_rate;
439 +diff --git a/drivers/clk/tegra/clk-tegra-pmc.c b/drivers/clk/tegra/clk-tegra-pmc.c
440 +index 91377abfefa1..17a04300f93b 100644
441 +--- a/drivers/clk/tegra/clk-tegra-pmc.c
442 ++++ b/drivers/clk/tegra/clk-tegra-pmc.c
443 +@@ -60,16 +60,16 @@ struct pmc_clk_init_data {
444 +
445 + static DEFINE_SPINLOCK(clk_out_lock);
446 +
447 +-static const char *clk_out1_parents[] = { "clk_m", "clk_m_div2",
448 +- "clk_m_div4", "extern1",
449 ++static const char *clk_out1_parents[] = { "osc", "osc_div2",
450 ++ "osc_div4", "extern1",
451 + };
452 +
453 +-static const char *clk_out2_parents[] = { "clk_m", "clk_m_div2",
454 +- "clk_m_div4", "extern2",
455 ++static const char *clk_out2_parents[] = { "osc", "osc_div2",
456 ++ "osc_div4", "extern2",
457 + };
458 +
459 +-static const char *clk_out3_parents[] = { "clk_m", "clk_m_div2",
460 +- "clk_m_div4", "extern3",
461 ++static const char *clk_out3_parents[] = { "osc", "osc_div2",
462 ++ "osc_div4", "extern3",
463 + };
464 +
465 + static struct pmc_clk_init_data pmc_clks[] = {
466 +diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
467 +index 4b82cf9da0ba..68836939f934 100644
468 +--- a/drivers/crypto/mxs-dcp.c
469 ++++ b/drivers/crypto/mxs-dcp.c
470 +@@ -25,6 +25,7 @@
471 + #include <crypto/aes.h>
472 + #include <crypto/sha.h>
473 + #include <crypto/internal/hash.h>
474 ++#include <crypto/scatterwalk.h>
475 +
476 + #define DCP_MAX_CHANS 4
477 + #define DCP_BUF_SZ PAGE_SIZE
478 +@@ -626,49 +627,46 @@ static int dcp_sha_req_to_buf(struct crypto_async_request *arq)
479 + struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm);
480 + struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req);
481 + struct hash_alg_common *halg = crypto_hash_alg_common(tfm);
482 +- const int nents = sg_nents(req->src);
483 +
484 + uint8_t *in_buf = sdcp->coh->sha_in_buf;
485 + uint8_t *out_buf = sdcp->coh->sha_out_buf;
486 +
487 +- uint8_t *src_buf;
488 +-
489 + struct scatterlist *src;
490 +
491 +- unsigned int i, len, clen;
492 ++ unsigned int i, len, clen, oft = 0;
493 + int ret;
494 +
495 + int fin = rctx->fini;
496 + if (fin)
497 + rctx->fini = 0;
498 +
499 +- for_each_sg(req->src, src, nents, i) {
500 +- src_buf = sg_virt(src);
501 +- len = sg_dma_len(src);
502 +-
503 +- do {
504 +- if (actx->fill + len > DCP_BUF_SZ)
505 +- clen = DCP_BUF_SZ - actx->fill;
506 +- else
507 +- clen = len;
508 +-
509 +- memcpy(in_buf + actx->fill, src_buf, clen);
510 +- len -= clen;
511 +- src_buf += clen;
512 +- actx->fill += clen;
513 ++ src = req->src;
514 ++ len = req->nbytes;
515 +
516 +- /*
517 +- * If we filled the buffer and still have some
518 +- * more data, submit the buffer.
519 +- */
520 +- if (len && actx->fill == DCP_BUF_SZ) {
521 +- ret = mxs_dcp_run_sha(req);
522 +- if (ret)
523 +- return ret;
524 +- actx->fill = 0;
525 +- rctx->init = 0;
526 +- }
527 +- } while (len);
528 ++ while (len) {
529 ++ if (actx->fill + len > DCP_BUF_SZ)
530 ++ clen = DCP_BUF_SZ - actx->fill;
531 ++ else
532 ++ clen = len;
533 ++
534 ++ scatterwalk_map_and_copy(in_buf + actx->fill, src, oft, clen,
535 ++ 0);
536 ++
537 ++ len -= clen;
538 ++ oft += clen;
539 ++ actx->fill += clen;
540 ++
541 ++ /*
542 ++ * If we filled the buffer and still have some
543 ++ * more data, submit the buffer.
544 ++ */
545 ++ if (len && actx->fill == DCP_BUF_SZ) {
546 ++ ret = mxs_dcp_run_sha(req);
547 ++ if (ret)
548 ++ return ret;
549 ++ actx->fill = 0;
550 ++ rctx->init = 0;
551 ++ }
552 + }
553 +
554 + if (fin) {
555 +diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
556 +index f5229b083f8e..bb25abba7ad0 100644
557 +--- a/drivers/gpu/drm/drm_dp_mst_topology.c
558 ++++ b/drivers/gpu/drm/drm_dp_mst_topology.c
559 +@@ -1036,10 +1036,12 @@ static bool drm_dp_port_setup_pdt(struct drm_dp_mst_port *port)
560 + lct = drm_dp_calculate_rad(port, rad);
561 +
562 + port->mstb = drm_dp_add_mst_branch_device(lct, rad);
563 +- port->mstb->mgr = port->mgr;
564 +- port->mstb->port_parent = port;
565 ++ if (port->mstb) {
566 ++ port->mstb->mgr = port->mgr;
567 ++ port->mstb->port_parent = port;
568 +
569 +- send_link = true;
570 ++ send_link = true;
571 ++ }
572 + break;
573 + }
574 + return send_link;
575 +@@ -2031,6 +2033,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms
576 + int ret = 0;
577 + struct drm_dp_mst_branch *mstb = NULL;
578 +
579 ++ mutex_lock(&mgr->payload_lock);
580 + mutex_lock(&mgr->lock);
581 + if (mst_state == mgr->mst_state)
582 + goto out_unlock;
583 +@@ -2093,7 +2096,10 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms
584 + /* this can fail if the device is gone */
585 + drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, 0);
586 + ret = 0;
587 +- memset(mgr->payloads, 0, mgr->max_payloads * sizeof(struct drm_dp_payload));
588 ++ memset(mgr->payloads, 0,
589 ++ mgr->max_payloads * sizeof(mgr->payloads[0]));
590 ++ memset(mgr->proposed_vcpis, 0,
591 ++ mgr->max_payloads * sizeof(mgr->proposed_vcpis[0]));
592 + mgr->payload_mask = 0;
593 + set_bit(0, &mgr->payload_mask);
594 + mgr->vcpi_mask = 0;
595 +@@ -2101,6 +2107,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms
596 +
597 + out_unlock:
598 + mutex_unlock(&mgr->lock);
599 ++ mutex_unlock(&mgr->payload_lock);
600 + if (mstb)
601 + drm_dp_put_mst_branch_device(mstb);
602 + return ret;
603 +diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c
604 +index 25020ec777c9..ee0a7d3dd0c6 100644
605 +--- a/drivers/i2c/busses/i2c-st.c
606 ++++ b/drivers/i2c/busses/i2c-st.c
607 +@@ -399,6 +399,7 @@ static void st_i2c_wr_fill_tx_fifo(struct st_i2c_dev *i2c_dev)
608 + /**
609 + * st_i2c_rd_fill_tx_fifo() - Fill the Tx FIFO in read mode
610 + * @i2c_dev: Controller's private data
611 ++ * @max: Maximum amount of data to fill into the Tx FIFO
612 + *
613 + * This functions fills the Tx FIFO with fixed pattern when
614 + * in read mode to trigger clock.
615 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
616 +index f6b06729f4ea..ffd88af80de3 100644
617 +--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
618 ++++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
619 +@@ -1057,13 +1057,10 @@ static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv,
620 + ipoib_ib_dev_down(dev);
621 +
622 + if (level == IPOIB_FLUSH_HEAVY) {
623 +- rtnl_lock();
624 + if (test_bit(IPOIB_FLAG_INITIALIZED, &priv->flags))
625 + ipoib_ib_dev_stop(dev);
626 +
627 +- result = ipoib_ib_dev_open(dev);
628 +- rtnl_unlock();
629 +- if (result)
630 ++ if (ipoib_ib_dev_open(dev))
631 + return;
632 +
633 + if (netif_queue_stopped(dev))
634 +@@ -1102,7 +1099,9 @@ void ipoib_ib_dev_flush_heavy(struct work_struct *work)
635 + struct ipoib_dev_priv *priv =
636 + container_of(work, struct ipoib_dev_priv, flush_heavy);
637 +
638 ++ rtnl_lock();
639 + __ipoib_ib_dev_flush(priv, IPOIB_FLUSH_HEAVY, 0);
640 ++ rtnl_unlock();
641 + }
642 +
643 + void ipoib_ib_dev_cleanup(struct net_device *dev)
644 +diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
645 +index 34be09651ee8..a4e76084a2af 100644
646 +--- a/drivers/input/serio/i8042-x86ia64io.h
647 ++++ b/drivers/input/serio/i8042-x86ia64io.h
648 +@@ -534,6 +534,17 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
649 + DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"),
650 + },
651 + },
652 ++ {
653 ++ /*
654 ++ * Acer Aspire 5738z
655 ++ * Touchpad stops working in mux mode when dis- + re-enabled
656 ++ * with the touchpad enable/disable toggle hotkey
657 ++ */
658 ++ .matches = {
659 ++ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
660 ++ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"),
661 ++ },
662 ++ },
663 + { }
664 + };
665 +
666 +diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
667 +index b08cf57bf455..695d4e235438 100644
668 +--- a/drivers/iommu/amd_iommu_types.h
669 ++++ b/drivers/iommu/amd_iommu_types.h
670 +@@ -303,7 +303,7 @@
671 +
672 + #define DTE_GCR3_VAL_A(x) (((x) >> 12) & 0x00007ULL)
673 + #define DTE_GCR3_VAL_B(x) (((x) >> 15) & 0x0ffffULL)
674 +-#define DTE_GCR3_VAL_C(x) (((x) >> 31) & 0xfffffULL)
675 ++#define DTE_GCR3_VAL_C(x) (((x) >> 31) & 0x1fffffULL)
676 +
677 + #define DTE_GCR3_INDEX_A 0
678 + #define DTE_GCR3_INDEX_B 1
679 +diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c
680 +index cadf104e3074..08b66b25f845 100644
681 +--- a/drivers/irqchip/irq-versatile-fpga.c
682 ++++ b/drivers/irqchip/irq-versatile-fpga.c
683 +@@ -5,6 +5,7 @@
684 + #include <linux/irq.h>
685 + #include <linux/io.h>
686 + #include <linux/irqchip.h>
687 ++#include <linux/irqchip/chained_irq.h>
688 + #include <linux/irqchip/versatile-fpga.h>
689 + #include <linux/irqdomain.h>
690 + #include <linux/module.h>
691 +@@ -67,12 +68,16 @@ static void fpga_irq_unmask(struct irq_data *d)
692 +
693 + static void fpga_irq_handle(struct irq_desc *desc)
694 + {
695 ++ struct irq_chip *chip = irq_desc_get_chip(desc);
696 + struct fpga_irq_data *f = irq_desc_get_handler_data(desc);
697 +- u32 status = readl(f->base + IRQ_STATUS);
698 ++ u32 status;
699 ++
700 ++ chained_irq_enter(chip, desc);
701 +
702 ++ status = readl(f->base + IRQ_STATUS);
703 + if (status == 0) {
704 + do_bad_IRQ(desc);
705 +- return;
706 ++ goto out;
707 + }
708 +
709 + do {
710 +@@ -81,6 +86,9 @@ static void fpga_irq_handle(struct irq_desc *desc)
711 + status &= ~(1 << irq);
712 + generic_handle_irq(irq_find_mapping(f->domain, irq));
713 + } while (status);
714 ++
715 ++out:
716 ++ chained_irq_exit(chip, desc);
717 + }
718 +
719 + /*
720 +@@ -203,6 +211,9 @@ int __init fpga_irq_of_init(struct device_node *node,
721 + if (of_property_read_u32(node, "valid-mask", &valid_mask))
722 + valid_mask = 0;
723 +
724 ++ writel(clear_mask, base + IRQ_ENABLE_CLEAR);
725 ++ writel(clear_mask, base + FIQ_ENABLE_CLEAR);
726 ++
727 + /* Some chips are cascaded from a parent IRQ */
728 + parent_irq = irq_of_parse_and_map(node, 0);
729 + if (!parent_irq) {
730 +@@ -217,9 +228,6 @@ int __init fpga_irq_of_init(struct device_node *node,
731 + fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node);
732 + #endif
733 +
734 +- writel(clear_mask, base + IRQ_ENABLE_CLEAR);
735 +- writel(clear_mask, base + FIQ_ENABLE_CLEAR);
736 +-
737 + /*
738 + * On Versatile AB/PB, some secondary interrupts have a direct
739 + * pass-thru to the primary controller for IRQs 20 and 22-31 which need
740 +diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c
741 +index 78f403b45ab3..bf82e4ccb584 100644
742 +--- a/drivers/md/dm-flakey.c
743 ++++ b/drivers/md/dm-flakey.c
744 +@@ -69,6 +69,11 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc,
745 + arg_name = dm_shift_arg(as);
746 + argc--;
747 +
748 ++ if (!arg_name) {
749 ++ ti->error = "Insufficient feature arguments";
750 ++ return -EINVAL;
751 ++ }
752 ++
753 + /*
754 + * drop_writes
755 + */
756 +diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
757 +index 95d0f2df0ad4..672831d5ee32 100644
758 +--- a/drivers/mfd/dln2.c
759 ++++ b/drivers/mfd/dln2.c
760 +@@ -93,6 +93,11 @@ struct dln2_mod_rx_slots {
761 + spinlock_t lock;
762 + };
763 +
764 ++enum dln2_endpoint {
765 ++ DLN2_EP_OUT = 0,
766 ++ DLN2_EP_IN = 1,
767 ++};
768 ++
769 + struct dln2_dev {
770 + struct usb_device *usb_dev;
771 + struct usb_interface *interface;
772 +@@ -740,10 +745,10 @@ static int dln2_probe(struct usb_interface *interface,
773 + hostif->desc.bNumEndpoints < 2)
774 + return -ENODEV;
775 +
776 +- epin = &hostif->endpoint[0].desc;
777 +- epout = &hostif->endpoint[1].desc;
778 ++ epout = &hostif->endpoint[DLN2_EP_OUT].desc;
779 + if (!usb_endpoint_is_bulk_out(epout))
780 + return -ENODEV;
781 ++ epin = &hostif->endpoint[DLN2_EP_IN].desc;
782 + if (!usb_endpoint_is_bulk_in(epin))
783 + return -ENODEV;
784 +
785 +diff --git a/drivers/mfd/rts5227.c b/drivers/mfd/rts5227.c
786 +index ff296a4bf3d2..dc6a9432a4b6 100644
787 +--- a/drivers/mfd/rts5227.c
788 ++++ b/drivers/mfd/rts5227.c
789 +@@ -369,6 +369,7 @@ static const struct pcr_ops rts522a_pcr_ops = {
790 + void rts522a_init_params(struct rtsx_pcr *pcr)
791 + {
792 + rts5227_init_params(pcr);
793 ++ pcr->ops = &rts522a_pcr_ops;
794 +
795 + pcr->reg_pm_ctrl3 = RTS522A_PM_CTRL3;
796 + }
797 +diff --git a/drivers/misc/echo/echo.c b/drivers/misc/echo/echo.c
798 +index 9597e9523cac..fff13176f9b8 100644
799 +--- a/drivers/misc/echo/echo.c
800 ++++ b/drivers/misc/echo/echo.c
801 +@@ -454,7 +454,7 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx)
802 + */
803 + ec->factor = 0;
804 + ec->shift = 0;
805 +- if ((ec->nonupdate_dwell == 0)) {
806 ++ if (!ec->nonupdate_dwell) {
807 + int p, logp, shift;
808 +
809 + /* Determine:
810 +diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
811 +index 8b66e52ca3cc..9734e6903fe6 100644
812 +--- a/drivers/mtd/devices/phram.c
813 ++++ b/drivers/mtd/devices/phram.c
814 +@@ -247,22 +247,25 @@ static int phram_setup(const char *val)
815 +
816 + ret = parse_num64(&start, token[1]);
817 + if (ret) {
818 +- kfree(name);
819 + parse_err("illegal start address\n");
820 ++ goto error;
821 + }
822 +
823 + ret = parse_num64(&len, token[2]);
824 + if (ret) {
825 +- kfree(name);
826 + parse_err("illegal device length\n");
827 ++ goto error;
828 + }
829 +
830 + ret = register_device(name, start, len);
831 +- if (!ret)
832 +- pr_info("%s device: %#llx at %#llx\n", name, len, start);
833 +- else
834 +- kfree(name);
835 ++ if (ret)
836 ++ goto error;
837 ++
838 ++ pr_info("%s device: %#llx at %#llx\n", name, len, start);
839 ++ return 0;
840 +
841 ++error:
842 ++ kfree(name);
843 + return ret;
844 + }
845 +
846 +diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c
847 +index 018c75faadb3..e1c283ccbbde 100644
848 +--- a/drivers/mtd/lpddr/lpddr_cmds.c
849 ++++ b/drivers/mtd/lpddr/lpddr_cmds.c
850 +@@ -81,7 +81,6 @@ struct mtd_info *lpddr_cmdset(struct map_info *map)
851 + shared = kmalloc(sizeof(struct flchip_shared) * lpddr->numchips,
852 + GFP_KERNEL);
853 + if (!shared) {
854 +- kfree(lpddr);
855 + kfree(mtd);
856 + return NULL;
857 + }
858 +diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.h b/drivers/net/ethernet/neterion/vxge/vxge-config.h
859 +index 6ce4412fcc1a..380e841fdd95 100644
860 +--- a/drivers/net/ethernet/neterion/vxge/vxge-config.h
861 ++++ b/drivers/net/ethernet/neterion/vxge/vxge-config.h
862 +@@ -2065,7 +2065,7 @@ vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);
863 + if ((level >= VXGE_ERR && VXGE_COMPONENT_LL & VXGE_DEBUG_ERR_MASK) || \
864 + (level >= VXGE_TRACE && VXGE_COMPONENT_LL & VXGE_DEBUG_TRACE_MASK))\
865 + if ((mask & VXGE_DEBUG_MASK) == mask) \
866 +- printk(fmt "\n", __VA_ARGS__); \
867 ++ printk(fmt "\n", ##__VA_ARGS__); \
868 + } while (0)
869 + #else
870 + #define vxge_debug_ll(level, mask, fmt, ...)
871 +diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.h b/drivers/net/ethernet/neterion/vxge/vxge-main.h
872 +index 3a79d93b8445..5b535aa10d23 100644
873 +--- a/drivers/net/ethernet/neterion/vxge/vxge-main.h
874 ++++ b/drivers/net/ethernet/neterion/vxge/vxge-main.h
875 +@@ -454,49 +454,49 @@ int vxge_fw_upgrade(struct vxgedev *vdev, char *fw_name, int override);
876 +
877 + #if (VXGE_DEBUG_LL_CONFIG & VXGE_DEBUG_MASK)
878 + #define vxge_debug_ll_config(level, fmt, ...) \
879 +- vxge_debug_ll(level, VXGE_DEBUG_LL_CONFIG, fmt, __VA_ARGS__)
880 ++ vxge_debug_ll(level, VXGE_DEBUG_LL_CONFIG, fmt, ##__VA_ARGS__)
881 + #else
882 + #define vxge_debug_ll_config(level, fmt, ...)
883 + #endif
884 +
885 + #if (VXGE_DEBUG_INIT & VXGE_DEBUG_MASK)
886 + #define vxge_debug_init(level, fmt, ...) \
887 +- vxge_debug_ll(level, VXGE_DEBUG_INIT, fmt, __VA_ARGS__)
888 ++ vxge_debug_ll(level, VXGE_DEBUG_INIT, fmt, ##__VA_ARGS__)
889 + #else
890 + #define vxge_debug_init(level, fmt, ...)
891 + #endif
892 +
893 + #if (VXGE_DEBUG_TX & VXGE_DEBUG_MASK)
894 + #define vxge_debug_tx(level, fmt, ...) \
895 +- vxge_debug_ll(level, VXGE_DEBUG_TX, fmt, __VA_ARGS__)
896 ++ vxge_debug_ll(level, VXGE_DEBUG_TX, fmt, ##__VA_ARGS__)
897 + #else
898 + #define vxge_debug_tx(level, fmt, ...)
899 + #endif
900 +
901 + #if (VXGE_DEBUG_RX & VXGE_DEBUG_MASK)
902 + #define vxge_debug_rx(level, fmt, ...) \
903 +- vxge_debug_ll(level, VXGE_DEBUG_RX, fmt, __VA_ARGS__)
904 ++ vxge_debug_ll(level, VXGE_DEBUG_RX, fmt, ##__VA_ARGS__)
905 + #else
906 + #define vxge_debug_rx(level, fmt, ...)
907 + #endif
908 +
909 + #if (VXGE_DEBUG_MEM & VXGE_DEBUG_MASK)
910 + #define vxge_debug_mem(level, fmt, ...) \
911 +- vxge_debug_ll(level, VXGE_DEBUG_MEM, fmt, __VA_ARGS__)
912 ++ vxge_debug_ll(level, VXGE_DEBUG_MEM, fmt, ##__VA_ARGS__)
913 + #else
914 + #define vxge_debug_mem(level, fmt, ...)
915 + #endif
916 +
917 + #if (VXGE_DEBUG_ENTRYEXIT & VXGE_DEBUG_MASK)
918 + #define vxge_debug_entryexit(level, fmt, ...) \
919 +- vxge_debug_ll(level, VXGE_DEBUG_ENTRYEXIT, fmt, __VA_ARGS__)
920 ++ vxge_debug_ll(level, VXGE_DEBUG_ENTRYEXIT, fmt, ##__VA_ARGS__)
921 + #else
922 + #define vxge_debug_entryexit(level, fmt, ...)
923 + #endif
924 +
925 + #if (VXGE_DEBUG_INTR & VXGE_DEBUG_MASK)
926 + #define vxge_debug_intr(level, fmt, ...) \
927 +- vxge_debug_ll(level, VXGE_DEBUG_INTR, fmt, __VA_ARGS__)
928 ++ vxge_debug_ll(level, VXGE_DEBUG_INTR, fmt, ##__VA_ARGS__)
929 + #else
930 + #define vxge_debug_intr(level, fmt, ...)
931 + #endif
932 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
933 +index 26263a192a77..083aeca77c75 100644
934 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
935 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
936 +@@ -1724,7 +1724,7 @@ static int qlcnic_83xx_get_reset_instruction_template(struct qlcnic_adapter *p_d
937 +
938 + ahw->reset.seq_error = 0;
939 + ahw->reset.buff = kzalloc(QLC_83XX_RESTART_TEMPLATE_SIZE, GFP_KERNEL);
940 +- if (p_dev->ahw->reset.buff == NULL)
941 ++ if (ahw->reset.buff == NULL)
942 + return -ENOMEM;
943 +
944 + p_buff = p_dev->ahw->reset.buff;
945 +diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
946 +index 3abc64574116..e153a94d0057 100644
947 +--- a/drivers/net/wireless/ath/ath9k/main.c
948 ++++ b/drivers/net/wireless/ath/ath9k/main.c
949 +@@ -1437,6 +1437,9 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
950 + ath_chanctx_set_channel(sc, ctx, &hw->conf.chandef);
951 + }
952 +
953 ++ if (changed & IEEE80211_CONF_CHANGE_POWER)
954 ++ ath9k_set_txpower(sc, NULL);
955 ++
956 + mutex_unlock(&sc->mutex);
957 + ath9k_ps_restore(sc);
958 +
959 +diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
960 +index 97bc186f9728..2da03d69ed42 100644
961 +--- a/drivers/net/wireless/ath/wil6210/debugfs.c
962 ++++ b/drivers/net/wireless/ath/wil6210/debugfs.c
963 +@@ -1088,7 +1088,7 @@ static const struct file_operations fops_ssid = {
964 + };
965 +
966 + /*---------temp------------*/
967 +-static void print_temp(struct seq_file *s, const char *prefix, u32 t)
968 ++static void print_temp(struct seq_file *s, const char *prefix, s32 t)
969 + {
970 + switch (t) {
971 + case 0:
972 +@@ -1096,7 +1096,8 @@ static void print_temp(struct seq_file *s, const char *prefix, u32 t)
973 + seq_printf(s, "%s N/A\n", prefix);
974 + break;
975 + default:
976 +- seq_printf(s, "%s %d.%03d\n", prefix, t / 1000, t % 1000);
977 ++ seq_printf(s, "%s %s%d.%03d\n", prefix, (t < 0 ? "-" : ""),
978 ++ abs(t / 1000), abs(t % 1000));
979 + break;
980 + }
981 + }
982 +@@ -1104,7 +1105,7 @@ static void print_temp(struct seq_file *s, const char *prefix, u32 t)
983 + static int wil_temp_debugfs_show(struct seq_file *s, void *data)
984 + {
985 + struct wil6210_priv *wil = s->private;
986 +- u32 t_m, t_r;
987 ++ s32 t_m, t_r;
988 + int rc = wmi_get_temperature(wil, &t_m, &t_r);
989 +
990 + if (rc) {
991 +diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
992 +index f09fafaaaf1a..c377937aae1c 100644
993 +--- a/drivers/net/wireless/ath/wil6210/main.c
994 ++++ b/drivers/net/wireless/ath/wil6210/main.c
995 +@@ -741,7 +741,7 @@ static void wil_bl_crash_info(struct wil6210_priv *wil, bool is_err)
996 +
997 + static int wil_wait_for_fw_ready(struct wil6210_priv *wil)
998 + {
999 +- ulong to = msecs_to_jiffies(1000);
1000 ++ ulong to = msecs_to_jiffies(2000);
1001 + ulong left = wait_for_completion_timeout(&wil->wmi_ready, to);
1002 +
1003 + if (0 == left) {
1004 +diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
1005 +index 3bc9bc0efbac..af436292190b 100644
1006 +--- a/drivers/net/wireless/ath/wil6210/txrx.c
1007 ++++ b/drivers/net/wireless/ath/wil6210/txrx.c
1008 +@@ -538,8 +538,8 @@ static int wil_rx_refill(struct wil6210_priv *wil, int count)
1009 + v->swtail = next_tail) {
1010 + rc = wil_vring_alloc_skb(wil, v, v->swtail, headroom);
1011 + if (unlikely(rc)) {
1012 +- wil_err(wil, "Error %d in wil_rx_refill[%d]\n",
1013 +- rc, v->swtail);
1014 ++ wil_err_ratelimited(wil, "Error %d in rx refill[%d]\n",
1015 ++ rc, v->swtail);
1016 + break;
1017 + }
1018 + }
1019 +diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
1020 +index 0f582117b0e3..8d8010b0c254 100644
1021 +--- a/drivers/net/wireless/mac80211_hwsim.c
1022 ++++ b/drivers/net/wireless/mac80211_hwsim.c
1023 +@@ -2901,9 +2901,9 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
1024 + param.no_vif = true;
1025 +
1026 + if (info->attrs[HWSIM_ATTR_RADIO_NAME]) {
1027 +- hwname = kasprintf(GFP_KERNEL, "%.*s",
1028 +- nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
1029 +- (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]));
1030 ++ hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]),
1031 ++ nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
1032 ++ GFP_KERNEL);
1033 + if (!hwname)
1034 + return -ENOMEM;
1035 + param.hwname = hwname;
1036 +@@ -2942,9 +2942,9 @@ static int hwsim_del_radio_nl(struct sk_buff *msg, struct genl_info *info)
1037 + if (info->attrs[HWSIM_ATTR_RADIO_ID]) {
1038 + idx = nla_get_u32(info->attrs[HWSIM_ATTR_RADIO_ID]);
1039 + } else if (info->attrs[HWSIM_ATTR_RADIO_NAME]) {
1040 +- hwname = kasprintf(GFP_KERNEL, "%.*s",
1041 +- nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
1042 +- (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]));
1043 ++ hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]),
1044 ++ nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]),
1045 ++ GFP_KERNEL);
1046 + if (!hwname)
1047 + return -ENOMEM;
1048 + } else
1049 +diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
1050 +index e99a07d5fda7..02b6a6c10840 100644
1051 +--- a/drivers/net/xen-netfront.c
1052 ++++ b/drivers/net/xen-netfront.c
1053 +@@ -283,6 +283,7 @@ static void xennet_alloc_rx_buffers(struct netfront_queue *queue)
1054 + {
1055 + RING_IDX req_prod = queue->rx.req_prod_pvt;
1056 + int notify;
1057 ++ int err = 0;
1058 +
1059 + if (unlikely(!netif_carrier_ok(queue->info->netdev)))
1060 + return;
1061 +@@ -297,8 +298,10 @@ static void xennet_alloc_rx_buffers(struct netfront_queue *queue)
1062 + struct xen_netif_rx_request *req;
1063 +
1064 + skb = xennet_alloc_one_rx_buffer(queue);
1065 +- if (!skb)
1066 ++ if (!skb) {
1067 ++ err = -ENOMEM;
1068 + break;
1069 ++ }
1070 +
1071 + id = xennet_rxidx(req_prod);
1072 +
1073 +@@ -322,8 +325,13 @@ static void xennet_alloc_rx_buffers(struct netfront_queue *queue)
1074 +
1075 + queue->rx.req_prod_pvt = req_prod;
1076 +
1077 +- /* Not enough requests? Try again later. */
1078 +- if (req_prod - queue->rx.sring->req_prod < NET_RX_SLOTS_MIN) {
1079 ++ /* Try again later if there are not enough requests or skb allocation
1080 ++ * failed.
1081 ++ * Enough requests is quantified as the sum of newly created slots and
1082 ++ * the unconsumed slots at the backend.
1083 ++ */
1084 ++ if (req_prod - queue->rx.rsp_cons < NET_RX_SLOTS_MIN ||
1085 ++ unlikely(err)) {
1086 + mod_timer(&queue->rx_refill_timer, jiffies + (HZ/10));
1087 + return;
1088 + }
1089 +diff --git a/drivers/of/base.c b/drivers/of/base.c
1090 +index 27783223ca5c..8adffecd710b 100644
1091 +--- a/drivers/of/base.c
1092 ++++ b/drivers/of/base.c
1093 +@@ -167,9 +167,6 @@ int __of_attach_node_sysfs(struct device_node *np)
1094 + struct property *pp;
1095 + int rc;
1096 +
1097 +- if (!IS_ENABLED(CONFIG_SYSFS))
1098 +- return 0;
1099 +-
1100 + if (!of_kset)
1101 + return 0;
1102 +
1103 +diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
1104 +index af9e4785b7a6..91e6891b777b 100644
1105 +--- a/drivers/of/unittest.c
1106 ++++ b/drivers/of/unittest.c
1107 +@@ -812,10 +812,13 @@ static void __init of_unittest_platform_populate(void)
1108 +
1109 + of_platform_populate(np, match, NULL, &test_bus->dev);
1110 + for_each_child_of_node(np, child) {
1111 +- for_each_child_of_node(child, grandchild)
1112 +- unittest(of_find_device_by_node(grandchild),
1113 ++ for_each_child_of_node(child, grandchild) {
1114 ++ pdev = of_find_device_by_node(grandchild);
1115 ++ unittest(pdev,
1116 + "Could not create device for node '%s'\n",
1117 + grandchild->name);
1118 ++ of_dev_put(pdev);
1119 ++ }
1120 + }
1121 +
1122 + of_platform_depopulate(&test_bus->dev);
1123 +diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c
1124 +index a0dae6271ff6..cd4434cca877 100644
1125 +--- a/drivers/rtc/rtc-pm8xxx.c
1126 ++++ b/drivers/rtc/rtc-pm8xxx.c
1127 +@@ -74,16 +74,18 @@ struct pm8xxx_rtc {
1128 + /*
1129 + * Steps to write the RTC registers.
1130 + * 1. Disable alarm if enabled.
1131 +- * 2. Write 0x00 to LSB.
1132 +- * 3. Write Byte[1], Byte[2], Byte[3] then Byte[0].
1133 +- * 4. Enable alarm if disabled in step 1.
1134 ++ * 2. Disable rtc if enabled.
1135 ++ * 3. Write 0x00 to LSB.
1136 ++ * 4. Write Byte[1], Byte[2], Byte[3] then Byte[0].
1137 ++ * 5. Enable rtc if disabled in step 2.
1138 ++ * 6. Enable alarm if disabled in step 1.
1139 + */
1140 + static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm)
1141 + {
1142 + int rc, i;
1143 + unsigned long secs, irq_flags;
1144 +- u8 value[NUM_8_BIT_RTC_REGS], alarm_enabled = 0;
1145 +- unsigned int ctrl_reg;
1146 ++ u8 value[NUM_8_BIT_RTC_REGS], alarm_enabled = 0, rtc_disabled = 0;
1147 ++ unsigned int ctrl_reg, rtc_ctrl_reg;
1148 + struct pm8xxx_rtc *rtc_dd = dev_get_drvdata(dev);
1149 + const struct pm8xxx_rtc_regs *regs = rtc_dd->regs;
1150 +
1151 +@@ -92,23 +94,38 @@ static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm)
1152 +
1153 + rtc_tm_to_time(tm, &secs);
1154 +
1155 ++ dev_dbg(dev, "Seconds value to be written to RTC = %lu\n", secs);
1156 ++
1157 + for (i = 0; i < NUM_8_BIT_RTC_REGS; i++) {
1158 + value[i] = secs & 0xFF;
1159 + secs >>= 8;
1160 + }
1161 +
1162 +- dev_dbg(dev, "Seconds value to be written to RTC = %lu\n", secs);
1163 +-
1164 + spin_lock_irqsave(&rtc_dd->ctrl_reg_lock, irq_flags);
1165 +
1166 +- rc = regmap_read(rtc_dd->regmap, regs->ctrl, &ctrl_reg);
1167 ++ rc = regmap_read(rtc_dd->regmap, regs->alarm_ctrl, &ctrl_reg);
1168 + if (rc)
1169 + goto rtc_rw_fail;
1170 +
1171 + if (ctrl_reg & regs->alarm_en) {
1172 + alarm_enabled = 1;
1173 + ctrl_reg &= ~regs->alarm_en;
1174 +- rc = regmap_write(rtc_dd->regmap, regs->ctrl, ctrl_reg);
1175 ++ rc = regmap_write(rtc_dd->regmap, regs->alarm_ctrl, ctrl_reg);
1176 ++ if (rc) {
1177 ++ dev_err(dev, "Write to RTC Alarm control register failed\n");
1178 ++ goto rtc_rw_fail;
1179 ++ }
1180 ++ }
1181 ++
1182 ++ /* Disable RTC H/w before writing on RTC register */
1183 ++ rc = regmap_read(rtc_dd->regmap, regs->ctrl, &rtc_ctrl_reg);
1184 ++ if (rc)
1185 ++ goto rtc_rw_fail;
1186 ++
1187 ++ if (rtc_ctrl_reg & PM8xxx_RTC_ENABLE) {
1188 ++ rtc_disabled = 1;
1189 ++ rtc_ctrl_reg &= ~PM8xxx_RTC_ENABLE;
1190 ++ rc = regmap_write(rtc_dd->regmap, regs->ctrl, rtc_ctrl_reg);
1191 + if (rc) {
1192 + dev_err(dev, "Write to RTC control register failed\n");
1193 + goto rtc_rw_fail;
1194 +@@ -137,11 +154,21 @@ static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm)
1195 + goto rtc_rw_fail;
1196 + }
1197 +
1198 ++ /* Enable RTC H/w after writing on RTC register */
1199 ++ if (rtc_disabled) {
1200 ++ rtc_ctrl_reg |= PM8xxx_RTC_ENABLE;
1201 ++ rc = regmap_write(rtc_dd->regmap, regs->ctrl, rtc_ctrl_reg);
1202 ++ if (rc) {
1203 ++ dev_err(dev, "Write to RTC control register failed\n");
1204 ++ goto rtc_rw_fail;
1205 ++ }
1206 ++ }
1207 ++
1208 + if (alarm_enabled) {
1209 + ctrl_reg |= regs->alarm_en;
1210 +- rc = regmap_write(rtc_dd->regmap, regs->ctrl, ctrl_reg);
1211 ++ rc = regmap_write(rtc_dd->regmap, regs->alarm_ctrl, ctrl_reg);
1212 + if (rc) {
1213 +- dev_err(dev, "Write to RTC control register failed\n");
1214 ++ dev_err(dev, "Write to RTC Alarm control register failed\n");
1215 + goto rtc_rw_fail;
1216 + }
1217 + }
1218 +diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
1219 +index d5214c4eb9dd..d8aee54f6c26 100644
1220 +--- a/drivers/s390/scsi/zfcp_erp.c
1221 ++++ b/drivers/s390/scsi/zfcp_erp.c
1222 +@@ -747,7 +747,7 @@ static void zfcp_erp_enqueue_ptp_port(struct zfcp_adapter *adapter)
1223 + adapter->peer_d_id);
1224 + if (IS_ERR(port)) /* error or port already attached */
1225 + return;
1226 +- _zfcp_erp_port_reopen(port, 0, "ereptp1");
1227 ++ zfcp_erp_port_reopen(port, 0, "ereptp1");
1228 + }
1229 +
1230 + static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action)
1231 +diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
1232 +index e1639e80db53..63e21ca538f1 100644
1233 +--- a/drivers/scsi/sg.c
1234 ++++ b/drivers/scsi/sg.c
1235 +@@ -820,8 +820,10 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
1236 + "sg_common_write: scsi opcode=0x%02x, cmd_size=%d\n",
1237 + (int) cmnd[0], (int) hp->cmd_len));
1238 +
1239 +- if (hp->dxfer_len >= SZ_256M)
1240 ++ if (hp->dxfer_len >= SZ_256M) {
1241 ++ sg_remove_request(sfp, srp);
1242 + return -EINVAL;
1243 ++ }
1244 +
1245 + k = sg_start_req(srp, cmnd);
1246 + if (k) {
1247 +diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
1248 +index 4b82c3765e01..2b779a55f699 100644
1249 +--- a/drivers/scsi/ufs/ufs-qcom.c
1250 ++++ b/drivers/scsi/ufs/ufs-qcom.c
1251 +@@ -1032,7 +1032,7 @@ static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
1252 + hba->quirks |= UFSHCD_QUIRK_BROKEN_LCC;
1253 + }
1254 +
1255 +- if (host->hw_ver.major >= 0x2) {
1256 ++ if (host->hw_ver.major == 0x2) {
1257 + hba->quirks |= UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION;
1258 +
1259 + if (!ufs_qcom_cap_qunipro(host))
1260 +diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
1261 +index 19f82069c68a..bc7f8d634c80 100644
1262 +--- a/drivers/scsi/ufs/ufshcd.c
1263 ++++ b/drivers/scsi/ufs/ufshcd.c
1264 +@@ -595,6 +595,11 @@ start:
1265 + */
1266 + if (ufshcd_can_hibern8_during_gating(hba) &&
1267 + ufshcd_is_link_hibern8(hba)) {
1268 ++ if (async) {
1269 ++ rc = -EAGAIN;
1270 ++ hba->clk_gating.active_reqs--;
1271 ++ break;
1272 ++ }
1273 + spin_unlock_irqrestore(hba->host->host_lock, flags);
1274 + flush_work(&hba->clk_gating.ungate_work);
1275 + spin_lock_irqsave(hba->host->host_lock, flags);
1276 +diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c
1277 +index 19019aa092e8..a1572075b8ac 100644
1278 +--- a/drivers/soc/qcom/smem.c
1279 ++++ b/drivers/soc/qcom/smem.c
1280 +@@ -646,7 +646,7 @@ static int qcom_smem_enumerate_partitions(struct qcom_smem *smem,
1281 + return -EINVAL;
1282 + }
1283 +
1284 +- if (header->size != entry->size) {
1285 ++ if (le32_to_cpu(header->size) != le32_to_cpu(entry->size)) {
1286 + dev_err(smem->dev,
1287 + "Partition %d has invalid size\n", i);
1288 + return -EINVAL;
1289 +diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c
1290 +index 342b36b9ad35..c13fe5ca6702 100644
1291 +--- a/drivers/tty/ehv_bytechan.c
1292 ++++ b/drivers/tty/ehv_bytechan.c
1293 +@@ -140,6 +140,21 @@ static int find_console_handle(void)
1294 + return 1;
1295 + }
1296 +
1297 ++static unsigned int local_ev_byte_channel_send(unsigned int handle,
1298 ++ unsigned int *count,
1299 ++ const char *p)
1300 ++{
1301 ++ char buffer[EV_BYTE_CHANNEL_MAX_BYTES];
1302 ++ unsigned int c = *count;
1303 ++
1304 ++ if (c < sizeof(buffer)) {
1305 ++ memcpy(buffer, p, c);
1306 ++ memset(&buffer[c], 0, sizeof(buffer) - c);
1307 ++ p = buffer;
1308 ++ }
1309 ++ return ev_byte_channel_send(handle, count, p);
1310 ++}
1311 ++
1312 + /*************************** EARLY CONSOLE DRIVER ***************************/
1313 +
1314 + #ifdef CONFIG_PPC_EARLY_DEBUG_EHV_BC
1315 +@@ -158,7 +173,7 @@ static void byte_channel_spin_send(const char data)
1316 +
1317 + do {
1318 + count = 1;
1319 +- ret = ev_byte_channel_send(CONFIG_PPC_EARLY_DEBUG_EHV_BC_HANDLE,
1320 ++ ret = local_ev_byte_channel_send(CONFIG_PPC_EARLY_DEBUG_EHV_BC_HANDLE,
1321 + &count, &data);
1322 + } while (ret == EV_EAGAIN);
1323 + }
1324 +@@ -225,7 +240,7 @@ static int ehv_bc_console_byte_channel_send(unsigned int handle, const char *s,
1325 + while (count) {
1326 + len = min_t(unsigned int, count, EV_BYTE_CHANNEL_MAX_BYTES);
1327 + do {
1328 +- ret = ev_byte_channel_send(handle, &len, s);
1329 ++ ret = local_ev_byte_channel_send(handle, &len, s);
1330 + } while (ret == EV_EAGAIN);
1331 + count -= len;
1332 + s += len;
1333 +@@ -405,7 +420,7 @@ static void ehv_bc_tx_dequeue(struct ehv_bc_data *bc)
1334 + CIRC_CNT_TO_END(bc->head, bc->tail, BUF_SIZE),
1335 + EV_BYTE_CHANNEL_MAX_BYTES);
1336 +
1337 +- ret = ev_byte_channel_send(bc->handle, &len, bc->buf + bc->tail);
1338 ++ ret = local_ev_byte_channel_send(bc->handle, &len, bc->buf + bc->tail);
1339 +
1340 + /* 'len' is valid only if the return code is 0 or EV_EAGAIN */
1341 + if (!ret || (ret == EV_EAGAIN))
1342 +diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
1343 +index 0f2d1e98481f..10f8fde7d6a6 100644
1344 +--- a/drivers/usb/gadget/composite.c
1345 ++++ b/drivers/usb/gadget/composite.c
1346 +@@ -744,6 +744,11 @@ static int set_config(struct usb_composite_dev *cdev,
1347 + /* when we return, be sure our power usage is valid */
1348 + power = c->MaxPower ? c->MaxPower : CONFIG_USB_GADGET_VBUS_DRAW;
1349 + done:
1350 ++ if (power <= USB_SELF_POWER_VBUS_MAX_DRAW)
1351 ++ usb_gadget_set_selfpowered(gadget);
1352 ++ else
1353 ++ usb_gadget_clear_selfpowered(gadget);
1354 ++
1355 + usb_gadget_vbus_draw(gadget, power);
1356 + if (result >= 0 && cdev->delayed_status)
1357 + result = USB_GADGET_DELAYED_STATUS;
1358 +@@ -2156,6 +2161,7 @@ void composite_suspend(struct usb_gadget *gadget)
1359 +
1360 + cdev->suspended = 1;
1361 +
1362 ++ usb_gadget_set_selfpowered(gadget);
1363 + usb_gadget_vbus_draw(gadget, 2);
1364 + }
1365 +
1366 +@@ -2179,6 +2185,9 @@ void composite_resume(struct usb_gadget *gadget)
1367 +
1368 + maxpower = cdev->config->MaxPower;
1369 +
1370 ++ if (maxpower > USB_SELF_POWER_VBUS_MAX_DRAW)
1371 ++ usb_gadget_clear_selfpowered(gadget);
1372 ++
1373 + usb_gadget_vbus_draw(gadget, maxpower ?
1374 + maxpower : CONFIG_USB_GADGET_VBUS_DRAW);
1375 + }
1376 +diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
1377 +index 9536c409a90d..23a9557c8234 100644
1378 +--- a/drivers/usb/gadget/function/f_fs.c
1379 ++++ b/drivers/usb/gadget/function/f_fs.c
1380 +@@ -812,6 +812,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data)
1381 +
1382 + ret = usb_ep_queue(ep->ep, req, GFP_ATOMIC);
1383 + if (unlikely(ret)) {
1384 ++ io_data->req = NULL;
1385 + usb_ep_free_request(ep->ep, req);
1386 + goto error_lock;
1387 + }
1388 +diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
1389 +index 9eae191728d2..348be7368f49 100644
1390 +--- a/drivers/video/fbdev/core/fbmem.c
1391 ++++ b/drivers/video/fbdev/core/fbmem.c
1392 +@@ -1132,7 +1132,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
1393 + case FBIOGET_FSCREENINFO:
1394 + if (!lock_fb_info(info))
1395 + return -ENODEV;
1396 +- fix = info->fix;
1397 ++ memcpy(&fix, &info->fix, sizeof(fix));
1398 + unlock_fb_info(info);
1399 +
1400 + ret = copy_to_user(argp, &fix, sizeof(fix)) ? -EFAULT : 0;
1401 +diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
1402 +index 20f7234e809e..c43b951cfb25 100644
1403 +--- a/drivers/video/fbdev/sis/init301.c
1404 ++++ b/drivers/video/fbdev/sis/init301.c
1405 +@@ -522,9 +522,7 @@ SiS_PanelDelay(struct SiS_Private *SiS_Pr, unsigned short DelayTime)
1406 + SiS_DDC2Delay(SiS_Pr, 0x4000);
1407 + }
1408 +
1409 +- } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* ||
1410 +- (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) ||
1411 +- (SiS_Pr->SiS_CustomT == CUT_CLEVO1400) */ ) { /* 315 series, LVDS; Special */
1412 ++ } else if (SiS_Pr->SiS_IF_DEF_LVDS == 1) { /* 315 series, LVDS; Special */
1413 +
1414 + if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) {
1415 + PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36);
1416 +diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
1417 +index a09264d8b853..205d6b43cd7d 100644
1418 +--- a/fs/btrfs/async-thread.c
1419 ++++ b/fs/btrfs/async-thread.c
1420 +@@ -389,3 +389,11 @@ void btrfs_set_work_high_priority(struct btrfs_work *work)
1421 + {
1422 + set_bit(WORK_HIGH_PRIO_BIT, &work->flags);
1423 + }
1424 ++
1425 ++void btrfs_flush_workqueue(struct btrfs_workqueue *wq)
1426 ++{
1427 ++ if (wq->high)
1428 ++ flush_workqueue(wq->high->normal_wq);
1429 ++
1430 ++ flush_workqueue(wq->normal->normal_wq);
1431 ++}
1432 +diff --git a/fs/btrfs/async-thread.h b/fs/btrfs/async-thread.h
1433 +index 8e1d6576d764..7ea220726de2 100644
1434 +--- a/fs/btrfs/async-thread.h
1435 ++++ b/fs/btrfs/async-thread.h
1436 +@@ -81,4 +81,6 @@ void btrfs_destroy_workqueue(struct btrfs_workqueue *wq);
1437 + void btrfs_workqueue_set_max(struct btrfs_workqueue *wq, int max);
1438 + void btrfs_set_work_high_priority(struct btrfs_work *work);
1439 + bool btrfs_workqueue_normal_congested(struct btrfs_workqueue *wq);
1440 ++void btrfs_flush_workqueue(struct btrfs_workqueue *wq);
1441 ++
1442 + #endif
1443 +diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
1444 +index 656f0b768185..774728143b63 100644
1445 +--- a/fs/btrfs/disk-io.c
1446 ++++ b/fs/btrfs/disk-io.c
1447 +@@ -3774,6 +3774,19 @@ void close_ctree(struct btrfs_root *root)
1448 + */
1449 + btrfs_delete_unused_bgs(root->fs_info);
1450 +
1451 ++ /*
1452 ++ * There might be existing delayed inode workers still running
1453 ++ * and holding an empty delayed inode item. We must wait for
1454 ++ * them to complete first because they can create a transaction.
1455 ++ * This happens when someone calls btrfs_balance_delayed_items()
1456 ++ * and then a transaction commit runs the same delayed nodes
1457 ++ * before any delayed worker has done something with the nodes.
1458 ++ * We must wait for any worker here and not at transaction
1459 ++ * commit time since that could cause a deadlock.
1460 ++ * This is a very rare case.
1461 ++ */
1462 ++ btrfs_flush_workqueue(fs_info->delayed_workers);
1463 ++
1464 + ret = btrfs_commit_super(root);
1465 + if (ret)
1466 + btrfs_err(fs_info, "commit super ret %d", ret);
1467 +diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
1468 +index f38bac9456fd..df04309390bb 100644
1469 +--- a/fs/btrfs/relocation.c
1470 ++++ b/fs/btrfs/relocation.c
1471 +@@ -1289,7 +1289,7 @@ static int __must_check __add_reloc_root(struct btrfs_root *root)
1472 + if (!node)
1473 + return -ENOMEM;
1474 +
1475 +- node->bytenr = root->node->start;
1476 ++ node->bytenr = root->commit_root->start;
1477 + node->data = root;
1478 +
1479 + spin_lock(&rc->reloc_root_tree.lock);
1480 +@@ -1321,10 +1321,11 @@ static void __del_reloc_root(struct btrfs_root *root)
1481 + if (rc && root->node) {
1482 + spin_lock(&rc->reloc_root_tree.lock);
1483 + rb_node = tree_search(&rc->reloc_root_tree.rb_root,
1484 +- root->node->start);
1485 ++ root->commit_root->start);
1486 + if (rb_node) {
1487 + node = rb_entry(rb_node, struct mapping_node, rb_node);
1488 + rb_erase(&node->rb_node, &rc->reloc_root_tree.rb_root);
1489 ++ RB_CLEAR_NODE(&node->rb_node);
1490 + }
1491 + spin_unlock(&rc->reloc_root_tree.lock);
1492 + if (!node)
1493 +@@ -1342,7 +1343,7 @@ static void __del_reloc_root(struct btrfs_root *root)
1494 + * helper to update the 'address of tree root -> reloc tree'
1495 + * mapping
1496 + */
1497 +-static int __update_reloc_root(struct btrfs_root *root, u64 new_bytenr)
1498 ++static int __update_reloc_root(struct btrfs_root *root)
1499 + {
1500 + struct rb_node *rb_node;
1501 + struct mapping_node *node = NULL;
1502 +@@ -1350,7 +1351,7 @@ static int __update_reloc_root(struct btrfs_root *root, u64 new_bytenr)
1503 +
1504 + spin_lock(&rc->reloc_root_tree.lock);
1505 + rb_node = tree_search(&rc->reloc_root_tree.rb_root,
1506 +- root->node->start);
1507 ++ root->commit_root->start);
1508 + if (rb_node) {
1509 + node = rb_entry(rb_node, struct mapping_node, rb_node);
1510 + rb_erase(&node->rb_node, &rc->reloc_root_tree.rb_root);
1511 +@@ -1362,7 +1363,7 @@ static int __update_reloc_root(struct btrfs_root *root, u64 new_bytenr)
1512 + BUG_ON((struct btrfs_root *)node->data != root);
1513 +
1514 + spin_lock(&rc->reloc_root_tree.lock);
1515 +- node->bytenr = new_bytenr;
1516 ++ node->bytenr = root->node->start;
1517 + rb_node = tree_insert(&rc->reloc_root_tree.rb_root,
1518 + node->bytenr, &node->rb_node);
1519 + spin_unlock(&rc->reloc_root_tree.lock);
1520 +@@ -1503,6 +1504,7 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans,
1521 + }
1522 +
1523 + if (reloc_root->commit_root != reloc_root->node) {
1524 ++ __update_reloc_root(reloc_root);
1525 + btrfs_set_root_node(root_item, reloc_root->node);
1526 + free_extent_buffer(reloc_root->commit_root);
1527 + reloc_root->commit_root = btrfs_root_node(reloc_root);
1528 +@@ -2440,7 +2442,21 @@ out:
1529 + free_reloc_roots(&reloc_roots);
1530 + }
1531 +
1532 +- BUG_ON(!RB_EMPTY_ROOT(&rc->reloc_root_tree.rb_root));
1533 ++ /*
1534 ++ * We used to have
1535 ++ *
1536 ++ * BUG_ON(!RB_EMPTY_ROOT(&rc->reloc_root_tree.rb_root));
1537 ++ *
1538 ++ * here, but it's wrong. If we fail to start the transaction in
1539 ++ * prepare_to_merge() we will have only 0 ref reloc roots, none of which
1540 ++ * have actually been removed from the reloc_root_tree rb tree. This is
1541 ++ * fine because we're bailing here, and we hold a reference on the root
1542 ++ * for the list that holds it, so these roots will be cleaned up when we
1543 ++ * do the reloc_dirty_list afterwards. Meanwhile the root->reloc_root
1544 ++ * will be cleaned up on unmount.
1545 ++ *
1546 ++ * The remaining nodes will be cleaned up by free_reloc_control.
1547 ++ */
1548 + }
1549 +
1550 + static void free_block_list(struct rb_root *blocks)
1551 +@@ -4564,11 +4580,6 @@ int btrfs_reloc_cow_block(struct btrfs_trans_handle *trans,
1552 + BUG_ON(rc->stage == UPDATE_DATA_PTRS &&
1553 + root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID);
1554 +
1555 +- if (root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) {
1556 +- if (buf == root->node)
1557 +- __update_reloc_root(root, cow->start);
1558 +- }
1559 +-
1560 + level = btrfs_header_level(buf);
1561 + if (btrfs_header_generation(buf) <=
1562 + btrfs_root_last_snapshot(&root->root_item))
1563 +diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
1564 +index 40d1ab957fb6..f35884a431c1 100644
1565 +--- a/fs/btrfs/send.c
1566 ++++ b/fs/btrfs/send.c
1567 +@@ -5022,15 +5022,12 @@ static int is_extent_unchanged(struct send_ctx *sctx,
1568 + goto out;
1569 + }
1570 +
1571 +- right_disknr = btrfs_file_extent_disk_bytenr(eb, ei);
1572 + if (right_type == BTRFS_FILE_EXTENT_INLINE) {
1573 + right_len = btrfs_file_extent_inline_len(eb, slot, ei);
1574 + right_len = PAGE_ALIGN(right_len);
1575 + } else {
1576 + right_len = btrfs_file_extent_num_bytes(eb, ei);
1577 + }
1578 +- right_offset = btrfs_file_extent_offset(eb, ei);
1579 +- right_gen = btrfs_file_extent_generation(eb, ei);
1580 +
1581 + /*
1582 + * Are we at extent 8? If yes, we know the extent is changed.
1583 +@@ -5055,6 +5052,10 @@ static int is_extent_unchanged(struct send_ctx *sctx,
1584 + goto out;
1585 + }
1586 +
1587 ++ right_disknr = btrfs_file_extent_disk_bytenr(eb, ei);
1588 ++ right_offset = btrfs_file_extent_offset(eb, ei);
1589 ++ right_gen = btrfs_file_extent_generation(eb, ei);
1590 ++
1591 + left_offset_fixed = left_offset;
1592 + if (key.offset < ekey->offset) {
1593 + /* Fix the right offset for 2a and 7. */
1594 +diff --git a/fs/exec.c b/fs/exec.c
1595 +index bb70472d7cee..d882ab7ac6e8 100644
1596 +--- a/fs/exec.c
1597 ++++ b/fs/exec.c
1598 +@@ -1207,7 +1207,7 @@ void setup_new_exec(struct linux_binprm * bprm)
1599 +
1600 + /* An exec changes our domain. We are no longer part of the thread
1601 + group */
1602 +- current->self_exec_id++;
1603 ++ WRITE_ONCE(current->self_exec_id, current->self_exec_id + 1);
1604 + flush_signal_handlers(current, 0);
1605 + }
1606 + EXPORT_SYMBOL(setup_new_exec);
1607 +diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
1608 +index 22d817dc821e..6f6f4f89a2f0 100644
1609 +--- a/fs/ext2/xattr.c
1610 ++++ b/fs/ext2/xattr.c
1611 +@@ -55,6 +55,7 @@
1612 +
1613 + #include <linux/buffer_head.h>
1614 + #include <linux/init.h>
1615 ++#include <linux/printk.h>
1616 + #include <linux/slab.h>
1617 + #include <linux/mbcache.h>
1618 + #include <linux/quotaops.h>
1619 +@@ -85,8 +86,8 @@
1620 + printk("\n"); \
1621 + } while (0)
1622 + #else
1623 +-# define ea_idebug(f...)
1624 +-# define ea_bdebug(f...)
1625 ++# define ea_idebug(inode, f...) no_printk(f)
1626 ++# define ea_bdebug(bh, f...) no_printk(f)
1627 + #endif
1628 +
1629 + static int ext2_xattr_set2(struct inode *, struct buffer_head *,
1630 +diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
1631 +index 8d98c9ac9205..7414bfd5a58e 100644
1632 +--- a/fs/ext4/extents.c
1633 ++++ b/fs/ext4/extents.c
1634 +@@ -3439,8 +3439,8 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
1635 + (unsigned long long)map->m_lblk, map_len);
1636 +
1637 + sbi = EXT4_SB(inode->i_sb);
1638 +- eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
1639 +- inode->i_sb->s_blocksize_bits;
1640 ++ eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1)
1641 ++ >> inode->i_sb->s_blocksize_bits;
1642 + if (eof_block < map->m_lblk + map_len)
1643 + eof_block = map->m_lblk + map_len;
1644 +
1645 +@@ -3701,8 +3701,8 @@ static int ext4_split_convert_extents(handle_t *handle,
1646 + __func__, inode->i_ino,
1647 + (unsigned long long)map->m_lblk, map->m_len);
1648 +
1649 +- eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >>
1650 +- inode->i_sb->s_blocksize_bits;
1651 ++ eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1)
1652 ++ >> inode->i_sb->s_blocksize_bits;
1653 + if (eof_block < map->m_lblk + map->m_len)
1654 + eof_block = map->m_lblk + map->m_len;
1655 + /*
1656 +diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
1657 +index d1daac8d81f3..a2bb9c60445c 100644
1658 +--- a/fs/ext4/inode.c
1659 ++++ b/fs/ext4/inode.c
1660 +@@ -4485,7 +4485,7 @@ static int ext4_inode_blocks_set(handle_t *handle,
1661 + struct ext4_inode_info *ei)
1662 + {
1663 + struct inode *inode = &(ei->vfs_inode);
1664 +- u64 i_blocks = inode->i_blocks;
1665 ++ u64 i_blocks = READ_ONCE(inode->i_blocks);
1666 + struct super_block *sb = inode->i_sb;
1667 +
1668 + if (i_blocks <= ~0U) {
1669 +diff --git a/fs/ext4/super.c b/fs/ext4/super.c
1670 +index f2e0220b00c3..67faf147bade 100644
1671 +--- a/fs/ext4/super.c
1672 ++++ b/fs/ext4/super.c
1673 +@@ -313,7 +313,8 @@ static void save_error_info(struct super_block *sb, const char *func,
1674 + unsigned int line)
1675 + {
1676 + __save_error_info(sb, func, line);
1677 +- ext4_commit_super(sb, 1);
1678 ++ if (!bdev_read_only(sb->s_bdev))
1679 ++ ext4_commit_super(sb, 1);
1680 + }
1681 +
1682 + /*
1683 +@@ -3660,7 +3661,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
1684 + if (sbi->s_inodes_per_group < sbi->s_inodes_per_block ||
1685 + sbi->s_inodes_per_group > blocksize * 8) {
1686 + ext4_msg(sb, KERN_ERR, "invalid inodes per group: %lu\n",
1687 +- sbi->s_blocks_per_group);
1688 ++ sbi->s_inodes_per_group);
1689 + goto failed_mount;
1690 + }
1691 + sbi->s_itb_per_group = sbi->s_inodes_per_group /
1692 +@@ -3791,9 +3792,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
1693 + EXT4_BLOCKS_PER_GROUP(sb) - 1);
1694 + do_div(blocks_count, EXT4_BLOCKS_PER_GROUP(sb));
1695 + if (blocks_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) {
1696 +- ext4_msg(sb, KERN_WARNING, "groups count too large: %u "
1697 ++ ext4_msg(sb, KERN_WARNING, "groups count too large: %llu "
1698 + "(block count %llu, first data block %u, "
1699 +- "blocks per group %lu)", sbi->s_groups_count,
1700 ++ "blocks per group %lu)", blocks_count,
1701 + ext4_blocks_count(es),
1702 + le32_to_cpu(es->s_first_data_block),
1703 + EXT4_BLOCKS_PER_GROUP(sb));
1704 +diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
1705 +index 1eb737c466dd..f80ffccb0316 100644
1706 +--- a/fs/gfs2/glock.c
1707 ++++ b/fs/gfs2/glock.c
1708 +@@ -541,6 +541,9 @@ __acquires(&gl->gl_lockref.lock)
1709 + goto out_unlock;
1710 + if (nonblock)
1711 + goto out_sched;
1712 ++ smp_mb();
1713 ++ if (atomic_read(&gl->gl_revokes) != 0)
1714 ++ goto out_sched;
1715 + set_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags);
1716 + GLOCK_BUG_ON(gl, gl->gl_demote_state == LM_ST_EXCLUSIVE);
1717 + gl->gl_target = gl->gl_demote_state;
1718 +diff --git a/fs/hfsplus/attributes.c b/fs/hfsplus/attributes.c
1719 +index d7455ea70287..0c4548d8cd0b 100644
1720 +--- a/fs/hfsplus/attributes.c
1721 ++++ b/fs/hfsplus/attributes.c
1722 +@@ -291,6 +291,10 @@ static int __hfsplus_delete_attr(struct inode *inode, u32 cnid,
1723 + return -ENOENT;
1724 + }
1725 +
1726 ++ /* Avoid btree corruption */
1727 ++ hfs_bnode_read(fd->bnode, fd->search_key,
1728 ++ fd->keyoffset, fd->keylength);
1729 ++
1730 + err = hfs_brec_remove(fd);
1731 + if (err)
1732 + return err;
1733 +diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
1734 +index a7d12dd6d56e..57490f08ad7c 100644
1735 +--- a/fs/jbd2/commit.c
1736 ++++ b/fs/jbd2/commit.c
1737 +@@ -1008,9 +1008,10 @@ restart_loop:
1738 + * journalled data) we need to unmap buffer and clear
1739 + * more bits. We also need to be careful about the check
1740 + * because the data page mapping can get cleared under
1741 +- * out hands, which alse need not to clear more bits
1742 +- * because the page and buffers will be freed and can
1743 +- * never be reused once we are done with them.
1744 ++ * our hands. Note that if mapping == NULL, we don't
1745 ++ * need to make buffer unmapped because the page is
1746 ++ * already detached from the mapping and buffers cannot
1747 ++ * get reused.
1748 + */
1749 + mapping = READ_ONCE(bh->b_page->mapping);
1750 + if (mapping && !sb_is_blkdev_sb(mapping->host->i_sb)) {
1751 +diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
1752 +index 88cb8e0d6014..7789f0b9b999 100644
1753 +--- a/fs/nfs/direct.c
1754 ++++ b/fs/nfs/direct.c
1755 +@@ -605,6 +605,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter,
1756 + l_ctx = nfs_get_lock_context(dreq->ctx);
1757 + if (IS_ERR(l_ctx)) {
1758 + result = PTR_ERR(l_ctx);
1759 ++ nfs_direct_req_release(dreq);
1760 + goto out_release;
1761 + }
1762 + dreq->l_ctx = l_ctx;
1763 +@@ -1015,6 +1016,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter)
1764 + l_ctx = nfs_get_lock_context(dreq->ctx);
1765 + if (IS_ERR(l_ctx)) {
1766 + result = PTR_ERR(l_ctx);
1767 ++ nfs_direct_req_release(dreq);
1768 + goto out_release;
1769 + }
1770 + dreq->l_ctx = l_ctx;
1771 +diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
1772 +index af1bb7353792..f5de58c5773f 100644
1773 +--- a/fs/nfs/pagelist.c
1774 ++++ b/fs/nfs/pagelist.c
1775 +@@ -886,15 +886,6 @@ static int nfs_pageio_setup_mirroring(struct nfs_pageio_descriptor *pgio,
1776 + return 0;
1777 + }
1778 +
1779 +-/*
1780 +- * nfs_pageio_stop_mirroring - stop using mirroring (set mirror count to 1)
1781 +- */
1782 +-void nfs_pageio_stop_mirroring(struct nfs_pageio_descriptor *pgio)
1783 +-{
1784 +- pgio->pg_mirror_count = 1;
1785 +- pgio->pg_mirror_idx = 0;
1786 +-}
1787 +-
1788 + static void nfs_pageio_cleanup_mirroring(struct nfs_pageio_descriptor *pgio)
1789 + {
1790 + pgio->pg_mirror_count = 1;
1791 +@@ -1287,6 +1278,14 @@ void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *desc, pgoff_t index)
1792 + }
1793 + }
1794 +
1795 ++/*
1796 ++ * nfs_pageio_stop_mirroring - stop using mirroring (set mirror count to 1)
1797 ++ */
1798 ++void nfs_pageio_stop_mirroring(struct nfs_pageio_descriptor *pgio)
1799 ++{
1800 ++ nfs_pageio_complete(pgio);
1801 ++}
1802 ++
1803 + int __init nfs_init_nfspagecache(void)
1804 + {
1805 + nfs_page_cachep = kmem_cache_create("nfs_page",
1806 +diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
1807 +index 93e6f029a322..7e34be37c96d 100644
1808 +--- a/fs/ocfs2/alloc.c
1809 ++++ b/fs/ocfs2/alloc.c
1810 +@@ -7206,6 +7206,10 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh,
1811 + struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;
1812 + struct ocfs2_inline_data *idata = &di->id2.i_data;
1813 +
1814 ++ /* No need to punch hole beyond i_size. */
1815 ++ if (start >= i_size_read(inode))
1816 ++ return 0;
1817 ++
1818 + if (end > i_size_read(inode))
1819 + end = i_size_read(inode);
1820 +
1821 +diff --git a/include/linux/compiler.h b/include/linux/compiler.h
1822 +index 5508011cc0c7..5f8749440c6a 100644
1823 +--- a/include/linux/compiler.h
1824 ++++ b/include/linux/compiler.h
1825 +@@ -502,7 +502,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
1826 + * compiler has support to do so.
1827 + */
1828 + #define compiletime_assert(condition, msg) \
1829 +- _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
1830 ++ _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
1831 +
1832 + #define compiletime_assert_atomic_type(t) \
1833 + compiletime_assert(__native_word(t), \
1834 +diff --git a/include/linux/devfreq_cooling.h b/include/linux/devfreq_cooling.h
1835 +index 7adf6cc4b305..633346b84cae 100644
1836 +--- a/include/linux/devfreq_cooling.h
1837 ++++ b/include/linux/devfreq_cooling.h
1838 +@@ -53,7 +53,7 @@ void devfreq_cooling_unregister(struct thermal_cooling_device *dfc);
1839 +
1840 + #else /* !CONFIG_DEVFREQ_THERMAL */
1841 +
1842 +-struct thermal_cooling_device *
1843 ++static inline struct thermal_cooling_device *
1844 + of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
1845 + struct devfreq_cooling_power *dfc_power)
1846 + {
1847 +diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
1848 +index 84a109449610..b6332cb761a4 100644
1849 +--- a/include/linux/percpu_counter.h
1850 ++++ b/include/linux/percpu_counter.h
1851 +@@ -76,9 +76,9 @@ static inline s64 percpu_counter_read(struct percpu_counter *fbc)
1852 + */
1853 + static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc)
1854 + {
1855 +- s64 ret = fbc->count;
1856 ++ /* Prevent reloads of fbc->count */
1857 ++ s64 ret = READ_ONCE(fbc->count);
1858 +
1859 +- barrier(); /* Prevent reloads of fbc->count */
1860 + if (ret >= 0)
1861 + return ret;
1862 + return 0;
1863 +diff --git a/include/linux/sched.h b/include/linux/sched.h
1864 +index 761247c966a5..df5f53ea2f86 100644
1865 +--- a/include/linux/sched.h
1866 ++++ b/include/linux/sched.h
1867 +@@ -1612,8 +1612,8 @@ struct task_struct {
1868 + struct seccomp seccomp;
1869 +
1870 + /* Thread group tracking */
1871 +- u32 parent_exec_id;
1872 +- u32 self_exec_id;
1873 ++ u64 parent_exec_id;
1874 ++ u64 self_exec_id;
1875 + /* Protection of (de-)allocation: mm, files, fs, tty, keyrings, mems_allowed,
1876 + * mempolicy */
1877 + spinlock_t alloc_lock;
1878 +diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
1879 +index b8a8d4239e85..df6474c37ca0 100644
1880 +--- a/include/net/ip6_route.h
1881 ++++ b/include/net/ip6_route.h
1882 +@@ -171,6 +171,7 @@ static inline bool ipv6_anycast_destination(const struct dst_entry *dst,
1883 +
1884 + return rt->rt6i_flags & RTF_ANYCAST ||
1885 + (rt->rt6i_dst.plen != 128 &&
1886 ++ !(rt->rt6i_flags & (RTF_GATEWAY | RTF_NONEXTHOP)) &&
1887 + ipv6_addr_equal(&rt->rt6i_dst.addr, daddr));
1888 + }
1889 +
1890 +diff --git a/kernel/futex.c b/kernel/futex.c
1891 +index a322303b4d75..e50b67674ba2 100644
1892 +--- a/kernel/futex.c
1893 ++++ b/kernel/futex.c
1894 +@@ -1479,8 +1479,16 @@ static int futex_atomic_op_inuser(unsigned int encoded_op, u32 __user *uaddr)
1895 + int oldval, ret;
1896 +
1897 + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) {
1898 +- if (oparg < 0 || oparg > 31)
1899 +- return -EINVAL;
1900 ++ if (oparg < 0 || oparg > 31) {
1901 ++ char comm[sizeof(current->comm)];
1902 ++ /*
1903 ++ * kill this print and return -EINVAL when userspace
1904 ++ * is sane again
1905 ++ */
1906 ++ pr_info_ratelimited("futex_wake_op: %s tries to shift op by %d; fix this program\n",
1907 ++ get_task_comm(comm, current), oparg);
1908 ++ oparg &= 31;
1909 ++ }
1910 + oparg = 1 << oparg;
1911 + }
1912 +
1913 +diff --git a/kernel/kmod.c b/kernel/kmod.c
1914 +index 0277d1216f80..e4e5e98002fe 100644
1915 +--- a/kernel/kmod.c
1916 ++++ b/kernel/kmod.c
1917 +@@ -119,7 +119,7 @@ out:
1918 + * invoke it.
1919 + *
1920 + * If module auto-loading support is disabled then this function
1921 +- * becomes a no-operation.
1922 ++ * simply returns -ENOENT.
1923 + */
1924 + int __request_module(bool wait, const char *fmt, ...)
1925 + {
1926 +@@ -140,7 +140,7 @@ int __request_module(bool wait, const char *fmt, ...)
1927 + WARN_ON_ONCE(wait && current_is_async());
1928 +
1929 + if (!modprobe_path[0])
1930 +- return 0;
1931 ++ return -ENOENT;
1932 +
1933 + va_start(args, fmt);
1934 + ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);
1935 +diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
1936 +index a419696709a1..0a00720d3ccc 100644
1937 +--- a/kernel/locking/lockdep.c
1938 ++++ b/kernel/locking/lockdep.c
1939 +@@ -1265,9 +1265,11 @@ unsigned long lockdep_count_forward_deps(struct lock_class *class)
1940 + this.class = class;
1941 +
1942 + raw_local_irq_save(flags);
1943 ++ current->lockdep_recursion = 1;
1944 + arch_spin_lock(&lockdep_lock);
1945 + ret = __lockdep_count_forward_deps(&this);
1946 + arch_spin_unlock(&lockdep_lock);
1947 ++ current->lockdep_recursion = 0;
1948 + raw_local_irq_restore(flags);
1949 +
1950 + return ret;
1951 +@@ -1292,9 +1294,11 @@ unsigned long lockdep_count_backward_deps(struct lock_class *class)
1952 + this.class = class;
1953 +
1954 + raw_local_irq_save(flags);
1955 ++ current->lockdep_recursion = 1;
1956 + arch_spin_lock(&lockdep_lock);
1957 + ret = __lockdep_count_backward_deps(&this);
1958 + arch_spin_unlock(&lockdep_lock);
1959 ++ current->lockdep_recursion = 0;
1960 + raw_local_irq_restore(flags);
1961 +
1962 + return ret;
1963 +diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
1964 +index d580b7d6ee6d..ad5aea269f76 100644
1965 +--- a/kernel/locking/locktorture.c
1966 ++++ b/kernel/locking/locktorture.c
1967 +@@ -655,10 +655,10 @@ static void __torture_print_stats(char *page,
1968 + if (statp[i].n_lock_fail)
1969 + fail = true;
1970 + sum += statp[i].n_lock_acquired;
1971 +- if (max < statp[i].n_lock_fail)
1972 +- max = statp[i].n_lock_fail;
1973 +- if (min > statp[i].n_lock_fail)
1974 +- min = statp[i].n_lock_fail;
1975 ++ if (max < statp[i].n_lock_acquired)
1976 ++ max = statp[i].n_lock_acquired;
1977 ++ if (min > statp[i].n_lock_acquired)
1978 ++ min = statp[i].n_lock_acquired;
1979 + }
1980 + page += sprintf(page,
1981 + "%s: Total: %lld Max/Min: %ld/%ld %s Fail: %d %s\n",
1982 +diff --git a/kernel/signal.c b/kernel/signal.c
1983 +index 90a94e54db09..6aa9ca45ebb1 100644
1984 +--- a/kernel/signal.c
1985 ++++ b/kernel/signal.c
1986 +@@ -1660,7 +1660,7 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
1987 + * This is only possible if parent == real_parent.
1988 + * Check if it has changed security domain.
1989 + */
1990 +- if (tsk->parent_exec_id != tsk->parent->self_exec_id)
1991 ++ if (tsk->parent_exec_id != READ_ONCE(tsk->parent->self_exec_id))
1992 + sig = SIGCHLD;
1993 + }
1994 +
1995 +diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
1996 +index 6524920c6ebc..78346aba6980 100644
1997 +--- a/kernel/trace/trace_events_trigger.c
1998 ++++ b/kernel/trace/trace_events_trigger.c
1999 +@@ -910,14 +910,10 @@ register_snapshot_trigger(char *glob, struct event_trigger_ops *ops,
2000 + struct event_trigger_data *data,
2001 + struct trace_event_file *file)
2002 + {
2003 +- int ret = register_trigger(glob, ops, data, file);
2004 +-
2005 +- if (ret > 0 && tracing_alloc_snapshot() != 0) {
2006 +- unregister_trigger(glob, ops, data, file);
2007 +- ret = 0;
2008 +- }
2009 ++ if (tracing_alloc_snapshot() != 0)
2010 ++ return 0;
2011 +
2012 +- return ret;
2013 ++ return register_trigger(glob, ops, data, file);
2014 + }
2015 +
2016 + static int
2017 +diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
2018 +index dbbe6f051a92..03ccacff3c3d 100644
2019 +--- a/net/ipv4/devinet.c
2020 ++++ b/net/ipv4/devinet.c
2021 +@@ -560,12 +560,15 @@ struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix,
2022 + return NULL;
2023 + }
2024 +
2025 +-static int ip_mc_config(struct sock *sk, bool join, const struct in_ifaddr *ifa)
2026 ++static int ip_mc_autojoin_config(struct net *net, bool join,
2027 ++ const struct in_ifaddr *ifa)
2028 + {
2029 ++#if defined(CONFIG_IP_MULTICAST)
2030 + struct ip_mreqn mreq = {
2031 + .imr_multiaddr.s_addr = ifa->ifa_address,
2032 + .imr_ifindex = ifa->ifa_dev->dev->ifindex,
2033 + };
2034 ++ struct sock *sk = net->ipv4.mc_autojoin_sk;
2035 + int ret;
2036 +
2037 + ASSERT_RTNL();
2038 +@@ -578,6 +581,9 @@ static int ip_mc_config(struct sock *sk, bool join, const struct in_ifaddr *ifa)
2039 + release_sock(sk);
2040 +
2041 + return ret;
2042 ++#else
2043 ++ return -EOPNOTSUPP;
2044 ++#endif
2045 + }
2046 +
2047 + static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh)
2048 +@@ -617,7 +623,7 @@ static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh)
2049 + continue;
2050 +
2051 + if (ipv4_is_multicast(ifa->ifa_address))
2052 +- ip_mc_config(net->ipv4.mc_autojoin_sk, false, ifa);
2053 ++ ip_mc_autojoin_config(net, false, ifa);
2054 + __inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).portid);
2055 + return 0;
2056 + }
2057 +@@ -873,8 +879,7 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh)
2058 + */
2059 + set_ifa_lifetime(ifa, valid_lft, prefered_lft);
2060 + if (ifa->ifa_flags & IFA_F_MCAUTOJOIN) {
2061 +- int ret = ip_mc_config(net->ipv4.mc_autojoin_sk,
2062 +- true, ifa);
2063 ++ int ret = ip_mc_autojoin_config(net, true, ifa);
2064 +
2065 + if (ret < 0) {
2066 + inet_free_ifa(ifa);
2067 +diff --git a/security/keys/key.c b/security/keys/key.c
2068 +index 03160f1f1aa2..b5c8324ecf62 100644
2069 +--- a/security/keys/key.c
2070 ++++ b/security/keys/key.c
2071 +@@ -376,7 +376,7 @@ int key_payload_reserve(struct key *key, size_t datalen)
2072 + spin_lock(&key->user->lock);
2073 +
2074 + if (delta > 0 &&
2075 +- (key->user->qnbytes + delta >= maxbytes ||
2076 ++ (key->user->qnbytes + delta > maxbytes ||
2077 + key->user->qnbytes + delta < key->user->qnbytes)) {
2078 + ret = -EDQUOT;
2079 + }
2080 +diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
2081 +index 2e741e1a8712..292b583e591b 100644
2082 +--- a/security/keys/keyctl.c
2083 ++++ b/security/keys/keyctl.c
2084 +@@ -853,8 +853,8 @@ long keyctl_chown_key(key_serial_t id, uid_t user, gid_t group)
2085 + key_quota_root_maxbytes : key_quota_maxbytes;
2086 +
2087 + spin_lock(&newowner->lock);
2088 +- if (newowner->qnkeys + 1 >= maxkeys ||
2089 +- newowner->qnbytes + key->quotalen >= maxbytes ||
2090 ++ if (newowner->qnkeys + 1 > maxkeys ||
2091 ++ newowner->qnbytes + key->quotalen > maxbytes ||
2092 + newowner->qnbytes + key->quotalen <
2093 + newowner->qnbytes)
2094 + goto quota_overrun;
2095 +diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c
2096 +index 0e3dd6014ce5..7c5d124d538c 100644
2097 +--- a/sound/core/oss/pcm_plugin.c
2098 ++++ b/sound/core/oss/pcm_plugin.c
2099 +@@ -196,7 +196,9 @@ int snd_pcm_plugin_free(struct snd_pcm_plugin *plugin)
2100 + return 0;
2101 + }
2102 +
2103 +-snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_pcm_uframes_t drv_frames)
2104 ++static snd_pcm_sframes_t plug_client_size(struct snd_pcm_substream *plug,
2105 ++ snd_pcm_uframes_t drv_frames,
2106 ++ bool check_size)
2107 + {
2108 + struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next;
2109 + int stream;
2110 +@@ -209,7 +211,7 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p
2111 + if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
2112 + plugin = snd_pcm_plug_last(plug);
2113 + while (plugin && drv_frames > 0) {
2114 +- if (drv_frames > plugin->buf_frames)
2115 ++ if (check_size && drv_frames > plugin->buf_frames)
2116 + drv_frames = plugin->buf_frames;
2117 + plugin_prev = plugin->prev;
2118 + if (plugin->src_frames)
2119 +@@ -222,7 +224,7 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p
2120 + plugin_next = plugin->next;
2121 + if (plugin->dst_frames)
2122 + drv_frames = plugin->dst_frames(plugin, drv_frames);
2123 +- if (drv_frames > plugin->buf_frames)
2124 ++ if (check_size && drv_frames > plugin->buf_frames)
2125 + drv_frames = plugin->buf_frames;
2126 + plugin = plugin_next;
2127 + }
2128 +@@ -231,7 +233,9 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p
2129 + return drv_frames;
2130 + }
2131 +
2132 +-snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pcm_uframes_t clt_frames)
2133 ++static snd_pcm_sframes_t plug_slave_size(struct snd_pcm_substream *plug,
2134 ++ snd_pcm_uframes_t clt_frames,
2135 ++ bool check_size)
2136 + {
2137 + struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next;
2138 + snd_pcm_sframes_t frames;
2139 +@@ -252,14 +256,14 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pc
2140 + if (frames < 0)
2141 + return frames;
2142 + }
2143 +- if (frames > plugin->buf_frames)
2144 ++ if (check_size && frames > plugin->buf_frames)
2145 + frames = plugin->buf_frames;
2146 + plugin = plugin_next;
2147 + }
2148 + } else if (stream == SNDRV_PCM_STREAM_CAPTURE) {
2149 + plugin = snd_pcm_plug_last(plug);
2150 + while (plugin) {
2151 +- if (frames > plugin->buf_frames)
2152 ++ if (check_size && frames > plugin->buf_frames)
2153 + frames = plugin->buf_frames;
2154 + plugin_prev = plugin->prev;
2155 + if (plugin->src_frames) {
2156 +@@ -274,6 +278,18 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pc
2157 + return frames;
2158 + }
2159 +
2160 ++snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug,
2161 ++ snd_pcm_uframes_t drv_frames)
2162 ++{
2163 ++ return plug_client_size(plug, drv_frames, false);
2164 ++}
2165 ++
2166 ++snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug,
2167 ++ snd_pcm_uframes_t clt_frames)
2168 ++{
2169 ++ return plug_slave_size(plug, clt_frames, false);
2170 ++}
2171 ++
2172 + static int snd_pcm_plug_formats(struct snd_mask *mask, snd_pcm_format_t format)
2173 + {
2174 + struct snd_mask formats = *mask;
2175 +@@ -628,7 +644,7 @@ snd_pcm_sframes_t snd_pcm_plug_write_transfer(struct snd_pcm_substream *plug, st
2176 + src_channels = dst_channels;
2177 + plugin = next;
2178 + }
2179 +- return snd_pcm_plug_client_size(plug, frames);
2180 ++ return plug_client_size(plug, frames, true);
2181 + }
2182 +
2183 + snd_pcm_sframes_t snd_pcm_plug_read_transfer(struct snd_pcm_substream *plug, struct snd_pcm_plugin_channel *dst_channels_final, snd_pcm_uframes_t size)
2184 +@@ -638,7 +654,7 @@ snd_pcm_sframes_t snd_pcm_plug_read_transfer(struct snd_pcm_substream *plug, str
2185 + snd_pcm_sframes_t frames = size;
2186 + int err;
2187 +
2188 +- frames = snd_pcm_plug_slave_size(plug, frames);
2189 ++ frames = plug_slave_size(plug, frames, true);
2190 + if (frames < 0)
2191 + return frames;
2192 +
2193 +diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c
2194 +index c397e7da0eac..7ccfb09535e1 100644
2195 +--- a/sound/pci/hda/hda_beep.c
2196 ++++ b/sound/pci/hda/hda_beep.c
2197 +@@ -310,8 +310,12 @@ int snd_hda_mixer_amp_switch_get_beep(struct snd_kcontrol *kcontrol,
2198 + {
2199 + struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2200 + struct hda_beep *beep = codec->beep;
2201 ++ int chs = get_amp_channels(kcontrol);
2202 ++
2203 + if (beep && (!beep->enabled || !ctl_has_mute(kcontrol))) {
2204 +- ucontrol->value.integer.value[0] =
2205 ++ if (chs & 1)
2206 ++ ucontrol->value.integer.value[0] = beep->enabled;
2207 ++ if (chs & 2)
2208 + ucontrol->value.integer.value[1] = beep->enabled;
2209 + return 0;
2210 + }
2211 +diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
2212 +index 16664b07b553..825d9b27dbe1 100644
2213 +--- a/sound/pci/hda/hda_codec.c
2214 ++++ b/sound/pci/hda/hda_codec.c
2215 +@@ -876,6 +876,7 @@ int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card,
2216 +
2217 + /* power-up all before initialization */
2218 + hda_set_power_state(codec, AC_PWRST_D0);
2219 ++ codec->core.dev.power.power_state = PMSG_ON;
2220 +
2221 + snd_hda_codec_proc_new(codec);
2222 +
2223 +diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
2224 +index 3e3277100f08..faf255439702 100644
2225 +--- a/sound/pci/hda/hda_intel.c
2226 ++++ b/sound/pci/hda/hda_intel.c
2227 +@@ -1839,24 +1839,15 @@ static void azx_firmware_cb(const struct firmware *fw, void *context)
2228 + {
2229 + struct snd_card *card = context;
2230 + struct azx *chip = card->private_data;
2231 +- struct pci_dev *pci = chip->pci;
2232 +-
2233 +- if (!fw) {
2234 +- dev_err(card->dev, "Cannot load firmware, aborting\n");
2235 +- goto error;
2236 +- }
2237 +
2238 +- chip->fw = fw;
2239 ++ if (fw)
2240 ++ chip->fw = fw;
2241 ++ else
2242 ++ dev_err(card->dev, "Cannot load firmware, continue without patching\n");
2243 + if (!chip->disabled) {
2244 + /* continue probing */
2245 +- if (azx_probe_continue(chip))
2246 +- goto error;
2247 ++ azx_probe_continue(chip);
2248 + }
2249 +- return; /* OK */
2250 +-
2251 +- error:
2252 +- snd_card_free(card);
2253 +- pci_set_drvdata(pci, NULL);
2254 + }
2255 + #endif
2256 +
2257 +@@ -1982,6 +1973,17 @@ static const struct hdac_io_ops pci_hda_io_ops = {
2258 + .dma_free_pages = dma_free_pages,
2259 + };
2260 +
2261 ++/* Blacklist for skipping the whole probe:
2262 ++ * some HD-audio PCI entries are exposed without any codecs, and such devices
2263 ++ * should be ignored from the beginning.
2264 ++ */
2265 ++static const struct snd_pci_quirk driver_blacklist[] = {
2266 ++ SND_PCI_QUIRK(0x1043, 0x874f, "ASUS ROG Zenith II / Strix", 0),
2267 ++ SND_PCI_QUIRK(0x1462, 0xcb59, "MSI TRX40 Creator", 0),
2268 ++ SND_PCI_QUIRK(0x1462, 0xcb60, "MSI TRX40", 0),
2269 ++ {}
2270 ++};
2271 ++
2272 + static const struct hda_controller_ops pci_hda_ops = {
2273 + .disable_msi_reset_irq = disable_msi_reset_irq,
2274 + .substream_alloc_pages = substream_alloc_pages,
2275 +@@ -2001,6 +2003,11 @@ static int azx_probe(struct pci_dev *pci,
2276 + bool schedule_probe;
2277 + int err;
2278 +
2279 ++ if (snd_pci_quirk_lookup(pci, driver_blacklist)) {
2280 ++ dev_info(&pci->dev, "Skipping the blacklisted device\n");
2281 ++ return -ENODEV;
2282 ++ }
2283 ++
2284 + if (dev >= SNDRV_CARDS)
2285 + return -ENODEV;
2286 + if (!enable[dev]) {
2287 +diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c
2288 +index 2697402b5195..41f6450a2539 100644
2289 +--- a/sound/pci/ice1712/prodigy_hifi.c
2290 ++++ b/sound/pci/ice1712/prodigy_hifi.c
2291 +@@ -569,7 +569,7 @@ static int wm_adc_mux_enum_get(struct snd_kcontrol *kcontrol,
2292 + struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
2293 +
2294 + mutex_lock(&ice->gpio_mutex);
2295 +- ucontrol->value.integer.value[0] = wm_get(ice, WM_ADC_MUX) & 0x1f;
2296 ++ ucontrol->value.enumerated.item[0] = wm_get(ice, WM_ADC_MUX) & 0x1f;
2297 + mutex_unlock(&ice->gpio_mutex);
2298 + return 0;
2299 + }
2300 +@@ -583,7 +583,7 @@ static int wm_adc_mux_enum_put(struct snd_kcontrol *kcontrol,
2301 +
2302 + mutex_lock(&ice->gpio_mutex);
2303 + oval = wm_get(ice, WM_ADC_MUX);
2304 +- nval = (oval & 0xe0) | ucontrol->value.integer.value[0];
2305 ++ nval = (oval & 0xe0) | ucontrol->value.enumerated.item[0];
2306 + if (nval != oval) {
2307 + wm_put(ice, WM_ADC_MUX, nval);
2308 + change = 1;
2309 +diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c
2310 +index d55388e082e1..b070d4754745 100644
2311 +--- a/sound/soc/intel/atom/sst-atom-controls.c
2312 ++++ b/sound/soc/intel/atom/sst-atom-controls.c
2313 +@@ -1318,7 +1318,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute)
2314 + dai->capture_widget->name);
2315 + w = dai->capture_widget;
2316 + snd_soc_dapm_widget_for_each_source_path(w, p) {
2317 +- if (p->connected && !p->connected(w, p->sink))
2318 ++ if (p->connected && !p->connected(w, p->source))
2319 + continue;
2320 +
2321 + if (p->connect && p->source->power &&
2322 +diff --git a/sound/soc/intel/atom/sst/sst_pci.c b/sound/soc/intel/atom/sst/sst_pci.c
2323 +index 3a0b3bf0af97..e9c6894cc27f 100644
2324 +--- a/sound/soc/intel/atom/sst/sst_pci.c
2325 ++++ b/sound/soc/intel/atom/sst/sst_pci.c
2326 +@@ -107,7 +107,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
2327 + dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
2328 + do_release_regions:
2329 + pci_release_regions(pci);
2330 +- return 0;
2331 ++ return ret;
2332 + }
2333 +
2334 + /*
2335 +diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
2336 +index b245379b4dfc..2798f4bb7fe4 100644
2337 +--- a/sound/soc/soc-dapm.c
2338 ++++ b/sound/soc/soc-dapm.c
2339 +@@ -751,7 +751,13 @@ static void dapm_set_mixer_path_status(struct snd_soc_dapm_path *p, int i)
2340 + val = max - val;
2341 + p->connect = !!val;
2342 + } else {
2343 +- p->connect = 0;
2344 ++ /* since a virtual mixer has no backing registers to
2345 ++ * decide which path to connect, it will try to match
2346 ++ * with initial state. This is to ensure
2347 ++ * that the default mixer choice will be
2348 ++ * correctly powered up during initialization.
2349 ++ */
2350 ++ p->connect = invert;
2351 + }
2352 + }
2353 +
2354 +diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
2355 +index 2f67ba6d7a8f..acacbce2a821 100644
2356 +--- a/sound/soc/soc-ops.c
2357 ++++ b/sound/soc/soc-ops.c
2358 +@@ -837,7 +837,7 @@ int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol,
2359 + unsigned int regbase = mc->regbase;
2360 + unsigned int regcount = mc->regcount;
2361 + unsigned int regwshift = component->val_bytes * BITS_PER_BYTE;
2362 +- unsigned int regwmask = (1<<regwshift)-1;
2363 ++ unsigned int regwmask = (1UL<<regwshift)-1;
2364 + unsigned int invert = mc->invert;
2365 + unsigned long mask = (1UL<<mc->nbits)-1;
2366 + long min = mc->min;
2367 +@@ -886,7 +886,7 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
2368 + unsigned int regbase = mc->regbase;
2369 + unsigned int regcount = mc->regcount;
2370 + unsigned int regwshift = component->val_bytes * BITS_PER_BYTE;
2371 +- unsigned int regwmask = (1<<regwshift)-1;
2372 ++ unsigned int regwmask = (1UL<<regwshift)-1;
2373 + unsigned int invert = mc->invert;
2374 + unsigned long mask = (1UL<<mc->nbits)-1;
2375 + long max = mc->max;
2376 +diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
2377 +index 7cffa98ec313..d4bf3dc6b015 100644
2378 +--- a/sound/soc/soc-pcm.c
2379 ++++ b/sound/soc/soc-pcm.c
2380 +@@ -1951,7 +1951,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
2381 + switch (cmd) {
2382 + case SNDRV_PCM_TRIGGER_START:
2383 + if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) &&
2384 +- (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP))
2385 ++ (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) &&
2386 ++ (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
2387 + continue;
2388 +
2389 + ret = dpcm_do_trigger(dpcm, be_substream, cmd);
2390 +@@ -1981,7 +1982,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream,
2391 + be->dpcm[stream].state = SND_SOC_DPCM_STATE_START;
2392 + break;
2393 + case SNDRV_PCM_TRIGGER_STOP:
2394 +- if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START)
2395 ++ if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) &&
2396 ++ (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
2397 + continue;
2398 +
2399 + if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream))
2400 +diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
2401 +index 824f4d7fc41f..0675ab3fec6c 100644
2402 +--- a/sound/soc/soc-topology.c
2403 ++++ b/sound/soc/soc-topology.c
2404 +@@ -378,7 +378,7 @@ static int soc_tplg_add_kcontrol(struct soc_tplg *tplg,
2405 + struct snd_soc_component *comp = tplg->comp;
2406 +
2407 + return soc_tplg_add_dcontrol(comp->card->snd_card,
2408 +- comp->dev, k, NULL, comp, kcontrol);
2409 ++ comp->dev, k, comp->name_prefix, comp, kcontrol);
2410 + }
2411 +
2412 + /* remove a mixer kcontrol */
2413 +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
2414 +index 73149b9be29c..f191f4a3cf3b 100644
2415 +--- a/sound/usb/mixer.c
2416 ++++ b/sound/usb/mixer.c
2417 +@@ -2269,7 +2269,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
2418 + if (map->id == state.chip->usb_id) {
2419 + state.map = map->map;
2420 + state.selector_map = map->selector_map;
2421 +- mixer->ignore_ctl_error = map->ignore_ctl_error;
2422 ++ mixer->ignore_ctl_error |= map->ignore_ctl_error;
2423 + break;
2424 + }
2425 + }
2426 +diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
2427 +index f5cf23ffb35b..a9f36f53d9d3 100644
2428 +--- a/sound/usb/mixer_maps.c
2429 ++++ b/sound/usb/mixer_maps.c
2430 +@@ -361,6 +361,14 @@ static const struct usbmix_name_map dell_alc4020_map[] = {
2431 + { 0 }
2432 + };
2433 +
2434 ++/* Some mobos shipped with a dummy HD-audio show the invalid GET_MIN/GET_MAX
2435 ++ * response for Input Gain Pad (id=19, control=12). Skip it.
2436 ++ */
2437 ++static const struct usbmix_name_map asus_rog_map[] = {
2438 ++ { 19, NULL, 12 }, /* FU, Input Gain Pad */
2439 ++ {}
2440 ++};
2441 ++
2442 + /*
2443 + * Control map entries
2444 + */
2445 +@@ -480,6 +488,26 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
2446 + .id = USB_ID(0x05a7, 0x1020),
2447 + .map = bose_companion5_map,
2448 + },
2449 ++ { /* Gigabyte TRX40 Aorus Pro WiFi */
2450 ++ .id = USB_ID(0x0414, 0xa002),
2451 ++ .map = asus_rog_map,
2452 ++ },
2453 ++ { /* ASUS ROG Zenith II */
2454 ++ .id = USB_ID(0x0b05, 0x1916),
2455 ++ .map = asus_rog_map,
2456 ++ },
2457 ++ { /* ASUS ROG Strix */
2458 ++ .id = USB_ID(0x0b05, 0x1917),
2459 ++ .map = asus_rog_map,
2460 ++ },
2461 ++ { /* MSI TRX40 Creator */
2462 ++ .id = USB_ID(0x0db0, 0x0d64),
2463 ++ .map = asus_rog_map,
2464 ++ },
2465 ++ { /* MSI TRX40 */
2466 ++ .id = USB_ID(0x0db0, 0x543d),
2467 ++ .map = asus_rog_map,
2468 ++ },
2469 + { 0 } /* terminator */
2470 + };
2471 +
2472 +diff --git a/tools/testing/selftests/x86/ptrace_syscall.c b/tools/testing/selftests/x86/ptrace_syscall.c
2473 +index 5105b49cd8aa..8b3c1236f04d 100644
2474 +--- a/tools/testing/selftests/x86/ptrace_syscall.c
2475 ++++ b/tools/testing/selftests/x86/ptrace_syscall.c
2476 +@@ -284,8 +284,12 @@ int main()
2477 +
2478 + #if defined(__i386__) && (!defined(__GLIBC__) || __GLIBC__ > 2 || __GLIBC_MINOR__ >= 16)
2479 + vsyscall32 = (void *)getauxval(AT_SYSINFO);
2480 +- printf("[RUN]\tCheck AT_SYSINFO return regs\n");
2481 +- test_sys32_regs(do_full_vsyscall32);
2482 ++ if (vsyscall32) {
2483 ++ printf("[RUN]\tCheck AT_SYSINFO return regs\n");
2484 ++ test_sys32_regs(do_full_vsyscall32);
2485 ++ } else {
2486 ++ printf("[SKIP]\tAT_SYSINFO is not available\n");
2487 ++ }
2488 + #endif
2489 +
2490 + test_ptrace_syscall_restart();