Magellan Linux

Annotation of /trunk/kernel-alx/patches-5.4/0301-5.4.202-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3637 - (hide annotations) (download)
Mon Oct 24 12:40:44 2022 UTC (20 months ago) by niro
File size: 55862 byte(s)
-add missing
1 niro 3637 diff --git a/Documentation/ABI/testing/sysfs-bus-iio-vf610 b/Documentation/ABI/testing/sysfs-bus-iio-vf610
2     index 308a6756d3bf3..491ead8044888 100644
3     --- a/Documentation/ABI/testing/sysfs-bus-iio-vf610
4     +++ b/Documentation/ABI/testing/sysfs-bus-iio-vf610
5     @@ -1,4 +1,4 @@
6     -What: /sys/bus/iio/devices/iio:deviceX/conversion_mode
7     +What: /sys/bus/iio/devices/iio:deviceX/in_conversion_mode
8     KernelVersion: 4.2
9     Contact: linux-iio@vger.kernel.org
10     Description:
11     diff --git a/Makefile b/Makefile
12     index 75be5870cc55f..021878dc23f9b 100644
13     --- a/Makefile
14     +++ b/Makefile
15     @@ -1,7 +1,7 @@
16     # SPDX-License-Identifier: GPL-2.0
17     VERSION = 5
18     PATCHLEVEL = 4
19     -SUBLEVEL = 201
20     +SUBLEVEL = 202
21     EXTRAVERSION =
22     NAME = Kleptomaniac Octopus
23    
24     @@ -1073,7 +1073,7 @@ PHONY += autoksyms_recursive
25     ifdef CONFIG_TRIM_UNUSED_KSYMS
26     autoksyms_recursive: descend modules.order
27     $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
28     - "$(MAKE) -f $(srctree)/Makefile vmlinux"
29     + "$(MAKE) -f $(srctree)/Makefile autoksyms_recursive"
30     endif
31    
32     # For the kernel to actually contain only the needed exported symbols,
33     diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
34     index bc488df315117..e9955ef12e02d 100644
35     --- a/arch/arm/boot/dts/imx6qdl.dtsi
36     +++ b/arch/arm/boot/dts/imx6qdl.dtsi
37     @@ -766,7 +766,7 @@
38     regulator-name = "vddpu";
39     regulator-min-microvolt = <725000>;
40     regulator-max-microvolt = <1450000>;
41     - regulator-enable-ramp-delay = <150>;
42     + regulator-enable-ramp-delay = <380>;
43     anatop-reg-offset = <0x140>;
44     anatop-vol-bit-shift = <9>;
45     anatop-vol-bit-width = <5>;
46     diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c
47     index 512943eae30a5..2e203626eda52 100644
48     --- a/arch/arm/mach-axxia/platsmp.c
49     +++ b/arch/arm/mach-axxia/platsmp.c
50     @@ -39,6 +39,7 @@ static int axxia_boot_secondary(unsigned int cpu, struct task_struct *idle)
51     return -ENOENT;
52    
53     syscon = of_iomap(syscon_np, 0);
54     + of_node_put(syscon_np);
55     if (!syscon)
56     return -ENOMEM;
57    
58     diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c
59     index 1d61a7701c11f..d7e63f57b426a 100644
60     --- a/arch/arm/mach-cns3xxx/core.c
61     +++ b/arch/arm/mach-cns3xxx/core.c
62     @@ -376,6 +376,7 @@ static void __init cns3xxx_init(void)
63     /* De-Asscer SATA Reset */
64     cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA));
65     }
66     + of_node_put(dn);
67    
68     dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci");
69     if (of_device_is_available(dn)) {
70     @@ -389,6 +390,7 @@ static void __init cns3xxx_init(void)
71     cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
72     cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO));
73     }
74     + of_node_put(dn);
75    
76     pm_power_off = cns3xxx_power_off;
77    
78     diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
79     index f226d4f57bf41..9025067ef6f57 100644
80     --- a/arch/arm/mach-exynos/exynos.c
81     +++ b/arch/arm/mach-exynos/exynos.c
82     @@ -136,6 +136,7 @@ static void exynos_map_pmu(void)
83     np = of_find_matching_node(NULL, exynos_dt_pmu_match);
84     if (np)
85     pmu_base_addr = of_iomap(np, 0);
86     + of_node_put(np);
87     }
88    
89     static void __init exynos_init_irq(void)
90     diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c
91     index 7b7f25b4b057e..9240bcdbe74e4 100644
92     --- a/arch/mips/vr41xx/common/icu.c
93     +++ b/arch/mips/vr41xx/common/icu.c
94     @@ -640,8 +640,6 @@ static int icu_get_irq(unsigned int irq)
95    
96     printk(KERN_ERR "spurious ICU interrupt: %04x,%04x\n", pend1, pend2);
97    
98     - atomic_inc(&irq_err_count);
99     -
100     return -1;
101     }
102    
103     diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
104     index 0c29d6cb2c8df..c97c01c755665 100644
105     --- a/arch/parisc/Kconfig
106     +++ b/arch/parisc/Kconfig
107     @@ -11,6 +11,7 @@ config PARISC
108     select ARCH_WANT_FRAME_POINTERS
109     select ARCH_HAS_ELF_RANDOMIZE
110     select ARCH_HAS_STRICT_KERNEL_RWX
111     + select ARCH_HAS_STRICT_MODULE_RWX
112     select ARCH_HAS_UBSAN_SANITIZE_ALL
113     select ARCH_NO_SG_CHAIN
114     select ARCH_SUPPORTS_MEMORY_FAILURE
115     diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
116     index 832663f214226..cf87573e6e785 100644
117     --- a/arch/powerpc/kernel/process.c
118     +++ b/arch/powerpc/kernel/process.c
119     @@ -1719,7 +1719,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
120     tm_reclaim_current(0);
121     #endif
122    
123     - memset(regs->gpr, 0, sizeof(regs->gpr));
124     + memset(&regs->gpr[1], 0, sizeof(regs->gpr) - sizeof(regs->gpr[0]));
125     regs->ctr = 0;
126     regs->link = 0;
127     regs->xer = 0;
128     diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
129     index 9392661ac8a87..35e246e39705b 100644
130     --- a/arch/powerpc/kernel/rtas.c
131     +++ b/arch/powerpc/kernel/rtas.c
132     @@ -988,7 +988,7 @@ static struct rtas_filter rtas_filters[] __ro_after_init = {
133     { "get-time-of-day", -1, -1, -1, -1, -1 },
134     { "ibm,get-vpd", -1, 0, -1, 1, 2 },
135     { "ibm,lpar-perftools", -1, 2, 3, -1, -1 },
136     - { "ibm,platform-dump", -1, 4, 5, -1, -1 },
137     + { "ibm,platform-dump", -1, 4, 5, -1, -1 }, /* Special cased */
138     { "ibm,read-slot-reset-state", -1, -1, -1, -1, -1 },
139     { "ibm,scan-log-dump", -1, 0, 1, -1, -1 },
140     { "ibm,set-dynamic-indicator", -1, 2, -1, -1, -1 },
141     @@ -1035,6 +1035,15 @@ static bool block_rtas_call(int token, int nargs,
142     size = 1;
143    
144     end = base + size - 1;
145     +
146     + /*
147     + * Special case for ibm,platform-dump - NULL buffer
148     + * address is used to indicate end of dump processing
149     + */
150     + if (!strcmp(f->name, "ibm,platform-dump") &&
151     + base == 0)
152     + return false;
153     +
154     if (!in_rmo_buf(base, end))
155     goto err;
156     }
157     diff --git a/arch/powerpc/platforms/powernv/powernv.h b/arch/powerpc/platforms/powernv/powernv.h
158     index 1aa51c4fa9045..4825e4cf4410d 100644
159     --- a/arch/powerpc/platforms/powernv/powernv.h
160     +++ b/arch/powerpc/platforms/powernv/powernv.h
161     @@ -35,4 +35,6 @@ ssize_t memcons_copy(struct memcons *mc, char *to, loff_t pos, size_t count);
162     u32 memcons_get_size(struct memcons *mc);
163     struct memcons *memcons_init(struct device_node *node, const char *mc_prop_name);
164    
165     +void pnv_rng_init(void);
166     +
167     #endif /* _POWERNV_H */
168     diff --git a/arch/powerpc/platforms/powernv/rng.c b/arch/powerpc/platforms/powernv/rng.c
169     index 1c31863a9be6c..eba4142998b03 100644
170     --- a/arch/powerpc/platforms/powernv/rng.c
171     +++ b/arch/powerpc/platforms/powernv/rng.c
172     @@ -17,6 +17,7 @@
173     #include <asm/prom.h>
174     #include <asm/machdep.h>
175     #include <asm/smp.h>
176     +#include "powernv.h"
177    
178     #define DARN_ERR 0xFFFFFFFFFFFFFFFFul
179    
180     @@ -28,7 +29,6 @@ struct powernv_rng {
181    
182     static DEFINE_PER_CPU(struct powernv_rng *, powernv_rng);
183    
184     -
185     int powernv_hwrng_present(void)
186     {
187     struct powernv_rng *rng;
188     @@ -98,9 +98,6 @@ static int initialise_darn(void)
189     return 0;
190     }
191     }
192     -
193     - pr_warn("Unable to use DARN for get_random_seed()\n");
194     -
195     return -EIO;
196     }
197    
198     @@ -163,32 +160,55 @@ static __init int rng_create(struct device_node *dn)
199    
200     rng_init_per_cpu(rng, dn);
201    
202     - pr_info_once("Registering arch random hook.\n");
203     -
204     ppc_md.get_random_seed = powernv_get_random_long;
205    
206     return 0;
207     }
208    
209     -static __init int rng_init(void)
210     +static int __init pnv_get_random_long_early(unsigned long *v)
211     {
212     struct device_node *dn;
213     - int rc;
214     +
215     + if (!slab_is_available())
216     + return 0;
217     +
218     + if (cmpxchg(&ppc_md.get_random_seed, pnv_get_random_long_early,
219     + NULL) != pnv_get_random_long_early)
220     + return 0;
221    
222     for_each_compatible_node(dn, NULL, "ibm,power-rng") {
223     - rc = rng_create(dn);
224     - if (rc) {
225     - pr_err("Failed creating rng for %pOF (%d).\n",
226     - dn, rc);
227     + if (rng_create(dn))
228     continue;
229     - }
230     -
231     /* Create devices for hwrng driver */
232     of_platform_device_create(dn, NULL, NULL);
233     }
234    
235     - initialise_darn();
236     + if (!ppc_md.get_random_seed)
237     + return 0;
238     + return ppc_md.get_random_seed(v);
239     +}
240     +
241     +void __init pnv_rng_init(void)
242     +{
243     + struct device_node *dn;
244    
245     + /* Prefer darn over the rest. */
246     + if (!initialise_darn())
247     + return;
248     +
249     + dn = of_find_compatible_node(NULL, NULL, "ibm,power-rng");
250     + if (dn)
251     + ppc_md.get_random_seed = pnv_get_random_long_early;
252     +
253     + of_node_put(dn);
254     +}
255     +
256     +static int __init pnv_rng_late_init(void)
257     +{
258     + unsigned long v;
259     + /* In case it wasn't called during init for some other reason. */
260     + if (ppc_md.get_random_seed == pnv_get_random_long_early)
261     + pnv_get_random_long_early(&v);
262     return 0;
263     }
264     -machine_subsys_initcall(powernv, rng_init);
265     +machine_subsys_initcall(powernv, pnv_rng_late_init);
266     diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
267     index 1b7b0d0c3ebdd..d9e26614d7ed8 100644
268     --- a/arch/powerpc/platforms/powernv/setup.c
269     +++ b/arch/powerpc/platforms/powernv/setup.c
270     @@ -168,6 +168,8 @@ static void __init pnv_setup_arch(void)
271     powersave_nap = 1;
272    
273     /* XXX PMCS */
274     +
275     + pnv_rng_init();
276     }
277    
278     static void __init pnv_init(void)
279     diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
280     index 13fa370a87e4e..5fd56230b01c5 100644
281     --- a/arch/powerpc/platforms/pseries/pseries.h
282     +++ b/arch/powerpc/platforms/pseries/pseries.h
283     @@ -114,4 +114,6 @@ int dlpar_workqueue_init(void);
284     void pseries_setup_rfi_flush(void);
285     void pseries_lpar_read_hblkrm_characteristics(void);
286    
287     +void pseries_rng_init(void);
288     +
289     #endif /* _PSERIES_PSERIES_H */
290     diff --git a/arch/powerpc/platforms/pseries/rng.c b/arch/powerpc/platforms/pseries/rng.c
291     index 6268545947b83..6ddfdeaace9ef 100644
292     --- a/arch/powerpc/platforms/pseries/rng.c
293     +++ b/arch/powerpc/platforms/pseries/rng.c
294     @@ -10,6 +10,7 @@
295     #include <asm/archrandom.h>
296     #include <asm/machdep.h>
297     #include <asm/plpar_wrappers.h>
298     +#include "pseries.h"
299    
300    
301     static int pseries_get_random_long(unsigned long *v)
302     @@ -24,19 +25,13 @@ static int pseries_get_random_long(unsigned long *v)
303     return 0;
304     }
305    
306     -static __init int rng_init(void)
307     +void __init pseries_rng_init(void)
308     {
309     struct device_node *dn;
310    
311     dn = of_find_compatible_node(NULL, NULL, "ibm,random");
312     if (!dn)
313     - return -ENODEV;
314     -
315     - pr_info("Registering arch random hook.\n");
316     -
317     + return;
318     ppc_md.get_random_seed = pseries_get_random_long;
319     -
320     of_node_put(dn);
321     - return 0;
322     }
323     -machine_subsys_initcall(pseries, rng_init);
324     diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
325     index 16b744646ea94..d5abb25865e36 100644
326     --- a/arch/powerpc/platforms/pseries/setup.c
327     +++ b/arch/powerpc/platforms/pseries/setup.c
328     @@ -792,6 +792,8 @@ static void __init pSeries_setup_arch(void)
329    
330     if (swiotlb_force == SWIOTLB_FORCE)
331     ppc_swiotlb_enable = 1;
332     +
333     + pseries_rng_init();
334     }
335    
336     static void pseries_panic(char *str)
337     diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c
338     index 0eb1d1cc53a88..dddb32e53db8b 100644
339     --- a/arch/s390/kernel/perf_cpum_cf.c
340     +++ b/arch/s390/kernel/perf_cpum_cf.c
341     @@ -292,6 +292,26 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type)
342     return err;
343     }
344    
345     +/* Events CPU_CYLCES and INSTRUCTIONS can be submitted with two different
346     + * attribute::type values:
347     + * - PERF_TYPE_HARDWARE:
348     + * - pmu->type:
349     + * Handle both type of invocations identical. They address the same hardware.
350     + * The result is different when event modifiers exclude_kernel and/or
351     + * exclude_user are also set.
352     + */
353     +static int cpumf_pmu_event_type(struct perf_event *event)
354     +{
355     + u64 ev = event->attr.config;
356     +
357     + if (cpumf_generic_events_basic[PERF_COUNT_HW_CPU_CYCLES] == ev ||
358     + cpumf_generic_events_basic[PERF_COUNT_HW_INSTRUCTIONS] == ev ||
359     + cpumf_generic_events_user[PERF_COUNT_HW_CPU_CYCLES] == ev ||
360     + cpumf_generic_events_user[PERF_COUNT_HW_INSTRUCTIONS] == ev)
361     + return PERF_TYPE_HARDWARE;
362     + return PERF_TYPE_RAW;
363     +}
364     +
365     static int cpumf_pmu_event_init(struct perf_event *event)
366     {
367     unsigned int type = event->attr.type;
368     @@ -301,7 +321,7 @@ static int cpumf_pmu_event_init(struct perf_event *event)
369     err = __hw_perf_event_init(event, type);
370     else if (event->pmu->type == type)
371     /* Registered as unknown PMU */
372     - err = __hw_perf_event_init(event, PERF_TYPE_RAW);
373     + err = __hw_perf_event_init(event, cpumf_pmu_event_type(event));
374     else
375     return -ENOENT;
376    
377     diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c
378     index 69db8c93c1f99..9b87a9b98727b 100644
379     --- a/arch/xtensa/kernel/time.c
380     +++ b/arch/xtensa/kernel/time.c
381     @@ -160,6 +160,7 @@ static void __init calibrate_ccount(void)
382     cpu = of_find_compatible_node(NULL, NULL, "cdns,xtensa-cpu");
383     if (cpu) {
384     clk = of_clk_get(cpu, 0);
385     + of_node_put(cpu);
386     if (!IS_ERR(clk)) {
387     ccount_freq = clk_get_rate(clk);
388     return;
389     diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c
390     index 4edccb4d4a5ff..340479a328dc3 100644
391     --- a/arch/xtensa/platforms/xtfpga/setup.c
392     +++ b/arch/xtensa/platforms/xtfpga/setup.c
393     @@ -148,6 +148,7 @@ static int __init machine_setup(void)
394    
395     if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))
396     update_local_mac(eth);
397     + of_node_put(eth);
398     return 0;
399     }
400     arch_initcall(machine_setup);
401     diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
402     index 3d64c9331a82a..3c1e554df4eb2 100644
403     --- a/drivers/base/regmap/regmap-irq.c
404     +++ b/drivers/base/regmap/regmap-irq.c
405     @@ -214,6 +214,7 @@ static void regmap_irq_enable(struct irq_data *data)
406     struct regmap_irq_chip_data *d = irq_data_get_irq_chip_data(data);
407     struct regmap *map = d->map;
408     const struct regmap_irq *irq_data = irq_to_regmap_irq(d, data->hwirq);
409     + unsigned int reg = irq_data->reg_offset / map->reg_stride;
410     unsigned int mask, type;
411    
412     type = irq_data->type.type_falling_val | irq_data->type.type_rising_val;
413     @@ -230,14 +231,14 @@ static void regmap_irq_enable(struct irq_data *data)
414     * at the corresponding offset in regmap_irq_set_type().
415     */
416     if (d->chip->type_in_mask && type)
417     - mask = d->type_buf[irq_data->reg_offset / map->reg_stride];
418     + mask = d->type_buf[reg] & irq_data->mask;
419     else
420     mask = irq_data->mask;
421    
422     if (d->chip->clear_on_unmask)
423     d->clear_status = true;
424    
425     - d->mask_buf[irq_data->reg_offset / map->reg_stride] &= ~mask;
426     + d->mask_buf[reg] &= ~mask;
427     }
428    
429     static void regmap_irq_disable(struct irq_data *data)
430     diff --git a/drivers/char/random.c b/drivers/char/random.c
431     index 82f9ee4404069..1ef94d1125210 100644
432     --- a/drivers/char/random.c
433     +++ b/drivers/char/random.c
434     @@ -88,7 +88,7 @@ static RAW_NOTIFIER_HEAD(random_ready_chain);
435    
436     /* Control how we warn userspace. */
437     static struct ratelimit_state urandom_warning =
438     - RATELIMIT_STATE_INIT("warn_urandom_randomness", HZ, 3);
439     + RATELIMIT_STATE_INIT_FLAGS("urandom_warning", HZ, 3, RATELIMIT_MSG_ON_RELEASE);
440     static int ratelimit_disable __read_mostly =
441     IS_ENABLED(CONFIG_WARN_ALL_UNSEEDED_RANDOM);
442     module_param_named(ratelimit_disable, ratelimit_disable, int, 0644);
443     @@ -450,7 +450,7 @@ static ssize_t get_random_bytes_user(struct iov_iter *iter)
444    
445     /*
446     * Immediately overwrite the ChaCha key at index 4 with random
447     - * bytes, in case userspace causes copy_to_user() below to sleep
448     + * bytes, in case userspace causes copy_to_iter() below to sleep
449     * forever, so that we still retain forward secrecy in that case.
450     */
451     crng_make_state(chacha_state, (u8 *)&chacha_state[4], CHACHA_KEY_SIZE);
452     @@ -996,7 +996,7 @@ void add_interrupt_randomness(int irq)
453     if (new_count & MIX_INFLIGHT)
454     return;
455    
456     - if (new_count < 64 && !time_is_before_jiffies(fast_pool->last + HZ))
457     + if (new_count < 1024 && !time_is_before_jiffies(fast_pool->last + HZ))
458     return;
459    
460     if (unlikely(!fast_pool->mix.func))
461     diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
462     index e553c6a937f69..c6e9b7bd7618c 100644
463     --- a/drivers/dma-buf/udmabuf.c
464     +++ b/drivers/dma-buf/udmabuf.c
465     @@ -24,8 +24,11 @@ static vm_fault_t udmabuf_vm_fault(struct vm_fault *vmf)
466     {
467     struct vm_area_struct *vma = vmf->vma;
468     struct udmabuf *ubuf = vma->vm_private_data;
469     + pgoff_t pgoff = vmf->pgoff;
470    
471     - vmf->page = ubuf->pages[vmf->pgoff];
472     + if (pgoff >= ubuf->pagecount)
473     + return VM_FAULT_SIGBUS;
474     + vmf->page = ubuf->pages[pgoff];
475     get_page(vmf->page);
476     return 0;
477     }
478     diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c
479     index 98cd715ccc33c..8d09b619c1669 100644
480     --- a/drivers/gpio/gpio-vr41xx.c
481     +++ b/drivers/gpio/gpio-vr41xx.c
482     @@ -217,8 +217,6 @@ static int giu_get_irq(unsigned int irq)
483     printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n",
484     maskl, pendl, maskh, pendh);
485    
486     - atomic_inc(&irq_err_count);
487     -
488     return -EINVAL;
489     }
490    
491     diff --git a/drivers/gpio/gpio-winbond.c b/drivers/gpio/gpio-winbond.c
492     index 7f8f5b02e31d5..4b61d975cc0ec 100644
493     --- a/drivers/gpio/gpio-winbond.c
494     +++ b/drivers/gpio/gpio-winbond.c
495     @@ -385,12 +385,13 @@ static int winbond_gpio_get(struct gpio_chip *gc, unsigned int offset)
496     unsigned long *base = gpiochip_get_data(gc);
497     const struct winbond_gpio_info *info;
498     bool val;
499     + int ret;
500    
501     winbond_gpio_get_info(&offset, &info);
502    
503     - val = winbond_sio_enter(*base);
504     - if (val)
505     - return val;
506     + ret = winbond_sio_enter(*base);
507     + if (ret)
508     + return ret;
509    
510     winbond_sio_select_logical(*base, info->dev);
511    
512     diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
513     index 4f0c6d58e06fa..f0a5767b69f50 100644
514     --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
515     +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
516     @@ -245,6 +245,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms,
517     encoder = mdp4_lcdc_encoder_init(dev, panel_node);
518     if (IS_ERR(encoder)) {
519     DRM_DEV_ERROR(dev->dev, "failed to construct LCDC encoder\n");
520     + of_node_put(panel_node);
521     return PTR_ERR(encoder);
522     }
523    
524     @@ -254,6 +255,7 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms,
525     connector = mdp4_lvds_connector_init(dev, panel_node, encoder);
526     if (IS_ERR(connector)) {
527     DRM_DEV_ERROR(dev->dev, "failed to initialize LVDS connector\n");
528     + of_node_put(panel_node);
529     return PTR_ERR(connector);
530     }
531    
532     diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
533     index acf1cc2bee07b..014788ea493ac 100644
534     --- a/drivers/iio/accel/bma180.c
535     +++ b/drivers/iio/accel/bma180.c
536     @@ -793,11 +793,12 @@ static int bma180_probe(struct i2c_client *client,
537     data->trig->dev.parent = &client->dev;
538     data->trig->ops = &bma180_trigger_ops;
539     iio_trigger_set_drvdata(data->trig, indio_dev);
540     - indio_dev->trig = iio_trigger_get(data->trig);
541    
542     ret = iio_trigger_register(data->trig);
543     if (ret)
544     goto err_trigger_free;
545     +
546     + indio_dev->trig = iio_trigger_get(data->trig);
547     }
548    
549     ret = iio_triggered_buffer_setup(indio_dev, NULL,
550     diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
551     index eaaee6f2a978b..74942bfc676a1 100644
552     --- a/drivers/iio/accel/mma8452.c
553     +++ b/drivers/iio/accel/mma8452.c
554     @@ -1489,10 +1489,14 @@ static int mma8452_reset(struct i2c_client *client)
555     int i;
556     int ret;
557    
558     - ret = i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
559     + /*
560     + * Find on fxls8471, after config reset bit, it reset immediately,
561     + * and will not give ACK, so here do not check the return value.
562     + * The following code will read the reset register, and check whether
563     + * this reset works.
564     + */
565     + i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
566     MMA8452_CTRL_REG2_RST);
567     - if (ret < 0)
568     - return ret;
569    
570     for (i = 0; i < 10; i++) {
571     usleep_range(100, 200);
572     diff --git a/drivers/iio/accel/mxc4005.c b/drivers/iio/accel/mxc4005.c
573     index d81b02642a0b3..110b7ea76ef2f 100644
574     --- a/drivers/iio/accel/mxc4005.c
575     +++ b/drivers/iio/accel/mxc4005.c
576     @@ -462,8 +462,6 @@ static int mxc4005_probe(struct i2c_client *client,
577     data->dready_trig->dev.parent = &client->dev;
578     data->dready_trig->ops = &mxc4005_trigger_ops;
579     iio_trigger_set_drvdata(data->dready_trig, indio_dev);
580     - indio_dev->trig = data->dready_trig;
581     - iio_trigger_get(indio_dev->trig);
582     ret = devm_iio_trigger_register(&client->dev,
583     data->dready_trig);
584     if (ret) {
585     @@ -471,6 +469,8 @@ static int mxc4005_probe(struct i2c_client *client,
586     "failed to register trigger\n");
587     return ret;
588     }
589     +
590     + indio_dev->trig = iio_trigger_get(data->dready_trig);
591     }
592    
593     return devm_iio_device_register(&client->dev, indio_dev);
594     diff --git a/drivers/iio/adc/axp288_adc.c b/drivers/iio/adc/axp288_adc.c
595     index 8ea2aed6d6f5a..99ceaa09ef392 100644
596     --- a/drivers/iio/adc/axp288_adc.c
597     +++ b/drivers/iio/adc/axp288_adc.c
598     @@ -196,6 +196,14 @@ static const struct dmi_system_id axp288_adc_ts_bias_override[] = {
599     },
600     .driver_data = (void *)(uintptr_t)AXP288_ADC_TS_BIAS_80UA,
601     },
602     + {
603     + /* Nuvision Solo 10 Draw */
604     + .matches = {
605     + DMI_MATCH(DMI_SYS_VENDOR, "TMAX"),
606     + DMI_MATCH(DMI_PRODUCT_NAME, "TM101W610L"),
607     + },
608     + .driver_data = (void *)(uintptr_t)AXP288_ADC_TS_BIAS_80UA,
609     + },
610     {}
611     };
612    
613     diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
614     index 14d6a537289cb..0ecec5a15fbf0 100644
615     --- a/drivers/iio/adc/stm32-adc-core.c
616     +++ b/drivers/iio/adc/stm32-adc-core.c
617     @@ -815,7 +815,7 @@ static const struct stm32_adc_priv_cfg stm32h7_adc_priv_cfg = {
618     static const struct stm32_adc_priv_cfg stm32mp1_adc_priv_cfg = {
619     .regs = &stm32h7_adc_common_regs,
620     .clk_sel = stm32h7_adc_clk_sel,
621     - .max_clk_rate_hz = 40000000,
622     + .max_clk_rate_hz = 36000000,
623     .has_syscfg = HAS_VBOOSTER | HAS_ANASWVDD,
624     .num_irqs = 2,
625     };
626     diff --git a/drivers/iio/chemical/ccs811.c b/drivers/iio/chemical/ccs811.c
627     index 7bf4e9a16a6ae..a2ee6bbda7f4d 100644
628     --- a/drivers/iio/chemical/ccs811.c
629     +++ b/drivers/iio/chemical/ccs811.c
630     @@ -418,11 +418,11 @@ static int ccs811_probe(struct i2c_client *client,
631     data->drdy_trig->dev.parent = &client->dev;
632     data->drdy_trig->ops = &ccs811_trigger_ops;
633     iio_trigger_set_drvdata(data->drdy_trig, indio_dev);
634     - indio_dev->trig = data->drdy_trig;
635     - iio_trigger_get(indio_dev->trig);
636     ret = iio_trigger_register(data->drdy_trig);
637     if (ret)
638     goto err_poweroff;
639     +
640     + indio_dev->trig = iio_trigger_get(data->drdy_trig);
641     }
642    
643     ret = iio_triggered_buffer_setup(indio_dev, NULL,
644     diff --git a/drivers/iio/gyro/mpu3050-core.c b/drivers/iio/gyro/mpu3050-core.c
645     index 75db410b5054e..0f5de4afe33f6 100644
646     --- a/drivers/iio/gyro/mpu3050-core.c
647     +++ b/drivers/iio/gyro/mpu3050-core.c
648     @@ -874,6 +874,7 @@ static int mpu3050_power_up(struct mpu3050 *mpu3050)
649     ret = regmap_update_bits(mpu3050->map, MPU3050_PWR_MGM,
650     MPU3050_PWR_MGM_SLEEP, 0);
651     if (ret) {
652     + regulator_bulk_disable(ARRAY_SIZE(mpu3050->regs), mpu3050->regs);
653     dev_err(mpu3050->dev, "error setting power mode\n");
654     return ret;
655     }
656     diff --git a/drivers/iio/trigger/iio-trig-sysfs.c b/drivers/iio/trigger/iio-trig-sysfs.c
657     index e09e58072872c..2277d6336ac06 100644
658     --- a/drivers/iio/trigger/iio-trig-sysfs.c
659     +++ b/drivers/iio/trigger/iio-trig-sysfs.c
660     @@ -196,6 +196,7 @@ static int iio_sysfs_trigger_remove(int id)
661     }
662    
663     iio_trigger_unregister(t->trig);
664     + irq_work_sync(&t->work);
665     iio_trigger_free(t->trig);
666    
667     list_del(&t->l);
668     diff --git a/drivers/md/dm-era-target.c b/drivers/md/dm-era-target.c
669     index 6b0b3a13ab4a2..418f590b99b8d 100644
670     --- a/drivers/md/dm-era-target.c
671     +++ b/drivers/md/dm-era-target.c
672     @@ -1397,7 +1397,7 @@ static void start_worker(struct era *era)
673     static void stop_worker(struct era *era)
674     {
675     atomic_set(&era->suspended, 1);
676     - flush_workqueue(era->wq);
677     + drain_workqueue(era->wq);
678     }
679    
680     /*----------------------------------------------------------------
681     @@ -1581,6 +1581,12 @@ static void era_postsuspend(struct dm_target *ti)
682     }
683    
684     stop_worker(era);
685     +
686     + r = metadata_commit(era->md);
687     + if (r) {
688     + DMERR("%s: metadata_commit failed", __func__);
689     + /* FIXME: fail mode */
690     + }
691     }
692    
693     static int era_preresume(struct dm_target *ti)
694     diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
695     index 8b15f53cbdd95..fe3a9473f3387 100644
696     --- a/drivers/md/dm-log.c
697     +++ b/drivers/md/dm-log.c
698     @@ -615,7 +615,7 @@ static int disk_resume(struct dm_dirty_log *log)
699     log_clear_bit(lc, lc->clean_bits, i);
700    
701     /* clear any old bits -- device has shrunk */
702     - for (i = lc->region_count; i % (sizeof(*lc->clean_bits) << BYTE_SHIFT); i++)
703     + for (i = lc->region_count; i % BITS_PER_LONG; i++)
704     log_clear_bit(lc, lc->clean_bits, i);
705    
706     /* copy clean across to sync */
707     diff --git a/drivers/mmc/host/sdhci-pci-o2micro.c b/drivers/mmc/host/sdhci-pci-o2micro.c
708     index 41a2394313dd0..3170c19683c49 100644
709     --- a/drivers/mmc/host/sdhci-pci-o2micro.c
710     +++ b/drivers/mmc/host/sdhci-pci-o2micro.c
711     @@ -145,6 +145,8 @@ static int sdhci_o2_get_cd(struct mmc_host *mmc)
712    
713     if (!(sdhci_readw(host, O2_PLL_DLL_WDT_CONTROL1) & O2_PLL_LOCK_STATUS))
714     sdhci_o2_enable_internal_clock(host);
715     + else
716     + sdhci_o2_wait_card_detect_stable(host);
717    
718     return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT);
719     }
720     diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
721     index 02218c3b548f9..41f7dd58bdcf8 100644
722     --- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
723     +++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
724     @@ -682,7 +682,7 @@ static void gpmi_nfc_compute_timings(struct gpmi_nand_data *this,
725     hw->timing0 = BF_GPMI_TIMING0_ADDRESS_SETUP(addr_setup_cycles) |
726     BF_GPMI_TIMING0_DATA_HOLD(data_hold_cycles) |
727     BF_GPMI_TIMING0_DATA_SETUP(data_setup_cycles);
728     - hw->timing1 = BF_GPMI_TIMING1_BUSY_TIMEOUT(busy_timeout_cycles * 4096);
729     + hw->timing1 = BF_GPMI_TIMING1_BUSY_TIMEOUT(DIV_ROUND_UP(busy_timeout_cycles, 4096));
730    
731     /*
732     * Derive NFC ideal delay from {3}:
733     diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
734     index d6ecd03b60452..246bcbd650b4b 100644
735     --- a/drivers/net/bonding/bond_main.c
736     +++ b/drivers/net/bonding/bond_main.c
737     @@ -3071,9 +3071,11 @@ re_arm:
738     if (!rtnl_trylock())
739     return;
740    
741     - if (should_notify_peers)
742     + if (should_notify_peers) {
743     + bond->send_peer_notif--;
744     call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
745     bond->dev);
746     + }
747     if (should_notify_rtnl) {
748     bond_slave_state_notify(bond);
749     bond_slave_link_notify(bond);
750     diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
751     index fc9ff985a62bd..b297a3ca22fc8 100644
752     --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
753     +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
754     @@ -2337,6 +2337,42 @@ ice_setup_autoneg(struct ice_port_info *p, struct ethtool_link_ksettings *ks,
755     return err;
756     }
757    
758     +/**
759     + * ice_set_phy_type_from_speed - set phy_types based on speeds
760     + * and advertised modes
761     + * @ks: ethtool link ksettings struct
762     + * @phy_type_low: pointer to the lower part of phy_type
763     + * @phy_type_high: pointer to the higher part of phy_type
764     + * @adv_link_speed: targeted link speeds bitmap
765     + */
766     +static void
767     +ice_set_phy_type_from_speed(const struct ethtool_link_ksettings *ks,
768     + u64 *phy_type_low, u64 *phy_type_high,
769     + u16 adv_link_speed)
770     +{
771     + /* Handle 1000M speed in a special way because ice_update_phy_type
772     + * enables all link modes, but having mixed copper and optical
773     + * standards is not supported.
774     + */
775     + adv_link_speed &= ~ICE_AQ_LINK_SPEED_1000MB;
776     +
777     + if (ethtool_link_ksettings_test_link_mode(ks, advertising,
778     + 1000baseT_Full))
779     + *phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_T |
780     + ICE_PHY_TYPE_LOW_1G_SGMII;
781     +
782     + if (ethtool_link_ksettings_test_link_mode(ks, advertising,
783     + 1000baseKX_Full))
784     + *phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_KX;
785     +
786     + if (ethtool_link_ksettings_test_link_mode(ks, advertising,
787     + 1000baseX_Full))
788     + *phy_type_low |= ICE_PHY_TYPE_LOW_1000BASE_SX |
789     + ICE_PHY_TYPE_LOW_1000BASE_LX;
790     +
791     + ice_update_phy_type(phy_type_low, phy_type_high, adv_link_speed);
792     +}
793     +
794     /**
795     * ice_set_link_ksettings - Set Speed and Duplex
796     * @netdev: network interface device structure
797     @@ -2472,7 +2508,8 @@ ice_set_link_ksettings(struct net_device *netdev,
798     adv_link_speed = curr_link_speed;
799    
800     /* Convert the advertise link speeds to their corresponded PHY_TYPE */
801     - ice_update_phy_type(&phy_type_low, &phy_type_high, adv_link_speed);
802     + ice_set_phy_type_from_speed(ks, &phy_type_low, &phy_type_high,
803     + adv_link_speed);
804    
805     if (!autoneg_changed && adv_link_speed == curr_link_speed) {
806     netdev_info(netdev, "Nothing changed, exiting without setting anything.\n");
807     diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
808     index 26c8d09ad4ddb..8734dfd001bbd 100644
809     --- a/drivers/net/ethernet/intel/igb/igb_main.c
810     +++ b/drivers/net/ethernet/intel/igb/igb_main.c
811     @@ -9404,11 +9404,10 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
812     struct e1000_hw *hw = &adapter->hw;
813     u32 dmac_thr;
814     u16 hwm;
815     + u32 reg;
816    
817     if (hw->mac.type > e1000_82580) {
818     if (adapter->flags & IGB_FLAG_DMAC) {
819     - u32 reg;
820     -
821     /* force threshold to 0. */
822     wr32(E1000_DMCTXTH, 0);
823    
824     @@ -9441,7 +9440,6 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
825     /* Disable BMC-to-OS Watchdog Enable */
826     if (hw->mac.type != e1000_i354)
827     reg &= ~E1000_DMACR_DC_BMC2OSW_EN;
828     -
829     wr32(E1000_DMACR, reg);
830    
831     /* no lower threshold to disable
832     @@ -9458,12 +9456,12 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
833     */
834     wr32(E1000_DMCTXTH, (IGB_MIN_TXPBSIZE -
835     (IGB_TX_BUF_4096 + adapter->max_frame_size)) >> 6);
836     + }
837    
838     - /* make low power state decision controlled
839     - * by DMA coal
840     - */
841     + if (hw->mac.type >= e1000_i210 ||
842     + (adapter->flags & IGB_FLAG_DMAC)) {
843     reg = rd32(E1000_PCIEMISC);
844     - reg &= ~E1000_PCIEMISC_LX_DECISION;
845     + reg |= E1000_PCIEMISC_LX_DECISION;
846     wr32(E1000_PCIEMISC, reg);
847     } /* endif adapter->dmac is not disabled */
848     } else if (hw->mac.type == e1000_82580) {
849     diff --git a/drivers/net/phy/aquantia_main.c b/drivers/net/phy/aquantia_main.c
850     index 975789d9349dc..75d8351ee2506 100644
851     --- a/drivers/net/phy/aquantia_main.c
852     +++ b/drivers/net/phy/aquantia_main.c
853     @@ -34,6 +34,8 @@
854     #define MDIO_AN_VEND_PROV 0xc400
855     #define MDIO_AN_VEND_PROV_1000BASET_FULL BIT(15)
856     #define MDIO_AN_VEND_PROV_1000BASET_HALF BIT(14)
857     +#define MDIO_AN_VEND_PROV_5000BASET_FULL BIT(11)
858     +#define MDIO_AN_VEND_PROV_2500BASET_FULL BIT(10)
859     #define MDIO_AN_VEND_PROV_DOWNSHIFT_EN BIT(4)
860     #define MDIO_AN_VEND_PROV_DOWNSHIFT_MASK GENMASK(3, 0)
861     #define MDIO_AN_VEND_PROV_DOWNSHIFT_DFLT 4
862     @@ -230,9 +232,20 @@ static int aqr_config_aneg(struct phy_device *phydev)
863     phydev->advertising))
864     reg |= MDIO_AN_VEND_PROV_1000BASET_HALF;
865    
866     + /* Handle the case when the 2.5G and 5G speeds are not advertised */
867     + if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
868     + phydev->advertising))
869     + reg |= MDIO_AN_VEND_PROV_2500BASET_FULL;
870     +
871     + if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
872     + phydev->advertising))
873     + reg |= MDIO_AN_VEND_PROV_5000BASET_FULL;
874     +
875     ret = phy_modify_mmd_changed(phydev, MDIO_MMD_AN, MDIO_AN_VEND_PROV,
876     MDIO_AN_VEND_PROV_1000BASET_HALF |
877     - MDIO_AN_VEND_PROV_1000BASET_FULL, reg);
878     + MDIO_AN_VEND_PROV_1000BASET_FULL |
879     + MDIO_AN_VEND_PROV_2500BASET_FULL |
880     + MDIO_AN_VEND_PROV_5000BASET_FULL, reg);
881     if (ret < 0)
882     return ret;
883     if (ret > 0)
884     diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
885     index 37c2cecd1e503..f4c03518d7d23 100644
886     --- a/drivers/net/virtio_net.c
887     +++ b/drivers/net/virtio_net.c
888     @@ -2393,7 +2393,6 @@ static const struct ethtool_ops virtnet_ethtool_ops = {
889     static void virtnet_freeze_down(struct virtio_device *vdev)
890     {
891     struct virtnet_info *vi = vdev->priv;
892     - int i;
893    
894     /* Make sure no work handler is accessing the device */
895     flush_work(&vi->config_work);
896     @@ -2401,14 +2400,8 @@ static void virtnet_freeze_down(struct virtio_device *vdev)
897     netif_tx_lock_bh(vi->dev);
898     netif_device_detach(vi->dev);
899     netif_tx_unlock_bh(vi->dev);
900     - cancel_delayed_work_sync(&vi->refill);
901     -
902     - if (netif_running(vi->dev)) {
903     - for (i = 0; i < vi->max_queue_pairs; i++) {
904     - napi_disable(&vi->rq[i].napi);
905     - virtnet_napi_tx_disable(&vi->sq[i].napi);
906     - }
907     - }
908     + if (netif_running(vi->dev))
909     + virtnet_close(vi->dev);
910     }
911    
912     static int init_vqs(struct virtnet_info *vi);
913     @@ -2416,7 +2409,7 @@ static int init_vqs(struct virtnet_info *vi);
914     static int virtnet_restore_up(struct virtio_device *vdev)
915     {
916     struct virtnet_info *vi = vdev->priv;
917     - int err, i;
918     + int err;
919    
920     err = init_vqs(vi);
921     if (err)
922     @@ -2425,15 +2418,9 @@ static int virtnet_restore_up(struct virtio_device *vdev)
923     virtio_device_ready(vdev);
924    
925     if (netif_running(vi->dev)) {
926     - for (i = 0; i < vi->curr_queue_pairs; i++)
927     - if (!try_fill_recv(vi, &vi->rq[i], GFP_KERNEL))
928     - schedule_delayed_work(&vi->refill, 0);
929     -
930     - for (i = 0; i < vi->max_queue_pairs; i++) {
931     - virtnet_napi_enable(vi->rq[i].vq, &vi->rq[i].napi);
932     - virtnet_napi_tx_enable(vi, vi->sq[i].vq,
933     - &vi->sq[i].napi);
934     - }
935     + err = virtnet_open(vi->dev);
936     + if (err)
937     + return err;
938     }
939    
940     netif_tx_lock_bh(vi->dev);
941     diff --git a/drivers/soc/bcm/brcmstb/pm/pm-arm.c b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
942     index b1062334e6089..c6ec7d95bcfcc 100644
943     --- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c
944     +++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
945     @@ -780,6 +780,7 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
946     }
947    
948     ret = brcmstb_init_sram(dn);
949     + of_node_put(dn);
950     if (ret) {
951     pr_err("error setting up SRAM for PM\n");
952     return ret;
953     diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
954     index d1ab8561e2581..c3df1660cb5c5 100644
955     --- a/drivers/tty/vt/vt.c
956     +++ b/drivers/tty/vt/vt.c
957     @@ -4541,16 +4541,8 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op)
958    
959     if (op->data && font.charcount > op->charcount)
960     rc = -ENOSPC;
961     - if (!(op->flags & KD_FONT_FLAG_OLD)) {
962     - if (font.width > op->width || font.height > op->height)
963     - rc = -ENOSPC;
964     - } else {
965     - if (font.width != 8)
966     - rc = -EIO;
967     - else if ((op->height && font.height > op->height) ||
968     - font.height > 32)
969     - rc = -ENOSPC;
970     - }
971     + if (font.width > op->width || font.height > op->height)
972     + rc = -ENOSPC;
973     if (rc)
974     goto out;
975    
976     @@ -4578,7 +4570,7 @@ static int con_font_set(struct vc_data *vc, struct console_font_op *op)
977     return -EINVAL;
978     if (op->charcount > 512)
979     return -EINVAL;
980     - if (op->width <= 0 || op->width > 32 || op->height > 32)
981     + if (op->width <= 0 || op->width > 32 || !op->height || op->height > 32)
982     return -EINVAL;
983     size = (op->width+7)/8 * 32 * op->charcount;
984     if (size > max_font_size)
985     @@ -4588,31 +4580,6 @@ static int con_font_set(struct vc_data *vc, struct console_font_op *op)
986     if (IS_ERR(font.data))
987     return PTR_ERR(font.data);
988    
989     - if (!op->height) { /* Need to guess font height [compat] */
990     - int h, i;
991     - u8 *charmap = font.data;
992     -
993     - /*
994     - * If from KDFONTOP ioctl, don't allow things which can be done
995     - * in userland,so that we can get rid of this soon
996     - */
997     - if (!(op->flags & KD_FONT_FLAG_OLD)) {
998     - kfree(font.data);
999     - return -EINVAL;
1000     - }
1001     -
1002     - for (h = 32; h > 0; h--)
1003     - for (i = 0; i < op->charcount; i++)
1004     - if (charmap[32*i+h-1])
1005     - goto nonzero;
1006     -
1007     - kfree(font.data);
1008     - return -EINVAL;
1009     -
1010     - nonzero:
1011     - op->height = h;
1012     - }
1013     -
1014     font.charcount = op->charcount;
1015     font.width = op->width;
1016     font.height = op->height;
1017     diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
1018     index 312857168dad3..f623b3859e980 100644
1019     --- a/drivers/tty/vt/vt_ioctl.c
1020     +++ b/drivers/tty/vt/vt_ioctl.c
1021     @@ -241,48 +241,6 @@ int vt_waitactive(int n)
1022     #define GPLAST 0x3df
1023     #define GPNUM (GPLAST - GPFIRST + 1)
1024    
1025     -
1026     -
1027     -static inline int
1028     -do_fontx_ioctl(struct vc_data *vc, int cmd, struct consolefontdesc __user *user_cfd, int perm, struct console_font_op *op)
1029     -{
1030     - struct consolefontdesc cfdarg;
1031     - int i;
1032     -
1033     - if (copy_from_user(&cfdarg, user_cfd, sizeof(struct consolefontdesc)))
1034     - return -EFAULT;
1035     -
1036     - switch (cmd) {
1037     - case PIO_FONTX:
1038     - if (!perm)
1039     - return -EPERM;
1040     - op->op = KD_FONT_OP_SET;
1041     - op->flags = KD_FONT_FLAG_OLD;
1042     - op->width = 8;
1043     - op->height = cfdarg.charheight;
1044     - op->charcount = cfdarg.charcount;
1045     - op->data = cfdarg.chardata;
1046     - return con_font_op(vc, op);
1047     -
1048     - case GIO_FONTX:
1049     - op->op = KD_FONT_OP_GET;
1050     - op->flags = KD_FONT_FLAG_OLD;
1051     - op->width = 8;
1052     - op->height = cfdarg.charheight;
1053     - op->charcount = cfdarg.charcount;
1054     - op->data = cfdarg.chardata;
1055     - i = con_font_op(vc, op);
1056     - if (i)
1057     - return i;
1058     - cfdarg.charheight = op->height;
1059     - cfdarg.charcount = op->charcount;
1060     - if (copy_to_user(user_cfd, &cfdarg, sizeof(struct consolefontdesc)))
1061     - return -EFAULT;
1062     - return 0;
1063     - }
1064     - return -EINVAL;
1065     -}
1066     -
1067     static inline int
1068     do_unimap_ioctl(int cmd, struct unimapdesc __user *user_ud, int perm, struct vc_data *vc)
1069     {
1070     @@ -919,30 +877,6 @@ int vt_ioctl(struct tty_struct *tty,
1071     break;
1072     }
1073    
1074     - case PIO_FONT: {
1075     - if (!perm)
1076     - return -EPERM;
1077     - op.op = KD_FONT_OP_SET;
1078     - op.flags = KD_FONT_FLAG_OLD | KD_FONT_FLAG_DONT_RECALC; /* Compatibility */
1079     - op.width = 8;
1080     - op.height = 0;
1081     - op.charcount = 256;
1082     - op.data = up;
1083     - ret = con_font_op(vc, &op);
1084     - break;
1085     - }
1086     -
1087     - case GIO_FONT: {
1088     - op.op = KD_FONT_OP_GET;
1089     - op.flags = KD_FONT_FLAG_OLD;
1090     - op.width = 8;
1091     - op.height = 32;
1092     - op.charcount = 256;
1093     - op.data = up;
1094     - ret = con_font_op(vc, &op);
1095     - break;
1096     - }
1097     -
1098     case PIO_CMAP:
1099     if (!perm)
1100     ret = -EPERM;
1101     @@ -954,36 +888,6 @@ int vt_ioctl(struct tty_struct *tty,
1102     ret = con_get_cmap(up);
1103     break;
1104    
1105     - case PIO_FONTX:
1106     - case GIO_FONTX:
1107     - ret = do_fontx_ioctl(vc, cmd, up, perm, &op);
1108     - break;
1109     -
1110     - case PIO_FONTRESET:
1111     - {
1112     - if (!perm)
1113     - return -EPERM;
1114     -
1115     -#ifdef BROKEN_GRAPHICS_PROGRAMS
1116     - /* With BROKEN_GRAPHICS_PROGRAMS defined, the default
1117     - font is not saved. */
1118     - ret = -ENOSYS;
1119     - break;
1120     -#else
1121     - {
1122     - op.op = KD_FONT_OP_SET_DEFAULT;
1123     - op.data = NULL;
1124     - ret = con_font_op(vc, &op);
1125     - if (ret)
1126     - break;
1127     - console_lock();
1128     - con_set_default_unimap(vc);
1129     - console_unlock();
1130     - break;
1131     - }
1132     -#endif
1133     - }
1134     -
1135     case KDFONTOP: {
1136     if (copy_from_user(&op, up, sizeof(op))) {
1137     ret = -EFAULT;
1138     @@ -1097,54 +1001,6 @@ void vc_SAK(struct work_struct *work)
1139    
1140     #ifdef CONFIG_COMPAT
1141    
1142     -struct compat_consolefontdesc {
1143     - unsigned short charcount; /* characters in font (256 or 512) */
1144     - unsigned short charheight; /* scan lines per character (1-32) */
1145     - compat_caddr_t chardata; /* font data in expanded form */
1146     -};
1147     -
1148     -static inline int
1149     -compat_fontx_ioctl(struct vc_data *vc, int cmd,
1150     - struct compat_consolefontdesc __user *user_cfd,
1151     - int perm, struct console_font_op *op)
1152     -{
1153     - struct compat_consolefontdesc cfdarg;
1154     - int i;
1155     -
1156     - if (copy_from_user(&cfdarg, user_cfd, sizeof(struct compat_consolefontdesc)))
1157     - return -EFAULT;
1158     -
1159     - switch (cmd) {
1160     - case PIO_FONTX:
1161     - if (!perm)
1162     - return -EPERM;
1163     - op->op = KD_FONT_OP_SET;
1164     - op->flags = KD_FONT_FLAG_OLD;
1165     - op->width = 8;
1166     - op->height = cfdarg.charheight;
1167     - op->charcount = cfdarg.charcount;
1168     - op->data = compat_ptr(cfdarg.chardata);
1169     - return con_font_op(vc, op);
1170     -
1171     - case GIO_FONTX:
1172     - op->op = KD_FONT_OP_GET;
1173     - op->flags = KD_FONT_FLAG_OLD;
1174     - op->width = 8;
1175     - op->height = cfdarg.charheight;
1176     - op->charcount = cfdarg.charcount;
1177     - op->data = compat_ptr(cfdarg.chardata);
1178     - i = con_font_op(vc, op);
1179     - if (i)
1180     - return i;
1181     - cfdarg.charheight = op->height;
1182     - cfdarg.charcount = op->charcount;
1183     - if (copy_to_user(user_cfd, &cfdarg, sizeof(struct compat_consolefontdesc)))
1184     - return -EFAULT;
1185     - return 0;
1186     - }
1187     - return -EINVAL;
1188     -}
1189     -
1190     struct compat_console_font_op {
1191     compat_uint_t op; /* operation code KD_FONT_OP_* */
1192     compat_uint_t flags; /* KD_FONT_FLAG_* */
1193     @@ -1221,9 +1077,6 @@ long vt_compat_ioctl(struct tty_struct *tty,
1194     /*
1195     * these need special handlers for incompatible data structures
1196     */
1197     - case PIO_FONTX:
1198     - case GIO_FONTX:
1199     - return compat_fontx_ioctl(vc, cmd, up, perm, &op);
1200    
1201     case KDFONTOP:
1202     return compat_kdfontop_ioctl(up, perm, &op, vc);
1203     diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
1204     index 8f18e7b6cadf4..21c299c85505d 100644
1205     --- a/drivers/usb/chipidea/udc.c
1206     +++ b/drivers/usb/chipidea/udc.c
1207     @@ -921,6 +921,9 @@ isr_setup_status_complete(struct usb_ep *ep, struct usb_request *req)
1208     struct ci_hdrc *ci = req->context;
1209     unsigned long flags;
1210    
1211     + if (req->status < 0)
1212     + return;
1213     +
1214     if (ci->setaddr) {
1215     hw_usb_set_address(ci, ci->address);
1216     ci->setaddr = false;
1217     diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
1218     index dd46c15c4853f..9c066d1c512b1 100644
1219     --- a/drivers/usb/host/xhci-hub.c
1220     +++ b/drivers/usb/host/xhci-hub.c
1221     @@ -566,7 +566,7 @@ struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd)
1222     * It will release and re-aquire the lock while calling ACPI
1223     * method.
1224     */
1225     -static void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd,
1226     +void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd,
1227     u16 index, bool on, unsigned long *flags)
1228     {
1229     struct xhci_hub *rhub;
1230     diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
1231     index 2f59d447411b5..9fe35bb67731e 100644
1232     --- a/drivers/usb/host/xhci.c
1233     +++ b/drivers/usb/host/xhci.c
1234     @@ -775,6 +775,8 @@ static void xhci_stop(struct usb_hcd *hcd)
1235     void xhci_shutdown(struct usb_hcd *hcd)
1236     {
1237     struct xhci_hcd *xhci = hcd_to_xhci(hcd);
1238     + unsigned long flags;
1239     + int i;
1240    
1241     if (xhci->quirks & XHCI_SPURIOUS_REBOOT)
1242     usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev));
1243     @@ -790,12 +792,21 @@ void xhci_shutdown(struct usb_hcd *hcd)
1244     del_timer_sync(&xhci->shared_hcd->rh_timer);
1245     }
1246    
1247     - spin_lock_irq(&xhci->lock);
1248     + spin_lock_irqsave(&xhci->lock, flags);
1249     xhci_halt(xhci);
1250     +
1251     + /* Power off USB2 ports*/
1252     + for (i = 0; i < xhci->usb2_rhub.num_ports; i++)
1253     + xhci_set_port_power(xhci, xhci->main_hcd, i, false, &flags);
1254     +
1255     + /* Power off USB3 ports*/
1256     + for (i = 0; i < xhci->usb3_rhub.num_ports; i++)
1257     + xhci_set_port_power(xhci, xhci->shared_hcd, i, false, &flags);
1258     +
1259     /* Workaround for spurious wakeups at shutdown with HSW */
1260     if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
1261     xhci_reset(xhci, XHCI_RESET_SHORT_USEC);
1262     - spin_unlock_irq(&xhci->lock);
1263     + spin_unlock_irqrestore(&xhci->lock, flags);
1264    
1265     xhci_cleanup_msix(xhci);
1266    
1267     diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
1268     index 4b05d767e08f7..a9031f4949842 100644
1269     --- a/drivers/usb/host/xhci.h
1270     +++ b/drivers/usb/host/xhci.h
1271     @@ -2155,6 +2155,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
1272     int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
1273     int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1);
1274     struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd);
1275     +void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, u16 index,
1276     + bool on, unsigned long *flags);
1277    
1278     void xhci_hc_died(struct xhci_hcd *xhci);
1279    
1280     diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1281     index ec4fdb8140917..2317ed357d8ef 100644
1282     --- a/drivers/usb/serial/option.c
1283     +++ b/drivers/usb/serial/option.c
1284     @@ -252,10 +252,12 @@ static void option_instat_callback(struct urb *urb);
1285     #define QUECTEL_PRODUCT_EG95 0x0195
1286     #define QUECTEL_PRODUCT_BG96 0x0296
1287     #define QUECTEL_PRODUCT_EP06 0x0306
1288     +#define QUECTEL_PRODUCT_EM05G 0x030a
1289     #define QUECTEL_PRODUCT_EM12 0x0512
1290     #define QUECTEL_PRODUCT_RM500Q 0x0800
1291     #define QUECTEL_PRODUCT_EC200S_CN 0x6002
1292     #define QUECTEL_PRODUCT_EC200T 0x6026
1293     +#define QUECTEL_PRODUCT_RM500K 0x7001
1294    
1295     #define CMOTECH_VENDOR_ID 0x16d8
1296     #define CMOTECH_PRODUCT_6001 0x6001
1297     @@ -1134,6 +1136,8 @@ static const struct usb_device_id option_ids[] = {
1298     { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff),
1299     .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
1300     { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },
1301     + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff),
1302     + .driver_info = RSVD(6) | ZLP },
1303     { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
1304     .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
1305     { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
1306     @@ -1147,6 +1151,7 @@ static const struct usb_device_id option_ids[] = {
1307     .driver_info = ZLP },
1308     { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) },
1309     { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) },
1310     + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) },
1311    
1312     { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
1313     { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
1314     @@ -1279,6 +1284,7 @@ static const struct usb_device_id option_ids[] = {
1315     .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1316     { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1231, 0xff), /* Telit LE910Cx (RNDIS) */
1317     .driver_info = NCTRL(2) | RSVD(3) },
1318     + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x1250, 0xff, 0x00, 0x00) }, /* Telit LE910Cx (rmnet) */
1319     { USB_DEVICE(TELIT_VENDOR_ID, 0x1260),
1320     .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1321     { USB_DEVICE(TELIT_VENDOR_ID, 0x1261),
1322     diff --git a/drivers/xen/features.c b/drivers/xen/features.c
1323     index 25c053b096051..2c306de228db3 100644
1324     --- a/drivers/xen/features.c
1325     +++ b/drivers/xen/features.c
1326     @@ -29,6 +29,6 @@ void xen_setup_features(void)
1327     if (HYPERVISOR_xen_version(XENVER_get_features, &fi) < 0)
1328     break;
1329     for (j = 0; j < 32; j++)
1330     - xen_features[i * 32 + j] = !!(fi.submap & 1<<j);
1331     + xen_features[i * 32 + j] = !!(fi.submap & 1U << j);
1332     }
1333     }
1334     diff --git a/fs/afs/inode.c b/fs/afs/inode.c
1335     index 90eac3ec01cbc..622363af4c1bf 100644
1336     --- a/fs/afs/inode.c
1337     +++ b/fs/afs/inode.c
1338     @@ -739,7 +739,8 @@ int afs_getattr(const struct path *path, struct kstat *stat,
1339    
1340     _enter("{ ino=%lu v=%u }", inode->i_ino, inode->i_generation);
1341    
1342     - if (!(query_flags & AT_STATX_DONT_SYNC) &&
1343     + if (vnode->volume &&
1344     + !(query_flags & AT_STATX_DONT_SYNC) &&
1345     !test_bit(AFS_VNODE_CB_PROMISED, &vnode->flags)) {
1346     key = afs_request_key(vnode->volume->cell);
1347     if (IS_ERR(key))
1348     diff --git a/include/linux/kd.h b/include/linux/kd.h
1349     deleted file mode 100644
1350     index b130a18f860f0..0000000000000
1351     --- a/include/linux/kd.h
1352     +++ /dev/null
1353     @@ -1,8 +0,0 @@
1354     -/* SPDX-License-Identifier: GPL-2.0 */
1355     -#ifndef _LINUX_KD_H
1356     -#define _LINUX_KD_H
1357     -
1358     -#include <uapi/linux/kd.h>
1359     -
1360     -#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface [compat] */
1361     -#endif /* _LINUX_KD_H */
1362     diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
1363     index 8ddf79e9207a9..1df12e8dde6f6 100644
1364     --- a/include/linux/ratelimit.h
1365     +++ b/include/linux/ratelimit.h
1366     @@ -23,12 +23,16 @@ struct ratelimit_state {
1367     unsigned long flags;
1368     };
1369    
1370     -#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) { \
1371     - .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
1372     - .interval = interval_init, \
1373     - .burst = burst_init, \
1374     +#define RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, flags_init) { \
1375     + .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
1376     + .interval = interval_init, \
1377     + .burst = burst_init, \
1378     + .flags = flags_init, \
1379     }
1380    
1381     +#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) \
1382     + RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, 0)
1383     +
1384     #define RATELIMIT_STATE_INIT_DISABLED \
1385     RATELIMIT_STATE_INIT(ratelimit_state, 0, DEFAULT_RATELIMIT_BURST)
1386    
1387     diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
1388     index ab69434e2329e..72e785a903b65 100644
1389     --- a/include/trace/events/libata.h
1390     +++ b/include/trace/events/libata.h
1391     @@ -249,6 +249,7 @@ DECLARE_EVENT_CLASS(ata_qc_complete_template,
1392     __entry->hob_feature = qc->result_tf.hob_feature;
1393     __entry->nsect = qc->result_tf.nsect;
1394     __entry->hob_nsect = qc->result_tf.hob_nsect;
1395     + __entry->flags = qc->flags;
1396     ),
1397    
1398     TP_printk("ata_port=%u ata_dev=%u tag=%d flags=%s status=%s " \
1399     diff --git a/net/core/filter.c b/net/core/filter.c
1400     index b0df4ddbe30c3..eba96343c7af9 100644
1401     --- a/net/core/filter.c
1402     +++ b/net/core/filter.c
1403     @@ -5313,10 +5313,21 @@ __bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len,
1404     ifindex, proto, netns_id, flags);
1405    
1406     if (sk) {
1407     - sk = sk_to_full_sk(sk);
1408     - if (!sk_fullsock(sk)) {
1409     + struct sock *sk2 = sk_to_full_sk(sk);
1410     +
1411     + /* sk_to_full_sk() may return (sk)->rsk_listener, so make sure the original sk
1412     + * sock refcnt is decremented to prevent a request_sock leak.
1413     + */
1414     + if (!sk_fullsock(sk2))
1415     + sk2 = NULL;
1416     + if (sk2 != sk) {
1417     sock_gen_put(sk);
1418     - return NULL;
1419     + /* Ensure there is no need to bump sk2 refcnt */
1420     + if (unlikely(sk2 && !sock_flag(sk2, SOCK_RCU_FREE))) {
1421     + WARN_ONCE(1, "Found non-RCU, unreferenced socket!");
1422     + return NULL;
1423     + }
1424     + sk = sk2;
1425     }
1426     }
1427    
1428     @@ -5350,10 +5361,21 @@ bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len,
1429     flags);
1430    
1431     if (sk) {
1432     - sk = sk_to_full_sk(sk);
1433     - if (!sk_fullsock(sk)) {
1434     + struct sock *sk2 = sk_to_full_sk(sk);
1435     +
1436     + /* sk_to_full_sk() may return (sk)->rsk_listener, so make sure the original sk
1437     + * sock refcnt is decremented to prevent a request_sock leak.
1438     + */
1439     + if (!sk_fullsock(sk2))
1440     + sk2 = NULL;
1441     + if (sk2 != sk) {
1442     sock_gen_put(sk);
1443     - return NULL;
1444     + /* Ensure there is no need to bump sk2 refcnt */
1445     + if (unlikely(sk2 && !sock_flag(sk2, SOCK_RCU_FREE))) {
1446     + WARN_ONCE(1, "Found non-RCU, unreferenced socket!");
1447     + return NULL;
1448     + }
1449     + sk = sk2;
1450     }
1451     }
1452    
1453     diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
1454     index 614410a6db44b..52dbffb7bc2fd 100644
1455     --- a/net/ipv4/ip_gre.c
1456     +++ b/net/ipv4/ip_gre.c
1457     @@ -497,7 +497,6 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct net_device *dev)
1458     int tunnel_hlen;
1459     int version;
1460     int nhoff;
1461     - int thoff;
1462    
1463     tun_info = skb_tunnel_info(skb);
1464     if (unlikely(!tun_info || !(tun_info->mode & IP_TUNNEL_INFO_TX) ||
1465     @@ -531,10 +530,16 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct net_device *dev)
1466     (ntohs(ip_hdr(skb)->tot_len) > skb->len - nhoff))
1467     truncate = true;
1468    
1469     - thoff = skb_transport_header(skb) - skb_mac_header(skb);
1470     - if (skb->protocol == htons(ETH_P_IPV6) &&
1471     - (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff))
1472     - truncate = true;
1473     + if (skb->protocol == htons(ETH_P_IPV6)) {
1474     + int thoff;
1475     +
1476     + if (skb_transport_header_was_set(skb))
1477     + thoff = skb_transport_header(skb) - skb_mac_header(skb);
1478     + else
1479     + thoff = nhoff + sizeof(struct ipv6hdr);
1480     + if (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff)
1481     + truncate = true;
1482     + }
1483    
1484     if (version == 1) {
1485     erspan_build_header(skb, ntohl(tunnel_id_to_key32(key->tun_id)),
1486     diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
1487     index e550db28aabb5..4a6396d574a0d 100644
1488     --- a/net/ipv6/ip6_gre.c
1489     +++ b/net/ipv6/ip6_gre.c
1490     @@ -927,7 +927,6 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
1491     __be16 proto;
1492     __u32 mtu;
1493     int nhoff;
1494     - int thoff;
1495    
1496     if (!pskb_inet_may_pull(skb))
1497     goto tx_err;
1498     @@ -948,10 +947,16 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
1499     (ntohs(ip_hdr(skb)->tot_len) > skb->len - nhoff))
1500     truncate = true;
1501    
1502     - thoff = skb_transport_header(skb) - skb_mac_header(skb);
1503     - if (skb->protocol == htons(ETH_P_IPV6) &&
1504     - (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff))
1505     - truncate = true;
1506     + if (skb->protocol == htons(ETH_P_IPV6)) {
1507     + int thoff;
1508     +
1509     + if (skb_transport_header_was_set(skb))
1510     + thoff = skb_transport_header(skb) - skb_mac_header(skb);
1511     + else
1512     + thoff = nhoff + sizeof(struct ipv6hdr);
1513     + if (ntohs(ipv6_hdr(skb)->payload_len) > skb->len - thoff)
1514     + truncate = true;
1515     + }
1516    
1517     if (skb_cow_head(skb, dev->needed_headroom ?: t->hlen))
1518     goto tx_err;
1519     diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
1520     index 38147e6a20f53..989175ce81d4d 100644
1521     --- a/net/openvswitch/flow.c
1522     +++ b/net/openvswitch/flow.c
1523     @@ -265,7 +265,7 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key)
1524     if (flags & IP6_FH_F_FRAG) {
1525     if (frag_off) {
1526     key->ip.frag = OVS_FRAG_TYPE_LATER;
1527     - key->ip.proto = nexthdr;
1528     + key->ip.proto = NEXTHDR_FRAGMENT;
1529     return 0;
1530     }
1531     key->ip.frag = OVS_FRAG_TYPE_FIRST;
1532     diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
1533     index f4101a920d1f9..1802f134aa407 100644
1534     --- a/net/sched/sch_netem.c
1535     +++ b/net/sched/sch_netem.c
1536     @@ -1146,9 +1146,9 @@ static int netem_dump(struct Qdisc *sch, struct sk_buff *skb)
1537     struct tc_netem_rate rate;
1538     struct tc_netem_slot slot;
1539    
1540     - qopt.latency = min_t(psched_tdiff_t, PSCHED_NS2TICKS(q->latency),
1541     + qopt.latency = min_t(psched_time_t, PSCHED_NS2TICKS(q->latency),
1542     UINT_MAX);
1543     - qopt.jitter = min_t(psched_tdiff_t, PSCHED_NS2TICKS(q->jitter),
1544     + qopt.jitter = min_t(psched_time_t, PSCHED_NS2TICKS(q->jitter),
1545     UINT_MAX);
1546     qopt.limit = q->limit;
1547     qopt.loss = q->loss;
1548     diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
1549     index 59011ddf8bb80..e5aeaf72dcdb8 100644
1550     --- a/scripts/mod/modpost.c
1551     +++ b/scripts/mod/modpost.c
1552     @@ -1131,7 +1131,7 @@ static const struct sectioncheck sectioncheck[] = {
1553     },
1554     /* Do not export init/exit functions or data */
1555     {
1556     - .fromsec = { "__ksymtab*", NULL },
1557     + .fromsec = { "___ksymtab*", NULL },
1558     .bad_tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
1559     .mismatch = EXPORT_TO_INIT_EXIT,
1560     .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },
1561     diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
1562     index c0b6881b06729..b81b0a1bada56 100644
1563     --- a/sound/pci/hda/patch_conexant.c
1564     +++ b/sound/pci/hda/patch_conexant.c
1565     @@ -1048,11 +1048,11 @@ static int patch_conexant_auto(struct hda_codec *codec)
1566     if (err < 0)
1567     goto error;
1568    
1569     - err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
1570     + err = cx_auto_parse_beep(codec);
1571     if (err < 0)
1572     goto error;
1573    
1574     - err = cx_auto_parse_beep(codec);
1575     + err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
1576     if (err < 0)
1577     goto error;
1578    
1579     diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1580     index 8c37de7793463..804fc0d331b4f 100644
1581     --- a/sound/pci/hda/patch_realtek.c
1582     +++ b/sound/pci/hda/patch_realtek.c
1583     @@ -2585,6 +2585,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
1584     SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1585     SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1586     SND_PCI_QUIRK(0x1558, 0x67f1, "Clevo PC70H[PRS]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1587     + SND_PCI_QUIRK(0x1558, 0x67f5, "Clevo PD70PN[NRT]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1588     SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1589     SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS),
1590     SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED),
1591     @@ -9805,6 +9806,7 @@ enum {
1592     ALC668_FIXUP_MIC_DET_COEF,
1593     ALC897_FIXUP_LENOVO_HEADSET_MIC,
1594     ALC897_FIXUP_HEADSET_MIC_PIN,
1595     + ALC897_FIXUP_HP_HSMIC_VERB,
1596     };
1597    
1598     static const struct hda_fixup alc662_fixups[] = {
1599     @@ -10224,6 +10226,13 @@ static const struct hda_fixup alc662_fixups[] = {
1600     .chained = true,
1601     .chain_id = ALC897_FIXUP_LENOVO_HEADSET_MIC
1602     },
1603     + [ALC897_FIXUP_HP_HSMIC_VERB] = {
1604     + .type = HDA_FIXUP_PINS,
1605     + .v.pins = (const struct hda_pintbl[]) {
1606     + { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */
1607     + { }
1608     + },
1609     + },
1610     };
1611    
1612     static const struct snd_pci_quirk alc662_fixup_tbl[] = {
1613     @@ -10249,6 +10258,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
1614     SND_PCI_QUIRK(0x1028, 0x0698, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
1615     SND_PCI_QUIRK(0x1028, 0x069f, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
1616     SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
1617     + SND_PCI_QUIRK(0x103c, 0x8719, "HP", ALC897_FIXUP_HP_HSMIC_VERB),
1618     SND_PCI_QUIRK(0x103c, 0x873e, "HP", ALC671_FIXUP_HP_HEADSET_MIC2),
1619     SND_PCI_QUIRK(0x103c, 0x885f, "HP 288 Pro G8", ALC671_FIXUP_HP_HEADSET_MIC2),
1620     SND_PCI_QUIRK(0x1043, 0x1080, "Asus UX501VW", ALC668_FIXUP_HEADSET_MODE),
1621     diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
1622     index a5c1a2c4eae4e..3edb4e25797de 100644
1623     --- a/sound/pci/hda/patch_via.c
1624     +++ b/sound/pci/hda/patch_via.c
1625     @@ -520,11 +520,11 @@ static int via_parse_auto_config(struct hda_codec *codec)
1626     if (err < 0)
1627     return err;
1628    
1629     - err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
1630     + err = auto_parse_beep(codec);
1631     if (err < 0)
1632     return err;
1633    
1634     - err = auto_parse_beep(codec);
1635     + err = snd_hda_gen_parse_auto_config(codec, &spec->gen.autocfg);
1636     if (err < 0)
1637     return err;
1638