Magellan Linux

Contents of /trunk/kernel-alx/patches-4.9/0140-4.9.41-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2965 - (show annotations) (download)
Mon Aug 14 07:24:41 2017 UTC (6 years, 8 months ago) by niro
File size: 117752 byte(s)
-linux-4.9.41
1 diff --git a/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt b/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
2 index 3e5b9793341f..8682ab6d4a50 100644
3 --- a/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
4 +++ b/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
5 @@ -8,8 +8,9 @@ This driver provides a simple power button event via an Interrupt.
6 Required properties:
7 - compatible: should be "ti,tps65217-pwrbutton" or "ti,tps65218-pwrbutton"
8
9 -Required properties for TPS65218:
10 +Required properties:
11 - interrupts: should be one of the following
12 + - <2>: For controllers compatible with tps65217
13 - <3 IRQ_TYPE_EDGE_BOTH>: For controllers compatible with tps65218
14
15 Examples:
16 @@ -17,6 +18,7 @@ Examples:
17 &tps {
18 tps65217-pwrbutton {
19 compatible = "ti,tps65217-pwrbutton";
20 + interrupts = <2>;
21 };
22 };
23
24 diff --git a/Documentation/devicetree/bindings/power/supply/tps65217_charger.txt b/Documentation/devicetree/bindings/power/supply/tps65217_charger.txt
25 index 98d131acee95..a11072c5a866 100644
26 --- a/Documentation/devicetree/bindings/power/supply/tps65217_charger.txt
27 +++ b/Documentation/devicetree/bindings/power/supply/tps65217_charger.txt
28 @@ -2,11 +2,16 @@ TPS65217 Charger
29
30 Required Properties:
31 -compatible: "ti,tps65217-charger"
32 +-interrupts: TPS65217 interrupt numbers for the AC and USB charger input change.
33 + Should be <0> for the USB charger and <1> for the AC adapter.
34 +-interrupt-names: Should be "USB" and "AC"
35
36 This node is a subnode of the tps65217 PMIC.
37
38 Example:
39
40 tps65217-charger {
41 - compatible = "ti,tps65090-charger";
42 + compatible = "ti,tps65217-charger";
43 + interrupts = <0>, <1>;
44 + interrupt-names = "USB", "AC";
45 };
46 diff --git a/Makefile b/Makefile
47 index d9397a912c31..82eb3d1ee801 100644
48 --- a/Makefile
49 +++ b/Makefile
50 @@ -1,6 +1,6 @@
51 VERSION = 4
52 PATCHLEVEL = 9
53 -SUBLEVEL = 40
54 +SUBLEVEL = 41
55 EXTRAVERSION =
56 NAME = Roaring Lionus
57
58 diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c
59 index f39142acc89e..be131b296a55 100644
60 --- a/arch/arc/kernel/mcip.c
61 +++ b/arch/arc/kernel/mcip.c
62 @@ -10,6 +10,7 @@
63
64 #include <linux/smp.h>
65 #include <linux/irq.h>
66 +#include <linux/irqchip/chained_irq.h>
67 #include <linux/spinlock.h>
68 #include <asm/irqflags-arcv2.h>
69 #include <asm/mcip.h>
70 @@ -221,10 +222,13 @@ static irq_hw_number_t idu_first_hwirq;
71 static void idu_cascade_isr(struct irq_desc *desc)
72 {
73 struct irq_domain *idu_domain = irq_desc_get_handler_data(desc);
74 + struct irq_chip *core_chip = irq_desc_get_chip(desc);
75 irq_hw_number_t core_hwirq = irqd_to_hwirq(irq_desc_get_irq_data(desc));
76 irq_hw_number_t idu_hwirq = core_hwirq - idu_first_hwirq;
77
78 + chained_irq_enter(core_chip, desc);
79 generic_handle_irq(irq_find_mapping(idu_domain, idu_hwirq));
80 + chained_irq_exit(core_chip, desc);
81 }
82
83 static int idu_irq_map(struct irq_domain *d, unsigned int virq, irq_hw_number_t hwirq)
84 diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi b/arch/arm/boot/dts/am57xx-idk-common.dtsi
85 index 03cec62260e1..db858fff4e18 100644
86 --- a/arch/arm/boot/dts/am57xx-idk-common.dtsi
87 +++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi
88 @@ -294,7 +294,7 @@
89 };
90
91 &usb2 {
92 - dr_mode = "otg";
93 + dr_mode = "peripheral";
94 };
95
96 &mmc2 {
97 diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
98 index 87ca50b53002..4d448f145ed1 100644
99 --- a/arch/arm/boot/dts/omap3-n900.dts
100 +++ b/arch/arm/boot/dts/omap3-n900.dts
101 @@ -734,6 +734,8 @@
102 vmmc_aux-supply = <&vsim>;
103 bus-width = <8>;
104 non-removable;
105 + no-sdio;
106 + no-sd;
107 };
108
109 &mmc3 {
110 diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
111 index bc4bfe02e611..60d3fecd7a22 100644
112 --- a/arch/arm/configs/s3c2410_defconfig
113 +++ b/arch/arm/configs/s3c2410_defconfig
114 @@ -86,9 +86,9 @@ CONFIG_IPV6_TUNNEL=m
115 CONFIG_NETFILTER=y
116 CONFIG_NF_CONNTRACK=m
117 CONFIG_NF_CONNTRACK_EVENTS=y
118 -CONFIG_NF_CT_PROTO_DCCP=m
119 -CONFIG_NF_CT_PROTO_SCTP=m
120 -CONFIG_NF_CT_PROTO_UDPLITE=m
121 +CONFIG_NF_CT_PROTO_DCCP=y
122 +CONFIG_NF_CT_PROTO_SCTP=y
123 +CONFIG_NF_CT_PROTO_UDPLITE=y
124 CONFIG_NF_CONNTRACK_AMANDA=m
125 CONFIG_NF_CONNTRACK_FTP=m
126 CONFIG_NF_CONNTRACK_H323=m
127 diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
128 index 1052b29697b8..b5c1714ebfdd 100644
129 --- a/arch/arm/mach-omap2/omap_hwmod.c
130 +++ b/arch/arm/mach-omap2/omap_hwmod.c
131 @@ -790,14 +790,14 @@ static int _init_main_clk(struct omap_hwmod *oh)
132 int ret = 0;
133 char name[MOD_CLK_MAX_NAME_LEN];
134 struct clk *clk;
135 + static const char modck[] = "_mod_ck";
136
137 - /* +7 magic comes from '_mod_ck' suffix */
138 - if (strlen(oh->name) + 7 > MOD_CLK_MAX_NAME_LEN)
139 + if (strlen(oh->name) >= MOD_CLK_MAX_NAME_LEN - strlen(modck))
140 pr_warn("%s: warning: cropping name for %s\n", __func__,
141 oh->name);
142
143 - strncpy(name, oh->name, MOD_CLK_MAX_NAME_LEN - 7);
144 - strcat(name, "_mod_ck");
145 + strlcpy(name, oh->name, MOD_CLK_MAX_NAME_LEN - strlen(modck));
146 + strlcat(name, modck, MOD_CLK_MAX_NAME_LEN);
147
148 clk = clk_get(NULL, name);
149 if (!IS_ERR(clk)) {
150 diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-ep108.dts b/arch/arm64/boot/dts/xilinx/zynqmp-ep108.dts
151 index 358089687a69..ef1b9e573af0 100644
152 --- a/arch/arm64/boot/dts/xilinx/zynqmp-ep108.dts
153 +++ b/arch/arm64/boot/dts/xilinx/zynqmp-ep108.dts
154 @@ -27,7 +27,7 @@
155 stdout-path = "serial0:115200n8";
156 };
157
158 - memory {
159 + memory@0 {
160 device_type = "memory";
161 reg = <0x0 0x0 0x0 0x40000000>;
162 };
163 diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
164 index 68a908334c7b..54dc28351c8c 100644
165 --- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
166 +++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
167 @@ -72,7 +72,7 @@
168 <1 10 0xf08>;
169 };
170
171 - amba_apu {
172 + amba_apu: amba_apu@0 {
173 compatible = "simple-bus";
174 #address-cells = <2>;
175 #size-cells = <1>;
176 @@ -175,7 +175,7 @@
177 };
178
179 i2c0: i2c@ff020000 {
180 - compatible = "cdns,i2c-r1p10";
181 + compatible = "cdns,i2c-r1p14", "cdns,i2c-r1p10";
182 status = "disabled";
183 interrupt-parent = <&gic>;
184 interrupts = <0 17 4>;
185 @@ -185,7 +185,7 @@
186 };
187
188 i2c1: i2c@ff030000 {
189 - compatible = "cdns,i2c-r1p10";
190 + compatible = "cdns,i2c-r1p14", "cdns,i2c-r1p10";
191 status = "disabled";
192 interrupt-parent = <&gic>;
193 interrupts = <0 18 4>;
194 diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
195 index 8b8ac3db4092..0e90c7e0279c 100644
196 --- a/arch/arm64/mm/fault.c
197 +++ b/arch/arm64/mm/fault.c
198 @@ -101,21 +101,21 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
199 break;
200
201 pud = pud_offset(pgd, addr);
202 - printk(", *pud=%016llx", pud_val(*pud));
203 + pr_cont(", *pud=%016llx", pud_val(*pud));
204 if (pud_none(*pud) || pud_bad(*pud))
205 break;
206
207 pmd = pmd_offset(pud, addr);
208 - printk(", *pmd=%016llx", pmd_val(*pmd));
209 + pr_cont(", *pmd=%016llx", pmd_val(*pmd));
210 if (pmd_none(*pmd) || pmd_bad(*pmd))
211 break;
212
213 pte = pte_offset_map(pmd, addr);
214 - printk(", *pte=%016llx", pte_val(*pte));
215 + pr_cont(", *pte=%016llx", pte_val(*pte));
216 pte_unmap(pte);
217 } while(0);
218
219 - printk("\n");
220 + pr_cont("\n");
221 }
222
223 #ifdef CONFIG_ARM64_HW_AFDBM
224 diff --git a/arch/openrisc/kernel/vmlinux.lds.S b/arch/openrisc/kernel/vmlinux.lds.S
225 index d68b9ede8423..c50609aead35 100644
226 --- a/arch/openrisc/kernel/vmlinux.lds.S
227 +++ b/arch/openrisc/kernel/vmlinux.lds.S
228 @@ -38,6 +38,8 @@ SECTIONS
229 /* Read-only sections, merged into text segment: */
230 . = LOAD_BASE ;
231
232 + _text = .;
233 +
234 /* _s_kernel_ro must be page aligned */
235 . = ALIGN(PAGE_SIZE);
236 _s_kernel_ro = .;
237 diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
238 index 53ec75f8e237..c721ea2fdbd8 100644
239 --- a/arch/parisc/kernel/cache.c
240 +++ b/arch/parisc/kernel/cache.c
241 @@ -452,8 +452,8 @@ void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
242 before it can be accessed through the kernel mapping. */
243 preempt_disable();
244 flush_dcache_page_asm(__pa(vfrom), vaddr);
245 - preempt_enable();
246 copy_page_asm(vto, vfrom);
247 + preempt_enable();
248 }
249 EXPORT_SYMBOL(copy_user_page);
250
251 @@ -538,6 +538,10 @@ void flush_cache_mm(struct mm_struct *mm)
252 struct vm_area_struct *vma;
253 pgd_t *pgd;
254
255 + /* Flush the TLB to avoid speculation if coherency is required. */
256 + if (parisc_requires_coherency())
257 + flush_tlb_all();
258 +
259 /* Flushing the whole cache on each cpu takes forever on
260 rp3440, etc. So, avoid it if the mm isn't too big. */
261 if (mm_total_size(mm) >= parisc_cache_flush_threshold) {
262 @@ -594,33 +598,22 @@ flush_user_icache_range(unsigned long start, unsigned long end)
263 void flush_cache_range(struct vm_area_struct *vma,
264 unsigned long start, unsigned long end)
265 {
266 - unsigned long addr;
267 - pgd_t *pgd;
268 -
269 BUG_ON(!vma->vm_mm->context);
270
271 + /* Flush the TLB to avoid speculation if coherency is required. */
272 + if (parisc_requires_coherency())
273 + flush_tlb_range(vma, start, end);
274 +
275 if ((end - start) >= parisc_cache_flush_threshold) {
276 flush_cache_all();
277 return;
278 }
279
280 - if (vma->vm_mm->context == mfsp(3)) {
281 - flush_user_dcache_range_asm(start, end);
282 - if (vma->vm_flags & VM_EXEC)
283 - flush_user_icache_range_asm(start, end);
284 - return;
285 - }
286 + BUG_ON(vma->vm_mm->context != mfsp(3));
287
288 - pgd = vma->vm_mm->pgd;
289 - for (addr = start & PAGE_MASK; addr < end; addr += PAGE_SIZE) {
290 - unsigned long pfn;
291 - pte_t *ptep = get_ptep(pgd, addr);
292 - if (!ptep)
293 - continue;
294 - pfn = pte_pfn(*ptep);
295 - if (pfn_valid(pfn))
296 - __flush_cache_page(vma, addr, PFN_PHYS(pfn));
297 - }
298 + flush_user_dcache_range_asm(start, end);
299 + if (vma->vm_flags & VM_EXEC)
300 + flush_user_icache_range_asm(start, end);
301 }
302
303 void
304 @@ -629,7 +622,8 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
305 BUG_ON(!vma->vm_mm->context);
306
307 if (pfn_valid(pfn)) {
308 - flush_tlb_page(vma, vmaddr);
309 + if (parisc_requires_coherency())
310 + flush_tlb_page(vma, vmaddr);
311 __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn));
312 }
313 }
314 diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
315 index e7ffde2758fc..7593787ed4c3 100644
316 --- a/arch/parisc/kernel/process.c
317 +++ b/arch/parisc/kernel/process.c
318 @@ -50,6 +50,7 @@
319 #include <linux/uaccess.h>
320 #include <linux/rcupdate.h>
321 #include <linux/random.h>
322 +#include <linux/nmi.h>
323
324 #include <asm/io.h>
325 #include <asm/asm-offsets.h>
326 @@ -142,6 +143,7 @@ void machine_power_off(void)
327
328 /* prevent soft lockup/stalled CPU messages for endless loop. */
329 rcu_sysrq_start();
330 + lockup_detector_suspend();
331 for (;;);
332 }
333
334 diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
335 index 329771559cbb..8b3b46b7b0f2 100644
336 --- a/arch/powerpc/include/asm/topology.h
337 +++ b/arch/powerpc/include/asm/topology.h
338 @@ -44,22 +44,8 @@ extern void __init dump_numa_cpu_topology(void);
339 extern int sysfs_add_device_to_node(struct device *dev, int nid);
340 extern void sysfs_remove_device_from_node(struct device *dev, int nid);
341
342 -static inline int early_cpu_to_node(int cpu)
343 -{
344 - int nid;
345 -
346 - nid = numa_cpu_lookup_table[cpu];
347 -
348 - /*
349 - * Fall back to node 0 if nid is unset (it should be, except bugs).
350 - * This allows callers to safely do NODE_DATA(early_cpu_to_node(cpu)).
351 - */
352 - return (nid < 0) ? 0 : nid;
353 -}
354 #else
355
356 -static inline int early_cpu_to_node(int cpu) { return 0; }
357 -
358 static inline void dump_numa_cpu_topology(void) {}
359
360 static inline int sysfs_add_device_to_node(struct device *dev, int nid)
361 diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
362 index ada71bee176d..a12be60181bf 100644
363 --- a/arch/powerpc/kernel/setup_64.c
364 +++ b/arch/powerpc/kernel/setup_64.c
365 @@ -595,7 +595,7 @@ void __init emergency_stack_init(void)
366
367 static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
368 {
369 - return __alloc_bootmem_node(NODE_DATA(early_cpu_to_node(cpu)), size, align,
370 + return __alloc_bootmem_node(NODE_DATA(cpu_to_node(cpu)), size, align,
371 __pa(MAX_DMA_ADDRESS));
372 }
373
374 @@ -606,7 +606,7 @@ static void __init pcpu_fc_free(void *ptr, size_t size)
375
376 static int pcpu_cpu_distance(unsigned int from, unsigned int to)
377 {
378 - if (early_cpu_to_node(from) == early_cpu_to_node(to))
379 + if (cpu_to_node(from) == cpu_to_node(to))
380 return LOCAL_DISTANCE;
381 else
382 return REMOTE_DISTANCE;
383 diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
384 index 5c0298422300..218cba2f5699 100644
385 --- a/arch/powerpc/kvm/book3s_hv.c
386 +++ b/arch/powerpc/kvm/book3s_hv.c
387 @@ -2808,6 +2808,8 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu)
388 int r;
389 int srcu_idx;
390 unsigned long ebb_regs[3] = {}; /* shut up GCC */
391 + unsigned long user_tar = 0;
392 + unsigned int user_vrsave;
393
394 if (!vcpu->arch.sane) {
395 run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
396 @@ -2828,6 +2830,8 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu)
397 run->fail_entry.hardware_entry_failure_reason = 0;
398 return -EINVAL;
399 }
400 + /* Enable TM so we can read the TM SPRs */
401 + mtmsr(mfmsr() | MSR_TM);
402 current->thread.tm_tfhar = mfspr(SPRN_TFHAR);
403 current->thread.tm_tfiar = mfspr(SPRN_TFIAR);
404 current->thread.tm_texasr = mfspr(SPRN_TEXASR);
405 @@ -2856,12 +2860,14 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu)
406
407 flush_all_to_thread(current);
408
409 - /* Save userspace EBB register values */
410 + /* Save userspace EBB and other register values */
411 if (cpu_has_feature(CPU_FTR_ARCH_207S)) {
412 ebb_regs[0] = mfspr(SPRN_EBBHR);
413 ebb_regs[1] = mfspr(SPRN_EBBRR);
414 ebb_regs[2] = mfspr(SPRN_BESCR);
415 + user_tar = mfspr(SPRN_TAR);
416 }
417 + user_vrsave = mfspr(SPRN_VRSAVE);
418
419 vcpu->arch.wqp = &vcpu->arch.vcore->wq;
420 vcpu->arch.pgdir = current->mm->pgd;
421 @@ -2885,12 +2891,15 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu)
422 r = kvmppc_xics_rm_complete(vcpu, 0);
423 } while (is_kvmppc_resume_guest(r));
424
425 - /* Restore userspace EBB register values */
426 + /* Restore userspace EBB and other register values */
427 if (cpu_has_feature(CPU_FTR_ARCH_207S)) {
428 mtspr(SPRN_EBBHR, ebb_regs[0]);
429 mtspr(SPRN_EBBRR, ebb_regs[1]);
430 mtspr(SPRN_BESCR, ebb_regs[2]);
431 + mtspr(SPRN_TAR, user_tar);
432 + mtspr(SPRN_FSCR, current->thread.fscr);
433 }
434 + mtspr(SPRN_VRSAVE, user_vrsave);
435
436 out:
437 vcpu->arch.state = KVMPPC_VCPU_NOTREADY;
438 diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
439 index 6f81adb112f1..0447a22a4df6 100644
440 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
441 +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
442 @@ -37,6 +37,13 @@
443 #define NAPPING_CEDE 1
444 #define NAPPING_NOVCPU 2
445
446 +/* Stack frame offsets for kvmppc_hv_entry */
447 +#define SFS 112
448 +#define STACK_SLOT_TRAP (SFS-4)
449 +#define STACK_SLOT_CIABR (SFS-16)
450 +#define STACK_SLOT_DAWR (SFS-24)
451 +#define STACK_SLOT_DAWRX (SFS-32)
452 +
453 /*
454 * Call kvmppc_hv_entry in real mode.
455 * Must be called with interrupts hard-disabled.
456 @@ -289,10 +296,10 @@ kvm_novcpu_exit:
457 bl kvmhv_accumulate_time
458 #endif
459 13: mr r3, r12
460 - stw r12, 112-4(r1)
461 + stw r12, STACK_SLOT_TRAP(r1)
462 bl kvmhv_commence_exit
463 nop
464 - lwz r12, 112-4(r1)
465 + lwz r12, STACK_SLOT_TRAP(r1)
466 b kvmhv_switch_to_host
467
468 /*
469 @@ -537,7 +544,7 @@ kvmppc_hv_entry:
470 */
471 mflr r0
472 std r0, PPC_LR_STKOFF(r1)
473 - stdu r1, -112(r1)
474 + stdu r1, -SFS(r1)
475
476 /* Save R1 in the PACA */
477 std r1, HSTATE_HOST_R1(r13)
478 @@ -698,6 +705,16 @@ kvmppc_got_guest:
479 mtspr SPRN_PURR,r7
480 mtspr SPRN_SPURR,r8
481
482 + /* Save host values of some registers */
483 +BEGIN_FTR_SECTION
484 + mfspr r5, SPRN_CIABR
485 + mfspr r6, SPRN_DAWR
486 + mfspr r7, SPRN_DAWRX
487 + std r5, STACK_SLOT_CIABR(r1)
488 + std r6, STACK_SLOT_DAWR(r1)
489 + std r7, STACK_SLOT_DAWRX(r1)
490 +END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
491 +
492 BEGIN_FTR_SECTION
493 /* Set partition DABR */
494 /* Do this before re-enabling PMU to avoid P7 DABR corruption bug */
495 @@ -1361,8 +1378,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
496 */
497 li r0, 0
498 mtspr SPRN_IAMR, r0
499 - mtspr SPRN_CIABR, r0
500 - mtspr SPRN_DAWRX, r0
501 + mtspr SPRN_PSPB, r0
502 mtspr SPRN_TCSCR, r0
503 mtspr SPRN_WORT, r0
504 /* Set MMCRS to 1<<31 to freeze and disable the SPMC counters */
505 @@ -1378,6 +1394,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S)
506 std r6,VCPU_UAMOR(r9)
507 li r6,0
508 mtspr SPRN_AMR,r6
509 + mtspr SPRN_UAMOR, r6
510
511 /* Switch DSCR back to host value */
512 mfspr r8, SPRN_DSCR
513 @@ -1519,6 +1536,16 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
514 slbia
515 ptesync
516
517 + /* Restore host values of some registers */
518 +BEGIN_FTR_SECTION
519 + ld r5, STACK_SLOT_CIABR(r1)
520 + ld r6, STACK_SLOT_DAWR(r1)
521 + ld r7, STACK_SLOT_DAWRX(r1)
522 + mtspr SPRN_CIABR, r5
523 + mtspr SPRN_DAWR, r6
524 + mtspr SPRN_DAWRX, r7
525 +END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
526 +
527 /*
528 * POWER7/POWER8 guest -> host partition switch code.
529 * We don't have to lock against tlbies but we do
530 @@ -1652,8 +1679,8 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
531 li r0, KVM_GUEST_MODE_NONE
532 stb r0, HSTATE_IN_GUEST(r13)
533
534 - ld r0, 112+PPC_LR_STKOFF(r1)
535 - addi r1, r1, 112
536 + ld r0, SFS+PPC_LR_STKOFF(r1)
537 + addi r1, r1, SFS
538 mtlr r0
539 blr
540
541 diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
542 index cc66c49f07aa..666ad0611e63 100644
543 --- a/arch/powerpc/platforms/pseries/reconfig.c
544 +++ b/arch/powerpc/platforms/pseries/reconfig.c
545 @@ -82,7 +82,6 @@ static int pSeries_reconfig_remove_node(struct device_node *np)
546
547 of_detach_node(np);
548 of_node_put(parent);
549 - of_node_put(np); /* Must decrement the refcount */
550 return 0;
551 }
552
553 diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c
554 index fec8a461bdef..1076c9a77292 100644
555 --- a/arch/x86/events/intel/cstate.c
556 +++ b/arch/x86/events/intel/cstate.c
557 @@ -434,6 +434,7 @@ static struct pmu cstate_core_pmu = {
558 .stop = cstate_pmu_event_stop,
559 .read = cstate_pmu_event_update,
560 .capabilities = PERF_PMU_CAP_NO_INTERRUPT,
561 + .module = THIS_MODULE,
562 };
563
564 static struct pmu cstate_pkg_pmu = {
565 @@ -447,6 +448,7 @@ static struct pmu cstate_pkg_pmu = {
566 .stop = cstate_pmu_event_stop,
567 .read = cstate_pmu_event_update,
568 .capabilities = PERF_PMU_CAP_NO_INTERRUPT,
569 + .module = THIS_MODULE,
570 };
571
572 static const struct cstate_model nhm_cstates __initconst = {
573 diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c
574 index 8b902b67342a..970c1de3b86e 100644
575 --- a/arch/x86/events/intel/rapl.c
576 +++ b/arch/x86/events/intel/rapl.c
577 @@ -697,6 +697,7 @@ static int __init init_rapl_pmus(void)
578 rapl_pmus->pmu.start = rapl_pmu_event_start;
579 rapl_pmus->pmu.stop = rapl_pmu_event_stop;
580 rapl_pmus->pmu.read = rapl_pmu_event_read;
581 + rapl_pmus->pmu.module = THIS_MODULE;
582 return 0;
583 }
584
585 diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
586 index 19d646a783fd..aec6cc925af8 100644
587 --- a/arch/x86/events/intel/uncore.c
588 +++ b/arch/x86/events/intel/uncore.c
589 @@ -733,6 +733,7 @@ static int uncore_pmu_register(struct intel_uncore_pmu *pmu)
590 .start = uncore_pmu_event_start,
591 .stop = uncore_pmu_event_stop,
592 .read = uncore_pmu_event_read,
593 + .module = THIS_MODULE,
594 };
595 } else {
596 pmu->pmu = *pmu->type->pmu;
597 diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
598 index 3dfca7b302dc..a5b47c1361a0 100644
599 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
600 +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
601 @@ -955,6 +955,9 @@ static int threshold_create_bank(unsigned int cpu, unsigned int bank)
602 const char *name = get_name(bank, NULL);
603 int err = 0;
604
605 + if (!dev)
606 + return -ENODEV;
607 +
608 if (is_shared_bank(bank)) {
609 nb = node_to_amd_nb(amd_get_nb_id(cpu));
610
611 diff --git a/arch/x86/platform/intel-mid/device_libs/Makefile b/arch/x86/platform/intel-mid/device_libs/Makefile
612 index dd6cfa4ad3ac..75029d0cfa15 100644
613 --- a/arch/x86/platform/intel-mid/device_libs/Makefile
614 +++ b/arch/x86/platform/intel-mid/device_libs/Makefile
615 @@ -15,7 +15,7 @@ obj-$(subst m,y,$(CONFIG_INTEL_MID_POWER_BUTTON)) += platform_msic_power_btn.o
616 obj-$(subst m,y,$(CONFIG_GPIO_INTEL_PMIC)) += platform_pmic_gpio.o
617 obj-$(subst m,y,$(CONFIG_INTEL_MFLD_THERMAL)) += platform_msic_thermal.o
618 # SPI Devices
619 -obj-$(subst m,y,$(CONFIG_SPI_SPIDEV)) += platform_spidev.o
620 +obj-$(subst m,y,$(CONFIG_SPI_SPIDEV)) += platform_mrfld_spidev.o
621 # I2C Devices
622 obj-$(subst m,y,$(CONFIG_SENSORS_EMC1403)) += platform_emc1403.o
623 obj-$(subst m,y,$(CONFIG_SENSORS_LIS3LV02D)) += platform_lis331.o
624 diff --git a/arch/x86/platform/intel-mid/device_libs/platform_mrfld_spidev.c b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_spidev.c
625 new file mode 100644
626 index 000000000000..27186ad654c9
627 --- /dev/null
628 +++ b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_spidev.c
629 @@ -0,0 +1,54 @@
630 +/*
631 + * spidev platform data initilization file
632 + *
633 + * (C) Copyright 2014, 2016 Intel Corporation
634 + * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
635 + * Dan O'Donovan <dan@emutex.com>
636 + *
637 + * This program is free software; you can redistribute it and/or
638 + * modify it under the terms of the GNU General Public License
639 + * as published by the Free Software Foundation; version 2
640 + * of the License.
641 + */
642 +
643 +#include <linux/err.h>
644 +#include <linux/init.h>
645 +#include <linux/sfi.h>
646 +#include <linux/spi/pxa2xx_spi.h>
647 +#include <linux/spi/spi.h>
648 +
649 +#include <asm/intel-mid.h>
650 +
651 +#define MRFLD_SPI_DEFAULT_DMA_BURST 8
652 +#define MRFLD_SPI_DEFAULT_TIMEOUT 500
653 +
654 +/* GPIO pin for spidev chipselect */
655 +#define MRFLD_SPIDEV_GPIO_CS 111
656 +
657 +static struct pxa2xx_spi_chip spidev_spi_chip = {
658 + .dma_burst_size = MRFLD_SPI_DEFAULT_DMA_BURST,
659 + .timeout = MRFLD_SPI_DEFAULT_TIMEOUT,
660 + .gpio_cs = MRFLD_SPIDEV_GPIO_CS,
661 +};
662 +
663 +static void __init *spidev_platform_data(void *info)
664 +{
665 + struct spi_board_info *spi_info = info;
666 +
667 + if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER)
668 + return ERR_PTR(-ENODEV);
669 +
670 + spi_info->mode = SPI_MODE_0;
671 + spi_info->controller_data = &spidev_spi_chip;
672 +
673 + return NULL;
674 +}
675 +
676 +static const struct devs_id spidev_dev_id __initconst = {
677 + .name = "spidev",
678 + .type = SFI_DEV_TYPE_SPI,
679 + .delay = 0,
680 + .get_platform_data = &spidev_platform_data,
681 +};
682 +
683 +sfi_device(spidev_dev_id);
684 diff --git a/arch/x86/platform/intel-mid/device_libs/platform_spidev.c b/arch/x86/platform/intel-mid/device_libs/platform_spidev.c
685 deleted file mode 100644
686 index 30c601b399ee..000000000000
687 --- a/arch/x86/platform/intel-mid/device_libs/platform_spidev.c
688 +++ /dev/null
689 @@ -1,50 +0,0 @@
690 -/*
691 - * spidev platform data initilization file
692 - *
693 - * (C) Copyright 2014, 2016 Intel Corporation
694 - * Authors: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
695 - * Dan O'Donovan <dan@emutex.com>
696 - *
697 - * This program is free software; you can redistribute it and/or
698 - * modify it under the terms of the GNU General Public License
699 - * as published by the Free Software Foundation; version 2
700 - * of the License.
701 - */
702 -
703 -#include <linux/init.h>
704 -#include <linux/sfi.h>
705 -#include <linux/spi/pxa2xx_spi.h>
706 -#include <linux/spi/spi.h>
707 -
708 -#include <asm/intel-mid.h>
709 -
710 -#define MRFLD_SPI_DEFAULT_DMA_BURST 8
711 -#define MRFLD_SPI_DEFAULT_TIMEOUT 500
712 -
713 -/* GPIO pin for spidev chipselect */
714 -#define MRFLD_SPIDEV_GPIO_CS 111
715 -
716 -static struct pxa2xx_spi_chip spidev_spi_chip = {
717 - .dma_burst_size = MRFLD_SPI_DEFAULT_DMA_BURST,
718 - .timeout = MRFLD_SPI_DEFAULT_TIMEOUT,
719 - .gpio_cs = MRFLD_SPIDEV_GPIO_CS,
720 -};
721 -
722 -static void __init *spidev_platform_data(void *info)
723 -{
724 - struct spi_board_info *spi_info = info;
725 -
726 - spi_info->mode = SPI_MODE_0;
727 - spi_info->controller_data = &spidev_spi_chip;
728 -
729 - return NULL;
730 -}
731 -
732 -static const struct devs_id spidev_dev_id __initconst = {
733 - .name = "spidev",
734 - .type = SFI_DEV_TYPE_SPI,
735 - .delay = 0,
736 - .get_platform_data = &spidev_platform_data,
737 -};
738 -
739 -sfi_device(spidev_dev_id);
740 diff --git a/crypto/authencesn.c b/crypto/authencesn.c
741 index 121010ac9962..18c94e1c31d1 100644
742 --- a/crypto/authencesn.c
743 +++ b/crypto/authencesn.c
744 @@ -248,6 +248,9 @@ static int crypto_authenc_esn_decrypt_tail(struct aead_request *req,
745 u8 *ihash = ohash + crypto_ahash_digestsize(auth);
746 u32 tmp[2];
747
748 + if (!authsize)
749 + goto decrypt;
750 +
751 /* Move high-order bits of sequence number back. */
752 scatterwalk_map_and_copy(tmp, dst, 4, 4, 0);
753 scatterwalk_map_and_copy(tmp + 1, dst, assoclen + cryptlen, 4, 0);
754 @@ -256,6 +259,8 @@ static int crypto_authenc_esn_decrypt_tail(struct aead_request *req,
755 if (crypto_memneq(ihash, ohash, authsize))
756 return -EBADMSG;
757
758 +decrypt:
759 +
760 sg_init_table(areq_ctx->dst, 2);
761 dst = scatterwalk_ffwd(areq_ctx->dst, dst, assoclen);
762
763 diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
764 index 5ea5dc219f56..73c9c7fa9001 100644
765 --- a/drivers/acpi/glue.c
766 +++ b/drivers/acpi/glue.c
767 @@ -98,7 +98,15 @@ static int find_child_checks(struct acpi_device *adev, bool check_children)
768 if (check_children && list_empty(&adev->children))
769 return -ENODEV;
770
771 - return sta_present ? FIND_CHILD_MAX_SCORE : FIND_CHILD_MIN_SCORE;
772 + /*
773 + * If the device has a _HID (or _CID) returning a valid ACPI/PNP
774 + * device ID, it is better to make it look less attractive here, so that
775 + * the other device with the same _ADR value (that may not have a valid
776 + * device ID) can be matched going forward. [This means a second spec
777 + * violation in a row, so whatever we do here is best effort anyway.]
778 + */
779 + return sta_present && list_empty(&adev->pnp.ids) ?
780 + FIND_CHILD_MAX_SCORE : FIND_CHILD_MIN_SCORE;
781 }
782
783 struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
784 diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
785 index 4facc7517a6a..909311016108 100644
786 --- a/drivers/char/ipmi/ipmi_watchdog.c
787 +++ b/drivers/char/ipmi/ipmi_watchdog.c
788 @@ -1162,10 +1162,11 @@ static int wdog_reboot_handler(struct notifier_block *this,
789 ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
790 ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
791 } else if (ipmi_watchdog_state != WDOG_TIMEOUT_NONE) {
792 - /* Set a long timer to let the reboot happens, but
793 - reboot if it hangs, but only if the watchdog
794 + /* Set a long timer to let the reboot happen or
795 + reset if it hangs, but only if the watchdog
796 timer was already running. */
797 - timeout = 120;
798 + if (timeout < 120)
799 + timeout = 120;
800 pretimeout = 0;
801 ipmi_watchdog_state = WDOG_TIMEOUT_RESET;
802 ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
803 diff --git a/drivers/dax/dax.c b/drivers/dax/dax.c
804 index 586f9543de73..40be3747724d 100644
805 --- a/drivers/dax/dax.c
806 +++ b/drivers/dax/dax.c
807 @@ -546,7 +546,8 @@ static void dax_dev_release(struct device *dev)
808 struct dax_dev *dax_dev = to_dax_dev(dev);
809 struct dax_region *dax_region = dax_dev->region;
810
811 - ida_simple_remove(&dax_region->ida, dax_dev->id);
812 + if (dax_dev->id >= 0)
813 + ida_simple_remove(&dax_region->ida, dax_dev->id);
814 ida_simple_remove(&dax_minor_ida, MINOR(dev->devt));
815 dax_region_put(dax_region);
816 iput(dax_dev->inode);
817 @@ -581,7 +582,7 @@ static void unregister_dax_dev(void *dev)
818 }
819
820 struct dax_dev *devm_create_dax_dev(struct dax_region *dax_region,
821 - struct resource *res, int count)
822 + int id, struct resource *res, int count)
823 {
824 struct device *parent = dax_region->dev;
825 struct dax_dev *dax_dev;
826 @@ -608,10 +609,16 @@ struct dax_dev *devm_create_dax_dev(struct dax_region *dax_region,
827 if (i < count)
828 goto err_id;
829
830 - dax_dev->id = ida_simple_get(&dax_region->ida, 0, 0, GFP_KERNEL);
831 - if (dax_dev->id < 0) {
832 - rc = dax_dev->id;
833 - goto err_id;
834 + if (id < 0) {
835 + id = ida_simple_get(&dax_region->ida, 0, 0, GFP_KERNEL);
836 + dax_dev->id = id;
837 + if (id < 0) {
838 + rc = id;
839 + goto err_id;
840 + }
841 + } else {
842 + /* region provider owns @id lifetime */
843 + dax_dev->id = -1;
844 }
845
846 minor = ida_simple_get(&dax_minor_ida, 0, 0, GFP_KERNEL);
847 @@ -650,7 +657,7 @@ struct dax_dev *devm_create_dax_dev(struct dax_region *dax_region,
848 dev->parent = parent;
849 dev->groups = dax_attribute_groups;
850 dev->release = dax_dev_release;
851 - dev_set_name(dev, "dax%d.%d", dax_region->id, dax_dev->id);
852 + dev_set_name(dev, "dax%d.%d", dax_region->id, id);
853 rc = device_add(dev);
854 if (rc) {
855 kill_dax_dev(dax_dev);
856 @@ -669,7 +676,8 @@ struct dax_dev *devm_create_dax_dev(struct dax_region *dax_region,
857 err_inode:
858 ida_simple_remove(&dax_minor_ida, minor);
859 err_minor:
860 - ida_simple_remove(&dax_region->ida, dax_dev->id);
861 + if (dax_dev->id >= 0)
862 + ida_simple_remove(&dax_region->ida, dax_dev->id);
863 err_id:
864 kfree(dax_dev);
865
866 diff --git a/drivers/dax/dax.h b/drivers/dax/dax.h
867 index ddd829ab58c0..b5ed85036b2a 100644
868 --- a/drivers/dax/dax.h
869 +++ b/drivers/dax/dax.h
870 @@ -21,5 +21,5 @@ struct dax_region *alloc_dax_region(struct device *parent,
871 int region_id, struct resource *res, unsigned int align,
872 void *addr, unsigned long flags);
873 struct dax_dev *devm_create_dax_dev(struct dax_region *dax_region,
874 - struct resource *res, int count);
875 + int id, struct resource *res, int count);
876 #endif /* __DAX_H__ */
877 diff --git a/drivers/dax/pmem.c b/drivers/dax/pmem.c
878 index 73c6ce93a0d9..eebb35720398 100644
879 --- a/drivers/dax/pmem.c
880 +++ b/drivers/dax/pmem.c
881 @@ -58,13 +58,12 @@ static void dax_pmem_percpu_kill(void *data)
882
883 static int dax_pmem_probe(struct device *dev)
884 {
885 - int rc;
886 void *addr;
887 struct resource res;
888 struct dax_dev *dax_dev;
889 + int rc, id, region_id;
890 struct nd_pfn_sb *pfn_sb;
891 struct dax_pmem *dax_pmem;
892 - struct nd_region *nd_region;
893 struct nd_namespace_io *nsio;
894 struct dax_region *dax_region;
895 struct nd_namespace_common *ndns;
896 @@ -122,14 +121,17 @@ static int dax_pmem_probe(struct device *dev)
897 /* adjust the dax_region resource to the start of data */
898 res.start += le64_to_cpu(pfn_sb->dataoff);
899
900 - nd_region = to_nd_region(dev->parent);
901 - dax_region = alloc_dax_region(dev, nd_region->id, &res,
902 + rc = sscanf(dev_name(&ndns->dev), "namespace%d.%d", &region_id, &id);
903 + if (rc != 2)
904 + return -EINVAL;
905 +
906 + dax_region = alloc_dax_region(dev, region_id, &res,
907 le32_to_cpu(pfn_sb->align), addr, PFN_DEV|PFN_MAP);
908 if (!dax_region)
909 return -ENOMEM;
910
911 /* TODO: support for subdividing a dax region... */
912 - dax_dev = devm_create_dax_dev(dax_region, &res, 1);
913 + dax_dev = devm_create_dax_dev(dax_region, id, &res, 1);
914
915 /* child dax_dev instances now own the lifetime of the dax_region */
916 dax_region_put(dax_region);
917 diff --git a/drivers/dma/ioat/hw.h b/drivers/dma/ioat/hw.h
918 index 8e67895bcca3..abcc51b343ce 100644
919 --- a/drivers/dma/ioat/hw.h
920 +++ b/drivers/dma/ioat/hw.h
921 @@ -64,6 +64,8 @@
922 #define PCI_DEVICE_ID_INTEL_IOAT_BDX8 0x6f2e
923 #define PCI_DEVICE_ID_INTEL_IOAT_BDX9 0x6f2f
924
925 +#define PCI_DEVICE_ID_INTEL_IOAT_SKX 0x2021
926 +
927 #define IOAT_VER_1_2 0x12 /* Version 1.2 */
928 #define IOAT_VER_2_0 0x20 /* Version 2.0 */
929 #define IOAT_VER_3_0 0x30 /* Version 3.0 */
930 diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
931 index d235fbe2564f..0dea6d55f0ff 100644
932 --- a/drivers/dma/ioat/init.c
933 +++ b/drivers/dma/ioat/init.c
934 @@ -106,6 +106,8 @@ static struct pci_device_id ioat_pci_tbl[] = {
935 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BDX8) },
936 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BDX9) },
937
938 + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_SKX) },
939 +
940 /* I/OAT v3.3 platforms */
941 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BWD0) },
942 { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BWD1) },
943 @@ -243,10 +245,15 @@ static bool is_bdx_ioat(struct pci_dev *pdev)
944 }
945 }
946
947 +static inline bool is_skx_ioat(struct pci_dev *pdev)
948 +{
949 + return (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_SKX) ? true : false;
950 +}
951 +
952 static bool is_xeon_cb32(struct pci_dev *pdev)
953 {
954 return is_jf_ioat(pdev) || is_snb_ioat(pdev) || is_ivb_ioat(pdev) ||
955 - is_hsw_ioat(pdev) || is_bdx_ioat(pdev);
956 + is_hsw_ioat(pdev) || is_bdx_ioat(pdev) || is_skx_ioat(pdev);
957 }
958
959 bool is_bwd_ioat(struct pci_dev *pdev)
960 @@ -1350,6 +1357,8 @@ static int ioat_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
961
962 device->version = readb(device->reg_base + IOAT_VER_OFFSET);
963 if (device->version >= IOAT_VER_3_0) {
964 + if (is_skx_ioat(pdev))
965 + device->version = IOAT_VER_3_2;
966 err = ioat3_dma_probe(device, ioat_dca_enabled);
967
968 if (device->version >= IOAT_VER_3_3)
969 diff --git a/drivers/dma/ti-dma-crossbar.c b/drivers/dma/ti-dma-crossbar.c
970 index 3f24aeb48c0e..2403475a37cf 100644
971 --- a/drivers/dma/ti-dma-crossbar.c
972 +++ b/drivers/dma/ti-dma-crossbar.c
973 @@ -149,6 +149,7 @@ static int ti_am335x_xbar_probe(struct platform_device *pdev)
974 match = of_match_node(ti_am335x_master_match, dma_node);
975 if (!match) {
976 dev_err(&pdev->dev, "DMA master is not supported\n");
977 + of_node_put(dma_node);
978 return -EINVAL;
979 }
980
981 @@ -339,6 +340,7 @@ static int ti_dra7_xbar_probe(struct platform_device *pdev)
982 match = of_match_node(ti_dra7_master_match, dma_node);
983 if (!match) {
984 dev_err(&pdev->dev, "DMA master is not supported\n");
985 + of_node_put(dma_node);
986 return -EINVAL;
987 }
988
989 diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
990 index f386f463278d..a904082ed206 100644
991 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
992 +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
993 @@ -210,7 +210,14 @@ void adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
994 void adreno_flush(struct msm_gpu *gpu)
995 {
996 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
997 - uint32_t wptr = get_wptr(gpu->rb);
998 + uint32_t wptr;
999 +
1000 + /*
1001 + * Mask wptr value that we calculate to fit in the HW range. This is
1002 + * to account for the possibility that the last command fit exactly into
1003 + * the ringbuffer and rb->next hasn't wrapped to zero yet
1004 + */
1005 + wptr = get_wptr(gpu->rb) & ((gpu->rb->size / 4) - 1);
1006
1007 /* ensure writes to ringbuffer have hit system memory: */
1008 mb();
1009 diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
1010 index b6a0f37a65f3..393973016b52 100644
1011 --- a/drivers/gpu/drm/msm/msm_gem_submit.c
1012 +++ b/drivers/gpu/drm/msm/msm_gem_submit.c
1013 @@ -106,7 +106,8 @@ static int submit_lookup_objects(struct msm_gem_submit *submit,
1014 pagefault_disable();
1015 }
1016
1017 - if (submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) {
1018 + if ((submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) ||
1019 + !(submit_bo.flags & MSM_SUBMIT_BO_FLAGS)) {
1020 DRM_ERROR("invalid flags: %x\n", submit_bo.flags);
1021 ret = -EINVAL;
1022 goto out_unlock;
1023 @@ -290,7 +291,7 @@ static int submit_reloc(struct msm_gem_submit *submit, struct msm_gem_object *ob
1024 {
1025 uint32_t i, last_offset = 0;
1026 uint32_t *ptr;
1027 - int ret;
1028 + int ret = 0;
1029
1030 if (offset % 4) {
1031 DRM_ERROR("non-aligned cmdstream buffer: %u\n", offset);
1032 @@ -317,12 +318,13 @@ static int submit_reloc(struct msm_gem_submit *submit, struct msm_gem_object *ob
1033
1034 ret = copy_from_user(&submit_reloc, userptr, sizeof(submit_reloc));
1035 if (ret)
1036 - return -EFAULT;
1037 + goto out;
1038
1039 if (submit_reloc.submit_offset % 4) {
1040 DRM_ERROR("non-aligned reloc offset: %u\n",
1041 submit_reloc.submit_offset);
1042 - return -EINVAL;
1043 + ret = -EINVAL;
1044 + goto out;
1045 }
1046
1047 /* offset in dwords: */
1048 @@ -331,12 +333,13 @@ static int submit_reloc(struct msm_gem_submit *submit, struct msm_gem_object *ob
1049 if ((off >= (obj->base.size / 4)) ||
1050 (off < last_offset)) {
1051 DRM_ERROR("invalid offset %u at reloc %u\n", off, i);
1052 - return -EINVAL;
1053 + ret = -EINVAL;
1054 + goto out;
1055 }
1056
1057 ret = submit_bo(submit, submit_reloc.reloc_idx, NULL, &iova, &valid);
1058 if (ret)
1059 - return ret;
1060 + goto out;
1061
1062 if (valid)
1063 continue;
1064 @@ -353,9 +356,10 @@ static int submit_reloc(struct msm_gem_submit *submit, struct msm_gem_object *ob
1065 last_offset = off;
1066 }
1067
1068 +out:
1069 msm_gem_put_vaddr_locked(&obj->base);
1070
1071 - return 0;
1072 + return ret;
1073 }
1074
1075 static void submit_cleanup(struct msm_gem_submit *submit)
1076 diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c b/drivers/gpu/drm/msm/msm_ringbuffer.c
1077 index f326cf6a32e6..67b34e069abf 100644
1078 --- a/drivers/gpu/drm/msm/msm_ringbuffer.c
1079 +++ b/drivers/gpu/drm/msm/msm_ringbuffer.c
1080 @@ -23,7 +23,8 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int size)
1081 struct msm_ringbuffer *ring;
1082 int ret;
1083
1084 - size = ALIGN(size, 4); /* size should be dword aligned */
1085 + if (WARN_ON(!is_power_of_2(size)))
1086 + return ERR_PTR(-EINVAL);
1087
1088 ring = kzalloc(sizeof(*ring), GFP_KERNEL);
1089 if (!ring) {
1090 diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
1091 index 1e1de6bfe85a..5893be9788d3 100644
1092 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
1093 +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
1094 @@ -27,7 +27,7 @@ struct nv50_disp {
1095 u8 type[3];
1096 } pior;
1097
1098 - struct nv50_disp_chan *chan[17];
1099 + struct nv50_disp_chan *chan[21];
1100 };
1101
1102 int nv50_disp_root_scanoutpos(NV50_DISP_MTHD_V0);
1103 diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
1104 index c794b2c2d21e..6d8f21290aa2 100644
1105 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
1106 +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
1107 @@ -129,7 +129,7 @@ gf100_bar_init(struct nvkm_bar *base)
1108
1109 if (bar->bar[0].mem) {
1110 addr = nvkm_memory_addr(bar->bar[0].mem) >> 12;
1111 - nvkm_wr32(device, 0x001714, 0xc0000000 | addr);
1112 + nvkm_wr32(device, 0x001714, 0x80000000 | addr);
1113 }
1114
1115 return 0;
1116 diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
1117 index 73c971e39b1c..ae125d070212 100644
1118 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
1119 +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
1120 @@ -285,7 +285,6 @@ static int rcar_du_remove(struct platform_device *pdev)
1121
1122 drm_kms_helper_poll_fini(ddev);
1123 drm_mode_config_cleanup(ddev);
1124 - drm_vblank_cleanup(ddev);
1125
1126 drm_dev_unref(ddev);
1127
1128 @@ -305,7 +304,7 @@ static int rcar_du_probe(struct platform_device *pdev)
1129 return -ENODEV;
1130 }
1131
1132 - /* Allocate and initialize the DRM and R-Car device structures. */
1133 + /* Allocate and initialize the R-Car device structure. */
1134 rcdu = devm_kzalloc(&pdev->dev, sizeof(*rcdu), GFP_KERNEL);
1135 if (rcdu == NULL)
1136 return -ENOMEM;
1137 @@ -315,31 +314,22 @@ static int rcar_du_probe(struct platform_device *pdev)
1138 rcdu->dev = &pdev->dev;
1139 rcdu->info = of_match_device(rcar_du_of_table, rcdu->dev)->data;
1140
1141 - ddev = drm_dev_alloc(&rcar_du_driver, &pdev->dev);
1142 - if (IS_ERR(ddev))
1143 - return PTR_ERR(ddev);
1144 -
1145 - rcdu->ddev = ddev;
1146 - ddev->dev_private = rcdu;
1147 -
1148 platform_set_drvdata(pdev, rcdu);
1149
1150 /* I/O resources */
1151 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1152 rcdu->mmio = devm_ioremap_resource(&pdev->dev, mem);
1153 - if (IS_ERR(rcdu->mmio)) {
1154 - ret = PTR_ERR(rcdu->mmio);
1155 - goto error;
1156 - }
1157 -
1158 - /* Initialize vertical blanking interrupts handling. Start with vblank
1159 - * disabled for all CRTCs.
1160 - */
1161 - ret = drm_vblank_init(ddev, (1 << rcdu->info->num_crtcs) - 1);
1162 - if (ret < 0)
1163 - goto error;
1164 + if (IS_ERR(rcdu->mmio))
1165 + return PTR_ERR(rcdu->mmio);
1166
1167 /* DRM/KMS objects */
1168 + ddev = drm_dev_alloc(&rcar_du_driver, &pdev->dev);
1169 + if (IS_ERR(ddev))
1170 + return PTR_ERR(ddev);
1171 +
1172 + rcdu->ddev = ddev;
1173 + ddev->dev_private = rcdu;
1174 +
1175 ret = rcar_du_modeset_init(rcdu);
1176 if (ret < 0) {
1177 if (ret != -EPROBE_DEFER)
1178 diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
1179 index 392c7e6de042..cfc302c65b0b 100644
1180 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
1181 +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
1182 @@ -567,6 +567,13 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
1183 if (ret < 0)
1184 return ret;
1185
1186 + /* Initialize vertical blanking interrupts handling. Start with vblank
1187 + * disabled for all CRTCs.
1188 + */
1189 + ret = drm_vblank_init(dev, (1 << rcdu->info->num_crtcs) - 1);
1190 + if (ret < 0)
1191 + return ret;
1192 +
1193 /* Initialize the groups. */
1194 num_groups = DIV_ROUND_UP(rcdu->num_crtcs, 2);
1195
1196 diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
1197 index c7b53d987f06..fefb9d995d2c 100644
1198 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
1199 +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
1200 @@ -519,7 +519,7 @@ static int vmw_cmd_invalid(struct vmw_private *dev_priv,
1201 struct vmw_sw_context *sw_context,
1202 SVGA3dCmdHeader *header)
1203 {
1204 - return capable(CAP_SYS_ADMIN) ? : -EINVAL;
1205 + return -EINVAL;
1206 }
1207
1208 static int vmw_cmd_ok(struct vmw_private *dev_priv,
1209 diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
1210 index a5dd7e63ada3..4f3f5749b0c1 100644
1211 --- a/drivers/hid/hid-core.c
1212 +++ b/drivers/hid/hid-core.c
1213 @@ -2484,6 +2484,7 @@ static const struct hid_device_id hid_ignore_list[] = {
1214 { HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0002) },
1215 { HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0003) },
1216 { HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0004) },
1217 + { HID_USB_DEVICE(USB_VENDOR_ID_PETZL, USB_DEVICE_ID_PETZL_HEADLAMP) },
1218 { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE) },
1219 { HID_USB_DEVICE(USB_VENDOR_ID_POWERCOM, USB_DEVICE_ID_POWERCOM_UPS) },
1220 #if IS_ENABLED(CONFIG_MOUSE_SYNAPTICS_USB)
1221 diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
1222 index cfca43f635a6..08fd3f831d62 100644
1223 --- a/drivers/hid/hid-ids.h
1224 +++ b/drivers/hid/hid-ids.h
1225 @@ -819,6 +819,9 @@
1226 #define USB_VENDOR_ID_PETALYNX 0x18b1
1227 #define USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE 0x0037
1228
1229 +#define USB_VENDOR_ID_PETZL 0x2122
1230 +#define USB_DEVICE_ID_PETZL_HEADLAMP 0x1234
1231 +
1232 #define USB_VENDOR_ID_PHILIPS 0x0471
1233 #define USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE 0x0617
1234
1235 diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
1236 index 01e3a37b0aef..d118ffe0bfb6 100644
1237 --- a/drivers/infiniband/core/uverbs_cmd.c
1238 +++ b/drivers/infiniband/core/uverbs_cmd.c
1239 @@ -2342,8 +2342,9 @@ ssize_t ib_uverbs_modify_qp(struct ib_uverbs_file *file,
1240 if (copy_from_user(&cmd, buf, sizeof cmd))
1241 return -EFAULT;
1242
1243 - if (cmd.port_num < rdma_start_port(ib_dev) ||
1244 - cmd.port_num > rdma_end_port(ib_dev))
1245 + if ((cmd.attr_mask & IB_QP_PORT) &&
1246 + (cmd.port_num < rdma_start_port(ib_dev) ||
1247 + cmd.port_num > rdma_end_port(ib_dev)))
1248 return -EINVAL;
1249
1250 INIT_UDATA(&udata, buf + sizeof cmd, NULL, in_len - sizeof cmd,
1251 diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
1252 index f2a885eee4bb..8059b7eaf3a8 100644
1253 --- a/drivers/infiniband/hw/mlx4/main.c
1254 +++ b/drivers/infiniband/hw/mlx4/main.c
1255 @@ -1680,9 +1680,19 @@ static int __mlx4_ib_create_flow(struct ib_qp *qp, struct ib_flow_attr *flow_att
1256 size += ret;
1257 }
1258
1259 + if (mlx4_is_master(mdev->dev) && flow_type == MLX4_FS_REGULAR &&
1260 + flow_attr->num_of_specs == 1) {
1261 + struct _rule_hw *rule_header = (struct _rule_hw *)(ctrl + 1);
1262 + enum ib_flow_spec_type header_spec =
1263 + ((union ib_flow_spec *)(flow_attr + 1))->type;
1264 +
1265 + if (header_spec == IB_FLOW_SPEC_ETH)
1266 + mlx4_handle_eth_header_mcast_prio(ctrl, rule_header);
1267 + }
1268 +
1269 ret = mlx4_cmd_imm(mdev->dev, mailbox->dma, reg_id, size >> 2, 0,
1270 MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A,
1271 - MLX4_CMD_WRAPPED);
1272 + MLX4_CMD_NATIVE);
1273 if (ret == -ENOMEM)
1274 pr_err("mcg table is full. Fail to register network rule.\n");
1275 else if (ret == -ENXIO)
1276 @@ -1699,7 +1709,7 @@ static int __mlx4_ib_destroy_flow(struct mlx4_dev *dev, u64 reg_id)
1277 int err;
1278 err = mlx4_cmd(dev, reg_id, 0, 0,
1279 MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A,
1280 - MLX4_CMD_WRAPPED);
1281 + MLX4_CMD_NATIVE);
1282 if (err)
1283 pr_err("Fail to detach network rule. registration id = 0x%llx\n",
1284 reg_id);
1285 diff --git a/drivers/irqchip/irq-keystone.c b/drivers/irqchip/irq-keystone.c
1286 index 54a5e870a8f5..efbcf8435185 100644
1287 --- a/drivers/irqchip/irq-keystone.c
1288 +++ b/drivers/irqchip/irq-keystone.c
1289 @@ -19,9 +19,9 @@
1290 #include <linux/bitops.h>
1291 #include <linux/module.h>
1292 #include <linux/moduleparam.h>
1293 +#include <linux/interrupt.h>
1294 #include <linux/irqdomain.h>
1295 #include <linux/irqchip.h>
1296 -#include <linux/irqchip/chained_irq.h>
1297 #include <linux/of.h>
1298 #include <linux/of_platform.h>
1299 #include <linux/mfd/syscon.h>
1300 @@ -39,6 +39,7 @@ struct keystone_irq_device {
1301 struct irq_domain *irqd;
1302 struct regmap *devctrl_regs;
1303 u32 devctrl_offset;
1304 + raw_spinlock_t wa_lock;
1305 };
1306
1307 static inline u32 keystone_irq_readl(struct keystone_irq_device *kirq)
1308 @@ -83,17 +84,15 @@ static void keystone_irq_ack(struct irq_data *d)
1309 /* nothing to do here */
1310 }
1311
1312 -static void keystone_irq_handler(struct irq_desc *desc)
1313 +static irqreturn_t keystone_irq_handler(int irq, void *keystone_irq)
1314 {
1315 - unsigned int irq = irq_desc_get_irq(desc);
1316 - struct keystone_irq_device *kirq = irq_desc_get_handler_data(desc);
1317 + struct keystone_irq_device *kirq = keystone_irq;
1318 + unsigned long wa_lock_flags;
1319 unsigned long pending;
1320 int src, virq;
1321
1322 dev_dbg(kirq->dev, "start irq %d\n", irq);
1323
1324 - chained_irq_enter(irq_desc_get_chip(desc), desc);
1325 -
1326 pending = keystone_irq_readl(kirq);
1327 keystone_irq_writel(kirq, pending);
1328
1329 @@ -111,13 +110,15 @@ static void keystone_irq_handler(struct irq_desc *desc)
1330 if (!virq)
1331 dev_warn(kirq->dev, "spurious irq detected hwirq %d, virq %d\n",
1332 src, virq);
1333 + raw_spin_lock_irqsave(&kirq->wa_lock, wa_lock_flags);
1334 generic_handle_irq(virq);
1335 + raw_spin_unlock_irqrestore(&kirq->wa_lock,
1336 + wa_lock_flags);
1337 }
1338 }
1339
1340 - chained_irq_exit(irq_desc_get_chip(desc), desc);
1341 -
1342 dev_dbg(kirq->dev, "end irq %d\n", irq);
1343 + return IRQ_HANDLED;
1344 }
1345
1346 static int keystone_irq_map(struct irq_domain *h, unsigned int virq,
1347 @@ -182,9 +183,16 @@ static int keystone_irq_probe(struct platform_device *pdev)
1348 return -ENODEV;
1349 }
1350
1351 + raw_spin_lock_init(&kirq->wa_lock);
1352 +
1353 platform_set_drvdata(pdev, kirq);
1354
1355 - irq_set_chained_handler_and_data(kirq->irq, keystone_irq_handler, kirq);
1356 + ret = request_irq(kirq->irq, keystone_irq_handler,
1357 + 0, dev_name(dev), kirq);
1358 + if (ret) {
1359 + irq_domain_remove(kirq->irqd);
1360 + return ret;
1361 + }
1362
1363 /* clear all source bits */
1364 keystone_irq_writel(kirq, ~0x0);
1365 @@ -199,6 +207,8 @@ static int keystone_irq_remove(struct platform_device *pdev)
1366 struct keystone_irq_device *kirq = platform_get_drvdata(pdev);
1367 int hwirq;
1368
1369 + free_irq(kirq->irq, kirq);
1370 +
1371 for (hwirq = 0; hwirq < KEYSTONE_N_IRQ; hwirq++)
1372 irq_dispose_mapping(irq_find_mapping(kirq->irqd, hwirq));
1373
1374 diff --git a/drivers/irqchip/irq-mxs.c b/drivers/irqchip/irq-mxs.c
1375 index 17304705f2cf..05fa9f7af53c 100644
1376 --- a/drivers/irqchip/irq-mxs.c
1377 +++ b/drivers/irqchip/irq-mxs.c
1378 @@ -131,12 +131,16 @@ static struct irq_chip mxs_icoll_chip = {
1379 .irq_ack = icoll_ack_irq,
1380 .irq_mask = icoll_mask_irq,
1381 .irq_unmask = icoll_unmask_irq,
1382 + .flags = IRQCHIP_MASK_ON_SUSPEND |
1383 + IRQCHIP_SKIP_SET_WAKE,
1384 };
1385
1386 static struct irq_chip asm9260_icoll_chip = {
1387 .irq_ack = icoll_ack_irq,
1388 .irq_mask = asm9260_mask_irq,
1389 .irq_unmask = asm9260_unmask_irq,
1390 + .flags = IRQCHIP_MASK_ON_SUSPEND |
1391 + IRQCHIP_SKIP_SET_WAKE,
1392 };
1393
1394 asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs)
1395 diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
1396 index 9b856e1890d1..e4c43a17b333 100644
1397 --- a/drivers/isdn/i4l/isdn_common.c
1398 +++ b/drivers/isdn/i4l/isdn_common.c
1399 @@ -1379,6 +1379,7 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
1400 if (arg) {
1401 if (copy_from_user(bname, argp, sizeof(bname) - 1))
1402 return -EFAULT;
1403 + bname[sizeof(bname)-1] = 0;
1404 } else
1405 return -EINVAL;
1406 ret = mutex_lock_interruptible(&dev->mtx);
1407 diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
1408 index c151c6daa67e..f63a110b7bcb 100644
1409 --- a/drivers/isdn/i4l/isdn_net.c
1410 +++ b/drivers/isdn/i4l/isdn_net.c
1411 @@ -2611,10 +2611,9 @@ isdn_net_newslave(char *parm)
1412 char newname[10];
1413
1414 if (p) {
1415 - /* Slave-Name MUST not be empty */
1416 - if (!strlen(p + 1))
1417 + /* Slave-Name MUST not be empty or overflow 'newname' */
1418 + if (strscpy(newname, p + 1, sizeof(newname)) <= 0)
1419 return NULL;
1420 - strcpy(newname, p + 1);
1421 *p = 0;
1422 /* Master must already exist */
1423 if (!(n = isdn_net_findif(parm)))
1424 diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
1425 index 9c1e8adaf4fc..bf3fbd00a091 100644
1426 --- a/drivers/isdn/i4l/isdn_ppp.c
1427 +++ b/drivers/isdn/i4l/isdn_ppp.c
1428 @@ -2364,7 +2364,7 @@ static struct ippp_ccp_reset_state *isdn_ppp_ccp_reset_alloc_state(struct ippp_s
1429 id);
1430 return NULL;
1431 } else {
1432 - rs = kzalloc(sizeof(struct ippp_ccp_reset_state), GFP_KERNEL);
1433 + rs = kzalloc(sizeof(struct ippp_ccp_reset_state), GFP_ATOMIC);
1434 if (!rs)
1435 return NULL;
1436 rs->state = CCPResetIdle;
1437 diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
1438 index 4a36632c236f..87ef465c6947 100644
1439 --- a/drivers/mailbox/mailbox.c
1440 +++ b/drivers/mailbox/mailbox.c
1441 @@ -104,11 +104,14 @@ static void tx_tick(struct mbox_chan *chan, int r)
1442 /* Submit next message */
1443 msg_submit(chan);
1444
1445 + if (!mssg)
1446 + return;
1447 +
1448 /* Notify the client */
1449 - if (mssg && chan->cl->tx_done)
1450 + if (chan->cl->tx_done)
1451 chan->cl->tx_done(chan->cl, mssg, r);
1452
1453 - if (chan->cl->tx_block)
1454 + if (r != -ETIME && chan->cl->tx_block)
1455 complete(&chan->tx_complete);
1456 }
1457
1458 @@ -261,7 +264,7 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)
1459
1460 msg_submit(chan);
1461
1462 - if (chan->cl->tx_block && chan->active_req) {
1463 + if (chan->cl->tx_block) {
1464 unsigned long wait;
1465 int ret;
1466
1467 @@ -272,8 +275,8 @@ int mbox_send_message(struct mbox_chan *chan, void *mssg)
1468
1469 ret = wait_for_completion_timeout(&chan->tx_complete, wait);
1470 if (ret == 0) {
1471 - t = -EIO;
1472 - tx_tick(chan, -EIO);
1473 + t = -ETIME;
1474 + tx_tick(chan, t);
1475 }
1476 }
1477
1478 diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
1479 index 8f117d6372c9..383f19c6bf24 100644
1480 --- a/drivers/md/raid5.c
1481 +++ b/drivers/md/raid5.c
1482 @@ -5843,6 +5843,8 @@ static void raid5_do_work(struct work_struct *work)
1483 pr_debug("%d stripes handled\n", handled);
1484
1485 spin_unlock_irq(&conf->device_lock);
1486 +
1487 + async_tx_issue_pending_all();
1488 blk_finish_plug(&plug);
1489
1490 pr_debug("--- raid5worker inactive\n");
1491 diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c b/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c
1492 index 0a060339e516..2e7185030741 100644
1493 --- a/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c
1494 +++ b/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c
1495 @@ -211,7 +211,7 @@ static int s5c73m3_3a_lock(struct s5c73m3 *state, struct v4l2_ctrl *ctrl)
1496 }
1497
1498 if ((ctrl->val ^ ctrl->cur.val) & V4L2_LOCK_FOCUS)
1499 - ret = s5c73m3_af_run(state, ~af_lock);
1500 + ret = s5c73m3_af_run(state, !af_lock);
1501
1502 return ret;
1503 }
1504 diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
1505 index b3c9cbef766e..5626908f3f7a 100644
1506 --- a/drivers/net/ethernet/emulex/benet/be_main.c
1507 +++ b/drivers/net/ethernet/emulex/benet/be_main.c
1508 @@ -5186,7 +5186,9 @@ static netdev_features_t be_features_check(struct sk_buff *skb,
1509 skb->inner_protocol_type != ENCAP_TYPE_ETHER ||
1510 skb->inner_protocol != htons(ETH_P_TEB) ||
1511 skb_inner_mac_header(skb) - skb_transport_header(skb) !=
1512 - sizeof(struct udphdr) + sizeof(struct vxlanhdr))
1513 + sizeof(struct udphdr) + sizeof(struct vxlanhdr) ||
1514 + !adapter->vxlan_port ||
1515 + udp_hdr(skb)->dest != adapter->vxlan_port)
1516 return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
1517
1518 return features;
1519 diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c b/drivers/net/ethernet/mellanox/mlx4/icm.c
1520 index 2a9dd460a95f..e1f9e7cebf8f 100644
1521 --- a/drivers/net/ethernet/mellanox/mlx4/icm.c
1522 +++ b/drivers/net/ethernet/mellanox/mlx4/icm.c
1523 @@ -118,8 +118,13 @@ static int mlx4_alloc_icm_coherent(struct device *dev, struct scatterlist *mem,
1524 if (!buf)
1525 return -ENOMEM;
1526
1527 + if (offset_in_page(buf)) {
1528 + dma_free_coherent(dev, PAGE_SIZE << order,
1529 + buf, sg_dma_address(mem));
1530 + return -ENOMEM;
1531 + }
1532 +
1533 sg_set_buf(mem, buf, PAGE_SIZE << order);
1534 - BUG_ON(mem->offset);
1535 sg_dma_len(mem) = PAGE_SIZE << order;
1536 return 0;
1537 }
1538 diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
1539 index b2ca8a635b2e..551786f58e59 100644
1540 --- a/drivers/net/ethernet/mellanox/mlx4/main.c
1541 +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
1542 @@ -42,6 +42,7 @@
1543 #include <linux/io-mapping.h>
1544 #include <linux/delay.h>
1545 #include <linux/kmod.h>
1546 +#include <linux/etherdevice.h>
1547 #include <net/devlink.h>
1548
1549 #include <linux/mlx4/device.h>
1550 @@ -782,6 +783,23 @@ int mlx4_is_slave_active(struct mlx4_dev *dev, int slave)
1551 }
1552 EXPORT_SYMBOL(mlx4_is_slave_active);
1553
1554 +void mlx4_handle_eth_header_mcast_prio(struct mlx4_net_trans_rule_hw_ctrl *ctrl,
1555 + struct _rule_hw *eth_header)
1556 +{
1557 + if (is_multicast_ether_addr(eth_header->eth.dst_mac) ||
1558 + is_broadcast_ether_addr(eth_header->eth.dst_mac)) {
1559 + struct mlx4_net_trans_rule_hw_eth *eth =
1560 + (struct mlx4_net_trans_rule_hw_eth *)eth_header;
1561 + struct _rule_hw *next_rule = (struct _rule_hw *)(eth + 1);
1562 + bool last_rule = next_rule->size == 0 && next_rule->id == 0 &&
1563 + next_rule->rsvd == 0;
1564 +
1565 + if (last_rule)
1566 + ctrl->prio = cpu_to_be16(MLX4_DOMAIN_NIC);
1567 + }
1568 +}
1569 +EXPORT_SYMBOL(mlx4_handle_eth_header_mcast_prio);
1570 +
1571 static void slave_adjust_steering_mode(struct mlx4_dev *dev,
1572 struct mlx4_dev_cap *dev_cap,
1573 struct mlx4_init_hca_param *hca_param)
1574 diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
1575 index 32f76bf018c3..1822382212ee 100644
1576 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
1577 +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
1578 @@ -4165,22 +4165,6 @@ static int validate_eth_header_mac(int slave, struct _rule_hw *eth_header,
1579 return 0;
1580 }
1581
1582 -static void handle_eth_header_mcast_prio(struct mlx4_net_trans_rule_hw_ctrl *ctrl,
1583 - struct _rule_hw *eth_header)
1584 -{
1585 - if (is_multicast_ether_addr(eth_header->eth.dst_mac) ||
1586 - is_broadcast_ether_addr(eth_header->eth.dst_mac)) {
1587 - struct mlx4_net_trans_rule_hw_eth *eth =
1588 - (struct mlx4_net_trans_rule_hw_eth *)eth_header;
1589 - struct _rule_hw *next_rule = (struct _rule_hw *)(eth + 1);
1590 - bool last_rule = next_rule->size == 0 && next_rule->id == 0 &&
1591 - next_rule->rsvd == 0;
1592 -
1593 - if (last_rule)
1594 - ctrl->prio = cpu_to_be16(MLX4_DOMAIN_NIC);
1595 - }
1596 -}
1597 -
1598 /*
1599 * In case of missing eth header, append eth header with a MAC address
1600 * assigned to the VF.
1601 @@ -4364,10 +4348,7 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
1602 header_id = map_hw_to_sw_id(be16_to_cpu(rule_header->id));
1603
1604 if (header_id == MLX4_NET_TRANS_RULE_ID_ETH)
1605 - handle_eth_header_mcast_prio(ctrl, rule_header);
1606 -
1607 - if (slave == dev->caps.function)
1608 - goto execute;
1609 + mlx4_handle_eth_header_mcast_prio(ctrl, rule_header);
1610
1611 switch (header_id) {
1612 case MLX4_NET_TRANS_RULE_ID_ETH:
1613 @@ -4395,7 +4376,6 @@ int mlx4_QP_FLOW_STEERING_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
1614 goto err_put_qp;
1615 }
1616
1617 -execute:
1618 err = mlx4_cmd_imm(dev, inbox->dma, &vhcr->out_param,
1619 vhcr->in_modifier, 0,
1620 MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A,
1621 @@ -4474,6 +4454,7 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave,
1622 struct res_qp *rqp;
1623 struct res_fs_rule *rrule;
1624 u64 mirr_reg_id;
1625 + int qpn;
1626
1627 if (dev->caps.steering_mode !=
1628 MLX4_STEERING_MODE_DEVICE_MANAGED)
1629 @@ -4490,10 +4471,11 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave,
1630 }
1631 mirr_reg_id = rrule->mirr_rule_id;
1632 kfree(rrule->mirr_mbox);
1633 + qpn = rrule->qpn;
1634
1635 /* Release the rule form busy state before removal */
1636 put_res(dev, slave, vhcr->in_param, RES_FS_RULE);
1637 - err = get_res(dev, slave, rrule->qpn, RES_QP, &rqp);
1638 + err = get_res(dev, slave, qpn, RES_QP, &rqp);
1639 if (err)
1640 return err;
1641
1642 @@ -4518,7 +4500,7 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev *dev, int slave,
1643 if (!err)
1644 atomic_dec(&rqp->ref_count);
1645 out:
1646 - put_res(dev, slave, rrule->qpn, RES_QP);
1647 + put_res(dev, slave, qpn, RES_QP);
1648 return err;
1649 }
1650
1651 diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
1652 index b08b9e2c6a76..6ffd5d2a70aa 100644
1653 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
1654 +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
1655 @@ -672,6 +672,12 @@ int esw_offloads_init(struct mlx5_eswitch *esw, int nvports)
1656 if (err)
1657 goto err_reps;
1658 }
1659 +
1660 + /* disable PF RoCE so missed packets don't go through RoCE steering */
1661 + mlx5_dev_list_lock();
1662 + mlx5_remove_dev_by_protocol(esw->dev, MLX5_INTERFACE_PROTOCOL_IB);
1663 + mlx5_dev_list_unlock();
1664 +
1665 return 0;
1666
1667 err_reps:
1668 @@ -695,6 +701,11 @@ static int esw_offloads_stop(struct mlx5_eswitch *esw)
1669 {
1670 int err, err1, num_vfs = esw->dev->priv.sriov.num_vfs;
1671
1672 + /* enable back PF RoCE */
1673 + mlx5_dev_list_lock();
1674 + mlx5_add_dev_by_protocol(esw->dev, MLX5_INTERFACE_PROTOCOL_IB);
1675 + mlx5_dev_list_unlock();
1676 +
1677 mlx5_eswitch_disable_sriov(esw);
1678 err = mlx5_eswitch_enable_sriov(esw, num_vfs, SRIOV_LEGACY);
1679 if (err) {
1680 diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
1681 index bf000d819a21..2c4350a1c629 100644
1682 --- a/drivers/net/ethernet/realtek/r8169.c
1683 +++ b/drivers/net/ethernet/realtek/r8169.c
1684 @@ -326,6 +326,7 @@ enum cfg_version {
1685 static const struct pci_device_id rtl8169_pci_tbl[] = {
1686 { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8129), 0, 0, RTL_CFG_0 },
1687 { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8136), 0, 0, RTL_CFG_2 },
1688 + { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8161), 0, 0, RTL_CFG_1 },
1689 { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8167), 0, 0, RTL_CFG_0 },
1690 { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8168), 0, 0, RTL_CFG_1 },
1691 { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8169), 0, 0, RTL_CFG_0 },
1692 diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
1693 index a2d218b28c0e..12be259394c6 100644
1694 --- a/drivers/net/ethernet/renesas/sh_eth.c
1695 +++ b/drivers/net/ethernet/renesas/sh_eth.c
1696 @@ -819,6 +819,7 @@ static struct sh_eth_cpu_data sh7734_data = {
1697 .tsu = 1,
1698 .hw_crc = 1,
1699 .select_mii = 1,
1700 + .shift_rd0 = 1,
1701 };
1702
1703 /* SH7763 */
1704 diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
1705 index 32b555a72e13..9e7b7836774f 100644
1706 --- a/drivers/net/phy/phy_device.c
1707 +++ b/drivers/net/phy/phy_device.c
1708 @@ -1792,7 +1792,7 @@ static struct phy_driver genphy_driver[] = {
1709 .phy_id = 0xffffffff,
1710 .phy_id_mask = 0xffffffff,
1711 .name = "Generic PHY",
1712 - .soft_reset = genphy_soft_reset,
1713 + .soft_reset = genphy_no_soft_reset,
1714 .config_init = genphy_config_init,
1715 .features = PHY_GBIT_FEATURES | SUPPORTED_MII |
1716 SUPPORTED_AUI | SUPPORTED_FIBRE |
1717 diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
1718 index dc7b6392e75a..50737def774c 100644
1719 --- a/drivers/net/usb/asix_devices.c
1720 +++ b/drivers/net/usb/asix_devices.c
1721 @@ -1369,6 +1369,7 @@ static struct usb_driver asix_driver = {
1722 .probe = usbnet_probe,
1723 .suspend = asix_suspend,
1724 .resume = asix_resume,
1725 + .reset_resume = asix_resume,
1726 .disconnect = usbnet_disconnect,
1727 .supports_autosuspend = 1,
1728 .disable_hub_initiated_lpm = 1,
1729 diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
1730 index c9a8bb1186f2..c7956e181f80 100644
1731 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
1732 +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
1733 @@ -660,6 +660,9 @@ ath10k_wmi_vdev_spectral_conf(struct ath10k *ar,
1734 struct sk_buff *skb;
1735 u32 cmd_id;
1736
1737 + if (!ar->wmi.ops->gen_vdev_spectral_conf)
1738 + return -EOPNOTSUPP;
1739 +
1740 skb = ar->wmi.ops->gen_vdev_spectral_conf(ar, arg);
1741 if (IS_ERR(skb))
1742 return PTR_ERR(skb);
1743 @@ -675,6 +678,9 @@ ath10k_wmi_vdev_spectral_enable(struct ath10k *ar, u32 vdev_id, u32 trigger,
1744 struct sk_buff *skb;
1745 u32 cmd_id;
1746
1747 + if (!ar->wmi.ops->gen_vdev_spectral_enable)
1748 + return -EOPNOTSUPP;
1749 +
1750 skb = ar->wmi.ops->gen_vdev_spectral_enable(ar, vdev_id, trigger,
1751 enable);
1752 if (IS_ERR(skb))
1753 diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
1754 index e7130b54d1d8..24b07a0ce6f7 100644
1755 --- a/drivers/net/wireless/ath/wil6210/main.c
1756 +++ b/drivers/net/wireless/ath/wil6210/main.c
1757 @@ -384,18 +384,19 @@ static void wil_fw_error_worker(struct work_struct *work)
1758
1759 wil->last_fw_recovery = jiffies;
1760
1761 + wil_info(wil, "fw error recovery requested (try %d)...\n",
1762 + wil->recovery_count);
1763 + if (!no_fw_recovery)
1764 + wil->recovery_state = fw_recovery_running;
1765 + if (wil_wait_for_recovery(wil) != 0)
1766 + return;
1767 +
1768 mutex_lock(&wil->mutex);
1769 switch (wdev->iftype) {
1770 case NL80211_IFTYPE_STATION:
1771 case NL80211_IFTYPE_P2P_CLIENT:
1772 case NL80211_IFTYPE_MONITOR:
1773 - wil_info(wil, "fw error recovery requested (try %d)...\n",
1774 - wil->recovery_count);
1775 - if (!no_fw_recovery)
1776 - wil->recovery_state = fw_recovery_running;
1777 - if (0 != wil_wait_for_recovery(wil))
1778 - break;
1779 -
1780 + /* silent recovery, upper layers will see disconnect */
1781 __wil_down(wil);
1782 __wil_up(wil);
1783 break;
1784 diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c
1785 index 5e797d5c38ed..712936f5d2d6 100644
1786 --- a/drivers/nfc/fdp/i2c.c
1787 +++ b/drivers/nfc/fdp/i2c.c
1788 @@ -210,14 +210,14 @@ static irqreturn_t fdp_nci_i2c_irq_thread_fn(int irq, void *phy_id)
1789 struct sk_buff *skb;
1790 int r;
1791
1792 - client = phy->i2c_dev;
1793 - dev_dbg(&client->dev, "%s\n", __func__);
1794 -
1795 if (!phy || irq != phy->i2c_dev->irq) {
1796 WARN_ON_ONCE(1);
1797 return IRQ_NONE;
1798 }
1799
1800 + client = phy->i2c_dev;
1801 + dev_dbg(&client->dev, "%s\n", __func__);
1802 +
1803 r = fdp_nci_i2c_read(phy, &skb);
1804
1805 if (r == -EREMOTEIO)
1806 diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c
1807 index 2b2330b235e6..073e4a478c89 100644
1808 --- a/drivers/nfc/port100.c
1809 +++ b/drivers/nfc/port100.c
1810 @@ -725,23 +725,33 @@ static int port100_submit_urb_for_ack(struct port100 *dev, gfp_t flags)
1811
1812 static int port100_send_ack(struct port100 *dev)
1813 {
1814 - int rc;
1815 + int rc = 0;
1816
1817 mutex_lock(&dev->out_urb_lock);
1818
1819 - init_completion(&dev->cmd_cancel_done);
1820 + /*
1821 + * If prior cancel is in-flight (dev->cmd_cancel == true), we
1822 + * can skip to send cancel. Then this will wait the prior
1823 + * cancel, or merged into the next cancel rarely if next
1824 + * cancel was started before waiting done. In any case, this
1825 + * will be waked up soon or later.
1826 + */
1827 + if (!dev->cmd_cancel) {
1828 + reinit_completion(&dev->cmd_cancel_done);
1829
1830 - usb_kill_urb(dev->out_urb);
1831 + usb_kill_urb(dev->out_urb);
1832
1833 - dev->out_urb->transfer_buffer = ack_frame;
1834 - dev->out_urb->transfer_buffer_length = sizeof(ack_frame);
1835 - rc = usb_submit_urb(dev->out_urb, GFP_KERNEL);
1836 + dev->out_urb->transfer_buffer = ack_frame;
1837 + dev->out_urb->transfer_buffer_length = sizeof(ack_frame);
1838 + rc = usb_submit_urb(dev->out_urb, GFP_KERNEL);
1839
1840 - /* Set the cmd_cancel flag only if the URB has been successfully
1841 - * submitted. It will be reset by the out URB completion callback
1842 - * port100_send_complete().
1843 - */
1844 - dev->cmd_cancel = !rc;
1845 + /*
1846 + * Set the cmd_cancel flag only if the URB has been
1847 + * successfully submitted. It will be reset by the out
1848 + * URB completion callback port100_send_complete().
1849 + */
1850 + dev->cmd_cancel = !rc;
1851 + }
1852
1853 mutex_unlock(&dev->out_urb_lock);
1854
1855 @@ -928,8 +938,8 @@ static void port100_send_complete(struct urb *urb)
1856 struct port100 *dev = urb->context;
1857
1858 if (dev->cmd_cancel) {
1859 + complete_all(&dev->cmd_cancel_done);
1860 dev->cmd_cancel = false;
1861 - complete(&dev->cmd_cancel_done);
1862 }
1863
1864 switch (urb->status) {
1865 @@ -1543,6 +1553,7 @@ static int port100_probe(struct usb_interface *interface,
1866 PORT100_COMM_RF_HEAD_MAX_LEN;
1867 dev->skb_tailroom = PORT100_FRAME_TAIL_LEN;
1868
1869 + init_completion(&dev->cmd_cancel_done);
1870 INIT_WORK(&dev->cmd_complete_work, port100_wq_cmd_complete);
1871
1872 /* The first thing to do with the Port-100 is to set the command type
1873 diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c
1874 index ac27b9bac3b9..8e7b120696fa 100644
1875 --- a/drivers/nvmem/imx-ocotp.c
1876 +++ b/drivers/nvmem/imx-ocotp.c
1877 @@ -71,7 +71,7 @@ static struct nvmem_config imx_ocotp_nvmem_config = {
1878
1879 static const struct of_device_id imx_ocotp_dt_ids[] = {
1880 { .compatible = "fsl,imx6q-ocotp", (void *)128 },
1881 - { .compatible = "fsl,imx6sl-ocotp", (void *)32 },
1882 + { .compatible = "fsl,imx6sl-ocotp", (void *)64 },
1883 { .compatible = "fsl,imx6sx-ocotp", (void *)128 },
1884 { },
1885 };
1886 diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
1887 index 9d253cb83ee7..e70410beb83a 100644
1888 --- a/drivers/scsi/bfa/bfad.c
1889 +++ b/drivers/scsi/bfa/bfad.c
1890 @@ -64,9 +64,9 @@ int max_rport_logins = BFA_FCS_MAX_RPORT_LOGINS;
1891 u32 bfi_image_cb_size, bfi_image_ct_size, bfi_image_ct2_size;
1892 u32 *bfi_image_cb, *bfi_image_ct, *bfi_image_ct2;
1893
1894 -#define BFAD_FW_FILE_CB "cbfw-3.2.3.0.bin"
1895 -#define BFAD_FW_FILE_CT "ctfw-3.2.3.0.bin"
1896 -#define BFAD_FW_FILE_CT2 "ct2fw-3.2.3.0.bin"
1897 +#define BFAD_FW_FILE_CB "cbfw-3.2.5.1.bin"
1898 +#define BFAD_FW_FILE_CT "ctfw-3.2.5.1.bin"
1899 +#define BFAD_FW_FILE_CT2 "ct2fw-3.2.5.1.bin"
1900
1901 static u32 *bfad_load_fwimg(struct pci_dev *pdev);
1902 static void bfad_free_fwimg(void);
1903 diff --git a/drivers/scsi/bfa/bfad_drv.h b/drivers/scsi/bfa/bfad_drv.h
1904 index f9e862093a25..cfcfff48e8e1 100644
1905 --- a/drivers/scsi/bfa/bfad_drv.h
1906 +++ b/drivers/scsi/bfa/bfad_drv.h
1907 @@ -58,7 +58,7 @@
1908 #ifdef BFA_DRIVER_VERSION
1909 #define BFAD_DRIVER_VERSION BFA_DRIVER_VERSION
1910 #else
1911 -#define BFAD_DRIVER_VERSION "3.2.25.0"
1912 +#define BFAD_DRIVER_VERSION "3.2.25.1"
1913 #endif
1914
1915 #define BFAD_PROTO_NAME FCPI_NAME
1916 diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h
1917 index 9ddc9200e0a4..9e4b7709043e 100644
1918 --- a/drivers/scsi/fnic/fnic.h
1919 +++ b/drivers/scsi/fnic/fnic.h
1920 @@ -248,6 +248,7 @@ struct fnic {
1921 struct completion *remove_wait; /* device remove thread blocks */
1922
1923 atomic_t in_flight; /* io counter */
1924 + bool internal_reset_inprogress;
1925 u32 _reserved; /* fill hole */
1926 unsigned long state_flags; /* protected by host lock */
1927 enum fnic_state state;
1928 diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
1929 index d9fd2f841585..44dd372aa7d3 100644
1930 --- a/drivers/scsi/fnic/fnic_scsi.c
1931 +++ b/drivers/scsi/fnic/fnic_scsi.c
1932 @@ -2573,6 +2573,19 @@ int fnic_host_reset(struct scsi_cmnd *sc)
1933 unsigned long wait_host_tmo;
1934 struct Scsi_Host *shost = sc->device->host;
1935 struct fc_lport *lp = shost_priv(shost);
1936 + struct fnic *fnic = lport_priv(lp);
1937 + unsigned long flags;
1938 +
1939 + spin_lock_irqsave(&fnic->fnic_lock, flags);
1940 + if (fnic->internal_reset_inprogress == 0) {
1941 + fnic->internal_reset_inprogress = 1;
1942 + } else {
1943 + spin_unlock_irqrestore(&fnic->fnic_lock, flags);
1944 + FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
1945 + "host reset in progress skipping another host reset\n");
1946 + return SUCCESS;
1947 + }
1948 + spin_unlock_irqrestore(&fnic->fnic_lock, flags);
1949
1950 /*
1951 * If fnic_reset is successful, wait for fabric login to complete
1952 @@ -2593,6 +2606,9 @@ int fnic_host_reset(struct scsi_cmnd *sc)
1953 }
1954 }
1955
1956 + spin_lock_irqsave(&fnic->fnic_lock, flags);
1957 + fnic->internal_reset_inprogress = 0;
1958 + spin_unlock_irqrestore(&fnic->fnic_lock, flags);
1959 return ret;
1960 }
1961
1962 diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c
1963 index 396b32dca074..7cf70aaec0ba 100644
1964 --- a/drivers/scsi/snic/snic_main.c
1965 +++ b/drivers/scsi/snic/snic_main.c
1966 @@ -591,6 +591,7 @@ snic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1967 if (!pool) {
1968 SNIC_HOST_ERR(shost, "dflt sgl pool creation failed\n");
1969
1970 + ret = -ENOMEM;
1971 goto err_free_res;
1972 }
1973
1974 @@ -601,6 +602,7 @@ snic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1975 if (!pool) {
1976 SNIC_HOST_ERR(shost, "max sgl pool creation failed\n");
1977
1978 + ret = -ENOMEM;
1979 goto err_free_dflt_sgl_pool;
1980 }
1981
1982 @@ -611,6 +613,7 @@ snic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1983 if (!pool) {
1984 SNIC_HOST_ERR(shost, "snic tmreq info pool creation failed.\n");
1985
1986 + ret = -ENOMEM;
1987 goto err_free_max_sgl_pool;
1988 }
1989
1990 diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
1991 index 27960e46135d..c4226c07e091 100644
1992 --- a/drivers/spi/spi-dw.c
1993 +++ b/drivers/spi/spi-dw.c
1994 @@ -107,7 +107,10 @@ static const struct file_operations dw_spi_regs_ops = {
1995
1996 static int dw_spi_debugfs_init(struct dw_spi *dws)
1997 {
1998 - dws->debugfs = debugfs_create_dir("dw_spi", NULL);
1999 + char name[128];
2000 +
2001 + snprintf(name, 128, "dw_spi-%s", dev_name(&dws->master->dev));
2002 + dws->debugfs = debugfs_create_dir(name, NULL);
2003 if (!dws->debugfs)
2004 return -ENOMEM;
2005
2006 diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
2007 index a34fd5afb9a8..ec9979070479 100644
2008 --- a/drivers/staging/comedi/comedi_fops.c
2009 +++ b/drivers/staging/comedi/comedi_fops.c
2010 @@ -2898,9 +2898,6 @@ static int __init comedi_init(void)
2011
2012 comedi_class->dev_groups = comedi_dev_groups;
2013
2014 - /* XXX requires /proc interface */
2015 - comedi_proc_init();
2016 -
2017 /* create devices files for legacy/manual use */
2018 for (i = 0; i < comedi_num_legacy_minors; i++) {
2019 struct comedi_device *dev;
2020 @@ -2918,6 +2915,9 @@ static int __init comedi_init(void)
2021 mutex_unlock(&dev->mutex);
2022 }
2023
2024 + /* XXX requires /proc interface */
2025 + comedi_proc_init();
2026 +
2027 return 0;
2028 }
2029 module_init(comedi_init);
2030 diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
2031 index 5dd1832564c7..35b63518baf6 100644
2032 --- a/drivers/usb/dwc3/dwc3-omap.c
2033 +++ b/drivers/usb/dwc3/dwc3-omap.c
2034 @@ -19,6 +19,7 @@
2035 #include <linux/module.h>
2036 #include <linux/kernel.h>
2037 #include <linux/slab.h>
2038 +#include <linux/irq.h>
2039 #include <linux/interrupt.h>
2040 #include <linux/platform_device.h>
2041 #include <linux/platform_data/dwc3-omap.h>
2042 @@ -511,7 +512,7 @@ static int dwc3_omap_probe(struct platform_device *pdev)
2043
2044 /* check the DMA Status */
2045 reg = dwc3_omap_readl(omap->base, USBOTGSS_SYSCONFIG);
2046 -
2047 + irq_set_status_flags(omap->irq, IRQ_NOAUTOEN);
2048 ret = devm_request_threaded_irq(dev, omap->irq, dwc3_omap_interrupt,
2049 dwc3_omap_interrupt_thread, IRQF_SHARED,
2050 "dwc3-omap", omap);
2051 @@ -532,7 +533,7 @@ static int dwc3_omap_probe(struct platform_device *pdev)
2052 }
2053
2054 dwc3_omap_enable_irqs(omap);
2055 -
2056 + enable_irq(omap->irq);
2057 return 0;
2058
2059 err2:
2060 @@ -553,6 +554,7 @@ static int dwc3_omap_remove(struct platform_device *pdev)
2061 extcon_unregister_notifier(omap->edev, EXTCON_USB, &omap->vbus_nb);
2062 extcon_unregister_notifier(omap->edev, EXTCON_USB_HOST, &omap->id_nb);
2063 dwc3_omap_disable_irqs(omap);
2064 + disable_irq(omap->irq);
2065 of_platform_depopulate(omap->dev);
2066 pm_runtime_put_sync(&pdev->dev);
2067 pm_runtime_disable(&pdev->dev);
2068 diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
2069 index b0f71957d00b..b6d4b484c51a 100644
2070 --- a/drivers/usb/gadget/function/f_hid.c
2071 +++ b/drivers/usb/gadget/function/f_hid.c
2072 @@ -582,7 +582,7 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
2073 }
2074 status = usb_ep_enable(hidg->out_ep);
2075 if (status < 0) {
2076 - ERROR(cdev, "Enable IN endpoint FAILED!\n");
2077 + ERROR(cdev, "Enable OUT endpoint FAILED!\n");
2078 goto fail;
2079 }
2080 hidg->out_ep->driver_data = hidg;
2081 diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
2082 index 031bc08d000d..43559bed7822 100644
2083 --- a/drivers/vfio/pci/vfio_pci.c
2084 +++ b/drivers/vfio/pci/vfio_pci.c
2085 @@ -1173,6 +1173,10 @@ static int vfio_pci_mmap(void *device_data, struct vm_area_struct *vma)
2086 return ret;
2087
2088 vdev->barmap[index] = pci_iomap(pdev, index, 0);
2089 + if (!vdev->barmap[index]) {
2090 + pci_release_selected_regions(pdev, 1 << index);
2091 + return -ENOMEM;
2092 + }
2093 }
2094
2095 vma->vm_private_data = vdev;
2096 diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c b/drivers/vfio/pci/vfio_pci_rdwr.c
2097 index 5ffd1d9ad4bd..357243d76f10 100644
2098 --- a/drivers/vfio/pci/vfio_pci_rdwr.c
2099 +++ b/drivers/vfio/pci/vfio_pci_rdwr.c
2100 @@ -193,7 +193,10 @@ ssize_t vfio_pci_vga_rw(struct vfio_pci_device *vdev, char __user *buf,
2101 if (!vdev->has_vga)
2102 return -EINVAL;
2103
2104 - switch (pos) {
2105 + if (pos > 0xbfffful)
2106 + return -EINVAL;
2107 +
2108 + switch ((u32)pos) {
2109 case 0xa0000 ... 0xbffff:
2110 count = min(count, (size_t)(0xc0000 - pos));
2111 iomem = ioremap_nocache(0xa0000, 0xbffff - 0xa0000 + 1);
2112 diff --git a/drivers/video/fbdev/cobalt_lcdfb.c b/drivers/video/fbdev/cobalt_lcdfb.c
2113 index 2d3b691f3fc4..038ac6934fe9 100644
2114 --- a/drivers/video/fbdev/cobalt_lcdfb.c
2115 +++ b/drivers/video/fbdev/cobalt_lcdfb.c
2116 @@ -308,6 +308,11 @@ static int cobalt_lcdfb_probe(struct platform_device *dev)
2117 info->screen_size = resource_size(res);
2118 info->screen_base = devm_ioremap(&dev->dev, res->start,
2119 info->screen_size);
2120 + if (!info->screen_base) {
2121 + framebuffer_release(info);
2122 + return -ENOMEM;
2123 + }
2124 +
2125 info->fbops = &cobalt_lcd_fbops;
2126 info->fix = cobalt_lcdfb_fix;
2127 info->fix.smem_start = res->start;
2128 diff --git a/drivers/xen/arm-device.c b/drivers/xen/arm-device.c
2129 index 778acf80aacb..85dd20e05726 100644
2130 --- a/drivers/xen/arm-device.c
2131 +++ b/drivers/xen/arm-device.c
2132 @@ -58,9 +58,13 @@ static int xen_map_device_mmio(const struct resource *resources,
2133 xen_pfn_t *gpfns;
2134 xen_ulong_t *idxs;
2135 int *errs;
2136 - struct xen_add_to_physmap_range xatp;
2137
2138 for (i = 0; i < count; i++) {
2139 + struct xen_add_to_physmap_range xatp = {
2140 + .domid = DOMID_SELF,
2141 + .space = XENMAPSPACE_dev_mmio
2142 + };
2143 +
2144 r = &resources[i];
2145 nr = DIV_ROUND_UP(resource_size(r), XEN_PAGE_SIZE);
2146 if ((resource_type(r) != IORESOURCE_MEM) || (nr == 0))
2147 @@ -87,9 +91,7 @@ static int xen_map_device_mmio(const struct resource *resources,
2148 idxs[j] = XEN_PFN_DOWN(r->start) + j;
2149 }
2150
2151 - xatp.domid = DOMID_SELF;
2152 xatp.size = nr;
2153 - xatp.space = XENMAPSPACE_dev_mmio;
2154
2155 set_xen_guest_handle(xatp.gpfns, gpfns);
2156 set_xen_guest_handle(xatp.idxs, idxs);
2157 diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
2158 index e46e7fbe1b34..14a37ff0b9e3 100644
2159 --- a/fs/btrfs/extent-tree.c
2160 +++ b/fs/btrfs/extent-tree.c
2161 @@ -7401,7 +7401,8 @@ btrfs_lock_cluster(struct btrfs_block_group_cache *block_group,
2162
2163 spin_unlock(&cluster->refill_lock);
2164
2165 - down_read(&used_bg->data_rwsem);
2166 + /* We should only have one-level nested. */
2167 + down_read_nested(&used_bg->data_rwsem, SINGLE_DEPTH_NESTING);
2168
2169 spin_lock(&cluster->refill_lock);
2170 if (used_bg == cluster->block_group)
2171 diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
2172 index a2a014b19f18..8a05fa7e2152 100644
2173 --- a/fs/btrfs/inode.c
2174 +++ b/fs/btrfs/inode.c
2175 @@ -7648,11 +7648,18 @@ static void adjust_dio_outstanding_extents(struct inode *inode,
2176 * within our reservation, otherwise we need to adjust our inode
2177 * counter appropriately.
2178 */
2179 - if (dio_data->outstanding_extents) {
2180 + if (dio_data->outstanding_extents >= num_extents) {
2181 dio_data->outstanding_extents -= num_extents;
2182 } else {
2183 + /*
2184 + * If dio write length has been split due to no large enough
2185 + * contiguous space, we need to compensate our inode counter
2186 + * appropriately.
2187 + */
2188 + u64 num_needed = num_extents - dio_data->outstanding_extents;
2189 +
2190 spin_lock(&BTRFS_I(inode)->lock);
2191 - BTRFS_I(inode)->outstanding_extents += num_extents;
2192 + BTRFS_I(inode)->outstanding_extents += num_needed;
2193 spin_unlock(&BTRFS_I(inode)->lock);
2194 }
2195 }
2196 diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
2197 index b89004513c09..309313b71617 100644
2198 --- a/fs/btrfs/tree-log.c
2199 +++ b/fs/btrfs/tree-log.c
2200 @@ -37,6 +37,7 @@
2201 */
2202 #define LOG_INODE_ALL 0
2203 #define LOG_INODE_EXISTS 1
2204 +#define LOG_OTHER_INODE 2
2205
2206 /*
2207 * directory trouble cases
2208 @@ -4623,7 +4624,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
2209 if (S_ISDIR(inode->i_mode) ||
2210 (!test_bit(BTRFS_INODE_NEEDS_FULL_SYNC,
2211 &BTRFS_I(inode)->runtime_flags) &&
2212 - inode_only == LOG_INODE_EXISTS))
2213 + inode_only >= LOG_INODE_EXISTS))
2214 max_key.type = BTRFS_XATTR_ITEM_KEY;
2215 else
2216 max_key.type = (u8)-1;
2217 @@ -4647,7 +4648,13 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
2218 return ret;
2219 }
2220
2221 - mutex_lock(&BTRFS_I(inode)->log_mutex);
2222 + if (inode_only == LOG_OTHER_INODE) {
2223 + inode_only = LOG_INODE_EXISTS;
2224 + mutex_lock_nested(&BTRFS_I(inode)->log_mutex,
2225 + SINGLE_DEPTH_NESTING);
2226 + } else {
2227 + mutex_lock(&BTRFS_I(inode)->log_mutex);
2228 + }
2229
2230 /*
2231 * a brute force approach to making sure we get the most uptodate
2232 @@ -4799,7 +4806,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
2233 * unpin it.
2234 */
2235 err = btrfs_log_inode(trans, root, other_inode,
2236 - LOG_INODE_EXISTS,
2237 + LOG_OTHER_INODE,
2238 0, LLONG_MAX, ctx);
2239 iput(other_inode);
2240 if (err)
2241 diff --git a/fs/dcache.c b/fs/dcache.c
2242 index 1dbc6b560fef..67957f5b325c 100644
2243 --- a/fs/dcache.c
2244 +++ b/fs/dcache.c
2245 @@ -277,6 +277,33 @@ static inline int dname_external(const struct dentry *dentry)
2246 return dentry->d_name.name != dentry->d_iname;
2247 }
2248
2249 +void take_dentry_name_snapshot(struct name_snapshot *name, struct dentry *dentry)
2250 +{
2251 + spin_lock(&dentry->d_lock);
2252 + if (unlikely(dname_external(dentry))) {
2253 + struct external_name *p = external_name(dentry);
2254 + atomic_inc(&p->u.count);
2255 + spin_unlock(&dentry->d_lock);
2256 + name->name = p->name;
2257 + } else {
2258 + memcpy(name->inline_name, dentry->d_iname, DNAME_INLINE_LEN);
2259 + spin_unlock(&dentry->d_lock);
2260 + name->name = name->inline_name;
2261 + }
2262 +}
2263 +EXPORT_SYMBOL(take_dentry_name_snapshot);
2264 +
2265 +void release_dentry_name_snapshot(struct name_snapshot *name)
2266 +{
2267 + if (unlikely(name->name != name->inline_name)) {
2268 + struct external_name *p;
2269 + p = container_of(name->name, struct external_name, name[0]);
2270 + if (unlikely(atomic_dec_and_test(&p->u.count)))
2271 + kfree_rcu(p, u.head);
2272 + }
2273 +}
2274 +EXPORT_SYMBOL(release_dentry_name_snapshot);
2275 +
2276 static inline void __d_set_inode_and_type(struct dentry *dentry,
2277 struct inode *inode,
2278 unsigned type_flags)
2279 diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
2280 index 1e30f74a9527..3d7de9f4f545 100644
2281 --- a/fs/debugfs/inode.c
2282 +++ b/fs/debugfs/inode.c
2283 @@ -730,7 +730,7 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
2284 {
2285 int error;
2286 struct dentry *dentry = NULL, *trap;
2287 - const char *old_name;
2288 + struct name_snapshot old_name;
2289
2290 trap = lock_rename(new_dir, old_dir);
2291 /* Source or destination directories don't exist? */
2292 @@ -745,19 +745,19 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
2293 if (IS_ERR(dentry) || dentry == trap || d_really_is_positive(dentry))
2294 goto exit;
2295
2296 - old_name = fsnotify_oldname_init(old_dentry->d_name.name);
2297 + take_dentry_name_snapshot(&old_name, old_dentry);
2298
2299 error = simple_rename(d_inode(old_dir), old_dentry, d_inode(new_dir),
2300 dentry, 0);
2301 if (error) {
2302 - fsnotify_oldname_free(old_name);
2303 + release_dentry_name_snapshot(&old_name);
2304 goto exit;
2305 }
2306 d_move(old_dentry, dentry);
2307 - fsnotify_move(d_inode(old_dir), d_inode(new_dir), old_name,
2308 + fsnotify_move(d_inode(old_dir), d_inode(new_dir), old_name.name,
2309 d_is_dir(old_dentry),
2310 NULL, old_dentry);
2311 - fsnotify_oldname_free(old_name);
2312 + release_dentry_name_snapshot(&old_name);
2313 unlock_rename(new_dir, old_dir);
2314 dput(dentry);
2315 return old_dentry;
2316 diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
2317 index 7bc186f4ed4d..1be45c8d460d 100644
2318 --- a/fs/jfs/acl.c
2319 +++ b/fs/jfs/acl.c
2320 @@ -77,13 +77,6 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type,
2321 switch (type) {
2322 case ACL_TYPE_ACCESS:
2323 ea_name = XATTR_NAME_POSIX_ACL_ACCESS;
2324 - if (acl) {
2325 - rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
2326 - if (rc)
2327 - return rc;
2328 - inode->i_ctime = current_time(inode);
2329 - mark_inode_dirty(inode);
2330 - }
2331 break;
2332 case ACL_TYPE_DEFAULT:
2333 ea_name = XATTR_NAME_POSIX_ACL_DEFAULT;
2334 @@ -118,9 +111,17 @@ int jfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
2335
2336 tid = txBegin(inode->i_sb, 0);
2337 mutex_lock(&JFS_IP(inode)->commit_mutex);
2338 + if (type == ACL_TYPE_ACCESS && acl) {
2339 + rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
2340 + if (rc)
2341 + goto end_tx;
2342 + inode->i_ctime = current_time(inode);
2343 + mark_inode_dirty(inode);
2344 + }
2345 rc = __jfs_set_acl(tid, inode, type, acl);
2346 if (!rc)
2347 rc = txCommit(tid, 1, &inode, 0);
2348 +end_tx:
2349 txEnd(tid);
2350 mutex_unlock(&JFS_IP(inode)->commit_mutex);
2351 return rc;
2352 diff --git a/fs/namei.c b/fs/namei.c
2353 index d5e5140c1045..66209f720146 100644
2354 --- a/fs/namei.c
2355 +++ b/fs/namei.c
2356 @@ -4336,11 +4336,11 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
2357 {
2358 int error;
2359 bool is_dir = d_is_dir(old_dentry);
2360 - const unsigned char *old_name;
2361 struct inode *source = old_dentry->d_inode;
2362 struct inode *target = new_dentry->d_inode;
2363 bool new_is_dir = false;
2364 unsigned max_links = new_dir->i_sb->s_max_links;
2365 + struct name_snapshot old_name;
2366
2367 /*
2368 * Check source == target.
2369 @@ -4391,7 +4391,7 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
2370 if (error)
2371 return error;
2372
2373 - old_name = fsnotify_oldname_init(old_dentry->d_name.name);
2374 + take_dentry_name_snapshot(&old_name, old_dentry);
2375 dget(new_dentry);
2376 if (!is_dir || (flags & RENAME_EXCHANGE))
2377 lock_two_nondirectories(source, target);
2378 @@ -4446,14 +4446,14 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
2379 inode_unlock(target);
2380 dput(new_dentry);
2381 if (!error) {
2382 - fsnotify_move(old_dir, new_dir, old_name, is_dir,
2383 + fsnotify_move(old_dir, new_dir, old_name.name, is_dir,
2384 !(flags & RENAME_EXCHANGE) ? target : NULL, old_dentry);
2385 if (flags & RENAME_EXCHANGE) {
2386 fsnotify_move(new_dir, old_dir, old_dentry->d_name.name,
2387 new_is_dir, NULL, new_dentry);
2388 }
2389 }
2390 - fsnotify_oldname_free(old_name);
2391 + release_dentry_name_snapshot(&old_name);
2392
2393 return error;
2394 }
2395 diff --git a/fs/nfs/file.c b/fs/nfs/file.c
2396 index a1de8ef63e56..84c1cb9237d0 100644
2397 --- a/fs/nfs/file.c
2398 +++ b/fs/nfs/file.c
2399 @@ -757,7 +757,7 @@ do_setlk(struct file *filp, int cmd, struct file_lock *fl, int is_local)
2400 */
2401 nfs_sync_mapping(filp->f_mapping);
2402 if (!NFS_PROTO(inode)->have_delegation(inode, FMODE_READ))
2403 - nfs_zap_mapping(inode, filp->f_mapping);
2404 + nfs_zap_caches(inode);
2405 out:
2406 return status;
2407 }
2408 diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
2409 index 401ea6e4cab8..46ca7881d80d 100644
2410 --- a/fs/nfs/nfs4proc.c
2411 +++ b/fs/nfs/nfs4proc.c
2412 @@ -6419,7 +6419,7 @@ nfs4_retry_setlk(struct nfs4_state *state, int cmd, struct file_lock *request)
2413 set_current_state(TASK_INTERRUPTIBLE);
2414 spin_unlock_irqrestore(&q->lock, flags);
2415
2416 - freezable_schedule_timeout_interruptible(NFS4_LOCK_MAXTIMEOUT);
2417 + freezable_schedule_timeout(NFS4_LOCK_MAXTIMEOUT);
2418 }
2419
2420 finish_wait(q, &wait);
2421 diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
2422 index db39de2dd4cb..a64adc2fced9 100644
2423 --- a/fs/notify/fsnotify.c
2424 +++ b/fs/notify/fsnotify.c
2425 @@ -104,16 +104,20 @@ int __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask)
2426 if (unlikely(!fsnotify_inode_watches_children(p_inode)))
2427 __fsnotify_update_child_dentry_flags(p_inode);
2428 else if (p_inode->i_fsnotify_mask & mask) {
2429 + struct name_snapshot name;
2430 +
2431 /* we are notifying a parent so come up with the new mask which
2432 * specifies these are events which came from a child. */
2433 mask |= FS_EVENT_ON_CHILD;
2434
2435 + take_dentry_name_snapshot(&name, dentry);
2436 if (path)
2437 ret = fsnotify(p_inode, mask, path, FSNOTIFY_EVENT_PATH,
2438 - dentry->d_name.name, 0);
2439 + name.name, 0);
2440 else
2441 ret = fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE,
2442 - dentry->d_name.name, 0);
2443 + name.name, 0);
2444 + release_dentry_name_snapshot(&name);
2445 }
2446
2447 dput(parent);
2448 diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
2449 index 6ad831b9d1b8..8b09271e5d66 100644
2450 --- a/fs/pstore/ram.c
2451 +++ b/fs/pstore/ram.c
2452 @@ -434,7 +434,7 @@ static int ramoops_init_przs(struct device *dev, struct ramoops_context *cxt,
2453 for (i = 0; i < cxt->max_dump_cnt; i++) {
2454 cxt->przs[i] = persistent_ram_new(*paddr, cxt->record_size, 0,
2455 &cxt->ecc_info,
2456 - cxt->memtype);
2457 + cxt->memtype, 0);
2458 if (IS_ERR(cxt->przs[i])) {
2459 err = PTR_ERR(cxt->przs[i]);
2460 dev_err(dev, "failed to request mem region (0x%zx@0x%llx): %d\n",
2461 @@ -471,7 +471,8 @@ static int ramoops_init_prz(struct device *dev, struct ramoops_context *cxt,
2462 return -ENOMEM;
2463 }
2464
2465 - *prz = persistent_ram_new(*paddr, sz, sig, &cxt->ecc_info, cxt->memtype);
2466 + *prz = persistent_ram_new(*paddr, sz, sig, &cxt->ecc_info,
2467 + cxt->memtype, 0);
2468 if (IS_ERR(*prz)) {
2469 int err = PTR_ERR(*prz);
2470
2471 diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
2472 index 3975deec02f8..e11672aa4575 100644
2473 --- a/fs/pstore/ram_core.c
2474 +++ b/fs/pstore/ram_core.c
2475 @@ -48,16 +48,15 @@ static inline size_t buffer_start(struct persistent_ram_zone *prz)
2476 return atomic_read(&prz->buffer->start);
2477 }
2478
2479 -static DEFINE_RAW_SPINLOCK(buffer_lock);
2480 -
2481 /* increase and wrap the start pointer, returning the old value */
2482 static size_t buffer_start_add(struct persistent_ram_zone *prz, size_t a)
2483 {
2484 int old;
2485 int new;
2486 - unsigned long flags;
2487 + unsigned long flags = 0;
2488
2489 - raw_spin_lock_irqsave(&buffer_lock, flags);
2490 + if (!(prz->flags & PRZ_FLAG_NO_LOCK))
2491 + raw_spin_lock_irqsave(&prz->buffer_lock, flags);
2492
2493 old = atomic_read(&prz->buffer->start);
2494 new = old + a;
2495 @@ -65,7 +64,8 @@ static size_t buffer_start_add(struct persistent_ram_zone *prz, size_t a)
2496 new -= prz->buffer_size;
2497 atomic_set(&prz->buffer->start, new);
2498
2499 - raw_spin_unlock_irqrestore(&buffer_lock, flags);
2500 + if (!(prz->flags & PRZ_FLAG_NO_LOCK))
2501 + raw_spin_unlock_irqrestore(&prz->buffer_lock, flags);
2502
2503 return old;
2504 }
2505 @@ -75,9 +75,10 @@ static void buffer_size_add(struct persistent_ram_zone *prz, size_t a)
2506 {
2507 size_t old;
2508 size_t new;
2509 - unsigned long flags;
2510 + unsigned long flags = 0;
2511
2512 - raw_spin_lock_irqsave(&buffer_lock, flags);
2513 + if (!(prz->flags & PRZ_FLAG_NO_LOCK))
2514 + raw_spin_lock_irqsave(&prz->buffer_lock, flags);
2515
2516 old = atomic_read(&prz->buffer->size);
2517 if (old == prz->buffer_size)
2518 @@ -89,7 +90,8 @@ static void buffer_size_add(struct persistent_ram_zone *prz, size_t a)
2519 atomic_set(&prz->buffer->size, new);
2520
2521 exit:
2522 - raw_spin_unlock_irqrestore(&buffer_lock, flags);
2523 + if (!(prz->flags & PRZ_FLAG_NO_LOCK))
2524 + raw_spin_unlock_irqrestore(&prz->buffer_lock, flags);
2525 }
2526
2527 static void notrace persistent_ram_encode_rs8(struct persistent_ram_zone *prz,
2528 @@ -491,6 +493,7 @@ static int persistent_ram_post_init(struct persistent_ram_zone *prz, u32 sig,
2529 prz->buffer->sig);
2530 }
2531
2532 + /* Rewind missing or invalid memory area. */
2533 prz->buffer->sig = sig;
2534 persistent_ram_zap(prz);
2535
2536 @@ -517,7 +520,7 @@ void persistent_ram_free(struct persistent_ram_zone *prz)
2537
2538 struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
2539 u32 sig, struct persistent_ram_ecc_info *ecc_info,
2540 - unsigned int memtype)
2541 + unsigned int memtype, u32 flags)
2542 {
2543 struct persistent_ram_zone *prz;
2544 int ret = -ENOMEM;
2545 @@ -528,6 +531,10 @@ struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
2546 goto err;
2547 }
2548
2549 + /* Initialize general buffer state. */
2550 + raw_spin_lock_init(&prz->buffer_lock);
2551 + prz->flags = flags;
2552 +
2553 ret = persistent_ram_buffer_map(start, size, prz, memtype);
2554 if (ret)
2555 goto err;
2556 diff --git a/include/linux/dcache.h b/include/linux/dcache.h
2557 index 5beed7b30561..ff295e166b2c 100644
2558 --- a/include/linux/dcache.h
2559 +++ b/include/linux/dcache.h
2560 @@ -590,5 +590,11 @@ static inline struct inode *d_real_inode(const struct dentry *dentry)
2561 return d_backing_inode(d_real((struct dentry *) dentry, NULL, 0));
2562 }
2563
2564 +struct name_snapshot {
2565 + const char *name;
2566 + char inline_name[DNAME_INLINE_LEN];
2567 +};
2568 +void take_dentry_name_snapshot(struct name_snapshot *, struct dentry *);
2569 +void release_dentry_name_snapshot(struct name_snapshot *);
2570
2571 #endif /* __LINUX_DCACHE_H */
2572 diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
2573 index b8bcc058e031..e5f03a4d8430 100644
2574 --- a/include/linux/fsnotify.h
2575 +++ b/include/linux/fsnotify.h
2576 @@ -293,35 +293,4 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid)
2577 }
2578 }
2579
2580 -#if defined(CONFIG_FSNOTIFY) /* notify helpers */
2581 -
2582 -/*
2583 - * fsnotify_oldname_init - save off the old filename before we change it
2584 - */
2585 -static inline const unsigned char *fsnotify_oldname_init(const unsigned char *name)
2586 -{
2587 - return kstrdup(name, GFP_KERNEL);
2588 -}
2589 -
2590 -/*
2591 - * fsnotify_oldname_free - free the name we got from fsnotify_oldname_init
2592 - */
2593 -static inline void fsnotify_oldname_free(const unsigned char *old_name)
2594 -{
2595 - kfree(old_name);
2596 -}
2597 -
2598 -#else /* CONFIG_FSNOTIFY */
2599 -
2600 -static inline const char *fsnotify_oldname_init(const unsigned char *name)
2601 -{
2602 - return NULL;
2603 -}
2604 -
2605 -static inline void fsnotify_oldname_free(const unsigned char *old_name)
2606 -{
2607 -}
2608 -
2609 -#endif /* CONFIG_FSNOTIFY */
2610 -
2611 #endif /* _LINUX_FS_NOTIFY_H */
2612 diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
2613 index c9f379689dd0..80faf44b8887 100644
2614 --- a/include/linux/mlx4/device.h
2615 +++ b/include/linux/mlx4/device.h
2616 @@ -1384,6 +1384,8 @@ int set_phv_bit(struct mlx4_dev *dev, u8 port, int new_val);
2617 int get_phv_bit(struct mlx4_dev *dev, u8 port, int *phv);
2618 int mlx4_get_is_vlan_offload_disabled(struct mlx4_dev *dev, u8 port,
2619 bool *vlan_offload_disabled);
2620 +void mlx4_handle_eth_header_mcast_prio(struct mlx4_net_trans_rule_hw_ctrl *ctrl,
2621 + struct _rule_hw *eth_header);
2622 int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx);
2623 int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
2624 int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
2625 diff --git a/include/linux/phy.h b/include/linux/phy.h
2626 index 6c9b1e0006ee..8431c8c0c320 100644
2627 --- a/include/linux/phy.h
2628 +++ b/include/linux/phy.h
2629 @@ -799,6 +799,10 @@ int genphy_read_status(struct phy_device *phydev);
2630 int genphy_suspend(struct phy_device *phydev);
2631 int genphy_resume(struct phy_device *phydev);
2632 int genphy_soft_reset(struct phy_device *phydev);
2633 +static inline int genphy_no_soft_reset(struct phy_device *phydev)
2634 +{
2635 + return 0;
2636 +}
2637 void phy_driver_unregister(struct phy_driver *drv);
2638 void phy_drivers_unregister(struct phy_driver *drv, int n);
2639 int phy_driver_register(struct phy_driver *new_driver, struct module *owner);
2640 diff --git a/include/linux/pstore_ram.h b/include/linux/pstore_ram.h
2641 index c668c861c96c..4058bf991868 100644
2642 --- a/include/linux/pstore_ram.h
2643 +++ b/include/linux/pstore_ram.h
2644 @@ -24,6 +24,13 @@
2645 #include <linux/list.h>
2646 #include <linux/types.h>
2647
2648 +/*
2649 + * Choose whether access to the RAM zone requires locking or not. If a zone
2650 + * can be written to from different CPUs like with ftrace for example, then
2651 + * PRZ_FLAG_NO_LOCK is used. For all other cases, locking is required.
2652 + */
2653 +#define PRZ_FLAG_NO_LOCK BIT(0)
2654 +
2655 struct persistent_ram_buffer;
2656 struct rs_control;
2657
2658 @@ -40,6 +47,8 @@ struct persistent_ram_zone {
2659 void *vaddr;
2660 struct persistent_ram_buffer *buffer;
2661 size_t buffer_size;
2662 + u32 flags;
2663 + raw_spinlock_t buffer_lock;
2664
2665 /* ECC correction */
2666 char *par_buffer;
2667 @@ -55,7 +64,7 @@ struct persistent_ram_zone {
2668
2669 struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
2670 u32 sig, struct persistent_ram_ecc_info *ecc_info,
2671 - unsigned int memtype);
2672 + unsigned int memtype, u32 flags);
2673 void persistent_ram_free(struct persistent_ram_zone *prz);
2674 void persistent_ram_zap(struct persistent_ram_zone *prz);
2675
2676 diff --git a/kernel/cpu.c b/kernel/cpu.c
2677 index 8f52977aad59..26a4f74bff83 100644
2678 --- a/kernel/cpu.c
2679 +++ b/kernel/cpu.c
2680 @@ -410,11 +410,26 @@ static int notify_online(unsigned int cpu)
2681 return 0;
2682 }
2683
2684 +static void __cpuhp_kick_ap_work(struct cpuhp_cpu_state *st);
2685 +
2686 static int bringup_wait_for_ap(unsigned int cpu)
2687 {
2688 struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
2689
2690 + /* Wait for the CPU to reach CPUHP_AP_ONLINE_IDLE */
2691 wait_for_completion(&st->done);
2692 + if (WARN_ON_ONCE((!cpu_online(cpu))))
2693 + return -ECANCELED;
2694 +
2695 + /* Unpark the stopper thread and the hotplug thread of the target cpu */
2696 + stop_machine_unpark(cpu);
2697 + kthread_unpark(st->thread);
2698 +
2699 + /* Should we go further up ? */
2700 + if (st->target > CPUHP_AP_ONLINE_IDLE) {
2701 + __cpuhp_kick_ap_work(st);
2702 + wait_for_completion(&st->done);
2703 + }
2704 return st->result;
2705 }
2706
2707 @@ -437,9 +452,7 @@ static int bringup_cpu(unsigned int cpu)
2708 cpu_notify(CPU_UP_CANCELED, cpu);
2709 return ret;
2710 }
2711 - ret = bringup_wait_for_ap(cpu);
2712 - BUG_ON(!cpu_online(cpu));
2713 - return ret;
2714 + return bringup_wait_for_ap(cpu);
2715 }
2716
2717 /*
2718 @@ -974,31 +987,20 @@ void notify_cpu_starting(unsigned int cpu)
2719 }
2720
2721 /*
2722 - * Called from the idle task. We need to set active here, so we can kick off
2723 - * the stopper thread and unpark the smpboot threads. If the target state is
2724 - * beyond CPUHP_AP_ONLINE_IDLE we kick cpuhp thread and let it bring up the
2725 - * cpu further.
2726 + * Called from the idle task. Wake up the controlling task which brings the
2727 + * stopper and the hotplug thread of the upcoming CPU up and then delegates
2728 + * the rest of the online bringup to the hotplug thread.
2729 */
2730 void cpuhp_online_idle(enum cpuhp_state state)
2731 {
2732 struct cpuhp_cpu_state *st = this_cpu_ptr(&cpuhp_state);
2733 - unsigned int cpu = smp_processor_id();
2734
2735 /* Happens for the boot cpu */
2736 if (state != CPUHP_AP_ONLINE_IDLE)
2737 return;
2738
2739 st->state = CPUHP_AP_ONLINE_IDLE;
2740 -
2741 - /* Unpark the stopper thread and the hotplug thread of this cpu */
2742 - stop_machine_unpark(cpu);
2743 - kthread_unpark(st->thread);
2744 -
2745 - /* Should we go further up ? */
2746 - if (st->target > CPUHP_AP_ONLINE_IDLE)
2747 - __cpuhp_kick_ap_work(st);
2748 - else
2749 - complete(&st->done);
2750 + complete(&st->done);
2751 }
2752
2753 /* Requires cpu_add_remove_lock to be held */
2754 diff --git a/kernel/sched/core.c b/kernel/sched/core.c
2755 index d177b21d04ce..2098954c690f 100644
2756 --- a/kernel/sched/core.c
2757 +++ b/kernel/sched/core.c
2758 @@ -8376,11 +8376,20 @@ cpu_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
2759 if (IS_ERR(tg))
2760 return ERR_PTR(-ENOMEM);
2761
2762 - sched_online_group(tg, parent);
2763 -
2764 return &tg->css;
2765 }
2766
2767 +/* Expose task group only after completing cgroup initialization */
2768 +static int cpu_cgroup_css_online(struct cgroup_subsys_state *css)
2769 +{
2770 + struct task_group *tg = css_tg(css);
2771 + struct task_group *parent = css_tg(css->parent);
2772 +
2773 + if (parent)
2774 + sched_online_group(tg, parent);
2775 + return 0;
2776 +}
2777 +
2778 static void cpu_cgroup_css_released(struct cgroup_subsys_state *css)
2779 {
2780 struct task_group *tg = css_tg(css);
2781 @@ -8783,6 +8792,7 @@ static struct cftype cpu_files[] = {
2782
2783 struct cgroup_subsys cpu_cgrp_subsys = {
2784 .css_alloc = cpu_cgroup_css_alloc,
2785 + .css_online = cpu_cgroup_css_online,
2786 .css_released = cpu_cgroup_css_released,
2787 .css_free = cpu_cgroup_css_free,
2788 .fork = cpu_cgroup_fork,
2789 diff --git a/net/core/dev.c b/net/core/dev.c
2790 index c17952b6e0b6..0af019dfe846 100644
2791 --- a/net/core/dev.c
2792 +++ b/net/core/dev.c
2793 @@ -2702,9 +2702,10 @@ EXPORT_SYMBOL(skb_mac_gso_segment);
2794 static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path)
2795 {
2796 if (tx_path)
2797 - return skb->ip_summed != CHECKSUM_PARTIAL;
2798 - else
2799 - return skb->ip_summed == CHECKSUM_NONE;
2800 + return skb->ip_summed != CHECKSUM_PARTIAL &&
2801 + skb->ip_summed != CHECKSUM_NONE;
2802 +
2803 + return skb->ip_summed == CHECKSUM_NONE;
2804 }
2805
2806 /**
2807 @@ -2723,11 +2724,12 @@ static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path)
2808 struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
2809 netdev_features_t features, bool tx_path)
2810 {
2811 + struct sk_buff *segs;
2812 +
2813 if (unlikely(skb_needs_check(skb, tx_path))) {
2814 int err;
2815
2816 - skb_warn_bad_offload(skb);
2817 -
2818 + /* We're going to init ->check field in TCP or UDP header */
2819 err = skb_cow_head(skb, 0);
2820 if (err < 0)
2821 return ERR_PTR(err);
2822 @@ -2755,7 +2757,12 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
2823 skb_reset_mac_header(skb);
2824 skb_reset_mac_len(skb);
2825
2826 - return skb_mac_gso_segment(skb, features);
2827 + segs = skb_mac_gso_segment(skb, features);
2828 +
2829 + if (unlikely(skb_needs_check(skb, tx_path)))
2830 + skb_warn_bad_offload(skb);
2831 +
2832 + return segs;
2833 }
2834 EXPORT_SYMBOL(__skb_gso_segment);
2835
2836 diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
2837 index fd649599620e..5a4b8e7bcedd 100644
2838 --- a/net/ipv6/ip6_output.c
2839 +++ b/net/ipv6/ip6_output.c
2840 @@ -1376,7 +1376,7 @@ static int __ip6_append_data(struct sock *sk,
2841 */
2842
2843 cork->length += length;
2844 - if (((length > mtu) ||
2845 + if ((((length + fragheaderlen) > mtu) ||
2846 (skb && skb_is_gso(skb))) &&
2847 (sk->sk_protocol == IPPROTO_UDP) &&
2848 (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len &&
2849 diff --git a/net/key/af_key.c b/net/key/af_key.c
2850 index d8d95b6415e4..2e1050ec2cf0 100644
2851 --- a/net/key/af_key.c
2852 +++ b/net/key/af_key.c
2853 @@ -63,6 +63,7 @@ struct pfkey_sock {
2854 } u;
2855 struct sk_buff *skb;
2856 } dump;
2857 + struct mutex dump_lock;
2858 };
2859
2860 static int parse_sockaddr_pair(struct sockaddr *sa, int ext_len,
2861 @@ -143,6 +144,7 @@ static int pfkey_create(struct net *net, struct socket *sock, int protocol,
2862 {
2863 struct netns_pfkey *net_pfkey = net_generic(net, pfkey_net_id);
2864 struct sock *sk;
2865 + struct pfkey_sock *pfk;
2866 int err;
2867
2868 if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
2869 @@ -157,6 +159,9 @@ static int pfkey_create(struct net *net, struct socket *sock, int protocol,
2870 if (sk == NULL)
2871 goto out;
2872
2873 + pfk = pfkey_sk(sk);
2874 + mutex_init(&pfk->dump_lock);
2875 +
2876 sock->ops = &pfkey_ops;
2877 sock_init_data(sock, sk);
2878
2879 @@ -285,13 +290,23 @@ static int pfkey_do_dump(struct pfkey_sock *pfk)
2880 struct sadb_msg *hdr;
2881 int rc;
2882
2883 + mutex_lock(&pfk->dump_lock);
2884 + if (!pfk->dump.dump) {
2885 + rc = 0;
2886 + goto out;
2887 + }
2888 +
2889 rc = pfk->dump.dump(pfk);
2890 - if (rc == -ENOBUFS)
2891 - return 0;
2892 + if (rc == -ENOBUFS) {
2893 + rc = 0;
2894 + goto out;
2895 + }
2896
2897 if (pfk->dump.skb) {
2898 - if (!pfkey_can_dump(&pfk->sk))
2899 - return 0;
2900 + if (!pfkey_can_dump(&pfk->sk)) {
2901 + rc = 0;
2902 + goto out;
2903 + }
2904
2905 hdr = (struct sadb_msg *) pfk->dump.skb->data;
2906 hdr->sadb_msg_seq = 0;
2907 @@ -302,6 +317,9 @@ static int pfkey_do_dump(struct pfkey_sock *pfk)
2908 }
2909
2910 pfkey_terminate_dump(pfk);
2911 +
2912 +out:
2913 + mutex_unlock(&pfk->dump_lock);
2914 return rc;
2915 }
2916
2917 @@ -1806,19 +1824,26 @@ static int pfkey_dump(struct sock *sk, struct sk_buff *skb, const struct sadb_ms
2918 struct xfrm_address_filter *filter = NULL;
2919 struct pfkey_sock *pfk = pfkey_sk(sk);
2920
2921 - if (pfk->dump.dump != NULL)
2922 + mutex_lock(&pfk->dump_lock);
2923 + if (pfk->dump.dump != NULL) {
2924 + mutex_unlock(&pfk->dump_lock);
2925 return -EBUSY;
2926 + }
2927
2928 proto = pfkey_satype2proto(hdr->sadb_msg_satype);
2929 - if (proto == 0)
2930 + if (proto == 0) {
2931 + mutex_unlock(&pfk->dump_lock);
2932 return -EINVAL;
2933 + }
2934
2935 if (ext_hdrs[SADB_X_EXT_FILTER - 1]) {
2936 struct sadb_x_filter *xfilter = ext_hdrs[SADB_X_EXT_FILTER - 1];
2937
2938 filter = kmalloc(sizeof(*filter), GFP_KERNEL);
2939 - if (filter == NULL)
2940 + if (filter == NULL) {
2941 + mutex_unlock(&pfk->dump_lock);
2942 return -ENOMEM;
2943 + }
2944
2945 memcpy(&filter->saddr, &xfilter->sadb_x_filter_saddr,
2946 sizeof(xfrm_address_t));
2947 @@ -1834,6 +1859,7 @@ static int pfkey_dump(struct sock *sk, struct sk_buff *skb, const struct sadb_ms
2948 pfk->dump.dump = pfkey_dump_sa;
2949 pfk->dump.done = pfkey_dump_sa_done;
2950 xfrm_state_walk_init(&pfk->dump.u.state, proto, filter);
2951 + mutex_unlock(&pfk->dump_lock);
2952
2953 return pfkey_do_dump(pfk);
2954 }
2955 @@ -2693,14 +2719,18 @@ static int pfkey_spddump(struct sock *sk, struct sk_buff *skb, const struct sadb
2956 {
2957 struct pfkey_sock *pfk = pfkey_sk(sk);
2958
2959 - if (pfk->dump.dump != NULL)
2960 + mutex_lock(&pfk->dump_lock);
2961 + if (pfk->dump.dump != NULL) {
2962 + mutex_unlock(&pfk->dump_lock);
2963 return -EBUSY;
2964 + }
2965
2966 pfk->dump.msg_version = hdr->sadb_msg_version;
2967 pfk->dump.msg_portid = hdr->sadb_msg_pid;
2968 pfk->dump.dump = pfkey_dump_sp;
2969 pfk->dump.done = pfkey_dump_sp_done;
2970 xfrm_policy_walk_init(&pfk->dump.u.policy, XFRM_POLICY_TYPE_MAIN);
2971 + mutex_unlock(&pfk->dump_lock);
2972
2973 return pfkey_do_dump(pfk);
2974 }
2975 diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c
2976 index b10abef6b0a0..1d522ce833e6 100644
2977 --- a/net/l2tp/l2tp_ip6.c
2978 +++ b/net/l2tp/l2tp_ip6.c
2979 @@ -64,7 +64,7 @@ static struct sock *__l2tp_ip6_bind_lookup(struct net *net,
2980 struct sock *sk;
2981
2982 sk_for_each_bound(sk, &l2tp_ip6_bind_table) {
2983 - const struct in6_addr *addr = inet6_rcv_saddr(sk);
2984 + const struct in6_addr *sk_laddr = inet6_rcv_saddr(sk);
2985 struct l2tp_ip6_sock *l2tp = l2tp_ip6_sk(sk);
2986
2987 if (l2tp == NULL)
2988 @@ -72,7 +72,7 @@ static struct sock *__l2tp_ip6_bind_lookup(struct net *net,
2989
2990 if ((l2tp->conn_id == tunnel_id) &&
2991 net_eq(sock_net(sk), net) &&
2992 - (!addr || ipv6_addr_equal(addr, laddr)) &&
2993 + (!sk_laddr || ipv6_addr_any(sk_laddr) || ipv6_addr_equal(sk_laddr, laddr)) &&
2994 (!sk->sk_bound_dev_if || !dif ||
2995 sk->sk_bound_dev_if == dif))
2996 goto found;
2997 diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
2998 index 8da67f7c9c5a..e26b515f7794 100644
2999 --- a/net/xfrm/xfrm_policy.c
3000 +++ b/net/xfrm/xfrm_policy.c
3001 @@ -1248,7 +1248,7 @@ static inline int policy_to_flow_dir(int dir)
3002 }
3003
3004 static struct xfrm_policy *xfrm_sk_policy_lookup(const struct sock *sk, int dir,
3005 - const struct flowi *fl)
3006 + const struct flowi *fl, u16 family)
3007 {
3008 struct xfrm_policy *pol;
3009
3010 @@ -1256,8 +1256,7 @@ static struct xfrm_policy *xfrm_sk_policy_lookup(const struct sock *sk, int dir,
3011 again:
3012 pol = rcu_dereference(sk->sk_policy[dir]);
3013 if (pol != NULL) {
3014 - bool match = xfrm_selector_match(&pol->selector, fl,
3015 - sk->sk_family);
3016 + bool match = xfrm_selector_match(&pol->selector, fl, family);
3017 int err = 0;
3018
3019 if (match) {
3020 @@ -2206,7 +2205,7 @@ struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
3021 sk = sk_const_to_full_sk(sk);
3022 if (sk && sk->sk_policy[XFRM_POLICY_OUT]) {
3023 num_pols = 1;
3024 - pols[0] = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl);
3025 + pols[0] = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl, family);
3026 err = xfrm_expand_policies(fl, family, pols,
3027 &num_pols, &num_xfrms);
3028 if (err < 0)
3029 @@ -2485,7 +2484,7 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb,
3030 pol = NULL;
3031 sk = sk_to_full_sk(sk);
3032 if (sk && sk->sk_policy[dir]) {
3033 - pol = xfrm_sk_policy_lookup(sk, dir, &fl);
3034 + pol = xfrm_sk_policy_lookup(sk, dir, &fl, family);
3035 if (IS_ERR(pol)) {
3036 XFRM_INC_STATS(net, LINUX_MIB_XFRMINPOLERROR);
3037 return 0;
3038 diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
3039 index c47287d79306..a178e0d03088 100644
3040 --- a/sound/pci/fm801.c
3041 +++ b/sound/pci/fm801.c
3042 @@ -1235,8 +1235,6 @@ static int snd_fm801_create(struct snd_card *card,
3043 }
3044 }
3045
3046 - snd_fm801_chip_init(chip);
3047 -
3048 if ((chip->tea575x_tuner & TUNER_ONLY) == 0) {
3049 if (devm_request_irq(&pci->dev, pci->irq, snd_fm801_interrupt,
3050 IRQF_SHARED, KBUILD_MODNAME, chip)) {
3051 @@ -1248,6 +1246,8 @@ static int snd_fm801_create(struct snd_card *card,
3052 pci_set_master(pci);
3053 }
3054
3055 + snd_fm801_chip_init(chip);
3056 +
3057 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
3058 snd_fm801_free(chip);
3059 return err;
3060 diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
3061 index 4bf48336b0fc..775c67818bf1 100644
3062 --- a/sound/pci/hda/patch_hdmi.c
3063 +++ b/sound/pci/hda/patch_hdmi.c
3064 @@ -3600,11 +3600,15 @@ HDA_CODEC_ENTRY(0x1002aa01, "R6xx HDMI", patch_atihdmi),
3065 HDA_CODEC_ENTRY(0x10951390, "SiI1390 HDMI", patch_generic_hdmi),
3066 HDA_CODEC_ENTRY(0x10951392, "SiI1392 HDMI", patch_generic_hdmi),
3067 HDA_CODEC_ENTRY(0x17e80047, "Chrontel HDMI", patch_generic_hdmi),
3068 +HDA_CODEC_ENTRY(0x10de0001, "MCP73 HDMI", patch_nvhdmi_2ch),
3069 HDA_CODEC_ENTRY(0x10de0002, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x),
3070 HDA_CODEC_ENTRY(0x10de0003, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x),
3071 +HDA_CODEC_ENTRY(0x10de0004, "GPU 04 HDMI", patch_nvhdmi_8ch_7x),
3072 HDA_CODEC_ENTRY(0x10de0005, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x),
3073 HDA_CODEC_ENTRY(0x10de0006, "MCP77/78 HDMI", patch_nvhdmi_8ch_7x),
3074 HDA_CODEC_ENTRY(0x10de0007, "MCP79/7A HDMI", patch_nvhdmi_8ch_7x),
3075 +HDA_CODEC_ENTRY(0x10de0008, "GPU 08 HDMI/DP", patch_nvhdmi),
3076 +HDA_CODEC_ENTRY(0x10de0009, "GPU 09 HDMI/DP", patch_nvhdmi),
3077 HDA_CODEC_ENTRY(0x10de000a, "GPU 0a HDMI/DP", patch_nvhdmi),
3078 HDA_CODEC_ENTRY(0x10de000b, "GPU 0b HDMI/DP", patch_nvhdmi),
3079 HDA_CODEC_ENTRY(0x10de000c, "MCP89 HDMI", patch_nvhdmi),
3080 @@ -3631,17 +3635,40 @@ HDA_CODEC_ENTRY(0x10de0041, "GPU 41 HDMI/DP", patch_nvhdmi),
3081 HDA_CODEC_ENTRY(0x10de0042, "GPU 42 HDMI/DP", patch_nvhdmi),
3082 HDA_CODEC_ENTRY(0x10de0043, "GPU 43 HDMI/DP", patch_nvhdmi),
3083 HDA_CODEC_ENTRY(0x10de0044, "GPU 44 HDMI/DP", patch_nvhdmi),
3084 +HDA_CODEC_ENTRY(0x10de0045, "GPU 45 HDMI/DP", patch_nvhdmi),
3085 +HDA_CODEC_ENTRY(0x10de0050, "GPU 50 HDMI/DP", patch_nvhdmi),
3086 HDA_CODEC_ENTRY(0x10de0051, "GPU 51 HDMI/DP", patch_nvhdmi),
3087 +HDA_CODEC_ENTRY(0x10de0052, "GPU 52 HDMI/DP", patch_nvhdmi),
3088 HDA_CODEC_ENTRY(0x10de0060, "GPU 60 HDMI/DP", patch_nvhdmi),
3089 +HDA_CODEC_ENTRY(0x10de0061, "GPU 61 HDMI/DP", patch_nvhdmi),
3090 +HDA_CODEC_ENTRY(0x10de0062, "GPU 62 HDMI/DP", patch_nvhdmi),
3091 HDA_CODEC_ENTRY(0x10de0067, "MCP67 HDMI", patch_nvhdmi_2ch),
3092 HDA_CODEC_ENTRY(0x10de0070, "GPU 70 HDMI/DP", patch_nvhdmi),
3093 HDA_CODEC_ENTRY(0x10de0071, "GPU 71 HDMI/DP", patch_nvhdmi),
3094 HDA_CODEC_ENTRY(0x10de0072, "GPU 72 HDMI/DP", patch_nvhdmi),
3095 +HDA_CODEC_ENTRY(0x10de0073, "GPU 73 HDMI/DP", patch_nvhdmi),
3096 +HDA_CODEC_ENTRY(0x10de0074, "GPU 74 HDMI/DP", patch_nvhdmi),
3097 +HDA_CODEC_ENTRY(0x10de0076, "GPU 76 HDMI/DP", patch_nvhdmi),
3098 +HDA_CODEC_ENTRY(0x10de007b, "GPU 7b HDMI/DP", patch_nvhdmi),
3099 +HDA_CODEC_ENTRY(0x10de007c, "GPU 7c HDMI/DP", patch_nvhdmi),
3100 HDA_CODEC_ENTRY(0x10de007d, "GPU 7d HDMI/DP", patch_nvhdmi),
3101 +HDA_CODEC_ENTRY(0x10de007e, "GPU 7e HDMI/DP", patch_nvhdmi),
3102 HDA_CODEC_ENTRY(0x10de0080, "GPU 80 HDMI/DP", patch_nvhdmi),
3103 +HDA_CODEC_ENTRY(0x10de0081, "GPU 81 HDMI/DP", patch_nvhdmi),
3104 HDA_CODEC_ENTRY(0x10de0082, "GPU 82 HDMI/DP", patch_nvhdmi),
3105 HDA_CODEC_ENTRY(0x10de0083, "GPU 83 HDMI/DP", patch_nvhdmi),
3106 +HDA_CODEC_ENTRY(0x10de0084, "GPU 84 HDMI/DP", patch_nvhdmi),
3107 +HDA_CODEC_ENTRY(0x10de0090, "GPU 90 HDMI/DP", patch_nvhdmi),
3108 +HDA_CODEC_ENTRY(0x10de0091, "GPU 91 HDMI/DP", patch_nvhdmi),
3109 +HDA_CODEC_ENTRY(0x10de0092, "GPU 92 HDMI/DP", patch_nvhdmi),
3110 +HDA_CODEC_ENTRY(0x10de0093, "GPU 93 HDMI/DP", patch_nvhdmi),
3111 +HDA_CODEC_ENTRY(0x10de0094, "GPU 94 HDMI/DP", patch_nvhdmi),
3112 +HDA_CODEC_ENTRY(0x10de0095, "GPU 95 HDMI/DP", patch_nvhdmi),
3113 +HDA_CODEC_ENTRY(0x10de0097, "GPU 97 HDMI/DP", patch_nvhdmi),
3114 +HDA_CODEC_ENTRY(0x10de0098, "GPU 98 HDMI/DP", patch_nvhdmi),
3115 +HDA_CODEC_ENTRY(0x10de0099, "GPU 99 HDMI/DP", patch_nvhdmi),
3116 HDA_CODEC_ENTRY(0x10de8001, "MCP73 HDMI", patch_nvhdmi_2ch),
3117 +HDA_CODEC_ENTRY(0x10de8067, "MCP67/68 HDMI", patch_nvhdmi_2ch),
3118 HDA_CODEC_ENTRY(0x11069f80, "VX900 HDMI/DP", patch_via_hdmi),
3119 HDA_CODEC_ENTRY(0x11069f81, "VX900 HDMI/DP", patch_via_hdmi),
3120 HDA_CODEC_ENTRY(0x11069f84, "VX11 HDMI/DP", patch_generic_hdmi),
3121 diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
3122 index e643be91d762..f9f2737c4ad2 100644
3123 --- a/sound/soc/codecs/nau8825.c
3124 +++ b/sound/soc/codecs/nau8825.c
3125 @@ -1928,7 +1928,8 @@ static void nau8825_fll_apply(struct nau8825 *nau8825,
3126 NAU8825_FLL_INTEGER_MASK, fll_param->fll_int);
3127 /* FLL pre-scaler */
3128 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL4,
3129 - NAU8825_FLL_REF_DIV_MASK, fll_param->clk_ref_div);
3130 + NAU8825_FLL_REF_DIV_MASK,
3131 + fll_param->clk_ref_div << NAU8825_FLL_REF_DIV_SFT);
3132 /* select divided VCO input */
3133 regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL5,
3134 NAU8825_FLL_CLK_SW_MASK, NAU8825_FLL_CLK_SW_REF);
3135 diff --git a/sound/soc/codecs/nau8825.h b/sound/soc/codecs/nau8825.h
3136 index 1c63e2abafa9..574d6f936135 100644
3137 --- a/sound/soc/codecs/nau8825.h
3138 +++ b/sound/soc/codecs/nau8825.h
3139 @@ -129,7 +129,8 @@
3140 #define NAU8825_FLL_CLK_SRC_FS (0x3 << NAU8825_FLL_CLK_SRC_SFT)
3141
3142 /* FLL4 (0x07) */
3143 -#define NAU8825_FLL_REF_DIV_MASK (0x3 << 10)
3144 +#define NAU8825_FLL_REF_DIV_SFT 10
3145 +#define NAU8825_FLL_REF_DIV_MASK (0x3 << NAU8825_FLL_REF_DIV_SFT)
3146
3147 /* FLL5 (0x08) */
3148 #define NAU8825_FLL_PDB_DAC_EN (0x1 << 15)
3149 diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
3150 index 5a8d96ec058c..fe45a16a5142 100644
3151 --- a/sound/soc/codecs/tlv320aic3x.c
3152 +++ b/sound/soc/codecs/tlv320aic3x.c
3153 @@ -126,6 +126,16 @@ static const struct reg_default aic3x_reg[] = {
3154 { 108, 0x00 }, { 109, 0x00 },
3155 };
3156
3157 +static bool aic3x_volatile_reg(struct device *dev, unsigned int reg)
3158 +{
3159 + switch (reg) {
3160 + case AIC3X_RESET:
3161 + return true;
3162 + default:
3163 + return false;
3164 + }
3165 +}
3166 +
3167 static const struct regmap_config aic3x_regmap = {
3168 .reg_bits = 8,
3169 .val_bits = 8,
3170 @@ -133,6 +143,9 @@ static const struct regmap_config aic3x_regmap = {
3171 .max_register = DAC_ICC_ADJ,
3172 .reg_defaults = aic3x_reg,
3173 .num_reg_defaults = ARRAY_SIZE(aic3x_reg),
3174 +
3175 + .volatile_reg = aic3x_volatile_reg,
3176 +
3177 .cache_type = REGCACHE_RBTREE,
3178 };
3179
3180 diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
3181 index 50349437d961..fde08660b63b 100644
3182 --- a/sound/soc/fsl/fsl_ssi.c
3183 +++ b/sound/soc/fsl/fsl_ssi.c
3184 @@ -224,6 +224,12 @@ struct fsl_ssi_soc_data {
3185 * @dbg_stats: Debugging statistics
3186 *
3187 * @soc: SoC specific data
3188 + *
3189 + * @fifo_watermark: the FIFO watermark setting. Notifies DMA when
3190 + * there are @fifo_watermark or fewer words in TX fifo or
3191 + * @fifo_watermark or more empty words in RX fifo.
3192 + * @dma_maxburst: max number of words to transfer in one go. So far,
3193 + * this is always the same as fifo_watermark.
3194 */
3195 struct fsl_ssi_private {
3196 struct regmap *regs;
3197 @@ -263,6 +269,9 @@ struct fsl_ssi_private {
3198
3199 const struct fsl_ssi_soc_data *soc;
3200 struct device *dev;
3201 +
3202 + u32 fifo_watermark;
3203 + u32 dma_maxburst;
3204 };
3205
3206 /*
3207 @@ -1051,21 +1060,7 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev,
3208 regmap_write(regs, CCSR_SSI_SRCR, srcr);
3209 regmap_write(regs, CCSR_SSI_SCR, scr);
3210
3211 - /*
3212 - * Set the watermark for transmit FIFI 0 and receive FIFO 0. We don't
3213 - * use FIFO 1. We program the transmit water to signal a DMA transfer
3214 - * if there are only two (or fewer) elements left in the FIFO. Two
3215 - * elements equals one frame (left channel, right channel). This value,
3216 - * however, depends on the depth of the transmit buffer.
3217 - *
3218 - * We set the watermark on the same level as the DMA burstsize. For
3219 - * fiq it is probably better to use the biggest possible watermark
3220 - * size.
3221 - */
3222 - if (ssi_private->use_dma)
3223 - wm = ssi_private->fifo_depth - 2;
3224 - else
3225 - wm = ssi_private->fifo_depth;
3226 + wm = ssi_private->fifo_watermark;
3227
3228 regmap_write(regs, CCSR_SSI_SFCSR,
3229 CCSR_SSI_SFCSR_TFWM0(wm) | CCSR_SSI_SFCSR_RFWM0(wm) |
3230 @@ -1373,12 +1368,8 @@ static int fsl_ssi_imx_probe(struct platform_device *pdev,
3231 dev_dbg(&pdev->dev, "could not get baud clock: %ld\n",
3232 PTR_ERR(ssi_private->baudclk));
3233
3234 - /*
3235 - * We have burstsize be "fifo_depth - 2" to match the SSI
3236 - * watermark setting in fsl_ssi_startup().
3237 - */
3238 - ssi_private->dma_params_tx.maxburst = ssi_private->fifo_depth - 2;
3239 - ssi_private->dma_params_rx.maxburst = ssi_private->fifo_depth - 2;
3240 + ssi_private->dma_params_tx.maxburst = ssi_private->dma_maxburst;
3241 + ssi_private->dma_params_rx.maxburst = ssi_private->dma_maxburst;
3242 ssi_private->dma_params_tx.addr = ssi_private->ssi_phys + CCSR_SSI_STX0;
3243 ssi_private->dma_params_rx.addr = ssi_private->ssi_phys + CCSR_SSI_SRX0;
3244
3245 @@ -1543,6 +1534,47 @@ static int fsl_ssi_probe(struct platform_device *pdev)
3246 /* Older 8610 DTs didn't have the fifo-depth property */
3247 ssi_private->fifo_depth = 8;
3248
3249 + /*
3250 + * Set the watermark for transmit FIFO 0 and receive FIFO 0. We don't
3251 + * use FIFO 1 but set the watermark appropriately nontheless.
3252 + * We program the transmit water to signal a DMA transfer
3253 + * if there are N elements left in the FIFO. For chips with 15-deep
3254 + * FIFOs, set watermark to 8. This allows the SSI to operate at a
3255 + * high data rate without channel slipping. Behavior is unchanged
3256 + * for the older chips with a fifo depth of only 8. A value of 4
3257 + * might be appropriate for the older chips, but is left at
3258 + * fifo_depth-2 until sombody has a chance to test.
3259 + *
3260 + * We set the watermark on the same level as the DMA burstsize. For
3261 + * fiq it is probably better to use the biggest possible watermark
3262 + * size.
3263 + */
3264 + switch (ssi_private->fifo_depth) {
3265 + case 15:
3266 + /*
3267 + * 2 samples is not enough when running at high data
3268 + * rates (like 48kHz @ 16 bits/channel, 16 channels)
3269 + * 8 seems to split things evenly and leave enough time
3270 + * for the DMA to fill the FIFO before it's over/under
3271 + * run.
3272 + */
3273 + ssi_private->fifo_watermark = 8;
3274 + ssi_private->dma_maxburst = 8;
3275 + break;
3276 + case 8:
3277 + default:
3278 + /*
3279 + * maintain old behavior for older chips.
3280 + * Keeping it the same because I don't have an older
3281 + * board to test with.
3282 + * I suspect this could be changed to be something to
3283 + * leave some more space in the fifo.
3284 + */
3285 + ssi_private->fifo_watermark = ssi_private->fifo_depth - 2;
3286 + ssi_private->dma_maxburst = ssi_private->fifo_depth - 2;
3287 + break;
3288 + }
3289 +
3290 dev_set_drvdata(&pdev->dev, ssi_private);
3291
3292 if (ssi_private->soc->imx) {
3293 diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
3294 index d5873eeae1aa..bd19fad2d91b 100644
3295 --- a/sound/soc/intel/boards/bytcr_rt5640.c
3296 +++ b/sound/soc/intel/boards/bytcr_rt5640.c
3297 @@ -142,7 +142,7 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w,
3298 * for Jack detection and button press
3299 */
3300 ret = snd_soc_dai_set_sysclk(codec_dai, RT5640_SCLK_S_RCCLK,
3301 - 0,
3302 + 48000 * 512,
3303 SND_SOC_CLOCK_IN);
3304 if (!ret) {
3305 if ((byt_rt5640_quirk & BYT_RT5640_MCLK_EN) && priv->mclk)
3306 diff --git a/sound/soc/intel/skylake/skl-sst.c b/sound/soc/intel/skylake/skl-sst.c
3307 index 8fc3178bc79c..b30bd384c8d3 100644
3308 --- a/sound/soc/intel/skylake/skl-sst.c
3309 +++ b/sound/soc/intel/skylake/skl-sst.c
3310 @@ -515,6 +515,9 @@ EXPORT_SYMBOL_GPL(skl_sst_init_fw);
3311
3312 void skl_sst_dsp_cleanup(struct device *dev, struct skl_sst *ctx)
3313 {
3314 +
3315 + if (ctx->dsp->fw)
3316 + release_firmware(ctx->dsp->fw);
3317 skl_clear_module_table(ctx->dsp);
3318 skl_freeup_uuid_list(ctx);
3319 skl_ipc_free(&ctx->ipc);
3320 diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
3321 index d56a16a0f6fa..21c3ef01c438 100644
3322 --- a/sound/soc/soc-pcm.c
3323 +++ b/sound/soc/soc-pcm.c
3324 @@ -2184,9 +2184,11 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd)
3325 break;
3326 case SNDRV_PCM_TRIGGER_STOP:
3327 case SNDRV_PCM_TRIGGER_SUSPEND:
3328 - case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
3329 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP;
3330 break;
3331 + case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
3332 + fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED;
3333 + break;
3334 }
3335
3336 out:
3337 diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
3338 index c5251aaad844..b8044c6034b3 100644
3339 --- a/sound/usb/endpoint.c
3340 +++ b/sound/usb/endpoint.c
3341 @@ -384,6 +384,9 @@ static void snd_complete_urb(struct urb *urb)
3342 if (unlikely(atomic_read(&ep->chip->shutdown)))
3343 goto exit_clear;
3344
3345 + if (unlikely(!test_bit(EP_FLAG_RUNNING, &ep->flags)))
3346 + goto exit_clear;
3347 +
3348 if (usb_pipeout(ep->pipe)) {
3349 retire_outbound_urb(ep, ctx);
3350 /* can be stopped during retire callback */
3351 diff --git a/tools/lib/traceevent/plugin_sched_switch.c b/tools/lib/traceevent/plugin_sched_switch.c
3352 index f1ce60065258..ec30c2fcbac0 100644
3353 --- a/tools/lib/traceevent/plugin_sched_switch.c
3354 +++ b/tools/lib/traceevent/plugin_sched_switch.c
3355 @@ -111,7 +111,7 @@ static int sched_switch_handler(struct trace_seq *s,
3356 trace_seq_printf(s, "%lld ", val);
3357
3358 if (pevent_get_field_val(s, event, "prev_prio", record, &val, 0) == 0)
3359 - trace_seq_printf(s, "[%lld] ", val);
3360 + trace_seq_printf(s, "[%d] ", (int) val);
3361
3362 if (pevent_get_field_val(s, event, "prev_state", record, &val, 0) == 0)
3363 write_state(s, val);
3364 @@ -129,7 +129,7 @@ static int sched_switch_handler(struct trace_seq *s,
3365 trace_seq_printf(s, "%lld", val);
3366
3367 if (pevent_get_field_val(s, event, "next_prio", record, &val, 0) == 0)
3368 - trace_seq_printf(s, " [%lld]", val);
3369 + trace_seq_printf(s, " [%d]", (int) val);
3370
3371 return 0;
3372 }
3373 diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
3374 index 982d6439bb07..ef52d1e3d431 100644
3375 --- a/tools/perf/Makefile.perf
3376 +++ b/tools/perf/Makefile.perf
3377 @@ -729,9 +729,9 @@ install-tests: all install-gtk
3378 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'; \
3379 $(INSTALL) tests/attr/* '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/attr'
3380
3381 -install-bin: install-tools install-tests
3382 +install-bin: install-tools install-tests install-traceevent-plugins
3383
3384 -install: install-bin try-install-man install-traceevent-plugins
3385 +install: install-bin try-install-man
3386
3387 install-python_ext:
3388 $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
3389 diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
3390 index 7ea13f44178d..6c50d9f8e210 100644
3391 --- a/tools/perf/util/probe-event.c
3392 +++ b/tools/perf/util/probe-event.c
3393 @@ -268,21 +268,6 @@ static bool kprobe_warn_out_range(const char *symbol, unsigned long address)
3394 }
3395
3396 /*
3397 - * NOTE:
3398 - * '.gnu.linkonce.this_module' section of kernel module elf directly
3399 - * maps to 'struct module' from linux/module.h. This section contains
3400 - * actual module name which will be used by kernel after loading it.
3401 - * But, we cannot use 'struct module' here since linux/module.h is not
3402 - * exposed to user-space. Offset of 'name' has remained same from long
3403 - * time, so hardcoding it here.
3404 - */
3405 -#ifdef __LP64__
3406 -#define MOD_NAME_OFFSET 24
3407 -#else
3408 -#define MOD_NAME_OFFSET 12
3409 -#endif
3410 -
3411 -/*
3412 * @module can be module name of module file path. In case of path,
3413 * inspect elf and find out what is actual module name.
3414 * Caller has to free mod_name after using it.
3415 @@ -296,6 +281,7 @@ static char *find_module_name(const char *module)
3416 Elf_Data *data;
3417 Elf_Scn *sec;
3418 char *mod_name = NULL;
3419 + int name_offset;
3420
3421 fd = open(module, O_RDONLY);
3422 if (fd < 0)
3423 @@ -317,7 +303,21 @@ static char *find_module_name(const char *module)
3424 if (!data || !data->d_buf)
3425 goto ret_err;
3426
3427 - mod_name = strdup((char *)data->d_buf + MOD_NAME_OFFSET);
3428 + /*
3429 + * NOTE:
3430 + * '.gnu.linkonce.this_module' section of kernel module elf directly
3431 + * maps to 'struct module' from linux/module.h. This section contains
3432 + * actual module name which will be used by kernel after loading it.
3433 + * But, we cannot use 'struct module' here since linux/module.h is not
3434 + * exposed to user-space. Offset of 'name' has remained same from long
3435 + * time, so hardcoding it here.
3436 + */
3437 + if (ehdr.e_ident[EI_CLASS] == ELFCLASS32)
3438 + name_offset = 12;
3439 + else /* expect ELFCLASS64 by default */
3440 + name_offset = 24;
3441 +
3442 + mod_name = strdup((char *)data->d_buf + name_offset);
3443
3444 ret_err:
3445 elf_end(elf);
3446 diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
3447 index 99400b0e8f2a..adbc6c02c3aa 100644
3448 --- a/tools/perf/util/symbol-elf.c
3449 +++ b/tools/perf/util/symbol-elf.c
3450 @@ -537,6 +537,12 @@ int sysfs__read_build_id(const char *filename, void *build_id, size_t size)
3451 break;
3452 } else {
3453 int n = namesz + descsz;
3454 +
3455 + if (n > (int)sizeof(bf)) {
3456 + n = sizeof(bf);
3457 + pr_debug("%s: truncating reading of build id in sysfs file %s: n_namesz=%u, n_descsz=%u.\n",
3458 + __func__, filename, nhdr.n_namesz, nhdr.n_descsz);
3459 + }
3460 if (read(fd, bf, n) != n)
3461 break;
3462 }