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: Tue, 05 Mar 2019 18:03:18
Message-Id: 1551808970.5f40e60f1499825253ab3d5a800de8d901e61460.mpagano@gentoo
1 commit: 5f40e60f1499825253ab3d5a800de8d901e61460
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 5 18:02:50 2019 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 5 18:02:50 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=5f40e60f
7
8 proj/linux-patches: Linux patch 4.14.105
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1104_linux-4.14.105.patch | 1566 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 1570 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 26d07a8..047a68d 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -459,6 +459,10 @@ Patch: 1103_4.14.104.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.14.104
23
24 +Patch: 1104_4.14.105.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.14.105
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/1104_linux-4.14.105.patch b/1104_linux-4.14.105.patch
33 new file mode 100644
34 index 0000000..e01e696
35 --- /dev/null
36 +++ b/1104_linux-4.14.105.patch
37 @@ -0,0 +1,1566 @@
38 +diff --git a/Makefile b/Makefile
39 +index 967692b8941fc..d5375891a7eb9 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 = 104
47 ++SUBLEVEL = 105
48 + EXTRAVERSION =
49 + NAME = Petit Gorille
50 +
51 +diff --git a/arch/arc/include/asm/bitops.h b/arch/arc/include/asm/bitops.h
52 +index 8da87feec59aa..99e6d8948f4ac 100644
53 +--- a/arch/arc/include/asm/bitops.h
54 ++++ b/arch/arc/include/asm/bitops.h
55 +@@ -340,7 +340,7 @@ static inline __attribute__ ((const)) int __fls(unsigned long x)
56 + /*
57 + * __ffs: Similar to ffs, but zero based (0-31)
58 + */
59 +-static inline __attribute__ ((const)) int __ffs(unsigned long word)
60 ++static inline __attribute__ ((const)) unsigned long __ffs(unsigned long word)
61 + {
62 + if (!word)
63 + return word;
64 +@@ -400,9 +400,9 @@ static inline __attribute__ ((const)) int ffs(unsigned long x)
65 + /*
66 + * __ffs: Similar to ffs, but zero based (0-31)
67 + */
68 +-static inline __attribute__ ((const)) int __ffs(unsigned long x)
69 ++static inline __attribute__ ((const)) unsigned long __ffs(unsigned long x)
70 + {
71 +- int n;
72 ++ unsigned long n;
73 +
74 + asm volatile(
75 + " ffs.f %0, %1 \n" /* 0:31; 31(Z) if src 0 */
76 +diff --git a/arch/mips/kernel/cmpxchg.c b/arch/mips/kernel/cmpxchg.c
77 +index 0b9535bc2c53d..6b2a4a902a981 100644
78 +--- a/arch/mips/kernel/cmpxchg.c
79 ++++ b/arch/mips/kernel/cmpxchg.c
80 +@@ -54,10 +54,9 @@ unsigned long __xchg_small(volatile void *ptr, unsigned long val, unsigned int s
81 + unsigned long __cmpxchg_small(volatile void *ptr, unsigned long old,
82 + unsigned long new, unsigned int size)
83 + {
84 +- u32 mask, old32, new32, load32;
85 ++ u32 mask, old32, new32, load32, load;
86 + volatile u32 *ptr32;
87 + unsigned int shift;
88 +- u8 load;
89 +
90 + /* Check that ptr is naturally aligned */
91 + WARN_ON((unsigned long)ptr & (size - 1));
92 +diff --git a/arch/mips/net/ebpf_jit.c b/arch/mips/net/ebpf_jit.c
93 +index dd537cba44494..8004bfcfb033a 100644
94 +--- a/arch/mips/net/ebpf_jit.c
95 ++++ b/arch/mips/net/ebpf_jit.c
96 +@@ -1971,7 +1971,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
97 +
98 + /* Update the icache */
99 + flush_icache_range((unsigned long)ctx.target,
100 +- (unsigned long)(ctx.target + ctx.idx * sizeof(u32)));
101 ++ (unsigned long)&ctx.target[ctx.idx]);
102 +
103 + if (bpf_jit_enable > 1)
104 + /* Dump JIT code */
105 +diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h
106 +index 334459ad145b4..90863245df53b 100644
107 +--- a/arch/powerpc/include/asm/epapr_hcalls.h
108 ++++ b/arch/powerpc/include/asm/epapr_hcalls.h
109 +@@ -508,7 +508,7 @@ static unsigned long epapr_hypercall(unsigned long *in,
110 +
111 + static inline long epapr_hypercall0_1(unsigned int nr, unsigned long *r2)
112 + {
113 +- unsigned long in[8];
114 ++ unsigned long in[8] = {0};
115 + unsigned long out[8];
116 + unsigned long r;
117 +
118 +@@ -520,7 +520,7 @@ static inline long epapr_hypercall0_1(unsigned int nr, unsigned long *r2)
119 +
120 + static inline long epapr_hypercall0(unsigned int nr)
121 + {
122 +- unsigned long in[8];
123 ++ unsigned long in[8] = {0};
124 + unsigned long out[8];
125 +
126 + return epapr_hypercall(in, out, nr);
127 +@@ -528,7 +528,7 @@ static inline long epapr_hypercall0(unsigned int nr)
128 +
129 + static inline long epapr_hypercall1(unsigned int nr, unsigned long p1)
130 + {
131 +- unsigned long in[8];
132 ++ unsigned long in[8] = {0};
133 + unsigned long out[8];
134 +
135 + in[0] = p1;
136 +@@ -538,7 +538,7 @@ static inline long epapr_hypercall1(unsigned int nr, unsigned long p1)
137 + static inline long epapr_hypercall2(unsigned int nr, unsigned long p1,
138 + unsigned long p2)
139 + {
140 +- unsigned long in[8];
141 ++ unsigned long in[8] = {0};
142 + unsigned long out[8];
143 +
144 + in[0] = p1;
145 +@@ -549,7 +549,7 @@ static inline long epapr_hypercall2(unsigned int nr, unsigned long p1,
146 + static inline long epapr_hypercall3(unsigned int nr, unsigned long p1,
147 + unsigned long p2, unsigned long p3)
148 + {
149 +- unsigned long in[8];
150 ++ unsigned long in[8] = {0};
151 + unsigned long out[8];
152 +
153 + in[0] = p1;
154 +@@ -562,7 +562,7 @@ static inline long epapr_hypercall4(unsigned int nr, unsigned long p1,
155 + unsigned long p2, unsigned long p3,
156 + unsigned long p4)
157 + {
158 +- unsigned long in[8];
159 ++ unsigned long in[8] = {0};
160 + unsigned long out[8];
161 +
162 + in[0] = p1;
163 +diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
164 +index aae77eb8491c0..4111edb3188e2 100644
165 +--- a/arch/x86/include/asm/uaccess.h
166 ++++ b/arch/x86/include/asm/uaccess.h
167 +@@ -293,8 +293,7 @@ do { \
168 + __put_user_asm(x, ptr, retval, "l", "k", "ir", errret); \
169 + break; \
170 + case 8: \
171 +- __put_user_asm_u64((__typeof__(*ptr))(x), ptr, retval, \
172 +- errret); \
173 ++ __put_user_asm_u64(x, ptr, retval, errret); \
174 + break; \
175 + default: \
176 + __put_user_bad(); \
177 +@@ -440,8 +439,10 @@ do { \
178 + #define __put_user_nocheck(x, ptr, size) \
179 + ({ \
180 + int __pu_err; \
181 ++ __typeof__(*(ptr)) __pu_val; \
182 ++ __pu_val = x; \
183 + __uaccess_begin(); \
184 +- __put_user_size((x), (ptr), (size), __pu_err, -EFAULT); \
185 ++ __put_user_size(__pu_val, (ptr), (size), __pu_err, -EFAULT);\
186 + __uaccess_end(); \
187 + __builtin_expect(__pu_err, 0); \
188 + })
189 +diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
190 +index 656ac12f54392..c387047e926a2 100644
191 +--- a/arch/x86/kvm/svm.c
192 ++++ b/arch/x86/kvm/svm.c
193 +@@ -2929,6 +2929,14 @@ static int nested_svm_vmexit(struct vcpu_svm *svm)
194 + kvm_mmu_reset_context(&svm->vcpu);
195 + kvm_mmu_load(&svm->vcpu);
196 +
197 ++ /*
198 ++ * Drop what we picked up for L2 via svm_complete_interrupts() so it
199 ++ * doesn't end up in L1.
200 ++ */
201 ++ svm->vcpu.arch.nmi_injected = false;
202 ++ kvm_clear_exception_queue(&svm->vcpu);
203 ++ kvm_clear_interrupt_queue(&svm->vcpu);
204 ++
205 + return 0;
206 + }
207 +
208 +@@ -4006,25 +4014,14 @@ static int avic_incomplete_ipi_interception(struct vcpu_svm *svm)
209 + kvm_lapic_reg_write(apic, APIC_ICR, icrl);
210 + break;
211 + case AVIC_IPI_FAILURE_TARGET_NOT_RUNNING: {
212 +- int i;
213 +- struct kvm_vcpu *vcpu;
214 +- struct kvm *kvm = svm->vcpu.kvm;
215 + struct kvm_lapic *apic = svm->vcpu.arch.apic;
216 +
217 + /*
218 +- * At this point, we expect that the AVIC HW has already
219 +- * set the appropriate IRR bits on the valid target
220 +- * vcpus. So, we just need to kick the appropriate vcpu.
221 ++ * Update ICR high and low, then emulate sending IPI,
222 ++ * which is handled when writing APIC_ICR.
223 + */
224 +- kvm_for_each_vcpu(i, vcpu, kvm) {
225 +- bool m = kvm_apic_match_dest(vcpu, apic,
226 +- icrl & KVM_APIC_SHORT_MASK,
227 +- GET_APIC_DEST_FIELD(icrh),
228 +- icrl & KVM_APIC_DEST_MASK);
229 +-
230 +- if (m && !avic_vcpu_is_running(vcpu))
231 +- kvm_vcpu_wake_up(vcpu);
232 +- }
233 ++ kvm_lapic_reg_write(apic, APIC_ICR2, icrh);
234 ++ kvm_lapic_reg_write(apic, APIC_ICR, icrl);
235 + break;
236 + }
237 + case AVIC_IPI_FAILURE_INVALID_TARGET:
238 +diff --git a/drivers/block/loop.c b/drivers/block/loop.c
239 +index 7910dd8b1d3a5..24a3fb35614f2 100644
240 +--- a/drivers/block/loop.c
241 ++++ b/drivers/block/loop.c
242 +@@ -81,6 +81,7 @@
243 + #include <linux/uaccess.h>
244 +
245 + static DEFINE_IDR(loop_index_idr);
246 ++static DEFINE_MUTEX(loop_index_mutex);
247 + static DEFINE_MUTEX(loop_ctl_mutex);
248 +
249 + static int max_part;
250 +@@ -1618,11 +1619,9 @@ static int lo_compat_ioctl(struct block_device *bdev, fmode_t mode,
251 + static int lo_open(struct block_device *bdev, fmode_t mode)
252 + {
253 + struct loop_device *lo;
254 +- int err;
255 ++ int err = 0;
256 +
257 +- err = mutex_lock_killable(&loop_ctl_mutex);
258 +- if (err)
259 +- return err;
260 ++ mutex_lock(&loop_index_mutex);
261 + lo = bdev->bd_disk->private_data;
262 + if (!lo) {
263 + err = -ENXIO;
264 +@@ -1631,20 +1630,18 @@ static int lo_open(struct block_device *bdev, fmode_t mode)
265 +
266 + atomic_inc(&lo->lo_refcnt);
267 + out:
268 +- mutex_unlock(&loop_ctl_mutex);
269 ++ mutex_unlock(&loop_index_mutex);
270 + return err;
271 + }
272 +
273 +-static void lo_release(struct gendisk *disk, fmode_t mode)
274 ++static void __lo_release(struct loop_device *lo)
275 + {
276 +- struct loop_device *lo;
277 + int err;
278 +
279 +- mutex_lock(&loop_ctl_mutex);
280 +- lo = disk->private_data;
281 + if (atomic_dec_return(&lo->lo_refcnt))
282 +- goto out_unlock;
283 ++ return;
284 +
285 ++ mutex_lock(&loop_ctl_mutex);
286 + if (lo->lo_flags & LO_FLAGS_AUTOCLEAR) {
287 + /*
288 + * In autoclear mode, stop the loop thread
289 +@@ -1662,10 +1659,16 @@ static void lo_release(struct gendisk *disk, fmode_t mode)
290 + blk_mq_unfreeze_queue(lo->lo_queue);
291 + }
292 +
293 +-out_unlock:
294 + mutex_unlock(&loop_ctl_mutex);
295 + }
296 +
297 ++static void lo_release(struct gendisk *disk, fmode_t mode)
298 ++{
299 ++ mutex_lock(&loop_index_mutex);
300 ++ __lo_release(disk->private_data);
301 ++ mutex_unlock(&loop_index_mutex);
302 ++}
303 ++
304 + static const struct block_device_operations lo_fops = {
305 + .owner = THIS_MODULE,
306 + .open = lo_open,
307 +@@ -1956,7 +1959,7 @@ static struct kobject *loop_probe(dev_t dev, int *part, void *data)
308 + struct kobject *kobj;
309 + int err;
310 +
311 +- mutex_lock(&loop_ctl_mutex);
312 ++ mutex_lock(&loop_index_mutex);
313 + err = loop_lookup(&lo, MINOR(dev) >> part_shift);
314 + if (err < 0)
315 + err = loop_add(&lo, MINOR(dev) >> part_shift);
316 +@@ -1964,7 +1967,7 @@ static struct kobject *loop_probe(dev_t dev, int *part, void *data)
317 + kobj = NULL;
318 + else
319 + kobj = get_disk(lo->lo_disk);
320 +- mutex_unlock(&loop_ctl_mutex);
321 ++ mutex_unlock(&loop_index_mutex);
322 +
323 + *part = 0;
324 + return kobj;
325 +@@ -1974,13 +1977,9 @@ static long loop_control_ioctl(struct file *file, unsigned int cmd,
326 + unsigned long parm)
327 + {
328 + struct loop_device *lo;
329 +- int ret;
330 +-
331 +- ret = mutex_lock_killable(&loop_ctl_mutex);
332 +- if (ret)
333 +- return ret;
334 ++ int ret = -ENOSYS;
335 +
336 +- ret = -ENOSYS;
337 ++ mutex_lock(&loop_index_mutex);
338 + switch (cmd) {
339 + case LOOP_CTL_ADD:
340 + ret = loop_lookup(&lo, parm);
341 +@@ -1994,15 +1993,19 @@ static long loop_control_ioctl(struct file *file, unsigned int cmd,
342 + ret = loop_lookup(&lo, parm);
343 + if (ret < 0)
344 + break;
345 ++ mutex_lock(&loop_ctl_mutex);
346 + if (lo->lo_state != Lo_unbound) {
347 + ret = -EBUSY;
348 ++ mutex_unlock(&loop_ctl_mutex);
349 + break;
350 + }
351 + if (atomic_read(&lo->lo_refcnt) > 0) {
352 + ret = -EBUSY;
353 ++ mutex_unlock(&loop_ctl_mutex);
354 + break;
355 + }
356 + lo->lo_disk->private_data = NULL;
357 ++ mutex_unlock(&loop_ctl_mutex);
358 + idr_remove(&loop_index_idr, lo->lo_number);
359 + loop_remove(lo);
360 + break;
361 +@@ -2012,7 +2015,7 @@ static long loop_control_ioctl(struct file *file, unsigned int cmd,
362 + break;
363 + ret = loop_add(&lo, -1);
364 + }
365 +- mutex_unlock(&loop_ctl_mutex);
366 ++ mutex_unlock(&loop_index_mutex);
367 +
368 + return ret;
369 + }
370 +@@ -2096,10 +2099,10 @@ static int __init loop_init(void)
371 + THIS_MODULE, loop_probe, NULL, NULL);
372 +
373 + /* pre-create number of devices given by config or max_loop */
374 +- mutex_lock(&loop_ctl_mutex);
375 ++ mutex_lock(&loop_index_mutex);
376 + for (i = 0; i < nr; i++)
377 + loop_add(&lo, i);
378 +- mutex_unlock(&loop_ctl_mutex);
379 ++ mutex_unlock(&loop_index_mutex);
380 +
381 + printk(KERN_INFO "loop: module loaded\n");
382 + return 0;
383 +diff --git a/drivers/clk/clk-versaclock5.c b/drivers/clk/clk-versaclock5.c
384 +index decffb3826ece..a738af893532f 100644
385 +--- a/drivers/clk/clk-versaclock5.c
386 ++++ b/drivers/clk/clk-versaclock5.c
387 +@@ -262,8 +262,10 @@ static int vc5_mux_set_parent(struct clk_hw *hw, u8 index)
388 +
389 + if (vc5->clk_mux_ins == VC5_MUX_IN_XIN)
390 + src = VC5_PRIM_SRC_SHDN_EN_XTAL;
391 +- if (vc5->clk_mux_ins == VC5_MUX_IN_CLKIN)
392 ++ else if (vc5->clk_mux_ins == VC5_MUX_IN_CLKIN)
393 + src = VC5_PRIM_SRC_SHDN_EN_CLKIN;
394 ++ else /* Invalid; should have been caught by vc5_probe() */
395 ++ return -EINVAL;
396 + }
397 +
398 + return regmap_update_bits(vc5->regmap, VC5_PRIM_SRC_SHDN, mask, src);
399 +diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
400 +index e343df1903754..05bb87a54e909 100644
401 +--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
402 ++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c
403 +@@ -32,6 +32,7 @@
404 + #include "vega10_pptable.h"
405 +
406 + #define NUM_DSPCLK_LEVELS 8
407 ++#define VEGA10_ENGINECLOCK_HARDMAX 198000
408 +
409 + static void set_hw_cap(struct pp_hwmgr *hwmgr, bool enable,
410 + enum phm_platform_caps cap)
411 +@@ -258,7 +259,26 @@ static int init_over_drive_limits(
412 + struct pp_hwmgr *hwmgr,
413 + const ATOM_Vega10_POWERPLAYTABLE *powerplay_table)
414 + {
415 +- hwmgr->platform_descriptor.overdriveLimit.engineClock =
416 ++ const ATOM_Vega10_GFXCLK_Dependency_Table *gfxclk_dep_table =
417 ++ (const ATOM_Vega10_GFXCLK_Dependency_Table *)
418 ++ (((unsigned long) powerplay_table) +
419 ++ le16_to_cpu(powerplay_table->usGfxclkDependencyTableOffset));
420 ++ bool is_acg_enabled = false;
421 ++ ATOM_Vega10_GFXCLK_Dependency_Record_V2 *patom_record_v2;
422 ++
423 ++ if (gfxclk_dep_table->ucRevId == 1) {
424 ++ patom_record_v2 =
425 ++ (ATOM_Vega10_GFXCLK_Dependency_Record_V2 *)gfxclk_dep_table->entries;
426 ++ is_acg_enabled =
427 ++ (bool)patom_record_v2[gfxclk_dep_table->ucNumEntries-1].ucACGEnable;
428 ++ }
429 ++
430 ++ if (powerplay_table->ulMaxODEngineClock > VEGA10_ENGINECLOCK_HARDMAX &&
431 ++ !is_acg_enabled)
432 ++ hwmgr->platform_descriptor.overdriveLimit.engineClock =
433 ++ VEGA10_ENGINECLOCK_HARDMAX;
434 ++ else
435 ++ hwmgr->platform_descriptor.overdriveLimit.engineClock =
436 + le32_to_cpu(powerplay_table->ulMaxODEngineClock);
437 + hwmgr->platform_descriptor.overdriveLimit.memoryClock =
438 + le32_to_cpu(powerplay_table->ulMaxODMemoryClock);
439 +diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c
440 +index ec56794ad0399..bdce1c9434c6c 100644
441 +--- a/drivers/gpu/drm/msm/msm_rd.c
442 ++++ b/drivers/gpu/drm/msm/msm_rd.c
443 +@@ -109,7 +109,9 @@ static void rd_write(struct msm_rd_state *rd, const void *buf, int sz)
444 + char *fptr = &fifo->buf[fifo->head];
445 + int n;
446 +
447 +- wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0);
448 ++ wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0 || !rd->open);
449 ++ if (!rd->open)
450 ++ return;
451 +
452 + /* Note that smp_load_acquire() is not strictly required
453 + * as CIRC_SPACE_TO_END() does not access the tail more
454 +@@ -207,7 +209,10 @@ out:
455 + static int rd_release(struct inode *inode, struct file *file)
456 + {
457 + struct msm_rd_state *rd = inode->i_private;
458 ++
459 + rd->open = false;
460 ++ wake_up_all(&rd->fifo_event);
461 ++
462 + return 0;
463 + }
464 +
465 +diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
466 +index 476e53d301283..67f6bd24a9d0c 100644
467 +--- a/drivers/mmc/host/mmc_spi.c
468 ++++ b/drivers/mmc/host/mmc_spi.c
469 +@@ -1447,6 +1447,7 @@ static int mmc_spi_probe(struct spi_device *spi)
470 + mmc->caps &= ~MMC_CAP_NEEDS_POLL;
471 + mmc_gpiod_request_cd_irq(mmc);
472 + }
473 ++ mmc_detect_change(mmc, 0);
474 +
475 + if (host->pdata && host->pdata->flags & MMC_SPI_USE_RO_GPIO) {
476 + has_ro = true;
477 +diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
478 +index df4465439e13c..5dd31a2a877a5 100644
479 +--- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c
480 ++++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
481 +@@ -68,6 +68,7 @@ static const struct renesas_sdhi_of_data of_rcar_gen2_compatible = {
482 + .scc_offset = 0x0300,
483 + .taps = rcar_gen2_scc_taps,
484 + .taps_num = ARRAY_SIZE(rcar_gen2_scc_taps),
485 ++ .max_blk_count = 0xffffffff,
486 + };
487 +
488 + /* Definitions for sampling clocks */
489 +diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
490 +index c81de2f25281e..59041f07b53cf 100644
491 +--- a/drivers/mmc/host/sdhci-esdhc-imx.c
492 ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c
493 +@@ -1077,11 +1077,12 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host)
494 + writel(readl(host->ioaddr + SDHCI_HOST_CONTROL)
495 + | ESDHC_BURST_LEN_EN_INCR,
496 + host->ioaddr + SDHCI_HOST_CONTROL);
497 ++
498 + /*
499 +- * erratum ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL
500 +- * TO1.1, it's harmless for MX6SL
501 +- */
502 +- writel(readl(host->ioaddr + 0x6c) | BIT(7),
503 ++ * erratum ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL
504 ++ * TO1.1, it's harmless for MX6SL
505 ++ */
506 ++ writel(readl(host->ioaddr + 0x6c) & ~BIT(7),
507 + host->ioaddr + 0x6c);
508 +
509 + /* disable DLL_CTRL delay line settings */
510 +diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
511 +index 3e6ff89214403..fe10de349aeb3 100644
512 +--- a/drivers/mmc/host/tmio_mmc.h
513 ++++ b/drivers/mmc/host/tmio_mmc.h
514 +@@ -286,6 +286,11 @@ static inline void sd_ctrl_write32_as_16_and_16(struct tmio_mmc_host *host,
515 + writew(val >> 16, host->ctl + ((addr + 2) << host->bus_shift));
516 + }
517 +
518 ++static inline void sd_ctrl_write32(struct tmio_mmc_host *host, int addr, u32 val)
519 ++{
520 ++ iowrite32(val, host->ctl + (addr << host->bus_shift));
521 ++}
522 ++
523 + static inline void sd_ctrl_write32_rep(struct tmio_mmc_host *host, int addr,
524 + const u32 *buf, int count)
525 + {
526 +diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
527 +index de1562f27fdb0..2437fcde915a7 100644
528 +--- a/drivers/mmc/host/tmio_mmc_core.c
529 ++++ b/drivers/mmc/host/tmio_mmc_core.c
530 +@@ -46,6 +46,7 @@
531 + #include <linux/regulator/consumer.h>
532 + #include <linux/mmc/sdio.h>
533 + #include <linux/scatterlist.h>
534 ++#include <linux/sizes.h>
535 + #include <linux/spinlock.h>
536 + #include <linux/swiotlb.h>
537 + #include <linux/workqueue.h>
538 +@@ -688,7 +689,7 @@ static bool __tmio_mmc_sdcard_irq(struct tmio_mmc_host *host, int ireg,
539 + return false;
540 + }
541 +
542 +-static void __tmio_mmc_sdio_irq(struct tmio_mmc_host *host)
543 ++static bool __tmio_mmc_sdio_irq(struct tmio_mmc_host *host)
544 + {
545 + struct mmc_host *mmc = host->mmc;
546 + struct tmio_mmc_data *pdata = host->pdata;
547 +@@ -696,7 +697,7 @@ static void __tmio_mmc_sdio_irq(struct tmio_mmc_host *host)
548 + unsigned int sdio_status;
549 +
550 + if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
551 +- return;
552 ++ return false;
553 +
554 + status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
555 + ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdio_irq_mask;
556 +@@ -709,6 +710,8 @@ static void __tmio_mmc_sdio_irq(struct tmio_mmc_host *host)
557 +
558 + if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
559 + mmc_signal_sdio_irq(mmc);
560 ++
561 ++ return ireg;
562 + }
563 +
564 + irqreturn_t tmio_mmc_irq(int irq, void *devid)
565 +@@ -727,9 +730,10 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
566 + if (__tmio_mmc_sdcard_irq(host, ireg, status))
567 + return IRQ_HANDLED;
568 +
569 +- __tmio_mmc_sdio_irq(host);
570 ++ if (__tmio_mmc_sdio_irq(host))
571 ++ return IRQ_HANDLED;
572 +
573 +- return IRQ_HANDLED;
574 ++ return IRQ_NONE;
575 + }
576 + EXPORT_SYMBOL_GPL(tmio_mmc_irq);
577 +
578 +@@ -758,7 +762,10 @@ static int tmio_mmc_start_data(struct tmio_mmc_host *host,
579 +
580 + /* Set transfer length / blocksize */
581 + sd_ctrl_write16(host, CTL_SD_XFER_LEN, data->blksz);
582 +- sd_ctrl_write16(host, CTL_XFER_BLK_COUNT, data->blocks);
583 ++ if (host->mmc->max_blk_count >= SZ_64K)
584 ++ sd_ctrl_write32(host, CTL_XFER_BLK_COUNT, data->blocks);
585 ++ else
586 ++ sd_ctrl_write16(host, CTL_XFER_BLK_COUNT, data->blocks);
587 +
588 + tmio_mmc_start_dma(host, data);
589 +
590 +diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
591 +index 527908c7e3845..84def1ff6cb64 100644
592 +--- a/drivers/net/ethernet/altera/altera_tse_main.c
593 ++++ b/drivers/net/ethernet/altera/altera_tse_main.c
594 +@@ -714,8 +714,10 @@ static struct phy_device *connect_local_phy(struct net_device *dev)
595 +
596 + phydev = phy_connect(dev, phy_id_fmt, &altera_tse_adjust_link,
597 + priv->phy_iface);
598 +- if (IS_ERR(phydev))
599 ++ if (IS_ERR(phydev)) {
600 + netdev_err(dev, "Could not attach to PHY\n");
601 ++ phydev = NULL;
602 ++ }
603 +
604 + } else {
605 + int ret;
606 +diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
607 +index 6c05819d995ea..754dff4c1771e 100644
608 +--- a/drivers/net/ethernet/ibm/ibmveth.c
609 ++++ b/drivers/net/ethernet/ibm/ibmveth.c
610 +@@ -1314,7 +1314,6 @@ static int ibmveth_poll(struct napi_struct *napi, int budget)
611 + unsigned long lpar_rc;
612 + u16 mss = 0;
613 +
614 +-restart_poll:
615 + while (frames_processed < budget) {
616 + if (!ibmveth_rxq_pending_buffer(adapter))
617 + break;
618 +@@ -1402,7 +1401,6 @@ restart_poll:
619 + napi_reschedule(napi)) {
620 + lpar_rc = h_vio_signal(adapter->vdev->unit_address,
621 + VIO_IRQ_DISABLE);
622 +- goto restart_poll;
623 + }
624 + }
625 +
626 +diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
627 +index c87bc0a5efa3a..d824bf942a8fb 100644
628 +--- a/drivers/net/ethernet/stmicro/stmmac/common.h
629 ++++ b/drivers/net/ethernet/stmicro/stmmac/common.h
630 +@@ -475,7 +475,7 @@ struct mac_device_info;
631 + /* Helpers to program the MAC core */
632 + struct stmmac_ops {
633 + /* MAC core initialization */
634 +- void (*core_init)(struct mac_device_info *hw, int mtu);
635 ++ void (*core_init)(struct mac_device_info *hw, struct net_device *dev);
636 + /* Enable the MAC RX/TX */
637 + void (*set_mac)(void __iomem *ioaddr, bool enable);
638 + /* Enable and verify that the IPC module is supported */
639 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
640 +index 39c2122a4f269..14866331eced6 100644
641 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
642 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
643 +@@ -477,7 +477,8 @@ static int sun8i_dwmac_init(struct platform_device *pdev, void *priv)
644 + return 0;
645 + }
646 +
647 +-static void sun8i_dwmac_core_init(struct mac_device_info *hw, int mtu)
648 ++static void sun8i_dwmac_core_init(struct mac_device_info *hw,
649 ++ struct net_device *dev)
650 + {
651 + void __iomem *ioaddr = hw->pcsr;
652 + u32 v;
653 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
654 +index 8a86340ff2d34..540d21786a43b 100644
655 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
656 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
657 +@@ -25,18 +25,28 @@
658 + #include <linux/crc32.h>
659 + #include <linux/slab.h>
660 + #include <linux/ethtool.h>
661 ++#include <net/dsa.h>
662 + #include <asm/io.h>
663 + #include "stmmac_pcs.h"
664 + #include "dwmac1000.h"
665 +
666 +-static void dwmac1000_core_init(struct mac_device_info *hw, int mtu)
667 ++static void dwmac1000_core_init(struct mac_device_info *hw,
668 ++ struct net_device *dev)
669 + {
670 + void __iomem *ioaddr = hw->pcsr;
671 + u32 value = readl(ioaddr + GMAC_CONTROL);
672 ++ int mtu = dev->mtu;
673 +
674 + /* Configure GMAC core */
675 + value |= GMAC_CORE_INIT;
676 +
677 ++ /* Clear ACS bit because Ethernet switch tagging formats such as
678 ++ * Broadcom tags can look like invalid LLC/SNAP packets and cause the
679 ++ * hardware to truncate packets on reception.
680 ++ */
681 ++ if (netdev_uses_dsa(dev))
682 ++ value &= ~GMAC_CONTROL_ACS;
683 ++
684 + if (mtu > 1500)
685 + value |= GMAC_CONTROL_2K;
686 + if (mtu > 2000)
687 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
688 +index 8ef5173563134..91b23f9db31ad 100644
689 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
690 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
691 +@@ -25,15 +25,26 @@
692 + *******************************************************************************/
693 +
694 + #include <linux/crc32.h>
695 ++#include <net/dsa.h>
696 + #include <asm/io.h>
697 + #include "dwmac100.h"
698 +
699 +-static void dwmac100_core_init(struct mac_device_info *hw, int mtu)
700 ++static void dwmac100_core_init(struct mac_device_info *hw,
701 ++ struct net_device *dev)
702 + {
703 + void __iomem *ioaddr = hw->pcsr;
704 + u32 value = readl(ioaddr + MAC_CONTROL);
705 +
706 +- writel((value | MAC_CORE_INIT), ioaddr + MAC_CONTROL);
707 ++ value |= MAC_CORE_INIT;
708 ++
709 ++ /* Clear ASTP bit because Ethernet switch tagging formats such as
710 ++ * Broadcom tags can look like invalid LLC/SNAP packets and cause the
711 ++ * hardware to truncate packets on reception.
712 ++ */
713 ++ if (netdev_uses_dsa(dev))
714 ++ value &= ~MAC_CONTROL_ASTP;
715 ++
716 ++ writel(value, ioaddr + MAC_CONTROL);
717 +
718 + #ifdef STMMAC_VLAN_TAG_USED
719 + writel(ETH_P_8021Q, ioaddr + MAC_VLAN1);
720 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h
721 +index d74cedf2a3975..db5f2aee360b1 100644
722 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h
723 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h
724 +@@ -336,7 +336,7 @@ enum power_event {
725 + #define MTL_RX_OVERFLOW_INT BIT(16)
726 +
727 + /* Default operating mode of the MAC */
728 +-#define GMAC_CORE_INIT (GMAC_CONFIG_JD | GMAC_CONFIG_PS | GMAC_CONFIG_ACS | \
729 ++#define GMAC_CORE_INIT (GMAC_CONFIG_JD | GMAC_CONFIG_PS | \
730 + GMAC_CONFIG_BE | GMAC_CONFIG_DCRS)
731 +
732 + /* To dump the core regs excluding the Address Registers */
733 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
734 +index e1d03489ae63f..55ae14a6bb8ce 100644
735 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
736 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
737 +@@ -17,13 +17,16 @@
738 + #include <linux/slab.h>
739 + #include <linux/ethtool.h>
740 + #include <linux/io.h>
741 ++#include <net/dsa.h>
742 + #include "stmmac_pcs.h"
743 + #include "dwmac4.h"
744 +
745 +-static void dwmac4_core_init(struct mac_device_info *hw, int mtu)
746 ++static void dwmac4_core_init(struct mac_device_info *hw,
747 ++ struct net_device *dev)
748 + {
749 + void __iomem *ioaddr = hw->pcsr;
750 + u32 value = readl(ioaddr + GMAC_CONFIG);
751 ++ int mtu = dev->mtu;
752 +
753 + value |= GMAC_CORE_INIT;
754 +
755 +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
756 +index a901feaad4e15..0e66a5082140b 100644
757 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
758 ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
759 +@@ -2497,7 +2497,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
760 + }
761 +
762 + /* Initialize the MAC Core */
763 +- priv->hw->mac->core_init(priv->hw, dev->mtu);
764 ++ priv->hw->mac->core_init(priv->hw, dev);
765 +
766 + /* Initialize MTL*/
767 + if (priv->synopsys_id >= DWMAC_CORE_4_00)
768 +@@ -3415,8 +3415,13 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
769 +
770 + /* ACS is set; GMAC core strips PAD/FCS for IEEE 802.3
771 + * Type frames (LLC/LLC-SNAP)
772 ++ *
773 ++ * llc_snap is never checked in GMAC >= 4, so this ACS
774 ++ * feature is always disabled and packets need to be
775 ++ * stripped manually.
776 + */
777 +- if (unlikely(status != llc_snap))
778 ++ if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00) ||
779 ++ unlikely(status != llc_snap))
780 + frame_len -= ETH_FCS_LEN;
781 +
782 + if (netif_msg_rx_status(priv)) {
783 +diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
784 +index 17025d46bdac8..fc1d5e14d83e9 100644
785 +--- a/drivers/net/hyperv/rndis_filter.c
786 ++++ b/drivers/net/hyperv/rndis_filter.c
787 +@@ -711,8 +711,8 @@ cleanup:
788 + return ret;
789 + }
790 +
791 +-int rndis_filter_set_rss_param(struct rndis_device *rdev,
792 +- const u8 *rss_key)
793 ++static int rndis_set_rss_param_msg(struct rndis_device *rdev,
794 ++ const u8 *rss_key, u16 flag)
795 + {
796 + struct net_device *ndev = rdev->ndev;
797 + struct rndis_request *request;
798 +@@ -741,7 +741,7 @@ int rndis_filter_set_rss_param(struct rndis_device *rdev,
799 + rssp->hdr.type = NDIS_OBJECT_TYPE_RSS_PARAMETERS;
800 + rssp->hdr.rev = NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2;
801 + rssp->hdr.size = sizeof(struct ndis_recv_scale_param);
802 +- rssp->flag = 0;
803 ++ rssp->flag = flag;
804 + rssp->hashinfo = NDIS_HASH_FUNC_TOEPLITZ | NDIS_HASH_IPV4 |
805 + NDIS_HASH_TCP_IPV4 | NDIS_HASH_IPV6 |
806 + NDIS_HASH_TCP_IPV6;
807 +@@ -766,9 +766,12 @@ int rndis_filter_set_rss_param(struct rndis_device *rdev,
808 +
809 + wait_for_completion(&request->wait_event);
810 + set_complete = &request->response_msg.msg.set_complete;
811 +- if (set_complete->status == RNDIS_STATUS_SUCCESS)
812 +- memcpy(rdev->rss_key, rss_key, NETVSC_HASH_KEYLEN);
813 +- else {
814 ++ if (set_complete->status == RNDIS_STATUS_SUCCESS) {
815 ++ if (!(flag & NDIS_RSS_PARAM_FLAG_DISABLE_RSS) &&
816 ++ !(flag & NDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED))
817 ++ memcpy(rdev->rss_key, rss_key, NETVSC_HASH_KEYLEN);
818 ++
819 ++ } else {
820 + netdev_err(ndev, "Fail to set RSS parameters:0x%x\n",
821 + set_complete->status);
822 + ret = -EINVAL;
823 +@@ -779,6 +782,16 @@ cleanup:
824 + return ret;
825 + }
826 +
827 ++int rndis_filter_set_rss_param(struct rndis_device *rdev,
828 ++ const u8 *rss_key)
829 ++{
830 ++ /* Disable RSS before change */
831 ++ rndis_set_rss_param_msg(rdev, rss_key,
832 ++ NDIS_RSS_PARAM_FLAG_DISABLE_RSS);
833 ++
834 ++ return rndis_set_rss_param_msg(rdev, rss_key, 0);
835 ++}
836 ++
837 + static int rndis_filter_query_device_link_status(struct rndis_device *dev,
838 + struct netvsc_device *net_device)
839 + {
840 +diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
841 +index b1b3d8f7e67dd..d0c0ac0c3519c 100644
842 +--- a/drivers/net/usb/asix_devices.c
843 ++++ b/drivers/net/usb/asix_devices.c
844 +@@ -731,8 +731,13 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
845 + asix_read_cmd(dev, AX_CMD_STATMNGSTS_REG, 0, 0, 1, &chipcode, 0);
846 + chipcode &= AX_CHIPCODE_MASK;
847 +
848 +- (chipcode == AX_AX88772_CHIPCODE) ? ax88772_hw_reset(dev, 0) :
849 +- ax88772a_hw_reset(dev, 0);
850 ++ ret = (chipcode == AX_AX88772_CHIPCODE) ? ax88772_hw_reset(dev, 0) :
851 ++ ax88772a_hw_reset(dev, 0);
852 ++
853 ++ if (ret < 0) {
854 ++ netdev_dbg(dev->net, "Failed to reset AX88772: %d\n", ret);
855 ++ return ret;
856 ++ }
857 +
858 + /* Read PHYID register *AFTER* the PHY was reset properly */
859 + phyid = asix_get_phyid(dev);
860 +diff --git a/drivers/scsi/csiostor/csio_attr.c b/drivers/scsi/csiostor/csio_attr.c
861 +index 2d1c4ebd40f91..6587f20cff1a1 100644
862 +--- a/drivers/scsi/csiostor/csio_attr.c
863 ++++ b/drivers/scsi/csiostor/csio_attr.c
864 +@@ -582,12 +582,12 @@ csio_vport_create(struct fc_vport *fc_vport, bool disable)
865 + }
866 +
867 + fc_vport_set_state(fc_vport, FC_VPORT_INITIALIZING);
868 ++ ln->fc_vport = fc_vport;
869 +
870 + if (csio_fcoe_alloc_vnp(hw, ln))
871 + goto error;
872 +
873 + *(struct csio_lnode **)fc_vport->dd_data = ln;
874 +- ln->fc_vport = fc_vport;
875 + if (!fc_vport->node_name)
876 + fc_vport->node_name = wwn_to_u64(csio_ln_wwnn(ln));
877 + if (!fc_vport->port_name)
878 +diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
879 +index e2ea389fbec37..56dec663d9f41 100644
880 +--- a/drivers/scsi/libsas/sas_expander.c
881 ++++ b/drivers/scsi/libsas/sas_expander.c
882 +@@ -829,6 +829,7 @@ static struct domain_device *sas_ex_discover_end_dev(
883 + rphy = sas_end_device_alloc(phy->port);
884 + if (!rphy)
885 + goto out_free;
886 ++ rphy->identify.phy_identifier = phy_id;
887 +
888 + child->rphy = rphy;
889 + get_device(&rphy->dev);
890 +@@ -856,6 +857,7 @@ static struct domain_device *sas_ex_discover_end_dev(
891 +
892 + child->rphy = rphy;
893 + get_device(&rphy->dev);
894 ++ rphy->identify.phy_identifier = phy_id;
895 + sas_fill_in_rphy(child, rphy);
896 +
897 + list_add_tail(&child->disco_list_node, &parent->port->disco_list);
898 +diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
899 +index 24cb666c92242..dd96ca61a5152 100644
900 +--- a/drivers/staging/android/ion/ion.c
901 ++++ b/drivers/staging/android/ion/ion.c
902 +@@ -257,10 +257,10 @@ static void ion_dma_buf_detatch(struct dma_buf *dmabuf,
903 + struct ion_dma_buf_attachment *a = attachment->priv;
904 + struct ion_buffer *buffer = dmabuf->priv;
905 +
906 +- free_duped_table(a->table);
907 + mutex_lock(&buffer->lock);
908 + list_del(&a->list);
909 + mutex_unlock(&buffer->lock);
910 ++ free_duped_table(a->table);
911 +
912 + kfree(a);
913 + }
914 +diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h
915 +index 73ce63770c3ce..fa9c80fc77739 100644
916 +--- a/drivers/staging/rtl8723bs/include/ieee80211.h
917 ++++ b/drivers/staging/rtl8723bs/include/ieee80211.h
918 +@@ -1008,18 +1008,18 @@ enum ieee80211_state {
919 + #define IP_FMT "%pI4"
920 + #define IP_ARG(x) (x)
921 +
922 +-extern __inline int is_multicast_mac_addr(const u8 *addr)
923 ++static inline int is_multicast_mac_addr(const u8 *addr)
924 + {
925 + return ((addr[0] != 0xff) && (0x01 & addr[0]));
926 + }
927 +
928 +-extern __inline int is_broadcast_mac_addr(const u8 *addr)
929 ++static inline int is_broadcast_mac_addr(const u8 *addr)
930 + {
931 + return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
932 + (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
933 + }
934 +
935 +-extern __inline int is_zero_mac_addr(const u8 *addr)
936 ++static inline int is_zero_mac_addr(const u8 *addr)
937 + {
938 + return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
939 + (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
940 +diff --git a/drivers/thermal/int340x_thermal/processor_thermal_device.c b/drivers/thermal/int340x_thermal/processor_thermal_device.c
941 +index f02341f7134d4..c344a3783625a 100644
942 +--- a/drivers/thermal/int340x_thermal/processor_thermal_device.c
943 ++++ b/drivers/thermal/int340x_thermal/processor_thermal_device.c
944 +@@ -77,7 +77,12 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \
945 + struct pci_dev *pci_dev; \
946 + struct platform_device *pdev; \
947 + struct proc_thermal_device *proc_dev; \
948 +-\
949 ++ \
950 ++ if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \
951 ++ dev_warn(dev, "Attempted to get power limit before device was initialized!\n"); \
952 ++ return 0; \
953 ++ } \
954 ++ \
955 + if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \
956 + pdev = to_platform_device(dev); \
957 + proc_dev = platform_get_drvdata(pdev); \
958 +@@ -291,11 +296,6 @@ static int proc_thermal_add(struct device *dev,
959 + *priv = proc_priv;
960 +
961 + ret = proc_thermal_read_ppcc(proc_priv);
962 +- if (!ret) {
963 +- ret = sysfs_create_group(&dev->kobj,
964 +- &power_limit_attribute_group);
965 +-
966 +- }
967 + if (ret)
968 + return ret;
969 +
970 +@@ -309,8 +309,7 @@ static int proc_thermal_add(struct device *dev,
971 +
972 + proc_priv->int340x_zone = int340x_thermal_zone_add(adev, ops);
973 + if (IS_ERR(proc_priv->int340x_zone)) {
974 +- ret = PTR_ERR(proc_priv->int340x_zone);
975 +- goto remove_group;
976 ++ return PTR_ERR(proc_priv->int340x_zone);
977 + } else
978 + ret = 0;
979 +
980 +@@ -324,9 +323,6 @@ static int proc_thermal_add(struct device *dev,
981 +
982 + remove_zone:
983 + int340x_thermal_zone_remove(proc_priv->int340x_zone);
984 +-remove_group:
985 +- sysfs_remove_group(&proc_priv->dev->kobj,
986 +- &power_limit_attribute_group);
987 +
988 + return ret;
989 + }
990 +@@ -357,7 +353,10 @@ static int int3401_add(struct platform_device *pdev)
991 + platform_set_drvdata(pdev, proc_priv);
992 + proc_thermal_emum_mode = PROC_THERMAL_PLATFORM_DEV;
993 +
994 +- return 0;
995 ++ dev_info(&pdev->dev, "Creating sysfs group for PROC_THERMAL_PLATFORM_DEV\n");
996 ++
997 ++ return sysfs_create_group(&pdev->dev.kobj,
998 ++ &power_limit_attribute_group);
999 + }
1000 +
1001 + static int int3401_remove(struct platform_device *pdev)
1002 +@@ -416,7 +415,7 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev,
1003 + proc_priv->soc_dts = intel_soc_dts_iosf_init(
1004 + INTEL_SOC_DTS_INTERRUPT_MSI, 2, 0);
1005 +
1006 +- if (proc_priv->soc_dts && pdev->irq) {
1007 ++ if (!IS_ERR(proc_priv->soc_dts) && pdev->irq) {
1008 + ret = pci_enable_msi(pdev);
1009 + if (!ret) {
1010 + ret = request_threaded_irq(pdev->irq, NULL,
1011 +@@ -434,7 +433,10 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev,
1012 + dev_err(&pdev->dev, "No auxiliary DTSs enabled\n");
1013 + }
1014 +
1015 +- return 0;
1016 ++ dev_info(&pdev->dev, "Creating sysfs group for PROC_THERMAL_PCI\n");
1017 ++
1018 ++ return sysfs_create_group(&pdev->dev.kobj,
1019 ++ &power_limit_attribute_group);
1020 + }
1021 +
1022 + static void proc_thermal_pci_remove(struct pci_dev *pdev)
1023 +diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
1024 +index 716c33b2a11cb..32a473f9d1d38 100644
1025 +--- a/drivers/tty/serial/fsl_lpuart.c
1026 ++++ b/drivers/tty/serial/fsl_lpuart.c
1027 +@@ -1701,7 +1701,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
1028 + }
1029 +
1030 + /* ask the core to calculate the divisor */
1031 +- baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 16);
1032 ++ baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 4);
1033 +
1034 + spin_lock_irqsave(&sport->port.lock, flags);
1035 +
1036 +diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
1037 +index 2f96d2d0addd1..32dd0d3462da1 100644
1038 +--- a/drivers/usb/dwc3/gadget.c
1039 ++++ b/drivers/usb/dwc3/gadget.c
1040 +@@ -1910,6 +1910,7 @@ static int __dwc3_gadget_start(struct dwc3 *dwc)
1041 +
1042 + /* begin to receive SETUP packets */
1043 + dwc->ep0state = EP0_SETUP_PHASE;
1044 ++ dwc->link_state = DWC3_LINK_STATE_SS_DIS;
1045 + dwc3_ep0_out_start(dwc);
1046 +
1047 + dwc3_gadget_enable_irq(dwc);
1048 +@@ -3327,6 +3328,8 @@ int dwc3_gadget_suspend(struct dwc3 *dwc)
1049 + dwc3_disconnect_gadget(dwc);
1050 + __dwc3_gadget_stop(dwc);
1051 +
1052 ++ synchronize_irq(dwc->irq_gadget);
1053 ++
1054 + return 0;
1055 + }
1056 +
1057 +diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c
1058 +index 8784fa12ea2c6..6e9d958004a0d 100644
1059 +--- a/drivers/usb/gadget/function/f_sourcesink.c
1060 ++++ b/drivers/usb/gadget/function/f_sourcesink.c
1061 +@@ -842,7 +842,7 @@ static struct usb_function *source_sink_alloc_func(
1062 +
1063 + ss = kzalloc(sizeof(*ss), GFP_KERNEL);
1064 + if (!ss)
1065 +- return NULL;
1066 ++ return ERR_PTR(-ENOMEM);
1067 +
1068 + ss_opts = container_of(fi, struct f_ss_opts, func_inst);
1069 +
1070 +diff --git a/fs/direct-io.c b/fs/direct-io.c
1071 +index 40567501015f2..2c90d541f5275 100644
1072 +--- a/fs/direct-io.c
1073 ++++ b/fs/direct-io.c
1074 +@@ -658,6 +658,7 @@ static int get_more_blocks(struct dio *dio, struct dio_submit *sdio,
1075 + unsigned long fs_count; /* Number of filesystem-sized blocks */
1076 + int create;
1077 + unsigned int i_blkbits = sdio->blkbits + sdio->blkfactor;
1078 ++ loff_t i_size;
1079 +
1080 + /*
1081 + * If there was a memory error and we've overwritten all the
1082 +@@ -687,8 +688,8 @@ static int get_more_blocks(struct dio *dio, struct dio_submit *sdio,
1083 + */
1084 + create = dio->op == REQ_OP_WRITE;
1085 + if (dio->flags & DIO_SKIP_HOLES) {
1086 +- if (fs_startblk <= ((i_size_read(dio->inode) - 1) >>
1087 +- i_blkbits))
1088 ++ i_size = i_size_read(dio->inode);
1089 ++ if (i_size && fs_startblk <= (i_size - 1) >> i_blkbits)
1090 + create = 0;
1091 + }
1092 +
1093 +diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
1094 +index 3244932f4d5cc..6a76616c9401b 100644
1095 +--- a/fs/fs-writeback.c
1096 ++++ b/fs/fs-writeback.c
1097 +@@ -331,11 +331,22 @@ struct inode_switch_wbs_context {
1098 + struct work_struct work;
1099 + };
1100 +
1101 ++static void bdi_down_write_wb_switch_rwsem(struct backing_dev_info *bdi)
1102 ++{
1103 ++ down_write(&bdi->wb_switch_rwsem);
1104 ++}
1105 ++
1106 ++static void bdi_up_write_wb_switch_rwsem(struct backing_dev_info *bdi)
1107 ++{
1108 ++ up_write(&bdi->wb_switch_rwsem);
1109 ++}
1110 ++
1111 + static void inode_switch_wbs_work_fn(struct work_struct *work)
1112 + {
1113 + struct inode_switch_wbs_context *isw =
1114 + container_of(work, struct inode_switch_wbs_context, work);
1115 + struct inode *inode = isw->inode;
1116 ++ struct backing_dev_info *bdi = inode_to_bdi(inode);
1117 + struct address_space *mapping = inode->i_mapping;
1118 + struct bdi_writeback *old_wb = inode->i_wb;
1119 + struct bdi_writeback *new_wb = isw->new_wb;
1120 +@@ -343,6 +354,12 @@ static void inode_switch_wbs_work_fn(struct work_struct *work)
1121 + bool switched = false;
1122 + void **slot;
1123 +
1124 ++ /*
1125 ++ * If @inode switches cgwb membership while sync_inodes_sb() is
1126 ++ * being issued, sync_inodes_sb() might miss it. Synchronize.
1127 ++ */
1128 ++ down_read(&bdi->wb_switch_rwsem);
1129 ++
1130 + /*
1131 + * By the time control reaches here, RCU grace period has passed
1132 + * since I_WB_SWITCH assertion and all wb stat update transactions
1133 +@@ -435,6 +452,8 @@ skip_switch:
1134 + spin_unlock(&new_wb->list_lock);
1135 + spin_unlock(&old_wb->list_lock);
1136 +
1137 ++ up_read(&bdi->wb_switch_rwsem);
1138 ++
1139 + if (switched) {
1140 + wb_wakeup(new_wb);
1141 + wb_put(old_wb);
1142 +@@ -475,9 +494,18 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)
1143 + if (inode->i_state & I_WB_SWITCH)
1144 + return;
1145 +
1146 ++ /*
1147 ++ * Avoid starting new switches while sync_inodes_sb() is in
1148 ++ * progress. Otherwise, if the down_write protected issue path
1149 ++ * blocks heavily, we might end up starting a large number of
1150 ++ * switches which will block on the rwsem.
1151 ++ */
1152 ++ if (!down_read_trylock(&bdi->wb_switch_rwsem))
1153 ++ return;
1154 ++
1155 + isw = kzalloc(sizeof(*isw), GFP_ATOMIC);
1156 + if (!isw)
1157 +- return;
1158 ++ goto out_unlock;
1159 +
1160 + /* find and pin the new wb */
1161 + rcu_read_lock();
1162 +@@ -511,12 +539,14 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)
1163 + * Let's continue after I_WB_SWITCH is guaranteed to be visible.
1164 + */
1165 + call_rcu(&isw->rcu_head, inode_switch_wbs_rcu_fn);
1166 +- return;
1167 ++ goto out_unlock;
1168 +
1169 + out_free:
1170 + if (isw->new_wb)
1171 + wb_put(isw->new_wb);
1172 + kfree(isw);
1173 ++out_unlock:
1174 ++ up_read(&bdi->wb_switch_rwsem);
1175 + }
1176 +
1177 + /**
1178 +@@ -894,6 +924,9 @@ fs_initcall(cgroup_writeback_init);
1179 +
1180 + #else /* CONFIG_CGROUP_WRITEBACK */
1181 +
1182 ++static void bdi_down_write_wb_switch_rwsem(struct backing_dev_info *bdi) { }
1183 ++static void bdi_up_write_wb_switch_rwsem(struct backing_dev_info *bdi) { }
1184 ++
1185 + static struct bdi_writeback *
1186 + locked_inode_to_wb_and_lock_list(struct inode *inode)
1187 + __releases(&inode->i_lock)
1188 +@@ -2408,8 +2441,11 @@ void sync_inodes_sb(struct super_block *sb)
1189 + return;
1190 + WARN_ON(!rwsem_is_locked(&sb->s_umount));
1191 +
1192 ++ /* protect against inode wb switch, see inode_switch_wbs_work_fn() */
1193 ++ bdi_down_write_wb_switch_rwsem(bdi);
1194 + bdi_split_work_to_wbs(bdi, &work, false);
1195 + wb_wait_for_completion(bdi, &done);
1196 ++ bdi_up_write_wb_switch_rwsem(bdi);
1197 +
1198 + wait_sb_inodes(sb);
1199 + }
1200 +diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
1201 +index 19240379637fe..b186c4b464e02 100644
1202 +--- a/include/linux/backing-dev-defs.h
1203 ++++ b/include/linux/backing-dev-defs.h
1204 +@@ -165,6 +165,7 @@ struct backing_dev_info {
1205 + struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */
1206 + struct rb_root cgwb_congested_tree; /* their congested states */
1207 + struct mutex cgwb_release_mutex; /* protect shutdown of wb structs */
1208 ++ struct rw_semaphore wb_switch_rwsem; /* no cgwb switch while syncing */
1209 + #else
1210 + struct bdi_writeback_congested *wb_congested;
1211 + #endif
1212 +diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h
1213 +index 3355efc897816..4125f60ee53b0 100644
1214 +--- a/include/linux/if_arp.h
1215 ++++ b/include/linux/if_arp.h
1216 +@@ -54,6 +54,7 @@ static inline bool dev_is_mac_header_xmit(const struct net_device *dev)
1217 + case ARPHRD_IPGRE:
1218 + case ARPHRD_VOID:
1219 + case ARPHRD_NONE:
1220 ++ case ARPHRD_RAWIP:
1221 + return false;
1222 + default:
1223 + return true;
1224 +diff --git a/kernel/exit.c b/kernel/exit.c
1225 +index 3aa01b74c1e36..5523fb0c20c8c 100644
1226 +--- a/kernel/exit.c
1227 ++++ b/kernel/exit.c
1228 +@@ -306,7 +306,7 @@ void rcuwait_wake_up(struct rcuwait *w)
1229 + * MB (A) MB (B)
1230 + * [L] cond [L] tsk
1231 + */
1232 +- smp_rmb(); /* (B) */
1233 ++ smp_mb(); /* (B) */
1234 +
1235 + /*
1236 + * Avoid using task_rcu_dereference() magic as long as we are careful,
1237 +diff --git a/kernel/futex.c b/kernel/futex.c
1238 +index 29d708d0b3d19..22f83064abb35 100644
1239 +--- a/kernel/futex.c
1240 ++++ b/kernel/futex.c
1241 +@@ -1462,11 +1462,7 @@ static void mark_wake_futex(struct wake_q_head *wake_q, struct futex_q *q)
1242 + if (WARN(q->pi_state || q->rt_waiter, "refusing to wake PI futex\n"))
1243 + return;
1244 +
1245 +- /*
1246 +- * Queue the task for later wakeup for after we've released
1247 +- * the hb->lock. wake_q_add() grabs reference to p.
1248 +- */
1249 +- wake_q_add(wake_q, p);
1250 ++ get_task_struct(p);
1251 + __unqueue_futex(q);
1252 + /*
1253 + * The waiting task can free the futex_q as soon as q->lock_ptr = NULL
1254 +@@ -1476,6 +1472,13 @@ static void mark_wake_futex(struct wake_q_head *wake_q, struct futex_q *q)
1255 + * plist_del in __unqueue_futex().
1256 + */
1257 + smp_store_release(&q->lock_ptr, NULL);
1258 ++
1259 ++ /*
1260 ++ * Queue the task for later wakeup for after we've released
1261 ++ * the hb->lock. wake_q_add() grabs reference to p.
1262 ++ */
1263 ++ wake_q_add(wake_q, p);
1264 ++ put_task_struct(p);
1265 + }
1266 +
1267 + /*
1268 +diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
1269 +index 4cd85870f00e6..6c877d28838f2 100644
1270 +--- a/kernel/irq/manage.c
1271 ++++ b/kernel/irq/manage.c
1272 +@@ -360,6 +360,9 @@ int irq_setup_affinity(struct irq_desc *desc)
1273 + }
1274 +
1275 + cpumask_and(&mask, cpu_online_mask, set);
1276 ++ if (cpumask_empty(&mask))
1277 ++ cpumask_copy(&mask, cpu_online_mask);
1278 ++
1279 + if (node != NUMA_NO_NODE) {
1280 + const struct cpumask *nodemask = cpumask_of_node(node);
1281 +
1282 +diff --git a/kernel/locking/rwsem-xadd.c b/kernel/locking/rwsem-xadd.c
1283 +index a903367793758..c75017326c37a 100644
1284 +--- a/kernel/locking/rwsem-xadd.c
1285 ++++ b/kernel/locking/rwsem-xadd.c
1286 +@@ -198,15 +198,22 @@ static void __rwsem_mark_wake(struct rw_semaphore *sem,
1287 + woken++;
1288 + tsk = waiter->task;
1289 +
1290 +- wake_q_add(wake_q, tsk);
1291 ++ get_task_struct(tsk);
1292 + list_del(&waiter->list);
1293 + /*
1294 +- * Ensure that the last operation is setting the reader
1295 ++ * Ensure calling get_task_struct() before setting the reader
1296 + * waiter to nil such that rwsem_down_read_failed() cannot
1297 + * race with do_exit() by always holding a reference count
1298 + * to the task to wakeup.
1299 + */
1300 + smp_store_release(&waiter->task, NULL);
1301 ++ /*
1302 ++ * Ensure issuing the wakeup (either by us or someone else)
1303 ++ * after setting the reader waiter to nil.
1304 ++ */
1305 ++ wake_q_add(wake_q, tsk);
1306 ++ /* wake_q_add() already take the task ref */
1307 ++ put_task_struct(tsk);
1308 + }
1309 +
1310 + adjustment = woken * RWSEM_ACTIVE_READ_BIAS - adjustment;
1311 +diff --git a/mm/backing-dev.c b/mm/backing-dev.c
1312 +index 9386c98dac123..6fa31754eadd9 100644
1313 +--- a/mm/backing-dev.c
1314 ++++ b/mm/backing-dev.c
1315 +@@ -684,6 +684,7 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi)
1316 + INIT_RADIX_TREE(&bdi->cgwb_tree, GFP_ATOMIC);
1317 + bdi->cgwb_congested_tree = RB_ROOT;
1318 + mutex_init(&bdi->cgwb_release_mutex);
1319 ++ init_rwsem(&bdi->wb_switch_rwsem);
1320 +
1321 + ret = wb_init(&bdi->wb, bdi, 1, GFP_KERNEL);
1322 + if (!ret) {
1323 +diff --git a/mm/mmap.c b/mm/mmap.c
1324 +index 2398776195d2b..00dab291e61df 100644
1325 +--- a/mm/mmap.c
1326 ++++ b/mm/mmap.c
1327 +@@ -2348,12 +2348,11 @@ int expand_downwards(struct vm_area_struct *vma,
1328 + {
1329 + struct mm_struct *mm = vma->vm_mm;
1330 + struct vm_area_struct *prev;
1331 +- int error;
1332 ++ int error = 0;
1333 +
1334 + address &= PAGE_MASK;
1335 +- error = security_mmap_addr(address);
1336 +- if (error)
1337 +- return error;
1338 ++ if (address < mmap_min_addr)
1339 ++ return -EPERM;
1340 +
1341 + /* Enforce stack_guard_gap */
1342 + prev = vma->vm_prev;
1343 +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
1344 +index ebc8045ddee68..150dd2160cefb 100644
1345 +--- a/net/mac80211/cfg.c
1346 ++++ b/net/mac80211/cfg.c
1347 +@@ -1466,6 +1466,10 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
1348 + if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))
1349 + sta->sta.tdls = true;
1350 +
1351 ++ if (sta->sta.tdls && sdata->vif.type == NL80211_IFTYPE_STATION &&
1352 ++ !sdata->u.mgd.associated)
1353 ++ return -EINVAL;
1354 ++
1355 + err = sta_apply_parameters(local, sta, params);
1356 + if (err) {
1357 + sta_info_free(local, sta);
1358 +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
1359 +index c7ac1a480b1dd..1512e547a5e05 100644
1360 +--- a/net/mac80211/rx.c
1361 ++++ b/net/mac80211/rx.c
1362 +@@ -206,7 +206,7 @@ static void ieee80211_handle_mu_mimo_mon(struct ieee80211_sub_if_data *sdata,
1363 + struct ieee80211_hdr_3addr hdr;
1364 + u8 category;
1365 + u8 action_code;
1366 +- } __packed action;
1367 ++ } __packed __aligned(2) action;
1368 +
1369 + if (!sdata)
1370 + return;
1371 +@@ -2533,7 +2533,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
1372 + skb_set_queue_mapping(skb, q);
1373 +
1374 + if (!--mesh_hdr->ttl) {
1375 +- IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
1376 ++ if (!is_multicast_ether_addr(hdr->addr1))
1377 ++ IEEE80211_IFSTA_MESH_CTR_INC(ifmsh,
1378 ++ dropped_frames_ttl);
1379 + goto out;
1380 + }
1381 +
1382 +diff --git a/net/wireless/reg.c b/net/wireless/reg.c
1383 +index bd91de4160353..ebfbc3f1be428 100644
1384 +--- a/net/wireless/reg.c
1385 ++++ b/net/wireless/reg.c
1386 +@@ -759,7 +759,7 @@ static bool is_valid_rd(const struct ieee80211_regdomain *rd)
1387 + * definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"),
1388 + * however it is safe for now to assume that a frequency rule should not be
1389 + * part of a frequency's band if the start freq or end freq are off by more
1390 +- * than 2 GHz for the 2.4 and 5 GHz bands, and by more than 10 GHz for the
1391 ++ * than 2 GHz for the 2.4 and 5 GHz bands, and by more than 20 GHz for the
1392 + * 60 GHz band.
1393 + * This resolution can be lowered and should be considered as we add
1394 + * regulatory rule support for other "bands".
1395 +@@ -774,7 +774,7 @@ static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range,
1396 + * with the Channel starting frequency above 45 GHz.
1397 + */
1398 + u32 limit = freq_khz > 45 * ONE_GHZ_IN_KHZ ?
1399 +- 10 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ;
1400 ++ 20 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ;
1401 + if (abs(freq_khz - freq_range->start_freq_khz) <= limit)
1402 + return true;
1403 + if (abs(freq_khz - freq_range->end_freq_khz) <= limit)
1404 +diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
1405 +index 4490a699030b1..555df64d46ffc 100644
1406 +--- a/sound/core/compress_offload.c
1407 ++++ b/sound/core/compress_offload.c
1408 +@@ -529,7 +529,8 @@ static int snd_compress_check_input(struct snd_compr_params *params)
1409 + {
1410 + /* first let's check the buffer parameter's */
1411 + if (params->buffer.fragment_size == 0 ||
1412 +- params->buffer.fragments > INT_MAX / params->buffer.fragment_size)
1413 ++ params->buffer.fragments > INT_MAX / params->buffer.fragment_size ||
1414 ++ params->buffer.fragments == 0)
1415 + return -EINVAL;
1416 +
1417 + /* now codec parameters */
1418 +diff --git a/sound/soc/codecs/rt274.c b/sound/soc/codecs/rt274.c
1419 +index 8f92e5c4dd9d7..cd048df762327 100644
1420 +--- a/sound/soc/codecs/rt274.c
1421 ++++ b/sound/soc/codecs/rt274.c
1422 +@@ -1128,8 +1128,11 @@ static int rt274_i2c_probe(struct i2c_client *i2c,
1423 + return ret;
1424 + }
1425 +
1426 +- regmap_read(rt274->regmap,
1427 ++ ret = regmap_read(rt274->regmap,
1428 + RT274_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &val);
1429 ++ if (ret)
1430 ++ return ret;
1431 ++
1432 + if (val != RT274_VENDOR_ID) {
1433 + dev_err(&i2c->dev,
1434 + "Device with ID register %#x is not rt274\n", val);
1435 +diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
1436 +index 392d5eef356d3..99e07b01a2ce9 100644
1437 +--- a/sound/soc/fsl/imx-audmux.c
1438 ++++ b/sound/soc/fsl/imx-audmux.c
1439 +@@ -86,49 +86,49 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
1440 + if (!buf)
1441 + return -ENOMEM;
1442 +
1443 +- ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n",
1444 ++ ret = scnprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n",
1445 + pdcr, ptcr);
1446 +
1447 + if (ptcr & IMX_AUDMUX_V2_PTCR_TFSDIR)
1448 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1449 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1450 + "TxFS output from %s, ",
1451 + audmux_port_string((ptcr >> 27) & 0x7));
1452 + else
1453 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1454 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1455 + "TxFS input, ");
1456 +
1457 + if (ptcr & IMX_AUDMUX_V2_PTCR_TCLKDIR)
1458 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1459 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1460 + "TxClk output from %s",
1461 + audmux_port_string((ptcr >> 22) & 0x7));
1462 + else
1463 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1464 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1465 + "TxClk input");
1466 +
1467 +- ret += snprintf(buf + ret, PAGE_SIZE - ret, "\n");
1468 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret, "\n");
1469 +
1470 + if (ptcr & IMX_AUDMUX_V2_PTCR_SYN) {
1471 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1472 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1473 + "Port is symmetric");
1474 + } else {
1475 + if (ptcr & IMX_AUDMUX_V2_PTCR_RFSDIR)
1476 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1477 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1478 + "RxFS output from %s, ",
1479 + audmux_port_string((ptcr >> 17) & 0x7));
1480 + else
1481 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1482 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1483 + "RxFS input, ");
1484 +
1485 + if (ptcr & IMX_AUDMUX_V2_PTCR_RCLKDIR)
1486 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1487 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1488 + "RxClk output from %s",
1489 + audmux_port_string((ptcr >> 12) & 0x7));
1490 + else
1491 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1492 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1493 + "RxClk input");
1494 + }
1495 +
1496 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1497 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1498 + "\nData received from %s\n",
1499 + audmux_port_string((pdcr >> 13) & 0x7));
1500 +
1501 +diff --git a/sound/soc/intel/boards/broadwell.c b/sound/soc/intel/boards/broadwell.c
1502 +index 6dcbbcefc25b4..88c26ab7b0273 100644
1503 +--- a/sound/soc/intel/boards/broadwell.c
1504 ++++ b/sound/soc/intel/boards/broadwell.c
1505 +@@ -191,7 +191,7 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = {
1506 + .stream_name = "Loopback",
1507 + .cpu_dai_name = "Loopback Pin",
1508 + .platform_name = "haswell-pcm-audio",
1509 +- .dynamic = 0,
1510 ++ .dynamic = 1,
1511 + .codec_name = "snd-soc-dummy",
1512 + .codec_dai_name = "snd-soc-dummy-dai",
1513 + .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
1514 +diff --git a/sound/soc/intel/boards/haswell.c b/sound/soc/intel/boards/haswell.c
1515 +index 5e1ea0371c909..8158409921e02 100644
1516 +--- a/sound/soc/intel/boards/haswell.c
1517 ++++ b/sound/soc/intel/boards/haswell.c
1518 +@@ -145,7 +145,7 @@ static struct snd_soc_dai_link haswell_rt5640_dais[] = {
1519 + .stream_name = "Loopback",
1520 + .cpu_dai_name = "Loopback Pin",
1521 + .platform_name = "haswell-pcm-audio",
1522 +- .dynamic = 0,
1523 ++ .dynamic = 1,
1524 + .codec_name = "snd-soc-dummy",
1525 + .codec_dai_name = "snd-soc-dummy-dai",
1526 + .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
1527 +diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
1528 +index 53c9d75256393..bba6a917cd02d 100644
1529 +--- a/sound/soc/soc-dapm.c
1530 ++++ b/sound/soc/soc-dapm.c
1531 +@@ -2009,19 +2009,19 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
1532 + out = is_connected_output_ep(w, NULL, NULL);
1533 + }
1534 +
1535 +- ret = snprintf(buf, PAGE_SIZE, "%s: %s%s in %d out %d",
1536 ++ ret = scnprintf(buf, PAGE_SIZE, "%s: %s%s in %d out %d",
1537 + w->name, w->power ? "On" : "Off",
1538 + w->force ? " (forced)" : "", in, out);
1539 +
1540 + if (w->reg >= 0)
1541 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1542 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1543 + " - R%d(0x%x) mask 0x%x",
1544 + w->reg, w->reg, w->mask << w->shift);
1545 +
1546 +- ret += snprintf(buf + ret, PAGE_SIZE - ret, "\n");
1547 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret, "\n");
1548 +
1549 + if (w->sname)
1550 +- ret += snprintf(buf + ret, PAGE_SIZE - ret, " stream %s %s\n",
1551 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret, " stream %s %s\n",
1552 + w->sname,
1553 + w->active ? "active" : "inactive");
1554 +
1555 +@@ -2034,7 +2034,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
1556 + if (!p->connect)
1557 + continue;
1558 +
1559 +- ret += snprintf(buf + ret, PAGE_SIZE - ret,
1560 ++ ret += scnprintf(buf + ret, PAGE_SIZE - ret,
1561 + " %s \"%s\" \"%s\"\n",
1562 + (rdir == SND_SOC_DAPM_DIR_IN) ? "in" : "out",
1563 + p->name ? p->name : "static",
1564 +diff --git a/tools/testing/selftests/gpio/gpio-mockup-chardev.c b/tools/testing/selftests/gpio/gpio-mockup-chardev.c
1565 +index 667e916fa7cc1..6ceeeed4eeb98 100644
1566 +--- a/tools/testing/selftests/gpio/gpio-mockup-chardev.c
1567 ++++ b/tools/testing/selftests/gpio/gpio-mockup-chardev.c
1568 +@@ -37,7 +37,7 @@ static int get_debugfs(char **path)
1569 + struct libmnt_table *tb;
1570 + struct libmnt_iter *itr = NULL;
1571 + struct libmnt_fs *fs;
1572 +- int found = 0;
1573 ++ int found = 0, ret;
1574 +
1575 + cxt = mnt_new_context();
1576 + if (!cxt)
1577 +@@ -58,8 +58,11 @@ static int get_debugfs(char **path)
1578 + break;
1579 + }
1580 + }
1581 +- if (found)
1582 +- asprintf(path, "%s/gpio", mnt_fs_get_target(fs));
1583 ++ if (found) {
1584 ++ ret = asprintf(path, "%s/gpio", mnt_fs_get_target(fs));
1585 ++ if (ret < 0)
1586 ++ err(EXIT_FAILURE, "failed to format string");
1587 ++ }
1588 +
1589 + mnt_free_iter(itr);
1590 + mnt_free_context(cxt);
1591 +diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
1592 +index fce7f4ce06925..1760b3e397306 100644
1593 +--- a/tools/testing/selftests/seccomp/Makefile
1594 ++++ b/tools/testing/selftests/seccomp/Makefile
1595 +@@ -9,7 +9,7 @@ BINARIES := seccomp_bpf seccomp_benchmark
1596 + CFLAGS += -Wl,-no-as-needed -Wall
1597 +
1598 + seccomp_bpf: seccomp_bpf.c ../kselftest_harness.h
1599 +- $(CC) $(CFLAGS) $(LDFLAGS) -lpthread $< -o $@
1600 ++ $(CC) $(CFLAGS) $(LDFLAGS) $< -lpthread -o $@
1601 +
1602 + TEST_PROGS += $(BINARIES)
1603 + EXTRA_CLEAN := $(BINARIES)