Magellan Linux

Contents of /trunk/kernel-alx/patches-5.4/0183-5.4.84-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3637 - (show annotations) (download)
Mon Oct 24 12:40:44 2022 UTC (18 months ago) by niro
File size: 41130 byte(s)
-add missing
1 diff --git a/Makefile b/Makefile
2 index eee1aa092ede8..fe0ab15cfd835 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,7 +1,7 @@
6 # SPDX-License-Identifier: GPL-2.0
7 VERSION = 5
8 PATCHLEVEL = 4
9 -SUBLEVEL = 83
10 +SUBLEVEL = 84
11 EXTRAVERSION =
12 NAME = Kleptomaniac Octopus
13
14 @@ -802,8 +802,11 @@ DEBUG_CFLAGS += -gsplit-dwarf
15 else
16 DEBUG_CFLAGS += -g
17 endif
18 +ifneq ($(LLVM_IAS),1)
19 KBUILD_AFLAGS += -Wa,-gdwarf-2
20 endif
21 +endif
22 +
23 ifdef CONFIG_DEBUG_INFO_DWARF4
24 DEBUG_CFLAGS += -gdwarf-4
25 endif
26 diff --git a/arch/arc/kernel/stacktrace.c b/arch/arc/kernel/stacktrace.c
27 index fc65d2921e3bd..fc3054c34db19 100644
28 --- a/arch/arc/kernel/stacktrace.c
29 +++ b/arch/arc/kernel/stacktrace.c
30 @@ -38,15 +38,15 @@
31
32 #ifdef CONFIG_ARC_DW2_UNWIND
33
34 -static void seed_unwind_frame_info(struct task_struct *tsk,
35 - struct pt_regs *regs,
36 - struct unwind_frame_info *frame_info)
37 +static int
38 +seed_unwind_frame_info(struct task_struct *tsk, struct pt_regs *regs,
39 + struct unwind_frame_info *frame_info)
40 {
41 /*
42 * synchronous unwinding (e.g. dump_stack)
43 * - uses current values of SP and friends
44 */
45 - if (tsk == NULL && regs == NULL) {
46 + if (regs == NULL && (tsk == NULL || tsk == current)) {
47 unsigned long fp, sp, blink, ret;
48 frame_info->task = current;
49
50 @@ -65,11 +65,15 @@ static void seed_unwind_frame_info(struct task_struct *tsk,
51 frame_info->call_frame = 0;
52 } else if (regs == NULL) {
53 /*
54 - * Asynchronous unwinding of sleeping task
55 - * - Gets SP etc from task's pt_regs (saved bottom of kernel
56 - * mode stack of task)
57 + * Asynchronous unwinding of a likely sleeping task
58 + * - first ensure it is actually sleeping
59 + * - if so, it will be in __switch_to, kernel mode SP of task
60 + * is safe-kept and BLINK at a well known location in there
61 */
62
63 + if (tsk->state == TASK_RUNNING)
64 + return -1;
65 +
66 frame_info->task = tsk;
67
68 frame_info->regs.r27 = TSK_K_FP(tsk);
69 @@ -103,6 +107,8 @@ static void seed_unwind_frame_info(struct task_struct *tsk,
70 frame_info->regs.r63 = regs->ret;
71 frame_info->call_frame = 0;
72 }
73 +
74 + return 0;
75 }
76
77 #endif
78 @@ -116,7 +122,8 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
79 unsigned int address;
80 struct unwind_frame_info frame_info;
81
82 - seed_unwind_frame_info(tsk, regs, &frame_info);
83 + if (seed_unwind_frame_info(tsk, regs, &frame_info))
84 + return 0;
85
86 while (1) {
87 address = UNW_PC(&frame_info);
88 diff --git a/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi b/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi
89 index 55259f973b5a9..aef8f2b00778d 100644
90 --- a/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi
91 +++ b/arch/arm64/boot/dts/broadcom/stingray/stingray-usb.dtsi
92 @@ -5,20 +5,20 @@
93 usb {
94 compatible = "simple-bus";
95 dma-ranges;
96 - #address-cells = <1>;
97 - #size-cells = <1>;
98 - ranges = <0x0 0x0 0x68500000 0x00400000>;
99 + #address-cells = <2>;
100 + #size-cells = <2>;
101 + ranges = <0x0 0x0 0x0 0x68500000 0x0 0x00400000>;
102
103 usbphy0: usb-phy@0 {
104 compatible = "brcm,sr-usb-combo-phy";
105 - reg = <0x00000000 0x100>;
106 + reg = <0x0 0x00000000 0x0 0x100>;
107 #phy-cells = <1>;
108 status = "disabled";
109 };
110
111 xhci0: usb@1000 {
112 compatible = "generic-xhci";
113 - reg = <0x00001000 0x1000>;
114 + reg = <0x0 0x00001000 0x0 0x1000>;
115 interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>;
116 phys = <&usbphy0 1>, <&usbphy0 0>;
117 phy-names = "phy0", "phy1";
118 @@ -28,7 +28,7 @@
119
120 bdc0: usb@2000 {
121 compatible = "brcm,bdc-v0.16";
122 - reg = <0x00002000 0x1000>;
123 + reg = <0x0 0x00002000 0x0 0x1000>;
124 interrupts = <GIC_SPI 259 IRQ_TYPE_LEVEL_HIGH>;
125 phys = <&usbphy0 0>, <&usbphy0 1>;
126 phy-names = "phy0", "phy1";
127 @@ -38,21 +38,21 @@
128
129 usbphy1: usb-phy@10000 {
130 compatible = "brcm,sr-usb-combo-phy";
131 - reg = <0x00010000 0x100>;
132 + reg = <0x0 0x00010000 0x0 0x100>;
133 #phy-cells = <1>;
134 status = "disabled";
135 };
136
137 usbphy2: usb-phy@20000 {
138 compatible = "brcm,sr-usb-hs-phy";
139 - reg = <0x00020000 0x100>;
140 + reg = <0x0 0x00020000 0x0 0x100>;
141 #phy-cells = <0>;
142 status = "disabled";
143 };
144
145 xhci1: usb@11000 {
146 compatible = "generic-xhci";
147 - reg = <0x00011000 0x1000>;
148 + reg = <0x0 0x00011000 0x0 0x1000>;
149 interrupts = <GIC_SPI 263 IRQ_TYPE_LEVEL_HIGH>;
150 phys = <&usbphy1 1>, <&usbphy2>, <&usbphy1 0>;
151 phy-names = "phy0", "phy1", "phy2";
152 @@ -62,7 +62,7 @@
153
154 bdc1: usb@21000 {
155 compatible = "brcm,bdc-v0.16";
156 - reg = <0x00021000 0x1000>;
157 + reg = <0x0 0x00021000 0x0 0x1000>;
158 interrupts = <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>;
159 phys = <&usbphy2>;
160 phy-names = "phy0";
161 diff --git a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts
162 index bdace01561bab..9df4782c90f35 100644
163 --- a/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts
164 +++ b/arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts
165 @@ -10,18 +10,6 @@
166 model = "NVIDIA Jetson TX2 Developer Kit";
167 compatible = "nvidia,p2771-0000", "nvidia,tegra186";
168
169 - aconnect {
170 - status = "okay";
171 -
172 - dma-controller@2930000 {
173 - status = "okay";
174 - };
175 -
176 - interrupt-controller@2a40000 {
177 - status = "okay";
178 - };
179 - };
180 -
181 i2c@3160000 {
182 power-monitor@42 {
183 compatible = "ti,ina3221";
184 diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
185 index c5d8d1c582913..bb7d0aac6b9db 100644
186 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
187 +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
188 @@ -29,6 +29,9 @@
189 i2c6 = &i2c6;
190 i2c7 = &i2c7;
191 i2c8 = &i2c8;
192 + mmc0 = &sdio0;
193 + mmc1 = &sdmmc;
194 + mmc2 = &sdhci;
195 serial0 = &uart0;
196 serial1 = &uart1;
197 serial2 = &uart2;
198 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
199 index 37ac731a556b8..9f73fb6b1cc91 100644
200 --- a/arch/powerpc/Makefile
201 +++ b/arch/powerpc/Makefile
202 @@ -250,7 +250,6 @@ KBUILD_CFLAGS += $(call cc-option,-mno-string)
203
204 cpu-as-$(CONFIG_4xx) += -Wa,-m405
205 cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec)
206 -cpu-as-$(CONFIG_E200) += -Wa,-me200
207 cpu-as-$(CONFIG_E500) += -Wa,-me500
208
209 # When using '-many -mpower4' gas will first try and find a matching power4
210 diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
211 index 8267dd426b152..ff77f561e11f0 100644
212 --- a/arch/x86/include/asm/pgtable_types.h
213 +++ b/arch/x86/include/asm/pgtable_types.h
214 @@ -147,6 +147,7 @@ enum page_cache_mode {
215 #endif
216
217 #define _PAGE_CACHE_MASK (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT)
218 +#define _PAGE_LARGE_CACHE_MASK (_PAGE_PWT | _PAGE_PCD | _PAGE_PAT_LARGE)
219 #define _PAGE_NOCACHE (cachemode2protval(_PAGE_CACHE_MODE_UC))
220 #define _PAGE_CACHE_WP (cachemode2protval(_PAGE_CACHE_MODE_WP))
221
222 diff --git a/arch/x86/include/asm/sync_core.h b/arch/x86/include/asm/sync_core.h
223 index c67caafd33817..43b5e02a7b4b9 100644
224 --- a/arch/x86/include/asm/sync_core.h
225 +++ b/arch/x86/include/asm/sync_core.h
226 @@ -16,12 +16,13 @@ static inline void sync_core_before_usermode(void)
227 /* With PTI, we unconditionally serialize before running user code. */
228 if (static_cpu_has(X86_FEATURE_PTI))
229 return;
230 +
231 /*
232 - * Return from interrupt and NMI is done through iret, which is core
233 - * serializing.
234 + * Even if we're in an interrupt, we might reschedule before returning,
235 + * in which case we could switch to a different thread in the same mm
236 + * and return using SYSRET or SYSEXIT. Instead of trying to keep
237 + * track of our need to sync the core, just sync right away.
238 */
239 - if (in_irq() || in_nmi())
240 - return;
241 sync_core();
242 }
243
244 diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
245 index c8203694d9ce4..bf6662d37a334 100644
246 --- a/arch/x86/kernel/apic/vector.c
247 +++ b/arch/x86/kernel/apic/vector.c
248 @@ -272,20 +272,24 @@ static int assign_irq_vector_any_locked(struct irq_data *irqd)
249 const struct cpumask *affmsk = irq_data_get_affinity_mask(irqd);
250 int node = irq_data_get_node(irqd);
251
252 - if (node == NUMA_NO_NODE)
253 - goto all;
254 - /* Try the intersection of @affmsk and node mask */
255 - cpumask_and(vector_searchmask, cpumask_of_node(node), affmsk);
256 - if (!assign_vector_locked(irqd, vector_searchmask))
257 - return 0;
258 - /* Try the node mask */
259 - if (!assign_vector_locked(irqd, cpumask_of_node(node)))
260 - return 0;
261 -all:
262 + if (node != NUMA_NO_NODE) {
263 + /* Try the intersection of @affmsk and node mask */
264 + cpumask_and(vector_searchmask, cpumask_of_node(node), affmsk);
265 + if (!assign_vector_locked(irqd, vector_searchmask))
266 + return 0;
267 + }
268 +
269 /* Try the full affinity mask */
270 cpumask_and(vector_searchmask, affmsk, cpu_online_mask);
271 if (!assign_vector_locked(irqd, vector_searchmask))
272 return 0;
273 +
274 + if (node != NUMA_NO_NODE) {
275 + /* Try the node mask */
276 + if (!assign_vector_locked(irqd, cpumask_of_node(node)))
277 + return 0;
278 + }
279 +
280 /* Try the full online mask */
281 return assign_vector_locked(irqd, cpu_online_mask);
282 }
283 diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S
284 index 92748660ba512..dc2fb886db2bc 100644
285 --- a/arch/x86/lib/memcpy_64.S
286 +++ b/arch/x86/lib/memcpy_64.S
287 @@ -15,8 +15,6 @@
288 * to a jmp to memcpy_erms which does the REP; MOVSB mem copy.
289 */
290
291 -.weak memcpy
292 -
293 /*
294 * memcpy - Copy a memory block.
295 *
296 @@ -29,7 +27,7 @@
297 * rax original destination
298 */
299 ENTRY(__memcpy)
300 -ENTRY(memcpy)
301 +SYM_FUNC_START_WEAK(memcpy)
302 ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \
303 "jmp memcpy_erms", X86_FEATURE_ERMS
304
305 diff --git a/arch/x86/lib/memmove_64.S b/arch/x86/lib/memmove_64.S
306 index bbec69d8223bf..b292445467b6c 100644
307 --- a/arch/x86/lib/memmove_64.S
308 +++ b/arch/x86/lib/memmove_64.S
309 @@ -24,9 +24,7 @@
310 * Output:
311 * rax: dest
312 */
313 -.weak memmove
314 -
315 -ENTRY(memmove)
316 +SYM_FUNC_START_WEAK(memmove)
317 ENTRY(__memmove)
318
319 /* Handle more 32 bytes in loop */
320 diff --git a/arch/x86/lib/memset_64.S b/arch/x86/lib/memset_64.S
321 index 9bc861c71e754..e3376c7d4c97e 100644
322 --- a/arch/x86/lib/memset_64.S
323 +++ b/arch/x86/lib/memset_64.S
324 @@ -6,8 +6,6 @@
325 #include <asm/alternative-asm.h>
326 #include <asm/export.h>
327
328 -.weak memset
329 -
330 /*
331 * ISO C memset - set a memory block to a byte value. This function uses fast
332 * string to get better performance than the original function. The code is
333 @@ -19,7 +17,7 @@
334 *
335 * rax original destination
336 */
337 -ENTRY(memset)
338 +SYM_FUNC_START_WEAK(memset)
339 ENTRY(__memset)
340 /*
341 * Some CPUs support enhanced REP MOVSB/STOSB feature. It is recommended
342 diff --git a/arch/x86/mm/mem_encrypt_identity.c b/arch/x86/mm/mem_encrypt_identity.c
343 index e2b0e2ac07bb6..84cda5dc03870 100644
344 --- a/arch/x86/mm/mem_encrypt_identity.c
345 +++ b/arch/x86/mm/mem_encrypt_identity.c
346 @@ -45,8 +45,8 @@
347 #define PMD_FLAGS_LARGE (__PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL)
348
349 #define PMD_FLAGS_DEC PMD_FLAGS_LARGE
350 -#define PMD_FLAGS_DEC_WP ((PMD_FLAGS_DEC & ~_PAGE_CACHE_MASK) | \
351 - (_PAGE_PAT | _PAGE_PWT))
352 +#define PMD_FLAGS_DEC_WP ((PMD_FLAGS_DEC & ~_PAGE_LARGE_CACHE_MASK) | \
353 + (_PAGE_PAT_LARGE | _PAGE_PWT))
354
355 #define PMD_FLAGS_ENC (PMD_FLAGS_LARGE | _PAGE_ENC)
356
357 diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
358 index e6a9edc5baaf0..851359b7edc57 100644
359 --- a/arch/x86/mm/tlb.c
360 +++ b/arch/x86/mm/tlb.c
361 @@ -327,8 +327,14 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
362 /*
363 * The membarrier system call requires a full memory barrier and
364 * core serialization before returning to user-space, after
365 - * storing to rq->curr. Writing to CR3 provides that full
366 - * memory barrier and core serializing instruction.
367 + * storing to rq->curr, when changing mm. This is because
368 + * membarrier() sends IPIs to all CPUs that are in the target mm
369 + * to make them issue memory barriers. However, if another CPU
370 + * switches to/from the target mm concurrently with
371 + * membarrier(), it can cause that CPU not to receive an IPI
372 + * when it really should issue a memory barrier. Writing to CR3
373 + * provides that full memory barrier and core serializing
374 + * instruction.
375 */
376 if (real_prev == next) {
377 VM_WARN_ON(this_cpu_read(cpu_tlbstate.ctxs[prev_asid].ctx_id) !=
378 diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
379 index 2efc317c90dfa..c2fccf97f7a42 100644
380 --- a/drivers/gpu/drm/i915/display/intel_dp.c
381 +++ b/drivers/gpu/drm/i915/display/intel_dp.c
382 @@ -567,7 +567,7 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,
383 return 0;
384 }
385 /* Also take into account max slice width */
386 - min_slice_count = min_t(u8, min_slice_count,
387 + min_slice_count = max_t(u8, min_slice_count,
388 DIV_ROUND_UP(mode_hdisplay,
389 max_slice_width));
390
391 diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
392 index c09b9628ad34a..c872ba579b039 100644
393 --- a/drivers/input/misc/cm109.c
394 +++ b/drivers/input/misc/cm109.c
395 @@ -568,12 +568,15 @@ static int cm109_input_open(struct input_dev *idev)
396 dev->ctl_data->byte[HID_OR2] = dev->keybit;
397 dev->ctl_data->byte[HID_OR3] = 0x00;
398
399 + dev->ctl_urb_pending = 1;
400 error = usb_submit_urb(dev->urb_ctl, GFP_KERNEL);
401 - if (error)
402 + if (error) {
403 + dev->ctl_urb_pending = 0;
404 dev_err(&dev->intf->dev, "%s: usb_submit_urb (urb_ctl) failed %d\n",
405 __func__, error);
406 - else
407 + } else {
408 dev->open = 1;
409 + }
410
411 mutex_unlock(&dev->pm_mutex);
412
413 diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
414 index 837911a15e443..eca931da76c3a 100644
415 --- a/drivers/input/serio/i8042-x86ia64io.h
416 +++ b/drivers/input/serio/i8042-x86ia64io.h
417 @@ -611,6 +611,48 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
418 DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
419 },
420 },
421 + {
422 + .matches = {
423 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
424 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"),
425 + },
426 + },
427 + {
428 + .matches = {
429 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
430 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"),
431 + },
432 + },
433 + {
434 + .matches = {
435 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
436 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"),
437 + },
438 + },
439 + {
440 + .matches = {
441 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
442 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"),
443 + },
444 + },
445 + {
446 + .matches = {
447 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
448 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"),
449 + },
450 + },
451 + {
452 + .matches = {
453 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
454 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"),
455 + },
456 + },
457 + {
458 + .matches = {
459 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
460 + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"),
461 + },
462 + },
463 {
464 /* Advent 4211 */
465 .matches = {
466 diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c
467 index 8e0735a870400..3a3ce6ea65ff2 100644
468 --- a/drivers/interconnect/qcom/qcs404.c
469 +++ b/drivers/interconnect/qcom/qcs404.c
470 @@ -157,8 +157,8 @@ struct qcom_icc_desc {
471 }
472
473 DEFINE_QNODE(mas_apps_proc, QCS404_MASTER_AMPSS_M0, 8, 0, -1, QCS404_SLAVE_EBI_CH0, QCS404_BIMC_SNOC_SLV);
474 -DEFINE_QNODE(mas_oxili, QCS404_MASTER_GRAPHICS_3D, 8, 6, -1, QCS404_SLAVE_EBI_CH0, QCS404_BIMC_SNOC_SLV);
475 -DEFINE_QNODE(mas_mdp, QCS404_MASTER_MDP_PORT0, 8, 8, -1, QCS404_SLAVE_EBI_CH0, QCS404_BIMC_SNOC_SLV);
476 +DEFINE_QNODE(mas_oxili, QCS404_MASTER_GRAPHICS_3D, 8, -1, -1, QCS404_SLAVE_EBI_CH0, QCS404_BIMC_SNOC_SLV);
477 +DEFINE_QNODE(mas_mdp, QCS404_MASTER_MDP_PORT0, 8, -1, -1, QCS404_SLAVE_EBI_CH0, QCS404_BIMC_SNOC_SLV);
478 DEFINE_QNODE(mas_snoc_bimc_1, QCS404_SNOC_BIMC_1_MAS, 8, 76, -1, QCS404_SLAVE_EBI_CH0);
479 DEFINE_QNODE(mas_tcu_0, QCS404_MASTER_TCU_0, 8, -1, -1, QCS404_SLAVE_EBI_CH0, QCS404_BIMC_SNOC_SLV);
480 DEFINE_QNODE(mas_spdm, QCS404_MASTER_SPDM, 4, -1, -1, QCS404_PNOC_INT_3);
481 diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
482 index 7966b19ceba79..f298313b87ac7 100644
483 --- a/drivers/irqchip/irq-gic-v3-its.c
484 +++ b/drivers/irqchip/irq-gic-v3-its.c
485 @@ -40,7 +40,6 @@
486 #define ITS_FLAGS_CMDQ_NEEDS_FLUSHING (1ULL << 0)
487 #define ITS_FLAGS_WORKAROUND_CAVIUM_22375 (1ULL << 1)
488 #define ITS_FLAGS_WORKAROUND_CAVIUM_23144 (1ULL << 2)
489 -#define ITS_FLAGS_SAVE_SUSPEND_STATE (1ULL << 3)
490
491 #define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0)
492 #define RDIST_FLAGS_RD_TABLES_PREALLOCATED (1 << 1)
493 @@ -3367,9 +3366,6 @@ static int its_save_disable(void)
494 list_for_each_entry(its, &its_nodes, entry) {
495 void __iomem *base;
496
497 - if (!(its->flags & ITS_FLAGS_SAVE_SUSPEND_STATE))
498 - continue;
499 -
500 base = its->base;
501 its->ctlr_save = readl_relaxed(base + GITS_CTLR);
502 err = its_force_quiescent(base);
503 @@ -3388,9 +3384,6 @@ err:
504 list_for_each_entry_continue_reverse(its, &its_nodes, entry) {
505 void __iomem *base;
506
507 - if (!(its->flags & ITS_FLAGS_SAVE_SUSPEND_STATE))
508 - continue;
509 -
510 base = its->base;
511 writel_relaxed(its->ctlr_save, base + GITS_CTLR);
512 }
513 @@ -3410,9 +3403,6 @@ static void its_restore_enable(void)
514 void __iomem *base;
515 int i;
516
517 - if (!(its->flags & ITS_FLAGS_SAVE_SUSPEND_STATE))
518 - continue;
519 -
520 base = its->base;
521
522 /*
523 @@ -3420,7 +3410,10 @@ static void its_restore_enable(void)
524 * don't restore it since writing to CBASER or BASER<n>
525 * registers is undefined according to the GIC v3 ITS
526 * Specification.
527 + *
528 + * Firmware resuming with the ITS enabled is terminally broken.
529 */
530 + WARN_ON(readl_relaxed(base + GITS_CTLR) & GITS_CTLR_ENABLE);
531 ret = its_force_quiescent(base);
532 if (ret) {
533 pr_err("ITS@%pa: failed to quiesce on resume: %d\n",
534 @@ -3687,9 +3680,6 @@ static int __init its_probe_one(struct resource *res,
535 ctlr |= GITS_CTLR_ImDe;
536 writel_relaxed(ctlr, its->base + GITS_CTLR);
537
538 - if (GITS_TYPER_HCC(typer))
539 - its->flags |= ITS_FLAGS_SAVE_SUSPEND_STATE;
540 -
541 err = its_init_domain(handle, its);
542 if (err)
543 goto out_free_tables;
544 diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
545 index 7f480c6b19810..63e838ec8af84 100644
546 --- a/drivers/mmc/core/block.c
547 +++ b/drivers/mmc/core/block.c
548 @@ -630,7 +630,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
549
550 memcpy(&(idata->ic.response), cmd.resp, sizeof(cmd.resp));
551
552 - if (idata->rpmb || (cmd.flags & MMC_RSP_R1B)) {
553 + if (idata->rpmb || (cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
554 /*
555 * Ensure RPMB/R1B command has completed by polling CMD13
556 * "Send Status".
557 diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
558 index f9a2a9ecbac9e..c84114b44ee07 100644
559 --- a/drivers/net/can/m_can/m_can.c
560 +++ b/drivers/net/can/m_can/m_can.c
561 @@ -1337,6 +1337,8 @@ static int m_can_dev_setup(struct m_can_classdev *m_can_dev)
562 &m_can_data_bittiming_const_31X;
563 break;
564 case 32:
565 + case 33:
566 + /* Support both MCAN version v3.2.x and v3.3.0 */
567 m_can_dev->can.bittiming_const = m_can_dev->bit_timing ?
568 m_can_dev->bit_timing : &m_can_bittiming_const_31X;
569
570 diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
571 index 7056419461e7b..47b8ce7822c09 100644
572 --- a/drivers/net/ethernet/ibm/ibmvnic.c
573 +++ b/drivers/net/ethernet/ibm/ibmvnic.c
574 @@ -2266,6 +2266,12 @@ static void ibmvnic_tx_timeout(struct net_device *dev)
575 {
576 struct ibmvnic_adapter *adapter = netdev_priv(dev);
577
578 + if (test_bit(0, &adapter->resetting)) {
579 + netdev_err(adapter->netdev,
580 + "Adapter is resetting, skip timeout reset\n");
581 + return;
582 + }
583 +
584 ibmvnic_reset(adapter, VNIC_RESET_TIMEOUT);
585 }
586
587 diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
588 index 695bbaa86273d..12ef3a0420515 100644
589 --- a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
590 +++ b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
591 @@ -147,6 +147,16 @@
592 #define CSR_MAC_SHADOW_REG_CTL2 (CSR_BASE + 0x0AC)
593 #define CSR_MAC_SHADOW_REG_CTL2_RX_WAKE 0xFFFF
594
595 +/* LTR control (since IWL_DEVICE_FAMILY_22000) */
596 +#define CSR_LTR_LONG_VAL_AD (CSR_BASE + 0x0D4)
597 +#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_REQ 0x80000000
598 +#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_SCALE 0x1c000000
599 +#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_VAL 0x03ff0000
600 +#define CSR_LTR_LONG_VAL_AD_SNOOP_REQ 0x00008000
601 +#define CSR_LTR_LONG_VAL_AD_SNOOP_SCALE 0x00001c00
602 +#define CSR_LTR_LONG_VAL_AD_SNOOP_VAL 0x000003ff
603 +#define CSR_LTR_LONG_VAL_AD_SCALE_USEC 2
604 +
605 /* GIO Chicken Bits (PCI Express bus link power management) */
606 #define CSR_GIO_CHICKEN_BITS (CSR_BASE+0x100)
607
608 diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
609 index 73b8bf0fbf16f..daae86cd61140 100644
610 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
611 +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
612 @@ -3022,7 +3022,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
613
614 /* this would be a mac80211 bug ... but don't crash */
615 if (WARN_ON_ONCE(!mvmvif->phy_ctxt))
616 - return -EINVAL;
617 + return test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status) ? 0 : -EINVAL;
618
619 /*
620 * If we are in a STA removal flow and in DQA mode:
621 diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
622 index 74980382e64c8..7a5b024a6d384 100644
623 --- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
624 +++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
625 @@ -180,6 +180,26 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
626
627 iwl_set_bit(trans, CSR_CTXT_INFO_BOOT_CTRL,
628 CSR_AUTO_FUNC_BOOT_ENA);
629 +
630 + if (trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_AX210) {
631 + /*
632 + * The firmware initializes this again later (to a smaller
633 + * value), but for the boot process initialize the LTR to
634 + * ~250 usec.
635 + */
636 + u32 val = CSR_LTR_LONG_VAL_AD_NO_SNOOP_REQ |
637 + u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
638 + CSR_LTR_LONG_VAL_AD_NO_SNOOP_SCALE) |
639 + u32_encode_bits(250,
640 + CSR_LTR_LONG_VAL_AD_NO_SNOOP_VAL) |
641 + CSR_LTR_LONG_VAL_AD_SNOOP_REQ |
642 + u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
643 + CSR_LTR_LONG_VAL_AD_SNOOP_SCALE) |
644 + u32_encode_bits(250, CSR_LTR_LONG_VAL_AD_SNOOP_VAL);
645 +
646 + iwl_write32(trans, CSR_LTR_LONG_VAL_AD, val);
647 + }
648 +
649 if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
650 iwl_write_umac_prph(trans, UREG_CPU_INIT_RUN, 1);
651 else
652 diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
653 index c76d26708e659..ef5a8ecabc60a 100644
654 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
655 +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
656 @@ -2178,18 +2178,36 @@ static int iwl_trans_pcie_read_mem(struct iwl_trans *trans, u32 addr,
657 void *buf, int dwords)
658 {
659 unsigned long flags;
660 - int offs, ret = 0;
661 + int offs = 0;
662 u32 *vals = buf;
663
664 - if (iwl_trans_grab_nic_access(trans, &flags)) {
665 - iwl_write32(trans, HBUS_TARG_MEM_RADDR, addr);
666 - for (offs = 0; offs < dwords; offs++)
667 - vals[offs] = iwl_read32(trans, HBUS_TARG_MEM_RDAT);
668 - iwl_trans_release_nic_access(trans, &flags);
669 - } else {
670 - ret = -EBUSY;
671 + while (offs < dwords) {
672 + /* limit the time we spin here under lock to 1/2s */
673 + ktime_t timeout = ktime_add_us(ktime_get(), 500 * USEC_PER_MSEC);
674 +
675 + if (iwl_trans_grab_nic_access(trans, &flags)) {
676 + iwl_write32(trans, HBUS_TARG_MEM_RADDR,
677 + addr + 4 * offs);
678 +
679 + while (offs < dwords) {
680 + vals[offs] = iwl_read32(trans,
681 + HBUS_TARG_MEM_RDAT);
682 + offs++;
683 +
684 + /* calling ktime_get is expensive so
685 + * do it once in 128 reads
686 + */
687 + if (offs % 128 == 0 && ktime_after(ktime_get(),
688 + timeout))
689 + break;
690 + }
691 + iwl_trans_release_nic_access(trans, &flags);
692 + } else {
693 + return -EBUSY;
694 + }
695 }
696 - return ret;
697 +
698 + return 0;
699 }
700
701 static int iwl_trans_pcie_write_mem(struct iwl_trans *trans, u32 addr,
702 diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
703 index 12b2707296b64..a85c679b6276c 100644
704 --- a/drivers/pinctrl/pinctrl-amd.c
705 +++ b/drivers/pinctrl/pinctrl-amd.c
706 @@ -435,7 +435,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
707 pin_reg &= ~BIT(LEVEL_TRIG_OFF);
708 pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
709 pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
710 - pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
711 irq_set_handler_locked(d, handle_edge_irq);
712 break;
713
714 @@ -443,7 +442,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
715 pin_reg &= ~BIT(LEVEL_TRIG_OFF);
716 pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
717 pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
718 - pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
719 irq_set_handler_locked(d, handle_edge_irq);
720 break;
721
722 @@ -451,7 +449,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
723 pin_reg &= ~BIT(LEVEL_TRIG_OFF);
724 pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
725 pin_reg |= BOTH_EADGE << ACTIVE_LEVEL_OFF;
726 - pin_reg |= DB_TYPE_REMOVE_GLITCH << DB_CNTRL_OFF;
727 irq_set_handler_locked(d, handle_edge_irq);
728 break;
729
730 @@ -459,8 +456,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
731 pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
732 pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
733 pin_reg |= ACTIVE_HIGH << ACTIVE_LEVEL_OFF;
734 - pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
735 - pin_reg |= DB_TYPE_PRESERVE_LOW_GLITCH << DB_CNTRL_OFF;
736 irq_set_handler_locked(d, handle_level_irq);
737 break;
738
739 @@ -468,8 +463,6 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
740 pin_reg |= LEVEL_TRIGGER << LEVEL_TRIG_OFF;
741 pin_reg &= ~(ACTIVE_LEVEL_MASK << ACTIVE_LEVEL_OFF);
742 pin_reg |= ACTIVE_LOW << ACTIVE_LEVEL_OFF;
743 - pin_reg &= ~(DB_CNTRl_MASK << DB_CNTRL_OFF);
744 - pin_reg |= DB_TYPE_PRESERVE_HIGH_GLITCH << DB_CNTRL_OFF;
745 irq_set_handler_locked(d, handle_level_irq);
746 break;
747
748 diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
749 index 60c18f21588dd..7fa27e7536917 100644
750 --- a/drivers/platform/x86/acer-wmi.c
751 +++ b/drivers/platform/x86/acer-wmi.c
752 @@ -111,6 +111,7 @@ static const struct key_entry acer_wmi_keymap[] __initconst = {
753 {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */
754 {KE_IGNORE, 0x81, {KEY_SLEEP} },
755 {KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} }, /* Touch Pad Toggle */
756 + {KE_IGNORE, 0x84, {KEY_KBDILLUMTOGGLE} }, /* Automatic Keyboard background light toggle */
757 {KE_KEY, KEY_TOUCHPAD_ON, {KEY_TOUCHPAD_ON} },
758 {KE_KEY, KEY_TOUCHPAD_OFF, {KEY_TOUCHPAD_OFF} },
759 {KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
760 diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c
761 index 5c103614a409a..701d1ddda4b11 100644
762 --- a/drivers/platform/x86/intel-vbtn.c
763 +++ b/drivers/platform/x86/intel-vbtn.c
764 @@ -197,6 +197,12 @@ static const struct dmi_system_id dmi_switches_allow_list[] = {
765 DMI_MATCH(DMI_PRODUCT_NAME, "HP Stream x360 Convertible PC 11"),
766 },
767 },
768 + {
769 + .matches = {
770 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
771 + DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion 13 x360 PC"),
772 + },
773 + },
774 {} /* Array terminator */
775 };
776
777 diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
778 index 5081048f2356e..8c54d3707fba3 100644
779 --- a/drivers/platform/x86/thinkpad_acpi.c
780 +++ b/drivers/platform/x86/thinkpad_acpi.c
781 @@ -3232,7 +3232,14 @@ static int hotkey_init_tablet_mode(void)
782
783 in_tablet_mode = hotkey_gmms_get_tablet_mode(res,
784 &has_tablet_mode);
785 - if (has_tablet_mode)
786 + /*
787 + * The Yoga 11e series has 2 accelerometers described by a
788 + * BOSC0200 ACPI node. This setup relies on a Windows service
789 + * which calls special ACPI methods on this node to report
790 + * the laptop/tent/tablet mode to the EC. The bmc150 iio driver
791 + * does not support this, so skip the hotkey on these models.
792 + */
793 + if (has_tablet_mode && !acpi_dev_present("BOSC0200", "1", -1))
794 tp_features.hotkey_tablet = TP_HOTKEY_TABLET_USES_GMMS;
795 type = "GMMS";
796 } else if (acpi_evalf(hkey_handle, &res, "MHKG", "qd")) {
797 @@ -9690,6 +9697,7 @@ static const struct tpacpi_quirk battery_quirk_table[] __initconst = {
798 TPACPI_Q_LNV3('R', '0', 'B', true), /* Thinkpad 11e gen 3 */
799 TPACPI_Q_LNV3('R', '0', 'C', true), /* Thinkpad 13 */
800 TPACPI_Q_LNV3('R', '0', 'J', true), /* Thinkpad 13 gen 2 */
801 + TPACPI_Q_LNV3('R', '0', 'K', true), /* Thinkpad 11e gen 4 celeron BIOS */
802 };
803
804 static int __init tpacpi_battery_init(struct ibm_init_struct *ibm)
805 diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c
806 index 1c7d8324ff5c2..1e072dbba30d6 100644
807 --- a/drivers/platform/x86/touchscreen_dmi.c
808 +++ b/drivers/platform/x86/touchscreen_dmi.c
809 @@ -264,6 +264,21 @@ static const struct ts_dmi_data irbis_tw90_data = {
810 .properties = irbis_tw90_props,
811 };
812
813 +static const struct property_entry irbis_tw118_props[] = {
814 + PROPERTY_ENTRY_U32("touchscreen-min-x", 20),
815 + PROPERTY_ENTRY_U32("touchscreen-min-y", 30),
816 + PROPERTY_ENTRY_U32("touchscreen-size-x", 1960),
817 + PROPERTY_ENTRY_U32("touchscreen-size-y", 1510),
818 + PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-irbis-tw118.fw"),
819 + PROPERTY_ENTRY_U32("silead,max-fingers", 10),
820 + { }
821 +};
822 +
823 +static const struct ts_dmi_data irbis_tw118_data = {
824 + .acpi_name = "MSSL1680:00",
825 + .properties = irbis_tw118_props,
826 +};
827 +
828 static const struct property_entry itworks_tw891_props[] = {
829 PROPERTY_ENTRY_U32("touchscreen-min-x", 1),
830 PROPERTY_ENTRY_U32("touchscreen-min-y", 5),
831 @@ -758,6 +773,14 @@ static const struct dmi_system_id touchscreen_dmi_table[] = {
832 DMI_MATCH(DMI_PRODUCT_NAME, "TW90"),
833 },
834 },
835 + {
836 + /* Irbis TW118 */
837 + .driver_data = (void *)&irbis_tw118_data,
838 + .matches = {
839 + DMI_MATCH(DMI_SYS_VENDOR, "IRBIS"),
840 + DMI_MATCH(DMI_PRODUCT_NAME, "TW118"),
841 + },
842 + },
843 {
844 /* I.T.Works TW891 */
845 .driver_data = (void *)&itworks_tw891_data,
846 diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
847 index 0fa455357594e..0760d0bd8a10b 100644
848 --- a/drivers/scsi/be2iscsi/be_main.c
849 +++ b/drivers/scsi/be2iscsi/be_main.c
850 @@ -3020,7 +3020,6 @@ static int beiscsi_create_eqs(struct beiscsi_hba *phba,
851 goto create_eq_error;
852 }
853
854 - mem->dma = paddr;
855 mem->va = eq_vaddress;
856 ret = be_fill_queue(eq, phba->params.num_eq_entries,
857 sizeof(struct be_eq_entry), eq_vaddress);
858 @@ -3030,6 +3029,7 @@ static int beiscsi_create_eqs(struct beiscsi_hba *phba,
859 goto create_eq_error;
860 }
861
862 + mem->dma = paddr;
863 ret = beiscsi_cmd_eq_create(&phba->ctrl, eq,
864 BEISCSI_EQ_DELAY_DEF);
865 if (ret) {
866 @@ -3086,7 +3086,6 @@ static int beiscsi_create_cqs(struct beiscsi_hba *phba,
867 goto create_cq_error;
868 }
869
870 - mem->dma = paddr;
871 ret = be_fill_queue(cq, phba->params.num_cq_entries,
872 sizeof(struct sol_cqe), cq_vaddress);
873 if (ret) {
874 @@ -3096,6 +3095,7 @@ static int beiscsi_create_cqs(struct beiscsi_hba *phba,
875 goto create_cq_error;
876 }
877
878 + mem->dma = paddr;
879 ret = beiscsi_cmd_cq_create(&phba->ctrl, cq, eq, false,
880 false, 0);
881 if (ret) {
882 diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
883 index b6ce880ddd153..675e16e61ebdd 100644
884 --- a/drivers/scsi/ufs/ufshcd.c
885 +++ b/drivers/scsi/ufs/ufshcd.c
886 @@ -1257,8 +1257,15 @@ static int ufshcd_devfreq_target(struct device *dev,
887 }
888 spin_unlock_irqrestore(hba->host->host_lock, irq_flags);
889
890 + pm_runtime_get_noresume(hba->dev);
891 + if (!pm_runtime_active(hba->dev)) {
892 + pm_runtime_put_noidle(hba->dev);
893 + ret = -EAGAIN;
894 + goto out;
895 + }
896 start = ktime_get();
897 ret = ufshcd_devfreq_scale(hba, scale_up);
898 + pm_runtime_put(hba->dev);
899
900 trace_ufshcd_profile_clk_scaling(dev_name(hba->dev),
901 (scale_up ? "up" : "down"),
902 diff --git a/drivers/soc/fsl/dpio/dpio-driver.c b/drivers/soc/fsl/dpio/dpio-driver.c
903 index 7b642c330977f..7f397b4ad878d 100644
904 --- a/drivers/soc/fsl/dpio/dpio-driver.c
905 +++ b/drivers/soc/fsl/dpio/dpio-driver.c
906 @@ -95,7 +95,6 @@ static int register_dpio_irq_handlers(struct fsl_mc_device *dpio_dev, int cpu)
907 {
908 int error;
909 struct fsl_mc_device_irq *irq;
910 - cpumask_t mask;
911
912 irq = dpio_dev->irqs[0];
913 error = devm_request_irq(&dpio_dev->dev,
914 @@ -112,9 +111,7 @@ static int register_dpio_irq_handlers(struct fsl_mc_device *dpio_dev, int cpu)
915 }
916
917 /* set the affinity hint */
918 - cpumask_clear(&mask);
919 - cpumask_set_cpu(cpu, &mask);
920 - if (irq_set_affinity_hint(irq->msi_desc->irq, &mask))
921 + if (irq_set_affinity_hint(irq->msi_desc->irq, cpumask_of(cpu)))
922 dev_err(&dpio_dev->dev,
923 "irq_set_affinity failed irq %d cpu %d\n",
924 irq->msi_desc->irq, cpu);
925 diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
926 index 28ae5229f889f..efd9e908e2248 100644
927 --- a/drivers/spi/spi-nxp-fspi.c
928 +++ b/drivers/spi/spi-nxp-fspi.c
929 @@ -948,6 +948,7 @@ static int nxp_fspi_probe(struct platform_device *pdev)
930 struct resource *res;
931 struct nxp_fspi *f;
932 int ret;
933 + u32 reg;
934
935 ctlr = spi_alloc_master(&pdev->dev, sizeof(*f));
936 if (!ctlr)
937 @@ -974,6 +975,12 @@ static int nxp_fspi_probe(struct platform_device *pdev)
938 goto err_put_ctrl;
939 }
940
941 + /* Clear potential interrupts */
942 + reg = fspi_readl(f, f->iobase + FSPI_INTR);
943 + if (reg)
944 + fspi_writel(f, reg, f->iobase + FSPI_INTR);
945 +
946 +
947 /* find the resources - controller memory mapped space */
948 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fspi_mmap");
949 f->ahb_addr = devm_ioremap_resource(dev, res);
950 diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
951 index 9442631fd4afc..f51dadd1ce431 100644
952 --- a/fs/proc/task_mmu.c
953 +++ b/fs/proc/task_mmu.c
954 @@ -1567,11 +1567,15 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
955
956 src = *ppos;
957 svpfn = src / PM_ENTRY_BYTES;
958 - start_vaddr = svpfn << PAGE_SHIFT;
959 end_vaddr = mm->task_size;
960
961 /* watch out for wraparound */
962 - if (svpfn > mm->task_size >> PAGE_SHIFT)
963 + start_vaddr = end_vaddr;
964 + if (svpfn <= (ULONG_MAX >> PAGE_SHIFT))
965 + start_vaddr = untagged_addr(svpfn << PAGE_SHIFT);
966 +
967 + /* Ensure the address is inside the task */
968 + if (start_vaddr > mm->task_size)
969 start_vaddr = end_vaddr;
970
971 /*
972 diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h
973 index 0fe5426f2bdcf..1fb55c0ad78ab 100644
974 --- a/include/linux/build_bug.h
975 +++ b/include/linux/build_bug.h
976 @@ -77,4 +77,9 @@
977 #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
978 #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
979
980 +#ifdef __GENKSYMS__
981 +/* genksyms gets confused by _Static_assert */
982 +#define _Static_assert(expr, ...)
983 +#endif
984 +
985 #endif /* _LINUX_BUILD_BUG_H */
986 diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
987 index 333a6695a918c..0e06df20928c4 100644
988 --- a/include/linux/compiler-clang.h
989 +++ b/include/linux/compiler-clang.h
990 @@ -36,9 +36,3 @@
991 __has_builtin(__builtin_sub_overflow)
992 #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
993 #endif
994 -
995 -/* The following are for compatibility with GCC, from compiler-gcc.h,
996 - * and may be redefined here because they should not be shared with other
997 - * compilers, like ICC.
998 - */
999 -#define barrier() __asm__ __volatile__("" : : : "memory")
1000 diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
1001 index e8579412ad214..d8fab3ecf5120 100644
1002 --- a/include/linux/compiler-gcc.h
1003 +++ b/include/linux/compiler-gcc.h
1004 @@ -14,25 +14,6 @@
1005 # error Sorry, your compiler is too old - please upgrade it.
1006 #endif
1007
1008 -/* Optimization barrier */
1009 -
1010 -/* The "volatile" is due to gcc bugs */
1011 -#define barrier() __asm__ __volatile__("": : :"memory")
1012 -/*
1013 - * This version is i.e. to prevent dead stores elimination on @ptr
1014 - * where gcc and llvm may behave differently when otherwise using
1015 - * normal barrier(): while gcc behavior gets along with a normal
1016 - * barrier(), llvm needs an explicit input variable to be assumed
1017 - * clobbered. The issue is as follows: while the inline asm might
1018 - * access any memory it wants, the compiler could have fit all of
1019 - * @ptr into memory registers instead, and since @ptr never escaped
1020 - * from that, it proved that the inline asm wasn't touching any of
1021 - * it. This version works well with both compilers, i.e. we're telling
1022 - * the compiler that the inline asm absolutely may see the contents
1023 - * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495
1024 - */
1025 -#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")
1026 -
1027 /*
1028 * This macro obfuscates arithmetic on a variable address so that gcc
1029 * shouldn't recognize the original var, and make assumptions about it.
1030 diff --git a/include/linux/compiler.h b/include/linux/compiler.h
1031 index 448c91bf543b7..f164a9b12813f 100644
1032 --- a/include/linux/compiler.h
1033 +++ b/include/linux/compiler.h
1034 @@ -80,11 +80,25 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
1035
1036 /* Optimization barrier */
1037 #ifndef barrier
1038 -# define barrier() __memory_barrier()
1039 +/* The "volatile" is due to gcc bugs */
1040 +# define barrier() __asm__ __volatile__("": : :"memory")
1041 #endif
1042
1043 #ifndef barrier_data
1044 -# define barrier_data(ptr) barrier()
1045 +/*
1046 + * This version is i.e. to prevent dead stores elimination on @ptr
1047 + * where gcc and llvm may behave differently when otherwise using
1048 + * normal barrier(): while gcc behavior gets along with a normal
1049 + * barrier(), llvm needs an explicit input variable to be assumed
1050 + * clobbered. The issue is as follows: while the inline asm might
1051 + * access any memory it wants, the compiler could have fit all of
1052 + * @ptr into memory registers instead, and since @ptr never escaped
1053 + * from that, it proved that the inline asm wasn't touching any of
1054 + * it. This version works well with both compilers, i.e. we're telling
1055 + * the compiler that the inline asm absolutely may see the contents
1056 + * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495
1057 + */
1058 +# define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")
1059 #endif
1060
1061 /* workaround for GCC PR82365 if needed */
1062 diff --git a/include/linux/zsmalloc.h b/include/linux/zsmalloc.h
1063 index 2219cce81ca48..4807ca4d52e03 100644
1064 --- a/include/linux/zsmalloc.h
1065 +++ b/include/linux/zsmalloc.h
1066 @@ -20,7 +20,6 @@
1067 * zsmalloc mapping modes
1068 *
1069 * NOTE: These only make a difference when a mapped object spans pages.
1070 - * They also have no effect when PGTABLE_MAPPING is selected.
1071 */
1072 enum zs_mapmode {
1073 ZS_MM_RW, /* normal read-write mapping */
1074 diff --git a/mm/Kconfig b/mm/Kconfig
1075 index a5dae9a7eb510..fbdc5c70e4873 100644
1076 --- a/mm/Kconfig
1077 +++ b/mm/Kconfig
1078 @@ -576,19 +576,6 @@ config ZSMALLOC
1079 returned by an alloc(). This handle must be mapped in order to
1080 access the allocated space.
1081
1082 -config PGTABLE_MAPPING
1083 - bool "Use page table mapping to access object in zsmalloc"
1084 - depends on ZSMALLOC
1085 - help
1086 - By default, zsmalloc uses a copy-based object mapping method to
1087 - access allocations that span two pages. However, if a particular
1088 - architecture (ex, ARM) performs VM mapping faster than copying,
1089 - then you should select this. This causes zsmalloc to use page table
1090 - mapping rather than copying for object mapping.
1091 -
1092 - You can check speed with zsmalloc benchmark:
1093 - https://github.com/spartacus06/zsmapbench
1094 -
1095 config ZSMALLOC_STAT
1096 bool "Export zsmalloc statistics"
1097 depends on ZSMALLOC
1098 diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
1099 index 22d17ecfe7df4..8a72a3b3837b4 100644
1100 --- a/mm/zsmalloc.c
1101 +++ b/mm/zsmalloc.c
1102 @@ -293,11 +293,7 @@ struct zspage {
1103 };
1104
1105 struct mapping_area {
1106 -#ifdef CONFIG_PGTABLE_MAPPING
1107 - struct vm_struct *vm; /* vm area for mapping object that span pages */
1108 -#else
1109 char *vm_buf; /* copy buffer for objects that span pages */
1110 -#endif
1111 char *vm_addr; /* address of kmap_atomic()'ed pages */
1112 enum zs_mapmode vm_mm; /* mapping mode */
1113 };
1114 @@ -1113,46 +1109,6 @@ static struct zspage *find_get_zspage(struct size_class *class)
1115 return zspage;
1116 }
1117
1118 -#ifdef CONFIG_PGTABLE_MAPPING
1119 -static inline int __zs_cpu_up(struct mapping_area *area)
1120 -{
1121 - /*
1122 - * Make sure we don't leak memory if a cpu UP notification
1123 - * and zs_init() race and both call zs_cpu_up() on the same cpu
1124 - */
1125 - if (area->vm)
1126 - return 0;
1127 - area->vm = alloc_vm_area(PAGE_SIZE * 2, NULL);
1128 - if (!area->vm)
1129 - return -ENOMEM;
1130 - return 0;
1131 -}
1132 -
1133 -static inline void __zs_cpu_down(struct mapping_area *area)
1134 -{
1135 - if (area->vm)
1136 - free_vm_area(area->vm);
1137 - area->vm = NULL;
1138 -}
1139 -
1140 -static inline void *__zs_map_object(struct mapping_area *area,
1141 - struct page *pages[2], int off, int size)
1142 -{
1143 - BUG_ON(map_vm_area(area->vm, PAGE_KERNEL, pages));
1144 - area->vm_addr = area->vm->addr;
1145 - return area->vm_addr + off;
1146 -}
1147 -
1148 -static inline void __zs_unmap_object(struct mapping_area *area,
1149 - struct page *pages[2], int off, int size)
1150 -{
1151 - unsigned long addr = (unsigned long)area->vm_addr;
1152 -
1153 - unmap_kernel_range(addr, PAGE_SIZE * 2);
1154 -}
1155 -
1156 -#else /* CONFIG_PGTABLE_MAPPING */
1157 -
1158 static inline int __zs_cpu_up(struct mapping_area *area)
1159 {
1160 /*
1161 @@ -1233,8 +1189,6 @@ out:
1162 pagefault_enable();
1163 }
1164
1165 -#endif /* CONFIG_PGTABLE_MAPPING */
1166 -
1167 static int zs_cpu_prepare(unsigned int cpu)
1168 {
1169 struct mapping_area *area;
1170 diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
1171 index 42b6cd41d2ea4..6c4f21db5fbad 100755
1172 --- a/tools/testing/ktest/ktest.pl
1173 +++ b/tools/testing/ktest/ktest.pl
1174 @@ -2008,7 +2008,7 @@ sub reboot_to {
1175
1176 if ($reboot_type eq "grub") {
1177 run_ssh "'(echo \"savedefault --default=$grub_number --once\" | grub --batch)'";
1178 - } elsif ($reboot_type eq "grub2") {
1179 + } elsif (($reboot_type eq "grub2") or ($reboot_type eq "grub2bls")) {
1180 run_ssh "$grub_reboot $grub_number";
1181 } elsif ($reboot_type eq "syslinux") {
1182 run_ssh "$syslinux --once \\\"$syslinux_label\\\" $syslinux_path";