1 |
commit: 7f6e24089fba9cb17bf18eee7ee204298d9d6e61 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 5 11:40:26 2019 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 29 13:59:02 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=7f6e2408 |
7 |
|
8 |
Linux patch 4.14.147 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1146_linux-4.14.147.patch | 5226 +++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 5230 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index a4f3b29..300d3fc 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -627,6 +627,10 @@ Patch: 1145_linux-4.14.146.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.14.146 |
23 |
|
24 |
+Patch: 1146_linux-4.14.147.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.14.147 |
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/1146_linux-4.14.147.patch b/1146_linux-4.14.147.patch |
33 |
new file mode 100644 |
34 |
index 0000000..118092b |
35 |
--- /dev/null |
36 |
+++ b/1146_linux-4.14.147.patch |
37 |
@@ -0,0 +1,5226 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index ad923d5eae1e..d6f1a056b233 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 14 |
46 |
+-SUBLEVEL = 146 |
47 |
++SUBLEVEL = 147 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Petit Gorille |
50 |
+ |
51 |
+@@ -949,9 +949,11 @@ mod_sign_cmd = true |
52 |
+ endif |
53 |
+ export mod_sign_cmd |
54 |
+ |
55 |
++HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf) |
56 |
++ |
57 |
+ ifdef CONFIG_STACK_VALIDATION |
58 |
+ has_libelf := $(call try-run,\ |
59 |
+- echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf -,1,0) |
60 |
++ echo "int main() {}" | $(HOSTCC) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0) |
61 |
+ ifeq ($(has_libelf),1) |
62 |
+ objtool_target := tools/objtool FORCE |
63 |
+ else |
64 |
+diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts b/arch/arm/boot/dts/exynos5420-peach-pit.dts |
65 |
+index c91eff8475a8..7ccee2cfe481 100644 |
66 |
+--- a/arch/arm/boot/dts/exynos5420-peach-pit.dts |
67 |
++++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts |
68 |
+@@ -426,6 +426,7 @@ |
69 |
+ regulator-name = "vdd_ldo10"; |
70 |
+ regulator-min-microvolt = <1800000>; |
71 |
+ regulator-max-microvolt = <1800000>; |
72 |
++ regulator-always-on; |
73 |
+ regulator-state-mem { |
74 |
+ regulator-off-in-suspend; |
75 |
+ }; |
76 |
+diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts b/arch/arm/boot/dts/exynos5800-peach-pi.dts |
77 |
+index daad5d425cf5..0900b38f60b4 100644 |
78 |
+--- a/arch/arm/boot/dts/exynos5800-peach-pi.dts |
79 |
++++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts |
80 |
+@@ -426,6 +426,7 @@ |
81 |
+ regulator-name = "vdd_ldo10"; |
82 |
+ regulator-min-microvolt = <1800000>; |
83 |
+ regulator-max-microvolt = <1800000>; |
84 |
++ regulator-always-on; |
85 |
+ regulator-state-mem { |
86 |
+ regulator-off-in-suspend; |
87 |
+ }; |
88 |
+diff --git a/arch/arm/boot/dts/imx7d-cl-som-imx7.dts b/arch/arm/boot/dts/imx7d-cl-som-imx7.dts |
89 |
+index 3cc1fb9ce441..60a28281d3d1 100644 |
90 |
+--- a/arch/arm/boot/dts/imx7d-cl-som-imx7.dts |
91 |
++++ b/arch/arm/boot/dts/imx7d-cl-som-imx7.dts |
92 |
+@@ -43,7 +43,7 @@ |
93 |
+ <&clks IMX7D_ENET1_TIME_ROOT_CLK>; |
94 |
+ assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>; |
95 |
+ assigned-clock-rates = <0>, <100000000>; |
96 |
+- phy-mode = "rgmii"; |
97 |
++ phy-mode = "rgmii-id"; |
98 |
+ phy-handle = <ðphy0>; |
99 |
+ fsl,magic-packet; |
100 |
+ status = "okay"; |
101 |
+@@ -69,7 +69,7 @@ |
102 |
+ <&clks IMX7D_ENET2_TIME_ROOT_CLK>; |
103 |
+ assigned-clock-parents = <&clks IMX7D_PLL_ENET_MAIN_100M_CLK>; |
104 |
+ assigned-clock-rates = <0>, <100000000>; |
105 |
+- phy-mode = "rgmii"; |
106 |
++ phy-mode = "rgmii-id"; |
107 |
+ phy-handle = <ðphy1>; |
108 |
+ fsl,magic-packet; |
109 |
+ status = "okay"; |
110 |
+diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c |
111 |
+index caa6d5fe9078..b296ada97409 100644 |
112 |
+--- a/arch/arm/mach-zynq/platsmp.c |
113 |
++++ b/arch/arm/mach-zynq/platsmp.c |
114 |
+@@ -65,7 +65,7 @@ int zynq_cpun_start(u32 address, int cpu) |
115 |
+ * 0x4: Jump by mov instruction |
116 |
+ * 0x8: Jumping address |
117 |
+ */ |
118 |
+- memcpy((__force void *)zero, &zynq_secondary_trampoline, |
119 |
++ memcpy_toio(zero, &zynq_secondary_trampoline, |
120 |
+ trampoline_size); |
121 |
+ writel(address, zero + trampoline_size); |
122 |
+ |
123 |
+diff --git a/arch/arm/plat-samsung/watchdog-reset.c b/arch/arm/plat-samsung/watchdog-reset.c |
124 |
+index 307d8ad96a78..be2ed95da0ec 100644 |
125 |
+--- a/arch/arm/plat-samsung/watchdog-reset.c |
126 |
++++ b/arch/arm/plat-samsung/watchdog-reset.c |
127 |
+@@ -67,6 +67,7 @@ void samsung_wdt_reset(void) |
128 |
+ #ifdef CONFIG_OF |
129 |
+ static const struct of_device_id s3c2410_wdt_match[] = { |
130 |
+ { .compatible = "samsung,s3c2410-wdt" }, |
131 |
++ { .compatible = "samsung,s3c6410-wdt" }, |
132 |
+ {}, |
133 |
+ }; |
134 |
+ |
135 |
+diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi |
136 |
+index f6b4b8f0260f..c34daae3c37c 100644 |
137 |
+--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi |
138 |
++++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi |
139 |
+@@ -685,6 +685,7 @@ |
140 |
+ <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; |
141 |
+ clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; |
142 |
+ fifo-depth = <0x100>; |
143 |
++ max-frequency = <150000000>; |
144 |
+ status = "disabled"; |
145 |
+ }; |
146 |
+ |
147 |
+@@ -696,6 +697,7 @@ |
148 |
+ <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; |
149 |
+ clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; |
150 |
+ fifo-depth = <0x100>; |
151 |
++ max-frequency = <150000000>; |
152 |
+ status = "disabled"; |
153 |
+ }; |
154 |
+ |
155 |
+@@ -707,6 +709,7 @@ |
156 |
+ <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; |
157 |
+ clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; |
158 |
+ fifo-depth = <0x100>; |
159 |
++ max-frequency = <150000000>; |
160 |
+ status = "disabled"; |
161 |
+ }; |
162 |
+ |
163 |
+diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c |
164 |
+index 3312d46fa29e..57ec681a8f11 100644 |
165 |
+--- a/arch/arm64/kernel/cpufeature.c |
166 |
++++ b/arch/arm64/kernel/cpufeature.c |
167 |
+@@ -838,6 +838,11 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry, |
168 |
+ switch (read_cpuid_id() & MIDR_CPU_MODEL_MASK) { |
169 |
+ case MIDR_CAVIUM_THUNDERX2: |
170 |
+ case MIDR_BRCM_VULCAN: |
171 |
++ case MIDR_CORTEX_A53: |
172 |
++ case MIDR_CORTEX_A55: |
173 |
++ case MIDR_CORTEX_A57: |
174 |
++ case MIDR_CORTEX_A72: |
175 |
++ case MIDR_CORTEX_A73: |
176 |
+ return false; |
177 |
+ } |
178 |
+ |
179 |
+diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S |
180 |
+index 034a3a2a38ee..65b040152184 100644 |
181 |
+--- a/arch/arm64/mm/proc.S |
182 |
++++ b/arch/arm64/mm/proc.S |
183 |
+@@ -280,6 +280,15 @@ skip_pgd: |
184 |
+ msr sctlr_el1, x18 |
185 |
+ isb |
186 |
+ |
187 |
++ /* |
188 |
++ * Invalidate the local I-cache so that any instructions fetched |
189 |
++ * speculatively from the PoC are discarded, since they may have |
190 |
++ * been dynamically patched at the PoU. |
191 |
++ */ |
192 |
++ ic iallu |
193 |
++ dsb nsh |
194 |
++ isb |
195 |
++ |
196 |
+ /* Set the flag to zero to indicate that we're all done */ |
197 |
+ str wzr, [flag_ptr] |
198 |
+ ret |
199 |
+diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c |
200 |
+index 853b5611a894..95e8d130e123 100644 |
201 |
+--- a/arch/ia64/kernel/module.c |
202 |
++++ b/arch/ia64/kernel/module.c |
203 |
+@@ -913,8 +913,12 @@ module_finalize (const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mo |
204 |
+ void |
205 |
+ module_arch_cleanup (struct module *mod) |
206 |
+ { |
207 |
+- if (mod->arch.init_unw_table) |
208 |
++ if (mod->arch.init_unw_table) { |
209 |
+ unw_remove_unwind_table(mod->arch.init_unw_table); |
210 |
+- if (mod->arch.core_unw_table) |
211 |
++ mod->arch.init_unw_table = NULL; |
212 |
++ } |
213 |
++ if (mod->arch.core_unw_table) { |
214 |
+ unw_remove_unwind_table(mod->arch.core_unw_table); |
215 |
++ mod->arch.core_unw_table = NULL; |
216 |
++ } |
217 |
+ } |
218 |
+diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h |
219 |
+index 8eb3ebca02df..163970c56e2f 100644 |
220 |
+--- a/arch/powerpc/include/asm/opal.h |
221 |
++++ b/arch/powerpc/include/asm/opal.h |
222 |
+@@ -266,7 +266,7 @@ int64_t opal_xive_get_vp_info(uint64_t vp, |
223 |
+ int64_t opal_xive_set_vp_info(uint64_t vp, |
224 |
+ uint64_t flags, |
225 |
+ uint64_t report_cl_pair); |
226 |
+-int64_t opal_xive_allocate_irq(uint32_t chip_id); |
227 |
++int64_t opal_xive_allocate_irq_raw(uint32_t chip_id); |
228 |
+ int64_t opal_xive_free_irq(uint32_t girq); |
229 |
+ int64_t opal_xive_sync(uint32_t type, uint32_t id); |
230 |
+ int64_t opal_xive_dump(uint32_t type, uint32_t id); |
231 |
+diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S |
232 |
+index 8c1ede2d3f7e..b12a75a0ee8b 100644 |
233 |
+--- a/arch/powerpc/platforms/powernv/opal-wrappers.S |
234 |
++++ b/arch/powerpc/platforms/powernv/opal-wrappers.S |
235 |
+@@ -301,7 +301,7 @@ OPAL_CALL(opal_xive_set_queue_info, OPAL_XIVE_SET_QUEUE_INFO); |
236 |
+ OPAL_CALL(opal_xive_donate_page, OPAL_XIVE_DONATE_PAGE); |
237 |
+ OPAL_CALL(opal_xive_alloc_vp_block, OPAL_XIVE_ALLOCATE_VP_BLOCK); |
238 |
+ OPAL_CALL(opal_xive_free_vp_block, OPAL_XIVE_FREE_VP_BLOCK); |
239 |
+-OPAL_CALL(opal_xive_allocate_irq, OPAL_XIVE_ALLOCATE_IRQ); |
240 |
++OPAL_CALL(opal_xive_allocate_irq_raw, OPAL_XIVE_ALLOCATE_IRQ); |
241 |
+ OPAL_CALL(opal_xive_free_irq, OPAL_XIVE_FREE_IRQ); |
242 |
+ OPAL_CALL(opal_xive_get_vp_info, OPAL_XIVE_GET_VP_INFO); |
243 |
+ OPAL_CALL(opal_xive_set_vp_info, OPAL_XIVE_SET_VP_INFO); |
244 |
+diff --git a/arch/powerpc/sysdev/xive/native.c b/arch/powerpc/sysdev/xive/native.c |
245 |
+index 0f89ee557b04..aac61374afeb 100644 |
246 |
+--- a/arch/powerpc/sysdev/xive/native.c |
247 |
++++ b/arch/powerpc/sysdev/xive/native.c |
248 |
+@@ -234,6 +234,17 @@ static bool xive_native_match(struct device_node *node) |
249 |
+ return of_device_is_compatible(node, "ibm,opal-xive-vc"); |
250 |
+ } |
251 |
+ |
252 |
++static s64 opal_xive_allocate_irq(u32 chip_id) |
253 |
++{ |
254 |
++ s64 irq = opal_xive_allocate_irq_raw(chip_id); |
255 |
++ |
256 |
++ /* |
257 |
++ * Old versions of skiboot can incorrectly return 0xffffffff to |
258 |
++ * indicate no space, fix it up here. |
259 |
++ */ |
260 |
++ return irq == 0xffffffff ? OPAL_RESOURCE : irq; |
261 |
++} |
262 |
++ |
263 |
+ #ifdef CONFIG_SMP |
264 |
+ static int xive_native_get_ipi(unsigned int cpu, struct xive_cpu *xc) |
265 |
+ { |
266 |
+diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c |
267 |
+index 591cbdf615af..1a906dd7ca7d 100644 |
268 |
+--- a/arch/s390/crypto/aes_s390.c |
269 |
++++ b/arch/s390/crypto/aes_s390.c |
270 |
+@@ -572,6 +572,9 @@ static int xts_aes_encrypt(struct blkcipher_desc *desc, |
271 |
+ struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); |
272 |
+ struct blkcipher_walk walk; |
273 |
+ |
274 |
++ if (!nbytes) |
275 |
++ return -EINVAL; |
276 |
++ |
277 |
+ if (unlikely(!xts_ctx->fc)) |
278 |
+ return xts_fallback_encrypt(desc, dst, src, nbytes); |
279 |
+ |
280 |
+@@ -586,6 +589,9 @@ static int xts_aes_decrypt(struct blkcipher_desc *desc, |
281 |
+ struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); |
282 |
+ struct blkcipher_walk walk; |
283 |
+ |
284 |
++ if (!nbytes) |
285 |
++ return -EINVAL; |
286 |
++ |
287 |
+ if (unlikely(!xts_ctx->fc)) |
288 |
+ return xts_fallback_decrypt(desc, dst, src, nbytes); |
289 |
+ |
290 |
+diff --git a/arch/x86/Makefile b/arch/x86/Makefile |
291 |
+index cd596ca60901..3dc54d2f79c4 100644 |
292 |
+--- a/arch/x86/Makefile |
293 |
++++ b/arch/x86/Makefile |
294 |
+@@ -249,7 +249,7 @@ ifdef CONFIG_RETPOLINE |
295 |
+ # retpoline builds, however, gcc does not for x86. This has |
296 |
+ # only been fixed starting from gcc stable version 8.4.0 and |
297 |
+ # onwards, but not for older ones. See gcc bug #86952. |
298 |
+- ifndef CONFIG_CC_IS_CLANG |
299 |
++ ifneq ($(cc-name), clang) |
300 |
+ KBUILD_CFLAGS += $(call cc-option,-fno-jump-tables) |
301 |
+ endif |
302 |
+ endif |
303 |
+diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c |
304 |
+index f8f9cfded97d..ea2de324ab02 100644 |
305 |
+--- a/arch/x86/kernel/apic/apic.c |
306 |
++++ b/arch/x86/kernel/apic/apic.c |
307 |
+@@ -1384,6 +1384,14 @@ void setup_local_APIC(void) |
308 |
+ return; |
309 |
+ } |
310 |
+ |
311 |
++ /* |
312 |
++ * If this comes from kexec/kcrash the APIC might be enabled in |
313 |
++ * SPIV. Soft disable it before doing further initialization. |
314 |
++ */ |
315 |
++ value = apic_read(APIC_SPIV); |
316 |
++ value &= ~APIC_SPIV_APIC_ENABLED; |
317 |
++ apic_write(APIC_SPIV, value); |
318 |
++ |
319 |
+ #ifdef CONFIG_X86_32 |
320 |
+ /* Pound the ESR really hard over the head with a big hammer - mbligh */ |
321 |
+ if (lapic_is_integrated() && apic->disable_esr) { |
322 |
+diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c |
323 |
+index 04adc8d60aed..b2b87b91f336 100644 |
324 |
+--- a/arch/x86/kernel/smp.c |
325 |
++++ b/arch/x86/kernel/smp.c |
326 |
+@@ -181,6 +181,12 @@ asmlinkage __visible void smp_reboot_interrupt(void) |
327 |
+ irq_exit(); |
328 |
+ } |
329 |
+ |
330 |
++static int register_stop_handler(void) |
331 |
++{ |
332 |
++ return register_nmi_handler(NMI_LOCAL, smp_stop_nmi_callback, |
333 |
++ NMI_FLAG_FIRST, "smp_stop"); |
334 |
++} |
335 |
++ |
336 |
+ static void native_stop_other_cpus(int wait) |
337 |
+ { |
338 |
+ unsigned long flags; |
339 |
+@@ -214,39 +220,41 @@ static void native_stop_other_cpus(int wait) |
340 |
+ apic->send_IPI_allbutself(REBOOT_VECTOR); |
341 |
+ |
342 |
+ /* |
343 |
+- * Don't wait longer than a second if the caller |
344 |
+- * didn't ask us to wait. |
345 |
++ * Don't wait longer than a second for IPI completion. The |
346 |
++ * wait request is not checked here because that would |
347 |
++ * prevent an NMI shutdown attempt in case that not all |
348 |
++ * CPUs reach shutdown state. |
349 |
+ */ |
350 |
+ timeout = USEC_PER_SEC; |
351 |
+- while (num_online_cpus() > 1 && (wait || timeout--)) |
352 |
++ while (num_online_cpus() > 1 && timeout--) |
353 |
+ udelay(1); |
354 |
+ } |
355 |
+- |
356 |
+- /* if the REBOOT_VECTOR didn't work, try with the NMI */ |
357 |
+- if ((num_online_cpus() > 1) && (!smp_no_nmi_ipi)) { |
358 |
+- if (register_nmi_handler(NMI_LOCAL, smp_stop_nmi_callback, |
359 |
+- NMI_FLAG_FIRST, "smp_stop")) |
360 |
+- /* Note: we ignore failures here */ |
361 |
+- /* Hope the REBOOT_IRQ is good enough */ |
362 |
+- goto finish; |
363 |
+- |
364 |
+- /* sync above data before sending IRQ */ |
365 |
+- wmb(); |
366 |
+ |
367 |
+- pr_emerg("Shutting down cpus with NMI\n"); |
368 |
++ /* if the REBOOT_VECTOR didn't work, try with the NMI */ |
369 |
++ if (num_online_cpus() > 1) { |
370 |
++ /* |
371 |
++ * If NMI IPI is enabled, try to register the stop handler |
372 |
++ * and send the IPI. In any case try to wait for the other |
373 |
++ * CPUs to stop. |
374 |
++ */ |
375 |
++ if (!smp_no_nmi_ipi && !register_stop_handler()) { |
376 |
++ /* Sync above data before sending IRQ */ |
377 |
++ wmb(); |
378 |
+ |
379 |
+- apic->send_IPI_allbutself(NMI_VECTOR); |
380 |
++ pr_emerg("Shutting down cpus with NMI\n"); |
381 |
+ |
382 |
++ apic->send_IPI_allbutself(NMI_VECTOR); |
383 |
++ } |
384 |
+ /* |
385 |
+- * Don't wait longer than a 10 ms if the caller |
386 |
+- * didn't ask us to wait. |
387 |
++ * Don't wait longer than 10 ms if the caller didn't |
388 |
++ * reqeust it. If wait is true, the machine hangs here if |
389 |
++ * one or more CPUs do not reach shutdown state. |
390 |
+ */ |
391 |
+ timeout = USEC_PER_MSEC * 10; |
392 |
+ while (num_online_cpus() > 1 && (wait || timeout--)) |
393 |
+ udelay(1); |
394 |
+ } |
395 |
+ |
396 |
+-finish: |
397 |
+ local_irq_save(flags); |
398 |
+ disable_local_APIC(); |
399 |
+ mcheck_cpu_clear(this_cpu_ptr(&cpu_info)); |
400 |
+diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c |
401 |
+index 2bcadfc5b2f0..eb8b843325f4 100644 |
402 |
+--- a/arch/x86/kvm/emulate.c |
403 |
++++ b/arch/x86/kvm/emulate.c |
404 |
+@@ -5298,6 +5298,8 @@ done_prefixes: |
405 |
+ ctxt->memopp->addr.mem.ea + ctxt->_eip); |
406 |
+ |
407 |
+ done: |
408 |
++ if (rc == X86EMUL_PROPAGATE_FAULT) |
409 |
++ ctxt->have_exception = true; |
410 |
+ return (rc != X86EMUL_CONTINUE) ? EMULATION_FAILED : EMULATION_OK; |
411 |
+ } |
412 |
+ |
413 |
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c |
414 |
+index def9c844c322..98b990f13ae0 100644 |
415 |
+--- a/arch/x86/kvm/x86.c |
416 |
++++ b/arch/x86/kvm/x86.c |
417 |
+@@ -563,8 +563,14 @@ static int kvm_read_nested_guest_page(struct kvm_vcpu *vcpu, gfn_t gfn, |
418 |
+ data, offset, len, access); |
419 |
+ } |
420 |
+ |
421 |
++static inline u64 pdptr_rsvd_bits(struct kvm_vcpu *vcpu) |
422 |
++{ |
423 |
++ return rsvd_bits(cpuid_maxphyaddr(vcpu), 63) | rsvd_bits(5, 8) | |
424 |
++ rsvd_bits(1, 2); |
425 |
++} |
426 |
++ |
427 |
+ /* |
428 |
+- * Load the pae pdptrs. Return true is they are all valid. |
429 |
++ * Load the pae pdptrs. Return 1 if they are all valid, 0 otherwise. |
430 |
+ */ |
431 |
+ int load_pdptrs(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu, unsigned long cr3) |
432 |
+ { |
433 |
+@@ -583,8 +589,7 @@ int load_pdptrs(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu, unsigned long cr3) |
434 |
+ } |
435 |
+ for (i = 0; i < ARRAY_SIZE(pdpte); ++i) { |
436 |
+ if ((pdpte[i] & PT_PRESENT_MASK) && |
437 |
+- (pdpte[i] & |
438 |
+- vcpu->arch.mmu.guest_rsvd_check.rsvd_bits_mask[0][2])) { |
439 |
++ (pdpte[i] & pdptr_rsvd_bits(vcpu))) { |
440 |
+ ret = 0; |
441 |
+ goto out; |
442 |
+ } |
443 |
+@@ -5892,8 +5897,16 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, |
444 |
+ if (reexecute_instruction(vcpu, cr2, write_fault_to_spt, |
445 |
+ emulation_type)) |
446 |
+ return EMULATE_DONE; |
447 |
+- if (ctxt->have_exception && inject_emulated_exception(vcpu)) |
448 |
++ if (ctxt->have_exception) { |
449 |
++ /* |
450 |
++ * #UD should result in just EMULATION_FAILED, and trap-like |
451 |
++ * exception should not be encountered during decode. |
452 |
++ */ |
453 |
++ WARN_ON_ONCE(ctxt->exception.vector == UD_VECTOR || |
454 |
++ exception_type(ctxt->exception.vector) == EXCPT_TRAP); |
455 |
++ inject_emulated_exception(vcpu); |
456 |
+ return EMULATE_DONE; |
457 |
++ } |
458 |
+ if (emulation_type & EMULTYPE_SKIP) |
459 |
+ return EMULATE_FAIL; |
460 |
+ return handle_emulation_failure(vcpu); |
461 |
+diff --git a/block/blk-mq.c b/block/blk-mq.c |
462 |
+index 55139d2fca3e..eac444804736 100644 |
463 |
+--- a/block/blk-mq.c |
464 |
++++ b/block/blk-mq.c |
465 |
+@@ -2294,8 +2294,6 @@ void blk_mq_release(struct request_queue *q) |
466 |
+ struct blk_mq_hw_ctx *hctx; |
467 |
+ unsigned int i; |
468 |
+ |
469 |
+- cancel_delayed_work_sync(&q->requeue_work); |
470 |
+- |
471 |
+ /* hctx kobj stays in hctx */ |
472 |
+ queue_for_each_hw_ctx(q, hctx, i) { |
473 |
+ if (!hctx) |
474 |
+diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c |
475 |
+index e54be402899d..9caf96c2c108 100644 |
476 |
+--- a/block/blk-sysfs.c |
477 |
++++ b/block/blk-sysfs.c |
478 |
+@@ -811,6 +811,9 @@ static void __blk_release_queue(struct work_struct *work) |
479 |
+ |
480 |
+ blk_free_queue_stats(q->stats); |
481 |
+ |
482 |
++ if (q->mq_ops) |
483 |
++ cancel_delayed_work_sync(&q->requeue_work); |
484 |
++ |
485 |
+ blk_exit_rl(q, &q->root_rl); |
486 |
+ |
487 |
+ if (q->queue_tags) |
488 |
+diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c |
489 |
+index ccf07674a2a0..f81c434ce4c5 100644 |
490 |
+--- a/drivers/acpi/acpi_processor.c |
491 |
++++ b/drivers/acpi/acpi_processor.c |
492 |
+@@ -281,9 +281,13 @@ static int acpi_processor_get_info(struct acpi_device *device) |
493 |
+ } |
494 |
+ |
495 |
+ if (acpi_duplicate_processor_id(pr->acpi_id)) { |
496 |
+- dev_err(&device->dev, |
497 |
+- "Failed to get unique processor _UID (0x%x)\n", |
498 |
+- pr->acpi_id); |
499 |
++ if (pr->acpi_id == 0xff) |
500 |
++ dev_info_once(&device->dev, |
501 |
++ "Entry not well-defined, consider updating BIOS\n"); |
502 |
++ else |
503 |
++ dev_err(&device->dev, |
504 |
++ "Failed to get unique processor _UID (0x%x)\n", |
505 |
++ pr->acpi_id); |
506 |
+ return -ENODEV; |
507 |
+ } |
508 |
+ |
509 |
+diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c |
510 |
+index e39a1489cc72..7df7abde1fcb 100644 |
511 |
+--- a/drivers/acpi/acpi_video.c |
512 |
++++ b/drivers/acpi/acpi_video.c |
513 |
+@@ -73,6 +73,12 @@ module_param(report_key_events, int, 0644); |
514 |
+ MODULE_PARM_DESC(report_key_events, |
515 |
+ "0: none, 1: output changes, 2: brightness changes, 3: all"); |
516 |
+ |
517 |
++static int hw_changes_brightness = -1; |
518 |
++module_param(hw_changes_brightness, int, 0644); |
519 |
++MODULE_PARM_DESC(hw_changes_brightness, |
520 |
++ "Set this to 1 on buggy hw which changes the brightness itself when " |
521 |
++ "a hotkey is pressed: -1: auto, 0: normal 1: hw-changes-brightness"); |
522 |
++ |
523 |
+ /* |
524 |
+ * Whether the struct acpi_video_device_attrib::device_id_scheme bit should be |
525 |
+ * assumed even if not actually set. |
526 |
+@@ -418,6 +424,14 @@ static int video_set_report_key_events(const struct dmi_system_id *id) |
527 |
+ return 0; |
528 |
+ } |
529 |
+ |
530 |
++static int video_hw_changes_brightness( |
531 |
++ const struct dmi_system_id *d) |
532 |
++{ |
533 |
++ if (hw_changes_brightness == -1) |
534 |
++ hw_changes_brightness = 1; |
535 |
++ return 0; |
536 |
++} |
537 |
++ |
538 |
+ static const struct dmi_system_id video_dmi_table[] = { |
539 |
+ /* |
540 |
+ * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 |
541 |
+@@ -542,6 +556,21 @@ static const struct dmi_system_id video_dmi_table[] = { |
542 |
+ DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V131"), |
543 |
+ }, |
544 |
+ }, |
545 |
++ /* |
546 |
++ * Some machines change the brightness themselves when a brightness |
547 |
++ * hotkey gets pressed, despite us telling them not to. In this case |
548 |
++ * acpi_video_device_notify() should only call backlight_force_update( |
549 |
++ * BACKLIGHT_UPDATE_HOTKEY) and not do anything else. |
550 |
++ */ |
551 |
++ { |
552 |
++ /* https://bugzilla.kernel.org/show_bug.cgi?id=204077 */ |
553 |
++ .callback = video_hw_changes_brightness, |
554 |
++ .ident = "Packard Bell EasyNote MZ35", |
555 |
++ .matches = { |
556 |
++ DMI_MATCH(DMI_SYS_VENDOR, "Packard Bell"), |
557 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "EasyNote MZ35"), |
558 |
++ }, |
559 |
++ }, |
560 |
+ {} |
561 |
+ }; |
562 |
+ |
563 |
+@@ -1624,6 +1653,14 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) |
564 |
+ bus = video_device->video; |
565 |
+ input = bus->input; |
566 |
+ |
567 |
++ if (hw_changes_brightness > 0) { |
568 |
++ if (video_device->backlight) |
569 |
++ backlight_force_update(video_device->backlight, |
570 |
++ BACKLIGHT_UPDATE_HOTKEY); |
571 |
++ acpi_notifier_call_chain(device, event, 0); |
572 |
++ return; |
573 |
++ } |
574 |
++ |
575 |
+ switch (event) { |
576 |
+ case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */ |
577 |
+ brightness_switch_event(video_device, event); |
578 |
+diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c |
579 |
+index e5b47f032d9a..7bf1948b1223 100644 |
580 |
+--- a/drivers/acpi/cppc_acpi.c |
581 |
++++ b/drivers/acpi/cppc_acpi.c |
582 |
+@@ -365,8 +365,10 @@ static int acpi_get_psd(struct cpc_desc *cpc_ptr, acpi_handle handle) |
583 |
+ union acpi_object *psd = NULL; |
584 |
+ struct acpi_psd_package *pdomain; |
585 |
+ |
586 |
+- status = acpi_evaluate_object_typed(handle, "_PSD", NULL, &buffer, |
587 |
+- ACPI_TYPE_PACKAGE); |
588 |
++ status = acpi_evaluate_object_typed(handle, "_PSD", NULL, |
589 |
++ &buffer, ACPI_TYPE_PACKAGE); |
590 |
++ if (status == AE_NOT_FOUND) /* _PSD is optional */ |
591 |
++ return 0; |
592 |
+ if (ACPI_FAILURE(status)) |
593 |
+ return -ENODEV; |
594 |
+ |
595 |
+diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c |
596 |
+index c68e72414a67..435bd0ffc8c0 100644 |
597 |
+--- a/drivers/acpi/custom_method.c |
598 |
++++ b/drivers/acpi/custom_method.c |
599 |
+@@ -48,8 +48,10 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, |
600 |
+ if ((*ppos > max_size) || |
601 |
+ (*ppos + count > max_size) || |
602 |
+ (*ppos + count < count) || |
603 |
+- (count > uncopied_bytes)) |
604 |
++ (count > uncopied_bytes)) { |
605 |
++ kfree(buf); |
606 |
+ return -EINVAL; |
607 |
++ } |
608 |
+ |
609 |
+ if (copy_from_user(buf + (*ppos), user_buf, count)) { |
610 |
+ kfree(buf); |
611 |
+@@ -69,6 +71,7 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, |
612 |
+ add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, LOCKDEP_NOW_UNRELIABLE); |
613 |
+ } |
614 |
+ |
615 |
++ kfree(buf); |
616 |
+ return count; |
617 |
+ } |
618 |
+ |
619 |
+diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c |
620 |
+index c576a6fe4ebb..94ded9513c73 100644 |
621 |
+--- a/drivers/acpi/pci_irq.c |
622 |
++++ b/drivers/acpi/pci_irq.c |
623 |
+@@ -462,8 +462,10 @@ int acpi_pci_irq_enable(struct pci_dev *dev) |
624 |
+ * No IRQ known to the ACPI subsystem - maybe the BIOS / |
625 |
+ * driver reported one, then use it. Exit in any case. |
626 |
+ */ |
627 |
+- if (!acpi_pci_irq_valid(dev, pin)) |
628 |
++ if (!acpi_pci_irq_valid(dev, pin)) { |
629 |
++ kfree(entry); |
630 |
+ return 0; |
631 |
++ } |
632 |
+ |
633 |
+ if (acpi_isa_register_gsi(dev)) |
634 |
+ dev_warn(&dev->dev, "PCI INT %c: no GSI\n", |
635 |
+diff --git a/drivers/base/soc.c b/drivers/base/soc.c |
636 |
+index 909dedae4c4e..1242b2d2e01a 100644 |
637 |
+--- a/drivers/base/soc.c |
638 |
++++ b/drivers/base/soc.c |
639 |
+@@ -155,6 +155,7 @@ out2: |
640 |
+ out1: |
641 |
+ return ERR_PTR(ret); |
642 |
+ } |
643 |
++EXPORT_SYMBOL_GPL(soc_device_register); |
644 |
+ |
645 |
+ /* Ensure soc_dev->attr is freed prior to calling soc_device_unregister. */ |
646 |
+ void soc_device_unregister(struct soc_device *soc_dev) |
647 |
+@@ -164,6 +165,7 @@ void soc_device_unregister(struct soc_device *soc_dev) |
648 |
+ device_unregister(&soc_dev->dev); |
649 |
+ early_soc_dev_attr = NULL; |
650 |
+ } |
651 |
++EXPORT_SYMBOL_GPL(soc_device_unregister); |
652 |
+ |
653 |
+ static int __init soc_bus_register(void) |
654 |
+ { |
655 |
+diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c |
656 |
+index b77e9281c039..e4b049f281f5 100644 |
657 |
+--- a/drivers/block/nbd.c |
658 |
++++ b/drivers/block/nbd.c |
659 |
+@@ -340,8 +340,10 @@ static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req, |
660 |
+ } |
661 |
+ config = nbd->config; |
662 |
+ |
663 |
+- if (!mutex_trylock(&cmd->lock)) |
664 |
++ if (!mutex_trylock(&cmd->lock)) { |
665 |
++ nbd_config_put(nbd); |
666 |
+ return BLK_EH_RESET_TIMER; |
667 |
++ } |
668 |
+ |
669 |
+ if (config->num_connections > 1) { |
670 |
+ dev_err_ratelimited(nbd_to_dev(nbd), |
671 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
672 |
+index 7b5a06b27746..73561bfd95d4 100644 |
673 |
+--- a/drivers/bluetooth/btusb.c |
674 |
++++ b/drivers/bluetooth/btusb.c |
675 |
+@@ -388,6 +388,9 @@ static const struct usb_device_id blacklist_table[] = { |
676 |
+ /* Additional Realtek 8822BE Bluetooth devices */ |
677 |
+ { USB_DEVICE(0x0b05, 0x185c), .driver_info = BTUSB_REALTEK }, |
678 |
+ |
679 |
++ /* Additional Realtek 8822CE Bluetooth devices */ |
680 |
++ { USB_DEVICE(0x04ca, 0x4005), .driver_info = BTUSB_REALTEK }, |
681 |
++ |
682 |
+ /* Silicon Wave based devices */ |
683 |
+ { USB_DEVICE(0x0c10, 0x0000), .driver_info = BTUSB_SWAVE }, |
684 |
+ |
685 |
+diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c |
686 |
+index 9701ac7d8b47..21b98771312f 100644 |
687 |
+--- a/drivers/char/hw_random/core.c |
688 |
++++ b/drivers/char/hw_random/core.c |
689 |
+@@ -67,7 +67,7 @@ static void add_early_randomness(struct hwrng *rng) |
690 |
+ size_t size = min_t(size_t, 16, rng_buffer_size()); |
691 |
+ |
692 |
+ mutex_lock(&reading_mutex); |
693 |
+- bytes_read = rng_get_data(rng, rng_buffer, size, 1); |
694 |
++ bytes_read = rng_get_data(rng, rng_buffer, size, 0); |
695 |
+ mutex_unlock(&reading_mutex); |
696 |
+ if (bytes_read > 0) |
697 |
+ add_device_randomness(rng_buffer, bytes_read); |
698 |
+diff --git a/drivers/char/mem.c b/drivers/char/mem.c |
699 |
+index f11224a5dc5c..125404773646 100644 |
700 |
+--- a/drivers/char/mem.c |
701 |
++++ b/drivers/char/mem.c |
702 |
+@@ -97,6 +97,13 @@ void __weak unxlate_dev_mem_ptr(phys_addr_t phys, void *addr) |
703 |
+ } |
704 |
+ #endif |
705 |
+ |
706 |
++static inline bool should_stop_iteration(void) |
707 |
++{ |
708 |
++ if (need_resched()) |
709 |
++ cond_resched(); |
710 |
++ return fatal_signal_pending(current); |
711 |
++} |
712 |
++ |
713 |
+ /* |
714 |
+ * This funcion reads the *physical* memory. The f_pos points directly to the |
715 |
+ * memory location. |
716 |
+@@ -175,6 +182,8 @@ static ssize_t read_mem(struct file *file, char __user *buf, |
717 |
+ p += sz; |
718 |
+ count -= sz; |
719 |
+ read += sz; |
720 |
++ if (should_stop_iteration()) |
721 |
++ break; |
722 |
+ } |
723 |
+ kfree(bounce); |
724 |
+ |
725 |
+@@ -251,6 +260,8 @@ static ssize_t write_mem(struct file *file, const char __user *buf, |
726 |
+ p += sz; |
727 |
+ count -= sz; |
728 |
+ written += sz; |
729 |
++ if (should_stop_iteration()) |
730 |
++ break; |
731 |
+ } |
732 |
+ |
733 |
+ *ppos += written; |
734 |
+@@ -464,6 +475,10 @@ static ssize_t read_kmem(struct file *file, char __user *buf, |
735 |
+ read += sz; |
736 |
+ low_count -= sz; |
737 |
+ count -= sz; |
738 |
++ if (should_stop_iteration()) { |
739 |
++ count = 0; |
740 |
++ break; |
741 |
++ } |
742 |
+ } |
743 |
+ } |
744 |
+ |
745 |
+@@ -488,6 +503,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf, |
746 |
+ buf += sz; |
747 |
+ read += sz; |
748 |
+ p += sz; |
749 |
++ if (should_stop_iteration()) |
750 |
++ break; |
751 |
+ } |
752 |
+ free_page((unsigned long)kbuf); |
753 |
+ } |
754 |
+@@ -540,6 +557,8 @@ static ssize_t do_write_kmem(unsigned long p, const char __user *buf, |
755 |
+ p += sz; |
756 |
+ count -= sz; |
757 |
+ written += sz; |
758 |
++ if (should_stop_iteration()) |
759 |
++ break; |
760 |
+ } |
761 |
+ |
762 |
+ *ppos += written; |
763 |
+@@ -591,6 +610,8 @@ static ssize_t write_kmem(struct file *file, const char __user *buf, |
764 |
+ buf += sz; |
765 |
+ virtr += sz; |
766 |
+ p += sz; |
767 |
++ if (should_stop_iteration()) |
768 |
++ break; |
769 |
+ } |
770 |
+ free_page((unsigned long)kbuf); |
771 |
+ } |
772 |
+diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c |
773 |
+index 3465a440ca02..fef2b306cdee 100644 |
774 |
+--- a/drivers/crypto/talitos.c |
775 |
++++ b/drivers/crypto/talitos.c |
776 |
+@@ -3043,6 +3043,7 @@ static int talitos_remove(struct platform_device *ofdev) |
777 |
+ break; |
778 |
+ case CRYPTO_ALG_TYPE_AEAD: |
779 |
+ crypto_unregister_aead(&t_alg->algt.alg.aead); |
780 |
++ break; |
781 |
+ case CRYPTO_ALG_TYPE_AHASH: |
782 |
+ crypto_unregister_ahash(&t_alg->algt.alg.hash); |
783 |
+ break; |
784 |
+diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c |
785 |
+index 49f68929e024..25ff31eb1044 100644 |
786 |
+--- a/drivers/devfreq/exynos-bus.c |
787 |
++++ b/drivers/devfreq/exynos-bus.c |
788 |
+@@ -194,11 +194,10 @@ static void exynos_bus_exit(struct device *dev) |
789 |
+ if (ret < 0) |
790 |
+ dev_warn(dev, "failed to disable the devfreq-event devices\n"); |
791 |
+ |
792 |
+- if (bus->regulator) |
793 |
+- regulator_disable(bus->regulator); |
794 |
+- |
795 |
+ dev_pm_opp_of_remove_table(dev); |
796 |
+ clk_disable_unprepare(bus->clk); |
797 |
++ if (bus->regulator) |
798 |
++ regulator_disable(bus->regulator); |
799 |
+ } |
800 |
+ |
801 |
+ /* |
802 |
+@@ -386,6 +385,7 @@ static int exynos_bus_probe(struct platform_device *pdev) |
803 |
+ struct exynos_bus *bus; |
804 |
+ int ret, max_state; |
805 |
+ unsigned long min_freq, max_freq; |
806 |
++ bool passive = false; |
807 |
+ |
808 |
+ if (!np) { |
809 |
+ dev_err(dev, "failed to find devicetree node\n"); |
810 |
+@@ -399,27 +399,27 @@ static int exynos_bus_probe(struct platform_device *pdev) |
811 |
+ bus->dev = &pdev->dev; |
812 |
+ platform_set_drvdata(pdev, bus); |
813 |
+ |
814 |
+- /* Parse the device-tree to get the resource information */ |
815 |
+- ret = exynos_bus_parse_of(np, bus); |
816 |
+- if (ret < 0) |
817 |
+- return ret; |
818 |
+- |
819 |
+ profile = devm_kzalloc(dev, sizeof(*profile), GFP_KERNEL); |
820 |
+- if (!profile) { |
821 |
+- ret = -ENOMEM; |
822 |
+- goto err; |
823 |
+- } |
824 |
++ if (!profile) |
825 |
++ return -ENOMEM; |
826 |
+ |
827 |
+ node = of_parse_phandle(dev->of_node, "devfreq", 0); |
828 |
+ if (node) { |
829 |
+ of_node_put(node); |
830 |
+- goto passive; |
831 |
++ passive = true; |
832 |
+ } else { |
833 |
+ ret = exynos_bus_parent_parse_of(np, bus); |
834 |
++ if (ret < 0) |
835 |
++ return ret; |
836 |
+ } |
837 |
+ |
838 |
++ /* Parse the device-tree to get the resource information */ |
839 |
++ ret = exynos_bus_parse_of(np, bus); |
840 |
+ if (ret < 0) |
841 |
+- goto err; |
842 |
++ goto err_reg; |
843 |
++ |
844 |
++ if (passive) |
845 |
++ goto passive; |
846 |
+ |
847 |
+ /* Initialize the struct profile and governor data for parent device */ |
848 |
+ profile->polling_ms = 50; |
849 |
+@@ -509,6 +509,9 @@ out: |
850 |
+ err: |
851 |
+ dev_pm_opp_of_remove_table(dev); |
852 |
+ clk_disable_unprepare(bus->clk); |
853 |
++err_reg: |
854 |
++ if (!passive) |
855 |
++ regulator_disable(bus->regulator); |
856 |
+ |
857 |
+ return ret; |
858 |
+ } |
859 |
+diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c |
860 |
+index 673ad8cc9a1d..d2ebdb7fd751 100644 |
861 |
+--- a/drivers/devfreq/governor_passive.c |
862 |
++++ b/drivers/devfreq/governor_passive.c |
863 |
+@@ -152,7 +152,6 @@ static int devfreq_passive_notifier_call(struct notifier_block *nb, |
864 |
+ static int devfreq_passive_event_handler(struct devfreq *devfreq, |
865 |
+ unsigned int event, void *data) |
866 |
+ { |
867 |
+- struct device *dev = devfreq->dev.parent; |
868 |
+ struct devfreq_passive_data *p_data |
869 |
+ = (struct devfreq_passive_data *)devfreq->data; |
870 |
+ struct devfreq *parent = (struct devfreq *)p_data->parent; |
871 |
+@@ -168,12 +167,12 @@ static int devfreq_passive_event_handler(struct devfreq *devfreq, |
872 |
+ p_data->this = devfreq; |
873 |
+ |
874 |
+ nb->notifier_call = devfreq_passive_notifier_call; |
875 |
+- ret = devm_devfreq_register_notifier(dev, parent, nb, |
876 |
++ ret = devfreq_register_notifier(parent, nb, |
877 |
+ DEVFREQ_TRANSITION_NOTIFIER); |
878 |
+ break; |
879 |
+ case DEVFREQ_GOV_STOP: |
880 |
+- devm_devfreq_unregister_notifier(dev, parent, nb, |
881 |
+- DEVFREQ_TRANSITION_NOTIFIER); |
882 |
++ WARN_ON(devfreq_unregister_notifier(parent, nb, |
883 |
++ DEVFREQ_TRANSITION_NOTIFIER)); |
884 |
+ break; |
885 |
+ default: |
886 |
+ break; |
887 |
+diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c |
888 |
+index 6ba53bbd0e16..b984d00bc055 100644 |
889 |
+--- a/drivers/dma/bcm2835-dma.c |
890 |
++++ b/drivers/dma/bcm2835-dma.c |
891 |
+@@ -891,8 +891,10 @@ static int bcm2835_dma_probe(struct platform_device *pdev) |
892 |
+ pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; |
893 |
+ |
894 |
+ rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); |
895 |
+- if (rc) |
896 |
++ if (rc) { |
897 |
++ dev_err(&pdev->dev, "Unable to set DMA mask\n"); |
898 |
+ return rc; |
899 |
++ } |
900 |
+ |
901 |
+ od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL); |
902 |
+ if (!od) |
903 |
+diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c |
904 |
+index a7ea20e7b8e9..519c24465dea 100644 |
905 |
+--- a/drivers/dma/edma.c |
906 |
++++ b/drivers/dma/edma.c |
907 |
+@@ -2268,9 +2268,6 @@ static int edma_probe(struct platform_device *pdev) |
908 |
+ |
909 |
+ ecc->default_queue = info->default_queue; |
910 |
+ |
911 |
+- for (i = 0; i < ecc->num_slots; i++) |
912 |
+- edma_write_slot(ecc, i, &dummy_paramset); |
913 |
+- |
914 |
+ if (info->rsv) { |
915 |
+ /* Set the reserved slots in inuse list */ |
916 |
+ rsv_slots = info->rsv->rsv_slots; |
917 |
+@@ -2283,6 +2280,12 @@ static int edma_probe(struct platform_device *pdev) |
918 |
+ } |
919 |
+ } |
920 |
+ |
921 |
++ for (i = 0; i < ecc->num_slots; i++) { |
922 |
++ /* Reset only unused - not reserved - paRAM slots */ |
923 |
++ if (!test_bit(i, ecc->slot_inuse)) |
924 |
++ edma_write_slot(ecc, i, &dummy_paramset); |
925 |
++ } |
926 |
++ |
927 |
+ /* Clear the xbar mapped channels in unused list */ |
928 |
+ xbar_chans = info->xbar_chans; |
929 |
+ if (xbar_chans) { |
930 |
+diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c |
931 |
+index a410657f7bcd..012584cf3c17 100644 |
932 |
+--- a/drivers/dma/iop-adma.c |
933 |
++++ b/drivers/dma/iop-adma.c |
934 |
+@@ -125,9 +125,9 @@ static void __iop_adma_slot_cleanup(struct iop_adma_chan *iop_chan) |
935 |
+ list_for_each_entry_safe(iter, _iter, &iop_chan->chain, |
936 |
+ chain_node) { |
937 |
+ pr_debug("\tcookie: %d slot: %d busy: %d " |
938 |
+- "this_desc: %#x next_desc: %#x ack: %d\n", |
939 |
++ "this_desc: %#x next_desc: %#llx ack: %d\n", |
940 |
+ iter->async_tx.cookie, iter->idx, busy, |
941 |
+- iter->async_tx.phys, iop_desc_get_next_desc(iter), |
942 |
++ iter->async_tx.phys, (u64)iop_desc_get_next_desc(iter), |
943 |
+ async_tx_test_ack(&iter->async_tx)); |
944 |
+ prefetch(_iter); |
945 |
+ prefetch(&_iter->async_tx); |
946 |
+@@ -315,9 +315,9 @@ retry: |
947 |
+ int i; |
948 |
+ dev_dbg(iop_chan->device->common.dev, |
949 |
+ "allocated slot: %d " |
950 |
+- "(desc %p phys: %#x) slots_per_op %d\n", |
951 |
++ "(desc %p phys: %#llx) slots_per_op %d\n", |
952 |
+ iter->idx, iter->hw_desc, |
953 |
+- iter->async_tx.phys, slots_per_op); |
954 |
++ (u64)iter->async_tx.phys, slots_per_op); |
955 |
+ |
956 |
+ /* pre-ack all but the last descriptor */ |
957 |
+ if (num_slots != slots_per_op) |
958 |
+@@ -525,7 +525,7 @@ iop_adma_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dma_dest, |
959 |
+ return NULL; |
960 |
+ BUG_ON(len > IOP_ADMA_MAX_BYTE_COUNT); |
961 |
+ |
962 |
+- dev_dbg(iop_chan->device->common.dev, "%s len: %u\n", |
963 |
++ dev_dbg(iop_chan->device->common.dev, "%s len: %zu\n", |
964 |
+ __func__, len); |
965 |
+ |
966 |
+ spin_lock_bh(&iop_chan->lock); |
967 |
+@@ -558,7 +558,7 @@ iop_adma_prep_dma_xor(struct dma_chan *chan, dma_addr_t dma_dest, |
968 |
+ BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); |
969 |
+ |
970 |
+ dev_dbg(iop_chan->device->common.dev, |
971 |
+- "%s src_cnt: %d len: %u flags: %lx\n", |
972 |
++ "%s src_cnt: %d len: %zu flags: %lx\n", |
973 |
+ __func__, src_cnt, len, flags); |
974 |
+ |
975 |
+ spin_lock_bh(&iop_chan->lock); |
976 |
+@@ -591,7 +591,7 @@ iop_adma_prep_dma_xor_val(struct dma_chan *chan, dma_addr_t *dma_src, |
977 |
+ if (unlikely(!len)) |
978 |
+ return NULL; |
979 |
+ |
980 |
+- dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %u\n", |
981 |
++ dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %zu\n", |
982 |
+ __func__, src_cnt, len); |
983 |
+ |
984 |
+ spin_lock_bh(&iop_chan->lock); |
985 |
+@@ -629,7 +629,7 @@ iop_adma_prep_dma_pq(struct dma_chan *chan, dma_addr_t *dst, dma_addr_t *src, |
986 |
+ BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); |
987 |
+ |
988 |
+ dev_dbg(iop_chan->device->common.dev, |
989 |
+- "%s src_cnt: %d len: %u flags: %lx\n", |
990 |
++ "%s src_cnt: %d len: %zu flags: %lx\n", |
991 |
+ __func__, src_cnt, len, flags); |
992 |
+ |
993 |
+ if (dmaf_p_disabled_continue(flags)) |
994 |
+@@ -692,7 +692,7 @@ iop_adma_prep_dma_pq_val(struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src, |
995 |
+ return NULL; |
996 |
+ BUG_ON(len > IOP_ADMA_XOR_MAX_BYTE_COUNT); |
997 |
+ |
998 |
+- dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %u\n", |
999 |
++ dev_dbg(iop_chan->device->common.dev, "%s src_cnt: %d len: %zu\n", |
1000 |
+ __func__, src_cnt, len); |
1001 |
+ |
1002 |
+ spin_lock_bh(&iop_chan->lock); |
1003 |
+diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c |
1004 |
+index 38983f56ad0d..d92090b127de 100644 |
1005 |
+--- a/drivers/edac/altera_edac.c |
1006 |
++++ b/drivers/edac/altera_edac.c |
1007 |
+@@ -1646,6 +1646,7 @@ static void altr_edac_a10_irq_handler(struct irq_desc *desc) |
1008 |
+ struct altr_arria10_edac *edac = irq_desc_get_handler_data(desc); |
1009 |
+ struct irq_chip *chip = irq_desc_get_chip(desc); |
1010 |
+ int irq = irq_desc_get_irq(desc); |
1011 |
++ unsigned long bits; |
1012 |
+ |
1013 |
+ dberr = (irq == edac->db_irq) ? 1 : 0; |
1014 |
+ sm_offset = dberr ? A10_SYSMGR_ECC_INTSTAT_DERR_OFST : |
1015 |
+@@ -1655,7 +1656,8 @@ static void altr_edac_a10_irq_handler(struct irq_desc *desc) |
1016 |
+ |
1017 |
+ regmap_read(edac->ecc_mgr_map, sm_offset, &irq_status); |
1018 |
+ |
1019 |
+- for_each_set_bit(bit, (unsigned long *)&irq_status, 32) { |
1020 |
++ bits = irq_status; |
1021 |
++ for_each_set_bit(bit, &bits, 32) { |
1022 |
+ irq = irq_linear_revmap(edac->domain, dberr * 32 + bit); |
1023 |
+ if (irq) |
1024 |
+ generic_handle_irq(irq); |
1025 |
+diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c |
1026 |
+index 667f5ba0403c..40fb0e7ff8fd 100644 |
1027 |
+--- a/drivers/edac/amd64_edac.c |
1028 |
++++ b/drivers/edac/amd64_edac.c |
1029 |
+@@ -2501,13 +2501,6 @@ static void decode_umc_error(int node_id, struct mce *m) |
1030 |
+ goto log_error; |
1031 |
+ } |
1032 |
+ |
1033 |
+- if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, err.channel, &sys_addr)) { |
1034 |
+- err.err_code = ERR_NORM_ADDR; |
1035 |
+- goto log_error; |
1036 |
+- } |
1037 |
+- |
1038 |
+- error_address_to_page_and_offset(sys_addr, &err); |
1039 |
+- |
1040 |
+ if (!(m->status & MCI_STATUS_SYNDV)) { |
1041 |
+ err.err_code = ERR_SYND; |
1042 |
+ goto log_error; |
1043 |
+@@ -2524,6 +2517,13 @@ static void decode_umc_error(int node_id, struct mce *m) |
1044 |
+ |
1045 |
+ err.csrow = m->synd & 0x7; |
1046 |
+ |
1047 |
++ if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, err.channel, &sys_addr)) { |
1048 |
++ err.err_code = ERR_NORM_ADDR; |
1049 |
++ goto log_error; |
1050 |
++ } |
1051 |
++ |
1052 |
++ error_address_to_page_and_offset(sys_addr, &err); |
1053 |
++ |
1054 |
+ log_error: |
1055 |
+ __log_ecc_error(mci, &err, ecc_type); |
1056 |
+ } |
1057 |
+@@ -3101,12 +3101,15 @@ static bool ecc_enabled(struct pci_dev *F3, u16 nid) |
1058 |
+ static inline void |
1059 |
+ f17h_determine_edac_ctl_cap(struct mem_ctl_info *mci, struct amd64_pvt *pvt) |
1060 |
+ { |
1061 |
+- u8 i, ecc_en = 1, cpk_en = 1; |
1062 |
++ u8 i, ecc_en = 1, cpk_en = 1, dev_x4 = 1, dev_x16 = 1; |
1063 |
+ |
1064 |
+ for (i = 0; i < NUM_UMCS; i++) { |
1065 |
+ if (pvt->umc[i].sdp_ctrl & UMC_SDP_INIT) { |
1066 |
+ ecc_en &= !!(pvt->umc[i].umc_cap_hi & UMC_ECC_ENABLED); |
1067 |
+ cpk_en &= !!(pvt->umc[i].umc_cap_hi & UMC_ECC_CHIPKILL_CAP); |
1068 |
++ |
1069 |
++ dev_x4 &= !!(pvt->umc[i].dimm_cfg & BIT(6)); |
1070 |
++ dev_x16 &= !!(pvt->umc[i].dimm_cfg & BIT(7)); |
1071 |
+ } |
1072 |
+ } |
1073 |
+ |
1074 |
+@@ -3114,8 +3117,15 @@ f17h_determine_edac_ctl_cap(struct mem_ctl_info *mci, struct amd64_pvt *pvt) |
1075 |
+ if (ecc_en) { |
1076 |
+ mci->edac_ctl_cap |= EDAC_FLAG_SECDED; |
1077 |
+ |
1078 |
+- if (cpk_en) |
1079 |
++ if (!cpk_en) |
1080 |
++ return; |
1081 |
++ |
1082 |
++ if (dev_x4) |
1083 |
+ mci->edac_ctl_cap |= EDAC_FLAG_S4ECD4ED; |
1084 |
++ else if (dev_x16) |
1085 |
++ mci->edac_ctl_cap |= EDAC_FLAG_S16ECD16ED; |
1086 |
++ else |
1087 |
++ mci->edac_ctl_cap |= EDAC_FLAG_S8ECD8ED; |
1088 |
+ } |
1089 |
+ } |
1090 |
+ |
1091 |
+diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c |
1092 |
+index 80801c616395..f7fa05fee45a 100644 |
1093 |
+--- a/drivers/edac/edac_mc.c |
1094 |
++++ b/drivers/edac/edac_mc.c |
1095 |
+@@ -1240,9 +1240,13 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type, |
1096 |
+ if (p > e->location) |
1097 |
+ *(p - 1) = '\0'; |
1098 |
+ |
1099 |
+- /* Report the error via the trace interface */ |
1100 |
+- grain_bits = fls_long(e->grain) + 1; |
1101 |
++ /* Sanity-check driver-supplied grain value. */ |
1102 |
++ if (WARN_ON_ONCE(!e->grain)) |
1103 |
++ e->grain = 1; |
1104 |
++ |
1105 |
++ grain_bits = fls_long(e->grain - 1); |
1106 |
+ |
1107 |
++ /* Report the error via the trace interface */ |
1108 |
+ if (IS_ENABLED(CONFIG_RAS)) |
1109 |
+ trace_mc_event(type, e->msg, e->label, e->error_count, |
1110 |
+ mci->mc_idx, e->top_layer, e->mid_layer, |
1111 |
+diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c |
1112 |
+index 7f9bb9d9fcdc..641ff19b2f57 100644 |
1113 |
+--- a/drivers/edac/pnd2_edac.c |
1114 |
++++ b/drivers/edac/pnd2_edac.c |
1115 |
+@@ -266,11 +266,14 @@ static u64 get_sideband_reg_base_addr(void) |
1116 |
+ } |
1117 |
+ } |
1118 |
+ |
1119 |
++#define DNV_MCHBAR_SIZE 0x8000 |
1120 |
++#define DNV_SB_PORT_SIZE 0x10000 |
1121 |
+ static int dnv_rd_reg(int port, int off, int op, void *data, size_t sz, char *name) |
1122 |
+ { |
1123 |
+ struct pci_dev *pdev; |
1124 |
+ char *base; |
1125 |
+ u64 addr; |
1126 |
++ unsigned long size; |
1127 |
+ |
1128 |
+ if (op == 4) { |
1129 |
+ pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x1980, NULL); |
1130 |
+@@ -285,15 +288,17 @@ static int dnv_rd_reg(int port, int off, int op, void *data, size_t sz, char *na |
1131 |
+ addr = get_mem_ctrl_hub_base_addr(); |
1132 |
+ if (!addr) |
1133 |
+ return -ENODEV; |
1134 |
++ size = DNV_MCHBAR_SIZE; |
1135 |
+ } else { |
1136 |
+ /* MMIO via sideband register base address */ |
1137 |
+ addr = get_sideband_reg_base_addr(); |
1138 |
+ if (!addr) |
1139 |
+ return -ENODEV; |
1140 |
+ addr += (port << 16); |
1141 |
++ size = DNV_SB_PORT_SIZE; |
1142 |
+ } |
1143 |
+ |
1144 |
+- base = ioremap((resource_size_t)addr, 0x10000); |
1145 |
++ base = ioremap((resource_size_t)addr, size); |
1146 |
+ if (!base) |
1147 |
+ return -ENODEV; |
1148 |
+ |
1149 |
+diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c |
1150 |
+index ce23d5402bd6..db404aab82b2 100644 |
1151 |
+--- a/drivers/firmware/efi/cper.c |
1152 |
++++ b/drivers/firmware/efi/cper.c |
1153 |
+@@ -507,6 +507,21 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, |
1154 |
+ printk( |
1155 |
+ "%s""bridge: secondary_status: 0x%04x, control: 0x%04x\n", |
1156 |
+ pfx, pcie->bridge.secondary_status, pcie->bridge.control); |
1157 |
++ |
1158 |
++ /* Fatal errors call __ghes_panic() before AER handler prints this */ |
1159 |
++ if ((pcie->validation_bits & CPER_PCIE_VALID_AER_INFO) && |
1160 |
++ (gdata->error_severity & CPER_SEV_FATAL)) { |
1161 |
++ struct aer_capability_regs *aer; |
1162 |
++ |
1163 |
++ aer = (struct aer_capability_regs *)pcie->aer_info; |
1164 |
++ printk("%saer_uncor_status: 0x%08x, aer_uncor_mask: 0x%08x\n", |
1165 |
++ pfx, aer->uncor_status, aer->uncor_mask); |
1166 |
++ printk("%saer_uncor_severity: 0x%08x\n", |
1167 |
++ pfx, aer->uncor_severity); |
1168 |
++ printk("%sTLP Header: %08x %08x %08x %08x\n", pfx, |
1169 |
++ aer->header_log.dw0, aer->header_log.dw1, |
1170 |
++ aer->header_log.dw2, aer->header_log.dw3); |
1171 |
++ } |
1172 |
+ } |
1173 |
+ |
1174 |
+ static void cper_print_tstamp(const char *pfx, |
1175 |
+diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c |
1176 |
+index 336fdd8c7db0..61141bc3edfe 100644 |
1177 |
+--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c |
1178 |
++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c |
1179 |
+@@ -3972,6 +3972,11 @@ static int smu7_program_display_gap(struct pp_hwmgr *hwmgr) |
1180 |
+ |
1181 |
+ data->frame_time_x2 = frame_time_in_us * 2 / 100; |
1182 |
+ |
1183 |
++ if (data->frame_time_x2 < 280) { |
1184 |
++ pr_debug("%s: enforce minimal VBITimeout: %d -> 280\n", __func__, data->frame_time_x2); |
1185 |
++ data->frame_time_x2 = 280; |
1186 |
++ } |
1187 |
++ |
1188 |
+ display_gap2 = pre_vbi_time_in_us * (ref_clock / 100); |
1189 |
+ |
1190 |
+ cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixCG_DISPLAY_GAP_CNTL2, display_gap2); |
1191 |
+diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c |
1192 |
+index d29fd8443fed..adbabf16c07b 100644 |
1193 |
+--- a/drivers/gpu/drm/drm_probe_helper.c |
1194 |
++++ b/drivers/gpu/drm/drm_probe_helper.c |
1195 |
+@@ -593,6 +593,9 @@ static void output_poll_execute(struct work_struct *work) |
1196 |
+ enum drm_connector_status old_status; |
1197 |
+ bool repoll = false, changed; |
1198 |
+ |
1199 |
++ if (!dev->mode_config.poll_enabled) |
1200 |
++ return; |
1201 |
++ |
1202 |
+ /* Pick up any changes detected by the probe functions. */ |
1203 |
+ changed = dev->mode_config.delayed_event; |
1204 |
+ dev->mode_config.delayed_event = false; |
1205 |
+@@ -747,7 +750,11 @@ EXPORT_SYMBOL(drm_kms_helper_poll_init); |
1206 |
+ */ |
1207 |
+ void drm_kms_helper_poll_fini(struct drm_device *dev) |
1208 |
+ { |
1209 |
+- drm_kms_helper_poll_disable(dev); |
1210 |
++ if (!dev->mode_config.poll_enabled) |
1211 |
++ return; |
1212 |
++ |
1213 |
++ dev->mode_config.poll_enabled = false; |
1214 |
++ cancel_delayed_work_sync(&dev->mode_config.output_poll_work); |
1215 |
+ } |
1216 |
+ EXPORT_SYMBOL(drm_kms_helper_poll_fini); |
1217 |
+ |
1218 |
+diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c |
1219 |
+index 52026dc94d5c..7e55d3f755dd 100644 |
1220 |
+--- a/drivers/hid/hid-lg.c |
1221 |
++++ b/drivers/hid/hid-lg.c |
1222 |
+@@ -761,7 +761,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) |
1223 |
+ |
1224 |
+ if (!buf) { |
1225 |
+ ret = -ENOMEM; |
1226 |
+- goto err_free; |
1227 |
++ goto err_stop; |
1228 |
+ } |
1229 |
+ |
1230 |
+ ret = hid_hw_raw_request(hdev, buf[0], buf, sizeof(cbuf), |
1231 |
+@@ -793,9 +793,12 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) |
1232 |
+ ret = lg4ff_init(hdev); |
1233 |
+ |
1234 |
+ if (ret) |
1235 |
+- goto err_free; |
1236 |
++ goto err_stop; |
1237 |
+ |
1238 |
+ return 0; |
1239 |
++ |
1240 |
++err_stop: |
1241 |
++ hid_hw_stop(hdev); |
1242 |
+ err_free: |
1243 |
+ kfree(drv_data); |
1244 |
+ return ret; |
1245 |
+@@ -806,8 +809,7 @@ static void lg_remove(struct hid_device *hdev) |
1246 |
+ struct lg_drv_data *drv_data = hid_get_drvdata(hdev); |
1247 |
+ if (drv_data->quirks & LG_FF4) |
1248 |
+ lg4ff_deinit(hdev); |
1249 |
+- else |
1250 |
+- hid_hw_stop(hdev); |
1251 |
++ hid_hw_stop(hdev); |
1252 |
+ kfree(drv_data); |
1253 |
+ } |
1254 |
+ |
1255 |
+diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c |
1256 |
+index 1fc12e357035..127f1335a1da 100644 |
1257 |
+--- a/drivers/hid/hid-lg4ff.c |
1258 |
++++ b/drivers/hid/hid-lg4ff.c |
1259 |
+@@ -1485,7 +1485,6 @@ int lg4ff_deinit(struct hid_device *hid) |
1260 |
+ } |
1261 |
+ } |
1262 |
+ #endif |
1263 |
+- hid_hw_stop(hid); |
1264 |
+ drv_data->device_props = NULL; |
1265 |
+ |
1266 |
+ kfree(entry); |
1267 |
+diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c |
1268 |
+index 49c4bd34b3c5..205f68251ac0 100644 |
1269 |
+--- a/drivers/hid/hid-prodikeys.c |
1270 |
++++ b/drivers/hid/hid-prodikeys.c |
1271 |
+@@ -556,10 +556,14 @@ static void pcmidi_setup_extra_keys( |
1272 |
+ |
1273 |
+ static int pcmidi_set_operational(struct pcmidi_snd *pm) |
1274 |
+ { |
1275 |
++ int rc; |
1276 |
++ |
1277 |
+ if (pm->ifnum != 1) |
1278 |
+ return 0; /* only set up ONCE for interace 1 */ |
1279 |
+ |
1280 |
+- pcmidi_get_output_report(pm); |
1281 |
++ rc = pcmidi_get_output_report(pm); |
1282 |
++ if (rc < 0) |
1283 |
++ return rc; |
1284 |
+ pcmidi_submit_output_report(pm, 0xc1); |
1285 |
+ return 0; |
1286 |
+ } |
1287 |
+@@ -688,7 +692,11 @@ static int pcmidi_snd_initialise(struct pcmidi_snd *pm) |
1288 |
+ spin_lock_init(&pm->rawmidi_in_lock); |
1289 |
+ |
1290 |
+ init_sustain_timers(pm); |
1291 |
+- pcmidi_set_operational(pm); |
1292 |
++ err = pcmidi_set_operational(pm); |
1293 |
++ if (err < 0) { |
1294 |
++ pk_error("failed to find output report\n"); |
1295 |
++ goto fail_register; |
1296 |
++ } |
1297 |
+ |
1298 |
+ /* register it */ |
1299 |
+ err = snd_card_register(card); |
1300 |
+diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c |
1301 |
+index 51f7bcd799fa..6ce9b5e1a06f 100644 |
1302 |
+--- a/drivers/hid/hid-sony.c |
1303 |
++++ b/drivers/hid/hid-sony.c |
1304 |
+@@ -2710,7 +2710,6 @@ err_stop: |
1305 |
+ kfree(sc->output_report_dmabuf); |
1306 |
+ sony_remove_dev_list(sc); |
1307 |
+ sony_release_device_id(sc); |
1308 |
+- hid_hw_stop(hdev); |
1309 |
+ return ret; |
1310 |
+ } |
1311 |
+ |
1312 |
+@@ -2772,6 +2771,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) |
1313 |
+ */ |
1314 |
+ if (!(hdev->claimed & HID_CLAIMED_INPUT)) { |
1315 |
+ hid_err(hdev, "failed to claim input\n"); |
1316 |
++ hid_hw_stop(hdev); |
1317 |
+ return -ENODEV; |
1318 |
+ } |
1319 |
+ |
1320 |
+diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c |
1321 |
+index 01b5a9f01814..5652bd0ffb4d 100644 |
1322 |
+--- a/drivers/hid/hidraw.c |
1323 |
++++ b/drivers/hid/hidraw.c |
1324 |
+@@ -378,7 +378,7 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd, |
1325 |
+ |
1326 |
+ mutex_lock(&minors_lock); |
1327 |
+ dev = hidraw_table[minor]; |
1328 |
+- if (!dev) { |
1329 |
++ if (!dev || !dev->exist) { |
1330 |
+ ret = -ENODEV; |
1331 |
+ goto out; |
1332 |
+ } |
1333 |
+diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c |
1334 |
+index 14a94d90c028..ba3af4505d8f 100644 |
1335 |
+--- a/drivers/hwmon/acpi_power_meter.c |
1336 |
++++ b/drivers/hwmon/acpi_power_meter.c |
1337 |
+@@ -693,8 +693,8 @@ static int setup_attrs(struct acpi_power_meter_resource *resource) |
1338 |
+ |
1339 |
+ if (resource->caps.flags & POWER_METER_CAN_CAP) { |
1340 |
+ if (!can_cap_in_hardware()) { |
1341 |
+- dev_err(&resource->acpi_dev->dev, |
1342 |
+- "Ignoring unsafe software power cap!\n"); |
1343 |
++ dev_warn(&resource->acpi_dev->dev, |
1344 |
++ "Ignoring unsafe software power cap!\n"); |
1345 |
+ goto skip_unsafe_cap; |
1346 |
+ } |
1347 |
+ |
1348 |
+diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c |
1349 |
+index c811af4c8d81..e420b41a34ba 100644 |
1350 |
+--- a/drivers/i2c/busses/i2c-riic.c |
1351 |
++++ b/drivers/i2c/busses/i2c-riic.c |
1352 |
+@@ -212,6 +212,7 @@ static irqreturn_t riic_tend_isr(int irq, void *data) |
1353 |
+ if (readb(riic->base + RIIC_ICSR2) & ICSR2_NACKF) { |
1354 |
+ /* We got a NACKIE */ |
1355 |
+ readb(riic->base + RIIC_ICDRR); /* dummy read */ |
1356 |
++ riic_clear_set_bit(riic, ICSR2_NACKF, 0, RIIC_ICSR2); |
1357 |
+ riic->err = -ENXIO; |
1358 |
+ } else if (riic->bytes_left) { |
1359 |
+ return IRQ_NONE; |
1360 |
+diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c |
1361 |
+index 757d308bebe8..88c54db16f29 100644 |
1362 |
+--- a/drivers/infiniband/core/cq.c |
1363 |
++++ b/drivers/infiniband/core/cq.c |
1364 |
+@@ -112,12 +112,12 @@ static void ib_cq_poll_work(struct work_struct *work) |
1365 |
+ IB_POLL_BATCH); |
1366 |
+ if (completed >= IB_POLL_BUDGET_WORKQUEUE || |
1367 |
+ ib_req_notify_cq(cq, IB_POLL_FLAGS) > 0) |
1368 |
+- queue_work(ib_comp_wq, &cq->work); |
1369 |
++ queue_work(cq->comp_wq, &cq->work); |
1370 |
+ } |
1371 |
+ |
1372 |
+ static void ib_cq_completion_workqueue(struct ib_cq *cq, void *private) |
1373 |
+ { |
1374 |
+- queue_work(ib_comp_wq, &cq->work); |
1375 |
++ queue_work(cq->comp_wq, &cq->work); |
1376 |
+ } |
1377 |
+ |
1378 |
+ /** |
1379 |
+@@ -169,9 +169,12 @@ struct ib_cq *ib_alloc_cq(struct ib_device *dev, void *private, |
1380 |
+ ib_req_notify_cq(cq, IB_CQ_NEXT_COMP); |
1381 |
+ break; |
1382 |
+ case IB_POLL_WORKQUEUE: |
1383 |
++ case IB_POLL_UNBOUND_WORKQUEUE: |
1384 |
+ cq->comp_handler = ib_cq_completion_workqueue; |
1385 |
+ INIT_WORK(&cq->work, ib_cq_poll_work); |
1386 |
+ ib_req_notify_cq(cq, IB_CQ_NEXT_COMP); |
1387 |
++ cq->comp_wq = (cq->poll_ctx == IB_POLL_WORKQUEUE) ? |
1388 |
++ ib_comp_wq : ib_comp_unbound_wq; |
1389 |
+ break; |
1390 |
+ default: |
1391 |
+ ret = -EINVAL; |
1392 |
+@@ -206,6 +209,7 @@ void ib_free_cq(struct ib_cq *cq) |
1393 |
+ irq_poll_disable(&cq->iop); |
1394 |
+ break; |
1395 |
+ case IB_POLL_WORKQUEUE: |
1396 |
++ case IB_POLL_UNBOUND_WORKQUEUE: |
1397 |
+ cancel_work_sync(&cq->work); |
1398 |
+ break; |
1399 |
+ default: |
1400 |
+diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c |
1401 |
+index 4dff06ab771e..61ade4b3e7bb 100644 |
1402 |
+--- a/drivers/infiniband/core/device.c |
1403 |
++++ b/drivers/infiniband/core/device.c |
1404 |
+@@ -61,6 +61,7 @@ struct ib_client_data { |
1405 |
+ }; |
1406 |
+ |
1407 |
+ struct workqueue_struct *ib_comp_wq; |
1408 |
++struct workqueue_struct *ib_comp_unbound_wq; |
1409 |
+ struct workqueue_struct *ib_wq; |
1410 |
+ EXPORT_SYMBOL_GPL(ib_wq); |
1411 |
+ |
1412 |
+@@ -1202,10 +1203,19 @@ static int __init ib_core_init(void) |
1413 |
+ goto err; |
1414 |
+ } |
1415 |
+ |
1416 |
++ ib_comp_unbound_wq = |
1417 |
++ alloc_workqueue("ib-comp-unb-wq", |
1418 |
++ WQ_UNBOUND | WQ_HIGHPRI | WQ_MEM_RECLAIM | |
1419 |
++ WQ_SYSFS, WQ_UNBOUND_MAX_ACTIVE); |
1420 |
++ if (!ib_comp_unbound_wq) { |
1421 |
++ ret = -ENOMEM; |
1422 |
++ goto err_comp; |
1423 |
++ } |
1424 |
++ |
1425 |
+ ret = class_register(&ib_class); |
1426 |
+ if (ret) { |
1427 |
+ pr_warn("Couldn't create InfiniBand device class\n"); |
1428 |
+- goto err_comp; |
1429 |
++ goto err_comp_unbound; |
1430 |
+ } |
1431 |
+ |
1432 |
+ ret = rdma_nl_init(); |
1433 |
+@@ -1254,6 +1264,8 @@ err_ibnl: |
1434 |
+ rdma_nl_exit(); |
1435 |
+ err_sysfs: |
1436 |
+ class_unregister(&ib_class); |
1437 |
++err_comp_unbound: |
1438 |
++ destroy_workqueue(ib_comp_unbound_wq); |
1439 |
+ err_comp: |
1440 |
+ destroy_workqueue(ib_comp_wq); |
1441 |
+ err: |
1442 |
+@@ -1272,6 +1284,7 @@ static void __exit ib_core_cleanup(void) |
1443 |
+ addr_cleanup(); |
1444 |
+ rdma_nl_exit(); |
1445 |
+ class_unregister(&ib_class); |
1446 |
++ destroy_workqueue(ib_comp_unbound_wq); |
1447 |
+ destroy_workqueue(ib_comp_wq); |
1448 |
+ /* Make sure that any pending umem accounting work is done. */ |
1449 |
+ destroy_workqueue(ib_wq); |
1450 |
+diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c |
1451 |
+index 49b6da1d990f..e4339b9e43a5 100644 |
1452 |
+--- a/drivers/infiniband/core/mad.c |
1453 |
++++ b/drivers/infiniband/core/mad.c |
1454 |
+@@ -3178,7 +3178,7 @@ static int ib_mad_port_open(struct ib_device *device, |
1455 |
+ } |
1456 |
+ |
1457 |
+ port_priv->cq = ib_alloc_cq(port_priv->device, port_priv, cq_size, 0, |
1458 |
+- IB_POLL_WORKQUEUE); |
1459 |
++ IB_POLL_UNBOUND_WORKQUEUE); |
1460 |
+ if (IS_ERR(port_priv->cq)) { |
1461 |
+ dev_err(&device->dev, "Couldn't create ib_mad CQ\n"); |
1462 |
+ ret = PTR_ERR(port_priv->cq); |
1463 |
+diff --git a/drivers/infiniband/hw/hfi1/mad.c b/drivers/infiniband/hw/hfi1/mad.c |
1464 |
+index 07b80faf1675..c0abeae1b223 100644 |
1465 |
+--- a/drivers/infiniband/hw/hfi1/mad.c |
1466 |
++++ b/drivers/infiniband/hw/hfi1/mad.c |
1467 |
+@@ -2311,7 +2311,7 @@ struct opa_port_status_req { |
1468 |
+ __be32 vl_select_mask; |
1469 |
+ }; |
1470 |
+ |
1471 |
+-#define VL_MASK_ALL 0x000080ff |
1472 |
++#define VL_MASK_ALL 0x00000000000080ffUL |
1473 |
+ |
1474 |
+ struct opa_port_status_rsp { |
1475 |
+ __u8 port_num; |
1476 |
+@@ -2610,15 +2610,14 @@ static int pma_get_opa_classportinfo(struct opa_pma_mad *pmp, |
1477 |
+ } |
1478 |
+ |
1479 |
+ static void a0_portstatus(struct hfi1_pportdata *ppd, |
1480 |
+- struct opa_port_status_rsp *rsp, u32 vl_select_mask) |
1481 |
++ struct opa_port_status_rsp *rsp) |
1482 |
+ { |
1483 |
+ if (!is_bx(ppd->dd)) { |
1484 |
+ unsigned long vl; |
1485 |
+ u64 sum_vl_xmit_wait = 0; |
1486 |
+- u32 vl_all_mask = VL_MASK_ALL; |
1487 |
++ unsigned long vl_all_mask = VL_MASK_ALL; |
1488 |
+ |
1489 |
+- for_each_set_bit(vl, (unsigned long *)&(vl_all_mask), |
1490 |
+- 8 * sizeof(vl_all_mask)) { |
1491 |
++ for_each_set_bit(vl, &vl_all_mask, BITS_PER_LONG) { |
1492 |
+ u64 tmp = sum_vl_xmit_wait + |
1493 |
+ read_port_cntr(ppd, C_TX_WAIT_VL, |
1494 |
+ idx_from_vl(vl)); |
1495 |
+@@ -2642,12 +2641,12 @@ static int pma_get_opa_portstatus(struct opa_pma_mad *pmp, |
1496 |
+ (struct opa_port_status_req *)pmp->data; |
1497 |
+ struct hfi1_devdata *dd = dd_from_ibdev(ibdev); |
1498 |
+ struct opa_port_status_rsp *rsp; |
1499 |
+- u32 vl_select_mask = be32_to_cpu(req->vl_select_mask); |
1500 |
++ unsigned long vl_select_mask = be32_to_cpu(req->vl_select_mask); |
1501 |
+ unsigned long vl; |
1502 |
+ size_t response_data_size; |
1503 |
+ u32 nports = be32_to_cpu(pmp->mad_hdr.attr_mod) >> 24; |
1504 |
+ u8 port_num = req->port_num; |
1505 |
+- u8 num_vls = hweight32(vl_select_mask); |
1506 |
++ u8 num_vls = hweight64(vl_select_mask); |
1507 |
+ struct _vls_pctrs *vlinfo; |
1508 |
+ struct hfi1_ibport *ibp = to_iport(ibdev, port); |
1509 |
+ struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); |
1510 |
+@@ -2681,7 +2680,7 @@ static int pma_get_opa_portstatus(struct opa_pma_mad *pmp, |
1511 |
+ |
1512 |
+ hfi1_read_link_quality(dd, &rsp->link_quality_indicator); |
1513 |
+ |
1514 |
+- rsp->vl_select_mask = cpu_to_be32(vl_select_mask); |
1515 |
++ rsp->vl_select_mask = cpu_to_be32((u32)vl_select_mask); |
1516 |
+ rsp->port_xmit_data = cpu_to_be64(read_dev_cntr(dd, C_DC_XMIT_FLITS, |
1517 |
+ CNTR_INVALID_VL)); |
1518 |
+ rsp->port_rcv_data = cpu_to_be64(read_dev_cntr(dd, C_DC_RCV_FLITS, |
1519 |
+@@ -2744,8 +2743,7 @@ static int pma_get_opa_portstatus(struct opa_pma_mad *pmp, |
1520 |
+ * So in the for_each_set_bit() loop below, we don't need |
1521 |
+ * any additional checks for vl. |
1522 |
+ */ |
1523 |
+- for_each_set_bit(vl, (unsigned long *)&(vl_select_mask), |
1524 |
+- 8 * sizeof(vl_select_mask)) { |
1525 |
++ for_each_set_bit(vl, &vl_select_mask, BITS_PER_LONG) { |
1526 |
+ memset(vlinfo, 0, sizeof(*vlinfo)); |
1527 |
+ |
1528 |
+ tmp = read_dev_cntr(dd, C_DC_RX_FLIT_VL, idx_from_vl(vl)); |
1529 |
+@@ -2782,7 +2780,7 @@ static int pma_get_opa_portstatus(struct opa_pma_mad *pmp, |
1530 |
+ vfi++; |
1531 |
+ } |
1532 |
+ |
1533 |
+- a0_portstatus(ppd, rsp, vl_select_mask); |
1534 |
++ a0_portstatus(ppd, rsp); |
1535 |
+ |
1536 |
+ if (resp_len) |
1537 |
+ *resp_len += response_data_size; |
1538 |
+@@ -2829,16 +2827,14 @@ static u64 get_error_counter_summary(struct ib_device *ibdev, u8 port, |
1539 |
+ return error_counter_summary; |
1540 |
+ } |
1541 |
+ |
1542 |
+-static void a0_datacounters(struct hfi1_pportdata *ppd, struct _port_dctrs *rsp, |
1543 |
+- u32 vl_select_mask) |
1544 |
++static void a0_datacounters(struct hfi1_pportdata *ppd, struct _port_dctrs *rsp) |
1545 |
+ { |
1546 |
+ if (!is_bx(ppd->dd)) { |
1547 |
+ unsigned long vl; |
1548 |
+ u64 sum_vl_xmit_wait = 0; |
1549 |
+- u32 vl_all_mask = VL_MASK_ALL; |
1550 |
++ unsigned long vl_all_mask = VL_MASK_ALL; |
1551 |
+ |
1552 |
+- for_each_set_bit(vl, (unsigned long *)&(vl_all_mask), |
1553 |
+- 8 * sizeof(vl_all_mask)) { |
1554 |
++ for_each_set_bit(vl, &vl_all_mask, BITS_PER_LONG) { |
1555 |
+ u64 tmp = sum_vl_xmit_wait + |
1556 |
+ read_port_cntr(ppd, C_TX_WAIT_VL, |
1557 |
+ idx_from_vl(vl)); |
1558 |
+@@ -2894,7 +2890,7 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp, |
1559 |
+ u64 port_mask; |
1560 |
+ u8 port_num; |
1561 |
+ unsigned long vl; |
1562 |
+- u32 vl_select_mask; |
1563 |
++ unsigned long vl_select_mask; |
1564 |
+ int vfi; |
1565 |
+ |
1566 |
+ num_ports = be32_to_cpu(pmp->mad_hdr.attr_mod) >> 24; |
1567 |
+@@ -2963,8 +2959,7 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp, |
1568 |
+ * So in the for_each_set_bit() loop below, we don't need |
1569 |
+ * any additional checks for vl. |
1570 |
+ */ |
1571 |
+- for_each_set_bit(vl, (unsigned long *)&(vl_select_mask), |
1572 |
+- 8 * sizeof(req->vl_select_mask)) { |
1573 |
++ for_each_set_bit(vl, &vl_select_mask, BITS_PER_LONG) { |
1574 |
+ memset(vlinfo, 0, sizeof(*vlinfo)); |
1575 |
+ |
1576 |
+ rsp->vls[vfi].port_vl_xmit_data = |
1577 |
+@@ -3007,7 +3002,7 @@ static int pma_get_opa_datacounters(struct opa_pma_mad *pmp, |
1578 |
+ vfi++; |
1579 |
+ } |
1580 |
+ |
1581 |
+- a0_datacounters(ppd, rsp, vl_select_mask); |
1582 |
++ a0_datacounters(ppd, rsp); |
1583 |
+ |
1584 |
+ if (resp_len) |
1585 |
+ *resp_len += response_data_size; |
1586 |
+@@ -3102,7 +3097,7 @@ static int pma_get_opa_porterrors(struct opa_pma_mad *pmp, |
1587 |
+ struct _vls_ectrs *vlinfo; |
1588 |
+ unsigned long vl; |
1589 |
+ u64 port_mask, tmp; |
1590 |
+- u32 vl_select_mask; |
1591 |
++ unsigned long vl_select_mask; |
1592 |
+ int vfi; |
1593 |
+ |
1594 |
+ req = (struct opa_port_error_counters64_msg *)pmp->data; |
1595 |
+@@ -3161,8 +3156,7 @@ static int pma_get_opa_porterrors(struct opa_pma_mad *pmp, |
1596 |
+ vlinfo = &rsp->vls[0]; |
1597 |
+ vfi = 0; |
1598 |
+ vl_select_mask = be32_to_cpu(req->vl_select_mask); |
1599 |
+- for_each_set_bit(vl, (unsigned long *)&(vl_select_mask), |
1600 |
+- 8 * sizeof(req->vl_select_mask)) { |
1601 |
++ for_each_set_bit(vl, &vl_select_mask, BITS_PER_LONG) { |
1602 |
+ memset(vlinfo, 0, sizeof(*vlinfo)); |
1603 |
+ rsp->vls[vfi].port_vl_xmit_discards = |
1604 |
+ cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD_VL, |
1605 |
+@@ -3372,7 +3366,7 @@ static int pma_set_opa_portstatus(struct opa_pma_mad *pmp, |
1606 |
+ u32 nports = be32_to_cpu(pmp->mad_hdr.attr_mod) >> 24; |
1607 |
+ u64 portn = be64_to_cpu(req->port_select_mask[3]); |
1608 |
+ u32 counter_select = be32_to_cpu(req->counter_select_mask); |
1609 |
+- u32 vl_select_mask = VL_MASK_ALL; /* clear all per-vl cnts */ |
1610 |
++ unsigned long vl_select_mask = VL_MASK_ALL; /* clear all per-vl cnts */ |
1611 |
+ unsigned long vl; |
1612 |
+ |
1613 |
+ if ((nports != 1) || (portn != 1 << port)) { |
1614 |
+@@ -3464,8 +3458,7 @@ static int pma_set_opa_portstatus(struct opa_pma_mad *pmp, |
1615 |
+ if (counter_select & CS_UNCORRECTABLE_ERRORS) |
1616 |
+ write_dev_cntr(dd, C_DC_UNC_ERR, CNTR_INVALID_VL, 0); |
1617 |
+ |
1618 |
+- for_each_set_bit(vl, (unsigned long *)&(vl_select_mask), |
1619 |
+- 8 * sizeof(vl_select_mask)) { |
1620 |
++ for_each_set_bit(vl, &vl_select_mask, BITS_PER_LONG) { |
1621 |
+ if (counter_select & CS_PORT_XMIT_DATA) |
1622 |
+ write_port_cntr(ppd, C_TX_FLIT_VL, idx_from_vl(vl), 0); |
1623 |
+ |
1624 |
+diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c |
1625 |
+index a1174e61daf4..07b6cf58fd99 100644 |
1626 |
+--- a/drivers/iommu/amd_iommu.c |
1627 |
++++ b/drivers/iommu/amd_iommu.c |
1628 |
+@@ -2568,7 +2568,9 @@ static int map_sg(struct device *dev, struct scatterlist *sglist, |
1629 |
+ |
1630 |
+ bus_addr = address + s->dma_address + (j << PAGE_SHIFT); |
1631 |
+ phys_addr = (sg_phys(s) & PAGE_MASK) + (j << PAGE_SHIFT); |
1632 |
+- ret = iommu_map_page(domain, bus_addr, phys_addr, PAGE_SIZE, prot, GFP_ATOMIC); |
1633 |
++ ret = iommu_map_page(domain, bus_addr, phys_addr, |
1634 |
++ PAGE_SIZE, prot, |
1635 |
++ GFP_ATOMIC | __GFP_NOWARN); |
1636 |
+ if (ret) |
1637 |
+ goto out_unmap; |
1638 |
+ |
1639 |
+diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c |
1640 |
+index 9f35b9a0d6d8..4edf65dbbcab 100644 |
1641 |
+--- a/drivers/iommu/iova.c |
1642 |
++++ b/drivers/iommu/iova.c |
1643 |
+@@ -607,7 +607,9 @@ void queue_iova(struct iova_domain *iovad, |
1644 |
+ |
1645 |
+ spin_unlock_irqrestore(&fq->lock, flags); |
1646 |
+ |
1647 |
+- if (atomic_cmpxchg(&iovad->fq_timer_on, 0, 1) == 0) |
1648 |
++ /* Avoid false sharing as much as possible. */ |
1649 |
++ if (!atomic_read(&iovad->fq_timer_on) && |
1650 |
++ !atomic_cmpxchg(&iovad->fq_timer_on, 0, 1)) |
1651 |
+ mod_timer(&iovad->fq_timer, |
1652 |
+ jiffies + msecs_to_jiffies(IOVA_FQ_TIMEOUT)); |
1653 |
+ |
1654 |
+diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c |
1655 |
+index f80666acb9ef..52238e6bed39 100644 |
1656 |
+--- a/drivers/irqchip/irq-gic-v3-its.c |
1657 |
++++ b/drivers/irqchip/irq-gic-v3-its.c |
1658 |
+@@ -2269,14 +2269,13 @@ static void its_irq_domain_free(struct irq_domain *domain, unsigned int virq, |
1659 |
+ struct its_node *its = its_dev->its; |
1660 |
+ int i; |
1661 |
+ |
1662 |
++ bitmap_release_region(its_dev->event_map.lpi_map, |
1663 |
++ its_get_event_id(irq_domain_get_irq_data(domain, virq)), |
1664 |
++ get_count_order(nr_irqs)); |
1665 |
++ |
1666 |
+ for (i = 0; i < nr_irqs; i++) { |
1667 |
+ struct irq_data *data = irq_domain_get_irq_data(domain, |
1668 |
+ virq + i); |
1669 |
+- u32 event = its_get_event_id(data); |
1670 |
+- |
1671 |
+- /* Mark interrupt index as unused */ |
1672 |
+- clear_bit(event, its_dev->event_map.lpi_map); |
1673 |
+- |
1674 |
+ /* Nuke the entry in the domain */ |
1675 |
+ irq_domain_reset_irq_data(data); |
1676 |
+ } |
1677 |
+diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c |
1678 |
+index 477e07036add..ca56f1fb61af 100644 |
1679 |
+--- a/drivers/isdn/mISDN/socket.c |
1680 |
++++ b/drivers/isdn/mISDN/socket.c |
1681 |
+@@ -766,6 +766,8 @@ base_sock_create(struct net *net, struct socket *sock, int protocol, int kern) |
1682 |
+ |
1683 |
+ if (sock->type != SOCK_RAW) |
1684 |
+ return -ESOCKTNOSUPPORT; |
1685 |
++ if (!capable(CAP_NET_RAW)) |
1686 |
++ return -EPERM; |
1687 |
+ |
1688 |
+ sk = sk_alloc(net, PF_ISDN, GFP_KERNEL, &mISDN_proto, kern); |
1689 |
+ if (!sk) |
1690 |
+diff --git a/drivers/leds/leds-lp5562.c b/drivers/leds/leds-lp5562.c |
1691 |
+index 05ffa34fb6ad..9d9b673c873c 100644 |
1692 |
+--- a/drivers/leds/leds-lp5562.c |
1693 |
++++ b/drivers/leds/leds-lp5562.c |
1694 |
+@@ -263,7 +263,11 @@ static void lp5562_firmware_loaded(struct lp55xx_chip *chip) |
1695 |
+ { |
1696 |
+ const struct firmware *fw = chip->fw; |
1697 |
+ |
1698 |
+- if (fw->size > LP5562_PROGRAM_LENGTH) { |
1699 |
++ /* |
1700 |
++ * the firmware is encoded in ascii hex character, with 2 chars |
1701 |
++ * per byte |
1702 |
++ */ |
1703 |
++ if (fw->size > (LP5562_PROGRAM_LENGTH * 2)) { |
1704 |
+ dev_err(&chip->cl->dev, "firmware data size overflow: %zu\n", |
1705 |
+ fw->size); |
1706 |
+ return; |
1707 |
+diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c |
1708 |
+index 1e004d975e78..4694763f9d40 100644 |
1709 |
+--- a/drivers/md/dm-zoned-target.c |
1710 |
++++ b/drivers/md/dm-zoned-target.c |
1711 |
+@@ -133,8 +133,6 @@ static int dmz_submit_bio(struct dmz_target *dmz, struct dm_zone *zone, |
1712 |
+ |
1713 |
+ atomic_inc(&bioctx->ref); |
1714 |
+ generic_make_request(clone); |
1715 |
+- if (clone->bi_status == BLK_STS_IOERR) |
1716 |
+- return -EIO; |
1717 |
+ |
1718 |
+ if (bio_op(bio) == REQ_OP_WRITE && dmz_is_seq(zone)) |
1719 |
+ zone->wp_block += nr_blocks; |
1720 |
+diff --git a/drivers/md/md.c b/drivers/md/md.c |
1721 |
+index 764ed9c46629..e529cef5483a 100644 |
1722 |
+--- a/drivers/md/md.c |
1723 |
++++ b/drivers/md/md.c |
1724 |
+@@ -1763,8 +1763,15 @@ static int super_1_validate(struct mddev *mddev, struct md_rdev *rdev) |
1725 |
+ if (!(le32_to_cpu(sb->feature_map) & |
1726 |
+ MD_FEATURE_RECOVERY_BITMAP)) |
1727 |
+ rdev->saved_raid_disk = -1; |
1728 |
+- } else |
1729 |
+- set_bit(In_sync, &rdev->flags); |
1730 |
++ } else { |
1731 |
++ /* |
1732 |
++ * If the array is FROZEN, then the device can't |
1733 |
++ * be in_sync with rest of array. |
1734 |
++ */ |
1735 |
++ if (!test_bit(MD_RECOVERY_FROZEN, |
1736 |
++ &mddev->recovery)) |
1737 |
++ set_bit(In_sync, &rdev->flags); |
1738 |
++ } |
1739 |
+ rdev->raid_disk = role; |
1740 |
+ break; |
1741 |
+ } |
1742 |
+@@ -4101,7 +4108,7 @@ array_state_show(struct mddev *mddev, char *page) |
1743 |
+ { |
1744 |
+ enum array_state st = inactive; |
1745 |
+ |
1746 |
+- if (mddev->pers) |
1747 |
++ if (mddev->pers && !test_bit(MD_NOT_READY, &mddev->flags)) |
1748 |
+ switch(mddev->ro) { |
1749 |
+ case 1: |
1750 |
+ st = readonly; |
1751 |
+@@ -5662,9 +5669,6 @@ int md_run(struct mddev *mddev) |
1752 |
+ md_update_sb(mddev, 0); |
1753 |
+ |
1754 |
+ md_new_event(mddev); |
1755 |
+- sysfs_notify_dirent_safe(mddev->sysfs_state); |
1756 |
+- sysfs_notify_dirent_safe(mddev->sysfs_action); |
1757 |
+- sysfs_notify(&mddev->kobj, NULL, "degraded"); |
1758 |
+ return 0; |
1759 |
+ |
1760 |
+ abort: |
1761 |
+@@ -5685,6 +5689,7 @@ static int do_md_run(struct mddev *mddev) |
1762 |
+ { |
1763 |
+ int err; |
1764 |
+ |
1765 |
++ set_bit(MD_NOT_READY, &mddev->flags); |
1766 |
+ err = md_run(mddev); |
1767 |
+ if (err) |
1768 |
+ goto out; |
1769 |
+@@ -5702,9 +5707,14 @@ static int do_md_run(struct mddev *mddev) |
1770 |
+ |
1771 |
+ set_capacity(mddev->gendisk, mddev->array_sectors); |
1772 |
+ revalidate_disk(mddev->gendisk); |
1773 |
++ clear_bit(MD_NOT_READY, &mddev->flags); |
1774 |
+ mddev->changed = 1; |
1775 |
+ kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE); |
1776 |
++ sysfs_notify_dirent_safe(mddev->sysfs_state); |
1777 |
++ sysfs_notify_dirent_safe(mddev->sysfs_action); |
1778 |
++ sysfs_notify(&mddev->kobj, NULL, "degraded"); |
1779 |
+ out: |
1780 |
++ clear_bit(MD_NOT_READY, &mddev->flags); |
1781 |
+ return err; |
1782 |
+ } |
1783 |
+ |
1784 |
+@@ -8755,6 +8765,7 @@ void md_check_recovery(struct mddev *mddev) |
1785 |
+ |
1786 |
+ if (mddev_trylock(mddev)) { |
1787 |
+ int spares = 0; |
1788 |
++ bool try_set_sync = mddev->safemode != 0; |
1789 |
+ |
1790 |
+ if (!mddev->external && mddev->safemode == 1) |
1791 |
+ mddev->safemode = 0; |
1792 |
+@@ -8800,7 +8811,7 @@ void md_check_recovery(struct mddev *mddev) |
1793 |
+ } |
1794 |
+ } |
1795 |
+ |
1796 |
+- if (!mddev->external && !mddev->in_sync) { |
1797 |
++ if (try_set_sync && !mddev->external && !mddev->in_sync) { |
1798 |
+ spin_lock(&mddev->lock); |
1799 |
+ set_in_sync(mddev); |
1800 |
+ spin_unlock(&mddev->lock); |
1801 |
+@@ -8906,7 +8917,8 @@ void md_reap_sync_thread(struct mddev *mddev) |
1802 |
+ /* resync has finished, collect result */ |
1803 |
+ md_unregister_thread(&mddev->sync_thread); |
1804 |
+ if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery) && |
1805 |
+- !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery)) { |
1806 |
++ !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) && |
1807 |
++ mddev->degraded != mddev->raid_disks) { |
1808 |
+ /* success...*/ |
1809 |
+ /* activate any spares */ |
1810 |
+ if (mddev->pers->spare_active(mddev)) { |
1811 |
+diff --git a/drivers/md/md.h b/drivers/md/md.h |
1812 |
+index 11696aba94e3..69bc0d5550cd 100644 |
1813 |
+--- a/drivers/md/md.h |
1814 |
++++ b/drivers/md/md.h |
1815 |
+@@ -243,6 +243,9 @@ enum mddev_flags { |
1816 |
+ MD_UPDATING_SB, /* md_check_recovery is updating the metadata |
1817 |
+ * without explicitly holding reconfig_mutex. |
1818 |
+ */ |
1819 |
++ MD_NOT_READY, /* do_md_run() is active, so 'array_state' |
1820 |
++ * must not report that array is ready yet |
1821 |
++ */ |
1822 |
+ }; |
1823 |
+ |
1824 |
+ enum mddev_sb_flags { |
1825 |
+diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c |
1826 |
+index 5ecba9eef441..28fb71721770 100644 |
1827 |
+--- a/drivers/md/raid0.c |
1828 |
++++ b/drivers/md/raid0.c |
1829 |
+@@ -26,6 +26,9 @@ |
1830 |
+ #include "raid0.h" |
1831 |
+ #include "raid5.h" |
1832 |
+ |
1833 |
++static int default_layout = 0; |
1834 |
++module_param(default_layout, int, 0644); |
1835 |
++ |
1836 |
+ #define UNSUPPORTED_MDDEV_FLAGS \ |
1837 |
+ ((1L << MD_HAS_JOURNAL) | \ |
1838 |
+ (1L << MD_JOURNAL_CLEAN) | \ |
1839 |
+@@ -146,6 +149,19 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) |
1840 |
+ } |
1841 |
+ pr_debug("md/raid0:%s: FINAL %d zones\n", |
1842 |
+ mdname(mddev), conf->nr_strip_zones); |
1843 |
++ |
1844 |
++ if (conf->nr_strip_zones == 1) { |
1845 |
++ conf->layout = RAID0_ORIG_LAYOUT; |
1846 |
++ } else if (default_layout == RAID0_ORIG_LAYOUT || |
1847 |
++ default_layout == RAID0_ALT_MULTIZONE_LAYOUT) { |
1848 |
++ conf->layout = default_layout; |
1849 |
++ } else { |
1850 |
++ pr_err("md/raid0:%s: cannot assemble multi-zone RAID0 with default_layout setting\n", |
1851 |
++ mdname(mddev)); |
1852 |
++ pr_err("md/raid0: please set raid.default_layout to 1 or 2\n"); |
1853 |
++ err = -ENOTSUPP; |
1854 |
++ goto abort; |
1855 |
++ } |
1856 |
+ /* |
1857 |
+ * now since we have the hard sector sizes, we can make sure |
1858 |
+ * chunk size is a multiple of that sector size |
1859 |
+@@ -552,10 +568,12 @@ static void raid0_handle_discard(struct mddev *mddev, struct bio *bio) |
1860 |
+ |
1861 |
+ static bool raid0_make_request(struct mddev *mddev, struct bio *bio) |
1862 |
+ { |
1863 |
++ struct r0conf *conf = mddev->private; |
1864 |
+ struct strip_zone *zone; |
1865 |
+ struct md_rdev *tmp_dev; |
1866 |
+ sector_t bio_sector; |
1867 |
+ sector_t sector; |
1868 |
++ sector_t orig_sector; |
1869 |
+ unsigned chunk_sects; |
1870 |
+ unsigned sectors; |
1871 |
+ |
1872 |
+@@ -588,8 +606,21 @@ static bool raid0_make_request(struct mddev *mddev, struct bio *bio) |
1873 |
+ bio = split; |
1874 |
+ } |
1875 |
+ |
1876 |
++ orig_sector = sector; |
1877 |
+ zone = find_zone(mddev->private, §or); |
1878 |
+- tmp_dev = map_sector(mddev, zone, sector, §or); |
1879 |
++ switch (conf->layout) { |
1880 |
++ case RAID0_ORIG_LAYOUT: |
1881 |
++ tmp_dev = map_sector(mddev, zone, orig_sector, §or); |
1882 |
++ break; |
1883 |
++ case RAID0_ALT_MULTIZONE_LAYOUT: |
1884 |
++ tmp_dev = map_sector(mddev, zone, sector, §or); |
1885 |
++ break; |
1886 |
++ default: |
1887 |
++ WARN("md/raid0:%s: Invalid layout\n", mdname(mddev)); |
1888 |
++ bio_io_error(bio); |
1889 |
++ return true; |
1890 |
++ } |
1891 |
++ |
1892 |
+ bio_set_dev(bio, tmp_dev->bdev); |
1893 |
+ bio->bi_iter.bi_sector = sector + zone->dev_start + |
1894 |
+ tmp_dev->data_offset; |
1895 |
+diff --git a/drivers/md/raid0.h b/drivers/md/raid0.h |
1896 |
+index 540e65d92642..3816e5477db1 100644 |
1897 |
+--- a/drivers/md/raid0.h |
1898 |
++++ b/drivers/md/raid0.h |
1899 |
+@@ -8,11 +8,25 @@ struct strip_zone { |
1900 |
+ int nb_dev; /* # of devices attached to the zone */ |
1901 |
+ }; |
1902 |
+ |
1903 |
++/* Linux 3.14 (20d0189b101) made an unintended change to |
1904 |
++ * the RAID0 layout for multi-zone arrays (where devices aren't all |
1905 |
++ * the same size. |
1906 |
++ * RAID0_ORIG_LAYOUT restores the original layout |
1907 |
++ * RAID0_ALT_MULTIZONE_LAYOUT uses the altered layout |
1908 |
++ * The layouts are identical when there is only one zone (all |
1909 |
++ * devices the same size). |
1910 |
++ */ |
1911 |
++ |
1912 |
++enum r0layout { |
1913 |
++ RAID0_ORIG_LAYOUT = 1, |
1914 |
++ RAID0_ALT_MULTIZONE_LAYOUT = 2, |
1915 |
++}; |
1916 |
+ struct r0conf { |
1917 |
+ struct strip_zone *strip_zone; |
1918 |
+ struct md_rdev **devlist; /* lists of rdevs, pointed to |
1919 |
+ * by strip_zone->dev */ |
1920 |
+ int nr_strip_zones; |
1921 |
++ enum r0layout layout; |
1922 |
+ }; |
1923 |
+ |
1924 |
+ #endif |
1925 |
+diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c |
1926 |
+index 31c4391f6a62..f46ac9db9edb 100644 |
1927 |
+--- a/drivers/md/raid1.c |
1928 |
++++ b/drivers/md/raid1.c |
1929 |
+@@ -435,19 +435,21 @@ static void raid1_end_write_request(struct bio *bio) |
1930 |
+ /* We never try FailFast to WriteMostly devices */ |
1931 |
+ !test_bit(WriteMostly, &rdev->flags)) { |
1932 |
+ md_error(r1_bio->mddev, rdev); |
1933 |
+- if (!test_bit(Faulty, &rdev->flags)) |
1934 |
+- /* This is the only remaining device, |
1935 |
+- * We need to retry the write without |
1936 |
+- * FailFast |
1937 |
+- */ |
1938 |
+- set_bit(R1BIO_WriteError, &r1_bio->state); |
1939 |
+- else { |
1940 |
+- /* Finished with this branch */ |
1941 |
+- r1_bio->bios[mirror] = NULL; |
1942 |
+- to_put = bio; |
1943 |
+- } |
1944 |
+- } else |
1945 |
++ } |
1946 |
++ |
1947 |
++ /* |
1948 |
++ * When the device is faulty, it is not necessary to |
1949 |
++ * handle write error. |
1950 |
++ * For failfast, this is the only remaining device, |
1951 |
++ * We need to retry the write without FailFast. |
1952 |
++ */ |
1953 |
++ if (!test_bit(Faulty, &rdev->flags)) |
1954 |
+ set_bit(R1BIO_WriteError, &r1_bio->state); |
1955 |
++ else { |
1956 |
++ /* Finished with this branch */ |
1957 |
++ r1_bio->bios[mirror] = NULL; |
1958 |
++ to_put = bio; |
1959 |
++ } |
1960 |
+ } else { |
1961 |
+ /* |
1962 |
+ * Set R1BIO_Uptodate in our master bio, so that we |
1963 |
+@@ -3097,6 +3099,13 @@ static int raid1_run(struct mddev *mddev) |
1964 |
+ !test_bit(In_sync, &conf->mirrors[i].rdev->flags) || |
1965 |
+ test_bit(Faulty, &conf->mirrors[i].rdev->flags)) |
1966 |
+ mddev->degraded++; |
1967 |
++ /* |
1968 |
++ * RAID1 needs at least one disk in active |
1969 |
++ */ |
1970 |
++ if (conf->raid_disks - mddev->degraded < 1) { |
1971 |
++ ret = -EINVAL; |
1972 |
++ goto abort; |
1973 |
++ } |
1974 |
+ |
1975 |
+ if (conf->raid_disks - mddev->degraded == 1) |
1976 |
+ mddev->recovery_cp = MaxSector; |
1977 |
+@@ -3130,8 +3139,12 @@ static int raid1_run(struct mddev *mddev) |
1978 |
+ ret = md_integrity_register(mddev); |
1979 |
+ if (ret) { |
1980 |
+ md_unregister_thread(&mddev->thread); |
1981 |
+- raid1_free(mddev, conf); |
1982 |
++ goto abort; |
1983 |
+ } |
1984 |
++ return 0; |
1985 |
++ |
1986 |
++abort: |
1987 |
++ raid1_free(mddev, conf); |
1988 |
+ return ret; |
1989 |
+ } |
1990 |
+ |
1991 |
+diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c |
1992 |
+index 65608c6b6836..4c49bed40f1f 100644 |
1993 |
+--- a/drivers/md/raid5.c |
1994 |
++++ b/drivers/md/raid5.c |
1995 |
+@@ -2538,7 +2538,8 @@ static void raid5_end_read_request(struct bio * bi) |
1996 |
+ int set_bad = 0; |
1997 |
+ |
1998 |
+ clear_bit(R5_UPTODATE, &sh->dev[i].flags); |
1999 |
+- atomic_inc(&rdev->read_errors); |
2000 |
++ if (!(bi->bi_status == BLK_STS_PROTECTION)) |
2001 |
++ atomic_inc(&rdev->read_errors); |
2002 |
+ if (test_bit(R5_ReadRepl, &sh->dev[i].flags)) |
2003 |
+ pr_warn_ratelimited( |
2004 |
+ "md/raid:%s: read error on replacement device (sector %llu on %s).\n", |
2005 |
+@@ -2570,7 +2571,9 @@ static void raid5_end_read_request(struct bio * bi) |
2006 |
+ && !test_bit(R5_ReadNoMerge, &sh->dev[i].flags)) |
2007 |
+ retry = 1; |
2008 |
+ if (retry) |
2009 |
+- if (test_bit(R5_ReadNoMerge, &sh->dev[i].flags)) { |
2010 |
++ if (sh->qd_idx >= 0 && sh->pd_idx == i) |
2011 |
++ set_bit(R5_ReadError, &sh->dev[i].flags); |
2012 |
++ else if (test_bit(R5_ReadNoMerge, &sh->dev[i].flags)) { |
2013 |
+ set_bit(R5_ReadError, &sh->dev[i].flags); |
2014 |
+ clear_bit(R5_ReadNoMerge, &sh->dev[i].flags); |
2015 |
+ } else |
2016 |
+@@ -5718,7 +5721,8 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi) |
2017 |
+ do_flush = false; |
2018 |
+ } |
2019 |
+ |
2020 |
+- set_bit(STRIPE_HANDLE, &sh->state); |
2021 |
++ if (!sh->batch_head) |
2022 |
++ set_bit(STRIPE_HANDLE, &sh->state); |
2023 |
+ clear_bit(STRIPE_DELAYED, &sh->state); |
2024 |
+ if ((!sh->batch_head || sh == sh->batch_head) && |
2025 |
+ (bi->bi_opf & REQ_SYNC) && |
2026 |
+diff --git a/drivers/media/cec/cec-notifier.c b/drivers/media/cec/cec-notifier.c |
2027 |
+index 08b619d0ea1e..cd04499df489 100644 |
2028 |
+--- a/drivers/media/cec/cec-notifier.c |
2029 |
++++ b/drivers/media/cec/cec-notifier.c |
2030 |
+@@ -130,6 +130,8 @@ void cec_notifier_unregister(struct cec_notifier *n) |
2031 |
+ { |
2032 |
+ mutex_lock(&n->lock); |
2033 |
+ n->callback = NULL; |
2034 |
++ n->cec_adap->notifier = NULL; |
2035 |
++ n->cec_adap = NULL; |
2036 |
+ mutex_unlock(&n->lock); |
2037 |
+ cec_notifier_put(n); |
2038 |
+ } |
2039 |
+diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c |
2040 |
+index 41aad0f99d73..ba3c68fb9676 100644 |
2041 |
+--- a/drivers/media/dvb-core/dvbdev.c |
2042 |
++++ b/drivers/media/dvb-core/dvbdev.c |
2043 |
+@@ -316,8 +316,10 @@ static int dvb_create_media_entity(struct dvb_device *dvbdev, |
2044 |
+ if (npads) { |
2045 |
+ dvbdev->pads = kcalloc(npads, sizeof(*dvbdev->pads), |
2046 |
+ GFP_KERNEL); |
2047 |
+- if (!dvbdev->pads) |
2048 |
++ if (!dvbdev->pads) { |
2049 |
++ kfree(dvbdev->entity); |
2050 |
+ return -ENOMEM; |
2051 |
++ } |
2052 |
+ } |
2053 |
+ |
2054 |
+ switch (type) { |
2055 |
+diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c |
2056 |
+index acf5c8a55bbd..69f564b0837a 100644 |
2057 |
+--- a/drivers/media/i2c/ov5640.c |
2058 |
++++ b/drivers/media/i2c/ov5640.c |
2059 |
+@@ -2261,9 +2261,14 @@ static int ov5640_probe(struct i2c_client *client, |
2060 |
+ /* request optional power down pin */ |
2061 |
+ sensor->pwdn_gpio = devm_gpiod_get_optional(dev, "powerdown", |
2062 |
+ GPIOD_OUT_HIGH); |
2063 |
++ if (IS_ERR(sensor->pwdn_gpio)) |
2064 |
++ return PTR_ERR(sensor->pwdn_gpio); |
2065 |
++ |
2066 |
+ /* request optional reset pin */ |
2067 |
+ sensor->reset_gpio = devm_gpiod_get_optional(dev, "reset", |
2068 |
+ GPIOD_OUT_HIGH); |
2069 |
++ if (IS_ERR(sensor->reset_gpio)) |
2070 |
++ return PTR_ERR(sensor->reset_gpio); |
2071 |
+ |
2072 |
+ v4l2_i2c_subdev_init(&sensor->sd, client, &ov5640_subdev_ops); |
2073 |
+ |
2074 |
+diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c |
2075 |
+index 2d96c1849759..de15a13443e4 100644 |
2076 |
+--- a/drivers/media/i2c/ov5645.c |
2077 |
++++ b/drivers/media/i2c/ov5645.c |
2078 |
+@@ -53,6 +53,8 @@ |
2079 |
+ #define OV5645_CHIP_ID_HIGH_BYTE 0x56 |
2080 |
+ #define OV5645_CHIP_ID_LOW 0x300b |
2081 |
+ #define OV5645_CHIP_ID_LOW_BYTE 0x45 |
2082 |
++#define OV5645_IO_MIPI_CTRL00 0x300e |
2083 |
++#define OV5645_PAD_OUTPUT00 0x3019 |
2084 |
+ #define OV5645_AWB_MANUAL_CONTROL 0x3406 |
2085 |
+ #define OV5645_AWB_MANUAL_ENABLE BIT(0) |
2086 |
+ #define OV5645_AEC_PK_MANUAL 0x3503 |
2087 |
+@@ -63,6 +65,7 @@ |
2088 |
+ #define OV5645_ISP_VFLIP BIT(2) |
2089 |
+ #define OV5645_TIMING_TC_REG21 0x3821 |
2090 |
+ #define OV5645_SENSOR_MIRROR BIT(1) |
2091 |
++#define OV5645_MIPI_CTRL00 0x4800 |
2092 |
+ #define OV5645_PRE_ISP_TEST_SETTING_1 0x503d |
2093 |
+ #define OV5645_TEST_PATTERN_MASK 0x3 |
2094 |
+ #define OV5645_SET_TEST_PATTERN(x) ((x) & OV5645_TEST_PATTERN_MASK) |
2095 |
+@@ -129,7 +132,6 @@ static const struct reg_value ov5645_global_init_setting[] = { |
2096 |
+ { 0x3503, 0x07 }, |
2097 |
+ { 0x3002, 0x1c }, |
2098 |
+ { 0x3006, 0xc3 }, |
2099 |
+- { 0x300e, 0x45 }, |
2100 |
+ { 0x3017, 0x00 }, |
2101 |
+ { 0x3018, 0x00 }, |
2102 |
+ { 0x302e, 0x0b }, |
2103 |
+@@ -358,7 +360,10 @@ static const struct reg_value ov5645_global_init_setting[] = { |
2104 |
+ { 0x3a1f, 0x14 }, |
2105 |
+ { 0x0601, 0x02 }, |
2106 |
+ { 0x3008, 0x42 }, |
2107 |
+- { 0x3008, 0x02 } |
2108 |
++ { 0x3008, 0x02 }, |
2109 |
++ { OV5645_IO_MIPI_CTRL00, 0x40 }, |
2110 |
++ { OV5645_MIPI_CTRL00, 0x24 }, |
2111 |
++ { OV5645_PAD_OUTPUT00, 0x70 } |
2112 |
+ }; |
2113 |
+ |
2114 |
+ static const struct reg_value ov5645_setting_sxga[] = { |
2115 |
+@@ -743,13 +748,9 @@ static int ov5645_s_power(struct v4l2_subdev *sd, int on) |
2116 |
+ goto exit; |
2117 |
+ } |
2118 |
+ |
2119 |
+- ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0, |
2120 |
+- OV5645_SYSTEM_CTRL0_STOP); |
2121 |
+- if (ret < 0) { |
2122 |
+- ov5645_set_power_off(ov5645); |
2123 |
+- goto exit; |
2124 |
+- } |
2125 |
++ usleep_range(500, 1000); |
2126 |
+ } else { |
2127 |
++ ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x58); |
2128 |
+ ov5645_set_power_off(ov5645); |
2129 |
+ } |
2130 |
+ } |
2131 |
+@@ -1069,11 +1070,20 @@ static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable) |
2132 |
+ dev_err(ov5645->dev, "could not sync v4l2 controls\n"); |
2133 |
+ return ret; |
2134 |
+ } |
2135 |
++ |
2136 |
++ ret = ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x45); |
2137 |
++ if (ret < 0) |
2138 |
++ return ret; |
2139 |
++ |
2140 |
+ ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0, |
2141 |
+ OV5645_SYSTEM_CTRL0_START); |
2142 |
+ if (ret < 0) |
2143 |
+ return ret; |
2144 |
+ } else { |
2145 |
++ ret = ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x40); |
2146 |
++ if (ret < 0) |
2147 |
++ return ret; |
2148 |
++ |
2149 |
+ ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0, |
2150 |
+ OV5645_SYSTEM_CTRL0_STOP); |
2151 |
+ if (ret < 0) |
2152 |
+diff --git a/drivers/media/i2c/ov9650.c b/drivers/media/i2c/ov9650.c |
2153 |
+index 6ffb460e8589..565903c3172d 100644 |
2154 |
+--- a/drivers/media/i2c/ov9650.c |
2155 |
++++ b/drivers/media/i2c/ov9650.c |
2156 |
+@@ -710,6 +710,11 @@ static int ov965x_set_gain(struct ov965x *ov965x, int auto_gain) |
2157 |
+ for (m = 6; m >= 0; m--) |
2158 |
+ if (gain >= (1 << m) * 16) |
2159 |
+ break; |
2160 |
++ |
2161 |
++ /* Sanity check: don't adjust the gain with a negative value */ |
2162 |
++ if (m < 0) |
2163 |
++ return -EINVAL; |
2164 |
++ |
2165 |
+ rgain = (gain - ((1 << m) * 16)) / (1 << m); |
2166 |
+ rgain |= (((1 << m) - 1) << 4); |
2167 |
+ |
2168 |
+diff --git a/drivers/media/i2c/tvp5150.c b/drivers/media/i2c/tvp5150.c |
2169 |
+index b41f7fafb731..a10331b22fee 100644 |
2170 |
+--- a/drivers/media/i2c/tvp5150.c |
2171 |
++++ b/drivers/media/i2c/tvp5150.c |
2172 |
+@@ -827,7 +827,7 @@ static int tvp5150_s_ctrl(struct v4l2_ctrl *ctrl) |
2173 |
+ return 0; |
2174 |
+ case V4L2_CID_HUE: |
2175 |
+ tvp5150_write(sd, TVP5150_HUE_CTL, ctrl->val); |
2176 |
+- break; |
2177 |
++ return 0; |
2178 |
+ case V4L2_CID_TEST_PATTERN: |
2179 |
+ decoder->enable = ctrl->val ? false : true; |
2180 |
+ tvp5150_selmux(sd); |
2181 |
+diff --git a/drivers/media/pci/saa7134/saa7134-i2c.c b/drivers/media/pci/saa7134/saa7134-i2c.c |
2182 |
+index 8f2ed632840f..f70a79983684 100644 |
2183 |
+--- a/drivers/media/pci/saa7134/saa7134-i2c.c |
2184 |
++++ b/drivers/media/pci/saa7134/saa7134-i2c.c |
2185 |
+@@ -351,7 +351,11 @@ static struct i2c_client saa7134_client_template = { |
2186 |
+ |
2187 |
+ /* ----------------------------------------------------------- */ |
2188 |
+ |
2189 |
+-/* On Medion 7134 reading EEPROM needs DVB-T demod i2c gate open */ |
2190 |
++/* |
2191 |
++ * On Medion 7134 reading the SAA7134 chip config EEPROM needs DVB-T |
2192 |
++ * demod i2c gate closed due to an address clash between this EEPROM |
2193 |
++ * and the demod one. |
2194 |
++ */ |
2195 |
+ static void saa7134_i2c_eeprom_md7134_gate(struct saa7134_dev *dev) |
2196 |
+ { |
2197 |
+ u8 subaddr = 0x7, dmdregval; |
2198 |
+@@ -368,14 +372,14 @@ static void saa7134_i2c_eeprom_md7134_gate(struct saa7134_dev *dev) |
2199 |
+ |
2200 |
+ ret = i2c_transfer(&dev->i2c_adap, i2cgatemsg_r, 2); |
2201 |
+ if ((ret == 2) && (dmdregval & 0x2)) { |
2202 |
+- pr_debug("%s: DVB-T demod i2c gate was left closed\n", |
2203 |
++ pr_debug("%s: DVB-T demod i2c gate was left open\n", |
2204 |
+ dev->name); |
2205 |
+ |
2206 |
+ data[0] = subaddr; |
2207 |
+ data[1] = (dmdregval & ~0x2); |
2208 |
+ if (i2c_transfer(&dev->i2c_adap, i2cgatemsg_w, 1) != 1) |
2209 |
+- pr_err("%s: EEPROM i2c gate open failure\n", |
2210 |
+- dev->name); |
2211 |
++ pr_err("%s: EEPROM i2c gate close failure\n", |
2212 |
++ dev->name); |
2213 |
+ } |
2214 |
+ } |
2215 |
+ |
2216 |
+diff --git a/drivers/media/pci/saa7146/hexium_gemini.c b/drivers/media/pci/saa7146/hexium_gemini.c |
2217 |
+index 934332f1fd8e..a527d86b93a7 100644 |
2218 |
+--- a/drivers/media/pci/saa7146/hexium_gemini.c |
2219 |
++++ b/drivers/media/pci/saa7146/hexium_gemini.c |
2220 |
+@@ -304,6 +304,9 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d |
2221 |
+ ret = saa7146_register_device(&hexium->video_dev, dev, "hexium gemini", VFL_TYPE_GRABBER); |
2222 |
+ if (ret < 0) { |
2223 |
+ pr_err("cannot register capture v4l2 device. skipping.\n"); |
2224 |
++ saa7146_vv_release(dev); |
2225 |
++ i2c_del_adapter(&hexium->i2c_adapter); |
2226 |
++ kfree(hexium); |
2227 |
+ return ret; |
2228 |
+ } |
2229 |
+ |
2230 |
+diff --git a/drivers/media/platform/exynos4-is/fimc-is.c b/drivers/media/platform/exynos4-is/fimc-is.c |
2231 |
+index 5ddb2321e9e4..0fe9be93fabe 100644 |
2232 |
+--- a/drivers/media/platform/exynos4-is/fimc-is.c |
2233 |
++++ b/drivers/media/platform/exynos4-is/fimc-is.c |
2234 |
+@@ -819,6 +819,7 @@ static int fimc_is_probe(struct platform_device *pdev) |
2235 |
+ return -ENODEV; |
2236 |
+ |
2237 |
+ is->pmu_regs = of_iomap(node, 0); |
2238 |
++ of_node_put(node); |
2239 |
+ if (!is->pmu_regs) |
2240 |
+ return -ENOMEM; |
2241 |
+ |
2242 |
+diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c |
2243 |
+index d4656d5175d7..b2eb830c0360 100644 |
2244 |
+--- a/drivers/media/platform/exynos4-is/media-dev.c |
2245 |
++++ b/drivers/media/platform/exynos4-is/media-dev.c |
2246 |
+@@ -496,6 +496,7 @@ static int fimc_md_register_sensor_entities(struct fimc_md *fmd) |
2247 |
+ continue; |
2248 |
+ |
2249 |
+ ret = fimc_md_parse_port_node(fmd, port, index); |
2250 |
++ of_node_put(port); |
2251 |
+ if (ret < 0) { |
2252 |
+ of_node_put(node); |
2253 |
+ goto rpm_put; |
2254 |
+@@ -529,6 +530,7 @@ static int __of_get_csis_id(struct device_node *np) |
2255 |
+ if (!np) |
2256 |
+ return -EINVAL; |
2257 |
+ of_property_read_u32(np, "reg", ®); |
2258 |
++ of_node_put(np); |
2259 |
+ return reg - FIMC_INPUT_MIPI_CSI2_0; |
2260 |
+ } |
2261 |
+ |
2262 |
+diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c |
2263 |
+index bbb24fb95b95..3deb0549b1a1 100644 |
2264 |
+--- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c |
2265 |
++++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c |
2266 |
+@@ -118,7 +118,9 @@ static int mtk_mdp_probe(struct platform_device *pdev) |
2267 |
+ mutex_init(&mdp->vpulock); |
2268 |
+ |
2269 |
+ /* Old dts had the components as child nodes */ |
2270 |
+- if (of_get_next_child(dev->of_node, NULL)) { |
2271 |
++ node = of_get_next_child(dev->of_node, NULL); |
2272 |
++ if (node) { |
2273 |
++ of_node_put(node); |
2274 |
+ parent = dev->of_node; |
2275 |
+ dev_warn(dev, "device tree is out of date\n"); |
2276 |
+ } else { |
2277 |
+diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c |
2278 |
+index c834fea5f9b0..b34b6a604f92 100644 |
2279 |
+--- a/drivers/media/platform/omap3isp/isp.c |
2280 |
++++ b/drivers/media/platform/omap3isp/isp.c |
2281 |
+@@ -727,6 +727,10 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe, |
2282 |
+ s_stream, mode); |
2283 |
+ pipe->do_propagation = true; |
2284 |
+ } |
2285 |
++ |
2286 |
++ /* Stop at the first external sub-device. */ |
2287 |
++ if (subdev->dev != isp->dev) |
2288 |
++ break; |
2289 |
+ } |
2290 |
+ |
2291 |
+ return 0; |
2292 |
+@@ -841,6 +845,10 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe) |
2293 |
+ &subdev->entity); |
2294 |
+ failure = -ETIMEDOUT; |
2295 |
+ } |
2296 |
++ |
2297 |
++ /* Stop at the first external sub-device. */ |
2298 |
++ if (subdev->dev != isp->dev) |
2299 |
++ break; |
2300 |
+ } |
2301 |
+ |
2302 |
+ return failure; |
2303 |
+diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c |
2304 |
+index b66276ab5765..a2c18ab8167e 100644 |
2305 |
+--- a/drivers/media/platform/omap3isp/ispccdc.c |
2306 |
++++ b/drivers/media/platform/omap3isp/ispccdc.c |
2307 |
+@@ -2605,6 +2605,7 @@ int omap3isp_ccdc_register_entities(struct isp_ccdc_device *ccdc, |
2308 |
+ int ret; |
2309 |
+ |
2310 |
+ /* Register the subdev and video node. */ |
2311 |
++ ccdc->subdev.dev = vdev->mdev->dev; |
2312 |
+ ret = v4l2_device_register_subdev(vdev, &ccdc->subdev); |
2313 |
+ if (ret < 0) |
2314 |
+ goto error; |
2315 |
+diff --git a/drivers/media/platform/omap3isp/ispccp2.c b/drivers/media/platform/omap3isp/ispccp2.c |
2316 |
+index e062939d0d05..47b0d3fe87d8 100644 |
2317 |
+--- a/drivers/media/platform/omap3isp/ispccp2.c |
2318 |
++++ b/drivers/media/platform/omap3isp/ispccp2.c |
2319 |
+@@ -1034,6 +1034,7 @@ int omap3isp_ccp2_register_entities(struct isp_ccp2_device *ccp2, |
2320 |
+ int ret; |
2321 |
+ |
2322 |
+ /* Register the subdev and video nodes. */ |
2323 |
++ ccp2->subdev.dev = vdev->mdev->dev; |
2324 |
+ ret = v4l2_device_register_subdev(vdev, &ccp2->subdev); |
2325 |
+ if (ret < 0) |
2326 |
+ goto error; |
2327 |
+diff --git a/drivers/media/platform/omap3isp/ispcsi2.c b/drivers/media/platform/omap3isp/ispcsi2.c |
2328 |
+index a4d3d030e81e..e45292a1bf6c 100644 |
2329 |
+--- a/drivers/media/platform/omap3isp/ispcsi2.c |
2330 |
++++ b/drivers/media/platform/omap3isp/ispcsi2.c |
2331 |
+@@ -1201,6 +1201,7 @@ int omap3isp_csi2_register_entities(struct isp_csi2_device *csi2, |
2332 |
+ int ret; |
2333 |
+ |
2334 |
+ /* Register the subdev and video nodes. */ |
2335 |
++ csi2->subdev.dev = vdev->mdev->dev; |
2336 |
+ ret = v4l2_device_register_subdev(vdev, &csi2->subdev); |
2337 |
+ if (ret < 0) |
2338 |
+ goto error; |
2339 |
+diff --git a/drivers/media/platform/omap3isp/isppreview.c b/drivers/media/platform/omap3isp/isppreview.c |
2340 |
+index ac30a0f83780..e981eb2330f1 100644 |
2341 |
+--- a/drivers/media/platform/omap3isp/isppreview.c |
2342 |
++++ b/drivers/media/platform/omap3isp/isppreview.c |
2343 |
+@@ -2228,6 +2228,7 @@ int omap3isp_preview_register_entities(struct isp_prev_device *prev, |
2344 |
+ int ret; |
2345 |
+ |
2346 |
+ /* Register the subdev and video nodes. */ |
2347 |
++ prev->subdev.dev = vdev->mdev->dev; |
2348 |
+ ret = v4l2_device_register_subdev(vdev, &prev->subdev); |
2349 |
+ if (ret < 0) |
2350 |
+ goto error; |
2351 |
+diff --git a/drivers/media/platform/omap3isp/ispresizer.c b/drivers/media/platform/omap3isp/ispresizer.c |
2352 |
+index 0b6a87508584..2035e3c6a9de 100644 |
2353 |
+--- a/drivers/media/platform/omap3isp/ispresizer.c |
2354 |
++++ b/drivers/media/platform/omap3isp/ispresizer.c |
2355 |
+@@ -1684,6 +1684,7 @@ int omap3isp_resizer_register_entities(struct isp_res_device *res, |
2356 |
+ int ret; |
2357 |
+ |
2358 |
+ /* Register the subdev and video nodes. */ |
2359 |
++ res->subdev.dev = vdev->mdev->dev; |
2360 |
+ ret = v4l2_device_register_subdev(vdev, &res->subdev); |
2361 |
+ if (ret < 0) |
2362 |
+ goto error; |
2363 |
+diff --git a/drivers/media/platform/omap3isp/ispstat.c b/drivers/media/platform/omap3isp/ispstat.c |
2364 |
+index 47cbc7e3d825..24c07939aedd 100644 |
2365 |
+--- a/drivers/media/platform/omap3isp/ispstat.c |
2366 |
++++ b/drivers/media/platform/omap3isp/ispstat.c |
2367 |
+@@ -1018,6 +1018,8 @@ void omap3isp_stat_unregister_entities(struct ispstat *stat) |
2368 |
+ int omap3isp_stat_register_entities(struct ispstat *stat, |
2369 |
+ struct v4l2_device *vdev) |
2370 |
+ { |
2371 |
++ stat->subdev.dev = vdev->mdev->dev; |
2372 |
++ |
2373 |
+ return v4l2_device_register_subdev(vdev, &stat->subdev); |
2374 |
+ } |
2375 |
+ |
2376 |
+diff --git a/drivers/media/platform/rcar_fdp1.c b/drivers/media/platform/rcar_fdp1.c |
2377 |
+index a889332d5d30..d8d406c79cfa 100644 |
2378 |
+--- a/drivers/media/platform/rcar_fdp1.c |
2379 |
++++ b/drivers/media/platform/rcar_fdp1.c |
2380 |
+@@ -2310,7 +2310,7 @@ static int fdp1_probe(struct platform_device *pdev) |
2381 |
+ fdp1->fcp = rcar_fcp_get(fcp_node); |
2382 |
+ of_node_put(fcp_node); |
2383 |
+ if (IS_ERR(fdp1->fcp)) { |
2384 |
+- dev_err(&pdev->dev, "FCP not found (%ld)\n", |
2385 |
++ dev_dbg(&pdev->dev, "FCP not found (%ld)\n", |
2386 |
+ PTR_ERR(fdp1->fcp)); |
2387 |
+ return PTR_ERR(fdp1->fcp); |
2388 |
+ } |
2389 |
+diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c |
2390 |
+index c311f9951d80..aec528f52ca1 100644 |
2391 |
+--- a/drivers/media/radio/si470x/radio-si470x-usb.c |
2392 |
++++ b/drivers/media/radio/si470x/radio-si470x-usb.c |
2393 |
+@@ -737,7 +737,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, |
2394 |
+ /* start radio */ |
2395 |
+ retval = si470x_start_usb(radio); |
2396 |
+ if (retval < 0) |
2397 |
+- goto err_all; |
2398 |
++ goto err_buf; |
2399 |
+ |
2400 |
+ /* set initial frequency */ |
2401 |
+ si470x_set_freq(radio, 87.5 * FREQ_MUL); /* available in all regions */ |
2402 |
+@@ -752,6 +752,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, |
2403 |
+ |
2404 |
+ return 0; |
2405 |
+ err_all: |
2406 |
++ usb_kill_urb(radio->int_in_urb); |
2407 |
++err_buf: |
2408 |
+ kfree(radio->buffer); |
2409 |
+ err_ctrl: |
2410 |
+ v4l2_ctrl_handler_free(&radio->hdl); |
2411 |
+@@ -825,6 +827,7 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf) |
2412 |
+ mutex_lock(&radio->lock); |
2413 |
+ v4l2_device_disconnect(&radio->v4l2_dev); |
2414 |
+ video_unregister_device(&radio->videodev); |
2415 |
++ usb_kill_urb(radio->int_in_urb); |
2416 |
+ usb_set_intfdata(intf, NULL); |
2417 |
+ mutex_unlock(&radio->lock); |
2418 |
+ v4l2_device_put(&radio->v4l2_dev); |
2419 |
+diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c |
2420 |
+index 30e24da67226..3c2e248ceca8 100644 |
2421 |
+--- a/drivers/media/rc/iguanair.c |
2422 |
++++ b/drivers/media/rc/iguanair.c |
2423 |
+@@ -427,6 +427,10 @@ static int iguanair_probe(struct usb_interface *intf, |
2424 |
+ int ret, pipein, pipeout; |
2425 |
+ struct usb_host_interface *idesc; |
2426 |
+ |
2427 |
++ idesc = intf->altsetting; |
2428 |
++ if (idesc->desc.bNumEndpoints < 2) |
2429 |
++ return -ENODEV; |
2430 |
++ |
2431 |
+ ir = kzalloc(sizeof(*ir), GFP_KERNEL); |
2432 |
+ rc = rc_allocate_device(RC_DRIVER_IR_RAW); |
2433 |
+ if (!ir || !rc) { |
2434 |
+@@ -441,18 +445,13 @@ static int iguanair_probe(struct usb_interface *intf, |
2435 |
+ ir->urb_in = usb_alloc_urb(0, GFP_KERNEL); |
2436 |
+ ir->urb_out = usb_alloc_urb(0, GFP_KERNEL); |
2437 |
+ |
2438 |
+- if (!ir->buf_in || !ir->packet || !ir->urb_in || !ir->urb_out) { |
2439 |
++ if (!ir->buf_in || !ir->packet || !ir->urb_in || !ir->urb_out || |
2440 |
++ !usb_endpoint_is_int_in(&idesc->endpoint[0].desc) || |
2441 |
++ !usb_endpoint_is_int_out(&idesc->endpoint[1].desc)) { |
2442 |
+ ret = -ENOMEM; |
2443 |
+ goto out; |
2444 |
+ } |
2445 |
+ |
2446 |
+- idesc = intf->altsetting; |
2447 |
+- |
2448 |
+- if (idesc->desc.bNumEndpoints < 2) { |
2449 |
+- ret = -ENODEV; |
2450 |
+- goto out; |
2451 |
+- } |
2452 |
+- |
2453 |
+ ir->rc = rc; |
2454 |
+ ir->dev = &intf->dev; |
2455 |
+ ir->udev = udev; |
2456 |
+diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c |
2457 |
+index 0c46155a8e9d..a7547c88e4c3 100644 |
2458 |
+--- a/drivers/media/rc/imon.c |
2459 |
++++ b/drivers/media/rc/imon.c |
2460 |
+@@ -1963,12 +1963,17 @@ static void imon_get_ffdc_type(struct imon_context *ictx) |
2461 |
+ break; |
2462 |
+ /* iMON VFD, MCE IR */ |
2463 |
+ case 0x46: |
2464 |
+- case 0x7e: |
2465 |
+ case 0x9e: |
2466 |
+ dev_info(ictx->dev, "0xffdc iMON VFD, MCE IR"); |
2467 |
+ detected_display_type = IMON_DISPLAY_TYPE_VFD; |
2468 |
+ allowed_protos = RC_PROTO_BIT_RC6_MCE; |
2469 |
+ break; |
2470 |
++ /* iMON VFD, iMON or MCE IR */ |
2471 |
++ case 0x7e: |
2472 |
++ dev_info(ictx->dev, "0xffdc iMON VFD, iMON or MCE IR"); |
2473 |
++ detected_display_type = IMON_DISPLAY_TYPE_VFD; |
2474 |
++ allowed_protos |= RC_PROTO_BIT_RC6_MCE; |
2475 |
++ break; |
2476 |
+ /* iMON LCD, MCE IR */ |
2477 |
+ case 0x9f: |
2478 |
+ dev_info(ictx->dev, "0xffdc iMON LCD, MCE IR"); |
2479 |
+diff --git a/drivers/media/rc/mtk-cir.c b/drivers/media/rc/mtk-cir.c |
2480 |
+index e88eb64e8e69..00a4a0dfcab8 100644 |
2481 |
+--- a/drivers/media/rc/mtk-cir.c |
2482 |
++++ b/drivers/media/rc/mtk-cir.c |
2483 |
+@@ -44,6 +44,11 @@ |
2484 |
+ /* Fields containing pulse width data */ |
2485 |
+ #define MTK_WIDTH_MASK (GENMASK(7, 0)) |
2486 |
+ |
2487 |
++/* IR threshold */ |
2488 |
++#define MTK_IRTHD 0x14 |
2489 |
++#define MTK_DG_CNT_MASK (GENMASK(12, 8)) |
2490 |
++#define MTK_DG_CNT(x) ((x) << 8) |
2491 |
++ |
2492 |
+ /* Bit to enable interrupt */ |
2493 |
+ #define MTK_IRINT_EN BIT(0) |
2494 |
+ |
2495 |
+@@ -411,6 +416,9 @@ static int mtk_ir_probe(struct platform_device *pdev) |
2496 |
+ mtk_w32_mask(ir, val, ir->data->fields[MTK_HW_PERIOD].mask, |
2497 |
+ ir->data->fields[MTK_HW_PERIOD].reg); |
2498 |
+ |
2499 |
++ /* Set de-glitch counter */ |
2500 |
++ mtk_w32_mask(ir, MTK_DG_CNT(1), MTK_DG_CNT_MASK, MTK_IRTHD); |
2501 |
++ |
2502 |
+ /* Enable IR and PWM */ |
2503 |
+ val = mtk_r32(ir, MTK_CONFIG_HIGH_REG); |
2504 |
+ val |= MTK_OK_COUNT(ir->data->ok_count) | MTK_PWM_EN | MTK_IR_EN; |
2505 |
+diff --git a/drivers/media/usb/cpia2/cpia2_usb.c b/drivers/media/usb/cpia2/cpia2_usb.c |
2506 |
+index 0964ff556f4e..91b9eaa9b2ad 100644 |
2507 |
+--- a/drivers/media/usb/cpia2/cpia2_usb.c |
2508 |
++++ b/drivers/media/usb/cpia2/cpia2_usb.c |
2509 |
+@@ -684,6 +684,10 @@ static int submit_urbs(struct camera_data *cam) |
2510 |
+ if (!urb) { |
2511 |
+ for (j = 0; j < i; j++) |
2512 |
+ usb_free_urb(cam->sbuf[j].urb); |
2513 |
++ for (j = 0; j < NUM_SBUF; j++) { |
2514 |
++ kfree(cam->sbuf[j].data); |
2515 |
++ cam->sbuf[j].data = NULL; |
2516 |
++ } |
2517 |
+ return -ENOMEM; |
2518 |
+ } |
2519 |
+ |
2520 |
+diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c |
2521 |
+index 9be1e658ef47..969358f57d91 100644 |
2522 |
+--- a/drivers/media/usb/dvb-usb/dib0700_devices.c |
2523 |
++++ b/drivers/media/usb/dvb-usb/dib0700_devices.c |
2524 |
+@@ -2438,9 +2438,13 @@ static int dib9090_tuner_attach(struct dvb_usb_adapter *adap) |
2525 |
+ 8, 0x0486, |
2526 |
+ }; |
2527 |
+ |
2528 |
++ if (!IS_ENABLED(CONFIG_DVB_DIB9000)) |
2529 |
++ return -ENODEV; |
2530 |
+ if (dvb_attach(dib0090_fw_register, adap->fe_adap[0].fe, i2c, &dib9090_dib0090_config) == NULL) |
2531 |
+ return -ENODEV; |
2532 |
+ i2c = dib9000_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); |
2533 |
++ if (!i2c) |
2534 |
++ return -ENODEV; |
2535 |
+ if (dib01x0_pmu_update(i2c, data_dib190, 10) != 0) |
2536 |
+ return -ENODEV; |
2537 |
+ dib0700_set_i2c_speed(adap->dev, 1500); |
2538 |
+@@ -2516,10 +2520,14 @@ static int nim9090md_tuner_attach(struct dvb_usb_adapter *adap) |
2539 |
+ 0, 0x00ef, |
2540 |
+ 8, 0x0406, |
2541 |
+ }; |
2542 |
++ if (!IS_ENABLED(CONFIG_DVB_DIB9000)) |
2543 |
++ return -ENODEV; |
2544 |
+ i2c = dib9000_get_tuner_interface(adap->fe_adap[0].fe); |
2545 |
+ if (dvb_attach(dib0090_fw_register, adap->fe_adap[0].fe, i2c, &nim9090md_dib0090_config[0]) == NULL) |
2546 |
+ return -ENODEV; |
2547 |
+ i2c = dib9000_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); |
2548 |
++ if (!i2c) |
2549 |
++ return -ENODEV; |
2550 |
+ if (dib01x0_pmu_update(i2c, data_dib190, 10) < 0) |
2551 |
+ return -ENODEV; |
2552 |
+ |
2553 |
+diff --git a/drivers/media/usb/gspca/konica.c b/drivers/media/usb/gspca/konica.c |
2554 |
+index 31b2117e8f1d..4fac3315cfe6 100644 |
2555 |
+--- a/drivers/media/usb/gspca/konica.c |
2556 |
++++ b/drivers/media/usb/gspca/konica.c |
2557 |
+@@ -123,6 +123,11 @@ static void reg_r(struct gspca_dev *gspca_dev, u16 value, u16 index) |
2558 |
+ if (ret < 0) { |
2559 |
+ pr_err("reg_r err %d\n", ret); |
2560 |
+ gspca_dev->usb_err = ret; |
2561 |
++ /* |
2562 |
++ * Make sure the buffer is zeroed to avoid uninitialized |
2563 |
++ * values. |
2564 |
++ */ |
2565 |
++ memset(gspca_dev->usb_buf, 0, 2); |
2566 |
+ } |
2567 |
+ } |
2568 |
+ |
2569 |
+diff --git a/drivers/media/usb/gspca/nw80x.c b/drivers/media/usb/gspca/nw80x.c |
2570 |
+index 5d2d0bcb038d..4c95341864da 100644 |
2571 |
+--- a/drivers/media/usb/gspca/nw80x.c |
2572 |
++++ b/drivers/media/usb/gspca/nw80x.c |
2573 |
+@@ -1580,6 +1580,11 @@ static void reg_r(struct gspca_dev *gspca_dev, |
2574 |
+ if (ret < 0) { |
2575 |
+ pr_err("reg_r err %d\n", ret); |
2576 |
+ gspca_dev->usb_err = ret; |
2577 |
++ /* |
2578 |
++ * Make sure the buffer is zeroed to avoid uninitialized |
2579 |
++ * values. |
2580 |
++ */ |
2581 |
++ memset(gspca_dev->usb_buf, 0, USB_BUF_SZ); |
2582 |
+ return; |
2583 |
+ } |
2584 |
+ if (len == 1) |
2585 |
+diff --git a/drivers/media/usb/gspca/ov519.c b/drivers/media/usb/gspca/ov519.c |
2586 |
+index cdb79c5f0c38..8106a47a0dd0 100644 |
2587 |
+--- a/drivers/media/usb/gspca/ov519.c |
2588 |
++++ b/drivers/media/usb/gspca/ov519.c |
2589 |
+@@ -2083,6 +2083,11 @@ static int reg_r(struct sd *sd, u16 index) |
2590 |
+ } else { |
2591 |
+ PERR("reg_r %02x failed %d\n", index, ret); |
2592 |
+ sd->gspca_dev.usb_err = ret; |
2593 |
++ /* |
2594 |
++ * Make sure the result is zeroed to avoid uninitialized |
2595 |
++ * values. |
2596 |
++ */ |
2597 |
++ gspca_dev->usb_buf[0] = 0; |
2598 |
+ } |
2599 |
+ |
2600 |
+ return ret; |
2601 |
+@@ -2111,6 +2116,11 @@ static int reg_r8(struct sd *sd, |
2602 |
+ } else { |
2603 |
+ PERR("reg_r8 %02x failed %d\n", index, ret); |
2604 |
+ sd->gspca_dev.usb_err = ret; |
2605 |
++ /* |
2606 |
++ * Make sure the buffer is zeroed to avoid uninitialized |
2607 |
++ * values. |
2608 |
++ */ |
2609 |
++ memset(gspca_dev->usb_buf, 0, 8); |
2610 |
+ } |
2611 |
+ |
2612 |
+ return ret; |
2613 |
+diff --git a/drivers/media/usb/gspca/ov534.c b/drivers/media/usb/gspca/ov534.c |
2614 |
+index 32849ff86b09..25c0d349fdab 100644 |
2615 |
+--- a/drivers/media/usb/gspca/ov534.c |
2616 |
++++ b/drivers/media/usb/gspca/ov534.c |
2617 |
+@@ -641,6 +641,11 @@ static u8 ov534_reg_read(struct gspca_dev *gspca_dev, u16 reg) |
2618 |
+ if (ret < 0) { |
2619 |
+ pr_err("read failed %d\n", ret); |
2620 |
+ gspca_dev->usb_err = ret; |
2621 |
++ /* |
2622 |
++ * Make sure the result is zeroed to avoid uninitialized |
2623 |
++ * values. |
2624 |
++ */ |
2625 |
++ gspca_dev->usb_buf[0] = 0; |
2626 |
+ } |
2627 |
+ return gspca_dev->usb_buf[0]; |
2628 |
+ } |
2629 |
+diff --git a/drivers/media/usb/gspca/ov534_9.c b/drivers/media/usb/gspca/ov534_9.c |
2630 |
+index b2a92e518118..dadfe1effbc2 100644 |
2631 |
+--- a/drivers/media/usb/gspca/ov534_9.c |
2632 |
++++ b/drivers/media/usb/gspca/ov534_9.c |
2633 |
+@@ -1153,6 +1153,7 @@ static u8 reg_r(struct gspca_dev *gspca_dev, u16 reg) |
2634 |
+ if (ret < 0) { |
2635 |
+ pr_err("reg_r err %d\n", ret); |
2636 |
+ gspca_dev->usb_err = ret; |
2637 |
++ return 0; |
2638 |
+ } |
2639 |
+ return gspca_dev->usb_buf[0]; |
2640 |
+ } |
2641 |
+diff --git a/drivers/media/usb/gspca/se401.c b/drivers/media/usb/gspca/se401.c |
2642 |
+index 477da0664b7d..40b87717bb5c 100644 |
2643 |
+--- a/drivers/media/usb/gspca/se401.c |
2644 |
++++ b/drivers/media/usb/gspca/se401.c |
2645 |
+@@ -111,6 +111,11 @@ static void se401_read_req(struct gspca_dev *gspca_dev, u16 req, int silent) |
2646 |
+ pr_err("read req failed req %#04x error %d\n", |
2647 |
+ req, err); |
2648 |
+ gspca_dev->usb_err = err; |
2649 |
++ /* |
2650 |
++ * Make sure the buffer is zeroed to avoid uninitialized |
2651 |
++ * values. |
2652 |
++ */ |
2653 |
++ memset(gspca_dev->usb_buf, 0, READ_REQ_SIZE); |
2654 |
+ } |
2655 |
+ } |
2656 |
+ |
2657 |
+diff --git a/drivers/media/usb/gspca/sn9c20x.c b/drivers/media/usb/gspca/sn9c20x.c |
2658 |
+index c605f78d6186..948fa2d0c5cc 100644 |
2659 |
+--- a/drivers/media/usb/gspca/sn9c20x.c |
2660 |
++++ b/drivers/media/usb/gspca/sn9c20x.c |
2661 |
+@@ -132,6 +132,13 @@ static const struct dmi_system_id flip_dmi_table[] = { |
2662 |
+ DMI_MATCH(DMI_PRODUCT_VERSION, "0341") |
2663 |
+ } |
2664 |
+ }, |
2665 |
++ { |
2666 |
++ .ident = "MSI MS-1039", |
2667 |
++ .matches = { |
2668 |
++ DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT'L CO.,LTD."), |
2669 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "MS-1039"), |
2670 |
++ } |
2671 |
++ }, |
2672 |
+ { |
2673 |
+ .ident = "MSI MS-1632", |
2674 |
+ .matches = { |
2675 |
+@@ -918,6 +925,11 @@ static void reg_r(struct gspca_dev *gspca_dev, u16 reg, u16 length) |
2676 |
+ if (unlikely(result < 0 || result != length)) { |
2677 |
+ pr_err("Read register %02x failed %d\n", reg, result); |
2678 |
+ gspca_dev->usb_err = result; |
2679 |
++ /* |
2680 |
++ * Make sure the buffer is zeroed to avoid uninitialized |
2681 |
++ * values. |
2682 |
++ */ |
2683 |
++ memset(gspca_dev->usb_buf, 0, USB_BUF_SZ); |
2684 |
+ } |
2685 |
+ } |
2686 |
+ |
2687 |
+diff --git a/drivers/media/usb/gspca/sonixb.c b/drivers/media/usb/gspca/sonixb.c |
2688 |
+index 5f3f2979540a..22de65d840dd 100644 |
2689 |
+--- a/drivers/media/usb/gspca/sonixb.c |
2690 |
++++ b/drivers/media/usb/gspca/sonixb.c |
2691 |
+@@ -462,6 +462,11 @@ static void reg_r(struct gspca_dev *gspca_dev, |
2692 |
+ dev_err(gspca_dev->v4l2_dev.dev, |
2693 |
+ "Error reading register %02x: %d\n", value, res); |
2694 |
+ gspca_dev->usb_err = res; |
2695 |
++ /* |
2696 |
++ * Make sure the result is zeroed to avoid uninitialized |
2697 |
++ * values. |
2698 |
++ */ |
2699 |
++ gspca_dev->usb_buf[0] = 0; |
2700 |
+ } |
2701 |
+ } |
2702 |
+ |
2703 |
+diff --git a/drivers/media/usb/gspca/sonixj.c b/drivers/media/usb/gspca/sonixj.c |
2704 |
+index 5eeaf16ac5e8..c53002a5ccb7 100644 |
2705 |
+--- a/drivers/media/usb/gspca/sonixj.c |
2706 |
++++ b/drivers/media/usb/gspca/sonixj.c |
2707 |
+@@ -1170,6 +1170,11 @@ static void reg_r(struct gspca_dev *gspca_dev, |
2708 |
+ if (ret < 0) { |
2709 |
+ pr_err("reg_r err %d\n", ret); |
2710 |
+ gspca_dev->usb_err = ret; |
2711 |
++ /* |
2712 |
++ * Make sure the buffer is zeroed to avoid uninitialized |
2713 |
++ * values. |
2714 |
++ */ |
2715 |
++ memset(gspca_dev->usb_buf, 0, USB_BUF_SZ); |
2716 |
+ } |
2717 |
+ } |
2718 |
+ |
2719 |
+diff --git a/drivers/media/usb/gspca/spca1528.c b/drivers/media/usb/gspca/spca1528.c |
2720 |
+index 327ec901abe1..769a9d95d2fa 100644 |
2721 |
+--- a/drivers/media/usb/gspca/spca1528.c |
2722 |
++++ b/drivers/media/usb/gspca/spca1528.c |
2723 |
+@@ -80,6 +80,11 @@ static void reg_r(struct gspca_dev *gspca_dev, |
2724 |
+ if (ret < 0) { |
2725 |
+ pr_err("reg_r err %d\n", ret); |
2726 |
+ gspca_dev->usb_err = ret; |
2727 |
++ /* |
2728 |
++ * Make sure the buffer is zeroed to avoid uninitialized |
2729 |
++ * values. |
2730 |
++ */ |
2731 |
++ memset(gspca_dev->usb_buf, 0, USB_BUF_SZ); |
2732 |
+ } |
2733 |
+ } |
2734 |
+ |
2735 |
+diff --git a/drivers/media/usb/gspca/sq930x.c b/drivers/media/usb/gspca/sq930x.c |
2736 |
+index aa9a9411b801..a3e261685ebd 100644 |
2737 |
+--- a/drivers/media/usb/gspca/sq930x.c |
2738 |
++++ b/drivers/media/usb/gspca/sq930x.c |
2739 |
+@@ -434,6 +434,11 @@ static void reg_r(struct gspca_dev *gspca_dev, |
2740 |
+ if (ret < 0) { |
2741 |
+ pr_err("reg_r %04x failed %d\n", value, ret); |
2742 |
+ gspca_dev->usb_err = ret; |
2743 |
++ /* |
2744 |
++ * Make sure the buffer is zeroed to avoid uninitialized |
2745 |
++ * values. |
2746 |
++ */ |
2747 |
++ memset(gspca_dev->usb_buf, 0, USB_BUF_SZ); |
2748 |
+ } |
2749 |
+ } |
2750 |
+ |
2751 |
+diff --git a/drivers/media/usb/gspca/sunplus.c b/drivers/media/usb/gspca/sunplus.c |
2752 |
+index 8c2785aea3cd..d87fcff38310 100644 |
2753 |
+--- a/drivers/media/usb/gspca/sunplus.c |
2754 |
++++ b/drivers/media/usb/gspca/sunplus.c |
2755 |
+@@ -264,6 +264,11 @@ static void reg_r(struct gspca_dev *gspca_dev, |
2756 |
+ if (ret < 0) { |
2757 |
+ pr_err("reg_r err %d\n", ret); |
2758 |
+ gspca_dev->usb_err = ret; |
2759 |
++ /* |
2760 |
++ * Make sure the buffer is zeroed to avoid uninitialized |
2761 |
++ * values. |
2762 |
++ */ |
2763 |
++ memset(gspca_dev->usb_buf, 0, USB_BUF_SZ); |
2764 |
+ } |
2765 |
+ } |
2766 |
+ |
2767 |
+diff --git a/drivers/media/usb/gspca/vc032x.c b/drivers/media/usb/gspca/vc032x.c |
2768 |
+index b935febf7146..c026c513f65f 100644 |
2769 |
+--- a/drivers/media/usb/gspca/vc032x.c |
2770 |
++++ b/drivers/media/usb/gspca/vc032x.c |
2771 |
+@@ -2915,6 +2915,11 @@ static void reg_r_i(struct gspca_dev *gspca_dev, |
2772 |
+ if (ret < 0) { |
2773 |
+ pr_err("reg_r err %d\n", ret); |
2774 |
+ gspca_dev->usb_err = ret; |
2775 |
++ /* |
2776 |
++ * Make sure the buffer is zeroed to avoid uninitialized |
2777 |
++ * values. |
2778 |
++ */ |
2779 |
++ memset(gspca_dev->usb_buf, 0, USB_BUF_SZ); |
2780 |
+ } |
2781 |
+ } |
2782 |
+ static void reg_r(struct gspca_dev *gspca_dev, |
2783 |
+diff --git a/drivers/media/usb/gspca/w996Xcf.c b/drivers/media/usb/gspca/w996Xcf.c |
2784 |
+index 728d2322c433..cd10e717c7e5 100644 |
2785 |
+--- a/drivers/media/usb/gspca/w996Xcf.c |
2786 |
++++ b/drivers/media/usb/gspca/w996Xcf.c |
2787 |
+@@ -143,6 +143,11 @@ static int w9968cf_read_sb(struct sd *sd) |
2788 |
+ } else { |
2789 |
+ pr_err("Read SB reg [01] failed\n"); |
2790 |
+ sd->gspca_dev.usb_err = ret; |
2791 |
++ /* |
2792 |
++ * Make sure the buffer is zeroed to avoid uninitialized |
2793 |
++ * values. |
2794 |
++ */ |
2795 |
++ memset(sd->gspca_dev.usb_buf, 0, 2); |
2796 |
+ } |
2797 |
+ |
2798 |
+ udelay(W9968CF_I2C_BUS_DELAY); |
2799 |
+diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c |
2800 |
+index 1e8cbaf36896..dd82948b1cb0 100644 |
2801 |
+--- a/drivers/media/usb/hdpvr/hdpvr-core.c |
2802 |
++++ b/drivers/media/usb/hdpvr/hdpvr-core.c |
2803 |
+@@ -141,6 +141,7 @@ static int device_authorization(struct hdpvr_device *dev) |
2804 |
+ |
2805 |
+ dev->fw_ver = dev->usbc_buf[1]; |
2806 |
+ |
2807 |
++ dev->usbc_buf[46] = '\0'; |
2808 |
+ v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n", |
2809 |
+ dev->fw_ver, &dev->usbc_buf[2]); |
2810 |
+ |
2811 |
+@@ -275,6 +276,7 @@ static int hdpvr_probe(struct usb_interface *interface, |
2812 |
+ #endif |
2813 |
+ size_t buffer_size; |
2814 |
+ int i; |
2815 |
++ int dev_num; |
2816 |
+ int retval = -ENOMEM; |
2817 |
+ |
2818 |
+ /* allocate memory for our device state and initialize it */ |
2819 |
+@@ -379,8 +381,17 @@ static int hdpvr_probe(struct usb_interface *interface, |
2820 |
+ } |
2821 |
+ #endif |
2822 |
+ |
2823 |
++ dev_num = atomic_inc_return(&dev_nr); |
2824 |
++ if (dev_num >= HDPVR_MAX) { |
2825 |
++ v4l2_err(&dev->v4l2_dev, |
2826 |
++ "max device number reached, device register failed\n"); |
2827 |
++ atomic_dec(&dev_nr); |
2828 |
++ retval = -ENODEV; |
2829 |
++ goto reg_fail; |
2830 |
++ } |
2831 |
++ |
2832 |
+ retval = hdpvr_register_videodev(dev, &interface->dev, |
2833 |
+- video_nr[atomic_inc_return(&dev_nr)]); |
2834 |
++ video_nr[dev_num]); |
2835 |
+ if (retval < 0) { |
2836 |
+ v4l2_err(&dev->v4l2_dev, "registering videodev failed\n"); |
2837 |
+ goto reg_fail; |
2838 |
+diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c b/drivers/media/usb/ttusb-dec/ttusb_dec.c |
2839 |
+index cdefb5dfbbdc..cad274615816 100644 |
2840 |
+--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c |
2841 |
++++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c |
2842 |
+@@ -330,7 +330,7 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command, |
2843 |
+ |
2844 |
+ dprintk("%s\n", __func__); |
2845 |
+ |
2846 |
+- b = kmalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL); |
2847 |
++ b = kzalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL); |
2848 |
+ if (!b) |
2849 |
+ return -ENOMEM; |
2850 |
+ |
2851 |
+diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c |
2852 |
+index 2fdd84c67f19..0656d740b0dd 100644 |
2853 |
+--- a/drivers/mmc/core/sdio_irq.c |
2854 |
++++ b/drivers/mmc/core/sdio_irq.c |
2855 |
+@@ -35,6 +35,7 @@ static int process_sdio_pending_irqs(struct mmc_host *host) |
2856 |
+ { |
2857 |
+ struct mmc_card *card = host->card; |
2858 |
+ int i, ret, count; |
2859 |
++ bool sdio_irq_pending = host->sdio_irq_pending; |
2860 |
+ unsigned char pending; |
2861 |
+ struct sdio_func *func; |
2862 |
+ |
2863 |
+@@ -42,13 +43,16 @@ static int process_sdio_pending_irqs(struct mmc_host *host) |
2864 |
+ if (mmc_card_suspended(card)) |
2865 |
+ return 0; |
2866 |
+ |
2867 |
++ /* Clear the flag to indicate that we have processed the IRQ. */ |
2868 |
++ host->sdio_irq_pending = false; |
2869 |
++ |
2870 |
+ /* |
2871 |
+ * Optimization, if there is only 1 function interrupt registered |
2872 |
+ * and we know an IRQ was signaled then call irq handler directly. |
2873 |
+ * Otherwise do the full probe. |
2874 |
+ */ |
2875 |
+ func = card->sdio_single_irq; |
2876 |
+- if (func && host->sdio_irq_pending) { |
2877 |
++ if (func && sdio_irq_pending) { |
2878 |
+ func->irq_handler(func); |
2879 |
+ return 1; |
2880 |
+ } |
2881 |
+@@ -100,7 +104,6 @@ void sdio_run_irqs(struct mmc_host *host) |
2882 |
+ { |
2883 |
+ mmc_claim_host(host); |
2884 |
+ if (host->sdio_irqs) { |
2885 |
+- host->sdio_irq_pending = true; |
2886 |
+ process_sdio_pending_irqs(host); |
2887 |
+ if (host->ops->ack_sdio_irq) |
2888 |
+ host->ops->ack_sdio_irq(host); |
2889 |
+@@ -119,6 +122,7 @@ void sdio_irq_work(struct work_struct *work) |
2890 |
+ |
2891 |
+ void sdio_signal_irq(struct mmc_host *host) |
2892 |
+ { |
2893 |
++ host->sdio_irq_pending = true; |
2894 |
+ queue_delayed_work(system_wq, &host->sdio_irq_work, 0); |
2895 |
+ } |
2896 |
+ EXPORT_SYMBOL_GPL(sdio_signal_irq); |
2897 |
+@@ -163,7 +167,6 @@ static int sdio_irq_thread(void *_host) |
2898 |
+ if (ret) |
2899 |
+ break; |
2900 |
+ ret = process_sdio_pending_irqs(host); |
2901 |
+- host->sdio_irq_pending = false; |
2902 |
+ mmc_release_host(host); |
2903 |
+ |
2904 |
+ /* |
2905 |
+diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c |
2906 |
+index 9540fda7fc6b..3741d4c846e5 100644 |
2907 |
+--- a/drivers/mmc/host/sdhci.c |
2908 |
++++ b/drivers/mmc/host/sdhci.c |
2909 |
+@@ -1635,7 +1635,9 @@ void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing) |
2910 |
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR104; |
2911 |
+ else if (timing == MMC_TIMING_UHS_SDR12) |
2912 |
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR12; |
2913 |
+- else if (timing == MMC_TIMING_UHS_SDR25) |
2914 |
++ else if (timing == MMC_TIMING_SD_HS || |
2915 |
++ timing == MMC_TIMING_MMC_HS || |
2916 |
++ timing == MMC_TIMING_UHS_SDR25) |
2917 |
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR25; |
2918 |
+ else if (timing == MMC_TIMING_UHS_SDR50) |
2919 |
+ ctrl_2 |= SDHCI_CTRL_UHS_SDR50; |
2920 |
+diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c |
2921 |
+index af3d207c9cc4..e773dc6fdd3c 100644 |
2922 |
+--- a/drivers/mtd/chips/cfi_cmdset_0002.c |
2923 |
++++ b/drivers/mtd/chips/cfi_cmdset_0002.c |
2924 |
+@@ -1628,29 +1628,35 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip, |
2925 |
+ continue; |
2926 |
+ } |
2927 |
+ |
2928 |
+- if (time_after(jiffies, timeo) && !chip_ready(map, adr)){ |
2929 |
++ /* |
2930 |
++ * We check "time_after" and "!chip_good" before checking |
2931 |
++ * "chip_good" to avoid the failure due to scheduling. |
2932 |
++ */ |
2933 |
++ if (time_after(jiffies, timeo) && !chip_good(map, adr, datum)) { |
2934 |
+ xip_enable(map, chip, adr); |
2935 |
+ printk(KERN_WARNING "MTD %s(): software timeout\n", __func__); |
2936 |
+ xip_disable(map, chip, adr); |
2937 |
++ ret = -EIO; |
2938 |
+ break; |
2939 |
+ } |
2940 |
+ |
2941 |
+- if (chip_ready(map, adr)) |
2942 |
++ if (chip_good(map, adr, datum)) |
2943 |
+ break; |
2944 |
+ |
2945 |
+ /* Latency issues. Drop the lock, wait a while and retry */ |
2946 |
+ UDELAY(map, chip, adr, 1); |
2947 |
+ } |
2948 |
++ |
2949 |
+ /* Did we succeed? */ |
2950 |
+- if (!chip_good(map, adr, datum)) { |
2951 |
++ if (ret) { |
2952 |
+ /* reset on all failures. */ |
2953 |
+ map_write( map, CMD(0xF0), chip->start ); |
2954 |
+ /* FIXME - should have reset delay before continuing */ |
2955 |
+ |
2956 |
+- if (++retry_cnt <= MAX_RETRIES) |
2957 |
++ if (++retry_cnt <= MAX_RETRIES) { |
2958 |
++ ret = 0; |
2959 |
+ goto retry; |
2960 |
+- |
2961 |
+- ret = -EIO; |
2962 |
++ } |
2963 |
+ } |
2964 |
+ xip_enable(map, chip, adr); |
2965 |
+ op_done: |
2966 |
+diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c |
2967 |
+index fcfccbb3d9a2..998bc7bc7d1f 100644 |
2968 |
+--- a/drivers/net/arcnet/arcnet.c |
2969 |
++++ b/drivers/net/arcnet/arcnet.c |
2970 |
+@@ -1064,31 +1064,34 @@ EXPORT_SYMBOL(arcnet_interrupt); |
2971 |
+ static void arcnet_rx(struct net_device *dev, int bufnum) |
2972 |
+ { |
2973 |
+ struct arcnet_local *lp = netdev_priv(dev); |
2974 |
+- struct archdr pkt; |
2975 |
++ union { |
2976 |
++ struct archdr pkt; |
2977 |
++ char buf[512]; |
2978 |
++ } rxdata; |
2979 |
+ struct arc_rfc1201 *soft; |
2980 |
+ int length, ofs; |
2981 |
+ |
2982 |
+- soft = &pkt.soft.rfc1201; |
2983 |
++ soft = &rxdata.pkt.soft.rfc1201; |
2984 |
+ |
2985 |
+- lp->hw.copy_from_card(dev, bufnum, 0, &pkt, ARC_HDR_SIZE); |
2986 |
+- if (pkt.hard.offset[0]) { |
2987 |
+- ofs = pkt.hard.offset[0]; |
2988 |
++ lp->hw.copy_from_card(dev, bufnum, 0, &rxdata.pkt, ARC_HDR_SIZE); |
2989 |
++ if (rxdata.pkt.hard.offset[0]) { |
2990 |
++ ofs = rxdata.pkt.hard.offset[0]; |
2991 |
+ length = 256 - ofs; |
2992 |
+ } else { |
2993 |
+- ofs = pkt.hard.offset[1]; |
2994 |
++ ofs = rxdata.pkt.hard.offset[1]; |
2995 |
+ length = 512 - ofs; |
2996 |
+ } |
2997 |
+ |
2998 |
+ /* get the full header, if possible */ |
2999 |
+- if (sizeof(pkt.soft) <= length) { |
3000 |
+- lp->hw.copy_from_card(dev, bufnum, ofs, soft, sizeof(pkt.soft)); |
3001 |
++ if (sizeof(rxdata.pkt.soft) <= length) { |
3002 |
++ lp->hw.copy_from_card(dev, bufnum, ofs, soft, sizeof(rxdata.pkt.soft)); |
3003 |
+ } else { |
3004 |
+- memset(&pkt.soft, 0, sizeof(pkt.soft)); |
3005 |
++ memset(&rxdata.pkt.soft, 0, sizeof(rxdata.pkt.soft)); |
3006 |
+ lp->hw.copy_from_card(dev, bufnum, ofs, soft, length); |
3007 |
+ } |
3008 |
+ |
3009 |
+ arc_printk(D_DURING, dev, "Buffer #%d: received packet from %02Xh to %02Xh (%d+4 bytes)\n", |
3010 |
+- bufnum, pkt.hard.source, pkt.hard.dest, length); |
3011 |
++ bufnum, rxdata.pkt.hard.source, rxdata.pkt.hard.dest, length); |
3012 |
+ |
3013 |
+ dev->stats.rx_packets++; |
3014 |
+ dev->stats.rx_bytes += length + ARC_HDR_SIZE; |
3015 |
+@@ -1097,13 +1100,13 @@ static void arcnet_rx(struct net_device *dev, int bufnum) |
3016 |
+ if (arc_proto_map[soft->proto]->is_ip) { |
3017 |
+ if (BUGLVL(D_PROTO)) { |
3018 |
+ struct ArcProto |
3019 |
+- *oldp = arc_proto_map[lp->default_proto[pkt.hard.source]], |
3020 |
++ *oldp = arc_proto_map[lp->default_proto[rxdata.pkt.hard.source]], |
3021 |
+ *newp = arc_proto_map[soft->proto]; |
3022 |
+ |
3023 |
+ if (oldp != newp) { |
3024 |
+ arc_printk(D_PROTO, dev, |
3025 |
+ "got protocol %02Xh; encap for host %02Xh is now '%c' (was '%c')\n", |
3026 |
+- soft->proto, pkt.hard.source, |
3027 |
++ soft->proto, rxdata.pkt.hard.source, |
3028 |
+ newp->suffix, oldp->suffix); |
3029 |
+ } |
3030 |
+ } |
3031 |
+@@ -1112,10 +1115,10 @@ static void arcnet_rx(struct net_device *dev, int bufnum) |
3032 |
+ lp->default_proto[0] = soft->proto; |
3033 |
+ |
3034 |
+ /* in striking contrast, the following isn't a hack. */ |
3035 |
+- lp->default_proto[pkt.hard.source] = soft->proto; |
3036 |
++ lp->default_proto[rxdata.pkt.hard.source] = soft->proto; |
3037 |
+ } |
3038 |
+ /* call the protocol-specific receiver. */ |
3039 |
+- arc_proto_map[soft->proto]->rx(dev, bufnum, &pkt, length); |
3040 |
++ arc_proto_map[soft->proto]->rx(dev, bufnum, &rxdata.pkt, length); |
3041 |
+ } |
3042 |
+ |
3043 |
+ static void null_rx(struct net_device *dev, int bufnum, |
3044 |
+diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c |
3045 |
+index 00eedf202e62..1e990f9dd379 100644 |
3046 |
+--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c |
3047 |
++++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c |
3048 |
+@@ -1447,6 +1447,16 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) |
3049 |
+ else |
3050 |
+ phy_reg |= 0xFA; |
3051 |
+ e1e_wphy_locked(hw, I217_PLL_CLOCK_GATE_REG, phy_reg); |
3052 |
++ |
3053 |
++ if (speed == SPEED_1000) { |
3054 |
++ hw->phy.ops.read_reg_locked(hw, HV_PM_CTRL, |
3055 |
++ &phy_reg); |
3056 |
++ |
3057 |
++ phy_reg |= HV_PM_CTRL_K1_CLK_REQ; |
3058 |
++ |
3059 |
++ hw->phy.ops.write_reg_locked(hw, HV_PM_CTRL, |
3060 |
++ phy_reg); |
3061 |
++ } |
3062 |
+ } |
3063 |
+ hw->phy.ops.release(hw); |
3064 |
+ |
3065 |
+diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.h b/drivers/net/ethernet/intel/e1000e/ich8lan.h |
3066 |
+index 00a36df02a3f..88df80c0894b 100644 |
3067 |
+--- a/drivers/net/ethernet/intel/e1000e/ich8lan.h |
3068 |
++++ b/drivers/net/ethernet/intel/e1000e/ich8lan.h |
3069 |
+@@ -228,7 +228,7 @@ |
3070 |
+ |
3071 |
+ /* PHY Power Management Control */ |
3072 |
+ #define HV_PM_CTRL PHY_REG(770, 17) |
3073 |
+-#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100 |
3074 |
++#define HV_PM_CTRL_K1_CLK_REQ 0x200 |
3075 |
+ #define HV_PM_CTRL_K1_ENABLE 0x4000 |
3076 |
+ |
3077 |
+ #define I217_PLL_CLOCK_GATE_REG PHY_REG(772, 28) |
3078 |
+diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c |
3079 |
+index 5d00be3aac73..191f20a074a9 100644 |
3080 |
+--- a/drivers/net/ethernet/marvell/skge.c |
3081 |
++++ b/drivers/net/ethernet/marvell/skge.c |
3082 |
+@@ -3122,7 +3122,7 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, |
3083 |
+ skb_put(skb, len); |
3084 |
+ |
3085 |
+ if (dev->features & NETIF_F_RXCSUM) { |
3086 |
+- skb->csum = csum; |
3087 |
++ skb->csum = le16_to_cpu(csum); |
3088 |
+ skb->ip_summed = CHECKSUM_COMPLETE; |
3089 |
+ } |
3090 |
+ |
3091 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c |
3092 |
+index 826d1a4600f3..97874c2568fc 100644 |
3093 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c |
3094 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c |
3095 |
+@@ -1574,6 +1574,7 @@ static const struct pci_device_id mlx5_core_pci_table[] = { |
3096 |
+ { PCI_VDEVICE(MELLANOX, 0x101c), MLX5_PCI_DEV_IS_VF}, /* ConnectX-6 VF */ |
3097 |
+ { PCI_VDEVICE(MELLANOX, 0xa2d2) }, /* BlueField integrated ConnectX-5 network controller */ |
3098 |
+ { PCI_VDEVICE(MELLANOX, 0xa2d3), MLX5_PCI_DEV_IS_VF}, /* BlueField integrated ConnectX-5 network controller VF */ |
3099 |
++ { PCI_VDEVICE(MELLANOX, 0xa2d6) }, /* BlueField-2 integrated ConnectX-6 Dx network controller */ |
3100 |
+ { 0, } |
3101 |
+ }; |
3102 |
+ |
3103 |
+diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c |
3104 |
+index 08381ef8bdb4..41d30f55c946 100644 |
3105 |
+--- a/drivers/net/ethernet/nxp/lpc_eth.c |
3106 |
++++ b/drivers/net/ethernet/nxp/lpc_eth.c |
3107 |
+@@ -1371,13 +1371,14 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) |
3108 |
+ pldat->dma_buff_base_p = dma_handle; |
3109 |
+ |
3110 |
+ netdev_dbg(ndev, "IO address space :%pR\n", res); |
3111 |
+- netdev_dbg(ndev, "IO address size :%d\n", resource_size(res)); |
3112 |
++ netdev_dbg(ndev, "IO address size :%zd\n", |
3113 |
++ (size_t)resource_size(res)); |
3114 |
+ netdev_dbg(ndev, "IO address (mapped) :0x%p\n", |
3115 |
+ pldat->net_base); |
3116 |
+ netdev_dbg(ndev, "IRQ number :%d\n", ndev->irq); |
3117 |
+- netdev_dbg(ndev, "DMA buffer size :%d\n", pldat->dma_buff_size); |
3118 |
+- netdev_dbg(ndev, "DMA buffer P address :0x%08x\n", |
3119 |
+- pldat->dma_buff_base_p); |
3120 |
++ netdev_dbg(ndev, "DMA buffer size :%zd\n", pldat->dma_buff_size); |
3121 |
++ netdev_dbg(ndev, "DMA buffer P address :%pad\n", |
3122 |
++ &pldat->dma_buff_base_p); |
3123 |
+ netdev_dbg(ndev, "DMA buffer V address :0x%p\n", |
3124 |
+ pldat->dma_buff_base_v); |
3125 |
+ |
3126 |
+@@ -1424,8 +1425,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev) |
3127 |
+ if (ret) |
3128 |
+ goto err_out_unregister_netdev; |
3129 |
+ |
3130 |
+- netdev_info(ndev, "LPC mac at 0x%08x irq %d\n", |
3131 |
+- res->start, ndev->irq); |
3132 |
++ netdev_info(ndev, "LPC mac at 0x%08lx irq %d\n", |
3133 |
++ (unsigned long)res->start, ndev->irq); |
3134 |
+ |
3135 |
+ phydev = ndev->phydev; |
3136 |
+ |
3137 |
+diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c |
3138 |
+index 0c69dfbd28ef..aa204c98af79 100644 |
3139 |
+--- a/drivers/net/macsec.c |
3140 |
++++ b/drivers/net/macsec.c |
3141 |
+@@ -1234,6 +1234,7 @@ deliver: |
3142 |
+ macsec_rxsa_put(rx_sa); |
3143 |
+ macsec_rxsc_put(rx_sc); |
3144 |
+ |
3145 |
++ skb_orphan(skb); |
3146 |
+ ret = gro_cells_receive(&macsec->gro_cells, skb); |
3147 |
+ if (ret == NET_RX_SUCCESS) |
3148 |
+ count_rx(dev, skb->len); |
3149 |
+diff --git a/drivers/net/phy/national.c b/drivers/net/phy/national.c |
3150 |
+index 2addf1d3f619..3aa910b3dc89 100644 |
3151 |
+--- a/drivers/net/phy/national.c |
3152 |
++++ b/drivers/net/phy/national.c |
3153 |
+@@ -110,14 +110,17 @@ static void ns_giga_speed_fallback(struct phy_device *phydev, int mode) |
3154 |
+ |
3155 |
+ static void ns_10_base_t_hdx_loopack(struct phy_device *phydev, int disable) |
3156 |
+ { |
3157 |
++ u16 lb_dis = BIT(1); |
3158 |
++ |
3159 |
+ if (disable) |
3160 |
+- ns_exp_write(phydev, 0x1c0, ns_exp_read(phydev, 0x1c0) | 1); |
3161 |
++ ns_exp_write(phydev, 0x1c0, |
3162 |
++ ns_exp_read(phydev, 0x1c0) | lb_dis); |
3163 |
+ else |
3164 |
+ ns_exp_write(phydev, 0x1c0, |
3165 |
+- ns_exp_read(phydev, 0x1c0) & 0xfffe); |
3166 |
++ ns_exp_read(phydev, 0x1c0) & ~lb_dis); |
3167 |
+ |
3168 |
+ pr_debug("10BASE-T HDX loopback %s\n", |
3169 |
+- (ns_exp_read(phydev, 0x1c0) & 0x0001) ? "off" : "on"); |
3170 |
++ (ns_exp_read(phydev, 0x1c0) & lb_dis) ? "off" : "on"); |
3171 |
+ } |
3172 |
+ |
3173 |
+ static int ns_config_init(struct phy_device *phydev) |
3174 |
+diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c |
3175 |
+index 34b24d7e1e2f..8faf4488340d 100644 |
3176 |
+--- a/drivers/net/ppp/ppp_generic.c |
3177 |
++++ b/drivers/net/ppp/ppp_generic.c |
3178 |
+@@ -1433,6 +1433,8 @@ static void __ppp_xmit_process(struct ppp *ppp, struct sk_buff *skb) |
3179 |
+ netif_wake_queue(ppp->dev); |
3180 |
+ else |
3181 |
+ netif_stop_queue(ppp->dev); |
3182 |
++ } else { |
3183 |
++ kfree_skb(skb); |
3184 |
+ } |
3185 |
+ ppp_xmit_unlock(ppp); |
3186 |
+ } |
3187 |
+diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c |
3188 |
+index f5316ab68a0a..ab28487e6048 100644 |
3189 |
+--- a/drivers/net/usb/cdc_ncm.c |
3190 |
++++ b/drivers/net/usb/cdc_ncm.c |
3191 |
+@@ -681,8 +681,12 @@ cdc_ncm_find_endpoints(struct usbnet *dev, struct usb_interface *intf) |
3192 |
+ u8 ep; |
3193 |
+ |
3194 |
+ for (ep = 0; ep < intf->cur_altsetting->desc.bNumEndpoints; ep++) { |
3195 |
+- |
3196 |
+ e = intf->cur_altsetting->endpoint + ep; |
3197 |
++ |
3198 |
++ /* ignore endpoints which cannot transfer data */ |
3199 |
++ if (!usb_endpoint_maxp(&e->desc)) |
3200 |
++ continue; |
3201 |
++ |
3202 |
+ switch (e->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { |
3203 |
+ case USB_ENDPOINT_XFER_INT: |
3204 |
+ if (usb_endpoint_dir_in(&e->desc)) { |
3205 |
+diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c |
3206 |
+index 831a9cec700c..cb9a18eda798 100644 |
3207 |
+--- a/drivers/net/usb/usbnet.c |
3208 |
++++ b/drivers/net/usb/usbnet.c |
3209 |
+@@ -112,6 +112,11 @@ int usbnet_get_endpoints(struct usbnet *dev, struct usb_interface *intf) |
3210 |
+ int intr = 0; |
3211 |
+ |
3212 |
+ e = alt->endpoint + ep; |
3213 |
++ |
3214 |
++ /* ignore endpoints which cannot transfer data */ |
3215 |
++ if (!usb_endpoint_maxp(&e->desc)) |
3216 |
++ continue; |
3217 |
++ |
3218 |
+ switch (e->desc.bmAttributes) { |
3219 |
+ case USB_ENDPOINT_XFER_INT: |
3220 |
+ if (!usb_endpoint_dir_in(&e->desc)) |
3221 |
+@@ -351,6 +356,8 @@ void usbnet_update_max_qlen(struct usbnet *dev) |
3222 |
+ { |
3223 |
+ enum usb_device_speed speed = dev->udev->speed; |
3224 |
+ |
3225 |
++ if (!dev->rx_urb_size || !dev->hard_mtu) |
3226 |
++ goto insanity; |
3227 |
+ switch (speed) { |
3228 |
+ case USB_SPEED_HIGH: |
3229 |
+ dev->rx_qlen = MAX_QUEUE_MEMORY / dev->rx_urb_size; |
3230 |
+@@ -367,6 +374,7 @@ void usbnet_update_max_qlen(struct usbnet *dev) |
3231 |
+ dev->tx_qlen = 5 * MAX_QUEUE_MEMORY / dev->hard_mtu; |
3232 |
+ break; |
3233 |
+ default: |
3234 |
++insanity: |
3235 |
+ dev->rx_qlen = dev->tx_qlen = 4; |
3236 |
+ } |
3237 |
+ } |
3238 |
+diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c |
3239 |
+index f0f2be432d20..efef28012a6b 100644 |
3240 |
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c |
3241 |
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c |
3242 |
+@@ -651,7 +651,7 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb) |
3243 |
+ if (info.control.vif->type == NL80211_IFTYPE_P2P_DEVICE || |
3244 |
+ info.control.vif->type == NL80211_IFTYPE_AP || |
3245 |
+ info.control.vif->type == NL80211_IFTYPE_ADHOC) { |
3246 |
+- if (info.control.vif->type == NL80211_IFTYPE_P2P_DEVICE) |
3247 |
++ if (!ieee80211_is_data(hdr->frame_control)) |
3248 |
+ sta_id = mvmvif->bcast_sta.sta_id; |
3249 |
+ else |
3250 |
+ sta_id = mvmvif->mcast_sta.sta_id; |
3251 |
+diff --git a/drivers/net/wireless/marvell/libertas/if_usb.c b/drivers/net/wireless/marvell/libertas/if_usb.c |
3252 |
+index e4ae2b5a71c2..aad82ff56883 100644 |
3253 |
+--- a/drivers/net/wireless/marvell/libertas/if_usb.c |
3254 |
++++ b/drivers/net/wireless/marvell/libertas/if_usb.c |
3255 |
+@@ -49,7 +49,8 @@ static const struct lbs_fw_table fw_table[] = { |
3256 |
+ { MODEL_8388, "libertas/usb8388_v5.bin", NULL }, |
3257 |
+ { MODEL_8388, "libertas/usb8388.bin", NULL }, |
3258 |
+ { MODEL_8388, "usb8388.bin", NULL }, |
3259 |
+- { MODEL_8682, "libertas/usb8682.bin", NULL } |
3260 |
++ { MODEL_8682, "libertas/usb8682.bin", NULL }, |
3261 |
++ { 0, NULL, NULL } |
3262 |
+ }; |
3263 |
+ |
3264 |
+ static const struct usb_device_id if_usb_table[] = { |
3265 |
+diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c |
3266 |
+index c4a0bf36e752..0e94fd737eb4 100644 |
3267 |
+--- a/drivers/nvme/target/admin-cmd.c |
3268 |
++++ b/drivers/nvme/target/admin-cmd.c |
3269 |
+@@ -49,9 +49,11 @@ static u16 nvmet_get_smart_log_nsid(struct nvmet_req *req, |
3270 |
+ } |
3271 |
+ |
3272 |
+ host_reads = part_stat_read(ns->bdev->bd_part, ios[READ]); |
3273 |
+- data_units_read = part_stat_read(ns->bdev->bd_part, sectors[READ]); |
3274 |
++ data_units_read = DIV_ROUND_UP(part_stat_read(ns->bdev->bd_part, |
3275 |
++ sectors[READ]), 1000); |
3276 |
+ host_writes = part_stat_read(ns->bdev->bd_part, ios[WRITE]); |
3277 |
+- data_units_written = part_stat_read(ns->bdev->bd_part, sectors[WRITE]); |
3278 |
++ data_units_written = DIV_ROUND_UP(part_stat_read(ns->bdev->bd_part, |
3279 |
++ sectors[WRITE]), 1000); |
3280 |
+ |
3281 |
+ put_unaligned_le64(host_reads, &slog->host_reads[0]); |
3282 |
+ put_unaligned_le64(data_units_read, &slog->data_units_read[0]); |
3283 |
+@@ -77,11 +79,11 @@ static u16 nvmet_get_smart_log_all(struct nvmet_req *req, |
3284 |
+ rcu_read_lock(); |
3285 |
+ list_for_each_entry_rcu(ns, &ctrl->subsys->namespaces, dev_link) { |
3286 |
+ host_reads += part_stat_read(ns->bdev->bd_part, ios[READ]); |
3287 |
+- data_units_read += |
3288 |
+- part_stat_read(ns->bdev->bd_part, sectors[READ]); |
3289 |
++ data_units_read += DIV_ROUND_UP( |
3290 |
++ part_stat_read(ns->bdev->bd_part, sectors[READ]), 1000); |
3291 |
+ host_writes += part_stat_read(ns->bdev->bd_part, ios[WRITE]); |
3292 |
+- data_units_written += |
3293 |
+- part_stat_read(ns->bdev->bd_part, sectors[WRITE]); |
3294 |
++ data_units_written += DIV_ROUND_UP( |
3295 |
++ part_stat_read(ns->bdev->bd_part, sectors[WRITE]), 1000); |
3296 |
+ |
3297 |
+ } |
3298 |
+ rcu_read_unlock(); |
3299 |
+diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c |
3300 |
+index 0b3fb99d9b89..8bed46630857 100644 |
3301 |
+--- a/drivers/parisc/dino.c |
3302 |
++++ b/drivers/parisc/dino.c |
3303 |
+@@ -160,6 +160,15 @@ struct dino_device |
3304 |
+ (struct dino_device *)__pdata; }) |
3305 |
+ |
3306 |
+ |
3307 |
++/* Check if PCI device is behind a Card-mode Dino. */ |
3308 |
++static int pci_dev_is_behind_card_dino(struct pci_dev *dev) |
3309 |
++{ |
3310 |
++ struct dino_device *dino_dev; |
3311 |
++ |
3312 |
++ dino_dev = DINO_DEV(parisc_walk_tree(dev->bus->bridge)); |
3313 |
++ return is_card_dino(&dino_dev->hba.dev->id); |
3314 |
++} |
3315 |
++ |
3316 |
+ /* |
3317 |
+ * Dino Configuration Space Accessor Functions |
3318 |
+ */ |
3319 |
+@@ -442,6 +451,21 @@ static void quirk_cirrus_cardbus(struct pci_dev *dev) |
3320 |
+ } |
3321 |
+ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_6832, quirk_cirrus_cardbus ); |
3322 |
+ |
3323 |
++#ifdef CONFIG_TULIP |
3324 |
++static void pci_fixup_tulip(struct pci_dev *dev) |
3325 |
++{ |
3326 |
++ if (!pci_dev_is_behind_card_dino(dev)) |
3327 |
++ return; |
3328 |
++ if (!(pci_resource_flags(dev, 1) & IORESOURCE_MEM)) |
3329 |
++ return; |
3330 |
++ pr_warn("%s: HP HSC-PCI Cards with card-mode Dino not yet supported.\n", |
3331 |
++ pci_name(dev)); |
3332 |
++ /* Disable this card by zeroing the PCI resources */ |
3333 |
++ memset(&dev->resource[0], 0, sizeof(dev->resource[0])); |
3334 |
++ memset(&dev->resource[1], 0, sizeof(dev->resource[1])); |
3335 |
++} |
3336 |
++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_DEC, PCI_ANY_ID, pci_fixup_tulip); |
3337 |
++#endif /* CONFIG_TULIP */ |
3338 |
+ |
3339 |
+ static void __init |
3340 |
+ dino_bios_init(void) |
3341 |
+diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c |
3342 |
+index 5a9d94512232..70825689e5a0 100644 |
3343 |
+--- a/drivers/pci/host/pci-hyperv.c |
3344 |
++++ b/drivers/pci/host/pci-hyperv.c |
3345 |
+@@ -2740,8 +2740,8 @@ static int hv_pci_remove(struct hv_device *hdev) |
3346 |
+ /* Remove the bus from PCI's point of view. */ |
3347 |
+ pci_lock_rescan_remove(); |
3348 |
+ pci_stop_root_bus(hbus->pci_bus); |
3349 |
+- pci_remove_root_bus(hbus->pci_bus); |
3350 |
+ hv_pci_remove_slots(hbus); |
3351 |
++ pci_remove_root_bus(hbus->pci_bus); |
3352 |
+ pci_unlock_rescan_remove(); |
3353 |
+ hbus->state = hv_pcibus_removed; |
3354 |
+ } |
3355 |
+diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c |
3356 |
+index 63529911445c..83958bdd0f05 100644 |
3357 |
+--- a/drivers/pinctrl/sprd/pinctrl-sprd.c |
3358 |
++++ b/drivers/pinctrl/sprd/pinctrl-sprd.c |
3359 |
+@@ -159,10 +159,8 @@ struct sprd_pinctrl { |
3360 |
+ struct sprd_pinctrl_soc_info *info; |
3361 |
+ }; |
3362 |
+ |
3363 |
+-enum sprd_pinconf_params { |
3364 |
+- SPRD_PIN_CONFIG_CONTROL = PIN_CONFIG_END + 1, |
3365 |
+- SPRD_PIN_CONFIG_SLEEP_MODE = PIN_CONFIG_END + 2, |
3366 |
+-}; |
3367 |
++#define SPRD_PIN_CONFIG_CONTROL (PIN_CONFIG_END + 1) |
3368 |
++#define SPRD_PIN_CONFIG_SLEEP_MODE (PIN_CONFIG_END + 2) |
3369 |
+ |
3370 |
+ static int sprd_pinctrl_get_id_by_name(struct sprd_pinctrl *sprd_pctl, |
3371 |
+ const char *name) |
3372 |
+diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c |
3373 |
+index eb5dc7482053..2ccaf4ff4be4 100644 |
3374 |
+--- a/drivers/power/supply/power_supply_sysfs.c |
3375 |
++++ b/drivers/power/supply/power_supply_sysfs.c |
3376 |
+@@ -91,7 +91,8 @@ static ssize_t power_supply_show_property(struct device *dev, |
3377 |
+ dev_dbg(dev, "driver has no data for `%s' property\n", |
3378 |
+ attr->attr.name); |
3379 |
+ else if (ret != -ENODEV && ret != -EAGAIN) |
3380 |
+- dev_err(dev, "driver failed to report `%s' property: %zd\n", |
3381 |
++ dev_err_ratelimited(dev, |
3382 |
++ "driver failed to report `%s' property: %zd\n", |
3383 |
+ attr->attr.name, ret); |
3384 |
+ return ret; |
3385 |
+ } |
3386 |
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c |
3387 |
+index b2cb4f497ef6..d2428c262b7c 100644 |
3388 |
+--- a/drivers/regulator/core.c |
3389 |
++++ b/drivers/regulator/core.c |
3390 |
+@@ -4503,7 +4503,7 @@ static int __init regulator_init(void) |
3391 |
+ /* init early to allow our consumers to complete system booting */ |
3392 |
+ core_initcall(regulator_init); |
3393 |
+ |
3394 |
+-static int __init regulator_late_cleanup(struct device *dev, void *data) |
3395 |
++static int regulator_late_cleanup(struct device *dev, void *data) |
3396 |
+ { |
3397 |
+ struct regulator_dev *rdev = dev_to_rdev(dev); |
3398 |
+ const struct regulator_ops *ops = rdev->desc->ops; |
3399 |
+@@ -4552,17 +4552,8 @@ unlock: |
3400 |
+ return 0; |
3401 |
+ } |
3402 |
+ |
3403 |
+-static int __init regulator_init_complete(void) |
3404 |
++static void regulator_init_complete_work_function(struct work_struct *work) |
3405 |
+ { |
3406 |
+- /* |
3407 |
+- * Since DT doesn't provide an idiomatic mechanism for |
3408 |
+- * enabling full constraints and since it's much more natural |
3409 |
+- * with DT to provide them just assume that a DT enabled |
3410 |
+- * system has full constraints. |
3411 |
+- */ |
3412 |
+- if (of_have_populated_dt()) |
3413 |
+- has_full_constraints = true; |
3414 |
+- |
3415 |
+ /* |
3416 |
+ * Regulators may had failed to resolve their input supplies |
3417 |
+ * when were registered, either because the input supply was |
3418 |
+@@ -4580,6 +4571,35 @@ static int __init regulator_init_complete(void) |
3419 |
+ */ |
3420 |
+ class_for_each_device(®ulator_class, NULL, NULL, |
3421 |
+ regulator_late_cleanup); |
3422 |
++} |
3423 |
++ |
3424 |
++static DECLARE_DELAYED_WORK(regulator_init_complete_work, |
3425 |
++ regulator_init_complete_work_function); |
3426 |
++ |
3427 |
++static int __init regulator_init_complete(void) |
3428 |
++{ |
3429 |
++ /* |
3430 |
++ * Since DT doesn't provide an idiomatic mechanism for |
3431 |
++ * enabling full constraints and since it's much more natural |
3432 |
++ * with DT to provide them just assume that a DT enabled |
3433 |
++ * system has full constraints. |
3434 |
++ */ |
3435 |
++ if (of_have_populated_dt()) |
3436 |
++ has_full_constraints = true; |
3437 |
++ |
3438 |
++ /* |
3439 |
++ * We punt completion for an arbitrary amount of time since |
3440 |
++ * systems like distros will load many drivers from userspace |
3441 |
++ * so consumers might not always be ready yet, this is |
3442 |
++ * particularly an issue with laptops where this might bounce |
3443 |
++ * the display off then on. Ideally we'd get a notification |
3444 |
++ * from userspace when this happens but we don't so just wait |
3445 |
++ * a bit and hope we waited long enough. It'd be better if |
3446 |
++ * we'd only do this on systems that need it, and a kernel |
3447 |
++ * command line option might be useful. |
3448 |
++ */ |
3449 |
++ schedule_delayed_work(®ulator_init_complete_work, |
3450 |
++ msecs_to_jiffies(30000)); |
3451 |
+ |
3452 |
+ return 0; |
3453 |
+ } |
3454 |
+diff --git a/drivers/regulator/lm363x-regulator.c b/drivers/regulator/lm363x-regulator.c |
3455 |
+index ce5f7d9ad475..30f576a5daf1 100644 |
3456 |
+--- a/drivers/regulator/lm363x-regulator.c |
3457 |
++++ b/drivers/regulator/lm363x-regulator.c |
3458 |
+@@ -33,7 +33,7 @@ |
3459 |
+ |
3460 |
+ /* LM3632 */ |
3461 |
+ #define LM3632_BOOST_VSEL_MAX 0x26 |
3462 |
+-#define LM3632_LDO_VSEL_MAX 0x29 |
3463 |
++#define LM3632_LDO_VSEL_MAX 0x28 |
3464 |
+ #define LM3632_VBOOST_MIN 4500000 |
3465 |
+ #define LM3632_VLDO_MIN 4000000 |
3466 |
+ |
3467 |
+diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c |
3468 |
+index 2ceff585f189..b92e06f75756 100644 |
3469 |
+--- a/drivers/scsi/device_handler/scsi_dh_rdac.c |
3470 |
++++ b/drivers/scsi/device_handler/scsi_dh_rdac.c |
3471 |
+@@ -546,6 +546,8 @@ static void send_mode_select(struct work_struct *work) |
3472 |
+ spin_unlock(&ctlr->ms_lock); |
3473 |
+ |
3474 |
+ retry: |
3475 |
++ memset(cdb, 0, sizeof(cdb)); |
3476 |
++ |
3477 |
+ data_size = rdac_failover_get(ctlr, &list, cdb); |
3478 |
+ |
3479 |
+ RDAC_LOG(RDAC_LOG_FAILOVER, sdev, "array %s, ctlr %d, " |
3480 |
+diff --git a/drivers/staging/media/imx/imx6-mipi-csi2.c b/drivers/staging/media/imx/imx6-mipi-csi2.c |
3481 |
+index 5061f3f524fd..c28f65c5427d 100644 |
3482 |
+--- a/drivers/staging/media/imx/imx6-mipi-csi2.c |
3483 |
++++ b/drivers/staging/media/imx/imx6-mipi-csi2.c |
3484 |
+@@ -247,7 +247,7 @@ static int __maybe_unused csi2_dphy_wait_ulp(struct csi2_dev *csi2) |
3485 |
+ } |
3486 |
+ |
3487 |
+ /* Waits for low-power LP-11 state on data and clock lanes. */ |
3488 |
+-static int csi2_dphy_wait_stopstate(struct csi2_dev *csi2) |
3489 |
++static void csi2_dphy_wait_stopstate(struct csi2_dev *csi2) |
3490 |
+ { |
3491 |
+ u32 mask, reg; |
3492 |
+ int ret; |
3493 |
+@@ -258,11 +258,9 @@ static int csi2_dphy_wait_stopstate(struct csi2_dev *csi2) |
3494 |
+ ret = readl_poll_timeout(csi2->base + CSI2_PHY_STATE, reg, |
3495 |
+ (reg & mask) == mask, 0, 500000); |
3496 |
+ if (ret) { |
3497 |
+- v4l2_err(&csi2->sd, "LP-11 timeout, phy_state = 0x%08x\n", reg); |
3498 |
+- return ret; |
3499 |
++ v4l2_warn(&csi2->sd, "LP-11 wait timeout, likely a sensor driver bug, expect capture failures.\n"); |
3500 |
++ v4l2_warn(&csi2->sd, "phy_state = 0x%08x\n", reg); |
3501 |
+ } |
3502 |
+- |
3503 |
+- return 0; |
3504 |
+ } |
3505 |
+ |
3506 |
+ /* Wait for active clock on the clock lane. */ |
3507 |
+@@ -320,9 +318,7 @@ static int csi2_start(struct csi2_dev *csi2) |
3508 |
+ csi2_enable(csi2, true); |
3509 |
+ |
3510 |
+ /* Step 5 */ |
3511 |
+- ret = csi2_dphy_wait_stopstate(csi2); |
3512 |
+- if (ret) |
3513 |
+- goto err_assert_reset; |
3514 |
++ csi2_dphy_wait_stopstate(csi2); |
3515 |
+ |
3516 |
+ /* Step 6 */ |
3517 |
+ ret = v4l2_subdev_call(csi2->src_sd, video, s_stream, 1); |
3518 |
+diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c |
3519 |
+index 8096cca87fe7..166846a40078 100644 |
3520 |
+--- a/fs/binfmt_elf.c |
3521 |
++++ b/fs/binfmt_elf.c |
3522 |
+@@ -1123,7 +1123,8 @@ static int load_elf_binary(struct linux_binprm *bprm) |
3523 |
+ * (since it grows up, and may collide early with the stack |
3524 |
+ * growing down), and into the unused ELF_ET_DYN_BASE region. |
3525 |
+ */ |
3526 |
+- if (IS_ENABLED(CONFIG_ARCH_HAS_ELF_RANDOMIZE) && !interpreter) |
3527 |
++ if (IS_ENABLED(CONFIG_ARCH_HAS_ELF_RANDOMIZE) && |
3528 |
++ loc->elf_ex.e_type == ET_DYN && !interpreter) |
3529 |
+ current->mm->brk = current->mm->start_brk = |
3530 |
+ ELF_ET_DYN_BASE; |
3531 |
+ |
3532 |
+diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c |
3533 |
+index d1b9900ebc9b..27983fd657ab 100644 |
3534 |
+--- a/fs/btrfs/ctree.c |
3535 |
++++ b/fs/btrfs/ctree.c |
3536 |
+@@ -1414,6 +1414,7 @@ get_old_root(struct btrfs_root *root, u64 time_seq) |
3537 |
+ struct tree_mod_elem *tm; |
3538 |
+ struct extent_buffer *eb = NULL; |
3539 |
+ struct extent_buffer *eb_root; |
3540 |
++ u64 eb_root_owner = 0; |
3541 |
+ struct extent_buffer *old; |
3542 |
+ struct tree_mod_root *old_root = NULL; |
3543 |
+ u64 old_generation = 0; |
3544 |
+@@ -1448,6 +1449,7 @@ get_old_root(struct btrfs_root *root, u64 time_seq) |
3545 |
+ free_extent_buffer(old); |
3546 |
+ } |
3547 |
+ } else if (old_root) { |
3548 |
++ eb_root_owner = btrfs_header_owner(eb_root); |
3549 |
+ btrfs_tree_read_unlock(eb_root); |
3550 |
+ free_extent_buffer(eb_root); |
3551 |
+ eb = alloc_dummy_extent_buffer(fs_info, logical); |
3552 |
+@@ -1465,7 +1467,7 @@ get_old_root(struct btrfs_root *root, u64 time_seq) |
3553 |
+ if (old_root) { |
3554 |
+ btrfs_set_header_bytenr(eb, eb->start); |
3555 |
+ btrfs_set_header_backref_rev(eb, BTRFS_MIXED_BACKREF_REV); |
3556 |
+- btrfs_set_header_owner(eb, btrfs_header_owner(eb_root)); |
3557 |
++ btrfs_set_header_owner(eb, eb_root_owner); |
3558 |
+ btrfs_set_header_level(eb, old_root->level); |
3559 |
+ btrfs_set_header_generation(eb, old_generation); |
3560 |
+ } |
3561 |
+@@ -5492,6 +5494,7 @@ int btrfs_compare_trees(struct btrfs_root *left_root, |
3562 |
+ advance_left = advance_right = 0; |
3563 |
+ |
3564 |
+ while (1) { |
3565 |
++ cond_resched(); |
3566 |
+ if (advance_left && !left_end_reached) { |
3567 |
+ ret = tree_advance(fs_info, left_path, &left_level, |
3568 |
+ left_root_level, |
3569 |
+diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c |
3570 |
+index 49766721b2b1..10dee8245558 100644 |
3571 |
+--- a/fs/btrfs/extent-tree.c |
3572 |
++++ b/fs/btrfs/extent-tree.c |
3573 |
+@@ -7706,6 +7706,14 @@ search: |
3574 |
+ */ |
3575 |
+ if ((flags & extra) && !(block_group->flags & extra)) |
3576 |
+ goto loop; |
3577 |
++ |
3578 |
++ /* |
3579 |
++ * This block group has different flags than we want. |
3580 |
++ * It's possible that we have MIXED_GROUP flag but no |
3581 |
++ * block group is mixed. Just skip such block group. |
3582 |
++ */ |
3583 |
++ btrfs_release_block_group(block_group, delalloc); |
3584 |
++ continue; |
3585 |
+ } |
3586 |
+ |
3587 |
+ have_block_group: |
3588 |
+diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c |
3589 |
+index d6d6e9593e39..cb6e8cb0de94 100644 |
3590 |
+--- a/fs/btrfs/qgroup.c |
3591 |
++++ b/fs/btrfs/qgroup.c |
3592 |
+@@ -722,10 +722,10 @@ out: |
3593 |
+ return ret; |
3594 |
+ } |
3595 |
+ |
3596 |
+-static int update_qgroup_status_item(struct btrfs_trans_handle *trans, |
3597 |
+- struct btrfs_fs_info *fs_info, |
3598 |
+- struct btrfs_root *root) |
3599 |
++static int update_qgroup_status_item(struct btrfs_trans_handle *trans) |
3600 |
+ { |
3601 |
++ struct btrfs_fs_info *fs_info = trans->fs_info; |
3602 |
++ struct btrfs_root *quota_root = fs_info->quota_root; |
3603 |
+ struct btrfs_path *path; |
3604 |
+ struct btrfs_key key; |
3605 |
+ struct extent_buffer *l; |
3606 |
+@@ -741,7 +741,7 @@ static int update_qgroup_status_item(struct btrfs_trans_handle *trans, |
3607 |
+ if (!path) |
3608 |
+ return -ENOMEM; |
3609 |
+ |
3610 |
+- ret = btrfs_search_slot(trans, root, &key, path, 0, 1); |
3611 |
++ ret = btrfs_search_slot(trans, quota_root, &key, path, 0, 1); |
3612 |
+ if (ret > 0) |
3613 |
+ ret = -ENOENT; |
3614 |
+ |
3615 |
+@@ -2110,7 +2110,7 @@ int btrfs_run_qgroups(struct btrfs_trans_handle *trans, |
3616 |
+ fs_info->qgroup_flags &= ~BTRFS_QGROUP_STATUS_FLAG_ON; |
3617 |
+ spin_unlock(&fs_info->qgroup_lock); |
3618 |
+ |
3619 |
+- ret = update_qgroup_status_item(trans, fs_info, quota_root); |
3620 |
++ ret = update_qgroup_status_item(trans); |
3621 |
+ if (ret) |
3622 |
+ fs_info->qgroup_flags |= BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT; |
3623 |
+ |
3624 |
+@@ -2645,9 +2645,6 @@ out: |
3625 |
+ btrfs_free_path(path); |
3626 |
+ |
3627 |
+ mutex_lock(&fs_info->qgroup_rescan_lock); |
3628 |
+- if (!btrfs_fs_closing(fs_info)) |
3629 |
+- fs_info->qgroup_flags &= ~BTRFS_QGROUP_STATUS_FLAG_RESCAN; |
3630 |
+- |
3631 |
+ if (err > 0 && |
3632 |
+ fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT) { |
3633 |
+ fs_info->qgroup_flags &= ~BTRFS_QGROUP_STATUS_FLAG_INCONSISTENT; |
3634 |
+@@ -2663,16 +2660,30 @@ out: |
3635 |
+ trans = btrfs_start_transaction(fs_info->quota_root, 1); |
3636 |
+ if (IS_ERR(trans)) { |
3637 |
+ err = PTR_ERR(trans); |
3638 |
++ trans = NULL; |
3639 |
+ btrfs_err(fs_info, |
3640 |
+ "fail to start transaction for status update: %d", |
3641 |
+ err); |
3642 |
+- goto done; |
3643 |
+ } |
3644 |
+- ret = update_qgroup_status_item(trans, fs_info, fs_info->quota_root); |
3645 |
+- if (ret < 0) { |
3646 |
+- err = ret; |
3647 |
+- btrfs_err(fs_info, "fail to update qgroup status: %d", err); |
3648 |
++ |
3649 |
++ mutex_lock(&fs_info->qgroup_rescan_lock); |
3650 |
++ if (!btrfs_fs_closing(fs_info)) |
3651 |
++ fs_info->qgroup_flags &= ~BTRFS_QGROUP_STATUS_FLAG_RESCAN; |
3652 |
++ if (trans) { |
3653 |
++ ret = update_qgroup_status_item(trans); |
3654 |
++ if (ret < 0) { |
3655 |
++ err = ret; |
3656 |
++ btrfs_err(fs_info, "fail to update qgroup status: %d", |
3657 |
++ err); |
3658 |
++ } |
3659 |
+ } |
3660 |
++ fs_info->qgroup_rescan_running = false; |
3661 |
++ complete_all(&fs_info->qgroup_rescan_completion); |
3662 |
++ mutex_unlock(&fs_info->qgroup_rescan_lock); |
3663 |
++ |
3664 |
++ if (!trans) |
3665 |
++ return; |
3666 |
++ |
3667 |
+ btrfs_end_transaction(trans); |
3668 |
+ |
3669 |
+ if (btrfs_fs_closing(fs_info)) { |
3670 |
+@@ -2683,12 +2694,6 @@ out: |
3671 |
+ } else { |
3672 |
+ btrfs_err(fs_info, "qgroup scan failed with %d", err); |
3673 |
+ } |
3674 |
+- |
3675 |
+-done: |
3676 |
+- mutex_lock(&fs_info->qgroup_rescan_lock); |
3677 |
+- fs_info->qgroup_rescan_running = false; |
3678 |
+- mutex_unlock(&fs_info->qgroup_rescan_lock); |
3679 |
+- complete_all(&fs_info->qgroup_rescan_completion); |
3680 |
+ } |
3681 |
+ |
3682 |
+ /* |
3683 |
+@@ -2951,7 +2956,7 @@ static int qgroup_free_reserved_data(struct inode *inode, |
3684 |
+ * EXTENT_QGROUP_RESERVED, we won't double free. |
3685 |
+ * So not need to rush. |
3686 |
+ */ |
3687 |
+- ret = clear_record_extent_bits(&BTRFS_I(inode)->io_failure_tree, |
3688 |
++ ret = clear_record_extent_bits(&BTRFS_I(inode)->io_tree, |
3689 |
+ free_start, free_start + free_len - 1, |
3690 |
+ EXTENT_QGROUP_RESERVED, &changeset); |
3691 |
+ if (ret < 0) |
3692 |
+diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c |
3693 |
+index 58a502e622aa..951c444d83e7 100644 |
3694 |
+--- a/fs/cifs/smb2ops.c |
3695 |
++++ b/fs/cifs/smb2ops.c |
3696 |
+@@ -1975,6 +1975,11 @@ smb21_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock, |
3697 |
+ if (oplock == SMB2_OPLOCK_LEVEL_NOCHANGE) |
3698 |
+ return; |
3699 |
+ |
3700 |
++ /* Check if the server granted an oplock rather than a lease */ |
3701 |
++ if (oplock & SMB2_OPLOCK_LEVEL_EXCLUSIVE) |
3702 |
++ return smb2_set_oplock_level(cinode, oplock, epoch, |
3703 |
++ purge_cache); |
3704 |
++ |
3705 |
+ if (oplock & SMB2_LEASE_READ_CACHING_HE) { |
3706 |
+ new_oplock |= CIFS_CACHE_READ_FLG; |
3707 |
+ strcat(message, "R"); |
3708 |
+diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c |
3709 |
+index 52f975d848a0..26219d9db575 100644 |
3710 |
+--- a/fs/cifs/xattr.c |
3711 |
++++ b/fs/cifs/xattr.c |
3712 |
+@@ -31,7 +31,7 @@ |
3713 |
+ #include "cifs_fs_sb.h" |
3714 |
+ #include "cifs_unicode.h" |
3715 |
+ |
3716 |
+-#define MAX_EA_VALUE_SIZE 65535 |
3717 |
++#define MAX_EA_VALUE_SIZE CIFSMaxBufSize |
3718 |
+ #define CIFS_XATTR_CIFS_ACL "system.cifs_acl" |
3719 |
+ #define CIFS_XATTR_ATTRIB "cifs.dosattrib" /* full name: user.cifs.dosattrib */ |
3720 |
+ #define CIFS_XATTR_CREATETIME "cifs.creationtime" /* user.cifs.creationtime */ |
3721 |
+diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c |
3722 |
+index 01f44364c547..20d68554680f 100644 |
3723 |
+--- a/fs/ext4/extents.c |
3724 |
++++ b/fs/ext4/extents.c |
3725 |
+@@ -3756,8 +3756,8 @@ static int ext4_convert_unwritten_extents_endio(handle_t *handle, |
3726 |
+ * illegal. |
3727 |
+ */ |
3728 |
+ if (ee_block != map->m_lblk || ee_len > map->m_len) { |
3729 |
+-#ifdef EXT4_DEBUG |
3730 |
+- ext4_warning("Inode (%ld) finished: extent logical block %llu," |
3731 |
++#ifdef CONFIG_EXT4_DEBUG |
3732 |
++ ext4_warning(inode->i_sb, "Inode (%ld) finished: extent logical block %llu," |
3733 |
+ " len %u; IO logical block %llu, len %u", |
3734 |
+ inode->i_ino, (unsigned long long)ee_block, ee_len, |
3735 |
+ (unsigned long long)map->m_lblk, map->m_len); |
3736 |
+diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c |
3737 |
+index ea85063e5dc2..8c987a1994d4 100644 |
3738 |
+--- a/fs/ext4/inode.c |
3739 |
++++ b/fs/ext4/inode.c |
3740 |
+@@ -4177,6 +4177,15 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length) |
3741 |
+ |
3742 |
+ trace_ext4_punch_hole(inode, offset, length, 0); |
3743 |
+ |
3744 |
++ ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); |
3745 |
++ if (ext4_has_inline_data(inode)) { |
3746 |
++ down_write(&EXT4_I(inode)->i_mmap_sem); |
3747 |
++ ret = ext4_convert_inline_data(inode); |
3748 |
++ up_write(&EXT4_I(inode)->i_mmap_sem); |
3749 |
++ if (ret) |
3750 |
++ return ret; |
3751 |
++ } |
3752 |
++ |
3753 |
+ /* |
3754 |
+ * Write out all dirty pages to avoid race conditions |
3755 |
+ * Then release them. |
3756 |
+diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c |
3757 |
+index 624817eeb25e..170423ff2721 100644 |
3758 |
+--- a/fs/f2fs/checkpoint.c |
3759 |
++++ b/fs/f2fs/checkpoint.c |
3760 |
+@@ -793,6 +793,7 @@ int get_valid_checkpoint(struct f2fs_sb_info *sbi) |
3761 |
+ unsigned int cp_blks = 1 + __cp_payload(sbi); |
3762 |
+ block_t cp_blk_no; |
3763 |
+ int i; |
3764 |
++ int err; |
3765 |
+ |
3766 |
+ sbi->ckpt = kzalloc(cp_blks * blk_size, GFP_KERNEL); |
3767 |
+ if (!sbi->ckpt) |
3768 |
+@@ -819,6 +820,7 @@ int get_valid_checkpoint(struct f2fs_sb_info *sbi) |
3769 |
+ } else if (cp2) { |
3770 |
+ cur_page = cp2; |
3771 |
+ } else { |
3772 |
++ err = -EFSCORRUPTED; |
3773 |
+ goto fail_no_cp; |
3774 |
+ } |
3775 |
+ |
3776 |
+@@ -831,8 +833,10 @@ int get_valid_checkpoint(struct f2fs_sb_info *sbi) |
3777 |
+ sbi->cur_cp_pack = 2; |
3778 |
+ |
3779 |
+ /* Sanity checking of checkpoint */ |
3780 |
+- if (sanity_check_ckpt(sbi)) |
3781 |
++ if (sanity_check_ckpt(sbi)) { |
3782 |
++ err = -EFSCORRUPTED; |
3783 |
+ goto free_fail_no_cp; |
3784 |
++ } |
3785 |
+ |
3786 |
+ if (cp_blks <= 1) |
3787 |
+ goto done; |
3788 |
+@@ -860,7 +864,7 @@ free_fail_no_cp: |
3789 |
+ f2fs_put_page(cp2, 1); |
3790 |
+ fail_no_cp: |
3791 |
+ kfree(sbi->ckpt); |
3792 |
+- return -EINVAL; |
3793 |
++ return err; |
3794 |
+ } |
3795 |
+ |
3796 |
+ static void __add_dirty_inode(struct inode *inode, enum inode_type type) |
3797 |
+diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c |
3798 |
+index 113d1cd55119..cc5729445194 100644 |
3799 |
+--- a/fs/f2fs/data.c |
3800 |
++++ b/fs/f2fs/data.c |
3801 |
+@@ -376,7 +376,7 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio) |
3802 |
+ |
3803 |
+ if (!f2fs_is_valid_blkaddr(fio->sbi, fio->new_blkaddr, |
3804 |
+ __is_meta_io(fio) ? META_GENERIC : DATA_GENERIC)) |
3805 |
+- return -EFAULT; |
3806 |
++ return -EFSCORRUPTED; |
3807 |
+ |
3808 |
+ trace_f2fs_submit_page_bio(page, fio); |
3809 |
+ f2fs_trace_ios(fio, 0); |
3810 |
+@@ -959,7 +959,7 @@ next_block: |
3811 |
+ |
3812 |
+ if (__is_valid_data_blkaddr(blkaddr) && |
3813 |
+ !f2fs_is_valid_blkaddr(sbi, blkaddr, DATA_GENERIC)) { |
3814 |
+- err = -EFAULT; |
3815 |
++ err = -EFSCORRUPTED; |
3816 |
+ goto sync_out; |
3817 |
+ } |
3818 |
+ |
3819 |
+@@ -1425,7 +1425,7 @@ int do_write_data_page(struct f2fs_io_info *fio) |
3820 |
+ |
3821 |
+ if (!f2fs_is_valid_blkaddr(fio->sbi, fio->old_blkaddr, |
3822 |
+ DATA_GENERIC)) |
3823 |
+- return -EFAULT; |
3824 |
++ return -EFSCORRUPTED; |
3825 |
+ |
3826 |
+ ipu_force = true; |
3827 |
+ fio->need_lock = LOCK_DONE; |
3828 |
+@@ -1451,7 +1451,7 @@ got_it: |
3829 |
+ if (__is_valid_data_blkaddr(fio->old_blkaddr) && |
3830 |
+ !f2fs_is_valid_blkaddr(fio->sbi, fio->old_blkaddr, |
3831 |
+ DATA_GENERIC)) { |
3832 |
+- err = -EFAULT; |
3833 |
++ err = -EFSCORRUPTED; |
3834 |
+ goto out_writepage; |
3835 |
+ } |
3836 |
+ /* |
3837 |
+diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h |
3838 |
+index 6caae471c1a4..268409cee1c3 100644 |
3839 |
+--- a/fs/f2fs/f2fs.h |
3840 |
++++ b/fs/f2fs/f2fs.h |
3841 |
+@@ -3089,3 +3089,7 @@ static inline bool f2fs_may_encrypt(struct inode *inode) |
3842 |
+ } |
3843 |
+ |
3844 |
+ #endif |
3845 |
++ |
3846 |
++#define EFSBADCRC EBADMSG /* Bad CRC detected */ |
3847 |
++#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ |
3848 |
++ |
3849 |
+diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c |
3850 |
+index 506e365cf903..8906f6381b1a 100644 |
3851 |
+--- a/fs/f2fs/inline.c |
3852 |
++++ b/fs/f2fs/inline.c |
3853 |
+@@ -135,7 +135,7 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page) |
3854 |
+ "%s: corrupted inline inode ino=%lx, i_addr[0]:0x%x, " |
3855 |
+ "run fsck to fix.", |
3856 |
+ __func__, dn->inode->i_ino, dn->data_blkaddr); |
3857 |
+- return -EINVAL; |
3858 |
++ return -EFSCORRUPTED; |
3859 |
+ } |
3860 |
+ |
3861 |
+ f2fs_bug_on(F2FS_P_SB(page), PageWriteback(page)); |
3862 |
+@@ -382,7 +382,7 @@ static int f2fs_move_inline_dirents(struct inode *dir, struct page *ipage, |
3863 |
+ "%s: corrupted inline inode ino=%lx, i_addr[0]:0x%x, " |
3864 |
+ "run fsck to fix.", |
3865 |
+ __func__, dir->i_ino, dn.data_blkaddr); |
3866 |
+- err = -EINVAL; |
3867 |
++ err = -EFSCORRUPTED; |
3868 |
+ goto out; |
3869 |
+ } |
3870 |
+ |
3871 |
+diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c |
3872 |
+index e02ed16bc35c..c6d0687f00fe 100644 |
3873 |
+--- a/fs/f2fs/inode.c |
3874 |
++++ b/fs/f2fs/inode.c |
3875 |
+@@ -70,7 +70,7 @@ static int __written_first_block(struct f2fs_sb_info *sbi, |
3876 |
+ if (!__is_valid_data_blkaddr(addr)) |
3877 |
+ return 1; |
3878 |
+ if (!f2fs_is_valid_blkaddr(sbi, addr, DATA_GENERIC)) |
3879 |
+- return -EFAULT; |
3880 |
++ return -EFSCORRUPTED; |
3881 |
+ return 0; |
3882 |
+ } |
3883 |
+ |
3884 |
+@@ -300,7 +300,7 @@ static int do_read_inode(struct inode *inode) |
3885 |
+ |
3886 |
+ if (!sanity_check_inode(inode, node_page)) { |
3887 |
+ f2fs_put_page(node_page, 1); |
3888 |
+- return -EINVAL; |
3889 |
++ return -EFSCORRUPTED; |
3890 |
+ } |
3891 |
+ |
3892 |
+ /* check data exist */ |
3893 |
+diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c |
3894 |
+index 12060fbfbb05..e7b8e2b35e22 100644 |
3895 |
+--- a/fs/f2fs/node.c |
3896 |
++++ b/fs/f2fs/node.c |
3897 |
+@@ -39,7 +39,7 @@ int check_nid_range(struct f2fs_sb_info *sbi, nid_t nid) |
3898 |
+ f2fs_msg(sbi->sb, KERN_WARNING, |
3899 |
+ "%s: out-of-range nid=%x, run fsck to fix.", |
3900 |
+ __func__, nid); |
3901 |
+- return -EINVAL; |
3902 |
++ return -EFSCORRUPTED; |
3903 |
+ } |
3904 |
+ return 0; |
3905 |
+ } |
3906 |
+@@ -1195,7 +1195,7 @@ repeat: |
3907 |
+ } |
3908 |
+ |
3909 |
+ if (!f2fs_inode_chksum_verify(sbi, page)) { |
3910 |
+- err = -EBADMSG; |
3911 |
++ err = -EFSBADCRC; |
3912 |
+ goto out_err; |
3913 |
+ } |
3914 |
+ page_hit: |
3915 |
+diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c |
3916 |
+index 65a82c5bafcb..db357e9ad599 100644 |
3917 |
+--- a/fs/f2fs/recovery.c |
3918 |
++++ b/fs/f2fs/recovery.c |
3919 |
+@@ -451,7 +451,7 @@ retry_dn: |
3920 |
+ "Inconsistent ofs_of_node, ino:%lu, ofs:%u, %u", |
3921 |
+ inode->i_ino, ofs_of_node(dn.node_page), |
3922 |
+ ofs_of_node(page)); |
3923 |
+- err = -EFAULT; |
3924 |
++ err = -EFSCORRUPTED; |
3925 |
+ goto err; |
3926 |
+ } |
3927 |
+ |
3928 |
+diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c |
3929 |
+index 18d51c36a5e3..9e5fca35e47d 100644 |
3930 |
+--- a/fs/f2fs/segment.c |
3931 |
++++ b/fs/f2fs/segment.c |
3932 |
+@@ -2216,6 +2216,7 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range) |
3933 |
+ if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) { |
3934 |
+ f2fs_msg(sbi->sb, KERN_WARNING, |
3935 |
+ "Found FS corruption, run fsck to fix."); |
3936 |
++ err = -EFSCORRUPTED; |
3937 |
+ goto out; |
3938 |
+ } |
3939 |
+ |
3940 |
+@@ -2612,11 +2613,6 @@ static int read_compacted_summaries(struct f2fs_sb_info *sbi) |
3941 |
+ seg_i = CURSEG_I(sbi, i); |
3942 |
+ segno = le32_to_cpu(ckpt->cur_data_segno[i]); |
3943 |
+ blk_off = le16_to_cpu(ckpt->cur_data_blkoff[i]); |
3944 |
+- if (blk_off > ENTRIES_IN_SUM) { |
3945 |
+- f2fs_bug_on(sbi, 1); |
3946 |
+- f2fs_put_page(page, 1); |
3947 |
+- return -EFAULT; |
3948 |
+- } |
3949 |
+ seg_i->next_segno = segno; |
3950 |
+ reset_curseg(sbi, i, 0); |
3951 |
+ seg_i->alloc_type = ckpt->alloc_type[i]; |
3952 |
+@@ -3314,7 +3310,7 @@ static int build_sit_entries(struct f2fs_sb_info *sbi) |
3953 |
+ "Wrong journal entry on segno %u", |
3954 |
+ start); |
3955 |
+ set_sbi_flag(sbi, SBI_NEED_FSCK); |
3956 |
+- err = -EINVAL; |
3957 |
++ err = -EFSCORRUPTED; |
3958 |
+ break; |
3959 |
+ } |
3960 |
+ |
3961 |
+@@ -3355,7 +3351,7 @@ static int build_sit_entries(struct f2fs_sb_info *sbi) |
3962 |
+ "SIT is corrupted node# %u vs %u", |
3963 |
+ total_node_blocks, valid_node_count(sbi)); |
3964 |
+ set_sbi_flag(sbi, SBI_NEED_FSCK); |
3965 |
+- err = -EINVAL; |
3966 |
++ err = -EFSCORRUPTED; |
3967 |
+ } |
3968 |
+ |
3969 |
+ return err; |
3970 |
+@@ -3444,6 +3440,41 @@ static int build_dirty_segmap(struct f2fs_sb_info *sbi) |
3971 |
+ return init_victim_secmap(sbi); |
3972 |
+ } |
3973 |
+ |
3974 |
++static int sanity_check_curseg(struct f2fs_sb_info *sbi) |
3975 |
++{ |
3976 |
++ int i; |
3977 |
++ |
3978 |
++ /* |
3979 |
++ * In LFS/SSR curseg, .next_blkoff should point to an unused blkaddr; |
3980 |
++ * In LFS curseg, all blkaddr after .next_blkoff should be unused. |
3981 |
++ */ |
3982 |
++ for (i = 0; i < NO_CHECK_TYPE; i++) { |
3983 |
++ struct curseg_info *curseg = CURSEG_I(sbi, i); |
3984 |
++ struct seg_entry *se = get_seg_entry(sbi, curseg->segno); |
3985 |
++ unsigned int blkofs = curseg->next_blkoff; |
3986 |
++ |
3987 |
++ if (f2fs_test_bit(blkofs, se->cur_valid_map)) |
3988 |
++ goto out; |
3989 |
++ |
3990 |
++ if (curseg->alloc_type == SSR) |
3991 |
++ continue; |
3992 |
++ |
3993 |
++ for (blkofs += 1; blkofs < sbi->blocks_per_seg; blkofs++) { |
3994 |
++ if (!f2fs_test_bit(blkofs, se->cur_valid_map)) |
3995 |
++ continue; |
3996 |
++out: |
3997 |
++ f2fs_msg(sbi->sb, KERN_ERR, |
3998 |
++ "Current segment's next free block offset is " |
3999 |
++ "inconsistent with bitmap, logtype:%u, " |
4000 |
++ "segno:%u, type:%u, next_blkoff:%u, blkofs:%u", |
4001 |
++ i, curseg->segno, curseg->alloc_type, |
4002 |
++ curseg->next_blkoff, blkofs); |
4003 |
++ return -EFSCORRUPTED; |
4004 |
++ } |
4005 |
++ } |
4006 |
++ return 0; |
4007 |
++} |
4008 |
++ |
4009 |
+ /* |
4010 |
+ * Update min, max modified time for cost-benefit GC algorithm |
4011 |
+ */ |
4012 |
+@@ -3537,6 +3568,10 @@ int build_segment_manager(struct f2fs_sb_info *sbi) |
4013 |
+ if (err) |
4014 |
+ return err; |
4015 |
+ |
4016 |
++ err = sanity_check_curseg(sbi); |
4017 |
++ if (err) |
4018 |
++ return err; |
4019 |
++ |
4020 |
+ init_min_max_mtime(sbi); |
4021 |
+ return 0; |
4022 |
+ } |
4023 |
+diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h |
4024 |
+index e3d8826c5113..0d46e936d54e 100644 |
4025 |
+--- a/fs/f2fs/segment.h |
4026 |
++++ b/fs/f2fs/segment.h |
4027 |
+@@ -665,7 +665,7 @@ static inline int check_block_count(struct f2fs_sb_info *sbi, |
4028 |
+ "Mismatch valid blocks %d vs. %d", |
4029 |
+ GET_SIT_VBLOCKS(raw_sit), valid_blocks); |
4030 |
+ set_sbi_flag(sbi, SBI_NEED_FSCK); |
4031 |
+- return -EINVAL; |
4032 |
++ return -EFSCORRUPTED; |
4033 |
+ } |
4034 |
+ |
4035 |
+ /* check segment usage, and check boundary of a given segment number */ |
4036 |
+@@ -675,7 +675,7 @@ static inline int check_block_count(struct f2fs_sb_info *sbi, |
4037 |
+ "Wrong valid blocks %d or segno %u", |
4038 |
+ GET_SIT_VBLOCKS(raw_sit), segno); |
4039 |
+ set_sbi_flag(sbi, SBI_NEED_FSCK); |
4040 |
+- return -EINVAL; |
4041 |
++ return -EFSCORRUPTED; |
4042 |
+ } |
4043 |
+ return 0; |
4044 |
+ } |
4045 |
+diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c |
4046 |
+index 4c169ba50c0f..344aa861774b 100644 |
4047 |
+--- a/fs/f2fs/super.c |
4048 |
++++ b/fs/f2fs/super.c |
4049 |
+@@ -2027,11 +2027,11 @@ int sanity_check_ckpt(struct f2fs_sb_info *sbi) |
4050 |
+ } |
4051 |
+ } |
4052 |
+ for (i = 0; i < NR_CURSEG_NODE_TYPE; i++) { |
4053 |
+- for (j = i; j < NR_CURSEG_DATA_TYPE; j++) { |
4054 |
++ for (j = 0; j < NR_CURSEG_DATA_TYPE; j++) { |
4055 |
+ if (le32_to_cpu(ckpt->cur_node_segno[i]) == |
4056 |
+ le32_to_cpu(ckpt->cur_data_segno[j])) { |
4057 |
+ f2fs_msg(sbi->sb, KERN_ERR, |
4058 |
+- "Data segment (%u) and Data segment (%u)" |
4059 |
++ "Node segment (%u) and Data segment (%u)" |
4060 |
+ " has the same segno: %u", i, j, |
4061 |
+ le32_to_cpu(ckpt->cur_node_segno[i])); |
4062 |
+ return 1; |
4063 |
+@@ -2220,7 +2220,7 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi, |
4064 |
+ f2fs_msg(sb, KERN_ERR, |
4065 |
+ "Can't find valid F2FS filesystem in %dth superblock", |
4066 |
+ block + 1); |
4067 |
+- err = -EINVAL; |
4068 |
++ err = -EFSCORRUPTED; |
4069 |
+ brelse(bh); |
4070 |
+ continue; |
4071 |
+ } |
4072 |
+diff --git a/fs/fuse/file.c b/fs/fuse/file.c |
4073 |
+index e340449ca862..34cbec8e6850 100644 |
4074 |
+--- a/fs/fuse/file.c |
4075 |
++++ b/fs/fuse/file.c |
4076 |
+@@ -1699,6 +1699,7 @@ static int fuse_writepage(struct page *page, struct writeback_control *wbc) |
4077 |
+ WARN_ON(wbc->sync_mode == WB_SYNC_ALL); |
4078 |
+ |
4079 |
+ redirty_page_for_writepage(wbc, page); |
4080 |
++ unlock_page(page); |
4081 |
+ return 0; |
4082 |
+ } |
4083 |
+ |
4084 |
+diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c |
4085 |
+index bc8787718feb..09432b25fe9b 100644 |
4086 |
+--- a/fs/gfs2/bmap.c |
4087 |
++++ b/fs/gfs2/bmap.c |
4088 |
+@@ -1078,6 +1078,7 @@ out_unlock: |
4089 |
+ gfs2_dinode_out(ip, dibh->b_data); |
4090 |
+ up_write(&ip->i_rw_mutex); |
4091 |
+ gfs2_trans_end(sdp); |
4092 |
++ buf_in_tr = false; |
4093 |
+ } |
4094 |
+ gfs2_glock_dq_uninit(rd_gh); |
4095 |
+ cond_resched(); |
4096 |
+diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c |
4097 |
+index efed50304b49..30a1c7fc8c75 100644 |
4098 |
+--- a/fs/overlayfs/inode.c |
4099 |
++++ b/fs/overlayfs/inode.c |
4100 |
+@@ -265,7 +265,8 @@ static bool ovl_can_list(const char *s) |
4101 |
+ return true; |
4102 |
+ |
4103 |
+ /* Never list trusted.overlay, list other trusted for superuser only */ |
4104 |
+- return !ovl_is_private_xattr(s) && capable(CAP_SYS_ADMIN); |
4105 |
++ return !ovl_is_private_xattr(s) && |
4106 |
++ ns_capable_noaudit(&init_user_ns, CAP_SYS_ADMIN); |
4107 |
+ } |
4108 |
+ |
4109 |
+ ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size) |
4110 |
+diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c |
4111 |
+index a3cc8afed367..7b25a88569c9 100644 |
4112 |
+--- a/fs/xfs/libxfs/xfs_bmap.c |
4113 |
++++ b/fs/xfs/libxfs/xfs_bmap.c |
4114 |
+@@ -4006,15 +4006,28 @@ xfs_bmapi_read( |
4115 |
+ XFS_STATS_INC(mp, xs_blk_mapr); |
4116 |
+ |
4117 |
+ ifp = XFS_IFORK_PTR(ip, whichfork); |
4118 |
++ if (!ifp) { |
4119 |
++ /* No CoW fork? Return a hole. */ |
4120 |
++ if (whichfork == XFS_COW_FORK) { |
4121 |
++ mval->br_startoff = bno; |
4122 |
++ mval->br_startblock = HOLESTARTBLOCK; |
4123 |
++ mval->br_blockcount = len; |
4124 |
++ mval->br_state = XFS_EXT_NORM; |
4125 |
++ *nmap = 1; |
4126 |
++ return 0; |
4127 |
++ } |
4128 |
+ |
4129 |
+- /* No CoW fork? Return a hole. */ |
4130 |
+- if (whichfork == XFS_COW_FORK && !ifp) { |
4131 |
+- mval->br_startoff = bno; |
4132 |
+- mval->br_startblock = HOLESTARTBLOCK; |
4133 |
+- mval->br_blockcount = len; |
4134 |
+- mval->br_state = XFS_EXT_NORM; |
4135 |
+- *nmap = 1; |
4136 |
+- return 0; |
4137 |
++ /* |
4138 |
++ * A missing attr ifork implies that the inode says we're in |
4139 |
++ * extents or btree format but failed to pass the inode fork |
4140 |
++ * verifier while trying to load it. Treat that as a file |
4141 |
++ * corruption too. |
4142 |
++ */ |
4143 |
++#ifdef DEBUG |
4144 |
++ xfs_alert(mp, "%s: inode %llu missing fork %d", |
4145 |
++ __func__, ip->i_ino, whichfork); |
4146 |
++#endif /* DEBUG */ |
4147 |
++ return -EFSCORRUPTED; |
4148 |
+ } |
4149 |
+ |
4150 |
+ if (!(ifp->if_flags & XFS_IFEXTENTS)) { |
4151 |
+diff --git a/include/linux/bug.h b/include/linux/bug.h |
4152 |
+index da4231c905c8..f48597417791 100644 |
4153 |
+--- a/include/linux/bug.h |
4154 |
++++ b/include/linux/bug.h |
4155 |
+@@ -45,6 +45,11 @@ int is_valid_bugaddr(unsigned long addr); |
4156 |
+ |
4157 |
+ #else /* !CONFIG_GENERIC_BUG */ |
4158 |
+ |
4159 |
++static inline void *find_bug(unsigned long bugaddr) |
4160 |
++{ |
4161 |
++ return NULL; |
4162 |
++} |
4163 |
++ |
4164 |
+ static inline enum bug_trap_type report_bug(unsigned long bug_addr, |
4165 |
+ struct pt_regs *regs) |
4166 |
+ { |
4167 |
+diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h |
4168 |
+index 2fb6fb11132e..a109e6107c06 100644 |
4169 |
+--- a/include/linux/quotaops.h |
4170 |
++++ b/include/linux/quotaops.h |
4171 |
+@@ -22,7 +22,7 @@ static inline struct quota_info *sb_dqopt(struct super_block *sb) |
4172 |
+ /* i_mutex must being held */ |
4173 |
+ static inline bool is_quota_modification(struct inode *inode, struct iattr *ia) |
4174 |
+ { |
4175 |
+- return (ia->ia_valid & ATTR_SIZE && ia->ia_size != inode->i_size) || |
4176 |
++ return (ia->ia_valid & ATTR_SIZE) || |
4177 |
+ (ia->ia_valid & ATTR_UID && !uid_eq(ia->ia_uid, inode->i_uid)) || |
4178 |
+ (ia->ia_valid & ATTR_GID && !gid_eq(ia->ia_gid, inode->i_gid)); |
4179 |
+ } |
4180 |
+diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h |
4181 |
+index 9e76b2410d03..b8a5118b6a42 100644 |
4182 |
+--- a/include/rdma/ib_verbs.h |
4183 |
++++ b/include/rdma/ib_verbs.h |
4184 |
+@@ -68,6 +68,7 @@ |
4185 |
+ |
4186 |
+ extern struct workqueue_struct *ib_wq; |
4187 |
+ extern struct workqueue_struct *ib_comp_wq; |
4188 |
++extern struct workqueue_struct *ib_comp_unbound_wq; |
4189 |
+ |
4190 |
+ union ib_gid { |
4191 |
+ u8 raw[16]; |
4192 |
+@@ -1544,9 +1545,10 @@ struct ib_ah { |
4193 |
+ typedef void (*ib_comp_handler)(struct ib_cq *cq, void *cq_context); |
4194 |
+ |
4195 |
+ enum ib_poll_context { |
4196 |
+- IB_POLL_DIRECT, /* caller context, no hw completions */ |
4197 |
+- IB_POLL_SOFTIRQ, /* poll from softirq context */ |
4198 |
+- IB_POLL_WORKQUEUE, /* poll from workqueue */ |
4199 |
++ IB_POLL_DIRECT, /* caller context, no hw completions */ |
4200 |
++ IB_POLL_SOFTIRQ, /* poll from softirq context */ |
4201 |
++ IB_POLL_WORKQUEUE, /* poll from workqueue */ |
4202 |
++ IB_POLL_UNBOUND_WORKQUEUE, /* poll from unbound workqueue */ |
4203 |
+ }; |
4204 |
+ |
4205 |
+ struct ib_cq { |
4206 |
+@@ -1563,6 +1565,7 @@ struct ib_cq { |
4207 |
+ struct irq_poll iop; |
4208 |
+ struct work_struct work; |
4209 |
+ }; |
4210 |
++ struct workqueue_struct *comp_wq; |
4211 |
+ }; |
4212 |
+ |
4213 |
+ struct ib_srq { |
4214 |
+diff --git a/kernel/kprobes.c b/kernel/kprobes.c |
4215 |
+index c43bc2bc5b2c..f7a4602a76f9 100644 |
4216 |
+--- a/kernel/kprobes.c |
4217 |
++++ b/kernel/kprobes.c |
4218 |
+@@ -1501,7 +1501,8 @@ static int check_kprobe_address_safe(struct kprobe *p, |
4219 |
+ /* Ensure it is not in reserved area nor out of text */ |
4220 |
+ if (!kernel_text_address((unsigned long) p->addr) || |
4221 |
+ within_kprobe_blacklist((unsigned long) p->addr) || |
4222 |
+- jump_label_text_reserved(p->addr, p->addr)) { |
4223 |
++ jump_label_text_reserved(p->addr, p->addr) || |
4224 |
++ find_bug((unsigned long)p->addr)) { |
4225 |
+ ret = -EINVAL; |
4226 |
+ goto out; |
4227 |
+ } |
4228 |
+diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c |
4229 |
+index 565005a3b8f0..90a3469a7a88 100644 |
4230 |
+--- a/kernel/locking/lockdep.c |
4231 |
++++ b/kernel/locking/lockdep.c |
4232 |
+@@ -3688,6 +3688,9 @@ static int __lock_downgrade(struct lockdep_map *lock, unsigned long ip) |
4233 |
+ unsigned int depth; |
4234 |
+ int i; |
4235 |
+ |
4236 |
++ if (unlikely(!debug_locks)) |
4237 |
++ return 0; |
4238 |
++ |
4239 |
+ depth = curr->lockdep_depth; |
4240 |
+ /* |
4241 |
+ * This function is about (re)setting the class of a held lock, |
4242 |
+diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c |
4243 |
+index 2e2c86dd226f..5aa96098c64d 100644 |
4244 |
+--- a/kernel/printk/printk.c |
4245 |
++++ b/kernel/printk/printk.c |
4246 |
+@@ -3189,7 +3189,7 @@ bool kmsg_dump_get_buffer(struct kmsg_dumper *dumper, bool syslog, |
4247 |
+ /* move first record forward until length fits into the buffer */ |
4248 |
+ seq = dumper->cur_seq; |
4249 |
+ idx = dumper->cur_idx; |
4250 |
+- while (l > size && seq < dumper->next_seq) { |
4251 |
++ while (l >= size && seq < dumper->next_seq) { |
4252 |
+ struct printk_log *msg = log_from_idx(idx); |
4253 |
+ |
4254 |
+ l -= msg_print_text(msg, true, NULL, 0); |
4255 |
+diff --git a/kernel/sched/core.c b/kernel/sched/core.c |
4256 |
+index ff128e281d1c..3d24d401b9d4 100644 |
4257 |
+--- a/kernel/sched/core.c |
4258 |
++++ b/kernel/sched/core.c |
4259 |
+@@ -6342,10 +6342,6 @@ static int cpu_cgroup_can_attach(struct cgroup_taskset *tset) |
4260 |
+ #ifdef CONFIG_RT_GROUP_SCHED |
4261 |
+ if (!sched_rt_can_attach(css_tg(css), task)) |
4262 |
+ return -EINVAL; |
4263 |
+-#else |
4264 |
+- /* We don't support RT-tasks being in separate groups */ |
4265 |
+- if (task->sched_class != &fair_sched_class) |
4266 |
+- return -EINVAL; |
4267 |
+ #endif |
4268 |
+ /* |
4269 |
+ * Serialize against wake_up_new_task() such that if its |
4270 |
+diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c |
4271 |
+index c298d47888ed..55a33009f9a5 100644 |
4272 |
+--- a/kernel/sched/fair.c |
4273 |
++++ b/kernel/sched/fair.c |
4274 |
+@@ -8359,9 +8359,10 @@ more_balance: |
4275 |
+ out_balanced: |
4276 |
+ /* |
4277 |
+ * We reach balance although we may have faced some affinity |
4278 |
+- * constraints. Clear the imbalance flag if it was set. |
4279 |
++ * constraints. Clear the imbalance flag only if other tasks got |
4280 |
++ * a chance to move and fix the imbalance. |
4281 |
+ */ |
4282 |
+- if (sd_parent) { |
4283 |
++ if (sd_parent && !(env.flags & LBF_ALL_PINNED)) { |
4284 |
+ int *group_imbalance = &sd_parent->groups->sgc->imbalance; |
4285 |
+ |
4286 |
+ if (*group_imbalance) |
4287 |
+@@ -9422,18 +9423,18 @@ err: |
4288 |
+ void online_fair_sched_group(struct task_group *tg) |
4289 |
+ { |
4290 |
+ struct sched_entity *se; |
4291 |
++ struct rq_flags rf; |
4292 |
+ struct rq *rq; |
4293 |
+ int i; |
4294 |
+ |
4295 |
+ for_each_possible_cpu(i) { |
4296 |
+ rq = cpu_rq(i); |
4297 |
+ se = tg->se[i]; |
4298 |
+- |
4299 |
+- raw_spin_lock_irq(&rq->lock); |
4300 |
++ rq_lock_irq(rq, &rf); |
4301 |
+ update_rq_clock(rq); |
4302 |
+ attach_entity_cfs_rq(se); |
4303 |
+ sync_throttle(tg, i); |
4304 |
+- raw_spin_unlock_irq(&rq->lock); |
4305 |
++ rq_unlock_irq(rq, &rf); |
4306 |
+ } |
4307 |
+ } |
4308 |
+ |
4309 |
+diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c |
4310 |
+index fdeb9bc6affb..f4255a65c44b 100644 |
4311 |
+--- a/kernel/time/alarmtimer.c |
4312 |
++++ b/kernel/time/alarmtimer.c |
4313 |
+@@ -676,7 +676,7 @@ static int alarm_timer_create(struct k_itimer *new_timer) |
4314 |
+ enum alarmtimer_type type; |
4315 |
+ |
4316 |
+ if (!alarmtimer_get_rtcdev()) |
4317 |
+- return -ENOTSUPP; |
4318 |
++ return -EOPNOTSUPP; |
4319 |
+ |
4320 |
+ if (!capable(CAP_WAKE_ALARM)) |
4321 |
+ return -EPERM; |
4322 |
+@@ -794,7 +794,7 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags, |
4323 |
+ int ret = 0; |
4324 |
+ |
4325 |
+ if (!alarmtimer_get_rtcdev()) |
4326 |
+- return -ENOTSUPP; |
4327 |
++ return -EOPNOTSUPP; |
4328 |
+ |
4329 |
+ if (flags & ~TIMER_ABSTIME) |
4330 |
+ return -EINVAL; |
4331 |
+diff --git a/mm/compaction.c b/mm/compaction.c |
4332 |
+index 85395dc6eb13..eb8e7f5d3a08 100644 |
4333 |
+--- a/mm/compaction.c |
4334 |
++++ b/mm/compaction.c |
4335 |
+@@ -1517,6 +1517,17 @@ static enum compact_result compact_zone(struct zone *zone, struct compact_contro |
4336 |
+ unsigned long end_pfn = zone_end_pfn(zone); |
4337 |
+ const bool sync = cc->mode != MIGRATE_ASYNC; |
4338 |
+ |
4339 |
++ /* |
4340 |
++ * These counters track activities during zone compaction. Initialize |
4341 |
++ * them before compacting a new zone. |
4342 |
++ */ |
4343 |
++ cc->total_migrate_scanned = 0; |
4344 |
++ cc->total_free_scanned = 0; |
4345 |
++ cc->nr_migratepages = 0; |
4346 |
++ cc->nr_freepages = 0; |
4347 |
++ INIT_LIST_HEAD(&cc->freepages); |
4348 |
++ INIT_LIST_HEAD(&cc->migratepages); |
4349 |
++ |
4350 |
+ cc->migratetype = gfpflags_to_migratetype(cc->gfp_mask); |
4351 |
+ ret = compaction_suitable(zone, cc->order, cc->alloc_flags, |
4352 |
+ cc->classzone_idx); |
4353 |
+@@ -1680,10 +1691,6 @@ static enum compact_result compact_zone_order(struct zone *zone, int order, |
4354 |
+ { |
4355 |
+ enum compact_result ret; |
4356 |
+ struct compact_control cc = { |
4357 |
+- .nr_freepages = 0, |
4358 |
+- .nr_migratepages = 0, |
4359 |
+- .total_migrate_scanned = 0, |
4360 |
+- .total_free_scanned = 0, |
4361 |
+ .order = order, |
4362 |
+ .gfp_mask = gfp_mask, |
4363 |
+ .zone = zone, |
4364 |
+@@ -1696,8 +1703,6 @@ static enum compact_result compact_zone_order(struct zone *zone, int order, |
4365 |
+ .ignore_skip_hint = (prio == MIN_COMPACT_PRIORITY), |
4366 |
+ .ignore_block_suitable = (prio == MIN_COMPACT_PRIORITY) |
4367 |
+ }; |
4368 |
+- INIT_LIST_HEAD(&cc.freepages); |
4369 |
+- INIT_LIST_HEAD(&cc.migratepages); |
4370 |
+ |
4371 |
+ ret = compact_zone(zone, &cc); |
4372 |
+ |
4373 |
+@@ -1796,8 +1801,6 @@ static void compact_node(int nid) |
4374 |
+ struct zone *zone; |
4375 |
+ struct compact_control cc = { |
4376 |
+ .order = -1, |
4377 |
+- .total_migrate_scanned = 0, |
4378 |
+- .total_free_scanned = 0, |
4379 |
+ .mode = MIGRATE_SYNC, |
4380 |
+ .ignore_skip_hint = true, |
4381 |
+ .whole_zone = true, |
4382 |
+@@ -1811,11 +1814,7 @@ static void compact_node(int nid) |
4383 |
+ if (!populated_zone(zone)) |
4384 |
+ continue; |
4385 |
+ |
4386 |
+- cc.nr_freepages = 0; |
4387 |
+- cc.nr_migratepages = 0; |
4388 |
+ cc.zone = zone; |
4389 |
+- INIT_LIST_HEAD(&cc.freepages); |
4390 |
+- INIT_LIST_HEAD(&cc.migratepages); |
4391 |
+ |
4392 |
+ compact_zone(zone, &cc); |
4393 |
+ |
4394 |
+@@ -1924,8 +1923,6 @@ static void kcompactd_do_work(pg_data_t *pgdat) |
4395 |
+ struct zone *zone; |
4396 |
+ struct compact_control cc = { |
4397 |
+ .order = pgdat->kcompactd_max_order, |
4398 |
+- .total_migrate_scanned = 0, |
4399 |
+- .total_free_scanned = 0, |
4400 |
+ .classzone_idx = pgdat->kcompactd_classzone_idx, |
4401 |
+ .mode = MIGRATE_SYNC_LIGHT, |
4402 |
+ .ignore_skip_hint = true, |
4403 |
+@@ -1950,16 +1947,10 @@ static void kcompactd_do_work(pg_data_t *pgdat) |
4404 |
+ COMPACT_CONTINUE) |
4405 |
+ continue; |
4406 |
+ |
4407 |
+- cc.nr_freepages = 0; |
4408 |
+- cc.nr_migratepages = 0; |
4409 |
+- cc.total_migrate_scanned = 0; |
4410 |
+- cc.total_free_scanned = 0; |
4411 |
+- cc.zone = zone; |
4412 |
+- INIT_LIST_HEAD(&cc.freepages); |
4413 |
+- INIT_LIST_HEAD(&cc.migratepages); |
4414 |
+- |
4415 |
+ if (kthread_should_stop()) |
4416 |
+ return; |
4417 |
++ |
4418 |
++ cc.zone = zone; |
4419 |
+ status = compact_zone(zone, &cc); |
4420 |
+ |
4421 |
+ if (status == COMPACT_SUCCESS) { |
4422 |
+diff --git a/mm/memcontrol.c b/mm/memcontrol.c |
4423 |
+index 84e4c23ed606..2dd99c7884cd 100644 |
4424 |
+--- a/mm/memcontrol.c |
4425 |
++++ b/mm/memcontrol.c |
4426 |
+@@ -2352,6 +2352,16 @@ int memcg_kmem_charge_memcg(struct page *page, gfp_t gfp, int order, |
4427 |
+ |
4428 |
+ if (!cgroup_subsys_on_dfl(memory_cgrp_subsys) && |
4429 |
+ !page_counter_try_charge(&memcg->kmem, nr_pages, &counter)) { |
4430 |
++ |
4431 |
++ /* |
4432 |
++ * Enforce __GFP_NOFAIL allocation because callers are not |
4433 |
++ * prepared to see failures and likely do not have any failure |
4434 |
++ * handling code. |
4435 |
++ */ |
4436 |
++ if (gfp & __GFP_NOFAIL) { |
4437 |
++ page_counter_charge(&memcg->kmem, nr_pages); |
4438 |
++ return 0; |
4439 |
++ } |
4440 |
+ cancel_charge(memcg, nr_pages); |
4441 |
+ return -ENOMEM; |
4442 |
+ } |
4443 |
+diff --git a/mm/oom_kill.c b/mm/oom_kill.c |
4444 |
+index fe0aac2348e5..7a5c0b229c6a 100644 |
4445 |
+--- a/mm/oom_kill.c |
4446 |
++++ b/mm/oom_kill.c |
4447 |
+@@ -1050,9 +1050,10 @@ bool out_of_memory(struct oom_control *oc) |
4448 |
+ * The OOM killer does not compensate for IO-less reclaim. |
4449 |
+ * pagefault_out_of_memory lost its gfp context so we have to |
4450 |
+ * make sure exclude 0 mask - all other users should have at least |
4451 |
+- * ___GFP_DIRECT_RECLAIM to get here. |
4452 |
++ * ___GFP_DIRECT_RECLAIM to get here. But mem_cgroup_oom() has to |
4453 |
++ * invoke the OOM killer even if it is a GFP_NOFS allocation. |
4454 |
+ */ |
4455 |
+- if (oc->gfp_mask && !(oc->gfp_mask & __GFP_FS)) |
4456 |
++ if (oc->gfp_mask && !(oc->gfp_mask & __GFP_FS) && !is_memcg_oom(oc)) |
4457 |
+ return true; |
4458 |
+ |
4459 |
+ /* |
4460 |
+diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c |
4461 |
+index d1b68cc7da89..475f332b1ad2 100644 |
4462 |
+--- a/net/appletalk/ddp.c |
4463 |
++++ b/net/appletalk/ddp.c |
4464 |
+@@ -1029,6 +1029,11 @@ static int atalk_create(struct net *net, struct socket *sock, int protocol, |
4465 |
+ */ |
4466 |
+ if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM) |
4467 |
+ goto out; |
4468 |
++ |
4469 |
++ rc = -EPERM; |
4470 |
++ if (sock->type == SOCK_RAW && !kern && !capable(CAP_NET_RAW)) |
4471 |
++ goto out; |
4472 |
++ |
4473 |
+ rc = -ENOMEM; |
4474 |
+ sk = sk_alloc(net, PF_APPLETALK, GFP_KERNEL, &ddp_proto, kern); |
4475 |
+ if (!sk) |
4476 |
+diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c |
4477 |
+index d783d90c20f1..63fa6ea2341e 100644 |
4478 |
+--- a/net/ax25/af_ax25.c |
4479 |
++++ b/net/ax25/af_ax25.c |
4480 |
+@@ -859,6 +859,8 @@ static int ax25_create(struct net *net, struct socket *sock, int protocol, |
4481 |
+ break; |
4482 |
+ |
4483 |
+ case SOCK_RAW: |
4484 |
++ if (!capable(CAP_NET_RAW)) |
4485 |
++ return -EPERM; |
4486 |
+ break; |
4487 |
+ default: |
4488 |
+ return -ESOCKTNOSUPPORT; |
4489 |
+diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c |
4490 |
+index 3d2f64a6d623..363dc85bbc5c 100644 |
4491 |
+--- a/net/bluetooth/hci_event.c |
4492 |
++++ b/net/bluetooth/hci_event.c |
4493 |
+@@ -5089,11 +5089,6 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev, |
4494 |
+ return send_conn_param_neg_reply(hdev, handle, |
4495 |
+ HCI_ERROR_UNKNOWN_CONN_ID); |
4496 |
+ |
4497 |
+- if (min < hcon->le_conn_min_interval || |
4498 |
+- max > hcon->le_conn_max_interval) |
4499 |
+- return send_conn_param_neg_reply(hdev, handle, |
4500 |
+- HCI_ERROR_INVALID_LL_PARAMS); |
4501 |
+- |
4502 |
+ if (hci_check_conn_params(min, max, latency, timeout)) |
4503 |
+ return send_conn_param_neg_reply(hdev, handle, |
4504 |
+ HCI_ERROR_INVALID_LL_PARAMS); |
4505 |
+diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c |
4506 |
+index 4dc1db85a9c2..0c2219f483d7 100644 |
4507 |
+--- a/net/bluetooth/l2cap_core.c |
4508 |
++++ b/net/bluetooth/l2cap_core.c |
4509 |
+@@ -5287,14 +5287,7 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn, |
4510 |
+ |
4511 |
+ memset(&rsp, 0, sizeof(rsp)); |
4512 |
+ |
4513 |
+- if (min < hcon->le_conn_min_interval || |
4514 |
+- max > hcon->le_conn_max_interval) { |
4515 |
+- BT_DBG("requested connection interval exceeds current bounds."); |
4516 |
+- err = -EINVAL; |
4517 |
+- } else { |
4518 |
+- err = hci_check_conn_params(min, max, latency, to_multiplier); |
4519 |
+- } |
4520 |
+- |
4521 |
++ err = hci_check_conn_params(min, max, latency, to_multiplier); |
4522 |
+ if (err) |
4523 |
+ rsp.result = cpu_to_le16(L2CAP_CONN_PARAM_REJECTED); |
4524 |
+ else |
4525 |
+diff --git a/net/ieee802154/socket.c b/net/ieee802154/socket.c |
4526 |
+index a60658c85a9a..e95004b507d3 100644 |
4527 |
+--- a/net/ieee802154/socket.c |
4528 |
++++ b/net/ieee802154/socket.c |
4529 |
+@@ -1001,6 +1001,9 @@ static int ieee802154_create(struct net *net, struct socket *sock, |
4530 |
+ |
4531 |
+ switch (sock->type) { |
4532 |
+ case SOCK_RAW: |
4533 |
++ rc = -EPERM; |
4534 |
++ if (!capable(CAP_NET_RAW)) |
4535 |
++ goto out; |
4536 |
+ proto = &ieee802154_raw_prot; |
4537 |
+ ops = &ieee802154_raw_ops; |
4538 |
+ break; |
4539 |
+diff --git a/net/ipv4/raw_diag.c b/net/ipv4/raw_diag.c |
4540 |
+index c200065ef9a5..6367ecdf76c4 100644 |
4541 |
+--- a/net/ipv4/raw_diag.c |
4542 |
++++ b/net/ipv4/raw_diag.c |
4543 |
+@@ -23,9 +23,6 @@ raw_get_hashinfo(const struct inet_diag_req_v2 *r) |
4544 |
+ return &raw_v6_hashinfo; |
4545 |
+ #endif |
4546 |
+ } else { |
4547 |
+- pr_warn_once("Unexpected inet family %d\n", |
4548 |
+- r->sdiag_family); |
4549 |
+- WARN_ON_ONCE(1); |
4550 |
+ return ERR_PTR(-EINVAL); |
4551 |
+ } |
4552 |
+ } |
4553 |
+diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c |
4554 |
+index fb7afcaa3004..33ad7e25a89d 100644 |
4555 |
+--- a/net/nfc/llcp_sock.c |
4556 |
++++ b/net/nfc/llcp_sock.c |
4557 |
+@@ -1012,10 +1012,13 @@ static int llcp_sock_create(struct net *net, struct socket *sock, |
4558 |
+ sock->type != SOCK_RAW) |
4559 |
+ return -ESOCKTNOSUPPORT; |
4560 |
+ |
4561 |
+- if (sock->type == SOCK_RAW) |
4562 |
++ if (sock->type == SOCK_RAW) { |
4563 |
++ if (!capable(CAP_NET_RAW)) |
4564 |
++ return -EPERM; |
4565 |
+ sock->ops = &llcp_rawsock_ops; |
4566 |
+- else |
4567 |
++ } else { |
4568 |
+ sock->ops = &llcp_sock_ops; |
4569 |
++ } |
4570 |
+ |
4571 |
+ sk = nfc_llcp_sock_alloc(sock, sock->type, GFP_ATOMIC, kern); |
4572 |
+ if (sk == NULL) |
4573 |
+diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c |
4574 |
+index 363dd904733d..2de2a923ff2b 100644 |
4575 |
+--- a/net/openvswitch/datapath.c |
4576 |
++++ b/net/openvswitch/datapath.c |
4577 |
+@@ -2240,7 +2240,7 @@ static const struct nla_policy vport_policy[OVS_VPORT_ATTR_MAX + 1] = { |
4578 |
+ [OVS_VPORT_ATTR_STATS] = { .len = sizeof(struct ovs_vport_stats) }, |
4579 |
+ [OVS_VPORT_ATTR_PORT_NO] = { .type = NLA_U32 }, |
4580 |
+ [OVS_VPORT_ATTR_TYPE] = { .type = NLA_U32 }, |
4581 |
+- [OVS_VPORT_ATTR_UPCALL_PID] = { .type = NLA_U32 }, |
4582 |
++ [OVS_VPORT_ATTR_UPCALL_PID] = { .type = NLA_UNSPEC }, |
4583 |
+ [OVS_VPORT_ATTR_OPTIONS] = { .type = NLA_NESTED }, |
4584 |
+ }; |
4585 |
+ |
4586 |
+diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c |
4587 |
+index 084adea6a818..8d9a244f4534 100644 |
4588 |
+--- a/net/qrtr/qrtr.c |
4589 |
++++ b/net/qrtr/qrtr.c |
4590 |
+@@ -129,6 +129,7 @@ static void __qrtr_node_release(struct kref *kref) |
4591 |
+ list_del(&node->item); |
4592 |
+ mutex_unlock(&qrtr_node_lock); |
4593 |
+ |
4594 |
++ cancel_work_sync(&node->work); |
4595 |
+ skb_queue_purge(&node->rx_queue); |
4596 |
+ kfree(node); |
4597 |
+ } |
4598 |
+diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c |
4599 |
+index 489db1064d5b..9d92eac01958 100644 |
4600 |
+--- a/net/sched/act_sample.c |
4601 |
++++ b/net/sched/act_sample.c |
4602 |
+@@ -132,6 +132,7 @@ static bool tcf_sample_dev_ok_push(struct net_device *dev) |
4603 |
+ case ARPHRD_TUNNEL6: |
4604 |
+ case ARPHRD_SIT: |
4605 |
+ case ARPHRD_IPGRE: |
4606 |
++ case ARPHRD_IP6GRE: |
4607 |
+ case ARPHRD_VOID: |
4608 |
+ case ARPHRD_NONE: |
4609 |
+ return false; |
4610 |
+diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c |
4611 |
+index 7b4270987ac1..637949b576c6 100644 |
4612 |
+--- a/net/sched/sch_api.c |
4613 |
++++ b/net/sched/sch_api.c |
4614 |
+@@ -1217,7 +1217,8 @@ check_loop_fn(struct Qdisc *q, unsigned long cl, struct qdisc_walker *w) |
4615 |
+ */ |
4616 |
+ |
4617 |
+ const struct nla_policy rtm_tca_policy[TCA_MAX + 1] = { |
4618 |
+- [TCA_KIND] = { .type = NLA_STRING }, |
4619 |
++ [TCA_KIND] = { .type = NLA_NUL_STRING, |
4620 |
++ .len = IFNAMSIZ - 1 }, |
4621 |
+ [TCA_RATE] = { .type = NLA_BINARY, |
4622 |
+ .len = sizeof(struct tc_estimator) }, |
4623 |
+ [TCA_STAB] = { .type = NLA_NESTED }, |
4624 |
+diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c |
4625 |
+index 3d5654333d49..787aa52e5991 100644 |
4626 |
+--- a/net/sched/sch_netem.c |
4627 |
++++ b/net/sched/sch_netem.c |
4628 |
+@@ -708,7 +708,7 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr) |
4629 |
+ struct disttable *d; |
4630 |
+ int i; |
4631 |
+ |
4632 |
+- if (n > NETEM_DIST_MAX) |
4633 |
++ if (!n || n > NETEM_DIST_MAX) |
4634 |
+ return -EINVAL; |
4635 |
+ |
4636 |
+ d = kvmalloc(sizeof(struct disttable) + n * sizeof(s16), GFP_KERNEL); |
4637 |
+diff --git a/net/wireless/util.c b/net/wireless/util.c |
4638 |
+index ca3361a3e750..0f6c34ff9b55 100644 |
4639 |
+--- a/net/wireless/util.c |
4640 |
++++ b/net/wireless/util.c |
4641 |
+@@ -1042,6 +1042,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev, |
4642 |
+ } |
4643 |
+ |
4644 |
+ cfg80211_process_rdev_events(rdev); |
4645 |
++ cfg80211_mlme_purge_registrations(dev->ieee80211_ptr); |
4646 |
+ } |
4647 |
+ |
4648 |
+ err = rdev_change_virtual_intf(rdev, dev, ntype, params); |
4649 |
+diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c |
4650 |
+index c4a345c3715b..6ee49c973135 100644 |
4651 |
+--- a/scripts/gcc-plugins/randomize_layout_plugin.c |
4652 |
++++ b/scripts/gcc-plugins/randomize_layout_plugin.c |
4653 |
+@@ -443,13 +443,13 @@ static int is_pure_ops_struct(const_tree node) |
4654 |
+ if (node == fieldtype) |
4655 |
+ continue; |
4656 |
+ |
4657 |
+- if (!is_fptr(fieldtype)) |
4658 |
+- return 0; |
4659 |
+- |
4660 |
+- if (code != RECORD_TYPE && code != UNION_TYPE) |
4661 |
++ if (code == RECORD_TYPE || code == UNION_TYPE) { |
4662 |
++ if (!is_pure_ops_struct(fieldtype)) |
4663 |
++ return 0; |
4664 |
+ continue; |
4665 |
++ } |
4666 |
+ |
4667 |
+- if (!is_pure_ops_struct(fieldtype)) |
4668 |
++ if (!is_fptr(fieldtype)) |
4669 |
+ return 0; |
4670 |
+ } |
4671 |
+ |
4672 |
+diff --git a/sound/firewire/tascam/tascam-pcm.c b/sound/firewire/tascam/tascam-pcm.c |
4673 |
+index 6ec8ec634d4d..87da80727c22 100644 |
4674 |
+--- a/sound/firewire/tascam/tascam-pcm.c |
4675 |
++++ b/sound/firewire/tascam/tascam-pcm.c |
4676 |
+@@ -57,6 +57,9 @@ static int pcm_open(struct snd_pcm_substream *substream) |
4677 |
+ goto err_locked; |
4678 |
+ |
4679 |
+ err = snd_tscm_stream_get_clock(tscm, &clock); |
4680 |
++ if (err < 0) |
4681 |
++ goto err_locked; |
4682 |
++ |
4683 |
+ if (clock != SND_TSCM_CLOCK_INTERNAL || |
4684 |
+ amdtp_stream_pcm_running(&tscm->rx_stream) || |
4685 |
+ amdtp_stream_pcm_running(&tscm->tx_stream)) { |
4686 |
+diff --git a/sound/firewire/tascam/tascam-stream.c b/sound/firewire/tascam/tascam-stream.c |
4687 |
+index f1657a4e0621..a1308f12a65b 100644 |
4688 |
+--- a/sound/firewire/tascam/tascam-stream.c |
4689 |
++++ b/sound/firewire/tascam/tascam-stream.c |
4690 |
+@@ -9,20 +9,37 @@ |
4691 |
+ #include <linux/delay.h> |
4692 |
+ #include "tascam.h" |
4693 |
+ |
4694 |
++#define CLOCK_STATUS_MASK 0xffff0000 |
4695 |
++#define CLOCK_CONFIG_MASK 0x0000ffff |
4696 |
++ |
4697 |
+ #define CALLBACK_TIMEOUT 500 |
4698 |
+ |
4699 |
+ static int get_clock(struct snd_tscm *tscm, u32 *data) |
4700 |
+ { |
4701 |
++ int trial = 0; |
4702 |
+ __be32 reg; |
4703 |
+ int err; |
4704 |
+ |
4705 |
+- err = snd_fw_transaction(tscm->unit, TCODE_READ_QUADLET_REQUEST, |
4706 |
+- TSCM_ADDR_BASE + TSCM_OFFSET_CLOCK_STATUS, |
4707 |
+- ®, sizeof(reg), 0); |
4708 |
+- if (err >= 0) |
4709 |
++ while (trial++ < 5) { |
4710 |
++ err = snd_fw_transaction(tscm->unit, TCODE_READ_QUADLET_REQUEST, |
4711 |
++ TSCM_ADDR_BASE + TSCM_OFFSET_CLOCK_STATUS, |
4712 |
++ ®, sizeof(reg), 0); |
4713 |
++ if (err < 0) |
4714 |
++ return err; |
4715 |
++ |
4716 |
+ *data = be32_to_cpu(reg); |
4717 |
++ if (*data & CLOCK_STATUS_MASK) |
4718 |
++ break; |
4719 |
+ |
4720 |
+- return err; |
4721 |
++ // In intermediate state after changing clock status. |
4722 |
++ msleep(50); |
4723 |
++ } |
4724 |
++ |
4725 |
++ // Still in the intermediate state. |
4726 |
++ if (trial >= 5) |
4727 |
++ return -EAGAIN; |
4728 |
++ |
4729 |
++ return 0; |
4730 |
+ } |
4731 |
+ |
4732 |
+ static int set_clock(struct snd_tscm *tscm, unsigned int rate, |
4733 |
+@@ -35,7 +52,7 @@ static int set_clock(struct snd_tscm *tscm, unsigned int rate, |
4734 |
+ err = get_clock(tscm, &data); |
4735 |
+ if (err < 0) |
4736 |
+ return err; |
4737 |
+- data &= 0x0000ffff; |
4738 |
++ data &= CLOCK_CONFIG_MASK; |
4739 |
+ |
4740 |
+ if (rate > 0) { |
4741 |
+ data &= 0x000000ff; |
4742 |
+@@ -80,17 +97,14 @@ static int set_clock(struct snd_tscm *tscm, unsigned int rate, |
4743 |
+ |
4744 |
+ int snd_tscm_stream_get_rate(struct snd_tscm *tscm, unsigned int *rate) |
4745 |
+ { |
4746 |
+- u32 data = 0x0; |
4747 |
+- unsigned int trials = 0; |
4748 |
++ u32 data; |
4749 |
+ int err; |
4750 |
+ |
4751 |
+- while (data == 0x0 || trials++ < 5) { |
4752 |
+- err = get_clock(tscm, &data); |
4753 |
+- if (err < 0) |
4754 |
+- return err; |
4755 |
++ err = get_clock(tscm, &data); |
4756 |
++ if (err < 0) |
4757 |
++ return err; |
4758 |
+ |
4759 |
+- data = (data & 0xff000000) >> 24; |
4760 |
+- } |
4761 |
++ data = (data & 0xff000000) >> 24; |
4762 |
+ |
4763 |
+ /* Check base rate. */ |
4764 |
+ if ((data & 0x0f) == 0x01) |
4765 |
+diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c |
4766 |
+index 778b42ba90b8..3377f0bc2828 100644 |
4767 |
+--- a/sound/hda/hdac_controller.c |
4768 |
++++ b/sound/hda/hdac_controller.c |
4769 |
+@@ -442,6 +442,8 @@ static void azx_int_disable(struct hdac_bus *bus) |
4770 |
+ list_for_each_entry(azx_dev, &bus->stream_list, list) |
4771 |
+ snd_hdac_stream_updateb(azx_dev, SD_CTL, SD_INT_MASK, 0); |
4772 |
+ |
4773 |
++ synchronize_irq(bus->irq); |
4774 |
++ |
4775 |
+ /* disable SIE for all streams */ |
4776 |
+ snd_hdac_chip_writeb(bus, INTCTL, 0); |
4777 |
+ |
4778 |
+diff --git a/sound/i2c/other/ak4xxx-adda.c b/sound/i2c/other/ak4xxx-adda.c |
4779 |
+index bf377dc192aa..d33e02c31712 100644 |
4780 |
+--- a/sound/i2c/other/ak4xxx-adda.c |
4781 |
++++ b/sound/i2c/other/ak4xxx-adda.c |
4782 |
+@@ -789,11 +789,12 @@ static int build_adc_controls(struct snd_akm4xxx *ak) |
4783 |
+ return err; |
4784 |
+ |
4785 |
+ memset(&knew, 0, sizeof(knew)); |
4786 |
+- knew.name = ak->adc_info[mixer_ch].selector_name; |
4787 |
+- if (!knew.name) { |
4788 |
++ if (!ak->adc_info || |
4789 |
++ !ak->adc_info[mixer_ch].selector_name) { |
4790 |
+ knew.name = "Capture Channel"; |
4791 |
+ knew.index = mixer_ch + ak->idx_offset * 2; |
4792 |
+- } |
4793 |
++ } else |
4794 |
++ knew.name = ak->adc_info[mixer_ch].selector_name; |
4795 |
+ |
4796 |
+ knew.iface = SNDRV_CTL_ELEM_IFACE_MIXER; |
4797 |
+ knew.info = ak4xxx_capture_source_info; |
4798 |
+diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c |
4799 |
+index a41c1bec7c88..8fcb421193e0 100644 |
4800 |
+--- a/sound/pci/hda/hda_controller.c |
4801 |
++++ b/sound/pci/hda/hda_controller.c |
4802 |
+@@ -877,10 +877,13 @@ static int azx_rirb_get_response(struct hdac_bus *bus, unsigned int addr, |
4803 |
+ */ |
4804 |
+ if (hbus->allow_bus_reset && !hbus->response_reset && !hbus->in_reset) { |
4805 |
+ hbus->response_reset = 1; |
4806 |
++ dev_err(chip->card->dev, |
4807 |
++ "No response from codec, resetting bus: last cmd=0x%08x\n", |
4808 |
++ bus->last_cmd[addr]); |
4809 |
+ return -EAGAIN; /* give a chance to retry */ |
4810 |
+ } |
4811 |
+ |
4812 |
+- dev_err(chip->card->dev, |
4813 |
++ dev_WARN(chip->card->dev, |
4814 |
+ "azx_get_response timeout, switching to single_cmd mode: last cmd=0x%08x\n", |
4815 |
+ bus->last_cmd[addr]); |
4816 |
+ chip->single_cmd = 1; |
4817 |
+diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c |
4818 |
+index 682f9657c16c..b42ab80ee607 100644 |
4819 |
+--- a/sound/pci/hda/hda_intel.c |
4820 |
++++ b/sound/pci/hda/hda_intel.c |
4821 |
+@@ -1413,9 +1413,9 @@ static int azx_free(struct azx *chip) |
4822 |
+ } |
4823 |
+ |
4824 |
+ if (bus->chip_init) { |
4825 |
++ azx_stop_chip(chip); |
4826 |
+ azx_clear_irq_pending(chip); |
4827 |
+ azx_stop_all_streams(chip); |
4828 |
+- azx_stop_chip(chip); |
4829 |
+ } |
4830 |
+ |
4831 |
+ if (bus->irq >= 0) |
4832 |
+@@ -2586,8 +2586,7 @@ static const struct pci_device_id azx_ids[] = { |
4833 |
+ AZX_DCAPS_PM_RUNTIME }, |
4834 |
+ /* AMD Raven */ |
4835 |
+ { PCI_DEVICE(0x1022, 0x15e3), |
4836 |
+- .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_SB | |
4837 |
+- AZX_DCAPS_PM_RUNTIME }, |
4838 |
++ .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_AMD_SB }, |
4839 |
+ /* ATI HDMI */ |
4840 |
+ { PCI_DEVICE(0x1002, 0x0002), |
4841 |
+ .driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS }, |
4842 |
+diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c |
4843 |
+index 757857313426..87eff3c39611 100644 |
4844 |
+--- a/sound/pci/hda/patch_analog.c |
4845 |
++++ b/sound/pci/hda/patch_analog.c |
4846 |
+@@ -370,6 +370,7 @@ static const struct hda_fixup ad1986a_fixups[] = { |
4847 |
+ |
4848 |
+ static const struct snd_pci_quirk ad1986a_fixup_tbl[] = { |
4849 |
+ SND_PCI_QUIRK(0x103c, 0x30af, "HP B2800", AD1986A_FIXUP_LAPTOP_IMIC), |
4850 |
++ SND_PCI_QUIRK(0x1043, 0x1153, "ASUS M9V", AD1986A_FIXUP_LAPTOP_IMIC), |
4851 |
+ SND_PCI_QUIRK(0x1043, 0x1443, "ASUS Z99He", AD1986A_FIXUP_EAPD), |
4852 |
+ SND_PCI_QUIRK(0x1043, 0x1447, "ASUS A8JN", AD1986A_FIXUP_EAPD), |
4853 |
+ SND_PCI_QUIRK_MASK(0x1043, 0xff00, 0x8100, "ASUS P5", AD1986A_FIXUP_3STACK), |
4854 |
+diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c |
4855 |
+index f5803f9bba9b..f21405597215 100644 |
4856 |
+--- a/sound/pci/hda/patch_hdmi.c |
4857 |
++++ b/sound/pci/hda/patch_hdmi.c |
4858 |
+@@ -2555,13 +2555,20 @@ static void i915_pin_cvt_fixup(struct hda_codec *codec, |
4859 |
+ /* precondition and allocation for Intel codecs */ |
4860 |
+ static int alloc_intel_hdmi(struct hda_codec *codec) |
4861 |
+ { |
4862 |
++ int err; |
4863 |
++ |
4864 |
+ /* requires i915 binding */ |
4865 |
+ if (!codec->bus->core.audio_component) { |
4866 |
+ codec_info(codec, "No i915 binding for Intel HDMI/DP codec\n"); |
4867 |
+ return -ENODEV; |
4868 |
+ } |
4869 |
+ |
4870 |
+- return alloc_generic_hdmi(codec); |
4871 |
++ err = alloc_generic_hdmi(codec); |
4872 |
++ if (err < 0) |
4873 |
++ return err; |
4874 |
++ /* no need to handle unsol events */ |
4875 |
++ codec->patch_ops.unsol_event = NULL; |
4876 |
++ return 0; |
4877 |
+ } |
4878 |
+ |
4879 |
+ /* parse and post-process for Intel codecs */ |
4880 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
4881 |
+index 6deb96a301d3..ab7bc7ebb721 100644 |
4882 |
+--- a/sound/pci/hda/patch_realtek.c |
4883 |
++++ b/sound/pci/hda/patch_realtek.c |
4884 |
+@@ -977,6 +977,9 @@ static const struct snd_pci_quirk beep_white_list[] = { |
4885 |
+ SND_PCI_QUIRK(0x1043, 0x834a, "EeePC", 1), |
4886 |
+ SND_PCI_QUIRK(0x1458, 0xa002, "GA-MA790X", 1), |
4887 |
+ SND_PCI_QUIRK(0x8086, 0xd613, "Intel", 1), |
4888 |
++ /* blacklist -- no beep available */ |
4889 |
++ SND_PCI_QUIRK(0x17aa, 0x309e, "Lenovo ThinkCentre M73", 0), |
4890 |
++ SND_PCI_QUIRK(0x17aa, 0x30a3, "Lenovo ThinkCentre M93", 0), |
4891 |
+ {} |
4892 |
+ }; |
4893 |
+ |
4894 |
+@@ -3608,6 +3611,19 @@ static void alc269_fixup_hp_mute_led_mic2(struct hda_codec *codec, |
4895 |
+ } |
4896 |
+ } |
4897 |
+ |
4898 |
++static void alc269_fixup_hp_mute_led_mic3(struct hda_codec *codec, |
4899 |
++ const struct hda_fixup *fix, int action) |
4900 |
++{ |
4901 |
++ struct alc_spec *spec = codec->spec; |
4902 |
++ if (action == HDA_FIXUP_ACT_PRE_PROBE) { |
4903 |
++ spec->mute_led_polarity = 0; |
4904 |
++ spec->mute_led_nid = 0x1b; |
4905 |
++ spec->gen.vmaster_mute.hook = alc269_fixup_mic_mute_hook; |
4906 |
++ spec->gen.vmaster_mute_enum = 1; |
4907 |
++ codec->power_filter = led_power_filter; |
4908 |
++ } |
4909 |
++} |
4910 |
++ |
4911 |
+ /* update LED status via GPIO */ |
4912 |
+ static void alc_update_gpio_led(struct hda_codec *codec, unsigned int mask, |
4913 |
+ bool enabled) |
4914 |
+@@ -5382,6 +5398,7 @@ enum { |
4915 |
+ ALC269_FIXUP_HP_MUTE_LED, |
4916 |
+ ALC269_FIXUP_HP_MUTE_LED_MIC1, |
4917 |
+ ALC269_FIXUP_HP_MUTE_LED_MIC2, |
4918 |
++ ALC269_FIXUP_HP_MUTE_LED_MIC3, |
4919 |
+ ALC269_FIXUP_HP_GPIO_LED, |
4920 |
+ ALC269_FIXUP_HP_GPIO_MIC1_LED, |
4921 |
+ ALC269_FIXUP_HP_LINE1_MIC1_LED, |
4922 |
+@@ -5645,6 +5662,10 @@ static const struct hda_fixup alc269_fixups[] = { |
4923 |
+ .type = HDA_FIXUP_FUNC, |
4924 |
+ .v.func = alc269_fixup_hp_mute_led_mic2, |
4925 |
+ }, |
4926 |
++ [ALC269_FIXUP_HP_MUTE_LED_MIC3] = { |
4927 |
++ .type = HDA_FIXUP_FUNC, |
4928 |
++ .v.func = alc269_fixup_hp_mute_led_mic3, |
4929 |
++ }, |
4930 |
+ [ALC269_FIXUP_HP_GPIO_LED] = { |
4931 |
+ .type = HDA_FIXUP_FUNC, |
4932 |
+ .v.func = alc269_fixup_hp_gpio_led, |
4933 |
+@@ -6499,6 +6520,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
4934 |
+ SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
4935 |
+ SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), |
4936 |
+ SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
4937 |
++ SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
4938 |
+ SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
4939 |
+ SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
4940 |
+ SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
4941 |
+diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c |
4942 |
+index da2d353af5ba..949dbdc0445e 100644 |
4943 |
+--- a/sound/soc/codecs/es8316.c |
4944 |
++++ b/sound/soc/codecs/es8316.c |
4945 |
+@@ -46,7 +46,10 @@ static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(adc_vol_tlv, -9600, 50, 1); |
4946 |
+ static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(alc_max_gain_tlv, -650, 150, 0); |
4947 |
+ static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(alc_min_gain_tlv, -1200, 150, 0); |
4948 |
+ static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(alc_target_tlv, -1650, 150, 0); |
4949 |
+-static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(hpmixer_gain_tlv, -1200, 150, 0); |
4950 |
++static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(hpmixer_gain_tlv, |
4951 |
++ 0, 4, TLV_DB_SCALE_ITEM(-1200, 150, 0), |
4952 |
++ 8, 11, TLV_DB_SCALE_ITEM(-450, 150, 0), |
4953 |
++); |
4954 |
+ |
4955 |
+ static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(adc_pga_gain_tlv, |
4956 |
+ 0, 0, TLV_DB_SCALE_ITEM(-350, 0, 0), |
4957 |
+@@ -84,7 +87,7 @@ static const struct snd_kcontrol_new es8316_snd_controls[] = { |
4958 |
+ SOC_DOUBLE_TLV("Headphone Playback Volume", ES8316_CPHP_ICAL_VOL, |
4959 |
+ 4, 0, 3, 1, hpout_vol_tlv), |
4960 |
+ SOC_DOUBLE_TLV("Headphone Mixer Volume", ES8316_HPMIX_VOL, |
4961 |
+- 0, 4, 7, 0, hpmixer_gain_tlv), |
4962 |
++ 0, 4, 11, 0, hpmixer_gain_tlv), |
4963 |
+ |
4964 |
+ SOC_ENUM("Playback Polarity", dacpol), |
4965 |
+ SOC_DOUBLE_R_TLV("DAC Playback Volume", ES8316_DAC_VOLL, |
4966 |
+diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c |
4967 |
+index 0b11a2e01b2f..b649675d190d 100644 |
4968 |
+--- a/sound/soc/codecs/sgtl5000.c |
4969 |
++++ b/sound/soc/codecs/sgtl5000.c |
4970 |
+@@ -1084,12 +1084,17 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec) |
4971 |
+ SGTL5000_INT_OSC_EN); |
4972 |
+ /* Enable VDDC charge pump */ |
4973 |
+ ana_pwr |= SGTL5000_VDDC_CHRGPMP_POWERUP; |
4974 |
+- } else if (vddio >= 3100 && vdda >= 3100) { |
4975 |
++ } else { |
4976 |
+ ana_pwr &= ~SGTL5000_VDDC_CHRGPMP_POWERUP; |
4977 |
+- /* VDDC use VDDIO rail */ |
4978 |
+- lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD; |
4979 |
+- lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO << |
4980 |
+- SGTL5000_VDDC_MAN_ASSN_SHIFT; |
4981 |
++ /* |
4982 |
++ * if vddio == vdda the source of charge pump should be |
4983 |
++ * assigned manually to VDDIO |
4984 |
++ */ |
4985 |
++ if (vddio == vdda) { |
4986 |
++ lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD; |
4987 |
++ lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO << |
4988 |
++ SGTL5000_VDDC_MAN_ASSN_SHIFT; |
4989 |
++ } |
4990 |
+ } |
4991 |
+ |
4992 |
+ snd_soc_write(codec, SGTL5000_CHIP_LINREG_CTRL, lreg_ctrl); |
4993 |
+diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c |
4994 |
+index 3ffbb498cc70..38b336146b38 100644 |
4995 |
+--- a/sound/soc/fsl/fsl_ssi.c |
4996 |
++++ b/sound/soc/fsl/fsl_ssi.c |
4997 |
+@@ -1418,6 +1418,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) |
4998 |
+ struct fsl_ssi_private *ssi_private; |
4999 |
+ int ret = 0; |
5000 |
+ struct device_node *np = pdev->dev.of_node; |
5001 |
++ struct device_node *root; |
5002 |
+ const struct of_device_id *of_id; |
5003 |
+ const char *p, *sprop; |
5004 |
+ const uint32_t *iprop; |
5005 |
+@@ -1605,7 +1606,9 @@ static int fsl_ssi_probe(struct platform_device *pdev) |
5006 |
+ * device tree. We also pass the address of the CPU DAI driver |
5007 |
+ * structure. |
5008 |
+ */ |
5009 |
+- sprop = of_get_property(of_find_node_by_path("/"), "compatible", NULL); |
5010 |
++ root = of_find_node_by_path("/"); |
5011 |
++ sprop = of_get_property(root, "compatible", NULL); |
5012 |
++ of_node_put(root); |
5013 |
+ /* Sometimes the compatible name has a "fsl," prefix, so we strip it. */ |
5014 |
+ p = strrchr(sprop, ','); |
5015 |
+ if (p) |
5016 |
+diff --git a/sound/soc/intel/common/sst-ipc.c b/sound/soc/intel/common/sst-ipc.c |
5017 |
+index 62f3a8e0ec87..fedce78675e8 100644 |
5018 |
+--- a/sound/soc/intel/common/sst-ipc.c |
5019 |
++++ b/sound/soc/intel/common/sst-ipc.c |
5020 |
+@@ -231,6 +231,8 @@ struct ipc_message *sst_ipc_reply_find_msg(struct sst_generic_ipc *ipc, |
5021 |
+ |
5022 |
+ if (ipc->ops.reply_msg_match != NULL) |
5023 |
+ header = ipc->ops.reply_msg_match(header, &mask); |
5024 |
++ else |
5025 |
++ mask = (u64)-1; |
5026 |
+ |
5027 |
+ if (list_empty(&ipc->rx_list)) { |
5028 |
+ dev_err(ipc->dev, "error: rx list empty but received 0x%llx\n", |
5029 |
+diff --git a/sound/soc/intel/skylake/skl-debug.c b/sound/soc/intel/skylake/skl-debug.c |
5030 |
+index dc20d91f62e6..1987f78ea91e 100644 |
5031 |
+--- a/sound/soc/intel/skylake/skl-debug.c |
5032 |
++++ b/sound/soc/intel/skylake/skl-debug.c |
5033 |
+@@ -196,7 +196,7 @@ static ssize_t fw_softreg_read(struct file *file, char __user *user_buf, |
5034 |
+ memset(d->fw_read_buff, 0, FW_REG_BUF); |
5035 |
+ |
5036 |
+ if (w0_stat_sz > 0) |
5037 |
+- __iowrite32_copy(d->fw_read_buff, fw_reg_addr, w0_stat_sz >> 2); |
5038 |
++ __ioread32_copy(d->fw_read_buff, fw_reg_addr, w0_stat_sz >> 2); |
5039 |
+ |
5040 |
+ for (offset = 0; offset < FW_REG_SIZE; offset += 16) { |
5041 |
+ ret += snprintf(tmp + ret, FW_REG_BUF - ret, "%#.4x: ", offset); |
5042 |
+diff --git a/sound/soc/intel/skylake/skl-nhlt.c b/sound/soc/intel/skylake/skl-nhlt.c |
5043 |
+index 55859c5b456f..1b0129478a7f 100644 |
5044 |
+--- a/sound/soc/intel/skylake/skl-nhlt.c |
5045 |
++++ b/sound/soc/intel/skylake/skl-nhlt.c |
5046 |
+@@ -215,7 +215,7 @@ int skl_nhlt_update_topology_bin(struct skl *skl) |
5047 |
+ struct hdac_bus *bus = ebus_to_hbus(&skl->ebus); |
5048 |
+ struct device *dev = bus->dev; |
5049 |
+ |
5050 |
+- dev_dbg(dev, "oem_id %.6s, oem_table_id %8s oem_revision %d\n", |
5051 |
++ dev_dbg(dev, "oem_id %.6s, oem_table_id %.8s oem_revision %d\n", |
5052 |
+ nhlt->header.oem_id, nhlt->header.oem_table_id, |
5053 |
+ nhlt->header.oem_revision); |
5054 |
+ |
5055 |
+diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c |
5056 |
+index eb7879bcc6a7..686401bcd1f5 100644 |
5057 |
+--- a/sound/soc/sh/rcar/adg.c |
5058 |
++++ b/sound/soc/sh/rcar/adg.c |
5059 |
+@@ -33,6 +33,7 @@ struct rsnd_adg { |
5060 |
+ struct clk *clkout[CLKOUTMAX]; |
5061 |
+ struct clk_onecell_data onecell; |
5062 |
+ struct rsnd_mod mod; |
5063 |
++ int clk_rate[CLKMAX]; |
5064 |
+ u32 flags; |
5065 |
+ u32 ckr; |
5066 |
+ u32 rbga; |
5067 |
+@@ -110,9 +111,9 @@ static void __rsnd_adg_get_timesel_ratio(struct rsnd_priv *priv, |
5068 |
+ unsigned int val, en; |
5069 |
+ unsigned int min, diff; |
5070 |
+ unsigned int sel_rate[] = { |
5071 |
+- clk_get_rate(adg->clk[CLKA]), /* 0000: CLKA */ |
5072 |
+- clk_get_rate(adg->clk[CLKB]), /* 0001: CLKB */ |
5073 |
+- clk_get_rate(adg->clk[CLKC]), /* 0010: CLKC */ |
5074 |
++ adg->clk_rate[CLKA], /* 0000: CLKA */ |
5075 |
++ adg->clk_rate[CLKB], /* 0001: CLKB */ |
5076 |
++ adg->clk_rate[CLKC], /* 0010: CLKC */ |
5077 |
+ adg->rbga_rate_for_441khz, /* 0011: RBGA */ |
5078 |
+ adg->rbgb_rate_for_48khz, /* 0100: RBGB */ |
5079 |
+ }; |
5080 |
+@@ -328,7 +329,7 @@ int rsnd_adg_clk_query(struct rsnd_priv *priv, unsigned int rate) |
5081 |
+ * AUDIO_CLKA/AUDIO_CLKB/AUDIO_CLKC/AUDIO_CLKI. |
5082 |
+ */ |
5083 |
+ for_each_rsnd_clk(clk, adg, i) { |
5084 |
+- if (rate == clk_get_rate(clk)) |
5085 |
++ if (rate == adg->clk_rate[i]) |
5086 |
+ return sel_table[i]; |
5087 |
+ } |
5088 |
+ |
5089 |
+@@ -394,10 +395,18 @@ void rsnd_adg_clk_control(struct rsnd_priv *priv, int enable) |
5090 |
+ |
5091 |
+ for_each_rsnd_clk(clk, adg, i) { |
5092 |
+ ret = 0; |
5093 |
+- if (enable) |
5094 |
++ if (enable) { |
5095 |
+ ret = clk_prepare_enable(clk); |
5096 |
+- else |
5097 |
++ |
5098 |
++ /* |
5099 |
++ * We shouldn't use clk_get_rate() under |
5100 |
++ * atomic context. Let's keep it when |
5101 |
++ * rsnd_adg_clk_enable() was called |
5102 |
++ */ |
5103 |
++ adg->clk_rate[i] = clk_get_rate(adg->clk[i]); |
5104 |
++ } else { |
5105 |
+ clk_disable_unprepare(clk); |
5106 |
++ } |
5107 |
+ |
5108 |
+ if (ret < 0) |
5109 |
+ dev_warn(dev, "can't use clk %d\n", i); |
5110 |
+diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c |
5111 |
+index d53786498b61..052778c6afad 100644 |
5112 |
+--- a/sound/soc/soc-generic-dmaengine-pcm.c |
5113 |
++++ b/sound/soc/soc-generic-dmaengine-pcm.c |
5114 |
+@@ -311,6 +311,12 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd) |
5115 |
+ |
5116 |
+ if (!dmaengine_pcm_can_report_residue(dev, pcm->chan[i])) |
5117 |
+ pcm->flags |= SND_DMAENGINE_PCM_FLAG_NO_RESIDUE; |
5118 |
++ |
5119 |
++ if (rtd->pcm->streams[i].pcm->name[0] == '\0') { |
5120 |
++ strncpy(rtd->pcm->streams[i].pcm->name, |
5121 |
++ rtd->pcm->streams[i].pcm->id, |
5122 |
++ sizeof(rtd->pcm->streams[i].pcm->name)); |
5123 |
++ } |
5124 |
+ } |
5125 |
+ |
5126 |
+ return 0; |
5127 |
+diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c |
5128 |
+index b1a1eb1f65aa..ff38fca1781b 100644 |
5129 |
+--- a/sound/usb/pcm.c |
5130 |
++++ b/sound/usb/pcm.c |
5131 |
+@@ -470,6 +470,7 @@ static int set_sync_endpoint(struct snd_usb_substream *subs, |
5132 |
+ } |
5133 |
+ ep = get_endpoint(alts, 1)->bEndpointAddress; |
5134 |
+ if (get_endpoint(alts, 0)->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE && |
5135 |
++ get_endpoint(alts, 0)->bSynchAddress != 0 && |
5136 |
+ ((is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress | USB_DIR_IN)) || |
5137 |
+ (!is_playback && ep != (unsigned int)(get_endpoint(alts, 0)->bSynchAddress & ~USB_DIR_IN)))) { |
5138 |
+ dev_err(&dev->dev, |
5139 |
+diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile |
5140 |
+index 46cd5f871ad7..a26c44cf31aa 100644 |
5141 |
+--- a/tools/lib/traceevent/Makefile |
5142 |
++++ b/tools/lib/traceevent/Makefile |
5143 |
+@@ -55,15 +55,15 @@ set_plugin_dir := 1 |
5144 |
+ |
5145 |
+ # Set plugin_dir to preffered global plugin location |
5146 |
+ # If we install under $HOME directory we go under |
5147 |
+-# $(HOME)/.traceevent/plugins |
5148 |
++# $(HOME)/.local/lib/traceevent/plugins |
5149 |
+ # |
5150 |
+ # We dont set PLUGIN_DIR in case we install under $HOME |
5151 |
+ # directory, because by default the code looks under: |
5152 |
+-# $(HOME)/.traceevent/plugins by default. |
5153 |
++# $(HOME)/.local/lib/traceevent/plugins by default. |
5154 |
+ # |
5155 |
+ ifeq ($(plugin_dir),) |
5156 |
+ ifeq ($(prefix),$(HOME)) |
5157 |
+-override plugin_dir = $(HOME)/.traceevent/plugins |
5158 |
++override plugin_dir = $(HOME)/.local/lib/traceevent/plugins |
5159 |
+ set_plugin_dir := 0 |
5160 |
+ else |
5161 |
+ override plugin_dir = $(libdir)/traceevent/plugins |
5162 |
+diff --git a/tools/lib/traceevent/event-plugin.c b/tools/lib/traceevent/event-plugin.c |
5163 |
+index a16756ae3526..5fe7889606a2 100644 |
5164 |
+--- a/tools/lib/traceevent/event-plugin.c |
5165 |
++++ b/tools/lib/traceevent/event-plugin.c |
5166 |
+@@ -30,7 +30,7 @@ |
5167 |
+ #include "event-parse.h" |
5168 |
+ #include "event-utils.h" |
5169 |
+ |
5170 |
+-#define LOCAL_PLUGIN_DIR ".traceevent/plugins" |
5171 |
++#define LOCAL_PLUGIN_DIR ".local/lib/traceevent/plugins/" |
5172 |
+ |
5173 |
+ static struct registered_plugin_options { |
5174 |
+ struct registered_plugin_options *next; |
5175 |
+diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile |
5176 |
+index 884d4f1ed0c1..7786bce816c9 100644 |
5177 |
+--- a/tools/objtool/Makefile |
5178 |
++++ b/tools/objtool/Makefile |
5179 |
+@@ -26,14 +26,17 @@ LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a |
5180 |
+ OBJTOOL := $(OUTPUT)objtool |
5181 |
+ OBJTOOL_IN := $(OBJTOOL)-in.o |
5182 |
+ |
5183 |
++LIBELF_FLAGS := $(shell pkg-config libelf --cflags 2>/dev/null) |
5184 |
++LIBELF_LIBS := $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf) |
5185 |
++ |
5186 |
+ all: $(OBJTOOL) |
5187 |
+ |
5188 |
+ INCLUDES := -I$(srctree)/tools/include \ |
5189 |
+ -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \ |
5190 |
+ -I$(srctree)/tools/objtool/arch/$(ARCH)/include |
5191 |
+ WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed |
5192 |
+-CFLAGS += -Wall -Werror $(WARNINGS) -fomit-frame-pointer -O2 -g $(INCLUDES) |
5193 |
+-LDFLAGS += -lelf $(LIBSUBCMD) |
5194 |
++CFLAGS := -Wall -Werror $(WARNINGS) -fomit-frame-pointer -O2 -g $(INCLUDES) $(LIBELF_FLAGS) |
5195 |
++LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD) |
5196 |
+ |
5197 |
+ # Allow old libelf to be used: |
5198 |
+ elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr) |
5199 |
+diff --git a/tools/perf/tests/shell/trace+probe_vfs_getname.sh b/tools/perf/tests/shell/trace+probe_vfs_getname.sh |
5200 |
+index 2a9ef080efd0..a8a516dec4ed 100755 |
5201 |
+--- a/tools/perf/tests/shell/trace+probe_vfs_getname.sh |
5202 |
++++ b/tools/perf/tests/shell/trace+probe_vfs_getname.sh |
5203 |
+@@ -30,6 +30,10 @@ if [ $err -ne 0 ] ; then |
5204 |
+ exit $err |
5205 |
+ fi |
5206 |
+ |
5207 |
++# Do not use whatever ~/.perfconfig file, it may change the output |
5208 |
++# via trace.{show_timestamp,show_prefix,etc} |
5209 |
++export PERF_CONFIG=/dev/null |
5210 |
++ |
5211 |
+ trace_open_vfs_getname |
5212 |
+ err=$? |
5213 |
+ rm -f ${file} |
5214 |
+diff --git a/tools/perf/trace/beauty/ioctl.c b/tools/perf/trace/beauty/ioctl.c |
5215 |
+index 1be3b4cf0827..82346ca06f17 100644 |
5216 |
+--- a/tools/perf/trace/beauty/ioctl.c |
5217 |
++++ b/tools/perf/trace/beauty/ioctl.c |
5218 |
+@@ -22,7 +22,7 @@ |
5219 |
+ static size_t ioctl__scnprintf_tty_cmd(int nr, int dir, char *bf, size_t size) |
5220 |
+ { |
5221 |
+ static const char *ioctl_tty_cmd[] = { |
5222 |
+- "TCGETS", "TCSETS", "TCSETSW", "TCSETSF", "TCGETA", "TCSETA", "TCSETAW", |
5223 |
++ [_IOC_NR(TCGETS)] = "TCGETS", "TCSETS", "TCSETSW", "TCSETSF", "TCGETA", "TCSETA", "TCSETAW", |
5224 |
+ "TCSETAF", "TCSBRK", "TCXONC", "TCFLSH", "TIOCEXCL", "TIOCNXCL", "TIOCSCTTY", |
5225 |
+ "TIOCGPGRP", "TIOCSPGRP", "TIOCOUTQ", "TIOCSTI", "TIOCGWINSZ", "TIOCSWINSZ", |
5226 |
+ "TIOCMGET", "TIOCMBIS", "TIOCMBIC", "TIOCMSET", "TIOCGSOFTCAR", "TIOCSSOFTCAR", |
5227 |
+diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c |
5228 |
+index 6da7afa7d328..e1fe446f65da 100644 |
5229 |
+--- a/tools/perf/util/header.c |
5230 |
++++ b/tools/perf/util/header.c |
5231 |
+@@ -1882,8 +1882,10 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) |
5232 |
+ /* On s390 the socket_id number is not related to the numbers of cpus. |
5233 |
+ * The socket_id number might be higher than the numbers of cpus. |
5234 |
+ * This depends on the configuration. |
5235 |
++ * AArch64 is the same. |
5236 |
+ */ |
5237 |
+- if (ph->env.arch && !strncmp(ph->env.arch, "s390", 4)) |
5238 |
++ if (ph->env.arch && (!strncmp(ph->env.arch, "s390", 4) |
5239 |
++ || !strncmp(ph->env.arch, "aarch64", 7))) |
5240 |
+ do_core_id_test = false; |
5241 |
+ |
5242 |
+ for (i = 0; i < (u32)cpu_nr; i++) { |
5243 |
+diff --git a/tools/perf/util/xyarray.h b/tools/perf/util/xyarray.h |
5244 |
+index 7ffe562e7ae7..2627b038b6f2 100644 |
5245 |
+--- a/tools/perf/util/xyarray.h |
5246 |
++++ b/tools/perf/util/xyarray.h |
5247 |
+@@ -2,6 +2,7 @@ |
5248 |
+ #ifndef _PERF_XYARRAY_H_ |
5249 |
+ #define _PERF_XYARRAY_H_ 1 |
5250 |
+ |
5251 |
++#include <linux/compiler.h> |
5252 |
+ #include <sys/types.h> |
5253 |
+ |
5254 |
+ struct xyarray { |
5255 |
+@@ -10,7 +11,7 @@ struct xyarray { |
5256 |
+ size_t entries; |
5257 |
+ size_t max_x; |
5258 |
+ size_t max_y; |
5259 |
+- char contents[]; |
5260 |
++ char contents[] __aligned(8); |
5261 |
+ }; |
5262 |
+ |
5263 |
+ struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size); |