Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.14 commit in: /
Date: Tue, 30 Mar 2021 14:15:37
Message-Id: 1617113720.d2c3a71d5e72a5b2a2993344b1318573086d8177.mpagano@gentoo
1 commit: d2c3a71d5e72a5b2a2993344b1318573086d8177
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 30 14:15:20 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 30 14:15:20 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=d2c3a71d
7
8 Linux patch 4.14.228
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1227_linux-4.14.228.patch | 1490 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 1494 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index e2f51c8..f78a10d 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -951,6 +951,10 @@ Patch: 1226_linux-4.14.227.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.14.227
23
24 +Patch: 1227_linux-4.14.228.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.14.228
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/1227_linux-4.14.228.patch b/1227_linux-4.14.228.patch
33 new file mode 100644
34 index 0000000..41d8570
35 --- /dev/null
36 +++ b/1227_linux-4.14.228.patch
37 @@ -0,0 +1,1490 @@
38 +diff --git a/Makefile b/Makefile
39 +index 60506b154d53d..b30a6e708d5ee 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 14
46 +-SUBLEVEL = 227
47 ++SUBLEVEL = 228
48 + EXTRAVERSION =
49 + NAME = Petit Gorille
50 +
51 +diff --git a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
52 +index cf0087b4c9e18..ea02a51c71e23 100644
53 +--- a/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
54 ++++ b/arch/arm/boot/dts/at91-sama5d27_som1.dtsi
55 +@@ -67,8 +67,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 df83915d6ea62..2bdd787190c9c 100644
68 +--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
69 ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
70 +@@ -164,6 +164,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 d16b9cc1e8252..990b576b2b7b5 100644
80 +--- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
81 ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
82 +@@ -219,6 +219,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 cb49d21e317c0..24bee3b7f3eec 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 f46d57c314430..76905a2585505 100644
104 +--- a/arch/arm64/kernel/crash_dump.c
105 ++++ b/arch/arm64/kernel/crash_dump.c
106 +@@ -67,5 +67,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 1d0b875fec44f..ec909eec0b4c6 100644
116 +--- a/arch/ia64/include/asm/syscall.h
117 ++++ b/arch/ia64/include/asm/syscall.h
118 +@@ -35,7 +35,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 427cd565fd61d..799400287cdac 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 4a2beef742772..86fdda16bb73e 100644
179 +--- a/arch/powerpc/include/asm/dcr-native.h
180 ++++ b/arch/powerpc/include/asm/dcr-native.h
181 +@@ -65,8 +65,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 +@@ -76,8 +76,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 0a56dc257cb9a..6ab9b87dbca8c 100644
205 +--- a/arch/sparc/kernel/traps_64.c
206 ++++ b/arch/sparc/kernel/traps_64.c
207 +@@ -290,14 +290,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/drivers/acpi/internal.h b/drivers/acpi/internal.h
229 +index e6b10aad55d56..6ac1c6b04199b 100644
230 +--- a/drivers/acpi/internal.h
231 ++++ b/drivers/acpi/internal.h
232 +@@ -18,6 +18,8 @@
233 + #ifndef _ACPI_INTERNAL_H_
234 + #define _ACPI_INTERNAL_H_
235 +
236 ++#include <linux/idr.h>
237 ++
238 + #define PREFIX "ACPI: "
239 +
240 + int early_acpi_osi_init(void);
241 +@@ -97,9 +99,11 @@ void acpi_scan_table_handler(u32 event, void *table, void *context);
242 +
243 + extern struct list_head acpi_bus_id_list;
244 +
245 ++#define ACPI_MAX_DEVICE_INSTANCES 4096
246 ++
247 + struct acpi_device_bus_id {
248 + const char *bus_id;
249 +- unsigned int instance_no;
250 ++ struct ida instance_ida;
251 + struct list_head node;
252 + };
253 +
254 +diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
255 +index bd58f0743cfc4..57a213466721b 100644
256 +--- a/drivers/acpi/scan.c
257 ++++ b/drivers/acpi/scan.c
258 +@@ -481,9 +481,8 @@ static void acpi_device_del(struct acpi_device *device)
259 + list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node)
260 + if (!strcmp(acpi_device_bus_id->bus_id,
261 + acpi_device_hid(device))) {
262 +- if (acpi_device_bus_id->instance_no > 0)
263 +- acpi_device_bus_id->instance_no--;
264 +- else {
265 ++ ida_simple_remove(&acpi_device_bus_id->instance_ida, device->pnp.instance_no);
266 ++ if (ida_is_empty(&acpi_device_bus_id->instance_ida)) {
267 + list_del(&acpi_device_bus_id->node);
268 + kfree_const(acpi_device_bus_id->bus_id);
269 + kfree(acpi_device_bus_id);
270 +@@ -622,12 +621,38 @@ void acpi_bus_put_acpi_device(struct acpi_device *adev)
271 + put_device(&adev->dev);
272 + }
273 +
274 ++static struct acpi_device_bus_id *acpi_device_bus_id_match(const char *dev_id)
275 ++{
276 ++ struct acpi_device_bus_id *acpi_device_bus_id;
277 ++
278 ++ /* Find suitable bus_id and instance number in acpi_bus_id_list. */
279 ++ list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) {
280 ++ if (!strcmp(acpi_device_bus_id->bus_id, dev_id))
281 ++ return acpi_device_bus_id;
282 ++ }
283 ++ return NULL;
284 ++}
285 ++
286 ++static int acpi_device_set_name(struct acpi_device *device,
287 ++ struct acpi_device_bus_id *acpi_device_bus_id)
288 ++{
289 ++ struct ida *instance_ida = &acpi_device_bus_id->instance_ida;
290 ++ int result;
291 ++
292 ++ result = ida_simple_get(instance_ida, 0, ACPI_MAX_DEVICE_INSTANCES, GFP_KERNEL);
293 ++ if (result < 0)
294 ++ return result;
295 ++
296 ++ device->pnp.instance_no = result;
297 ++ dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, result);
298 ++ return 0;
299 ++}
300 ++
301 + int acpi_device_add(struct acpi_device *device,
302 + void (*release)(struct device *))
303 + {
304 ++ struct acpi_device_bus_id *acpi_device_bus_id;
305 + int result;
306 +- struct acpi_device_bus_id *acpi_device_bus_id, *new_bus_id;
307 +- int found = 0;
308 +
309 + if (device->handle) {
310 + acpi_status status;
311 +@@ -653,41 +678,38 @@ int acpi_device_add(struct acpi_device *device,
312 + INIT_LIST_HEAD(&device->del_list);
313 + mutex_init(&device->physical_node_lock);
314 +
315 +- new_bus_id = kzalloc(sizeof(struct acpi_device_bus_id), GFP_KERNEL);
316 +- if (!new_bus_id) {
317 +- pr_err(PREFIX "Memory allocation error\n");
318 +- result = -ENOMEM;
319 +- goto err_detach;
320 +- }
321 +-
322 + mutex_lock(&acpi_device_lock);
323 +- /*
324 +- * Find suitable bus_id and instance number in acpi_bus_id_list
325 +- * If failed, create one and link it into acpi_bus_id_list
326 +- */
327 +- list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) {
328 +- if (!strcmp(acpi_device_bus_id->bus_id,
329 +- acpi_device_hid(device))) {
330 +- acpi_device_bus_id->instance_no++;
331 +- found = 1;
332 +- kfree(new_bus_id);
333 +- break;
334 ++
335 ++ acpi_device_bus_id = acpi_device_bus_id_match(acpi_device_hid(device));
336 ++ if (acpi_device_bus_id) {
337 ++ result = acpi_device_set_name(device, acpi_device_bus_id);
338 ++ if (result)
339 ++ goto err_unlock;
340 ++ } else {
341 ++ acpi_device_bus_id = kzalloc(sizeof(*acpi_device_bus_id),
342 ++ GFP_KERNEL);
343 ++ if (!acpi_device_bus_id) {
344 ++ result = -ENOMEM;
345 ++ goto err_unlock;
346 + }
347 +- }
348 +- if (!found) {
349 +- acpi_device_bus_id = new_bus_id;
350 + acpi_device_bus_id->bus_id =
351 + kstrdup_const(acpi_device_hid(device), GFP_KERNEL);
352 + if (!acpi_device_bus_id->bus_id) {
353 +- pr_err(PREFIX "Memory allocation error for bus id\n");
354 ++ kfree(acpi_device_bus_id);
355 + result = -ENOMEM;
356 +- goto err_free_new_bus_id;
357 ++ goto err_unlock;
358 ++ }
359 ++
360 ++ ida_init(&acpi_device_bus_id->instance_ida);
361 ++
362 ++ result = acpi_device_set_name(device, acpi_device_bus_id);
363 ++ if (result) {
364 ++ kfree(acpi_device_bus_id);
365 ++ goto err_unlock;
366 + }
367 +
368 +- acpi_device_bus_id->instance_no = 0;
369 + list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list);
370 + }
371 +- dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no);
372 +
373 + if (device->parent)
374 + list_add_tail(&device->node, &device->parent->children);
375 +@@ -719,13 +741,9 @@ int acpi_device_add(struct acpi_device *device,
376 + list_del(&device->node);
377 + list_del(&device->wakeup_list);
378 +
379 +- err_free_new_bus_id:
380 +- if (!found)
381 +- kfree(new_bus_id);
382 +-
383 ++ err_unlock:
384 + mutex_unlock(&acpi_device_lock);
385 +
386 +- err_detach:
387 + acpi_detach_data(device->handle, acpi_scan_drop_device);
388 + return result;
389 + }
390 +diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
391 +index ba549d9454799..ffe519663687e 100644
392 +--- a/drivers/atm/eni.c
393 ++++ b/drivers/atm/eni.c
394 +@@ -2279,7 +2279,8 @@ out:
395 + return rc;
396 +
397 + err_eni_release:
398 +- eni_do_release(dev);
399 ++ dev->phy = NULL;
400 ++ iounmap(ENI_DEV(dev)->ioaddr);
401 + err_unregister:
402 + atm_dev_deregister(dev);
403 + err_free_consistent:
404 +diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
405 +index 082aa02abc574..be3ba90b76b96 100644
406 +--- a/drivers/atm/idt77105.c
407 ++++ b/drivers/atm/idt77105.c
408 +@@ -261,7 +261,7 @@ static int idt77105_start(struct atm_dev *dev)
409 + {
410 + unsigned long flags;
411 +
412 +- if (!(dev->dev_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL)))
413 ++ if (!(dev->phy_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL)))
414 + return -ENOMEM;
415 + PRIV(dev)->dev = dev;
416 + spin_lock_irqsave(&idt77105_priv_lock, flags);
417 +@@ -338,7 +338,7 @@ static int idt77105_stop(struct atm_dev *dev)
418 + else
419 + idt77105_all = walk->next;
420 + dev->phy = NULL;
421 +- dev->dev_data = NULL;
422 ++ dev->phy_data = NULL;
423 + kfree(walk);
424 + break;
425 + }
426 +diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
427 +index 2351dad78ff58..60e5e496bd3b2 100644
428 +--- a/drivers/atm/lanai.c
429 ++++ b/drivers/atm/lanai.c
430 +@@ -2240,6 +2240,7 @@ static int lanai_dev_open(struct atm_dev *atmdev)
431 + conf1_write(lanai);
432 + #endif
433 + iounmap(lanai->base);
434 ++ lanai->base = NULL;
435 + error_pci:
436 + pci_disable_device(lanai->pci);
437 + error:
438 +@@ -2252,6 +2253,8 @@ static int lanai_dev_open(struct atm_dev *atmdev)
439 + static void lanai_dev_close(struct atm_dev *atmdev)
440 + {
441 + struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data;
442 ++ if (lanai->base==NULL)
443 ++ return;
444 + printk(KERN_INFO DEV_LABEL "(itf %d): shutting down interface\n",
445 + lanai->number);
446 + lanai_timed_poll_stop(lanai);
447 +@@ -2561,7 +2564,7 @@ static int lanai_init_one(struct pci_dev *pci,
448 + struct atm_dev *atmdev;
449 + int result;
450 +
451 +- lanai = kmalloc(sizeof(*lanai), GFP_KERNEL);
452 ++ lanai = kzalloc(sizeof(*lanai), GFP_KERNEL);
453 + if (lanai == NULL) {
454 + printk(KERN_ERR DEV_LABEL
455 + ": couldn't allocate dev_data structure!\n");
456 +diff --git a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c
457 +index 4fa13a8078739..cf517fd148ea1 100644
458 +--- a/drivers/atm/uPD98402.c
459 ++++ b/drivers/atm/uPD98402.c
460 +@@ -210,7 +210,7 @@ static void uPD98402_int(struct atm_dev *dev)
461 + static int uPD98402_start(struct atm_dev *dev)
462 + {
463 + DPRINTK("phy_start\n");
464 +- if (!(dev->dev_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL)))
465 ++ if (!(dev->phy_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL)))
466 + return -ENOMEM;
467 + spin_lock_init(&PRIV(dev)->lock);
468 + memset(&PRIV(dev)->sonet_stats,0,sizeof(struct k_sonet_stats));
469 +diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
470 +index a703f365b5b19..ec292aa62046a 100644
471 +--- a/drivers/block/xen-blkback/blkback.c
472 ++++ b/drivers/block/xen-blkback/blkback.c
473 +@@ -937,7 +937,7 @@ next:
474 + out:
475 + for (i = last_map; i < num; i++) {
476 + /* Don't zap current batch's valid persistent grants. */
477 +- if(i >= last_map + segs_to_map)
478 ++ if(i >= map_until)
479 + pages[i]->persistent_gnt = NULL;
480 + pages[i]->handle = BLKBACK_INVALID_HANDLE;
481 + }
482 +diff --git a/drivers/bus/omap_l3_noc.c b/drivers/bus/omap_l3_noc.c
483 +index 5012e3ad12256..624f74d03a83a 100644
484 +--- a/drivers/bus/omap_l3_noc.c
485 ++++ b/drivers/bus/omap_l3_noc.c
486 +@@ -285,7 +285,7 @@ static int omap_l3_probe(struct platform_device *pdev)
487 + */
488 + l3->debug_irq = platform_get_irq(pdev, 0);
489 + ret = devm_request_irq(l3->dev, l3->debug_irq, l3_interrupt_handler,
490 +- 0x0, "l3-dbg-irq", l3);
491 ++ IRQF_NO_THREAD, "l3-dbg-irq", l3);
492 + if (ret) {
493 + dev_err(l3->dev, "request_irq failed for %d\n",
494 + l3->debug_irq);
495 +@@ -294,7 +294,7 @@ static int omap_l3_probe(struct platform_device *pdev)
496 +
497 + l3->app_irq = platform_get_irq(pdev, 1);
498 + ret = devm_request_irq(l3->dev, l3->app_irq, l3_interrupt_handler,
499 +- 0x0, "l3-app-irq", l3);
500 ++ IRQF_NO_THREAD, "l3-app-irq", l3);
501 + if (ret)
502 + dev_err(l3->dev, "request_irq failed for %d\n", l3->app_irq);
503 +
504 +diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
505 +index 7c06f4541c5d0..ab5de5196080b 100644
506 +--- a/drivers/gpio/gpiolib-acpi.c
507 ++++ b/drivers/gpio/gpiolib-acpi.c
508 +@@ -234,7 +234,7 @@ static void acpi_gpiochip_request_irq(struct acpi_gpio_chip *acpi_gpio,
509 + int ret, value;
510 +
511 + ret = request_threaded_irq(event->irq, NULL, event->handler,
512 +- event->irqflags, "ACPI:Event", event);
513 ++ event->irqflags | IRQF_ONESHOT, "ACPI:Event", event);
514 + if (ret) {
515 + dev_err(acpi_gpio->chip->parent,
516 + "Failed to setup interrupt handler for %d\n",
517 +diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
518 +index 83cb2a88c204f..595d0c96ba894 100644
519 +--- a/drivers/gpu/drm/Kconfig
520 ++++ b/drivers/gpu/drm/Kconfig
521 +@@ -156,6 +156,7 @@ source "drivers/gpu/drm/arm/Kconfig"
522 + config DRM_RADEON
523 + tristate "ATI Radeon"
524 + depends on DRM && PCI && MMU
525 ++ depends on AGP || !AGP
526 + select FW_LOADER
527 + select DRM_KMS_HELPER
528 + select DRM_TTM
529 +diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
530 +index c59240b566d83..3dad4687d3ddc 100644
531 +--- a/drivers/gpu/drm/msm/msm_drv.c
532 ++++ b/drivers/gpu/drm/msm/msm_drv.c
533 +@@ -1137,6 +1137,10 @@ static int msm_pdev_remove(struct platform_device *pdev)
534 + static void msm_pdev_shutdown(struct platform_device *pdev)
535 + {
536 + struct drm_device *drm = platform_get_drvdata(pdev);
537 ++ struct msm_drm_private *priv = drm ? drm->dev_private : NULL;
538 ++
539 ++ if (!priv || !priv->kms)
540 ++ return;
541 +
542 + drm_atomic_helper_shutdown(drm);
543 + }
544 +diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
545 +index 5aa545f9a4232..72e2031993fb2 100644
546 +--- a/drivers/infiniband/hw/cxgb4/cm.c
547 ++++ b/drivers/infiniband/hw/cxgb4/cm.c
548 +@@ -3492,13 +3492,13 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id)
549 + ep->com.local_addr.ss_family == AF_INET) {
550 + err = cxgb4_remove_server_filter(
551 + ep->com.dev->rdev.lldi.ports[0], ep->stid,
552 +- ep->com.dev->rdev.lldi.rxq_ids[0], 0);
553 ++ ep->com.dev->rdev.lldi.rxq_ids[0], false);
554 + } else {
555 + struct sockaddr_in6 *sin6;
556 + c4iw_init_wr_wait(&ep->com.wr_wait);
557 + err = cxgb4_remove_server(
558 + ep->com.dev->rdev.lldi.ports[0], ep->stid,
559 +- ep->com.dev->rdev.lldi.rxq_ids[0], 0);
560 ++ ep->com.dev->rdev.lldi.rxq_ids[0], true);
561 + if (err)
562 + goto done;
563 + err = c4iw_wait_for_reply(&ep->com.dev->rdev, &ep->com.wr_wait,
564 +diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
565 +index 469453e106d14..2f020401d5baa 100644
566 +--- a/drivers/md/dm-ioctl.c
567 ++++ b/drivers/md/dm-ioctl.c
568 +@@ -529,7 +529,7 @@ static int list_devices(struct file *filp, struct dm_ioctl *param, size_t param_
569 + * Grab our output buffer.
570 + */
571 + nl = orig_nl = get_result_buffer(param, param_size, &len);
572 +- if (len < needed) {
573 ++ if (len < needed || len < sizeof(nl->dev)) {
574 + param->flags |= DM_BUFFER_FULL_FLAG;
575 + goto out;
576 + }
577 +diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
578 +index 24c6015f6c92b..2278c5fff5c69 100644
579 +--- a/drivers/net/can/c_can/c_can.c
580 ++++ b/drivers/net/can/c_can/c_can.c
581 +@@ -212,18 +212,6 @@ static const struct can_bittiming_const c_can_bittiming_const = {
582 + .brp_inc = 1,
583 + };
584 +
585 +-static inline void c_can_pm_runtime_enable(const struct c_can_priv *priv)
586 +-{
587 +- if (priv->device)
588 +- pm_runtime_enable(priv->device);
589 +-}
590 +-
591 +-static inline void c_can_pm_runtime_disable(const struct c_can_priv *priv)
592 +-{
593 +- if (priv->device)
594 +- pm_runtime_disable(priv->device);
595 +-}
596 +-
597 + static inline void c_can_pm_runtime_get_sync(const struct c_can_priv *priv)
598 + {
599 + if (priv->device)
600 +@@ -1318,7 +1306,6 @@ static const struct net_device_ops c_can_netdev_ops = {
601 +
602 + int register_c_can_dev(struct net_device *dev)
603 + {
604 +- struct c_can_priv *priv = netdev_priv(dev);
605 + int err;
606 +
607 + /* Deactivate pins to prevent DRA7 DCAN IP from being
608 +@@ -1328,28 +1315,19 @@ int register_c_can_dev(struct net_device *dev)
609 + */
610 + pinctrl_pm_select_sleep_state(dev->dev.parent);
611 +
612 +- c_can_pm_runtime_enable(priv);
613 +-
614 + dev->flags |= IFF_ECHO; /* we support local echo */
615 + dev->netdev_ops = &c_can_netdev_ops;
616 +
617 + err = register_candev(dev);
618 +- if (err)
619 +- c_can_pm_runtime_disable(priv);
620 +- else
621 ++ if (!err)
622 + devm_can_led_init(dev);
623 +-
624 + return err;
625 + }
626 + EXPORT_SYMBOL_GPL(register_c_can_dev);
627 +
628 + void unregister_c_can_dev(struct net_device *dev)
629 + {
630 +- struct c_can_priv *priv = netdev_priv(dev);
631 +-
632 + unregister_candev(dev);
633 +-
634 +- c_can_pm_runtime_disable(priv);
635 + }
636 + EXPORT_SYMBOL_GPL(unregister_c_can_dev);
637 +
638 +diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
639 +index d065c0e2d18e6..f3e0b2124a376 100644
640 +--- a/drivers/net/can/c_can/c_can_pci.c
641 ++++ b/drivers/net/can/c_can/c_can_pci.c
642 +@@ -239,12 +239,13 @@ static void c_can_pci_remove(struct pci_dev *pdev)
643 + {
644 + struct net_device *dev = pci_get_drvdata(pdev);
645 + struct c_can_priv *priv = netdev_priv(dev);
646 ++ void __iomem *addr = priv->base;
647 +
648 + unregister_c_can_dev(dev);
649 +
650 + free_c_can_dev(dev);
651 +
652 +- pci_iounmap(pdev, priv->base);
653 ++ pci_iounmap(pdev, addr);
654 + pci_disable_msi(pdev);
655 + pci_clear_master(pdev);
656 + pci_release_regions(pdev);
657 +diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
658 +index b5145a7f874c2..f2b0408ce87d1 100644
659 +--- a/drivers/net/can/c_can/c_can_platform.c
660 ++++ b/drivers/net/can/c_can/c_can_platform.c
661 +@@ -29,6 +29,7 @@
662 + #include <linux/list.h>
663 + #include <linux/io.h>
664 + #include <linux/platform_device.h>
665 ++#include <linux/pm_runtime.h>
666 + #include <linux/clk.h>
667 + #include <linux/of.h>
668 + #include <linux/of_device.h>
669 +@@ -385,6 +386,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
670 + platform_set_drvdata(pdev, dev);
671 + SET_NETDEV_DEV(dev, &pdev->dev);
672 +
673 ++ pm_runtime_enable(priv->device);
674 + ret = register_c_can_dev(dev);
675 + if (ret) {
676 + dev_err(&pdev->dev, "registering %s failed (err=%d)\n",
677 +@@ -397,6 +399,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
678 + return 0;
679 +
680 + exit_free_device:
681 ++ pm_runtime_disable(priv->device);
682 + free_c_can_dev(dev);
683 + exit:
684 + dev_err(&pdev->dev, "probe failed\n");
685 +@@ -407,9 +410,10 @@ exit:
686 + static int c_can_plat_remove(struct platform_device *pdev)
687 + {
688 + struct net_device *dev = platform_get_drvdata(pdev);
689 ++ struct c_can_priv *priv = netdev_priv(dev);
690 +
691 + unregister_c_can_dev(dev);
692 +-
693 ++ pm_runtime_disable(priv->device);
694 + free_c_can_dev(dev);
695 +
696 + return 0;
697 +diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
698 +index 0ebee99a3e857..011faed515e75 100644
699 +--- a/drivers/net/can/dev.c
700 ++++ b/drivers/net/can/dev.c
701 +@@ -1191,6 +1191,7 @@ static void can_dellink(struct net_device *dev, struct list_head *head)
702 +
703 + static struct rtnl_link_ops can_link_ops __read_mostly = {
704 + .kind = "can",
705 ++ .netns_refund = true,
706 + .maxtype = IFLA_CAN_MAX,
707 + .policy = can_policy,
708 + .setup = can_setup,
709 +diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
710 +index a3f2548c5548c..8751bd3e5789c 100644
711 +--- a/drivers/net/can/m_can/m_can.c
712 ++++ b/drivers/net/can/m_can/m_can.c
713 +@@ -513,9 +513,6 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota)
714 + }
715 +
716 + while ((rxfs & RXFS_FFL_MASK) && (quota > 0)) {
717 +- if (rxfs & RXFS_RFL)
718 +- netdev_warn(dev, "Rx FIFO 0 Message Lost\n");
719 +-
720 + m_can_read_fifo(dev, rxfs);
721 +
722 + quota--;
723 +diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
724 +index 7fc84ae562a29..11a72c4cbb928 100644
725 +--- a/drivers/net/dsa/bcm_sf2.c
726 ++++ b/drivers/net/dsa/bcm_sf2.c
727 +@@ -613,8 +613,10 @@ static u32 bcm_sf2_sw_get_phy_flags(struct dsa_switch *ds, int port)
728 + * in bits 15:8 and the patch level in bits 7:0 which is exactly what
729 + * the REG_PHY_REVISION register layout is.
730 + */
731 +-
732 +- return priv->hw_params.gphy_rev;
733 ++ if (priv->int_phy_mask & BIT(port))
734 ++ return priv->hw_params.gphy_rev;
735 ++ else
736 ++ return 0;
737 + }
738 +
739 + static void bcm_sf2_sw_adjust_link(struct dsa_switch *ds, int port,
740 +diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
741 +index b28425f4cfac4..f35c5dbe54ee8 100644
742 +--- a/drivers/net/ethernet/faraday/ftgmac100.c
743 ++++ b/drivers/net/ethernet/faraday/ftgmac100.c
744 +@@ -1328,6 +1328,7 @@ static int ftgmac100_poll(struct napi_struct *napi, int budget)
745 + */
746 + if (unlikely(priv->need_mac_restart)) {
747 + ftgmac100_start_hw(priv);
748 ++ priv->need_mac_restart = false;
749 +
750 + /* Re-enable "bad" interrupts */
751 + iowrite32(FTGMAC100_INT_BAD,
752 +diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
753 +index 6ebad3fac81d1..e63df6455fbad 100644
754 +--- a/drivers/net/ethernet/freescale/fec_ptp.c
755 ++++ b/drivers/net/ethernet/freescale/fec_ptp.c
756 +@@ -396,9 +396,16 @@ static int fec_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
757 + u64 ns;
758 + unsigned long flags;
759 +
760 ++ mutex_lock(&adapter->ptp_clk_mutex);
761 ++ /* Check the ptp clock */
762 ++ if (!adapter->ptp_clk_on) {
763 ++ mutex_unlock(&adapter->ptp_clk_mutex);
764 ++ return -EINVAL;
765 ++ }
766 + spin_lock_irqsave(&adapter->tmreg_lock, flags);
767 + ns = timecounter_read(&adapter->tc);
768 + spin_unlock_irqrestore(&adapter->tmreg_lock, flags);
769 ++ mutex_unlock(&adapter->ptp_clk_mutex);
770 +
771 + *ts = ns_to_timespec64(ns);
772 +
773 +diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
774 +index af832929ae287..5ddc09e9b5a60 100644
775 +--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
776 ++++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
777 +@@ -1812,8 +1812,10 @@ static int hns_nic_clear_all_rx_fetch(struct net_device *ndev)
778 + for (j = 0; j < fetch_num; j++) {
779 + /* alloc one skb and init */
780 + skb = hns_assemble_skb(ndev);
781 +- if (!skb)
782 ++ if (!skb) {
783 ++ ret = -ENOMEM;
784 + goto out;
785 ++ }
786 + rd = &tx_ring_data(priv, skb->queue_mapping);
787 + hns_nic_net_xmit_hw(ndev, skb, rd);
788 +
789 +diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
790 +index 6b03c8553e597..65deaf8f30047 100644
791 +--- a/drivers/net/ethernet/intel/e1000e/82571.c
792 ++++ b/drivers/net/ethernet/intel/e1000e/82571.c
793 +@@ -917,6 +917,8 @@ static s32 e1000_set_d0_lplu_state_82571(struct e1000_hw *hw, bool active)
794 + } else {
795 + data &= ~IGP02E1000_PM_D0_LPLU;
796 + ret_val = e1e_wphy(hw, IGP02E1000_PHY_POWER_MGMT, data);
797 ++ if (ret_val)
798 ++ return ret_val;
799 + /* LPLU and SmartSpeed are mutually exclusive. LPLU is used
800 + * during Dx states where the power conservation is most
801 + * important. During driver activity we should enable
802 +diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
803 +index fff55f0bed303..f50d0da8fefeb 100644
804 +--- a/drivers/net/ethernet/intel/e1000e/netdev.c
805 ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c
806 +@@ -5942,15 +5942,19 @@ static void e1000_reset_task(struct work_struct *work)
807 + struct e1000_adapter *adapter;
808 + adapter = container_of(work, struct e1000_adapter, reset_task);
809 +
810 ++ rtnl_lock();
811 + /* don't run the task if already down */
812 +- if (test_bit(__E1000_DOWN, &adapter->state))
813 ++ if (test_bit(__E1000_DOWN, &adapter->state)) {
814 ++ rtnl_unlock();
815 + return;
816 ++ }
817 +
818 + if (!(adapter->flags & FLAG_RESTART_NOW)) {
819 + e1000e_dump(adapter);
820 + e_err("Reset adapter unexpectedly\n");
821 + }
822 + e1000e_reinit_locked(adapter);
823 ++ rtnl_unlock();
824 + }
825 +
826 + /**
827 +diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
828 +index 9c3fa0b555519..e9205c8935310 100644
829 +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
830 ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
831 +@@ -9266,8 +9266,10 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,
832 + ixgbe_atr_compute_perfect_hash_82599(&input->filter, mask);
833 + err = ixgbe_fdir_write_perfect_filter_82599(hw, &input->filter,
834 + input->sw_idx, queue);
835 +- if (!err)
836 +- ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx);
837 ++ if (err)
838 ++ goto err_out_w_lock;
839 ++
840 ++ ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx);
841 + spin_unlock(&adapter->fdir_perfect_lock);
842 +
843 + if ((uhtid != 0x800) && (adapter->jump_tables[uhtid]))
844 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
845 +index c3f1e2d76a463..377f91885bdaa 100644
846 +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
847 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
848 +@@ -1747,6 +1747,7 @@ static int set_pflag_rx_cqe_compress(struct net_device *netdev,
849 + {
850 + struct mlx5e_priv *priv = netdev_priv(netdev);
851 + struct mlx5_core_dev *mdev = priv->mdev;
852 ++ int err;
853 +
854 + if (!MLX5_CAP_GEN(mdev, cqe_compression))
855 + return -EOPNOTSUPP;
856 +@@ -1756,7 +1757,10 @@ static int set_pflag_rx_cqe_compress(struct net_device *netdev,
857 + return -EINVAL;
858 + }
859 +
860 +- mlx5e_modify_rx_cqe_compression_locked(priv, enable);
861 ++ err = mlx5e_modify_rx_cqe_compression_locked(priv, enable);
862 ++ if (err)
863 ++ return err;
864 ++
865 + priv->channels.params.rx_cqe_compress_def = enable;
866 +
867 + return 0;
868 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
869 +index f34ae8c75bc5e..61a39d167c8bc 100644
870 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
871 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
872 +@@ -1426,6 +1426,7 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
873 +
874 + if (fw_dump->tmpl_hdr == NULL || current_version > prev_version) {
875 + vfree(fw_dump->tmpl_hdr);
876 ++ fw_dump->tmpl_hdr = NULL;
877 +
878 + if (qlcnic_83xx_md_check_extended_dump_capability(adapter))
879 + extended = !qlcnic_83xx_extend_md_capab(adapter);
880 +@@ -1444,6 +1445,8 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
881 + struct qlcnic_83xx_dump_template_hdr *hdr;
882 +
883 + hdr = fw_dump->tmpl_hdr;
884 ++ if (!hdr)
885 ++ return;
886 + hdr->drv_cap_mask = 0x1f;
887 + fw_dump->cap_mask = 0x1f;
888 + dev_info(&pdev->dev,
889 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
890 +index 149fd0d5e069f..8e60315a087c9 100644
891 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
892 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
893 +@@ -972,6 +972,8 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
894 + plat_dat->init = sun8i_dwmac_init;
895 + plat_dat->exit = sun8i_dwmac_exit;
896 + plat_dat->setup = sun8i_dwmac_setup;
897 ++ plat_dat->tx_fifo_size = 4096;
898 ++ plat_dat->rx_fifo_size = 16384;
899 +
900 + ret = sun8i_dwmac_init(pdev, plat_dat->bsp_priv);
901 + if (ret)
902 +diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
903 +index 411a69bea1d44..32ab44d00790e 100644
904 +--- a/drivers/net/ethernet/sun/niu.c
905 ++++ b/drivers/net/ethernet/sun/niu.c
906 +@@ -3948,8 +3948,6 @@ static void niu_xmac_interrupt(struct niu *np)
907 + mp->rx_mcasts += RXMAC_MC_FRM_CNT_COUNT;
908 + if (val & XRXMAC_STATUS_RXBCAST_CNT_EXP)
909 + mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT;
910 +- if (val & XRXMAC_STATUS_RXBCAST_CNT_EXP)
911 +- mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT;
912 + if (val & XRXMAC_STATUS_RXHIST1_CNT_EXP)
913 + mp->rx_hist_cnt1 += RXMAC_HIST_CNT1_COUNT;
914 + if (val & XRXMAC_STATUS_RXHIST2_CNT_EXP)
915 +diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c
916 +index 163d8d16bc245..75620c3365b3c 100644
917 +--- a/drivers/net/ethernet/tehuti/tehuti.c
918 ++++ b/drivers/net/ethernet/tehuti/tehuti.c
919 +@@ -2058,6 +2058,7 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
920 + /*bdx_hw_reset(priv); */
921 + if (bdx_read_mac(priv)) {
922 + pr_err("load MAC address failed\n");
923 ++ err = -EFAULT;
924 + goto err_out_iomap;
925 + }
926 + SET_NETDEV_DEV(ndev, &pdev->dev);
927 +diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
928 +index 288ecd9991713..7a18eb0784f31 100644
929 +--- a/drivers/net/usb/cdc-phonet.c
930 ++++ b/drivers/net/usb/cdc-phonet.c
931 +@@ -398,6 +398,8 @@ static int usbpn_probe(struct usb_interface *intf, const struct usb_device_id *i
932 +
933 + err = register_netdev(dev);
934 + if (err) {
935 ++ /* Set disconnected flag so that disconnect() returns early. */
936 ++ pnd->disconnected = 1;
937 + usb_driver_release_interface(&usbpn_driver, data_intf);
938 + goto out;
939 + }
940 +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
941 +index bd91d4bad49b2..f9c531a6ce064 100644
942 +--- a/drivers/net/usb/r8152.c
943 ++++ b/drivers/net/usb/r8152.c
944 +@@ -2588,29 +2588,6 @@ static void __rtl_set_wol(struct r8152 *tp, u32 wolopts)
945 + device_set_wakeup_enable(&tp->udev->dev, false);
946 + }
947 +
948 +-static void r8153_mac_clk_spd(struct r8152 *tp, bool enable)
949 +-{
950 +- /* MAC clock speed down */
951 +- if (enable) {
952 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL,
953 +- ALDPS_SPDWN_RATIO);
954 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2,
955 +- EEE_SPDWN_RATIO);
956 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3,
957 +- PKT_AVAIL_SPDWN_EN | SUSPEND_SPDWN_EN |
958 +- U1U2_SPDWN_EN | L1_SPDWN_EN);
959 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4,
960 +- PWRSAVE_SPDWN_EN | RXDV_SPDWN_EN | TX10MIDLE_EN |
961 +- TP100_SPDWN_EN | TP500_SPDWN_EN | EEE_SPDWN_EN |
962 +- TP1000_SPDWN_EN);
963 +- } else {
964 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0);
965 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, 0);
966 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, 0);
967 +- ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, 0);
968 +- }
969 +-}
970 +-
971 + static void r8153_u1u2en(struct r8152 *tp, bool enable)
972 + {
973 + u8 u1u2[8];
974 +@@ -2841,11 +2818,9 @@ static void rtl8153_runtime_enable(struct r8152 *tp, bool enable)
975 + if (enable) {
976 + r8153_u1u2en(tp, false);
977 + r8153_u2p3en(tp, false);
978 +- r8153_mac_clk_spd(tp, true);
979 + rtl_runtime_suspend_enable(tp, true);
980 + } else {
981 + rtl_runtime_suspend_enable(tp, false);
982 +- r8153_mac_clk_spd(tp, false);
983 +
984 + switch (tp->version) {
985 + case RTL_VER_03:
986 +@@ -3407,7 +3382,6 @@ static void r8153_first_init(struct r8152 *tp)
987 + u32 ocp_data;
988 + int i;
989 +
990 +- r8153_mac_clk_spd(tp, false);
991 + rxdy_gated_en(tp, true);
992 + r8153_teredo_off(tp);
993 +
994 +@@ -3469,8 +3443,6 @@ static void r8153_enter_oob(struct r8152 *tp)
995 + u32 ocp_data;
996 + int i;
997 +
998 +- r8153_mac_clk_spd(tp, true);
999 +-
1000 + ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
1001 + ocp_data &= ~NOW_IS_OOB;
1002 + ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
1003 +@@ -4134,9 +4106,14 @@ static void r8153_init(struct r8152 *tp)
1004 +
1005 + ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001);
1006 +
1007 ++ /* MAC clock speed down */
1008 ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL, 0);
1009 ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL2, 0);
1010 ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, 0);
1011 ++ ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL4, 0);
1012 ++
1013 + r8153_power_cut_en(tp, false);
1014 + r8153_u1u2en(tp, true);
1015 +- r8153_mac_clk_spd(tp, false);
1016 + usb_enable_lpm(tp->udev);
1017 +
1018 + /* rx aggregation */
1019 +diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
1020 +index 6a26cef621935..978f642dacedd 100644
1021 +--- a/drivers/net/wan/fsl_ucc_hdlc.c
1022 ++++ b/drivers/net/wan/fsl_ucc_hdlc.c
1023 +@@ -200,13 +200,17 @@ static int uhdlc_init(struct ucc_hdlc_private *priv)
1024 +
1025 + priv->rx_skbuff = kzalloc(priv->rx_ring_size * sizeof(*priv->rx_skbuff),
1026 + GFP_KERNEL);
1027 +- if (!priv->rx_skbuff)
1028 ++ if (!priv->rx_skbuff) {
1029 ++ ret = -ENOMEM;
1030 + goto free_ucc_pram;
1031 ++ }
1032 +
1033 + priv->tx_skbuff = kzalloc(priv->tx_ring_size * sizeof(*priv->tx_skbuff),
1034 + GFP_KERNEL);
1035 +- if (!priv->tx_skbuff)
1036 ++ if (!priv->tx_skbuff) {
1037 ++ ret = -ENOMEM;
1038 + goto free_rx_skbuff;
1039 ++ }
1040 +
1041 + priv->skb_curtx = 0;
1042 + priv->skb_dirtytx = 0;
1043 +diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
1044 +index 20bf1fa7f2733..9e400def0d04e 100644
1045 +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
1046 ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
1047 +@@ -5455,14 +5455,18 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc)
1048 + ioc->pend_os_device_add_sz++;
1049 + ioc->pend_os_device_add = kzalloc(ioc->pend_os_device_add_sz,
1050 + GFP_KERNEL);
1051 +- if (!ioc->pend_os_device_add)
1052 ++ if (!ioc->pend_os_device_add) {
1053 ++ r = -ENOMEM;
1054 + goto out_free_resources;
1055 ++ }
1056 +
1057 + ioc->device_remove_in_progress_sz = ioc->pend_os_device_add_sz;
1058 + ioc->device_remove_in_progress =
1059 + kzalloc(ioc->device_remove_in_progress_sz, GFP_KERNEL);
1060 +- if (!ioc->device_remove_in_progress)
1061 ++ if (!ioc->device_remove_in_progress) {
1062 ++ r = -ENOMEM;
1063 + goto out_free_resources;
1064 ++ }
1065 +
1066 + ioc->fwfault_debug = mpt3sas_fwfault_debug;
1067 +
1068 +diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
1069 +index a742b88567762..b0a404d4e6767 100644
1070 +--- a/drivers/scsi/qedi/qedi_main.c
1071 ++++ b/drivers/scsi/qedi/qedi_main.c
1072 +@@ -1354,6 +1354,7 @@ static int qedi_alloc_global_queues(struct qedi_ctx *qedi)
1073 + if (!qedi->global_queues[i]) {
1074 + QEDI_ERR(&qedi->dbg_ctx,
1075 + "Unable to allocation global queue %d.\n", i);
1076 ++ status = -ENOMEM;
1077 + goto mem_alloc_failure;
1078 + }
1079 +
1080 +diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
1081 +index 1e73feb5970b2..a97dcfd5a5668 100644
1082 +--- a/fs/ext4/xattr.c
1083 ++++ b/fs/ext4/xattr.c
1084 +@@ -1479,6 +1479,9 @@ ext4_xattr_inode_cache_find(struct inode *inode, const void *value,
1085 + if (!ce)
1086 + return NULL;
1087 +
1088 ++ WARN_ON_ONCE(ext4_handle_valid(journal_current_handle()) &&
1089 ++ !(current->flags & PF_MEMALLOC_NOFS));
1090 ++
1091 + ea_data = ext4_kvmalloc(value_len, GFP_NOFS);
1092 + if (!ea_data) {
1093 + mb_cache_entry_put(ea_inode_cache, ce);
1094 +@@ -2345,6 +2348,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
1095 + error = -ENOSPC;
1096 + goto cleanup;
1097 + }
1098 ++ WARN_ON_ONCE(!(current->flags & PF_MEMALLOC_NOFS));
1099 + }
1100 +
1101 + error = ext4_reserve_inode_write(handle, inode, &is.iloc);
1102 +diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig
1103 +index ac3e06367cb68..e55f86713948b 100644
1104 +--- a/fs/nfs/Kconfig
1105 ++++ b/fs/nfs/Kconfig
1106 +@@ -127,7 +127,7 @@ config PNFS_BLOCK
1107 + config PNFS_FLEXFILE_LAYOUT
1108 + tristate
1109 + depends on NFS_V4_1 && NFS_V3
1110 +- default m
1111 ++ default NFS_V4
1112 +
1113 + config NFS_V4_1_IMPLEMENTATION_ID_DOMAIN
1114 + string "NFSv4.1 Implementation ID Domain"
1115 +diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c
1116 +index f1cb0b7eb05f9..be666aee28cc6 100644
1117 +--- a/fs/nfs/nfs3xdr.c
1118 ++++ b/fs/nfs/nfs3xdr.c
1119 +@@ -34,6 +34,7 @@
1120 + */
1121 + #define NFS3_fhandle_sz (1+16)
1122 + #define NFS3_fh_sz (NFS3_fhandle_sz) /* shorthand */
1123 ++#define NFS3_post_op_fh_sz (1+NFS3_fh_sz)
1124 + #define NFS3_sattr_sz (15)
1125 + #define NFS3_filename_sz (1+(NFS3_MAXNAMLEN>>2))
1126 + #define NFS3_path_sz (1+(NFS3_MAXPATHLEN>>2))
1127 +@@ -71,7 +72,7 @@
1128 + #define NFS3_readlinkres_sz (1+NFS3_post_op_attr_sz+1)
1129 + #define NFS3_readres_sz (1+NFS3_post_op_attr_sz+3)
1130 + #define NFS3_writeres_sz (1+NFS3_wcc_data_sz+4)
1131 +-#define NFS3_createres_sz (1+NFS3_fh_sz+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)
1132 ++#define NFS3_createres_sz (1+NFS3_post_op_fh_sz+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)
1133 + #define NFS3_renameres_sz (1+(2 * NFS3_wcc_data_sz))
1134 + #define NFS3_linkres_sz (1+NFS3_post_op_attr_sz+NFS3_wcc_data_sz)
1135 + #define NFS3_readdirres_sz (1+NFS3_post_op_attr_sz+2)
1136 +diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
1137 +index 7f50767af46ba..e053fd7f83d81 100644
1138 +--- a/fs/nfs/nfs4proc.c
1139 ++++ b/fs/nfs/nfs4proc.c
1140 +@@ -5255,6 +5255,9 @@ static int __nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t bufl
1141 + unsigned int npages = DIV_ROUND_UP(buflen, PAGE_SIZE);
1142 + int ret, i;
1143 +
1144 ++ /* You can't remove system.nfs4_acl: */
1145 ++ if (buflen == 0)
1146 ++ return -EINVAL;
1147 + if (!nfs4_server_supports_acls(server))
1148 + return -EOPNOTSUPP;
1149 + if (npages > ARRAY_SIZE(pages))
1150 +diff --git a/fs/squashfs/export.c b/fs/squashfs/export.c
1151 +index d2a806416c3ab..1d406a2094a56 100644
1152 +--- a/fs/squashfs/export.c
1153 ++++ b/fs/squashfs/export.c
1154 +@@ -165,14 +165,18 @@ __le64 *squashfs_read_inode_lookup_table(struct super_block *sb,
1155 + start = le64_to_cpu(table[n]);
1156 + end = le64_to_cpu(table[n + 1]);
1157 +
1158 +- if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) {
1159 ++ if (start >= end
1160 ++ || (end - start) >
1161 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1162 + kfree(table);
1163 + return ERR_PTR(-EINVAL);
1164 + }
1165 + }
1166 +
1167 + start = le64_to_cpu(table[indexes - 1]);
1168 +- if (start >= lookup_table_start || (lookup_table_start - start) > SQUASHFS_METADATA_SIZE) {
1169 ++ if (start >= lookup_table_start ||
1170 ++ (lookup_table_start - start) >
1171 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1172 + kfree(table);
1173 + return ERR_PTR(-EINVAL);
1174 + }
1175 +diff --git a/fs/squashfs/id.c b/fs/squashfs/id.c
1176 +index 8ccc0e3f6ea5a..d2e15baab5378 100644
1177 +--- a/fs/squashfs/id.c
1178 ++++ b/fs/squashfs/id.c
1179 +@@ -110,14 +110,16 @@ __le64 *squashfs_read_id_index_table(struct super_block *sb,
1180 + start = le64_to_cpu(table[n]);
1181 + end = le64_to_cpu(table[n + 1]);
1182 +
1183 +- if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) {
1184 ++ if (start >= end || (end - start) >
1185 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1186 + kfree(table);
1187 + return ERR_PTR(-EINVAL);
1188 + }
1189 + }
1190 +
1191 + start = le64_to_cpu(table[indexes - 1]);
1192 +- if (start >= id_table_start || (id_table_start - start) > SQUASHFS_METADATA_SIZE) {
1193 ++ if (start >= id_table_start || (id_table_start - start) >
1194 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1195 + kfree(table);
1196 + return ERR_PTR(-EINVAL);
1197 + }
1198 +diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h
1199 +index 4e6853f084d07..10e93345b6153 100644
1200 +--- a/fs/squashfs/squashfs_fs.h
1201 ++++ b/fs/squashfs/squashfs_fs.h
1202 +@@ -30,6 +30,7 @@
1203 +
1204 + /* size of metadata (inode and directory) blocks */
1205 + #define SQUASHFS_METADATA_SIZE 8192
1206 ++#define SQUASHFS_BLOCK_OFFSET 2
1207 +
1208 + /* default size of block device I/O */
1209 + #ifdef CONFIG_SQUASHFS_4K_DEVBLK_SIZE
1210 +diff --git a/fs/squashfs/xattr_id.c b/fs/squashfs/xattr_id.c
1211 +index 3a655d879600c..7f718d2bf3579 100644
1212 +--- a/fs/squashfs/xattr_id.c
1213 ++++ b/fs/squashfs/xattr_id.c
1214 +@@ -122,14 +122,16 @@ __le64 *squashfs_read_xattr_id_table(struct super_block *sb, u64 table_start,
1215 + start = le64_to_cpu(table[n]);
1216 + end = le64_to_cpu(table[n + 1]);
1217 +
1218 +- if (start >= end || (end - start) > SQUASHFS_METADATA_SIZE) {
1219 ++ if (start >= end || (end - start) >
1220 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1221 + kfree(table);
1222 + return ERR_PTR(-EINVAL);
1223 + }
1224 + }
1225 +
1226 + start = le64_to_cpu(table[indexes - 1]);
1227 +- if (start >= table_start || (table_start - start) > SQUASHFS_METADATA_SIZE) {
1228 ++ if (start >= table_start || (table_start - start) >
1229 ++ (SQUASHFS_METADATA_SIZE + SQUASHFS_BLOCK_OFFSET)) {
1230 + kfree(table);
1231 + return ERR_PTR(-EINVAL);
1232 + }
1233 +diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
1234 +index 67f4fce222091..3746d4ce48579 100644
1235 +--- a/include/acpi/acpi_bus.h
1236 ++++ b/include/acpi/acpi_bus.h
1237 +@@ -245,6 +245,7 @@ struct acpi_pnp_type {
1238 +
1239 + struct acpi_device_pnp {
1240 + acpi_bus_id bus_id; /* Object name */
1241 ++ int instance_no; /* Instance number of this object */
1242 + struct acpi_pnp_type type; /* ID type */
1243 + acpi_bus_address bus_address; /* _ADR */
1244 + char *unique_id; /* _UID */
1245 +diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
1246 +index 0e2c60efad2de..55a1d32605891 100644
1247 +--- a/include/linux/if_macvlan.h
1248 ++++ b/include/linux/if_macvlan.h
1249 +@@ -58,13 +58,14 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
1250 + if (likely(success)) {
1251 + struct vlan_pcpu_stats *pcpu_stats;
1252 +
1253 +- pcpu_stats = this_cpu_ptr(vlan->pcpu_stats);
1254 ++ pcpu_stats = get_cpu_ptr(vlan->pcpu_stats);
1255 + u64_stats_update_begin(&pcpu_stats->syncp);
1256 + pcpu_stats->rx_packets++;
1257 + pcpu_stats->rx_bytes += len;
1258 + if (multicast)
1259 + pcpu_stats->rx_multicast++;
1260 + u64_stats_update_end(&pcpu_stats->syncp);
1261 ++ put_cpu_ptr(vlan->pcpu_stats);
1262 + } else {
1263 + this_cpu_inc(vlan->pcpu_stats->rx_errors);
1264 + }
1265 +diff --git a/include/linux/mutex.h b/include/linux/mutex.h
1266 +index 153274f78402b..ae7707020b252 100644
1267 +--- a/include/linux/mutex.h
1268 ++++ b/include/linux/mutex.h
1269 +@@ -183,7 +183,7 @@ extern void mutex_lock_io(struct mutex *lock);
1270 + # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
1271 + # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock)
1272 + # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock)
1273 +-# define mutex_lock_io_nested(lock, subclass) mutex_lock(lock)
1274 ++# define mutex_lock_io_nested(lock, subclass) mutex_lock_io(lock)
1275 + #endif
1276 +
1277 + /*
1278 +diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h
1279 +index 07ee0f84a46ca..eb0a2532eb6fa 100644
1280 +--- a/include/linux/u64_stats_sync.h
1281 ++++ b/include/linux/u64_stats_sync.h
1282 +@@ -69,12 +69,13 @@ struct u64_stats_sync {
1283 + };
1284 +
1285 +
1286 ++#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
1287 ++#define u64_stats_init(syncp) seqcount_init(&(syncp)->seq)
1288 ++#else
1289 + static inline void u64_stats_init(struct u64_stats_sync *syncp)
1290 + {
1291 +-#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
1292 +- seqcount_init(&syncp->seq);
1293 +-#endif
1294 + }
1295 ++#endif
1296 +
1297 + static inline void u64_stats_update_begin(struct u64_stats_sync *syncp)
1298 + {
1299 +diff --git a/include/net/red.h b/include/net/red.h
1300 +index e21e7fd4fe077..8fe55b8b2fb81 100644
1301 +--- a/include/net/red.h
1302 ++++ b/include/net/red.h
1303 +@@ -168,7 +168,8 @@ static inline void red_set_vars(struct red_vars *v)
1304 + v->qcount = -1;
1305 + }
1306 +
1307 +-static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog, u8 Scell_log)
1308 ++static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog,
1309 ++ u8 Scell_log, u8 *stab)
1310 + {
1311 + if (fls(qth_min) + Wlog > 32)
1312 + return false;
1313 +@@ -178,6 +179,13 @@ static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog, u8 Scell_
1314 + return false;
1315 + if (qth_max < qth_min)
1316 + return false;
1317 ++ if (stab) {
1318 ++ int i;
1319 ++
1320 ++ for (i = 0; i < RED_STAB_SIZE; i++)
1321 ++ if (stab[i] >= 32)
1322 ++ return false;
1323 ++ }
1324 + return true;
1325 + }
1326 +
1327 +diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
1328 +index 7b938fbeebc1c..f5026a54f4127 100644
1329 +--- a/include/net/rtnetlink.h
1330 ++++ b/include/net/rtnetlink.h
1331 +@@ -33,6 +33,7 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh)
1332 + *
1333 + * @list: Used internally
1334 + * @kind: Identifier
1335 ++ * @netns_refund: Physical device, move to init_net on netns exit
1336 + * @maxtype: Highest device specific netlink attribute number
1337 + * @policy: Netlink policy for device specific attribute validation
1338 + * @validate: Optional validation function for netlink/changelink parameters
1339 +@@ -92,6 +93,7 @@ struct rtnl_link_ops {
1340 + unsigned int (*get_num_tx_queues)(void);
1341 + unsigned int (*get_num_rx_queues)(void);
1342 +
1343 ++ bool netns_refund;
1344 + int slave_maxtype;
1345 + const struct nla_policy *slave_policy;
1346 + int (*slave_validate)(struct nlattr *tb[],
1347 +diff --git a/net/core/dev.c b/net/core/dev.c
1348 +index d101f95a47fbc..7ee89125cd53a 100644
1349 +--- a/net/core/dev.c
1350 ++++ b/net/core/dev.c
1351 +@@ -8667,7 +8667,7 @@ static void __net_exit default_device_exit(struct net *net)
1352 + continue;
1353 +
1354 + /* Leave virtual devices for the generic cleanup */
1355 +- if (dev->rtnl_link_ops)
1356 ++ if (dev->rtnl_link_ops && !dev->rtnl_link_ops->netns_refund)
1357 + continue;
1358 +
1359 + /* Push remaining network devices to init_net */
1360 +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
1361 +index 0b82d8da4ab0a..0563bde0c285c 100644
1362 +--- a/net/mac80211/cfg.c
1363 ++++ b/net/mac80211/cfg.c
1364 +@@ -2752,14 +2752,14 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
1365 + continue;
1366 +
1367 + for (j = 0; j < IEEE80211_HT_MCS_MASK_LEN; j++) {
1368 +- if (~sdata->rc_rateidx_mcs_mask[i][j]) {
1369 ++ if (sdata->rc_rateidx_mcs_mask[i][j] != 0xff) {
1370 + sdata->rc_has_mcs_mask[i] = true;
1371 + break;
1372 + }
1373 + }
1374 +
1375 + for (j = 0; j < NL80211_VHT_NSS_MAX; j++) {
1376 +- if (~sdata->rc_rateidx_vht_mcs_mask[i][j]) {
1377 ++ if (sdata->rc_rateidx_vht_mcs_mask[i][j] != 0xffff) {
1378 + sdata->rc_has_vht_mcs_mask[i] = true;
1379 + break;
1380 + }
1381 +diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
1382 +index 3d0d12fbd8dd1..e550154b12df6 100644
1383 +--- a/net/mac80211/ibss.c
1384 ++++ b/net/mac80211/ibss.c
1385 +@@ -1861,6 +1861,8 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
1386 +
1387 + /* remove beacon */
1388 + kfree(sdata->u.ibss.ie);
1389 ++ sdata->u.ibss.ie = NULL;
1390 ++ sdata->u.ibss.ie_len = 0;
1391 +
1392 + /* on the next join, re-program HT parameters */
1393 + memset(&ifibss->ht_capa, 0, sizeof(ifibss->ht_capa));
1394 +diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
1395 +index 11f79c3b01a99..f712f521db269 100644
1396 +--- a/net/qrtr/qrtr.c
1397 ++++ b/net/qrtr/qrtr.c
1398 +@@ -819,6 +819,11 @@ static int qrtr_recvmsg(struct socket *sock, struct msghdr *msg,
1399 + rc = copied;
1400 +
1401 + if (addr) {
1402 ++ /* There is an anonymous 2-byte hole after sq_family,
1403 ++ * make sure to clear it.
1404 ++ */
1405 ++ memset(addr, 0, sizeof(*addr));
1406 ++
1407 + addr->sq_family = AF_QIPCRTR;
1408 + addr->sq_node = le32_to_cpu(phdr->src_node_id);
1409 + addr->sq_port = le32_to_cpu(phdr->src_port_id);
1410 +diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
1411 +index 777475f7f29c4..221ae1fe98224 100644
1412 +--- a/net/sched/sch_choke.c
1413 ++++ b/net/sched/sch_choke.c
1414 +@@ -354,6 +354,7 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt)
1415 + struct sk_buff **old = NULL;
1416 + unsigned int mask;
1417 + u32 max_P;
1418 ++ u8 *stab;
1419 +
1420 + if (opt == NULL)
1421 + return -EINVAL;
1422 +@@ -369,8 +370,8 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt)
1423 + max_P = tb[TCA_CHOKE_MAX_P] ? nla_get_u32(tb[TCA_CHOKE_MAX_P]) : 0;
1424 +
1425 + ctl = nla_data(tb[TCA_CHOKE_PARMS]);
1426 +-
1427 +- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log))
1428 ++ stab = nla_data(tb[TCA_CHOKE_STAB]);
1429 ++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log, stab))
1430 + return -EINVAL;
1431 +
1432 + if (ctl->limit > CHOKE_MAX_QUEUE)
1433 +@@ -420,7 +421,7 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt)
1434 +
1435 + red_set_parms(&q->parms, ctl->qth_min, ctl->qth_max, ctl->Wlog,
1436 + ctl->Plog, ctl->Scell_log,
1437 +- nla_data(tb[TCA_CHOKE_STAB]),
1438 ++ stab,
1439 + max_P);
1440 + red_set_vars(&q->vars);
1441 +
1442 +diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
1443 +index 357dec26f2fdc..1b5a09206a2be 100644
1444 +--- a/net/sched/sch_gred.c
1445 ++++ b/net/sched/sch_gred.c
1446 +@@ -356,7 +356,7 @@ static inline int gred_change_vq(struct Qdisc *sch, int dp,
1447 + struct gred_sched *table = qdisc_priv(sch);
1448 + struct gred_sched_data *q = table->tab[dp];
1449 +
1450 +- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log))
1451 ++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log, stab))
1452 + return -EINVAL;
1453 +
1454 + if (!q) {
1455 +diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
1456 +index 6e6397bda49be..9cf6cd8ea6c66 100644
1457 +--- a/net/sched/sch_red.c
1458 ++++ b/net/sched/sch_red.c
1459 +@@ -169,6 +169,7 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt)
1460 + struct Qdisc *child = NULL;
1461 + int err;
1462 + u32 max_P;
1463 ++ u8 *stab;
1464 +
1465 + if (opt == NULL)
1466 + return -EINVAL;
1467 +@@ -184,7 +185,9 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt)
1468 + max_P = tb[TCA_RED_MAX_P] ? nla_get_u32(tb[TCA_RED_MAX_P]) : 0;
1469 +
1470 + ctl = nla_data(tb[TCA_RED_PARMS]);
1471 +- if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog, ctl->Scell_log))
1472 ++ stab = nla_data(tb[TCA_RED_STAB]);
1473 ++ if (!red_check_params(ctl->qth_min, ctl->qth_max, ctl->Wlog,
1474 ++ ctl->Scell_log, stab))
1475 + return -EINVAL;
1476 +
1477 + if (ctl->limit > 0) {
1478 +@@ -209,7 +212,7 @@ static int red_change(struct Qdisc *sch, struct nlattr *opt)
1479 + red_set_parms(&q->parms,
1480 + ctl->qth_min, ctl->qth_max, ctl->Wlog,
1481 + ctl->Plog, ctl->Scell_log,
1482 +- nla_data(tb[TCA_RED_STAB]),
1483 ++ stab,
1484 + max_P);
1485 + red_set_vars(&q->vars);
1486 +
1487 +diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
1488 +index 2104fe7267e15..4a02dd26986e5 100644
1489 +--- a/net/sched/sch_sfq.c
1490 ++++ b/net/sched/sch_sfq.c
1491 +@@ -649,7 +649,7 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt)
1492 + }
1493 +
1494 + if (ctl_v1 && !red_check_params(ctl_v1->qth_min, ctl_v1->qth_max,
1495 +- ctl_v1->Wlog, ctl_v1->Scell_log))
1496 ++ ctl_v1->Wlog, ctl_v1->Scell_log, NULL))
1497 + return -EINVAL;
1498 + if (ctl_v1 && ctl_v1->qth_min) {
1499 + p = kmalloc(sizeof(*p), GFP_KERNEL);
1500 +diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
1501 +index f02448e86d38b..9fa466d4417b7 100644
1502 +--- a/tools/lib/bpf/Makefile
1503 ++++ b/tools/lib/bpf/Makefile
1504 +@@ -183,7 +183,7 @@ define do_install
1505 + if [ ! -d '$(DESTDIR_SQ)$2' ]; then \
1506 + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \
1507 + fi; \
1508 +- $(INSTALL) $1 $(if $3,-m $3,) '$(DESTDIR_SQ)$2'
1509 ++ $(INSTALL) $(if $3,-m $3,) $1 '$(DESTDIR_SQ)$2'
1510 + endef
1511 +
1512 + install_lib: all_cmd
1513 +diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
1514 +index 44c8bcefe2247..0224fc3aacc16 100644
1515 +--- a/tools/perf/util/auxtrace.c
1516 ++++ b/tools/perf/util/auxtrace.c
1517 +@@ -250,10 +250,6 @@ static int auxtrace_queues__add_buffer(struct auxtrace_queues *queues,
1518 + queue->set = true;
1519 + queue->tid = buffer->tid;
1520 + queue->cpu = buffer->cpu;
1521 +- } else if (buffer->cpu != queue->cpu || buffer->tid != queue->tid) {
1522 +- pr_err("auxtrace queue conflict: cpu %d, tid %d vs cpu %d, tid %d\n",
1523 +- queue->cpu, queue->tid, buffer->cpu, buffer->tid);
1524 +- return -EINVAL;
1525 + }
1526 +
1527 + buffer->buffer_nr = queues->next_buffer_nr++;