Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.19 commit in: /
Date: Wed, 28 Apr 2021 11:44:52
Message-Id: 1619610275.555c6226f41d9bb863aef0eee0db88f419e48695.alicef@gentoo
1 commit: 555c6226f41d9bb863aef0eee0db88f419e48695
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 28 11:44:02 2021 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 28 11:44:35 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=555c6226
7
8 Linux patch 4.19.189
9
10 Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org>
11
12 0000_README | 4 +
13 1188_linux-4.19.189.patch | 1590 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 1594 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 32b1ad4..a3a9c1c 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -791,6 +791,10 @@ Patch: 1187_linux-4.19.188.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.19.188
23
24 +Patch: 1188_linux-4.19.189.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.19.189
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/1188_linux-4.19.189.patch b/1188_linux-4.19.189.patch
33 new file mode 100644
34 index 0000000..e63483d
35 --- /dev/null
36 +++ b/1188_linux-4.19.189.patch
37 @@ -0,0 +1,1590 @@
38 +diff --git a/Makefile b/Makefile
39 +index 85f071709a619..b19e0e7b7eb34 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 19
46 +-SUBLEVEL = 188
47 ++SUBLEVEL = 189
48 + EXTRAVERSION =
49 + NAME = "People's Front"
50 +
51 +diff --git a/arch/arc/kernel/signal.c b/arch/arc/kernel/signal.c
52 +index 48685445002e7..da243420bcb58 100644
53 +--- a/arch/arc/kernel/signal.c
54 ++++ b/arch/arc/kernel/signal.c
55 +@@ -99,7 +99,7 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs,
56 + sizeof(sf->uc.uc_mcontext.regs.scratch));
57 + err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t));
58 +
59 +- return err;
60 ++ return err ? -EFAULT : 0;
61 + }
62 +
63 + static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)
64 +@@ -113,7 +113,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf)
65 + &(sf->uc.uc_mcontext.regs.scratch),
66 + sizeof(sf->uc.uc_mcontext.regs.scratch));
67 + if (err)
68 +- return err;
69 ++ return -EFAULT;
70 +
71 + set_current_blocked(&set);
72 + regs->bta = uregs.scratch.bta;
73 +diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
74 +index 4043ecb380168..0c8fcfb292bf9 100644
75 +--- a/arch/arm/boot/dts/omap3.dtsi
76 ++++ b/arch/arm/boot/dts/omap3.dtsi
77 +@@ -23,6 +23,9 @@
78 + i2c0 = &i2c1;
79 + i2c1 = &i2c2;
80 + i2c2 = &i2c3;
81 ++ mmc0 = &mmc1;
82 ++ mmc1 = &mmc2;
83 ++ mmc2 = &mmc3;
84 + serial0 = &uart1;
85 + serial1 = &uart2;
86 + serial2 = &uart3;
87 +diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
88 +index 8f907c235b02c..046e77024567b 100644
89 +--- a/arch/arm/boot/dts/omap4.dtsi
90 ++++ b/arch/arm/boot/dts/omap4.dtsi
91 +@@ -25,6 +25,11 @@
92 + i2c1 = &i2c2;
93 + i2c2 = &i2c3;
94 + i2c3 = &i2c4;
95 ++ mmc0 = &mmc1;
96 ++ mmc1 = &mmc2;
97 ++ mmc2 = &mmc3;
98 ++ mmc3 = &mmc4;
99 ++ mmc4 = &mmc5;
100 + serial0 = &uart1;
101 + serial1 = &uart2;
102 + serial2 = &uart3;
103 +diff --git a/arch/arm/boot/dts/omap44xx-clocks.dtsi b/arch/arm/boot/dts/omap44xx-clocks.dtsi
104 +index 279ff2f419df6..c654588f9e8cc 100644
105 +--- a/arch/arm/boot/dts/omap44xx-clocks.dtsi
106 ++++ b/arch/arm/boot/dts/omap44xx-clocks.dtsi
107 +@@ -773,14 +773,6 @@
108 + ti,max-div = <2>;
109 + };
110 +
111 +- sha2md5_fck: sha2md5_fck@15c8 {
112 +- #clock-cells = <0>;
113 +- compatible = "ti,gate-clock";
114 +- clocks = <&l3_div_ck>;
115 +- ti,bit-shift = <1>;
116 +- reg = <0x15c8>;
117 +- };
118 +-
119 + usb_phy_cm_clk32k: usb_phy_cm_clk32k@640 {
120 + #clock-cells = <0>;
121 + compatible = "ti,gate-clock";
122 +diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
123 +index 3c0bafe0fb05f..cf66c374de4f2 100644
124 +--- a/arch/arm/boot/dts/omap5.dtsi
125 ++++ b/arch/arm/boot/dts/omap5.dtsi
126 +@@ -26,6 +26,11 @@
127 + i2c2 = &i2c3;
128 + i2c3 = &i2c4;
129 + i2c4 = &i2c5;
130 ++ mmc0 = &mmc1;
131 ++ mmc1 = &mmc2;
132 ++ mmc2 = &mmc3;
133 ++ mmc3 = &mmc4;
134 ++ mmc4 = &mmc5;
135 + serial0 = &uart1;
136 + serial1 = &uart2;
137 + serial2 = &uart3;
138 +diff --git a/arch/arm/mach-footbridge/cats-pci.c b/arch/arm/mach-footbridge/cats-pci.c
139 +index 0b2fd7e2e9b42..90b1e9be430e9 100644
140 +--- a/arch/arm/mach-footbridge/cats-pci.c
141 ++++ b/arch/arm/mach-footbridge/cats-pci.c
142 +@@ -15,14 +15,14 @@
143 + #include <asm/mach-types.h>
144 +
145 + /* cats host-specific stuff */
146 +-static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
147 ++static int irqmap_cats[] = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
148 +
149 + static u8 cats_no_swizzle(struct pci_dev *dev, u8 *pin)
150 + {
151 + return 0;
152 + }
153 +
154 +-static int __init cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
155 ++static int cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
156 + {
157 + if (dev->irq >= 255)
158 + return -1; /* not a valid interrupt. */
159 +diff --git a/arch/arm/mach-footbridge/ebsa285-pci.c b/arch/arm/mach-footbridge/ebsa285-pci.c
160 +index 6f28aaa9ca79b..c3f280d08fa7f 100644
161 +--- a/arch/arm/mach-footbridge/ebsa285-pci.c
162 ++++ b/arch/arm/mach-footbridge/ebsa285-pci.c
163 +@@ -14,9 +14,9 @@
164 + #include <asm/mach/pci.h>
165 + #include <asm/mach-types.h>
166 +
167 +-static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };
168 ++static int irqmap_ebsa285[] = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };
169 +
170 +-static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
171 ++static int ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
172 + {
173 + if (dev->vendor == PCI_VENDOR_ID_CONTAQ &&
174 + dev->device == PCI_DEVICE_ID_CONTAQ_82C693)
175 +diff --git a/arch/arm/mach-footbridge/netwinder-pci.c b/arch/arm/mach-footbridge/netwinder-pci.c
176 +index 9473aa0305e5f..e8304392074b8 100644
177 +--- a/arch/arm/mach-footbridge/netwinder-pci.c
178 ++++ b/arch/arm/mach-footbridge/netwinder-pci.c
179 +@@ -18,7 +18,7 @@
180 + * We now use the slot ID instead of the device identifiers to select
181 + * which interrupt is routed where.
182 + */
183 +-static int __init netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
184 ++static int netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
185 + {
186 + switch (slot) {
187 + case 0: /* host bridge */
188 +diff --git a/arch/arm/mach-footbridge/personal-pci.c b/arch/arm/mach-footbridge/personal-pci.c
189 +index 4391e433a4b2f..9d19aa98a663e 100644
190 +--- a/arch/arm/mach-footbridge/personal-pci.c
191 ++++ b/arch/arm/mach-footbridge/personal-pci.c
192 +@@ -14,13 +14,12 @@
193 + #include <asm/mach/pci.h>
194 + #include <asm/mach-types.h>
195 +
196 +-static int irqmap_personal_server[] __initdata = {
197 ++static int irqmap_personal_server[] = {
198 + IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0,
199 + IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI
200 + };
201 +
202 +-static int __init personal_server_map_irq(const struct pci_dev *dev, u8 slot,
203 +- u8 pin)
204 ++static int personal_server_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
205 + {
206 + unsigned char line;
207 +
208 +diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c
209 +index 84613abf35a33..79ff5b9534313 100644
210 +--- a/arch/arm/mach-keystone/keystone.c
211 ++++ b/arch/arm/mach-keystone/keystone.c
212 +@@ -65,7 +65,7 @@ static void __init keystone_init(void)
213 + static long long __init keystone_pv_fixup(void)
214 + {
215 + long long offset;
216 +- phys_addr_t mem_start, mem_end;
217 ++ u64 mem_start, mem_end;
218 +
219 + mem_start = memblock_start_of_DRAM();
220 + mem_end = memblock_end_of_DRAM();
221 +@@ -78,7 +78,7 @@ static long long __init keystone_pv_fixup(void)
222 + if (mem_start < KEYSTONE_HIGH_PHYS_START ||
223 + mem_end > KEYSTONE_HIGH_PHYS_END) {
224 + pr_crit("Invalid address space for memory (%08llx-%08llx)\n",
225 +- (u64)mem_start, (u64)mem_end);
226 ++ mem_start, mem_end);
227 + return 0;
228 + }
229 +
230 +diff --git a/arch/arm/probes/uprobes/core.c b/arch/arm/probes/uprobes/core.c
231 +index bf992264060ef..b1b7b51c938c4 100644
232 +--- a/arch/arm/probes/uprobes/core.c
233 ++++ b/arch/arm/probes/uprobes/core.c
234 +@@ -207,7 +207,7 @@ unsigned long uprobe_get_swbp_addr(struct pt_regs *regs)
235 + static struct undef_hook uprobes_arm_break_hook = {
236 + .instr_mask = 0x0fffffff,
237 + .instr_val = (UPROBE_SWBP_ARM_INSN & 0x0fffffff),
238 +- .cpsr_mask = MODE_MASK,
239 ++ .cpsr_mask = (PSR_T_BIT | MODE_MASK),
240 + .cpsr_val = USR_MODE,
241 + .fn = uprobe_trap_handler,
242 + };
243 +@@ -215,7 +215,7 @@ static struct undef_hook uprobes_arm_break_hook = {
244 + static struct undef_hook uprobes_arm_ss_hook = {
245 + .instr_mask = 0x0fffffff,
246 + .instr_val = (UPROBE_SS_ARM_INSN & 0x0fffffff),
247 +- .cpsr_mask = MODE_MASK,
248 ++ .cpsr_mask = (PSR_T_BIT | MODE_MASK),
249 + .cpsr_val = USR_MODE,
250 + .fn = uprobe_trap_handler,
251 + };
252 +diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h
253 +index 844f05b23115a..4fbbcdda70d76 100644
254 +--- a/arch/arm64/include/asm/alternative.h
255 ++++ b/arch/arm64/include/asm/alternative.h
256 +@@ -119,9 +119,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
257 + .popsection
258 + .subsection 1
259 + 663: \insn2
260 +-664: .previous
261 +- .org . - (664b-663b) + (662b-661b)
262 ++664: .org . - (664b-663b) + (662b-661b)
263 + .org . - (662b-661b) + (664b-663b)
264 ++ .previous
265 + .endif
266 + .endm
267 +
268 +@@ -191,11 +191,11 @@ static inline void apply_alternatives_module(void *start, size_t length) { }
269 + */
270 + .macro alternative_endif
271 + 664:
272 ++ .org . - (664b-663b) + (662b-661b)
273 ++ .org . - (662b-661b) + (664b-663b)
274 + .if .Lasm_alt_mode==0
275 + .previous
276 + .endif
277 +- .org . - (664b-663b) + (662b-661b)
278 +- .org . - (662b-661b) + (664b-663b)
279 + .endm
280 +
281 + /*
282 +diff --git a/arch/arm64/include/asm/word-at-a-time.h b/arch/arm64/include/asm/word-at-a-time.h
283 +index b0d708ff7f4e5..a2601c1ccf435 100644
284 +--- a/arch/arm64/include/asm/word-at-a-time.h
285 ++++ b/arch/arm64/include/asm/word-at-a-time.h
286 +@@ -64,7 +64,7 @@ static inline unsigned long find_zero(unsigned long mask)
287 + */
288 + static inline unsigned long load_unaligned_zeropad(const void *addr)
289 + {
290 +- unsigned long ret, offset;
291 ++ unsigned long ret, tmp;
292 +
293 + /* Load word from unaligned pointer addr */
294 + asm(
295 +@@ -72,9 +72,9 @@ static inline unsigned long load_unaligned_zeropad(const void *addr)
296 + "2:\n"
297 + " .pushsection .fixup,\"ax\"\n"
298 + " .align 2\n"
299 +- "3: and %1, %2, #0x7\n"
300 +- " bic %2, %2, #0x7\n"
301 +- " ldr %0, [%2]\n"
302 ++ "3: bic %1, %2, #0x7\n"
303 ++ " ldr %0, [%1]\n"
304 ++ " and %1, %2, #0x7\n"
305 + " lsl %1, %1, #0x3\n"
306 + #ifndef __AARCH64EB__
307 + " lsr %0, %0, %1\n"
308 +@@ -84,7 +84,7 @@ static inline unsigned long load_unaligned_zeropad(const void *addr)
309 + " b 2b\n"
310 + " .popsection\n"
311 + _ASM_EXTABLE(1b, 3b)
312 +- : "=&r" (ret), "=&r" (offset)
313 ++ : "=&r" (ret), "=&r" (tmp)
314 + : "r" (addr), "Q" (*(unsigned long *)addr));
315 +
316 + return ret;
317 +diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
318 +index 1928d5719e417..db3104c9fac53 100644
319 +--- a/arch/ia64/mm/discontig.c
320 ++++ b/arch/ia64/mm/discontig.c
321 +@@ -96,7 +96,7 @@ static int __init build_node_maps(unsigned long start, unsigned long len,
322 + * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been
323 + * called yet. Note that node 0 will also count all non-existent cpus.
324 + */
325 +-static int __meminit early_nr_cpus_node(int node)
326 ++static int early_nr_cpus_node(int node)
327 + {
328 + int cpu, n = 0;
329 +
330 +@@ -111,7 +111,7 @@ static int __meminit early_nr_cpus_node(int node)
331 + * compute_pernodesize - compute size of pernode data
332 + * @node: the node id.
333 + */
334 +-static unsigned long __meminit compute_pernodesize(int node)
335 ++static unsigned long compute_pernodesize(int node)
336 + {
337 + unsigned long pernodesize = 0, cpus;
338 +
339 +@@ -371,7 +371,7 @@ static void __init reserve_pernode_space(void)
340 + }
341 + }
342 +
343 +-static void __meminit scatter_node_data(void)
344 ++static void scatter_node_data(void)
345 + {
346 + pg_data_t **dst;
347 + int node;
348 +diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
349 +index 150130c897c39..7e6a9cf863c73 100644
350 +--- a/arch/s390/kernel/entry.S
351 ++++ b/arch/s390/kernel/entry.S
352 +@@ -949,6 +949,7 @@ ENTRY(ext_int_handler)
353 + * Load idle PSW. The second "half" of this function is in .Lcleanup_idle.
354 + */
355 + ENTRY(psw_idle)
356 ++ stg %r14,(__SF_GPRS+8*8)(%r15)
357 + stg %r3,__SF_EMPTY(%r15)
358 + larl %r1,.Lpsw_idle_lpsw+4
359 + stg %r1,__SF_EMPTY+8(%r15)
360 +diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
361 +index 8e4e8e423839a..c06074b847fa6 100644
362 +--- a/arch/x86/events/intel/uncore_snbep.c
363 ++++ b/arch/x86/events/intel/uncore_snbep.c
364 +@@ -1030,7 +1030,6 @@ enum {
365 + SNBEP_PCI_QPI_PORT0_FILTER,
366 + SNBEP_PCI_QPI_PORT1_FILTER,
367 + BDX_PCI_QPI_PORT2_FILTER,
368 +- HSWEP_PCI_PCU_3,
369 + };
370 +
371 + static int snbep_qpi_hw_config(struct intel_uncore_box *box, struct perf_event *event)
372 +@@ -2687,22 +2686,33 @@ static struct intel_uncore_type *hswep_msr_uncores[] = {
373 + NULL,
374 + };
375 +
376 +-void hswep_uncore_cpu_init(void)
377 ++#define HSWEP_PCU_DID 0x2fc0
378 ++#define HSWEP_PCU_CAPID4_OFFET 0x94
379 ++#define hswep_get_chop(_cap) (((_cap) >> 6) & 0x3)
380 ++
381 ++static bool hswep_has_limit_sbox(unsigned int device)
382 + {
383 +- int pkg = boot_cpu_data.logical_proc_id;
384 ++ struct pci_dev *dev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL);
385 ++ u32 capid4;
386 ++
387 ++ if (!dev)
388 ++ return false;
389 ++
390 ++ pci_read_config_dword(dev, HSWEP_PCU_CAPID4_OFFET, &capid4);
391 ++ if (!hswep_get_chop(capid4))
392 ++ return true;
393 +
394 ++ return false;
395 ++}
396 ++
397 ++void hswep_uncore_cpu_init(void)
398 ++{
399 + if (hswep_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
400 + hswep_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
401 +
402 + /* Detect 6-8 core systems with only two SBOXes */
403 +- if (uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3]) {
404 +- u32 capid4;
405 +-
406 +- pci_read_config_dword(uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3],
407 +- 0x94, &capid4);
408 +- if (((capid4 >> 6) & 0x3) == 0)
409 +- hswep_uncore_sbox.num_boxes = 2;
410 +- }
411 ++ if (hswep_has_limit_sbox(HSWEP_PCU_DID))
412 ++ hswep_uncore_sbox.num_boxes = 2;
413 +
414 + uncore_msr_uncores = hswep_msr_uncores;
415 + }
416 +@@ -2965,11 +2975,6 @@ static const struct pci_device_id hswep_uncore_pci_ids[] = {
417 + .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,
418 + SNBEP_PCI_QPI_PORT1_FILTER),
419 + },
420 +- { /* PCU.3 (for Capability registers) */
421 +- PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2fc0),
422 +- .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,
423 +- HSWEP_PCI_PCU_3),
424 +- },
425 + { /* end: all zeroes */ }
426 + };
427 +
428 +@@ -3061,27 +3066,18 @@ static struct event_constraint bdx_uncore_pcu_constraints[] = {
429 + EVENT_CONSTRAINT_END
430 + };
431 +
432 ++#define BDX_PCU_DID 0x6fc0
433 ++
434 + void bdx_uncore_cpu_init(void)
435 + {
436 +- int pkg = topology_phys_to_logical_pkg(boot_cpu_data.phys_proc_id);
437 +-
438 + if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
439 + bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
440 + uncore_msr_uncores = bdx_msr_uncores;
441 +
442 +- /* BDX-DE doesn't have SBOX */
443 +- if (boot_cpu_data.x86_model == 86) {
444 +- uncore_msr_uncores[BDX_MSR_UNCORE_SBOX] = NULL;
445 + /* Detect systems with no SBOXes */
446 +- } else if (uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3]) {
447 +- struct pci_dev *pdev;
448 +- u32 capid4;
449 +-
450 +- pdev = uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3];
451 +- pci_read_config_dword(pdev, 0x94, &capid4);
452 +- if (((capid4 >> 6) & 0x3) == 0)
453 +- bdx_msr_uncores[BDX_MSR_UNCORE_SBOX] = NULL;
454 +- }
455 ++ if ((boot_cpu_data.x86_model == 86) || hswep_has_limit_sbox(BDX_PCU_DID))
456 ++ uncore_msr_uncores[BDX_MSR_UNCORE_SBOX] = NULL;
457 ++
458 + hswep_uncore_pcu.constraints = bdx_uncore_pcu_constraints;
459 + }
460 +
461 +@@ -3302,11 +3298,6 @@ static const struct pci_device_id bdx_uncore_pci_ids[] = {
462 + .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,
463 + BDX_PCI_QPI_PORT2_FILTER),
464 + },
465 +- { /* PCU.3 (for Capability registers) */
466 +- PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fc0),
467 +- .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,
468 +- HSWEP_PCI_PCU_3),
469 +- },
470 + { /* end: all zeroes */ }
471 + };
472 +
473 +diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
474 +index f631a3f155875..91b3483e5085f 100644
475 +--- a/arch/x86/kernel/crash.c
476 ++++ b/arch/x86/kernel/crash.c
477 +@@ -356,7 +356,7 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
478 + struct crash_memmap_data cmd;
479 + struct crash_mem *cmem;
480 +
481 +- cmem = vzalloc(sizeof(struct crash_mem));
482 ++ cmem = vzalloc(struct_size(cmem, ranges, 1));
483 + if (!cmem)
484 + return -ENOMEM;
485 +
486 +diff --git a/drivers/dma/dw/Kconfig b/drivers/dma/dw/Kconfig
487 +index 04b9728c1d269..070860ec0ef1d 100644
488 +--- a/drivers/dma/dw/Kconfig
489 ++++ b/drivers/dma/dw/Kconfig
490 +@@ -8,6 +8,7 @@ config DW_DMAC_CORE
491 +
492 + config DW_DMAC
493 + tristate "Synopsys DesignWare AHB DMA platform driver"
494 ++ depends on HAS_IOMEM
495 + select DW_DMAC_CORE
496 + help
497 + Support the Synopsys DesignWare AHB DMA controller. This
498 +@@ -16,6 +17,7 @@ config DW_DMAC
499 + config DW_DMAC_PCI
500 + tristate "Synopsys DesignWare AHB DMA PCI driver"
501 + depends on PCI
502 ++ depends on HAS_IOMEM
503 + select DW_DMAC_CORE
504 + help
505 + Support the Synopsys DesignWare AHB DMA controller on the
506 +diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
507 +index 3dbaf489a8a52..e0ccc79b239a5 100644
508 +--- a/drivers/gpio/gpiolib-sysfs.c
509 ++++ b/drivers/gpio/gpiolib-sysfs.c
510 +@@ -462,6 +462,8 @@ static ssize_t export_store(struct class *class,
511 + long gpio;
512 + struct gpio_desc *desc;
513 + int status;
514 ++ struct gpio_chip *gc;
515 ++ int offset;
516 +
517 + status = kstrtol(buf, 0, &gpio);
518 + if (status < 0)
519 +@@ -473,6 +475,12 @@ static ssize_t export_store(struct class *class,
520 + pr_warn("%s: invalid GPIO %ld\n", __func__, gpio);
521 + return -EINVAL;
522 + }
523 ++ gc = desc->gdev->chip;
524 ++ offset = gpio_chip_hwgpio(desc);
525 ++ if (!gpiochip_line_is_valid(gc, offset)) {
526 ++ pr_warn("%s: GPIO %ld masked\n", __func__, gpio);
527 ++ return -EINVAL;
528 ++ }
529 +
530 + /* No extra locking here; FLAG_SYSFS just signifies that the
531 + * request and export were done by on behalf of userspace, so
532 +diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
533 +index 776bbe9775e9d..ba513018534e3 100644
534 +--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
535 ++++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
536 +@@ -1194,8 +1194,8 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu)
537 +
538 + static int a5xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value)
539 + {
540 +- *value = gpu_read64(gpu, REG_A5XX_RBBM_PERFCTR_CP_0_LO,
541 +- REG_A5XX_RBBM_PERFCTR_CP_0_HI);
542 ++ *value = gpu_read64(gpu, REG_A5XX_RBBM_ALWAYSON_COUNTER_LO,
543 ++ REG_A5XX_RBBM_ALWAYSON_COUNTER_HI);
544 +
545 + return 0;
546 + }
547 +diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
548 +index c629f742a1d19..c280fdc44939f 100644
549 +--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
550 ++++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
551 +@@ -713,8 +713,8 @@ static int a6xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value)
552 + /* Force the GPU power on so we can read this register */
553 + a6xx_gmu_set_oob(&a6xx_gpu->gmu, GMU_OOB_GPU_SET);
554 +
555 +- *value = gpu_read64(gpu, REG_A6XX_RBBM_PERFCTR_CP_0_LO,
556 +- REG_A6XX_RBBM_PERFCTR_CP_0_HI);
557 ++ *value = gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO,
558 ++ REG_A6XX_CP_ALWAYS_ON_COUNTER_HI);
559 +
560 + a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_GPU_SET);
561 + return 0;
562 +diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
563 +index f4cf541d13e08..3eddd8f73b577 100644
564 +--- a/drivers/hid/hid-alps.c
565 ++++ b/drivers/hid/hid-alps.c
566 +@@ -766,6 +766,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi)
567 +
568 + if (input_register_device(data->input2)) {
569 + input_free_device(input2);
570 ++ ret = -ENOENT;
571 + goto exit;
572 + }
573 + }
574 +diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c
575 +index fab8fd7082e04..3e58d4c3cf2c0 100644
576 +--- a/drivers/hid/hid-google-hammer.c
577 ++++ b/drivers/hid/hid-google-hammer.c
578 +@@ -118,6 +118,8 @@ static int hammer_input_configured(struct hid_device *hdev,
579 + }
580 +
581 + static const struct hid_device_id hammer_devices[] = {
582 ++ { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
583 ++ USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_DON) },
584 + { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
585 + USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_HAMMER) },
586 + { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
587 +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
588 +index 2f1516b328372..68908dac5835e 100644
589 +--- a/drivers/hid/hid-ids.h
590 ++++ b/drivers/hid/hid-ids.h
591 +@@ -478,6 +478,7 @@
592 + #define USB_DEVICE_ID_GOOGLE_MASTERBALL 0x503c
593 + #define USB_DEVICE_ID_GOOGLE_MAGNEMITE 0x503d
594 + #define USB_DEVICE_ID_GOOGLE_MOONBALL 0x5044
595 ++#define USB_DEVICE_ID_GOOGLE_DON 0x5050
596 +
597 + #define USB_VENDOR_ID_GOTOP 0x08f2
598 + #define USB_DEVICE_ID_SUPER_Q2 0x007f
599 +diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
600 +index 274a55702784a..10524c93f8b62 100644
601 +--- a/drivers/hid/wacom_wac.c
602 ++++ b/drivers/hid/wacom_wac.c
603 +@@ -2496,7 +2496,7 @@ static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac,
604 + !wacom_wac->shared->is_touch_on) {
605 + if (!wacom_wac->shared->touch_down)
606 + return;
607 +- prox = 0;
608 ++ prox = false;
609 + }
610 +
611 + wacom_wac->hid_data.num_received++;
612 +@@ -3528,8 +3528,6 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
613 + {
614 + struct wacom_features *features = &wacom_wac->features;
615 +
616 +- input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
617 +-
618 + if (!(features->device_type & WACOM_DEVICETYPE_PEN))
619 + return -ENODEV;
620 +
621 +@@ -3544,6 +3542,7 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
622 + return 0;
623 + }
624 +
625 ++ input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
626 + __set_bit(BTN_TOUCH, input_dev->keybit);
627 + __set_bit(ABS_MISC, input_dev->absbit);
628 +
629 +@@ -3694,8 +3693,6 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
630 + {
631 + struct wacom_features *features = &wacom_wac->features;
632 +
633 +- input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
634 +-
635 + if (!(features->device_type & WACOM_DEVICETYPE_TOUCH))
636 + return -ENODEV;
637 +
638 +@@ -3708,6 +3705,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
639 + /* setup has already been done */
640 + return 0;
641 +
642 ++ input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
643 + __set_bit(BTN_TOUCH, input_dev->keybit);
644 +
645 + if (features->touch_max == 1) {
646 +diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c
647 +index c7f26fa3034ca..cf138d836eec6 100644
648 +--- a/drivers/input/keyboard/nspire-keypad.c
649 ++++ b/drivers/input/keyboard/nspire-keypad.c
650 +@@ -96,9 +96,15 @@ static irqreturn_t nspire_keypad_irq(int irq, void *dev_id)
651 + return IRQ_HANDLED;
652 + }
653 +
654 +-static int nspire_keypad_chip_init(struct nspire_keypad *keypad)
655 ++static int nspire_keypad_open(struct input_dev *input)
656 + {
657 ++ struct nspire_keypad *keypad = input_get_drvdata(input);
658 + unsigned long val = 0, cycles_per_us, delay_cycles, row_delay_cycles;
659 ++ int error;
660 ++
661 ++ error = clk_prepare_enable(keypad->clk);
662 ++ if (error)
663 ++ return error;
664 +
665 + cycles_per_us = (clk_get_rate(keypad->clk) / 1000000);
666 + if (cycles_per_us == 0)
667 +@@ -124,30 +130,6 @@ static int nspire_keypad_chip_init(struct nspire_keypad *keypad)
668 + keypad->int_mask = 1 << 1;
669 + writel(keypad->int_mask, keypad->reg_base + KEYPAD_INTMSK);
670 +
671 +- /* Disable GPIO interrupts to prevent hanging on touchpad */
672 +- /* Possibly used to detect touchpad events */
673 +- writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT);
674 +- /* Acknowledge existing interrupts */
675 +- writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS);
676 +-
677 +- return 0;
678 +-}
679 +-
680 +-static int nspire_keypad_open(struct input_dev *input)
681 +-{
682 +- struct nspire_keypad *keypad = input_get_drvdata(input);
683 +- int error;
684 +-
685 +- error = clk_prepare_enable(keypad->clk);
686 +- if (error)
687 +- return error;
688 +-
689 +- error = nspire_keypad_chip_init(keypad);
690 +- if (error) {
691 +- clk_disable_unprepare(keypad->clk);
692 +- return error;
693 +- }
694 +-
695 + return 0;
696 + }
697 +
698 +@@ -155,6 +137,11 @@ static void nspire_keypad_close(struct input_dev *input)
699 + {
700 + struct nspire_keypad *keypad = input_get_drvdata(input);
701 +
702 ++ /* Disable interrupts */
703 ++ writel(0, keypad->reg_base + KEYPAD_INTMSK);
704 ++ /* Acknowledge existing interrupts */
705 ++ writel(~0, keypad->reg_base + KEYPAD_INT);
706 ++
707 + clk_disable_unprepare(keypad->clk);
708 + }
709 +
710 +@@ -215,6 +202,25 @@ static int nspire_keypad_probe(struct platform_device *pdev)
711 + return -ENOMEM;
712 + }
713 +
714 ++ error = clk_prepare_enable(keypad->clk);
715 ++ if (error) {
716 ++ dev_err(&pdev->dev, "failed to enable clock\n");
717 ++ return error;
718 ++ }
719 ++
720 ++ /* Disable interrupts */
721 ++ writel(0, keypad->reg_base + KEYPAD_INTMSK);
722 ++ /* Acknowledge existing interrupts */
723 ++ writel(~0, keypad->reg_base + KEYPAD_INT);
724 ++
725 ++ /* Disable GPIO interrupts to prevent hanging on touchpad */
726 ++ /* Possibly used to detect touchpad events */
727 ++ writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT);
728 ++ /* Acknowledge existing GPIO interrupts */
729 ++ writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS);
730 ++
731 ++ clk_disable_unprepare(keypad->clk);
732 ++
733 + input_set_drvdata(input, keypad);
734 +
735 + input->id.bustype = BUS_HOST;
736 +diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
737 +index 0463ab79160b7..f20e54f41dde9 100644
738 +--- a/drivers/input/serio/i8042-x86ia64io.h
739 ++++ b/drivers/input/serio/i8042-x86ia64io.h
740 +@@ -592,6 +592,7 @@ static const struct dmi_system_id i8042_dmi_noselftest_table[] = {
741 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
742 + DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
743 + },
744 ++ }, {
745 + .matches = {
746 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
747 + DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
748 +diff --git a/drivers/input/touchscreen/s6sy761.c b/drivers/input/touchscreen/s6sy761.c
749 +index b63d7fdf0cd20..85a1f465c097e 100644
750 +--- a/drivers/input/touchscreen/s6sy761.c
751 ++++ b/drivers/input/touchscreen/s6sy761.c
752 +@@ -145,8 +145,8 @@ static void s6sy761_report_coordinates(struct s6sy761_data *sdata,
753 + u8 major = event[4];
754 + u8 minor = event[5];
755 + u8 z = event[6] & S6SY761_MASK_Z;
756 +- u16 x = (event[1] << 3) | ((event[3] & S6SY761_MASK_X) >> 4);
757 +- u16 y = (event[2] << 3) | (event[3] & S6SY761_MASK_Y);
758 ++ u16 x = (event[1] << 4) | ((event[3] & S6SY761_MASK_X) >> 4);
759 ++ u16 y = (event[2] << 4) | (event[3] & S6SY761_MASK_Y);
760 +
761 + input_mt_slot(sdata->input, tid);
762 +
763 +diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c
764 +index dd7684333d90a..a433f5824f188 100644
765 +--- a/drivers/md/dm-verity-fec.c
766 ++++ b/drivers/md/dm-verity-fec.c
767 +@@ -69,7 +69,7 @@ static u8 *fec_read_parity(struct dm_verity *v, u64 rsb, int index,
768 + u8 *res;
769 +
770 + position = (index + rsb) * v->fec->roots;
771 +- block = div64_u64_rem(position, v->fec->roots << SECTOR_SHIFT, &rem);
772 ++ block = div64_u64_rem(position, v->fec->io_size, &rem);
773 + *offset = (unsigned)rem;
774 +
775 + res = dm_bufio_read(v->fec->bufio, block, buf);
776 +@@ -158,7 +158,7 @@ static int fec_decode_bufs(struct dm_verity *v, struct dm_verity_fec_io *fio,
777 +
778 + /* read the next block when we run out of parity bytes */
779 + offset += v->fec->roots;
780 +- if (offset >= v->fec->roots << SECTOR_SHIFT) {
781 ++ if (offset >= v->fec->io_size) {
782 + dm_bufio_release(buf);
783 +
784 + par = fec_read_parity(v, rsb, block_offset, &offset, &buf);
785 +@@ -743,8 +743,13 @@ int verity_fec_ctr(struct dm_verity *v)
786 + return -E2BIG;
787 + }
788 +
789 ++ if ((f->roots << SECTOR_SHIFT) & ((1 << v->data_dev_block_bits) - 1))
790 ++ f->io_size = 1 << v->data_dev_block_bits;
791 ++ else
792 ++ f->io_size = v->fec->roots << SECTOR_SHIFT;
793 ++
794 + f->bufio = dm_bufio_client_create(f->dev->bdev,
795 +- f->roots << SECTOR_SHIFT,
796 ++ f->io_size,
797 + 1, 0, NULL, NULL);
798 + if (IS_ERR(f->bufio)) {
799 + ti->error = "Cannot initialize FEC bufio client";
800 +diff --git a/drivers/md/dm-verity-fec.h b/drivers/md/dm-verity-fec.h
801 +index 6ad803b2b36ca..b9f0bb0f63c42 100644
802 +--- a/drivers/md/dm-verity-fec.h
803 ++++ b/drivers/md/dm-verity-fec.h
804 +@@ -40,6 +40,7 @@ struct dm_verity_fec {
805 + struct dm_dev *dev; /* parity data device */
806 + struct dm_bufio_client *data_bufio; /* for data dev access */
807 + struct dm_bufio_client *bufio; /* for parity data access */
808 ++ size_t io_size; /* IO size for roots */
809 + sector_t start; /* parity data start in blocks */
810 + sector_t blocks; /* number of blocks covered */
811 + sector_t rounds; /* number of interleaving rounds */
812 +diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
813 +index e04b7fa068aff..67c0ad3b80795 100644
814 +--- a/drivers/net/dsa/mv88e6xxx/chip.c
815 ++++ b/drivers/net/dsa/mv88e6xxx/chip.c
816 +@@ -2634,10 +2634,17 @@ unlock:
817 + return err;
818 + }
819 +
820 ++/* prod_id for switch families which do not have a PHY model number */
821 ++static const u16 family_prod_id_table[] = {
822 ++ [MV88E6XXX_FAMILY_6341] = MV88E6XXX_PORT_SWITCH_ID_PROD_6341,
823 ++ [MV88E6XXX_FAMILY_6390] = MV88E6XXX_PORT_SWITCH_ID_PROD_6390,
824 ++};
825 ++
826 + static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)
827 + {
828 + struct mv88e6xxx_mdio_bus *mdio_bus = bus->priv;
829 + struct mv88e6xxx_chip *chip = mdio_bus->chip;
830 ++ u16 prod_id;
831 + u16 val;
832 + int err;
833 +
834 +@@ -2648,23 +2655,12 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)
835 + err = chip->info->ops->phy_read(chip, bus, phy, reg, &val);
836 + mutex_unlock(&chip->reg_lock);
837 +
838 +- if (reg == MII_PHYSID2) {
839 +- /* Some internal PHYs don't have a model number. */
840 +- if (chip->info->family != MV88E6XXX_FAMILY_6165)
841 +- /* Then there is the 6165 family. It gets is
842 +- * PHYs correct. But it can also have two
843 +- * SERDES interfaces in the PHY address
844 +- * space. And these don't have a model
845 +- * number. But they are not PHYs, so we don't
846 +- * want to give them something a PHY driver
847 +- * will recognise.
848 +- *
849 +- * Use the mv88e6390 family model number
850 +- * instead, for anything which really could be
851 +- * a PHY,
852 +- */
853 +- if (!(val & 0x3f0))
854 +- val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4;
855 ++ /* Some internal PHYs don't have a model number. */
856 ++ if (reg == MII_PHYSID2 && !(val & 0x3f0) &&
857 ++ chip->info->family < ARRAY_SIZE(family_prod_id_table)) {
858 ++ prod_id = family_prod_id_table[chip->info->family];
859 ++ if (prod_id)
860 ++ val |= prod_id >> 4;
861 + }
862 +
863 + return err ? err : val;
864 +diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
865 +index f5ad12c109344..da84660ceae1f 100644
866 +--- a/drivers/net/ethernet/amd/pcnet32.c
867 ++++ b/drivers/net/ethernet/amd/pcnet32.c
868 +@@ -1548,8 +1548,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
869 + }
870 + pci_set_master(pdev);
871 +
872 +- ioaddr = pci_resource_start(pdev, 0);
873 +- if (!ioaddr) {
874 ++ if (!pci_resource_len(pdev, 0)) {
875 + if (pcnet32_debug & NETIF_MSG_PROBE)
876 + pr_err("card has no PCI IO resources, aborting\n");
877 + err = -ENODEV;
878 +@@ -1562,6 +1561,8 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
879 + pr_err("architecture does not support 32bit PCI busmaster DMA\n");
880 + goto err_disable_dev;
881 + }
882 ++
883 ++ ioaddr = pci_resource_start(pdev, 0);
884 + if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) {
885 + if (pcnet32_debug & NETIF_MSG_PROBE)
886 + pr_err("io address range already allocated\n");
887 +diff --git a/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h b/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h
888 +index b248966837b4c..7aad40b2aa736 100644
889 +--- a/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h
890 ++++ b/drivers/net/ethernet/cavium/liquidio/cn66xx_regs.h
891 +@@ -412,7 +412,7 @@
892 + | CN6XXX_INTR_M0UNWI_ERR \
893 + | CN6XXX_INTR_M1UPB0_ERR \
894 + | CN6XXX_INTR_M1UPWI_ERR \
895 +- | CN6XXX_INTR_M1UPB0_ERR \
896 ++ | CN6XXX_INTR_M1UNB0_ERR \
897 + | CN6XXX_INTR_M1UNWI_ERR \
898 + | CN6XXX_INTR_INSTR_DB_OF_ERR \
899 + | CN6XXX_INTR_SLIST_DB_OF_ERR \
900 +diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
901 +index a339ea2fd4961..8b07890b0b232 100644
902 +--- a/drivers/net/ethernet/davicom/dm9000.c
903 ++++ b/drivers/net/ethernet/davicom/dm9000.c
904 +@@ -1482,8 +1482,10 @@ dm9000_probe(struct platform_device *pdev)
905 +
906 + /* Init network device */
907 + ndev = alloc_etherdev(sizeof(struct board_info));
908 +- if (!ndev)
909 +- return -ENOMEM;
910 ++ if (!ndev) {
911 ++ ret = -ENOMEM;
912 ++ goto out_regulator_disable;
913 ++ }
914 +
915 + SET_NETDEV_DEV(ndev, &pdev->dev);
916 +
917 +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
918 +index 0c7c0206b1be5..9f72cd3b1d244 100644
919 +--- a/drivers/net/ethernet/ibm/ibmvnic.c
920 ++++ b/drivers/net/ethernet/ibm/ibmvnic.c
921 +@@ -1092,19 +1092,13 @@ static int __ibmvnic_open(struct net_device *netdev)
922 +
923 + rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_UP);
924 + if (rc) {
925 +- for (i = 0; i < adapter->req_rx_queues; i++)
926 +- napi_disable(&adapter->napi[i]);
927 ++ ibmvnic_napi_disable(adapter);
928 + release_resources(adapter);
929 + return rc;
930 + }
931 +
932 + netif_tx_start_all_queues(netdev);
933 +
934 +- if (prev_state == VNIC_CLOSED) {
935 +- for (i = 0; i < adapter->req_rx_queues; i++)
936 +- napi_schedule(&adapter->napi[i]);
937 +- }
938 +-
939 + adapter->state = VNIC_OPEN;
940 + return rc;
941 + }
942 +@@ -1761,7 +1755,7 @@ static int do_reset(struct ibmvnic_adapter *adapter,
943 + u64 old_num_rx_queues, old_num_tx_queues;
944 + u64 old_num_rx_slots, old_num_tx_slots;
945 + struct net_device *netdev = adapter->netdev;
946 +- int i, rc;
947 ++ int rc;
948 +
949 + netdev_dbg(adapter->netdev, "Re-setting driver (%d)\n",
950 + rwi->reset_reason);
951 +@@ -1879,10 +1873,6 @@ static int do_reset(struct ibmvnic_adapter *adapter,
952 + /* refresh device's multicast list */
953 + ibmvnic_set_multi(netdev);
954 +
955 +- /* kick napi */
956 +- for (i = 0; i < adapter->req_rx_queues; i++)
957 +- napi_schedule(&adapter->napi[i]);
958 +-
959 + if (adapter->reset_reason != VNIC_RESET_FAILOVER &&
960 + adapter->reset_reason != VNIC_RESET_CHANGE_PARAM) {
961 + call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, netdev);
962 +diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
963 +index 1591f81d8ae3b..fa0e7582159ff 100644
964 +--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
965 ++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
966 +@@ -11211,6 +11211,7 @@ static int i40e_sw_init(struct i40e_pf *pf)
967 + {
968 + int err = 0;
969 + int size;
970 ++ u16 pow;
971 +
972 + /* Set default capability flags */
973 + pf->flags = I40E_FLAG_RX_CSUM_ENABLED |
974 +@@ -11229,6 +11230,11 @@ static int i40e_sw_init(struct i40e_pf *pf)
975 + pf->rss_table_size = pf->hw.func_caps.rss_table_size;
976 + pf->rss_size_max = min_t(int, pf->rss_size_max,
977 + pf->hw.func_caps.num_tx_qp);
978 ++
979 ++ /* find the next higher power-of-2 of num cpus */
980 ++ pow = roundup_pow_of_two(num_online_cpus());
981 ++ pf->rss_size_max = min_t(int, pf->rss_size_max, pow);
982 ++
983 + if (pf->hw.func_caps.rss) {
984 + pf->flags |= I40E_FLAG_RSS_ENABLED;
985 + pf->alloc_rss_size = min_t(int, pf->rss_size_max,
986 +diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
987 +index 2e2afc824a6a8..ce6fecf421f86 100644
988 +--- a/drivers/net/geneve.c
989 ++++ b/drivers/net/geneve.c
990 +@@ -839,6 +839,9 @@ static int geneve_xmit_skb(struct sk_buff *skb, struct net_device *dev,
991 + __be16 df;
992 + int err;
993 +
994 ++ if (!pskb_network_may_pull(skb, sizeof(struct iphdr)))
995 ++ return -EINVAL;
996 ++
997 + sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
998 + rt = geneve_get_v4_rt(skb, dev, gs4, &fl4, info,
999 + geneve->info.key.tp_dst, sport);
1000 +@@ -882,6 +885,9 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev,
1001 + __be16 sport;
1002 + int err;
1003 +
1004 ++ if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr)))
1005 ++ return -EINVAL;
1006 ++
1007 + sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
1008 + dst = geneve_get_v6_dst(skb, dev, gs6, &fl6, info,
1009 + geneve->info.key.tp_dst, sport);
1010 +diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
1011 +index bb6107f3b947b..832a401c5fa56 100644
1012 +--- a/drivers/net/phy/marvell.c
1013 ++++ b/drivers/net/phy/marvell.c
1014 +@@ -2329,9 +2329,30 @@ static struct phy_driver marvell_drivers[] = {
1015 + .get_stats = marvell_get_stats,
1016 + },
1017 + {
1018 +- .phy_id = MARVELL_PHY_ID_88E6390,
1019 ++ .phy_id = MARVELL_PHY_ID_88E6341_FAMILY,
1020 + .phy_id_mask = MARVELL_PHY_ID_MASK,
1021 +- .name = "Marvell 88E6390",
1022 ++ .name = "Marvell 88E6341 Family",
1023 ++ .features = PHY_GBIT_FEATURES,
1024 ++ .flags = PHY_HAS_INTERRUPT,
1025 ++ .probe = m88e1510_probe,
1026 ++ .config_init = &marvell_config_init,
1027 ++ .config_aneg = &m88e6390_config_aneg,
1028 ++ .read_status = &marvell_read_status,
1029 ++ .ack_interrupt = &marvell_ack_interrupt,
1030 ++ .config_intr = &marvell_config_intr,
1031 ++ .did_interrupt = &m88e1121_did_interrupt,
1032 ++ .resume = &genphy_resume,
1033 ++ .suspend = &genphy_suspend,
1034 ++ .read_page = marvell_read_page,
1035 ++ .write_page = marvell_write_page,
1036 ++ .get_sset_count = marvell_get_sset_count,
1037 ++ .get_strings = marvell_get_strings,
1038 ++ .get_stats = marvell_get_stats,
1039 ++ },
1040 ++ {
1041 ++ .phy_id = MARVELL_PHY_ID_88E6390_FAMILY,
1042 ++ .phy_id_mask = MARVELL_PHY_ID_MASK,
1043 ++ .name = "Marvell 88E6390 Family",
1044 + .features = PHY_GBIT_FEATURES,
1045 + .flags = PHY_HAS_INTERRUPT,
1046 + .probe = m88e6390_probe,
1047 +@@ -2368,7 +2389,8 @@ static struct mdio_device_id __maybe_unused marvell_tbl[] = {
1048 + { MARVELL_PHY_ID_88E1540, MARVELL_PHY_ID_MASK },
1049 + { MARVELL_PHY_ID_88E1545, MARVELL_PHY_ID_MASK },
1050 + { MARVELL_PHY_ID_88E3016, MARVELL_PHY_ID_MASK },
1051 +- { MARVELL_PHY_ID_88E6390, MARVELL_PHY_ID_MASK },
1052 ++ { MARVELL_PHY_ID_88E6341_FAMILY, MARVELL_PHY_ID_MASK },
1053 ++ { MARVELL_PHY_ID_88E6390_FAMILY, MARVELL_PHY_ID_MASK },
1054 + { }
1055 + };
1056 +
1057 +diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
1058 +index 2eb33d2bb7ad4..94f1c2422f844 100644
1059 +--- a/drivers/net/usb/hso.c
1060 ++++ b/drivers/net/usb/hso.c
1061 +@@ -3114,7 +3114,7 @@ static void hso_free_interface(struct usb_interface *interface)
1062 + cancel_work_sync(&serial_table[i]->async_put_intf);
1063 + cancel_work_sync(&serial_table[i]->async_get_intf);
1064 + hso_serial_tty_unregister(serial);
1065 +- kref_put(&serial_table[i]->ref, hso_serial_ref_free);
1066 ++ kref_put(&serial->parent->ref, hso_serial_ref_free);
1067 + }
1068 + }
1069 +
1070 +diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
1071 +index 107bbd4ae825e..78c56149559ce 100644
1072 +--- a/drivers/net/xen-netback/xenbus.c
1073 ++++ b/drivers/net/xen-netback/xenbus.c
1074 +@@ -1043,11 +1043,15 @@ static void connect(struct backend_info *be)
1075 + xenvif_carrier_on(be->vif);
1076 +
1077 + unregister_hotplug_status_watch(be);
1078 +- err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch, NULL,
1079 +- hotplug_status_changed,
1080 +- "%s/%s", dev->nodename, "hotplug-status");
1081 +- if (!err)
1082 ++ if (xenbus_exists(XBT_NIL, dev->nodename, "hotplug-status")) {
1083 ++ err = xenbus_watch_pathfmt(dev, &be->hotplug_status_watch,
1084 ++ NULL, hotplug_status_changed,
1085 ++ "%s/%s", dev->nodename,
1086 ++ "hotplug-status");
1087 ++ if (err)
1088 ++ goto err;
1089 + be->have_hotplug_status_watch = 1;
1090 ++ }
1091 +
1092 + netif_tx_wake_all_queues(be->vif->dev);
1093 +
1094 +diff --git a/drivers/pinctrl/intel/pinctrl-lewisburg.c b/drivers/pinctrl/intel/pinctrl-lewisburg.c
1095 +index dc32c22bf19fa..8388aa671b21a 100644
1096 +--- a/drivers/pinctrl/intel/pinctrl-lewisburg.c
1097 ++++ b/drivers/pinctrl/intel/pinctrl-lewisburg.c
1098 +@@ -297,9 +297,9 @@ static const struct pinctrl_pin_desc lbg_pins[] = {
1099 + static const struct intel_community lbg_communities[] = {
1100 + LBG_COMMUNITY(0, 0, 71),
1101 + LBG_COMMUNITY(1, 72, 132),
1102 +- LBG_COMMUNITY(3, 133, 144),
1103 +- LBG_COMMUNITY(4, 145, 180),
1104 +- LBG_COMMUNITY(5, 181, 246),
1105 ++ LBG_COMMUNITY(3, 133, 143),
1106 ++ LBG_COMMUNITY(4, 144, 178),
1107 ++ LBG_COMMUNITY(5, 179, 246),
1108 + };
1109 +
1110 + static const struct intel_pinctrl_soc_data lbg_soc_data = {
1111 +diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
1112 +index d82698b7dfe6c..e032af6547334 100644
1113 +--- a/drivers/scsi/libsas/sas_ata.c
1114 ++++ b/drivers/scsi/libsas/sas_ata.c
1115 +@@ -215,18 +215,17 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
1116 + memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len);
1117 + task->total_xfer_len = qc->nbytes;
1118 + task->num_scatter = qc->n_elem;
1119 ++ task->data_dir = qc->dma_dir;
1120 ++ } else if (qc->tf.protocol == ATA_PROT_NODATA) {
1121 ++ task->data_dir = DMA_NONE;
1122 + } else {
1123 + for_each_sg(qc->sg, sg, qc->n_elem, si)
1124 + xfer += sg_dma_len(sg);
1125 +
1126 + task->total_xfer_len = xfer;
1127 + task->num_scatter = si;
1128 +- }
1129 +-
1130 +- if (qc->tf.protocol == ATA_PROT_NODATA)
1131 +- task->data_dir = DMA_NONE;
1132 +- else
1133 + task->data_dir = qc->dma_dir;
1134 ++ }
1135 + task->scatter = qc->sg;
1136 + task->ata_task.retry_count = 1;
1137 + task->task_state_flags = SAS_TASK_STATE_PENDING;
1138 +diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c
1139 +index 2aaf1b7103981..9ac89462a8e02 100644
1140 +--- a/drivers/scsi/scsi_transport_srp.c
1141 ++++ b/drivers/scsi/scsi_transport_srp.c
1142 +@@ -555,7 +555,7 @@ int srp_reconnect_rport(struct srp_rport *rport)
1143 + res = mutex_lock_interruptible(&rport->mutex);
1144 + if (res)
1145 + goto out;
1146 +- if (rport->state != SRP_RPORT_FAIL_FAST)
1147 ++ if (rport->state != SRP_RPORT_FAIL_FAST && rport->state != SRP_RPORT_LOST)
1148 + /*
1149 + * sdev state must be SDEV_TRANSPORT_OFFLINE, transition
1150 + * to SDEV_BLOCK is illegal. Calling scsi_target_unblock()
1151 +diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
1152 +index a1fa16a03ab9d..7f4f21ba8efcf 100644
1153 +--- a/drivers/usb/class/cdc-acm.c
1154 ++++ b/drivers/usb/class/cdc-acm.c
1155 +@@ -1682,12 +1682,13 @@ static int acm_resume(struct usb_interface *intf)
1156 + struct urb *urb;
1157 + int rv = 0;
1158 +
1159 +- acm_unpoison_urbs(acm);
1160 + spin_lock_irq(&acm->write_lock);
1161 +
1162 + if (--acm->susp_count)
1163 + goto out;
1164 +
1165 ++ acm_unpoison_urbs(acm);
1166 ++
1167 + if (tty_port_initialized(&acm->port)) {
1168 + rv = usb_submit_urb(acm->ctrlurb, GFP_ATOMIC);
1169 +
1170 +diff --git a/fs/readdir.c b/fs/readdir.c
1171 +index 443270f635f43..3c5ce8a0ddc99 100644
1172 +--- a/fs/readdir.c
1173 ++++ b/fs/readdir.c
1174 +@@ -132,6 +132,9 @@ static int fillonedir(struct dir_context *ctx, const char *name, int namlen,
1175 +
1176 + if (buf->result)
1177 + return -EINVAL;
1178 ++ buf->result = verify_dirent_name(name, namlen);
1179 ++ if (buf->result < 0)
1180 ++ return buf->result;
1181 + d_ino = ino;
1182 + if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) {
1183 + buf->result = -EOVERFLOW;
1184 +@@ -398,6 +401,9 @@ static int compat_fillonedir(struct dir_context *ctx, const char *name,
1185 +
1186 + if (buf->result)
1187 + return -EINVAL;
1188 ++ buf->result = verify_dirent_name(name, namlen);
1189 ++ if (buf->result < 0)
1190 ++ return buf->result;
1191 + d_ino = ino;
1192 + if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) {
1193 + buf->result = -EOVERFLOW;
1194 +diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h
1195 +index 1eb6f244588da..9a488497ebc29 100644
1196 +--- a/include/linux/marvell_phy.h
1197 ++++ b/include/linux/marvell_phy.h
1198 +@@ -21,11 +21,12 @@
1199 + #define MARVELL_PHY_ID_88E1545 0x01410ea0
1200 + #define MARVELL_PHY_ID_88E3016 0x01410e60
1201 +
1202 +-/* The MV88e6390 Ethernet switch contains embedded PHYs. These PHYs do
1203 ++/* These Ethernet switch families contain embedded PHYs, but they do
1204 + * not have a model ID. So the switch driver traps reads to the ID2
1205 + * register and returns the switch family ID
1206 + */
1207 +-#define MARVELL_PHY_ID_88E6390 0x01410f90
1208 ++#define MARVELL_PHY_ID_88E6341_FAMILY 0x01410f41
1209 ++#define MARVELL_PHY_ID_88E6390_FAMILY 0x01410f90
1210 +
1211 + #define MARVELL_PHY_FAMILY_ID(id) ((id) >> 4)
1212 +
1213 +diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
1214 +index 8a1758b094b70..126c6d524a0f2 100644
1215 +--- a/kernel/locking/lockdep.c
1216 ++++ b/kernel/locking/lockdep.c
1217 +@@ -722,7 +722,8 @@ static bool assign_lock_key(struct lockdep_map *lock)
1218 + /* Debug-check: all keys must be persistent! */
1219 + debug_locks_off();
1220 + pr_err("INFO: trying to register non-static key.\n");
1221 +- pr_err("the code is fine but needs lockdep annotation.\n");
1222 ++ pr_err("The code is fine but needs lockdep annotation, or maybe\n");
1223 ++ pr_err("you didn't initialize this object before use?\n");
1224 + pr_err("turning off the locking correctness validator.\n");
1225 + dump_stack();
1226 + return false;
1227 +diff --git a/kernel/locking/qrwlock.c b/kernel/locking/qrwlock.c
1228 +index c7471c3fb7989..16c09cda3b02e 100644
1229 +--- a/kernel/locking/qrwlock.c
1230 ++++ b/kernel/locking/qrwlock.c
1231 +@@ -70,6 +70,8 @@ EXPORT_SYMBOL(queued_read_lock_slowpath);
1232 + */
1233 + void queued_write_lock_slowpath(struct qrwlock *lock)
1234 + {
1235 ++ int cnts;
1236 ++
1237 + /* Put the writer into the wait queue */
1238 + arch_spin_lock(&lock->wait_lock);
1239 +
1240 +@@ -83,9 +85,8 @@ void queued_write_lock_slowpath(struct qrwlock *lock)
1241 +
1242 + /* When no more readers or writers, set the locked flag */
1243 + do {
1244 +- atomic_cond_read_acquire(&lock->cnts, VAL == _QW_WAITING);
1245 +- } while (atomic_cmpxchg_relaxed(&lock->cnts, _QW_WAITING,
1246 +- _QW_LOCKED) != _QW_WAITING);
1247 ++ cnts = atomic_cond_read_relaxed(&lock->cnts, VAL == _QW_WAITING);
1248 ++ } while (!atomic_try_cmpxchg_acquire(&lock->cnts, &cnts, _QW_LOCKED));
1249 + unlock:
1250 + arch_spin_unlock(&lock->wait_lock);
1251 + }
1252 +diff --git a/mm/gup.c b/mm/gup.c
1253 +index f3088d25bd926..44569927f0ea1 100644
1254 +--- a/mm/gup.c
1255 ++++ b/mm/gup.c
1256 +@@ -61,13 +61,22 @@ static int follow_pfn_pte(struct vm_area_struct *vma, unsigned long address,
1257 + }
1258 +
1259 + /*
1260 +- * FOLL_FORCE can write to even unwritable pte's, but only
1261 +- * after we've gone through a COW cycle and they are dirty.
1262 ++ * FOLL_FORCE or a forced COW break can write even to unwritable pte's,
1263 ++ * but only after we've gone through a COW cycle and they are dirty.
1264 + */
1265 + static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)
1266 + {
1267 +- return pte_write(pte) ||
1268 +- ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte));
1269 ++ return pte_write(pte) || ((flags & FOLL_COW) && pte_dirty(pte));
1270 ++}
1271 ++
1272 ++/*
1273 ++ * A (separate) COW fault might break the page the other way and
1274 ++ * get_user_pages() would return the page from what is now the wrong
1275 ++ * VM. So we need to force a COW break at GUP time even for reads.
1276 ++ */
1277 ++static inline bool should_force_cow_break(struct vm_area_struct *vma, unsigned int flags)
1278 ++{
1279 ++ return is_cow_mapping(vma->vm_flags) && (flags & FOLL_GET);
1280 + }
1281 +
1282 + static struct page *follow_page_pte(struct vm_area_struct *vma,
1283 +@@ -710,12 +719,18 @@ static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1284 + if (!vma || check_vma_flags(vma, gup_flags))
1285 + return i ? : -EFAULT;
1286 + if (is_vm_hugetlb_page(vma)) {
1287 ++ if (should_force_cow_break(vma, foll_flags))
1288 ++ foll_flags |= FOLL_WRITE;
1289 + i = follow_hugetlb_page(mm, vma, pages, vmas,
1290 + &start, &nr_pages, i,
1291 +- gup_flags, nonblocking);
1292 ++ foll_flags, nonblocking);
1293 + continue;
1294 + }
1295 + }
1296 ++
1297 ++ if (should_force_cow_break(vma, foll_flags))
1298 ++ foll_flags |= FOLL_WRITE;
1299 ++
1300 + retry:
1301 + /*
1302 + * If we have a pending SIGKILL, don't keep faulting pages and
1303 +@@ -1804,6 +1819,10 @@ bool gup_fast_permitted(unsigned long start, int nr_pages, int write)
1304 + * the regular GUP.
1305 + * Note a difference with get_user_pages_fast: this always returns the
1306 + * number of pages pinned, 0 if no pages were pinned.
1307 ++ *
1308 ++ * Careful, careful! COW breaking can go either way, so a non-write
1309 ++ * access can get ambiguous page results. If you call this function without
1310 ++ * 'write' set, you'd better be sure that you're ok with that ambiguity.
1311 + */
1312 + int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
1313 + struct page **pages)
1314 +@@ -1831,6 +1850,12 @@ int __get_user_pages_fast(unsigned long start, int nr_pages, int write,
1315 + *
1316 + * We do not adopt an rcu_read_lock(.) here as we also want to
1317 + * block IPIs that come from THPs splitting.
1318 ++ *
1319 ++ * NOTE! We allow read-only gup_fast() here, but you'd better be
1320 ++ * careful about possible COW pages. You'll get _a_ COW page, but
1321 ++ * not necessarily the one you intended to get depending on what
1322 ++ * COW event happens after this. COW may break the page copy in a
1323 ++ * random direction.
1324 + */
1325 +
1326 + if (gup_fast_permitted(start, nr_pages, write)) {
1327 +@@ -1876,9 +1901,16 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
1328 + (void __user *)start, len)))
1329 + return -EFAULT;
1330 +
1331 ++ /*
1332 ++ * The FAST_GUP case requires FOLL_WRITE even for pure reads,
1333 ++ * because get_user_pages() may need to cause an early COW in
1334 ++ * order to avoid confusing the normal COW routines. So only
1335 ++ * targets that are already writable are safe to do by just
1336 ++ * looking at the page tables.
1337 ++ */
1338 + if (gup_fast_permitted(start, nr_pages, write)) {
1339 + local_irq_disable();
1340 +- gup_pgd_range(addr, end, write, pages, &nr);
1341 ++ gup_pgd_range(addr, end, 1, pages, &nr);
1342 + local_irq_enable();
1343 + ret = nr;
1344 + }
1345 +diff --git a/mm/huge_memory.c b/mm/huge_memory.c
1346 +index cf9e2bbffdc1a..7c374c0fcf0c7 100644
1347 +--- a/mm/huge_memory.c
1348 ++++ b/mm/huge_memory.c
1349 +@@ -1432,13 +1432,12 @@ out_unlock:
1350 + }
1351 +
1352 + /*
1353 +- * FOLL_FORCE can write to even unwritable pmd's, but only
1354 +- * after we've gone through a COW cycle and they are dirty.
1355 ++ * FOLL_FORCE or a forced COW break can write even to unwritable pmd's,
1356 ++ * but only after we've gone through a COW cycle and they are dirty.
1357 + */
1358 + static inline bool can_follow_write_pmd(pmd_t pmd, unsigned int flags)
1359 + {
1360 +- return pmd_write(pmd) ||
1361 +- ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pmd_dirty(pmd));
1362 ++ return pmd_write(pmd) || ((flags & FOLL_COW) && pmd_dirty(pmd));
1363 + }
1364 +
1365 + struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
1366 +diff --git a/net/core/neighbour.c b/net/core/neighbour.c
1367 +index 6e890f51b7d86..e471c32e448f6 100644
1368 +--- a/net/core/neighbour.c
1369 ++++ b/net/core/neighbour.c
1370 +@@ -1271,7 +1271,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
1371 + * we can reinject the packet there.
1372 + */
1373 + n2 = NULL;
1374 +- if (dst) {
1375 ++ if (dst && dst->obsolete != DST_OBSOLETE_DEAD) {
1376 + n2 = dst_neigh_lookup_skb(dst, skb);
1377 + if (n2)
1378 + n1 = n2;
1379 +diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
1380 +index b10b297e76b78..b1c55db737648 100644
1381 +--- a/net/ieee802154/nl802154.c
1382 ++++ b/net/ieee802154/nl802154.c
1383 +@@ -1516,6 +1516,11 @@ nl802154_dump_llsec_key(struct sk_buff *skb, struct netlink_callback *cb)
1384 + if (err)
1385 + return err;
1386 +
1387 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
1388 ++ err = skb->len;
1389 ++ goto out_err;
1390 ++ }
1391 ++
1392 + if (!wpan_dev->netdev) {
1393 + err = -EINVAL;
1394 + goto out_err;
1395 +@@ -1688,6 +1693,11 @@ nl802154_dump_llsec_dev(struct sk_buff *skb, struct netlink_callback *cb)
1396 + if (err)
1397 + return err;
1398 +
1399 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
1400 ++ err = skb->len;
1401 ++ goto out_err;
1402 ++ }
1403 ++
1404 + if (!wpan_dev->netdev) {
1405 + err = -EINVAL;
1406 + goto out_err;
1407 +@@ -1775,6 +1785,9 @@ static int nl802154_add_llsec_dev(struct sk_buff *skb, struct genl_info *info)
1408 + struct wpan_dev *wpan_dev = dev->ieee802154_ptr;
1409 + struct ieee802154_llsec_device dev_desc;
1410 +
1411 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
1412 ++ return -EOPNOTSUPP;
1413 ++
1414 + if (ieee802154_llsec_parse_device(info->attrs[NL802154_ATTR_SEC_DEVICE],
1415 + &dev_desc) < 0)
1416 + return -EINVAL;
1417 +@@ -1861,6 +1874,11 @@ nl802154_dump_llsec_devkey(struct sk_buff *skb, struct netlink_callback *cb)
1418 + if (err)
1419 + return err;
1420 +
1421 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
1422 ++ err = skb->len;
1423 ++ goto out_err;
1424 ++ }
1425 ++
1426 + if (!wpan_dev->netdev) {
1427 + err = -EINVAL;
1428 + goto out_err;
1429 +@@ -1918,6 +1936,9 @@ static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *info
1430 + struct ieee802154_llsec_device_key key;
1431 + __le64 extended_addr;
1432 +
1433 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
1434 ++ return -EOPNOTSUPP;
1435 ++
1436 + if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] ||
1437 + nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX,
1438 + info->attrs[NL802154_ATTR_SEC_DEVKEY],
1439 +@@ -2027,6 +2048,11 @@ nl802154_dump_llsec_seclevel(struct sk_buff *skb, struct netlink_callback *cb)
1440 + if (err)
1441 + return err;
1442 +
1443 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) {
1444 ++ err = skb->len;
1445 ++ goto out_err;
1446 ++ }
1447 ++
1448 + if (!wpan_dev->netdev) {
1449 + err = -EINVAL;
1450 + goto out_err;
1451 +@@ -2112,6 +2138,9 @@ static int nl802154_add_llsec_seclevel(struct sk_buff *skb,
1452 + struct wpan_dev *wpan_dev = dev->ieee802154_ptr;
1453 + struct ieee802154_llsec_seclevel sl;
1454 +
1455 ++ if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR)
1456 ++ return -EOPNOTSUPP;
1457 ++
1458 + if (llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL],
1459 + &sl) < 0)
1460 + return -EINVAL;
1461 +diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
1462 +index b825ac025d5bd..28c4a693ab98d 100644
1463 +--- a/net/ipv6/ip6_tunnel.c
1464 ++++ b/net/ipv6/ip6_tunnel.c
1465 +@@ -2222,6 +2222,16 @@ static void __net_exit ip6_tnl_destroy_tunnels(struct net *net, struct list_head
1466 + t = rtnl_dereference(t->next);
1467 + }
1468 + }
1469 ++
1470 ++ t = rtnl_dereference(ip6n->tnls_wc[0]);
1471 ++ while (t) {
1472 ++ /* If dev is in the same netns, it has already
1473 ++ * been added to the list by the previous loop.
1474 ++ */
1475 ++ if (!net_eq(dev_net(t->dev), net))
1476 ++ unregister_netdevice_queue(t->dev, list);
1477 ++ t = rtnl_dereference(t->next);
1478 ++ }
1479 + }
1480 +
1481 + static int __net_init ip6_tnl_init_net(struct net *net)
1482 +diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
1483 +index bcf29201f87b3..ad737b68b8e96 100644
1484 +--- a/net/ipv6/sit.c
1485 ++++ b/net/ipv6/sit.c
1486 +@@ -1818,9 +1818,9 @@ static void __net_exit sit_destroy_tunnels(struct net *net,
1487 + if (dev->rtnl_link_ops == &sit_link_ops)
1488 + unregister_netdevice_queue(dev, head);
1489 +
1490 +- for (prio = 1; prio < 4; prio++) {
1491 ++ for (prio = 0; prio < 4; prio++) {
1492 + int h;
1493 +- for (h = 0; h < IP6_SIT_HASH_SIZE; h++) {
1494 ++ for (h = 0; h < (prio ? IP6_SIT_HASH_SIZE : 1); h++) {
1495 + struct ip_tunnel *t;
1496 +
1497 + t = rtnl_dereference(sitn->tunnels[prio][h]);
1498 +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
1499 +index f484f9fc62ca9..6804cdd43befc 100644
1500 +--- a/net/mac80211/cfg.c
1501 ++++ b/net/mac80211/cfg.c
1502 +@@ -1548,8 +1548,10 @@ static int ieee80211_change_station(struct wiphy *wiphy,
1503 + }
1504 +
1505 + if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
1506 +- sta->sdata->u.vlan.sta)
1507 ++ sta->sdata->u.vlan.sta) {
1508 ++ ieee80211_clear_fast_rx(sta);
1509 + RCU_INIT_POINTER(sta->sdata->u.vlan.sta, NULL);
1510 ++ }
1511 +
1512 + if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
1513 + ieee80211_vif_dec_num_mcast(sta->sdata);
1514 +diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
1515 +index dcd8e79229515..2e3ae494f3697 100644
1516 +--- a/net/netfilter/nf_conntrack_standalone.c
1517 ++++ b/net/netfilter/nf_conntrack_standalone.c
1518 +@@ -262,6 +262,7 @@ static const char* l4proto_name(u16 proto)
1519 + case IPPROTO_GRE: return "gre";
1520 + case IPPROTO_SCTP: return "sctp";
1521 + case IPPROTO_UDPLITE: return "udplite";
1522 ++ case IPPROTO_ICMPV6: return "icmpv6";
1523 + }
1524 +
1525 + return "unknown";
1526 +diff --git a/net/netfilter/nft_limit.c b/net/netfilter/nft_limit.c
1527 +index 72f13a1144dd6..a7bdc532479a3 100644
1528 +--- a/net/netfilter/nft_limit.c
1529 ++++ b/net/netfilter/nft_limit.c
1530 +@@ -79,13 +79,13 @@ static int nft_limit_init(struct nft_limit *limit,
1531 + return -EOVERFLOW;
1532 +
1533 + if (pkts) {
1534 +- tokens = div_u64(limit->nsecs, limit->rate) * limit->burst;
1535 ++ tokens = div64_u64(limit->nsecs, limit->rate) * limit->burst;
1536 + } else {
1537 + /* The token bucket size limits the number of tokens can be
1538 + * accumulated. tokens_max specifies the bucket size.
1539 + * tokens_max = unit * (rate + burst) / rate.
1540 + */
1541 +- tokens = div_u64(limit->nsecs * (limit->rate + limit->burst),
1542 ++ tokens = div64_u64(limit->nsecs * (limit->rate + limit->burst),
1543 + limit->rate);
1544 + }
1545 +
1546 +diff --git a/net/sctp/socket.c b/net/sctp/socket.c
1547 +index 4a2873f70b372..656bd15328836 100644
1548 +--- a/net/sctp/socket.c
1549 ++++ b/net/sctp/socket.c
1550 +@@ -1569,11 +1569,9 @@ static void sctp_close(struct sock *sk, long timeout)
1551 +
1552 + /* Supposedly, no process has access to the socket, but
1553 + * the net layers still may.
1554 +- * Also, sctp_destroy_sock() needs to be called with addr_wq_lock
1555 +- * held and that should be grabbed before socket lock.
1556 + */
1557 +- spin_lock_bh(&net->sctp.addr_wq_lock);
1558 +- bh_lock_sock_nested(sk);
1559 ++ local_bh_disable();
1560 ++ bh_lock_sock(sk);
1561 +
1562 + /* Hold the sock, since sk_common_release() will put sock_put()
1563 + * and we have just a little more cleanup.
1564 +@@ -1582,7 +1580,7 @@ static void sctp_close(struct sock *sk, long timeout)
1565 + sk_common_release(sk);
1566 +
1567 + bh_unlock_sock(sk);
1568 +- spin_unlock_bh(&net->sctp.addr_wq_lock);
1569 ++ local_bh_enable();
1570 +
1571 + sock_put(sk);
1572 +
1573 +@@ -4776,9 +4774,6 @@ static int sctp_init_sock(struct sock *sk)
1574 + sk_sockets_allocated_inc(sk);
1575 + sock_prot_inuse_add(net, sk->sk_prot, 1);
1576 +
1577 +- /* Nothing can fail after this block, otherwise
1578 +- * sctp_destroy_sock() will be called without addr_wq_lock held
1579 +- */
1580 + if (net->sctp.default_auto_asconf) {
1581 + spin_lock(&sock_net(sk)->sctp.addr_wq_lock);
1582 + list_add_tail(&sp->auto_asconf_list,
1583 +@@ -4813,7 +4808,9 @@ static void sctp_destroy_sock(struct sock *sk)
1584 +
1585 + if (sp->do_auto_asconf) {
1586 + sp->do_auto_asconf = 0;
1587 ++ spin_lock_bh(&sock_net(sk)->sctp.addr_wq_lock);
1588 + list_del(&sp->auto_asconf_list);
1589 ++ spin_unlock_bh(&sock_net(sk)->sctp.addr_wq_lock);
1590 + }
1591 + sctp_endpoint_free(sp->ep);
1592 + local_bh_disable();
1593 +diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c
1594 +index ff96db91f818a..baa76337c33f3 100644
1595 +--- a/sound/soc/fsl/fsl_esai.c
1596 ++++ b/sound/soc/fsl/fsl_esai.c
1597 +@@ -497,11 +497,13 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream,
1598 + ESAI_SAICR_SYNC, esai_priv->synchronous ?
1599 + ESAI_SAICR_SYNC : 0);
1600 +
1601 +- /* Set a default slot number -- 2 */
1602 ++ /* Set slots count */
1603 + regmap_update_bits(esai_priv->regmap, REG_ESAI_TCCR,
1604 +- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2));
1605 ++ ESAI_xCCR_xDC_MASK,
1606 ++ ESAI_xCCR_xDC(esai_priv->slots));
1607 + regmap_update_bits(esai_priv->regmap, REG_ESAI_RCCR,
1608 +- ESAI_xCCR_xDC_MASK, ESAI_xCCR_xDC(2));
1609 ++ ESAI_xCCR_xDC_MASK,
1610 ++ ESAI_xCCR_xDC(esai_priv->slots));
1611 + }
1612 +
1613 + return 0;
1614 +diff --git a/tools/arch/ia64/include/asm/barrier.h b/tools/arch/ia64/include/asm/barrier.h
1615 +index d808ee0e77b58..90f8bbd9aede7 100644
1616 +--- a/tools/arch/ia64/include/asm/barrier.h
1617 ++++ b/tools/arch/ia64/include/asm/barrier.h
1618 +@@ -39,9 +39,6 @@
1619 + * sequential memory pages only.
1620 + */
1621 +
1622 +-/* XXX From arch/ia64/include/uapi/asm/gcc_intrin.h */
1623 +-#define ia64_mf() asm volatile ("mf" ::: "memory")
1624 +-
1625 + #define mb() ia64_mf()
1626 + #define rmb() mb()
1627 + #define wmb() mb()