Magellan Linux

Contents of /trunk/kernel-alx-legacy/patches-4.9/0420-4.9.321-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3722 - (show annotations) (download)
Mon Oct 24 14:08:33 2022 UTC (18 months, 1 week ago) by niro
File size: 29301 byte(s)
-linux-4.9.321
1 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 04cefc7d5b47f..4b9b412d5fb82 100644
13 --- a/Makefile
14 +++ b/Makefile
15 @@ -1,6 +1,6 @@
16 VERSION = 4
17 PATCHLEVEL = 9
18 -SUBLEVEL = 320
19 +SUBLEVEL = 321
20 EXTRAVERSION =
21 NAME = Roaring Lionus
22
23 diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi
24 index 8ccafdfbe87cc..5fae9adb9f320 100644
25 --- a/arch/arm/boot/dts/imx6qdl.dtsi
26 +++ b/arch/arm/boot/dts/imx6qdl.dtsi
27 @@ -686,7 +686,7 @@
28 regulator-name = "vddpu";
29 regulator-min-microvolt = <725000>;
30 regulator-max-microvolt = <1450000>;
31 - regulator-enable-ramp-delay = <150>;
32 + regulator-enable-ramp-delay = <380>;
33 anatop-reg-offset = <0x140>;
34 anatop-vol-bit-shift = <9>;
35 anatop-vol-bit-width = <5>;
36 diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c
37 index ffbd71d45008a..a895ab988b580 100644
38 --- a/arch/arm/mach-axxia/platsmp.c
39 +++ b/arch/arm/mach-axxia/platsmp.c
40 @@ -42,6 +42,7 @@ static int axxia_boot_secondary(unsigned int cpu, struct task_struct *idle)
41 return -ENOENT;
42
43 syscon = of_iomap(syscon_np, 0);
44 + of_node_put(syscon_np);
45 if (!syscon)
46 return -ENOMEM;
47
48 diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c
49 index 7d5a44a06648d..95716fc9e6286 100644
50 --- a/arch/arm/mach-cns3xxx/core.c
51 +++ b/arch/arm/mach-cns3xxx/core.c
52 @@ -379,6 +379,7 @@ static void __init cns3xxx_init(void)
53 /* De-Asscer SATA Reset */
54 cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA));
55 }
56 + of_node_put(dn);
57
58 dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci");
59 if (of_device_is_available(dn)) {
60 @@ -392,6 +393,7 @@ static void __init cns3xxx_init(void)
61 cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
62 cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO));
63 }
64 + of_node_put(dn);
65
66 pm_power_off = cns3xxx_power_off;
67
68 diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
69 index 757fc11de30d8..e6ef717f1621a 100644
70 --- a/arch/arm/mach-exynos/exynos.c
71 +++ b/arch/arm/mach-exynos/exynos.c
72 @@ -167,6 +167,7 @@ static void exynos_map_pmu(void)
73 np = of_find_matching_node(NULL, exynos_dt_pmu_match);
74 if (np)
75 pmu_base_addr = of_iomap(np, 0);
76 + of_node_put(np);
77 }
78
79 static void __init exynos_init_irq(void)
80 diff --git a/arch/mips/vr41xx/common/icu.c b/arch/mips/vr41xx/common/icu.c
81 index 41e873bc84747..a174fda8b3971 100644
82 --- a/arch/mips/vr41xx/common/icu.c
83 +++ b/arch/mips/vr41xx/common/icu.c
84 @@ -653,8 +653,6 @@ static int icu_get_irq(unsigned int irq)
85
86 printk(KERN_ERR "spurious ICU interrupt: %04x,%04x\n", pend1, pend2);
87
88 - atomic_inc(&irq_err_count);
89 -
90 return -1;
91 }
92
93 diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
94 index 54c95e7c74cce..a8ddf01a1f052 100644
95 --- a/arch/powerpc/kernel/process.c
96 +++ b/arch/powerpc/kernel/process.c
97 @@ -1591,7 +1591,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
98 tm_reclaim_current(0);
99 #endif
100
101 - memset(regs->gpr, 0, sizeof(regs->gpr));
102 + memset(&regs->gpr[1], 0, sizeof(regs->gpr) - sizeof(regs->gpr[0]));
103 regs->ctr = 0;
104 regs->link = 0;
105 regs->xer = 0;
106 diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
107 index 62ff57cf6c249..18f797a665fda 100644
108 --- a/arch/powerpc/platforms/pseries/pseries.h
109 +++ b/arch/powerpc/platforms/pseries/pseries.h
110 @@ -81,4 +81,6 @@ unsigned long pseries_memory_block_size(void);
111
112 void pseries_setup_rfi_flush(void);
113
114 +void pseries_rng_init(void);
115 +
116 #endif /* _PSERIES_PSERIES_H */
117 diff --git a/arch/powerpc/platforms/pseries/rng.c b/arch/powerpc/platforms/pseries/rng.c
118 index 262b8c5e1b9d0..2262630543e91 100644
119 --- a/arch/powerpc/platforms/pseries/rng.c
120 +++ b/arch/powerpc/platforms/pseries/rng.c
121 @@ -14,6 +14,7 @@
122 #include <asm/archrandom.h>
123 #include <asm/machdep.h>
124 #include <asm/plpar_wrappers.h>
125 +#include "pseries.h"
126
127
128 static int pseries_get_random_long(unsigned long *v)
129 @@ -28,19 +29,13 @@ static int pseries_get_random_long(unsigned long *v)
130 return 0;
131 }
132
133 -static __init int rng_init(void)
134 +void __init pseries_rng_init(void)
135 {
136 struct device_node *dn;
137
138 dn = of_find_compatible_node(NULL, NULL, "ibm,random");
139 if (!dn)
140 - return -ENODEV;
141 -
142 - pr_info("Registering arch random hook.\n");
143 -
144 + return;
145 ppc_md.get_random_seed = pseries_get_random_long;
146 -
147 of_node_put(dn);
148 - return 0;
149 }
150 -machine_subsys_initcall(pseries, rng_init);
151 diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
152 index bb74711388621..a06ea88ff7576 100644
153 --- a/arch/powerpc/platforms/pseries/setup.c
154 +++ b/arch/powerpc/platforms/pseries/setup.c
155 @@ -585,6 +585,7 @@ static void __init pSeries_setup_arch(void)
156 }
157
158 ppc_md.pcibios_root_bridge_prepare = pseries_root_bridge_prepare;
159 + pseries_rng_init();
160 }
161
162 static int __init pSeries_init_panel(void)
163 diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
164 index 1624a7ffa95d8..3f1f58c1a9ce6 100644
165 --- a/arch/x86/include/asm/kexec.h
166 +++ b/arch/x86/include/asm/kexec.h
167 @@ -20,6 +20,7 @@
168 #ifndef __ASSEMBLY__
169
170 #include <linux/string.h>
171 +#include <linux/module.h>
172
173 #include <asm/page.h>
174 #include <asm/ptrace.h>
175 @@ -206,6 +207,12 @@ struct kexec_entry64_regs {
176 uint64_t r15;
177 uint64_t rip;
178 };
179 +
180 +#ifdef CONFIG_KEXEC_FILE
181 +int arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr,
182 + Elf_Shdr *sechdrs, unsigned int relsec);
183 +#define arch_kexec_apply_relocations_add arch_kexec_apply_relocations_add
184 +#endif
185 #endif
186
187 typedef void crash_vmclear_fn(void);
188 diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c
189 index 2251a6e0973a8..d4b4386df5686 100644
190 --- a/arch/xtensa/kernel/time.c
191 +++ b/arch/xtensa/kernel/time.c
192 @@ -146,6 +146,7 @@ static void __init calibrate_ccount(void)
193 cpu = of_find_compatible_node(NULL, NULL, "cdns,xtensa-cpu");
194 if (cpu) {
195 clk = of_clk_get(cpu, 0);
196 + of_node_put(cpu);
197 if (!IS_ERR(clk)) {
198 ccount_freq = clk_get_rate(clk);
199 return;
200 diff --git a/arch/xtensa/platforms/xtfpga/setup.c b/arch/xtensa/platforms/xtfpga/setup.c
201 index db5122765f166..ce00dc2b3a1ec 100644
202 --- a/arch/xtensa/platforms/xtfpga/setup.c
203 +++ b/arch/xtensa/platforms/xtfpga/setup.c
204 @@ -152,6 +152,7 @@ static int __init machine_setup(void)
205
206 if ((eth = of_find_compatible_node(eth, NULL, "opencores,ethoc")))
207 update_local_mac(eth);
208 + of_node_put(eth);
209 return 0;
210 }
211 arch_initcall(machine_setup);
212 diff --git a/drivers/char/random.c b/drivers/char/random.c
213 index 8e701ea78b0da..38591c53ea571 100644
214 --- a/drivers/char/random.c
215 +++ b/drivers/char/random.c
216 @@ -89,7 +89,7 @@ static RAW_NOTIFIER_HEAD(random_ready_chain);
217
218 /* Control how we warn userspace. */
219 static struct ratelimit_state urandom_warning =
220 - RATELIMIT_STATE_INIT("warn_urandom_randomness", HZ, 3);
221 + RATELIMIT_STATE_INIT_FLAGS("urandom_warning", HZ, 3, RATELIMIT_MSG_ON_RELEASE);
222 static int ratelimit_disable __read_mostly =
223 IS_ENABLED(CONFIG_WARN_ALL_UNSEEDED_RANDOM);
224 module_param_named(ratelimit_disable, ratelimit_disable, int, 0644);
225 @@ -997,7 +997,7 @@ void add_interrupt_randomness(int irq)
226 if (new_count & MIX_INFLIGHT)
227 return;
228
229 - if (new_count < 64 && !time_is_before_jiffies(fast_pool->last + HZ))
230 + if (new_count < 1024 && !time_is_before_jiffies(fast_pool->last + HZ))
231 return;
232
233 if (unlikely(!fast_pool->mix.func))
234 diff --git a/drivers/gpio/gpio-vr41xx.c b/drivers/gpio/gpio-vr41xx.c
235 index ac8deb01f6f63..ee3163dd794bc 100644
236 --- a/drivers/gpio/gpio-vr41xx.c
237 +++ b/drivers/gpio/gpio-vr41xx.c
238 @@ -224,8 +224,6 @@ static int giu_get_irq(unsigned int irq)
239 printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n",
240 maskl, pendl, maskh, pendh);
241
242 - atomic_inc(&irq_err_count);
243 -
244 return -EINVAL;
245 }
246
247 diff --git a/drivers/gpu/drm/drm_crtc_helper_internal.h b/drivers/gpu/drm/drm_crtc_helper_internal.h
248 index 28295e5d0d9ea..8c967157aa909 100644
249 --- a/drivers/gpu/drm/drm_crtc_helper_internal.h
250 +++ b/drivers/gpu/drm/drm_crtc_helper_internal.h
251 @@ -28,16 +28,6 @@
252
253 #include <drm/drm_dp_helper.h>
254
255 -/* drm_fb_helper.c */
256 -#ifdef CONFIG_DRM_FBDEV_EMULATION
257 -int drm_fb_helper_modinit(void);
258 -#else
259 -static inline int drm_fb_helper_modinit(void)
260 -{
261 - return 0;
262 -}
263 -#endif
264 -
265 /* drm_dp_aux_dev.c */
266 #ifdef CONFIG_DRM_DP_AUX_CHARDEV
267 int drm_dp_aux_dev_init(void);
268 diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
269 index 2e85e609f1256..9c571336ae81c 100644
270 --- a/drivers/gpu/drm/drm_fb_helper.c
271 +++ b/drivers/gpu/drm/drm_fb_helper.c
272 @@ -2324,24 +2324,3 @@ int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
273 return 0;
274 }
275 EXPORT_SYMBOL(drm_fb_helper_hotplug_event);
276 -
277 -/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT)
278 - * but the module doesn't depend on any fb console symbols. At least
279 - * attempt to load fbcon to avoid leaving the system without a usable console.
280 - */
281 -int __init drm_fb_helper_modinit(void)
282 -{
283 -#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT)
284 - const char *name = "fbcon";
285 - struct module *fbcon;
286 -
287 - mutex_lock(&module_mutex);
288 - fbcon = find_module(name);
289 - mutex_unlock(&module_mutex);
290 -
291 - if (!fbcon)
292 - request_module_nowait(name);
293 -#endif
294 - return 0;
295 -}
296 -EXPORT_SYMBOL(drm_fb_helper_modinit);
297 diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c
298 index 45db36cd3d200..4c11711234b6f 100644
299 --- a/drivers/gpu/drm/drm_kms_helper_common.c
300 +++ b/drivers/gpu/drm/drm_kms_helper_common.c
301 @@ -36,19 +36,18 @@ MODULE_LICENSE("GPL and additional rights");
302
303 static int __init drm_kms_helper_init(void)
304 {
305 - int ret;
306 -
307 - /* Call init functions from specific kms helpers here */
308 - ret = drm_fb_helper_modinit();
309 - if (ret < 0)
310 - goto out;
311 -
312 - ret = drm_dp_aux_dev_init();
313 - if (ret < 0)
314 - goto out;
315 -
316 -out:
317 - return ret;
318 + /*
319 + * The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT)
320 + * but the module doesn't depend on any fb console symbols. At least
321 + * attempt to load fbcon to avoid leaving the system without a usable
322 + * console.
323 + */
324 + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) &&
325 + IS_MODULE(CONFIG_FRAMEBUFFER_CONSOLE) &&
326 + !IS_ENABLED(CONFIG_EXPERT))
327 + request_module_nowait("fbcon");
328 +
329 + return drm_dp_aux_dev_init();
330 }
331
332 static void __exit drm_kms_helper_exit(void)
333 diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
334 index 02a361de3dcca..8028bc432ffba 100644
335 --- a/drivers/iio/accel/bma180.c
336 +++ b/drivers/iio/accel/bma180.c
337 @@ -776,11 +776,12 @@ static int bma180_probe(struct i2c_client *client,
338 data->trig->dev.parent = &client->dev;
339 data->trig->ops = &bma180_trigger_ops;
340 iio_trigger_set_drvdata(data->trig, indio_dev);
341 - indio_dev->trig = iio_trigger_get(data->trig);
342
343 ret = iio_trigger_register(data->trig);
344 if (ret)
345 goto err_trigger_free;
346 +
347 + indio_dev->trig = iio_trigger_get(data->trig);
348 }
349
350 ret = iio_triggered_buffer_setup(indio_dev, NULL,
351 diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
352 index 0346c37b1e285..3e4f5ab39af30 100644
353 --- a/drivers/iio/accel/mma8452.c
354 +++ b/drivers/iio/accel/mma8452.c
355 @@ -1405,10 +1405,14 @@ static int mma8452_reset(struct i2c_client *client)
356 int i;
357 int ret;
358
359 - ret = i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
360 + /*
361 + * Find on fxls8471, after config reset bit, it reset immediately,
362 + * and will not give ACK, so here do not check the return value.
363 + * The following code will read the reset register, and check whether
364 + * this reset works.
365 + */
366 + i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
367 MMA8452_CTRL_REG2_RST);
368 - if (ret < 0)
369 - return ret;
370
371 for (i = 0; i < 10; i++) {
372 usleep_range(100, 200);
373 diff --git a/drivers/iio/trigger/iio-trig-sysfs.c b/drivers/iio/trigger/iio-trig-sysfs.c
374 index 202e8b89caf2d..0e9590e071d14 100644
375 --- a/drivers/iio/trigger/iio-trig-sysfs.c
376 +++ b/drivers/iio/trigger/iio-trig-sysfs.c
377 @@ -199,6 +199,7 @@ static int iio_sysfs_trigger_remove(int id)
378 }
379
380 iio_trigger_unregister(t->trig);
381 + irq_work_sync(&t->work);
382 iio_trigger_free(t->trig);
383
384 list_del(&t->l);
385 diff --git a/drivers/md/dm-era-target.c b/drivers/md/dm-era-target.c
386 index c7151febbb094..521f733e70e13 100644
387 --- a/drivers/md/dm-era-target.c
388 +++ b/drivers/md/dm-era-target.c
389 @@ -1398,7 +1398,7 @@ static void start_worker(struct era *era)
390 static void stop_worker(struct era *era)
391 {
392 atomic_set(&era->suspended, 1);
393 - flush_workqueue(era->wq);
394 + drain_workqueue(era->wq);
395 }
396
397 /*----------------------------------------------------------------
398 @@ -1583,6 +1583,12 @@ static void era_postsuspend(struct dm_target *ti)
399 }
400
401 stop_worker(era);
402 +
403 + r = metadata_commit(era->md);
404 + if (r) {
405 + DMERR("%s: metadata_commit failed", __func__);
406 + /* FIXME: fail mode */
407 + }
408 }
409
410 static int era_preresume(struct dm_target *ti)
411 diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
412 index 0d9226bdf6614..33843b89ab047 100644
413 --- a/drivers/net/bonding/bond_main.c
414 +++ b/drivers/net/bonding/bond_main.c
415 @@ -3014,9 +3014,11 @@ re_arm:
416 if (!rtnl_trylock())
417 return;
418
419 - if (should_notify_peers)
420 + if (should_notify_peers) {
421 + bond->send_peer_notif--;
422 call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
423 bond->dev);
424 + }
425 if (should_notify_rtnl) {
426 bond_slave_state_notify(bond);
427 bond_slave_link_notify(bond);
428 diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
429 index d825e527ec1ac..2e713e5f75cdb 100644
430 --- a/drivers/net/ethernet/intel/igb/igb_main.c
431 +++ b/drivers/net/ethernet/intel/igb/igb_main.c
432 @@ -8161,11 +8161,10 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
433 struct e1000_hw *hw = &adapter->hw;
434 u32 dmac_thr;
435 u16 hwm;
436 + u32 reg;
437
438 if (hw->mac.type > e1000_82580) {
439 if (adapter->flags & IGB_FLAG_DMAC) {
440 - u32 reg;
441 -
442 /* force threshold to 0. */
443 wr32(E1000_DMCTXTH, 0);
444
445 @@ -8198,7 +8197,6 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
446 /* Disable BMC-to-OS Watchdog Enable */
447 if (hw->mac.type != e1000_i354)
448 reg &= ~E1000_DMACR_DC_BMC2OSW_EN;
449 -
450 wr32(E1000_DMACR, reg);
451
452 /* no lower threshold to disable
453 @@ -8215,12 +8213,12 @@ static void igb_init_dmac(struct igb_adapter *adapter, u32 pba)
454 */
455 wr32(E1000_DMCTXTH, (IGB_MIN_TXPBSIZE -
456 (IGB_TX_BUF_4096 + adapter->max_frame_size)) >> 6);
457 + }
458
459 - /* make low power state decision controlled
460 - * by DMA coal
461 - */
462 + if (hw->mac.type >= e1000_i210 ||
463 + (adapter->flags & IGB_FLAG_DMAC)) {
464 reg = rd32(E1000_PCIEMISC);
465 - reg &= ~E1000_PCIEMISC_LX_DECISION;
466 + reg |= E1000_PCIEMISC_LX_DECISION;
467 wr32(E1000_PCIEMISC, reg);
468 } /* endif adapter->dmac is not disabled */
469 } else if (hw->mac.type == e1000_82580) {
470 diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
471 index e797fa92c90dd..513558eecfd6c 100644
472 --- a/drivers/of/fdt.c
473 +++ b/drivers/of/fdt.c
474 @@ -1110,6 +1110,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
475
476 /* try to clear seed so it won't be found. */
477 fdt_nop_property(initial_boot_params, node, "rng-seed");
478 +
479 + /* update CRC check value */
480 + of_fdt_crc32 = crc32_be(~0, initial_boot_params,
481 + fdt_totalsize(initial_boot_params));
482 }
483
484 /* break now */
485 @@ -1213,6 +1217,8 @@ bool __init early_init_dt_verify(void *params)
486
487 /* Setup flat device-tree pointer */
488 initial_boot_params = params;
489 + of_fdt_crc32 = crc32_be(~0, initial_boot_params,
490 + fdt_totalsize(initial_boot_params));
491 return true;
492 }
493
494 @@ -1238,8 +1244,6 @@ bool __init early_init_dt_scan(void *params)
495 return false;
496
497 early_init_dt_scan_nodes();
498 - of_fdt_crc32 = crc32_be(~0, initial_boot_params,
499 - fdt_totalsize(initial_boot_params));
500 return true;
501 }
502
503 diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
504 index 9f1573b0e4530..f7a035fa9a97a 100644
505 --- a/drivers/tty/vt/vt.c
506 +++ b/drivers/tty/vt/vt.c
507 @@ -4140,16 +4140,8 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op)
508
509 if (op->data && font.charcount > op->charcount)
510 rc = -ENOSPC;
511 - if (!(op->flags & KD_FONT_FLAG_OLD)) {
512 - if (font.width > op->width || font.height > op->height)
513 - rc = -ENOSPC;
514 - } else {
515 - if (font.width != 8)
516 - rc = -EIO;
517 - else if ((op->height && font.height > op->height) ||
518 - font.height > 32)
519 - rc = -ENOSPC;
520 - }
521 + if (font.width > op->width || font.height > op->height)
522 + rc = -ENOSPC;
523 if (rc)
524 goto out;
525
526 @@ -4177,27 +4169,7 @@ static int con_font_set(struct vc_data *vc, struct console_font_op *op)
527 return -EINVAL;
528 if (op->charcount > 512)
529 return -EINVAL;
530 - if (!op->height) { /* Need to guess font height [compat] */
531 - int h, i;
532 - u8 __user *charmap = op->data;
533 - u8 tmp;
534 -
535 - /* If from KDFONTOP ioctl, don't allow things which can be done in userland,
536 - so that we can get rid of this soon */
537 - if (!(op->flags & KD_FONT_FLAG_OLD))
538 - return -EINVAL;
539 - for (h = 32; h > 0; h--)
540 - for (i = 0; i < op->charcount; i++) {
541 - if (get_user(tmp, &charmap[32*i+h-1]))
542 - return -EFAULT;
543 - if (tmp)
544 - goto nonzero;
545 - }
546 - return -EINVAL;
547 - nonzero:
548 - op->height = h;
549 - }
550 - if (op->width <= 0 || op->width > 32 || op->height > 32)
551 + if (op->width <= 0 || op->width > 32 || !op->height || op->height > 32)
552 return -EINVAL;
553 size = (op->width+7)/8 * 32 * op->charcount;
554 if (size > max_font_size)
555 diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
556 index e785a8a7f1c22..1306893d9fd94 100644
557 --- a/drivers/tty/vt/vt_ioctl.c
558 +++ b/drivers/tty/vt/vt_ioctl.c
559 @@ -240,48 +240,6 @@ int vt_waitactive(int n)
560 #define GPLAST 0x3df
561 #define GPNUM (GPLAST - GPFIRST + 1)
562
563 -
564 -
565 -static inline int
566 -do_fontx_ioctl(struct vc_data *vc, int cmd, struct consolefontdesc __user *user_cfd, int perm, struct console_font_op *op)
567 -{
568 - struct consolefontdesc cfdarg;
569 - int i;
570 -
571 - if (copy_from_user(&cfdarg, user_cfd, sizeof(struct consolefontdesc)))
572 - return -EFAULT;
573 -
574 - switch (cmd) {
575 - case PIO_FONTX:
576 - if (!perm)
577 - return -EPERM;
578 - op->op = KD_FONT_OP_SET;
579 - op->flags = KD_FONT_FLAG_OLD;
580 - op->width = 8;
581 - op->height = cfdarg.charheight;
582 - op->charcount = cfdarg.charcount;
583 - op->data = cfdarg.chardata;
584 - return con_font_op(vc, op);
585 -
586 - case GIO_FONTX:
587 - op->op = KD_FONT_OP_GET;
588 - op->flags = KD_FONT_FLAG_OLD;
589 - op->width = 8;
590 - op->height = cfdarg.charheight;
591 - op->charcount = cfdarg.charcount;
592 - op->data = cfdarg.chardata;
593 - i = con_font_op(vc, op);
594 - if (i)
595 - return i;
596 - cfdarg.charheight = op->height;
597 - cfdarg.charcount = op->charcount;
598 - if (copy_to_user(user_cfd, &cfdarg, sizeof(struct consolefontdesc)))
599 - return -EFAULT;
600 - return 0;
601 - }
602 - return -EINVAL;
603 -}
604 -
605 static inline int
606 do_unimap_ioctl(int cmd, struct unimapdesc __user *user_ud, int perm, struct vc_data *vc)
607 {
608 @@ -922,30 +880,6 @@ int vt_ioctl(struct tty_struct *tty,
609 break;
610 }
611
612 - case PIO_FONT: {
613 - if (!perm)
614 - return -EPERM;
615 - op.op = KD_FONT_OP_SET;
616 - op.flags = KD_FONT_FLAG_OLD | KD_FONT_FLAG_DONT_RECALC; /* Compatibility */
617 - op.width = 8;
618 - op.height = 0;
619 - op.charcount = 256;
620 - op.data = up;
621 - ret = con_font_op(vc, &op);
622 - break;
623 - }
624 -
625 - case GIO_FONT: {
626 - op.op = KD_FONT_OP_GET;
627 - op.flags = KD_FONT_FLAG_OLD;
628 - op.width = 8;
629 - op.height = 32;
630 - op.charcount = 256;
631 - op.data = up;
632 - ret = con_font_op(vc, &op);
633 - break;
634 - }
635 -
636 case PIO_CMAP:
637 if (!perm)
638 ret = -EPERM;
639 @@ -957,36 +891,6 @@ int vt_ioctl(struct tty_struct *tty,
640 ret = con_get_cmap(up);
641 break;
642
643 - case PIO_FONTX:
644 - case GIO_FONTX:
645 - ret = do_fontx_ioctl(vc, cmd, up, perm, &op);
646 - break;
647 -
648 - case PIO_FONTRESET:
649 - {
650 - if (!perm)
651 - return -EPERM;
652 -
653 -#ifdef BROKEN_GRAPHICS_PROGRAMS
654 - /* With BROKEN_GRAPHICS_PROGRAMS defined, the default
655 - font is not saved. */
656 - ret = -ENOSYS;
657 - break;
658 -#else
659 - {
660 - op.op = KD_FONT_OP_SET_DEFAULT;
661 - op.data = NULL;
662 - ret = con_font_op(vc, &op);
663 - if (ret)
664 - break;
665 - console_lock();
666 - con_set_default_unimap(vc);
667 - console_unlock();
668 - break;
669 - }
670 -#endif
671 - }
672 -
673 case KDFONTOP: {
674 if (copy_from_user(&op, up, sizeof(op))) {
675 ret = -EFAULT;
676 @@ -1100,54 +1004,6 @@ void vc_SAK(struct work_struct *work)
677
678 #ifdef CONFIG_COMPAT
679
680 -struct compat_consolefontdesc {
681 - unsigned short charcount; /* characters in font (256 or 512) */
682 - unsigned short charheight; /* scan lines per character (1-32) */
683 - compat_caddr_t chardata; /* font data in expanded form */
684 -};
685 -
686 -static inline int
687 -compat_fontx_ioctl(struct vc_data *vc, int cmd,
688 - struct compat_consolefontdesc __user *user_cfd,
689 - int perm, struct console_font_op *op)
690 -{
691 - struct compat_consolefontdesc cfdarg;
692 - int i;
693 -
694 - if (copy_from_user(&cfdarg, user_cfd, sizeof(struct compat_consolefontdesc)))
695 - return -EFAULT;
696 -
697 - switch (cmd) {
698 - case PIO_FONTX:
699 - if (!perm)
700 - return -EPERM;
701 - op->op = KD_FONT_OP_SET;
702 - op->flags = KD_FONT_FLAG_OLD;
703 - op->width = 8;
704 - op->height = cfdarg.charheight;
705 - op->charcount = cfdarg.charcount;
706 - op->data = compat_ptr(cfdarg.chardata);
707 - return con_font_op(vc, op);
708 -
709 - case GIO_FONTX:
710 - op->op = KD_FONT_OP_GET;
711 - op->flags = KD_FONT_FLAG_OLD;
712 - op->width = 8;
713 - op->height = cfdarg.charheight;
714 - op->charcount = cfdarg.charcount;
715 - op->data = compat_ptr(cfdarg.chardata);
716 - i = con_font_op(vc, op);
717 - if (i)
718 - return i;
719 - cfdarg.charheight = op->height;
720 - cfdarg.charcount = op->charcount;
721 - if (copy_to_user(user_cfd, &cfdarg, sizeof(struct compat_consolefontdesc)))
722 - return -EFAULT;
723 - return 0;
724 - }
725 - return -EINVAL;
726 -}
727 -
728 struct compat_console_font_op {
729 compat_uint_t op; /* operation code KD_FONT_OP_* */
730 compat_uint_t flags; /* KD_FONT_FLAG_* */
731 @@ -1229,11 +1085,6 @@ long vt_compat_ioctl(struct tty_struct *tty,
732 /*
733 * these need special handlers for incompatible data structures
734 */
735 - case PIO_FONTX:
736 - case GIO_FONTX:
737 - ret = compat_fontx_ioctl(vc, cmd, up, perm, &op);
738 - break;
739 -
740 case KDFONTOP:
741 ret = compat_kdfontop_ioctl(up, perm, &op, vc);
742 break;
743 diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
744 index 2fbc67ca47d40..8b0d584e5d2b1 100644
745 --- a/drivers/usb/chipidea/udc.c
746 +++ b/drivers/usb/chipidea/udc.c
747 @@ -921,6 +921,9 @@ isr_setup_status_complete(struct usb_ep *ep, struct usb_request *req)
748 struct ci_hdrc *ci = req->context;
749 unsigned long flags;
750
751 + if (req->status < 0)
752 + return;
753 +
754 if (ci->setaddr) {
755 hw_usb_set_address(ci, ci->address);
756 ci->setaddr = false;
757 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
758 index 8add5a762f219..f54ab5706cd11 100644
759 --- a/drivers/usb/serial/option.c
760 +++ b/drivers/usb/serial/option.c
761 @@ -1253,6 +1253,7 @@ static const struct usb_device_id option_ids[] = {
762 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
763 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1231, 0xff), /* Telit LE910Cx (RNDIS) */
764 .driver_info = NCTRL(2) | RSVD(3) },
765 + { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x1250, 0xff, 0x00, 0x00) }, /* Telit LE910Cx (rmnet) */
766 { USB_DEVICE(TELIT_VENDOR_ID, 0x1260),
767 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
768 { USB_DEVICE(TELIT_VENDOR_ID, 0x1261),
769 diff --git a/drivers/xen/features.c b/drivers/xen/features.c
770 index d7d34fdfc9938..f466f776604f2 100644
771 --- a/drivers/xen/features.c
772 +++ b/drivers/xen/features.c
773 @@ -28,6 +28,6 @@ void xen_setup_features(void)
774 if (HYPERVISOR_xen_version(XENVER_get_features, &fi) < 0)
775 break;
776 for (j = 0; j < 32; j++)
777 - xen_features[i * 32 + j] = !!(fi.submap & 1<<j);
778 + xen_features[i * 32 + j] = !!(fi.submap & 1U << j);
779 }
780 }
781 diff --git a/drivers/xen/xlate_mmu.c b/drivers/xen/xlate_mmu.c
782 index e7df65d32c918..136345b45b29d 100644
783 --- a/drivers/xen/xlate_mmu.c
784 +++ b/drivers/xen/xlate_mmu.c
785 @@ -262,4 +262,3 @@ int __init xen_xlate_map_ballooned_pages(xen_pfn_t **gfns, void **virt,
786
787 return 0;
788 }
789 -EXPORT_SYMBOL_GPL(xen_xlate_map_ballooned_pages);
790 diff --git a/include/linux/kd.h b/include/linux/kd.h
791 deleted file mode 100644
792 index 25bd17fad239f..0000000000000
793 --- a/include/linux/kd.h
794 +++ /dev/null
795 @@ -1,7 +0,0 @@
796 -#ifndef _LINUX_KD_H
797 -#define _LINUX_KD_H
798 -
799 -#include <uapi/linux/kd.h>
800 -
801 -#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface [compat] */
802 -#endif /* _LINUX_KD_H */
803 diff --git a/include/linux/kexec.h b/include/linux/kexec.h
804 index 406c33dcae137..565be657098b0 100644
805 --- a/include/linux/kexec.h
806 +++ b/include/linux/kexec.h
807 @@ -148,6 +148,28 @@ struct kexec_file_ops {
808 kexec_verify_sig_t *verify_sig;
809 #endif
810 };
811 +
812 +#ifndef arch_kexec_apply_relocations_add
813 +/* Apply relocations of type RELA */
814 +static inline int
815 +arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr,
816 + Elf_Shdr *sechdrs, unsigned int relsec)
817 +{
818 + pr_err("RELA relocation unsupported.\n");
819 + return -ENOEXEC;
820 +}
821 +#endif
822 +
823 +#ifndef arch_kexec_apply_relocations
824 +/* Apply relocations of type REL */
825 +static inline int
826 +arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
827 + unsigned int relsec)
828 +{
829 + pr_err("REL relocation unsupported.\n");
830 + return -ENOEXEC;
831 +}
832 +#endif
833 #endif
834
835 struct kimage {
836 @@ -320,10 +342,6 @@ void * __weak arch_kexec_kernel_image_load(struct kimage *image);
837 int __weak arch_kimage_file_post_load_cleanup(struct kimage *image);
838 int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,
839 unsigned long buf_len);
840 -int __weak arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr,
841 - Elf_Shdr *sechdrs, unsigned int relsec);
842 -int __weak arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
843 - unsigned int relsec);
844 void arch_kexec_protect_crashkres(void);
845 void arch_kexec_unprotect_crashkres(void);
846
847 diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
848 index 57c9e0622a38d..7ce241cb51a1f 100644
849 --- a/include/linux/ratelimit.h
850 +++ b/include/linux/ratelimit.h
851 @@ -22,12 +22,16 @@ struct ratelimit_state {
852 unsigned long flags;
853 };
854
855 -#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) { \
856 - .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
857 - .interval = interval_init, \
858 - .burst = burst_init, \
859 +#define RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, flags_init) { \
860 + .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
861 + .interval = interval_init, \
862 + .burst = burst_init, \
863 + .flags = flags_init, \
864 }
865
866 +#define RATELIMIT_STATE_INIT(name, interval_init, burst_init) \
867 + RATELIMIT_STATE_INIT_FLAGS(name, interval_init, burst_init, 0)
868 +
869 #define RATELIMIT_STATE_INIT_DISABLED \
870 RATELIMIT_STATE_INIT(ratelimit_state, 0, DEFAULT_RATELIMIT_BURST)
871
872 diff --git a/include/trace/events/libata.h b/include/trace/events/libata.h
873 index 2fbbf990e4b33..330f40c9ffa8e 100644
874 --- a/include/trace/events/libata.h
875 +++ b/include/trace/events/libata.h
876 @@ -248,6 +248,7 @@ DECLARE_EVENT_CLASS(ata_qc_complete_template,
877 __entry->hob_feature = qc->result_tf.hob_feature;
878 __entry->nsect = qc->result_tf.nsect;
879 __entry->hob_nsect = qc->result_tf.hob_nsect;
880 + __entry->flags = qc->flags;
881 ),
882
883 TP_printk("ata_port=%u ata_dev=%u tag=%d flags=%s status=%s " \
884 diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
885 index 2edaed6803ff7..eb775e699836a 100644
886 --- a/kernel/kexec_file.c
887 +++ b/kernel/kexec_file.c
888 @@ -59,24 +59,6 @@ int __weak arch_kexec_kernel_verify_sig(struct kimage *image, void *buf,
889 }
890 #endif
891
892 -/* Apply relocations of type RELA */
893 -int __weak
894 -arch_kexec_apply_relocations_add(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
895 - unsigned int relsec)
896 -{
897 - pr_err("RELA relocation unsupported.\n");
898 - return -ENOEXEC;
899 -}
900 -
901 -/* Apply relocations of type REL */
902 -int __weak
903 -arch_kexec_apply_relocations(const Elf_Ehdr *ehdr, Elf_Shdr *sechdrs,
904 - unsigned int relsec)
905 -{
906 - pr_err("REL relocation unsupported.\n");
907 - return -ENOEXEC;
908 -}
909 -
910 /*
911 * Free up memory used by kernel, initrd, and command line. This is temporary
912 * memory allocation which is not needed any more after these buffers have
913 diff --git a/lib/swiotlb.c b/lib/swiotlb.c
914 index 277a2f6fde6b1..aad34b1c77e2e 100644
915 --- a/lib/swiotlb.c
916 +++ b/lib/swiotlb.c
917 @@ -539,7 +539,8 @@ found:
918 * unconditional bounce may prevent leaking swiotlb content (i.e.
919 * kernel memory) to user-space.
920 */
921 - swiotlb_bounce(orig_addr, tlb_addr, size, DMA_TO_DEVICE);
922 + if (orig_addr)
923 + swiotlb_bounce(orig_addr, tlb_addr, size, DMA_TO_DEVICE);
924 return tlb_addr;
925 }
926 EXPORT_SYMBOL_GPL(swiotlb_tbl_map_single);
927 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
928 index c5f3267aa08a0..e29d4006ed667 100644
929 --- a/scripts/mod/modpost.c
930 +++ b/scripts/mod/modpost.c
931 @@ -1060,7 +1060,7 @@ static const struct sectioncheck sectioncheck[] = {
932 },
933 /* Do not export init/exit functions or data */
934 {
935 - .fromsec = { "__ksymtab*", NULL },
936 + .fromsec = { "___ksymtab*", NULL },
937 .bad_tosec = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
938 .mismatch = EXPORT_TO_INIT_EXIT,
939 .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL },