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