Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.4 commit in: /
Date: Wed, 21 Nov 2018 15:02:42
Message-Id: 1542812505.1950ee99461bdc6a46958d93468c0901c1895680.mpagano@gentoo
1 commit: 1950ee99461bdc6a46958d93468c0901c1895680
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 20 12:32:45 2018 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 21 15:01:45 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=1950ee99
7
8 Linux patch 4.4.162
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1161_linux-4.4.162.patch | 2111 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2115 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index d7ad776..98ec483 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -687,6 +687,10 @@ Patch: 1160_linux-4.4.161.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.4.161
23
24 +Patch: 1161_linux-4.4.162.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.4.162
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/1161_linux-4.4.162.patch b/1161_linux-4.4.162.patch
33 new file mode 100644
34 index 0000000..d8efae3
35 --- /dev/null
36 +++ b/1161_linux-4.4.162.patch
37 @@ -0,0 +1,2111 @@
38 +diff --git a/Documentation/devicetree/bindings/net/macb.txt b/Documentation/devicetree/bindings/net/macb.txt
39 +index b5d79761ac97..410c044166e2 100644
40 +--- a/Documentation/devicetree/bindings/net/macb.txt
41 ++++ b/Documentation/devicetree/bindings/net/macb.txt
42 +@@ -8,6 +8,7 @@ Required properties:
43 + Use "cdns,pc302-gem" for Picochip picoXcell pc302 and later devices based on
44 + the Cadence GEM, or the generic form: "cdns,gem".
45 + Use "atmel,sama5d2-gem" for the GEM IP (10/100) available on Atmel sama5d2 SoCs.
46 ++ Use "atmel,sama5d3-macb" for the 10/100Mbit IP available on Atmel sama5d3 SoCs.
47 + Use "atmel,sama5d3-gem" for the Gigabit IP available on Atmel sama5d3 SoCs.
48 + Use "atmel,sama5d4-gem" for the GEM IP (10/100) available on Atmel sama5d4 SoCs.
49 + Use "cdns,zynqmp-gem" for Zynq Ultrascale+ MPSoC.
50 +diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
51 +index 3fd53e193b7f..da515c535e62 100644
52 +--- a/Documentation/kernel-parameters.txt
53 ++++ b/Documentation/kernel-parameters.txt
54 +@@ -961,11 +961,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
55 + See Documentation/x86/intel_mpx.txt for more
56 + information about the feature.
57 +
58 +- eagerfpu= [X86]
59 +- on enable eager fpu restore
60 +- off disable eager fpu restore
61 +- auto selects the default scheme, which automatically
62 +- enables eagerfpu restore for xsaveopt.
63 +
64 + module.async_probe [KNL]
65 + Enable asynchronous probe on this module.
66 +diff --git a/Makefile b/Makefile
67 +index 57e4ff1a8b96..00ff2dd68ff1 100644
68 +--- a/Makefile
69 ++++ b/Makefile
70 +@@ -1,6 +1,6 @@
71 + VERSION = 4
72 + PATCHLEVEL = 4
73 +-SUBLEVEL = 161
74 ++SUBLEVEL = 162
75 + EXTRAVERSION =
76 + NAME = Blurry Fish Butt
77 +
78 +diff --git a/arch/arc/Makefile b/arch/arc/Makefile
79 +index b9f7306412e5..9d64eacdd2aa 100644
80 +--- a/arch/arc/Makefile
81 ++++ b/arch/arc/Makefile
82 +@@ -18,20 +18,6 @@ cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
83 + cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
84 + cflags-$(CONFIG_ISA_ARCV2) += -mcpu=archs
85 +
86 +-is_700 = $(shell $(CC) -dM -E - < /dev/null | grep -q "ARC700" && echo 1 || echo 0)
87 +-
88 +-ifdef CONFIG_ISA_ARCOMPACT
89 +-ifeq ($(is_700), 0)
90 +- $(error Toolchain not configured for ARCompact builds)
91 +-endif
92 +-endif
93 +-
94 +-ifdef CONFIG_ISA_ARCV2
95 +-ifeq ($(is_700), 1)
96 +- $(error Toolchain not configured for ARCv2 builds)
97 +-endif
98 +-endif
99 +-
100 + ifdef CONFIG_ARC_CURR_IN_REG
101 + # For a global register defintion, make sure it gets passed to every file
102 + # We had a customer reported bug where some code built in kernel was NOT using
103 +diff --git a/arch/arm/boot/dts/sama5d3_emac.dtsi b/arch/arm/boot/dts/sama5d3_emac.dtsi
104 +index 7cb235ef0fb6..6e9e1c2f9def 100644
105 +--- a/arch/arm/boot/dts/sama5d3_emac.dtsi
106 ++++ b/arch/arm/boot/dts/sama5d3_emac.dtsi
107 +@@ -41,7 +41,7 @@
108 + };
109 +
110 + macb1: ethernet@f802c000 {
111 +- compatible = "cdns,at91sam9260-macb", "cdns,macb";
112 ++ compatible = "atmel,sama5d3-macb", "cdns,at91sam9260-macb", "cdns,macb";
113 + reg = <0xf802c000 0x100>;
114 + interrupts = <35 IRQ_TYPE_LEVEL_HIGH 3>;
115 + pinctrl-names = "default";
116 +diff --git a/arch/powerpc/kernel/tm.S b/arch/powerpc/kernel/tm.S
117 +index b7019b559ddb..2d2860711e07 100644
118 +--- a/arch/powerpc/kernel/tm.S
119 ++++ b/arch/powerpc/kernel/tm.S
120 +@@ -199,13 +199,27 @@ dont_backup_fp:
121 + std r1, PACATMSCRATCH(r13)
122 + ld r1, PACAR1(r13)
123 +
124 +- /* Store the PPR in r11 and reset to decent value */
125 + std r11, GPR11(r1) /* Temporary stash */
126 +
127 ++ /*
128 ++ * Move the saved user r1 to the kernel stack in case PACATMSCRATCH is
129 ++ * clobbered by an exception once we turn on MSR_RI below.
130 ++ */
131 ++ ld r11, PACATMSCRATCH(r13)
132 ++ std r11, GPR1(r1)
133 ++
134 ++ /*
135 ++ * Store r13 away so we can free up the scratch SPR for the SLB fault
136 ++ * handler (needed once we start accessing the thread_struct).
137 ++ */
138 ++ GET_SCRATCH0(r11)
139 ++ std r11, GPR13(r1)
140 ++
141 + /* Reset MSR RI so we can take SLB faults again */
142 + li r11, MSR_RI
143 + mtmsrd r11, 1
144 +
145 ++ /* Store the PPR in r11 and reset to decent value */
146 + mfspr r11, SPRN_PPR
147 + HMT_MEDIUM
148 +
149 +@@ -230,11 +244,11 @@ dont_backup_fp:
150 + SAVE_GPR(8, r7) /* user r8 */
151 + SAVE_GPR(9, r7) /* user r9 */
152 + SAVE_GPR(10, r7) /* user r10 */
153 +- ld r3, PACATMSCRATCH(r13) /* user r1 */
154 ++ ld r3, GPR1(r1) /* user r1 */
155 + ld r4, GPR7(r1) /* user r7 */
156 + ld r5, GPR11(r1) /* user r11 */
157 + ld r6, GPR12(r1) /* user r12 */
158 +- GET_SCRATCH0(8) /* user r13 */
159 ++ ld r8, GPR13(r1) /* user r13 */
160 + std r3, GPR1(r7)
161 + std r4, GPR7(r7)
162 + std r5, GPR11(r7)
163 +diff --git a/arch/x86/crypto/crc32c-intel_glue.c b/arch/x86/crypto/crc32c-intel_glue.c
164 +index 715399b14ed7..c194d5717ae5 100644
165 +--- a/arch/x86/crypto/crc32c-intel_glue.c
166 ++++ b/arch/x86/crypto/crc32c-intel_glue.c
167 +@@ -48,21 +48,13 @@
168 + #ifdef CONFIG_X86_64
169 + /*
170 + * use carryless multiply version of crc32c when buffer
171 +- * size is >= 512 (when eager fpu is enabled) or
172 +- * >= 1024 (when eager fpu is disabled) to account
173 ++ * size is >= 512 to account
174 + * for fpu state save/restore overhead.
175 + */
176 +-#define CRC32C_PCL_BREAKEVEN_EAGERFPU 512
177 +-#define CRC32C_PCL_BREAKEVEN_NOEAGERFPU 1024
178 ++#define CRC32C_PCL_BREAKEVEN 512
179 +
180 + asmlinkage unsigned int crc_pcl(const u8 *buffer, int len,
181 + unsigned int crc_init);
182 +-static int crc32c_pcl_breakeven = CRC32C_PCL_BREAKEVEN_EAGERFPU;
183 +-#define set_pcl_breakeven_point() \
184 +-do { \
185 +- if (!use_eager_fpu()) \
186 +- crc32c_pcl_breakeven = CRC32C_PCL_BREAKEVEN_NOEAGERFPU; \
187 +-} while (0)
188 + #endif /* CONFIG_X86_64 */
189 +
190 + static u32 crc32c_intel_le_hw_byte(u32 crc, unsigned char const *data, size_t length)
191 +@@ -185,7 +177,7 @@ static int crc32c_pcl_intel_update(struct shash_desc *desc, const u8 *data,
192 + * use faster PCL version if datasize is large enough to
193 + * overcome kernel fpu state save/restore overhead
194 + */
195 +- if (len >= crc32c_pcl_breakeven && irq_fpu_usable()) {
196 ++ if (len >= CRC32C_PCL_BREAKEVEN && irq_fpu_usable()) {
197 + kernel_fpu_begin();
198 + *crcp = crc_pcl(data, len, *crcp);
199 + kernel_fpu_end();
200 +@@ -197,7 +189,7 @@ static int crc32c_pcl_intel_update(struct shash_desc *desc, const u8 *data,
201 + static int __crc32c_pcl_intel_finup(u32 *crcp, const u8 *data, unsigned int len,
202 + u8 *out)
203 + {
204 +- if (len >= crc32c_pcl_breakeven && irq_fpu_usable()) {
205 ++ if (len >= CRC32C_PCL_BREAKEVEN && irq_fpu_usable()) {
206 + kernel_fpu_begin();
207 + *(__le32 *)out = ~cpu_to_le32(crc_pcl(data, len, *crcp));
208 + kernel_fpu_end();
209 +@@ -256,7 +248,6 @@ static int __init crc32c_intel_mod_init(void)
210 + alg.update = crc32c_pcl_intel_update;
211 + alg.finup = crc32c_pcl_intel_finup;
212 + alg.digest = crc32c_pcl_intel_digest;
213 +- set_pcl_breakeven_point();
214 + }
215 + #endif
216 + return crypto_register_shash(&alg);
217 +diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h
218 +index dd2269dcbc47..a5fa3195a230 100644
219 +--- a/arch/x86/include/asm/cpufeatures.h
220 ++++ b/arch/x86/include/asm/cpufeatures.h
221 +@@ -104,7 +104,6 @@
222 + #define X86_FEATURE_EXTD_APICID ( 3*32+26) /* has extended APICID (8 bits) */
223 + #define X86_FEATURE_AMD_DCM ( 3*32+27) /* multi-node processor */
224 + #define X86_FEATURE_APERFMPERF ( 3*32+28) /* APERFMPERF */
225 +-/* free, was #define X86_FEATURE_EAGER_FPU ( 3*32+29) * "eagerfpu" Non lazy FPU restore */
226 + #define X86_FEATURE_NONSTOP_TSC_S3 ( 3*32+30) /* TSC doesn't stop in S3 state */
227 +
228 + /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */
229 +diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h
230 +index ec2aedb6f92a..16825dda18dc 100644
231 +--- a/arch/x86/include/asm/fpu/internal.h
232 ++++ b/arch/x86/include/asm/fpu/internal.h
233 +@@ -57,11 +57,6 @@ extern u64 fpu__get_supported_xfeatures_mask(void);
234 + /*
235 + * FPU related CPU feature flag helper routines:
236 + */
237 +-static __always_inline __pure bool use_eager_fpu(void)
238 +-{
239 +- return true;
240 +-}
241 +-
242 + static __always_inline __pure bool use_xsaveopt(void)
243 + {
244 + return static_cpu_has(X86_FEATURE_XSAVEOPT);
245 +@@ -498,24 +493,6 @@ static inline int fpu_want_lazy_restore(struct fpu *fpu, unsigned int cpu)
246 + }
247 +
248 +
249 +-/*
250 +- * Wrap lazy FPU TS handling in a 'hw fpregs activation/deactivation'
251 +- * idiom, which is then paired with the sw-flag (fpregs_active) later on:
252 +- */
253 +-
254 +-static inline void __fpregs_activate_hw(void)
255 +-{
256 +- if (!use_eager_fpu())
257 +- clts();
258 +-}
259 +-
260 +-static inline void __fpregs_deactivate_hw(void)
261 +-{
262 +- if (!use_eager_fpu())
263 +- stts();
264 +-}
265 +-
266 +-/* Must be paired with an 'stts' (fpregs_deactivate_hw()) after! */
267 + static inline void __fpregs_deactivate(struct fpu *fpu)
268 + {
269 + WARN_ON_FPU(!fpu->fpregs_active);
270 +@@ -524,7 +501,6 @@ static inline void __fpregs_deactivate(struct fpu *fpu)
271 + this_cpu_write(fpu_fpregs_owner_ctx, NULL);
272 + }
273 +
274 +-/* Must be paired with a 'clts' (fpregs_activate_hw()) before! */
275 + static inline void __fpregs_activate(struct fpu *fpu)
276 + {
277 + WARN_ON_FPU(fpu->fpregs_active);
278 +@@ -549,22 +525,17 @@ static inline int fpregs_active(void)
279 + }
280 +
281 + /*
282 +- * Encapsulate the CR0.TS handling together with the
283 +- * software flag.
284 +- *
285 + * These generally need preemption protection to work,
286 + * do try to avoid using these on their own.
287 + */
288 + static inline void fpregs_activate(struct fpu *fpu)
289 + {
290 +- __fpregs_activate_hw();
291 + __fpregs_activate(fpu);
292 + }
293 +
294 + static inline void fpregs_deactivate(struct fpu *fpu)
295 + {
296 + __fpregs_deactivate(fpu);
297 +- __fpregs_deactivate_hw();
298 + }
299 +
300 + /*
301 +@@ -591,8 +562,7 @@ switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu)
302 + * or if the past 5 consecutive context-switches used math.
303 + */
304 + fpu.preload = static_cpu_has(X86_FEATURE_FPU) &&
305 +- new_fpu->fpstate_active &&
306 +- (use_eager_fpu() || new_fpu->counter > 5);
307 ++ new_fpu->fpstate_active;
308 +
309 + if (old_fpu->fpregs_active) {
310 + if (!copy_fpregs_to_fpstate(old_fpu))
311 +@@ -605,17 +575,12 @@ switch_fpu_prepare(struct fpu *old_fpu, struct fpu *new_fpu, int cpu)
312 +
313 + /* Don't change CR0.TS if we just switch! */
314 + if (fpu.preload) {
315 +- new_fpu->counter++;
316 + __fpregs_activate(new_fpu);
317 + prefetch(&new_fpu->state);
318 +- } else {
319 +- __fpregs_deactivate_hw();
320 + }
321 + } else {
322 +- old_fpu->counter = 0;
323 + old_fpu->last_cpu = -1;
324 + if (fpu.preload) {
325 +- new_fpu->counter++;
326 + if (fpu_want_lazy_restore(new_fpu, cpu))
327 + fpu.preload = 0;
328 + else
329 +diff --git a/arch/x86/include/asm/fpu/types.h b/arch/x86/include/asm/fpu/types.h
330 +index 1c6f6ac52ad0..0d81c7d6fe96 100644
331 +--- a/arch/x86/include/asm/fpu/types.h
332 ++++ b/arch/x86/include/asm/fpu/types.h
333 +@@ -302,17 +302,6 @@ struct fpu {
334 + */
335 + unsigned char fpregs_active;
336 +
337 +- /*
338 +- * @counter:
339 +- *
340 +- * This counter contains the number of consecutive context switches
341 +- * during which the FPU stays used. If this is over a threshold, the
342 +- * lazy FPU restore logic becomes eager, to save the trap overhead.
343 +- * This is an unsigned char so that after 256 iterations the counter
344 +- * wraps and the context switch behavior turns lazy again; this is to
345 +- * deal with bursty apps that only use the FPU for a short time:
346 +- */
347 +- unsigned char counter;
348 + /*
349 + * @state:
350 + *
351 +@@ -321,29 +310,6 @@ struct fpu {
352 + * the registers in the FPU are more recent than this state
353 + * copy. If the task context-switches away then they get
354 + * saved here and represent the FPU state.
355 +- *
356 +- * After context switches there may be a (short) time period
357 +- * during which the in-FPU hardware registers are unchanged
358 +- * and still perfectly match this state, if the tasks
359 +- * scheduled afterwards are not using the FPU.
360 +- *
361 +- * This is the 'lazy restore' window of optimization, which
362 +- * we track though 'fpu_fpregs_owner_ctx' and 'fpu->last_cpu'.
363 +- *
364 +- * We detect whether a subsequent task uses the FPU via setting
365 +- * CR0::TS to 1, which causes any FPU use to raise a #NM fault.
366 +- *
367 +- * During this window, if the task gets scheduled again, we
368 +- * might be able to skip having to do a restore from this
369 +- * memory buffer to the hardware registers - at the cost of
370 +- * incurring the overhead of #NM fault traps.
371 +- *
372 +- * Note that on modern CPUs that support the XSAVEOPT (or other
373 +- * optimized XSAVE instructions), we don't use #NM traps anymore,
374 +- * as the hardware can track whether FPU registers need saving
375 +- * or not. On such CPUs we activate the non-lazy ('eagerfpu')
376 +- * logic, which unconditionally saves/restores all FPU state
377 +- * across context switches. (if FPU state exists.)
378 + */
379 + union fpregs_state state;
380 + /*
381 +diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
382 +index 74fda1a453bd..3a37cdbdfbaa 100644
383 +--- a/arch/x86/include/asm/kvm_host.h
384 ++++ b/arch/x86/include/asm/kvm_host.h
385 +@@ -439,7 +439,6 @@ struct kvm_vcpu_arch {
386 + struct kvm_mmu_memory_cache mmu_page_header_cache;
387 +
388 + struct fpu guest_fpu;
389 +- bool eager_fpu;
390 + u64 xcr0;
391 + u64 guest_supported_xcr0;
392 + u32 guest_xstate_size;
393 +diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
394 +index 6aa0b519c851..b322325424bc 100644
395 +--- a/arch/x86/kernel/fpu/core.c
396 ++++ b/arch/x86/kernel/fpu/core.c
397 +@@ -53,27 +53,9 @@ static bool kernel_fpu_disabled(void)
398 + return this_cpu_read(in_kernel_fpu);
399 + }
400 +
401 +-/*
402 +- * Were we in an interrupt that interrupted kernel mode?
403 +- *
404 +- * On others, we can do a kernel_fpu_begin/end() pair *ONLY* if that
405 +- * pair does nothing at all: the thread must not have fpu (so
406 +- * that we don't try to save the FPU state), and TS must
407 +- * be set (so that the clts/stts pair does nothing that is
408 +- * visible in the interrupted kernel thread).
409 +- *
410 +- * Except for the eagerfpu case when we return true; in the likely case
411 +- * the thread has FPU but we are not going to set/clear TS.
412 +- */
413 + static bool interrupted_kernel_fpu_idle(void)
414 + {
415 +- if (kernel_fpu_disabled())
416 +- return false;
417 +-
418 +- if (use_eager_fpu())
419 +- return true;
420 +-
421 +- return !current->thread.fpu.fpregs_active && (read_cr0() & X86_CR0_TS);
422 ++ return !kernel_fpu_disabled();
423 + }
424 +
425 + /*
426 +@@ -121,7 +103,6 @@ void __kernel_fpu_begin(void)
427 + copy_fpregs_to_fpstate(fpu);
428 + } else {
429 + this_cpu_write(fpu_fpregs_owner_ctx, NULL);
430 +- __fpregs_activate_hw();
431 + }
432 + }
433 + EXPORT_SYMBOL(__kernel_fpu_begin);
434 +@@ -132,8 +113,6 @@ void __kernel_fpu_end(void)
435 +
436 + if (fpu->fpregs_active)
437 + copy_kernel_to_fpregs(&fpu->state);
438 +- else
439 +- __fpregs_deactivate_hw();
440 +
441 + kernel_fpu_enable();
442 + }
443 +@@ -194,10 +173,7 @@ void fpu__save(struct fpu *fpu)
444 + preempt_disable();
445 + if (fpu->fpregs_active) {
446 + if (!copy_fpregs_to_fpstate(fpu)) {
447 +- if (use_eager_fpu())
448 +- copy_kernel_to_fpregs(&fpu->state);
449 +- else
450 +- fpregs_deactivate(fpu);
451 ++ copy_kernel_to_fpregs(&fpu->state);
452 + }
453 + }
454 + preempt_enable();
455 +@@ -245,8 +221,7 @@ static void fpu_copy(struct fpu *dst_fpu, struct fpu *src_fpu)
456 + * Don't let 'init optimized' areas of the XSAVE area
457 + * leak into the child task:
458 + */
459 +- if (use_eager_fpu())
460 +- memset(&dst_fpu->state.xsave, 0, xstate_size);
461 ++ memset(&dst_fpu->state.xsave, 0, xstate_size);
462 +
463 + /*
464 + * Save current FPU registers directly into the child
465 +@@ -268,17 +243,13 @@ static void fpu_copy(struct fpu *dst_fpu, struct fpu *src_fpu)
466 + if (!copy_fpregs_to_fpstate(dst_fpu)) {
467 + memcpy(&src_fpu->state, &dst_fpu->state, xstate_size);
468 +
469 +- if (use_eager_fpu())
470 +- copy_kernel_to_fpregs(&src_fpu->state);
471 +- else
472 +- fpregs_deactivate(src_fpu);
473 ++ copy_kernel_to_fpregs(&src_fpu->state);
474 + }
475 + preempt_enable();
476 + }
477 +
478 + int fpu__copy(struct fpu *dst_fpu, struct fpu *src_fpu)
479 + {
480 +- dst_fpu->counter = 0;
481 + dst_fpu->fpregs_active = 0;
482 + dst_fpu->last_cpu = -1;
483 +
484 +@@ -381,7 +352,6 @@ void fpu__restore(struct fpu *fpu)
485 + kernel_fpu_disable();
486 + fpregs_activate(fpu);
487 + copy_kernel_to_fpregs(&fpu->state);
488 +- fpu->counter++;
489 + kernel_fpu_enable();
490 + }
491 + EXPORT_SYMBOL_GPL(fpu__restore);
492 +@@ -398,7 +368,6 @@ EXPORT_SYMBOL_GPL(fpu__restore);
493 + void fpu__drop(struct fpu *fpu)
494 + {
495 + preempt_disable();
496 +- fpu->counter = 0;
497 +
498 + if (fpu->fpregs_active) {
499 + /* Ignore delayed exceptions from user space */
500 +@@ -437,7 +406,7 @@ void fpu__clear(struct fpu *fpu)
501 + {
502 + WARN_ON_FPU(fpu != &current->thread.fpu); /* Almost certainly an anomaly */
503 +
504 +- if (!use_eager_fpu() || !static_cpu_has(X86_FEATURE_FPU)) {
505 ++ if (!static_cpu_has(X86_FEATURE_FPU)) {
506 + /* FPU state will be reallocated lazily at the first use. */
507 + fpu__drop(fpu);
508 + } else {
509 +diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c
510 +index 3de077116218..9be3e79eb629 100644
511 +--- a/arch/x86/kernel/fpu/signal.c
512 ++++ b/arch/x86/kernel/fpu/signal.c
513 +@@ -319,11 +319,9 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
514 + }
515 +
516 + fpu->fpstate_active = 1;
517 +- if (use_eager_fpu()) {
518 +- preempt_disable();
519 +- fpu__restore(fpu);
520 +- preempt_enable();
521 +- }
522 ++ preempt_disable();
523 ++ fpu__restore(fpu);
524 ++ preempt_enable();
525 +
526 + return err;
527 + } else {
528 +diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
529 +index 83d6369c45f5..338d13d4fd2f 100644
530 +--- a/arch/x86/kvm/cpuid.c
531 ++++ b/arch/x86/kvm/cpuid.c
532 +@@ -16,7 +16,6 @@
533 + #include <linux/module.h>
534 + #include <linux/vmalloc.h>
535 + #include <linux/uaccess.h>
536 +-#include <asm/fpu/internal.h> /* For use_eager_fpu. Ugh! */
537 + #include <asm/user.h>
538 + #include <asm/fpu/xstate.h>
539 + #include "cpuid.h"
540 +@@ -104,9 +103,7 @@ int kvm_update_cpuid(struct kvm_vcpu *vcpu)
541 + if (best && (best->eax & (F(XSAVES) | F(XSAVEC))))
542 + best->ebx = xstate_required_size(vcpu->arch.xcr0, true);
543 +
544 +- vcpu->arch.eager_fpu = use_eager_fpu();
545 +- if (vcpu->arch.eager_fpu)
546 +- kvm_x86_ops->fpu_activate(vcpu);
547 ++ kvm_x86_ops->fpu_activate(vcpu);
548 +
549 + /*
550 + * The existing code assumes virtual address is 48-bit in the canonical
551 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
552 +index 53d43d22a84b..e6ab034f0bc7 100644
553 +--- a/arch/x86/kvm/x86.c
554 ++++ b/arch/x86/kvm/x86.c
555 +@@ -7319,16 +7319,6 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
556 + copy_fpregs_to_fpstate(&vcpu->arch.guest_fpu);
557 + __kernel_fpu_end();
558 + ++vcpu->stat.fpu_reload;
559 +- /*
560 +- * If using eager FPU mode, or if the guest is a frequent user
561 +- * of the FPU, just leave the FPU active for next time.
562 +- * Every 255 times fpu_counter rolls over to 0; a guest that uses
563 +- * the FPU in bursts will revert to loading it on demand.
564 +- */
565 +- if (!vcpu->arch.eager_fpu) {
566 +- if (++vcpu->fpu_counter < 5)
567 +- kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
568 +- }
569 + trace_kvm_fpu(0);
570 + }
571 +
572 +diff --git a/drivers/clocksource/timer-ti-32k.c b/drivers/clocksource/timer-ti-32k.c
573 +index 8518d9dfba5c..73c990867c01 100644
574 +--- a/drivers/clocksource/timer-ti-32k.c
575 ++++ b/drivers/clocksource/timer-ti-32k.c
576 +@@ -98,6 +98,9 @@ static void __init ti_32k_timer_init(struct device_node *np)
577 + return;
578 + }
579 +
580 ++ if (!of_machine_is_compatible("ti,am43"))
581 ++ ti_32k_timer.cs.flags |= CLOCK_SOURCE_SUSPEND_NONSTOP;
582 ++
583 + ti_32k_timer.counter = ti_32k_timer.base;
584 +
585 + /*
586 +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
587 +index b233cf8436b0..2e1e84c98034 100644
588 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
589 ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
590 +@@ -504,7 +504,7 @@ static int kgd_hqd_sdma_destroy(struct kgd_dev *kgd, void *mqd,
591 +
592 + while (true) {
593 + temp = RREG32(sdma_base_addr + mmSDMA0_RLC0_CONTEXT_STATUS);
594 +- if (temp & SDMA0_STATUS_REG__RB_CMD_IDLE__SHIFT)
595 ++ if (temp & SDMA0_RLC0_CONTEXT_STATUS__IDLE_MASK)
596 + break;
597 + if (timeout == 0)
598 + return -ETIME;
599 +diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c
600 +index 12dcbd8226f2..2cce48d9e903 100644
601 +--- a/drivers/hv/hv_fcopy.c
602 ++++ b/drivers/hv/hv_fcopy.c
603 +@@ -256,7 +256,6 @@ void hv_fcopy_onchannelcallback(void *context)
604 + */
605 +
606 + fcopy_transaction.recv_len = recvlen;
607 +- fcopy_transaction.recv_channel = channel;
608 + fcopy_transaction.recv_req_id = requestid;
609 + fcopy_transaction.fcopy_msg = fcopy_msg;
610 +
611 +@@ -323,6 +322,7 @@ static void fcopy_on_reset(void)
612 + int hv_fcopy_init(struct hv_util_service *srv)
613 + {
614 + recv_buffer = srv->recv_buffer;
615 ++ fcopy_transaction.recv_channel = srv->channel;
616 +
617 + init_completion(&release_event);
618 + /*
619 +diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c
620 +index ce4d3a935491..1771a968c3f2 100644
621 +--- a/drivers/hv/hv_kvp.c
622 ++++ b/drivers/hv/hv_kvp.c
623 +@@ -78,9 +78,11 @@ static void kvp_send_key(struct work_struct *dummy);
624 +
625 + static void kvp_respond_to_host(struct hv_kvp_msg *msg, int error);
626 + static void kvp_timeout_func(struct work_struct *dummy);
627 ++static void kvp_host_handshake_func(struct work_struct *dummy);
628 + static void kvp_register(int);
629 +
630 + static DECLARE_DELAYED_WORK(kvp_timeout_work, kvp_timeout_func);
631 ++static DECLARE_DELAYED_WORK(kvp_host_handshake_work, kvp_host_handshake_func);
632 + static DECLARE_WORK(kvp_sendkey_work, kvp_send_key);
633 +
634 + static const char kvp_devname[] = "vmbus/hv_kvp";
635 +@@ -131,6 +133,11 @@ static void kvp_timeout_func(struct work_struct *dummy)
636 + hv_poll_channel(kvp_transaction.recv_channel, kvp_poll_wrapper);
637 + }
638 +
639 ++static void kvp_host_handshake_func(struct work_struct *dummy)
640 ++{
641 ++ hv_poll_channel(kvp_transaction.recv_channel, hv_kvp_onchannelcallback);
642 ++}
643 ++
644 + static int kvp_handle_handshake(struct hv_kvp_msg *msg)
645 + {
646 + switch (msg->kvp_hdr.operation) {
647 +@@ -155,7 +162,13 @@ static int kvp_handle_handshake(struct hv_kvp_msg *msg)
648 + pr_debug("KVP: userspace daemon ver. %d registered\n",
649 + KVP_OP_REGISTER);
650 + kvp_register(dm_reg_value);
651 +- kvp_transaction.state = HVUTIL_READY;
652 ++
653 ++ /*
654 ++ * If we're still negotiating with the host cancel the timeout
655 ++ * work to not poll the channel twice.
656 ++ */
657 ++ cancel_delayed_work_sync(&kvp_host_handshake_work);
658 ++ hv_poll_channel(kvp_transaction.recv_channel, kvp_poll_wrapper);
659 +
660 + return 0;
661 + }
662 +@@ -595,10 +608,26 @@ void hv_kvp_onchannelcallback(void *context)
663 + struct icmsg_negotiate *negop = NULL;
664 + int util_fw_version;
665 + int kvp_srv_version;
666 ++ static enum {NEGO_NOT_STARTED,
667 ++ NEGO_IN_PROGRESS,
668 ++ NEGO_FINISHED} host_negotiatied = NEGO_NOT_STARTED;
669 +
670 ++ if (kvp_transaction.state < HVUTIL_READY) {
671 ++ /*
672 ++ * If userspace daemon is not connected and host is asking
673 ++ * us to negotiate we need to delay to not lose messages.
674 ++ * This is important for Failover IP setting.
675 ++ */
676 ++ if (host_negotiatied == NEGO_NOT_STARTED) {
677 ++ host_negotiatied = NEGO_IN_PROGRESS;
678 ++ schedule_delayed_work(&kvp_host_handshake_work,
679 ++ HV_UTIL_NEGO_TIMEOUT * HZ);
680 ++ }
681 ++ return;
682 ++ }
683 + if (kvp_transaction.state > HVUTIL_READY)
684 + return;
685 +-
686 ++recheck:
687 + vmbus_recvpacket(channel, recv_buffer, PAGE_SIZE * 4, &recvlen,
688 + &requestid);
689 +
690 +@@ -640,7 +669,6 @@ void hv_kvp_onchannelcallback(void *context)
691 + */
692 +
693 + kvp_transaction.recv_len = recvlen;
694 +- kvp_transaction.recv_channel = channel;
695 + kvp_transaction.recv_req_id = requestid;
696 + kvp_transaction.kvp_msg = kvp_msg;
697 +
698 +@@ -674,6 +702,10 @@ void hv_kvp_onchannelcallback(void *context)
699 + vmbus_sendpacket(channel, recv_buffer,
700 + recvlen, requestid,
701 + VM_PKT_DATA_INBAND, 0);
702 ++
703 ++ host_negotiatied = NEGO_FINISHED;
704 ++
705 ++ goto recheck;
706 + }
707 +
708 + }
709 +@@ -690,6 +722,7 @@ int
710 + hv_kvp_init(struct hv_util_service *srv)
711 + {
712 + recv_buffer = srv->recv_buffer;
713 ++ kvp_transaction.recv_channel = srv->channel;
714 +
715 + init_completion(&release_event);
716 + /*
717 +@@ -711,6 +744,7 @@ hv_kvp_init(struct hv_util_service *srv)
718 + void hv_kvp_deinit(void)
719 + {
720 + kvp_transaction.state = HVUTIL_DEVICE_DYING;
721 ++ cancel_delayed_work_sync(&kvp_host_handshake_work);
722 + cancel_delayed_work_sync(&kvp_timeout_work);
723 + cancel_work_sync(&kvp_sendkey_work);
724 + hvutil_transport_destroy(hvt);
725 +diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c
726 +index faad79ae318a..b0feddb17170 100644
727 +--- a/drivers/hv/hv_snapshot.c
728 ++++ b/drivers/hv/hv_snapshot.c
729 +@@ -114,7 +114,7 @@ static int vss_handle_handshake(struct hv_vss_msg *vss_msg)
730 + default:
731 + return -EINVAL;
732 + }
733 +- vss_transaction.state = HVUTIL_READY;
734 ++ hv_poll_channel(vss_transaction.recv_channel, vss_poll_wrapper);
735 + pr_debug("VSS: userspace daemon ver. %d registered\n", dm_reg_value);
736 + return 0;
737 + }
738 +@@ -264,7 +264,6 @@ void hv_vss_onchannelcallback(void *context)
739 + */
740 +
741 + vss_transaction.recv_len = recvlen;
742 +- vss_transaction.recv_channel = channel;
743 + vss_transaction.recv_req_id = requestid;
744 + vss_transaction.msg = (struct hv_vss_msg *)vss_msg;
745 +
746 +@@ -340,6 +339,7 @@ hv_vss_init(struct hv_util_service *srv)
747 + return -ENOTSUPP;
748 + }
749 + recv_buffer = srv->recv_buffer;
750 ++ vss_transaction.recv_channel = srv->channel;
751 +
752 + /*
753 + * When this driver loads, the user level daemon that
754 +diff --git a/drivers/hv/hv_util.c b/drivers/hv/hv_util.c
755 +index 41f5896224bd..9dc63725363d 100644
756 +--- a/drivers/hv/hv_util.c
757 ++++ b/drivers/hv/hv_util.c
758 +@@ -326,6 +326,7 @@ static int util_probe(struct hv_device *dev,
759 + srv->recv_buffer = kmalloc(PAGE_SIZE * 4, GFP_KERNEL);
760 + if (!srv->recv_buffer)
761 + return -ENOMEM;
762 ++ srv->channel = dev->channel;
763 + if (srv->util_init) {
764 + ret = srv->util_init(srv);
765 + if (ret) {
766 +diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
767 +index 75e383e6d03d..15e06493c53a 100644
768 +--- a/drivers/hv/hyperv_vmbus.h
769 ++++ b/drivers/hv/hyperv_vmbus.h
770 +@@ -35,6 +35,11 @@
771 + */
772 + #define HV_UTIL_TIMEOUT 30
773 +
774 ++/*
775 ++ * Timeout for guest-host handshake for services.
776 ++ */
777 ++#define HV_UTIL_NEGO_TIMEOUT 60
778 ++
779 + /*
780 + * The below CPUID leaves are present if VersionAndFeatures.HypervisorPresent
781 + * is set by CPUID(HVCPUID_VERSION_FEATURES).
782 +diff --git a/drivers/i2c/busses/i2c-scmi.c b/drivers/i2c/busses/i2c-scmi.c
783 +index 7aa7b9cb6203..efefcfa24a4c 100644
784 +--- a/drivers/i2c/busses/i2c-scmi.c
785 ++++ b/drivers/i2c/busses/i2c-scmi.c
786 +@@ -152,6 +152,7 @@ acpi_smbus_cmi_access(struct i2c_adapter *adap, u16 addr, unsigned short flags,
787 + mt_params[3].type = ACPI_TYPE_INTEGER;
788 + mt_params[3].integer.value = len;
789 + mt_params[4].type = ACPI_TYPE_BUFFER;
790 ++ mt_params[4].buffer.length = len;
791 + mt_params[4].buffer.pointer = data->block + 1;
792 + }
793 + break;
794 +diff --git a/drivers/input/keyboard/atakbd.c b/drivers/input/keyboard/atakbd.c
795 +index f1235831283d..fdeda0b0fbd6 100644
796 +--- a/drivers/input/keyboard/atakbd.c
797 ++++ b/drivers/input/keyboard/atakbd.c
798 +@@ -79,8 +79,7 @@ MODULE_LICENSE("GPL");
799 + */
800 +
801 +
802 +-static unsigned char atakbd_keycode[0x72] = { /* American layout */
803 +- [0] = KEY_GRAVE,
804 ++static unsigned char atakbd_keycode[0x73] = { /* American layout */
805 + [1] = KEY_ESC,
806 + [2] = KEY_1,
807 + [3] = KEY_2,
808 +@@ -121,9 +120,9 @@ static unsigned char atakbd_keycode[0x72] = { /* American layout */
809 + [38] = KEY_L,
810 + [39] = KEY_SEMICOLON,
811 + [40] = KEY_APOSTROPHE,
812 +- [41] = KEY_BACKSLASH, /* FIXME, '#' */
813 ++ [41] = KEY_GRAVE,
814 + [42] = KEY_LEFTSHIFT,
815 +- [43] = KEY_GRAVE, /* FIXME: '~' */
816 ++ [43] = KEY_BACKSLASH,
817 + [44] = KEY_Z,
818 + [45] = KEY_X,
819 + [46] = KEY_C,
820 +@@ -149,45 +148,34 @@ static unsigned char atakbd_keycode[0x72] = { /* American layout */
821 + [66] = KEY_F8,
822 + [67] = KEY_F9,
823 + [68] = KEY_F10,
824 +- [69] = KEY_ESC,
825 +- [70] = KEY_DELETE,
826 +- [71] = KEY_KP7,
827 +- [72] = KEY_KP8,
828 +- [73] = KEY_KP9,
829 ++ [71] = KEY_HOME,
830 ++ [72] = KEY_UP,
831 + [74] = KEY_KPMINUS,
832 +- [75] = KEY_KP4,
833 +- [76] = KEY_KP5,
834 +- [77] = KEY_KP6,
835 ++ [75] = KEY_LEFT,
836 ++ [77] = KEY_RIGHT,
837 + [78] = KEY_KPPLUS,
838 +- [79] = KEY_KP1,
839 +- [80] = KEY_KP2,
840 +- [81] = KEY_KP3,
841 +- [82] = KEY_KP0,
842 +- [83] = KEY_KPDOT,
843 +- [90] = KEY_KPLEFTPAREN,
844 +- [91] = KEY_KPRIGHTPAREN,
845 +- [92] = KEY_KPASTERISK, /* FIXME */
846 +- [93] = KEY_KPASTERISK,
847 +- [94] = KEY_KPPLUS,
848 +- [95] = KEY_HELP,
849 ++ [80] = KEY_DOWN,
850 ++ [82] = KEY_INSERT,
851 ++ [83] = KEY_DELETE,
852 + [96] = KEY_102ND,
853 +- [97] = KEY_KPASTERISK, /* FIXME */
854 +- [98] = KEY_KPSLASH,
855 ++ [97] = KEY_UNDO,
856 ++ [98] = KEY_HELP,
857 + [99] = KEY_KPLEFTPAREN,
858 + [100] = KEY_KPRIGHTPAREN,
859 + [101] = KEY_KPSLASH,
860 + [102] = KEY_KPASTERISK,
861 +- [103] = KEY_UP,
862 +- [104] = KEY_KPASTERISK, /* FIXME */
863 +- [105] = KEY_LEFT,
864 +- [106] = KEY_RIGHT,
865 +- [107] = KEY_KPASTERISK, /* FIXME */
866 +- [108] = KEY_DOWN,
867 +- [109] = KEY_KPASTERISK, /* FIXME */
868 +- [110] = KEY_KPASTERISK, /* FIXME */
869 +- [111] = KEY_KPASTERISK, /* FIXME */
870 +- [112] = KEY_KPASTERISK, /* FIXME */
871 +- [113] = KEY_KPASTERISK /* FIXME */
872 ++ [103] = KEY_KP7,
873 ++ [104] = KEY_KP8,
874 ++ [105] = KEY_KP9,
875 ++ [106] = KEY_KP4,
876 ++ [107] = KEY_KP5,
877 ++ [108] = KEY_KP6,
878 ++ [109] = KEY_KP1,
879 ++ [110] = KEY_KP2,
880 ++ [111] = KEY_KP3,
881 ++ [112] = KEY_KP0,
882 ++ [113] = KEY_KPDOT,
883 ++ [114] = KEY_KPENTER,
884 + };
885 +
886 + static struct input_dev *atakbd_dev;
887 +@@ -195,21 +183,15 @@ static struct input_dev *atakbd_dev;
888 + static void atakbd_interrupt(unsigned char scancode, char down)
889 + {
890 +
891 +- if (scancode < 0x72) { /* scancodes < 0xf2 are keys */
892 ++ if (scancode < 0x73) { /* scancodes < 0xf3 are keys */
893 +
894 + // report raw events here?
895 +
896 + scancode = atakbd_keycode[scancode];
897 +
898 +- if (scancode == KEY_CAPSLOCK) { /* CapsLock is a toggle switch key on Amiga */
899 +- input_report_key(atakbd_dev, scancode, 1);
900 +- input_report_key(atakbd_dev, scancode, 0);
901 +- input_sync(atakbd_dev);
902 +- } else {
903 +- input_report_key(atakbd_dev, scancode, down);
904 +- input_sync(atakbd_dev);
905 +- }
906 +- } else /* scancodes >= 0xf2 are mouse data, most likely */
907 ++ input_report_key(atakbd_dev, scancode, down);
908 ++ input_sync(atakbd_dev);
909 ++ } else /* scancodes >= 0xf3 are mouse data, most likely */
910 + printk(KERN_INFO "atakbd: unhandled scancode %x\n", scancode);
911 +
912 + return;
913 +diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
914 +index 6e02a15d39ce..abddb621d9e6 100644
915 +--- a/drivers/media/usb/dvb-usb-v2/af9035.c
916 ++++ b/drivers/media/usb/dvb-usb-v2/af9035.c
917 +@@ -389,8 +389,10 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
918 + msg[0].addr == (state->af9033_i2c_addr[1] >> 1))
919 + reg |= 0x100000;
920 +
921 +- ret = af9035_wr_regs(d, reg, &msg[0].buf[3],
922 +- msg[0].len - 3);
923 ++ ret = (msg[0].len >= 3) ? af9035_wr_regs(d, reg,
924 ++ &msg[0].buf[3],
925 ++ msg[0].len - 3)
926 ++ : -EOPNOTSUPP;
927 + } else {
928 + /* I2C write */
929 + u8 buf[MAX_XFER_SIZE];
930 +diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
931 +index 1d924d1533c0..b9dc2fcd8f26 100644
932 +--- a/drivers/mfd/omap-usb-host.c
933 ++++ b/drivers/mfd/omap-usb-host.c
934 +@@ -548,8 +548,8 @@ static int usbhs_omap_get_dt_pdata(struct device *dev,
935 + }
936 +
937 + static const struct of_device_id usbhs_child_match_table[] = {
938 +- { .compatible = "ti,omap-ehci", },
939 +- { .compatible = "ti,omap-ohci", },
940 ++ { .compatible = "ti,ehci-omap", },
941 ++ { .compatible = "ti,ohci-omap3", },
942 + { }
943 + };
944 +
945 +@@ -875,6 +875,7 @@ static struct platform_driver usbhs_omap_driver = {
946 + .pm = &usbhsomap_dev_pm_ops,
947 + .of_match_table = usbhs_omap_dt_ids,
948 + },
949 ++ .probe = usbhs_omap_probe,
950 + .remove = usbhs_omap_remove,
951 + };
952 +
953 +@@ -884,9 +885,9 @@ MODULE_ALIAS("platform:" USBHS_DRIVER_NAME);
954 + MODULE_LICENSE("GPL v2");
955 + MODULE_DESCRIPTION("usb host common core driver for omap EHCI and OHCI");
956 +
957 +-static int __init omap_usbhs_drvinit(void)
958 ++static int omap_usbhs_drvinit(void)
959 + {
960 +- return platform_driver_probe(&usbhs_omap_driver, usbhs_omap_probe);
961 ++ return platform_driver_register(&usbhs_omap_driver);
962 + }
963 +
964 + /*
965 +@@ -898,7 +899,7 @@ static int __init omap_usbhs_drvinit(void)
966 + */
967 + fs_initcall_sync(omap_usbhs_drvinit);
968 +
969 +-static void __exit omap_usbhs_drvexit(void)
970 ++static void omap_usbhs_drvexit(void)
971 + {
972 + platform_driver_unregister(&usbhs_omap_driver);
973 + }
974 +diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
975 +index 339118f3c718..78da1b7b4d86 100644
976 +--- a/drivers/net/bonding/bond_main.c
977 ++++ b/drivers/net/bonding/bond_main.c
978 +@@ -216,6 +216,7 @@ static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev,
979 + static void bond_slave_arr_handler(struct work_struct *work);
980 + static bool bond_time_in_interval(struct bonding *bond, unsigned long last_act,
981 + int mod);
982 ++static void bond_netdev_notify_work(struct work_struct *work);
983 +
984 + /*---------------------------- General routines -----------------------------*/
985 +
986 +@@ -1237,6 +1238,8 @@ static struct slave *bond_alloc_slave(struct bonding *bond)
987 + return NULL;
988 + }
989 + }
990 ++ INIT_DELAYED_WORK(&slave->notify_work, bond_netdev_notify_work);
991 ++
992 + return slave;
993 + }
994 +
995 +@@ -1244,6 +1247,7 @@ static void bond_free_slave(struct slave *slave)
996 + {
997 + struct bonding *bond = bond_get_bond_by_slave(slave);
998 +
999 ++ cancel_delayed_work_sync(&slave->notify_work);
1000 + if (BOND_MODE(bond) == BOND_MODE_8023AD)
1001 + kfree(SLAVE_AD_INFO(slave));
1002 +
1003 +@@ -1265,39 +1269,26 @@ static void bond_fill_ifslave(struct slave *slave, struct ifslave *info)
1004 + info->link_failure_count = slave->link_failure_count;
1005 + }
1006 +
1007 +-static void bond_netdev_notify(struct net_device *dev,
1008 +- struct netdev_bonding_info *info)
1009 +-{
1010 +- rtnl_lock();
1011 +- netdev_bonding_info_change(dev, info);
1012 +- rtnl_unlock();
1013 +-}
1014 +-
1015 + static void bond_netdev_notify_work(struct work_struct *_work)
1016 + {
1017 +- struct netdev_notify_work *w =
1018 +- container_of(_work, struct netdev_notify_work, work.work);
1019 ++ struct slave *slave = container_of(_work, struct slave,
1020 ++ notify_work.work);
1021 ++
1022 ++ if (rtnl_trylock()) {
1023 ++ struct netdev_bonding_info binfo;
1024 +
1025 +- bond_netdev_notify(w->dev, &w->bonding_info);
1026 +- dev_put(w->dev);
1027 +- kfree(w);
1028 ++ bond_fill_ifslave(slave, &binfo.slave);
1029 ++ bond_fill_ifbond(slave->bond, &binfo.master);
1030 ++ netdev_bonding_info_change(slave->dev, &binfo);
1031 ++ rtnl_unlock();
1032 ++ } else {
1033 ++ queue_delayed_work(slave->bond->wq, &slave->notify_work, 1);
1034 ++ }
1035 + }
1036 +
1037 + void bond_queue_slave_event(struct slave *slave)
1038 + {
1039 +- struct bonding *bond = slave->bond;
1040 +- struct netdev_notify_work *nnw = kzalloc(sizeof(*nnw), GFP_ATOMIC);
1041 +-
1042 +- if (!nnw)
1043 +- return;
1044 +-
1045 +- dev_hold(slave->dev);
1046 +- nnw->dev = slave->dev;
1047 +- bond_fill_ifslave(slave, &nnw->bonding_info.slave);
1048 +- bond_fill_ifbond(bond, &nnw->bonding_info.master);
1049 +- INIT_DELAYED_WORK(&nnw->work, bond_netdev_notify_work);
1050 +-
1051 +- queue_delayed_work(slave->bond->wq, &nnw->work, 0);
1052 ++ queue_delayed_work(slave->bond->wq, &slave->notify_work, 0);
1053 + }
1054 +
1055 + /* enslave device <slave> to bond device <master> */
1056 +diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
1057 +index af9ec57bbebf..7a6dd5e5e498 100644
1058 +--- a/drivers/net/ethernet/broadcom/bcmsysport.c
1059 ++++ b/drivers/net/ethernet/broadcom/bcmsysport.c
1060 +@@ -850,14 +850,22 @@ static void bcm_sysport_resume_from_wol(struct bcm_sysport_priv *priv)
1061 + {
1062 + u32 reg;
1063 +
1064 +- /* Stop monitoring MPD interrupt */
1065 +- intrl2_0_mask_set(priv, INTRL2_0_MPD);
1066 +-
1067 + /* Clear the MagicPacket detection logic */
1068 + reg = umac_readl(priv, UMAC_MPD_CTRL);
1069 + reg &= ~MPD_EN;
1070 + umac_writel(priv, reg, UMAC_MPD_CTRL);
1071 +
1072 ++ reg = intrl2_0_readl(priv, INTRL2_CPU_STATUS);
1073 ++ if (reg & INTRL2_0_MPD)
1074 ++ netdev_info(priv->netdev, "Wake-on-LAN (MPD) interrupt!\n");
1075 ++
1076 ++ if (reg & INTRL2_0_BRCM_MATCH_TAG) {
1077 ++ reg = rxchk_readl(priv, RXCHK_BRCM_TAG_MATCH_STATUS) &
1078 ++ RXCHK_BRCM_TAG_MATCH_MASK;
1079 ++ netdev_info(priv->netdev,
1080 ++ "Wake-on-LAN (filters 0x%02x) interrupt!\n", reg);
1081 ++ }
1082 ++
1083 + netif_dbg(priv, wol, priv->netdev, "resumed from WOL\n");
1084 + }
1085 +
1086 +@@ -890,11 +898,6 @@ static irqreturn_t bcm_sysport_rx_isr(int irq, void *dev_id)
1087 + if (priv->irq0_stat & INTRL2_0_TX_RING_FULL)
1088 + bcm_sysport_tx_reclaim_all(priv);
1089 +
1090 +- if (priv->irq0_stat & INTRL2_0_MPD) {
1091 +- netdev_info(priv->netdev, "Wake-on-LAN interrupt!\n");
1092 +- bcm_sysport_resume_from_wol(priv);
1093 +- }
1094 +-
1095 + return IRQ_HANDLED;
1096 + }
1097 +
1098 +@@ -1915,9 +1918,6 @@ static int bcm_sysport_suspend_to_wol(struct bcm_sysport_priv *priv)
1099 + /* UniMAC receive needs to be turned on */
1100 + umac_enable_set(priv, CMD_RX_EN, 1);
1101 +
1102 +- /* Enable the interrupt wake-up source */
1103 +- intrl2_0_mask_clear(priv, INTRL2_0_MPD);
1104 +-
1105 + netif_dbg(priv, wol, ndev, "entered WOL mode\n");
1106 +
1107 + return 0;
1108 +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
1109 +index 4ffacafddacb..fea8116da06a 100644
1110 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
1111 ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
1112 +@@ -1343,8 +1343,11 @@ static int bnxt_poll_work(struct bnxt *bp, struct bnxt_napi *bnapi, int budget)
1113 + if (TX_CMP_TYPE(txcmp) == CMP_TYPE_TX_L2_CMP) {
1114 + tx_pkts++;
1115 + /* return full budget so NAPI will complete. */
1116 +- if (unlikely(tx_pkts > bp->tx_wake_thresh))
1117 ++ if (unlikely(tx_pkts > bp->tx_wake_thresh)) {
1118 + rx_pkts = budget;
1119 ++ raw_cons = NEXT_RAW_CMP(raw_cons);
1120 ++ break;
1121 ++ }
1122 + } else if ((TX_CMP_TYPE(txcmp) & 0x30) == 0x10) {
1123 + rc = bnxt_rx_pkt(bp, bnapi, &raw_cons, &agg_event);
1124 + if (likely(rc >= 0))
1125 +@@ -1362,7 +1365,7 @@ static int bnxt_poll_work(struct bnxt *bp, struct bnxt_napi *bnapi, int budget)
1126 + }
1127 + raw_cons = NEXT_RAW_CMP(raw_cons);
1128 +
1129 +- if (rx_pkts == budget)
1130 ++ if (rx_pkts && rx_pkts == budget)
1131 + break;
1132 + }
1133 +
1134 +@@ -1404,8 +1407,12 @@ static int bnxt_poll(struct napi_struct *napi, int budget)
1135 + while (1) {
1136 + work_done += bnxt_poll_work(bp, bnapi, budget - work_done);
1137 +
1138 +- if (work_done >= budget)
1139 ++ if (work_done >= budget) {
1140 ++ if (!budget)
1141 ++ BNXT_CP_DB_REARM(cpr->cp_doorbell,
1142 ++ cpr->cp_raw_cons);
1143 + break;
1144 ++ }
1145 +
1146 + if (!bnxt_has_work(bp, cpr)) {
1147 + napi_complete(napi);
1148 +diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
1149 +index 8c698d464716..085f77f273ba 100644
1150 +--- a/drivers/net/ethernet/cadence/macb.c
1151 ++++ b/drivers/net/ethernet/cadence/macb.c
1152 +@@ -2743,6 +2743,13 @@ static const struct macb_config at91sam9260_config = {
1153 + .init = macb_init,
1154 + };
1155 +
1156 ++static const struct macb_config sama5d3macb_config = {
1157 ++ .caps = MACB_CAPS_SG_DISABLED
1158 ++ | MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
1159 ++ .clk_init = macb_clk_init,
1160 ++ .init = macb_init,
1161 ++};
1162 ++
1163 + static const struct macb_config pc302gem_config = {
1164 + .caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE,
1165 + .dma_burst_length = 16,
1166 +@@ -2801,6 +2808,7 @@ static const struct of_device_id macb_dt_ids[] = {
1167 + { .compatible = "cdns,gem", .data = &pc302gem_config },
1168 + { .compatible = "atmel,sama5d2-gem", .data = &sama5d2_config },
1169 + { .compatible = "atmel,sama5d3-gem", .data = &sama5d3_config },
1170 ++ { .compatible = "atmel,sama5d3-macb", .data = &sama5d3macb_config },
1171 + { .compatible = "atmel,sama5d4-gem", .data = &sama5d4_config },
1172 + { .compatible = "cdns,at91rm9200-emac", .data = &emac_config },
1173 + { .compatible = "cdns,emac", .data = &emac_config },
1174 +diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
1175 +index ac92685dd4e5..42305f3234ff 100644
1176 +--- a/drivers/net/ethernet/marvell/mvpp2.c
1177 ++++ b/drivers/net/ethernet/marvell/mvpp2.c
1178 +@@ -29,6 +29,7 @@
1179 + #include <linux/clk.h>
1180 + #include <linux/hrtimer.h>
1181 + #include <linux/ktime.h>
1182 ++#include <linux/if_vlan.h>
1183 + #include <uapi/linux/ppp_defs.h>
1184 + #include <net/ip.h>
1185 + #include <net/ipv6.h>
1186 +@@ -4268,7 +4269,7 @@ static void mvpp2_txq_desc_put(struct mvpp2_tx_queue *txq)
1187 + }
1188 +
1189 + /* Set Tx descriptors fields relevant for CSUM calculation */
1190 +-static u32 mvpp2_txq_desc_csum(int l3_offs, int l3_proto,
1191 ++static u32 mvpp2_txq_desc_csum(int l3_offs, __be16 l3_proto,
1192 + int ip_hdr_len, int l4_proto)
1193 + {
1194 + u32 command;
1195 +@@ -5032,14 +5033,15 @@ static u32 mvpp2_skb_tx_csum(struct mvpp2_port *port, struct sk_buff *skb)
1196 + if (skb->ip_summed == CHECKSUM_PARTIAL) {
1197 + int ip_hdr_len = 0;
1198 + u8 l4_proto;
1199 ++ __be16 l3_proto = vlan_get_protocol(skb);
1200 +
1201 +- if (skb->protocol == htons(ETH_P_IP)) {
1202 ++ if (l3_proto == htons(ETH_P_IP)) {
1203 + struct iphdr *ip4h = ip_hdr(skb);
1204 +
1205 + /* Calculate IPv4 checksum and L4 checksum */
1206 + ip_hdr_len = ip4h->ihl;
1207 + l4_proto = ip4h->protocol;
1208 +- } else if (skb->protocol == htons(ETH_P_IPV6)) {
1209 ++ } else if (l3_proto == htons(ETH_P_IPV6)) {
1210 + struct ipv6hdr *ip6h = ipv6_hdr(skb);
1211 +
1212 + /* Read l4_protocol from one of IPv6 extra headers */
1213 +@@ -5051,7 +5053,7 @@ static u32 mvpp2_skb_tx_csum(struct mvpp2_port *port, struct sk_buff *skb)
1214 + }
1215 +
1216 + return mvpp2_txq_desc_csum(skb_network_offset(skb),
1217 +- skb->protocol, ip_hdr_len, l4_proto);
1218 ++ l3_proto, ip_hdr_len, l4_proto);
1219 + }
1220 +
1221 + return MVPP2_TXD_L4_CSUM_NOT | MVPP2_TXD_IP_CSUM_DISABLE;
1222 +diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c
1223 +index ff77b8b608bd..7417605c3cf6 100644
1224 +--- a/drivers/net/ethernet/mellanox/mlx4/eq.c
1225 ++++ b/drivers/net/ethernet/mellanox/mlx4/eq.c
1226 +@@ -228,7 +228,8 @@ static void mlx4_set_eq_affinity_hint(struct mlx4_priv *priv, int vec)
1227 + struct mlx4_dev *dev = &priv->dev;
1228 + struct mlx4_eq *eq = &priv->eq_table.eq[vec];
1229 +
1230 +- if (!eq->affinity_mask || cpumask_empty(eq->affinity_mask))
1231 ++ if (!cpumask_available(eq->affinity_mask) ||
1232 ++ cpumask_empty(eq->affinity_mask))
1233 + return;
1234 +
1235 + hint_err = irq_set_affinity_hint(eq->irq, eq->affinity_mask);
1236 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
1237 +index 55007f1e6bbc..12cd8aef1881 100644
1238 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
1239 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
1240 +@@ -1802,7 +1802,8 @@ struct qlcnic_hardware_ops {
1241 + int (*config_loopback) (struct qlcnic_adapter *, u8);
1242 + int (*clear_loopback) (struct qlcnic_adapter *, u8);
1243 + int (*config_promisc_mode) (struct qlcnic_adapter *, u32);
1244 +- void (*change_l2_filter) (struct qlcnic_adapter *, u64 *, u16);
1245 ++ void (*change_l2_filter)(struct qlcnic_adapter *adapter, u64 *addr,
1246 ++ u16 vlan, struct qlcnic_host_tx_ring *tx_ring);
1247 + int (*get_board_info) (struct qlcnic_adapter *);
1248 + void (*set_mac_filter_count) (struct qlcnic_adapter *);
1249 + void (*free_mac_list) (struct qlcnic_adapter *);
1250 +@@ -2044,9 +2045,10 @@ static inline int qlcnic_nic_set_promisc(struct qlcnic_adapter *adapter,
1251 + }
1252 +
1253 + static inline void qlcnic_change_filter(struct qlcnic_adapter *adapter,
1254 +- u64 *addr, u16 id)
1255 ++ u64 *addr, u16 vlan,
1256 ++ struct qlcnic_host_tx_ring *tx_ring)
1257 + {
1258 +- adapter->ahw->hw_ops->change_l2_filter(adapter, addr, id);
1259 ++ adapter->ahw->hw_ops->change_l2_filter(adapter, addr, vlan, tx_ring);
1260 + }
1261 +
1262 + static inline int qlcnic_get_board_info(struct qlcnic_adapter *adapter)
1263 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
1264 +index b4f3cb55605e..7f7aea9758e7 100644
1265 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
1266 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
1267 +@@ -2132,7 +2132,8 @@ out:
1268 + }
1269 +
1270 + void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *adapter, u64 *addr,
1271 +- u16 vlan_id)
1272 ++ u16 vlan_id,
1273 ++ struct qlcnic_host_tx_ring *tx_ring)
1274 + {
1275 + u8 mac[ETH_ALEN];
1276 + memcpy(&mac, addr, ETH_ALEN);
1277 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
1278 +index 331ae2c20f40..c8e012b3f7e7 100644
1279 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
1280 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
1281 +@@ -550,7 +550,8 @@ int qlcnic_83xx_wrt_reg_indirect(struct qlcnic_adapter *, ulong, u32);
1282 + int qlcnic_83xx_nic_set_promisc(struct qlcnic_adapter *, u32);
1283 + int qlcnic_83xx_config_hw_lro(struct qlcnic_adapter *, int);
1284 + int qlcnic_83xx_config_rss(struct qlcnic_adapter *, int);
1285 +-void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *, u64 *, u16);
1286 ++void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *adapter, u64 *addr,
1287 ++ u16 vlan, struct qlcnic_host_tx_ring *ring);
1288 + int qlcnic_83xx_get_pci_info(struct qlcnic_adapter *, struct qlcnic_pci_info *);
1289 + int qlcnic_83xx_set_nic_info(struct qlcnic_adapter *, struct qlcnic_info *);
1290 + void qlcnic_83xx_initialize_nic(struct qlcnic_adapter *, int);
1291 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
1292 +index 4bb33af8e2b3..56a3bd9e37dc 100644
1293 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
1294 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h
1295 +@@ -173,7 +173,8 @@ int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter,
1296 + struct net_device *netdev);
1297 + void qlcnic_82xx_get_beacon_state(struct qlcnic_adapter *);
1298 + void qlcnic_82xx_change_filter(struct qlcnic_adapter *adapter,
1299 +- u64 *uaddr, u16 vlan_id);
1300 ++ u64 *uaddr, u16 vlan_id,
1301 ++ struct qlcnic_host_tx_ring *tx_ring);
1302 + int qlcnic_82xx_config_intr_coalesce(struct qlcnic_adapter *,
1303 + struct ethtool_coalesce *);
1304 + int qlcnic_82xx_set_rx_coalesce(struct qlcnic_adapter *);
1305 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
1306 +index d4b5085a21fa..98042a3701b5 100644
1307 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
1308 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
1309 +@@ -269,13 +269,12 @@ static void qlcnic_add_lb_filter(struct qlcnic_adapter *adapter,
1310 + }
1311 +
1312 + void qlcnic_82xx_change_filter(struct qlcnic_adapter *adapter, u64 *uaddr,
1313 +- u16 vlan_id)
1314 ++ u16 vlan_id, struct qlcnic_host_tx_ring *tx_ring)
1315 + {
1316 + struct cmd_desc_type0 *hwdesc;
1317 + struct qlcnic_nic_req *req;
1318 + struct qlcnic_mac_req *mac_req;
1319 + struct qlcnic_vlan_req *vlan_req;
1320 +- struct qlcnic_host_tx_ring *tx_ring = adapter->tx_ring;
1321 + u32 producer;
1322 + u64 word;
1323 +
1324 +@@ -302,7 +301,8 @@ void qlcnic_82xx_change_filter(struct qlcnic_adapter *adapter, u64 *uaddr,
1325 +
1326 + static void qlcnic_send_filter(struct qlcnic_adapter *adapter,
1327 + struct cmd_desc_type0 *first_desc,
1328 +- struct sk_buff *skb)
1329 ++ struct sk_buff *skb,
1330 ++ struct qlcnic_host_tx_ring *tx_ring)
1331 + {
1332 + struct vlan_ethhdr *vh = (struct vlan_ethhdr *)(skb->data);
1333 + struct ethhdr *phdr = (struct ethhdr *)(skb->data);
1334 +@@ -336,7 +336,7 @@ static void qlcnic_send_filter(struct qlcnic_adapter *adapter,
1335 + tmp_fil->vlan_id == vlan_id) {
1336 + if (jiffies > (QLCNIC_READD_AGE * HZ + tmp_fil->ftime))
1337 + qlcnic_change_filter(adapter, &src_addr,
1338 +- vlan_id);
1339 ++ vlan_id, tx_ring);
1340 + tmp_fil->ftime = jiffies;
1341 + return;
1342 + }
1343 +@@ -351,7 +351,7 @@ static void qlcnic_send_filter(struct qlcnic_adapter *adapter,
1344 + if (!fil)
1345 + return;
1346 +
1347 +- qlcnic_change_filter(adapter, &src_addr, vlan_id);
1348 ++ qlcnic_change_filter(adapter, &src_addr, vlan_id, tx_ring);
1349 + fil->ftime = jiffies;
1350 + fil->vlan_id = vlan_id;
1351 + memcpy(fil->faddr, &src_addr, ETH_ALEN);
1352 +@@ -767,7 +767,7 @@ netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1353 + }
1354 +
1355 + if (adapter->drv_mac_learn)
1356 +- qlcnic_send_filter(adapter, first_desc, skb);
1357 ++ qlcnic_send_filter(adapter, first_desc, skb, tx_ring);
1358 +
1359 + tx_ring->tx_stats.tx_bytes += skb->len;
1360 + tx_ring->tx_stats.xmit_called++;
1361 +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
1362 +index d02691ba3d7f..20aa34f45f07 100644
1363 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
1364 ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
1365 +@@ -71,7 +71,7 @@ static int dwmac1000_validate_mcast_bins(int mcast_bins)
1366 + * Description:
1367 + * This function validates the number of Unicast address entries supported
1368 + * by a particular Synopsys 10/100/1000 controller. The Synopsys controller
1369 +- * supports 1, 32, 64, or 128 Unicast filter entries for it's Unicast filter
1370 ++ * supports 1..32, 64, or 128 Unicast filter entries for it's Unicast filter
1371 + * logic. This function validates a valid, supported configuration is
1372 + * selected, and defaults to 1 Unicast address if an unsupported
1373 + * configuration is selected.
1374 +@@ -81,8 +81,7 @@ static int dwmac1000_validate_ucast_entries(int ucast_entries)
1375 + int x = ucast_entries;
1376 +
1377 + switch (x) {
1378 +- case 1:
1379 +- case 32:
1380 ++ case 1 ... 32:
1381 + case 64:
1382 + case 128:
1383 + break;
1384 +diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
1385 +index 49174837c2ba..33ffb573fd67 100644
1386 +--- a/drivers/net/team/team.c
1387 ++++ b/drivers/net/team/team.c
1388 +@@ -1142,6 +1142,11 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
1389 + return -EBUSY;
1390 + }
1391 +
1392 ++ if (dev == port_dev) {
1393 ++ netdev_err(dev, "Cannot enslave team device to itself\n");
1394 ++ return -EINVAL;
1395 ++ }
1396 ++
1397 + if (port_dev->features & NETIF_F_VLAN_CHALLENGED &&
1398 + vlan_uses_dev(dev)) {
1399 + netdev_err(dev, "Device %s is VLAN challenged and team device has VLAN set up\n",
1400 +diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
1401 +index 478937418a33..8dbe086e0a96 100644
1402 +--- a/drivers/net/usb/smsc75xx.c
1403 ++++ b/drivers/net/usb/smsc75xx.c
1404 +@@ -1506,6 +1506,7 @@ static void smsc75xx_unbind(struct usbnet *dev, struct usb_interface *intf)
1405 + {
1406 + struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
1407 + if (pdata) {
1408 ++ cancel_work_sync(&pdata->set_multicast);
1409 + netif_dbg(dev, ifdown, dev->net, "free pdata\n");
1410 + kfree(pdata);
1411 + pdata = NULL;
1412 +diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c
1413 +index f7771d86ad6c..4ea44f7122ee 100644
1414 +--- a/drivers/usb/gadget/function/u_serial.c
1415 ++++ b/drivers/usb/gadget/function/u_serial.c
1416 +@@ -518,7 +518,7 @@ static void gs_rx_push(unsigned long _port)
1417 + }
1418 +
1419 + /* push data to (open) tty */
1420 +- if (req->actual) {
1421 ++ if (req->actual && tty) {
1422 + char *packet = req->buf;
1423 + unsigned size = req->actual;
1424 + unsigned n;
1425 +diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
1426 +index 9df00101bfe1..f788f80fe1aa 100644
1427 +--- a/drivers/usb/host/xhci-hub.c
1428 ++++ b/drivers/usb/host/xhci-hub.c
1429 +@@ -1048,17 +1048,17 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
1430 + temp = readl(port_array[wIndex]);
1431 + break;
1432 + }
1433 +-
1434 +- /* Software should not attempt to set
1435 +- * port link state above '3' (U3) and the port
1436 +- * must be enabled.
1437 +- */
1438 +- if ((temp & PORT_PE) == 0 ||
1439 +- (link_state > USB_SS_PORT_LS_U3)) {
1440 +- xhci_warn(xhci, "Cannot set link state.\n");
1441 ++ /* Port must be enabled */
1442 ++ if (!(temp & PORT_PE)) {
1443 ++ retval = -ENODEV;
1444 ++ break;
1445 ++ }
1446 ++ /* Can't set port link state above '3' (U3) */
1447 ++ if (link_state > USB_SS_PORT_LS_U3) {
1448 ++ xhci_warn(xhci, "Cannot set port %d link state %d\n",
1449 ++ wIndex, link_state);
1450 + goto error;
1451 + }
1452 +-
1453 + if (link_state == USB_SS_PORT_LS_U3) {
1454 + slot_id = xhci_find_slot_id_by_port(hcd, xhci,
1455 + wIndex + 1);
1456 +diff --git a/drivers/video/fbdev/aty/atyfb.h b/drivers/video/fbdev/aty/atyfb.h
1457 +index 63c4842eb224..46e0e8b39b76 100644
1458 +--- a/drivers/video/fbdev/aty/atyfb.h
1459 ++++ b/drivers/video/fbdev/aty/atyfb.h
1460 +@@ -332,6 +332,8 @@ extern const struct aty_pll_ops aty_pll_ct; /* Integrated */
1461 + extern void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll);
1462 + extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par);
1463 +
1464 ++extern const u8 aty_postdividers[8];
1465 ++
1466 +
1467 + /*
1468 + * Hardware cursor support
1469 +@@ -358,7 +360,6 @@ static inline void wait_for_idle(struct atyfb_par *par)
1470 +
1471 + extern void aty_reset_engine(const struct atyfb_par *par);
1472 + extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info);
1473 +-extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par);
1474 +
1475 + void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
1476 + void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
1477 +diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
1478 +index 7f658fa4d22a..9755a0ec6591 100644
1479 +--- a/drivers/video/fbdev/aty/atyfb_base.c
1480 ++++ b/drivers/video/fbdev/aty/atyfb_base.c
1481 +@@ -3093,17 +3093,18 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct fb_info *info,
1482 + /*
1483 + * PLL Reference Divider M:
1484 + */
1485 +- M = pll_regs[2];
1486 ++ M = pll_regs[PLL_REF_DIV];
1487 +
1488 + /*
1489 + * PLL Feedback Divider N (Dependent on CLOCK_CNTL):
1490 + */
1491 +- N = pll_regs[7 + (clock_cntl & 3)];
1492 ++ N = pll_regs[VCLK0_FB_DIV + (clock_cntl & 3)];
1493 +
1494 + /*
1495 + * PLL Post Divider P (Dependent on CLOCK_CNTL):
1496 + */
1497 +- P = 1 << (pll_regs[6] >> ((clock_cntl & 3) << 1));
1498 ++ P = aty_postdividers[((pll_regs[VCLK_POST_DIV] >> ((clock_cntl & 3) << 1)) & 3) |
1499 ++ ((pll_regs[PLL_EXT_CNTL] >> (2 + (clock_cntl & 3))) & 4)];
1500 +
1501 + /*
1502 + * PLL Divider Q:
1503 +diff --git a/drivers/video/fbdev/aty/mach64_ct.c b/drivers/video/fbdev/aty/mach64_ct.c
1504 +index 51f29d627ceb..af54256a20a1 100644
1505 +--- a/drivers/video/fbdev/aty/mach64_ct.c
1506 ++++ b/drivers/video/fbdev/aty/mach64_ct.c
1507 +@@ -114,7 +114,7 @@ static void aty_st_pll_ct(int offset, u8 val, const struct atyfb_par *par)
1508 + */
1509 +
1510 + #define Maximum_DSP_PRECISION 7
1511 +-static u8 postdividers[] = {1,2,4,8,3};
1512 ++const u8 aty_postdividers[8] = {1,2,4,8,3,5,6,12};
1513 +
1514 + static int aty_dsp_gt(const struct fb_info *info, u32 bpp, struct pll_ct *pll)
1515 + {
1516 +@@ -221,7 +221,7 @@ static int aty_valid_pll_ct(const struct fb_info *info, u32 vclk_per, struct pll
1517 + pll->vclk_post_div += (q < 64*8);
1518 + pll->vclk_post_div += (q < 32*8);
1519 + }
1520 +- pll->vclk_post_div_real = postdividers[pll->vclk_post_div];
1521 ++ pll->vclk_post_div_real = aty_postdividers[pll->vclk_post_div];
1522 + // pll->vclk_post_div <<= 6;
1523 + pll->vclk_fb_div = q * pll->vclk_post_div_real / 8;
1524 + pllvclk = (1000000 * 2 * pll->vclk_fb_div) /
1525 +@@ -512,7 +512,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
1526 + u8 mclk_fb_div, pll_ext_cntl;
1527 + pll->ct.pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par);
1528 + pll_ext_cntl = aty_ld_pll_ct(PLL_EXT_CNTL, par);
1529 +- pll->ct.xclk_post_div_real = postdividers[pll_ext_cntl & 0x07];
1530 ++ pll->ct.xclk_post_div_real = aty_postdividers[pll_ext_cntl & 0x07];
1531 + mclk_fb_div = aty_ld_pll_ct(MCLK_FB_DIV, par);
1532 + if (pll_ext_cntl & PLL_MFB_TIMES_4_2B)
1533 + mclk_fb_div <<= 1;
1534 +@@ -534,7 +534,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
1535 + xpost_div += (q < 64*8);
1536 + xpost_div += (q < 32*8);
1537 + }
1538 +- pll->ct.xclk_post_div_real = postdividers[xpost_div];
1539 ++ pll->ct.xclk_post_div_real = aty_postdividers[xpost_div];
1540 + pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8;
1541 +
1542 + #ifdef CONFIG_PPC
1543 +@@ -583,7 +583,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
1544 + mpost_div += (q < 64*8);
1545 + mpost_div += (q < 32*8);
1546 + }
1547 +- sclk_post_div_real = postdividers[mpost_div];
1548 ++ sclk_post_div_real = aty_postdividers[mpost_div];
1549 + pll->ct.sclk_fb_div = q * sclk_post_div_real / 8;
1550 + pll->ct.spll_cntl2 = mpost_div << 4;
1551 + #ifdef DEBUG
1552 +diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
1553 +index d0aaf338fa9f..d6bae37489af 100644
1554 +--- a/fs/ext4/xattr.c
1555 ++++ b/fs/ext4/xattr.c
1556 +@@ -638,14 +638,20 @@ static size_t ext4_xattr_free_space(struct ext4_xattr_entry *last,
1557 + }
1558 +
1559 + static int
1560 +-ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s)
1561 ++ext4_xattr_set_entry(struct ext4_xattr_info *i, struct ext4_xattr_search *s,
1562 ++ struct inode *inode)
1563 + {
1564 +- struct ext4_xattr_entry *last;
1565 ++ struct ext4_xattr_entry *last, *next;
1566 + size_t free, min_offs = s->end - s->base, name_len = strlen(i->name);
1567 +
1568 + /* Compute min_offs and last. */
1569 + last = s->first;
1570 +- for (; !IS_LAST_ENTRY(last); last = EXT4_XATTR_NEXT(last)) {
1571 ++ for (; !IS_LAST_ENTRY(last); last = next) {
1572 ++ next = EXT4_XATTR_NEXT(last);
1573 ++ if ((void *)next >= s->end) {
1574 ++ EXT4_ERROR_INODE(inode, "corrupted xattr entries");
1575 ++ return -EFSCORRUPTED;
1576 ++ }
1577 + if (!last->e_value_block && last->e_value_size) {
1578 + size_t offs = le16_to_cpu(last->e_value_offs);
1579 + if (offs < min_offs)
1580 +@@ -825,7 +831,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
1581 + ce = NULL;
1582 + }
1583 + ea_bdebug(bs->bh, "modifying in-place");
1584 +- error = ext4_xattr_set_entry(i, s);
1585 ++ error = ext4_xattr_set_entry(i, s, inode);
1586 + if (!error) {
1587 + if (!IS_LAST_ENTRY(s->first))
1588 + ext4_xattr_rehash(header(s->base),
1589 +@@ -875,7 +881,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
1590 + s->end = s->base + sb->s_blocksize;
1591 + }
1592 +
1593 +- error = ext4_xattr_set_entry(i, s);
1594 ++ error = ext4_xattr_set_entry(i, s, inode);
1595 + if (error == -EFSCORRUPTED)
1596 + goto bad_block;
1597 + if (error)
1598 +@@ -1037,7 +1043,7 @@ int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode,
1599 +
1600 + if (EXT4_I(inode)->i_extra_isize == 0)
1601 + return -ENOSPC;
1602 +- error = ext4_xattr_set_entry(i, s);
1603 ++ error = ext4_xattr_set_entry(i, s, inode);
1604 + if (error) {
1605 + if (error == -ENOSPC &&
1606 + ext4_has_inline_data(inode)) {
1607 +@@ -1049,7 +1055,7 @@ int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode,
1608 + error = ext4_xattr_ibody_find(inode, i, is);
1609 + if (error)
1610 + return error;
1611 +- error = ext4_xattr_set_entry(i, s);
1612 ++ error = ext4_xattr_set_entry(i, s, inode);
1613 + }
1614 + if (error)
1615 + return error;
1616 +@@ -1075,7 +1081,7 @@ static int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode,
1617 +
1618 + if (EXT4_I(inode)->i_extra_isize == 0)
1619 + return -ENOSPC;
1620 +- error = ext4_xattr_set_entry(i, s);
1621 ++ error = ext4_xattr_set_entry(i, s, inode);
1622 + if (error)
1623 + return error;
1624 + header = IHDR(inode, ext4_raw_inode(&is->iloc));
1625 +diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c
1626 +index 4c2c03663533..8e1427762eeb 100644
1627 +--- a/fs/jffs2/xattr.c
1628 ++++ b/fs/jffs2/xattr.c
1629 +@@ -1004,12 +1004,14 @@ ssize_t jffs2_listxattr(struct dentry *dentry, char *buffer, size_t size)
1630 + rc = xhandle->list(xhandle, dentry, buffer + len,
1631 + size - len, xd->xname,
1632 + xd->name_len);
1633 ++ if (rc > size - len) {
1634 ++ rc = -ERANGE;
1635 ++ goto out;
1636 ++ }
1637 + } else {
1638 + rc = xhandle->list(xhandle, dentry, NULL, 0,
1639 + xd->xname, xd->name_len);
1640 + }
1641 +- if (rc < 0)
1642 +- goto out;
1643 + len += rc;
1644 + }
1645 + rc = len;
1646 +diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
1647 +index ae6a711dcd1d..281bb007f725 100644
1648 +--- a/include/linux/hyperv.h
1649 ++++ b/include/linux/hyperv.h
1650 +@@ -1179,6 +1179,7 @@ int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj,
1651 +
1652 + struct hv_util_service {
1653 + u8 *recv_buffer;
1654 ++ void *channel;
1655 + void (*util_cb)(void *);
1656 + int (*util_init)(struct hv_util_service *);
1657 + void (*util_deinit)(void);
1658 +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
1659 +index fc54049e8286..0b211d482c96 100644
1660 +--- a/include/linux/netdevice.h
1661 ++++ b/include/linux/netdevice.h
1662 +@@ -2168,6 +2168,13 @@ struct netdev_notifier_info {
1663 + struct net_device *dev;
1664 + };
1665 +
1666 ++struct netdev_notifier_info_ext {
1667 ++ struct netdev_notifier_info info; /* must be first */
1668 ++ union {
1669 ++ u32 mtu;
1670 ++ } ext;
1671 ++};
1672 ++
1673 + struct netdev_notifier_change_info {
1674 + struct netdev_notifier_info info; /* must be first */
1675 + unsigned int flags_changed;
1676 +diff --git a/include/net/bonding.h b/include/net/bonding.h
1677 +index 93abe5f6188d..d5abd3a80896 100644
1678 +--- a/include/net/bonding.h
1679 ++++ b/include/net/bonding.h
1680 +@@ -146,12 +146,6 @@ struct bond_parm_tbl {
1681 + int mode;
1682 + };
1683 +
1684 +-struct netdev_notify_work {
1685 +- struct delayed_work work;
1686 +- struct net_device *dev;
1687 +- struct netdev_bonding_info bonding_info;
1688 +-};
1689 +-
1690 + struct slave {
1691 + struct net_device *dev; /* first - useful for panic debug */
1692 + struct bonding *bond; /* our master */
1693 +@@ -177,6 +171,7 @@ struct slave {
1694 + #ifdef CONFIG_NET_POLL_CONTROLLER
1695 + struct netpoll *np;
1696 + #endif
1697 ++ struct delayed_work notify_work;
1698 + struct kobject kobj;
1699 + struct rtnl_link_stats64 slave_stats;
1700 + };
1701 +diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
1702 +index 3afb7c4c7098..2a25b53cd427 100644
1703 +--- a/include/net/ip_fib.h
1704 ++++ b/include/net/ip_fib.h
1705 +@@ -322,6 +322,7 @@ int ip_fib_check_default(__be32 gw, struct net_device *dev);
1706 + int fib_sync_down_dev(struct net_device *dev, unsigned long event, bool force);
1707 + int fib_sync_down_addr(struct net *net, __be32 local);
1708 + int fib_sync_up(struct net_device *dev, unsigned int nh_flags);
1709 ++void fib_sync_mtu(struct net_device *dev, u32 orig_mtu);
1710 +
1711 + extern u32 fib_multipath_secret __read_mostly;
1712 +
1713 +diff --git a/mm/vmstat.c b/mm/vmstat.c
1714 +index 8895eff2d735..a2d70ef74db7 100644
1715 +--- a/mm/vmstat.c
1716 ++++ b/mm/vmstat.c
1717 +@@ -869,7 +869,6 @@ const char * const vmstat_text[] = {
1718 + #ifdef CONFIG_DEBUG_VM_VMACACHE
1719 + "vmacache_find_calls",
1720 + "vmacache_find_hits",
1721 +- "vmacache_full_flushes",
1722 + #endif
1723 + #endif /* CONFIG_VM_EVENTS_COUNTERS */
1724 + };
1725 +diff --git a/net/core/dev.c b/net/core/dev.c
1726 +index 191cf880d805..7366feb8b5b3 100644
1727 +--- a/net/core/dev.c
1728 ++++ b/net/core/dev.c
1729 +@@ -1660,6 +1660,28 @@ int call_netdevice_notifiers(unsigned long val, struct net_device *dev)
1730 + }
1731 + EXPORT_SYMBOL(call_netdevice_notifiers);
1732 +
1733 ++/**
1734 ++ * call_netdevice_notifiers_mtu - call all network notifier blocks
1735 ++ * @val: value passed unmodified to notifier function
1736 ++ * @dev: net_device pointer passed unmodified to notifier function
1737 ++ * @arg: additional u32 argument passed to the notifier function
1738 ++ *
1739 ++ * Call all network notifier blocks. Parameters and return value
1740 ++ * are as for raw_notifier_call_chain().
1741 ++ */
1742 ++static int call_netdevice_notifiers_mtu(unsigned long val,
1743 ++ struct net_device *dev, u32 arg)
1744 ++{
1745 ++ struct netdev_notifier_info_ext info = {
1746 ++ .info.dev = dev,
1747 ++ .ext.mtu = arg,
1748 ++ };
1749 ++
1750 ++ BUILD_BUG_ON(offsetof(struct netdev_notifier_info_ext, info) != 0);
1751 ++
1752 ++ return call_netdevice_notifiers_info(val, dev, &info.info);
1753 ++}
1754 ++
1755 + #ifdef CONFIG_NET_INGRESS
1756 + static struct static_key ingress_needed __read_mostly;
1757 +
1758 +@@ -6134,14 +6156,16 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
1759 + err = __dev_set_mtu(dev, new_mtu);
1760 +
1761 + if (!err) {
1762 +- err = call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
1763 ++ err = call_netdevice_notifiers_mtu(NETDEV_CHANGEMTU, dev,
1764 ++ orig_mtu);
1765 + err = notifier_to_errno(err);
1766 + if (err) {
1767 + /* setting mtu back and notifying everyone again,
1768 + * so that they have a chance to revert changes.
1769 + */
1770 + __dev_set_mtu(dev, orig_mtu);
1771 +- call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
1772 ++ call_netdevice_notifiers_mtu(NETDEV_CHANGEMTU, dev,
1773 ++ new_mtu);
1774 + }
1775 + }
1776 + return err;
1777 +diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
1778 +index 96c9c0f0905a..f1df04c7d395 100644
1779 +--- a/net/core/rtnetlink.c
1780 ++++ b/net/core/rtnetlink.c
1781 +@@ -2116,6 +2116,12 @@ struct net_device *rtnl_create_link(struct net *net,
1782 + else if (ops->get_num_rx_queues)
1783 + num_rx_queues = ops->get_num_rx_queues();
1784 +
1785 ++ if (num_tx_queues < 1 || num_tx_queues > 4096)
1786 ++ return ERR_PTR(-EINVAL);
1787 ++
1788 ++ if (num_rx_queues < 1 || num_rx_queues > 4096)
1789 ++ return ERR_PTR(-EINVAL);
1790 ++
1791 + err = -ENOMEM;
1792 + dev = alloc_netdev_mqs(ops->priv_size, ifname, name_assign_type,
1793 + ops->setup, num_tx_queues, num_rx_queues);
1794 +diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
1795 +index 015c33712803..ce646572b912 100644
1796 +--- a/net/ipv4/fib_frontend.c
1797 ++++ b/net/ipv4/fib_frontend.c
1798 +@@ -1170,7 +1170,8 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event,
1799 + static int fib_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
1800 + {
1801 + struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1802 +- struct netdev_notifier_changeupper_info *info;
1803 ++ struct netdev_notifier_changeupper_info *upper_info = ptr;
1804 ++ struct netdev_notifier_info_ext *info_ext = ptr;
1805 + struct in_device *in_dev;
1806 + struct net *net = dev_net(dev);
1807 + unsigned int flags;
1808 +@@ -1205,16 +1206,19 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
1809 + fib_sync_up(dev, RTNH_F_LINKDOWN);
1810 + else
1811 + fib_sync_down_dev(dev, event, false);
1812 +- /* fall through */
1813 ++ rt_cache_flush(net);
1814 ++ break;
1815 + case NETDEV_CHANGEMTU:
1816 ++ fib_sync_mtu(dev, info_ext->ext.mtu);
1817 + rt_cache_flush(net);
1818 + break;
1819 + case NETDEV_CHANGEUPPER:
1820 +- info = ptr;
1821 ++ upper_info = ptr;
1822 + /* flush all routes if dev is linked to or unlinked from
1823 + * an L3 master device (e.g., VRF)
1824 + */
1825 +- if (info->upper_dev && netif_is_l3_master(info->upper_dev))
1826 ++ if (upper_info->upper_dev &&
1827 ++ netif_is_l3_master(upper_info->upper_dev))
1828 + fib_disable_ip(dev, NETDEV_DOWN, true);
1829 + break;
1830 + }
1831 +diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
1832 +index 03ebff3950d8..3109b9bb95d2 100644
1833 +--- a/net/ipv4/fib_semantics.c
1834 ++++ b/net/ipv4/fib_semantics.c
1835 +@@ -1373,6 +1373,56 @@ int fib_sync_down_addr(struct net *net, __be32 local)
1836 + return ret;
1837 + }
1838 +
1839 ++/* Update the PMTU of exceptions when:
1840 ++ * - the new MTU of the first hop becomes smaller than the PMTU
1841 ++ * - the old MTU was the same as the PMTU, and it limited discovery of
1842 ++ * larger MTUs on the path. With that limit raised, we can now
1843 ++ * discover larger MTUs
1844 ++ * A special case is locked exceptions, for which the PMTU is smaller
1845 ++ * than the minimal accepted PMTU:
1846 ++ * - if the new MTU is greater than the PMTU, don't make any change
1847 ++ * - otherwise, unlock and set PMTU
1848 ++ */
1849 ++static void nh_update_mtu(struct fib_nh *nh, u32 new, u32 orig)
1850 ++{
1851 ++ struct fnhe_hash_bucket *bucket;
1852 ++ int i;
1853 ++
1854 ++ bucket = rcu_dereference_protected(nh->nh_exceptions, 1);
1855 ++ if (!bucket)
1856 ++ return;
1857 ++
1858 ++ for (i = 0; i < FNHE_HASH_SIZE; i++) {
1859 ++ struct fib_nh_exception *fnhe;
1860 ++
1861 ++ for (fnhe = rcu_dereference_protected(bucket[i].chain, 1);
1862 ++ fnhe;
1863 ++ fnhe = rcu_dereference_protected(fnhe->fnhe_next, 1)) {
1864 ++ if (fnhe->fnhe_mtu_locked) {
1865 ++ if (new <= fnhe->fnhe_pmtu) {
1866 ++ fnhe->fnhe_pmtu = new;
1867 ++ fnhe->fnhe_mtu_locked = false;
1868 ++ }
1869 ++ } else if (new < fnhe->fnhe_pmtu ||
1870 ++ orig == fnhe->fnhe_pmtu) {
1871 ++ fnhe->fnhe_pmtu = new;
1872 ++ }
1873 ++ }
1874 ++ }
1875 ++}
1876 ++
1877 ++void fib_sync_mtu(struct net_device *dev, u32 orig_mtu)
1878 ++{
1879 ++ unsigned int hash = fib_devindex_hashfn(dev->ifindex);
1880 ++ struct hlist_head *head = &fib_info_devhash[hash];
1881 ++ struct fib_nh *nh;
1882 ++
1883 ++ hlist_for_each_entry(nh, head, nh_hash) {
1884 ++ if (nh->nh_dev == dev)
1885 ++ nh_update_mtu(nh, dev->mtu, orig_mtu);
1886 ++ }
1887 ++}
1888 ++
1889 + /* Event force Flags Description
1890 + * NETDEV_CHANGE 0 LINKDOWN Carrier OFF, not for scope host
1891 + * NETDEV_DOWN 0 LINKDOWN|DEAD Link down, not for scope host
1892 +diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
1893 +index 88426a6a7a85..3f8caf7d19b8 100644
1894 +--- a/net/ipv4/ip_sockglue.c
1895 ++++ b/net/ipv4/ip_sockglue.c
1896 +@@ -134,7 +134,6 @@ static void ip_cmsg_recv_security(struct msghdr *msg, struct sk_buff *skb)
1897 + static void ip_cmsg_recv_dstaddr(struct msghdr *msg, struct sk_buff *skb)
1898 + {
1899 + struct sockaddr_in sin;
1900 +- const struct iphdr *iph = ip_hdr(skb);
1901 + __be16 *ports;
1902 + int end;
1903 +
1904 +@@ -149,7 +148,7 @@ static void ip_cmsg_recv_dstaddr(struct msghdr *msg, struct sk_buff *skb)
1905 + ports = (__be16 *)skb_transport_header(skb);
1906 +
1907 + sin.sin_family = AF_INET;
1908 +- sin.sin_addr.s_addr = iph->daddr;
1909 ++ sin.sin_addr.s_addr = ip_hdr(skb)->daddr;
1910 + sin.sin_port = ports[1];
1911 + memset(sin.sin_zero, 0, sizeof(sin.sin_zero));
1912 +
1913 +diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
1914 +index 3d62feb65932..9d3176b080a4 100644
1915 +--- a/net/ipv4/ip_tunnel.c
1916 ++++ b/net/ipv4/ip_tunnel.c
1917 +@@ -597,6 +597,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
1918 + const struct iphdr *tnl_params, u8 protocol)
1919 + {
1920 + struct ip_tunnel *tunnel = netdev_priv(dev);
1921 ++ unsigned int inner_nhdr_len = 0;
1922 + const struct iphdr *inner_iph;
1923 + struct flowi4 fl4;
1924 + u8 tos, ttl;
1925 +@@ -607,6 +608,14 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
1926 + int err;
1927 + bool connected;
1928 +
1929 ++ /* ensure we can access the inner net header, for several users below */
1930 ++ if (skb->protocol == htons(ETH_P_IP))
1931 ++ inner_nhdr_len = sizeof(struct iphdr);
1932 ++ else if (skb->protocol == htons(ETH_P_IPV6))
1933 ++ inner_nhdr_len = sizeof(struct ipv6hdr);
1934 ++ if (unlikely(!pskb_may_pull(skb, inner_nhdr_len)))
1935 ++ goto tx_error;
1936 ++
1937 + inner_iph = (const struct iphdr *)skb_inner_network_header(skb);
1938 + connected = (tunnel->parms.iph.daddr != 0);
1939 +
1940 +diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
1941 +index 0613be57513e..582e757e5727 100644
1942 +--- a/net/ipv6/addrconf.c
1943 ++++ b/net/ipv6/addrconf.c
1944 +@@ -3786,7 +3786,6 @@ static struct inet6_ifaddr *if6_get_first(struct seq_file *seq, loff_t pos)
1945 + p++;
1946 + continue;
1947 + }
1948 +- state->offset++;
1949 + return ifa;
1950 + }
1951 +
1952 +@@ -3810,13 +3809,12 @@ static struct inet6_ifaddr *if6_get_next(struct seq_file *seq,
1953 + return ifa;
1954 + }
1955 +
1956 ++ state->offset = 0;
1957 + while (++state->bucket < IN6_ADDR_HSIZE) {
1958 +- state->offset = 0;
1959 + hlist_for_each_entry_rcu_bh(ifa,
1960 + &inet6_addr_lst[state->bucket], addr_lst) {
1961 + if (!net_eq(dev_net(ifa->idev->dev), net))
1962 + continue;
1963 +- state->offset++;
1964 + return ifa;
1965 + }
1966 + }
1967 +diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
1968 +index e8f21dd520b2..7c7a74ea2b0d 100644
1969 +--- a/net/ipv6/ip6_tunnel.c
1970 ++++ b/net/ipv6/ip6_tunnel.c
1971 +@@ -1096,7 +1096,7 @@ static inline int
1972 + ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
1973 + {
1974 + struct ip6_tnl *t = netdev_priv(dev);
1975 +- const struct iphdr *iph = ip_hdr(skb);
1976 ++ const struct iphdr *iph;
1977 + int encap_limit = -1;
1978 + struct flowi6 fl6;
1979 + __u8 dsfield;
1980 +@@ -1104,6 +1104,11 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
1981 + u8 tproto;
1982 + int err;
1983 +
1984 ++ /* ensure we can access the full inner ip header */
1985 ++ if (!pskb_may_pull(skb, sizeof(struct iphdr)))
1986 ++ return -1;
1987 ++
1988 ++ iph = ip_hdr(skb);
1989 + memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
1990 +
1991 + tproto = ACCESS_ONCE(t->parms.proto);
1992 +@@ -1140,7 +1145,7 @@ static inline int
1993 + ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
1994 + {
1995 + struct ip6_tnl *t = netdev_priv(dev);
1996 +- struct ipv6hdr *ipv6h = ipv6_hdr(skb);
1997 ++ struct ipv6hdr *ipv6h;
1998 + int encap_limit = -1;
1999 + __u16 offset;
2000 + struct flowi6 fl6;
2001 +@@ -1149,6 +1154,10 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev)
2002 + u8 tproto;
2003 + int err;
2004 +
2005 ++ if (unlikely(!pskb_may_pull(skb, sizeof(*ipv6h))))
2006 ++ return -1;
2007 ++
2008 ++ ipv6h = ipv6_hdr(skb);
2009 + tproto = ACCESS_ONCE(t->parms.proto);
2010 + if ((tproto != IPPROTO_IPV6 && tproto != 0) ||
2011 + ip6_tnl_addr_conflict(t, ipv6h))
2012 +diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
2013 +index 3f33ec44bd28..9f4ec16abfcf 100644
2014 +--- a/net/netlabel/netlabel_unlabeled.c
2015 ++++ b/net/netlabel/netlabel_unlabeled.c
2016 +@@ -787,7 +787,8 @@ static int netlbl_unlabel_addrinfo_get(struct genl_info *info,
2017 + {
2018 + u32 addr_len;
2019 +
2020 +- if (info->attrs[NLBL_UNLABEL_A_IPV4ADDR]) {
2021 ++ if (info->attrs[NLBL_UNLABEL_A_IPV4ADDR] &&
2022 ++ info->attrs[NLBL_UNLABEL_A_IPV4MASK]) {
2023 + addr_len = nla_len(info->attrs[NLBL_UNLABEL_A_IPV4ADDR]);
2024 + if (addr_len != sizeof(struct in_addr) &&
2025 + addr_len != nla_len(info->attrs[NLBL_UNLABEL_A_IPV4MASK]))
2026 +diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
2027 +index b5a17cb510a0..4727f5b80e76 100644
2028 +--- a/sound/hda/hdac_controller.c
2029 ++++ b/sound/hda/hdac_controller.c
2030 +@@ -40,6 +40,8 @@ static void azx_clear_corbrp(struct hdac_bus *bus)
2031 + */
2032 + void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus)
2033 + {
2034 ++ WARN_ON_ONCE(!bus->rb.area);
2035 ++
2036 + spin_lock_irq(&bus->reg_lock);
2037 + /* CORB set up */
2038 + bus->corb.addr = bus->rb.addr;
2039 +@@ -377,13 +379,15 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
2040 + /* reset controller */
2041 + azx_reset(bus, full_reset);
2042 +
2043 +- /* initialize interrupts */
2044 ++ /* clear interrupts */
2045 + azx_int_clear(bus);
2046 +- azx_int_enable(bus);
2047 +
2048 + /* initialize the codec command I/O */
2049 + snd_hdac_bus_init_cmd_io(bus);
2050 +
2051 ++ /* enable interrupts after CORB/RIRB buffers are initialized above */
2052 ++ azx_int_enable(bus);
2053 ++
2054 + /* program the position buffer */
2055 + if (bus->use_posbuf && bus->posbuf.addr) {
2056 + snd_hdac_chip_writel(bus, DPLBASE, (u32)bus->posbuf.addr);
2057 +diff --git a/sound/soc/codecs/sigmadsp.c b/sound/soc/codecs/sigmadsp.c
2058 +index d53680ac78e4..6df158669420 100644
2059 +--- a/sound/soc/codecs/sigmadsp.c
2060 ++++ b/sound/soc/codecs/sigmadsp.c
2061 +@@ -117,8 +117,7 @@ static int sigmadsp_ctrl_write(struct sigmadsp *sigmadsp,
2062 + struct sigmadsp_control *ctrl, void *data)
2063 + {
2064 + /* safeload loads up to 20 bytes in a atomic operation */
2065 +- if (ctrl->num_bytes > 4 && ctrl->num_bytes <= 20 && sigmadsp->ops &&
2066 +- sigmadsp->ops->safeload)
2067 ++ if (ctrl->num_bytes <= 20 && sigmadsp->ops && sigmadsp->ops->safeload)
2068 + return sigmadsp->ops->safeload(sigmadsp, ctrl->addr, data,
2069 + ctrl->num_bytes);
2070 + else
2071 +diff --git a/sound/soc/codecs/wm8804-i2c.c b/sound/soc/codecs/wm8804-i2c.c
2072 +index f27464c2c5ba..79541960f45d 100644
2073 +--- a/sound/soc/codecs/wm8804-i2c.c
2074 ++++ b/sound/soc/codecs/wm8804-i2c.c
2075 +@@ -13,6 +13,7 @@
2076 + #include <linux/init.h>
2077 + #include <linux/module.h>
2078 + #include <linux/i2c.h>
2079 ++#include <linux/acpi.h>
2080 +
2081 + #include "wm8804.h"
2082 +
2083 +@@ -40,17 +41,29 @@ static const struct i2c_device_id wm8804_i2c_id[] = {
2084 + };
2085 + MODULE_DEVICE_TABLE(i2c, wm8804_i2c_id);
2086 +
2087 ++#if defined(CONFIG_OF)
2088 + static const struct of_device_id wm8804_of_match[] = {
2089 + { .compatible = "wlf,wm8804", },
2090 + { }
2091 + };
2092 + MODULE_DEVICE_TABLE(of, wm8804_of_match);
2093 ++#endif
2094 ++
2095 ++#ifdef CONFIG_ACPI
2096 ++static const struct acpi_device_id wm8804_acpi_match[] = {
2097 ++ { "1AEC8804", 0 }, /* Wolfson PCI ID + part ID */
2098 ++ { "10138804", 0 }, /* Cirrus Logic PCI ID + part ID */
2099 ++ { },
2100 ++};
2101 ++MODULE_DEVICE_TABLE(acpi, wm8804_acpi_match);
2102 ++#endif
2103 +
2104 + static struct i2c_driver wm8804_i2c_driver = {
2105 + .driver = {
2106 + .name = "wm8804",
2107 + .pm = &wm8804_pm,
2108 +- .of_match_table = wm8804_of_match,
2109 ++ .of_match_table = of_match_ptr(wm8804_of_match),
2110 ++ .acpi_match_table = ACPI_PTR(wm8804_acpi_match),
2111 + },
2112 + .probe = wm8804_i2c_probe,
2113 + .remove = wm8804_i2c_remove,
2114 +diff --git a/tools/perf/scripts/python/export-to-postgresql.py b/tools/perf/scripts/python/export-to-postgresql.py
2115 +index 1b02cdc0cab6..84cb5913b05a 100644
2116 +--- a/tools/perf/scripts/python/export-to-postgresql.py
2117 ++++ b/tools/perf/scripts/python/export-to-postgresql.py
2118 +@@ -205,14 +205,23 @@ from ctypes import *
2119 + libpq = CDLL("libpq.so.5")
2120 + PQconnectdb = libpq.PQconnectdb
2121 + PQconnectdb.restype = c_void_p
2122 ++PQconnectdb.argtypes = [ c_char_p ]
2123 + PQfinish = libpq.PQfinish
2124 ++PQfinish.argtypes = [ c_void_p ]
2125 + PQstatus = libpq.PQstatus
2126 ++PQstatus.restype = c_int
2127 ++PQstatus.argtypes = [ c_void_p ]
2128 + PQexec = libpq.PQexec
2129 + PQexec.restype = c_void_p
2130 ++PQexec.argtypes = [ c_void_p, c_char_p ]
2131 + PQresultStatus = libpq.PQresultStatus
2132 ++PQresultStatus.restype = c_int
2133 ++PQresultStatus.argtypes = [ c_void_p ]
2134 + PQputCopyData = libpq.PQputCopyData
2135 ++PQputCopyData.restype = c_int
2136 + PQputCopyData.argtypes = [ c_void_p, c_void_p, c_int ]
2137 + PQputCopyEnd = libpq.PQputCopyEnd
2138 ++PQputCopyEnd.restype = c_int
2139 + PQputCopyEnd.argtypes = [ c_void_p, c_void_p ]
2140 +
2141 + sys.path.append(os.environ['PERF_EXEC_PATH'] + \
2142 +diff --git a/tools/testing/selftests/efivarfs/config b/tools/testing/selftests/efivarfs/config
2143 +new file mode 100644
2144 +index 000000000000..4e151f1005b2
2145 +--- /dev/null
2146 ++++ b/tools/testing/selftests/efivarfs/config
2147 +@@ -0,0 +1 @@
2148 ++CONFIG_EFIVAR_FS=y