Contents of /trunk/kernel-alx/patches-5.4/0255-5.4.156-all-fixes.patch
Parent Directory | Revision Log
Revision 3637 -
(show annotations)
(download)
Mon Oct 24 12:40:44 2022 UTC (18 months, 3 weeks ago) by niro
File size: 70122 byte(s)
Mon Oct 24 12:40:44 2022 UTC (18 months, 3 weeks ago) by niro
File size: 70122 byte(s)
-add missing
1 | diff --git a/Makefile b/Makefile |
2 | index f7e2bf924463b..ced1f0fd48dc6 100644 |
3 | --- a/Makefile |
4 | +++ b/Makefile |
5 | @@ -1,7 +1,7 @@ |
6 | # SPDX-License-Identifier: GPL-2.0 |
7 | VERSION = 5 |
8 | PATCHLEVEL = 4 |
9 | -SUBLEVEL = 155 |
10 | +SUBLEVEL = 156 |
11 | EXTRAVERSION = |
12 | NAME = Kleptomaniac Octopus |
13 | |
14 | diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig |
15 | index 9aa88715f196c..4b36bbcf5a5b4 100644 |
16 | --- a/arch/arm/Kconfig |
17 | +++ b/arch/arm/Kconfig |
18 | @@ -85,6 +85,7 @@ config ARM |
19 | select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL |
20 | select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG |
21 | select HAVE_FUNCTION_TRACER if !XIP_KERNEL && (CC_IS_GCC || CLANG_VERSION >= 100000) |
22 | + select HAVE_FUTEX_CMPXCHG if FUTEX |
23 | select HAVE_GCC_PLUGINS |
24 | select HAVE_HW_BREAKPOINT if PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7) |
25 | select HAVE_IDE if PCI || ISA || PCMCIA |
26 | diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts |
27 | index 89f0c9979b89c..4f63158d6b9bd 100644 |
28 | --- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts |
29 | +++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts |
30 | @@ -69,7 +69,6 @@ |
31 | isc: isc@f0008000 { |
32 | pinctrl-names = "default"; |
33 | pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>; |
34 | - status = "okay"; |
35 | }; |
36 | |
37 | qspi1: spi@f0024000 { |
38 | diff --git a/arch/arm/boot/dts/spear3xx.dtsi b/arch/arm/boot/dts/spear3xx.dtsi |
39 | index f266b7b034823..cc88ebe7a60ce 100644 |
40 | --- a/arch/arm/boot/dts/spear3xx.dtsi |
41 | +++ b/arch/arm/boot/dts/spear3xx.dtsi |
42 | @@ -47,7 +47,7 @@ |
43 | }; |
44 | |
45 | gmac: eth@e0800000 { |
46 | - compatible = "st,spear600-gmac"; |
47 | + compatible = "snps,dwmac-3.40a"; |
48 | reg = <0xe0800000 0x8000>; |
49 | interrupts = <23 22>; |
50 | interrupt-names = "macirq", "eth_wake_irq"; |
51 | diff --git a/arch/nios2/include/asm/irqflags.h b/arch/nios2/include/asm/irqflags.h |
52 | index b3ec3e510706d..25acf27862f91 100644 |
53 | --- a/arch/nios2/include/asm/irqflags.h |
54 | +++ b/arch/nios2/include/asm/irqflags.h |
55 | @@ -9,7 +9,7 @@ |
56 | |
57 | static inline unsigned long arch_local_save_flags(void) |
58 | { |
59 | - return RDCTL(CTL_STATUS); |
60 | + return RDCTL(CTL_FSTATUS); |
61 | } |
62 | |
63 | /* |
64 | @@ -18,7 +18,7 @@ static inline unsigned long arch_local_save_flags(void) |
65 | */ |
66 | static inline void arch_local_irq_restore(unsigned long flags) |
67 | { |
68 | - WRCTL(CTL_STATUS, flags); |
69 | + WRCTL(CTL_FSTATUS, flags); |
70 | } |
71 | |
72 | static inline void arch_local_irq_disable(void) |
73 | diff --git a/arch/nios2/include/asm/registers.h b/arch/nios2/include/asm/registers.h |
74 | index 183c720e454d9..95b67dd16f818 100644 |
75 | --- a/arch/nios2/include/asm/registers.h |
76 | +++ b/arch/nios2/include/asm/registers.h |
77 | @@ -11,7 +11,7 @@ |
78 | #endif |
79 | |
80 | /* control register numbers */ |
81 | -#define CTL_STATUS 0 |
82 | +#define CTL_FSTATUS 0 |
83 | #define CTL_ESTATUS 1 |
84 | #define CTL_BSTATUS 2 |
85 | #define CTL_IENABLE 3 |
86 | diff --git a/arch/parisc/math-emu/fpudispatch.c b/arch/parisc/math-emu/fpudispatch.c |
87 | index 7c46969ead9b1..01ed133227c25 100644 |
88 | --- a/arch/parisc/math-emu/fpudispatch.c |
89 | +++ b/arch/parisc/math-emu/fpudispatch.c |
90 | @@ -310,12 +310,15 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
91 | r1 &= ~3; |
92 | fpregs[t+3] = fpregs[r1+3]; |
93 | fpregs[t+2] = fpregs[r1+2]; |
94 | + fallthrough; |
95 | case 1: /* double */ |
96 | fpregs[t+1] = fpregs[r1+1]; |
97 | + fallthrough; |
98 | case 0: /* single */ |
99 | fpregs[t] = fpregs[r1]; |
100 | return(NOEXCEPTION); |
101 | } |
102 | + BUG(); |
103 | case 3: /* FABS */ |
104 | switch (fmt) { |
105 | case 2: /* illegal */ |
106 | @@ -325,13 +328,16 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
107 | r1 &= ~3; |
108 | fpregs[t+3] = fpregs[r1+3]; |
109 | fpregs[t+2] = fpregs[r1+2]; |
110 | + fallthrough; |
111 | case 1: /* double */ |
112 | fpregs[t+1] = fpregs[r1+1]; |
113 | + fallthrough; |
114 | case 0: /* single */ |
115 | /* copy and clear sign bit */ |
116 | fpregs[t] = fpregs[r1] & 0x7fffffff; |
117 | return(NOEXCEPTION); |
118 | } |
119 | + BUG(); |
120 | case 6: /* FNEG */ |
121 | switch (fmt) { |
122 | case 2: /* illegal */ |
123 | @@ -341,13 +347,16 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
124 | r1 &= ~3; |
125 | fpregs[t+3] = fpregs[r1+3]; |
126 | fpregs[t+2] = fpregs[r1+2]; |
127 | + fallthrough; |
128 | case 1: /* double */ |
129 | fpregs[t+1] = fpregs[r1+1]; |
130 | + fallthrough; |
131 | case 0: /* single */ |
132 | /* copy and invert sign bit */ |
133 | fpregs[t] = fpregs[r1] ^ 0x80000000; |
134 | return(NOEXCEPTION); |
135 | } |
136 | + BUG(); |
137 | case 7: /* FNEGABS */ |
138 | switch (fmt) { |
139 | case 2: /* illegal */ |
140 | @@ -357,13 +366,16 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
141 | r1 &= ~3; |
142 | fpregs[t+3] = fpregs[r1+3]; |
143 | fpregs[t+2] = fpregs[r1+2]; |
144 | + fallthrough; |
145 | case 1: /* double */ |
146 | fpregs[t+1] = fpregs[r1+1]; |
147 | + fallthrough; |
148 | case 0: /* single */ |
149 | /* copy and set sign bit */ |
150 | fpregs[t] = fpregs[r1] | 0x80000000; |
151 | return(NOEXCEPTION); |
152 | } |
153 | + BUG(); |
154 | case 4: /* FSQRT */ |
155 | switch (fmt) { |
156 | case 0: |
157 | @@ -376,6 +388,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
158 | case 3: /* quad not implemented */ |
159 | return(MAJOR_0C_EXCP); |
160 | } |
161 | + BUG(); |
162 | case 5: /* FRND */ |
163 | switch (fmt) { |
164 | case 0: |
165 | @@ -389,7 +402,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
166 | return(MAJOR_0C_EXCP); |
167 | } |
168 | } /* end of switch (subop) */ |
169 | - |
170 | + BUG(); |
171 | case 1: /* class 1 */ |
172 | df = extru(ir,fpdfpos,2); /* get dest format */ |
173 | if ((df & 2) || (fmt & 2)) { |
174 | @@ -419,6 +432,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
175 | case 3: /* dbl/dbl */ |
176 | return(MAJOR_0C_EXCP); |
177 | } |
178 | + BUG(); |
179 | case 1: /* FCNVXF */ |
180 | switch(fmt) { |
181 | case 0: /* sgl/sgl */ |
182 | @@ -434,6 +448,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
183 | return(dbl_to_dbl_fcnvxf(&fpregs[r1],0, |
184 | &fpregs[t],status)); |
185 | } |
186 | + BUG(); |
187 | case 2: /* FCNVFX */ |
188 | switch(fmt) { |
189 | case 0: /* sgl/sgl */ |
190 | @@ -449,6 +464,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
191 | return(dbl_to_dbl_fcnvfx(&fpregs[r1],0, |
192 | &fpregs[t],status)); |
193 | } |
194 | + BUG(); |
195 | case 3: /* FCNVFXT */ |
196 | switch(fmt) { |
197 | case 0: /* sgl/sgl */ |
198 | @@ -464,6 +480,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
199 | return(dbl_to_dbl_fcnvfxt(&fpregs[r1],0, |
200 | &fpregs[t],status)); |
201 | } |
202 | + BUG(); |
203 | case 5: /* FCNVUF (PA2.0 only) */ |
204 | switch(fmt) { |
205 | case 0: /* sgl/sgl */ |
206 | @@ -479,6 +496,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
207 | return(dbl_to_dbl_fcnvuf(&fpregs[r1],0, |
208 | &fpregs[t],status)); |
209 | } |
210 | + BUG(); |
211 | case 6: /* FCNVFU (PA2.0 only) */ |
212 | switch(fmt) { |
213 | case 0: /* sgl/sgl */ |
214 | @@ -494,6 +512,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
215 | return(dbl_to_dbl_fcnvfu(&fpregs[r1],0, |
216 | &fpregs[t],status)); |
217 | } |
218 | + BUG(); |
219 | case 7: /* FCNVFUT (PA2.0 only) */ |
220 | switch(fmt) { |
221 | case 0: /* sgl/sgl */ |
222 | @@ -509,10 +528,11 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
223 | return(dbl_to_dbl_fcnvfut(&fpregs[r1],0, |
224 | &fpregs[t],status)); |
225 | } |
226 | + BUG(); |
227 | case 4: /* undefined */ |
228 | return(MAJOR_0C_EXCP); |
229 | } /* end of switch subop */ |
230 | - |
231 | + BUG(); |
232 | case 2: /* class 2 */ |
233 | fpu_type_flags=fpregs[FPU_TYPE_FLAG_POS]; |
234 | r2 = extru(ir, fpr2pos, 5) * sizeof(double)/sizeof(u_int); |
235 | @@ -590,6 +610,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
236 | case 3: /* quad not implemented */ |
237 | return(MAJOR_0C_EXCP); |
238 | } |
239 | + BUG(); |
240 | case 1: /* FTEST */ |
241 | switch (fmt) { |
242 | case 0: |
243 | @@ -609,8 +630,10 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
244 | case 3: |
245 | return(MAJOR_0C_EXCP); |
246 | } |
247 | + BUG(); |
248 | } /* end of switch subop */ |
249 | } /* end of else for PA1.0 & PA1.1 */ |
250 | + BUG(); |
251 | case 3: /* class 3 */ |
252 | r2 = extru(ir,fpr2pos,5) * sizeof(double)/sizeof(u_int); |
253 | if (r2 == 0) |
254 | @@ -633,6 +656,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
255 | case 3: /* quad not implemented */ |
256 | return(MAJOR_0C_EXCP); |
257 | } |
258 | + BUG(); |
259 | case 1: /* FSUB */ |
260 | switch (fmt) { |
261 | case 0: |
262 | @@ -645,6 +669,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
263 | case 3: /* quad not implemented */ |
264 | return(MAJOR_0C_EXCP); |
265 | } |
266 | + BUG(); |
267 | case 2: /* FMPY */ |
268 | switch (fmt) { |
269 | case 0: |
270 | @@ -657,6 +682,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
271 | case 3: /* quad not implemented */ |
272 | return(MAJOR_0C_EXCP); |
273 | } |
274 | + BUG(); |
275 | case 3: /* FDIV */ |
276 | switch (fmt) { |
277 | case 0: |
278 | @@ -669,6 +695,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
279 | case 3: /* quad not implemented */ |
280 | return(MAJOR_0C_EXCP); |
281 | } |
282 | + BUG(); |
283 | case 4: /* FREM */ |
284 | switch (fmt) { |
285 | case 0: |
286 | @@ -681,6 +708,7 @@ decode_0c(u_int ir, u_int class, u_int subop, u_int fpregs[]) |
287 | case 3: /* quad not implemented */ |
288 | return(MAJOR_0C_EXCP); |
289 | } |
290 | + BUG(); |
291 | } /* end of class 3 switch */ |
292 | } /* end of switch(class) */ |
293 | |
294 | @@ -736,10 +764,12 @@ u_int fpregs[]; |
295 | return(MAJOR_0E_EXCP); |
296 | case 1: /* double */ |
297 | fpregs[t+1] = fpregs[r1+1]; |
298 | + fallthrough; |
299 | case 0: /* single */ |
300 | fpregs[t] = fpregs[r1]; |
301 | return(NOEXCEPTION); |
302 | } |
303 | + BUG(); |
304 | case 3: /* FABS */ |
305 | switch (fmt) { |
306 | case 2: |
307 | @@ -747,10 +777,12 @@ u_int fpregs[]; |
308 | return(MAJOR_0E_EXCP); |
309 | case 1: /* double */ |
310 | fpregs[t+1] = fpregs[r1+1]; |
311 | + fallthrough; |
312 | case 0: /* single */ |
313 | fpregs[t] = fpregs[r1] & 0x7fffffff; |
314 | return(NOEXCEPTION); |
315 | } |
316 | + BUG(); |
317 | case 6: /* FNEG */ |
318 | switch (fmt) { |
319 | case 2: |
320 | @@ -758,10 +790,12 @@ u_int fpregs[]; |
321 | return(MAJOR_0E_EXCP); |
322 | case 1: /* double */ |
323 | fpregs[t+1] = fpregs[r1+1]; |
324 | + fallthrough; |
325 | case 0: /* single */ |
326 | fpregs[t] = fpregs[r1] ^ 0x80000000; |
327 | return(NOEXCEPTION); |
328 | } |
329 | + BUG(); |
330 | case 7: /* FNEGABS */ |
331 | switch (fmt) { |
332 | case 2: |
333 | @@ -769,10 +803,12 @@ u_int fpregs[]; |
334 | return(MAJOR_0E_EXCP); |
335 | case 1: /* double */ |
336 | fpregs[t+1] = fpregs[r1+1]; |
337 | + fallthrough; |
338 | case 0: /* single */ |
339 | fpregs[t] = fpregs[r1] | 0x80000000; |
340 | return(NOEXCEPTION); |
341 | } |
342 | + BUG(); |
343 | case 4: /* FSQRT */ |
344 | switch (fmt) { |
345 | case 0: |
346 | @@ -785,6 +821,7 @@ u_int fpregs[]; |
347 | case 3: |
348 | return(MAJOR_0E_EXCP); |
349 | } |
350 | + BUG(); |
351 | case 5: /* FRMD */ |
352 | switch (fmt) { |
353 | case 0: |
354 | @@ -798,7 +835,7 @@ u_int fpregs[]; |
355 | return(MAJOR_0E_EXCP); |
356 | } |
357 | } /* end of switch (subop */ |
358 | - |
359 | + BUG(); |
360 | case 1: /* class 1 */ |
361 | df = extru(ir,fpdfpos,2); /* get dest format */ |
362 | /* |
363 | @@ -826,6 +863,7 @@ u_int fpregs[]; |
364 | case 3: /* dbl/dbl */ |
365 | return(MAJOR_0E_EXCP); |
366 | } |
367 | + BUG(); |
368 | case 1: /* FCNVXF */ |
369 | switch(fmt) { |
370 | case 0: /* sgl/sgl */ |
371 | @@ -841,6 +879,7 @@ u_int fpregs[]; |
372 | return(dbl_to_dbl_fcnvxf(&fpregs[r1],0, |
373 | &fpregs[t],status)); |
374 | } |
375 | + BUG(); |
376 | case 2: /* FCNVFX */ |
377 | switch(fmt) { |
378 | case 0: /* sgl/sgl */ |
379 | @@ -856,6 +895,7 @@ u_int fpregs[]; |
380 | return(dbl_to_dbl_fcnvfx(&fpregs[r1],0, |
381 | &fpregs[t],status)); |
382 | } |
383 | + BUG(); |
384 | case 3: /* FCNVFXT */ |
385 | switch(fmt) { |
386 | case 0: /* sgl/sgl */ |
387 | @@ -871,6 +911,7 @@ u_int fpregs[]; |
388 | return(dbl_to_dbl_fcnvfxt(&fpregs[r1],0, |
389 | &fpregs[t],status)); |
390 | } |
391 | + BUG(); |
392 | case 5: /* FCNVUF (PA2.0 only) */ |
393 | switch(fmt) { |
394 | case 0: /* sgl/sgl */ |
395 | @@ -886,6 +927,7 @@ u_int fpregs[]; |
396 | return(dbl_to_dbl_fcnvuf(&fpregs[r1],0, |
397 | &fpregs[t],status)); |
398 | } |
399 | + BUG(); |
400 | case 6: /* FCNVFU (PA2.0 only) */ |
401 | switch(fmt) { |
402 | case 0: /* sgl/sgl */ |
403 | @@ -901,6 +943,7 @@ u_int fpregs[]; |
404 | return(dbl_to_dbl_fcnvfu(&fpregs[r1],0, |
405 | &fpregs[t],status)); |
406 | } |
407 | + BUG(); |
408 | case 7: /* FCNVFUT (PA2.0 only) */ |
409 | switch(fmt) { |
410 | case 0: /* sgl/sgl */ |
411 | @@ -916,9 +959,11 @@ u_int fpregs[]; |
412 | return(dbl_to_dbl_fcnvfut(&fpregs[r1],0, |
413 | &fpregs[t],status)); |
414 | } |
415 | + BUG(); |
416 | case 4: /* undefined */ |
417 | return(MAJOR_0C_EXCP); |
418 | } /* end of switch subop */ |
419 | + BUG(); |
420 | case 2: /* class 2 */ |
421 | /* |
422 | * Be careful out there. |
423 | @@ -994,6 +1039,7 @@ u_int fpregs[]; |
424 | } |
425 | } /* end of switch subop */ |
426 | } /* end of else for PA1.0 & PA1.1 */ |
427 | + BUG(); |
428 | case 3: /* class 3 */ |
429 | /* |
430 | * Be careful out there. |
431 | @@ -1026,6 +1072,7 @@ u_int fpregs[]; |
432 | return(dbl_fadd(&fpregs[r1],&fpregs[r2], |
433 | &fpregs[t],status)); |
434 | } |
435 | + BUG(); |
436 | case 1: /* FSUB */ |
437 | switch (fmt) { |
438 | case 0: |
439 | @@ -1035,6 +1082,7 @@ u_int fpregs[]; |
440 | return(dbl_fsub(&fpregs[r1],&fpregs[r2], |
441 | &fpregs[t],status)); |
442 | } |
443 | + BUG(); |
444 | case 2: /* FMPY or XMPYU */ |
445 | /* |
446 | * check for integer multiply (x bit set) |
447 | @@ -1071,6 +1119,7 @@ u_int fpregs[]; |
448 | &fpregs[r2],&fpregs[t],status)); |
449 | } |
450 | } |
451 | + BUG(); |
452 | case 3: /* FDIV */ |
453 | switch (fmt) { |
454 | case 0: |
455 | @@ -1080,6 +1129,7 @@ u_int fpregs[]; |
456 | return(dbl_fdiv(&fpregs[r1],&fpregs[r2], |
457 | &fpregs[t],status)); |
458 | } |
459 | + BUG(); |
460 | case 4: /* FREM */ |
461 | switch (fmt) { |
462 | case 0: |
463 | diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S |
464 | index d32751994a62c..c3f62c9ce7406 100644 |
465 | --- a/arch/powerpc/kernel/idle_book3s.S |
466 | +++ b/arch/powerpc/kernel/idle_book3s.S |
467 | @@ -50,28 +50,32 @@ _GLOBAL(isa300_idle_stop_mayloss) |
468 | std r1,PACAR1(r13) |
469 | mflr r4 |
470 | mfcr r5 |
471 | - /* use stack red zone rather than a new frame for saving regs */ |
472 | - std r2,-8*0(r1) |
473 | - std r14,-8*1(r1) |
474 | - std r15,-8*2(r1) |
475 | - std r16,-8*3(r1) |
476 | - std r17,-8*4(r1) |
477 | - std r18,-8*5(r1) |
478 | - std r19,-8*6(r1) |
479 | - std r20,-8*7(r1) |
480 | - std r21,-8*8(r1) |
481 | - std r22,-8*9(r1) |
482 | - std r23,-8*10(r1) |
483 | - std r24,-8*11(r1) |
484 | - std r25,-8*12(r1) |
485 | - std r26,-8*13(r1) |
486 | - std r27,-8*14(r1) |
487 | - std r28,-8*15(r1) |
488 | - std r29,-8*16(r1) |
489 | - std r30,-8*17(r1) |
490 | - std r31,-8*18(r1) |
491 | - std r4,-8*19(r1) |
492 | - std r5,-8*20(r1) |
493 | + /* |
494 | + * Use the stack red zone rather than a new frame for saving regs since |
495 | + * in the case of no GPR loss the wakeup code branches directly back to |
496 | + * the caller without deallocating the stack frame first. |
497 | + */ |
498 | + std r2,-8*1(r1) |
499 | + std r14,-8*2(r1) |
500 | + std r15,-8*3(r1) |
501 | + std r16,-8*4(r1) |
502 | + std r17,-8*5(r1) |
503 | + std r18,-8*6(r1) |
504 | + std r19,-8*7(r1) |
505 | + std r20,-8*8(r1) |
506 | + std r21,-8*9(r1) |
507 | + std r22,-8*10(r1) |
508 | + std r23,-8*11(r1) |
509 | + std r24,-8*12(r1) |
510 | + std r25,-8*13(r1) |
511 | + std r26,-8*14(r1) |
512 | + std r27,-8*15(r1) |
513 | + std r28,-8*16(r1) |
514 | + std r29,-8*17(r1) |
515 | + std r30,-8*18(r1) |
516 | + std r31,-8*19(r1) |
517 | + std r4,-8*20(r1) |
518 | + std r5,-8*21(r1) |
519 | /* 168 bytes */ |
520 | PPC_STOP |
521 | b . /* catch bugs */ |
522 | @@ -87,8 +91,8 @@ _GLOBAL(isa300_idle_stop_mayloss) |
523 | */ |
524 | _GLOBAL(idle_return_gpr_loss) |
525 | ld r1,PACAR1(r13) |
526 | - ld r4,-8*19(r1) |
527 | - ld r5,-8*20(r1) |
528 | + ld r4,-8*20(r1) |
529 | + ld r5,-8*21(r1) |
530 | mtlr r4 |
531 | mtcr r5 |
532 | /* |
533 | @@ -96,38 +100,40 @@ _GLOBAL(idle_return_gpr_loss) |
534 | * from PACATOC. This could be avoided for that less common case |
535 | * if KVM saved its r2. |
536 | */ |
537 | - ld r2,-8*0(r1) |
538 | - ld r14,-8*1(r1) |
539 | - ld r15,-8*2(r1) |
540 | - ld r16,-8*3(r1) |
541 | - ld r17,-8*4(r1) |
542 | - ld r18,-8*5(r1) |
543 | - ld r19,-8*6(r1) |
544 | - ld r20,-8*7(r1) |
545 | - ld r21,-8*8(r1) |
546 | - ld r22,-8*9(r1) |
547 | - ld r23,-8*10(r1) |
548 | - ld r24,-8*11(r1) |
549 | - ld r25,-8*12(r1) |
550 | - ld r26,-8*13(r1) |
551 | - ld r27,-8*14(r1) |
552 | - ld r28,-8*15(r1) |
553 | - ld r29,-8*16(r1) |
554 | - ld r30,-8*17(r1) |
555 | - ld r31,-8*18(r1) |
556 | + ld r2,-8*1(r1) |
557 | + ld r14,-8*2(r1) |
558 | + ld r15,-8*3(r1) |
559 | + ld r16,-8*4(r1) |
560 | + ld r17,-8*5(r1) |
561 | + ld r18,-8*6(r1) |
562 | + ld r19,-8*7(r1) |
563 | + ld r20,-8*8(r1) |
564 | + ld r21,-8*9(r1) |
565 | + ld r22,-8*10(r1) |
566 | + ld r23,-8*11(r1) |
567 | + ld r24,-8*12(r1) |
568 | + ld r25,-8*13(r1) |
569 | + ld r26,-8*14(r1) |
570 | + ld r27,-8*15(r1) |
571 | + ld r28,-8*16(r1) |
572 | + ld r29,-8*17(r1) |
573 | + ld r30,-8*18(r1) |
574 | + ld r31,-8*19(r1) |
575 | blr |
576 | |
577 | /* |
578 | * This is the sequence required to execute idle instructions, as |
579 | * specified in ISA v2.07 (and earlier). MSR[IR] and MSR[DR] must be 0. |
580 | - * |
581 | - * The 0(r1) slot is used to save r2 in isa206, so use that here. |
582 | + * We have to store a GPR somewhere, ptesync, then reload it, and create |
583 | + * a false dependency on the result of the load. It doesn't matter which |
584 | + * GPR we store, or where we store it. We have already stored r2 to the |
585 | + * stack at -8(r1) in isa206_idle_insn_mayloss, so use that. |
586 | */ |
587 | #define IDLE_STATE_ENTER_SEQ_NORET(IDLE_INST) \ |
588 | /* Magic NAP/SLEEP/WINKLE mode enter sequence */ \ |
589 | - std r2,0(r1); \ |
590 | + std r2,-8(r1); \ |
591 | ptesync; \ |
592 | - ld r2,0(r1); \ |
593 | + ld r2,-8(r1); \ |
594 | 236: cmpd cr0,r2,r2; \ |
595 | bne 236b; \ |
596 | IDLE_INST; \ |
597 | @@ -152,28 +158,32 @@ _GLOBAL(isa206_idle_insn_mayloss) |
598 | std r1,PACAR1(r13) |
599 | mflr r4 |
600 | mfcr r5 |
601 | - /* use stack red zone rather than a new frame for saving regs */ |
602 | - std r2,-8*0(r1) |
603 | - std r14,-8*1(r1) |
604 | - std r15,-8*2(r1) |
605 | - std r16,-8*3(r1) |
606 | - std r17,-8*4(r1) |
607 | - std r18,-8*5(r1) |
608 | - std r19,-8*6(r1) |
609 | - std r20,-8*7(r1) |
610 | - std r21,-8*8(r1) |
611 | - std r22,-8*9(r1) |
612 | - std r23,-8*10(r1) |
613 | - std r24,-8*11(r1) |
614 | - std r25,-8*12(r1) |
615 | - std r26,-8*13(r1) |
616 | - std r27,-8*14(r1) |
617 | - std r28,-8*15(r1) |
618 | - std r29,-8*16(r1) |
619 | - std r30,-8*17(r1) |
620 | - std r31,-8*18(r1) |
621 | - std r4,-8*19(r1) |
622 | - std r5,-8*20(r1) |
623 | + /* |
624 | + * Use the stack red zone rather than a new frame for saving regs since |
625 | + * in the case of no GPR loss the wakeup code branches directly back to |
626 | + * the caller without deallocating the stack frame first. |
627 | + */ |
628 | + std r2,-8*1(r1) |
629 | + std r14,-8*2(r1) |
630 | + std r15,-8*3(r1) |
631 | + std r16,-8*4(r1) |
632 | + std r17,-8*5(r1) |
633 | + std r18,-8*6(r1) |
634 | + std r19,-8*7(r1) |
635 | + std r20,-8*8(r1) |
636 | + std r21,-8*9(r1) |
637 | + std r22,-8*10(r1) |
638 | + std r23,-8*11(r1) |
639 | + std r24,-8*12(r1) |
640 | + std r25,-8*13(r1) |
641 | + std r26,-8*14(r1) |
642 | + std r27,-8*15(r1) |
643 | + std r28,-8*16(r1) |
644 | + std r29,-8*17(r1) |
645 | + std r30,-8*18(r1) |
646 | + std r31,-8*19(r1) |
647 | + std r4,-8*20(r1) |
648 | + std r5,-8*21(r1) |
649 | cmpwi r3,PNV_THREAD_NAP |
650 | bne 1f |
651 | IDLE_STATE_ENTER_SEQ_NORET(PPC_NAP) |
652 | diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S |
653 | index feaf6ca2e76c1..f9c7326672b95 100644 |
654 | --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S |
655 | +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S |
656 | @@ -292,13 +292,16 @@ kvm_novcpu_exit: |
657 | * r3 contains the SRR1 wakeup value, SRR1 is trashed. |
658 | */ |
659 | _GLOBAL(idle_kvm_start_guest) |
660 | - ld r4,PACAEMERGSP(r13) |
661 | mfcr r5 |
662 | mflr r0 |
663 | - std r1,0(r4) |
664 | - std r5,8(r4) |
665 | - std r0,16(r4) |
666 | - subi r1,r4,STACK_FRAME_OVERHEAD |
667 | + std r5, 8(r1) // Save CR in caller's frame |
668 | + std r0, 16(r1) // Save LR in caller's frame |
669 | + // Create frame on emergency stack |
670 | + ld r4, PACAEMERGSP(r13) |
671 | + stdu r1, -SWITCH_FRAME_SIZE(r4) |
672 | + // Switch to new frame on emergency stack |
673 | + mr r1, r4 |
674 | + std r3, 32(r1) // Save SRR1 wakeup value |
675 | SAVE_NVGPRS(r1) |
676 | |
677 | /* |
678 | @@ -350,6 +353,10 @@ kvm_unsplit_wakeup: |
679 | |
680 | kvm_secondary_got_guest: |
681 | |
682 | + // About to go to guest, clear saved SRR1 |
683 | + li r0, 0 |
684 | + std r0, 32(r1) |
685 | + |
686 | /* Set HSTATE_DSCR(r13) to something sensible */ |
687 | ld r6, PACA_DSCR_DEFAULT(r13) |
688 | std r6, HSTATE_DSCR(r13) |
689 | @@ -441,13 +448,12 @@ kvm_no_guest: |
690 | mfspr r4, SPRN_LPCR |
691 | rlwimi r4, r3, 0, LPCR_PECE0 | LPCR_PECE1 |
692 | mtspr SPRN_LPCR, r4 |
693 | - /* set up r3 for return */ |
694 | - mfspr r3,SPRN_SRR1 |
695 | + // Return SRR1 wakeup value, or 0 if we went into the guest |
696 | + ld r3, 32(r1) |
697 | REST_NVGPRS(r1) |
698 | - addi r1, r1, STACK_FRAME_OVERHEAD |
699 | - ld r0, 16(r1) |
700 | - ld r5, 8(r1) |
701 | - ld r1, 0(r1) |
702 | + ld r1, 0(r1) // Switch back to caller stack |
703 | + ld r0, 16(r1) // Reload LR |
704 | + ld r5, 8(r1) // Reload CR |
705 | mtlr r0 |
706 | mtcr r5 |
707 | blr |
708 | diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c |
709 | index 829115bb381f8..4edccb4d4a5ff 100644 |
710 | --- a/arch/xtensa/platforms/xtfpga/setup.c |
711 | +++ b/arch/xtensa/platforms/xtfpga/setup.c |
712 | @@ -50,8 +50,12 @@ void platform_power_off(void) |
713 | |
714 | void platform_restart(void) |
715 | { |
716 | - /* Flush and reset the mmu, simulate a processor reset, and |
717 | - * jump to the reset vector. */ |
718 | + /* Try software reset first. */ |
719 | + WRITE_ONCE(*(u32 *)XTFPGA_SWRST_VADDR, 0xdead); |
720 | + |
721 | + /* If software reset did not work, flush and reset the mmu, |
722 | + * simulate a processor reset, and jump to the reset vector. |
723 | + */ |
724 | cpu_reset(); |
725 | /* control never gets here */ |
726 | } |
727 | @@ -81,7 +85,7 @@ void __init platform_calibrate_ccount(void) |
728 | |
729 | #endif |
730 | |
731 | -#ifdef CONFIG_OF |
732 | +#ifdef CONFIG_USE_OF |
733 | |
734 | static void __init xtfpga_clk_setup(struct device_node *np) |
735 | { |
736 | @@ -299,4 +303,4 @@ static int __init xtavnet_init(void) |
737 | */ |
738 | arch_initcall(xtavnet_init); |
739 | |
740 | -#endif /* CONFIG_OF */ |
741 | +#endif /* CONFIG_USE_OF */ |
742 | diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c |
743 | index e76b7a400a1c1..248bb86f4b3f4 100644 |
744 | --- a/drivers/input/keyboard/snvs_pwrkey.c |
745 | +++ b/drivers/input/keyboard/snvs_pwrkey.c |
746 | @@ -3,6 +3,7 @@ |
747 | // Driver for the IMX SNVS ON/OFF Power Key |
748 | // Copyright (C) 2015 Freescale Semiconductor, Inc. All Rights Reserved. |
749 | |
750 | +#include <linux/clk.h> |
751 | #include <linux/device.h> |
752 | #include <linux/err.h> |
753 | #include <linux/init.h> |
754 | @@ -81,6 +82,11 @@ static irqreturn_t imx_snvs_pwrkey_interrupt(int irq, void *dev_id) |
755 | return IRQ_HANDLED; |
756 | } |
757 | |
758 | +static void imx_snvs_pwrkey_disable_clk(void *data) |
759 | +{ |
760 | + clk_disable_unprepare(data); |
761 | +} |
762 | + |
763 | static void imx_snvs_pwrkey_act(void *pdata) |
764 | { |
765 | struct pwrkey_drv_data *pd = pdata; |
766 | @@ -93,6 +99,7 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev) |
767 | struct pwrkey_drv_data *pdata = NULL; |
768 | struct input_dev *input = NULL; |
769 | struct device_node *np; |
770 | + struct clk *clk; |
771 | int error; |
772 | |
773 | /* Get SNVS register Page */ |
774 | @@ -115,6 +122,28 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev) |
775 | dev_warn(&pdev->dev, "KEY_POWER without setting in dts\n"); |
776 | } |
777 | |
778 | + clk = devm_clk_get_optional(&pdev->dev, NULL); |
779 | + if (IS_ERR(clk)) { |
780 | + dev_err(&pdev->dev, "Failed to get snvs clock (%pe)\n", clk); |
781 | + return PTR_ERR(clk); |
782 | + } |
783 | + |
784 | + error = clk_prepare_enable(clk); |
785 | + if (error) { |
786 | + dev_err(&pdev->dev, "Failed to enable snvs clock (%pe)\n", |
787 | + ERR_PTR(error)); |
788 | + return error; |
789 | + } |
790 | + |
791 | + error = devm_add_action_or_reset(&pdev->dev, |
792 | + imx_snvs_pwrkey_disable_clk, clk); |
793 | + if (error) { |
794 | + dev_err(&pdev->dev, |
795 | + "Failed to register clock cleanup handler (%pe)\n", |
796 | + ERR_PTR(error)); |
797 | + return error; |
798 | + } |
799 | + |
800 | pdata->wakeup = of_property_read_bool(np, "wakeup-source"); |
801 | |
802 | pdata->irq = platform_get_irq(pdev, 0); |
803 | diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c |
804 | index 18de41a266ebe..aa625b7ddcce2 100644 |
805 | --- a/drivers/isdn/capi/kcapi.c |
806 | +++ b/drivers/isdn/capi/kcapi.c |
807 | @@ -565,6 +565,11 @@ int detach_capi_ctr(struct capi_ctr *ctr) |
808 | |
809 | ctr_down(ctr, CAPI_CTR_DETACHED); |
810 | |
811 | + if (ctr->cnr < 1 || ctr->cnr - 1 >= CAPI_MAXCONTR) { |
812 | + err = -EINVAL; |
813 | + goto unlock_out; |
814 | + } |
815 | + |
816 | if (capi_controller[ctr->cnr - 1] != ctr) { |
817 | err = -EINVAL; |
818 | goto unlock_out; |
819 | diff --git a/drivers/isdn/hardware/mISDN/netjet.c b/drivers/isdn/hardware/mISDN/netjet.c |
820 | index 9e6aab04f9d61..8299defff55ae 100644 |
821 | --- a/drivers/isdn/hardware/mISDN/netjet.c |
822 | +++ b/drivers/isdn/hardware/mISDN/netjet.c |
823 | @@ -949,8 +949,8 @@ nj_release(struct tiger_hw *card) |
824 | nj_disable_hwirq(card); |
825 | mode_tiger(&card->bc[0], ISDN_P_NONE); |
826 | mode_tiger(&card->bc[1], ISDN_P_NONE); |
827 | - card->isac.release(&card->isac); |
828 | spin_unlock_irqrestore(&card->lock, flags); |
829 | + card->isac.release(&card->isac); |
830 | release_region(card->base, card->base_s); |
831 | card->base_s = 0; |
832 | } |
833 | diff --git a/drivers/net/can/rcar/rcar_can.c b/drivers/net/can/rcar/rcar_can.c |
834 | index bf5adea9c0a38..ac52288fa3bfe 100644 |
835 | --- a/drivers/net/can/rcar/rcar_can.c |
836 | +++ b/drivers/net/can/rcar/rcar_can.c |
837 | @@ -848,10 +848,12 @@ static int __maybe_unused rcar_can_suspend(struct device *dev) |
838 | struct rcar_can_priv *priv = netdev_priv(ndev); |
839 | u16 ctlr; |
840 | |
841 | - if (netif_running(ndev)) { |
842 | - netif_stop_queue(ndev); |
843 | - netif_device_detach(ndev); |
844 | - } |
845 | + if (!netif_running(ndev)) |
846 | + return 0; |
847 | + |
848 | + netif_stop_queue(ndev); |
849 | + netif_device_detach(ndev); |
850 | + |
851 | ctlr = readw(&priv->regs->ctlr); |
852 | ctlr |= RCAR_CAN_CTLR_CANM_HALT; |
853 | writew(ctlr, &priv->regs->ctlr); |
854 | @@ -870,6 +872,9 @@ static int __maybe_unused rcar_can_resume(struct device *dev) |
855 | u16 ctlr; |
856 | int err; |
857 | |
858 | + if (!netif_running(ndev)) |
859 | + return 0; |
860 | + |
861 | err = clk_enable(priv->clk); |
862 | if (err) { |
863 | netdev_err(ndev, "clk_enable() failed, error %d\n", err); |
864 | @@ -883,10 +888,9 @@ static int __maybe_unused rcar_can_resume(struct device *dev) |
865 | writew(ctlr, &priv->regs->ctlr); |
866 | priv->can.state = CAN_STATE_ERROR_ACTIVE; |
867 | |
868 | - if (netif_running(ndev)) { |
869 | - netif_device_attach(ndev); |
870 | - netif_start_queue(ndev); |
871 | - } |
872 | + netif_device_attach(ndev); |
873 | + netif_start_queue(ndev); |
874 | + |
875 | return 0; |
876 | } |
877 | |
878 | diff --git a/drivers/net/can/sja1000/peak_pci.c b/drivers/net/can/sja1000/peak_pci.c |
879 | index 8c0244f51059e..41a63777030cb 100644 |
880 | --- a/drivers/net/can/sja1000/peak_pci.c |
881 | +++ b/drivers/net/can/sja1000/peak_pci.c |
882 | @@ -731,16 +731,15 @@ static void peak_pci_remove(struct pci_dev *pdev) |
883 | struct net_device *prev_dev = chan->prev_dev; |
884 | |
885 | dev_info(&pdev->dev, "removing device %s\n", dev->name); |
886 | + /* do that only for first channel */ |
887 | + if (!prev_dev && chan->pciec_card) |
888 | + peak_pciec_remove(chan->pciec_card); |
889 | unregister_sja1000dev(dev); |
890 | free_sja1000dev(dev); |
891 | dev = prev_dev; |
892 | |
893 | - if (!dev) { |
894 | - /* do that only for first channel */ |
895 | - if (chan->pciec_card) |
896 | - peak_pciec_remove(chan->pciec_card); |
897 | + if (!dev) |
898 | break; |
899 | - } |
900 | priv = netdev_priv(dev); |
901 | chan = priv->priv; |
902 | } |
903 | diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c |
904 | index 96bbdef672bc9..571d9b0bfe518 100644 |
905 | --- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c |
906 | +++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c |
907 | @@ -551,11 +551,10 @@ static int pcan_usb_fd_decode_status(struct pcan_usb_fd_if *usb_if, |
908 | } else if (sm->channel_p_w_b & PUCAN_BUS_WARNING) { |
909 | new_state = CAN_STATE_ERROR_WARNING; |
910 | } else { |
911 | - /* no error bit (so, no error skb, back to active state) */ |
912 | - dev->can.state = CAN_STATE_ERROR_ACTIVE; |
913 | + /* back to (or still in) ERROR_ACTIVE state */ |
914 | + new_state = CAN_STATE_ERROR_ACTIVE; |
915 | pdev->bec.txerr = 0; |
916 | pdev->bec.rxerr = 0; |
917 | - return 0; |
918 | } |
919 | |
920 | /* state hasn't changed */ |
921 | diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c |
922 | index 3225de0f655f2..60e36f46f8abe 100644 |
923 | --- a/drivers/net/dsa/lantiq_gswip.c |
924 | +++ b/drivers/net/dsa/lantiq_gswip.c |
925 | @@ -229,7 +229,7 @@ |
926 | #define GSWIP_SDMA_PCTRLp(p) (0xBC0 + ((p) * 0x6)) |
927 | #define GSWIP_SDMA_PCTRL_EN BIT(0) /* SDMA Port Enable */ |
928 | #define GSWIP_SDMA_PCTRL_FCEN BIT(1) /* Flow Control Enable */ |
929 | -#define GSWIP_SDMA_PCTRL_PAUFWD BIT(1) /* Pause Frame Forwarding */ |
930 | +#define GSWIP_SDMA_PCTRL_PAUFWD BIT(3) /* Pause Frame Forwarding */ |
931 | |
932 | #define GSWIP_TABLE_ACTIVE_VLAN 0x01 |
933 | #define GSWIP_TABLE_VLAN_MAPPING 0x02 |
934 | diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c |
935 | index 89121d7ce3e6f..636aa6d81d8fe 100644 |
936 | --- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c |
937 | +++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c |
938 | @@ -155,7 +155,7 @@ static const struct { |
939 | { ENETC_PM0_TFRM, "MAC tx frames" }, |
940 | { ENETC_PM0_TFCS, "MAC tx fcs errors" }, |
941 | { ENETC_PM0_TVLAN, "MAC tx VLAN frames" }, |
942 | - { ENETC_PM0_TERR, "MAC tx frames" }, |
943 | + { ENETC_PM0_TERR, "MAC tx frame errors" }, |
944 | { ENETC_PM0_TUCA, "MAC tx unicast frames" }, |
945 | { ENETC_PM0_TMCA, "MAC tx multicast frames" }, |
946 | { ENETC_PM0_TBCA, "MAC tx broadcast frames" }, |
947 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c b/drivers/net/ethernet/hisilicon/hns3/hnae3.c |
948 | index 03ca7d925e8e0..2e38c7d214c45 100644 |
949 | --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.c |
950 | +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c |
951 | @@ -10,6 +10,27 @@ static LIST_HEAD(hnae3_ae_algo_list); |
952 | static LIST_HEAD(hnae3_client_list); |
953 | static LIST_HEAD(hnae3_ae_dev_list); |
954 | |
955 | +void hnae3_unregister_ae_algo_prepare(struct hnae3_ae_algo *ae_algo) |
956 | +{ |
957 | + const struct pci_device_id *pci_id; |
958 | + struct hnae3_ae_dev *ae_dev; |
959 | + |
960 | + if (!ae_algo) |
961 | + return; |
962 | + |
963 | + list_for_each_entry(ae_dev, &hnae3_ae_dev_list, node) { |
964 | + if (!hnae3_get_bit(ae_dev->flag, HNAE3_DEV_INITED_B)) |
965 | + continue; |
966 | + |
967 | + pci_id = pci_match_id(ae_algo->pdev_id_table, ae_dev->pdev); |
968 | + if (!pci_id) |
969 | + continue; |
970 | + if (IS_ENABLED(CONFIG_PCI_IOV)) |
971 | + pci_disable_sriov(ae_dev->pdev); |
972 | + } |
973 | +} |
974 | +EXPORT_SYMBOL(hnae3_unregister_ae_algo_prepare); |
975 | + |
976 | /* we are keeping things simple and using single lock for all the |
977 | * list. This is a non-critical code so other updations, if happen |
978 | * in parallel, can wait. |
979 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h |
980 | index 0db835d87d09d..6cf8490110642 100644 |
981 | --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h |
982 | +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h |
983 | @@ -666,6 +666,7 @@ struct hnae3_handle { |
984 | int hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev); |
985 | void hnae3_unregister_ae_dev(struct hnae3_ae_dev *ae_dev); |
986 | |
987 | +void hnae3_unregister_ae_algo_prepare(struct hnae3_ae_algo *ae_algo); |
988 | void hnae3_unregister_ae_algo(struct hnae3_ae_algo *ae_algo); |
989 | void hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo); |
990 | |
991 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c |
992 | index d16488bab86f5..9076605403a74 100644 |
993 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c |
994 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c |
995 | @@ -132,6 +132,15 @@ static int hclge_ets_validate(struct hclge_dev *hdev, struct ieee_ets *ets, |
996 | *changed = true; |
997 | break; |
998 | case IEEE_8021QAZ_TSA_ETS: |
999 | + /* The hardware will switch to sp mode if bandwidth is |
1000 | + * 0, so limit ets bandwidth must be greater than 0. |
1001 | + */ |
1002 | + if (!ets->tc_tx_bw[i]) { |
1003 | + dev_err(&hdev->pdev->dev, |
1004 | + "tc%u ets bw cannot be 0\n", i); |
1005 | + return -EINVAL; |
1006 | + } |
1007 | + |
1008 | if (hdev->tm_info.tc_info[i].tc_sch_mode != |
1009 | HCLGE_SCH_MODE_DWRR) |
1010 | *changed = true; |
1011 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c |
1012 | index f44e8401496b1..8ecfabaefa85b 100644 |
1013 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c |
1014 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c |
1015 | @@ -10274,6 +10274,7 @@ static int hclge_init(void) |
1016 | |
1017 | static void hclge_exit(void) |
1018 | { |
1019 | + hnae3_unregister_ae_algo_prepare(&ae_algo); |
1020 | hnae3_unregister_ae_algo(&ae_algo); |
1021 | } |
1022 | module_init(hclge_init); |
1023 | diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c |
1024 | index 62399cc1c5a63..d98f0e2ec7aa3 100644 |
1025 | --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c |
1026 | +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c |
1027 | @@ -633,6 +633,8 @@ static void hclge_tm_pg_info_init(struct hclge_dev *hdev) |
1028 | hdev->tm_info.pg_info[i].tc_bit_map = hdev->hw_tc_map; |
1029 | for (k = 0; k < hdev->tm_info.num_tc; k++) |
1030 | hdev->tm_info.pg_info[i].tc_dwrr[k] = BW_PERCENT; |
1031 | + for (; k < HNAE3_MAX_TC; k++) |
1032 | + hdev->tm_info.pg_info[i].tc_dwrr[k] = 0; |
1033 | } |
1034 | } |
1035 | |
1036 | diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c |
1037 | index fad503820e040..b3365b34cac7c 100644 |
1038 | --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c |
1039 | +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c |
1040 | @@ -71,6 +71,7 @@ err_remove_config_dt: |
1041 | |
1042 | static const struct of_device_id dwmac_generic_match[] = { |
1043 | { .compatible = "st,spear600-gmac"}, |
1044 | + { .compatible = "snps,dwmac-3.40a"}, |
1045 | { .compatible = "snps,dwmac-3.50a"}, |
1046 | { .compatible = "snps,dwmac-3.610"}, |
1047 | { .compatible = "snps,dwmac-3.70a"}, |
1048 | diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
1049 | index 835ac178bc8c0..94c652b9a0a8b 100644 |
1050 | --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
1051 | +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
1052 | @@ -604,7 +604,7 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr) |
1053 | config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT; |
1054 | ptp_v2 = PTP_TCR_TSVER2ENA; |
1055 | snap_type_sel = PTP_TCR_SNAPTYPSEL_1; |
1056 | - if (priv->synopsys_id != DWMAC_CORE_5_10) |
1057 | + if (priv->synopsys_id < DWMAC_CORE_4_10) |
1058 | ts_event_en = PTP_TCR_TSEVNTENA; |
1059 | ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA; |
1060 | ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA; |
1061 | diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c |
1062 | index 678aa2b001e01..a46fea472bc46 100644 |
1063 | --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c |
1064 | +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c |
1065 | @@ -505,6 +505,14 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) |
1066 | plat->pmt = 1; |
1067 | } |
1068 | |
1069 | + if (of_device_is_compatible(np, "snps,dwmac-3.40a")) { |
1070 | + plat->has_gmac = 1; |
1071 | + plat->enh_desc = 1; |
1072 | + plat->tx_coe = 1; |
1073 | + plat->bugged_jumbo = 1; |
1074 | + plat->pmt = 1; |
1075 | + } |
1076 | + |
1077 | if (of_device_is_compatible(np, "snps,dwmac-4.00") || |
1078 | of_device_is_compatible(np, "snps,dwmac-4.10a") || |
1079 | of_device_is_compatible(np, "snps,dwmac-4.20a")) { |
1080 | diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c |
1081 | index bec73f0640d03..8377ff229a303 100644 |
1082 | --- a/drivers/net/phy/mdio_bus.c |
1083 | +++ b/drivers/net/phy/mdio_bus.c |
1084 | @@ -395,6 +395,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) |
1085 | err = device_register(&bus->dev); |
1086 | if (err) { |
1087 | pr_err("mii_bus %s failed to register\n", bus->id); |
1088 | + put_device(&bus->dev); |
1089 | return -EINVAL; |
1090 | } |
1091 | |
1092 | diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig |
1093 | index ca234d1a0e3bf..d7005cc76ce91 100644 |
1094 | --- a/drivers/net/usb/Kconfig |
1095 | +++ b/drivers/net/usb/Kconfig |
1096 | @@ -117,6 +117,7 @@ config USB_LAN78XX |
1097 | select PHYLIB |
1098 | select MICROCHIP_PHY |
1099 | select FIXED_PHY |
1100 | + select CRC32 |
1101 | help |
1102 | This option adds support for Microchip LAN78XX based USB 2 |
1103 | & USB 3 10/100/1000 Ethernet adapters. |
1104 | diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c |
1105 | index bac1d040bacab..138cbc012cd89 100644 |
1106 | --- a/drivers/pinctrl/stm32/pinctrl-stm32.c |
1107 | +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c |
1108 | @@ -1554,8 +1554,8 @@ int __maybe_unused stm32_pinctrl_resume(struct device *dev) |
1109 | struct stm32_pinctrl_group *g = pctl->groups; |
1110 | int i; |
1111 | |
1112 | - for (i = g->pin; i < g->pin + pctl->ngroups; i++) |
1113 | - stm32_pinctrl_restore_gpio_regs(pctl, i); |
1114 | + for (i = 0; i < pctl->ngroups; i++, g++) |
1115 | + stm32_pinctrl_restore_gpio_regs(pctl, g->pin); |
1116 | |
1117 | return 0; |
1118 | } |
1119 | diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c |
1120 | index e330ec73c465d..bcb516892d01d 100644 |
1121 | --- a/drivers/platform/x86/intel_scu_ipc.c |
1122 | +++ b/drivers/platform/x86/intel_scu_ipc.c |
1123 | @@ -181,7 +181,7 @@ static inline int busy_loop(struct intel_scu_ipc_dev *scu) |
1124 | return 0; |
1125 | } |
1126 | |
1127 | -/* Wait till ipc ioc interrupt is received or timeout in 3 HZ */ |
1128 | +/* Wait till ipc ioc interrupt is received or timeout in 10 HZ */ |
1129 | static inline int ipc_wait_for_interrupt(struct intel_scu_ipc_dev *scu) |
1130 | { |
1131 | int status; |
1132 | diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c |
1133 | index 7c736e4ddafe7..45885e80992fb 100644 |
1134 | --- a/drivers/scsi/hosts.c |
1135 | +++ b/drivers/scsi/hosts.c |
1136 | @@ -219,7 +219,8 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev, |
1137 | goto fail; |
1138 | } |
1139 | |
1140 | - shost->cmd_per_lun = min_t(short, shost->cmd_per_lun, |
1141 | + /* Use min_t(int, ...) in case shost->can_queue exceeds SHRT_MAX */ |
1142 | + shost->cmd_per_lun = min_t(int, shost->cmd_per_lun, |
1143 | shost->can_queue); |
1144 | |
1145 | error = scsi_init_sense_cache(shost); |
1146 | diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c |
1147 | index 4bb4c8f28cbd7..5eaef45799e61 100644 |
1148 | --- a/drivers/tee/optee/core.c |
1149 | +++ b/drivers/tee/optee/core.c |
1150 | @@ -582,6 +582,9 @@ static struct optee *optee_probe(struct device_node *np) |
1151 | if (sec_caps & OPTEE_SMC_SEC_CAP_DYNAMIC_SHM) |
1152 | pool = optee_config_dyn_shm(); |
1153 | |
1154 | + /* Unregister OP-TEE specific client devices on TEE bus */ |
1155 | + optee_unregister_devices(); |
1156 | + |
1157 | /* |
1158 | * If dynamic shared memory is not available or failed - try static one |
1159 | */ |
1160 | diff --git a/drivers/tee/optee/device.c b/drivers/tee/optee/device.c |
1161 | index e3a148521ec1d..acff7dd677d67 100644 |
1162 | --- a/drivers/tee/optee/device.c |
1163 | +++ b/drivers/tee/optee/device.c |
1164 | @@ -65,6 +65,13 @@ static int get_devices(struct tee_context *ctx, u32 session, |
1165 | return 0; |
1166 | } |
1167 | |
1168 | +static void optee_release_device(struct device *dev) |
1169 | +{ |
1170 | + struct tee_client_device *optee_device = to_tee_client_device(dev); |
1171 | + |
1172 | + kfree(optee_device); |
1173 | +} |
1174 | + |
1175 | static int optee_register_device(const uuid_t *device_uuid, u32 device_id) |
1176 | { |
1177 | struct tee_client_device *optee_device = NULL; |
1178 | @@ -75,6 +82,7 @@ static int optee_register_device(const uuid_t *device_uuid, u32 device_id) |
1179 | return -ENOMEM; |
1180 | |
1181 | optee_device->dev.bus = &tee_bus_type; |
1182 | + optee_device->dev.release = optee_release_device; |
1183 | dev_set_name(&optee_device->dev, "optee-clnt%u", device_id); |
1184 | uuid_copy(&optee_device->id.uuid, device_uuid); |
1185 | |
1186 | @@ -158,3 +166,17 @@ out_ctx: |
1187 | |
1188 | return rc; |
1189 | } |
1190 | + |
1191 | +static int __optee_unregister_device(struct device *dev, void *data) |
1192 | +{ |
1193 | + if (!strncmp(dev_name(dev), "optee-clnt", strlen("optee-clnt"))) |
1194 | + device_unregister(dev); |
1195 | + |
1196 | + return 0; |
1197 | +} |
1198 | + |
1199 | +void optee_unregister_devices(void) |
1200 | +{ |
1201 | + bus_for_each_dev(&tee_bus_type, NULL, NULL, |
1202 | + __optee_unregister_device); |
1203 | +} |
1204 | diff --git a/drivers/tee/optee/optee_private.h b/drivers/tee/optee/optee_private.h |
1205 | index 3eeaad2a28686..54c3fa01d0024 100644 |
1206 | --- a/drivers/tee/optee/optee_private.h |
1207 | +++ b/drivers/tee/optee/optee_private.h |
1208 | @@ -175,6 +175,7 @@ void optee_fill_pages_list(u64 *dst, struct page **pages, int num_pages, |
1209 | size_t page_offset); |
1210 | |
1211 | int optee_enumerate_devices(void); |
1212 | +void optee_unregister_devices(void); |
1213 | |
1214 | /* |
1215 | * Small helpers |
1216 | diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c |
1217 | index 9d358dafef367..f342055699870 100644 |
1218 | --- a/fs/btrfs/tree-log.c |
1219 | +++ b/fs/btrfs/tree-log.c |
1220 | @@ -900,9 +900,11 @@ out: |
1221 | } |
1222 | |
1223 | /* |
1224 | - * helper function to see if a given name and sequence number found |
1225 | - * in an inode back reference are already in a directory and correctly |
1226 | - * point to this inode |
1227 | + * See if a given name and sequence number found in an inode back reference are |
1228 | + * already in a directory and correctly point to this inode. |
1229 | + * |
1230 | + * Returns: < 0 on error, 0 if the directory entry does not exists and 1 if it |
1231 | + * exists. |
1232 | */ |
1233 | static noinline int inode_in_dir(struct btrfs_root *root, |
1234 | struct btrfs_path *path, |
1235 | @@ -911,29 +913,35 @@ static noinline int inode_in_dir(struct btrfs_root *root, |
1236 | { |
1237 | struct btrfs_dir_item *di; |
1238 | struct btrfs_key location; |
1239 | - int match = 0; |
1240 | + int ret = 0; |
1241 | |
1242 | di = btrfs_lookup_dir_index_item(NULL, root, path, dirid, |
1243 | index, name, name_len, 0); |
1244 | - if (di && !IS_ERR(di)) { |
1245 | + if (IS_ERR(di)) { |
1246 | + if (PTR_ERR(di) != -ENOENT) |
1247 | + ret = PTR_ERR(di); |
1248 | + goto out; |
1249 | + } else if (di) { |
1250 | btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); |
1251 | if (location.objectid != objectid) |
1252 | goto out; |
1253 | - } else |
1254 | + } else { |
1255 | goto out; |
1256 | - btrfs_release_path(path); |
1257 | + } |
1258 | |
1259 | + btrfs_release_path(path); |
1260 | di = btrfs_lookup_dir_item(NULL, root, path, dirid, name, name_len, 0); |
1261 | - if (di && !IS_ERR(di)) { |
1262 | - btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); |
1263 | - if (location.objectid != objectid) |
1264 | - goto out; |
1265 | - } else |
1266 | + if (IS_ERR(di)) { |
1267 | + ret = PTR_ERR(di); |
1268 | goto out; |
1269 | - match = 1; |
1270 | + } else if (di) { |
1271 | + btrfs_dir_item_key_to_cpu(path->nodes[0], di, &location); |
1272 | + if (location.objectid == objectid) |
1273 | + ret = 1; |
1274 | + } |
1275 | out: |
1276 | btrfs_release_path(path); |
1277 | - return match; |
1278 | + return ret; |
1279 | } |
1280 | |
1281 | /* |
1282 | @@ -1500,10 +1508,12 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans, |
1283 | if (ret) |
1284 | goto out; |
1285 | |
1286 | - /* if we already have a perfect match, we're done */ |
1287 | - if (!inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)), |
1288 | - btrfs_ino(BTRFS_I(inode)), ref_index, |
1289 | - name, namelen)) { |
1290 | + ret = inode_in_dir(root, path, btrfs_ino(BTRFS_I(dir)), |
1291 | + btrfs_ino(BTRFS_I(inode)), ref_index, |
1292 | + name, namelen); |
1293 | + if (ret < 0) { |
1294 | + goto out; |
1295 | + } else if (ret == 0) { |
1296 | /* |
1297 | * look for a conflicting back reference in the |
1298 | * metadata. if we find one we have to unlink that name |
1299 | @@ -1561,6 +1571,7 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans, |
1300 | |
1301 | btrfs_update_inode(trans, root, inode); |
1302 | } |
1303 | + /* Else, ret == 1, we already have a perfect match, we're done. */ |
1304 | |
1305 | ref_ptr = (unsigned long)(ref_ptr + ref_struct_size) + namelen; |
1306 | kfree(name); |
1307 | diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c |
1308 | index 0fad044a5752b..06e9b26bf277a 100644 |
1309 | --- a/fs/ceph/caps.c |
1310 | +++ b/fs/ceph/caps.c |
1311 | @@ -2249,7 +2249,6 @@ static int unsafe_request_wait(struct inode *inode) |
1312 | |
1313 | int ceph_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
1314 | { |
1315 | - struct ceph_file_info *fi = file->private_data; |
1316 | struct inode *inode = file->f_mapping->host; |
1317 | struct ceph_inode_info *ci = ceph_inode(inode); |
1318 | u64 flush_tid; |
1319 | @@ -2280,14 +2279,9 @@ int ceph_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
1320 | if (err < 0) |
1321 | ret = err; |
1322 | |
1323 | - if (errseq_check(&ci->i_meta_err, READ_ONCE(fi->meta_err))) { |
1324 | - spin_lock(&file->f_lock); |
1325 | - err = errseq_check_and_advance(&ci->i_meta_err, |
1326 | - &fi->meta_err); |
1327 | - spin_unlock(&file->f_lock); |
1328 | - if (err < 0) |
1329 | - ret = err; |
1330 | - } |
1331 | + err = file_check_and_advance_wb_err(file); |
1332 | + if (err < 0) |
1333 | + ret = err; |
1334 | out: |
1335 | dout("fsync %p%s result=%d\n", inode, datasync ? " datasync" : "", ret); |
1336 | return ret; |
1337 | diff --git a/fs/ceph/file.c b/fs/ceph/file.c |
1338 | index 34785a203461d..aa1eac6d89f2e 100644 |
1339 | --- a/fs/ceph/file.c |
1340 | +++ b/fs/ceph/file.c |
1341 | @@ -234,7 +234,6 @@ static int ceph_init_file_info(struct inode *inode, struct file *file, |
1342 | fi->fmode = fmode; |
1343 | spin_lock_init(&fi->rw_contexts_lock); |
1344 | INIT_LIST_HEAD(&fi->rw_contexts); |
1345 | - fi->meta_err = errseq_sample(&ci->i_meta_err); |
1346 | fi->filp_gen = READ_ONCE(ceph_inode_to_client(inode)->filp_gen); |
1347 | |
1348 | return 0; |
1349 | diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c |
1350 | index 5beebbbb42f09..af85a72376040 100644 |
1351 | --- a/fs/ceph/inode.c |
1352 | +++ b/fs/ceph/inode.c |
1353 | @@ -515,8 +515,6 @@ struct inode *ceph_alloc_inode(struct super_block *sb) |
1354 | |
1355 | ceph_fscache_inode_init(ci); |
1356 | |
1357 | - ci->i_meta_err = 0; |
1358 | - |
1359 | return &ci->vfs_inode; |
1360 | } |
1361 | |
1362 | diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c |
1363 | index 1ef370913c007..37fb71797b341 100644 |
1364 | --- a/fs/ceph/mds_client.c |
1365 | +++ b/fs/ceph/mds_client.c |
1366 | @@ -1272,7 +1272,6 @@ static void cleanup_session_requests(struct ceph_mds_client *mdsc, |
1367 | { |
1368 | struct ceph_mds_request *req; |
1369 | struct rb_node *p; |
1370 | - struct ceph_inode_info *ci; |
1371 | |
1372 | dout("cleanup_session_requests mds%d\n", session->s_mds); |
1373 | mutex_lock(&mdsc->mutex); |
1374 | @@ -1281,16 +1280,10 @@ static void cleanup_session_requests(struct ceph_mds_client *mdsc, |
1375 | struct ceph_mds_request, r_unsafe_item); |
1376 | pr_warn_ratelimited(" dropping unsafe request %llu\n", |
1377 | req->r_tid); |
1378 | - if (req->r_target_inode) { |
1379 | - /* dropping unsafe change of inode's attributes */ |
1380 | - ci = ceph_inode(req->r_target_inode); |
1381 | - errseq_set(&ci->i_meta_err, -EIO); |
1382 | - } |
1383 | - if (req->r_unsafe_dir) { |
1384 | - /* dropping unsafe directory operation */ |
1385 | - ci = ceph_inode(req->r_unsafe_dir); |
1386 | - errseq_set(&ci->i_meta_err, -EIO); |
1387 | - } |
1388 | + if (req->r_target_inode) |
1389 | + mapping_set_error(req->r_target_inode->i_mapping, -EIO); |
1390 | + if (req->r_unsafe_dir) |
1391 | + mapping_set_error(req->r_unsafe_dir->i_mapping, -EIO); |
1392 | __unregister_request(mdsc, req); |
1393 | } |
1394 | /* zero r_attempts, so kick_requests() will re-send requests */ |
1395 | @@ -1436,7 +1429,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap, |
1396 | spin_unlock(&mdsc->cap_dirty_lock); |
1397 | |
1398 | if (dirty_dropped) { |
1399 | - errseq_set(&ci->i_meta_err, -EIO); |
1400 | + mapping_set_error(inode->i_mapping, -EIO); |
1401 | |
1402 | if (ci->i_wrbuffer_ref_head == 0 && |
1403 | ci->i_wr_ref == 0 && |
1404 | diff --git a/fs/ceph/super.h b/fs/ceph/super.h |
1405 | index 8ffc8e88dd3d2..6db7b3387e1cc 100644 |
1406 | --- a/fs/ceph/super.h |
1407 | +++ b/fs/ceph/super.h |
1408 | @@ -402,8 +402,6 @@ struct ceph_inode_info { |
1409 | struct fscache_cookie *fscache; |
1410 | u32 i_fscache_gen; |
1411 | #endif |
1412 | - errseq_t i_meta_err; |
1413 | - |
1414 | struct inode vfs_inode; /* at end */ |
1415 | }; |
1416 | |
1417 | @@ -712,7 +710,6 @@ struct ceph_file_info { |
1418 | spinlock_t rw_contexts_lock; |
1419 | struct list_head rw_contexts; |
1420 | |
1421 | - errseq_t meta_err; |
1422 | u32 filp_gen; |
1423 | atomic_t num_locks; |
1424 | }; |
1425 | diff --git a/fs/exec.c b/fs/exec.c |
1426 | index 1b4d2206d53a1..098de820abcc9 100644 |
1427 | --- a/fs/exec.c |
1428 | +++ b/fs/exec.c |
1429 | @@ -988,7 +988,7 @@ int kernel_read_file_from_fd(int fd, void **buf, loff_t *size, loff_t max_size, |
1430 | struct fd f = fdget(fd); |
1431 | int ret = -EBADF; |
1432 | |
1433 | - if (!f.file) |
1434 | + if (!f.file || !(f.file->f_mode & FMODE_READ)) |
1435 | goto out; |
1436 | |
1437 | ret = kernel_read_file(f.file, buf, size, max_size, id); |
1438 | diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c |
1439 | index 8e03d6c25097a..730386c130e0f 100644 |
1440 | --- a/fs/nfsd/nfsctl.c |
1441 | +++ b/fs/nfsd/nfsctl.c |
1442 | @@ -792,7 +792,10 @@ out_close: |
1443 | svc_xprt_put(xprt); |
1444 | } |
1445 | out_err: |
1446 | - nfsd_destroy(net); |
1447 | + if (!list_empty(&nn->nfsd_serv->sv_permsocks)) |
1448 | + nn->nfsd_serv->sv_nrthreads--; |
1449 | + else |
1450 | + nfsd_destroy(net); |
1451 | return err; |
1452 | } |
1453 | |
1454 | diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c |
1455 | index 0a6fe7d5aba74..4db87b26cf7b2 100644 |
1456 | --- a/fs/ocfs2/alloc.c |
1457 | +++ b/fs/ocfs2/alloc.c |
1458 | @@ -7048,7 +7048,7 @@ void ocfs2_set_inode_data_inline(struct inode *inode, struct ocfs2_dinode *di) |
1459 | int ocfs2_convert_inline_data_to_extents(struct inode *inode, |
1460 | struct buffer_head *di_bh) |
1461 | { |
1462 | - int ret, i, has_data, num_pages = 0; |
1463 | + int ret, has_data, num_pages = 0; |
1464 | int need_free = 0; |
1465 | u32 bit_off, num; |
1466 | handle_t *handle; |
1467 | @@ -7057,26 +7057,17 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, |
1468 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
1469 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; |
1470 | struct ocfs2_alloc_context *data_ac = NULL; |
1471 | - struct page **pages = NULL; |
1472 | - loff_t end = osb->s_clustersize; |
1473 | + struct page *page = NULL; |
1474 | struct ocfs2_extent_tree et; |
1475 | int did_quota = 0; |
1476 | |
1477 | has_data = i_size_read(inode) ? 1 : 0; |
1478 | |
1479 | if (has_data) { |
1480 | - pages = kcalloc(ocfs2_pages_per_cluster(osb->sb), |
1481 | - sizeof(struct page *), GFP_NOFS); |
1482 | - if (pages == NULL) { |
1483 | - ret = -ENOMEM; |
1484 | - mlog_errno(ret); |
1485 | - return ret; |
1486 | - } |
1487 | - |
1488 | ret = ocfs2_reserve_clusters(osb, 1, &data_ac); |
1489 | if (ret) { |
1490 | mlog_errno(ret); |
1491 | - goto free_pages; |
1492 | + goto out; |
1493 | } |
1494 | } |
1495 | |
1496 | @@ -7096,7 +7087,8 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, |
1497 | } |
1498 | |
1499 | if (has_data) { |
1500 | - unsigned int page_end; |
1501 | + unsigned int page_end = min_t(unsigned, PAGE_SIZE, |
1502 | + osb->s_clustersize); |
1503 | u64 phys; |
1504 | |
1505 | ret = dquot_alloc_space_nodirty(inode, |
1506 | @@ -7120,15 +7112,8 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, |
1507 | */ |
1508 | block = phys = ocfs2_clusters_to_blocks(inode->i_sb, bit_off); |
1509 | |
1510 | - /* |
1511 | - * Non sparse file systems zero on extend, so no need |
1512 | - * to do that now. |
1513 | - */ |
1514 | - if (!ocfs2_sparse_alloc(osb) && |
1515 | - PAGE_SIZE < osb->s_clustersize) |
1516 | - end = PAGE_SIZE; |
1517 | - |
1518 | - ret = ocfs2_grab_eof_pages(inode, 0, end, pages, &num_pages); |
1519 | + ret = ocfs2_grab_eof_pages(inode, 0, page_end, &page, |
1520 | + &num_pages); |
1521 | if (ret) { |
1522 | mlog_errno(ret); |
1523 | need_free = 1; |
1524 | @@ -7139,20 +7124,15 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, |
1525 | * This should populate the 1st page for us and mark |
1526 | * it up to date. |
1527 | */ |
1528 | - ret = ocfs2_read_inline_data(inode, pages[0], di_bh); |
1529 | + ret = ocfs2_read_inline_data(inode, page, di_bh); |
1530 | if (ret) { |
1531 | mlog_errno(ret); |
1532 | need_free = 1; |
1533 | goto out_unlock; |
1534 | } |
1535 | |
1536 | - page_end = PAGE_SIZE; |
1537 | - if (PAGE_SIZE > osb->s_clustersize) |
1538 | - page_end = osb->s_clustersize; |
1539 | - |
1540 | - for (i = 0; i < num_pages; i++) |
1541 | - ocfs2_map_and_dirty_page(inode, handle, 0, page_end, |
1542 | - pages[i], i > 0, &phys); |
1543 | + ocfs2_map_and_dirty_page(inode, handle, 0, page_end, page, 0, |
1544 | + &phys); |
1545 | } |
1546 | |
1547 | spin_lock(&oi->ip_lock); |
1548 | @@ -7183,8 +7163,8 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, |
1549 | } |
1550 | |
1551 | out_unlock: |
1552 | - if (pages) |
1553 | - ocfs2_unlock_and_free_pages(pages, num_pages); |
1554 | + if (page) |
1555 | + ocfs2_unlock_and_free_pages(&page, num_pages); |
1556 | |
1557 | out_commit: |
1558 | if (ret < 0 && did_quota) |
1559 | @@ -7208,8 +7188,6 @@ out_commit: |
1560 | out: |
1561 | if (data_ac) |
1562 | ocfs2_free_alloc_context(data_ac); |
1563 | -free_pages: |
1564 | - kfree(pages); |
1565 | return ret; |
1566 | } |
1567 | |
1568 | diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c |
1569 | index 60b4b6df1ed36..eaec97892dce8 100644 |
1570 | --- a/fs/ocfs2/super.c |
1571 | +++ b/fs/ocfs2/super.c |
1572 | @@ -2150,11 +2150,17 @@ static int ocfs2_initialize_super(struct super_block *sb, |
1573 | } |
1574 | |
1575 | if (ocfs2_clusterinfo_valid(osb)) { |
1576 | + /* |
1577 | + * ci_stack and ci_cluster in ocfs2_cluster_info may not be null |
1578 | + * terminated, so make sure no overflow happens here by using |
1579 | + * memcpy. Destination strings will always be null terminated |
1580 | + * because osb is allocated using kzalloc. |
1581 | + */ |
1582 | osb->osb_stackflags = |
1583 | OCFS2_RAW_SB(di)->s_cluster_info.ci_stackflags; |
1584 | - strlcpy(osb->osb_cluster_stack, |
1585 | + memcpy(osb->osb_cluster_stack, |
1586 | OCFS2_RAW_SB(di)->s_cluster_info.ci_stack, |
1587 | - OCFS2_STACK_LABEL_LEN + 1); |
1588 | + OCFS2_STACK_LABEL_LEN); |
1589 | if (strlen(osb->osb_cluster_stack) != OCFS2_STACK_LABEL_LEN) { |
1590 | mlog(ML_ERROR, |
1591 | "couldn't mount because of an invalid " |
1592 | @@ -2163,9 +2169,9 @@ static int ocfs2_initialize_super(struct super_block *sb, |
1593 | status = -EINVAL; |
1594 | goto bail; |
1595 | } |
1596 | - strlcpy(osb->osb_cluster_name, |
1597 | + memcpy(osb->osb_cluster_name, |
1598 | OCFS2_RAW_SB(di)->s_cluster_info.ci_cluster, |
1599 | - OCFS2_CLUSTER_NAME_LEN + 1); |
1600 | + OCFS2_CLUSTER_NAME_LEN); |
1601 | } else { |
1602 | /* The empty string is identical with classic tools that |
1603 | * don't know about s_cluster_info. */ |
1604 | diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h |
1605 | index b81f9e1d74b0a..9d249dfbab726 100644 |
1606 | --- a/include/linux/elfcore.h |
1607 | +++ b/include/linux/elfcore.h |
1608 | @@ -58,7 +58,7 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse |
1609 | } |
1610 | #endif |
1611 | |
1612 | -#if defined(CONFIG_UM) || defined(CONFIG_IA64) |
1613 | +#if (defined(CONFIG_UML) && defined(CONFIG_X86_32)) || defined(CONFIG_IA64) |
1614 | /* |
1615 | * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out |
1616 | * extra segments containing the gate DSO contents. Dumping its |
1617 | diff --git a/kernel/auditsc.c b/kernel/auditsc.c |
1618 | index 4effe01ebbe2b..d33c5dccde1c7 100644 |
1619 | --- a/kernel/auditsc.c |
1620 | +++ b/kernel/auditsc.c |
1621 | @@ -624,7 +624,7 @@ static int audit_filter_rules(struct task_struct *tsk, |
1622 | result = audit_comparator(audit_loginuid_set(tsk), f->op, f->val); |
1623 | break; |
1624 | case AUDIT_SADDR_FAM: |
1625 | - if (ctx->sockaddr) |
1626 | + if (ctx && ctx->sockaddr) |
1627 | result = audit_comparator(ctx->sockaddr->ss_family, |
1628 | f->op, f->val); |
1629 | break; |
1630 | diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c |
1631 | index 01e893cf9b9f7..b28665f4d8c7a 100644 |
1632 | --- a/kernel/dma/debug.c |
1633 | +++ b/kernel/dma/debug.c |
1634 | @@ -1354,6 +1354,12 @@ void debug_dma_map_sg(struct device *dev, struct scatterlist *sg, |
1635 | if (unlikely(dma_debug_disabled())) |
1636 | return; |
1637 | |
1638 | + for_each_sg(sg, s, nents, i) { |
1639 | + check_for_stack(dev, sg_page(s), s->offset); |
1640 | + if (!PageHighMem(sg_page(s))) |
1641 | + check_for_illegal_area(dev, sg_virt(s), s->length); |
1642 | + } |
1643 | + |
1644 | for_each_sg(sg, s, mapped_ents, i) { |
1645 | entry = dma_entry_alloc(); |
1646 | if (!entry) |
1647 | @@ -1369,12 +1375,6 @@ void debug_dma_map_sg(struct device *dev, struct scatterlist *sg, |
1648 | entry->sg_call_ents = nents; |
1649 | entry->sg_mapped_ents = mapped_ents; |
1650 | |
1651 | - check_for_stack(dev, sg_page(s), s->offset); |
1652 | - |
1653 | - if (!PageHighMem(sg_page(s))) { |
1654 | - check_for_illegal_area(dev, sg_virt(s), sg_dma_len(s)); |
1655 | - } |
1656 | - |
1657 | check_sg_segment(dev, s); |
1658 | |
1659 | add_dma_entry(entry); |
1660 | diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c |
1661 | index 2b55016d5164b..efc338969b98b 100644 |
1662 | --- a/kernel/trace/ftrace.c |
1663 | +++ b/kernel/trace/ftrace.c |
1664 | @@ -6336,7 +6336,7 @@ __ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, |
1665 | struct ftrace_ops *op; |
1666 | int bit; |
1667 | |
1668 | - bit = trace_test_and_set_recursion(TRACE_LIST_START, TRACE_LIST_MAX); |
1669 | + bit = trace_test_and_set_recursion(TRACE_LIST_START); |
1670 | if (bit < 0) |
1671 | return; |
1672 | |
1673 | @@ -6411,7 +6411,7 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip, |
1674 | { |
1675 | int bit; |
1676 | |
1677 | - bit = trace_test_and_set_recursion(TRACE_LIST_START, TRACE_LIST_MAX); |
1678 | + bit = trace_test_and_set_recursion(TRACE_LIST_START); |
1679 | if (bit < 0) |
1680 | return; |
1681 | |
1682 | diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h |
1683 | index fc3aa81a43e3c..35e9a01b54800 100644 |
1684 | --- a/kernel/trace/trace.h |
1685 | +++ b/kernel/trace/trace.h |
1686 | @@ -518,23 +518,8 @@ struct tracer { |
1687 | * When function tracing occurs, the following steps are made: |
1688 | * If arch does not support a ftrace feature: |
1689 | * call internal function (uses INTERNAL bits) which calls... |
1690 | - * If callback is registered to the "global" list, the list |
1691 | - * function is called and recursion checks the GLOBAL bits. |
1692 | - * then this function calls... |
1693 | * The function callback, which can use the FTRACE bits to |
1694 | * check for recursion. |
1695 | - * |
1696 | - * Now if the arch does not suppport a feature, and it calls |
1697 | - * the global list function which calls the ftrace callback |
1698 | - * all three of these steps will do a recursion protection. |
1699 | - * There's no reason to do one if the previous caller already |
1700 | - * did. The recursion that we are protecting against will |
1701 | - * go through the same steps again. |
1702 | - * |
1703 | - * To prevent the multiple recursion checks, if a recursion |
1704 | - * bit is set that is higher than the MAX bit of the current |
1705 | - * check, then we know that the check was made by the previous |
1706 | - * caller, and we can skip the current check. |
1707 | */ |
1708 | enum { |
1709 | TRACE_BUFFER_BIT, |
1710 | @@ -547,12 +532,14 @@ enum { |
1711 | TRACE_FTRACE_NMI_BIT, |
1712 | TRACE_FTRACE_IRQ_BIT, |
1713 | TRACE_FTRACE_SIRQ_BIT, |
1714 | + TRACE_FTRACE_TRANSITION_BIT, |
1715 | |
1716 | - /* INTERNAL_BITs must be greater than FTRACE_BITs */ |
1717 | + /* Internal use recursion bits */ |
1718 | TRACE_INTERNAL_BIT, |
1719 | TRACE_INTERNAL_NMI_BIT, |
1720 | TRACE_INTERNAL_IRQ_BIT, |
1721 | TRACE_INTERNAL_SIRQ_BIT, |
1722 | + TRACE_INTERNAL_TRANSITION_BIT, |
1723 | |
1724 | TRACE_BRANCH_BIT, |
1725 | /* |
1726 | @@ -592,12 +579,6 @@ enum { |
1727 | * function is called to clear it. |
1728 | */ |
1729 | TRACE_GRAPH_NOTRACE_BIT, |
1730 | - |
1731 | - /* |
1732 | - * When transitioning between context, the preempt_count() may |
1733 | - * not be correct. Allow for a single recursion to cover this case. |
1734 | - */ |
1735 | - TRACE_TRANSITION_BIT, |
1736 | }; |
1737 | |
1738 | #define trace_recursion_set(bit) do { (current)->trace_recursion |= (1<<(bit)); } while (0) |
1739 | @@ -617,12 +598,18 @@ enum { |
1740 | #define TRACE_CONTEXT_BITS 4 |
1741 | |
1742 | #define TRACE_FTRACE_START TRACE_FTRACE_BIT |
1743 | -#define TRACE_FTRACE_MAX ((1 << (TRACE_FTRACE_START + TRACE_CONTEXT_BITS)) - 1) |
1744 | |
1745 | #define TRACE_LIST_START TRACE_INTERNAL_BIT |
1746 | -#define TRACE_LIST_MAX ((1 << (TRACE_LIST_START + TRACE_CONTEXT_BITS)) - 1) |
1747 | |
1748 | -#define TRACE_CONTEXT_MASK TRACE_LIST_MAX |
1749 | +#define TRACE_CONTEXT_MASK ((1 << (TRACE_LIST_START + TRACE_CONTEXT_BITS)) - 1) |
1750 | + |
1751 | +enum { |
1752 | + TRACE_CTX_NMI, |
1753 | + TRACE_CTX_IRQ, |
1754 | + TRACE_CTX_SOFTIRQ, |
1755 | + TRACE_CTX_NORMAL, |
1756 | + TRACE_CTX_TRANSITION, |
1757 | +}; |
1758 | |
1759 | static __always_inline int trace_get_context_bit(void) |
1760 | { |
1761 | @@ -630,59 +617,48 @@ static __always_inline int trace_get_context_bit(void) |
1762 | |
1763 | if (in_interrupt()) { |
1764 | if (in_nmi()) |
1765 | - bit = 0; |
1766 | + bit = TRACE_CTX_NMI; |
1767 | |
1768 | else if (in_irq()) |
1769 | - bit = 1; |
1770 | + bit = TRACE_CTX_IRQ; |
1771 | else |
1772 | - bit = 2; |
1773 | + bit = TRACE_CTX_SOFTIRQ; |
1774 | } else |
1775 | - bit = 3; |
1776 | + bit = TRACE_CTX_NORMAL; |
1777 | |
1778 | return bit; |
1779 | } |
1780 | |
1781 | -static __always_inline int trace_test_and_set_recursion(int start, int max) |
1782 | +static __always_inline int trace_test_and_set_recursion(int start) |
1783 | { |
1784 | unsigned int val = current->trace_recursion; |
1785 | int bit; |
1786 | |
1787 | - /* A previous recursion check was made */ |
1788 | - if ((val & TRACE_CONTEXT_MASK) > max) |
1789 | - return 0; |
1790 | - |
1791 | bit = trace_get_context_bit() + start; |
1792 | if (unlikely(val & (1 << bit))) { |
1793 | /* |
1794 | * It could be that preempt_count has not been updated during |
1795 | * a switch between contexts. Allow for a single recursion. |
1796 | */ |
1797 | - bit = TRACE_TRANSITION_BIT; |
1798 | + bit = start + TRACE_CTX_TRANSITION; |
1799 | if (trace_recursion_test(bit)) |
1800 | return -1; |
1801 | trace_recursion_set(bit); |
1802 | barrier(); |
1803 | - return bit + 1; |
1804 | + return bit; |
1805 | } |
1806 | |
1807 | - /* Normal check passed, clear the transition to allow it again */ |
1808 | - trace_recursion_clear(TRACE_TRANSITION_BIT); |
1809 | - |
1810 | val |= 1 << bit; |
1811 | current->trace_recursion = val; |
1812 | barrier(); |
1813 | |
1814 | - return bit + 1; |
1815 | + return bit; |
1816 | } |
1817 | |
1818 | static __always_inline void trace_clear_recursion(int bit) |
1819 | { |
1820 | unsigned int val = current->trace_recursion; |
1821 | |
1822 | - if (!bit) |
1823 | - return; |
1824 | - |
1825 | - bit--; |
1826 | bit = 1 << bit; |
1827 | val &= ~bit; |
1828 | |
1829 | diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c |
1830 | index b611cd36e22db..4e8acfe3437fd 100644 |
1831 | --- a/kernel/trace/trace_functions.c |
1832 | +++ b/kernel/trace/trace_functions.c |
1833 | @@ -138,7 +138,7 @@ function_trace_call(unsigned long ip, unsigned long parent_ip, |
1834 | pc = preempt_count(); |
1835 | preempt_disable_notrace(); |
1836 | |
1837 | - bit = trace_test_and_set_recursion(TRACE_FTRACE_START, TRACE_FTRACE_MAX); |
1838 | + bit = trace_test_and_set_recursion(TRACE_FTRACE_START); |
1839 | if (bit < 0) |
1840 | goto out; |
1841 | |
1842 | diff --git a/mm/slub.c b/mm/slub.c |
1843 | index ca7143fe25b56..63fe43c8d3323 100644 |
1844 | --- a/mm/slub.c |
1845 | +++ b/mm/slub.c |
1846 | @@ -1455,7 +1455,8 @@ static __always_inline bool slab_free_hook(struct kmem_cache *s, void *x) |
1847 | } |
1848 | |
1849 | static inline bool slab_free_freelist_hook(struct kmem_cache *s, |
1850 | - void **head, void **tail) |
1851 | + void **head, void **tail, |
1852 | + int *cnt) |
1853 | { |
1854 | |
1855 | void *object; |
1856 | @@ -1490,6 +1491,12 @@ static inline bool slab_free_freelist_hook(struct kmem_cache *s, |
1857 | *head = object; |
1858 | if (!*tail) |
1859 | *tail = object; |
1860 | + } else { |
1861 | + /* |
1862 | + * Adjust the reconstructed freelist depth |
1863 | + * accordingly if object's reuse is delayed. |
1864 | + */ |
1865 | + --(*cnt); |
1866 | } |
1867 | } while (object != old_tail); |
1868 | |
1869 | @@ -3049,7 +3056,7 @@ static __always_inline void slab_free(struct kmem_cache *s, struct page *page, |
1870 | * With KASAN enabled slab_free_freelist_hook modifies the freelist |
1871 | * to remove objects, whose reuse must be delayed. |
1872 | */ |
1873 | - if (slab_free_freelist_hook(s, &head, &tail)) |
1874 | + if (slab_free_freelist_hook(s, &head, &tail, &cnt)) |
1875 | do_slab_free(s, page, head, tail, cnt, addr); |
1876 | } |
1877 | |
1878 | @@ -3727,8 +3734,8 @@ static int kmem_cache_open(struct kmem_cache *s, slab_flags_t flags) |
1879 | if (alloc_kmem_cache_cpus(s)) |
1880 | return 0; |
1881 | |
1882 | - free_kmem_cache_nodes(s); |
1883 | error: |
1884 | + __kmem_cache_release(s); |
1885 | return -EINVAL; |
1886 | } |
1887 | |
1888 | diff --git a/net/can/j1939/j1939-priv.h b/net/can/j1939/j1939-priv.h |
1889 | index 12369b604ce95..cea712fb2a9e0 100644 |
1890 | --- a/net/can/j1939/j1939-priv.h |
1891 | +++ b/net/can/j1939/j1939-priv.h |
1892 | @@ -326,6 +326,7 @@ int j1939_session_activate(struct j1939_session *session); |
1893 | void j1939_tp_schedule_txtimer(struct j1939_session *session, int msec); |
1894 | void j1939_session_timers_cancel(struct j1939_session *session); |
1895 | |
1896 | +#define J1939_MIN_TP_PACKET_SIZE 9 |
1897 | #define J1939_MAX_TP_PACKET_SIZE (7 * 0xff) |
1898 | #define J1939_MAX_ETP_PACKET_SIZE (7 * 0x00ffffff) |
1899 | |
1900 | diff --git a/net/can/j1939/main.c b/net/can/j1939/main.c |
1901 | index 6884d18f919c7..266c189f1e809 100644 |
1902 | --- a/net/can/j1939/main.c |
1903 | +++ b/net/can/j1939/main.c |
1904 | @@ -249,11 +249,14 @@ struct j1939_priv *j1939_netdev_start(struct net_device *ndev) |
1905 | struct j1939_priv *priv, *priv_new; |
1906 | int ret; |
1907 | |
1908 | - priv = j1939_priv_get_by_ndev(ndev); |
1909 | + spin_lock(&j1939_netdev_lock); |
1910 | + priv = j1939_priv_get_by_ndev_locked(ndev); |
1911 | if (priv) { |
1912 | kref_get(&priv->rx_kref); |
1913 | + spin_unlock(&j1939_netdev_lock); |
1914 | return priv; |
1915 | } |
1916 | + spin_unlock(&j1939_netdev_lock); |
1917 | |
1918 | priv = j1939_priv_create(ndev); |
1919 | if (!priv) |
1920 | @@ -269,10 +272,10 @@ struct j1939_priv *j1939_netdev_start(struct net_device *ndev) |
1921 | /* Someone was faster than us, use their priv and roll |
1922 | * back our's. |
1923 | */ |
1924 | + kref_get(&priv_new->rx_kref); |
1925 | spin_unlock(&j1939_netdev_lock); |
1926 | dev_put(ndev); |
1927 | kfree(priv); |
1928 | - kref_get(&priv_new->rx_kref); |
1929 | return priv_new; |
1930 | } |
1931 | j1939_priv_set(ndev, priv); |
1932 | diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c |
1933 | index 6571895228f01..7a54170da09df 100644 |
1934 | --- a/net/can/j1939/transport.c |
1935 | +++ b/net/can/j1939/transport.c |
1936 | @@ -1230,12 +1230,11 @@ static enum hrtimer_restart j1939_tp_rxtimer(struct hrtimer *hrtimer) |
1937 | session->err = -ETIME; |
1938 | j1939_session_deactivate(session); |
1939 | } else { |
1940 | - netdev_alert(priv->ndev, "%s: 0x%p: rx timeout, send abort\n", |
1941 | - __func__, session); |
1942 | - |
1943 | j1939_session_list_lock(session->priv); |
1944 | if (session->state >= J1939_SESSION_ACTIVE && |
1945 | session->state < J1939_SESSION_ACTIVE_MAX) { |
1946 | + netdev_alert(priv->ndev, "%s: 0x%p: rx timeout, send abort\n", |
1947 | + __func__, session); |
1948 | j1939_session_get(session); |
1949 | hrtimer_start(&session->rxtimer, |
1950 | ms_to_ktime(J1939_XTP_ABORT_TIMEOUT_MS), |
1951 | @@ -1597,6 +1596,8 @@ j1939_session *j1939_xtp_rx_rts_session_new(struct j1939_priv *priv, |
1952 | abort = J1939_XTP_ABORT_FAULT; |
1953 | else if (len > priv->tp_max_packet_size) |
1954 | abort = J1939_XTP_ABORT_RESOURCE; |
1955 | + else if (len < J1939_MIN_TP_PACKET_SIZE) |
1956 | + abort = J1939_XTP_ABORT_FAULT; |
1957 | } |
1958 | |
1959 | if (abort != J1939_XTP_NO_ABORT) { |
1960 | @@ -1771,6 +1772,7 @@ static void j1939_xtp_rx_dpo(struct j1939_priv *priv, struct sk_buff *skb, |
1961 | static void j1939_xtp_rx_dat_one(struct j1939_session *session, |
1962 | struct sk_buff *skb) |
1963 | { |
1964 | + enum j1939_xtp_abort abort = J1939_XTP_ABORT_FAULT; |
1965 | struct j1939_priv *priv = session->priv; |
1966 | struct j1939_sk_buff_cb *skcb; |
1967 | struct sk_buff *se_skb = NULL; |
1968 | @@ -1785,9 +1787,11 @@ static void j1939_xtp_rx_dat_one(struct j1939_session *session, |
1969 | |
1970 | skcb = j1939_skb_to_cb(skb); |
1971 | dat = skb->data; |
1972 | - if (skb->len <= 1) |
1973 | + if (skb->len != 8) { |
1974 | /* makes no sense */ |
1975 | + abort = J1939_XTP_ABORT_UNEXPECTED_DATA; |
1976 | goto out_session_cancel; |
1977 | + } |
1978 | |
1979 | switch (session->last_cmd) { |
1980 | case 0xff: |
1981 | @@ -1885,7 +1889,7 @@ static void j1939_xtp_rx_dat_one(struct j1939_session *session, |
1982 | out_session_cancel: |
1983 | kfree_skb(se_skb); |
1984 | j1939_session_timers_cancel(session); |
1985 | - j1939_session_cancel(session, J1939_XTP_ABORT_FAULT); |
1986 | + j1939_session_cancel(session, abort); |
1987 | j1939_session_put(session); |
1988 | } |
1989 | |
1990 | diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig |
1991 | index 91efae88e8c2a..ef72819d9d315 100644 |
1992 | --- a/net/netfilter/Kconfig |
1993 | +++ b/net/netfilter/Kconfig |
1994 | @@ -94,7 +94,7 @@ config NF_CONNTRACK_MARK |
1995 | config NF_CONNTRACK_SECMARK |
1996 | bool 'Connection tracking security mark support' |
1997 | depends on NETWORK_SECMARK |
1998 | - default m if NETFILTER_ADVANCED=n |
1999 | + default y if NETFILTER_ADVANCED=n |
2000 | help |
2001 | This option enables security markings to be applied to |
2002 | connections. Typically they are copied to connections from |
2003 | diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c |
2004 | index f93fa0e210979..07242503d74d3 100644 |
2005 | --- a/net/netfilter/ipvs/ip_vs_ctl.c |
2006 | +++ b/net/netfilter/ipvs/ip_vs_ctl.c |
2007 | @@ -4047,6 +4047,11 @@ static int __net_init ip_vs_control_net_init_sysctl(struct netns_ipvs *ipvs) |
2008 | tbl[idx++].data = &ipvs->sysctl_conn_reuse_mode; |
2009 | tbl[idx++].data = &ipvs->sysctl_schedule_icmp; |
2010 | tbl[idx++].data = &ipvs->sysctl_ignore_tunneled; |
2011 | +#ifdef CONFIG_IP_VS_DEBUG |
2012 | + /* Global sysctls must be ro in non-init netns */ |
2013 | + if (!net_eq(net, &init_net)) |
2014 | + tbl[idx++].mode = 0444; |
2015 | +#endif |
2016 | |
2017 | ipvs->sysctl_hdr = register_net_sysctl(net, "net/ipv4/vs", tbl); |
2018 | if (ipvs->sysctl_hdr == NULL) { |
2019 | diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c |
2020 | index a48297b79f34f..b0ed2b47ac437 100644 |
2021 | --- a/net/nfc/nci/rsp.c |
2022 | +++ b/net/nfc/nci/rsp.c |
2023 | @@ -277,6 +277,8 @@ static void nci_core_conn_close_rsp_packet(struct nci_dev *ndev, |
2024 | ndev->cur_conn_id); |
2025 | if (conn_info) { |
2026 | list_del(&conn_info->list); |
2027 | + if (conn_info == ndev->rf_conn_info) |
2028 | + ndev->rf_conn_info = NULL; |
2029 | devm_kfree(&ndev->nfc_dev->dev, conn_info); |
2030 | } |
2031 | } |
2032 | diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c |
2033 | index ea9ddea35a886..96773555af5ca 100644 |
2034 | --- a/net/switchdev/switchdev.c |
2035 | +++ b/net/switchdev/switchdev.c |
2036 | @@ -476,6 +476,9 @@ static int __switchdev_handle_port_obj_add(struct net_device *dev, |
2037 | * necessary to go through this helper. |
2038 | */ |
2039 | netdev_for_each_lower_dev(dev, lower_dev, iter) { |
2040 | + if (netif_is_bridge_master(lower_dev)) |
2041 | + continue; |
2042 | + |
2043 | err = __switchdev_handle_port_obj_add(lower_dev, port_obj_info, |
2044 | check_cb, add_cb); |
2045 | if (err && err != -EOPNOTSUPP) |
2046 | @@ -528,6 +531,9 @@ static int __switchdev_handle_port_obj_del(struct net_device *dev, |
2047 | * necessary to go through this helper. |
2048 | */ |
2049 | netdev_for_each_lower_dev(dev, lower_dev, iter) { |
2050 | + if (netif_is_bridge_master(lower_dev)) |
2051 | + continue; |
2052 | + |
2053 | err = __switchdev_handle_port_obj_del(lower_dev, port_obj_info, |
2054 | check_cb, del_cb); |
2055 | if (err && err != -EOPNOTSUPP) |
2056 | @@ -579,6 +585,9 @@ static int __switchdev_handle_port_attr_set(struct net_device *dev, |
2057 | * necessary to go through this helper. |
2058 | */ |
2059 | netdev_for_each_lower_dev(dev, lower_dev, iter) { |
2060 | + if (netif_is_bridge_master(lower_dev)) |
2061 | + continue; |
2062 | + |
2063 | err = __switchdev_handle_port_attr_set(lower_dev, port_attr_info, |
2064 | check_cb, set_cb); |
2065 | if (err && err != -EOPNOTSUPP) |
2066 | diff --git a/scripts/Makefile.gcc-plugins b/scripts/Makefile.gcc-plugins |
2067 | index 5f7df50cfe7aa..63d21489216b0 100644 |
2068 | --- a/scripts/Makefile.gcc-plugins |
2069 | +++ b/scripts/Makefile.gcc-plugins |
2070 | @@ -19,6 +19,10 @@ gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF) \ |
2071 | += -fplugin-arg-structleak_plugin-byref |
2072 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) \ |
2073 | += -fplugin-arg-structleak_plugin-byref-all |
2074 | +ifdef CONFIG_GCC_PLUGIN_STRUCTLEAK |
2075 | + DISABLE_STRUCTLEAK_PLUGIN += -fplugin-arg-structleak_plugin-disable |
2076 | +endif |
2077 | +export DISABLE_STRUCTLEAK_PLUGIN |
2078 | gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_STRUCTLEAK) \ |
2079 | += -DSTRUCTLEAK_PLUGIN |
2080 | |
2081 | diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c |
2082 | index 7e7be8e4dcf9c..87ba66dcfd478 100644 |
2083 | --- a/sound/hda/hdac_controller.c |
2084 | +++ b/sound/hda/hdac_controller.c |
2085 | @@ -395,8 +395,9 @@ int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset) |
2086 | if (!full_reset) |
2087 | goto skip_reset; |
2088 | |
2089 | - /* clear STATESTS */ |
2090 | - snd_hdac_chip_writew(bus, STATESTS, STATESTS_INT_MASK); |
2091 | + /* clear STATESTS if not in reset */ |
2092 | + if (snd_hdac_chip_readb(bus, GCTL) & AZX_GCTL_RESET) |
2093 | + snd_hdac_chip_writew(bus, STATESTS, STATESTS_INT_MASK); |
2094 | |
2095 | /* reset controller */ |
2096 | snd_hdac_bus_enter_link_reset(bus); |
2097 | diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
2098 | index c4837c78a8624..49aefb7875e72 100644 |
2099 | --- a/sound/pci/hda/patch_realtek.c |
2100 | +++ b/sound/pci/hda/patch_realtek.c |
2101 | @@ -2537,6 +2537,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
2102 | SND_PCI_QUIRK(0x1558, 0x65d2, "Clevo PB51R[CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2103 | SND_PCI_QUIRK(0x1558, 0x65e1, "Clevo PB51[ED][DF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2104 | SND_PCI_QUIRK(0x1558, 0x65e5, "Clevo PC50D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2105 | + SND_PCI_QUIRK(0x1558, 0x65f1, "Clevo PC50HS", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2106 | SND_PCI_QUIRK(0x1558, 0x67d1, "Clevo PB71[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2107 | SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2108 | SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2109 | diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c |
2110 | index 708fc4ed54eda..512f8899dcbbd 100644 |
2111 | --- a/sound/soc/codecs/wm8960.c |
2112 | +++ b/sound/soc/codecs/wm8960.c |
2113 | @@ -752,9 +752,16 @@ static int wm8960_configure_clocking(struct snd_soc_component *component) |
2114 | int i, j, k; |
2115 | int ret; |
2116 | |
2117 | - if (!(iface1 & (1<<6))) { |
2118 | - dev_dbg(component->dev, |
2119 | - "Codec is slave mode, no need to configure clock\n"); |
2120 | + /* |
2121 | + * For Slave mode clocking should still be configured, |
2122 | + * so this if statement should be removed, but some platform |
2123 | + * may not work if the sysclk is not configured, to avoid such |
2124 | + * compatible issue, just add '!wm8960->sysclk' condition in |
2125 | + * this if statement. |
2126 | + */ |
2127 | + if (!(iface1 & (1 << 6)) && !wm8960->sysclk) { |
2128 | + dev_warn(component->dev, |
2129 | + "slave mode, but proceeding with no clock configuration\n"); |
2130 | return 0; |
2131 | } |
2132 | |
2133 | diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c |
2134 | index 7c4d5963692dd..66f6b698a5436 100644 |
2135 | --- a/sound/soc/soc-dapm.c |
2136 | +++ b/sound/soc/soc-dapm.c |
2137 | @@ -2546,6 +2546,7 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm, |
2138 | const char *pin, int status) |
2139 | { |
2140 | struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); |
2141 | + int ret = 0; |
2142 | |
2143 | dapm_assert_locked(dapm); |
2144 | |
2145 | @@ -2558,13 +2559,14 @@ static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm, |
2146 | dapm_mark_dirty(w, "pin configuration"); |
2147 | dapm_widget_invalidate_input_paths(w); |
2148 | dapm_widget_invalidate_output_paths(w); |
2149 | + ret = 1; |
2150 | } |
2151 | |
2152 | w->connected = status; |
2153 | if (status == 0) |
2154 | w->force = 0; |
2155 | |
2156 | - return 0; |
2157 | + return ret; |
2158 | } |
2159 | |
2160 | /** |
2161 | @@ -3580,14 +3582,15 @@ int snd_soc_dapm_put_pin_switch(struct snd_kcontrol *kcontrol, |
2162 | { |
2163 | struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); |
2164 | const char *pin = (const char *)kcontrol->private_value; |
2165 | + int ret; |
2166 | |
2167 | if (ucontrol->value.integer.value[0]) |
2168 | - snd_soc_dapm_enable_pin(&card->dapm, pin); |
2169 | + ret = snd_soc_dapm_enable_pin(&card->dapm, pin); |
2170 | else |
2171 | - snd_soc_dapm_disable_pin(&card->dapm, pin); |
2172 | + ret = snd_soc_dapm_disable_pin(&card->dapm, pin); |
2173 | |
2174 | snd_soc_dapm_sync(&card->dapm); |
2175 | - return 0; |
2176 | + return ret; |
2177 | } |
2178 | EXPORT_SYMBOL_GPL(snd_soc_dapm_put_pin_switch); |
2179 | |
2180 | @@ -4029,7 +4032,7 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol, |
2181 | |
2182 | rtd->params_select = ucontrol->value.enumerated.item[0]; |
2183 | |
2184 | - return 0; |
2185 | + return 1; |
2186 | } |
2187 | |
2188 | static void |
2189 | diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h |
2190 | index 9620ae0003ce4..01dee2074ab36 100644 |
2191 | --- a/sound/usb/quirks-table.h |
2192 | +++ b/sound/usb/quirks-table.h |
2193 | @@ -3806,5 +3806,37 @@ ALC1220_VB_DESKTOP(0x26ce, 0x0a01), /* Asrock TRX40 Creator */ |
2194 | } |
2195 | } |
2196 | }, |
2197 | +{ |
2198 | + /* |
2199 | + * Sennheiser GSP670 |
2200 | + * Change order of interfaces loaded |
2201 | + */ |
2202 | + USB_DEVICE(0x1395, 0x0300), |
2203 | + .bInterfaceClass = USB_CLASS_PER_INTERFACE, |
2204 | + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { |
2205 | + .ifnum = QUIRK_ANY_INTERFACE, |
2206 | + .type = QUIRK_COMPOSITE, |
2207 | + .data = &(const struct snd_usb_audio_quirk[]) { |
2208 | + // Communication |
2209 | + { |
2210 | + .ifnum = 3, |
2211 | + .type = QUIRK_AUDIO_STANDARD_INTERFACE |
2212 | + }, |
2213 | + // Recording |
2214 | + { |
2215 | + .ifnum = 4, |
2216 | + .type = QUIRK_AUDIO_STANDARD_INTERFACE |
2217 | + }, |
2218 | + // Main |
2219 | + { |
2220 | + .ifnum = 1, |
2221 | + .type = QUIRK_AUDIO_STANDARD_INTERFACE |
2222 | + }, |
2223 | + { |
2224 | + .ifnum = -1 |
2225 | + } |
2226 | + } |
2227 | + } |
2228 | +}, |
2229 | |
2230 | #undef USB_DEVICE_VENDOR_SPEC |
2231 | diff --git a/tools/testing/selftests/netfilter/nft_flowtable.sh b/tools/testing/selftests/netfilter/nft_flowtable.sh |
2232 | index 16571ac1dab40..1ccb12fe2511a 100755 |
2233 | --- a/tools/testing/selftests/netfilter/nft_flowtable.sh |
2234 | +++ b/tools/testing/selftests/netfilter/nft_flowtable.sh |
2235 | @@ -174,7 +174,6 @@ fi |
2236 | ip netns exec ns1 ping -c 1 -q 10.0.2.99 > /dev/null |
2237 | if [ $? -ne 0 ];then |
2238 | echo "ERROR: ns1 cannot reach ns2" 1>&2 |
2239 | - bash |
2240 | exit 1 |
2241 | fi |
2242 |