1 |
commit: 4a10e2795a26e06020a21f5e978cc6d762f649c5 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 27 11:20:31 2019 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 27 11:20:31 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=4a10e279 |
7 |
|
8 |
proj/linux-patches: Linux patch 4.9.161 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1160_linux-4.9.161.patch | 2707 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 2711 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 203d1e5..b5f7603 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -683,6 +683,10 @@ Patch: 1159_linux-4.9.160.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.9.160 |
23 |
|
24 |
+Patch: 1160_linux-4.9.161.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.9.161 |
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/1160_linux-4.9.161.patch b/1160_linux-4.9.161.patch |
33 |
new file mode 100644 |
34 |
index 0000000..7dab518 |
35 |
--- /dev/null |
36 |
+++ b/1160_linux-4.9.161.patch |
37 |
@@ -0,0 +1,2707 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index af70503df3f46..239b74a7147b5 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 4 |
44 |
+ PATCHLEVEL = 9 |
45 |
+-SUBLEVEL = 160 |
46 |
++SUBLEVEL = 161 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Roaring Lionus |
49 |
+ |
50 |
+@@ -306,11 +306,6 @@ HOSTCXX = g++ |
51 |
+ HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu89 |
52 |
+ HOSTCXXFLAGS = -O2 |
53 |
+ |
54 |
+-ifeq ($(shell $(HOSTCC) -v 2>&1 | grep -c "clang version"), 1) |
55 |
+-HOSTCFLAGS += -Wno-unused-value -Wno-unused-parameter \ |
56 |
+- -Wno-missing-field-initializers -fno-delete-null-pointer-checks |
57 |
+-endif |
58 |
+- |
59 |
+ # Decide whether to build built-in, modular, or both. |
60 |
+ # Normally, just do built-in. |
61 |
+ |
62 |
+@@ -511,36 +506,17 @@ endif |
63 |
+ |
64 |
+ ifeq ($(cc-name),clang) |
65 |
+ ifneq ($(CROSS_COMPILE),) |
66 |
+-CLANG_TARGET := -target $(notdir $(CROSS_COMPILE:%-=%)) |
67 |
++CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%)) |
68 |
+ GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD))) |
69 |
+-CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR) |
70 |
++CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR) |
71 |
+ GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..) |
72 |
+ endif |
73 |
+ ifneq ($(GCC_TOOLCHAIN),) |
74 |
+-CLANG_GCC_TC := -gcc-toolchain $(GCC_TOOLCHAIN) |
75 |
++CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN) |
76 |
+ endif |
77 |
+-KBUILD_CFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) |
78 |
+-KBUILD_AFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX) |
79 |
+-KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) |
80 |
+-KBUILD_CFLAGS += $(call cc-disable-warning, unused-variable) |
81 |
+-KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) |
82 |
+-KBUILD_CFLAGS += $(call cc-disable-warning, gnu) |
83 |
+-KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) |
84 |
+-# Quiet clang warning: comparison of unsigned expression < 0 is always false |
85 |
+-KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) |
86 |
+-# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the |
87 |
+-# source of a reference will be _MergedGlobals and not on of the whitelisted names. |
88 |
+-# See modpost pattern 2 |
89 |
+-KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,) |
90 |
+-KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior) |
91 |
+-KBUILD_CFLAGS += $(call cc-option, -no-integrated-as) |
92 |
+-KBUILD_AFLAGS += $(call cc-option, -no-integrated-as) |
93 |
+-else |
94 |
+- |
95 |
+-# These warnings generated too much noise in a regular build. |
96 |
+-# Use make W=1 to enable them (see scripts/Makefile.build) |
97 |
+-KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) |
98 |
+-KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) |
99 |
++CLANG_FLAGS += -no-integrated-as |
100 |
++KBUILD_CFLAGS += $(CLANG_FLAGS) |
101 |
++KBUILD_AFLAGS += $(CLANG_FLAGS) |
102 |
+ endif |
103 |
+ |
104 |
+ |
105 |
+@@ -739,6 +715,26 @@ ifdef CONFIG_CC_STACKPROTECTOR |
106 |
+ endif |
107 |
+ KBUILD_CFLAGS += $(stackp-flag) |
108 |
+ |
109 |
++ifeq ($(cc-name),clang) |
110 |
++KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,) |
111 |
++KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier) |
112 |
++KBUILD_CFLAGS += $(call cc-disable-warning, gnu) |
113 |
++KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) |
114 |
++# Quiet clang warning: comparison of unsigned expression < 0 is always false |
115 |
++KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) |
116 |
++# CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the |
117 |
++# source of a reference will be _MergedGlobals and not on of the whitelisted names. |
118 |
++# See modpost pattern 2 |
119 |
++KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,) |
120 |
++KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior) |
121 |
++else |
122 |
++ |
123 |
++# These warnings generated too much noise in a regular build. |
124 |
++# Use make W=1 to enable them (see scripts/Makefile.extrawarn) |
125 |
++KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) |
126 |
++endif |
127 |
++ |
128 |
++KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) |
129 |
+ ifdef CONFIG_FRAME_POINTER |
130 |
+ KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls |
131 |
+ else |
132 |
+diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h |
133 |
+index 4fd6272e6c01b..c5816a224571e 100644 |
134 |
+--- a/arch/arc/include/asm/cache.h |
135 |
++++ b/arch/arc/include/asm/cache.h |
136 |
+@@ -49,6 +49,17 @@ |
137 |
+ |
138 |
+ #define ARCH_DMA_MINALIGN L1_CACHE_BYTES |
139 |
+ |
140 |
++/* |
141 |
++ * Make sure slab-allocated buffers are 64-bit aligned when atomic64_t uses |
142 |
++ * ARCv2 64-bit atomics (LLOCKD/SCONDD). This guarantess runtime 64-bit |
143 |
++ * alignment for any atomic64_t embedded in buffer. |
144 |
++ * Default ARCH_SLAB_MINALIGN is __alignof__(long long) which has a relaxed |
145 |
++ * value of 4 (and not 8) in ARC ABI. |
146 |
++ */ |
147 |
++#if defined(CONFIG_ARC_HAS_LL64) && defined(CONFIG_ARC_HAS_LLSC) |
148 |
++#define ARCH_SLAB_MINALIGN 8 |
149 |
++#endif |
150 |
++ |
151 |
+ extern void arc_cache_init(void); |
152 |
+ extern char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len); |
153 |
+ extern void read_decode_cache_bcr(void); |
154 |
+diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S |
155 |
+index 8b90d25a15cca..1f945d0f40daa 100644 |
156 |
+--- a/arch/arc/kernel/head.S |
157 |
++++ b/arch/arc/kernel/head.S |
158 |
+@@ -17,6 +17,7 @@ |
159 |
+ #include <asm/entry.h> |
160 |
+ #include <asm/arcregs.h> |
161 |
+ #include <asm/cache.h> |
162 |
++#include <asm/irqflags.h> |
163 |
+ |
164 |
+ .macro CPU_EARLY_SETUP |
165 |
+ |
166 |
+@@ -47,6 +48,15 @@ |
167 |
+ sr r5, [ARC_REG_DC_CTRL] |
168 |
+ |
169 |
+ 1: |
170 |
++ |
171 |
++#ifdef CONFIG_ISA_ARCV2 |
172 |
++ ; Unaligned access is disabled at reset, so re-enable early as |
173 |
++ ; gcc 7.3.1 (ARC GNU 2018.03) onwards generates unaligned access |
174 |
++ ; by default |
175 |
++ lr r5, [status32] |
176 |
++ bset r5, r5, STATUS_AD_BIT |
177 |
++ kflag r5 |
178 |
++#endif |
179 |
+ .endm |
180 |
+ |
181 |
+ .section .init.text, "ax",@progbits |
182 |
+@@ -93,9 +103,9 @@ ENTRY(stext) |
183 |
+ #ifdef CONFIG_ARC_UBOOT_SUPPORT |
184 |
+ ; Uboot - kernel ABI |
185 |
+ ; r0 = [0] No uboot interaction, [1] cmdline in r2, [2] DTB in r2 |
186 |
+- ; r1 = magic number (board identity, unused as of now |
187 |
++ ; r1 = magic number (always zero as of now) |
188 |
+ ; r2 = pointer to uboot provided cmdline or external DTB in mem |
189 |
+- ; These are handled later in setup_arch() |
190 |
++ ; These are handled later in handle_uboot_args() |
191 |
+ st r0, [@uboot_tag] |
192 |
+ st r2, [@uboot_arg] |
193 |
+ #endif |
194 |
+diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c |
195 |
+index 0385df77a6973..9119bea503a7c 100644 |
196 |
+--- a/arch/arc/kernel/setup.c |
197 |
++++ b/arch/arc/kernel/setup.c |
198 |
+@@ -381,43 +381,80 @@ void setup_processor(void) |
199 |
+ arc_chk_core_config(); |
200 |
+ } |
201 |
+ |
202 |
+-static inline int is_kernel(unsigned long addr) |
203 |
++static inline bool uboot_arg_invalid(unsigned long addr) |
204 |
+ { |
205 |
+- if (addr >= (unsigned long)_stext && addr <= (unsigned long)_end) |
206 |
+- return 1; |
207 |
+- return 0; |
208 |
++ /* |
209 |
++ * Check that it is a untranslated address (although MMU is not enabled |
210 |
++ * yet, it being a high address ensures this is not by fluke) |
211 |
++ */ |
212 |
++ if (addr < PAGE_OFFSET) |
213 |
++ return true; |
214 |
++ |
215 |
++ /* Check that address doesn't clobber resident kernel image */ |
216 |
++ return addr >= (unsigned long)_stext && addr <= (unsigned long)_end; |
217 |
+ } |
218 |
+ |
219 |
+-void __init setup_arch(char **cmdline_p) |
220 |
++#define IGNORE_ARGS "Ignore U-boot args: " |
221 |
++ |
222 |
++/* uboot_tag values for U-boot - kernel ABI revision 0; see head.S */ |
223 |
++#define UBOOT_TAG_NONE 0 |
224 |
++#define UBOOT_TAG_CMDLINE 1 |
225 |
++#define UBOOT_TAG_DTB 2 |
226 |
++ |
227 |
++void __init handle_uboot_args(void) |
228 |
+ { |
229 |
++ bool use_embedded_dtb = true; |
230 |
++ bool append_cmdline = false; |
231 |
++ |
232 |
+ #ifdef CONFIG_ARC_UBOOT_SUPPORT |
233 |
+- /* make sure that uboot passed pointer to cmdline/dtb is valid */ |
234 |
+- if (uboot_tag && is_kernel((unsigned long)uboot_arg)) |
235 |
+- panic("Invalid uboot arg\n"); |
236 |
++ /* check that we know this tag */ |
237 |
++ if (uboot_tag != UBOOT_TAG_NONE && |
238 |
++ uboot_tag != UBOOT_TAG_CMDLINE && |
239 |
++ uboot_tag != UBOOT_TAG_DTB) { |
240 |
++ pr_warn(IGNORE_ARGS "invalid uboot tag: '%08x'\n", uboot_tag); |
241 |
++ goto ignore_uboot_args; |
242 |
++ } |
243 |
++ |
244 |
++ if (uboot_tag != UBOOT_TAG_NONE && |
245 |
++ uboot_arg_invalid((unsigned long)uboot_arg)) { |
246 |
++ pr_warn(IGNORE_ARGS "invalid uboot arg: '%px'\n", uboot_arg); |
247 |
++ goto ignore_uboot_args; |
248 |
++ } |
249 |
++ |
250 |
++ /* see if U-boot passed an external Device Tree blob */ |
251 |
++ if (uboot_tag == UBOOT_TAG_DTB) { |
252 |
++ machine_desc = setup_machine_fdt((void *)uboot_arg); |
253 |
+ |
254 |
+- /* See if u-boot passed an external Device Tree blob */ |
255 |
+- machine_desc = setup_machine_fdt(uboot_arg); /* uboot_tag == 2 */ |
256 |
+- if (!machine_desc) |
257 |
++ /* external Device Tree blob is invalid - use embedded one */ |
258 |
++ use_embedded_dtb = !machine_desc; |
259 |
++ } |
260 |
++ |
261 |
++ if (uboot_tag == UBOOT_TAG_CMDLINE) |
262 |
++ append_cmdline = true; |
263 |
++ |
264 |
++ignore_uboot_args: |
265 |
+ #endif |
266 |
+- { |
267 |
+- /* No, so try the embedded one */ |
268 |
++ |
269 |
++ if (use_embedded_dtb) { |
270 |
+ machine_desc = setup_machine_fdt(__dtb_start); |
271 |
+ if (!machine_desc) |
272 |
+ panic("Embedded DT invalid\n"); |
273 |
++ } |
274 |
+ |
275 |
+- /* |
276 |
+- * If we are here, it is established that @uboot_arg didn't |
277 |
+- * point to DT blob. Instead if u-boot says it is cmdline, |
278 |
+- * append to embedded DT cmdline. |
279 |
+- * setup_machine_fdt() would have populated @boot_command_line |
280 |
+- */ |
281 |
+- if (uboot_tag == 1) { |
282 |
+- /* Ensure a whitespace between the 2 cmdlines */ |
283 |
+- strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); |
284 |
+- strlcat(boot_command_line, uboot_arg, |
285 |
+- COMMAND_LINE_SIZE); |
286 |
+- } |
287 |
++ /* |
288 |
++ * NOTE: @boot_command_line is populated by setup_machine_fdt() so this |
289 |
++ * append processing can only happen after. |
290 |
++ */ |
291 |
++ if (append_cmdline) { |
292 |
++ /* Ensure a whitespace between the 2 cmdlines */ |
293 |
++ strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); |
294 |
++ strlcat(boot_command_line, uboot_arg, COMMAND_LINE_SIZE); |
295 |
+ } |
296 |
++} |
297 |
++ |
298 |
++void __init setup_arch(char **cmdline_p) |
299 |
++{ |
300 |
++ handle_uboot_args(); |
301 |
+ |
302 |
+ /* Save unparsed command line copy for /proc/cmdline */ |
303 |
+ *cmdline_p = boot_command_line; |
304 |
+diff --git a/arch/arm64/include/asm/arch_gicv3.h b/arch/arm64/include/asm/arch_gicv3.h |
305 |
+index f8ae6d6e4767e..85a15b38b6d8c 100644 |
306 |
+--- a/arch/arm64/include/asm/arch_gicv3.h |
307 |
++++ b/arch/arm64/include/asm/arch_gicv3.h |
308 |
+@@ -80,18 +80,8 @@ |
309 |
+ #include <linux/stringify.h> |
310 |
+ #include <asm/barrier.h> |
311 |
+ |
312 |
+-#define read_gicreg(r) \ |
313 |
+- ({ \ |
314 |
+- u64 reg; \ |
315 |
+- asm volatile("mrs_s %0, " __stringify(r) : "=r" (reg)); \ |
316 |
+- reg; \ |
317 |
+- }) |
318 |
+- |
319 |
+-#define write_gicreg(v,r) \ |
320 |
+- do { \ |
321 |
+- u64 __val = (v); \ |
322 |
+- asm volatile("msr_s " __stringify(r) ", %0" : : "r" (__val));\ |
323 |
+- } while (0) |
324 |
++#define read_gicreg read_sysreg_s |
325 |
++#define write_gicreg write_sysreg_s |
326 |
+ |
327 |
+ /* |
328 |
+ * Low-level accessors |
329 |
+@@ -102,13 +92,13 @@ |
330 |
+ |
331 |
+ static inline void gic_write_eoir(u32 irq) |
332 |
+ { |
333 |
+- asm volatile("msr_s " __stringify(ICC_EOIR1_EL1) ", %0" : : "r" ((u64)irq)); |
334 |
++ write_sysreg_s(irq, ICC_EOIR1_EL1); |
335 |
+ isb(); |
336 |
+ } |
337 |
+ |
338 |
+ static inline void gic_write_dir(u32 irq) |
339 |
+ { |
340 |
+- asm volatile("msr_s " __stringify(ICC_DIR_EL1) ", %0" : : "r" ((u64)irq)); |
341 |
++ write_sysreg_s(irq, ICC_DIR_EL1); |
342 |
+ isb(); |
343 |
+ } |
344 |
+ |
345 |
+@@ -116,7 +106,7 @@ static inline u64 gic_read_iar_common(void) |
346 |
+ { |
347 |
+ u64 irqstat; |
348 |
+ |
349 |
+- asm volatile("mrs_s %0, " __stringify(ICC_IAR1_EL1) : "=r" (irqstat)); |
350 |
++ irqstat = read_sysreg_s(ICC_IAR1_EL1); |
351 |
+ dsb(sy); |
352 |
+ return irqstat; |
353 |
+ } |
354 |
+@@ -134,10 +124,12 @@ static inline u64 gic_read_iar_cavium_thunderx(void) |
355 |
+ |
356 |
+ asm volatile( |
357 |
+ "nop;nop;nop;nop\n\t" |
358 |
+- "nop;nop;nop;nop\n\t" |
359 |
+- "mrs_s %0, " __stringify(ICC_IAR1_EL1) "\n\t" |
360 |
+- "nop;nop;nop;nop" |
361 |
+- : "=r" (irqstat)); |
362 |
++ "nop;nop;nop;nop"); |
363 |
++ |
364 |
++ irqstat = read_sysreg_s(ICC_IAR1_EL1); |
365 |
++ |
366 |
++ asm volatile( |
367 |
++ "nop;nop;nop;nop"); |
368 |
+ mb(); |
369 |
+ |
370 |
+ return irqstat; |
371 |
+@@ -145,43 +137,40 @@ static inline u64 gic_read_iar_cavium_thunderx(void) |
372 |
+ |
373 |
+ static inline void gic_write_pmr(u32 val) |
374 |
+ { |
375 |
+- asm volatile("msr_s " __stringify(ICC_PMR_EL1) ", %0" : : "r" ((u64)val)); |
376 |
++ write_sysreg_s(val, ICC_PMR_EL1); |
377 |
+ } |
378 |
+ |
379 |
+ static inline void gic_write_ctlr(u32 val) |
380 |
+ { |
381 |
+- asm volatile("msr_s " __stringify(ICC_CTLR_EL1) ", %0" : : "r" ((u64)val)); |
382 |
++ write_sysreg_s(val, ICC_CTLR_EL1); |
383 |
+ isb(); |
384 |
+ } |
385 |
+ |
386 |
+ static inline void gic_write_grpen1(u32 val) |
387 |
+ { |
388 |
+- asm volatile("msr_s " __stringify(ICC_GRPEN1_EL1) ", %0" : : "r" ((u64)val)); |
389 |
++ write_sysreg_s(val, ICC_GRPEN1_EL1); |
390 |
+ isb(); |
391 |
+ } |
392 |
+ |
393 |
+ static inline void gic_write_sgi1r(u64 val) |
394 |
+ { |
395 |
+- asm volatile("msr_s " __stringify(ICC_SGI1R_EL1) ", %0" : : "r" (val)); |
396 |
++ write_sysreg_s(val, ICC_SGI1R_EL1); |
397 |
+ } |
398 |
+ |
399 |
+ static inline u32 gic_read_sre(void) |
400 |
+ { |
401 |
+- u64 val; |
402 |
+- |
403 |
+- asm volatile("mrs_s %0, " __stringify(ICC_SRE_EL1) : "=r" (val)); |
404 |
+- return val; |
405 |
++ return read_sysreg_s(ICC_SRE_EL1); |
406 |
+ } |
407 |
+ |
408 |
+ static inline void gic_write_sre(u32 val) |
409 |
+ { |
410 |
+- asm volatile("msr_s " __stringify(ICC_SRE_EL1) ", %0" : : "r" ((u64)val)); |
411 |
++ write_sysreg_s(val, ICC_SRE_EL1); |
412 |
+ isb(); |
413 |
+ } |
414 |
+ |
415 |
+ static inline void gic_write_bpr1(u32 val) |
416 |
+ { |
417 |
+- asm volatile("msr_s " __stringify(ICC_BPR1_EL1) ", %0" : : "r" (val)); |
418 |
++ write_sysreg_s(val, ICC_BPR1_EL1); |
419 |
+ } |
420 |
+ |
421 |
+ #define gic_read_typer(c) readq_relaxed(c) |
422 |
+diff --git a/arch/mips/configs/ath79_defconfig b/arch/mips/configs/ath79_defconfig |
423 |
+index 134879c1310a0..4ed369c0ec6a1 100644 |
424 |
+--- a/arch/mips/configs/ath79_defconfig |
425 |
++++ b/arch/mips/configs/ath79_defconfig |
426 |
+@@ -74,6 +74,7 @@ CONFIG_SERIAL_8250_CONSOLE=y |
427 |
+ # CONFIG_SERIAL_8250_PCI is not set |
428 |
+ CONFIG_SERIAL_8250_NR_UARTS=1 |
429 |
+ CONFIG_SERIAL_8250_RUNTIME_UARTS=1 |
430 |
++CONFIG_SERIAL_OF_PLATFORM=y |
431 |
+ CONFIG_SERIAL_AR933X=y |
432 |
+ CONFIG_SERIAL_AR933X_CONSOLE=y |
433 |
+ # CONFIG_HW_RANDOM is not set |
434 |
+diff --git a/arch/mips/jazz/jazzdma.c b/arch/mips/jazz/jazzdma.c |
435 |
+index db6f5afff4ff1..ea897912bc712 100644 |
436 |
+--- a/arch/mips/jazz/jazzdma.c |
437 |
++++ b/arch/mips/jazz/jazzdma.c |
438 |
+@@ -71,14 +71,15 @@ static int __init vdma_init(void) |
439 |
+ get_order(VDMA_PGTBL_SIZE)); |
440 |
+ BUG_ON(!pgtbl); |
441 |
+ dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE); |
442 |
+- pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl); |
443 |
++ pgtbl = (VDMA_PGTBL_ENTRY *)CKSEG1ADDR((unsigned long)pgtbl); |
444 |
+ |
445 |
+ /* |
446 |
+ * Clear the R4030 translation table |
447 |
+ */ |
448 |
+ vdma_pgtbl_init(); |
449 |
+ |
450 |
+- r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, CPHYSADDR(pgtbl)); |
451 |
++ r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, |
452 |
++ CPHYSADDR((unsigned long)pgtbl)); |
453 |
+ r4030_write_reg32(JAZZ_R4030_TRSTBL_LIM, VDMA_PGTBL_SIZE); |
454 |
+ r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0); |
455 |
+ |
456 |
+diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c |
457 |
+index e02d7b4d2b693..0780c375fe2e2 100644 |
458 |
+--- a/arch/parisc/kernel/ptrace.c |
459 |
++++ b/arch/parisc/kernel/ptrace.c |
460 |
+@@ -311,15 +311,29 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, |
461 |
+ |
462 |
+ long do_syscall_trace_enter(struct pt_regs *regs) |
463 |
+ { |
464 |
+- if (test_thread_flag(TIF_SYSCALL_TRACE) && |
465 |
+- tracehook_report_syscall_entry(regs)) { |
466 |
++ if (test_thread_flag(TIF_SYSCALL_TRACE)) { |
467 |
++ int rc = tracehook_report_syscall_entry(regs); |
468 |
++ |
469 |
+ /* |
470 |
+- * Tracing decided this syscall should not happen or the |
471 |
+- * debugger stored an invalid system call number. Skip |
472 |
+- * the system call and the system call restart handling. |
473 |
++ * As tracesys_next does not set %r28 to -ENOSYS |
474 |
++ * when %r20 is set to -1, initialize it here. |
475 |
+ */ |
476 |
+- regs->gr[20] = -1UL; |
477 |
+- goto out; |
478 |
++ regs->gr[28] = -ENOSYS; |
479 |
++ |
480 |
++ if (rc) { |
481 |
++ /* |
482 |
++ * A nonzero return code from |
483 |
++ * tracehook_report_syscall_entry() tells us |
484 |
++ * to prevent the syscall execution. Skip |
485 |
++ * the syscall call and the syscall restart handling. |
486 |
++ * |
487 |
++ * Note that the tracer may also just change |
488 |
++ * regs->gr[20] to an invalid syscall number, |
489 |
++ * that is handled by tracesys_next. |
490 |
++ */ |
491 |
++ regs->gr[20] = -1UL; |
492 |
++ return -1; |
493 |
++ } |
494 |
+ } |
495 |
+ |
496 |
+ /* Do the secure computing check after ptrace. */ |
497 |
+@@ -343,7 +357,6 @@ long do_syscall_trace_enter(struct pt_regs *regs) |
498 |
+ regs->gr[24] & 0xffffffff, |
499 |
+ regs->gr[23] & 0xffffffff); |
500 |
+ |
501 |
+-out: |
502 |
+ /* |
503 |
+ * Sign extend the syscall number to 64bit since it may have been |
504 |
+ * modified by a compat ptrace call |
505 |
+diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile |
506 |
+index cda8e14bd72a3..89b163351e642 100644 |
507 |
+--- a/arch/x86/boot/compressed/Makefile |
508 |
++++ b/arch/x86/boot/compressed/Makefile |
509 |
+@@ -34,6 +34,7 @@ KBUILD_CFLAGS += $(cflags-y) |
510 |
+ KBUILD_CFLAGS += -mno-mmx -mno-sse |
511 |
+ KBUILD_CFLAGS += $(call cc-option,-ffreestanding) |
512 |
+ KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) |
513 |
++KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) |
514 |
+ |
515 |
+ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ |
516 |
+ GCOV_PROFILE := n |
517 |
+diff --git a/drivers/atm/he.c b/drivers/atm/he.c |
518 |
+index 31b513a23ae0c..985a5800a6376 100644 |
519 |
+--- a/drivers/atm/he.c |
520 |
++++ b/drivers/atm/he.c |
521 |
+@@ -717,7 +717,7 @@ static int he_init_cs_block_rcm(struct he_dev *he_dev) |
522 |
+ instead of '/ 512', use '>> 9' to prevent a call |
523 |
+ to divdu3 on x86 platforms |
524 |
+ */ |
525 |
+- rate_cps = (unsigned long long) (1 << exp) * (man + 512) >> 9; |
526 |
++ rate_cps = (unsigned long long) (1UL << exp) * (man + 512) >> 9; |
527 |
+ |
528 |
+ if (rate_cps < 10) |
529 |
+ rate_cps = 10; /* 2.2.1 minimum payload rate is 10 cps */ |
530 |
+diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c |
531 |
+index be54e5331a451..50272fe81f267 100644 |
532 |
+--- a/drivers/char/hpet.c |
533 |
++++ b/drivers/char/hpet.c |
534 |
+@@ -574,7 +574,7 @@ static inline unsigned long hpet_time_div(struct hpets *hpets, |
535 |
+ } |
536 |
+ |
537 |
+ static int |
538 |
+-hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, |
539 |
++hpet_ioctl_common(struct hpet_dev *devp, unsigned int cmd, unsigned long arg, |
540 |
+ struct hpet_info *info) |
541 |
+ { |
542 |
+ struct hpet_timer __iomem *timer; |
543 |
+diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c |
544 |
+index 279d1e021421b..685247c3d489f 100644 |
545 |
+--- a/drivers/gpu/drm/i915/i915_irq.c |
546 |
++++ b/drivers/gpu/drm/i915/i915_irq.c |
547 |
+@@ -1985,10 +1985,10 @@ static void ibx_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir) |
548 |
+ DRM_DEBUG_DRIVER("PCH transcoder CRC error interrupt\n"); |
549 |
+ |
550 |
+ if (pch_iir & SDE_TRANSA_FIFO_UNDER) |
551 |
+- intel_pch_fifo_underrun_irq_handler(dev_priv, TRANSCODER_A); |
552 |
++ intel_pch_fifo_underrun_irq_handler(dev_priv, PIPE_A); |
553 |
+ |
554 |
+ if (pch_iir & SDE_TRANSB_FIFO_UNDER) |
555 |
+- intel_pch_fifo_underrun_irq_handler(dev_priv, TRANSCODER_B); |
556 |
++ intel_pch_fifo_underrun_irq_handler(dev_priv, PIPE_B); |
557 |
+ } |
558 |
+ |
559 |
+ static void ivb_err_int_handler(struct drm_i915_private *dev_priv) |
560 |
+@@ -2022,13 +2022,13 @@ static void cpt_serr_int_handler(struct drm_i915_private *dev_priv) |
561 |
+ DRM_ERROR("PCH poison interrupt\n"); |
562 |
+ |
563 |
+ if (serr_int & SERR_INT_TRANS_A_FIFO_UNDERRUN) |
564 |
+- intel_pch_fifo_underrun_irq_handler(dev_priv, TRANSCODER_A); |
565 |
++ intel_pch_fifo_underrun_irq_handler(dev_priv, PIPE_A); |
566 |
+ |
567 |
+ if (serr_int & SERR_INT_TRANS_B_FIFO_UNDERRUN) |
568 |
+- intel_pch_fifo_underrun_irq_handler(dev_priv, TRANSCODER_B); |
569 |
++ intel_pch_fifo_underrun_irq_handler(dev_priv, PIPE_B); |
570 |
+ |
571 |
+ if (serr_int & SERR_INT_TRANS_C_FIFO_UNDERRUN) |
572 |
+- intel_pch_fifo_underrun_irq_handler(dev_priv, TRANSCODER_C); |
573 |
++ intel_pch_fifo_underrun_irq_handler(dev_priv, PIPE_C); |
574 |
+ |
575 |
+ I915_WRITE(SERR_INT, serr_int); |
576 |
+ } |
577 |
+diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c |
578 |
+index c185625d67f20..d915877b6ecbc 100644 |
579 |
+--- a/drivers/gpu/drm/i915/intel_display.c |
580 |
++++ b/drivers/gpu/drm/i915/intel_display.c |
581 |
+@@ -1849,7 +1849,7 @@ static void lpt_enable_pch_transcoder(struct drm_i915_private *dev_priv, |
582 |
+ |
583 |
+ /* FDI must be feeding us bits for PCH ports */ |
584 |
+ assert_fdi_tx_enabled(dev_priv, (enum pipe) cpu_transcoder); |
585 |
+- assert_fdi_rx_enabled(dev_priv, TRANSCODER_A); |
586 |
++ assert_fdi_rx_enabled(dev_priv, PIPE_A); |
587 |
+ |
588 |
+ /* Workaround: set timing override bit. */ |
589 |
+ val = I915_READ(TRANS_CHICKEN2(PIPE_A)); |
590 |
+@@ -1950,7 +1950,7 @@ static void intel_enable_pipe(struct intel_crtc *crtc) |
591 |
+ assert_sprites_disabled(dev_priv, pipe); |
592 |
+ |
593 |
+ if (HAS_PCH_LPT(dev_priv)) |
594 |
+- pch_transcoder = TRANSCODER_A; |
595 |
++ pch_transcoder = PIPE_A; |
596 |
+ else |
597 |
+ pch_transcoder = pipe; |
598 |
+ |
599 |
+@@ -4636,7 +4636,7 @@ static void lpt_pch_enable(struct drm_crtc *crtc) |
600 |
+ struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
601 |
+ enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder; |
602 |
+ |
603 |
+- assert_pch_transcoder_disabled(dev_priv, TRANSCODER_A); |
604 |
++ assert_pch_transcoder_disabled(dev_priv, PIPE_A); |
605 |
+ |
606 |
+ lpt_program_iclkip(crtc); |
607 |
+ |
608 |
+@@ -5410,7 +5410,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config, |
609 |
+ return; |
610 |
+ |
611 |
+ if (intel_crtc->config->has_pch_encoder) |
612 |
+- intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A, |
613 |
++ intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, |
614 |
+ false); |
615 |
+ |
616 |
+ intel_encoders_pre_pll_enable(crtc, pipe_config, old_state); |
617 |
+@@ -5498,7 +5498,7 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config, |
618 |
+ intel_wait_for_vblank(dev, pipe); |
619 |
+ intel_wait_for_vblank(dev, pipe); |
620 |
+ intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, true); |
621 |
+- intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A, |
622 |
++ intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, |
623 |
+ true); |
624 |
+ } |
625 |
+ |
626 |
+@@ -5597,7 +5597,7 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state, |
627 |
+ enum transcoder cpu_transcoder = intel_crtc->config->cpu_transcoder; |
628 |
+ |
629 |
+ if (intel_crtc->config->has_pch_encoder) |
630 |
+- intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A, |
631 |
++ intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, |
632 |
+ false); |
633 |
+ |
634 |
+ intel_encoders_disable(crtc, old_crtc_state, old_state); |
635 |
+@@ -5626,7 +5626,7 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state, |
636 |
+ intel_encoders_post_disable(crtc, old_crtc_state, old_state); |
637 |
+ |
638 |
+ if (old_crtc_state->has_pch_encoder) |
639 |
+- intel_set_pch_fifo_underrun_reporting(dev_priv, TRANSCODER_A, |
640 |
++ intel_set_pch_fifo_underrun_reporting(dev_priv, PIPE_A, |
641 |
+ true); |
642 |
+ } |
643 |
+ |
644 |
+diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h |
645 |
+index 6a9860df208f5..8aafb96015402 100644 |
646 |
+--- a/drivers/gpu/drm/i915/intel_drv.h |
647 |
++++ b/drivers/gpu/drm/i915/intel_drv.h |
648 |
+@@ -1095,12 +1095,12 @@ static inline unsigned int intel_num_planes(struct intel_crtc *crtc) |
649 |
+ bool intel_set_cpu_fifo_underrun_reporting(struct drm_i915_private *dev_priv, |
650 |
+ enum pipe pipe, bool enable); |
651 |
+ bool intel_set_pch_fifo_underrun_reporting(struct drm_i915_private *dev_priv, |
652 |
+- enum transcoder pch_transcoder, |
653 |
++ enum pipe pch_transcoder, |
654 |
+ bool enable); |
655 |
+ void intel_cpu_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv, |
656 |
+ enum pipe pipe); |
657 |
+ void intel_pch_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv, |
658 |
+- enum transcoder pch_transcoder); |
659 |
++ enum pipe pch_transcoder); |
660 |
+ void intel_check_cpu_fifo_underruns(struct drm_i915_private *dev_priv); |
661 |
+ void intel_check_pch_fifo_underruns(struct drm_i915_private *dev_priv); |
662 |
+ |
663 |
+diff --git a/drivers/gpu/drm/i915/intel_fifo_underrun.c b/drivers/gpu/drm/i915/intel_fifo_underrun.c |
664 |
+index 2aa744081f090..b6b64a2d4b71c 100644 |
665 |
+--- a/drivers/gpu/drm/i915/intel_fifo_underrun.c |
666 |
++++ b/drivers/gpu/drm/i915/intel_fifo_underrun.c |
667 |
+@@ -185,11 +185,11 @@ static void broadwell_set_fifo_underrun_reporting(struct drm_device *dev, |
668 |
+ } |
669 |
+ |
670 |
+ static void ibx_set_fifo_underrun_reporting(struct drm_device *dev, |
671 |
+- enum transcoder pch_transcoder, |
672 |
++ enum pipe pch_transcoder, |
673 |
+ bool enable) |
674 |
+ { |
675 |
+ struct drm_i915_private *dev_priv = to_i915(dev); |
676 |
+- uint32_t bit = (pch_transcoder == TRANSCODER_A) ? |
677 |
++ uint32_t bit = (pch_transcoder == PIPE_A) ? |
678 |
+ SDE_TRANSA_FIFO_UNDER : SDE_TRANSB_FIFO_UNDER; |
679 |
+ |
680 |
+ if (enable) |
681 |
+@@ -201,7 +201,7 @@ static void ibx_set_fifo_underrun_reporting(struct drm_device *dev, |
682 |
+ static void cpt_check_pch_fifo_underruns(struct intel_crtc *crtc) |
683 |
+ { |
684 |
+ struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); |
685 |
+- enum transcoder pch_transcoder = (enum transcoder) crtc->pipe; |
686 |
++ enum pipe pch_transcoder = crtc->pipe; |
687 |
+ uint32_t serr_int = I915_READ(SERR_INT); |
688 |
+ |
689 |
+ assert_spin_locked(&dev_priv->irq_lock); |
690 |
+@@ -212,12 +212,12 @@ static void cpt_check_pch_fifo_underruns(struct intel_crtc *crtc) |
691 |
+ I915_WRITE(SERR_INT, SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder)); |
692 |
+ POSTING_READ(SERR_INT); |
693 |
+ |
694 |
+- DRM_ERROR("pch fifo underrun on pch transcoder %s\n", |
695 |
+- transcoder_name(pch_transcoder)); |
696 |
++ DRM_ERROR("pch fifo underrun on pch transcoder %c\n", |
697 |
++ pipe_name(pch_transcoder)); |
698 |
+ } |
699 |
+ |
700 |
+ static void cpt_set_fifo_underrun_reporting(struct drm_device *dev, |
701 |
+- enum transcoder pch_transcoder, |
702 |
++ enum pipe pch_transcoder, |
703 |
+ bool enable, bool old) |
704 |
+ { |
705 |
+ struct drm_i915_private *dev_priv = to_i915(dev); |
706 |
+@@ -235,8 +235,8 @@ static void cpt_set_fifo_underrun_reporting(struct drm_device *dev, |
707 |
+ |
708 |
+ if (old && I915_READ(SERR_INT) & |
709 |
+ SERR_INT_TRANS_FIFO_UNDERRUN(pch_transcoder)) { |
710 |
+- DRM_ERROR("uncleared pch fifo underrun on pch transcoder %s\n", |
711 |
+- transcoder_name(pch_transcoder)); |
712 |
++ DRM_ERROR("uncleared pch fifo underrun on pch transcoder %c\n", |
713 |
++ pipe_name(pch_transcoder)); |
714 |
+ } |
715 |
+ } |
716 |
+ } |
717 |
+@@ -311,7 +311,7 @@ bool intel_set_cpu_fifo_underrun_reporting(struct drm_i915_private *dev_priv, |
718 |
+ * Returns the previous state of underrun reporting. |
719 |
+ */ |
720 |
+ bool intel_set_pch_fifo_underrun_reporting(struct drm_i915_private *dev_priv, |
721 |
+- enum transcoder pch_transcoder, |
722 |
++ enum pipe pch_transcoder, |
723 |
+ bool enable) |
724 |
+ { |
725 |
+ struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pch_transcoder]; |
726 |
+@@ -384,12 +384,12 @@ void intel_cpu_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv, |
727 |
+ * interrupt to avoid an irq storm. |
728 |
+ */ |
729 |
+ void intel_pch_fifo_underrun_irq_handler(struct drm_i915_private *dev_priv, |
730 |
+- enum transcoder pch_transcoder) |
731 |
++ enum pipe pch_transcoder) |
732 |
+ { |
733 |
+ if (intel_set_pch_fifo_underrun_reporting(dev_priv, pch_transcoder, |
734 |
+ false)) |
735 |
+- DRM_ERROR("PCH transcoder %s FIFO underrun\n", |
736 |
+- transcoder_name(pch_transcoder)); |
737 |
++ DRM_ERROR("PCH transcoder %c FIFO underrun\n", |
738 |
++ pipe_name(pch_transcoder)); |
739 |
+ } |
740 |
+ |
741 |
+ /** |
742 |
+diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c |
743 |
+index 646359025574a..74de1ae48d4f7 100644 |
744 |
+--- a/drivers/infiniband/ulp/srp/ib_srp.c |
745 |
++++ b/drivers/infiniband/ulp/srp/ib_srp.c |
746 |
+@@ -2639,7 +2639,6 @@ static int srp_reset_device(struct scsi_cmnd *scmnd) |
747 |
+ { |
748 |
+ struct srp_target_port *target = host_to_target(scmnd->device->host); |
749 |
+ struct srp_rdma_ch *ch; |
750 |
+- int i, j; |
751 |
+ u8 status; |
752 |
+ |
753 |
+ shost_printk(KERN_ERR, target->scsi_host, "SRP reset_device called\n"); |
754 |
+@@ -2651,15 +2650,6 @@ static int srp_reset_device(struct scsi_cmnd *scmnd) |
755 |
+ if (status) |
756 |
+ return FAILED; |
757 |
+ |
758 |
+- for (i = 0; i < target->ch_count; i++) { |
759 |
+- ch = &target->ch[i]; |
760 |
+- for (j = 0; j < target->req_ring_size; ++j) { |
761 |
+- struct srp_request *req = &ch->req_ring[j]; |
762 |
+- |
763 |
+- srp_finish_req(ch, req, scmnd->device, DID_RESET << 16); |
764 |
+- } |
765 |
+- } |
766 |
+- |
767 |
+ return SUCCESS; |
768 |
+ } |
769 |
+ |
770 |
+diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c |
771 |
+index 4d9b195547c5c..df2a10157720a 100644 |
772 |
+--- a/drivers/isdn/hardware/avm/b1.c |
773 |
++++ b/drivers/isdn/hardware/avm/b1.c |
774 |
+@@ -423,7 +423,7 @@ void b1_parse_version(avmctrl_info *cinfo) |
775 |
+ int i, j; |
776 |
+ |
777 |
+ for (j = 0; j < AVM_MAXVERSION; j++) |
778 |
+- cinfo->version[j] = "\0\0" + 1; |
779 |
++ cinfo->version[j] = ""; |
780 |
+ for (i = 0, j = 0; |
781 |
+ j < AVM_MAXVERSION && i < cinfo->versionlen; |
782 |
+ j++, i += cinfo->versionbuf[i] + 1) |
783 |
+diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c |
784 |
+index 63eaa0a9f8a18..d4e0d1602c80f 100644 |
785 |
+--- a/drivers/isdn/i4l/isdn_tty.c |
786 |
++++ b/drivers/isdn/i4l/isdn_tty.c |
787 |
+@@ -1455,15 +1455,19 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) |
788 |
+ { |
789 |
+ modem_info *info = (modem_info *) tty->driver_data; |
790 |
+ |
791 |
++ mutex_lock(&modem_info_mutex); |
792 |
+ if (!old_termios) |
793 |
+ isdn_tty_change_speed(info); |
794 |
+ else { |
795 |
+ if (tty->termios.c_cflag == old_termios->c_cflag && |
796 |
+ tty->termios.c_ispeed == old_termios->c_ispeed && |
797 |
+- tty->termios.c_ospeed == old_termios->c_ospeed) |
798 |
++ tty->termios.c_ospeed == old_termios->c_ospeed) { |
799 |
++ mutex_unlock(&modem_info_mutex); |
800 |
+ return; |
801 |
++ } |
802 |
+ isdn_tty_change_speed(info); |
803 |
+ } |
804 |
++ mutex_unlock(&modem_info_mutex); |
805 |
+ } |
806 |
+ |
807 |
+ /* |
808 |
+diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c |
809 |
+index c5b30f06218a3..44ceed7ac3c5b 100644 |
810 |
+--- a/drivers/leds/leds-lp5523.c |
811 |
++++ b/drivers/leds/leds-lp5523.c |
812 |
+@@ -318,7 +318,9 @@ static int lp5523_init_program_engine(struct lp55xx_chip *chip) |
813 |
+ |
814 |
+ /* Let the programs run for couple of ms and check the engine status */ |
815 |
+ usleep_range(3000, 6000); |
816 |
+- lp55xx_read(chip, LP5523_REG_STATUS, &status); |
817 |
++ ret = lp55xx_read(chip, LP5523_REG_STATUS, &status); |
818 |
++ if (ret) |
819 |
++ return ret; |
820 |
+ status &= LP5523_ENG_STATUS_MASK; |
821 |
+ |
822 |
+ if (status != LP5523_ENG_STATUS_MASK) { |
823 |
+diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c |
824 |
+index 589eebfc13df9..2f212bdc187a4 100644 |
825 |
+--- a/drivers/mfd/ab8500-core.c |
826 |
++++ b/drivers/mfd/ab8500-core.c |
827 |
+@@ -257,7 +257,7 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank, |
828 |
+ mutex_unlock(&ab8500->lock); |
829 |
+ dev_vdbg(ab8500->dev, "rd: addr %#x => data %#x\n", addr, ret); |
830 |
+ |
831 |
+- return ret; |
832 |
++ return (ret < 0) ? ret : 0; |
833 |
+ } |
834 |
+ |
835 |
+ static int ab8500_get_register(struct device *dev, u8 bank, |
836 |
+diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c |
837 |
+index ca38a6a141100..26ccf3f4ade9c 100644 |
838 |
+--- a/drivers/mfd/db8500-prcmu.c |
839 |
++++ b/drivers/mfd/db8500-prcmu.c |
840 |
+@@ -2588,7 +2588,7 @@ static struct irq_chip prcmu_irq_chip = { |
841 |
+ .irq_unmask = prcmu_irq_unmask, |
842 |
+ }; |
843 |
+ |
844 |
+-static __init char *fw_project_name(u32 project) |
845 |
++static char *fw_project_name(u32 project) |
846 |
+ { |
847 |
+ switch (project) { |
848 |
+ case PRCMU_FW_PROJECT_U8500: |
849 |
+@@ -2736,7 +2736,7 @@ void __init db8500_prcmu_early_init(u32 phy_base, u32 size) |
850 |
+ INIT_WORK(&mb0_transfer.mask_work, prcmu_mask_work); |
851 |
+ } |
852 |
+ |
853 |
+-static void __init init_prcm_registers(void) |
854 |
++static void init_prcm_registers(void) |
855 |
+ { |
856 |
+ u32 val; |
857 |
+ |
858 |
+diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c |
859 |
+index d7f54e492aa61..6c16f170529f5 100644 |
860 |
+--- a/drivers/mfd/mc13xxx-core.c |
861 |
++++ b/drivers/mfd/mc13xxx-core.c |
862 |
+@@ -274,7 +274,9 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode, |
863 |
+ |
864 |
+ mc13xxx->adcflags |= MC13XXX_ADC_WORKING; |
865 |
+ |
866 |
+- mc13xxx_reg_read(mc13xxx, MC13XXX_ADC0, &old_adc0); |
867 |
++ ret = mc13xxx_reg_read(mc13xxx, MC13XXX_ADC0, &old_adc0); |
868 |
++ if (ret) |
869 |
++ goto out; |
870 |
+ |
871 |
+ adc0 = MC13XXX_ADC0_ADINC1 | MC13XXX_ADC0_ADINC2; |
872 |
+ adc1 = MC13XXX_ADC1_ADEN | MC13XXX_ADC1_ADTRIGIGN | MC13XXX_ADC1_ASC; |
873 |
+diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c |
874 |
+index e14d8b058f0c2..5d4c10f05450a 100644 |
875 |
+--- a/drivers/mfd/mt6397-core.c |
876 |
++++ b/drivers/mfd/mt6397-core.c |
877 |
+@@ -306,8 +306,7 @@ static int mt6397_probe(struct platform_device *pdev) |
878 |
+ |
879 |
+ default: |
880 |
+ dev_err(&pdev->dev, "unsupported chip: %d\n", id); |
881 |
+- ret = -ENODEV; |
882 |
+- break; |
883 |
++ return -ENODEV; |
884 |
+ } |
885 |
+ |
886 |
+ if (ret) { |
887 |
+diff --git a/drivers/mfd/qcom_rpm.c b/drivers/mfd/qcom_rpm.c |
888 |
+index 52fafea06067e..8d420c37b2a61 100644 |
889 |
+--- a/drivers/mfd/qcom_rpm.c |
890 |
++++ b/drivers/mfd/qcom_rpm.c |
891 |
+@@ -638,6 +638,10 @@ static int qcom_rpm_probe(struct platform_device *pdev) |
892 |
+ return -EFAULT; |
893 |
+ } |
894 |
+ |
895 |
++ writel(fw_version[0], RPM_CTRL_REG(rpm, 0)); |
896 |
++ writel(fw_version[1], RPM_CTRL_REG(rpm, 1)); |
897 |
++ writel(fw_version[2], RPM_CTRL_REG(rpm, 2)); |
898 |
++ |
899 |
+ dev_info(&pdev->dev, "RPM firmware %u.%u.%u\n", fw_version[0], |
900 |
+ fw_version[1], |
901 |
+ fw_version[2]); |
902 |
+diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c |
903 |
+index 798f0a829637f..60286adbd6a1c 100644 |
904 |
+--- a/drivers/mfd/ti_am335x_tscadc.c |
905 |
++++ b/drivers/mfd/ti_am335x_tscadc.c |
906 |
+@@ -264,8 +264,9 @@ static int ti_tscadc_probe(struct platform_device *pdev) |
907 |
+ cell->pdata_size = sizeof(tscadc); |
908 |
+ } |
909 |
+ |
910 |
+- err = mfd_add_devices(&pdev->dev, pdev->id, tscadc->cells, |
911 |
+- tscadc->used_cells, NULL, 0, NULL); |
912 |
++ err = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, |
913 |
++ tscadc->cells, tscadc->used_cells, NULL, |
914 |
++ 0, NULL); |
915 |
+ if (err < 0) |
916 |
+ goto err_disable_clk; |
917 |
+ |
918 |
+diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c |
919 |
+index c64615dca2bd3..1d58df8565488 100644 |
920 |
+--- a/drivers/mfd/twl-core.c |
921 |
++++ b/drivers/mfd/twl-core.c |
922 |
+@@ -979,7 +979,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned irq_base, |
923 |
+ * letting it generate the right frequencies for USB, MADC, and |
924 |
+ * other purposes. |
925 |
+ */ |
926 |
+-static inline int __init protect_pm_master(void) |
927 |
++static inline int protect_pm_master(void) |
928 |
+ { |
929 |
+ int e = 0; |
930 |
+ |
931 |
+@@ -988,7 +988,7 @@ static inline int __init protect_pm_master(void) |
932 |
+ return e; |
933 |
+ } |
934 |
+ |
935 |
+-static inline int __init unprotect_pm_master(void) |
936 |
++static inline int unprotect_pm_master(void) |
937 |
+ { |
938 |
+ int e = 0; |
939 |
+ |
940 |
+diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c |
941 |
+index 1ee68bd440fbc..16c6e2accfaa5 100644 |
942 |
+--- a/drivers/mfd/wm5110-tables.c |
943 |
++++ b/drivers/mfd/wm5110-tables.c |
944 |
+@@ -1618,6 +1618,7 @@ static const struct reg_default wm5110_reg_default[] = { |
945 |
+ { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */ |
946 |
+ { 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */ |
947 |
+ { 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */ |
948 |
++ { 0x00000EE3, 0x4000 }, /* R3811 - ASRC_RATE2 */ |
949 |
+ { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */ |
950 |
+ { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */ |
951 |
+ { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */ |
952 |
+@@ -2869,6 +2870,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) |
953 |
+ case ARIZONA_ASRC_ENABLE: |
954 |
+ case ARIZONA_ASRC_STATUS: |
955 |
+ case ARIZONA_ASRC_RATE1: |
956 |
++ case ARIZONA_ASRC_RATE2: |
957 |
+ case ARIZONA_ISRC_1_CTRL_1: |
958 |
+ case ARIZONA_ISRC_1_CTRL_2: |
959 |
+ case ARIZONA_ISRC_1_CTRL_3: |
960 |
+diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c |
961 |
+index 0b4d90ceea7a6..864f107ed48fa 100644 |
962 |
+--- a/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c |
963 |
++++ b/drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c |
964 |
+@@ -149,12 +149,10 @@ static void hns_ae_put_handle(struct hnae_handle *handle) |
965 |
+ struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle); |
966 |
+ int i; |
967 |
+ |
968 |
+- vf_cb->mac_cb = NULL; |
969 |
+- |
970 |
+- kfree(vf_cb); |
971 |
+- |
972 |
+ for (i = 0; i < handle->q_num; i++) |
973 |
+ hns_ae_get_ring_pair(handle->qs[i])->used_by_vf = 0; |
974 |
++ |
975 |
++ kfree(vf_cb); |
976 |
+ } |
977 |
+ |
978 |
+ static void hns_ae_ring_enable_all(struct hnae_handle *handle, int val) |
979 |
+diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
980 |
+index 1a92cd719e19d..ab2259c5808aa 100644 |
981 |
+--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
982 |
++++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c |
983 |
+@@ -777,13 +777,27 @@ static int get_fixed_ipv6_csum(__wsum hw_checksum, struct sk_buff *skb, |
984 |
+ return 0; |
985 |
+ } |
986 |
+ #endif |
987 |
++ |
988 |
++#define short_frame(size) ((size) <= ETH_ZLEN + ETH_FCS_LEN) |
989 |
++ |
990 |
+ static int check_csum(struct mlx4_cqe *cqe, struct sk_buff *skb, void *va, |
991 |
+ netdev_features_t dev_features) |
992 |
+ { |
993 |
+ __wsum hw_checksum = 0; |
994 |
++ void *hdr; |
995 |
++ |
996 |
++ /* CQE csum doesn't cover padding octets in short ethernet |
997 |
++ * frames. And the pad field is appended prior to calculating |
998 |
++ * and appending the FCS field. |
999 |
++ * |
1000 |
++ * Detecting these padded frames requires to verify and parse |
1001 |
++ * IP headers, so we simply force all those small frames to skip |
1002 |
++ * checksum complete. |
1003 |
++ */ |
1004 |
++ if (short_frame(skb->len)) |
1005 |
++ return -EINVAL; |
1006 |
+ |
1007 |
+- void *hdr = (u8 *)va + sizeof(struct ethhdr); |
1008 |
+- |
1009 |
++ hdr = (u8 *)va + sizeof(struct ethhdr); |
1010 |
+ hw_checksum = csum_unfold((__force __sum16)cqe->checksum); |
1011 |
+ |
1012 |
+ if (cqe->vlan_my_qpn & cpu_to_be32(MLX4_CQE_CVLAN_PRESENT_MASK) && |
1013 |
+@@ -945,6 +959,11 @@ xdp_drop: |
1014 |
+ } |
1015 |
+ |
1016 |
+ if (likely(dev->features & NETIF_F_RXCSUM)) { |
1017 |
++ /* TODO: For IP non TCP/UDP packets when csum complete is |
1018 |
++ * not an option (not supported or any other reason) we can |
1019 |
++ * actually check cqe IPOK status bit and report |
1020 |
++ * CHECKSUM_UNNECESSARY rather than CHECKSUM_NONE |
1021 |
++ */ |
1022 |
+ if (cqe->status & cpu_to_be16(MLX4_CQE_STATUS_TCP | |
1023 |
+ MLX4_CQE_STATUS_UDP)) { |
1024 |
+ if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) && |
1025 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c |
1026 |
+index bf1c09ca73c03..b210c171a3806 100644 |
1027 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c |
1028 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c |
1029 |
+@@ -91,6 +91,7 @@ static void mlx5e_update_sw_rep_counters(struct mlx5e_priv *priv) |
1030 |
+ |
1031 |
+ s->tx_packets += sq_stats->packets; |
1032 |
+ s->tx_bytes += sq_stats->bytes; |
1033 |
++ s->tx_queue_dropped += sq_stats->dropped; |
1034 |
+ } |
1035 |
+ } |
1036 |
+ } |
1037 |
+diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c |
1038 |
+index 60e1edcbe5734..7ca1ab5c19366 100644 |
1039 |
+--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c |
1040 |
++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c |
1041 |
+@@ -794,7 +794,7 @@ static int mlxsw_sp_port_vlans_add(struct mlxsw_sp_port *mlxsw_sp_port, |
1042 |
+ static enum mlxsw_reg_sfd_rec_policy mlxsw_sp_sfd_rec_policy(bool dynamic) |
1043 |
+ { |
1044 |
+ return dynamic ? MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_INGRESS : |
1045 |
+- MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY; |
1046 |
++ MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_MLAG; |
1047 |
+ } |
1048 |
+ |
1049 |
+ static enum mlxsw_reg_sfd_op mlxsw_sp_sfd_op(bool adding) |
1050 |
+@@ -806,7 +806,7 @@ static enum mlxsw_reg_sfd_op mlxsw_sp_sfd_op(bool adding) |
1051 |
+ static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port, |
1052 |
+ const char *mac, u16 fid, bool adding, |
1053 |
+ enum mlxsw_reg_sfd_rec_action action, |
1054 |
+- bool dynamic) |
1055 |
++ enum mlxsw_reg_sfd_rec_policy policy) |
1056 |
+ { |
1057 |
+ char *sfd_pl; |
1058 |
+ u8 num_rec; |
1059 |
+@@ -817,8 +817,7 @@ static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port, |
1060 |
+ return -ENOMEM; |
1061 |
+ |
1062 |
+ mlxsw_reg_sfd_pack(sfd_pl, mlxsw_sp_sfd_op(adding), 0); |
1063 |
+- mlxsw_reg_sfd_uc_pack(sfd_pl, 0, mlxsw_sp_sfd_rec_policy(dynamic), |
1064 |
+- mac, fid, action, local_port); |
1065 |
++ mlxsw_reg_sfd_uc_pack(sfd_pl, 0, policy, mac, fid, action, local_port); |
1066 |
+ num_rec = mlxsw_reg_sfd_num_rec_get(sfd_pl); |
1067 |
+ err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl); |
1068 |
+ if (err) |
1069 |
+@@ -837,7 +836,8 @@ static int mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port, |
1070 |
+ bool dynamic) |
1071 |
+ { |
1072 |
+ return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, local_port, mac, fid, adding, |
1073 |
+- MLXSW_REG_SFD_REC_ACTION_NOP, dynamic); |
1074 |
++ MLXSW_REG_SFD_REC_ACTION_NOP, |
1075 |
++ mlxsw_sp_sfd_rec_policy(dynamic)); |
1076 |
+ } |
1077 |
+ |
1078 |
+ int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid, |
1079 |
+@@ -845,7 +845,7 @@ int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid, |
1080 |
+ { |
1081 |
+ return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, 0, mac, fid, adding, |
1082 |
+ MLXSW_REG_SFD_REC_ACTION_FORWARD_IP_ROUTER, |
1083 |
+- false); |
1084 |
++ MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY); |
1085 |
+ } |
1086 |
+ |
1087 |
+ static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id, |
1088 |
+diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c |
1089 |
+index a3360cbdb30bd..5b968e6a0a7fb 100644 |
1090 |
+--- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c |
1091 |
++++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c |
1092 |
+@@ -1013,6 +1013,10 @@ static void qed_ll2_post_rx_buffer_notify_fw(struct qed_hwfn *p_hwfn, |
1093 |
+ cq_prod = qed_chain_get_prod_idx(&p_rx->rcq_chain); |
1094 |
+ rx_prod.bd_prod = cpu_to_le16(bd_prod); |
1095 |
+ rx_prod.cqe_prod = cpu_to_le16(cq_prod); |
1096 |
++ |
1097 |
++ /* Make sure chain element is updated before ringing the doorbell */ |
1098 |
++ dma_wmb(); |
1099 |
++ |
1100 |
+ DIRECT_REG_WR(p_rx->set_prod_addr, *((u32 *)&rx_prod)); |
1101 |
+ } |
1102 |
+ |
1103 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c |
1104 |
+index b3e669af30055..026e8e9cb9429 100644 |
1105 |
+--- a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c |
1106 |
++++ b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c |
1107 |
+@@ -34,7 +34,7 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) |
1108 |
+ unsigned int entry = priv->cur_tx; |
1109 |
+ struct dma_desc *desc = priv->dma_tx + entry; |
1110 |
+ unsigned int nopaged_len = skb_headlen(skb); |
1111 |
+- unsigned int bmax; |
1112 |
++ unsigned int bmax, des2; |
1113 |
+ unsigned int i = 1, len; |
1114 |
+ |
1115 |
+ if (priv->plat->enh_desc) |
1116 |
+@@ -44,11 +44,12 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) |
1117 |
+ |
1118 |
+ len = nopaged_len - bmax; |
1119 |
+ |
1120 |
+- desc->des2 = dma_map_single(priv->device, skb->data, |
1121 |
+- bmax, DMA_TO_DEVICE); |
1122 |
+- if (dma_mapping_error(priv->device, desc->des2)) |
1123 |
++ des2 = dma_map_single(priv->device, skb->data, |
1124 |
++ bmax, DMA_TO_DEVICE); |
1125 |
++ desc->des2 = cpu_to_le32(des2); |
1126 |
++ if (dma_mapping_error(priv->device, des2)) |
1127 |
+ return -1; |
1128 |
+- priv->tx_skbuff_dma[entry].buf = desc->des2; |
1129 |
++ priv->tx_skbuff_dma[entry].buf = des2; |
1130 |
+ priv->tx_skbuff_dma[entry].len = bmax; |
1131 |
+ /* do not close the descriptor and do not set own bit */ |
1132 |
+ priv->hw->desc->prepare_tx_desc(desc, 1, bmax, csum, STMMAC_CHAIN_MODE, |
1133 |
+@@ -60,12 +61,13 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) |
1134 |
+ desc = priv->dma_tx + entry; |
1135 |
+ |
1136 |
+ if (len > bmax) { |
1137 |
+- desc->des2 = dma_map_single(priv->device, |
1138 |
+- (skb->data + bmax * i), |
1139 |
+- bmax, DMA_TO_DEVICE); |
1140 |
+- if (dma_mapping_error(priv->device, desc->des2)) |
1141 |
++ des2 = dma_map_single(priv->device, |
1142 |
++ (skb->data + bmax * i), |
1143 |
++ bmax, DMA_TO_DEVICE); |
1144 |
++ desc->des2 = cpu_to_le32(des2); |
1145 |
++ if (dma_mapping_error(priv->device, des2)) |
1146 |
+ return -1; |
1147 |
+- priv->tx_skbuff_dma[entry].buf = desc->des2; |
1148 |
++ priv->tx_skbuff_dma[entry].buf = des2; |
1149 |
+ priv->tx_skbuff_dma[entry].len = bmax; |
1150 |
+ priv->hw->desc->prepare_tx_desc(desc, 0, bmax, csum, |
1151 |
+ STMMAC_CHAIN_MODE, 1, |
1152 |
+@@ -73,12 +75,13 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) |
1153 |
+ len -= bmax; |
1154 |
+ i++; |
1155 |
+ } else { |
1156 |
+- desc->des2 = dma_map_single(priv->device, |
1157 |
+- (skb->data + bmax * i), len, |
1158 |
+- DMA_TO_DEVICE); |
1159 |
+- if (dma_mapping_error(priv->device, desc->des2)) |
1160 |
++ des2 = dma_map_single(priv->device, |
1161 |
++ (skb->data + bmax * i), len, |
1162 |
++ DMA_TO_DEVICE); |
1163 |
++ desc->des2 = cpu_to_le32(des2); |
1164 |
++ if (dma_mapping_error(priv->device, des2)) |
1165 |
+ return -1; |
1166 |
+- priv->tx_skbuff_dma[entry].buf = desc->des2; |
1167 |
++ priv->tx_skbuff_dma[entry].buf = des2; |
1168 |
+ priv->tx_skbuff_dma[entry].len = len; |
1169 |
+ /* last descriptor can be set now */ |
1170 |
+ priv->hw->desc->prepare_tx_desc(desc, 0, len, csum, |
1171 |
+@@ -119,19 +122,19 @@ static void stmmac_init_dma_chain(void *des, dma_addr_t phy_addr, |
1172 |
+ struct dma_extended_desc *p = (struct dma_extended_desc *)des; |
1173 |
+ for (i = 0; i < (size - 1); i++) { |
1174 |
+ dma_phy += sizeof(struct dma_extended_desc); |
1175 |
+- p->basic.des3 = (unsigned int)dma_phy; |
1176 |
++ p->basic.des3 = cpu_to_le32((unsigned int)dma_phy); |
1177 |
+ p++; |
1178 |
+ } |
1179 |
+- p->basic.des3 = (unsigned int)phy_addr; |
1180 |
++ p->basic.des3 = cpu_to_le32((unsigned int)phy_addr); |
1181 |
+ |
1182 |
+ } else { |
1183 |
+ struct dma_desc *p = (struct dma_desc *)des; |
1184 |
+ for (i = 0; i < (size - 1); i++) { |
1185 |
+ dma_phy += sizeof(struct dma_desc); |
1186 |
+- p->des3 = (unsigned int)dma_phy; |
1187 |
++ p->des3 = cpu_to_le32((unsigned int)dma_phy); |
1188 |
+ p++; |
1189 |
+ } |
1190 |
+- p->des3 = (unsigned int)phy_addr; |
1191 |
++ p->des3 = cpu_to_le32((unsigned int)phy_addr); |
1192 |
+ } |
1193 |
+ } |
1194 |
+ |
1195 |
+@@ -144,10 +147,10 @@ static void stmmac_refill_desc3(void *priv_ptr, struct dma_desc *p) |
1196 |
+ * 1588-2002 time stamping is enabled, hence reinitialize it |
1197 |
+ * to keep explicit chaining in the descriptor. |
1198 |
+ */ |
1199 |
+- p->des3 = (unsigned int)(priv->dma_rx_phy + |
1200 |
+- (((priv->dirty_rx) + 1) % |
1201 |
+- DMA_RX_SIZE) * |
1202 |
+- sizeof(struct dma_desc)); |
1203 |
++ p->des3 = cpu_to_le32((unsigned int)(priv->dma_rx_phy + |
1204 |
++ (((priv->dirty_rx) + 1) % |
1205 |
++ DMA_RX_SIZE) * |
1206 |
++ sizeof(struct dma_desc))); |
1207 |
+ } |
1208 |
+ |
1209 |
+ static void stmmac_clean_desc3(void *priv_ptr, struct dma_desc *p) |
1210 |
+@@ -161,9 +164,9 @@ static void stmmac_clean_desc3(void *priv_ptr, struct dma_desc *p) |
1211 |
+ * 1588-2002 time stamping is enabled, hence reinitialize it |
1212 |
+ * to keep explicit chaining in the descriptor. |
1213 |
+ */ |
1214 |
+- p->des3 = (unsigned int)((priv->dma_tx_phy + |
1215 |
+- ((priv->dirty_tx + 1) % DMA_TX_SIZE)) |
1216 |
+- * sizeof(struct dma_desc)); |
1217 |
++ p->des3 = cpu_to_le32((unsigned int)((priv->dma_tx_phy + |
1218 |
++ ((priv->dirty_tx + 1) % DMA_TX_SIZE)) |
1219 |
++ * sizeof(struct dma_desc))); |
1220 |
+ } |
1221 |
+ |
1222 |
+ const struct stmmac_mode_ops chain_mode_ops = { |
1223 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/descs.h b/drivers/net/ethernet/stmicro/stmmac/descs.h |
1224 |
+index e3c86d4221095..faeeef75d7f17 100644 |
1225 |
+--- a/drivers/net/ethernet/stmicro/stmmac/descs.h |
1226 |
++++ b/drivers/net/ethernet/stmicro/stmmac/descs.h |
1227 |
+@@ -87,7 +87,7 @@ |
1228 |
+ #define TDES0_ERROR_SUMMARY BIT(15) |
1229 |
+ #define TDES0_IP_HEADER_ERROR BIT(16) |
1230 |
+ #define TDES0_TIME_STAMP_STATUS BIT(17) |
1231 |
+-#define TDES0_OWN BIT(31) |
1232 |
++#define TDES0_OWN ((u32)BIT(31)) /* silence sparse */ |
1233 |
+ /* TDES1 */ |
1234 |
+ #define TDES1_BUFFER1_SIZE_MASK GENMASK(10, 0) |
1235 |
+ #define TDES1_BUFFER2_SIZE_MASK GENMASK(21, 11) |
1236 |
+@@ -130,7 +130,7 @@ |
1237 |
+ #define ETDES0_FIRST_SEGMENT BIT(28) |
1238 |
+ #define ETDES0_LAST_SEGMENT BIT(29) |
1239 |
+ #define ETDES0_INTERRUPT BIT(30) |
1240 |
+-#define ETDES0_OWN BIT(31) |
1241 |
++#define ETDES0_OWN ((u32)BIT(31)) /* silence sparse */ |
1242 |
+ /* TDES1 */ |
1243 |
+ #define ETDES1_BUFFER1_SIZE_MASK GENMASK(12, 0) |
1244 |
+ #define ETDES1_BUFFER2_SIZE_MASK GENMASK(28, 16) |
1245 |
+@@ -170,19 +170,19 @@ |
1246 |
+ |
1247 |
+ /* Basic descriptor structure for normal and alternate descriptors */ |
1248 |
+ struct dma_desc { |
1249 |
+- unsigned int des0; |
1250 |
+- unsigned int des1; |
1251 |
+- unsigned int des2; |
1252 |
+- unsigned int des3; |
1253 |
++ __le32 des0; |
1254 |
++ __le32 des1; |
1255 |
++ __le32 des2; |
1256 |
++ __le32 des3; |
1257 |
+ }; |
1258 |
+ |
1259 |
+ /* Extended descriptor structure (e.g. >= databook 3.50a) */ |
1260 |
+ struct dma_extended_desc { |
1261 |
+ struct dma_desc basic; /* Basic descriptors */ |
1262 |
+- unsigned int des4; /* Extended Status */ |
1263 |
+- unsigned int des5; /* Reserved */ |
1264 |
+- unsigned int des6; /* Tx/Rx Timestamp Low */ |
1265 |
+- unsigned int des7; /* Tx/Rx Timestamp High */ |
1266 |
++ __le32 des4; /* Extended Status */ |
1267 |
++ __le32 des5; /* Reserved */ |
1268 |
++ __le32 des6; /* Tx/Rx Timestamp Low */ |
1269 |
++ __le32 des7; /* Tx/Rx Timestamp High */ |
1270 |
+ }; |
1271 |
+ |
1272 |
+ /* Transmit checksum insertion control */ |
1273 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/descs_com.h b/drivers/net/ethernet/stmicro/stmmac/descs_com.h |
1274 |
+index 7635a464ce41c..1d181e205d6ec 100644 |
1275 |
+--- a/drivers/net/ethernet/stmicro/stmmac/descs_com.h |
1276 |
++++ b/drivers/net/ethernet/stmicro/stmmac/descs_com.h |
1277 |
+@@ -35,47 +35,50 @@ |
1278 |
+ /* Enhanced descriptors */ |
1279 |
+ static inline void ehn_desc_rx_set_on_ring(struct dma_desc *p, int end) |
1280 |
+ { |
1281 |
+- p->des1 |= ((BUF_SIZE_8KiB - 1) << ERDES1_BUFFER2_SIZE_SHIFT) |
1282 |
+- & ERDES1_BUFFER2_SIZE_MASK; |
1283 |
++ p->des1 |= cpu_to_le32(((BUF_SIZE_8KiB - 1) |
1284 |
++ << ERDES1_BUFFER2_SIZE_SHIFT) |
1285 |
++ & ERDES1_BUFFER2_SIZE_MASK); |
1286 |
+ |
1287 |
+ if (end) |
1288 |
+- p->des1 |= ERDES1_END_RING; |
1289 |
++ p->des1 |= cpu_to_le32(ERDES1_END_RING); |
1290 |
+ } |
1291 |
+ |
1292 |
+ static inline void enh_desc_end_tx_desc_on_ring(struct dma_desc *p, int end) |
1293 |
+ { |
1294 |
+ if (end) |
1295 |
+- p->des0 |= ETDES0_END_RING; |
1296 |
++ p->des0 |= cpu_to_le32(ETDES0_END_RING); |
1297 |
+ else |
1298 |
+- p->des0 &= ~ETDES0_END_RING; |
1299 |
++ p->des0 &= cpu_to_le32(~ETDES0_END_RING); |
1300 |
+ } |
1301 |
+ |
1302 |
+ static inline void enh_set_tx_desc_len_on_ring(struct dma_desc *p, int len) |
1303 |
+ { |
1304 |
+ if (unlikely(len > BUF_SIZE_4KiB)) { |
1305 |
+- p->des1 |= (((len - BUF_SIZE_4KiB) << ETDES1_BUFFER2_SIZE_SHIFT) |
1306 |
++ p->des1 |= cpu_to_le32((((len - BUF_SIZE_4KiB) |
1307 |
++ << ETDES1_BUFFER2_SIZE_SHIFT) |
1308 |
+ & ETDES1_BUFFER2_SIZE_MASK) | (BUF_SIZE_4KiB |
1309 |
+- & ETDES1_BUFFER1_SIZE_MASK); |
1310 |
++ & ETDES1_BUFFER1_SIZE_MASK)); |
1311 |
+ } else |
1312 |
+- p->des1 |= (len & ETDES1_BUFFER1_SIZE_MASK); |
1313 |
++ p->des1 |= cpu_to_le32((len & ETDES1_BUFFER1_SIZE_MASK)); |
1314 |
+ } |
1315 |
+ |
1316 |
+ /* Normal descriptors */ |
1317 |
+ static inline void ndesc_rx_set_on_ring(struct dma_desc *p, int end) |
1318 |
+ { |
1319 |
+- p->des1 |= ((BUF_SIZE_2KiB - 1) << RDES1_BUFFER2_SIZE_SHIFT) |
1320 |
+- & RDES1_BUFFER2_SIZE_MASK; |
1321 |
++ p->des1 |= cpu_to_le32(((BUF_SIZE_2KiB - 1) |
1322 |
++ << RDES1_BUFFER2_SIZE_SHIFT) |
1323 |
++ & RDES1_BUFFER2_SIZE_MASK); |
1324 |
+ |
1325 |
+ if (end) |
1326 |
+- p->des1 |= RDES1_END_RING; |
1327 |
++ p->des1 |= cpu_to_le32(RDES1_END_RING); |
1328 |
+ } |
1329 |
+ |
1330 |
+ static inline void ndesc_end_tx_desc_on_ring(struct dma_desc *p, int end) |
1331 |
+ { |
1332 |
+ if (end) |
1333 |
+- p->des1 |= TDES1_END_RING; |
1334 |
++ p->des1 |= cpu_to_le32(TDES1_END_RING); |
1335 |
+ else |
1336 |
+- p->des1 &= ~TDES1_END_RING; |
1337 |
++ p->des1 &= cpu_to_le32(~TDES1_END_RING); |
1338 |
+ } |
1339 |
+ |
1340 |
+ static inline void norm_set_tx_desc_len_on_ring(struct dma_desc *p, int len) |
1341 |
+@@ -83,10 +86,11 @@ static inline void norm_set_tx_desc_len_on_ring(struct dma_desc *p, int len) |
1342 |
+ if (unlikely(len > BUF_SIZE_2KiB)) { |
1343 |
+ unsigned int buffer1 = (BUF_SIZE_2KiB - 1) |
1344 |
+ & TDES1_BUFFER1_SIZE_MASK; |
1345 |
+- p->des1 |= ((((len - buffer1) << TDES1_BUFFER2_SIZE_SHIFT) |
1346 |
+- & TDES1_BUFFER2_SIZE_MASK) | buffer1); |
1347 |
++ p->des1 |= cpu_to_le32((((len - buffer1) |
1348 |
++ << TDES1_BUFFER2_SIZE_SHIFT) |
1349 |
++ & TDES1_BUFFER2_SIZE_MASK) | buffer1); |
1350 |
+ } else |
1351 |
+- p->des1 |= (len & TDES1_BUFFER1_SIZE_MASK); |
1352 |
++ p->des1 |= cpu_to_le32((len & TDES1_BUFFER1_SIZE_MASK)); |
1353 |
+ } |
1354 |
+ |
1355 |
+ /* Specific functions used for Chain mode */ |
1356 |
+@@ -94,32 +98,32 @@ static inline void norm_set_tx_desc_len_on_ring(struct dma_desc *p, int len) |
1357 |
+ /* Enhanced descriptors */ |
1358 |
+ static inline void ehn_desc_rx_set_on_chain(struct dma_desc *p) |
1359 |
+ { |
1360 |
+- p->des1 |= ERDES1_SECOND_ADDRESS_CHAINED; |
1361 |
++ p->des1 |= cpu_to_le32(ERDES1_SECOND_ADDRESS_CHAINED); |
1362 |
+ } |
1363 |
+ |
1364 |
+ static inline void enh_desc_end_tx_desc_on_chain(struct dma_desc *p) |
1365 |
+ { |
1366 |
+- p->des0 |= ETDES0_SECOND_ADDRESS_CHAINED; |
1367 |
++ p->des0 |= cpu_to_le32(ETDES0_SECOND_ADDRESS_CHAINED); |
1368 |
+ } |
1369 |
+ |
1370 |
+ static inline void enh_set_tx_desc_len_on_chain(struct dma_desc *p, int len) |
1371 |
+ { |
1372 |
+- p->des1 |= (len & ETDES1_BUFFER1_SIZE_MASK); |
1373 |
++ p->des1 |= cpu_to_le32(len & ETDES1_BUFFER1_SIZE_MASK); |
1374 |
+ } |
1375 |
+ |
1376 |
+ /* Normal descriptors */ |
1377 |
+ static inline void ndesc_rx_set_on_chain(struct dma_desc *p, int end) |
1378 |
+ { |
1379 |
+- p->des1 |= RDES1_SECOND_ADDRESS_CHAINED; |
1380 |
++ p->des1 |= cpu_to_le32(RDES1_SECOND_ADDRESS_CHAINED); |
1381 |
+ } |
1382 |
+ |
1383 |
+ static inline void ndesc_tx_set_on_chain(struct dma_desc *p) |
1384 |
+ { |
1385 |
+- p->des1 |= TDES1_SECOND_ADDRESS_CHAINED; |
1386 |
++ p->des1 |= cpu_to_le32(TDES1_SECOND_ADDRESS_CHAINED); |
1387 |
+ } |
1388 |
+ |
1389 |
+ static inline void norm_set_tx_desc_len_on_chain(struct dma_desc *p, int len) |
1390 |
+ { |
1391 |
+- p->des1 |= len & TDES1_BUFFER1_SIZE_MASK; |
1392 |
++ p->des1 |= cpu_to_le32(len & TDES1_BUFFER1_SIZE_MASK); |
1393 |
+ } |
1394 |
+ #endif /* __DESC_COM_H__ */ |
1395 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c |
1396 |
+index f988c7573ba59..3f5056858535a 100644 |
1397 |
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c |
1398 |
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c |
1399 |
+@@ -23,7 +23,7 @@ static int dwmac4_wrback_get_tx_status(void *data, struct stmmac_extra_stats *x, |
1400 |
+ unsigned int tdes3; |
1401 |
+ int ret = tx_done; |
1402 |
+ |
1403 |
+- tdes3 = p->des3; |
1404 |
++ tdes3 = le32_to_cpu(p->des3); |
1405 |
+ |
1406 |
+ /* Get tx owner first */ |
1407 |
+ if (unlikely(tdes3 & TDES3_OWN)) |
1408 |
+@@ -77,9 +77,9 @@ static int dwmac4_wrback_get_rx_status(void *data, struct stmmac_extra_stats *x, |
1409 |
+ struct dma_desc *p) |
1410 |
+ { |
1411 |
+ struct net_device_stats *stats = (struct net_device_stats *)data; |
1412 |
+- unsigned int rdes1 = p->des1; |
1413 |
+- unsigned int rdes2 = p->des2; |
1414 |
+- unsigned int rdes3 = p->des3; |
1415 |
++ unsigned int rdes1 = le32_to_cpu(p->des1); |
1416 |
++ unsigned int rdes2 = le32_to_cpu(p->des2); |
1417 |
++ unsigned int rdes3 = le32_to_cpu(p->des3); |
1418 |
+ int message_type; |
1419 |
+ int ret = good_frame; |
1420 |
+ |
1421 |
+@@ -176,47 +176,48 @@ static int dwmac4_wrback_get_rx_status(void *data, struct stmmac_extra_stats *x, |
1422 |
+ |
1423 |
+ static int dwmac4_rd_get_tx_len(struct dma_desc *p) |
1424 |
+ { |
1425 |
+- return (p->des2 & TDES2_BUFFER1_SIZE_MASK); |
1426 |
++ return (le32_to_cpu(p->des2) & TDES2_BUFFER1_SIZE_MASK); |
1427 |
+ } |
1428 |
+ |
1429 |
+ static int dwmac4_get_tx_owner(struct dma_desc *p) |
1430 |
+ { |
1431 |
+- return (p->des3 & TDES3_OWN) >> TDES3_OWN_SHIFT; |
1432 |
++ return (le32_to_cpu(p->des3) & TDES3_OWN) >> TDES3_OWN_SHIFT; |
1433 |
+ } |
1434 |
+ |
1435 |
+ static void dwmac4_set_tx_owner(struct dma_desc *p) |
1436 |
+ { |
1437 |
+- p->des3 |= TDES3_OWN; |
1438 |
++ p->des3 |= cpu_to_le32(TDES3_OWN); |
1439 |
+ } |
1440 |
+ |
1441 |
+ static void dwmac4_set_rx_owner(struct dma_desc *p) |
1442 |
+ { |
1443 |
+- p->des3 |= RDES3_OWN; |
1444 |
++ p->des3 |= cpu_to_le32(RDES3_OWN); |
1445 |
+ } |
1446 |
+ |
1447 |
+ static int dwmac4_get_tx_ls(struct dma_desc *p) |
1448 |
+ { |
1449 |
+- return (p->des3 & TDES3_LAST_DESCRIPTOR) >> TDES3_LAST_DESCRIPTOR_SHIFT; |
1450 |
++ return (le32_to_cpu(p->des3) & TDES3_LAST_DESCRIPTOR) |
1451 |
++ >> TDES3_LAST_DESCRIPTOR_SHIFT; |
1452 |
+ } |
1453 |
+ |
1454 |
+ static int dwmac4_wrback_get_rx_frame_len(struct dma_desc *p, int rx_coe) |
1455 |
+ { |
1456 |
+- return (p->des3 & RDES3_PACKET_SIZE_MASK); |
1457 |
++ return (le32_to_cpu(p->des3) & RDES3_PACKET_SIZE_MASK); |
1458 |
+ } |
1459 |
+ |
1460 |
+ static void dwmac4_rd_enable_tx_timestamp(struct dma_desc *p) |
1461 |
+ { |
1462 |
+- p->des2 |= TDES2_TIMESTAMP_ENABLE; |
1463 |
++ p->des2 |= cpu_to_le32(TDES2_TIMESTAMP_ENABLE); |
1464 |
+ } |
1465 |
+ |
1466 |
+ static int dwmac4_wrback_get_tx_timestamp_status(struct dma_desc *p) |
1467 |
+ { |
1468 |
+ /* Context type from W/B descriptor must be zero */ |
1469 |
+- if (p->des3 & TDES3_CONTEXT_TYPE) |
1470 |
++ if (le32_to_cpu(p->des3) & TDES3_CONTEXT_TYPE) |
1471 |
+ return -EINVAL; |
1472 |
+ |
1473 |
+ /* Tx Timestamp Status is 1 so des0 and des1'll have valid values */ |
1474 |
+- if (p->des3 & TDES3_TIMESTAMP_STATUS) |
1475 |
++ if (le32_to_cpu(p->des3) & TDES3_TIMESTAMP_STATUS) |
1476 |
+ return 0; |
1477 |
+ |
1478 |
+ return 1; |
1479 |
+@@ -227,9 +228,9 @@ static inline u64 dwmac4_get_timestamp(void *desc, u32 ats) |
1480 |
+ struct dma_desc *p = (struct dma_desc *)desc; |
1481 |
+ u64 ns; |
1482 |
+ |
1483 |
+- ns = p->des0; |
1484 |
++ ns = le32_to_cpu(p->des0); |
1485 |
+ /* convert high/sec time stamp value to nanosecond */ |
1486 |
+- ns += p->des1 * 1000000000ULL; |
1487 |
++ ns += le32_to_cpu(p->des1) * 1000000000ULL; |
1488 |
+ |
1489 |
+ return ns; |
1490 |
+ } |
1491 |
+@@ -267,7 +268,7 @@ static int dwmac4_wrback_get_rx_timestamp_status(void *desc, u32 ats) |
1492 |
+ |
1493 |
+ /* Get the status from normal w/b descriptor */ |
1494 |
+ if (likely(p->des3 & TDES3_RS1V)) { |
1495 |
+- if (likely(p->des1 & RDES1_TIMESTAMP_AVAILABLE)) { |
1496 |
++ if (likely(le32_to_cpu(p->des1) & RDES1_TIMESTAMP_AVAILABLE)) { |
1497 |
+ int i = 0; |
1498 |
+ |
1499 |
+ /* Check if timestamp is OK from context descriptor */ |
1500 |
+@@ -290,10 +291,10 @@ exit: |
1501 |
+ static void dwmac4_rd_init_rx_desc(struct dma_desc *p, int disable_rx_ic, |
1502 |
+ int mode, int end) |
1503 |
+ { |
1504 |
+- p->des3 = RDES3_OWN | RDES3_BUFFER1_VALID_ADDR; |
1505 |
++ p->des3 = cpu_to_le32(RDES3_OWN | RDES3_BUFFER1_VALID_ADDR); |
1506 |
+ |
1507 |
+ if (!disable_rx_ic) |
1508 |
+- p->des3 |= RDES3_INT_ON_COMPLETION_EN; |
1509 |
++ p->des3 |= cpu_to_le32(RDES3_INT_ON_COMPLETION_EN); |
1510 |
+ } |
1511 |
+ |
1512 |
+ static void dwmac4_rd_init_tx_desc(struct dma_desc *p, int mode, int end) |
1513 |
+@@ -308,9 +309,9 @@ static void dwmac4_rd_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, |
1514 |
+ bool csum_flag, int mode, bool tx_own, |
1515 |
+ bool ls) |
1516 |
+ { |
1517 |
+- unsigned int tdes3 = p->des3; |
1518 |
++ unsigned int tdes3 = le32_to_cpu(p->des3); |
1519 |
+ |
1520 |
+- p->des2 |= (len & TDES2_BUFFER1_SIZE_MASK); |
1521 |
++ p->des2 |= cpu_to_le32(len & TDES2_BUFFER1_SIZE_MASK); |
1522 |
+ |
1523 |
+ if (is_fs) |
1524 |
+ tdes3 |= TDES3_FIRST_DESCRIPTOR; |
1525 |
+@@ -338,7 +339,7 @@ static void dwmac4_rd_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, |
1526 |
+ */ |
1527 |
+ wmb(); |
1528 |
+ |
1529 |
+- p->des3 = tdes3; |
1530 |
++ p->des3 = cpu_to_le32(tdes3); |
1531 |
+ } |
1532 |
+ |
1533 |
+ static void dwmac4_rd_prepare_tso_tx_desc(struct dma_desc *p, int is_fs, |
1534 |
+@@ -346,14 +347,14 @@ static void dwmac4_rd_prepare_tso_tx_desc(struct dma_desc *p, int is_fs, |
1535 |
+ bool ls, unsigned int tcphdrlen, |
1536 |
+ unsigned int tcppayloadlen) |
1537 |
+ { |
1538 |
+- unsigned int tdes3 = p->des3; |
1539 |
++ unsigned int tdes3 = le32_to_cpu(p->des3); |
1540 |
+ |
1541 |
+ if (len1) |
1542 |
+- p->des2 |= (len1 & TDES2_BUFFER1_SIZE_MASK); |
1543 |
++ p->des2 |= cpu_to_le32((len1 & TDES2_BUFFER1_SIZE_MASK)); |
1544 |
+ |
1545 |
+ if (len2) |
1546 |
+- p->des2 |= (len2 << TDES2_BUFFER2_SIZE_MASK_SHIFT) |
1547 |
+- & TDES2_BUFFER2_SIZE_MASK; |
1548 |
++ p->des2 |= cpu_to_le32((len2 << TDES2_BUFFER2_SIZE_MASK_SHIFT) |
1549 |
++ & TDES2_BUFFER2_SIZE_MASK); |
1550 |
+ |
1551 |
+ if (is_fs) { |
1552 |
+ tdes3 |= TDES3_FIRST_DESCRIPTOR | |
1553 |
+@@ -381,7 +382,7 @@ static void dwmac4_rd_prepare_tso_tx_desc(struct dma_desc *p, int is_fs, |
1554 |
+ */ |
1555 |
+ wmb(); |
1556 |
+ |
1557 |
+- p->des3 = tdes3; |
1558 |
++ p->des3 = cpu_to_le32(tdes3); |
1559 |
+ } |
1560 |
+ |
1561 |
+ static void dwmac4_release_tx_desc(struct dma_desc *p, int mode) |
1562 |
+@@ -392,7 +393,7 @@ static void dwmac4_release_tx_desc(struct dma_desc *p, int mode) |
1563 |
+ |
1564 |
+ static void dwmac4_rd_set_tx_ic(struct dma_desc *p) |
1565 |
+ { |
1566 |
+- p->des2 |= TDES2_INTERRUPT_ON_COMPLETION; |
1567 |
++ p->des2 |= cpu_to_le32(TDES2_INTERRUPT_ON_COMPLETION); |
1568 |
+ } |
1569 |
+ |
1570 |
+ static void dwmac4_display_ring(void *head, unsigned int size, bool rx) |
1571 |
+@@ -405,7 +406,8 @@ static void dwmac4_display_ring(void *head, unsigned int size, bool rx) |
1572 |
+ for (i = 0; i < size; i++) { |
1573 |
+ pr_info("%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", |
1574 |
+ i, (unsigned int)virt_to_phys(p), |
1575 |
+- p->des0, p->des1, p->des2, p->des3); |
1576 |
++ le32_to_cpu(p->des0), le32_to_cpu(p->des1), |
1577 |
++ le32_to_cpu(p->des2), le32_to_cpu(p->des3)); |
1578 |
+ p++; |
1579 |
+ } |
1580 |
+ } |
1581 |
+@@ -414,8 +416,8 @@ static void dwmac4_set_mss_ctxt(struct dma_desc *p, unsigned int mss) |
1582 |
+ { |
1583 |
+ p->des0 = 0; |
1584 |
+ p->des1 = 0; |
1585 |
+- p->des2 = mss; |
1586 |
+- p->des3 = TDES3_CONTEXT_TYPE | TDES3_CTXT_TCMSSV; |
1587 |
++ p->des2 = cpu_to_le32(mss); |
1588 |
++ p->des3 = cpu_to_le32(TDES3_CONTEXT_TYPE | TDES3_CTXT_TCMSSV); |
1589 |
+ } |
1590 |
+ |
1591 |
+ const struct stmmac_desc_ops dwmac4_desc_ops = { |
1592 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c |
1593 |
+index e75549327c345..ce97e522566a8 100644 |
1594 |
+--- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c |
1595 |
++++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c |
1596 |
+@@ -30,7 +30,7 @@ static int enh_desc_get_tx_status(void *data, struct stmmac_extra_stats *x, |
1597 |
+ struct dma_desc *p, void __iomem *ioaddr) |
1598 |
+ { |
1599 |
+ struct net_device_stats *stats = (struct net_device_stats *)data; |
1600 |
+- unsigned int tdes0 = p->des0; |
1601 |
++ unsigned int tdes0 = le32_to_cpu(p->des0); |
1602 |
+ int ret = tx_done; |
1603 |
+ |
1604 |
+ /* Get tx owner first */ |
1605 |
+@@ -95,7 +95,7 @@ static int enh_desc_get_tx_status(void *data, struct stmmac_extra_stats *x, |
1606 |
+ |
1607 |
+ static int enh_desc_get_tx_len(struct dma_desc *p) |
1608 |
+ { |
1609 |
+- return (p->des1 & ETDES1_BUFFER1_SIZE_MASK); |
1610 |
++ return (le32_to_cpu(p->des1) & ETDES1_BUFFER1_SIZE_MASK); |
1611 |
+ } |
1612 |
+ |
1613 |
+ static int enh_desc_coe_rdes0(int ipc_err, int type, int payload_err) |
1614 |
+@@ -134,8 +134,8 @@ static int enh_desc_coe_rdes0(int ipc_err, int type, int payload_err) |
1615 |
+ static void enh_desc_get_ext_status(void *data, struct stmmac_extra_stats *x, |
1616 |
+ struct dma_extended_desc *p) |
1617 |
+ { |
1618 |
+- unsigned int rdes0 = p->basic.des0; |
1619 |
+- unsigned int rdes4 = p->des4; |
1620 |
++ unsigned int rdes0 = le32_to_cpu(p->basic.des0); |
1621 |
++ unsigned int rdes4 = le32_to_cpu(p->des4); |
1622 |
+ |
1623 |
+ if (unlikely(rdes0 & ERDES0_RX_MAC_ADDR)) { |
1624 |
+ int message_type = (rdes4 & ERDES4_MSG_TYPE_MASK) >> 8; |
1625 |
+@@ -199,7 +199,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x, |
1626 |
+ struct dma_desc *p) |
1627 |
+ { |
1628 |
+ struct net_device_stats *stats = (struct net_device_stats *)data; |
1629 |
+- unsigned int rdes0 = p->des0; |
1630 |
++ unsigned int rdes0 = le32_to_cpu(p->des0); |
1631 |
+ int ret = good_frame; |
1632 |
+ |
1633 |
+ if (unlikely(rdes0 & RDES0_OWN)) |
1634 |
+@@ -265,8 +265,8 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x, |
1635 |
+ static void enh_desc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, |
1636 |
+ int mode, int end) |
1637 |
+ { |
1638 |
+- p->des0 |= RDES0_OWN; |
1639 |
+- p->des1 |= ((BUF_SIZE_8KiB - 1) & ERDES1_BUFFER1_SIZE_MASK); |
1640 |
++ p->des0 |= cpu_to_le32(RDES0_OWN); |
1641 |
++ p->des1 |= cpu_to_le32((BUF_SIZE_8KiB - 1) & ERDES1_BUFFER1_SIZE_MASK); |
1642 |
+ |
1643 |
+ if (mode == STMMAC_CHAIN_MODE) |
1644 |
+ ehn_desc_rx_set_on_chain(p); |
1645 |
+@@ -274,12 +274,12 @@ static void enh_desc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, |
1646 |
+ ehn_desc_rx_set_on_ring(p, end); |
1647 |
+ |
1648 |
+ if (disable_rx_ic) |
1649 |
+- p->des1 |= ERDES1_DISABLE_IC; |
1650 |
++ p->des1 |= cpu_to_le32(ERDES1_DISABLE_IC); |
1651 |
+ } |
1652 |
+ |
1653 |
+ static void enh_desc_init_tx_desc(struct dma_desc *p, int mode, int end) |
1654 |
+ { |
1655 |
+- p->des0 &= ~ETDES0_OWN; |
1656 |
++ p->des0 &= cpu_to_le32(~ETDES0_OWN); |
1657 |
+ if (mode == STMMAC_CHAIN_MODE) |
1658 |
+ enh_desc_end_tx_desc_on_chain(p); |
1659 |
+ else |
1660 |
+@@ -288,27 +288,27 @@ static void enh_desc_init_tx_desc(struct dma_desc *p, int mode, int end) |
1661 |
+ |
1662 |
+ static int enh_desc_get_tx_owner(struct dma_desc *p) |
1663 |
+ { |
1664 |
+- return (p->des0 & ETDES0_OWN) >> 31; |
1665 |
++ return (le32_to_cpu(p->des0) & ETDES0_OWN) >> 31; |
1666 |
+ } |
1667 |
+ |
1668 |
+ static void enh_desc_set_tx_owner(struct dma_desc *p) |
1669 |
+ { |
1670 |
+- p->des0 |= ETDES0_OWN; |
1671 |
++ p->des0 |= cpu_to_le32(ETDES0_OWN); |
1672 |
+ } |
1673 |
+ |
1674 |
+ static void enh_desc_set_rx_owner(struct dma_desc *p) |
1675 |
+ { |
1676 |
+- p->des0 |= RDES0_OWN; |
1677 |
++ p->des0 |= cpu_to_le32(RDES0_OWN); |
1678 |
+ } |
1679 |
+ |
1680 |
+ static int enh_desc_get_tx_ls(struct dma_desc *p) |
1681 |
+ { |
1682 |
+- return (p->des0 & ETDES0_LAST_SEGMENT) >> 29; |
1683 |
++ return (le32_to_cpu(p->des0) & ETDES0_LAST_SEGMENT) >> 29; |
1684 |
+ } |
1685 |
+ |
1686 |
+ static void enh_desc_release_tx_desc(struct dma_desc *p, int mode) |
1687 |
+ { |
1688 |
+- int ter = (p->des0 & ETDES0_END_RING) >> 21; |
1689 |
++ int ter = (le32_to_cpu(p->des0) & ETDES0_END_RING) >> 21; |
1690 |
+ |
1691 |
+ memset(p, 0, offsetof(struct dma_desc, des2)); |
1692 |
+ if (mode == STMMAC_CHAIN_MODE) |
1693 |
+@@ -321,7 +321,7 @@ static void enh_desc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, |
1694 |
+ bool csum_flag, int mode, bool tx_own, |
1695 |
+ bool ls) |
1696 |
+ { |
1697 |
+- unsigned int tdes0 = p->des0; |
1698 |
++ unsigned int tdes0 = le32_to_cpu(p->des0); |
1699 |
+ |
1700 |
+ if (mode == STMMAC_CHAIN_MODE) |
1701 |
+ enh_set_tx_desc_len_on_chain(p, len); |
1702 |
+@@ -352,12 +352,12 @@ static void enh_desc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, |
1703 |
+ */ |
1704 |
+ wmb(); |
1705 |
+ |
1706 |
+- p->des0 = tdes0; |
1707 |
++ p->des0 = cpu_to_le32(tdes0); |
1708 |
+ } |
1709 |
+ |
1710 |
+ static void enh_desc_set_tx_ic(struct dma_desc *p) |
1711 |
+ { |
1712 |
+- p->des0 |= ETDES0_INTERRUPT; |
1713 |
++ p->des0 |= cpu_to_le32(ETDES0_INTERRUPT); |
1714 |
+ } |
1715 |
+ |
1716 |
+ static int enh_desc_get_rx_frame_len(struct dma_desc *p, int rx_coe_type) |
1717 |
+@@ -372,18 +372,18 @@ static int enh_desc_get_rx_frame_len(struct dma_desc *p, int rx_coe_type) |
1718 |
+ if (rx_coe_type == STMMAC_RX_COE_TYPE1) |
1719 |
+ csum = 2; |
1720 |
+ |
1721 |
+- return (((p->des0 & RDES0_FRAME_LEN_MASK) >> RDES0_FRAME_LEN_SHIFT) - |
1722 |
+- csum); |
1723 |
++ return (((le32_to_cpu(p->des0) & RDES0_FRAME_LEN_MASK) |
1724 |
++ >> RDES0_FRAME_LEN_SHIFT) - csum); |
1725 |
+ } |
1726 |
+ |
1727 |
+ static void enh_desc_enable_tx_timestamp(struct dma_desc *p) |
1728 |
+ { |
1729 |
+- p->des0 |= ETDES0_TIME_STAMP_ENABLE; |
1730 |
++ p->des0 |= cpu_to_le32(ETDES0_TIME_STAMP_ENABLE); |
1731 |
+ } |
1732 |
+ |
1733 |
+ static int enh_desc_get_tx_timestamp_status(struct dma_desc *p) |
1734 |
+ { |
1735 |
+- return (p->des0 & ETDES0_TIME_STAMP_STATUS) >> 17; |
1736 |
++ return (le32_to_cpu(p->des0) & ETDES0_TIME_STAMP_STATUS) >> 17; |
1737 |
+ } |
1738 |
+ |
1739 |
+ static u64 enh_desc_get_timestamp(void *desc, u32 ats) |
1740 |
+@@ -392,13 +392,13 @@ static u64 enh_desc_get_timestamp(void *desc, u32 ats) |
1741 |
+ |
1742 |
+ if (ats) { |
1743 |
+ struct dma_extended_desc *p = (struct dma_extended_desc *)desc; |
1744 |
+- ns = p->des6; |
1745 |
++ ns = le32_to_cpu(p->des6); |
1746 |
+ /* convert high/sec time stamp value to nanosecond */ |
1747 |
+- ns += p->des7 * 1000000000ULL; |
1748 |
++ ns += le32_to_cpu(p->des7) * 1000000000ULL; |
1749 |
+ } else { |
1750 |
+ struct dma_desc *p = (struct dma_desc *)desc; |
1751 |
+- ns = p->des2; |
1752 |
+- ns += p->des3 * 1000000000ULL; |
1753 |
++ ns = le32_to_cpu(p->des2); |
1754 |
++ ns += le32_to_cpu(p->des3) * 1000000000ULL; |
1755 |
+ } |
1756 |
+ |
1757 |
+ return ns; |
1758 |
+@@ -408,10 +408,11 @@ static int enh_desc_get_rx_timestamp_status(void *desc, u32 ats) |
1759 |
+ { |
1760 |
+ if (ats) { |
1761 |
+ struct dma_extended_desc *p = (struct dma_extended_desc *)desc; |
1762 |
+- return (p->basic.des0 & RDES0_IPC_CSUM_ERROR) >> 7; |
1763 |
++ return (le32_to_cpu(p->basic.des0) & RDES0_IPC_CSUM_ERROR) >> 7; |
1764 |
+ } else { |
1765 |
+ struct dma_desc *p = (struct dma_desc *)desc; |
1766 |
+- if ((p->des2 == 0xffffffff) && (p->des3 == 0xffffffff)) |
1767 |
++ if ((le32_to_cpu(p->des2) == 0xffffffff) && |
1768 |
++ (le32_to_cpu(p->des3) == 0xffffffff)) |
1769 |
+ /* timestamp is corrupted, hence don't store it */ |
1770 |
+ return 0; |
1771 |
+ else |
1772 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c |
1773 |
+index 2beacd0d3043a..fd78406e2e9af 100644 |
1774 |
+--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c |
1775 |
++++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c |
1776 |
+@@ -30,8 +30,8 @@ static int ndesc_get_tx_status(void *data, struct stmmac_extra_stats *x, |
1777 |
+ struct dma_desc *p, void __iomem *ioaddr) |
1778 |
+ { |
1779 |
+ struct net_device_stats *stats = (struct net_device_stats *)data; |
1780 |
+- unsigned int tdes0 = p->des0; |
1781 |
+- unsigned int tdes1 = p->des1; |
1782 |
++ unsigned int tdes0 = le32_to_cpu(p->des0); |
1783 |
++ unsigned int tdes1 = le32_to_cpu(p->des1); |
1784 |
+ int ret = tx_done; |
1785 |
+ |
1786 |
+ /* Get tx owner first */ |
1787 |
+@@ -77,7 +77,7 @@ static int ndesc_get_tx_status(void *data, struct stmmac_extra_stats *x, |
1788 |
+ |
1789 |
+ static int ndesc_get_tx_len(struct dma_desc *p) |
1790 |
+ { |
1791 |
+- return (p->des1 & RDES1_BUFFER1_SIZE_MASK); |
1792 |
++ return (le32_to_cpu(p->des1) & RDES1_BUFFER1_SIZE_MASK); |
1793 |
+ } |
1794 |
+ |
1795 |
+ /* This function verifies if each incoming frame has some errors |
1796 |
+@@ -88,7 +88,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x, |
1797 |
+ struct dma_desc *p) |
1798 |
+ { |
1799 |
+ int ret = good_frame; |
1800 |
+- unsigned int rdes0 = p->des0; |
1801 |
++ unsigned int rdes0 = le32_to_cpu(p->des0); |
1802 |
+ struct net_device_stats *stats = (struct net_device_stats *)data; |
1803 |
+ |
1804 |
+ if (unlikely(rdes0 & RDES0_OWN)) |
1805 |
+@@ -141,8 +141,8 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x, |
1806 |
+ static void ndesc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, int mode, |
1807 |
+ int end) |
1808 |
+ { |
1809 |
+- p->des0 |= RDES0_OWN; |
1810 |
+- p->des1 |= (BUF_SIZE_2KiB - 1) & RDES1_BUFFER1_SIZE_MASK; |
1811 |
++ p->des0 |= cpu_to_le32(RDES0_OWN); |
1812 |
++ p->des1 |= cpu_to_le32((BUF_SIZE_2KiB - 1) & RDES1_BUFFER1_SIZE_MASK); |
1813 |
+ |
1814 |
+ if (mode == STMMAC_CHAIN_MODE) |
1815 |
+ ndesc_rx_set_on_chain(p, end); |
1816 |
+@@ -150,12 +150,12 @@ static void ndesc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, int mode, |
1817 |
+ ndesc_rx_set_on_ring(p, end); |
1818 |
+ |
1819 |
+ if (disable_rx_ic) |
1820 |
+- p->des1 |= RDES1_DISABLE_IC; |
1821 |
++ p->des1 |= cpu_to_le32(RDES1_DISABLE_IC); |
1822 |
+ } |
1823 |
+ |
1824 |
+ static void ndesc_init_tx_desc(struct dma_desc *p, int mode, int end) |
1825 |
+ { |
1826 |
+- p->des0 &= ~TDES0_OWN; |
1827 |
++ p->des0 &= cpu_to_le32(~TDES0_OWN); |
1828 |
+ if (mode == STMMAC_CHAIN_MODE) |
1829 |
+ ndesc_tx_set_on_chain(p); |
1830 |
+ else |
1831 |
+@@ -164,27 +164,27 @@ static void ndesc_init_tx_desc(struct dma_desc *p, int mode, int end) |
1832 |
+ |
1833 |
+ static int ndesc_get_tx_owner(struct dma_desc *p) |
1834 |
+ { |
1835 |
+- return (p->des0 & TDES0_OWN) >> 31; |
1836 |
++ return (le32_to_cpu(p->des0) & TDES0_OWN) >> 31; |
1837 |
+ } |
1838 |
+ |
1839 |
+ static void ndesc_set_tx_owner(struct dma_desc *p) |
1840 |
+ { |
1841 |
+- p->des0 |= TDES0_OWN; |
1842 |
++ p->des0 |= cpu_to_le32(TDES0_OWN); |
1843 |
+ } |
1844 |
+ |
1845 |
+ static void ndesc_set_rx_owner(struct dma_desc *p) |
1846 |
+ { |
1847 |
+- p->des0 |= RDES0_OWN; |
1848 |
++ p->des0 |= cpu_to_le32(RDES0_OWN); |
1849 |
+ } |
1850 |
+ |
1851 |
+ static int ndesc_get_tx_ls(struct dma_desc *p) |
1852 |
+ { |
1853 |
+- return (p->des1 & TDES1_LAST_SEGMENT) >> 30; |
1854 |
++ return (le32_to_cpu(p->des1) & TDES1_LAST_SEGMENT) >> 30; |
1855 |
+ } |
1856 |
+ |
1857 |
+ static void ndesc_release_tx_desc(struct dma_desc *p, int mode) |
1858 |
+ { |
1859 |
+- int ter = (p->des1 & TDES1_END_RING) >> 25; |
1860 |
++ int ter = (le32_to_cpu(p->des1) & TDES1_END_RING) >> 25; |
1861 |
+ |
1862 |
+ memset(p, 0, offsetof(struct dma_desc, des2)); |
1863 |
+ if (mode == STMMAC_CHAIN_MODE) |
1864 |
+@@ -197,7 +197,7 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, |
1865 |
+ bool csum_flag, int mode, bool tx_own, |
1866 |
+ bool ls) |
1867 |
+ { |
1868 |
+- unsigned int tdes1 = p->des1; |
1869 |
++ unsigned int tdes1 = le32_to_cpu(p->des1); |
1870 |
+ |
1871 |
+ if (is_fs) |
1872 |
+ tdes1 |= TDES1_FIRST_SEGMENT; |
1873 |
+@@ -212,7 +212,7 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, |
1874 |
+ if (ls) |
1875 |
+ tdes1 |= TDES1_LAST_SEGMENT; |
1876 |
+ |
1877 |
+- p->des1 = tdes1; |
1878 |
++ p->des1 = cpu_to_le32(tdes1); |
1879 |
+ |
1880 |
+ if (mode == STMMAC_CHAIN_MODE) |
1881 |
+ norm_set_tx_desc_len_on_chain(p, len); |
1882 |
+@@ -220,12 +220,12 @@ static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, |
1883 |
+ norm_set_tx_desc_len_on_ring(p, len); |
1884 |
+ |
1885 |
+ if (tx_own) |
1886 |
+- p->des0 |= TDES0_OWN; |
1887 |
++ p->des0 |= cpu_to_le32(TDES0_OWN); |
1888 |
+ } |
1889 |
+ |
1890 |
+ static void ndesc_set_tx_ic(struct dma_desc *p) |
1891 |
+ { |
1892 |
+- p->des1 |= TDES1_INTERRUPT; |
1893 |
++ p->des1 |= cpu_to_le32(TDES1_INTERRUPT); |
1894 |
+ } |
1895 |
+ |
1896 |
+ static int ndesc_get_rx_frame_len(struct dma_desc *p, int rx_coe_type) |
1897 |
+@@ -241,19 +241,20 @@ static int ndesc_get_rx_frame_len(struct dma_desc *p, int rx_coe_type) |
1898 |
+ if (rx_coe_type == STMMAC_RX_COE_TYPE1) |
1899 |
+ csum = 2; |
1900 |
+ |
1901 |
+- return (((p->des0 & RDES0_FRAME_LEN_MASK) >> RDES0_FRAME_LEN_SHIFT) - |
1902 |
++ return (((le32_to_cpu(p->des0) & RDES0_FRAME_LEN_MASK) |
1903 |
++ >> RDES0_FRAME_LEN_SHIFT) - |
1904 |
+ csum); |
1905 |
+ |
1906 |
+ } |
1907 |
+ |
1908 |
+ static void ndesc_enable_tx_timestamp(struct dma_desc *p) |
1909 |
+ { |
1910 |
+- p->des1 |= TDES1_TIME_STAMP_ENABLE; |
1911 |
++ p->des1 |= cpu_to_le32(TDES1_TIME_STAMP_ENABLE); |
1912 |
+ } |
1913 |
+ |
1914 |
+ static int ndesc_get_tx_timestamp_status(struct dma_desc *p) |
1915 |
+ { |
1916 |
+- return (p->des0 & TDES0_TIME_STAMP_STATUS) >> 17; |
1917 |
++ return (le32_to_cpu(p->des0) & TDES0_TIME_STAMP_STATUS) >> 17; |
1918 |
+ } |
1919 |
+ |
1920 |
+ static u64 ndesc_get_timestamp(void *desc, u32 ats) |
1921 |
+@@ -261,9 +262,9 @@ static u64 ndesc_get_timestamp(void *desc, u32 ats) |
1922 |
+ struct dma_desc *p = (struct dma_desc *)desc; |
1923 |
+ u64 ns; |
1924 |
+ |
1925 |
+- ns = p->des2; |
1926 |
++ ns = le32_to_cpu(p->des2); |
1927 |
+ /* convert high/sec time stamp value to nanosecond */ |
1928 |
+- ns += p->des3 * 1000000000ULL; |
1929 |
++ ns += le32_to_cpu(p->des3) * 1000000000ULL; |
1930 |
+ |
1931 |
+ return ns; |
1932 |
+ } |
1933 |
+@@ -272,7 +273,8 @@ static int ndesc_get_rx_timestamp_status(void *desc, u32 ats) |
1934 |
+ { |
1935 |
+ struct dma_desc *p = (struct dma_desc *)desc; |
1936 |
+ |
1937 |
+- if ((p->des2 == 0xffffffff) && (p->des3 == 0xffffffff)) |
1938 |
++ if ((le32_to_cpu(p->des2) == 0xffffffff) && |
1939 |
++ (le32_to_cpu(p->des3) == 0xffffffff)) |
1940 |
+ /* timestamp is corrupted, hence don't store it */ |
1941 |
+ return 0; |
1942 |
+ else |
1943 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c |
1944 |
+index 7723b5d2499a1..9983ce9bd90de 100644 |
1945 |
+--- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c |
1946 |
++++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c |
1947 |
+@@ -34,7 +34,7 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) |
1948 |
+ unsigned int entry = priv->cur_tx; |
1949 |
+ struct dma_desc *desc; |
1950 |
+ unsigned int nopaged_len = skb_headlen(skb); |
1951 |
+- unsigned int bmax, len; |
1952 |
++ unsigned int bmax, len, des2; |
1953 |
+ |
1954 |
+ if (priv->extend_desc) |
1955 |
+ desc = (struct dma_desc *)(priv->dma_etx + entry); |
1956 |
+@@ -50,16 +50,17 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) |
1957 |
+ |
1958 |
+ if (nopaged_len > BUF_SIZE_8KiB) { |
1959 |
+ |
1960 |
+- desc->des2 = dma_map_single(priv->device, skb->data, |
1961 |
+- bmax, DMA_TO_DEVICE); |
1962 |
+- if (dma_mapping_error(priv->device, desc->des2)) |
1963 |
++ des2 = dma_map_single(priv->device, skb->data, bmax, |
1964 |
++ DMA_TO_DEVICE); |
1965 |
++ desc->des2 = cpu_to_le32(des2); |
1966 |
++ if (dma_mapping_error(priv->device, des2)) |
1967 |
+ return -1; |
1968 |
+ |
1969 |
+- priv->tx_skbuff_dma[entry].buf = desc->des2; |
1970 |
++ priv->tx_skbuff_dma[entry].buf = des2; |
1971 |
+ priv->tx_skbuff_dma[entry].len = bmax; |
1972 |
+ priv->tx_skbuff_dma[entry].is_jumbo = true; |
1973 |
+ |
1974 |
+- desc->des3 = desc->des2 + BUF_SIZE_4KiB; |
1975 |
++ desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); |
1976 |
+ priv->hw->desc->prepare_tx_desc(desc, 1, bmax, csum, |
1977 |
+ STMMAC_RING_MODE, 0, false); |
1978 |
+ priv->tx_skbuff[entry] = NULL; |
1979 |
+@@ -70,26 +71,28 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) |
1980 |
+ else |
1981 |
+ desc = priv->dma_tx + entry; |
1982 |
+ |
1983 |
+- desc->des2 = dma_map_single(priv->device, skb->data + bmax, |
1984 |
+- len, DMA_TO_DEVICE); |
1985 |
+- if (dma_mapping_error(priv->device, desc->des2)) |
1986 |
++ des2 = dma_map_single(priv->device, skb->data + bmax, len, |
1987 |
++ DMA_TO_DEVICE); |
1988 |
++ desc->des2 = cpu_to_le32(des2); |
1989 |
++ if (dma_mapping_error(priv->device, des2)) |
1990 |
+ return -1; |
1991 |
+- priv->tx_skbuff_dma[entry].buf = desc->des2; |
1992 |
++ priv->tx_skbuff_dma[entry].buf = des2; |
1993 |
+ priv->tx_skbuff_dma[entry].len = len; |
1994 |
+ priv->tx_skbuff_dma[entry].is_jumbo = true; |
1995 |
+ |
1996 |
+- desc->des3 = desc->des2 + BUF_SIZE_4KiB; |
1997 |
++ desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); |
1998 |
+ priv->hw->desc->prepare_tx_desc(desc, 0, len, csum, |
1999 |
+ STMMAC_RING_MODE, 1, true); |
2000 |
+ } else { |
2001 |
+- desc->des2 = dma_map_single(priv->device, skb->data, |
2002 |
+- nopaged_len, DMA_TO_DEVICE); |
2003 |
+- if (dma_mapping_error(priv->device, desc->des2)) |
2004 |
++ des2 = dma_map_single(priv->device, skb->data, |
2005 |
++ nopaged_len, DMA_TO_DEVICE); |
2006 |
++ desc->des2 = cpu_to_le32(des2); |
2007 |
++ if (dma_mapping_error(priv->device, des2)) |
2008 |
+ return -1; |
2009 |
+- priv->tx_skbuff_dma[entry].buf = desc->des2; |
2010 |
++ priv->tx_skbuff_dma[entry].buf = des2; |
2011 |
+ priv->tx_skbuff_dma[entry].len = nopaged_len; |
2012 |
+ priv->tx_skbuff_dma[entry].is_jumbo = true; |
2013 |
+- desc->des3 = desc->des2 + BUF_SIZE_4KiB; |
2014 |
++ desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); |
2015 |
+ priv->hw->desc->prepare_tx_desc(desc, 1, nopaged_len, csum, |
2016 |
+ STMMAC_RING_MODE, 0, true); |
2017 |
+ } |
2018 |
+@@ -115,13 +118,13 @@ static void stmmac_refill_desc3(void *priv_ptr, struct dma_desc *p) |
2019 |
+ |
2020 |
+ /* Fill DES3 in case of RING mode */ |
2021 |
+ if (priv->dma_buf_sz >= BUF_SIZE_8KiB) |
2022 |
+- p->des3 = p->des2 + BUF_SIZE_8KiB; |
2023 |
++ p->des3 = cpu_to_le32(le32_to_cpu(p->des2) + BUF_SIZE_8KiB); |
2024 |
+ } |
2025 |
+ |
2026 |
+ /* In ring mode we need to fill the desc3 because it is used as buffer */ |
2027 |
+ static void stmmac_init_desc3(struct dma_desc *p) |
2028 |
+ { |
2029 |
+- p->des3 = p->des2 + BUF_SIZE_8KiB; |
2030 |
++ p->des3 = cpu_to_le32(le32_to_cpu(p->des2) + BUF_SIZE_8KiB); |
2031 |
+ } |
2032 |
+ |
2033 |
+ static void stmmac_clean_desc3(void *priv_ptr, struct dma_desc *p) |
2034 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
2035 |
+index 65ed02bc3ea34..20a2b01b392c1 100644 |
2036 |
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
2037 |
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
2038 |
+@@ -1002,9 +1002,9 @@ static int stmmac_init_rx_buffers(struct stmmac_priv *priv, struct dma_desc *p, |
2039 |
+ } |
2040 |
+ |
2041 |
+ if (priv->synopsys_id >= DWMAC_CORE_4_00) |
2042 |
+- p->des0 = priv->rx_skbuff_dma[i]; |
2043 |
++ p->des0 = cpu_to_le32(priv->rx_skbuff_dma[i]); |
2044 |
+ else |
2045 |
+- p->des2 = priv->rx_skbuff_dma[i]; |
2046 |
++ p->des2 = cpu_to_le32(priv->rx_skbuff_dma[i]); |
2047 |
+ |
2048 |
+ if ((priv->hw->mode->init_desc3) && |
2049 |
+ (priv->dma_buf_sz == BUF_SIZE_16KiB)) |
2050 |
+@@ -1968,7 +1968,7 @@ static void stmmac_tso_allocator(struct stmmac_priv *priv, unsigned int des, |
2051 |
+ priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); |
2052 |
+ desc = priv->dma_tx + priv->cur_tx; |
2053 |
+ |
2054 |
+- desc->des0 = des + (total_len - tmp_len); |
2055 |
++ desc->des0 = cpu_to_le32(des + (total_len - tmp_len)); |
2056 |
+ buff_size = tmp_len >= TSO_MAX_BUFF_SIZE ? |
2057 |
+ TSO_MAX_BUFF_SIZE : tmp_len; |
2058 |
+ |
2059 |
+@@ -2070,11 +2070,11 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) |
2060 |
+ priv->tx_skbuff_dma[first_entry].len = skb_headlen(skb); |
2061 |
+ priv->tx_skbuff[first_entry] = skb; |
2062 |
+ |
2063 |
+- first->des0 = des; |
2064 |
++ first->des0 = cpu_to_le32(des); |
2065 |
+ |
2066 |
+ /* Fill start of payload in buff2 of first descriptor */ |
2067 |
+ if (pay_len) |
2068 |
+- first->des1 = des + proto_hdr_len; |
2069 |
++ first->des1 = cpu_to_le32(des + proto_hdr_len); |
2070 |
+ |
2071 |
+ /* If needed take extra descriptors to fill the remaining payload */ |
2072 |
+ tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE; |
2073 |
+@@ -2271,13 +2271,11 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) |
2074 |
+ |
2075 |
+ priv->tx_skbuff[entry] = NULL; |
2076 |
+ |
2077 |
+- if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) { |
2078 |
+- desc->des0 = des; |
2079 |
+- priv->tx_skbuff_dma[entry].buf = desc->des0; |
2080 |
+- } else { |
2081 |
+- desc->des2 = des; |
2082 |
+- priv->tx_skbuff_dma[entry].buf = desc->des2; |
2083 |
+- } |
2084 |
++ priv->tx_skbuff_dma[entry].buf = des; |
2085 |
++ if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) |
2086 |
++ desc->des0 = cpu_to_le32(des); |
2087 |
++ else |
2088 |
++ desc->des2 = cpu_to_le32(des); |
2089 |
+ |
2090 |
+ priv->tx_skbuff_dma[entry].map_as_page = true; |
2091 |
+ priv->tx_skbuff_dma[entry].len = len; |
2092 |
+@@ -2348,13 +2346,11 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) |
2093 |
+ if (dma_mapping_error(priv->device, des)) |
2094 |
+ goto dma_map_err; |
2095 |
+ |
2096 |
+- if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) { |
2097 |
+- first->des0 = des; |
2098 |
+- priv->tx_skbuff_dma[first_entry].buf = first->des0; |
2099 |
+- } else { |
2100 |
+- first->des2 = des; |
2101 |
+- priv->tx_skbuff_dma[first_entry].buf = first->des2; |
2102 |
+- } |
2103 |
++ priv->tx_skbuff_dma[first_entry].buf = des; |
2104 |
++ if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) |
2105 |
++ first->des0 = cpu_to_le32(des); |
2106 |
++ else |
2107 |
++ first->des2 = cpu_to_le32(des); |
2108 |
+ |
2109 |
+ priv->tx_skbuff_dma[first_entry].len = nopaged_len; |
2110 |
+ priv->tx_skbuff_dma[first_entry].last_segment = last_segment; |
2111 |
+@@ -2468,10 +2464,10 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv) |
2112 |
+ } |
2113 |
+ |
2114 |
+ if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) { |
2115 |
+- p->des0 = priv->rx_skbuff_dma[entry]; |
2116 |
++ p->des0 = cpu_to_le32(priv->rx_skbuff_dma[entry]); |
2117 |
+ p->des1 = 0; |
2118 |
+ } else { |
2119 |
+- p->des2 = priv->rx_skbuff_dma[entry]; |
2120 |
++ p->des2 = cpu_to_le32(priv->rx_skbuff_dma[entry]); |
2121 |
+ } |
2122 |
+ if (priv->hw->mode->refill_desc3) |
2123 |
+ priv->hw->mode->refill_desc3(priv, p); |
2124 |
+@@ -2575,9 +2571,9 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit) |
2125 |
+ unsigned int des; |
2126 |
+ |
2127 |
+ if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) |
2128 |
+- des = p->des0; |
2129 |
++ des = le32_to_cpu(p->des0); |
2130 |
+ else |
2131 |
+- des = p->des2; |
2132 |
++ des = le32_to_cpu(p->des2); |
2133 |
+ |
2134 |
+ frame_len = priv->hw->desc->get_rx_frame_len(p, coe); |
2135 |
+ |
2136 |
+@@ -2951,14 +2947,17 @@ static void sysfs_display_ring(void *head, int size, int extend_desc, |
2137 |
+ x = *(u64 *) ep; |
2138 |
+ seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", |
2139 |
+ i, (unsigned int)virt_to_phys(ep), |
2140 |
+- ep->basic.des0, ep->basic.des1, |
2141 |
+- ep->basic.des2, ep->basic.des3); |
2142 |
++ le32_to_cpu(ep->basic.des0), |
2143 |
++ le32_to_cpu(ep->basic.des1), |
2144 |
++ le32_to_cpu(ep->basic.des2), |
2145 |
++ le32_to_cpu(ep->basic.des3)); |
2146 |
+ ep++; |
2147 |
+ } else { |
2148 |
+ x = *(u64 *) p; |
2149 |
+ seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", |
2150 |
+ i, (unsigned int)virt_to_phys(ep), |
2151 |
+- p->des0, p->des1, p->des2, p->des3); |
2152 |
++ le32_to_cpu(p->des0), le32_to_cpu(p->des1), |
2153 |
++ le32_to_cpu(p->des2), le32_to_cpu(p->des3)); |
2154 |
+ p++; |
2155 |
+ } |
2156 |
+ seq_printf(seq, "\n"); |
2157 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c |
2158 |
+index eafc28142cd21..49eaede34eea6 100644 |
2159 |
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c |
2160 |
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c |
2161 |
+@@ -231,7 +231,17 @@ static int stmmac_pci_probe(struct pci_dev *pdev, |
2162 |
+ */ |
2163 |
+ static void stmmac_pci_remove(struct pci_dev *pdev) |
2164 |
+ { |
2165 |
++ int i; |
2166 |
++ |
2167 |
+ stmmac_dvr_remove(&pdev->dev); |
2168 |
++ |
2169 |
++ for (i = 0; i <= PCI_STD_RESOURCE_END; i++) { |
2170 |
++ if (pci_resource_len(pdev, i) == 0) |
2171 |
++ continue; |
2172 |
++ pcim_iounmap_regions(pdev, BIT(i)); |
2173 |
++ break; |
2174 |
++ } |
2175 |
++ |
2176 |
+ pci_disable_device(pdev); |
2177 |
+ } |
2178 |
+ |
2179 |
+diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c |
2180 |
+index 94b05dd827af6..375b6810bf461 100644 |
2181 |
+--- a/drivers/net/team/team.c |
2182 |
++++ b/drivers/net/team/team.c |
2183 |
+@@ -261,17 +261,6 @@ static void __team_option_inst_mark_removed_port(struct team *team, |
2184 |
+ } |
2185 |
+ } |
2186 |
+ |
2187 |
+-static bool __team_option_inst_tmp_find(const struct list_head *opts, |
2188 |
+- const struct team_option_inst *needle) |
2189 |
+-{ |
2190 |
+- struct team_option_inst *opt_inst; |
2191 |
+- |
2192 |
+- list_for_each_entry(opt_inst, opts, tmp_list) |
2193 |
+- if (opt_inst == needle) |
2194 |
+- return true; |
2195 |
+- return false; |
2196 |
+-} |
2197 |
+- |
2198 |
+ static int __team_options_register(struct team *team, |
2199 |
+ const struct team_option *option, |
2200 |
+ size_t option_count) |
2201 |
+@@ -2466,7 +2455,6 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) |
2202 |
+ int err = 0; |
2203 |
+ int i; |
2204 |
+ struct nlattr *nl_option; |
2205 |
+- LIST_HEAD(opt_inst_list); |
2206 |
+ |
2207 |
+ rtnl_lock(); |
2208 |
+ |
2209 |
+@@ -2486,6 +2474,7 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) |
2210 |
+ struct nlattr *opt_attrs[TEAM_ATTR_OPTION_MAX + 1]; |
2211 |
+ struct nlattr *attr; |
2212 |
+ struct nlattr *attr_data; |
2213 |
++ LIST_HEAD(opt_inst_list); |
2214 |
+ enum team_option_type opt_type; |
2215 |
+ int opt_port_ifindex = 0; /* != 0 for per-port options */ |
2216 |
+ u32 opt_array_index = 0; |
2217 |
+@@ -2589,23 +2578,17 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) |
2218 |
+ if (err) |
2219 |
+ goto team_put; |
2220 |
+ opt_inst->changed = true; |
2221 |
+- |
2222 |
+- /* dumb/evil user-space can send us duplicate opt, |
2223 |
+- * keep only the last one |
2224 |
+- */ |
2225 |
+- if (__team_option_inst_tmp_find(&opt_inst_list, |
2226 |
+- opt_inst)) |
2227 |
+- continue; |
2228 |
+- |
2229 |
+ list_add(&opt_inst->tmp_list, &opt_inst_list); |
2230 |
+ } |
2231 |
+ if (!opt_found) { |
2232 |
+ err = -ENOENT; |
2233 |
+ goto team_put; |
2234 |
+ } |
2235 |
+- } |
2236 |
+ |
2237 |
+- err = team_nl_send_event_options_get(team, &opt_inst_list); |
2238 |
++ err = team_nl_send_event_options_get(team, &opt_inst_list); |
2239 |
++ if (err) |
2240 |
++ break; |
2241 |
++ } |
2242 |
+ |
2243 |
+ team_put: |
2244 |
+ team_nl_team_put(team); |
2245 |
+diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c |
2246 |
+index 873424ab0e328..bd0e659002161 100644 |
2247 |
+--- a/drivers/phy/tegra/xusb.c |
2248 |
++++ b/drivers/phy/tegra/xusb.c |
2249 |
+@@ -418,7 +418,7 @@ tegra_xusb_port_find_lane(struct tegra_xusb_port *port, |
2250 |
+ { |
2251 |
+ struct tegra_xusb_lane *lane, *match = ERR_PTR(-ENODEV); |
2252 |
+ |
2253 |
+- for (map = map; map->type; map++) { |
2254 |
++ for (; map->type; map++) { |
2255 |
+ if (port->index != map->port) |
2256 |
+ continue; |
2257 |
+ |
2258 |
+diff --git a/drivers/pinctrl/pinctrl-max77620.c b/drivers/pinctrl/pinctrl-max77620.c |
2259 |
+index d9ff53e8f715a..a7c4e32d31c36 100644 |
2260 |
+--- a/drivers/pinctrl/pinctrl-max77620.c |
2261 |
++++ b/drivers/pinctrl/pinctrl-max77620.c |
2262 |
+@@ -34,14 +34,12 @@ enum max77620_pin_ppdrv { |
2263 |
+ MAX77620_PIN_PP_DRV, |
2264 |
+ }; |
2265 |
+ |
2266 |
+-enum max77620_pinconf_param { |
2267 |
+- MAX77620_ACTIVE_FPS_SOURCE = PIN_CONFIG_END + 1, |
2268 |
+- MAX77620_ACTIVE_FPS_POWER_ON_SLOTS, |
2269 |
+- MAX77620_ACTIVE_FPS_POWER_DOWN_SLOTS, |
2270 |
+- MAX77620_SUSPEND_FPS_SOURCE, |
2271 |
+- MAX77620_SUSPEND_FPS_POWER_ON_SLOTS, |
2272 |
+- MAX77620_SUSPEND_FPS_POWER_DOWN_SLOTS, |
2273 |
+-}; |
2274 |
++#define MAX77620_ACTIVE_FPS_SOURCE (PIN_CONFIG_END + 1) |
2275 |
++#define MAX77620_ACTIVE_FPS_POWER_ON_SLOTS (PIN_CONFIG_END + 2) |
2276 |
++#define MAX77620_ACTIVE_FPS_POWER_DOWN_SLOTS (PIN_CONFIG_END + 3) |
2277 |
++#define MAX77620_SUSPEND_FPS_SOURCE (PIN_CONFIG_END + 4) |
2278 |
++#define MAX77620_SUSPEND_FPS_POWER_ON_SLOTS (PIN_CONFIG_END + 5) |
2279 |
++#define MAX77620_SUSPEND_FPS_POWER_DOWN_SLOTS (PIN_CONFIG_END + 6) |
2280 |
+ |
2281 |
+ struct max77620_pin_function { |
2282 |
+ const char *name; |
2283 |
+diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c |
2284 |
+index 77128d680e3bc..6f38fa1f468a7 100644 |
2285 |
+--- a/drivers/scsi/isci/init.c |
2286 |
++++ b/drivers/scsi/isci/init.c |
2287 |
+@@ -595,6 +595,13 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id) |
2288 |
+ shost->max_lun = ~0; |
2289 |
+ shost->max_cmd_len = MAX_COMMAND_SIZE; |
2290 |
+ |
2291 |
++ /* turn on DIF support */ |
2292 |
++ scsi_host_set_prot(shost, |
2293 |
++ SHOST_DIF_TYPE1_PROTECTION | |
2294 |
++ SHOST_DIF_TYPE2_PROTECTION | |
2295 |
++ SHOST_DIF_TYPE3_PROTECTION); |
2296 |
++ scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC); |
2297 |
++ |
2298 |
+ err = scsi_add_host(shost, &pdev->dev); |
2299 |
+ if (err) |
2300 |
+ goto err_shost; |
2301 |
+@@ -682,13 +689,6 @@ static int isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
2302 |
+ goto err_host_alloc; |
2303 |
+ } |
2304 |
+ pci_info->hosts[i] = h; |
2305 |
+- |
2306 |
+- /* turn on DIF support */ |
2307 |
+- scsi_host_set_prot(to_shost(h), |
2308 |
+- SHOST_DIF_TYPE1_PROTECTION | |
2309 |
+- SHOST_DIF_TYPE2_PROTECTION | |
2310 |
+- SHOST_DIF_TYPE3_PROTECTION); |
2311 |
+- scsi_host_set_guard(to_shost(h), SHOST_DIX_GUARD_CRC); |
2312 |
+ } |
2313 |
+ |
2314 |
+ err = isci_setup_interrupts(pdev); |
2315 |
+diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c |
2316 |
+index d8c03431d0aa8..f9f899ec94270 100644 |
2317 |
+--- a/drivers/scsi/qla4xxx/ql4_os.c |
2318 |
++++ b/drivers/scsi/qla4xxx/ql4_os.c |
2319 |
+@@ -7245,6 +7245,8 @@ static int qla4xxx_sysfs_ddb_tgt_create(struct scsi_qla_host *ha, |
2320 |
+ |
2321 |
+ rc = qla4xxx_copy_from_fwddb_param(fnode_sess, fnode_conn, |
2322 |
+ fw_ddb_entry); |
2323 |
++ if (rc) |
2324 |
++ goto free_sess; |
2325 |
+ |
2326 |
+ ql4_printk(KERN_INFO, ha, "%s: sysfs entry %s created\n", |
2327 |
+ __func__, fnode_sess->dev.kobj.name); |
2328 |
+diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c |
2329 |
+index 9ff5219d849e9..411e9df0d40e9 100644 |
2330 |
+--- a/fs/ceph/snap.c |
2331 |
++++ b/fs/ceph/snap.c |
2332 |
+@@ -609,7 +609,8 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci, |
2333 |
+ capsnap->size); |
2334 |
+ |
2335 |
+ spin_lock(&mdsc->snap_flush_lock); |
2336 |
+- list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list); |
2337 |
++ if (list_empty(&ci->i_snap_flush_item)) |
2338 |
++ list_add_tail(&ci->i_snap_flush_item, &mdsc->snap_flush_list); |
2339 |
+ spin_unlock(&mdsc->snap_flush_lock); |
2340 |
+ return 1; /* caller may want to ceph_flush_snaps */ |
2341 |
+ } |
2342 |
+diff --git a/fs/proc/base.c b/fs/proc/base.c |
2343 |
+index 79702d405ba72..b9e41832315a6 100644 |
2344 |
+--- a/fs/proc/base.c |
2345 |
++++ b/fs/proc/base.c |
2346 |
+@@ -1134,10 +1134,6 @@ static int __set_oom_adj(struct file *file, int oom_adj, bool legacy) |
2347 |
+ |
2348 |
+ task_lock(p); |
2349 |
+ if (!p->vfork_done && process_shares_mm(p, mm)) { |
2350 |
+- pr_info("updating oom_score_adj for %d (%s) from %d to %d because it shares mm with %d (%s). Report if this is unexpected.\n", |
2351 |
+- task_pid_nr(p), p->comm, |
2352 |
+- p->signal->oom_score_adj, oom_adj, |
2353 |
+- task_pid_nr(task), task->comm); |
2354 |
+ p->signal->oom_score_adj = oom_adj; |
2355 |
+ if (!legacy && has_capability_noaudit(current, CAP_SYS_RESOURCE)) |
2356 |
+ p->signal->oom_score_adj_min = (short)oom_adj; |
2357 |
+diff --git a/include/keys/user-type.h b/include/keys/user-type.h |
2358 |
+index c56fef40f53ef..5d744ec8f644a 100644 |
2359 |
+--- a/include/keys/user-type.h |
2360 |
++++ b/include/keys/user-type.h |
2361 |
+@@ -31,7 +31,7 @@ |
2362 |
+ struct user_key_payload { |
2363 |
+ struct rcu_head rcu; /* RCU destructor */ |
2364 |
+ unsigned short datalen; /* length of this data */ |
2365 |
+- char data[0]; /* actual data */ |
2366 |
++ char data[0] __aligned(__alignof__(u64)); /* actual data */ |
2367 |
+ }; |
2368 |
+ |
2369 |
+ extern struct key_type key_type_user; |
2370 |
+diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h |
2371 |
+index 08398182f56ec..36dc52067377b 100644 |
2372 |
+--- a/include/linux/clocksource.h |
2373 |
++++ b/include/linux/clocksource.h |
2374 |
+@@ -117,7 +117,7 @@ struct clocksource { |
2375 |
+ #define CLOCK_SOURCE_RESELECT 0x100 |
2376 |
+ |
2377 |
+ /* simplify initialization of mask field */ |
2378 |
+-#define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) |
2379 |
++#define CLOCKSOURCE_MASK(bits) GENMASK_ULL((bits) - 1, 0) |
2380 |
+ |
2381 |
+ static inline u32 clocksource_freq2mult(u32 freq, u32 shift_constant, u64 from) |
2382 |
+ { |
2383 |
+diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h |
2384 |
+index 22db1e63707ec..05e8b6e4edcb6 100644 |
2385 |
+--- a/include/linux/sched/sysctl.h |
2386 |
++++ b/include/linux/sched/sysctl.h |
2387 |
+@@ -33,9 +33,9 @@ extern unsigned int sysctl_numa_balancing_scan_period_max; |
2388 |
+ extern unsigned int sysctl_numa_balancing_scan_size; |
2389 |
+ |
2390 |
+ #ifdef CONFIG_SCHED_DEBUG |
2391 |
+-extern unsigned int sysctl_sched_migration_cost; |
2392 |
+-extern unsigned int sysctl_sched_nr_migrate; |
2393 |
+-extern unsigned int sysctl_sched_time_avg; |
2394 |
++extern __read_mostly unsigned int sysctl_sched_migration_cost; |
2395 |
++extern __read_mostly unsigned int sysctl_sched_nr_migrate; |
2396 |
++extern __read_mostly unsigned int sysctl_sched_time_avg; |
2397 |
+ extern unsigned int sysctl_sched_shares_window; |
2398 |
+ |
2399 |
+ int sched_proc_update_handler(struct ctl_table *table, int write, |
2400 |
+diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c |
2401 |
+index a47339b156ce7..6786c507f1f98 100644 |
2402 |
+--- a/kernel/trace/trace.c |
2403 |
++++ b/kernel/trace/trace.c |
2404 |
+@@ -3022,13 +3022,14 @@ static void test_cpu_buff_start(struct trace_iterator *iter) |
2405 |
+ if (!(iter->iter_flags & TRACE_FILE_ANNOTATE)) |
2406 |
+ return; |
2407 |
+ |
2408 |
+- if (iter->started && cpumask_test_cpu(iter->cpu, iter->started)) |
2409 |
++ if (cpumask_available(iter->started) && |
2410 |
++ cpumask_test_cpu(iter->cpu, iter->started)) |
2411 |
+ return; |
2412 |
+ |
2413 |
+ if (per_cpu_ptr(iter->trace_buffer->data, iter->cpu)->skipped_entries) |
2414 |
+ return; |
2415 |
+ |
2416 |
+- if (iter->started) |
2417 |
++ if (cpumask_available(iter->started)) |
2418 |
+ cpumask_set_cpu(iter->cpu, iter->started); |
2419 |
+ |
2420 |
+ /* Don't print started cpu buffer for the first entry of the trace */ |
2421 |
+diff --git a/mm/mempolicy.c b/mm/mempolicy.c |
2422 |
+index e21d9b44247bc..593b74bed59b8 100644 |
2423 |
+--- a/mm/mempolicy.c |
2424 |
++++ b/mm/mempolicy.c |
2425 |
+@@ -1327,7 +1327,7 @@ static int copy_nodes_to_user(unsigned long __user *mask, unsigned long maxnode, |
2426 |
+ nodemask_t *nodes) |
2427 |
+ { |
2428 |
+ unsigned long copy = ALIGN(maxnode-1, 64) / 8; |
2429 |
+- const int nbytes = BITS_TO_LONGS(MAX_NUMNODES) * sizeof(long); |
2430 |
++ unsigned int nbytes = BITS_TO_LONGS(nr_node_ids) * sizeof(long); |
2431 |
+ |
2432 |
+ if (copy > nbytes) { |
2433 |
+ if (copy > PAGE_SIZE) |
2434 |
+@@ -1488,7 +1488,7 @@ SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, |
2435 |
+ int uninitialized_var(pval); |
2436 |
+ nodemask_t nodes; |
2437 |
+ |
2438 |
+- if (nmask != NULL && maxnode < MAX_NUMNODES) |
2439 |
++ if (nmask != NULL && maxnode < nr_node_ids) |
2440 |
+ return -EINVAL; |
2441 |
+ |
2442 |
+ err = do_get_mempolicy(&pval, &nodes, addr, flags); |
2443 |
+@@ -1517,7 +1517,7 @@ COMPAT_SYSCALL_DEFINE5(get_mempolicy, int __user *, policy, |
2444 |
+ unsigned long nr_bits, alloc_size; |
2445 |
+ DECLARE_BITMAP(bm, MAX_NUMNODES); |
2446 |
+ |
2447 |
+- nr_bits = min_t(unsigned long, maxnode-1, MAX_NUMNODES); |
2448 |
++ nr_bits = min_t(unsigned long, maxnode-1, nr_node_ids); |
2449 |
+ alloc_size = ALIGN(nr_bits, BITS_PER_LONG) / 8; |
2450 |
+ |
2451 |
+ if (nmask) |
2452 |
+diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c |
2453 |
+index d3548c48369f0..cf15851a7d2fb 100644 |
2454 |
+--- a/mm/zsmalloc.c |
2455 |
++++ b/mm/zsmalloc.c |
2456 |
+@@ -473,7 +473,7 @@ static bool is_zspage_isolated(struct zspage *zspage) |
2457 |
+ return zspage->isolated; |
2458 |
+ } |
2459 |
+ |
2460 |
+-static int is_first_page(struct page *page) |
2461 |
++static __maybe_unused int is_first_page(struct page *page) |
2462 |
+ { |
2463 |
+ return PagePrivate(page); |
2464 |
+ } |
2465 |
+@@ -558,20 +558,23 @@ static int get_size_class_index(int size) |
2466 |
+ return min(zs_size_classes - 1, idx); |
2467 |
+ } |
2468 |
+ |
2469 |
++/* type can be of enum type zs_stat_type or fullness_group */ |
2470 |
+ static inline void zs_stat_inc(struct size_class *class, |
2471 |
+- enum zs_stat_type type, unsigned long cnt) |
2472 |
++ int type, unsigned long cnt) |
2473 |
+ { |
2474 |
+ class->stats.objs[type] += cnt; |
2475 |
+ } |
2476 |
+ |
2477 |
++/* type can be of enum type zs_stat_type or fullness_group */ |
2478 |
+ static inline void zs_stat_dec(struct size_class *class, |
2479 |
+- enum zs_stat_type type, unsigned long cnt) |
2480 |
++ int type, unsigned long cnt) |
2481 |
+ { |
2482 |
+ class->stats.objs[type] -= cnt; |
2483 |
+ } |
2484 |
+ |
2485 |
++/* type can be of enum type zs_stat_type or fullness_group */ |
2486 |
+ static inline unsigned long zs_stat_get(struct size_class *class, |
2487 |
+- enum zs_stat_type type) |
2488 |
++ int type) |
2489 |
+ { |
2490 |
+ return class->stats.objs[type]; |
2491 |
+ } |
2492 |
+diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c |
2493 |
+index 835af771a9fd1..a92512a46e91e 100644 |
2494 |
+--- a/net/batman-adv/soft-interface.c |
2495 |
++++ b/net/batman-adv/soft-interface.c |
2496 |
+@@ -217,6 +217,8 @@ static int batadv_interface_tx(struct sk_buff *skb, |
2497 |
+ |
2498 |
+ switch (ntohs(ethhdr->h_proto)) { |
2499 |
+ case ETH_P_8021Q: |
2500 |
++ if (!pskb_may_pull(skb, sizeof(*vhdr))) |
2501 |
++ goto dropped; |
2502 |
+ vhdr = vlan_eth_hdr(skb); |
2503 |
+ |
2504 |
+ /* drop batman-in-batman packets to prevent loops */ |
2505 |
+diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c |
2506 |
+index 4bd57507b9a45..2136e45f52777 100644 |
2507 |
+--- a/net/bridge/br_multicast.c |
2508 |
++++ b/net/bridge/br_multicast.c |
2509 |
+@@ -1287,14 +1287,7 @@ static void br_multicast_query_received(struct net_bridge *br, |
2510 |
+ return; |
2511 |
+ |
2512 |
+ br_multicast_update_query_timer(br, query, max_delay); |
2513 |
+- |
2514 |
+- /* Based on RFC4541, section 2.1.1 IGMP Forwarding Rules, |
2515 |
+- * the arrival port for IGMP Queries where the source address |
2516 |
+- * is 0.0.0.0 should not be added to router port list. |
2517 |
+- */ |
2518 |
+- if ((saddr->proto == htons(ETH_P_IP) && saddr->u.ip4) || |
2519 |
+- saddr->proto == htons(ETH_P_IPV6)) |
2520 |
+- br_multicast_mark_router(br, port); |
2521 |
++ br_multicast_mark_router(br, port); |
2522 |
+ } |
2523 |
+ |
2524 |
+ static int br_ip4_multicast_query(struct net_bridge *br, |
2525 |
+diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c |
2526 |
+index 93eb606f76282..7e27cabb04ef9 100644 |
2527 |
+--- a/net/ceph/messenger.c |
2528 |
++++ b/net/ceph/messenger.c |
2529 |
+@@ -2042,6 +2042,8 @@ static int process_connect(struct ceph_connection *con) |
2530 |
+ dout("process_connect on %p tag %d\n", con, (int)con->in_tag); |
2531 |
+ |
2532 |
+ if (con->auth) { |
2533 |
++ int len = le32_to_cpu(con->in_reply.authorizer_len); |
2534 |
++ |
2535 |
+ /* |
2536 |
+ * Any connection that defines ->get_authorizer() |
2537 |
+ * should also define ->add_authorizer_challenge() and |
2538 |
+@@ -2051,8 +2053,7 @@ static int process_connect(struct ceph_connection *con) |
2539 |
+ */ |
2540 |
+ if (con->in_reply.tag == CEPH_MSGR_TAG_CHALLENGE_AUTHORIZER) { |
2541 |
+ ret = con->ops->add_authorizer_challenge( |
2542 |
+- con, con->auth->authorizer_reply_buf, |
2543 |
+- le32_to_cpu(con->in_reply.authorizer_len)); |
2544 |
++ con, con->auth->authorizer_reply_buf, len); |
2545 |
+ if (ret < 0) |
2546 |
+ return ret; |
2547 |
+ |
2548 |
+@@ -2062,10 +2063,12 @@ static int process_connect(struct ceph_connection *con) |
2549 |
+ return 0; |
2550 |
+ } |
2551 |
+ |
2552 |
+- ret = con->ops->verify_authorizer_reply(con); |
2553 |
+- if (ret < 0) { |
2554 |
+- con->error_msg = "bad authorize reply"; |
2555 |
+- return ret; |
2556 |
++ if (len) { |
2557 |
++ ret = con->ops->verify_authorizer_reply(con); |
2558 |
++ if (ret < 0) { |
2559 |
++ con->error_msg = "bad authorize reply"; |
2560 |
++ return ret; |
2561 |
++ } |
2562 |
+ } |
2563 |
+ } |
2564 |
+ |
2565 |
+diff --git a/net/core/netpoll.c b/net/core/netpoll.c |
2566 |
+index 457f882b0f7ba..9b2d61120c0d7 100644 |
2567 |
+--- a/net/core/netpoll.c |
2568 |
++++ b/net/core/netpoll.c |
2569 |
+@@ -666,7 +666,7 @@ int netpoll_setup(struct netpoll *np) |
2570 |
+ int err; |
2571 |
+ |
2572 |
+ rtnl_lock(); |
2573 |
+- if (np->dev_name) { |
2574 |
++ if (np->dev_name[0]) { |
2575 |
+ struct net *net = current->nsproxy->net_ns; |
2576 |
+ ndev = __dev_get_by_name(net, np->dev_name); |
2577 |
+ } |
2578 |
+diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c |
2579 |
+index fc7ca1e469081..4381ea53fa91d 100644 |
2580 |
+--- a/net/ipv6/sit.c |
2581 |
++++ b/net/ipv6/sit.c |
2582 |
+@@ -540,7 +540,8 @@ static int ipip6_err(struct sk_buff *skb, u32 info) |
2583 |
+ } |
2584 |
+ |
2585 |
+ err = 0; |
2586 |
+- if (!ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4, type, data_len)) |
2587 |
++ if (__in6_dev_get(skb->dev) && |
2588 |
++ !ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4, type, data_len)) |
2589 |
+ goto out; |
2590 |
+ |
2591 |
+ if (t->parms.iph.daddr == 0) |
2592 |
+diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c |
2593 |
+index f0e6175a9821f..197753ad50b4e 100644 |
2594 |
+--- a/net/mac80211/mesh_pathtbl.c |
2595 |
++++ b/net/mac80211/mesh_pathtbl.c |
2596 |
+@@ -449,17 +449,15 @@ struct mesh_path *mesh_path_add(struct ieee80211_sub_if_data *sdata, |
2597 |
+ |
2598 |
+ } while (unlikely(ret == -EEXIST && !mpath)); |
2599 |
+ |
2600 |
+- if (ret && ret != -EEXIST) |
2601 |
+- return ERR_PTR(ret); |
2602 |
+- |
2603 |
+- /* At this point either new_mpath was added, or we found a |
2604 |
+- * matching entry already in the table; in the latter case |
2605 |
+- * free the unnecessary new entry. |
2606 |
+- */ |
2607 |
+- if (ret == -EEXIST) { |
2608 |
++ if (ret) { |
2609 |
+ kfree(new_mpath); |
2610 |
++ |
2611 |
++ if (ret != -EEXIST) |
2612 |
++ return ERR_PTR(ret); |
2613 |
++ |
2614 |
+ new_mpath = mpath; |
2615 |
+ } |
2616 |
++ |
2617 |
+ sdata->u.mesh.mesh_paths_generation++; |
2618 |
+ return new_mpath; |
2619 |
+ } |
2620 |
+@@ -489,6 +487,9 @@ int mpp_path_add(struct ieee80211_sub_if_data *sdata, |
2621 |
+ &new_mpath->rhash, |
2622 |
+ mesh_rht_params); |
2623 |
+ |
2624 |
++ if (ret) |
2625 |
++ kfree(new_mpath); |
2626 |
++ |
2627 |
+ sdata->u.mesh.mpp_paths_generation++; |
2628 |
+ return ret; |
2629 |
+ } |
2630 |
+diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c |
2631 |
+index a3fb30f5a1a95..2fa1c4f2e94e0 100644 |
2632 |
+--- a/net/netfilter/nf_tables_api.c |
2633 |
++++ b/net/netfilter/nf_tables_api.c |
2634 |
+@@ -263,6 +263,9 @@ static int nft_delrule_by_chain(struct nft_ctx *ctx) |
2635 |
+ int err; |
2636 |
+ |
2637 |
+ list_for_each_entry(rule, &ctx->chain->rules, list) { |
2638 |
++ if (!nft_is_active_next(ctx->net, rule)) |
2639 |
++ continue; |
2640 |
++ |
2641 |
+ err = nft_delrule(ctx, rule); |
2642 |
+ if (err < 0) |
2643 |
+ return err; |
2644 |
+diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c |
2645 |
+index 82e222cd48454..14df2fcf61384 100644 |
2646 |
+--- a/net/packet/af_packet.c |
2647 |
++++ b/net/packet/af_packet.c |
2648 |
+@@ -4316,7 +4316,7 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, |
2649 |
+ rb->frames_per_block = req->tp_block_size / req->tp_frame_size; |
2650 |
+ if (unlikely(rb->frames_per_block == 0)) |
2651 |
+ goto out; |
2652 |
+- if (unlikely(req->tp_block_size > UINT_MAX / req->tp_block_nr)) |
2653 |
++ if (unlikely(rb->frames_per_block > UINT_MAX / req->tp_block_nr)) |
2654 |
+ goto out; |
2655 |
+ if (unlikely((rb->frames_per_block * req->tp_block_nr) != |
2656 |
+ req->tp_frame_nr)) |
2657 |
+diff --git a/net/sctp/offload.c b/net/sctp/offload.c |
2658 |
+index 6300f28c95888..31b9a12fc35a1 100644 |
2659 |
+--- a/net/sctp/offload.c |
2660 |
++++ b/net/sctp/offload.c |
2661 |
+@@ -35,6 +35,7 @@ |
2662 |
+ static __le32 sctp_gso_make_checksum(struct sk_buff *skb) |
2663 |
+ { |
2664 |
+ skb->ip_summed = CHECKSUM_NONE; |
2665 |
++ gso_reset_checksum(skb, ~0); |
2666 |
+ return sctp_compute_cksum(skb, skb_transport_offset(skb)); |
2667 |
+ } |
2668 |
+ |
2669 |
+diff --git a/security/keys/key.c b/security/keys/key.c |
2670 |
+index 7dc59069e8c76..7276d1a009d49 100644 |
2671 |
+--- a/security/keys/key.c |
2672 |
++++ b/security/keys/key.c |
2673 |
+@@ -264,8 +264,8 @@ struct key *key_alloc(struct key_type *type, const char *desc, |
2674 |
+ |
2675 |
+ spin_lock(&user->lock); |
2676 |
+ if (!(flags & KEY_ALLOC_QUOTA_OVERRUN)) { |
2677 |
+- if (user->qnkeys + 1 >= maxkeys || |
2678 |
+- user->qnbytes + quotalen >= maxbytes || |
2679 |
++ if (user->qnkeys + 1 > maxkeys || |
2680 |
++ user->qnbytes + quotalen > maxbytes || |
2681 |
+ user->qnbytes + quotalen < user->qnbytes) |
2682 |
+ goto no_quota; |
2683 |
+ } |
2684 |
+diff --git a/security/keys/keyring.c b/security/keys/keyring.c |
2685 |
+index 4e9b4d23e20ef..7308067dcc5d8 100644 |
2686 |
+--- a/security/keys/keyring.c |
2687 |
++++ b/security/keys/keyring.c |
2688 |
+@@ -652,9 +652,6 @@ static bool search_nested_keyrings(struct key *keyring, |
2689 |
+ BUG_ON((ctx->flags & STATE_CHECKS) == 0 || |
2690 |
+ (ctx->flags & STATE_CHECKS) == STATE_CHECKS); |
2691 |
+ |
2692 |
+- if (ctx->index_key.description) |
2693 |
+- ctx->index_key.desc_len = strlen(ctx->index_key.description); |
2694 |
+- |
2695 |
+ /* Check to see if this top-level keyring is what we are looking for |
2696 |
+ * and whether it is valid or not. |
2697 |
+ */ |
2698 |
+@@ -912,6 +909,7 @@ key_ref_t keyring_search(key_ref_t keyring, |
2699 |
+ struct keyring_search_context ctx = { |
2700 |
+ .index_key.type = type, |
2701 |
+ .index_key.description = description, |
2702 |
++ .index_key.desc_len = strlen(description), |
2703 |
+ .cred = current_cred(), |
2704 |
+ .match_data.cmp = key_default_cmp, |
2705 |
+ .match_data.raw_data = description, |
2706 |
+diff --git a/security/keys/proc.c b/security/keys/proc.c |
2707 |
+index 0361286824638..ec493ddadd111 100644 |
2708 |
+--- a/security/keys/proc.c |
2709 |
++++ b/security/keys/proc.c |
2710 |
+@@ -186,8 +186,7 @@ static int proc_keys_show(struct seq_file *m, void *v) |
2711 |
+ int rc; |
2712 |
+ |
2713 |
+ struct keyring_search_context ctx = { |
2714 |
+- .index_key.type = key->type, |
2715 |
+- .index_key.description = key->description, |
2716 |
++ .index_key = key->index_key, |
2717 |
+ .cred = current_cred(), |
2718 |
+ .match_data.cmp = lookup_user_key_possessed, |
2719 |
+ .match_data.raw_data = key, |
2720 |
+diff --git a/security/keys/request_key.c b/security/keys/request_key.c |
2721 |
+index cb7f8f730c6dd..aa292e01c5621 100644 |
2722 |
+--- a/security/keys/request_key.c |
2723 |
++++ b/security/keys/request_key.c |
2724 |
+@@ -544,6 +544,7 @@ struct key *request_key_and_link(struct key_type *type, |
2725 |
+ struct keyring_search_context ctx = { |
2726 |
+ .index_key.type = type, |
2727 |
+ .index_key.description = description, |
2728 |
++ .index_key.desc_len = strlen(description), |
2729 |
+ .cred = current_cred(), |
2730 |
+ .match_data.cmp = key_default_cmp, |
2731 |
+ .match_data.raw_data = description, |
2732 |
+diff --git a/security/keys/request_key_auth.c b/security/keys/request_key_auth.c |
2733 |
+index ba74a0b4d1cb6..f60baeb338e5f 100644 |
2734 |
+--- a/security/keys/request_key_auth.c |
2735 |
++++ b/security/keys/request_key_auth.c |
2736 |
+@@ -254,7 +254,7 @@ struct key *key_get_instantiation_authkey(key_serial_t target_id) |
2737 |
+ struct key *authkey; |
2738 |
+ key_ref_t authkey_ref; |
2739 |
+ |
2740 |
+- sprintf(description, "%x", target_id); |
2741 |
++ ctx.index_key.desc_len = sprintf(description, "%x", target_id); |
2742 |
+ |
2743 |
+ authkey_ref = search_process_keyrings(&ctx); |
2744 |
+ |