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: Sat, 26 Jan 2019 15:06:41
Message-Id: 1548515161.b1c9fff53212babfe9765966d3de92288185b31f.mpagano@gentoo
1 commit: b1c9fff53212babfe9765966d3de92288185b31f
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 26 15:06:01 2019 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 26 15:06:01 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=b1c9fff5
7
8 proj/linux-patches: Linux patch 4.14.96
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1095_linux-4.14.96.patch | 2392 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2396 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index e1a1f75..628069f 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -423,6 +423,10 @@ Patch: 1094_4.14.95.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.14.95
23
24 +Patch: 1095_4.14.96.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.14.96
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/1095_linux-4.14.96.patch b/1095_linux-4.14.96.patch
33 new file mode 100644
34 index 0000000..5be89cb
35 --- /dev/null
36 +++ b/1095_linux-4.14.96.patch
37 @@ -0,0 +1,2392 @@
38 +diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
39 +index adba21b5ada7..4cee34ce496e 100644
40 +--- a/Documentation/filesystems/proc.txt
41 ++++ b/Documentation/filesystems/proc.txt
42 +@@ -494,7 +494,9 @@ manner. The codes are the following:
43 +
44 + Note that there is no guarantee that every flag and associated mnemonic will
45 + be present in all further kernel releases. Things get changed, the flags may
46 +-be vanished or the reverse -- new added.
47 ++be vanished or the reverse -- new added. Interpretation of their meaning
48 ++might change in future as well. So each consumer of these flags has to
49 ++follow each specific kernel version for the exact semantic.
50 +
51 + This file is only present if the CONFIG_MMU kernel configuration option is
52 + enabled.
53 +diff --git a/Makefile b/Makefile
54 +index 70cc37cb3e99..57b45169ed85 100644
55 +--- a/Makefile
56 ++++ b/Makefile
57 +@@ -1,7 +1,7 @@
58 + # SPDX-License-Identifier: GPL-2.0
59 + VERSION = 4
60 + PATCHLEVEL = 14
61 +-SUBLEVEL = 95
62 ++SUBLEVEL = 96
63 + EXTRAVERSION =
64 + NAME = Petit Gorille
65 +
66 +diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
67 +index 66aea4aa455d..02d73d83f0de 100644
68 +--- a/arch/arm64/include/asm/assembler.h
69 ++++ b/arch/arm64/include/asm/assembler.h
70 +@@ -373,27 +373,33 @@ alternative_endif
71 + * size: size of the region
72 + * Corrupts: kaddr, size, tmp1, tmp2
73 + */
74 ++ .macro __dcache_op_workaround_clean_cache, op, kaddr
75 ++alternative_if_not ARM64_WORKAROUND_CLEAN_CACHE
76 ++ dc \op, \kaddr
77 ++alternative_else
78 ++ dc civac, \kaddr
79 ++alternative_endif
80 ++ .endm
81 ++
82 + .macro dcache_by_line_op op, domain, kaddr, size, tmp1, tmp2
83 + dcache_line_size \tmp1, \tmp2
84 + add \size, \kaddr, \size
85 + sub \tmp2, \tmp1, #1
86 + bic \kaddr, \kaddr, \tmp2
87 + 9998:
88 +- .if (\op == cvau || \op == cvac)
89 +-alternative_if_not ARM64_WORKAROUND_CLEAN_CACHE
90 +- dc \op, \kaddr
91 +-alternative_else
92 +- dc civac, \kaddr
93 +-alternative_endif
94 +- .elseif (\op == cvap)
95 +-alternative_if ARM64_HAS_DCPOP
96 +- sys 3, c7, c12, 1, \kaddr // dc cvap
97 +-alternative_else
98 +- dc cvac, \kaddr
99 +-alternative_endif
100 ++ .ifc \op, cvau
101 ++ __dcache_op_workaround_clean_cache \op, \kaddr
102 ++ .else
103 ++ .ifc \op, cvac
104 ++ __dcache_op_workaround_clean_cache \op, \kaddr
105 ++ .else
106 ++ .ifc \op, cvap
107 ++ sys 3, c7, c12, 1, \kaddr // dc cvap
108 + .else
109 + dc \op, \kaddr
110 + .endif
111 ++ .endif
112 ++ .endif
113 + add \kaddr, \kaddr, \tmp1
114 + cmp \kaddr, \size
115 + b.lo 9998b
116 +diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c
117 +index 86249a24592d..05fdae70e9f6 100644
118 +--- a/arch/arm64/kernel/perf_event.c
119 ++++ b/arch/arm64/kernel/perf_event.c
120 +@@ -1130,6 +1130,7 @@ static struct platform_driver armv8_pmu_driver = {
121 + .driver = {
122 + .name = ARMV8_PMU_PDEV_NAME,
123 + .of_match_table = armv8_pmu_of_device_ids,
124 ++ .suppress_bind_attrs = true,
125 + },
126 + .probe = armv8_pmu_device_probe,
127 + };
128 +diff --git a/arch/arm64/mm/cache.S b/arch/arm64/mm/cache.S
129 +index 91464e7f77cc..c1e8f3c6ffd5 100644
130 +--- a/arch/arm64/mm/cache.S
131 ++++ b/arch/arm64/mm/cache.S
132 +@@ -181,6 +181,9 @@ ENDPROC(__dma_clean_area)
133 + * - size - size in question
134 + */
135 + ENTRY(__clean_dcache_area_pop)
136 ++ alternative_if_not ARM64_HAS_DCPOP
137 ++ b __clean_dcache_area_poc
138 ++ alternative_else_nop_endif
139 + dcache_by_line_op cvap, sy, x0, x1, x2, x3
140 + ret
141 + ENDPIPROC(__clean_dcache_area_pop)
142 +diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
143 +index ae4450e891ab..8d4470f44b74 100644
144 +--- a/arch/mips/Kconfig
145 ++++ b/arch/mips/Kconfig
146 +@@ -800,6 +800,7 @@ config SIBYTE_SWARM
147 + select SYS_SUPPORTS_HIGHMEM
148 + select SYS_SUPPORTS_LITTLE_ENDIAN
149 + select ZONE_DMA32 if 64BIT
150 ++ select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI
151 +
152 + config SIBYTE_LITTLESUR
153 + bool "Sibyte BCM91250C2-LittleSur"
154 +@@ -822,6 +823,7 @@ config SIBYTE_SENTOSA
155 + select SYS_HAS_CPU_SB1
156 + select SYS_SUPPORTS_BIG_ENDIAN
157 + select SYS_SUPPORTS_LITTLE_ENDIAN
158 ++ select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI
159 +
160 + config SIBYTE_BIGSUR
161 + bool "Sibyte BCM91480B-BigSur"
162 +@@ -835,6 +837,7 @@ config SIBYTE_BIGSUR
163 + select SYS_SUPPORTS_HIGHMEM
164 + select SYS_SUPPORTS_LITTLE_ENDIAN
165 + select ZONE_DMA32 if 64BIT
166 ++ select SWIOTLB if ARCH_DMA_ADDR_T_64BIT && PCI
167 +
168 + config SNI_RM
169 + bool "SNI RM200/300/400"
170 +diff --git a/arch/mips/sibyte/common/Makefile b/arch/mips/sibyte/common/Makefile
171 +index b3d6bf23a662..3ef3fb658136 100644
172 +--- a/arch/mips/sibyte/common/Makefile
173 ++++ b/arch/mips/sibyte/common/Makefile
174 +@@ -1,4 +1,5 @@
175 + obj-y := cfe.o
176 ++obj-$(CONFIG_SWIOTLB) += dma.o
177 + obj-$(CONFIG_SIBYTE_BUS_WATCHER) += bus_watcher.o
178 + obj-$(CONFIG_SIBYTE_CFE_CONSOLE) += cfe_console.o
179 + obj-$(CONFIG_SIBYTE_TBPROF) += sb_tbprof.o
180 +diff --git a/arch/mips/sibyte/common/dma.c b/arch/mips/sibyte/common/dma.c
181 +new file mode 100644
182 +index 000000000000..eb47a94f3583
183 +--- /dev/null
184 ++++ b/arch/mips/sibyte/common/dma.c
185 +@@ -0,0 +1,14 @@
186 ++// SPDX-License-Identifier: GPL-2.0+
187 ++/*
188 ++ * DMA support for Broadcom SiByte platforms.
189 ++ *
190 ++ * Copyright (c) 2018 Maciej W. Rozycki
191 ++ */
192 ++
193 ++#include <linux/swiotlb.h>
194 ++#include <asm/bootinfo.h>
195 ++
196 ++void __init plat_swiotlb_setup(void)
197 ++{
198 ++ swiotlb_init(1);
199 ++}
200 +diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
201 +index a5938fadd031..f752f771f29d 100644
202 +--- a/arch/powerpc/xmon/xmon.c
203 ++++ b/arch/powerpc/xmon/xmon.c
204 +@@ -78,6 +78,9 @@ static int xmon_gate;
205 + #define xmon_owner 0
206 + #endif /* CONFIG_SMP */
207 +
208 ++#ifdef CONFIG_PPC_PSERIES
209 ++static int set_indicator_token = RTAS_UNKNOWN_SERVICE;
210 ++#endif
211 + static unsigned long in_xmon __read_mostly = 0;
212 + static int xmon_on = IS_ENABLED(CONFIG_XMON_DEFAULT);
213 +
214 +@@ -357,7 +360,6 @@ static inline void disable_surveillance(void)
215 + #ifdef CONFIG_PPC_PSERIES
216 + /* Since this can't be a module, args should end up below 4GB. */
217 + static struct rtas_args args;
218 +- int token;
219 +
220 + /*
221 + * At this point we have got all the cpus we can into
222 +@@ -366,11 +368,11 @@ static inline void disable_surveillance(void)
223 + * If we did try to take rtas.lock there would be a
224 + * real possibility of deadlock.
225 + */
226 +- token = rtas_token("set-indicator");
227 +- if (token == RTAS_UNKNOWN_SERVICE)
228 ++ if (set_indicator_token == RTAS_UNKNOWN_SERVICE)
229 + return;
230 +
231 +- rtas_call_unlocked(&args, token, 3, 1, NULL, SURVEILLANCE_TOKEN, 0, 0);
232 ++ rtas_call_unlocked(&args, set_indicator_token, 3, 1, NULL,
233 ++ SURVEILLANCE_TOKEN, 0, 0);
234 +
235 + #endif /* CONFIG_PPC_PSERIES */
236 + }
237 +@@ -3472,6 +3474,14 @@ static void xmon_init(int enable)
238 + __debugger_iabr_match = xmon_iabr_match;
239 + __debugger_break_match = xmon_break_match;
240 + __debugger_fault_handler = xmon_fault_handler;
241 ++
242 ++#ifdef CONFIG_PPC_PSERIES
243 ++ /*
244 ++ * Get the token here to avoid trying to get a lock
245 ++ * during the crash, causing a deadlock.
246 ++ */
247 ++ set_indicator_token = rtas_token("set-indicator");
248 ++#endif
249 + } else {
250 + __debugger = NULL;
251 + __debugger_ipi = NULL;
252 +diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
253 +index 3de69330e6c5..afbc87206886 100644
254 +--- a/arch/x86/include/asm/traps.h
255 ++++ b/arch/x86/include/asm/traps.h
256 +@@ -104,9 +104,9 @@ extern int panic_on_unrecovered_nmi;
257 +
258 + void math_emulate(struct math_emu_info *);
259 + #ifndef CONFIG_X86_32
260 +-asmlinkage void smp_thermal_interrupt(void);
261 +-asmlinkage void smp_threshold_interrupt(void);
262 +-asmlinkage void smp_deferred_error_interrupt(void);
263 ++asmlinkage void smp_thermal_interrupt(struct pt_regs *regs);
264 ++asmlinkage void smp_threshold_interrupt(struct pt_regs *regs);
265 ++asmlinkage void smp_deferred_error_interrupt(struct pt_regs *regs);
266 + #endif
267 +
268 + extern void ist_enter(struct pt_regs *regs);
269 +diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
270 +index beec0daecbc5..4fa97a44e73f 100644
271 +--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
272 ++++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
273 +@@ -23,6 +23,7 @@
274 + #include <linux/string.h>
275 +
276 + #include <asm/amd_nb.h>
277 ++#include <asm/traps.h>
278 + #include <asm/apic.h>
279 + #include <asm/mce.h>
280 + #include <asm/msr.h>
281 +@@ -99,7 +100,7 @@ static u32 smca_bank_addrs[MAX_NR_BANKS][NR_BLOCKS] __ro_after_init =
282 + [0 ... MAX_NR_BANKS - 1] = { [0 ... NR_BLOCKS - 1] = -1 }
283 + };
284 +
285 +-const char *smca_get_name(enum smca_bank_types t)
286 ++static const char *smca_get_name(enum smca_bank_types t)
287 + {
288 + if (t >= N_SMCA_BANK_TYPES)
289 + return NULL;
290 +@@ -823,7 +824,7 @@ static void __log_error(unsigned int bank, u64 status, u64 addr, u64 misc)
291 + mce_log(&m);
292 + }
293 +
294 +-asmlinkage __visible void __irq_entry smp_deferred_error_interrupt(void)
295 ++asmlinkage __visible void __irq_entry smp_deferred_error_interrupt(struct pt_regs *regs)
296 + {
297 + entering_irq();
298 + trace_deferred_error_apic_entry(DEFERRED_ERROR_VECTOR);
299 +diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
300 +index 2da67b70ba98..ee229ceee745 100644
301 +--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
302 ++++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
303 +@@ -25,6 +25,7 @@
304 + #include <linux/cpu.h>
305 +
306 + #include <asm/processor.h>
307 ++#include <asm/traps.h>
308 + #include <asm/apic.h>
309 + #include <asm/mce.h>
310 + #include <asm/msr.h>
311 +@@ -390,7 +391,7 @@ static void unexpected_thermal_interrupt(void)
312 +
313 + static void (*smp_thermal_vector)(void) = unexpected_thermal_interrupt;
314 +
315 +-asmlinkage __visible void __irq_entry smp_thermal_interrupt(struct pt_regs *r)
316 ++asmlinkage __visible void __irq_entry smp_thermal_interrupt(struct pt_regs *regs)
317 + {
318 + entering_irq();
319 + trace_thermal_apic_entry(THERMAL_APIC_VECTOR);
320 +diff --git a/arch/x86/kernel/cpu/mcheck/threshold.c b/arch/x86/kernel/cpu/mcheck/threshold.c
321 +index 2b584b319eff..c21e0a1efd0f 100644
322 +--- a/arch/x86/kernel/cpu/mcheck/threshold.c
323 ++++ b/arch/x86/kernel/cpu/mcheck/threshold.c
324 +@@ -6,6 +6,7 @@
325 + #include <linux/kernel.h>
326 +
327 + #include <asm/irq_vectors.h>
328 ++#include <asm/traps.h>
329 + #include <asm/apic.h>
330 + #include <asm/mce.h>
331 + #include <asm/trace/irq_vectors.h>
332 +@@ -18,7 +19,7 @@ static void default_threshold_interrupt(void)
333 +
334 + void (*mce_threshold_vector)(void) = default_threshold_interrupt;
335 +
336 +-asmlinkage __visible void __irq_entry smp_threshold_interrupt(void)
337 ++asmlinkage __visible void __irq_entry smp_threshold_interrupt(struct pt_regs *regs)
338 + {
339 + entering_irq();
340 + trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR);
341 +diff --git a/drivers/base/bus.c b/drivers/base/bus.c
342 +index 22a64fd3309b..1cf1460f8c90 100644
343 +--- a/drivers/base/bus.c
344 ++++ b/drivers/base/bus.c
345 +@@ -33,6 +33,9 @@ static struct kset *system_kset;
346 +
347 + #define to_drv_attr(_attr) container_of(_attr, struct driver_attribute, attr)
348 +
349 ++#define DRIVER_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \
350 ++ struct driver_attribute driver_attr_##_name = \
351 ++ __ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store)
352 +
353 + static int __must_check bus_rescan_devices_helper(struct device *dev,
354 + void *data);
355 +@@ -197,7 +200,7 @@ static ssize_t unbind_store(struct device_driver *drv, const char *buf,
356 + bus_put(bus);
357 + return err;
358 + }
359 +-static DRIVER_ATTR_WO(unbind);
360 ++static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, S_IWUSR, NULL, unbind_store);
361 +
362 + /*
363 + * Manually attach a device to a driver.
364 +@@ -233,7 +236,7 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf,
365 + bus_put(bus);
366 + return err;
367 + }
368 +-static DRIVER_ATTR_WO(bind);
369 ++static DRIVER_ATTR_IGNORE_LOCKDEP(bind, S_IWUSR, NULL, bind_store);
370 +
371 + static ssize_t show_drivers_autoprobe(struct bus_type *bus, char *buf)
372 + {
373 +diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
374 +index c04aa11f0e21..a106cf7b5ee0 100644
375 +--- a/drivers/char/ipmi/ipmi_si_intf.c
376 ++++ b/drivers/char/ipmi/ipmi_si_intf.c
377 +@@ -2447,6 +2447,15 @@ static int ipmi_pci_probe_regspacing(struct smi_info *info)
378 + return DEFAULT_REGSPACING;
379 + }
380 +
381 ++static struct pci_device_id ipmi_pci_blacklist[] = {
382 ++ /*
383 ++ * This is a "Virtual IPMI device", whatever that is. It appears
384 ++ * as a KCS device by the class, but it is not one.
385 ++ */
386 ++ { PCI_VDEVICE(REALTEK, 0x816c) },
387 ++ { 0, }
388 ++};
389 ++
390 + static int ipmi_pci_probe(struct pci_dev *pdev,
391 + const struct pci_device_id *ent)
392 + {
393 +@@ -2454,6 +2463,9 @@ static int ipmi_pci_probe(struct pci_dev *pdev,
394 + int class_type = pdev->class & PCI_ERMC_CLASSCODE_TYPE_MASK;
395 + struct smi_info *info;
396 +
397 ++ if (pci_match_id(ipmi_pci_blacklist, pdev))
398 ++ return -ENODEV;
399 ++
400 + info = smi_info_alloc();
401 + if (!info)
402 + return -ENOMEM;
403 +diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
404 +index 0904ab442d31..ab701f668ebc 100644
405 +--- a/drivers/char/ipmi/ipmi_ssif.c
406 ++++ b/drivers/char/ipmi/ipmi_ssif.c
407 +@@ -645,8 +645,9 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
408 +
409 + /* Remove the multi-part read marker. */
410 + len -= 2;
411 ++ data += 2;
412 + for (i = 0; i < len; i++)
413 +- ssif_info->data[i] = data[i+2];
414 ++ ssif_info->data[i] = data[i];
415 + ssif_info->multi_len = len;
416 + ssif_info->multi_pos = 1;
417 +
418 +@@ -674,8 +675,19 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
419 + }
420 +
421 + blocknum = data[0];
422 ++ len--;
423 ++ data++;
424 ++
425 ++ if (blocknum != 0xff && len != 31) {
426 ++ /* All blocks but the last must have 31 data bytes. */
427 ++ result = -EIO;
428 ++ if (ssif_info->ssif_debug & SSIF_DEBUG_MSG)
429 ++ pr_info("Received middle message <31\n");
430 +
431 +- if (ssif_info->multi_len + len - 1 > IPMI_MAX_MSG_LENGTH) {
432 ++ goto continue_op;
433 ++ }
434 ++
435 ++ if (ssif_info->multi_len + len > IPMI_MAX_MSG_LENGTH) {
436 + /* Received message too big, abort the operation. */
437 + result = -E2BIG;
438 + if (ssif_info->ssif_debug & SSIF_DEBUG_MSG)
439 +@@ -684,16 +696,14 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
440 + goto continue_op;
441 + }
442 +
443 +- /* Remove the blocknum from the data. */
444 +- len--;
445 + for (i = 0; i < len; i++)
446 +- ssif_info->data[i + ssif_info->multi_len] = data[i + 1];
447 ++ ssif_info->data[i + ssif_info->multi_len] = data[i];
448 + ssif_info->multi_len += len;
449 + if (blocknum == 0xff) {
450 + /* End of read */
451 + len = ssif_info->multi_len;
452 + data = ssif_info->data;
453 +- } else if (blocknum + 1 != ssif_info->multi_pos) {
454 ++ } else if (blocknum != ssif_info->multi_pos) {
455 + /*
456 + * Out of sequence block, just abort. Block
457 + * numbers start at zero for the second block,
458 +@@ -721,6 +731,7 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
459 + }
460 + }
461 +
462 ++ continue_op:
463 + if (result < 0) {
464 + ssif_inc_stat(ssif_info, receive_errors);
465 + } else {
466 +@@ -728,8 +739,6 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
467 + ssif_inc_stat(ssif_info, received_message_parts);
468 + }
469 +
470 +-
471 +- continue_op:
472 + if (ssif_info->ssif_debug & SSIF_DEBUG_STATE)
473 + pr_info(PFX "DONE 1: state = %d, result=%d.\n",
474 + ssif_info->ssif_state, result);
475 +diff --git a/drivers/clk/imx/clk-busy.c b/drivers/clk/imx/clk-busy.c
476 +index 5cc99590f9a3..097625c5715c 100644
477 +--- a/drivers/clk/imx/clk-busy.c
478 ++++ b/drivers/clk/imx/clk-busy.c
479 +@@ -154,7 +154,7 @@ static struct clk_ops clk_busy_mux_ops = {
480 +
481 + struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
482 + u8 width, void __iomem *busy_reg, u8 busy_shift,
483 +- const char **parent_names, int num_parents)
484 ++ const char * const *parent_names, int num_parents)
485 + {
486 + struct clk_busy_mux *busy;
487 + struct clk *clk;
488 +diff --git a/drivers/clk/imx/clk-fixup-mux.c b/drivers/clk/imx/clk-fixup-mux.c
489 +index c9b327e0a8dd..44817c1b0b88 100644
490 +--- a/drivers/clk/imx/clk-fixup-mux.c
491 ++++ b/drivers/clk/imx/clk-fixup-mux.c
492 +@@ -70,7 +70,7 @@ static const struct clk_ops clk_fixup_mux_ops = {
493 + };
494 +
495 + struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
496 +- u8 shift, u8 width, const char **parents,
497 ++ u8 shift, u8 width, const char * const *parents,
498 + int num_parents, void (*fixup)(u32 *val))
499 + {
500 + struct clk_fixup_mux *fixup_mux;
501 +diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c
502 +index 8d518ad5dc13..8eb93eb2f857 100644
503 +--- a/drivers/clk/imx/clk-imx6q.c
504 ++++ b/drivers/clk/imx/clk-imx6q.c
505 +@@ -515,8 +515,12 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node)
506 + * lvds1_gate and lvds2_gate are pseudo-gates. Both can be
507 + * independently configured as clock inputs or outputs. We treat
508 + * the "output_enable" bit as a gate, even though it's really just
509 +- * enabling clock output.
510 ++ * enabling clock output. Initially the gate bits are cleared, as
511 ++ * otherwise the exclusive configuration gets locked in the setup done
512 ++ * by software running before the clock driver, with no way to change
513 ++ * it.
514 + */
515 ++ writel(readl(base + 0x160) & ~0x3c00, base + 0x160);
516 + clk[IMX6QDL_CLK_LVDS1_GATE] = imx_clk_gate_exclusive("lvds1_gate", "lvds1_sel", base + 0x160, 10, BIT(12));
517 + clk[IMX6QDL_CLK_LVDS2_GATE] = imx_clk_gate_exclusive("lvds2_gate", "lvds2_sel", base + 0x160, 11, BIT(13));
518 +
519 +diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
520 +index d69c4bbf3597..b03fbd502528 100644
521 +--- a/drivers/clk/imx/clk.h
522 ++++ b/drivers/clk/imx/clk.h
523 +@@ -63,14 +63,14 @@ struct clk *imx_clk_busy_divider(const char *name, const char *parent_name,
524 +
525 + struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
526 + u8 width, void __iomem *busy_reg, u8 busy_shift,
527 +- const char **parent_names, int num_parents);
528 ++ const char * const *parent_names, int num_parents);
529 +
530 + struct clk *imx_clk_fixup_divider(const char *name, const char *parent,
531 + void __iomem *reg, u8 shift, u8 width,
532 + void (*fixup)(u32 *val));
533 +
534 + struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
535 +- u8 shift, u8 width, const char **parents,
536 ++ u8 shift, u8 width, const char * const *parents,
537 + int num_parents, void (*fixup)(u32 *val));
538 +
539 + static inline struct clk *imx_clk_fixed(const char *name, int rate)
540 +@@ -79,7 +79,8 @@ static inline struct clk *imx_clk_fixed(const char *name, int rate)
541 + }
542 +
543 + static inline struct clk *imx_clk_mux_ldb(const char *name, void __iomem *reg,
544 +- u8 shift, u8 width, const char **parents, int num_parents)
545 ++ u8 shift, u8 width, const char * const *parents,
546 ++ int num_parents)
547 + {
548 + return clk_register_mux(NULL, name, parents, num_parents,
549 + CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT, reg,
550 +@@ -178,7 +179,8 @@ static inline struct clk *imx_clk_gate4(const char *name, const char *parent,
551 + }
552 +
553 + static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg,
554 +- u8 shift, u8 width, const char **parents, int num_parents)
555 ++ u8 shift, u8 width, const char * const *parents,
556 ++ int num_parents)
557 + {
558 + return clk_register_mux(NULL, name, parents, num_parents,
559 + CLK_SET_RATE_NO_REPARENT, reg, shift,
560 +@@ -186,7 +188,8 @@ static inline struct clk *imx_clk_mux(const char *name, void __iomem *reg,
561 + }
562 +
563 + static inline struct clk *imx_clk_mux2(const char *name, void __iomem *reg,
564 +- u8 shift, u8 width, const char **parents, int num_parents)
565 ++ u8 shift, u8 width, const char * const *parents,
566 ++ int num_parents)
567 + {
568 + return clk_register_mux(NULL, name, parents, num_parents,
569 + CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE,
570 +@@ -194,8 +197,9 @@ static inline struct clk *imx_clk_mux2(const char *name, void __iomem *reg,
571 + }
572 +
573 + static inline struct clk *imx_clk_mux_flags(const char *name,
574 +- void __iomem *reg, u8 shift, u8 width, const char **parents,
575 +- int num_parents, unsigned long flags)
576 ++ void __iomem *reg, u8 shift, u8 width,
577 ++ const char * const *parents, int num_parents,
578 ++ unsigned long flags)
579 + {
580 + return clk_register_mux(NULL, name, parents, num_parents,
581 + flags | CLK_SET_RATE_NO_REPARENT, reg, shift, width, 0,
582 +diff --git a/drivers/clocksource/timer-integrator-ap.c b/drivers/clocksource/timer-integrator-ap.c
583 +index 62d24690ba02..9701107806a7 100644
584 +--- a/drivers/clocksource/timer-integrator-ap.c
585 ++++ b/drivers/clocksource/timer-integrator-ap.c
586 +@@ -181,8 +181,7 @@ static int __init integrator_ap_timer_init_of(struct device_node *node)
587 + int irq;
588 + struct clk *clk;
589 + unsigned long rate;
590 +- struct device_node *pri_node;
591 +- struct device_node *sec_node;
592 ++ struct device_node *alias_node;
593 +
594 + base = of_io_request_and_map(node, 0, "integrator-timer");
595 + if (IS_ERR(base))
596 +@@ -204,7 +203,18 @@ static int __init integrator_ap_timer_init_of(struct device_node *node)
597 + return err;
598 + }
599 +
600 +- pri_node = of_find_node_by_path(path);
601 ++ alias_node = of_find_node_by_path(path);
602 ++
603 ++ /*
604 ++ * The pointer is used as an identifier not as a pointer, we
605 ++ * can drop the refcount on the of__node immediately after
606 ++ * getting it.
607 ++ */
608 ++ of_node_put(alias_node);
609 ++
610 ++ if (node == alias_node)
611 ++ /* The primary timer lacks IRQ, use as clocksource */
612 ++ return integrator_clocksource_init(rate, base);
613 +
614 + err = of_property_read_string(of_aliases,
615 + "arm,timer-secondary", &path);
616 +@@ -213,14 +223,11 @@ static int __init integrator_ap_timer_init_of(struct device_node *node)
617 + return err;
618 + }
619 +
620 ++ alias_node = of_find_node_by_path(path);
621 +
622 +- sec_node = of_find_node_by_path(path);
623 +-
624 +- if (node == pri_node)
625 +- /* The primary timer lacks IRQ, use as clocksource */
626 +- return integrator_clocksource_init(rate, base);
627 ++ of_node_put(alias_node);
628 +
629 +- if (node == sec_node) {
630 ++ if (node == alias_node) {
631 + /* The secondary timer will drive the clock event */
632 + irq = irq_of_parse_and_map(node, 0);
633 + return integrator_clockevent_init(rate, base, irq);
634 +diff --git a/drivers/cpuidle/cpuidle-pseries.c b/drivers/cpuidle/cpuidle-pseries.c
635 +index a187a39fb866..7f21c6a57178 100644
636 +--- a/drivers/cpuidle/cpuidle-pseries.c
637 ++++ b/drivers/cpuidle/cpuidle-pseries.c
638 +@@ -239,7 +239,13 @@ static int pseries_idle_probe(void)
639 + return -ENODEV;
640 +
641 + if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
642 +- if (lppaca_shared_proc(get_lppaca())) {
643 ++ /*
644 ++ * Use local_paca instead of get_lppaca() since
645 ++ * preemption is not disabled, and it is not required in
646 ++ * fact, since lppaca_ptr does not need to be the value
647 ++ * associated to the current CPU, it can be from any CPU.
648 ++ */
649 ++ if (lppaca_shared_proc(local_paca->lppaca_ptr)) {
650 + cpuidle_state_table = shared_states;
651 + max_idle_state = ARRAY_SIZE(shared_states);
652 + } else {
653 +diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
654 +index 6aaaab79c205..f6e1e0e306a3 100644
655 +--- a/drivers/gpio/gpio-pl061.c
656 ++++ b/drivers/gpio/gpio-pl061.c
657 +@@ -54,6 +54,7 @@ struct pl061 {
658 +
659 + void __iomem *base;
660 + struct gpio_chip gc;
661 ++ struct irq_chip irq_chip;
662 + int parent_irq;
663 +
664 + #ifdef CONFIG_PM
665 +@@ -281,15 +282,6 @@ static int pl061_irq_set_wake(struct irq_data *d, unsigned int state)
666 + return irq_set_irq_wake(pl061->parent_irq, state);
667 + }
668 +
669 +-static struct irq_chip pl061_irqchip = {
670 +- .name = "pl061",
671 +- .irq_ack = pl061_irq_ack,
672 +- .irq_mask = pl061_irq_mask,
673 +- .irq_unmask = pl061_irq_unmask,
674 +- .irq_set_type = pl061_irq_type,
675 +- .irq_set_wake = pl061_irq_set_wake,
676 +-};
677 +-
678 + static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
679 + {
680 + struct device *dev = &adev->dev;
681 +@@ -328,6 +320,13 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
682 + /*
683 + * irq_chip support
684 + */
685 ++ pl061->irq_chip.name = dev_name(dev);
686 ++ pl061->irq_chip.irq_ack = pl061_irq_ack;
687 ++ pl061->irq_chip.irq_mask = pl061_irq_mask;
688 ++ pl061->irq_chip.irq_unmask = pl061_irq_unmask;
689 ++ pl061->irq_chip.irq_set_type = pl061_irq_type;
690 ++ pl061->irq_chip.irq_set_wake = pl061_irq_set_wake;
691 ++
692 + writeb(0, pl061->base + GPIOIE); /* disable irqs */
693 + irq = adev->irq[0];
694 + if (irq < 0) {
695 +@@ -336,14 +335,14 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
696 + }
697 + pl061->parent_irq = irq;
698 +
699 +- ret = gpiochip_irqchip_add(&pl061->gc, &pl061_irqchip,
700 ++ ret = gpiochip_irqchip_add(&pl061->gc, &pl061->irq_chip,
701 + 0, handle_bad_irq,
702 + IRQ_TYPE_NONE);
703 + if (ret) {
704 + dev_info(&adev->dev, "could not add irqchip\n");
705 + return ret;
706 + }
707 +- gpiochip_set_chained_irqchip(&pl061->gc, &pl061_irqchip,
708 ++ gpiochip_set_chained_irqchip(&pl061->gc, &pl061->irq_chip,
709 + irq, pl061_irq_handler);
710 +
711 + amba_set_drvdata(adev, pl061);
712 +diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
713 +index 73c672fc17c4..9834b7c1c9d4 100644
714 +--- a/drivers/gpu/drm/i915/gvt/kvmgt.c
715 ++++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
716 +@@ -807,11 +807,18 @@ write_err:
717 + return -EFAULT;
718 + }
719 +
720 ++static inline bool intel_vgpu_in_aperture(struct intel_vgpu *vgpu,
721 ++ unsigned long off)
722 ++{
723 ++ return off >= vgpu_aperture_offset(vgpu) &&
724 ++ off < vgpu_aperture_offset(vgpu) + vgpu_aperture_sz(vgpu);
725 ++}
726 ++
727 + static int intel_vgpu_mmap(struct mdev_device *mdev, struct vm_area_struct *vma)
728 + {
729 + unsigned int index;
730 + u64 virtaddr;
731 +- unsigned long req_size, pgoff = 0;
732 ++ unsigned long req_size, pgoff, req_start;
733 + pgprot_t pg_prot;
734 + struct intel_vgpu *vgpu = mdev_get_drvdata(mdev);
735 +
736 +@@ -829,7 +836,17 @@ static int intel_vgpu_mmap(struct mdev_device *mdev, struct vm_area_struct *vma)
737 + pg_prot = vma->vm_page_prot;
738 + virtaddr = vma->vm_start;
739 + req_size = vma->vm_end - vma->vm_start;
740 +- pgoff = vgpu_aperture_pa_base(vgpu) >> PAGE_SHIFT;
741 ++ pgoff = vma->vm_pgoff &
742 ++ ((1U << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1);
743 ++ req_start = pgoff << PAGE_SHIFT;
744 ++
745 ++ if (!intel_vgpu_in_aperture(vgpu, req_start))
746 ++ return -EINVAL;
747 ++ if (req_start + req_size >
748 ++ vgpu_aperture_offset(vgpu) + vgpu_aperture_sz(vgpu))
749 ++ return -EINVAL;
750 ++
751 ++ pgoff = (gvt_aperture_pa_base(vgpu->gvt) >> PAGE_SHIFT) + pgoff;
752 +
753 + return remap_pfn_range(vma, virtaddr, pgoff, req_size, pg_prot);
754 + }
755 +diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
756 +index 3c3453d213dc..fdfa25059723 100644
757 +--- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
758 ++++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
759 +@@ -310,13 +310,16 @@ int usnic_ib_query_port(struct ib_device *ibdev, u8 port,
760 +
761 + usnic_dbg("\n");
762 +
763 +- mutex_lock(&us_ibdev->usdev_lock);
764 + if (ib_get_eth_speed(ibdev, port, &props->active_speed,
765 +- &props->active_width)) {
766 +- mutex_unlock(&us_ibdev->usdev_lock);
767 ++ &props->active_width))
768 + return -EINVAL;
769 +- }
770 +
771 ++ /*
772 ++ * usdev_lock is acquired after (and not before) ib_get_eth_speed call
773 ++ * because acquiring rtnl_lock in ib_get_eth_speed, while holding
774 ++ * usdev_lock could lead to a deadlock.
775 ++ */
776 ++ mutex_lock(&us_ibdev->usdev_lock);
777 + /* props being zeroed by the caller, avoid zeroing it here */
778 +
779 + props->lid = 0;
780 +diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
781 +index de853bcc2384..08ae4f3a6a37 100644
782 +--- a/drivers/infiniband/sw/rxe/rxe_req.c
783 ++++ b/drivers/infiniband/sw/rxe/rxe_req.c
784 +@@ -640,6 +640,7 @@ next_wqe:
785 + rmr->access = wqe->wr.wr.reg.access;
786 + rmr->lkey = wqe->wr.wr.reg.key;
787 + rmr->rkey = wqe->wr.wr.reg.key;
788 ++ rmr->iova = wqe->wr.wr.reg.mr->iova;
789 + wqe->state = wqe_state_done;
790 + wqe->status = IB_WC_SUCCESS;
791 + } else {
792 +diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
793 +index c60d29d09687..2652ef68d58d 100644
794 +--- a/drivers/md/dm-crypt.c
795 ++++ b/drivers/md/dm-crypt.c
796 +@@ -49,7 +49,7 @@ struct convert_context {
797 + struct bio *bio_out;
798 + struct bvec_iter iter_in;
799 + struct bvec_iter iter_out;
800 +- sector_t cc_sector;
801 ++ u64 cc_sector;
802 + atomic_t cc_pending;
803 + union {
804 + struct skcipher_request *req;
805 +@@ -81,7 +81,7 @@ struct dm_crypt_request {
806 + struct convert_context *ctx;
807 + struct scatterlist sg_in[4];
808 + struct scatterlist sg_out[4];
809 +- sector_t iv_sector;
810 ++ u64 iv_sector;
811 + };
812 +
813 + struct crypt_config;
814 +@@ -172,7 +172,7 @@ struct crypt_config {
815 + struct iv_lmk_private lmk;
816 + struct iv_tcw_private tcw;
817 + } iv_gen_private;
818 +- sector_t iv_offset;
819 ++ u64 iv_offset;
820 + unsigned int iv_size;
821 + unsigned short int sector_size;
822 + unsigned char sector_shift;
823 +diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c
824 +index d4b326914f06..b9d1897bcf5b 100644
825 +--- a/drivers/md/dm-kcopyd.c
826 ++++ b/drivers/md/dm-kcopyd.c
827 +@@ -55,15 +55,17 @@ struct dm_kcopyd_client {
828 + struct dm_kcopyd_throttle *throttle;
829 +
830 + /*
831 +- * We maintain three lists of jobs:
832 ++ * We maintain four lists of jobs:
833 + *
834 + * i) jobs waiting for pages
835 + * ii) jobs that have pages, and are waiting for the io to be issued.
836 +- * iii) jobs that have completed.
837 ++ * iii) jobs that don't need to do any IO and just run a callback
838 ++ * iv) jobs that have completed.
839 + *
840 +- * All three of these are protected by job_lock.
841 ++ * All four of these are protected by job_lock.
842 + */
843 + spinlock_t job_lock;
844 ++ struct list_head callback_jobs;
845 + struct list_head complete_jobs;
846 + struct list_head io_jobs;
847 + struct list_head pages_jobs;
848 +@@ -622,6 +624,7 @@ static void do_work(struct work_struct *work)
849 + struct dm_kcopyd_client *kc = container_of(work,
850 + struct dm_kcopyd_client, kcopyd_work);
851 + struct blk_plug plug;
852 ++ unsigned long flags;
853 +
854 + /*
855 + * The order that these are called is *very* important.
856 +@@ -630,6 +633,10 @@ static void do_work(struct work_struct *work)
857 + * list. io jobs call wake when they complete and it all
858 + * starts again.
859 + */
860 ++ spin_lock_irqsave(&kc->job_lock, flags);
861 ++ list_splice_tail_init(&kc->callback_jobs, &kc->complete_jobs);
862 ++ spin_unlock_irqrestore(&kc->job_lock, flags);
863 ++
864 + blk_start_plug(&plug);
865 + process_jobs(&kc->complete_jobs, kc, run_complete_job);
866 + process_jobs(&kc->pages_jobs, kc, run_pages_job);
867 +@@ -647,7 +654,7 @@ static void dispatch_job(struct kcopyd_job *job)
868 + struct dm_kcopyd_client *kc = job->kc;
869 + atomic_inc(&kc->nr_jobs);
870 + if (unlikely(!job->source.count))
871 +- push(&kc->complete_jobs, job);
872 ++ push(&kc->callback_jobs, job);
873 + else if (job->pages == &zero_page_list)
874 + push(&kc->io_jobs, job);
875 + else
876 +@@ -857,7 +864,7 @@ void dm_kcopyd_do_callback(void *j, int read_err, unsigned long write_err)
877 + job->read_err = read_err;
878 + job->write_err = write_err;
879 +
880 +- push(&kc->complete_jobs, job);
881 ++ push(&kc->callback_jobs, job);
882 + wake(kc);
883 + }
884 + EXPORT_SYMBOL(dm_kcopyd_do_callback);
885 +@@ -887,6 +894,7 @@ struct dm_kcopyd_client *dm_kcopyd_client_create(struct dm_kcopyd_throttle *thro
886 + return ERR_PTR(-ENOMEM);
887 +
888 + spin_lock_init(&kc->job_lock);
889 ++ INIT_LIST_HEAD(&kc->callback_jobs);
890 + INIT_LIST_HEAD(&kc->complete_jobs);
891 + INIT_LIST_HEAD(&kc->io_jobs);
892 + INIT_LIST_HEAD(&kc->pages_jobs);
893 +@@ -936,6 +944,7 @@ void dm_kcopyd_client_destroy(struct dm_kcopyd_client *kc)
894 + /* Wait for completion of all jobs submitted by this client. */
895 + wait_event(kc->destroyq, !atomic_read(&kc->nr_jobs));
896 +
897 ++ BUG_ON(!list_empty(&kc->callback_jobs));
898 + BUG_ON(!list_empty(&kc->complete_jobs));
899 + BUG_ON(!list_empty(&kc->io_jobs));
900 + BUG_ON(!list_empty(&kc->pages_jobs));
901 +diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
902 +index a0613bd8ed00..b502debc6df3 100644
903 +--- a/drivers/md/dm-snap.c
904 ++++ b/drivers/md/dm-snap.c
905 +@@ -19,6 +19,7 @@
906 + #include <linux/vmalloc.h>
907 + #include <linux/log2.h>
908 + #include <linux/dm-kcopyd.h>
909 ++#include <linux/semaphore.h>
910 +
911 + #include "dm.h"
912 +
913 +@@ -105,6 +106,9 @@ struct dm_snapshot {
914 + /* The on disk metadata handler */
915 + struct dm_exception_store *store;
916 +
917 ++ /* Maximum number of in-flight COW jobs. */
918 ++ struct semaphore cow_count;
919 ++
920 + struct dm_kcopyd_client *kcopyd_client;
921 +
922 + /* Wait for events based on state_bits */
923 +@@ -145,6 +149,19 @@ struct dm_snapshot {
924 + #define RUNNING_MERGE 0
925 + #define SHUTDOWN_MERGE 1
926 +
927 ++/*
928 ++ * Maximum number of chunks being copied on write.
929 ++ *
930 ++ * The value was decided experimentally as a trade-off between memory
931 ++ * consumption, stalling the kernel's workqueues and maintaining a high enough
932 ++ * throughput.
933 ++ */
934 ++#define DEFAULT_COW_THRESHOLD 2048
935 ++
936 ++static int cow_threshold = DEFAULT_COW_THRESHOLD;
937 ++module_param_named(snapshot_cow_threshold, cow_threshold, int, 0644);
938 ++MODULE_PARM_DESC(snapshot_cow_threshold, "Maximum number of chunks being copied on write");
939 ++
940 + DECLARE_DM_KCOPYD_THROTTLE_WITH_MODULE_PARM(snapshot_copy_throttle,
941 + "A percentage of time allocated for copy on write");
942 +
943 +@@ -1189,6 +1206,8 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)
944 + goto bad_hash_tables;
945 + }
946 +
947 ++ sema_init(&s->cow_count, (cow_threshold > 0) ? cow_threshold : INT_MAX);
948 ++
949 + s->kcopyd_client = dm_kcopyd_client_create(&dm_kcopyd_throttle);
950 + if (IS_ERR(s->kcopyd_client)) {
951 + r = PTR_ERR(s->kcopyd_client);
952 +@@ -1560,6 +1579,7 @@ static void copy_callback(int read_err, unsigned long write_err, void *context)
953 + }
954 + list_add(&pe->out_of_order_entry, lh);
955 + }
956 ++ up(&s->cow_count);
957 + }
958 +
959 + /*
960 +@@ -1583,6 +1603,7 @@ static void start_copy(struct dm_snap_pending_exception *pe)
961 + dest.count = src.count;
962 +
963 + /* Hand over to kcopyd */
964 ++ down(&s->cow_count);
965 + dm_kcopyd_copy(s->kcopyd_client, &src, 1, &dest, 0, copy_callback, pe);
966 + }
967 +
968 +@@ -1602,6 +1623,7 @@ static void start_full_bio(struct dm_snap_pending_exception *pe,
969 + pe->full_bio = bio;
970 + pe->full_bio_end_io = bio->bi_end_io;
971 +
972 ++ down(&s->cow_count);
973 + callback_data = dm_kcopyd_prepare_callback(s->kcopyd_client,
974 + copy_callback, pe);
975 +
976 +diff --git a/drivers/media/firewire/firedtv-avc.c b/drivers/media/firewire/firedtv-avc.c
977 +index 5bde6c209cd7..b243e4a52f10 100644
978 +--- a/drivers/media/firewire/firedtv-avc.c
979 ++++ b/drivers/media/firewire/firedtv-avc.c
980 +@@ -968,7 +968,8 @@ static int get_ca_object_length(struct avc_response_frame *r)
981 + return r->operand[7];
982 + }
983 +
984 +-int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len)
985 ++int avc_ca_app_info(struct firedtv *fdtv, unsigned char *app_info,
986 ++ unsigned int *len)
987 + {
988 + struct avc_command_frame *c = (void *)fdtv->avc_data;
989 + struct avc_response_frame *r = (void *)fdtv->avc_data;
990 +@@ -1009,7 +1010,8 @@ out:
991 + return ret;
992 + }
993 +
994 +-int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len)
995 ++int avc_ca_info(struct firedtv *fdtv, unsigned char *app_info,
996 ++ unsigned int *len)
997 + {
998 + struct avc_command_frame *c = (void *)fdtv->avc_data;
999 + struct avc_response_frame *r = (void *)fdtv->avc_data;
1000 +diff --git a/drivers/media/firewire/firedtv.h b/drivers/media/firewire/firedtv.h
1001 +index 345d1eda8c05..5b18a08c6285 100644
1002 +--- a/drivers/media/firewire/firedtv.h
1003 ++++ b/drivers/media/firewire/firedtv.h
1004 +@@ -124,8 +124,10 @@ int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
1005 + struct dvb_diseqc_master_cmd *diseqcmd);
1006 + void avc_remote_ctrl_work(struct work_struct *work);
1007 + int avc_register_remote_control(struct firedtv *fdtv);
1008 +-int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
1009 +-int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
1010 ++int avc_ca_app_info(struct firedtv *fdtv, unsigned char *app_info,
1011 ++ unsigned int *len);
1012 ++int avc_ca_info(struct firedtv *fdtv, unsigned char *app_info,
1013 ++ unsigned int *len);
1014 + int avc_ca_reset(struct firedtv *fdtv);
1015 + int avc_ca_pmt(struct firedtv *fdtv, char *app_info, int length);
1016 + int avc_ca_get_time_date(struct firedtv *fdtv, int *interval);
1017 +diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
1018 +index 41eef376eb2d..769e9e68562d 100644
1019 +--- a/drivers/media/platform/qcom/venus/core.c
1020 ++++ b/drivers/media/platform/qcom/venus/core.c
1021 +@@ -187,6 +187,14 @@ static int venus_probe(struct platform_device *pdev)
1022 + if (ret)
1023 + return ret;
1024 +
1025 ++ if (!dev->dma_parms) {
1026 ++ dev->dma_parms = devm_kzalloc(dev, sizeof(*dev->dma_parms),
1027 ++ GFP_KERNEL);
1028 ++ if (!dev->dma_parms)
1029 ++ return -ENOMEM;
1030 ++ }
1031 ++ dma_set_max_seg_size(dev, DMA_BIT_MASK(32));
1032 ++
1033 + INIT_LIST_HEAD(&core->instances);
1034 + mutex_init(&core->lock);
1035 + INIT_DELAYED_WORK(&core->work, venus_sys_error_handler);
1036 +diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
1037 +index 0a0ebf3a096d..c8a591d8a3d9 100644
1038 +--- a/drivers/mmc/host/atmel-mci.c
1039 ++++ b/drivers/mmc/host/atmel-mci.c
1040 +@@ -1954,13 +1954,14 @@ static void atmci_tasklet_func(unsigned long priv)
1041 + }
1042 +
1043 + atmci_request_end(host, host->mrq);
1044 +- state = STATE_IDLE;
1045 ++ goto unlock; /* atmci_request_end() sets host->state */
1046 + break;
1047 + }
1048 + } while (state != prev_state);
1049 +
1050 + host->state = state;
1051 +
1052 ++unlock:
1053 + spin_unlock(&host->lock);
1054 + }
1055 +
1056 +diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
1057 +index eebda5ec9676..34998ecd9cc9 100644
1058 +--- a/drivers/net/dsa/mv88e6xxx/chip.c
1059 ++++ b/drivers/net/dsa/mv88e6xxx/chip.c
1060 +@@ -1979,6 +1979,107 @@ static int mv88e6xxx_g1_setup(struct mv88e6xxx_chip *chip)
1061 + return 0;
1062 + }
1063 +
1064 ++/* The mv88e6390 has some hidden registers used for debug and
1065 ++ * development. The errata also makes use of them.
1066 ++ */
1067 ++static int mv88e6390_hidden_write(struct mv88e6xxx_chip *chip, int port,
1068 ++ int reg, u16 val)
1069 ++{
1070 ++ u16 ctrl;
1071 ++ int err;
1072 ++
1073 ++ err = mv88e6xxx_port_write(chip, PORT_RESERVED_1A_DATA_PORT,
1074 ++ PORT_RESERVED_1A, val);
1075 ++ if (err)
1076 ++ return err;
1077 ++
1078 ++ ctrl = PORT_RESERVED_1A_BUSY | PORT_RESERVED_1A_WRITE |
1079 ++ PORT_RESERVED_1A_BLOCK | port << PORT_RESERVED_1A_PORT_SHIFT |
1080 ++ reg;
1081 ++
1082 ++ return mv88e6xxx_port_write(chip, PORT_RESERVED_1A_CTRL_PORT,
1083 ++ PORT_RESERVED_1A, ctrl);
1084 ++}
1085 ++
1086 ++static int mv88e6390_hidden_wait(struct mv88e6xxx_chip *chip)
1087 ++{
1088 ++ return mv88e6xxx_wait(chip, PORT_RESERVED_1A_CTRL_PORT,
1089 ++ PORT_RESERVED_1A, PORT_RESERVED_1A_BUSY);
1090 ++}
1091 ++
1092 ++
1093 ++static int mv88e6390_hidden_read(struct mv88e6xxx_chip *chip, int port,
1094 ++ int reg, u16 *val)
1095 ++{
1096 ++ u16 ctrl;
1097 ++ int err;
1098 ++
1099 ++ ctrl = PORT_RESERVED_1A_BUSY | PORT_RESERVED_1A_READ |
1100 ++ PORT_RESERVED_1A_BLOCK | port << PORT_RESERVED_1A_PORT_SHIFT |
1101 ++ reg;
1102 ++
1103 ++ err = mv88e6xxx_port_write(chip, PORT_RESERVED_1A_CTRL_PORT,
1104 ++ PORT_RESERVED_1A, ctrl);
1105 ++ if (err)
1106 ++ return err;
1107 ++
1108 ++ err = mv88e6390_hidden_wait(chip);
1109 ++ if (err)
1110 ++ return err;
1111 ++
1112 ++ return mv88e6xxx_port_read(chip, PORT_RESERVED_1A_DATA_PORT,
1113 ++ PORT_RESERVED_1A, val);
1114 ++}
1115 ++
1116 ++/* Check if the errata has already been applied. */
1117 ++static bool mv88e6390_setup_errata_applied(struct mv88e6xxx_chip *chip)
1118 ++{
1119 ++ int port;
1120 ++ int err;
1121 ++ u16 val;
1122 ++
1123 ++ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
1124 ++ err = mv88e6390_hidden_read(chip, port, 0, &val);
1125 ++ if (err) {
1126 ++ dev_err(chip->dev,
1127 ++ "Error reading hidden register: %d\n", err);
1128 ++ return false;
1129 ++ }
1130 ++ if (val != 0x01c0)
1131 ++ return false;
1132 ++ }
1133 ++
1134 ++ return true;
1135 ++}
1136 ++
1137 ++/* The 6390 copper ports have an errata which require poking magic
1138 ++ * values into undocumented hidden registers and then performing a
1139 ++ * software reset.
1140 ++ */
1141 ++static int mv88e6390_setup_errata(struct mv88e6xxx_chip *chip)
1142 ++{
1143 ++ int port;
1144 ++ int err;
1145 ++
1146 ++ if (mv88e6390_setup_errata_applied(chip))
1147 ++ return 0;
1148 ++
1149 ++ /* Set the ports into blocking mode */
1150 ++ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
1151 ++ err = mv88e6xxx_port_set_state(chip, port, BR_STATE_DISABLED);
1152 ++ if (err)
1153 ++ return err;
1154 ++ }
1155 ++
1156 ++ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
1157 ++ err = mv88e6390_hidden_write(chip, port, 0, 0x01c0);
1158 ++ if (err)
1159 ++ return err;
1160 ++ }
1161 ++
1162 ++ return mv88e6xxx_software_reset(chip);
1163 ++}
1164 ++
1165 + static int mv88e6xxx_setup(struct dsa_switch *ds)
1166 + {
1167 + struct mv88e6xxx_chip *chip = ds->priv;
1168 +@@ -1990,6 +2091,12 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
1169 +
1170 + mutex_lock(&chip->reg_lock);
1171 +
1172 ++ if (chip->info->ops->setup_errata) {
1173 ++ err = chip->info->ops->setup_errata(chip);
1174 ++ if (err)
1175 ++ goto unlock;
1176 ++ }
1177 ++
1178 + /* Setup Switch Port Registers */
1179 + for (i = 0; i < mv88e6xxx_num_ports(chip); i++) {
1180 + err = mv88e6xxx_setup_port(chip, i);
1181 +@@ -2652,6 +2759,7 @@ static const struct mv88e6xxx_ops mv88e6185_ops = {
1182 +
1183 + static const struct mv88e6xxx_ops mv88e6190_ops = {
1184 + /* MV88E6XXX_FAMILY_6390 */
1185 ++ .setup_errata = mv88e6390_setup_errata,
1186 + .irl_init_all = mv88e6390_g2_irl_init_all,
1187 + .get_eeprom = mv88e6xxx_g2_get_eeprom8,
1188 + .set_eeprom = mv88e6xxx_g2_set_eeprom8,
1189 +@@ -2687,6 +2795,7 @@ static const struct mv88e6xxx_ops mv88e6190_ops = {
1190 +
1191 + static const struct mv88e6xxx_ops mv88e6190x_ops = {
1192 + /* MV88E6XXX_FAMILY_6390 */
1193 ++ .setup_errata = mv88e6390_setup_errata,
1194 + .irl_init_all = mv88e6390_g2_irl_init_all,
1195 + .get_eeprom = mv88e6xxx_g2_get_eeprom8,
1196 + .set_eeprom = mv88e6xxx_g2_set_eeprom8,
1197 +@@ -2722,6 +2831,7 @@ static const struct mv88e6xxx_ops mv88e6190x_ops = {
1198 +
1199 + static const struct mv88e6xxx_ops mv88e6191_ops = {
1200 + /* MV88E6XXX_FAMILY_6390 */
1201 ++ .setup_errata = mv88e6390_setup_errata,
1202 + .irl_init_all = mv88e6390_g2_irl_init_all,
1203 + .get_eeprom = mv88e6xxx_g2_get_eeprom8,
1204 + .set_eeprom = mv88e6xxx_g2_set_eeprom8,
1205 +@@ -2793,6 +2903,7 @@ static const struct mv88e6xxx_ops mv88e6240_ops = {
1206 +
1207 + static const struct mv88e6xxx_ops mv88e6290_ops = {
1208 + /* MV88E6XXX_FAMILY_6390 */
1209 ++ .setup_errata = mv88e6390_setup_errata,
1210 + .irl_init_all = mv88e6390_g2_irl_init_all,
1211 + .get_eeprom = mv88e6xxx_g2_get_eeprom8,
1212 + .set_eeprom = mv88e6xxx_g2_set_eeprom8,
1213 +@@ -3030,6 +3141,7 @@ static const struct mv88e6xxx_ops mv88e6352_ops = {
1214 +
1215 + static const struct mv88e6xxx_ops mv88e6390_ops = {
1216 + /* MV88E6XXX_FAMILY_6390 */
1217 ++ .setup_errata = mv88e6390_setup_errata,
1218 + .irl_init_all = mv88e6390_g2_irl_init_all,
1219 + .get_eeprom = mv88e6xxx_g2_get_eeprom8,
1220 + .set_eeprom = mv88e6xxx_g2_set_eeprom8,
1221 +@@ -3068,6 +3180,7 @@ static const struct mv88e6xxx_ops mv88e6390_ops = {
1222 +
1223 + static const struct mv88e6xxx_ops mv88e6390x_ops = {
1224 + /* MV88E6XXX_FAMILY_6390 */
1225 ++ .setup_errata = mv88e6390_setup_errata,
1226 + .irl_init_all = mv88e6390_g2_irl_init_all,
1227 + .get_eeprom = mv88e6xxx_g2_get_eeprom8,
1228 + .set_eeprom = mv88e6xxx_g2_set_eeprom8,
1229 +diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
1230 +index 334f6f7544ba..0913eeca53b3 100644
1231 +--- a/drivers/net/dsa/mv88e6xxx/chip.h
1232 ++++ b/drivers/net/dsa/mv88e6xxx/chip.h
1233 +@@ -222,6 +222,11 @@ struct mv88e6xxx_mdio_bus {
1234 + };
1235 +
1236 + struct mv88e6xxx_ops {
1237 ++ /* Switch Setup Errata, called early in the switch setup to
1238 ++ * allow any errata actions to be performed
1239 ++ */
1240 ++ int (*setup_errata)(struct mv88e6xxx_chip *chip);
1241 ++
1242 + /* Ingress Rate Limit unit (IRL) operations */
1243 + int (*irl_init_all)(struct mv88e6xxx_chip *chip, int port);
1244 +
1245 +diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h
1246 +index b16d5f0e6e9c..ccdc67fe9079 100644
1247 +--- a/drivers/net/dsa/mv88e6xxx/port.h
1248 ++++ b/drivers/net/dsa/mv88e6xxx/port.h
1249 +@@ -236,6 +236,16 @@
1250 + /* Offset 0x19: Port IEEE Priority Remapping Registers (4-7) */
1251 + #define MV88E6095_PORT_IEEE_PRIO_REMAP_4567 0x19
1252 +
1253 ++/* Offset 0x1a: Magic undocumented errata register */
1254 ++#define PORT_RESERVED_1A 0x1a
1255 ++#define PORT_RESERVED_1A_BUSY BIT(15)
1256 ++#define PORT_RESERVED_1A_WRITE BIT(14)
1257 ++#define PORT_RESERVED_1A_READ 0
1258 ++#define PORT_RESERVED_1A_PORT_SHIFT 5
1259 ++#define PORT_RESERVED_1A_BLOCK (0xf << 10)
1260 ++#define PORT_RESERVED_1A_CTRL_PORT 4
1261 ++#define PORT_RESERVED_1A_DATA_PORT 5
1262 ++
1263 + int mv88e6xxx_port_read(struct mv88e6xxx_chip *chip, int port, int reg,
1264 + u16 *val);
1265 + int mv88e6xxx_port_write(struct mv88e6xxx_chip *chip, int port, int reg,
1266 +diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c
1267 +index b366885487a8..cd16b70a4e70 100644
1268 +--- a/drivers/net/ethernet/intel/e1000e/ptp.c
1269 ++++ b/drivers/net/ethernet/intel/e1000e/ptp.c
1270 +@@ -191,10 +191,14 @@ static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
1271 + struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter,
1272 + ptp_clock_info);
1273 + unsigned long flags;
1274 +- u64 ns;
1275 ++ u64 cycles, ns;
1276 +
1277 + spin_lock_irqsave(&adapter->systim_lock, flags);
1278 +- ns = timecounter_read(&adapter->tc);
1279 ++
1280 ++ /* Use timecounter_cyc2time() to allow non-monotonic SYSTIM readings */
1281 ++ cycles = adapter->cc.read(&adapter->cc);
1282 ++ ns = timecounter_cyc2time(&adapter->tc, cycles);
1283 ++
1284 + spin_unlock_irqrestore(&adapter->systim_lock, flags);
1285 +
1286 + *ts = ns_to_timespec64(ns);
1287 +@@ -250,9 +254,12 @@ static void e1000e_systim_overflow_work(struct work_struct *work)
1288 + systim_overflow_work.work);
1289 + struct e1000_hw *hw = &adapter->hw;
1290 + struct timespec64 ts;
1291 ++ u64 ns;
1292 +
1293 +- adapter->ptp_clock_info.gettime64(&adapter->ptp_clock_info, &ts);
1294 ++ /* Update the timecounter */
1295 ++ ns = timecounter_read(&adapter->tc);
1296 +
1297 ++ ts = ns_to_timespec64(ns);
1298 + e_dbg("SYSTIM overflow check at %lld.%09lu\n",
1299 + (long long) ts.tv_sec, ts.tv_nsec);
1300 +
1301 +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
1302 +index 84864fdcb0e8..cf65b2ee8b95 100644
1303 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
1304 ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
1305 +@@ -4276,12 +4276,15 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *lower_dev,
1306 + lower_dev,
1307 + upper_dev);
1308 + } else if (netif_is_lag_master(upper_dev)) {
1309 +- if (info->linking)
1310 ++ if (info->linking) {
1311 + err = mlxsw_sp_port_lag_join(mlxsw_sp_port,
1312 + upper_dev);
1313 +- else
1314 ++ } else {
1315 ++ mlxsw_sp_port_lag_tx_en_set(mlxsw_sp_port,
1316 ++ false);
1317 + mlxsw_sp_port_lag_leave(mlxsw_sp_port,
1318 + upper_dev);
1319 ++ }
1320 + } else if (netif_is_ovs_master(upper_dev)) {
1321 + if (info->linking)
1322 + err = mlxsw_sp_port_ovs_join(mlxsw_sp_port);
1323 +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
1324 +index 21611613f44c..9052e93e1925 100644
1325 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
1326 ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
1327 +@@ -1424,7 +1424,7 @@ static void
1328 + mlxsw_sp_bridge_port_vlan_del(struct mlxsw_sp_port *mlxsw_sp_port,
1329 + struct mlxsw_sp_bridge_port *bridge_port, u16 vid)
1330 + {
1331 +- u16 pvid = mlxsw_sp_port->pvid == vid ? 0 : vid;
1332 ++ u16 pvid = mlxsw_sp_port->pvid == vid ? 0 : mlxsw_sp_port->pvid;
1333 + struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan;
1334 +
1335 + mlxsw_sp_port_vlan = mlxsw_sp_port_vlan_find_by_vid(mlxsw_sp_port, vid);
1336 +diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
1337 +index 1b61ce310132..c7364d9496e3 100644
1338 +--- a/drivers/net/ethernet/realtek/r8169.c
1339 ++++ b/drivers/net/ethernet/realtek/r8169.c
1340 +@@ -324,6 +324,8 @@ enum cfg_version {
1341 + };
1342 +
1343 + static const struct pci_device_id rtl8169_pci_tbl[] = {
1344 ++ { PCI_VDEVICE(REALTEK, 0x2502), RTL_CFG_1 },
1345 ++ { PCI_VDEVICE(REALTEK, 0x2600), RTL_CFG_1 },
1346 + { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8129), 0, 0, RTL_CFG_0 },
1347 + { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8136), 0, 0, RTL_CFG_2 },
1348 + { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8161), 0, 0, RTL_CFG_1 },
1349 +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
1350 +index 891f8f975b43..25204d2c9e89 100644
1351 +--- a/drivers/net/usb/qmi_wwan.c
1352 ++++ b/drivers/net/usb/qmi_wwan.c
1353 +@@ -123,6 +123,7 @@ static void qmimux_setup(struct net_device *dev)
1354 + dev->addr_len = 0;
1355 + dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
1356 + dev->netdev_ops = &qmimux_netdev_ops;
1357 ++ dev->mtu = 1500;
1358 + dev->needs_free_netdev = true;
1359 + }
1360 +
1361 +diff --git a/drivers/pci/dwc/pcie-designware-host.c b/drivers/pci/dwc/pcie-designware-host.c
1362 +index bc3e2d8d0cce..58b38c54a7cf 100644
1363 +--- a/drivers/pci/dwc/pcie-designware-host.c
1364 ++++ b/drivers/pci/dwc/pcie-designware-host.c
1365 +@@ -45,8 +45,19 @@ static int dw_pcie_wr_own_conf(struct pcie_port *pp, int where, int size,
1366 + return dw_pcie_write(pci->dbi_base + where, size, val);
1367 + }
1368 +
1369 ++static void dwc_irq_ack(struct irq_data *d)
1370 ++{
1371 ++ struct msi_desc *msi = irq_data_get_msi_desc(d);
1372 ++ struct pcie_port *pp = msi_desc_to_pci_sysdata(msi);
1373 ++ int pos = d->hwirq % 32;
1374 ++ int i = d->hwirq / 32;
1375 ++
1376 ++ dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12, 4, BIT(pos));
1377 ++}
1378 ++
1379 + static struct irq_chip dw_msi_irq_chip = {
1380 + .name = "PCI-MSI",
1381 ++ .irq_ack = dwc_irq_ack,
1382 + .irq_enable = pci_msi_unmask_irq,
1383 + .irq_disable = pci_msi_mask_irq,
1384 + .irq_mask = pci_msi_mask_irq,
1385 +@@ -72,8 +83,6 @@ irqreturn_t dw_handle_msi_irq(struct pcie_port *pp)
1386 + pos)) != 32) {
1387 + irq = irq_find_mapping(pp->irq_domain, i * 32 + pos);
1388 + generic_handle_irq(irq);
1389 +- dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_STATUS + i * 12,
1390 +- 4, 1 << pos);
1391 + pos++;
1392 + }
1393 + }
1394 +@@ -263,7 +272,7 @@ static struct msi_controller dw_pcie_msi_chip = {
1395 + static int dw_pcie_msi_map(struct irq_domain *domain, unsigned int irq,
1396 + irq_hw_number_t hwirq)
1397 + {
1398 +- irq_set_chip_and_handler(irq, &dw_msi_irq_chip, handle_simple_irq);
1399 ++ irq_set_chip_and_handler(irq, &dw_msi_irq_chip, handle_edge_irq);
1400 + irq_set_chip_data(irq, domain->host_data);
1401 +
1402 + return 0;
1403 +diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
1404 +index 7440f650e81a..3f662cd774d7 100644
1405 +--- a/drivers/platform/x86/asus-wmi.c
1406 ++++ b/drivers/platform/x86/asus-wmi.c
1407 +@@ -2147,7 +2147,8 @@ static int asus_wmi_add(struct platform_device *pdev)
1408 + err = asus_wmi_backlight_init(asus);
1409 + if (err && err != -ENODEV)
1410 + goto fail_backlight;
1411 +- }
1412 ++ } else
1413 ++ err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL);
1414 +
1415 + status = wmi_install_notify_handler(asus->driver->event_guid,
1416 + asus_wmi_notify, asus);
1417 +diff --git a/drivers/scsi/megaraid/megaraid_sas_fp.c b/drivers/scsi/megaraid/megaraid_sas_fp.c
1418 +index f2ffde430ec1..9a2a62e39e4c 100644
1419 +--- a/drivers/scsi/megaraid/megaraid_sas_fp.c
1420 ++++ b/drivers/scsi/megaraid/megaraid_sas_fp.c
1421 +@@ -1266,7 +1266,7 @@ void mr_update_load_balance_params(struct MR_DRV_RAID_MAP_ALL *drv_map,
1422 +
1423 + for (ldCount = 0; ldCount < MAX_LOGICAL_DRIVES_EXT; ldCount++) {
1424 + ld = MR_TargetIdToLdGet(ldCount, drv_map);
1425 +- if (ld >= MAX_LOGICAL_DRIVES_EXT) {
1426 ++ if (ld >= MAX_LOGICAL_DRIVES_EXT - 1) {
1427 + lbInfo[ldCount].loadBalanceFlag = 0;
1428 + continue;
1429 + }
1430 +diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
1431 +index 06a2e3d9fc5b..7be2b9e11332 100644
1432 +--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
1433 ++++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
1434 +@@ -2529,7 +2529,7 @@ static void megasas_build_ld_nonrw_fusion(struct megasas_instance *instance,
1435 + device_id < instance->fw_supported_vd_count)) {
1436 +
1437 + ld = MR_TargetIdToLdGet(device_id, local_map_ptr);
1438 +- if (ld >= instance->fw_supported_vd_count)
1439 ++ if (ld >= instance->fw_supported_vd_count - 1)
1440 + fp_possible = 0;
1441 + else {
1442 + raid = MR_LdRaidGet(ld, local_map_ptr);
1443 +diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
1444 +index 83bdbd84eb01..bc15999f1c7c 100644
1445 +--- a/drivers/scsi/smartpqi/smartpqi_init.c
1446 ++++ b/drivers/scsi/smartpqi/smartpqi_init.c
1447 +@@ -2709,6 +2709,9 @@ static unsigned int pqi_process_io_intr(struct pqi_ctrl_info *ctrl_info,
1448 + switch (response->header.iu_type) {
1449 + case PQI_RESPONSE_IU_RAID_PATH_IO_SUCCESS:
1450 + case PQI_RESPONSE_IU_AIO_PATH_IO_SUCCESS:
1451 ++ if (io_request->scmd)
1452 ++ io_request->scmd->result = 0;
1453 ++ /* fall through */
1454 + case PQI_RESPONSE_IU_GENERAL_MANAGEMENT:
1455 + break;
1456 + case PQI_RESPONSE_IU_TASK_MANAGEMENT:
1457 +@@ -6700,6 +6703,7 @@ static void pqi_shutdown(struct pci_dev *pci_dev)
1458 + * storage.
1459 + */
1460 + rc = pqi_flush_cache(ctrl_info, SHUTDOWN);
1461 ++ pqi_free_interrupts(ctrl_info);
1462 + pqi_reset(ctrl_info);
1463 + if (rc == 0)
1464 + return;
1465 +diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c
1466 +index cb0461a10808..93424db5f002 100644
1467 +--- a/drivers/target/target_core_spc.c
1468 ++++ b/drivers/target/target_core_spc.c
1469 +@@ -108,12 +108,17 @@ spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf)
1470 +
1471 + buf[7] = 0x2; /* CmdQue=1 */
1472 +
1473 +- memcpy(&buf[8], "LIO-ORG ", 8);
1474 +- memset(&buf[16], 0x20, 16);
1475 ++ /*
1476 ++ * ASCII data fields described as being left-aligned shall have any
1477 ++ * unused bytes at the end of the field (i.e., highest offset) and the
1478 ++ * unused bytes shall be filled with ASCII space characters (20h).
1479 ++ */
1480 ++ memset(&buf[8], 0x20, 8 + 16 + 4);
1481 ++ memcpy(&buf[8], "LIO-ORG", sizeof("LIO-ORG") - 1);
1482 + memcpy(&buf[16], dev->t10_wwn.model,
1483 +- min_t(size_t, strlen(dev->t10_wwn.model), 16));
1484 ++ strnlen(dev->t10_wwn.model, 16));
1485 + memcpy(&buf[32], dev->t10_wwn.revision,
1486 +- min_t(size_t, strlen(dev->t10_wwn.revision), 4));
1487 ++ strnlen(dev->t10_wwn.revision, 4));
1488 + buf[4] = 31; /* Set additional length to 31 */
1489 +
1490 + return 0;
1491 +@@ -251,7 +256,9 @@ check_t10_vend_desc:
1492 + buf[off] = 0x2; /* ASCII */
1493 + buf[off+1] = 0x1; /* T10 Vendor ID */
1494 + buf[off+2] = 0x0;
1495 +- memcpy(&buf[off+4], "LIO-ORG", 8);
1496 ++ /* left align Vendor ID and pad with spaces */
1497 ++ memset(&buf[off+4], 0x20, 8);
1498 ++ memcpy(&buf[off+4], "LIO-ORG", sizeof("LIO-ORG") - 1);
1499 + /* Extra Byte for NULL Terminator */
1500 + id_len++;
1501 + /* Identifier Length */
1502 +diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
1503 +index c9f701aca677..4a4a9f33715c 100644
1504 +--- a/drivers/tty/serial/amba-pl011.c
1505 ++++ b/drivers/tty/serial/amba-pl011.c
1506 +@@ -2800,6 +2800,7 @@ static struct platform_driver arm_sbsa_uart_platform_driver = {
1507 + .name = "sbsa-uart",
1508 + .of_match_table = of_match_ptr(sbsa_uart_of_match),
1509 + .acpi_match_table = ACPI_PTR(sbsa_uart_acpi_match),
1510 ++ .suppress_bind_attrs = IS_BUILTIN(CONFIG_SERIAL_AMBA_PL011),
1511 + },
1512 + };
1513 +
1514 +@@ -2828,6 +2829,7 @@ static struct amba_driver pl011_driver = {
1515 + .drv = {
1516 + .name = "uart-pl011",
1517 + .pm = &pl011_dev_pm_ops,
1518 ++ .suppress_bind_attrs = IS_BUILTIN(CONFIG_SERIAL_AMBA_PL011),
1519 + },
1520 + .id_table = pl011_ids,
1521 + .probe = pl011_probe,
1522 +diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c
1523 +index 00a33eb859d3..e3d7d9d6c599 100644
1524 +--- a/drivers/tty/serial/pic32_uart.c
1525 ++++ b/drivers/tty/serial/pic32_uart.c
1526 +@@ -920,6 +920,7 @@ static struct platform_driver pic32_uart_platform_driver = {
1527 + .driver = {
1528 + .name = PIC32_DEV_NAME,
1529 + .of_match_table = of_match_ptr(pic32_serial_dt_ids),
1530 ++ .suppress_bind_attrs = IS_BUILTIN(CONFIG_SERIAL_PIC32),
1531 + },
1532 + };
1533 +
1534 +diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
1535 +index 6db8844ef3ec..543d0f95f094 100644
1536 +--- a/drivers/tty/serial/serial_core.c
1537 ++++ b/drivers/tty/serial/serial_core.c
1538 +@@ -218,10 +218,15 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
1539 + if (!state->xmit.buf) {
1540 + state->xmit.buf = (unsigned char *) page;
1541 + uart_circ_clear(&state->xmit);
1542 ++ uart_port_unlock(uport, flags);
1543 + } else {
1544 ++ uart_port_unlock(uport, flags);
1545 ++ /*
1546 ++ * Do not free() the page under the port lock, see
1547 ++ * uart_shutdown().
1548 ++ */
1549 + free_page(page);
1550 + }
1551 +- uart_port_unlock(uport, flags);
1552 +
1553 + retval = uport->ops->startup(uport);
1554 + if (retval == 0) {
1555 +@@ -281,6 +286,7 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)
1556 + struct uart_port *uport = uart_port_check(state);
1557 + struct tty_port *port = &state->port;
1558 + unsigned long flags = 0;
1559 ++ char *xmit_buf = NULL;
1560 +
1561 + /*
1562 + * Set the TTY IO error marker
1563 +@@ -311,14 +317,18 @@ static void uart_shutdown(struct tty_struct *tty, struct uart_state *state)
1564 + tty_port_set_suspended(port, 0);
1565 +
1566 + /*
1567 +- * Free the transmit buffer page.
1568 ++ * Do not free() the transmit buffer page under the port lock since
1569 ++ * this can create various circular locking scenarios. For instance,
1570 ++ * console driver may need to allocate/free a debug object, which
1571 ++ * can endup in printk() recursion.
1572 + */
1573 + uart_port_lock(state, flags);
1574 +- if (state->xmit.buf) {
1575 +- free_page((unsigned long)state->xmit.buf);
1576 +- state->xmit.buf = NULL;
1577 +- }
1578 ++ xmit_buf = state->xmit.buf;
1579 ++ state->xmit.buf = NULL;
1580 + uart_port_unlock(uport, flags);
1581 ++
1582 ++ if (xmit_buf)
1583 ++ free_page((unsigned long)xmit_buf);
1584 + }
1585 +
1586 + /**
1587 +diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
1588 +index 897b1c515d00..217686cb4cd3 100644
1589 +--- a/drivers/tty/serial/xilinx_uartps.c
1590 ++++ b/drivers/tty/serial/xilinx_uartps.c
1591 +@@ -1644,6 +1644,7 @@ static struct platform_driver cdns_uart_platform_driver = {
1592 + .name = CDNS_UART_NAME,
1593 + .of_match_table = cdns_uart_of_match,
1594 + .pm = &cdns_uart_dev_pm_ops,
1595 ++ .suppress_bind_attrs = IS_BUILTIN(CONFIG_SERIAL_XILINX_PS_UART),
1596 + },
1597 + };
1598 +
1599 +diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c
1600 +index ade0723787e5..e5355ede2c46 100644
1601 +--- a/drivers/usb/gadget/udc/renesas_usb3.c
1602 ++++ b/drivers/usb/gadget/udc/renesas_usb3.c
1603 +@@ -352,6 +352,7 @@ struct renesas_usb3 {
1604 + bool extcon_host; /* check id and set EXTCON_USB_HOST */
1605 + bool extcon_usb; /* check vbus and set EXTCON_USB */
1606 + bool forced_b_device;
1607 ++ bool start_to_connect;
1608 + };
1609 +
1610 + #define gadget_to_renesas_usb3(_gadget) \
1611 +@@ -470,7 +471,8 @@ static void usb3_init_axi_bridge(struct renesas_usb3 *usb3)
1612 + static void usb3_init_epc_registers(struct renesas_usb3 *usb3)
1613 + {
1614 + usb3_write(usb3, ~0, USB3_USB_INT_STA_1);
1615 +- usb3_enable_irq_1(usb3, USB_INT_1_VBUS_CNG);
1616 ++ if (!usb3->workaround_for_vbus)
1617 ++ usb3_enable_irq_1(usb3, USB_INT_1_VBUS_CNG);
1618 + }
1619 +
1620 + static bool usb3_wakeup_usb2_phy(struct renesas_usb3 *usb3)
1621 +@@ -676,8 +678,7 @@ static void usb3_mode_config(struct renesas_usb3 *usb3, bool host, bool a_dev)
1622 + usb3_set_mode(usb3, host);
1623 + usb3_vbus_out(usb3, a_dev);
1624 + /* for A-Peripheral or forced B-device mode */
1625 +- if ((!host && a_dev) ||
1626 +- (usb3->workaround_for_vbus && usb3->forced_b_device))
1627 ++ if ((!host && a_dev) || usb3->start_to_connect)
1628 + usb3_connect(usb3);
1629 + spin_unlock_irqrestore(&usb3->lock, flags);
1630 + }
1631 +@@ -2369,7 +2370,11 @@ static ssize_t renesas_usb3_b_device_write(struct file *file,
1632 + if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
1633 + return -EFAULT;
1634 +
1635 +- if (!strncmp(buf, "1", 1))
1636 ++ usb3->start_to_connect = false;
1637 ++ if (usb3->workaround_for_vbus && usb3->forced_b_device &&
1638 ++ !strncmp(buf, "2", 1))
1639 ++ usb3->start_to_connect = true;
1640 ++ else if (!strncmp(buf, "1", 1))
1641 + usb3->forced_b_device = true;
1642 + else
1643 + usb3->forced_b_device = false;
1644 +@@ -2377,7 +2382,7 @@ static ssize_t renesas_usb3_b_device_write(struct file *file,
1645 + if (usb3->workaround_for_vbus)
1646 + usb3_disconnect(usb3);
1647 +
1648 +- /* Let this driver call usb3_connect() anyway */
1649 ++ /* Let this driver call usb3_connect() if needed */
1650 + usb3_check_id(usb3);
1651 +
1652 + return count;
1653 +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
1654 +index 909f7ea92e0b..7e288510fd2c 100644
1655 +--- a/fs/btrfs/inode.c
1656 ++++ b/fs/btrfs/inode.c
1657 +@@ -6594,14 +6594,19 @@ fail_dir_item:
1658 + err = btrfs_del_root_ref(trans, fs_info, key.objectid,
1659 + root->root_key.objectid, parent_ino,
1660 + &local_index, name, name_len);
1661 +-
1662 ++ if (err)
1663 ++ btrfs_abort_transaction(trans, err);
1664 + } else if (add_backref) {
1665 + u64 local_index;
1666 + int err;
1667 +
1668 + err = btrfs_del_inode_ref(trans, root, name, name_len,
1669 + ino, parent_ino, &local_index);
1670 ++ if (err)
1671 ++ btrfs_abort_transaction(trans, err);
1672 + }
1673 ++
1674 ++ /* Return the original error code */
1675 + return ret;
1676 + }
1677 +
1678 +diff --git a/fs/cifs/Kconfig b/fs/cifs/Kconfig
1679 +index 7b95e7971d18..a78c4133724c 100644
1680 +--- a/fs/cifs/Kconfig
1681 ++++ b/fs/cifs/Kconfig
1682 +@@ -66,9 +66,24 @@ config CIFS_STATS2
1683 + Unless you are a developer or are doing network performance analysis
1684 + or tuning, say N.
1685 +
1686 ++config CIFS_ALLOW_INSECURE_LEGACY
1687 ++ bool "Support legacy servers which use less secure dialects"
1688 ++ depends on CIFS
1689 ++ default y
1690 ++ help
1691 ++ Modern dialects, SMB2.1 and later (including SMB3 and 3.1.1), have
1692 ++ additional security features, including protection against
1693 ++ man-in-the-middle attacks and stronger crypto hashes, so the use
1694 ++ of legacy dialects (SMB1/CIFS and SMB2.0) is discouraged.
1695 ++
1696 ++ Disabling this option prevents users from using vers=1.0 or vers=2.0
1697 ++ on mounts with cifs.ko
1698 ++
1699 ++ If unsure, say Y.
1700 ++
1701 + config CIFS_WEAK_PW_HASH
1702 + bool "Support legacy servers which use weaker LANMAN security"
1703 +- depends on CIFS
1704 ++ depends on CIFS && CIFS_ALLOW_INSECURE_LEGACY
1705 + help
1706 + Modern CIFS servers including Samba and most Windows versions
1707 + (since 1997) support stronger NTLM (and even NTLMv2 and Kerberos)
1708 +diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
1709 +index fd24c72bd2cd..d6248137c219 100644
1710 +--- a/fs/cifs/connect.c
1711 ++++ b/fs/cifs/connect.c
1712 +@@ -1130,6 +1130,7 @@ cifs_parse_smb_version(char *value, struct smb_vol *vol)
1713 + substring_t args[MAX_OPT_ARGS];
1714 +
1715 + switch (match_token(value, cifs_smb_version_tokens, args)) {
1716 ++#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
1717 + case Smb_1:
1718 + vol->ops = &smb1_operations;
1719 + vol->vals = &smb1_values;
1720 +@@ -1138,6 +1139,14 @@ cifs_parse_smb_version(char *value, struct smb_vol *vol)
1721 + vol->ops = &smb20_operations;
1722 + vol->vals = &smb20_values;
1723 + break;
1724 ++#else
1725 ++ case Smb_1:
1726 ++ cifs_dbg(VFS, "vers=1.0 (cifs) mount not permitted when legacy dialects disabled\n");
1727 ++ return 1;
1728 ++ case Smb_20:
1729 ++ cifs_dbg(VFS, "vers=2.0 mount not permitted when legacy dialects disabled\n");
1730 ++ return 1;
1731 ++#endif /* CIFS_ALLOW_INSECURE_LEGACY */
1732 + case Smb_21:
1733 + vol->ops = &smb21_operations;
1734 + vol->vals = &smb21_values;
1735 +diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
1736 +index bc00cc385b77..83340496645b 100644
1737 +--- a/fs/jffs2/super.c
1738 ++++ b/fs/jffs2/super.c
1739 +@@ -101,7 +101,8 @@ static int jffs2_sync_fs(struct super_block *sb, int wait)
1740 + struct jffs2_sb_info *c = JFFS2_SB_INFO(sb);
1741 +
1742 + #ifdef CONFIG_JFFS2_FS_WRITEBUFFER
1743 +- cancel_delayed_work_sync(&c->wbuf_dwork);
1744 ++ if (jffs2_is_writebuffered(c))
1745 ++ cancel_delayed_work_sync(&c->wbuf_dwork);
1746 + #endif
1747 +
1748 + mutex_lock(&c->alloc_sem);
1749 +diff --git a/fs/nfs/client.c b/fs/nfs/client.c
1750 +index 22880ef6d8dd..7d6ddfd60271 100644
1751 +--- a/fs/nfs/client.c
1752 ++++ b/fs/nfs/client.c
1753 +@@ -291,12 +291,23 @@ static struct nfs_client *nfs_match_client(const struct nfs_client_initdata *dat
1754 + const struct sockaddr *sap = data->addr;
1755 + struct nfs_net *nn = net_generic(data->net, nfs_net_id);
1756 +
1757 ++again:
1758 + list_for_each_entry(clp, &nn->nfs_client_list, cl_share_link) {
1759 + const struct sockaddr *clap = (struct sockaddr *)&clp->cl_addr;
1760 + /* Don't match clients that failed to initialise properly */
1761 + if (clp->cl_cons_state < 0)
1762 + continue;
1763 +
1764 ++ /* If a client is still initializing then we need to wait */
1765 ++ if (clp->cl_cons_state > NFS_CS_READY) {
1766 ++ atomic_inc(&clp->cl_count);
1767 ++ spin_unlock(&nn->nfs_client_lock);
1768 ++ nfs_wait_client_init_complete(clp);
1769 ++ nfs_put_client(clp);
1770 ++ spin_lock(&nn->nfs_client_lock);
1771 ++ goto again;
1772 ++ }
1773 ++
1774 + /* Different NFS versions cannot share the same nfs_client */
1775 + if (clp->rpc_ops != data->nfs_mod->rpc_ops)
1776 + continue;
1777 +diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
1778 +index fed9c8005c17..8f96f6548dc8 100644
1779 +--- a/fs/nfs/nfs4client.c
1780 ++++ b/fs/nfs/nfs4client.c
1781 +@@ -404,15 +404,19 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,
1782 + if (error < 0)
1783 + goto error;
1784 +
1785 +- if (!nfs4_has_session(clp))
1786 +- nfs_mark_client_ready(clp, NFS_CS_READY);
1787 +-
1788 + error = nfs4_discover_server_trunking(clp, &old);
1789 + if (error < 0)
1790 + goto error;
1791 +
1792 +- if (clp != old)
1793 ++ if (clp != old) {
1794 + clp->cl_preserve_clid = true;
1795 ++ /*
1796 ++ * Mark the client as having failed initialization so other
1797 ++ * processes walking the nfs_client_list in nfs_match_client()
1798 ++ * won't try to use it.
1799 ++ */
1800 ++ nfs_mark_client_ready(clp, -EPERM);
1801 ++ }
1802 + nfs_put_client(clp);
1803 + clear_bit(NFS_CS_TSM_POSSIBLE, &clp->cl_flags);
1804 + return old;
1805 +@@ -539,6 +543,9 @@ int nfs40_walk_client_list(struct nfs_client *new,
1806 + spin_lock(&nn->nfs_client_lock);
1807 + list_for_each_entry(pos, &nn->nfs_client_list, cl_share_link) {
1808 +
1809 ++ if (pos == new)
1810 ++ goto found;
1811 ++
1812 + status = nfs4_match_client(pos, new, &prev, nn);
1813 + if (status < 0)
1814 + goto out_unlock;
1815 +@@ -559,6 +566,7 @@ int nfs40_walk_client_list(struct nfs_client *new,
1816 + * way that a SETCLIENTID_CONFIRM to pos can succeed is
1817 + * if new and pos point to the same server:
1818 + */
1819 ++found:
1820 + atomic_inc(&pos->cl_count);
1821 + spin_unlock(&nn->nfs_client_lock);
1822 +
1823 +@@ -572,6 +580,7 @@ int nfs40_walk_client_list(struct nfs_client *new,
1824 + case 0:
1825 + nfs4_swap_callback_idents(pos, new);
1826 + pos->cl_confirm = new->cl_confirm;
1827 ++ nfs_mark_client_ready(pos, NFS_CS_READY);
1828 +
1829 + prev = NULL;
1830 + *result = pos;
1831 +diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
1832 +index fe0d1f9571bb..5d53d0d63d19 100644
1833 +--- a/fs/ocfs2/localalloc.c
1834 ++++ b/fs/ocfs2/localalloc.c
1835 +@@ -345,13 +345,18 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb)
1836 + if (num_used
1837 + || alloc->id1.bitmap1.i_used
1838 + || alloc->id1.bitmap1.i_total
1839 +- || la->la_bm_off)
1840 +- mlog(ML_ERROR, "Local alloc hasn't been recovered!\n"
1841 ++ || la->la_bm_off) {
1842 ++ mlog(ML_ERROR, "inconsistent detected, clean journal with"
1843 ++ " unrecovered local alloc, please run fsck.ocfs2!\n"
1844 + "found = %u, set = %u, taken = %u, off = %u\n",
1845 + num_used, le32_to_cpu(alloc->id1.bitmap1.i_used),
1846 + le32_to_cpu(alloc->id1.bitmap1.i_total),
1847 + OCFS2_LOCAL_ALLOC(alloc)->la_bm_off);
1848 +
1849 ++ status = -EINVAL;
1850 ++ goto bail;
1851 ++ }
1852 ++
1853 + osb->local_alloc_bh = alloc_bh;
1854 + osb->local_alloc_state = OCFS2_LA_ENABLED;
1855 +
1856 +diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
1857 +index ecdb3baa1283..11e558efd61e 100644
1858 +--- a/fs/pstore/ram_core.c
1859 ++++ b/fs/pstore/ram_core.c
1860 +@@ -488,6 +488,11 @@ static int persistent_ram_post_init(struct persistent_ram_zone *prz, u32 sig,
1861 + sig ^= PERSISTENT_RAM_SIG;
1862 +
1863 + if (prz->buffer->sig == sig) {
1864 ++ if (buffer_size(prz) == 0) {
1865 ++ pr_debug("found existing empty buffer\n");
1866 ++ return 0;
1867 ++ }
1868 ++
1869 + if (buffer_size(prz) > prz->buffer_size ||
1870 + buffer_start(prz) > buffer_size(prz))
1871 + pr_info("found existing invalid buffer, size %zu, start %zu\n",
1872 +diff --git a/fs/quota/quota.c b/fs/quota/quota.c
1873 +index 3f02bab0db4e..a89c1f05b22e 100644
1874 +--- a/fs/quota/quota.c
1875 ++++ b/fs/quota/quota.c
1876 +@@ -793,7 +793,8 @@ static int quotactl_cmd_write(int cmd)
1877 + /* Return true if quotactl command is manipulating quota on/off state */
1878 + static bool quotactl_cmd_onoff(int cmd)
1879 + {
1880 +- return (cmd == Q_QUOTAON) || (cmd == Q_QUOTAOFF);
1881 ++ return (cmd == Q_QUOTAON) || (cmd == Q_QUOTAOFF) ||
1882 ++ (cmd == Q_XQUOTAON) || (cmd == Q_XQUOTAOFF);
1883 + }
1884 +
1885 + /*
1886 +diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
1887 +index 3c1beffc861a..19240379637f 100644
1888 +--- a/include/linux/backing-dev-defs.h
1889 ++++ b/include/linux/backing-dev-defs.h
1890 +@@ -233,6 +233,14 @@ static inline void wb_get(struct bdi_writeback *wb)
1891 + */
1892 + static inline void wb_put(struct bdi_writeback *wb)
1893 + {
1894 ++ if (WARN_ON_ONCE(!wb->bdi)) {
1895 ++ /*
1896 ++ * A driver bug might cause a file to be removed before bdi was
1897 ++ * initialized.
1898 ++ */
1899 ++ return;
1900 ++ }
1901 ++
1902 + if (wb != &wb->bdi->wb)
1903 + percpu_ref_put(&wb->refcnt);
1904 + }
1905 +diff --git a/include/linux/swap.h b/include/linux/swap.h
1906 +index f02fb5db8914..4fd1ab9565ba 100644
1907 +--- a/include/linux/swap.h
1908 ++++ b/include/linux/swap.h
1909 +@@ -231,7 +231,6 @@ struct swap_info_struct {
1910 + unsigned long flags; /* SWP_USED etc: see above */
1911 + signed short prio; /* swap priority of this type */
1912 + struct plist_node list; /* entry in swap_active_head */
1913 +- struct plist_node avail_lists[MAX_NUMNODES];/* entry in swap_avail_heads */
1914 + signed char type; /* strange name for an index */
1915 + unsigned int max; /* extent of the swap_map */
1916 + unsigned char *swap_map; /* vmalloc'ed array of usage counts */
1917 +@@ -272,6 +271,16 @@ struct swap_info_struct {
1918 + */
1919 + struct work_struct discard_work; /* discard worker */
1920 + struct swap_cluster_list discard_clusters; /* discard clusters list */
1921 ++ struct plist_node avail_lists[0]; /*
1922 ++ * entries in swap_avail_heads, one
1923 ++ * entry per node.
1924 ++ * Must be last as the number of the
1925 ++ * array is nr_node_ids, which is not
1926 ++ * a fixed value so have to allocate
1927 ++ * dynamically.
1928 ++ * And it has to be an array so that
1929 ++ * plist_for_each_* can work.
1930 ++ */
1931 + };
1932 +
1933 + #ifdef CONFIG_64BIT
1934 +diff --git a/mm/page-writeback.c b/mm/page-writeback.c
1935 +index 3175ac850a53..e001de5ac50c 100644
1936 +--- a/mm/page-writeback.c
1937 ++++ b/mm/page-writeback.c
1938 +@@ -2157,6 +2157,7 @@ int write_cache_pages(struct address_space *mapping,
1939 + {
1940 + int ret = 0;
1941 + int done = 0;
1942 ++ int error;
1943 + struct pagevec pvec;
1944 + int nr_pages;
1945 + pgoff_t uninitialized_var(writeback_index);
1946 +@@ -2253,25 +2254,31 @@ continue_unlock:
1947 + goto continue_unlock;
1948 +
1949 + trace_wbc_writepage(wbc, inode_to_bdi(mapping->host));
1950 +- ret = (*writepage)(page, wbc, data);
1951 +- if (unlikely(ret)) {
1952 +- if (ret == AOP_WRITEPAGE_ACTIVATE) {
1953 ++ error = (*writepage)(page, wbc, data);
1954 ++ if (unlikely(error)) {
1955 ++ /*
1956 ++ * Handle errors according to the type of
1957 ++ * writeback. There's no need to continue for
1958 ++ * background writeback. Just push done_index
1959 ++ * past this page so media errors won't choke
1960 ++ * writeout for the entire file. For integrity
1961 ++ * writeback, we must process the entire dirty
1962 ++ * set regardless of errors because the fs may
1963 ++ * still have state to clear for each page. In
1964 ++ * that case we continue processing and return
1965 ++ * the first error.
1966 ++ */
1967 ++ if (error == AOP_WRITEPAGE_ACTIVATE) {
1968 + unlock_page(page);
1969 +- ret = 0;
1970 +- } else {
1971 +- /*
1972 +- * done_index is set past this page,
1973 +- * so media errors will not choke
1974 +- * background writeout for the entire
1975 +- * file. This has consequences for
1976 +- * range_cyclic semantics (ie. it may
1977 +- * not be suitable for data integrity
1978 +- * writeout).
1979 +- */
1980 ++ error = 0;
1981 ++ } else if (wbc->sync_mode != WB_SYNC_ALL) {
1982 ++ ret = error;
1983 + done_index = page->index + 1;
1984 + done = 1;
1985 + break;
1986 + }
1987 ++ if (!ret)
1988 ++ ret = error;
1989 + }
1990 +
1991 + /*
1992 +diff --git a/mm/swapfile.c b/mm/swapfile.c
1993 +index af3c4c5a0b4e..4f9e522643a2 100644
1994 +--- a/mm/swapfile.c
1995 ++++ b/mm/swapfile.c
1996 +@@ -2830,8 +2830,9 @@ static struct swap_info_struct *alloc_swap_info(void)
1997 + struct swap_info_struct *p;
1998 + unsigned int type;
1999 + int i;
2000 ++ int size = sizeof(*p) + nr_node_ids * sizeof(struct plist_node);
2001 +
2002 +- p = kvzalloc(sizeof(*p), GFP_KERNEL);
2003 ++ p = kvzalloc(size, GFP_KERNEL);
2004 + if (!p)
2005 + return ERR_PTR(-ENOMEM);
2006 +
2007 +diff --git a/net/core/skbuff.c b/net/core/skbuff.c
2008 +index 4067fa3fcbb2..873032d1a083 100644
2009 +--- a/net/core/skbuff.c
2010 ++++ b/net/core/skbuff.c
2011 +@@ -5154,7 +5154,6 @@ struct sk_buff *alloc_skb_with_frags(unsigned long header_len,
2012 + unsigned long chunk;
2013 + struct sk_buff *skb;
2014 + struct page *page;
2015 +- gfp_t gfp_head;
2016 + int i;
2017 +
2018 + *errcode = -EMSGSIZE;
2019 +@@ -5164,12 +5163,8 @@ struct sk_buff *alloc_skb_with_frags(unsigned long header_len,
2020 + if (npages > MAX_SKB_FRAGS)
2021 + return NULL;
2022 +
2023 +- gfp_head = gfp_mask;
2024 +- if (gfp_head & __GFP_DIRECT_RECLAIM)
2025 +- gfp_head |= __GFP_RETRY_MAYFAIL;
2026 +-
2027 + *errcode = -ENOBUFS;
2028 +- skb = alloc_skb(header_len, gfp_head);
2029 ++ skb = alloc_skb(header_len, gfp_mask);
2030 + if (!skb)
2031 + return NULL;
2032 +
2033 +diff --git a/net/core/sock.c b/net/core/sock.c
2034 +index 01cae48d6eef..a88579589946 100644
2035 +--- a/net/core/sock.c
2036 ++++ b/net/core/sock.c
2037 +@@ -735,6 +735,7 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
2038 + break;
2039 + case SO_DONTROUTE:
2040 + sock_valbool_flag(sk, SOCK_LOCALROUTE, valbool);
2041 ++ sk_dst_reset(sk);
2042 + break;
2043 + case SO_BROADCAST:
2044 + sock_valbool_flag(sk, SOCK_BROADCAST, valbool);
2045 +diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
2046 +index cc7c9d67ac19..45f21489f515 100644
2047 +--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
2048 ++++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
2049 +@@ -492,7 +492,8 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par)
2050 + if (IS_ERR(config))
2051 + return PTR_ERR(config);
2052 + }
2053 +- }
2054 ++ } else if (memcmp(&config->clustermac, &cipinfo->clustermac, ETH_ALEN))
2055 ++ return -EINVAL;
2056 +
2057 + ret = nf_ct_netns_get(par->net, par->family);
2058 + if (ret < 0) {
2059 +diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
2060 +index 9ccbf74deb99..b1ed9254a4b6 100644
2061 +--- a/net/ipv6/af_inet6.c
2062 ++++ b/net/ipv6/af_inet6.c
2063 +@@ -317,6 +317,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
2064 +
2065 + /* Check if the address belongs to the host. */
2066 + if (addr_type == IPV6_ADDR_MAPPED) {
2067 ++ struct net_device *dev = NULL;
2068 + int chk_addr_ret;
2069 +
2070 + /* Binding to v4-mapped address on a v6-only socket
2071 +@@ -327,9 +328,20 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
2072 + goto out;
2073 + }
2074 +
2075 ++ rcu_read_lock();
2076 ++ if (sk->sk_bound_dev_if) {
2077 ++ dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if);
2078 ++ if (!dev) {
2079 ++ err = -ENODEV;
2080 ++ goto out_unlock;
2081 ++ }
2082 ++ }
2083 ++
2084 + /* Reproduce AF_INET checks to make the bindings consistent */
2085 + v4addr = addr->sin6_addr.s6_addr32[3];
2086 +- chk_addr_ret = inet_addr_type(net, v4addr);
2087 ++ chk_addr_ret = inet_addr_type_dev_table(net, dev, v4addr);
2088 ++ rcu_read_unlock();
2089 ++
2090 + if (!net->ipv4.sysctl_ip_nonlocal_bind &&
2091 + !(inet->freebind || inet->transparent) &&
2092 + v4addr != htonl(INADDR_ANY) &&
2093 +diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
2094 +index c410d257da06..0c7800112ff5 100644
2095 +--- a/scripts/kconfig/zconf.l
2096 ++++ b/scripts/kconfig/zconf.l
2097 +@@ -71,7 +71,7 @@ static void warn_ignored_character(char chr)
2098 + {
2099 + fprintf(stderr,
2100 + "%s:%d:warning: ignoring unsupported character '%c'\n",
2101 +- zconf_curname(), zconf_lineno(), chr);
2102 ++ current_file->name, yylineno, chr);
2103 + }
2104 + %}
2105 +
2106 +@@ -191,6 +191,8 @@ n [A-Za-z0-9_-]
2107 + }
2108 + <<EOF>> {
2109 + BEGIN(INITIAL);
2110 ++ yylval.string = text;
2111 ++ return T_WORD_QUOTE;
2112 + }
2113 + }
2114 +
2115 +diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
2116 +index f5d304736852..d6b9ed34ceae 100644
2117 +--- a/security/selinux/hooks.c
2118 ++++ b/security/selinux/hooks.c
2119 +@@ -2820,7 +2820,7 @@ static int selinux_sb_kern_mount(struct super_block *sb, int flags, void *data)
2120 + return rc;
2121 +
2122 + /* Allow all mounts performed by the kernel */
2123 +- if (flags & MS_KERNMOUNT)
2124 ++ if (flags & (MS_KERNMOUNT | MS_SUBMOUNT))
2125 + return 0;
2126 +
2127 + ad.type = LSM_AUDIT_DATA_DENTRY;
2128 +diff --git a/sound/firewire/Kconfig b/sound/firewire/Kconfig
2129 +index 529d9f405fa9..0cb65d0864cc 100644
2130 +--- a/sound/firewire/Kconfig
2131 ++++ b/sound/firewire/Kconfig
2132 +@@ -41,6 +41,7 @@ config SND_OXFW
2133 + * Mackie(Loud) U.420/U.420d
2134 + * TASCAM FireOne
2135 + * Stanton Controllers & Systems 1 Deck/Mixer
2136 ++ * APOGEE duet FireWire
2137 +
2138 + To compile this driver as a module, choose M here: the module
2139 + will be called snd-oxfw.
2140 +diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c
2141 +index 93676354f87f..de4af8a41ff0 100644
2142 +--- a/sound/firewire/bebob/bebob.c
2143 ++++ b/sound/firewire/bebob/bebob.c
2144 +@@ -434,7 +434,7 @@ static const struct ieee1394_device_id bebob_id_table[] = {
2145 + /* Apogee Electronics, DA/AD/DD-16X (X-FireWire card) */
2146 + SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x00010048, &spec_normal),
2147 + /* Apogee Electronics, Ensemble */
2148 +- SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x00001eee, &spec_normal),
2149 ++ SND_BEBOB_DEV_ENTRY(VEN_APOGEE, 0x01eeee, &spec_normal),
2150 + /* ESI, Quatafire610 */
2151 + SND_BEBOB_DEV_ENTRY(VEN_ESI, 0x00010064, &spec_normal),
2152 + /* AcousticReality, eARMasterOne */
2153 +diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
2154 +index a315d5b6b86b..1554dc98e092 100644
2155 +--- a/sound/firewire/oxfw/oxfw.c
2156 ++++ b/sound/firewire/oxfw/oxfw.c
2157 +@@ -20,6 +20,7 @@
2158 + #define VENDOR_LACIE 0x00d04b
2159 + #define VENDOR_TASCAM 0x00022e
2160 + #define OUI_STANTON 0x001260
2161 ++#define OUI_APOGEE 0x0003db
2162 +
2163 + #define MODEL_SATELLITE 0x00200f
2164 +
2165 +@@ -442,6 +443,13 @@ static const struct ieee1394_device_id oxfw_id_table[] = {
2166 + .vendor_id = OUI_STANTON,
2167 + .model_id = 0x002000,
2168 + },
2169 ++ // APOGEE, duet FireWire
2170 ++ {
2171 ++ .match_flags = IEEE1394_MATCH_VENDOR_ID |
2172 ++ IEEE1394_MATCH_MODEL_ID,
2173 ++ .vendor_id = OUI_APOGEE,
2174 ++ .model_id = 0x01dddd,
2175 ++ },
2176 + { }
2177 + };
2178 + MODULE_DEVICE_TABLE(ieee1394, oxfw_id_table);
2179 +diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile
2180 +index 95563b8e1ad7..ed61fb3a46c0 100644
2181 +--- a/tools/lib/subcmd/Makefile
2182 ++++ b/tools/lib/subcmd/Makefile
2183 +@@ -36,8 +36,6 @@ endif
2184 + CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
2185 +
2186 + CFLAGS += -I$(srctree)/tools/include/
2187 +-CFLAGS += -I$(srctree)/include/uapi
2188 +-CFLAGS += -I$(srctree)/include
2189 +
2190 + SUBCMD_IN := $(OUTPUT)libsubcmd-in.o
2191 +
2192 +diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
2193 +index db0ba8caf5a2..ba8ecaf52200 100644
2194 +--- a/tools/perf/arch/x86/util/intel-pt.c
2195 ++++ b/tools/perf/arch/x86/util/intel-pt.c
2196 +@@ -524,10 +524,21 @@ static int intel_pt_validate_config(struct perf_pmu *intel_pt_pmu,
2197 + struct perf_evsel *evsel)
2198 + {
2199 + int err;
2200 ++ char c;
2201 +
2202 + if (!evsel)
2203 + return 0;
2204 +
2205 ++ /*
2206 ++ * If supported, force pass-through config term (pt=1) even if user
2207 ++ * sets pt=0, which avoids senseless kernel errors.
2208 ++ */
2209 ++ if (perf_pmu__scan_file(intel_pt_pmu, "format/pt", "%c", &c) == 1 &&
2210 ++ !(evsel->attr.config & 1)) {
2211 ++ pr_warning("pt=0 doesn't make sense, forcing pt=1\n");
2212 ++ evsel->attr.config |= 1;
2213 ++ }
2214 ++
2215 + err = intel_pt_val_config_term(intel_pt_pmu, "caps/cycle_thresholds",
2216 + "cyc_thresh", "caps/psb_cyc",
2217 + evsel->attr.config);
2218 +diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
2219 +index 53f620472151..d0b92d374ba9 100644
2220 +--- a/tools/perf/util/parse-events.c
2221 ++++ b/tools/perf/util/parse-events.c
2222 +@@ -2300,7 +2300,7 @@ restart:
2223 + if (!name_only && strlen(syms->alias))
2224 + snprintf(name, MAX_NAME_LEN, "%s OR %s", syms->symbol, syms->alias);
2225 + else
2226 +- strncpy(name, syms->symbol, MAX_NAME_LEN);
2227 ++ strlcpy(name, syms->symbol, MAX_NAME_LEN);
2228 +
2229 + evt_list[evt_i] = strdup(name);
2230 + if (evt_list[evt_i] == NULL)
2231 +diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c
2232 +index 1cbada2dc6be..f735ee038713 100644
2233 +--- a/tools/perf/util/svghelper.c
2234 ++++ b/tools/perf/util/svghelper.c
2235 +@@ -334,7 +334,7 @@ static char *cpu_model(void)
2236 + if (file) {
2237 + while (fgets(buf, 255, file)) {
2238 + if (strstr(buf, "model name")) {
2239 +- strncpy(cpu_m, &buf[13], 255);
2240 ++ strlcpy(cpu_m, &buf[13], 255);
2241 + break;
2242 + }
2243 + }
2244 +diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
2245 +index e81bd28bdd89..8f32d699d6c5 100644
2246 +--- a/tools/testing/selftests/kselftest_harness.h
2247 ++++ b/tools/testing/selftests/kselftest_harness.h
2248 +@@ -330,7 +330,7 @@
2249 + * ASSERT_EQ(expected, measured): expected == measured
2250 + */
2251 + #define ASSERT_EQ(expected, seen) \
2252 +- __EXPECT(expected, seen, ==, 1)
2253 ++ __EXPECT(expected, #expected, seen, #seen, ==, 1)
2254 +
2255 + /**
2256 + * ASSERT_NE(expected, seen)
2257 +@@ -341,7 +341,7 @@
2258 + * ASSERT_NE(expected, measured): expected != measured
2259 + */
2260 + #define ASSERT_NE(expected, seen) \
2261 +- __EXPECT(expected, seen, !=, 1)
2262 ++ __EXPECT(expected, #expected, seen, #seen, !=, 1)
2263 +
2264 + /**
2265 + * ASSERT_LT(expected, seen)
2266 +@@ -352,7 +352,7 @@
2267 + * ASSERT_LT(expected, measured): expected < measured
2268 + */
2269 + #define ASSERT_LT(expected, seen) \
2270 +- __EXPECT(expected, seen, <, 1)
2271 ++ __EXPECT(expected, #expected, seen, #seen, <, 1)
2272 +
2273 + /**
2274 + * ASSERT_LE(expected, seen)
2275 +@@ -363,7 +363,7 @@
2276 + * ASSERT_LE(expected, measured): expected <= measured
2277 + */
2278 + #define ASSERT_LE(expected, seen) \
2279 +- __EXPECT(expected, seen, <=, 1)
2280 ++ __EXPECT(expected, #expected, seen, #seen, <=, 1)
2281 +
2282 + /**
2283 + * ASSERT_GT(expected, seen)
2284 +@@ -374,7 +374,7 @@
2285 + * ASSERT_GT(expected, measured): expected > measured
2286 + */
2287 + #define ASSERT_GT(expected, seen) \
2288 +- __EXPECT(expected, seen, >, 1)
2289 ++ __EXPECT(expected, #expected, seen, #seen, >, 1)
2290 +
2291 + /**
2292 + * ASSERT_GE(expected, seen)
2293 +@@ -385,7 +385,7 @@
2294 + * ASSERT_GE(expected, measured): expected >= measured
2295 + */
2296 + #define ASSERT_GE(expected, seen) \
2297 +- __EXPECT(expected, seen, >=, 1)
2298 ++ __EXPECT(expected, #expected, seen, #seen, >=, 1)
2299 +
2300 + /**
2301 + * ASSERT_NULL(seen)
2302 +@@ -395,7 +395,7 @@
2303 + * ASSERT_NULL(measured): NULL == measured
2304 + */
2305 + #define ASSERT_NULL(seen) \
2306 +- __EXPECT(NULL, seen, ==, 1)
2307 ++ __EXPECT(NULL, "NULL", seen, #seen, ==, 1)
2308 +
2309 + /**
2310 + * ASSERT_TRUE(seen)
2311 +@@ -405,7 +405,7 @@
2312 + * ASSERT_TRUE(measured): measured != 0
2313 + */
2314 + #define ASSERT_TRUE(seen) \
2315 +- ASSERT_NE(0, seen)
2316 ++ __EXPECT(0, "0", seen, #seen, !=, 1)
2317 +
2318 + /**
2319 + * ASSERT_FALSE(seen)
2320 +@@ -415,7 +415,7 @@
2321 + * ASSERT_FALSE(measured): measured == 0
2322 + */
2323 + #define ASSERT_FALSE(seen) \
2324 +- ASSERT_EQ(0, seen)
2325 ++ __EXPECT(0, "0", seen, #seen, ==, 1)
2326 +
2327 + /**
2328 + * ASSERT_STREQ(expected, seen)
2329 +@@ -448,7 +448,7 @@
2330 + * EXPECT_EQ(expected, measured): expected == measured
2331 + */
2332 + #define EXPECT_EQ(expected, seen) \
2333 +- __EXPECT(expected, seen, ==, 0)
2334 ++ __EXPECT(expected, #expected, seen, #seen, ==, 0)
2335 +
2336 + /**
2337 + * EXPECT_NE(expected, seen)
2338 +@@ -459,7 +459,7 @@
2339 + * EXPECT_NE(expected, measured): expected != measured
2340 + */
2341 + #define EXPECT_NE(expected, seen) \
2342 +- __EXPECT(expected, seen, !=, 0)
2343 ++ __EXPECT(expected, #expected, seen, #seen, !=, 0)
2344 +
2345 + /**
2346 + * EXPECT_LT(expected, seen)
2347 +@@ -470,7 +470,7 @@
2348 + * EXPECT_LT(expected, measured): expected < measured
2349 + */
2350 + #define EXPECT_LT(expected, seen) \
2351 +- __EXPECT(expected, seen, <, 0)
2352 ++ __EXPECT(expected, #expected, seen, #seen, <, 0)
2353 +
2354 + /**
2355 + * EXPECT_LE(expected, seen)
2356 +@@ -481,7 +481,7 @@
2357 + * EXPECT_LE(expected, measured): expected <= measured
2358 + */
2359 + #define EXPECT_LE(expected, seen) \
2360 +- __EXPECT(expected, seen, <=, 0)
2361 ++ __EXPECT(expected, #expected, seen, #seen, <=, 0)
2362 +
2363 + /**
2364 + * EXPECT_GT(expected, seen)
2365 +@@ -492,7 +492,7 @@
2366 + * EXPECT_GT(expected, measured): expected > measured
2367 + */
2368 + #define EXPECT_GT(expected, seen) \
2369 +- __EXPECT(expected, seen, >, 0)
2370 ++ __EXPECT(expected, #expected, seen, #seen, >, 0)
2371 +
2372 + /**
2373 + * EXPECT_GE(expected, seen)
2374 +@@ -503,7 +503,7 @@
2375 + * EXPECT_GE(expected, measured): expected >= measured
2376 + */
2377 + #define EXPECT_GE(expected, seen) \
2378 +- __EXPECT(expected, seen, >=, 0)
2379 ++ __EXPECT(expected, #expected, seen, #seen, >=, 0)
2380 +
2381 + /**
2382 + * EXPECT_NULL(seen)
2383 +@@ -513,7 +513,7 @@
2384 + * EXPECT_NULL(measured): NULL == measured
2385 + */
2386 + #define EXPECT_NULL(seen) \
2387 +- __EXPECT(NULL, seen, ==, 0)
2388 ++ __EXPECT(NULL, "NULL", seen, #seen, ==, 0)
2389 +
2390 + /**
2391 + * EXPECT_TRUE(seen)
2392 +@@ -523,7 +523,7 @@
2393 + * EXPECT_TRUE(measured): 0 != measured
2394 + */
2395 + #define EXPECT_TRUE(seen) \
2396 +- EXPECT_NE(0, seen)
2397 ++ __EXPECT(0, "0", seen, #seen, !=, 0)
2398 +
2399 + /**
2400 + * EXPECT_FALSE(seen)
2401 +@@ -533,7 +533,7 @@
2402 + * EXPECT_FALSE(measured): 0 == measured
2403 + */
2404 + #define EXPECT_FALSE(seen) \
2405 +- EXPECT_EQ(0, seen)
2406 ++ __EXPECT(0, "0", seen, #seen, ==, 0)
2407 +
2408 + /**
2409 + * EXPECT_STREQ(expected, seen)
2410 +@@ -573,7 +573,7 @@
2411 + if (_metadata->passed && _metadata->step < 255) \
2412 + _metadata->step++;
2413 +
2414 +-#define __EXPECT(_expected, _seen, _t, _assert) do { \
2415 ++#define __EXPECT(_expected, _expected_str, _seen, _seen_str, _t, _assert) do { \
2416 + /* Avoid multiple evaluation of the cases */ \
2417 + __typeof__(_expected) __exp = (_expected); \
2418 + __typeof__(_seen) __seen = (_seen); \
2419 +@@ -582,8 +582,8 @@
2420 + unsigned long long __exp_print = (uintptr_t)__exp; \
2421 + unsigned long long __seen_print = (uintptr_t)__seen; \
2422 + __TH_LOG("Expected %s (%llu) %s %s (%llu)", \
2423 +- #_expected, __exp_print, #_t, \
2424 +- #_seen, __seen_print); \
2425 ++ _expected_str, __exp_print, #_t, \
2426 ++ _seen_str, __seen_print); \
2427 + _metadata->passed = 0; \
2428 + /* Ensure the optional handler is triggered */ \
2429 + _metadata->trigger = 1; \