1 |
commit: f0692fef2ebc8ccdee5117b2b793b72a24c01158 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 17 14:55:20 2020 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 17 14:55:20 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f0692fef |
7 |
|
8 |
Linux patch 4.19.146 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1145_linux-4.19.146.patch | 3221 +++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 3225 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 7d78220..4416605 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -619,6 +619,10 @@ Patch: 1144_linux-4.19.145.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.19.145 |
23 |
|
24 |
+Patch: 1145_linux-4.19.146.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.19.146 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1145_linux-4.19.146.patch b/1145_linux-4.19.146.patch |
33 |
new file mode 100644 |
34 |
index 0000000..6b815f5 |
35 |
--- /dev/null |
36 |
+++ b/1145_linux-4.19.146.patch |
37 |
@@ -0,0 +1,3221 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 6bf851efcabe9..aaeb3f3dbcea8 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 19 |
46 |
+-SUBLEVEL = 145 |
47 |
++SUBLEVEL = 146 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = "People's Front" |
50 |
+ |
51 |
+diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts |
52 |
+index d131c54acd3ec..f6b6e3c9ca8aa 100644 |
53 |
+--- a/arch/arc/boot/dts/hsdk.dts |
54 |
++++ b/arch/arc/boot/dts/hsdk.dts |
55 |
+@@ -83,6 +83,8 @@ |
56 |
+ |
57 |
+ arcpct: pct { |
58 |
+ compatible = "snps,archs-pct"; |
59 |
++ interrupt-parent = <&cpu_intc>; |
60 |
++ interrupts = <20>; |
61 |
+ }; |
62 |
+ |
63 |
+ /* TIMER0 with interrupt for clockevent */ |
64 |
+@@ -173,7 +175,7 @@ |
65 |
+ reg = <0x8000 0x2000>; |
66 |
+ interrupts = <10>; |
67 |
+ interrupt-names = "macirq"; |
68 |
+- phy-mode = "rgmii"; |
69 |
++ phy-mode = "rgmii-id"; |
70 |
+ snps,pbl = <32>; |
71 |
+ snps,multicast-filter-bins = <256>; |
72 |
+ clocks = <&gmacclk>; |
73 |
+@@ -191,7 +193,7 @@ |
74 |
+ #address-cells = <1>; |
75 |
+ #size-cells = <0>; |
76 |
+ compatible = "snps,dwmac-mdio"; |
77 |
+- phy0: ethernet-phy@0 { |
78 |
++ phy0: ethernet-phy@0 { /* Micrel KSZ9031 */ |
79 |
+ reg = <0>; |
80 |
+ ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; |
81 |
+ ti,tx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; |
82 |
+diff --git a/arch/arc/plat-eznps/include/plat/ctop.h b/arch/arc/plat-eznps/include/plat/ctop.h |
83 |
+index 4f6a1673b3a6e..ddfca2c3357a0 100644 |
84 |
+--- a/arch/arc/plat-eznps/include/plat/ctop.h |
85 |
++++ b/arch/arc/plat-eznps/include/plat/ctop.h |
86 |
+@@ -43,7 +43,6 @@ |
87 |
+ #define CTOP_AUX_DPC (CTOP_AUX_BASE + 0x02C) |
88 |
+ #define CTOP_AUX_LPC (CTOP_AUX_BASE + 0x030) |
89 |
+ #define CTOP_AUX_EFLAGS (CTOP_AUX_BASE + 0x080) |
90 |
+-#define CTOP_AUX_IACK (CTOP_AUX_BASE + 0x088) |
91 |
+ #define CTOP_AUX_GPA1 (CTOP_AUX_BASE + 0x08C) |
92 |
+ #define CTOP_AUX_UDMC (CTOP_AUX_BASE + 0x300) |
93 |
+ |
94 |
+diff --git a/arch/arm/boot/dts/bcm-hr2.dtsi b/arch/arm/boot/dts/bcm-hr2.dtsi |
95 |
+index e35398cc60a06..dd71ab08136be 100644 |
96 |
+--- a/arch/arm/boot/dts/bcm-hr2.dtsi |
97 |
++++ b/arch/arm/boot/dts/bcm-hr2.dtsi |
98 |
+@@ -217,7 +217,7 @@ |
99 |
+ }; |
100 |
+ |
101 |
+ qspi: spi@27200 { |
102 |
+- compatible = "brcm,spi-bcm-qspi", "brcm,spi-nsp-qspi"; |
103 |
++ compatible = "brcm,spi-nsp-qspi", "brcm,spi-bcm-qspi"; |
104 |
+ reg = <0x027200 0x184>, |
105 |
+ <0x027000 0x124>, |
106 |
+ <0x11c408 0x004>, |
107 |
+diff --git a/arch/arm/boot/dts/bcm-nsp.dtsi b/arch/arm/boot/dts/bcm-nsp.dtsi |
108 |
+index 273a316045798..b395cb195db21 100644 |
109 |
+--- a/arch/arm/boot/dts/bcm-nsp.dtsi |
110 |
++++ b/arch/arm/boot/dts/bcm-nsp.dtsi |
111 |
+@@ -274,7 +274,7 @@ |
112 |
+ }; |
113 |
+ |
114 |
+ qspi: spi@27200 { |
115 |
+- compatible = "brcm,spi-bcm-qspi", "brcm,spi-nsp-qspi"; |
116 |
++ compatible = "brcm,spi-nsp-qspi", "brcm,spi-bcm-qspi"; |
117 |
+ reg = <0x027200 0x184>, |
118 |
+ <0x027000 0x124>, |
119 |
+ <0x11c408 0x004>, |
120 |
+diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi |
121 |
+index a678fb7c9e3b2..c91716d5980c3 100644 |
122 |
+--- a/arch/arm/boot/dts/bcm5301x.dtsi |
123 |
++++ b/arch/arm/boot/dts/bcm5301x.dtsi |
124 |
+@@ -445,7 +445,7 @@ |
125 |
+ }; |
126 |
+ |
127 |
+ spi@18029200 { |
128 |
+- compatible = "brcm,spi-bcm-qspi", "brcm,spi-nsp-qspi"; |
129 |
++ compatible = "brcm,spi-nsp-qspi", "brcm,spi-bcm-qspi"; |
130 |
+ reg = <0x18029200 0x184>, |
131 |
+ <0x18029000 0x124>, |
132 |
+ <0x1811b408 0x004>, |
133 |
+diff --git a/arch/arm/boot/dts/logicpd-som-lv-baseboard.dtsi b/arch/arm/boot/dts/logicpd-som-lv-baseboard.dtsi |
134 |
+index 3e39b9a1f35d0..0093548d50ff8 100644 |
135 |
+--- a/arch/arm/boot/dts/logicpd-som-lv-baseboard.dtsi |
136 |
++++ b/arch/arm/boot/dts/logicpd-som-lv-baseboard.dtsi |
137 |
+@@ -55,6 +55,8 @@ |
138 |
+ |
139 |
+ &mcbsp2 { |
140 |
+ status = "okay"; |
141 |
++ pinctrl-names = "default"; |
142 |
++ pinctrl-0 = <&mcbsp2_pins>; |
143 |
+ }; |
144 |
+ |
145 |
+ &charger { |
146 |
+diff --git a/arch/arm/boot/dts/logicpd-torpedo-baseboard.dtsi b/arch/arm/boot/dts/logicpd-torpedo-baseboard.dtsi |
147 |
+index 86c5644f558cb..032e8dde13817 100644 |
148 |
+--- a/arch/arm/boot/dts/logicpd-torpedo-baseboard.dtsi |
149 |
++++ b/arch/arm/boot/dts/logicpd-torpedo-baseboard.dtsi |
150 |
+@@ -84,6 +84,8 @@ |
151 |
+ }; |
152 |
+ |
153 |
+ &mcbsp2 { |
154 |
++ pinctrl-names = "default"; |
155 |
++ pinctrl-0 = <&mcbsp2_pins>; |
156 |
+ status = "okay"; |
157 |
+ }; |
158 |
+ |
159 |
+diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi |
160 |
+index d18c043264440..b66b2bd1aa856 100644 |
161 |
+--- a/arch/arm/boot/dts/ls1021a.dtsi |
162 |
++++ b/arch/arm/boot/dts/ls1021a.dtsi |
163 |
+@@ -168,7 +168,7 @@ |
164 |
+ #address-cells = <1>; |
165 |
+ #size-cells = <0>; |
166 |
+ reg = <0x0 0x1550000 0x0 0x10000>, |
167 |
+- <0x0 0x40000000 0x0 0x40000000>; |
168 |
++ <0x0 0x40000000 0x0 0x20000000>; |
169 |
+ reg-names = "QuadSPI", "QuadSPI-memory"; |
170 |
+ interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>; |
171 |
+ clock-names = "qspi_en", "qspi"; |
172 |
+diff --git a/arch/arm/boot/dts/socfpga_arria10.dtsi b/arch/arm/boot/dts/socfpga_arria10.dtsi |
173 |
+index ba5657574d9bb..4b1c8bec2de35 100644 |
174 |
+--- a/arch/arm/boot/dts/socfpga_arria10.dtsi |
175 |
++++ b/arch/arm/boot/dts/socfpga_arria10.dtsi |
176 |
+@@ -791,7 +791,7 @@ |
177 |
+ timer3: timer3@ffd00100 { |
178 |
+ compatible = "snps,dw-apb-timer"; |
179 |
+ interrupts = <0 118 IRQ_TYPE_LEVEL_HIGH>; |
180 |
+- reg = <0xffd01000 0x100>; |
181 |
++ reg = <0xffd00100 0x100>; |
182 |
+ clocks = <&l4_sys_free_clk>; |
183 |
+ clock-names = "timer"; |
184 |
+ }; |
185 |
+diff --git a/arch/arm/boot/dts/vfxxx.dtsi b/arch/arm/boot/dts/vfxxx.dtsi |
186 |
+index d392794d9c139..de81e8b4afde9 100644 |
187 |
+--- a/arch/arm/boot/dts/vfxxx.dtsi |
188 |
++++ b/arch/arm/boot/dts/vfxxx.dtsi |
189 |
+@@ -532,7 +532,7 @@ |
190 |
+ }; |
191 |
+ |
192 |
+ ocotp: ocotp@400a5000 { |
193 |
+- compatible = "fsl,vf610-ocotp"; |
194 |
++ compatible = "fsl,vf610-ocotp", "syscon"; |
195 |
+ reg = <0x400a5000 0x1000>; |
196 |
+ clocks = <&clks VF610_CLK_OCOTP>; |
197 |
+ }; |
198 |
+diff --git a/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi b/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi |
199 |
+index ea854f689fda8..6bfb7bbd264af 100644 |
200 |
+--- a/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi |
201 |
++++ b/arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi |
202 |
+@@ -745,7 +745,7 @@ |
203 |
+ }; |
204 |
+ |
205 |
+ qspi: spi@66470200 { |
206 |
+- compatible = "brcm,spi-bcm-qspi", "brcm,spi-ns2-qspi"; |
207 |
++ compatible = "brcm,spi-ns2-qspi", "brcm,spi-bcm-qspi"; |
208 |
+ reg = <0x66470200 0x184>, |
209 |
+ <0x66470000 0x124>, |
210 |
+ <0x67017408 0x004>, |
211 |
+diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig |
212 |
+index 4504380c7a922..60839eeada8b7 100644 |
213 |
+--- a/arch/powerpc/configs/pasemi_defconfig |
214 |
++++ b/arch/powerpc/configs/pasemi_defconfig |
215 |
+@@ -110,7 +110,6 @@ CONFIG_FB_NVIDIA=y |
216 |
+ CONFIG_FB_NVIDIA_I2C=y |
217 |
+ CONFIG_FB_RADEON=y |
218 |
+ # CONFIG_LCD_CLASS_DEVICE is not set |
219 |
+-CONFIG_VGACON_SOFT_SCROLLBACK=y |
220 |
+ CONFIG_LOGO=y |
221 |
+ CONFIG_SOUND=y |
222 |
+ CONFIG_SND=y |
223 |
+diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig |
224 |
+index 7032d4244ec5f..e30af76f47537 100644 |
225 |
+--- a/arch/powerpc/configs/ppc6xx_defconfig |
226 |
++++ b/arch/powerpc/configs/ppc6xx_defconfig |
227 |
+@@ -779,7 +779,6 @@ CONFIG_FB_TRIDENT=m |
228 |
+ CONFIG_FB_SM501=m |
229 |
+ CONFIG_FB_IBM_GXT4500=y |
230 |
+ CONFIG_LCD_PLATFORM=m |
231 |
+-CONFIG_VGACON_SOFT_SCROLLBACK=y |
232 |
+ CONFIG_FRAMEBUFFER_CONSOLE=y |
233 |
+ CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y |
234 |
+ CONFIG_LOGO=y |
235 |
+diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig |
236 |
+index ce75be940567e..5a23a4ccd7556 100644 |
237 |
+--- a/arch/x86/configs/i386_defconfig |
238 |
++++ b/arch/x86/configs/i386_defconfig |
239 |
+@@ -216,7 +216,6 @@ CONFIG_FB_MODE_HELPERS=y |
240 |
+ CONFIG_FB_TILEBLITTING=y |
241 |
+ CONFIG_FB_EFI=y |
242 |
+ # CONFIG_LCD_CLASS_DEVICE is not set |
243 |
+-CONFIG_VGACON_SOFT_SCROLLBACK=y |
244 |
+ CONFIG_LOGO=y |
245 |
+ # CONFIG_LOGO_LINUX_MONO is not set |
246 |
+ # CONFIG_LOGO_LINUX_VGA16 is not set |
247 |
+diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig |
248 |
+index 45b0f4d84d83b..dc08812929046 100644 |
249 |
+--- a/arch/x86/configs/x86_64_defconfig |
250 |
++++ b/arch/x86/configs/x86_64_defconfig |
251 |
+@@ -212,7 +212,6 @@ CONFIG_FB_MODE_HELPERS=y |
252 |
+ CONFIG_FB_TILEBLITTING=y |
253 |
+ CONFIG_FB_EFI=y |
254 |
+ # CONFIG_LCD_CLASS_DEVICE is not set |
255 |
+-CONFIG_VGACON_SOFT_SCROLLBACK=y |
256 |
+ CONFIG_LOGO=y |
257 |
+ # CONFIG_LOGO_LINUX_MONO is not set |
258 |
+ # CONFIG_LOGO_LINUX_VGA16 is not set |
259 |
+diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c |
260 |
+index 2f823f35dee50..d6bcbce6c15cb 100644 |
261 |
+--- a/arch/x86/kvm/vmx.c |
262 |
++++ b/arch/x86/kvm/vmx.c |
263 |
+@@ -10128,6 +10128,7 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu) |
264 |
+ (exit_reason != EXIT_REASON_EXCEPTION_NMI && |
265 |
+ exit_reason != EXIT_REASON_EPT_VIOLATION && |
266 |
+ exit_reason != EXIT_REASON_PML_FULL && |
267 |
++ exit_reason != EXIT_REASON_APIC_ACCESS && |
268 |
+ exit_reason != EXIT_REASON_TASK_SWITCH)) { |
269 |
+ vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; |
270 |
+ vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_DELIVERY_EV; |
271 |
+diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c |
272 |
+index 112b1001c2694..ef395b238816c 100644 |
273 |
+--- a/drivers/atm/firestream.c |
274 |
++++ b/drivers/atm/firestream.c |
275 |
+@@ -1013,6 +1013,7 @@ static int fs_open(struct atm_vcc *atm_vcc) |
276 |
+ error = make_rate (pcr, r, &tmc0, NULL); |
277 |
+ if (error) { |
278 |
+ kfree(tc); |
279 |
++ kfree(vcc); |
280 |
+ return error; |
281 |
+ } |
282 |
+ } |
283 |
+diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c |
284 |
+index 1101290971699..9f1265ce2e365 100644 |
285 |
+--- a/drivers/block/rbd.c |
286 |
++++ b/drivers/block/rbd.c |
287 |
+@@ -4124,6 +4124,9 @@ static ssize_t rbd_config_info_show(struct device *dev, |
288 |
+ { |
289 |
+ struct rbd_device *rbd_dev = dev_to_rbd_dev(dev); |
290 |
+ |
291 |
++ if (!capable(CAP_SYS_ADMIN)) |
292 |
++ return -EPERM; |
293 |
++ |
294 |
+ return sprintf(buf, "%s\n", rbd_dev->config_info); |
295 |
+ } |
296 |
+ |
297 |
+@@ -4235,6 +4238,9 @@ static ssize_t rbd_image_refresh(struct device *dev, |
298 |
+ struct rbd_device *rbd_dev = dev_to_rbd_dev(dev); |
299 |
+ int ret; |
300 |
+ |
301 |
++ if (!capable(CAP_SYS_ADMIN)) |
302 |
++ return -EPERM; |
303 |
++ |
304 |
+ ret = rbd_dev_refresh(rbd_dev); |
305 |
+ if (ret) |
306 |
+ return ret; |
307 |
+@@ -5846,6 +5852,9 @@ static ssize_t do_rbd_add(struct bus_type *bus, |
308 |
+ struct rbd_client *rbdc; |
309 |
+ int rc; |
310 |
+ |
311 |
++ if (!capable(CAP_SYS_ADMIN)) |
312 |
++ return -EPERM; |
313 |
++ |
314 |
+ if (!try_module_get(THIS_MODULE)) |
315 |
+ return -ENODEV; |
316 |
+ |
317 |
+@@ -5995,6 +6004,9 @@ static ssize_t do_rbd_remove(struct bus_type *bus, |
318 |
+ bool force = false; |
319 |
+ int ret; |
320 |
+ |
321 |
++ if (!capable(CAP_SYS_ADMIN)) |
322 |
++ return -EPERM; |
323 |
++ |
324 |
+ dev_id = -1; |
325 |
+ opt_buf[0] = '\0'; |
326 |
+ sscanf(buf, "%d %5s", &dev_id, opt_buf); |
327 |
+diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c |
328 |
+index 99166000ffb77..864a7e8ebdfc3 100644 |
329 |
+--- a/drivers/cpufreq/intel_pstate.c |
330 |
++++ b/drivers/cpufreq/intel_pstate.c |
331 |
+@@ -712,7 +712,7 @@ static void intel_pstate_get_hwp_max(unsigned int cpu, int *phy_max, |
332 |
+ |
333 |
+ rdmsrl_on_cpu(cpu, MSR_HWP_CAPABILITIES, &cap); |
334 |
+ WRITE_ONCE(all_cpu_data[cpu]->hwp_cap_cached, cap); |
335 |
+- if (global.no_turbo) |
336 |
++ if (global.no_turbo || global.turbo_disabled) |
337 |
+ *current_max = HWP_GUARANTEED_PERF(cap); |
338 |
+ else |
339 |
+ *current_max = HWP_HIGHEST_PERF(cap); |
340 |
+@@ -2325,9 +2325,15 @@ static int intel_pstate_update_status(const char *buf, size_t size) |
341 |
+ { |
342 |
+ int ret; |
343 |
+ |
344 |
+- if (size == 3 && !strncmp(buf, "off", size)) |
345 |
+- return intel_pstate_driver ? |
346 |
+- intel_pstate_unregister_driver() : -EINVAL; |
347 |
++ if (size == 3 && !strncmp(buf, "off", size)) { |
348 |
++ if (!intel_pstate_driver) |
349 |
++ return -EINVAL; |
350 |
++ |
351 |
++ if (hwp_active) |
352 |
++ return -EBUSY; |
353 |
++ |
354 |
++ return intel_pstate_unregister_driver(); |
355 |
++ } |
356 |
+ |
357 |
+ if (size == 6 && !strncmp(buf, "active", size)) { |
358 |
+ if (intel_pstate_driver) { |
359 |
+diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c |
360 |
+index 4a748c3435d7d..8d99c84361cbb 100644 |
361 |
+--- a/drivers/dma/acpi-dma.c |
362 |
++++ b/drivers/dma/acpi-dma.c |
363 |
+@@ -131,11 +131,13 @@ static void acpi_dma_parse_csrt(struct acpi_device *adev, struct acpi_dma *adma) |
364 |
+ if (ret < 0) { |
365 |
+ dev_warn(&adev->dev, |
366 |
+ "error in parsing resource group\n"); |
367 |
+- return; |
368 |
++ break; |
369 |
+ } |
370 |
+ |
371 |
+ grp = (struct acpi_csrt_group *)((void *)grp + grp->length); |
372 |
+ } |
373 |
++ |
374 |
++ acpi_put_table((struct acpi_table_header *)csrt); |
375 |
+ } |
376 |
+ |
377 |
+ /** |
378 |
+diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c |
379 |
+index 219440bebd052..72c0a2ae2dd4f 100644 |
380 |
+--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c |
381 |
++++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c |
382 |
+@@ -3566,7 +3566,8 @@ static int smu7_read_sensor(struct pp_hwmgr *hwmgr, int idx, |
383 |
+ case AMDGPU_PP_SENSOR_GPU_POWER: |
384 |
+ return smu7_get_gpu_power(hwmgr, (uint32_t *)value); |
385 |
+ case AMDGPU_PP_SENSOR_VDDGFX: |
386 |
+- if ((data->vr_config & 0xff) == 0x2) |
387 |
++ if ((data->vr_config & VRCONF_VDDGFX_MASK) == |
388 |
++ (VR_SVI2_PLANE_2 << VRCONF_VDDGFX_SHIFT)) |
389 |
+ val_vid = PHM_READ_INDIRECT_FIELD(hwmgr->device, |
390 |
+ CGS_IND_REG__SMC, PWR_SVI2_STATUS, PLANE2_VID); |
391 |
+ else |
392 |
+diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c |
393 |
+index ba6f3c14495c0..1fc9a7fa37b45 100644 |
394 |
+--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c |
395 |
++++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c |
396 |
+@@ -1518,7 +1518,8 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) |
397 |
+ |
398 |
+ check_speed_bin(&pdev->dev); |
399 |
+ |
400 |
+- ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, 4); |
401 |
++ /* Restricting nr_rings to 1 to temporarily disable preemption */ |
402 |
++ ret = adreno_gpu_init(dev, pdev, adreno_gpu, &funcs, 1); |
403 |
+ if (ret) { |
404 |
+ a5xx_destroy(&(a5xx_gpu->base.base)); |
405 |
+ return ERR_PTR(ret); |
406 |
+diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c |
407 |
+index 79eb11cd185d1..9a5584efd5e78 100644 |
408 |
+--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c |
409 |
++++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c |
410 |
+@@ -761,7 +761,7 @@ static int sun6i_dsi_dcs_write_long(struct sun6i_dsi *dsi, |
411 |
+ regmap_write(dsi->regs, SUN6I_DSI_CMD_TX_REG(0), |
412 |
+ sun6i_dsi_dcs_build_pkt_hdr(dsi, msg)); |
413 |
+ |
414 |
+- bounce = kzalloc(msg->tx_len + sizeof(crc), GFP_KERNEL); |
415 |
++ bounce = kzalloc(ALIGN(msg->tx_len + sizeof(crc), 4), GFP_KERNEL); |
416 |
+ if (!bounce) |
417 |
+ return -ENOMEM; |
418 |
+ |
419 |
+@@ -772,7 +772,7 @@ static int sun6i_dsi_dcs_write_long(struct sun6i_dsi *dsi, |
420 |
+ memcpy((u8 *)bounce + msg->tx_len, &crc, sizeof(crc)); |
421 |
+ len += sizeof(crc); |
422 |
+ |
423 |
+- regmap_bulk_write(dsi->regs, SUN6I_DSI_CMD_TX_REG(1), bounce, len); |
424 |
++ regmap_bulk_write(dsi->regs, SUN6I_DSI_CMD_TX_REG(1), bounce, DIV_ROUND_UP(len, 4)); |
425 |
+ regmap_write(dsi->regs, SUN6I_DSI_CMD_CTL_REG, len + 4 - 1); |
426 |
+ kfree(bounce); |
427 |
+ |
428 |
+diff --git a/drivers/gpu/drm/tve200/tve200_display.c b/drivers/gpu/drm/tve200/tve200_display.c |
429 |
+index e8723a2412a6f..c0b113ba329c2 100644 |
430 |
+--- a/drivers/gpu/drm/tve200/tve200_display.c |
431 |
++++ b/drivers/gpu/drm/tve200/tve200_display.c |
432 |
+@@ -17,6 +17,7 @@ |
433 |
+ #include <linux/version.h> |
434 |
+ #include <linux/dma-buf.h> |
435 |
+ #include <linux/of_graph.h> |
436 |
++#include <linux/delay.h> |
437 |
+ |
438 |
+ #include <drm/drmP.h> |
439 |
+ #include <drm/drm_panel.h> |
440 |
+@@ -132,9 +133,25 @@ static void tve200_display_enable(struct drm_simple_display_pipe *pipe, |
441 |
+ struct drm_connector *connector = priv->connector; |
442 |
+ u32 format = fb->format->format; |
443 |
+ u32 ctrl1 = 0; |
444 |
++ int retries; |
445 |
+ |
446 |
+ clk_prepare_enable(priv->clk); |
447 |
+ |
448 |
++ /* Reset the TVE200 and wait for it to come back online */ |
449 |
++ writel(TVE200_CTRL_4_RESET, priv->regs + TVE200_CTRL_4); |
450 |
++ for (retries = 0; retries < 5; retries++) { |
451 |
++ usleep_range(30000, 50000); |
452 |
++ if (readl(priv->regs + TVE200_CTRL_4) & TVE200_CTRL_4_RESET) |
453 |
++ continue; |
454 |
++ else |
455 |
++ break; |
456 |
++ } |
457 |
++ if (retries == 5 && |
458 |
++ readl(priv->regs + TVE200_CTRL_4) & TVE200_CTRL_4_RESET) { |
459 |
++ dev_err(drm->dev, "can't get hardware out of reset\n"); |
460 |
++ return; |
461 |
++ } |
462 |
++ |
463 |
+ /* Function 1 */ |
464 |
+ ctrl1 |= TVE200_CTRL_CSMODE; |
465 |
+ /* Interlace mode for CCIR656: parameterize? */ |
466 |
+@@ -231,8 +248,9 @@ static void tve200_display_disable(struct drm_simple_display_pipe *pipe) |
467 |
+ |
468 |
+ drm_crtc_vblank_off(crtc); |
469 |
+ |
470 |
+- /* Disable and Power Down */ |
471 |
++ /* Disable put into reset and Power Down */ |
472 |
+ writel(0, priv->regs + TVE200_CTRL); |
473 |
++ writel(TVE200_CTRL_4_RESET, priv->regs + TVE200_CTRL_4); |
474 |
+ |
475 |
+ clk_disable_unprepare(priv->clk); |
476 |
+ } |
477 |
+@@ -280,6 +298,8 @@ static int tve200_display_enable_vblank(struct drm_simple_display_pipe *pipe) |
478 |
+ struct drm_device *drm = crtc->dev; |
479 |
+ struct tve200_drm_dev_private *priv = drm->dev_private; |
480 |
+ |
481 |
++ /* Clear any IRQs and enable */ |
482 |
++ writel(0xFF, priv->regs + TVE200_INT_CLR); |
483 |
+ writel(TVE200_INT_V_STATUS, priv->regs + TVE200_INT_EN); |
484 |
+ return 0; |
485 |
+ } |
486 |
+diff --git a/drivers/hid/hid-elan.c b/drivers/hid/hid-elan.c |
487 |
+index 07e26c3567eb9..6346282e0ff05 100644 |
488 |
+--- a/drivers/hid/hid-elan.c |
489 |
++++ b/drivers/hid/hid-elan.c |
490 |
+@@ -192,6 +192,7 @@ static int elan_input_configured(struct hid_device *hdev, struct hid_input *hi) |
491 |
+ ret = input_mt_init_slots(input, ELAN_MAX_FINGERS, INPUT_MT_POINTER); |
492 |
+ if (ret) { |
493 |
+ hid_err(hdev, "Failed to init elan MT slots: %d\n", ret); |
494 |
++ input_free_device(input); |
495 |
+ return ret; |
496 |
+ } |
497 |
+ |
498 |
+@@ -202,6 +203,7 @@ static int elan_input_configured(struct hid_device *hdev, struct hid_input *hi) |
499 |
+ if (ret) { |
500 |
+ hid_err(hdev, "Failed to register elan input device: %d\n", |
501 |
+ ret); |
502 |
++ input_mt_destroy_slots(input); |
503 |
+ input_free_device(input); |
504 |
+ return ret; |
505 |
+ } |
506 |
+diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h |
507 |
+index 2c100b73d3fc1..e18d796d985f8 100644 |
508 |
+--- a/drivers/hid/hid-ids.h |
509 |
++++ b/drivers/hid/hid-ids.h |
510 |
+@@ -985,6 +985,8 @@ |
511 |
+ #define USB_DEVICE_ID_SAITEK_RAT9 0x0cfa |
512 |
+ #define USB_DEVICE_ID_SAITEK_MMO7 0x0cd0 |
513 |
+ #define USB_DEVICE_ID_SAITEK_X52 0x075c |
514 |
++#define USB_DEVICE_ID_SAITEK_X52_2 0x0255 |
515 |
++#define USB_DEVICE_ID_SAITEK_X52_PRO 0x0762 |
516 |
+ |
517 |
+ #define USB_VENDOR_ID_SAMSUNG 0x0419 |
518 |
+ #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001 |
519 |
+diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c |
520 |
+index 62f87f8bd9720..2d8d20a7f4574 100644 |
521 |
+--- a/drivers/hid/hid-quirks.c |
522 |
++++ b/drivers/hid/hid-quirks.c |
523 |
+@@ -147,6 +147,8 @@ static const struct hid_device_id hid_quirks[] = { |
524 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_RETROUSB, USB_DEVICE_ID_RETROUSB_SNES_RETROPORT), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE }, |
525 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD), HID_QUIRK_BADPAD }, |
526 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_X52), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE }, |
527 |
++ { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_X52_2), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE }, |
528 |
++ { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_X52_PRO), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE }, |
529 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD2), HID_QUIRK_NO_INIT_REPORTS }, |
530 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD), HID_QUIRK_NO_INIT_REPORTS }, |
531 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB), HID_QUIRK_NOGET }, |
532 |
+diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c |
533 |
+index cb8c98a440109..e029d4b0f7afd 100644 |
534 |
+--- a/drivers/iio/accel/bmc150-accel-core.c |
535 |
++++ b/drivers/iio/accel/bmc150-accel-core.c |
536 |
+@@ -197,6 +197,14 @@ struct bmc150_accel_data { |
537 |
+ struct mutex mutex; |
538 |
+ u8 fifo_mode, watermark; |
539 |
+ s16 buffer[8]; |
540 |
++ /* |
541 |
++ * Ensure there is sufficient space and correct alignment for |
542 |
++ * the timestamp if enabled |
543 |
++ */ |
544 |
++ struct { |
545 |
++ __le16 channels[3]; |
546 |
++ s64 ts __aligned(8); |
547 |
++ } scan; |
548 |
+ u8 bw_bits; |
549 |
+ u32 slope_dur; |
550 |
+ u32 slope_thres; |
551 |
+@@ -915,15 +923,16 @@ static int __bmc150_accel_fifo_flush(struct iio_dev *indio_dev, |
552 |
+ * now. |
553 |
+ */ |
554 |
+ for (i = 0; i < count; i++) { |
555 |
+- u16 sample[8]; |
556 |
+ int j, bit; |
557 |
+ |
558 |
+ j = 0; |
559 |
+ for_each_set_bit(bit, indio_dev->active_scan_mask, |
560 |
+ indio_dev->masklength) |
561 |
+- memcpy(&sample[j++], &buffer[i * 3 + bit], 2); |
562 |
++ memcpy(&data->scan.channels[j++], &buffer[i * 3 + bit], |
563 |
++ sizeof(data->scan.channels[0])); |
564 |
+ |
565 |
+- iio_push_to_buffers_with_timestamp(indio_dev, sample, tstamp); |
566 |
++ iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, |
567 |
++ tstamp); |
568 |
+ |
569 |
+ tstamp += sample_period; |
570 |
+ } |
571 |
+diff --git a/drivers/iio/accel/kxsd9.c b/drivers/iio/accel/kxsd9.c |
572 |
+index 0c0df4fce4206..f74cb2e082a67 100644 |
573 |
+--- a/drivers/iio/accel/kxsd9.c |
574 |
++++ b/drivers/iio/accel/kxsd9.c |
575 |
+@@ -212,14 +212,20 @@ static irqreturn_t kxsd9_trigger_handler(int irq, void *p) |
576 |
+ const struct iio_poll_func *pf = p; |
577 |
+ struct iio_dev *indio_dev = pf->indio_dev; |
578 |
+ struct kxsd9_state *st = iio_priv(indio_dev); |
579 |
++ /* |
580 |
++ * Ensure correct positioning and alignment of timestamp. |
581 |
++ * No need to zero initialize as all elements written. |
582 |
++ */ |
583 |
++ struct { |
584 |
++ __be16 chan[4]; |
585 |
++ s64 ts __aligned(8); |
586 |
++ } hw_values; |
587 |
+ int ret; |
588 |
+- /* 4 * 16bit values AND timestamp */ |
589 |
+- __be16 hw_values[8]; |
590 |
+ |
591 |
+ ret = regmap_bulk_read(st->map, |
592 |
+ KXSD9_REG_X, |
593 |
+- &hw_values, |
594 |
+- 8); |
595 |
++ hw_values.chan, |
596 |
++ sizeof(hw_values.chan)); |
597 |
+ if (ret) { |
598 |
+ dev_err(st->dev, |
599 |
+ "error reading data\n"); |
600 |
+@@ -227,7 +233,7 @@ static irqreturn_t kxsd9_trigger_handler(int irq, void *p) |
601 |
+ } |
602 |
+ |
603 |
+ iio_push_to_buffers_with_timestamp(indio_dev, |
604 |
+- hw_values, |
605 |
++ &hw_values, |
606 |
+ iio_get_time_ns(indio_dev)); |
607 |
+ iio_trigger_notify_done(indio_dev->trig); |
608 |
+ |
609 |
+diff --git a/drivers/iio/accel/mma7455_core.c b/drivers/iio/accel/mma7455_core.c |
610 |
+index da0ceaac46b53..a3b5d5780bc8f 100644 |
611 |
+--- a/drivers/iio/accel/mma7455_core.c |
612 |
++++ b/drivers/iio/accel/mma7455_core.c |
613 |
+@@ -55,6 +55,14 @@ |
614 |
+ |
615 |
+ struct mma7455_data { |
616 |
+ struct regmap *regmap; |
617 |
++ /* |
618 |
++ * Used to reorganize data. Will ensure correct alignment of |
619 |
++ * the timestamp if present |
620 |
++ */ |
621 |
++ struct { |
622 |
++ __le16 channels[3]; |
623 |
++ s64 ts __aligned(8); |
624 |
++ } scan; |
625 |
+ }; |
626 |
+ |
627 |
+ static int mma7455_drdy(struct mma7455_data *mma7455) |
628 |
+@@ -85,19 +93,19 @@ static irqreturn_t mma7455_trigger_handler(int irq, void *p) |
629 |
+ struct iio_poll_func *pf = p; |
630 |
+ struct iio_dev *indio_dev = pf->indio_dev; |
631 |
+ struct mma7455_data *mma7455 = iio_priv(indio_dev); |
632 |
+- u8 buf[16]; /* 3 x 16-bit channels + padding + ts */ |
633 |
+ int ret; |
634 |
+ |
635 |
+ ret = mma7455_drdy(mma7455); |
636 |
+ if (ret) |
637 |
+ goto done; |
638 |
+ |
639 |
+- ret = regmap_bulk_read(mma7455->regmap, MMA7455_REG_XOUTL, buf, |
640 |
+- sizeof(__le16) * 3); |
641 |
++ ret = regmap_bulk_read(mma7455->regmap, MMA7455_REG_XOUTL, |
642 |
++ mma7455->scan.channels, |
643 |
++ sizeof(mma7455->scan.channels)); |
644 |
+ if (ret) |
645 |
+ goto done; |
646 |
+ |
647 |
+- iio_push_to_buffers_with_timestamp(indio_dev, buf, |
648 |
++ iio_push_to_buffers_with_timestamp(indio_dev, &mma7455->scan, |
649 |
+ iio_get_time_ns(indio_dev)); |
650 |
+ |
651 |
+ done: |
652 |
+diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c |
653 |
+index fcfec758fec63..15c254b4745cc 100644 |
654 |
+--- a/drivers/iio/accel/mma8452.c |
655 |
++++ b/drivers/iio/accel/mma8452.c |
656 |
+@@ -107,6 +107,12 @@ struct mma8452_data { |
657 |
+ u8 data_cfg; |
658 |
+ const struct mma_chip_info *chip_info; |
659 |
+ int sleep_val; |
660 |
++ |
661 |
++ /* Ensure correct alignment of time stamp when present */ |
662 |
++ struct { |
663 |
++ __be16 channels[3]; |
664 |
++ s64 ts __aligned(8); |
665 |
++ } buffer; |
666 |
+ }; |
667 |
+ |
668 |
+ /** |
669 |
+@@ -1088,14 +1094,13 @@ static irqreturn_t mma8452_trigger_handler(int irq, void *p) |
670 |
+ struct iio_poll_func *pf = p; |
671 |
+ struct iio_dev *indio_dev = pf->indio_dev; |
672 |
+ struct mma8452_data *data = iio_priv(indio_dev); |
673 |
+- u8 buffer[16]; /* 3 16-bit channels + padding + ts */ |
674 |
+ int ret; |
675 |
+ |
676 |
+- ret = mma8452_read(data, (__be16 *)buffer); |
677 |
++ ret = mma8452_read(data, data->buffer.channels); |
678 |
+ if (ret < 0) |
679 |
+ goto done; |
680 |
+ |
681 |
+- iio_push_to_buffers_with_timestamp(indio_dev, buffer, |
682 |
++ iio_push_to_buffers_with_timestamp(indio_dev, &data->buffer, |
683 |
+ iio_get_time_ns(indio_dev)); |
684 |
+ |
685 |
+ done: |
686 |
+diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c |
687 |
+index d1239624187da..1ab106b3d3a6b 100644 |
688 |
+--- a/drivers/iio/adc/ina2xx-adc.c |
689 |
++++ b/drivers/iio/adc/ina2xx-adc.c |
690 |
+@@ -146,6 +146,11 @@ struct ina2xx_chip_info { |
691 |
+ int range_vbus; /* Bus voltage maximum in V */ |
692 |
+ int pga_gain_vshunt; /* Shunt voltage PGA gain */ |
693 |
+ bool allow_async_readout; |
694 |
++ /* data buffer needs space for channel data and timestamp */ |
695 |
++ struct { |
696 |
++ u16 chan[4]; |
697 |
++ u64 ts __aligned(8); |
698 |
++ } scan; |
699 |
+ }; |
700 |
+ |
701 |
+ static const struct ina2xx_config ina2xx_config[] = { |
702 |
+@@ -736,8 +741,6 @@ static int ina2xx_conversion_ready(struct iio_dev *indio_dev) |
703 |
+ static int ina2xx_work_buffer(struct iio_dev *indio_dev) |
704 |
+ { |
705 |
+ struct ina2xx_chip_info *chip = iio_priv(indio_dev); |
706 |
+- /* data buffer needs space for channel data and timestap */ |
707 |
+- unsigned short data[4 + sizeof(s64)/sizeof(short)]; |
708 |
+ int bit, ret, i = 0; |
709 |
+ s64 time; |
710 |
+ |
711 |
+@@ -756,10 +759,10 @@ static int ina2xx_work_buffer(struct iio_dev *indio_dev) |
712 |
+ if (ret < 0) |
713 |
+ return ret; |
714 |
+ |
715 |
+- data[i++] = val; |
716 |
++ chip->scan.chan[i++] = val; |
717 |
+ } |
718 |
+ |
719 |
+- iio_push_to_buffers_with_timestamp(indio_dev, data, time); |
720 |
++ iio_push_to_buffers_with_timestamp(indio_dev, &chip->scan, time); |
721 |
+ |
722 |
+ return 0; |
723 |
+ }; |
724 |
+diff --git a/drivers/iio/adc/max1118.c b/drivers/iio/adc/max1118.c |
725 |
+index 49db9e9ae625c..b372b226ac203 100644 |
726 |
+--- a/drivers/iio/adc/max1118.c |
727 |
++++ b/drivers/iio/adc/max1118.c |
728 |
+@@ -38,6 +38,11 @@ struct max1118 { |
729 |
+ struct spi_device *spi; |
730 |
+ struct mutex lock; |
731 |
+ struct regulator *reg; |
732 |
++ /* Ensure natural alignment of buffer elements */ |
733 |
++ struct { |
734 |
++ u8 channels[2]; |
735 |
++ s64 ts __aligned(8); |
736 |
++ } scan; |
737 |
+ |
738 |
+ u8 data ____cacheline_aligned; |
739 |
+ }; |
740 |
+@@ -162,7 +167,6 @@ static irqreturn_t max1118_trigger_handler(int irq, void *p) |
741 |
+ struct iio_poll_func *pf = p; |
742 |
+ struct iio_dev *indio_dev = pf->indio_dev; |
743 |
+ struct max1118 *adc = iio_priv(indio_dev); |
744 |
+- u8 data[16] = { }; /* 2x 8-bit ADC data + padding + 8 bytes timestamp */ |
745 |
+ int scan_index; |
746 |
+ int i = 0; |
747 |
+ |
748 |
+@@ -180,10 +184,10 @@ static irqreturn_t max1118_trigger_handler(int irq, void *p) |
749 |
+ goto out; |
750 |
+ } |
751 |
+ |
752 |
+- data[i] = ret; |
753 |
++ adc->scan.channels[i] = ret; |
754 |
+ i++; |
755 |
+ } |
756 |
+- iio_push_to_buffers_with_timestamp(indio_dev, data, |
757 |
++ iio_push_to_buffers_with_timestamp(indio_dev, &adc->scan, |
758 |
+ iio_get_time_ns(indio_dev)); |
759 |
+ out: |
760 |
+ mutex_unlock(&adc->lock); |
761 |
+diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c |
762 |
+index 819f260115005..4ee4ca35c2550 100644 |
763 |
+--- a/drivers/iio/adc/mcp3422.c |
764 |
++++ b/drivers/iio/adc/mcp3422.c |
765 |
+@@ -99,16 +99,12 @@ static int mcp3422_update_config(struct mcp3422 *adc, u8 newconfig) |
766 |
+ { |
767 |
+ int ret; |
768 |
+ |
769 |
+- mutex_lock(&adc->lock); |
770 |
+- |
771 |
+ ret = i2c_master_send(adc->i2c, &newconfig, 1); |
772 |
+ if (ret > 0) { |
773 |
+ adc->config = newconfig; |
774 |
+ ret = 0; |
775 |
+ } |
776 |
+ |
777 |
+- mutex_unlock(&adc->lock); |
778 |
+- |
779 |
+ return ret; |
780 |
+ } |
781 |
+ |
782 |
+@@ -141,6 +137,8 @@ static int mcp3422_read_channel(struct mcp3422 *adc, |
783 |
+ u8 config; |
784 |
+ u8 req_channel = channel->channel; |
785 |
+ |
786 |
++ mutex_lock(&adc->lock); |
787 |
++ |
788 |
+ if (req_channel != MCP3422_CHANNEL(adc->config)) { |
789 |
+ config = adc->config; |
790 |
+ config &= ~MCP3422_CHANNEL_MASK; |
791 |
+@@ -148,12 +146,18 @@ static int mcp3422_read_channel(struct mcp3422 *adc, |
792 |
+ config &= ~MCP3422_PGA_MASK; |
793 |
+ config |= MCP3422_PGA_VALUE(adc->pga[req_channel]); |
794 |
+ ret = mcp3422_update_config(adc, config); |
795 |
+- if (ret < 0) |
796 |
++ if (ret < 0) { |
797 |
++ mutex_unlock(&adc->lock); |
798 |
+ return ret; |
799 |
++ } |
800 |
+ msleep(mcp3422_read_times[MCP3422_SAMPLE_RATE(adc->config)]); |
801 |
+ } |
802 |
+ |
803 |
+- return mcp3422_read(adc, value, &config); |
804 |
++ ret = mcp3422_read(adc, value, &config); |
805 |
++ |
806 |
++ mutex_unlock(&adc->lock); |
807 |
++ |
808 |
++ return ret; |
809 |
+ } |
810 |
+ |
811 |
+ static int mcp3422_read_raw(struct iio_dev *iio, |
812 |
+diff --git a/drivers/iio/adc/ti-adc081c.c b/drivers/iio/adc/ti-adc081c.c |
813 |
+index 405e3779c0c56..ef95363ebac2a 100644 |
814 |
+--- a/drivers/iio/adc/ti-adc081c.c |
815 |
++++ b/drivers/iio/adc/ti-adc081c.c |
816 |
+@@ -36,6 +36,12 @@ struct adc081c { |
817 |
+ |
818 |
+ /* 8, 10 or 12 */ |
819 |
+ int bits; |
820 |
++ |
821 |
++ /* Ensure natural alignment of buffer elements */ |
822 |
++ struct { |
823 |
++ u16 channel; |
824 |
++ s64 ts __aligned(8); |
825 |
++ } scan; |
826 |
+ }; |
827 |
+ |
828 |
+ #define REG_CONV_RES 0x00 |
829 |
+@@ -131,14 +137,13 @@ static irqreturn_t adc081c_trigger_handler(int irq, void *p) |
830 |
+ struct iio_poll_func *pf = p; |
831 |
+ struct iio_dev *indio_dev = pf->indio_dev; |
832 |
+ struct adc081c *data = iio_priv(indio_dev); |
833 |
+- u16 buf[8]; /* 2 bytes data + 6 bytes padding + 8 bytes timestamp */ |
834 |
+ int ret; |
835 |
+ |
836 |
+ ret = i2c_smbus_read_word_swapped(data->i2c, REG_CONV_RES); |
837 |
+ if (ret < 0) |
838 |
+ goto out; |
839 |
+- buf[0] = ret; |
840 |
+- iio_push_to_buffers_with_timestamp(indio_dev, buf, |
841 |
++ data->scan.channel = ret; |
842 |
++ iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, |
843 |
+ iio_get_time_ns(indio_dev)); |
844 |
+ out: |
845 |
+ iio_trigger_notify_done(indio_dev->trig); |
846 |
+diff --git a/drivers/iio/adc/ti-adc084s021.c b/drivers/iio/adc/ti-adc084s021.c |
847 |
+index 25504640e1261..ec490e7a5b737 100644 |
848 |
+--- a/drivers/iio/adc/ti-adc084s021.c |
849 |
++++ b/drivers/iio/adc/ti-adc084s021.c |
850 |
+@@ -28,6 +28,11 @@ struct adc084s021 { |
851 |
+ struct spi_transfer spi_trans; |
852 |
+ struct regulator *reg; |
853 |
+ struct mutex lock; |
854 |
++ /* Buffer used to align data */ |
855 |
++ struct { |
856 |
++ __be16 channels[4]; |
857 |
++ s64 ts __aligned(8); |
858 |
++ } scan; |
859 |
+ /* |
860 |
+ * DMA (thus cache coherency maintenance) requires the |
861 |
+ * transfer buffers to live in their own cache line. |
862 |
+@@ -143,14 +148,13 @@ static irqreturn_t adc084s021_buffer_trigger_handler(int irq, void *pollfunc) |
863 |
+ struct iio_poll_func *pf = pollfunc; |
864 |
+ struct iio_dev *indio_dev = pf->indio_dev; |
865 |
+ struct adc084s021 *adc = iio_priv(indio_dev); |
866 |
+- __be16 data[8] = {0}; /* 4 * 16-bit words of data + 8 bytes timestamp */ |
867 |
+ |
868 |
+ mutex_lock(&adc->lock); |
869 |
+ |
870 |
+- if (adc084s021_adc_conversion(adc, &data) < 0) |
871 |
++ if (adc084s021_adc_conversion(adc, adc->scan.channels) < 0) |
872 |
+ dev_err(&adc->spi->dev, "Failed to read data\n"); |
873 |
+ |
874 |
+- iio_push_to_buffers_with_timestamp(indio_dev, data, |
875 |
++ iio_push_to_buffers_with_timestamp(indio_dev, &adc->scan, |
876 |
+ iio_get_time_ns(indio_dev)); |
877 |
+ mutex_unlock(&adc->lock); |
878 |
+ iio_trigger_notify_done(indio_dev->trig); |
879 |
+diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c |
880 |
+index 6a114dcb4a3a7..dc8d859e4b92c 100644 |
881 |
+--- a/drivers/iio/adc/ti-ads1015.c |
882 |
++++ b/drivers/iio/adc/ti-ads1015.c |
883 |
+@@ -312,6 +312,7 @@ static const struct iio_chan_spec ads1115_channels[] = { |
884 |
+ IIO_CHAN_SOFT_TIMESTAMP(ADS1015_TIMESTAMP), |
885 |
+ }; |
886 |
+ |
887 |
++#ifdef CONFIG_PM |
888 |
+ static int ads1015_set_power_state(struct ads1015_data *data, bool on) |
889 |
+ { |
890 |
+ int ret; |
891 |
+@@ -329,6 +330,15 @@ static int ads1015_set_power_state(struct ads1015_data *data, bool on) |
892 |
+ return ret < 0 ? ret : 0; |
893 |
+ } |
894 |
+ |
895 |
++#else /* !CONFIG_PM */ |
896 |
++ |
897 |
++static int ads1015_set_power_state(struct ads1015_data *data, bool on) |
898 |
++{ |
899 |
++ return 0; |
900 |
++} |
901 |
++ |
902 |
++#endif /* !CONFIG_PM */ |
903 |
++ |
904 |
+ static |
905 |
+ int ads1015_get_adc_result(struct ads1015_data *data, int chan, int *val) |
906 |
+ { |
907 |
+diff --git a/drivers/iio/chemical/ccs811.c b/drivers/iio/chemical/ccs811.c |
908 |
+index b4a46eb457893..46d5d48b58b6c 100644 |
909 |
+--- a/drivers/iio/chemical/ccs811.c |
910 |
++++ b/drivers/iio/chemical/ccs811.c |
911 |
+@@ -78,6 +78,11 @@ struct ccs811_data { |
912 |
+ struct ccs811_reading buffer; |
913 |
+ struct iio_trigger *drdy_trig; |
914 |
+ bool drdy_trig_on; |
915 |
++ /* Ensures correct alignment of timestamp if present */ |
916 |
++ struct { |
917 |
++ s16 channels[2]; |
918 |
++ s64 ts __aligned(8); |
919 |
++ } scan; |
920 |
+ }; |
921 |
+ |
922 |
+ static const struct iio_chan_spec ccs811_channels[] = { |
923 |
+@@ -309,17 +314,17 @@ static irqreturn_t ccs811_trigger_handler(int irq, void *p) |
924 |
+ struct iio_dev *indio_dev = pf->indio_dev; |
925 |
+ struct ccs811_data *data = iio_priv(indio_dev); |
926 |
+ struct i2c_client *client = data->client; |
927 |
+- s16 buf[8]; /* s16 eCO2 + s16 TVOC + padding + 8 byte timestamp */ |
928 |
+ int ret; |
929 |
+ |
930 |
+- ret = i2c_smbus_read_i2c_block_data(client, CCS811_ALG_RESULT_DATA, 4, |
931 |
+- (u8 *)&buf); |
932 |
++ ret = i2c_smbus_read_i2c_block_data(client, CCS811_ALG_RESULT_DATA, |
933 |
++ sizeof(data->scan.channels), |
934 |
++ (u8 *)data->scan.channels); |
935 |
+ if (ret != 4) { |
936 |
+ dev_err(&client->dev, "cannot read sensor data\n"); |
937 |
+ goto err; |
938 |
+ } |
939 |
+ |
940 |
+- iio_push_to_buffers_with_timestamp(indio_dev, buf, |
941 |
++ iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, |
942 |
+ iio_get_time_ns(indio_dev)); |
943 |
+ |
944 |
+ err: |
945 |
+diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c |
946 |
+index 830a2d45aa4dd..947f17588024a 100644 |
947 |
+--- a/drivers/iio/light/ltr501.c |
948 |
++++ b/drivers/iio/light/ltr501.c |
949 |
+@@ -1245,13 +1245,16 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p) |
950 |
+ struct iio_poll_func *pf = p; |
951 |
+ struct iio_dev *indio_dev = pf->indio_dev; |
952 |
+ struct ltr501_data *data = iio_priv(indio_dev); |
953 |
+- u16 buf[8]; |
954 |
++ struct { |
955 |
++ u16 channels[3]; |
956 |
++ s64 ts __aligned(8); |
957 |
++ } scan; |
958 |
+ __le16 als_buf[2]; |
959 |
+ u8 mask = 0; |
960 |
+ int j = 0; |
961 |
+ int ret, psdata; |
962 |
+ |
963 |
+- memset(buf, 0, sizeof(buf)); |
964 |
++ memset(&scan, 0, sizeof(scan)); |
965 |
+ |
966 |
+ /* figure out which data needs to be ready */ |
967 |
+ if (test_bit(0, indio_dev->active_scan_mask) || |
968 |
+@@ -1270,9 +1273,9 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p) |
969 |
+ if (ret < 0) |
970 |
+ return ret; |
971 |
+ if (test_bit(0, indio_dev->active_scan_mask)) |
972 |
+- buf[j++] = le16_to_cpu(als_buf[1]); |
973 |
++ scan.channels[j++] = le16_to_cpu(als_buf[1]); |
974 |
+ if (test_bit(1, indio_dev->active_scan_mask)) |
975 |
+- buf[j++] = le16_to_cpu(als_buf[0]); |
976 |
++ scan.channels[j++] = le16_to_cpu(als_buf[0]); |
977 |
+ } |
978 |
+ |
979 |
+ if (mask & LTR501_STATUS_PS_RDY) { |
980 |
+@@ -1280,10 +1283,10 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p) |
981 |
+ &psdata, 2); |
982 |
+ if (ret < 0) |
983 |
+ goto done; |
984 |
+- buf[j++] = psdata & LTR501_PS_DATA_MASK; |
985 |
++ scan.channels[j++] = psdata & LTR501_PS_DATA_MASK; |
986 |
+ } |
987 |
+ |
988 |
+- iio_push_to_buffers_with_timestamp(indio_dev, buf, |
989 |
++ iio_push_to_buffers_with_timestamp(indio_dev, &scan, |
990 |
+ iio_get_time_ns(indio_dev)); |
991 |
+ |
992 |
+ done: |
993 |
+diff --git a/drivers/iio/light/max44000.c b/drivers/iio/light/max44000.c |
994 |
+index bcdb0eb9e5371..7d2b3d0657262 100644 |
995 |
+--- a/drivers/iio/light/max44000.c |
996 |
++++ b/drivers/iio/light/max44000.c |
997 |
+@@ -78,6 +78,11 @@ |
998 |
+ struct max44000_data { |
999 |
+ struct mutex lock; |
1000 |
+ struct regmap *regmap; |
1001 |
++ /* Ensure naturally aligned timestamp */ |
1002 |
++ struct { |
1003 |
++ u16 channels[2]; |
1004 |
++ s64 ts __aligned(8); |
1005 |
++ } scan; |
1006 |
+ }; |
1007 |
+ |
1008 |
+ /* Default scale is set to the minimum of 0.03125 or 1 / (1 << 5) lux */ |
1009 |
+@@ -491,7 +496,6 @@ static irqreturn_t max44000_trigger_handler(int irq, void *p) |
1010 |
+ struct iio_poll_func *pf = p; |
1011 |
+ struct iio_dev *indio_dev = pf->indio_dev; |
1012 |
+ struct max44000_data *data = iio_priv(indio_dev); |
1013 |
+- u16 buf[8]; /* 2x u16 + padding + 8 bytes timestamp */ |
1014 |
+ int index = 0; |
1015 |
+ unsigned int regval; |
1016 |
+ int ret; |
1017 |
+@@ -501,17 +505,17 @@ static irqreturn_t max44000_trigger_handler(int irq, void *p) |
1018 |
+ ret = max44000_read_alsval(data); |
1019 |
+ if (ret < 0) |
1020 |
+ goto out_unlock; |
1021 |
+- buf[index++] = ret; |
1022 |
++ data->scan.channels[index++] = ret; |
1023 |
+ } |
1024 |
+ if (test_bit(MAX44000_SCAN_INDEX_PRX, indio_dev->active_scan_mask)) { |
1025 |
+ ret = regmap_read(data->regmap, MAX44000_REG_PRX_DATA, ®val); |
1026 |
+ if (ret < 0) |
1027 |
+ goto out_unlock; |
1028 |
+- buf[index] = regval; |
1029 |
++ data->scan.channels[index] = regval; |
1030 |
+ } |
1031 |
+ mutex_unlock(&data->lock); |
1032 |
+ |
1033 |
+- iio_push_to_buffers_with_timestamp(indio_dev, buf, |
1034 |
++ iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, |
1035 |
+ iio_get_time_ns(indio_dev)); |
1036 |
+ iio_trigger_notify_done(indio_dev->trig); |
1037 |
+ return IRQ_HANDLED; |
1038 |
+diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c |
1039 |
+index 42a827a665121..379aa7f4a8041 100644 |
1040 |
+--- a/drivers/iio/magnetometer/ak8975.c |
1041 |
++++ b/drivers/iio/magnetometer/ak8975.c |
1042 |
+@@ -381,6 +381,12 @@ struct ak8975_data { |
1043 |
+ struct iio_mount_matrix orientation; |
1044 |
+ struct regulator *vdd; |
1045 |
+ struct regulator *vid; |
1046 |
++ |
1047 |
++ /* Ensure natural alignment of timestamp */ |
1048 |
++ struct { |
1049 |
++ s16 channels[3]; |
1050 |
++ s64 ts __aligned(8); |
1051 |
++ } scan; |
1052 |
+ }; |
1053 |
+ |
1054 |
+ /* Enable attached power regulator if any. */ |
1055 |
+@@ -815,7 +821,6 @@ static void ak8975_fill_buffer(struct iio_dev *indio_dev) |
1056 |
+ const struct i2c_client *client = data->client; |
1057 |
+ const struct ak_def *def = data->def; |
1058 |
+ int ret; |
1059 |
+- s16 buff[8]; /* 3 x 16 bits axis values + 1 aligned 64 bits timestamp */ |
1060 |
+ __le16 fval[3]; |
1061 |
+ |
1062 |
+ mutex_lock(&data->lock); |
1063 |
+@@ -838,12 +843,13 @@ static void ak8975_fill_buffer(struct iio_dev *indio_dev) |
1064 |
+ mutex_unlock(&data->lock); |
1065 |
+ |
1066 |
+ /* Clamp to valid range. */ |
1067 |
+- buff[0] = clamp_t(s16, le16_to_cpu(fval[0]), -def->range, def->range); |
1068 |
+- buff[1] = clamp_t(s16, le16_to_cpu(fval[1]), -def->range, def->range); |
1069 |
+- buff[2] = clamp_t(s16, le16_to_cpu(fval[2]), -def->range, def->range); |
1070 |
++ data->scan.channels[0] = clamp_t(s16, le16_to_cpu(fval[0]), -def->range, def->range); |
1071 |
++ data->scan.channels[1] = clamp_t(s16, le16_to_cpu(fval[1]), -def->range, def->range); |
1072 |
++ data->scan.channels[2] = clamp_t(s16, le16_to_cpu(fval[2]), -def->range, def->range); |
1073 |
+ |
1074 |
+- iio_push_to_buffers_with_timestamp(indio_dev, buff, |
1075 |
++ iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, |
1076 |
+ iio_get_time_ns(indio_dev)); |
1077 |
++ |
1078 |
+ return; |
1079 |
+ |
1080 |
+ unlock: |
1081 |
+diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c |
1082 |
+index e8432876cc860..e1ecd4682c096 100644 |
1083 |
+--- a/drivers/infiniband/core/verbs.c |
1084 |
++++ b/drivers/infiniband/core/verbs.c |
1085 |
+@@ -1711,7 +1711,7 @@ int ib_get_eth_speed(struct ib_device *dev, u8 port_num, u8 *speed, u8 *width) |
1086 |
+ |
1087 |
+ dev_put(netdev); |
1088 |
+ |
1089 |
+- if (!rc) { |
1090 |
++ if (!rc && lksettings.base.speed != (u32)SPEED_UNKNOWN) { |
1091 |
+ netdev_speed = lksettings.base.speed; |
1092 |
+ } else { |
1093 |
+ netdev_speed = SPEED_1000; |
1094 |
+diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c |
1095 |
+index c9af2d139f5cb..957da3ffe593c 100644 |
1096 |
+--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c |
1097 |
++++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c |
1098 |
+@@ -3033,6 +3033,19 @@ static void bnxt_re_process_res_rawqp1_wc(struct ib_wc *wc, |
1099 |
+ wc->wc_flags |= IB_WC_GRH; |
1100 |
+ } |
1101 |
+ |
1102 |
++static bool bnxt_re_check_if_vlan_valid(struct bnxt_re_dev *rdev, |
1103 |
++ u16 vlan_id) |
1104 |
++{ |
1105 |
++ /* |
1106 |
++ * Check if the vlan is configured in the host. If not configured, it |
1107 |
++ * can be a transparent VLAN. So dont report the vlan id. |
1108 |
++ */ |
1109 |
++ if (!__vlan_find_dev_deep_rcu(rdev->netdev, |
1110 |
++ htons(ETH_P_8021Q), vlan_id)) |
1111 |
++ return false; |
1112 |
++ return true; |
1113 |
++} |
1114 |
++ |
1115 |
+ static bool bnxt_re_is_vlan_pkt(struct bnxt_qplib_cqe *orig_cqe, |
1116 |
+ u16 *vid, u8 *sl) |
1117 |
+ { |
1118 |
+@@ -3101,9 +3114,11 @@ static void bnxt_re_process_res_shadow_qp_wc(struct bnxt_re_qp *qp, |
1119 |
+ wc->src_qp = orig_cqe->src_qp; |
1120 |
+ memcpy(wc->smac, orig_cqe->smac, ETH_ALEN); |
1121 |
+ if (bnxt_re_is_vlan_pkt(orig_cqe, &vlan_id, &sl)) { |
1122 |
+- wc->vlan_id = vlan_id; |
1123 |
+- wc->sl = sl; |
1124 |
+- wc->wc_flags |= IB_WC_WITH_VLAN; |
1125 |
++ if (bnxt_re_check_if_vlan_valid(rdev, vlan_id)) { |
1126 |
++ wc->vlan_id = vlan_id; |
1127 |
++ wc->sl = sl; |
1128 |
++ wc->wc_flags |= IB_WC_WITH_VLAN; |
1129 |
++ } |
1130 |
+ } |
1131 |
+ wc->port_num = 1; |
1132 |
+ wc->vendor_err = orig_cqe->status; |
1133 |
+diff --git a/drivers/infiniband/sw/rxe/rxe.c b/drivers/infiniband/sw/rxe/rxe.c |
1134 |
+index 10999fa692818..94dedabe648c2 100644 |
1135 |
+--- a/drivers/infiniband/sw/rxe/rxe.c |
1136 |
++++ b/drivers/infiniband/sw/rxe/rxe.c |
1137 |
+@@ -163,9 +163,6 @@ static int rxe_init_ports(struct rxe_dev *rxe) |
1138 |
+ |
1139 |
+ rxe_init_port_param(port); |
1140 |
+ |
1141 |
+- if (!port->attr.pkey_tbl_len || !port->attr.gid_tbl_len) |
1142 |
+- return -EINVAL; |
1143 |
+- |
1144 |
+ port->pkey_tbl = kcalloc(port->attr.pkey_tbl_len, |
1145 |
+ sizeof(*port->pkey_tbl), GFP_KERNEL); |
1146 |
+ |
1147 |
+diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c |
1148 |
+index dff605fdf60fa..2cca89ca08cd4 100644 |
1149 |
+--- a/drivers/infiniband/sw/rxe/rxe_mr.c |
1150 |
++++ b/drivers/infiniband/sw/rxe/rxe_mr.c |
1151 |
+@@ -203,6 +203,7 @@ int rxe_mem_init_user(struct rxe_pd *pd, u64 start, |
1152 |
+ vaddr = page_address(sg_page(sg)); |
1153 |
+ if (!vaddr) { |
1154 |
+ pr_warn("null vaddr\n"); |
1155 |
++ ib_umem_release(umem); |
1156 |
+ err = -ENOMEM; |
1157 |
+ goto err1; |
1158 |
+ } |
1159 |
+diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c |
1160 |
+index 3a94eb5edcf90..f7f9caaec7d6b 100644 |
1161 |
+--- a/drivers/infiniband/sw/rxe/rxe_verbs.c |
1162 |
++++ b/drivers/infiniband/sw/rxe/rxe_verbs.c |
1163 |
+@@ -1146,7 +1146,7 @@ static ssize_t parent_show(struct device *device, |
1164 |
+ struct rxe_dev *rxe = container_of(device, struct rxe_dev, |
1165 |
+ ib_dev.dev); |
1166 |
+ |
1167 |
+- return snprintf(buf, 16, "%s\n", rxe_parent_name(rxe, 1)); |
1168 |
++ return scnprintf(buf, PAGE_SIZE, "%s\n", rxe_parent_name(rxe, 1)); |
1169 |
+ } |
1170 |
+ |
1171 |
+ static DEVICE_ATTR_RO(parent); |
1172 |
+diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c |
1173 |
+index 58da65df03f5e..7a59a8ebac108 100644 |
1174 |
+--- a/drivers/iommu/amd_iommu_v2.c |
1175 |
++++ b/drivers/iommu/amd_iommu_v2.c |
1176 |
+@@ -776,6 +776,13 @@ int amd_iommu_init_device(struct pci_dev *pdev, int pasids) |
1177 |
+ |
1178 |
+ might_sleep(); |
1179 |
+ |
1180 |
++ /* |
1181 |
++ * When memory encryption is active the device is likely not in a |
1182 |
++ * direct-mapped domain. Forbid using IOMMUv2 functionality for now. |
1183 |
++ */ |
1184 |
++ if (mem_encrypt_active()) |
1185 |
++ return -ENODEV; |
1186 |
++ |
1187 |
+ if (!amd_iommu_v2_supported()) |
1188 |
+ return -ENODEV; |
1189 |
+ |
1190 |
+diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c |
1191 |
+index 643fd1a1b88be..4970cd40813b2 100644 |
1192 |
+--- a/drivers/mmc/host/sdhci-msm.c |
1193 |
++++ b/drivers/mmc/host/sdhci-msm.c |
1194 |
+@@ -1060,7 +1060,7 @@ static void sdhci_msm_set_cdr(struct sdhci_host *host, bool enable) |
1195 |
+ static int sdhci_msm_execute_tuning(struct mmc_host *mmc, u32 opcode) |
1196 |
+ { |
1197 |
+ struct sdhci_host *host = mmc_priv(mmc); |
1198 |
+- int tuning_seq_cnt = 3; |
1199 |
++ int tuning_seq_cnt = 10; |
1200 |
+ u8 phase, tuned_phases[16], tuned_phase_cnt = 0; |
1201 |
+ int rc; |
1202 |
+ struct mmc_ios ios = host->mmc->ios; |
1203 |
+@@ -1124,6 +1124,22 @@ retry: |
1204 |
+ } while (++phase < ARRAY_SIZE(tuned_phases)); |
1205 |
+ |
1206 |
+ if (tuned_phase_cnt) { |
1207 |
++ if (tuned_phase_cnt == ARRAY_SIZE(tuned_phases)) { |
1208 |
++ /* |
1209 |
++ * All phases valid is _almost_ as bad as no phases |
1210 |
++ * valid. Probably all phases are not really reliable |
1211 |
++ * but we didn't detect where the unreliable place is. |
1212 |
++ * That means we'll essentially be guessing and hoping |
1213 |
++ * we get a good phase. Better to try a few times. |
1214 |
++ */ |
1215 |
++ dev_dbg(mmc_dev(mmc), "%s: All phases valid; try again\n", |
1216 |
++ mmc_hostname(mmc)); |
1217 |
++ if (--tuning_seq_cnt) { |
1218 |
++ tuned_phase_cnt = 0; |
1219 |
++ goto retry; |
1220 |
++ } |
1221 |
++ } |
1222 |
++ |
1223 |
+ rc = msm_find_most_appropriate_phase(host, tuned_phases, |
1224 |
+ tuned_phase_cnt); |
1225 |
+ if (rc < 0) |
1226 |
+diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c |
1227 |
+index 320039d329c7d..c169a26e5359a 100644 |
1228 |
+--- a/drivers/net/wan/hdlc_cisco.c |
1229 |
++++ b/drivers/net/wan/hdlc_cisco.c |
1230 |
+@@ -374,6 +374,7 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr) |
1231 |
+ memcpy(&state(hdlc)->settings, &new_settings, size); |
1232 |
+ spin_lock_init(&state(hdlc)->lock); |
1233 |
+ dev->header_ops = &cisco_header_ops; |
1234 |
++ dev->hard_header_len = sizeof(struct hdlc_header); |
1235 |
+ dev->type = ARPHRD_CISCO; |
1236 |
+ call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE, dev); |
1237 |
+ netif_dormant_on(dev); |
1238 |
+diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c |
1239 |
+index c94dfa70f2a33..15177a54b17d7 100644 |
1240 |
+--- a/drivers/net/wan/lapbether.c |
1241 |
++++ b/drivers/net/wan/lapbether.c |
1242 |
+@@ -213,6 +213,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb) |
1243 |
+ |
1244 |
+ skb->dev = dev = lapbeth->ethdev; |
1245 |
+ |
1246 |
++ skb_reset_network_header(skb); |
1247 |
++ |
1248 |
+ dev_hard_header(skb, dev, ETH_P_DEC, bcast_addr, NULL, 0); |
1249 |
+ |
1250 |
+ dev_queue_xmit(skb); |
1251 |
+@@ -343,6 +345,7 @@ static int lapbeth_new_device(struct net_device *dev) |
1252 |
+ */ |
1253 |
+ ndev->needed_headroom = -1 + 3 + 2 + dev->hard_header_len |
1254 |
+ + dev->needed_headroom; |
1255 |
++ ndev->needed_tailroom = dev->needed_tailroom; |
1256 |
+ |
1257 |
+ lapbeth = netdev_priv(ndev); |
1258 |
+ lapbeth->axdev = ndev; |
1259 |
+diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c |
1260 |
+index 01acb6e533655..c4b6e29c07192 100644 |
1261 |
+--- a/drivers/nfc/st95hf/core.c |
1262 |
++++ b/drivers/nfc/st95hf/core.c |
1263 |
+@@ -981,7 +981,7 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev, |
1264 |
+ rc = down_killable(&stcontext->exchange_lock); |
1265 |
+ if (rc) { |
1266 |
+ WARN(1, "Semaphore is not found up in st95hf_in_send_cmd\n"); |
1267 |
+- return rc; |
1268 |
++ goto free_skb_resp; |
1269 |
+ } |
1270 |
+ |
1271 |
+ rc = st95hf_spi_send(&stcontext->spicontext, skb->data, |
1272 |
+diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c |
1273 |
+index bcd09d3a44dad..05dd46f984414 100644 |
1274 |
+--- a/drivers/nvme/host/fabrics.c |
1275 |
++++ b/drivers/nvme/host/fabrics.c |
1276 |
+@@ -577,7 +577,6 @@ bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq, |
1277 |
+ * which is require to set the queue live in the appropinquate states. |
1278 |
+ */ |
1279 |
+ switch (ctrl->state) { |
1280 |
+- case NVME_CTRL_NEW: |
1281 |
+ case NVME_CTRL_CONNECTING: |
1282 |
+ if (req->cmd->common.opcode == nvme_fabrics_command && |
1283 |
+ req->cmd->fabrics.fctype == nvme_fabrics_type_connect) |
1284 |
+diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c |
1285 |
+index f393a6193252e..7e2cdb17c26d8 100644 |
1286 |
+--- a/drivers/nvme/host/rdma.c |
1287 |
++++ b/drivers/nvme/host/rdma.c |
1288 |
+@@ -118,6 +118,7 @@ struct nvme_rdma_ctrl { |
1289 |
+ struct sockaddr_storage src_addr; |
1290 |
+ |
1291 |
+ struct nvme_ctrl ctrl; |
1292 |
++ struct mutex teardown_lock; |
1293 |
+ bool use_inline_data; |
1294 |
+ }; |
1295 |
+ |
1296 |
+@@ -880,6 +881,7 @@ out_free_io_queues: |
1297 |
+ static void nvme_rdma_teardown_admin_queue(struct nvme_rdma_ctrl *ctrl, |
1298 |
+ bool remove) |
1299 |
+ { |
1300 |
++ mutex_lock(&ctrl->teardown_lock); |
1301 |
+ blk_mq_quiesce_queue(ctrl->ctrl.admin_q); |
1302 |
+ nvme_rdma_stop_queue(&ctrl->queues[0]); |
1303 |
+ if (ctrl->ctrl.admin_tagset) |
1304 |
+@@ -887,11 +889,13 @@ static void nvme_rdma_teardown_admin_queue(struct nvme_rdma_ctrl *ctrl, |
1305 |
+ nvme_cancel_request, &ctrl->ctrl); |
1306 |
+ blk_mq_unquiesce_queue(ctrl->ctrl.admin_q); |
1307 |
+ nvme_rdma_destroy_admin_queue(ctrl, remove); |
1308 |
++ mutex_unlock(&ctrl->teardown_lock); |
1309 |
+ } |
1310 |
+ |
1311 |
+ static void nvme_rdma_teardown_io_queues(struct nvme_rdma_ctrl *ctrl, |
1312 |
+ bool remove) |
1313 |
+ { |
1314 |
++ mutex_lock(&ctrl->teardown_lock); |
1315 |
+ if (ctrl->ctrl.queue_count > 1) { |
1316 |
+ nvme_stop_queues(&ctrl->ctrl); |
1317 |
+ nvme_rdma_stop_io_queues(ctrl); |
1318 |
+@@ -902,6 +906,7 @@ static void nvme_rdma_teardown_io_queues(struct nvme_rdma_ctrl *ctrl, |
1319 |
+ nvme_start_queues(&ctrl->ctrl); |
1320 |
+ nvme_rdma_destroy_io_queues(ctrl, remove); |
1321 |
+ } |
1322 |
++ mutex_unlock(&ctrl->teardown_lock); |
1323 |
+ } |
1324 |
+ |
1325 |
+ static void nvme_rdma_stop_ctrl(struct nvme_ctrl *nctrl) |
1326 |
+@@ -1955,6 +1960,7 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev, |
1327 |
+ return ERR_PTR(-ENOMEM); |
1328 |
+ ctrl->ctrl.opts = opts; |
1329 |
+ INIT_LIST_HEAD(&ctrl->list); |
1330 |
++ mutex_init(&ctrl->teardown_lock); |
1331 |
+ |
1332 |
+ if (opts->mask & NVMF_OPT_TRSVCID) |
1333 |
+ port = opts->trsvcid; |
1334 |
+diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c |
1335 |
+index cf515928fed09..68107611c70a2 100644 |
1336 |
+--- a/drivers/phy/qualcomm/phy-qcom-qmp.c |
1337 |
++++ b/drivers/phy/qualcomm/phy-qcom-qmp.c |
1338 |
+@@ -311,8 +311,8 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_serdes_tbl[] = { |
1339 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_BG_TRIM, 0xf), |
1340 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_LOCK_CMP_EN, 0x1), |
1341 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_MAP, 0x0), |
1342 |
+- QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER1, 0x1f), |
1343 |
+- QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER2, 0x3f), |
1344 |
++ QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER1, 0xff), |
1345 |
++ QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER2, 0x1f), |
1346 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_CMN_CONFIG, 0x6), |
1347 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_PLL_IVCO, 0xf), |
1348 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_HSCLK_SEL, 0x0), |
1349 |
+@@ -338,7 +338,6 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_serdes_tbl[] = { |
1350 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_INTEGLOOP_GAIN1_MODE0, 0x0), |
1351 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_INTEGLOOP_GAIN0_MODE0, 0x80), |
1352 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_BIAS_EN_CTRL_BY_PSM, 0x1), |
1353 |
+- QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_CTRL, 0xa), |
1354 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_SSC_EN_CENTER, 0x1), |
1355 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_SSC_PER1, 0x31), |
1356 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_SSC_PER2, 0x1), |
1357 |
+@@ -347,7 +346,6 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_serdes_tbl[] = { |
1358 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_SSC_STEP_SIZE1, 0x2f), |
1359 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_SSC_STEP_SIZE2, 0x19), |
1360 |
+ QMP_PHY_INIT_CFG(QSERDES_COM_CLK_EP_DIV, 0x19), |
1361 |
+- QMP_PHY_INIT_CFG(QSERDES_RX_SIGDET_CNTRL, 0x7), |
1362 |
+ }; |
1363 |
+ |
1364 |
+ static const struct qmp_phy_init_tbl ipq8074_pcie_tx_tbl[] = { |
1365 |
+@@ -355,6 +353,8 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_tx_tbl[] = { |
1366 |
+ QMP_PHY_INIT_CFG(QSERDES_TX_LANE_MODE, 0x6), |
1367 |
+ QMP_PHY_INIT_CFG(QSERDES_TX_RES_CODE_LANE_OFFSET, 0x2), |
1368 |
+ QMP_PHY_INIT_CFG(QSERDES_TX_RCV_DETECT_LVL_2, 0x12), |
1369 |
++ QMP_PHY_INIT_CFG(QSERDES_TX_EMP_POST1_LVL, 0x36), |
1370 |
++ QMP_PHY_INIT_CFG(QSERDES_TX_SLEW_CNTL, 0x0a), |
1371 |
+ }; |
1372 |
+ |
1373 |
+ static const struct qmp_phy_init_tbl ipq8074_pcie_rx_tbl[] = { |
1374 |
+@@ -365,7 +365,6 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_rx_tbl[] = { |
1375 |
+ QMP_PHY_INIT_CFG(QSERDES_RX_RX_EQU_ADAPTOR_CNTRL4, 0xdb), |
1376 |
+ QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x4b), |
1377 |
+ QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_GAIN, 0x4), |
1378 |
+- QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_GAIN_HALF, 0x4), |
1379 |
+ }; |
1380 |
+ |
1381 |
+ static const struct qmp_phy_init_tbl ipq8074_pcie_pcs_tbl[] = { |
1382 |
+@@ -818,6 +817,9 @@ static const struct qmp_phy_cfg msm8996_usb3phy_cfg = { |
1383 |
+ .mask_pcs_ready = PHYSTATUS, |
1384 |
+ }; |
1385 |
+ |
1386 |
++static const char * const ipq8074_pciephy_clk_l[] = { |
1387 |
++ "aux", "cfg_ahb", |
1388 |
++}; |
1389 |
+ /* list of resets */ |
1390 |
+ static const char * const ipq8074_pciephy_reset_l[] = { |
1391 |
+ "phy", "common", |
1392 |
+@@ -835,8 +837,8 @@ static const struct qmp_phy_cfg ipq8074_pciephy_cfg = { |
1393 |
+ .rx_tbl_num = ARRAY_SIZE(ipq8074_pcie_rx_tbl), |
1394 |
+ .pcs_tbl = ipq8074_pcie_pcs_tbl, |
1395 |
+ .pcs_tbl_num = ARRAY_SIZE(ipq8074_pcie_pcs_tbl), |
1396 |
+- .clk_list = NULL, |
1397 |
+- .num_clks = 0, |
1398 |
++ .clk_list = ipq8074_pciephy_clk_l, |
1399 |
++ .num_clks = ARRAY_SIZE(ipq8074_pciephy_clk_l), |
1400 |
+ .reset_list = ipq8074_pciephy_reset_l, |
1401 |
+ .num_resets = ARRAY_SIZE(ipq8074_pciephy_reset_l), |
1402 |
+ .vreg_list = NULL, |
1403 |
+diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.h b/drivers/phy/qualcomm/phy-qcom-qmp.h |
1404 |
+index 5d78d43ba9fc5..6b3aaf521e588 100644 |
1405 |
+--- a/drivers/phy/qualcomm/phy-qcom-qmp.h |
1406 |
++++ b/drivers/phy/qualcomm/phy-qcom-qmp.h |
1407 |
+@@ -77,6 +77,8 @@ |
1408 |
+ #define QSERDES_COM_CORECLK_DIV_MODE1 0x1bc |
1409 |
+ |
1410 |
+ /* Only for QMP V2 PHY - TX registers */ |
1411 |
++#define QSERDES_TX_EMP_POST1_LVL 0x018 |
1412 |
++#define QSERDES_TX_SLEW_CNTL 0x040 |
1413 |
+ #define QSERDES_TX_RES_CODE_LANE_OFFSET 0x054 |
1414 |
+ #define QSERDES_TX_DEBUG_BUS_SEL 0x064 |
1415 |
+ #define QSERDES_TX_HIGHZ_TRANSCEIVEREN_BIAS_DRVR_EN 0x068 |
1416 |
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c |
1417 |
+index 4bab758d14b1a..37e6270749eef 100644 |
1418 |
+--- a/drivers/regulator/core.c |
1419 |
++++ b/drivers/regulator/core.c |
1420 |
+@@ -1257,7 +1257,7 @@ static int set_consumer_device_supply(struct regulator_dev *rdev, |
1421 |
+ const char *consumer_dev_name, |
1422 |
+ const char *supply) |
1423 |
+ { |
1424 |
+- struct regulator_map *node; |
1425 |
++ struct regulator_map *node, *new_node; |
1426 |
+ int has_dev; |
1427 |
+ |
1428 |
+ if (supply == NULL) |
1429 |
+@@ -1268,6 +1268,22 @@ static int set_consumer_device_supply(struct regulator_dev *rdev, |
1430 |
+ else |
1431 |
+ has_dev = 0; |
1432 |
+ |
1433 |
++ new_node = kzalloc(sizeof(struct regulator_map), GFP_KERNEL); |
1434 |
++ if (new_node == NULL) |
1435 |
++ return -ENOMEM; |
1436 |
++ |
1437 |
++ new_node->regulator = rdev; |
1438 |
++ new_node->supply = supply; |
1439 |
++ |
1440 |
++ if (has_dev) { |
1441 |
++ new_node->dev_name = kstrdup(consumer_dev_name, GFP_KERNEL); |
1442 |
++ if (new_node->dev_name == NULL) { |
1443 |
++ kfree(new_node); |
1444 |
++ return -ENOMEM; |
1445 |
++ } |
1446 |
++ } |
1447 |
++ |
1448 |
++ mutex_lock(®ulator_list_mutex); |
1449 |
+ list_for_each_entry(node, ®ulator_map_list, list) { |
1450 |
+ if (node->dev_name && consumer_dev_name) { |
1451 |
+ if (strcmp(node->dev_name, consumer_dev_name) != 0) |
1452 |
+@@ -1285,26 +1301,19 @@ static int set_consumer_device_supply(struct regulator_dev *rdev, |
1453 |
+ node->regulator->desc->name, |
1454 |
+ supply, |
1455 |
+ dev_name(&rdev->dev), rdev_get_name(rdev)); |
1456 |
+- return -EBUSY; |
1457 |
++ goto fail; |
1458 |
+ } |
1459 |
+ |
1460 |
+- node = kzalloc(sizeof(struct regulator_map), GFP_KERNEL); |
1461 |
+- if (node == NULL) |
1462 |
+- return -ENOMEM; |
1463 |
+- |
1464 |
+- node->regulator = rdev; |
1465 |
+- node->supply = supply; |
1466 |
+- |
1467 |
+- if (has_dev) { |
1468 |
+- node->dev_name = kstrdup(consumer_dev_name, GFP_KERNEL); |
1469 |
+- if (node->dev_name == NULL) { |
1470 |
+- kfree(node); |
1471 |
+- return -ENOMEM; |
1472 |
+- } |
1473 |
+- } |
1474 |
++ list_add(&new_node->list, ®ulator_map_list); |
1475 |
++ mutex_unlock(®ulator_list_mutex); |
1476 |
+ |
1477 |
+- list_add(&node->list, ®ulator_map_list); |
1478 |
+ return 0; |
1479 |
++ |
1480 |
++fail: |
1481 |
++ mutex_unlock(®ulator_list_mutex); |
1482 |
++ kfree(new_node->dev_name); |
1483 |
++ kfree(new_node); |
1484 |
++ return -EBUSY; |
1485 |
+ } |
1486 |
+ |
1487 |
+ static void unset_regulator_supplies(struct regulator_dev *rdev) |
1488 |
+@@ -4375,19 +4384,16 @@ regulator_register(const struct regulator_desc *regulator_desc, |
1489 |
+ |
1490 |
+ /* add consumers devices */ |
1491 |
+ if (init_data) { |
1492 |
+- mutex_lock(®ulator_list_mutex); |
1493 |
+ for (i = 0; i < init_data->num_consumer_supplies; i++) { |
1494 |
+ ret = set_consumer_device_supply(rdev, |
1495 |
+ init_data->consumer_supplies[i].dev_name, |
1496 |
+ init_data->consumer_supplies[i].supply); |
1497 |
+ if (ret < 0) { |
1498 |
+- mutex_unlock(®ulator_list_mutex); |
1499 |
+ dev_err(dev, "Failed to set supply %s\n", |
1500 |
+ init_data->consumer_supplies[i].supply); |
1501 |
+ goto unset_supplies; |
1502 |
+ } |
1503 |
+ } |
1504 |
+- mutex_unlock(®ulator_list_mutex); |
1505 |
+ } |
1506 |
+ |
1507 |
+ if (!rdev->desc->ops->get_voltage && |
1508 |
+diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c |
1509 |
+index 64a958a99f6a8..d82698b7dfe6c 100644 |
1510 |
+--- a/drivers/scsi/libsas/sas_ata.c |
1511 |
++++ b/drivers/scsi/libsas/sas_ata.c |
1512 |
+@@ -223,7 +223,10 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) |
1513 |
+ task->num_scatter = si; |
1514 |
+ } |
1515 |
+ |
1516 |
+- task->data_dir = qc->dma_dir; |
1517 |
++ if (qc->tf.protocol == ATA_PROT_NODATA) |
1518 |
++ task->data_dir = DMA_NONE; |
1519 |
++ else |
1520 |
++ task->data_dir = qc->dma_dir; |
1521 |
+ task->scatter = qc->sg; |
1522 |
+ task->ata_task.retry_count = 1; |
1523 |
+ task->task_state_flags = SAS_TASK_STATE_PENDING; |
1524 |
+diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c |
1525 |
+index b71078339e860..860247d718184 100644 |
1526 |
+--- a/drivers/staging/greybus/audio_topology.c |
1527 |
++++ b/drivers/staging/greybus/audio_topology.c |
1528 |
+@@ -460,6 +460,15 @@ static int gbcodec_mixer_dapm_ctl_put(struct snd_kcontrol *kcontrol, |
1529 |
+ val = ucontrol->value.integer.value[0] & mask; |
1530 |
+ connect = !!val; |
1531 |
+ |
1532 |
++ ret = gb_pm_runtime_get_sync(bundle); |
1533 |
++ if (ret) |
1534 |
++ return ret; |
1535 |
++ |
1536 |
++ ret = gb_audio_gb_get_control(module->mgmt_connection, data->ctl_id, |
1537 |
++ GB_AUDIO_INVALID_INDEX, &gbvalue); |
1538 |
++ if (ret) |
1539 |
++ goto exit; |
1540 |
++ |
1541 |
+ /* update ucontrol */ |
1542 |
+ if (gbvalue.value.integer_value[0] != val) { |
1543 |
+ for (wi = 0; wi < wlist->num_widgets; wi++) { |
1544 |
+@@ -473,25 +482,17 @@ static int gbcodec_mixer_dapm_ctl_put(struct snd_kcontrol *kcontrol, |
1545 |
+ gbvalue.value.integer_value[0] = |
1546 |
+ cpu_to_le32(ucontrol->value.integer.value[0]); |
1547 |
+ |
1548 |
+- ret = gb_pm_runtime_get_sync(bundle); |
1549 |
+- if (ret) |
1550 |
+- return ret; |
1551 |
+- |
1552 |
+ ret = gb_audio_gb_set_control(module->mgmt_connection, |
1553 |
+ data->ctl_id, |
1554 |
+ GB_AUDIO_INVALID_INDEX, &gbvalue); |
1555 |
+- |
1556 |
+- gb_pm_runtime_put_autosuspend(bundle); |
1557 |
+- |
1558 |
+- if (ret) { |
1559 |
+- dev_err_ratelimited(codec->dev, |
1560 |
+- "%d:Error in %s for %s\n", ret, |
1561 |
+- __func__, kcontrol->id.name); |
1562 |
+- return ret; |
1563 |
+- } |
1564 |
+ } |
1565 |
+ |
1566 |
+- return 0; |
1567 |
++exit: |
1568 |
++ gb_pm_runtime_put_autosuspend(bundle); |
1569 |
++ if (ret) |
1570 |
++ dev_err_ratelimited(codec_dev, "%d:Error in %s for %s\n", ret, |
1571 |
++ __func__, kcontrol->id.name); |
1572 |
++ return ret; |
1573 |
+ } |
1574 |
+ |
1575 |
+ #define SOC_DAPM_MIXER_GB(xname, kcount, data) \ |
1576 |
+diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c |
1577 |
+index 65ad9773018ee..7686805dfe0f2 100644 |
1578 |
+--- a/drivers/staging/wlan-ng/hfa384x_usb.c |
1579 |
++++ b/drivers/staging/wlan-ng/hfa384x_usb.c |
1580 |
+@@ -532,13 +532,8 @@ static void hfa384x_usb_defer(struct work_struct *data) |
1581 |
+ */ |
1582 |
+ void hfa384x_create(struct hfa384x *hw, struct usb_device *usb) |
1583 |
+ { |
1584 |
+- memset(hw, 0, sizeof(*hw)); |
1585 |
+ hw->usb = usb; |
1586 |
+ |
1587 |
+- /* set up the endpoints */ |
1588 |
+- hw->endp_in = usb_rcvbulkpipe(usb, 1); |
1589 |
+- hw->endp_out = usb_sndbulkpipe(usb, 2); |
1590 |
+- |
1591 |
+ /* Set up the waitq */ |
1592 |
+ init_waitqueue_head(&hw->cmdq); |
1593 |
+ |
1594 |
+diff --git a/drivers/staging/wlan-ng/prism2usb.c b/drivers/staging/wlan-ng/prism2usb.c |
1595 |
+index 8d32b1603d10a..9eee72aff7233 100644 |
1596 |
+--- a/drivers/staging/wlan-ng/prism2usb.c |
1597 |
++++ b/drivers/staging/wlan-ng/prism2usb.c |
1598 |
+@@ -61,23 +61,14 @@ static int prism2sta_probe_usb(struct usb_interface *interface, |
1599 |
+ const struct usb_device_id *id) |
1600 |
+ { |
1601 |
+ struct usb_device *dev; |
1602 |
+- const struct usb_endpoint_descriptor *epd; |
1603 |
+- const struct usb_host_interface *iface_desc = interface->cur_altsetting; |
1604 |
++ struct usb_endpoint_descriptor *bulk_in, *bulk_out; |
1605 |
++ struct usb_host_interface *iface_desc = interface->cur_altsetting; |
1606 |
+ struct wlandevice *wlandev = NULL; |
1607 |
+ struct hfa384x *hw = NULL; |
1608 |
+ int result = 0; |
1609 |
+ |
1610 |
+- if (iface_desc->desc.bNumEndpoints != 2) { |
1611 |
+- result = -ENODEV; |
1612 |
+- goto failed; |
1613 |
+- } |
1614 |
+- |
1615 |
+- result = -EINVAL; |
1616 |
+- epd = &iface_desc->endpoint[1].desc; |
1617 |
+- if (!usb_endpoint_is_bulk_in(epd)) |
1618 |
+- goto failed; |
1619 |
+- epd = &iface_desc->endpoint[2].desc; |
1620 |
+- if (!usb_endpoint_is_bulk_out(epd)) |
1621 |
++ result = usb_find_common_endpoints(iface_desc, &bulk_in, &bulk_out, NULL, NULL); |
1622 |
++ if (result) |
1623 |
+ goto failed; |
1624 |
+ |
1625 |
+ dev = interface_to_usbdev(interface); |
1626 |
+@@ -96,6 +87,8 @@ static int prism2sta_probe_usb(struct usb_interface *interface, |
1627 |
+ } |
1628 |
+ |
1629 |
+ /* Initialize the hw data */ |
1630 |
++ hw->endp_in = usb_rcvbulkpipe(dev, bulk_in->bEndpointAddress); |
1631 |
++ hw->endp_out = usb_sndbulkpipe(dev, bulk_out->bEndpointAddress); |
1632 |
+ hfa384x_create(hw, dev); |
1633 |
+ hw->wlandev = wlandev; |
1634 |
+ |
1635 |
+diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c |
1636 |
+index 1633e26662687..2602b57936d4b 100644 |
1637 |
+--- a/drivers/target/iscsi/iscsi_target.c |
1638 |
++++ b/drivers/target/iscsi/iscsi_target.c |
1639 |
+@@ -1381,14 +1381,27 @@ static u32 iscsit_do_crypto_hash_sg( |
1640 |
+ sg = cmd->first_data_sg; |
1641 |
+ page_off = cmd->first_data_sg_off; |
1642 |
+ |
1643 |
++ if (data_length && page_off) { |
1644 |
++ struct scatterlist first_sg; |
1645 |
++ u32 len = min_t(u32, data_length, sg->length - page_off); |
1646 |
++ |
1647 |
++ sg_init_table(&first_sg, 1); |
1648 |
++ sg_set_page(&first_sg, sg_page(sg), len, sg->offset + page_off); |
1649 |
++ |
1650 |
++ ahash_request_set_crypt(hash, &first_sg, NULL, len); |
1651 |
++ crypto_ahash_update(hash); |
1652 |
++ |
1653 |
++ data_length -= len; |
1654 |
++ sg = sg_next(sg); |
1655 |
++ } |
1656 |
++ |
1657 |
+ while (data_length) { |
1658 |
+- u32 cur_len = min_t(u32, data_length, (sg->length - page_off)); |
1659 |
++ u32 cur_len = min_t(u32, data_length, sg->length); |
1660 |
+ |
1661 |
+ ahash_request_set_crypt(hash, sg, NULL, cur_len); |
1662 |
+ crypto_ahash_update(hash); |
1663 |
+ |
1664 |
+ data_length -= cur_len; |
1665 |
+- page_off = 0; |
1666 |
+ /* iscsit_map_iovec has already checked for invalid sg pointers */ |
1667 |
+ sg = sg_next(sg); |
1668 |
+ } |
1669 |
+diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c |
1670 |
+index f25049ba4a85b..db93bd0a9b886 100644 |
1671 |
+--- a/drivers/target/iscsi/iscsi_target_login.c |
1672 |
++++ b/drivers/target/iscsi/iscsi_target_login.c |
1673 |
+@@ -1183,7 +1183,7 @@ void iscsit_free_conn(struct iscsi_conn *conn) |
1674 |
+ } |
1675 |
+ |
1676 |
+ void iscsi_target_login_sess_out(struct iscsi_conn *conn, |
1677 |
+- struct iscsi_np *np, bool zero_tsih, bool new_sess) |
1678 |
++ bool zero_tsih, bool new_sess) |
1679 |
+ { |
1680 |
+ if (!new_sess) |
1681 |
+ goto old_sess_out; |
1682 |
+@@ -1201,7 +1201,6 @@ void iscsi_target_login_sess_out(struct iscsi_conn *conn, |
1683 |
+ conn->sess = NULL; |
1684 |
+ |
1685 |
+ old_sess_out: |
1686 |
+- iscsi_stop_login_thread_timer(np); |
1687 |
+ /* |
1688 |
+ * If login negotiation fails check if the Time2Retain timer |
1689 |
+ * needs to be restarted. |
1690 |
+@@ -1441,8 +1440,9 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) |
1691 |
+ new_sess_out: |
1692 |
+ new_sess = true; |
1693 |
+ old_sess_out: |
1694 |
++ iscsi_stop_login_thread_timer(np); |
1695 |
+ tpg_np = conn->tpg_np; |
1696 |
+- iscsi_target_login_sess_out(conn, np, zero_tsih, new_sess); |
1697 |
++ iscsi_target_login_sess_out(conn, zero_tsih, new_sess); |
1698 |
+ new_sess = false; |
1699 |
+ |
1700 |
+ if (tpg) { |
1701 |
+diff --git a/drivers/target/iscsi/iscsi_target_login.h b/drivers/target/iscsi/iscsi_target_login.h |
1702 |
+index 3b8e3639ff5d0..fc95e6150253f 100644 |
1703 |
+--- a/drivers/target/iscsi/iscsi_target_login.h |
1704 |
++++ b/drivers/target/iscsi/iscsi_target_login.h |
1705 |
+@@ -22,8 +22,7 @@ extern int iscsit_put_login_tx(struct iscsi_conn *, struct iscsi_login *, u32); |
1706 |
+ extern void iscsit_free_conn(struct iscsi_conn *); |
1707 |
+ extern int iscsit_start_kthreads(struct iscsi_conn *); |
1708 |
+ extern void iscsi_post_login_handler(struct iscsi_np *, struct iscsi_conn *, u8); |
1709 |
+-extern void iscsi_target_login_sess_out(struct iscsi_conn *, struct iscsi_np *, |
1710 |
+- bool, bool); |
1711 |
++extern void iscsi_target_login_sess_out(struct iscsi_conn *, bool, bool); |
1712 |
+ extern int iscsi_target_login_thread(void *); |
1713 |
+ extern void iscsi_handle_login_thread_timeout(struct timer_list *t); |
1714 |
+ |
1715 |
+diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c |
1716 |
+index 8a5e8d17a9426..5db8842a80265 100644 |
1717 |
+--- a/drivers/target/iscsi/iscsi_target_nego.c |
1718 |
++++ b/drivers/target/iscsi/iscsi_target_nego.c |
1719 |
+@@ -554,12 +554,11 @@ static bool iscsi_target_sk_check_and_clear(struct iscsi_conn *conn, unsigned in |
1720 |
+ |
1721 |
+ static void iscsi_target_login_drop(struct iscsi_conn *conn, struct iscsi_login *login) |
1722 |
+ { |
1723 |
+- struct iscsi_np *np = login->np; |
1724 |
+ bool zero_tsih = login->zero_tsih; |
1725 |
+ |
1726 |
+ iscsi_remove_failed_auth_entry(conn); |
1727 |
+ iscsi_target_nego_release(conn); |
1728 |
+- iscsi_target_login_sess_out(conn, np, zero_tsih, true); |
1729 |
++ iscsi_target_login_sess_out(conn, zero_tsih, true); |
1730 |
+ } |
1731 |
+ |
1732 |
+ struct conn_timeout { |
1733 |
+diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c |
1734 |
+index f705ea52eb973..152228d33ad20 100644 |
1735 |
+--- a/drivers/usb/core/message.c |
1736 |
++++ b/drivers/usb/core/message.c |
1737 |
+@@ -1204,6 +1204,34 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf, |
1738 |
+ } |
1739 |
+ } |
1740 |
+ |
1741 |
++/* |
1742 |
++ * usb_disable_device_endpoints -- Disable all endpoints for a device |
1743 |
++ * @dev: the device whose endpoints are being disabled |
1744 |
++ * @skip_ep0: 0 to disable endpoint 0, 1 to skip it. |
1745 |
++ */ |
1746 |
++static void usb_disable_device_endpoints(struct usb_device *dev, int skip_ep0) |
1747 |
++{ |
1748 |
++ struct usb_hcd *hcd = bus_to_hcd(dev->bus); |
1749 |
++ int i; |
1750 |
++ |
1751 |
++ if (hcd->driver->check_bandwidth) { |
1752 |
++ /* First pass: Cancel URBs, leave endpoint pointers intact. */ |
1753 |
++ for (i = skip_ep0; i < 16; ++i) { |
1754 |
++ usb_disable_endpoint(dev, i, false); |
1755 |
++ usb_disable_endpoint(dev, i + USB_DIR_IN, false); |
1756 |
++ } |
1757 |
++ /* Remove endpoints from the host controller internal state */ |
1758 |
++ mutex_lock(hcd->bandwidth_mutex); |
1759 |
++ usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); |
1760 |
++ mutex_unlock(hcd->bandwidth_mutex); |
1761 |
++ } |
1762 |
++ /* Second pass: remove endpoint pointers */ |
1763 |
++ for (i = skip_ep0; i < 16; ++i) { |
1764 |
++ usb_disable_endpoint(dev, i, true); |
1765 |
++ usb_disable_endpoint(dev, i + USB_DIR_IN, true); |
1766 |
++ } |
1767 |
++} |
1768 |
++ |
1769 |
+ /** |
1770 |
+ * usb_disable_device - Disable all the endpoints for a USB device |
1771 |
+ * @dev: the device whose endpoints are being disabled |
1772 |
+@@ -1217,7 +1245,6 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf, |
1773 |
+ void usb_disable_device(struct usb_device *dev, int skip_ep0) |
1774 |
+ { |
1775 |
+ int i; |
1776 |
+- struct usb_hcd *hcd = bus_to_hcd(dev->bus); |
1777 |
+ |
1778 |
+ /* getting rid of interfaces will disconnect |
1779 |
+ * any drivers bound to them (a key side effect) |
1780 |
+@@ -1263,22 +1290,8 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) |
1781 |
+ |
1782 |
+ dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__, |
1783 |
+ skip_ep0 ? "non-ep0" : "all"); |
1784 |
+- if (hcd->driver->check_bandwidth) { |
1785 |
+- /* First pass: Cancel URBs, leave endpoint pointers intact. */ |
1786 |
+- for (i = skip_ep0; i < 16; ++i) { |
1787 |
+- usb_disable_endpoint(dev, i, false); |
1788 |
+- usb_disable_endpoint(dev, i + USB_DIR_IN, false); |
1789 |
+- } |
1790 |
+- /* Remove endpoints from the host controller internal state */ |
1791 |
+- mutex_lock(hcd->bandwidth_mutex); |
1792 |
+- usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); |
1793 |
+- mutex_unlock(hcd->bandwidth_mutex); |
1794 |
+- /* Second pass: remove endpoint pointers */ |
1795 |
+- } |
1796 |
+- for (i = skip_ep0; i < 16; ++i) { |
1797 |
+- usb_disable_endpoint(dev, i, true); |
1798 |
+- usb_disable_endpoint(dev, i + USB_DIR_IN, true); |
1799 |
+- } |
1800 |
++ |
1801 |
++ usb_disable_device_endpoints(dev, skip_ep0); |
1802 |
+ } |
1803 |
+ |
1804 |
+ /** |
1805 |
+@@ -1521,6 +1534,9 @@ EXPORT_SYMBOL_GPL(usb_set_interface); |
1806 |
+ * The caller must own the device lock. |
1807 |
+ * |
1808 |
+ * Return: Zero on success, else a negative error code. |
1809 |
++ * |
1810 |
++ * If this routine fails the device will probably be in an unusable state |
1811 |
++ * with endpoints disabled, and interfaces only partially enabled. |
1812 |
+ */ |
1813 |
+ int usb_reset_configuration(struct usb_device *dev) |
1814 |
+ { |
1815 |
+@@ -1536,10 +1552,7 @@ int usb_reset_configuration(struct usb_device *dev) |
1816 |
+ * calls during probe() are fine |
1817 |
+ */ |
1818 |
+ |
1819 |
+- for (i = 1; i < 16; ++i) { |
1820 |
+- usb_disable_endpoint(dev, i, true); |
1821 |
+- usb_disable_endpoint(dev, i + USB_DIR_IN, true); |
1822 |
+- } |
1823 |
++ usb_disable_device_endpoints(dev, 1); /* skip ep0*/ |
1824 |
+ |
1825 |
+ config = dev->actconfig; |
1826 |
+ retval = 0; |
1827 |
+@@ -1552,34 +1565,10 @@ int usb_reset_configuration(struct usb_device *dev) |
1828 |
+ mutex_unlock(hcd->bandwidth_mutex); |
1829 |
+ return -ENOMEM; |
1830 |
+ } |
1831 |
+- /* Make sure we have enough bandwidth for each alternate setting 0 */ |
1832 |
+- for (i = 0; i < config->desc.bNumInterfaces; i++) { |
1833 |
+- struct usb_interface *intf = config->interface[i]; |
1834 |
+- struct usb_host_interface *alt; |
1835 |
+ |
1836 |
+- alt = usb_altnum_to_altsetting(intf, 0); |
1837 |
+- if (!alt) |
1838 |
+- alt = &intf->altsetting[0]; |
1839 |
+- if (alt != intf->cur_altsetting) |
1840 |
+- retval = usb_hcd_alloc_bandwidth(dev, NULL, |
1841 |
+- intf->cur_altsetting, alt); |
1842 |
+- if (retval < 0) |
1843 |
+- break; |
1844 |
+- } |
1845 |
+- /* If not, reinstate the old alternate settings */ |
1846 |
++ /* xHCI adds all endpoints in usb_hcd_alloc_bandwidth */ |
1847 |
++ retval = usb_hcd_alloc_bandwidth(dev, config, NULL, NULL); |
1848 |
+ if (retval < 0) { |
1849 |
+-reset_old_alts: |
1850 |
+- for (i--; i >= 0; i--) { |
1851 |
+- struct usb_interface *intf = config->interface[i]; |
1852 |
+- struct usb_host_interface *alt; |
1853 |
+- |
1854 |
+- alt = usb_altnum_to_altsetting(intf, 0); |
1855 |
+- if (!alt) |
1856 |
+- alt = &intf->altsetting[0]; |
1857 |
+- if (alt != intf->cur_altsetting) |
1858 |
+- usb_hcd_alloc_bandwidth(dev, NULL, |
1859 |
+- alt, intf->cur_altsetting); |
1860 |
+- } |
1861 |
+ usb_enable_lpm(dev); |
1862 |
+ mutex_unlock(hcd->bandwidth_mutex); |
1863 |
+ return retval; |
1864 |
+@@ -1588,8 +1577,12 @@ reset_old_alts: |
1865 |
+ USB_REQ_SET_CONFIGURATION, 0, |
1866 |
+ config->desc.bConfigurationValue, 0, |
1867 |
+ NULL, 0, USB_CTRL_SET_TIMEOUT); |
1868 |
+- if (retval < 0) |
1869 |
+- goto reset_old_alts; |
1870 |
++ if (retval < 0) { |
1871 |
++ usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); |
1872 |
++ usb_enable_lpm(dev); |
1873 |
++ mutex_unlock(hcd->bandwidth_mutex); |
1874 |
++ return retval; |
1875 |
++ } |
1876 |
+ mutex_unlock(hcd->bandwidth_mutex); |
1877 |
+ |
1878 |
+ /* re-init hc/hcd interface/endpoint state */ |
1879 |
+diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c |
1880 |
+index 7e88fdfe3cf5c..b93b18ba89df6 100644 |
1881 |
+--- a/drivers/usb/core/sysfs.c |
1882 |
++++ b/drivers/usb/core/sysfs.c |
1883 |
+@@ -888,7 +888,11 @@ read_descriptors(struct file *filp, struct kobject *kobj, |
1884 |
+ size_t srclen, n; |
1885 |
+ int cfgno; |
1886 |
+ void *src; |
1887 |
++ int retval; |
1888 |
+ |
1889 |
++ retval = usb_lock_device_interruptible(udev); |
1890 |
++ if (retval < 0) |
1891 |
++ return -EINTR; |
1892 |
+ /* The binary attribute begins with the device descriptor. |
1893 |
+ * Following that are the raw descriptor entries for all the |
1894 |
+ * configurations (config plus subsidiary descriptors). |
1895 |
+@@ -913,6 +917,7 @@ read_descriptors(struct file *filp, struct kobject *kobj, |
1896 |
+ off -= srclen; |
1897 |
+ } |
1898 |
+ } |
1899 |
++ usb_unlock_device(udev); |
1900 |
+ return count - nleft; |
1901 |
+ } |
1902 |
+ |
1903 |
+diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c |
1904 |
+index ce9cc1f90b052..f0f630e1cf1c9 100644 |
1905 |
+--- a/drivers/usb/serial/ftdi_sio.c |
1906 |
++++ b/drivers/usb/serial/ftdi_sio.c |
1907 |
+@@ -703,6 +703,7 @@ static const struct usb_device_id id_table_combined[] = { |
1908 |
+ { USB_DEVICE(XSENS_VID, XSENS_AWINDA_STATION_PID) }, |
1909 |
+ { USB_DEVICE(XSENS_VID, XSENS_CONVERTER_PID) }, |
1910 |
+ { USB_DEVICE(XSENS_VID, XSENS_MTDEVBOARD_PID) }, |
1911 |
++ { USB_DEVICE(XSENS_VID, XSENS_MTIUSBCONVERTER_PID) }, |
1912 |
+ { USB_DEVICE(XSENS_VID, XSENS_MTW_PID) }, |
1913 |
+ { USB_DEVICE(FTDI_VID, FTDI_OMNI1509) }, |
1914 |
+ { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, |
1915 |
+diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h |
1916 |
+index e8373528264c3..b5ca17a5967a0 100644 |
1917 |
+--- a/drivers/usb/serial/ftdi_sio_ids.h |
1918 |
++++ b/drivers/usb/serial/ftdi_sio_ids.h |
1919 |
+@@ -160,6 +160,7 @@ |
1920 |
+ #define XSENS_AWINDA_DONGLE_PID 0x0102 |
1921 |
+ #define XSENS_MTW_PID 0x0200 /* Xsens MTw */ |
1922 |
+ #define XSENS_MTDEVBOARD_PID 0x0300 /* Motion Tracker Development Board */ |
1923 |
++#define XSENS_MTIUSBCONVERTER_PID 0x0301 /* MTi USB converter */ |
1924 |
+ #define XSENS_CONVERTER_PID 0xD00D /* Xsens USB-serial converter */ |
1925 |
+ |
1926 |
+ /* Xsens devices using FTDI VID */ |
1927 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
1928 |
+index 6e44aaafdcb10..810f1010ab132 100644 |
1929 |
+--- a/drivers/usb/serial/option.c |
1930 |
++++ b/drivers/usb/serial/option.c |
1931 |
+@@ -1094,14 +1094,18 @@ static const struct usb_device_id option_ids[] = { |
1932 |
+ { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M), |
1933 |
+ .driver_info = RSVD(1) | RSVD(3) }, |
1934 |
+ /* Quectel products using Quectel vendor ID */ |
1935 |
+- { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), |
1936 |
+- .driver_info = RSVD(4) }, |
1937 |
+- { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25), |
1938 |
+- .driver_info = RSVD(4) }, |
1939 |
+- { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95), |
1940 |
+- .driver_info = RSVD(4) }, |
1941 |
+- { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), |
1942 |
+- .driver_info = RSVD(4) }, |
1943 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff), |
1944 |
++ .driver_info = NUMEP2 }, |
1945 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0, 0) }, |
1946 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0xff, 0xff), |
1947 |
++ .driver_info = NUMEP2 }, |
1948 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25, 0xff, 0, 0) }, |
1949 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0xff, 0xff), |
1950 |
++ .driver_info = NUMEP2 }, |
1951 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) }, |
1952 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96, 0xff, 0xff, 0xff), |
1953 |
++ .driver_info = NUMEP2 }, |
1954 |
++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96, 0xff, 0, 0) }, |
1955 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff), |
1956 |
+ .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, |
1957 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) }, |
1958 |
+@@ -1819,6 +1823,8 @@ static const struct usb_device_id option_ids[] = { |
1959 |
+ { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9003, 0xff) }, /* Simcom SIM7500/SIM7600 MBIM mode */ |
1960 |
+ { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9011, 0xff), /* Simcom SIM7500/SIM7600 RNDIS mode */ |
1961 |
+ .driver_info = RSVD(7) }, |
1962 |
++ { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9205, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT+ECM mode */ |
1963 |
++ { USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9206, 0xff) }, /* Simcom SIM7070/SIM7080/SIM7090 AT-only mode */ |
1964 |
+ { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S_X200), |
1965 |
+ .driver_info = NCTRL(0) | NCTRL(1) | RSVD(4) }, |
1966 |
+ { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X220_X500D), |
1967 |
+diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c |
1968 |
+index a18112a83faed..dda8bd39c9186 100644 |
1969 |
+--- a/drivers/usb/typec/ucsi/ucsi_acpi.c |
1970 |
++++ b/drivers/usb/typec/ucsi/ucsi_acpi.c |
1971 |
+@@ -64,11 +64,15 @@ static void ucsi_acpi_notify(acpi_handle handle, u32 event, void *data) |
1972 |
+ |
1973 |
+ static int ucsi_acpi_probe(struct platform_device *pdev) |
1974 |
+ { |
1975 |
++ struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); |
1976 |
+ struct ucsi_acpi *ua; |
1977 |
+ struct resource *res; |
1978 |
+ acpi_status status; |
1979 |
+ int ret; |
1980 |
+ |
1981 |
++ if (adev->dep_unmet) |
1982 |
++ return -EPROBE_DEFER; |
1983 |
++ |
1984 |
+ ua = devm_kzalloc(&pdev->dev, sizeof(*ua), GFP_KERNEL); |
1985 |
+ if (!ua) |
1986 |
+ return -ENOMEM; |
1987 |
+diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig |
1988 |
+index 787792c3d08d6..40d5fea8513cf 100644 |
1989 |
+--- a/drivers/video/console/Kconfig |
1990 |
++++ b/drivers/video/console/Kconfig |
1991 |
+@@ -21,52 +21,6 @@ config VGA_CONSOLE |
1992 |
+ |
1993 |
+ Say Y. |
1994 |
+ |
1995 |
+-config VGACON_SOFT_SCROLLBACK |
1996 |
+- bool "Enable Scrollback Buffer in System RAM" |
1997 |
+- depends on VGA_CONSOLE |
1998 |
+- default n |
1999 |
+- help |
2000 |
+- The scrollback buffer of the standard VGA console is located in |
2001 |
+- the VGA RAM. The size of this RAM is fixed and is quite small. |
2002 |
+- If you require a larger scrollback buffer, this can be placed in |
2003 |
+- System RAM which is dynamically allocated during initialization. |
2004 |
+- Placing the scrollback buffer in System RAM will slightly slow |
2005 |
+- down the console. |
2006 |
+- |
2007 |
+- If you want this feature, say 'Y' here and enter the amount of |
2008 |
+- RAM to allocate for this buffer. If unsure, say 'N'. |
2009 |
+- |
2010 |
+-config VGACON_SOFT_SCROLLBACK_SIZE |
2011 |
+- int "Scrollback Buffer Size (in KB)" |
2012 |
+- depends on VGACON_SOFT_SCROLLBACK |
2013 |
+- range 1 1024 |
2014 |
+- default "64" |
2015 |
+- help |
2016 |
+- Enter the amount of System RAM to allocate for scrollback |
2017 |
+- buffers of VGA consoles. Each 64KB will give you approximately |
2018 |
+- 16 80x25 screenfuls of scrollback buffer. |
2019 |
+- |
2020 |
+-config VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT |
2021 |
+- bool "Persistent Scrollback History for each console by default" |
2022 |
+- depends on VGACON_SOFT_SCROLLBACK |
2023 |
+- default n |
2024 |
+- help |
2025 |
+- Say Y here if the scrollback history should persist by default when |
2026 |
+- switching between consoles. Otherwise, the scrollback history will be |
2027 |
+- flushed each time the console is switched. This feature can also be |
2028 |
+- enabled using the boot command line parameter |
2029 |
+- 'vgacon.scrollback_persistent=1'. |
2030 |
+- |
2031 |
+- This feature might break your tool of choice to flush the scrollback |
2032 |
+- buffer, e.g. clear(1) will work fine but Debian's clear_console(1) |
2033 |
+- will be broken, which might cause security issues. |
2034 |
+- You can use the escape sequence \e[3J instead if this feature is |
2035 |
+- activated. |
2036 |
+- |
2037 |
+- Note that a buffer of VGACON_SOFT_SCROLLBACK_SIZE is taken for each |
2038 |
+- created tty device. |
2039 |
+- So if you use a RAM-constrained system, say N here. |
2040 |
+- |
2041 |
+ config MDA_CONSOLE |
2042 |
+ depends on !M68K && !PARISC && ISA |
2043 |
+ tristate "MDA text console (dual-headed)" |
2044 |
+diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c |
2045 |
+index e079b910feb24..55507df335bdd 100644 |
2046 |
+--- a/drivers/video/console/vgacon.c |
2047 |
++++ b/drivers/video/console/vgacon.c |
2048 |
+@@ -165,214 +165,6 @@ static inline void vga_set_mem_top(struct vc_data *c) |
2049 |
+ write_vga(12, (c->vc_visible_origin - vga_vram_base) / 2); |
2050 |
+ } |
2051 |
+ |
2052 |
+-#ifdef CONFIG_VGACON_SOFT_SCROLLBACK |
2053 |
+-/* software scrollback */ |
2054 |
+-struct vgacon_scrollback_info { |
2055 |
+- void *data; |
2056 |
+- int tail; |
2057 |
+- int size; |
2058 |
+- int rows; |
2059 |
+- int cnt; |
2060 |
+- int cur; |
2061 |
+- int save; |
2062 |
+- int restore; |
2063 |
+-}; |
2064 |
+- |
2065 |
+-static struct vgacon_scrollback_info *vgacon_scrollback_cur; |
2066 |
+-static struct vgacon_scrollback_info vgacon_scrollbacks[MAX_NR_CONSOLES]; |
2067 |
+-static bool scrollback_persistent = \ |
2068 |
+- IS_ENABLED(CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT); |
2069 |
+-module_param_named(scrollback_persistent, scrollback_persistent, bool, 0000); |
2070 |
+-MODULE_PARM_DESC(scrollback_persistent, "Enable persistent scrollback for all vga consoles"); |
2071 |
+- |
2072 |
+-static void vgacon_scrollback_reset(int vc_num, size_t reset_size) |
2073 |
+-{ |
2074 |
+- struct vgacon_scrollback_info *scrollback = &vgacon_scrollbacks[vc_num]; |
2075 |
+- |
2076 |
+- if (scrollback->data && reset_size > 0) |
2077 |
+- memset(scrollback->data, 0, reset_size); |
2078 |
+- |
2079 |
+- scrollback->cnt = 0; |
2080 |
+- scrollback->tail = 0; |
2081 |
+- scrollback->cur = 0; |
2082 |
+-} |
2083 |
+- |
2084 |
+-static void vgacon_scrollback_init(int vc_num) |
2085 |
+-{ |
2086 |
+- int pitch = vga_video_num_columns * 2; |
2087 |
+- size_t size = CONFIG_VGACON_SOFT_SCROLLBACK_SIZE * 1024; |
2088 |
+- int rows = size / pitch; |
2089 |
+- void *data; |
2090 |
+- |
2091 |
+- data = kmalloc_array(CONFIG_VGACON_SOFT_SCROLLBACK_SIZE, 1024, |
2092 |
+- GFP_NOWAIT); |
2093 |
+- |
2094 |
+- vgacon_scrollbacks[vc_num].data = data; |
2095 |
+- vgacon_scrollback_cur = &vgacon_scrollbacks[vc_num]; |
2096 |
+- |
2097 |
+- vgacon_scrollback_cur->rows = rows - 1; |
2098 |
+- vgacon_scrollback_cur->size = rows * pitch; |
2099 |
+- |
2100 |
+- vgacon_scrollback_reset(vc_num, size); |
2101 |
+-} |
2102 |
+- |
2103 |
+-static void vgacon_scrollback_switch(int vc_num) |
2104 |
+-{ |
2105 |
+- if (!scrollback_persistent) |
2106 |
+- vc_num = 0; |
2107 |
+- |
2108 |
+- if (!vgacon_scrollbacks[vc_num].data) { |
2109 |
+- vgacon_scrollback_init(vc_num); |
2110 |
+- } else { |
2111 |
+- if (scrollback_persistent) { |
2112 |
+- vgacon_scrollback_cur = &vgacon_scrollbacks[vc_num]; |
2113 |
+- } else { |
2114 |
+- size_t size = CONFIG_VGACON_SOFT_SCROLLBACK_SIZE * 1024; |
2115 |
+- |
2116 |
+- vgacon_scrollback_reset(vc_num, size); |
2117 |
+- } |
2118 |
+- } |
2119 |
+-} |
2120 |
+- |
2121 |
+-static void vgacon_scrollback_startup(void) |
2122 |
+-{ |
2123 |
+- vgacon_scrollback_cur = &vgacon_scrollbacks[0]; |
2124 |
+- vgacon_scrollback_init(0); |
2125 |
+-} |
2126 |
+- |
2127 |
+-static void vgacon_scrollback_update(struct vc_data *c, int t, int count) |
2128 |
+-{ |
2129 |
+- void *p; |
2130 |
+- |
2131 |
+- if (!vgacon_scrollback_cur->data || !vgacon_scrollback_cur->size || |
2132 |
+- c->vc_num != fg_console) |
2133 |
+- return; |
2134 |
+- |
2135 |
+- p = (void *) (c->vc_origin + t * c->vc_size_row); |
2136 |
+- |
2137 |
+- while (count--) { |
2138 |
+- if ((vgacon_scrollback_cur->tail + c->vc_size_row) > |
2139 |
+- vgacon_scrollback_cur->size) |
2140 |
+- vgacon_scrollback_cur->tail = 0; |
2141 |
+- |
2142 |
+- scr_memcpyw(vgacon_scrollback_cur->data + |
2143 |
+- vgacon_scrollback_cur->tail, |
2144 |
+- p, c->vc_size_row); |
2145 |
+- |
2146 |
+- vgacon_scrollback_cur->cnt++; |
2147 |
+- p += c->vc_size_row; |
2148 |
+- vgacon_scrollback_cur->tail += c->vc_size_row; |
2149 |
+- |
2150 |
+- if (vgacon_scrollback_cur->tail >= vgacon_scrollback_cur->size) |
2151 |
+- vgacon_scrollback_cur->tail = 0; |
2152 |
+- |
2153 |
+- if (vgacon_scrollback_cur->cnt > vgacon_scrollback_cur->rows) |
2154 |
+- vgacon_scrollback_cur->cnt = vgacon_scrollback_cur->rows; |
2155 |
+- |
2156 |
+- vgacon_scrollback_cur->cur = vgacon_scrollback_cur->cnt; |
2157 |
+- } |
2158 |
+-} |
2159 |
+- |
2160 |
+-static void vgacon_restore_screen(struct vc_data *c) |
2161 |
+-{ |
2162 |
+- c->vc_origin = c->vc_visible_origin; |
2163 |
+- vgacon_scrollback_cur->save = 0; |
2164 |
+- |
2165 |
+- if (!vga_is_gfx && !vgacon_scrollback_cur->restore) { |
2166 |
+- scr_memcpyw((u16 *) c->vc_origin, (u16 *) c->vc_screenbuf, |
2167 |
+- c->vc_screenbuf_size > vga_vram_size ? |
2168 |
+- vga_vram_size : c->vc_screenbuf_size); |
2169 |
+- vgacon_scrollback_cur->restore = 1; |
2170 |
+- vgacon_scrollback_cur->cur = vgacon_scrollback_cur->cnt; |
2171 |
+- } |
2172 |
+-} |
2173 |
+- |
2174 |
+-static void vgacon_scrolldelta(struct vc_data *c, int lines) |
2175 |
+-{ |
2176 |
+- int start, end, count, soff; |
2177 |
+- |
2178 |
+- if (!lines) { |
2179 |
+- vgacon_restore_screen(c); |
2180 |
+- return; |
2181 |
+- } |
2182 |
+- |
2183 |
+- if (!vgacon_scrollback_cur->data) |
2184 |
+- return; |
2185 |
+- |
2186 |
+- if (!vgacon_scrollback_cur->save) { |
2187 |
+- vgacon_cursor(c, CM_ERASE); |
2188 |
+- vgacon_save_screen(c); |
2189 |
+- c->vc_origin = (unsigned long)c->vc_screenbuf; |
2190 |
+- vgacon_scrollback_cur->save = 1; |
2191 |
+- } |
2192 |
+- |
2193 |
+- vgacon_scrollback_cur->restore = 0; |
2194 |
+- start = vgacon_scrollback_cur->cur + lines; |
2195 |
+- end = start + abs(lines); |
2196 |
+- |
2197 |
+- if (start < 0) |
2198 |
+- start = 0; |
2199 |
+- |
2200 |
+- if (start > vgacon_scrollback_cur->cnt) |
2201 |
+- start = vgacon_scrollback_cur->cnt; |
2202 |
+- |
2203 |
+- if (end < 0) |
2204 |
+- end = 0; |
2205 |
+- |
2206 |
+- if (end > vgacon_scrollback_cur->cnt) |
2207 |
+- end = vgacon_scrollback_cur->cnt; |
2208 |
+- |
2209 |
+- vgacon_scrollback_cur->cur = start; |
2210 |
+- count = end - start; |
2211 |
+- soff = vgacon_scrollback_cur->tail - |
2212 |
+- ((vgacon_scrollback_cur->cnt - end) * c->vc_size_row); |
2213 |
+- soff -= count * c->vc_size_row; |
2214 |
+- |
2215 |
+- if (soff < 0) |
2216 |
+- soff += vgacon_scrollback_cur->size; |
2217 |
+- |
2218 |
+- count = vgacon_scrollback_cur->cnt - start; |
2219 |
+- |
2220 |
+- if (count > c->vc_rows) |
2221 |
+- count = c->vc_rows; |
2222 |
+- |
2223 |
+- if (count) { |
2224 |
+- int copysize; |
2225 |
+- |
2226 |
+- int diff = c->vc_rows - count; |
2227 |
+- void *d = (void *) c->vc_visible_origin; |
2228 |
+- void *s = (void *) c->vc_screenbuf; |
2229 |
+- |
2230 |
+- count *= c->vc_size_row; |
2231 |
+- /* how much memory to end of buffer left? */ |
2232 |
+- copysize = min(count, vgacon_scrollback_cur->size - soff); |
2233 |
+- scr_memcpyw(d, vgacon_scrollback_cur->data + soff, copysize); |
2234 |
+- d += copysize; |
2235 |
+- count -= copysize; |
2236 |
+- |
2237 |
+- if (count) { |
2238 |
+- scr_memcpyw(d, vgacon_scrollback_cur->data, count); |
2239 |
+- d += count; |
2240 |
+- } |
2241 |
+- |
2242 |
+- if (diff) |
2243 |
+- scr_memcpyw(d, s, diff * c->vc_size_row); |
2244 |
+- } else |
2245 |
+- vgacon_cursor(c, CM_MOVE); |
2246 |
+-} |
2247 |
+- |
2248 |
+-static void vgacon_flush_scrollback(struct vc_data *c) |
2249 |
+-{ |
2250 |
+- size_t size = CONFIG_VGACON_SOFT_SCROLLBACK_SIZE * 1024; |
2251 |
+- |
2252 |
+- vgacon_scrollback_reset(c->vc_num, size); |
2253 |
+-} |
2254 |
+-#else |
2255 |
+-#define vgacon_scrollback_startup(...) do { } while (0) |
2256 |
+-#define vgacon_scrollback_init(...) do { } while (0) |
2257 |
+-#define vgacon_scrollback_update(...) do { } while (0) |
2258 |
+-#define vgacon_scrollback_switch(...) do { } while (0) |
2259 |
+- |
2260 |
+ static void vgacon_restore_screen(struct vc_data *c) |
2261 |
+ { |
2262 |
+ if (c->vc_origin != c->vc_visible_origin) |
2263 |
+@@ -386,11 +178,6 @@ static void vgacon_scrolldelta(struct vc_data *c, int lines) |
2264 |
+ vga_set_mem_top(c); |
2265 |
+ } |
2266 |
+ |
2267 |
+-static void vgacon_flush_scrollback(struct vc_data *c) |
2268 |
+-{ |
2269 |
+-} |
2270 |
+-#endif /* CONFIG_VGACON_SOFT_SCROLLBACK */ |
2271 |
+- |
2272 |
+ static const char *vgacon_startup(void) |
2273 |
+ { |
2274 |
+ const char *display_desc = NULL; |
2275 |
+@@ -573,10 +360,7 @@ static const char *vgacon_startup(void) |
2276 |
+ vgacon_xres = screen_info.orig_video_cols * VGA_FONTWIDTH; |
2277 |
+ vgacon_yres = vga_scan_lines; |
2278 |
+ |
2279 |
+- if (!vga_init_done) { |
2280 |
+- vgacon_scrollback_startup(); |
2281 |
+- vga_init_done = true; |
2282 |
+- } |
2283 |
++ vga_init_done = true; |
2284 |
+ |
2285 |
+ return display_desc; |
2286 |
+ } |
2287 |
+@@ -867,7 +651,6 @@ static int vgacon_switch(struct vc_data *c) |
2288 |
+ vgacon_doresize(c, c->vc_cols, c->vc_rows); |
2289 |
+ } |
2290 |
+ |
2291 |
+- vgacon_scrollback_switch(c->vc_num); |
2292 |
+ return 0; /* Redrawing not needed */ |
2293 |
+ } |
2294 |
+ |
2295 |
+@@ -1384,7 +1167,6 @@ static bool vgacon_scroll(struct vc_data *c, unsigned int t, unsigned int b, |
2296 |
+ oldo = c->vc_origin; |
2297 |
+ delta = lines * c->vc_size_row; |
2298 |
+ if (dir == SM_UP) { |
2299 |
+- vgacon_scrollback_update(c, t, lines); |
2300 |
+ if (c->vc_scr_end + delta >= vga_vram_end) { |
2301 |
+ scr_memcpyw((u16 *) vga_vram_base, |
2302 |
+ (u16 *) (oldo + delta), |
2303 |
+@@ -1448,7 +1230,6 @@ const struct consw vga_con = { |
2304 |
+ .con_save_screen = vgacon_save_screen, |
2305 |
+ .con_build_attr = vgacon_build_attr, |
2306 |
+ .con_invert_region = vgacon_invert_region, |
2307 |
+- .con_flush_scrollback = vgacon_flush_scrollback, |
2308 |
+ }; |
2309 |
+ EXPORT_SYMBOL(vga_con); |
2310 |
+ |
2311 |
+diff --git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/bitblit.c |
2312 |
+index 35ebeeccde4df..436365efae731 100644 |
2313 |
+--- a/drivers/video/fbdev/core/bitblit.c |
2314 |
++++ b/drivers/video/fbdev/core/bitblit.c |
2315 |
+@@ -234,7 +234,7 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info, |
2316 |
+ } |
2317 |
+ |
2318 |
+ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode, |
2319 |
+- int softback_lines, int fg, int bg) |
2320 |
++ int fg, int bg) |
2321 |
+ { |
2322 |
+ struct fb_cursor cursor; |
2323 |
+ struct fbcon_ops *ops = info->fbcon_par; |
2324 |
+@@ -247,15 +247,6 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode, |
2325 |
+ |
2326 |
+ cursor.set = 0; |
2327 |
+ |
2328 |
+- if (softback_lines) { |
2329 |
+- if (y + softback_lines >= vc->vc_rows) { |
2330 |
+- mode = CM_ERASE; |
2331 |
+- ops->cursor_flash = 0; |
2332 |
+- return; |
2333 |
+- } else |
2334 |
+- y += softback_lines; |
2335 |
+- } |
2336 |
+- |
2337 |
+ c = scr_readw((u16 *) vc->vc_pos); |
2338 |
+ attribute = get_attribute(info, c); |
2339 |
+ src = vc->vc_font.data + ((c & charmask) * (w * vc->vc_font.height)); |
2340 |
+diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c |
2341 |
+index f75557b39a61d..29226b6cb632d 100644 |
2342 |
+--- a/drivers/video/fbdev/core/fbcon.c |
2343 |
++++ b/drivers/video/fbdev/core/fbcon.c |
2344 |
+@@ -102,12 +102,6 @@ static int logo_lines; |
2345 |
+ /* logo_shown is an index to vc_cons when >= 0; otherwise follows FBCON_LOGO |
2346 |
+ enums. */ |
2347 |
+ static int logo_shown = FBCON_LOGO_CANSHOW; |
2348 |
+-/* Software scrollback */ |
2349 |
+-static int fbcon_softback_size = 32768; |
2350 |
+-static unsigned long softback_buf, softback_curr; |
2351 |
+-static unsigned long softback_in; |
2352 |
+-static unsigned long softback_top, softback_end; |
2353 |
+-static int softback_lines; |
2354 |
+ /* console mappings */ |
2355 |
+ static int first_fb_vc; |
2356 |
+ static int last_fb_vc = MAX_NR_CONSOLES - 1; |
2357 |
+@@ -148,8 +142,6 @@ static int margin_color; |
2358 |
+ |
2359 |
+ static const struct consw fb_con; |
2360 |
+ |
2361 |
+-#define CM_SOFTBACK (8) |
2362 |
+- |
2363 |
+ #define advance_row(p, delta) (unsigned short *)((unsigned long)(p) + (delta) * vc->vc_size_row) |
2364 |
+ |
2365 |
+ static int fbcon_set_origin(struct vc_data *); |
2366 |
+@@ -355,18 +347,6 @@ static int get_color(struct vc_data *vc, struct fb_info *info, |
2367 |
+ return color; |
2368 |
+ } |
2369 |
+ |
2370 |
+-static void fbcon_update_softback(struct vc_data *vc) |
2371 |
+-{ |
2372 |
+- int l = fbcon_softback_size / vc->vc_size_row; |
2373 |
+- |
2374 |
+- if (l > 5) |
2375 |
+- softback_end = softback_buf + l * vc->vc_size_row; |
2376 |
+- else |
2377 |
+- /* Smaller scrollback makes no sense, and 0 would screw |
2378 |
+- the operation totally */ |
2379 |
+- softback_top = 0; |
2380 |
+-} |
2381 |
+- |
2382 |
+ static void fb_flashcursor(struct work_struct *work) |
2383 |
+ { |
2384 |
+ struct fb_info *info = container_of(work, struct fb_info, queue); |
2385 |
+@@ -396,7 +376,7 @@ static void fb_flashcursor(struct work_struct *work) |
2386 |
+ c = scr_readw((u16 *) vc->vc_pos); |
2387 |
+ mode = (!ops->cursor_flash || ops->cursor_state.enable) ? |
2388 |
+ CM_ERASE : CM_DRAW; |
2389 |
+- ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1), |
2390 |
++ ops->cursor(vc, info, mode, get_color(vc, info, c, 1), |
2391 |
+ get_color(vc, info, c, 0)); |
2392 |
+ console_unlock(); |
2393 |
+ } |
2394 |
+@@ -453,13 +433,7 @@ static int __init fb_console_setup(char *this_opt) |
2395 |
+ } |
2396 |
+ |
2397 |
+ if (!strncmp(options, "scrollback:", 11)) { |
2398 |
+- options += 11; |
2399 |
+- if (*options) { |
2400 |
+- fbcon_softback_size = simple_strtoul(options, &options, 0); |
2401 |
+- if (*options == 'k' || *options == 'K') { |
2402 |
+- fbcon_softback_size *= 1024; |
2403 |
+- } |
2404 |
+- } |
2405 |
++ pr_warn("Ignoring scrollback size option\n"); |
2406 |
+ continue; |
2407 |
+ } |
2408 |
+ |
2409 |
+@@ -988,31 +962,6 @@ static const char *fbcon_startup(void) |
2410 |
+ |
2411 |
+ set_blitting_type(vc, info); |
2412 |
+ |
2413 |
+- if (info->fix.type != FB_TYPE_TEXT) { |
2414 |
+- if (fbcon_softback_size) { |
2415 |
+- if (!softback_buf) { |
2416 |
+- softback_buf = |
2417 |
+- (unsigned long) |
2418 |
+- kmalloc(fbcon_softback_size, |
2419 |
+- GFP_KERNEL); |
2420 |
+- if (!softback_buf) { |
2421 |
+- fbcon_softback_size = 0; |
2422 |
+- softback_top = 0; |
2423 |
+- } |
2424 |
+- } |
2425 |
+- } else { |
2426 |
+- if (softback_buf) { |
2427 |
+- kfree((void *) softback_buf); |
2428 |
+- softback_buf = 0; |
2429 |
+- softback_top = 0; |
2430 |
+- } |
2431 |
+- } |
2432 |
+- if (softback_buf) |
2433 |
+- softback_in = softback_top = softback_curr = |
2434 |
+- softback_buf; |
2435 |
+- softback_lines = 0; |
2436 |
+- } |
2437 |
+- |
2438 |
+ /* Setup default font */ |
2439 |
+ if (!p->fontdata && !vc->vc_font.data) { |
2440 |
+ if (!fontname[0] || !(font = find_font(fontname))) |
2441 |
+@@ -1181,9 +1130,6 @@ static void fbcon_init(struct vc_data *vc, int init) |
2442 |
+ if (logo) |
2443 |
+ fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows); |
2444 |
+ |
2445 |
+- if (vc == svc && softback_buf) |
2446 |
+- fbcon_update_softback(vc); |
2447 |
+- |
2448 |
+ if (ops->rotate_font && ops->rotate_font(info, vc)) { |
2449 |
+ ops->rotate = FB_ROTATE_UR; |
2450 |
+ set_blitting_type(vc, info); |
2451 |
+@@ -1346,7 +1292,6 @@ static void fbcon_cursor(struct vc_data *vc, int mode) |
2452 |
+ { |
2453 |
+ struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
2454 |
+ struct fbcon_ops *ops = info->fbcon_par; |
2455 |
+- int y; |
2456 |
+ int c = scr_readw((u16 *) vc->vc_pos); |
2457 |
+ |
2458 |
+ ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms); |
2459 |
+@@ -1360,16 +1305,8 @@ static void fbcon_cursor(struct vc_data *vc, int mode) |
2460 |
+ fbcon_add_cursor_timer(info); |
2461 |
+ |
2462 |
+ ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1; |
2463 |
+- if (mode & CM_SOFTBACK) { |
2464 |
+- mode &= ~CM_SOFTBACK; |
2465 |
+- y = softback_lines; |
2466 |
+- } else { |
2467 |
+- if (softback_lines) |
2468 |
+- fbcon_set_origin(vc); |
2469 |
+- y = 0; |
2470 |
+- } |
2471 |
+ |
2472 |
+- ops->cursor(vc, info, mode, y, get_color(vc, info, c, 1), |
2473 |
++ ops->cursor(vc, info, mode, get_color(vc, info, c, 1), |
2474 |
+ get_color(vc, info, c, 0)); |
2475 |
+ } |
2476 |
+ |
2477 |
+@@ -1440,8 +1377,6 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var, |
2478 |
+ |
2479 |
+ if (con_is_visible(vc)) { |
2480 |
+ update_screen(vc); |
2481 |
+- if (softback_buf) |
2482 |
+- fbcon_update_softback(vc); |
2483 |
+ } |
2484 |
+ } |
2485 |
+ |
2486 |
+@@ -1579,99 +1514,6 @@ static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int count) |
2487 |
+ scrollback_current = 0; |
2488 |
+ } |
2489 |
+ |
2490 |
+-static void fbcon_redraw_softback(struct vc_data *vc, struct display *p, |
2491 |
+- long delta) |
2492 |
+-{ |
2493 |
+- int count = vc->vc_rows; |
2494 |
+- unsigned short *d, *s; |
2495 |
+- unsigned long n; |
2496 |
+- int line = 0; |
2497 |
+- |
2498 |
+- d = (u16 *) softback_curr; |
2499 |
+- if (d == (u16 *) softback_in) |
2500 |
+- d = (u16 *) vc->vc_origin; |
2501 |
+- n = softback_curr + delta * vc->vc_size_row; |
2502 |
+- softback_lines -= delta; |
2503 |
+- if (delta < 0) { |
2504 |
+- if (softback_curr < softback_top && n < softback_buf) { |
2505 |
+- n += softback_end - softback_buf; |
2506 |
+- if (n < softback_top) { |
2507 |
+- softback_lines -= |
2508 |
+- (softback_top - n) / vc->vc_size_row; |
2509 |
+- n = softback_top; |
2510 |
+- } |
2511 |
+- } else if (softback_curr >= softback_top |
2512 |
+- && n < softback_top) { |
2513 |
+- softback_lines -= |
2514 |
+- (softback_top - n) / vc->vc_size_row; |
2515 |
+- n = softback_top; |
2516 |
+- } |
2517 |
+- } else { |
2518 |
+- if (softback_curr > softback_in && n >= softback_end) { |
2519 |
+- n += softback_buf - softback_end; |
2520 |
+- if (n > softback_in) { |
2521 |
+- n = softback_in; |
2522 |
+- softback_lines = 0; |
2523 |
+- } |
2524 |
+- } else if (softback_curr <= softback_in && n > softback_in) { |
2525 |
+- n = softback_in; |
2526 |
+- softback_lines = 0; |
2527 |
+- } |
2528 |
+- } |
2529 |
+- if (n == softback_curr) |
2530 |
+- return; |
2531 |
+- softback_curr = n; |
2532 |
+- s = (u16 *) softback_curr; |
2533 |
+- if (s == (u16 *) softback_in) |
2534 |
+- s = (u16 *) vc->vc_origin; |
2535 |
+- while (count--) { |
2536 |
+- unsigned short *start; |
2537 |
+- unsigned short *le; |
2538 |
+- unsigned short c; |
2539 |
+- int x = 0; |
2540 |
+- unsigned short attr = 1; |
2541 |
+- |
2542 |
+- start = s; |
2543 |
+- le = advance_row(s, 1); |
2544 |
+- do { |
2545 |
+- c = scr_readw(s); |
2546 |
+- if (attr != (c & 0xff00)) { |
2547 |
+- attr = c & 0xff00; |
2548 |
+- if (s > start) { |
2549 |
+- fbcon_putcs(vc, start, s - start, |
2550 |
+- line, x); |
2551 |
+- x += s - start; |
2552 |
+- start = s; |
2553 |
+- } |
2554 |
+- } |
2555 |
+- if (c == scr_readw(d)) { |
2556 |
+- if (s > start) { |
2557 |
+- fbcon_putcs(vc, start, s - start, |
2558 |
+- line, x); |
2559 |
+- x += s - start + 1; |
2560 |
+- start = s + 1; |
2561 |
+- } else { |
2562 |
+- x++; |
2563 |
+- start++; |
2564 |
+- } |
2565 |
+- } |
2566 |
+- s++; |
2567 |
+- d++; |
2568 |
+- } while (s < le); |
2569 |
+- if (s > start) |
2570 |
+- fbcon_putcs(vc, start, s - start, line, x); |
2571 |
+- line++; |
2572 |
+- if (d == (u16 *) softback_end) |
2573 |
+- d = (u16 *) softback_buf; |
2574 |
+- if (d == (u16 *) softback_in) |
2575 |
+- d = (u16 *) vc->vc_origin; |
2576 |
+- if (s == (u16 *) softback_end) |
2577 |
+- s = (u16 *) softback_buf; |
2578 |
+- if (s == (u16 *) softback_in) |
2579 |
+- s = (u16 *) vc->vc_origin; |
2580 |
+- } |
2581 |
+-} |
2582 |
+- |
2583 |
+ static void fbcon_redraw_move(struct vc_data *vc, struct display *p, |
2584 |
+ int line, int count, int dy) |
2585 |
+ { |
2586 |
+@@ -1811,31 +1653,6 @@ static void fbcon_redraw(struct vc_data *vc, struct display *p, |
2587 |
+ } |
2588 |
+ } |
2589 |
+ |
2590 |
+-static inline void fbcon_softback_note(struct vc_data *vc, int t, |
2591 |
+- int count) |
2592 |
+-{ |
2593 |
+- unsigned short *p; |
2594 |
+- |
2595 |
+- if (vc->vc_num != fg_console) |
2596 |
+- return; |
2597 |
+- p = (unsigned short *) (vc->vc_origin + t * vc->vc_size_row); |
2598 |
+- |
2599 |
+- while (count) { |
2600 |
+- scr_memcpyw((u16 *) softback_in, p, vc->vc_size_row); |
2601 |
+- count--; |
2602 |
+- p = advance_row(p, 1); |
2603 |
+- softback_in += vc->vc_size_row; |
2604 |
+- if (softback_in == softback_end) |
2605 |
+- softback_in = softback_buf; |
2606 |
+- if (softback_in == softback_top) { |
2607 |
+- softback_top += vc->vc_size_row; |
2608 |
+- if (softback_top == softback_end) |
2609 |
+- softback_top = softback_buf; |
2610 |
+- } |
2611 |
+- } |
2612 |
+- softback_curr = softback_in; |
2613 |
+-} |
2614 |
+- |
2615 |
+ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b, |
2616 |
+ enum con_scroll dir, unsigned int count) |
2617 |
+ { |
2618 |
+@@ -1858,8 +1675,6 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b, |
2619 |
+ case SM_UP: |
2620 |
+ if (count > vc->vc_rows) /* Maximum realistic size */ |
2621 |
+ count = vc->vc_rows; |
2622 |
+- if (softback_top) |
2623 |
+- fbcon_softback_note(vc, t, count); |
2624 |
+ if (logo_shown >= 0) |
2625 |
+ goto redraw_up; |
2626 |
+ switch (p->scrollmode) { |
2627 |
+@@ -2230,14 +2045,6 @@ static int fbcon_switch(struct vc_data *vc) |
2628 |
+ info = registered_fb[con2fb_map[vc->vc_num]]; |
2629 |
+ ops = info->fbcon_par; |
2630 |
+ |
2631 |
+- if (softback_top) { |
2632 |
+- if (softback_lines) |
2633 |
+- fbcon_set_origin(vc); |
2634 |
+- softback_top = softback_curr = softback_in = softback_buf; |
2635 |
+- softback_lines = 0; |
2636 |
+- fbcon_update_softback(vc); |
2637 |
+- } |
2638 |
+- |
2639 |
+ if (logo_shown >= 0) { |
2640 |
+ struct vc_data *conp2 = vc_cons[logo_shown].d; |
2641 |
+ |
2642 |
+@@ -2571,9 +2378,6 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, |
2643 |
+ int cnt; |
2644 |
+ char *old_data = NULL; |
2645 |
+ |
2646 |
+- if (con_is_visible(vc) && softback_lines) |
2647 |
+- fbcon_set_origin(vc); |
2648 |
+- |
2649 |
+ resize = (w != vc->vc_font.width) || (h != vc->vc_font.height); |
2650 |
+ if (p->userfont) |
2651 |
+ old_data = vc->vc_font.data; |
2652 |
+@@ -2599,8 +2403,6 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, |
2653 |
+ cols /= w; |
2654 |
+ rows /= h; |
2655 |
+ vc_resize(vc, cols, rows); |
2656 |
+- if (con_is_visible(vc) && softback_buf) |
2657 |
+- fbcon_update_softback(vc); |
2658 |
+ } else if (con_is_visible(vc) |
2659 |
+ && vc->vc_mode == KD_TEXT) { |
2660 |
+ fbcon_clear_margins(vc, 0); |
2661 |
+@@ -2759,19 +2561,7 @@ static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table) |
2662 |
+ |
2663 |
+ static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) |
2664 |
+ { |
2665 |
+- unsigned long p; |
2666 |
+- int line; |
2667 |
+- |
2668 |
+- if (vc->vc_num != fg_console || !softback_lines) |
2669 |
+- return (u16 *) (vc->vc_origin + offset); |
2670 |
+- line = offset / vc->vc_size_row; |
2671 |
+- if (line >= softback_lines) |
2672 |
+- return (u16 *) (vc->vc_origin + offset - |
2673 |
+- softback_lines * vc->vc_size_row); |
2674 |
+- p = softback_curr + offset; |
2675 |
+- if (p >= softback_end) |
2676 |
+- p += softback_buf - softback_end; |
2677 |
+- return (u16 *) p; |
2678 |
++ return (u16 *) (vc->vc_origin + offset); |
2679 |
+ } |
2680 |
+ |
2681 |
+ static unsigned long fbcon_getxy(struct vc_data *vc, unsigned long pos, |
2682 |
+@@ -2785,22 +2575,7 @@ static unsigned long fbcon_getxy(struct vc_data *vc, unsigned long pos, |
2683 |
+ |
2684 |
+ x = offset % vc->vc_cols; |
2685 |
+ y = offset / vc->vc_cols; |
2686 |
+- if (vc->vc_num == fg_console) |
2687 |
+- y += softback_lines; |
2688 |
+ ret = pos + (vc->vc_cols - x) * 2; |
2689 |
+- } else if (vc->vc_num == fg_console && softback_lines) { |
2690 |
+- unsigned long offset = pos - softback_curr; |
2691 |
+- |
2692 |
+- if (pos < softback_curr) |
2693 |
+- offset += softback_end - softback_buf; |
2694 |
+- offset /= 2; |
2695 |
+- x = offset % vc->vc_cols; |
2696 |
+- y = offset / vc->vc_cols; |
2697 |
+- ret = pos + (vc->vc_cols - x) * 2; |
2698 |
+- if (ret == softback_end) |
2699 |
+- ret = softback_buf; |
2700 |
+- if (ret == softback_in) |
2701 |
+- ret = vc->vc_origin; |
2702 |
+ } else { |
2703 |
+ /* Should not happen */ |
2704 |
+ x = y = 0; |
2705 |
+@@ -2828,106 +2603,11 @@ static void fbcon_invert_region(struct vc_data *vc, u16 * p, int cnt) |
2706 |
+ a = ((a) & 0x88ff) | (((a) & 0x7000) >> 4) | |
2707 |
+ (((a) & 0x0700) << 4); |
2708 |
+ scr_writew(a, p++); |
2709 |
+- if (p == (u16 *) softback_end) |
2710 |
+- p = (u16 *) softback_buf; |
2711 |
+- if (p == (u16 *) softback_in) |
2712 |
+- p = (u16 *) vc->vc_origin; |
2713 |
+ } |
2714 |
+ } |
2715 |
+ |
2716 |
+-static void fbcon_scrolldelta(struct vc_data *vc, int lines) |
2717 |
+-{ |
2718 |
+- struct fb_info *info = registered_fb[con2fb_map[fg_console]]; |
2719 |
+- struct fbcon_ops *ops = info->fbcon_par; |
2720 |
+- struct display *disp = &fb_display[fg_console]; |
2721 |
+- int offset, limit, scrollback_old; |
2722 |
+- |
2723 |
+- if (softback_top) { |
2724 |
+- if (vc->vc_num != fg_console) |
2725 |
+- return; |
2726 |
+- if (vc->vc_mode != KD_TEXT || !lines) |
2727 |
+- return; |
2728 |
+- if (logo_shown >= 0) { |
2729 |
+- struct vc_data *conp2 = vc_cons[logo_shown].d; |
2730 |
+- |
2731 |
+- if (conp2->vc_top == logo_lines |
2732 |
+- && conp2->vc_bottom == conp2->vc_rows) |
2733 |
+- conp2->vc_top = 0; |
2734 |
+- if (logo_shown == vc->vc_num) { |
2735 |
+- unsigned long p, q; |
2736 |
+- int i; |
2737 |
+- |
2738 |
+- p = softback_in; |
2739 |
+- q = vc->vc_origin + |
2740 |
+- logo_lines * vc->vc_size_row; |
2741 |
+- for (i = 0; i < logo_lines; i++) { |
2742 |
+- if (p == softback_top) |
2743 |
+- break; |
2744 |
+- if (p == softback_buf) |
2745 |
+- p = softback_end; |
2746 |
+- p -= vc->vc_size_row; |
2747 |
+- q -= vc->vc_size_row; |
2748 |
+- scr_memcpyw((u16 *) q, (u16 *) p, |
2749 |
+- vc->vc_size_row); |
2750 |
+- } |
2751 |
+- softback_in = softback_curr = p; |
2752 |
+- update_region(vc, vc->vc_origin, |
2753 |
+- logo_lines * vc->vc_cols); |
2754 |
+- } |
2755 |
+- logo_shown = FBCON_LOGO_CANSHOW; |
2756 |
+- } |
2757 |
+- fbcon_cursor(vc, CM_ERASE | CM_SOFTBACK); |
2758 |
+- fbcon_redraw_softback(vc, disp, lines); |
2759 |
+- fbcon_cursor(vc, CM_DRAW | CM_SOFTBACK); |
2760 |
+- return; |
2761 |
+- } |
2762 |
+- |
2763 |
+- if (!scrollback_phys_max) |
2764 |
+- return; |
2765 |
+- |
2766 |
+- scrollback_old = scrollback_current; |
2767 |
+- scrollback_current -= lines; |
2768 |
+- if (scrollback_current < 0) |
2769 |
+- scrollback_current = 0; |
2770 |
+- else if (scrollback_current > scrollback_max) |
2771 |
+- scrollback_current = scrollback_max; |
2772 |
+- if (scrollback_current == scrollback_old) |
2773 |
+- return; |
2774 |
+- |
2775 |
+- if (fbcon_is_inactive(vc, info)) |
2776 |
+- return; |
2777 |
+- |
2778 |
+- fbcon_cursor(vc, CM_ERASE); |
2779 |
+- |
2780 |
+- offset = disp->yscroll - scrollback_current; |
2781 |
+- limit = disp->vrows; |
2782 |
+- switch (disp->scrollmode) { |
2783 |
+- case SCROLL_WRAP_MOVE: |
2784 |
+- info->var.vmode |= FB_VMODE_YWRAP; |
2785 |
+- break; |
2786 |
+- case SCROLL_PAN_MOVE: |
2787 |
+- case SCROLL_PAN_REDRAW: |
2788 |
+- limit -= vc->vc_rows; |
2789 |
+- info->var.vmode &= ~FB_VMODE_YWRAP; |
2790 |
+- break; |
2791 |
+- } |
2792 |
+- if (offset < 0) |
2793 |
+- offset += limit; |
2794 |
+- else if (offset >= limit) |
2795 |
+- offset -= limit; |
2796 |
+- |
2797 |
+- ops->var.xoffset = 0; |
2798 |
+- ops->var.yoffset = offset * vc->vc_font.height; |
2799 |
+- ops->update_start(info); |
2800 |
+- |
2801 |
+- if (!scrollback_current) |
2802 |
+- fbcon_cursor(vc, CM_DRAW); |
2803 |
+-} |
2804 |
+- |
2805 |
+ static int fbcon_set_origin(struct vc_data *vc) |
2806 |
+ { |
2807 |
+- if (softback_lines) |
2808 |
+- fbcon_scrolldelta(vc, softback_lines); |
2809 |
+ return 0; |
2810 |
+ } |
2811 |
+ |
2812 |
+@@ -2991,8 +2671,6 @@ static void fbcon_modechanged(struct fb_info *info) |
2813 |
+ |
2814 |
+ fbcon_set_palette(vc, color_table); |
2815 |
+ update_screen(vc); |
2816 |
+- if (softback_buf) |
2817 |
+- fbcon_update_softback(vc); |
2818 |
+ } |
2819 |
+ } |
2820 |
+ |
2821 |
+@@ -3434,7 +3112,6 @@ static const struct consw fb_con = { |
2822 |
+ .con_font_default = fbcon_set_def_font, |
2823 |
+ .con_font_copy = fbcon_copy_font, |
2824 |
+ .con_set_palette = fbcon_set_palette, |
2825 |
+- .con_scrolldelta = fbcon_scrolldelta, |
2826 |
+ .con_set_origin = fbcon_set_origin, |
2827 |
+ .con_invert_region = fbcon_invert_region, |
2828 |
+ .con_screen_pos = fbcon_screen_pos, |
2829 |
+@@ -3691,9 +3368,6 @@ static void fbcon_exit(void) |
2830 |
+ } |
2831 |
+ #endif |
2832 |
+ |
2833 |
+- kfree((void *)softback_buf); |
2834 |
+- softback_buf = 0UL; |
2835 |
+- |
2836 |
+ for_each_registered_fb(i) { |
2837 |
+ int pending = 0; |
2838 |
+ |
2839 |
+diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fbcon.h |
2840 |
+index 21912a3ba32f8..aeea63abbe987 100644 |
2841 |
+--- a/drivers/video/fbdev/core/fbcon.h |
2842 |
++++ b/drivers/video/fbdev/core/fbcon.h |
2843 |
+@@ -62,7 +62,7 @@ struct fbcon_ops { |
2844 |
+ void (*clear_margins)(struct vc_data *vc, struct fb_info *info, |
2845 |
+ int color, int bottom_only); |
2846 |
+ void (*cursor)(struct vc_data *vc, struct fb_info *info, int mode, |
2847 |
+- int softback_lines, int fg, int bg); |
2848 |
++ int fg, int bg); |
2849 |
+ int (*update_start)(struct fb_info *info); |
2850 |
+ int (*rotate_font)(struct fb_info *info, struct vc_data *vc); |
2851 |
+ struct fb_var_screeninfo var; /* copy of the current fb_var_screeninfo */ |
2852 |
+diff --git a/drivers/video/fbdev/core/fbcon_ccw.c b/drivers/video/fbdev/core/fbcon_ccw.c |
2853 |
+index 78f3a56214782..71ad6967a70ee 100644 |
2854 |
+--- a/drivers/video/fbdev/core/fbcon_ccw.c |
2855 |
++++ b/drivers/video/fbdev/core/fbcon_ccw.c |
2856 |
+@@ -219,7 +219,7 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info, |
2857 |
+ } |
2858 |
+ |
2859 |
+ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode, |
2860 |
+- int softback_lines, int fg, int bg) |
2861 |
++ int fg, int bg) |
2862 |
+ { |
2863 |
+ struct fb_cursor cursor; |
2864 |
+ struct fbcon_ops *ops = info->fbcon_par; |
2865 |
+@@ -236,15 +236,6 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode, |
2866 |
+ |
2867 |
+ cursor.set = 0; |
2868 |
+ |
2869 |
+- if (softback_lines) { |
2870 |
+- if (y + softback_lines >= vc->vc_rows) { |
2871 |
+- mode = CM_ERASE; |
2872 |
+- ops->cursor_flash = 0; |
2873 |
+- return; |
2874 |
+- } else |
2875 |
+- y += softback_lines; |
2876 |
+- } |
2877 |
+- |
2878 |
+ c = scr_readw((u16 *) vc->vc_pos); |
2879 |
+ attribute = get_attribute(info, c); |
2880 |
+ src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); |
2881 |
+diff --git a/drivers/video/fbdev/core/fbcon_cw.c b/drivers/video/fbdev/core/fbcon_cw.c |
2882 |
+index fd098ff17574b..31fe5dd651d44 100644 |
2883 |
+--- a/drivers/video/fbdev/core/fbcon_cw.c |
2884 |
++++ b/drivers/video/fbdev/core/fbcon_cw.c |
2885 |
+@@ -202,7 +202,7 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info, |
2886 |
+ } |
2887 |
+ |
2888 |
+ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode, |
2889 |
+- int softback_lines, int fg, int bg) |
2890 |
++ int fg, int bg) |
2891 |
+ { |
2892 |
+ struct fb_cursor cursor; |
2893 |
+ struct fbcon_ops *ops = info->fbcon_par; |
2894 |
+@@ -219,15 +219,6 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode, |
2895 |
+ |
2896 |
+ cursor.set = 0; |
2897 |
+ |
2898 |
+- if (softback_lines) { |
2899 |
+- if (y + softback_lines >= vc->vc_rows) { |
2900 |
+- mode = CM_ERASE; |
2901 |
+- ops->cursor_flash = 0; |
2902 |
+- return; |
2903 |
+- } else |
2904 |
+- y += softback_lines; |
2905 |
+- } |
2906 |
+- |
2907 |
+ c = scr_readw((u16 *) vc->vc_pos); |
2908 |
+ attribute = get_attribute(info, c); |
2909 |
+ src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); |
2910 |
+diff --git a/drivers/video/fbdev/core/fbcon_ud.c b/drivers/video/fbdev/core/fbcon_ud.c |
2911 |
+index e165a3fad29ad..b2dd1370e39b2 100644 |
2912 |
+--- a/drivers/video/fbdev/core/fbcon_ud.c |
2913 |
++++ b/drivers/video/fbdev/core/fbcon_ud.c |
2914 |
+@@ -249,7 +249,7 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info, |
2915 |
+ } |
2916 |
+ |
2917 |
+ static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode, |
2918 |
+- int softback_lines, int fg, int bg) |
2919 |
++ int fg, int bg) |
2920 |
+ { |
2921 |
+ struct fb_cursor cursor; |
2922 |
+ struct fbcon_ops *ops = info->fbcon_par; |
2923 |
+@@ -267,15 +267,6 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode, |
2924 |
+ |
2925 |
+ cursor.set = 0; |
2926 |
+ |
2927 |
+- if (softback_lines) { |
2928 |
+- if (y + softback_lines >= vc->vc_rows) { |
2929 |
+- mode = CM_ERASE; |
2930 |
+- ops->cursor_flash = 0; |
2931 |
+- return; |
2932 |
+- } else |
2933 |
+- y += softback_lines; |
2934 |
+- } |
2935 |
+- |
2936 |
+ c = scr_readw((u16 *) vc->vc_pos); |
2937 |
+ attribute = get_attribute(info, c); |
2938 |
+ src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.height)); |
2939 |
+diff --git a/drivers/video/fbdev/core/tileblit.c b/drivers/video/fbdev/core/tileblit.c |
2940 |
+index 93390312957ff..eb664dbf96f66 100644 |
2941 |
+--- a/drivers/video/fbdev/core/tileblit.c |
2942 |
++++ b/drivers/video/fbdev/core/tileblit.c |
2943 |
+@@ -80,7 +80,7 @@ static void tile_clear_margins(struct vc_data *vc, struct fb_info *info, |
2944 |
+ } |
2945 |
+ |
2946 |
+ static void tile_cursor(struct vc_data *vc, struct fb_info *info, int mode, |
2947 |
+- int softback_lines, int fg, int bg) |
2948 |
++ int fg, int bg) |
2949 |
+ { |
2950 |
+ struct fb_tilecursor cursor; |
2951 |
+ int use_sw = (vc->vc_cursor_type & 0x10); |
2952 |
+diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c |
2953 |
+index 2c6a576ed84c7..4b83109202b1c 100644 |
2954 |
+--- a/drivers/video/fbdev/vga16fb.c |
2955 |
++++ b/drivers/video/fbdev/vga16fb.c |
2956 |
+@@ -1121,7 +1121,7 @@ static void vga_8planes_imageblit(struct fb_info *info, const struct fb_image *i |
2957 |
+ char oldop = setop(0); |
2958 |
+ char oldsr = setsr(0); |
2959 |
+ char oldmask = selectmask(); |
2960 |
+- const char *cdat = image->data; |
2961 |
++ const unsigned char *cdat = image->data; |
2962 |
+ u32 dx = image->dx; |
2963 |
+ char __iomem *where; |
2964 |
+ int y; |
2965 |
+diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c |
2966 |
+index ec3aa76d19b7f..319a89d4d0735 100644 |
2967 |
+--- a/fs/btrfs/extent-tree.c |
2968 |
++++ b/fs/btrfs/extent-tree.c |
2969 |
+@@ -1057,12 +1057,11 @@ int btrfs_get_extent_inline_ref_type(const struct extent_buffer *eb, |
2970 |
+ if (type == BTRFS_SHARED_BLOCK_REF_KEY) { |
2971 |
+ ASSERT(eb->fs_info); |
2972 |
+ /* |
2973 |
+- * Every shared one has parent tree |
2974 |
+- * block, which must be aligned to |
2975 |
+- * nodesize. |
2976 |
++ * Every shared one has parent tree block, |
2977 |
++ * which must be aligned to sector size. |
2978 |
+ */ |
2979 |
+ if (offset && |
2980 |
+- IS_ALIGNED(offset, eb->fs_info->nodesize)) |
2981 |
++ IS_ALIGNED(offset, eb->fs_info->sectorsize)) |
2982 |
+ return type; |
2983 |
+ } |
2984 |
+ } else if (is_data == BTRFS_REF_TYPE_DATA) { |
2985 |
+@@ -1071,12 +1070,11 @@ int btrfs_get_extent_inline_ref_type(const struct extent_buffer *eb, |
2986 |
+ if (type == BTRFS_SHARED_DATA_REF_KEY) { |
2987 |
+ ASSERT(eb->fs_info); |
2988 |
+ /* |
2989 |
+- * Every shared one has parent tree |
2990 |
+- * block, which must be aligned to |
2991 |
+- * nodesize. |
2992 |
++ * Every shared one has parent tree block, |
2993 |
++ * which must be aligned to sector size. |
2994 |
+ */ |
2995 |
+ if (offset && |
2996 |
+- IS_ALIGNED(offset, eb->fs_info->nodesize)) |
2997 |
++ IS_ALIGNED(offset, eb->fs_info->sectorsize)) |
2998 |
+ return type; |
2999 |
+ } |
3000 |
+ } else { |
3001 |
+@@ -1086,8 +1084,9 @@ int btrfs_get_extent_inline_ref_type(const struct extent_buffer *eb, |
3002 |
+ } |
3003 |
+ |
3004 |
+ btrfs_print_leaf((struct extent_buffer *)eb); |
3005 |
+- btrfs_err(eb->fs_info, "eb %llu invalid extent inline ref type %d", |
3006 |
+- eb->start, type); |
3007 |
++ btrfs_err(eb->fs_info, |
3008 |
++ "eb %llu iref 0x%lx invalid extent inline ref type %d", |
3009 |
++ eb->start, (unsigned long)iref, type); |
3010 |
+ WARN_ON(1); |
3011 |
+ |
3012 |
+ return BTRFS_REF_TYPE_INVALID; |
3013 |
+diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c |
3014 |
+index 85990755edd90..01a90fa03c24f 100644 |
3015 |
+--- a/fs/btrfs/ioctl.c |
3016 |
++++ b/fs/btrfs/ioctl.c |
3017 |
+@@ -2189,7 +2189,8 @@ static noinline int search_ioctl(struct inode *inode, |
3018 |
+ key.offset = sk->min_offset; |
3019 |
+ |
3020 |
+ while (1) { |
3021 |
+- ret = fault_in_pages_writeable(ubuf, *buf_size - sk_offset); |
3022 |
++ ret = fault_in_pages_writeable(ubuf + sk_offset, |
3023 |
++ *buf_size - sk_offset); |
3024 |
+ if (ret) |
3025 |
+ break; |
3026 |
+ |
3027 |
+diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c |
3028 |
+index df49931ffe922..4b217e9a581ce 100644 |
3029 |
+--- a/fs/btrfs/print-tree.c |
3030 |
++++ b/fs/btrfs/print-tree.c |
3031 |
+@@ -95,9 +95,10 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type) |
3032 |
+ * offset is supposed to be a tree block which |
3033 |
+ * must be aligned to nodesize. |
3034 |
+ */ |
3035 |
+- if (!IS_ALIGNED(offset, eb->fs_info->nodesize)) |
3036 |
+- pr_info("\t\t\t(parent %llu is NOT ALIGNED to nodesize %llu)\n", |
3037 |
+- offset, (unsigned long long)eb->fs_info->nodesize); |
3038 |
++ if (!IS_ALIGNED(offset, eb->fs_info->sectorsize)) |
3039 |
++ pr_info( |
3040 |
++ "\t\t\t(parent %llu not aligned to sectorsize %u)\n", |
3041 |
++ offset, eb->fs_info->sectorsize); |
3042 |
+ break; |
3043 |
+ case BTRFS_EXTENT_DATA_REF_KEY: |
3044 |
+ dref = (struct btrfs_extent_data_ref *)(&iref->offset); |
3045 |
+@@ -112,8 +113,9 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type) |
3046 |
+ * must be aligned to nodesize. |
3047 |
+ */ |
3048 |
+ if (!IS_ALIGNED(offset, eb->fs_info->nodesize)) |
3049 |
+- pr_info("\t\t\t(parent %llu is NOT ALIGNED to nodesize %llu)\n", |
3050 |
+- offset, (unsigned long long)eb->fs_info->nodesize); |
3051 |
++ pr_info( |
3052 |
++ "\t\t\t(parent %llu not aligned to sectorsize %u)\n", |
3053 |
++ offset, eb->fs_info->sectorsize); |
3054 |
+ break; |
3055 |
+ default: |
3056 |
+ pr_cont("(extent %llu has INVALID ref type %d)\n", |
3057 |
+diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c |
3058 |
+index 498ec4b10e610..815b655b8f10a 100644 |
3059 |
+--- a/fs/btrfs/volumes.c |
3060 |
++++ b/fs/btrfs/volumes.c |
3061 |
+@@ -4,6 +4,7 @@ |
3062 |
+ */ |
3063 |
+ |
3064 |
+ #include <linux/sched.h> |
3065 |
++#include <linux/sched/mm.h> |
3066 |
+ #include <linux/bio.h> |
3067 |
+ #include <linux/slab.h> |
3068 |
+ #include <linux/buffer_head.h> |
3069 |
+@@ -6292,8 +6293,17 @@ static struct btrfs_device *add_missing_dev(struct btrfs_fs_devices *fs_devices, |
3070 |
+ u64 devid, u8 *dev_uuid) |
3071 |
+ { |
3072 |
+ struct btrfs_device *device; |
3073 |
++ unsigned int nofs_flag; |
3074 |
+ |
3075 |
++ /* |
3076 |
++ * We call this under the chunk_mutex, so we want to use NOFS for this |
3077 |
++ * allocation, however we don't want to change btrfs_alloc_device() to |
3078 |
++ * always do NOFS because we use it in a lot of other GFP_KERNEL safe |
3079 |
++ * places. |
3080 |
++ */ |
3081 |
++ nofs_flag = memalloc_nofs_save(); |
3082 |
+ device = btrfs_alloc_device(NULL, &devid, dev_uuid); |
3083 |
++ memalloc_nofs_restore(nofs_flag); |
3084 |
+ if (IS_ERR(device)) |
3085 |
+ return device; |
3086 |
+ |
3087 |
+diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c |
3088 |
+index 087a5715cf20e..bd37f4a292c3b 100644 |
3089 |
+--- a/fs/xfs/libxfs/xfs_attr_leaf.c |
3090 |
++++ b/fs/xfs/libxfs/xfs_attr_leaf.c |
3091 |
+@@ -551,8 +551,8 @@ xfs_attr_shortform_create(xfs_da_args_t *args) |
3092 |
+ ASSERT(ifp->if_flags & XFS_IFINLINE); |
3093 |
+ } |
3094 |
+ xfs_idata_realloc(dp, sizeof(*hdr), XFS_ATTR_FORK); |
3095 |
+- hdr = (xfs_attr_sf_hdr_t *)ifp->if_u1.if_data; |
3096 |
+- hdr->count = 0; |
3097 |
++ hdr = (struct xfs_attr_sf_hdr *)ifp->if_u1.if_data; |
3098 |
++ memset(hdr, 0, sizeof(*hdr)); |
3099 |
+ hdr->totsize = cpu_to_be16(sizeof(*hdr)); |
3100 |
+ xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA); |
3101 |
+ } |
3102 |
+diff --git a/include/linux/netfilter/nf_conntrack_sctp.h b/include/linux/netfilter/nf_conntrack_sctp.h |
3103 |
+index 9a33f171aa822..625f491b95de8 100644 |
3104 |
+--- a/include/linux/netfilter/nf_conntrack_sctp.h |
3105 |
++++ b/include/linux/netfilter/nf_conntrack_sctp.h |
3106 |
+@@ -9,6 +9,8 @@ struct ip_ct_sctp { |
3107 |
+ enum sctp_conntrack state; |
3108 |
+ |
3109 |
+ __be32 vtag[IP_CT_DIR_MAX]; |
3110 |
++ u8 last_dir; |
3111 |
++ u8 flags; |
3112 |
+ }; |
3113 |
+ |
3114 |
+ #endif /* _NF_CONNTRACK_SCTP_H */ |
3115 |
+diff --git a/include/soc/nps/common.h b/include/soc/nps/common.h |
3116 |
+index 9b1d43d671a3f..8c18dc6d3fde5 100644 |
3117 |
+--- a/include/soc/nps/common.h |
3118 |
++++ b/include/soc/nps/common.h |
3119 |
+@@ -45,6 +45,12 @@ |
3120 |
+ #define CTOP_INST_MOV2B_FLIP_R3_B1_B2_INST 0x5B60 |
3121 |
+ #define CTOP_INST_MOV2B_FLIP_R3_B1_B2_LIMM 0x00010422 |
3122 |
+ |
3123 |
++#ifndef AUX_IENABLE |
3124 |
++#define AUX_IENABLE 0x40c |
3125 |
++#endif |
3126 |
++ |
3127 |
++#define CTOP_AUX_IACK (0xFFFFF800 + 0x088) |
3128 |
++ |
3129 |
+ #ifndef __ASSEMBLY__ |
3130 |
+ |
3131 |
+ /* In order to increase compilation test coverage */ |
3132 |
+diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c |
3133 |
+index ca5e5c0ef8536..5b9e76117ded1 100644 |
3134 |
+--- a/kernel/gcov/gcc_4_7.c |
3135 |
++++ b/kernel/gcov/gcc_4_7.c |
3136 |
+@@ -19,7 +19,9 @@ |
3137 |
+ #include <linux/vmalloc.h> |
3138 |
+ #include "gcov.h" |
3139 |
+ |
3140 |
+-#if (__GNUC__ >= 7) |
3141 |
++#if (__GNUC__ >= 10) |
3142 |
++#define GCOV_COUNTERS 8 |
3143 |
++#elif (__GNUC__ >= 7) |
3144 |
+ #define GCOV_COUNTERS 9 |
3145 |
+ #elif (__GNUC__ > 5) || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1) |
3146 |
+ #define GCOV_COUNTERS 10 |
3147 |
+diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c |
3148 |
+index 7d7e30ea0ecf9..a937d4f75613f 100644 |
3149 |
+--- a/net/netfilter/nf_conntrack_proto_sctp.c |
3150 |
++++ b/net/netfilter/nf_conntrack_proto_sctp.c |
3151 |
+@@ -65,6 +65,8 @@ static const unsigned int sctp_timeouts[SCTP_CONNTRACK_MAX] = { |
3152 |
+ [SCTP_CONNTRACK_HEARTBEAT_ACKED] = 210 SECS, |
3153 |
+ }; |
3154 |
+ |
3155 |
++#define SCTP_FLAG_HEARTBEAT_VTAG_FAILED 1 |
3156 |
++ |
3157 |
+ #define sNO SCTP_CONNTRACK_NONE |
3158 |
+ #define sCL SCTP_CONNTRACK_CLOSED |
3159 |
+ #define sCW SCTP_CONNTRACK_COOKIE_WAIT |
3160 |
+@@ -288,6 +290,7 @@ static int sctp_packet(struct nf_conn *ct, |
3161 |
+ u_int32_t offset, count; |
3162 |
+ unsigned int *timeouts; |
3163 |
+ unsigned long map[256 / sizeof(unsigned long)] = { 0 }; |
3164 |
++ bool ignore = false; |
3165 |
+ |
3166 |
+ sh = skb_header_pointer(skb, dataoff, sizeof(_sctph), &_sctph); |
3167 |
+ if (sh == NULL) |
3168 |
+@@ -332,15 +335,39 @@ static int sctp_packet(struct nf_conn *ct, |
3169 |
+ /* Sec 8.5.1 (D) */ |
3170 |
+ if (sh->vtag != ct->proto.sctp.vtag[dir]) |
3171 |
+ goto out_unlock; |
3172 |
+- } else if (sch->type == SCTP_CID_HEARTBEAT || |
3173 |
+- sch->type == SCTP_CID_HEARTBEAT_ACK) { |
3174 |
++ } else if (sch->type == SCTP_CID_HEARTBEAT) { |
3175 |
++ if (ct->proto.sctp.vtag[dir] == 0) { |
3176 |
++ pr_debug("Setting %d vtag %x for dir %d\n", sch->type, sh->vtag, dir); |
3177 |
++ ct->proto.sctp.vtag[dir] = sh->vtag; |
3178 |
++ } else if (sh->vtag != ct->proto.sctp.vtag[dir]) { |
3179 |
++ if (test_bit(SCTP_CID_DATA, map) || ignore) |
3180 |
++ goto out_unlock; |
3181 |
++ |
3182 |
++ ct->proto.sctp.flags |= SCTP_FLAG_HEARTBEAT_VTAG_FAILED; |
3183 |
++ ct->proto.sctp.last_dir = dir; |
3184 |
++ ignore = true; |
3185 |
++ continue; |
3186 |
++ } else if (ct->proto.sctp.flags & SCTP_FLAG_HEARTBEAT_VTAG_FAILED) { |
3187 |
++ ct->proto.sctp.flags &= ~SCTP_FLAG_HEARTBEAT_VTAG_FAILED; |
3188 |
++ } |
3189 |
++ } else if (sch->type == SCTP_CID_HEARTBEAT_ACK) { |
3190 |
+ if (ct->proto.sctp.vtag[dir] == 0) { |
3191 |
+ pr_debug("Setting vtag %x for dir %d\n", |
3192 |
+ sh->vtag, dir); |
3193 |
+ ct->proto.sctp.vtag[dir] = sh->vtag; |
3194 |
+ } else if (sh->vtag != ct->proto.sctp.vtag[dir]) { |
3195 |
+- pr_debug("Verification tag check failed\n"); |
3196 |
+- goto out_unlock; |
3197 |
++ if (test_bit(SCTP_CID_DATA, map) || ignore) |
3198 |
++ goto out_unlock; |
3199 |
++ |
3200 |
++ if ((ct->proto.sctp.flags & SCTP_FLAG_HEARTBEAT_VTAG_FAILED) == 0 || |
3201 |
++ ct->proto.sctp.last_dir == dir) |
3202 |
++ goto out_unlock; |
3203 |
++ |
3204 |
++ ct->proto.sctp.flags &= ~SCTP_FLAG_HEARTBEAT_VTAG_FAILED; |
3205 |
++ ct->proto.sctp.vtag[dir] = sh->vtag; |
3206 |
++ ct->proto.sctp.vtag[!dir] = 0; |
3207 |
++ } else if (ct->proto.sctp.flags & SCTP_FLAG_HEARTBEAT_VTAG_FAILED) { |
3208 |
++ ct->proto.sctp.flags &= ~SCTP_FLAG_HEARTBEAT_VTAG_FAILED; |
3209 |
+ } |
3210 |
+ } |
3211 |
+ |
3212 |
+@@ -375,6 +402,10 @@ static int sctp_packet(struct nf_conn *ct, |
3213 |
+ } |
3214 |
+ spin_unlock_bh(&ct->lock); |
3215 |
+ |
3216 |
++ /* allow but do not refresh timeout */ |
3217 |
++ if (ignore) |
3218 |
++ return NF_ACCEPT; |
3219 |
++ |
3220 |
+ timeouts = nf_ct_timeout_lookup(ct); |
3221 |
+ if (!timeouts) |
3222 |
+ timeouts = sctp_pernet(nf_ct_net(ct))->timeouts; |
3223 |
+diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c |
3224 |
+index dbf02a3a8d2f2..58b53a4bc4d01 100644 |
3225 |
+--- a/sound/hda/hdac_device.c |
3226 |
++++ b/sound/hda/hdac_device.c |
3227 |
+@@ -124,6 +124,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_init); |
3228 |
+ void snd_hdac_device_exit(struct hdac_device *codec) |
3229 |
+ { |
3230 |
+ pm_runtime_put_noidle(&codec->dev); |
3231 |
++ /* keep balance of runtime PM child_count in parent device */ |
3232 |
++ pm_runtime_set_suspended(&codec->dev); |
3233 |
+ snd_hdac_bus_remove_device(codec->bus, codec); |
3234 |
+ kfree(codec->vendor_name); |
3235 |
+ kfree(codec->chip_name); |
3236 |
+diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c |
3237 |
+index b8e5f2b19ff85..708efb9b43877 100644 |
3238 |
+--- a/sound/pci/hda/patch_hdmi.c |
3239 |
++++ b/sound/pci/hda/patch_hdmi.c |
3240 |
+@@ -3431,6 +3431,7 @@ static int tegra_hdmi_build_pcms(struct hda_codec *codec) |
3241 |
+ |
3242 |
+ static int patch_tegra_hdmi(struct hda_codec *codec) |
3243 |
+ { |
3244 |
++ struct hdmi_spec *spec; |
3245 |
+ int err; |
3246 |
+ |
3247 |
+ err = patch_generic_hdmi(codec); |
3248 |
+@@ -3438,6 +3439,10 @@ static int patch_tegra_hdmi(struct hda_codec *codec) |
3249 |
+ return err; |
3250 |
+ |
3251 |
+ codec->patch_ops.build_pcms = tegra_hdmi_build_pcms; |
3252 |
++ spec = codec->spec; |
3253 |
++ spec->chmap.ops.chmap_cea_alloc_validate_get_type = |
3254 |
++ nvhdmi_chmap_cea_alloc_validate_get_type; |
3255 |
++ spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate; |
3256 |
+ |
3257 |
+ return 0; |
3258 |
+ } |