1 |
commit: d06d27402b004bff3804265e4074fbfdd6edd601 |
2 |
Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Mar 30 13:10:47 2021 +0000 |
4 |
Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Mar 30 13:12:24 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=d06d2740 |
7 |
|
8 |
Linux patch 5.4.109 |
9 |
|
10 |
Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1108_linux-5.4.109.patch | 3135 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 3139 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index b003605..3371952 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -475,6 +475,10 @@ Patch: 1107_linux-5.4.108.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.4.108 |
23 |
|
24 |
+Patch: 1108_linux-5.4.109.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.4.109 |
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/1108_linux-5.4.109.patch b/1108_linux-5.4.109.patch |
33 |
new file mode 100644 |
34 |
index 0000000..6569291 |
35 |
--- /dev/null |
36 |
+++ b/1108_linux-5.4.109.patch |
37 |
@@ -0,0 +1,3135 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index b0abe257221a7..e037662c369ba 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 4 |
46 |
+-SUBLEVEL = 108 |
47 |
++SUBLEVEL = 109 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Kleptomaniac Octopus |
50 |
+ |
51 |
+diff --git a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi |
52 |
+index 7788d5db65c25..ae6d07dc02832 100644 |
53 |
+--- a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi |
54 |
++++ b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi |
55 |
+@@ -44,8 +44,8 @@ |
56 |
+ pinctrl-0 = <&pinctrl_macb0_default>; |
57 |
+ phy-mode = "rmii"; |
58 |
+ |
59 |
+- ethernet-phy@0 { |
60 |
+- reg = <0x0>; |
61 |
++ ethernet-phy@7 { |
62 |
++ reg = <0x7>; |
63 |
+ interrupt-parent = <&pioA>; |
64 |
+ interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>; |
65 |
+ pinctrl-names = "default"; |
66 |
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi |
67 |
+index 337919366dc85..ec141c9852893 100644 |
68 |
+--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi |
69 |
++++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi |
70 |
+@@ -177,6 +177,7 @@ |
71 |
+ ranges = <0x0 0x00 0x1700000 0x100000>; |
72 |
+ reg = <0x00 0x1700000 0x0 0x100000>; |
73 |
+ interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>; |
74 |
++ dma-coherent; |
75 |
+ |
76 |
+ sec_jr0: jr@10000 { |
77 |
+ compatible = "fsl,sec-v5.4-job-ring", |
78 |
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi |
79 |
+index c084c7a4b6a6f..b611d835dc25a 100644 |
80 |
+--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi |
81 |
++++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi |
82 |
+@@ -241,6 +241,7 @@ |
83 |
+ ranges = <0x0 0x00 0x1700000 0x100000>; |
84 |
+ reg = <0x00 0x1700000 0x0 0x100000>; |
85 |
+ interrupts = <0 75 0x4>; |
86 |
++ dma-coherent; |
87 |
+ |
88 |
+ sec_jr0: jr@10000 { |
89 |
+ compatible = "fsl,sec-v5.4-job-ring", |
90 |
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi |
91 |
+index 04d4b1b11a00a..ca087918c250a 100644 |
92 |
+--- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi |
93 |
++++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi |
94 |
+@@ -244,6 +244,7 @@ |
95 |
+ ranges = <0x0 0x00 0x1700000 0x100000>; |
96 |
+ reg = <0x00 0x1700000 0x0 0x100000>; |
97 |
+ interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>; |
98 |
++ dma-coherent; |
99 |
+ |
100 |
+ sec_jr0: jr@10000 { |
101 |
+ compatible = "fsl,sec-v5.4-job-ring", |
102 |
+diff --git a/arch/arm64/kernel/crash_dump.c b/arch/arm64/kernel/crash_dump.c |
103 |
+index e6e284265f19d..58303a9ec32c4 100644 |
104 |
+--- a/arch/arm64/kernel/crash_dump.c |
105 |
++++ b/arch/arm64/kernel/crash_dump.c |
106 |
+@@ -64,5 +64,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, |
107 |
+ ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos) |
108 |
+ { |
109 |
+ memcpy(buf, phys_to_virt((phys_addr_t)*ppos), count); |
110 |
++ *ppos += count; |
111 |
++ |
112 |
+ return count; |
113 |
+ } |
114 |
+diff --git a/arch/ia64/include/asm/syscall.h b/arch/ia64/include/asm/syscall.h |
115 |
+index 6c6f16e409a87..0d23c00493018 100644 |
116 |
+--- a/arch/ia64/include/asm/syscall.h |
117 |
++++ b/arch/ia64/include/asm/syscall.h |
118 |
+@@ -32,7 +32,7 @@ static inline void syscall_rollback(struct task_struct *task, |
119 |
+ static inline long syscall_get_error(struct task_struct *task, |
120 |
+ struct pt_regs *regs) |
121 |
+ { |
122 |
+- return regs->r10 == -1 ? regs->r8:0; |
123 |
++ return regs->r10 == -1 ? -regs->r8:0; |
124 |
+ } |
125 |
+ |
126 |
+ static inline long syscall_get_return_value(struct task_struct *task, |
127 |
+diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c |
128 |
+index bf9c24d9ce84e..54e12b0ecebdf 100644 |
129 |
+--- a/arch/ia64/kernel/ptrace.c |
130 |
++++ b/arch/ia64/kernel/ptrace.c |
131 |
+@@ -2147,27 +2147,39 @@ static void syscall_get_set_args_cb(struct unw_frame_info *info, void *data) |
132 |
+ { |
133 |
+ struct syscall_get_set_args *args = data; |
134 |
+ struct pt_regs *pt = args->regs; |
135 |
+- unsigned long *krbs, cfm, ndirty; |
136 |
++ unsigned long *krbs, cfm, ndirty, nlocals, nouts; |
137 |
+ int i, count; |
138 |
+ |
139 |
+ if (unw_unwind_to_user(info) < 0) |
140 |
+ return; |
141 |
+ |
142 |
++ /* |
143 |
++ * We get here via a few paths: |
144 |
++ * - break instruction: cfm is shared with caller. |
145 |
++ * syscall args are in out= regs, locals are non-empty. |
146 |
++ * - epsinstruction: cfm is set by br.call |
147 |
++ * locals don't exist. |
148 |
++ * |
149 |
++ * For both cases argguments are reachable in cfm.sof - cfm.sol. |
150 |
++ * CFM: [ ... | sor: 17..14 | sol : 13..7 | sof : 6..0 ] |
151 |
++ */ |
152 |
+ cfm = pt->cr_ifs; |
153 |
++ nlocals = (cfm >> 7) & 0x7f; /* aka sol */ |
154 |
++ nouts = (cfm & 0x7f) - nlocals; /* aka sof - sol */ |
155 |
+ krbs = (unsigned long *)info->task + IA64_RBS_OFFSET/8; |
156 |
+ ndirty = ia64_rse_num_regs(krbs, krbs + (pt->loadrs >> 19)); |
157 |
+ |
158 |
+ count = 0; |
159 |
+ if (in_syscall(pt)) |
160 |
+- count = min_t(int, args->n, cfm & 0x7f); |
161 |
++ count = min_t(int, args->n, nouts); |
162 |
+ |
163 |
++ /* Iterate over outs. */ |
164 |
+ for (i = 0; i < count; i++) { |
165 |
++ int j = ndirty + nlocals + i + args->i; |
166 |
+ if (args->rw) |
167 |
+- *ia64_rse_skip_regs(krbs, ndirty + i + args->i) = |
168 |
+- args->args[i]; |
169 |
++ *ia64_rse_skip_regs(krbs, j) = args->args[i]; |
170 |
+ else |
171 |
+- args->args[i] = *ia64_rse_skip_regs(krbs, |
172 |
+- ndirty + i + args->i); |
173 |
++ args->args[i] = *ia64_rse_skip_regs(krbs, j); |
174 |
+ } |
175 |
+ |
176 |
+ if (!args->rw) { |
177 |
+diff --git a/arch/powerpc/include/asm/dcr-native.h b/arch/powerpc/include/asm/dcr-native.h |
178 |
+index 7141ccea8c94e..a92059964579b 100644 |
179 |
+--- a/arch/powerpc/include/asm/dcr-native.h |
180 |
++++ b/arch/powerpc/include/asm/dcr-native.h |
181 |
+@@ -53,8 +53,8 @@ static inline void mtdcrx(unsigned int reg, unsigned int val) |
182 |
+ #define mfdcr(rn) \ |
183 |
+ ({unsigned int rval; \ |
184 |
+ if (__builtin_constant_p(rn) && rn < 1024) \ |
185 |
+- asm volatile("mfdcr %0," __stringify(rn) \ |
186 |
+- : "=r" (rval)); \ |
187 |
++ asm volatile("mfdcr %0, %1" : "=r" (rval) \ |
188 |
++ : "n" (rn)); \ |
189 |
+ else if (likely(cpu_has_feature(CPU_FTR_INDEXED_DCR))) \ |
190 |
+ rval = mfdcrx(rn); \ |
191 |
+ else \ |
192 |
+@@ -64,8 +64,8 @@ static inline void mtdcrx(unsigned int reg, unsigned int val) |
193 |
+ #define mtdcr(rn, v) \ |
194 |
+ do { \ |
195 |
+ if (__builtin_constant_p(rn) && rn < 1024) \ |
196 |
+- asm volatile("mtdcr " __stringify(rn) ",%0" \ |
197 |
+- : : "r" (v)); \ |
198 |
++ asm volatile("mtdcr %0, %1" \ |
199 |
++ : : "n" (rn), "r" (v)); \ |
200 |
+ else if (likely(cpu_has_feature(CPU_FTR_INDEXED_DCR))) \ |
201 |
+ mtdcrx(rn, v); \ |
202 |
+ else \ |
203 |
+diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c |
204 |
+index 27778b65a965e..f2b22c496fb97 100644 |
205 |
+--- a/arch/sparc/kernel/traps_64.c |
206 |
++++ b/arch/sparc/kernel/traps_64.c |
207 |
+@@ -275,14 +275,13 @@ bool is_no_fault_exception(struct pt_regs *regs) |
208 |
+ asi = (regs->tstate >> 24); /* saved %asi */ |
209 |
+ else |
210 |
+ asi = (insn >> 5); /* immediate asi */ |
211 |
+- if ((asi & 0xf2) == ASI_PNF) { |
212 |
+- if (insn & 0x1000000) { /* op3[5:4]=3 */ |
213 |
+- handle_ldf_stq(insn, regs); |
214 |
+- return true; |
215 |
+- } else if (insn & 0x200000) { /* op3[2], stores */ |
216 |
++ if ((asi & 0xf6) == ASI_PNF) { |
217 |
++ if (insn & 0x200000) /* op3[2], stores */ |
218 |
+ return false; |
219 |
+- } |
220 |
+- handle_ld_nf(insn, regs); |
221 |
++ if (insn & 0x1000000) /* op3[5:4]=3 (fp) */ |
222 |
++ handle_ldf_stq(insn, regs); |
223 |
++ else |
224 |
++ handle_ld_nf(insn, regs); |
225 |
+ return true; |
226 |
+ } |
227 |
+ } |
228 |
+diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c |
229 |
+index dfa01bcdc3694..7b558939b89c1 100644 |
230 |
+--- a/arch/x86/mm/mem_encrypt.c |
231 |
++++ b/arch/x86/mm/mem_encrypt.c |
232 |
+@@ -229,7 +229,7 @@ static void __init __set_clr_pte_enc(pte_t *kpte, int level, bool enc) |
233 |
+ if (pgprot_val(old_prot) == pgprot_val(new_prot)) |
234 |
+ return; |
235 |
+ |
236 |
+- pa = pfn << page_level_shift(level); |
237 |
++ pa = pfn << PAGE_SHIFT; |
238 |
+ size = page_level_size(level); |
239 |
+ |
240 |
+ /* |
241 |
+diff --git a/block/blk-merge.c b/block/blk-merge.c |
242 |
+index 86c4c1ef87429..03959bfe961cf 100644 |
243 |
+--- a/block/blk-merge.c |
244 |
++++ b/block/blk-merge.c |
245 |
+@@ -370,6 +370,14 @@ unsigned int blk_recalc_rq_segments(struct request *rq) |
246 |
+ switch (bio_op(rq->bio)) { |
247 |
+ case REQ_OP_DISCARD: |
248 |
+ case REQ_OP_SECURE_ERASE: |
249 |
++ if (queue_max_discard_segments(rq->q) > 1) { |
250 |
++ struct bio *bio = rq->bio; |
251 |
++ |
252 |
++ for_each_bio(bio) |
253 |
++ nr_phys_segs++; |
254 |
++ return nr_phys_segs; |
255 |
++ } |
256 |
++ return 1; |
257 |
+ case REQ_OP_WRITE_ZEROES: |
258 |
+ return 0; |
259 |
+ case REQ_OP_WRITE_SAME: |
260 |
+diff --git a/block/genhd.c b/block/genhd.c |
261 |
+index 604f0a2cbc9a0..2f6f341a8fbb7 100644 |
262 |
+--- a/block/genhd.c |
263 |
++++ b/block/genhd.c |
264 |
+@@ -637,10 +637,8 @@ static void register_disk(struct device *parent, struct gendisk *disk, |
265 |
+ disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj); |
266 |
+ disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); |
267 |
+ |
268 |
+- if (disk->flags & GENHD_FL_HIDDEN) { |
269 |
+- dev_set_uevent_suppress(ddev, 0); |
270 |
++ if (disk->flags & GENHD_FL_HIDDEN) |
271 |
+ return; |
272 |
+- } |
273 |
+ |
274 |
+ /* No minors to use for partitions */ |
275 |
+ if (!disk_part_scan_enabled(disk)) |
276 |
+diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h |
277 |
+index 1db2e1bb72ba6..159c422601bc4 100644 |
278 |
+--- a/drivers/acpi/internal.h |
279 |
++++ b/drivers/acpi/internal.h |
280 |
+@@ -9,6 +9,8 @@ |
281 |
+ #ifndef _ACPI_INTERNAL_H_ |
282 |
+ #define _ACPI_INTERNAL_H_ |
283 |
+ |
284 |
++#include <linux/idr.h> |
285 |
++ |
286 |
+ #define PREFIX "ACPI: " |
287 |
+ |
288 |
+ int early_acpi_osi_init(void); |
289 |
+@@ -96,9 +98,11 @@ void acpi_scan_table_handler(u32 event, void *table, void *context); |
290 |
+ |
291 |
+ extern struct list_head acpi_bus_id_list; |
292 |
+ |
293 |
++#define ACPI_MAX_DEVICE_INSTANCES 4096 |
294 |
++ |
295 |
+ struct acpi_device_bus_id { |
296 |
+ const char *bus_id; |
297 |
+- unsigned int instance_no; |
298 |
++ struct ida instance_ida; |
299 |
+ struct list_head node; |
300 |
+ }; |
301 |
+ |
302 |
+diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c |
303 |
+index 8887a72712d4b..dbb5919f23e2d 100644 |
304 |
+--- a/drivers/acpi/scan.c |
305 |
++++ b/drivers/acpi/scan.c |
306 |
+@@ -483,9 +483,8 @@ static void acpi_device_del(struct acpi_device *device) |
307 |
+ list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) |
308 |
+ if (!strcmp(acpi_device_bus_id->bus_id, |
309 |
+ acpi_device_hid(device))) { |
310 |
+- if (acpi_device_bus_id->instance_no > 0) |
311 |
+- acpi_device_bus_id->instance_no--; |
312 |
+- else { |
313 |
++ ida_simple_remove(&acpi_device_bus_id->instance_ida, device->pnp.instance_no); |
314 |
++ if (ida_is_empty(&acpi_device_bus_id->instance_ida)) { |
315 |
+ list_del(&acpi_device_bus_id->node); |
316 |
+ kfree_const(acpi_device_bus_id->bus_id); |
317 |
+ kfree(acpi_device_bus_id); |
318 |
+@@ -624,12 +623,38 @@ void acpi_bus_put_acpi_device(struct acpi_device *adev) |
319 |
+ put_device(&adev->dev); |
320 |
+ } |
321 |
+ |
322 |
++static struct acpi_device_bus_id *acpi_device_bus_id_match(const char *dev_id) |
323 |
++{ |
324 |
++ struct acpi_device_bus_id *acpi_device_bus_id; |
325 |
++ |
326 |
++ /* Find suitable bus_id and instance number in acpi_bus_id_list. */ |
327 |
++ list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) { |
328 |
++ if (!strcmp(acpi_device_bus_id->bus_id, dev_id)) |
329 |
++ return acpi_device_bus_id; |
330 |
++ } |
331 |
++ return NULL; |
332 |
++} |
333 |
++ |
334 |
++static int acpi_device_set_name(struct acpi_device *device, |
335 |
++ struct acpi_device_bus_id *acpi_device_bus_id) |
336 |
++{ |
337 |
++ struct ida *instance_ida = &acpi_device_bus_id->instance_ida; |
338 |
++ int result; |
339 |
++ |
340 |
++ result = ida_simple_get(instance_ida, 0, ACPI_MAX_DEVICE_INSTANCES, GFP_KERNEL); |
341 |
++ if (result < 0) |
342 |
++ return result; |
343 |
++ |
344 |
++ device->pnp.instance_no = result; |
345 |
++ dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, result); |
346 |
++ return 0; |
347 |
++} |
348 |
++ |
349 |
+ int acpi_device_add(struct acpi_device *device, |
350 |
+ void (*release)(struct device *)) |
351 |
+ { |
352 |
++ struct acpi_device_bus_id *acpi_device_bus_id; |
353 |
+ int result; |
354 |
+- struct acpi_device_bus_id *acpi_device_bus_id, *new_bus_id; |
355 |
+- int found = 0; |
356 |
+ |
357 |
+ if (device->handle) { |
358 |
+ acpi_status status; |
359 |
+@@ -655,41 +680,38 @@ int acpi_device_add(struct acpi_device *device, |
360 |
+ INIT_LIST_HEAD(&device->del_list); |
361 |
+ mutex_init(&device->physical_node_lock); |
362 |
+ |
363 |
+- new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL); |
364 |
+- if (!new_bus_id) { |
365 |
+- pr_err(PREFIX "Memory allocation error\n"); |
366 |
+- result = -ENOMEM; |
367 |
+- goto err_detach; |
368 |
+- } |
369 |
+- |
370 |
+ mutex_lock(&acpi_device_lock); |
371 |
+- /* |
372 |
+- * Find suitable bus_id and instance number in acpi_bus_id_list |
373 |
+- * If failed, create one and link it into acpi_bus_id_list |
374 |
+- */ |
375 |
+- list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) { |
376 |
+- if (!strcmp(acpi_device_bus_id->bus_id, |
377 |
+- acpi_device_hid(device))) { |
378 |
+- acpi_device_bus_id->instance_no++; |
379 |
+- found = 1; |
380 |
+- kfree(new_bus_id); |
381 |
+- break; |
382 |
++ |
383 |
++ acpi_device_bus_id = acpi_device_bus_id_match(acpi_device_hid(device)); |
384 |
++ if (acpi_device_bus_id) { |
385 |
++ result = acpi_device_set_name(device, acpi_device_bus_id); |
386 |
++ if (result) |
387 |
++ goto err_unlock; |
388 |
++ } else { |
389 |
++ acpi_device_bus_id = kzalloc(sizeof(*acpi_device_bus_id), |
390 |
++ GFP_KERNEL); |
391 |
++ if (!acpi_device_bus_id) { |
392 |
++ result = -ENOMEM; |
393 |
++ goto err_unlock; |
394 |
+ } |
395 |
+- } |
396 |
+- if (!found) { |
397 |
+- acpi_device_bus_id = new_bus_id; |
398 |
+ acpi_device_bus_id->bus_id = |
399 |
+ kstrdup_const(acpi_device_hid(device), GFP_KERNEL); |
400 |
+ if (!acpi_device_bus_id->bus_id) { |
401 |
+- pr_err(PREFIX "Memory allocation error for bus id\n"); |
402 |
++ kfree(acpi_device_bus_id); |
403 |
+ result = -ENOMEM; |
404 |
+- goto err_free_new_bus_id; |
405 |
++ goto err_unlock; |
406 |
++ } |
407 |
++ |
408 |
++ ida_init(&acpi_device_bus_id->instance_ida); |
409 |
++ |
410 |
++ result = acpi_device_set_name(device, acpi_device_bus_id); |
411 |
++ if (result) { |
412 |
++ kfree(acpi_device_bus_id); |
413 |
++ goto err_unlock; |
414 |
+ } |
415 |
+ |
416 |
+- acpi_device_bus_id->instance_no = 0; |
417 |
+ list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); |
418 |
+ } |
419 |
+- dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no); |
420 |
+ |
421 |
+ if (device->parent) |
422 |
+ list_add_tail(&device->node, &device->parent->children); |
423 |
+@@ -721,13 +743,9 @@ int acpi_device_add(struct acpi_device *device, |
424 |
+ list_del(&device->node); |
425 |
+ list_del(&device->wakeup_list); |
426 |
+ |
427 |
+- err_free_new_bus_id: |
428 |
+- if (!found) |
429 |
+- kfree(new_bus_id); |
430 |
+- |
431 |
++ err_unlock: |
432 |
+ mutex_unlock(&acpi_device_lock); |
433 |
+ |
434 |
+- err_detach: |
435 |
+ acpi_detach_data(device->handle, acpi_scan_drop_device); |
436 |
+ return result; |
437 |
+ } |
438 |
+diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c |
439 |
+index 301ffe5b8feb0..e7978d983b263 100644 |
440 |
+--- a/drivers/acpi/video_detect.c |
441 |
++++ b/drivers/acpi/video_detect.c |
442 |
+@@ -150,6 +150,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = { |
443 |
+ }, |
444 |
+ }, |
445 |
+ { |
446 |
++ .callback = video_detect_force_vendor, |
447 |
+ .ident = "Sony VPCEH3U1E", |
448 |
+ .matches = { |
449 |
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), |
450 |
+diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c |
451 |
+index bedaebd5a4956..de52428b8833d 100644 |
452 |
+--- a/drivers/atm/eni.c |
453 |
++++ b/drivers/atm/eni.c |
454 |
+@@ -2281,7 +2281,8 @@ out: |
455 |
+ return rc; |
456 |
+ |
457 |
+ err_eni_release: |
458 |
+- eni_do_release(dev); |
459 |
++ dev->phy = NULL; |
460 |
++ iounmap(ENI_DEV(dev)->ioaddr); |
461 |
+ err_unregister: |
462 |
+ atm_dev_deregister(dev); |
463 |
+ err_free_consistent: |
464 |
+diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c |
465 |
+index 63871859e6e8e..52c2878b755db 100644 |
466 |
+--- a/drivers/atm/idt77105.c |
467 |
++++ b/drivers/atm/idt77105.c |
468 |
+@@ -262,7 +262,7 @@ static int idt77105_start(struct atm_dev *dev) |
469 |
+ { |
470 |
+ unsigned long flags; |
471 |
+ |
472 |
+- if (!(dev->dev_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL))) |
473 |
++ if (!(dev->phy_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL))) |
474 |
+ return -ENOMEM; |
475 |
+ PRIV(dev)->dev = dev; |
476 |
+ spin_lock_irqsave(&idt77105_priv_lock, flags); |
477 |
+@@ -337,7 +337,7 @@ static int idt77105_stop(struct atm_dev *dev) |
478 |
+ else |
479 |
+ idt77105_all = walk->next; |
480 |
+ dev->phy = NULL; |
481 |
+- dev->dev_data = NULL; |
482 |
++ dev->phy_data = NULL; |
483 |
+ kfree(walk); |
484 |
+ break; |
485 |
+ } |
486 |
+diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c |
487 |
+index 645a6bc1df888..c6b38112bcf4f 100644 |
488 |
+--- a/drivers/atm/lanai.c |
489 |
++++ b/drivers/atm/lanai.c |
490 |
+@@ -2234,6 +2234,7 @@ static int lanai_dev_open(struct atm_dev *atmdev) |
491 |
+ conf1_write(lanai); |
492 |
+ #endif |
493 |
+ iounmap(lanai->base); |
494 |
++ lanai->base = NULL; |
495 |
+ error_pci: |
496 |
+ pci_disable_device(lanai->pci); |
497 |
+ error: |
498 |
+@@ -2246,6 +2247,8 @@ static int lanai_dev_open(struct atm_dev *atmdev) |
499 |
+ static void lanai_dev_close(struct atm_dev *atmdev) |
500 |
+ { |
501 |
+ struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data; |
502 |
++ if (lanai->base==NULL) |
503 |
++ return; |
504 |
+ printk(KERN_INFO DEV_LABEL "(itf %d): shutting down interface\n", |
505 |
+ lanai->number); |
506 |
+ lanai_timed_poll_stop(lanai); |
507 |
+@@ -2555,7 +2558,7 @@ static int lanai_init_one(struct pci_dev *pci, |
508 |
+ struct atm_dev *atmdev; |
509 |
+ int result; |
510 |
+ |
511 |
+- lanai = kmalloc(sizeof(*lanai), GFP_KERNEL); |
512 |
++ lanai = kzalloc(sizeof(*lanai), GFP_KERNEL); |
513 |
+ if (lanai == NULL) { |
514 |
+ printk(KERN_ERR DEV_LABEL |
515 |
+ ": couldn't allocate dev_data structure!\n"); |
516 |
+diff --git a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c |
517 |
+index 7850758b5bb82..239852d855589 100644 |
518 |
+--- a/drivers/atm/uPD98402.c |
519 |
++++ b/drivers/atm/uPD98402.c |
520 |
+@@ -211,7 +211,7 @@ static void uPD98402_int(struct atm_dev *dev) |
521 |
+ static int uPD98402_start(struct atm_dev *dev) |
522 |
+ { |
523 |
+ DPRINTK("phy_start\n"); |
524 |
+- if (!(dev->dev_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL))) |
525 |
++ if (!(dev->phy_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL))) |
526 |
+ return -ENOMEM; |
527 |
+ spin_lock_init(&PRIV(dev)->lock); |
528 |
+ memset(&PRIV(dev)->sonet_stats,0,sizeof(struct k_sonet_stats)); |
529 |
+diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c |
530 |
+index 137a7ba053d78..e0c4ef06ca917 100644 |
531 |
+--- a/drivers/base/power/runtime.c |
532 |
++++ b/drivers/base/power/runtime.c |
533 |
+@@ -305,7 +305,7 @@ static int rpm_get_suppliers(struct device *dev) |
534 |
+ return 0; |
535 |
+ } |
536 |
+ |
537 |
+-static void rpm_put_suppliers(struct device *dev) |
538 |
++static void __rpm_put_suppliers(struct device *dev, bool try_to_suspend) |
539 |
+ { |
540 |
+ struct device_link *link; |
541 |
+ |
542 |
+@@ -313,10 +313,30 @@ static void rpm_put_suppliers(struct device *dev) |
543 |
+ device_links_read_lock_held()) { |
544 |
+ |
545 |
+ while (refcount_dec_not_one(&link->rpm_active)) |
546 |
+- pm_runtime_put(link->supplier); |
547 |
++ pm_runtime_put_noidle(link->supplier); |
548 |
++ |
549 |
++ if (try_to_suspend) |
550 |
++ pm_request_idle(link->supplier); |
551 |
+ } |
552 |
+ } |
553 |
+ |
554 |
++static void rpm_put_suppliers(struct device *dev) |
555 |
++{ |
556 |
++ __rpm_put_suppliers(dev, true); |
557 |
++} |
558 |
++ |
559 |
++static void rpm_suspend_suppliers(struct device *dev) |
560 |
++{ |
561 |
++ struct device_link *link; |
562 |
++ int idx = device_links_read_lock(); |
563 |
++ |
564 |
++ list_for_each_entry_rcu(link, &dev->links.suppliers, c_node, |
565 |
++ device_links_read_lock_held()) |
566 |
++ pm_request_idle(link->supplier); |
567 |
++ |
568 |
++ device_links_read_unlock(idx); |
569 |
++} |
570 |
++ |
571 |
+ /** |
572 |
+ * __rpm_callback - Run a given runtime PM callback for a given device. |
573 |
+ * @cb: Runtime PM callback to run. |
574 |
+@@ -344,8 +364,10 @@ static int __rpm_callback(int (*cb)(struct device *), struct device *dev) |
575 |
+ idx = device_links_read_lock(); |
576 |
+ |
577 |
+ retval = rpm_get_suppliers(dev); |
578 |
+- if (retval) |
579 |
++ if (retval) { |
580 |
++ rpm_put_suppliers(dev); |
581 |
+ goto fail; |
582 |
++ } |
583 |
+ |
584 |
+ device_links_read_unlock(idx); |
585 |
+ } |
586 |
+@@ -368,9 +390,9 @@ static int __rpm_callback(int (*cb)(struct device *), struct device *dev) |
587 |
+ || (dev->power.runtime_status == RPM_RESUMING && retval))) { |
588 |
+ idx = device_links_read_lock(); |
589 |
+ |
590 |
+- fail: |
591 |
+- rpm_put_suppliers(dev); |
592 |
++ __rpm_put_suppliers(dev, false); |
593 |
+ |
594 |
++fail: |
595 |
+ device_links_read_unlock(idx); |
596 |
+ } |
597 |
+ |
598 |
+@@ -644,8 +666,11 @@ static int rpm_suspend(struct device *dev, int rpmflags) |
599 |
+ goto out; |
600 |
+ } |
601 |
+ |
602 |
++ if (dev->power.irq_safe) |
603 |
++ goto out; |
604 |
++ |
605 |
+ /* Maybe the parent is now able to suspend. */ |
606 |
+- if (parent && !parent->power.ignore_children && !dev->power.irq_safe) { |
607 |
++ if (parent && !parent->power.ignore_children) { |
608 |
+ spin_unlock(&dev->power.lock); |
609 |
+ |
610 |
+ spin_lock(&parent->power.lock); |
611 |
+@@ -654,6 +679,14 @@ static int rpm_suspend(struct device *dev, int rpmflags) |
612 |
+ |
613 |
+ spin_lock(&dev->power.lock); |
614 |
+ } |
615 |
++ /* Maybe the suppliers are now able to suspend. */ |
616 |
++ if (dev->power.links_count > 0) { |
617 |
++ spin_unlock_irq(&dev->power.lock); |
618 |
++ |
619 |
++ rpm_suspend_suppliers(dev); |
620 |
++ |
621 |
++ spin_lock_irq(&dev->power.lock); |
622 |
++ } |
623 |
+ |
624 |
+ out: |
625 |
+ trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval); |
626 |
+diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c |
627 |
+index 208f3eea3641f..d98cfd3b64ff0 100644 |
628 |
+--- a/drivers/block/xen-blkback/blkback.c |
629 |
++++ b/drivers/block/xen-blkback/blkback.c |
630 |
+@@ -944,7 +944,7 @@ next: |
631 |
+ out: |
632 |
+ for (i = last_map; i < num; i++) { |
633 |
+ /* Don't zap current batch's valid persistent grants. */ |
634 |
+- if(i >= last_map + segs_to_map) |
635 |
++ if(i >= map_until) |
636 |
+ pages[i]->persistent_gnt = NULL; |
637 |
+ pages[i]->handle = BLKBACK_INVALID_HANDLE; |
638 |
+ } |
639 |
+diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c |
640 |
+index b040447575adc..dcfb32ee5cb60 100644 |
641 |
+--- a/drivers/bus/omap_l3_noc.c |
642 |
++++ b/drivers/bus/omap_l3_noc.c |
643 |
+@@ -285,7 +285,7 @@ static int omap_l3_probe(struct platform_device *pdev) |
644 |
+ */ |
645 |
+ l3->debug_irq = platform_get_irq(pdev, 0); |
646 |
+ ret = devm_request_irq(l3->dev, l3->debug_irq, l3_interrupt_handler, |
647 |
+- 0x0, "l3-dbg-irq", l3); |
648 |
++ IRQF_NO_THREAD, "l3-dbg-irq", l3); |
649 |
+ if (ret) { |
650 |
+ dev_err(l3->dev, "request_irq failed for %d\n", |
651 |
+ l3->debug_irq); |
652 |
+@@ -294,7 +294,7 @@ static int omap_l3_probe(struct platform_device *pdev) |
653 |
+ |
654 |
+ l3->app_irq = platform_get_irq(pdev, 1); |
655 |
+ ret = devm_request_irq(l3->dev, l3->app_irq, l3_interrupt_handler, |
656 |
+- 0x0, "l3-app-irq", l3); |
657 |
++ IRQF_NO_THREAD, "l3-app-irq", l3); |
658 |
+ if (ret) |
659 |
+ dev_err(l3->dev, "request_irq failed for %d\n", l3->app_irq); |
660 |
+ |
661 |
+diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c |
662 |
+index bca8d1f47fd2c..1200842c3da42 100644 |
663 |
+--- a/drivers/cpufreq/cpufreq-dt-platdev.c |
664 |
++++ b/drivers/cpufreq/cpufreq-dt-platdev.c |
665 |
+@@ -103,6 +103,8 @@ static const struct of_device_id whitelist[] __initconst = { |
666 |
+ static const struct of_device_id blacklist[] __initconst = { |
667 |
+ { .compatible = "allwinner,sun50i-h6", }, |
668 |
+ |
669 |
++ { .compatible = "arm,vexpress", }, |
670 |
++ |
671 |
+ { .compatible = "calxeda,highbank", }, |
672 |
+ { .compatible = "calxeda,ecx-2000", }, |
673 |
+ |
674 |
+diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c |
675 |
+index b2e186047014f..66dcab6ab26dd 100644 |
676 |
+--- a/drivers/gpio/gpiolib-acpi.c |
677 |
++++ b/drivers/gpio/gpiolib-acpi.c |
678 |
+@@ -174,7 +174,7 @@ static void acpi_gpiochip_request_irq(struct acpi_gpio_chip *acpi_gpio, |
679 |
+ int ret, value; |
680 |
+ |
681 |
+ ret = request_threaded_irq(event->irq, NULL, event->handler, |
682 |
+- event->irqflags, "ACPI:Event", event); |
683 |
++ event->irqflags | IRQF_ONESHOT, "ACPI:Event", event); |
684 |
+ if (ret) { |
685 |
+ dev_err(acpi_gpio->chip->parent, |
686 |
+ "Failed to setup interrupt handler for %d\n", |
687 |
+diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig |
688 |
+index e67c194c2acad..649f17dfcf459 100644 |
689 |
+--- a/drivers/gpu/drm/Kconfig |
690 |
++++ b/drivers/gpu/drm/Kconfig |
691 |
+@@ -206,6 +206,7 @@ source "drivers/gpu/drm/arm/Kconfig" |
692 |
+ config DRM_RADEON |
693 |
+ tristate "ATI Radeon" |
694 |
+ depends on DRM && PCI && MMU |
695 |
++ depends on AGP || !AGP |
696 |
+ select FW_LOADER |
697 |
+ select DRM_KMS_HELPER |
698 |
+ select DRM_TTM |
699 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c |
700 |
+index eaa5e7b7c19d6..fd94a17fb2c6d 100644 |
701 |
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c |
702 |
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c |
703 |
+@@ -146,7 +146,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, |
704 |
+ size = mode_cmd->pitches[0] * height; |
705 |
+ aligned_size = ALIGN(size, PAGE_SIZE); |
706 |
+ ret = amdgpu_gem_object_create(adev, aligned_size, 0, domain, flags, |
707 |
+- ttm_bo_type_kernel, NULL, &gobj); |
708 |
++ ttm_bo_type_device, NULL, &gobj); |
709 |
+ if (ret) { |
710 |
+ pr_err("failed to allocate framebuffer (%d)\n", aligned_size); |
711 |
+ return -ENOMEM; |
712 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c |
713 |
+index f63cbbee7b337..11a4c4029a902 100644 |
714 |
+--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c |
715 |
++++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c |
716 |
+@@ -257,7 +257,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn2_1_soc = { |
717 |
+ .num_banks = 8, |
718 |
+ .num_chans = 4, |
719 |
+ .vmm_page_size_bytes = 4096, |
720 |
+- .dram_clock_change_latency_us = 11.72, |
721 |
++ .dram_clock_change_latency_us = 23.84, |
722 |
+ .return_bus_width_bytes = 64, |
723 |
+ .dispclk_dppclk_vco_speed_mhz = 3600, |
724 |
+ .xfc_bus_transport_time_us = 4, |
725 |
+diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c |
726 |
+index 8d9d86c76a4e9..896d6f95a9604 100644 |
727 |
+--- a/drivers/gpu/drm/msm/msm_drv.c |
728 |
++++ b/drivers/gpu/drm/msm/msm_drv.c |
729 |
+@@ -1326,6 +1326,10 @@ static int msm_pdev_remove(struct platform_device *pdev) |
730 |
+ static void msm_pdev_shutdown(struct platform_device *pdev) |
731 |
+ { |
732 |
+ struct drm_device *drm = platform_get_drvdata(pdev); |
733 |
++ struct msm_drm_private *priv = drm ? drm->dev_private : NULL; |
734 |
++ |
735 |
++ if (!priv || !priv->kms) |
736 |
++ return; |
737 |
+ |
738 |
+ drm_atomic_helper_shutdown(drm); |
739 |
+ } |
740 |
+diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c |
741 |
+index 30e08bcc9afb5..3c78f8c32d12b 100644 |
742 |
+--- a/drivers/infiniband/hw/cxgb4/cm.c |
743 |
++++ b/drivers/infiniband/hw/cxgb4/cm.c |
744 |
+@@ -3610,13 +3610,13 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id) |
745 |
+ ep->com.local_addr.ss_family == AF_INET) { |
746 |
+ err = cxgb4_remove_server_filter( |
747 |
+ ep->com.dev->rdev.lldi.ports[0], ep->stid, |
748 |
+- ep->com.dev->rdev.lldi.rxq_ids[0], 0); |
749 |
++ ep->com.dev->rdev.lldi.rxq_ids[0], false); |
750 |
+ } else { |
751 |
+ struct sockaddr_in6 *sin6; |
752 |
+ c4iw_init_wr_wait(ep->com.wr_waitp); |
753 |
+ err = cxgb4_remove_server( |
754 |
+ ep->com.dev->rdev.lldi.ports[0], ep->stid, |
755 |
+- ep->com.dev->rdev.lldi.rxq_ids[0], 0); |
756 |
++ ep->com.dev->rdev.lldi.rxq_ids[0], true); |
757 |
+ if (err) |
758 |
+ goto done; |
759 |
+ err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp, |
760 |
+diff --git a/drivers/irqchip/irq-ingenic-tcu.c b/drivers/irqchip/irq-ingenic-tcu.c |
761 |
+index 6d05cefe9d795..02a82723a57ab 100644 |
762 |
+--- a/drivers/irqchip/irq-ingenic-tcu.c |
763 |
++++ b/drivers/irqchip/irq-ingenic-tcu.c |
764 |
+@@ -179,4 +179,5 @@ err_free_tcu: |
765 |
+ } |
766 |
+ IRQCHIP_DECLARE(jz4740_tcu_irq, "ingenic,jz4740-tcu", ingenic_tcu_irq_init); |
767 |
+ IRQCHIP_DECLARE(jz4725b_tcu_irq, "ingenic,jz4725b-tcu", ingenic_tcu_irq_init); |
768 |
++IRQCHIP_DECLARE(jz4760_tcu_irq, "ingenic,jz4760-tcu", ingenic_tcu_irq_init); |
769 |
+ IRQCHIP_DECLARE(jz4770_tcu_irq, "ingenic,jz4770-tcu", ingenic_tcu_irq_init); |
770 |
+diff --git a/drivers/irqchip/irq-ingenic.c b/drivers/irqchip/irq-ingenic.c |
771 |
+index dda512dfe2c17..31bc11f15bfa4 100644 |
772 |
+--- a/drivers/irqchip/irq-ingenic.c |
773 |
++++ b/drivers/irqchip/irq-ingenic.c |
774 |
+@@ -168,6 +168,7 @@ static int __init intc_2chip_of_init(struct device_node *node, |
775 |
+ { |
776 |
+ return ingenic_intc_of_init(node, 2); |
777 |
+ } |
778 |
++IRQCHIP_DECLARE(jz4760_intc, "ingenic,jz4760-intc", intc_2chip_of_init); |
779 |
+ IRQCHIP_DECLARE(jz4770_intc, "ingenic,jz4770-intc", intc_2chip_of_init); |
780 |
+ IRQCHIP_DECLARE(jz4775_intc, "ingenic,jz4775-intc", intc_2chip_of_init); |
781 |
+ IRQCHIP_DECLARE(jz4780_intc, "ingenic,jz4780-intc", intc_2chip_of_init); |
782 |
+diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c |
783 |
+index 1c5133f71af39..3f15d8dc2b71f 100644 |
784 |
+--- a/drivers/md/dm-ioctl.c |
785 |
++++ b/drivers/md/dm-ioctl.c |
786 |
+@@ -529,7 +529,7 @@ static int list_devices(struct file *filp, struct dm_ioctl *param, size_t param_ |
787 |
+ * Grab our output buffer. |
788 |
+ */ |
789 |
+ nl = orig_nl = get_result_buffer(param, param_size, &len); |
790 |
+- if (len < needed) { |
791 |
++ if (len < needed || len < sizeof(nl->dev)) { |
792 |
+ param->flags |= DM_BUFFER_FULL_FLAG; |
793 |
+ goto out; |
794 |
+ } |
795 |
+diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c |
796 |
+index 2aeb922e2365c..711f101447e3e 100644 |
797 |
+--- a/drivers/md/dm-verity-target.c |
798 |
++++ b/drivers/md/dm-verity-target.c |
799 |
+@@ -33,7 +33,7 @@ |
800 |
+ #define DM_VERITY_OPT_IGN_ZEROES "ignore_zero_blocks" |
801 |
+ #define DM_VERITY_OPT_AT_MOST_ONCE "check_at_most_once" |
802 |
+ |
803 |
+-#define DM_VERITY_OPTS_MAX (2 + DM_VERITY_OPTS_FEC + \ |
804 |
++#define DM_VERITY_OPTS_MAX (3 + DM_VERITY_OPTS_FEC + \ |
805 |
+ DM_VERITY_ROOT_HASH_VERIFICATION_OPTS) |
806 |
+ |
807 |
+ static unsigned dm_verity_prefetch_cluster = DM_VERITY_DEFAULT_PREFETCH_SIZE; |
808 |
+diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c |
809 |
+index 3486bf33474d9..e3d943c65419b 100644 |
810 |
+--- a/drivers/misc/habanalabs/device.c |
811 |
++++ b/drivers/misc/habanalabs/device.c |
812 |
+@@ -108,6 +108,8 @@ static int hl_device_release_ctrl(struct inode *inode, struct file *filp) |
813 |
+ list_del(&hpriv->dev_node); |
814 |
+ mutex_unlock(&hdev->fpriv_list_lock); |
815 |
+ |
816 |
++ put_pid(hpriv->taskpid); |
817 |
++ |
818 |
+ kfree(hpriv); |
819 |
+ |
820 |
+ return 0; |
821 |
+diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c |
822 |
+index 8e9f5620c9a21..f14e739ba3f45 100644 |
823 |
+--- a/drivers/net/can/c_can/c_can.c |
824 |
++++ b/drivers/net/can/c_can/c_can.c |
825 |
+@@ -212,18 +212,6 @@ static const struct can_bittiming_const c_can_bittiming_const = { |
826 |
+ .brp_inc = 1, |
827 |
+ }; |
828 |
+ |
829 |
+-static inline void c_can_pm_runtime_enable(const struct c_can_priv *priv) |
830 |
+-{ |
831 |
+- if (priv->device) |
832 |
+- pm_runtime_enable(priv->device); |
833 |
+-} |
834 |
+- |
835 |
+-static inline void c_can_pm_runtime_disable(const struct c_can_priv *priv) |
836 |
+-{ |
837 |
+- if (priv->device) |
838 |
+- pm_runtime_disable(priv->device); |
839 |
+-} |
840 |
+- |
841 |
+ static inline void c_can_pm_runtime_get_sync(const struct c_can_priv *priv) |
842 |
+ { |
843 |
+ if (priv->device) |
844 |
+@@ -1334,7 +1322,6 @@ static const struct net_device_ops c_can_netdev_ops = { |
845 |
+ |
846 |
+ int register_c_can_dev(struct net_device *dev) |
847 |
+ { |
848 |
+- struct c_can_priv *priv = netdev_priv(dev); |
849 |
+ int err; |
850 |
+ |
851 |
+ /* Deactivate pins to prevent DRA7 DCAN IP from being |
852 |
+@@ -1344,28 +1331,19 @@ int register_c_can_dev(struct net_device *dev) |
853 |
+ */ |
854 |
+ pinctrl_pm_select_sleep_state(dev->dev.parent); |
855 |
+ |
856 |
+- c_can_pm_runtime_enable(priv); |
857 |
+- |
858 |
+ dev->flags |= IFF_ECHO; /* we support local echo */ |
859 |
+ dev->netdev_ops = &c_can_netdev_ops; |
860 |
+ |
861 |
+ err = register_candev(dev); |
862 |
+- if (err) |
863 |
+- c_can_pm_runtime_disable(priv); |
864 |
+- else |
865 |
++ if (!err) |
866 |
+ devm_can_led_init(dev); |
867 |
+- |
868 |
+ return err; |
869 |
+ } |
870 |
+ EXPORT_SYMBOL_GPL(register_c_can_dev); |
871 |
+ |
872 |
+ void unregister_c_can_dev(struct net_device *dev) |
873 |
+ { |
874 |
+- struct c_can_priv *priv = netdev_priv(dev); |
875 |
+- |
876 |
+ unregister_candev(dev); |
877 |
+- |
878 |
+- c_can_pm_runtime_disable(priv); |
879 |
+ } |
880 |
+ EXPORT_SYMBOL_GPL(unregister_c_can_dev); |
881 |
+ |
882 |
+diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c |
883 |
+index 406b4847e5dc3..7efb60b508762 100644 |
884 |
+--- a/drivers/net/can/c_can/c_can_pci.c |
885 |
++++ b/drivers/net/can/c_can/c_can_pci.c |
886 |
+@@ -239,12 +239,13 @@ static void c_can_pci_remove(struct pci_dev *pdev) |
887 |
+ { |
888 |
+ struct net_device *dev = pci_get_drvdata(pdev); |
889 |
+ struct c_can_priv *priv = netdev_priv(dev); |
890 |
++ void __iomem *addr = priv->base; |
891 |
+ |
892 |
+ unregister_c_can_dev(dev); |
893 |
+ |
894 |
+ free_c_can_dev(dev); |
895 |
+ |
896 |
+- pci_iounmap(pdev, priv->base); |
897 |
++ pci_iounmap(pdev, addr); |
898 |
+ pci_disable_msi(pdev); |
899 |
+ pci_clear_master(pdev); |
900 |
+ pci_release_regions(pdev); |
901 |
+diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c |
902 |
+index b5145a7f874c2..f2b0408ce87d1 100644 |
903 |
+--- a/drivers/net/can/c_can/c_can_platform.c |
904 |
++++ b/drivers/net/can/c_can/c_can_platform.c |
905 |
+@@ -29,6 +29,7 @@ |
906 |
+ #include <linux/list.h> |
907 |
+ #include <linux/io.h> |
908 |
+ #include <linux/platform_device.h> |
909 |
++#include <linux/pm_runtime.h> |
910 |
+ #include <linux/clk.h> |
911 |
+ #include <linux/of.h> |
912 |
+ #include <linux/of_device.h> |
913 |
+@@ -385,6 +386,7 @@ static int c_can_plat_probe(struct platform_device *pdev) |
914 |
+ platform_set_drvdata(pdev, dev); |
915 |
+ SET_NETDEV_DEV(dev, &pdev->dev); |
916 |
+ |
917 |
++ pm_runtime_enable(priv->device); |
918 |
+ ret = register_c_can_dev(dev); |
919 |
+ if (ret) { |
920 |
+ dev_err(&pdev->dev, "registering %s failed (err=%d)\n", |
921 |
+@@ -397,6 +399,7 @@ static int c_can_plat_probe(struct platform_device *pdev) |
922 |
+ return 0; |
923 |
+ |
924 |
+ exit_free_device: |
925 |
++ pm_runtime_disable(priv->device); |
926 |
+ free_c_can_dev(dev); |
927 |
+ exit: |
928 |
+ dev_err(&pdev->dev, "probe failed\n"); |
929 |
+@@ -407,9 +410,10 @@ exit: |
930 |
+ static int c_can_plat_remove(struct platform_device *pdev) |
931 |
+ { |
932 |
+ struct net_device *dev = platform_get_drvdata(pdev); |
933 |
++ struct c_can_priv *priv = netdev_priv(dev); |
934 |
+ |
935 |
+ unregister_c_can_dev(dev); |
936 |
+- |
937 |
++ pm_runtime_disable(priv->device); |
938 |
+ free_c_can_dev(dev); |
939 |
+ |
940 |
+ return 0; |
941 |
+diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c |
942 |
+index 2ae9feb99a07d..1e0c1a05df82d 100644 |
943 |
+--- a/drivers/net/can/dev.c |
944 |
++++ b/drivers/net/can/dev.c |
945 |
+@@ -1226,6 +1226,7 @@ static void can_dellink(struct net_device *dev, struct list_head *head) |
946 |
+ |
947 |
+ static struct rtnl_link_ops can_link_ops __read_mostly = { |
948 |
+ .kind = "can", |
949 |
++ .netns_refund = true, |
950 |
+ .maxtype = IFLA_CAN_MAX, |
951 |
+ .policy = can_policy, |
952 |
+ .setup = can_setup, |
953 |
+diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c |
954 |
+index b6d00dfa8b8f6..7ec15cb356c01 100644 |
955 |
+--- a/drivers/net/can/flexcan.c |
956 |
++++ b/drivers/net/can/flexcan.c |
957 |
+@@ -544,9 +544,15 @@ static int flexcan_chip_disable(struct flexcan_priv *priv) |
958 |
+ static int flexcan_chip_freeze(struct flexcan_priv *priv) |
959 |
+ { |
960 |
+ struct flexcan_regs __iomem *regs = priv->regs; |
961 |
+- unsigned int timeout = 1000 * 1000 * 10 / priv->can.bittiming.bitrate; |
962 |
++ unsigned int timeout; |
963 |
++ u32 bitrate = priv->can.bittiming.bitrate; |
964 |
+ u32 reg; |
965 |
+ |
966 |
++ if (bitrate) |
967 |
++ timeout = 1000 * 1000 * 10 / bitrate; |
968 |
++ else |
969 |
++ timeout = FLEXCAN_TIMEOUT_US / 10; |
970 |
++ |
971 |
+ reg = priv->read(®s->mcr); |
972 |
+ reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT; |
973 |
+ priv->write(reg, ®s->mcr); |
974 |
+diff --git a/drivers/net/can/kvaser_pciefd.c b/drivers/net/can/kvaser_pciefd.c |
975 |
+index 72acd1ba162d2..e7a26ec9bdc11 100644 |
976 |
+--- a/drivers/net/can/kvaser_pciefd.c |
977 |
++++ b/drivers/net/can/kvaser_pciefd.c |
978 |
+@@ -57,6 +57,7 @@ MODULE_DESCRIPTION("CAN driver for Kvaser CAN/PCIe devices"); |
979 |
+ #define KVASER_PCIEFD_KCAN_STAT_REG 0x418 |
980 |
+ #define KVASER_PCIEFD_KCAN_MODE_REG 0x41c |
981 |
+ #define KVASER_PCIEFD_KCAN_BTRN_REG 0x420 |
982 |
++#define KVASER_PCIEFD_KCAN_BUS_LOAD_REG 0x424 |
983 |
+ #define KVASER_PCIEFD_KCAN_BTRD_REG 0x428 |
984 |
+ #define KVASER_PCIEFD_KCAN_PWM_REG 0x430 |
985 |
+ /* Loopback control register */ |
986 |
+@@ -947,6 +948,9 @@ static int kvaser_pciefd_setup_can_ctrls(struct kvaser_pciefd *pcie) |
987 |
+ timer_setup(&can->bec_poll_timer, kvaser_pciefd_bec_poll_timer, |
988 |
+ 0); |
989 |
+ |
990 |
++ /* Disable Bus load reporting */ |
991 |
++ iowrite32(0, can->reg_base + KVASER_PCIEFD_KCAN_BUS_LOAD_REG); |
992 |
++ |
993 |
+ tx_npackets = ioread32(can->reg_base + |
994 |
+ KVASER_PCIEFD_KCAN_TX_NPACKETS_REG); |
995 |
+ if (((tx_npackets >> KVASER_PCIEFD_KCAN_TX_NPACKETS_MAX_SHIFT) & |
996 |
+diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c |
997 |
+index 8a842545e3f69..b2224113987c7 100644 |
998 |
+--- a/drivers/net/can/m_can/m_can.c |
999 |
++++ b/drivers/net/can/m_can/m_can.c |
1000 |
+@@ -501,9 +501,6 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota) |
1001 |
+ } |
1002 |
+ |
1003 |
+ while ((rxfs & RXFS_FFL_MASK) && (quota > 0)) { |
1004 |
+- if (rxfs & RXFS_RFL) |
1005 |
+- netdev_warn(dev, "Rx FIFO 0 Message Lost\n"); |
1006 |
+- |
1007 |
+ m_can_read_fifo(dev, rxfs); |
1008 |
+ |
1009 |
+ quota--; |
1010 |
+@@ -842,7 +839,7 @@ static int m_can_rx_peripheral(struct net_device *dev) |
1011 |
+ { |
1012 |
+ struct m_can_classdev *cdev = netdev_priv(dev); |
1013 |
+ |
1014 |
+- m_can_rx_handler(dev, 1); |
1015 |
++ m_can_rx_handler(dev, M_CAN_NAPI_WEIGHT); |
1016 |
+ |
1017 |
+ m_can_enable_all_interrupts(cdev); |
1018 |
+ |
1019 |
+diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c |
1020 |
+index f35757b63ea78..e78b683f73052 100644 |
1021 |
+--- a/drivers/net/dsa/b53/b53_common.c |
1022 |
++++ b/drivers/net/dsa/b53/b53_common.c |
1023 |
+@@ -996,13 +996,6 @@ static int b53_setup(struct dsa_switch *ds) |
1024 |
+ b53_disable_port(ds, port); |
1025 |
+ } |
1026 |
+ |
1027 |
+- /* Let DSA handle the case were multiple bridges span the same switch |
1028 |
+- * device and different VLAN awareness settings are requested, which |
1029 |
+- * would be breaking filtering semantics for any of the other bridge |
1030 |
+- * devices. (not hardware supported) |
1031 |
+- */ |
1032 |
+- ds->vlan_filtering_is_global = true; |
1033 |
+- |
1034 |
+ return ret; |
1035 |
+ } |
1036 |
+ |
1037 |
+@@ -2418,6 +2411,13 @@ struct b53_device *b53_switch_alloc(struct device *base, |
1038 |
+ dev->priv = priv; |
1039 |
+ dev->ops = ops; |
1040 |
+ ds->ops = &b53_switch_ops; |
1041 |
++ /* Let DSA handle the case were multiple bridges span the same switch |
1042 |
++ * device and different VLAN awareness settings are requested, which |
1043 |
++ * would be breaking filtering semantics for any of the other bridge |
1044 |
++ * devices. (not hardware supported) |
1045 |
++ */ |
1046 |
++ ds->vlan_filtering_is_global = true; |
1047 |
++ |
1048 |
+ mutex_init(&dev->reg_mutex); |
1049 |
+ mutex_init(&dev->stats_mutex); |
1050 |
+ |
1051 |
+diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c |
1052 |
+index ca425c15953b1..0ee1c0a7b165b 100644 |
1053 |
+--- a/drivers/net/dsa/bcm_sf2.c |
1054 |
++++ b/drivers/net/dsa/bcm_sf2.c |
1055 |
+@@ -479,8 +479,10 @@ static u32 bcm_sf2_sw_get_phy_flags(struct dsa_switch *ds, int port) |
1056 |
+ * in bits 15:8 and the patch level in bits 7:0 which is exactly what |
1057 |
+ * the REG_PHY_REVISION register layout is. |
1058 |
+ */ |
1059 |
+- |
1060 |
+- return priv->hw_params.gphy_rev; |
1061 |
++ if (priv->int_phy_mask & BIT(port)) |
1062 |
++ return priv->hw_params.gphy_rev; |
1063 |
++ else |
1064 |
++ return 0; |
1065 |
+ } |
1066 |
+ |
1067 |
+ static void bcm_sf2_sw_validate(struct dsa_switch *ds, int port, |
1068 |
+diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c |
1069 |
+index 0928bec79fe4b..4b958681d66e7 100644 |
1070 |
+--- a/drivers/net/ethernet/davicom/dm9000.c |
1071 |
++++ b/drivers/net/ethernet/davicom/dm9000.c |
1072 |
+@@ -1512,7 +1512,7 @@ dm9000_probe(struct platform_device *pdev) |
1073 |
+ goto out; |
1074 |
+ } |
1075 |
+ |
1076 |
+- db->irq_wake = platform_get_irq(pdev, 1); |
1077 |
++ db->irq_wake = platform_get_irq_optional(pdev, 1); |
1078 |
+ if (db->irq_wake >= 0) { |
1079 |
+ dev_dbg(db->dev, "wakeup irq %d\n", db->irq_wake); |
1080 |
+ |
1081 |
+diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c |
1082 |
+index 1aea22d2540fb..4050f81f788c3 100644 |
1083 |
+--- a/drivers/net/ethernet/faraday/ftgmac100.c |
1084 |
++++ b/drivers/net/ethernet/faraday/ftgmac100.c |
1085 |
+@@ -1307,6 +1307,7 @@ static int ftgmac100_poll(struct napi_struct *napi, int budget) |
1086 |
+ */ |
1087 |
+ if (unlikely(priv->need_mac_restart)) { |
1088 |
+ ftgmac100_start_hw(priv); |
1089 |
++ priv->need_mac_restart = false; |
1090 |
+ |
1091 |
+ /* Re-enable "bad" interrupts */ |
1092 |
+ iowrite32(FTGMAC100_INT_BAD, |
1093 |
+diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c |
1094 |
+index 945643c026155..49fad118988bc 100644 |
1095 |
+--- a/drivers/net/ethernet/freescale/fec_ptp.c |
1096 |
++++ b/drivers/net/ethernet/freescale/fec_ptp.c |
1097 |
+@@ -382,9 +382,16 @@ static int fec_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) |
1098 |
+ u64 ns; |
1099 |
+ unsigned long flags; |
1100 |
+ |
1101 |
++ mutex_lock(&adapter->ptp_clk_mutex); |
1102 |
++ /* Check the ptp clock */ |
1103 |
++ if (!adapter->ptp_clk_on) { |
1104 |
++ mutex_unlock(&adapter->ptp_clk_mutex); |
1105 |
++ return -EINVAL; |
1106 |
++ } |
1107 |
+ spin_lock_irqsave(&adapter->tmreg_lock, flags); |
1108 |
+ ns = timecounter_read(&adapter->tc); |
1109 |
+ spin_unlock_irqrestore(&adapter->tmreg_lock, flags); |
1110 |
++ mutex_unlock(&adapter->ptp_clk_mutex); |
1111 |
+ |
1112 |
+ *ts = ns_to_timespec64(ns); |
1113 |
+ |
1114 |
+diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c |
1115 |
+index 5cb58ab1eec97..a8959a092344f 100644 |
1116 |
+--- a/drivers/net/ethernet/freescale/gianfar.c |
1117 |
++++ b/drivers/net/ethernet/freescale/gianfar.c |
1118 |
+@@ -2388,6 +2388,10 @@ static bool gfar_add_rx_frag(struct gfar_rx_buff *rxb, u32 lstatus, |
1119 |
+ if (lstatus & BD_LFLAG(RXBD_LAST)) |
1120 |
+ size -= skb->len; |
1121 |
+ |
1122 |
++ WARN(size < 0, "gianfar: rx fragment size underflow"); |
1123 |
++ if (size < 0) |
1124 |
++ return false; |
1125 |
++ |
1126 |
+ skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, |
1127 |
+ rxb->page_offset + RXBUF_ALIGNMENT, |
1128 |
+ size, GFAR_RXB_TRUESIZE); |
1129 |
+@@ -2550,6 +2554,17 @@ static int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, |
1130 |
+ if (lstatus & BD_LFLAG(RXBD_EMPTY)) |
1131 |
+ break; |
1132 |
+ |
1133 |
++ /* lost RXBD_LAST descriptor due to overrun */ |
1134 |
++ if (skb && |
1135 |
++ (lstatus & BD_LFLAG(RXBD_FIRST))) { |
1136 |
++ /* discard faulty buffer */ |
1137 |
++ dev_kfree_skb(skb); |
1138 |
++ skb = NULL; |
1139 |
++ rx_queue->stats.rx_dropped++; |
1140 |
++ |
1141 |
++ /* can continue normally */ |
1142 |
++ } |
1143 |
++ |
1144 |
+ /* order rx buffer descriptor reads */ |
1145 |
+ rmb(); |
1146 |
+ |
1147 |
+diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c |
1148 |
+index 6d5d53cfc7ab4..7516f68230900 100644 |
1149 |
+--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c |
1150 |
++++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c |
1151 |
+@@ -1677,8 +1677,10 @@ static int hns_nic_clear_all_rx_fetch(struct net_device *ndev) |
1152 |
+ for (j = 0; j < fetch_num; j++) { |
1153 |
+ /* alloc one skb and init */ |
1154 |
+ skb = hns_assemble_skb(ndev); |
1155 |
+- if (!skb) |
1156 |
++ if (!skb) { |
1157 |
++ ret = -ENOMEM; |
1158 |
+ goto out; |
1159 |
++ } |
1160 |
+ rd = &tx_ring_data(priv, skb->queue_mapping); |
1161 |
+ hns_nic_net_xmit_hw(ndev, skb, rd); |
1162 |
+ |
1163 |
+diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c |
1164 |
+index 2c1bab377b2a5..1fd4406173a87 100644 |
1165 |
+--- a/drivers/net/ethernet/intel/e1000e/82571.c |
1166 |
++++ b/drivers/net/ethernet/intel/e1000e/82571.c |
1167 |
+@@ -899,6 +899,8 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active) |
1168 |
+ } else { |
1169 |
+ data &= ~IGP02E1000_PM_D0_LPLU; |
1170 |
+ ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data); |
1171 |
++ if (ret_val) |
1172 |
++ return ret_val; |
1173 |
+ /* LPLU and SmartSpeed are mutually exclusive. LPLU is used |
1174 |
+ * during Dx states where the power conservation is most |
1175 |
+ * important. During driver activity we should enable |
1176 |
+diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c |
1177 |
+index 4cb05a31e66df..c2feedfd321dc 100644 |
1178 |
+--- a/drivers/net/ethernet/intel/e1000e/netdev.c |
1179 |
++++ b/drivers/net/ethernet/intel/e1000e/netdev.c |
1180 |
+@@ -5953,15 +5953,19 @@ static void e1000_reset_task(struct work_struct *work) |
1181 |
+ struct e1000_adapter *adapter; |
1182 |
+ adapter = container_of(work, struct e1000_adapter, reset_task); |
1183 |
+ |
1184 |
++ rtnl_lock(); |
1185 |
+ /* don't run the task if already down */ |
1186 |
+- if (test_bit(__E1000_DOWN, &adapter->state)) |
1187 |
++ if (test_bit(__E1000_DOWN, &adapter->state)) { |
1188 |
++ rtnl_unlock(); |
1189 |
+ return; |
1190 |
++ } |
1191 |
+ |
1192 |
+ if (!(adapter->flags & FLAG_RESTART_NOW)) { |
1193 |
+ e1000e_dump(adapter); |
1194 |
+ e_err("Reset adapter unexpectedly\n"); |
1195 |
+ } |
1196 |
+ e1000e_reinit_locked(adapter); |
1197 |
++ rtnl_unlock(); |
1198 |
+ } |
1199 |
+ |
1200 |
+ /** |
1201 |
+diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c |
1202 |
+index 56e6bec9af797..cffc8c1044f20 100644 |
1203 |
+--- a/drivers/net/ethernet/intel/iavf/iavf_main.c |
1204 |
++++ b/drivers/net/ethernet/intel/iavf/iavf_main.c |
1205 |
+@@ -1786,7 +1786,8 @@ static int iavf_init_get_resources(struct iavf_adapter *adapter) |
1206 |
+ goto err_alloc; |
1207 |
+ } |
1208 |
+ |
1209 |
+- if (iavf_process_config(adapter)) |
1210 |
++ err = iavf_process_config(adapter); |
1211 |
++ if (err) |
1212 |
+ goto err_alloc; |
1213 |
+ adapter->current_op = VIRTCHNL_OP_UNKNOWN; |
1214 |
+ |
1215 |
+diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c |
1216 |
+index 0365bf2b480e3..cbcb8611ab50d 100644 |
1217 |
+--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c |
1218 |
++++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c |
1219 |
+@@ -1690,6 +1690,9 @@ static int igc_get_link_ksettings(struct net_device *netdev, |
1220 |
+ Autoneg); |
1221 |
+ } |
1222 |
+ |
1223 |
++ /* Set pause flow control settings */ |
1224 |
++ ethtool_link_ksettings_add_link_mode(cmd, supported, Pause); |
1225 |
++ |
1226 |
+ switch (hw->fc.requested_mode) { |
1227 |
+ case igc_fc_full: |
1228 |
+ ethtool_link_ksettings_add_link_mode(cmd, advertising, Pause); |
1229 |
+@@ -1704,9 +1707,7 @@ static int igc_get_link_ksettings(struct net_device *netdev, |
1230 |
+ Asym_Pause); |
1231 |
+ break; |
1232 |
+ default: |
1233 |
+- ethtool_link_ksettings_add_link_mode(cmd, advertising, Pause); |
1234 |
+- ethtool_link_ksettings_add_link_mode(cmd, advertising, |
1235 |
+- Asym_Pause); |
1236 |
++ break; |
1237 |
+ } |
1238 |
+ |
1239 |
+ status = pm_runtime_suspended(&adapter->pdev->dev) ? |
1240 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1241 |
+index f605540644035..1b8e70585c44a 100644 |
1242 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1243 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1244 |
+@@ -9595,8 +9595,10 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter, |
1245 |
+ ixgbe_atr_compute_perfect_hash_82599(&input->filter, mask); |
1246 |
+ err = ixgbe_fdir_write_perfect_filter_82599(hw, &input->filter, |
1247 |
+ input->sw_idx, queue); |
1248 |
+- if (!err) |
1249 |
+- ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx); |
1250 |
++ if (err) |
1251 |
++ goto err_out_w_lock; |
1252 |
++ |
1253 |
++ ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx); |
1254 |
+ spin_unlock(&adapter->fdir_perfect_lock); |
1255 |
+ |
1256 |
+ if ((uhtid != 0x800) && (adapter->jump_tables[uhtid])) |
1257 |
+diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c |
1258 |
+index e581091c09c4e..02b4620f7368a 100644 |
1259 |
+--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c |
1260 |
++++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c |
1261 |
+@@ -1980,8 +1980,10 @@ static void rvu_unregister_interrupts(struct rvu *rvu) |
1262 |
+ INTR_MASK(rvu->hw->total_pfs) & ~1ULL); |
1263 |
+ |
1264 |
+ for (irq = 0; irq < rvu->num_vec; irq++) { |
1265 |
+- if (rvu->irq_allocated[irq]) |
1266 |
++ if (rvu->irq_allocated[irq]) { |
1267 |
+ free_irq(pci_irq_vector(rvu->pdev, irq), rvu); |
1268 |
++ rvu->irq_allocated[irq] = false; |
1269 |
++ } |
1270 |
+ } |
1271 |
+ |
1272 |
+ pci_free_irq_vectors(rvu->pdev); |
1273 |
+diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c |
1274 |
+index 15f70273e29c7..d82a519a0cd9a 100644 |
1275 |
+--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c |
1276 |
++++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c |
1277 |
+@@ -1967,10 +1967,10 @@ int rvu_mbox_handler_npc_mcam_free_counter(struct rvu *rvu, |
1278 |
+ index = find_next_bit(mcam->bmap, mcam->bmap_entries, entry); |
1279 |
+ if (index >= mcam->bmap_entries) |
1280 |
+ break; |
1281 |
++ entry = index + 1; |
1282 |
+ if (mcam->entry2cntr_map[index] != req->cntr) |
1283 |
+ continue; |
1284 |
+ |
1285 |
+- entry = index + 1; |
1286 |
+ npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr, |
1287 |
+ index, req->cntr); |
1288 |
+ } |
1289 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c |
1290 |
+index 951ea26d96bc3..6d27f69cc7fc9 100644 |
1291 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c |
1292 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_geneve.c |
1293 |
+@@ -227,6 +227,10 @@ static int mlx5e_tc_tun_parse_geneve_options(struct mlx5e_priv *priv, |
1294 |
+ option_key = (struct geneve_opt *)&enc_opts.key->data[0]; |
1295 |
+ option_mask = (struct geneve_opt *)&enc_opts.mask->data[0]; |
1296 |
+ |
1297 |
++ if (option_mask->opt_class == 0 && option_mask->type == 0 && |
1298 |
++ !memchr_inv(option_mask->opt_data, 0, option_mask->length * 4)) |
1299 |
++ return 0; |
1300 |
++ |
1301 |
+ if (option_key->length > max_tlv_option_data_len) { |
1302 |
+ NL_SET_ERR_MSG_MOD(extack, |
1303 |
+ "Matching on GENEVE options: unsupported option len"); |
1304 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c |
1305 |
+index 01089c2283d7f..e09b4a96a1d5f 100644 |
1306 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c |
1307 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c |
1308 |
+@@ -1811,6 +1811,7 @@ static int set_pflag_rx_cqe_compress(struct net_device *netdev, |
1309 |
+ { |
1310 |
+ struct mlx5e_priv *priv = netdev_priv(netdev); |
1311 |
+ struct mlx5_core_dev *mdev = priv->mdev; |
1312 |
++ int err; |
1313 |
+ |
1314 |
+ if (!MLX5_CAP_GEN(mdev, cqe_compression)) |
1315 |
+ return -EOPNOTSUPP; |
1316 |
+@@ -1820,7 +1821,10 @@ static int set_pflag_rx_cqe_compress(struct net_device *netdev, |
1317 |
+ return -EINVAL; |
1318 |
+ } |
1319 |
+ |
1320 |
+- mlx5e_modify_rx_cqe_compression_locked(priv, enable); |
1321 |
++ err = mlx5e_modify_rx_cqe_compression_locked(priv, enable); |
1322 |
++ if (err) |
1323 |
++ return err; |
1324 |
++ |
1325 |
+ priv->channels.params.rx_cqe_compress_def = enable; |
1326 |
+ |
1327 |
+ return 0; |
1328 |
+diff --git a/drivers/net/ethernet/netronome/nfp/flower/metadata.c b/drivers/net/ethernet/netronome/nfp/flower/metadata.c |
1329 |
+index 5defd31d481c2..aa06fcb38f8b9 100644 |
1330 |
+--- a/drivers/net/ethernet/netronome/nfp/flower/metadata.c |
1331 |
++++ b/drivers/net/ethernet/netronome/nfp/flower/metadata.c |
1332 |
+@@ -327,8 +327,14 @@ int nfp_compile_flow_metadata(struct nfp_app *app, |
1333 |
+ goto err_free_ctx_entry; |
1334 |
+ } |
1335 |
+ |
1336 |
++ /* Do net allocate a mask-id for pre_tun_rules. These flows are used to |
1337 |
++ * configure the pre_tun table and are never actually send to the |
1338 |
++ * firmware as an add-flow message. This causes the mask-id allocation |
1339 |
++ * on the firmware to get out of sync if allocated here. |
1340 |
++ */ |
1341 |
+ new_mask_id = 0; |
1342 |
+- if (!nfp_check_mask_add(app, nfp_flow->mask_data, |
1343 |
++ if (!nfp_flow->pre_tun_rule.dev && |
1344 |
++ !nfp_check_mask_add(app, nfp_flow->mask_data, |
1345 |
+ nfp_flow->meta.mask_len, |
1346 |
+ &nfp_flow->meta.flags, &new_mask_id)) { |
1347 |
+ NL_SET_ERR_MSG_MOD(extack, "invalid entry: cannot allocate a new mask id"); |
1348 |
+@@ -359,7 +365,8 @@ int nfp_compile_flow_metadata(struct nfp_app *app, |
1349 |
+ goto err_remove_mask; |
1350 |
+ } |
1351 |
+ |
1352 |
+- if (!nfp_check_mask_remove(app, nfp_flow->mask_data, |
1353 |
++ if (!nfp_flow->pre_tun_rule.dev && |
1354 |
++ !nfp_check_mask_remove(app, nfp_flow->mask_data, |
1355 |
+ nfp_flow->meta.mask_len, |
1356 |
+ NULL, &new_mask_id)) { |
1357 |
+ NL_SET_ERR_MSG_MOD(extack, "invalid entry: cannot release mask id"); |
1358 |
+@@ -374,8 +381,10 @@ int nfp_compile_flow_metadata(struct nfp_app *app, |
1359 |
+ return 0; |
1360 |
+ |
1361 |
+ err_remove_mask: |
1362 |
+- nfp_check_mask_remove(app, nfp_flow->mask_data, nfp_flow->meta.mask_len, |
1363 |
+- NULL, &new_mask_id); |
1364 |
++ if (!nfp_flow->pre_tun_rule.dev) |
1365 |
++ nfp_check_mask_remove(app, nfp_flow->mask_data, |
1366 |
++ nfp_flow->meta.mask_len, |
1367 |
++ NULL, &new_mask_id); |
1368 |
+ err_remove_rhash: |
1369 |
+ WARN_ON_ONCE(rhashtable_remove_fast(&priv->stats_ctx_table, |
1370 |
+ &ctx_entry->ht_node, |
1371 |
+@@ -406,9 +415,10 @@ int nfp_modify_flow_metadata(struct nfp_app *app, |
1372 |
+ |
1373 |
+ __nfp_modify_flow_metadata(priv, nfp_flow); |
1374 |
+ |
1375 |
+- nfp_check_mask_remove(app, nfp_flow->mask_data, |
1376 |
+- nfp_flow->meta.mask_len, &nfp_flow->meta.flags, |
1377 |
+- &new_mask_id); |
1378 |
++ if (!nfp_flow->pre_tun_rule.dev) |
1379 |
++ nfp_check_mask_remove(app, nfp_flow->mask_data, |
1380 |
++ nfp_flow->meta.mask_len, &nfp_flow->meta.flags, |
1381 |
++ &new_mask_id); |
1382 |
+ |
1383 |
+ /* Update flow payload with mask ids. */ |
1384 |
+ nfp_flow->unmasked_data[NFP_FL_MASK_ID_LOCATION] = new_mask_id; |
1385 |
+diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c |
1386 |
+index f34ae8c75bc5e..61a39d167c8bc 100644 |
1387 |
+--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c |
1388 |
++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c |
1389 |
+@@ -1426,6 +1426,7 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter) |
1390 |
+ |
1391 |
+ if (fw_dump->tmpl_hdr == NULL || current_version > prev_version) { |
1392 |
+ vfree(fw_dump->tmpl_hdr); |
1393 |
++ fw_dump->tmpl_hdr = NULL; |
1394 |
+ |
1395 |
+ if (qlcnic_83xx_md_check_extended_dump_capability(adapter)) |
1396 |
+ extended = !qlcnic_83xx_extend_md_capab(adapter); |
1397 |
+@@ -1444,6 +1445,8 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter) |
1398 |
+ struct qlcnic_83xx_dump_template_hdr *hdr; |
1399 |
+ |
1400 |
+ hdr = fw_dump->tmpl_hdr; |
1401 |
++ if (!hdr) |
1402 |
++ return; |
1403 |
+ hdr->drv_cap_mask = 0x1f; |
1404 |
+ fw_dump->cap_mask = 0x1f; |
1405 |
+ dev_info(&pdev->dev, |
1406 |
+diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c |
1407 |
+index 8bd2912bf713c..33d7c2940ba9d 100644 |
1408 |
+--- a/drivers/net/ethernet/socionext/netsec.c |
1409 |
++++ b/drivers/net/ethernet/socionext/netsec.c |
1410 |
+@@ -1693,14 +1693,17 @@ static int netsec_netdev_init(struct net_device *ndev) |
1411 |
+ goto err1; |
1412 |
+ |
1413 |
+ /* set phy power down */ |
1414 |
+- data = netsec_phy_read(priv->mii_bus, priv->phy_addr, MII_BMCR) | |
1415 |
+- BMCR_PDOWN; |
1416 |
+- netsec_phy_write(priv->mii_bus, priv->phy_addr, MII_BMCR, data); |
1417 |
++ data = netsec_phy_read(priv->mii_bus, priv->phy_addr, MII_BMCR); |
1418 |
++ netsec_phy_write(priv->mii_bus, priv->phy_addr, MII_BMCR, |
1419 |
++ data | BMCR_PDOWN); |
1420 |
+ |
1421 |
+ ret = netsec_reset_hardware(priv, true); |
1422 |
+ if (ret) |
1423 |
+ goto err2; |
1424 |
+ |
1425 |
++ /* Restore phy power state */ |
1426 |
++ netsec_phy_write(priv->mii_bus, priv->phy_addr, MII_BMCR, data); |
1427 |
++ |
1428 |
+ spin_lock_init(&priv->desc_ring[NETSEC_RING_TX].lock); |
1429 |
+ spin_lock_init(&priv->desc_ring[NETSEC_RING_RX].lock); |
1430 |
+ |
1431 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c |
1432 |
+index c4c9cbdeb601e..2f6258ca95155 100644 |
1433 |
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c |
1434 |
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c |
1435 |
+@@ -1206,6 +1206,8 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) |
1436 |
+ plat_dat->init = sun8i_dwmac_init; |
1437 |
+ plat_dat->exit = sun8i_dwmac_exit; |
1438 |
+ plat_dat->setup = sun8i_dwmac_setup; |
1439 |
++ plat_dat->tx_fifo_size = 4096; |
1440 |
++ plat_dat->rx_fifo_size = 16384; |
1441 |
+ |
1442 |
+ ret = sun8i_dwmac_init(pdev, plat_dat->bsp_priv); |
1443 |
+ if (ret) |
1444 |
+diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c |
1445 |
+index f5fd1f3c07cc5..2911740af7061 100644 |
1446 |
+--- a/drivers/net/ethernet/sun/niu.c |
1447 |
++++ b/drivers/net/ethernet/sun/niu.c |
1448 |
+@@ -3931,8 +3931,6 @@ static void niu_xmac_interrupt(struct niu *np) |
1449 |
+ mp->rx_mcasts += RXMAC_MC_FRM_CNT_COUNT; |
1450 |
+ if (val & XRXMAC_STATUS_RXBCAST_CNT_EXP) |
1451 |
+ mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT; |
1452 |
+- if (val & XRXMAC_STATUS_RXBCAST_CNT_EXP) |
1453 |
+- mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT; |
1454 |
+ if (val & XRXMAC_STATUS_RXHIST1_CNT_EXP) |
1455 |
+ mp->rx_hist_cnt1 += RXMAC_HIST_CNT1_COUNT; |
1456 |
+ if (val & XRXMAC_STATUS_RXHIST2_CNT_EXP) |
1457 |
+diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c |
1458 |
+index 0f8a924fc60c3..c6c1bb15557f4 100644 |
1459 |
+--- a/drivers/net/ethernet/tehuti/tehuti.c |
1460 |
++++ b/drivers/net/ethernet/tehuti/tehuti.c |
1461 |
+@@ -2052,6 +2052,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
1462 |
+ /*bdx_hw_reset(priv); */ |
1463 |
+ if (bdx_read_mac(priv)) { |
1464 |
+ pr_err("load MAC address failed\n"); |
1465 |
++ err = -EFAULT; |
1466 |
+ goto err_out_iomap; |
1467 |
+ } |
1468 |
+ SET_NETDEV_DEV(ndev, &pdev->dev); |
1469 |
+diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c |
1470 |
+index bcabd39d136ae..f778172356e68 100644 |
1471 |
+--- a/drivers/net/usb/cdc-phonet.c |
1472 |
++++ b/drivers/net/usb/cdc-phonet.c |
1473 |
+@@ -387,6 +387,8 @@ static int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *i |
1474 |
+ |
1475 |
+ err = register_netdev(dev); |
1476 |
+ if (err) { |
1477 |
++ /* Set disconnected flag so that disconnect() returns early. */ |
1478 |
++ pnd->disconnected = 1; |
1479 |
+ usb_driver_release_interface(&usbpn_driver, data_intf); |
1480 |
+ goto out; |
1481 |
+ } |
1482 |
+diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c |
1483 |
+index 22f093797f417..f6d643ecaf39b 100644 |
1484 |
+--- a/drivers/net/usb/r8152.c |
1485 |
++++ b/drivers/net/usb/r8152.c |
1486 |
+@@ -2836,29 +2836,6 @@ static void __rtl_set_wol(struct r8152 *tp, u32 wolopts) |
1487 |
+ device_set_wakeup_enable(&tp->udev->dev, false); |
1488 |
+ } |
1489 |
+ |
1490 |
+-static void r8153_mac_clk_spd(struct r8152 *tp, bool enable) |
1491 |
+-{ |
1492 |
+- /* MAC clock speed down */ |
1493 |
+- if (enable) { |
1494 |
+- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, |
1495 |
+- ALDPS_SPDWN_RATIO); |
1496 |
+- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, |
1497 |
+- EEE_SPDWN_RATIO); |
1498 |
+- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, |
1499 |
+- PKT_AVAIL_SPDWN_EN | SUSPEND_SPDWN_EN | |
1500 |
+- U1U2_SPDWN_EN | L1_SPDWN_EN); |
1501 |
+- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, |
1502 |
+- PWRSAVE_SPDWN_EN | RXDV_SPDWN_EN | TX10MIDLE_EN | |
1503 |
+- TP100_SPDWN_EN | TP500_SPDWN_EN | EEE_SPDWN_EN | |
1504 |
+- TP1000_SPDWN_EN); |
1505 |
+- } else { |
1506 |
+- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0); |
1507 |
+- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, 0); |
1508 |
+- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, 0); |
1509 |
+- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, 0); |
1510 |
+- } |
1511 |
+-} |
1512 |
+- |
1513 |
+ static void r8153_u1u2en(struct r8152 *tp, bool enable) |
1514 |
+ { |
1515 |
+ u8 u1u2[8]; |
1516 |
+@@ -3158,11 +3135,9 @@ static void rtl8153_runtime_enable(struct r8152 *tp, bool enable) |
1517 |
+ if (enable) { |
1518 |
+ r8153_u1u2en(tp, false); |
1519 |
+ r8153_u2p3en(tp, false); |
1520 |
+- r8153_mac_clk_spd(tp, true); |
1521 |
+ rtl_runtime_suspend_enable(tp, true); |
1522 |
+ } else { |
1523 |
+ rtl_runtime_suspend_enable(tp, false); |
1524 |
+- r8153_mac_clk_spd(tp, false); |
1525 |
+ |
1526 |
+ switch (tp->version) { |
1527 |
+ case RTL_VER_03: |
1528 |
+@@ -3727,7 +3702,6 @@ static void r8153_first_init(struct r8152 *tp) |
1529 |
+ u32 ocp_data; |
1530 |
+ int i; |
1531 |
+ |
1532 |
+- r8153_mac_clk_spd(tp, false); |
1533 |
+ rxdy_gated_en(tp, true); |
1534 |
+ r8153_teredo_off(tp); |
1535 |
+ |
1536 |
+@@ -3789,8 +3763,6 @@ static void r8153_enter_oob(struct r8152 *tp) |
1537 |
+ u32 ocp_data; |
1538 |
+ int i; |
1539 |
+ |
1540 |
+- r8153_mac_clk_spd(tp, true); |
1541 |
+- |
1542 |
+ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL); |
1543 |
+ ocp_data &= ~NOW_IS_OOB; |
1544 |
+ ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data); |
1545 |
+@@ -4498,9 +4470,14 @@ static void r8153_init(struct r8152 *tp) |
1546 |
+ |
1547 |
+ ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001); |
1548 |
+ |
1549 |
++ /* MAC clock speed down */ |
1550 |
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0); |
1551 |
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, 0); |
1552 |
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, 0); |
1553 |
++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, 0); |
1554 |
++ |
1555 |
+ r8153_power_cut_en(tp, false); |
1556 |
+ r8153_u1u2en(tp, true); |
1557 |
+- r8153_mac_clk_spd(tp, false); |
1558 |
+ usb_enable_lpm(tp->udev); |
1559 |
+ |
1560 |
+ ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_CONFIG6); |
1561 |
+@@ -5552,7 +5529,10 @@ static int rtl_ops_init(struct r8152 *tp) |
1562 |
+ ops->in_nway = rtl8153_in_nway; |
1563 |
+ ops->hw_phy_cfg = r8153_hw_phy_cfg; |
1564 |
+ ops->autosuspend_en = rtl8153_runtime_enable; |
1565 |
+- tp->rx_buf_sz = 32 * 1024; |
1566 |
++ if (tp->udev->speed < USB_SPEED_SUPER) |
1567 |
++ tp->rx_buf_sz = 16 * 1024; |
1568 |
++ else |
1569 |
++ tp->rx_buf_sz = 32 * 1024; |
1570 |
+ tp->eee_en = true; |
1571 |
+ tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX; |
1572 |
+ break; |
1573 |
+diff --git a/drivers/net/veth.c b/drivers/net/veth.c |
1574 |
+index 88cfd63f08a6a..44ad412f9a06f 100644 |
1575 |
+--- a/drivers/net/veth.c |
1576 |
++++ b/drivers/net/veth.c |
1577 |
+@@ -254,8 +254,7 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) |
1578 |
+ if (rxq < rcv->real_num_rx_queues) { |
1579 |
+ rq = &rcv_priv->rq[rxq]; |
1580 |
+ rcv_xdp = rcu_access_pointer(rq->xdp_prog); |
1581 |
+- if (rcv_xdp) |
1582 |
+- skb_record_rx_queue(skb, rxq); |
1583 |
++ skb_record_rx_queue(skb, rxq); |
1584 |
+ } |
1585 |
+ |
1586 |
+ skb_tx_timestamp(skb); |
1587 |
+diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c |
1588 |
+index 4ad0a0c33d853..034eb6535ab7d 100644 |
1589 |
+--- a/drivers/net/wan/fsl_ucc_hdlc.c |
1590 |
++++ b/drivers/net/wan/fsl_ucc_hdlc.c |
1591 |
+@@ -204,14 +204,18 @@ static int uhdlc_init(struct ucc_hdlc_private *priv) |
1592 |
+ priv->rx_skbuff = kcalloc(priv->rx_ring_size, |
1593 |
+ sizeof(*priv->rx_skbuff), |
1594 |
+ GFP_KERNEL); |
1595 |
+- if (!priv->rx_skbuff) |
1596 |
++ if (!priv->rx_skbuff) { |
1597 |
++ ret = -ENOMEM; |
1598 |
+ goto free_ucc_pram; |
1599 |
++ } |
1600 |
+ |
1601 |
+ priv->tx_skbuff = kcalloc(priv->tx_ring_size, |
1602 |
+ sizeof(*priv->tx_skbuff), |
1603 |
+ GFP_KERNEL); |
1604 |
+- if (!priv->tx_skbuff) |
1605 |
++ if (!priv->tx_skbuff) { |
1606 |
++ ret = -ENOMEM; |
1607 |
+ goto free_rx_skbuff; |
1608 |
++ } |
1609 |
+ |
1610 |
+ priv->skb_curtx = 0; |
1611 |
+ priv->skb_dirtytx = 0; |
1612 |
+diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c |
1613 |
+index 308f3a28e12a2..67ea531e8b34b 100644 |
1614 |
+--- a/drivers/nvme/host/core.c |
1615 |
++++ b/drivers/nvme/host/core.c |
1616 |
+@@ -312,6 +312,7 @@ bool nvme_cancel_request(struct request *req, void *data, bool reserved) |
1617 |
+ return true; |
1618 |
+ |
1619 |
+ nvme_req(req)->status = NVME_SC_HOST_ABORTED_CMD; |
1620 |
++ nvme_req(req)->flags |= NVME_REQ_CANCELLED; |
1621 |
+ blk_mq_complete_request(req); |
1622 |
+ return true; |
1623 |
+ } |
1624 |
+diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c |
1625 |
+index 65b3dc9cd693b..0d2c22cf12a08 100644 |
1626 |
+--- a/drivers/nvme/host/fc.c |
1627 |
++++ b/drivers/nvme/host/fc.c |
1628 |
+@@ -1608,7 +1608,7 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req) |
1629 |
+ sizeof(op->rsp_iu), DMA_FROM_DEVICE); |
1630 |
+ |
1631 |
+ if (opstate == FCPOP_STATE_ABORTED) |
1632 |
+- status = cpu_to_le16(NVME_SC_HOST_PATH_ERROR << 1); |
1633 |
++ status = cpu_to_le16(NVME_SC_HOST_ABORTED_CMD << 1); |
1634 |
+ else if (freq->status) { |
1635 |
+ status = cpu_to_le16(NVME_SC_HOST_PATH_ERROR << 1); |
1636 |
+ dev_info(ctrl->ctrl.device, |
1637 |
+diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c |
1638 |
+index fc18738dcf8ff..3bee3724e9fa7 100644 |
1639 |
+--- a/drivers/nvme/host/pci.c |
1640 |
++++ b/drivers/nvme/host/pci.c |
1641 |
+@@ -3176,6 +3176,7 @@ static const struct pci_device_id nvme_id_table[] = { |
1642 |
+ .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, |
1643 |
+ { PCI_DEVICE(0x144d, 0xa822), /* Samsung PM1725a */ |
1644 |
+ .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY | |
1645 |
++ NVME_QUIRK_DISABLE_WRITE_ZEROES| |
1646 |
+ NVME_QUIRK_IGNORE_DEV_SUBNQN, }, |
1647 |
+ { PCI_DEVICE(0x1987, 0x5016), /* Phison E16 */ |
1648 |
+ .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, }, |
1649 |
+diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c |
1650 |
+index d4fc2cbf78703..6aaceef3326c7 100644 |
1651 |
+--- a/drivers/platform/x86/intel-vbtn.c |
1652 |
++++ b/drivers/platform/x86/intel-vbtn.c |
1653 |
+@@ -46,8 +46,16 @@ static const struct key_entry intel_vbtn_keymap[] = { |
1654 |
+ }; |
1655 |
+ |
1656 |
+ static const struct key_entry intel_vbtn_switchmap[] = { |
1657 |
+- { KE_SW, 0xCA, { .sw = { SW_DOCK, 1 } } }, /* Docked */ |
1658 |
+- { KE_SW, 0xCB, { .sw = { SW_DOCK, 0 } } }, /* Undocked */ |
1659 |
++ /* |
1660 |
++ * SW_DOCK should only be reported for docking stations, but DSDTs using the |
1661 |
++ * intel-vbtn code, always seem to use this for 2-in-1s / convertibles and set |
1662 |
++ * SW_DOCK=1 when in laptop-mode (in tandem with setting SW_TABLET_MODE=0). |
1663 |
++ * This causes userspace to think the laptop is docked to a port-replicator |
1664 |
++ * and to disable suspend-on-lid-close, which is undesirable. |
1665 |
++ * Map the dock events to KEY_IGNORE to avoid this broken SW_DOCK reporting. |
1666 |
++ */ |
1667 |
++ { KE_IGNORE, 0xCA, { .sw = { SW_DOCK, 1 } } }, /* Docked */ |
1668 |
++ { KE_IGNORE, 0xCB, { .sw = { SW_DOCK, 0 } } }, /* Undocked */ |
1669 |
+ { KE_SW, 0xCC, { .sw = { SW_TABLET_MODE, 1 } } }, /* Tablet */ |
1670 |
+ { KE_SW, 0xCD, { .sw = { SW_TABLET_MODE, 0 } } }, /* Laptop */ |
1671 |
+ }; |
1672 |
+diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c |
1673 |
+index 68d22acdb037a..2de7af13288e3 100644 |
1674 |
+--- a/drivers/regulator/qcom-rpmh-regulator.c |
1675 |
++++ b/drivers/regulator/qcom-rpmh-regulator.c |
1676 |
+@@ -726,8 +726,8 @@ static const struct rpmh_vreg_hw_data pmic5_ftsmps510 = { |
1677 |
+ static const struct rpmh_vreg_hw_data pmic5_hfsmps515 = { |
1678 |
+ .regulator_type = VRM, |
1679 |
+ .ops = &rpmh_regulator_vrm_ops, |
1680 |
+- .voltage_range = REGULATOR_LINEAR_RANGE(2800000, 0, 4, 16000), |
1681 |
+- .n_voltages = 5, |
1682 |
++ .voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 235, 16000), |
1683 |
++ .n_voltages = 236, |
1684 |
+ .pmic_mode_map = pmic_mode_map_pmic5_smps, |
1685 |
+ .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, |
1686 |
+ }; |
1687 |
+diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c |
1688 |
+index 7532603aafb15..b6d42b2ce6fe4 100644 |
1689 |
+--- a/drivers/scsi/mpt3sas/mpt3sas_base.c |
1690 |
++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c |
1691 |
+@@ -7102,14 +7102,18 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) |
1692 |
+ ioc->pend_os_device_add_sz++; |
1693 |
+ ioc->pend_os_device_add = kzalloc(ioc->pend_os_device_add_sz, |
1694 |
+ GFP_KERNEL); |
1695 |
+- if (!ioc->pend_os_device_add) |
1696 |
++ if (!ioc->pend_os_device_add) { |
1697 |
++ r = -ENOMEM; |
1698 |
+ goto out_free_resources; |
1699 |
++ } |
1700 |
+ |
1701 |
+ ioc->device_remove_in_progress_sz = ioc->pend_os_device_add_sz; |
1702 |
+ ioc->device_remove_in_progress = |
1703 |
+ kzalloc(ioc->device_remove_in_progress_sz, GFP_KERNEL); |
1704 |
+- if (!ioc->device_remove_in_progress) |
1705 |
++ if (!ioc->device_remove_in_progress) { |
1706 |
++ r = -ENOMEM; |
1707 |
+ goto out_free_resources; |
1708 |
++ } |
1709 |
+ |
1710 |
+ ioc->fwfault_debug = mpt3sas_fwfault_debug; |
1711 |
+ |
1712 |
+diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c |
1713 |
+index fdd966fea7f6a..4498add3d4d66 100644 |
1714 |
+--- a/drivers/scsi/qedi/qedi_main.c |
1715 |
++++ b/drivers/scsi/qedi/qedi_main.c |
1716 |
+@@ -1605,6 +1605,7 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi) |
1717 |
+ if (!qedi->global_queues[i]) { |
1718 |
+ QEDI_ERR(&qedi->dbg_ctx, |
1719 |
+ "Unable to allocation global queue %d.\n", i); |
1720 |
++ status = -ENOMEM; |
1721 |
+ goto mem_alloc_failure; |
1722 |
+ } |
1723 |
+ |
1724 |
+diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c |
1725 |
+index 412009e2b9488..8fd0a568303b5 100644 |
1726 |
+--- a/drivers/scsi/qla2xxx/qla_target.c |
1727 |
++++ b/drivers/scsi/qla2xxx/qla_target.c |
1728 |
+@@ -3216,8 +3216,7 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, |
1729 |
+ if (!qpair->fw_started || (cmd->reset_count != qpair->chip_reset) || |
1730 |
+ (cmd->sess && cmd->sess->deleted)) { |
1731 |
+ cmd->state = QLA_TGT_STATE_PROCESSED; |
1732 |
+- res = 0; |
1733 |
+- goto free; |
1734 |
++ return 0; |
1735 |
+ } |
1736 |
+ |
1737 |
+ ql_dbg_qp(ql_dbg_tgt, qpair, 0xe018, |
1738 |
+@@ -3228,8 +3227,9 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, |
1739 |
+ |
1740 |
+ res = qlt_pre_xmit_response(cmd, &prm, xmit_type, scsi_status, |
1741 |
+ &full_req_cnt); |
1742 |
+- if (unlikely(res != 0)) |
1743 |
+- goto free; |
1744 |
++ if (unlikely(res != 0)) { |
1745 |
++ return res; |
1746 |
++ } |
1747 |
+ |
1748 |
+ spin_lock_irqsave(qpair->qp_lock_ptr, flags); |
1749 |
+ |
1750 |
+@@ -3249,8 +3249,7 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, |
1751 |
+ vha->flags.online, qla2x00_reset_active(vha), |
1752 |
+ cmd->reset_count, qpair->chip_reset); |
1753 |
+ spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); |
1754 |
+- res = 0; |
1755 |
+- goto free; |
1756 |
++ return 0; |
1757 |
+ } |
1758 |
+ |
1759 |
+ /* Does F/W have an IOCBs for this request */ |
1760 |
+@@ -3353,8 +3352,6 @@ out_unmap_unlock: |
1761 |
+ qlt_unmap_sg(vha, cmd); |
1762 |
+ spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); |
1763 |
+ |
1764 |
+-free: |
1765 |
+- vha->hw->tgt.tgt_ops->free_cmd(cmd); |
1766 |
+ return res; |
1767 |
+ } |
1768 |
+ EXPORT_SYMBOL(qlt_xmit_response); |
1769 |
+diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c |
1770 |
+index 744cd93189da3..df8644da2c323 100644 |
1771 |
+--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c |
1772 |
++++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c |
1773 |
+@@ -623,7 +623,6 @@ static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) |
1774 |
+ { |
1775 |
+ struct qla_tgt_cmd *cmd = container_of(se_cmd, |
1776 |
+ struct qla_tgt_cmd, se_cmd); |
1777 |
+- struct scsi_qla_host *vha = cmd->vha; |
1778 |
+ |
1779 |
+ if (cmd->aborted) { |
1780 |
+ /* Cmd can loop during Q-full. tcm_qla2xxx_aborted_task |
1781 |
+@@ -636,7 +635,6 @@ static int tcm_qla2xxx_queue_data_in(struct se_cmd *se_cmd) |
1782 |
+ cmd->se_cmd.transport_state, |
1783 |
+ cmd->se_cmd.t_state, |
1784 |
+ cmd->se_cmd.se_cmd_flags); |
1785 |
+- vha->hw->tgt.tgt_ops->free_cmd(cmd); |
1786 |
+ return 0; |
1787 |
+ } |
1788 |
+ |
1789 |
+@@ -664,7 +662,6 @@ static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) |
1790 |
+ { |
1791 |
+ struct qla_tgt_cmd *cmd = container_of(se_cmd, |
1792 |
+ struct qla_tgt_cmd, se_cmd); |
1793 |
+- struct scsi_qla_host *vha = cmd->vha; |
1794 |
+ int xmit_type = QLA_TGT_XMIT_STATUS; |
1795 |
+ |
1796 |
+ if (cmd->aborted) { |
1797 |
+@@ -678,7 +675,6 @@ static int tcm_qla2xxx_queue_status(struct se_cmd *se_cmd) |
1798 |
+ cmd, kref_read(&cmd->se_cmd.cmd_kref), |
1799 |
+ cmd->se_cmd.transport_state, cmd->se_cmd.t_state, |
1800 |
+ cmd->se_cmd.se_cmd_flags); |
1801 |
+- vha->hw->tgt.tgt_ops->free_cmd(cmd); |
1802 |
+ return 0; |
1803 |
+ } |
1804 |
+ cmd->bufflen = se_cmd->data_length; |
1805 |
+diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c |
1806 |
+index 7adecfd0c1e99..81d9c4ea0e8f3 100644 |
1807 |
+--- a/fs/cifs/smb2pdu.c |
1808 |
++++ b/fs/cifs/smb2pdu.c |
1809 |
+@@ -3743,8 +3743,7 @@ smb2_async_readv(struct cifs_readdata *rdata) |
1810 |
+ if (rdata->credits.value > 0) { |
1811 |
+ shdr->CreditCharge = cpu_to_le16(DIV_ROUND_UP(rdata->bytes, |
1812 |
+ SMB2_MAX_BUFFER_SIZE)); |
1813 |
+- shdr->CreditRequest = |
1814 |
+- cpu_to_le16(le16_to_cpu(shdr->CreditCharge) + 1); |
1815 |
++ shdr->CreditRequest = cpu_to_le16(le16_to_cpu(shdr->CreditCharge) + 8); |
1816 |
+ |
1817 |
+ rc = adjust_credits(server, &rdata->credits, rdata->bytes); |
1818 |
+ if (rc) |
1819 |
+@@ -4038,8 +4037,7 @@ smb2_async_writev(struct cifs_writedata *wdata, |
1820 |
+ if (wdata->credits.value > 0) { |
1821 |
+ shdr->CreditCharge = cpu_to_le16(DIV_ROUND_UP(wdata->bytes, |
1822 |
+ SMB2_MAX_BUFFER_SIZE)); |
1823 |
+- shdr->CreditRequest = |
1824 |
+- cpu_to_le16(le16_to_cpu(shdr->CreditCharge) + 1); |
1825 |
++ shdr->CreditRequest = cpu_to_le16(le16_to_cpu(shdr->CreditCharge) + 8); |
1826 |
+ |
1827 |
+ rc = adjust_credits(server, &wdata->credits, wdata->bytes); |
1828 |
+ if (rc) |
1829 |
+diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c |
1830 |
+index e99ecfafffac3..61e7df4d9cb11 100644 |
1831 |
+--- a/fs/cifs/transport.c |
1832 |
++++ b/fs/cifs/transport.c |
1833 |
+@@ -1148,7 +1148,7 @@ compound_send_recv(const unsigned int xid, struct cifs_ses *ses, |
1834 |
+ } |
1835 |
+ if (rc != 0) { |
1836 |
+ for (; i < num_rqst; i++) { |
1837 |
+- cifs_server_dbg(VFS, "Cancelling wait for mid %llu cmd: %d\n", |
1838 |
++ cifs_server_dbg(FYI, "Cancelling wait for mid %llu cmd: %d\n", |
1839 |
+ midQ[i]->mid, le16_to_cpu(midQ[i]->command)); |
1840 |
+ send_cancel(server, &rqst[i], midQ[i]); |
1841 |
+ spin_lock(&GlobalMid_Lock); |
1842 |
+diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c |
1843 |
+index 5451f10800065..20e40cac819e4 100644 |
1844 |
+--- a/fs/ext4/xattr.c |
1845 |
++++ b/fs/ext4/xattr.c |
1846 |
+@@ -1476,6 +1476,9 @@ ext4_xattr_inode_cache_find(struct inode *inode, const void *value, |
1847 |
+ if (!ce) |
1848 |
+ return NULL; |
1849 |
+ |
1850 |
++ WARN_ON_ONCE(ext4_handle_valid(journal_current_handle()) && |
1851 |
++ !(current->flags & PF_MEMALLOC_NOFS)); |
1852 |
++ |
1853 |
+ ea_data = ext4_kvmalloc(value_len, GFP_NOFS); |
1854 |
+ if (!ea_data) { |
1855 |
+ mb_cache_entry_put(ea_inode_cache, ce); |
1856 |
+@@ -2342,6 +2345,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index, |
1857 |
+ error = -ENOSPC; |
1858 |
+ goto cleanup; |
1859 |
+ } |
1860 |
++ WARN_ON_ONCE(!(current->flags & PF_MEMALLOC_NOFS)); |
1861 |
+ } |
1862 |
+ |
1863 |
+ error = ext4_reserve_inode_write(handle, inode, &is.iloc); |
1864 |
+diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c |
1865 |
+index cf3af2140c3d8..a2e9354b9d534 100644 |
1866 |
+--- a/fs/hugetlbfs/inode.c |
1867 |
++++ b/fs/hugetlbfs/inode.c |
1868 |
+@@ -440,7 +440,7 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart, |
1869 |
+ u32 hash; |
1870 |
+ |
1871 |
+ index = page->index; |
1872 |
+- hash = hugetlb_fault_mutex_hash(h, mapping, index, 0); |
1873 |
++ hash = hugetlb_fault_mutex_hash(h, mapping, index); |
1874 |
+ mutex_lock(&hugetlb_fault_mutex_table[hash]); |
1875 |
+ |
1876 |
+ /* |
1877 |
+@@ -644,7 +644,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, |
1878 |
+ addr = index * hpage_size; |
1879 |
+ |
1880 |
+ /* mutex taken here, fault path and hole punch */ |
1881 |
+- hash = hugetlb_fault_mutex_hash(h, mapping, index, addr); |
1882 |
++ hash = hugetlb_fault_mutex_hash(h, mapping, index); |
1883 |
+ mutex_lock(&hugetlb_fault_mutex_table[hash]); |
1884 |
+ |
1885 |
+ /* See if already present in mapping to avoid alloc/free */ |
1886 |
+diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig |
1887 |
+index e7dd07f478259..e84c187d942e8 100644 |
1888 |
+--- a/fs/nfs/Kconfig |
1889 |
++++ b/fs/nfs/Kconfig |
1890 |
+@@ -127,7 +127,7 @@ config PNFS_BLOCK |
1891 |
+ config PNFS_FLEXFILE_LAYOUT |
1892 |
+ tristate |
1893 |
+ depends on NFS_V4_1 && NFS_V3 |
1894 |
+- default m |
1895 |
++ default NFS_V4 |
1896 |
+ |
1897 |
+ config NFS_V4_1_IMPLEMENTATION_ID_DOMAIN |
1898 |
+ string "NFSv4.1 Implementation ID Domain" |
1899 |
+diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c |
1900 |
+index 1f60ab2535eed..23d75cddbb2ee 100644 |
1901 |
+--- a/fs/nfs/nfs3xdr.c |
1902 |
++++ b/fs/nfs/nfs3xdr.c |
1903 |
+@@ -35,6 +35,7 @@ |
1904 |
+ */ |
1905 |
+ #define NFS3_fhandle_sz (1+16) |
1906 |
+ #define NFS3_fh_sz (NFS3_fhandle_sz) /* shorthand */ |
1907 |
++#define NFS3_post_op_fh_sz (1+NFS3_fh_sz) |
1908 |
+ #define NFS3_sattr_sz (15) |
1909 |
+ #define NFS3_filename_sz (1+(NFS3_MAXNAMLEN>>2)) |
1910 |
+ #define NFS3_path_sz (1+(NFS3_MAXPATHLEN>>2)) |
1911 |
+@@ -72,7 +73,7 @@ |
1912 |
+ #define NFS3_readlinkres_sz (1+NFS3_post_op_attr_sz+1+1) |
1913 |
+ #define NFS3_readres_sz (1+NFS3_post_op_attr_sz+3+1) |
1914 |
+ #define NFS3_writeres_sz (1+NFS3_wcc_data_sz+4) |
1915 |
+-#define NFS3_createres_sz (1+NFS3_fh_sz+NFS3_post_op_attr_sz+NFS3_wcc_data_sz) |
1916 |
++#define NFS3_createres_sz (1+NFS3_post_op_fh_sz+NFS3_post_op_attr_sz+NFS3_wcc_data_sz) |
1917 |
+ #define NFS3_renameres_sz (1+(2 * NFS3_wcc_data_sz)) |
1918 |
+ #define NFS3_linkres_sz (1+NFS3_post_op_attr_sz+NFS3_wcc_data_sz) |
1919 |
+ #define NFS3_readdirres_sz (1+NFS3_post_op_attr_sz+2+1) |
1920 |
+diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c |
1921 |
+index b2119159dead2..304ab4cdaa8c1 100644 |
1922 |
+--- a/fs/nfs/nfs4proc.c |
1923 |
++++ b/fs/nfs/nfs4proc.c |
1924 |
+@@ -5754,6 +5754,9 @@ static int __nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t bufl |
1925 |
+ unsigned int npages = DIV_ROUND_UP(buflen, PAGE_SIZE); |
1926 |
+ int ret, i; |
1927 |
+ |
1928 |
++ /* You can't remove system.nfs4_acl: */ |
1929 |
++ if (buflen == 0) |
1930 |
++ return -EINVAL; |
1931 |
+ if (!nfs4_server_supports_acls(server)) |
1932 |
+ return -EOPNOTSUPP; |
1933 |
+ if (npages > ARRAY_SIZE(pages)) |
1934 |
+diff --git a/fs/squashfs/export.c b/fs/squashfs/export.c |
1935 |
+index eb02072d28dd6..723763746238d 100644 |
1936 |
+--- a/fs/squashfs/export.c |
1937 |
++++ b/fs/squashfs/export.c |
1938 |
+@@ -152,14 +152,18 @@ __le64 *squashfs_read_inode_lookup_table(struct super_block *sb, |
1939 |
+ start = le64_to_cpu(table[n]); |
1940 |
+ end = le64_to_cpu(table[n + 1]); |
1941 |
+ |
1942 |
+- if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) { |
1943 |
++ if (start >= end |
1944 |
++ || (end - start) > |
1945 |
++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) { |
1946 |
+ kfree(table); |
1947 |
+ return ERR_PTR(-EINVAL); |
1948 |
+ } |
1949 |
+ } |
1950 |
+ |
1951 |
+ start = le64_to_cpu(table[indexes - 1]); |
1952 |
+- if (start >= lookup_table_start || (lookup_table_start - start) > SQUASHFS_METADATA_SIZE) { |
1953 |
++ if (start >= lookup_table_start || |
1954 |
++ (lookup_table_start - start) > |
1955 |
++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) { |
1956 |
+ kfree(table); |
1957 |
+ return ERR_PTR(-EINVAL); |
1958 |
+ } |
1959 |
+diff --git a/fs/squashfs/id.c b/fs/squashfs/id.c |
1960 |
+index 11581bf31af41..ea5387679723f 100644 |
1961 |
+--- a/fs/squashfs/id.c |
1962 |
++++ b/fs/squashfs/id.c |
1963 |
+@@ -97,14 +97,16 @@ __le64 *squashfs_read_id_index_table(struct super_block *sb, |
1964 |
+ start = le64_to_cpu(table[n]); |
1965 |
+ end = le64_to_cpu(table[n + 1]); |
1966 |
+ |
1967 |
+- if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) { |
1968 |
++ if (start >= end || (end - start) > |
1969 |
++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) { |
1970 |
+ kfree(table); |
1971 |
+ return ERR_PTR(-EINVAL); |
1972 |
+ } |
1973 |
+ } |
1974 |
+ |
1975 |
+ start = le64_to_cpu(table[indexes - 1]); |
1976 |
+- if (start >= id_table_start || (id_table_start - start) > SQUASHFS_METADATA_SIZE) { |
1977 |
++ if (start >= id_table_start || (id_table_start - start) > |
1978 |
++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) { |
1979 |
+ kfree(table); |
1980 |
+ return ERR_PTR(-EINVAL); |
1981 |
+ } |
1982 |
+diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h |
1983 |
+index 7187bd1a30ea5..236664d691419 100644 |
1984 |
+--- a/fs/squashfs/squashfs_fs.h |
1985 |
++++ b/fs/squashfs/squashfs_fs.h |
1986 |
+@@ -17,6 +17,7 @@ |
1987 |
+ |
1988 |
+ /* size of metadata (inode and directory) blocks */ |
1989 |
+ #define SQUASHFS_METADATA_SIZE 8192 |
1990 |
++#define SQUASHFS_BLOCK_OFFSET 2 |
1991 |
+ |
1992 |
+ /* default size of block device I/O */ |
1993 |
+ #ifdef CONFIG_SQUASHFS_4K_DEVBLK_SIZE |
1994 |
+diff --git a/fs/squashfs/xattr_id.c b/fs/squashfs/xattr_id.c |
1995 |
+index ead66670b41a5..087cab8c78f4e 100644 |
1996 |
+--- a/fs/squashfs/xattr_id.c |
1997 |
++++ b/fs/squashfs/xattr_id.c |
1998 |
+@@ -109,14 +109,16 @@ __le64 *squashfs_read_xattr_id_table(struct super_block *sb, u64 table_start, |
1999 |
+ start = le64_to_cpu(table[n]); |
2000 |
+ end = le64_to_cpu(table[n + 1]); |
2001 |
+ |
2002 |
+- if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) { |
2003 |
++ if (start >= end || (end - start) > |
2004 |
++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) { |
2005 |
+ kfree(table); |
2006 |
+ return ERR_PTR(-EINVAL); |
2007 |
+ } |
2008 |
+ } |
2009 |
+ |
2010 |
+ start = le64_to_cpu(table[indexes - 1]); |
2011 |
+- if (start >= table_start || (table_start - start) > SQUASHFS_METADATA_SIZE) { |
2012 |
++ if (start >= table_start || (table_start - start) > |
2013 |
++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) { |
2014 |
+ kfree(table); |
2015 |
+ return ERR_PTR(-EINVAL); |
2016 |
+ } |
2017 |
+diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h |
2018 |
+index defed629073bf..4d67a67964fa3 100644 |
2019 |
+--- a/include/acpi/acpi_bus.h |
2020 |
++++ b/include/acpi/acpi_bus.h |
2021 |
+@@ -232,6 +232,7 @@ struct acpi_pnp_type { |
2022 |
+ |
2023 |
+ struct acpi_device_pnp { |
2024 |
+ acpi_bus_id bus_id; /* Object name */ |
2025 |
++ int instance_no; /* Instance number of this object */ |
2026 |
+ struct acpi_pnp_type type; /* ID type */ |
2027 |
+ acpi_bus_address bus_address; /* _ADR */ |
2028 |
+ char *unique_id; /* _UID */ |
2029 |
+diff --git a/include/linux/bpf.h b/include/linux/bpf.h |
2030 |
+index 007147f643908..66590ae89c97c 100644 |
2031 |
+--- a/include/linux/bpf.h |
2032 |
++++ b/include/linux/bpf.h |
2033 |
+@@ -535,7 +535,7 @@ int bpf_prog_array_copy(struct bpf_prog_array *old_array, |
2034 |
+ struct bpf_prog *include_prog, |
2035 |
+ struct bpf_prog_array **new_array); |
2036 |
+ |
2037 |
+-#define __BPF_PROG_RUN_ARRAY(array, ctx, func, check_non_null) \ |
2038 |
++#define __BPF_PROG_RUN_ARRAY(array, ctx, func, check_non_null, set_cg_storage) \ |
2039 |
+ ({ \ |
2040 |
+ struct bpf_prog_array_item *_item; \ |
2041 |
+ struct bpf_prog *_prog; \ |
2042 |
+@@ -548,7 +548,8 @@ int bpf_prog_array_copy(struct bpf_prog_array *old_array, |
2043 |
+ goto _out; \ |
2044 |
+ _item = &_array->items[0]; \ |
2045 |
+ while ((_prog = READ_ONCE(_item->prog))) { \ |
2046 |
+- bpf_cgroup_storage_set(_item->cgroup_storage); \ |
2047 |
++ if (set_cg_storage) \ |
2048 |
++ bpf_cgroup_storage_set(_item->cgroup_storage); \ |
2049 |
+ _ret &= func(_prog, ctx); \ |
2050 |
+ _item++; \ |
2051 |
+ } \ |
2052 |
+@@ -609,10 +610,10 @@ _out: \ |
2053 |
+ }) |
2054 |
+ |
2055 |
+ #define BPF_PROG_RUN_ARRAY(array, ctx, func) \ |
2056 |
+- __BPF_PROG_RUN_ARRAY(array, ctx, func, false) |
2057 |
++ __BPF_PROG_RUN_ARRAY(array, ctx, func, false, true) |
2058 |
+ |
2059 |
+ #define BPF_PROG_RUN_ARRAY_CHECK(array, ctx, func) \ |
2060 |
+- __BPF_PROG_RUN_ARRAY(array, ctx, func, true) |
2061 |
++ __BPF_PROG_RUN_ARRAY(array, ctx, func, true, false) |
2062 |
+ |
2063 |
+ #ifdef CONFIG_BPF_SYSCALL |
2064 |
+ DECLARE_PER_CPU(int, bpf_prog_active); |
2065 |
+diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h |
2066 |
+index 0e080ba5efbcc..fc717aeb2b3de 100644 |
2067 |
+--- a/include/linux/hugetlb.h |
2068 |
++++ b/include/linux/hugetlb.h |
2069 |
+@@ -106,7 +106,7 @@ void free_huge_page(struct page *page); |
2070 |
+ void hugetlb_fix_reserve_counts(struct inode *inode); |
2071 |
+ extern struct mutex *hugetlb_fault_mutex_table; |
2072 |
+ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping, |
2073 |
+- pgoff_t idx, unsigned long address); |
2074 |
++ pgoff_t idx); |
2075 |
+ |
2076 |
+ pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); |
2077 |
+ |
2078 |
+diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h |
2079 |
+index a367ead4bf4bb..e11555989090c 100644 |
2080 |
+--- a/include/linux/if_macvlan.h |
2081 |
++++ b/include/linux/if_macvlan.h |
2082 |
+@@ -42,13 +42,14 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, |
2083 |
+ if (likely(success)) { |
2084 |
+ struct vlan_pcpu_stats *pcpu_stats; |
2085 |
+ |
2086 |
+- pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); |
2087 |
++ pcpu_stats = get_cpu_ptr(vlan->pcpu_stats); |
2088 |
+ u64_stats_update_begin(&pcpu_stats->syncp); |
2089 |
+ pcpu_stats->rx_packets++; |
2090 |
+ pcpu_stats->rx_bytes += len; |
2091 |
+ if (multicast) |
2092 |
+ pcpu_stats->rx_multicast++; |
2093 |
+ u64_stats_update_end(&pcpu_stats->syncp); |
2094 |
++ put_cpu_ptr(vlan->pcpu_stats); |
2095 |
+ } else { |
2096 |
+ this_cpu_inc(vlan->pcpu_stats->rx_errors); |
2097 |
+ } |
2098 |
+diff --git a/include/linux/mm.h b/include/linux/mm.h |
2099 |
+index c63e4b38b7fe0..703e0d72a05c7 100644 |
2100 |
+--- a/include/linux/mm.h |
2101 |
++++ b/include/linux/mm.h |
2102 |
+@@ -1226,13 +1226,26 @@ static inline bool cpupid_match_pid(struct task_struct *task, int cpupid) |
2103 |
+ #endif /* CONFIG_NUMA_BALANCING */ |
2104 |
+ |
2105 |
+ #ifdef CONFIG_KASAN_SW_TAGS |
2106 |
++ |
2107 |
++/* |
2108 |
++ * KASAN per-page tags are stored xor'ed with 0xff. This allows to avoid |
2109 |
++ * setting tags for all pages to native kernel tag value 0xff, as the default |
2110 |
++ * value 0x00 maps to 0xff. |
2111 |
++ */ |
2112 |
++ |
2113 |
+ static inline u8 page_kasan_tag(const struct page *page) |
2114 |
+ { |
2115 |
+- return (page->flags >> KASAN_TAG_PGSHIFT) & KASAN_TAG_MASK; |
2116 |
++ u8 tag; |
2117 |
++ |
2118 |
++ tag = (page->flags >> KASAN_TAG_PGSHIFT) & KASAN_TAG_MASK; |
2119 |
++ tag ^= 0xff; |
2120 |
++ |
2121 |
++ return tag; |
2122 |
+ } |
2123 |
+ |
2124 |
+ static inline void page_kasan_tag_set(struct page *page, u8 tag) |
2125 |
+ { |
2126 |
++ tag ^= 0xff; |
2127 |
+ page->flags &= ~(KASAN_TAG_MASK << KASAN_TAG_PGSHIFT); |
2128 |
+ page->flags |= (tag & KASAN_TAG_MASK) << KASAN_TAG_PGSHIFT; |
2129 |
+ } |
2130 |
+diff --git a/include/linux/mutex.h b/include/linux/mutex.h |
2131 |
+index aca8f36dfac9a..479bc96c3e63a 100644 |
2132 |
+--- a/include/linux/mutex.h |
2133 |
++++ b/include/linux/mutex.h |
2134 |
+@@ -171,7 +171,7 @@ extern void mutex_lock_io(struct mutex *lock); |
2135 |
+ # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) |
2136 |
+ # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock) |
2137 |
+ # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock) |
2138 |
+-# define mutex_lock_io_nested(lock, subclass) mutex_lock(lock) |
2139 |
++# define mutex_lock_io_nested(lock, subclass) mutex_lock_io(lock) |
2140 |
+ #endif |
2141 |
+ |
2142 |
+ /* |
2143 |
+diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h |
2144 |
+index f5c21b7d29748..04e7f5630509c 100644 |
2145 |
+--- a/include/linux/netfilter/x_tables.h |
2146 |
++++ b/include/linux/netfilter/x_tables.h |
2147 |
+@@ -227,7 +227,7 @@ struct xt_table { |
2148 |
+ unsigned int valid_hooks; |
2149 |
+ |
2150 |
+ /* Man behind the curtain... */ |
2151 |
+- struct xt_table_info __rcu *private; |
2152 |
++ struct xt_table_info *private; |
2153 |
+ |
2154 |
+ /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
2155 |
+ struct module *me; |
2156 |
+@@ -376,7 +376,7 @@ static inline unsigned int xt_write_recseq_begin(void) |
2157 |
+ * since addend is most likely 1 |
2158 |
+ */ |
2159 |
+ __this_cpu_add(xt_recseq.sequence, addend); |
2160 |
+- smp_wmb(); |
2161 |
++ smp_mb(); |
2162 |
+ |
2163 |
+ return addend; |
2164 |
+ } |
2165 |
+@@ -448,9 +448,6 @@ xt_get_per_cpu_counter(struct xt_counters *cnt, unsigned int cpu) |
2166 |
+ |
2167 |
+ struct nf_hook_ops *xt_hook_ops_alloc(const struct xt_table *, nf_hookfn *); |
2168 |
+ |
2169 |
+-struct xt_table_info |
2170 |
+-*xt_table_get_private_protected(const struct xt_table *table); |
2171 |
+- |
2172 |
+ #ifdef CONFIG_COMPAT |
2173 |
+ #include <net/compat.h> |
2174 |
+ |
2175 |
+diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h |
2176 |
+index a27604f99ed04..11096b561dab6 100644 |
2177 |
+--- a/include/linux/u64_stats_sync.h |
2178 |
++++ b/include/linux/u64_stats_sync.h |
2179 |
+@@ -69,12 +69,13 @@ struct u64_stats_sync { |
2180 |
+ }; |
2181 |
+ |
2182 |
+ |
2183 |
++#if BITS_PER_LONG == 32 && defined(CONFIG_SMP) |
2184 |
++#define u64_stats_init(syncp) seqcount_init(&(syncp)->seq) |
2185 |
++#else |
2186 |
+ static inline void u64_stats_init(struct u64_stats_sync *syncp) |
2187 |
+ { |
2188 |
+-#if BITS_PER_LONG == 32 && defined(CONFIG_SMP) |
2189 |
+- seqcount_init(&syncp->seq); |
2190 |
+-#endif |
2191 |
+ } |
2192 |
++#endif |
2193 |
+ |
2194 |
+ static inline void u64_stats_update_begin(struct u64_stats_sync *syncp) |
2195 |
+ { |
2196 |
+diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h |
2197 |
+index 6c8f8e5e33c3d..13792c0ef46e3 100644 |
2198 |
+--- a/include/net/inet_connection_sock.h |
2199 |
++++ b/include/net/inet_connection_sock.h |
2200 |
+@@ -287,7 +287,7 @@ static inline int inet_csk_reqsk_queue_is_full(const struct sock *sk) |
2201 |
+ return inet_csk_reqsk_queue_len(sk) >= sk->sk_max_ack_backlog; |
2202 |
+ } |
2203 |
+ |
2204 |
+-void inet_csk_reqsk_queue_drop(struct sock *sk, struct request_sock *req); |
2205 |
++bool inet_csk_reqsk_queue_drop(struct sock *sk, struct request_sock *req); |
2206 |
+ void inet_csk_reqsk_queue_drop_and_put(struct sock *sk, struct request_sock *req); |
2207 |
+ |
2208 |
+ void inet_csk_destroy_sock(struct sock *sk); |
2209 |
+diff --git a/include/net/nexthop.h b/include/net/nexthop.h |
2210 |
+index 3bb618e5ecf72..18a5aca264767 100644 |
2211 |
+--- a/include/net/nexthop.h |
2212 |
++++ b/include/net/nexthop.h |
2213 |
+@@ -291,6 +291,7 @@ static inline struct fib_nh *fib_info_nh(struct fib_info *fi, int nhsel) |
2214 |
+ int fib6_check_nexthop(struct nexthop *nh, struct fib6_config *cfg, |
2215 |
+ struct netlink_ext_ack *extack); |
2216 |
+ |
2217 |
++/* Caller should either hold rcu_read_lock(), or RTNL. */ |
2218 |
+ static inline struct fib6_nh *nexthop_fib6_nh(struct nexthop *nh) |
2219 |
+ { |
2220 |
+ struct nh_info *nhi; |
2221 |
+@@ -311,6 +312,29 @@ static inline struct fib6_nh *nexthop_fib6_nh(struct nexthop *nh) |
2222 |
+ return NULL; |
2223 |
+ } |
2224 |
+ |
2225 |
++/* Variant of nexthop_fib6_nh(). |
2226 |
++ * Caller should either hold rcu_read_lock_bh(), or RTNL. |
2227 |
++ */ |
2228 |
++static inline struct fib6_nh *nexthop_fib6_nh_bh(struct nexthop *nh) |
2229 |
++{ |
2230 |
++ struct nh_info *nhi; |
2231 |
++ |
2232 |
++ if (nh->is_group) { |
2233 |
++ struct nh_group *nh_grp; |
2234 |
++ |
2235 |
++ nh_grp = rcu_dereference_bh_rtnl(nh->nh_grp); |
2236 |
++ nh = nexthop_mpath_select(nh_grp, 0); |
2237 |
++ if (!nh) |
2238 |
++ return NULL; |
2239 |
++ } |
2240 |
++ |
2241 |
++ nhi = rcu_dereference_bh_rtnl(nh->nh_info); |
2242 |
++ if (nhi->family == AF_INET6) |
2243 |
++ return &nhi->fib6_nh; |
2244 |
++ |
2245 |
++ return NULL; |
2246 |
++} |
2247 |
++ |
2248 |
+ static inline struct net_device *fib6_info_nh_dev(struct fib6_info *f6i) |
2249 |
+ { |
2250 |
+ struct fib6_nh *fib6_nh; |
2251 |
+diff --git a/include/net/red.h b/include/net/red.h |
2252 |
+index e21e7fd4fe077..8fe55b8b2fb81 100644 |
2253 |
+--- a/include/net/red.h |
2254 |
++++ b/include/net/red.h |
2255 |
+@@ -168,7 +168,8 @@ static inline void red_set_vars(struct red_vars *v) |
2256 |
+ v->qcount = -1; |
2257 |
+ } |
2258 |
+ |
2259 |
+-static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog, u8 Scell_log) |
2260 |
++static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog, |
2261 |
++ u8 Scell_log, u8 *stab) |
2262 |
+ { |
2263 |
+ if (fls(qth_min) + Wlog > 32) |
2264 |
+ return false; |
2265 |
+@@ -178,6 +179,13 @@ static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog, u8 Scell_ |
2266 |
+ return false; |
2267 |
+ if (qth_max < qth_min) |
2268 |
+ return false; |
2269 |
++ if (stab) { |
2270 |
++ int i; |
2271 |
++ |
2272 |
++ for (i = 0; i < RED_STAB_SIZE; i++) |
2273 |
++ if (stab[i] >= 32) |
2274 |
++ return false; |
2275 |
++ } |
2276 |
+ return true; |
2277 |
+ } |
2278 |
+ |
2279 |
+diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h |
2280 |
+index e2091bb2b3a8e..4da61c950e931 100644 |
2281 |
+--- a/include/net/rtnetlink.h |
2282 |
++++ b/include/net/rtnetlink.h |
2283 |
+@@ -33,6 +33,7 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh) |
2284 |
+ * |
2285 |
+ * @list: Used internally |
2286 |
+ * @kind: Identifier |
2287 |
++ * @netns_refund: Physical device, move to init_net on netns exit |
2288 |
+ * @maxtype: Highest device specific netlink attribute number |
2289 |
+ * @policy: Netlink policy for device specific attribute validation |
2290 |
+ * @validate: Optional validation function for netlink/changelink parameters |
2291 |
+@@ -64,6 +65,7 @@ struct rtnl_link_ops { |
2292 |
+ size_t priv_size; |
2293 |
+ void (*setup)(struct net_device *dev); |
2294 |
+ |
2295 |
++ bool netns_refund; |
2296 |
+ unsigned int maxtype; |
2297 |
+ const struct nla_policy *policy; |
2298 |
+ int (*validate)(struct nlattr *tb[], |
2299 |
+diff --git a/kernel/gcov/clang.c b/kernel/gcov/clang.c |
2300 |
+index c94b820a1b62c..8743150db2acc 100644 |
2301 |
+--- a/kernel/gcov/clang.c |
2302 |
++++ b/kernel/gcov/clang.c |
2303 |
+@@ -75,7 +75,9 @@ struct gcov_fn_info { |
2304 |
+ |
2305 |
+ u32 num_counters; |
2306 |
+ u64 *counters; |
2307 |
++#if CONFIG_CLANG_VERSION < 110000 |
2308 |
+ const char *function_name; |
2309 |
++#endif |
2310 |
+ }; |
2311 |
+ |
2312 |
+ static struct gcov_info *current_info; |
2313 |
+@@ -105,6 +107,7 @@ void llvm_gcov_init(llvm_gcov_callback writeout, llvm_gcov_callback flush) |
2314 |
+ } |
2315 |
+ EXPORT_SYMBOL(llvm_gcov_init); |
2316 |
+ |
2317 |
++#if CONFIG_CLANG_VERSION < 110000 |
2318 |
+ void llvm_gcda_start_file(const char *orig_filename, const char version[4], |
2319 |
+ u32 checksum) |
2320 |
+ { |
2321 |
+@@ -113,7 +116,17 @@ void llvm_gcda_start_file(const char *orig_filename, const char version[4], |
2322 |
+ current_info->checksum = checksum; |
2323 |
+ } |
2324 |
+ EXPORT_SYMBOL(llvm_gcda_start_file); |
2325 |
++#else |
2326 |
++void llvm_gcda_start_file(const char *orig_filename, u32 version, u32 checksum) |
2327 |
++{ |
2328 |
++ current_info->filename = orig_filename; |
2329 |
++ current_info->version = version; |
2330 |
++ current_info->checksum = checksum; |
2331 |
++} |
2332 |
++EXPORT_SYMBOL(llvm_gcda_start_file); |
2333 |
++#endif |
2334 |
+ |
2335 |
++#if CONFIG_CLANG_VERSION < 110000 |
2336 |
+ void llvm_gcda_emit_function(u32 ident, const char *function_name, |
2337 |
+ u32 func_checksum, u8 use_extra_checksum, u32 cfg_checksum) |
2338 |
+ { |
2339 |
+@@ -133,6 +146,24 @@ void llvm_gcda_emit_function(u32 ident, const char *function_name, |
2340 |
+ list_add_tail(&info->head, ¤t_info->functions); |
2341 |
+ } |
2342 |
+ EXPORT_SYMBOL(llvm_gcda_emit_function); |
2343 |
++#else |
2344 |
++void llvm_gcda_emit_function(u32 ident, u32 func_checksum, |
2345 |
++ u8 use_extra_checksum, u32 cfg_checksum) |
2346 |
++{ |
2347 |
++ struct gcov_fn_info *info = kzalloc(sizeof(*info), GFP_KERNEL); |
2348 |
++ |
2349 |
++ if (!info) |
2350 |
++ return; |
2351 |
++ |
2352 |
++ INIT_LIST_HEAD(&info->head); |
2353 |
++ info->ident = ident; |
2354 |
++ info->checksum = func_checksum; |
2355 |
++ info->use_extra_checksum = use_extra_checksum; |
2356 |
++ info->cfg_checksum = cfg_checksum; |
2357 |
++ list_add_tail(&info->head, ¤t_info->functions); |
2358 |
++} |
2359 |
++EXPORT_SYMBOL(llvm_gcda_emit_function); |
2360 |
++#endif |
2361 |
+ |
2362 |
+ void llvm_gcda_emit_arcs(u32 num_counters, u64 *counters) |
2363 |
+ { |
2364 |
+@@ -295,6 +326,7 @@ void gcov_info_add(struct gcov_info *dst, struct gcov_info *src) |
2365 |
+ } |
2366 |
+ } |
2367 |
+ |
2368 |
++#if CONFIG_CLANG_VERSION < 110000 |
2369 |
+ static struct gcov_fn_info *gcov_fn_info_dup(struct gcov_fn_info *fn) |
2370 |
+ { |
2371 |
+ size_t cv_size; /* counter values size */ |
2372 |
+@@ -322,6 +354,28 @@ err_name: |
2373 |
+ kfree(fn_dup); |
2374 |
+ return NULL; |
2375 |
+ } |
2376 |
++#else |
2377 |
++static struct gcov_fn_info *gcov_fn_info_dup(struct gcov_fn_info *fn) |
2378 |
++{ |
2379 |
++ size_t cv_size; /* counter values size */ |
2380 |
++ struct gcov_fn_info *fn_dup = kmemdup(fn, sizeof(*fn), |
2381 |
++ GFP_KERNEL); |
2382 |
++ if (!fn_dup) |
2383 |
++ return NULL; |
2384 |
++ INIT_LIST_HEAD(&fn_dup->head); |
2385 |
++ |
2386 |
++ cv_size = fn->num_counters * sizeof(fn->counters[0]); |
2387 |
++ fn_dup->counters = vmalloc(cv_size); |
2388 |
++ if (!fn_dup->counters) { |
2389 |
++ kfree(fn_dup); |
2390 |
++ return NULL; |
2391 |
++ } |
2392 |
++ |
2393 |
++ memcpy(fn_dup->counters, fn->counters, cv_size); |
2394 |
++ |
2395 |
++ return fn_dup; |
2396 |
++} |
2397 |
++#endif |
2398 |
+ |
2399 |
+ /** |
2400 |
+ * gcov_info_dup - duplicate profiling data set |
2401 |
+@@ -362,6 +416,7 @@ err: |
2402 |
+ * gcov_info_free - release memory for profiling data set duplicate |
2403 |
+ * @info: profiling data set duplicate to free |
2404 |
+ */ |
2405 |
++#if CONFIG_CLANG_VERSION < 110000 |
2406 |
+ void gcov_info_free(struct gcov_info *info) |
2407 |
+ { |
2408 |
+ struct gcov_fn_info *fn, *tmp; |
2409 |
+@@ -375,6 +430,20 @@ void gcov_info_free(struct gcov_info *info) |
2410 |
+ kfree(info->filename); |
2411 |
+ kfree(info); |
2412 |
+ } |
2413 |
++#else |
2414 |
++void gcov_info_free(struct gcov_info *info) |
2415 |
++{ |
2416 |
++ struct gcov_fn_info *fn, *tmp; |
2417 |
++ |
2418 |
++ list_for_each_entry_safe(fn, tmp, &info->functions, head) { |
2419 |
++ vfree(fn->counters); |
2420 |
++ list_del(&fn->head); |
2421 |
++ kfree(fn); |
2422 |
++ } |
2423 |
++ kfree(info->filename); |
2424 |
++ kfree(info); |
2425 |
++} |
2426 |
++#endif |
2427 |
+ |
2428 |
+ #define ITER_STRIDE PAGE_SIZE |
2429 |
+ |
2430 |
+diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c |
2431 |
+index 0a9326f5f4218..8dac32bd90894 100644 |
2432 |
+--- a/kernel/power/energy_model.c |
2433 |
++++ b/kernel/power/energy_model.c |
2434 |
+@@ -74,7 +74,7 @@ static int __init em_debug_init(void) |
2435 |
+ |
2436 |
+ return 0; |
2437 |
+ } |
2438 |
+-core_initcall(em_debug_init); |
2439 |
++fs_initcall(em_debug_init); |
2440 |
+ #else /* CONFIG_DEBUG_FS */ |
2441 |
+ static void em_debug_create_pd(struct em_perf_domain *pd, int cpu) {} |
2442 |
+ #endif |
2443 |
+diff --git a/mm/hugetlb.c b/mm/hugetlb.c |
2444 |
+index 4033b6ce01c40..5253c67acb1df 100644 |
2445 |
+--- a/mm/hugetlb.c |
2446 |
++++ b/mm/hugetlb.c |
2447 |
+@@ -4020,7 +4020,7 @@ retry: |
2448 |
+ * handling userfault. Reacquire after handling |
2449 |
+ * fault to make calling code simpler. |
2450 |
+ */ |
2451 |
+- hash = hugetlb_fault_mutex_hash(h, mapping, idx, haddr); |
2452 |
++ hash = hugetlb_fault_mutex_hash(h, mapping, idx); |
2453 |
+ mutex_unlock(&hugetlb_fault_mutex_table[hash]); |
2454 |
+ ret = handle_userfault(&vmf, VM_UFFD_MISSING); |
2455 |
+ mutex_lock(&hugetlb_fault_mutex_table[hash]); |
2456 |
+@@ -4148,7 +4148,7 @@ backout_unlocked: |
2457 |
+ |
2458 |
+ #ifdef CONFIG_SMP |
2459 |
+ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping, |
2460 |
+- pgoff_t idx, unsigned long address) |
2461 |
++ pgoff_t idx) |
2462 |
+ { |
2463 |
+ unsigned long key[2]; |
2464 |
+ u32 hash; |
2465 |
+@@ -4156,7 +4156,7 @@ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping, |
2466 |
+ key[0] = (unsigned long) mapping; |
2467 |
+ key[1] = idx; |
2468 |
+ |
2469 |
+- hash = jhash2((u32 *)&key, sizeof(key)/sizeof(u32), 0); |
2470 |
++ hash = jhash2((u32 *)&key, sizeof(key)/(sizeof(u32)), 0); |
2471 |
+ |
2472 |
+ return hash & (num_fault_mutexes - 1); |
2473 |
+ } |
2474 |
+@@ -4166,7 +4166,7 @@ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping, |
2475 |
+ * return 0 and avoid the hashing overhead. |
2476 |
+ */ |
2477 |
+ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct address_space *mapping, |
2478 |
+- pgoff_t idx, unsigned long address) |
2479 |
++ pgoff_t idx) |
2480 |
+ { |
2481 |
+ return 0; |
2482 |
+ } |
2483 |
+@@ -4210,7 +4210,7 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
2484 |
+ * get spurious allocation failures if two CPUs race to instantiate |
2485 |
+ * the same page in the page cache. |
2486 |
+ */ |
2487 |
+- hash = hugetlb_fault_mutex_hash(h, mapping, idx, haddr); |
2488 |
++ hash = hugetlb_fault_mutex_hash(h, mapping, idx); |
2489 |
+ mutex_lock(&hugetlb_fault_mutex_table[hash]); |
2490 |
+ |
2491 |
+ entry = huge_ptep_get(ptep); |
2492 |
+diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c |
2493 |
+index c7ae74ce5ff3e..640ff2bd9a693 100644 |
2494 |
+--- a/mm/userfaultfd.c |
2495 |
++++ b/mm/userfaultfd.c |
2496 |
+@@ -269,7 +269,7 @@ retry: |
2497 |
+ */ |
2498 |
+ idx = linear_page_index(dst_vma, dst_addr); |
2499 |
+ mapping = dst_vma->vm_file->f_mapping; |
2500 |
+- hash = hugetlb_fault_mutex_hash(h, mapping, idx, dst_addr); |
2501 |
++ hash = hugetlb_fault_mutex_hash(h, mapping, idx); |
2502 |
+ mutex_lock(&hugetlb_fault_mutex_table[hash]); |
2503 |
+ |
2504 |
+ err = -ENOMEM; |
2505 |
+diff --git a/net/core/dev.c b/net/core/dev.c |
2506 |
+index e732faade5dca..2ec21380f86d9 100644 |
2507 |
+--- a/net/core/dev.c |
2508 |
++++ b/net/core/dev.c |
2509 |
+@@ -10121,7 +10121,7 @@ static void __net_exit default_device_exit(struct net *net) |
2510 |
+ continue; |
2511 |
+ |
2512 |
+ /* Leave virtual devices for the generic cleanup */ |
2513 |
+- if (dev->rtnl_link_ops) |
2514 |
++ if (dev->rtnl_link_ops && !dev->rtnl_link_ops->netns_refund) |
2515 |
+ continue; |
2516 |
+ |
2517 |
+ /* Push remaining network devices to init_net */ |
2518 |
+diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c |
2519 |
+index ac5c4f6cdefee..85a88425edc48 100644 |
2520 |
+--- a/net/ipv4/inet_connection_sock.c |
2521 |
++++ b/net/ipv4/inet_connection_sock.c |
2522 |
+@@ -700,12 +700,15 @@ static bool reqsk_queue_unlink(struct request_sock *req) |
2523 |
+ return found; |
2524 |
+ } |
2525 |
+ |
2526 |
+-void inet_csk_reqsk_queue_drop(struct sock *sk, struct request_sock *req) |
2527 |
++bool inet_csk_reqsk_queue_drop(struct sock *sk, struct request_sock *req) |
2528 |
+ { |
2529 |
+- if (reqsk_queue_unlink(req)) { |
2530 |
++ bool unlinked = reqsk_queue_unlink(req); |
2531 |
++ |
2532 |
++ if (unlinked) { |
2533 |
+ reqsk_queue_removed(&inet_csk(sk)->icsk_accept_queue, req); |
2534 |
+ reqsk_put(req); |
2535 |
+ } |
2536 |
++ return unlinked; |
2537 |
+ } |
2538 |
+ EXPORT_SYMBOL(inet_csk_reqsk_queue_drop); |
2539 |
+ |
2540 |
+diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c |
2541 |
+index 12d242fedffdc..f1f78a742b36a 100644 |
2542 |
+--- a/net/ipv4/netfilter/arp_tables.c |
2543 |
++++ b/net/ipv4/netfilter/arp_tables.c |
2544 |
+@@ -203,7 +203,7 @@ unsigned int arpt_do_table(struct sk_buff *skb, |
2545 |
+ |
2546 |
+ local_bh_disable(); |
2547 |
+ addend = xt_write_recseq_begin(); |
2548 |
+- private = rcu_access_pointer(table->private); |
2549 |
++ private = READ_ONCE(table->private); /* Address dependency. */ |
2550 |
+ cpu = smp_processor_id(); |
2551 |
+ table_base = private->entries; |
2552 |
+ jumpstack = (struct arpt_entry **)private->jumpstack[cpu]; |
2553 |
+@@ -649,7 +649,7 @@ static struct xt_counters *alloc_counters(const struct xt_table *table) |
2554 |
+ { |
2555 |
+ unsigned int countersize; |
2556 |
+ struct xt_counters *counters; |
2557 |
+- const struct xt_table_info *private = xt_table_get_private_protected(table); |
2558 |
++ const struct xt_table_info *private = table->private; |
2559 |
+ |
2560 |
+ /* We need atomic snapshot of counters: rest doesn't change |
2561 |
+ * (other than comefrom, which userspace doesn't care |
2562 |
+@@ -673,7 +673,7 @@ static int copy_entries_to_user(unsigned int total_size, |
2563 |
+ unsigned int off, num; |
2564 |
+ const struct arpt_entry *e; |
2565 |
+ struct xt_counters *counters; |
2566 |
+- struct xt_table_info *private = xt_table_get_private_protected(table); |
2567 |
++ struct xt_table_info *private = table->private; |
2568 |
+ int ret = 0; |
2569 |
+ void *loc_cpu_entry; |
2570 |
+ |
2571 |
+@@ -808,7 +808,7 @@ static int get_info(struct net *net, void __user *user, |
2572 |
+ t = xt_request_find_table_lock(net, NFPROTO_ARP, name); |
2573 |
+ if (!IS_ERR(t)) { |
2574 |
+ struct arpt_getinfo info; |
2575 |
+- const struct xt_table_info *private = xt_table_get_private_protected(t); |
2576 |
++ const struct xt_table_info *private = t->private; |
2577 |
+ #ifdef CONFIG_COMPAT |
2578 |
+ struct xt_table_info tmp; |
2579 |
+ |
2580 |
+@@ -861,7 +861,7 @@ static int get_entries(struct net *net, struct arpt_get_entries __user *uptr, |
2581 |
+ |
2582 |
+ t = xt_find_table_lock(net, NFPROTO_ARP, get.name); |
2583 |
+ if (!IS_ERR(t)) { |
2584 |
+- const struct xt_table_info *private = xt_table_get_private_protected(t); |
2585 |
++ const struct xt_table_info *private = t->private; |
2586 |
+ |
2587 |
+ if (get.size == private->size) |
2588 |
+ ret = copy_entries_to_user(private->size, |
2589 |
+@@ -1020,7 +1020,7 @@ static int do_add_counters(struct net *net, const void __user *user, |
2590 |
+ } |
2591 |
+ |
2592 |
+ local_bh_disable(); |
2593 |
+- private = xt_table_get_private_protected(t); |
2594 |
++ private = t->private; |
2595 |
+ if (private->number != tmp.num_counters) { |
2596 |
+ ret = -EINVAL; |
2597 |
+ goto unlock_up_free; |
2598 |
+@@ -1357,7 +1357,7 @@ static int compat_copy_entries_to_user(unsigned int total_size, |
2599 |
+ void __user *userptr) |
2600 |
+ { |
2601 |
+ struct xt_counters *counters; |
2602 |
+- const struct xt_table_info *private = xt_table_get_private_protected(table); |
2603 |
++ const struct xt_table_info *private = table->private; |
2604 |
+ void __user *pos; |
2605 |
+ unsigned int size; |
2606 |
+ int ret = 0; |
2607 |
+@@ -1406,7 +1406,7 @@ static int compat_get_entries(struct net *net, |
2608 |
+ xt_compat_lock(NFPROTO_ARP); |
2609 |
+ t = xt_find_table_lock(net, NFPROTO_ARP, get.name); |
2610 |
+ if (!IS_ERR(t)) { |
2611 |
+- const struct xt_table_info *private = xt_table_get_private_protected(t); |
2612 |
++ const struct xt_table_info *private = t->private; |
2613 |
+ struct xt_table_info info; |
2614 |
+ |
2615 |
+ ret = compat_table_info(private, &info); |
2616 |
+diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c |
2617 |
+index cbbc8a7b82788..10b91ebdf2131 100644 |
2618 |
+--- a/net/ipv4/netfilter/ip_tables.c |
2619 |
++++ b/net/ipv4/netfilter/ip_tables.c |
2620 |
+@@ -258,7 +258,7 @@ ipt_do_table(struct sk_buff *skb, |
2621 |
+ WARN_ON(!(table->valid_hooks & (1 << hook))); |
2622 |
+ local_bh_disable(); |
2623 |
+ addend = xt_write_recseq_begin(); |
2624 |
+- private = rcu_access_pointer(table->private); |
2625 |
++ private = READ_ONCE(table->private); /* Address dependency. */ |
2626 |
+ cpu = smp_processor_id(); |
2627 |
+ table_base = private->entries; |
2628 |
+ jumpstack = (struct ipt_entry **)private->jumpstack[cpu]; |
2629 |
+@@ -791,7 +791,7 @@ static struct xt_counters *alloc_counters(const struct xt_table *table) |
2630 |
+ { |
2631 |
+ unsigned int countersize; |
2632 |
+ struct xt_counters *counters; |
2633 |
+- const struct xt_table_info *private = xt_table_get_private_protected(table); |
2634 |
++ const struct xt_table_info *private = table->private; |
2635 |
+ |
2636 |
+ /* We need atomic snapshot of counters: rest doesn't change |
2637 |
+ (other than comefrom, which userspace doesn't care |
2638 |
+@@ -815,7 +815,7 @@ copy_entries_to_user(unsigned int total_size, |
2639 |
+ unsigned int off, num; |
2640 |
+ const struct ipt_entry *e; |
2641 |
+ struct xt_counters *counters; |
2642 |
+- const struct xt_table_info *private = xt_table_get_private_protected(table); |
2643 |
++ const struct xt_table_info *private = table->private; |
2644 |
+ int ret = 0; |
2645 |
+ const void *loc_cpu_entry; |
2646 |
+ |
2647 |
+@@ -965,7 +965,7 @@ static int get_info(struct net *net, void __user *user, |
2648 |
+ t = xt_request_find_table_lock(net, AF_INET, name); |
2649 |
+ if (!IS_ERR(t)) { |
2650 |
+ struct ipt_getinfo info; |
2651 |
+- const struct xt_table_info *private = xt_table_get_private_protected(t); |
2652 |
++ const struct xt_table_info *private = t->private; |
2653 |
+ #ifdef CONFIG_COMPAT |
2654 |
+ struct xt_table_info tmp; |
2655 |
+ |
2656 |
+@@ -1019,7 +1019,7 @@ get_entries(struct net *net, struct ipt_get_entries __user *uptr, |
2657 |
+ |
2658 |
+ t = xt_find_table_lock(net, AF_INET, get.name); |
2659 |
+ if (!IS_ERR(t)) { |
2660 |
+- const struct xt_table_info *private = xt_table_get_private_protected(t); |
2661 |
++ const struct xt_table_info *private = t->private; |
2662 |
+ if (get.size == private->size) |
2663 |
+ ret = copy_entries_to_user(private->size, |
2664 |
+ t, uptr->entrytable); |
2665 |
+@@ -1175,7 +1175,7 @@ do_add_counters(struct net *net, const void __user *user, |
2666 |
+ } |
2667 |
+ |
2668 |
+ local_bh_disable(); |
2669 |
+- private = xt_table_get_private_protected(t); |
2670 |
++ private = t->private; |
2671 |
+ if (private->number != tmp.num_counters) { |
2672 |
+ ret = -EINVAL; |
2673 |
+ goto unlock_up_free; |
2674 |
+@@ -1570,7 +1570,7 @@ compat_copy_entries_to_user(unsigned int total_size, struct xt_table *table, |
2675 |
+ void __user *userptr) |
2676 |
+ { |
2677 |
+ struct xt_counters *counters; |
2678 |
+- const struct xt_table_info *private = xt_table_get_private_protected(table); |
2679 |
++ const struct xt_table_info *private = table->private; |
2680 |
+ void __user *pos; |
2681 |
+ unsigned int size; |
2682 |
+ int ret = 0; |
2683 |
+@@ -1616,7 +1616,7 @@ compat_get_entries(struct net *net, struct compat_ipt_get_entries __user *uptr, |
2684 |
+ xt_compat_lock(AF_INET); |
2685 |
+ t = xt_find_table_lock(net, AF_INET, get.name); |
2686 |
+ if (!IS_ERR(t)) { |
2687 |
+- const struct xt_table_info *private = xt_table_get_private_protected(t); |
2688 |
++ const struct xt_table_info *private = t->private; |
2689 |
+ struct xt_table_info info; |
2690 |
+ ret = compat_table_info(private, &info); |
2691 |
+ if (!ret && get.size == info.size) |
2692 |
+diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c |
2693 |
+index c802bc80c4006..194743bd3fc10 100644 |
2694 |
+--- a/net/ipv4/tcp_minisocks.c |
2695 |
++++ b/net/ipv4/tcp_minisocks.c |
2696 |
+@@ -796,8 +796,11 @@ embryonic_reset: |
2697 |
+ tcp_reset(sk); |
2698 |
+ } |
2699 |
+ if (!fastopen) { |
2700 |
+- inet_csk_reqsk_queue_drop(sk, req); |
2701 |
+- __NET_INC_STATS(sock_net(sk), LINUX_MIB_EMBRYONICRSTS); |
2702 |
++ bool unlinked = inet_csk_reqsk_queue_drop(sk, req); |
2703 |
++ |
2704 |
++ if (unlinked) |
2705 |
++ __NET_INC_STATS(sock_net(sk), LINUX_MIB_EMBRYONICRSTS); |
2706 |
++ *req_stolen = !unlinked; |
2707 |
+ } |
2708 |
+ return NULL; |
2709 |
+ } |
2710 |
+diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c |
2711 |
+index 906ac5e6d96cd..bb68290ad68d8 100644 |
2712 |
+--- a/net/ipv6/ip6_fib.c |
2713 |
++++ b/net/ipv6/ip6_fib.c |
2714 |
+@@ -2382,7 +2382,7 @@ static int ipv6_route_seq_show(struct seq_file *seq, void *v) |
2715 |
+ const struct net_device *dev; |
2716 |
+ |
2717 |
+ if (rt->nh) |
2718 |
+- fib6_nh = nexthop_fib6_nh(rt->nh); |
2719 |
++ fib6_nh = nexthop_fib6_nh_bh(rt->nh); |
2720 |
+ |
2721 |
+ seq_printf(seq, "%pi6 %02x ", &rt->fib6_dst.addr, rt->fib6_dst.plen); |
2722 |
+ |
2723 |
+diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c |
2724 |
+index 01cdde25eb16d..c973ace208c51 100644 |
2725 |
+--- a/net/ipv6/netfilter/ip6_tables.c |
2726 |
++++ b/net/ipv6/netfilter/ip6_tables.c |
2727 |
+@@ -280,7 +280,7 @@ ip6t_do_table(struct sk_buff *skb, |
2728 |
+ |
2729 |
+ local_bh_disable(); |
2730 |
+ addend = xt_write_recseq_begin(); |
2731 |
+- private = rcu_access_pointer(table->private); |
2732 |
++ private = READ_ONCE(table->private); /* Address dependency. */ |
2733 |
+ cpu = smp_processor_id(); |
2734 |
+ table_base = private->entries; |
2735 |
+ jumpstack = (struct ip6t_entry **)private->jumpstack[cpu]; |
2736 |
+@@ -807,7 +807,7 @@ static struct xt_counters *alloc_counters(const struct xt_table *table) |
2737 |
+ { |
2738 |
+ unsigned int countersize; |
2739 |
+ struct xt_counters *counters; |
2740 |
+- const struct xt_table_info *private = xt_table_get_private_protected(table); |
2741 |
++ const struct xt_table_info *private = table->private; |
2742 |
+ |
2743 |
+ /* We need atomic snapshot of counters: rest doesn't change |
2744 |
+ (other than comefrom, which userspace doesn't care |
2745 |
+@@ -831,7 +831,7 @@ copy_entries_to_user(unsigned int total_size, |
2746 |
+ unsigned int off, num; |
2747 |
+ const struct ip6t_entry *e; |
2748 |
+ struct xt_counters *counters; |
2749 |
+- const struct xt_table_info *private = xt_table_get_private_protected(table); |
2750 |
++ const struct xt_table_info *private = table->private; |
2751 |
+ int ret = 0; |
2752 |
+ const void *loc_cpu_entry; |
2753 |
+ |
2754 |
+@@ -981,7 +981,7 @@ static int get_info(struct net *net, void __user *user, |
2755 |
+ t = xt_request_find_table_lock(net, AF_INET6, name); |
2756 |
+ if (!IS_ERR(t)) { |
2757 |
+ struct ip6t_getinfo info; |
2758 |
+- const struct xt_table_info *private = xt_table_get_private_protected(t); |
2759 |
++ const struct xt_table_info *private = t->private; |
2760 |
+ #ifdef CONFIG_COMPAT |
2761 |
+ struct xt_table_info tmp; |
2762 |
+ |
2763 |
+@@ -1036,7 +1036,7 @@ get_entries(struct net *net, struct ip6t_get_entries __user *uptr, |
2764 |
+ |
2765 |
+ t = xt_find_table_lock(net, AF_INET6, get.name); |
2766 |
+ if (!IS_ERR(t)) { |
2767 |
+- struct xt_table_info *private = xt_table_get_private_protected(t); |
2768 |
++ struct xt_table_info *private = t->private; |
2769 |
+ if (get.size == private->size) |
2770 |
+ ret = copy_entries_to_user(private->size, |
2771 |
+ t, uptr->entrytable); |
2772 |
+@@ -1191,7 +1191,7 @@ do_add_counters(struct net *net, const void __user *user, unsigned int len, |
2773 |
+ } |
2774 |
+ |
2775 |
+ local_bh_disable(); |
2776 |
+- private = xt_table_get_private_protected(t); |
2777 |
++ private = t->private; |
2778 |
+ if (private->number != tmp.num_counters) { |
2779 |
+ ret = -EINVAL; |
2780 |
+ goto unlock_up_free; |
2781 |
+@@ -1579,7 +1579,7 @@ compat_copy_entries_to_user(unsigned int total_size, struct xt_table *table, |
2782 |
+ void __user *userptr) |
2783 |
+ { |
2784 |
+ struct xt_counters *counters; |
2785 |
+- const struct xt_table_info *private = xt_table_get_private_protected(table); |
2786 |
++ const struct xt_table_info *private = table->private; |
2787 |
+ void __user *pos; |
2788 |
+ unsigned int size; |
2789 |
+ int ret = 0; |
2790 |
+@@ -1625,7 +1625,7 @@ compat_get_entries(struct net *net, struct compat_ip6t_get_entries __user *uptr, |
2791 |
+ xt_compat_lock(AF_INET6); |
2792 |
+ t = xt_find_table_lock(net, AF_INET6, get.name); |
2793 |
+ if (!IS_ERR(t)) { |
2794 |
+- const struct xt_table_info *private = xt_table_get_private_protected(t); |
2795 |
++ const struct xt_table_info *private = t->private; |
2796 |
+ struct xt_table_info info; |
2797 |
+ ret = compat_table_info(private, &info); |
2798 |
+ if (!ret && get.size == info.size) |
2799 |
+diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c |
2800 |
+index fa293feef935d..677928bf13d13 100644 |
2801 |
+--- a/net/mac80211/cfg.c |
2802 |
++++ b/net/mac80211/cfg.c |
2803 |
+@@ -2906,14 +2906,14 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, |
2804 |
+ continue; |
2805 |
+ |
2806 |
+ for (j = 0; j < IEEE80211_HT_MCS_MASK_LEN; j++) { |
2807 |
+- if (~sdata->rc_rateidx_mcs_mask[i][j]) { |
2808 |
++ if (sdata->rc_rateidx_mcs_mask[i][j] != 0xff) { |
2809 |
+ sdata->rc_has_mcs_mask[i] = true; |
2810 |
+ break; |
2811 |
+ } |
2812 |
+ } |
2813 |
+ |
2814 |
+ for (j = 0; j < NL80211_VHT_NSS_MAX; j++) { |
2815 |
+- if (~sdata->rc_rateidx_vht_mcs_mask[i][j]) { |
2816 |
++ if (sdata->rc_rateidx_vht_mcs_mask[i][j] != 0xffff) { |
2817 |
+ sdata->rc_has_vht_mcs_mask[i] = true; |
2818 |
+ break; |
2819 |
+ } |
2820 |
+diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c |
2821 |
+index 0a6ff01c68a96..0e26c83b6b412 100644 |
2822 |
+--- a/net/mac80211/ibss.c |
2823 |
++++ b/net/mac80211/ibss.c |
2824 |
+@@ -1868,6 +1868,8 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata) |
2825 |
+ |
2826 |
+ /* remove beacon */ |
2827 |
+ kfree(sdata->u.ibss.ie); |
2828 |
++ sdata->u.ibss.ie = NULL; |
2829 |
++ sdata->u.ibss.ie_len = 0; |
2830 |
+ |
2831 |
+ /* on the next join, re-program HT parameters */ |
2832 |
+ memset(&ifibss->ht_capa, 0, sizeof(ifibss->ht_capa)); |
2833 |
+diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c |
2834 |
+index b7f0d52e5f1b6..783af451a8325 100644 |
2835 |
+--- a/net/netfilter/nf_conntrack_netlink.c |
2836 |
++++ b/net/netfilter/nf_conntrack_netlink.c |
2837 |
+@@ -2680,6 +2680,7 @@ static int ctnetlink_exp_dump_mask(struct sk_buff *skb, |
2838 |
+ memset(&m, 0xFF, sizeof(m)); |
2839 |
+ memcpy(&m.src.u3, &mask->src.u3, sizeof(m.src.u3)); |
2840 |
+ m.src.u.all = mask->src.u.all; |
2841 |
++ m.src.l3num = tuple->src.l3num; |
2842 |
+ m.dst.protonum = tuple->dst.protonum; |
2843 |
+ |
2844 |
+ nest_parms = nla_nest_start(skb, CTA_EXPECT_MASK); |
2845 |
+diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c |
2846 |
+index 8b60fc04c67c2..5c35d64d1f342 100644 |
2847 |
+--- a/net/netfilter/x_tables.c |
2848 |
++++ b/net/netfilter/x_tables.c |
2849 |
+@@ -1351,14 +1351,6 @@ struct xt_counters *xt_counters_alloc(unsigned int counters) |
2850 |
+ } |
2851 |
+ EXPORT_SYMBOL(xt_counters_alloc); |
2852 |
+ |
2853 |
+-struct xt_table_info |
2854 |
+-*xt_table_get_private_protected(const struct xt_table *table) |
2855 |
+-{ |
2856 |
+- return rcu_dereference_protected(table->private, |
2857 |
+- mutex_is_locked(&xt[table->af].mutex)); |
2858 |
+-} |
2859 |
+-EXPORT_SYMBOL(xt_table_get_private_protected); |
2860 |
+- |
2861 |
+ struct xt_table_info * |
2862 |
+ xt_replace_table(struct xt_table *table, |
2863 |
+ unsigned int num_counters, |
2864 |
+@@ -1366,6 +1358,7 @@ xt_replace_table(struct xt_table *table, |
2865 |
+ int *error) |
2866 |
+ { |
2867 |
+ struct xt_table_info *private; |
2868 |
++ unsigned int cpu; |
2869 |
+ int ret; |
2870 |
+ |
2871 |
+ ret = xt_jumpstack_alloc(newinfo); |
2872 |
+@@ -1375,20 +1368,47 @@ xt_replace_table(struct xt_table *table, |
2873 |
+ } |
2874 |
+ |
2875 |
+ /* Do the substitution. */ |
2876 |
+- private = xt_table_get_private_protected(table); |
2877 |
++ local_bh_disable(); |
2878 |
++ private = table->private; |
2879 |
+ |
2880 |
+ /* Check inside lock: is the old number correct? */ |
2881 |
+ if (num_counters != private->number) { |
2882 |
+ pr_debug("num_counters != table->private->number (%u/%u)\n", |
2883 |
+ num_counters, private->number); |
2884 |
++ local_bh_enable(); |
2885 |
+ *error = -EAGAIN; |
2886 |
+ return NULL; |
2887 |
+ } |
2888 |
+ |
2889 |
+ newinfo->initial_entries = private->initial_entries; |
2890 |
++ /* |
2891 |
++ * Ensure contents of newinfo are visible before assigning to |
2892 |
++ * private. |
2893 |
++ */ |
2894 |
++ smp_wmb(); |
2895 |
++ table->private = newinfo; |
2896 |
++ |
2897 |
++ /* make sure all cpus see new ->private value */ |
2898 |
++ smp_mb(); |
2899 |
+ |
2900 |
+- rcu_assign_pointer(table->private, newinfo); |
2901 |
+- synchronize_rcu(); |
2902 |
++ /* |
2903 |
++ * Even though table entries have now been swapped, other CPU's |
2904 |
++ * may still be using the old entries... |
2905 |
++ */ |
2906 |
++ local_bh_enable(); |
2907 |
++ |
2908 |
++ /* ... so wait for even xt_recseq on all cpus */ |
2909 |
++ for_each_possible_cpu(cpu) { |
2910 |
++ seqcount_t *s = &per_cpu(xt_recseq, cpu); |
2911 |
++ u32 seq = raw_read_seqcount(s); |
2912 |
++ |
2913 |
++ if (seq & 1) { |
2914 |
++ do { |
2915 |
++ cond_resched(); |
2916 |
++ cpu_relax(); |
2917 |
++ } while (seq == raw_read_seqcount(s)); |
2918 |
++ } |
2919 |
++ } |
2920 |
+ |
2921 |
+ #ifdef CONFIG_AUDIT |
2922 |
+ if (audit_enabled) { |
2923 |
+@@ -1429,12 +1449,12 @@ struct xt_table *xt_register_table(struct net *net, |
2924 |
+ } |
2925 |
+ |
2926 |
+ /* Simplifies replace_table code. */ |
2927 |
+- rcu_assign_pointer(table->private, bootstrap); |
2928 |
++ table->private = bootstrap; |
2929 |
+ |
2930 |
+ if (!xt_replace_table(table, 0, newinfo, &ret)) |
2931 |
+ goto unlock; |
2932 |
+ |
2933 |
+- private = xt_table_get_private_protected(table); |
2934 |
++ private = table->private; |
2935 |
+ pr_debug("table->private->number = %u\n", private->number); |
2936 |
+ |
2937 |
+ /* save number of initial entries */ |
2938 |
+@@ -1457,8 +1477,7 @@ void *xt_unregister_table(struct xt_table *table) |
2939 |
+ struct xt_table_info *private; |
2940 |
+ |
2941 |
+ mutex_lock(&xt[table->af].mutex); |
2942 |
+- private = xt_table_get_private_protected(table); |
2943 |
+- RCU_INIT_POINTER(table->private, NULL); |
2944 |
++ private = table->private; |
2945 |
+ list_del(&table->list); |
2946 |
+ mutex_unlock(&xt[table->af].mutex); |
2947 |
+ kfree(table); |
2948 |
+diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c |
2949 |
+index 0d4f12dbd2443..46273a8383615 100644 |
2950 |
+--- a/net/qrtr/qrtr.c |
2951 |
++++ b/net/qrtr/qrtr.c |
2952 |
+@@ -862,6 +862,11 @@ static int qrtr_recvmsg(struct socket *sock, struct msghdr *msg, |
2953 |
+ rc = copied; |
2954 |
+ |
2955 |
+ if (addr) { |
2956 |
++ /* There is an anonymous 2-byte hole after sq_family, |
2957 |
++ * make sure to clear it. |
2958 |
++ */ |
2959 |
++ memset(addr, 0, sizeof(*addr)); |
2960 |
++ |
2961 |
+ cb = (struct qrtr_cb *)skb->cb; |
2962 |
+ addr->sq_family = AF_QIPCRTR; |
2963 |
+ addr->sq_node = cb->src_node; |
2964 |
+diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c |
2965 |
+index d856b395ee8eb..e54f6eabfa0c0 100644 |
2966 |
+--- a/net/sched/sch_choke.c |
2967 |
++++ b/net/sched/sch_choke.c |
2968 |
+@@ -351,6 +351,7 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt, |
2969 |
+ struct sk_buff **old = NULL; |
2970 |
+ unsigned int mask; |
2971 |
+ u32 max_P; |
2972 |
++ u8 *stab; |
2973 |
+ |
2974 |
+ if (opt == NULL) |
2975 |
+ return -EINVAL; |
2976 |
+@@ -367,8 +368,8 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt, |
2977 |
+ max_P = tb[TCA_CHOKE_MAX_P] ? nla_get_u32(tb[TCA_CHOKE_MAX_P]) : 0; |
2978 |
+ |
2979 |
+ ctl = nla_data(tb[TCA_CHOKE_PARMS]); |
2980 |
+- |
2981 |
+- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log)) |
2982 |
++ stab = nla_data(tb[TCA_CHOKE_STAB]); |
2983 |
++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log, stab)) |
2984 |
+ return -EINVAL; |
2985 |
+ |
2986 |
+ if (ctl->limit > CHOKE_MAX_QUEUE) |
2987 |
+@@ -418,7 +419,7 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt, |
2988 |
+ |
2989 |
+ red_set_parms(&q->parms, ctl->qth_min, ctl->qth_max, ctl->Wlog, |
2990 |
+ ctl->Plog, ctl->Scell_log, |
2991 |
+- nla_data(tb[TCA_CHOKE_STAB]), |
2992 |
++ stab, |
2993 |
+ max_P); |
2994 |
+ red_set_vars(&q->vars); |
2995 |
+ |
2996 |
+diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c |
2997 |
+index e0bc77533acc3..f4132dc25ac05 100644 |
2998 |
+--- a/net/sched/sch_gred.c |
2999 |
++++ b/net/sched/sch_gred.c |
3000 |
+@@ -480,7 +480,7 @@ static inline int gred_change_vq(struct Qdisc *sch, int dp, |
3001 |
+ struct gred_sched *table = qdisc_priv(sch); |
3002 |
+ struct gred_sched_data *q = table->tab[dp]; |
3003 |
+ |
3004 |
+- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log)) { |
3005 |
++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log, stab)) { |
3006 |
+ NL_SET_ERR_MSG_MOD(extack, "invalid RED parameters"); |
3007 |
+ return -EINVAL; |
3008 |
+ } |
3009 |
+diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c |
3010 |
+index 71e167e91a48d..7741f102be4a0 100644 |
3011 |
+--- a/net/sched/sch_red.c |
3012 |
++++ b/net/sched/sch_red.c |
3013 |
+@@ -197,6 +197,7 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt, |
3014 |
+ struct tc_red_qopt *ctl; |
3015 |
+ int err; |
3016 |
+ u32 max_P; |
3017 |
++ u8 *stab; |
3018 |
+ |
3019 |
+ if (opt == NULL) |
3020 |
+ return -EINVAL; |
3021 |
+@@ -213,7 +214,9 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt, |
3022 |
+ max_P = tb[TCA_RED_MAX_P] ? nla_get_u32(tb[TCA_RED_MAX_P]) : 0; |
3023 |
+ |
3024 |
+ ctl = nla_data(tb[TCA_RED_PARMS]); |
3025 |
+- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log)) |
3026 |
++ stab = nla_data(tb[TCA_RED_STAB]); |
3027 |
++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, |
3028 |
++ ctl->Scell_log, stab)) |
3029 |
+ return -EINVAL; |
3030 |
+ |
3031 |
+ if (ctl->limit > 0) { |
3032 |
+@@ -238,7 +241,7 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt, |
3033 |
+ red_set_parms(&q->parms, |
3034 |
+ ctl->qth_min, ctl->qth_max, ctl->Wlog, |
3035 |
+ ctl->Plog, ctl->Scell_log, |
3036 |
+- nla_data(tb[TCA_RED_STAB]), |
3037 |
++ stab, |
3038 |
+ max_P); |
3039 |
+ red_set_vars(&q->vars); |
3040 |
+ |
3041 |
+diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c |
3042 |
+index 6e13e137883c3..b92bafaf83f36 100644 |
3043 |
+--- a/net/sched/sch_sfq.c |
3044 |
++++ b/net/sched/sch_sfq.c |
3045 |
+@@ -647,7 +647,7 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt) |
3046 |
+ } |
3047 |
+ |
3048 |
+ if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max, |
3049 |
+- ctl_v1->Wlog, ctl_v1->Scell_log)) |
3050 |
++ ctl_v1->Wlog, ctl_v1->Scell_log, NULL)) |
3051 |
+ return -EINVAL; |
3052 |
+ if (ctl_v1 && ctl_v1->qth_min) { |
3053 |
+ p = kmalloc(sizeof(*p), GFP_KERNEL); |
3054 |
+diff --git a/security/integrity/iint.c b/security/integrity/iint.c |
3055 |
+index e12c4900510f6..0b9cb639a0ed0 100644 |
3056 |
+--- a/security/integrity/iint.c |
3057 |
++++ b/security/integrity/iint.c |
3058 |
+@@ -98,6 +98,14 @@ struct integrity_iint_cache *integrity_inode_get(struct inode *inode) |
3059 |
+ struct rb_node *node, *parent = NULL; |
3060 |
+ struct integrity_iint_cache *iint, *test_iint; |
3061 |
+ |
3062 |
++ /* |
3063 |
++ * The integrity's "iint_cache" is initialized at security_init(), |
3064 |
++ * unless it is not included in the ordered list of LSMs enabled |
3065 |
++ * on the boot command line. |
3066 |
++ */ |
3067 |
++ if (!iint_cache) |
3068 |
++ panic("%s: lsm=integrity required.\n", __func__); |
3069 |
++ |
3070 |
+ iint = integrity_iint_find(inode); |
3071 |
+ if (iint) |
3072 |
+ return iint; |
3073 |
+diff --git a/sound/hda/intel-nhlt.c b/sound/hda/intel-nhlt.c |
3074 |
+index baeda6c9716a1..6ed80a4cba01a 100644 |
3075 |
+--- a/sound/hda/intel-nhlt.c |
3076 |
++++ b/sound/hda/intel-nhlt.c |
3077 |
+@@ -72,6 +72,11 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt) |
3078 |
+ if (!nhlt) |
3079 |
+ return 0; |
3080 |
+ |
3081 |
++ if (nhlt->header.length <= sizeof(struct acpi_table_header)) { |
3082 |
++ dev_warn(dev, "Invalid DMIC description table\n"); |
3083 |
++ return 0; |
3084 |
++ } |
3085 |
++ |
3086 |
+ for (j = 0, epnt = nhlt->desc; j < nhlt->endpoint_count; j++, |
3087 |
+ epnt = (struct nhlt_endpoint *)((u8 *)epnt + epnt->length)) { |
3088 |
+ |
3089 |
+diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile |
3090 |
+index 283caeaaffc30..9758bfa592321 100644 |
3091 |
+--- a/tools/lib/bpf/Makefile |
3092 |
++++ b/tools/lib/bpf/Makefile |
3093 |
+@@ -241,7 +241,7 @@ define do_install |
3094 |
+ if [ ! -d '$(DESTDIR_SQ)$2' ]; then \ |
3095 |
+ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \ |
3096 |
+ fi; \ |
3097 |
+- $(INSTALL) $1 $(if $3,-m $3,) '$(DESTDIR_SQ)$2' |
3098 |
++ $(INSTALL) $(if $3,-m $3,) $1 '$(DESTDIR_SQ)$2' |
3099 |
+ endef |
3100 |
+ |
3101 |
+ install_lib: all_cmd |
3102 |
+diff --git a/tools/lib/bpf/btf_dump.c b/tools/lib/bpf/btf_dump.c |
3103 |
+index d9e386b8f47ed..b2fc452504501 100644 |
3104 |
+--- a/tools/lib/bpf/btf_dump.c |
3105 |
++++ b/tools/lib/bpf/btf_dump.c |
3106 |
+@@ -443,7 +443,7 @@ static int btf_dump_order_type(struct btf_dump *d, __u32 id, bool through_ptr) |
3107 |
+ return err; |
3108 |
+ |
3109 |
+ case BTF_KIND_ARRAY: |
3110 |
+- return btf_dump_order_type(d, btf_array(t)->type, through_ptr); |
3111 |
++ return btf_dump_order_type(d, btf_array(t)->type, false); |
3112 |
+ |
3113 |
+ case BTF_KIND_STRUCT: |
3114 |
+ case BTF_KIND_UNION: { |
3115 |
+diff --git a/tools/lib/bpf/netlink.c b/tools/lib/bpf/netlink.c |
3116 |
+index 88416be2bf994..5ec8043c71bca 100644 |
3117 |
+--- a/tools/lib/bpf/netlink.c |
3118 |
++++ b/tools/lib/bpf/netlink.c |
3119 |
+@@ -37,7 +37,7 @@ int libbpf_netlink_open(__u32 *nl_pid) |
3120 |
+ memset(&sa, 0, sizeof(sa)); |
3121 |
+ sa.nl_family = AF_NETLINK; |
3122 |
+ |
3123 |
+- sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); |
3124 |
++ sock = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE); |
3125 |
+ if (sock < 0) |
3126 |
+ return -errno; |
3127 |
+ |
3128 |
+diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c |
3129 |
+index 8470dfe9fe97b..61b8dc45428ff 100644 |
3130 |
+--- a/tools/perf/util/auxtrace.c |
3131 |
++++ b/tools/perf/util/auxtrace.c |
3132 |
+@@ -252,10 +252,6 @@ static int auxtrace_queues__queue_buffer(struct auxtrace_queues *queues, |
3133 |
+ queue->set = true; |
3134 |
+ queue->tid = buffer->tid; |
3135 |
+ queue->cpu = buffer->cpu; |
3136 |
+- } else if (buffer->cpu != queue->cpu || buffer->tid != queue->tid) { |
3137 |
+- pr_err("auxtrace queue conflict: cpu %d, tid %d vs cpu %d, tid %d\n", |
3138 |
+- queue->cpu, queue->tid, buffer->cpu, buffer->tid); |
3139 |
+- return -EINVAL; |
3140 |
+ } |
3141 |
+ |
3142 |
+ buffer->buffer_nr = queues->next_buffer_nr++; |
3143 |
+diff --git a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c |
3144 |
+index b4e9a1d8c6cdb..141670ab4e670 100644 |
3145 |
+--- a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c |
3146 |
++++ b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c |
3147 |
+@@ -508,10 +508,8 @@ int _ip6geneve_get_tunnel(struct __sk_buff *skb) |
3148 |
+ } |
3149 |
+ |
3150 |
+ ret = bpf_skb_get_tunnel_opt(skb, &gopt, sizeof(gopt)); |
3151 |
+- if (ret < 0) { |
3152 |
+- ERROR(ret); |
3153 |
+- return TC_ACT_SHOT; |
3154 |
+- } |
3155 |
++ if (ret < 0) |
3156 |
++ gopt.opt_class = 0; |
3157 |
+ |
3158 |
+ bpf_trace_printk(fmt, sizeof(fmt), |
3159 |
+ key.tunnel_id, key.remote_ipv4, gopt.opt_class); |
3160 |
+diff --git a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh |
3161 |
+index ce6bea9675c07..0ccb1dda099ae 100755 |
3162 |
+--- a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh |
3163 |
++++ b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh |
3164 |
+@@ -658,7 +658,7 @@ test_ecn_decap() |
3165 |
+ # In accordance with INET_ECN_decapsulate() |
3166 |
+ __test_ecn_decap 00 00 0x00 |
3167 |
+ __test_ecn_decap 01 01 0x01 |
3168 |
+- __test_ecn_decap 02 01 0x02 |
3169 |
++ __test_ecn_decap 02 01 0x01 |
3170 |
+ __test_ecn_decap 01 03 0x03 |
3171 |
+ __test_ecn_decap 02 03 0x03 |
3172 |
+ test_ecn_decap_error |