Magellan Linux

Annotation of /trunk/kernel-alx/patches-5.4/0192-5.4.93-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3635 - (hide annotations) (download)
Mon Oct 24 12:34:12 2022 UTC (19 months, 1 week ago) by niro
File size: 83242 byte(s)
-sync kernel patches
1 niro 3635 diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
2     index 74ba077e99e56..a19ae163c0589 100644
3     --- a/Documentation/admin-guide/kernel-parameters.txt
4     +++ b/Documentation/admin-guide/kernel-parameters.txt
5     @@ -5452,6 +5452,10 @@
6     This option is obsoleted by the "nopv" option, which
7     has equivalent effect for XEN platform.
8    
9     + xen_no_vector_callback
10     + [KNL,X86,XEN] Disable the vector callback for Xen
11     + event channel interrupts.
12     +
13     xen_scrub_pages= [XEN]
14     Boolean option to control scrubbing pages before giving them back
15     to Xen, for use by other domains. Can be also changed at runtime
16     diff --git a/Makefile b/Makefile
17     index 5bae2206a35e7..f8462f8d8a151 100644
18     --- a/Makefile
19     +++ b/Makefile
20     @@ -1,7 +1,7 @@
21     # SPDX-License-Identifier: GPL-2.0
22     VERSION = 5
23     PATCHLEVEL = 4
24     -SUBLEVEL = 92
25     +SUBLEVEL = 93
26     EXTRAVERSION =
27     NAME = Kleptomaniac Octopus
28    
29     diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
30     index dd6804a64f1a0..f45bff158fc20 100644
31     --- a/arch/arm/xen/enlighten.c
32     +++ b/arch/arm/xen/enlighten.c
33     @@ -371,7 +371,7 @@ static int __init xen_guest_init(void)
34     }
35     gnttab_init();
36     if (!xen_initial_domain())
37     - xenbus_probe(NULL);
38     + xenbus_probe();
39    
40     /*
41     * Making sure board specific code will not set up ops for
42     diff --git a/arch/arm64/include/asm/atomic.h b/arch/arm64/include/asm/atomic.h
43     index 9543b5e0534d2..6e0f48ddfc656 100644
44     --- a/arch/arm64/include/asm/atomic.h
45     +++ b/arch/arm64/include/asm/atomic.h
46     @@ -17,7 +17,7 @@
47     #include <asm/lse.h>
48    
49     #define ATOMIC_OP(op) \
50     -static inline void arch_##op(int i, atomic_t *v) \
51     +static __always_inline void arch_##op(int i, atomic_t *v) \
52     { \
53     __lse_ll_sc_body(op, i, v); \
54     }
55     @@ -32,7 +32,7 @@ ATOMIC_OP(atomic_sub)
56     #undef ATOMIC_OP
57    
58     #define ATOMIC_FETCH_OP(name, op) \
59     -static inline int arch_##op##name(int i, atomic_t *v) \
60     +static __always_inline int arch_##op##name(int i, atomic_t *v) \
61     { \
62     return __lse_ll_sc_body(op##name, i, v); \
63     }
64     @@ -56,7 +56,7 @@ ATOMIC_FETCH_OPS(atomic_sub_return)
65     #undef ATOMIC_FETCH_OPS
66    
67     #define ATOMIC64_OP(op) \
68     -static inline void arch_##op(long i, atomic64_t *v) \
69     +static __always_inline void arch_##op(long i, atomic64_t *v) \
70     { \
71     __lse_ll_sc_body(op, i, v); \
72     }
73     @@ -71,7 +71,7 @@ ATOMIC64_OP(atomic64_sub)
74     #undef ATOMIC64_OP
75    
76     #define ATOMIC64_FETCH_OP(name, op) \
77     -static inline long arch_##op##name(long i, atomic64_t *v) \
78     +static __always_inline long arch_##op##name(long i, atomic64_t *v) \
79     { \
80     return __lse_ll_sc_body(op##name, i, v); \
81     }
82     @@ -94,7 +94,7 @@ ATOMIC64_FETCH_OPS(atomic64_sub_return)
83     #undef ATOMIC64_FETCH_OP
84     #undef ATOMIC64_FETCH_OPS
85    
86     -static inline long arch_atomic64_dec_if_positive(atomic64_t *v)
87     +static __always_inline long arch_atomic64_dec_if_positive(atomic64_t *v)
88     {
89     return __lse_ll_sc_body(atomic64_dec_if_positive, v);
90     }
91     diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
92     index 4def51c12e1bf..a4e576019d79c 100644
93     --- a/arch/powerpc/kernel/vmlinux.lds.S
94     +++ b/arch/powerpc/kernel/vmlinux.lds.S
95     @@ -210,6 +210,12 @@ SECTIONS
96     .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
97     _sinittext = .;
98     INIT_TEXT
99     +
100     + /*
101     + *.init.text might be RO so we must ensure this section ends on
102     + * a page boundary.
103     + */
104     + . = ALIGN(PAGE_SIZE);
105     _einittext = .;
106     #ifdef CONFIG_PPC64
107     *(.tramp.ftrace.init);
108     @@ -223,21 +229,9 @@ SECTIONS
109     EXIT_TEXT
110     }
111    
112     - .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
113     - INIT_DATA
114     - }
115     -
116     - .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
117     - INIT_SETUP(16)
118     - }
119     + . = ALIGN(PAGE_SIZE);
120    
121     - .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
122     - INIT_CALLS
123     - }
124     -
125     - .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
126     - CON_INITCALL
127     - }
128     + INIT_DATA_SECTION(16)
129    
130     . = ALIGN(8);
131     __ftr_fixup : AT(ADDR(__ftr_fixup) - LOAD_OFFSET) {
132     @@ -265,9 +259,6 @@ SECTIONS
133     __stop___fw_ftr_fixup = .;
134     }
135     #endif
136     - .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
137     - INIT_RAM_FS
138     - }
139    
140     PERCPU_SECTION(L1_CACHE_BYTES)
141    
142     diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
143     index 88cfcb96bf233..cc04e66752aac 100644
144     --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
145     +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
146     @@ -83,6 +83,7 @@
147     phy-mode = "gmii";
148     phy-handle = <&phy0>;
149     phy0: ethernet-phy@0 {
150     + compatible = "ethernet-phy-id0007.0771";
151     reg = <0>;
152     };
153     };
154     diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
155     index 420a0dbef3866..3c656fe97e583 100644
156     --- a/arch/riscv/configs/defconfig
157     +++ b/arch/riscv/configs/defconfig
158     @@ -62,6 +62,8 @@ CONFIG_HW_RANDOM=y
159     CONFIG_HW_RANDOM_VIRTIO=y
160     CONFIG_SPI=y
161     CONFIG_SPI_SIFIVE=y
162     +CONFIG_GPIOLIB=y
163     +CONFIG_GPIO_SIFIVE=y
164     # CONFIG_PTP_1588_CLOCK is not set
165     CONFIG_DRM=y
166     CONFIG_DRM_RADEON=y
167     diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
168     index 6a53c02e9c734..8aa70b519e04f 100644
169     --- a/arch/riscv/kernel/time.c
170     +++ b/arch/riscv/kernel/time.c
171     @@ -4,6 +4,7 @@
172     * Copyright (C) 2017 SiFive
173     */
174    
175     +#include <linux/of_clk.h>
176     #include <linux/clocksource.h>
177     #include <linux/delay.h>
178     #include <asm/sbi.h>
179     @@ -24,5 +25,7 @@ void __init time_init(void)
180     riscv_timebase = prop;
181    
182     lpj_fine = riscv_timebase / HZ;
183     +
184     + of_clk_init(NULL);
185     timer_probe();
186     }
187     diff --git a/arch/sh/drivers/dma/Kconfig b/arch/sh/drivers/dma/Kconfig
188     index d0de378beefe5..7d54f284ce10f 100644
189     --- a/arch/sh/drivers/dma/Kconfig
190     +++ b/arch/sh/drivers/dma/Kconfig
191     @@ -63,8 +63,7 @@ config PVR2_DMA
192    
193     config G2_DMA
194     tristate "G2 Bus DMA support"
195     - depends on SH_DREAMCAST
196     - select SH_DMA_API
197     + depends on SH_DREAMCAST && SH_DMA_API
198     help
199     This enables support for the DMA controller for the Dreamcast's
200     G2 bus. Drivers that want this will generally enable this on
201     diff --git a/arch/x86/include/asm/fpu/api.h b/arch/x86/include/asm/fpu/api.h
202     index b774c52e5411f..06e767bca0c14 100644
203     --- a/arch/x86/include/asm/fpu/api.h
204     +++ b/arch/x86/include/asm/fpu/api.h
205     @@ -16,14 +16,25 @@
206     * Use kernel_fpu_begin/end() if you intend to use FPU in kernel context. It
207     * disables preemption so be careful if you intend to use it for long periods
208     * of time.
209     - * If you intend to use the FPU in softirq you need to check first with
210     + * If you intend to use the FPU in irq/softirq you need to check first with
211     * irq_fpu_usable() if it is possible.
212     */
213     -extern void kernel_fpu_begin(void);
214     +
215     +/* Kernel FPU states to initialize in kernel_fpu_begin_mask() */
216     +#define KFPU_387 _BITUL(0) /* 387 state will be initialized */
217     +#define KFPU_MXCSR _BITUL(1) /* MXCSR will be initialized */
218     +
219     +extern void kernel_fpu_begin_mask(unsigned int kfpu_mask);
220     extern void kernel_fpu_end(void);
221     extern bool irq_fpu_usable(void);
222     extern void fpregs_mark_activate(void);
223    
224     +/* Code that is unaware of kernel_fpu_begin_mask() can use this */
225     +static inline void kernel_fpu_begin(void)
226     +{
227     + kernel_fpu_begin_mask(KFPU_387 | KFPU_MXCSR);
228     +}
229     +
230     /*
231     * Use fpregs_lock() while editing CPU's FPU registers or fpu->state.
232     * A context switch will (and softirq might) save CPU's FPU registers to
233     diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
234     index 4b14d2318251e..f3459df117aa8 100644
235     --- a/arch/x86/include/asm/topology.h
236     +++ b/arch/x86/include/asm/topology.h
237     @@ -110,6 +110,8 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu);
238     #define topology_die_id(cpu) (cpu_data(cpu).cpu_die_id)
239     #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id)
240    
241     +extern unsigned int __max_die_per_package;
242     +
243     #ifdef CONFIG_SMP
244     #define topology_die_cpumask(cpu) (per_cpu(cpu_die_map, cpu))
245     #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
246     @@ -118,8 +120,6 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu);
247     extern unsigned int __max_logical_packages;
248     #define topology_max_packages() (__max_logical_packages)
249    
250     -extern unsigned int __max_die_per_package;
251     -
252     static inline int topology_max_die_per_package(void)
253     {
254     return __max_die_per_package;
255     diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
256     index 52373921af2eb..753f3dfbc9c91 100644
257     --- a/arch/x86/kernel/cpu/amd.c
258     +++ b/arch/x86/kernel/cpu/amd.c
259     @@ -545,12 +545,12 @@ static void bsp_init_amd(struct cpuinfo_x86 *c)
260     u32 ecx;
261    
262     ecx = cpuid_ecx(0x8000001e);
263     - nodes_per_socket = ((ecx >> 8) & 7) + 1;
264     + __max_die_per_package = nodes_per_socket = ((ecx >> 8) & 7) + 1;
265     } else if (boot_cpu_has(X86_FEATURE_NODEID_MSR)) {
266     u64 value;
267    
268     rdmsrl(MSR_FAM10H_NODE_ID, value);
269     - nodes_per_socket = ((value >> 3) & 7) + 1;
270     + __max_die_per_package = nodes_per_socket = ((value >> 3) & 7) + 1;
271     }
272    
273     if (!boot_cpu_has(X86_FEATURE_AMD_SSBD) &&
274     diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c
275     index ee48c3fc8a65e..24da5ee4f0220 100644
276     --- a/arch/x86/kernel/cpu/topology.c
277     +++ b/arch/x86/kernel/cpu/topology.c
278     @@ -25,10 +25,10 @@
279     #define BITS_SHIFT_NEXT_LEVEL(eax) ((eax) & 0x1f)
280     #define LEVEL_MAX_SIBLINGS(ebx) ((ebx) & 0xffff)
281    
282     -#ifdef CONFIG_SMP
283     unsigned int __max_die_per_package __read_mostly = 1;
284     EXPORT_SYMBOL(__max_die_per_package);
285    
286     +#ifdef CONFIG_SMP
287     /*
288     * Check if given CPUID extended toplogy "leaf" is implemented
289     */
290     diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
291     index cd8839027f66d..8c9b202f3e6db 100644
292     --- a/arch/x86/kernel/fpu/core.c
293     +++ b/arch/x86/kernel/fpu/core.c
294     @@ -82,7 +82,7 @@ bool irq_fpu_usable(void)
295     }
296     EXPORT_SYMBOL(irq_fpu_usable);
297    
298     -void kernel_fpu_begin(void)
299     +void kernel_fpu_begin_mask(unsigned int kfpu_mask)
300     {
301     preempt_disable();
302    
303     @@ -102,13 +102,14 @@ void kernel_fpu_begin(void)
304     }
305     __cpu_invalidate_fpregs_state();
306    
307     - if (boot_cpu_has(X86_FEATURE_XMM))
308     + /* Put sane initial values into the control registers. */
309     + if (likely(kfpu_mask & KFPU_MXCSR) && boot_cpu_has(X86_FEATURE_XMM))
310     ldmxcsr(MXCSR_DEFAULT);
311    
312     - if (boot_cpu_has(X86_FEATURE_FPU))
313     + if (unlikely(kfpu_mask & KFPU_387) && boot_cpu_has(X86_FEATURE_FPU))
314     asm volatile ("fninit");
315     }
316     -EXPORT_SYMBOL_GPL(kernel_fpu_begin);
317     +EXPORT_SYMBOL_GPL(kernel_fpu_begin_mask);
318    
319     void kernel_fpu_end(void)
320     {
321     diff --git a/arch/x86/lib/mmx_32.c b/arch/x86/lib/mmx_32.c
322     index 4321fa02e18df..419365c48b2ad 100644
323     --- a/arch/x86/lib/mmx_32.c
324     +++ b/arch/x86/lib/mmx_32.c
325     @@ -26,6 +26,16 @@
326     #include <asm/fpu/api.h>
327     #include <asm/asm.h>
328    
329     +/*
330     + * Use KFPU_387. MMX instructions are not affected by MXCSR,
331     + * but both AMD and Intel documentation states that even integer MMX
332     + * operations will result in #MF if an exception is pending in FCW.
333     + *
334     + * EMMS is not needed afterwards because, after calling kernel_fpu_end(),
335     + * any subsequent user of the 387 stack will reinitialize it using
336     + * KFPU_387.
337     + */
338     +
339     void *_mmx_memcpy(void *to, const void *from, size_t len)
340     {
341     void *p;
342     @@ -37,7 +47,7 @@ void *_mmx_memcpy(void *to, const void *from, size_t len)
343     p = to;
344     i = len >> 6; /* len/64 */
345    
346     - kernel_fpu_begin();
347     + kernel_fpu_begin_mask(KFPU_387);
348    
349     __asm__ __volatile__ (
350     "1: prefetch (%0)\n" /* This set is 28 bytes */
351     @@ -127,7 +137,7 @@ static void fast_clear_page(void *page)
352     {
353     int i;
354    
355     - kernel_fpu_begin();
356     + kernel_fpu_begin_mask(KFPU_387);
357    
358     __asm__ __volatile__ (
359     " pxor %%mm0, %%mm0\n" : :
360     @@ -160,7 +170,7 @@ static void fast_copy_page(void *to, void *from)
361     {
362     int i;
363    
364     - kernel_fpu_begin();
365     + kernel_fpu_begin_mask(KFPU_387);
366    
367     /*
368     * maybe the prefetch stuff can go before the expensive fnsave...
369     @@ -247,7 +257,7 @@ static void fast_clear_page(void *page)
370     {
371     int i;
372    
373     - kernel_fpu_begin();
374     + kernel_fpu_begin_mask(KFPU_387);
375    
376     __asm__ __volatile__ (
377     " pxor %%mm0, %%mm0\n" : :
378     @@ -282,7 +292,7 @@ static void fast_copy_page(void *to, void *from)
379     {
380     int i;
381    
382     - kernel_fpu_begin();
383     + kernel_fpu_begin_mask(KFPU_387);
384    
385     __asm__ __volatile__ (
386     "1: prefetch (%0)\n"
387     diff --git a/arch/x86/xen/enlighten_hvm.c b/arch/x86/xen/enlighten_hvm.c
388     index e138f7de52d20..6024fafed1642 100644
389     --- a/arch/x86/xen/enlighten_hvm.c
390     +++ b/arch/x86/xen/enlighten_hvm.c
391     @@ -175,6 +175,8 @@ static int xen_cpu_dead_hvm(unsigned int cpu)
392     return 0;
393     }
394    
395     +static bool no_vector_callback __initdata;
396     +
397     static void __init xen_hvm_guest_init(void)
398     {
399     if (xen_pv_domain())
400     @@ -194,7 +196,7 @@ static void __init xen_hvm_guest_init(void)
401    
402     xen_panic_handler_init();
403    
404     - if (xen_feature(XENFEAT_hvm_callback_vector))
405     + if (!no_vector_callback && xen_feature(XENFEAT_hvm_callback_vector))
406     xen_have_vector_callback = 1;
407    
408     xen_hvm_smp_init();
409     @@ -220,6 +222,13 @@ static __init int xen_parse_nopv(char *arg)
410     }
411     early_param("xen_nopv", xen_parse_nopv);
412    
413     +static __init int xen_parse_no_vector_callback(char *arg)
414     +{
415     + no_vector_callback = true;
416     + return 0;
417     +}
418     +early_param("xen_no_vector_callback", xen_parse_no_vector_callback);
419     +
420     bool __init xen_hvm_need_lapic(void)
421     {
422     if (xen_pv_domain())
423     diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
424     index 6c8c9509e03d1..8887a72712d4b 100644
425     --- a/drivers/acpi/scan.c
426     +++ b/drivers/acpi/scan.c
427     @@ -587,6 +587,8 @@ static int acpi_get_device_data(acpi_handle handle, struct acpi_device **device,
428     if (!device)
429     return -EINVAL;
430    
431     + *device = NULL;
432     +
433     status = acpi_get_data_full(handle, acpi_scan_drop_device,
434     (void **)device, callback);
435     if (ACPI_FAILURE(status) || !*device) {
436     diff --git a/drivers/base/core.c b/drivers/base/core.c
437     index c5edb00938f69..a119479fe3f42 100644
438     --- a/drivers/base/core.c
439     +++ b/drivers/base/core.c
440     @@ -106,6 +106,16 @@ int device_links_read_lock_held(void)
441     #endif
442     #endif /* !CONFIG_SRCU */
443    
444     +static bool device_is_ancestor(struct device *dev, struct device *target)
445     +{
446     + while (target->parent) {
447     + target = target->parent;
448     + if (dev == target)
449     + return true;
450     + }
451     + return false;
452     +}
453     +
454     /**
455     * device_is_dependent - Check if one device depends on another one
456     * @dev: Device to check dependencies for.
457     @@ -119,7 +129,12 @@ static int device_is_dependent(struct device *dev, void *target)
458     struct device_link *link;
459     int ret;
460    
461     - if (dev == target)
462     + /*
463     + * The "ancestors" check is needed to catch the case when the target
464     + * device has not been completely initialized yet and it is still
465     + * missing from the list of children of its parent device.
466     + */
467     + if (dev == target || device_is_ancestor(dev, target))
468     return 1;
469    
470     ret = device_for_each_child(dev, target, device_is_dependent);
471     diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c
472     index 7b4c6a488527d..501929d9f70ed 100644
473     --- a/drivers/clk/tegra/clk-tegra30.c
474     +++ b/drivers/clk/tegra/clk-tegra30.c
475     @@ -1263,6 +1263,8 @@ static struct tegra_clk_init_table init_table[] __initdata = {
476     { TEGRA30_CLK_I2S3_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
477     { TEGRA30_CLK_I2S4_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
478     { TEGRA30_CLK_VIMCLK_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
479     + { TEGRA30_CLK_HDA, TEGRA30_CLK_PLL_P, 102000000, 0 },
480     + { TEGRA30_CLK_HDA2CODEC_2X, TEGRA30_CLK_PLL_P, 48000000, 0 },
481     /* must be the last entry */
482     { TEGRA30_CLK_CLK_MAX, TEGRA30_CLK_CLK_MAX, 0, 0 },
483     };
484     diff --git a/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h b/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h
485     index 74a9fe8e0cfb9..8c54f0be51bab 100644
486     --- a/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h
487     +++ b/drivers/gpu/drm/amd/amdgpu/psp_gfx_if.h
488     @@ -44,7 +44,7 @@ enum psp_gfx_crtl_cmd_id
489     GFX_CTRL_CMD_ID_DISABLE_INT = 0x00060000, /* disable PSP-to-Gfx interrupt */
490     GFX_CTRL_CMD_ID_MODE1_RST = 0x00070000, /* trigger the Mode 1 reset */
491     GFX_CTRL_CMD_ID_GBR_IH_SET = 0x00080000, /* set Gbr IH_RB_CNTL registers */
492     - GFX_CTRL_CMD_ID_CONSUME_CMD = 0x000A0000, /* send interrupt to psp for updating write pointer of vf */
493     + GFX_CTRL_CMD_ID_CONSUME_CMD = 0x00090000, /* send interrupt to psp for updating write pointer of vf */
494     GFX_CTRL_CMD_ID_DESTROY_GPCOM_RING = 0x000C0000, /* destroy GPCOM ring */
495    
496     GFX_CTRL_CMD_ID_MAX = 0x000F0000, /* max command ID */
497     diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
498     index a549c7c717ddc..f0b001b3af578 100644
499     --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
500     +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c
501     @@ -113,7 +113,7 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc,
502     mutex_lock(&adev->dm.dc_lock);
503    
504     /* Enable CRTC CRC generation if necessary. */
505     - if (dm_is_crc_source_crtc(source)) {
506     + if (dm_is_crc_source_crtc(source) || source == AMDGPU_DM_PIPE_CRC_SOURCE_NONE) {
507     if (!dc_stream_configure_crc(stream_state->ctx->dc,
508     stream_state, enable, enable)) {
509     ret = -EINVAL;
510     diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
511     index 2dd2cd87cdbb3..5e906ea6df67d 100644
512     --- a/drivers/gpu/drm/drm_atomic_helper.c
513     +++ b/drivers/gpu/drm/drm_atomic_helper.c
514     @@ -2948,7 +2948,7 @@ int drm_atomic_helper_set_config(struct drm_mode_set *set,
515    
516     ret = handle_conflicting_encoders(state, true);
517     if (ret)
518     - return ret;
519     + goto fail;
520    
521     ret = drm_atomic_commit(state);
522    
523     diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
524     index 4b5c7b0ed7148..8fdb271354061 100644
525     --- a/drivers/gpu/drm/drm_syncobj.c
526     +++ b/drivers/gpu/drm/drm_syncobj.c
527     @@ -326,19 +326,18 @@ int drm_syncobj_find_fence(struct drm_file *file_private,
528     return -ENOENT;
529    
530     *fence = drm_syncobj_fence_get(syncobj);
531     - drm_syncobj_put(syncobj);
532    
533     if (*fence) {
534     ret = dma_fence_chain_find_seqno(fence, point);
535     if (!ret)
536     - return 0;
537     + goto out;
538     dma_fence_put(*fence);
539     } else {
540     ret = -EINVAL;
541     }
542    
543     if (!(flags & DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT))
544     - return ret;
545     + goto out;
546    
547     memset(&wait, 0, sizeof(wait));
548     wait.task = current;
549     @@ -370,6 +369,9 @@ int drm_syncobj_find_fence(struct drm_file *file_private,
550     if (wait.node.next)
551     drm_syncobj_remove_wait(syncobj, &wait);
552    
553     +out:
554     + drm_syncobj_put(syncobj);
555     +
556     return ret;
557     }
558     EXPORT_SYMBOL(drm_syncobj_find_fence);
559     diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
560     index 2fa491f826824..398068b173891 100644
561     --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
562     +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
563     @@ -2245,6 +2245,9 @@ err:
564     static void lrc_destroy_wa_ctx(struct intel_engine_cs *engine)
565     {
566     i915_vma_unpin_and_release(&engine->wa_ctx.vma, 0);
567     +
568     + /* Called on error unwind, clear all flags to prevent further use */
569     + memset(&engine->wa_ctx, 0, sizeof(engine->wa_ctx));
570     }
571    
572     typedef u32 *(*wa_bb_func_t)(struct intel_engine_cs *engine, u32 *batch);
573     diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
574     index ee2b1e1199e09..daa79d39201f9 100644
575     --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
576     +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
577     @@ -132,7 +132,7 @@ nv50_dmac_destroy(struct nv50_dmac *dmac)
578    
579     int
580     nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
581     - const s32 *oclass, u8 head, void *data, u32 size, u64 syncbuf,
582     + const s32 *oclass, u8 head, void *data, u32 size, s64 syncbuf,
583     struct nv50_dmac *dmac)
584     {
585     struct nouveau_cli *cli = (void *)device->object.client;
586     @@ -167,7 +167,7 @@ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
587     if (ret)
588     return ret;
589    
590     - if (!syncbuf)
591     + if (syncbuf < 0)
592     return 0;
593    
594     ret = nvif_object_init(&dmac->base.user, 0xf0000000, NV_DMA_IN_MEMORY,
595     diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.h b/drivers/gpu/drm/nouveau/dispnv50/disp.h
596     index 7c41b0599d1ac..284068fa6d007 100644
597     --- a/drivers/gpu/drm/nouveau/dispnv50/disp.h
598     +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.h
599     @@ -70,7 +70,7 @@ struct nv50_dmac {
600    
601     int nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
602     const s32 *oclass, u8 head, void *data, u32 size,
603     - u64 syncbuf, struct nv50_dmac *dmac);
604     + s64 syncbuf, struct nv50_dmac *dmac);
605     void nv50_dmac_destroy(struct nv50_dmac *);
606    
607     u32 *evo_wait(struct nv50_dmac *, int nr);
608     diff --git a/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c b/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
609     index f7dbd965e4e72..b49a212af4d8d 100644
610     --- a/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
611     +++ b/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
612     @@ -68,7 +68,7 @@ wimmc37b_init_(const struct nv50_wimm_func *func, struct nouveau_drm *drm,
613     int ret;
614    
615     ret = nv50_dmac_create(&drm->client.device, &disp->disp->object,
616     - &oclass, 0, &args, sizeof(args), 0,
617     + &oclass, 0, &args, sizeof(args), -1,
618     &wndw->wimm);
619     if (ret) {
620     NV_ERROR(drm, "wimm%04x allocation failed: %d\n", oclass, ret);
621     diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
622     index 7deb81b6dbac6..4b571cc6bc70f 100644
623     --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
624     +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
625     @@ -75,7 +75,7 @@ shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd)
626     nvkm_debug(subdev, "%08x: type %02x, %d bytes\n",
627     image.base, image.type, image.size);
628    
629     - if (!shadow_fetch(bios, mthd, image.size)) {
630     + if (!shadow_fetch(bios, mthd, image.base + image.size)) {
631     nvkm_debug(subdev, "%08x: fetch failed\n", image.base);
632     return 0;
633     }
634     diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
635     index edb6148cbca04..d0e80ad526845 100644
636     --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
637     +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
638     @@ -33,7 +33,7 @@ static void
639     gm200_i2c_aux_fini(struct gm200_i2c_aux *aux)
640     {
641     struct nvkm_device *device = aux->base.pad->i2c->subdev.device;
642     - nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00310000, 0x00000000);
643     + nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00710000, 0x00000000);
644     }
645    
646     static int
647     @@ -54,10 +54,10 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux)
648     AUX_ERR(&aux->base, "begin idle timeout %08x", ctrl);
649     return -EBUSY;
650     }
651     - } while (ctrl & 0x03010000);
652     + } while (ctrl & 0x07010000);
653    
654     /* set some magic, and wait up to 1ms for it to appear */
655     - nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00300000, ureq);
656     + nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00700000, ureq);
657     timeout = 1000;
658     do {
659     ctrl = nvkm_rd32(device, 0x00d954 + (aux->ch * 0x50));
660     @@ -67,7 +67,7 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux)
661     gm200_i2c_aux_fini(aux);
662     return -EBUSY;
663     }
664     - } while ((ctrl & 0x03000000) != urep);
665     + } while ((ctrl & 0x07000000) != urep);
666    
667     return 0;
668     }
669     diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c
670     index d80dbc8f09b20..55a4ea4393c62 100644
671     --- a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c
672     +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c
673     @@ -22,6 +22,7 @@
674     * Authors: Ben Skeggs
675     */
676     #include "priv.h"
677     +#include <subdev/timer.h>
678    
679     static void
680     gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
681     @@ -31,7 +32,6 @@ gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
682     u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0400));
683     u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0400));
684     nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat);
685     - nvkm_mask(device, 0x122128 + (i * 0x0400), 0x00000200, 0x00000000);
686     }
687    
688     static void
689     @@ -42,7 +42,6 @@ gf100_ibus_intr_rop(struct nvkm_subdev *ibus, int i)
690     u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0400));
691     u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0400));
692     nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat);
693     - nvkm_mask(device, 0x124128 + (i * 0x0400), 0x00000200, 0x00000000);
694     }
695    
696     static void
697     @@ -53,7 +52,6 @@ gf100_ibus_intr_gpc(struct nvkm_subdev *ibus, int i)
698     u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0400));
699     u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0400));
700     nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat);
701     - nvkm_mask(device, 0x128128 + (i * 0x0400), 0x00000200, 0x00000000);
702     }
703    
704     void
705     @@ -90,6 +88,12 @@ gf100_ibus_intr(struct nvkm_subdev *ibus)
706     intr1 &= ~stat;
707     }
708     }
709     +
710     + nvkm_mask(device, 0x121c4c, 0x0000003f, 0x00000002);
711     + nvkm_msec(device, 2000,
712     + if (!(nvkm_rd32(device, 0x121c4c) & 0x0000003f))
713     + break;
714     + );
715     }
716    
717     static int
718     diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c
719     index 9025ed1bd2a99..4caf3ef087e1d 100644
720     --- a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c
721     +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c
722     @@ -22,6 +22,7 @@
723     * Authors: Ben Skeggs
724     */
725     #include "priv.h"
726     +#include <subdev/timer.h>
727    
728     static void
729     gk104_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
730     @@ -31,7 +32,6 @@ gk104_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
731     u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0800));
732     u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0800));
733     nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat);
734     - nvkm_mask(device, 0x122128 + (i * 0x0800), 0x00000200, 0x00000000);
735     }
736    
737     static void
738     @@ -42,7 +42,6 @@ gk104_ibus_intr_rop(struct nvkm_subdev *ibus, int i)
739     u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0800));
740     u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0800));
741     nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat);
742     - nvkm_mask(device, 0x124128 + (i * 0x0800), 0x00000200, 0x00000000);
743     }
744    
745     static void
746     @@ -53,7 +52,6 @@ gk104_ibus_intr_gpc(struct nvkm_subdev *ibus, int i)
747     u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0800));
748     u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0800));
749     nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat);
750     - nvkm_mask(device, 0x128128 + (i * 0x0800), 0x00000200, 0x00000000);
751     }
752    
753     void
754     @@ -90,6 +88,12 @@ gk104_ibus_intr(struct nvkm_subdev *ibus)
755     intr1 &= ~stat;
756     }
757     }
758     +
759     + nvkm_mask(device, 0x12004c, 0x0000003f, 0x00000002);
760     + nvkm_msec(device, 2000,
761     + if (!(nvkm_rd32(device, 0x12004c) & 0x0000003f))
762     + break;
763     + );
764     }
765    
766     static int
767     diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
768     index ee11ccaf0563c..cb51e248cb41b 100644
769     --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
770     +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
771     @@ -316,9 +316,9 @@ nvkm_mmu_vram(struct nvkm_mmu *mmu)
772     {
773     struct nvkm_device *device = mmu->subdev.device;
774     struct nvkm_mm *mm = &device->fb->ram->vram;
775     - const u32 sizeN = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NORMAL);
776     - const u32 sizeU = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NOMAP);
777     - const u32 sizeM = nvkm_mm_heap_size(mm, NVKM_RAM_MM_MIXED);
778     + const u64 sizeN = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NORMAL);
779     + const u64 sizeU = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NOMAP);
780     + const u64 sizeM = nvkm_mm_heap_size(mm, NVKM_RAM_MM_MIXED);
781     u8 type = NVKM_MEM_KIND * !!mmu->func->kind;
782     u8 heap = NVKM_MEM_VRAM;
783     int heapM, heapN, heapU;
784     diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
785     index 2aa810665a78c..33183933337af 100644
786     --- a/drivers/hid/hid-ids.h
787     +++ b/drivers/hid/hid-ids.h
788     @@ -393,6 +393,7 @@
789     #define USB_DEVICE_ID_TOSHIBA_CLICK_L9W 0x0401
790     #define USB_DEVICE_ID_HP_X2 0x074d
791     #define USB_DEVICE_ID_HP_X2_10_COVER 0x0755
792     +#define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706
793    
794     #define USB_VENDOR_ID_ELECOM 0x056e
795     #define USB_DEVICE_ID_ELECOM_BM084 0x0061
796     diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
797     index b2da8476d0d30..ec08895e7b1dc 100644
798     --- a/drivers/hid/hid-input.c
799     +++ b/drivers/hid/hid-input.c
800     @@ -322,6 +322,8 @@ static const struct hid_device_id hid_battery_quirks[] = {
801     { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH,
802     USB_DEVICE_ID_LOGITECH_DINOVO_EDGE_KBD),
803     HID_BATTERY_QUIRK_IGNORE },
804     + { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN),
805     + HID_BATTERY_QUIRK_IGNORE },
806     {}
807     };
808    
809     diff --git a/drivers/hid/hid-logitech-dj.c b/drivers/hid/hid-logitech-dj.c
810     index 54d811fdcdb44..e5550a5bf49d0 100644
811     --- a/drivers/hid/hid-logitech-dj.c
812     +++ b/drivers/hid/hid-logitech-dj.c
813     @@ -1862,6 +1862,10 @@ static const struct hid_device_id logi_dj_receivers[] = {
814     HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
815     0xc531),
816     .driver_data = recvr_type_gaming_hidpp},
817     + { /* Logitech G602 receiver (0xc537) */
818     + HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
819     + 0xc537),
820     + .driver_data = recvr_type_gaming_hidpp},
821     { /* Logitech lightspeed receiver (0xc539) */
822     HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH,
823     USB_DEVICE_ID_LOGITECH_NANO_RECEIVER_LIGHTSPEED_1),
824     diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
825     index 128d8f4319b9f..d91e6679afb18 100644
826     --- a/drivers/hid/hid-multitouch.c
827     +++ b/drivers/hid/hid-multitouch.c
828     @@ -2084,6 +2084,10 @@ static const struct hid_device_id mt_devices[] = {
829     HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
830     USB_VENDOR_ID_SYNAPTICS, 0xce08) },
831    
832     + { .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
833     + HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
834     + USB_VENDOR_ID_SYNAPTICS, 0xce09) },
835     +
836     /* TopSeed panels */
837     { .driver_data = MT_CLS_TOPSEED,
838     MT_USB_DEVICE(USB_VENDOR_ID_TOPSEED2,
839     diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c
840     index 21fdf0b935166..d7d99acac52f2 100644
841     --- a/drivers/hwtracing/intel_th/pci.c
842     +++ b/drivers/hwtracing/intel_th/pci.c
843     @@ -258,6 +258,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
844     PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4b26),
845     .driver_data = (kernel_ulong_t)&intel_th_2x,
846     },
847     + {
848     + /* Alder Lake-P */
849     + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x51a6),
850     + .driver_data = (kernel_ulong_t)&intel_th_2x,
851     + },
852     {
853     /* Emmitsburg PCH */
854     PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x1bcc),
855     diff --git a/drivers/hwtracing/stm/heartbeat.c b/drivers/hwtracing/stm/heartbeat.c
856     index 3e7df1c0477f7..81d7b21d31ec2 100644
857     --- a/drivers/hwtracing/stm/heartbeat.c
858     +++ b/drivers/hwtracing/stm/heartbeat.c
859     @@ -64,7 +64,7 @@ static void stm_heartbeat_unlink(struct stm_source_data *data)
860    
861     static int stm_heartbeat_init(void)
862     {
863     - int i, ret = -ENOMEM;
864     + int i, ret;
865    
866     if (nr_devs < 0 || nr_devs > STM_HEARTBEAT_MAX)
867     return -EINVAL;
868     @@ -72,8 +72,10 @@ static int stm_heartbeat_init(void)
869     for (i = 0; i < nr_devs; i++) {
870     stm_heartbeat[i].data.name =
871     kasprintf(GFP_KERNEL, "heartbeat.%d", i);
872     - if (!stm_heartbeat[i].data.name)
873     + if (!stm_heartbeat[i].data.name) {
874     + ret = -ENOMEM;
875     goto fail_unregister;
876     + }
877    
878     stm_heartbeat[i].data.nr_chans = 1;
879     stm_heartbeat[i].data.link = stm_heartbeat_link;
880     diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c
881     index d9607905dc2f1..845eda70b8cab 100644
882     --- a/drivers/i2c/busses/i2c-octeon-core.c
883     +++ b/drivers/i2c/busses/i2c-octeon-core.c
884     @@ -347,7 +347,7 @@ static int octeon_i2c_read(struct octeon_i2c *i2c, int target,
885     if (result)
886     return result;
887     if (recv_len && i == 0) {
888     - if (data[i] > I2C_SMBUS_BLOCK_MAX + 1)
889     + if (data[i] > I2C_SMBUS_BLOCK_MAX)
890     return -EPROTO;
891     length += data[i];
892     }
893     diff --git a/drivers/i2c/busses/i2c-tegra-bpmp.c b/drivers/i2c/busses/i2c-tegra-bpmp.c
894     index ec7a7e917eddb..c0c7d01473f2b 100644
895     --- a/drivers/i2c/busses/i2c-tegra-bpmp.c
896     +++ b/drivers/i2c/busses/i2c-tegra-bpmp.c
897     @@ -80,7 +80,7 @@ static int tegra_bpmp_xlate_flags(u16 flags, u16 *out)
898     flags &= ~I2C_M_RECV_LEN;
899     }
900    
901     - return (flags != 0) ? -EINVAL : 0;
902     + return 0;
903     }
904    
905     /**
906     diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c
907     index c64e6898ff20a..d1ffc8cb08ed6 100644
908     --- a/drivers/iio/dac/ad5504.c
909     +++ b/drivers/iio/dac/ad5504.c
910     @@ -188,9 +188,9 @@ static ssize_t ad5504_write_dac_powerdown(struct iio_dev *indio_dev,
911     return ret;
912    
913     if (pwr_down)
914     - st->pwr_down_mask |= (1 << chan->channel);
915     - else
916     st->pwr_down_mask &= ~(1 << chan->channel);
917     + else
918     + st->pwr_down_mask |= (1 << chan->channel);
919    
920     ret = ad5504_spi_write(st, AD5504_ADDR_CTRL,
921     AD5504_DAC_PWRDWN_MODE(st->pwr_down_mode) |
922     diff --git a/drivers/irqchip/irq-mips-cpu.c b/drivers/irqchip/irq-mips-cpu.c
923     index 95d4fd8f7a968..0bbb0b2d0dd5f 100644
924     --- a/drivers/irqchip/irq-mips-cpu.c
925     +++ b/drivers/irqchip/irq-mips-cpu.c
926     @@ -197,6 +197,13 @@ static int mips_cpu_ipi_alloc(struct irq_domain *domain, unsigned int virq,
927     if (ret)
928     return ret;
929    
930     + ret = irq_domain_set_hwirq_and_chip(domain->parent, virq + i, hwirq,
931     + &mips_mt_cpu_irq_controller,
932     + NULL);
933     +
934     + if (ret)
935     + return ret;
936     +
937     ret = irq_set_irq_type(virq + i, IRQ_TYPE_LEVEL_HIGH);
938     if (ret)
939     return ret;
940     diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
941     index a2ebc75af8c79..4714aa936b2a2 100644
942     --- a/drivers/lightnvm/core.c
943     +++ b/drivers/lightnvm/core.c
944     @@ -849,11 +849,10 @@ static int nvm_bb_chunk_sense(struct nvm_dev *dev, struct ppa_addr ppa)
945     rqd.ppa_addr = generic_to_dev_addr(dev, ppa);
946    
947     ret = nvm_submit_io_sync_raw(dev, &rqd);
948     + __free_page(page);
949     if (ret)
950     return ret;
951    
952     - __free_page(page);
953     -
954     return rqd.error;
955     }
956    
957     diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig
958     index aa98953f4462e..7dd6e98257c72 100644
959     --- a/drivers/md/Kconfig
960     +++ b/drivers/md/Kconfig
961     @@ -565,6 +565,7 @@ config DM_INTEGRITY
962     select BLK_DEV_INTEGRITY
963     select DM_BUFIO
964     select CRYPTO
965     + select CRYPTO_SKCIPHER
966     select ASYNC_XOR
967     ---help---
968     This device-mapper target emulates a block device that has
969     diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
970     index 25efe382e78fa..57f66f2ad98dc 100644
971     --- a/drivers/md/dm-integrity.c
972     +++ b/drivers/md/dm-integrity.c
973     @@ -4059,6 +4059,12 @@ try_smaller_buffer:
974     r = -ENOMEM;
975     goto bad;
976     }
977     + } else {
978     + if (ic->sb->flags & cpu_to_le32(SB_FLAG_RECALCULATING)) {
979     + ti->error = "Recalculate can only be specified with internal_hash";
980     + r = -EINVAL;
981     + goto bad;
982     + }
983     }
984    
985     ic->bufio = dm_bufio_client_create(ic->meta_dev ? ic->meta_dev->bdev : ic->dev->bdev,
986     diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
987     index 6dd56afa048c2..98be040cf958c 100644
988     --- a/drivers/md/dm-table.c
989     +++ b/drivers/md/dm-table.c
990     @@ -428,14 +428,23 @@ int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode,
991     {
992     int r;
993     dev_t dev;
994     + unsigned int major, minor;
995     + char dummy;
996     struct dm_dev_internal *dd;
997     struct dm_table *t = ti->table;
998    
999     BUG_ON(!t);
1000    
1001     - dev = dm_get_dev_t(path);
1002     - if (!dev)
1003     - return -ENODEV;
1004     + if (sscanf(path, "%u:%u%c", &major, &minor, &dummy) == 2) {
1005     + /* Extract the major/minor numbers */
1006     + dev = MKDEV(major, minor);
1007     + if (MAJOR(dev) != major || MINOR(dev) != minor)
1008     + return -EOVERFLOW;
1009     + } else {
1010     + dev = dm_get_dev_t(path);
1011     + if (!dev)
1012     + return -ENODEV;
1013     + }
1014    
1015     dd = find_device(&t->devices, dev);
1016     if (!dd) {
1017     diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
1018     index 81b8d5ede484e..9cee10e44e2fc 100644
1019     --- a/drivers/mmc/core/queue.c
1020     +++ b/drivers/mmc/core/queue.c
1021     @@ -370,8 +370,10 @@ static void mmc_setup_queue(struct mmc_queue *mq, struct mmc_card *card)
1022     "merging was advertised but not possible");
1023     blk_queue_max_segments(mq->queue, mmc_get_max_segments(host));
1024    
1025     - if (mmc_card_mmc(card))
1026     + if (mmc_card_mmc(card) && card->ext_csd.data_sector_size) {
1027     block_size = card->ext_csd.data_sector_size;
1028     + WARN_ON(block_size != 512 && block_size != 4096);
1029     + }
1030    
1031     blk_queue_logical_block_size(mq->queue, block_size);
1032     /*
1033     diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c
1034     index 4703cd540c7fd..5f57e78e5f13f 100644
1035     --- a/drivers/mmc/host/sdhci-xenon.c
1036     +++ b/drivers/mmc/host/sdhci-xenon.c
1037     @@ -167,7 +167,12 @@ static void xenon_reset_exit(struct sdhci_host *host,
1038     /* Disable tuning request and auto-retuning again */
1039     xenon_retune_setup(host);
1040    
1041     - xenon_set_acg(host, true);
1042     + /*
1043     + * The ACG should be turned off at the early init time, in order
1044     + * to solve a possible issues with the 1.8V regulator stabilization.
1045     + * The feature is enabled in later stage.
1046     + */
1047     + xenon_set_acg(host, false);
1048    
1049     xenon_set_sdclk_off_idle(host, sdhc_id, false);
1050    
1051     diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
1052     index 5b8791135de13..247aeacb3a440 100644
1053     --- a/drivers/net/can/dev.c
1054     +++ b/drivers/net/can/dev.c
1055     @@ -567,11 +567,11 @@ static void can_restart(struct net_device *dev)
1056     }
1057     cf->can_id |= CAN_ERR_RESTARTED;
1058    
1059     - netif_rx_ni(skb);
1060     -
1061     stats->rx_packets++;
1062     stats->rx_bytes += cf->can_dlc;
1063    
1064     + netif_rx_ni(skb);
1065     +
1066     restart:
1067     netdev_dbg(dev, "restarted\n");
1068     priv->can_stats.restarts++;
1069     diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
1070     index dee3e689b54da..96bbdef672bc9 100644
1071     --- a/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
1072     +++ b/drivers/net/can/usb/peak_usb/pcan_usb_fd.c
1073     @@ -512,11 +512,11 @@ static int pcan_usb_fd_decode_canmsg(struct pcan_usb_fd_if *usb_if,
1074     else
1075     memcpy(cfd->data, rm->d, cfd->len);
1076    
1077     - peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(rm->ts_low));
1078     -
1079     netdev->stats.rx_packets++;
1080     netdev->stats.rx_bytes += cfd->len;
1081    
1082     + peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(rm->ts_low));
1083     +
1084     return 0;
1085     }
1086    
1087     @@ -578,11 +578,11 @@ static int pcan_usb_fd_decode_status(struct pcan_usb_fd_if *usb_if,
1088     if (!skb)
1089     return -ENOMEM;
1090    
1091     - peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(sm->ts_low));
1092     -
1093     netdev->stats.rx_packets++;
1094     netdev->stats.rx_bytes += cf->can_dlc;
1095    
1096     + peak_usb_netif_rx(skb, &usb_if->time_ref, le32_to_cpu(sm->ts_low));
1097     +
1098     return 0;
1099     }
1100    
1101     diff --git a/drivers/net/can/vxcan.c b/drivers/net/can/vxcan.c
1102     index d6ba9426be4de..b1baa4ac1d537 100644
1103     --- a/drivers/net/can/vxcan.c
1104     +++ b/drivers/net/can/vxcan.c
1105     @@ -39,6 +39,7 @@ static netdev_tx_t vxcan_xmit(struct sk_buff *skb, struct net_device *dev)
1106     struct net_device *peer;
1107     struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
1108     struct net_device_stats *peerstats, *srcstats = &dev->stats;
1109     + u8 len;
1110    
1111     if (can_dropped_invalid_skb(dev, skb))
1112     return NETDEV_TX_OK;
1113     @@ -61,12 +62,13 @@ static netdev_tx_t vxcan_xmit(struct sk_buff *skb, struct net_device *dev)
1114     skb->dev = peer;
1115     skb->ip_summed = CHECKSUM_UNNECESSARY;
1116    
1117     + len = cfd->len;
1118     if (netif_rx_ni(skb) == NET_RX_SUCCESS) {
1119     srcstats->tx_packets++;
1120     - srcstats->tx_bytes += cfd->len;
1121     + srcstats->tx_bytes += len;
1122     peerstats = &peer->stats;
1123     peerstats->rx_packets++;
1124     - peerstats->rx_bytes += cfd->len;
1125     + peerstats->rx_bytes += len;
1126     }
1127    
1128     out_unlock:
1129     diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
1130     index 4bd66ba72c03c..0b1223f360d97 100644
1131     --- a/drivers/net/dsa/b53/b53_common.c
1132     +++ b/drivers/net/dsa/b53/b53_common.c
1133     @@ -1330,7 +1330,7 @@ int b53_vlan_prepare(struct dsa_switch *ds, int port,
1134     if ((is5325(dev) || is5365(dev)) && vlan->vid_begin == 0)
1135     return -EOPNOTSUPP;
1136    
1137     - if (vlan->vid_end > dev->num_vlans)
1138     + if (vlan->vid_end >= dev->num_vlans)
1139     return -ERANGE;
1140    
1141     b53_enable_vlan(dev, true, ds->vlan_filtering);
1142     diff --git a/drivers/net/dsa/mv88e6xxx/global1_vtu.c b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
1143     index c51c01345223d..fcfda1a1cecfc 100644
1144     --- a/drivers/net/dsa/mv88e6xxx/global1_vtu.c
1145     +++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
1146     @@ -351,6 +351,10 @@ int mv88e6250_g1_vtu_getnext(struct mv88e6xxx_chip *chip,
1147     if (err)
1148     return err;
1149    
1150     + err = mv88e6185_g1_stu_data_read(chip, entry);
1151     + if (err)
1152     + return err;
1153     +
1154     /* VTU DBNum[3:0] are located in VTU Operation 3:0
1155     * VTU DBNum[5:4] are located in VTU Operation 9:8
1156     */
1157     diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
1158     index da1fd0e08c36e..6030c90d50ccb 100644
1159     --- a/drivers/net/ethernet/mscc/ocelot.c
1160     +++ b/drivers/net/ethernet/mscc/ocelot.c
1161     @@ -1716,10 +1716,8 @@ static int ocelot_netdevice_event(struct notifier_block *unused,
1162     struct net_device *dev = netdev_notifier_info_to_dev(ptr);
1163     int ret = 0;
1164    
1165     - if (!ocelot_netdevice_dev_check(dev))
1166     - return 0;
1167     -
1168     if (event == NETDEV_PRECHANGEUPPER &&
1169     + ocelot_netdevice_dev_check(dev) &&
1170     netif_is_lag_master(info->upper_dev)) {
1171     struct netdev_lag_upper_info *lag_upper_info = info->upper_info;
1172     struct netlink_ext_ack *extack;
1173     diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
1174     index 8aa1b1bda96d1..18f86e441570c 100644
1175     --- a/drivers/net/ethernet/renesas/sh_eth.c
1176     +++ b/drivers/net/ethernet/renesas/sh_eth.c
1177     @@ -2640,10 +2640,10 @@ static int sh_eth_close(struct net_device *ndev)
1178     /* Free all the skbuffs in the Rx queue and the DMA buffer. */
1179     sh_eth_ring_free(ndev);
1180    
1181     - pm_runtime_put_sync(&mdp->pdev->dev);
1182     -
1183     mdp->is_opened = 0;
1184    
1185     + pm_runtime_put(&mdp->pdev->dev);
1186     +
1187     return 0;
1188     }
1189    
1190     diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c
1191     index bb07024d22edc..0a745769e7127 100644
1192     --- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c
1193     +++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c
1194     @@ -334,7 +334,7 @@ FUNC_GROUP_DECL(RMII4, F24, E23, E24, E25, C25, C24, B26, B25, B24);
1195    
1196     #define D22 40
1197     SIG_EXPR_LIST_DECL_SESG(D22, SD1CLK, SD1, SIG_DESC_SET(SCU414, 8));
1198     -SIG_EXPR_LIST_DECL_SEMG(D22, PWM8, PWM8G0, PWM8, SIG_DESC_SET(SCU414, 8));
1199     +SIG_EXPR_LIST_DECL_SEMG(D22, PWM8, PWM8G0, PWM8, SIG_DESC_SET(SCU4B4, 8));
1200     PIN_DECL_2(D22, GPIOF0, SD1CLK, PWM8);
1201     GROUP_DECL(PWM8G0, D22);
1202    
1203     diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
1204     index 8bd0a078bfc47..61e7d938d4c5c 100644
1205     --- a/drivers/pinctrl/pinctrl-ingenic.c
1206     +++ b/drivers/pinctrl/pinctrl-ingenic.c
1207     @@ -1378,7 +1378,7 @@ static inline bool ingenic_gpio_get_value(struct ingenic_gpio_chip *jzgc,
1208     static void ingenic_gpio_set_value(struct ingenic_gpio_chip *jzgc,
1209     u8 offset, int value)
1210     {
1211     - if (jzgc->jzpc->version >= ID_JZ4760)
1212     + if (jzgc->jzpc->version >= ID_JZ4770)
1213     ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_PAT0, offset, !!value);
1214     else
1215     ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_DATA, offset, !!value);
1216     @@ -1389,7 +1389,7 @@ static void irq_set_type(struct ingenic_gpio_chip *jzgc,
1217     {
1218     u8 reg1, reg2;
1219    
1220     - if (jzgc->jzpc->version >= ID_JZ4760) {
1221     + if (jzgc->jzpc->version >= ID_JZ4770) {
1222     reg1 = JZ4760_GPIO_PAT1;
1223     reg2 = JZ4760_GPIO_PAT0;
1224     } else {
1225     @@ -1464,7 +1464,7 @@ static void ingenic_gpio_irq_enable(struct irq_data *irqd)
1226     struct ingenic_gpio_chip *jzgc = gpiochip_get_data(gc);
1227     int irq = irqd->hwirq;
1228    
1229     - if (jzgc->jzpc->version >= ID_JZ4760)
1230     + if (jzgc->jzpc->version >= ID_JZ4770)
1231     ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_INT, irq, true);
1232     else
1233     ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_SELECT, irq, true);
1234     @@ -1480,7 +1480,7 @@ static void ingenic_gpio_irq_disable(struct irq_data *irqd)
1235    
1236     ingenic_gpio_irq_mask(irqd);
1237    
1238     - if (jzgc->jzpc->version >= ID_JZ4760)
1239     + if (jzgc->jzpc->version >= ID_JZ4770)
1240     ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_INT, irq, false);
1241     else
1242     ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_SELECT, irq, false);
1243     @@ -1505,7 +1505,7 @@ static void ingenic_gpio_irq_ack(struct irq_data *irqd)
1244     irq_set_type(jzgc, irq, IRQ_TYPE_LEVEL_HIGH);
1245     }
1246    
1247     - if (jzgc->jzpc->version >= ID_JZ4760)
1248     + if (jzgc->jzpc->version >= ID_JZ4770)
1249     ingenic_gpio_set_bit(jzgc, JZ4760_GPIO_FLAG, irq, false);
1250     else
1251     ingenic_gpio_set_bit(jzgc, JZ4740_GPIO_DATA, irq, true);
1252     @@ -1562,7 +1562,7 @@ static void ingenic_gpio_irq_handler(struct irq_desc *desc)
1253    
1254     chained_irq_enter(irq_chip, desc);
1255    
1256     - if (jzgc->jzpc->version >= ID_JZ4760)
1257     + if (jzgc->jzpc->version >= ID_JZ4770)
1258     flag = ingenic_gpio_read_reg(jzgc, JZ4760_GPIO_FLAG);
1259     else
1260     flag = ingenic_gpio_read_reg(jzgc, JZ4740_GPIO_FLAG);
1261     @@ -1643,7 +1643,7 @@ static int ingenic_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
1262     struct ingenic_pinctrl *jzpc = jzgc->jzpc;
1263     unsigned int pin = gc->base + offset;
1264    
1265     - if (jzpc->version >= ID_JZ4760)
1266     + if (jzpc->version >= ID_JZ4770)
1267     return ingenic_get_pin_config(jzpc, pin, JZ4760_GPIO_INT) ||
1268     ingenic_get_pin_config(jzpc, pin, JZ4760_GPIO_PAT1);
1269    
1270     @@ -1676,7 +1676,7 @@ static int ingenic_pinmux_set_pin_fn(struct ingenic_pinctrl *jzpc,
1271     ingenic_shadow_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, func & 0x2);
1272     ingenic_shadow_config_pin(jzpc, pin, JZ4760_GPIO_PAT0, func & 0x1);
1273     ingenic_shadow_config_pin_load(jzpc, pin);
1274     - } else if (jzpc->version >= ID_JZ4760) {
1275     + } else if (jzpc->version >= ID_JZ4770) {
1276     ingenic_config_pin(jzpc, pin, JZ4760_GPIO_INT, false);
1277     ingenic_config_pin(jzpc, pin, GPIO_MSK, false);
1278     ingenic_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, func & 0x2);
1279     @@ -1684,7 +1684,7 @@ static int ingenic_pinmux_set_pin_fn(struct ingenic_pinctrl *jzpc,
1280     } else {
1281     ingenic_config_pin(jzpc, pin, JZ4740_GPIO_FUNC, true);
1282     ingenic_config_pin(jzpc, pin, JZ4740_GPIO_TRIG, func & 0x2);
1283     - ingenic_config_pin(jzpc, pin, JZ4740_GPIO_SELECT, func > 0);
1284     + ingenic_config_pin(jzpc, pin, JZ4740_GPIO_SELECT, func & 0x1);
1285     }
1286    
1287     return 0;
1288     @@ -1734,7 +1734,7 @@ static int ingenic_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev,
1289     ingenic_shadow_config_pin(jzpc, pin, GPIO_MSK, true);
1290     ingenic_shadow_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, input);
1291     ingenic_shadow_config_pin_load(jzpc, pin);
1292     - } else if (jzpc->version >= ID_JZ4760) {
1293     + } else if (jzpc->version >= ID_JZ4770) {
1294     ingenic_config_pin(jzpc, pin, JZ4760_GPIO_INT, false);
1295     ingenic_config_pin(jzpc, pin, GPIO_MSK, true);
1296     ingenic_config_pin(jzpc, pin, JZ4760_GPIO_PAT1, input);
1297     @@ -1764,7 +1764,7 @@ static int ingenic_pinconf_get(struct pinctrl_dev *pctldev,
1298     unsigned int offt = pin / PINS_PER_GPIO_CHIP;
1299     bool pull;
1300    
1301     - if (jzpc->version >= ID_JZ4760)
1302     + if (jzpc->version >= ID_JZ4770)
1303     pull = !ingenic_get_pin_config(jzpc, pin, JZ4760_GPIO_PEN);
1304     else
1305     pull = !ingenic_get_pin_config(jzpc, pin, JZ4740_GPIO_PULL_DIS);
1306     @@ -1796,7 +1796,7 @@ static int ingenic_pinconf_get(struct pinctrl_dev *pctldev,
1307     static void ingenic_set_bias(struct ingenic_pinctrl *jzpc,
1308     unsigned int pin, bool enabled)
1309     {
1310     - if (jzpc->version >= ID_JZ4760)
1311     + if (jzpc->version >= ID_JZ4770)
1312     ingenic_config_pin(jzpc, pin, JZ4760_GPIO_PEN, !enabled);
1313     else
1314     ingenic_config_pin(jzpc, pin, JZ4740_GPIO_PULL_DIS, !enabled);
1315     diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
1316     index ffb8d5d1eb5ff..f85a5c720507b 100644
1317     --- a/drivers/platform/x86/i2c-multi-instantiate.c
1318     +++ b/drivers/platform/x86/i2c-multi-instantiate.c
1319     @@ -166,13 +166,29 @@ static const struct i2c_inst_data bsg2150_data[] = {
1320     {}
1321     };
1322    
1323     -static const struct i2c_inst_data int3515_data[] = {
1324     - { "tps6598x", IRQ_RESOURCE_APIC, 0 },
1325     - { "tps6598x", IRQ_RESOURCE_APIC, 1 },
1326     - { "tps6598x", IRQ_RESOURCE_APIC, 2 },
1327     - { "tps6598x", IRQ_RESOURCE_APIC, 3 },
1328     - {}
1329     -};
1330     +/*
1331     + * Device with _HID INT3515 (TI PD controllers) has some unresolved interrupt
1332     + * issues. The most common problem seen is interrupt flood.
1333     + *
1334     + * There are at least two known causes. Firstly, on some boards, the
1335     + * I2CSerialBus resource index does not match the Interrupt resource, i.e. they
1336     + * are not one-to-one mapped like in the array below. Secondly, on some boards
1337     + * the IRQ line from the PD controller is not actually connected at all. But the
1338     + * interrupt flood is also seen on some boards where those are not a problem, so
1339     + * there are some other problems as well.
1340     + *
1341     + * Because of the issues with the interrupt, the device is disabled for now. If
1342     + * you wish to debug the issues, uncomment the below, and add an entry for the
1343     + * INT3515 device to the i2c_multi_instance_ids table.
1344     + *
1345     + * static const struct i2c_inst_data int3515_data[] = {
1346     + * { "tps6598x", IRQ_RESOURCE_APIC, 0 },
1347     + * { "tps6598x", IRQ_RESOURCE_APIC, 1 },
1348     + * { "tps6598x", IRQ_RESOURCE_APIC, 2 },
1349     + * { "tps6598x", IRQ_RESOURCE_APIC, 3 },
1350     + * { }
1351     + * };
1352     + */
1353    
1354     /*
1355     * Note new device-ids must also be added to i2c_multi_instantiate_ids in
1356     @@ -181,7 +197,6 @@ static const struct i2c_inst_data int3515_data[] = {
1357     static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = {
1358     { "BSG1160", (unsigned long)bsg1160_data },
1359     { "BSG2150", (unsigned long)bsg2150_data },
1360     - { "INT3515", (unsigned long)int3515_data },
1361     { }
1362     };
1363     MODULE_DEVICE_TABLE(acpi, i2c_multi_inst_acpi_ids);
1364     diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
1365     index 7598cd46cf606..5b81bafa5c165 100644
1366     --- a/drivers/platform/x86/ideapad-laptop.c
1367     +++ b/drivers/platform/x86/ideapad-laptop.c
1368     @@ -92,6 +92,7 @@ struct ideapad_private {
1369     struct dentry *debug;
1370     unsigned long cfg;
1371     bool has_hw_rfkill_switch;
1372     + bool has_touchpad_switch;
1373     const char *fnesc_guid;
1374     };
1375    
1376     @@ -535,7 +536,9 @@ static umode_t ideapad_is_visible(struct kobject *kobj,
1377     } else if (attr == &dev_attr_fn_lock.attr) {
1378     supported = acpi_has_method(priv->adev->handle, "HALS") &&
1379     acpi_has_method(priv->adev->handle, "SALS");
1380     - } else
1381     + } else if (attr == &dev_attr_touchpad.attr)
1382     + supported = priv->has_touchpad_switch;
1383     + else
1384     supported = true;
1385    
1386     return supported ? attr->mode : 0;
1387     @@ -867,6 +870,9 @@ static void ideapad_sync_touchpad_state(struct ideapad_private *priv)
1388     {
1389     unsigned long value;
1390    
1391     + if (!priv->has_touchpad_switch)
1392     + return;
1393     +
1394     /* Without reading from EC touchpad LED doesn't switch state */
1395     if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) {
1396     /* Some IdeaPads don't really turn off touchpad - they only
1397     @@ -989,6 +995,9 @@ static int ideapad_acpi_add(struct platform_device *pdev)
1398     priv->platform_device = pdev;
1399     priv->has_hw_rfkill_switch = dmi_check_system(hw_rfkill_list);
1400    
1401     + /* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */
1402     + priv->has_touchpad_switch = !acpi_dev_present("ELAN0634", NULL, -1);
1403     +
1404     ret = ideapad_sysfs_init(priv);
1405     if (ret)
1406     return ret;
1407     @@ -1006,6 +1015,10 @@ static int ideapad_acpi_add(struct platform_device *pdev)
1408     if (!priv->has_hw_rfkill_switch)
1409     write_ec_cmd(priv->adev->handle, VPCCMD_W_RF, 1);
1410    
1411     + /* The same for Touchpad */
1412     + if (!priv->has_touchpad_switch)
1413     + write_ec_cmd(priv->adev->handle, VPCCMD_W_TOUCHPAD, 1);
1414     +
1415     for (i = 0; i < IDEAPAD_RFKILL_DEV_NUM; i++)
1416     if (test_bit(ideapad_rfk_data[i].cfgbit, &priv->cfg))
1417     ideapad_register_rfkill(priv, i);
1418     diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c
1419     index bc8b0098d4f32..37035dca469cf 100644
1420     --- a/drivers/platform/x86/intel-vbtn.c
1421     +++ b/drivers/platform/x86/intel-vbtn.c
1422     @@ -191,12 +191,6 @@ static const struct dmi_system_id dmi_switches_allow_list[] = {
1423     DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7130"),
1424     },
1425     },
1426     - {
1427     - .matches = {
1428     - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1429     - DMI_MATCH(DMI_PRODUCT_NAME, "HP Stream x360 Convertible PC 11"),
1430     - },
1431     - },
1432     {
1433     .matches = {
1434     DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1435     diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
1436     index 4a23dd8b7f9aa..b9c1f722f1ded 100644
1437     --- a/drivers/scsi/megaraid/megaraid_sas_base.c
1438     +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
1439     @@ -8174,11 +8174,9 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
1440     goto out;
1441     }
1442    
1443     + /* always store 64 bits regardless of addressing */
1444     sense_ptr = (void *)cmd->frame + ioc->sense_off;
1445     - if (instance->consistent_mask_64bit)
1446     - put_unaligned_le64(sense_handle, sense_ptr);
1447     - else
1448     - put_unaligned_le32(sense_handle, sense_ptr);
1449     + put_unaligned_le64(sense_handle, sense_ptr);
1450     }
1451    
1452     /*
1453     diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
1454     index 35c96ea2653be..fdd966fea7f6a 100644
1455     --- a/drivers/scsi/qedi/qedi_main.c
1456     +++ b/drivers/scsi/qedi/qedi_main.c
1457     @@ -2175,7 +2175,7 @@ qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type,
1458     chap_name);
1459     break;
1460     case ISCSI_BOOT_TGT_CHAP_SECRET:
1461     - rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN,
1462     + rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN,
1463     chap_secret);
1464     break;
1465     case ISCSI_BOOT_TGT_REV_CHAP_NAME:
1466     @@ -2183,7 +2183,7 @@ qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type,
1467     mchap_name);
1468     break;
1469     case ISCSI_BOOT_TGT_REV_CHAP_SECRET:
1470     - rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN,
1471     + rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN,
1472     mchap_secret);
1473     break;
1474     case ISCSI_BOOT_TGT_FLAGS:
1475     diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
1476     index 6a2f8bacfacea..f55249766d224 100644
1477     --- a/drivers/scsi/sd.c
1478     +++ b/drivers/scsi/sd.c
1479     @@ -934,8 +934,10 @@ static blk_status_t sd_setup_write_zeroes_cmnd(struct scsi_cmnd *cmd)
1480     }
1481     }
1482    
1483     - if (sdp->no_write_same)
1484     + if (sdp->no_write_same) {
1485     + rq->rq_flags |= RQF_QUIET;
1486     return BLK_STS_TARGET;
1487     + }
1488    
1489     if (sdkp->ws16 || lba > 0xffffffff || nr_blocks > 0xffff)
1490     return sd_setup_write_same16_cmnd(cmd, false);
1491     diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
1492     index b888117f4ecd3..476ef8044ae59 100644
1493     --- a/drivers/scsi/ufs/ufshcd.c
1494     +++ b/drivers/scsi/ufs/ufshcd.c
1495     @@ -5980,19 +5980,16 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
1496     {
1497     struct Scsi_Host *host;
1498     struct ufs_hba *hba;
1499     - unsigned int tag;
1500     u32 pos;
1501     int err;
1502     - u8 resp = 0xF;
1503     - struct ufshcd_lrb *lrbp;
1504     + u8 resp = 0xF, lun;
1505     unsigned long flags;
1506    
1507     host = cmd->device->host;
1508     hba = shost_priv(host);
1509     - tag = cmd->request->tag;
1510    
1511     - lrbp = &hba->lrb[tag];
1512     - err = ufshcd_issue_tm_cmd(hba, lrbp->lun, 0, UFS_LOGICAL_RESET, &resp);
1513     + lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun);
1514     + err = ufshcd_issue_tm_cmd(hba, lun, 0, UFS_LOGICAL_RESET, &resp);
1515     if (err || resp != UPIU_TASK_MANAGEMENT_FUNC_COMPL) {
1516     if (!err)
1517     err = resp;
1518     @@ -6001,7 +5998,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
1519    
1520     /* clear the commands that were pending for corresponding LUN */
1521     for_each_set_bit(pos, &hba->outstanding_reqs, hba->nutrs) {
1522     - if (hba->lrb[pos].lun == lrbp->lun) {
1523     + if (hba->lrb[pos].lun == lun) {
1524     err = ufshcd_clear_cmd(hba, pos);
1525     if (err)
1526     break;
1527     diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
1528     index 4e9a590712cb2..e006f40ffdc04 100644
1529     --- a/drivers/tty/serial/mvebu-uart.c
1530     +++ b/drivers/tty/serial/mvebu-uart.c
1531     @@ -648,6 +648,14 @@ static void wait_for_xmitr(struct uart_port *port)
1532     (val & STAT_TX_RDY(port)), 1, 10000);
1533     }
1534    
1535     +static void wait_for_xmite(struct uart_port *port)
1536     +{
1537     + u32 val;
1538     +
1539     + readl_poll_timeout_atomic(port->membase + UART_STAT, val,
1540     + (val & STAT_TX_EMP), 1, 10000);
1541     +}
1542     +
1543     static void mvebu_uart_console_putchar(struct uart_port *port, int ch)
1544     {
1545     wait_for_xmitr(port);
1546     @@ -675,7 +683,7 @@ static void mvebu_uart_console_write(struct console *co, const char *s,
1547    
1548     uart_console_write(port, s, count, mvebu_uart_console_putchar);
1549    
1550     - wait_for_xmitr(port);
1551     + wait_for_xmite(port);
1552    
1553     if (ier)
1554     writel(ier, port->membase + UART_CTRL(port));
1555     diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c
1556     index b4343c6aa6512..6a2dc823ea828 100644
1557     --- a/drivers/tty/serial/sifive.c
1558     +++ b/drivers/tty/serial/sifive.c
1559     @@ -973,6 +973,7 @@ static int sifive_serial_probe(struct platform_device *pdev)
1560     /* Set up clock divider */
1561     ssp->clkin_rate = clk_get_rate(ssp->clk);
1562     ssp->baud_rate = SIFIVE_DEFAULT_BAUD_RATE;
1563     + ssp->port.uartclk = ssp->baud_rate * 16;
1564     __ssp_update_div(ssp);
1565    
1566     platform_set_drvdata(pdev, ssp);
1567     diff --git a/drivers/usb/gadget/udc/aspeed-vhub/epn.c b/drivers/usb/gadget/udc/aspeed-vhub/epn.c
1568     index 7475c74aa5c5e..66d8884615f0e 100644
1569     --- a/drivers/usb/gadget/udc/aspeed-vhub/epn.c
1570     +++ b/drivers/usb/gadget/udc/aspeed-vhub/epn.c
1571     @@ -420,7 +420,10 @@ static void ast_vhub_stop_active_req(struct ast_vhub_ep *ep,
1572     u32 state, reg, loops;
1573    
1574     /* Stop DMA activity */
1575     - writel(0, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT);
1576     + if (ep->epn.desc_mode)
1577     + writel(VHUB_EP_DMA_CTRL_RESET, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT);
1578     + else
1579     + writel(0, ep->epn.regs + AST_VHUB_EP_DMA_CTLSTAT);
1580    
1581     /* Wait for it to complete */
1582     for (loops = 0; loops < 1000; loops++) {
1583     diff --git a/drivers/usb/gadget/udc/bdc/Kconfig b/drivers/usb/gadget/udc/bdc/Kconfig
1584     index 3e88c7670b2ed..fb01ff47b64cf 100644
1585     --- a/drivers/usb/gadget/udc/bdc/Kconfig
1586     +++ b/drivers/usb/gadget/udc/bdc/Kconfig
1587     @@ -17,7 +17,7 @@ if USB_BDC_UDC
1588     comment "Platform Support"
1589     config USB_BDC_PCI
1590     tristate "BDC support for PCIe based platforms"
1591     - depends on USB_PCI
1592     + depends on USB_PCI && BROKEN
1593     default USB_BDC_UDC
1594     help
1595     Enable support for platforms which have BDC connected through PCIe, such as Lego3 FPGA platform.
1596     diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
1597     index 0e7820158aaa9..e41f67cd3d469 100644
1598     --- a/drivers/usb/gadget/udc/core.c
1599     +++ b/drivers/usb/gadget/udc/core.c
1600     @@ -1477,10 +1477,13 @@ static ssize_t soft_connect_store(struct device *dev,
1601     struct device_attribute *attr, const char *buf, size_t n)
1602     {
1603     struct usb_udc *udc = container_of(dev, struct usb_udc, dev);
1604     + ssize_t ret;
1605    
1606     + mutex_lock(&udc_lock);
1607     if (!udc->driver) {
1608     dev_err(dev, "soft-connect without a gadget driver\n");
1609     - return -EOPNOTSUPP;
1610     + ret = -EOPNOTSUPP;
1611     + goto out;
1612     }
1613    
1614     if (sysfs_streq(buf, "connect")) {
1615     @@ -1491,10 +1494,14 @@ static ssize_t soft_connect_store(struct device *dev,
1616     usb_gadget_udc_stop(udc);
1617     } else {
1618     dev_err(dev, "unsupported command '%s'\n", buf);
1619     - return -EINVAL;
1620     + ret = -EINVAL;
1621     + goto out;
1622     }
1623    
1624     - return n;
1625     + ret = n;
1626     +out:
1627     + mutex_unlock(&udc_lock);
1628     + return ret;
1629     }
1630     static DEVICE_ATTR_WO(soft_connect);
1631    
1632     diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
1633     index 0e5c56e065591..5c6ce1ef3f4b0 100644
1634     --- a/drivers/usb/host/ehci-hcd.c
1635     +++ b/drivers/usb/host/ehci-hcd.c
1636     @@ -574,6 +574,7 @@ static int ehci_run (struct usb_hcd *hcd)
1637     struct ehci_hcd *ehci = hcd_to_ehci (hcd);
1638     u32 temp;
1639     u32 hcc_params;
1640     + int rc;
1641    
1642     hcd->uses_new_polling = 1;
1643    
1644     @@ -629,9 +630,20 @@ static int ehci_run (struct usb_hcd *hcd)
1645     down_write(&ehci_cf_port_reset_rwsem);
1646     ehci->rh_state = EHCI_RH_RUNNING;
1647     ehci_writel(ehci, FLAG_CF, &ehci->regs->configured_flag);
1648     +
1649     + /* Wait until HC become operational */
1650     ehci_readl(ehci, &ehci->regs->command); /* unblock posted writes */
1651     msleep(5);
1652     + rc = ehci_handshake(ehci, &ehci->regs->status, STS_HALT, 0, 100 * 1000);
1653     +
1654     up_write(&ehci_cf_port_reset_rwsem);
1655     +
1656     + if (rc) {
1657     + ehci_err(ehci, "USB %x.%x, controller refused to start: %d\n",
1658     + ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f), rc);
1659     + return rc;
1660     + }
1661     +
1662     ehci->last_periodic_enable = ktime_get_real();
1663    
1664     temp = HC_VERSION(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
1665     diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
1666     index 087402aec5cbe..9f9ab5ccea889 100644
1667     --- a/drivers/usb/host/ehci-hub.c
1668     +++ b/drivers/usb/host/ehci-hub.c
1669     @@ -345,6 +345,9 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
1670    
1671     unlink_empty_async_suspended(ehci);
1672    
1673     + /* Some Synopsys controllers mistakenly leave IAA turned on */
1674     + ehci_writel(ehci, STS_IAA, &ehci->regs->status);
1675     +
1676     /* Any IAA cycle that started before the suspend is now invalid */
1677     end_iaa_cycle(ehci);
1678     ehci_handle_start_intr_unlinks(ehci);
1679     diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
1680     index 49894541ea9a5..52e156c018042 100644
1681     --- a/drivers/usb/host/xhci-ring.c
1682     +++ b/drivers/usb/host/xhci-ring.c
1683     @@ -2918,6 +2918,8 @@ static void queue_trb(struct xhci_hcd *xhci, struct xhci_ring *ring,
1684     trb->field[0] = cpu_to_le32(field1);
1685     trb->field[1] = cpu_to_le32(field2);
1686     trb->field[2] = cpu_to_le32(field3);
1687     + /* make sure TRB is fully written before giving it to the controller */
1688     + wmb();
1689     trb->field[3] = cpu_to_le32(field4);
1690    
1691     trace_xhci_queue_trb(ring, trb);
1692     diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
1693     index b8e24ccba9f3e..6087b1fa530f8 100644
1694     --- a/drivers/usb/host/xhci-tegra.c
1695     +++ b/drivers/usb/host/xhci-tegra.c
1696     @@ -562,6 +562,13 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra,
1697     enable);
1698     if (err < 0)
1699     break;
1700     +
1701     + /*
1702     + * wait 500us for LFPS detector to be disabled before
1703     + * sending ACK
1704     + */
1705     + if (!enable)
1706     + usleep_range(500, 1000);
1707     }
1708    
1709     if (err < 0) {
1710     diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
1711     index 26df84c45db4e..7b94a6c316643 100644
1712     --- a/drivers/xen/events/events_base.c
1713     +++ b/drivers/xen/events/events_base.c
1714     @@ -1988,16 +1988,6 @@ static struct irq_chip xen_percpu_chip __read_mostly = {
1715     .irq_ack = ack_dynirq,
1716     };
1717    
1718     -int xen_set_callback_via(uint64_t via)
1719     -{
1720     - struct xen_hvm_param a;
1721     - a.domid = DOMID_SELF;
1722     - a.index = HVM_PARAM_CALLBACK_IRQ;
1723     - a.value = via;
1724     - return HYPERVISOR_hvm_op(HVMOP_set_param, &a);
1725     -}
1726     -EXPORT_SYMBOL_GPL(xen_set_callback_via);
1727     -
1728     #ifdef CONFIG_XEN_PVHVM
1729     /* Vector callbacks are better than PCI interrupts to receive event
1730     * channel notifications because we can receive vector callbacks on any
1731     diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
1732     index 5e30602fdbad8..c45646450135f 100644
1733     --- a/drivers/xen/platform-pci.c
1734     +++ b/drivers/xen/platform-pci.c
1735     @@ -149,7 +149,6 @@ static int platform_pci_probe(struct pci_dev *pdev,
1736     ret = gnttab_init();
1737     if (ret)
1738     goto grant_out;
1739     - xenbus_probe(NULL);
1740     return 0;
1741     grant_out:
1742     gnttab_free_auto_xlat_frames();
1743     diff --git a/drivers/xen/xenbus/xenbus.h b/drivers/xen/xenbus/xenbus.h
1744     index 88516a8a9f932..a9bb5f91082d3 100644
1745     --- a/drivers/xen/xenbus/xenbus.h
1746     +++ b/drivers/xen/xenbus/xenbus.h
1747     @@ -115,6 +115,7 @@ int xenbus_probe_node(struct xen_bus_type *bus,
1748     const char *type,
1749     const char *nodename);
1750     int xenbus_probe_devices(struct xen_bus_type *bus);
1751     +void xenbus_probe(void);
1752    
1753     void xenbus_dev_changed(const char *node, struct xen_bus_type *bus);
1754    
1755     diff --git a/drivers/xen/xenbus/xenbus_comms.c b/drivers/xen/xenbus/xenbus_comms.c
1756     index eb5151fc8efab..e5fda0256feb3 100644
1757     --- a/drivers/xen/xenbus/xenbus_comms.c
1758     +++ b/drivers/xen/xenbus/xenbus_comms.c
1759     @@ -57,16 +57,8 @@ DEFINE_MUTEX(xs_response_mutex);
1760     static int xenbus_irq;
1761     static struct task_struct *xenbus_task;
1762    
1763     -static DECLARE_WORK(probe_work, xenbus_probe);
1764     -
1765     -
1766     static irqreturn_t wake_waiting(int irq, void *unused)
1767     {
1768     - if (unlikely(xenstored_ready == 0)) {
1769     - xenstored_ready = 1;
1770     - schedule_work(&probe_work);
1771     - }
1772     -
1773     wake_up(&xb_waitq);
1774     return IRQ_HANDLED;
1775     }
1776     diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
1777     index e6d0903459e11..14ccf13ab8fa1 100644
1778     --- a/drivers/xen/xenbus/xenbus_probe.c
1779     +++ b/drivers/xen/xenbus/xenbus_probe.c
1780     @@ -683,29 +683,76 @@ void unregister_xenstore_notifier(struct notifier_block *nb)
1781     }
1782     EXPORT_SYMBOL_GPL(unregister_xenstore_notifier);
1783    
1784     -void xenbus_probe(struct work_struct *unused)
1785     +void xenbus_probe(void)
1786     {
1787     xenstored_ready = 1;
1788    
1789     + /*
1790     + * In the HVM case, xenbus_init() deferred its call to
1791     + * xs_init() in case callbacks were not operational yet.
1792     + * So do it now.
1793     + */
1794     + if (xen_store_domain_type == XS_HVM)
1795     + xs_init();
1796     +
1797     /* Notify others that xenstore is up */
1798     blocking_notifier_call_chain(&xenstore_chain, 0, NULL);
1799     }
1800     -EXPORT_SYMBOL_GPL(xenbus_probe);
1801    
1802     -static int __init xenbus_probe_initcall(void)
1803     +/*
1804     + * Returns true when XenStore init must be deferred in order to
1805     + * allow the PCI platform device to be initialised, before we
1806     + * can actually have event channel interrupts working.
1807     + */
1808     +static bool xs_hvm_defer_init_for_callback(void)
1809     {
1810     - if (!xen_domain())
1811     - return -ENODEV;
1812     +#ifdef CONFIG_XEN_PVHVM
1813     + return xen_store_domain_type == XS_HVM &&
1814     + !xen_have_vector_callback;
1815     +#else
1816     + return false;
1817     +#endif
1818     +}
1819    
1820     - if (xen_initial_domain() || xen_hvm_domain())
1821     - return 0;
1822     +static int __init xenbus_probe_initcall(void)
1823     +{
1824     + /*
1825     + * Probe XenBus here in the XS_PV case, and also XS_HVM unless we
1826     + * need to wait for the platform PCI device to come up.
1827     + */
1828     + if (xen_store_domain_type == XS_PV ||
1829     + (xen_store_domain_type == XS_HVM &&
1830     + !xs_hvm_defer_init_for_callback()))
1831     + xenbus_probe();
1832    
1833     - xenbus_probe(NULL);
1834     return 0;
1835     }
1836     -
1837     device_initcall(xenbus_probe_initcall);
1838    
1839     +int xen_set_callback_via(uint64_t via)
1840     +{
1841     + struct xen_hvm_param a;
1842     + int ret;
1843     +
1844     + a.domid = DOMID_SELF;
1845     + a.index = HVM_PARAM_CALLBACK_IRQ;
1846     + a.value = via;
1847     +
1848     + ret = HYPERVISOR_hvm_op(HVMOP_set_param, &a);
1849     + if (ret)
1850     + return ret;
1851     +
1852     + /*
1853     + * If xenbus_probe_initcall() deferred the xenbus_probe()
1854     + * due to the callback not functioning yet, we can do it now.
1855     + */
1856     + if (!xenstored_ready && xs_hvm_defer_init_for_callback())
1857     + xenbus_probe();
1858     +
1859     + return ret;
1860     +}
1861     +EXPORT_SYMBOL_GPL(xen_set_callback_via);
1862     +
1863     /* Set up event channel for xenstored which is run as a local process
1864     * (this is normally used only in dom0)
1865     */
1866     @@ -818,11 +865,17 @@ static int __init xenbus_init(void)
1867     break;
1868     }
1869    
1870     - /* Initialize the interface to xenstore. */
1871     - err = xs_init();
1872     - if (err) {
1873     - pr_warn("Error initializing xenstore comms: %i\n", err);
1874     - goto out_error;
1875     + /*
1876     + * HVM domains may not have a functional callback yet. In that
1877     + * case let xs_init() be called from xenbus_probe(), which will
1878     + * get invoked at an appropriate time.
1879     + */
1880     + if (xen_store_domain_type != XS_HVM) {
1881     + err = xs_init();
1882     + if (err) {
1883     + pr_warn("Error initializing xenstore comms: %i\n", err);
1884     + goto out_error;
1885     + }
1886     }
1887    
1888     if ((xen_store_domain_type != XS_LOCAL) &&
1889     diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
1890     index ace49a999ecec..59e7a2ad440fc 100644
1891     --- a/fs/btrfs/block-group.c
1892     +++ b/fs/btrfs/block-group.c
1893     @@ -2497,7 +2497,8 @@ again:
1894     * Go through delayed refs for all the stuff we've just kicked off
1895     * and then loop back (just once)
1896     */
1897     - ret = btrfs_run_delayed_refs(trans, 0);
1898     + if (!ret)
1899     + ret = btrfs_run_delayed_refs(trans, 0);
1900     if (!ret && loops == 0) {
1901     loops++;
1902     spin_lock(&cur_trans->dirty_bgs_lock);
1903     diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
1904     index c0dd839e99b79..6317394f02b86 100644
1905     --- a/fs/btrfs/extent-tree.c
1906     +++ b/fs/btrfs/extent-tree.c
1907     @@ -5390,7 +5390,15 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
1908     goto out_free;
1909     }
1910    
1911     - trans = btrfs_start_transaction(tree_root, 0);
1912     + /*
1913     + * Use join to avoid potential EINTR from transaction
1914     + * start. See wait_reserve_ticket and the whole
1915     + * reservation callchain.
1916     + */
1917     + if (for_reloc)
1918     + trans = btrfs_join_transaction(tree_root);
1919     + else
1920     + trans = btrfs_start_transaction(tree_root, 0);
1921     if (IS_ERR(trans)) {
1922     err = PTR_ERR(trans);
1923     goto out_free;
1924     diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
1925     index 903136ceac34a..ecdefa7262d2b 100644
1926     --- a/fs/btrfs/send.c
1927     +++ b/fs/btrfs/send.c
1928     @@ -5519,6 +5519,21 @@ static int clone_range(struct send_ctx *sctx,
1929     break;
1930     offset += clone_len;
1931     clone_root->offset += clone_len;
1932     +
1933     + /*
1934     + * If we are cloning from the file we are currently processing,
1935     + * and using the send root as the clone root, we must stop once
1936     + * the current clone offset reaches the current eof of the file
1937     + * at the receiver, otherwise we would issue an invalid clone
1938     + * operation (source range going beyond eof) and cause the
1939     + * receiver to fail. So if we reach the current eof, bail out
1940     + * and fallback to a regular write.
1941     + */
1942     + if (clone_root->root == sctx->send_root &&
1943     + clone_root->ino == sctx->cur_ino &&
1944     + clone_root->offset >= sctx->cur_inode_next_write_offset)
1945     + break;
1946     +
1947     data_offset += clone_len;
1948     next:
1949     path->slots[0]++;
1950     diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
1951     index 67ffbe92944c6..db3b17bca11f5 100644
1952     --- a/fs/btrfs/volumes.c
1953     +++ b/fs/btrfs/volumes.c
1954     @@ -4409,6 +4409,8 @@ int btrfs_recover_balance(struct btrfs_fs_info *fs_info)
1955     btrfs_warn(fs_info,
1956     "balance: cannot set exclusive op status, resume manually");
1957    
1958     + btrfs_release_path(path);
1959     +
1960     mutex_lock(&fs_info->balance_mutex);
1961     BUG_ON(fs_info->balance_ctl);
1962     spin_lock(&fs_info->balance_lock);
1963     diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
1964     index 6d6de183915b5..4ffbf8f965814 100644
1965     --- a/fs/cifs/transport.c
1966     +++ b/fs/cifs/transport.c
1967     @@ -339,7 +339,7 @@ __smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
1968     if (ssocket == NULL)
1969     return -EAGAIN;
1970    
1971     - if (signal_pending(current)) {
1972     + if (fatal_signal_pending(current)) {
1973     cifs_dbg(FYI, "signal pending before send request\n");
1974     return -ERESTARTSYS;
1975     }
1976     @@ -431,7 +431,7 @@ unmask:
1977    
1978     if (signal_pending(current) && (total_len != send_length)) {
1979     cifs_dbg(FYI, "signal is pending after attempt to send\n");
1980     - rc = -EINTR;
1981     + rc = -ERESTARTSYS;
1982     }
1983    
1984     /* uncork it */
1985     diff --git a/include/asm-generic/bitops/atomic.h b/include/asm-generic/bitops/atomic.h
1986     index dd90c9792909d..0e7316a86240b 100644
1987     --- a/include/asm-generic/bitops/atomic.h
1988     +++ b/include/asm-generic/bitops/atomic.h
1989     @@ -11,19 +11,19 @@
1990     * See Documentation/atomic_bitops.txt for details.
1991     */
1992    
1993     -static inline void set_bit(unsigned int nr, volatile unsigned long *p)
1994     +static __always_inline void set_bit(unsigned int nr, volatile unsigned long *p)
1995     {
1996     p += BIT_WORD(nr);
1997     atomic_long_or(BIT_MASK(nr), (atomic_long_t *)p);
1998     }
1999    
2000     -static inline void clear_bit(unsigned int nr, volatile unsigned long *p)
2001     +static __always_inline void clear_bit(unsigned int nr, volatile unsigned long *p)
2002     {
2003     p += BIT_WORD(nr);
2004     atomic_long_andnot(BIT_MASK(nr), (atomic_long_t *)p);
2005     }
2006    
2007     -static inline void change_bit(unsigned int nr, volatile unsigned long *p)
2008     +static __always_inline void change_bit(unsigned int nr, volatile unsigned long *p)
2009     {
2010     p += BIT_WORD(nr);
2011     atomic_long_xor(BIT_MASK(nr), (atomic_long_t *)p);
2012     diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
2013     index c71eb294da954..6c8f8e5e33c3d 100644
2014     --- a/include/net/inet_connection_sock.h
2015     +++ b/include/net/inet_connection_sock.h
2016     @@ -83,6 +83,8 @@ struct inet_connection_sock_af_ops {
2017     * @icsk_ext_hdr_len: Network protocol overhead (IP/IPv6 options)
2018     * @icsk_ack: Delayed ACK control data
2019     * @icsk_mtup; MTU probing control data
2020     + * @icsk_probes_tstamp: Probe timestamp (cleared by non-zero window ack)
2021     + * @icsk_user_timeout: TCP_USER_TIMEOUT value
2022     */
2023     struct inet_connection_sock {
2024     /* inet_sock has to be the first member! */
2025     @@ -133,6 +135,7 @@ struct inet_connection_sock {
2026    
2027     u32 probe_timestamp;
2028     } icsk_mtup;
2029     + u32 icsk_probes_tstamp;
2030     u32 icsk_user_timeout;
2031    
2032     u64 icsk_ca_priv[104 / sizeof(u64)];
2033     diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
2034     index eba01ab5a55e0..fe9a9fa2ebc45 100644
2035     --- a/include/xen/xenbus.h
2036     +++ b/include/xen/xenbus.h
2037     @@ -187,7 +187,7 @@ void xs_suspend_cancel(void);
2038    
2039     struct work_struct;
2040    
2041     -void xenbus_probe(struct work_struct *);
2042     +void xenbus_probe(void);
2043    
2044     #define XENBUS_IS_ERR_READ(str) ({ \
2045     if (!IS_ERR(str) && strlen(str) == 0) { \
2046     diff --git a/mm/kasan/init.c b/mm/kasan/init.c
2047     index ce45c491ebcdb..ee21e1c1150c6 100644
2048     --- a/mm/kasan/init.c
2049     +++ b/mm/kasan/init.c
2050     @@ -388,9 +388,10 @@ static void kasan_remove_pmd_table(pmd_t *pmd, unsigned long addr,
2051    
2052     if (kasan_pte_table(*pmd)) {
2053     if (IS_ALIGNED(addr, PMD_SIZE) &&
2054     - IS_ALIGNED(next, PMD_SIZE))
2055     + IS_ALIGNED(next, PMD_SIZE)) {
2056     pmd_clear(pmd);
2057     - continue;
2058     + continue;
2059     + }
2060     }
2061     pte = pte_offset_kernel(pmd, addr);
2062     kasan_remove_pte_table(pte, addr, next);
2063     @@ -413,9 +414,10 @@ static void kasan_remove_pud_table(pud_t *pud, unsigned long addr,
2064    
2065     if (kasan_pmd_table(*pud)) {
2066     if (IS_ALIGNED(addr, PUD_SIZE) &&
2067     - IS_ALIGNED(next, PUD_SIZE))
2068     + IS_ALIGNED(next, PUD_SIZE)) {
2069     pud_clear(pud);
2070     - continue;
2071     + continue;
2072     + }
2073     }
2074     pmd = pmd_offset(pud, addr);
2075     pmd_base = pmd_offset(pud, 0);
2076     @@ -439,9 +441,10 @@ static void kasan_remove_p4d_table(p4d_t *p4d, unsigned long addr,
2077    
2078     if (kasan_pud_table(*p4d)) {
2079     if (IS_ALIGNED(addr, P4D_SIZE) &&
2080     - IS_ALIGNED(next, P4D_SIZE))
2081     + IS_ALIGNED(next, P4D_SIZE)) {
2082     p4d_clear(p4d);
2083     - continue;
2084     + continue;
2085     + }
2086     }
2087     pud = pud_offset(p4d, addr);
2088     kasan_remove_pud_table(pud, addr, next);
2089     @@ -473,9 +476,10 @@ void kasan_remove_zero_shadow(void *start, unsigned long size)
2090    
2091     if (kasan_p4d_table(*pgd)) {
2092     if (IS_ALIGNED(addr, PGDIR_SIZE) &&
2093     - IS_ALIGNED(next, PGDIR_SIZE))
2094     + IS_ALIGNED(next, PGDIR_SIZE)) {
2095     pgd_clear(pgd);
2096     - continue;
2097     + continue;
2098     + }
2099     }
2100    
2101     p4d = p4d_offset(pgd, addr);
2102     @@ -499,7 +503,6 @@ int kasan_add_zero_shadow(void *start, unsigned long size)
2103    
2104     ret = kasan_populate_early_shadow(shadow_start, shadow_end);
2105     if (ret)
2106     - kasan_remove_zero_shadow(shadow_start,
2107     - size >> KASAN_SHADOW_SCALE_SHIFT);
2108     + kasan_remove_zero_shadow(start, size);
2109     return ret;
2110     }
2111     diff --git a/net/core/dev.c b/net/core/dev.c
2112     index 20c7fd7b8b4bc..ec66d13d2bdad 100644
2113     --- a/net/core/dev.c
2114     +++ b/net/core/dev.c
2115     @@ -8692,6 +8692,11 @@ static netdev_features_t netdev_fix_features(struct net_device *dev,
2116     }
2117     }
2118    
2119     + if ((features & NETIF_F_HW_TLS_RX) && !(features & NETIF_F_RXCSUM)) {
2120     + netdev_dbg(dev, "Dropping TLS RX HW offload feature since no RXCSUM feature.\n");
2121     + features &= ~NETIF_F_HW_TLS_RX;
2122     + }
2123     +
2124     return features;
2125     }
2126    
2127     diff --git a/net/core/skbuff.c b/net/core/skbuff.c
2128     index 961cb5a88c958..45117fa299837 100644
2129     --- a/net/core/skbuff.c
2130     +++ b/net/core/skbuff.c
2131     @@ -431,7 +431,11 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, unsigned int len,
2132    
2133     len += NET_SKB_PAD;
2134    
2135     - if ((len > SKB_WITH_OVERHEAD(PAGE_SIZE)) ||
2136     + /* If requested length is either too small or too big,
2137     + * we use kmalloc() for skb->head allocation.
2138     + */
2139     + if (len <= SKB_WITH_OVERHEAD(1024) ||
2140     + len > SKB_WITH_OVERHEAD(PAGE_SIZE) ||
2141     (gfp_mask & (__GFP_DIRECT_RECLAIM | GFP_DMA))) {
2142     skb = __alloc_skb(len, gfp_mask, SKB_ALLOC_RX, NUMA_NO_NODE);
2143     if (!skb)
2144     diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
2145     index 9745c52f49ca4..ac5c4f6cdefee 100644
2146     --- a/net/ipv4/inet_connection_sock.c
2147     +++ b/net/ipv4/inet_connection_sock.c
2148     @@ -840,6 +840,7 @@ struct sock *inet_csk_clone_lock(const struct sock *sk,
2149     newicsk->icsk_retransmits = 0;
2150     newicsk->icsk_backoff = 0;
2151     newicsk->icsk_probes_out = 0;
2152     + newicsk->icsk_probes_tstamp = 0;
2153    
2154     /* Deinitialize accept_queue to trap illegal accesses. */
2155     memset(&newicsk->icsk_accept_queue, 0, sizeof(newicsk->icsk_accept_queue));
2156     diff --git a/net/ipv4/netfilter/ipt_rpfilter.c b/net/ipv4/netfilter/ipt_rpfilter.c
2157     index cc23f1ce239c2..8cd3224d913e0 100644
2158     --- a/net/ipv4/netfilter/ipt_rpfilter.c
2159     +++ b/net/ipv4/netfilter/ipt_rpfilter.c
2160     @@ -76,7 +76,7 @@ static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par)
2161     flow.daddr = iph->saddr;
2162     flow.saddr = rpfilter_get_saddr(iph->daddr);
2163     flow.flowi4_mark = info->flags & XT_RPFILTER_VALID_MARK ? skb->mark : 0;
2164     - flow.flowi4_tos = RT_TOS(iph->tos);
2165     + flow.flowi4_tos = iph->tos & IPTOS_RT_MASK;
2166     flow.flowi4_scope = RT_SCOPE_UNIVERSE;
2167     flow.flowi4_oif = l3mdev_master_ifindex_rcu(xt_in(par));
2168    
2169     diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
2170     index d3ced6a39bcf1..6ddec8a23942b 100644
2171     --- a/net/ipv4/tcp.c
2172     +++ b/net/ipv4/tcp.c
2173     @@ -2627,6 +2627,7 @@ int tcp_disconnect(struct sock *sk, int flags)
2174     icsk->icsk_backoff = 0;
2175     tp->snd_cwnd = 2;
2176     icsk->icsk_probes_out = 0;
2177     + icsk->icsk_probes_tstamp = 0;
2178     icsk->icsk_rto = TCP_TIMEOUT_INIT;
2179     tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
2180     tp->snd_cwnd = TCP_INIT_CWND;
2181     diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
2182     index adace90f49fac..7411a43134629 100644
2183     --- a/net/ipv4/tcp_input.c
2184     +++ b/net/ipv4/tcp_input.c
2185     @@ -3286,6 +3286,7 @@ static void tcp_ack_probe(struct sock *sk)
2186     return;
2187     if (!after(TCP_SKB_CB(head)->end_seq, tcp_wnd_end(tp))) {
2188     icsk->icsk_backoff = 0;
2189     + icsk->icsk_probes_tstamp = 0;
2190     inet_csk_clear_xmit_timer(sk, ICSK_TIME_PROBE0);
2191     /* Socket must be waked up by subsequent tcp_data_snd_check().
2192     * This function is not for random using!
2193     diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
2194     index 87a5037a9cb3e..04acdca4bb0d5 100644
2195     --- a/net/ipv4/tcp_ipv4.c
2196     +++ b/net/ipv4/tcp_ipv4.c
2197     @@ -1657,6 +1657,7 @@ int tcp_v4_early_demux(struct sk_buff *skb)
2198     bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb)
2199     {
2200     u32 limit = READ_ONCE(sk->sk_rcvbuf) + READ_ONCE(sk->sk_sndbuf);
2201     + u32 tail_gso_size, tail_gso_segs;
2202     struct skb_shared_info *shinfo;
2203     const struct tcphdr *th;
2204     struct tcphdr *thtail;
2205     @@ -1664,6 +1665,7 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb)
2206     unsigned int hdrlen;
2207     bool fragstolen;
2208     u32 gso_segs;
2209     + u32 gso_size;
2210     int delta;
2211    
2212     /* In case all data was pulled from skb frags (in __pskb_pull_tail()),
2213     @@ -1689,13 +1691,6 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb)
2214     */
2215     th = (const struct tcphdr *)skb->data;
2216     hdrlen = th->doff * 4;
2217     - shinfo = skb_shinfo(skb);
2218     -
2219     - if (!shinfo->gso_size)
2220     - shinfo->gso_size = skb->len - hdrlen;
2221     -
2222     - if (!shinfo->gso_segs)
2223     - shinfo->gso_segs = 1;
2224    
2225     tail = sk->sk_backlog.tail;
2226     if (!tail)
2227     @@ -1718,6 +1713,15 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb)
2228     goto no_coalesce;
2229    
2230     __skb_pull(skb, hdrlen);
2231     +
2232     + shinfo = skb_shinfo(skb);
2233     + gso_size = shinfo->gso_size ?: skb->len;
2234     + gso_segs = shinfo->gso_segs ?: 1;
2235     +
2236     + shinfo = skb_shinfo(tail);
2237     + tail_gso_size = shinfo->gso_size ?: (tail->len - hdrlen);
2238     + tail_gso_segs = shinfo->gso_segs ?: 1;
2239     +
2240     if (skb_try_coalesce(tail, skb, &fragstolen, &delta)) {
2241     TCP_SKB_CB(tail)->end_seq = TCP_SKB_CB(skb)->end_seq;
2242    
2243     @@ -1744,11 +1748,8 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb)
2244     }
2245    
2246     /* Not as strict as GRO. We only need to carry mss max value */
2247     - skb_shinfo(tail)->gso_size = max(shinfo->gso_size,
2248     - skb_shinfo(tail)->gso_size);
2249     -
2250     - gso_segs = skb_shinfo(tail)->gso_segs + shinfo->gso_segs;
2251     - skb_shinfo(tail)->gso_segs = min_t(u32, gso_segs, 0xFFFF);
2252     + shinfo->gso_size = max(gso_size, tail_gso_size);
2253     + shinfo->gso_segs = min_t(u32, gso_segs + tail_gso_segs, 0xFFFF);
2254    
2255     sk->sk_backlog.len += delta;
2256     __NET_INC_STATS(sock_net(sk),
2257     diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
2258     index 5e311e6a31d51..5da6ffce390c2 100644
2259     --- a/net/ipv4/tcp_output.c
2260     +++ b/net/ipv4/tcp_output.c
2261     @@ -3835,6 +3835,7 @@ void tcp_send_probe0(struct sock *sk)
2262     /* Cancel probe timer, if it is not required. */
2263     icsk->icsk_probes_out = 0;
2264     icsk->icsk_backoff = 0;
2265     + icsk->icsk_probes_tstamp = 0;
2266     return;
2267     }
2268    
2269     diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
2270     index dd5a6317a8018..7fcd116fbd378 100644
2271     --- a/net/ipv4/tcp_timer.c
2272     +++ b/net/ipv4/tcp_timer.c
2273     @@ -344,6 +344,7 @@ static void tcp_probe_timer(struct sock *sk)
2274    
2275     if (tp->packets_out || !skb) {
2276     icsk->icsk_probes_out = 0;
2277     + icsk->icsk_probes_tstamp = 0;
2278     return;
2279     }
2280    
2281     @@ -355,13 +356,12 @@ static void tcp_probe_timer(struct sock *sk)
2282     * corresponding system limit. We also implement similar policy when
2283     * we use RTO to probe window in tcp_retransmit_timer().
2284     */
2285     - if (icsk->icsk_user_timeout) {
2286     - u32 elapsed = tcp_model_timeout(sk, icsk->icsk_probes_out,
2287     - tcp_probe0_base(sk));
2288     -
2289     - if (elapsed >= icsk->icsk_user_timeout)
2290     - goto abort;
2291     - }
2292     + if (!icsk->icsk_probes_tstamp)
2293     + icsk->icsk_probes_tstamp = tcp_jiffies32;
2294     + else if (icsk->icsk_user_timeout &&
2295     + (s32)(tcp_jiffies32 - icsk->icsk_probes_tstamp) >=
2296     + msecs_to_jiffies(icsk->icsk_user_timeout))
2297     + goto abort;
2298    
2299     max_probes = sock_net(sk)->ipv4.sysctl_tcp_retries2;
2300     if (sock_flag(sk, SOCK_DEAD)) {
2301     diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
2302     index c7ff200d0bd41..994a150ae3e90 100644
2303     --- a/net/ipv4/udp.c
2304     +++ b/net/ipv4/udp.c
2305     @@ -2495,7 +2495,8 @@ int udp_v4_early_demux(struct sk_buff *skb)
2306     */
2307     if (!inet_sk(sk)->inet_daddr && in_dev)
2308     return ip_mc_validate_source(skb, iph->daddr,
2309     - iph->saddr, iph->tos,
2310     + iph->saddr,
2311     + iph->tos & IPTOS_RT_MASK,
2312     skb->dev, in_dev, &itag);
2313     }
2314     return 0;
2315     diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
2316     index 635b2482fa204..52feab2baeee5 100644
2317     --- a/net/ipv6/addrconf.c
2318     +++ b/net/ipv6/addrconf.c
2319     @@ -2452,8 +2452,9 @@ static void addrconf_add_mroute(struct net_device *dev)
2320     .fc_ifindex = dev->ifindex,
2321     .fc_dst_len = 8,
2322     .fc_flags = RTF_UP,
2323     - .fc_type = RTN_UNICAST,
2324     + .fc_type = RTN_MULTICAST,
2325     .fc_nlinfo.nl_net = dev_net(dev),
2326     + .fc_protocol = RTPROT_KERNEL,
2327     };
2328    
2329     ipv6_addr_set(&cfg.fc_dst, htonl(0xFF000000), 0, 0, 0);
2330     diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
2331     index 61e95029c18f5..c9399e81c5059 100644
2332     --- a/net/sched/cls_tcindex.c
2333     +++ b/net/sched/cls_tcindex.c
2334     @@ -366,9 +366,13 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base,
2335     if (tb[TCA_TCINDEX_MASK])
2336     cp->mask = nla_get_u16(tb[TCA_TCINDEX_MASK]);
2337    
2338     - if (tb[TCA_TCINDEX_SHIFT])
2339     + if (tb[TCA_TCINDEX_SHIFT]) {
2340     cp->shift = nla_get_u32(tb[TCA_TCINDEX_SHIFT]);
2341     -
2342     + if (cp->shift > 16) {
2343     + err = -EINVAL;
2344     + goto errout;
2345     + }
2346     + }
2347     if (!cp->hash) {
2348     /* Hash not specified, use perfect hash if the upper limit
2349     * of the hashing index is below the threshold.
2350     diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
2351     index 50794125bf024..b65a405f607b2 100644
2352     --- a/net/sched/sch_api.c
2353     +++ b/net/sched/sch_api.c
2354     @@ -409,7 +409,8 @@ struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
2355     {
2356     struct qdisc_rate_table *rtab;
2357    
2358     - if (tab == NULL || r->rate == 0 || r->cell_log == 0 ||
2359     + if (tab == NULL || r->rate == 0 ||
2360     + r->cell_log == 0 || r->cell_log >= 32 ||
2361     nla_len(tab) != TC_RTAB_SIZE) {
2362     NL_SET_ERR_MSG(extack, "Invalid rate table parameters for searching");
2363     return NULL;
2364     diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c
2365     index 11554d0412f06..1b8409ec2c97f 100644
2366     --- a/sound/core/seq/oss/seq_oss_synth.c
2367     +++ b/sound/core/seq/oss/seq_oss_synth.c
2368     @@ -611,7 +611,8 @@ snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_in
2369    
2370     if (info->is_midi) {
2371     struct midi_info minf;
2372     - snd_seq_oss_midi_make_info(dp, info->midi_mapped, &minf);
2373     + if (snd_seq_oss_midi_make_info(dp, info->midi_mapped, &minf))
2374     + return -ENXIO;
2375     inf->synth_type = SYNTH_TYPE_MIDI;
2376     inf->synth_subtype = 0;
2377     inf->nr_voices = 16;
2378     diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
2379     index 0ab40a8a68fb5..834367dd54e1b 100644
2380     --- a/sound/pci/hda/patch_via.c
2381     +++ b/sound/pci/hda/patch_via.c
2382     @@ -113,6 +113,7 @@ static struct via_spec *via_new_spec(struct hda_codec *codec)
2383     spec->codec_type = VT1708S;
2384     spec->gen.indep_hp = 1;
2385     spec->gen.keep_eapd_on = 1;
2386     + spec->gen.dac_min_mute = 1;
2387     spec->gen.pcm_playback_hook = via_playback_pcm_hook;
2388     spec->gen.add_stereo_mix_input = HDA_HINT_STEREO_MIX_AUTO;
2389     codec->power_save_node = 1;
2390     diff --git a/sound/soc/intel/boards/haswell.c b/sound/soc/intel/boards/haswell.c
2391     index 3dadf9bff796a..cf47fd9cd506b 100644
2392     --- a/sound/soc/intel/boards/haswell.c
2393     +++ b/sound/soc/intel/boards/haswell.c
2394     @@ -206,6 +206,7 @@ static struct platform_driver haswell_audio = {
2395     .probe = haswell_audio_probe,
2396     .driver = {
2397     .name = "haswell-audio",
2398     + .pm = &snd_soc_pm_ops,
2399     },
2400     };
2401    
2402     diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh
2403     index 4811067d9b053..4e19a1c00ddd8 100755
2404     --- a/tools/testing/selftests/net/fib_tests.sh
2405     +++ b/tools/testing/selftests/net/fib_tests.sh
2406     @@ -1055,7 +1055,6 @@ ipv6_addr_metric_test()
2407    
2408     check_route6 "2001:db8:104::1 dev dummy2 proto kernel metric 260"
2409     log_test $? 0 "Set metric with peer route on local side"
2410     - log_test $? 0 "User specified metric on local address"
2411     check_route6 "2001:db8:104::2 dev dummy2 proto kernel metric 260"
2412     log_test $? 0 "Set metric with peer route on peer side"
2413