Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.4 commit in: /
Date: Wed, 15 Sep 2021 12:01:01
Message-Id: 1631707242.f1eb05238e10533a9d19fdfc1e4cc99acfa0e9ee.mpagano@gentoo
1 commit: f1eb05238e10533a9d19fdfc1e4cc99acfa0e9ee
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 15 12:00:42 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 15 12:00:42 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f1eb0523
7
8 Linux patch 5.4.146
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1145_linux-5.4.146.patch | 5068 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 5072 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 0712ff5..f0cfe0c 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -623,6 +623,10 @@ Patch: 1144_linux-5.4.145.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.4.145
23
24 +Patch: 1145_linux-5.4.146.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.4.146
27 +
28 Patch: 1500_XATTR_USER_PREFIX.patch
29 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
30 Desc: Support for namespace user.pax.* on tmpfs.
31
32 diff --git a/1145_linux-5.4.146.patch b/1145_linux-5.4.146.patch
33 new file mode 100644
34 index 0000000..c7ea7f7
35 --- /dev/null
36 +++ b/1145_linux-5.4.146.patch
37 @@ -0,0 +1,5068 @@
38 +diff --git a/Makefile b/Makefile
39 +index c32a36c8ffc90..48d0c03acfc55 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 5
45 + PATCHLEVEL = 4
46 +-SUBLEVEL = 145
47 ++SUBLEVEL = 146
48 + EXTRAVERSION =
49 + NAME = Kleptomaniac Octopus
50 +
51 +diff --git a/arch/arm/boot/dts/aspeed-g6-pinctrl.dtsi b/arch/arm/boot/dts/aspeed-g6-pinctrl.dtsi
52 +index 5b8bf58e89cb4..996e006e06c25 100644
53 +--- a/arch/arm/boot/dts/aspeed-g6-pinctrl.dtsi
54 ++++ b/arch/arm/boot/dts/aspeed-g6-pinctrl.dtsi
55 +@@ -208,12 +208,12 @@
56 + };
57 +
58 + pinctrl_hvi3c3_default: hvi3c3_default {
59 +- function = "HVI3C3";
60 ++ function = "I3C3";
61 + groups = "HVI3C3";
62 + };
63 +
64 + pinctrl_hvi3c4_default: hvi3c4_default {
65 +- function = "HVI3C4";
66 ++ function = "I3C4";
67 + groups = "HVI3C4";
68 + };
69 +
70 +diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
71 +index 3efe9d41c2bb6..d7c9dbee0f016 100644
72 +--- a/arch/arm/boot/dts/meson8.dtsi
73 ++++ b/arch/arm/boot/dts/meson8.dtsi
74 +@@ -241,8 +241,13 @@
75 + "pp2", "ppmmu2", "pp4", "ppmmu4",
76 + "pp5", "ppmmu5", "pp6", "ppmmu6";
77 + resets = <&reset RESET_MALI>;
78 ++
79 + clocks = <&clkc CLKID_CLK81>, <&clkc CLKID_MALI>;
80 + clock-names = "bus", "core";
81 ++
82 ++ assigned-clocks = <&clkc CLKID_MALI>;
83 ++ assigned-clock-rates = <318750000>;
84 ++
85 + operating-points-v2 = <&gpu_opp_table>;
86 + };
87 + };
88 +diff --git a/arch/arm/boot/dts/meson8b-ec100.dts b/arch/arm/boot/dts/meson8b-ec100.dts
89 +index bed1dfef19857..32d1c322dbc65 100644
90 +--- a/arch/arm/boot/dts/meson8b-ec100.dts
91 ++++ b/arch/arm/boot/dts/meson8b-ec100.dts
92 +@@ -148,7 +148,7 @@
93 + regulator-min-microvolt = <860000>;
94 + regulator-max-microvolt = <1140000>;
95 +
96 +- vin-supply = <&vcc_5v>;
97 ++ pwm-supply = <&vcc_5v>;
98 +
99 + pwms = <&pwm_cd 0 1148 0>;
100 + pwm-dutycycle-range = <100 0>;
101 +@@ -232,7 +232,7 @@
102 + regulator-min-microvolt = <860000>;
103 + regulator-max-microvolt = <1140000>;
104 +
105 +- vin-supply = <&vcc_5v>;
106 ++ pwm-supply = <&vcc_5v>;
107 +
108 + pwms = <&pwm_cd 1 1148 0>;
109 + pwm-dutycycle-range = <100 0>;
110 +diff --git a/arch/arm/boot/dts/meson8b-mxq.dts b/arch/arm/boot/dts/meson8b-mxq.dts
111 +index 6e39ad52e42d3..ab8fe55963f7c 100644
112 +--- a/arch/arm/boot/dts/meson8b-mxq.dts
113 ++++ b/arch/arm/boot/dts/meson8b-mxq.dts
114 +@@ -39,6 +39,8 @@
115 + regulator-min-microvolt = <860000>;
116 + regulator-max-microvolt = <1140000>;
117 +
118 ++ pwm-supply = <&vcc_5v>;
119 ++
120 + pwms = <&pwm_cd 0 1148 0>;
121 + pwm-dutycycle-range = <100 0>;
122 +
123 +@@ -84,7 +86,7 @@
124 + regulator-min-microvolt = <860000>;
125 + regulator-max-microvolt = <1140000>;
126 +
127 +- vin-supply = <&vcc_5v>;
128 ++ pwm-supply = <&vcc_5v>;
129 +
130 + pwms = <&pwm_cd 1 1148 0>;
131 + pwm-dutycycle-range = <100 0>;
132 +diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
133 +index 0f9c71137bed5..c413af9a7af8e 100644
134 +--- a/arch/arm/boot/dts/meson8b-odroidc1.dts
135 ++++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
136 +@@ -130,7 +130,7 @@
137 + regulator-min-microvolt = <860000>;
138 + regulator-max-microvolt = <1140000>;
139 +
140 +- vin-supply = <&p5v0>;
141 ++ pwm-supply = <&p5v0>;
142 +
143 + pwms = <&pwm_cd 0 12218 0>;
144 + pwm-dutycycle-range = <91 0>;
145 +@@ -162,7 +162,7 @@
146 + regulator-min-microvolt = <860000>;
147 + regulator-max-microvolt = <1140000>;
148 +
149 +- vin-supply = <&p5v0>;
150 ++ pwm-supply = <&p5v0>;
151 +
152 + pwms = <&pwm_cd 1 12218 0>;
153 + pwm-dutycycle-range = <91 0>;
154 +diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
155 +index 7216653424fd6..b51a8c7b01114 100644
156 +--- a/arch/arm/net/bpf_jit_32.c
157 ++++ b/arch/arm/net/bpf_jit_32.c
158 +@@ -1602,6 +1602,9 @@ exit:
159 + rn = arm_bpf_get_reg32(src_lo, tmp2[1], ctx);
160 + emit_ldx_r(dst, rn, off, ctx, BPF_SIZE(code));
161 + break;
162 ++ /* speculation barrier */
163 ++ case BPF_ST | BPF_NOSPEC:
164 ++ break;
165 + /* ST: *(size *)(dst + off) = imm */
166 + case BPF_ST | BPF_MEM | BPF_W:
167 + case BPF_ST | BPF_MEM | BPF_H:
168 +diff --git a/arch/arm64/boot/dts/exynos/exynos7.dtsi b/arch/arm64/boot/dts/exynos/exynos7.dtsi
169 +index 25549d9552ae2..84f92b44c3235 100644
170 +--- a/arch/arm64/boot/dts/exynos/exynos7.dtsi
171 ++++ b/arch/arm64/boot/dts/exynos/exynos7.dtsi
172 +@@ -113,7 +113,7 @@
173 + #address-cells = <0>;
174 + interrupt-controller;
175 + reg = <0x11001000 0x1000>,
176 +- <0x11002000 0x1000>,
177 ++ <0x11002000 0x2000>,
178 + <0x11004000 0x2000>,
179 + <0x11006000 0x2000>;
180 + };
181 +diff --git a/arch/arm64/boot/dts/renesas/r8a77995-draak.dts b/arch/arm64/boot/dts/renesas/r8a77995-draak.dts
182 +index 67634cb01d6b6..cbdd46ed3ca63 100644
183 +--- a/arch/arm64/boot/dts/renesas/r8a77995-draak.dts
184 ++++ b/arch/arm64/boot/dts/renesas/r8a77995-draak.dts
185 +@@ -277,10 +277,6 @@
186 + interrupt-parent = <&gpio1>;
187 + interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
188 +
189 +- /* Depends on LVDS */
190 +- max-clock = <135000000>;
191 +- min-vrefresh = <50>;
192 +-
193 + adi,input-depth = <8>;
194 + adi,input-colorspace = "rgb";
195 + adi,input-clock = "1x";
196 +diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
197 +index 945e5f690edec..afc7d41347f73 100644
198 +--- a/arch/arm64/net/bpf_jit_comp.c
199 ++++ b/arch/arm64/net/bpf_jit_comp.c
200 +@@ -701,6 +701,19 @@ emit_cond_jmp:
201 + }
202 + break;
203 +
204 ++ /* speculation barrier */
205 ++ case BPF_ST | BPF_NOSPEC:
206 ++ /*
207 ++ * Nothing required here.
208 ++ *
209 ++ * In case of arm64, we rely on the firmware mitigation of
210 ++ * Speculative Store Bypass as controlled via the ssbd kernel
211 ++ * parameter. Whenever the mitigation is enabled, it works
212 ++ * for all of the kernel code with no need to provide any
213 ++ * additional instructions.
214 ++ */
215 ++ break;
216 ++
217 + /* ST: *(size *)(dst + off) = imm */
218 + case BPF_ST | BPF_MEM | BPF_W:
219 + case BPF_ST | BPF_MEM | BPF_H:
220 +diff --git a/arch/m68k/emu/nfeth.c b/arch/m68k/emu/nfeth.c
221 +index a4ebd2445edae..e5831cd293d05 100644
222 +--- a/arch/m68k/emu/nfeth.c
223 ++++ b/arch/m68k/emu/nfeth.c
224 +@@ -254,8 +254,8 @@ static void __exit nfeth_cleanup(void)
225 +
226 + for (i = 0; i < MAX_UNIT; i++) {
227 + if (nfeth_dev[i]) {
228 +- unregister_netdev(nfeth_dev[0]);
229 +- free_netdev(nfeth_dev[0]);
230 ++ unregister_netdev(nfeth_dev[i]);
231 ++ free_netdev(nfeth_dev[i]);
232 + }
233 + }
234 + free_irq(nfEtherIRQ, nfeth_interrupt);
235 +diff --git a/arch/mips/net/ebpf_jit.c b/arch/mips/net/ebpf_jit.c
236 +index 561154cbcc401..b31b91e57c341 100644
237 +--- a/arch/mips/net/ebpf_jit.c
238 ++++ b/arch/mips/net/ebpf_jit.c
239 +@@ -1355,6 +1355,9 @@ jeq_common:
240 + }
241 + break;
242 +
243 ++ case BPF_ST | BPF_NOSPEC: /* speculation barrier */
244 ++ break;
245 ++
246 + case BPF_ST | BPF_B | BPF_MEM:
247 + case BPF_ST | BPF_H | BPF_MEM:
248 + case BPF_ST | BPF_W | BPF_MEM:
249 +diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
250 +index be3517ef0574d..20bfd753bcba6 100644
251 +--- a/arch/powerpc/net/bpf_jit_comp64.c
252 ++++ b/arch/powerpc/net/bpf_jit_comp64.c
253 +@@ -644,6 +644,12 @@ emit_clear:
254 + }
255 + break;
256 +
257 ++ /*
258 ++ * BPF_ST NOSPEC (speculation barrier)
259 ++ */
260 ++ case BPF_ST | BPF_NOSPEC:
261 ++ break;
262 ++
263 + /*
264 + * BPF_ST(X)
265 + */
266 +diff --git a/arch/riscv/net/bpf_jit_comp.c b/arch/riscv/net/bpf_jit_comp.c
267 +index e2279fed8f564..0eefe6193253b 100644
268 +--- a/arch/riscv/net/bpf_jit_comp.c
269 ++++ b/arch/riscv/net/bpf_jit_comp.c
270 +@@ -1313,6 +1313,10 @@ out_be:
271 + emit(rv_ld(rd, 0, RV_REG_T1), ctx);
272 + break;
273 +
274 ++ /* speculation barrier */
275 ++ case BPF_ST | BPF_NOSPEC:
276 ++ break;
277 ++
278 + /* ST: *(size *)(dst + off) = imm */
279 + case BPF_ST | BPF_MEM | BPF_B:
280 + emit_imm(RV_REG_T1, imm, ctx);
281 +diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
282 +index 0fe5600a037e4..4d59d11e6813d 100644
283 +--- a/arch/s390/include/asm/kvm_host.h
284 ++++ b/arch/s390/include/asm/kvm_host.h
285 +@@ -873,6 +873,7 @@ struct kvm_arch{
286 + atomic64_t cmma_dirty_pages;
287 + /* subset of available cpu features enabled by user space */
288 + DECLARE_BITMAP(cpu_feat, KVM_S390_VM_CPU_FEAT_NR_BITS);
289 ++ /* indexed by vcpu_idx */
290 + DECLARE_BITMAP(idle_mask, KVM_MAX_VCPUS);
291 + struct kvm_s390_gisa_interrupt gisa_int;
292 + };
293 +diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
294 +index 7184d55d87aae..b1aadc3ad065d 100644
295 +--- a/arch/s390/kernel/debug.c
296 ++++ b/arch/s390/kernel/debug.c
297 +@@ -327,24 +327,6 @@ static debug_info_t *debug_info_create(const char *name, int pages_per_area,
298 + goto out;
299 +
300 + rc->mode = mode & ~S_IFMT;
301 +-
302 +- /* create root directory */
303 +- rc->debugfs_root_entry = debugfs_create_dir(rc->name,
304 +- debug_debugfs_root_entry);
305 +-
306 +- /* append new element to linked list */
307 +- if (!debug_area_first) {
308 +- /* first element in list */
309 +- debug_area_first = rc;
310 +- rc->prev = NULL;
311 +- } else {
312 +- /* append element to end of list */
313 +- debug_area_last->next = rc;
314 +- rc->prev = debug_area_last;
315 +- }
316 +- debug_area_last = rc;
317 +- rc->next = NULL;
318 +-
319 + refcount_set(&rc->ref_count, 1);
320 + out:
321 + return rc;
322 +@@ -404,27 +386,10 @@ static void debug_info_get(debug_info_t *db_info)
323 + */
324 + static void debug_info_put(debug_info_t *db_info)
325 + {
326 +- int i;
327 +-
328 + if (!db_info)
329 + return;
330 +- if (refcount_dec_and_test(&db_info->ref_count)) {
331 +- for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
332 +- if (!db_info->views[i])
333 +- continue;
334 +- debugfs_remove(db_info->debugfs_entries[i]);
335 +- }
336 +- debugfs_remove(db_info->debugfs_root_entry);
337 +- if (db_info == debug_area_first)
338 +- debug_area_first = db_info->next;
339 +- if (db_info == debug_area_last)
340 +- debug_area_last = db_info->prev;
341 +- if (db_info->prev)
342 +- db_info->prev->next = db_info->next;
343 +- if (db_info->next)
344 +- db_info->next->prev = db_info->prev;
345 ++ if (refcount_dec_and_test(&db_info->ref_count))
346 + debug_info_free(db_info);
347 +- }
348 + }
349 +
350 + /*
351 +@@ -648,6 +613,31 @@ static int debug_close(struct inode *inode, struct file *file)
352 + return 0; /* success */
353 + }
354 +
355 ++/* Create debugfs entries and add to internal list. */
356 ++static void _debug_register(debug_info_t *id)
357 ++{
358 ++ /* create root directory */
359 ++ id->debugfs_root_entry = debugfs_create_dir(id->name,
360 ++ debug_debugfs_root_entry);
361 ++
362 ++ /* append new element to linked list */
363 ++ if (!debug_area_first) {
364 ++ /* first element in list */
365 ++ debug_area_first = id;
366 ++ id->prev = NULL;
367 ++ } else {
368 ++ /* append element to end of list */
369 ++ debug_area_last->next = id;
370 ++ id->prev = debug_area_last;
371 ++ }
372 ++ debug_area_last = id;
373 ++ id->next = NULL;
374 ++
375 ++ debug_register_view(id, &debug_level_view);
376 ++ debug_register_view(id, &debug_flush_view);
377 ++ debug_register_view(id, &debug_pages_view);
378 ++}
379 ++
380 + /**
381 + * debug_register_mode() - creates and initializes debug area.
382 + *
383 +@@ -677,19 +667,16 @@ debug_info_t *debug_register_mode(const char *name, int pages_per_area,
384 + if ((uid != 0) || (gid != 0))
385 + pr_warn("Root becomes the owner of all s390dbf files in sysfs\n");
386 + BUG_ON(!initialized);
387 +- mutex_lock(&debug_mutex);
388 +
389 + /* create new debug_info */
390 + rc = debug_info_create(name, pages_per_area, nr_areas, buf_size, mode);
391 +- if (!rc)
392 +- goto out;
393 +- debug_register_view(rc, &debug_level_view);
394 +- debug_register_view(rc, &debug_flush_view);
395 +- debug_register_view(rc, &debug_pages_view);
396 +-out:
397 +- if (!rc)
398 ++ if (rc) {
399 ++ mutex_lock(&debug_mutex);
400 ++ _debug_register(rc);
401 ++ mutex_unlock(&debug_mutex);
402 ++ } else {
403 + pr_err("Registering debug feature %s failed\n", name);
404 +- mutex_unlock(&debug_mutex);
405 ++ }
406 + return rc;
407 + }
408 + EXPORT_SYMBOL(debug_register_mode);
409 +@@ -718,6 +705,27 @@ debug_info_t *debug_register(const char *name, int pages_per_area,
410 + }
411 + EXPORT_SYMBOL(debug_register);
412 +
413 ++/* Remove debugfs entries and remove from internal list. */
414 ++static void _debug_unregister(debug_info_t *id)
415 ++{
416 ++ int i;
417 ++
418 ++ for (i = 0; i < DEBUG_MAX_VIEWS; i++) {
419 ++ if (!id->views[i])
420 ++ continue;
421 ++ debugfs_remove(id->debugfs_entries[i]);
422 ++ }
423 ++ debugfs_remove(id->debugfs_root_entry);
424 ++ if (id == debug_area_first)
425 ++ debug_area_first = id->next;
426 ++ if (id == debug_area_last)
427 ++ debug_area_last = id->prev;
428 ++ if (id->prev)
429 ++ id->prev->next = id->next;
430 ++ if (id->next)
431 ++ id->next->prev = id->prev;
432 ++}
433 ++
434 + /**
435 + * debug_unregister() - give back debug area.
436 + *
437 +@@ -731,8 +739,10 @@ void debug_unregister(debug_info_t *id)
438 + if (!id)
439 + return;
440 + mutex_lock(&debug_mutex);
441 +- debug_info_put(id);
442 ++ _debug_unregister(id);
443 + mutex_unlock(&debug_mutex);
444 ++
445 ++ debug_info_put(id);
446 + }
447 + EXPORT_SYMBOL(debug_unregister);
448 +
449 +diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
450 +index 62388a678b91a..fa9483aa4f575 100644
451 +--- a/arch/s390/kvm/interrupt.c
452 ++++ b/arch/s390/kvm/interrupt.c
453 +@@ -408,13 +408,13 @@ static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu)
454 + static void __set_cpu_idle(struct kvm_vcpu *vcpu)
455 + {
456 + kvm_s390_set_cpuflags(vcpu, CPUSTAT_WAIT);
457 +- set_bit(vcpu->vcpu_id, vcpu->kvm->arch.idle_mask);
458 ++ set_bit(kvm_vcpu_get_idx(vcpu), vcpu->kvm->arch.idle_mask);
459 + }
460 +
461 + static void __unset_cpu_idle(struct kvm_vcpu *vcpu)
462 + {
463 + kvm_s390_clear_cpuflags(vcpu, CPUSTAT_WAIT);
464 +- clear_bit(vcpu->vcpu_id, vcpu->kvm->arch.idle_mask);
465 ++ clear_bit(kvm_vcpu_get_idx(vcpu), vcpu->kvm->arch.idle_mask);
466 + }
467 +
468 + static void __reset_intercept_indicators(struct kvm_vcpu *vcpu)
469 +@@ -2984,18 +2984,18 @@ int kvm_s390_get_irq_state(struct kvm_vcpu *vcpu, __u8 __user *buf, int len)
470 +
471 + static void __airqs_kick_single_vcpu(struct kvm *kvm, u8 deliverable_mask)
472 + {
473 +- int vcpu_id, online_vcpus = atomic_read(&kvm->online_vcpus);
474 ++ int vcpu_idx, online_vcpus = atomic_read(&kvm->online_vcpus);
475 + struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int;
476 + struct kvm_vcpu *vcpu;
477 +
478 +- for_each_set_bit(vcpu_id, kvm->arch.idle_mask, online_vcpus) {
479 +- vcpu = kvm_get_vcpu(kvm, vcpu_id);
480 ++ for_each_set_bit(vcpu_idx, kvm->arch.idle_mask, online_vcpus) {
481 ++ vcpu = kvm_get_vcpu(kvm, vcpu_idx);
482 + if (psw_ioint_disabled(vcpu))
483 + continue;
484 + deliverable_mask &= (u8)(vcpu->arch.sie_block->gcr[6] >> 24);
485 + if (deliverable_mask) {
486 + /* lately kicked but not yet running */
487 +- if (test_and_set_bit(vcpu_id, gi->kicked_mask))
488 ++ if (test_and_set_bit(vcpu_idx, gi->kicked_mask))
489 + return;
490 + kvm_s390_vcpu_wakeup(vcpu);
491 + return;
492 +diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
493 +index 20ba8537dbcc2..9ed2fee612297 100644
494 +--- a/arch/s390/kvm/kvm-s390.c
495 ++++ b/arch/s390/kvm/kvm-s390.c
496 +@@ -3726,7 +3726,7 @@ static int vcpu_pre_run(struct kvm_vcpu *vcpu)
497 + kvm_s390_patch_guest_per_regs(vcpu);
498 + }
499 +
500 +- clear_bit(vcpu->vcpu_id, vcpu->kvm->arch.gisa_int.kicked_mask);
501 ++ clear_bit(kvm_vcpu_get_idx(vcpu), vcpu->kvm->arch.gisa_int.kicked_mask);
502 +
503 + vcpu->arch.sie_block->icptcode = 0;
504 + cpuflags = atomic_read(&vcpu->arch.sie_block->cpuflags);
505 +diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
506 +index 6d9448dbd052b..63d94a5253a8f 100644
507 +--- a/arch/s390/kvm/kvm-s390.h
508 ++++ b/arch/s390/kvm/kvm-s390.h
509 +@@ -67,7 +67,7 @@ static inline int is_vcpu_stopped(struct kvm_vcpu *vcpu)
510 +
511 + static inline int is_vcpu_idle(struct kvm_vcpu *vcpu)
512 + {
513 +- return test_bit(vcpu->vcpu_id, vcpu->kvm->arch.idle_mask);
514 ++ return test_bit(kvm_vcpu_get_idx(vcpu), vcpu->kvm->arch.idle_mask);
515 + }
516 +
517 + static inline int kvm_is_ucontrol(struct kvm *kvm)
518 +diff --git a/arch/s390/mm/kasan_init.c b/arch/s390/mm/kasan_init.c
519 +index 460f255729402..5182e0836ca71 100644
520 +--- a/arch/s390/mm/kasan_init.c
521 ++++ b/arch/s390/mm/kasan_init.c
522 +@@ -101,6 +101,9 @@ static void __init kasan_early_vmemmap_populate(unsigned long address,
523 + pgt_prot = pgprot_val(PAGE_KERNEL_EXEC);
524 + sgt_prot = pgprot_val(SEGMENT_KERNEL_EXEC);
525 +
526 ++ /*
527 ++ * The first 1MB of 1:1 mapping is mapped with 4KB pages
528 ++ */
529 + while (address < end) {
530 + pg_dir = pgd_offset_k(address);
531 + if (pgd_none(*pg_dir)) {
532 +@@ -146,30 +149,26 @@ static void __init kasan_early_vmemmap_populate(unsigned long address,
533 +
534 + pm_dir = pmd_offset(pu_dir, address);
535 + if (pmd_none(*pm_dir)) {
536 +- if (mode == POPULATE_ZERO_SHADOW &&
537 +- IS_ALIGNED(address, PMD_SIZE) &&
538 ++ if (IS_ALIGNED(address, PMD_SIZE) &&
539 + end - address >= PMD_SIZE) {
540 +- pmd_populate(&init_mm, pm_dir,
541 +- kasan_early_shadow_pte);
542 +- address = (address + PMD_SIZE) & PMD_MASK;
543 +- continue;
544 +- }
545 +- /* the first megabyte of 1:1 is mapped with 4k pages */
546 +- if (has_edat && address && end - address >= PMD_SIZE &&
547 +- mode != POPULATE_ZERO_SHADOW) {
548 +- void *page;
549 +-
550 +- if (mode == POPULATE_ONE2ONE) {
551 +- page = (void *)address;
552 +- } else {
553 +- page = kasan_early_alloc_segment();
554 +- memset(page, 0, _SEGMENT_SIZE);
555 ++ if (mode == POPULATE_ZERO_SHADOW) {
556 ++ pmd_populate(&init_mm, pm_dir, kasan_early_shadow_pte);
557 ++ address = (address + PMD_SIZE) & PMD_MASK;
558 ++ continue;
559 ++ } else if (has_edat && address) {
560 ++ void *page;
561 ++
562 ++ if (mode == POPULATE_ONE2ONE) {
563 ++ page = (void *)address;
564 ++ } else {
565 ++ page = kasan_early_alloc_segment();
566 ++ memset(page, 0, _SEGMENT_SIZE);
567 ++ }
568 ++ pmd_val(*pm_dir) = __pa(page) | sgt_prot;
569 ++ address = (address + PMD_SIZE) & PMD_MASK;
570 ++ continue;
571 + }
572 +- pmd_val(*pm_dir) = __pa(page) | sgt_prot;
573 +- address = (address + PMD_SIZE) & PMD_MASK;
574 +- continue;
575 + }
576 +-
577 + pt_dir = kasan_early_pte_alloc();
578 + pmd_populate(&init_mm, pm_dir, pt_dir);
579 + } else if (pmd_large(*pm_dir)) {
580 +diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
581 +index e160f4650f8e4..3e6612d8b921c 100644
582 +--- a/arch/s390/net/bpf_jit_comp.c
583 ++++ b/arch/s390/net/bpf_jit_comp.c
584 +@@ -913,6 +913,11 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp,
585 + break;
586 + }
587 + break;
588 ++ /*
589 ++ * BPF_NOSPEC (speculation barrier)
590 ++ */
591 ++ case BPF_ST | BPF_NOSPEC:
592 ++ break;
593 + /*
594 + * BPF_ST(X)
595 + */
596 +diff --git a/arch/sparc/net/bpf_jit_comp_64.c b/arch/sparc/net/bpf_jit_comp_64.c
597 +index 3364e2a009899..fef734473c0f3 100644
598 +--- a/arch/sparc/net/bpf_jit_comp_64.c
599 ++++ b/arch/sparc/net/bpf_jit_comp_64.c
600 +@@ -1287,6 +1287,9 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)
601 + return 1;
602 + break;
603 + }
604 ++ /* speculation barrier */
605 ++ case BPF_ST | BPF_NOSPEC:
606 ++ break;
607 + /* ST: *(size *)(dst + off) = imm */
608 + case BPF_ST | BPF_MEM | BPF_W:
609 + case BPF_ST | BPF_MEM | BPF_H:
610 +diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
611 +index ff07040287c40..b7baaa9733173 100644
612 +--- a/arch/x86/events/amd/ibs.c
613 ++++ b/arch/x86/events/amd/ibs.c
614 +@@ -562,6 +562,7 @@ static struct perf_ibs perf_ibs_op = {
615 + .start = perf_ibs_start,
616 + .stop = perf_ibs_stop,
617 + .read = perf_ibs_read,
618 ++ .capabilities = PERF_PMU_CAP_NO_EXCLUDE,
619 + },
620 + .msr = MSR_AMD64_IBSOPCTL,
621 + .config_mask = IBS_OP_CONFIG_MASK,
622 +diff --git a/arch/x86/kernel/cpu/resctrl/monitor.c b/arch/x86/kernel/cpu/resctrl/monitor.c
623 +index 21eb593e0313e..008bcb15fe96a 100644
624 +--- a/arch/x86/kernel/cpu/resctrl/monitor.c
625 ++++ b/arch/x86/kernel/cpu/resctrl/monitor.c
626 +@@ -242,6 +242,12 @@ static u64 __mon_event_count(u32 rmid, struct rmid_read *rr)
627 + case QOS_L3_MBM_LOCAL_EVENT_ID:
628 + m = &rr->d->mbm_local[rmid];
629 + break;
630 ++ default:
631 ++ /*
632 ++ * Code would never reach here because an invalid
633 ++ * event id would fail the __rmid_read.
634 ++ */
635 ++ return RMID_VAL_ERROR;
636 + }
637 +
638 + if (rr->first) {
639 +diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
640 +index 023bd3e1aa0d2..3041015b05f71 100644
641 +--- a/arch/x86/kvm/vmx/nested.c
642 ++++ b/arch/x86/kvm/vmx/nested.c
643 +@@ -2057,12 +2057,11 @@ static void prepare_vmcs02_early(struct vcpu_vmx *vmx, struct vmcs12 *vmcs12)
644 + ~PIN_BASED_VMX_PREEMPTION_TIMER);
645 +
646 + /* Posted interrupts setting is only taken from vmcs12. */
647 +- if (nested_cpu_has_posted_intr(vmcs12)) {
648 ++ vmx->nested.pi_pending = false;
649 ++ if (nested_cpu_has_posted_intr(vmcs12))
650 + vmx->nested.posted_intr_nv = vmcs12->posted_intr_nv;
651 +- vmx->nested.pi_pending = false;
652 +- } else {
653 ++ else
654 + exec_control &= ~PIN_BASED_POSTED_INTR;
655 +- }
656 + pin_controls_set(vmx, exec_control);
657 +
658 + /*
659 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
660 +index 364e96e508d90..f1a0eebdcf641 100644
661 +--- a/arch/x86/kvm/x86.c
662 ++++ b/arch/x86/kvm/x86.c
663 +@@ -2764,6 +2764,10 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
664 + if (!msr_info->host_initiated) {
665 + s64 adj = data - vcpu->arch.ia32_tsc_adjust_msr;
666 + adjust_tsc_offset_guest(vcpu, adj);
667 ++ /* Before back to guest, tsc_timestamp must be adjusted
668 ++ * as well, otherwise guest's percpu pvclock time could jump.
669 ++ */
670 ++ kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu);
671 + }
672 + vcpu->arch.ia32_tsc_adjust_msr = data;
673 + }
674 +diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
675 +index 6e884f17634fe..55f62dca28aa2 100644
676 +--- a/arch/x86/net/bpf_jit_comp.c
677 ++++ b/arch/x86/net/bpf_jit_comp.c
678 +@@ -728,6 +728,13 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
679 + }
680 + break;
681 +
682 ++ /* speculation barrier */
683 ++ case BPF_ST | BPF_NOSPEC:
684 ++ if (boot_cpu_has(X86_FEATURE_XMM2))
685 ++ /* Emit 'lfence' */
686 ++ EMIT3(0x0F, 0xAE, 0xE8);
687 ++ break;
688 ++
689 + /* ST: *(u8*)(dst_reg + off) = imm */
690 + case BPF_ST | BPF_MEM | BPF_B:
691 + if (is_ereg(dst_reg))
692 +diff --git a/arch/x86/net/bpf_jit_comp32.c b/arch/x86/net/bpf_jit_comp32.c
693 +index 0fcba32077c87..2914f900034e0 100644
694 +--- a/arch/x86/net/bpf_jit_comp32.c
695 ++++ b/arch/x86/net/bpf_jit_comp32.c
696 +@@ -1705,6 +1705,12 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
697 + i++;
698 + break;
699 + }
700 ++ /* speculation barrier */
701 ++ case BPF_ST | BPF_NOSPEC:
702 ++ if (boot_cpu_has(X86_FEATURE_XMM2))
703 ++ /* Emit 'lfence' */
704 ++ EMIT3(0x0F, 0xAE, 0xE8);
705 ++ break;
706 + /* ST: *(u8*)(dst_reg + off) = imm */
707 + case BPF_ST | BPF_MEM | BPF_H:
708 + case BPF_ST | BPF_MEM | BPF_B:
709 +diff --git a/certs/Makefile b/certs/Makefile
710 +index f4b90bad8690a..2baef6fba029e 100644
711 +--- a/certs/Makefile
712 ++++ b/certs/Makefile
713 +@@ -46,11 +46,19 @@ endif
714 + redirect_openssl = 2>&1
715 + quiet_redirect_openssl = 2>&1
716 + silent_redirect_openssl = 2>/dev/null
717 ++openssl_available = $(shell openssl help 2>/dev/null && echo yes)
718 +
719 + # We do it this way rather than having a boolean option for enabling an
720 + # external private key, because 'make randconfig' might enable such a
721 + # boolean option and we unfortunately can't make it depend on !RANDCONFIG.
722 + ifeq ($(CONFIG_MODULE_SIG_KEY),"certs/signing_key.pem")
723 ++
724 ++ifeq ($(openssl_available),yes)
725 ++X509TEXT=$(shell openssl x509 -in "certs/signing_key.pem" -text 2>/dev/null)
726 ++
727 ++$(if $(findstring rsaEncryption,$(X509TEXT)),,$(shell rm -f "certs/signing_key.pem"))
728 ++endif
729 ++
730 + $(obj)/signing_key.pem: $(obj)/x509.genkey
731 + @$(kecho) "###"
732 + @$(kecho) "### Now generating an X.509 key pair to be used for signing modules."
733 +diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
734 +index f67b3fb33d579..7788af0ca1090 100644
735 +--- a/drivers/ata/libata-core.c
736 ++++ b/drivers/ata/libata-core.c
737 +@@ -6394,7 +6394,7 @@ int ata_host_start(struct ata_host *host)
738 + have_stop = 1;
739 + }
740 +
741 +- if (host->ops->host_stop)
742 ++ if (host->ops && host->ops->host_stop)
743 + have_stop = 1;
744 +
745 + if (have_stop) {
746 +diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
747 +index e0893f1b14522..43c0452a8ba91 100644
748 +--- a/drivers/base/regmap/regmap.c
749 ++++ b/drivers/base/regmap/regmap.c
750 +@@ -1505,7 +1505,7 @@ static int _regmap_raw_write_impl(struct regmap *map, unsigned int reg,
751 + if (ret) {
752 + dev_err(map->dev,
753 + "Error in caching of register: %x ret: %d\n",
754 +- reg + i, ret);
755 ++ reg + regmap_get_offset(map, i), ret);
756 + return ret;
757 + }
758 + }
759 +diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
760 +index 6535614a7dc13..1df2b5801c3bc 100644
761 +--- a/drivers/bcma/main.c
762 ++++ b/drivers/bcma/main.c
763 +@@ -236,6 +236,7 @@ EXPORT_SYMBOL(bcma_core_irq);
764 +
765 + void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
766 + {
767 ++ device_initialize(&core->dev);
768 + core->dev.release = bcma_release_core_dev;
769 + core->dev.bus = &bcma_bus_type;
770 + dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
771 +@@ -277,11 +278,10 @@ static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
772 + {
773 + int err;
774 +
775 +- err = device_register(&core->dev);
776 ++ err = device_add(&core->dev);
777 + if (err) {
778 + bcma_err(bus, "Could not register dev for core 0x%03X\n",
779 + core->id.id);
780 +- put_device(&core->dev);
781 + return;
782 + }
783 + core->dev_registered = true;
784 +@@ -372,7 +372,7 @@ void bcma_unregister_cores(struct bcma_bus *bus)
785 + /* Now noone uses internally-handled cores, we can free them */
786 + list_for_each_entry_safe(core, tmp, &bus->cores, list) {
787 + list_del(&core->list);
788 +- kfree(core);
789 ++ put_device(&core->dev);
790 + }
791 + }
792 +
793 +diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
794 +index 25e81b1a59a54..bc3ab98855cf0 100644
795 +--- a/drivers/block/nbd.c
796 ++++ b/drivers/block/nbd.c
797 +@@ -1744,7 +1744,17 @@ static int nbd_dev_add(int index)
798 + refcount_set(&nbd->refs, 1);
799 + INIT_LIST_HEAD(&nbd->list);
800 + disk->major = NBD_MAJOR;
801 ++
802 ++ /* Too big first_minor can cause duplicate creation of
803 ++ * sysfs files/links, since first_minor will be truncated to
804 ++ * byte in __device_add_disk().
805 ++ */
806 + disk->first_minor = index << part_shift;
807 ++ if (disk->first_minor > 0xff) {
808 ++ err = -EINVAL;
809 ++ goto out_free_idr;
810 ++ }
811 ++
812 + disk->fops = &nbd_fops;
813 + disk->private_data = nbd;
814 + sprintf(disk->disk_name, "nbd%d", index);
815 +diff --git a/drivers/clk/mvebu/kirkwood.c b/drivers/clk/mvebu/kirkwood.c
816 +index 47680237d0beb..8bc893df47364 100644
817 +--- a/drivers/clk/mvebu/kirkwood.c
818 ++++ b/drivers/clk/mvebu/kirkwood.c
819 +@@ -265,6 +265,7 @@ static const char *powersave_parents[] = {
820 + static const struct clk_muxing_soc_desc kirkwood_mux_desc[] __initconst = {
821 + { "powersave", powersave_parents, ARRAY_SIZE(powersave_parents),
822 + 11, 1, 0 },
823 ++ { }
824 + };
825 +
826 + static struct clk *clk_muxing_get_src(
827 +diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
828 +index ef773db080e90..a0570213170d8 100644
829 +--- a/drivers/clocksource/sh_cmt.c
830 ++++ b/drivers/clocksource/sh_cmt.c
831 +@@ -568,7 +568,8 @@ static int sh_cmt_start(struct sh_cmt_channel *ch, unsigned long flag)
832 + ch->flags |= flag;
833 +
834 + /* setup timeout if no clockevent */
835 +- if ((flag == FLAG_CLOCKSOURCE) && (!(ch->flags & FLAG_CLOCKEVENT)))
836 ++ if (ch->cmt->num_channels == 1 &&
837 ++ flag == FLAG_CLOCKSOURCE && (!(ch->flags & FLAG_CLOCKEVENT)))
838 + __sh_cmt_set_next(ch, ch->max_match_value);
839 + out:
840 + raw_spin_unlock_irqrestore(&ch->lock, flags);
841 +@@ -604,20 +605,25 @@ static struct sh_cmt_channel *cs_to_sh_cmt(struct clocksource *cs)
842 + static u64 sh_cmt_clocksource_read(struct clocksource *cs)
843 + {
844 + struct sh_cmt_channel *ch = cs_to_sh_cmt(cs);
845 +- unsigned long flags;
846 + u32 has_wrapped;
847 +- u64 value;
848 +- u32 raw;
849 +
850 +- raw_spin_lock_irqsave(&ch->lock, flags);
851 +- value = ch->total_cycles;
852 +- raw = sh_cmt_get_counter(ch, &has_wrapped);
853 ++ if (ch->cmt->num_channels == 1) {
854 ++ unsigned long flags;
855 ++ u64 value;
856 ++ u32 raw;
857 +
858 +- if (unlikely(has_wrapped))
859 +- raw += ch->match_value + 1;
860 +- raw_spin_unlock_irqrestore(&ch->lock, flags);
861 ++ raw_spin_lock_irqsave(&ch->lock, flags);
862 ++ value = ch->total_cycles;
863 ++ raw = sh_cmt_get_counter(ch, &has_wrapped);
864 ++
865 ++ if (unlikely(has_wrapped))
866 ++ raw += ch->match_value + 1;
867 ++ raw_spin_unlock_irqrestore(&ch->lock, flags);
868 ++
869 ++ return value + raw;
870 ++ }
871 +
872 +- return value + raw;
873 ++ return sh_cmt_get_counter(ch, &has_wrapped);
874 + }
875 +
876 + static int sh_cmt_clocksource_enable(struct clocksource *cs)
877 +@@ -680,7 +686,7 @@ static int sh_cmt_register_clocksource(struct sh_cmt_channel *ch,
878 + cs->disable = sh_cmt_clocksource_disable;
879 + cs->suspend = sh_cmt_clocksource_suspend;
880 + cs->resume = sh_cmt_clocksource_resume;
881 +- cs->mask = CLOCKSOURCE_MASK(sizeof(u64) * 8);
882 ++ cs->mask = CLOCKSOURCE_MASK(ch->cmt->info->width);
883 + cs->flags = CLOCK_SOURCE_IS_CONTINUOUS;
884 +
885 + dev_info(&ch->cmt->pdev->dev, "ch%u: used as clock source\n",
886 +diff --git a/drivers/counter/104-quad-8.c b/drivers/counter/104-quad-8.c
887 +index 5c23a9a56921b..f261a57af1c01 100644
888 +--- a/drivers/counter/104-quad-8.c
889 ++++ b/drivers/counter/104-quad-8.c
890 +@@ -1230,12 +1230,13 @@ static ssize_t quad8_count_ceiling_write(struct counter_device *counter,
891 + case 1:
892 + case 3:
893 + quad8_preset_register_set(priv, count->id, ceiling);
894 +- break;
895 ++ mutex_unlock(&priv->lock);
896 ++ return len;
897 + }
898 +
899 + mutex_unlock(&priv->lock);
900 +
901 +- return len;
902 ++ return -EINVAL;
903 + }
904 +
905 + static ssize_t quad8_count_preset_enable_read(struct counter_device *counter,
906 +diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c
907 +index f8a48a84df2ab..66fa524b6261e 100644
908 +--- a/drivers/crypto/mxs-dcp.c
909 ++++ b/drivers/crypto/mxs-dcp.c
910 +@@ -168,15 +168,19 @@ static struct dcp *global_sdcp;
911 +
912 + static int mxs_dcp_start_dma(struct dcp_async_ctx *actx)
913 + {
914 ++ int dma_err;
915 + struct dcp *sdcp = global_sdcp;
916 + const int chan = actx->chan;
917 + uint32_t stat;
918 + unsigned long ret;
919 + struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan];
920 +-
921 + dma_addr_t desc_phys = dma_map_single(sdcp->dev, desc, sizeof(*desc),
922 + DMA_TO_DEVICE);
923 +
924 ++ dma_err = dma_mapping_error(sdcp->dev, desc_phys);
925 ++ if (dma_err)
926 ++ return dma_err;
927 ++
928 + reinit_completion(&sdcp->completion[chan]);
929 +
930 + /* Clear status register. */
931 +@@ -214,18 +218,29 @@ static int mxs_dcp_start_dma(struct dcp_async_ctx *actx)
932 + static int mxs_dcp_run_aes(struct dcp_async_ctx *actx,
933 + struct ablkcipher_request *req, int init)
934 + {
935 ++ dma_addr_t key_phys, src_phys, dst_phys;
936 + struct dcp *sdcp = global_sdcp;
937 + struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan];
938 + struct dcp_aes_req_ctx *rctx = ablkcipher_request_ctx(req);
939 + int ret;
940 +
941 +- dma_addr_t key_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_key,
942 +- 2 * AES_KEYSIZE_128,
943 +- DMA_TO_DEVICE);
944 +- dma_addr_t src_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_in_buf,
945 +- DCP_BUF_SZ, DMA_TO_DEVICE);
946 +- dma_addr_t dst_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_out_buf,
947 +- DCP_BUF_SZ, DMA_FROM_DEVICE);
948 ++ key_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_key,
949 ++ 2 * AES_KEYSIZE_128, DMA_TO_DEVICE);
950 ++ ret = dma_mapping_error(sdcp->dev, key_phys);
951 ++ if (ret)
952 ++ return ret;
953 ++
954 ++ src_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_in_buf,
955 ++ DCP_BUF_SZ, DMA_TO_DEVICE);
956 ++ ret = dma_mapping_error(sdcp->dev, src_phys);
957 ++ if (ret)
958 ++ goto err_src;
959 ++
960 ++ dst_phys = dma_map_single(sdcp->dev, sdcp->coh->aes_out_buf,
961 ++ DCP_BUF_SZ, DMA_FROM_DEVICE);
962 ++ ret = dma_mapping_error(sdcp->dev, dst_phys);
963 ++ if (ret)
964 ++ goto err_dst;
965 +
966 + if (actx->fill % AES_BLOCK_SIZE) {
967 + dev_err(sdcp->dev, "Invalid block size!\n");
968 +@@ -263,10 +278,12 @@ static int mxs_dcp_run_aes(struct dcp_async_ctx *actx,
969 + ret = mxs_dcp_start_dma(actx);
970 +
971 + aes_done_run:
972 ++ dma_unmap_single(sdcp->dev, dst_phys, DCP_BUF_SZ, DMA_FROM_DEVICE);
973 ++err_dst:
974 ++ dma_unmap_single(sdcp->dev, src_phys, DCP_BUF_SZ, DMA_TO_DEVICE);
975 ++err_src:
976 + dma_unmap_single(sdcp->dev, key_phys, 2 * AES_KEYSIZE_128,
977 + DMA_TO_DEVICE);
978 +- dma_unmap_single(sdcp->dev, src_phys, DCP_BUF_SZ, DMA_TO_DEVICE);
979 +- dma_unmap_single(sdcp->dev, dst_phys, DCP_BUF_SZ, DMA_FROM_DEVICE);
980 +
981 + return ret;
982 + }
983 +@@ -565,6 +582,10 @@ static int mxs_dcp_run_sha(struct ahash_request *req)
984 + dma_addr_t buf_phys = dma_map_single(sdcp->dev, sdcp->coh->sha_in_buf,
985 + DCP_BUF_SZ, DMA_TO_DEVICE);
986 +
987 ++ ret = dma_mapping_error(sdcp->dev, buf_phys);
988 ++ if (ret)
989 ++ return ret;
990 ++
991 + /* Fill in the DMA descriptor. */
992 + desc->control0 = MXS_DCP_CONTROL0_DECR_SEMAPHORE |
993 + MXS_DCP_CONTROL0_INTERRUPT |
994 +@@ -597,6 +618,10 @@ static int mxs_dcp_run_sha(struct ahash_request *req)
995 + if (rctx->fini) {
996 + digest_phys = dma_map_single(sdcp->dev, sdcp->coh->sha_out_buf,
997 + DCP_SHA_PAY_SZ, DMA_FROM_DEVICE);
998 ++ ret = dma_mapping_error(sdcp->dev, digest_phys);
999 ++ if (ret)
1000 ++ goto done_run;
1001 ++
1002 + desc->control0 |= MXS_DCP_CONTROL0_HASH_TERM;
1003 + desc->payload = digest_phys;
1004 + }
1005 +diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
1006 +index f80db1eb29945..f8a146554b1f3 100644
1007 +--- a/drivers/crypto/omap-sham.c
1008 ++++ b/drivers/crypto/omap-sham.c
1009 +@@ -1734,7 +1734,7 @@ static void omap_sham_done_task(unsigned long data)
1010 + if (test_and_clear_bit(FLAGS_OUTPUT_READY, &dd->flags))
1011 + goto finish;
1012 + } else if (test_bit(FLAGS_DMA_READY, &dd->flags)) {
1013 +- if (test_and_clear_bit(FLAGS_DMA_ACTIVE, &dd->flags)) {
1014 ++ if (test_bit(FLAGS_DMA_ACTIVE, &dd->flags)) {
1015 + omap_sham_update_dma_stop(dd);
1016 + if (dd->err) {
1017 + err = dd->err;
1018 +diff --git a/drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c b/drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c
1019 +index d2d0ae445fd89..7c7d49a8a4034 100644
1020 +--- a/drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c
1021 ++++ b/drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c
1022 +@@ -123,10 +123,10 @@ void adf_init_hw_data_c3xxxiov(struct adf_hw_device_data *hw_data)
1023 + hw_data->enable_error_correction = adf_vf_void_noop;
1024 + hw_data->init_admin_comms = adf_vf_int_noop;
1025 + hw_data->exit_admin_comms = adf_vf_void_noop;
1026 +- hw_data->send_admin_init = adf_vf2pf_init;
1027 ++ hw_data->send_admin_init = adf_vf2pf_notify_init;
1028 + hw_data->init_arb = adf_vf_int_noop;
1029 + hw_data->exit_arb = adf_vf_void_noop;
1030 +- hw_data->disable_iov = adf_vf2pf_shutdown;
1031 ++ hw_data->disable_iov = adf_vf2pf_notify_shutdown;
1032 + hw_data->get_accel_mask = get_accel_mask;
1033 + hw_data->get_ae_mask = get_ae_mask;
1034 + hw_data->get_num_accels = get_num_accels;
1035 +diff --git a/drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c b/drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c
1036 +index 38e4bc04f407b..90e8a7564756b 100644
1037 +--- a/drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c
1038 ++++ b/drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c
1039 +@@ -123,10 +123,10 @@ void adf_init_hw_data_c62xiov(struct adf_hw_device_data *hw_data)
1040 + hw_data->enable_error_correction = adf_vf_void_noop;
1041 + hw_data->init_admin_comms = adf_vf_int_noop;
1042 + hw_data->exit_admin_comms = adf_vf_void_noop;
1043 +- hw_data->send_admin_init = adf_vf2pf_init;
1044 ++ hw_data->send_admin_init = adf_vf2pf_notify_init;
1045 + hw_data->init_arb = adf_vf_int_noop;
1046 + hw_data->exit_arb = adf_vf_void_noop;
1047 +- hw_data->disable_iov = adf_vf2pf_shutdown;
1048 ++ hw_data->disable_iov = adf_vf2pf_notify_shutdown;
1049 + hw_data->get_accel_mask = get_accel_mask;
1050 + hw_data->get_ae_mask = get_ae_mask;
1051 + hw_data->get_num_accels = get_num_accels;
1052 +diff --git a/drivers/crypto/qat/qat_common/adf_common_drv.h b/drivers/crypto/qat/qat_common/adf_common_drv.h
1053 +index d78f8d5c89c3f..289dd7e48d4a4 100644
1054 +--- a/drivers/crypto/qat/qat_common/adf_common_drv.h
1055 ++++ b/drivers/crypto/qat/qat_common/adf_common_drv.h
1056 +@@ -239,8 +239,8 @@ void adf_enable_vf2pf_interrupts(struct adf_accel_dev *accel_dev,
1057 + void adf_enable_pf2vf_interrupts(struct adf_accel_dev *accel_dev);
1058 + void adf_disable_pf2vf_interrupts(struct adf_accel_dev *accel_dev);
1059 +
1060 +-int adf_vf2pf_init(struct adf_accel_dev *accel_dev);
1061 +-void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev);
1062 ++int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev);
1063 ++void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev);
1064 + int adf_init_pf_wq(void);
1065 + void adf_exit_pf_wq(void);
1066 + int adf_init_vf_wq(void);
1067 +@@ -263,12 +263,12 @@ static inline void adf_disable_pf2vf_interrupts(struct adf_accel_dev *accel_dev)
1068 + {
1069 + }
1070 +
1071 +-static inline int adf_vf2pf_init(struct adf_accel_dev *accel_dev)
1072 ++static inline int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev)
1073 + {
1074 + return 0;
1075 + }
1076 +
1077 +-static inline void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev)
1078 ++static inline void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev)
1079 + {
1080 + }
1081 +
1082 +diff --git a/drivers/crypto/qat/qat_common/adf_init.c b/drivers/crypto/qat/qat_common/adf_init.c
1083 +index 26556c7130497..7a7d43c475342 100644
1084 +--- a/drivers/crypto/qat/qat_common/adf_init.c
1085 ++++ b/drivers/crypto/qat/qat_common/adf_init.c
1086 +@@ -105,6 +105,7 @@ int adf_dev_init(struct adf_accel_dev *accel_dev)
1087 + struct service_hndl *service;
1088 + struct list_head *list_itr;
1089 + struct adf_hw_device_data *hw_data = accel_dev->hw_device;
1090 ++ int ret;
1091 +
1092 + if (!hw_data) {
1093 + dev_err(&GET_DEV(accel_dev),
1094 +@@ -171,9 +172,9 @@ int adf_dev_init(struct adf_accel_dev *accel_dev)
1095 + }
1096 +
1097 + hw_data->enable_error_correction(accel_dev);
1098 +- hw_data->enable_vf2pf_comms(accel_dev);
1099 ++ ret = hw_data->enable_vf2pf_comms(accel_dev);
1100 +
1101 +- return 0;
1102 ++ return ret;
1103 + }
1104 + EXPORT_SYMBOL_GPL(adf_dev_init);
1105 +
1106 +diff --git a/drivers/crypto/qat/qat_common/adf_isr.c b/drivers/crypto/qat/qat_common/adf_isr.c
1107 +index 4898ef41fd9fd..7d319c5c071c4 100644
1108 +--- a/drivers/crypto/qat/qat_common/adf_isr.c
1109 ++++ b/drivers/crypto/qat/qat_common/adf_isr.c
1110 +@@ -59,6 +59,8 @@
1111 + #include "adf_transport_access_macros.h"
1112 + #include "adf_transport_internal.h"
1113 +
1114 ++#define ADF_MAX_NUM_VFS 32
1115 ++
1116 + static int adf_enable_msix(struct adf_accel_dev *accel_dev)
1117 + {
1118 + struct adf_accel_pci *pci_dev_info = &accel_dev->accel_pci_dev;
1119 +@@ -111,7 +113,7 @@ static irqreturn_t adf_msix_isr_ae(int irq, void *dev_ptr)
1120 + struct adf_bar *pmisc =
1121 + &GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)];
1122 + void __iomem *pmisc_bar_addr = pmisc->virt_addr;
1123 +- u32 vf_mask;
1124 ++ unsigned long vf_mask;
1125 +
1126 + /* Get the interrupt sources triggered by VFs */
1127 + vf_mask = ((ADF_CSR_RD(pmisc_bar_addr, ADF_ERRSOU5) &
1128 +@@ -132,8 +134,7 @@ static irqreturn_t adf_msix_isr_ae(int irq, void *dev_ptr)
1129 + * unless the VF is malicious and is attempting to
1130 + * flood the host OS with VF2PF interrupts.
1131 + */
1132 +- for_each_set_bit(i, (const unsigned long *)&vf_mask,
1133 +- (sizeof(vf_mask) * BITS_PER_BYTE)) {
1134 ++ for_each_set_bit(i, &vf_mask, ADF_MAX_NUM_VFS) {
1135 + vf_info = accel_dev->pf.vf_info + i;
1136 +
1137 + if (!__ratelimit(&vf_info->vf2pf_ratelimit)) {
1138 +diff --git a/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c b/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c
1139 +index b3875fdf6cd72..c64481160b711 100644
1140 +--- a/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c
1141 ++++ b/drivers/crypto/qat/qat_common/adf_pf2vf_msg.c
1142 +@@ -231,7 +231,6 @@ int adf_iov_putmsg(struct adf_accel_dev *accel_dev, u32 msg, u8 vf_nr)
1143 +
1144 + return ret;
1145 + }
1146 +-EXPORT_SYMBOL_GPL(adf_iov_putmsg);
1147 +
1148 + void adf_vf2pf_req_hndl(struct adf_accel_vf_info *vf_info)
1149 + {
1150 +@@ -361,6 +360,8 @@ static int adf_vf2pf_request_version(struct adf_accel_dev *accel_dev)
1151 + msg |= ADF_PFVF_COMPATIBILITY_VERSION << ADF_VF2PF_COMPAT_VER_REQ_SHIFT;
1152 + BUILD_BUG_ON(ADF_PFVF_COMPATIBILITY_VERSION > 255);
1153 +
1154 ++ reinit_completion(&accel_dev->vf.iov_msg_completion);
1155 ++
1156 + /* Send request from VF to PF */
1157 + ret = adf_iov_putmsg(accel_dev, msg, 0);
1158 + if (ret) {
1159 +diff --git a/drivers/crypto/qat/qat_common/adf_vf2pf_msg.c b/drivers/crypto/qat/qat_common/adf_vf2pf_msg.c
1160 +index cd5f37dffe8a6..1830194567e84 100644
1161 +--- a/drivers/crypto/qat/qat_common/adf_vf2pf_msg.c
1162 ++++ b/drivers/crypto/qat/qat_common/adf_vf2pf_msg.c
1163 +@@ -49,14 +49,14 @@
1164 + #include "adf_pf2vf_msg.h"
1165 +
1166 + /**
1167 +- * adf_vf2pf_init() - send init msg to PF
1168 ++ * adf_vf2pf_notify_init() - send init msg to PF
1169 + * @accel_dev: Pointer to acceleration VF device.
1170 + *
1171 + * Function sends an init messge from the VF to a PF
1172 + *
1173 + * Return: 0 on success, error code otherwise.
1174 + */
1175 +-int adf_vf2pf_init(struct adf_accel_dev *accel_dev)
1176 ++int adf_vf2pf_notify_init(struct adf_accel_dev *accel_dev)
1177 + {
1178 + u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM |
1179 + (ADF_VF2PF_MSGTYPE_INIT << ADF_VF2PF_MSGTYPE_SHIFT));
1180 +@@ -69,17 +69,17 @@ int adf_vf2pf_init(struct adf_accel_dev *accel_dev)
1181 + set_bit(ADF_STATUS_PF_RUNNING, &accel_dev->status);
1182 + return 0;
1183 + }
1184 +-EXPORT_SYMBOL_GPL(adf_vf2pf_init);
1185 ++EXPORT_SYMBOL_GPL(adf_vf2pf_notify_init);
1186 +
1187 + /**
1188 +- * adf_vf2pf_shutdown() - send shutdown msg to PF
1189 ++ * adf_vf2pf_notify_shutdown() - send shutdown msg to PF
1190 + * @accel_dev: Pointer to acceleration VF device.
1191 + *
1192 + * Function sends a shutdown messge from the VF to a PF
1193 + *
1194 + * Return: void
1195 + */
1196 +-void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev)
1197 ++void adf_vf2pf_notify_shutdown(struct adf_accel_dev *accel_dev)
1198 + {
1199 + u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM |
1200 + (ADF_VF2PF_MSGTYPE_SHUTDOWN << ADF_VF2PF_MSGTYPE_SHIFT));
1201 +@@ -89,4 +89,4 @@ void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev)
1202 + dev_err(&GET_DEV(accel_dev),
1203 + "Failed to send Shutdown event to PF\n");
1204 + }
1205 +-EXPORT_SYMBOL_GPL(adf_vf2pf_shutdown);
1206 ++EXPORT_SYMBOL_GPL(adf_vf2pf_notify_shutdown);
1207 +diff --git a/drivers/crypto/qat/qat_common/adf_vf_isr.c b/drivers/crypto/qat/qat_common/adf_vf_isr.c
1208 +index df9a1f35b8320..ef90902c8200d 100644
1209 +--- a/drivers/crypto/qat/qat_common/adf_vf_isr.c
1210 ++++ b/drivers/crypto/qat/qat_common/adf_vf_isr.c
1211 +@@ -203,6 +203,7 @@ static irqreturn_t adf_isr(int irq, void *privdata)
1212 + struct adf_bar *pmisc =
1213 + &GET_BARS(accel_dev)[hw_data->get_misc_bar_id(hw_data)];
1214 + void __iomem *pmisc_bar_addr = pmisc->virt_addr;
1215 ++ bool handled = false;
1216 + u32 v_int;
1217 +
1218 + /* Read VF INT source CSR to determine the source of VF interrupt */
1219 +@@ -215,7 +216,7 @@ static irqreturn_t adf_isr(int irq, void *privdata)
1220 +
1221 + /* Schedule tasklet to handle interrupt BH */
1222 + tasklet_hi_schedule(&accel_dev->vf.pf2vf_bh_tasklet);
1223 +- return IRQ_HANDLED;
1224 ++ handled = true;
1225 + }
1226 +
1227 + /* Check bundle interrupt */
1228 +@@ -227,10 +228,10 @@ static irqreturn_t adf_isr(int irq, void *privdata)
1229 + WRITE_CSR_INT_FLAG_AND_COL(bank->csr_addr, bank->bank_number,
1230 + 0);
1231 + tasklet_hi_schedule(&bank->resp_handler);
1232 +- return IRQ_HANDLED;
1233 ++ handled = true;
1234 + }
1235 +
1236 +- return IRQ_NONE;
1237 ++ return handled ? IRQ_HANDLED : IRQ_NONE;
1238 + }
1239 +
1240 + static int adf_request_msi_irq(struct adf_accel_dev *accel_dev)
1241 +diff --git a/drivers/crypto/qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c b/drivers/crypto/qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c
1242 +index a3b4dd8099a7b..3a8361c83f0b1 100644
1243 +--- a/drivers/crypto/qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c
1244 ++++ b/drivers/crypto/qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c
1245 +@@ -123,10 +123,10 @@ void adf_init_hw_data_dh895xcciov(struct adf_hw_device_data *hw_data)
1246 + hw_data->enable_error_correction = adf_vf_void_noop;
1247 + hw_data->init_admin_comms = adf_vf_int_noop;
1248 + hw_data->exit_admin_comms = adf_vf_void_noop;
1249 +- hw_data->send_admin_init = adf_vf2pf_init;
1250 ++ hw_data->send_admin_init = adf_vf2pf_notify_init;
1251 + hw_data->init_arb = adf_vf_int_noop;
1252 + hw_data->exit_arb = adf_vf_void_noop;
1253 +- hw_data->disable_iov = adf_vf2pf_shutdown;
1254 ++ hw_data->disable_iov = adf_vf2pf_notify_shutdown;
1255 + hw_data->get_accel_mask = get_accel_mask;
1256 + hw_data->get_ae_mask = get_ae_mask;
1257 + hw_data->get_num_accels = get_num_accels;
1258 +diff --git a/drivers/edac/i10nm_base.c b/drivers/edac/i10nm_base.c
1259 +index f72be5f94e6fa..29576922df78f 100644
1260 +--- a/drivers/edac/i10nm_base.c
1261 ++++ b/drivers/edac/i10nm_base.c
1262 +@@ -26,8 +26,8 @@
1263 + pci_read_config_dword((d)->uracu, 0xd8 + (i) * 4, &(reg))
1264 + #define I10NM_GET_DIMMMTR(m, i, j) \
1265 + readl((m)->mbase + 0x2080c + (i) * 0x4000 + (j) * 4)
1266 +-#define I10NM_GET_MCDDRTCFG(m, i, j) \
1267 +- readl((m)->mbase + 0x20970 + (i) * 0x4000 + (j) * 4)
1268 ++#define I10NM_GET_MCDDRTCFG(m, i) \
1269 ++ readl((m)->mbase + 0x20970 + (i) * 0x4000)
1270 + #define I10NM_GET_MCMTR(m, i) \
1271 + readl((m)->mbase + 0x20ef8 + (i) * 0x4000)
1272 +
1273 +@@ -156,11 +156,11 @@ static int i10nm_get_dimm_config(struct mem_ctl_info *mci)
1274 + continue;
1275 +
1276 + ndimms = 0;
1277 ++ mcddrtcfg = I10NM_GET_MCDDRTCFG(imc, i);
1278 + for (j = 0; j < I10NM_NUM_DIMMS; j++) {
1279 + dimm = EDAC_DIMM_PTR(mci->layers, mci->dimms,
1280 + mci->n_layers, i, j, 0);
1281 + mtr = I10NM_GET_DIMMMTR(imc, i, j);
1282 +- mcddrtcfg = I10NM_GET_MCDDRTCFG(imc, i, j);
1283 + edac_dbg(1, "dimmmtr 0x%x mcddrtcfg 0x%x (mc%d ch%d dimm%d)\n",
1284 + mtr, mcddrtcfg, imc->mc, i, j);
1285 +
1286 +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
1287 +index 82155ac3288a0..64ee44c2fdd1d 100644
1288 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
1289 ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
1290 +@@ -163,17 +163,28 @@ static int acp_poweron(struct generic_pm_domain *genpd)
1291 + return 0;
1292 + }
1293 +
1294 +-static struct device *get_mfd_cell_dev(const char *device_name, int r)
1295 ++static int acp_genpd_add_device(struct device *dev, void *data)
1296 + {
1297 +- char auto_dev_name[25];
1298 +- struct device *dev;
1299 ++ struct generic_pm_domain *gpd = data;
1300 ++ int ret;
1301 +
1302 +- snprintf(auto_dev_name, sizeof(auto_dev_name),
1303 +- "%s.%d.auto", device_name, r);
1304 +- dev = bus_find_device_by_name(&platform_bus_type, NULL, auto_dev_name);
1305 +- dev_info(dev, "device %s added to pm domain\n", auto_dev_name);
1306 ++ ret = pm_genpd_add_device(gpd, dev);
1307 ++ if (ret)
1308 ++ dev_err(dev, "Failed to add dev to genpd %d\n", ret);
1309 +
1310 +- return dev;
1311 ++ return ret;
1312 ++}
1313 ++
1314 ++static int acp_genpd_remove_device(struct device *dev, void *data)
1315 ++{
1316 ++ int ret;
1317 ++
1318 ++ ret = pm_genpd_remove_device(dev);
1319 ++ if (ret)
1320 ++ dev_err(dev, "Failed to remove dev from genpd %d\n", ret);
1321 ++
1322 ++ /* Continue to remove */
1323 ++ return 0;
1324 + }
1325 +
1326 + /**
1327 +@@ -184,11 +195,10 @@ static struct device *get_mfd_cell_dev(const char *device_name, int r)
1328 + */
1329 + static int acp_hw_init(void *handle)
1330 + {
1331 +- int r, i;
1332 ++ int r;
1333 + uint64_t acp_base;
1334 + u32 val = 0;
1335 + u32 count = 0;
1336 +- struct device *dev;
1337 + struct i2s_platform_data *i2s_pdata = NULL;
1338 +
1339 + struct amdgpu_device *adev = (struct amdgpu_device *)handle;
1340 +@@ -344,15 +354,10 @@ static int acp_hw_init(void *handle)
1341 + if (r)
1342 + goto failure;
1343 +
1344 +- for (i = 0; i < ACP_DEVS ; i++) {
1345 +- dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i);
1346 +- r = pm_genpd_add_device(&adev->acp.acp_genpd->gpd, dev);
1347 +- if (r) {
1348 +- dev_err(dev, "Failed to add dev to genpd\n");
1349 +- goto failure;
1350 +- }
1351 +- }
1352 +-
1353 ++ r = device_for_each_child(adev->acp.parent, &adev->acp.acp_genpd->gpd,
1354 ++ acp_genpd_add_device);
1355 ++ if (r)
1356 ++ goto failure;
1357 +
1358 + /* Assert Soft reset of ACP */
1359 + val = cgs_read_register(adev->acp.cgs_device, mmACP_SOFT_RESET);
1360 +@@ -413,10 +418,8 @@ failure:
1361 + */
1362 + static int acp_hw_fini(void *handle)
1363 + {
1364 +- int i, ret;
1365 + u32 val = 0;
1366 + u32 count = 0;
1367 +- struct device *dev;
1368 + struct amdgpu_device *adev = (struct amdgpu_device *)handle;
1369 +
1370 + /* return early if no ACP */
1371 +@@ -461,13 +464,8 @@ static int acp_hw_fini(void *handle)
1372 + udelay(100);
1373 + }
1374 +
1375 +- for (i = 0; i < ACP_DEVS ; i++) {
1376 +- dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i);
1377 +- ret = pm_genpd_remove_device(dev);
1378 +- /* If removal fails, dont giveup and try rest */
1379 +- if (ret)
1380 +- dev_err(dev, "remove dev from genpd failed\n");
1381 +- }
1382 ++ device_for_each_child(adev->acp.parent, NULL,
1383 ++ acp_genpd_remove_device);
1384 +
1385 + mfd_remove_devices(adev->acp.parent);
1386 + kfree(adev->acp.acp_res);
1387 +diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
1388 +index 179e8d52cadb4..a08ca7a47400f 100644
1389 +--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
1390 ++++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
1391 +@@ -281,10 +281,12 @@ static void dpu_hw_ctl_clear_all_blendstages(struct dpu_hw_ctl *ctx)
1392 + int i;
1393 +
1394 + for (i = 0; i < ctx->mixer_count; i++) {
1395 +- DPU_REG_WRITE(c, CTL_LAYER(LM_0 + i), 0);
1396 +- DPU_REG_WRITE(c, CTL_LAYER_EXT(LM_0 + i), 0);
1397 +- DPU_REG_WRITE(c, CTL_LAYER_EXT2(LM_0 + i), 0);
1398 +- DPU_REG_WRITE(c, CTL_LAYER_EXT3(LM_0 + i), 0);
1399 ++ enum dpu_lm mixer_id = ctx->mixer_hw_caps[i].id;
1400 ++
1401 ++ DPU_REG_WRITE(c, CTL_LAYER(mixer_id), 0);
1402 ++ DPU_REG_WRITE(c, CTL_LAYER_EXT(mixer_id), 0);
1403 ++ DPU_REG_WRITE(c, CTL_LAYER_EXT2(mixer_id), 0);
1404 ++ DPU_REG_WRITE(c, CTL_LAYER_EXT3(mixer_id), 0);
1405 + }
1406 + }
1407 +
1408 +diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
1409 +index 55ea4bc2ee9cb..0d37ae5b310c4 100644
1410 +--- a/drivers/gpu/drm/msm/dsi/dsi.c
1411 ++++ b/drivers/gpu/drm/msm/dsi/dsi.c
1412 +@@ -26,8 +26,10 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
1413 + }
1414 +
1415 + phy_pdev = of_find_device_by_node(phy_node);
1416 +- if (phy_pdev)
1417 ++ if (phy_pdev) {
1418 + msm_dsi->phy = platform_get_drvdata(phy_pdev);
1419 ++ msm_dsi->phy_dev = &phy_pdev->dev;
1420 ++ }
1421 +
1422 + of_node_put(phy_node);
1423 +
1424 +@@ -36,8 +38,6 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi)
1425 + return -EPROBE_DEFER;
1426 + }
1427 +
1428 +- msm_dsi->phy_dev = get_device(&phy_pdev->dev);
1429 +-
1430 + return 0;
1431 + }
1432 +
1433 +diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c
1434 +index 238fb6d54df47..413bf314a2bc3 100644
1435 +--- a/drivers/gpu/drm/panfrost/panfrost_device.c
1436 ++++ b/drivers/gpu/drm/panfrost/panfrost_device.c
1437 +@@ -59,7 +59,8 @@ static int panfrost_clk_init(struct panfrost_device *pfdev)
1438 + if (IS_ERR(pfdev->bus_clock)) {
1439 + dev_err(pfdev->dev, "get bus_clock failed %ld\n",
1440 + PTR_ERR(pfdev->bus_clock));
1441 +- return PTR_ERR(pfdev->bus_clock);
1442 ++ err = PTR_ERR(pfdev->bus_clock);
1443 ++ goto disable_clock;
1444 + }
1445 +
1446 + if (pfdev->bus_clock) {
1447 +diff --git a/drivers/i2c/busses/i2c-highlander.c b/drivers/i2c/busses/i2c-highlander.c
1448 +index ff340d7ae2e52..6a880c2623808 100644
1449 +--- a/drivers/i2c/busses/i2c-highlander.c
1450 ++++ b/drivers/i2c/busses/i2c-highlander.c
1451 +@@ -379,7 +379,7 @@ static int highlander_i2c_probe(struct platform_device *pdev)
1452 + platform_set_drvdata(pdev, dev);
1453 +
1454 + dev->irq = platform_get_irq(pdev, 0);
1455 +- if (iic_force_poll)
1456 ++ if (dev->irq < 0 || iic_force_poll)
1457 + dev->irq = 0;
1458 +
1459 + if (dev->irq) {
1460 +diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
1461 +index 2f8b8050a2233..899624721c1ea 100644
1462 +--- a/drivers/i2c/busses/i2c-iop3xx.c
1463 ++++ b/drivers/i2c/busses/i2c-iop3xx.c
1464 +@@ -467,16 +467,14 @@ iop3xx_i2c_probe(struct platform_device *pdev)
1465 +
1466 + irq = platform_get_irq(pdev, 0);
1467 + if (irq < 0) {
1468 +- ret = -ENXIO;
1469 ++ ret = irq;
1470 + goto unmap;
1471 + }
1472 + ret = request_irq(irq, iop3xx_i2c_irq_handler, 0,
1473 + pdev->name, adapter_data);
1474 +
1475 +- if (ret) {
1476 +- ret = -EIO;
1477 ++ if (ret)
1478 + goto unmap;
1479 +- }
1480 +
1481 + memcpy(new_adapter->name, pdev->name, strlen(pdev->name));
1482 + new_adapter->owner = THIS_MODULE;
1483 +diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
1484 +index e1ef0122ef759..5587e7c549c4f 100644
1485 +--- a/drivers/i2c/busses/i2c-mt65xx.c
1486 ++++ b/drivers/i2c/busses/i2c-mt65xx.c
1487 +@@ -932,7 +932,7 @@ static int mtk_i2c_probe(struct platform_device *pdev)
1488 + return PTR_ERR(i2c->pdmabase);
1489 +
1490 + irq = platform_get_irq(pdev, 0);
1491 +- if (irq <= 0)
1492 ++ if (irq < 0)
1493 + return irq;
1494 +
1495 + init_completion(&i2c->msg_complete);
1496 +diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
1497 +index d6322698b2458..e6f927c6f8af9 100644
1498 +--- a/drivers/i2c/busses/i2c-s3c2410.c
1499 ++++ b/drivers/i2c/busses/i2c-s3c2410.c
1500 +@@ -1141,7 +1141,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
1501 + */
1502 + if (!(i2c->quirks & QUIRK_POLL)) {
1503 + i2c->irq = ret = platform_get_irq(pdev, 0);
1504 +- if (ret <= 0) {
1505 ++ if (ret < 0) {
1506 + dev_err(&pdev->dev, "cannot find IRQ\n");
1507 + clk_unprepare(i2c->clk);
1508 + return ret;
1509 +diff --git a/drivers/leds/leds-lt3593.c b/drivers/leds/leds-lt3593.c
1510 +index c94995f0daa2a..03ae33093ce63 100644
1511 +--- a/drivers/leds/leds-lt3593.c
1512 ++++ b/drivers/leds/leds-lt3593.c
1513 +@@ -103,10 +103,9 @@ static int lt3593_led_probe(struct platform_device *pdev)
1514 + init_data.default_label = ":";
1515 +
1516 + ret = devm_led_classdev_register_ext(dev, &led_data->cdev, &init_data);
1517 +- if (ret < 0) {
1518 +- fwnode_handle_put(child);
1519 ++ fwnode_handle_put(child);
1520 ++ if (ret < 0)
1521 + return ret;
1522 +- }
1523 +
1524 + led_data->cdev.dev->of_node = dev->of_node;
1525 + platform_set_drvdata(pdev, led_data);
1526 +diff --git a/drivers/leds/trigger/ledtrig-audio.c b/drivers/leds/trigger/ledtrig-audio.c
1527 +index f76621e88482d..c6b437e6369b8 100644
1528 +--- a/drivers/leds/trigger/ledtrig-audio.c
1529 ++++ b/drivers/leds/trigger/ledtrig-audio.c
1530 +@@ -6,10 +6,33 @@
1531 + #include <linux/kernel.h>
1532 + #include <linux/leds.h>
1533 + #include <linux/module.h>
1534 ++#include "../leds.h"
1535 +
1536 +-static struct led_trigger *ledtrig_audio[NUM_AUDIO_LEDS];
1537 + static enum led_brightness audio_state[NUM_AUDIO_LEDS];
1538 +
1539 ++static int ledtrig_audio_mute_activate(struct led_classdev *led_cdev)
1540 ++{
1541 ++ led_set_brightness_nosleep(led_cdev, audio_state[LED_AUDIO_MUTE]);
1542 ++ return 0;
1543 ++}
1544 ++
1545 ++static int ledtrig_audio_micmute_activate(struct led_classdev *led_cdev)
1546 ++{
1547 ++ led_set_brightness_nosleep(led_cdev, audio_state[LED_AUDIO_MICMUTE]);
1548 ++ return 0;
1549 ++}
1550 ++
1551 ++static struct led_trigger ledtrig_audio[NUM_AUDIO_LEDS] = {
1552 ++ [LED_AUDIO_MUTE] = {
1553 ++ .name = "audio-mute",
1554 ++ .activate = ledtrig_audio_mute_activate,
1555 ++ },
1556 ++ [LED_AUDIO_MICMUTE] = {
1557 ++ .name = "audio-micmute",
1558 ++ .activate = ledtrig_audio_micmute_activate,
1559 ++ },
1560 ++};
1561 ++
1562 + enum led_brightness ledtrig_audio_get(enum led_audio type)
1563 + {
1564 + return audio_state[type];
1565 +@@ -19,24 +42,22 @@ EXPORT_SYMBOL_GPL(ledtrig_audio_get);
1566 + void ledtrig_audio_set(enum led_audio type, enum led_brightness state)
1567 + {
1568 + audio_state[type] = state;
1569 +- led_trigger_event(ledtrig_audio[type], state);
1570 ++ led_trigger_event(&ledtrig_audio[type], state);
1571 + }
1572 + EXPORT_SYMBOL_GPL(ledtrig_audio_set);
1573 +
1574 + static int __init ledtrig_audio_init(void)
1575 + {
1576 +- led_trigger_register_simple("audio-mute",
1577 +- &ledtrig_audio[LED_AUDIO_MUTE]);
1578 +- led_trigger_register_simple("audio-micmute",
1579 +- &ledtrig_audio[LED_AUDIO_MICMUTE]);
1580 ++ led_trigger_register(&ledtrig_audio[LED_AUDIO_MUTE]);
1581 ++ led_trigger_register(&ledtrig_audio[LED_AUDIO_MICMUTE]);
1582 + return 0;
1583 + }
1584 + module_init(ledtrig_audio_init);
1585 +
1586 + static void __exit ledtrig_audio_exit(void)
1587 + {
1588 +- led_trigger_unregister_simple(ledtrig_audio[LED_AUDIO_MUTE]);
1589 +- led_trigger_unregister_simple(ledtrig_audio[LED_AUDIO_MICMUTE]);
1590 ++ led_trigger_unregister(&ledtrig_audio[LED_AUDIO_MUTE]);
1591 ++ led_trigger_unregister(&ledtrig_audio[LED_AUDIO_MICMUTE]);
1592 + }
1593 + module_exit(ledtrig_audio_exit);
1594 +
1595 +diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
1596 +index b0d569032dd4e..efdf6ce0443ea 100644
1597 +--- a/drivers/md/bcache/super.c
1598 ++++ b/drivers/md/bcache/super.c
1599 +@@ -839,20 +839,20 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size,
1600 + n = BITS_TO_LONGS(d->nr_stripes) * sizeof(unsigned long);
1601 + d->full_dirty_stripes = kvzalloc(n, GFP_KERNEL);
1602 + if (!d->full_dirty_stripes)
1603 +- return -ENOMEM;
1604 ++ goto out_free_stripe_sectors_dirty;
1605 +
1606 + idx = ida_simple_get(&bcache_device_idx, 0,
1607 + BCACHE_DEVICE_IDX_MAX, GFP_KERNEL);
1608 + if (idx < 0)
1609 +- return idx;
1610 ++ goto out_free_full_dirty_stripes;
1611 +
1612 + if (bioset_init(&d->bio_split, 4, offsetof(struct bbio, bio),
1613 + BIOSET_NEED_BVECS|BIOSET_NEED_RESCUER))
1614 +- goto err;
1615 ++ goto out_ida_remove;
1616 +
1617 + d->disk = alloc_disk(BCACHE_MINORS);
1618 + if (!d->disk)
1619 +- goto err;
1620 ++ goto out_bioset_exit;
1621 +
1622 + set_capacity(d->disk, sectors);
1623 + snprintf(d->disk->disk_name, DISK_NAME_LEN, "bcache%i", idx);
1624 +@@ -887,8 +887,14 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size,
1625 +
1626 + return 0;
1627 +
1628 +-err:
1629 ++out_bioset_exit:
1630 ++ bioset_exit(&d->bio_split);
1631 ++out_ida_remove:
1632 + ida_simple_remove(&bcache_device_idx, idx);
1633 ++out_free_full_dirty_stripes:
1634 ++ kvfree(d->full_dirty_stripes);
1635 ++out_free_stripe_sectors_dirty:
1636 ++ kvfree(d->stripe_sectors_dirty);
1637 + return -ENOMEM;
1638 +
1639 + }
1640 +diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
1641 +index e43d8327b8103..1088161498df0 100644
1642 +--- a/drivers/media/i2c/tda1997x.c
1643 ++++ b/drivers/media/i2c/tda1997x.c
1644 +@@ -2233,6 +2233,7 @@ static int tda1997x_core_init(struct v4l2_subdev *sd)
1645 + /* get initial HDMI status */
1646 + state->hdmi_status = io_read(sd, REG_HDMI_FLAGS);
1647 +
1648 ++ io_write(sd, REG_EDID_ENABLE, EDID_ENABLE_A_EN | EDID_ENABLE_B_EN);
1649 + return 0;
1650 + }
1651 +
1652 +diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
1653 +index 00c7bed3dd572..e6b68be09f8f0 100644
1654 +--- a/drivers/media/platform/coda/coda-bit.c
1655 ++++ b/drivers/media/platform/coda/coda-bit.c
1656 +@@ -2023,17 +2023,25 @@ static int __coda_start_decoding(struct coda_ctx *ctx)
1657 + u32 src_fourcc, dst_fourcc;
1658 + int ret;
1659 +
1660 ++ q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
1661 ++ q_data_dst = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
1662 ++ src_fourcc = q_data_src->fourcc;
1663 ++ dst_fourcc = q_data_dst->fourcc;
1664 ++
1665 + if (!ctx->initialized) {
1666 + ret = __coda_decoder_seq_init(ctx);
1667 + if (ret < 0)
1668 + return ret;
1669 ++ } else {
1670 ++ ctx->frame_mem_ctrl &= ~(CODA_FRAME_CHROMA_INTERLEAVE | (0x3 << 9) |
1671 ++ CODA9_FRAME_TILED2LINEAR);
1672 ++ if (dst_fourcc == V4L2_PIX_FMT_NV12 || dst_fourcc == V4L2_PIX_FMT_YUYV)
1673 ++ ctx->frame_mem_ctrl |= CODA_FRAME_CHROMA_INTERLEAVE;
1674 ++ if (ctx->tiled_map_type == GDI_TILED_FRAME_MB_RASTER_MAP)
1675 ++ ctx->frame_mem_ctrl |= (0x3 << 9) |
1676 ++ ((ctx->use_vdoa) ? 0 : CODA9_FRAME_TILED2LINEAR);
1677 + }
1678 +
1679 +- q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
1680 +- q_data_dst = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
1681 +- src_fourcc = q_data_src->fourcc;
1682 +- dst_fourcc = q_data_dst->fourcc;
1683 +-
1684 + coda_write(dev, ctx->parabuf.paddr, CODA_REG_BIT_PARA_BUF_ADDR);
1685 +
1686 + ret = coda_alloc_framebuffers(ctx, q_data_dst, src_fourcc);
1687 +diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
1688 +index 30028ceb548b1..766ca497f8565 100644
1689 +--- a/drivers/media/platform/qcom/venus/venc.c
1690 ++++ b/drivers/media/platform/qcom/venus/venc.c
1691 +@@ -308,6 +308,8 @@ venc_try_fmt_common(struct venus_inst *inst, struct v4l2_format *f)
1692 + else
1693 + return NULL;
1694 + fmt = find_format(inst, pixmp->pixelformat, f->type);
1695 ++ if (!fmt)
1696 ++ return NULL;
1697 + }
1698 +
1699 + pixmp->width = clamp(pixmp->width, frame_width_min(inst),
1700 +diff --git a/drivers/media/spi/cxd2880-spi.c b/drivers/media/spi/cxd2880-spi.c
1701 +index 4077217777f92..93194f03764d2 100644
1702 +--- a/drivers/media/spi/cxd2880-spi.c
1703 ++++ b/drivers/media/spi/cxd2880-spi.c
1704 +@@ -524,13 +524,13 @@ cxd2880_spi_probe(struct spi_device *spi)
1705 + if (IS_ERR(dvb_spi->vcc_supply)) {
1706 + if (PTR_ERR(dvb_spi->vcc_supply) == -EPROBE_DEFER) {
1707 + ret = -EPROBE_DEFER;
1708 +- goto fail_adapter;
1709 ++ goto fail_regulator;
1710 + }
1711 + dvb_spi->vcc_supply = NULL;
1712 + } else {
1713 + ret = regulator_enable(dvb_spi->vcc_supply);
1714 + if (ret)
1715 +- goto fail_adapter;
1716 ++ goto fail_regulator;
1717 + }
1718 +
1719 + dvb_spi->spi = spi;
1720 +@@ -618,6 +618,9 @@ fail_frontend:
1721 + fail_attach:
1722 + dvb_unregister_adapter(&dvb_spi->adapter);
1723 + fail_adapter:
1724 ++ if (!dvb_spi->vcc_supply)
1725 ++ regulator_disable(dvb_spi->vcc_supply);
1726 ++fail_regulator:
1727 + kfree(dvb_spi);
1728 + return ret;
1729 + }
1730 +diff --git a/drivers/media/usb/dvb-usb/dvb-usb-i2c.c b/drivers/media/usb/dvb-usb/dvb-usb-i2c.c
1731 +index 2e07106f46803..bc4b2abdde1a4 100644
1732 +--- a/drivers/media/usb/dvb-usb/dvb-usb-i2c.c
1733 ++++ b/drivers/media/usb/dvb-usb/dvb-usb-i2c.c
1734 +@@ -17,7 +17,8 @@ int dvb_usb_i2c_init(struct dvb_usb_device *d)
1735 +
1736 + if (d->props.i2c_algo == NULL) {
1737 + err("no i2c algorithm specified");
1738 +- return -EINVAL;
1739 ++ ret = -EINVAL;
1740 ++ goto err;
1741 + }
1742 +
1743 + strscpy(d->i2c_adap.name, d->desc->name, sizeof(d->i2c_adap.name));
1744 +@@ -27,11 +28,15 @@ int dvb_usb_i2c_init(struct dvb_usb_device *d)
1745 +
1746 + i2c_set_adapdata(&d->i2c_adap, d);
1747 +
1748 +- if ((ret = i2c_add_adapter(&d->i2c_adap)) < 0)
1749 ++ ret = i2c_add_adapter(&d->i2c_adap);
1750 ++ if (ret < 0) {
1751 + err("could not add i2c adapter");
1752 ++ goto err;
1753 ++ }
1754 +
1755 + d->state |= DVB_USB_STATE_I2C;
1756 +
1757 ++err:
1758 + return ret;
1759 + }
1760 +
1761 +diff --git a/drivers/media/usb/dvb-usb/dvb-usb-init.c b/drivers/media/usb/dvb-usb/dvb-usb-init.c
1762 +index f57c4627624f5..e7720ff11d3d9 100644
1763 +--- a/drivers/media/usb/dvb-usb/dvb-usb-init.c
1764 ++++ b/drivers/media/usb/dvb-usb/dvb-usb-init.c
1765 +@@ -194,8 +194,8 @@ static int dvb_usb_init(struct dvb_usb_device *d, short *adapter_nums)
1766 +
1767 + err_adapter_init:
1768 + dvb_usb_adapter_exit(d);
1769 +-err_i2c_init:
1770 + dvb_usb_i2c_exit(d);
1771 ++err_i2c_init:
1772 + if (d->priv && d->props.priv_destroy)
1773 + d->props.priv_destroy(d);
1774 + err_priv_init:
1775 +diff --git a/drivers/media/usb/dvb-usb/nova-t-usb2.c b/drivers/media/usb/dvb-usb/nova-t-usb2.c
1776 +index e368935a50894..c16d4f1624952 100644
1777 +--- a/drivers/media/usb/dvb-usb/nova-t-usb2.c
1778 ++++ b/drivers/media/usb/dvb-usb/nova-t-usb2.c
1779 +@@ -130,7 +130,7 @@ ret:
1780 +
1781 + static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6])
1782 + {
1783 +- int i;
1784 ++ int i, ret;
1785 + u8 b;
1786 +
1787 + mac[0] = 0x00;
1788 +@@ -139,7 +139,9 @@ static int nova_t_read_mac_address (struct dvb_usb_device *d, u8 mac[6])
1789 +
1790 + /* this is a complete guess, but works for my box */
1791 + for (i = 136; i < 139; i++) {
1792 +- dibusb_read_eeprom_byte(d,i, &b);
1793 ++ ret = dibusb_read_eeprom_byte(d, i, &b);
1794 ++ if (ret)
1795 ++ return ret;
1796 +
1797 + mac[5 - (i - 136)] = b;
1798 + }
1799 +diff --git a/drivers/media/usb/dvb-usb/vp702x.c b/drivers/media/usb/dvb-usb/vp702x.c
1800 +index 381b5c898a076..b7ee972455e5b 100644
1801 +--- a/drivers/media/usb/dvb-usb/vp702x.c
1802 ++++ b/drivers/media/usb/dvb-usb/vp702x.c
1803 +@@ -291,16 +291,22 @@ static int vp702x_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
1804 + static int vp702x_read_mac_addr(struct dvb_usb_device *d,u8 mac[6])
1805 + {
1806 + u8 i, *buf;
1807 ++ int ret;
1808 + struct vp702x_device_state *st = d->priv;
1809 +
1810 + mutex_lock(&st->buf_mutex);
1811 + buf = st->buf;
1812 +- for (i = 6; i < 12; i++)
1813 +- vp702x_usb_in_op(d, READ_EEPROM_REQ, i, 1, &buf[i - 6], 1);
1814 ++ for (i = 6; i < 12; i++) {
1815 ++ ret = vp702x_usb_in_op(d, READ_EEPROM_REQ, i, 1,
1816 ++ &buf[i - 6], 1);
1817 ++ if (ret < 0)
1818 ++ goto err;
1819 ++ }
1820 +
1821 + memcpy(mac, buf, 6);
1822 ++err:
1823 + mutex_unlock(&st->buf_mutex);
1824 +- return 0;
1825 ++ return ret;
1826 + }
1827 +
1828 + static int vp702x_frontend_attach(struct dvb_usb_adapter *adap)
1829 +diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
1830 +index 59529cbf9cd0b..0b6d77c3bec86 100644
1831 +--- a/drivers/media/usb/em28xx/em28xx-input.c
1832 ++++ b/drivers/media/usb/em28xx/em28xx-input.c
1833 +@@ -842,7 +842,6 @@ error:
1834 + kfree(ir);
1835 + ref_put:
1836 + em28xx_shutdown_buttons(dev);
1837 +- kref_put(&dev->ref, em28xx_free_device);
1838 + return err;
1839 + }
1840 +
1841 +diff --git a/drivers/media/usb/go7007/go7007-driver.c b/drivers/media/usb/go7007/go7007-driver.c
1842 +index 153a0c3e3da64..b9302d77d6c83 100644
1843 +--- a/drivers/media/usb/go7007/go7007-driver.c
1844 ++++ b/drivers/media/usb/go7007/go7007-driver.c
1845 +@@ -691,49 +691,23 @@ struct go7007 *go7007_alloc(const struct go7007_board_info *board,
1846 + struct device *dev)
1847 + {
1848 + struct go7007 *go;
1849 +- int i;
1850 +
1851 + go = kzalloc(sizeof(struct go7007), GFP_KERNEL);
1852 + if (go == NULL)
1853 + return NULL;
1854 + go->dev = dev;
1855 + go->board_info = board;
1856 +- go->board_id = 0;
1857 + go->tuner_type = -1;
1858 +- go->channel_number = 0;
1859 +- go->name[0] = 0;
1860 + mutex_init(&go->hw_lock);
1861 + init_waitqueue_head(&go->frame_waitq);
1862 + spin_lock_init(&go->spinlock);
1863 + go->status = STATUS_INIT;
1864 +- memset(&go->i2c_adapter, 0, sizeof(go->i2c_adapter));
1865 +- go->i2c_adapter_online = 0;
1866 +- go->interrupt_available = 0;
1867 + init_waitqueue_head(&go->interrupt_waitq);
1868 +- go->input = 0;
1869 + go7007_update_board(go);
1870 +- go->encoder_h_halve = 0;
1871 +- go->encoder_v_halve = 0;
1872 +- go->encoder_subsample = 0;
1873 + go->format = V4L2_PIX_FMT_MJPEG;
1874 + go->bitrate = 1500000;
1875 + go->fps_scale = 1;
1876 +- go->pali = 0;
1877 + go->aspect_ratio = GO7007_RATIO_1_1;
1878 +- go->gop_size = 0;
1879 +- go->ipb = 0;
1880 +- go->closed_gop = 0;
1881 +- go->repeat_seqhead = 0;
1882 +- go->seq_header_enable = 0;
1883 +- go->gop_header_enable = 0;
1884 +- go->dvd_mode = 0;
1885 +- go->interlace_coding = 0;
1886 +- for (i = 0; i < 4; ++i)
1887 +- go->modet[i].enable = 0;
1888 +- for (i = 0; i < 1624; ++i)
1889 +- go->modet_map[i] = 0;
1890 +- go->audio_deliver = NULL;
1891 +- go->audio_enabled = 0;
1892 +
1893 + return go;
1894 + }
1895 +diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
1896 +index 6ace82028667b..7b280cb363271 100644
1897 +--- a/drivers/mmc/host/dw_mmc.c
1898 ++++ b/drivers/mmc/host/dw_mmc.c
1899 +@@ -782,6 +782,7 @@ static int dw_mci_edmac_start_dma(struct dw_mci *host,
1900 + int ret = 0;
1901 +
1902 + /* Set external dma config: burst size, burst width */
1903 ++ memset(&cfg, 0, sizeof(cfg));
1904 + cfg.dst_addr = host->phy_regs + fifo_offset;
1905 + cfg.src_addr = cfg.dst_addr;
1906 + cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
1907 +diff --git a/drivers/mmc/host/moxart-mmc.c b/drivers/mmc/host/moxart-mmc.c
1908 +index a0670e9cd0127..5553a5643f405 100644
1909 +--- a/drivers/mmc/host/moxart-mmc.c
1910 ++++ b/drivers/mmc/host/moxart-mmc.c
1911 +@@ -631,6 +631,7 @@ static int moxart_probe(struct platform_device *pdev)
1912 + host->dma_chan_tx, host->dma_chan_rx);
1913 + host->have_dma = true;
1914 +
1915 ++ memset(&cfg, 0, sizeof(cfg));
1916 + cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
1917 + cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
1918 +
1919 +diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
1920 +index d82a519a0cd9a..f9f246c82c974 100644
1921 +--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
1922 ++++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
1923 +@@ -2013,10 +2013,11 @@ int rvu_mbox_handler_npc_mcam_unmap_counter(struct rvu *rvu,
1924 + index = find_next_bit(mcam->bmap, mcam->bmap_entries, entry);
1925 + if (index >= mcam->bmap_entries)
1926 + break;
1927 ++ entry = index + 1;
1928 ++
1929 + if (mcam->entry2cntr_map[index] != req->cntr)
1930 + continue;
1931 +
1932 +- entry = index + 1;
1933 + npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr,
1934 + index, req->cntr);
1935 + }
1936 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
1937 +index d48292ccda294..9239d767443f2 100644
1938 +--- a/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
1939 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en/fs.h
1940 +@@ -234,18 +234,12 @@ struct ttc_params {
1941 +
1942 + void mlx5e_set_ttc_basic_params(struct mlx5e_priv *priv, struct ttc_params *ttc_params);
1943 + void mlx5e_set_ttc_ft_params(struct ttc_params *ttc_params);
1944 +-void mlx5e_set_inner_ttc_ft_params(struct ttc_params *ttc_params);
1945 +
1946 + int mlx5e_create_ttc_table(struct mlx5e_priv *priv, struct ttc_params *params,
1947 + struct mlx5e_ttc_table *ttc);
1948 + void mlx5e_destroy_ttc_table(struct mlx5e_priv *priv,
1949 + struct mlx5e_ttc_table *ttc);
1950 +
1951 +-int mlx5e_create_inner_ttc_table(struct mlx5e_priv *priv, struct ttc_params *params,
1952 +- struct mlx5e_ttc_table *ttc);
1953 +-void mlx5e_destroy_inner_ttc_table(struct mlx5e_priv *priv,
1954 +- struct mlx5e_ttc_table *ttc);
1955 +-
1956 + void mlx5e_destroy_flow_table(struct mlx5e_flow_table *ft);
1957 +
1958 + void mlx5e_enable_cvlan_filter(struct mlx5e_priv *priv);
1959 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
1960 +index c4ac7a9968d16..c3b9278486a1e 100644
1961 +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
1962 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
1963 +@@ -1123,7 +1123,7 @@ void mlx5e_set_ttc_basic_params(struct mlx5e_priv *priv,
1964 + ttc_params->inner_ttc = &priv->fs.inner_ttc;
1965 + }
1966 +
1967 +-void mlx5e_set_inner_ttc_ft_params(struct ttc_params *ttc_params)
1968 ++static void mlx5e_set_inner_ttc_ft_params(struct ttc_params *ttc_params)
1969 + {
1970 + struct mlx5_flow_table_attr *ft_attr = &ttc_params->ft_attr;
1971 +
1972 +@@ -1142,8 +1142,8 @@ void mlx5e_set_ttc_ft_params(struct ttc_params *ttc_params)
1973 + ft_attr->prio = MLX5E_NIC_PRIO;
1974 + }
1975 +
1976 +-int mlx5e_create_inner_ttc_table(struct mlx5e_priv *priv, struct ttc_params *params,
1977 +- struct mlx5e_ttc_table *ttc)
1978 ++static int mlx5e_create_inner_ttc_table(struct mlx5e_priv *priv, struct ttc_params *params,
1979 ++ struct mlx5e_ttc_table *ttc)
1980 + {
1981 + struct mlx5e_flow_table *ft = &ttc->ft;
1982 + int err;
1983 +@@ -1173,8 +1173,8 @@ err:
1984 + return err;
1985 + }
1986 +
1987 +-void mlx5e_destroy_inner_ttc_table(struct mlx5e_priv *priv,
1988 +- struct mlx5e_ttc_table *ttc)
1989 ++static void mlx5e_destroy_inner_ttc_table(struct mlx5e_priv *priv,
1990 ++ struct mlx5e_ttc_table *ttc)
1991 + {
1992 + if (!mlx5e_tunnel_inner_ft_supported(priv->mdev))
1993 + return;
1994 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
1995 +index 0fed2419623d1..1f3d12faa2a5b 100644
1996 +--- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
1997 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
1998 +@@ -319,17 +319,6 @@ static int mlx5i_create_flow_steering(struct mlx5e_priv *priv)
1999 + }
2000 +
2001 + mlx5e_set_ttc_basic_params(priv, &ttc_params);
2002 +- mlx5e_set_inner_ttc_ft_params(&ttc_params);
2003 +- for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++)
2004 +- ttc_params.indir_tirn[tt] = priv->inner_indir_tir[tt].tirn;
2005 +-
2006 +- err = mlx5e_create_inner_ttc_table(priv, &ttc_params, &priv->fs.inner_ttc);
2007 +- if (err) {
2008 +- netdev_err(priv->netdev, "Failed to create inner ttc table, err=%d\n",
2009 +- err);
2010 +- goto err_destroy_arfs_tables;
2011 +- }
2012 +-
2013 + mlx5e_set_ttc_ft_params(&ttc_params);
2014 + for (tt = 0; tt < MLX5E_NUM_INDIR_TIRS; tt++)
2015 + ttc_params.indir_tirn[tt] = priv->indir_tir[tt].tirn;
2016 +@@ -338,13 +327,11 @@ static int mlx5i_create_flow_steering(struct mlx5e_priv *priv)
2017 + if (err) {
2018 + netdev_err(priv->netdev, "Failed to create ttc table, err=%d\n",
2019 + err);
2020 +- goto err_destroy_inner_ttc_table;
2021 ++ goto err_destroy_arfs_tables;
2022 + }
2023 +
2024 + return 0;
2025 +
2026 +-err_destroy_inner_ttc_table:
2027 +- mlx5e_destroy_inner_ttc_table(priv, &priv->fs.inner_ttc);
2028 + err_destroy_arfs_tables:
2029 + mlx5e_arfs_destroy_tables(priv);
2030 +
2031 +@@ -354,7 +341,6 @@ err_destroy_arfs_tables:
2032 + static void mlx5i_destroy_flow_steering(struct mlx5e_priv *priv)
2033 + {
2034 + mlx5e_destroy_ttc_table(priv, &priv->fs.ttc);
2035 +- mlx5e_destroy_inner_ttc_table(priv, &priv->fs.inner_ttc);
2036 + mlx5e_arfs_destroy_tables(priv);
2037 + }
2038 +
2039 +@@ -379,7 +365,7 @@ static int mlx5i_init_rx(struct mlx5e_priv *priv)
2040 + if (err)
2041 + goto err_destroy_indirect_rqts;
2042 +
2043 +- err = mlx5e_create_indirect_tirs(priv, true);
2044 ++ err = mlx5e_create_indirect_tirs(priv, false);
2045 + if (err)
2046 + goto err_destroy_direct_rqts;
2047 +
2048 +diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
2049 +index baac016f3ec0b..15591ad5fe4ea 100644
2050 +--- a/drivers/net/ethernet/qualcomm/qca_spi.c
2051 ++++ b/drivers/net/ethernet/qualcomm/qca_spi.c
2052 +@@ -434,7 +434,7 @@ qcaspi_receive(struct qcaspi *qca)
2053 + skb_put(qca->rx_skb, retcode);
2054 + qca->rx_skb->protocol = eth_type_trans(
2055 + qca->rx_skb, qca->rx_skb->dev);
2056 +- qca->rx_skb->ip_summed = CHECKSUM_UNNECESSARY;
2057 ++ skb_checksum_none_assert(qca->rx_skb);
2058 + netif_rx_ni(qca->rx_skb);
2059 + qca->rx_skb = netdev_alloc_skb_ip_align(net_dev,
2060 + net_dev->mtu + VLAN_ETH_HLEN);
2061 +diff --git a/drivers/net/ethernet/qualcomm/qca_uart.c b/drivers/net/ethernet/qualcomm/qca_uart.c
2062 +index 0981068504fa7..ade70f5df496c 100644
2063 +--- a/drivers/net/ethernet/qualcomm/qca_uart.c
2064 ++++ b/drivers/net/ethernet/qualcomm/qca_uart.c
2065 +@@ -107,7 +107,7 @@ qca_tty_receive(struct serdev_device *serdev, const unsigned char *data,
2066 + skb_put(qca->rx_skb, retcode);
2067 + qca->rx_skb->protocol = eth_type_trans(
2068 + qca->rx_skb, qca->rx_skb->dev);
2069 +- qca->rx_skb->ip_summed = CHECKSUM_UNNECESSARY;
2070 ++ skb_checksum_none_assert(qca->rx_skb);
2071 + netif_rx_ni(qca->rx_skb);
2072 + qca->rx_skb = netdev_alloc_skb_ip_align(netdev,
2073 + netdev->mtu +
2074 +diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
2075 +index c610fe21c85c0..31ffec3a59727 100644
2076 +--- a/drivers/net/wireless/ath/ath6kl/wmi.c
2077 ++++ b/drivers/net/wireless/ath/ath6kl/wmi.c
2078 +@@ -2510,8 +2510,10 @@ static int ath6kl_wmi_sync_point(struct wmi *wmi, u8 if_idx)
2079 + goto free_data_skb;
2080 +
2081 + for (index = 0; index < num_pri_streams; index++) {
2082 +- if (WARN_ON(!data_sync_bufs[index].skb))
2083 ++ if (WARN_ON(!data_sync_bufs[index].skb)) {
2084 ++ ret = -ENOMEM;
2085 + goto free_data_skb;
2086 ++ }
2087 +
2088 + ep_id = ath6kl_ac2_endpoint_id(wmi->parent_dev,
2089 + data_sync_bufs[index].
2090 +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
2091 +index bda042138e967..e6001f0a81a3a 100644
2092 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
2093 ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
2094 +@@ -2073,7 +2073,7 @@ cleanup:
2095 +
2096 + err = brcmf_pcie_probe(pdev, NULL);
2097 + if (err)
2098 +- brcmf_err(bus, "probe after resume failed, err=%d\n", err);
2099 ++ __brcmf_err(NULL, __func__, "probe after resume failed, err=%d\n", err);
2100 +
2101 + return err;
2102 + }
2103 +diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c
2104 +index 03791f3fe480c..5e6c5d13319d5 100644
2105 +--- a/drivers/net/wireless/rsi/rsi_91x_hal.c
2106 ++++ b/drivers/net/wireless/rsi/rsi_91x_hal.c
2107 +@@ -1038,8 +1038,10 @@ static int rsi_load_9116_firmware(struct rsi_hw *adapter)
2108 + }
2109 +
2110 + ta_firmware = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
2111 +- if (!ta_firmware)
2112 ++ if (!ta_firmware) {
2113 ++ status = -ENOMEM;
2114 + goto fail_release_fw;
2115 ++ }
2116 + fw_p = ta_firmware;
2117 + instructions_sz = fw_entry->size;
2118 + rsi_dbg(INFO_ZONE, "FW Length = %d bytes\n", instructions_sz);
2119 +diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
2120 +index a296f4e0d324a..e8aa3d4bda885 100644
2121 +--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
2122 ++++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
2123 +@@ -806,6 +806,7 @@ static int rsi_probe(struct usb_interface *pfunction,
2124 + } else {
2125 + rsi_dbg(ERR_ZONE, "%s: Unsupported RSI device id 0x%x\n",
2126 + __func__, id->idProduct);
2127 ++ status = -ENODEV;
2128 + goto err1;
2129 + }
2130 +
2131 +diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
2132 +index b8c0f75bfb7ba..dcc3d2393605e 100644
2133 +--- a/drivers/nvme/host/rdma.c
2134 ++++ b/drivers/nvme/host/rdma.c
2135 +@@ -665,13 +665,13 @@ static int nvme_rdma_alloc_io_queues(struct nvme_rdma_ctrl *ctrl)
2136 + if (ret)
2137 + return ret;
2138 +
2139 +- ctrl->ctrl.queue_count = nr_io_queues + 1;
2140 +- if (ctrl->ctrl.queue_count < 2) {
2141 ++ if (nr_io_queues == 0) {
2142 + dev_err(ctrl->ctrl.device,
2143 + "unable to set any I/O queues\n");
2144 + return -ENOMEM;
2145 + }
2146 +
2147 ++ ctrl->ctrl.queue_count = nr_io_queues + 1;
2148 + dev_info(ctrl->ctrl.device,
2149 + "creating %d I/O queues.\n", nr_io_queues);
2150 +
2151 +diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
2152 +index 718152adc6254..f6427a10a9908 100644
2153 +--- a/drivers/nvme/host/tcp.c
2154 ++++ b/drivers/nvme/host/tcp.c
2155 +@@ -1649,13 +1649,13 @@ static int nvme_tcp_alloc_io_queues(struct nvme_ctrl *ctrl)
2156 + if (ret)
2157 + return ret;
2158 +
2159 +- ctrl->queue_count = nr_io_queues + 1;
2160 +- if (ctrl->queue_count < 2) {
2161 ++ if (nr_io_queues == 0) {
2162 + dev_err(ctrl->device,
2163 + "unable to set any I/O queues\n");
2164 + return -ENOMEM;
2165 + }
2166 +
2167 ++ ctrl->queue_count = nr_io_queues + 1;
2168 + dev_info(ctrl->device,
2169 + "creating %d I/O queues.\n", nr_io_queues);
2170 +
2171 +diff --git a/drivers/nvme/target/fabrics-cmd.c b/drivers/nvme/target/fabrics-cmd.c
2172 +index 4e9004fe5c6f3..5e47395afc1d5 100644
2173 +--- a/drivers/nvme/target/fabrics-cmd.c
2174 ++++ b/drivers/nvme/target/fabrics-cmd.c
2175 +@@ -116,6 +116,7 @@ static u16 nvmet_install_queue(struct nvmet_ctrl *ctrl, struct nvmet_req *req)
2176 + if (!sqsize) {
2177 + pr_warn("queue size zero!\n");
2178 + req->error_loc = offsetof(struct nvmf_connect_command, sqsize);
2179 ++ req->cqe->result.u32 = IPO_IATTR_CONNECT_SQE(sqsize);
2180 + ret = NVME_SC_CONNECT_INVALID_PARAM | NVME_SC_DNR;
2181 + goto err;
2182 + }
2183 +@@ -250,11 +251,11 @@ static void nvmet_execute_io_connect(struct nvmet_req *req)
2184 + }
2185 +
2186 + status = nvmet_install_queue(ctrl, req);
2187 +- if (status) {
2188 +- /* pass back cntlid that had the issue of installing queue */
2189 +- req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid);
2190 ++ if (status)
2191 + goto out_ctrl_put;
2192 +- }
2193 ++
2194 ++ /* pass back cntlid for successful completion */
2195 ++ req->cqe->result.u16 = cpu_to_le16(ctrl->cntlid);
2196 +
2197 + pr_debug("adding queue %d to ctrl %d.\n", qid, ctrl->cntlid);
2198 +
2199 +diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
2200 +index 3c3bc9f584983..58c33b65d451a 100644
2201 +--- a/drivers/pci/pci.c
2202 ++++ b/drivers/pci/pci.c
2203 +@@ -2253,7 +2253,14 @@ static int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable
2204 + if (enable) {
2205 + int error;
2206 +
2207 +- if (pci_pme_capable(dev, state))
2208 ++ /*
2209 ++ * Enable PME signaling if the device can signal PME from
2210 ++ * D3cold regardless of whether or not it can signal PME from
2211 ++ * the current target state, because that will allow it to
2212 ++ * signal PME when the hierarchy above it goes into D3cold and
2213 ++ * the device itself ends up in D3cold as a result of that.
2214 ++ */
2215 ++ if (pci_pme_capable(dev, state) || pci_pme_capable(dev, PCI_D3cold))
2216 + pci_pme_active(dev, true);
2217 + else
2218 + ret = 1;
2219 +@@ -2357,16 +2364,20 @@ static pci_power_t pci_target_state(struct pci_dev *dev, bool wakeup)
2220 + if (dev->current_state == PCI_D3cold)
2221 + target_state = PCI_D3cold;
2222 +
2223 +- if (wakeup) {
2224 ++ if (wakeup && dev->pme_support) {
2225 ++ pci_power_t state = target_state;
2226 ++
2227 + /*
2228 + * Find the deepest state from which the device can generate
2229 + * PME#.
2230 + */
2231 +- if (dev->pme_support) {
2232 +- while (target_state
2233 +- && !(dev->pme_support & (1 << target_state)))
2234 +- target_state--;
2235 +- }
2236 ++ while (state && !(dev->pme_support & (1 << state)))
2237 ++ state--;
2238 ++
2239 ++ if (state)
2240 ++ return state;
2241 ++ else if (dev->pme_support & 1)
2242 ++ return PCI_D0;
2243 + }
2244 +
2245 + return target_state;
2246 +diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
2247 +index f40fa0e63b6e5..993e4a4a34b38 100644
2248 +--- a/drivers/power/supply/axp288_fuel_gauge.c
2249 ++++ b/drivers/power/supply/axp288_fuel_gauge.c
2250 +@@ -149,7 +149,7 @@ static int fuel_gauge_reg_readb(struct axp288_fg_info *info, int reg)
2251 + }
2252 +
2253 + if (ret < 0) {
2254 +- dev_err(&info->pdev->dev, "axp288 reg read err:%d\n", ret);
2255 ++ dev_err(&info->pdev->dev, "Error reading reg 0x%02x err: %d\n", reg, ret);
2256 + return ret;
2257 + }
2258 +
2259 +@@ -163,7 +163,7 @@ static int fuel_gauge_reg_writeb(struct axp288_fg_info *info, int reg, u8 val)
2260 + ret = regmap_write(info->regmap, reg, (unsigned int)val);
2261 +
2262 + if (ret < 0)
2263 +- dev_err(&info->pdev->dev, "axp288 reg write err:%d\n", ret);
2264 ++ dev_err(&info->pdev->dev, "Error writing reg 0x%02x err: %d\n", reg, ret);
2265 +
2266 + return ret;
2267 + }
2268 +diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
2269 +index fa862f0380c41..ab4740c3bf573 100644
2270 +--- a/drivers/power/supply/max17042_battery.c
2271 ++++ b/drivers/power/supply/max17042_battery.c
2272 +@@ -726,7 +726,7 @@ static inline void max17042_override_por_values(struct max17042_chip *chip)
2273 + struct max17042_config_data *config = chip->pdata->config_data;
2274 +
2275 + max17042_override_por(map, MAX17042_TGAIN, config->tgain);
2276 +- max17042_override_por(map, MAx17042_TOFF, config->toff);
2277 ++ max17042_override_por(map, MAX17042_TOFF, config->toff);
2278 + max17042_override_por(map, MAX17042_CGAIN, config->cgain);
2279 + max17042_override_por(map, MAX17042_COFF, config->coff);
2280 +
2281 +diff --git a/drivers/regulator/vctrl-regulator.c b/drivers/regulator/vctrl-regulator.c
2282 +index cbadb1c996790..d2a37978fc3a8 100644
2283 +--- a/drivers/regulator/vctrl-regulator.c
2284 ++++ b/drivers/regulator/vctrl-regulator.c
2285 +@@ -37,7 +37,6 @@ struct vctrl_voltage_table {
2286 + struct vctrl_data {
2287 + struct regulator_dev *rdev;
2288 + struct regulator_desc desc;
2289 +- struct regulator *ctrl_reg;
2290 + bool enabled;
2291 + unsigned int min_slew_down_rate;
2292 + unsigned int ovp_threshold;
2293 +@@ -82,7 +81,12 @@ static int vctrl_calc_output_voltage(struct vctrl_data *vctrl, int ctrl_uV)
2294 + static int vctrl_get_voltage(struct regulator_dev *rdev)
2295 + {
2296 + struct vctrl_data *vctrl = rdev_get_drvdata(rdev);
2297 +- int ctrl_uV = regulator_get_voltage_rdev(vctrl->ctrl_reg->rdev);
2298 ++ int ctrl_uV;
2299 ++
2300 ++ if (!rdev->supply)
2301 ++ return -EPROBE_DEFER;
2302 ++
2303 ++ ctrl_uV = regulator_get_voltage_rdev(rdev->supply->rdev);
2304 +
2305 + return vctrl_calc_output_voltage(vctrl, ctrl_uV);
2306 + }
2307 +@@ -92,14 +96,19 @@ static int vctrl_set_voltage(struct regulator_dev *rdev,
2308 + unsigned int *selector)
2309 + {
2310 + struct vctrl_data *vctrl = rdev_get_drvdata(rdev);
2311 +- struct regulator *ctrl_reg = vctrl->ctrl_reg;
2312 +- int orig_ctrl_uV = regulator_get_voltage_rdev(ctrl_reg->rdev);
2313 +- int uV = vctrl_calc_output_voltage(vctrl, orig_ctrl_uV);
2314 ++ int orig_ctrl_uV;
2315 ++ int uV;
2316 + int ret;
2317 +
2318 ++ if (!rdev->supply)
2319 ++ return -EPROBE_DEFER;
2320 ++
2321 ++ orig_ctrl_uV = regulator_get_voltage_rdev(rdev->supply->rdev);
2322 ++ uV = vctrl_calc_output_voltage(vctrl, orig_ctrl_uV);
2323 ++
2324 + if (req_min_uV >= uV || !vctrl->ovp_threshold)
2325 + /* voltage rising or no OVP */
2326 +- return regulator_set_voltage_rdev(ctrl_reg->rdev,
2327 ++ return regulator_set_voltage_rdev(rdev->supply->rdev,
2328 + vctrl_calc_ctrl_voltage(vctrl, req_min_uV),
2329 + vctrl_calc_ctrl_voltage(vctrl, req_max_uV),
2330 + PM_SUSPEND_ON);
2331 +@@ -117,7 +126,7 @@ static int vctrl_set_voltage(struct regulator_dev *rdev,
2332 + next_uV = max_t(int, req_min_uV, uV - max_drop_uV);
2333 + next_ctrl_uV = vctrl_calc_ctrl_voltage(vctrl, next_uV);
2334 +
2335 +- ret = regulator_set_voltage_rdev(ctrl_reg->rdev,
2336 ++ ret = regulator_set_voltage_rdev(rdev->supply->rdev,
2337 + next_ctrl_uV,
2338 + next_ctrl_uV,
2339 + PM_SUSPEND_ON);
2340 +@@ -134,7 +143,7 @@ static int vctrl_set_voltage(struct regulator_dev *rdev,
2341 +
2342 + err:
2343 + /* Try to go back to original voltage */
2344 +- regulator_set_voltage_rdev(ctrl_reg->rdev, orig_ctrl_uV, orig_ctrl_uV,
2345 ++ regulator_set_voltage_rdev(rdev->supply->rdev, orig_ctrl_uV, orig_ctrl_uV,
2346 + PM_SUSPEND_ON);
2347 +
2348 + return ret;
2349 +@@ -151,16 +160,18 @@ static int vctrl_set_voltage_sel(struct regulator_dev *rdev,
2350 + unsigned int selector)
2351 + {
2352 + struct vctrl_data *vctrl = rdev_get_drvdata(rdev);
2353 +- struct regulator *ctrl_reg = vctrl->ctrl_reg;
2354 + unsigned int orig_sel = vctrl->sel;
2355 + int ret;
2356 +
2357 ++ if (!rdev->supply)
2358 ++ return -EPROBE_DEFER;
2359 ++
2360 + if (selector >= rdev->desc->n_voltages)
2361 + return -EINVAL;
2362 +
2363 + if (selector >= vctrl->sel || !vctrl->ovp_threshold) {
2364 + /* voltage rising or no OVP */
2365 +- ret = regulator_set_voltage_rdev(ctrl_reg->rdev,
2366 ++ ret = regulator_set_voltage_rdev(rdev->supply->rdev,
2367 + vctrl->vtable[selector].ctrl,
2368 + vctrl->vtable[selector].ctrl,
2369 + PM_SUSPEND_ON);
2370 +@@ -179,7 +190,7 @@ static int vctrl_set_voltage_sel(struct regulator_dev *rdev,
2371 + else
2372 + next_sel = vctrl->vtable[vctrl->sel].ovp_min_sel;
2373 +
2374 +- ret = regulator_set_voltage_rdev(ctrl_reg->rdev,
2375 ++ ret = regulator_set_voltage_rdev(rdev->supply->rdev,
2376 + vctrl->vtable[next_sel].ctrl,
2377 + vctrl->vtable[next_sel].ctrl,
2378 + PM_SUSPEND_ON);
2379 +@@ -202,7 +213,7 @@ static int vctrl_set_voltage_sel(struct regulator_dev *rdev,
2380 + err:
2381 + if (vctrl->sel != orig_sel) {
2382 + /* Try to go back to original voltage */
2383 +- if (!regulator_set_voltage_rdev(ctrl_reg->rdev,
2384 ++ if (!regulator_set_voltage_rdev(rdev->supply->rdev,
2385 + vctrl->vtable[orig_sel].ctrl,
2386 + vctrl->vtable[orig_sel].ctrl,
2387 + PM_SUSPEND_ON))
2388 +@@ -234,10 +245,6 @@ static int vctrl_parse_dt(struct platform_device *pdev,
2389 + u32 pval;
2390 + u32 vrange_ctrl[2];
2391 +
2392 +- vctrl->ctrl_reg = devm_regulator_get(&pdev->dev, "ctrl");
2393 +- if (IS_ERR(vctrl->ctrl_reg))
2394 +- return PTR_ERR(vctrl->ctrl_reg);
2395 +-
2396 + ret = of_property_read_u32(np, "ovp-threshold-percent", &pval);
2397 + if (!ret) {
2398 + vctrl->ovp_threshold = pval;
2399 +@@ -315,11 +322,11 @@ static int vctrl_cmp_ctrl_uV(const void *a, const void *b)
2400 + return at->ctrl - bt->ctrl;
2401 + }
2402 +
2403 +-static int vctrl_init_vtable(struct platform_device *pdev)
2404 ++static int vctrl_init_vtable(struct platform_device *pdev,
2405 ++ struct regulator *ctrl_reg)
2406 + {
2407 + struct vctrl_data *vctrl = platform_get_drvdata(pdev);
2408 + struct regulator_desc *rdesc = &vctrl->desc;
2409 +- struct regulator *ctrl_reg = vctrl->ctrl_reg;
2410 + struct vctrl_voltage_range *vrange_ctrl = &vctrl->vrange.ctrl;
2411 + int n_voltages;
2412 + int ctrl_uV;
2413 +@@ -395,23 +402,19 @@ static int vctrl_init_vtable(struct platform_device *pdev)
2414 + static int vctrl_enable(struct regulator_dev *rdev)
2415 + {
2416 + struct vctrl_data *vctrl = rdev_get_drvdata(rdev);
2417 +- int ret = regulator_enable(vctrl->ctrl_reg);
2418 +
2419 +- if (!ret)
2420 +- vctrl->enabled = true;
2421 ++ vctrl->enabled = true;
2422 +
2423 +- return ret;
2424 ++ return 0;
2425 + }
2426 +
2427 + static int vctrl_disable(struct regulator_dev *rdev)
2428 + {
2429 + struct vctrl_data *vctrl = rdev_get_drvdata(rdev);
2430 +- int ret = regulator_disable(vctrl->ctrl_reg);
2431 +
2432 +- if (!ret)
2433 +- vctrl->enabled = false;
2434 ++ vctrl->enabled = false;
2435 +
2436 +- return ret;
2437 ++ return 0;
2438 + }
2439 +
2440 + static int vctrl_is_enabled(struct regulator_dev *rdev)
2441 +@@ -447,6 +450,7 @@ static int vctrl_probe(struct platform_device *pdev)
2442 + struct regulator_desc *rdesc;
2443 + struct regulator_config cfg = { };
2444 + struct vctrl_voltage_range *vrange_ctrl;
2445 ++ struct regulator *ctrl_reg;
2446 + int ctrl_uV;
2447 + int ret;
2448 +
2449 +@@ -461,15 +465,20 @@ static int vctrl_probe(struct platform_device *pdev)
2450 + if (ret)
2451 + return ret;
2452 +
2453 ++ ctrl_reg = devm_regulator_get(&pdev->dev, "ctrl");
2454 ++ if (IS_ERR(ctrl_reg))
2455 ++ return PTR_ERR(ctrl_reg);
2456 ++
2457 + vrange_ctrl = &vctrl->vrange.ctrl;
2458 +
2459 + rdesc = &vctrl->desc;
2460 + rdesc->name = "vctrl";
2461 + rdesc->type = REGULATOR_VOLTAGE;
2462 + rdesc->owner = THIS_MODULE;
2463 ++ rdesc->supply_name = "ctrl";
2464 +
2465 +- if ((regulator_get_linear_step(vctrl->ctrl_reg) == 1) ||
2466 +- (regulator_count_voltages(vctrl->ctrl_reg) == -EINVAL)) {
2467 ++ if ((regulator_get_linear_step(ctrl_reg) == 1) ||
2468 ++ (regulator_count_voltages(ctrl_reg) == -EINVAL)) {
2469 + rdesc->continuous_voltage_range = true;
2470 + rdesc->ops = &vctrl_ops_cont;
2471 + } else {
2472 +@@ -486,11 +495,12 @@ static int vctrl_probe(struct platform_device *pdev)
2473 + cfg.init_data = init_data;
2474 +
2475 + if (!rdesc->continuous_voltage_range) {
2476 +- ret = vctrl_init_vtable(pdev);
2477 ++ ret = vctrl_init_vtable(pdev, ctrl_reg);
2478 + if (ret)
2479 + return ret;
2480 +
2481 +- ctrl_uV = regulator_get_voltage_rdev(vctrl->ctrl_reg->rdev);
2482 ++ /* Use locked consumer API when not in regulator framework */
2483 ++ ctrl_uV = regulator_get_voltage(ctrl_reg);
2484 + if (ctrl_uV < 0) {
2485 + dev_err(&pdev->dev, "failed to get control voltage\n");
2486 + return ctrl_uV;
2487 +@@ -513,6 +523,9 @@ static int vctrl_probe(struct platform_device *pdev)
2488 + }
2489 + }
2490 +
2491 ++ /* Drop ctrl-supply here in favor of regulator core managed supply */
2492 ++ devm_regulator_put(ctrl_reg);
2493 ++
2494 + vctrl->rdev = devm_regulator_register(&pdev->dev, rdesc, &cfg);
2495 + if (IS_ERR(vctrl->rdev)) {
2496 + ret = PTR_ERR(vctrl->rdev);
2497 +diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
2498 +index 5734a78dbb8e6..7950ac59b1744 100644
2499 +--- a/drivers/s390/cio/css.c
2500 ++++ b/drivers/s390/cio/css.c
2501 +@@ -426,9 +426,26 @@ static ssize_t pimpampom_show(struct device *dev,
2502 + }
2503 + static DEVICE_ATTR_RO(pimpampom);
2504 +
2505 ++static ssize_t dev_busid_show(struct device *dev,
2506 ++ struct device_attribute *attr,
2507 ++ char *buf)
2508 ++{
2509 ++ struct subchannel *sch = to_subchannel(dev);
2510 ++ struct pmcw *pmcw = &sch->schib.pmcw;
2511 ++
2512 ++ if ((pmcw->st == SUBCHANNEL_TYPE_IO ||
2513 ++ pmcw->st == SUBCHANNEL_TYPE_MSG) && pmcw->dnv)
2514 ++ return sysfs_emit(buf, "0.%x.%04x\n", sch->schid.ssid,
2515 ++ pmcw->dev);
2516 ++ else
2517 ++ return sysfs_emit(buf, "none\n");
2518 ++}
2519 ++static DEVICE_ATTR_RO(dev_busid);
2520 ++
2521 + static struct attribute *io_subchannel_type_attrs[] = {
2522 + &dev_attr_chpids.attr,
2523 + &dev_attr_pimpampom.attr,
2524 ++ &dev_attr_dev_busid.attr,
2525 + NULL,
2526 + };
2527 + ATTRIBUTE_GROUPS(io_subchannel_type);
2528 +diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
2529 +index 51850cc68b701..aa24237a78405 100644
2530 +--- a/drivers/soc/qcom/rpmhpd.c
2531 ++++ b/drivers/soc/qcom/rpmhpd.c
2532 +@@ -235,12 +235,11 @@ static int rpmhpd_power_on(struct generic_pm_domain *domain)
2533 + static int rpmhpd_power_off(struct generic_pm_domain *domain)
2534 + {
2535 + struct rpmhpd *pd = domain_to_rpmhpd(domain);
2536 +- int ret = 0;
2537 ++ int ret;
2538 +
2539 + mutex_lock(&rpmhpd_lock);
2540 +
2541 +- ret = rpmhpd_aggregate_corner(pd, pd->level[0]);
2542 +-
2543 ++ ret = rpmhpd_aggregate_corner(pd, 0);
2544 + if (!ret)
2545 + pd->enabled = false;
2546 +
2547 +diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c
2548 +index 70c3c90b997c9..c428d0f78816e 100644
2549 +--- a/drivers/soc/qcom/smsm.c