1 |
commit: bc672db99a4326c8616dc6c6534b6a67eed1c25c |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 20 13:23:27 2021 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 20 13:23:27 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=bc672db9 |
7 |
|
8 |
Linux patch 5.10.75 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1074_linux-5.10.75.patch | 2564 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 2568 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 11f68cc..6ee12e3 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -339,6 +339,10 @@ Patch: 1073_linux-5.10.74.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.10.74 |
23 |
|
24 |
+Patch: 1074_linux-5.10.75.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.10.75 |
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/1074_linux-5.10.75.patch b/1074_linux-5.10.75.patch |
33 |
new file mode 100644 |
34 |
index 0000000..8d9c3ca |
35 |
--- /dev/null |
36 |
+++ b/1074_linux-5.10.75.patch |
37 |
@@ -0,0 +1,2564 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 84d540aed24c9..74318cf964b89 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 10 |
46 |
+-SUBLEVEL = 74 |
47 |
++SUBLEVEL = 75 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Dare mighty things |
50 |
+ |
51 |
+diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts |
52 |
+index 5395e8c2484e0..167538518a1ec 100644 |
53 |
+--- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts |
54 |
++++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts |
55 |
+@@ -54,8 +54,8 @@ |
56 |
+ regulator-always-on; |
57 |
+ regulator-settling-time-us = <5000>; |
58 |
+ gpios = <&expgpio 4 GPIO_ACTIVE_HIGH>; |
59 |
+- states = <1800000 0x1 |
60 |
+- 3300000 0x0>; |
61 |
++ states = <1800000 0x1>, |
62 |
++ <3300000 0x0>; |
63 |
+ status = "okay"; |
64 |
+ }; |
65 |
+ |
66 |
+@@ -255,15 +255,16 @@ |
67 |
+ }; |
68 |
+ |
69 |
+ &pcie0 { |
70 |
+- pci@1,0 { |
71 |
++ pci@0,0 { |
72 |
++ device_type = "pci"; |
73 |
+ #address-cells = <3>; |
74 |
+ #size-cells = <2>; |
75 |
+ ranges; |
76 |
+ |
77 |
+ reg = <0 0 0 0 0>; |
78 |
+ |
79 |
+- usb@1,0 { |
80 |
+- reg = <0x10000 0 0 0 0>; |
81 |
++ usb@0,0 { |
82 |
++ reg = <0 0 0 0 0>; |
83 |
+ resets = <&reset RASPBERRYPI_FIRMWARE_RESET_ID_USB>; |
84 |
+ }; |
85 |
+ }; |
86 |
+diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi |
87 |
+index 3d040f6e2a20f..398ecd7b9b68b 100644 |
88 |
+--- a/arch/arm/boot/dts/bcm2711.dtsi |
89 |
++++ b/arch/arm/boot/dts/bcm2711.dtsi |
90 |
+@@ -514,8 +514,8 @@ |
91 |
+ compatible = "brcm,genet-mdio-v5"; |
92 |
+ reg = <0xe14 0x8>; |
93 |
+ reg-names = "mdio"; |
94 |
+- #address-cells = <0x0>; |
95 |
+- #size-cells = <0x1>; |
96 |
++ #address-cells = <0x1>; |
97 |
++ #size-cells = <0x0>; |
98 |
+ }; |
99 |
+ }; |
100 |
+ }; |
101 |
+diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c |
102 |
+index 55ecf6de9ff77..99cd6e7184083 100644 |
103 |
+--- a/arch/arm64/mm/hugetlbpage.c |
104 |
++++ b/arch/arm64/mm/hugetlbpage.c |
105 |
+@@ -43,7 +43,7 @@ void __init arm64_hugetlb_cma_reserve(void) |
106 |
+ #ifdef CONFIG_ARM64_4K_PAGES |
107 |
+ order = PUD_SHIFT - PAGE_SHIFT; |
108 |
+ #else |
109 |
+- order = CONT_PMD_SHIFT + PMD_SHIFT - PAGE_SHIFT; |
110 |
++ order = CONT_PMD_SHIFT - PAGE_SHIFT; |
111 |
+ #endif |
112 |
+ /* |
113 |
+ * HugeTLB CMA reservation is required for gigantic |
114 |
+diff --git a/arch/csky/kernel/ptrace.c b/arch/csky/kernel/ptrace.c |
115 |
+index a4cf2e2ac15ac..ac07695bc5418 100644 |
116 |
+--- a/arch/csky/kernel/ptrace.c |
117 |
++++ b/arch/csky/kernel/ptrace.c |
118 |
+@@ -98,7 +98,8 @@ static int gpr_set(struct task_struct *target, |
119 |
+ if (ret) |
120 |
+ return ret; |
121 |
+ |
122 |
+- regs.sr = task_pt_regs(target)->sr; |
123 |
++ /* BIT(0) of regs.sr is Condition Code/Carry bit */ |
124 |
++ regs.sr = (regs.sr & BIT(0)) | (task_pt_regs(target)->sr & ~BIT(0)); |
125 |
+ #ifdef CONFIG_CPU_HAS_HILO |
126 |
+ regs.dcsr = task_pt_regs(target)->dcsr; |
127 |
+ #endif |
128 |
+diff --git a/arch/csky/kernel/signal.c b/arch/csky/kernel/signal.c |
129 |
+index 8b068cf374478..0ca49b5e3dd37 100644 |
130 |
+--- a/arch/csky/kernel/signal.c |
131 |
++++ b/arch/csky/kernel/signal.c |
132 |
+@@ -52,10 +52,14 @@ static long restore_sigcontext(struct pt_regs *regs, |
133 |
+ struct sigcontext __user *sc) |
134 |
+ { |
135 |
+ int err = 0; |
136 |
++ unsigned long sr = regs->sr; |
137 |
+ |
138 |
+ /* sc_pt_regs is structured the same as the start of pt_regs */ |
139 |
+ err |= __copy_from_user(regs, &sc->sc_pt_regs, sizeof(struct pt_regs)); |
140 |
+ |
141 |
++ /* BIT(0) of regs->sr is Condition Code/Carry bit */ |
142 |
++ regs->sr = (sr & ~1) | (regs->sr & 1); |
143 |
++ |
144 |
+ /* Restore the floating-point state. */ |
145 |
+ err |= restore_fpu_state(sc); |
146 |
+ |
147 |
+diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c |
148 |
+index 5b0f6b6278e3d..6018f73d947da 100644 |
149 |
+--- a/arch/powerpc/sysdev/xive/common.c |
150 |
++++ b/arch/powerpc/sysdev/xive/common.c |
151 |
+@@ -997,7 +997,8 @@ static int xive_get_irqchip_state(struct irq_data *data, |
152 |
+ * interrupt to be inactive in that case. |
153 |
+ */ |
154 |
+ *state = (pq != XIVE_ESB_INVALID) && !xd->stale_p && |
155 |
+- (xd->saved_p || !!(pq & XIVE_ESB_VAL_P)); |
156 |
++ (xd->saved_p || (!!(pq & XIVE_ESB_VAL_P) && |
157 |
++ !irqd_irq_disabled(data))); |
158 |
+ return 0; |
159 |
+ default: |
160 |
+ return -EINVAL; |
161 |
+diff --git a/arch/s390/lib/string.c b/arch/s390/lib/string.c |
162 |
+index 93b3209b94a2f..db4e539d8c7fe 100644 |
163 |
+--- a/arch/s390/lib/string.c |
164 |
++++ b/arch/s390/lib/string.c |
165 |
+@@ -246,14 +246,13 @@ EXPORT_SYMBOL(strcmp); |
166 |
+ #ifdef __HAVE_ARCH_STRRCHR |
167 |
+ char *strrchr(const char *s, int c) |
168 |
+ { |
169 |
+- size_t len = __strend(s) - s; |
170 |
+- |
171 |
+- if (len) |
172 |
+- do { |
173 |
+- if (s[len] == (char) c) |
174 |
+- return (char *) s + len; |
175 |
+- } while (--len > 0); |
176 |
+- return NULL; |
177 |
++ ssize_t len = __strend(s) - s; |
178 |
++ |
179 |
++ do { |
180 |
++ if (s[len] == (char)c) |
181 |
++ return (char *)s + len; |
182 |
++ } while (--len >= 0); |
183 |
++ return NULL; |
184 |
+ } |
185 |
+ EXPORT_SYMBOL(strrchr); |
186 |
+ #endif |
187 |
+diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig |
188 |
+index 4201d0cf5f835..c3d9f56c90186 100644 |
189 |
+--- a/arch/x86/Kconfig |
190 |
++++ b/arch/x86/Kconfig |
191 |
+@@ -1534,7 +1534,6 @@ config AMD_MEM_ENCRYPT |
192 |
+ |
193 |
+ config AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT |
194 |
+ bool "Activate AMD Secure Memory Encryption (SME) by default" |
195 |
+- default y |
196 |
+ depends on AMD_MEM_ENCRYPT |
197 |
+ help |
198 |
+ Say yes to have system memory encrypted by default if running on |
199 |
+diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c |
200 |
+index e8b5f1cf1ae8c..4ccb9039f5950 100644 |
201 |
+--- a/arch/x86/kernel/cpu/resctrl/core.c |
202 |
++++ b/arch/x86/kernel/cpu/resctrl/core.c |
203 |
+@@ -590,6 +590,8 @@ static void domain_add_cpu(int cpu, struct rdt_resource *r) |
204 |
+ } |
205 |
+ |
206 |
+ if (r->mon_capable && domain_setup_mon_state(r, d)) { |
207 |
++ kfree(d->ctrl_val); |
208 |
++ kfree(d->mbps_val); |
209 |
+ kfree(d); |
210 |
+ return; |
211 |
+ } |
212 |
+diff --git a/drivers/acpi/arm64/gtdt.c b/drivers/acpi/arm64/gtdt.c |
213 |
+index 0a0a982f9c28d..c0e77c1c8e09d 100644 |
214 |
+--- a/drivers/acpi/arm64/gtdt.c |
215 |
++++ b/drivers/acpi/arm64/gtdt.c |
216 |
+@@ -36,7 +36,7 @@ struct acpi_gtdt_descriptor { |
217 |
+ |
218 |
+ static struct acpi_gtdt_descriptor acpi_gtdt_desc __initdata; |
219 |
+ |
220 |
+-static inline void *next_platform_timer(void *platform_timer) |
221 |
++static inline __init void *next_platform_timer(void *platform_timer) |
222 |
+ { |
223 |
+ struct acpi_gtdt_header *gh = platform_timer; |
224 |
+ |
225 |
+diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c |
226 |
+index b2f5520882918..0910441321f72 100644 |
227 |
+--- a/drivers/ata/libahci_platform.c |
228 |
++++ b/drivers/ata/libahci_platform.c |
229 |
+@@ -440,10 +440,7 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev, |
230 |
+ hpriv->phy_regulator = devm_regulator_get(dev, "phy"); |
231 |
+ if (IS_ERR(hpriv->phy_regulator)) { |
232 |
+ rc = PTR_ERR(hpriv->phy_regulator); |
233 |
+- if (rc == -EPROBE_DEFER) |
234 |
+- goto err_out; |
235 |
+- rc = 0; |
236 |
+- hpriv->phy_regulator = NULL; |
237 |
++ goto err_out; |
238 |
+ } |
239 |
+ |
240 |
+ if (flags & AHCI_PLATFORM_GET_RESETS) { |
241 |
+diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c |
242 |
+index 4fd12b20df239..d91ba47f2fc44 100644 |
243 |
+--- a/drivers/ata/pata_legacy.c |
244 |
++++ b/drivers/ata/pata_legacy.c |
245 |
+@@ -315,7 +315,8 @@ static unsigned int pdc_data_xfer_vlb(struct ata_queued_cmd *qc, |
246 |
+ iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); |
247 |
+ |
248 |
+ if (unlikely(slop)) { |
249 |
+- __le32 pad; |
250 |
++ __le32 pad = 0; |
251 |
++ |
252 |
+ if (rw == READ) { |
253 |
+ pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr)); |
254 |
+ memcpy(buf + buflen - slop, &pad, slop); |
255 |
+@@ -705,7 +706,8 @@ static unsigned int vlb32_data_xfer(struct ata_queued_cmd *qc, |
256 |
+ ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); |
257 |
+ |
258 |
+ if (unlikely(slop)) { |
259 |
+- __le32 pad; |
260 |
++ __le32 pad = 0; |
261 |
++ |
262 |
+ if (rw == WRITE) { |
263 |
+ memcpy(&pad, buf + buflen - slop, slop); |
264 |
+ iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr); |
265 |
+diff --git a/drivers/base/core.c b/drivers/base/core.c |
266 |
+index a364fe565007c..2bc4db5ffe445 100644 |
267 |
+--- a/drivers/base/core.c |
268 |
++++ b/drivers/base/core.c |
269 |
+@@ -549,7 +549,8 @@ struct device_link *device_link_add(struct device *consumer, |
270 |
+ { |
271 |
+ struct device_link *link; |
272 |
+ |
273 |
+- if (!consumer || !supplier || flags & ~DL_ADD_VALID_FLAGS || |
274 |
++ if (!consumer || !supplier || consumer == supplier || |
275 |
++ flags & ~DL_ADD_VALID_FLAGS || |
276 |
+ (flags & DL_FLAG_STATELESS && flags & DL_MANAGED_LINK_FLAGS) || |
277 |
+ (flags & DL_FLAG_SYNC_STATE_ONLY && |
278 |
+ flags != DL_FLAG_SYNC_STATE_ONLY) || |
279 |
+diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c |
280 |
+index c5eb46cbf388b..244b8f3b38b40 100644 |
281 |
+--- a/drivers/bus/simple-pm-bus.c |
282 |
++++ b/drivers/bus/simple-pm-bus.c |
283 |
+@@ -16,7 +16,33 @@ |
284 |
+ |
285 |
+ static int simple_pm_bus_probe(struct platform_device *pdev) |
286 |
+ { |
287 |
+- struct device_node *np = pdev->dev.of_node; |
288 |
++ const struct device *dev = &pdev->dev; |
289 |
++ struct device_node *np = dev->of_node; |
290 |
++ const struct of_device_id *match; |
291 |
++ |
292 |
++ /* |
293 |
++ * Allow user to use driver_override to bind this driver to a |
294 |
++ * transparent bus device which has a different compatible string |
295 |
++ * that's not listed in simple_pm_bus_of_match. We don't want to do any |
296 |
++ * of the simple-pm-bus tasks for these devices, so return early. |
297 |
++ */ |
298 |
++ if (pdev->driver_override) |
299 |
++ return 0; |
300 |
++ |
301 |
++ match = of_match_device(dev->driver->of_match_table, dev); |
302 |
++ /* |
303 |
++ * These are transparent bus devices (not simple-pm-bus matches) that |
304 |
++ * have their child nodes populated automatically. So, don't need to |
305 |
++ * do anything more. We only match with the device if this driver is |
306 |
++ * the most specific match because we don't want to incorrectly bind to |
307 |
++ * a device that has a more specific driver. |
308 |
++ */ |
309 |
++ if (match && match->data) { |
310 |
++ if (of_property_match_string(np, "compatible", match->compatible) == 0) |
311 |
++ return 0; |
312 |
++ else |
313 |
++ return -ENODEV; |
314 |
++ } |
315 |
+ |
316 |
+ dev_dbg(&pdev->dev, "%s\n", __func__); |
317 |
+ |
318 |
+@@ -30,14 +56,25 @@ static int simple_pm_bus_probe(struct platform_device *pdev) |
319 |
+ |
320 |
+ static int simple_pm_bus_remove(struct platform_device *pdev) |
321 |
+ { |
322 |
++ const void *data = of_device_get_match_data(&pdev->dev); |
323 |
++ |
324 |
++ if (pdev->driver_override || data) |
325 |
++ return 0; |
326 |
++ |
327 |
+ dev_dbg(&pdev->dev, "%s\n", __func__); |
328 |
+ |
329 |
+ pm_runtime_disable(&pdev->dev); |
330 |
+ return 0; |
331 |
+ } |
332 |
+ |
333 |
++#define ONLY_BUS ((void *) 1) /* Match if the device is only a bus. */ |
334 |
++ |
335 |
+ static const struct of_device_id simple_pm_bus_of_match[] = { |
336 |
+ { .compatible = "simple-pm-bus", }, |
337 |
++ { .compatible = "simple-bus", .data = ONLY_BUS }, |
338 |
++ { .compatible = "simple-mfd", .data = ONLY_BUS }, |
339 |
++ { .compatible = "isa", .data = ONLY_BUS }, |
340 |
++ { .compatible = "arm,amba-bus", .data = ONLY_BUS }, |
341 |
+ { /* sentinel */ } |
342 |
+ }; |
343 |
+ MODULE_DEVICE_TABLE(of, simple_pm_bus_of_match); |
344 |
+diff --git a/drivers/clk/socfpga/clk-agilex.c b/drivers/clk/socfpga/clk-agilex.c |
345 |
+index 7182afb4258a7..225636c2b5696 100644 |
346 |
+--- a/drivers/clk/socfpga/clk-agilex.c |
347 |
++++ b/drivers/clk/socfpga/clk-agilex.c |
348 |
+@@ -165,13 +165,6 @@ static const struct clk_parent_data mpu_mux[] = { |
349 |
+ .name = "boot_clk", }, |
350 |
+ }; |
351 |
+ |
352 |
+-static const struct clk_parent_data s2f_usr0_mux[] = { |
353 |
+- { .fw_name = "f2s-free-clk", |
354 |
+- .name = "f2s-free-clk", }, |
355 |
+- { .fw_name = "boot_clk", |
356 |
+- .name = "boot_clk", }, |
357 |
+-}; |
358 |
+- |
359 |
+ static const struct clk_parent_data emac_mux[] = { |
360 |
+ { .fw_name = "emaca_free_clk", |
361 |
+ .name = "emaca_free_clk", }, |
362 |
+@@ -299,8 +292,6 @@ static const struct stratix10_gate_clock agilex_gate_clks[] = { |
363 |
+ 4, 0x44, 28, 1, 0, 0, 0}, |
364 |
+ { AGILEX_CS_TIMER_CLK, "cs_timer_clk", NULL, noc_mux, ARRAY_SIZE(noc_mux), 0, 0x24, |
365 |
+ 5, 0, 0, 0, 0x30, 1, 0}, |
366 |
+- { AGILEX_S2F_USER0_CLK, "s2f_user0_clk", NULL, s2f_usr0_mux, ARRAY_SIZE(s2f_usr0_mux), 0, 0x24, |
367 |
+- 6, 0, 0, 0, 0, 0, 0}, |
368 |
+ { AGILEX_EMAC0_CLK, "emac0_clk", NULL, emac_mux, ARRAY_SIZE(emac_mux), 0, 0x7C, |
369 |
+ 0, 0, 0, 0, 0x94, 26, 0}, |
370 |
+ { AGILEX_EMAC1_CLK, "emac1_clk", NULL, emac_mux, ARRAY_SIZE(emac_mux), 0, 0x7C, |
371 |
+diff --git a/drivers/edac/armada_xp_edac.c b/drivers/edac/armada_xp_edac.c |
372 |
+index e3e757513d1bc..b1f46a974b9e0 100644 |
373 |
+--- a/drivers/edac/armada_xp_edac.c |
374 |
++++ b/drivers/edac/armada_xp_edac.c |
375 |
+@@ -178,7 +178,7 @@ static void axp_mc_check(struct mem_ctl_info *mci) |
376 |
+ "details unavailable (multiple errors)"); |
377 |
+ if (cnt_dbe) |
378 |
+ edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, |
379 |
+- cnt_sbe, /* error count */ |
380 |
++ cnt_dbe, /* error count */ |
381 |
+ 0, 0, 0, /* pfn, offset, syndrome */ |
382 |
+ -1, -1, -1, /* top, mid, low layer */ |
383 |
+ mci->ctl_name, |
384 |
+diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c |
385 |
+index ea7ca74fc1730..232c092c4c970 100644 |
386 |
+--- a/drivers/firmware/efi/cper.c |
387 |
++++ b/drivers/firmware/efi/cper.c |
388 |
+@@ -25,8 +25,6 @@ |
389 |
+ #include <acpi/ghes.h> |
390 |
+ #include <ras/ras_event.h> |
391 |
+ |
392 |
+-static char rcd_decode_str[CPER_REC_LEN]; |
393 |
+- |
394 |
+ /* |
395 |
+ * CPER record ID need to be unique even after reboot, because record |
396 |
+ * ID is used as index for ERST storage, while CPER records from |
397 |
+@@ -313,6 +311,7 @@ const char *cper_mem_err_unpack(struct trace_seq *p, |
398 |
+ struct cper_mem_err_compact *cmem) |
399 |
+ { |
400 |
+ const char *ret = trace_seq_buffer_ptr(p); |
401 |
++ char rcd_decode_str[CPER_REC_LEN]; |
402 |
+ |
403 |
+ if (cper_mem_err_location(cmem, rcd_decode_str)) |
404 |
+ trace_seq_printf(p, "%s", rcd_decode_str); |
405 |
+@@ -327,6 +326,7 @@ static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem, |
406 |
+ int len) |
407 |
+ { |
408 |
+ struct cper_mem_err_compact cmem; |
409 |
++ char rcd_decode_str[CPER_REC_LEN]; |
410 |
+ |
411 |
+ /* Don't trust UEFI 2.1/2.2 structure with bad validation bits */ |
412 |
+ if (len == sizeof(struct cper_sec_mem_err_old) && |
413 |
+diff --git a/drivers/firmware/efi/runtime-wrappers.c b/drivers/firmware/efi/runtime-wrappers.c |
414 |
+index 1410beaef5c30..f3e54f6616f02 100644 |
415 |
+--- a/drivers/firmware/efi/runtime-wrappers.c |
416 |
++++ b/drivers/firmware/efi/runtime-wrappers.c |
417 |
+@@ -414,7 +414,7 @@ static void virt_efi_reset_system(int reset_type, |
418 |
+ unsigned long data_size, |
419 |
+ efi_char16_t *data) |
420 |
+ { |
421 |
+- if (down_interruptible(&efi_runtime_lock)) { |
422 |
++ if (down_trylock(&efi_runtime_lock)) { |
423 |
+ pr_warn("failed to invoke the reset_system() runtime service:\n" |
424 |
+ "could not get exclusive access to the firmware\n"); |
425 |
+ return; |
426 |
+diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c |
427 |
+index 3a3aeef1017f5..a78167b2c9ca2 100644 |
428 |
+--- a/drivers/gpio/gpio-pca953x.c |
429 |
++++ b/drivers/gpio/gpio-pca953x.c |
430 |
+@@ -558,21 +558,21 @@ static int pca953x_gpio_set_pull_up_down(struct pca953x_chip *chip, |
431 |
+ |
432 |
+ mutex_lock(&chip->i2c_lock); |
433 |
+ |
434 |
+- /* Disable pull-up/pull-down */ |
435 |
+- ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, 0); |
436 |
+- if (ret) |
437 |
+- goto exit; |
438 |
+- |
439 |
+ /* Configure pull-up/pull-down */ |
440 |
+ if (config == PIN_CONFIG_BIAS_PULL_UP) |
441 |
+ ret = regmap_write_bits(chip->regmap, pull_sel_reg, bit, bit); |
442 |
+ else if (config == PIN_CONFIG_BIAS_PULL_DOWN) |
443 |
+ ret = regmap_write_bits(chip->regmap, pull_sel_reg, bit, 0); |
444 |
++ else |
445 |
++ ret = 0; |
446 |
+ if (ret) |
447 |
+ goto exit; |
448 |
+ |
449 |
+- /* Enable pull-up/pull-down */ |
450 |
+- ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, bit); |
451 |
++ /* Disable/Enable pull-up/pull-down */ |
452 |
++ if (config == PIN_CONFIG_BIAS_DISABLE) |
453 |
++ ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, 0); |
454 |
++ else |
455 |
++ ret = regmap_write_bits(chip->regmap, pull_en_reg, bit, bit); |
456 |
+ |
457 |
+ exit: |
458 |
+ mutex_unlock(&chip->i2c_lock); |
459 |
+@@ -586,7 +586,9 @@ static int pca953x_gpio_set_config(struct gpio_chip *gc, unsigned int offset, |
460 |
+ |
461 |
+ switch (pinconf_to_config_param(config)) { |
462 |
+ case PIN_CONFIG_BIAS_PULL_UP: |
463 |
++ case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: |
464 |
+ case PIN_CONFIG_BIAS_PULL_DOWN: |
465 |
++ case PIN_CONFIG_BIAS_DISABLE: |
466 |
+ return pca953x_gpio_set_pull_up_down(chip, offset, config); |
467 |
+ default: |
468 |
+ return -ENOTSUPP; |
469 |
+diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c |
470 |
+index b7ddf504e0249..add317bd8d55c 100644 |
471 |
+--- a/drivers/gpu/drm/drm_edid.c |
472 |
++++ b/drivers/gpu/drm/drm_edid.c |
473 |
+@@ -1835,11 +1835,20 @@ static void connector_bad_edid(struct drm_connector *connector, |
474 |
+ u8 *edid, int num_blocks) |
475 |
+ { |
476 |
+ int i; |
477 |
+- u8 num_of_ext = edid[0x7e]; |
478 |
++ u8 last_block; |
479 |
++ |
480 |
++ /* |
481 |
++ * 0x7e in the EDID is the number of extension blocks. The EDID |
482 |
++ * is 1 (base block) + num_ext_blocks big. That means we can think |
483 |
++ * of 0x7e in the EDID of the _index_ of the last block in the |
484 |
++ * combined chunk of memory. |
485 |
++ */ |
486 |
++ last_block = edid[0x7e]; |
487 |
+ |
488 |
+ /* Calculate real checksum for the last edid extension block data */ |
489 |
+- connector->real_edid_checksum = |
490 |
+- drm_edid_block_checksum(edid + num_of_ext * EDID_LENGTH); |
491 |
++ if (last_block < num_blocks) |
492 |
++ connector->real_edid_checksum = |
493 |
++ drm_edid_block_checksum(edid + last_block * EDID_LENGTH); |
494 |
+ |
495 |
+ if (connector->bad_edid_counter++ && !drm_debug_enabled(DRM_UT_KMS)) |
496 |
+ return; |
497 |
+diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c |
498 |
+index 2dcbe02846cd9..9e09805575db4 100644 |
499 |
+--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c |
500 |
++++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c |
501 |
+@@ -99,7 +99,7 @@ static void a6xx_set_pagetable(struct a6xx_gpu *a6xx_gpu, |
502 |
+ u32 asid; |
503 |
+ u64 memptr = rbmemptr(ring, ttbr0); |
504 |
+ |
505 |
+- if (ctx == a6xx_gpu->cur_ctx) |
506 |
++ if (ctx->seqno == a6xx_gpu->cur_ctx_seqno) |
507 |
+ return; |
508 |
+ |
509 |
+ if (msm_iommu_pagetable_params(ctx->aspace->mmu, &ttbr, &asid)) |
510 |
+@@ -132,7 +132,7 @@ static void a6xx_set_pagetable(struct a6xx_gpu *a6xx_gpu, |
511 |
+ OUT_PKT7(ring, CP_EVENT_WRITE, 1); |
512 |
+ OUT_RING(ring, 0x31); |
513 |
+ |
514 |
+- a6xx_gpu->cur_ctx = ctx; |
515 |
++ a6xx_gpu->cur_ctx_seqno = ctx->seqno; |
516 |
+ } |
517 |
+ |
518 |
+ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) |
519 |
+@@ -887,7 +887,7 @@ static int a6xx_hw_init(struct msm_gpu *gpu) |
520 |
+ /* Always come up on rb 0 */ |
521 |
+ a6xx_gpu->cur_ring = gpu->rb[0]; |
522 |
+ |
523 |
+- a6xx_gpu->cur_ctx = NULL; |
524 |
++ a6xx_gpu->cur_ctx_seqno = 0; |
525 |
+ |
526 |
+ /* Enable the SQE_to start the CP engine */ |
527 |
+ gpu_write(gpu, REG_A6XX_CP_SQE_CNTL, 1); |
528 |
+diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h |
529 |
+index 69765a722cae6..f923edbd5daaf 100644 |
530 |
+--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h |
531 |
++++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h |
532 |
+@@ -19,7 +19,16 @@ struct a6xx_gpu { |
533 |
+ uint64_t sqe_iova; |
534 |
+ |
535 |
+ struct msm_ringbuffer *cur_ring; |
536 |
+- struct msm_file_private *cur_ctx; |
537 |
++ |
538 |
++ /** |
539 |
++ * cur_ctx_seqno: |
540 |
++ * |
541 |
++ * The ctx->seqno value of the context with current pgtables |
542 |
++ * installed. Tracked by seqno rather than pointer value to |
543 |
++ * avoid dangling pointers, and cases where a ctx can be freed |
544 |
++ * and a new one created with the same address. |
545 |
++ */ |
546 |
++ int cur_ctx_seqno; |
547 |
+ |
548 |
+ struct a6xx_gmu gmu; |
549 |
+ |
550 |
+diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c |
551 |
+index 7d7668998501a..a8fa084dfa494 100644 |
552 |
+--- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c |
553 |
++++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c |
554 |
+@@ -1119,6 +1119,20 @@ static void mdp5_crtc_reset(struct drm_crtc *crtc) |
555 |
+ __drm_atomic_helper_crtc_reset(crtc, &mdp5_cstate->base); |
556 |
+ } |
557 |
+ |
558 |
++static const struct drm_crtc_funcs mdp5_crtc_no_lm_cursor_funcs = { |
559 |
++ .set_config = drm_atomic_helper_set_config, |
560 |
++ .destroy = mdp5_crtc_destroy, |
561 |
++ .page_flip = drm_atomic_helper_page_flip, |
562 |
++ .reset = mdp5_crtc_reset, |
563 |
++ .atomic_duplicate_state = mdp5_crtc_duplicate_state, |
564 |
++ .atomic_destroy_state = mdp5_crtc_destroy_state, |
565 |
++ .atomic_print_state = mdp5_crtc_atomic_print_state, |
566 |
++ .get_vblank_counter = mdp5_crtc_get_vblank_counter, |
567 |
++ .enable_vblank = msm_crtc_enable_vblank, |
568 |
++ .disable_vblank = msm_crtc_disable_vblank, |
569 |
++ .get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp, |
570 |
++}; |
571 |
++ |
572 |
+ static const struct drm_crtc_funcs mdp5_crtc_funcs = { |
573 |
+ .set_config = drm_atomic_helper_set_config, |
574 |
+ .destroy = mdp5_crtc_destroy, |
575 |
+@@ -1307,6 +1321,8 @@ struct drm_crtc *mdp5_crtc_init(struct drm_device *dev, |
576 |
+ mdp5_crtc->lm_cursor_enabled = cursor_plane ? false : true; |
577 |
+ |
578 |
+ drm_crtc_init_with_planes(dev, crtc, plane, cursor_plane, |
579 |
++ cursor_plane ? |
580 |
++ &mdp5_crtc_no_lm_cursor_funcs : |
581 |
+ &mdp5_crtc_funcs, NULL); |
582 |
+ |
583 |
+ drm_flip_work_init(&mdp5_crtc->unref_cursor_work, |
584 |
+diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c |
585 |
+index 7e364b9c9f9e1..1adead764feed 100644 |
586 |
+--- a/drivers/gpu/drm/msm/dsi/dsi.c |
587 |
++++ b/drivers/gpu/drm/msm/dsi/dsi.c |
588 |
+@@ -208,8 +208,10 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, |
589 |
+ goto fail; |
590 |
+ } |
591 |
+ |
592 |
+- if (!msm_dsi_manager_validate_current_config(msm_dsi->id)) |
593 |
++ if (!msm_dsi_manager_validate_current_config(msm_dsi->id)) { |
594 |
++ ret = -EINVAL; |
595 |
+ goto fail; |
596 |
++ } |
597 |
+ |
598 |
+ msm_dsi->encoder = encoder; |
599 |
+ |
600 |
+diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c |
601 |
+index b17ac6c275549..96b5dcf8e4540 100644 |
602 |
+--- a/drivers/gpu/drm/msm/dsi/dsi_host.c |
603 |
++++ b/drivers/gpu/drm/msm/dsi/dsi_host.c |
604 |
+@@ -464,7 +464,7 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host) |
605 |
+ |
606 |
+ return 0; |
607 |
+ err: |
608 |
+- for (; i > 0; i--) |
609 |
++ while (--i >= 0) |
610 |
+ clk_disable_unprepare(msm_host->bus_clks[i]); |
611 |
+ |
612 |
+ return ret; |
613 |
+diff --git a/drivers/gpu/drm/msm/edp/edp_ctrl.c b/drivers/gpu/drm/msm/edp/edp_ctrl.c |
614 |
+index 0d9657cc70dbb..937b4abb15526 100644 |
615 |
+--- a/drivers/gpu/drm/msm/edp/edp_ctrl.c |
616 |
++++ b/drivers/gpu/drm/msm/edp/edp_ctrl.c |
617 |
+@@ -1116,7 +1116,7 @@ void msm_edp_ctrl_power(struct edp_ctrl *ctrl, bool on) |
618 |
+ int msm_edp_ctrl_init(struct msm_edp *edp) |
619 |
+ { |
620 |
+ struct edp_ctrl *ctrl = NULL; |
621 |
+- struct device *dev = &edp->pdev->dev; |
622 |
++ struct device *dev; |
623 |
+ int ret; |
624 |
+ |
625 |
+ if (!edp) { |
626 |
+@@ -1124,6 +1124,7 @@ int msm_edp_ctrl_init(struct msm_edp *edp) |
627 |
+ return -EINVAL; |
628 |
+ } |
629 |
+ |
630 |
++ dev = &edp->pdev->dev; |
631 |
+ ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL); |
632 |
+ if (!ctrl) |
633 |
+ return -ENOMEM; |
634 |
+diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c |
635 |
+index edee4c2a76ce4..33e42b2f9cfcb 100644 |
636 |
+--- a/drivers/gpu/drm/msm/msm_drv.c |
637 |
++++ b/drivers/gpu/drm/msm/msm_drv.c |
638 |
+@@ -581,6 +581,7 @@ static void load_gpu(struct drm_device *dev) |
639 |
+ |
640 |
+ static int context_init(struct drm_device *dev, struct drm_file *file) |
641 |
+ { |
642 |
++ static atomic_t ident = ATOMIC_INIT(0); |
643 |
+ struct msm_drm_private *priv = dev->dev_private; |
644 |
+ struct msm_file_private *ctx; |
645 |
+ |
646 |
+@@ -594,6 +595,8 @@ static int context_init(struct drm_device *dev, struct drm_file *file) |
647 |
+ ctx->aspace = msm_gpu_create_private_address_space(priv->gpu, current); |
648 |
+ file->driver_priv = ctx; |
649 |
+ |
650 |
++ ctx->seqno = atomic_inc_return(&ident); |
651 |
++ |
652 |
+ return 0; |
653 |
+ } |
654 |
+ |
655 |
+diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h |
656 |
+index 0b2686b060c73..1fe809add8f62 100644 |
657 |
+--- a/drivers/gpu/drm/msm/msm_drv.h |
658 |
++++ b/drivers/gpu/drm/msm/msm_drv.h |
659 |
+@@ -58,6 +58,7 @@ struct msm_file_private { |
660 |
+ int queueid; |
661 |
+ struct msm_gem_address_space *aspace; |
662 |
+ struct kref ref; |
663 |
++ int seqno; |
664 |
+ }; |
665 |
+ |
666 |
+ enum msm_mdp_plane_property { |
667 |
+@@ -543,7 +544,7 @@ static inline int align_pitch(int width, int bpp) |
668 |
+ static inline unsigned long timeout_to_jiffies(const ktime_t *timeout) |
669 |
+ { |
670 |
+ ktime_t now = ktime_get(); |
671 |
+- unsigned long remaining_jiffies; |
672 |
++ s64 remaining_jiffies; |
673 |
+ |
674 |
+ if (ktime_compare(*timeout, now) < 0) { |
675 |
+ remaining_jiffies = 0; |
676 |
+@@ -552,7 +553,7 @@ static inline unsigned long timeout_to_jiffies(const ktime_t *timeout) |
677 |
+ remaining_jiffies = ktime_divns(rem, NSEC_PER_SEC / HZ); |
678 |
+ } |
679 |
+ |
680 |
+- return remaining_jiffies; |
681 |
++ return clamp(remaining_jiffies, 0LL, (s64)INT_MAX); |
682 |
+ } |
683 |
+ |
684 |
+ #endif /* __MSM_DRV_H__ */ |
685 |
+diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig |
686 |
+index b9dbedf8f15e8..6153972e0127a 100644 |
687 |
+--- a/drivers/gpu/drm/panel/Kconfig |
688 |
++++ b/drivers/gpu/drm/panel/Kconfig |
689 |
+@@ -233,6 +233,7 @@ config DRM_PANEL_OLIMEX_LCD_OLINUXINO |
690 |
+ depends on OF |
691 |
+ depends on I2C |
692 |
+ depends on BACKLIGHT_CLASS_DEVICE |
693 |
++ select CRC32 |
694 |
+ help |
695 |
+ The panel is used with different sizes LCDs, from 480x272 to |
696 |
+ 1280x800, and 24 bit per pixel. |
697 |
+diff --git a/drivers/iio/adc/ad7192.c b/drivers/iio/adc/ad7192.c |
698 |
+index 1141cc13a1249..1b8baba9d4d64 100644 |
699 |
+--- a/drivers/iio/adc/ad7192.c |
700 |
++++ b/drivers/iio/adc/ad7192.c |
701 |
+@@ -293,6 +293,7 @@ static const struct ad_sigma_delta_info ad7192_sigma_delta_info = { |
702 |
+ .has_registers = true, |
703 |
+ .addr_shift = 3, |
704 |
+ .read_mask = BIT(6), |
705 |
++ .irq_flags = IRQF_TRIGGER_FALLING, |
706 |
+ }; |
707 |
+ |
708 |
+ static const struct ad_sd_calib_data ad7192_calib_arr[8] = { |
709 |
+diff --git a/drivers/iio/adc/ad7780.c b/drivers/iio/adc/ad7780.c |
710 |
+index 42e7e8e595d18..c70048bc791bd 100644 |
711 |
+--- a/drivers/iio/adc/ad7780.c |
712 |
++++ b/drivers/iio/adc/ad7780.c |
713 |
+@@ -203,7 +203,7 @@ static const struct ad_sigma_delta_info ad7780_sigma_delta_info = { |
714 |
+ .set_mode = ad7780_set_mode, |
715 |
+ .postprocess_sample = ad7780_postprocess_sample, |
716 |
+ .has_registers = false, |
717 |
+- .irq_flags = IRQF_TRIGGER_LOW, |
718 |
++ .irq_flags = IRQF_TRIGGER_FALLING, |
719 |
+ }; |
720 |
+ |
721 |
+ #define _AD7780_CHANNEL(_bits, _wordsize, _mask_all) \ |
722 |
+diff --git a/drivers/iio/adc/ad7793.c b/drivers/iio/adc/ad7793.c |
723 |
+index 440ef4c7be074..7c9c95c252cf8 100644 |
724 |
+--- a/drivers/iio/adc/ad7793.c |
725 |
++++ b/drivers/iio/adc/ad7793.c |
726 |
+@@ -206,7 +206,7 @@ static const struct ad_sigma_delta_info ad7793_sigma_delta_info = { |
727 |
+ .has_registers = true, |
728 |
+ .addr_shift = 3, |
729 |
+ .read_mask = BIT(6), |
730 |
+- .irq_flags = IRQF_TRIGGER_LOW, |
731 |
++ .irq_flags = IRQF_TRIGGER_FALLING, |
732 |
+ }; |
733 |
+ |
734 |
+ static const struct ad_sd_calib_data ad7793_calib_arr[6] = { |
735 |
+diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c |
736 |
+index 19efaa41bc344..34ec0c28b2dff 100644 |
737 |
+--- a/drivers/iio/adc/aspeed_adc.c |
738 |
++++ b/drivers/iio/adc/aspeed_adc.c |
739 |
+@@ -183,6 +183,7 @@ static int aspeed_adc_probe(struct platform_device *pdev) |
740 |
+ |
741 |
+ data = iio_priv(indio_dev); |
742 |
+ data->dev = &pdev->dev; |
743 |
++ platform_set_drvdata(pdev, indio_dev); |
744 |
+ |
745 |
+ data->base = devm_platform_ioremap_resource(pdev, 0); |
746 |
+ if (IS_ERR(data->base)) |
747 |
+diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c |
748 |
+index ca1dff3924ff9..a08efaaf1a814 100644 |
749 |
+--- a/drivers/iio/adc/max1027.c |
750 |
++++ b/drivers/iio/adc/max1027.c |
751 |
+@@ -103,7 +103,7 @@ MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids); |
752 |
+ .sign = 'u', \ |
753 |
+ .realbits = depth, \ |
754 |
+ .storagebits = 16, \ |
755 |
+- .shift = 2, \ |
756 |
++ .shift = (depth == 10) ? 2 : 0, \ |
757 |
+ .endianness = IIO_BE, \ |
758 |
+ }, \ |
759 |
+ } |
760 |
+@@ -142,7 +142,6 @@ MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids); |
761 |
+ MAX1027_V_CHAN(11, depth) |
762 |
+ |
763 |
+ #define MAX1X31_CHANNELS(depth) \ |
764 |
+- MAX1X27_CHANNELS(depth), \ |
765 |
+ MAX1X29_CHANNELS(depth), \ |
766 |
+ MAX1027_V_CHAN(12, depth), \ |
767 |
+ MAX1027_V_CHAN(13, depth), \ |
768 |
+diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c |
769 |
+index 79c1dd68b9092..d4fccd52ef08b 100644 |
770 |
+--- a/drivers/iio/adc/mt6577_auxadc.c |
771 |
++++ b/drivers/iio/adc/mt6577_auxadc.c |
772 |
+@@ -82,6 +82,10 @@ static const struct iio_chan_spec mt6577_auxadc_iio_channels[] = { |
773 |
+ MT6577_AUXADC_CHANNEL(15), |
774 |
+ }; |
775 |
+ |
776 |
++/* For Voltage calculation */ |
777 |
++#define VOLTAGE_FULL_RANGE 1500 /* VA voltage */ |
778 |
++#define AUXADC_PRECISE 4096 /* 12 bits */ |
779 |
++ |
780 |
+ static int mt_auxadc_get_cali_data(int rawdata, bool enable_cali) |
781 |
+ { |
782 |
+ return rawdata; |
783 |
+@@ -191,6 +195,10 @@ static int mt6577_auxadc_read_raw(struct iio_dev *indio_dev, |
784 |
+ } |
785 |
+ if (adc_dev->dev_comp->sample_data_cali) |
786 |
+ *val = mt_auxadc_get_cali_data(*val, true); |
787 |
++ |
788 |
++ /* Convert adc raw data to voltage: 0 - 1500 mV */ |
789 |
++ *val = *val * VOLTAGE_FULL_RANGE / AUXADC_PRECISE; |
790 |
++ |
791 |
+ return IIO_VAL_INT; |
792 |
+ |
793 |
+ default: |
794 |
+diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s052.c |
795 |
+index 3143f35a6509a..83c1ae07b3e9a 100644 |
796 |
+--- a/drivers/iio/adc/ti-adc128s052.c |
797 |
++++ b/drivers/iio/adc/ti-adc128s052.c |
798 |
+@@ -171,7 +171,13 @@ static int adc128_probe(struct spi_device *spi) |
799 |
+ mutex_init(&adc->lock); |
800 |
+ |
801 |
+ ret = iio_device_register(indio_dev); |
802 |
++ if (ret) |
803 |
++ goto err_disable_regulator; |
804 |
+ |
805 |
++ return 0; |
806 |
++ |
807 |
++err_disable_regulator: |
808 |
++ regulator_disable(adc->reg); |
809 |
+ return ret; |
810 |
+ } |
811 |
+ |
812 |
+diff --git a/drivers/iio/common/ssp_sensors/ssp_spi.c b/drivers/iio/common/ssp_sensors/ssp_spi.c |
813 |
+index 4864c38b8d1c2..769bd9280524a 100644 |
814 |
+--- a/drivers/iio/common/ssp_sensors/ssp_spi.c |
815 |
++++ b/drivers/iio/common/ssp_sensors/ssp_spi.c |
816 |
+@@ -137,7 +137,7 @@ static int ssp_print_mcu_debug(char *data_frame, int *data_index, |
817 |
+ if (length > received_len - *data_index || length <= 0) { |
818 |
+ ssp_dbg("[SSP]: MSG From MCU-invalid debug length(%d/%d)\n", |
819 |
+ length, received_len); |
820 |
+- return length ? length : -EPROTO; |
821 |
++ return -EPROTO; |
822 |
+ } |
823 |
+ |
824 |
+ ssp_dbg("[SSP]: MSG From MCU - %s\n", &data_frame[*data_index]); |
825 |
+@@ -273,6 +273,8 @@ static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len) |
826 |
+ for (idx = 0; idx < len;) { |
827 |
+ switch (dataframe[idx++]) { |
828 |
+ case SSP_MSG2AP_INST_BYPASS_DATA: |
829 |
++ if (idx >= len) |
830 |
++ return -EPROTO; |
831 |
+ sd = dataframe[idx++]; |
832 |
+ if (sd < 0 || sd >= SSP_SENSOR_MAX) { |
833 |
+ dev_err(SSP_DEV, |
834 |
+@@ -282,10 +284,13 @@ static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len) |
835 |
+ |
836 |
+ if (indio_devs[sd]) { |
837 |
+ spd = iio_priv(indio_devs[sd]); |
838 |
+- if (spd->process_data) |
839 |
++ if (spd->process_data) { |
840 |
++ if (idx >= len) |
841 |
++ return -EPROTO; |
842 |
+ spd->process_data(indio_devs[sd], |
843 |
+ &dataframe[idx], |
844 |
+ data->timestamp); |
845 |
++ } |
846 |
+ } else { |
847 |
+ dev_err(SSP_DEV, "no client for frame\n"); |
848 |
+ } |
849 |
+@@ -293,6 +298,8 @@ static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len) |
850 |
+ idx += ssp_offset_map[sd]; |
851 |
+ break; |
852 |
+ case SSP_MSG2AP_INST_DEBUG_DATA: |
853 |
++ if (idx >= len) |
854 |
++ return -EPROTO; |
855 |
+ sd = ssp_print_mcu_debug(dataframe, &idx, len); |
856 |
+ if (sd) { |
857 |
+ dev_err(SSP_DEV, |
858 |
+diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c |
859 |
+index d3295767a079c..c0714cb1e164a 100644 |
860 |
+--- a/drivers/iio/dac/ti-dac5571.c |
861 |
++++ b/drivers/iio/dac/ti-dac5571.c |
862 |
+@@ -350,6 +350,7 @@ static int dac5571_probe(struct i2c_client *client, |
863 |
+ data->dac5571_pwrdwn = dac5571_pwrdwn_quad; |
864 |
+ break; |
865 |
+ default: |
866 |
++ ret = -EINVAL; |
867 |
+ goto err; |
868 |
+ } |
869 |
+ |
870 |
+diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c |
871 |
+index 2d48d61909a4d..ff776259734ad 100644 |
872 |
+--- a/drivers/iio/light/opt3001.c |
873 |
++++ b/drivers/iio/light/opt3001.c |
874 |
+@@ -276,6 +276,8 @@ static int opt3001_get_lux(struct opt3001 *opt, int *val, int *val2) |
875 |
+ ret = wait_event_timeout(opt->result_ready_queue, |
876 |
+ opt->result_ready, |
877 |
+ msecs_to_jiffies(OPT3001_RESULT_READY_LONG)); |
878 |
++ if (ret == 0) |
879 |
++ return -ETIMEDOUT; |
880 |
+ } else { |
881 |
+ /* Sleep for result ready time */ |
882 |
+ timeout = (opt->int_time == OPT3001_INT_TIME_SHORT) ? |
883 |
+@@ -312,9 +314,7 @@ err: |
884 |
+ /* Disallow IRQ to access the device while lock is active */ |
885 |
+ opt->ok_to_ignore_lock = false; |
886 |
+ |
887 |
+- if (ret == 0) |
888 |
+- return -ETIMEDOUT; |
889 |
+- else if (ret < 0) |
890 |
++ if (ret < 0) |
891 |
+ return ret; |
892 |
+ |
893 |
+ if (opt->use_irq) { |
894 |
+diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c |
895 |
+index e5f1e3cf9179f..ba101afcfc27f 100644 |
896 |
+--- a/drivers/input/joystick/xpad.c |
897 |
++++ b/drivers/input/joystick/xpad.c |
898 |
+@@ -331,6 +331,7 @@ static const struct xpad_device { |
899 |
+ { 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 }, |
900 |
+ { 0x24c6, 0x5d04, "Razer Sabertooth", 0, XTYPE_XBOX360 }, |
901 |
+ { 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 }, |
902 |
++ { 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 }, |
903 |
+ { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX }, |
904 |
+ { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, |
905 |
+ { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN } |
906 |
+@@ -447,6 +448,7 @@ static const struct usb_device_id xpad_table[] = { |
907 |
+ XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */ |
908 |
+ XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */ |
909 |
+ XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */ |
910 |
++ XPAD_XBOX360_VENDOR(0x3285), /* Nacon GC-100 */ |
911 |
+ { } |
912 |
+ }; |
913 |
+ |
914 |
+diff --git a/drivers/misc/cb710/sgbuf2.c b/drivers/misc/cb710/sgbuf2.c |
915 |
+index e5a4ed3701eb8..a798fad5f03c2 100644 |
916 |
+--- a/drivers/misc/cb710/sgbuf2.c |
917 |
++++ b/drivers/misc/cb710/sgbuf2.c |
918 |
+@@ -47,7 +47,7 @@ static inline bool needs_unaligned_copy(const void *ptr) |
919 |
+ #ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS |
920 |
+ return false; |
921 |
+ #else |
922 |
+- return ((ptr - NULL) & 3) != 0; |
923 |
++ return ((uintptr_t)ptr & 3) != 0; |
924 |
+ #endif |
925 |
+ } |
926 |
+ |
927 |
+diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c |
928 |
+index 273d9c1591793..a9c9d86eef4bc 100644 |
929 |
+--- a/drivers/misc/fastrpc.c |
930 |
++++ b/drivers/misc/fastrpc.c |
931 |
+@@ -812,10 +812,12 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx) |
932 |
+ rpra[i].pv = (u64) ctx->args[i].ptr; |
933 |
+ pages[i].addr = ctx->maps[i]->phys; |
934 |
+ |
935 |
++ mmap_read_lock(current->mm); |
936 |
+ vma = find_vma(current->mm, ctx->args[i].ptr); |
937 |
+ if (vma) |
938 |
+ pages[i].addr += ctx->args[i].ptr - |
939 |
+ vma->vm_start; |
940 |
++ mmap_read_unlock(current->mm); |
941 |
+ |
942 |
+ pg_start = (ctx->args[i].ptr & PAGE_MASK) >> PAGE_SHIFT; |
943 |
+ pg_end = ((ctx->args[i].ptr + len - 1) & PAGE_MASK) >> |
944 |
+diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h |
945 |
+index cb34925e10f15..67bb6a25fd0a0 100644 |
946 |
+--- a/drivers/misc/mei/hw-me-regs.h |
947 |
++++ b/drivers/misc/mei/hw-me-regs.h |
948 |
+@@ -92,6 +92,7 @@ |
949 |
+ #define MEI_DEV_ID_CDF 0x18D3 /* Cedar Fork */ |
950 |
+ |
951 |
+ #define MEI_DEV_ID_ICP_LP 0x34E0 /* Ice Lake Point LP */ |
952 |
++#define MEI_DEV_ID_ICP_N 0x38E0 /* Ice Lake Point N */ |
953 |
+ |
954 |
+ #define MEI_DEV_ID_JSP_N 0x4DE0 /* Jasper Lake Point N */ |
955 |
+ |
956 |
+diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c |
957 |
+index c3393b383e598..3a45aaf002ac8 100644 |
958 |
+--- a/drivers/misc/mei/pci-me.c |
959 |
++++ b/drivers/misc/mei/pci-me.c |
960 |
+@@ -96,6 +96,7 @@ static const struct pci_device_id mei_me_pci_tbl[] = { |
961 |
+ {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_H_3, MEI_ME_PCH8_ITOUCH_CFG)}, |
962 |
+ |
963 |
+ {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)}, |
964 |
++ {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_N, MEI_ME_PCH12_CFG)}, |
965 |
+ |
966 |
+ {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_LP, MEI_ME_PCH15_CFG)}, |
967 |
+ {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_H, MEI_ME_PCH15_SPS_CFG)}, |
968 |
+diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c |
969 |
+index 88fa0779e0bc9..e3c338624b95c 100644 |
970 |
+--- a/drivers/net/dsa/microchip/ksz_common.c |
971 |
++++ b/drivers/net/dsa/microchip/ksz_common.c |
972 |
+@@ -460,8 +460,10 @@ EXPORT_SYMBOL(ksz_switch_register); |
973 |
+ void ksz_switch_remove(struct ksz_device *dev) |
974 |
+ { |
975 |
+ /* timer started */ |
976 |
+- if (dev->mib_read_interval) |
977 |
++ if (dev->mib_read_interval) { |
978 |
++ dev->mib_read_interval = 0; |
979 |
+ cancel_delayed_work_sync(&dev->mib_read); |
980 |
++ } |
981 |
+ |
982 |
+ dev->dev_ops->exit(dev); |
983 |
+ dsa_unregister_switch(dev->ds); |
984 |
+diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c |
985 |
+index 18388ea5ebd96..afc5500ef8ed9 100644 |
986 |
+--- a/drivers/net/dsa/mv88e6xxx/chip.c |
987 |
++++ b/drivers/net/dsa/mv88e6xxx/chip.c |
988 |
+@@ -726,7 +726,11 @@ static void mv88e6xxx_mac_link_down(struct dsa_switch *ds, int port, |
989 |
+ ops = chip->info->ops; |
990 |
+ |
991 |
+ mv88e6xxx_reg_lock(chip); |
992 |
+- if ((!mv88e6xxx_port_ppu_updates(chip, port) || |
993 |
++ /* Internal PHYs propagate their configuration directly to the MAC. |
994 |
++ * External PHYs depend on whether the PPU is enabled for this port. |
995 |
++ */ |
996 |
++ if (((!mv88e6xxx_phy_is_internal(ds, port) && |
997 |
++ !mv88e6xxx_port_ppu_updates(chip, port)) || |
998 |
+ mode == MLO_AN_FIXED) && ops->port_set_link) |
999 |
+ err = ops->port_set_link(chip, port, LINK_FORCED_DOWN); |
1000 |
+ mv88e6xxx_reg_unlock(chip); |
1001 |
+@@ -749,7 +753,12 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port, |
1002 |
+ ops = chip->info->ops; |
1003 |
+ |
1004 |
+ mv88e6xxx_reg_lock(chip); |
1005 |
+- if (!mv88e6xxx_port_ppu_updates(chip, port) || mode == MLO_AN_FIXED) { |
1006 |
++ /* Internal PHYs propagate their configuration directly to the MAC. |
1007 |
++ * External PHYs depend on whether the PPU is enabled for this port. |
1008 |
++ */ |
1009 |
++ if ((!mv88e6xxx_phy_is_internal(ds, port) && |
1010 |
++ !mv88e6xxx_port_ppu_updates(chip, port)) || |
1011 |
++ mode == MLO_AN_FIXED) { |
1012 |
+ /* FIXME: for an automedia port, should we force the link |
1013 |
+ * down here - what if the link comes up due to "other" media |
1014 |
+ * while we're bringing the port up, how is the exclusivity |
1015 |
+diff --git a/drivers/net/ethernet/Kconfig b/drivers/net/ethernet/Kconfig |
1016 |
+index de50e8b9e6562..fad9a2c77fa7c 100644 |
1017 |
+--- a/drivers/net/ethernet/Kconfig |
1018 |
++++ b/drivers/net/ethernet/Kconfig |
1019 |
+@@ -99,6 +99,7 @@ config JME |
1020 |
+ config KORINA |
1021 |
+ tristate "Korina (IDT RC32434) Ethernet support" |
1022 |
+ depends on MIKROTIK_RB532 |
1023 |
++ select CRC32 |
1024 |
+ help |
1025 |
+ If you have a Mikrotik RouterBoard 500 or IDT RC32434 |
1026 |
+ based system say Y. Otherwise say N. |
1027 |
+diff --git a/drivers/net/ethernet/arc/Kconfig b/drivers/net/ethernet/arc/Kconfig |
1028 |
+index 37a41773dd435..92a79c4ffa2c7 100644 |
1029 |
+--- a/drivers/net/ethernet/arc/Kconfig |
1030 |
++++ b/drivers/net/ethernet/arc/Kconfig |
1031 |
+@@ -21,6 +21,7 @@ config ARC_EMAC_CORE |
1032 |
+ depends on ARC || ARCH_ROCKCHIP || COMPILE_TEST |
1033 |
+ select MII |
1034 |
+ select PHYLIB |
1035 |
++ select CRC32 |
1036 |
+ |
1037 |
+ config ARC_EMAC |
1038 |
+ tristate "ARC EMAC support" |
1039 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cq.c b/drivers/net/ethernet/mellanox/mlx5/core/cq.c |
1040 |
+index 360e093874d4f..c74600be570ed 100644 |
1041 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/cq.c |
1042 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/cq.c |
1043 |
+@@ -154,6 +154,8 @@ int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq) |
1044 |
+ u32 in[MLX5_ST_SZ_DW(destroy_cq_in)] = {}; |
1045 |
+ int err; |
1046 |
+ |
1047 |
++ mlx5_debug_cq_remove(dev, cq); |
1048 |
++ |
1049 |
+ mlx5_eq_del_cq(mlx5_get_async_eq(dev), cq); |
1050 |
+ mlx5_eq_del_cq(&cq->eq->core, cq); |
1051 |
+ |
1052 |
+@@ -161,16 +163,13 @@ int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq) |
1053 |
+ MLX5_SET(destroy_cq_in, in, cqn, cq->cqn); |
1054 |
+ MLX5_SET(destroy_cq_in, in, uid, cq->uid); |
1055 |
+ err = mlx5_cmd_exec_in(dev, destroy_cq, in); |
1056 |
+- if (err) |
1057 |
+- return err; |
1058 |
+ |
1059 |
+ synchronize_irq(cq->irqn); |
1060 |
+ |
1061 |
+- mlx5_debug_cq_remove(dev, cq); |
1062 |
+ mlx5_cq_put(cq); |
1063 |
+ wait_for_completion(&cq->free); |
1064 |
+ |
1065 |
+- return 0; |
1066 |
++ return err; |
1067 |
+ } |
1068 |
+ EXPORT_SYMBOL(mlx5_core_destroy_cq); |
1069 |
+ |
1070 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c |
1071 |
+index 6974090a7efac..6ec4b96497ffb 100644 |
1072 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c |
1073 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c |
1074 |
+@@ -3819,20 +3819,67 @@ static int set_feature_rx_all(struct net_device *netdev, bool enable) |
1075 |
+ return mlx5_set_port_fcs(mdev, !enable); |
1076 |
+ } |
1077 |
+ |
1078 |
++static int mlx5e_set_rx_port_ts(struct mlx5_core_dev *mdev, bool enable) |
1079 |
++{ |
1080 |
++ u32 in[MLX5_ST_SZ_DW(pcmr_reg)] = {}; |
1081 |
++ bool supported, curr_state; |
1082 |
++ int err; |
1083 |
++ |
1084 |
++ if (!MLX5_CAP_GEN(mdev, ports_check)) |
1085 |
++ return 0; |
1086 |
++ |
1087 |
++ err = mlx5_query_ports_check(mdev, in, sizeof(in)); |
1088 |
++ if (err) |
1089 |
++ return err; |
1090 |
++ |
1091 |
++ supported = MLX5_GET(pcmr_reg, in, rx_ts_over_crc_cap); |
1092 |
++ curr_state = MLX5_GET(pcmr_reg, in, rx_ts_over_crc); |
1093 |
++ |
1094 |
++ if (!supported || enable == curr_state) |
1095 |
++ return 0; |
1096 |
++ |
1097 |
++ MLX5_SET(pcmr_reg, in, local_port, 1); |
1098 |
++ MLX5_SET(pcmr_reg, in, rx_ts_over_crc, enable); |
1099 |
++ |
1100 |
++ return mlx5_set_ports_check(mdev, in, sizeof(in)); |
1101 |
++} |
1102 |
++ |
1103 |
+ static int set_feature_rx_fcs(struct net_device *netdev, bool enable) |
1104 |
+ { |
1105 |
+ struct mlx5e_priv *priv = netdev_priv(netdev); |
1106 |
++ struct mlx5e_channels *chs = &priv->channels; |
1107 |
++ struct mlx5_core_dev *mdev = priv->mdev; |
1108 |
+ int err; |
1109 |
+ |
1110 |
+ mutex_lock(&priv->state_lock); |
1111 |
+ |
1112 |
+- priv->channels.params.scatter_fcs_en = enable; |
1113 |
+- err = mlx5e_modify_channels_scatter_fcs(&priv->channels, enable); |
1114 |
+- if (err) |
1115 |
+- priv->channels.params.scatter_fcs_en = !enable; |
1116 |
++ if (enable) { |
1117 |
++ err = mlx5e_set_rx_port_ts(mdev, false); |
1118 |
++ if (err) |
1119 |
++ goto out; |
1120 |
+ |
1121 |
+- mutex_unlock(&priv->state_lock); |
1122 |
++ chs->params.scatter_fcs_en = true; |
1123 |
++ err = mlx5e_modify_channels_scatter_fcs(chs, true); |
1124 |
++ if (err) { |
1125 |
++ chs->params.scatter_fcs_en = false; |
1126 |
++ mlx5e_set_rx_port_ts(mdev, true); |
1127 |
++ } |
1128 |
++ } else { |
1129 |
++ chs->params.scatter_fcs_en = false; |
1130 |
++ err = mlx5e_modify_channels_scatter_fcs(chs, false); |
1131 |
++ if (err) { |
1132 |
++ chs->params.scatter_fcs_en = true; |
1133 |
++ goto out; |
1134 |
++ } |
1135 |
++ err = mlx5e_set_rx_port_ts(mdev, true); |
1136 |
++ if (err) { |
1137 |
++ mlx5_core_warn(mdev, "Failed to set RX port timestamp %d\n", err); |
1138 |
++ err = 0; |
1139 |
++ } |
1140 |
++ } |
1141 |
+ |
1142 |
++out: |
1143 |
++ mutex_unlock(&priv->state_lock); |
1144 |
+ return err; |
1145 |
+ } |
1146 |
+ |
1147 |
+diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c |
1148 |
+index 42e4437ac3c16..7ec1d0ee9beeb 100644 |
1149 |
+--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c |
1150 |
++++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c |
1151 |
+@@ -25,16 +25,8 @@ |
1152 |
+ #define MLXSW_THERMAL_ZONE_MAX_NAME 16 |
1153 |
+ #define MLXSW_THERMAL_TEMP_SCORE_MAX GENMASK(31, 0) |
1154 |
+ #define MLXSW_THERMAL_MAX_STATE 10 |
1155 |
++#define MLXSW_THERMAL_MIN_STATE 2 |
1156 |
+ #define MLXSW_THERMAL_MAX_DUTY 255 |
1157 |
+-/* Minimum and maximum fan allowed speed in percent: from 20% to 100%. Values |
1158 |
+- * MLXSW_THERMAL_MAX_STATE + x, where x is between 2 and 10 are used for |
1159 |
+- * setting fan speed dynamic minimum. For example, if value is set to 14 (40%) |
1160 |
+- * cooling levels vector will be set to 4, 4, 4, 4, 4, 5, 6, 7, 8, 9, 10 to |
1161 |
+- * introduce PWM speed in percent: 40, 40, 40, 40, 40, 50, 60. 70, 80, 90, 100. |
1162 |
+- */ |
1163 |
+-#define MLXSW_THERMAL_SPEED_MIN (MLXSW_THERMAL_MAX_STATE + 2) |
1164 |
+-#define MLXSW_THERMAL_SPEED_MAX (MLXSW_THERMAL_MAX_STATE * 2) |
1165 |
+-#define MLXSW_THERMAL_SPEED_MIN_LEVEL 2 /* 20% */ |
1166 |
+ |
1167 |
+ /* External cooling devices, allowed for binding to mlxsw thermal zones. */ |
1168 |
+ static char * const mlxsw_thermal_external_allowed_cdev[] = { |
1169 |
+@@ -635,49 +627,16 @@ static int mlxsw_thermal_set_cur_state(struct thermal_cooling_device *cdev, |
1170 |
+ struct mlxsw_thermal *thermal = cdev->devdata; |
1171 |
+ struct device *dev = thermal->bus_info->dev; |
1172 |
+ char mfsc_pl[MLXSW_REG_MFSC_LEN]; |
1173 |
+- unsigned long cur_state, i; |
1174 |
+ int idx; |
1175 |
+- u8 duty; |
1176 |
+ int err; |
1177 |
+ |
1178 |
++ if (state > MLXSW_THERMAL_MAX_STATE) |
1179 |
++ return -EINVAL; |
1180 |
++ |
1181 |
+ idx = mlxsw_get_cooling_device_idx(thermal, cdev); |
1182 |
+ if (idx < 0) |
1183 |
+ return idx; |
1184 |
+ |
1185 |
+- /* Verify if this request is for changing allowed fan dynamical |
1186 |
+- * minimum. If it is - update cooling levels accordingly and update |
1187 |
+- * state, if current state is below the newly requested minimum state. |
1188 |
+- * For example, if current state is 5, and minimal state is to be |
1189 |
+- * changed from 4 to 6, thermal->cooling_levels[0 to 5] will be changed |
1190 |
+- * all from 4 to 6. And state 5 (thermal->cooling_levels[4]) should be |
1191 |
+- * overwritten. |
1192 |
+- */ |
1193 |
+- if (state >= MLXSW_THERMAL_SPEED_MIN && |
1194 |
+- state <= MLXSW_THERMAL_SPEED_MAX) { |
1195 |
+- state -= MLXSW_THERMAL_MAX_STATE; |
1196 |
+- for (i = 0; i <= MLXSW_THERMAL_MAX_STATE; i++) |
1197 |
+- thermal->cooling_levels[i] = max(state, i); |
1198 |
+- |
1199 |
+- mlxsw_reg_mfsc_pack(mfsc_pl, idx, 0); |
1200 |
+- err = mlxsw_reg_query(thermal->core, MLXSW_REG(mfsc), mfsc_pl); |
1201 |
+- if (err) |
1202 |
+- return err; |
1203 |
+- |
1204 |
+- duty = mlxsw_reg_mfsc_pwm_duty_cycle_get(mfsc_pl); |
1205 |
+- cur_state = mlxsw_duty_to_state(duty); |
1206 |
+- |
1207 |
+- /* If current fan state is lower than requested dynamical |
1208 |
+- * minimum, increase fan speed up to dynamical minimum. |
1209 |
+- */ |
1210 |
+- if (state < cur_state) |
1211 |
+- return 0; |
1212 |
+- |
1213 |
+- state = cur_state; |
1214 |
+- } |
1215 |
+- |
1216 |
+- if (state > MLXSW_THERMAL_MAX_STATE) |
1217 |
+- return -EINVAL; |
1218 |
+- |
1219 |
+ /* Normalize the state to the valid speed range. */ |
1220 |
+ state = thermal->cooling_levels[state]; |
1221 |
+ mlxsw_reg_mfsc_pack(mfsc_pl, idx, mlxsw_state_to_duty(state)); |
1222 |
+@@ -980,8 +939,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core, |
1223 |
+ |
1224 |
+ /* Initialize cooling levels per PWM state. */ |
1225 |
+ for (i = 0; i < MLXSW_THERMAL_MAX_STATE; i++) |
1226 |
+- thermal->cooling_levels[i] = max(MLXSW_THERMAL_SPEED_MIN_LEVEL, |
1227 |
+- i); |
1228 |
++ thermal->cooling_levels[i] = max(MLXSW_THERMAL_MIN_STATE, i); |
1229 |
+ |
1230 |
+ thermal->polling_delay = bus_info->low_frequency ? |
1231 |
+ MLXSW_THERMAL_SLOW_POLL_INT : |
1232 |
+diff --git a/drivers/net/ethernet/microchip/encx24j600-regmap.c b/drivers/net/ethernet/microchip/encx24j600-regmap.c |
1233 |
+index 796e46a539269..81a8ccca7e5e0 100644 |
1234 |
+--- a/drivers/net/ethernet/microchip/encx24j600-regmap.c |
1235 |
++++ b/drivers/net/ethernet/microchip/encx24j600-regmap.c |
1236 |
+@@ -497,13 +497,19 @@ static struct regmap_bus phymap_encx24j600 = { |
1237 |
+ .reg_read = regmap_encx24j600_phy_reg_read, |
1238 |
+ }; |
1239 |
+ |
1240 |
+-void devm_regmap_init_encx24j600(struct device *dev, |
1241 |
+- struct encx24j600_context *ctx) |
1242 |
++int devm_regmap_init_encx24j600(struct device *dev, |
1243 |
++ struct encx24j600_context *ctx) |
1244 |
+ { |
1245 |
+ mutex_init(&ctx->mutex); |
1246 |
+ regcfg.lock_arg = ctx; |
1247 |
+ ctx->regmap = devm_regmap_init(dev, ®map_encx24j600, ctx, ®cfg); |
1248 |
++ if (IS_ERR(ctx->regmap)) |
1249 |
++ return PTR_ERR(ctx->regmap); |
1250 |
+ ctx->phymap = devm_regmap_init(dev, &phymap_encx24j600, ctx, &phycfg); |
1251 |
++ if (IS_ERR(ctx->phymap)) |
1252 |
++ return PTR_ERR(ctx->phymap); |
1253 |
++ |
1254 |
++ return 0; |
1255 |
+ } |
1256 |
+ EXPORT_SYMBOL_GPL(devm_regmap_init_encx24j600); |
1257 |
+ |
1258 |
+diff --git a/drivers/net/ethernet/microchip/encx24j600.c b/drivers/net/ethernet/microchip/encx24j600.c |
1259 |
+index 2c0dcd7acf3fd..c95e29ae6f20c 100644 |
1260 |
+--- a/drivers/net/ethernet/microchip/encx24j600.c |
1261 |
++++ b/drivers/net/ethernet/microchip/encx24j600.c |
1262 |
+@@ -1024,10 +1024,13 @@ static int encx24j600_spi_probe(struct spi_device *spi) |
1263 |
+ priv->speed = SPEED_100; |
1264 |
+ |
1265 |
+ priv->ctx.spi = spi; |
1266 |
+- devm_regmap_init_encx24j600(&spi->dev, &priv->ctx); |
1267 |
+ ndev->irq = spi->irq; |
1268 |
+ ndev->netdev_ops = &encx24j600_netdev_ops; |
1269 |
+ |
1270 |
++ ret = devm_regmap_init_encx24j600(&spi->dev, &priv->ctx); |
1271 |
++ if (ret) |
1272 |
++ goto out_free; |
1273 |
++ |
1274 |
+ mutex_init(&priv->lock); |
1275 |
+ |
1276 |
+ /* Reset device and check if it is connected */ |
1277 |
+diff --git a/drivers/net/ethernet/microchip/encx24j600_hw.h b/drivers/net/ethernet/microchip/encx24j600_hw.h |
1278 |
+index f604a260ede79..711147a159aa9 100644 |
1279 |
+--- a/drivers/net/ethernet/microchip/encx24j600_hw.h |
1280 |
++++ b/drivers/net/ethernet/microchip/encx24j600_hw.h |
1281 |
+@@ -15,8 +15,8 @@ struct encx24j600_context { |
1282 |
+ int bank; |
1283 |
+ }; |
1284 |
+ |
1285 |
+-void devm_regmap_init_encx24j600(struct device *dev, |
1286 |
+- struct encx24j600_context *ctx); |
1287 |
++int devm_regmap_init_encx24j600(struct device *dev, |
1288 |
++ struct encx24j600_context *ctx); |
1289 |
+ |
1290 |
+ /* Single-byte instructions */ |
1291 |
+ #define BANK_SELECT(bank) (0xC0 | ((bank & (BANK_MASK >> BANK_SHIFT)) << 1)) |
1292 |
+diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c |
1293 |
+index 5bfc7acfd13a9..8c45b236649a9 100644 |
1294 |
+--- a/drivers/net/ethernet/mscc/ocelot.c |
1295 |
++++ b/drivers/net/ethernet/mscc/ocelot.c |
1296 |
+@@ -594,12 +594,12 @@ void ocelot_get_txtstamp(struct ocelot *ocelot) |
1297 |
+ |
1298 |
+ spin_unlock_irqrestore(&port->tx_skbs.lock, flags); |
1299 |
+ |
1300 |
++ if (WARN_ON(!skb_match)) |
1301 |
++ continue; |
1302 |
++ |
1303 |
+ /* Get the h/w timestamp */ |
1304 |
+ ocelot_get_hwtimestamp(ocelot, &ts); |
1305 |
+ |
1306 |
+- if (unlikely(!skb_match)) |
1307 |
+- continue; |
1308 |
+- |
1309 |
+ /* Set the timestamp into the skb */ |
1310 |
+ memset(&shhwtstamps, 0, sizeof(shhwtstamps)); |
1311 |
+ shhwtstamps.hwtstamp = ktime_set(ts.tv_sec, ts.tv_nsec); |
1312 |
+diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c |
1313 |
+index d13d92bf74478..3cae8449fadb7 100644 |
1314 |
+--- a/drivers/net/ethernet/neterion/s2io.c |
1315 |
++++ b/drivers/net/ethernet/neterion/s2io.c |
1316 |
+@@ -8555,7 +8555,7 @@ static void s2io_io_resume(struct pci_dev *pdev) |
1317 |
+ return; |
1318 |
+ } |
1319 |
+ |
1320 |
+- if (s2io_set_mac_addr(netdev, netdev->dev_addr) == FAILURE) { |
1321 |
++ if (do_s2io_prog_unicast(netdev, netdev->dev_addr) == FAILURE) { |
1322 |
+ s2io_card_down(sp); |
1323 |
+ pr_err("Can't restore mac addr after reset.\n"); |
1324 |
+ return; |
1325 |
+diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c b/drivers/net/ethernet/netronome/nfp/flower/main.c |
1326 |
+index c029950a81e20..ac1dcfa1d1790 100644 |
1327 |
+--- a/drivers/net/ethernet/netronome/nfp/flower/main.c |
1328 |
++++ b/drivers/net/ethernet/netronome/nfp/flower/main.c |
1329 |
+@@ -830,10 +830,6 @@ static int nfp_flower_init(struct nfp_app *app) |
1330 |
+ if (err) |
1331 |
+ goto err_cleanup; |
1332 |
+ |
1333 |
+- err = flow_indr_dev_register(nfp_flower_indr_setup_tc_cb, app); |
1334 |
+- if (err) |
1335 |
+- goto err_cleanup; |
1336 |
+- |
1337 |
+ if (app_priv->flower_ext_feats & NFP_FL_FEATS_VF_RLIM) |
1338 |
+ nfp_flower_qos_init(app); |
1339 |
+ |
1340 |
+@@ -942,7 +938,20 @@ static int nfp_flower_start(struct nfp_app *app) |
1341 |
+ return err; |
1342 |
+ } |
1343 |
+ |
1344 |
+- return nfp_tunnel_config_start(app); |
1345 |
++ err = flow_indr_dev_register(nfp_flower_indr_setup_tc_cb, app); |
1346 |
++ if (err) |
1347 |
++ return err; |
1348 |
++ |
1349 |
++ err = nfp_tunnel_config_start(app); |
1350 |
++ if (err) |
1351 |
++ goto err_tunnel_config; |
1352 |
++ |
1353 |
++ return 0; |
1354 |
++ |
1355 |
++err_tunnel_config: |
1356 |
++ flow_indr_dev_unregister(nfp_flower_indr_setup_tc_cb, app, |
1357 |
++ nfp_flower_setup_indr_tc_release); |
1358 |
++ return err; |
1359 |
+ } |
1360 |
+ |
1361 |
+ static void nfp_flower_stop(struct nfp_app *app) |
1362 |
+diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c |
1363 |
+index 6dc7ce6494488..1b44155fa24b2 100644 |
1364 |
+--- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c |
1365 |
++++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c |
1366 |
+@@ -1096,6 +1096,10 @@ static int ionic_ndo_addr_add(struct net_device *netdev, const u8 *addr) |
1367 |
+ |
1368 |
+ static int ionic_addr_del(struct net_device *netdev, const u8 *addr) |
1369 |
+ { |
1370 |
++ /* Don't delete our own address from the uc list */ |
1371 |
++ if (ether_addr_equal(addr, netdev->dev_addr)) |
1372 |
++ return 0; |
1373 |
++ |
1374 |
+ return ionic_lif_addr(netdev_priv(netdev), addr, false, true); |
1375 |
+ } |
1376 |
+ |
1377 |
+diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c |
1378 |
+index 6bb9ec98a12b5..41bc31e3f9356 100644 |
1379 |
+--- a/drivers/net/ethernet/qlogic/qed/qed_main.c |
1380 |
++++ b/drivers/net/ethernet/qlogic/qed/qed_main.c |
1381 |
+@@ -1295,6 +1295,7 @@ static int qed_slowpath_start(struct qed_dev *cdev, |
1382 |
+ } else { |
1383 |
+ DP_NOTICE(cdev, |
1384 |
+ "Failed to acquire PTT for aRFS\n"); |
1385 |
++ rc = -EINVAL; |
1386 |
+ goto err; |
1387 |
+ } |
1388 |
+ } |
1389 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c |
1390 |
+index 2bac49b49f739..fbf2deafe8ba3 100644 |
1391 |
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c |
1392 |
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c |
1393 |
+@@ -218,11 +218,18 @@ static void dwmac1000_dump_dma_regs(void __iomem *ioaddr, u32 *reg_space) |
1394 |
+ readl(ioaddr + DMA_BUS_MODE + i * 4); |
1395 |
+ } |
1396 |
+ |
1397 |
+-static void dwmac1000_get_hw_feature(void __iomem *ioaddr, |
1398 |
+- struct dma_features *dma_cap) |
1399 |
++static int dwmac1000_get_hw_feature(void __iomem *ioaddr, |
1400 |
++ struct dma_features *dma_cap) |
1401 |
+ { |
1402 |
+ u32 hw_cap = readl(ioaddr + DMA_HW_FEATURE); |
1403 |
+ |
1404 |
++ if (!hw_cap) { |
1405 |
++ /* 0x00000000 is the value read on old hardware that does not |
1406 |
++ * implement this register |
1407 |
++ */ |
1408 |
++ return -EOPNOTSUPP; |
1409 |
++ } |
1410 |
++ |
1411 |
+ dma_cap->mbps_10_100 = (hw_cap & DMA_HW_FEAT_MIISEL); |
1412 |
+ dma_cap->mbps_1000 = (hw_cap & DMA_HW_FEAT_GMIISEL) >> 1; |
1413 |
+ dma_cap->half_duplex = (hw_cap & DMA_HW_FEAT_HDSEL) >> 2; |
1414 |
+@@ -252,6 +259,8 @@ static void dwmac1000_get_hw_feature(void __iomem *ioaddr, |
1415 |
+ dma_cap->number_tx_channel = (hw_cap & DMA_HW_FEAT_TXCHCNT) >> 22; |
1416 |
+ /* Alternate (enhanced) DESC mode */ |
1417 |
+ dma_cap->enh_desc = (hw_cap & DMA_HW_FEAT_ENHDESSEL) >> 24; |
1418 |
++ |
1419 |
++ return 0; |
1420 |
+ } |
1421 |
+ |
1422 |
+ static void dwmac1000_rx_watchdog(void __iomem *ioaddr, u32 riwt, |
1423 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c |
1424 |
+index a7249e4071f16..935510cdc3ffd 100644 |
1425 |
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c |
1426 |
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c |
1427 |
+@@ -337,8 +337,8 @@ static void dwmac4_dma_tx_chan_op_mode(void __iomem *ioaddr, int mode, |
1428 |
+ writel(mtl_tx_op, ioaddr + MTL_CHAN_TX_OP_MODE(channel)); |
1429 |
+ } |
1430 |
+ |
1431 |
+-static void dwmac4_get_hw_feature(void __iomem *ioaddr, |
1432 |
+- struct dma_features *dma_cap) |
1433 |
++static int dwmac4_get_hw_feature(void __iomem *ioaddr, |
1434 |
++ struct dma_features *dma_cap) |
1435 |
+ { |
1436 |
+ u32 hw_cap = readl(ioaddr + GMAC_HW_FEATURE0); |
1437 |
+ |
1438 |
+@@ -425,6 +425,8 @@ static void dwmac4_get_hw_feature(void __iomem *ioaddr, |
1439 |
+ dma_cap->frpbs = (hw_cap & GMAC_HW_FEAT_FRPBS) >> 11; |
1440 |
+ dma_cap->frpsel = (hw_cap & GMAC_HW_FEAT_FRPSEL) >> 10; |
1441 |
+ dma_cap->dvlan = (hw_cap & GMAC_HW_FEAT_DVLAN) >> 5; |
1442 |
++ |
1443 |
++ return 0; |
1444 |
+ } |
1445 |
+ |
1446 |
+ /* Enable/disable TSO feature and set MSS */ |
1447 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c |
1448 |
+index 77308c5c5d294..a5583d706b9f2 100644 |
1449 |
+--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c |
1450 |
++++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c |
1451 |
+@@ -365,8 +365,8 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr, |
1452 |
+ return ret; |
1453 |
+ } |
1454 |
+ |
1455 |
+-static void dwxgmac2_get_hw_feature(void __iomem *ioaddr, |
1456 |
+- struct dma_features *dma_cap) |
1457 |
++static int dwxgmac2_get_hw_feature(void __iomem *ioaddr, |
1458 |
++ struct dma_features *dma_cap) |
1459 |
+ { |
1460 |
+ u32 hw_cap; |
1461 |
+ |
1462 |
+@@ -439,6 +439,8 @@ static void dwxgmac2_get_hw_feature(void __iomem *ioaddr, |
1463 |
+ dma_cap->frpes = (hw_cap & XGMAC_HWFEAT_FRPES) >> 11; |
1464 |
+ dma_cap->frpbs = (hw_cap & XGMAC_HWFEAT_FRPPB) >> 9; |
1465 |
+ dma_cap->frpsel = (hw_cap & XGMAC_HWFEAT_FRPSEL) >> 3; |
1466 |
++ |
1467 |
++ return 0; |
1468 |
+ } |
1469 |
+ |
1470 |
+ static void dwxgmac2_rx_watchdog(void __iomem *ioaddr, u32 riwt, u32 nchan) |
1471 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h |
1472 |
+index b0b84244ef107..8b7ec2457eba2 100644 |
1473 |
+--- a/drivers/net/ethernet/stmicro/stmmac/hwif.h |
1474 |
++++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h |
1475 |
+@@ -203,8 +203,8 @@ struct stmmac_dma_ops { |
1476 |
+ int (*dma_interrupt) (void __iomem *ioaddr, |
1477 |
+ struct stmmac_extra_stats *x, u32 chan); |
1478 |
+ /* If supported then get the optional core features */ |
1479 |
+- void (*get_hw_feature)(void __iomem *ioaddr, |
1480 |
+- struct dma_features *dma_cap); |
1481 |
++ int (*get_hw_feature)(void __iomem *ioaddr, |
1482 |
++ struct dma_features *dma_cap); |
1483 |
+ /* Program the HW RX Watchdog */ |
1484 |
+ void (*rx_watchdog)(void __iomem *ioaddr, u32 riwt, u32 number_chan); |
1485 |
+ void (*set_tx_ring_len)(void __iomem *ioaddr, u32 len, u32 chan); |
1486 |
+@@ -255,7 +255,7 @@ struct stmmac_dma_ops { |
1487 |
+ #define stmmac_dma_interrupt_status(__priv, __args...) \ |
1488 |
+ stmmac_do_callback(__priv, dma, dma_interrupt, __args) |
1489 |
+ #define stmmac_get_hw_feature(__priv, __args...) \ |
1490 |
+- stmmac_do_void_callback(__priv, dma, get_hw_feature, __args) |
1491 |
++ stmmac_do_callback(__priv, dma, get_hw_feature, __args) |
1492 |
+ #define stmmac_rx_watchdog(__priv, __args...) \ |
1493 |
+ stmmac_do_void_callback(__priv, dma, rx_watchdog, __args) |
1494 |
+ #define stmmac_set_tx_ring_len(__priv, __args...) \ |
1495 |
+diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig |
1496 |
+index b46993d5f9978..4efad42b9aa97 100644 |
1497 |
+--- a/drivers/net/usb/Kconfig |
1498 |
++++ b/drivers/net/usb/Kconfig |
1499 |
+@@ -99,6 +99,10 @@ config USB_RTL8150 |
1500 |
+ config USB_RTL8152 |
1501 |
+ tristate "Realtek RTL8152/RTL8153 Based USB Ethernet Adapters" |
1502 |
+ select MII |
1503 |
++ select CRC32 |
1504 |
++ select CRYPTO |
1505 |
++ select CRYPTO_HASH |
1506 |
++ select CRYPTO_SHA256 |
1507 |
+ help |
1508 |
+ This option adds support for Realtek RTL8152 based USB 2.0 |
1509 |
+ 10/100 Ethernet adapters and RTL8153 based USB 3.0 10/100/1000 |
1510 |
+diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c |
1511 |
+index d79abb88a0c62..1b85349f57af0 100644 |
1512 |
+--- a/drivers/nvme/host/pci.c |
1513 |
++++ b/drivers/nvme/host/pci.c |
1514 |
+@@ -1342,7 +1342,7 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved) |
1515 |
+ |
1516 |
+ memset(&cmd, 0, sizeof(cmd)); |
1517 |
+ cmd.abort.opcode = nvme_admin_abort_cmd; |
1518 |
+- cmd.abort.cid = req->tag; |
1519 |
++ cmd.abort.cid = nvme_cid(req); |
1520 |
+ cmd.abort.sqid = cpu_to_le16(nvmeq->qid); |
1521 |
+ |
1522 |
+ dev_warn(nvmeq->dev->ctrl.device, |
1523 |
+diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c |
1524 |
+index bb8fb2b3711d4..6b170083cd248 100644 |
1525 |
+--- a/drivers/nvmem/core.c |
1526 |
++++ b/drivers/nvmem/core.c |
1527 |
+@@ -1229,7 +1229,8 @@ static void nvmem_shift_read_buffer_in_place(struct nvmem_cell *cell, void *buf) |
1528 |
+ *p-- = 0; |
1529 |
+ |
1530 |
+ /* clear msb bits if any leftover in the last byte */ |
1531 |
+- *p &= GENMASK((cell->nbits%BITS_PER_BYTE) - 1, 0); |
1532 |
++ if (cell->nbits % BITS_PER_BYTE) |
1533 |
++ *p &= GENMASK((cell->nbits % BITS_PER_BYTE) - 1, 0); |
1534 |
+ } |
1535 |
+ |
1536 |
+ static int __nvmem_cell_read(struct nvmem_device *nvmem, |
1537 |
+diff --git a/drivers/platform/mellanox/mlxreg-io.c b/drivers/platform/mellanox/mlxreg-io.c |
1538 |
+index 7646708d57e42..a916cd89cbbed 100644 |
1539 |
+--- a/drivers/platform/mellanox/mlxreg-io.c |
1540 |
++++ b/drivers/platform/mellanox/mlxreg-io.c |
1541 |
+@@ -98,7 +98,7 @@ mlxreg_io_get_reg(void *regmap, struct mlxreg_core_data *data, u32 in_val, |
1542 |
+ if (ret) |
1543 |
+ goto access_error; |
1544 |
+ |
1545 |
+- *regval |= rol32(val, regsize * i); |
1546 |
++ *regval |= rol32(val, regsize * i * 8); |
1547 |
+ } |
1548 |
+ } |
1549 |
+ |
1550 |
+@@ -141,7 +141,7 @@ mlxreg_io_attr_store(struct device *dev, struct device_attribute *attr, |
1551 |
+ return -EINVAL; |
1552 |
+ |
1553 |
+ /* Convert buffer to input value. */ |
1554 |
+- ret = kstrtou32(buf, len, &input_val); |
1555 |
++ ret = kstrtou32(buf, 0, &input_val); |
1556 |
+ if (ret) |
1557 |
+ return ret; |
1558 |
+ |
1559 |
+diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c |
1560 |
+index d9cf7f7602b0b..425d2064148f9 100644 |
1561 |
+--- a/drivers/platform/x86/intel_scu_ipc.c |
1562 |
++++ b/drivers/platform/x86/intel_scu_ipc.c |
1563 |
+@@ -232,7 +232,7 @@ static inline u32 ipc_data_readl(struct intel_scu_ipc_dev *scu, u32 offset) |
1564 |
+ /* Wait till scu status is busy */ |
1565 |
+ static inline int busy_loop(struct intel_scu_ipc_dev *scu) |
1566 |
+ { |
1567 |
+- unsigned long end = jiffies + msecs_to_jiffies(IPC_TIMEOUT); |
1568 |
++ unsigned long end = jiffies + IPC_TIMEOUT; |
1569 |
+ |
1570 |
+ do { |
1571 |
+ u32 status; |
1572 |
+diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c |
1573 |
+index c028446c74604..b4d5930be2a95 100644 |
1574 |
+--- a/drivers/spi/spi-bcm-qspi.c |
1575 |
++++ b/drivers/spi/spi-bcm-qspi.c |
1576 |
+@@ -1250,10 +1250,14 @@ static void bcm_qspi_hw_init(struct bcm_qspi *qspi) |
1577 |
+ |
1578 |
+ static void bcm_qspi_hw_uninit(struct bcm_qspi *qspi) |
1579 |
+ { |
1580 |
++ u32 status = bcm_qspi_read(qspi, MSPI, MSPI_MSPI_STATUS); |
1581 |
++ |
1582 |
+ bcm_qspi_write(qspi, MSPI, MSPI_SPCR2, 0); |
1583 |
+ if (has_bspi(qspi)) |
1584 |
+ bcm_qspi_write(qspi, MSPI, MSPI_WRITE_LOCK, 0); |
1585 |
+ |
1586 |
++ /* clear interrupt */ |
1587 |
++ bcm_qspi_write(qspi, MSPI, MSPI_MSPI_STATUS, status & ~1); |
1588 |
+ } |
1589 |
+ |
1590 |
+ static const struct spi_controller_mem_ops bcm_qspi_mem_ops = { |
1591 |
+@@ -1397,6 +1401,47 @@ int bcm_qspi_probe(struct platform_device *pdev, |
1592 |
+ if (!qspi->dev_ids) |
1593 |
+ return -ENOMEM; |
1594 |
+ |
1595 |
++ /* |
1596 |
++ * Some SoCs integrate spi controller (e.g., its interrupt bits) |
1597 |
++ * in specific ways |
1598 |
++ */ |
1599 |
++ if (soc_intc) { |
1600 |
++ qspi->soc_intc = soc_intc; |
1601 |
++ soc_intc->bcm_qspi_int_set(soc_intc, MSPI_DONE, true); |
1602 |
++ } else { |
1603 |
++ qspi->soc_intc = NULL; |
1604 |
++ } |
1605 |
++ |
1606 |
++ if (qspi->clk) { |
1607 |
++ ret = clk_prepare_enable(qspi->clk); |
1608 |
++ if (ret) { |
1609 |
++ dev_err(dev, "failed to prepare clock\n"); |
1610 |
++ goto qspi_probe_err; |
1611 |
++ } |
1612 |
++ qspi->base_clk = clk_get_rate(qspi->clk); |
1613 |
++ } else { |
1614 |
++ qspi->base_clk = MSPI_BASE_FREQ; |
1615 |
++ } |
1616 |
++ |
1617 |
++ if (data->has_mspi_rev) { |
1618 |
++ rev = bcm_qspi_read(qspi, MSPI, MSPI_REV); |
1619 |
++ /* some older revs do not have a MSPI_REV register */ |
1620 |
++ if ((rev & 0xff) == 0xff) |
1621 |
++ rev = 0; |
1622 |
++ } |
1623 |
++ |
1624 |
++ qspi->mspi_maj_rev = (rev >> 4) & 0xf; |
1625 |
++ qspi->mspi_min_rev = rev & 0xf; |
1626 |
++ qspi->mspi_spcr3_sysclk = data->has_spcr3_sysclk; |
1627 |
++ |
1628 |
++ qspi->max_speed_hz = qspi->base_clk / (bcm_qspi_spbr_min(qspi) * 2); |
1629 |
++ |
1630 |
++ /* |
1631 |
++ * On SW resets it is possible to have the mask still enabled |
1632 |
++ * Need to disable the mask and clear the status while we init |
1633 |
++ */ |
1634 |
++ bcm_qspi_hw_uninit(qspi); |
1635 |
++ |
1636 |
+ for (val = 0; val < num_irqs; val++) { |
1637 |
+ irq = -1; |
1638 |
+ name = qspi_irq_tab[val].irq_name; |
1639 |
+@@ -1433,38 +1478,6 @@ int bcm_qspi_probe(struct platform_device *pdev, |
1640 |
+ goto qspi_probe_err; |
1641 |
+ } |
1642 |
+ |
1643 |
+- /* |
1644 |
+- * Some SoCs integrate spi controller (e.g., its interrupt bits) |
1645 |
+- * in specific ways |
1646 |
+- */ |
1647 |
+- if (soc_intc) { |
1648 |
+- qspi->soc_intc = soc_intc; |
1649 |
+- soc_intc->bcm_qspi_int_set(soc_intc, MSPI_DONE, true); |
1650 |
+- } else { |
1651 |
+- qspi->soc_intc = NULL; |
1652 |
+- } |
1653 |
+- |
1654 |
+- ret = clk_prepare_enable(qspi->clk); |
1655 |
+- if (ret) { |
1656 |
+- dev_err(dev, "failed to prepare clock\n"); |
1657 |
+- goto qspi_probe_err; |
1658 |
+- } |
1659 |
+- |
1660 |
+- qspi->base_clk = clk_get_rate(qspi->clk); |
1661 |
+- |
1662 |
+- if (data->has_mspi_rev) { |
1663 |
+- rev = bcm_qspi_read(qspi, MSPI, MSPI_REV); |
1664 |
+- /* some older revs do not have a MSPI_REV register */ |
1665 |
+- if ((rev & 0xff) == 0xff) |
1666 |
+- rev = 0; |
1667 |
+- } |
1668 |
+- |
1669 |
+- qspi->mspi_maj_rev = (rev >> 4) & 0xf; |
1670 |
+- qspi->mspi_min_rev = rev & 0xf; |
1671 |
+- qspi->mspi_spcr3_sysclk = data->has_spcr3_sysclk; |
1672 |
+- |
1673 |
+- qspi->max_speed_hz = qspi->base_clk / (bcm_qspi_spbr_min(qspi) * 2); |
1674 |
+- |
1675 |
+ bcm_qspi_hw_init(qspi); |
1676 |
+ init_completion(&qspi->mspi_done); |
1677 |
+ init_completion(&qspi->bspi_done); |
1678 |
+diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c |
1679 |
+index 823a81d8ff0ed..f255a96ae5a48 100644 |
1680 |
+--- a/drivers/tee/optee/core.c |
1681 |
++++ b/drivers/tee/optee/core.c |
1682 |
+@@ -585,6 +585,9 @@ static int optee_remove(struct platform_device *pdev) |
1683 |
+ { |
1684 |
+ struct optee *optee = platform_get_drvdata(pdev); |
1685 |
+ |
1686 |
++ /* Unregister OP-TEE specific client devices on TEE bus */ |
1687 |
++ optee_unregister_devices(); |
1688 |
++ |
1689 |
+ /* |
1690 |
+ * Ask OP-TEE to free all cached shared memory objects to decrease |
1691 |
+ * reference counters and also avoid wild pointers in secure world |
1692 |
+diff --git a/drivers/tee/optee/device.c b/drivers/tee/optee/device.c |
1693 |
+index 7a897d51969fc..031806468af48 100644 |
1694 |
+--- a/drivers/tee/optee/device.c |
1695 |
++++ b/drivers/tee/optee/device.c |
1696 |
+@@ -53,6 +53,13 @@ static int get_devices(struct tee_context *ctx, u32 session, |
1697 |
+ return 0; |
1698 |
+ } |
1699 |
+ |
1700 |
++static void optee_release_device(struct device *dev) |
1701 |
++{ |
1702 |
++ struct tee_client_device *optee_device = to_tee_client_device(dev); |
1703 |
++ |
1704 |
++ kfree(optee_device); |
1705 |
++} |
1706 |
++ |
1707 |
+ static int optee_register_device(const uuid_t *device_uuid) |
1708 |
+ { |
1709 |
+ struct tee_client_device *optee_device = NULL; |
1710 |
+@@ -63,6 +70,7 @@ static int optee_register_device(const uuid_t *device_uuid) |
1711 |
+ return -ENOMEM; |
1712 |
+ |
1713 |
+ optee_device->dev.bus = &tee_bus_type; |
1714 |
++ optee_device->dev.release = optee_release_device; |
1715 |
+ if (dev_set_name(&optee_device->dev, "optee-ta-%pUb", device_uuid)) { |
1716 |
+ kfree(optee_device); |
1717 |
+ return -ENOMEM; |
1718 |
+@@ -154,3 +162,17 @@ int optee_enumerate_devices(u32 func) |
1719 |
+ { |
1720 |
+ return __optee_enumerate_devices(func); |
1721 |
+ } |
1722 |
++ |
1723 |
++static int __optee_unregister_device(struct device *dev, void *data) |
1724 |
++{ |
1725 |
++ if (!strncmp(dev_name(dev), "optee-ta", strlen("optee-ta"))) |
1726 |
++ device_unregister(dev); |
1727 |
++ |
1728 |
++ return 0; |
1729 |
++} |
1730 |
++ |
1731 |
++void optee_unregister_devices(void) |
1732 |
++{ |
1733 |
++ bus_for_each_dev(&tee_bus_type, NULL, NULL, |
1734 |
++ __optee_unregister_device); |
1735 |
++} |
1736 |
+diff --git a/drivers/tee/optee/optee_private.h b/drivers/tee/optee/optee_private.h |
1737 |
+index dbdd367be1568..f6bb4a763ba94 100644 |
1738 |
+--- a/drivers/tee/optee/optee_private.h |
1739 |
++++ b/drivers/tee/optee/optee_private.h |
1740 |
+@@ -184,6 +184,7 @@ void optee_fill_pages_list(u64 *dst, struct page **pages, int num_pages, |
1741 |
+ #define PTA_CMD_GET_DEVICES 0x0 |
1742 |
+ #define PTA_CMD_GET_DEVICES_SUPP 0x1 |
1743 |
+ int optee_enumerate_devices(u32 func); |
1744 |
++void optee_unregister_devices(void); |
1745 |
+ |
1746 |
+ /* |
1747 |
+ * Small helpers |
1748 |
+diff --git a/drivers/usb/host/xhci-dbgtty.c b/drivers/usb/host/xhci-dbgtty.c |
1749 |
+index ae4e4ab638b55..2a53b28319999 100644 |
1750 |
+--- a/drivers/usb/host/xhci-dbgtty.c |
1751 |
++++ b/drivers/usb/host/xhci-dbgtty.c |
1752 |
+@@ -408,40 +408,38 @@ static int xhci_dbc_tty_register_device(struct xhci_dbc *dbc) |
1753 |
+ return -EBUSY; |
1754 |
+ |
1755 |
+ xhci_dbc_tty_init_port(dbc, port); |
1756 |
+- tty_dev = tty_port_register_device(&port->port, |
1757 |
+- dbc_tty_driver, 0, NULL); |
1758 |
+- if (IS_ERR(tty_dev)) { |
1759 |
+- ret = PTR_ERR(tty_dev); |
1760 |
+- goto register_fail; |
1761 |
+- } |
1762 |
+ |
1763 |
+ ret = kfifo_alloc(&port->write_fifo, DBC_WRITE_BUF_SIZE, GFP_KERNEL); |
1764 |
+ if (ret) |
1765 |
+- goto buf_alloc_fail; |
1766 |
++ goto err_exit_port; |
1767 |
+ |
1768 |
+ ret = xhci_dbc_alloc_requests(dbc, BULK_IN, &port->read_pool, |
1769 |
+ dbc_read_complete); |
1770 |
+ if (ret) |
1771 |
+- goto request_fail; |
1772 |
++ goto err_free_fifo; |
1773 |
+ |
1774 |
+ ret = xhci_dbc_alloc_requests(dbc, BULK_OUT, &port->write_pool, |
1775 |
+ dbc_write_complete); |
1776 |
+ if (ret) |
1777 |
+- goto request_fail; |
1778 |
++ goto err_free_requests; |
1779 |
++ |
1780 |
++ tty_dev = tty_port_register_device(&port->port, |
1781 |
++ dbc_tty_driver, 0, NULL); |
1782 |
++ if (IS_ERR(tty_dev)) { |
1783 |
++ ret = PTR_ERR(tty_dev); |
1784 |
++ goto err_free_requests; |
1785 |
++ } |
1786 |
+ |
1787 |
+ port->registered = true; |
1788 |
+ |
1789 |
+ return 0; |
1790 |
+ |
1791 |
+-request_fail: |
1792 |
++err_free_requests: |
1793 |
+ xhci_dbc_free_requests(&port->read_pool); |
1794 |
+ xhci_dbc_free_requests(&port->write_pool); |
1795 |
++err_free_fifo: |
1796 |
+ kfifo_free(&port->write_fifo); |
1797 |
+- |
1798 |
+-buf_alloc_fail: |
1799 |
+- tty_unregister_device(dbc_tty_driver, 0); |
1800 |
+- |
1801 |
+-register_fail: |
1802 |
++err_exit_port: |
1803 |
+ xhci_dbc_tty_exit_port(port); |
1804 |
+ |
1805 |
+ dev_err(dbc->dev, "can't register tty port, err %d\n", ret); |
1806 |
+diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c |
1807 |
+index 119d1a8fbb194..2299866dc82ff 100644 |
1808 |
+--- a/drivers/usb/host/xhci-pci.c |
1809 |
++++ b/drivers/usb/host/xhci-pci.c |
1810 |
+@@ -30,6 +30,7 @@ |
1811 |
+ #define PCI_VENDOR_ID_FRESCO_LOGIC 0x1b73 |
1812 |
+ #define PCI_DEVICE_ID_FRESCO_LOGIC_PDK 0x1000 |
1813 |
+ #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1009 0x1009 |
1814 |
++#define PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 0x1100 |
1815 |
+ #define PCI_DEVICE_ID_FRESCO_LOGIC_FL1400 0x1400 |
1816 |
+ |
1817 |
+ #define PCI_VENDOR_ID_ETRON 0x1b6f |
1818 |
+@@ -112,6 +113,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) |
1819 |
+ /* Look for vendor-specific quirks */ |
1820 |
+ if (pdev->vendor == PCI_VENDOR_ID_FRESCO_LOGIC && |
1821 |
+ (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK || |
1822 |
++ pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1100 || |
1823 |
+ pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_FL1400)) { |
1824 |
+ if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK && |
1825 |
+ pdev->revision == 0x0) { |
1826 |
+diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c |
1827 |
+index dc2068e3bedb7..ec8f2910faf97 100644 |
1828 |
+--- a/drivers/usb/host/xhci-ring.c |
1829 |
++++ b/drivers/usb/host/xhci-ring.c |
1830 |
+@@ -342,16 +342,22 @@ static void xhci_handle_stopped_cmd_ring(struct xhci_hcd *xhci, |
1831 |
+ /* Must be called with xhci->lock held, releases and aquires lock back */ |
1832 |
+ static int xhci_abort_cmd_ring(struct xhci_hcd *xhci, unsigned long flags) |
1833 |
+ { |
1834 |
+- u64 temp_64; |
1835 |
++ u32 temp_32; |
1836 |
+ int ret; |
1837 |
+ |
1838 |
+ xhci_dbg(xhci, "Abort command ring\n"); |
1839 |
+ |
1840 |
+ reinit_completion(&xhci->cmd_ring_stop_completion); |
1841 |
+ |
1842 |
+- temp_64 = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); |
1843 |
+- xhci_write_64(xhci, temp_64 | CMD_RING_ABORT, |
1844 |
+- &xhci->op_regs->cmd_ring); |
1845 |
++ /* |
1846 |
++ * The control bits like command stop, abort are located in lower |
1847 |
++ * dword of the command ring control register. Limit the write |
1848 |
++ * to the lower dword to avoid corrupting the command ring pointer |
1849 |
++ * in case if the command ring is stopped by the time upper dword |
1850 |
++ * is written. |
1851 |
++ */ |
1852 |
++ temp_32 = readl(&xhci->op_regs->cmd_ring); |
1853 |
++ writel(temp_32 | CMD_RING_ABORT, &xhci->op_regs->cmd_ring); |
1854 |
+ |
1855 |
+ /* Section 4.6.1.2 of xHCI 1.0 spec says software should also time the |
1856 |
+ * completion of the Command Abort operation. If CRR is not negated in 5 |
1857 |
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c |
1858 |
+index 6389dc99bc9a4..0d6dc2e20f2aa 100644 |
1859 |
+--- a/drivers/usb/host/xhci.c |
1860 |
++++ b/drivers/usb/host/xhci.c |
1861 |
+@@ -3173,10 +3173,13 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd, |
1862 |
+ return; |
1863 |
+ |
1864 |
+ /* Bail out if toggle is already being cleared by a endpoint reset */ |
1865 |
++ spin_lock_irqsave(&xhci->lock, flags); |
1866 |
+ if (ep->ep_state & EP_HARD_CLEAR_TOGGLE) { |
1867 |
+ ep->ep_state &= ~EP_HARD_CLEAR_TOGGLE; |
1868 |
++ spin_unlock_irqrestore(&xhci->lock, flags); |
1869 |
+ return; |
1870 |
+ } |
1871 |
++ spin_unlock_irqrestore(&xhci->lock, flags); |
1872 |
+ /* Only interrupt and bulk ep's use data toggle, USB2 spec 5.5.4-> */ |
1873 |
+ if (usb_endpoint_xfer_control(&host_ep->desc) || |
1874 |
+ usb_endpoint_xfer_isoc(&host_ep->desc)) |
1875 |
+@@ -3262,8 +3265,10 @@ static void xhci_endpoint_reset(struct usb_hcd *hcd, |
1876 |
+ xhci_free_command(xhci, cfg_cmd); |
1877 |
+ cleanup: |
1878 |
+ xhci_free_command(xhci, stop_cmd); |
1879 |
++ spin_lock_irqsave(&xhci->lock, flags); |
1880 |
+ if (ep->ep_state & EP_SOFT_CLEAR_TOGGLE) |
1881 |
+ ep->ep_state &= ~EP_SOFT_CLEAR_TOGGLE; |
1882 |
++ spin_unlock_irqrestore(&xhci->lock, flags); |
1883 |
+ } |
1884 |
+ |
1885 |
+ static int xhci_check_streams_endpoint(struct xhci_hcd *xhci, |
1886 |
+diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c |
1887 |
+index ce9fc46c92661..b5935834f9d24 100644 |
1888 |
+--- a/drivers/usb/musb/musb_dsps.c |
1889 |
++++ b/drivers/usb/musb/musb_dsps.c |
1890 |
+@@ -899,11 +899,13 @@ static int dsps_probe(struct platform_device *pdev) |
1891 |
+ if (usb_get_dr_mode(&pdev->dev) == USB_DR_MODE_PERIPHERAL) { |
1892 |
+ ret = dsps_setup_optional_vbus_irq(pdev, glue); |
1893 |
+ if (ret) |
1894 |
+- goto err; |
1895 |
++ goto unregister_pdev; |
1896 |
+ } |
1897 |
+ |
1898 |
+ return 0; |
1899 |
+ |
1900 |
++unregister_pdev: |
1901 |
++ platform_device_unregister(glue->musb); |
1902 |
+ err: |
1903 |
+ pm_runtime_disable(&pdev->dev); |
1904 |
+ iounmap(glue->usbss_base); |
1905 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
1906 |
+index 1e990a8264a53..c7356718a7c66 100644 |
1907 |
+--- a/drivers/usb/serial/option.c |
1908 |
++++ b/drivers/usb/serial/option.c |
1909 |
+@@ -246,11 +246,13 @@ static void option_instat_callback(struct urb *urb); |
1910 |
+ /* These Quectel products use Quectel's vendor ID */ |
1911 |
+ #define QUECTEL_PRODUCT_EC21 0x0121 |
1912 |
+ #define QUECTEL_PRODUCT_EC25 0x0125 |
1913 |
++#define QUECTEL_PRODUCT_EG91 0x0191 |
1914 |
+ #define QUECTEL_PRODUCT_EG95 0x0195 |
1915 |
+ #define QUECTEL_PRODUCT_BG96 0x0296 |
1916 |
+ #define QUECTEL_PRODUCT_EP06 0x0306 |
1917 |
+ #define QUECTEL_PRODUCT_EM12 0x0512 |
1918 |
+ #define QUECTEL_PRODUCT_RM500Q 0x0800 |
1919 |
++#define QUECTEL_PRODUCT_EC200S_CN 0x6002 |
1920 |
+ #define QUECTEL_PRODUCT_EC200T 0x6026 |
1921 |
+ |
1922 |
+ #define CMOTECH_VENDOR_ID 0x16d8 |
1923 |
+@@ -1111,6 +1113,9 @@ static const struct usb_device_id option_ids[] = { |
1924 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0xff, 0xff), |
1925 |
+ .driver_info = NUMEP2 }, |
1926 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0, 0) }, |
1927 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG91, 0xff, 0xff, 0xff), |
1928 |
++ .driver_info = NUMEP2 }, |
1929 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG91, 0xff, 0, 0) }, |
1930 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0xff, 0xff), |
1931 |
+ .driver_info = NUMEP2 }, |
1932 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) }, |
1933 |
+@@ -1128,6 +1133,7 @@ static const struct usb_device_id option_ids[] = { |
1934 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) }, |
1935 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10), |
1936 |
+ .driver_info = ZLP }, |
1937 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, |
1938 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, |
1939 |
+ |
1940 |
+ { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) }, |
1941 |
+@@ -1227,6 +1233,8 @@ static const struct usb_device_id option_ids[] = { |
1942 |
+ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, |
1943 |
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1203, 0xff), /* Telit LE910Cx (RNDIS) */ |
1944 |
+ .driver_info = NCTRL(2) | RSVD(3) }, |
1945 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1204, 0xff), /* Telit LE910Cx (MBIM) */ |
1946 |
++ .driver_info = NCTRL(0) | RSVD(1) }, |
1947 |
+ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4), |
1948 |
+ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) }, |
1949 |
+ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920), |
1950 |
+diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c |
1951 |
+index 83da8236e3c8b..c18bf8164bc2e 100644 |
1952 |
+--- a/drivers/usb/serial/qcserial.c |
1953 |
++++ b/drivers/usb/serial/qcserial.c |
1954 |
+@@ -165,6 +165,7 @@ static const struct usb_device_id id_table[] = { |
1955 |
+ {DEVICE_SWI(0x1199, 0x907b)}, /* Sierra Wireless EM74xx */ |
1956 |
+ {DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */ |
1957 |
+ {DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */ |
1958 |
++ {DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */ |
1959 |
+ {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ |
1960 |
+ {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ |
1961 |
+ {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ |
1962 |
+diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c |
1963 |
+index c4d53ff06bf85..fdeb20f2f174c 100644 |
1964 |
+--- a/drivers/vhost/vdpa.c |
1965 |
++++ b/drivers/vhost/vdpa.c |
1966 |
+@@ -325,7 +325,7 @@ static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp) |
1967 |
+ struct eventfd_ctx *ctx; |
1968 |
+ |
1969 |
+ cb.callback = vhost_vdpa_config_cb; |
1970 |
+- cb.private = v->vdpa; |
1971 |
++ cb.private = v; |
1972 |
+ if (copy_from_user(&fd, argp, sizeof(fd))) |
1973 |
+ return -EFAULT; |
1974 |
+ |
1975 |
+diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c |
1976 |
+index 84b5dec5d29cd..5c53098755a35 100644 |
1977 |
+--- a/drivers/virtio/virtio.c |
1978 |
++++ b/drivers/virtio/virtio.c |
1979 |
+@@ -240,6 +240,17 @@ static int virtio_dev_probe(struct device *_d) |
1980 |
+ driver_features_legacy = driver_features; |
1981 |
+ } |
1982 |
+ |
1983 |
++ /* |
1984 |
++ * Some devices detect legacy solely via F_VERSION_1. Write |
1985 |
++ * F_VERSION_1 to force LE config space accesses before FEATURES_OK for |
1986 |
++ * these when needed. |
1987 |
++ */ |
1988 |
++ if (drv->validate && !virtio_legacy_is_little_endian() |
1989 |
++ && device_features & BIT_ULL(VIRTIO_F_VERSION_1)) { |
1990 |
++ dev->features = BIT_ULL(VIRTIO_F_VERSION_1); |
1991 |
++ dev->config->finalize_features(dev); |
1992 |
++ } |
1993 |
++ |
1994 |
+ if (device_features & (1ULL << VIRTIO_F_VERSION_1)) |
1995 |
+ dev->features = driver_features & device_features; |
1996 |
+ else |
1997 |
+diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c |
1998 |
+index c346c46020e5e..284294620e9fa 100644 |
1999 |
+--- a/fs/btrfs/extent-tree.c |
2000 |
++++ b/fs/btrfs/extent-tree.c |
2001 |
+@@ -4715,6 +4715,7 @@ struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans, |
2002 |
+ out_free_delayed: |
2003 |
+ btrfs_free_delayed_extent_op(extent_op); |
2004 |
+ out_free_buf: |
2005 |
++ btrfs_tree_unlock(buf); |
2006 |
+ free_extent_buffer(buf); |
2007 |
+ out_free_reserved: |
2008 |
+ btrfs_free_reserved_extent(fs_info, ins.objectid, ins.offset, 0); |
2009 |
+diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c |
2010 |
+index 6ab91661cd261..f59ec55e5feb2 100644 |
2011 |
+--- a/fs/btrfs/file.c |
2012 |
++++ b/fs/btrfs/file.c |
2013 |
+@@ -710,8 +710,7 @@ int __btrfs_drop_extents(struct btrfs_trans_handle *trans, |
2014 |
+ if (start >= inode->disk_i_size && !replace_extent) |
2015 |
+ modify_tree = 0; |
2016 |
+ |
2017 |
+- update_refs = (test_bit(BTRFS_ROOT_SHAREABLE, &root->state) || |
2018 |
+- root == fs_info->tree_root); |
2019 |
++ update_refs = (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID); |
2020 |
+ while (1) { |
2021 |
+ recow = 0; |
2022 |
+ ret = btrfs_lookup_file_extent(trans, root, path, ino, |
2023 |
+@@ -2662,14 +2661,16 @@ int btrfs_replace_file_extents(struct inode *inode, struct btrfs_path *path, |
2024 |
+ 1, 0, 0, NULL); |
2025 |
+ if (ret != -ENOSPC) { |
2026 |
+ /* |
2027 |
+- * When cloning we want to avoid transaction aborts when |
2028 |
+- * nothing was done and we are attempting to clone parts |
2029 |
+- * of inline extents, in such cases -EOPNOTSUPP is |
2030 |
+- * returned by __btrfs_drop_extents() without having |
2031 |
+- * changed anything in the file. |
2032 |
++ * The only time we don't want to abort is if we are |
2033 |
++ * attempting to clone a partial inline extent, in which |
2034 |
++ * case we'll get EOPNOTSUPP. However if we aren't |
2035 |
++ * clone we need to abort no matter what, because if we |
2036 |
++ * got EOPNOTSUPP via prealloc then we messed up and |
2037 |
++ * need to abort. |
2038 |
+ */ |
2039 |
+- if (extent_info && !extent_info->is_new_extent && |
2040 |
+- ret && ret != -EOPNOTSUPP) |
2041 |
++ if (ret && |
2042 |
++ (ret != -EOPNOTSUPP || |
2043 |
++ (extent_info && extent_info->is_new_extent))) |
2044 |
+ btrfs_abort_transaction(trans, ret); |
2045 |
+ break; |
2046 |
+ } |
2047 |
+diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c |
2048 |
+index 7bf3936aceda2..c3bb5c4375ab0 100644 |
2049 |
+--- a/fs/btrfs/tree-log.c |
2050 |
++++ b/fs/btrfs/tree-log.c |
2051 |
+@@ -1137,7 +1137,10 @@ next: |
2052 |
+ /* look for a conflicting sequence number */ |
2053 |
+ di = btrfs_lookup_dir_index_item(trans, root, path, btrfs_ino(dir), |
2054 |
+ ref_index, name, namelen, 0); |
2055 |
+- if (di && !IS_ERR(di)) { |
2056 |
++ if (IS_ERR(di)) { |
2057 |
++ if (PTR_ERR(di) != -ENOENT) |
2058 |
++ return PTR_ERR(di); |
2059 |
++ } else if (di) { |
2060 |
+ ret = drop_one_dir_item(trans, root, path, dir, di); |
2061 |
+ if (ret) |
2062 |
+ return ret; |
2063 |
+@@ -1147,7 +1150,9 @@ next: |
2064 |
+ /* look for a conflicting name */ |
2065 |
+ di = btrfs_lookup_dir_item(trans, root, path, btrfs_ino(dir), |
2066 |
+ name, namelen, 0); |
2067 |
+- if (di && !IS_ERR(di)) { |
2068 |
++ if (IS_ERR(di)) { |
2069 |
++ return PTR_ERR(di); |
2070 |
++ } else if (di) { |
2071 |
+ ret = drop_one_dir_item(trans, root, path, dir, di); |
2072 |
+ if (ret) |
2073 |
+ return ret; |
2074 |
+@@ -1897,8 +1902,8 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans, |
2075 |
+ struct btrfs_key log_key; |
2076 |
+ struct inode *dir; |
2077 |
+ u8 log_type; |
2078 |
+- int exists; |
2079 |
+- int ret = 0; |
2080 |
++ bool exists; |
2081 |
++ int ret; |
2082 |
+ bool update_size = (key->type == BTRFS_DIR_INDEX_KEY); |
2083 |
+ bool name_added = false; |
2084 |
+ |
2085 |
+@@ -1918,12 +1923,12 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans, |
2086 |
+ name_len); |
2087 |
+ |
2088 |
+ btrfs_dir_item_key_to_cpu(eb, di, &log_key); |
2089 |
+- exists = btrfs_lookup_inode(trans, root, path, &log_key, 0); |
2090 |
+- if (exists == 0) |
2091 |
+- exists = 1; |
2092 |
+- else |
2093 |
+- exists = 0; |
2094 |
++ ret = btrfs_lookup_inode(trans, root, path, &log_key, 0); |
2095 |
+ btrfs_release_path(path); |
2096 |
++ if (ret < 0) |
2097 |
++ goto out; |
2098 |
++ exists = (ret == 0); |
2099 |
++ ret = 0; |
2100 |
+ |
2101 |
+ if (key->type == BTRFS_DIR_ITEM_KEY) { |
2102 |
+ dst_di = btrfs_lookup_dir_item(trans, root, path, key->objectid, |
2103 |
+@@ -1938,7 +1943,14 @@ static noinline int replay_one_name(struct btrfs_trans_handle *trans, |
2104 |
+ ret = -EINVAL; |
2105 |
+ goto out; |
2106 |
+ } |
2107 |
+- if (IS_ERR_OR_NULL(dst_di)) { |
2108 |
++ |
2109 |
++ if (dst_di == ERR_PTR(-ENOENT)) |
2110 |
++ dst_di = NULL; |
2111 |
++ |
2112 |
++ if (IS_ERR(dst_di)) { |
2113 |
++ ret = PTR_ERR(dst_di); |
2114 |
++ goto out; |
2115 |
++ } else if (!dst_di) { |
2116 |
+ /* we need a sequence number to insert, so we only |
2117 |
+ * do inserts for the BTRFS_DIR_INDEX_KEY types |
2118 |
+ */ |
2119 |
+diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h |
2120 |
+index 70a3664785f80..f5e829e12a76d 100644 |
2121 |
+--- a/include/linux/mlx5/mlx5_ifc.h |
2122 |
++++ b/include/linux/mlx5/mlx5_ifc.h |
2123 |
+@@ -9274,16 +9274,22 @@ struct mlx5_ifc_pcmr_reg_bits { |
2124 |
+ u8 reserved_at_0[0x8]; |
2125 |
+ u8 local_port[0x8]; |
2126 |
+ u8 reserved_at_10[0x10]; |
2127 |
++ |
2128 |
+ u8 entropy_force_cap[0x1]; |
2129 |
+ u8 entropy_calc_cap[0x1]; |
2130 |
+ u8 entropy_gre_calc_cap[0x1]; |
2131 |
+- u8 reserved_at_23[0x1b]; |
2132 |
++ u8 reserved_at_23[0xf]; |
2133 |
++ u8 rx_ts_over_crc_cap[0x1]; |
2134 |
++ u8 reserved_at_33[0xb]; |
2135 |
+ u8 fcs_cap[0x1]; |
2136 |
+ u8 reserved_at_3f[0x1]; |
2137 |
++ |
2138 |
+ u8 entropy_force[0x1]; |
2139 |
+ u8 entropy_calc[0x1]; |
2140 |
+ u8 entropy_gre_calc[0x1]; |
2141 |
+- u8 reserved_at_43[0x1b]; |
2142 |
++ u8 reserved_at_43[0xf]; |
2143 |
++ u8 rx_ts_over_crc[0x1]; |
2144 |
++ u8 reserved_at_53[0xb]; |
2145 |
+ u8 fcs_chk[0x1]; |
2146 |
+ u8 reserved_at_5f[0x1]; |
2147 |
+ }; |
2148 |
+diff --git a/net/nfc/af_nfc.c b/net/nfc/af_nfc.c |
2149 |
+index 4a9e72073564a..581358dcbdf8d 100644 |
2150 |
+--- a/net/nfc/af_nfc.c |
2151 |
++++ b/net/nfc/af_nfc.c |
2152 |
+@@ -60,6 +60,9 @@ int nfc_proto_register(const struct nfc_protocol *nfc_proto) |
2153 |
+ proto_tab[nfc_proto->id] = nfc_proto; |
2154 |
+ write_unlock(&proto_tab_lock); |
2155 |
+ |
2156 |
++ if (rc) |
2157 |
++ proto_unregister(nfc_proto->proto); |
2158 |
++ |
2159 |
+ return rc; |
2160 |
+ } |
2161 |
+ EXPORT_SYMBOL(nfc_proto_register); |
2162 |
+diff --git a/net/nfc/digital_core.c b/net/nfc/digital_core.c |
2163 |
+index e3599ed4a7a87..9c9caa307cf16 100644 |
2164 |
+--- a/net/nfc/digital_core.c |
2165 |
++++ b/net/nfc/digital_core.c |
2166 |
+@@ -277,6 +277,7 @@ int digital_tg_configure_hw(struct nfc_digital_dev *ddev, int type, int param) |
2167 |
+ static int digital_tg_listen_mdaa(struct nfc_digital_dev *ddev, u8 rf_tech) |
2168 |
+ { |
2169 |
+ struct digital_tg_mdaa_params *params; |
2170 |
++ int rc; |
2171 |
+ |
2172 |
+ params = kzalloc(sizeof(*params), GFP_KERNEL); |
2173 |
+ if (!params) |
2174 |
+@@ -291,8 +292,12 @@ static int digital_tg_listen_mdaa(struct nfc_digital_dev *ddev, u8 rf_tech) |
2175 |
+ get_random_bytes(params->nfcid2 + 2, NFC_NFCID2_MAXSIZE - 2); |
2176 |
+ params->sc = DIGITAL_SENSF_FELICA_SC; |
2177 |
+ |
2178 |
+- return digital_send_cmd(ddev, DIGITAL_CMD_TG_LISTEN_MDAA, NULL, params, |
2179 |
+- 500, digital_tg_recv_atr_req, NULL); |
2180 |
++ rc = digital_send_cmd(ddev, DIGITAL_CMD_TG_LISTEN_MDAA, NULL, params, |
2181 |
++ 500, digital_tg_recv_atr_req, NULL); |
2182 |
++ if (rc) |
2183 |
++ kfree(params); |
2184 |
++ |
2185 |
++ return rc; |
2186 |
+ } |
2187 |
+ |
2188 |
+ static int digital_tg_listen_md(struct nfc_digital_dev *ddev, u8 rf_tech) |
2189 |
+diff --git a/net/nfc/digital_technology.c b/net/nfc/digital_technology.c |
2190 |
+index 84d2345c75a3f..3adf4589852af 100644 |
2191 |
+--- a/net/nfc/digital_technology.c |
2192 |
++++ b/net/nfc/digital_technology.c |
2193 |
+@@ -465,8 +465,12 @@ static int digital_in_send_sdd_req(struct nfc_digital_dev *ddev, |
2194 |
+ skb_put_u8(skb, sel_cmd); |
2195 |
+ skb_put_u8(skb, DIGITAL_SDD_REQ_SEL_PAR); |
2196 |
+ |
2197 |
+- return digital_in_send_cmd(ddev, skb, 30, digital_in_recv_sdd_res, |
2198 |
+- target); |
2199 |
++ rc = digital_in_send_cmd(ddev, skb, 30, digital_in_recv_sdd_res, |
2200 |
++ target); |
2201 |
++ if (rc) |
2202 |
++ kfree_skb(skb); |
2203 |
++ |
2204 |
++ return rc; |
2205 |
+ } |
2206 |
+ |
2207 |
+ static void digital_in_recv_sens_res(struct nfc_digital_dev *ddev, void *arg, |
2208 |
+diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c |
2209 |
+index 8766ab5b87880..5eb3b1b7ae5e7 100644 |
2210 |
+--- a/net/sched/sch_mqprio.c |
2211 |
++++ b/net/sched/sch_mqprio.c |
2212 |
+@@ -529,22 +529,28 @@ static int mqprio_dump_class_stats(struct Qdisc *sch, unsigned long cl, |
2213 |
+ for (i = tc.offset; i < tc.offset + tc.count; i++) { |
2214 |
+ struct netdev_queue *q = netdev_get_tx_queue(dev, i); |
2215 |
+ struct Qdisc *qdisc = rtnl_dereference(q->qdisc); |
2216 |
+- struct gnet_stats_basic_cpu __percpu *cpu_bstats = NULL; |
2217 |
+- struct gnet_stats_queue __percpu *cpu_qstats = NULL; |
2218 |
+ |
2219 |
+ spin_lock_bh(qdisc_lock(qdisc)); |
2220 |
++ |
2221 |
+ if (qdisc_is_percpu_stats(qdisc)) { |
2222 |
+- cpu_bstats = qdisc->cpu_bstats; |
2223 |
+- cpu_qstats = qdisc->cpu_qstats; |
2224 |
++ qlen = qdisc_qlen_sum(qdisc); |
2225 |
++ |
2226 |
++ __gnet_stats_copy_basic(NULL, &bstats, |
2227 |
++ qdisc->cpu_bstats, |
2228 |
++ &qdisc->bstats); |
2229 |
++ __gnet_stats_copy_queue(&qstats, |
2230 |
++ qdisc->cpu_qstats, |
2231 |
++ &qdisc->qstats, |
2232 |
++ qlen); |
2233 |
++ } else { |
2234 |
++ qlen += qdisc->q.qlen; |
2235 |
++ bstats.bytes += qdisc->bstats.bytes; |
2236 |
++ bstats.packets += qdisc->bstats.packets; |
2237 |
++ qstats.backlog += qdisc->qstats.backlog; |
2238 |
++ qstats.drops += qdisc->qstats.drops; |
2239 |
++ qstats.requeues += qdisc->qstats.requeues; |
2240 |
++ qstats.overlimits += qdisc->qstats.overlimits; |
2241 |
+ } |
2242 |
+- |
2243 |
+- qlen = qdisc_qlen_sum(qdisc); |
2244 |
+- __gnet_stats_copy_basic(NULL, &sch->bstats, |
2245 |
+- cpu_bstats, &qdisc->bstats); |
2246 |
+- __gnet_stats_copy_queue(&sch->qstats, |
2247 |
+- cpu_qstats, |
2248 |
+- &qdisc->qstats, |
2249 |
+- qlen); |
2250 |
+ spin_unlock_bh(qdisc_lock(qdisc)); |
2251 |
+ } |
2252 |
+ |
2253 |
+diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c |
2254 |
+index fa0d96320baae..64e0f4864b733 100644 |
2255 |
+--- a/net/sctp/sm_make_chunk.c |
2256 |
++++ b/net/sctp/sm_make_chunk.c |
2257 |
+@@ -3651,7 +3651,7 @@ struct sctp_chunk *sctp_make_strreset_req( |
2258 |
+ outlen = (sizeof(outreq) + stream_len) * out; |
2259 |
+ inlen = (sizeof(inreq) + stream_len) * in; |
2260 |
+ |
2261 |
+- retval = sctp_make_reconf(asoc, outlen + inlen); |
2262 |
++ retval = sctp_make_reconf(asoc, SCTP_PAD4(outlen) + SCTP_PAD4(inlen)); |
2263 |
+ if (!retval) |
2264 |
+ return NULL; |
2265 |
+ |
2266 |
+diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl |
2267 |
+index 4f84657f55c23..f459ae883a0a6 100755 |
2268 |
+--- a/scripts/recordmcount.pl |
2269 |
++++ b/scripts/recordmcount.pl |
2270 |
+@@ -222,7 +222,7 @@ if ($arch =~ /(x86(_64)?)|(i386)/) { |
2271 |
+ $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)"; |
2272 |
+ $weak_regex = "^[0-9a-fA-F]+\\s+([wW])\\s+(\\S+)"; |
2273 |
+ $section_regex = "Disassembly of section\\s+(\\S+):"; |
2274 |
+-$function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; |
2275 |
++$function_regex = "^([0-9a-fA-F]+)\\s+<([^^]*?)>:"; |
2276 |
+ $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s(mcount|__fentry__)\$"; |
2277 |
+ $section_type = '@progbits'; |
2278 |
+ $mcount_adjust = 0; |
2279 |
+diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c |
2280 |
+index 590a46a9e78de..a226d8f240287 100644 |
2281 |
+--- a/sound/core/pcm_compat.c |
2282 |
++++ b/sound/core/pcm_compat.c |
2283 |
+@@ -466,6 +466,76 @@ static int snd_pcm_ioctl_sync_ptr_x32(struct snd_pcm_substream *substream, |
2284 |
+ } |
2285 |
+ #endif /* CONFIG_X86_X32 */ |
2286 |
+ |
2287 |
++#ifdef __BIG_ENDIAN |
2288 |
++typedef char __pad_before_u32[4]; |
2289 |
++typedef char __pad_after_u32[0]; |
2290 |
++#else |
2291 |
++typedef char __pad_before_u32[0]; |
2292 |
++typedef char __pad_after_u32[4]; |
2293 |
++#endif |
2294 |
++ |
2295 |
++/* PCM 2.0.15 API definition had a bug in mmap control; it puts the avail_min |
2296 |
++ * at the wrong offset due to a typo in padding type. |
2297 |
++ * The bug hits only 32bit. |
2298 |
++ * A workaround for incorrect read/write is needed only in 32bit compat mode. |
2299 |
++ */ |
2300 |
++struct __snd_pcm_mmap_control64_buggy { |
2301 |
++ __pad_before_u32 __pad1; |
2302 |
++ __u32 appl_ptr; |
2303 |
++ __pad_before_u32 __pad2; /* SiC! here is the bug */ |
2304 |
++ __pad_before_u32 __pad3; |
2305 |
++ __u32 avail_min; |
2306 |
++ __pad_after_uframe __pad4; |
2307 |
++}; |
2308 |
++ |
2309 |
++static int snd_pcm_ioctl_sync_ptr_buggy(struct snd_pcm_substream *substream, |
2310 |
++ struct snd_pcm_sync_ptr __user *_sync_ptr) |
2311 |
++{ |
2312 |
++ struct snd_pcm_runtime *runtime = substream->runtime; |
2313 |
++ struct snd_pcm_sync_ptr sync_ptr; |
2314 |
++ struct __snd_pcm_mmap_control64_buggy *sync_cp; |
2315 |
++ volatile struct snd_pcm_mmap_status *status; |
2316 |
++ volatile struct snd_pcm_mmap_control *control; |
2317 |
++ int err; |
2318 |
++ |
2319 |
++ memset(&sync_ptr, 0, sizeof(sync_ptr)); |
2320 |
++ sync_cp = (struct __snd_pcm_mmap_control64_buggy *)&sync_ptr.c.control; |
2321 |
++ if (get_user(sync_ptr.flags, (unsigned __user *)&(_sync_ptr->flags))) |
2322 |
++ return -EFAULT; |
2323 |
++ if (copy_from_user(sync_cp, &(_sync_ptr->c.control), sizeof(*sync_cp))) |
2324 |
++ return -EFAULT; |
2325 |
++ status = runtime->status; |
2326 |
++ control = runtime->control; |
2327 |
++ if (sync_ptr.flags & SNDRV_PCM_SYNC_PTR_HWSYNC) { |
2328 |
++ err = snd_pcm_hwsync(substream); |
2329 |
++ if (err < 0) |
2330 |
++ return err; |
2331 |
++ } |
2332 |
++ snd_pcm_stream_lock_irq(substream); |
2333 |
++ if (!(sync_ptr.flags & SNDRV_PCM_SYNC_PTR_APPL)) { |
2334 |
++ err = pcm_lib_apply_appl_ptr(substream, sync_cp->appl_ptr); |
2335 |
++ if (err < 0) { |
2336 |
++ snd_pcm_stream_unlock_irq(substream); |
2337 |
++ return err; |
2338 |
++ } |
2339 |
++ } else { |
2340 |
++ sync_cp->appl_ptr = control->appl_ptr; |
2341 |
++ } |
2342 |
++ if (!(sync_ptr.flags & SNDRV_PCM_SYNC_PTR_AVAIL_MIN)) |
2343 |
++ control->avail_min = sync_cp->avail_min; |
2344 |
++ else |
2345 |
++ sync_cp->avail_min = control->avail_min; |
2346 |
++ sync_ptr.s.status.state = status->state; |
2347 |
++ sync_ptr.s.status.hw_ptr = status->hw_ptr; |
2348 |
++ sync_ptr.s.status.tstamp = status->tstamp; |
2349 |
++ sync_ptr.s.status.suspended_state = status->suspended_state; |
2350 |
++ sync_ptr.s.status.audio_tstamp = status->audio_tstamp; |
2351 |
++ snd_pcm_stream_unlock_irq(substream); |
2352 |
++ if (copy_to_user(_sync_ptr, &sync_ptr, sizeof(sync_ptr))) |
2353 |
++ return -EFAULT; |
2354 |
++ return 0; |
2355 |
++} |
2356 |
++ |
2357 |
+ /* |
2358 |
+ */ |
2359 |
+ enum { |
2360 |
+@@ -535,7 +605,7 @@ static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned l |
2361 |
+ if (in_x32_syscall()) |
2362 |
+ return snd_pcm_ioctl_sync_ptr_x32(substream, argp); |
2363 |
+ #endif /* CONFIG_X86_X32 */ |
2364 |
+- return snd_pcm_common_ioctl(file, substream, cmd, argp); |
2365 |
++ return snd_pcm_ioctl_sync_ptr_buggy(substream, argp); |
2366 |
+ case SNDRV_PCM_IOCTL_HW_REFINE32: |
2367 |
+ return snd_pcm_ioctl_hw_params_compat(substream, 1, argp); |
2368 |
+ case SNDRV_PCM_IOCTL_HW_PARAMS32: |
2369 |
+diff --git a/sound/core/seq_device.c b/sound/core/seq_device.c |
2370 |
+index 7ed13cb32ef82..f22d3bbfcaa54 100644 |
2371 |
+--- a/sound/core/seq_device.c |
2372 |
++++ b/sound/core/seq_device.c |
2373 |
+@@ -147,6 +147,8 @@ static int snd_seq_device_dev_free(struct snd_device *device) |
2374 |
+ struct snd_seq_device *dev = device->device_data; |
2375 |
+ |
2376 |
+ cancel_autoload_drivers(); |
2377 |
++ if (dev->private_free) |
2378 |
++ dev->private_free(dev); |
2379 |
+ put_device(&dev->dev); |
2380 |
+ return 0; |
2381 |
+ } |
2382 |
+@@ -174,11 +176,7 @@ static int snd_seq_device_dev_disconnect(struct snd_device *device) |
2383 |
+ |
2384 |
+ static void snd_seq_dev_release(struct device *dev) |
2385 |
+ { |
2386 |
+- struct snd_seq_device *sdev = to_seq_dev(dev); |
2387 |
+- |
2388 |
+- if (sdev->private_free) |
2389 |
+- sdev->private_free(sdev); |
2390 |
+- kfree(sdev); |
2391 |
++ kfree(to_seq_dev(dev)); |
2392 |
+ } |
2393 |
+ |
2394 |
+ /* |
2395 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
2396 |
+index 9f37adb2b4d09..c36239cea474f 100644 |
2397 |
+--- a/sound/pci/hda/patch_realtek.c |
2398 |
++++ b/sound/pci/hda/patch_realtek.c |
2399 |
+@@ -527,6 +527,8 @@ static void alc_shutup_pins(struct hda_codec *codec) |
2400 |
+ struct alc_spec *spec = codec->spec; |
2401 |
+ |
2402 |
+ switch (codec->core.vendor_id) { |
2403 |
++ case 0x10ec0236: |
2404 |
++ case 0x10ec0256: |
2405 |
+ case 0x10ec0283: |
2406 |
+ case 0x10ec0286: |
2407 |
+ case 0x10ec0288: |
2408 |
+@@ -2549,7 +2551,8 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { |
2409 |
+ SND_PCI_QUIRK(0x1558, 0x67e1, "Clevo PB71[DE][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2410 |
+ SND_PCI_QUIRK(0x1558, 0x67e5, "Clevo PC70D[PRS](?:-D|-G)?", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2411 |
+ SND_PCI_QUIRK(0x1558, 0x70d1, "Clevo PC70[ER][CDF]", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2412 |
+- SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2413 |
++ SND_PCI_QUIRK(0x1558, 0x7714, "Clevo X170SM", ALC1220_FIXUP_CLEVO_PB51ED_PINS), |
2414 |
++ SND_PCI_QUIRK(0x1558, 0x7715, "Clevo X170KM-G", ALC1220_FIXUP_CLEVO_PB51ED), |
2415 |
+ SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), |
2416 |
+ SND_PCI_QUIRK(0x1558, 0x9506, "Clevo P955HQ", ALC1220_FIXUP_CLEVO_P950), |
2417 |
+ SND_PCI_QUIRK(0x1558, 0x950a, "Clevo P955H[PR]", ALC1220_FIXUP_CLEVO_P950), |
2418 |
+@@ -3531,7 +3534,8 @@ static void alc256_shutup(struct hda_codec *codec) |
2419 |
+ /* If disable 3k pulldown control for alc257, the Mic detection will not work correctly |
2420 |
+ * when booting with headset plugged. So skip setting it for the codec alc257 |
2421 |
+ */ |
2422 |
+- if (codec->core.vendor_id != 0x10ec0257) |
2423 |
++ if (spec->codec_variant != ALC269_TYPE_ALC257 && |
2424 |
++ spec->codec_variant != ALC269_TYPE_ALC256) |
2425 |
+ alc_update_coef_idx(codec, 0x46, 0, 3 << 12); |
2426 |
+ |
2427 |
+ if (!spec->no_shutup_pins) |
2428 |
+@@ -6395,6 +6399,24 @@ static void alc287_fixup_legion_15imhg05_speakers(struct hda_codec *codec, |
2429 |
+ /* for alc285_fixup_ideapad_s740_coef() */ |
2430 |
+ #include "ideapad_s740_helper.c" |
2431 |
+ |
2432 |
++static void alc256_fixup_tongfang_reset_persistent_settings(struct hda_codec *codec, |
2433 |
++ const struct hda_fixup *fix, |
2434 |
++ int action) |
2435 |
++{ |
2436 |
++ /* |
2437 |
++ * A certain other OS sets these coeffs to different values. On at least one TongFang |
2438 |
++ * barebone these settings might survive even a cold reboot. So to restore a clean slate the |
2439 |
++ * values are explicitly reset to default here. Without this, the external microphone is |
2440 |
++ * always in a plugged-in state, while the internal microphone is always in an unplugged |
2441 |
++ * state, breaking the ability to use the internal microphone. |
2442 |
++ */ |
2443 |
++ alc_write_coef_idx(codec, 0x24, 0x0000); |
2444 |
++ alc_write_coef_idx(codec, 0x26, 0x0000); |
2445 |
++ alc_write_coef_idx(codec, 0x29, 0x3000); |
2446 |
++ alc_write_coef_idx(codec, 0x37, 0xfe05); |
2447 |
++ alc_write_coef_idx(codec, 0x45, 0x5089); |
2448 |
++} |
2449 |
++ |
2450 |
+ enum { |
2451 |
+ ALC269_FIXUP_GPIO2, |
2452 |
+ ALC269_FIXUP_SONY_VAIO, |
2453 |
+@@ -6608,7 +6630,8 @@ enum { |
2454 |
+ ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS, |
2455 |
+ ALC287_FIXUP_LEGION_15IMHG05_AUTOMUTE, |
2456 |
+ ALC287_FIXUP_YOGA7_14ITL_SPEAKERS, |
2457 |
+- ALC287_FIXUP_13S_GEN2_SPEAKERS |
2458 |
++ ALC287_FIXUP_13S_GEN2_SPEAKERS, |
2459 |
++ ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS, |
2460 |
+ }; |
2461 |
+ |
2462 |
+ static const struct hda_fixup alc269_fixups[] = { |
2463 |
+@@ -8283,7 +8306,7 @@ static const struct hda_fixup alc269_fixups[] = { |
2464 |
+ .v.verbs = (const struct hda_verb[]) { |
2465 |
+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x24 }, |
2466 |
+ { 0x20, AC_VERB_SET_PROC_COEF, 0x41 }, |
2467 |
+- { 0x20, AC_VERB_SET_PROC_COEF, 0xb020 }, |
2468 |
++ { 0x20, AC_VERB_SET_COEF_INDEX, 0x26 }, |
2469 |
+ { 0x20, AC_VERB_SET_PROC_COEF, 0x2 }, |
2470 |
+ { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
2471 |
+ { 0x20, AC_VERB_SET_PROC_COEF, 0x0 }, |
2472 |
+@@ -8300,6 +8323,10 @@ static const struct hda_fixup alc269_fixups[] = { |
2473 |
+ .chained = true, |
2474 |
+ .chain_id = ALC269_FIXUP_HEADSET_MODE, |
2475 |
+ }, |
2476 |
++ [ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS] = { |
2477 |
++ .type = HDA_FIXUP_FUNC, |
2478 |
++ .v.func = alc256_fixup_tongfang_reset_persistent_settings, |
2479 |
++ }, |
2480 |
+ }; |
2481 |
+ |
2482 |
+ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
2483 |
+@@ -8391,6 +8418,9 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
2484 |
+ SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), |
2485 |
+ SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC), |
2486 |
+ SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK), |
2487 |
++ SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK), |
2488 |
++ SND_PCI_QUIRK(0x1028, 0x0a9d, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), |
2489 |
++ SND_PCI_QUIRK(0x1028, 0x0a9e, "Dell Latitude 5430", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE), |
2490 |
+ SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
2491 |
+ SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
2492 |
+ SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), |
2493 |
+@@ -8726,6 +8756,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
2494 |
+ SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ |
2495 |
+ SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), |
2496 |
+ SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), |
2497 |
++ SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_TONGFANG_RESET_PERSISTENT_SETTINGS), |
2498 |
+ SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), |
2499 |
+ SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), |
2500 |
+ SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), |
2501 |
+@@ -10098,6 +10129,9 @@ enum { |
2502 |
+ ALC671_FIXUP_HP_HEADSET_MIC2, |
2503 |
+ ALC662_FIXUP_ACER_X2660G_HEADSET_MODE, |
2504 |
+ ALC662_FIXUP_ACER_NITRO_HEADSET_MODE, |
2505 |
++ ALC668_FIXUP_ASUS_NO_HEADSET_MIC, |
2506 |
++ ALC668_FIXUP_HEADSET_MIC, |
2507 |
++ ALC668_FIXUP_MIC_DET_COEF, |
2508 |
+ }; |
2509 |
+ |
2510 |
+ static const struct hda_fixup alc662_fixups[] = { |
2511 |
+@@ -10481,6 +10515,29 @@ static const struct hda_fixup alc662_fixups[] = { |
2512 |
+ .chained = true, |
2513 |
+ .chain_id = ALC662_FIXUP_USI_FUNC |
2514 |
+ }, |
2515 |
++ [ALC668_FIXUP_ASUS_NO_HEADSET_MIC] = { |
2516 |
++ .type = HDA_FIXUP_PINS, |
2517 |
++ .v.pins = (const struct hda_pintbl[]) { |
2518 |
++ { 0x1b, 0x04a1112c }, |
2519 |
++ { } |
2520 |
++ }, |
2521 |
++ .chained = true, |
2522 |
++ .chain_id = ALC668_FIXUP_HEADSET_MIC |
2523 |
++ }, |
2524 |
++ [ALC668_FIXUP_HEADSET_MIC] = { |
2525 |
++ .type = HDA_FIXUP_FUNC, |
2526 |
++ .v.func = alc269_fixup_headset_mic, |
2527 |
++ .chained = true, |
2528 |
++ .chain_id = ALC668_FIXUP_MIC_DET_COEF |
2529 |
++ }, |
2530 |
++ [ALC668_FIXUP_MIC_DET_COEF] = { |
2531 |
++ .type = HDA_FIXUP_VERBS, |
2532 |
++ .v.verbs = (const struct hda_verb[]) { |
2533 |
++ { 0x20, AC_VERB_SET_COEF_INDEX, 0x15 }, |
2534 |
++ { 0x20, AC_VERB_SET_PROC_COEF, 0x0d60 }, |
2535 |
++ {} |
2536 |
++ }, |
2537 |
++ }, |
2538 |
+ }; |
2539 |
+ |
2540 |
+ static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
2541 |
+@@ -10516,6 +10573,7 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = { |
2542 |
+ SND_PCI_QUIRK(0x1043, 0x15a7, "ASUS UX51VZH", ALC662_FIXUP_BASS_16), |
2543 |
+ SND_PCI_QUIRK(0x1043, 0x177d, "ASUS N551", ALC668_FIXUP_ASUS_Nx51), |
2544 |
+ SND_PCI_QUIRK(0x1043, 0x17bd, "ASUS N751", ALC668_FIXUP_ASUS_Nx51), |
2545 |
++ SND_PCI_QUIRK(0x1043, 0x185d, "ASUS G551JW", ALC668_FIXUP_ASUS_NO_HEADSET_MIC), |
2546 |
+ SND_PCI_QUIRK(0x1043, 0x1963, "ASUS X71SL", ALC662_FIXUP_ASUS_MODE8), |
2547 |
+ SND_PCI_QUIRK(0x1043, 0x1b73, "ASUS N55SF", ALC662_FIXUP_BASS_16), |
2548 |
+ SND_PCI_QUIRK(0x1043, 0x1bf3, "ASUS N76VZ", ALC662_FIXUP_BASS_MODE4_CHMAP), |
2549 |
+diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h |
2550 |
+index 5728bf722c88a..7c649cd380493 100644 |
2551 |
+--- a/sound/usb/quirks-table.h |
2552 |
++++ b/sound/usb/quirks-table.h |
2553 |
+@@ -77,6 +77,48 @@ |
2554 |
+ /* E-Mu 0204 USB */ |
2555 |
+ { USB_DEVICE_VENDOR_SPEC(0x041e, 0x3f19) }, |
2556 |
+ |
2557 |
++/* |
2558 |
++ * Creative Technology, Ltd Live! Cam Sync HD [VF0770] |
2559 |
++ * The device advertises 8 formats, but only a rate of 48kHz is honored by the |
2560 |
++ * hardware and 24 bits give chopped audio, so only report the one working |
2561 |
++ * combination. |
2562 |
++ */ |
2563 |
++{ |
2564 |
++ USB_DEVICE(0x041e, 0x4095), |
2565 |
++ .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { |
2566 |
++ .ifnum = QUIRK_ANY_INTERFACE, |
2567 |
++ .type = QUIRK_COMPOSITE, |
2568 |
++ .data = &(const struct snd_usb_audio_quirk[]) { |
2569 |
++ { |
2570 |
++ .ifnum = 2, |
2571 |
++ .type = QUIRK_AUDIO_STANDARD_MIXER, |
2572 |
++ }, |
2573 |
++ { |
2574 |
++ .ifnum = 3, |
2575 |
++ .type = QUIRK_AUDIO_FIXED_ENDPOINT, |
2576 |
++ .data = &(const struct audioformat) { |
2577 |
++ .formats = SNDRV_PCM_FMTBIT_S16_LE, |
2578 |
++ .channels = 2, |
2579 |
++ .fmt_bits = 16, |
2580 |
++ .iface = 3, |
2581 |
++ .altsetting = 4, |
2582 |
++ .altset_idx = 4, |
2583 |
++ .endpoint = 0x82, |
2584 |
++ .ep_attr = 0x05, |
2585 |
++ .rates = SNDRV_PCM_RATE_48000, |
2586 |
++ .rate_min = 48000, |
2587 |
++ .rate_max = 48000, |
2588 |
++ .nr_rates = 1, |
2589 |
++ .rate_table = (unsigned int[]) { 48000 }, |
2590 |
++ }, |
2591 |
++ }, |
2592 |
++ { |
2593 |
++ .ifnum = -1 |
2594 |
++ }, |
2595 |
++ }, |
2596 |
++ }, |
2597 |
++}, |
2598 |
++ |
2599 |
+ /* |
2600 |
+ * HP Wireless Audio |
2601 |
+ * When not ignored, causes instability issues for some users, forcing them to |