Magellan Linux

Contents of /trunk/kernel-alx/patches-4.4/0154-4.4.55-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2890 - (show annotations) (download)
Mon Mar 27 13:49:27 2017 UTC (7 years, 1 month ago) by niro
File size: 39567 byte(s)
linux-4.4.55
1 diff --git a/Makefile b/Makefile
2 index 7f54ac081cf3..d9cc21df444d 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 4
7 PATCHLEVEL = 4
8 -SUBLEVEL = 54
9 +SUBLEVEL = 55
10 EXTRAVERSION =
11 NAME = Blurry Fish Butt
12
13 diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig
14 index 57ed466e00db..2f140d75d01c 100644
15 --- a/arch/mips/configs/ip22_defconfig
16 +++ b/arch/mips/configs/ip22_defconfig
17 @@ -68,8 +68,8 @@ CONFIG_NETFILTER_NETLINK_QUEUE=m
18 CONFIG_NF_CONNTRACK=m
19 CONFIG_NF_CONNTRACK_SECMARK=y
20 CONFIG_NF_CONNTRACK_EVENTS=y
21 -CONFIG_NF_CT_PROTO_DCCP=m
22 -CONFIG_NF_CT_PROTO_UDPLITE=m
23 +CONFIG_NF_CT_PROTO_DCCP=y
24 +CONFIG_NF_CT_PROTO_UDPLITE=y
25 CONFIG_NF_CONNTRACK_AMANDA=m
26 CONFIG_NF_CONNTRACK_FTP=m
27 CONFIG_NF_CONNTRACK_H323=m
28 diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig
29 index 48e16d98b2cc..b15508447366 100644
30 --- a/arch/mips/configs/ip27_defconfig
31 +++ b/arch/mips/configs/ip27_defconfig
32 @@ -134,7 +134,7 @@ CONFIG_LIBFC=m
33 CONFIG_SCSI_QLOGIC_1280=y
34 CONFIG_SCSI_PMCRAID=m
35 CONFIG_SCSI_BFA_FC=m
36 -CONFIG_SCSI_DH=m
37 +CONFIG_SCSI_DH=y
38 CONFIG_SCSI_DH_RDAC=m
39 CONFIG_SCSI_DH_HP_SW=m
40 CONFIG_SCSI_DH_EMC=m
41 @@ -206,7 +206,6 @@ CONFIG_MLX4_EN=m
42 # CONFIG_MLX4_DEBUG is not set
43 CONFIG_TEHUTI=m
44 CONFIG_BNX2X=m
45 -CONFIG_QLGE=m
46 CONFIG_SFC=m
47 CONFIG_BE2NET=m
48 CONFIG_LIBERTAS_THINFIRM=m
49 diff --git a/arch/mips/configs/lemote2f_defconfig b/arch/mips/configs/lemote2f_defconfig
50 index 004cf52d1b7d..c24b87819ccb 100644
51 --- a/arch/mips/configs/lemote2f_defconfig
52 +++ b/arch/mips/configs/lemote2f_defconfig
53 @@ -39,7 +39,7 @@ CONFIG_HIBERNATION=y
54 CONFIG_PM_STD_PARTITION="/dev/hda3"
55 CONFIG_CPU_FREQ=y
56 CONFIG_CPU_FREQ_DEBUG=y
57 -CONFIG_CPU_FREQ_STAT=m
58 +CONFIG_CPU_FREQ_STAT=y
59 CONFIG_CPU_FREQ_STAT_DETAILS=y
60 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
61 CONFIG_CPU_FREQ_GOV_POWERSAVE=m
62 diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig
63 index 5afb4840aec7..739ccd0dca64 100644
64 --- a/arch/mips/configs/malta_defconfig
65 +++ b/arch/mips/configs/malta_defconfig
66 @@ -59,8 +59,8 @@ CONFIG_NETFILTER=y
67 CONFIG_NF_CONNTRACK=m
68 CONFIG_NF_CONNTRACK_SECMARK=y
69 CONFIG_NF_CONNTRACK_EVENTS=y
70 -CONFIG_NF_CT_PROTO_DCCP=m
71 -CONFIG_NF_CT_PROTO_UDPLITE=m
72 +CONFIG_NF_CT_PROTO_DCCP=y
73 +CONFIG_NF_CT_PROTO_UDPLITE=y
74 CONFIG_NF_CONNTRACK_AMANDA=m
75 CONFIG_NF_CONNTRACK_FTP=m
76 CONFIG_NF_CONNTRACK_H323=m
77 diff --git a/arch/mips/configs/malta_kvm_defconfig b/arch/mips/configs/malta_kvm_defconfig
78 index 98f13879bb8f..47f4ecf125ba 100644
79 --- a/arch/mips/configs/malta_kvm_defconfig
80 +++ b/arch/mips/configs/malta_kvm_defconfig
81 @@ -60,8 +60,8 @@ CONFIG_NETFILTER=y
82 CONFIG_NF_CONNTRACK=m
83 CONFIG_NF_CONNTRACK_SECMARK=y
84 CONFIG_NF_CONNTRACK_EVENTS=y
85 -CONFIG_NF_CT_PROTO_DCCP=m
86 -CONFIG_NF_CT_PROTO_UDPLITE=m
87 +CONFIG_NF_CT_PROTO_DCCP=y
88 +CONFIG_NF_CT_PROTO_UDPLITE=y
89 CONFIG_NF_CONNTRACK_AMANDA=m
90 CONFIG_NF_CONNTRACK_FTP=m
91 CONFIG_NF_CONNTRACK_H323=m
92 diff --git a/arch/mips/configs/malta_kvm_guest_defconfig b/arch/mips/configs/malta_kvm_guest_defconfig
93 index 3b5d5913f548..e79d325aa085 100644
94 --- a/arch/mips/configs/malta_kvm_guest_defconfig
95 +++ b/arch/mips/configs/malta_kvm_guest_defconfig
96 @@ -59,8 +59,8 @@ CONFIG_NETFILTER=y
97 CONFIG_NF_CONNTRACK=m
98 CONFIG_NF_CONNTRACK_SECMARK=y
99 CONFIG_NF_CONNTRACK_EVENTS=y
100 -CONFIG_NF_CT_PROTO_DCCP=m
101 -CONFIG_NF_CT_PROTO_UDPLITE=m
102 +CONFIG_NF_CT_PROTO_DCCP=y
103 +CONFIG_NF_CT_PROTO_UDPLITE=y
104 CONFIG_NF_CONNTRACK_AMANDA=m
105 CONFIG_NF_CONNTRACK_FTP=m
106 CONFIG_NF_CONNTRACK_H323=m
107 diff --git a/arch/mips/configs/maltaup_xpa_defconfig b/arch/mips/configs/maltaup_xpa_defconfig
108 index 732215732751..ae87ad86243b 100644
109 --- a/arch/mips/configs/maltaup_xpa_defconfig
110 +++ b/arch/mips/configs/maltaup_xpa_defconfig
111 @@ -61,8 +61,8 @@ CONFIG_NETFILTER=y
112 CONFIG_NF_CONNTRACK=m
113 CONFIG_NF_CONNTRACK_SECMARK=y
114 CONFIG_NF_CONNTRACK_EVENTS=y
115 -CONFIG_NF_CT_PROTO_DCCP=m
116 -CONFIG_NF_CT_PROTO_UDPLITE=m
117 +CONFIG_NF_CT_PROTO_DCCP=y
118 +CONFIG_NF_CT_PROTO_UDPLITE=y
119 CONFIG_NF_CONNTRACK_AMANDA=m
120 CONFIG_NF_CONNTRACK_FTP=m
121 CONFIG_NF_CONNTRACK_H323=m
122 diff --git a/arch/mips/configs/nlm_xlp_defconfig b/arch/mips/configs/nlm_xlp_defconfig
123 index b3d1d37f85ea..47492fee2952 100644
124 --- a/arch/mips/configs/nlm_xlp_defconfig
125 +++ b/arch/mips/configs/nlm_xlp_defconfig
126 @@ -111,7 +111,7 @@ CONFIG_NETFILTER=y
127 CONFIG_NF_CONNTRACK=m
128 CONFIG_NF_CONNTRACK_SECMARK=y
129 CONFIG_NF_CONNTRACK_EVENTS=y
130 -CONFIG_NF_CT_PROTO_UDPLITE=m
131 +CONFIG_NF_CT_PROTO_UDPLITE=y
132 CONFIG_NF_CONNTRACK_AMANDA=m
133 CONFIG_NF_CONNTRACK_FTP=m
134 CONFIG_NF_CONNTRACK_H323=m
135 diff --git a/arch/mips/configs/nlm_xlr_defconfig b/arch/mips/configs/nlm_xlr_defconfig
136 index 3d8016d6cf3e..472a818f1eb8 100644
137 --- a/arch/mips/configs/nlm_xlr_defconfig
138 +++ b/arch/mips/configs/nlm_xlr_defconfig
139 @@ -91,7 +91,7 @@ CONFIG_NETFILTER=y
140 CONFIG_NF_CONNTRACK=m
141 CONFIG_NF_CONNTRACK_SECMARK=y
142 CONFIG_NF_CONNTRACK_EVENTS=y
143 -CONFIG_NF_CT_PROTO_UDPLITE=m
144 +CONFIG_NF_CT_PROTO_UDPLITE=y
145 CONFIG_NF_CONNTRACK_AMANDA=m
146 CONFIG_NF_CONNTRACK_FTP=m
147 CONFIG_NF_CONNTRACK_H323=m
148 diff --git a/arch/mips/dec/int-handler.S b/arch/mips/dec/int-handler.S
149 index 8c6f508e59de..554d1da97743 100644
150 --- a/arch/mips/dec/int-handler.S
151 +++ b/arch/mips/dec/int-handler.S
152 @@ -146,7 +146,25 @@
153 /*
154 * Find irq with highest priority
155 */
156 - PTR_LA t1,cpu_mask_nr_tbl
157 + # open coded PTR_LA t1, cpu_mask_nr_tbl
158 +#if (_MIPS_SZPTR == 32)
159 + # open coded la t1, cpu_mask_nr_tbl
160 + lui t1, %hi(cpu_mask_nr_tbl)
161 + addiu t1, %lo(cpu_mask_nr_tbl)
162 +
163 +#endif
164 +#if (_MIPS_SZPTR == 64)
165 + # open coded dla t1, cpu_mask_nr_tbl
166 + .set push
167 + .set noat
168 + lui t1, %highest(cpu_mask_nr_tbl)
169 + lui AT, %hi(cpu_mask_nr_tbl)
170 + daddiu t1, t1, %higher(cpu_mask_nr_tbl)
171 + daddiu AT, AT, %lo(cpu_mask_nr_tbl)
172 + dsll t1, 32
173 + daddu t1, t1, AT
174 + .set pop
175 +#endif
176 1: lw t2,(t1)
177 nop
178 and t2,t0
179 @@ -195,7 +213,25 @@
180 /*
181 * Find irq with highest priority
182 */
183 - PTR_LA t1,asic_mask_nr_tbl
184 + # open coded PTR_LA t1,asic_mask_nr_tbl
185 +#if (_MIPS_SZPTR == 32)
186 + # open coded la t1, asic_mask_nr_tbl
187 + lui t1, %hi(asic_mask_nr_tbl)
188 + addiu t1, %lo(asic_mask_nr_tbl)
189 +
190 +#endif
191 +#if (_MIPS_SZPTR == 64)
192 + # open coded dla t1, asic_mask_nr_tbl
193 + .set push
194 + .set noat
195 + lui t1, %highest(asic_mask_nr_tbl)
196 + lui AT, %hi(asic_mask_nr_tbl)
197 + daddiu t1, t1, %higher(asic_mask_nr_tbl)
198 + daddiu AT, AT, %lo(asic_mask_nr_tbl)
199 + dsll t1, 32
200 + daddu t1, t1, AT
201 + .set pop
202 +#endif
203 2: lw t2,(t1)
204 nop
205 and t2,t0
206 diff --git a/arch/mips/netlogic/common/reset.S b/arch/mips/netlogic/common/reset.S
207 index edbab9b8691f..c474981a6c0d 100644
208 --- a/arch/mips/netlogic/common/reset.S
209 +++ b/arch/mips/netlogic/common/reset.S
210 @@ -50,7 +50,6 @@
211 #include <asm/netlogic/xlp-hal/sys.h>
212 #include <asm/netlogic/xlp-hal/cpucontrol.h>
213
214 -#define CP0_EBASE $15
215 #define SYS_CPU_COHERENT_BASE CKSEG1ADDR(XLP_DEFAULT_IO_BASE) + \
216 XLP_IO_SYS_OFFSET(0) + XLP_IO_PCI_HDRSZ + \
217 SYS_CPU_NONCOHERENT_MODE * 4
218 @@ -92,7 +91,7 @@
219 * registers. On XLPII CPUs, usual cache instructions work.
220 */
221 .macro xlp_flush_l1_dcache
222 - mfc0 t0, CP0_EBASE, 0
223 + mfc0 t0, CP0_PRID
224 andi t0, t0, PRID_IMP_MASK
225 slt t1, t0, 0x1200
226 beqz t1, 15f
227 @@ -171,7 +170,7 @@ FEXPORT(nlm_reset_entry)
228 nop
229
230 1: /* Entry point on core wakeup */
231 - mfc0 t0, CP0_EBASE, 0 /* processor ID */
232 + mfc0 t0, CP0_PRID /* processor ID */
233 andi t0, PRID_IMP_MASK
234 li t1, 0x1500 /* XLP 9xx */
235 beq t0, t1, 2f /* does not need to set coherent */
236 @@ -182,8 +181,8 @@ FEXPORT(nlm_reset_entry)
237 nop
238
239 /* set bit in SYS coherent register for the core */
240 - mfc0 t0, CP0_EBASE, 1
241 - mfc0 t1, CP0_EBASE, 1
242 + mfc0 t0, CP0_EBASE
243 + mfc0 t1, CP0_EBASE
244 srl t1, 5
245 andi t1, 0x3 /* t1 <- node */
246 li t2, 0x40000
247 @@ -232,7 +231,7 @@ EXPORT(nlm_boot_siblings)
248
249 * NOTE: All GPR contents are lost after the mtcr above!
250 */
251 - mfc0 v0, CP0_EBASE, 1
252 + mfc0 v0, CP0_EBASE
253 andi v0, 0x3ff /* v0 <- node/core */
254
255 /*
256 diff --git a/arch/mips/netlogic/common/smpboot.S b/arch/mips/netlogic/common/smpboot.S
257 index 805355b0bd05..f0cc4c9de2bb 100644
258 --- a/arch/mips/netlogic/common/smpboot.S
259 +++ b/arch/mips/netlogic/common/smpboot.S
260 @@ -48,8 +48,6 @@
261 #include <asm/netlogic/xlp-hal/sys.h>
262 #include <asm/netlogic/xlp-hal/cpucontrol.h>
263
264 -#define CP0_EBASE $15
265 -
266 .set noreorder
267 .set noat
268 .set arch=xlr /* for mfcr/mtcr, XLR is sufficient */
269 @@ -86,7 +84,7 @@ NESTED(nlm_boot_secondary_cpus, 16, sp)
270 PTR_L gp, 0(t1)
271
272 /* a0 has the processor id */
273 - mfc0 a0, CP0_EBASE, 1
274 + mfc0 a0, CP0_EBASE
275 andi a0, 0x3ff /* a0 <- node/core */
276 PTR_LA t0, nlm_early_init_secondary
277 jalr t0
278 diff --git a/arch/mips/ralink/prom.c b/arch/mips/ralink/prom.c
279 index 39a9142f71be..7ecb4af79b7b 100644
280 --- a/arch/mips/ralink/prom.c
281 +++ b/arch/mips/ralink/prom.c
282 @@ -30,8 +30,10 @@ const char *get_system_type(void)
283 return soc_info.sys_type;
284 }
285
286 -static __init void prom_init_cmdline(int argc, char **argv)
287 +static __init void prom_init_cmdline(void)
288 {
289 + int argc;
290 + char **argv;
291 int i;
292
293 pr_debug("prom: fw_arg0=%08x fw_arg1=%08x fw_arg2=%08x fw_arg3=%08x\n",
294 @@ -60,14 +62,11 @@ static __init void prom_init_cmdline(int argc, char **argv)
295
296 void __init prom_init(void)
297 {
298 - int argc;
299 - char **argv;
300 -
301 prom_soc_init(&soc_info);
302
303 pr_info("SoC Type: %s\n", get_system_type());
304
305 - prom_init_cmdline(argc, argv);
306 + prom_init_cmdline();
307 }
308
309 void __init prom_free_prom_memory(void)
310 diff --git a/arch/mips/ralink/rt288x.c b/arch/mips/ralink/rt288x.c
311 index 844f5cd55c8f..15506a1ff22a 100644
312 --- a/arch/mips/ralink/rt288x.c
313 +++ b/arch/mips/ralink/rt288x.c
314 @@ -40,16 +40,6 @@ static struct rt2880_pmx_group rt2880_pinmux_data_act[] = {
315 { 0 }
316 };
317
318 -static void rt288x_wdt_reset(void)
319 -{
320 - u32 t;
321 -
322 - /* enable WDT reset output on pin SRAM_CS_N */
323 - t = rt_sysc_r32(SYSC_REG_CLKCFG);
324 - t |= CLKCFG_SRAM_CS_N_WDT;
325 - rt_sysc_w32(t, SYSC_REG_CLKCFG);
326 -}
327 -
328 void __init ralink_clk_init(void)
329 {
330 unsigned long cpu_rate, wmac_rate = 40000000;
331 diff --git a/arch/mips/ralink/rt305x.c b/arch/mips/ralink/rt305x.c
332 index 9e4572592065..15b32cd01906 100644
333 --- a/arch/mips/ralink/rt305x.c
334 +++ b/arch/mips/ralink/rt305x.c
335 @@ -89,17 +89,6 @@ static struct rt2880_pmx_group rt5350_pinmux_data[] = {
336 { 0 }
337 };
338
339 -static void rt305x_wdt_reset(void)
340 -{
341 - u32 t;
342 -
343 - /* enable WDT reset output on pin SRAM_CS_N */
344 - t = rt_sysc_r32(SYSC_REG_SYSTEM_CONFIG);
345 - t |= RT305X_SYSCFG_SRAM_CS0_MODE_WDT <<
346 - RT305X_SYSCFG_SRAM_CS0_MODE_SHIFT;
347 - rt_sysc_w32(t, SYSC_REG_SYSTEM_CONFIG);
348 -}
349 -
350 static unsigned long rt5350_get_mem_size(void)
351 {
352 void __iomem *sysc = (void __iomem *) KSEG1ADDR(RT305X_SYSC_BASE);
353 diff --git a/arch/mips/ralink/rt3883.c b/arch/mips/ralink/rt3883.c
354 index 582995aaaf4e..f42834c7f007 100644
355 --- a/arch/mips/ralink/rt3883.c
356 +++ b/arch/mips/ralink/rt3883.c
357 @@ -63,16 +63,6 @@ static struct rt2880_pmx_group rt3883_pinmux_data[] = {
358 { 0 }
359 };
360
361 -static void rt3883_wdt_reset(void)
362 -{
363 - u32 t;
364 -
365 - /* enable WDT reset output on GPIO 2 */
366 - t = rt_sysc_r32(RT3883_SYSC_REG_SYSCFG1);
367 - t |= RT3883_SYSCFG1_GPIO2_AS_WDT_OUT;
368 - rt_sysc_w32(t, RT3883_SYSC_REG_SYSCFG1);
369 -}
370 -
371 void __init ralink_clk_init(void)
372 {
373 unsigned long cpu_rate, sys_rate;
374 diff --git a/arch/mips/sgi-ip22/Platform b/arch/mips/sgi-ip22/Platform
375 index b7a4b7e04c38..e8f6b3a42a48 100644
376 --- a/arch/mips/sgi-ip22/Platform
377 +++ b/arch/mips/sgi-ip22/Platform
378 @@ -25,7 +25,7 @@ endif
379 # Simplified: what IP22 does at 128MB+ in ksegN, IP28 does at 512MB+ in xkphys
380 #
381 ifdef CONFIG_SGI_IP28
382 - ifeq ($(call cc-option-yn,-mr10k-cache-barrier=store), n)
383 + ifeq ($(call cc-option-yn,-march=r10000 -mr10k-cache-barrier=store), n)
384 $(error gcc doesn't support needed option -mr10k-cache-barrier=store)
385 endif
386 endif
387 diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
388 index dc885b30f7a6..4014881e9843 100644
389 --- a/arch/powerpc/lib/sstep.c
390 +++ b/arch/powerpc/lib/sstep.c
391 @@ -1806,8 +1806,6 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
392 goto instr_done;
393
394 case LARX:
395 - if (regs->msr & MSR_LE)
396 - return 0;
397 if (op.ea & (size - 1))
398 break; /* can't handle misaligned */
399 err = -EFAULT;
400 @@ -1829,8 +1827,6 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
401 goto ldst_done;
402
403 case STCX:
404 - if (regs->msr & MSR_LE)
405 - return 0;
406 if (op.ea & (size - 1))
407 break; /* can't handle misaligned */
408 err = -EFAULT;
409 @@ -1854,8 +1850,6 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
410 goto ldst_done;
411
412 case LOAD:
413 - if (regs->msr & MSR_LE)
414 - return 0;
415 err = read_mem(&regs->gpr[op.reg], op.ea, size, regs);
416 if (!err) {
417 if (op.type & SIGNEXT)
418 @@ -1867,8 +1861,6 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
419
420 #ifdef CONFIG_PPC_FPU
421 case LOAD_FP:
422 - if (regs->msr & MSR_LE)
423 - return 0;
424 if (size == 4)
425 err = do_fp_load(op.reg, do_lfs, op.ea, size, regs);
426 else
427 @@ -1877,15 +1869,11 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
428 #endif
429 #ifdef CONFIG_ALTIVEC
430 case LOAD_VMX:
431 - if (regs->msr & MSR_LE)
432 - return 0;
433 err = do_vec_load(op.reg, do_lvx, op.ea & ~0xfUL, regs);
434 goto ldst_done;
435 #endif
436 #ifdef CONFIG_VSX
437 case LOAD_VSX:
438 - if (regs->msr & MSR_LE)
439 - return 0;
440 err = do_vsx_load(op.reg, do_lxvd2x, op.ea, regs);
441 goto ldst_done;
442 #endif
443 @@ -1908,8 +1896,6 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
444 goto instr_done;
445
446 case STORE:
447 - if (regs->msr & MSR_LE)
448 - return 0;
449 if ((op.type & UPDATE) && size == sizeof(long) &&
450 op.reg == 1 && op.update_reg == 1 &&
451 !(regs->msr & MSR_PR) &&
452 @@ -1922,8 +1908,6 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
453
454 #ifdef CONFIG_PPC_FPU
455 case STORE_FP:
456 - if (regs->msr & MSR_LE)
457 - return 0;
458 if (size == 4)
459 err = do_fp_store(op.reg, do_stfs, op.ea, size, regs);
460 else
461 @@ -1932,15 +1916,11 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr)
462 #endif
463 #ifdef CONFIG_ALTIVEC
464 case STORE_VMX:
465 - if (regs->msr & MSR_LE)
466 - return 0;
467 err = do_vec_store(op.reg, do_stvx, op.ea & ~0xfUL, regs);
468 goto ldst_done;
469 #endif
470 #ifdef CONFIG_VSX
471 case STORE_VSX:
472 - if (regs->msr & MSR_LE)
473 - return 0;
474 err = do_vsx_store(op.reg, do_stxvd2x, op.ea, regs);
475 goto ldst_done;
476 #endif
477 diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
478 index 171e09bb8ea2..f7c3a61040bd 100644
479 --- a/arch/s390/kernel/crash_dump.c
480 +++ b/arch/s390/kernel/crash_dump.c
481 @@ -23,6 +23,8 @@
482 #define PTR_SUB(x, y) (((char *) (x)) - ((unsigned long) (y)))
483 #define PTR_DIFF(x, y) ((unsigned long)(((char *) (x)) - ((unsigned long) (y))))
484
485 +#define LINUX_NOTE_NAME "LINUX"
486 +
487 static struct memblock_region oldmem_region;
488
489 static struct memblock_type oldmem_type = {
490 @@ -312,7 +314,7 @@ static void *nt_fpregset(void *ptr, struct save_area *sa)
491 static void *nt_s390_timer(void *ptr, struct save_area *sa)
492 {
493 return nt_init(ptr, NT_S390_TIMER, &sa->timer, sizeof(sa->timer),
494 - KEXEC_CORE_NOTE_NAME);
495 + LINUX_NOTE_NAME);
496 }
497
498 /*
499 @@ -321,7 +323,7 @@ static void *nt_s390_timer(void *ptr, struct save_area *sa)
500 static void *nt_s390_tod_cmp(void *ptr, struct save_area *sa)
501 {
502 return nt_init(ptr, NT_S390_TODCMP, &sa->clk_cmp,
503 - sizeof(sa->clk_cmp), KEXEC_CORE_NOTE_NAME);
504 + sizeof(sa->clk_cmp), LINUX_NOTE_NAME);
505 }
506
507 /*
508 @@ -330,7 +332,7 @@ static void *nt_s390_tod_cmp(void *ptr, struct save_area *sa)
509 static void *nt_s390_tod_preg(void *ptr, struct save_area *sa)
510 {
511 return nt_init(ptr, NT_S390_TODPREG, &sa->tod_reg,
512 - sizeof(sa->tod_reg), KEXEC_CORE_NOTE_NAME);
513 + sizeof(sa->tod_reg), LINUX_NOTE_NAME);
514 }
515
516 /*
517 @@ -339,7 +341,7 @@ static void *nt_s390_tod_preg(void *ptr, struct save_area *sa)
518 static void *nt_s390_ctrs(void *ptr, struct save_area *sa)
519 {
520 return nt_init(ptr, NT_S390_CTRS, &sa->ctrl_regs,
521 - sizeof(sa->ctrl_regs), KEXEC_CORE_NOTE_NAME);
522 + sizeof(sa->ctrl_regs), LINUX_NOTE_NAME);
523 }
524
525 /*
526 @@ -348,7 +350,7 @@ static void *nt_s390_ctrs(void *ptr, struct save_area *sa)
527 static void *nt_s390_prefix(void *ptr, struct save_area *sa)
528 {
529 return nt_init(ptr, NT_S390_PREFIX, &sa->pref_reg,
530 - sizeof(sa->pref_reg), KEXEC_CORE_NOTE_NAME);
531 + sizeof(sa->pref_reg), LINUX_NOTE_NAME);
532 }
533
534 /*
535 @@ -357,7 +359,7 @@ static void *nt_s390_prefix(void *ptr, struct save_area *sa)
536 static void *nt_s390_vx_high(void *ptr, __vector128 *vx_regs)
537 {
538 return nt_init(ptr, NT_S390_VXRS_HIGH, &vx_regs[16],
539 - 16 * sizeof(__vector128), KEXEC_CORE_NOTE_NAME);
540 + 16 * sizeof(__vector128), LINUX_NOTE_NAME);
541 }
542
543 /*
544 @@ -370,12 +372,12 @@ static void *nt_s390_vx_low(void *ptr, __vector128 *vx_regs)
545 int i;
546
547 note = (Elf64_Nhdr *)ptr;
548 - note->n_namesz = strlen(KEXEC_CORE_NOTE_NAME) + 1;
549 + note->n_namesz = strlen(LINUX_NOTE_NAME) + 1;
550 note->n_descsz = 16 * 8;
551 note->n_type = NT_S390_VXRS_LOW;
552 len = sizeof(Elf64_Nhdr);
553
554 - memcpy(ptr + len, KEXEC_CORE_NOTE_NAME, note->n_namesz);
555 + memcpy(ptr + len, LINUX_NOTE_NAME, note->n_namesz);
556 len = roundup(len + note->n_namesz, 4);
557
558 ptr += len;
559 diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
560 index 8345ae1f117d..05ae254f84cf 100644
561 --- a/arch/s390/mm/pgtable.c
562 +++ b/arch/s390/mm/pgtable.c
563 @@ -1237,11 +1237,28 @@ EXPORT_SYMBOL_GPL(s390_reset_cmma);
564 */
565 bool gmap_test_and_clear_dirty(unsigned long address, struct gmap *gmap)
566 {
567 + pgd_t *pgd;
568 + pud_t *pud;
569 + pmd_t *pmd;
570 pte_t *pte;
571 spinlock_t *ptl;
572 bool dirty = false;
573
574 - pte = get_locked_pte(gmap->mm, address, &ptl);
575 + pgd = pgd_offset(gmap->mm, address);
576 + pud = pud_alloc(gmap->mm, pgd, address);
577 + if (!pud)
578 + return false;
579 + pmd = pmd_alloc(gmap->mm, pud, address);
580 + if (!pmd)
581 + return false;
582 + /* We can't run guests backed by huge pages, but userspace can
583 + * still set them up and then try to migrate them without any
584 + * migration support.
585 + */
586 + if (pmd_large(*pmd))
587 + return true;
588 +
589 + pte = pte_alloc_map_lock(gmap->mm, pmd, address, &ptl);
590 if (unlikely(!pte))
591 return false;
592
593 diff --git a/crypto/Makefile b/crypto/Makefile
594 index 82fbff180ad3..03e66097eb0c 100644
595 --- a/crypto/Makefile
596 +++ b/crypto/Makefile
597 @@ -62,6 +62,7 @@ obj-$(CONFIG_CRYPTO_SHA1) += sha1_generic.o
598 obj-$(CONFIG_CRYPTO_SHA256) += sha256_generic.o
599 obj-$(CONFIG_CRYPTO_SHA512) += sha512_generic.o
600 obj-$(CONFIG_CRYPTO_WP512) += wp512.o
601 +CFLAGS_wp512.o := $(call cc-option,-fno-schedule-insns) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
602 obj-$(CONFIG_CRYPTO_TGR192) += tgr192.o
603 obj-$(CONFIG_CRYPTO_GF128MUL) += gf128mul.o
604 obj-$(CONFIG_CRYPTO_ECB) += ecb.o
605 @@ -85,6 +86,7 @@ obj-$(CONFIG_CRYPTO_BLOWFISH_COMMON) += blowfish_common.o
606 obj-$(CONFIG_CRYPTO_TWOFISH) += twofish_generic.o
607 obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o
608 obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o
609 +CFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149
610 obj-$(CONFIG_CRYPTO_AES) += aes_generic.o
611 obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o
612 obj-$(CONFIG_CRYPTO_CAST_COMMON) += cast_common.o
613 diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
614 index c097f477c74c..14c2a07c9f3f 100644
615 --- a/drivers/acpi/nfit.c
616 +++ b/drivers/acpi/nfit.c
617 @@ -965,7 +965,7 @@ static size_t sizeof_nfit_set_info(int num_mappings)
618 + num_mappings * sizeof(struct nfit_set_info_map);
619 }
620
621 -static int cmp_map(const void *m0, const void *m1)
622 +static int cmp_map_compat(const void *m0, const void *m1)
623 {
624 const struct nfit_set_info_map *map0 = m0;
625 const struct nfit_set_info_map *map1 = m1;
626 @@ -974,6 +974,14 @@ static int cmp_map(const void *m0, const void *m1)
627 sizeof(u64));
628 }
629
630 +static int cmp_map(const void *m0, const void *m1)
631 +{
632 + const struct nfit_set_info_map *map0 = m0;
633 + const struct nfit_set_info_map *map1 = m1;
634 +
635 + return map0->region_offset - map1->region_offset;
636 +}
637 +
638 /* Retrieve the nth entry referencing this spa */
639 static struct acpi_nfit_memory_map *memdev_from_spa(
640 struct acpi_nfit_desc *acpi_desc, u16 range_index, int n)
641 @@ -1029,6 +1037,12 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc,
642 sort(&info->mapping[0], nr, sizeof(struct nfit_set_info_map),
643 cmp_map, NULL);
644 nd_set->cookie = nd_fletcher64(info, sizeof_nfit_set_info(nr), 0);
645 +
646 + /* support namespaces created with the wrong sort order */
647 + sort(&info->mapping[0], nr, sizeof(struct nfit_set_info_map),
648 + cmp_map_compat, NULL);
649 + nd_set->altcookie = nd_fletcher64(info, sizeof_nfit_set_info(nr), 0);
650 +
651 ndr_desc->nd_set = nd_set;
652 devm_kfree(dev, info);
653
654 diff --git a/drivers/md/dm.c b/drivers/md/dm.c
655 index 3384a3eef917..397f0454100b 100644
656 --- a/drivers/md/dm.c
657 +++ b/drivers/md/dm.c
658 @@ -1467,11 +1467,62 @@ void dm_accept_partial_bio(struct bio *bio, unsigned n_sectors)
659 }
660 EXPORT_SYMBOL_GPL(dm_accept_partial_bio);
661
662 +/*
663 + * Flush current->bio_list when the target map method blocks.
664 + * This fixes deadlocks in snapshot and possibly in other targets.
665 + */
666 +struct dm_offload {
667 + struct blk_plug plug;
668 + struct blk_plug_cb cb;
669 +};
670 +
671 +static void flush_current_bio_list(struct blk_plug_cb *cb, bool from_schedule)
672 +{
673 + struct dm_offload *o = container_of(cb, struct dm_offload, cb);
674 + struct bio_list list;
675 + struct bio *bio;
676 +
677 + INIT_LIST_HEAD(&o->cb.list);
678 +
679 + if (unlikely(!current->bio_list))
680 + return;
681 +
682 + list = *current->bio_list;
683 + bio_list_init(current->bio_list);
684 +
685 + while ((bio = bio_list_pop(&list))) {
686 + struct bio_set *bs = bio->bi_pool;
687 + if (unlikely(!bs) || bs == fs_bio_set) {
688 + bio_list_add(current->bio_list, bio);
689 + continue;
690 + }
691 +
692 + spin_lock(&bs->rescue_lock);
693 + bio_list_add(&bs->rescue_list, bio);
694 + queue_work(bs->rescue_workqueue, &bs->rescue_work);
695 + spin_unlock(&bs->rescue_lock);
696 + }
697 +}
698 +
699 +static void dm_offload_start(struct dm_offload *o)
700 +{
701 + blk_start_plug(&o->plug);
702 + o->cb.callback = flush_current_bio_list;
703 + list_add(&o->cb.list, &current->plug->cb_list);
704 +}
705 +
706 +static void dm_offload_end(struct dm_offload *o)
707 +{
708 + list_del(&o->cb.list);
709 + blk_finish_plug(&o->plug);
710 +}
711 +
712 static void __map_bio(struct dm_target_io *tio)
713 {
714 int r;
715 sector_t sector;
716 struct mapped_device *md;
717 + struct dm_offload o;
718 struct bio *clone = &tio->clone;
719 struct dm_target *ti = tio->ti;
720
721 @@ -1484,7 +1535,11 @@ static void __map_bio(struct dm_target_io *tio)
722 */
723 atomic_inc(&tio->io->io_count);
724 sector = clone->bi_iter.bi_sector;
725 +
726 + dm_offload_start(&o);
727 r = ti->type->map(ti, clone);
728 + dm_offload_end(&o);
729 +
730 if (r == DM_MAPIO_REMAPPED) {
731 /* the bio has been remapped so dispatch it */
732
733 diff --git a/drivers/mtd/maps/pmcmsp-flash.c b/drivers/mtd/maps/pmcmsp-flash.c
734 index f9fa3fad728e..2051f28ddac6 100644
735 --- a/drivers/mtd/maps/pmcmsp-flash.c
736 +++ b/drivers/mtd/maps/pmcmsp-flash.c
737 @@ -139,15 +139,13 @@ static int __init init_msp_flash(void)
738 }
739
740 msp_maps[i].bankwidth = 1;
741 - msp_maps[i].name = kmalloc(7, GFP_KERNEL);
742 + msp_maps[i].name = kstrndup(flash_name, 7, GFP_KERNEL);
743 if (!msp_maps[i].name) {
744 iounmap(msp_maps[i].virt);
745 kfree(msp_parts[i]);
746 goto cleanup_loop;
747 }
748
749 - msp_maps[i].name = strncpy(msp_maps[i].name, flash_name, 7);
750 -
751 for (j = 0; j < pcnt; j++) {
752 part_name[5] = '0' + i;
753 part_name[7] = '0' + j;
754 diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
755 index d52ea3008946..7e8bce46e6b4 100644
756 --- a/drivers/net/ethernet/ti/cpmac.c
757 +++ b/drivers/net/ethernet/ti/cpmac.c
758 @@ -1237,7 +1237,7 @@ int cpmac_init(void)
759 goto fail_alloc;
760 }
761
762 -#warning FIXME: unhardcode gpio&reset bits
763 + /* FIXME: unhardcode gpio&reset bits */
764 ar7_gpio_disable(26);
765 ar7_gpio_disable(27);
766 ar7_device_reset(AR7_RESET_BIT_CPMAC_LO);
767 diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
768 index 62120c38d56b..aae7379af4e4 100644
769 --- a/drivers/nvdimm/namespace_devs.c
770 +++ b/drivers/nvdimm/namespace_devs.c
771 @@ -1534,6 +1534,7 @@ static int select_pmem_id(struct nd_region *nd_region, u8 *pmem_id)
772 static int find_pmem_label_set(struct nd_region *nd_region,
773 struct nd_namespace_pmem *nspm)
774 {
775 + u64 altcookie = nd_region_interleave_set_altcookie(nd_region);
776 u64 cookie = nd_region_interleave_set_cookie(nd_region);
777 struct nd_namespace_label *nd_label;
778 u8 select_id[NSLABEL_UUID_LEN];
779 @@ -1542,8 +1543,10 @@ static int find_pmem_label_set(struct nd_region *nd_region,
780 int rc = -ENODEV, l;
781 u16 i;
782
783 - if (cookie == 0)
784 + if (cookie == 0) {
785 + dev_dbg(&nd_region->dev, "invalid interleave-set-cookie\n");
786 return -ENXIO;
787 + }
788
789 /*
790 * Find a complete set of labels by uuid. By definition we can start
791 @@ -1552,13 +1555,24 @@ static int find_pmem_label_set(struct nd_region *nd_region,
792 for_each_label(l, nd_label, nd_region->mapping[0].labels) {
793 u64 isetcookie = __le64_to_cpu(nd_label->isetcookie);
794
795 - if (isetcookie != cookie)
796 - continue;
797 + if (isetcookie != cookie) {
798 + dev_dbg(&nd_region->dev, "invalid cookie in label: %pUb\n",
799 + nd_label->uuid);
800 + if (isetcookie != altcookie)
801 + continue;
802 +
803 + dev_dbg(&nd_region->dev, "valid altcookie in label: %pUb\n",
804 + nd_label->uuid);
805 + }
806 +
807 + for (i = 0; nd_region->ndr_mappings; i++) {
808 + if (has_uuid_at_pos(nd_region, nd_label->uuid, cookie, i))
809 + continue;
810 + if (has_uuid_at_pos(nd_region, nd_label->uuid, altcookie, i))
811 + continue;
812 + break;
813 + }
814
815 - for (i = 0; nd_region->ndr_mappings; i++)
816 - if (!has_uuid_at_pos(nd_region, nd_label->uuid,
817 - cookie, i))
818 - break;
819 if (i < nd_region->ndr_mappings) {
820 /*
821 * Give up if we don't find an instance of a
822 diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h
823 index 417e521d299c..fc870e55bb66 100644
824 --- a/drivers/nvdimm/nd.h
825 +++ b/drivers/nvdimm/nd.h
826 @@ -245,6 +245,7 @@ struct nd_region *to_nd_region(struct device *dev);
827 int nd_region_to_nstype(struct nd_region *nd_region);
828 int nd_region_register_namespaces(struct nd_region *nd_region, int *err);
829 u64 nd_region_interleave_set_cookie(struct nd_region *nd_region);
830 +u64 nd_region_interleave_set_altcookie(struct nd_region *nd_region);
831 void nvdimm_bus_lock(struct device *dev);
832 void nvdimm_bus_unlock(struct device *dev);
833 bool is_nvdimm_bus_locked(struct device *dev);
834 diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
835 index 9521696c9385..dc2e919daa39 100644
836 --- a/drivers/nvdimm/region_devs.c
837 +++ b/drivers/nvdimm/region_devs.c
838 @@ -379,6 +379,15 @@ u64 nd_region_interleave_set_cookie(struct nd_region *nd_region)
839 return 0;
840 }
841
842 +u64 nd_region_interleave_set_altcookie(struct nd_region *nd_region)
843 +{
844 + struct nd_interleave_set *nd_set = nd_region->nd_set;
845 +
846 + if (nd_set)
847 + return nd_set->altcookie;
848 + return 0;
849 +}
850 +
851 /*
852 * Upon successful probe/remove, take/release a reference on the
853 * associated interleave set (if present), and plant new btt + namespace
854 diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
855 index 9c780740fb82..e712fe745955 100644
856 --- a/drivers/scsi/mvsas/mv_sas.c
857 +++ b/drivers/scsi/mvsas/mv_sas.c
858 @@ -737,8 +737,8 @@ static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmf
859 mv_dprintk("device %016llx not ready.\n",
860 SAS_ADDR(dev->sas_addr));
861
862 - rc = SAS_PHY_DOWN;
863 - return rc;
864 + rc = SAS_PHY_DOWN;
865 + return rc;
866 }
867 tei.port = dev->port->lldd_port;
868 if (tei.port && !tei.port->port_attached && !tmf) {
869 diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
870 index 237ef5573c18..6deb06147202 100644
871 --- a/drivers/tty/serial/samsung.c
872 +++ b/drivers/tty/serial/samsung.c
873 @@ -1030,8 +1030,10 @@ static int s3c64xx_serial_startup(struct uart_port *port)
874 if (ourport->dma) {
875 ret = s3c24xx_serial_request_dma(ourport);
876 if (ret < 0) {
877 - dev_warn(port->dev, "DMA request failed\n");
878 - return ret;
879 + dev_warn(port->dev,
880 + "DMA request failed, DMA will not be used\n");
881 + devm_kfree(port->dev, ourport->dma);
882 + ourport->dma = NULL;
883 }
884 }
885
886 diff --git a/drivers/usb/dwc3/gadget.h b/drivers/usb/dwc3/gadget.h
887 index 18ae3eaa8b6f..ccd9694f8e36 100644
888 --- a/drivers/usb/dwc3/gadget.h
889 +++ b/drivers/usb/dwc3/gadget.h
890 @@ -28,23 +28,23 @@ struct dwc3;
891 #define gadget_to_dwc(g) (container_of(g, struct dwc3, gadget))
892
893 /* DEPCFG parameter 1 */
894 -#define DWC3_DEPCFG_INT_NUM(n) ((n) << 0)
895 +#define DWC3_DEPCFG_INT_NUM(n) (((n) & 0x1f) << 0)
896 #define DWC3_DEPCFG_XFER_COMPLETE_EN (1 << 8)
897 #define DWC3_DEPCFG_XFER_IN_PROGRESS_EN (1 << 9)
898 #define DWC3_DEPCFG_XFER_NOT_READY_EN (1 << 10)
899 #define DWC3_DEPCFG_FIFO_ERROR_EN (1 << 11)
900 #define DWC3_DEPCFG_STREAM_EVENT_EN (1 << 13)
901 -#define DWC3_DEPCFG_BINTERVAL_M1(n) ((n) << 16)
902 +#define DWC3_DEPCFG_BINTERVAL_M1(n) (((n) & 0xff) << 16)
903 #define DWC3_DEPCFG_STREAM_CAPABLE (1 << 24)
904 -#define DWC3_DEPCFG_EP_NUMBER(n) ((n) << 25)
905 +#define DWC3_DEPCFG_EP_NUMBER(n) (((n) & 0x1f) << 25)
906 #define DWC3_DEPCFG_BULK_BASED (1 << 30)
907 #define DWC3_DEPCFG_FIFO_BASED (1 << 31)
908
909 /* DEPCFG parameter 0 */
910 -#define DWC3_DEPCFG_EP_TYPE(n) ((n) << 1)
911 -#define DWC3_DEPCFG_MAX_PACKET_SIZE(n) ((n) << 3)
912 -#define DWC3_DEPCFG_FIFO_NUMBER(n) ((n) << 17)
913 -#define DWC3_DEPCFG_BURST_SIZE(n) ((n) << 22)
914 +#define DWC3_DEPCFG_EP_TYPE(n) (((n) & 0x3) << 1)
915 +#define DWC3_DEPCFG_MAX_PACKET_SIZE(n) (((n) & 0x7ff) << 3)
916 +#define DWC3_DEPCFG_FIFO_NUMBER(n) (((n) & 0x1f) << 17)
917 +#define DWC3_DEPCFG_BURST_SIZE(n) (((n) & 0xf) << 22)
918 #define DWC3_DEPCFG_DATA_SEQ_NUM(n) ((n) << 26)
919 /* This applies for core versions earlier than 1.94a */
920 #define DWC3_DEPCFG_IGN_SEQ_NUM (1 << 31)
921 diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
922 index cfda1a1c0ab6..9ad5145d3103 100644
923 --- a/drivers/usb/gadget/function/f_fs.c
924 +++ b/drivers/usb/gadget/function/f_fs.c
925 @@ -1643,11 +1643,14 @@ static int ffs_func_eps_enable(struct ffs_function *func)
926 spin_lock_irqsave(&func->ffs->eps_lock, flags);
927 do {
928 struct usb_endpoint_descriptor *ds;
929 + struct usb_ss_ep_comp_descriptor *comp_desc = NULL;
930 + int needs_comp_desc = false;
931 int desc_idx;
932
933 - if (ffs->gadget->speed == USB_SPEED_SUPER)
934 + if (ffs->gadget->speed == USB_SPEED_SUPER) {
935 desc_idx = 2;
936 - else if (ffs->gadget->speed == USB_SPEED_HIGH)
937 + needs_comp_desc = true;
938 + } else if (ffs->gadget->speed == USB_SPEED_HIGH)
939 desc_idx = 1;
940 else
941 desc_idx = 0;
942 @@ -1664,6 +1667,14 @@ static int ffs_func_eps_enable(struct ffs_function *func)
943
944 ep->ep->driver_data = ep;
945 ep->ep->desc = ds;
946 +
947 + comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds +
948 + USB_DT_ENDPOINT_SIZE);
949 + ep->ep->maxburst = comp_desc->bMaxBurst + 1;
950 +
951 + if (needs_comp_desc)
952 + ep->ep->comp_desc = comp_desc;
953 +
954 ret = usb_ep_enable(ep->ep);
955 if (likely(!ret)) {
956 epfile->ep = ep;
957 diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
958 index 22d067cd5aa3..6610f7a023d3 100644
959 --- a/drivers/usb/gadget/udc/dummy_hcd.c
960 +++ b/drivers/usb/gadget/udc/dummy_hcd.c
961 @@ -1033,6 +1033,8 @@ static int dummy_udc_probe(struct platform_device *pdev)
962 int rc;
963
964 dum = *((void **)dev_get_platdata(&pdev->dev));
965 + /* Clear usb_gadget region for new registration to udc-core */
966 + memzero_explicit(&dum->gadget, sizeof(struct usb_gadget));
967 dum->gadget.name = gadget_name;
968 dum->gadget.ops = &dummy_ops;
969 dum->gadget.max_speed = USB_SPEED_SUPER;
970 diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c
971 index 74c42f722678..3425154baf8b 100644
972 --- a/drivers/usb/host/xhci-dbg.c
973 +++ b/drivers/usb/host/xhci-dbg.c
974 @@ -111,7 +111,7 @@ static void xhci_print_cap_regs(struct xhci_hcd *xhci)
975 xhci_dbg(xhci, "RTSOFF 0x%x:\n", temp & RTSOFF_MASK);
976
977 /* xhci 1.1 controllers have the HCCPARAMS2 register */
978 - if (hci_version > 100) {
979 + if (hci_version > 0x100) {
980 temp = readl(&xhci->cap_regs->hcc_params2);
981 xhci_dbg(xhci, "HCC PARAMS2 0x%x:\n", (unsigned int) temp);
982 xhci_dbg(xhci, " HC %s Force save context capability",
983 diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
984 index 19cb32a65161..268829db9e88 100644
985 --- a/drivers/usb/host/xhci-plat.c
986 +++ b/drivers/usb/host/xhci-plat.c
987 @@ -213,6 +213,8 @@ static int xhci_plat_remove(struct platform_device *dev)
988 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
989 struct clk *clk = xhci->clk;
990
991 + xhci->xhc_state |= XHCI_STATE_REMOVING;
992 +
993 usb_remove_hcd(xhci->shared_hcd);
994 usb_phy_shutdown(hcd->usb_phy);
995
996 diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
997 index 1950e87b4219..775690bed4c0 100644
998 --- a/drivers/usb/misc/iowarrior.c
999 +++ b/drivers/usb/misc/iowarrior.c
1000 @@ -787,12 +787,6 @@ static int iowarrior_probe(struct usb_interface *interface,
1001 iface_desc = interface->cur_altsetting;
1002 dev->product_id = le16_to_cpu(udev->descriptor.idProduct);
1003
1004 - if (iface_desc->desc.bNumEndpoints < 1) {
1005 - dev_err(&interface->dev, "Invalid number of endpoints\n");
1006 - retval = -EINVAL;
1007 - goto error;
1008 - }
1009 -
1010 /* set up the endpoint information */
1011 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
1012 endpoint = &iface_desc->endpoint[i].desc;
1013 @@ -803,6 +797,21 @@ static int iowarrior_probe(struct usb_interface *interface,
1014 /* this one will match for the IOWarrior56 only */
1015 dev->int_out_endpoint = endpoint;
1016 }
1017 +
1018 + if (!dev->int_in_endpoint) {
1019 + dev_err(&interface->dev, "no interrupt-in endpoint found\n");
1020 + retval = -ENODEV;
1021 + goto error;
1022 + }
1023 +
1024 + if (dev->product_id == USB_DEVICE_ID_CODEMERCS_IOW56) {
1025 + if (!dev->int_out_endpoint) {
1026 + dev_err(&interface->dev, "no interrupt-out endpoint found\n");
1027 + retval = -ENODEV;
1028 + goto error;
1029 + }
1030 + }
1031 +
1032 /* we have to check the report_size often, so remember it in the endianness suitable for our machine */
1033 dev->report_size = usb_endpoint_maxp(dev->int_in_endpoint);
1034 if ((dev->interface->cur_altsetting->desc.bInterfaceNumber == 0) &&
1035 diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
1036 index 3df7b7ec178e..e0b1fe2f60e1 100644
1037 --- a/drivers/usb/serial/digi_acceleport.c
1038 +++ b/drivers/usb/serial/digi_acceleport.c
1039 @@ -1483,16 +1483,20 @@ static int digi_read_oob_callback(struct urb *urb)
1040 struct usb_serial *serial = port->serial;
1041 struct tty_struct *tty;
1042 struct digi_port *priv = usb_get_serial_port_data(port);
1043 + unsigned char *buf = urb->transfer_buffer;
1044 int opcode, line, status, val;
1045 int i;
1046 unsigned int rts;
1047
1048 + if (urb->actual_length < 4)
1049 + return -1;
1050 +
1051 /* handle each oob command */
1052 - for (i = 0; i < urb->actual_length - 3;) {
1053 - opcode = ((unsigned char *)urb->transfer_buffer)[i++];
1054 - line = ((unsigned char *)urb->transfer_buffer)[i++];
1055 - status = ((unsigned char *)urb->transfer_buffer)[i++];
1056 - val = ((unsigned char *)urb->transfer_buffer)[i++];
1057 + for (i = 0; i < urb->actual_length - 3; i += 4) {
1058 + opcode = buf[i];
1059 + line = buf[i + 1];
1060 + status = buf[i + 2];
1061 + val = buf[i + 3];
1062
1063 dev_dbg(&port->dev, "digi_read_oob_callback: opcode=%d, line=%d, status=%d, val=%d\n",
1064 opcode, line, status, val);
1065 diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
1066 index c02808a30436..f1a8fdcd8674 100644
1067 --- a/drivers/usb/serial/io_ti.c
1068 +++ b/drivers/usb/serial/io_ti.c
1069 @@ -1674,6 +1674,12 @@ static void edge_interrupt_callback(struct urb *urb)
1070 function = TIUMP_GET_FUNC_FROM_CODE(data[0]);
1071 dev_dbg(dev, "%s - port_number %d, function %d, info 0x%x\n", __func__,
1072 port_number, function, data[1]);
1073 +
1074 + if (port_number >= edge_serial->serial->num_ports) {
1075 + dev_err(dev, "bad port number %d\n", port_number);
1076 + goto exit;
1077 + }
1078 +
1079 port = edge_serial->serial->port[port_number];
1080 edge_port = usb_get_serial_port_data(port);
1081 if (!edge_port) {
1082 @@ -1755,7 +1761,7 @@ static void edge_bulk_in_callback(struct urb *urb)
1083
1084 port_number = edge_port->port->port_number;
1085
1086 - if (edge_port->lsr_event) {
1087 + if (urb->actual_length > 0 && edge_port->lsr_event) {
1088 edge_port->lsr_event = 0;
1089 dev_dbg(dev, "%s ===== Port %u LSR Status = %02x, Data = %02x ======\n",
1090 __func__, port_number, edge_port->lsr_mask, *data);
1091 diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
1092 index a180b17d2432..76564b3bebb9 100644
1093 --- a/drivers/usb/serial/omninet.c
1094 +++ b/drivers/usb/serial/omninet.c
1095 @@ -142,12 +142,6 @@ static int omninet_port_remove(struct usb_serial_port *port)
1096
1097 static int omninet_open(struct tty_struct *tty, struct usb_serial_port *port)
1098 {
1099 - struct usb_serial *serial = port->serial;
1100 - struct usb_serial_port *wport;
1101 -
1102 - wport = serial->port[1];
1103 - tty_port_tty_set(&wport->port, tty);
1104 -
1105 return usb_serial_generic_open(tty, port);
1106 }
1107
1108 diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c
1109 index b2dff0f14743..236ea43f7815 100644
1110 --- a/drivers/usb/serial/safe_serial.c
1111 +++ b/drivers/usb/serial/safe_serial.c
1112 @@ -205,6 +205,11 @@ static void safe_process_read_urb(struct urb *urb)
1113 if (!safe)
1114 goto out;
1115
1116 + if (length < 2) {
1117 + dev_err(&port->dev, "malformed packet\n");
1118 + return;
1119 + }
1120 +
1121 fcs = fcs_compute10(data, length, CRC10_INITFCS);
1122 if (fcs) {
1123 dev_err(&port->dev, "%s - bad CRC %x\n", __func__, fcs);
1124 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
1125 index e0f862146793..7dcc97eadb12 100644
1126 --- a/fs/ext4/inode.c
1127 +++ b/fs/ext4/inode.c
1128 @@ -3573,6 +3573,10 @@ static int ext4_block_truncate_page(handle_t *handle,
1129 unsigned blocksize;
1130 struct inode *inode = mapping->host;
1131
1132 + /* If we are processing an encrypted inode during orphan list handling */
1133 + if (ext4_encrypted_inode(inode) && !ext4_has_encryption_key(inode))
1134 + return 0;
1135 +
1136 blocksize = inode->i_sb->s_blocksize;
1137 length = blocksize - (offset & (blocksize - 1));
1138
1139 diff --git a/include/linux/libnvdimm.h b/include/linux/libnvdimm.h
1140 index 3f021dc5da8c..30201b9be7bc 100644
1141 --- a/include/linux/libnvdimm.h
1142 +++ b/include/linux/libnvdimm.h
1143 @@ -83,6 +83,8 @@ struct nd_cmd_desc {
1144
1145 struct nd_interleave_set {
1146 u64 cookie;
1147 + /* compatibility with initial buggy Linux implementation */
1148 + u64 altcookie;
1149 };
1150
1151 struct nd_region_desc {
1152 diff --git a/include/trace/events/syscalls.h b/include/trace/events/syscalls.h
1153 index 14e49c798135..b35533b94277 100644
1154 --- a/include/trace/events/syscalls.h
1155 +++ b/include/trace/events/syscalls.h
1156 @@ -1,5 +1,6 @@
1157 #undef TRACE_SYSTEM
1158 #define TRACE_SYSTEM raw_syscalls
1159 +#undef TRACE_INCLUDE_FILE
1160 #define TRACE_INCLUDE_FILE syscalls
1161
1162 #if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ)
1163 diff --git a/mm/memcontrol.c b/mm/memcontrol.c
1164 index 43eefe9d834c..e25b93a4267d 100644
1165 --- a/mm/memcontrol.c
1166 +++ b/mm/memcontrol.c
1167 @@ -4150,24 +4150,6 @@ static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n)
1168 atomic_add(n, &memcg->id.ref);
1169 }
1170
1171 -static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
1172 -{
1173 - while (!atomic_inc_not_zero(&memcg->id.ref)) {
1174 - /*
1175 - * The root cgroup cannot be destroyed, so it's refcount must
1176 - * always be >= 1.
1177 - */
1178 - if (WARN_ON_ONCE(memcg == root_mem_cgroup)) {
1179 - VM_BUG_ON(1);
1180 - break;
1181 - }
1182 - memcg = parent_mem_cgroup(memcg);
1183 - if (!memcg)
1184 - memcg = root_mem_cgroup;
1185 - }
1186 - return memcg;
1187 -}
1188 -
1189 static void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n)
1190 {
1191 if (atomic_sub_and_test(n, &memcg->id.ref)) {
1192 @@ -5751,6 +5733,24 @@ static int __init mem_cgroup_init(void)
1193 subsys_initcall(mem_cgroup_init);
1194
1195 #ifdef CONFIG_MEMCG_SWAP
1196 +static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg)
1197 +{
1198 + while (!atomic_inc_not_zero(&memcg->id.ref)) {
1199 + /*
1200 + * The root cgroup cannot be destroyed, so it's refcount must
1201 + * always be >= 1.
1202 + */
1203 + if (WARN_ON_ONCE(memcg == root_mem_cgroup)) {
1204 + VM_BUG_ON(1);
1205 + break;
1206 + }
1207 + memcg = parent_mem_cgroup(memcg);
1208 + if (!memcg)
1209 + memcg = root_mem_cgroup;
1210 + }
1211 + return memcg;
1212 +}
1213 +
1214 /**
1215 * mem_cgroup_swapout - transfer a memsw charge to swap
1216 * @page: page whose memsw charge to transfer