Gentoo Archives: gentoo-commits

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