Contents of /trunk/kernel-alx-legacy/patches-4.9/0319-4.9.220-all-fixes.patch
Parent Directory | Revision Log
Revision 3608 -
(show annotations)
(download)
Fri Aug 14 07:34:29 2020 UTC (4 years, 1 month ago) by niro
File size: 111270 byte(s)
Fri Aug 14 07:34:29 2020 UTC (4 years, 1 month ago) by niro
File size: 111270 byte(s)
-added kerenl-alx-legacy pkg
1 | diff --git a/Makefile b/Makefile |
2 | index 26ad7b28a193..e7866bc2d817 100644 |
3 | --- a/Makefile |
4 | +++ b/Makefile |
5 | @@ -1,6 +1,6 @@ |
6 | VERSION = 4 |
7 | PATCHLEVEL = 9 |
8 | -SUBLEVEL = 219 |
9 | +SUBLEVEL = 220 |
10 | EXTRAVERSION = |
11 | NAME = Roaring Lionus |
12 | |
13 | diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c |
14 | index c0ede237c14b..49989207989a 100644 |
15 | --- a/arch/arm64/kernel/armv8_deprecated.c |
16 | +++ b/arch/arm64/kernel/armv8_deprecated.c |
17 | @@ -604,7 +604,7 @@ static struct undef_hook setend_hooks[] = { |
18 | }, |
19 | { |
20 | /* Thumb mode */ |
21 | - .instr_mask = 0x0000fff7, |
22 | + .instr_mask = 0xfffffff7, |
23 | .instr_val = 0x0000b650, |
24 | .pstate_mask = (COMPAT_PSR_T_BIT | COMPAT_PSR_MODE_MASK), |
25 | .pstate_val = (COMPAT_PSR_T_BIT | COMPAT_PSR_MODE_USR), |
26 | diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c |
27 | index 930e74d9fcbd..3b680a32886b 100644 |
28 | --- a/arch/arm64/kernel/cpu_errata.c |
29 | +++ b/arch/arm64/kernel/cpu_errata.c |
30 | @@ -16,6 +16,8 @@ |
31 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
32 | */ |
33 | |
34 | +#include <linux/arm-smccc.h> |
35 | +#include <linux/psci.h> |
36 | #include <linux/types.h> |
37 | #include <asm/cachetype.h> |
38 | #include <asm/cpu.h> |
39 | diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c |
40 | index 6420c83c29d1..ff5fc917ef95 100644 |
41 | --- a/arch/mips/cavium-octeon/octeon-irq.c |
42 | +++ b/arch/mips/cavium-octeon/octeon-irq.c |
43 | @@ -2199,6 +2199,9 @@ static int octeon_irq_cib_map(struct irq_domain *d, |
44 | } |
45 | |
46 | cd = kzalloc(sizeof(*cd), GFP_KERNEL); |
47 | + if (!cd) |
48 | + return -ENOMEM; |
49 | + |
50 | cd->host_data = host_data; |
51 | cd->bit = hw; |
52 | |
53 | diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c |
54 | index f4c46b0ec611..aa6cc2bfa69d 100644 |
55 | --- a/arch/powerpc/kernel/signal_64.c |
56 | +++ b/arch/powerpc/kernel/signal_64.c |
57 | @@ -469,8 +469,10 @@ static long restore_tm_sigcontexts(struct task_struct *tsk, |
58 | err |= __get_user(tsk->thread.ckpt_regs.ccr, |
59 | &sc->gp_regs[PT_CCR]); |
60 | |
61 | + /* Don't allow userspace to set the trap value */ |
62 | + regs->trap = 0; |
63 | + |
64 | /* These regs are not checkpointed; they can go in 'regs'. */ |
65 | - err |= __get_user(regs->trap, &sc->gp_regs[PT_TRAP]); |
66 | err |= __get_user(regs->dar, &sc->gp_regs[PT_DAR]); |
67 | err |= __get_user(regs->dsisr, &sc->gp_regs[PT_DSISR]); |
68 | err |= __get_user(regs->result, &sc->gp_regs[PT_RESULT]); |
69 | diff --git a/arch/powerpc/mm/tlb_nohash_low.S b/arch/powerpc/mm/tlb_nohash_low.S |
70 | index eabecfcaef7c..204b4d9c4424 100644 |
71 | --- a/arch/powerpc/mm/tlb_nohash_low.S |
72 | +++ b/arch/powerpc/mm/tlb_nohash_low.S |
73 | @@ -400,7 +400,7 @@ _GLOBAL(set_context) |
74 | * extern void loadcam_entry(unsigned int index) |
75 | * |
76 | * Load TLBCAM[index] entry in to the L2 CAM MMU |
77 | - * Must preserve r7, r8, r9, and r10 |
78 | + * Must preserve r7, r8, r9, r10 and r11 |
79 | */ |
80 | _GLOBAL(loadcam_entry) |
81 | mflr r5 |
82 | @@ -436,6 +436,10 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS) |
83 | */ |
84 | _GLOBAL(loadcam_multi) |
85 | mflr r8 |
86 | + /* Don't switch to AS=1 if already there */ |
87 | + mfmsr r11 |
88 | + andi. r11,r11,MSR_IS |
89 | + bne 10f |
90 | |
91 | /* |
92 | * Set up temporary TLB entry that is the same as what we're |
93 | @@ -461,6 +465,7 @@ _GLOBAL(loadcam_multi) |
94 | mtmsr r6 |
95 | isync |
96 | |
97 | +10: |
98 | mr r9,r3 |
99 | add r10,r3,r4 |
100 | 2: bl loadcam_entry |
101 | @@ -469,6 +474,10 @@ _GLOBAL(loadcam_multi) |
102 | mr r3,r9 |
103 | blt 2b |
104 | |
105 | + /* Don't return to AS=0 if we were in AS=1 at function start */ |
106 | + andi. r11,r11,MSR_IS |
107 | + bne 3f |
108 | + |
109 | /* Return to AS=0 and clear the temporary entry */ |
110 | mfmsr r6 |
111 | rlwinm. r6,r6,0,~(MSR_IS|MSR_DS) |
112 | @@ -484,6 +493,7 @@ _GLOBAL(loadcam_multi) |
113 | tlbwe |
114 | isync |
115 | |
116 | +3: |
117 | mtlr r8 |
118 | blr |
119 | #endif |
120 | diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c |
121 | index b7f937563827..d1fee2d35b49 100644 |
122 | --- a/arch/powerpc/platforms/maple/setup.c |
123 | +++ b/arch/powerpc/platforms/maple/setup.c |
124 | @@ -299,23 +299,6 @@ static int __init maple_probe(void) |
125 | return 1; |
126 | } |
127 | |
128 | -define_machine(maple) { |
129 | - .name = "Maple", |
130 | - .probe = maple_probe, |
131 | - .setup_arch = maple_setup_arch, |
132 | - .init_IRQ = maple_init_IRQ, |
133 | - .pci_irq_fixup = maple_pci_irq_fixup, |
134 | - .pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq, |
135 | - .restart = maple_restart, |
136 | - .halt = maple_halt, |
137 | - .get_boot_time = maple_get_boot_time, |
138 | - .set_rtc_time = maple_set_rtc_time, |
139 | - .get_rtc_time = maple_get_rtc_time, |
140 | - .calibrate_decr = generic_calibrate_decr, |
141 | - .progress = maple_progress, |
142 | - .power_save = power4_idle, |
143 | -}; |
144 | - |
145 | #ifdef CONFIG_EDAC |
146 | /* |
147 | * Register a platform device for CPC925 memory controller on |
148 | @@ -372,3 +355,20 @@ static int __init maple_cpc925_edac_setup(void) |
149 | } |
150 | machine_device_initcall(maple, maple_cpc925_edac_setup); |
151 | #endif |
152 | + |
153 | +define_machine(maple) { |
154 | + .name = "Maple", |
155 | + .probe = maple_probe, |
156 | + .setup_arch = maple_setup_arch, |
157 | + .init_IRQ = maple_init_IRQ, |
158 | + .pci_irq_fixup = maple_pci_irq_fixup, |
159 | + .pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq, |
160 | + .restart = maple_restart, |
161 | + .halt = maple_halt, |
162 | + .get_boot_time = maple_get_boot_time, |
163 | + .set_rtc_time = maple_set_rtc_time, |
164 | + .get_rtc_time = maple_get_rtc_time, |
165 | + .calibrate_decr = generic_calibrate_decr, |
166 | + .progress = maple_progress, |
167 | + .power_save = power4_idle, |
168 | +}; |
169 | diff --git a/arch/s390/kernel/diag.c b/arch/s390/kernel/diag.c |
170 | index a97354c8c667..7171fb98533f 100644 |
171 | --- a/arch/s390/kernel/diag.c |
172 | +++ b/arch/s390/kernel/diag.c |
173 | @@ -76,7 +76,7 @@ static int show_diag_stat(struct seq_file *m, void *v) |
174 | |
175 | static void *show_diag_stat_start(struct seq_file *m, loff_t *pos) |
176 | { |
177 | - return *pos <= nr_cpu_ids ? (void *)((unsigned long) *pos + 1) : NULL; |
178 | + return *pos <= NR_DIAG_STAT ? (void *)((unsigned long) *pos + 1) : NULL; |
179 | } |
180 | |
181 | static void *show_diag_stat_next(struct seq_file *m, void *v, loff_t *pos) |
182 | diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c |
183 | index d856263fd768..737e22cf0972 100644 |
184 | --- a/arch/s390/kernel/processor.c |
185 | +++ b/arch/s390/kernel/processor.c |
186 | @@ -139,8 +139,9 @@ static void show_cpu_mhz(struct seq_file *m, unsigned long n) |
187 | static int show_cpuinfo(struct seq_file *m, void *v) |
188 | { |
189 | unsigned long n = (unsigned long) v - 1; |
190 | + unsigned long first = cpumask_first(cpu_online_mask); |
191 | |
192 | - if (!n) |
193 | + if (n == first) |
194 | show_cpu_summary(m, v); |
195 | if (!machine_has_cpu_mhz) |
196 | return 0; |
197 | @@ -153,6 +154,8 @@ static inline void *c_update(loff_t *pos) |
198 | { |
199 | if (*pos) |
200 | *pos = cpumask_next(*pos - 1, cpu_online_mask); |
201 | + else |
202 | + *pos = cpumask_first(cpu_online_mask); |
203 | return *pos < nr_cpu_ids ? (void *)*pos + 1 : NULL; |
204 | } |
205 | |
206 | diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c |
207 | index da246d95b87c..d3f046eca7db 100644 |
208 | --- a/arch/s390/kvm/vsie.c |
209 | +++ b/arch/s390/kvm/vsie.c |
210 | @@ -947,6 +947,7 @@ static int vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) |
211 | scb_s->iprcc = PGM_ADDRESSING; |
212 | scb_s->pgmilc = 4; |
213 | scb_s->gpsw.addr = __rewind_psw(scb_s->gpsw, 4); |
214 | + rc = 1; |
215 | } |
216 | return rc; |
217 | } |
218 | diff --git a/arch/s390/mm/gmap.c b/arch/s390/mm/gmap.c |
219 | index b6c85b760305..0195c3983f54 100644 |
220 | --- a/arch/s390/mm/gmap.c |
221 | +++ b/arch/s390/mm/gmap.c |
222 | @@ -759,14 +759,18 @@ static void gmap_call_notifier(struct gmap *gmap, unsigned long start, |
223 | static inline unsigned long *gmap_table_walk(struct gmap *gmap, |
224 | unsigned long gaddr, int level) |
225 | { |
226 | + const int asce_type = gmap->asce & _ASCE_TYPE_MASK; |
227 | unsigned long *table; |
228 | |
229 | if ((gmap->asce & _ASCE_TYPE_MASK) + 4 < (level * 4)) |
230 | return NULL; |
231 | if (gmap_is_shadow(gmap) && gmap->removed) |
232 | return NULL; |
233 | - if (gaddr & (-1UL << (31 + ((gmap->asce & _ASCE_TYPE_MASK) >> 2)*11))) |
234 | + |
235 | + if (asce_type != _ASCE_TYPE_REGION1 && |
236 | + gaddr & (-1UL << (31 + (asce_type >> 2) * 11))) |
237 | return NULL; |
238 | + |
239 | table = gmap->table; |
240 | switch (gmap->asce & _ASCE_TYPE_MASK) { |
241 | case _ASCE_TYPE_REGION1: |
242 | @@ -1680,6 +1684,7 @@ int gmap_shadow_r3t(struct gmap *sg, unsigned long saddr, unsigned long r3t, |
243 | goto out_free; |
244 | } else if (*table & _REGION_ENTRY_ORIGIN) { |
245 | rc = -EAGAIN; /* Race with shadow */ |
246 | + goto out_free; |
247 | } |
248 | crst_table_init(s_r3t, _REGION3_ENTRY_EMPTY); |
249 | /* mark as invalid as long as the parent table is not protected */ |
250 | diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S |
251 | index fd0b6a272dd5..7532f6f53677 100644 |
252 | --- a/arch/x86/boot/compressed/head_32.S |
253 | +++ b/arch/x86/boot/compressed/head_32.S |
254 | @@ -170,7 +170,7 @@ preferred_addr: |
255 | notl %eax |
256 | andl %eax, %ebx |
257 | cmpl $LOAD_PHYSICAL_ADDR, %ebx |
258 | - jge 1f |
259 | + jae 1f |
260 | #endif |
261 | movl $LOAD_PHYSICAL_ADDR, %ebx |
262 | 1: |
263 | diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S |
264 | index 9e3a183561a9..3fac2d133e4e 100644 |
265 | --- a/arch/x86/boot/compressed/head_64.S |
266 | +++ b/arch/x86/boot/compressed/head_64.S |
267 | @@ -104,7 +104,7 @@ ENTRY(startup_32) |
268 | notl %eax |
269 | andl %eax, %ebx |
270 | cmpl $LOAD_PHYSICAL_ADDR, %ebx |
271 | - jge 1f |
272 | + jae 1f |
273 | #endif |
274 | movl $LOAD_PHYSICAL_ADDR, %ebx |
275 | 1: |
276 | @@ -339,7 +339,7 @@ preferred_addr: |
277 | notq %rax |
278 | andq %rax, %rbp |
279 | cmpq $LOAD_PHYSICAL_ADDR, %rbp |
280 | - jge 1f |
281 | + jae 1f |
282 | #endif |
283 | movq $LOAD_PHYSICAL_ADDR, %rbp |
284 | 1: |
285 | diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S |
286 | index 1cf16760f5e3..4d980d11e2d1 100644 |
287 | --- a/arch/x86/entry/entry_32.S |
288 | +++ b/arch/x86/entry/entry_32.S |
289 | @@ -1195,6 +1195,7 @@ ENTRY(int3) |
290 | END(int3) |
291 | |
292 | ENTRY(general_protection) |
293 | + ASM_CLAC |
294 | pushl $do_general_protection |
295 | jmp error_code |
296 | END(general_protection) |
297 | diff --git a/arch/x86/include/asm/microcode_intel.h b/arch/x86/include/asm/microcode_intel.h |
298 | index a61ec81b27db..c8e472e2c896 100644 |
299 | --- a/arch/x86/include/asm/microcode_intel.h |
300 | +++ b/arch/x86/include/asm/microcode_intel.h |
301 | @@ -59,7 +59,7 @@ static inline u32 intel_get_microcode_revision(void) |
302 | native_wrmsrl(MSR_IA32_UCODE_REV, 0); |
303 | |
304 | /* As documented in the SDM: Do a CPUID 1 here */ |
305 | - sync_core(); |
306 | + native_cpuid_eax(1); |
307 | |
308 | /* get the current revision from MSR 0x8B */ |
309 | native_rdmsr(MSR_IA32_UCODE_REV, dummy, rev); |
310 | diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h |
311 | index 92703fa09c19..7aa9a9bd9d98 100644 |
312 | --- a/arch/x86/include/asm/processor.h |
313 | +++ b/arch/x86/include/asm/processor.h |
314 | @@ -213,6 +213,24 @@ static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, |
315 | : "memory"); |
316 | } |
317 | |
318 | +#define native_cpuid_reg(reg) \ |
319 | +static inline unsigned int native_cpuid_##reg(unsigned int op) \ |
320 | +{ \ |
321 | + unsigned int eax = op, ebx, ecx = 0, edx; \ |
322 | + \ |
323 | + native_cpuid(&eax, &ebx, &ecx, &edx); \ |
324 | + \ |
325 | + return reg; \ |
326 | +} |
327 | + |
328 | +/* |
329 | + * Native CPUID functions returning a single datum. |
330 | + */ |
331 | +native_cpuid_reg(eax) |
332 | +native_cpuid_reg(ebx) |
333 | +native_cpuid_reg(ecx) |
334 | +native_cpuid_reg(edx) |
335 | + |
336 | static inline void load_cr3(pgd_t *pgdir) |
337 | { |
338 | write_cr3(__pa(pgdir)); |
339 | diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h |
340 | index 3a01996db58f..59e78c3d3dd8 100644 |
341 | --- a/arch/x86/include/asm/vgtod.h |
342 | +++ b/arch/x86/include/asm/vgtod.h |
343 | @@ -92,7 +92,7 @@ static inline unsigned int __getcpu(void) |
344 | * |
345 | * If RDPID is available, use it. |
346 | */ |
347 | - alternative_io ("lsl %[p],%[seg]", |
348 | + alternative_io ("lsl %[seg],%[p]", |
349 | ".byte 0xf3,0x0f,0xc7,0xf8", /* RDPID %eax/rax */ |
350 | X86_FEATURE_RDPID, |
351 | [p] "=a" (p), [seg] "r" (__PER_CPU_SEG)); |
352 | diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c |
353 | index 0a1e8a67cc99..c3fba8b52753 100644 |
354 | --- a/arch/x86/kernel/acpi/boot.c |
355 | +++ b/arch/x86/kernel/acpi/boot.c |
356 | @@ -1717,7 +1717,7 @@ int __acpi_acquire_global_lock(unsigned int *lock) |
357 | new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); |
358 | val = cmpxchg(lock, old, new); |
359 | } while (unlikely (val != old)); |
360 | - return (new < 3) ? -1 : 0; |
361 | + return ((new & 0x3) < 3) ? -1 : 0; |
362 | } |
363 | |
364 | int __acpi_release_global_lock(unsigned int *lock) |
365 | diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c |
366 | index c57dab0884fe..63c3ff9e74d4 100644 |
367 | --- a/arch/x86/kvm/cpuid.c |
368 | +++ b/arch/x86/kvm/cpuid.c |
369 | @@ -479,7 +479,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, |
370 | entry->edx |= F(SPEC_CTRL); |
371 | if (boot_cpu_has(X86_FEATURE_STIBP)) |
372 | entry->edx |= F(INTEL_STIBP); |
373 | - if (boot_cpu_has(X86_FEATURE_SSBD)) |
374 | + if (boot_cpu_has(X86_FEATURE_SPEC_CTRL_SSBD) || |
375 | + boot_cpu_has(X86_FEATURE_AMD_SSBD)) |
376 | entry->edx |= F(SPEC_CTRL_SSBD); |
377 | /* |
378 | * We emulate ARCH_CAPABILITIES in software even |
379 | diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c |
380 | index 1fa4545c55e3..2ad59d8553a5 100644 |
381 | --- a/arch/x86/kvm/vmx.c |
382 | +++ b/arch/x86/kvm/vmx.c |
383 | @@ -1619,43 +1619,15 @@ static void vmcs_load(struct vmcs *vmcs) |
384 | } |
385 | |
386 | #ifdef CONFIG_KEXEC_CORE |
387 | -/* |
388 | - * This bitmap is used to indicate whether the vmclear |
389 | - * operation is enabled on all cpus. All disabled by |
390 | - * default. |
391 | - */ |
392 | -static cpumask_t crash_vmclear_enabled_bitmap = CPU_MASK_NONE; |
393 | - |
394 | -static inline void crash_enable_local_vmclear(int cpu) |
395 | -{ |
396 | - cpumask_set_cpu(cpu, &crash_vmclear_enabled_bitmap); |
397 | -} |
398 | - |
399 | -static inline void crash_disable_local_vmclear(int cpu) |
400 | -{ |
401 | - cpumask_clear_cpu(cpu, &crash_vmclear_enabled_bitmap); |
402 | -} |
403 | - |
404 | -static inline int crash_local_vmclear_enabled(int cpu) |
405 | -{ |
406 | - return cpumask_test_cpu(cpu, &crash_vmclear_enabled_bitmap); |
407 | -} |
408 | - |
409 | static void crash_vmclear_local_loaded_vmcss(void) |
410 | { |
411 | int cpu = raw_smp_processor_id(); |
412 | struct loaded_vmcs *v; |
413 | |
414 | - if (!crash_local_vmclear_enabled(cpu)) |
415 | - return; |
416 | - |
417 | list_for_each_entry(v, &per_cpu(loaded_vmcss_on_cpu, cpu), |
418 | loaded_vmcss_on_cpu_link) |
419 | vmcs_clear(v->vmcs); |
420 | } |
421 | -#else |
422 | -static inline void crash_enable_local_vmclear(int cpu) { } |
423 | -static inline void crash_disable_local_vmclear(int cpu) { } |
424 | #endif /* CONFIG_KEXEC_CORE */ |
425 | |
426 | static void __loaded_vmcs_clear(void *arg) |
427 | @@ -1667,19 +1639,24 @@ static void __loaded_vmcs_clear(void *arg) |
428 | return; /* vcpu migration can race with cpu offline */ |
429 | if (per_cpu(current_vmcs, cpu) == loaded_vmcs->vmcs) |
430 | per_cpu(current_vmcs, cpu) = NULL; |
431 | - crash_disable_local_vmclear(cpu); |
432 | + |
433 | + vmcs_clear(loaded_vmcs->vmcs); |
434 | + if (loaded_vmcs->shadow_vmcs && loaded_vmcs->launched) |
435 | + vmcs_clear(loaded_vmcs->shadow_vmcs); |
436 | + |
437 | list_del(&loaded_vmcs->loaded_vmcss_on_cpu_link); |
438 | |
439 | /* |
440 | - * we should ensure updating loaded_vmcs->loaded_vmcss_on_cpu_link |
441 | - * is before setting loaded_vmcs->vcpu to -1 which is done in |
442 | - * loaded_vmcs_init. Otherwise, other cpu can see vcpu = -1 fist |
443 | - * then adds the vmcs into percpu list before it is deleted. |
444 | + * Ensure all writes to loaded_vmcs, including deleting it from its |
445 | + * current percpu list, complete before setting loaded_vmcs->vcpu to |
446 | + * -1, otherwise a different cpu can see vcpu == -1 first and add |
447 | + * loaded_vmcs to its percpu list before it's deleted from this cpu's |
448 | + * list. Pairs with the smp_rmb() in vmx_vcpu_load_vmcs(). |
449 | */ |
450 | smp_wmb(); |
451 | |
452 | - loaded_vmcs_init(loaded_vmcs); |
453 | - crash_enable_local_vmclear(cpu); |
454 | + loaded_vmcs->cpu = -1; |
455 | + loaded_vmcs->launched = 0; |
456 | } |
457 | |
458 | static void loaded_vmcs_clear(struct loaded_vmcs *loaded_vmcs) |
459 | @@ -2471,18 +2448,17 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) |
460 | |
461 | if (!already_loaded) { |
462 | local_irq_disable(); |
463 | - crash_disable_local_vmclear(cpu); |
464 | |
465 | /* |
466 | - * Read loaded_vmcs->cpu should be before fetching |
467 | - * loaded_vmcs->loaded_vmcss_on_cpu_link. |
468 | - * See the comments in __loaded_vmcs_clear(). |
469 | + * Ensure loaded_vmcs->cpu is read before adding loaded_vmcs to |
470 | + * this cpu's percpu list, otherwise it may not yet be deleted |
471 | + * from its previous cpu's percpu list. Pairs with the |
472 | + * smb_wmb() in __loaded_vmcs_clear(). |
473 | */ |
474 | smp_rmb(); |
475 | |
476 | list_add(&vmx->loaded_vmcs->loaded_vmcss_on_cpu_link, |
477 | &per_cpu(loaded_vmcss_on_cpu, cpu)); |
478 | - crash_enable_local_vmclear(cpu); |
479 | local_irq_enable(); |
480 | } |
481 | |
482 | @@ -3506,21 +3482,6 @@ static int hardware_enable(void) |
483 | if (cr4_read_shadow() & X86_CR4_VMXE) |
484 | return -EBUSY; |
485 | |
486 | - INIT_LIST_HEAD(&per_cpu(loaded_vmcss_on_cpu, cpu)); |
487 | - INIT_LIST_HEAD(&per_cpu(blocked_vcpu_on_cpu, cpu)); |
488 | - spin_lock_init(&per_cpu(blocked_vcpu_on_cpu_lock, cpu)); |
489 | - |
490 | - /* |
491 | - * Now we can enable the vmclear operation in kdump |
492 | - * since the loaded_vmcss_on_cpu list on this cpu |
493 | - * has been initialized. |
494 | - * |
495 | - * Though the cpu is not in VMX operation now, there |
496 | - * is no problem to enable the vmclear operation |
497 | - * for the loaded_vmcss_on_cpu list is empty! |
498 | - */ |
499 | - crash_enable_local_vmclear(cpu); |
500 | - |
501 | rdmsrl(MSR_IA32_FEATURE_CONTROL, old); |
502 | |
503 | test_bits = FEATURE_CONTROL_LOCKED; |
504 | @@ -11895,7 +11856,7 @@ module_exit(vmx_exit) |
505 | |
506 | static int __init vmx_init(void) |
507 | { |
508 | - int r; |
509 | + int r, cpu; |
510 | |
511 | r = kvm_init(&vmx_x86_ops, sizeof(struct vcpu_vmx), |
512 | __alignof__(struct vcpu_vmx), THIS_MODULE); |
513 | @@ -11917,6 +11878,12 @@ static int __init vmx_init(void) |
514 | } |
515 | } |
516 | |
517 | + for_each_possible_cpu(cpu) { |
518 | + INIT_LIST_HEAD(&per_cpu(loaded_vmcss_on_cpu, cpu)); |
519 | + INIT_LIST_HEAD(&per_cpu(blocked_vcpu_on_cpu, cpu)); |
520 | + spin_lock_init(&per_cpu(blocked_vcpu_on_cpu_lock, cpu)); |
521 | + } |
522 | + |
523 | #ifdef CONFIG_KEXEC_CORE |
524 | rcu_assign_pointer(crash_vmclear_loaded_vmcss, |
525 | crash_vmclear_local_loaded_vmcss); |
526 | diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c |
527 | index 43aabd72019b..314eb954bdee 100644 |
528 | --- a/arch/x86/kvm/x86.c |
529 | +++ b/arch/x86/kvm/x86.c |
530 | @@ -8319,6 +8319,13 @@ int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot, |
531 | { |
532 | int i; |
533 | |
534 | + /* |
535 | + * Clear out the previous array pointers for the KVM_MR_MOVE case. The |
536 | + * old arrays will be freed by __kvm_set_memory_region() if installing |
537 | + * the new memslot is successful. |
538 | + */ |
539 | + memset(&slot->arch, 0, sizeof(slot->arch)); |
540 | + |
541 | for (i = 0; i < KVM_NR_PAGE_SIZES; ++i) { |
542 | struct kvm_lpage_info *linfo; |
543 | unsigned long ugfn; |
544 | @@ -8392,6 +8399,10 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, |
545 | const struct kvm_userspace_memory_region *mem, |
546 | enum kvm_mr_change change) |
547 | { |
548 | + if (change == KVM_MR_MOVE) |
549 | + return kvm_arch_create_memslot(kvm, memslot, |
550 | + mem->memory_size >> PAGE_SHIFT); |
551 | + |
552 | return 0; |
553 | } |
554 | |
555 | diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c |
556 | index 85aa76116a30..7924d0635718 100644 |
557 | --- a/drivers/ata/libata-pmp.c |
558 | +++ b/drivers/ata/libata-pmp.c |
559 | @@ -764,6 +764,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap, |
560 | |
561 | if (dev->flags & ATA_DFLAG_DETACH) { |
562 | detach = 1; |
563 | + rc = -ENODEV; |
564 | goto fail; |
565 | } |
566 | |
567 | diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c |
568 | index f5eb102a2cf7..c4f2b563c9f0 100644 |
569 | --- a/drivers/ata/libata-scsi.c |
570 | +++ b/drivers/ata/libata-scsi.c |
571 | @@ -4444,22 +4444,19 @@ int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht) |
572 | */ |
573 | shost->max_host_blocked = 1; |
574 | |
575 | - rc = scsi_add_host_with_dma(ap->scsi_host, |
576 | - &ap->tdev, ap->host->dev); |
577 | + rc = scsi_add_host_with_dma(shost, &ap->tdev, ap->host->dev); |
578 | if (rc) |
579 | - goto err_add; |
580 | + goto err_alloc; |
581 | } |
582 | |
583 | return 0; |
584 | |
585 | - err_add: |
586 | - scsi_host_put(host->ports[i]->scsi_host); |
587 | err_alloc: |
588 | while (--i >= 0) { |
589 | struct Scsi_Host *shost = host->ports[i]->scsi_host; |
590 | |
591 | + /* scsi_host_put() is in ata_devres_release() */ |
592 | scsi_remove_host(shost); |
593 | - scsi_host_put(shost); |
594 | } |
595 | return rc; |
596 | } |
597 | diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c |
598 | index 2051d926e303..4f3d988210b0 100644 |
599 | --- a/drivers/bus/sunxi-rsb.c |
600 | +++ b/drivers/bus/sunxi-rsb.c |
601 | @@ -345,7 +345,7 @@ static int sunxi_rsb_read(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr, |
602 | if (ret) |
603 | goto unlock; |
604 | |
605 | - *buf = readl(rsb->regs + RSB_DATA); |
606 | + *buf = readl(rsb->regs + RSB_DATA) & GENMASK(len * 8 - 1, 0); |
607 | |
608 | unlock: |
609 | mutex_unlock(&rsb->lock); |
610 | diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c |
611 | index 5d509ccf1299..74044b52d2c6 100644 |
612 | --- a/drivers/char/ipmi/ipmi_msghandler.c |
613 | +++ b/drivers/char/ipmi/ipmi_msghandler.c |
614 | @@ -2646,7 +2646,9 @@ get_guid(ipmi_smi_t intf) |
615 | if (rv) |
616 | /* Send failed, no GUID available. */ |
617 | intf->bmc->guid_set = 0; |
618 | - wait_event(intf->waitq, intf->bmc->guid_set != 2); |
619 | + else |
620 | + wait_event(intf->waitq, intf->bmc->guid_set != 2); |
621 | + |
622 | intf->null_user_handler = NULL; |
623 | } |
624 | |
625 | diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c |
626 | index 791770a563fc..6fac6383d024 100644 |
627 | --- a/drivers/clk/at91/clk-usb.c |
628 | +++ b/drivers/clk/at91/clk-usb.c |
629 | @@ -78,6 +78,9 @@ static int at91sam9x5_clk_usb_determine_rate(struct clk_hw *hw, |
630 | tmp_parent_rate = req->rate * div; |
631 | tmp_parent_rate = clk_hw_round_rate(parent, |
632 | tmp_parent_rate); |
633 | + if (!tmp_parent_rate) |
634 | + continue; |
635 | + |
636 | tmp_rate = DIV_ROUND_CLOSEST(tmp_parent_rate, div); |
637 | if (tmp_rate < req->rate) |
638 | tmp_diff = req->rate - tmp_rate; |
639 | diff --git a/drivers/clk/tegra/clk-tegra-pmc.c b/drivers/clk/tegra/clk-tegra-pmc.c |
640 | index 91377abfefa1..17a04300f93b 100644 |
641 | --- a/drivers/clk/tegra/clk-tegra-pmc.c |
642 | +++ b/drivers/clk/tegra/clk-tegra-pmc.c |
643 | @@ -60,16 +60,16 @@ struct pmc_clk_init_data { |
644 | |
645 | static DEFINE_SPINLOCK(clk_out_lock); |
646 | |
647 | -static const char *clk_out1_parents[] = { "clk_m", "clk_m_div2", |
648 | - "clk_m_div4", "extern1", |
649 | +static const char *clk_out1_parents[] = { "osc", "osc_div2", |
650 | + "osc_div4", "extern1", |
651 | }; |
652 | |
653 | -static const char *clk_out2_parents[] = { "clk_m", "clk_m_div2", |
654 | - "clk_m_div4", "extern2", |
655 | +static const char *clk_out2_parents[] = { "osc", "osc_div2", |
656 | + "osc_div4", "extern2", |
657 | }; |
658 | |
659 | -static const char *clk_out3_parents[] = { "clk_m", "clk_m_div2", |
660 | - "clk_m_div4", "extern3", |
661 | +static const char *clk_out3_parents[] = { "osc", "osc_div2", |
662 | + "osc_div4", "extern3", |
663 | }; |
664 | |
665 | static struct pmc_clk_init_data pmc_clks[] = { |
666 | diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c |
667 | index a1d7fa48229d..b4fc65512aad 100644 |
668 | --- a/drivers/cpufreq/powernv-cpufreq.c |
669 | +++ b/drivers/cpufreq/powernv-cpufreq.c |
670 | @@ -955,6 +955,12 @@ static int init_chip_info(void) |
671 | |
672 | static inline void clean_chip_info(void) |
673 | { |
674 | + int i; |
675 | + |
676 | + /* flush any pending work items */ |
677 | + if (chips) |
678 | + for (i = 0; i < nr_chips; i++) |
679 | + cancel_work_sync(&chips[i].throttle); |
680 | kfree(chips); |
681 | } |
682 | |
683 | diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c |
684 | index b4bd34429cc1..78212ba16eeb 100644 |
685 | --- a/drivers/crypto/mxs-dcp.c |
686 | +++ b/drivers/crypto/mxs-dcp.c |
687 | @@ -25,6 +25,7 @@ |
688 | #include <crypto/sha.h> |
689 | #include <crypto/internal/hash.h> |
690 | #include <crypto/internal/skcipher.h> |
691 | +#include <crypto/scatterwalk.h> |
692 | |
693 | #define DCP_MAX_CHANS 4 |
694 | #define DCP_BUF_SZ PAGE_SIZE |
695 | @@ -621,49 +622,46 @@ static int dcp_sha_req_to_buf(struct crypto_async_request *arq) |
696 | struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); |
697 | struct dcp_sha_req_ctx *rctx = ahash_request_ctx(req); |
698 | struct hash_alg_common *halg = crypto_hash_alg_common(tfm); |
699 | - const int nents = sg_nents(req->src); |
700 | |
701 | uint8_t *in_buf = sdcp->coh->sha_in_buf; |
702 | uint8_t *out_buf = sdcp->coh->sha_out_buf; |
703 | |
704 | - uint8_t *src_buf; |
705 | - |
706 | struct scatterlist *src; |
707 | |
708 | - unsigned int i, len, clen; |
709 | + unsigned int i, len, clen, oft = 0; |
710 | int ret; |
711 | |
712 | int fin = rctx->fini; |
713 | if (fin) |
714 | rctx->fini = 0; |
715 | |
716 | - for_each_sg(req->src, src, nents, i) { |
717 | - src_buf = sg_virt(src); |
718 | - len = sg_dma_len(src); |
719 | - |
720 | - do { |
721 | - if (actx->fill + len > DCP_BUF_SZ) |
722 | - clen = DCP_BUF_SZ - actx->fill; |
723 | - else |
724 | - clen = len; |
725 | - |
726 | - memcpy(in_buf + actx->fill, src_buf, clen); |
727 | - len -= clen; |
728 | - src_buf += clen; |
729 | - actx->fill += clen; |
730 | + src = req->src; |
731 | + len = req->nbytes; |
732 | |
733 | - /* |
734 | - * If we filled the buffer and still have some |
735 | - * more data, submit the buffer. |
736 | - */ |
737 | - if (len && actx->fill == DCP_BUF_SZ) { |
738 | - ret = mxs_dcp_run_sha(req); |
739 | - if (ret) |
740 | - return ret; |
741 | - actx->fill = 0; |
742 | - rctx->init = 0; |
743 | - } |
744 | - } while (len); |
745 | + while (len) { |
746 | + if (actx->fill + len > DCP_BUF_SZ) |
747 | + clen = DCP_BUF_SZ - actx->fill; |
748 | + else |
749 | + clen = len; |
750 | + |
751 | + scatterwalk_map_and_copy(in_buf + actx->fill, src, oft, clen, |
752 | + 0); |
753 | + |
754 | + len -= clen; |
755 | + oft += clen; |
756 | + actx->fill += clen; |
757 | + |
758 | + /* |
759 | + * If we filled the buffer and still have some |
760 | + * more data, submit the buffer. |
761 | + */ |
762 | + if (len && actx->fill == DCP_BUF_SZ) { |
763 | + ret = mxs_dcp_run_sha(req); |
764 | + if (ret) |
765 | + return ret; |
766 | + actx->fill = 0; |
767 | + rctx->init = 0; |
768 | + } |
769 | } |
770 | |
771 | if (fin) { |
772 | diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c |
773 | index 505dead07619..73d02f6089d5 100644 |
774 | --- a/drivers/gpio/gpiolib.c |
775 | +++ b/drivers/gpio/gpiolib.c |
776 | @@ -1232,31 +1232,14 @@ int gpiochip_add_data(struct gpio_chip *chip, void *data) |
777 | struct gpio_desc *desc = &gdev->descs[i]; |
778 | |
779 | desc->gdev = gdev; |
780 | - /* |
781 | - * REVISIT: most hardware initializes GPIOs as inputs |
782 | - * (often with pullups enabled) so power usage is |
783 | - * minimized. Linux code should set the gpio direction |
784 | - * first thing; but until it does, and in case |
785 | - * chip->get_direction is not set, we may expose the |
786 | - * wrong direction in sysfs. |
787 | - */ |
788 | - |
789 | - if (chip->get_direction) { |
790 | - /* |
791 | - * If we have .get_direction, set up the initial |
792 | - * direction flag from the hardware. |
793 | - */ |
794 | - int dir = chip->get_direction(chip, i); |
795 | |
796 | - if (!dir) |
797 | - set_bit(FLAG_IS_OUT, &desc->flags); |
798 | - } else if (!chip->direction_input) { |
799 | - /* |
800 | - * If the chip lacks the .direction_input callback |
801 | - * we logically assume all lines are outputs. |
802 | - */ |
803 | - set_bit(FLAG_IS_OUT, &desc->flags); |
804 | - } |
805 | + /* REVISIT: most hardware initializes GPIOs as inputs (often |
806 | + * with pullups enabled) so power usage is minimized. Linux |
807 | + * code should set the gpio direction first thing; but until |
808 | + * it does, and in case chip->get_direction is not set, we may |
809 | + * expose the wrong direction in sysfs. |
810 | + */ |
811 | + desc->flags = !chip->direction_input ? (1 << FLAG_IS_OUT) : 0; |
812 | } |
813 | |
814 | #ifdef CONFIG_PINCTRL |
815 | diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c |
816 | index 592ebcd440b6..41e67e983a7f 100644 |
817 | --- a/drivers/gpu/drm/drm_dp_mst_topology.c |
818 | +++ b/drivers/gpu/drm/drm_dp_mst_topology.c |
819 | @@ -1041,10 +1041,12 @@ static bool drm_dp_port_setup_pdt(struct drm_dp_mst_port *port) |
820 | lct = drm_dp_calculate_rad(port, rad); |
821 | |
822 | port->mstb = drm_dp_add_mst_branch_device(lct, rad); |
823 | - port->mstb->mgr = port->mgr; |
824 | - port->mstb->port_parent = port; |
825 | + if (port->mstb) { |
826 | + port->mstb->mgr = port->mgr; |
827 | + port->mstb->port_parent = port; |
828 | |
829 | - send_link = true; |
830 | + send_link = true; |
831 | + } |
832 | break; |
833 | } |
834 | return send_link; |
835 | @@ -2034,6 +2036,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms |
836 | int ret = 0; |
837 | struct drm_dp_mst_branch *mstb = NULL; |
838 | |
839 | + mutex_lock(&mgr->payload_lock); |
840 | mutex_lock(&mgr->lock); |
841 | if (mst_state == mgr->mst_state) |
842 | goto out_unlock; |
843 | @@ -2096,7 +2099,10 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms |
844 | /* this can fail if the device is gone */ |
845 | drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, 0); |
846 | ret = 0; |
847 | - memset(mgr->payloads, 0, mgr->max_payloads * sizeof(struct drm_dp_payload)); |
848 | + memset(mgr->payloads, 0, |
849 | + mgr->max_payloads * sizeof(mgr->payloads[0])); |
850 | + memset(mgr->proposed_vcpis, 0, |
851 | + mgr->max_payloads * sizeof(mgr->proposed_vcpis[0])); |
852 | mgr->payload_mask = 0; |
853 | set_bit(0, &mgr->payload_mask); |
854 | mgr->vcpi_mask = 0; |
855 | @@ -2104,6 +2110,7 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms |
856 | |
857 | out_unlock: |
858 | mutex_unlock(&mgr->lock); |
859 | + mutex_unlock(&mgr->payload_lock); |
860 | if (mstb) |
861 | drm_dp_put_mst_branch_device(mstb); |
862 | return ret; |
863 | diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c |
864 | index 3ceea9cb9d3e..d5de4dd19701 100644 |
865 | --- a/drivers/gpu/drm/drm_pci.c |
866 | +++ b/drivers/gpu/drm/drm_pci.c |
867 | @@ -42,8 +42,6 @@ |
868 | drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align) |
869 | { |
870 | drm_dma_handle_t *dmah; |
871 | - unsigned long addr; |
872 | - size_t sz; |
873 | |
874 | /* pci_alloc_consistent only guarantees alignment to the smallest |
875 | * PAGE_SIZE order which is greater than or equal to the requested size. |
876 | @@ -57,22 +55,13 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali |
877 | return NULL; |
878 | |
879 | dmah->size = size; |
880 | - dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size, &dmah->busaddr, GFP_KERNEL | __GFP_COMP); |
881 | + dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size, &dmah->busaddr, GFP_KERNEL); |
882 | |
883 | if (dmah->vaddr == NULL) { |
884 | kfree(dmah); |
885 | return NULL; |
886 | } |
887 | |
888 | - memset(dmah->vaddr, 0, size); |
889 | - |
890 | - /* XXX - Is virt_to_page() legal for consistent mem? */ |
891 | - /* Reserve */ |
892 | - for (addr = (unsigned long)dmah->vaddr, sz = size; |
893 | - sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { |
894 | - SetPageReserved(virt_to_page((void *)addr)); |
895 | - } |
896 | - |
897 | return dmah; |
898 | } |
899 | |
900 | @@ -85,19 +74,9 @@ EXPORT_SYMBOL(drm_pci_alloc); |
901 | */ |
902 | void __drm_legacy_pci_free(struct drm_device * dev, drm_dma_handle_t * dmah) |
903 | { |
904 | - unsigned long addr; |
905 | - size_t sz; |
906 | - |
907 | - if (dmah->vaddr) { |
908 | - /* XXX - Is virt_to_page() legal for consistent mem? */ |
909 | - /* Unreserve */ |
910 | - for (addr = (unsigned long)dmah->vaddr, sz = dmah->size; |
911 | - sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { |
912 | - ClearPageReserved(virt_to_page((void *)addr)); |
913 | - } |
914 | + if (dmah->vaddr) |
915 | dma_free_coherent(&dev->pdev->dev, dmah->size, dmah->vaddr, |
916 | dmah->busaddr); |
917 | - } |
918 | } |
919 | |
920 | /** |
921 | diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c |
922 | index 1371547ce1a3..185653b8ec3a 100644 |
923 | --- a/drivers/i2c/busses/i2c-st.c |
924 | +++ b/drivers/i2c/busses/i2c-st.c |
925 | @@ -437,6 +437,7 @@ static void st_i2c_wr_fill_tx_fifo(struct st_i2c_dev *i2c_dev) |
926 | /** |
927 | * st_i2c_rd_fill_tx_fifo() - Fill the Tx FIFO in read mode |
928 | * @i2c_dev: Controller's private data |
929 | + * @max: Maximum amount of data to fill into the Tx FIFO |
930 | * |
931 | * This functions fills the Tx FIFO with fixed pattern when |
932 | * in read mode to trigger clock. |
933 | diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h |
934 | index 34be09651ee8..a4e76084a2af 100644 |
935 | --- a/drivers/input/serio/i8042-x86ia64io.h |
936 | +++ b/drivers/input/serio/i8042-x86ia64io.h |
937 | @@ -534,6 +534,17 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { |
938 | DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"), |
939 | }, |
940 | }, |
941 | + { |
942 | + /* |
943 | + * Acer Aspire 5738z |
944 | + * Touchpad stops working in mux mode when dis- + re-enabled |
945 | + * with the touchpad enable/disable toggle hotkey |
946 | + */ |
947 | + .matches = { |
948 | + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), |
949 | + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"), |
950 | + }, |
951 | + }, |
952 | { } |
953 | }; |
954 | |
955 | diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h |
956 | index 0d91785ebdc3..da3fbf82d1cf 100644 |
957 | --- a/drivers/iommu/amd_iommu_types.h |
958 | +++ b/drivers/iommu/amd_iommu_types.h |
959 | @@ -329,7 +329,7 @@ |
960 | |
961 | #define DTE_GCR3_VAL_A(x) (((x) >> 12) & 0x00007ULL) |
962 | #define DTE_GCR3_VAL_B(x) (((x) >> 15) & 0x0ffffULL) |
963 | -#define DTE_GCR3_VAL_C(x) (((x) >> 31) & 0xfffffULL) |
964 | +#define DTE_GCR3_VAL_C(x) (((x) >> 31) & 0x1fffffULL) |
965 | |
966 | #define DTE_GCR3_INDEX_A 0 |
967 | #define DTE_GCR3_INDEX_B 1 |
968 | diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c |
969 | index 37dd4645bf18..b075409a06a9 100644 |
970 | --- a/drivers/irqchip/irq-versatile-fpga.c |
971 | +++ b/drivers/irqchip/irq-versatile-fpga.c |
972 | @@ -5,6 +5,7 @@ |
973 | #include <linux/irq.h> |
974 | #include <linux/io.h> |
975 | #include <linux/irqchip.h> |
976 | +#include <linux/irqchip/chained_irq.h> |
977 | #include <linux/irqchip/versatile-fpga.h> |
978 | #include <linux/irqdomain.h> |
979 | #include <linux/module.h> |
980 | @@ -67,12 +68,16 @@ static void fpga_irq_unmask(struct irq_data *d) |
981 | |
982 | static void fpga_irq_handle(struct irq_desc *desc) |
983 | { |
984 | + struct irq_chip *chip = irq_desc_get_chip(desc); |
985 | struct fpga_irq_data *f = irq_desc_get_handler_data(desc); |
986 | - u32 status = readl(f->base + IRQ_STATUS); |
987 | + u32 status; |
988 | + |
989 | + chained_irq_enter(chip, desc); |
990 | |
991 | + status = readl(f->base + IRQ_STATUS); |
992 | if (status == 0) { |
993 | do_bad_IRQ(desc); |
994 | - return; |
995 | + goto out; |
996 | } |
997 | |
998 | do { |
999 | @@ -81,6 +86,9 @@ static void fpga_irq_handle(struct irq_desc *desc) |
1000 | status &= ~(1 << irq); |
1001 | generic_handle_irq(irq_find_mapping(f->domain, irq)); |
1002 | } while (status); |
1003 | + |
1004 | +out: |
1005 | + chained_irq_exit(chip, desc); |
1006 | } |
1007 | |
1008 | /* |
1009 | @@ -203,6 +211,9 @@ int __init fpga_irq_of_init(struct device_node *node, |
1010 | if (of_property_read_u32(node, "valid-mask", &valid_mask)) |
1011 | valid_mask = 0; |
1012 | |
1013 | + writel(clear_mask, base + IRQ_ENABLE_CLEAR); |
1014 | + writel(clear_mask, base + FIQ_ENABLE_CLEAR); |
1015 | + |
1016 | /* Some chips are cascaded from a parent IRQ */ |
1017 | parent_irq = irq_of_parse_and_map(node, 0); |
1018 | if (!parent_irq) { |
1019 | @@ -212,9 +223,6 @@ int __init fpga_irq_of_init(struct device_node *node, |
1020 | |
1021 | fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node); |
1022 | |
1023 | - writel(clear_mask, base + IRQ_ENABLE_CLEAR); |
1024 | - writel(clear_mask, base + FIQ_ENABLE_CLEAR); |
1025 | - |
1026 | /* |
1027 | * On Versatile AB/PB, some secondary interrupts have a direct |
1028 | * pass-thru to the primary controller for IRQs 20 and 22-31 which need |
1029 | diff --git a/drivers/md/dm-flakey.c b/drivers/md/dm-flakey.c |
1030 | index 742c1fa870da..36a98f4db056 100644 |
1031 | --- a/drivers/md/dm-flakey.c |
1032 | +++ b/drivers/md/dm-flakey.c |
1033 | @@ -69,6 +69,11 @@ static int parse_features(struct dm_arg_set *as, struct flakey_c *fc, |
1034 | arg_name = dm_shift_arg(as); |
1035 | argc--; |
1036 | |
1037 | + if (!arg_name) { |
1038 | + ti->error = "Insufficient feature arguments"; |
1039 | + return -EINVAL; |
1040 | + } |
1041 | + |
1042 | /* |
1043 | * drop_writes |
1044 | */ |
1045 | diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c |
1046 | index 78f36012eaca..8f9957d31a3e 100644 |
1047 | --- a/drivers/md/dm-verity-fec.c |
1048 | +++ b/drivers/md/dm-verity-fec.c |
1049 | @@ -563,6 +563,7 @@ void verity_fec_dtr(struct dm_verity *v) |
1050 | mempool_destroy(f->rs_pool); |
1051 | mempool_destroy(f->prealloc_pool); |
1052 | mempool_destroy(f->extra_pool); |
1053 | + mempool_destroy(f->output_pool); |
1054 | kmem_cache_destroy(f->cache); |
1055 | |
1056 | if (f->data_bufio) |
1057 | diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c |
1058 | index 44323cb5d287..563b9636ab63 100644 |
1059 | --- a/drivers/media/platform/ti-vpe/cal.c |
1060 | +++ b/drivers/media/platform/ti-vpe/cal.c |
1061 | @@ -548,16 +548,16 @@ static void enable_irqs(struct cal_ctx *ctx) |
1062 | |
1063 | static void disable_irqs(struct cal_ctx *ctx) |
1064 | { |
1065 | + u32 val; |
1066 | + |
1067 | /* Disable IRQ_WDMA_END 0/1 */ |
1068 | - reg_write_field(ctx->dev, |
1069 | - CAL_HL_IRQENABLE_CLR(2), |
1070 | - CAL_HL_IRQ_CLEAR, |
1071 | - CAL_HL_IRQ_MASK(ctx->csi2_port)); |
1072 | + val = 0; |
1073 | + set_field(&val, CAL_HL_IRQ_CLEAR, CAL_HL_IRQ_MASK(ctx->csi2_port)); |
1074 | + reg_write(ctx->dev, CAL_HL_IRQENABLE_CLR(2), val); |
1075 | /* Disable IRQ_WDMA_START 0/1 */ |
1076 | - reg_write_field(ctx->dev, |
1077 | - CAL_HL_IRQENABLE_CLR(3), |
1078 | - CAL_HL_IRQ_CLEAR, |
1079 | - CAL_HL_IRQ_MASK(ctx->csi2_port)); |
1080 | + val = 0; |
1081 | + set_field(&val, CAL_HL_IRQ_CLEAR, CAL_HL_IRQ_MASK(ctx->csi2_port)); |
1082 | + reg_write(ctx->dev, CAL_HL_IRQENABLE_CLR(3), val); |
1083 | /* Todo: Add VC_IRQ and CSI2_COMPLEXIO_IRQ handling */ |
1084 | reg_write(ctx->dev, CAL_CSI2_VC_IRQENABLE(1), 0); |
1085 | } |
1086 | diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c |
1087 | index 95d0f2df0ad4..672831d5ee32 100644 |
1088 | --- a/drivers/mfd/dln2.c |
1089 | +++ b/drivers/mfd/dln2.c |
1090 | @@ -93,6 +93,11 @@ struct dln2_mod_rx_slots { |
1091 | spinlock_t lock; |
1092 | }; |
1093 | |
1094 | +enum dln2_endpoint { |
1095 | + DLN2_EP_OUT = 0, |
1096 | + DLN2_EP_IN = 1, |
1097 | +}; |
1098 | + |
1099 | struct dln2_dev { |
1100 | struct usb_device *usb_dev; |
1101 | struct usb_interface *interface; |
1102 | @@ -740,10 +745,10 @@ static int dln2_probe(struct usb_interface *interface, |
1103 | hostif->desc.bNumEndpoints < 2) |
1104 | return -ENODEV; |
1105 | |
1106 | - epin = &hostif->endpoint[0].desc; |
1107 | - epout = &hostif->endpoint[1].desc; |
1108 | + epout = &hostif->endpoint[DLN2_EP_OUT].desc; |
1109 | if (!usb_endpoint_is_bulk_out(epout)) |
1110 | return -ENODEV; |
1111 | + epin = &hostif->endpoint[DLN2_EP_IN].desc; |
1112 | if (!usb_endpoint_is_bulk_in(epin)) |
1113 | return -ENODEV; |
1114 | |
1115 | diff --git a/drivers/mfd/rts5227.c b/drivers/mfd/rts5227.c |
1116 | index ff296a4bf3d2..dc6a9432a4b6 100644 |
1117 | --- a/drivers/mfd/rts5227.c |
1118 | +++ b/drivers/mfd/rts5227.c |
1119 | @@ -369,6 +369,7 @@ static const struct pcr_ops rts522a_pcr_ops = { |
1120 | void rts522a_init_params(struct rtsx_pcr *pcr) |
1121 | { |
1122 | rts5227_init_params(pcr); |
1123 | + pcr->ops = &rts522a_pcr_ops; |
1124 | |
1125 | pcr->reg_pm_ctrl3 = RTS522A_PM_CTRL3; |
1126 | } |
1127 | diff --git a/drivers/misc/echo/echo.c b/drivers/misc/echo/echo.c |
1128 | index 9597e9523cac..fff13176f9b8 100644 |
1129 | --- a/drivers/misc/echo/echo.c |
1130 | +++ b/drivers/misc/echo/echo.c |
1131 | @@ -454,7 +454,7 @@ int16_t oslec_update(struct oslec_state *ec, int16_t tx, int16_t rx) |
1132 | */ |
1133 | ec->factor = 0; |
1134 | ec->shift = 0; |
1135 | - if ((ec->nonupdate_dwell == 0)) { |
1136 | + if (!ec->nonupdate_dwell) { |
1137 | int p, logp, shift; |
1138 | |
1139 | /* Determine: |
1140 | diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c |
1141 | index 8b66e52ca3cc..9734e6903fe6 100644 |
1142 | --- a/drivers/mtd/devices/phram.c |
1143 | +++ b/drivers/mtd/devices/phram.c |
1144 | @@ -247,22 +247,25 @@ static int phram_setup(const char *val) |
1145 | |
1146 | ret = parse_num64(&start, token[1]); |
1147 | if (ret) { |
1148 | - kfree(name); |
1149 | parse_err("illegal start address\n"); |
1150 | + goto error; |
1151 | } |
1152 | |
1153 | ret = parse_num64(&len, token[2]); |
1154 | if (ret) { |
1155 | - kfree(name); |
1156 | parse_err("illegal device length\n"); |
1157 | + goto error; |
1158 | } |
1159 | |
1160 | ret = register_device(name, start, len); |
1161 | - if (!ret) |
1162 | - pr_info("%s device: %#llx at %#llx\n", name, len, start); |
1163 | - else |
1164 | - kfree(name); |
1165 | + if (ret) |
1166 | + goto error; |
1167 | + |
1168 | + pr_info("%s device: %#llx at %#llx\n", name, len, start); |
1169 | + return 0; |
1170 | |
1171 | +error: |
1172 | + kfree(name); |
1173 | return ret; |
1174 | } |
1175 | |
1176 | diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c |
1177 | index 018c75faadb3..e1c283ccbbde 100644 |
1178 | --- a/drivers/mtd/lpddr/lpddr_cmds.c |
1179 | +++ b/drivers/mtd/lpddr/lpddr_cmds.c |
1180 | @@ -81,7 +81,6 @@ struct mtd_info *lpddr_cmdset(struct map_info *map) |
1181 | shared = kmalloc(sizeof(struct flchip_shared) * lpddr->numchips, |
1182 | GFP_KERNEL); |
1183 | if (!shared) { |
1184 | - kfree(lpddr); |
1185 | kfree(mtd); |
1186 | return NULL; |
1187 | } |
1188 | diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.h b/drivers/net/ethernet/neterion/vxge/vxge-config.h |
1189 | index 6ce4412fcc1a..380e841fdd95 100644 |
1190 | --- a/drivers/net/ethernet/neterion/vxge/vxge-config.h |
1191 | +++ b/drivers/net/ethernet/neterion/vxge/vxge-config.h |
1192 | @@ -2065,7 +2065,7 @@ vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask); |
1193 | if ((level >= VXGE_ERR && VXGE_COMPONENT_LL & VXGE_DEBUG_ERR_MASK) || \ |
1194 | (level >= VXGE_TRACE && VXGE_COMPONENT_LL & VXGE_DEBUG_TRACE_MASK))\ |
1195 | if ((mask & VXGE_DEBUG_MASK) == mask) \ |
1196 | - printk(fmt "\n", __VA_ARGS__); \ |
1197 | + printk(fmt "\n", ##__VA_ARGS__); \ |
1198 | } while (0) |
1199 | #else |
1200 | #define vxge_debug_ll(level, mask, fmt, ...) |
1201 | diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.h b/drivers/net/ethernet/neterion/vxge/vxge-main.h |
1202 | index 3a79d93b8445..5b535aa10d23 100644 |
1203 | --- a/drivers/net/ethernet/neterion/vxge/vxge-main.h |
1204 | +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.h |
1205 | @@ -454,49 +454,49 @@ int vxge_fw_upgrade(struct vxgedev *vdev, char *fw_name, int override); |
1206 | |
1207 | #if (VXGE_DEBUG_LL_CONFIG & VXGE_DEBUG_MASK) |
1208 | #define vxge_debug_ll_config(level, fmt, ...) \ |
1209 | - vxge_debug_ll(level, VXGE_DEBUG_LL_CONFIG, fmt, __VA_ARGS__) |
1210 | + vxge_debug_ll(level, VXGE_DEBUG_LL_CONFIG, fmt, ##__VA_ARGS__) |
1211 | #else |
1212 | #define vxge_debug_ll_config(level, fmt, ...) |
1213 | #endif |
1214 | |
1215 | #if (VXGE_DEBUG_INIT & VXGE_DEBUG_MASK) |
1216 | #define vxge_debug_init(level, fmt, ...) \ |
1217 | - vxge_debug_ll(level, VXGE_DEBUG_INIT, fmt, __VA_ARGS__) |
1218 | + vxge_debug_ll(level, VXGE_DEBUG_INIT, fmt, ##__VA_ARGS__) |
1219 | #else |
1220 | #define vxge_debug_init(level, fmt, ...) |
1221 | #endif |
1222 | |
1223 | #if (VXGE_DEBUG_TX & VXGE_DEBUG_MASK) |
1224 | #define vxge_debug_tx(level, fmt, ...) \ |
1225 | - vxge_debug_ll(level, VXGE_DEBUG_TX, fmt, __VA_ARGS__) |
1226 | + vxge_debug_ll(level, VXGE_DEBUG_TX, fmt, ##__VA_ARGS__) |
1227 | #else |
1228 | #define vxge_debug_tx(level, fmt, ...) |
1229 | #endif |
1230 | |
1231 | #if (VXGE_DEBUG_RX & VXGE_DEBUG_MASK) |
1232 | #define vxge_debug_rx(level, fmt, ...) \ |
1233 | - vxge_debug_ll(level, VXGE_DEBUG_RX, fmt, __VA_ARGS__) |
1234 | + vxge_debug_ll(level, VXGE_DEBUG_RX, fmt, ##__VA_ARGS__) |
1235 | #else |
1236 | #define vxge_debug_rx(level, fmt, ...) |
1237 | #endif |
1238 | |
1239 | #if (VXGE_DEBUG_MEM & VXGE_DEBUG_MASK) |
1240 | #define vxge_debug_mem(level, fmt, ...) \ |
1241 | - vxge_debug_ll(level, VXGE_DEBUG_MEM, fmt, __VA_ARGS__) |
1242 | + vxge_debug_ll(level, VXGE_DEBUG_MEM, fmt, ##__VA_ARGS__) |
1243 | #else |
1244 | #define vxge_debug_mem(level, fmt, ...) |
1245 | #endif |
1246 | |
1247 | #if (VXGE_DEBUG_ENTRYEXIT & VXGE_DEBUG_MASK) |
1248 | #define vxge_debug_entryexit(level, fmt, ...) \ |
1249 | - vxge_debug_ll(level, VXGE_DEBUG_ENTRYEXIT, fmt, __VA_ARGS__) |
1250 | + vxge_debug_ll(level, VXGE_DEBUG_ENTRYEXIT, fmt, ##__VA_ARGS__) |
1251 | #else |
1252 | #define vxge_debug_entryexit(level, fmt, ...) |
1253 | #endif |
1254 | |
1255 | #if (VXGE_DEBUG_INTR & VXGE_DEBUG_MASK) |
1256 | #define vxge_debug_intr(level, fmt, ...) \ |
1257 | - vxge_debug_ll(level, VXGE_DEBUG_INTR, fmt, __VA_ARGS__) |
1258 | + vxge_debug_ll(level, VXGE_DEBUG_INTR, fmt, ##__VA_ARGS__) |
1259 | #else |
1260 | #define vxge_debug_intr(level, fmt, ...) |
1261 | #endif |
1262 | diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c |
1263 | index 07f9067affc6..cda5b0a9e948 100644 |
1264 | --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c |
1265 | +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c |
1266 | @@ -1720,7 +1720,7 @@ static int qlcnic_83xx_get_reset_instruction_template(struct qlcnic_adapter *p_d |
1267 | |
1268 | ahw->reset.seq_error = 0; |
1269 | ahw->reset.buff = kzalloc(QLC_83XX_RESTART_TEMPLATE_SIZE, GFP_KERNEL); |
1270 | - if (p_dev->ahw->reset.buff == NULL) |
1271 | + if (ahw->reset.buff == NULL) |
1272 | return -ENOMEM; |
1273 | |
1274 | p_buff = p_dev->ahw->reset.buff; |
1275 | diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c |
1276 | index abc997427bae..58af2fe5be3c 100644 |
1277 | --- a/drivers/net/wireless/ath/ath9k/main.c |
1278 | +++ b/drivers/net/wireless/ath/ath9k/main.c |
1279 | @@ -1455,6 +1455,9 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) |
1280 | ath_chanctx_set_channel(sc, ctx, &hw->conf.chandef); |
1281 | } |
1282 | |
1283 | + if (changed & IEEE80211_CONF_CHANGE_POWER) |
1284 | + ath9k_set_txpower(sc, NULL); |
1285 | + |
1286 | mutex_unlock(&sc->mutex); |
1287 | ath9k_ps_restore(sc); |
1288 | |
1289 | diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c |
1290 | index 5e4058a4037b..cbf3958d788a 100644 |
1291 | --- a/drivers/net/wireless/ath/wil6210/debugfs.c |
1292 | +++ b/drivers/net/wireless/ath/wil6210/debugfs.c |
1293 | @@ -1091,7 +1091,7 @@ static const struct file_operations fops_ssid = { |
1294 | }; |
1295 | |
1296 | /*---------temp------------*/ |
1297 | -static void print_temp(struct seq_file *s, const char *prefix, u32 t) |
1298 | +static void print_temp(struct seq_file *s, const char *prefix, s32 t) |
1299 | { |
1300 | switch (t) { |
1301 | case 0: |
1302 | @@ -1099,7 +1099,8 @@ static void print_temp(struct seq_file *s, const char *prefix, u32 t) |
1303 | seq_printf(s, "%s N/A\n", prefix); |
1304 | break; |
1305 | default: |
1306 | - seq_printf(s, "%s %d.%03d\n", prefix, t / 1000, t % 1000); |
1307 | + seq_printf(s, "%s %s%d.%03d\n", prefix, (t < 0 ? "-" : ""), |
1308 | + abs(t / 1000), abs(t % 1000)); |
1309 | break; |
1310 | } |
1311 | } |
1312 | @@ -1107,7 +1108,7 @@ static void print_temp(struct seq_file *s, const char *prefix, u32 t) |
1313 | static int wil_temp_debugfs_show(struct seq_file *s, void *data) |
1314 | { |
1315 | struct wil6210_priv *wil = s->private; |
1316 | - u32 t_m, t_r; |
1317 | + s32 t_m, t_r; |
1318 | int rc = wmi_get_temperature(wil, &t_m, &t_r); |
1319 | |
1320 | if (rc) { |
1321 | diff --git a/drivers/net/wireless/ath/wil6210/interrupt.c b/drivers/net/wireless/ath/wil6210/interrupt.c |
1322 | index 64046e0bd0a2..a37533cffc7c 100644 |
1323 | --- a/drivers/net/wireless/ath/wil6210/interrupt.c |
1324 | +++ b/drivers/net/wireless/ath/wil6210/interrupt.c |
1325 | @@ -356,6 +356,25 @@ static void wil_cache_mbox_regs(struct wil6210_priv *wil) |
1326 | wil_mbox_ring_le2cpus(&wil->mbox_ctl.tx); |
1327 | } |
1328 | |
1329 | +static bool wil_validate_mbox_regs(struct wil6210_priv *wil) |
1330 | +{ |
1331 | + size_t min_size = sizeof(struct wil6210_mbox_hdr) + |
1332 | + sizeof(struct wmi_cmd_hdr); |
1333 | + |
1334 | + if (wil->mbox_ctl.rx.entry_size < min_size) { |
1335 | + wil_err(wil, "rx mbox entry too small (%d)\n", |
1336 | + wil->mbox_ctl.rx.entry_size); |
1337 | + return false; |
1338 | + } |
1339 | + if (wil->mbox_ctl.tx.entry_size < min_size) { |
1340 | + wil_err(wil, "tx mbox entry too small (%d)\n", |
1341 | + wil->mbox_ctl.tx.entry_size); |
1342 | + return false; |
1343 | + } |
1344 | + |
1345 | + return true; |
1346 | +} |
1347 | + |
1348 | static irqreturn_t wil6210_irq_misc(int irq, void *cookie) |
1349 | { |
1350 | struct wil6210_priv *wil = cookie; |
1351 | @@ -391,7 +410,8 @@ static irqreturn_t wil6210_irq_misc(int irq, void *cookie) |
1352 | if (isr & ISR_MISC_FW_READY) { |
1353 | wil_dbg_irq(wil, "IRQ: FW ready\n"); |
1354 | wil_cache_mbox_regs(wil); |
1355 | - set_bit(wil_status_mbox_ready, wil->status); |
1356 | + if (wil_validate_mbox_regs(wil)) |
1357 | + set_bit(wil_status_mbox_ready, wil->status); |
1358 | /** |
1359 | * Actual FW ready indicated by the |
1360 | * WMI_FW_READY_EVENTID |
1361 | diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c |
1362 | index f8bce58d48cc..12b4c6f00372 100644 |
1363 | --- a/drivers/net/wireless/ath/wil6210/main.c |
1364 | +++ b/drivers/net/wireless/ath/wil6210/main.c |
1365 | @@ -803,7 +803,7 @@ static void wil_bl_crash_info(struct wil6210_priv *wil, bool is_err) |
1366 | |
1367 | static int wil_wait_for_fw_ready(struct wil6210_priv *wil) |
1368 | { |
1369 | - ulong to = msecs_to_jiffies(1000); |
1370 | + ulong to = msecs_to_jiffies(2000); |
1371 | ulong left = wait_for_completion_timeout(&wil->wmi_ready, to); |
1372 | |
1373 | if (0 == left) { |
1374 | diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c |
1375 | index 4c38520d4dd2..72e8fea05e5e 100644 |
1376 | --- a/drivers/net/wireless/ath/wil6210/txrx.c |
1377 | +++ b/drivers/net/wireless/ath/wil6210/txrx.c |
1378 | @@ -546,8 +546,8 @@ static int wil_rx_refill(struct wil6210_priv *wil, int count) |
1379 | v->swtail = next_tail) { |
1380 | rc = wil_vring_alloc_skb(wil, v, v->swtail, headroom); |
1381 | if (unlikely(rc)) { |
1382 | - wil_err(wil, "Error %d in wil_rx_refill[%d]\n", |
1383 | - rc, v->swtail); |
1384 | + wil_err_ratelimited(wil, "Error %d in rx refill[%d]\n", |
1385 | + rc, v->swtail); |
1386 | break; |
1387 | } |
1388 | } |
1389 | diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c |
1390 | index 61419d1b4543..3f6ac1ca0e57 100644 |
1391 | --- a/drivers/net/wireless/ath/wil6210/wmi.c |
1392 | +++ b/drivers/net/wireless/ath/wil6210/wmi.c |
1393 | @@ -209,7 +209,7 @@ static int __wmi_send(struct wil6210_priv *wil, u16 cmdid, void *buf, u16 len) |
1394 | uint retry; |
1395 | int rc = 0; |
1396 | |
1397 | - if (sizeof(cmd) + len > r->entry_size) { |
1398 | + if (len > r->entry_size - sizeof(cmd)) { |
1399 | wil_err(wil, "WMI size too large: %d bytes, max is %d\n", |
1400 | (int)(sizeof(cmd) + len), r->entry_size); |
1401 | return -ERANGE; |
1402 | diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c |
1403 | index e9ec1da9935d..dd6924d21b8a 100644 |
1404 | --- a/drivers/net/wireless/mac80211_hwsim.c |
1405 | +++ b/drivers/net/wireless/mac80211_hwsim.c |
1406 | @@ -3060,9 +3060,9 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info) |
1407 | param.no_vif = true; |
1408 | |
1409 | if (info->attrs[HWSIM_ATTR_RADIO_NAME]) { |
1410 | - hwname = kasprintf(GFP_KERNEL, "%.*s", |
1411 | - nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]), |
1412 | - (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME])); |
1413 | + hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]), |
1414 | + nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]), |
1415 | + GFP_KERNEL); |
1416 | if (!hwname) |
1417 | return -ENOMEM; |
1418 | param.hwname = hwname; |
1419 | @@ -3101,9 +3101,9 @@ static int hwsim_del_radio_nl(struct sk_buff *msg, struct genl_info *info) |
1420 | if (info->attrs[HWSIM_ATTR_RADIO_ID]) { |
1421 | idx = nla_get_u32(info->attrs[HWSIM_ATTR_RADIO_ID]); |
1422 | } else if (info->attrs[HWSIM_ATTR_RADIO_NAME]) { |
1423 | - hwname = kasprintf(GFP_KERNEL, "%.*s", |
1424 | - nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]), |
1425 | - (char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME])); |
1426 | + hwname = kstrndup((char *)nla_data(info->attrs[HWSIM_ATTR_RADIO_NAME]), |
1427 | + nla_len(info->attrs[HWSIM_ATTR_RADIO_NAME]), |
1428 | + GFP_KERNEL); |
1429 | if (!hwname) |
1430 | return -ENOMEM; |
1431 | } else |
1432 | diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c |
1433 | index 5768a4749564..65ac1d3870f9 100644 |
1434 | --- a/drivers/nvdimm/bus.c |
1435 | +++ b/drivers/nvdimm/bus.c |
1436 | @@ -851,8 +851,10 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, |
1437 | return -EFAULT; |
1438 | } |
1439 | |
1440 | - if (!desc || (desc->out_num + desc->in_num == 0) || |
1441 | - !test_bit(cmd, &cmd_mask)) |
1442 | + if (!desc || |
1443 | + (desc->out_num + desc->in_num == 0) || |
1444 | + cmd > ND_CMD_CALL || |
1445 | + !test_bit(cmd, &cmd_mask)) |
1446 | return -ENOTTY; |
1447 | |
1448 | /* fail write commands (when read-only) */ |
1449 | diff --git a/drivers/of/base.c b/drivers/of/base.c |
1450 | index c66cdc4307fd..af80e3d34eda 100644 |
1451 | --- a/drivers/of/base.c |
1452 | +++ b/drivers/of/base.c |
1453 | @@ -170,9 +170,6 @@ int __of_attach_node_sysfs(struct device_node *np) |
1454 | struct property *pp; |
1455 | int rc; |
1456 | |
1457 | - if (!IS_ENABLED(CONFIG_SYSFS)) |
1458 | - return 0; |
1459 | - |
1460 | if (!of_kset) |
1461 | return 0; |
1462 | |
1463 | diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c |
1464 | index 92530525e355..aeb6d3009ae9 100644 |
1465 | --- a/drivers/of/unittest.c |
1466 | +++ b/drivers/of/unittest.c |
1467 | @@ -821,10 +821,13 @@ static void __init of_unittest_platform_populate(void) |
1468 | |
1469 | of_platform_populate(np, match, NULL, &test_bus->dev); |
1470 | for_each_child_of_node(np, child) { |
1471 | - for_each_child_of_node(child, grandchild) |
1472 | - unittest(of_find_device_by_node(grandchild), |
1473 | + for_each_child_of_node(child, grandchild) { |
1474 | + pdev = of_find_device_by_node(grandchild); |
1475 | + unittest(pdev, |
1476 | "Could not create device for node '%s'\n", |
1477 | grandchild->name); |
1478 | + of_dev_put(pdev); |
1479 | + } |
1480 | } |
1481 | |
1482 | of_platform_depopulate(&test_bus->dev); |
1483 | diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c |
1484 | index bccb3f595ff3..247be9155694 100644 |
1485 | --- a/drivers/power/supply/bq27xxx_battery.c |
1486 | +++ b/drivers/power/supply/bq27xxx_battery.c |
1487 | @@ -1031,7 +1031,10 @@ int bq27xxx_battery_setup(struct bq27xxx_device_info *di) |
1488 | |
1489 | di->bat = power_supply_register_no_ws(di->dev, psy_desc, &psy_cfg); |
1490 | if (IS_ERR(di->bat)) { |
1491 | - dev_err(di->dev, "failed to register battery\n"); |
1492 | + if (PTR_ERR(di->bat) == -EPROBE_DEFER) |
1493 | + dev_dbg(di->dev, "failed to register battery, deferring probe\n"); |
1494 | + else |
1495 | + dev_err(di->dev, "failed to register battery\n"); |
1496 | return PTR_ERR(di->bat); |
1497 | } |
1498 | |
1499 | diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c |
1500 | index bd5ca548c265..dd9751687760 100644 |
1501 | --- a/drivers/rtc/rtc-omap.c |
1502 | +++ b/drivers/rtc/rtc-omap.c |
1503 | @@ -559,9 +559,7 @@ static const struct pinctrl_ops rtc_pinctrl_ops = { |
1504 | .dt_free_map = pinconf_generic_dt_free_map, |
1505 | }; |
1506 | |
1507 | -enum rtc_pin_config_param { |
1508 | - PIN_CONFIG_ACTIVE_HIGH = PIN_CONFIG_END + 1, |
1509 | -}; |
1510 | +#define PIN_CONFIG_ACTIVE_HIGH (PIN_CONFIG_END + 1) |
1511 | |
1512 | static const struct pinconf_generic_params rtc_params[] = { |
1513 | {"ti,active-high", PIN_CONFIG_ACTIVE_HIGH, 0}, |
1514 | diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c |
1515 | index a1b4b0ed1f19..3b619b7b2c53 100644 |
1516 | --- a/drivers/rtc/rtc-pm8xxx.c |
1517 | +++ b/drivers/rtc/rtc-pm8xxx.c |
1518 | @@ -74,16 +74,18 @@ struct pm8xxx_rtc { |
1519 | /* |
1520 | * Steps to write the RTC registers. |
1521 | * 1. Disable alarm if enabled. |
1522 | - * 2. Write 0x00 to LSB. |
1523 | - * 3. Write Byte[1], Byte[2], Byte[3] then Byte[0]. |
1524 | - * 4. Enable alarm if disabled in step 1. |
1525 | + * 2. Disable rtc if enabled. |
1526 | + * 3. Write 0x00 to LSB. |
1527 | + * 4. Write Byte[1], Byte[2], Byte[3] then Byte[0]. |
1528 | + * 5. Enable rtc if disabled in step 2. |
1529 | + * 6. Enable alarm if disabled in step 1. |
1530 | */ |
1531 | static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm) |
1532 | { |
1533 | int rc, i; |
1534 | unsigned long secs, irq_flags; |
1535 | - u8 value[NUM_8_BIT_RTC_REGS], alarm_enabled = 0; |
1536 | - unsigned int ctrl_reg; |
1537 | + u8 value[NUM_8_BIT_RTC_REGS], alarm_enabled = 0, rtc_disabled = 0; |
1538 | + unsigned int ctrl_reg, rtc_ctrl_reg; |
1539 | struct pm8xxx_rtc *rtc_dd = dev_get_drvdata(dev); |
1540 | const struct pm8xxx_rtc_regs *regs = rtc_dd->regs; |
1541 | |
1542 | @@ -92,23 +94,38 @@ static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm) |
1543 | |
1544 | rtc_tm_to_time(tm, &secs); |
1545 | |
1546 | + dev_dbg(dev, "Seconds value to be written to RTC = %lu\n", secs); |
1547 | + |
1548 | for (i = 0; i < NUM_8_BIT_RTC_REGS; i++) { |
1549 | value[i] = secs & 0xFF; |
1550 | secs >>= 8; |
1551 | } |
1552 | |
1553 | - dev_dbg(dev, "Seconds value to be written to RTC = %lu\n", secs); |
1554 | - |
1555 | spin_lock_irqsave(&rtc_dd->ctrl_reg_lock, irq_flags); |
1556 | |
1557 | - rc = regmap_read(rtc_dd->regmap, regs->ctrl, &ctrl_reg); |
1558 | + rc = regmap_read(rtc_dd->regmap, regs->alarm_ctrl, &ctrl_reg); |
1559 | if (rc) |
1560 | goto rtc_rw_fail; |
1561 | |
1562 | if (ctrl_reg & regs->alarm_en) { |
1563 | alarm_enabled = 1; |
1564 | ctrl_reg &= ~regs->alarm_en; |
1565 | - rc = regmap_write(rtc_dd->regmap, regs->ctrl, ctrl_reg); |
1566 | + rc = regmap_write(rtc_dd->regmap, regs->alarm_ctrl, ctrl_reg); |
1567 | + if (rc) { |
1568 | + dev_err(dev, "Write to RTC Alarm control register failed\n"); |
1569 | + goto rtc_rw_fail; |
1570 | + } |
1571 | + } |
1572 | + |
1573 | + /* Disable RTC H/w before writing on RTC register */ |
1574 | + rc = regmap_read(rtc_dd->regmap, regs->ctrl, &rtc_ctrl_reg); |
1575 | + if (rc) |
1576 | + goto rtc_rw_fail; |
1577 | + |
1578 | + if (rtc_ctrl_reg & PM8xxx_RTC_ENABLE) { |
1579 | + rtc_disabled = 1; |
1580 | + rtc_ctrl_reg &= ~PM8xxx_RTC_ENABLE; |
1581 | + rc = regmap_write(rtc_dd->regmap, regs->ctrl, rtc_ctrl_reg); |
1582 | if (rc) { |
1583 | dev_err(dev, "Write to RTC control register failed\n"); |
1584 | goto rtc_rw_fail; |
1585 | @@ -137,11 +154,21 @@ static int pm8xxx_rtc_set_time(struct device *dev, struct rtc_time *tm) |
1586 | goto rtc_rw_fail; |
1587 | } |
1588 | |
1589 | + /* Enable RTC H/w after writing on RTC register */ |
1590 | + if (rtc_disabled) { |
1591 | + rtc_ctrl_reg |= PM8xxx_RTC_ENABLE; |
1592 | + rc = regmap_write(rtc_dd->regmap, regs->ctrl, rtc_ctrl_reg); |
1593 | + if (rc) { |
1594 | + dev_err(dev, "Write to RTC control register failed\n"); |
1595 | + goto rtc_rw_fail; |
1596 | + } |
1597 | + } |
1598 | + |
1599 | if (alarm_enabled) { |
1600 | ctrl_reg |= regs->alarm_en; |
1601 | - rc = regmap_write(rtc_dd->regmap, regs->ctrl, ctrl_reg); |
1602 | + rc = regmap_write(rtc_dd->regmap, regs->alarm_ctrl, ctrl_reg); |
1603 | if (rc) { |
1604 | - dev_err(dev, "Write to RTC control register failed\n"); |
1605 | + dev_err(dev, "Write to RTC Alarm control register failed\n"); |
1606 | goto rtc_rw_fail; |
1607 | } |
1608 | } |
1609 | diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c |
1610 | index d5214c4eb9dd..d8aee54f6c26 100644 |
1611 | --- a/drivers/s390/scsi/zfcp_erp.c |
1612 | +++ b/drivers/s390/scsi/zfcp_erp.c |
1613 | @@ -747,7 +747,7 @@ static void zfcp_erp_enqueue_ptp_port(struct zfcp_adapter *adapter) |
1614 | adapter->peer_d_id); |
1615 | if (IS_ERR(port)) /* error or port already attached */ |
1616 | return; |
1617 | - _zfcp_erp_port_reopen(port, 0, "ereptp1"); |
1618 | + zfcp_erp_port_reopen(port, 0, "ereptp1"); |
1619 | } |
1620 | |
1621 | static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action) |
1622 | diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c |
1623 | index 8d9b416399f9..c924df5538dd 100644 |
1624 | --- a/drivers/scsi/sg.c |
1625 | +++ b/drivers/scsi/sg.c |
1626 | @@ -809,8 +809,10 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp, |
1627 | "sg_common_write: scsi opcode=0x%02x, cmd_size=%d\n", |
1628 | (int) cmnd[0], (int) hp->cmd_len)); |
1629 | |
1630 | - if (hp->dxfer_len >= SZ_256M) |
1631 | + if (hp->dxfer_len >= SZ_256M) { |
1632 | + sg_remove_request(sfp, srp); |
1633 | return -EINVAL; |
1634 | + } |
1635 | |
1636 | k = sg_start_req(srp, cmnd); |
1637 | if (k) { |
1638 | diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c |
1639 | index 51d559214db6..1fe193590b8b 100644 |
1640 | --- a/drivers/scsi/ufs/ufs-qcom.c |
1641 | +++ b/drivers/scsi/ufs/ufs-qcom.c |
1642 | @@ -1094,7 +1094,7 @@ static void ufs_qcom_advertise_quirks(struct ufs_hba *hba) |
1643 | hba->quirks |= UFSHCD_QUIRK_BROKEN_LCC; |
1644 | } |
1645 | |
1646 | - if (host->hw_ver.major >= 0x2) { |
1647 | + if (host->hw_ver.major == 0x2) { |
1648 | hba->quirks |= UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION; |
1649 | |
1650 | if (!ufs_qcom_cap_qunipro(host)) |
1651 | diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c |
1652 | index 394df57894e6..50d15748084a 100644 |
1653 | --- a/drivers/scsi/ufs/ufshcd.c |
1654 | +++ b/drivers/scsi/ufs/ufshcd.c |
1655 | @@ -682,6 +682,11 @@ start: |
1656 | */ |
1657 | if (ufshcd_can_hibern8_during_gating(hba) && |
1658 | ufshcd_is_link_hibern8(hba)) { |
1659 | + if (async) { |
1660 | + rc = -EAGAIN; |
1661 | + hba->clk_gating.active_reqs--; |
1662 | + break; |
1663 | + } |
1664 | spin_unlock_irqrestore(hba->host->host_lock, flags); |
1665 | flush_work(&hba->clk_gating.ungate_work); |
1666 | spin_lock_irqsave(hba->host->host_lock, flags); |
1667 | @@ -4392,19 +4397,30 @@ static irqreturn_t ufshcd_intr(int irq, void *__hba) |
1668 | u32 intr_status, enabled_intr_status; |
1669 | irqreturn_t retval = IRQ_NONE; |
1670 | struct ufs_hba *hba = __hba; |
1671 | + int retries = hba->nutrs; |
1672 | |
1673 | spin_lock(hba->host->host_lock); |
1674 | intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS); |
1675 | - enabled_intr_status = |
1676 | - intr_status & ufshcd_readl(hba, REG_INTERRUPT_ENABLE); |
1677 | |
1678 | - if (intr_status) |
1679 | - ufshcd_writel(hba, intr_status, REG_INTERRUPT_STATUS); |
1680 | + /* |
1681 | + * There could be max of hba->nutrs reqs in flight and in worst case |
1682 | + * if the reqs get finished 1 by 1 after the interrupt status is |
1683 | + * read, make sure we handle them by checking the interrupt status |
1684 | + * again in a loop until we process all of the reqs before returning. |
1685 | + */ |
1686 | + do { |
1687 | + enabled_intr_status = |
1688 | + intr_status & ufshcd_readl(hba, REG_INTERRUPT_ENABLE); |
1689 | + if (intr_status) |
1690 | + ufshcd_writel(hba, intr_status, REG_INTERRUPT_STATUS); |
1691 | + if (enabled_intr_status) { |
1692 | + ufshcd_sl_intr(hba, enabled_intr_status); |
1693 | + retval = IRQ_HANDLED; |
1694 | + } |
1695 | + |
1696 | + intr_status = ufshcd_readl(hba, REG_INTERRUPT_STATUS); |
1697 | + } while (intr_status && --retries); |
1698 | |
1699 | - if (enabled_intr_status) { |
1700 | - ufshcd_sl_intr(hba, enabled_intr_status); |
1701 | - retval = IRQ_HANDLED; |
1702 | - } |
1703 | spin_unlock(hba->host->host_lock); |
1704 | return retval; |
1705 | } |
1706 | diff --git a/drivers/soc/qcom/smem.c b/drivers/soc/qcom/smem.c |
1707 | index 18ec52f2078a..89dd50fa404f 100644 |
1708 | --- a/drivers/soc/qcom/smem.c |
1709 | +++ b/drivers/soc/qcom/smem.c |
1710 | @@ -646,7 +646,7 @@ static int qcom_smem_enumerate_partitions(struct qcom_smem *smem, |
1711 | return -EINVAL; |
1712 | } |
1713 | |
1714 | - if (header->size != entry->size) { |
1715 | + if (le32_to_cpu(header->size) != le32_to_cpu(entry->size)) { |
1716 | dev_err(smem->dev, |
1717 | "Partition %d has invalid size\n", i); |
1718 | return -EINVAL; |
1719 | diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c |
1720 | index b6c4f55f79e7..2b8fbcd8dde2 100644 |
1721 | --- a/drivers/target/iscsi/iscsi_target.c |
1722 | +++ b/drivers/target/iscsi/iscsi_target.c |
1723 | @@ -4321,30 +4321,37 @@ int iscsit_close_connection( |
1724 | if (!atomic_read(&sess->session_reinstatement) && |
1725 | atomic_read(&sess->session_fall_back_to_erl0)) { |
1726 | spin_unlock_bh(&sess->conn_lock); |
1727 | + complete_all(&sess->session_wait_comp); |
1728 | iscsit_close_session(sess); |
1729 | |
1730 | return 0; |
1731 | } else if (atomic_read(&sess->session_logout)) { |
1732 | pr_debug("Moving to TARG_SESS_STATE_FREE.\n"); |
1733 | sess->session_state = TARG_SESS_STATE_FREE; |
1734 | - spin_unlock_bh(&sess->conn_lock); |
1735 | |
1736 | - if (atomic_read(&sess->sleep_on_sess_wait_comp)) |
1737 | - complete(&sess->session_wait_comp); |
1738 | + if (atomic_read(&sess->session_close)) { |
1739 | + spin_unlock_bh(&sess->conn_lock); |
1740 | + complete_all(&sess->session_wait_comp); |
1741 | + iscsit_close_session(sess); |
1742 | + } else { |
1743 | + spin_unlock_bh(&sess->conn_lock); |
1744 | + } |
1745 | |
1746 | return 0; |
1747 | } else { |
1748 | pr_debug("Moving to TARG_SESS_STATE_FAILED.\n"); |
1749 | sess->session_state = TARG_SESS_STATE_FAILED; |
1750 | |
1751 | - if (!atomic_read(&sess->session_continuation)) { |
1752 | - spin_unlock_bh(&sess->conn_lock); |
1753 | + if (!atomic_read(&sess->session_continuation)) |
1754 | iscsit_start_time2retain_handler(sess); |
1755 | - } else |
1756 | - spin_unlock_bh(&sess->conn_lock); |
1757 | |
1758 | - if (atomic_read(&sess->sleep_on_sess_wait_comp)) |
1759 | - complete(&sess->session_wait_comp); |
1760 | + if (atomic_read(&sess->session_close)) { |
1761 | + spin_unlock_bh(&sess->conn_lock); |
1762 | + complete_all(&sess->session_wait_comp); |
1763 | + iscsit_close_session(sess); |
1764 | + } else { |
1765 | + spin_unlock_bh(&sess->conn_lock); |
1766 | + } |
1767 | |
1768 | return 0; |
1769 | } |
1770 | @@ -4453,9 +4460,9 @@ static void iscsit_logout_post_handler_closesession( |
1771 | complete(&conn->conn_logout_comp); |
1772 | |
1773 | iscsit_dec_conn_usage_count(conn); |
1774 | + atomic_set(&sess->session_close, 1); |
1775 | iscsit_stop_session(sess, sleep, sleep); |
1776 | iscsit_dec_session_usage_count(sess); |
1777 | - iscsit_close_session(sess); |
1778 | } |
1779 | |
1780 | static void iscsit_logout_post_handler_samecid( |
1781 | @@ -4590,49 +4597,6 @@ void iscsit_fail_session(struct iscsi_session *sess) |
1782 | sess->session_state = TARG_SESS_STATE_FAILED; |
1783 | } |
1784 | |
1785 | -int iscsit_free_session(struct iscsi_session *sess) |
1786 | -{ |
1787 | - u16 conn_count = atomic_read(&sess->nconn); |
1788 | - struct iscsi_conn *conn, *conn_tmp = NULL; |
1789 | - int is_last; |
1790 | - |
1791 | - spin_lock_bh(&sess->conn_lock); |
1792 | - atomic_set(&sess->sleep_on_sess_wait_comp, 1); |
1793 | - |
1794 | - list_for_each_entry_safe(conn, conn_tmp, &sess->sess_conn_list, |
1795 | - conn_list) { |
1796 | - if (conn_count == 0) |
1797 | - break; |
1798 | - |
1799 | - if (list_is_last(&conn->conn_list, &sess->sess_conn_list)) { |
1800 | - is_last = 1; |
1801 | - } else { |
1802 | - iscsit_inc_conn_usage_count(conn_tmp); |
1803 | - is_last = 0; |
1804 | - } |
1805 | - iscsit_inc_conn_usage_count(conn); |
1806 | - |
1807 | - spin_unlock_bh(&sess->conn_lock); |
1808 | - iscsit_cause_connection_reinstatement(conn, 1); |
1809 | - spin_lock_bh(&sess->conn_lock); |
1810 | - |
1811 | - iscsit_dec_conn_usage_count(conn); |
1812 | - if (is_last == 0) |
1813 | - iscsit_dec_conn_usage_count(conn_tmp); |
1814 | - |
1815 | - conn_count--; |
1816 | - } |
1817 | - |
1818 | - if (atomic_read(&sess->nconn)) { |
1819 | - spin_unlock_bh(&sess->conn_lock); |
1820 | - wait_for_completion(&sess->session_wait_comp); |
1821 | - } else |
1822 | - spin_unlock_bh(&sess->conn_lock); |
1823 | - |
1824 | - iscsit_close_session(sess); |
1825 | - return 0; |
1826 | -} |
1827 | - |
1828 | void iscsit_stop_session( |
1829 | struct iscsi_session *sess, |
1830 | int session_sleep, |
1831 | @@ -4643,8 +4607,6 @@ void iscsit_stop_session( |
1832 | int is_last; |
1833 | |
1834 | spin_lock_bh(&sess->conn_lock); |
1835 | - if (session_sleep) |
1836 | - atomic_set(&sess->sleep_on_sess_wait_comp, 1); |
1837 | |
1838 | if (connection_sleep) { |
1839 | list_for_each_entry_safe(conn, conn_tmp, &sess->sess_conn_list, |
1840 | @@ -4702,12 +4664,15 @@ int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *tpg, int force) |
1841 | spin_lock(&sess->conn_lock); |
1842 | if (atomic_read(&sess->session_fall_back_to_erl0) || |
1843 | atomic_read(&sess->session_logout) || |
1844 | + atomic_read(&sess->session_close) || |
1845 | (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED)) { |
1846 | spin_unlock(&sess->conn_lock); |
1847 | continue; |
1848 | } |
1849 | + iscsit_inc_session_usage_count(sess); |
1850 | atomic_set(&sess->session_reinstatement, 1); |
1851 | atomic_set(&sess->session_fall_back_to_erl0, 1); |
1852 | + atomic_set(&sess->session_close, 1); |
1853 | spin_unlock(&sess->conn_lock); |
1854 | |
1855 | list_move_tail(&se_sess->sess_list, &free_list); |
1856 | @@ -4717,7 +4682,9 @@ int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *tpg, int force) |
1857 | list_for_each_entry_safe(se_sess, se_sess_tmp, &free_list, sess_list) { |
1858 | sess = (struct iscsi_session *)se_sess->fabric_sess_ptr; |
1859 | |
1860 | - iscsit_free_session(sess); |
1861 | + list_del_init(&se_sess->sess_list); |
1862 | + iscsit_stop_session(sess, 1, 1); |
1863 | + iscsit_dec_session_usage_count(sess); |
1864 | session_count++; |
1865 | } |
1866 | |
1867 | diff --git a/drivers/target/iscsi/iscsi_target.h b/drivers/target/iscsi/iscsi_target.h |
1868 | index 4cf2c0f2ba2f..cfe87b629a8b 100644 |
1869 | --- a/drivers/target/iscsi/iscsi_target.h |
1870 | +++ b/drivers/target/iscsi/iscsi_target.h |
1871 | @@ -30,7 +30,6 @@ extern int iscsi_target_rx_thread(void *); |
1872 | extern int iscsit_close_connection(struct iscsi_conn *); |
1873 | extern int iscsit_close_session(struct iscsi_session *); |
1874 | extern void iscsit_fail_session(struct iscsi_session *); |
1875 | -extern int iscsit_free_session(struct iscsi_session *); |
1876 | extern void iscsit_stop_session(struct iscsi_session *, int, int); |
1877 | extern int iscsit_release_sessions_for_tpg(struct iscsi_portal_group *, int); |
1878 | |
1879 | diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c |
1880 | index 8a4bc15bc3f5..0718f688277a 100644 |
1881 | --- a/drivers/target/iscsi/iscsi_target_configfs.c |
1882 | +++ b/drivers/target/iscsi/iscsi_target_configfs.c |
1883 | @@ -1527,20 +1527,23 @@ static void lio_tpg_close_session(struct se_session *se_sess) |
1884 | spin_lock(&sess->conn_lock); |
1885 | if (atomic_read(&sess->session_fall_back_to_erl0) || |
1886 | atomic_read(&sess->session_logout) || |
1887 | + atomic_read(&sess->session_close) || |
1888 | (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED)) { |
1889 | spin_unlock(&sess->conn_lock); |
1890 | spin_unlock_bh(&se_tpg->session_lock); |
1891 | return; |
1892 | } |
1893 | + iscsit_inc_session_usage_count(sess); |
1894 | atomic_set(&sess->session_reinstatement, 1); |
1895 | atomic_set(&sess->session_fall_back_to_erl0, 1); |
1896 | + atomic_set(&sess->session_close, 1); |
1897 | spin_unlock(&sess->conn_lock); |
1898 | |
1899 | iscsit_stop_time2retain_timer(sess); |
1900 | spin_unlock_bh(&se_tpg->session_lock); |
1901 | |
1902 | iscsit_stop_session(sess, 1, 1); |
1903 | - iscsit_close_session(sess); |
1904 | + iscsit_dec_session_usage_count(sess); |
1905 | } |
1906 | |
1907 | static u32 lio_tpg_get_inst_index(struct se_portal_group *se_tpg) |
1908 | diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c |
1909 | index d2f82aaf6a85..985e600908e0 100644 |
1910 | --- a/drivers/target/iscsi/iscsi_target_login.c |
1911 | +++ b/drivers/target/iscsi/iscsi_target_login.c |
1912 | @@ -195,6 +195,7 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn) |
1913 | spin_lock(&sess_p->conn_lock); |
1914 | if (atomic_read(&sess_p->session_fall_back_to_erl0) || |
1915 | atomic_read(&sess_p->session_logout) || |
1916 | + atomic_read(&sess_p->session_close) || |
1917 | (sess_p->time2retain_timer_flags & ISCSI_TF_EXPIRED)) { |
1918 | spin_unlock(&sess_p->conn_lock); |
1919 | continue; |
1920 | @@ -205,6 +206,7 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn) |
1921 | (sess_p->sess_ops->SessionType == sessiontype))) { |
1922 | atomic_set(&sess_p->session_reinstatement, 1); |
1923 | atomic_set(&sess_p->session_fall_back_to_erl0, 1); |
1924 | + atomic_set(&sess_p->session_close, 1); |
1925 | spin_unlock(&sess_p->conn_lock); |
1926 | iscsit_inc_session_usage_count(sess_p); |
1927 | iscsit_stop_time2retain_timer(sess_p); |
1928 | @@ -229,7 +231,6 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn) |
1929 | if (sess->session_state == TARG_SESS_STATE_FAILED) { |
1930 | spin_unlock_bh(&sess->conn_lock); |
1931 | iscsit_dec_session_usage_count(sess); |
1932 | - iscsit_close_session(sess); |
1933 | return 0; |
1934 | } |
1935 | spin_unlock_bh(&sess->conn_lock); |
1936 | @@ -237,7 +238,6 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn) |
1937 | iscsit_stop_session(sess, 1, 1); |
1938 | iscsit_dec_session_usage_count(sess); |
1939 | |
1940 | - iscsit_close_session(sess); |
1941 | return 0; |
1942 | } |
1943 | |
1944 | @@ -525,6 +525,7 @@ static int iscsi_login_non_zero_tsih_s2( |
1945 | sess_p = (struct iscsi_session *)se_sess->fabric_sess_ptr; |
1946 | if (atomic_read(&sess_p->session_fall_back_to_erl0) || |
1947 | atomic_read(&sess_p->session_logout) || |
1948 | + atomic_read(&sess_p->session_close) || |
1949 | (sess_p->time2retain_timer_flags & ISCSI_TF_EXPIRED)) |
1950 | continue; |
1951 | if (!memcmp(sess_p->isid, pdu->isid, 6) && |
1952 | diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c |
1953 | index 7ac9bcdf1e61..1ba0dc11153d 100644 |
1954 | --- a/drivers/tty/ehv_bytechan.c |
1955 | +++ b/drivers/tty/ehv_bytechan.c |
1956 | @@ -139,6 +139,21 @@ static int find_console_handle(void) |
1957 | return 1; |
1958 | } |
1959 | |
1960 | +static unsigned int local_ev_byte_channel_send(unsigned int handle, |
1961 | + unsigned int *count, |
1962 | + const char *p) |
1963 | +{ |
1964 | + char buffer[EV_BYTE_CHANNEL_MAX_BYTES]; |
1965 | + unsigned int c = *count; |
1966 | + |
1967 | + if (c < sizeof(buffer)) { |
1968 | + memcpy(buffer, p, c); |
1969 | + memset(&buffer[c], 0, sizeof(buffer) - c); |
1970 | + p = buffer; |
1971 | + } |
1972 | + return ev_byte_channel_send(handle, count, p); |
1973 | +} |
1974 | + |
1975 | /*************************** EARLY CONSOLE DRIVER ***************************/ |
1976 | |
1977 | #ifdef CONFIG_PPC_EARLY_DEBUG_EHV_BC |
1978 | @@ -157,7 +172,7 @@ static void byte_channel_spin_send(const char data) |
1979 | |
1980 | do { |
1981 | count = 1; |
1982 | - ret = ev_byte_channel_send(CONFIG_PPC_EARLY_DEBUG_EHV_BC_HANDLE, |
1983 | + ret = local_ev_byte_channel_send(CONFIG_PPC_EARLY_DEBUG_EHV_BC_HANDLE, |
1984 | &count, &data); |
1985 | } while (ret == EV_EAGAIN); |
1986 | } |
1987 | @@ -224,7 +239,7 @@ static int ehv_bc_console_byte_channel_send(unsigned int handle, const char *s, |
1988 | while (count) { |
1989 | len = min_t(unsigned int, count, EV_BYTE_CHANNEL_MAX_BYTES); |
1990 | do { |
1991 | - ret = ev_byte_channel_send(handle, &len, s); |
1992 | + ret = local_ev_byte_channel_send(handle, &len, s); |
1993 | } while (ret == EV_EAGAIN); |
1994 | count -= len; |
1995 | s += len; |
1996 | @@ -404,7 +419,7 @@ static void ehv_bc_tx_dequeue(struct ehv_bc_data *bc) |
1997 | CIRC_CNT_TO_END(bc->head, bc->tail, BUF_SIZE), |
1998 | EV_BYTE_CHANNEL_MAX_BYTES); |
1999 | |
2000 | - ret = ev_byte_channel_send(bc->handle, &len, bc->buf + bc->tail); |
2001 | + ret = local_ev_byte_channel_send(bc->handle, &len, bc->buf + bc->tail); |
2002 | |
2003 | /* 'len' is valid only if the return code is 0 or EV_EAGAIN */ |
2004 | if (!ret || (ret == EV_EAGAIN)) |
2005 | diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c |
2006 | index 3a0452ff1a56..2e545d025030 100644 |
2007 | --- a/drivers/usb/gadget/composite.c |
2008 | +++ b/drivers/usb/gadget/composite.c |
2009 | @@ -842,6 +842,11 @@ static int set_config(struct usb_composite_dev *cdev, |
2010 | else |
2011 | power = min(power, 900U); |
2012 | done: |
2013 | + if (power <= USB_SELF_POWER_VBUS_MAX_DRAW) |
2014 | + usb_gadget_set_selfpowered(gadget); |
2015 | + else |
2016 | + usb_gadget_clear_selfpowered(gadget); |
2017 | + |
2018 | usb_gadget_vbus_draw(gadget, power); |
2019 | if (result >= 0 && cdev->delayed_status) |
2020 | result = USB_GADGET_DELAYED_STATUS; |
2021 | @@ -2273,6 +2278,7 @@ void composite_suspend(struct usb_gadget *gadget) |
2022 | |
2023 | cdev->suspended = 1; |
2024 | |
2025 | + usb_gadget_set_selfpowered(gadget); |
2026 | usb_gadget_vbus_draw(gadget, 2); |
2027 | } |
2028 | |
2029 | @@ -2301,6 +2307,9 @@ void composite_resume(struct usb_gadget *gadget) |
2030 | else |
2031 | maxpower = min(maxpower, 900U); |
2032 | |
2033 | + if (maxpower > USB_SELF_POWER_VBUS_MAX_DRAW) |
2034 | + usb_gadget_clear_selfpowered(gadget); |
2035 | + |
2036 | usb_gadget_vbus_draw(gadget, maxpower); |
2037 | } |
2038 | |
2039 | diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c |
2040 | index b5747f1270a6..223b28cbf3c8 100644 |
2041 | --- a/drivers/usb/gadget/function/f_fs.c |
2042 | +++ b/drivers/usb/gadget/function/f_fs.c |
2043 | @@ -1036,6 +1036,7 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) |
2044 | |
2045 | ret = usb_ep_queue(ep->ep, req, GFP_ATOMIC); |
2046 | if (unlikely(ret)) { |
2047 | + io_data->req = NULL; |
2048 | usb_ep_free_request(ep->ep, req); |
2049 | goto error_lock; |
2050 | } |
2051 | diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c |
2052 | index c928190666ac..ae623cd04d6c 100644 |
2053 | --- a/drivers/video/fbdev/core/fbmem.c |
2054 | +++ b/drivers/video/fbdev/core/fbmem.c |
2055 | @@ -1132,7 +1132,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd, |
2056 | case FBIOGET_FSCREENINFO: |
2057 | if (!lock_fb_info(info)) |
2058 | return -ENODEV; |
2059 | - fix = info->fix; |
2060 | + memcpy(&fix, &info->fix, sizeof(fix)); |
2061 | unlock_fb_info(info); |
2062 | |
2063 | ret = copy_to_user(argp, &fix, sizeof(fix)) ? -EFAULT : 0; |
2064 | diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c |
2065 | index 20f7234e809e..c43b951cfb25 100644 |
2066 | --- a/drivers/video/fbdev/sis/init301.c |
2067 | +++ b/drivers/video/fbdev/sis/init301.c |
2068 | @@ -522,9 +522,7 @@ SiS_PanelDelay(struct SiS_Private *SiS_Pr, unsigned short DelayTime) |
2069 | SiS_DDC2Delay(SiS_Pr, 0x4000); |
2070 | } |
2071 | |
2072 | - } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* || |
2073 | - (SiS_Pr->SiS_CustomT == CUT_COMPAQ1280) || |
2074 | - (SiS_Pr->SiS_CustomT == CUT_CLEVO1400) */ ) { /* 315 series, LVDS; Special */ |
2075 | + } else if (SiS_Pr->SiS_IF_DEF_LVDS == 1) { /* 315 series, LVDS; Special */ |
2076 | |
2077 | if(SiS_Pr->SiS_IF_DEF_CH70xx == 0) { |
2078 | PanelID = SiS_GetReg(SiS_Pr->SiS_P3d4,0x36); |
2079 | diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c |
2080 | index a3de11d52ad0..5456937836b8 100644 |
2081 | --- a/fs/btrfs/async-thread.c |
2082 | +++ b/fs/btrfs/async-thread.c |
2083 | @@ -447,3 +447,11 @@ void btrfs_set_work_high_priority(struct btrfs_work *work) |
2084 | { |
2085 | set_bit(WORK_HIGH_PRIO_BIT, &work->flags); |
2086 | } |
2087 | + |
2088 | +void btrfs_flush_workqueue(struct btrfs_workqueue *wq) |
2089 | +{ |
2090 | + if (wq->high) |
2091 | + flush_workqueue(wq->high->normal_wq); |
2092 | + |
2093 | + flush_workqueue(wq->normal->normal_wq); |
2094 | +} |
2095 | diff --git a/fs/btrfs/async-thread.h b/fs/btrfs/async-thread.h |
2096 | index 1f9597355c9d..a0f6986806a4 100644 |
2097 | --- a/fs/btrfs/async-thread.h |
2098 | +++ b/fs/btrfs/async-thread.h |
2099 | @@ -85,4 +85,6 @@ void btrfs_set_work_high_priority(struct btrfs_work *work); |
2100 | struct btrfs_fs_info *btrfs_work_owner(struct btrfs_work *work); |
2101 | struct btrfs_fs_info *btrfs_workqueue_owner(struct __btrfs_workqueue *wq); |
2102 | bool btrfs_workqueue_normal_congested(struct btrfs_workqueue *wq); |
2103 | +void btrfs_flush_workqueue(struct btrfs_workqueue *wq); |
2104 | + |
2105 | #endif |
2106 | diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c |
2107 | index 390053557d4d..1de017051928 100644 |
2108 | --- a/fs/btrfs/disk-io.c |
2109 | +++ b/fs/btrfs/disk-io.c |
2110 | @@ -3825,6 +3825,19 @@ void close_ctree(struct btrfs_root *root) |
2111 | */ |
2112 | btrfs_delete_unused_bgs(root->fs_info); |
2113 | |
2114 | + /* |
2115 | + * There might be existing delayed inode workers still running |
2116 | + * and holding an empty delayed inode item. We must wait for |
2117 | + * them to complete first because they can create a transaction. |
2118 | + * This happens when someone calls btrfs_balance_delayed_items() |
2119 | + * and then a transaction commit runs the same delayed nodes |
2120 | + * before any delayed worker has done something with the nodes. |
2121 | + * We must wait for any worker here and not at transaction |
2122 | + * commit time since that could cause a deadlock. |
2123 | + * This is a very rare case. |
2124 | + */ |
2125 | + btrfs_flush_workqueue(fs_info->delayed_workers); |
2126 | + |
2127 | ret = btrfs_commit_super(root); |
2128 | if (ret) |
2129 | btrfs_err(fs_info, "commit super ret %d", ret); |
2130 | diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c |
2131 | index b106d365257d..1003b983a8d7 100644 |
2132 | --- a/fs/btrfs/relocation.c |
2133 | +++ b/fs/btrfs/relocation.c |
2134 | @@ -537,8 +537,8 @@ static int should_ignore_root(struct btrfs_root *root) |
2135 | if (!reloc_root) |
2136 | return 0; |
2137 | |
2138 | - if (btrfs_root_last_snapshot(&reloc_root->root_item) == |
2139 | - root->fs_info->running_transaction->transid - 1) |
2140 | + if (btrfs_header_generation(reloc_root->commit_root) == |
2141 | + root->fs_info->running_transaction->transid) |
2142 | return 0; |
2143 | /* |
2144 | * if there is reloc tree and it was created in previous |
2145 | @@ -1185,7 +1185,7 @@ out: |
2146 | free_backref_node(cache, lower); |
2147 | } |
2148 | |
2149 | - free_backref_node(cache, node); |
2150 | + remove_backref_node(cache, node); |
2151 | return ERR_PTR(err); |
2152 | } |
2153 | ASSERT(!node || !node->detached); |
2154 | @@ -1296,7 +1296,7 @@ static int __must_check __add_reloc_root(struct btrfs_root *root) |
2155 | if (!node) |
2156 | return -ENOMEM; |
2157 | |
2158 | - node->bytenr = root->node->start; |
2159 | + node->bytenr = root->commit_root->start; |
2160 | node->data = root; |
2161 | |
2162 | spin_lock(&rc->reloc_root_tree.lock); |
2163 | @@ -1328,10 +1328,11 @@ static void __del_reloc_root(struct btrfs_root *root) |
2164 | if (rc && root->node) { |
2165 | spin_lock(&rc->reloc_root_tree.lock); |
2166 | rb_node = tree_search(&rc->reloc_root_tree.rb_root, |
2167 | - root->node->start); |
2168 | + root->commit_root->start); |
2169 | if (rb_node) { |
2170 | node = rb_entry(rb_node, struct mapping_node, rb_node); |
2171 | rb_erase(&node->rb_node, &rc->reloc_root_tree.rb_root); |
2172 | + RB_CLEAR_NODE(&node->rb_node); |
2173 | } |
2174 | spin_unlock(&rc->reloc_root_tree.lock); |
2175 | if (!node) |
2176 | @@ -1349,7 +1350,7 @@ static void __del_reloc_root(struct btrfs_root *root) |
2177 | * helper to update the 'address of tree root -> reloc tree' |
2178 | * mapping |
2179 | */ |
2180 | -static int __update_reloc_root(struct btrfs_root *root, u64 new_bytenr) |
2181 | +static int __update_reloc_root(struct btrfs_root *root) |
2182 | { |
2183 | struct rb_node *rb_node; |
2184 | struct mapping_node *node = NULL; |
2185 | @@ -1357,7 +1358,7 @@ static int __update_reloc_root(struct btrfs_root *root, u64 new_bytenr) |
2186 | |
2187 | spin_lock(&rc->reloc_root_tree.lock); |
2188 | rb_node = tree_search(&rc->reloc_root_tree.rb_root, |
2189 | - root->node->start); |
2190 | + root->commit_root->start); |
2191 | if (rb_node) { |
2192 | node = rb_entry(rb_node, struct mapping_node, rb_node); |
2193 | rb_erase(&node->rb_node, &rc->reloc_root_tree.rb_root); |
2194 | @@ -1369,7 +1370,7 @@ static int __update_reloc_root(struct btrfs_root *root, u64 new_bytenr) |
2195 | BUG_ON((struct btrfs_root *)node->data != root); |
2196 | |
2197 | spin_lock(&rc->reloc_root_tree.lock); |
2198 | - node->bytenr = new_bytenr; |
2199 | + node->bytenr = root->node->start; |
2200 | rb_node = tree_insert(&rc->reloc_root_tree.rb_root, |
2201 | node->bytenr, &node->rb_node); |
2202 | spin_unlock(&rc->reloc_root_tree.lock); |
2203 | @@ -1519,6 +1520,7 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans, |
2204 | } |
2205 | |
2206 | if (reloc_root->commit_root != reloc_root->node) { |
2207 | + __update_reloc_root(reloc_root); |
2208 | btrfs_set_root_node(root_item, reloc_root->node); |
2209 | free_extent_buffer(reloc_root->commit_root); |
2210 | reloc_root->commit_root = btrfs_root_node(reloc_root); |
2211 | @@ -2457,7 +2459,21 @@ out: |
2212 | free_reloc_roots(&reloc_roots); |
2213 | } |
2214 | |
2215 | - BUG_ON(!RB_EMPTY_ROOT(&rc->reloc_root_tree.rb_root)); |
2216 | + /* |
2217 | + * We used to have |
2218 | + * |
2219 | + * BUG_ON(!RB_EMPTY_ROOT(&rc->reloc_root_tree.rb_root)); |
2220 | + * |
2221 | + * here, but it's wrong. If we fail to start the transaction in |
2222 | + * prepare_to_merge() we will have only 0 ref reloc roots, none of which |
2223 | + * have actually been removed from the reloc_root_tree rb tree. This is |
2224 | + * fine because we're bailing here, and we hold a reference on the root |
2225 | + * for the list that holds it, so these roots will be cleaned up when we |
2226 | + * do the reloc_dirty_list afterwards. Meanwhile the root->reloc_root |
2227 | + * will be cleaned up on unmount. |
2228 | + * |
2229 | + * The remaining nodes will be cleaned up by free_reloc_control. |
2230 | + */ |
2231 | } |
2232 | |
2233 | static void free_block_list(struct rb_root *blocks) |
2234 | @@ -4703,11 +4719,6 @@ int btrfs_reloc_cow_block(struct btrfs_trans_handle *trans, |
2235 | BUG_ON(rc->stage == UPDATE_DATA_PTRS && |
2236 | root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID); |
2237 | |
2238 | - if (root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) { |
2239 | - if (buf == root->node) |
2240 | - __update_reloc_root(root, cow->start); |
2241 | - } |
2242 | - |
2243 | level = btrfs_header_level(buf); |
2244 | if (btrfs_header_generation(buf) <= |
2245 | btrfs_root_last_snapshot(&root->root_item)) |
2246 | diff --git a/fs/exec.c b/fs/exec.c |
2247 | index 820d7f3b25e8..bb03b98fd03b 100644 |
2248 | --- a/fs/exec.c |
2249 | +++ b/fs/exec.c |
2250 | @@ -1353,7 +1353,7 @@ void setup_new_exec(struct linux_binprm * bprm) |
2251 | |
2252 | /* An exec changes our domain. We are no longer part of the thread |
2253 | group */ |
2254 | - current->self_exec_id++; |
2255 | + WRITE_ONCE(current->self_exec_id, current->self_exec_id + 1); |
2256 | flush_signal_handlers(current, 0); |
2257 | } |
2258 | EXPORT_SYMBOL(setup_new_exec); |
2259 | diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c |
2260 | index babef30d440b..c8679b583561 100644 |
2261 | --- a/fs/ext2/xattr.c |
2262 | +++ b/fs/ext2/xattr.c |
2263 | @@ -55,6 +55,7 @@ |
2264 | |
2265 | #include <linux/buffer_head.h> |
2266 | #include <linux/init.h> |
2267 | +#include <linux/printk.h> |
2268 | #include <linux/slab.h> |
2269 | #include <linux/mbcache.h> |
2270 | #include <linux/quotaops.h> |
2271 | @@ -83,8 +84,8 @@ |
2272 | printk("\n"); \ |
2273 | } while (0) |
2274 | #else |
2275 | -# define ea_idebug(f...) |
2276 | -# define ea_bdebug(f...) |
2277 | +# define ea_idebug(inode, f...) no_printk(f) |
2278 | +# define ea_bdebug(bh, f...) no_printk(f) |
2279 | #endif |
2280 | |
2281 | static int ext2_xattr_set2(struct inode *, struct buffer_head *, |
2282 | @@ -835,8 +836,7 @@ ext2_xattr_cache_insert(struct mb_cache *cache, struct buffer_head *bh) |
2283 | error = mb_cache_entry_create(cache, GFP_NOFS, hash, bh->b_blocknr, 1); |
2284 | if (error) { |
2285 | if (error == -EBUSY) { |
2286 | - ea_bdebug(bh, "already in cache (%d cache entries)", |
2287 | - atomic_read(&ext2_xattr_cache->c_entry_count)); |
2288 | + ea_bdebug(bh, "already in cache"); |
2289 | error = 0; |
2290 | } |
2291 | } else |
2292 | diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c |
2293 | index 71c68bd302c5..999d2a54297d 100644 |
2294 | --- a/fs/ext4/extents.c |
2295 | +++ b/fs/ext4/extents.c |
2296 | @@ -3445,8 +3445,8 @@ static int ext4_ext_convert_to_initialized(handle_t *handle, |
2297 | (unsigned long long)map->m_lblk, map_len); |
2298 | |
2299 | sbi = EXT4_SB(inode->i_sb); |
2300 | - eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >> |
2301 | - inode->i_sb->s_blocksize_bits; |
2302 | + eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1) |
2303 | + >> inode->i_sb->s_blocksize_bits; |
2304 | if (eof_block < map->m_lblk + map_len) |
2305 | eof_block = map->m_lblk + map_len; |
2306 | |
2307 | @@ -3701,8 +3701,8 @@ static int ext4_split_convert_extents(handle_t *handle, |
2308 | __func__, inode->i_ino, |
2309 | (unsigned long long)map->m_lblk, map->m_len); |
2310 | |
2311 | - eof_block = (inode->i_size + inode->i_sb->s_blocksize - 1) >> |
2312 | - inode->i_sb->s_blocksize_bits; |
2313 | + eof_block = (EXT4_I(inode)->i_disksize + inode->i_sb->s_blocksize - 1) |
2314 | + >> inode->i_sb->s_blocksize_bits; |
2315 | if (eof_block < map->m_lblk + map->m_len) |
2316 | eof_block = map->m_lblk + map->m_len; |
2317 | /* |
2318 | diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c |
2319 | index 911a49e861d2..45bcde1969e3 100644 |
2320 | --- a/fs/ext4/inode.c |
2321 | +++ b/fs/ext4/inode.c |
2322 | @@ -4754,7 +4754,7 @@ static int ext4_inode_blocks_set(handle_t *handle, |
2323 | struct ext4_inode_info *ei) |
2324 | { |
2325 | struct inode *inode = &(ei->vfs_inode); |
2326 | - u64 i_blocks = inode->i_blocks; |
2327 | + u64 i_blocks = READ_ONCE(inode->i_blocks); |
2328 | struct super_block *sb = inode->i_sb; |
2329 | |
2330 | if (i_blocks <= ~0U) { |
2331 | diff --git a/fs/ext4/super.c b/fs/ext4/super.c |
2332 | index 75f71e52ffc7..ed0520fe4dad 100644 |
2333 | --- a/fs/ext4/super.c |
2334 | +++ b/fs/ext4/super.c |
2335 | @@ -344,7 +344,8 @@ static void save_error_info(struct super_block *sb, const char *func, |
2336 | unsigned int line) |
2337 | { |
2338 | __save_error_info(sb, func, line); |
2339 | - ext4_commit_super(sb, 1); |
2340 | + if (!bdev_read_only(sb->s_bdev)) |
2341 | + ext4_commit_super(sb, 1); |
2342 | } |
2343 | |
2344 | /* |
2345 | @@ -3820,7 +3821,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) |
2346 | if (sbi->s_inodes_per_group < sbi->s_inodes_per_block || |
2347 | sbi->s_inodes_per_group > blocksize * 8) { |
2348 | ext4_msg(sb, KERN_ERR, "invalid inodes per group: %lu\n", |
2349 | - sbi->s_blocks_per_group); |
2350 | + sbi->s_inodes_per_group); |
2351 | goto failed_mount; |
2352 | } |
2353 | sbi->s_itb_per_group = sbi->s_inodes_per_group / |
2354 | @@ -3951,9 +3952,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) |
2355 | EXT4_BLOCKS_PER_GROUP(sb) - 1); |
2356 | do_div(blocks_count, EXT4_BLOCKS_PER_GROUP(sb)); |
2357 | if (blocks_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) { |
2358 | - ext4_msg(sb, KERN_WARNING, "groups count too large: %u " |
2359 | + ext4_msg(sb, KERN_WARNING, "groups count too large: %llu " |
2360 | "(block count %llu, first data block %u, " |
2361 | - "blocks per group %lu)", sbi->s_groups_count, |
2362 | + "blocks per group %lu)", blocks_count, |
2363 | ext4_blocks_count(es), |
2364 | le32_to_cpu(es->s_first_data_block), |
2365 | EXT4_BLOCKS_PER_GROUP(sb)); |
2366 | diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c |
2367 | index efd44d5645d8..adc1a97cfe96 100644 |
2368 | --- a/fs/gfs2/glock.c |
2369 | +++ b/fs/gfs2/glock.c |
2370 | @@ -548,6 +548,9 @@ __acquires(&gl->gl_lockref.lock) |
2371 | goto out_unlock; |
2372 | if (nonblock) |
2373 | goto out_sched; |
2374 | + smp_mb(); |
2375 | + if (atomic_read(&gl->gl_revokes) != 0) |
2376 | + goto out_sched; |
2377 | set_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags); |
2378 | GLOCK_BUG_ON(gl, gl->gl_demote_state == LM_ST_EXCLUSIVE); |
2379 | gl->gl_target = gl->gl_demote_state; |
2380 | diff --git a/fs/hfsplus/attributes.c b/fs/hfsplus/attributes.c |
2381 | index d7455ea70287..0c4548d8cd0b 100644 |
2382 | --- a/fs/hfsplus/attributes.c |
2383 | +++ b/fs/hfsplus/attributes.c |
2384 | @@ -291,6 +291,10 @@ static int __hfsplus_delete_attr(struct inode *inode, u32 cnid, |
2385 | return -ENOENT; |
2386 | } |
2387 | |
2388 | + /* Avoid btree corruption */ |
2389 | + hfs_bnode_read(fd->bnode, fd->search_key, |
2390 | + fd->keyoffset, fd->keylength); |
2391 | + |
2392 | err = hfs_brec_remove(fd); |
2393 | if (err) |
2394 | return err; |
2395 | diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c |
2396 | index 1d06f81ee8b4..f65ad50d5f7b 100644 |
2397 | --- a/fs/jbd2/commit.c |
2398 | +++ b/fs/jbd2/commit.c |
2399 | @@ -990,9 +990,10 @@ restart_loop: |
2400 | * journalled data) we need to unmap buffer and clear |
2401 | * more bits. We also need to be careful about the check |
2402 | * because the data page mapping can get cleared under |
2403 | - * out hands, which alse need not to clear more bits |
2404 | - * because the page and buffers will be freed and can |
2405 | - * never be reused once we are done with them. |
2406 | + * our hands. Note that if mapping == NULL, we don't |
2407 | + * need to make buffer unmapped because the page is |
2408 | + * already detached from the mapping and buffers cannot |
2409 | + * get reused. |
2410 | */ |
2411 | mapping = READ_ONCE(bh->b_page->mapping); |
2412 | if (mapping && !sb_is_blkdev_sb(mapping->host->i_sb)) { |
2413 | diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c |
2414 | index 53f0012ace42..de135d2591ff 100644 |
2415 | --- a/fs/nfs/direct.c |
2416 | +++ b/fs/nfs/direct.c |
2417 | @@ -595,6 +595,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, struct iov_iter *iter) |
2418 | l_ctx = nfs_get_lock_context(dreq->ctx); |
2419 | if (IS_ERR(l_ctx)) { |
2420 | result = PTR_ERR(l_ctx); |
2421 | + nfs_direct_req_release(dreq); |
2422 | goto out_release; |
2423 | } |
2424 | dreq->l_ctx = l_ctx; |
2425 | @@ -1019,6 +1020,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter) |
2426 | l_ctx = nfs_get_lock_context(dreq->ctx); |
2427 | if (IS_ERR(l_ctx)) { |
2428 | result = PTR_ERR(l_ctx); |
2429 | + nfs_direct_req_release(dreq); |
2430 | goto out_release; |
2431 | } |
2432 | dreq->l_ctx = l_ctx; |
2433 | diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c |
2434 | index b6e25126a0b0..529f3a576263 100644 |
2435 | --- a/fs/nfs/pagelist.c |
2436 | +++ b/fs/nfs/pagelist.c |
2437 | @@ -851,15 +851,6 @@ static int nfs_pageio_setup_mirroring(struct nfs_pageio_descriptor *pgio, |
2438 | return 0; |
2439 | } |
2440 | |
2441 | -/* |
2442 | - * nfs_pageio_stop_mirroring - stop using mirroring (set mirror count to 1) |
2443 | - */ |
2444 | -void nfs_pageio_stop_mirroring(struct nfs_pageio_descriptor *pgio) |
2445 | -{ |
2446 | - pgio->pg_mirror_count = 1; |
2447 | - pgio->pg_mirror_idx = 0; |
2448 | -} |
2449 | - |
2450 | static void nfs_pageio_cleanup_mirroring(struct nfs_pageio_descriptor *pgio) |
2451 | { |
2452 | pgio->pg_mirror_count = 1; |
2453 | @@ -1285,6 +1276,14 @@ void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *desc, pgoff_t index) |
2454 | } |
2455 | } |
2456 | |
2457 | +/* |
2458 | + * nfs_pageio_stop_mirroring - stop using mirroring (set mirror count to 1) |
2459 | + */ |
2460 | +void nfs_pageio_stop_mirroring(struct nfs_pageio_descriptor *pgio) |
2461 | +{ |
2462 | + nfs_pageio_complete(pgio); |
2463 | +} |
2464 | + |
2465 | int __init nfs_init_nfspagecache(void) |
2466 | { |
2467 | nfs_page_cachep = kmem_cache_create("nfs_page", |
2468 | diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c |
2469 | index 06089becca60..dfb8a923921e 100644 |
2470 | --- a/fs/ocfs2/alloc.c |
2471 | +++ b/fs/ocfs2/alloc.c |
2472 | @@ -7246,6 +7246,10 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh, |
2473 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; |
2474 | struct ocfs2_inline_data *idata = &di->id2.i_data; |
2475 | |
2476 | + /* No need to punch hole beyond i_size. */ |
2477 | + if (start >= i_size_read(inode)) |
2478 | + return 0; |
2479 | + |
2480 | if (end > i_size_read(inode)) |
2481 | end = i_size_read(inode); |
2482 | |
2483 | diff --git a/include/linux/compiler.h b/include/linux/compiler.h |
2484 | index 0020ee1cab37..7837afabbd78 100644 |
2485 | --- a/include/linux/compiler.h |
2486 | +++ b/include/linux/compiler.h |
2487 | @@ -546,7 +546,7 @@ unsigned long read_word_at_a_time(const void *addr) |
2488 | * compiler has support to do so. |
2489 | */ |
2490 | #define compiletime_assert(condition, msg) \ |
2491 | - _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) |
2492 | + _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) |
2493 | |
2494 | #define compiletime_assert_atomic_type(t) \ |
2495 | compiletime_assert(__native_word(t), \ |
2496 | diff --git a/include/linux/devfreq_cooling.h b/include/linux/devfreq_cooling.h |
2497 | index 7adf6cc4b305..633346b84cae 100644 |
2498 | --- a/include/linux/devfreq_cooling.h |
2499 | +++ b/include/linux/devfreq_cooling.h |
2500 | @@ -53,7 +53,7 @@ void devfreq_cooling_unregister(struct thermal_cooling_device *dfc); |
2501 | |
2502 | #else /* !CONFIG_DEVFREQ_THERMAL */ |
2503 | |
2504 | -struct thermal_cooling_device * |
2505 | +static inline struct thermal_cooling_device * |
2506 | of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df, |
2507 | struct devfreq_cooling_power *dfc_power) |
2508 | { |
2509 | diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h |
2510 | index 84a109449610..b6332cb761a4 100644 |
2511 | --- a/include/linux/percpu_counter.h |
2512 | +++ b/include/linux/percpu_counter.h |
2513 | @@ -76,9 +76,9 @@ static inline s64 percpu_counter_read(struct percpu_counter *fbc) |
2514 | */ |
2515 | static inline s64 percpu_counter_read_positive(struct percpu_counter *fbc) |
2516 | { |
2517 | - s64 ret = fbc->count; |
2518 | + /* Prevent reloads of fbc->count */ |
2519 | + s64 ret = READ_ONCE(fbc->count); |
2520 | |
2521 | - barrier(); /* Prevent reloads of fbc->count */ |
2522 | if (ret >= 0) |
2523 | return ret; |
2524 | return 0; |
2525 | diff --git a/include/linux/sched.h b/include/linux/sched.h |
2526 | index 275511b60978..1872d4e9acbe 100644 |
2527 | --- a/include/linux/sched.h |
2528 | +++ b/include/linux/sched.h |
2529 | @@ -1720,8 +1720,8 @@ struct task_struct { |
2530 | struct seccomp seccomp; |
2531 | |
2532 | /* Thread group tracking */ |
2533 | - u32 parent_exec_id; |
2534 | - u32 self_exec_id; |
2535 | + u64 parent_exec_id; |
2536 | + u64 self_exec_id; |
2537 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings, mems_allowed, |
2538 | * mempolicy */ |
2539 | spinlock_t alloc_lock; |
2540 | diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h |
2541 | index 2c43993e079c..e45b6286983c 100644 |
2542 | --- a/include/net/ip6_route.h |
2543 | +++ b/include/net/ip6_route.h |
2544 | @@ -195,6 +195,7 @@ static inline bool ipv6_anycast_destination(const struct dst_entry *dst, |
2545 | |
2546 | return rt->rt6i_flags & RTF_ANYCAST || |
2547 | (rt->rt6i_dst.plen != 128 && |
2548 | + !(rt->rt6i_flags & (RTF_GATEWAY | RTF_NONEXTHOP)) && |
2549 | ipv6_addr_equal(&rt->rt6i_dst.addr, daddr)); |
2550 | } |
2551 | |
2552 | diff --git a/include/target/iscsi/iscsi_target_core.h b/include/target/iscsi/iscsi_target_core.h |
2553 | index 6021c3acb6c5..b1814d2762bd 100644 |
2554 | --- a/include/target/iscsi/iscsi_target_core.h |
2555 | +++ b/include/target/iscsi/iscsi_target_core.h |
2556 | @@ -671,7 +671,7 @@ struct iscsi_session { |
2557 | atomic_t session_logout; |
2558 | atomic_t session_reinstatement; |
2559 | atomic_t session_stop_active; |
2560 | - atomic_t sleep_on_sess_wait_comp; |
2561 | + atomic_t session_close; |
2562 | /* connection list */ |
2563 | struct list_head sess_conn_list; |
2564 | struct list_head cr_active_list; |
2565 | diff --git a/kernel/cpu.c b/kernel/cpu.c |
2566 | index 1fbe93fefc1f..a542b5e58350 100644 |
2567 | --- a/kernel/cpu.c |
2568 | +++ b/kernel/cpu.c |
2569 | @@ -2027,10 +2027,8 @@ int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) |
2570 | */ |
2571 | cpuhp_offline_cpu_device(cpu); |
2572 | } |
2573 | - if (!ret) { |
2574 | + if (!ret) |
2575 | cpu_smt_control = ctrlval; |
2576 | - arch_smt_update(); |
2577 | - } |
2578 | cpu_maps_update_done(); |
2579 | return ret; |
2580 | } |
2581 | @@ -2041,7 +2039,6 @@ int cpuhp_smt_enable(void) |
2582 | |
2583 | cpu_maps_update_begin(); |
2584 | cpu_smt_control = CPU_SMT_ENABLED; |
2585 | - arch_smt_update(); |
2586 | for_each_present_cpu(cpu) { |
2587 | /* Skip online CPUs and CPUs on offline nodes */ |
2588 | if (cpu_online(cpu) || !node_online(cpu_to_node(cpu))) |
2589 | diff --git a/kernel/kmod.c b/kernel/kmod.c |
2590 | index 0277d1216f80..e4e5e98002fe 100644 |
2591 | --- a/kernel/kmod.c |
2592 | +++ b/kernel/kmod.c |
2593 | @@ -119,7 +119,7 @@ out: |
2594 | * invoke it. |
2595 | * |
2596 | * If module auto-loading support is disabled then this function |
2597 | - * becomes a no-operation. |
2598 | + * simply returns -ENOENT. |
2599 | */ |
2600 | int __request_module(bool wait, const char *fmt, ...) |
2601 | { |
2602 | @@ -140,7 +140,7 @@ int __request_module(bool wait, const char *fmt, ...) |
2603 | WARN_ON_ONCE(wait && current_is_async()); |
2604 | |
2605 | if (!modprobe_path[0]) |
2606 | - return 0; |
2607 | + return -ENOENT; |
2608 | |
2609 | va_start(args, fmt); |
2610 | ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args); |
2611 | diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c |
2612 | index d7f425698a4a..9f56e3fac795 100644 |
2613 | --- a/kernel/locking/lockdep.c |
2614 | +++ b/kernel/locking/lockdep.c |
2615 | @@ -1241,9 +1241,11 @@ unsigned long lockdep_count_forward_deps(struct lock_class *class) |
2616 | this.class = class; |
2617 | |
2618 | raw_local_irq_save(flags); |
2619 | + current->lockdep_recursion = 1; |
2620 | arch_spin_lock(&lockdep_lock); |
2621 | ret = __lockdep_count_forward_deps(&this); |
2622 | arch_spin_unlock(&lockdep_lock); |
2623 | + current->lockdep_recursion = 0; |
2624 | raw_local_irq_restore(flags); |
2625 | |
2626 | return ret; |
2627 | @@ -1268,9 +1270,11 @@ unsigned long lockdep_count_backward_deps(struct lock_class *class) |
2628 | this.class = class; |
2629 | |
2630 | raw_local_irq_save(flags); |
2631 | + current->lockdep_recursion = 1; |
2632 | arch_spin_lock(&lockdep_lock); |
2633 | ret = __lockdep_count_backward_deps(&this); |
2634 | arch_spin_unlock(&lockdep_lock); |
2635 | + current->lockdep_recursion = 0; |
2636 | raw_local_irq_restore(flags); |
2637 | |
2638 | return ret; |
2639 | diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c |
2640 | index babc67cfed69..b0e41c312c15 100644 |
2641 | --- a/kernel/locking/locktorture.c |
2642 | +++ b/kernel/locking/locktorture.c |
2643 | @@ -649,10 +649,10 @@ static void __torture_print_stats(char *page, |
2644 | if (statp[i].n_lock_fail) |
2645 | fail = true; |
2646 | sum += statp[i].n_lock_acquired; |
2647 | - if (max < statp[i].n_lock_fail) |
2648 | - max = statp[i].n_lock_fail; |
2649 | - if (min > statp[i].n_lock_fail) |
2650 | - min = statp[i].n_lock_fail; |
2651 | + if (max < statp[i].n_lock_acquired) |
2652 | + max = statp[i].n_lock_acquired; |
2653 | + if (min > statp[i].n_lock_acquired) |
2654 | + min = statp[i].n_lock_acquired; |
2655 | } |
2656 | page += sprintf(page, |
2657 | "%s: Total: %lld Max/Min: %ld/%ld %s Fail: %d %s\n", |
2658 | diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h |
2659 | index 15c08752926b..819bd5fb0264 100644 |
2660 | --- a/kernel/sched/sched.h |
2661 | +++ b/kernel/sched/sched.h |
2662 | @@ -73,7 +73,13 @@ static inline void update_idle_core(struct rq *rq) { } |
2663 | #ifdef CONFIG_64BIT |
2664 | # define NICE_0_LOAD_SHIFT (SCHED_FIXEDPOINT_SHIFT + SCHED_FIXEDPOINT_SHIFT) |
2665 | # define scale_load(w) ((w) << SCHED_FIXEDPOINT_SHIFT) |
2666 | -# define scale_load_down(w) ((w) >> SCHED_FIXEDPOINT_SHIFT) |
2667 | +# define scale_load_down(w) \ |
2668 | +({ \ |
2669 | + unsigned long __w = (w); \ |
2670 | + if (__w) \ |
2671 | + __w = max(2UL, __w >> SCHED_FIXEDPOINT_SHIFT); \ |
2672 | + __w; \ |
2673 | +}) |
2674 | #else |
2675 | # define NICE_0_LOAD_SHIFT (SCHED_FIXEDPOINT_SHIFT) |
2676 | # define scale_load(w) (w) |
2677 | diff --git a/kernel/signal.c b/kernel/signal.c |
2678 | index d90ccbeb909d..bedca1629f26 100644 |
2679 | --- a/kernel/signal.c |
2680 | +++ b/kernel/signal.c |
2681 | @@ -1660,7 +1660,7 @@ bool do_notify_parent(struct task_struct *tsk, int sig) |
2682 | * This is only possible if parent == real_parent. |
2683 | * Check if it has changed security domain. |
2684 | */ |
2685 | - if (tsk->parent_exec_id != tsk->parent->self_exec_id) |
2686 | + if (tsk->parent_exec_id != READ_ONCE(tsk->parent->self_exec_id)) |
2687 | sig = SIGCHLD; |
2688 | } |
2689 | |
2690 | diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c |
2691 | index 8a88e85c8c61..c9ca2ed50c0e 100644 |
2692 | --- a/kernel/trace/trace_events_trigger.c |
2693 | +++ b/kernel/trace/trace_events_trigger.c |
2694 | @@ -1068,14 +1068,10 @@ register_snapshot_trigger(char *glob, struct event_trigger_ops *ops, |
2695 | struct event_trigger_data *data, |
2696 | struct trace_event_file *file) |
2697 | { |
2698 | - int ret = register_trigger(glob, ops, data, file); |
2699 | - |
2700 | - if (ret > 0 && tracing_alloc_snapshot() != 0) { |
2701 | - unregister_trigger(glob, ops, data, file); |
2702 | - ret = 0; |
2703 | - } |
2704 | + if (tracing_alloc_snapshot() != 0) |
2705 | + return 0; |
2706 | |
2707 | - return ret; |
2708 | + return register_trigger(glob, ops, data, file); |
2709 | } |
2710 | |
2711 | static int |
2712 | diff --git a/mm/page_alloc.c b/mm/page_alloc.c |
2713 | index 13a642192e12..ef710e387862 100644 |
2714 | --- a/mm/page_alloc.c |
2715 | +++ b/mm/page_alloc.c |
2716 | @@ -3955,11 +3955,11 @@ refill: |
2717 | /* Even if we own the page, we do not use atomic_set(). |
2718 | * This would break get_page_unless_zero() users. |
2719 | */ |
2720 | - page_ref_add(page, size); |
2721 | + page_ref_add(page, PAGE_FRAG_CACHE_MAX_SIZE); |
2722 | |
2723 | /* reset page count bias and offset to start of new frag */ |
2724 | nc->pfmemalloc = page_is_pfmemalloc(page); |
2725 | - nc->pagecnt_bias = size + 1; |
2726 | + nc->pagecnt_bias = PAGE_FRAG_CACHE_MAX_SIZE + 1; |
2727 | nc->offset = size; |
2728 | } |
2729 | |
2730 | @@ -3975,10 +3975,10 @@ refill: |
2731 | size = nc->size; |
2732 | #endif |
2733 | /* OK, page count is 0, we can safely set it */ |
2734 | - set_page_count(page, size + 1); |
2735 | + set_page_count(page, PAGE_FRAG_CACHE_MAX_SIZE + 1); |
2736 | |
2737 | /* reset page count bias and offset to start of new frag */ |
2738 | - nc->pagecnt_bias = size + 1; |
2739 | + nc->pagecnt_bias = PAGE_FRAG_CACHE_MAX_SIZE + 1; |
2740 | offset = size - fragsz; |
2741 | } |
2742 | |
2743 | diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c |
2744 | index 4f869d05410f..1da236db04d6 100644 |
2745 | --- a/net/hsr/hsr_netlink.c |
2746 | +++ b/net/hsr/hsr_netlink.c |
2747 | @@ -63,10 +63,15 @@ static int hsr_newlink(struct net *src_net, struct net_device *dev, |
2748 | else |
2749 | multicast_spec = nla_get_u8(data[IFLA_HSR_MULTICAST_SPEC]); |
2750 | |
2751 | - if (!data[IFLA_HSR_VERSION]) |
2752 | + if (!data[IFLA_HSR_VERSION]) { |
2753 | hsr_version = 0; |
2754 | - else |
2755 | + } else { |
2756 | hsr_version = nla_get_u8(data[IFLA_HSR_VERSION]); |
2757 | + if (hsr_version > 1) { |
2758 | + netdev_info(dev, "Only versions 0..1 are supported"); |
2759 | + return -EINVAL; |
2760 | + } |
2761 | + } |
2762 | |
2763 | return hsr_dev_finalize(dev, link, multicast_spec, hsr_version); |
2764 | } |
2765 | diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c |
2766 | index 6c873cb829ca..af3363f4543f 100644 |
2767 | --- a/net/ipv4/devinet.c |
2768 | +++ b/net/ipv4/devinet.c |
2769 | @@ -560,12 +560,15 @@ struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, |
2770 | return NULL; |
2771 | } |
2772 | |
2773 | -static int ip_mc_config(struct sock *sk, bool join, const struct in_ifaddr *ifa) |
2774 | +static int ip_mc_autojoin_config(struct net *net, bool join, |
2775 | + const struct in_ifaddr *ifa) |
2776 | { |
2777 | +#if defined(CONFIG_IP_MULTICAST) |
2778 | struct ip_mreqn mreq = { |
2779 | .imr_multiaddr.s_addr = ifa->ifa_address, |
2780 | .imr_ifindex = ifa->ifa_dev->dev->ifindex, |
2781 | }; |
2782 | + struct sock *sk = net->ipv4.mc_autojoin_sk; |
2783 | int ret; |
2784 | |
2785 | ASSERT_RTNL(); |
2786 | @@ -578,6 +581,9 @@ static int ip_mc_config(struct sock *sk, bool join, const struct in_ifaddr *ifa) |
2787 | release_sock(sk); |
2788 | |
2789 | return ret; |
2790 | +#else |
2791 | + return -EOPNOTSUPP; |
2792 | +#endif |
2793 | } |
2794 | |
2795 | static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh) |
2796 | @@ -617,7 +623,7 @@ static int inet_rtm_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh) |
2797 | continue; |
2798 | |
2799 | if (ipv4_is_multicast(ifa->ifa_address)) |
2800 | - ip_mc_config(net->ipv4.mc_autojoin_sk, false, ifa); |
2801 | + ip_mc_autojoin_config(net, false, ifa); |
2802 | __inet_del_ifa(in_dev, ifap, 1, nlh, NETLINK_CB(skb).portid); |
2803 | return 0; |
2804 | } |
2805 | @@ -873,8 +879,7 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh) |
2806 | */ |
2807 | set_ifa_lifetime(ifa, valid_lft, prefered_lft); |
2808 | if (ifa->ifa_flags & IFA_F_MCAUTOJOIN) { |
2809 | - int ret = ip_mc_config(net->ipv4.mc_autojoin_sk, |
2810 | - true, ifa); |
2811 | + int ret = ip_mc_autojoin_config(net, true, ifa); |
2812 | |
2813 | if (ret < 0) { |
2814 | inet_free_ifa(ifa); |
2815 | diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c |
2816 | index ee930b3011cc..41547c6e496a 100644 |
2817 | --- a/net/qrtr/qrtr.c |
2818 | +++ b/net/qrtr/qrtr.c |
2819 | @@ -621,20 +621,21 @@ static int qrtr_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) |
2820 | |
2821 | node = NULL; |
2822 | if (addr->sq_node == QRTR_NODE_BCAST) { |
2823 | - enqueue_fn = qrtr_bcast_enqueue; |
2824 | - if (addr->sq_port != QRTR_PORT_CTRL) { |
2825 | + if (addr->sq_port != QRTR_PORT_CTRL && |
2826 | + qrtr_local_nid != QRTR_NODE_BCAST) { |
2827 | release_sock(sk); |
2828 | return -ENOTCONN; |
2829 | } |
2830 | + enqueue_fn = qrtr_bcast_enqueue; |
2831 | } else if (addr->sq_node == ipc->us.sq_node) { |
2832 | enqueue_fn = qrtr_local_enqueue; |
2833 | } else { |
2834 | - enqueue_fn = qrtr_node_enqueue; |
2835 | node = qrtr_node_lookup(addr->sq_node); |
2836 | if (!node) { |
2837 | release_sock(sk); |
2838 | return -ECONNRESET; |
2839 | } |
2840 | + enqueue_fn = qrtr_node_enqueue; |
2841 | } |
2842 | |
2843 | plen = (len + 3) & ~3; |
2844 | diff --git a/security/keys/key.c b/security/keys/key.c |
2845 | index 280b4feccdc0..33a9c64eeed3 100644 |
2846 | --- a/security/keys/key.c |
2847 | +++ b/security/keys/key.c |
2848 | @@ -382,7 +382,7 @@ int key_payload_reserve(struct key *key, size_t datalen) |
2849 | spin_lock(&key->user->lock); |
2850 | |
2851 | if (delta > 0 && |
2852 | - (key->user->qnbytes + delta >= maxbytes || |
2853 | + (key->user->qnbytes + delta > maxbytes || |
2854 | key->user->qnbytes + delta < key->user->qnbytes)) { |
2855 | ret = -EDQUOT; |
2856 | } |
2857 | diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c |
2858 | index 797edcf1d424..2ef853bfbb8f 100644 |
2859 | --- a/security/keys/keyctl.c |
2860 | +++ b/security/keys/keyctl.c |
2861 | @@ -881,8 +881,8 @@ long keyctl_chown_key(key_serial_t id, uid_t user, gid_t group) |
2862 | key_quota_root_maxbytes : key_quota_maxbytes; |
2863 | |
2864 | spin_lock(&newowner->lock); |
2865 | - if (newowner->qnkeys + 1 >= maxkeys || |
2866 | - newowner->qnbytes + key->quotalen >= maxbytes || |
2867 | + if (newowner->qnkeys + 1 > maxkeys || |
2868 | + newowner->qnbytes + key->quotalen > maxbytes || |
2869 | newowner->qnbytes + key->quotalen < |
2870 | newowner->qnbytes) |
2871 | goto quota_overrun; |
2872 | diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c |
2873 | index 0e3dd6014ce5..7c5d124d538c 100644 |
2874 | --- a/sound/core/oss/pcm_plugin.c |
2875 | +++ b/sound/core/oss/pcm_plugin.c |
2876 | @@ -196,7 +196,9 @@ int snd_pcm_plugin_free(struct snd_pcm_plugin *plugin) |
2877 | return 0; |
2878 | } |
2879 | |
2880 | -snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_pcm_uframes_t drv_frames) |
2881 | +static snd_pcm_sframes_t plug_client_size(struct snd_pcm_substream *plug, |
2882 | + snd_pcm_uframes_t drv_frames, |
2883 | + bool check_size) |
2884 | { |
2885 | struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next; |
2886 | int stream; |
2887 | @@ -209,7 +211,7 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p |
2888 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) { |
2889 | plugin = snd_pcm_plug_last(plug); |
2890 | while (plugin && drv_frames > 0) { |
2891 | - if (drv_frames > plugin->buf_frames) |
2892 | + if (check_size && drv_frames > plugin->buf_frames) |
2893 | drv_frames = plugin->buf_frames; |
2894 | plugin_prev = plugin->prev; |
2895 | if (plugin->src_frames) |
2896 | @@ -222,7 +224,7 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p |
2897 | plugin_next = plugin->next; |
2898 | if (plugin->dst_frames) |
2899 | drv_frames = plugin->dst_frames(plugin, drv_frames); |
2900 | - if (drv_frames > plugin->buf_frames) |
2901 | + if (check_size && drv_frames > plugin->buf_frames) |
2902 | drv_frames = plugin->buf_frames; |
2903 | plugin = plugin_next; |
2904 | } |
2905 | @@ -231,7 +233,9 @@ snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, snd_p |
2906 | return drv_frames; |
2907 | } |
2908 | |
2909 | -snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pcm_uframes_t clt_frames) |
2910 | +static snd_pcm_sframes_t plug_slave_size(struct snd_pcm_substream *plug, |
2911 | + snd_pcm_uframes_t clt_frames, |
2912 | + bool check_size) |
2913 | { |
2914 | struct snd_pcm_plugin *plugin, *plugin_prev, *plugin_next; |
2915 | snd_pcm_sframes_t frames; |
2916 | @@ -252,14 +256,14 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pc |
2917 | if (frames < 0) |
2918 | return frames; |
2919 | } |
2920 | - if (frames > plugin->buf_frames) |
2921 | + if (check_size && frames > plugin->buf_frames) |
2922 | frames = plugin->buf_frames; |
2923 | plugin = plugin_next; |
2924 | } |
2925 | } else if (stream == SNDRV_PCM_STREAM_CAPTURE) { |
2926 | plugin = snd_pcm_plug_last(plug); |
2927 | while (plugin) { |
2928 | - if (frames > plugin->buf_frames) |
2929 | + if (check_size && frames > plugin->buf_frames) |
2930 | frames = plugin->buf_frames; |
2931 | plugin_prev = plugin->prev; |
2932 | if (plugin->src_frames) { |
2933 | @@ -274,6 +278,18 @@ snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, snd_pc |
2934 | return frames; |
2935 | } |
2936 | |
2937 | +snd_pcm_sframes_t snd_pcm_plug_client_size(struct snd_pcm_substream *plug, |
2938 | + snd_pcm_uframes_t drv_frames) |
2939 | +{ |
2940 | + return plug_client_size(plug, drv_frames, false); |
2941 | +} |
2942 | + |
2943 | +snd_pcm_sframes_t snd_pcm_plug_slave_size(struct snd_pcm_substream *plug, |
2944 | + snd_pcm_uframes_t clt_frames) |
2945 | +{ |
2946 | + return plug_slave_size(plug, clt_frames, false); |
2947 | +} |
2948 | + |
2949 | static int snd_pcm_plug_formats(struct snd_mask *mask, snd_pcm_format_t format) |
2950 | { |
2951 | struct snd_mask formats = *mask; |
2952 | @@ -628,7 +644,7 @@ snd_pcm_sframes_t snd_pcm_plug_write_transfer(struct snd_pcm_substream *plug, st |
2953 | src_channels = dst_channels; |
2954 | plugin = next; |
2955 | } |
2956 | - return snd_pcm_plug_client_size(plug, frames); |
2957 | + return plug_client_size(plug, frames, true); |
2958 | } |
2959 | |
2960 | snd_pcm_sframes_t snd_pcm_plug_read_transfer(struct snd_pcm_substream *plug, struct snd_pcm_plugin_channel *dst_channels_final, snd_pcm_uframes_t size) |
2961 | @@ -638,7 +654,7 @@ snd_pcm_sframes_t snd_pcm_plug_read_transfer(struct snd_pcm_substream *plug, str |
2962 | snd_pcm_sframes_t frames = size; |
2963 | int err; |
2964 | |
2965 | - frames = snd_pcm_plug_slave_size(plug, frames); |
2966 | + frames = plug_slave_size(plug, frames, true); |
2967 | if (frames < 0) |
2968 | return frames; |
2969 | |
2970 | diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c |
2971 | index c397e7da0eac..7ccfb09535e1 100644 |
2972 | --- a/sound/pci/hda/hda_beep.c |
2973 | +++ b/sound/pci/hda/hda_beep.c |
2974 | @@ -310,8 +310,12 @@ int snd_hda_mixer_amp_switch_get_beep(struct snd_kcontrol *kcontrol, |
2975 | { |
2976 | struct hda_codec *codec = snd_kcontrol_chip(kcontrol); |
2977 | struct hda_beep *beep = codec->beep; |
2978 | + int chs = get_amp_channels(kcontrol); |
2979 | + |
2980 | if (beep && (!beep->enabled || !ctl_has_mute(kcontrol))) { |
2981 | - ucontrol->value.integer.value[0] = |
2982 | + if (chs & 1) |
2983 | + ucontrol->value.integer.value[0] = beep->enabled; |
2984 | + if (chs & 2) |
2985 | ucontrol->value.integer.value[1] = beep->enabled; |
2986 | return 0; |
2987 | } |
2988 | diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c |
2989 | index 2ad28ce7ff49..cbe0248225c1 100644 |
2990 | --- a/sound/pci/hda/hda_codec.c |
2991 | +++ b/sound/pci/hda/hda_codec.c |
2992 | @@ -876,6 +876,7 @@ int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card, |
2993 | |
2994 | /* power-up all before initialization */ |
2995 | hda_set_power_state(codec, AC_PWRST_D0); |
2996 | + codec->core.dev.power.power_state = PMSG_ON; |
2997 | |
2998 | snd_hda_codec_proc_new(codec); |
2999 | |
3000 | diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c |
3001 | index 3234e9ca02ce..d8e132a2d1a8 100644 |
3002 | --- a/sound/pci/hda/hda_intel.c |
3003 | +++ b/sound/pci/hda/hda_intel.c |
3004 | @@ -1828,24 +1828,15 @@ static void azx_firmware_cb(const struct firmware *fw, void *context) |
3005 | { |
3006 | struct snd_card *card = context; |
3007 | struct azx *chip = card->private_data; |
3008 | - struct pci_dev *pci = chip->pci; |
3009 | - |
3010 | - if (!fw) { |
3011 | - dev_err(card->dev, "Cannot load firmware, aborting\n"); |
3012 | - goto error; |
3013 | - } |
3014 | |
3015 | - chip->fw = fw; |
3016 | + if (fw) |
3017 | + chip->fw = fw; |
3018 | + else |
3019 | + dev_err(card->dev, "Cannot load firmware, continue without patching\n"); |
3020 | if (!chip->disabled) { |
3021 | /* continue probing */ |
3022 | - if (azx_probe_continue(chip)) |
3023 | - goto error; |
3024 | + azx_probe_continue(chip); |
3025 | } |
3026 | - return; /* OK */ |
3027 | - |
3028 | - error: |
3029 | - snd_card_free(card); |
3030 | - pci_set_drvdata(pci, NULL); |
3031 | } |
3032 | #endif |
3033 | |
3034 | @@ -1971,6 +1962,17 @@ static const struct hdac_io_ops pci_hda_io_ops = { |
3035 | .dma_free_pages = dma_free_pages, |
3036 | }; |
3037 | |
3038 | +/* Blacklist for skipping the whole probe: |
3039 | + * some HD-audio PCI entries are exposed without any codecs, and such devices |
3040 | + * should be ignored from the beginning. |
3041 | + */ |
3042 | +static const struct snd_pci_quirk driver_blacklist[] = { |
3043 | + SND_PCI_QUIRK(0x1043, 0x874f, "ASUS ROG Zenith II / Strix", 0), |
3044 | + SND_PCI_QUIRK(0x1462, 0xcb59, "MSI TRX40 Creator", 0), |
3045 | + SND_PCI_QUIRK(0x1462, 0xcb60, "MSI TRX40", 0), |
3046 | + {} |
3047 | +}; |
3048 | + |
3049 | static const struct hda_controller_ops pci_hda_ops = { |
3050 | .disable_msi_reset_irq = disable_msi_reset_irq, |
3051 | .substream_alloc_pages = substream_alloc_pages, |
3052 | @@ -1990,6 +1992,11 @@ static int azx_probe(struct pci_dev *pci, |
3053 | bool schedule_probe; |
3054 | int err; |
3055 | |
3056 | + if (snd_pci_quirk_lookup(pci, driver_blacklist)) { |
3057 | + dev_info(&pci->dev, "Skipping the blacklisted device\n"); |
3058 | + return -ENODEV; |
3059 | + } |
3060 | + |
3061 | if (dev >= SNDRV_CARDS) |
3062 | return -ENODEV; |
3063 | if (!enable[dev]) { |
3064 | diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c |
3065 | index 2697402b5195..41f6450a2539 100644 |
3066 | --- a/sound/pci/ice1712/prodigy_hifi.c |
3067 | +++ b/sound/pci/ice1712/prodigy_hifi.c |
3068 | @@ -569,7 +569,7 @@ static int wm_adc_mux_enum_get(struct snd_kcontrol *kcontrol, |
3069 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
3070 | |
3071 | mutex_lock(&ice->gpio_mutex); |
3072 | - ucontrol->value.integer.value[0] = wm_get(ice, WM_ADC_MUX) & 0x1f; |
3073 | + ucontrol->value.enumerated.item[0] = wm_get(ice, WM_ADC_MUX) & 0x1f; |
3074 | mutex_unlock(&ice->gpio_mutex); |
3075 | return 0; |
3076 | } |
3077 | @@ -583,7 +583,7 @@ static int wm_adc_mux_enum_put(struct snd_kcontrol *kcontrol, |
3078 | |
3079 | mutex_lock(&ice->gpio_mutex); |
3080 | oval = wm_get(ice, WM_ADC_MUX); |
3081 | - nval = (oval & 0xe0) | ucontrol->value.integer.value[0]; |
3082 | + nval = (oval & 0xe0) | ucontrol->value.enumerated.item[0]; |
3083 | if (nval != oval) { |
3084 | wm_put(ice, WM_ADC_MUX, nval); |
3085 | change = 1; |
3086 | diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c |
3087 | index 0838478c4c3f..b3464ac99b99 100644 |
3088 | --- a/sound/soc/intel/atom/sst-atom-controls.c |
3089 | +++ b/sound/soc/intel/atom/sst-atom-controls.c |
3090 | @@ -1343,7 +1343,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute) |
3091 | dai->capture_widget->name); |
3092 | w = dai->capture_widget; |
3093 | snd_soc_dapm_widget_for_each_source_path(w, p) { |
3094 | - if (p->connected && !p->connected(w, p->sink)) |
3095 | + if (p->connected && !p->connected(w, p->source)) |
3096 | continue; |
3097 | |
3098 | if (p->connect && p->source->power && |
3099 | diff --git a/sound/soc/intel/atom/sst/sst_pci.c b/sound/soc/intel/atom/sst/sst_pci.c |
3100 | index 3a0b3bf0af97..e9c6894cc27f 100644 |
3101 | --- a/sound/soc/intel/atom/sst/sst_pci.c |
3102 | +++ b/sound/soc/intel/atom/sst/sst_pci.c |
3103 | @@ -107,7 +107,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx) |
3104 | dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram); |
3105 | do_release_regions: |
3106 | pci_release_regions(pci); |
3107 | - return 0; |
3108 | + return ret; |
3109 | } |
3110 | |
3111 | /* |
3112 | diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c |
3113 | index a04672411bef..73523cf0329b 100644 |
3114 | --- a/sound/soc/soc-dapm.c |
3115 | +++ b/sound/soc/soc-dapm.c |
3116 | @@ -751,7 +751,13 @@ static void dapm_set_mixer_path_status(struct snd_soc_dapm_path *p, int i) |
3117 | val = max - val; |
3118 | p->connect = !!val; |
3119 | } else { |
3120 | - p->connect = 0; |
3121 | + /* since a virtual mixer has no backing registers to |
3122 | + * decide which path to connect, it will try to match |
3123 | + * with initial state. This is to ensure |
3124 | + * that the default mixer choice will be |
3125 | + * correctly powered up during initialization. |
3126 | + */ |
3127 | + p->connect = invert; |
3128 | } |
3129 | } |
3130 | |
3131 | diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c |
3132 | index 9fc1a7bb8b95..90acdf4d90ed 100644 |
3133 | --- a/sound/soc/soc-ops.c |
3134 | +++ b/sound/soc/soc-ops.c |
3135 | @@ -837,7 +837,7 @@ int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol, |
3136 | unsigned int regbase = mc->regbase; |
3137 | unsigned int regcount = mc->regcount; |
3138 | unsigned int regwshift = component->val_bytes * BITS_PER_BYTE; |
3139 | - unsigned int regwmask = (1<<regwshift)-1; |
3140 | + unsigned int regwmask = (1UL<<regwshift)-1; |
3141 | unsigned int invert = mc->invert; |
3142 | unsigned long mask = (1UL<<mc->nbits)-1; |
3143 | long min = mc->min; |
3144 | @@ -886,7 +886,7 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol, |
3145 | unsigned int regbase = mc->regbase; |
3146 | unsigned int regcount = mc->regcount; |
3147 | unsigned int regwshift = component->val_bytes * BITS_PER_BYTE; |
3148 | - unsigned int regwmask = (1<<regwshift)-1; |
3149 | + unsigned int regwmask = (1UL<<regwshift)-1; |
3150 | unsigned int invert = mc->invert; |
3151 | unsigned long mask = (1UL<<mc->nbits)-1; |
3152 | long max = mc->max; |
3153 | diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c |
3154 | index 9df0c8102dc0..b67d105b76e4 100644 |
3155 | --- a/sound/soc/soc-pcm.c |
3156 | +++ b/sound/soc/soc-pcm.c |
3157 | @@ -2062,7 +2062,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, |
3158 | switch (cmd) { |
3159 | case SNDRV_PCM_TRIGGER_START: |
3160 | if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && |
3161 | - (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) |
3162 | + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && |
3163 | + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) |
3164 | continue; |
3165 | |
3166 | ret = dpcm_do_trigger(dpcm, be_substream, cmd); |
3167 | @@ -2092,7 +2093,8 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, |
3168 | be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; |
3169 | break; |
3170 | case SNDRV_PCM_TRIGGER_STOP: |
3171 | - if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) |
3172 | + if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) && |
3173 | + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) |
3174 | continue; |
3175 | |
3176 | if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) |
3177 | diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c |
3178 | index 086fe4d27f60..e9c57bd3c02b 100644 |
3179 | --- a/sound/soc/soc-topology.c |
3180 | +++ b/sound/soc/soc-topology.c |
3181 | @@ -344,7 +344,7 @@ static int soc_tplg_add_kcontrol(struct soc_tplg *tplg, |
3182 | struct snd_soc_component *comp = tplg->comp; |
3183 | |
3184 | return soc_tplg_add_dcontrol(comp->card->snd_card, |
3185 | - comp->dev, k, NULL, comp, kcontrol); |
3186 | + comp->dev, k, comp->name_prefix, comp, kcontrol); |
3187 | } |
3188 | |
3189 | /* remove a mixer kcontrol */ |
3190 | diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c |
3191 | index 54011f8543a7..e2f62362a0b0 100644 |
3192 | --- a/sound/usb/mixer.c |
3193 | +++ b/sound/usb/mixer.c |
3194 | @@ -2336,7 +2336,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) |
3195 | if (map->id == state.chip->usb_id) { |
3196 | state.map = map->map; |
3197 | state.selector_map = map->selector_map; |
3198 | - mixer->ignore_ctl_error = map->ignore_ctl_error; |
3199 | + mixer->ignore_ctl_error |= map->ignore_ctl_error; |
3200 | break; |
3201 | } |
3202 | } |
3203 | diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c |
3204 | index eaa03acd4686..26ce6838e842 100644 |
3205 | --- a/sound/usb/mixer_maps.c |
3206 | +++ b/sound/usb/mixer_maps.c |
3207 | @@ -363,6 +363,14 @@ static const struct usbmix_name_map dell_alc4020_map[] = { |
3208 | { 0 } |
3209 | }; |
3210 | |
3211 | +/* Some mobos shipped with a dummy HD-audio show the invalid GET_MIN/GET_MAX |
3212 | + * response for Input Gain Pad (id=19, control=12). Skip it. |
3213 | + */ |
3214 | +static const struct usbmix_name_map asus_rog_map[] = { |
3215 | + { 19, NULL, 12 }, /* FU, Input Gain Pad */ |
3216 | + {} |
3217 | +}; |
3218 | + |
3219 | /* |
3220 | * Control map entries |
3221 | */ |
3222 | @@ -482,6 +490,26 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = { |
3223 | .id = USB_ID(0x05a7, 0x1020), |
3224 | .map = bose_companion5_map, |
3225 | }, |
3226 | + { /* Gigabyte TRX40 Aorus Pro WiFi */ |
3227 | + .id = USB_ID(0x0414, 0xa002), |
3228 | + .map = asus_rog_map, |
3229 | + }, |
3230 | + { /* ASUS ROG Zenith II */ |
3231 | + .id = USB_ID(0x0b05, 0x1916), |
3232 | + .map = asus_rog_map, |
3233 | + }, |
3234 | + { /* ASUS ROG Strix */ |
3235 | + .id = USB_ID(0x0b05, 0x1917), |
3236 | + .map = asus_rog_map, |
3237 | + }, |
3238 | + { /* MSI TRX40 Creator */ |
3239 | + .id = USB_ID(0x0db0, 0x0d64), |
3240 | + .map = asus_rog_map, |
3241 | + }, |
3242 | + { /* MSI TRX40 */ |
3243 | + .id = USB_ID(0x0db0, 0x543d), |
3244 | + .map = asus_rog_map, |
3245 | + }, |
3246 | { 0 } /* terminator */ |
3247 | }; |
3248 | |
3249 | diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile |
3250 | index 359dd5d11c81..e2ac49253a0a 100644 |
3251 | --- a/tools/gpio/Makefile |
3252 | +++ b/tools/gpio/Makefile |
3253 | @@ -32,7 +32,7 @@ $(OUTPUT)include/linux/gpio.h: ../../include/uapi/linux/gpio.h |
3254 | |
3255 | prepare: $(OUTPUT)include/linux/gpio.h |
3256 | |
3257 | -GPIO_UTILS_IN := $(output)gpio-utils-in.o |
3258 | +GPIO_UTILS_IN := $(OUTPUT)gpio-utils-in.o |
3259 | $(GPIO_UTILS_IN): prepare FORCE |
3260 | $(Q)$(MAKE) $(build)=gpio-utils |
3261 | |
3262 | diff --git a/tools/objtool/check.c b/tools/objtool/check.c |
3263 | index 09782ff427d0..db105207757b 100644 |
3264 | --- a/tools/objtool/check.c |
3265 | +++ b/tools/objtool/check.c |
3266 | @@ -914,10 +914,7 @@ static struct rela *find_switch_table(struct objtool_file *file, |
3267 | * it. |
3268 | */ |
3269 | for (; |
3270 | - &insn->list != &file->insn_list && |
3271 | - insn->sec == func->sec && |
3272 | - insn->offset >= func->offset; |
3273 | - |
3274 | + &insn->list != &file->insn_list && insn->func && insn->func->pfunc == func; |
3275 | insn = insn->first_jump_src ?: list_prev_entry(insn, list)) { |
3276 | |
3277 | if (insn != orig_insn && insn->type == INSN_JUMP_DYNAMIC) |
3278 | diff --git a/tools/testing/selftests/x86/ptrace_syscall.c b/tools/testing/selftests/x86/ptrace_syscall.c |
3279 | index 1e3da137a8bb..5390c827a359 100644 |
3280 | --- a/tools/testing/selftests/x86/ptrace_syscall.c |
3281 | +++ b/tools/testing/selftests/x86/ptrace_syscall.c |
3282 | @@ -413,8 +413,12 @@ int main() |
3283 | |
3284 | #if defined(__i386__) && (!defined(__GLIBC__) || __GLIBC__ > 2 || __GLIBC_MINOR__ >= 16) |
3285 | vsyscall32 = (void *)getauxval(AT_SYSINFO); |
3286 | - printf("[RUN]\tCheck AT_SYSINFO return regs\n"); |
3287 | - test_sys32_regs(do_full_vsyscall32); |
3288 | + if (vsyscall32) { |
3289 | + printf("[RUN]\tCheck AT_SYSINFO return regs\n"); |
3290 | + test_sys32_regs(do_full_vsyscall32); |
3291 | + } else { |
3292 | + printf("[SKIP]\tAT_SYSINFO is not available\n"); |
3293 | + } |
3294 | #endif |
3295 | |
3296 | test_ptrace_syscall_restart(); |