Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.14 commit in: /
Date: Wed, 01 Jul 2020 12:13:47
Message-Id: 1593605611.69c11b1237a5b9382dfef7abd26fd04e45711b58.mpagano@gentoo
1 commit: 69c11b1237a5b9382dfef7abd26fd04e45711b58
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 1 12:13:31 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 1 12:13:31 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=69c11b12
7
8 Linux patch 4.14.187
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1186_linux-4.14.187.patch | 2099 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2103 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index a5ce682..165efa8 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -787,6 +787,10 @@ Patch: 1185_linux-4.14.186.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.14.186
23
24 +Patch: 1186_linux-4.14.187.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.14.187
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/1186_linux-4.14.187.patch b/1186_linux-4.14.187.patch
33 new file mode 100644
34 index 0000000..67ed497
35 --- /dev/null
36 +++ b/1186_linux-4.14.187.patch
37 @@ -0,0 +1,2099 @@
38 +diff --git a/Makefile b/Makefile
39 +index 5152fefccab5..42b7d816d102 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 14
46 +-SUBLEVEL = 186
47 ++SUBLEVEL = 187
48 + EXTRAVERSION =
49 + NAME = Petit Gorille
50 +
51 +diff --git a/arch/arm/boot/dts/bcm-nsp.dtsi b/arch/arm/boot/dts/bcm-nsp.dtsi
52 +index 1792192001a2..e975f9cabe84 100644
53 +--- a/arch/arm/boot/dts/bcm-nsp.dtsi
54 ++++ b/arch/arm/boot/dts/bcm-nsp.dtsi
55 +@@ -249,10 +249,10 @@
56 + status = "disabled";
57 + };
58 +
59 +- mailbox: mailbox@25000 {
60 ++ mailbox: mailbox@25c00 {
61 + compatible = "brcm,iproc-fa2-mbox";
62 +- reg = <0x25000 0x445>;
63 +- interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
64 ++ reg = <0x25c00 0x400>;
65 ++ interrupts = <GIC_SPI 151 IRQ_TYPE_LEVEL_HIGH>;
66 + #mbox-cells = <1>;
67 + brcm,rx-status-len = <32>;
68 + brcm,use-bcm-hdr;
69 +diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c
70 +index 868781fd460c..14c630c899c5 100644
71 +--- a/arch/arm/mach-imx/pm-imx5.c
72 ++++ b/arch/arm/mach-imx/pm-imx5.c
73 +@@ -301,14 +301,14 @@ static int __init imx_suspend_alloc_ocram(
74 + if (!ocram_pool) {
75 + pr_warn("%s: ocram pool unavailable!\n", __func__);
76 + ret = -ENODEV;
77 +- goto put_node;
78 ++ goto put_device;
79 + }
80 +
81 + ocram_base = gen_pool_alloc(ocram_pool, size);
82 + if (!ocram_base) {
83 + pr_warn("%s: unable to alloc ocram!\n", __func__);
84 + ret = -ENOMEM;
85 +- goto put_node;
86 ++ goto put_device;
87 + }
88 +
89 + phys = gen_pool_virt_to_phys(ocram_pool, ocram_base);
90 +@@ -318,6 +318,8 @@ static int __init imx_suspend_alloc_ocram(
91 + if (virt_out)
92 + *virt_out = virt;
93 +
94 ++put_device:
95 ++ put_device(&pdev->dev);
96 + put_node:
97 + of_node_put(node);
98 +
99 +diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c
100 +index 1d091d048d04..0819db91ca94 100644
101 +--- a/arch/arm64/kernel/perf_regs.c
102 ++++ b/arch/arm64/kernel/perf_regs.c
103 +@@ -15,15 +15,34 @@ u64 perf_reg_value(struct pt_regs *regs, int idx)
104 + return 0;
105 +
106 + /*
107 +- * Compat (i.e. 32 bit) mode:
108 +- * - PC has been set in the pt_regs struct in kernel_entry,
109 +- * - Handle SP and LR here.
110 ++ * Our handling of compat tasks (PERF_SAMPLE_REGS_ABI_32) is weird, but
111 ++ * we're stuck with it for ABI compatability reasons.
112 ++ *
113 ++ * For a 32-bit consumer inspecting a 32-bit task, then it will look at
114 ++ * the first 16 registers (see arch/arm/include/uapi/asm/perf_regs.h).
115 ++ * These correspond directly to a prefix of the registers saved in our
116 ++ * 'struct pt_regs', with the exception of the PC, so we copy that down
117 ++ * (x15 corresponds to SP_hyp in the architecture).
118 ++ *
119 ++ * So far, so good.
120 ++ *
121 ++ * The oddity arises when a 64-bit consumer looks at a 32-bit task and
122 ++ * asks for registers beyond PERF_REG_ARM_MAX. In this case, we return
123 ++ * SP_usr, LR_usr and PC in the positions where the AArch64 SP, LR and
124 ++ * PC registers would normally live. The initial idea was to allow a
125 ++ * 64-bit unwinder to unwind a 32-bit task and, although it's not clear
126 ++ * how well that works in practice, somebody might be relying on it.
127 ++ *
128 ++ * At the time we make a sample, we don't know whether the consumer is
129 ++ * 32-bit or 64-bit, so we have to cater for both possibilities.
130 + */
131 + if (compat_user_mode(regs)) {
132 + if ((u32)idx == PERF_REG_ARM64_SP)
133 + return regs->compat_sp;
134 + if ((u32)idx == PERF_REG_ARM64_LR)
135 + return regs->compat_lr;
136 ++ if (idx == 15)
137 ++ return regs->pc;
138 + }
139 +
140 + if ((u32)idx == PERF_REG_ARM64_SP)
141 +diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
142 +index 56e0190d6e65..42e4cd20fbbe 100644
143 +--- a/arch/s390/kernel/ptrace.c
144 ++++ b/arch/s390/kernel/ptrace.c
145 +@@ -322,6 +322,25 @@ static inline void __poke_user_per(struct task_struct *child,
146 + child->thread.per_user.end = data;
147 + }
148 +
149 ++static void fixup_int_code(struct task_struct *child, addr_t data)
150 ++{
151 ++ struct pt_regs *regs = task_pt_regs(child);
152 ++ int ilc = regs->int_code >> 16;
153 ++ u16 insn;
154 ++
155 ++ if (ilc > 6)
156 ++ return;
157 ++
158 ++ if (ptrace_access_vm(child, regs->psw.addr - (regs->int_code >> 16),
159 ++ &insn, sizeof(insn), FOLL_FORCE) != sizeof(insn))
160 ++ return;
161 ++
162 ++ /* double check that tracee stopped on svc instruction */
163 ++ if ((insn >> 8) != 0xa)
164 ++ return;
165 ++
166 ++ regs->int_code = 0x20000 | (data & 0xffff);
167 ++}
168 + /*
169 + * Write a word to the user area of a process at location addr. This
170 + * operation does have an additional problem compared to peek_user.
171 +@@ -333,7 +352,9 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
172 + struct user *dummy = NULL;
173 + addr_t offset;
174 +
175 ++
176 + if (addr < (addr_t) &dummy->regs.acrs) {
177 ++ struct pt_regs *regs = task_pt_regs(child);
178 + /*
179 + * psw and gprs are stored on the stack
180 + */
181 +@@ -351,7 +372,11 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
182 + /* Invalid addressing mode bits */
183 + return -EINVAL;
184 + }
185 +- *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data;
186 ++
187 ++ if (test_pt_regs_flag(regs, PIF_SYSCALL) &&
188 ++ addr == offsetof(struct user, regs.gprs[2]))
189 ++ fixup_int_code(child, data);
190 ++ *(addr_t *)((addr_t) &regs->psw + addr) = data;
191 +
192 + } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) {
193 + /*
194 +@@ -717,6 +742,10 @@ static int __poke_user_compat(struct task_struct *child,
195 + regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) |
196 + (__u64)(tmp & PSW32_ADDR_AMODE);
197 + } else {
198 ++
199 ++ if (test_pt_regs_flag(regs, PIF_SYSCALL) &&
200 ++ addr == offsetof(struct compat_user, regs.gprs[2]))
201 ++ fixup_int_code(child, data);
202 + /* gpr 0-15 */
203 + *(__u32*)((addr_t) &regs->psw + addr*2 + 4) = tmp;
204 + }
205 +diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c
206 +index 60f7205ebe40..646dd58169ec 100644
207 +--- a/arch/sparc/kernel/ptrace_32.c
208 ++++ b/arch/sparc/kernel/ptrace_32.c
209 +@@ -168,12 +168,17 @@ static int genregs32_set(struct task_struct *target,
210 + if (ret || !count)
211 + return ret;
212 + ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
213 +- &regs->y,
214 ++ &regs->npc,
215 + 34 * sizeof(u32), 35 * sizeof(u32));
216 + if (ret || !count)
217 + return ret;
218 ++ ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
219 ++ &regs->y,
220 ++ 35 * sizeof(u32), 36 * sizeof(u32));
221 ++ if (ret || !count)
222 ++ return ret;
223 + return user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
224 +- 35 * sizeof(u32), 38 * sizeof(u32));
225 ++ 36 * sizeof(u32), 38 * sizeof(u32));
226 + }
227 +
228 + static int fpregs32_get(struct task_struct *target,
229 +diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
230 +index 9529fe69e1d9..ecb6009a2c8a 100644
231 +--- a/arch/x86/include/asm/kvm_host.h
232 ++++ b/arch/x86/include/asm/kvm_host.h
233 +@@ -1060,7 +1060,7 @@ struct kvm_x86_ops {
234 + void (*enable_log_dirty_pt_masked)(struct kvm *kvm,
235 + struct kvm_memory_slot *slot,
236 + gfn_t offset, unsigned long mask);
237 +- int (*write_log_dirty)(struct kvm_vcpu *vcpu);
238 ++ int (*write_log_dirty)(struct kvm_vcpu *vcpu, gpa_t l2_gpa);
239 +
240 + /* pmu operations of sub-arch */
241 + const struct kvm_pmu_ops *pmu_ops;
242 +diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
243 +index 082d0cea72f4..9df3d5d7214a 100644
244 +--- a/arch/x86/kvm/mmu.c
245 ++++ b/arch/x86/kvm/mmu.c
246 +@@ -1713,10 +1713,10 @@ void kvm_arch_mmu_enable_log_dirty_pt_masked(struct kvm *kvm,
247 + * Emulate arch specific page modification logging for the
248 + * nested hypervisor
249 + */
250 +-int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu)
251 ++int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu, gpa_t l2_gpa)
252 + {
253 + if (kvm_x86_ops->write_log_dirty)
254 +- return kvm_x86_ops->write_log_dirty(vcpu);
255 ++ return kvm_x86_ops->write_log_dirty(vcpu, l2_gpa);
256 +
257 + return 0;
258 + }
259 +diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h
260 +index 068feab64acf..816a626b6250 100644
261 +--- a/arch/x86/kvm/mmu.h
262 ++++ b/arch/x86/kvm/mmu.h
263 +@@ -194,7 +194,7 @@ void kvm_mmu_gfn_disallow_lpage(struct kvm_memory_slot *slot, gfn_t gfn);
264 + void kvm_mmu_gfn_allow_lpage(struct kvm_memory_slot *slot, gfn_t gfn);
265 + bool kvm_mmu_slot_gfn_write_protect(struct kvm *kvm,
266 + struct kvm_memory_slot *slot, u64 gfn);
267 +-int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu);
268 ++int kvm_arch_write_log_dirty(struct kvm_vcpu *vcpu, gpa_t l2_gpa);
269 +
270 + int kvm_mmu_post_init_vm(struct kvm *kvm);
271 + void kvm_mmu_pre_destroy_vm(struct kvm *kvm);
272 +diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
273 +index 8cf7a09bdd73..7260a165488d 100644
274 +--- a/arch/x86/kvm/paging_tmpl.h
275 ++++ b/arch/x86/kvm/paging_tmpl.h
276 +@@ -202,7 +202,7 @@ static inline unsigned FNAME(gpte_access)(struct kvm_vcpu *vcpu, u64 gpte)
277 + static int FNAME(update_accessed_dirty_bits)(struct kvm_vcpu *vcpu,
278 + struct kvm_mmu *mmu,
279 + struct guest_walker *walker,
280 +- int write_fault)
281 ++ gpa_t addr, int write_fault)
282 + {
283 + unsigned level, index;
284 + pt_element_t pte, orig_pte;
285 +@@ -227,7 +227,7 @@ static int FNAME(update_accessed_dirty_bits)(struct kvm_vcpu *vcpu,
286 + !(pte & PT_GUEST_DIRTY_MASK)) {
287 + trace_kvm_mmu_set_dirty_bit(table_gfn, index, sizeof(pte));
288 + #if PTTYPE == PTTYPE_EPT
289 +- if (kvm_arch_write_log_dirty(vcpu))
290 ++ if (kvm_arch_write_log_dirty(vcpu, addr))
291 + return -EINVAL;
292 + #endif
293 + pte |= PT_GUEST_DIRTY_MASK;
294 +@@ -424,7 +424,8 @@ retry_walk:
295 + (PT_GUEST_DIRTY_SHIFT - PT_GUEST_ACCESSED_SHIFT);
296 +
297 + if (unlikely(!accessed_dirty)) {
298 +- ret = FNAME(update_accessed_dirty_bits)(vcpu, mmu, walker, write_fault);
299 ++ ret = FNAME(update_accessed_dirty_bits)(vcpu, mmu, walker,
300 ++ addr, write_fault);
301 + if (unlikely(ret < 0))
302 + goto error;
303 + else if (ret)
304 +diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
305 +index 42c6ca05a613..11e683ec6c85 100644
306 +--- a/arch/x86/kvm/vmx.c
307 ++++ b/arch/x86/kvm/vmx.c
308 +@@ -12462,11 +12462,10 @@ static void vmx_flush_log_dirty(struct kvm *kvm)
309 + kvm_flush_pml_buffers(kvm);
310 + }
311 +
312 +-static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu)
313 ++static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu, gpa_t gpa)
314 + {
315 + struct vmcs12 *vmcs12;
316 + struct vcpu_vmx *vmx = to_vmx(vcpu);
317 +- gpa_t gpa;
318 + struct page *page = NULL;
319 + u64 *pml_address;
320 +
321 +@@ -12487,7 +12486,7 @@ static int vmx_write_pml_buffer(struct kvm_vcpu *vcpu)
322 + return 1;
323 + }
324 +
325 +- gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS) & ~0xFFFull;
326 ++ gpa &= ~0xFFFull;
327 +
328 + page = kvm_vcpu_gpa_to_page(vcpu, vmcs12->pml_address);
329 + if (is_error_page(page))
330 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
331 +index 3401061a2231..0db7f5cd9c72 100644
332 +--- a/arch/x86/kvm/x86.c
333 ++++ b/arch/x86/kvm/x86.c
334 +@@ -2344,7 +2344,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
335 + return kvm_mtrr_set_msr(vcpu, msr, data);
336 + case MSR_IA32_APICBASE:
337 + return kvm_set_apic_base(vcpu, msr_info);
338 +- case APIC_BASE_MSR ... APIC_BASE_MSR + 0x3ff:
339 ++ case APIC_BASE_MSR ... APIC_BASE_MSR + 0xff:
340 + return kvm_x2apic_msr_write(vcpu, msr, data);
341 + case MSR_IA32_TSCDEADLINE:
342 + kvm_set_lapic_tscdeadline_msr(vcpu, data);
343 +@@ -2629,7 +2629,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
344 + case MSR_IA32_APICBASE:
345 + msr_info->data = kvm_get_apic_base(vcpu);
346 + break;
347 +- case APIC_BASE_MSR ... APIC_BASE_MSR + 0x3ff:
348 ++ case APIC_BASE_MSR ... APIC_BASE_MSR + 0xff:
349 + return kvm_x2apic_msr_read(vcpu, msr_info->index, &msr_info->data);
350 + break;
351 + case MSR_IA32_TSCDEADLINE:
352 +diff --git a/block/bio-integrity.c b/block/bio-integrity.c
353 +index 7f8010662437..d3df44c3b43a 100644
354 +--- a/block/bio-integrity.c
355 ++++ b/block/bio-integrity.c
356 +@@ -315,7 +315,6 @@ bool bio_integrity_prep(struct bio *bio)
357 +
358 + if (ret == 0) {
359 + printk(KERN_ERR "could not attach integrity payload\n");
360 +- kfree(buf);
361 + status = BLK_STS_RESOURCE;
362 + goto err_end_io;
363 + }
364 +diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
365 +index a663014cfa52..3b7e23866b42 100644
366 +--- a/drivers/acpi/sysfs.c
367 ++++ b/drivers/acpi/sysfs.c
368 +@@ -942,13 +942,13 @@ static void __exit interrupt_stats_exit(void)
369 + }
370 +
371 + static ssize_t
372 +-acpi_show_profile(struct device *dev, struct device_attribute *attr,
373 ++acpi_show_profile(struct kobject *kobj, struct kobj_attribute *attr,
374 + char *buf)
375 + {
376 + return sprintf(buf, "%d\n", acpi_gbl_FADT.preferred_profile);
377 + }
378 +
379 +-static const struct device_attribute pm_profile_attr =
380 ++static const struct kobj_attribute pm_profile_attr =
381 + __ATTR(pm_profile, S_IRUGO, acpi_show_profile, NULL);
382 +
383 + static ssize_t hotplug_enabled_show(struct kobject *kobj,
384 +diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
385 +index 2f81d6534270..bc2c27f0493f 100644
386 +--- a/drivers/ata/libata-scsi.c
387 ++++ b/drivers/ata/libata-scsi.c
388 +@@ -3996,12 +3996,13 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
389 + {
390 + struct scsi_cmnd *scmd = qc->scsicmd;
391 + const u8 *cdb = scmd->cmnd;
392 +- const u8 *p;
393 + u8 pg, spg;
394 + unsigned six_byte, pg_len, hdr_len, bd_len;
395 + int len;
396 + u16 fp = (u16)-1;
397 + u8 bp = 0xff;
398 ++ u8 buffer[64];
399 ++ const u8 *p = buffer;
400 +
401 + VPRINTK("ENTER\n");
402 +
403 +@@ -4035,12 +4036,14 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
404 + if (!scsi_sg_count(scmd) || scsi_sglist(scmd)->length < len)
405 + goto invalid_param_len;
406 +
407 +- p = page_address(sg_page(scsi_sglist(scmd)));
408 +-
409 + /* Move past header and block descriptors. */
410 + if (len < hdr_len)
411 + goto invalid_param_len;
412 +
413 ++ if (!sg_copy_to_buffer(scsi_sglist(scmd), scsi_sg_count(scmd),
414 ++ buffer, sizeof(buffer)))
415 ++ goto invalid_param_len;
416 ++
417 + if (six_byte)
418 + bd_len = p[3];
419 + else
420 +diff --git a/drivers/block/loop.c b/drivers/block/loop.c
421 +index 453e3728e657..c6157ccb9498 100644
422 +--- a/drivers/block/loop.c
423 ++++ b/drivers/block/loop.c
424 +@@ -1110,7 +1110,7 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
425 + if (lo->lo_offset != info->lo_offset ||
426 + lo->lo_sizelimit != info->lo_sizelimit) {
427 + sync_blockdev(lo->lo_device);
428 +- kill_bdev(lo->lo_device);
429 ++ invalidate_bdev(lo->lo_device);
430 + }
431 +
432 + /* I/O need to be drained during transfer transition */
433 +@@ -1380,12 +1380,12 @@ static int loop_set_block_size(struct loop_device *lo, unsigned long arg)
434 +
435 + if (lo->lo_queue->limits.logical_block_size != arg) {
436 + sync_blockdev(lo->lo_device);
437 +- kill_bdev(lo->lo_device);
438 ++ invalidate_bdev(lo->lo_device);
439 + }
440 +
441 + blk_mq_freeze_queue(lo->lo_queue);
442 +
443 +- /* kill_bdev should have truncated all the pages */
444 ++ /* invalidate_bdev should have truncated all the pages */
445 + if (lo->lo_queue->limits.logical_block_size != arg &&
446 + lo->lo_device->bd_inode->i_mapping->nrpages) {
447 + err = -EAGAIN;
448 +diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c
449 +index f3c28777b8c6..deb1d8f3bdc8 100644
450 +--- a/drivers/firmware/efi/esrt.c
451 ++++ b/drivers/firmware/efi/esrt.c
452 +@@ -180,7 +180,7 @@ static int esre_create_sysfs_entry(void *esre, int entry_num)
453 + rc = kobject_init_and_add(&entry->kobj, &esre1_ktype, NULL,
454 + "entry%d", entry_num);
455 + if (rc) {
456 +- kfree(entry);
457 ++ kobject_put(&entry->kobj);
458 + return rc;
459 + }
460 + }
461 +diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c
462 +index 9416e72f86aa..d491b3aa124f 100644
463 +--- a/drivers/gpu/drm/radeon/ni_dpm.c
464 ++++ b/drivers/gpu/drm/radeon/ni_dpm.c
465 +@@ -2126,7 +2126,7 @@ static int ni_init_smc_spll_table(struct radeon_device *rdev)
466 + if (clk_s & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_SHIFT))
467 + ret = -EINVAL;
468 +
469 +- if (clk_s & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKS_SHIFT))
470 ++ if (fb_div & ~(SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_FBDIV_SHIFT))
471 + ret = -EINVAL;
472 +
473 + if (clk_v & ~(SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_MASK >> SMC_NISLANDS_SPLL_DIV_TABLE_CLKV_SHIFT))
474 +diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
475 +index d901591db9c8..6e8af2b91492 100644
476 +--- a/drivers/infiniband/core/cma.c
477 ++++ b/drivers/infiniband/core/cma.c
478 +@@ -1482,6 +1482,8 @@ static struct rdma_id_private *cma_find_listener(
479 + {
480 + struct rdma_id_private *id_priv, *id_priv_dev;
481 +
482 ++ lockdep_assert_held(&lock);
483 ++
484 + if (!bind_list)
485 + return ERR_PTR(-EINVAL);
486 +
487 +@@ -1530,6 +1532,7 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id,
488 + }
489 + }
490 +
491 ++ mutex_lock(&lock);
492 + /*
493 + * Net namespace might be getting deleted while route lookup,
494 + * cm_id lookup is in progress. Therefore, perform netdevice
495 +@@ -1571,6 +1574,7 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id,
496 + id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev);
497 + err:
498 + rcu_read_unlock();
499 ++ mutex_unlock(&lock);
500 + if (IS_ERR(id_priv) && *net_dev) {
501 + dev_put(*net_dev);
502 + *net_dev = NULL;
503 +@@ -2287,6 +2291,8 @@ static void cma_listen_on_dev(struct rdma_id_private *id_priv,
504 + struct net *net = id_priv->id.route.addr.dev_addr.net;
505 + int ret;
506 +
507 ++ lockdep_assert_held(&lock);
508 ++
509 + if (cma_family(id_priv) == AF_IB && !rdma_cap_ib_cm(cma_dev->device, 1))
510 + return;
511 +
512 +@@ -2993,6 +2999,8 @@ static void cma_bind_port(struct rdma_bind_list *bind_list,
513 + u64 sid, mask;
514 + __be16 port;
515 +
516 ++ lockdep_assert_held(&lock);
517 ++
518 + addr = cma_src_addr(id_priv);
519 + port = htons(bind_list->port);
520 +
521 +@@ -3021,6 +3029,8 @@ static int cma_alloc_port(enum rdma_port_space ps,
522 + struct rdma_bind_list *bind_list;
523 + int ret;
524 +
525 ++ lockdep_assert_held(&lock);
526 ++
527 + bind_list = kzalloc(sizeof *bind_list, GFP_KERNEL);
528 + if (!bind_list)
529 + return -ENOMEM;
530 +@@ -3047,6 +3057,8 @@ static int cma_port_is_unique(struct rdma_bind_list *bind_list,
531 + struct sockaddr *saddr = cma_src_addr(id_priv);
532 + __be16 dport = cma_port(daddr);
533 +
534 ++ lockdep_assert_held(&lock);
535 ++
536 + hlist_for_each_entry(cur_id, &bind_list->owners, node) {
537 + struct sockaddr *cur_daddr = cma_dst_addr(cur_id);
538 + struct sockaddr *cur_saddr = cma_src_addr(cur_id);
539 +@@ -3086,6 +3098,8 @@ static int cma_alloc_any_port(enum rdma_port_space ps,
540 + unsigned int rover;
541 + struct net *net = id_priv->id.route.addr.dev_addr.net;
542 +
543 ++ lockdep_assert_held(&lock);
544 ++
545 + inet_get_local_port_range(net, &low, &high);
546 + remaining = (high - low) + 1;
547 + rover = prandom_u32() % remaining + low;
548 +@@ -3133,6 +3147,8 @@ static int cma_check_port(struct rdma_bind_list *bind_list,
549 + struct rdma_id_private *cur_id;
550 + struct sockaddr *addr, *cur_addr;
551 +
552 ++ lockdep_assert_held(&lock);
553 ++
554 + addr = cma_src_addr(id_priv);
555 + hlist_for_each_entry(cur_id, &bind_list->owners, node) {
556 + if (id_priv == cur_id)
557 +@@ -3163,6 +3179,8 @@ static int cma_use_port(enum rdma_port_space ps,
558 + unsigned short snum;
559 + int ret;
560 +
561 ++ lockdep_assert_held(&lock);
562 ++
563 + snum = ntohs(cma_port(cma_src_addr(id_priv)));
564 + if (snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE))
565 + return -EACCES;
566 +diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
567 +index 6072ac7023cb..08d2e9cc28eb 100644
568 +--- a/drivers/infiniband/core/mad.c
569 ++++ b/drivers/infiniband/core/mad.c
570 +@@ -2907,6 +2907,7 @@ static int ib_mad_post_receive_mads(struct ib_mad_qp_info *qp_info,
571 + DMA_FROM_DEVICE);
572 + if (unlikely(ib_dma_mapping_error(qp_info->port_priv->device,
573 + sg_list.addr))) {
574 ++ kfree(mad_priv);
575 + ret = -ENOMEM;
576 + break;
577 + }
578 +diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
579 +index 5e5022fa1d04..85029d43da75 100644
580 +--- a/drivers/net/ethernet/atheros/alx/main.c
581 ++++ b/drivers/net/ethernet/atheros/alx/main.c
582 +@@ -1250,8 +1250,12 @@ out_disable_adv_intr:
583 +
584 + static void __alx_stop(struct alx_priv *alx)
585 + {
586 +- alx_halt(alx);
587 + alx_free_irq(alx);
588 ++
589 ++ cancel_work_sync(&alx->link_check_wk);
590 ++ cancel_work_sync(&alx->reset_wk);
591 ++
592 ++ alx_halt(alx);
593 + alx_free_rings(alx);
594 + alx_free_napis(alx);
595 + }
596 +@@ -1863,9 +1867,6 @@ static void alx_remove(struct pci_dev *pdev)
597 + struct alx_priv *alx = pci_get_drvdata(pdev);
598 + struct alx_hw *hw = &alx->hw;
599 +
600 +- cancel_work_sync(&alx->link_check_wk);
601 +- cancel_work_sync(&alx->reset_wk);
602 +-
603 + /* restore permanent mac address */
604 + alx_set_macaddr(hw, hw->perm_addr);
605 +
606 +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
607 +index 7d3cbbd88a00..8bfa2523e253 100644
608 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
609 ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
610 +@@ -1567,11 +1567,6 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
611 + goto out;
612 + }
613 +
614 +- if (skb_padto(skb, ETH_ZLEN)) {
615 +- ret = NETDEV_TX_OK;
616 +- goto out;
617 +- }
618 +-
619 + /* Retain how many bytes will be sent on the wire, without TSB inserted
620 + * by transmit checksum offload
621 + */
622 +@@ -1621,6 +1616,9 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
623 + len_stat = (size << DMA_BUFLENGTH_SHIFT) |
624 + (priv->hw_params->qtag_mask << DMA_TX_QTAG_SHIFT);
625 +
626 ++ /* Note: if we ever change from DMA_TX_APPEND_CRC below we
627 ++ * will need to restore software padding of "runt" packets
628 ++ */
629 + if (!i) {
630 + len_stat |= DMA_TX_APPEND_CRC | DMA_SOP;
631 + if (skb->ip_summed == CHECKSUM_PARTIAL)
632 +diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
633 +index bc0221eafe5c..e40d31b40525 100644
634 +--- a/drivers/net/ethernet/broadcom/tg3.c
635 ++++ b/drivers/net/ethernet/broadcom/tg3.c
636 +@@ -18179,8 +18179,8 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev,
637 +
638 + rtnl_lock();
639 +
640 +- /* We probably don't have netdev yet */
641 +- if (!netdev || !netif_running(netdev))
642 ++ /* Could be second call or maybe we don't have netdev yet */
643 ++ if (!netdev || tp->pcierr_recovery || !netif_running(netdev))
644 + goto done;
645 +
646 + /* We needn't recover from permanent error */
647 +diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
648 +index 880d925438c1..b43aebfc7f5b 100644
649 +--- a/drivers/net/ethernet/ibm/ibmveth.c
650 ++++ b/drivers/net/ethernet/ibm/ibmveth.c
651 +@@ -1695,7 +1695,7 @@ static int ibmveth_probe(struct vio_dev *dev, const struct vio_device_id *id)
652 + }
653 +
654 + netdev->min_mtu = IBMVETH_MIN_MTU;
655 +- netdev->max_mtu = ETH_MAX_MTU;
656 ++ netdev->max_mtu = ETH_MAX_MTU - IBMVETH_BUFF_OH;
657 +
658 + memcpy(netdev->dev_addr, mac_addr_p, ETH_ALEN);
659 +
660 +diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
661 +index 27ba476f761d..4fc3468f6f38 100644
662 +--- a/drivers/net/ethernet/qlogic/qed/qed_cxt.c
663 ++++ b/drivers/net/ethernet/qlogic/qed/qed_cxt.c
664 +@@ -396,7 +396,7 @@ static void qed_cxt_qm_iids(struct qed_hwfn *p_hwfn,
665 + vf_tids += segs[NUM_TASK_PF_SEGMENTS].count;
666 + }
667 +
668 +- iids->vf_cids += vf_cids * p_mngr->vf_count;
669 ++ iids->vf_cids = vf_cids;
670 + iids->tids += vf_tids * p_mngr->vf_count;
671 +
672 + DP_VERBOSE(p_hwfn, QED_MSG_ILT,
673 +diff --git a/drivers/net/ethernet/qlogic/qed/qed_vf.c b/drivers/net/ethernet/qlogic/qed/qed_vf.c
674 +index a2a9921b467b..693f2a039383 100644
675 +--- a/drivers/net/ethernet/qlogic/qed/qed_vf.c
676 ++++ b/drivers/net/ethernet/qlogic/qed/qed_vf.c
677 +@@ -81,12 +81,17 @@ static void qed_vf_pf_req_end(struct qed_hwfn *p_hwfn, int req_status)
678 + mutex_unlock(&(p_hwfn->vf_iov_info->mutex));
679 + }
680 +
681 ++#define QED_VF_CHANNEL_USLEEP_ITERATIONS 90
682 ++#define QED_VF_CHANNEL_USLEEP_DELAY 100
683 ++#define QED_VF_CHANNEL_MSLEEP_ITERATIONS 10
684 ++#define QED_VF_CHANNEL_MSLEEP_DELAY 25
685 ++
686 + static int qed_send_msg2pf(struct qed_hwfn *p_hwfn, u8 *done, u32 resp_size)
687 + {
688 + union vfpf_tlvs *p_req = p_hwfn->vf_iov_info->vf2pf_request;
689 + struct ustorm_trigger_vf_zone trigger;
690 + struct ustorm_vf_zone *zone_data;
691 +- int rc = 0, time = 100;
692 ++ int iter, rc = 0;
693 +
694 + zone_data = (struct ustorm_vf_zone *)PXP_VF_BAR0_START_USDM_ZONE_B;
695 +
696 +@@ -126,11 +131,19 @@ static int qed_send_msg2pf(struct qed_hwfn *p_hwfn, u8 *done, u32 resp_size)
697 + REG_WR(p_hwfn, (uintptr_t)&zone_data->trigger, *((u32 *)&trigger));
698 +
699 + /* When PF would be done with the response, it would write back to the
700 +- * `done' address. Poll until then.
701 ++ * `done' address from a coherent DMA zone. Poll until then.
702 + */
703 +- while ((!*done) && time) {
704 +- msleep(25);
705 +- time--;
706 ++
707 ++ iter = QED_VF_CHANNEL_USLEEP_ITERATIONS;
708 ++ while (!*done && iter--) {
709 ++ udelay(QED_VF_CHANNEL_USLEEP_DELAY);
710 ++ dma_rmb();
711 ++ }
712 ++
713 ++ iter = QED_VF_CHANNEL_MSLEEP_ITERATIONS;
714 ++ while (!*done && iter--) {
715 ++ msleep(QED_VF_CHANNEL_MSLEEP_DELAY);
716 ++ dma_rmb();
717 + }
718 +
719 + if (!*done) {
720 +diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c
721 +index 056cb6093630..8ad05e500829 100644
722 +--- a/drivers/net/ethernet/rocker/rocker_main.c
723 ++++ b/drivers/net/ethernet/rocker/rocker_main.c
724 +@@ -651,10 +651,10 @@ static int rocker_dma_rings_init(struct rocker *rocker)
725 + err_dma_event_ring_bufs_alloc:
726 + rocker_dma_ring_destroy(rocker, &rocker->event_ring);
727 + err_dma_event_ring_create:
728 ++ rocker_dma_cmd_ring_waits_free(rocker);
729 ++err_dma_cmd_ring_waits_alloc:
730 + rocker_dma_ring_bufs_free(rocker, &rocker->cmd_ring,
731 + PCI_DMA_BIDIRECTIONAL);
732 +-err_dma_cmd_ring_waits_alloc:
733 +- rocker_dma_cmd_ring_waits_free(rocker);
734 + err_dma_cmd_ring_bufs_alloc:
735 + rocker_dma_ring_destroy(rocker, &rocker->cmd_ring);
736 + return err;
737 +diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c
738 +index 0f69b77e8502..875639b0e9d5 100644
739 +--- a/drivers/net/usb/ax88179_178a.c
740 ++++ b/drivers/net/usb/ax88179_178a.c
741 +@@ -1400,10 +1400,10 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
742 + }
743 +
744 + if (pkt_cnt == 0) {
745 +- /* Skip IP alignment psudo header */
746 +- skb_pull(skb, 2);
747 + skb->len = pkt_len;
748 +- skb_set_tail_pointer(skb, pkt_len);
749 ++ /* Skip IP alignment pseudo header */
750 ++ skb_pull(skb, 2);
751 ++ skb_set_tail_pointer(skb, skb->len);
752 + skb->truesize = pkt_len + sizeof(struct sk_buff);
753 + ax88179_rx_checksum(skb, pkt_hdr);
754 + return 1;
755 +@@ -1412,8 +1412,9 @@ static int ax88179_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
756 + ax_skb = skb_clone(skb, GFP_ATOMIC);
757 + if (ax_skb) {
758 + ax_skb->len = pkt_len;
759 +- ax_skb->data = skb->data + 2;
760 +- skb_set_tail_pointer(ax_skb, pkt_len);
761 ++ /* Skip IP alignment pseudo header */
762 ++ skb_pull(ax_skb, 2);
763 ++ skb_set_tail_pointer(ax_skb, ax_skb->len);
764 + ax_skb->truesize = pkt_len + sizeof(struct sk_buff);
765 + ax88179_rx_checksum(ax_skb, pkt_hdr);
766 + usbnet_skb_return(dev, ax_skb);
767 +diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
768 +index 9654898f3e51..6748e82c6352 100644
769 +--- a/drivers/scsi/scsi_devinfo.c
770 ++++ b/drivers/scsi/scsi_devinfo.c
771 +@@ -449,7 +449,8 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor,
772 + /*
773 + * vendor strings must be an exact match
774 + */
775 +- if (vmax != strlen(devinfo->vendor) ||
776 ++ if (vmax != strnlen(devinfo->vendor,
777 ++ sizeof(devinfo->vendor)) ||
778 + memcmp(devinfo->vendor, vskip, vmax))
779 + continue;
780 +
781 +@@ -457,7 +458,7 @@ static struct scsi_dev_info_list *scsi_dev_info_list_find(const char *vendor,
782 + * @model specifies the full string, and
783 + * must be larger or equal to devinfo->model
784 + */
785 +- mlen = strlen(devinfo->model);
786 ++ mlen = strnlen(devinfo->model, sizeof(devinfo->model));
787 + if (mmax < mlen || memcmp(devinfo->model, mskip, mlen))
788 + continue;
789 + return devinfo;
790 +diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
791 +index f485f541e36d..d6de62ee681e 100644
792 +--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
793 ++++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
794 +@@ -1904,12 +1904,14 @@ int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie, uint var_ie_l
795 + pIE = (struct ndis_80211_var_ie *)rtw_get_ie(pvar_ie, _SUPPORTEDRATES_IE_, &ie_len, var_ie_len);
796 + if (pIE == NULL)
797 + return _FAIL;
798 ++ if (ie_len > sizeof(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates))
799 ++ return _FAIL;
800 +
801 + memcpy(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates, pIE->data, ie_len);
802 + supportRateNum = ie_len;
803 +
804 + pIE = (struct ndis_80211_var_ie *)rtw_get_ie(pvar_ie, _EXT_SUPPORTEDRATES_IE_, &ie_len, var_ie_len);
805 +- if (pIE)
806 ++ if (pIE && (ie_len <= sizeof(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates) - supportRateNum))
807 + memcpy((pmlmeinfo->FW_sta_info[cam_idx].SupportedRates + supportRateNum), pIE->data, ie_len);
808 +
809 + return _SUCCESS;
810 +diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
811 +index 663cbe3669e1..d52221ae1b85 100644
812 +--- a/drivers/tty/hvc/hvc_console.c
813 ++++ b/drivers/tty/hvc/hvc_console.c
814 +@@ -88,8 +88,6 @@ static LIST_HEAD(hvc_structs);
815 + */
816 + static DEFINE_SPINLOCK(hvc_structs_lock);
817 +
818 +-/* Mutex to serialize hvc_open */
819 +-static DEFINE_MUTEX(hvc_open_mutex);
820 + /*
821 + * This value is used to assign a tty->index value to a hvc_struct based
822 + * upon order of exposure via hvc_probe(), when we can not match it to
823 +@@ -334,24 +332,16 @@ static int hvc_install(struct tty_driver *driver, struct tty_struct *tty)
824 + */
825 + static int hvc_open(struct tty_struct *tty, struct file * filp)
826 + {
827 +- struct hvc_struct *hp;
828 ++ struct hvc_struct *hp = tty->driver_data;
829 + unsigned long flags;
830 + int rc = 0;
831 +
832 +- mutex_lock(&hvc_open_mutex);
833 +-
834 +- hp = tty->driver_data;
835 +- if (!hp) {
836 +- rc = -EIO;
837 +- goto out;
838 +- }
839 +-
840 + spin_lock_irqsave(&hp->port.lock, flags);
841 + /* Check and then increment for fast path open. */
842 + if (hp->port.count++ > 0) {
843 + spin_unlock_irqrestore(&hp->port.lock, flags);
844 + hvc_kick();
845 +- goto out;
846 ++ return 0;
847 + } /* else count == 0 */
848 + spin_unlock_irqrestore(&hp->port.lock, flags);
849 +
850 +@@ -379,8 +369,6 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
851 + /* Force wakeup of the polling thread */
852 + hvc_kick();
853 +
854 +-out:
855 +- mutex_unlock(&hvc_open_mutex);
856 + return rc;
857 + }
858 +
859 +diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
860 +index 4067f079b08d..0de467c8593d 100644
861 +--- a/drivers/usb/class/cdc-acm.c
862 ++++ b/drivers/usb/class/cdc-acm.c
863 +@@ -1734,6 +1734,8 @@ static int acm_pre_reset(struct usb_interface *intf)
864 +
865 + static const struct usb_device_id acm_ids[] = {
866 + /* quirky and broken devices */
867 ++ { USB_DEVICE(0x0424, 0x274e), /* Microchip Technology, Inc. (formerly SMSC) */
868 ++ .driver_info = DISABLE_ECHO, }, /* DISABLE ECHO in termios flag */
869 + { USB_DEVICE(0x076d, 0x0006), /* Denso Cradle CU-321 */
870 + .driver_info = NO_UNION_NORMAL, },/* has no union descriptor */
871 + { USB_DEVICE(0x17ef, 0x7000), /* Lenovo USB modem */
872 +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
873 +index 27d05f0134de..e6e0f786547b 100644
874 +--- a/drivers/usb/core/quirks.c
875 ++++ b/drivers/usb/core/quirks.c
876 +@@ -73,11 +73,12 @@ static const struct usb_device_id usb_quirk_list[] = {
877 + /* Logitech HD Webcam C270 */
878 + { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME },
879 +
880 +- /* Logitech HD Pro Webcams C920, C920-C, C925e and C930e */
881 ++ /* Logitech HD Pro Webcams C920, C920-C, C922, C925e and C930e */
882 + { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT },
883 + { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT },
884 + { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT },
885 + { USB_DEVICE(0x046d, 0x085b), .driver_info = USB_QUIRK_DELAY_INIT },
886 ++ { USB_DEVICE(0x046d, 0x085c), .driver_info = USB_QUIRK_DELAY_INIT },
887 +
888 + /* Logitech ConferenceCam CC3000e */
889 + { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT },
890 +diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
891 +index aeb6f7c84ea0..03bc479d04e0 100644
892 +--- a/drivers/usb/dwc2/gadget.c
893 ++++ b/drivers/usb/dwc2/gadget.c
894 +@@ -4723,12 +4723,6 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
895 + epnum, 0);
896 + }
897 +
898 +- ret = usb_add_gadget_udc(dev, &hsotg->gadget);
899 +- if (ret) {
900 +- dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep,
901 +- hsotg->ctrl_req);
902 +- return ret;
903 +- }
904 + dwc2_hsotg_dump(hsotg);
905 +
906 + return 0;
907 +diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
908 +index daf0d37acb37..c8ac0391e65f 100644
909 +--- a/drivers/usb/dwc2/platform.c
910 ++++ b/drivers/usb/dwc2/platform.c
911 +@@ -452,6 +452,17 @@ static int dwc2_driver_probe(struct platform_device *dev)
912 + if (hsotg->dr_mode == USB_DR_MODE_PERIPHERAL)
913 + dwc2_lowlevel_hw_disable(hsotg);
914 +
915 ++#if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
916 ++ IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
917 ++ /* Postponed adding a new gadget to the udc class driver list */
918 ++ if (hsotg->gadget_enabled) {
919 ++ retval = usb_add_gadget_udc(hsotg->dev, &hsotg->gadget);
920 ++ if (retval) {
921 ++ dwc2_hsotg_remove(hsotg);
922 ++ goto error;
923 ++ }
924 ++ }
925 ++#endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */
926 + return 0;
927 +
928 + error:
929 +diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c
930 +index 4103bf7cf52a..62fad60d0c06 100644
931 +--- a/drivers/usb/gadget/udc/mv_udc_core.c
932 ++++ b/drivers/usb/gadget/udc/mv_udc_core.c
933 +@@ -2317,7 +2317,8 @@ static int mv_udc_probe(struct platform_device *pdev)
934 + return 0;
935 +
936 + err_create_workqueue:
937 +- destroy_workqueue(udc->qwork);
938 ++ if (udc->qwork)
939 ++ destroy_workqueue(udc->qwork);
940 + err_destroy_dma:
941 + dma_pool_destroy(udc->dtd_pool);
942 + err_free_dma:
943 +diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
944 +index 26b641100639..be72a625dc21 100644
945 +--- a/drivers/usb/host/ehci-exynos.c
946 ++++ b/drivers/usb/host/ehci-exynos.c
947 +@@ -199,9 +199,8 @@ skip_phy:
948 + hcd->rsrc_len = resource_size(res);
949 +
950 + irq = platform_get_irq(pdev, 0);
951 +- if (!irq) {
952 +- dev_err(&pdev->dev, "Failed to get IRQ\n");
953 +- err = -ENODEV;
954 ++ if (irq < 0) {
955 ++ err = irq;
956 + goto fail_io;
957 + }
958 +
959 +diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
960 +index 93326974ff4b..265c9af1d2b5 100644
961 +--- a/drivers/usb/host/ehci-pci.c
962 ++++ b/drivers/usb/host/ehci-pci.c
963 +@@ -229,6 +229,13 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
964 + ehci_info(ehci, "applying MosChip frame-index workaround\n");
965 + ehci->frame_index_bug = 1;
966 + break;
967 ++ case PCI_VENDOR_ID_HUAWEI:
968 ++ /* Synopsys HC bug */
969 ++ if (pdev->device == 0xa239) {
970 ++ ehci_info(ehci, "applying Synopsys HC workaround\n");
971 ++ ehci->has_synopsys_hc_bug = 1;
972 ++ }
973 ++ break;
974 + }
975 +
976 + /* optional debug port, normally in the first BAR */
977 +diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
978 +index d4e0f7cd96fa..b5592fb518e3 100644
979 +--- a/drivers/usb/host/ohci-sm501.c
980 ++++ b/drivers/usb/host/ohci-sm501.c
981 +@@ -195,6 +195,7 @@ static int ohci_hcd_sm501_drv_remove(struct platform_device *pdev)
982 + struct resource *mem;
983 +
984 + usb_remove_hcd(hcd);
985 ++ iounmap(hcd->regs);
986 + release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
987 + usb_put_hcd(hcd);
988 + dma_release_declared_memory(&pdev->dev);
989 +diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
990 +index 35aecbcac6f7..945e108cffb8 100644
991 +--- a/drivers/usb/host/xhci-mtk.c
992 ++++ b/drivers/usb/host/xhci-mtk.c
993 +@@ -726,6 +726,9 @@ static int xhci_mtk_remove(struct platform_device *dev)
994 + struct xhci_hcd *xhci = hcd_to_xhci(hcd);
995 + struct usb_hcd *shared_hcd = xhci->shared_hcd;
996 +
997 ++ pm_runtime_put_noidle(&dev->dev);
998 ++ pm_runtime_disable(&dev->dev);
999 ++
1000 + usb_remove_hcd(shared_hcd);
1001 + xhci->shared_hcd = NULL;
1002 + xhci_mtk_phy_power_off(mtk);
1003 +@@ -738,8 +741,6 @@ static int xhci_mtk_remove(struct platform_device *dev)
1004 + xhci_mtk_sch_exit(mtk);
1005 + xhci_mtk_clks_disable(mtk);
1006 + xhci_mtk_ldos_disable(mtk);
1007 +- pm_runtime_put_sync(&dev->dev);
1008 +- pm_runtime_disable(&dev->dev);
1009 +
1010 + return 0;
1011 + }
1012 +diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
1013 +index 6c0a0ca316d3..cdf1c9155403 100644
1014 +--- a/drivers/usb/host/xhci.c
1015 ++++ b/drivers/usb/host/xhci.c
1016 +@@ -1346,6 +1346,7 @@ static int xhci_check_maxpacket(struct xhci_hcd *xhci, unsigned int slot_id,
1017 + xhci->devs[slot_id]->out_ctx, ep_index);
1018 +
1019 + ep_ctx = xhci_get_ep_ctx(xhci, command->in_ctx, ep_index);
1020 ++ ep_ctx->ep_info &= cpu_to_le32(~EP_STATE_MASK);/* must clear */
1021 + ep_ctx->ep_info2 &= cpu_to_le32(~MAX_PACKET_MASK);
1022 + ep_ctx->ep_info2 |= cpu_to_le32(MAX_PACKET(max_packet_size));
1023 +
1024 +@@ -4225,6 +4226,9 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
1025 + mutex_lock(hcd->bandwidth_mutex);
1026 + xhci_change_max_exit_latency(xhci, udev, 0);
1027 + mutex_unlock(hcd->bandwidth_mutex);
1028 ++ readl_poll_timeout(port_array[port_num], pm_val,
1029 ++ (pm_val & PORT_PLS_MASK) == XDEV_U0,
1030 ++ 100, 10000);
1031 + return 0;
1032 + }
1033 + }
1034 +diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
1035 +index db1af99d53bd..8b52a7773bc8 100644
1036 +--- a/drivers/usb/host/xhci.h
1037 ++++ b/drivers/usb/host/xhci.h
1038 +@@ -718,7 +718,7 @@ struct xhci_ep_ctx {
1039 + * 4 - TRB error
1040 + * 5-7 - reserved
1041 + */
1042 +-#define EP_STATE_MASK (0xf)
1043 ++#define EP_STATE_MASK (0x7)
1044 + #define EP_STATE_DISABLED 0
1045 + #define EP_STATE_RUNNING 1
1046 + #define EP_STATE_HALTED 2
1047 +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
1048 +index ad138f0b0ce1..39ad582d72c4 100644
1049 +--- a/fs/btrfs/inode.c
1050 ++++ b/fs/btrfs/inode.c
1051 +@@ -8947,9 +8947,6 @@ static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
1052 + dio_data.overwrite = 1;
1053 + inode_unlock(inode);
1054 + relock = true;
1055 +- } else if (iocb->ki_flags & IOCB_NOWAIT) {
1056 +- ret = -EAGAIN;
1057 +- goto out;
1058 + }
1059 + ret = btrfs_delalloc_reserve_space(inode, &data_reserved,
1060 + offset, count);
1061 +diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
1062 +index 951c444d83e7..b46fdb2b8d34 100644
1063 +--- a/fs/cifs/smb2ops.c
1064 ++++ b/fs/cifs/smb2ops.c
1065 +@@ -1755,6 +1755,12 @@ static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
1066 + inode = d_inode(cfile->dentry);
1067 + cifsi = CIFS_I(inode);
1068 +
1069 ++ /*
1070 ++ * We zero the range through ioctl, so we need remove the page caches
1071 ++ * first, otherwise the data may be inconsistent with the server.
1072 ++ */
1073 ++ truncate_pagecache_range(inode, offset, offset + len - 1);
1074 ++
1075 + /* if file not oplocked can't be sure whether asking to extend size */
1076 + if (!CIFS_CACHE_READ(cifsi))
1077 + if (keep_size == false) {
1078 +@@ -1824,6 +1830,12 @@ static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon,
1079 + return rc;
1080 + }
1081 +
1082 ++ /*
1083 ++ * We implement the punch hole through ioctl, so we need remove the page
1084 ++ * caches first, otherwise the data may be inconsistent with the server.
1085 ++ */
1086 ++ truncate_pagecache_range(inode, offset, offset + len - 1);
1087 ++
1088 + cifs_dbg(FYI, "offset %lld len %lld", offset, len);
1089 +
1090 + fsctl_buf.FileOffset = cpu_to_le64(offset);
1091 +diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
1092 +index e6ea4511c41c..3cef33b0f7e0 100644
1093 +--- a/fs/nfs/direct.c
1094 ++++ b/fs/nfs/direct.c
1095 +@@ -396,8 +396,6 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq)
1096 + {
1097 + struct inode *inode = dreq->inode;
1098 +
1099 +- inode_dio_end(inode);
1100 +-
1101 + if (dreq->iocb) {
1102 + long res = (long) dreq->error;
1103 + if (dreq->count != 0) {
1104 +@@ -409,7 +407,10 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq)
1105 +
1106 + complete(&dreq->completion);
1107 +
1108 ++ igrab(inode);
1109 + nfs_direct_req_release(dreq);
1110 ++ inode_dio_end(inode);
1111 ++ iput(inode);
1112 + }
1113 +
1114 + static void nfs_direct_read_completion(struct nfs_pgio_header *hdr)
1115 +@@ -539,8 +540,10 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq,
1116 + * generic layer handle the completion.
1117 + */
1118 + if (requested_bytes == 0) {
1119 +- inode_dio_end(inode);
1120 ++ igrab(inode);
1121 + nfs_direct_req_release(dreq);
1122 ++ inode_dio_end(inode);
1123 ++ iput(inode);
1124 + return result < 0 ? result : -EIO;
1125 + }
1126 +
1127 +@@ -957,8 +960,10 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
1128 + * generic layer handle the completion.
1129 + */
1130 + if (requested_bytes == 0) {
1131 +- inode_dio_end(inode);
1132 ++ igrab(inode);
1133 + nfs_direct_req_release(dreq);
1134 ++ inode_dio_end(inode);
1135 ++ iput(inode);
1136 + return result < 0 ? result : -EIO;
1137 + }
1138 +
1139 +diff --git a/fs/nfs/file.c b/fs/nfs/file.c
1140 +index 81cca49a8375..7da2cea1e7a0 100644
1141 +--- a/fs/nfs/file.c
1142 ++++ b/fs/nfs/file.c
1143 +@@ -82,6 +82,7 @@ nfs_file_release(struct inode *inode, struct file *filp)
1144 + dprintk("NFS: release(%pD2)\n", filp);
1145 +
1146 + nfs_inc_stats(inode, NFSIOS_VFSRELEASE);
1147 ++ inode_dio_wait(inode);
1148 + nfs_file_clear_open_context(filp);
1149 + return 0;
1150 + }
1151 +diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
1152 +index 8dbde5ded042..74f15498c9bf 100644
1153 +--- a/fs/nfs/flexfilelayout/flexfilelayout.c
1154 ++++ b/fs/nfs/flexfilelayout/flexfilelayout.c
1155 +@@ -921,9 +921,8 @@ retry:
1156 + goto out_mds;
1157 +
1158 + /* Use a direct mapping of ds_idx to pgio mirror_idx */
1159 +- if (WARN_ON_ONCE(pgio->pg_mirror_count !=
1160 +- FF_LAYOUT_MIRROR_COUNT(pgio->pg_lseg)))
1161 +- goto out_mds;
1162 ++ if (pgio->pg_mirror_count != FF_LAYOUT_MIRROR_COUNT(pgio->pg_lseg))
1163 ++ goto out_eagain;
1164 +
1165 + for (i = 0; i < pgio->pg_mirror_count; i++) {
1166 + ds = nfs4_ff_layout_prepare_ds(pgio->pg_lseg, i, true);
1167 +@@ -942,11 +941,15 @@ retry:
1168 + }
1169 +
1170 + return;
1171 +-
1172 ++out_eagain:
1173 ++ pnfs_generic_pg_cleanup(pgio);
1174 ++ pgio->pg_error = -EAGAIN;
1175 ++ return;
1176 + out_mds:
1177 + pnfs_put_lseg(pgio->pg_lseg);
1178 + pgio->pg_lseg = NULL;
1179 + nfs_pageio_reset_write_mds(pgio);
1180 ++ pgio->pg_error = -EAGAIN;
1181 + }
1182 +
1183 + static unsigned int
1184 +diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
1185 +index 5bb4a89f9045..0773c774e2bf 100644
1186 +--- a/fs/ocfs2/ocfs2_fs.h
1187 ++++ b/fs/ocfs2/ocfs2_fs.h
1188 +@@ -303,7 +303,7 @@
1189 + #define OCFS2_MAX_SLOTS 255
1190 +
1191 + /* Slot map indicator for an empty slot */
1192 +-#define OCFS2_INVALID_SLOT -1
1193 ++#define OCFS2_INVALID_SLOT ((u16)-1)
1194 +
1195 + #define OCFS2_VOL_UUID_LEN 16
1196 + #define OCFS2_MAX_VOL_LABEL_LEN 64
1197 +@@ -339,8 +339,8 @@ struct ocfs2_system_inode_info {
1198 + enum {
1199 + BAD_BLOCK_SYSTEM_INODE = 0,
1200 + GLOBAL_INODE_ALLOC_SYSTEM_INODE,
1201 ++#define OCFS2_FIRST_ONLINE_SYSTEM_INODE GLOBAL_INODE_ALLOC_SYSTEM_INODE
1202 + SLOT_MAP_SYSTEM_INODE,
1203 +-#define OCFS2_FIRST_ONLINE_SYSTEM_INODE SLOT_MAP_SYSTEM_INODE
1204 + HEARTBEAT_SYSTEM_INODE,
1205 + GLOBAL_BITMAP_SYSTEM_INODE,
1206 + USER_QUOTA_SYSTEM_INODE,
1207 +diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
1208 +index 71f22c8fbffd..4ca2f71565f9 100644
1209 +--- a/fs/ocfs2/suballoc.c
1210 ++++ b/fs/ocfs2/suballoc.c
1211 +@@ -2891,9 +2891,12 @@ int ocfs2_test_inode_bit(struct ocfs2_super *osb, u64 blkno, int *res)
1212 + goto bail;
1213 + }
1214 +
1215 +- inode_alloc_inode =
1216 +- ocfs2_get_system_file_inode(osb, INODE_ALLOC_SYSTEM_INODE,
1217 +- suballoc_slot);
1218 ++ if (suballoc_slot == (u16)OCFS2_INVALID_SLOT)
1219 ++ inode_alloc_inode = ocfs2_get_system_file_inode(osb,
1220 ++ GLOBAL_INODE_ALLOC_SYSTEM_INODE, suballoc_slot);
1221 ++ else
1222 ++ inode_alloc_inode = ocfs2_get_system_file_inode(osb,
1223 ++ INODE_ALLOC_SYSTEM_INODE, suballoc_slot);
1224 + if (!inode_alloc_inode) {
1225 + /* the error code could be inaccurate, but we are not able to
1226 + * get the correct one. */
1227 +diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
1228 +index 516e0c57cf9c..a10d9a3c181e 100644
1229 +--- a/fs/xfs/libxfs/xfs_alloc.c
1230 ++++ b/fs/xfs/libxfs/xfs_alloc.c
1231 +@@ -2529,6 +2529,13 @@ xfs_agf_verify(
1232 + be32_to_cpu(agf->agf_flcount) <= xfs_agfl_size(mp)))
1233 + return false;
1234 +
1235 ++ if (be32_to_cpu(agf->agf_length) > mp->m_sb.sb_dblocks)
1236 ++ return false;
1237 ++
1238 ++ if (be32_to_cpu(agf->agf_freeblks) < be32_to_cpu(agf->agf_longest) ||
1239 ++ be32_to_cpu(agf->agf_freeblks) > be32_to_cpu(agf->agf_length))
1240 ++ return false;
1241 ++
1242 + if (be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]) < 1 ||
1243 + be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]) < 1 ||
1244 + be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]) > XFS_BTREE_MAXLEVELS ||
1245 +@@ -2540,6 +2547,10 @@ xfs_agf_verify(
1246 + be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]) > XFS_BTREE_MAXLEVELS))
1247 + return false;
1248 +
1249 ++ if (xfs_sb_version_hasrmapbt(&mp->m_sb) &&
1250 ++ be32_to_cpu(agf->agf_rmap_blocks) > be32_to_cpu(agf->agf_length))
1251 ++ return false;
1252 ++
1253 + /*
1254 + * during growfs operations, the perag is not fully initialised,
1255 + * so we can't use it for any useful checking. growfs ensures we can't
1256 +@@ -2553,6 +2564,11 @@ xfs_agf_verify(
1257 + be32_to_cpu(agf->agf_btreeblks) > be32_to_cpu(agf->agf_length))
1258 + return false;
1259 +
1260 ++ if (xfs_sb_version_hasreflink(&mp->m_sb) &&
1261 ++ be32_to_cpu(agf->agf_refcount_blocks) >
1262 ++ be32_to_cpu(agf->agf_length))
1263 ++ return false;
1264 ++
1265 + if (xfs_sb_version_hasreflink(&mp->m_sb) &&
1266 + (be32_to_cpu(agf->agf_refcount_level) < 1 ||
1267 + be32_to_cpu(agf->agf_refcount_level) > XFS_BTREE_MAXLEVELS))
1268 +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
1269 +index 31fc54757bf2..3512c337a4a6 100644
1270 +--- a/include/linux/netdevice.h
1271 ++++ b/include/linux/netdevice.h
1272 +@@ -2449,7 +2449,7 @@ void synchronize_net(void);
1273 + int init_dummy_netdev(struct net_device *dev);
1274 +
1275 + DECLARE_PER_CPU(int, xmit_recursion);
1276 +-#define XMIT_RECURSION_LIMIT 10
1277 ++#define XMIT_RECURSION_LIMIT 8
1278 +
1279 + static inline int dev_recursion_level(void)
1280 + {
1281 +diff --git a/include/linux/qed/qed_chain.h b/include/linux/qed/qed_chain.h
1282 +index 733fad7dfbed..6d15040c642c 100644
1283 +--- a/include/linux/qed/qed_chain.h
1284 ++++ b/include/linux/qed/qed_chain.h
1285 +@@ -207,28 +207,34 @@ static inline u32 qed_chain_get_cons_idx_u32(struct qed_chain *p_chain)
1286 +
1287 + static inline u16 qed_chain_get_elem_left(struct qed_chain *p_chain)
1288 + {
1289 ++ u16 elem_per_page = p_chain->elem_per_page;
1290 ++ u32 prod = p_chain->u.chain16.prod_idx;
1291 ++ u32 cons = p_chain->u.chain16.cons_idx;
1292 + u16 used;
1293 +
1294 +- used = (u16) (((u32)0x10000 +
1295 +- (u32)p_chain->u.chain16.prod_idx) -
1296 +- (u32)p_chain->u.chain16.cons_idx);
1297 ++ if (prod < cons)
1298 ++ prod += (u32)U16_MAX + 1;
1299 ++
1300 ++ used = (u16)(prod - cons);
1301 + if (p_chain->mode == QED_CHAIN_MODE_NEXT_PTR)
1302 +- used -= p_chain->u.chain16.prod_idx / p_chain->elem_per_page -
1303 +- p_chain->u.chain16.cons_idx / p_chain->elem_per_page;
1304 ++ used -= prod / elem_per_page - cons / elem_per_page;
1305 +
1306 + return (u16)(p_chain->capacity - used);
1307 + }
1308 +
1309 + static inline u32 qed_chain_get_elem_left_u32(struct qed_chain *p_chain)
1310 + {
1311 ++ u16 elem_per_page = p_chain->elem_per_page;
1312 ++ u64 prod = p_chain->u.chain32.prod_idx;
1313 ++ u64 cons = p_chain->u.chain32.cons_idx;
1314 + u32 used;
1315 +
1316 +- used = (u32) (((u64)0x100000000ULL +
1317 +- (u64)p_chain->u.chain32.prod_idx) -
1318 +- (u64)p_chain->u.chain32.cons_idx);
1319 ++ if (prod < cons)
1320 ++ prod += (u64)U32_MAX + 1;
1321 ++
1322 ++ used = (u32)(prod - cons);
1323 + if (p_chain->mode == QED_CHAIN_MODE_NEXT_PTR)
1324 +- used -= p_chain->u.chain32.prod_idx / p_chain->elem_per_page -
1325 +- p_chain->u.chain32.cons_idx / p_chain->elem_per_page;
1326 ++ used -= (u32)(prod / elem_per_page - cons / elem_per_page);
1327 +
1328 + return p_chain->capacity - used;
1329 + }
1330 +diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
1331 +index a16e0bdf7751..d19bfdcf7749 100644
1332 +--- a/include/linux/virtio_net.h
1333 ++++ b/include/linux/virtio_net.h
1334 +@@ -107,16 +107,17 @@ retry:
1335 +
1336 + if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
1337 + u16 gso_size = __virtio16_to_cpu(little_endian, hdr->gso_size);
1338 ++ struct skb_shared_info *shinfo = skb_shinfo(skb);
1339 +
1340 +- if (skb->len - p_off <= gso_size)
1341 +- return -EINVAL;
1342 +-
1343 +- skb_shinfo(skb)->gso_size = gso_size;
1344 +- skb_shinfo(skb)->gso_type = gso_type;
1345 ++ /* Too small packets are not really GSO ones. */
1346 ++ if (skb->len - p_off > gso_size) {
1347 ++ shinfo->gso_size = gso_size;
1348 ++ shinfo->gso_type = gso_type;
1349 +
1350 +- /* Header must be checked, and gso_segs computed. */
1351 +- skb_shinfo(skb)->gso_type |= SKB_GSO_DODGY;
1352 +- skb_shinfo(skb)->gso_segs = 0;
1353 ++ /* Header must be checked, and gso_segs computed. */
1354 ++ shinfo->gso_type |= SKB_GSO_DODGY;
1355 ++ shinfo->gso_segs = 0;
1356 ++ }
1357 + }
1358 +
1359 + return 0;
1360 +diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
1361 +index deaafa9b09cb..d4da07048aa3 100644
1362 +--- a/include/net/sctp/constants.h
1363 ++++ b/include/net/sctp/constants.h
1364 +@@ -361,11 +361,13 @@ enum {
1365 + ipv4_is_anycast_6to4(a))
1366 +
1367 + /* Flags used for the bind address copy functions. */
1368 +-#define SCTP_ADDR6_ALLOWED 0x00000001 /* IPv6 address is allowed by
1369 ++#define SCTP_ADDR4_ALLOWED 0x00000001 /* IPv4 address is allowed by
1370 + local sock family */
1371 +-#define SCTP_ADDR4_PEERSUPP 0x00000002 /* IPv4 address is supported by
1372 ++#define SCTP_ADDR6_ALLOWED 0x00000002 /* IPv6 address is allowed by
1373 ++ local sock family */
1374 ++#define SCTP_ADDR4_PEERSUPP 0x00000004 /* IPv4 address is supported by
1375 + peer */
1376 +-#define SCTP_ADDR6_PEERSUPP 0x00000004 /* IPv6 address is supported by
1377 ++#define SCTP_ADDR6_PEERSUPP 0x00000008 /* IPv6 address is supported by
1378 + peer */
1379 +
1380 + /* Reasons to retransmit. */
1381 +diff --git a/include/net/sock.h b/include/net/sock.h
1382 +index c6a003bc4737..a2e10d0b1280 100644
1383 +--- a/include/net/sock.h
1384 ++++ b/include/net/sock.h
1385 +@@ -1687,7 +1687,6 @@ static inline int sk_tx_queue_get(const struct sock *sk)
1386 +
1387 + static inline void sk_set_socket(struct sock *sk, struct socket *sock)
1388 + {
1389 +- sk_tx_queue_clear(sk);
1390 + sk->sk_socket = sock;
1391 + }
1392 +
1393 +diff --git a/kernel/sched/core.c b/kernel/sched/core.c
1394 +index 97a27726ea21..c5599174e745 100644
1395 +--- a/kernel/sched/core.c
1396 ++++ b/kernel/sched/core.c
1397 +@@ -3731,7 +3731,8 @@ void rt_mutex_setprio(struct task_struct *p, struct task_struct *pi_task)
1398 + */
1399 + if (dl_prio(prio)) {
1400 + if (!dl_prio(p->normal_prio) ||
1401 +- (pi_task && dl_entity_preempt(&pi_task->dl, &p->dl))) {
1402 ++ (pi_task && dl_prio(pi_task->prio) &&
1403 ++ dl_entity_preempt(&pi_task->dl, &p->dl))) {
1404 + p->dl.dl_boosted = 1;
1405 + queue_flag |= ENQUEUE_REPLENISH;
1406 + } else
1407 +diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
1408 +index 304a164f5e7e..9a55c5bc5243 100644
1409 +--- a/kernel/trace/blktrace.c
1410 ++++ b/kernel/trace/blktrace.c
1411 +@@ -15,6 +15,9 @@
1412 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1413 + *
1414 + */
1415 ++
1416 ++#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1417 ++
1418 + #include <linux/kernel.h>
1419 + #include <linux/blkdev.h>
1420 + #include <linux/blktrace_api.h>
1421 +@@ -504,6 +507,16 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
1422 + */
1423 + strreplace(buts->name, '/', '_');
1424 +
1425 ++ /*
1426 ++ * bdev can be NULL, as with scsi-generic, this is a helpful as
1427 ++ * we can be.
1428 ++ */
1429 ++ if (q->blk_trace) {
1430 ++ pr_warn("Concurrent blktraces are not allowed on %s\n",
1431 ++ buts->name);
1432 ++ return -EBUSY;
1433 ++ }
1434 ++
1435 + bt = kzalloc(sizeof(*bt), GFP_KERNEL);
1436 + if (!bt)
1437 + return -ENOMEM;
1438 +diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
1439 +index 6fb5eb7b57dc..13f501337308 100644
1440 +--- a/kernel/trace/trace_events_trigger.c
1441 ++++ b/kernel/trace/trace_events_trigger.c
1442 +@@ -223,11 +223,17 @@ static int event_trigger_regex_open(struct inode *inode, struct file *file)
1443 +
1444 + static int trigger_process_regex(struct trace_event_file *file, char *buff)
1445 + {
1446 +- char *command, *next = buff;
1447 ++ char *command, *next;
1448 + struct event_command *p;
1449 + int ret = -EINVAL;
1450 +
1451 ++ next = buff = skip_spaces(buff);
1452 + command = strsep(&next, ": \t");
1453 ++ if (next) {
1454 ++ next = skip_spaces(next);
1455 ++ if (!*next)
1456 ++ next = NULL;
1457 ++ }
1458 + command = (command[0] != '!') ? command : command + 1;
1459 +
1460 + mutex_lock(&trigger_cmd_mutex);
1461 +@@ -630,8 +636,14 @@ event_trigger_callback(struct event_command *cmd_ops,
1462 + int ret;
1463 +
1464 + /* separate the trigger from the filter (t:n [if filter]) */
1465 +- if (param && isdigit(param[0]))
1466 ++ if (param && isdigit(param[0])) {
1467 + trigger = strsep(&param, " \t");
1468 ++ if (param) {
1469 ++ param = skip_spaces(param);
1470 ++ if (!*param)
1471 ++ param = NULL;
1472 ++ }
1473 ++ }
1474 +
1475 + trigger_ops = cmd_ops->get_trigger_ops(cmd, trigger);
1476 +
1477 +@@ -1342,6 +1354,11 @@ int event_enable_trigger_func(struct event_command *cmd_ops,
1478 + trigger = strsep(&param, " \t");
1479 + if (!trigger)
1480 + return -EINVAL;
1481 ++ if (param) {
1482 ++ param = skip_spaces(param);
1483 ++ if (!*param)
1484 ++ param = NULL;
1485 ++ }
1486 +
1487 + system = strsep(&trigger, ":");
1488 + if (!trigger)
1489 +diff --git a/mm/slab_common.c b/mm/slab_common.c
1490 +index f6764cf162b8..caba3efce3f4 100644
1491 +--- a/mm/slab_common.c
1492 ++++ b/mm/slab_common.c
1493 +@@ -1449,7 +1449,7 @@ void kzfree(const void *p)
1494 + if (unlikely(ZERO_OR_NULL_PTR(mem)))
1495 + return;
1496 + ks = ksize(mem);
1497 +- memset(mem, 0, ks);
1498 ++ memzero_explicit(mem, ks);
1499 + kfree(mem);
1500 + }
1501 + EXPORT_SYMBOL(kzfree);
1502 +diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
1503 +index e870cfc85b14..14ff034e561c 100644
1504 +--- a/net/bridge/br_private.h
1505 ++++ b/net/bridge/br_private.h
1506 +@@ -190,8 +190,8 @@ struct net_bridge_port_group {
1507 + struct rcu_head rcu;
1508 + struct timer_list timer;
1509 + struct br_ip addr;
1510 ++ unsigned char eth_addr[ETH_ALEN] __aligned(2);
1511 + unsigned char flags;
1512 +- unsigned char eth_addr[ETH_ALEN];
1513 + };
1514 +
1515 + struct net_bridge_mdb_entry
1516 +diff --git a/net/core/dev.c b/net/core/dev.c
1517 +index 0aaa1426450f..1ee177485fd0 100644
1518 +--- a/net/core/dev.c
1519 ++++ b/net/core/dev.c
1520 +@@ -7694,6 +7694,13 @@ int register_netdevice(struct net_device *dev)
1521 + rcu_barrier();
1522 +
1523 + dev->reg_state = NETREG_UNREGISTERED;
1524 ++ /* We should put the kobject that hold in
1525 ++ * netdev_unregister_kobject(), otherwise
1526 ++ * the net device cannot be freed when
1527 ++ * driver calls free_netdev(), because the
1528 ++ * kobject is being hold.
1529 ++ */
1530 ++ kobject_put(&dev->dev.kobj);
1531 + }
1532 + /*
1533 + * Prevent userspace races by waiting until the network
1534 +diff --git a/net/core/sock.c b/net/core/sock.c
1535 +index d2cb2051d045..08ca2ec0ce60 100644
1536 +--- a/net/core/sock.c
1537 ++++ b/net/core/sock.c
1538 +@@ -1538,6 +1538,7 @@ struct sock *sk_alloc(struct net *net, int family, gfp_t priority,
1539 + cgroup_sk_alloc(&sk->sk_cgrp_data);
1540 + sock_update_classid(&sk->sk_cgrp_data);
1541 + sock_update_netprioidx(&sk->sk_cgrp_data);
1542 ++ sk_tx_queue_clear(sk);
1543 + }
1544 +
1545 + return sk;
1546 +@@ -1740,6 +1741,7 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
1547 + */
1548 + sk_refcnt_debug_inc(newsk);
1549 + sk_set_socket(newsk, NULL);
1550 ++ sk_tx_queue_clear(newsk);
1551 + newsk->sk_wq = NULL;
1552 +
1553 + if (newsk->sk_prot->sockets_allocated)
1554 +diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
1555 +index eff703cb13b6..bc233fdfae0f 100644
1556 +--- a/net/ipv4/fib_semantics.c
1557 ++++ b/net/ipv4/fib_semantics.c
1558 +@@ -839,7 +839,7 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
1559 + if (fl4.flowi4_scope < RT_SCOPE_LINK)
1560 + fl4.flowi4_scope = RT_SCOPE_LINK;
1561 +
1562 +- if (cfg->fc_table)
1563 ++ if (cfg->fc_table && cfg->fc_table != RT_TABLE_MAIN)
1564 + tbl = fib_get_table(net, cfg->fc_table);
1565 +
1566 + if (tbl)
1567 +diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
1568 +index f6793017a20d..44cc17c43a6b 100644
1569 +--- a/net/ipv4/ip_tunnel.c
1570 ++++ b/net/ipv4/ip_tunnel.c
1571 +@@ -98,9 +98,10 @@ struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
1572 + __be32 remote, __be32 local,
1573 + __be32 key)
1574 + {
1575 +- unsigned int hash;
1576 + struct ip_tunnel *t, *cand = NULL;
1577 + struct hlist_head *head;
1578 ++ struct net_device *ndev;
1579 ++ unsigned int hash;
1580 +
1581 + hash = ip_tunnel_hash(key, remote);
1582 + head = &itn->tunnels[hash];
1583 +@@ -175,8 +176,9 @@ struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
1584 + if (t && t->dev->flags & IFF_UP)
1585 + return t;
1586 +
1587 +- if (itn->fb_tunnel_dev && itn->fb_tunnel_dev->flags & IFF_UP)
1588 +- return netdev_priv(itn->fb_tunnel_dev);
1589 ++ ndev = READ_ONCE(itn->fb_tunnel_dev);
1590 ++ if (ndev && ndev->flags & IFF_UP)
1591 ++ return netdev_priv(ndev);
1592 +
1593 + return NULL;
1594 + }
1595 +@@ -1211,9 +1213,9 @@ void ip_tunnel_uninit(struct net_device *dev)
1596 + struct ip_tunnel_net *itn;
1597 +
1598 + itn = net_generic(net, tunnel->ip_tnl_net_id);
1599 +- /* fb_tunnel_dev will be unregisted in net-exit call. */
1600 +- if (itn->fb_tunnel_dev != dev)
1601 +- ip_tunnel_del(itn, netdev_priv(dev));
1602 ++ ip_tunnel_del(itn, netdev_priv(dev));
1603 ++ if (itn->fb_tunnel_dev == dev)
1604 ++ WRITE_ONCE(itn->fb_tunnel_dev, NULL);
1605 +
1606 + dst_cache_reset(&tunnel->dst_cache);
1607 + }
1608 +diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
1609 +index 78bfadfcf342..8b5ba0a5cd38 100644
1610 +--- a/net/ipv4/tcp_cubic.c
1611 ++++ b/net/ipv4/tcp_cubic.c
1612 +@@ -403,6 +403,8 @@ static void hystart_update(struct sock *sk, u32 delay)
1613 +
1614 + if (hystart_detect & HYSTART_DELAY) {
1615 + /* obtain the minimum delay of more than sampling packets */
1616 ++ if (ca->curr_rtt > delay)
1617 ++ ca->curr_rtt = delay;
1618 + if (ca->sample_cnt < HYSTART_MIN_SAMPLES) {
1619 + if (ca->curr_rtt == 0 || ca->curr_rtt > delay)
1620 + ca->curr_rtt = delay;
1621 +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
1622 +index 29f3df4ddd1f..a2c26c2b3a94 100644
1623 +--- a/net/ipv4/tcp_input.c
1624 ++++ b/net/ipv4/tcp_input.c
1625 +@@ -4507,7 +4507,11 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
1626 + if (tcp_ooo_try_coalesce(sk, tp->ooo_last_skb,
1627 + skb, &fragstolen)) {
1628 + coalesce_done:
1629 +- tcp_grow_window(sk, skb);
1630 ++ /* For non sack flows, do not grow window to force DUPACK
1631 ++ * and trigger fast retransmit.
1632 ++ */
1633 ++ if (tcp_is_sack(tp))
1634 ++ tcp_grow_window(sk, skb);
1635 + kfree_skb_partial(skb, fragstolen);
1636 + skb = NULL;
1637 + goto add_sack;
1638 +@@ -4591,7 +4595,11 @@ add_sack:
1639 + tcp_sack_new_ofo_skb(sk, seq, end_seq);
1640 + end:
1641 + if (skb) {
1642 +- tcp_grow_window(sk, skb);
1643 ++ /* For non sack flows, do not grow window to force DUPACK
1644 ++ * and trigger fast retransmit.
1645 ++ */
1646 ++ if (tcp_is_sack(tp))
1647 ++ tcp_grow_window(sk, skb);
1648 + skb_condense(skb);
1649 + skb_set_owner_r(skb, sk);
1650 + }
1651 +diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
1652 +index 726ba41133a3..e07cc2cfc1a6 100644
1653 +--- a/net/ipv6/ip6_gre.c
1654 ++++ b/net/ipv6/ip6_gre.c
1655 +@@ -124,6 +124,7 @@ static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev,
1656 + int dev_type = (gre_proto == htons(ETH_P_TEB)) ?
1657 + ARPHRD_ETHER : ARPHRD_IP6GRE;
1658 + int score, cand_score = 4;
1659 ++ struct net_device *ndev;
1660 +
1661 + for_each_ip_tunnel_rcu(t, ign->tunnels_r_l[h0 ^ h1]) {
1662 + if (!ipv6_addr_equal(local, &t->parms.laddr) ||
1663 +@@ -226,9 +227,9 @@ static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev,
1664 + if (cand)
1665 + return cand;
1666 +
1667 +- dev = ign->fb_tunnel_dev;
1668 +- if (dev->flags & IFF_UP)
1669 +- return netdev_priv(dev);
1670 ++ ndev = READ_ONCE(ign->fb_tunnel_dev);
1671 ++ if (ndev && ndev->flags & IFF_UP)
1672 ++ return netdev_priv(ndev);
1673 +
1674 + return NULL;
1675 + }
1676 +@@ -364,6 +365,8 @@ static void ip6gre_tunnel_uninit(struct net_device *dev)
1677 + struct ip6gre_net *ign = net_generic(t->net, ip6gre_net_id);
1678 +
1679 + ip6gre_tunnel_unlink(ign, t);
1680 ++ if (ign->fb_tunnel_dev == dev)
1681 ++ WRITE_ONCE(ign->fb_tunnel_dev, NULL);
1682 + dst_cache_reset(&t->dst_cache);
1683 + dev_put(dev);
1684 + }
1685 +diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
1686 +index 611dc5d55fa0..959057515fc9 100644
1687 +--- a/net/ipv6/mcast.c
1688 ++++ b/net/ipv6/mcast.c
1689 +@@ -2599,6 +2599,7 @@ void ipv6_mc_destroy_dev(struct inet6_dev *idev)
1690 + idev->mc_list = i->next;
1691 +
1692 + write_unlock_bh(&idev->lock);
1693 ++ ip6_mc_clear_src(i);
1694 + ma_put(i);
1695 + write_lock_bh(&idev->lock);
1696 + }
1697 +diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
1698 +index c2b21c9c1229..5c59bbad8d19 100644
1699 +--- a/net/netfilter/ipset/ip_set_core.c
1700 ++++ b/net/netfilter/ipset/ip_set_core.c
1701 +@@ -381,6 +381,8 @@ ip_set_elem_len(struct ip_set *set, struct nlattr *tb[], size_t len,
1702 + for (id = 0; id < IPSET_EXT_ID_MAX; id++) {
1703 + if (!add_extension(id, cadt_flags, tb))
1704 + continue;
1705 ++ if (align < ip_set_extensions[id].align)
1706 ++ align = ip_set_extensions[id].align;
1707 + len = ALIGN(len, ip_set_extensions[id].align);
1708 + set->offset[id] = len;
1709 + set->extensions |= ip_set_extensions[id].type;
1710 +diff --git a/net/rxrpc/call_accept.c b/net/rxrpc/call_accept.c
1711 +index 2dd13f5c47c8..61425179780c 100644
1712 +--- a/net/rxrpc/call_accept.c
1713 ++++ b/net/rxrpc/call_accept.c
1714 +@@ -26,6 +26,11 @@
1715 + #include <net/ip.h>
1716 + #include "ar-internal.h"
1717 +
1718 ++static void rxrpc_dummy_notify(struct sock *sk, struct rxrpc_call *call,
1719 ++ unsigned long user_call_ID)
1720 ++{
1721 ++}
1722 ++
1723 + /*
1724 + * Preallocate a single service call, connection and peer and, if possible,
1725 + * give them a user ID and attach the user's side of the ID to them.
1726 +@@ -227,6 +232,8 @@ void rxrpc_discard_prealloc(struct rxrpc_sock *rx)
1727 + if (rx->discard_new_call) {
1728 + _debug("discard %lx", call->user_call_ID);
1729 + rx->discard_new_call(call, call->user_call_ID);
1730 ++ if (call->notify_rx)
1731 ++ call->notify_rx = rxrpc_dummy_notify;
1732 + rxrpc_put_call(call, rxrpc_call_put_kernel);
1733 + }
1734 + rxrpc_call_completed(call);
1735 +diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
1736 +index 18ce6f97462b..98285b117a7c 100644
1737 +--- a/net/rxrpc/input.c
1738 ++++ b/net/rxrpc/input.c
1739 +@@ -664,13 +664,12 @@ static void rxrpc_input_ackinfo(struct rxrpc_call *call, struct sk_buff *skb,
1740 + ntohl(ackinfo->rxMTU), ntohl(ackinfo->maxMTU),
1741 + rwind, ntohl(ackinfo->jumbo_max));
1742 +
1743 ++ if (rwind > RXRPC_RXTX_BUFF_SIZE - 1)
1744 ++ rwind = RXRPC_RXTX_BUFF_SIZE - 1;
1745 + if (call->tx_winsize != rwind) {
1746 +- if (rwind > RXRPC_RXTX_BUFF_SIZE - 1)
1747 +- rwind = RXRPC_RXTX_BUFF_SIZE - 1;
1748 + if (rwind > call->tx_winsize)
1749 + wake = true;
1750 +- trace_rxrpc_rx_rwind_change(call, sp->hdr.serial,
1751 +- ntohl(ackinfo->rwind), wake);
1752 ++ trace_rxrpc_rx_rwind_change(call, sp->hdr.serial, rwind, wake);
1753 + call->tx_winsize = rwind;
1754 + }
1755 +
1756 +diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
1757 +index 21b981abbacb..091a9746627f 100644
1758 +--- a/net/sched/sch_generic.c
1759 ++++ b/net/sched/sch_generic.c
1760 +@@ -341,6 +341,7 @@ void __netdev_watchdog_up(struct net_device *dev)
1761 + dev_hold(dev);
1762 + }
1763 + }
1764 ++EXPORT_SYMBOL_GPL(__netdev_watchdog_up);
1765 +
1766 + static void dev_watchdog_up(struct net_device *dev)
1767 + {
1768 +diff --git a/net/sctp/associola.c b/net/sctp/associola.c
1769 +index dd1a3bd80be5..0a5764016721 100644
1770 +--- a/net/sctp/associola.c
1771 ++++ b/net/sctp/associola.c
1772 +@@ -1598,12 +1598,15 @@ void sctp_assoc_rwnd_decrease(struct sctp_association *asoc, unsigned int len)
1773 + int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc,
1774 + enum sctp_scope scope, gfp_t gfp)
1775 + {
1776 ++ struct sock *sk = asoc->base.sk;
1777 + int flags;
1778 +
1779 + /* Use scoping rules to determine the subset of addresses from
1780 + * the endpoint.
1781 + */
1782 +- flags = (PF_INET6 == asoc->base.sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0;
1783 ++ flags = (PF_INET6 == sk->sk_family) ? SCTP_ADDR6_ALLOWED : 0;
1784 ++ if (!inet_v6_ipv6only(sk))
1785 ++ flags |= SCTP_ADDR4_ALLOWED;
1786 + if (asoc->peer.ipv4_address)
1787 + flags |= SCTP_ADDR4_PEERSUPP;
1788 + if (asoc->peer.ipv6_address)
1789 +diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
1790 +index 7df3704982f5..38d01cfb313e 100644
1791 +--- a/net/sctp/bind_addr.c
1792 ++++ b/net/sctp/bind_addr.c
1793 +@@ -453,6 +453,7 @@ static int sctp_copy_one_addr(struct net *net, struct sctp_bind_addr *dest,
1794 + * well as the remote peer.
1795 + */
1796 + if ((((AF_INET == addr->sa.sa_family) &&
1797 ++ (flags & SCTP_ADDR4_ALLOWED) &&
1798 + (flags & SCTP_ADDR4_PEERSUPP))) ||
1799 + (((AF_INET6 == addr->sa.sa_family) &&
1800 + (flags & SCTP_ADDR6_ALLOWED) &&
1801 +diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
1802 +index 785456df7505..8fe9c0646205 100644
1803 +--- a/net/sctp/protocol.c
1804 ++++ b/net/sctp/protocol.c
1805 +@@ -213,7 +213,8 @@ int sctp_copy_local_addr_list(struct net *net, struct sctp_bind_addr *bp,
1806 + * sock as well as the remote peer.
1807 + */
1808 + if (addr->a.sa.sa_family == AF_INET &&
1809 +- !(copy_flags & SCTP_ADDR4_PEERSUPP))
1810 ++ (!(copy_flags & SCTP_ADDR4_ALLOWED) ||
1811 ++ !(copy_flags & SCTP_ADDR4_PEERSUPP)))
1812 + continue;
1813 + if (addr->a.sa.sa_family == AF_INET6 &&
1814 + (!(copy_flags & SCTP_ADDR6_ALLOWED) ||
1815 +diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
1816 +index 34f94052c519..137f92bfafac 100644
1817 +--- a/net/sunrpc/rpc_pipe.c
1818 ++++ b/net/sunrpc/rpc_pipe.c
1819 +@@ -1347,6 +1347,7 @@ rpc_gssd_dummy_populate(struct dentry *root, struct rpc_pipe *pipe_data)
1820 + q.len = strlen(gssd_dummy_clnt_dir[0].name);
1821 + clnt_dentry = d_hash_and_lookup(gssd_dentry, &q);
1822 + if (!clnt_dentry) {
1823 ++ __rpc_depopulate(gssd_dentry, gssd_dummy_clnt_dir, 0, 1);
1824 + pipe_dentry = ERR_PTR(-ENOENT);
1825 + goto out;
1826 + }
1827 +diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c
1828 +index 4f382805eb9c..87cf0b933f99 100644
1829 +--- a/net/sunrpc/xdr.c
1830 ++++ b/net/sunrpc/xdr.c
1831 +@@ -1036,6 +1036,7 @@ xdr_buf_subsegment(struct xdr_buf *buf, struct xdr_buf *subbuf,
1832 + base = 0;
1833 + } else {
1834 + base -= buf->head[0].iov_len;
1835 ++ subbuf->head[0].iov_base = buf->head[0].iov_base;
1836 + subbuf->head[0].iov_len = 0;
1837 + }
1838 +
1839 +@@ -1048,6 +1049,8 @@ xdr_buf_subsegment(struct xdr_buf *buf, struct xdr_buf *subbuf,
1840 + base = 0;
1841 + } else {
1842 + base -= buf->page_len;
1843 ++ subbuf->pages = buf->pages;
1844 ++ subbuf->page_base = 0;
1845 + subbuf->page_len = 0;
1846 + }
1847 +
1848 +@@ -1059,6 +1062,7 @@ xdr_buf_subsegment(struct xdr_buf *buf, struct xdr_buf *subbuf,
1849 + base = 0;
1850 + } else {
1851 + base -= buf->tail[0].iov_len;
1852 ++ subbuf->tail[0].iov_base = buf->tail[0].iov_base;
1853 + subbuf->tail[0].iov_len = 0;
1854 + }
1855 +
1856 +diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
1857 +index a33fa1a91873..28bfb4378dbd 100644
1858 +--- a/scripts/Kbuild.include
1859 ++++ b/scripts/Kbuild.include
1860 +@@ -82,20 +82,21 @@ cc-cross-prefix = \
1861 + fi)))
1862 +
1863 + # output directory for tests below
1864 +-TMPOUT := $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/)
1865 ++TMPOUT = $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_$$$$
1866 +
1867 + # try-run
1868 + # Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
1869 + # Exit code chooses option. "$$TMP" serves as a temporary file and is
1870 + # automatically cleaned up.
1871 + try-run = $(shell set -e; \
1872 +- TMP="$(TMPOUT).$$$$.tmp"; \
1873 +- TMPO="$(TMPOUT).$$$$.o"; \
1874 ++ TMP=$(TMPOUT)/tmp; \
1875 ++ TMPO=$(TMPOUT)/tmp.o; \
1876 ++ mkdir -p $(TMPOUT); \
1877 ++ trap "rm -rf $(TMPOUT)" EXIT; \
1878 + if ($(1)) >/dev/null 2>&1; \
1879 + then echo "$(2)"; \
1880 + else echo "$(3)"; \
1881 +- fi; \
1882 +- rm -f "$$TMP" "$$TMPO")
1883 ++ fi)
1884 +
1885 + # as-option
1886 + # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,)
1887 +diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
1888 +index 4f08023101f3..1c6b389ad8f9 100644
1889 +--- a/security/apparmor/lsm.c
1890 ++++ b/security/apparmor/lsm.c
1891 +@@ -123,11 +123,11 @@ static int apparmor_ptrace_traceme(struct task_struct *parent)
1892 + struct aa_label *tracer, *tracee;
1893 + int error;
1894 +
1895 +- tracee = begin_current_label_crit_section();
1896 ++ tracee = __begin_current_label_crit_section();
1897 + tracer = aa_get_task_label(parent);
1898 + error = aa_may_ptrace(tracer, tracee, AA_PTRACE_TRACE);
1899 + aa_put_label(tracer);
1900 +- end_current_label_crit_section(tracee);
1901 ++ __end_current_label_crit_section(tracee);
1902 +
1903 + return error;
1904 + }
1905 +diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
1906 +index 6b4ebaefd8f8..9e8cfc409b4b 100644
1907 +--- a/sound/pci/hda/patch_hdmi.c
1908 ++++ b/sound/pci/hda/patch_hdmi.c
1909 +@@ -3861,6 +3861,11 @@ HDA_CODEC_ENTRY(0x10de0095, "GPU 95 HDMI/DP", patch_nvhdmi),
1910 + HDA_CODEC_ENTRY(0x10de0097, "GPU 97 HDMI/DP", patch_nvhdmi),
1911 + HDA_CODEC_ENTRY(0x10de0098, "GPU 98 HDMI/DP", patch_nvhdmi),
1912 + HDA_CODEC_ENTRY(0x10de0099, "GPU 99 HDMI/DP", patch_nvhdmi),
1913 ++HDA_CODEC_ENTRY(0x10de009a, "GPU 9a HDMI/DP", patch_nvhdmi),
1914 ++HDA_CODEC_ENTRY(0x10de009d, "GPU 9d HDMI/DP", patch_nvhdmi),
1915 ++HDA_CODEC_ENTRY(0x10de009e, "GPU 9e HDMI/DP", patch_nvhdmi),
1916 ++HDA_CODEC_ENTRY(0x10de009f, "GPU 9f HDMI/DP", patch_nvhdmi),
1917 ++HDA_CODEC_ENTRY(0x10de00a0, "GPU a0 HDMI/DP", patch_nvhdmi),
1918 + HDA_CODEC_ENTRY(0x10de8001, "MCP73 HDMI", patch_nvhdmi_2ch),
1919 + HDA_CODEC_ENTRY(0x10de8067, "MCP67/68 HDMI", patch_nvhdmi_2ch),
1920 + HDA_CODEC_ENTRY(0x11069f80, "VX900 HDMI/DP", patch_via_hdmi),
1921 +diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c
1922 +index 8a2e3bbce3a1..ad16c8310dd3 100644
1923 +--- a/sound/soc/rockchip/rockchip_pdm.c
1924 ++++ b/sound/soc/rockchip/rockchip_pdm.c
1925 +@@ -478,8 +478,10 @@ static int rockchip_pdm_resume(struct device *dev)
1926 + int ret;
1927 +
1928 + ret = pm_runtime_get_sync(dev);
1929 +- if (ret < 0)
1930 ++ if (ret < 0) {
1931 ++ pm_runtime_put(dev);
1932 + return ret;
1933 ++ }
1934 +
1935 + ret = regcache_sync(pdm->regmap);
1936 +
1937 +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
1938 +index dbbc5609b453..b29a3546ab6a 100644
1939 +--- a/sound/usb/mixer.c
1940 ++++ b/sound/usb/mixer.c
1941 +@@ -591,8 +591,9 @@ static int check_matrix_bitmap(unsigned char *bmap,
1942 + * if failed, give up and free the control instance.
1943 + */
1944 +
1945 +-int snd_usb_mixer_add_control(struct usb_mixer_elem_list *list,
1946 +- struct snd_kcontrol *kctl)
1947 ++int snd_usb_mixer_add_list(struct usb_mixer_elem_list *list,
1948 ++ struct snd_kcontrol *kctl,
1949 ++ bool is_std_info)
1950 + {
1951 + struct usb_mixer_interface *mixer = list->mixer;
1952 + int err;
1953 +@@ -605,6 +606,7 @@ int snd_usb_mixer_add_control(struct usb_mixer_elem_list *list,
1954 + return err;
1955 + }
1956 + list->kctl = kctl;
1957 ++ list->is_std_info = is_std_info;
1958 + list->next_id_elem = mixer->id_elems[list->id];
1959 + mixer->id_elems[list->id] = list;
1960 + return 0;
1961 +@@ -2403,15 +2405,23 @@ void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid)
1962 + {
1963 + struct usb_mixer_elem_list *list;
1964 +
1965 +- for (list = mixer->id_elems[unitid]; list; list = list->next_id_elem)
1966 ++ for_each_mixer_elem(list, mixer, unitid) {
1967 ++ struct usb_mixer_elem_info *info;
1968 ++
1969 ++ if (!list->is_std_info)
1970 ++ continue;
1971 ++ info = mixer_elem_list_to_info(list);
1972 ++ /* invalidate cache, so the value is read from the device */
1973 ++ info->cached = 0;
1974 + snd_ctl_notify(mixer->chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
1975 + &list->kctl->id);
1976 ++ }
1977 + }
1978 +
1979 + static void snd_usb_mixer_dump_cval(struct snd_info_buffer *buffer,
1980 + struct usb_mixer_elem_list *list)
1981 + {
1982 +- struct usb_mixer_elem_info *cval = (struct usb_mixer_elem_info *)list;
1983 ++ struct usb_mixer_elem_info *cval = mixer_elem_list_to_info(list);
1984 + static char *val_types[] = {"BOOLEAN", "INV_BOOLEAN",
1985 + "S8", "U8", "S16", "U16"};
1986 + snd_iprintf(buffer, " Info: id=%i, control=%i, cmask=0x%x, "
1987 +@@ -2437,8 +2447,7 @@ static void snd_usb_mixer_proc_read(struct snd_info_entry *entry,
1988 + mixer->ignore_ctl_error);
1989 + snd_iprintf(buffer, "Card: %s\n", chip->card->longname);
1990 + for (unitid = 0; unitid < MAX_ID_ELEMS; unitid++) {
1991 +- for (list = mixer->id_elems[unitid]; list;
1992 +- list = list->next_id_elem) {
1993 ++ for_each_mixer_elem(list, mixer, unitid) {
1994 + snd_iprintf(buffer, " Unit: %i\n", list->id);
1995 + if (list->kctl)
1996 + snd_iprintf(buffer,
1997 +@@ -2468,19 +2477,21 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer,
1998 + return;
1999 + }
2000 +
2001 +- for (list = mixer->id_elems[unitid]; list; list = list->next_id_elem)
2002 ++ for_each_mixer_elem(list, mixer, unitid)
2003 + count++;
2004 +
2005 + if (count == 0)
2006 + return;
2007 +
2008 +- for (list = mixer->id_elems[unitid]; list; list = list->next_id_elem) {
2009 ++ for_each_mixer_elem(list, mixer, unitid) {
2010 + struct usb_mixer_elem_info *info;
2011 +
2012 + if (!list->kctl)
2013 + continue;
2014 ++ if (!list->is_std_info)
2015 ++ continue;
2016 +
2017 +- info = (struct usb_mixer_elem_info *)list;
2018 ++ info = mixer_elem_list_to_info(list);
2019 + if (count > 1 && info->control != control)
2020 + continue;
2021 +
2022 +@@ -2700,7 +2711,7 @@ int snd_usb_mixer_suspend(struct usb_mixer_interface *mixer)
2023 +
2024 + static int restore_mixer_value(struct usb_mixer_elem_list *list)
2025 + {
2026 +- struct usb_mixer_elem_info *cval = (struct usb_mixer_elem_info *)list;
2027 ++ struct usb_mixer_elem_info *cval = mixer_elem_list_to_info(list);
2028 + int c, err, idx;
2029 +
2030 + if (cval->cmask) {
2031 +@@ -2736,8 +2747,7 @@ int snd_usb_mixer_resume(struct usb_mixer_interface *mixer, bool reset_resume)
2032 + if (reset_resume) {
2033 + /* restore cached mixer values */
2034 + for (id = 0; id < MAX_ID_ELEMS; id++) {
2035 +- for (list = mixer->id_elems[id]; list;
2036 +- list = list->next_id_elem) {
2037 ++ for_each_mixer_elem(list, mixer, id) {
2038 + if (list->resume) {
2039 + err = list->resume(list);
2040 + if (err < 0)
2041 +diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h
2042 +index ba27f7ade670..7c824a44589b 100644
2043 +--- a/sound/usb/mixer.h
2044 ++++ b/sound/usb/mixer.h
2045 +@@ -49,10 +49,17 @@ struct usb_mixer_elem_list {
2046 + struct usb_mixer_elem_list *next_id_elem; /* list of controls with same id */
2047 + struct snd_kcontrol *kctl;
2048 + unsigned int id;
2049 ++ bool is_std_info;
2050 + usb_mixer_elem_dump_func_t dump;
2051 + usb_mixer_elem_resume_func_t resume;
2052 + };
2053 +
2054 ++/* iterate over mixer element list of the given unit id */
2055 ++#define for_each_mixer_elem(list, mixer, id) \
2056 ++ for ((list) = (mixer)->id_elems[id]; (list); (list) = (list)->next_id_elem)
2057 ++#define mixer_elem_list_to_info(list) \
2058 ++ container_of(list, struct usb_mixer_elem_info, head)
2059 ++
2060 + struct usb_mixer_elem_info {
2061 + struct usb_mixer_elem_list head;
2062 + unsigned int control; /* CS or ICN (high byte) */
2063 +@@ -80,8 +87,12 @@ void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid);
2064 + int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
2065 + int request, int validx, int value_set);
2066 +
2067 +-int snd_usb_mixer_add_control(struct usb_mixer_elem_list *list,
2068 +- struct snd_kcontrol *kctl);
2069 ++int snd_usb_mixer_add_list(struct usb_mixer_elem_list *list,
2070 ++ struct snd_kcontrol *kctl,
2071 ++ bool is_std_info);
2072 ++
2073 ++#define snd_usb_mixer_add_control(list, kctl) \
2074 ++ snd_usb_mixer_add_list(list, kctl, true)
2075 +
2076 + void snd_usb_mixer_elem_init_std(struct usb_mixer_elem_list *list,
2077 + struct usb_mixer_interface *mixer,
2078 +diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
2079 +index b9ea4a42aee4..5604cce30a58 100644
2080 +--- a/sound/usb/mixer_quirks.c
2081 ++++ b/sound/usb/mixer_quirks.c
2082 +@@ -169,7 +169,8 @@ static int add_single_ctl_with_resume(struct usb_mixer_interface *mixer,
2083 + return -ENOMEM;
2084 + }
2085 + kctl->private_free = snd_usb_mixer_elem_free;
2086 +- return snd_usb_mixer_add_control(list, kctl);
2087 ++ /* don't use snd_usb_mixer_add_control() here, this is a special list element */
2088 ++ return snd_usb_mixer_add_list(list, kctl, false);
2089 + }
2090 +
2091 + /*
2092 +@@ -1171,7 +1172,7 @@ void snd_emuusb_set_samplerate(struct snd_usb_audio *chip,
2093 + int unitid = 12; /* SamleRate ExtensionUnit ID */
2094 +
2095 + list_for_each_entry(mixer, &chip->mixer_list, list) {
2096 +- cval = (struct usb_mixer_elem_info *)mixer->id_elems[unitid];
2097 ++ cval = mixer_elem_list_to_info(mixer->id_elems[unitid]);
2098 + if (cval) {
2099 + snd_usb_mixer_set_ctl_value(cval, UAC_SET_CUR,
2100 + cval->control << 8,
2101 +diff --git a/sound/usb/mixer_scarlett.c b/sound/usb/mixer_scarlett.c
2102 +index c33e2378089d..4aeb9488a0c9 100644
2103 +--- a/sound/usb/mixer_scarlett.c
2104 ++++ b/sound/usb/mixer_scarlett.c
2105 +@@ -287,8 +287,7 @@ static int scarlett_ctl_switch_put(struct snd_kcontrol *kctl,
2106 +
2107 + static int scarlett_ctl_resume(struct usb_mixer_elem_list *list)
2108 + {
2109 +- struct usb_mixer_elem_info *elem =
2110 +- container_of(list, struct usb_mixer_elem_info, head);
2111 ++ struct usb_mixer_elem_info *elem = mixer_elem_list_to_info(list);
2112 + int i;
2113 +
2114 + for (i = 0; i < elem->channels; i++)
2115 +@@ -447,8 +446,7 @@ static int scarlett_ctl_enum_put(struct snd_kcontrol *kctl,
2116 +
2117 + static int scarlett_ctl_enum_resume(struct usb_mixer_elem_list *list)
2118 + {
2119 +- struct usb_mixer_elem_info *elem =
2120 +- container_of(list, struct usb_mixer_elem_info, head);
2121 ++ struct usb_mixer_elem_info *elem = mixer_elem_list_to_info(list);
2122 +
2123 + if (elem->cached)
2124 + snd_usb_set_cur_mix_value(elem, 0, 0, *elem->cache_val);
2125 +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
2126 +index f29a8ed4f856..cd36394e27ae 100644
2127 +--- a/sound/usb/quirks.c
2128 ++++ b/sound/usb/quirks.c
2129 +@@ -1164,6 +1164,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip)
2130 + static bool is_itf_usb_dsd_2alts_dac(unsigned int id)
2131 + {
2132 + switch (id) {
2133 ++ case USB_ID(0x154e, 0x1002): /* Denon DCD-1500RE */
2134 + case USB_ID(0x154e, 0x1003): /* Denon DA-300USB */
2135 + case USB_ID(0x154e, 0x3005): /* Marantz HD-DAC1 */
2136 + case USB_ID(0x154e, 0x3006): /* Marantz SA-14S1 */