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:37
Message-Id: 1542812479.fc128fac8946788ddbac961b6a8d02a8904e2f99.mpagano@gentoo
1 commit: fc128fac8946788ddbac961b6a8d02a8904e2f99
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 24 11:41:45 2018 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 21 15:01:19 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=fc128fac
7
8 Linux patch 4.4.152
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1151_linux-4.4.152.patch | 2288 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2292 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index de81070..ebf1b99 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -647,6 +647,10 @@ Patch: 1150_linux-4.4.151.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.4.151
23
24 +Patch: 1151_linux-4.4.152.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.4.152
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/1151_linux-4.4.152.patch b/1151_linux-4.4.152.patch
33 new file mode 100644
34 index 0000000..c35680c
35 --- /dev/null
36 +++ b/1151_linux-4.4.152.patch
37 @@ -0,0 +1,2288 @@
38 +diff --git a/Makefile b/Makefile
39 +index 04199cf99dd5..523b0d4354fb 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,6 +1,6 @@
43 + VERSION = 4
44 + PATCHLEVEL = 4
45 +-SUBLEVEL = 151
46 ++SUBLEVEL = 152
47 + EXTRAVERSION =
48 + NAME = Blurry Fish Butt
49 +
50 +diff --git a/arch/arc/Makefile b/arch/arc/Makefile
51 +index c05ea2b54276..b9f7306412e5 100644
52 +--- a/arch/arc/Makefile
53 ++++ b/arch/arc/Makefile
54 +@@ -14,7 +14,7 @@ endif
55 +
56 + KBUILD_DEFCONFIG := nsim_700_defconfig
57 +
58 +-cflags-y += -fno-common -pipe -fno-builtin -D__linux__
59 ++cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
60 + cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
61 + cflags-$(CONFIG_ISA_ARCV2) += -mcpu=archs
62 +
63 +@@ -137,16 +137,3 @@ dtbs: scripts
64 +
65 + archclean:
66 + $(Q)$(MAKE) $(clean)=$(boot)
67 +-
68 +-# Hacks to enable final link due to absence of link-time branch relexation
69 +-# and gcc choosing optimal(shorter) branches at -O3
70 +-#
71 +-# vineetg Feb 2010: -mlong-calls switched off for overall kernel build
72 +-# However lib/decompress_inflate.o (.init.text) calls
73 +-# zlib_inflate_workspacesize (.text) causing relocation errors.
74 +-# Thus forcing all exten calls in this file to be long calls
75 +-export CFLAGS_decompress_inflate.o = -mmedium-calls
76 +-export CFLAGS_initramfs.o = -mmedium-calls
77 +-ifdef CONFIG_SMP
78 +-export CFLAGS_core.o = -mmedium-calls
79 +-endif
80 +diff --git a/arch/arc/include/asm/mach_desc.h b/arch/arc/include/asm/mach_desc.h
81 +index c28e6c347b49..871f3cb16af9 100644
82 +--- a/arch/arc/include/asm/mach_desc.h
83 ++++ b/arch/arc/include/asm/mach_desc.h
84 +@@ -34,9 +34,7 @@ struct machine_desc {
85 + const char *name;
86 + const char **dt_compat;
87 + void (*init_early)(void);
88 +-#ifdef CONFIG_SMP
89 + void (*init_per_cpu)(unsigned int);
90 +-#endif
91 + void (*init_machine)(void);
92 + void (*init_late)(void);
93 +
94 +diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c
95 +index ba17f85285cf..dd42c6feaba5 100644
96 +--- a/arch/arc/kernel/irq.c
97 ++++ b/arch/arc/kernel/irq.c
98 +@@ -31,10 +31,10 @@ void __init init_IRQ(void)
99 + /* a SMP H/w block could do IPI IRQ request here */
100 + if (plat_smp_ops.init_per_cpu)
101 + plat_smp_ops.init_per_cpu(smp_processor_id());
102 ++#endif
103 +
104 + if (machine_desc->init_per_cpu)
105 + machine_desc->init_per_cpu(smp_processor_id());
106 +-#endif
107 + }
108 +
109 + /*
110 +diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi
111 +index 5e3f5e86ffcf..cfcbf5baba4f 100644
112 +--- a/arch/arm/boot/dts/am3517.dtsi
113 ++++ b/arch/arm/boot/dts/am3517.dtsi
114 +@@ -74,6 +74,11 @@
115 + };
116 + };
117 +
118 ++/* Table Table 5-79 of the TRM shows 480ab000 is reserved */
119 ++&usb_otg_hs {
120 ++ status = "disabled";
121 ++};
122 ++
123 + &iva {
124 + status = "disabled";
125 + };
126 +diff --git a/arch/arm/boot/dts/am437x-sk-evm.dts b/arch/arm/boot/dts/am437x-sk-evm.dts
127 +index 63de2a1b4315..648236c5281b 100644
128 +--- a/arch/arm/boot/dts/am437x-sk-evm.dts
129 ++++ b/arch/arm/boot/dts/am437x-sk-evm.dts
130 +@@ -508,6 +508,8 @@
131 +
132 + touchscreen-size-x = <480>;
133 + touchscreen-size-y = <272>;
134 ++
135 ++ wakeup-source;
136 + };
137 +
138 + tlv320aic3106: tlv320aic3106@1b {
139 +diff --git a/arch/arm/boot/dts/bcm-cygnus.dtsi b/arch/arm/boot/dts/bcm-cygnus.dtsi
140 +index 2778533502d9..5ce200860c89 100644
141 +--- a/arch/arm/boot/dts/bcm-cygnus.dtsi
142 ++++ b/arch/arm/boot/dts/bcm-cygnus.dtsi
143 +@@ -110,7 +110,7 @@
144 + reg = <0x18008000 0x100>;
145 + #address-cells = <1>;
146 + #size-cells = <0>;
147 +- interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>;
148 ++ interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
149 + clock-frequency = <100000>;
150 + status = "disabled";
151 + };
152 +@@ -138,7 +138,7 @@
153 + reg = <0x1800b000 0x100>;
154 + #address-cells = <1>;
155 + #size-cells = <0>;
156 +- interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>;
157 ++ interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
158 + clock-frequency = <100000>;
159 + status = "disabled";
160 + };
161 +diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
162 +index 0bd98cd00816..4ef5c3410fcc 100644
163 +--- a/arch/arm/boot/dts/da850.dtsi
164 ++++ b/arch/arm/boot/dts/da850.dtsi
165 +@@ -267,11 +267,7 @@
166 + compatible = "ti,dm6441-gpio";
167 + gpio-controller;
168 + reg = <0x226000 0x1000>;
169 +- interrupts = <42 IRQ_TYPE_EDGE_BOTH
170 +- 43 IRQ_TYPE_EDGE_BOTH 44 IRQ_TYPE_EDGE_BOTH
171 +- 45 IRQ_TYPE_EDGE_BOTH 46 IRQ_TYPE_EDGE_BOTH
172 +- 47 IRQ_TYPE_EDGE_BOTH 48 IRQ_TYPE_EDGE_BOTH
173 +- 49 IRQ_TYPE_EDGE_BOTH 50 IRQ_TYPE_EDGE_BOTH>;
174 ++ interrupts = <42 43 44 45 46 47 48 49 50>;
175 + ti,ngpio = <144>;
176 + ti,davinci-gpio-unbanked = <0>;
177 + status = "disabled";
178 +diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig
179 +index d3a8018639de..f4a2d28936e1 100644
180 +--- a/arch/arm/configs/imx_v4_v5_defconfig
181 ++++ b/arch/arm/configs/imx_v4_v5_defconfig
182 +@@ -145,9 +145,11 @@ CONFIG_USB_STORAGE=y
183 + CONFIG_USB_CHIPIDEA=y
184 + CONFIG_USB_CHIPIDEA_UDC=y
185 + CONFIG_USB_CHIPIDEA_HOST=y
186 ++CONFIG_USB_CHIPIDEA_ULPI=y
187 + CONFIG_NOP_USB_XCEIV=y
188 + CONFIG_USB_GADGET=y
189 + CONFIG_USB_ETH=m
190 ++CONFIG_USB_ULPI_BUS=y
191 + CONFIG_MMC=y
192 + CONFIG_MMC_SDHCI=y
193 + CONFIG_MMC_SDHCI_PLTFM=y
194 +diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
195 +index 4187f69f6630..b3490c1c49d1 100644
196 +--- a/arch/arm/configs/imx_v6_v7_defconfig
197 ++++ b/arch/arm/configs/imx_v6_v7_defconfig
198 +@@ -261,6 +261,7 @@ CONFIG_USB_STORAGE=y
199 + CONFIG_USB_CHIPIDEA=y
200 + CONFIG_USB_CHIPIDEA_UDC=y
201 + CONFIG_USB_CHIPIDEA_HOST=y
202 ++CONFIG_USB_CHIPIDEA_ULPI=y
203 + CONFIG_USB_SERIAL=m
204 + CONFIG_USB_SERIAL_GENERIC=y
205 + CONFIG_USB_SERIAL_FTDI_SIO=m
206 +@@ -287,6 +288,7 @@ CONFIG_USB_G_NCM=m
207 + CONFIG_USB_GADGETFS=m
208 + CONFIG_USB_MASS_STORAGE=m
209 + CONFIG_USB_G_SERIAL=m
210 ++CONFIG_USB_ULPI_BUS=y
211 + CONFIG_MMC=y
212 + CONFIG_MMC_SDHCI=y
213 + CONFIG_MMC_SDHCI_PLTFM=y
214 +diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
215 +index 9c10248fadcc..4e8c2116808e 100644
216 +--- a/arch/arm/mach-pxa/irq.c
217 ++++ b/arch/arm/mach-pxa/irq.c
218 +@@ -185,7 +185,7 @@ static int pxa_irq_suspend(void)
219 + {
220 + int i;
221 +
222 +- for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
223 ++ for (i = 0; i < DIV_ROUND_UP(pxa_internal_irq_nr, 32); i++) {
224 + void __iomem *base = irq_base(i);
225 +
226 + saved_icmr[i] = __raw_readl(base + ICMR);
227 +@@ -204,7 +204,7 @@ static void pxa_irq_resume(void)
228 + {
229 + int i;
230 +
231 +- for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
232 ++ for (i = 0; i < DIV_ROUND_UP(pxa_internal_irq_nr, 32); i++) {
233 + void __iomem *base = irq_base(i);
234 +
235 + __raw_writel(saved_icmr[i], base + ICMR);
236 +diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
237 +index c29ad610311b..a9f6705aea23 100644
238 +--- a/arch/arm/mm/init.c
239 ++++ b/arch/arm/mm/init.c
240 +@@ -716,19 +716,28 @@ int __mark_rodata_ro(void *unused)
241 + return 0;
242 + }
243 +
244 ++static int kernel_set_to_readonly __read_mostly;
245 ++
246 + void mark_rodata_ro(void)
247 + {
248 ++ kernel_set_to_readonly = 1;
249 + stop_machine(__mark_rodata_ro, NULL, NULL);
250 + }
251 +
252 + void set_kernel_text_rw(void)
253 + {
254 ++ if (!kernel_set_to_readonly)
255 ++ return;
256 ++
257 + set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), false,
258 + current->active_mm);
259 + }
260 +
261 + void set_kernel_text_ro(void)
262 + {
263 ++ if (!kernel_set_to_readonly)
264 ++ return;
265 ++
266 + set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), true,
267 + current->active_mm);
268 + }
269 +diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
270 +index f3c3d8fee5ba..03c0946b79d2 100644
271 +--- a/arch/arm64/kernel/smp.c
272 ++++ b/arch/arm64/kernel/smp.c
273 +@@ -131,7 +131,7 @@ static void smp_store_cpu_info(unsigned int cpuid)
274 + * This is the secondary CPU boot entry. We're using this CPUs
275 + * idle thread stack, but a set of temporary page tables.
276 + */
277 +-asmlinkage void secondary_start_kernel(void)
278 ++asmlinkage notrace void secondary_start_kernel(void)
279 + {
280 + struct mm_struct *mm = &init_mm;
281 + unsigned int cpu = smp_processor_id();
282 +diff --git a/arch/m68k/include/asm/mcf_pgalloc.h b/arch/m68k/include/asm/mcf_pgalloc.h
283 +index f9924fbcfe42..456e3f75ef3b 100644
284 +--- a/arch/m68k/include/asm/mcf_pgalloc.h
285 ++++ b/arch/m68k/include/asm/mcf_pgalloc.h
286 +@@ -43,6 +43,7 @@ extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address)
287 + static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page,
288 + unsigned long address)
289 + {
290 ++ pgtable_page_dtor(page);
291 + __free_page(page);
292 + }
293 +
294 +@@ -73,8 +74,9 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
295 + return page;
296 + }
297 +
298 +-extern inline void pte_free(struct mm_struct *mm, struct page *page)
299 ++static inline void pte_free(struct mm_struct *mm, struct page *page)
300 + {
301 ++ pgtable_page_dtor(page);
302 + __free_page(page);
303 + }
304 +
305 +diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h
306 +index 64f2992e439f..617efa845054 100644
307 +--- a/arch/parisc/include/asm/spinlock.h
308 ++++ b/arch/parisc/include/asm/spinlock.h
309 +@@ -21,7 +21,6 @@ static inline void arch_spin_lock_flags(arch_spinlock_t *x,
310 + {
311 + volatile unsigned int *a;
312 +
313 +- mb();
314 + a = __ldcw_align(x);
315 + while (__ldcw(a) == 0)
316 + while (*a == 0)
317 +@@ -31,16 +30,15 @@ static inline void arch_spin_lock_flags(arch_spinlock_t *x,
318 + local_irq_disable();
319 + } else
320 + cpu_relax();
321 +- mb();
322 + }
323 +
324 + static inline void arch_spin_unlock(arch_spinlock_t *x)
325 + {
326 + volatile unsigned int *a;
327 +- mb();
328 ++
329 + a = __ldcw_align(x);
330 +- *a = 1;
331 + mb();
332 ++ *a = 1;
333 + }
334 +
335 + static inline int arch_spin_trylock(arch_spinlock_t *x)
336 +@@ -48,10 +46,8 @@ static inline int arch_spin_trylock(arch_spinlock_t *x)
337 + volatile unsigned int *a;
338 + int ret;
339 +
340 +- mb();
341 + a = __ldcw_align(x);
342 + ret = __ldcw(a) != 0;
343 +- mb();
344 +
345 + return ret;
346 + }
347 +diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
348 +index f68eedc72484..dd44022c3ae3 100644
349 +--- a/arch/parisc/kernel/syscall.S
350 ++++ b/arch/parisc/kernel/syscall.S
351 +@@ -627,12 +627,12 @@ cas_action:
352 + stw %r1, 4(%sr2,%r20)
353 + #endif
354 + /* The load and store could fail */
355 +-1: ldw,ma 0(%r26), %r28
356 ++1: ldw 0(%r26), %r28
357 + sub,<> %r28, %r25, %r0
358 +-2: stw,ma %r24, 0(%r26)
359 ++2: stw %r24, 0(%r26)
360 + /* Free lock */
361 + sync
362 +- stw,ma %r20, 0(%sr2,%r20)
363 ++ stw %r20, 0(%sr2,%r20)
364 + #if ENABLE_LWS_DEBUG
365 + /* Clear thread register indicator */
366 + stw %r0, 4(%sr2,%r20)
367 +@@ -796,30 +796,30 @@ cas2_action:
368 + ldo 1(%r0),%r28
369 +
370 + /* 8bit CAS */
371 +-13: ldb,ma 0(%r26), %r29
372 ++13: ldb 0(%r26), %r29
373 + sub,= %r29, %r25, %r0
374 + b,n cas2_end
375 +-14: stb,ma %r24, 0(%r26)
376 ++14: stb %r24, 0(%r26)
377 + b cas2_end
378 + copy %r0, %r28
379 + nop
380 + nop
381 +
382 + /* 16bit CAS */
383 +-15: ldh,ma 0(%r26), %r29
384 ++15: ldh 0(%r26), %r29
385 + sub,= %r29, %r25, %r0
386 + b,n cas2_end
387 +-16: sth,ma %r24, 0(%r26)
388 ++16: sth %r24, 0(%r26)
389 + b cas2_end
390 + copy %r0, %r28
391 + nop
392 + nop
393 +
394 + /* 32bit CAS */
395 +-17: ldw,ma 0(%r26), %r29
396 ++17: ldw 0(%r26), %r29
397 + sub,= %r29, %r25, %r0
398 + b,n cas2_end
399 +-18: stw,ma %r24, 0(%r26)
400 ++18: stw %r24, 0(%r26)
401 + b cas2_end
402 + copy %r0, %r28
403 + nop
404 +@@ -827,10 +827,10 @@ cas2_action:
405 +
406 + /* 64bit CAS */
407 + #ifdef CONFIG_64BIT
408 +-19: ldd,ma 0(%r26), %r29
409 ++19: ldd 0(%r26), %r29
410 + sub,*= %r29, %r25, %r0
411 + b,n cas2_end
412 +-20: std,ma %r24, 0(%r26)
413 ++20: std %r24, 0(%r26)
414 + copy %r0, %r28
415 + #else
416 + /* Compare first word */
417 +@@ -849,7 +849,7 @@ cas2_action:
418 + cas2_end:
419 + /* Free lock */
420 + sync
421 +- stw,ma %r20, 0(%sr2,%r20)
422 ++ stw %r20, 0(%sr2,%r20)
423 + /* Enable interrupts */
424 + ssm PSW_SM_I, %r0
425 + /* Return to userspace, set no error */
426 +diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c
427 +index 1ba2fd73852d..0f0c06ab414b 100644
428 +--- a/drivers/dma/k3dma.c
429 ++++ b/drivers/dma/k3dma.c
430 +@@ -660,7 +660,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct of_phandle_args *dma_spec,
431 + struct k3_dma_dev *d = ofdma->of_dma_data;
432 + unsigned int request = dma_spec->args[0];
433 +
434 +- if (request > d->dma_requests)
435 ++ if (request >= d->dma_requests)
436 + return NULL;
437 +
438 + return dma_get_slave_channel(&(d->chans[request].vc.chan));
439 +diff --git a/drivers/gpu/drm/armada/armada_hw.h b/drivers/gpu/drm/armada/armada_hw.h
440 +index 27319a8335e2..345dc4d0851e 100644
441 +--- a/drivers/gpu/drm/armada/armada_hw.h
442 ++++ b/drivers/gpu/drm/armada/armada_hw.h
443 +@@ -160,6 +160,7 @@ enum {
444 + CFG_ALPHAM_GRA = 0x1 << 16,
445 + CFG_ALPHAM_CFG = 0x2 << 16,
446 + CFG_ALPHA_MASK = 0xff << 8,
447 ++#define CFG_ALPHA(x) ((x) << 8)
448 + CFG_PIXCMD_MASK = 0xff,
449 + };
450 +
451 +diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c
452 +index 5c22b380f8f3..f8a69ec63550 100644
453 +--- a/drivers/gpu/drm/armada/armada_overlay.c
454 ++++ b/drivers/gpu/drm/armada/armada_overlay.c
455 +@@ -27,6 +27,7 @@ struct armada_ovl_plane_properties {
456 + uint16_t contrast;
457 + uint16_t saturation;
458 + uint32_t colorkey_mode;
459 ++ uint32_t colorkey_enable;
460 + };
461 +
462 + struct armada_ovl_plane {
463 +@@ -62,11 +63,13 @@ armada_ovl_update_attr(struct armada_ovl_plane_properties *prop,
464 + writel_relaxed(0x00002000, dcrtc->base + LCD_SPU_CBSH_HUE);
465 +
466 + spin_lock_irq(&dcrtc->irq_lock);
467 +- armada_updatel(prop->colorkey_mode | CFG_ALPHAM_GRA,
468 +- CFG_CKMODE_MASK | CFG_ALPHAM_MASK | CFG_ALPHA_MASK,
469 +- dcrtc->base + LCD_SPU_DMA_CTRL1);
470 +-
471 +- armada_updatel(ADV_GRACOLORKEY, 0, dcrtc->base + LCD_SPU_ADV_REG);
472 ++ armada_updatel(prop->colorkey_mode,
473 ++ CFG_CKMODE_MASK | CFG_ALPHAM_MASK | CFG_ALPHA_MASK,
474 ++ dcrtc->base + LCD_SPU_DMA_CTRL1);
475 ++ if (dcrtc->variant->has_spu_adv_reg)
476 ++ armada_updatel(prop->colorkey_enable,
477 ++ ADV_GRACOLORKEY | ADV_VIDCOLORKEY,
478 ++ dcrtc->base + LCD_SPU_ADV_REG);
479 + spin_unlock_irq(&dcrtc->irq_lock);
480 + }
481 +
482 +@@ -339,8 +342,17 @@ static int armada_ovl_plane_set_property(struct drm_plane *plane,
483 + dplane->prop.colorkey_vb |= K2B(val);
484 + update_attr = true;
485 + } else if (property == priv->colorkey_mode_prop) {
486 +- dplane->prop.colorkey_mode &= ~CFG_CKMODE_MASK;
487 +- dplane->prop.colorkey_mode |= CFG_CKMODE(val);
488 ++ if (val == CKMODE_DISABLE) {
489 ++ dplane->prop.colorkey_mode =
490 ++ CFG_CKMODE(CKMODE_DISABLE) |
491 ++ CFG_ALPHAM_CFG | CFG_ALPHA(255);
492 ++ dplane->prop.colorkey_enable = 0;
493 ++ } else {
494 ++ dplane->prop.colorkey_mode =
495 ++ CFG_CKMODE(val) |
496 ++ CFG_ALPHAM_GRA | CFG_ALPHA(0);
497 ++ dplane->prop.colorkey_enable = ADV_GRACOLORKEY;
498 ++ }
499 + update_attr = true;
500 + } else if (property == priv->brightness_prop) {
501 + dplane->prop.brightness = val - 256;
502 +@@ -469,7 +481,9 @@ int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs)
503 + dplane->prop.colorkey_yr = 0xfefefe00;
504 + dplane->prop.colorkey_ug = 0x01010100;
505 + dplane->prop.colorkey_vb = 0x01010100;
506 +- dplane->prop.colorkey_mode = CFG_CKMODE(CKMODE_RGB);
507 ++ dplane->prop.colorkey_mode = CFG_CKMODE(CKMODE_RGB) |
508 ++ CFG_ALPHAM_GRA | CFG_ALPHA(0);
509 ++ dplane->prop.colorkey_enable = ADV_GRACOLORKEY;
510 + dplane->prop.brightness = 0;
511 + dplane->prop.contrast = 0x4000;
512 + dplane->prop.saturation = 0x4000;
513 +diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
514 +index 34cebcdc2fc4..9cae5f69b07c 100644
515 +--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
516 ++++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
517 +@@ -190,7 +190,7 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win,
518 + unsigned long val;
519 +
520 + val = readl(ctx->addr + DECON_WINCONx(win));
521 +- val &= ~WINCONx_BPPMODE_MASK;
522 ++ val &= WINCONx_ENWIN_F;
523 +
524 + switch (fb->pixel_format) {
525 + case DRM_FORMAT_XRGB1555:
526 +@@ -278,8 +278,8 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,
527 + COORDINATE_Y(plane->crtc_y + plane->crtc_h - 1);
528 + writel(val, ctx->addr + DECON_VIDOSDxB(win));
529 +
530 +- val = VIDOSD_Wx_ALPHA_R_F(0x0) | VIDOSD_Wx_ALPHA_G_F(0x0) |
531 +- VIDOSD_Wx_ALPHA_B_F(0x0);
532 ++ val = VIDOSD_Wx_ALPHA_R_F(0xff) | VIDOSD_Wx_ALPHA_G_F(0xff) |
533 ++ VIDOSD_Wx_ALPHA_B_F(0xff);
534 + writel(val, ctx->addr + DECON_VIDOSDxC(win));
535 +
536 + val = VIDOSD_Wx_ALPHA_R_F(0x0) | VIDOSD_Wx_ALPHA_G_F(0x0) |
537 +diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
538 +index 11b87d2a7913..ba69d1c72221 100644
539 +--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
540 ++++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
541 +@@ -526,21 +526,25 @@ static int gsc_src_set_fmt(struct device *dev, u32 fmt)
542 + GSC_IN_CHROMA_ORDER_CRCB);
543 + break;
544 + case DRM_FORMAT_NV21:
545 ++ cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV420_2P);
546 ++ break;
547 + case DRM_FORMAT_NV61:
548 +- cfg |= (GSC_IN_CHROMA_ORDER_CRCB |
549 +- GSC_IN_YUV420_2P);
550 ++ cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV422_2P);
551 + break;
552 + case DRM_FORMAT_YUV422:
553 + cfg |= GSC_IN_YUV422_3P;
554 + break;
555 + case DRM_FORMAT_YUV420:
556 ++ cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV420_3P);
557 ++ break;
558 + case DRM_FORMAT_YVU420:
559 +- cfg |= GSC_IN_YUV420_3P;
560 ++ cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV420_3P);
561 + break;
562 + case DRM_FORMAT_NV12:
563 ++ cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV420_2P);
564 ++ break;
565 + case DRM_FORMAT_NV16:
566 +- cfg |= (GSC_IN_CHROMA_ORDER_CBCR |
567 +- GSC_IN_YUV420_2P);
568 ++ cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV422_2P);
569 + break;
570 + default:
571 + dev_err(ippdrv->dev, "invalid target yuv order 0x%x.\n", fmt);
572 +@@ -800,18 +804,25 @@ static int gsc_dst_set_fmt(struct device *dev, u32 fmt)
573 + GSC_OUT_CHROMA_ORDER_CRCB);
574 + break;
575 + case DRM_FORMAT_NV21:
576 +- case DRM_FORMAT_NV61:
577 + cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_2P);
578 + break;
579 ++ case DRM_FORMAT_NV61:
580 ++ cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV422_2P);
581 ++ break;
582 + case DRM_FORMAT_YUV422:
583 ++ cfg |= GSC_OUT_YUV422_3P;
584 ++ break;
585 + case DRM_FORMAT_YUV420:
586 ++ cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV420_3P);
587 ++ break;
588 + case DRM_FORMAT_YVU420:
589 +- cfg |= GSC_OUT_YUV420_3P;
590 ++ cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_3P);
591 + break;
592 + case DRM_FORMAT_NV12:
593 ++ cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV420_2P);
594 ++ break;
595 + case DRM_FORMAT_NV16:
596 +- cfg |= (GSC_OUT_CHROMA_ORDER_CBCR |
597 +- GSC_OUT_YUV420_2P);
598 ++ cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV422_2P);
599 + break;
600 + default:
601 + dev_err(ippdrv->dev, "invalid target yuv order 0x%x.\n", fmt);
602 +diff --git a/drivers/gpu/drm/exynos/regs-gsc.h b/drivers/gpu/drm/exynos/regs-gsc.h
603 +index 9ad592707aaf..ade10966d6af 100644
604 +--- a/drivers/gpu/drm/exynos/regs-gsc.h
605 ++++ b/drivers/gpu/drm/exynos/regs-gsc.h
606 +@@ -138,6 +138,7 @@
607 + #define GSC_OUT_YUV420_3P (3 << 4)
608 + #define GSC_OUT_YUV422_1P (4 << 4)
609 + #define GSC_OUT_YUV422_2P (5 << 4)
610 ++#define GSC_OUT_YUV422_3P (6 << 4)
611 + #define GSC_OUT_YUV444 (7 << 4)
612 + #define GSC_OUT_TILE_TYPE_MASK (1 << 2)
613 + #define GSC_OUT_TILE_C_16x8 (0 << 2)
614 +diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
615 +index 495c279da200..ae560f5977fc 100644
616 +--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
617 ++++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
618 +@@ -602,7 +602,7 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli,
619 + struct nouveau_bo *nvbo;
620 + uint32_t data;
621 +
622 +- if (unlikely(r->bo_index > req->nr_buffers)) {
623 ++ if (unlikely(r->bo_index >= req->nr_buffers)) {
624 + NV_PRINTK(err, cli, "reloc bo index invalid\n");
625 + ret = -EINVAL;
626 + break;
627 +@@ -612,7 +612,7 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli,
628 + if (b->presumed.valid)
629 + continue;
630 +
631 +- if (unlikely(r->reloc_bo_index > req->nr_buffers)) {
632 ++ if (unlikely(r->reloc_bo_index >= req->nr_buffers)) {
633 + NV_PRINTK(err, cli, "reloc container bo index invalid\n");
634 + ret = -EINVAL;
635 + break;
636 +diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
637 +index b62c50d1b1e4..b184956bd430 100644
638 +--- a/drivers/hid/wacom_wac.c
639 ++++ b/drivers/hid/wacom_wac.c
640 +@@ -2487,8 +2487,14 @@ void wacom_setup_device_quirks(struct wacom *wacom)
641 + if (features->type >= INTUOSHT && features->type <= BAMBOO_PT)
642 + features->device_type |= WACOM_DEVICETYPE_PAD;
643 +
644 +- features->x_max = 4096;
645 +- features->y_max = 4096;
646 ++ if (features->type == INTUOSHT2) {
647 ++ features->x_max = features->x_max / 10;
648 ++ features->y_max = features->y_max / 10;
649 ++ }
650 ++ else {
651 ++ features->x_max = 4096;
652 ++ features->y_max = 4096;
653 ++ }
654 + }
655 + else if (features->pktlen == WACOM_PKGLEN_BBTOUCH) {
656 + features->device_type |= WACOM_DEVICETYPE_PAD;
657 +diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
658 +index a4abf7dc9576..cf1b57a054d0 100644
659 +--- a/drivers/i2c/busses/i2c-imx.c
660 ++++ b/drivers/i2c/busses/i2c-imx.c
661 +@@ -677,9 +677,6 @@ static int i2c_imx_dma_read(struct imx_i2c_struct *i2c_imx,
662 + struct imx_i2c_dma *dma = i2c_imx->dma;
663 + struct device *dev = &i2c_imx->adapter.dev;
664 +
665 +- temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
666 +- temp |= I2CR_DMAEN;
667 +- imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
668 +
669 + dma->chan_using = dma->chan_rx;
670 + dma->dma_transfer_dir = DMA_DEV_TO_MEM;
671 +@@ -792,6 +789,7 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bo
672 + int i, result;
673 + unsigned int temp;
674 + int block_data = msgs->flags & I2C_M_RECV_LEN;
675 ++ int use_dma = i2c_imx->dma && msgs->len >= DMA_THRESHOLD && !block_data;
676 +
677 + dev_dbg(&i2c_imx->adapter.dev,
678 + "<%s> write slave address: addr=0x%x\n",
679 +@@ -818,12 +816,14 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bo
680 + */
681 + if ((msgs->len - 1) || block_data)
682 + temp &= ~I2CR_TXAK;
683 ++ if (use_dma)
684 ++ temp |= I2CR_DMAEN;
685 + imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
686 + imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR); /* dummy read */
687 +
688 + dev_dbg(&i2c_imx->adapter.dev, "<%s> read data\n", __func__);
689 +
690 +- if (i2c_imx->dma && msgs->len >= DMA_THRESHOLD && !block_data)
691 ++ if (use_dma)
692 + return i2c_imx_dma_read(i2c_imx, msgs, is_lastmsg);
693 +
694 + /* read data */
695 +diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
696 +index 7b6acedc89c1..8a731bdd268e 100644
697 +--- a/drivers/md/raid10.c
698 ++++ b/drivers/md/raid10.c
699 +@@ -3691,6 +3691,13 @@ static int run(struct mddev *mddev)
700 + disk->rdev->saved_raid_disk < 0)
701 + conf->fullsync = 1;
702 + }
703 ++
704 ++ if (disk->replacement &&
705 ++ !test_bit(In_sync, &disk->replacement->flags) &&
706 ++ disk->replacement->saved_raid_disk < 0) {
707 ++ conf->fullsync = 1;
708 ++ }
709 ++
710 + disk->recovery_disabled = mddev->recovery_disabled - 1;
711 + }
712 +
713 +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
714 +index b5e64b02200c..1ea068815419 100644
715 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
716 ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
717 +@@ -1634,6 +1634,7 @@ struct bnx2x {
718 + struct link_vars link_vars;
719 + u32 link_cnt;
720 + struct bnx2x_link_report_data last_reported_link;
721 ++ bool force_link_down;
722 +
723 + struct mdio_if_info mdio;
724 +
725 +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
726 +index 949a82458a29..ebc4518d598a 100644
727 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
728 ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
729 +@@ -1277,6 +1277,11 @@ void __bnx2x_link_report(struct bnx2x *bp)
730 + {
731 + struct bnx2x_link_report_data cur_data;
732 +
733 ++ if (bp->force_link_down) {
734 ++ bp->link_vars.link_up = 0;
735 ++ return;
736 ++ }
737 ++
738 + /* reread mf_cfg */
739 + if (IS_PF(bp) && !CHIP_IS_E1(bp))
740 + bnx2x_read_mf_cfg(bp);
741 +@@ -2840,6 +2845,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
742 + bp->pending_max = 0;
743 + }
744 +
745 ++ bp->force_link_down = false;
746 + if (bp->port.pmf) {
747 + rc = bnx2x_initial_phy_init(bp, load_mode);
748 + if (rc)
749 +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
750 +index 8ddb68a3fdb6..403fa8d98aa3 100644
751 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
752 ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
753 +@@ -10222,6 +10222,12 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work)
754 + bp->sp_rtnl_state = 0;
755 + smp_mb();
756 +
757 ++ /* Immediately indicate link as down */
758 ++ bp->link_vars.link_up = 0;
759 ++ bp->force_link_down = true;
760 ++ netif_carrier_off(bp->dev);
761 ++ BNX2X_ERR("Indicating link is down due to Tx-timeout\n");
762 ++
763 + bnx2x_nic_unload(bp, UNLOAD_NORMAL, true);
764 + bnx2x_nic_load(bp, LOAD_NORMAL);
765 +
766 +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
767 +index 9904d768a20a..4ffacafddacb 100644
768 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
769 ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
770 +@@ -4591,7 +4591,7 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
771 + rc = bnxt_request_irq(bp);
772 + if (rc) {
773 + netdev_err(bp->dev, "bnxt_request_irq err: %x\n", rc);
774 +- goto open_err;
775 ++ goto open_err_irq;
776 + }
777 + }
778 +
779 +@@ -4629,6 +4629,8 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
780 +
781 + open_err:
782 + bnxt_disable_napi(bp);
783 ++
784 ++open_err_irq:
785 + bnxt_del_napi(bp);
786 +
787 + open_err_free_mem:
788 +diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
789 +index 090e00650601..a3e1498ca67c 100644
790 +--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
791 ++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
792 +@@ -338,7 +338,7 @@ static void dcb_tx_queue_prio_enable(struct net_device *dev, int enable)
793 + "Can't %s DCB Priority on port %d, TX Queue %d: err=%d\n",
794 + enable ? "set" : "unset", pi->port_id, i, -err);
795 + else
796 +- txq->dcb_prio = value;
797 ++ txq->dcb_prio = enable ? value : 0;
798 + }
799 + }
800 + #endif /* CONFIG_CHELSIO_T4_DCB */
801 +diff --git a/drivers/net/ethernet/cisco/enic/enic_clsf.c b/drivers/net/ethernet/cisco/enic/enic_clsf.c
802 +index 3c677ed3c29e..4d9014d5b36d 100644
803 +--- a/drivers/net/ethernet/cisco/enic/enic_clsf.c
804 ++++ b/drivers/net/ethernet/cisco/enic/enic_clsf.c
805 +@@ -78,7 +78,6 @@ void enic_rfs_flw_tbl_init(struct enic *enic)
806 + enic->rfs_h.max = enic->config.num_arfs;
807 + enic->rfs_h.free = enic->rfs_h.max;
808 + enic->rfs_h.toclean = 0;
809 +- enic_rfs_timer_start(enic);
810 + }
811 +
812 + void enic_rfs_flw_tbl_free(struct enic *enic)
813 +@@ -87,7 +86,6 @@ void enic_rfs_flw_tbl_free(struct enic *enic)
814 +
815 + enic_rfs_timer_stop(enic);
816 + spin_lock_bh(&enic->rfs_h.lock);
817 +- enic->rfs_h.free = 0;
818 + for (i = 0; i < (1 << ENIC_RFS_FLW_BITSHIFT); i++) {
819 + struct hlist_head *hhead;
820 + struct hlist_node *tmp;
821 +@@ -98,6 +96,7 @@ void enic_rfs_flw_tbl_free(struct enic *enic)
822 + enic_delfltr(enic, n->fltr_id);
823 + hlist_del(&n->node);
824 + kfree(n);
825 ++ enic->rfs_h.free++;
826 + }
827 + }
828 + spin_unlock_bh(&enic->rfs_h.lock);
829 +diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
830 +index 029fa5bee520..8390597aecb8 100644
831 +--- a/drivers/net/ethernet/cisco/enic/enic_main.c
832 ++++ b/drivers/net/ethernet/cisco/enic/enic_main.c
833 +@@ -1760,7 +1760,7 @@ static int enic_open(struct net_device *netdev)
834 + vnic_intr_unmask(&enic->intr[i]);
835 +
836 + enic_notify_timer_start(enic);
837 +- enic_rfs_flw_tbl_init(enic);
838 ++ enic_rfs_timer_start(enic);
839 +
840 + return 0;
841 +
842 +@@ -2694,6 +2694,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
843 + enic->notify_timer.function = enic_notify_timer;
844 + enic->notify_timer.data = (unsigned long)enic;
845 +
846 ++ enic_rfs_flw_tbl_init(enic);
847 + enic_set_rx_coal_setting(enic);
848 + INIT_WORK(&enic->reset, enic_reset);
849 + INIT_WORK(&enic->tx_hang_reset, enic_tx_hang_reset);
850 +diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
851 +index 105dd00ddc1a..cd2afe92f1da 100644
852 +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
853 ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
854 +@@ -1814,7 +1814,12 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
855 + if (enable_addr != 0)
856 + rar_high |= IXGBE_RAH_AV;
857 +
858 ++ /* Record lower 32 bits of MAC address and then make
859 ++ * sure that write is flushed to hardware before writing
860 ++ * the upper 16 bits and setting the valid bit.
861 ++ */
862 + IXGBE_WRITE_REG(hw, IXGBE_RAL(index), rar_low);
863 ++ IXGBE_WRITE_FLUSH(hw);
864 + IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
865 +
866 + return 0;
867 +@@ -1846,8 +1851,13 @@ s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index)
868 + rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(index));
869 + rar_high &= ~(0x0000FFFF | IXGBE_RAH_AV);
870 +
871 +- IXGBE_WRITE_REG(hw, IXGBE_RAL(index), 0);
872 ++ /* Clear the address valid bit and upper 16 bits of the address
873 ++ * before clearing the lower bits. This way we aren't updating
874 ++ * a live filter.
875 ++ */
876 + IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
877 ++ IXGBE_WRITE_FLUSH(hw);
878 ++ IXGBE_WRITE_REG(hw, IXGBE_RAL(index), 0);
879 +
880 + /* clear VMDq pool/queue selection for this RAR */
881 + hw->mac.ops.clear_vmdq(hw, index, IXGBE_CLEAR_VMDQ_ALL);
882 +diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
883 +index 688b6da5a9bb..35e1468d8196 100644
884 +--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
885 ++++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
886 +@@ -461,8 +461,16 @@ static irqreturn_t qed_single_int(int irq, void *dev_instance)
887 + /* Fastpath interrupts */
888 + for (j = 0; j < 64; j++) {
889 + if ((0x2ULL << j) & status) {
890 +- hwfn->simd_proto_handler[j].func(
891 +- hwfn->simd_proto_handler[j].token);
892 ++ struct qed_simd_fp_handler *p_handler =
893 ++ &hwfn->simd_proto_handler[j];
894 ++
895 ++ if (p_handler->func)
896 ++ p_handler->func(p_handler->token);
897 ++ else
898 ++ DP_NOTICE(hwfn,
899 ++ "Not calling fastpath handler as it is NULL [handler #%d, status 0x%llx]\n",
900 ++ j, status);
901 ++
902 + status &= ~(0x2ULL << j);
903 + rc = IRQ_HANDLED;
904 + }
905 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
906 +index ccbb04503b27..b53a18e365c2 100644
907 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
908 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c
909 +@@ -1128,6 +1128,8 @@ static ssize_t qlcnic_83xx_sysfs_flash_write_handler(struct file *filp,
910 + struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
911 +
912 + ret = kstrtoul(buf, 16, &data);
913 ++ if (ret)
914 ++ return ret;
915 +
916 + switch (data) {
917 + case QLC_83XX_FLASH_SECTOR_ERASE_CMD:
918 +diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
919 +index c90ae4d4be7d..7886a8a5b55b 100644
920 +--- a/drivers/net/ethernet/qualcomm/qca_spi.c
921 ++++ b/drivers/net/ethernet/qualcomm/qca_spi.c
922 +@@ -635,7 +635,7 @@ qcaspi_netdev_open(struct net_device *dev)
923 + return ret;
924 + }
925 +
926 +- netif_start_queue(qca->net_dev);
927 ++ /* SPI thread takes care of TX queue */
928 +
929 + return 0;
930 + }
931 +@@ -739,6 +739,9 @@ qcaspi_netdev_tx_timeout(struct net_device *dev)
932 + qca->net_dev->stats.tx_errors++;
933 + /* Trigger tx queue flush and QCA7000 reset */
934 + qca->sync = QCASPI_SYNC_UNKNOWN;
935 ++
936 ++ if (qca->spi_thread)
937 ++ wake_up_process(qca->spi_thread);
938 + }
939 +
940 + static int
941 +@@ -865,22 +868,22 @@ qca_spi_probe(struct spi_device *spi)
942 +
943 + if ((qcaspi_clkspeed < QCASPI_CLK_SPEED_MIN) ||
944 + (qcaspi_clkspeed > QCASPI_CLK_SPEED_MAX)) {
945 +- dev_info(&spi->dev, "Invalid clkspeed: %d\n",
946 +- qcaspi_clkspeed);
947 ++ dev_err(&spi->dev, "Invalid clkspeed: %d\n",
948 ++ qcaspi_clkspeed);
949 + return -EINVAL;
950 + }
951 +
952 + if ((qcaspi_burst_len < QCASPI_BURST_LEN_MIN) ||
953 + (qcaspi_burst_len > QCASPI_BURST_LEN_MAX)) {
954 +- dev_info(&spi->dev, "Invalid burst len: %d\n",
955 +- qcaspi_burst_len);
956 ++ dev_err(&spi->dev, "Invalid burst len: %d\n",
957 ++ qcaspi_burst_len);
958 + return -EINVAL;
959 + }
960 +
961 + if ((qcaspi_pluggable < QCASPI_PLUGGABLE_MIN) ||
962 + (qcaspi_pluggable > QCASPI_PLUGGABLE_MAX)) {
963 +- dev_info(&spi->dev, "Invalid pluggable: %d\n",
964 +- qcaspi_pluggable);
965 ++ dev_err(&spi->dev, "Invalid pluggable: %d\n",
966 ++ qcaspi_pluggable);
967 + return -EINVAL;
968 + }
969 +
970 +@@ -941,8 +944,8 @@ qca_spi_probe(struct spi_device *spi)
971 + }
972 +
973 + if (register_netdev(qcaspi_devs)) {
974 +- dev_info(&spi->dev, "Unable to register net device %s\n",
975 +- qcaspi_devs->name);
976 ++ dev_err(&spi->dev, "Unable to register net device %s\n",
977 ++ qcaspi_devs->name);
978 + free_netdev(qcaspi_devs);
979 + return -EFAULT;
980 + }
981 +diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
982 +index 33bd3b902304..6be315303d61 100644
983 +--- a/drivers/net/ethernet/ti/davinci_emac.c
984 ++++ b/drivers/net/ethernet/ti/davinci_emac.c
985 +@@ -1517,6 +1517,10 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd)
986 +
987 + static int match_first_device(struct device *dev, void *data)
988 + {
989 ++ if (dev->parent && dev->parent->of_node)
990 ++ return of_device_is_compatible(dev->parent->of_node,
991 ++ "ti,davinci_mdio");
992 ++
993 + return !strncmp(dev_name(dev), "davinci_mdio", 12);
994 + }
995 +
996 +diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
997 +index d95a50ae996d..8748e8c9ce96 100644
998 +--- a/drivers/net/hamradio/bpqether.c
999 ++++ b/drivers/net/hamradio/bpqether.c
1000 +@@ -89,10 +89,6 @@
1001 + static const char banner[] __initconst = KERN_INFO \
1002 + "AX.25: bpqether driver version 004\n";
1003 +
1004 +-static char bcast_addr[6]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
1005 +-
1006 +-static char bpq_eth_addr[6];
1007 +-
1008 + static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
1009 + static int bpq_device_event(struct notifier_block *, unsigned long, void *);
1010 +
1011 +@@ -515,8 +511,8 @@ static int bpq_new_device(struct net_device *edev)
1012 + bpq->ethdev = edev;
1013 + bpq->axdev = ndev;
1014 +
1015 +- memcpy(bpq->dest_addr, bcast_addr, sizeof(bpq_eth_addr));
1016 +- memcpy(bpq->acpt_addr, bcast_addr, sizeof(bpq_eth_addr));
1017 ++ eth_broadcast_addr(bpq->dest_addr);
1018 ++ eth_broadcast_addr(bpq->acpt_addr);
1019 +
1020 + err = register_netdevice(ndev);
1021 + if (err)
1022 +diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
1023 +index 0fbbba7a0cae..f72c2967ae82 100644
1024 +--- a/drivers/net/ieee802154/at86rf230.c
1025 ++++ b/drivers/net/ieee802154/at86rf230.c
1026 +@@ -932,7 +932,7 @@ at86rf230_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
1027 + static int
1028 + at86rf230_ed(struct ieee802154_hw *hw, u8 *level)
1029 + {
1030 +- BUG_ON(!level);
1031 ++ WARN_ON(!level);
1032 + *level = 0xbe;
1033 + return 0;
1034 + }
1035 +@@ -1108,8 +1108,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
1036 + if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
1037 + u16 addr = le16_to_cpu(filt->short_addr);
1038 +
1039 +- dev_vdbg(&lp->spi->dev,
1040 +- "at86rf230_set_hw_addr_filt called for saddr\n");
1041 ++ dev_vdbg(&lp->spi->dev, "%s called for saddr\n", __func__);
1042 + __at86rf230_write(lp, RG_SHORT_ADDR_0, addr);
1043 + __at86rf230_write(lp, RG_SHORT_ADDR_1, addr >> 8);
1044 + }
1045 +@@ -1117,8 +1116,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
1046 + if (changed & IEEE802154_AFILT_PANID_CHANGED) {
1047 + u16 pan = le16_to_cpu(filt->pan_id);
1048 +
1049 +- dev_vdbg(&lp->spi->dev,
1050 +- "at86rf230_set_hw_addr_filt called for pan id\n");
1051 ++ dev_vdbg(&lp->spi->dev, "%s called for pan id\n", __func__);
1052 + __at86rf230_write(lp, RG_PAN_ID_0, pan);
1053 + __at86rf230_write(lp, RG_PAN_ID_1, pan >> 8);
1054 + }
1055 +@@ -1127,15 +1125,13 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
1056 + u8 i, addr[8];
1057 +
1058 + memcpy(addr, &filt->ieee_addr, 8);
1059 +- dev_vdbg(&lp->spi->dev,
1060 +- "at86rf230_set_hw_addr_filt called for IEEE addr\n");
1061 ++ dev_vdbg(&lp->spi->dev, "%s called for IEEE addr\n", __func__);
1062 + for (i = 0; i < 8; i++)
1063 + __at86rf230_write(lp, RG_IEEE_ADDR_0 + i, addr[i]);
1064 + }
1065 +
1066 + if (changed & IEEE802154_AFILT_PANC_CHANGED) {
1067 +- dev_vdbg(&lp->spi->dev,
1068 +- "at86rf230_set_hw_addr_filt called for panc change\n");
1069 ++ dev_vdbg(&lp->spi->dev, "%s called for panc change\n", __func__);
1070 + if (filt->pan_coord)
1071 + at86rf230_write_subreg(lp, SR_AACK_I_AM_COORD, 1);
1072 + else
1073 +@@ -1239,7 +1235,6 @@ at86rf230_set_cca_mode(struct ieee802154_hw *hw,
1074 + return at86rf230_write_subreg(lp, SR_CCA_MODE, val);
1075 + }
1076 +
1077 +-
1078 + static int
1079 + at86rf230_set_cca_ed_level(struct ieee802154_hw *hw, s32 mbm)
1080 + {
1081 +diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
1082 +index 43617ded3773..91de25c53274 100644
1083 +--- a/drivers/net/ieee802154/fakelb.c
1084 ++++ b/drivers/net/ieee802154/fakelb.c
1085 +@@ -49,7 +49,7 @@ struct fakelb_phy {
1086 +
1087 + static int fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
1088 + {
1089 +- BUG_ON(!level);
1090 ++ WARN_ON(!level);
1091 + *level = 0xbe;
1092 +
1093 + return 0;
1094 +diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
1095 +index 39672984dde1..58b1e18fdd64 100644
1096 +--- a/drivers/net/usb/rtl8150.c
1097 ++++ b/drivers/net/usb/rtl8150.c
1098 +@@ -681,7 +681,7 @@ static void rtl8150_set_multicast(struct net_device *netdev)
1099 + (netdev->flags & IFF_ALLMULTI)) {
1100 + rx_creg &= 0xfffe;
1101 + rx_creg |= 0x0002;
1102 +- dev_info(&netdev->dev, "%s: allmulti set\n", netdev->name);
1103 ++ dev_dbg(&netdev->dev, "%s: allmulti set\n", netdev->name);
1104 + } else {
1105 + /* ~RX_MULTICAST, ~RX_PROMISCUOUS */
1106 + rx_creg &= 0x00fc;
1107 +diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
1108 +index 7337e6c0e126..478937418a33 100644
1109 +--- a/drivers/net/usb/smsc75xx.c
1110 ++++ b/drivers/net/usb/smsc75xx.c
1111 +@@ -81,6 +81,9 @@ static bool turbo_mode = true;
1112 + module_param(turbo_mode, bool, 0644);
1113 + MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
1114 +
1115 ++static int smsc75xx_link_ok_nopm(struct usbnet *dev);
1116 ++static int smsc75xx_phy_gig_workaround(struct usbnet *dev);
1117 ++
1118 + static int __must_check __smsc75xx_read_reg(struct usbnet *dev, u32 index,
1119 + u32 *data, int in_pm)
1120 + {
1121 +@@ -840,6 +843,9 @@ static int smsc75xx_phy_initialize(struct usbnet *dev)
1122 + return -EIO;
1123 + }
1124 +
1125 ++ /* phy workaround for gig link */
1126 ++ smsc75xx_phy_gig_workaround(dev);
1127 ++
1128 + smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
1129 + ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP |
1130 + ADVERTISE_PAUSE_ASYM);
1131 +@@ -978,6 +984,62 @@ static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm)
1132 + return -EIO;
1133 + }
1134 +
1135 ++static int smsc75xx_phy_gig_workaround(struct usbnet *dev)
1136 ++{
1137 ++ struct mii_if_info *mii = &dev->mii;
1138 ++ int ret = 0, timeout = 0;
1139 ++ u32 buf, link_up = 0;
1140 ++
1141 ++ /* Set the phy in Gig loopback */
1142 ++ smsc75xx_mdio_write(dev->net, mii->phy_id, MII_BMCR, 0x4040);
1143 ++
1144 ++ /* Wait for the link up */
1145 ++ do {
1146 ++ link_up = smsc75xx_link_ok_nopm(dev);
1147 ++ usleep_range(10000, 20000);
1148 ++ timeout++;
1149 ++ } while ((!link_up) && (timeout < 1000));
1150 ++
1151 ++ if (timeout >= 1000) {
1152 ++ netdev_warn(dev->net, "Timeout waiting for PHY link up\n");
1153 ++ return -EIO;
1154 ++ }
1155 ++
1156 ++ /* phy reset */
1157 ++ ret = smsc75xx_read_reg(dev, PMT_CTL, &buf);
1158 ++ if (ret < 0) {
1159 ++ netdev_warn(dev->net, "Failed to read PMT_CTL: %d\n", ret);
1160 ++ return ret;
1161 ++ }
1162 ++
1163 ++ buf |= PMT_CTL_PHY_RST;
1164 ++
1165 ++ ret = smsc75xx_write_reg(dev, PMT_CTL, buf);
1166 ++ if (ret < 0) {
1167 ++ netdev_warn(dev->net, "Failed to write PMT_CTL: %d\n", ret);
1168 ++ return ret;
1169 ++ }
1170 ++
1171 ++ timeout = 0;
1172 ++ do {
1173 ++ usleep_range(10000, 20000);
1174 ++ ret = smsc75xx_read_reg(dev, PMT_CTL, &buf);
1175 ++ if (ret < 0) {
1176 ++ netdev_warn(dev->net, "Failed to read PMT_CTL: %d\n",
1177 ++ ret);
1178 ++ return ret;
1179 ++ }
1180 ++ timeout++;
1181 ++ } while ((buf & PMT_CTL_PHY_RST) && (timeout < 100));
1182 ++
1183 ++ if (timeout >= 100) {
1184 ++ netdev_warn(dev->net, "timeout waiting for PHY Reset\n");
1185 ++ return -EIO;
1186 ++ }
1187 ++
1188 ++ return 0;
1189 ++}
1190 ++
1191 + static int smsc75xx_reset(struct usbnet *dev)
1192 + {
1193 + struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
1194 +diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
1195 +index 7e74ac3ad815..35f62b00f1df 100644
1196 +--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
1197 ++++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
1198 +@@ -4291,6 +4291,13 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus)
1199 + brcmf_dbg(TRACE, "Enter\n");
1200 +
1201 + if (bus) {
1202 ++ /* Stop watchdog task */
1203 ++ if (bus->watchdog_tsk) {
1204 ++ send_sig(SIGTERM, bus->watchdog_tsk, 1);
1205 ++ kthread_stop(bus->watchdog_tsk);
1206 ++ bus->watchdog_tsk = NULL;
1207 ++ }
1208 ++
1209 + /* De-register interrupt handler */
1210 + brcmf_sdiod_intr_unregister(bus->sdiodev);
1211 +
1212 +diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
1213 +index d1fab97d6b01..6ce2a73fe0e4 100644
1214 +--- a/drivers/pci/hotplug/pci_hotplug_core.c
1215 ++++ b/drivers/pci/hotplug/pci_hotplug_core.c
1216 +@@ -457,8 +457,17 @@ int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus,
1217 + list_add(&slot->slot_list, &pci_hotplug_slot_list);
1218 +
1219 + result = fs_add_slot(pci_slot);
1220 ++ if (result)
1221 ++ goto err_list_del;
1222 ++
1223 + kobject_uevent(&pci_slot->kobj, KOBJ_ADD);
1224 + dbg("Added slot %s to the list\n", name);
1225 ++ goto out;
1226 ++
1227 ++err_list_del:
1228 ++ list_del(&slot->slot_list);
1229 ++ pci_slot->hotplug = NULL;
1230 ++ pci_destroy_slot(pci_slot);
1231 + out:
1232 + mutex_unlock(&pci_hp_mutex);
1233 + return result;
1234 +diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
1235 +index cbe58480b474..6b0f7e0d7dbd 100644
1236 +--- a/drivers/pci/hotplug/pciehp.h
1237 ++++ b/drivers/pci/hotplug/pciehp.h
1238 +@@ -132,6 +132,7 @@ int pciehp_unconfigure_device(struct slot *p_slot);
1239 + void pciehp_queue_pushbutton_work(struct work_struct *work);
1240 + struct controller *pcie_init(struct pcie_device *dev);
1241 + int pcie_init_notification(struct controller *ctrl);
1242 ++void pcie_shutdown_notification(struct controller *ctrl);
1243 + int pciehp_enable_slot(struct slot *p_slot);
1244 + int pciehp_disable_slot(struct slot *p_slot);
1245 + void pcie_reenable_notification(struct controller *ctrl);
1246 +diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
1247 +index 8f6ded43760a..47cc3568514e 100644
1248 +--- a/drivers/pci/hotplug/pciehp_core.c
1249 ++++ b/drivers/pci/hotplug/pciehp_core.c
1250 +@@ -77,6 +77,12 @@ static int reset_slot (struct hotplug_slot *slot, int probe);
1251 + */
1252 + static void release_slot(struct hotplug_slot *hotplug_slot)
1253 + {
1254 ++ struct slot *slot = hotplug_slot->private;
1255 ++
1256 ++ /* queued work needs hotplug_slot name */
1257 ++ cancel_delayed_work(&slot->work);
1258 ++ drain_workqueue(slot->wq);
1259 ++
1260 + kfree(hotplug_slot->ops);
1261 + kfree(hotplug_slot->info);
1262 + kfree(hotplug_slot);
1263 +@@ -276,6 +282,7 @@ static void pciehp_remove(struct pcie_device *dev)
1264 + {
1265 + struct controller *ctrl = get_service_data(dev);
1266 +
1267 ++ pcie_shutdown_notification(ctrl);
1268 + cleanup_slot(ctrl);
1269 + pciehp_release_ctrl(ctrl);
1270 + }
1271 +diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
1272 +index 63c6c7fce3eb..cd982778a6b8 100644
1273 +--- a/drivers/pci/hotplug/pciehp_hpc.c
1274 ++++ b/drivers/pci/hotplug/pciehp_hpc.c
1275 +@@ -741,7 +741,7 @@ int pcie_init_notification(struct controller *ctrl)
1276 + return 0;
1277 + }
1278 +
1279 +-static void pcie_shutdown_notification(struct controller *ctrl)
1280 ++void pcie_shutdown_notification(struct controller *ctrl)
1281 + {
1282 + if (ctrl->notification_enabled) {
1283 + pcie_disable_notification(ctrl);
1284 +@@ -776,7 +776,7 @@ abort:
1285 + static void pcie_cleanup_slot(struct controller *ctrl)
1286 + {
1287 + struct slot *slot = ctrl->slot;
1288 +- cancel_delayed_work(&slot->work);
1289 ++
1290 + destroy_workqueue(slot->wq);
1291 + kfree(slot);
1292 + }
1293 +@@ -853,7 +853,6 @@ abort:
1294 +
1295 + void pciehp_release_ctrl(struct controller *ctrl)
1296 + {
1297 +- pcie_shutdown_notification(ctrl);
1298 + pcie_cleanup_slot(ctrl);
1299 + kfree(ctrl);
1300 + }
1301 +diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
1302 +index 566897f24dee..5f040619393f 100644
1303 +--- a/drivers/pci/probe.c
1304 ++++ b/drivers/pci/probe.c
1305 +@@ -1338,6 +1338,10 @@ static void pci_configure_mps(struct pci_dev *dev)
1306 + if (!pci_is_pcie(dev) || !bridge || !pci_is_pcie(bridge))
1307 + return;
1308 +
1309 ++ /* MPS and MRRS fields are of type 'RsvdP' for VFs, short-circuit out */
1310 ++ if (dev->is_virtfn)
1311 ++ return;
1312 ++
1313 + mps = pcie_get_mps(dev);
1314 + p_mps = pcie_get_mps(bridge);
1315 +
1316 +diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
1317 +index 9dc8687bf048..e1b32ed0aa20 100644
1318 +--- a/drivers/scsi/xen-scsifront.c
1319 ++++ b/drivers/scsi/xen-scsifront.c
1320 +@@ -676,10 +676,17 @@ static int scsifront_dev_reset_handler(struct scsi_cmnd *sc)
1321 + static int scsifront_sdev_configure(struct scsi_device *sdev)
1322 + {
1323 + struct vscsifrnt_info *info = shost_priv(sdev->host);
1324 ++ int err;
1325 +
1326 +- if (info && current == info->curr)
1327 +- xenbus_printf(XBT_NIL, info->dev->nodename,
1328 ++ if (info && current == info->curr) {
1329 ++ err = xenbus_printf(XBT_NIL, info->dev->nodename,
1330 + info->dev_state_path, "%d", XenbusStateConnected);
1331 ++ if (err) {
1332 ++ xenbus_dev_error(info->dev, err,
1333 ++ "%s: writing dev_state_path", __func__);
1334 ++ return err;
1335 ++ }
1336 ++ }
1337 +
1338 + return 0;
1339 + }
1340 +@@ -687,10 +694,15 @@ static int scsifront_sdev_configure(struct scsi_device *sdev)
1341 + static void scsifront_sdev_destroy(struct scsi_device *sdev)
1342 + {
1343 + struct vscsifrnt_info *info = shost_priv(sdev->host);
1344 ++ int err;
1345 +
1346 +- if (info && current == info->curr)
1347 +- xenbus_printf(XBT_NIL, info->dev->nodename,
1348 ++ if (info && current == info->curr) {
1349 ++ err = xenbus_printf(XBT_NIL, info->dev->nodename,
1350 + info->dev_state_path, "%d", XenbusStateClosed);
1351 ++ if (err)
1352 ++ xenbus_dev_error(info->dev, err,
1353 ++ "%s: writing dev_state_path", __func__);
1354 ++ }
1355 + }
1356 +
1357 + static struct scsi_host_template scsifront_sht = {
1358 +@@ -1025,9 +1037,12 @@ static void scsifront_do_lun_hotplug(struct vscsifrnt_info *info, int op)
1359 +
1360 + if (scsi_add_device(info->host, chn, tgt, lun)) {
1361 + dev_err(&dev->dev, "scsi_add_device\n");
1362 +- xenbus_printf(XBT_NIL, dev->nodename,
1363 ++ err = xenbus_printf(XBT_NIL, dev->nodename,
1364 + info->dev_state_path,
1365 + "%d", XenbusStateClosed);
1366 ++ if (err)
1367 ++ xenbus_dev_error(dev, err,
1368 ++ "%s: writing dev_state_path", __func__);
1369 + }
1370 + break;
1371 + case VSCSIFRONT_OP_DEL_LUN:
1372 +@@ -1041,10 +1056,14 @@ static void scsifront_do_lun_hotplug(struct vscsifrnt_info *info, int op)
1373 + }
1374 + break;
1375 + case VSCSIFRONT_OP_READD_LUN:
1376 +- if (device_state == XenbusStateConnected)
1377 +- xenbus_printf(XBT_NIL, dev->nodename,
1378 ++ if (device_state == XenbusStateConnected) {
1379 ++ err = xenbus_printf(XBT_NIL, dev->nodename,
1380 + info->dev_state_path,
1381 + "%d", XenbusStateConnected);
1382 ++ if (err)
1383 ++ xenbus_dev_error(dev, err,
1384 ++ "%s: writing dev_state_path", __func__);
1385 ++ }
1386 + break;
1387 + default:
1388 + break;
1389 +diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
1390 +index 374f840f31a4..47cb163da9a0 100644
1391 +--- a/drivers/staging/android/ion/ion.c
1392 ++++ b/drivers/staging/android/ion/ion.c
1393 +@@ -15,6 +15,7 @@
1394 + *
1395 + */
1396 +
1397 ++#include <linux/atomic.h>
1398 + #include <linux/device.h>
1399 + #include <linux/err.h>
1400 + #include <linux/file.h>
1401 +@@ -387,6 +388,16 @@ static void ion_handle_get(struct ion_handle *handle)
1402 + kref_get(&handle->ref);
1403 + }
1404 +
1405 ++/* Must hold the client lock */
1406 ++static struct ion_handle *ion_handle_get_check_overflow(
1407 ++ struct ion_handle *handle)
1408 ++{
1409 ++ if (atomic_read(&handle->ref.refcount) + 1 == 0)
1410 ++ return ERR_PTR(-EOVERFLOW);
1411 ++ ion_handle_get(handle);
1412 ++ return handle;
1413 ++}
1414 ++
1415 + static int ion_handle_put_nolock(struct ion_handle *handle)
1416 + {
1417 + int ret;
1418 +@@ -433,9 +444,9 @@ static struct ion_handle *ion_handle_get_by_id_nolock(struct ion_client *client,
1419 +
1420 + handle = idr_find(&client->idr, id);
1421 + if (handle)
1422 +- ion_handle_get(handle);
1423 ++ return ion_handle_get_check_overflow(handle);
1424 +
1425 +- return handle ? handle : ERR_PTR(-EINVAL);
1426 ++ return ERR_PTR(-EINVAL);
1427 + }
1428 +
1429 + struct ion_handle *ion_handle_get_by_id(struct ion_client *client,
1430 +@@ -1202,7 +1213,7 @@ struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd)
1431 + /* if a handle exists for this buffer just take a reference to it */
1432 + handle = ion_handle_lookup(client, buffer);
1433 + if (!IS_ERR(handle)) {
1434 +- ion_handle_get(handle);
1435 ++ handle = ion_handle_get_check_overflow(handle);
1436 + mutex_unlock(&client->lock);
1437 + goto end;
1438 + }
1439 +diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
1440 +index 98705b83d2dc..842c1ae7a291 100644
1441 +--- a/drivers/usb/dwc2/gadget.c
1442 ++++ b/drivers/usb/dwc2/gadget.c
1443 +@@ -3657,9 +3657,11 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
1444 + }
1445 +
1446 + ret = usb_add_gadget_udc(dev, &hsotg->gadget);
1447 +- if (ret)
1448 ++ if (ret) {
1449 ++ dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep,
1450 ++ hsotg->ctrl_req);
1451 + return ret;
1452 +-
1453 ++ }
1454 + dwc2_hsotg_dump(hsotg);
1455 +
1456 + return 0;
1457 +@@ -3672,6 +3674,7 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
1458 + int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg)
1459 + {
1460 + usb_del_gadget_udc(&hsotg->gadget);
1461 ++ dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, hsotg->ctrl_req);
1462 +
1463 + return 0;
1464 + }
1465 +diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
1466 +index bda0b21b850f..51866f3f2052 100644
1467 +--- a/drivers/usb/dwc2/hcd_intr.c
1468 ++++ b/drivers/usb/dwc2/hcd_intr.c
1469 +@@ -931,9 +931,8 @@ static int dwc2_xfercomp_isoc_split_in(struct dwc2_hsotg *hsotg,
1470 + frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index];
1471 + len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
1472 + DWC2_HC_XFER_COMPLETE, NULL);
1473 +- if (!len) {
1474 ++ if (!len && !qtd->isoc_split_offset) {
1475 + qtd->complete_split = 0;
1476 +- qtd->isoc_split_offset = 0;
1477 + return 0;
1478 + }
1479 +
1480 +diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
1481 +index eb445c2ab15e..58f5fbdb6959 100644
1482 +--- a/drivers/usb/gadget/composite.c
1483 ++++ b/drivers/usb/gadget/composite.c
1484 +@@ -1619,6 +1619,8 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1485 + */
1486 + if (w_value && !f->get_alt)
1487 + break;
1488 ++
1489 ++ spin_lock(&cdev->lock);
1490 + value = f->set_alt(f, w_index, w_value);
1491 + if (value == USB_GADGET_DELAYED_STATUS) {
1492 + DBG(cdev,
1493 +@@ -1628,6 +1630,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1494 + DBG(cdev, "delayed_status count %d\n",
1495 + cdev->delayed_status);
1496 + }
1497 ++ spin_unlock(&cdev->lock);
1498 + break;
1499 + case USB_REQ_GET_INTERFACE:
1500 + if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE))
1501 +diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
1502 +index 2d837b6bd495..128a3c0a9286 100644
1503 +--- a/drivers/usb/host/xhci.c
1504 ++++ b/drivers/usb/host/xhci.c
1505 +@@ -1052,8 +1052,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1506 + command = readl(&xhci->op_regs->command);
1507 + command |= CMD_CRS;
1508 + writel(command, &xhci->op_regs->command);
1509 ++ /*
1510 ++ * Some controllers take up to 55+ ms to complete the controller
1511 ++ * restore so setting the timeout to 100ms. Xhci specification
1512 ++ * doesn't mention any timeout value.
1513 ++ */
1514 + if (xhci_handshake(&xhci->op_regs->status,
1515 +- STS_RESTORE, 0, 10 * 1000)) {
1516 ++ STS_RESTORE, 0, 100 * 1000)) {
1517 + xhci_warn(xhci, "WARN: xHC restore state timeout\n");
1518 + spin_unlock_irq(&xhci->lock);
1519 + return -ETIMEDOUT;
1520 +diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
1521 +index 75f79ff29ce0..828b4c080c38 100644
1522 +--- a/fs/ext4/mballoc.c
1523 ++++ b/fs/ext4/mballoc.c
1524 +@@ -26,6 +26,7 @@
1525 + #include <linux/log2.h>
1526 + #include <linux/module.h>
1527 + #include <linux/slab.h>
1528 ++#include <linux/nospec.h>
1529 + #include <linux/backing-dev.h>
1530 + #include <trace/events/ext4.h>
1531 +
1532 +@@ -2144,7 +2145,8 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
1533 + * This should tell if fe_len is exactly power of 2
1534 + */
1535 + if ((ac->ac_g_ex.fe_len & (~(1 << (i - 1)))) == 0)
1536 +- ac->ac_2order = i - 1;
1537 ++ ac->ac_2order = array_index_nospec(i - 1,
1538 ++ sb->s_blocksize_bits + 2);
1539 + }
1540 +
1541 + /* if stream allocation is enabled, use global goal */
1542 +diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
1543 +index a8dbc93e45eb..8b32fdaad468 100644
1544 +--- a/fs/reiserfs/xattr.c
1545 ++++ b/fs/reiserfs/xattr.c
1546 +@@ -791,8 +791,10 @@ static int listxattr_filler(struct dir_context *ctx, const char *name,
1547 + size = handler->list(handler, b->dentry,
1548 + b->buf + b->pos, b->size, name,
1549 + namelen);
1550 +- if (size > b->size)
1551 ++ if (b->pos + size > b->size) {
1552 ++ b->pos = -ERANGE;
1553 + return -ERANGE;
1554 ++ }
1555 + } else {
1556 + size = handler->list(handler, b->dentry,
1557 + NULL, 0, name, namelen);
1558 +diff --git a/include/linux/fsl/guts.h b/include/linux/fsl/guts.h
1559 +index 84d971ff3fba..5d06e838e650 100644
1560 +--- a/include/linux/fsl/guts.h
1561 ++++ b/include/linux/fsl/guts.h
1562 +@@ -16,6 +16,7 @@
1563 + #define __FSL_GUTS_H__
1564 +
1565 + #include <linux/types.h>
1566 ++#include <linux/io.h>
1567 +
1568 + /**
1569 + * Global Utility Registers.
1570 +diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
1571 +index 93328c61934a..6965dfe7e88b 100644
1572 +--- a/include/net/net_namespace.h
1573 ++++ b/include/net/net_namespace.h
1574 +@@ -115,6 +115,7 @@ struct net {
1575 + #endif
1576 + #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
1577 + struct netns_nf_frag nf_frag;
1578 ++ struct ctl_table_header *nf_frag_frags_hdr;
1579 + #endif
1580 + struct sock *nfnl;
1581 + struct sock *nfnl_stash;
1582 +diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
1583 +index c0368db6df54..d235722c0d92 100644
1584 +--- a/include/net/netns/ipv6.h
1585 ++++ b/include/net/netns/ipv6.h
1586 +@@ -86,7 +86,6 @@ struct netns_ipv6 {
1587 +
1588 + #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
1589 + struct netns_nf_frag {
1590 +- struct netns_sysctl_ipv6 sysctl;
1591 + struct netns_frags frags;
1592 + };
1593 + #endif
1594 +diff --git a/include/net/tcp.h b/include/net/tcp.h
1595 +index cac4a6ad5db3..6c89238f192e 100644
1596 +--- a/include/net/tcp.h
1597 ++++ b/include/net/tcp.h
1598 +@@ -821,8 +821,6 @@ enum tcp_ca_event {
1599 + CA_EVENT_LOSS, /* loss timeout */
1600 + CA_EVENT_ECN_NO_CE, /* ECT set, but not CE marked */
1601 + CA_EVENT_ECN_IS_CE, /* received CE marked IP packet */
1602 +- CA_EVENT_DELAYED_ACK, /* Delayed ack is sent */
1603 +- CA_EVENT_NON_DELAYED_ACK,
1604 + };
1605 +
1606 + /* Information about inbound ACK, passed to cong_ops->in_ack_event() */
1607 +diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
1608 +index 0e2c4911ba61..6e171b547a80 100644
1609 +--- a/kernel/locking/lockdep.c
1610 ++++ b/kernel/locking/lockdep.c
1611 +@@ -1264,11 +1264,11 @@ unsigned long lockdep_count_forward_deps(struct lock_class *class)
1612 + this.parent = NULL;
1613 + this.class = class;
1614 +
1615 +- local_irq_save(flags);
1616 ++ raw_local_irq_save(flags);
1617 + arch_spin_lock(&lockdep_lock);
1618 + ret = __lockdep_count_forward_deps(&this);
1619 + arch_spin_unlock(&lockdep_lock);
1620 +- local_irq_restore(flags);
1621 ++ raw_local_irq_restore(flags);
1622 +
1623 + return ret;
1624 + }
1625 +@@ -1291,11 +1291,11 @@ unsigned long lockdep_count_backward_deps(struct lock_class *class)
1626 + this.parent = NULL;
1627 + this.class = class;
1628 +
1629 +- local_irq_save(flags);
1630 ++ raw_local_irq_save(flags);
1631 + arch_spin_lock(&lockdep_lock);
1632 + ret = __lockdep_count_backward_deps(&this);
1633 + arch_spin_unlock(&lockdep_lock);
1634 +- local_irq_restore(flags);
1635 ++ raw_local_irq_restore(flags);
1636 +
1637 + return ret;
1638 + }
1639 +@@ -4123,7 +4123,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
1640 + if (unlikely(!debug_locks))
1641 + return;
1642 +
1643 +- local_irq_save(flags);
1644 ++ raw_local_irq_save(flags);
1645 + for (i = 0; i < curr->lockdep_depth; i++) {
1646 + hlock = curr->held_locks + i;
1647 +
1648 +@@ -4134,7 +4134,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
1649 + print_freed_lock_bug(curr, mem_from, mem_from + mem_len, hlock);
1650 + break;
1651 + }
1652 +- local_irq_restore(flags);
1653 ++ raw_local_irq_restore(flags);
1654 + }
1655 + EXPORT_SYMBOL_GPL(debug_check_no_locks_freed);
1656 +
1657 +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
1658 +index 1b980a8ef791..11761b3dd7ba 100644
1659 +--- a/kernel/trace/trace.c
1660 ++++ b/kernel/trace/trace.c
1661 +@@ -2186,6 +2186,7 @@ out:
1662 + }
1663 + EXPORT_SYMBOL_GPL(trace_vbprintk);
1664 +
1665 ++__printf(3, 0)
1666 + static int
1667 + __trace_array_vprintk(struct ring_buffer *buffer,
1668 + unsigned long ip, const char *fmt, va_list args)
1669 +@@ -2236,12 +2237,14 @@ __trace_array_vprintk(struct ring_buffer *buffer,
1670 + return len;
1671 + }
1672 +
1673 ++__printf(3, 0)
1674 + int trace_array_vprintk(struct trace_array *tr,
1675 + unsigned long ip, const char *fmt, va_list args)
1676 + {
1677 + return __trace_array_vprintk(tr->trace_buffer.buffer, ip, fmt, args);
1678 + }
1679 +
1680 ++__printf(3, 0)
1681 + int trace_array_printk(struct trace_array *tr,
1682 + unsigned long ip, const char *fmt, ...)
1683 + {
1684 +@@ -2257,6 +2260,7 @@ int trace_array_printk(struct trace_array *tr,
1685 + return ret;
1686 + }
1687 +
1688 ++__printf(3, 4)
1689 + int trace_array_printk_buf(struct ring_buffer *buffer,
1690 + unsigned long ip, const char *fmt, ...)
1691 + {
1692 +@@ -2272,6 +2276,7 @@ int trace_array_printk_buf(struct ring_buffer *buffer,
1693 + return ret;
1694 + }
1695 +
1696 ++__printf(2, 0)
1697 + int trace_vprintk(unsigned long ip, const char *fmt, va_list args)
1698 + {
1699 + return trace_array_vprintk(&global_trace, ip, fmt, args);
1700 +diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c
1701 +index ba9adce1422a..b7397b459960 100644
1702 +--- a/mm/kasan/kasan.c
1703 ++++ b/mm/kasan/kasan.c
1704 +@@ -427,12 +427,13 @@ void kasan_kfree_large(const void *ptr)
1705 + int kasan_module_alloc(void *addr, size_t size)
1706 + {
1707 + void *ret;
1708 ++ size_t scaled_size;
1709 + size_t shadow_size;
1710 + unsigned long shadow_start;
1711 +
1712 + shadow_start = (unsigned long)kasan_mem_to_shadow(addr);
1713 +- shadow_size = round_up(size >> KASAN_SHADOW_SCALE_SHIFT,
1714 +- PAGE_SIZE);
1715 ++ scaled_size = (size + KASAN_SHADOW_MASK) >> KASAN_SHADOW_SCALE_SHIFT;
1716 ++ shadow_size = round_up(scaled_size, PAGE_SIZE);
1717 +
1718 + if (WARN_ON(!PAGE_ALIGNED(shadow_start)))
1719 + return -EINVAL;
1720 +diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
1721 +index 3400b1e47668..50e84e634dfe 100644
1722 +--- a/net/bridge/br_if.c
1723 ++++ b/net/bridge/br_if.c
1724 +@@ -511,8 +511,11 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
1725 + if (br_fdb_insert(br, p, dev->dev_addr, 0))
1726 + netdev_err(dev, "failed insert local address bridge forwarding table\n");
1727 +
1728 +- if (nbp_vlan_init(p))
1729 ++ err = nbp_vlan_init(p);
1730 ++ if (err) {
1731 + netdev_err(dev, "failed to initialize vlan filtering on this port\n");
1732 ++ goto err6;
1733 ++ }
1734 +
1735 + spin_lock_bh(&br->lock);
1736 + changed_addr = br_stp_recalculate_bridge_id(br);
1737 +@@ -533,6 +536,12 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
1738 +
1739 + return 0;
1740 +
1741 ++err6:
1742 ++ list_del_rcu(&p->list);
1743 ++ br_fdb_delete_by_port(br, p, 0, 1);
1744 ++ nbp_update_port_count(br);
1745 ++ netdev_upper_dev_unlink(dev, br->dev);
1746 ++
1747 + err5:
1748 + dev->priv_flags &= ~IFF_BRIDGE_PORT;
1749 + netdev_rx_handler_unregister(dev);
1750 +diff --git a/net/core/dev.c b/net/core/dev.c
1751 +index 3bcbf931a910..191cf880d805 100644
1752 +--- a/net/core/dev.c
1753 ++++ b/net/core/dev.c
1754 +@@ -7420,7 +7420,8 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
1755 + /* We get here if we can't use the current device name */
1756 + if (!pat)
1757 + goto out;
1758 +- if (dev_get_valid_name(net, dev, pat) < 0)
1759 ++ err = dev_get_valid_name(net, dev, pat);
1760 ++ if (err < 0)
1761 + goto out;
1762 + }
1763 +
1764 +@@ -7432,7 +7433,6 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
1765 + dev_close(dev);
1766 +
1767 + /* And unlink it from device chain */
1768 +- err = -ENODEV;
1769 + unlist_netdevice(dev);
1770 +
1771 + synchronize_net();
1772 +diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
1773 +index 9363c1a70f16..8adb6e9ba8f5 100644
1774 +--- a/net/ipv4/netfilter/ip_tables.c
1775 ++++ b/net/ipv4/netfilter/ip_tables.c
1776 +@@ -2072,6 +2072,7 @@ static struct xt_match ipt_builtin_mt[] __read_mostly = {
1777 + .checkentry = icmp_checkentry,
1778 + .proto = IPPROTO_ICMP,
1779 + .family = NFPROTO_IPV4,
1780 ++ .me = THIS_MODULE,
1781 + },
1782 + };
1783 +
1784 +diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
1785 +index a0f0a7db946b..5e162b8ab184 100644
1786 +--- a/net/ipv4/tcp.c
1787 ++++ b/net/ipv4/tcp.c
1788 +@@ -1659,7 +1659,7 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
1789 + * shouldn't happen.
1790 + */
1791 + if (WARN(before(*seq, TCP_SKB_CB(skb)->seq),
1792 +- "recvmsg bug: copied %X seq %X rcvnxt %X fl %X\n",
1793 ++ "TCP recvmsg seq # bug: copied %X, seq %X, rcvnxt %X, fl %X\n",
1794 + *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt,
1795 + flags))
1796 + break;
1797 +@@ -1672,7 +1672,7 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
1798 + if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
1799 + goto found_fin_ok;
1800 + WARN(!(flags & MSG_PEEK),
1801 +- "recvmsg bug 2: copied %X seq %X rcvnxt %X fl %X\n",
1802 ++ "TCP recvmsg seq # bug 2: copied %X, seq %X, rcvnxt %X, fl %X\n",
1803 + *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt, flags);
1804 + }
1805 +
1806 +diff --git a/net/ipv4/tcp_dctcp.c b/net/ipv4/tcp_dctcp.c
1807 +index 6300edf90e60..62f90f6b7a9d 100644
1808 +--- a/net/ipv4/tcp_dctcp.c
1809 ++++ b/net/ipv4/tcp_dctcp.c
1810 +@@ -55,7 +55,6 @@ struct dctcp {
1811 + u32 dctcp_alpha;
1812 + u32 next_seq;
1813 + u32 ce_state;
1814 +- u32 delayed_ack_reserved;
1815 + u32 loss_cwnd;
1816 + };
1817 +
1818 +@@ -96,7 +95,6 @@ static void dctcp_init(struct sock *sk)
1819 +
1820 + ca->dctcp_alpha = min(dctcp_alpha_on_init, DCTCP_MAX_ALPHA);
1821 +
1822 +- ca->delayed_ack_reserved = 0;
1823 + ca->loss_cwnd = 0;
1824 + ca->ce_state = 0;
1825 +
1826 +@@ -230,25 +228,6 @@ static void dctcp_state(struct sock *sk, u8 new_state)
1827 + }
1828 + }
1829 +
1830 +-static void dctcp_update_ack_reserved(struct sock *sk, enum tcp_ca_event ev)
1831 +-{
1832 +- struct dctcp *ca = inet_csk_ca(sk);
1833 +-
1834 +- switch (ev) {
1835 +- case CA_EVENT_DELAYED_ACK:
1836 +- if (!ca->delayed_ack_reserved)
1837 +- ca->delayed_ack_reserved = 1;
1838 +- break;
1839 +- case CA_EVENT_NON_DELAYED_ACK:
1840 +- if (ca->delayed_ack_reserved)
1841 +- ca->delayed_ack_reserved = 0;
1842 +- break;
1843 +- default:
1844 +- /* Don't care for the rest. */
1845 +- break;
1846 +- }
1847 +-}
1848 +-
1849 + static void dctcp_cwnd_event(struct sock *sk, enum tcp_ca_event ev)
1850 + {
1851 + switch (ev) {
1852 +@@ -258,10 +237,6 @@ static void dctcp_cwnd_event(struct sock *sk, enum tcp_ca_event ev)
1853 + case CA_EVENT_ECN_NO_CE:
1854 + dctcp_ce_state_1_to_0(sk);
1855 + break;
1856 +- case CA_EVENT_DELAYED_ACK:
1857 +- case CA_EVENT_NON_DELAYED_ACK:
1858 +- dctcp_update_ack_reserved(sk, ev);
1859 +- break;
1860 + default:
1861 + /* Don't care for the rest. */
1862 + break;
1863 +diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
1864 +index 6fa749ce231f..2d3c9df8d75c 100644
1865 +--- a/net/ipv4/tcp_output.c
1866 ++++ b/net/ipv4/tcp_output.c
1867 +@@ -3316,8 +3316,6 @@ void tcp_send_delayed_ack(struct sock *sk)
1868 + int ato = icsk->icsk_ack.ato;
1869 + unsigned long timeout;
1870 +
1871 +- tcp_ca_event(sk, CA_EVENT_DELAYED_ACK);
1872 +-
1873 + if (ato > TCP_DELACK_MIN) {
1874 + const struct tcp_sock *tp = tcp_sk(sk);
1875 + int max_ato = HZ / 2;
1876 +@@ -3374,8 +3372,6 @@ void __tcp_send_ack(struct sock *sk, u32 rcv_nxt)
1877 + if (sk->sk_state == TCP_CLOSE)
1878 + return;
1879 +
1880 +- tcp_ca_event(sk, CA_EVENT_NON_DELAYED_ACK);
1881 +-
1882 + /* We are not putting this on the write queue, so
1883 + * tcp_transmit_skb() will set the ownership to this
1884 + * sock.
1885 +diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
1886 +index 06640685ff43..091cee551cd9 100644
1887 +--- a/net/ipv6/mcast.c
1888 ++++ b/net/ipv6/mcast.c
1889 +@@ -2061,7 +2061,8 @@ void ipv6_mc_dad_complete(struct inet6_dev *idev)
1890 + mld_send_initial_cr(idev);
1891 + idev->mc_dad_count--;
1892 + if (idev->mc_dad_count)
1893 +- mld_dad_start_timer(idev, idev->mc_maxdelay);
1894 ++ mld_dad_start_timer(idev,
1895 ++ unsolicited_report_interval(idev));
1896 + }
1897 + }
1898 +
1899 +@@ -2073,7 +2074,8 @@ static void mld_dad_timer_expire(unsigned long data)
1900 + if (idev->mc_dad_count) {
1901 + idev->mc_dad_count--;
1902 + if (idev->mc_dad_count)
1903 +- mld_dad_start_timer(idev, idev->mc_maxdelay);
1904 ++ mld_dad_start_timer(idev,
1905 ++ unsolicited_report_interval(idev));
1906 + }
1907 + in6_dev_put(idev);
1908 + }
1909 +@@ -2431,7 +2433,8 @@ static void mld_ifc_timer_expire(unsigned long data)
1910 + if (idev->mc_ifc_count) {
1911 + idev->mc_ifc_count--;
1912 + if (idev->mc_ifc_count)
1913 +- mld_ifc_start_timer(idev, idev->mc_maxdelay);
1914 ++ mld_ifc_start_timer(idev,
1915 ++ unsolicited_report_interval(idev));
1916 + }
1917 + in6_dev_put(idev);
1918 + }
1919 +diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
1920 +index 6cb9e35d23ac..96de322fe5e2 100644
1921 +--- a/net/ipv6/netfilter/ip6_tables.c
1922 ++++ b/net/ipv6/netfilter/ip6_tables.c
1923 +@@ -2073,6 +2073,7 @@ static struct xt_match ip6t_builtin_mt[] __read_mostly = {
1924 + .checkentry = icmp6_checkentry,
1925 + .proto = IPPROTO_ICMPV6,
1926 + .family = NFPROTO_IPV6,
1927 ++ .me = THIS_MODULE,
1928 + },
1929 + };
1930 +
1931 +diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
1932 +index eb2dc39f7066..838b65a59a73 100644
1933 +--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
1934 ++++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
1935 +@@ -118,7 +118,7 @@ static int nf_ct_frag6_sysctl_register(struct net *net)
1936 + if (hdr == NULL)
1937 + goto err_reg;
1938 +
1939 +- net->nf_frag.sysctl.frags_hdr = hdr;
1940 ++ net->nf_frag_frags_hdr = hdr;
1941 + return 0;
1942 +
1943 + err_reg:
1944 +@@ -132,8 +132,8 @@ static void __net_exit nf_ct_frags6_sysctl_unregister(struct net *net)
1945 + {
1946 + struct ctl_table *table;
1947 +
1948 +- table = net->nf_frag.sysctl.frags_hdr->ctl_table_arg;
1949 +- unregister_net_sysctl_table(net->nf_frag.sysctl.frags_hdr);
1950 ++ table = net->nf_frag_frags_hdr->ctl_table_arg;
1951 ++ unregister_net_sysctl_table(net->nf_frag_frags_hdr);
1952 + if (!net_eq(net, &init_net))
1953 + kfree(table);
1954 + }
1955 +diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c
1956 +index fce1b1cca32d..99d0e9261a64 100644
1957 +--- a/net/netfilter/nf_conntrack_proto_dccp.c
1958 ++++ b/net/netfilter/nf_conntrack_proto_dccp.c
1959 +@@ -244,14 +244,14 @@ dccp_state_table[CT_DCCP_ROLE_MAX + 1][DCCP_PKT_SYNCACK + 1][CT_DCCP_MAX + 1] =
1960 + * We currently ignore Sync packets
1961 + *
1962 + * sNO, sRQ, sRS, sPO, sOP, sCR, sCG, sTW */
1963 +- sIG, sIG, sIG, sIG, sIG, sIG, sIG, sIG,
1964 ++ sIV, sIG, sIG, sIG, sIG, sIG, sIG, sIG,
1965 + },
1966 + [DCCP_PKT_SYNCACK] = {
1967 + /*
1968 + * We currently ignore SyncAck packets
1969 + *
1970 + * sNO, sRQ, sRS, sPO, sOP, sCR, sCG, sTW */
1971 +- sIG, sIG, sIG, sIG, sIG, sIG, sIG, sIG,
1972 ++ sIV, sIG, sIG, sIG, sIG, sIG, sIG, sIG,
1973 + },
1974 + },
1975 + [CT_DCCP_ROLE_SERVER] = {
1976 +@@ -372,14 +372,14 @@ dccp_state_table[CT_DCCP_ROLE_MAX + 1][DCCP_PKT_SYNCACK + 1][CT_DCCP_MAX + 1] =
1977 + * We currently ignore Sync packets
1978 + *
1979 + * sNO, sRQ, sRS, sPO, sOP, sCR, sCG, sTW */
1980 +- sIG, sIG, sIG, sIG, sIG, sIG, sIG, sIG,
1981 ++ sIV, sIG, sIG, sIG, sIG, sIG, sIG, sIG,
1982 + },
1983 + [DCCP_PKT_SYNCACK] = {
1984 + /*
1985 + * We currently ignore SyncAck packets
1986 + *
1987 + * sNO, sRQ, sRS, sPO, sOP, sCR, sCG, sTW */
1988 +- sIG, sIG, sIG, sIG, sIG, sIG, sIG, sIG,
1989 ++ sIV, sIG, sIG, sIG, sIG, sIG, sIG, sIG,
1990 + },
1991 + },
1992 + };
1993 +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
1994 +index 3a63f33698d3..07668f152a3a 100644
1995 +--- a/net/packet/af_packet.c
1996 ++++ b/net/packet/af_packet.c
1997 +@@ -2780,6 +2780,8 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len)
1998 + goto out_free;
1999 + } else if (reserve) {
2000 + skb_reserve(skb, -reserve);
2001 ++ if (len < reserve)
2002 ++ skb_reset_network_header(skb);
2003 + }
2004 +
2005 + /* Returns -EFAULT on error */
2006 +@@ -4174,6 +4176,8 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
2007 + }
2008 +
2009 + if (req->tp_block_nr) {
2010 ++ unsigned int min_frame_size;
2011 ++
2012 + /* Sanity tests and some calculations */
2013 + err = -EBUSY;
2014 + if (unlikely(rb->pg_vec))
2015 +@@ -4196,12 +4200,12 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
2016 + goto out;
2017 + if (unlikely(!PAGE_ALIGNED(req->tp_block_size)))
2018 + goto out;
2019 ++ min_frame_size = po->tp_hdrlen + po->tp_reserve;
2020 + if (po->tp_version >= TPACKET_V3 &&
2021 +- req->tp_block_size <=
2022 +- BLK_PLUS_PRIV((u64)req_u->req3.tp_sizeof_priv) + sizeof(struct tpacket3_hdr))
2023 ++ req->tp_block_size <
2024 ++ BLK_PLUS_PRIV((u64)req_u->req3.tp_sizeof_priv) + min_frame_size)
2025 + goto out;
2026 +- if (unlikely(req->tp_frame_size < po->tp_hdrlen +
2027 +- po->tp_reserve))
2028 ++ if (unlikely(req->tp_frame_size < min_frame_size))
2029 + goto out;
2030 + if (unlikely(req->tp_frame_size & (TPACKET_ALIGNMENT - 1)))
2031 + goto out;
2032 +diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
2033 +index 90270d7110a3..78c40bb681b9 100644
2034 +--- a/net/xfrm/xfrm_user.c
2035 ++++ b/net/xfrm/xfrm_user.c
2036 +@@ -1624,9 +1624,11 @@ static inline size_t userpolicy_type_attrsize(void)
2037 + #ifdef CONFIG_XFRM_SUB_POLICY
2038 + static int copy_to_user_policy_type(u8 type, struct sk_buff *skb)
2039 + {
2040 +- struct xfrm_userpolicy_type upt = {
2041 +- .type = type,
2042 +- };
2043 ++ struct xfrm_userpolicy_type upt;
2044 ++
2045 ++ /* Sadly there are two holes in struct xfrm_userpolicy_type */
2046 ++ memset(&upt, 0, sizeof(upt));
2047 ++ upt.type = type;
2048 +
2049 + return nla_put(skb, XFRMA_POLICY_TYPE, sizeof(upt), &upt);
2050 + }
2051 +diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
2052 +index 735a1a9386d6..c73361859d11 100644
2053 +--- a/security/smack/smack_lsm.c
2054 ++++ b/security/smack/smack_lsm.c
2055 +@@ -2260,6 +2260,7 @@ static void smack_task_to_inode(struct task_struct *p, struct inode *inode)
2056 + struct smack_known *skp = smk_of_task_struct(p);
2057 +
2058 + isp->smk_inode = skp;
2059 ++ isp->smk_flags |= SMK_INODE_INSTANT;
2060 + }
2061 +
2062 + /*
2063 +diff --git a/tools/perf/arch/powerpc/util/skip-callchain-idx.c b/tools/perf/arch/powerpc/util/skip-callchain-idx.c
2064 +index 0c370f81e002..bd630c222e65 100644
2065 +--- a/tools/perf/arch/powerpc/util/skip-callchain-idx.c
2066 ++++ b/tools/perf/arch/powerpc/util/skip-callchain-idx.c
2067 +@@ -243,7 +243,7 @@ int arch_skip_callchain_idx(struct thread *thread, struct ip_callchain *chain)
2068 + u64 ip;
2069 + u64 skip_slot = -1;
2070 +
2071 +- if (chain->nr < 3)
2072 ++ if (!chain || chain->nr < 3)
2073 + return skip_slot;
2074 +
2075 + ip = chain->ips[2];
2076 +diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
2077 +index f5bb096c3bd9..bf67343c7795 100644
2078 +--- a/tools/perf/tests/topology.c
2079 ++++ b/tools/perf/tests/topology.c
2080 +@@ -42,6 +42,7 @@ static int session_write_header(char *path)
2081 +
2082 + perf_header__set_feat(&session->header, HEADER_CPU_TOPOLOGY);
2083 + perf_header__set_feat(&session->header, HEADER_NRCPUS);
2084 ++ perf_header__set_feat(&session->header, HEADER_ARCH);
2085 +
2086 + session->header.data_size += DATA_SIZE;
2087 +
2088 +diff --git a/tools/perf/util/llvm-utils.c b/tools/perf/util/llvm-utils.c
2089 +index 00724d496d38..62f6d7dc2dda 100644
2090 +--- a/tools/perf/util/llvm-utils.c
2091 ++++ b/tools/perf/util/llvm-utils.c
2092 +@@ -254,16 +254,16 @@ static const char *kinc_fetch_script =
2093 + "#!/usr/bin/env sh\n"
2094 + "if ! test -d \"$KBUILD_DIR\"\n"
2095 + "then\n"
2096 +-" exit -1\n"
2097 ++" exit 1\n"
2098 + "fi\n"
2099 + "if ! test -f \"$KBUILD_DIR/include/generated/autoconf.h\"\n"
2100 + "then\n"
2101 +-" exit -1\n"
2102 ++" exit 1\n"
2103 + "fi\n"
2104 + "TMPDIR=`mktemp -d`\n"
2105 + "if test -z \"$TMPDIR\"\n"
2106 + "then\n"
2107 +-" exit -1\n"
2108 ++" exit 1\n"
2109 + "fi\n"
2110 + "cat << EOF > $TMPDIR/Makefile\n"
2111 + "obj-y := dummy.o\n"
2112 +diff --git a/tools/testing/selftests/pstore/pstore_post_reboot_tests b/tools/testing/selftests/pstore/pstore_post_reboot_tests
2113 +index 6ccb154cb4aa..22f8df1ad7d4 100755
2114 +--- a/tools/testing/selftests/pstore/pstore_post_reboot_tests
2115 ++++ b/tools/testing/selftests/pstore/pstore_post_reboot_tests
2116 +@@ -7,13 +7,16 @@
2117 + #
2118 + # Released under the terms of the GPL v2.
2119 +
2120 ++# Kselftest framework requirement - SKIP code is 4.
2121 ++ksft_skip=4
2122 ++
2123 + . ./common_tests
2124 +
2125 + if [ -e $REBOOT_FLAG ]; then
2126 + rm $REBOOT_FLAG
2127 + else
2128 + prlog "pstore_crash_test has not been executed yet. we skip further tests."
2129 +- exit 0
2130 ++ exit $ksft_skip
2131 + fi
2132 +
2133 + prlog -n "Mounting pstore filesystem ... "
2134 +diff --git a/tools/testing/selftests/static_keys/test_static_keys.sh b/tools/testing/selftests/static_keys/test_static_keys.sh
2135 +index 1261e3fa1e3a..5bba7796fb34 100755
2136 +--- a/tools/testing/selftests/static_keys/test_static_keys.sh
2137 ++++ b/tools/testing/selftests/static_keys/test_static_keys.sh
2138 +@@ -1,6 +1,19 @@
2139 + #!/bin/sh
2140 + # Runs static keys kernel module tests
2141 +
2142 ++# Kselftest framework requirement - SKIP code is 4.
2143 ++ksft_skip=4
2144 ++
2145 ++if ! /sbin/modprobe -q -n test_static_key_base; then
2146 ++ echo "static_key: module test_static_key_base is not found [SKIP]"
2147 ++ exit $ksft_skip
2148 ++fi
2149 ++
2150 ++if ! /sbin/modprobe -q -n test_static_keys; then
2151 ++ echo "static_key: module test_static_keys is not found [SKIP]"
2152 ++ exit $ksft_skip
2153 ++fi
2154 ++
2155 + if /sbin/modprobe -q test_static_key_base; then
2156 + if /sbin/modprobe -q test_static_keys; then
2157 + echo "static_key: ok"
2158 +diff --git a/tools/testing/selftests/sync/config b/tools/testing/selftests/sync/config
2159 +new file mode 100644
2160 +index 000000000000..1ab7e8130db2
2161 +--- /dev/null
2162 ++++ b/tools/testing/selftests/sync/config
2163 +@@ -0,0 +1,4 @@
2164 ++CONFIG_STAGING=y
2165 ++CONFIG_ANDROID=y
2166 ++CONFIG_SYNC=y
2167 ++CONFIG_SW_SYNC=y
2168 +diff --git a/tools/testing/selftests/user/test_user_copy.sh b/tools/testing/selftests/user/test_user_copy.sh
2169 +index 350107f40c1d..0409270f998c 100755
2170 +--- a/tools/testing/selftests/user/test_user_copy.sh
2171 ++++ b/tools/testing/selftests/user/test_user_copy.sh
2172 +@@ -1,6 +1,13 @@
2173 + #!/bin/sh
2174 + # Runs copy_to/from_user infrastructure using test_user_copy kernel module
2175 +
2176 ++# Kselftest framework requirement - SKIP code is 4.
2177 ++ksft_skip=4
2178 ++
2179 ++if ! /sbin/modprobe -q -n test_user_copy; then
2180 ++ echo "user: module test_user_copy is not found [SKIP]"
2181 ++ exit $ksft_skip
2182 ++fi
2183 + if /sbin/modprobe -q test_user_copy; then
2184 + /sbin/modprobe -q -r test_user_copy
2185 + echo "user_copy: ok"
2186 +diff --git a/tools/testing/selftests/x86/sigreturn.c b/tools/testing/selftests/x86/sigreturn.c
2187 +index b5aa1bab7416..97ad2d40324a 100644
2188 +--- a/tools/testing/selftests/x86/sigreturn.c
2189 ++++ b/tools/testing/selftests/x86/sigreturn.c
2190 +@@ -456,19 +456,38 @@ static int test_valid_sigreturn(int cs_bits, bool use_16bit_ss, int force_ss)
2191 + greg_t req = requested_regs[i], res = resulting_regs[i];
2192 + if (i == REG_TRAPNO || i == REG_IP)
2193 + continue; /* don't care */
2194 +- if (i == REG_SP) {
2195 +- printf("\tSP: %llx -> %llx\n", (unsigned long long)req,
2196 +- (unsigned long long)res);
2197 +
2198 ++ if (i == REG_SP) {
2199 + /*
2200 +- * In many circumstances, the high 32 bits of rsp
2201 +- * are zeroed. For example, we could be a real
2202 +- * 32-bit program, or we could hit any of a number
2203 +- * of poorly-documented IRET or segmented ESP
2204 +- * oddities. If this happens, it's okay.
2205 ++ * If we were using a 16-bit stack segment, then
2206 ++ * the kernel is a bit stuck: IRET only restores
2207 ++ * the low 16 bits of ESP/RSP if SS is 16-bit.
2208 ++ * The kernel uses a hack to restore bits 31:16,
2209 ++ * but that hack doesn't help with bits 63:32.
2210 ++ * On Intel CPUs, bits 63:32 end up zeroed, and, on
2211 ++ * AMD CPUs, they leak the high bits of the kernel
2212 ++ * espfix64 stack pointer. There's very little that
2213 ++ * the kernel can do about it.
2214 ++ *
2215 ++ * Similarly, if we are returning to a 32-bit context,
2216 ++ * the CPU will often lose the high 32 bits of RSP.
2217 + */
2218 +- if (res == (req & 0xFFFFFFFF))
2219 +- continue; /* OK; not expected to work */
2220 ++
2221 ++ if (res == req)
2222 ++ continue;
2223 ++
2224 ++ if (cs_bits != 64 && ((res ^ req) & 0xFFFFFFFF) == 0) {
2225 ++ printf("[NOTE]\tSP: %llx -> %llx\n",
2226 ++ (unsigned long long)req,
2227 ++ (unsigned long long)res);
2228 ++ continue;
2229 ++ }
2230 ++
2231 ++ printf("[FAIL]\tSP mismatch: requested 0x%llx; got 0x%llx\n",
2232 ++ (unsigned long long)requested_regs[i],
2233 ++ (unsigned long long)resulting_regs[i]);
2234 ++ nerrs++;
2235 ++ continue;
2236 + }
2237 +
2238 + bool ignore_reg = false;
2239 +@@ -507,13 +526,6 @@ static int test_valid_sigreturn(int cs_bits, bool use_16bit_ss, int force_ss)
2240 + }
2241 +
2242 + if (requested_regs[i] != resulting_regs[i] && !ignore_reg) {
2243 +- /*
2244 +- * SP is particularly interesting here. The
2245 +- * usual cause of failures is that we hit the
2246 +- * nasty IRET case of returning to a 16-bit SS,
2247 +- * in which case bits 16:31 of the *kernel*
2248 +- * stack pointer persist in ESP.
2249 +- */
2250 + printf("[FAIL]\tReg %d mismatch: requested 0x%llx; got 0x%llx\n",
2251 + i, (unsigned long long)requested_regs[i],
2252 + (unsigned long long)resulting_regs[i]);
2253 +diff --git a/tools/testing/selftests/zram/zram.sh b/tools/testing/selftests/zram/zram.sh
2254 +index 683a292e3290..9399c4aeaa26 100755
2255 +--- a/tools/testing/selftests/zram/zram.sh
2256 ++++ b/tools/testing/selftests/zram/zram.sh
2257 +@@ -1,6 +1,9 @@
2258 + #!/bin/bash
2259 + TCID="zram.sh"
2260 +
2261 ++# Kselftest framework requirement - SKIP code is 4.
2262 ++ksft_skip=4
2263 ++
2264 + . ./zram_lib.sh
2265 +
2266 + run_zram () {
2267 +@@ -23,5 +26,5 @@ elif [ -b /dev/zram0 ]; then
2268 + else
2269 + echo "$TCID : No zram.ko module or /dev/zram0 device file not found"
2270 + echo "$TCID : CONFIG_ZRAM is not set"
2271 +- exit 1
2272 ++ exit $ksft_skip
2273 + fi
2274 +diff --git a/tools/testing/selftests/zram/zram_lib.sh b/tools/testing/selftests/zram/zram_lib.sh
2275 +index f6a9c73e7a44..9e73a4fb9b0a 100755
2276 +--- a/tools/testing/selftests/zram/zram_lib.sh
2277 ++++ b/tools/testing/selftests/zram/zram_lib.sh
2278 +@@ -18,6 +18,9 @@ MODULE=0
2279 + dev_makeswap=-1
2280 + dev_mounted=-1
2281 +
2282 ++# Kselftest framework requirement - SKIP code is 4.
2283 ++ksft_skip=4
2284 ++
2285 + trap INT
2286 +
2287 + check_prereqs()
2288 +@@ -27,7 +30,7 @@ check_prereqs()
2289 +
2290 + if [ $uid -ne 0 ]; then
2291 + echo $msg must be run as root >&2
2292 +- exit 0
2293 ++ exit $ksft_skip
2294 + fi
2295 + }
2296 +
2297 +diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
2298 +index 1203829316b2..f509cfd37db5 100644
2299 +--- a/virt/kvm/eventfd.c
2300 ++++ b/virt/kvm/eventfd.c
2301 +@@ -405,11 +405,6 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
2302 + if (events & POLLIN)
2303 + schedule_work(&irqfd->inject);
2304 +
2305 +- /*
2306 +- * do not drop the file until the irqfd is fully initialized, otherwise
2307 +- * we might race against the POLLHUP
2308 +- */
2309 +- fdput(f);
2310 + #ifdef CONFIG_HAVE_KVM_IRQ_BYPASS
2311 + irqfd->consumer.token = (void *)irqfd->eventfd;
2312 + irqfd->consumer.add_producer = kvm_arch_irq_bypass_add_producer;
2313 +@@ -423,6 +418,12 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
2314 + #endif
2315 +
2316 + srcu_read_unlock(&kvm->irq_srcu, idx);
2317 ++
2318 ++ /*
2319 ++ * do not drop the file until the irqfd is fully initialized, otherwise
2320 ++ * we might race against the POLLHUP
2321 ++ */
2322 ++ fdput(f);
2323 + return 0;
2324 +
2325 + fail: