Annotation of /trunk/kernel-alx/patches-5.4/0152-5.4.53-all-fixes.patch
Parent Directory | Revision Log
Revision 3548 -
(hide annotations)
(download)
Fri Jul 24 06:59:33 2020 UTC (4 years, 2 months ago) by niro
File size: 279559 byte(s)
Fri Jul 24 06:59:33 2020 UTC (4 years, 2 months ago) by niro
File size: 279559 byte(s)
-linux-5.4.53
1 | niro | 3548 | diff --git a/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt |
2 | index 4438432bfe9b..ad76edccf881 100644 | ||
3 | --- a/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt | ||
4 | +++ b/Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt | ||
5 | @@ -87,7 +87,7 @@ Example: | ||
6 | ranges; | ||
7 | |||
8 | /* APU<->RPU0 IPI mailbox controller */ | ||
9 | - ipi_mailbox_rpu0: mailbox@ff90400 { | ||
10 | + ipi_mailbox_rpu0: mailbox@ff990400 { | ||
11 | reg = <0xff990400 0x20>, | ||
12 | <0xff990420 0x20>, | ||
13 | <0xff990080 0x20>, | ||
14 | diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt | ||
15 | index 66780a47ad85..c977a3ba2f35 100644 | ||
16 | --- a/Documentation/devicetree/bindings/usb/dwc3.txt | ||
17 | +++ b/Documentation/devicetree/bindings/usb/dwc3.txt | ||
18 | @@ -75,6 +75,8 @@ Optional properties: | ||
19 | from P0 to P1/P2/P3 without delay. | ||
20 | - snps,dis-tx-ipgap-linecheck-quirk: when set, disable u2mac linestate check | ||
21 | during HS transmit. | ||
22 | + - snps,parkmode-disable-ss-quirk: when set, all SuperSpeed bus instances in | ||
23 | + park mode are disabled. | ||
24 | - snps,dis_metastability_quirk: when set, disable metastability workaround. | ||
25 | CAUTION: use only if you are absolutely sure of it. | ||
26 | - snps,is-utmi-l1-suspend: true when DWC3 asserts output signal | ||
27 | diff --git a/Makefile b/Makefile | ||
28 | index 435d27be54c9..d33b312a14e3 100644 | ||
29 | --- a/Makefile | ||
30 | +++ b/Makefile | ||
31 | @@ -1,7 +1,7 @@ | ||
32 | # SPDX-License-Identifier: GPL-2.0 | ||
33 | VERSION = 5 | ||
34 | PATCHLEVEL = 4 | ||
35 | -SUBLEVEL = 52 | ||
36 | +SUBLEVEL = 53 | ||
37 | EXTRAVERSION = | ||
38 | NAME = Kleptomaniac Octopus | ||
39 | |||
40 | diff --git a/arch/alpha/configs/defconfig b/arch/alpha/configs/defconfig | ||
41 | index f4ec420d7f2d..3a132c91d45b 100644 | ||
42 | --- a/arch/alpha/configs/defconfig | ||
43 | +++ b/arch/alpha/configs/defconfig | ||
44 | @@ -36,7 +36,6 @@ CONFIG_BLK_DEV_CY82C693=y | ||
45 | CONFIG_SCSI=y | ||
46 | CONFIG_BLK_DEV_SD=y | ||
47 | CONFIG_BLK_DEV_SR=y | ||
48 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
49 | CONFIG_SCSI_AIC7XXX=m | ||
50 | CONFIG_AIC7XXX_CMDS_PER_DEVICE=253 | ||
51 | # CONFIG_AIC7XXX_DEBUG_ENABLE is not set | ||
52 | diff --git a/arch/arm/boot/dts/am437x-l4.dtsi b/arch/arm/boot/dts/am437x-l4.dtsi | ||
53 | index 59770dd3785e..bbe15775fccd 100644 | ||
54 | --- a/arch/arm/boot/dts/am437x-l4.dtsi | ||
55 | +++ b/arch/arm/boot/dts/am437x-l4.dtsi | ||
56 | @@ -1576,8 +1576,9 @@ | ||
57 | reg-names = "rev"; | ||
58 | ti,hwmods = "d_can0"; | ||
59 | /* Domains (P, C): per_pwrdm, l4ls_clkdm */ | ||
60 | - clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>; | ||
61 | - clock-names = "fck"; | ||
62 | + clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>, | ||
63 | + <&dcan0_fck>; | ||
64 | + clock-names = "fck", "osc"; | ||
65 | #address-cells = <1>; | ||
66 | #size-cells = <1>; | ||
67 | ranges = <0x0 0xcc000 0x2000>; | ||
68 | @@ -1585,6 +1586,8 @@ | ||
69 | dcan0: can@0 { | ||
70 | compatible = "ti,am4372-d_can", "ti,am3352-d_can"; | ||
71 | reg = <0x0 0x2000>; | ||
72 | + clocks = <&dcan0_fck>; | ||
73 | + clock-names = "fck"; | ||
74 | syscon-raminit = <&scm_conf 0x644 0>; | ||
75 | interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; | ||
76 | status = "disabled"; | ||
77 | @@ -1597,8 +1600,9 @@ | ||
78 | reg-names = "rev"; | ||
79 | ti,hwmods = "d_can1"; | ||
80 | /* Domains (P, C): per_pwrdm, l4ls_clkdm */ | ||
81 | - clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>; | ||
82 | - clock-names = "fck"; | ||
83 | + clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>, | ||
84 | + <&dcan1_fck>; | ||
85 | + clock-names = "fck", "osc"; | ||
86 | #address-cells = <1>; | ||
87 | #size-cells = <1>; | ||
88 | ranges = <0x0 0xd0000 0x2000>; | ||
89 | @@ -1606,6 +1610,8 @@ | ||
90 | dcan1: can@0 { | ||
91 | compatible = "ti,am4372-d_can", "ti,am3352-d_can"; | ||
92 | reg = <0x0 0x2000>; | ||
93 | + clocks = <&dcan1_fck>; | ||
94 | + clock-name = "fck"; | ||
95 | syscon-raminit = <&scm_conf 0x644 1>; | ||
96 | interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>; | ||
97 | status = "disabled"; | ||
98 | diff --git a/arch/arm/boot/dts/mt7623n-rfb-emmc.dts b/arch/arm/boot/dts/mt7623n-rfb-emmc.dts | ||
99 | index b7606130ade9..0447748f9fa0 100644 | ||
100 | --- a/arch/arm/boot/dts/mt7623n-rfb-emmc.dts | ||
101 | +++ b/arch/arm/boot/dts/mt7623n-rfb-emmc.dts | ||
102 | @@ -138,6 +138,7 @@ | ||
103 | mac@1 { | ||
104 | compatible = "mediatek,eth-mac"; | ||
105 | reg = <1>; | ||
106 | + phy-mode = "rgmii"; | ||
107 | phy-handle = <&phy5>; | ||
108 | }; | ||
109 | |||
110 | diff --git a/arch/arm/boot/dts/socfpga.dtsi b/arch/arm/boot/dts/socfpga.dtsi | ||
111 | index 4f3993cc0227..451030897220 100644 | ||
112 | --- a/arch/arm/boot/dts/socfpga.dtsi | ||
113 | +++ b/arch/arm/boot/dts/socfpga.dtsi | ||
114 | @@ -710,7 +710,7 @@ | ||
115 | }; | ||
116 | }; | ||
117 | |||
118 | - L2: l2-cache@fffef000 { | ||
119 | + L2: cache-controller@fffef000 { | ||
120 | compatible = "arm,pl310-cache"; | ||
121 | reg = <0xfffef000 0x1000>; | ||
122 | interrupts = <0 38 0x04>; | ||
123 | diff --git a/arch/arm/boot/dts/socfpga_arria10.dtsi b/arch/arm/boot/dts/socfpga_arria10.dtsi | ||
124 | index 2a86e72d9791..906bfb580e9e 100644 | ||
125 | --- a/arch/arm/boot/dts/socfpga_arria10.dtsi | ||
126 | +++ b/arch/arm/boot/dts/socfpga_arria10.dtsi | ||
127 | @@ -636,7 +636,7 @@ | ||
128 | reg = <0xffcfb100 0x80>; | ||
129 | }; | ||
130 | |||
131 | - L2: l2-cache@fffff000 { | ||
132 | + L2: cache-controller@fffff000 { | ||
133 | compatible = "arm,pl310-cache"; | ||
134 | reg = <0xfffff000 0x1000>; | ||
135 | interrupts = <0 18 IRQ_TYPE_LEVEL_HIGH>; | ||
136 | diff --git a/arch/arm/configs/rpc_defconfig b/arch/arm/configs/rpc_defconfig | ||
137 | index 3b82b64950d9..c090643b1ecb 100644 | ||
138 | --- a/arch/arm/configs/rpc_defconfig | ||
139 | +++ b/arch/arm/configs/rpc_defconfig | ||
140 | @@ -32,7 +32,6 @@ CONFIG_BLK_DEV_RAM=y | ||
141 | CONFIG_BLK_DEV_SD=y | ||
142 | CONFIG_CHR_DEV_ST=m | ||
143 | CONFIG_BLK_DEV_SR=y | ||
144 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
145 | CONFIG_CHR_DEV_SG=y | ||
146 | CONFIG_SCSI_CONSTANTS=y | ||
147 | CONFIG_SCSI_LOGGING=y | ||
148 | diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig | ||
149 | index 73ed73a8785a..153009130dab 100644 | ||
150 | --- a/arch/arm/configs/s3c2410_defconfig | ||
151 | +++ b/arch/arm/configs/s3c2410_defconfig | ||
152 | @@ -202,7 +202,6 @@ CONFIG_EEPROM_AT24=y | ||
153 | CONFIG_BLK_DEV_SD=y | ||
154 | CONFIG_CHR_DEV_ST=m | ||
155 | CONFIG_BLK_DEV_SR=y | ||
156 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
157 | CONFIG_CHR_DEV_SG=y | ||
158 | CONFIG_CHR_DEV_SCH=m | ||
159 | CONFIG_SCSI_CONSTANTS=y | ||
160 | diff --git a/arch/arm/include/asm/clocksource.h b/arch/arm/include/asm/clocksource.h | ||
161 | index 0b350a7e26f3..afb7a59828fe 100644 | ||
162 | --- a/arch/arm/include/asm/clocksource.h | ||
163 | +++ b/arch/arm/include/asm/clocksource.h | ||
164 | @@ -1,8 +1,17 @@ | ||
165 | #ifndef _ASM_CLOCKSOURCE_H | ||
166 | #define _ASM_CLOCKSOURCE_H | ||
167 | |||
168 | +enum vdso_arch_clockmode { | ||
169 | + /* vdso clocksource not usable */ | ||
170 | + VDSO_CLOCKMODE_NONE, | ||
171 | + /* vdso clocksource usable */ | ||
172 | + VDSO_CLOCKMODE_ARCHTIMER, | ||
173 | + VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT = VDSO_CLOCKMODE_ARCHTIMER, | ||
174 | +}; | ||
175 | + | ||
176 | struct arch_clocksource_data { | ||
177 | - bool vdso_direct; /* Usable for direct VDSO access? */ | ||
178 | + /* Usable for direct VDSO access? */ | ||
179 | + enum vdso_arch_clockmode clock_mode; | ||
180 | }; | ||
181 | |||
182 | #endif | ||
183 | diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c | ||
184 | index f00e45fa62c4..6c69a5548ba2 100644 | ||
185 | --- a/arch/arm/kernel/vdso.c | ||
186 | +++ b/arch/arm/kernel/vdso.c | ||
187 | @@ -281,7 +281,7 @@ static bool tk_is_cntvct(const struct timekeeper *tk) | ||
188 | if (!IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) | ||
189 | return false; | ||
190 | |||
191 | - if (!tk->tkr_mono.clock->archdata.vdso_direct) | ||
192 | + if (tk->tkr_mono.clock->archdata.clock_mode != VDSO_CLOCKMODE_ARCHTIMER) | ||
193 | return false; | ||
194 | |||
195 | return true; | ||
196 | diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S | ||
197 | index ed57c879d4e1..2591cba61937 100644 | ||
198 | --- a/arch/arm/mach-at91/pm_suspend.S | ||
199 | +++ b/arch/arm/mach-at91/pm_suspend.S | ||
200 | @@ -268,6 +268,10 @@ ENDPROC(at91_backup_mode) | ||
201 | orr tmp1, tmp1, #AT91_PMC_KEY | ||
202 | str tmp1, [pmc, #AT91_CKGR_MOR] | ||
203 | |||
204 | + /* Quirk for SAM9X60's PMC */ | ||
205 | + nop | ||
206 | + nop | ||
207 | + | ||
208 | wait_mckrdy | ||
209 | |||
210 | /* Enable the crystal oscillator */ | ||
211 | diff --git a/arch/arm/mach-omap2/omap-iommu.c b/arch/arm/mach-omap2/omap-iommu.c | ||
212 | index f1a6ece8108e..78247e6f4a72 100644 | ||
213 | --- a/arch/arm/mach-omap2/omap-iommu.c | ||
214 | +++ b/arch/arm/mach-omap2/omap-iommu.c | ||
215 | @@ -11,14 +11,43 @@ | ||
216 | |||
217 | #include "omap_hwmod.h" | ||
218 | #include "omap_device.h" | ||
219 | +#include "clockdomain.h" | ||
220 | #include "powerdomain.h" | ||
221 | |||
222 | +static void omap_iommu_dra7_emu_swsup_config(struct platform_device *pdev, | ||
223 | + bool enable) | ||
224 | +{ | ||
225 | + static struct clockdomain *emu_clkdm; | ||
226 | + static DEFINE_SPINLOCK(emu_lock); | ||
227 | + static atomic_t count; | ||
228 | + struct device_node *np = pdev->dev.of_node; | ||
229 | + | ||
230 | + if (!of_device_is_compatible(np, "ti,dra7-dsp-iommu")) | ||
231 | + return; | ||
232 | + | ||
233 | + if (!emu_clkdm) { | ||
234 | + emu_clkdm = clkdm_lookup("emu_clkdm"); | ||
235 | + if (WARN_ON_ONCE(!emu_clkdm)) | ||
236 | + return; | ||
237 | + } | ||
238 | + | ||
239 | + spin_lock(&emu_lock); | ||
240 | + | ||
241 | + if (enable && (atomic_inc_return(&count) == 1)) | ||
242 | + clkdm_deny_idle(emu_clkdm); | ||
243 | + else if (!enable && (atomic_dec_return(&count) == 0)) | ||
244 | + clkdm_allow_idle(emu_clkdm); | ||
245 | + | ||
246 | + spin_unlock(&emu_lock); | ||
247 | +} | ||
248 | + | ||
249 | int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request, | ||
250 | u8 *pwrst) | ||
251 | { | ||
252 | struct powerdomain *pwrdm; | ||
253 | struct omap_device *od; | ||
254 | u8 next_pwrst; | ||
255 | + int ret = 0; | ||
256 | |||
257 | od = to_omap_device(pdev); | ||
258 | if (!od) | ||
259 | @@ -31,13 +60,21 @@ int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request, | ||
260 | if (!pwrdm) | ||
261 | return -EINVAL; | ||
262 | |||
263 | - if (request) | ||
264 | + if (request) { | ||
265 | *pwrst = pwrdm_read_next_pwrst(pwrdm); | ||
266 | + omap_iommu_dra7_emu_swsup_config(pdev, true); | ||
267 | + } | ||
268 | |||
269 | if (*pwrst > PWRDM_POWER_RET) | ||
270 | - return 0; | ||
271 | + goto out; | ||
272 | |||
273 | next_pwrst = request ? PWRDM_POWER_ON : *pwrst; | ||
274 | |||
275 | - return pwrdm_set_next_pwrst(pwrdm, next_pwrst); | ||
276 | + ret = pwrdm_set_next_pwrst(pwrdm, next_pwrst); | ||
277 | + | ||
278 | +out: | ||
279 | + if (!request) | ||
280 | + omap_iommu_dra7_emu_swsup_config(pdev, false); | ||
281 | + | ||
282 | + return ret; | ||
283 | } | ||
284 | diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c | ||
285 | index 247e3f8acffe..ca07e310d9ed 100644 | ||
286 | --- a/arch/arm/mach-omap2/pdata-quirks.c | ||
287 | +++ b/arch/arm/mach-omap2/pdata-quirks.c | ||
288 | @@ -44,6 +44,17 @@ struct pdata_init { | ||
289 | static struct of_dev_auxdata omap_auxdata_lookup[]; | ||
290 | static struct twl4030_gpio_platform_data twl_gpio_auxdata; | ||
291 | |||
292 | +#if IS_ENABLED(CONFIG_OMAP_IOMMU) | ||
293 | +int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request, | ||
294 | + u8 *pwrst); | ||
295 | +#else | ||
296 | +static inline int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, | ||
297 | + bool request, u8 *pwrst) | ||
298 | +{ | ||
299 | + return 0; | ||
300 | +} | ||
301 | +#endif | ||
302 | + | ||
303 | #ifdef CONFIG_MACH_NOKIA_N8X0 | ||
304 | static void __init omap2420_n8x0_legacy_init(void) | ||
305 | { | ||
306 | @@ -311,16 +322,6 @@ static void __init omap3_pandora_legacy_init(void) | ||
307 | } | ||
308 | #endif /* CONFIG_ARCH_OMAP3 */ | ||
309 | |||
310 | -#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) | ||
311 | -static struct iommu_platform_data omap4_iommu_pdata = { | ||
312 | - .reset_name = "mmu_cache", | ||
313 | - .assert_reset = omap_device_assert_hardreset, | ||
314 | - .deassert_reset = omap_device_deassert_hardreset, | ||
315 | - .device_enable = omap_device_enable, | ||
316 | - .device_idle = omap_device_idle, | ||
317 | -}; | ||
318 | -#endif | ||
319 | - | ||
320 | #if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX) | ||
321 | static struct wkup_m3_platform_data wkup_m3_data = { | ||
322 | .reset_name = "wkup_m3", | ||
323 | @@ -336,6 +337,10 @@ static void __init omap5_uevm_legacy_init(void) | ||
324 | #endif | ||
325 | |||
326 | #ifdef CONFIG_SOC_DRA7XX | ||
327 | +static struct iommu_platform_data dra7_ipu1_dsp_iommu_pdata = { | ||
328 | + .set_pwrdm_constraint = omap_iommu_set_pwrdm_constraint, | ||
329 | +}; | ||
330 | + | ||
331 | static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc1; | ||
332 | static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc2; | ||
333 | static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc3; | ||
334 | @@ -543,10 +548,6 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { | ||
335 | &wkup_m3_data), | ||
336 | #endif | ||
337 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) | ||
338 | - OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu", | ||
339 | - &omap4_iommu_pdata), | ||
340 | - OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu", | ||
341 | - &omap4_iommu_pdata), | ||
342 | OF_DEV_AUXDATA("ti,omap4-smartreflex-iva", 0x4a0db000, | ||
343 | "4a0db000.smartreflex", &omap_sr_pdata[OMAP_SR_IVA]), | ||
344 | OF_DEV_AUXDATA("ti,omap4-smartreflex-core", 0x4a0dd000, | ||
345 | @@ -561,6 +562,12 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { | ||
346 | &dra7_hsmmc_data_mmc2), | ||
347 | OF_DEV_AUXDATA("ti,dra7-hsmmc", 0x480ad000, "480ad000.mmc", | ||
348 | &dra7_hsmmc_data_mmc3), | ||
349 | + OF_DEV_AUXDATA("ti,dra7-dsp-iommu", 0x40d01000, "40d01000.mmu", | ||
350 | + &dra7_ipu1_dsp_iommu_pdata), | ||
351 | + OF_DEV_AUXDATA("ti,dra7-dsp-iommu", 0x41501000, "41501000.mmu", | ||
352 | + &dra7_ipu1_dsp_iommu_pdata), | ||
353 | + OF_DEV_AUXDATA("ti,dra7-iommu", 0x58882000, "58882000.mmu", | ||
354 | + &dra7_ipu1_dsp_iommu_pdata), | ||
355 | #endif | ||
356 | /* Common auxdata */ | ||
357 | OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata), | ||
358 | diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | ||
359 | index d1fc9c2055f4..9498d1de730c 100644 | ||
360 | --- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | ||
361 | +++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | ||
362 | @@ -77,7 +77,7 @@ | ||
363 | method = "smc"; | ||
364 | }; | ||
365 | |||
366 | - intc: intc@fffc1000 { | ||
367 | + intc: interrupt-controller@fffc1000 { | ||
368 | compatible = "arm,gic-400", "arm,cortex-a15-gic"; | ||
369 | #interrupt-cells = <3>; | ||
370 | interrupt-controller; | ||
371 | @@ -302,7 +302,7 @@ | ||
372 | status = "disabled"; | ||
373 | }; | ||
374 | |||
375 | - nand: nand@ffb90000 { | ||
376 | + nand: nand-controller@ffb90000 { | ||
377 | #address-cells = <1>; | ||
378 | #size-cells = <0>; | ||
379 | compatible = "altr,socfpga-denali-nand"; | ||
380 | @@ -445,7 +445,7 @@ | ||
381 | clock-names = "timer"; | ||
382 | }; | ||
383 | |||
384 | - uart0: serial0@ffc02000 { | ||
385 | + uart0: serial@ffc02000 { | ||
386 | compatible = "snps,dw-apb-uart"; | ||
387 | reg = <0xffc02000 0x100>; | ||
388 | interrupts = <0 108 4>; | ||
389 | @@ -456,7 +456,7 @@ | ||
390 | status = "disabled"; | ||
391 | }; | ||
392 | |||
393 | - uart1: serial1@ffc02100 { | ||
394 | + uart1: serial@ffc02100 { | ||
395 | compatible = "snps,dw-apb-uart"; | ||
396 | reg = <0xffc02100 0x100>; | ||
397 | interrupts = <0 109 4>; | ||
398 | diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | ||
399 | index 2199a54c720c..1234bc797429 100644 | ||
400 | --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | ||
401 | +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | ||
402 | @@ -2381,6 +2381,7 @@ | ||
403 | dr_mode = "host"; | ||
404 | snps,dis_u2_susphy_quirk; | ||
405 | snps,quirk-frame-length-adjustment; | ||
406 | + snps,parkmode-disable-ss-quirk; | ||
407 | }; | ||
408 | }; | ||
409 | |||
410 | diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts | ||
411 | index 82b1c4851147..e034bbff8e66 100644 | ||
412 | --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts | ||
413 | +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts | ||
414 | @@ -9,7 +9,7 @@ | ||
415 | |||
416 | #include <dt-bindings/input/input.h> | ||
417 | |||
418 | -#include "meson-gxl-s905x.dtsi" | ||
419 | +#include "meson-gxl-s805x.dtsi" | ||
420 | |||
421 | / { | ||
422 | compatible = "libretech,aml-s805x-ac", "amlogic,s805x", | ||
423 | diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-p241.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-p241.dts | ||
424 | index 3a1484e5b8e1..fbc687c9ff83 100644 | ||
425 | --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-p241.dts | ||
426 | +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-p241.dts | ||
427 | @@ -9,7 +9,7 @@ | ||
428 | |||
429 | #include <dt-bindings/input/input.h> | ||
430 | |||
431 | -#include "meson-gxl-s905x.dtsi" | ||
432 | +#include "meson-gxl-s805x.dtsi" | ||
433 | |||
434 | / { | ||
435 | compatible = "amlogic,p241", "amlogic,s805x", "amlogic,meson-gxl"; | ||
436 | diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s805x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl-s805x.dtsi | ||
437 | new file mode 100644 | ||
438 | index 000000000000..f9d705648426 | ||
439 | --- /dev/null | ||
440 | +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s805x.dtsi | ||
441 | @@ -0,0 +1,24 @@ | ||
442 | +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) | ||
443 | +/* | ||
444 | + * Copyright (c) 2020 BayLibre SAS | ||
445 | + * Author: Neil Armstrong <narmstrong@baylibre.com> | ||
446 | + */ | ||
447 | + | ||
448 | +#include "meson-gxl-s905x.dtsi" | ||
449 | + | ||
450 | +/ { | ||
451 | + compatible = "amlogic,s805x", "amlogic,meson-gxl"; | ||
452 | +}; | ||
453 | + | ||
454 | +/* The S805X Package doesn't seem to handle the 744MHz OPP correctly */ | ||
455 | +&mali { | ||
456 | + assigned-clocks = <&clkc CLKID_MALI_0_SEL>, | ||
457 | + <&clkc CLKID_MALI_0>, | ||
458 | + <&clkc CLKID_MALI>; /* Glitch free mux */ | ||
459 | + assigned-clock-parents = <&clkc CLKID_FCLK_DIV3>, | ||
460 | + <0>, /* Do Nothing */ | ||
461 | + <&clkc CLKID_MALI_0>; | ||
462 | + assigned-clock-rates = <0>, /* Do Nothing */ | ||
463 | + <666666666>, | ||
464 | + <0>; /* Do Nothing */ | ||
465 | +}; | ||
466 | diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | ||
467 | index 49ff0a7d0210..e3cfa24dca5a 100644 | ||
468 | --- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | ||
469 | +++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | ||
470 | @@ -288,6 +288,11 @@ | ||
471 | }; | ||
472 | }; | ||
473 | |||
474 | +&hwrng { | ||
475 | + clocks = <&clkc CLKID_RNG0>; | ||
476 | + clock-names = "core"; | ||
477 | +}; | ||
478 | + | ||
479 | &i2c_A { | ||
480 | clocks = <&clkc CLKID_I2C>; | ||
481 | }; | ||
482 | diff --git a/arch/arm64/include/asm/alternative.h b/arch/arm64/include/asm/alternative.h | ||
483 | index 5e5dc05d63a0..12f0eb56a1cc 100644 | ||
484 | --- a/arch/arm64/include/asm/alternative.h | ||
485 | +++ b/arch/arm64/include/asm/alternative.h | ||
486 | @@ -73,11 +73,11 @@ static inline void apply_alternatives_module(void *start, size_t length) { } | ||
487 | ".pushsection .altinstructions,\"a\"\n" \ | ||
488 | ALTINSTR_ENTRY(feature) \ | ||
489 | ".popsection\n" \ | ||
490 | - ".pushsection .altinstr_replacement, \"a\"\n" \ | ||
491 | + ".subsection 1\n" \ | ||
492 | "663:\n\t" \ | ||
493 | newinstr "\n" \ | ||
494 | "664:\n\t" \ | ||
495 | - ".popsection\n\t" \ | ||
496 | + ".previous\n\t" \ | ||
497 | ".org . - (664b-663b) + (662b-661b)\n\t" \ | ||
498 | ".org . - (662b-661b) + (664b-663b)\n" \ | ||
499 | ".endif\n" | ||
500 | @@ -117,9 +117,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } | ||
501 | 662: .pushsection .altinstructions, "a" | ||
502 | altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f | ||
503 | .popsection | ||
504 | - .pushsection .altinstr_replacement, "ax" | ||
505 | + .subsection 1 | ||
506 | 663: \insn2 | ||
507 | -664: .popsection | ||
508 | +664: .previous | ||
509 | .org . - (664b-663b) + (662b-661b) | ||
510 | .org . - (662b-661b) + (664b-663b) | ||
511 | .endif | ||
512 | @@ -160,7 +160,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { } | ||
513 | .pushsection .altinstructions, "a" | ||
514 | altinstruction_entry 663f, 661f, \cap, 664f-663f, 662f-661f | ||
515 | .popsection | ||
516 | - .pushsection .altinstr_replacement, "ax" | ||
517 | + .subsection 1 | ||
518 | .align 2 /* So GAS knows label 661 is suitably aligned */ | ||
519 | 661: | ||
520 | .endm | ||
521 | @@ -179,9 +179,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } | ||
522 | .macro alternative_else | ||
523 | 662: | ||
524 | .if .Lasm_alt_mode==0 | ||
525 | - .pushsection .altinstr_replacement, "ax" | ||
526 | + .subsection 1 | ||
527 | .else | ||
528 | - .popsection | ||
529 | + .previous | ||
530 | .endif | ||
531 | 663: | ||
532 | .endm | ||
533 | @@ -192,7 +192,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { } | ||
534 | .macro alternative_endif | ||
535 | 664: | ||
536 | .if .Lasm_alt_mode==0 | ||
537 | - .popsection | ||
538 | + .previous | ||
539 | .endif | ||
540 | .org . - (664b-663b) + (662b-661b) | ||
541 | .org . - (662b-661b) + (664b-663b) | ||
542 | diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h | ||
543 | index 7ae54d7d333a..9f0ec21d6327 100644 | ||
544 | --- a/arch/arm64/include/asm/arch_timer.h | ||
545 | +++ b/arch/arm64/include/asm/arch_timer.h | ||
546 | @@ -58,6 +58,7 @@ struct arch_timer_erratum_workaround { | ||
547 | u64 (*read_cntvct_el0)(void); | ||
548 | int (*set_next_event_phys)(unsigned long, struct clock_event_device *); | ||
549 | int (*set_next_event_virt)(unsigned long, struct clock_event_device *); | ||
550 | + bool disable_compat_vdso; | ||
551 | }; | ||
552 | |||
553 | DECLARE_PER_CPU(const struct arch_timer_erratum_workaround *, | ||
554 | diff --git a/arch/arm64/include/asm/clocksource.h b/arch/arm64/include/asm/clocksource.h | ||
555 | index 0ece64a26c8c..0c7910447235 100644 | ||
556 | --- a/arch/arm64/include/asm/clocksource.h | ||
557 | +++ b/arch/arm64/include/asm/clocksource.h | ||
558 | @@ -2,8 +2,11 @@ | ||
559 | #ifndef _ASM_CLOCKSOURCE_H | ||
560 | #define _ASM_CLOCKSOURCE_H | ||
561 | |||
562 | +#include <asm/vdso/clocksource.h> | ||
563 | + | ||
564 | struct arch_clocksource_data { | ||
565 | - bool vdso_direct; /* Usable for direct VDSO access? */ | ||
566 | + /* Usable for direct VDSO access? */ | ||
567 | + enum vdso_arch_clockmode clock_mode; | ||
568 | }; | ||
569 | |||
570 | #endif | ||
571 | diff --git a/arch/arm64/include/asm/debug-monitors.h b/arch/arm64/include/asm/debug-monitors.h | ||
572 | index 7619f473155f..d825e3585e28 100644 | ||
573 | --- a/arch/arm64/include/asm/debug-monitors.h | ||
574 | +++ b/arch/arm64/include/asm/debug-monitors.h | ||
575 | @@ -109,6 +109,8 @@ void disable_debug_monitors(enum dbg_active_el el); | ||
576 | |||
577 | void user_rewind_single_step(struct task_struct *task); | ||
578 | void user_fastforward_single_step(struct task_struct *task); | ||
579 | +void user_regs_reset_single_step(struct user_pt_regs *regs, | ||
580 | + struct task_struct *task); | ||
581 | |||
582 | void kernel_enable_single_step(struct pt_regs *regs); | ||
583 | void kernel_disable_single_step(void); | ||
584 | diff --git a/arch/arm64/include/asm/syscall.h b/arch/arm64/include/asm/syscall.h | ||
585 | index 65299a2dcf9c..cfc0672013f6 100644 | ||
586 | --- a/arch/arm64/include/asm/syscall.h | ||
587 | +++ b/arch/arm64/include/asm/syscall.h | ||
588 | @@ -34,6 +34,10 @@ static inline long syscall_get_error(struct task_struct *task, | ||
589 | struct pt_regs *regs) | ||
590 | { | ||
591 | unsigned long error = regs->regs[0]; | ||
592 | + | ||
593 | + if (is_compat_thread(task_thread_info(task))) | ||
594 | + error = sign_extend64(error, 31); | ||
595 | + | ||
596 | return IS_ERR_VALUE(error) ? error : 0; | ||
597 | } | ||
598 | |||
599 | @@ -47,7 +51,13 @@ static inline void syscall_set_return_value(struct task_struct *task, | ||
600 | struct pt_regs *regs, | ||
601 | int error, long val) | ||
602 | { | ||
603 | - regs->regs[0] = (long) error ? error : val; | ||
604 | + if (error) | ||
605 | + val = error; | ||
606 | + | ||
607 | + if (is_compat_thread(task_thread_info(task))) | ||
608 | + val = lower_32_bits(val); | ||
609 | + | ||
610 | + regs->regs[0] = val; | ||
611 | } | ||
612 | |||
613 | #define SYSCALL_MAX_ARGS 6 | ||
614 | diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h | ||
615 | index f0cec4160136..4e3ed702bec7 100644 | ||
616 | --- a/arch/arm64/include/asm/thread_info.h | ||
617 | +++ b/arch/arm64/include/asm/thread_info.h | ||
618 | @@ -91,6 +91,7 @@ void arch_release_task_struct(struct task_struct *tsk); | ||
619 | #define _TIF_SYSCALL_EMU (1 << TIF_SYSCALL_EMU) | ||
620 | #define _TIF_UPROBE (1 << TIF_UPROBE) | ||
621 | #define _TIF_FSCHECK (1 << TIF_FSCHECK) | ||
622 | +#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) | ||
623 | #define _TIF_32BIT (1 << TIF_32BIT) | ||
624 | #define _TIF_SVE (1 << TIF_SVE) | ||
625 | |||
626 | diff --git a/arch/arm64/include/asm/vdso/clocksource.h b/arch/arm64/include/asm/vdso/clocksource.h | ||
627 | new file mode 100644 | ||
628 | index 000000000000..8019f616e1f7 | ||
629 | --- /dev/null | ||
630 | +++ b/arch/arm64/include/asm/vdso/clocksource.h | ||
631 | @@ -0,0 +1,14 @@ | ||
632 | +/* SPDX-License-Identifier: GPL-2.0 */ | ||
633 | +#ifndef __ASM_VDSOCLOCKSOURCE_H | ||
634 | +#define __ASM_VDSOCLOCKSOURCE_H | ||
635 | + | ||
636 | +enum vdso_arch_clockmode { | ||
637 | + /* vdso clocksource not usable */ | ||
638 | + VDSO_CLOCKMODE_NONE, | ||
639 | + /* vdso clocksource for both 32 and 64bit tasks */ | ||
640 | + VDSO_CLOCKMODE_ARCHTIMER, | ||
641 | + /* vdso clocksource for 64bit tasks only */ | ||
642 | + VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT, | ||
643 | +}; | ||
644 | + | ||
645 | +#endif | ||
646 | diff --git a/arch/arm64/include/asm/vdso/compat_gettimeofday.h b/arch/arm64/include/asm/vdso/compat_gettimeofday.h | ||
647 | index c50ee1b7d5cd..413d42e197c7 100644 | ||
648 | --- a/arch/arm64/include/asm/vdso/compat_gettimeofday.h | ||
649 | +++ b/arch/arm64/include/asm/vdso/compat_gettimeofday.h | ||
650 | @@ -10,6 +10,7 @@ | ||
651 | #include <asm/unistd.h> | ||
652 | #include <uapi/linux/time.h> | ||
653 | |||
654 | +#include <asm/vdso/clocksource.h> | ||
655 | #include <asm/vdso/compat_barrier.h> | ||
656 | |||
657 | #define __VDSO_USE_SYSCALL ULLONG_MAX | ||
658 | @@ -117,10 +118,10 @@ static __always_inline u64 __arch_get_hw_counter(s32 clock_mode) | ||
659 | u64 res; | ||
660 | |||
661 | /* | ||
662 | - * clock_mode == 0 implies that vDSO are enabled otherwise | ||
663 | + * clock_mode == ARCHTIMER implies that vDSO are enabled otherwise | ||
664 | * fallback on syscall. | ||
665 | */ | ||
666 | - if (clock_mode) | ||
667 | + if (clock_mode != VDSO_CLOCKMODE_ARCHTIMER) | ||
668 | return __VDSO_USE_SYSCALL; | ||
669 | |||
670 | /* | ||
671 | diff --git a/arch/arm64/include/asm/vdso/gettimeofday.h b/arch/arm64/include/asm/vdso/gettimeofday.h | ||
672 | index b08f476b72b4..ff83b8b574fc 100644 | ||
673 | --- a/arch/arm64/include/asm/vdso/gettimeofday.h | ||
674 | +++ b/arch/arm64/include/asm/vdso/gettimeofday.h | ||
675 | @@ -10,6 +10,8 @@ | ||
676 | #include <asm/unistd.h> | ||
677 | #include <uapi/linux/time.h> | ||
678 | |||
679 | +#include <asm/vdso/clocksource.h> | ||
680 | + | ||
681 | #define __VDSO_USE_SYSCALL ULLONG_MAX | ||
682 | |||
683 | #define VDSO_HAS_CLOCK_GETRES 1 | ||
684 | @@ -71,10 +73,10 @@ static __always_inline u64 __arch_get_hw_counter(s32 clock_mode) | ||
685 | u64 res; | ||
686 | |||
687 | /* | ||
688 | - * clock_mode == 0 implies that vDSO are enabled otherwise | ||
689 | + * clock_mode != NONE implies that vDSO are enabled otherwise | ||
690 | * fallback on syscall. | ||
691 | */ | ||
692 | - if (clock_mode) | ||
693 | + if (clock_mode == VDSO_CLOCKMODE_NONE) | ||
694 | return __VDSO_USE_SYSCALL; | ||
695 | |||
696 | /* | ||
697 | diff --git a/arch/arm64/include/asm/vdso/vsyscall.h b/arch/arm64/include/asm/vdso/vsyscall.h | ||
698 | index 0c20a7c1bee5..e50f26741946 100644 | ||
699 | --- a/arch/arm64/include/asm/vdso/vsyscall.h | ||
700 | +++ b/arch/arm64/include/asm/vdso/vsyscall.h | ||
701 | @@ -24,9 +24,7 @@ struct vdso_data *__arm64_get_k_vdso_data(void) | ||
702 | static __always_inline | ||
703 | int __arm64_get_clock_mode(struct timekeeper *tk) | ||
704 | { | ||
705 | - u32 use_syscall = !tk->tkr_mono.clock->archdata.vdso_direct; | ||
706 | - | ||
707 | - return use_syscall; | ||
708 | + return tk->tkr_mono.clock->archdata.clock_mode; | ||
709 | } | ||
710 | #define __arch_get_clock_mode __arm64_get_clock_mode | ||
711 | |||
712 | diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c | ||
713 | index d1757ef1b1e7..73039949b5ce 100644 | ||
714 | --- a/arch/arm64/kernel/alternative.c | ||
715 | +++ b/arch/arm64/kernel/alternative.c | ||
716 | @@ -43,20 +43,8 @@ bool alternative_is_applied(u16 cpufeature) | ||
717 | */ | ||
718 | static bool branch_insn_requires_update(struct alt_instr *alt, unsigned long pc) | ||
719 | { | ||
720 | - unsigned long replptr; | ||
721 | - | ||
722 | - if (kernel_text_address(pc)) | ||
723 | - return true; | ||
724 | - | ||
725 | - replptr = (unsigned long)ALT_REPL_PTR(alt); | ||
726 | - if (pc >= replptr && pc <= (replptr + alt->alt_len)) | ||
727 | - return false; | ||
728 | - | ||
729 | - /* | ||
730 | - * Branching into *another* alternate sequence is doomed, and | ||
731 | - * we're not even trying to fix it up. | ||
732 | - */ | ||
733 | - BUG(); | ||
734 | + unsigned long replptr = (unsigned long)ALT_REPL_PTR(alt); | ||
735 | + return !(pc >= replptr && pc <= (replptr + alt->alt_len)); | ||
736 | } | ||
737 | |||
738 | #define align_down(x, a) ((unsigned long)(x) & ~(((unsigned long)(a)) - 1)) | ||
739 | diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c | ||
740 | index 48222a4760c2..7569deb1eac1 100644 | ||
741 | --- a/arch/arm64/kernel/debug-monitors.c | ||
742 | +++ b/arch/arm64/kernel/debug-monitors.c | ||
743 | @@ -141,17 +141,20 @@ postcore_initcall(debug_monitors_init); | ||
744 | /* | ||
745 | * Single step API and exception handling. | ||
746 | */ | ||
747 | -static void set_regs_spsr_ss(struct pt_regs *regs) | ||
748 | +static void set_user_regs_spsr_ss(struct user_pt_regs *regs) | ||
749 | { | ||
750 | regs->pstate |= DBG_SPSR_SS; | ||
751 | } | ||
752 | -NOKPROBE_SYMBOL(set_regs_spsr_ss); | ||
753 | +NOKPROBE_SYMBOL(set_user_regs_spsr_ss); | ||
754 | |||
755 | -static void clear_regs_spsr_ss(struct pt_regs *regs) | ||
756 | +static void clear_user_regs_spsr_ss(struct user_pt_regs *regs) | ||
757 | { | ||
758 | regs->pstate &= ~DBG_SPSR_SS; | ||
759 | } | ||
760 | -NOKPROBE_SYMBOL(clear_regs_spsr_ss); | ||
761 | +NOKPROBE_SYMBOL(clear_user_regs_spsr_ss); | ||
762 | + | ||
763 | +#define set_regs_spsr_ss(r) set_user_regs_spsr_ss(&(r)->user_regs) | ||
764 | +#define clear_regs_spsr_ss(r) clear_user_regs_spsr_ss(&(r)->user_regs) | ||
765 | |||
766 | static DEFINE_SPINLOCK(debug_hook_lock); | ||
767 | static LIST_HEAD(user_step_hook); | ||
768 | @@ -404,6 +407,15 @@ void user_fastforward_single_step(struct task_struct *task) | ||
769 | clear_regs_spsr_ss(task_pt_regs(task)); | ||
770 | } | ||
771 | |||
772 | +void user_regs_reset_single_step(struct user_pt_regs *regs, | ||
773 | + struct task_struct *task) | ||
774 | +{ | ||
775 | + if (test_tsk_thread_flag(task, TIF_SINGLESTEP)) | ||
776 | + set_user_regs_spsr_ss(regs); | ||
777 | + else | ||
778 | + clear_user_regs_spsr_ss(regs); | ||
779 | +} | ||
780 | + | ||
781 | /* Kernel API */ | ||
782 | void kernel_enable_single_step(struct pt_regs *regs) | ||
783 | { | ||
784 | diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c | ||
785 | index 8d2d9d5b418f..30b877f8b85e 100644 | ||
786 | --- a/arch/arm64/kernel/ptrace.c | ||
787 | +++ b/arch/arm64/kernel/ptrace.c | ||
788 | @@ -1819,12 +1819,23 @@ static void tracehook_report_syscall(struct pt_regs *regs, | ||
789 | saved_reg = regs->regs[regno]; | ||
790 | regs->regs[regno] = dir; | ||
791 | |||
792 | - if (dir == PTRACE_SYSCALL_EXIT) | ||
793 | + if (dir == PTRACE_SYSCALL_ENTER) { | ||
794 | + if (tracehook_report_syscall_entry(regs)) | ||
795 | + forget_syscall(regs); | ||
796 | + regs->regs[regno] = saved_reg; | ||
797 | + } else if (!test_thread_flag(TIF_SINGLESTEP)) { | ||
798 | tracehook_report_syscall_exit(regs, 0); | ||
799 | - else if (tracehook_report_syscall_entry(regs)) | ||
800 | - forget_syscall(regs); | ||
801 | + regs->regs[regno] = saved_reg; | ||
802 | + } else { | ||
803 | + regs->regs[regno] = saved_reg; | ||
804 | |||
805 | - regs->regs[regno] = saved_reg; | ||
806 | + /* | ||
807 | + * Signal a pseudo-step exception since we are stepping but | ||
808 | + * tracer modifications to the registers may have rewound the | ||
809 | + * state machine. | ||
810 | + */ | ||
811 | + tracehook_report_syscall_exit(regs, 1); | ||
812 | + } | ||
813 | } | ||
814 | |||
815 | int syscall_trace_enter(struct pt_regs *regs) | ||
816 | @@ -1852,12 +1863,14 @@ int syscall_trace_enter(struct pt_regs *regs) | ||
817 | |||
818 | void syscall_trace_exit(struct pt_regs *regs) | ||
819 | { | ||
820 | + unsigned long flags = READ_ONCE(current_thread_info()->flags); | ||
821 | + | ||
822 | audit_syscall_exit(regs); | ||
823 | |||
824 | - if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) | ||
825 | + if (flags & _TIF_SYSCALL_TRACEPOINT) | ||
826 | trace_sys_exit(regs, regs_return_value(regs)); | ||
827 | |||
828 | - if (test_thread_flag(TIF_SYSCALL_TRACE)) | ||
829 | + if (flags & (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP)) | ||
830 | tracehook_report_syscall(regs, PTRACE_SYSCALL_EXIT); | ||
831 | |||
832 | rseq_syscall(regs); | ||
833 | @@ -1935,8 +1948,8 @@ static int valid_native_regs(struct user_pt_regs *regs) | ||
834 | */ | ||
835 | int valid_user_regs(struct user_pt_regs *regs, struct task_struct *task) | ||
836 | { | ||
837 | - if (!test_tsk_thread_flag(task, TIF_SINGLESTEP)) | ||
838 | - regs->pstate &= ~DBG_SPSR_SS; | ||
839 | + /* https://lore.kernel.org/lkml/20191118131525.GA4180@willie-the-truck */ | ||
840 | + user_regs_reset_single_step(regs, task); | ||
841 | |||
842 | if (is_compat_thread(task_thread_info(task))) | ||
843 | return valid_compat_regs(regs); | ||
844 | diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c | ||
845 | index dd2cdc0d5be2..ddb757b2c3e5 100644 | ||
846 | --- a/arch/arm64/kernel/signal.c | ||
847 | +++ b/arch/arm64/kernel/signal.c | ||
848 | @@ -782,7 +782,6 @@ static void setup_restart_syscall(struct pt_regs *regs) | ||
849 | */ | ||
850 | static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) | ||
851 | { | ||
852 | - struct task_struct *tsk = current; | ||
853 | sigset_t *oldset = sigmask_to_save(); | ||
854 | int usig = ksig->sig; | ||
855 | int ret; | ||
856 | @@ -806,14 +805,8 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) | ||
857 | */ | ||
858 | ret |= !valid_user_regs(®s->user_regs, current); | ||
859 | |||
860 | - /* | ||
861 | - * Fast forward the stepping logic so we step into the signal | ||
862 | - * handler. | ||
863 | - */ | ||
864 | - if (!ret) | ||
865 | - user_fastforward_single_step(tsk); | ||
866 | - | ||
867 | - signal_setup_done(ret, ksig, 0); | ||
868 | + /* Step into the signal handler if we are stepping */ | ||
869 | + signal_setup_done(ret, ksig, test_thread_flag(TIF_SINGLESTEP)); | ||
870 | } | ||
871 | |||
872 | /* | ||
873 | diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c | ||
874 | index 871c739f060a..1457a0ba83db 100644 | ||
875 | --- a/arch/arm64/kernel/syscall.c | ||
876 | +++ b/arch/arm64/kernel/syscall.c | ||
877 | @@ -50,6 +50,9 @@ static void invoke_syscall(struct pt_regs *regs, unsigned int scno, | ||
878 | ret = do_ni_syscall(regs, scno); | ||
879 | } | ||
880 | |||
881 | + if (is_compat_task()) | ||
882 | + ret = lower_32_bits(ret); | ||
883 | + | ||
884 | regs->regs[0] = ret; | ||
885 | } | ||
886 | |||
887 | @@ -121,7 +124,7 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, | ||
888 | if (!has_syscall_work(flags) && !IS_ENABLED(CONFIG_DEBUG_RSEQ)) { | ||
889 | local_daif_mask(); | ||
890 | flags = current_thread_info()->flags; | ||
891 | - if (!has_syscall_work(flags)) { | ||
892 | + if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP)) { | ||
893 | /* | ||
894 | * We're off to userspace, where interrupts are | ||
895 | * always enabled after we restore the flags from | ||
896 | diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S | ||
897 | index e1af25dbc57e..8d0374ffdd2d 100644 | ||
898 | --- a/arch/arm64/kernel/vmlinux.lds.S | ||
899 | +++ b/arch/arm64/kernel/vmlinux.lds.S | ||
900 | @@ -172,9 +172,6 @@ SECTIONS | ||
901 | *(.altinstructions) | ||
902 | __alt_instructions_end = .; | ||
903 | } | ||
904 | - .altinstr_replacement : { | ||
905 | - *(.altinstr_replacement) | ||
906 | - } | ||
907 | |||
908 | . = ALIGN(PAGE_SIZE); | ||
909 | __inittext_end = .; | ||
910 | diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig | ||
911 | index 8c92e095f8bb..d42f79a33e91 100644 | ||
912 | --- a/arch/ia64/configs/zx1_defconfig | ||
913 | +++ b/arch/ia64/configs/zx1_defconfig | ||
914 | @@ -35,7 +35,6 @@ CONFIG_BLK_DEV_SD=y | ||
915 | CONFIG_CHR_DEV_ST=y | ||
916 | CONFIG_CHR_DEV_OSST=y | ||
917 | CONFIG_BLK_DEV_SR=y | ||
918 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
919 | CONFIG_CHR_DEV_SG=y | ||
920 | CONFIG_SCSI_CONSTANTS=y | ||
921 | CONFIG_SCSI_LOGGING=y | ||
922 | diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig | ||
923 | index 9a33c1c006a1..cf8103fa2f34 100644 | ||
924 | --- a/arch/m68k/configs/amiga_defconfig | ||
925 | +++ b/arch/m68k/configs/amiga_defconfig | ||
926 | @@ -334,7 +334,6 @@ CONFIG_SCSI=y | ||
927 | CONFIG_BLK_DEV_SD=y | ||
928 | CONFIG_CHR_DEV_ST=m | ||
929 | CONFIG_BLK_DEV_SR=y | ||
930 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
931 | CONFIG_CHR_DEV_SG=m | ||
932 | CONFIG_SCSI_CONSTANTS=y | ||
933 | CONFIG_SCSI_SAS_ATTRS=m | ||
934 | diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig | ||
935 | index 7fdbc797a05d..5636288a4b45 100644 | ||
936 | --- a/arch/m68k/configs/apollo_defconfig | ||
937 | +++ b/arch/m68k/configs/apollo_defconfig | ||
938 | @@ -319,7 +319,6 @@ CONFIG_SCSI=y | ||
939 | CONFIG_BLK_DEV_SD=y | ||
940 | CONFIG_CHR_DEV_ST=m | ||
941 | CONFIG_BLK_DEV_SR=y | ||
942 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
943 | CONFIG_CHR_DEV_SG=m | ||
944 | CONFIG_SCSI_CONSTANTS=y | ||
945 | CONFIG_SCSI_SAS_ATTRS=m | ||
946 | diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig | ||
947 | index f1763405a539..015a7f401ffd 100644 | ||
948 | --- a/arch/m68k/configs/atari_defconfig | ||
949 | +++ b/arch/m68k/configs/atari_defconfig | ||
950 | @@ -334,7 +334,6 @@ CONFIG_SCSI=y | ||
951 | CONFIG_BLK_DEV_SD=y | ||
952 | CONFIG_CHR_DEV_ST=m | ||
953 | CONFIG_BLK_DEV_SR=y | ||
954 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
955 | CONFIG_CHR_DEV_SG=m | ||
956 | CONFIG_SCSI_CONSTANTS=y | ||
957 | CONFIG_SCSI_SAS_ATTRS=m | ||
958 | diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig | ||
959 | index 91154d6acb31..1209430e61e1 100644 | ||
960 | --- a/arch/m68k/configs/bvme6000_defconfig | ||
961 | +++ b/arch/m68k/configs/bvme6000_defconfig | ||
962 | @@ -316,7 +316,6 @@ CONFIG_SCSI=y | ||
963 | CONFIG_BLK_DEV_SD=y | ||
964 | CONFIG_CHR_DEV_ST=m | ||
965 | CONFIG_BLK_DEV_SR=y | ||
966 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
967 | CONFIG_CHR_DEV_SG=m | ||
968 | CONFIG_SCSI_CONSTANTS=y | ||
969 | CONFIG_SCSI_SAS_ATTRS=m | ||
970 | diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig | ||
971 | index c398c4a94d95..a41b16067f5c 100644 | ||
972 | --- a/arch/m68k/configs/hp300_defconfig | ||
973 | +++ b/arch/m68k/configs/hp300_defconfig | ||
974 | @@ -318,7 +318,6 @@ CONFIG_SCSI=y | ||
975 | CONFIG_BLK_DEV_SD=y | ||
976 | CONFIG_CHR_DEV_ST=m | ||
977 | CONFIG_BLK_DEV_SR=y | ||
978 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
979 | CONFIG_CHR_DEV_SG=m | ||
980 | CONFIG_SCSI_CONSTANTS=y | ||
981 | CONFIG_SCSI_SAS_ATTRS=m | ||
982 | diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig | ||
983 | index 350d004559be..8af104a8c000 100644 | ||
984 | --- a/arch/m68k/configs/mac_defconfig | ||
985 | +++ b/arch/m68k/configs/mac_defconfig | ||
986 | @@ -325,7 +325,6 @@ CONFIG_SCSI=y | ||
987 | CONFIG_BLK_DEV_SD=y | ||
988 | CONFIG_CHR_DEV_ST=m | ||
989 | CONFIG_BLK_DEV_SR=y | ||
990 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
991 | CONFIG_CHR_DEV_SG=m | ||
992 | CONFIG_SCSI_CONSTANTS=y | ||
993 | CONFIG_SCSI_SAS_ATTRS=m | ||
994 | diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig | ||
995 | index b838dd820348..354ff30e22c9 100644 | ||
996 | --- a/arch/m68k/configs/multi_defconfig | ||
997 | +++ b/arch/m68k/configs/multi_defconfig | ||
998 | @@ -358,7 +358,6 @@ CONFIG_SCSI=y | ||
999 | CONFIG_BLK_DEV_SD=y | ||
1000 | CONFIG_CHR_DEV_ST=m | ||
1001 | CONFIG_BLK_DEV_SR=y | ||
1002 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1003 | CONFIG_CHR_DEV_SG=m | ||
1004 | CONFIG_SCSI_CONSTANTS=y | ||
1005 | CONFIG_SCSI_SAS_ATTRS=m | ||
1006 | diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig | ||
1007 | index 3f8dd61559cf..eac7685cea42 100644 | ||
1008 | --- a/arch/m68k/configs/mvme147_defconfig | ||
1009 | +++ b/arch/m68k/configs/mvme147_defconfig | ||
1010 | @@ -315,7 +315,6 @@ CONFIG_SCSI=y | ||
1011 | CONFIG_BLK_DEV_SD=y | ||
1012 | CONFIG_CHR_DEV_ST=m | ||
1013 | CONFIG_BLK_DEV_SR=y | ||
1014 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1015 | CONFIG_CHR_DEV_SG=m | ||
1016 | CONFIG_SCSI_CONSTANTS=y | ||
1017 | CONFIG_SCSI_SAS_ATTRS=m | ||
1018 | diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig | ||
1019 | index ae3b2d4f636c..0f38c4a3c87a 100644 | ||
1020 | --- a/arch/m68k/configs/mvme16x_defconfig | ||
1021 | +++ b/arch/m68k/configs/mvme16x_defconfig | ||
1022 | @@ -316,7 +316,6 @@ CONFIG_SCSI=y | ||
1023 | CONFIG_BLK_DEV_SD=y | ||
1024 | CONFIG_CHR_DEV_ST=m | ||
1025 | CONFIG_BLK_DEV_SR=y | ||
1026 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1027 | CONFIG_CHR_DEV_SG=m | ||
1028 | CONFIG_SCSI_CONSTANTS=y | ||
1029 | CONFIG_SCSI_SAS_ATTRS=m | ||
1030 | diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig | ||
1031 | index cd61ef14b582..6ede6869db1c 100644 | ||
1032 | --- a/arch/m68k/configs/q40_defconfig | ||
1033 | +++ b/arch/m68k/configs/q40_defconfig | ||
1034 | @@ -324,7 +324,6 @@ CONFIG_SCSI=y | ||
1035 | CONFIG_BLK_DEV_SD=y | ||
1036 | CONFIG_CHR_DEV_ST=m | ||
1037 | CONFIG_BLK_DEV_SR=y | ||
1038 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1039 | CONFIG_CHR_DEV_SG=m | ||
1040 | CONFIG_SCSI_CONSTANTS=y | ||
1041 | CONFIG_SCSI_SAS_ATTRS=m | ||
1042 | diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig | ||
1043 | index 151f5371cd3d..8644c4789938 100644 | ||
1044 | --- a/arch/m68k/configs/sun3_defconfig | ||
1045 | +++ b/arch/m68k/configs/sun3_defconfig | ||
1046 | @@ -313,7 +313,6 @@ CONFIG_SCSI=y | ||
1047 | CONFIG_BLK_DEV_SD=y | ||
1048 | CONFIG_CHR_DEV_ST=m | ||
1049 | CONFIG_BLK_DEV_SR=y | ||
1050 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1051 | CONFIG_CHR_DEV_SG=m | ||
1052 | CONFIG_SCSI_CONSTANTS=y | ||
1053 | CONFIG_SCSI_SAS_ATTRS=m | ||
1054 | diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig | ||
1055 | index 1dcb0ee1fe98..f2fd0da2346e 100644 | ||
1056 | --- a/arch/m68k/configs/sun3x_defconfig | ||
1057 | +++ b/arch/m68k/configs/sun3x_defconfig | ||
1058 | @@ -313,7 +313,6 @@ CONFIG_SCSI=y | ||
1059 | CONFIG_BLK_DEV_SD=y | ||
1060 | CONFIG_CHR_DEV_ST=m | ||
1061 | CONFIG_BLK_DEV_SR=y | ||
1062 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1063 | CONFIG_CHR_DEV_SG=m | ||
1064 | CONFIG_SCSI_CONSTANTS=y | ||
1065 | CONFIG_SCSI_SAS_ATTRS=m | ||
1066 | diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c | ||
1067 | index 3c5def10d486..caa260f877f2 100644 | ||
1068 | --- a/arch/m68k/kernel/setup_no.c | ||
1069 | +++ b/arch/m68k/kernel/setup_no.c | ||
1070 | @@ -139,7 +139,8 @@ void __init setup_arch(char **cmdline_p) | ||
1071 | pr_debug("MEMORY -> ROMFS=0x%p-0x%06lx MEM=0x%06lx-0x%06lx\n ", | ||
1072 | __bss_stop, memory_start, memory_start, memory_end); | ||
1073 | |||
1074 | - memblock_add(memory_start, memory_end - memory_start); | ||
1075 | + memblock_add(_rambase, memory_end - _rambase); | ||
1076 | + memblock_reserve(_rambase, memory_start - _rambase); | ||
1077 | |||
1078 | /* Keep a copy of command line */ | ||
1079 | *cmdline_p = &command_line[0]; | ||
1080 | diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c | ||
1081 | index 6cb1e41d58d0..70a5f55ea664 100644 | ||
1082 | --- a/arch/m68k/mm/mcfmmu.c | ||
1083 | +++ b/arch/m68k/mm/mcfmmu.c | ||
1084 | @@ -164,7 +164,7 @@ void __init cf_bootmem_alloc(void) | ||
1085 | m68k_memory[0].addr = _rambase; | ||
1086 | m68k_memory[0].size = _ramend - _rambase; | ||
1087 | |||
1088 | - memblock_add(m68k_memory[0].addr, m68k_memory[0].size); | ||
1089 | + memblock_add_node(m68k_memory[0].addr, m68k_memory[0].size, 0); | ||
1090 | |||
1091 | /* compute total pages in system */ | ||
1092 | num_pages = PFN_DOWN(_ramend - _rambase); | ||
1093 | diff --git a/arch/mips/configs/bigsur_defconfig b/arch/mips/configs/bigsur_defconfig | ||
1094 | index f14ad0538f4e..eea9b613bb74 100644 | ||
1095 | --- a/arch/mips/configs/bigsur_defconfig | ||
1096 | +++ b/arch/mips/configs/bigsur_defconfig | ||
1097 | @@ -112,7 +112,6 @@ CONFIG_BLK_DEV_TC86C001=m | ||
1098 | CONFIG_BLK_DEV_SD=y | ||
1099 | CONFIG_CHR_DEV_ST=y | ||
1100 | CONFIG_BLK_DEV_SR=y | ||
1101 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1102 | CONFIG_CHR_DEV_SG=m | ||
1103 | CONFIG_CHR_DEV_SCH=m | ||
1104 | CONFIG_ATA=y | ||
1105 | diff --git a/arch/mips/configs/fuloong2e_defconfig b/arch/mips/configs/fuloong2e_defconfig | ||
1106 | index 7a7af706e898..c5f66b7f2b22 100644 | ||
1107 | --- a/arch/mips/configs/fuloong2e_defconfig | ||
1108 | +++ b/arch/mips/configs/fuloong2e_defconfig | ||
1109 | @@ -99,7 +99,6 @@ CONFIG_CDROM_PKTCDVD=m | ||
1110 | CONFIG_ATA_OVER_ETH=m | ||
1111 | CONFIG_BLK_DEV_SD=y | ||
1112 | CONFIG_BLK_DEV_SR=y | ||
1113 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1114 | CONFIG_CHR_DEV_SG=y | ||
1115 | CONFIG_SCSI_CONSTANTS=y | ||
1116 | # CONFIG_SCSI_LOWLEVEL is not set | ||
1117 | diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig | ||
1118 | index 82d942a6026e..638d7cf5ef01 100644 | ||
1119 | --- a/arch/mips/configs/ip27_defconfig | ||
1120 | +++ b/arch/mips/configs/ip27_defconfig | ||
1121 | @@ -99,7 +99,6 @@ CONFIG_SCSI=y | ||
1122 | CONFIG_BLK_DEV_SD=y | ||
1123 | CONFIG_CHR_DEV_ST=y | ||
1124 | CONFIG_BLK_DEV_SR=m | ||
1125 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1126 | CONFIG_CHR_DEV_SG=m | ||
1127 | CONFIG_CHR_DEV_SCH=m | ||
1128 | CONFIG_SCSI_CONSTANTS=y | ||
1129 | diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig | ||
1130 | index 370884018aad..7b1fab518317 100644 | ||
1131 | --- a/arch/mips/configs/ip32_defconfig | ||
1132 | +++ b/arch/mips/configs/ip32_defconfig | ||
1133 | @@ -50,7 +50,6 @@ CONFIG_RAID_ATTRS=y | ||
1134 | CONFIG_SCSI=y | ||
1135 | CONFIG_BLK_DEV_SD=y | ||
1136 | CONFIG_BLK_DEV_SR=y | ||
1137 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1138 | CONFIG_CHR_DEV_SG=m | ||
1139 | CONFIG_SCSI_CONSTANTS=y | ||
1140 | CONFIG_SCSI_LOGGING=y | ||
1141 | diff --git a/arch/mips/configs/jazz_defconfig b/arch/mips/configs/jazz_defconfig | ||
1142 | index 328d4dfeb4cb..982b990469af 100644 | ||
1143 | --- a/arch/mips/configs/jazz_defconfig | ||
1144 | +++ b/arch/mips/configs/jazz_defconfig | ||
1145 | @@ -191,7 +191,6 @@ CONFIG_SCSI=y | ||
1146 | CONFIG_BLK_DEV_SD=y | ||
1147 | CONFIG_CHR_DEV_ST=m | ||
1148 | CONFIG_BLK_DEV_SR=m | ||
1149 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1150 | CONFIG_SCSI_CONSTANTS=y | ||
1151 | CONFIG_SCSI_SCAN_ASYNC=y | ||
1152 | CONFIG_SCSI_FC_ATTRS=y | ||
1153 | diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig | ||
1154 | index 59eedf55419d..211bd3d6e6cb 100644 | ||
1155 | --- a/arch/mips/configs/malta_defconfig | ||
1156 | +++ b/arch/mips/configs/malta_defconfig | ||
1157 | @@ -239,7 +239,6 @@ CONFIG_BLK_DEV_SD=y | ||
1158 | CONFIG_CHR_DEV_ST=m | ||
1159 | CONFIG_CHR_DEV_OSST=m | ||
1160 | CONFIG_BLK_DEV_SR=y | ||
1161 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1162 | CONFIG_CHR_DEV_SG=m | ||
1163 | CONFIG_SCSI_CONSTANTS=y | ||
1164 | CONFIG_SCSI_LOGGING=y | ||
1165 | diff --git a/arch/mips/configs/malta_kvm_defconfig b/arch/mips/configs/malta_kvm_defconfig | ||
1166 | index 8ef612552a19..62b1969b4f55 100644 | ||
1167 | --- a/arch/mips/configs/malta_kvm_defconfig | ||
1168 | +++ b/arch/mips/configs/malta_kvm_defconfig | ||
1169 | @@ -247,7 +247,6 @@ CONFIG_BLK_DEV_SD=y | ||
1170 | CONFIG_CHR_DEV_ST=m | ||
1171 | CONFIG_CHR_DEV_OSST=m | ||
1172 | CONFIG_BLK_DEV_SR=y | ||
1173 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1174 | CONFIG_CHR_DEV_SG=m | ||
1175 | CONFIG_SCSI_CONSTANTS=y | ||
1176 | CONFIG_SCSI_LOGGING=y | ||
1177 | diff --git a/arch/mips/configs/malta_kvm_guest_defconfig b/arch/mips/configs/malta_kvm_guest_defconfig | ||
1178 | index d2a008c9907c..9185e0a0aa45 100644 | ||
1179 | --- a/arch/mips/configs/malta_kvm_guest_defconfig | ||
1180 | +++ b/arch/mips/configs/malta_kvm_guest_defconfig | ||
1181 | @@ -245,7 +245,6 @@ CONFIG_BLK_DEV_SD=y | ||
1182 | CONFIG_CHR_DEV_ST=m | ||
1183 | CONFIG_CHR_DEV_OSST=m | ||
1184 | CONFIG_BLK_DEV_SR=y | ||
1185 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1186 | CONFIG_CHR_DEV_SG=m | ||
1187 | CONFIG_SCSI_CONSTANTS=y | ||
1188 | CONFIG_SCSI_LOGGING=y | ||
1189 | diff --git a/arch/mips/configs/maltaup_xpa_defconfig b/arch/mips/configs/maltaup_xpa_defconfig | ||
1190 | index 970df6d42728..636311d67a53 100644 | ||
1191 | --- a/arch/mips/configs/maltaup_xpa_defconfig | ||
1192 | +++ b/arch/mips/configs/maltaup_xpa_defconfig | ||
1193 | @@ -245,7 +245,6 @@ CONFIG_BLK_DEV_SD=y | ||
1194 | CONFIG_CHR_DEV_ST=m | ||
1195 | CONFIG_CHR_DEV_OSST=m | ||
1196 | CONFIG_BLK_DEV_SR=y | ||
1197 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1198 | CONFIG_CHR_DEV_SG=m | ||
1199 | CONFIG_SCSI_CONSTANTS=y | ||
1200 | CONFIG_SCSI_LOGGING=y | ||
1201 | diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig | ||
1202 | index 2c7adea7638f..30d7c3db884e 100644 | ||
1203 | --- a/arch/mips/configs/rm200_defconfig | ||
1204 | +++ b/arch/mips/configs/rm200_defconfig | ||
1205 | @@ -203,7 +203,6 @@ CONFIG_SCSI=y | ||
1206 | CONFIG_BLK_DEV_SD=y | ||
1207 | CONFIG_CHR_DEV_ST=m | ||
1208 | CONFIG_BLK_DEV_SR=m | ||
1209 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1210 | CONFIG_SCSI_CONSTANTS=y | ||
1211 | CONFIG_SCSI_SCAN_ASYNC=y | ||
1212 | CONFIG_SCSI_FC_ATTRS=y | ||
1213 | diff --git a/arch/powerpc/configs/85xx-hw.config b/arch/powerpc/configs/85xx-hw.config | ||
1214 | index 9575a38c9155..b507df6ac69f 100644 | ||
1215 | --- a/arch/powerpc/configs/85xx-hw.config | ||
1216 | +++ b/arch/powerpc/configs/85xx-hw.config | ||
1217 | @@ -2,7 +2,6 @@ CONFIG_AQUANTIA_PHY=y | ||
1218 | CONFIG_AT803X_PHY=y | ||
1219 | CONFIG_ATA=y | ||
1220 | CONFIG_BLK_DEV_SD=y | ||
1221 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1222 | CONFIG_BLK_DEV_SR=y | ||
1223 | CONFIG_BROADCOM_PHY=y | ||
1224 | CONFIG_C293_PCIE=y | ||
1225 | diff --git a/arch/powerpc/configs/amigaone_defconfig b/arch/powerpc/configs/amigaone_defconfig | ||
1226 | index cf94d28d0e31..340140160c7b 100644 | ||
1227 | --- a/arch/powerpc/configs/amigaone_defconfig | ||
1228 | +++ b/arch/powerpc/configs/amigaone_defconfig | ||
1229 | @@ -47,7 +47,6 @@ CONFIG_BLK_DEV_RAM=y | ||
1230 | CONFIG_BLK_DEV_SD=y | ||
1231 | CONFIG_CHR_DEV_ST=y | ||
1232 | CONFIG_BLK_DEV_SR=y | ||
1233 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1234 | CONFIG_CHR_DEV_SG=y | ||
1235 | CONFIG_SCSI_CONSTANTS=y | ||
1236 | CONFIG_SCSI_SYM53C8XX_2=y | ||
1237 | diff --git a/arch/powerpc/configs/chrp32_defconfig b/arch/powerpc/configs/chrp32_defconfig | ||
1238 | index 9ff493dd8439..6c5a4414e9ee 100644 | ||
1239 | --- a/arch/powerpc/configs/chrp32_defconfig | ||
1240 | +++ b/arch/powerpc/configs/chrp32_defconfig | ||
1241 | @@ -45,7 +45,6 @@ CONFIG_BLK_DEV_RAM=y | ||
1242 | CONFIG_BLK_DEV_SD=y | ||
1243 | CONFIG_CHR_DEV_ST=y | ||
1244 | CONFIG_BLK_DEV_SR=y | ||
1245 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1246 | CONFIG_CHR_DEV_SG=y | ||
1247 | CONFIG_SCSI_CONSTANTS=y | ||
1248 | CONFIG_SCSI_SYM53C8XX_2=y | ||
1249 | diff --git a/arch/powerpc/configs/g5_defconfig b/arch/powerpc/configs/g5_defconfig | ||
1250 | index fbfcc85e4dc0..a68c7f3af10e 100644 | ||
1251 | --- a/arch/powerpc/configs/g5_defconfig | ||
1252 | +++ b/arch/powerpc/configs/g5_defconfig | ||
1253 | @@ -62,7 +62,6 @@ CONFIG_CDROM_PKTCDVD=m | ||
1254 | CONFIG_BLK_DEV_SD=y | ||
1255 | CONFIG_CHR_DEV_ST=y | ||
1256 | CONFIG_BLK_DEV_SR=y | ||
1257 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1258 | CONFIG_CHR_DEV_SG=y | ||
1259 | CONFIG_SCSI_CONSTANTS=y | ||
1260 | CONFIG_SCSI_SPI_ATTRS=y | ||
1261 | diff --git a/arch/powerpc/configs/maple_defconfig b/arch/powerpc/configs/maple_defconfig | ||
1262 | index 2975e64629aa..161351a18517 100644 | ||
1263 | --- a/arch/powerpc/configs/maple_defconfig | ||
1264 | +++ b/arch/powerpc/configs/maple_defconfig | ||
1265 | @@ -41,7 +41,6 @@ CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
1266 | # CONFIG_SCSI_PROC_FS is not set | ||
1267 | CONFIG_BLK_DEV_SD=y | ||
1268 | CONFIG_BLK_DEV_SR=y | ||
1269 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1270 | CONFIG_CHR_DEV_SG=y | ||
1271 | CONFIG_SCSI_IPR=y | ||
1272 | CONFIG_ATA=y | ||
1273 | diff --git a/arch/powerpc/configs/pasemi_defconfig b/arch/powerpc/configs/pasemi_defconfig | ||
1274 | index 4b6d31d4474e..08b7f4cef243 100644 | ||
1275 | --- a/arch/powerpc/configs/pasemi_defconfig | ||
1276 | +++ b/arch/powerpc/configs/pasemi_defconfig | ||
1277 | @@ -60,7 +60,6 @@ CONFIG_BLK_DEV_SD=y | ||
1278 | CONFIG_CHR_DEV_ST=y | ||
1279 | CONFIG_CHR_DEV_OSST=y | ||
1280 | CONFIG_BLK_DEV_SR=y | ||
1281 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1282 | CONFIG_CHR_DEV_SG=y | ||
1283 | CONFIG_CHR_DEV_SCH=y | ||
1284 | CONFIG_SCSI_CONSTANTS=y | ||
1285 | diff --git a/arch/powerpc/configs/pmac32_defconfig b/arch/powerpc/configs/pmac32_defconfig | ||
1286 | index 4e6e95f92646..5cad09f93562 100644 | ||
1287 | --- a/arch/powerpc/configs/pmac32_defconfig | ||
1288 | +++ b/arch/powerpc/configs/pmac32_defconfig | ||
1289 | @@ -119,7 +119,6 @@ CONFIG_BLK_DEV_RAM=y | ||
1290 | CONFIG_BLK_DEV_SD=y | ||
1291 | CONFIG_CHR_DEV_ST=y | ||
1292 | CONFIG_BLK_DEV_SR=y | ||
1293 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1294 | CONFIG_CHR_DEV_SG=y | ||
1295 | CONFIG_SCSI_CONSTANTS=y | ||
1296 | CONFIG_SCSI_FC_ATTRS=y | ||
1297 | diff --git a/arch/powerpc/configs/powernv_defconfig b/arch/powerpc/configs/powernv_defconfig | ||
1298 | index 6658cceb928c..2a7c53cc2f83 100644 | ||
1299 | --- a/arch/powerpc/configs/powernv_defconfig | ||
1300 | +++ b/arch/powerpc/configs/powernv_defconfig | ||
1301 | @@ -111,7 +111,6 @@ CONFIG_BLK_DEV_NVME=y | ||
1302 | CONFIG_BLK_DEV_SD=y | ||
1303 | CONFIG_CHR_DEV_ST=m | ||
1304 | CONFIG_BLK_DEV_SR=m | ||
1305 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1306 | CONFIG_CHR_DEV_SG=m | ||
1307 | CONFIG_SCSI_CONSTANTS=y | ||
1308 | CONFIG_SCSI_SCAN_ASYNC=y | ||
1309 | diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig | ||
1310 | index b250e6f5a7ca..5569d36066dc 100644 | ||
1311 | --- a/arch/powerpc/configs/ppc64_defconfig | ||
1312 | +++ b/arch/powerpc/configs/ppc64_defconfig | ||
1313 | @@ -110,7 +110,6 @@ CONFIG_VIRTIO_BLK=m | ||
1314 | CONFIG_BLK_DEV_SD=y | ||
1315 | CONFIG_CHR_DEV_ST=m | ||
1316 | CONFIG_BLK_DEV_SR=y | ||
1317 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1318 | CONFIG_CHR_DEV_SG=y | ||
1319 | CONFIG_SCSI_CONSTANTS=y | ||
1320 | CONFIG_SCSI_FC_ATTRS=y | ||
1321 | diff --git a/arch/powerpc/configs/ppc64e_defconfig b/arch/powerpc/configs/ppc64e_defconfig | ||
1322 | index 0d746774c2bd..33a01a9e86be 100644 | ||
1323 | --- a/arch/powerpc/configs/ppc64e_defconfig | ||
1324 | +++ b/arch/powerpc/configs/ppc64e_defconfig | ||
1325 | @@ -60,7 +60,6 @@ CONFIG_BLK_DEV_RAM_SIZE=65536 | ||
1326 | CONFIG_BLK_DEV_SD=y | ||
1327 | CONFIG_CHR_DEV_ST=y | ||
1328 | CONFIG_BLK_DEV_SR=y | ||
1329 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1330 | CONFIG_CHR_DEV_SG=y | ||
1331 | CONFIG_SCSI_CONSTANTS=y | ||
1332 | CONFIG_SCSI_FC_ATTRS=y | ||
1333 | diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig | ||
1334 | index 9dca4cffa623..1372a1a7517a 100644 | ||
1335 | --- a/arch/powerpc/configs/ppc6xx_defconfig | ||
1336 | +++ b/arch/powerpc/configs/ppc6xx_defconfig | ||
1337 | @@ -372,7 +372,6 @@ CONFIG_BLK_DEV_SD=y | ||
1338 | CONFIG_CHR_DEV_ST=m | ||
1339 | CONFIG_CHR_DEV_OSST=m | ||
1340 | CONFIG_BLK_DEV_SR=m | ||
1341 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1342 | CONFIG_CHR_DEV_SG=y | ||
1343 | CONFIG_CHR_DEV_SCH=m | ||
1344 | CONFIG_SCSI_ENCLOSURE=m | ||
1345 | diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig | ||
1346 | index 26126b4d4de3..d58686a66388 100644 | ||
1347 | --- a/arch/powerpc/configs/pseries_defconfig | ||
1348 | +++ b/arch/powerpc/configs/pseries_defconfig | ||
1349 | @@ -97,7 +97,6 @@ CONFIG_VIRTIO_BLK=m | ||
1350 | CONFIG_BLK_DEV_SD=y | ||
1351 | CONFIG_CHR_DEV_ST=m | ||
1352 | CONFIG_BLK_DEV_SR=y | ||
1353 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1354 | CONFIG_CHR_DEV_SG=y | ||
1355 | CONFIG_SCSI_CONSTANTS=y | ||
1356 | CONFIG_SCSI_FC_ATTRS=y | ||
1357 | diff --git a/arch/powerpc/configs/skiroot_defconfig b/arch/powerpc/configs/skiroot_defconfig | ||
1358 | index 1253482a67c0..2e25b264f70f 100644 | ||
1359 | --- a/arch/powerpc/configs/skiroot_defconfig | ||
1360 | +++ b/arch/powerpc/configs/skiroot_defconfig | ||
1361 | @@ -83,7 +83,6 @@ CONFIG_EEPROM_AT24=m | ||
1362 | # CONFIG_OCXL is not set | ||
1363 | CONFIG_BLK_DEV_SD=m | ||
1364 | CONFIG_BLK_DEV_SR=m | ||
1365 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1366 | CONFIG_CHR_DEV_SG=m | ||
1367 | CONFIG_SCSI_CONSTANTS=y | ||
1368 | CONFIG_SCSI_SCAN_ASYNC=y | ||
1369 | diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c | ||
1370 | index 3f91ccaa9c74..4ea0cca52e16 100644 | ||
1371 | --- a/arch/powerpc/kernel/paca.c | ||
1372 | +++ b/arch/powerpc/kernel/paca.c | ||
1373 | @@ -86,7 +86,7 @@ static void *__init alloc_shared_lppaca(unsigned long size, unsigned long align, | ||
1374 | * This is very early in boot, so no harm done if the kernel crashes at | ||
1375 | * this point. | ||
1376 | */ | ||
1377 | - BUG_ON(shared_lppaca_size >= shared_lppaca_total_size); | ||
1378 | + BUG_ON(shared_lppaca_size > shared_lppaca_total_size); | ||
1379 | |||
1380 | return ptr; | ||
1381 | } | ||
1382 | diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c | ||
1383 | index ae7fca40e5b3..66f307e873dc 100644 | ||
1384 | --- a/arch/powerpc/mm/book3s64/pkeys.c | ||
1385 | +++ b/arch/powerpc/mm/book3s64/pkeys.c | ||
1386 | @@ -367,12 +367,14 @@ static bool pkey_access_permitted(int pkey, bool write, bool execute) | ||
1387 | return true; | ||
1388 | |||
1389 | pkey_shift = pkeyshift(pkey); | ||
1390 | - if (execute && !(read_iamr() & (IAMR_EX_BIT << pkey_shift))) | ||
1391 | - return true; | ||
1392 | + if (execute) | ||
1393 | + return !(read_iamr() & (IAMR_EX_BIT << pkey_shift)); | ||
1394 | + | ||
1395 | + amr = read_amr(); | ||
1396 | + if (write) | ||
1397 | + return !(amr & (AMR_WR_BIT << pkey_shift)); | ||
1398 | |||
1399 | - amr = read_amr(); /* Delay reading amr until absolutely needed */ | ||
1400 | - return ((!write && !(amr & (AMR_RD_BIT << pkey_shift))) || | ||
1401 | - (write && !(amr & (AMR_WR_BIT << pkey_shift)))); | ||
1402 | + return !(amr & (AMR_RD_BIT << pkey_shift)); | ||
1403 | } | ||
1404 | |||
1405 | bool arch_pte_access_permitted(u64 pte, bool write, bool execute) | ||
1406 | diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h | ||
1407 | index 905372d7eeb8..3df9a82bdbfd 100644 | ||
1408 | --- a/arch/riscv/include/asm/thread_info.h | ||
1409 | +++ b/arch/riscv/include/asm/thread_info.h | ||
1410 | @@ -12,7 +12,11 @@ | ||
1411 | #include <linux/const.h> | ||
1412 | |||
1413 | /* thread information allocation */ | ||
1414 | +#ifdef CONFIG_64BIT | ||
1415 | +#define THREAD_SIZE_ORDER (2) | ||
1416 | +#else | ||
1417 | #define THREAD_SIZE_ORDER (1) | ||
1418 | +#endif | ||
1419 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) | ||
1420 | |||
1421 | #ifndef __ASSEMBLY__ | ||
1422 | diff --git a/arch/sh/configs/sh03_defconfig b/arch/sh/configs/sh03_defconfig | ||
1423 | index e5beb625ab88..87db9a84b5ec 100644 | ||
1424 | --- a/arch/sh/configs/sh03_defconfig | ||
1425 | +++ b/arch/sh/configs/sh03_defconfig | ||
1426 | @@ -46,7 +46,6 @@ CONFIG_BLK_DEV_IDETAPE=m | ||
1427 | CONFIG_SCSI=m | ||
1428 | CONFIG_BLK_DEV_SD=m | ||
1429 | CONFIG_BLK_DEV_SR=m | ||
1430 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1431 | CONFIG_CHR_DEV_SG=m | ||
1432 | CONFIG_NETDEVICES=y | ||
1433 | CONFIG_NET_ETHERNET=y | ||
1434 | diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig | ||
1435 | index 6c325d53a20a..bde4d21a8ac8 100644 | ||
1436 | --- a/arch/sparc/configs/sparc64_defconfig | ||
1437 | +++ b/arch/sparc/configs/sparc64_defconfig | ||
1438 | @@ -73,7 +73,6 @@ CONFIG_RAID_ATTRS=m | ||
1439 | CONFIG_SCSI=y | ||
1440 | CONFIG_BLK_DEV_SD=y | ||
1441 | CONFIG_BLK_DEV_SR=m | ||
1442 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1443 | CONFIG_CHR_DEV_SG=m | ||
1444 | CONFIG_SCSI_MULTI_LUN=y | ||
1445 | CONFIG_SCSI_CONSTANTS=y | ||
1446 | diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig | ||
1447 | index 59ce9ed58430..18806b4fb26a 100644 | ||
1448 | --- a/arch/x86/configs/i386_defconfig | ||
1449 | +++ b/arch/x86/configs/i386_defconfig | ||
1450 | @@ -137,7 +137,6 @@ CONFIG_CONNECTOR=y | ||
1451 | CONFIG_BLK_DEV_LOOP=y | ||
1452 | CONFIG_BLK_DEV_SD=y | ||
1453 | CONFIG_BLK_DEV_SR=y | ||
1454 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1455 | CONFIG_CHR_DEV_SG=y | ||
1456 | CONFIG_SCSI_CONSTANTS=y | ||
1457 | CONFIG_SCSI_SPI_ATTRS=y | ||
1458 | diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig | ||
1459 | index d0a5ffeae8df..3087c5e351e7 100644 | ||
1460 | --- a/arch/x86/configs/x86_64_defconfig | ||
1461 | +++ b/arch/x86/configs/x86_64_defconfig | ||
1462 | @@ -136,7 +136,6 @@ CONFIG_CONNECTOR=y | ||
1463 | CONFIG_BLK_DEV_LOOP=y | ||
1464 | CONFIG_BLK_DEV_SD=y | ||
1465 | CONFIG_BLK_DEV_SR=y | ||
1466 | -CONFIG_BLK_DEV_SR_VENDOR=y | ||
1467 | CONFIG_CHR_DEV_SG=y | ||
1468 | CONFIG_SCSI_CONSTANTS=y | ||
1469 | CONFIG_SCSI_SPI_ATTRS=y | ||
1470 | diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h | ||
1471 | index 44c48e34d799..00eac7f1529b 100644 | ||
1472 | --- a/arch/x86/include/asm/fpu/internal.h | ||
1473 | +++ b/arch/x86/include/asm/fpu/internal.h | ||
1474 | @@ -619,6 +619,11 @@ static inline void switch_fpu_finish(struct fpu *new_fpu) | ||
1475 | * MXCSR and XCR definitions: | ||
1476 | */ | ||
1477 | |||
1478 | +static inline void ldmxcsr(u32 mxcsr) | ||
1479 | +{ | ||
1480 | + asm volatile("ldmxcsr %0" :: "m" (mxcsr)); | ||
1481 | +} | ||
1482 | + | ||
1483 | extern unsigned int mxcsr_feature_mask; | ||
1484 | |||
1485 | #define XCR_XFEATURE_ENABLED_MASK 0x00000000 | ||
1486 | diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c | ||
1487 | index 2c5676b0a6e7..18c0dca08163 100644 | ||
1488 | --- a/arch/x86/kernel/apic/vector.c | ||
1489 | +++ b/arch/x86/kernel/apic/vector.c | ||
1490 | @@ -446,12 +446,10 @@ static int x86_vector_activate(struct irq_domain *dom, struct irq_data *irqd, | ||
1491 | trace_vector_activate(irqd->irq, apicd->is_managed, | ||
1492 | apicd->can_reserve, reserve); | ||
1493 | |||
1494 | - /* Nothing to do for fixed assigned vectors */ | ||
1495 | - if (!apicd->can_reserve && !apicd->is_managed) | ||
1496 | - return 0; | ||
1497 | - | ||
1498 | raw_spin_lock_irqsave(&vector_lock, flags); | ||
1499 | - if (reserve || irqd_is_managed_and_shutdown(irqd)) | ||
1500 | + if (!apicd->can_reserve && !apicd->is_managed) | ||
1501 | + assign_irq_vector_any_locked(irqd); | ||
1502 | + else if (reserve || irqd_is_managed_and_shutdown(irqd)) | ||
1503 | vector_assign_managed_shutdown(irqd); | ||
1504 | else if (apicd->is_managed) | ||
1505 | ret = activate_managed(irqd); | ||
1506 | @@ -769,20 +767,10 @@ void lapic_offline(void) | ||
1507 | static int apic_set_affinity(struct irq_data *irqd, | ||
1508 | const struct cpumask *dest, bool force) | ||
1509 | { | ||
1510 | - struct apic_chip_data *apicd = apic_chip_data(irqd); | ||
1511 | int err; | ||
1512 | |||
1513 | - /* | ||
1514 | - * Core code can call here for inactive interrupts. For inactive | ||
1515 | - * interrupts which use managed or reservation mode there is no | ||
1516 | - * point in going through the vector assignment right now as the | ||
1517 | - * activation will assign a vector which fits the destination | ||
1518 | - * cpumask. Let the core code store the destination mask and be | ||
1519 | - * done with it. | ||
1520 | - */ | ||
1521 | - if (!irqd_is_activated(irqd) && | ||
1522 | - (apicd->is_managed || apicd->can_reserve)) | ||
1523 | - return IRQ_SET_MASK_OK; | ||
1524 | + if (WARN_ON_ONCE(!irqd_is_activated(irqd))) | ||
1525 | + return -EIO; | ||
1526 | |||
1527 | raw_spin_lock(&vector_lock); | ||
1528 | cpumask_and(vector_searchmask, dest, cpu_online_mask); | ||
1529 | diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c | ||
1530 | index 12c70840980e..cd8839027f66 100644 | ||
1531 | --- a/arch/x86/kernel/fpu/core.c | ||
1532 | +++ b/arch/x86/kernel/fpu/core.c | ||
1533 | @@ -101,6 +101,12 @@ void kernel_fpu_begin(void) | ||
1534 | copy_fpregs_to_fpstate(¤t->thread.fpu); | ||
1535 | } | ||
1536 | __cpu_invalidate_fpregs_state(); | ||
1537 | + | ||
1538 | + if (boot_cpu_has(X86_FEATURE_XMM)) | ||
1539 | + ldmxcsr(MXCSR_DEFAULT); | ||
1540 | + | ||
1541 | + if (boot_cpu_has(X86_FEATURE_FPU)) | ||
1542 | + asm volatile ("fninit"); | ||
1543 | } | ||
1544 | EXPORT_SYMBOL_GPL(kernel_fpu_begin); | ||
1545 | |||
1546 | diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c | ||
1547 | index c94fec268ef2..755eb26cbec0 100644 | ||
1548 | --- a/arch/x86/kernel/fpu/xstate.c | ||
1549 | +++ b/arch/x86/kernel/fpu/xstate.c | ||
1550 | @@ -1017,7 +1017,7 @@ int copy_xstate_to_kernel(void *kbuf, struct xregs_state *xsave, unsigned int of | ||
1551 | copy_part(offsetof(struct fxregs_state, st_space), 128, | ||
1552 | &xsave->i387.st_space, &kbuf, &offset_start, &count); | ||
1553 | if (header.xfeatures & XFEATURE_MASK_SSE) | ||
1554 | - copy_part(xstate_offsets[XFEATURE_MASK_SSE], 256, | ||
1555 | + copy_part(xstate_offsets[XFEATURE_SSE], 256, | ||
1556 | &xsave->i387.xmm_space, &kbuf, &offset_start, &count); | ||
1557 | /* | ||
1558 | * Fill xsave->i387.sw_reserved value for ptrace frame: | ||
1559 | diff --git a/block/blk-merge.c b/block/blk-merge.c | ||
1560 | index 48e6725b32ee..93cff719b066 100644 | ||
1561 | --- a/block/blk-merge.c | ||
1562 | +++ b/block/blk-merge.c | ||
1563 | @@ -157,17 +157,20 @@ static inline unsigned get_max_io_size(struct request_queue *q, | ||
1564 | return sectors & (lbs - 1); | ||
1565 | } | ||
1566 | |||
1567 | -static unsigned get_max_segment_size(const struct request_queue *q, | ||
1568 | - unsigned offset) | ||
1569 | +static inline unsigned get_max_segment_size(const struct request_queue *q, | ||
1570 | + struct page *start_page, | ||
1571 | + unsigned long offset) | ||
1572 | { | ||
1573 | unsigned long mask = queue_segment_boundary(q); | ||
1574 | |||
1575 | - /* default segment boundary mask means no boundary limit */ | ||
1576 | - if (mask == BLK_SEG_BOUNDARY_MASK) | ||
1577 | - return queue_max_segment_size(q); | ||
1578 | + offset = mask & (page_to_phys(start_page) + offset); | ||
1579 | |||
1580 | - return min_t(unsigned long, mask - (mask & offset) + 1, | ||
1581 | - queue_max_segment_size(q)); | ||
1582 | + /* | ||
1583 | + * overflow may be triggered in case of zero page physical address | ||
1584 | + * on 32bit arch, use queue's max segment size when that happens. | ||
1585 | + */ | ||
1586 | + return min_not_zero(mask - offset + 1, | ||
1587 | + (unsigned long)queue_max_segment_size(q)); | ||
1588 | } | ||
1589 | |||
1590 | /** | ||
1591 | @@ -201,7 +204,8 @@ static bool bvec_split_segs(const struct request_queue *q, | ||
1592 | unsigned seg_size = 0; | ||
1593 | |||
1594 | while (len && *nsegs < max_segs) { | ||
1595 | - seg_size = get_max_segment_size(q, bv->bv_offset + total_len); | ||
1596 | + seg_size = get_max_segment_size(q, bv->bv_page, | ||
1597 | + bv->bv_offset + total_len); | ||
1598 | seg_size = min(seg_size, len); | ||
1599 | |||
1600 | (*nsegs)++; | ||
1601 | @@ -404,7 +408,8 @@ static unsigned blk_bvec_map_sg(struct request_queue *q, | ||
1602 | |||
1603 | while (nbytes > 0) { | ||
1604 | unsigned offset = bvec->bv_offset + total; | ||
1605 | - unsigned len = min(get_max_segment_size(q, offset), nbytes); | ||
1606 | + unsigned len = min(get_max_segment_size(q, bvec->bv_page, | ||
1607 | + offset), nbytes); | ||
1608 | struct page *page = bvec->bv_page; | ||
1609 | |||
1610 | /* | ||
1611 | diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c | ||
1612 | index b3f2ba483992..121f4c1e0697 100644 | ||
1613 | --- a/block/blk-mq-debugfs.c | ||
1614 | +++ b/block/blk-mq-debugfs.c | ||
1615 | @@ -125,6 +125,9 @@ static const char *const blk_queue_flag_name[] = { | ||
1616 | QUEUE_FLAG_NAME(REGISTERED), | ||
1617 | QUEUE_FLAG_NAME(SCSI_PASSTHROUGH), | ||
1618 | QUEUE_FLAG_NAME(QUIESCED), | ||
1619 | + QUEUE_FLAG_NAME(PCI_P2PDMA), | ||
1620 | + QUEUE_FLAG_NAME(ZONE_RESETALL), | ||
1621 | + QUEUE_FLAG_NAME(RQ_ALLOC_TIME), | ||
1622 | }; | ||
1623 | #undef QUEUE_FLAG_NAME | ||
1624 | |||
1625 | diff --git a/crypto/asymmetric_keys/public_key.c b/crypto/asymmetric_keys/public_key.c | ||
1626 | index d7f43d4ea925..e5fae4e838c0 100644 | ||
1627 | --- a/crypto/asymmetric_keys/public_key.c | ||
1628 | +++ b/crypto/asymmetric_keys/public_key.c | ||
1629 | @@ -119,6 +119,7 @@ static int software_key_query(const struct kernel_pkey_params *params, | ||
1630 | if (IS_ERR(tfm)) | ||
1631 | return PTR_ERR(tfm); | ||
1632 | |||
1633 | + ret = -ENOMEM; | ||
1634 | key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen, | ||
1635 | GFP_KERNEL); | ||
1636 | if (!key) | ||
1637 | diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c | ||
1638 | index e63fd7bfd3a5..5bcb4c01ec5f 100644 | ||
1639 | --- a/drivers/acpi/video_detect.c | ||
1640 | +++ b/drivers/acpi/video_detect.c | ||
1641 | @@ -336,6 +336,25 @@ static const struct dmi_system_id video_detect_dmi_table[] = { | ||
1642 | DMI_MATCH(DMI_PRODUCT_NAME, "Precision 7510"), | ||
1643 | }, | ||
1644 | }, | ||
1645 | + { | ||
1646 | + .callback = video_detect_force_native, | ||
1647 | + .ident = "Acer Aspire 5738z", | ||
1648 | + .matches = { | ||
1649 | + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
1650 | + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"), | ||
1651 | + DMI_MATCH(DMI_BOARD_NAME, "JV50"), | ||
1652 | + }, | ||
1653 | + }, | ||
1654 | + { | ||
1655 | + /* https://bugzilla.kernel.org/show_bug.cgi?id=207835 */ | ||
1656 | + .callback = video_detect_force_native, | ||
1657 | + .ident = "Acer TravelMate 5735Z", | ||
1658 | + .matches = { | ||
1659 | + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
1660 | + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 5735Z"), | ||
1661 | + DMI_MATCH(DMI_BOARD_NAME, "BA51_MV"), | ||
1662 | + }, | ||
1663 | + }, | ||
1664 | |||
1665 | /* | ||
1666 | * Desktops which falsely report a backlight and which our heuristics | ||
1667 | diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c | ||
1668 | index e72843fe41df..e16afa27700d 100644 | ||
1669 | --- a/drivers/base/regmap/regmap-debugfs.c | ||
1670 | +++ b/drivers/base/regmap/regmap-debugfs.c | ||
1671 | @@ -457,29 +457,31 @@ static ssize_t regmap_cache_only_write_file(struct file *file, | ||
1672 | { | ||
1673 | struct regmap *map = container_of(file->private_data, | ||
1674 | struct regmap, cache_only); | ||
1675 | - ssize_t result; | ||
1676 | - bool was_enabled, require_sync = false; | ||
1677 | + bool new_val, require_sync = false; | ||
1678 | int err; | ||
1679 | |||
1680 | - map->lock(map->lock_arg); | ||
1681 | + err = kstrtobool_from_user(user_buf, count, &new_val); | ||
1682 | + /* Ignore malforned data like debugfs_write_file_bool() */ | ||
1683 | + if (err) | ||
1684 | + return count; | ||
1685 | |||
1686 | - was_enabled = map->cache_only; | ||
1687 | + err = debugfs_file_get(file->f_path.dentry); | ||
1688 | + if (err) | ||
1689 | + return err; | ||
1690 | |||
1691 | - result = debugfs_write_file_bool(file, user_buf, count, ppos); | ||
1692 | - if (result < 0) { | ||
1693 | - map->unlock(map->lock_arg); | ||
1694 | - return result; | ||
1695 | - } | ||
1696 | + map->lock(map->lock_arg); | ||
1697 | |||
1698 | - if (map->cache_only && !was_enabled) { | ||
1699 | + if (new_val && !map->cache_only) { | ||
1700 | dev_warn(map->dev, "debugfs cache_only=Y forced\n"); | ||
1701 | add_taint(TAINT_USER, LOCKDEP_STILL_OK); | ||
1702 | - } else if (!map->cache_only && was_enabled) { | ||
1703 | + } else if (!new_val && map->cache_only) { | ||
1704 | dev_warn(map->dev, "debugfs cache_only=N forced: syncing cache\n"); | ||
1705 | require_sync = true; | ||
1706 | } | ||
1707 | + map->cache_only = new_val; | ||
1708 | |||
1709 | map->unlock(map->lock_arg); | ||
1710 | + debugfs_file_put(file->f_path.dentry); | ||
1711 | |||
1712 | if (require_sync) { | ||
1713 | err = regcache_sync(map); | ||
1714 | @@ -487,7 +489,7 @@ static ssize_t regmap_cache_only_write_file(struct file *file, | ||
1715 | dev_err(map->dev, "Failed to sync cache %d\n", err); | ||
1716 | } | ||
1717 | |||
1718 | - return result; | ||
1719 | + return count; | ||
1720 | } | ||
1721 | |||
1722 | static const struct file_operations regmap_cache_only_fops = { | ||
1723 | @@ -502,28 +504,32 @@ static ssize_t regmap_cache_bypass_write_file(struct file *file, | ||
1724 | { | ||
1725 | struct regmap *map = container_of(file->private_data, | ||
1726 | struct regmap, cache_bypass); | ||
1727 | - ssize_t result; | ||
1728 | - bool was_enabled; | ||
1729 | + bool new_val; | ||
1730 | + int err; | ||
1731 | |||
1732 | - map->lock(map->lock_arg); | ||
1733 | + err = kstrtobool_from_user(user_buf, count, &new_val); | ||
1734 | + /* Ignore malforned data like debugfs_write_file_bool() */ | ||
1735 | + if (err) | ||
1736 | + return count; | ||
1737 | |||
1738 | - was_enabled = map->cache_bypass; | ||
1739 | + err = debugfs_file_get(file->f_path.dentry); | ||
1740 | + if (err) | ||
1741 | + return err; | ||
1742 | |||
1743 | - result = debugfs_write_file_bool(file, user_buf, count, ppos); | ||
1744 | - if (result < 0) | ||
1745 | - goto out; | ||
1746 | + map->lock(map->lock_arg); | ||
1747 | |||
1748 | - if (map->cache_bypass && !was_enabled) { | ||
1749 | + if (new_val && !map->cache_bypass) { | ||
1750 | dev_warn(map->dev, "debugfs cache_bypass=Y forced\n"); | ||
1751 | add_taint(TAINT_USER, LOCKDEP_STILL_OK); | ||
1752 | - } else if (!map->cache_bypass && was_enabled) { | ||
1753 | + } else if (!new_val && map->cache_bypass) { | ||
1754 | dev_warn(map->dev, "debugfs cache_bypass=N forced\n"); | ||
1755 | } | ||
1756 | + map->cache_bypass = new_val; | ||
1757 | |||
1758 | -out: | ||
1759 | map->unlock(map->lock_arg); | ||
1760 | + debugfs_file_put(file->f_path.dentry); | ||
1761 | |||
1762 | - return result; | ||
1763 | + return count; | ||
1764 | } | ||
1765 | |||
1766 | static const struct file_operations regmap_cache_bypass_fops = { | ||
1767 | diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c | ||
1768 | index 1bf4a908a0bd..36d49159140f 100644 | ||
1769 | --- a/drivers/block/zram/zram_drv.c | ||
1770 | +++ b/drivers/block/zram/zram_drv.c | ||
1771 | @@ -2023,7 +2023,8 @@ static ssize_t hot_add_show(struct class *class, | ||
1772 | return ret; | ||
1773 | return scnprintf(buf, PAGE_SIZE, "%d\n", ret); | ||
1774 | } | ||
1775 | -static CLASS_ATTR_RO(hot_add); | ||
1776 | +static struct class_attribute class_attr_hot_add = | ||
1777 | + __ATTR(hot_add, 0400, hot_add_show, NULL); | ||
1778 | |||
1779 | static ssize_t hot_remove_store(struct class *class, | ||
1780 | struct class_attribute *attr, | ||
1781 | diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c | ||
1782 | index 553c0e279621..f8bc052cd853 100644 | ||
1783 | --- a/drivers/bus/ti-sysc.c | ||
1784 | +++ b/drivers/bus/ti-sysc.c | ||
1785 | @@ -70,11 +70,13 @@ static const char * const clock_names[SYSC_MAX_CLOCKS] = { | ||
1786 | * @child_needs_resume: runtime resume needed for child on resume from suspend | ||
1787 | * @disable_on_idle: status flag used for disabling modules with resets | ||
1788 | * @idle_work: work structure used to perform delayed idle on a module | ||
1789 | - * @clk_enable_quirk: module specific clock enable quirk | ||
1790 | - * @clk_disable_quirk: module specific clock disable quirk | ||
1791 | + * @pre_reset_quirk: module specific pre-reset quirk | ||
1792 | + * @post_reset_quirk: module specific post-reset quirk | ||
1793 | * @reset_done_quirk: module specific reset done quirk | ||
1794 | * @module_enable_quirk: module specific enable quirk | ||
1795 | * @module_disable_quirk: module specific disable quirk | ||
1796 | + * @module_unlock_quirk: module specific sysconfig unlock quirk | ||
1797 | + * @module_lock_quirk: module specific sysconfig lock quirk | ||
1798 | */ | ||
1799 | struct sysc { | ||
1800 | struct device *dev; | ||
1801 | @@ -97,11 +99,13 @@ struct sysc { | ||
1802 | unsigned int needs_resume:1; | ||
1803 | unsigned int child_needs_resume:1; | ||
1804 | struct delayed_work idle_work; | ||
1805 | - void (*clk_enable_quirk)(struct sysc *sysc); | ||
1806 | - void (*clk_disable_quirk)(struct sysc *sysc); | ||
1807 | + void (*pre_reset_quirk)(struct sysc *sysc); | ||
1808 | + void (*post_reset_quirk)(struct sysc *sysc); | ||
1809 | void (*reset_done_quirk)(struct sysc *sysc); | ||
1810 | void (*module_enable_quirk)(struct sysc *sysc); | ||
1811 | void (*module_disable_quirk)(struct sysc *sysc); | ||
1812 | + void (*module_unlock_quirk)(struct sysc *sysc); | ||
1813 | + void (*module_lock_quirk)(struct sysc *sysc); | ||
1814 | }; | ||
1815 | |||
1816 | static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np, | ||
1817 | @@ -182,6 +186,34 @@ static u32 sysc_read_sysstatus(struct sysc *ddata) | ||
1818 | return sysc_read(ddata, offset); | ||
1819 | } | ||
1820 | |||
1821 | +/* Poll on reset status */ | ||
1822 | +static int sysc_wait_softreset(struct sysc *ddata) | ||
1823 | +{ | ||
1824 | + u32 sysc_mask, syss_done, rstval; | ||
1825 | + int syss_offset, error = 0; | ||
1826 | + | ||
1827 | + syss_offset = ddata->offsets[SYSC_SYSSTATUS]; | ||
1828 | + sysc_mask = BIT(ddata->cap->regbits->srst_shift); | ||
1829 | + | ||
1830 | + if (ddata->cfg.quirks & SYSS_QUIRK_RESETDONE_INVERTED) | ||
1831 | + syss_done = 0; | ||
1832 | + else | ||
1833 | + syss_done = ddata->cfg.syss_mask; | ||
1834 | + | ||
1835 | + if (syss_offset >= 0) { | ||
1836 | + error = readx_poll_timeout_atomic(sysc_read_sysstatus, ddata, | ||
1837 | + rstval, (rstval & ddata->cfg.syss_mask) == | ||
1838 | + syss_done, 100, MAX_MODULE_SOFTRESET_WAIT); | ||
1839 | + | ||
1840 | + } else if (ddata->cfg.quirks & SYSC_QUIRK_RESET_STATUS) { | ||
1841 | + error = readx_poll_timeout_atomic(sysc_read_sysconfig, ddata, | ||
1842 | + rstval, !(rstval & sysc_mask), | ||
1843 | + 100, MAX_MODULE_SOFTRESET_WAIT); | ||
1844 | + } | ||
1845 | + | ||
1846 | + return error; | ||
1847 | +} | ||
1848 | + | ||
1849 | static int sysc_add_named_clock_from_child(struct sysc *ddata, | ||
1850 | const char *name, | ||
1851 | const char *optfck_name) | ||
1852 | @@ -863,6 +895,22 @@ static void sysc_show_registers(struct sysc *ddata) | ||
1853 | buf); | ||
1854 | } | ||
1855 | |||
1856 | +/** | ||
1857 | + * sysc_write_sysconfig - handle sysconfig quirks for register write | ||
1858 | + * @ddata: device driver data | ||
1859 | + * @value: register value | ||
1860 | + */ | ||
1861 | +static void sysc_write_sysconfig(struct sysc *ddata, u32 value) | ||
1862 | +{ | ||
1863 | + if (ddata->module_unlock_quirk) | ||
1864 | + ddata->module_unlock_quirk(ddata); | ||
1865 | + | ||
1866 | + sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], value); | ||
1867 | + | ||
1868 | + if (ddata->module_lock_quirk) | ||
1869 | + ddata->module_lock_quirk(ddata); | ||
1870 | +} | ||
1871 | + | ||
1872 | #define SYSC_IDLE_MASK (SYSC_NR_IDLEMODES - 1) | ||
1873 | #define SYSC_CLOCACT_ICK 2 | ||
1874 | |||
1875 | @@ -872,8 +920,34 @@ static int sysc_enable_module(struct device *dev) | ||
1876 | struct sysc *ddata; | ||
1877 | const struct sysc_regbits *regbits; | ||
1878 | u32 reg, idlemodes, best_mode; | ||
1879 | + int error; | ||
1880 | |||
1881 | ddata = dev_get_drvdata(dev); | ||
1882 | + | ||
1883 | + /* | ||
1884 | + * Some modules like DSS reset automatically on idle. Enable optional | ||
1885 | + * reset clocks and wait for OCP softreset to complete. | ||
1886 | + */ | ||
1887 | + if (ddata->cfg.quirks & SYSC_QUIRK_OPT_CLKS_IN_RESET) { | ||
1888 | + error = sysc_enable_opt_clocks(ddata); | ||
1889 | + if (error) { | ||
1890 | + dev_err(ddata->dev, | ||
1891 | + "Optional clocks failed for enable: %i\n", | ||
1892 | + error); | ||
1893 | + return error; | ||
1894 | + } | ||
1895 | + } | ||
1896 | + error = sysc_wait_softreset(ddata); | ||
1897 | + if (error) | ||
1898 | + dev_warn(ddata->dev, "OCP softreset timed out\n"); | ||
1899 | + if (ddata->cfg.quirks & SYSC_QUIRK_OPT_CLKS_IN_RESET) | ||
1900 | + sysc_disable_opt_clocks(ddata); | ||
1901 | + | ||
1902 | + /* | ||
1903 | + * Some subsystem private interconnects, like DSS top level module, | ||
1904 | + * need only the automatic OCP softreset handling with no sysconfig | ||
1905 | + * register bits to configure. | ||
1906 | + */ | ||
1907 | if (ddata->offsets[SYSC_SYSCONFIG] == -ENODEV) | ||
1908 | return 0; | ||
1909 | |||
1910 | @@ -912,7 +986,7 @@ static int sysc_enable_module(struct device *dev) | ||
1911 | |||
1912 | reg &= ~(SYSC_IDLE_MASK << regbits->sidle_shift); | ||
1913 | reg |= best_mode << regbits->sidle_shift; | ||
1914 | - sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); | ||
1915 | + sysc_write_sysconfig(ddata, reg); | ||
1916 | |||
1917 | set_midle: | ||
1918 | /* Set MIDLE mode */ | ||
1919 | @@ -931,14 +1005,14 @@ set_midle: | ||
1920 | |||
1921 | reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift); | ||
1922 | reg |= best_mode << regbits->midle_shift; | ||
1923 | - sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); | ||
1924 | + sysc_write_sysconfig(ddata, reg); | ||
1925 | |||
1926 | set_autoidle: | ||
1927 | /* Autoidle bit must enabled separately if available */ | ||
1928 | if (regbits->autoidle_shift >= 0 && | ||
1929 | ddata->cfg.sysc_val & BIT(regbits->autoidle_shift)) { | ||
1930 | reg |= 1 << regbits->autoidle_shift; | ||
1931 | - sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); | ||
1932 | + sysc_write_sysconfig(ddata, reg); | ||
1933 | } | ||
1934 | |||
1935 | /* Flush posted write */ | ||
1936 | @@ -999,7 +1073,7 @@ static int sysc_disable_module(struct device *dev) | ||
1937 | |||
1938 | reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift); | ||
1939 | reg |= best_mode << regbits->midle_shift; | ||
1940 | - sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); | ||
1941 | + sysc_write_sysconfig(ddata, reg); | ||
1942 | |||
1943 | set_sidle: | ||
1944 | /* Set SIDLE mode */ | ||
1945 | @@ -1022,7 +1096,7 @@ set_sidle: | ||
1946 | if (regbits->autoidle_shift >= 0 && | ||
1947 | ddata->cfg.sysc_val & BIT(regbits->autoidle_shift)) | ||
1948 | reg |= 1 << regbits->autoidle_shift; | ||
1949 | - sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); | ||
1950 | + sysc_write_sysconfig(ddata, reg); | ||
1951 | |||
1952 | /* Flush posted write */ | ||
1953 | sysc_read(ddata, ddata->offsets[SYSC_SYSCONFIG]); | ||
1954 | @@ -1171,7 +1245,8 @@ static int __maybe_unused sysc_noirq_suspend(struct device *dev) | ||
1955 | |||
1956 | ddata = dev_get_drvdata(dev); | ||
1957 | |||
1958 | - if (ddata->cfg.quirks & SYSC_QUIRK_LEGACY_IDLE) | ||
1959 | + if (ddata->cfg.quirks & | ||
1960 | + (SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE)) | ||
1961 | return 0; | ||
1962 | |||
1963 | return pm_runtime_force_suspend(dev); | ||
1964 | @@ -1183,7 +1258,8 @@ static int __maybe_unused sysc_noirq_resume(struct device *dev) | ||
1965 | |||
1966 | ddata = dev_get_drvdata(dev); | ||
1967 | |||
1968 | - if (ddata->cfg.quirks & SYSC_QUIRK_LEGACY_IDLE) | ||
1969 | + if (ddata->cfg.quirks & | ||
1970 | + (SYSC_QUIRK_LEGACY_IDLE | SYSC_QUIRK_NO_IDLE)) | ||
1971 | return 0; | ||
1972 | |||
1973 | return pm_runtime_force_resume(dev); | ||
1974 | @@ -1231,16 +1307,16 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { | ||
1975 | SYSC_QUIRK_LEGACY_IDLE), | ||
1976 | SYSC_QUIRK("sham", 0, 0x100, 0x110, 0x114, 0x40000c03, 0xffffffff, | ||
1977 | SYSC_QUIRK_LEGACY_IDLE), | ||
1978 | - SYSC_QUIRK("smartreflex", 0, -1, 0x24, -1, 0x00000000, 0xffffffff, | ||
1979 | + SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x24, -ENODEV, 0x00000000, 0xffffffff, | ||
1980 | SYSC_QUIRK_LEGACY_IDLE), | ||
1981 | - SYSC_QUIRK("smartreflex", 0, -1, 0x38, -1, 0x00000000, 0xffffffff, | ||
1982 | + SYSC_QUIRK("smartreflex", 0, -ENODEV, 0x38, -ENODEV, 0x00000000, 0xffffffff, | ||
1983 | SYSC_QUIRK_LEGACY_IDLE), | ||
1984 | SYSC_QUIRK("timer", 0, 0, 0x10, 0x14, 0x00000015, 0xffffffff, | ||
1985 | 0), | ||
1986 | /* Some timers on omap4 and later */ | ||
1987 | - SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x50002100, 0xffffffff, | ||
1988 | + SYSC_QUIRK("timer", 0, 0, 0x10, -ENODEV, 0x50002100, 0xffffffff, | ||
1989 | 0), | ||
1990 | - SYSC_QUIRK("timer", 0, 0, 0x10, -1, 0x4fff1301, 0xffff00ff, | ||
1991 | + SYSC_QUIRK("timer", 0, 0, 0x10, -ENODEV, 0x4fff1301, 0xffff00ff, | ||
1992 | 0), | ||
1993 | SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000046, 0xffffffff, | ||
1994 | SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_LEGACY_IDLE), | ||
1995 | @@ -1253,19 +1329,27 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { | ||
1996 | SYSC_QUIRK_SWSUP_SIDLE_ACT | SYSC_QUIRK_LEGACY_IDLE), | ||
1997 | |||
1998 | /* Quirks that need to be set based on the module address */ | ||
1999 | - SYSC_QUIRK("mcpdm", 0x40132000, 0, 0x10, -1, 0x50000800, 0xffffffff, | ||
2000 | + SYSC_QUIRK("mcpdm", 0x40132000, 0, 0x10, -ENODEV, 0x50000800, 0xffffffff, | ||
2001 | SYSC_QUIRK_EXT_OPT_CLOCK | SYSC_QUIRK_NO_RESET_ON_INIT | | ||
2002 | SYSC_QUIRK_SWSUP_SIDLE), | ||
2003 | |||
2004 | /* Quirks that need to be set based on detected module */ | ||
2005 | - SYSC_QUIRK("aess", 0, 0, 0x10, -1, 0x40000000, 0xffffffff, | ||
2006 | + SYSC_QUIRK("aess", 0, 0, 0x10, -ENODEV, 0x40000000, 0xffffffff, | ||
2007 | SYSC_MODULE_QUIRK_AESS), | ||
2008 | - SYSC_QUIRK("dcan", 0x48480000, 0x20, -1, -1, 0xa3170504, 0xffffffff, | ||
2009 | + SYSC_QUIRK("dcan", 0x48480000, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff, | ||
2010 | SYSC_QUIRK_CLKDM_NOAUTO), | ||
2011 | - SYSC_QUIRK("dwc3", 0x48880000, 0, 0x10, -1, 0x500a0200, 0xffffffff, | ||
2012 | + SYSC_QUIRK("dss", 0x4832a000, 0, 0x10, 0x14, 0x00000020, 0xffffffff, | ||
2013 | + SYSC_QUIRK_OPT_CLKS_IN_RESET), | ||
2014 | + SYSC_QUIRK("dss", 0x58000000, 0, -ENODEV, 0x14, 0x00000040, 0xffffffff, | ||
2015 | + SYSC_QUIRK_OPT_CLKS_IN_RESET), | ||
2016 | + SYSC_QUIRK("dss", 0x58000000, 0, -ENODEV, 0x14, 0x00000061, 0xffffffff, | ||
2017 | + SYSC_QUIRK_OPT_CLKS_IN_RESET), | ||
2018 | + SYSC_QUIRK("dwc3", 0x48880000, 0, 0x10, -ENODEV, 0x500a0200, 0xffffffff, | ||
2019 | SYSC_QUIRK_CLKDM_NOAUTO), | ||
2020 | - SYSC_QUIRK("dwc3", 0x488c0000, 0, 0x10, -1, 0x500a0200, 0xffffffff, | ||
2021 | + SYSC_QUIRK("dwc3", 0x488c0000, 0, 0x10, -ENODEV, 0x500a0200, 0xffffffff, | ||
2022 | SYSC_QUIRK_CLKDM_NOAUTO), | ||
2023 | + SYSC_QUIRK("hdmi", 0, 0, 0x10, -ENODEV, 0x50030200, 0xffffffff, | ||
2024 | + SYSC_QUIRK_OPT_CLKS_NEEDED), | ||
2025 | SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x00000006, 0xffffffff, | ||
2026 | SYSC_MODULE_QUIRK_HDQ1W), | ||
2027 | SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x0000000a, 0xffffffff, | ||
2028 | @@ -1278,12 +1362,18 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { | ||
2029 | SYSC_MODULE_QUIRK_I2C), | ||
2030 | SYSC_QUIRK("i2c", 0, 0, 0x10, 0x90, 0x5040000a, 0xfffff0f0, | ||
2031 | SYSC_MODULE_QUIRK_I2C), | ||
2032 | - SYSC_QUIRK("gpu", 0x50000000, 0x14, -1, -1, 0x00010201, 0xffffffff, 0), | ||
2033 | - SYSC_QUIRK("gpu", 0x50000000, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff, | ||
2034 | + SYSC_QUIRK("gpu", 0x50000000, 0x14, -ENODEV, -ENODEV, 0x00010201, 0xffffffff, 0), | ||
2035 | + SYSC_QUIRK("gpu", 0x50000000, 0xfe00, 0xfe10, -ENODEV, 0x40000000 , 0xffffffff, | ||
2036 | SYSC_MODULE_QUIRK_SGX), | ||
2037 | + SYSC_QUIRK("rtc", 0, 0x74, 0x78, -ENODEV, 0x4eb01908, 0xffff00f0, | ||
2038 | + SYSC_MODULE_QUIRK_RTC_UNLOCK), | ||
2039 | + SYSC_QUIRK("tptc", 0, 0, 0x10, -ENODEV, 0x40006c00, 0xffffefff, | ||
2040 | + SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), | ||
2041 | + SYSC_QUIRK("tptc", 0, 0, -ENODEV, -ENODEV, 0x40007c00, 0xffffffff, | ||
2042 | + SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), | ||
2043 | SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050, | ||
2044 | 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), | ||
2045 | - SYSC_QUIRK("usb_otg_hs", 0, 0, 0x10, -1, 0x4ea2080d, 0xffffffff, | ||
2046 | + SYSC_QUIRK("usb_otg_hs", 0, 0, 0x10, -ENODEV, 0x4ea2080d, 0xffffffff, | ||
2047 | SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), | ||
2048 | SYSC_QUIRK("wdt", 0, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0, | ||
2049 | SYSC_MODULE_QUIRK_WDT), | ||
2050 | @@ -1292,57 +1382,68 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { | ||
2051 | SYSC_MODULE_QUIRK_WDT | SYSC_QUIRK_SWSUP_SIDLE), | ||
2052 | |||
2053 | #ifdef DEBUG | ||
2054 | - SYSC_QUIRK("adc", 0, 0, 0x10, -1, 0x47300001, 0xffffffff, 0), | ||
2055 | - SYSC_QUIRK("atl", 0, 0, -1, -1, 0x0a070100, 0xffffffff, 0), | ||
2056 | - SYSC_QUIRK("cm", 0, 0, -1, -1, 0x40000301, 0xffffffff, 0), | ||
2057 | - SYSC_QUIRK("control", 0, 0, 0x10, -1, 0x40000900, 0xffffffff, 0), | ||
2058 | + SYSC_QUIRK("adc", 0, 0, 0x10, -ENODEV, 0x47300001, 0xffffffff, 0), | ||
2059 | + SYSC_QUIRK("atl", 0, 0, -ENODEV, -ENODEV, 0x0a070100, 0xffffffff, 0), | ||
2060 | + SYSC_QUIRK("cm", 0, 0, -ENODEV, -ENODEV, 0x40000301, 0xffffffff, 0), | ||
2061 | + SYSC_QUIRK("control", 0, 0, 0x10, -ENODEV, 0x40000900, 0xffffffff, 0), | ||
2062 | SYSC_QUIRK("cpgmac", 0, 0x1200, 0x1208, 0x1204, 0x4edb1902, | ||
2063 | 0xffff00f0, 0), | ||
2064 | - SYSC_QUIRK("dcan", 0, 0x20, -1, -1, 0xa3170504, 0xffffffff, 0), | ||
2065 | - SYSC_QUIRK("dcan", 0, 0x20, -1, -1, 0x4edb1902, 0xffffffff, 0), | ||
2066 | - SYSC_QUIRK("dmic", 0, 0, 0x10, -1, 0x50010000, 0xffffffff, 0), | ||
2067 | - SYSC_QUIRK("dwc3", 0, 0, 0x10, -1, 0x500a0200, 0xffffffff, 0), | ||
2068 | + SYSC_QUIRK("dcan", 0, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff, 0), | ||
2069 | + SYSC_QUIRK("dcan", 0, 0x20, -ENODEV, -ENODEV, 0x4edb1902, 0xffffffff, 0), | ||
2070 | + SYSC_QUIRK("dispc", 0x4832a400, 0, 0x10, 0x14, 0x00000030, 0xffffffff, 0), | ||
2071 | + SYSC_QUIRK("dispc", 0x58001000, 0, 0x10, 0x14, 0x00000040, 0xffffffff, 0), | ||
2072 | + SYSC_QUIRK("dispc", 0x58001000, 0, 0x10, 0x14, 0x00000051, 0xffffffff, 0), | ||
2073 | + SYSC_QUIRK("dmic", 0, 0, 0x10, -ENODEV, 0x50010000, 0xffffffff, 0), | ||
2074 | + SYSC_QUIRK("dsi", 0x58004000, 0, 0x10, 0x14, 0x00000030, 0xffffffff, 0), | ||
2075 | + SYSC_QUIRK("dsi", 0x58005000, 0, 0x10, 0x14, 0x00000030, 0xffffffff, 0), | ||
2076 | + SYSC_QUIRK("dsi", 0x58005000, 0, 0x10, 0x14, 0x00000040, 0xffffffff, 0), | ||
2077 | + SYSC_QUIRK("dsi", 0x58009000, 0, 0x10, 0x14, 0x00000040, 0xffffffff, 0), | ||
2078 | + SYSC_QUIRK("dwc3", 0, 0, 0x10, -ENODEV, 0x500a0200, 0xffffffff, 0), | ||
2079 | SYSC_QUIRK("d2d", 0x4a0b6000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0), | ||
2080 | SYSC_QUIRK("d2d", 0x4a0cd000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0), | ||
2081 | - SYSC_QUIRK("epwmss", 0, 0, 0x4, -1, 0x47400001, 0xffffffff, 0), | ||
2082 | - SYSC_QUIRK("gpu", 0, 0x1fc00, 0x1fc10, -1, 0, 0, 0), | ||
2083 | - SYSC_QUIRK("gpu", 0, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff, 0), | ||
2084 | + SYSC_QUIRK("epwmss", 0, 0, 0x4, -ENODEV, 0x47400001, 0xffffffff, 0), | ||
2085 | + SYSC_QUIRK("gpu", 0, 0x1fc00, 0x1fc10, -ENODEV, 0, 0, 0), | ||
2086 | + SYSC_QUIRK("gpu", 0, 0xfe00, 0xfe10, -ENODEV, 0x40000000 , 0xffffffff, 0), | ||
2087 | + SYSC_QUIRK("hdmi", 0, 0, 0x10, -ENODEV, 0x50031d00, 0xffffffff, 0), | ||
2088 | SYSC_QUIRK("hsi", 0, 0, 0x10, 0x14, 0x50043101, 0xffffffff, 0), | ||
2089 | - SYSC_QUIRK("iss", 0, 0, 0x10, -1, 0x40000101, 0xffffffff, 0), | ||
2090 | - SYSC_QUIRK("lcdc", 0, 0, 0x54, -1, 0x4f201000, 0xffffffff, 0), | ||
2091 | - SYSC_QUIRK("mcasp", 0, 0, 0x4, -1, 0x44306302, 0xffffffff, 0), | ||
2092 | - SYSC_QUIRK("mcasp", 0, 0, 0x4, -1, 0x44307b02, 0xffffffff, 0), | ||
2093 | - SYSC_QUIRK("mcbsp", 0, -1, 0x8c, -1, 0, 0, 0), | ||
2094 | - SYSC_QUIRK("mcspi", 0, 0, 0x10, -1, 0x40300a0b, 0xffff00ff, 0), | ||
2095 | + SYSC_QUIRK("iss", 0, 0, 0x10, -ENODEV, 0x40000101, 0xffffffff, 0), | ||
2096 | + SYSC_QUIRK("lcdc", 0, 0, 0x54, -ENODEV, 0x4f201000, 0xffffffff, 0), | ||
2097 | + SYSC_QUIRK("mcasp", 0, 0, 0x4, -ENODEV, 0x44306302, 0xffffffff, 0), | ||
2098 | + SYSC_QUIRK("mcasp", 0, 0, 0x4, -ENODEV, 0x44307b02, 0xffffffff, 0), | ||
2099 | + SYSC_QUIRK("mcbsp", 0, -ENODEV, 0x8c, -ENODEV, 0, 0, 0), | ||
2100 | + SYSC_QUIRK("mcspi", 0, 0, 0x10, -ENODEV, 0x40300a0b, 0xffff00ff, 0), | ||
2101 | SYSC_QUIRK("mcspi", 0, 0, 0x110, 0x114, 0x40300a0b, 0xffffffff, 0), | ||
2102 | - SYSC_QUIRK("mailbox", 0, 0, 0x10, -1, 0x00000400, 0xffffffff, 0), | ||
2103 | - SYSC_QUIRK("m3", 0, 0, -1, -1, 0x5f580105, 0x0fff0f00, 0), | ||
2104 | + SYSC_QUIRK("mailbox", 0, 0, 0x10, -ENODEV, 0x00000400, 0xffffffff, 0), | ||
2105 | + SYSC_QUIRK("m3", 0, 0, -ENODEV, -ENODEV, 0x5f580105, 0x0fff0f00, 0), | ||
2106 | SYSC_QUIRK("ocp2scp", 0, 0, 0x10, 0x14, 0x50060005, 0xfffffff0, 0), | ||
2107 | - SYSC_QUIRK("ocp2scp", 0, 0, -1, -1, 0x50060007, 0xffffffff, 0), | ||
2108 | - SYSC_QUIRK("padconf", 0, 0, 0x10, -1, 0x4fff0800, 0xffffffff, 0), | ||
2109 | - SYSC_QUIRK("padconf", 0, 0, -1, -1, 0x40001100, 0xffffffff, 0), | ||
2110 | - SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x40000100, 0xffffffff, 0), | ||
2111 | - SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x00004102, 0xffffffff, 0), | ||
2112 | - SYSC_QUIRK("prcm", 0, 0, -1, -1, 0x40000400, 0xffffffff, 0), | ||
2113 | - SYSC_QUIRK("scm", 0, 0, 0x10, -1, 0x40000900, 0xffffffff, 0), | ||
2114 | - SYSC_QUIRK("scm", 0, 0, -1, -1, 0x4e8b0100, 0xffffffff, 0), | ||
2115 | - SYSC_QUIRK("scm", 0, 0, -1, -1, 0x4f000100, 0xffffffff, 0), | ||
2116 | - SYSC_QUIRK("scm", 0, 0, -1, -1, 0x40000900, 0xffffffff, 0), | ||
2117 | - SYSC_QUIRK("scrm", 0, 0, -1, -1, 0x00000010, 0xffffffff, 0), | ||
2118 | - SYSC_QUIRK("sdio", 0, 0, 0x10, -1, 0x40202301, 0xffff0ff0, 0), | ||
2119 | + SYSC_QUIRK("ocp2scp", 0, 0, -ENODEV, -ENODEV, 0x50060007, 0xffffffff, 0), | ||
2120 | + SYSC_QUIRK("padconf", 0, 0, 0x10, -ENODEV, 0x4fff0800, 0xffffffff, 0), | ||
2121 | + SYSC_QUIRK("padconf", 0, 0, -ENODEV, -ENODEV, 0x40001100, 0xffffffff, 0), | ||
2122 | + SYSC_QUIRK("prcm", 0, 0, -ENODEV, -ENODEV, 0x40000100, 0xffffffff, 0), | ||
2123 | + SYSC_QUIRK("prcm", 0, 0, -ENODEV, -ENODEV, 0x00004102, 0xffffffff, 0), | ||
2124 | + SYSC_QUIRK("prcm", 0, 0, -ENODEV, -ENODEV, 0x40000400, 0xffffffff, 0), | ||
2125 | + SYSC_QUIRK("rfbi", 0x4832a800, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0), | ||
2126 | + SYSC_QUIRK("rfbi", 0x58002000, 0, 0x10, 0x14, 0x00000010, 0xffffffff, 0), | ||
2127 | + SYSC_QUIRK("scm", 0, 0, 0x10, -ENODEV, 0x40000900, 0xffffffff, 0), | ||
2128 | + SYSC_QUIRK("scm", 0, 0, -ENODEV, -ENODEV, 0x4e8b0100, 0xffffffff, 0), | ||
2129 | + SYSC_QUIRK("scm", 0, 0, -ENODEV, -ENODEV, 0x4f000100, 0xffffffff, 0), | ||
2130 | + SYSC_QUIRK("scm", 0, 0, -ENODEV, -ENODEV, 0x40000900, 0xffffffff, 0), | ||
2131 | + SYSC_QUIRK("scrm", 0, 0, -ENODEV, -ENODEV, 0x00000010, 0xffffffff, 0), | ||
2132 | + SYSC_QUIRK("sdio", 0, 0, 0x10, -ENODEV, 0x40202301, 0xffff0ff0, 0), | ||
2133 | SYSC_QUIRK("sdio", 0, 0x2fc, 0x110, 0x114, 0x31010000, 0xffffffff, 0), | ||
2134 | SYSC_QUIRK("sdma", 0, 0, 0x2c, 0x28, 0x00010900, 0xffffffff, 0), | ||
2135 | - SYSC_QUIRK("slimbus", 0, 0, 0x10, -1, 0x40000902, 0xffffffff, 0), | ||
2136 | - SYSC_QUIRK("slimbus", 0, 0, 0x10, -1, 0x40002903, 0xffffffff, 0), | ||
2137 | - SYSC_QUIRK("spinlock", 0, 0, 0x10, -1, 0x50020000, 0xffffffff, 0), | ||
2138 | - SYSC_QUIRK("rng", 0, 0x1fe0, 0x1fe4, -1, 0x00000020, 0xffffffff, 0), | ||
2139 | - SYSC_QUIRK("rtc", 0, 0x74, 0x78, -1, 0x4eb01908, 0xffff00f0, 0), | ||
2140 | - SYSC_QUIRK("timer32k", 0, 0, 0x4, -1, 0x00000060, 0xffffffff, 0), | ||
2141 | + SYSC_QUIRK("slimbus", 0, 0, 0x10, -ENODEV, 0x40000902, 0xffffffff, 0), | ||
2142 | + SYSC_QUIRK("slimbus", 0, 0, 0x10, -ENODEV, 0x40002903, 0xffffffff, 0), | ||
2143 | + SYSC_QUIRK("spinlock", 0, 0, 0x10, -ENODEV, 0x50020000, 0xffffffff, 0), | ||
2144 | + SYSC_QUIRK("rng", 0, 0x1fe0, 0x1fe4, -ENODEV, 0x00000020, 0xffffffff, 0), | ||
2145 | + SYSC_QUIRK("timer32k", 0, 0, 0x4, -ENODEV, 0x00000060, 0xffffffff, 0), | ||
2146 | + SYSC_QUIRK("tpcc", 0, 0, -ENODEV, -ENODEV, 0x40014c00, 0xffffffff, 0), | ||
2147 | SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000004, 0xffffffff, 0), | ||
2148 | SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000008, 0xffffffff, 0), | ||
2149 | SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, 0x14, 0x50700100, 0xffffffff, 0), | ||
2150 | - SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, -1, 0x50700101, 0xffffffff, 0), | ||
2151 | - SYSC_QUIRK("vfpe", 0, 0, 0x104, -1, 0x4d001200, 0xffffffff, 0), | ||
2152 | + SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, -ENODEV, 0x50700101, 0xffffffff, 0), | ||
2153 | + SYSC_QUIRK("venc", 0x58003000, 0, -ENODEV, -ENODEV, 0x00000002, 0xffffffff, 0), | ||
2154 | + SYSC_QUIRK("vfpe", 0, 0, 0x104, -ENODEV, 0x4d001200, 0xffffffff, 0), | ||
2155 | #endif | ||
2156 | }; | ||
2157 | |||
2158 | @@ -1364,16 +1465,13 @@ static void sysc_init_early_quirks(struct sysc *ddata) | ||
2159 | if (q->base != ddata->module_pa) | ||
2160 | continue; | ||
2161 | |||
2162 | - if (q->rev_offset >= 0 && | ||
2163 | - q->rev_offset != ddata->offsets[SYSC_REVISION]) | ||
2164 | + if (q->rev_offset != ddata->offsets[SYSC_REVISION]) | ||
2165 | continue; | ||
2166 | |||
2167 | - if (q->sysc_offset >= 0 && | ||
2168 | - q->sysc_offset != ddata->offsets[SYSC_SYSCONFIG]) | ||
2169 | + if (q->sysc_offset != ddata->offsets[SYSC_SYSCONFIG]) | ||
2170 | continue; | ||
2171 | |||
2172 | - if (q->syss_offset >= 0 && | ||
2173 | - q->syss_offset != ddata->offsets[SYSC_SYSSTATUS]) | ||
2174 | + if (q->syss_offset != ddata->offsets[SYSC_SYSSTATUS]) | ||
2175 | continue; | ||
2176 | |||
2177 | ddata->name = q->name; | ||
2178 | @@ -1393,16 +1491,13 @@ static void sysc_init_revision_quirks(struct sysc *ddata) | ||
2179 | if (q->base && q->base != ddata->module_pa) | ||
2180 | continue; | ||
2181 | |||
2182 | - if (q->rev_offset >= 0 && | ||
2183 | - q->rev_offset != ddata->offsets[SYSC_REVISION]) | ||
2184 | + if (q->rev_offset != ddata->offsets[SYSC_REVISION]) | ||
2185 | continue; | ||
2186 | |||
2187 | - if (q->sysc_offset >= 0 && | ||
2188 | - q->sysc_offset != ddata->offsets[SYSC_SYSCONFIG]) | ||
2189 | + if (q->sysc_offset != ddata->offsets[SYSC_SYSCONFIG]) | ||
2190 | continue; | ||
2191 | |||
2192 | - if (q->syss_offset >= 0 && | ||
2193 | - q->syss_offset != ddata->offsets[SYSC_SYSSTATUS]) | ||
2194 | + if (q->syss_offset != ddata->offsets[SYSC_SYSSTATUS]) | ||
2195 | continue; | ||
2196 | |||
2197 | if (q->revision == ddata->revision || | ||
2198 | @@ -1433,7 +1528,7 @@ static void sysc_module_enable_quirk_aess(struct sysc *ddata) | ||
2199 | sysc_write(ddata, offset, 1); | ||
2200 | } | ||
2201 | |||
2202 | -/* I2C needs extra enable bit toggling for reset */ | ||
2203 | +/* I2C needs to be disabled for reset */ | ||
2204 | static void sysc_clk_quirk_i2c(struct sysc *ddata, bool enable) | ||
2205 | { | ||
2206 | int offset; | ||
2207 | @@ -1454,14 +1549,48 @@ static void sysc_clk_quirk_i2c(struct sysc *ddata, bool enable) | ||
2208 | sysc_write(ddata, offset, val); | ||
2209 | } | ||
2210 | |||
2211 | -static void sysc_clk_enable_quirk_i2c(struct sysc *ddata) | ||
2212 | +static void sysc_pre_reset_quirk_i2c(struct sysc *ddata) | ||
2213 | +{ | ||
2214 | + sysc_clk_quirk_i2c(ddata, false); | ||
2215 | +} | ||
2216 | + | ||
2217 | +static void sysc_post_reset_quirk_i2c(struct sysc *ddata) | ||
2218 | { | ||
2219 | sysc_clk_quirk_i2c(ddata, true); | ||
2220 | } | ||
2221 | |||
2222 | -static void sysc_clk_disable_quirk_i2c(struct sysc *ddata) | ||
2223 | +/* RTC on am3 and 4 needs to be unlocked and locked for sysconfig */ | ||
2224 | +static void sysc_quirk_rtc(struct sysc *ddata, bool lock) | ||
2225 | { | ||
2226 | - sysc_clk_quirk_i2c(ddata, false); | ||
2227 | + u32 val, kick0_val = 0, kick1_val = 0; | ||
2228 | + unsigned long flags; | ||
2229 | + int error; | ||
2230 | + | ||
2231 | + if (!lock) { | ||
2232 | + kick0_val = 0x83e70b13; | ||
2233 | + kick1_val = 0x95a4f1e0; | ||
2234 | + } | ||
2235 | + | ||
2236 | + local_irq_save(flags); | ||
2237 | + /* RTC_STATUS BUSY bit may stay active for 1/32768 seconds (~30 usec) */ | ||
2238 | + error = readl_poll_timeout_atomic(ddata->module_va + 0x44, val, | ||
2239 | + !(val & BIT(0)), 100, 50); | ||
2240 | + if (error) | ||
2241 | + dev_warn(ddata->dev, "rtc busy timeout\n"); | ||
2242 | + /* Now we have ~15 microseconds to read/write various registers */ | ||
2243 | + sysc_write(ddata, 0x6c, kick0_val); | ||
2244 | + sysc_write(ddata, 0x70, kick1_val); | ||
2245 | + local_irq_restore(flags); | ||
2246 | +} | ||
2247 | + | ||
2248 | +static void sysc_module_unlock_quirk_rtc(struct sysc *ddata) | ||
2249 | +{ | ||
2250 | + sysc_quirk_rtc(ddata, false); | ||
2251 | +} | ||
2252 | + | ||
2253 | +static void sysc_module_lock_quirk_rtc(struct sysc *ddata) | ||
2254 | +{ | ||
2255 | + sysc_quirk_rtc(ddata, true); | ||
2256 | } | ||
2257 | |||
2258 | /* 36xx SGX needs a quirk for to bypass OCP IPG interrupt logic */ | ||
2259 | @@ -1503,14 +1632,14 @@ static void sysc_init_module_quirks(struct sysc *ddata) | ||
2260 | return; | ||
2261 | |||
2262 | if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_HDQ1W) { | ||
2263 | - ddata->clk_disable_quirk = sysc_pre_reset_quirk_hdq1w; | ||
2264 | + ddata->pre_reset_quirk = sysc_pre_reset_quirk_hdq1w; | ||
2265 | |||
2266 | return; | ||
2267 | } | ||
2268 | |||
2269 | if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_I2C) { | ||
2270 | - ddata->clk_enable_quirk = sysc_clk_enable_quirk_i2c; | ||
2271 | - ddata->clk_disable_quirk = sysc_clk_disable_quirk_i2c; | ||
2272 | + ddata->pre_reset_quirk = sysc_pre_reset_quirk_i2c; | ||
2273 | + ddata->post_reset_quirk = sysc_post_reset_quirk_i2c; | ||
2274 | |||
2275 | return; | ||
2276 | } | ||
2277 | @@ -1518,6 +1647,13 @@ static void sysc_init_module_quirks(struct sysc *ddata) | ||
2278 | if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_AESS) | ||
2279 | ddata->module_enable_quirk = sysc_module_enable_quirk_aess; | ||
2280 | |||
2281 | + if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_RTC_UNLOCK) { | ||
2282 | + ddata->module_unlock_quirk = sysc_module_unlock_quirk_rtc; | ||
2283 | + ddata->module_lock_quirk = sysc_module_lock_quirk_rtc; | ||
2284 | + | ||
2285 | + return; | ||
2286 | + } | ||
2287 | + | ||
2288 | if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_SGX) | ||
2289 | ddata->module_enable_quirk = sysc_module_enable_quirk_sgx; | ||
2290 | |||
2291 | @@ -1611,11 +1747,10 @@ static int sysc_rstctrl_reset_deassert(struct sysc *ddata, bool reset) | ||
2292 | */ | ||
2293 | static int sysc_reset(struct sysc *ddata) | ||
2294 | { | ||
2295 | - int sysc_offset, syss_offset, sysc_val, rstval, error = 0; | ||
2296 | - u32 sysc_mask, syss_done; | ||
2297 | + int sysc_offset, sysc_val, error; | ||
2298 | + u32 sysc_mask; | ||
2299 | |||
2300 | sysc_offset = ddata->offsets[SYSC_SYSCONFIG]; | ||
2301 | - syss_offset = ddata->offsets[SYSC_SYSSTATUS]; | ||
2302 | |||
2303 | if (ddata->legacy_mode || sysc_offset < 0 || | ||
2304 | ddata->cap->regbits->srst_shift < 0 || | ||
2305 | @@ -1624,13 +1759,8 @@ static int sysc_reset(struct sysc *ddata) | ||
2306 | |||
2307 | sysc_mask = BIT(ddata->cap->regbits->srst_shift); | ||
2308 | |||
2309 | - if (ddata->cfg.quirks & SYSS_QUIRK_RESETDONE_INVERTED) | ||
2310 | - syss_done = 0; | ||
2311 | - else | ||
2312 | - syss_done = ddata->cfg.syss_mask; | ||
2313 | - | ||
2314 | - if (ddata->clk_disable_quirk) | ||
2315 | - ddata->clk_disable_quirk(ddata); | ||
2316 | + if (ddata->pre_reset_quirk) | ||
2317 | + ddata->pre_reset_quirk(ddata); | ||
2318 | |||
2319 | sysc_val = sysc_read_sysconfig(ddata); | ||
2320 | sysc_val |= sysc_mask; | ||
2321 | @@ -1640,21 +1770,12 @@ static int sysc_reset(struct sysc *ddata) | ||
2322 | usleep_range(ddata->cfg.srst_udelay, | ||
2323 | ddata->cfg.srst_udelay * 2); | ||
2324 | |||
2325 | - if (ddata->clk_enable_quirk) | ||
2326 | - ddata->clk_enable_quirk(ddata); | ||
2327 | + if (ddata->post_reset_quirk) | ||
2328 | + ddata->post_reset_quirk(ddata); | ||
2329 | |||
2330 | - /* Poll on reset status */ | ||
2331 | - if (syss_offset >= 0) { | ||
2332 | - error = readx_poll_timeout(sysc_read_sysstatus, ddata, rstval, | ||
2333 | - (rstval & ddata->cfg.syss_mask) == | ||
2334 | - syss_done, | ||
2335 | - 100, MAX_MODULE_SOFTRESET_WAIT); | ||
2336 | - | ||
2337 | - } else if (ddata->cfg.quirks & SYSC_QUIRK_RESET_STATUS) { | ||
2338 | - error = readx_poll_timeout(sysc_read_sysconfig, ddata, rstval, | ||
2339 | - !(rstval & sysc_mask), | ||
2340 | - 100, MAX_MODULE_SOFTRESET_WAIT); | ||
2341 | - } | ||
2342 | + error = sysc_wait_softreset(ddata); | ||
2343 | + if (error) | ||
2344 | + dev_warn(ddata->dev, "OCP softreset timed out\n"); | ||
2345 | |||
2346 | if (ddata->reset_done_quirk) | ||
2347 | ddata->reset_done_quirk(ddata); | ||
2348 | diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c | ||
2349 | index bdcf8f25cd0d..63f6bed78d89 100644 | ||
2350 | --- a/drivers/char/tpm/tpm_tis_core.c | ||
2351 | +++ b/drivers/char/tpm/tpm_tis_core.c | ||
2352 | @@ -1006,7 +1006,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, | ||
2353 | |||
2354 | return 0; | ||
2355 | out_err: | ||
2356 | - if ((chip->ops != NULL) && (chip->ops->clk_enable != NULL)) | ||
2357 | + if (chip->ops->clk_enable != NULL) | ||
2358 | chip->ops->clk_enable(chip, false); | ||
2359 | |||
2360 | tpm_tis_remove(chip); | ||
2361 | diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c | ||
2362 | index 3259426f01dc..9ebce2c12c43 100644 | ||
2363 | --- a/drivers/char/virtio_console.c | ||
2364 | +++ b/drivers/char/virtio_console.c | ||
2365 | @@ -2118,6 +2118,7 @@ static struct virtio_device_id id_table[] = { | ||
2366 | { VIRTIO_ID_CONSOLE, VIRTIO_DEV_ANY_ID }, | ||
2367 | { 0 }, | ||
2368 | }; | ||
2369 | +MODULE_DEVICE_TABLE(virtio, id_table); | ||
2370 | |||
2371 | static unsigned int features[] = { | ||
2372 | VIRTIO_CONSOLE_F_SIZE, | ||
2373 | @@ -2130,6 +2131,7 @@ static struct virtio_device_id rproc_serial_id_table[] = { | ||
2374 | #endif | ||
2375 | { 0 }, | ||
2376 | }; | ||
2377 | +MODULE_DEVICE_TABLE(virtio, rproc_serial_id_table); | ||
2378 | |||
2379 | static unsigned int rproc_serial_features[] = { | ||
2380 | }; | ||
2381 | @@ -2282,6 +2284,5 @@ static void __exit fini(void) | ||
2382 | module_init(init); | ||
2383 | module_exit(fini); | ||
2384 | |||
2385 | -MODULE_DEVICE_TABLE(virtio, id_table); | ||
2386 | MODULE_DESCRIPTION("Virtio console driver"); | ||
2387 | MODULE_LICENSE("GPL"); | ||
2388 | diff --git a/drivers/clk/clk-ast2600.c b/drivers/clk/clk-ast2600.c | ||
2389 | index 675cab6fa781..7015974f24b4 100644 | ||
2390 | --- a/drivers/clk/clk-ast2600.c | ||
2391 | +++ b/drivers/clk/clk-ast2600.c | ||
2392 | @@ -130,6 +130,18 @@ static const struct clk_div_table ast2600_eclk_div_table[] = { | ||
2393 | { 0 } | ||
2394 | }; | ||
2395 | |||
2396 | +static const struct clk_div_table ast2600_emmc_extclk_div_table[] = { | ||
2397 | + { 0x0, 2 }, | ||
2398 | + { 0x1, 4 }, | ||
2399 | + { 0x2, 6 }, | ||
2400 | + { 0x3, 8 }, | ||
2401 | + { 0x4, 10 }, | ||
2402 | + { 0x5, 12 }, | ||
2403 | + { 0x6, 14 }, | ||
2404 | + { 0x7, 16 }, | ||
2405 | + { 0 } | ||
2406 | +}; | ||
2407 | + | ||
2408 | static const struct clk_div_table ast2600_mac_div_table[] = { | ||
2409 | { 0x0, 4 }, | ||
2410 | { 0x1, 4 }, | ||
2411 | @@ -389,6 +401,11 @@ static struct clk_hw *aspeed_g6_clk_hw_register_gate(struct device *dev, | ||
2412 | return hw; | ||
2413 | } | ||
2414 | |||
2415 | +static const char *const emmc_extclk_parent_names[] = { | ||
2416 | + "emmc_extclk_hpll_in", | ||
2417 | + "mpll", | ||
2418 | +}; | ||
2419 | + | ||
2420 | static const char * const vclk_parent_names[] = { | ||
2421 | "dpll", | ||
2422 | "d1pll", | ||
2423 | @@ -458,16 +475,32 @@ static int aspeed_g6_clk_probe(struct platform_device *pdev) | ||
2424 | return PTR_ERR(hw); | ||
2425 | aspeed_g6_clk_data->hws[ASPEED_CLK_UARTX] = hw; | ||
2426 | |||
2427 | - /* EMMC ext clock divider */ | ||
2428 | - hw = clk_hw_register_gate(dev, "emmc_extclk_gate", "hpll", 0, | ||
2429 | - scu_g6_base + ASPEED_G6_CLK_SELECTION1, 15, 0, | ||
2430 | - &aspeed_g6_clk_lock); | ||
2431 | + /* EMMC ext clock */ | ||
2432 | + hw = clk_hw_register_fixed_factor(dev, "emmc_extclk_hpll_in", "hpll", | ||
2433 | + 0, 1, 2); | ||
2434 | if (IS_ERR(hw)) | ||
2435 | return PTR_ERR(hw); | ||
2436 | - hw = clk_hw_register_divider_table(dev, "emmc_extclk", "emmc_extclk_gate", 0, | ||
2437 | - scu_g6_base + ASPEED_G6_CLK_SELECTION1, 12, 3, 0, | ||
2438 | - ast2600_div_table, | ||
2439 | - &aspeed_g6_clk_lock); | ||
2440 | + | ||
2441 | + hw = clk_hw_register_mux(dev, "emmc_extclk_mux", | ||
2442 | + emmc_extclk_parent_names, | ||
2443 | + ARRAY_SIZE(emmc_extclk_parent_names), 0, | ||
2444 | + scu_g6_base + ASPEED_G6_CLK_SELECTION1, 11, 1, | ||
2445 | + 0, &aspeed_g6_clk_lock); | ||
2446 | + if (IS_ERR(hw)) | ||
2447 | + return PTR_ERR(hw); | ||
2448 | + | ||
2449 | + hw = clk_hw_register_gate(dev, "emmc_extclk_gate", "emmc_extclk_mux", | ||
2450 | + 0, scu_g6_base + ASPEED_G6_CLK_SELECTION1, | ||
2451 | + 15, 0, &aspeed_g6_clk_lock); | ||
2452 | + if (IS_ERR(hw)) | ||
2453 | + return PTR_ERR(hw); | ||
2454 | + | ||
2455 | + hw = clk_hw_register_divider_table(dev, "emmc_extclk", | ||
2456 | + "emmc_extclk_gate", 0, | ||
2457 | + scu_g6_base + | ||
2458 | + ASPEED_G6_CLK_SELECTION1, 12, | ||
2459 | + 3, 0, ast2600_emmc_extclk_div_table, | ||
2460 | + &aspeed_g6_clk_lock); | ||
2461 | if (IS_ERR(hw)) | ||
2462 | return PTR_ERR(hw); | ||
2463 | aspeed_g6_clk_data->hws[ASPEED_CLK_EMMC] = hw; | ||
2464 | diff --git a/drivers/clk/mvebu/Kconfig b/drivers/clk/mvebu/Kconfig | ||
2465 | index 415e6906a113..76cd06f4ed62 100644 | ||
2466 | --- a/drivers/clk/mvebu/Kconfig | ||
2467 | +++ b/drivers/clk/mvebu/Kconfig | ||
2468 | @@ -42,6 +42,7 @@ config ARMADA_AP806_SYSCON | ||
2469 | |||
2470 | config ARMADA_AP_CPU_CLK | ||
2471 | bool | ||
2472 | + select ARMADA_AP_CP_HELPER | ||
2473 | |||
2474 | config ARMADA_CP110_SYSCON | ||
2475 | bool | ||
2476 | diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c | ||
2477 | index e3959ff5cb55..fad42897a7a7 100644 | ||
2478 | --- a/drivers/clk/qcom/gcc-sm8150.c | ||
2479 | +++ b/drivers/clk/qcom/gcc-sm8150.c | ||
2480 | @@ -1615,6 +1615,36 @@ static struct clk_branch gcc_gpu_cfg_ahb_clk = { | ||
2481 | }, | ||
2482 | }; | ||
2483 | |||
2484 | +static struct clk_branch gcc_gpu_gpll0_clk_src = { | ||
2485 | + .clkr = { | ||
2486 | + .enable_reg = 0x52004, | ||
2487 | + .enable_mask = BIT(15), | ||
2488 | + .hw.init = &(struct clk_init_data){ | ||
2489 | + .name = "gcc_gpu_gpll0_clk_src", | ||
2490 | + .parent_hws = (const struct clk_hw *[]){ | ||
2491 | + &gpll0.clkr.hw }, | ||
2492 | + .num_parents = 1, | ||
2493 | + .flags = CLK_SET_RATE_PARENT, | ||
2494 | + .ops = &clk_branch2_ops, | ||
2495 | + }, | ||
2496 | + }, | ||
2497 | +}; | ||
2498 | + | ||
2499 | +static struct clk_branch gcc_gpu_gpll0_div_clk_src = { | ||
2500 | + .clkr = { | ||
2501 | + .enable_reg = 0x52004, | ||
2502 | + .enable_mask = BIT(16), | ||
2503 | + .hw.init = &(struct clk_init_data){ | ||
2504 | + .name = "gcc_gpu_gpll0_div_clk_src", | ||
2505 | + .parent_hws = (const struct clk_hw *[]){ | ||
2506 | + &gcc_gpu_gpll0_clk_src.clkr.hw }, | ||
2507 | + .num_parents = 1, | ||
2508 | + .flags = CLK_SET_RATE_PARENT, | ||
2509 | + .ops = &clk_branch2_ops, | ||
2510 | + }, | ||
2511 | + }, | ||
2512 | +}; | ||
2513 | + | ||
2514 | static struct clk_branch gcc_gpu_iref_clk = { | ||
2515 | .halt_reg = 0x8c010, | ||
2516 | .halt_check = BRANCH_HALT, | ||
2517 | @@ -1697,6 +1727,36 @@ static struct clk_branch gcc_npu_cfg_ahb_clk = { | ||
2518 | }, | ||
2519 | }; | ||
2520 | |||
2521 | +static struct clk_branch gcc_npu_gpll0_clk_src = { | ||
2522 | + .clkr = { | ||
2523 | + .enable_reg = 0x52004, | ||
2524 | + .enable_mask = BIT(18), | ||
2525 | + .hw.init = &(struct clk_init_data){ | ||
2526 | + .name = "gcc_npu_gpll0_clk_src", | ||
2527 | + .parent_hws = (const struct clk_hw *[]){ | ||
2528 | + &gpll0.clkr.hw }, | ||
2529 | + .num_parents = 1, | ||
2530 | + .flags = CLK_SET_RATE_PARENT, | ||
2531 | + .ops = &clk_branch2_ops, | ||
2532 | + }, | ||
2533 | + }, | ||
2534 | +}; | ||
2535 | + | ||
2536 | +static struct clk_branch gcc_npu_gpll0_div_clk_src = { | ||
2537 | + .clkr = { | ||
2538 | + .enable_reg = 0x52004, | ||
2539 | + .enable_mask = BIT(19), | ||
2540 | + .hw.init = &(struct clk_init_data){ | ||
2541 | + .name = "gcc_npu_gpll0_div_clk_src", | ||
2542 | + .parent_hws = (const struct clk_hw *[]){ | ||
2543 | + &gcc_npu_gpll0_clk_src.clkr.hw }, | ||
2544 | + .num_parents = 1, | ||
2545 | + .flags = CLK_SET_RATE_PARENT, | ||
2546 | + .ops = &clk_branch2_ops, | ||
2547 | + }, | ||
2548 | + }, | ||
2549 | +}; | ||
2550 | + | ||
2551 | static struct clk_branch gcc_npu_trig_clk = { | ||
2552 | .halt_reg = 0x4d00c, | ||
2553 | .halt_check = BRANCH_VOTED, | ||
2554 | @@ -2811,6 +2871,45 @@ static struct clk_branch gcc_ufs_card_phy_aux_hw_ctl_clk = { | ||
2555 | }, | ||
2556 | }; | ||
2557 | |||
2558 | +/* external clocks so add BRANCH_HALT_SKIP */ | ||
2559 | +static struct clk_branch gcc_ufs_card_rx_symbol_0_clk = { | ||
2560 | + .halt_check = BRANCH_HALT_SKIP, | ||
2561 | + .clkr = { | ||
2562 | + .enable_reg = 0x7501c, | ||
2563 | + .enable_mask = BIT(0), | ||
2564 | + .hw.init = &(struct clk_init_data){ | ||
2565 | + .name = "gcc_ufs_card_rx_symbol_0_clk", | ||
2566 | + .ops = &clk_branch2_ops, | ||
2567 | + }, | ||
2568 | + }, | ||
2569 | +}; | ||
2570 | + | ||
2571 | +/* external clocks so add BRANCH_HALT_SKIP */ | ||
2572 | +static struct clk_branch gcc_ufs_card_rx_symbol_1_clk = { | ||
2573 | + .halt_check = BRANCH_HALT_SKIP, | ||
2574 | + .clkr = { | ||
2575 | + .enable_reg = 0x750ac, | ||
2576 | + .enable_mask = BIT(0), | ||
2577 | + .hw.init = &(struct clk_init_data){ | ||
2578 | + .name = "gcc_ufs_card_rx_symbol_1_clk", | ||
2579 | + .ops = &clk_branch2_ops, | ||
2580 | + }, | ||
2581 | + }, | ||
2582 | +}; | ||
2583 | + | ||
2584 | +/* external clocks so add BRANCH_HALT_SKIP */ | ||
2585 | +static struct clk_branch gcc_ufs_card_tx_symbol_0_clk = { | ||
2586 | + .halt_check = BRANCH_HALT_SKIP, | ||
2587 | + .clkr = { | ||
2588 | + .enable_reg = 0x75018, | ||
2589 | + .enable_mask = BIT(0), | ||
2590 | + .hw.init = &(struct clk_init_data){ | ||
2591 | + .name = "gcc_ufs_card_tx_symbol_0_clk", | ||
2592 | + .ops = &clk_branch2_ops, | ||
2593 | + }, | ||
2594 | + }, | ||
2595 | +}; | ||
2596 | + | ||
2597 | static struct clk_branch gcc_ufs_card_unipro_core_clk = { | ||
2598 | .halt_reg = 0x75058, | ||
2599 | .halt_check = BRANCH_HALT, | ||
2600 | @@ -2991,6 +3090,45 @@ static struct clk_branch gcc_ufs_phy_phy_aux_hw_ctl_clk = { | ||
2601 | }, | ||
2602 | }; | ||
2603 | |||
2604 | +/* external clocks so add BRANCH_HALT_SKIP */ | ||
2605 | +static struct clk_branch gcc_ufs_phy_rx_symbol_0_clk = { | ||
2606 | + .halt_check = BRANCH_HALT_SKIP, | ||
2607 | + .clkr = { | ||
2608 | + .enable_reg = 0x7701c, | ||
2609 | + .enable_mask = BIT(0), | ||
2610 | + .hw.init = &(struct clk_init_data){ | ||
2611 | + .name = "gcc_ufs_phy_rx_symbol_0_clk", | ||
2612 | + .ops = &clk_branch2_ops, | ||
2613 | + }, | ||
2614 | + }, | ||
2615 | +}; | ||
2616 | + | ||
2617 | +/* external clocks so add BRANCH_HALT_SKIP */ | ||
2618 | +static struct clk_branch gcc_ufs_phy_rx_symbol_1_clk = { | ||
2619 | + .halt_check = BRANCH_HALT_SKIP, | ||
2620 | + .clkr = { | ||
2621 | + .enable_reg = 0x770ac, | ||
2622 | + .enable_mask = BIT(0), | ||
2623 | + .hw.init = &(struct clk_init_data){ | ||
2624 | + .name = "gcc_ufs_phy_rx_symbol_1_clk", | ||
2625 | + .ops = &clk_branch2_ops, | ||
2626 | + }, | ||
2627 | + }, | ||
2628 | +}; | ||
2629 | + | ||
2630 | +/* external clocks so add BRANCH_HALT_SKIP */ | ||
2631 | +static struct clk_branch gcc_ufs_phy_tx_symbol_0_clk = { | ||
2632 | + .halt_check = BRANCH_HALT_SKIP, | ||
2633 | + .clkr = { | ||
2634 | + .enable_reg = 0x77018, | ||
2635 | + .enable_mask = BIT(0), | ||
2636 | + .hw.init = &(struct clk_init_data){ | ||
2637 | + .name = "gcc_ufs_phy_tx_symbol_0_clk", | ||
2638 | + .ops = &clk_branch2_ops, | ||
2639 | + }, | ||
2640 | + }, | ||
2641 | +}; | ||
2642 | + | ||
2643 | static struct clk_branch gcc_ufs_phy_unipro_core_clk = { | ||
2644 | .halt_reg = 0x77058, | ||
2645 | .halt_check = BRANCH_HALT, | ||
2646 | @@ -3331,12 +3469,16 @@ static struct clk_regmap *gcc_sm8150_clocks[] = { | ||
2647 | [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, | ||
2648 | [GCC_GP3_CLK_SRC] = &gcc_gp3_clk_src.clkr, | ||
2649 | [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr, | ||
2650 | + [GCC_GPU_GPLL0_CLK_SRC] = &gcc_gpu_gpll0_clk_src.clkr, | ||
2651 | + [GCC_GPU_GPLL0_DIV_CLK_SRC] = &gcc_gpu_gpll0_div_clk_src.clkr, | ||
2652 | [GCC_GPU_IREF_CLK] = &gcc_gpu_iref_clk.clkr, | ||
2653 | [GCC_GPU_MEMNOC_GFX_CLK] = &gcc_gpu_memnoc_gfx_clk.clkr, | ||
2654 | [GCC_GPU_SNOC_DVM_GFX_CLK] = &gcc_gpu_snoc_dvm_gfx_clk.clkr, | ||
2655 | [GCC_NPU_AT_CLK] = &gcc_npu_at_clk.clkr, | ||
2656 | [GCC_NPU_AXI_CLK] = &gcc_npu_axi_clk.clkr, | ||
2657 | [GCC_NPU_CFG_AHB_CLK] = &gcc_npu_cfg_ahb_clk.clkr, | ||
2658 | + [GCC_NPU_GPLL0_CLK_SRC] = &gcc_npu_gpll0_clk_src.clkr, | ||
2659 | + [GCC_NPU_GPLL0_DIV_CLK_SRC] = &gcc_npu_gpll0_div_clk_src.clkr, | ||
2660 | [GCC_NPU_TRIG_CLK] = &gcc_npu_trig_clk.clkr, | ||
2661 | [GCC_PCIE0_PHY_REFGEN_CLK] = &gcc_pcie0_phy_refgen_clk.clkr, | ||
2662 | [GCC_PCIE1_PHY_REFGEN_CLK] = &gcc_pcie1_phy_refgen_clk.clkr, | ||
2663 | @@ -3441,6 +3583,9 @@ static struct clk_regmap *gcc_sm8150_clocks[] = { | ||
2664 | [GCC_UFS_CARD_PHY_AUX_CLK_SRC] = &gcc_ufs_card_phy_aux_clk_src.clkr, | ||
2665 | [GCC_UFS_CARD_PHY_AUX_HW_CTL_CLK] = | ||
2666 | &gcc_ufs_card_phy_aux_hw_ctl_clk.clkr, | ||
2667 | + [GCC_UFS_CARD_RX_SYMBOL_0_CLK] = &gcc_ufs_card_rx_symbol_0_clk.clkr, | ||
2668 | + [GCC_UFS_CARD_RX_SYMBOL_1_CLK] = &gcc_ufs_card_rx_symbol_1_clk.clkr, | ||
2669 | + [GCC_UFS_CARD_TX_SYMBOL_0_CLK] = &gcc_ufs_card_tx_symbol_0_clk.clkr, | ||
2670 | [GCC_UFS_CARD_UNIPRO_CORE_CLK] = &gcc_ufs_card_unipro_core_clk.clkr, | ||
2671 | [GCC_UFS_CARD_UNIPRO_CORE_CLK_SRC] = | ||
2672 | &gcc_ufs_card_unipro_core_clk_src.clkr, | ||
2673 | @@ -3458,6 +3603,9 @@ static struct clk_regmap *gcc_sm8150_clocks[] = { | ||
2674 | [GCC_UFS_PHY_PHY_AUX_CLK] = &gcc_ufs_phy_phy_aux_clk.clkr, | ||
2675 | [GCC_UFS_PHY_PHY_AUX_CLK_SRC] = &gcc_ufs_phy_phy_aux_clk_src.clkr, | ||
2676 | [GCC_UFS_PHY_PHY_AUX_HW_CTL_CLK] = &gcc_ufs_phy_phy_aux_hw_ctl_clk.clkr, | ||
2677 | + [GCC_UFS_PHY_RX_SYMBOL_0_CLK] = &gcc_ufs_phy_rx_symbol_0_clk.clkr, | ||
2678 | + [GCC_UFS_PHY_RX_SYMBOL_1_CLK] = &gcc_ufs_phy_rx_symbol_1_clk.clkr, | ||
2679 | + [GCC_UFS_PHY_TX_SYMBOL_0_CLK] = &gcc_ufs_phy_tx_symbol_0_clk.clkr, | ||
2680 | [GCC_UFS_PHY_UNIPRO_CORE_CLK] = &gcc_ufs_phy_unipro_core_clk.clkr, | ||
2681 | [GCC_UFS_PHY_UNIPRO_CORE_CLK_SRC] = | ||
2682 | &gcc_ufs_phy_unipro_core_clk_src.clkr, | ||
2683 | diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c | ||
2684 | index 9a5464c625b4..4be83b4de2a0 100644 | ||
2685 | --- a/drivers/clocksource/arm_arch_timer.c | ||
2686 | +++ b/drivers/clocksource/arm_arch_timer.c | ||
2687 | @@ -69,7 +69,7 @@ static enum arch_timer_ppi_nr arch_timer_uses_ppi = ARCH_TIMER_VIRT_PPI; | ||
2688 | static bool arch_timer_c3stop; | ||
2689 | static bool arch_timer_mem_use_virtual; | ||
2690 | static bool arch_counter_suspend_stop; | ||
2691 | -static bool vdso_default = true; | ||
2692 | +static enum vdso_arch_clockmode vdso_default = VDSO_CLOCKMODE_ARCHTIMER; | ||
2693 | |||
2694 | static cpumask_t evtstrm_available = CPU_MASK_NONE; | ||
2695 | static bool evtstrm_enable = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM); | ||
2696 | @@ -476,6 +476,14 @@ static const struct arch_timer_erratum_workaround ool_workarounds[] = { | ||
2697 | .set_next_event_virt = erratum_set_next_event_tval_virt, | ||
2698 | }, | ||
2699 | #endif | ||
2700 | +#ifdef CONFIG_ARM64_ERRATUM_1418040 | ||
2701 | + { | ||
2702 | + .match_type = ate_match_local_cap_id, | ||
2703 | + .id = (void *)ARM64_WORKAROUND_1418040, | ||
2704 | + .desc = "ARM erratum 1418040", | ||
2705 | + .disable_compat_vdso = true, | ||
2706 | + }, | ||
2707 | +#endif | ||
2708 | }; | ||
2709 | |||
2710 | typedef bool (*ate_match_fn_t)(const struct arch_timer_erratum_workaround *, | ||
2711 | @@ -560,8 +568,11 @@ void arch_timer_enable_workaround(const struct arch_timer_erratum_workaround *wa | ||
2712 | * change both the default value and the vdso itself. | ||
2713 | */ | ||
2714 | if (wa->read_cntvct_el0) { | ||
2715 | - clocksource_counter.archdata.vdso_direct = false; | ||
2716 | - vdso_default = false; | ||
2717 | + clocksource_counter.archdata.clock_mode = VDSO_CLOCKMODE_NONE; | ||
2718 | + vdso_default = VDSO_CLOCKMODE_NONE; | ||
2719 | + } else if (wa->disable_compat_vdso && vdso_default != VDSO_CLOCKMODE_NONE) { | ||
2720 | + vdso_default = VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT; | ||
2721 | + clocksource_counter.archdata.clock_mode = vdso_default; | ||
2722 | } | ||
2723 | } | ||
2724 | |||
2725 | @@ -979,7 +990,7 @@ static void __init arch_counter_register(unsigned type) | ||
2726 | } | ||
2727 | |||
2728 | arch_timer_read_counter = rd; | ||
2729 | - clocksource_counter.archdata.vdso_direct = vdso_default; | ||
2730 | + clocksource_counter.archdata.clock_mode = vdso_default; | ||
2731 | } else { | ||
2732 | arch_timer_read_counter = arch_counter_get_cntvct_mem; | ||
2733 | } | ||
2734 | diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig | ||
2735 | index 06b2b3fa5206..0952f059d967 100644 | ||
2736 | --- a/drivers/crypto/Kconfig | ||
2737 | +++ b/drivers/crypto/Kconfig | ||
2738 | @@ -491,11 +491,9 @@ if CRYPTO_DEV_UX500 | ||
2739 | endif # if CRYPTO_DEV_UX500 | ||
2740 | |||
2741 | config CRYPTO_DEV_ATMEL_AUTHENC | ||
2742 | - tristate "Support for Atmel IPSEC/SSL hw accelerator" | ||
2743 | + bool "Support for Atmel IPSEC/SSL hw accelerator" | ||
2744 | depends on ARCH_AT91 || COMPILE_TEST | ||
2745 | - select CRYPTO_AUTHENC | ||
2746 | - select CRYPTO_DEV_ATMEL_AES | ||
2747 | - select CRYPTO_DEV_ATMEL_SHA | ||
2748 | + depends on CRYPTO_DEV_ATMEL_AES | ||
2749 | help | ||
2750 | Some Atmel processors can combine the AES and SHA hw accelerators | ||
2751 | to enhance support of IPSEC/SSL. | ||
2752 | @@ -508,6 +506,8 @@ config CRYPTO_DEV_ATMEL_AES | ||
2753 | select CRYPTO_AES | ||
2754 | select CRYPTO_AEAD | ||
2755 | select CRYPTO_BLKCIPHER | ||
2756 | + select CRYPTO_AUTHENC if CRYPTO_DEV_ATMEL_AUTHENC | ||
2757 | + select CRYPTO_DEV_ATMEL_SHA if CRYPTO_DEV_ATMEL_AUTHENC | ||
2758 | help | ||
2759 | Some Atmel processors have AES hw accelerator. | ||
2760 | Select this if you want to use the Atmel module for | ||
2761 | diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c | ||
2762 | index 0425984db118..62d9825a49e9 100644 | ||
2763 | --- a/drivers/dma/dmatest.c | ||
2764 | +++ b/drivers/dma/dmatest.c | ||
2765 | @@ -1168,6 +1168,8 @@ static int dmatest_run_set(const char *val, const struct kernel_param *kp) | ||
2766 | } else if (dmatest_run) { | ||
2767 | if (!is_threaded_test_pending(info)) { | ||
2768 | pr_info("No channels configured, continue with any\n"); | ||
2769 | + if (!is_threaded_test_run(info)) | ||
2770 | + stop_threaded_test(info); | ||
2771 | add_threaded_test(info); | ||
2772 | } | ||
2773 | start_threaded_tests(info); | ||
2774 | diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c | ||
2775 | index 21cb2a58dbd2..a1b56f52db2f 100644 | ||
2776 | --- a/drivers/dma/dw/core.c | ||
2777 | +++ b/drivers/dma/dw/core.c | ||
2778 | @@ -118,16 +118,11 @@ static void dwc_initialize(struct dw_dma_chan *dwc) | ||
2779 | { | ||
2780 | struct dw_dma *dw = to_dw_dma(dwc->chan.device); | ||
2781 | |||
2782 | - if (test_bit(DW_DMA_IS_INITIALIZED, &dwc->flags)) | ||
2783 | - return; | ||
2784 | - | ||
2785 | dw->initialize_chan(dwc); | ||
2786 | |||
2787 | /* Enable interrupts */ | ||
2788 | channel_set_bit(dw, MASK.XFER, dwc->mask); | ||
2789 | channel_set_bit(dw, MASK.ERROR, dwc->mask); | ||
2790 | - | ||
2791 | - set_bit(DW_DMA_IS_INITIALIZED, &dwc->flags); | ||
2792 | } | ||
2793 | |||
2794 | /*----------------------------------------------------------------------*/ | ||
2795 | @@ -954,8 +949,6 @@ static void dwc_issue_pending(struct dma_chan *chan) | ||
2796 | |||
2797 | void do_dw_dma_off(struct dw_dma *dw) | ||
2798 | { | ||
2799 | - unsigned int i; | ||
2800 | - | ||
2801 | dma_writel(dw, CFG, 0); | ||
2802 | |||
2803 | channel_clear_bit(dw, MASK.XFER, dw->all_chan_mask); | ||
2804 | @@ -966,9 +959,6 @@ void do_dw_dma_off(struct dw_dma *dw) | ||
2805 | |||
2806 | while (dma_readl(dw, CFG) & DW_CFG_DMA_EN) | ||
2807 | cpu_relax(); | ||
2808 | - | ||
2809 | - for (i = 0; i < dw->dma.chancnt; i++) | ||
2810 | - clear_bit(DW_DMA_IS_INITIALIZED, &dw->chan[i].flags); | ||
2811 | } | ||
2812 | |||
2813 | void do_dw_dma_on(struct dw_dma *dw) | ||
2814 | @@ -1032,8 +1022,6 @@ static void dwc_free_chan_resources(struct dma_chan *chan) | ||
2815 | /* Clear custom channel configuration */ | ||
2816 | memset(&dwc->dws, 0, sizeof(struct dw_dma_slave)); | ||
2817 | |||
2818 | - clear_bit(DW_DMA_IS_INITIALIZED, &dwc->flags); | ||
2819 | - | ||
2820 | /* Disable interrupts */ | ||
2821 | channel_clear_bit(dw, MASK.XFER, dwc->mask); | ||
2822 | channel_clear_bit(dw, MASK.BLOCK, dwc->mask); | ||
2823 | diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h | ||
2824 | index 5eaa2902ed39..6ff7063a8a2f 100644 | ||
2825 | --- a/drivers/dma/fsl-edma-common.h | ||
2826 | +++ b/drivers/dma/fsl-edma-common.h | ||
2827 | @@ -33,7 +33,7 @@ | ||
2828 | #define EDMA_TCD_ATTR_DSIZE_16BIT BIT(0) | ||
2829 | #define EDMA_TCD_ATTR_DSIZE_32BIT BIT(1) | ||
2830 | #define EDMA_TCD_ATTR_DSIZE_64BIT (BIT(0) | BIT(1)) | ||
2831 | -#define EDMA_TCD_ATTR_DSIZE_32BYTE (BIT(3) | BIT(0)) | ||
2832 | +#define EDMA_TCD_ATTR_DSIZE_32BYTE (BIT(2) | BIT(0)) | ||
2833 | #define EDMA_TCD_ATTR_SSIZE_8BIT 0 | ||
2834 | #define EDMA_TCD_ATTR_SSIZE_16BIT (EDMA_TCD_ATTR_DSIZE_16BIT << 8) | ||
2835 | #define EDMA_TCD_ATTR_SSIZE_32BIT (EDMA_TCD_ATTR_DSIZE_32BIT << 8) | ||
2836 | diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c | ||
2837 | index b626c06ac2e0..6760ae4b2956 100644 | ||
2838 | --- a/drivers/dma/fsl-edma.c | ||
2839 | +++ b/drivers/dma/fsl-edma.c | ||
2840 | @@ -45,6 +45,13 @@ static irqreturn_t fsl_edma_tx_handler(int irq, void *dev_id) | ||
2841 | fsl_chan = &fsl_edma->chans[ch]; | ||
2842 | |||
2843 | spin_lock(&fsl_chan->vchan.lock); | ||
2844 | + | ||
2845 | + if (!fsl_chan->edesc) { | ||
2846 | + /* terminate_all called before */ | ||
2847 | + spin_unlock(&fsl_chan->vchan.lock); | ||
2848 | + continue; | ||
2849 | + } | ||
2850 | + | ||
2851 | if (!fsl_chan->edesc->iscyclic) { | ||
2852 | list_del(&fsl_chan->edesc->vdesc.node); | ||
2853 | vchan_cookie_complete(&fsl_chan->edesc->vdesc); | ||
2854 | diff --git a/drivers/dma/mcf-edma.c b/drivers/dma/mcf-edma.c | ||
2855 | index e15bd15a9ef6..e12b754e6398 100644 | ||
2856 | --- a/drivers/dma/mcf-edma.c | ||
2857 | +++ b/drivers/dma/mcf-edma.c | ||
2858 | @@ -35,6 +35,13 @@ static irqreturn_t mcf_edma_tx_handler(int irq, void *dev_id) | ||
2859 | mcf_chan = &mcf_edma->chans[ch]; | ||
2860 | |||
2861 | spin_lock(&mcf_chan->vchan.lock); | ||
2862 | + | ||
2863 | + if (!mcf_chan->edesc) { | ||
2864 | + /* terminate_all called before */ | ||
2865 | + spin_unlock(&mcf_chan->vchan.lock); | ||
2866 | + continue; | ||
2867 | + } | ||
2868 | + | ||
2869 | if (!mcf_chan->edesc->iscyclic) { | ||
2870 | list_del(&mcf_chan->edesc->vdesc.node); | ||
2871 | vchan_cookie_complete(&mcf_chan->edesc->vdesc); | ||
2872 | diff --git a/drivers/dma/sh/usb-dmac.c b/drivers/dma/sh/usb-dmac.c | ||
2873 | index b218a013c260..8f7ceb698226 100644 | ||
2874 | --- a/drivers/dma/sh/usb-dmac.c | ||
2875 | +++ b/drivers/dma/sh/usb-dmac.c | ||
2876 | @@ -586,6 +586,8 @@ static void usb_dmac_isr_transfer_end(struct usb_dmac_chan *chan) | ||
2877 | desc->residue = usb_dmac_get_current_residue(chan, desc, | ||
2878 | desc->sg_index - 1); | ||
2879 | desc->done_cookie = desc->vd.tx.cookie; | ||
2880 | + desc->vd.tx_result.result = DMA_TRANS_NOERROR; | ||
2881 | + desc->vd.tx_result.residue = desc->residue; | ||
2882 | vchan_cookie_complete(&desc->vd); | ||
2883 | |||
2884 | /* Restart the next transfer if this driver has a next desc */ | ||
2885 | diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c | ||
2886 | index 81f5103dccb6..9a24dce3c262 100644 | ||
2887 | --- a/drivers/gpio/gpio-pca953x.c | ||
2888 | +++ b/drivers/gpio/gpio-pca953x.c | ||
2889 | @@ -398,6 +398,7 @@ static const struct regmap_config pca953x_ai_i2c_regmap = { | ||
2890 | .writeable_reg = pca953x_writeable_register, | ||
2891 | .volatile_reg = pca953x_volatile_register, | ||
2892 | |||
2893 | + .disable_locking = true, | ||
2894 | .cache_type = REGCACHE_RBTREE, | ||
2895 | .max_register = 0x7f, | ||
2896 | }; | ||
2897 | diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | ||
2898 | index 23fc16dc92b4..465351184bc3 100644 | ||
2899 | --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | ||
2900 | +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | ||
2901 | @@ -286,30 +286,20 @@ static uint64_t sdma_v5_0_ring_get_rptr(struct amdgpu_ring *ring) | ||
2902 | static uint64_t sdma_v5_0_ring_get_wptr(struct amdgpu_ring *ring) | ||
2903 | { | ||
2904 | struct amdgpu_device *adev = ring->adev; | ||
2905 | - u64 *wptr = NULL; | ||
2906 | - uint64_t local_wptr = 0; | ||
2907 | + u64 wptr; | ||
2908 | |||
2909 | if (ring->use_doorbell) { | ||
2910 | /* XXX check if swapping is necessary on BE */ | ||
2911 | - wptr = ((u64 *)&adev->wb.wb[ring->wptr_offs]); | ||
2912 | - DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", *wptr); | ||
2913 | - *wptr = (*wptr) >> 2; | ||
2914 | - DRM_DEBUG("wptr/doorbell after shift == 0x%016llx\n", *wptr); | ||
2915 | + wptr = READ_ONCE(*((u64 *)&adev->wb.wb[ring->wptr_offs])); | ||
2916 | + DRM_DEBUG("wptr/doorbell before shift == 0x%016llx\n", wptr); | ||
2917 | } else { | ||
2918 | - u32 lowbit, highbit; | ||
2919 | - | ||
2920 | - wptr = &local_wptr; | ||
2921 | - lowbit = RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR)) >> 2; | ||
2922 | - highbit = RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR_HI)) >> 2; | ||
2923 | - | ||
2924 | - DRM_DEBUG("wptr [%i]high== 0x%08x low==0x%08x\n", | ||
2925 | - ring->me, highbit, lowbit); | ||
2926 | - *wptr = highbit; | ||
2927 | - *wptr = (*wptr) << 32; | ||
2928 | - *wptr |= lowbit; | ||
2929 | + wptr = RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR_HI)); | ||
2930 | + wptr = wptr << 32; | ||
2931 | + wptr |= RREG32(sdma_v5_0_get_reg_offset(adev, ring->me, mmSDMA0_GFX_RB_WPTR)); | ||
2932 | + DRM_DEBUG("wptr before shift [%i] wptr == 0x%016llx\n", ring->me, wptr); | ||
2933 | } | ||
2934 | |||
2935 | - return *wptr; | ||
2936 | + return wptr >> 2; | ||
2937 | } | ||
2938 | |||
2939 | /** | ||
2940 | diff --git a/drivers/gpu/drm/exynos/exynos_drm_dma.c b/drivers/gpu/drm/exynos/exynos_drm_dma.c | ||
2941 | index 619f81435c1b..58b89ec11b0e 100644 | ||
2942 | --- a/drivers/gpu/drm/exynos/exynos_drm_dma.c | ||
2943 | +++ b/drivers/gpu/drm/exynos/exynos_drm_dma.c | ||
2944 | @@ -61,7 +61,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev, | ||
2945 | struct device *subdrv_dev, void **dma_priv) | ||
2946 | { | ||
2947 | struct exynos_drm_private *priv = drm_dev->dev_private; | ||
2948 | - int ret; | ||
2949 | + int ret = 0; | ||
2950 | |||
2951 | if (get_dma_ops(priv->dma_dev) != get_dma_ops(subdrv_dev)) { | ||
2952 | DRM_DEV_ERROR(subdrv_dev, "Device %s lacks support for IOMMU\n", | ||
2953 | @@ -92,7 +92,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev, | ||
2954 | if (ret) | ||
2955 | clear_dma_max_seg_size(subdrv_dev); | ||
2956 | |||
2957 | - return 0; | ||
2958 | + return ret; | ||
2959 | } | ||
2960 | |||
2961 | /* | ||
2962 | diff --git a/drivers/gpu/drm/exynos/exynos_drm_mic.c b/drivers/gpu/drm/exynos/exynos_drm_mic.c | ||
2963 | index b78e8c5ba553..2aff986add89 100644 | ||
2964 | --- a/drivers/gpu/drm/exynos/exynos_drm_mic.c | ||
2965 | +++ b/drivers/gpu/drm/exynos/exynos_drm_mic.c | ||
2966 | @@ -268,8 +268,10 @@ static void mic_pre_enable(struct drm_bridge *bridge) | ||
2967 | goto unlock; | ||
2968 | |||
2969 | ret = pm_runtime_get_sync(mic->dev); | ||
2970 | - if (ret < 0) | ||
2971 | + if (ret < 0) { | ||
2972 | + pm_runtime_put_noidle(mic->dev); | ||
2973 | goto unlock; | ||
2974 | + } | ||
2975 | |||
2976 | mic_set_path(mic, 1); | ||
2977 | |||
2978 | diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c | ||
2979 | index 66f6d1a897f2..c169f0f70f3a 100644 | ||
2980 | --- a/drivers/gpu/drm/i915/gt/intel_lrc.c | ||
2981 | +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c | ||
2982 | @@ -3751,6 +3751,7 @@ intel_execlists_create_virtual(struct i915_gem_context *ctx, | ||
2983 | intel_engine_init_active(&ve->base, ENGINE_VIRTUAL); | ||
2984 | |||
2985 | intel_engine_init_execlists(&ve->base); | ||
2986 | + ve->base.breadcrumbs.irq_armed = true; /* fake HW, used for irq_work */ | ||
2987 | |||
2988 | ve->base.cops = &virtual_context_ops; | ||
2989 | ve->base.request_alloc = execlists_request_alloc; | ||
2990 | diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c | ||
2991 | index 25f78196b964..689b07bc91c4 100644 | ||
2992 | --- a/drivers/gpu/drm/i915/gvt/handlers.c | ||
2993 | +++ b/drivers/gpu/drm/i915/gvt/handlers.c | ||
2994 | @@ -3103,8 +3103,8 @@ static int init_skl_mmio_info(struct intel_gvt *gvt) | ||
2995 | MMIO_DFH(GEN9_WM_CHICKEN3, D_SKL_PLUS, F_MODE_MASK | F_CMD_ACCESS, | ||
2996 | NULL, NULL); | ||
2997 | |||
2998 | - MMIO_D(GAMT_CHKN_BIT_REG, D_KBL); | ||
2999 | - MMIO_D(GEN9_CTX_PREEMPT_REG, D_KBL | D_SKL); | ||
3000 | + MMIO_D(GAMT_CHKN_BIT_REG, D_KBL | D_CFL); | ||
3001 | + MMIO_D(GEN9_CTX_PREEMPT_REG, D_SKL_PLUS); | ||
3002 | |||
3003 | return 0; | ||
3004 | } | ||
3005 | diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | ||
3006 | index edf7989d7a8e..99d449ce4a07 100644 | ||
3007 | --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | ||
3008 | +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | ||
3009 | @@ -2185,7 +2185,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, | ||
3010 | |||
3011 | dpu_enc = to_dpu_encoder_virt(enc); | ||
3012 | |||
3013 | - mutex_init(&dpu_enc->enc_lock); | ||
3014 | ret = dpu_encoder_setup_display(dpu_enc, dpu_kms, disp_info); | ||
3015 | if (ret) | ||
3016 | goto fail; | ||
3017 | @@ -2200,7 +2199,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, | ||
3018 | 0); | ||
3019 | |||
3020 | |||
3021 | - mutex_init(&dpu_enc->rc_lock); | ||
3022 | INIT_DELAYED_WORK(&dpu_enc->delayed_off_work, | ||
3023 | dpu_encoder_off_work); | ||
3024 | dpu_enc->idle_timeout = IDLE_TIMEOUT; | ||
3025 | @@ -2245,6 +2243,8 @@ struct drm_encoder *dpu_encoder_init(struct drm_device *dev, | ||
3026 | |||
3027 | spin_lock_init(&dpu_enc->enc_spinlock); | ||
3028 | dpu_enc->enabled = false; | ||
3029 | + mutex_init(&dpu_enc->enc_lock); | ||
3030 | + mutex_init(&dpu_enc->rc_lock); | ||
3031 | |||
3032 | return &dpu_enc->base; | ||
3033 | } | ||
3034 | diff --git a/drivers/gpu/drm/msm/msm_submitqueue.c b/drivers/gpu/drm/msm/msm_submitqueue.c | ||
3035 | index 001fbf537440..a1d94be7883a 100644 | ||
3036 | --- a/drivers/gpu/drm/msm/msm_submitqueue.c | ||
3037 | +++ b/drivers/gpu/drm/msm/msm_submitqueue.c | ||
3038 | @@ -71,8 +71,10 @@ int msm_submitqueue_create(struct drm_device *drm, struct msm_file_private *ctx, | ||
3039 | queue->flags = flags; | ||
3040 | |||
3041 | if (priv->gpu) { | ||
3042 | - if (prio >= priv->gpu->nr_rings) | ||
3043 | + if (prio >= priv->gpu->nr_rings) { | ||
3044 | + kfree(queue); | ||
3045 | return -EINVAL; | ||
3046 | + } | ||
3047 | |||
3048 | queue->prio = prio; | ||
3049 | } | ||
3050 | diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c | ||
3051 | index 27c80c9e2b83..0f7eafedfe8f 100644 | ||
3052 | --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c | ||
3053 | +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c | ||
3054 | @@ -1504,6 +1504,8 @@ const struct of_device_id sun4i_tcon_of_table[] = { | ||
3055 | { .compatible = "allwinner,sun6i-a31-tcon", .data = &sun6i_a31_quirks }, | ||
3056 | { .compatible = "allwinner,sun6i-a31s-tcon", .data = &sun6i_a31s_quirks }, | ||
3057 | { .compatible = "allwinner,sun7i-a20-tcon", .data = &sun7i_a20_quirks }, | ||
3058 | + { .compatible = "allwinner,sun7i-a20-tcon0", .data = &sun7i_a20_quirks }, | ||
3059 | + { .compatible = "allwinner,sun7i-a20-tcon1", .data = &sun7i_a20_quirks }, | ||
3060 | { .compatible = "allwinner,sun8i-a23-tcon", .data = &sun8i_a33_quirks }, | ||
3061 | { .compatible = "allwinner,sun8i-a33-tcon", .data = &sun8i_a33_quirks }, | ||
3062 | { .compatible = "allwinner,sun8i-a83t-tcon-lcd", .data = &sun8i_a83t_lcd_quirks }, | ||
3063 | diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h | ||
3064 | index c552a6bc627e..73e4590ea9c9 100644 | ||
3065 | --- a/drivers/hid/hid-ids.h | ||
3066 | +++ b/drivers/hid/hid-ids.h | ||
3067 | @@ -620,6 +620,7 @@ | ||
3068 | #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081 0xa081 | ||
3069 | #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2 0xa0c2 | ||
3070 | #define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096 0xa096 | ||
3071 | +#define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A293 0xa293 | ||
3072 | |||
3073 | #define USB_VENDOR_ID_IMATION 0x0718 | ||
3074 | #define USB_DEVICE_ID_DISC_STAKKA 0xd000 | ||
3075 | @@ -995,6 +996,8 @@ | ||
3076 | #define USB_DEVICE_ID_ROCCAT_RYOS_MK_PRO 0x3232 | ||
3077 | #define USB_DEVICE_ID_ROCCAT_SAVU 0x2d5a | ||
3078 | |||
3079 | +#define USB_VENDOR_ID_SAI 0x17dd | ||
3080 | + | ||
3081 | #define USB_VENDOR_ID_SAITEK 0x06a3 | ||
3082 | #define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17 | ||
3083 | #define USB_DEVICE_ID_SAITEK_PS1000 0x0621 | ||
3084 | diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c | ||
3085 | index cd9193078525..60cf80606282 100644 | ||
3086 | --- a/drivers/hid/hid-logitech-hidpp.c | ||
3087 | +++ b/drivers/hid/hid-logitech-hidpp.c | ||
3088 | @@ -2964,7 +2964,7 @@ static int hi_res_scroll_enable(struct hidpp_device *hidpp) | ||
3089 | multiplier = 1; | ||
3090 | |||
3091 | hidpp->vertical_wheel_counter.wheel_multiplier = multiplier; | ||
3092 | - hid_info(hidpp->hid_dev, "multiplier = %d\n", multiplier); | ||
3093 | + hid_dbg(hidpp->hid_dev, "wheel multiplier = %d\n", multiplier); | ||
3094 | return 0; | ||
3095 | } | ||
3096 | |||
3097 | diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c | ||
3098 | index 34138667f8af..abd86903875f 100644 | ||
3099 | --- a/drivers/hid/hid-magicmouse.c | ||
3100 | +++ b/drivers/hid/hid-magicmouse.c | ||
3101 | @@ -535,6 +535,12 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd | ||
3102 | __set_bit(MSC_RAW, input->mscbit); | ||
3103 | } | ||
3104 | |||
3105 | + /* | ||
3106 | + * hid-input may mark device as using autorepeat, but neither | ||
3107 | + * the trackpad, nor the mouse actually want it. | ||
3108 | + */ | ||
3109 | + __clear_bit(EV_REP, input->evbit); | ||
3110 | + | ||
3111 | return 0; | ||
3112 | } | ||
3113 | |||
3114 | diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c | ||
3115 | index 168fdaa1999f..a49fa2b047cb 100644 | ||
3116 | --- a/drivers/hid/hid-quirks.c | ||
3117 | +++ b/drivers/hid/hid-quirks.c | ||
3118 | @@ -88,6 +88,7 @@ static const struct hid_device_id hid_quirks[] = { | ||
3119 | { HID_USB_DEVICE(USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING), HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | ||
3120 | { HID_USB_DEVICE(USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING), HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | ||
3121 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096), HID_QUIRK_NO_INIT_REPORTS }, | ||
3122 | + { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A293), HID_QUIRK_ALWAYS_POLL }, | ||
3123 | { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0A4A), HID_QUIRK_ALWAYS_POLL }, | ||
3124 | { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A), HID_QUIRK_ALWAYS_POLL }, | ||
3125 | { HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL }, | ||
3126 | @@ -400,9 +401,6 @@ static const struct hid_device_id hid_have_special_driver[] = { | ||
3127 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) }, | ||
3128 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) }, | ||
3129 | #endif | ||
3130 | -#if IS_ENABLED(CONFIG_HID_ITE) | ||
3131 | - { HID_USB_DEVICE(USB_VENDOR_ID_ITE, USB_DEVICE_ID_ITE8595) }, | ||
3132 | -#endif | ||
3133 | #if IS_ENABLED(CONFIG_HID_ICADE) | ||
3134 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, | ||
3135 | #endif | ||
3136 | @@ -842,6 +840,7 @@ static const struct hid_device_id hid_ignore_list[] = { | ||
3137 | { HID_USB_DEVICE(USB_VENDOR_ID_PETZL, USB_DEVICE_ID_PETZL_HEADLAMP) }, | ||
3138 | { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE) }, | ||
3139 | { HID_USB_DEVICE(USB_VENDOR_ID_POWERCOM, USB_DEVICE_ID_POWERCOM_UPS) }, | ||
3140 | + { HID_USB_DEVICE(USB_VENDOR_ID_SAI, USB_DEVICE_ID_CYPRESS_HIDCOM) }, | ||
3141 | #if IS_ENABLED(CONFIG_MOUSE_SYNAPTICS_USB) | ||
3142 | { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_TP) }, | ||
3143 | { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_INT_TP) }, | ||
3144 | diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c | ||
3145 | index 491a570e8e50..924c02c1631d 100644 | ||
3146 | --- a/drivers/hwmon/emc2103.c | ||
3147 | +++ b/drivers/hwmon/emc2103.c | ||
3148 | @@ -443,7 +443,7 @@ static ssize_t pwm1_enable_store(struct device *dev, | ||
3149 | } | ||
3150 | |||
3151 | result = read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg); | ||
3152 | - if (result) { | ||
3153 | + if (result < 0) { | ||
3154 | count = result; | ||
3155 | goto err; | ||
3156 | } | ||
3157 | diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c | ||
3158 | index ca232ec565e8..c9ac3dc65113 100644 | ||
3159 | --- a/drivers/hwtracing/intel_th/core.c | ||
3160 | +++ b/drivers/hwtracing/intel_th/core.c | ||
3161 | @@ -1021,15 +1021,30 @@ int intel_th_set_output(struct intel_th_device *thdev, | ||
3162 | { | ||
3163 | struct intel_th_device *hub = to_intel_th_hub(thdev); | ||
3164 | struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver); | ||
3165 | + int ret; | ||
3166 | |||
3167 | /* In host mode, this is up to the external debugger, do nothing. */ | ||
3168 | if (hub->host_mode) | ||
3169 | return 0; | ||
3170 | |||
3171 | - if (!hubdrv->set_output) | ||
3172 | - return -ENOTSUPP; | ||
3173 | + /* | ||
3174 | + * hub is instantiated together with the source device that | ||
3175 | + * calls here, so guaranteed to be present. | ||
3176 | + */ | ||
3177 | + hubdrv = to_intel_th_driver(hub->dev.driver); | ||
3178 | + if (!hubdrv || !try_module_get(hubdrv->driver.owner)) | ||
3179 | + return -EINVAL; | ||
3180 | + | ||
3181 | + if (!hubdrv->set_output) { | ||
3182 | + ret = -ENOTSUPP; | ||
3183 | + goto out; | ||
3184 | + } | ||
3185 | + | ||
3186 | + ret = hubdrv->set_output(hub, master); | ||
3187 | |||
3188 | - return hubdrv->set_output(hub, master); | ||
3189 | +out: | ||
3190 | + module_put(hubdrv->driver.owner); | ||
3191 | + return ret; | ||
3192 | } | ||
3193 | EXPORT_SYMBOL_GPL(intel_th_set_output); | ||
3194 | |||
3195 | diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c | ||
3196 | index 86aa6a46bcba..0d26484d6795 100644 | ||
3197 | --- a/drivers/hwtracing/intel_th/pci.c | ||
3198 | +++ b/drivers/hwtracing/intel_th/pci.c | ||
3199 | @@ -229,11 +229,21 @@ static const struct pci_device_id intel_th_pci_id_table[] = { | ||
3200 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa0a6), | ||
3201 | .driver_data = (kernel_ulong_t)&intel_th_2x, | ||
3202 | }, | ||
3203 | + { | ||
3204 | + /* Tiger Lake PCH-H */ | ||
3205 | + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x43a6), | ||
3206 | + .driver_data = (kernel_ulong_t)&intel_th_2x, | ||
3207 | + }, | ||
3208 | { | ||
3209 | /* Jasper Lake PCH */ | ||
3210 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4da6), | ||
3211 | .driver_data = (kernel_ulong_t)&intel_th_2x, | ||
3212 | }, | ||
3213 | + { | ||
3214 | + /* Jasper Lake CPU */ | ||
3215 | + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4e29), | ||
3216 | + .driver_data = (kernel_ulong_t)&intel_th_2x, | ||
3217 | + }, | ||
3218 | { | ||
3219 | /* Elkhart Lake CPU */ | ||
3220 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4529), | ||
3221 | @@ -244,6 +254,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = { | ||
3222 | PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4b26), | ||
3223 | .driver_data = (kernel_ulong_t)&intel_th_2x, | ||
3224 | }, | ||
3225 | + { | ||
3226 | + /* Emmitsburg PCH */ | ||
3227 | + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x1bcc), | ||
3228 | + .driver_data = (kernel_ulong_t)&intel_th_2x, | ||
3229 | + }, | ||
3230 | { 0 }, | ||
3231 | }; | ||
3232 | |||
3233 | diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c | ||
3234 | index 3a1f4e650378..a1529f571491 100644 | ||
3235 | --- a/drivers/hwtracing/intel_th/sth.c | ||
3236 | +++ b/drivers/hwtracing/intel_th/sth.c | ||
3237 | @@ -161,9 +161,7 @@ static int sth_stm_link(struct stm_data *stm_data, unsigned int master, | ||
3238 | { | ||
3239 | struct sth_device *sth = container_of(stm_data, struct sth_device, stm); | ||
3240 | |||
3241 | - intel_th_set_output(to_intel_th_device(sth->dev), master); | ||
3242 | - | ||
3243 | - return 0; | ||
3244 | + return intel_th_set_output(to_intel_th_device(sth->dev), master); | ||
3245 | } | ||
3246 | |||
3247 | static int intel_th_sw_init(struct sth_device *sth) | ||
3248 | diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c | ||
3249 | index bb810dee8fb5..73f139690e4e 100644 | ||
3250 | --- a/drivers/i2c/busses/i2c-eg20t.c | ||
3251 | +++ b/drivers/i2c/busses/i2c-eg20t.c | ||
3252 | @@ -180,6 +180,7 @@ static const struct pci_device_id pch_pcidev_id[] = { | ||
3253 | { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_I2C), 1, }, | ||
3254 | {0,} | ||
3255 | }; | ||
3256 | +MODULE_DEVICE_TABLE(pci, pch_pcidev_id); | ||
3257 | |||
3258 | static irqreturn_t pch_i2c_handler(int irq, void *pData); | ||
3259 | |||
3260 | diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c | ||
3261 | index 00e100fc845a..813bca7cfc3e 100644 | ||
3262 | --- a/drivers/iio/accel/mma8452.c | ||
3263 | +++ b/drivers/iio/accel/mma8452.c | ||
3264 | @@ -1685,10 +1685,13 @@ static int mma8452_probe(struct i2c_client *client, | ||
3265 | |||
3266 | ret = mma8452_set_freefall_mode(data, false); | ||
3267 | if (ret < 0) | ||
3268 | - goto buffer_cleanup; | ||
3269 | + goto unregister_device; | ||
3270 | |||
3271 | return 0; | ||
3272 | |||
3273 | +unregister_device: | ||
3274 | + iio_device_unregister(indio_dev); | ||
3275 | + | ||
3276 | buffer_cleanup: | ||
3277 | iio_triggered_buffer_cleanup(indio_dev); | ||
3278 | |||
3279 | diff --git a/drivers/iio/adc/ad7780.c b/drivers/iio/adc/ad7780.c | ||
3280 | index 217a5a5c3c6d..7e741294de7b 100644 | ||
3281 | --- a/drivers/iio/adc/ad7780.c | ||
3282 | +++ b/drivers/iio/adc/ad7780.c | ||
3283 | @@ -309,7 +309,7 @@ static int ad7780_probe(struct spi_device *spi) | ||
3284 | |||
3285 | ret = ad7780_init_gpios(&spi->dev, st); | ||
3286 | if (ret) | ||
3287 | - goto error_cleanup_buffer_and_trigger; | ||
3288 | + return ret; | ||
3289 | |||
3290 | st->reg = devm_regulator_get(&spi->dev, "avdd"); | ||
3291 | if (IS_ERR(st->reg)) | ||
3292 | diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c | ||
3293 | index dc22dc363a99..29104656a537 100644 | ||
3294 | --- a/drivers/iio/health/afe4403.c | ||
3295 | +++ b/drivers/iio/health/afe4403.c | ||
3296 | @@ -63,6 +63,7 @@ static const struct reg_field afe4403_reg_fields[] = { | ||
3297 | * @regulator: Pointer to the regulator for the IC | ||
3298 | * @trig: IIO trigger for this device | ||
3299 | * @irq: ADC_RDY line interrupt number | ||
3300 | + * @buffer: Used to construct data layout to push into IIO buffer. | ||
3301 | */ | ||
3302 | struct afe4403_data { | ||
3303 | struct device *dev; | ||
3304 | @@ -72,6 +73,8 @@ struct afe4403_data { | ||
3305 | struct regulator *regulator; | ||
3306 | struct iio_trigger *trig; | ||
3307 | int irq; | ||
3308 | + /* Ensure suitable alignment for timestamp */ | ||
3309 | + s32 buffer[8] __aligned(8); | ||
3310 | }; | ||
3311 | |||
3312 | enum afe4403_chan_id { | ||
3313 | @@ -309,7 +312,6 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private) | ||
3314 | struct iio_dev *indio_dev = pf->indio_dev; | ||
3315 | struct afe4403_data *afe = iio_priv(indio_dev); | ||
3316 | int ret, bit, i = 0; | ||
3317 | - s32 buffer[8]; | ||
3318 | u8 tx[4] = {AFE440X_CONTROL0, 0x0, 0x0, AFE440X_CONTROL0_READ}; | ||
3319 | u8 rx[3]; | ||
3320 | |||
3321 | @@ -326,9 +328,9 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private) | ||
3322 | if (ret) | ||
3323 | goto err; | ||
3324 | |||
3325 | - buffer[i++] = (rx[0] << 16) | | ||
3326 | - (rx[1] << 8) | | ||
3327 | - (rx[2]); | ||
3328 | + afe->buffer[i++] = (rx[0] << 16) | | ||
3329 | + (rx[1] << 8) | | ||
3330 | + (rx[2]); | ||
3331 | } | ||
3332 | |||
3333 | /* Disable reading from the device */ | ||
3334 | @@ -337,7 +339,8 @@ static irqreturn_t afe4403_trigger_handler(int irq, void *private) | ||
3335 | if (ret) | ||
3336 | goto err; | ||
3337 | |||
3338 | - iio_push_to_buffers_with_timestamp(indio_dev, buffer, pf->timestamp); | ||
3339 | + iio_push_to_buffers_with_timestamp(indio_dev, afe->buffer, | ||
3340 | + pf->timestamp); | ||
3341 | err: | ||
3342 | iio_trigger_notify_done(indio_dev->trig); | ||
3343 | |||
3344 | diff --git a/drivers/iio/health/afe4404.c b/drivers/iio/health/afe4404.c | ||
3345 | index e728bbb21ca8..cebb1fd4d0b1 100644 | ||
3346 | --- a/drivers/iio/health/afe4404.c | ||
3347 | +++ b/drivers/iio/health/afe4404.c | ||
3348 | @@ -83,6 +83,7 @@ static const struct reg_field afe4404_reg_fields[] = { | ||
3349 | * @regulator: Pointer to the regulator for the IC | ||
3350 | * @trig: IIO trigger for this device | ||
3351 | * @irq: ADC_RDY line interrupt number | ||
3352 | + * @buffer: Used to construct a scan to push to the iio buffer. | ||
3353 | */ | ||
3354 | struct afe4404_data { | ||
3355 | struct device *dev; | ||
3356 | @@ -91,6 +92,7 @@ struct afe4404_data { | ||
3357 | struct regulator *regulator; | ||
3358 | struct iio_trigger *trig; | ||
3359 | int irq; | ||
3360 | + s32 buffer[10] __aligned(8); | ||
3361 | }; | ||
3362 | |||
3363 | enum afe4404_chan_id { | ||
3364 | @@ -328,17 +330,17 @@ static irqreturn_t afe4404_trigger_handler(int irq, void *private) | ||
3365 | struct iio_dev *indio_dev = pf->indio_dev; | ||
3366 | struct afe4404_data *afe = iio_priv(indio_dev); | ||
3367 | int ret, bit, i = 0; | ||
3368 | - s32 buffer[10]; | ||
3369 | |||
3370 | for_each_set_bit(bit, indio_dev->active_scan_mask, | ||
3371 | indio_dev->masklength) { | ||
3372 | ret = regmap_read(afe->regmap, afe4404_channel_values[bit], | ||
3373 | - &buffer[i++]); | ||
3374 | + &afe->buffer[i++]); | ||
3375 | if (ret) | ||
3376 | goto err; | ||
3377 | } | ||
3378 | |||
3379 | - iio_push_to_buffers_with_timestamp(indio_dev, buffer, pf->timestamp); | ||
3380 | + iio_push_to_buffers_with_timestamp(indio_dev, afe->buffer, | ||
3381 | + pf->timestamp); | ||
3382 | err: | ||
3383 | iio_trigger_notify_done(indio_dev->trig); | ||
3384 | |||
3385 | diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c | ||
3386 | index dcf5a5bdfaa8..7618cdf59efd 100644 | ||
3387 | --- a/drivers/iio/humidity/hdc100x.c | ||
3388 | +++ b/drivers/iio/humidity/hdc100x.c | ||
3389 | @@ -38,6 +38,11 @@ struct hdc100x_data { | ||
3390 | |||
3391 | /* integration time of the sensor */ | ||
3392 | int adc_int_us[2]; | ||
3393 | + /* Ensure natural alignment of timestamp */ | ||
3394 | + struct { | ||
3395 | + __be16 channels[2]; | ||
3396 | + s64 ts __aligned(8); | ||
3397 | + } scan; | ||
3398 | }; | ||
3399 | |||
3400 | /* integration time in us */ | ||
3401 | @@ -319,7 +324,6 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p) | ||
3402 | struct i2c_client *client = data->client; | ||
3403 | int delay = data->adc_int_us[0] + data->adc_int_us[1]; | ||
3404 | int ret; | ||
3405 | - s16 buf[8]; /* 2x s16 + padding + 8 byte timestamp */ | ||
3406 | |||
3407 | /* dual read starts at temp register */ | ||
3408 | mutex_lock(&data->lock); | ||
3409 | @@ -330,13 +334,13 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p) | ||
3410 | } | ||
3411 | usleep_range(delay, delay + 1000); | ||
3412 | |||
3413 | - ret = i2c_master_recv(client, (u8 *)buf, 4); | ||
3414 | + ret = i2c_master_recv(client, (u8 *)data->scan.channels, 4); | ||
3415 | if (ret < 0) { | ||
3416 | dev_err(&client->dev, "cannot read sensor data\n"); | ||
3417 | goto err; | ||
3418 | } | ||
3419 | |||
3420 | - iio_push_to_buffers_with_timestamp(indio_dev, buf, | ||
3421 | + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, | ||
3422 | iio_get_time_ns(indio_dev)); | ||
3423 | err: | ||
3424 | mutex_unlock(&data->lock); | ||
3425 | diff --git a/drivers/iio/humidity/hts221.h b/drivers/iio/humidity/hts221.h | ||
3426 | index 7d6771f7cf47..b2eb5abeaccd 100644 | ||
3427 | --- a/drivers/iio/humidity/hts221.h | ||
3428 | +++ b/drivers/iio/humidity/hts221.h | ||
3429 | @@ -14,8 +14,6 @@ | ||
3430 | |||
3431 | #include <linux/iio/iio.h> | ||
3432 | |||
3433 | -#define HTS221_DATA_SIZE 2 | ||
3434 | - | ||
3435 | enum hts221_sensor_type { | ||
3436 | HTS221_SENSOR_H, | ||
3437 | HTS221_SENSOR_T, | ||
3438 | @@ -39,6 +37,11 @@ struct hts221_hw { | ||
3439 | |||
3440 | bool enabled; | ||
3441 | u8 odr; | ||
3442 | + /* Ensure natural alignment of timestamp */ | ||
3443 | + struct { | ||
3444 | + __le16 channels[2]; | ||
3445 | + s64 ts __aligned(8); | ||
3446 | + } scan; | ||
3447 | }; | ||
3448 | |||
3449 | extern const struct dev_pm_ops hts221_pm_ops; | ||
3450 | diff --git a/drivers/iio/humidity/hts221_buffer.c b/drivers/iio/humidity/hts221_buffer.c | ||
3451 | index 81d50a861c22..49dcd36d8838 100644 | ||
3452 | --- a/drivers/iio/humidity/hts221_buffer.c | ||
3453 | +++ b/drivers/iio/humidity/hts221_buffer.c | ||
3454 | @@ -162,7 +162,6 @@ static const struct iio_buffer_setup_ops hts221_buffer_ops = { | ||
3455 | |||
3456 | static irqreturn_t hts221_buffer_handler_thread(int irq, void *p) | ||
3457 | { | ||
3458 | - u8 buffer[ALIGN(2 * HTS221_DATA_SIZE, sizeof(s64)) + sizeof(s64)]; | ||
3459 | struct iio_poll_func *pf = p; | ||
3460 | struct iio_dev *iio_dev = pf->indio_dev; | ||
3461 | struct hts221_hw *hw = iio_priv(iio_dev); | ||
3462 | @@ -172,18 +171,20 @@ static irqreturn_t hts221_buffer_handler_thread(int irq, void *p) | ||
3463 | /* humidity data */ | ||
3464 | ch = &iio_dev->channels[HTS221_SENSOR_H]; | ||
3465 | err = regmap_bulk_read(hw->regmap, ch->address, | ||
3466 | - buffer, HTS221_DATA_SIZE); | ||
3467 | + &hw->scan.channels[0], | ||
3468 | + sizeof(hw->scan.channels[0])); | ||
3469 | if (err < 0) | ||
3470 | goto out; | ||
3471 | |||
3472 | /* temperature data */ | ||
3473 | ch = &iio_dev->channels[HTS221_SENSOR_T]; | ||
3474 | err = regmap_bulk_read(hw->regmap, ch->address, | ||
3475 | - buffer + HTS221_DATA_SIZE, HTS221_DATA_SIZE); | ||
3476 | + &hw->scan.channels[1], | ||
3477 | + sizeof(hw->scan.channels[1])); | ||
3478 | if (err < 0) | ||
3479 | goto out; | ||
3480 | |||
3481 | - iio_push_to_buffers_with_timestamp(iio_dev, buffer, | ||
3482 | + iio_push_to_buffers_with_timestamp(iio_dev, &hw->scan, | ||
3483 | iio_get_time_ns(iio_dev)); | ||
3484 | |||
3485 | out: | ||
3486 | diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c | ||
3487 | index 524a686077ca..485b2e6748c5 100644 | ||
3488 | --- a/drivers/iio/industrialio-core.c | ||
3489 | +++ b/drivers/iio/industrialio-core.c | ||
3490 | @@ -130,6 +130,8 @@ static const char * const iio_modifier_names[] = { | ||
3491 | [IIO_MOD_PM2P5] = "pm2p5", | ||
3492 | [IIO_MOD_PM4] = "pm4", | ||
3493 | [IIO_MOD_PM10] = "pm10", | ||
3494 | + [IIO_MOD_ETHANOL] = "ethanol", | ||
3495 | + [IIO_MOD_H2] = "h2", | ||
3496 | }; | ||
3497 | |||
3498 | /* relies on pairs of these shared then separate */ | ||
3499 | diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c | ||
3500 | index d32996702110..87c15a63c1a4 100644 | ||
3501 | --- a/drivers/iio/magnetometer/ak8974.c | ||
3502 | +++ b/drivers/iio/magnetometer/ak8974.c | ||
3503 | @@ -185,6 +185,11 @@ struct ak8974 { | ||
3504 | bool drdy_irq; | ||
3505 | struct completion drdy_complete; | ||
3506 | bool drdy_active_low; | ||
3507 | + /* Ensure timestamp is naturally aligned */ | ||
3508 | + struct { | ||
3509 | + __le16 channels[3]; | ||
3510 | + s64 ts __aligned(8); | ||
3511 | + } scan; | ||
3512 | }; | ||
3513 | |||
3514 | static const char ak8974_reg_avdd[] = "avdd"; | ||
3515 | @@ -581,7 +586,6 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev) | ||
3516 | { | ||
3517 | struct ak8974 *ak8974 = iio_priv(indio_dev); | ||
3518 | int ret; | ||
3519 | - __le16 hw_values[8]; /* Three axes + 64bit padding */ | ||
3520 | |||
3521 | pm_runtime_get_sync(&ak8974->i2c->dev); | ||
3522 | mutex_lock(&ak8974->lock); | ||
3523 | @@ -591,13 +595,13 @@ static void ak8974_fill_buffer(struct iio_dev *indio_dev) | ||
3524 | dev_err(&ak8974->i2c->dev, "error triggering measure\n"); | ||
3525 | goto out_unlock; | ||
3526 | } | ||
3527 | - ret = ak8974_getresult(ak8974, hw_values); | ||
3528 | + ret = ak8974_getresult(ak8974, ak8974->scan.channels); | ||
3529 | if (ret) { | ||
3530 | dev_err(&ak8974->i2c->dev, "error getting measures\n"); | ||
3531 | goto out_unlock; | ||
3532 | } | ||
3533 | |||
3534 | - iio_push_to_buffers_with_timestamp(indio_dev, hw_values, | ||
3535 | + iio_push_to_buffers_with_timestamp(indio_dev, &ak8974->scan, | ||
3536 | iio_get_time_ns(indio_dev)); | ||
3537 | |||
3538 | out_unlock: | ||
3539 | @@ -764,19 +768,21 @@ static int ak8974_probe(struct i2c_client *i2c, | ||
3540 | ak8974->map = devm_regmap_init_i2c(i2c, &ak8974_regmap_config); | ||
3541 | if (IS_ERR(ak8974->map)) { | ||
3542 | dev_err(&i2c->dev, "failed to allocate register map\n"); | ||
3543 | + pm_runtime_put_noidle(&i2c->dev); | ||
3544 | + pm_runtime_disable(&i2c->dev); | ||
3545 | return PTR_ERR(ak8974->map); | ||
3546 | } | ||
3547 | |||
3548 | ret = ak8974_set_power(ak8974, AK8974_PWR_ON); | ||
3549 | if (ret) { | ||
3550 | dev_err(&i2c->dev, "could not power on\n"); | ||
3551 | - goto power_off; | ||
3552 | + goto disable_pm; | ||
3553 | } | ||
3554 | |||
3555 | ret = ak8974_detect(ak8974); | ||
3556 | if (ret) { | ||
3557 | dev_err(&i2c->dev, "neither AK8974 nor AMI30x found\n"); | ||
3558 | - goto power_off; | ||
3559 | + goto disable_pm; | ||
3560 | } | ||
3561 | |||
3562 | ret = ak8974_selftest(ak8974); | ||
3563 | @@ -786,14 +792,9 @@ static int ak8974_probe(struct i2c_client *i2c, | ||
3564 | ret = ak8974_reset(ak8974); | ||
3565 | if (ret) { | ||
3566 | dev_err(&i2c->dev, "AK8974 reset failed\n"); | ||
3567 | - goto power_off; | ||
3568 | + goto disable_pm; | ||
3569 | } | ||
3570 | |||
3571 | - pm_runtime_set_autosuspend_delay(&i2c->dev, | ||
3572 | - AK8974_AUTOSUSPEND_DELAY); | ||
3573 | - pm_runtime_use_autosuspend(&i2c->dev); | ||
3574 | - pm_runtime_put(&i2c->dev); | ||
3575 | - | ||
3576 | indio_dev->dev.parent = &i2c->dev; | ||
3577 | indio_dev->channels = ak8974_channels; | ||
3578 | indio_dev->num_channels = ARRAY_SIZE(ak8974_channels); | ||
3579 | @@ -846,6 +847,11 @@ no_irq: | ||
3580 | goto cleanup_buffer; | ||
3581 | } | ||
3582 | |||
3583 | + pm_runtime_set_autosuspend_delay(&i2c->dev, | ||
3584 | + AK8974_AUTOSUSPEND_DELAY); | ||
3585 | + pm_runtime_use_autosuspend(&i2c->dev); | ||
3586 | + pm_runtime_put(&i2c->dev); | ||
3587 | + | ||
3588 | return 0; | ||
3589 | |||
3590 | cleanup_buffer: | ||
3591 | @@ -854,7 +860,6 @@ disable_pm: | ||
3592 | pm_runtime_put_noidle(&i2c->dev); | ||
3593 | pm_runtime_disable(&i2c->dev); | ||
3594 | ak8974_set_power(ak8974, AK8974_PWR_OFF); | ||
3595 | -power_off: | ||
3596 | regulator_bulk_disable(ARRAY_SIZE(ak8974->regs), ak8974->regs); | ||
3597 | |||
3598 | return ret; | ||
3599 | diff --git a/drivers/iio/pressure/ms5611_core.c b/drivers/iio/pressure/ms5611_core.c | ||
3600 | index 2f598ad91621..f5db9fa086f3 100644 | ||
3601 | --- a/drivers/iio/pressure/ms5611_core.c | ||
3602 | +++ b/drivers/iio/pressure/ms5611_core.c | ||
3603 | @@ -212,16 +212,21 @@ static irqreturn_t ms5611_trigger_handler(int irq, void *p) | ||
3604 | struct iio_poll_func *pf = p; | ||
3605 | struct iio_dev *indio_dev = pf->indio_dev; | ||
3606 | struct ms5611_state *st = iio_priv(indio_dev); | ||
3607 | - s32 buf[4]; /* s32 (pressure) + s32 (temp) + 2 * s32 (timestamp) */ | ||
3608 | + /* Ensure buffer elements are naturally aligned */ | ||
3609 | + struct { | ||
3610 | + s32 channels[2]; | ||
3611 | + s64 ts __aligned(8); | ||
3612 | + } scan; | ||
3613 | int ret; | ||
3614 | |||
3615 | mutex_lock(&st->lock); | ||
3616 | - ret = ms5611_read_temp_and_pressure(indio_dev, &buf[1], &buf[0]); | ||
3617 | + ret = ms5611_read_temp_and_pressure(indio_dev, &scan.channels[1], | ||
3618 | + &scan.channels[0]); | ||
3619 | mutex_unlock(&st->lock); | ||
3620 | if (ret < 0) | ||
3621 | goto err; | ||
3622 | |||
3623 | - iio_push_to_buffers_with_timestamp(indio_dev, buf, | ||
3624 | + iio_push_to_buffers_with_timestamp(indio_dev, &scan, | ||
3625 | iio_get_time_ns(indio_dev)); | ||
3626 | |||
3627 | err: | ||
3628 | diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c | ||
3629 | index 9d0d07930236..7f2e5a8942a4 100644 | ||
3630 | --- a/drivers/iio/pressure/zpa2326.c | ||
3631 | +++ b/drivers/iio/pressure/zpa2326.c | ||
3632 | @@ -664,8 +664,10 @@ static int zpa2326_resume(const struct iio_dev *indio_dev) | ||
3633 | int err; | ||
3634 | |||
3635 | err = pm_runtime_get_sync(indio_dev->dev.parent); | ||
3636 | - if (err < 0) | ||
3637 | + if (err < 0) { | ||
3638 | + pm_runtime_put(indio_dev->dev.parent); | ||
3639 | return err; | ||
3640 | + } | ||
3641 | |||
3642 | if (err > 0) { | ||
3643 | /* | ||
3644 | diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c | ||
3645 | index 96edc5c30204..09e29c6cb66d 100644 | ||
3646 | --- a/drivers/infiniband/hw/mlx5/qp.c | ||
3647 | +++ b/drivers/infiniband/hw/mlx5/qp.c | ||
3648 | @@ -1463,6 +1463,8 @@ static int create_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, | ||
3649 | u16 uid = to_mpd(pd)->uid; | ||
3650 | u32 out[MLX5_ST_SZ_DW(create_tir_out)] = {}; | ||
3651 | |||
3652 | + if (!qp->sq.wqe_cnt && !qp->rq.wqe_cnt) | ||
3653 | + return -EINVAL; | ||
3654 | if (qp->sq.wqe_cnt) { | ||
3655 | err = create_raw_packet_qp_tis(dev, qp, sq, tdn, pd); | ||
3656 | if (err) | ||
3657 | diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h | ||
3658 | index 7e048b557462..858a26302198 100644 | ||
3659 | --- a/drivers/input/serio/i8042-x86ia64io.h | ||
3660 | +++ b/drivers/input/serio/i8042-x86ia64io.h | ||
3661 | @@ -425,6 +425,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { | ||
3662 | DMI_MATCH(DMI_PRODUCT_NAME, "076804U"), | ||
3663 | }, | ||
3664 | }, | ||
3665 | + { | ||
3666 | + /* Lenovo XiaoXin Air 12 */ | ||
3667 | + .matches = { | ||
3668 | + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
3669 | + DMI_MATCH(DMI_PRODUCT_NAME, "80UN"), | ||
3670 | + }, | ||
3671 | + }, | ||
3672 | { | ||
3673 | .matches = { | ||
3674 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
3675 | diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c | ||
3676 | index 0403102e807e..37b35ab97beb 100644 | ||
3677 | --- a/drivers/input/touchscreen/goodix.c | ||
3678 | +++ b/drivers/input/touchscreen/goodix.c | ||
3679 | @@ -168,6 +168,22 @@ static const struct dmi_system_id nine_bytes_report[] = { | ||
3680 | {} | ||
3681 | }; | ||
3682 | |||
3683 | +/* | ||
3684 | + * Those tablets have their x coordinate inverted | ||
3685 | + */ | ||
3686 | +static const struct dmi_system_id inverted_x_screen[] = { | ||
3687 | +#if defined(CONFIG_DMI) && defined(CONFIG_X86) | ||
3688 | + { | ||
3689 | + .ident = "Cube I15-TC", | ||
3690 | + .matches = { | ||
3691 | + DMI_MATCH(DMI_SYS_VENDOR, "Cube"), | ||
3692 | + DMI_MATCH(DMI_PRODUCT_NAME, "I15-TC") | ||
3693 | + }, | ||
3694 | + }, | ||
3695 | +#endif | ||
3696 | + {} | ||
3697 | +}; | ||
3698 | + | ||
3699 | /** | ||
3700 | * goodix_i2c_read - read data from a register of the i2c slave device. | ||
3701 | * | ||
3702 | @@ -780,6 +796,12 @@ static int goodix_configure_dev(struct goodix_ts_data *ts) | ||
3703 | "Non-standard 9-bytes report format quirk\n"); | ||
3704 | } | ||
3705 | |||
3706 | + if (dmi_check_system(inverted_x_screen)) { | ||
3707 | + ts->prop.invert_x = true; | ||
3708 | + dev_dbg(&ts->client->dev, | ||
3709 | + "Applying 'inverted x screen' quirk\n"); | ||
3710 | + } | ||
3711 | + | ||
3712 | error = input_mt_init_slots(ts->input_dev, ts->max_touch_num, | ||
3713 | INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED); | ||
3714 | if (error) { | ||
3715 | diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c | ||
3716 | index fca908ba4841..fb28fd2d6f1c 100644 | ||
3717 | --- a/drivers/input/touchscreen/mms114.c | ||
3718 | +++ b/drivers/input/touchscreen/mms114.c | ||
3719 | @@ -54,6 +54,7 @@ | ||
3720 | enum mms_type { | ||
3721 | TYPE_MMS114 = 114, | ||
3722 | TYPE_MMS152 = 152, | ||
3723 | + TYPE_MMS345L = 345, | ||
3724 | }; | ||
3725 | |||
3726 | struct mms114_data { | ||
3727 | @@ -250,6 +251,15 @@ static int mms114_get_version(struct mms114_data *data) | ||
3728 | int error; | ||
3729 | |||
3730 | switch (data->type) { | ||
3731 | + case TYPE_MMS345L: | ||
3732 | + error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf); | ||
3733 | + if (error) | ||
3734 | + return error; | ||
3735 | + | ||
3736 | + dev_info(dev, "TSP FW Rev: bootloader 0x%x / core 0x%x / config 0x%x\n", | ||
3737 | + buf[0], buf[1], buf[2]); | ||
3738 | + break; | ||
3739 | + | ||
3740 | case TYPE_MMS152: | ||
3741 | error = __mms114_read_reg(data, MMS152_FW_REV, 3, buf); | ||
3742 | if (error) | ||
3743 | @@ -287,8 +297,8 @@ static int mms114_setup_regs(struct mms114_data *data) | ||
3744 | if (error < 0) | ||
3745 | return error; | ||
3746 | |||
3747 | - /* MMS152 has no configuration or power on registers */ | ||
3748 | - if (data->type == TYPE_MMS152) | ||
3749 | + /* Only MMS114 has configuration and power on registers */ | ||
3750 | + if (data->type != TYPE_MMS114) | ||
3751 | return 0; | ||
3752 | |||
3753 | error = mms114_set_active(data, true); | ||
3754 | @@ -598,6 +608,9 @@ static const struct of_device_id mms114_dt_match[] = { | ||
3755 | }, { | ||
3756 | .compatible = "melfas,mms152", | ||
3757 | .data = (void *)TYPE_MMS152, | ||
3758 | + }, { | ||
3759 | + .compatible = "melfas,mms345l", | ||
3760 | + .data = (void *)TYPE_MMS345L, | ||
3761 | }, | ||
3762 | { } | ||
3763 | }; | ||
3764 | diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig | ||
3765 | index e3842eabcfdd..390568afee9f 100644 | ||
3766 | --- a/drivers/iommu/Kconfig | ||
3767 | +++ b/drivers/iommu/Kconfig | ||
3768 | @@ -205,7 +205,7 @@ config INTEL_IOMMU_DEBUGFS | ||
3769 | |||
3770 | config INTEL_IOMMU_SVM | ||
3771 | bool "Support for Shared Virtual Memory with Intel IOMMU" | ||
3772 | - depends on INTEL_IOMMU && X86 | ||
3773 | + depends on INTEL_IOMMU && X86_64 | ||
3774 | select PCI_PASID | ||
3775 | select MMU_NOTIFIER | ||
3776 | help | ||
3777 | diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c | ||
3778 | index ab4144ea1f11..d6cd5537126c 100644 | ||
3779 | --- a/drivers/misc/atmel-ssc.c | ||
3780 | +++ b/drivers/misc/atmel-ssc.c | ||
3781 | @@ -10,7 +10,7 @@ | ||
3782 | #include <linux/clk.h> | ||
3783 | #include <linux/err.h> | ||
3784 | #include <linux/io.h> | ||
3785 | -#include <linux/spinlock.h> | ||
3786 | +#include <linux/mutex.h> | ||
3787 | #include <linux/atmel-ssc.h> | ||
3788 | #include <linux/slab.h> | ||
3789 | #include <linux/module.h> | ||
3790 | @@ -20,7 +20,7 @@ | ||
3791 | #include "../../sound/soc/atmel/atmel_ssc_dai.h" | ||
3792 | |||
3793 | /* Serialize access to ssc_list and user count */ | ||
3794 | -static DEFINE_SPINLOCK(user_lock); | ||
3795 | +static DEFINE_MUTEX(user_lock); | ||
3796 | static LIST_HEAD(ssc_list); | ||
3797 | |||
3798 | struct ssc_device *ssc_request(unsigned int ssc_num) | ||
3799 | @@ -28,7 +28,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num) | ||
3800 | int ssc_valid = 0; | ||
3801 | struct ssc_device *ssc; | ||
3802 | |||
3803 | - spin_lock(&user_lock); | ||
3804 | + mutex_lock(&user_lock); | ||
3805 | list_for_each_entry(ssc, &ssc_list, list) { | ||
3806 | if (ssc->pdev->dev.of_node) { | ||
3807 | if (of_alias_get_id(ssc->pdev->dev.of_node, "ssc") | ||
3808 | @@ -44,18 +44,18 @@ struct ssc_device *ssc_request(unsigned int ssc_num) | ||
3809 | } | ||
3810 | |||
3811 | if (!ssc_valid) { | ||
3812 | - spin_unlock(&user_lock); | ||
3813 | + mutex_unlock(&user_lock); | ||
3814 | pr_err("ssc: ssc%d platform device is missing\n", ssc_num); | ||
3815 | return ERR_PTR(-ENODEV); | ||
3816 | } | ||
3817 | |||
3818 | if (ssc->user) { | ||
3819 | - spin_unlock(&user_lock); | ||
3820 | + mutex_unlock(&user_lock); | ||
3821 | dev_dbg(&ssc->pdev->dev, "module busy\n"); | ||
3822 | return ERR_PTR(-EBUSY); | ||
3823 | } | ||
3824 | ssc->user++; | ||
3825 | - spin_unlock(&user_lock); | ||
3826 | + mutex_unlock(&user_lock); | ||
3827 | |||
3828 | clk_prepare(ssc->clk); | ||
3829 | |||
3830 | @@ -67,14 +67,14 @@ void ssc_free(struct ssc_device *ssc) | ||
3831 | { | ||
3832 | bool disable_clk = true; | ||
3833 | |||
3834 | - spin_lock(&user_lock); | ||
3835 | + mutex_lock(&user_lock); | ||
3836 | if (ssc->user) | ||
3837 | ssc->user--; | ||
3838 | else { | ||
3839 | disable_clk = false; | ||
3840 | dev_dbg(&ssc->pdev->dev, "device already free\n"); | ||
3841 | } | ||
3842 | - spin_unlock(&user_lock); | ||
3843 | + mutex_unlock(&user_lock); | ||
3844 | |||
3845 | if (disable_clk) | ||
3846 | clk_unprepare(ssc->clk); | ||
3847 | @@ -237,9 +237,9 @@ static int ssc_probe(struct platform_device *pdev) | ||
3848 | return -ENXIO; | ||
3849 | } | ||
3850 | |||
3851 | - spin_lock(&user_lock); | ||
3852 | + mutex_lock(&user_lock); | ||
3853 | list_add_tail(&ssc->list, &ssc_list); | ||
3854 | - spin_unlock(&user_lock); | ||
3855 | + mutex_unlock(&user_lock); | ||
3856 | |||
3857 | platform_set_drvdata(pdev, ssc); | ||
3858 | |||
3859 | @@ -258,9 +258,9 @@ static int ssc_remove(struct platform_device *pdev) | ||
3860 | |||
3861 | ssc_sound_dai_remove(ssc); | ||
3862 | |||
3863 | - spin_lock(&user_lock); | ||
3864 | + mutex_lock(&user_lock); | ||
3865 | list_del(&ssc->list); | ||
3866 | - spin_unlock(&user_lock); | ||
3867 | + mutex_unlock(&user_lock); | ||
3868 | |||
3869 | return 0; | ||
3870 | } | ||
3871 | diff --git a/drivers/misc/habanalabs/goya/goya_security.c b/drivers/misc/habanalabs/goya/goya_security.c | ||
3872 | index d6ec12b3e692..08fc89ea0a0c 100644 | ||
3873 | --- a/drivers/misc/habanalabs/goya/goya_security.c | ||
3874 | +++ b/drivers/misc/habanalabs/goya/goya_security.c | ||
3875 | @@ -695,7 +695,6 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
3876 | mask |= 1 << ((mmTPC0_CFG_CFG_SUBTRACT_VALUE & 0x7F) >> 2); | ||
3877 | mask |= 1 << ((mmTPC0_CFG_SM_BASE_ADDRESS_LOW & 0x7F) >> 2); | ||
3878 | mask |= 1 << ((mmTPC0_CFG_SM_BASE_ADDRESS_HIGH & 0x7F) >> 2); | ||
3879 | - mask |= 1 << ((mmTPC0_CFG_CFG_SUBTRACT_VALUE & 0x7F) >> 2); | ||
3880 | mask |= 1 << ((mmTPC0_CFG_TPC_STALL & 0x7F) >> 2); | ||
3881 | mask |= 1 << ((mmTPC0_CFG_MSS_CONFIG & 0x7F) >> 2); | ||
3882 | mask |= 1 << ((mmTPC0_CFG_TPC_INTR_CAUSE & 0x7F) >> 2); | ||
3883 | @@ -875,6 +874,16 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
3884 | goya_pb_set_block(hdev, mmTPC1_RD_REGULATOR_BASE); | ||
3885 | goya_pb_set_block(hdev, mmTPC1_WR_REGULATOR_BASE); | ||
3886 | |||
3887 | + pb_addr = (mmTPC1_CFG_SEMAPHORE & ~0xFFF) + PROT_BITS_OFFS; | ||
3888 | + word_offset = ((mmTPC1_CFG_SEMAPHORE & PROT_BITS_OFFS) >> 7) << 2; | ||
3889 | + | ||
3890 | + mask = 1 << ((mmTPC1_CFG_SEMAPHORE & 0x7F) >> 2); | ||
3891 | + mask |= 1 << ((mmTPC1_CFG_VFLAGS & 0x7F) >> 2); | ||
3892 | + mask |= 1 << ((mmTPC1_CFG_SFLAGS & 0x7F) >> 2); | ||
3893 | + mask |= 1 << ((mmTPC1_CFG_STATUS & 0x7F) >> 2); | ||
3894 | + | ||
3895 | + WREG32(pb_addr + word_offset, ~mask); | ||
3896 | + | ||
3897 | pb_addr = (mmTPC1_CFG_CFG_BASE_ADDRESS_HIGH & ~0xFFF) + PROT_BITS_OFFS; | ||
3898 | word_offset = ((mmTPC1_CFG_CFG_BASE_ADDRESS_HIGH & | ||
3899 | PROT_BITS_OFFS) >> 7) << 2; | ||
3900 | @@ -882,6 +891,10 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
3901 | mask |= 1 << ((mmTPC1_CFG_CFG_SUBTRACT_VALUE & 0x7F) >> 2); | ||
3902 | mask |= 1 << ((mmTPC1_CFG_SM_BASE_ADDRESS_LOW & 0x7F) >> 2); | ||
3903 | mask |= 1 << ((mmTPC1_CFG_SM_BASE_ADDRESS_HIGH & 0x7F) >> 2); | ||
3904 | + mask |= 1 << ((mmTPC1_CFG_TPC_STALL & 0x7F) >> 2); | ||
3905 | + mask |= 1 << ((mmTPC1_CFG_MSS_CONFIG & 0x7F) >> 2); | ||
3906 | + mask |= 1 << ((mmTPC1_CFG_TPC_INTR_CAUSE & 0x7F) >> 2); | ||
3907 | + mask |= 1 << ((mmTPC1_CFG_TPC_INTR_MASK & 0x7F) >> 2); | ||
3908 | |||
3909 | WREG32(pb_addr + word_offset, ~mask); | ||
3910 | |||
3911 | @@ -1057,6 +1070,16 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
3912 | goya_pb_set_block(hdev, mmTPC2_RD_REGULATOR_BASE); | ||
3913 | goya_pb_set_block(hdev, mmTPC2_WR_REGULATOR_BASE); | ||
3914 | |||
3915 | + pb_addr = (mmTPC2_CFG_SEMAPHORE & ~0xFFF) + PROT_BITS_OFFS; | ||
3916 | + word_offset = ((mmTPC2_CFG_SEMAPHORE & PROT_BITS_OFFS) >> 7) << 2; | ||
3917 | + | ||
3918 | + mask = 1 << ((mmTPC2_CFG_SEMAPHORE & 0x7F) >> 2); | ||
3919 | + mask |= 1 << ((mmTPC2_CFG_VFLAGS & 0x7F) >> 2); | ||
3920 | + mask |= 1 << ((mmTPC2_CFG_SFLAGS & 0x7F) >> 2); | ||
3921 | + mask |= 1 << ((mmTPC2_CFG_STATUS & 0x7F) >> 2); | ||
3922 | + | ||
3923 | + WREG32(pb_addr + word_offset, ~mask); | ||
3924 | + | ||
3925 | pb_addr = (mmTPC2_CFG_CFG_BASE_ADDRESS_HIGH & ~0xFFF) + PROT_BITS_OFFS; | ||
3926 | word_offset = ((mmTPC2_CFG_CFG_BASE_ADDRESS_HIGH & | ||
3927 | PROT_BITS_OFFS) >> 7) << 2; | ||
3928 | @@ -1064,6 +1087,10 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
3929 | mask |= 1 << ((mmTPC2_CFG_CFG_SUBTRACT_VALUE & 0x7F) >> 2); | ||
3930 | mask |= 1 << ((mmTPC2_CFG_SM_BASE_ADDRESS_LOW & 0x7F) >> 2); | ||
3931 | mask |= 1 << ((mmTPC2_CFG_SM_BASE_ADDRESS_HIGH & 0x7F) >> 2); | ||
3932 | + mask |= 1 << ((mmTPC2_CFG_TPC_STALL & 0x7F) >> 2); | ||
3933 | + mask |= 1 << ((mmTPC2_CFG_MSS_CONFIG & 0x7F) >> 2); | ||
3934 | + mask |= 1 << ((mmTPC2_CFG_TPC_INTR_CAUSE & 0x7F) >> 2); | ||
3935 | + mask |= 1 << ((mmTPC2_CFG_TPC_INTR_MASK & 0x7F) >> 2); | ||
3936 | |||
3937 | WREG32(pb_addr + word_offset, ~mask); | ||
3938 | |||
3939 | @@ -1239,6 +1266,16 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
3940 | goya_pb_set_block(hdev, mmTPC3_RD_REGULATOR_BASE); | ||
3941 | goya_pb_set_block(hdev, mmTPC3_WR_REGULATOR_BASE); | ||
3942 | |||
3943 | + pb_addr = (mmTPC3_CFG_SEMAPHORE & ~0xFFF) + PROT_BITS_OFFS; | ||
3944 | + word_offset = ((mmTPC3_CFG_SEMAPHORE & PROT_BITS_OFFS) >> 7) << 2; | ||
3945 | + | ||
3946 | + mask = 1 << ((mmTPC3_CFG_SEMAPHORE & 0x7F) >> 2); | ||
3947 | + mask |= 1 << ((mmTPC3_CFG_VFLAGS & 0x7F) >> 2); | ||
3948 | + mask |= 1 << ((mmTPC3_CFG_SFLAGS & 0x7F) >> 2); | ||
3949 | + mask |= 1 << ((mmTPC3_CFG_STATUS & 0x7F) >> 2); | ||
3950 | + | ||
3951 | + WREG32(pb_addr + word_offset, ~mask); | ||
3952 | + | ||
3953 | pb_addr = (mmTPC3_CFG_CFG_BASE_ADDRESS_HIGH & ~0xFFF) + PROT_BITS_OFFS; | ||
3954 | word_offset = ((mmTPC3_CFG_CFG_BASE_ADDRESS_HIGH | ||
3955 | & PROT_BITS_OFFS) >> 7) << 2; | ||
3956 | @@ -1246,6 +1283,10 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
3957 | mask |= 1 << ((mmTPC3_CFG_CFG_SUBTRACT_VALUE & 0x7F) >> 2); | ||
3958 | mask |= 1 << ((mmTPC3_CFG_SM_BASE_ADDRESS_LOW & 0x7F) >> 2); | ||
3959 | mask |= 1 << ((mmTPC3_CFG_SM_BASE_ADDRESS_HIGH & 0x7F) >> 2); | ||
3960 | + mask |= 1 << ((mmTPC3_CFG_TPC_STALL & 0x7F) >> 2); | ||
3961 | + mask |= 1 << ((mmTPC3_CFG_MSS_CONFIG & 0x7F) >> 2); | ||
3962 | + mask |= 1 << ((mmTPC3_CFG_TPC_INTR_CAUSE & 0x7F) >> 2); | ||
3963 | + mask |= 1 << ((mmTPC3_CFG_TPC_INTR_MASK & 0x7F) >> 2); | ||
3964 | |||
3965 | WREG32(pb_addr + word_offset, ~mask); | ||
3966 | |||
3967 | @@ -1421,6 +1462,16 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
3968 | goya_pb_set_block(hdev, mmTPC4_RD_REGULATOR_BASE); | ||
3969 | goya_pb_set_block(hdev, mmTPC4_WR_REGULATOR_BASE); | ||
3970 | |||
3971 | + pb_addr = (mmTPC4_CFG_SEMAPHORE & ~0xFFF) + PROT_BITS_OFFS; | ||
3972 | + word_offset = ((mmTPC4_CFG_SEMAPHORE & PROT_BITS_OFFS) >> 7) << 2; | ||
3973 | + | ||
3974 | + mask = 1 << ((mmTPC4_CFG_SEMAPHORE & 0x7F) >> 2); | ||
3975 | + mask |= 1 << ((mmTPC4_CFG_VFLAGS & 0x7F) >> 2); | ||
3976 | + mask |= 1 << ((mmTPC4_CFG_SFLAGS & 0x7F) >> 2); | ||
3977 | + mask |= 1 << ((mmTPC4_CFG_STATUS & 0x7F) >> 2); | ||
3978 | + | ||
3979 | + WREG32(pb_addr + word_offset, ~mask); | ||
3980 | + | ||
3981 | pb_addr = (mmTPC4_CFG_CFG_BASE_ADDRESS_HIGH & ~0xFFF) + PROT_BITS_OFFS; | ||
3982 | word_offset = ((mmTPC4_CFG_CFG_BASE_ADDRESS_HIGH & | ||
3983 | PROT_BITS_OFFS) >> 7) << 2; | ||
3984 | @@ -1428,6 +1479,10 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
3985 | mask |= 1 << ((mmTPC4_CFG_CFG_SUBTRACT_VALUE & 0x7F) >> 2); | ||
3986 | mask |= 1 << ((mmTPC4_CFG_SM_BASE_ADDRESS_LOW & 0x7F) >> 2); | ||
3987 | mask |= 1 << ((mmTPC4_CFG_SM_BASE_ADDRESS_HIGH & 0x7F) >> 2); | ||
3988 | + mask |= 1 << ((mmTPC4_CFG_TPC_STALL & 0x7F) >> 2); | ||
3989 | + mask |= 1 << ((mmTPC4_CFG_MSS_CONFIG & 0x7F) >> 2); | ||
3990 | + mask |= 1 << ((mmTPC4_CFG_TPC_INTR_CAUSE & 0x7F) >> 2); | ||
3991 | + mask |= 1 << ((mmTPC4_CFG_TPC_INTR_MASK & 0x7F) >> 2); | ||
3992 | |||
3993 | WREG32(pb_addr + word_offset, ~mask); | ||
3994 | |||
3995 | @@ -1603,6 +1658,16 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
3996 | goya_pb_set_block(hdev, mmTPC5_RD_REGULATOR_BASE); | ||
3997 | goya_pb_set_block(hdev, mmTPC5_WR_REGULATOR_BASE); | ||
3998 | |||
3999 | + pb_addr = (mmTPC5_CFG_SEMAPHORE & ~0xFFF) + PROT_BITS_OFFS; | ||
4000 | + word_offset = ((mmTPC5_CFG_SEMAPHORE & PROT_BITS_OFFS) >> 7) << 2; | ||
4001 | + | ||
4002 | + mask = 1 << ((mmTPC5_CFG_SEMAPHORE & 0x7F) >> 2); | ||
4003 | + mask |= 1 << ((mmTPC5_CFG_VFLAGS & 0x7F) >> 2); | ||
4004 | + mask |= 1 << ((mmTPC5_CFG_SFLAGS & 0x7F) >> 2); | ||
4005 | + mask |= 1 << ((mmTPC5_CFG_STATUS & 0x7F) >> 2); | ||
4006 | + | ||
4007 | + WREG32(pb_addr + word_offset, ~mask); | ||
4008 | + | ||
4009 | pb_addr = (mmTPC5_CFG_CFG_BASE_ADDRESS_HIGH & ~0xFFF) + PROT_BITS_OFFS; | ||
4010 | word_offset = ((mmTPC5_CFG_CFG_BASE_ADDRESS_HIGH & | ||
4011 | PROT_BITS_OFFS) >> 7) << 2; | ||
4012 | @@ -1610,6 +1675,10 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
4013 | mask |= 1 << ((mmTPC5_CFG_CFG_SUBTRACT_VALUE & 0x7F) >> 2); | ||
4014 | mask |= 1 << ((mmTPC5_CFG_SM_BASE_ADDRESS_LOW & 0x7F) >> 2); | ||
4015 | mask |= 1 << ((mmTPC5_CFG_SM_BASE_ADDRESS_HIGH & 0x7F) >> 2); | ||
4016 | + mask |= 1 << ((mmTPC5_CFG_TPC_STALL & 0x7F) >> 2); | ||
4017 | + mask |= 1 << ((mmTPC5_CFG_MSS_CONFIG & 0x7F) >> 2); | ||
4018 | + mask |= 1 << ((mmTPC5_CFG_TPC_INTR_CAUSE & 0x7F) >> 2); | ||
4019 | + mask |= 1 << ((mmTPC5_CFG_TPC_INTR_MASK & 0x7F) >> 2); | ||
4020 | |||
4021 | WREG32(pb_addr + word_offset, ~mask); | ||
4022 | |||
4023 | @@ -1785,6 +1854,16 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
4024 | goya_pb_set_block(hdev, mmTPC6_RD_REGULATOR_BASE); | ||
4025 | goya_pb_set_block(hdev, mmTPC6_WR_REGULATOR_BASE); | ||
4026 | |||
4027 | + pb_addr = (mmTPC6_CFG_SEMAPHORE & ~0xFFF) + PROT_BITS_OFFS; | ||
4028 | + word_offset = ((mmTPC6_CFG_SEMAPHORE & PROT_BITS_OFFS) >> 7) << 2; | ||
4029 | + | ||
4030 | + mask = 1 << ((mmTPC6_CFG_SEMAPHORE & 0x7F) >> 2); | ||
4031 | + mask |= 1 << ((mmTPC6_CFG_VFLAGS & 0x7F) >> 2); | ||
4032 | + mask |= 1 << ((mmTPC6_CFG_SFLAGS & 0x7F) >> 2); | ||
4033 | + mask |= 1 << ((mmTPC6_CFG_STATUS & 0x7F) >> 2); | ||
4034 | + | ||
4035 | + WREG32(pb_addr + word_offset, ~mask); | ||
4036 | + | ||
4037 | pb_addr = (mmTPC6_CFG_CFG_BASE_ADDRESS_HIGH & ~0xFFF) + PROT_BITS_OFFS; | ||
4038 | word_offset = ((mmTPC6_CFG_CFG_BASE_ADDRESS_HIGH & | ||
4039 | PROT_BITS_OFFS) >> 7) << 2; | ||
4040 | @@ -1792,6 +1871,10 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
4041 | mask |= 1 << ((mmTPC6_CFG_CFG_SUBTRACT_VALUE & 0x7F) >> 2); | ||
4042 | mask |= 1 << ((mmTPC6_CFG_SM_BASE_ADDRESS_LOW & 0x7F) >> 2); | ||
4043 | mask |= 1 << ((mmTPC6_CFG_SM_BASE_ADDRESS_HIGH & 0x7F) >> 2); | ||
4044 | + mask |= 1 << ((mmTPC6_CFG_TPC_STALL & 0x7F) >> 2); | ||
4045 | + mask |= 1 << ((mmTPC6_CFG_MSS_CONFIG & 0x7F) >> 2); | ||
4046 | + mask |= 1 << ((mmTPC6_CFG_TPC_INTR_CAUSE & 0x7F) >> 2); | ||
4047 | + mask |= 1 << ((mmTPC6_CFG_TPC_INTR_MASK & 0x7F) >> 2); | ||
4048 | |||
4049 | WREG32(pb_addr + word_offset, ~mask); | ||
4050 | |||
4051 | @@ -1967,6 +2050,16 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
4052 | goya_pb_set_block(hdev, mmTPC7_RD_REGULATOR_BASE); | ||
4053 | goya_pb_set_block(hdev, mmTPC7_WR_REGULATOR_BASE); | ||
4054 | |||
4055 | + pb_addr = (mmTPC7_CFG_SEMAPHORE & ~0xFFF) + PROT_BITS_OFFS; | ||
4056 | + word_offset = ((mmTPC7_CFG_SEMAPHORE & PROT_BITS_OFFS) >> 7) << 2; | ||
4057 | + | ||
4058 | + mask = 1 << ((mmTPC7_CFG_SEMAPHORE & 0x7F) >> 2); | ||
4059 | + mask |= 1 << ((mmTPC7_CFG_VFLAGS & 0x7F) >> 2); | ||
4060 | + mask |= 1 << ((mmTPC7_CFG_SFLAGS & 0x7F) >> 2); | ||
4061 | + mask |= 1 << ((mmTPC7_CFG_STATUS & 0x7F) >> 2); | ||
4062 | + | ||
4063 | + WREG32(pb_addr + word_offset, ~mask); | ||
4064 | + | ||
4065 | pb_addr = (mmTPC7_CFG_CFG_BASE_ADDRESS_HIGH & ~0xFFF) + PROT_BITS_OFFS; | ||
4066 | word_offset = ((mmTPC7_CFG_CFG_BASE_ADDRESS_HIGH & | ||
4067 | PROT_BITS_OFFS) >> 7) << 2; | ||
4068 | @@ -1974,6 +2067,10 @@ static void goya_init_tpc_protection_bits(struct hl_device *hdev) | ||
4069 | mask |= 1 << ((mmTPC7_CFG_CFG_SUBTRACT_VALUE & 0x7F) >> 2); | ||
4070 | mask |= 1 << ((mmTPC7_CFG_SM_BASE_ADDRESS_LOW & 0x7F) >> 2); | ||
4071 | mask |= 1 << ((mmTPC7_CFG_SM_BASE_ADDRESS_HIGH & 0x7F) >> 2); | ||
4072 | + mask |= 1 << ((mmTPC7_CFG_TPC_STALL & 0x7F) >> 2); | ||
4073 | + mask |= 1 << ((mmTPC7_CFG_MSS_CONFIG & 0x7F) >> 2); | ||
4074 | + mask |= 1 << ((mmTPC7_CFG_TPC_INTR_CAUSE & 0x7F) >> 2); | ||
4075 | + mask |= 1 << ((mmTPC7_CFG_TPC_INTR_MASK & 0x7F) >> 2); | ||
4076 | |||
4077 | WREG32(pb_addr + word_offset, ~mask); | ||
4078 | |||
4079 | diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c | ||
4080 | index 53bb394ccba6..cef97a7eb8b6 100644 | ||
4081 | --- a/drivers/misc/mei/bus.c | ||
4082 | +++ b/drivers/misc/mei/bus.c | ||
4083 | @@ -745,9 +745,8 @@ static int mei_cl_device_remove(struct device *dev) | ||
4084 | |||
4085 | mei_cl_bus_module_put(cldev); | ||
4086 | module_put(THIS_MODULE); | ||
4087 | - dev->driver = NULL; | ||
4088 | - return ret; | ||
4089 | |||
4090 | + return ret; | ||
4091 | } | ||
4092 | |||
4093 | static ssize_t name_show(struct device *dev, struct device_attribute *a, | ||
4094 | diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c | ||
4095 | index c37e70dbe250..7e4bc9124efd 100644 | ||
4096 | --- a/drivers/mmc/host/mmci.c | ||
4097 | +++ b/drivers/mmc/host/mmci.c | ||
4098 | @@ -168,6 +168,8 @@ static struct variant_data variant_ux500 = { | ||
4099 | .cmdreg_srsp = MCI_CPSM_RESPONSE, | ||
4100 | .datalength_bits = 24, | ||
4101 | .datactrl_blocksz = 11, | ||
4102 | + .datactrl_any_blocksz = true, | ||
4103 | + .dma_power_of_2 = true, | ||
4104 | .datactrl_mask_sdio = MCI_DPSM_ST_SDIOEN, | ||
4105 | .st_sdio = true, | ||
4106 | .st_clkdiv = true, | ||
4107 | @@ -201,6 +203,8 @@ static struct variant_data variant_ux500v2 = { | ||
4108 | .datactrl_mask_ddrmode = MCI_DPSM_ST_DDRMODE, | ||
4109 | .datalength_bits = 24, | ||
4110 | .datactrl_blocksz = 11, | ||
4111 | + .datactrl_any_blocksz = true, | ||
4112 | + .dma_power_of_2 = true, | ||
4113 | .datactrl_mask_sdio = MCI_DPSM_ST_SDIOEN, | ||
4114 | .st_sdio = true, | ||
4115 | .st_clkdiv = true, | ||
4116 | @@ -260,6 +264,7 @@ static struct variant_data variant_stm32_sdmmc = { | ||
4117 | .datacnt_useless = true, | ||
4118 | .datalength_bits = 25, | ||
4119 | .datactrl_blocksz = 14, | ||
4120 | + .datactrl_any_blocksz = true, | ||
4121 | .stm32_idmabsize_mask = GENMASK(12, 5), | ||
4122 | .init = sdmmc_variant_init, | ||
4123 | }; | ||
4124 | @@ -279,6 +284,7 @@ static struct variant_data variant_qcom = { | ||
4125 | .data_cmd_enable = MCI_CPSM_QCOM_DATCMD, | ||
4126 | .datalength_bits = 24, | ||
4127 | .datactrl_blocksz = 11, | ||
4128 | + .datactrl_any_blocksz = true, | ||
4129 | .pwrreg_powerup = MCI_PWR_UP, | ||
4130 | .f_max = 208000000, | ||
4131 | .explicit_mclk_control = true, | ||
4132 | @@ -447,10 +453,11 @@ void mmci_dma_setup(struct mmci_host *host) | ||
4133 | static int mmci_validate_data(struct mmci_host *host, | ||
4134 | struct mmc_data *data) | ||
4135 | { | ||
4136 | + struct variant_data *variant = host->variant; | ||
4137 | + | ||
4138 | if (!data) | ||
4139 | return 0; | ||
4140 | - | ||
4141 | - if (!is_power_of_2(data->blksz)) { | ||
4142 | + if (!is_power_of_2(data->blksz) && !variant->datactrl_any_blocksz) { | ||
4143 | dev_err(mmc_dev(host->mmc), | ||
4144 | "unsupported block size (%d bytes)\n", data->blksz); | ||
4145 | return -EINVAL; | ||
4146 | @@ -515,7 +522,9 @@ int mmci_dma_start(struct mmci_host *host, unsigned int datactrl) | ||
4147 | "Submit MMCI DMA job, sglen %d blksz %04x blks %04x flags %08x\n", | ||
4148 | data->sg_len, data->blksz, data->blocks, data->flags); | ||
4149 | |||
4150 | - host->ops->dma_start(host, &datactrl); | ||
4151 | + ret = host->ops->dma_start(host, &datactrl); | ||
4152 | + if (ret) | ||
4153 | + return ret; | ||
4154 | |||
4155 | /* Trigger the DMA transfer */ | ||
4156 | mmci_write_datactrlreg(host, datactrl); | ||
4157 | @@ -822,6 +831,18 @@ static int _mmci_dmae_prep_data(struct mmci_host *host, struct mmc_data *data, | ||
4158 | if (data->blksz * data->blocks <= variant->fifosize) | ||
4159 | return -EINVAL; | ||
4160 | |||
4161 | + /* | ||
4162 | + * This is necessary to get SDIO working on the Ux500. We do not yet | ||
4163 | + * know if this is a bug in: | ||
4164 | + * - The Ux500 DMA controller (DMA40) | ||
4165 | + * - The MMCI DMA interface on the Ux500 | ||
4166 | + * some power of two blocks (such as 64 bytes) are sent regularly | ||
4167 | + * during SDIO traffic and those work fine so for these we enable DMA | ||
4168 | + * transfers. | ||
4169 | + */ | ||
4170 | + if (host->variant->dma_power_of_2 && !is_power_of_2(data->blksz)) | ||
4171 | + return -EINVAL; | ||
4172 | + | ||
4173 | device = chan->device; | ||
4174 | nr_sg = dma_map_sg(device->dev, data->sg, data->sg_len, | ||
4175 | mmc_get_dma_dir(data)); | ||
4176 | @@ -872,9 +893,14 @@ int mmci_dmae_prep_data(struct mmci_host *host, | ||
4177 | int mmci_dmae_start(struct mmci_host *host, unsigned int *datactrl) | ||
4178 | { | ||
4179 | struct mmci_dmae_priv *dmae = host->dma_priv; | ||
4180 | + int ret; | ||
4181 | |||
4182 | host->dma_in_progress = true; | ||
4183 | - dmaengine_submit(dmae->desc_current); | ||
4184 | + ret = dma_submit_error(dmaengine_submit(dmae->desc_current)); | ||
4185 | + if (ret < 0) { | ||
4186 | + host->dma_in_progress = false; | ||
4187 | + return ret; | ||
4188 | + } | ||
4189 | dma_async_issue_pending(dmae->cur); | ||
4190 | |||
4191 | *datactrl |= MCI_DPSM_DMAENABLE; | ||
4192 | diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h | ||
4193 | index 833236ecb31e..89ab73343cf3 100644 | ||
4194 | --- a/drivers/mmc/host/mmci.h | ||
4195 | +++ b/drivers/mmc/host/mmci.h | ||
4196 | @@ -278,7 +278,11 @@ struct mmci_host; | ||
4197 | * @stm32_clkdiv: true if using a STM32-specific clock divider algorithm | ||
4198 | * @datactrl_mask_ddrmode: ddr mode mask in datactrl register. | ||
4199 | * @datactrl_mask_sdio: SDIO enable mask in datactrl register | ||
4200 | - * @datactrl_blksz: block size in power of two | ||
4201 | + * @datactrl_blocksz: block size in power of two | ||
4202 | + * @datactrl_any_blocksz: true if block any block sizes are accepted by | ||
4203 | + * hardware, such as with some SDIO traffic that send | ||
4204 | + * odd packets. | ||
4205 | + * @dma_power_of_2: DMA only works with blocks that are a power of 2. | ||
4206 | * @datactrl_first: true if data must be setup before send command | ||
4207 | * @datacnt_useless: true if you could not use datacnt register to read | ||
4208 | * remaining data | ||
4209 | @@ -323,6 +327,8 @@ struct variant_data { | ||
4210 | unsigned int datactrl_mask_ddrmode; | ||
4211 | unsigned int datactrl_mask_sdio; | ||
4212 | unsigned int datactrl_blocksz; | ||
4213 | + u8 datactrl_any_blocksz:1; | ||
4214 | + u8 dma_power_of_2:1; | ||
4215 | u8 datactrl_first:1; | ||
4216 | u8 datacnt_useless:1; | ||
4217 | u8 st_sdio:1; | ||
4218 | diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c | ||
4219 | index 50514fedbc76..136f9737713d 100644 | ||
4220 | --- a/drivers/mmc/host/sdhci.c | ||
4221 | +++ b/drivers/mmc/host/sdhci.c | ||
4222 | @@ -152,7 +152,7 @@ static void sdhci_set_card_detection(struct sdhci_host *host, bool enable) | ||
4223 | u32 present; | ||
4224 | |||
4225 | if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) || | ||
4226 | - !mmc_card_is_removable(host->mmc)) | ||
4227 | + !mmc_card_is_removable(host->mmc) || mmc_can_gpio_cd(host->mmc)) | ||
4228 | return; | ||
4229 | |||
4230 | if (enable) { | ||
4231 | diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c | ||
4232 | index 4fef20724175..e9ad8bb82f44 100644 | ||
4233 | --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c | ||
4234 | +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c | ||
4235 | @@ -537,8 +537,9 @@ static int brcmnand_revision_init(struct brcmnand_controller *ctrl) | ||
4236 | } else { | ||
4237 | ctrl->cs_offsets = brcmnand_cs_offsets; | ||
4238 | |||
4239 | - /* v5.0 and earlier has a different CS0 offset layout */ | ||
4240 | - if (ctrl->nand_version <= 0x0500) | ||
4241 | + /* v3.3-5.0 have a different CS0 offset layout */ | ||
4242 | + if (ctrl->nand_version >= 0x0303 && | ||
4243 | + ctrl->nand_version <= 0x0500) | ||
4244 | ctrl->cs0_offsets = brcmnand_cs_offsets_cs0; | ||
4245 | } | ||
4246 | |||
4247 | @@ -1790,28 +1791,31 @@ static int brcmnand_read_by_pio(struct mtd_info *mtd, struct nand_chip *chip, | ||
4248 | static int brcmstb_nand_verify_erased_page(struct mtd_info *mtd, | ||
4249 | struct nand_chip *chip, void *buf, u64 addr) | ||
4250 | { | ||
4251 | - int i, sas; | ||
4252 | - void *oob = chip->oob_poi; | ||
4253 | + struct mtd_oob_region ecc; | ||
4254 | + int i; | ||
4255 | int bitflips = 0; | ||
4256 | int page = addr >> chip->page_shift; | ||
4257 | int ret; | ||
4258 | + void *ecc_bytes; | ||
4259 | void *ecc_chunk; | ||
4260 | |||
4261 | if (!buf) | ||
4262 | buf = nand_get_data_buf(chip); | ||
4263 | |||
4264 | - sas = mtd->oobsize / chip->ecc.steps; | ||
4265 | - | ||
4266 | /* read without ecc for verification */ | ||
4267 | ret = chip->ecc.read_page_raw(chip, buf, true, page); | ||
4268 | if (ret) | ||
4269 | return ret; | ||
4270 | |||
4271 | - for (i = 0; i < chip->ecc.steps; i++, oob += sas) { | ||
4272 | + for (i = 0; i < chip->ecc.steps; i++) { | ||
4273 | ecc_chunk = buf + chip->ecc.size * i; | ||
4274 | - ret = nand_check_erased_ecc_chunk(ecc_chunk, | ||
4275 | - chip->ecc.size, | ||
4276 | - oob, sas, NULL, 0, | ||
4277 | + | ||
4278 | + mtd_ooblayout_ecc(mtd, i, &ecc); | ||
4279 | + ecc_bytes = chip->oob_poi + ecc.offset; | ||
4280 | + | ||
4281 | + ret = nand_check_erased_ecc_chunk(ecc_chunk, chip->ecc.size, | ||
4282 | + ecc_bytes, ecc.length, | ||
4283 | + NULL, 0, | ||
4284 | chip->ecc.strength); | ||
4285 | if (ret < 0) | ||
4286 | return ret; | ||
4287 | diff --git a/drivers/mtd/nand/raw/marvell_nand.c b/drivers/mtd/nand/raw/marvell_nand.c | ||
4288 | index fc49e13d81ec..ee4afa17d8a3 100644 | ||
4289 | --- a/drivers/mtd/nand/raw/marvell_nand.c | ||
4290 | +++ b/drivers/mtd/nand/raw/marvell_nand.c | ||
4291 | @@ -707,7 +707,7 @@ static int marvell_nfc_wait_op(struct nand_chip *chip, unsigned int timeout_ms) | ||
4292 | * In case the interrupt was not served in the required time frame, | ||
4293 | * check if the ISR was not served or if something went actually wrong. | ||
4294 | */ | ||
4295 | - if (ret && !pending) { | ||
4296 | + if (!ret && !pending) { | ||
4297 | dev_err(nfc->dev, "Timeout waiting for RB signal\n"); | ||
4298 | return -ETIMEDOUT; | ||
4299 | } | ||
4300 | @@ -2664,7 +2664,7 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc, | ||
4301 | ret = mtd_device_register(mtd, NULL, 0); | ||
4302 | if (ret) { | ||
4303 | dev_err(dev, "failed to register mtd device: %d\n", ret); | ||
4304 | - nand_release(chip); | ||
4305 | + nand_cleanup(chip); | ||
4306 | return ret; | ||
4307 | } | ||
4308 | |||
4309 | @@ -2673,6 +2673,16 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc, | ||
4310 | return 0; | ||
4311 | } | ||
4312 | |||
4313 | +static void marvell_nand_chips_cleanup(struct marvell_nfc *nfc) | ||
4314 | +{ | ||
4315 | + struct marvell_nand_chip *entry, *temp; | ||
4316 | + | ||
4317 | + list_for_each_entry_safe(entry, temp, &nfc->chips, node) { | ||
4318 | + nand_release(&entry->chip); | ||
4319 | + list_del(&entry->node); | ||
4320 | + } | ||
4321 | +} | ||
4322 | + | ||
4323 | static int marvell_nand_chips_init(struct device *dev, struct marvell_nfc *nfc) | ||
4324 | { | ||
4325 | struct device_node *np = dev->of_node; | ||
4326 | @@ -2707,21 +2717,16 @@ static int marvell_nand_chips_init(struct device *dev, struct marvell_nfc *nfc) | ||
4327 | ret = marvell_nand_chip_init(dev, nfc, nand_np); | ||
4328 | if (ret) { | ||
4329 | of_node_put(nand_np); | ||
4330 | - return ret; | ||
4331 | + goto cleanup_chips; | ||
4332 | } | ||
4333 | } | ||
4334 | |||
4335 | return 0; | ||
4336 | -} | ||
4337 | |||
4338 | -static void marvell_nand_chips_cleanup(struct marvell_nfc *nfc) | ||
4339 | -{ | ||
4340 | - struct marvell_nand_chip *entry, *temp; | ||
4341 | +cleanup_chips: | ||
4342 | + marvell_nand_chips_cleanup(nfc); | ||
4343 | |||
4344 | - list_for_each_entry_safe(entry, temp, &nfc->chips, node) { | ||
4345 | - nand_release(&entry->chip); | ||
4346 | - list_del(&entry->node); | ||
4347 | - } | ||
4348 | + return ret; | ||
4349 | } | ||
4350 | |||
4351 | static int marvell_nfc_init_dma(struct marvell_nfc *nfc) | ||
4352 | diff --git a/drivers/mtd/nand/raw/nand_timings.c b/drivers/mtd/nand/raw/nand_timings.c | ||
4353 | index f64b06a71dfa..f12b7a7844c9 100644 | ||
4354 | --- a/drivers/mtd/nand/raw/nand_timings.c | ||
4355 | +++ b/drivers/mtd/nand/raw/nand_timings.c | ||
4356 | @@ -314,10 +314,9 @@ int onfi_fill_data_interface(struct nand_chip *chip, | ||
4357 | /* microseconds -> picoseconds */ | ||
4358 | timings->tPROG_max = 1000000ULL * ONFI_DYN_TIMING_MAX; | ||
4359 | timings->tBERS_max = 1000000ULL * ONFI_DYN_TIMING_MAX; | ||
4360 | - timings->tR_max = 1000000ULL * 200000000ULL; | ||
4361 | |||
4362 | - /* nanoseconds -> picoseconds */ | ||
4363 | - timings->tCCS_min = 1000UL * 500000; | ||
4364 | + timings->tR_max = 200000000; | ||
4365 | + timings->tCCS_min = 500000; | ||
4366 | } | ||
4367 | |||
4368 | return 0; | ||
4369 | diff --git a/drivers/mtd/nand/raw/oxnas_nand.c b/drivers/mtd/nand/raw/oxnas_nand.c | ||
4370 | index 0429d218fd9f..23c222b6c40e 100644 | ||
4371 | --- a/drivers/mtd/nand/raw/oxnas_nand.c | ||
4372 | +++ b/drivers/mtd/nand/raw/oxnas_nand.c | ||
4373 | @@ -32,6 +32,7 @@ struct oxnas_nand_ctrl { | ||
4374 | void __iomem *io_base; | ||
4375 | struct clk *clk; | ||
4376 | struct nand_chip *chips[OXNAS_NAND_MAX_CHIPS]; | ||
4377 | + unsigned int nchips; | ||
4378 | }; | ||
4379 | |||
4380 | static uint8_t oxnas_nand_read_byte(struct nand_chip *chip) | ||
4381 | @@ -79,9 +80,9 @@ static int oxnas_nand_probe(struct platform_device *pdev) | ||
4382 | struct nand_chip *chip; | ||
4383 | struct mtd_info *mtd; | ||
4384 | struct resource *res; | ||
4385 | - int nchips = 0; | ||
4386 | int count = 0; | ||
4387 | int err = 0; | ||
4388 | + int i; | ||
4389 | |||
4390 | /* Allocate memory for the device structure (and zero it) */ | ||
4391 | oxnas = devm_kzalloc(&pdev->dev, sizeof(*oxnas), | ||
4392 | @@ -143,12 +144,12 @@ static int oxnas_nand_probe(struct platform_device *pdev) | ||
4393 | if (err) | ||
4394 | goto err_cleanup_nand; | ||
4395 | |||
4396 | - oxnas->chips[nchips] = chip; | ||
4397 | - ++nchips; | ||
4398 | + oxnas->chips[oxnas->nchips] = chip; | ||
4399 | + ++oxnas->nchips; | ||
4400 | } | ||
4401 | |||
4402 | /* Exit if no chips found */ | ||
4403 | - if (!nchips) { | ||
4404 | + if (!oxnas->nchips) { | ||
4405 | err = -ENODEV; | ||
4406 | goto err_clk_unprepare; | ||
4407 | } | ||
4408 | @@ -161,6 +162,13 @@ err_cleanup_nand: | ||
4409 | nand_cleanup(chip); | ||
4410 | err_release_child: | ||
4411 | of_node_put(nand_np); | ||
4412 | + | ||
4413 | + for (i = 0; i < oxnas->nchips; i++) { | ||
4414 | + chip = oxnas->chips[i]; | ||
4415 | + WARN_ON(mtd_device_unregister(nand_to_mtd(chip))); | ||
4416 | + nand_cleanup(chip); | ||
4417 | + } | ||
4418 | + | ||
4419 | err_clk_unprepare: | ||
4420 | clk_disable_unprepare(oxnas->clk); | ||
4421 | return err; | ||
4422 | @@ -169,9 +177,13 @@ err_clk_unprepare: | ||
4423 | static int oxnas_nand_remove(struct platform_device *pdev) | ||
4424 | { | ||
4425 | struct oxnas_nand_ctrl *oxnas = platform_get_drvdata(pdev); | ||
4426 | + struct nand_chip *chip; | ||
4427 | + int i; | ||
4428 | |||
4429 | - if (oxnas->chips[0]) | ||
4430 | - nand_release(oxnas->chips[0]); | ||
4431 | + for (i = 0; i < oxnas->nchips; i++) { | ||
4432 | + chip = oxnas->chips[i]; | ||
4433 | + nand_release(chip); | ||
4434 | + } | ||
4435 | |||
4436 | clk_disable_unprepare(oxnas->clk); | ||
4437 | |||
4438 | diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c | ||
4439 | index 9502db66092e..b16aea0e3999 100644 | ||
4440 | --- a/drivers/net/dsa/bcm_sf2.c | ||
4441 | +++ b/drivers/net/dsa/bcm_sf2.c | ||
4442 | @@ -1116,6 +1116,8 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev) | ||
4443 | set_bit(0, priv->cfp.used); | ||
4444 | set_bit(0, priv->cfp.unique); | ||
4445 | |||
4446 | + /* Balance of_node_put() done by of_find_node_by_name() */ | ||
4447 | + of_node_get(dn); | ||
4448 | ports = of_find_node_by_name(dn, "ports"); | ||
4449 | if (ports) { | ||
4450 | bcm_sf2_identify_ports(priv, ports); | ||
4451 | diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c | ||
4452 | index 84c4319e3b31..8d50aacd19e5 100644 | ||
4453 | --- a/drivers/net/dsa/microchip/ksz8795.c | ||
4454 | +++ b/drivers/net/dsa/microchip/ksz8795.c | ||
4455 | @@ -1270,6 +1270,9 @@ static int ksz8795_switch_init(struct ksz_device *dev) | ||
4456 | /* set the real number of ports */ | ||
4457 | dev->ds->num_ports = dev->port_cnt; | ||
4458 | |||
4459 | + /* set the real number of ports */ | ||
4460 | + dev->ds->num_ports = dev->port_cnt; | ||
4461 | + | ||
4462 | return 0; | ||
4463 | } | ||
4464 | |||
4465 | diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c | ||
4466 | index 3afb596d8e43..f600874e2476 100644 | ||
4467 | --- a/drivers/net/dsa/microchip/ksz9477.c | ||
4468 | +++ b/drivers/net/dsa/microchip/ksz9477.c | ||
4469 | @@ -515,6 +515,9 @@ static int ksz9477_port_vlan_filtering(struct dsa_switch *ds, int port, | ||
4470 | PORT_VLAN_LOOKUP_VID_0, false); | ||
4471 | } | ||
4472 | |||
4473 | + /* set the real number of ports */ | ||
4474 | + dev->ds->num_ports = dev->port_cnt; | ||
4475 | + | ||
4476 | return 0; | ||
4477 | } | ||
4478 | |||
4479 | diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c | ||
4480 | index 6f340695e6bd..774e48b3f904 100644 | ||
4481 | --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c | ||
4482 | +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c | ||
4483 | @@ -1597,7 +1597,7 @@ void hw_atl_rpfl3l4_ipv6_src_addr_set(struct aq_hw_s *aq_hw, u8 location, | ||
4484 | for (i = 0; i < 4; ++i) | ||
4485 | aq_hw_write_reg(aq_hw, | ||
4486 | HW_ATL_RPF_L3_SRCA_ADR(location + i), | ||
4487 | - ipv6_src[i]); | ||
4488 | + ipv6_src[3 - i]); | ||
4489 | } | ||
4490 | |||
4491 | void hw_atl_rpfl3l4_ipv6_dest_addr_set(struct aq_hw_s *aq_hw, u8 location, | ||
4492 | @@ -1608,7 +1608,7 @@ void hw_atl_rpfl3l4_ipv6_dest_addr_set(struct aq_hw_s *aq_hw, u8 location, | ||
4493 | for (i = 0; i < 4; ++i) | ||
4494 | aq_hw_write_reg(aq_hw, | ||
4495 | HW_ATL_RPF_L3_DSTA_ADR(location + i), | ||
4496 | - ipv6_dest[i]); | ||
4497 | + ipv6_dest[3 - i]); | ||
4498 | } | ||
4499 | |||
4500 | u32 hw_atl_sem_ram_get(struct aq_hw_s *self) | ||
4501 | diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h | ||
4502 | index 35887ad89025..dd8d591404be 100644 | ||
4503 | --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h | ||
4504 | +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_llh_internal.h | ||
4505 | @@ -2564,7 +2564,7 @@ | ||
4506 | */ | ||
4507 | |||
4508 | /* Register address for bitfield pif_rpf_l3_da0_i[31:0] */ | ||
4509 | -#define HW_ATL_RPF_L3_DSTA_ADR(location) (0x000053B0 + (location) * 0x4) | ||
4510 | +#define HW_ATL_RPF_L3_DSTA_ADR(filter) (0x000053D0 + (filter) * 0x4) | ||
4511 | /* Bitmask for bitfield l3_da0[1F:0] */ | ||
4512 | #define HW_ATL_RPF_L3_DSTA_MSK 0xFFFFFFFFu | ||
4513 | /* Inverted bitmask for bitfield l3_da0[1F:0] */ | ||
4514 | diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c | ||
4515 | index 01ed4d4296db..a5c4d4d66df3 100644 | ||
4516 | --- a/drivers/net/ethernet/cadence/macb_main.c | ||
4517 | +++ b/drivers/net/ethernet/cadence/macb_main.c | ||
4518 | @@ -3708,7 +3708,7 @@ static int at91ether_open(struct net_device *dev) | ||
4519 | |||
4520 | ret = at91ether_start(dev); | ||
4521 | if (ret) | ||
4522 | - return ret; | ||
4523 | + goto pm_exit; | ||
4524 | |||
4525 | /* Enable MAC interrupts */ | ||
4526 | macb_writel(lp, IER, MACB_BIT(RCOMP) | | ||
4527 | @@ -3725,6 +3725,10 @@ static int at91ether_open(struct net_device *dev) | ||
4528 | netif_start_queue(dev); | ||
4529 | |||
4530 | return 0; | ||
4531 | + | ||
4532 | +pm_exit: | ||
4533 | + pm_runtime_put_sync(&lp->pdev->dev); | ||
4534 | + return ret; | ||
4535 | } | ||
4536 | |||
4537 | /* Close the interface */ | ||
4538 | diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c | ||
4539 | index ffdb7b113f17..ccb2abd18d6c 100644 | ||
4540 | --- a/drivers/net/ethernet/marvell/mvneta.c | ||
4541 | +++ b/drivers/net/ethernet/marvell/mvneta.c | ||
4542 | @@ -3206,7 +3206,7 @@ static int mvneta_config_interface(struct mvneta_port *pp, | ||
4543 | MVNETA_HSGMII_SERDES_PROTO); | ||
4544 | break; | ||
4545 | default: | ||
4546 | - return -EINVAL; | ||
4547 | + break; | ||
4548 | } | ||
4549 | } | ||
4550 | |||
4551 | @@ -4496,10 +4496,18 @@ static void mvneta_conf_mbus_windows(struct mvneta_port *pp, | ||
4552 | } | ||
4553 | |||
4554 | /* Power up the port */ | ||
4555 | -static void mvneta_port_power_up(struct mvneta_port *pp, int phy_mode) | ||
4556 | +static int mvneta_port_power_up(struct mvneta_port *pp, int phy_mode) | ||
4557 | { | ||
4558 | /* MAC Cause register should be cleared */ | ||
4559 | mvreg_write(pp, MVNETA_UNIT_INTR_CAUSE, 0); | ||
4560 | + | ||
4561 | + if (phy_mode != PHY_INTERFACE_MODE_QSGMII && | ||
4562 | + phy_mode != PHY_INTERFACE_MODE_SGMII && | ||
4563 | + !phy_interface_mode_is_8023z(phy_mode) && | ||
4564 | + !phy_interface_mode_is_rgmii(phy_mode)) | ||
4565 | + return -EINVAL; | ||
4566 | + | ||
4567 | + return 0; | ||
4568 | } | ||
4569 | |||
4570 | /* Device initialization routine */ | ||
4571 | @@ -4683,7 +4691,11 @@ static int mvneta_probe(struct platform_device *pdev) | ||
4572 | if (err < 0) | ||
4573 | goto err_netdev; | ||
4574 | |||
4575 | - mvneta_port_power_up(pp, phy_mode); | ||
4576 | + err = mvneta_port_power_up(pp, pp->phy_interface); | ||
4577 | + if (err < 0) { | ||
4578 | + dev_err(&pdev->dev, "can't power up port\n"); | ||
4579 | + return err; | ||
4580 | + } | ||
4581 | |||
4582 | /* Armada3700 network controller does not support per-cpu | ||
4583 | * operation, so only single NAPI should be initialized. | ||
4584 | @@ -4836,7 +4848,11 @@ static int mvneta_resume(struct device *device) | ||
4585 | } | ||
4586 | } | ||
4587 | mvneta_defaults_set(pp); | ||
4588 | - mvneta_port_power_up(pp, pp->phy_interface); | ||
4589 | + err = mvneta_port_power_up(pp, pp->phy_interface); | ||
4590 | + if (err < 0) { | ||
4591 | + dev_err(device, "can't power up port\n"); | ||
4592 | + return err; | ||
4593 | + } | ||
4594 | |||
4595 | netif_device_attach(dev); | ||
4596 | |||
4597 | diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c | ||
4598 | index 134640412d7b..d5b0bf54f961 100644 | ||
4599 | --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c | ||
4600 | +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c | ||
4601 | @@ -1187,6 +1187,7 @@ static int ionic_init_nic_features(struct ionic_lif *lif) | ||
4602 | |||
4603 | netdev->hw_features |= netdev->hw_enc_features; | ||
4604 | netdev->features |= netdev->hw_features; | ||
4605 | + netdev->vlan_features |= netdev->features & ~NETIF_F_VLAN_FEATURES; | ||
4606 | |||
4607 | netdev->priv_flags |= IFF_UNICAST_FLT; | ||
4608 | |||
4609 | diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | ||
4610 | index 02cdbb22d335..18d88b424828 100644 | ||
4611 | --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | ||
4612 | +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | ||
4613 | @@ -47,15 +47,23 @@ static int rmnet_unregister_real_device(struct net_device *real_dev) | ||
4614 | return 0; | ||
4615 | } | ||
4616 | |||
4617 | -static int rmnet_register_real_device(struct net_device *real_dev) | ||
4618 | +static int rmnet_register_real_device(struct net_device *real_dev, | ||
4619 | + struct netlink_ext_ack *extack) | ||
4620 | { | ||
4621 | struct rmnet_port *port; | ||
4622 | int rc, entry; | ||
4623 | |||
4624 | ASSERT_RTNL(); | ||
4625 | |||
4626 | - if (rmnet_is_real_dev_registered(real_dev)) | ||
4627 | + if (rmnet_is_real_dev_registered(real_dev)) { | ||
4628 | + port = rmnet_get_port_rtnl(real_dev); | ||
4629 | + if (port->rmnet_mode != RMNET_EPMODE_VND) { | ||
4630 | + NL_SET_ERR_MSG_MOD(extack, "bridge device already exists"); | ||
4631 | + return -EINVAL; | ||
4632 | + } | ||
4633 | + | ||
4634 | return 0; | ||
4635 | + } | ||
4636 | |||
4637 | port = kzalloc(sizeof(*port), GFP_ATOMIC); | ||
4638 | if (!port) | ||
4639 | @@ -134,7 +142,7 @@ static int rmnet_newlink(struct net *src_net, struct net_device *dev, | ||
4640 | |||
4641 | mux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]); | ||
4642 | |||
4643 | - err = rmnet_register_real_device(real_dev); | ||
4644 | + err = rmnet_register_real_device(real_dev, extack); | ||
4645 | if (err) | ||
4646 | goto err0; | ||
4647 | |||
4648 | @@ -416,13 +424,10 @@ int rmnet_add_bridge(struct net_device *rmnet_dev, | ||
4649 | if (port->nr_rmnet_devs > 1) | ||
4650 | return -EINVAL; | ||
4651 | |||
4652 | - if (port->rmnet_mode != RMNET_EPMODE_VND) | ||
4653 | - return -EINVAL; | ||
4654 | - | ||
4655 | if (rmnet_is_real_dev_registered(slave_dev)) | ||
4656 | return -EBUSY; | ||
4657 | |||
4658 | - err = rmnet_register_real_device(slave_dev); | ||
4659 | + err = rmnet_register_real_device(slave_dev, extack); | ||
4660 | if (err) | ||
4661 | return -EBUSY; | ||
4662 | |||
4663 | diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c | ||
4664 | index b23fc41896ef..816e59fe68f5 100644 | ||
4665 | --- a/drivers/net/phy/sfp-bus.c | ||
4666 | +++ b/drivers/net/phy/sfp-bus.c | ||
4667 | @@ -9,6 +9,12 @@ | ||
4668 | |||
4669 | #include "sfp.h" | ||
4670 | |||
4671 | +struct sfp_quirk { | ||
4672 | + const char *vendor; | ||
4673 | + const char *part; | ||
4674 | + void (*modes)(const struct sfp_eeprom_id *id, unsigned long *modes); | ||
4675 | +}; | ||
4676 | + | ||
4677 | /** | ||
4678 | * struct sfp_bus - internal representation of a sfp bus | ||
4679 | */ | ||
4680 | @@ -21,6 +27,7 @@ struct sfp_bus { | ||
4681 | const struct sfp_socket_ops *socket_ops; | ||
4682 | struct device *sfp_dev; | ||
4683 | struct sfp *sfp; | ||
4684 | + const struct sfp_quirk *sfp_quirk; | ||
4685 | |||
4686 | const struct sfp_upstream_ops *upstream_ops; | ||
4687 | void *upstream; | ||
4688 | @@ -30,6 +37,71 @@ struct sfp_bus { | ||
4689 | bool started; | ||
4690 | }; | ||
4691 | |||
4692 | +static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id, | ||
4693 | + unsigned long *modes) | ||
4694 | +{ | ||
4695 | + phylink_set(modes, 2500baseX_Full); | ||
4696 | +} | ||
4697 | + | ||
4698 | +static const struct sfp_quirk sfp_quirks[] = { | ||
4699 | + { | ||
4700 | + // Alcatel Lucent G-010S-P can operate at 2500base-X, but | ||
4701 | + // incorrectly report 2500MBd NRZ in their EEPROM | ||
4702 | + .vendor = "ALCATELLUCENT", | ||
4703 | + .part = "G010SP", | ||
4704 | + .modes = sfp_quirk_2500basex, | ||
4705 | + }, { | ||
4706 | + // Alcatel Lucent G-010S-A can operate at 2500base-X, but | ||
4707 | + // report 3.2GBd NRZ in their EEPROM | ||
4708 | + .vendor = "ALCATELLUCENT", | ||
4709 | + .part = "3FE46541AA", | ||
4710 | + .modes = sfp_quirk_2500basex, | ||
4711 | + }, { | ||
4712 | + // Huawei MA5671A can operate at 2500base-X, but report 1.2GBd | ||
4713 | + // NRZ in their EEPROM | ||
4714 | + .vendor = "HUAWEI", | ||
4715 | + .part = "MA5671A", | ||
4716 | + .modes = sfp_quirk_2500basex, | ||
4717 | + }, | ||
4718 | +}; | ||
4719 | + | ||
4720 | +static size_t sfp_strlen(const char *str, size_t maxlen) | ||
4721 | +{ | ||
4722 | + size_t size, i; | ||
4723 | + | ||
4724 | + /* Trailing characters should be filled with space chars */ | ||
4725 | + for (i = 0, size = 0; i < maxlen; i++) | ||
4726 | + if (str[i] != ' ') | ||
4727 | + size = i + 1; | ||
4728 | + | ||
4729 | + return size; | ||
4730 | +} | ||
4731 | + | ||
4732 | +static bool sfp_match(const char *qs, const char *str, size_t len) | ||
4733 | +{ | ||
4734 | + if (!qs) | ||
4735 | + return true; | ||
4736 | + if (strlen(qs) != len) | ||
4737 | + return false; | ||
4738 | + return !strncmp(qs, str, len); | ||
4739 | +} | ||
4740 | + | ||
4741 | +static const struct sfp_quirk *sfp_lookup_quirk(const struct sfp_eeprom_id *id) | ||
4742 | +{ | ||
4743 | + const struct sfp_quirk *q; | ||
4744 | + unsigned int i; | ||
4745 | + size_t vs, ps; | ||
4746 | + | ||
4747 | + vs = sfp_strlen(id->base.vendor_name, ARRAY_SIZE(id->base.vendor_name)); | ||
4748 | + ps = sfp_strlen(id->base.vendor_pn, ARRAY_SIZE(id->base.vendor_pn)); | ||
4749 | + | ||
4750 | + for (i = 0, q = sfp_quirks; i < ARRAY_SIZE(sfp_quirks); i++, q++) | ||
4751 | + if (sfp_match(q->vendor, id->base.vendor_name, vs) && | ||
4752 | + sfp_match(q->part, id->base.vendor_pn, ps)) | ||
4753 | + return q; | ||
4754 | + | ||
4755 | + return NULL; | ||
4756 | +} | ||
4757 | /** | ||
4758 | * sfp_parse_port() - Parse the EEPROM base ID, setting the port type | ||
4759 | * @bus: a pointer to the &struct sfp_bus structure for the sfp module | ||
4760 | @@ -233,6 +305,9 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id, | ||
4761 | phylink_set(modes, 1000baseX_Full); | ||
4762 | } | ||
4763 | |||
4764 | + if (bus->sfp_quirk) | ||
4765 | + bus->sfp_quirk->modes(id, modes); | ||
4766 | + | ||
4767 | bitmap_or(support, support, modes, __ETHTOOL_LINK_MODE_MASK_NBITS); | ||
4768 | |||
4769 | phylink_set(support, Autoneg); | ||
4770 | @@ -553,6 +628,8 @@ int sfp_module_insert(struct sfp_bus *bus, const struct sfp_eeprom_id *id) | ||
4771 | const struct sfp_upstream_ops *ops = sfp_get_upstream_ops(bus); | ||
4772 | int ret = 0; | ||
4773 | |||
4774 | + bus->sfp_quirk = sfp_lookup_quirk(id); | ||
4775 | + | ||
4776 | if (ops && ops->module_insert) | ||
4777 | ret = ops->module_insert(bus->upstream, id); | ||
4778 | |||
4779 | @@ -566,6 +643,8 @@ void sfp_module_remove(struct sfp_bus *bus) | ||
4780 | |||
4781 | if (ops && ops->module_remove) | ||
4782 | ops->module_remove(bus->upstream); | ||
4783 | + | ||
4784 | + bus->sfp_quirk = NULL; | ||
4785 | } | ||
4786 | EXPORT_SYMBOL_GPL(sfp_module_remove); | ||
4787 | |||
4788 | diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c | ||
4789 | index 4a2c7355be63..e57d59b0a7ae 100644 | ||
4790 | --- a/drivers/net/usb/qmi_wwan.c | ||
4791 | +++ b/drivers/net/usb/qmi_wwan.c | ||
4792 | @@ -1370,6 +1370,7 @@ static const struct usb_device_id products[] = { | ||
4793 | {QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */ | ||
4794 | {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */ | ||
4795 | {QMI_QUIRK_SET_DTR(0x2c7c, 0x0191, 4)}, /* Quectel EG91 */ | ||
4796 | + {QMI_QUIRK_SET_DTR(0x2c7c, 0x0195, 4)}, /* Quectel EG95 */ | ||
4797 | {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */ | ||
4798 | {QMI_QUIRK_SET_DTR(0x2cb7, 0x0104, 4)}, /* Fibocom NL678 series */ | ||
4799 | {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */ | ||
4800 | diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c | ||
4801 | index c34a6df712ad..26ddb4cc675a 100644 | ||
4802 | --- a/drivers/of/of_mdio.c | ||
4803 | +++ b/drivers/of/of_mdio.c | ||
4804 | @@ -265,10 +265,15 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) | ||
4805 | child, addr); | ||
4806 | |||
4807 | if (of_mdiobus_child_is_phy(child)) { | ||
4808 | + /* -ENODEV is the return code that PHYLIB has | ||
4809 | + * standardized on to indicate that bus | ||
4810 | + * scanning should continue. | ||
4811 | + */ | ||
4812 | rc = of_mdiobus_register_phy(mdio, child, addr); | ||
4813 | - if (rc && rc != -ENODEV) | ||
4814 | + if (!rc) | ||
4815 | + break; | ||
4816 | + if (rc != -ENODEV) | ||
4817 | goto unregister; | ||
4818 | - break; | ||
4819 | } | ||
4820 | } | ||
4821 | } | ||
4822 | diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c | ||
4823 | index 689f0280c038..08f7b1ed8c62 100644 | ||
4824 | --- a/drivers/pci/pci.c | ||
4825 | +++ b/drivers/pci/pci.c | ||
4826 | @@ -802,7 +802,9 @@ static inline bool platform_pci_need_resume(struct pci_dev *dev) | ||
4827 | |||
4828 | static inline bool platform_pci_bridge_d3(struct pci_dev *dev) | ||
4829 | { | ||
4830 | - return pci_platform_pm ? pci_platform_pm->bridge_d3(dev) : false; | ||
4831 | + if (pci_platform_pm && pci_platform_pm->bridge_d3) | ||
4832 | + return pci_platform_pm->bridge_d3(dev); | ||
4833 | + return false; | ||
4834 | } | ||
4835 | |||
4836 | /** | ||
4837 | diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c | ||
4838 | index 856927382248..e5842e48a5e0 100644 | ||
4839 | --- a/drivers/phy/allwinner/phy-sun4i-usb.c | ||
4840 | +++ b/drivers/phy/allwinner/phy-sun4i-usb.c | ||
4841 | @@ -545,13 +545,14 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct work_struct *work) | ||
4842 | struct sun4i_usb_phy_data *data = | ||
4843 | container_of(work, struct sun4i_usb_phy_data, detect.work); | ||
4844 | struct phy *phy0 = data->phys[0].phy; | ||
4845 | - struct sun4i_usb_phy *phy = phy_get_drvdata(phy0); | ||
4846 | + struct sun4i_usb_phy *phy; | ||
4847 | bool force_session_end, id_notify = false, vbus_notify = false; | ||
4848 | int id_det, vbus_det; | ||
4849 | |||
4850 | - if (phy0 == NULL) | ||
4851 | + if (!phy0) | ||
4852 | return; | ||
4853 | |||
4854 | + phy = phy_get_drvdata(phy0); | ||
4855 | id_det = sun4i_usb_phy0_get_id_det(data); | ||
4856 | vbus_det = sun4i_usb_phy0_get_vbus_det(data); | ||
4857 | |||
4858 | diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig | ||
4859 | index 90cf4691b8c3..9ea30fcb4428 100644 | ||
4860 | --- a/drivers/scsi/Kconfig | ||
4861 | +++ b/drivers/scsi/Kconfig | ||
4862 | @@ -114,15 +114,6 @@ config BLK_DEV_SR | ||
4863 | <file:Documentation/scsi/scsi.txt>. | ||
4864 | The module will be called sr_mod. | ||
4865 | |||
4866 | -config BLK_DEV_SR_VENDOR | ||
4867 | - bool "Enable vendor-specific extensions (for SCSI CDROM)" | ||
4868 | - depends on BLK_DEV_SR | ||
4869 | - help | ||
4870 | - This enables the usage of vendor specific SCSI commands. This is | ||
4871 | - required to support multisession CDs with old NEC/TOSHIBA cdrom | ||
4872 | - drives (and HP Writers). If you have such a drive and get the first | ||
4873 | - session only, try saying Y here; everybody else says N. | ||
4874 | - | ||
4875 | config CHR_DEV_SG | ||
4876 | tristate "SCSI generic support" | ||
4877 | depends on SCSI | ||
4878 | diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c | ||
4879 | index 3d48024082ba..5bcef9769740 100644 | ||
4880 | --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c | ||
4881 | +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c | ||
4882 | @@ -3787,10 +3787,8 @@ static irqreturn_t megasas_isr_fusion(int irq, void *devp) | ||
4883 | if (instance->mask_interrupts) | ||
4884 | return IRQ_NONE; | ||
4885 | |||
4886 | -#if defined(ENABLE_IRQ_POLL) | ||
4887 | if (irq_context->irq_poll_scheduled) | ||
4888 | return IRQ_HANDLED; | ||
4889 | -#endif | ||
4890 | |||
4891 | if (!instance->msix_vectors) { | ||
4892 | mfiStatus = instance->instancet->clear_intr(instance); | ||
4893 | diff --git a/drivers/scsi/sr_vendor.c b/drivers/scsi/sr_vendor.c | ||
4894 | index e3b0ce25162b..b9db2ec6d036 100644 | ||
4895 | --- a/drivers/scsi/sr_vendor.c | ||
4896 | +++ b/drivers/scsi/sr_vendor.c | ||
4897 | @@ -66,9 +66,6 @@ | ||
4898 | |||
4899 | void sr_vendor_init(Scsi_CD *cd) | ||
4900 | { | ||
4901 | -#ifndef CONFIG_BLK_DEV_SR_VENDOR | ||
4902 | - cd->vendor = VENDOR_SCSI3; | ||
4903 | -#else | ||
4904 | const char *vendor = cd->device->vendor; | ||
4905 | const char *model = cd->device->model; | ||
4906 | |||
4907 | @@ -100,7 +97,6 @@ void sr_vendor_init(Scsi_CD *cd) | ||
4908 | cd->vendor = VENDOR_TOSHIBA; | ||
4909 | |||
4910 | } | ||
4911 | -#endif | ||
4912 | } | ||
4913 | |||
4914 | |||
4915 | @@ -114,10 +110,8 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength) | ||
4916 | struct ccs_modesel_head *modesel; | ||
4917 | int rc, density = 0; | ||
4918 | |||
4919 | -#ifdef CONFIG_BLK_DEV_SR_VENDOR | ||
4920 | if (cd->vendor == VENDOR_TOSHIBA) | ||
4921 | density = (blocklength > 2048) ? 0x81 : 0x83; | ||
4922 | -#endif | ||
4923 | |||
4924 | buffer = kmalloc(512, GFP_KERNEL | GFP_DMA); | ||
4925 | if (!buffer) | ||
4926 | @@ -205,7 +199,6 @@ int sr_cd_check(struct cdrom_device_info *cdi) | ||
4927 | } | ||
4928 | break; | ||
4929 | |||
4930 | -#ifdef CONFIG_BLK_DEV_SR_VENDOR | ||
4931 | case VENDOR_NEC:{ | ||
4932 | unsigned long min, sec, frame; | ||
4933 | cgc.cmd[0] = 0xde; | ||
4934 | @@ -298,7 +291,6 @@ int sr_cd_check(struct cdrom_device_info *cdi) | ||
4935 | sector = buffer[11] + (buffer[10] << 8) + | ||
4936 | (buffer[9] << 16) + (buffer[8] << 24); | ||
4937 | break; | ||
4938 | -#endif /* CONFIG_BLK_DEV_SR_VENDOR */ | ||
4939 | |||
4940 | default: | ||
4941 | /* should not happen */ | ||
4942 | diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c | ||
4943 | index 526e3215d8fe..63ee96eb58c6 100644 | ||
4944 | --- a/drivers/slimbus/core.c | ||
4945 | +++ b/drivers/slimbus/core.c | ||
4946 | @@ -283,6 +283,7 @@ EXPORT_SYMBOL_GPL(slim_register_controller); | ||
4947 | /* slim_remove_device: Remove the effect of slim_add_device() */ | ||
4948 | static void slim_remove_device(struct slim_device *sbdev) | ||
4949 | { | ||
4950 | + of_node_put(sbdev->dev.of_node); | ||
4951 | device_unregister(&sbdev->dev); | ||
4952 | } | ||
4953 | |||
4954 | diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c | ||
4955 | index e278fc11fe5c..0ba1f465db12 100644 | ||
4956 | --- a/drivers/soc/qcom/rpmh-rsc.c | ||
4957 | +++ b/drivers/soc/qcom/rpmh-rsc.c | ||
4958 | @@ -148,7 +148,7 @@ int rpmh_rsc_invalidate(struct rsc_drv *drv) | ||
4959 | static struct tcs_group *get_tcs_for_msg(struct rsc_drv *drv, | ||
4960 | const struct tcs_request *msg) | ||
4961 | { | ||
4962 | - int type, ret; | ||
4963 | + int type; | ||
4964 | struct tcs_group *tcs; | ||
4965 | |||
4966 | switch (msg->state) { | ||
4967 | @@ -169,19 +169,10 @@ static struct tcs_group *get_tcs_for_msg(struct rsc_drv *drv, | ||
4968 | * If we are making an active request on a RSC that does not have a | ||
4969 | * dedicated TCS for active state use, then re-purpose a wake TCS to | ||
4970 | * send active votes. | ||
4971 | - * NOTE: The driver must be aware that this RSC does not have a | ||
4972 | - * dedicated AMC, and therefore would invalidate the sleep and wake | ||
4973 | - * TCSes before making an active state request. | ||
4974 | */ | ||
4975 | tcs = get_tcs_of_type(drv, type); | ||
4976 | - if (msg->state == RPMH_ACTIVE_ONLY_STATE && !tcs->num_tcs) { | ||
4977 | + if (msg->state == RPMH_ACTIVE_ONLY_STATE && !tcs->num_tcs) | ||
4978 | tcs = get_tcs_of_type(drv, WAKE_TCS); | ||
4979 | - if (tcs->num_tcs) { | ||
4980 | - ret = rpmh_rsc_invalidate(drv); | ||
4981 | - if (ret) | ||
4982 | - return ERR_PTR(ret); | ||
4983 | - } | ||
4984 | - } | ||
4985 | |||
4986 | return tcs; | ||
4987 | } | ||
4988 | @@ -201,6 +192,42 @@ static const struct tcs_request *get_req_from_tcs(struct rsc_drv *drv, | ||
4989 | return NULL; | ||
4990 | } | ||
4991 | |||
4992 | +static void __tcs_set_trigger(struct rsc_drv *drv, int tcs_id, bool trigger) | ||
4993 | +{ | ||
4994 | + u32 enable; | ||
4995 | + | ||
4996 | + /* | ||
4997 | + * HW req: Clear the DRV_CONTROL and enable TCS again | ||
4998 | + * While clearing ensure that the AMC mode trigger is cleared | ||
4999 | + * and then the mode enable is cleared. | ||
5000 | + */ | ||
5001 | + enable = read_tcs_reg(drv, RSC_DRV_CONTROL, tcs_id, 0); | ||
5002 | + enable &= ~TCS_AMC_MODE_TRIGGER; | ||
5003 | + write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable); | ||
5004 | + enable &= ~TCS_AMC_MODE_ENABLE; | ||
5005 | + write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable); | ||
5006 | + | ||
5007 | + if (trigger) { | ||
5008 | + /* Enable the AMC mode on the TCS and then trigger the TCS */ | ||
5009 | + enable = TCS_AMC_MODE_ENABLE; | ||
5010 | + write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable); | ||
5011 | + enable |= TCS_AMC_MODE_TRIGGER; | ||
5012 | + write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable); | ||
5013 | + } | ||
5014 | +} | ||
5015 | + | ||
5016 | +static void enable_tcs_irq(struct rsc_drv *drv, int tcs_id, bool enable) | ||
5017 | +{ | ||
5018 | + u32 data; | ||
5019 | + | ||
5020 | + data = read_tcs_reg(drv, RSC_DRV_IRQ_ENABLE, 0, 0); | ||
5021 | + if (enable) | ||
5022 | + data |= BIT(tcs_id); | ||
5023 | + else | ||
5024 | + data &= ~BIT(tcs_id); | ||
5025 | + write_tcs_reg(drv, RSC_DRV_IRQ_ENABLE, 0, data); | ||
5026 | +} | ||
5027 | + | ||
5028 | /** | ||
5029 | * tcs_tx_done: TX Done interrupt handler | ||
5030 | */ | ||
5031 | @@ -237,6 +264,14 @@ static irqreturn_t tcs_tx_done(int irq, void *p) | ||
5032 | } | ||
5033 | |||
5034 | trace_rpmh_tx_done(drv, i, req, err); | ||
5035 | + | ||
5036 | + /* | ||
5037 | + * If wake tcs was re-purposed for sending active | ||
5038 | + * votes, clear AMC trigger & enable modes and | ||
5039 | + * disable interrupt for this TCS | ||
5040 | + */ | ||
5041 | + if (!drv->tcs[ACTIVE_TCS].num_tcs) | ||
5042 | + __tcs_set_trigger(drv, i, false); | ||
5043 | skip: | ||
5044 | /* Reclaim the TCS */ | ||
5045 | write_tcs_reg(drv, RSC_DRV_CMD_ENABLE, i, 0); | ||
5046 | @@ -244,6 +279,13 @@ skip: | ||
5047 | write_tcs_reg(drv, RSC_DRV_IRQ_CLEAR, 0, BIT(i)); | ||
5048 | spin_lock(&drv->lock); | ||
5049 | clear_bit(i, drv->tcs_in_use); | ||
5050 | + /* | ||
5051 | + * Disable interrupt for WAKE TCS to avoid being | ||
5052 | + * spammed with interrupts coming when the solver | ||
5053 | + * sends its wake votes. | ||
5054 | + */ | ||
5055 | + if (!drv->tcs[ACTIVE_TCS].num_tcs) | ||
5056 | + enable_tcs_irq(drv, i, false); | ||
5057 | spin_unlock(&drv->lock); | ||
5058 | if (req) | ||
5059 | rpmh_tx_done(req, err); | ||
5060 | @@ -285,28 +327,6 @@ static void __tcs_buffer_write(struct rsc_drv *drv, int tcs_id, int cmd_id, | ||
5061 | write_tcs_reg(drv, RSC_DRV_CMD_ENABLE, tcs_id, cmd_enable); | ||
5062 | } | ||
5063 | |||
5064 | -static void __tcs_trigger(struct rsc_drv *drv, int tcs_id) | ||
5065 | -{ | ||
5066 | - u32 enable; | ||
5067 | - | ||
5068 | - /* | ||
5069 | - * HW req: Clear the DRV_CONTROL and enable TCS again | ||
5070 | - * While clearing ensure that the AMC mode trigger is cleared | ||
5071 | - * and then the mode enable is cleared. | ||
5072 | - */ | ||
5073 | - enable = read_tcs_reg(drv, RSC_DRV_CONTROL, tcs_id, 0); | ||
5074 | - enable &= ~TCS_AMC_MODE_TRIGGER; | ||
5075 | - write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable); | ||
5076 | - enable &= ~TCS_AMC_MODE_ENABLE; | ||
5077 | - write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable); | ||
5078 | - | ||
5079 | - /* Enable the AMC mode on the TCS and then trigger the TCS */ | ||
5080 | - enable = TCS_AMC_MODE_ENABLE; | ||
5081 | - write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable); | ||
5082 | - enable |= TCS_AMC_MODE_TRIGGER; | ||
5083 | - write_tcs_reg_sync(drv, RSC_DRV_CONTROL, tcs_id, enable); | ||
5084 | -} | ||
5085 | - | ||
5086 | static int check_for_req_inflight(struct rsc_drv *drv, struct tcs_group *tcs, | ||
5087 | const struct tcs_request *msg) | ||
5088 | { | ||
5089 | @@ -377,10 +397,20 @@ static int tcs_write(struct rsc_drv *drv, const struct tcs_request *msg) | ||
5090 | |||
5091 | tcs->req[tcs_id - tcs->offset] = msg; | ||
5092 | set_bit(tcs_id, drv->tcs_in_use); | ||
5093 | + if (msg->state == RPMH_ACTIVE_ONLY_STATE && tcs->type != ACTIVE_TCS) { | ||
5094 | + /* | ||
5095 | + * Clear previously programmed WAKE commands in selected | ||
5096 | + * repurposed TCS to avoid triggering them. tcs->slots will be | ||
5097 | + * cleaned from rpmh_flush() by invoking rpmh_rsc_invalidate() | ||
5098 | + */ | ||
5099 | + write_tcs_reg_sync(drv, RSC_DRV_CMD_ENABLE, tcs_id, 0); | ||
5100 | + write_tcs_reg_sync(drv, RSC_DRV_CMD_WAIT_FOR_CMPL, tcs_id, 0); | ||
5101 | + enable_tcs_irq(drv, tcs_id, true); | ||
5102 | + } | ||
5103 | spin_unlock(&drv->lock); | ||
5104 | |||
5105 | __tcs_buffer_write(drv, tcs_id, 0, msg); | ||
5106 | - __tcs_trigger(drv, tcs_id); | ||
5107 | + __tcs_set_trigger(drv, tcs_id, true); | ||
5108 | |||
5109 | done_write: | ||
5110 | spin_unlock_irqrestore(&tcs->lock, flags); | ||
5111 | diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c | ||
5112 | index 035091fd44b8..ae2d1590a611 100644 | ||
5113 | --- a/drivers/soc/qcom/rpmh.c | ||
5114 | +++ b/drivers/soc/qcom/rpmh.c | ||
5115 | @@ -119,6 +119,7 @@ static struct cache_req *cache_rpm_request(struct rpmh_ctrlr *ctrlr, | ||
5116 | { | ||
5117 | struct cache_req *req; | ||
5118 | unsigned long flags; | ||
5119 | + u32 old_sleep_val, old_wake_val; | ||
5120 | |||
5121 | spin_lock_irqsave(&ctrlr->cache_lock, flags); | ||
5122 | req = __find_req(ctrlr, cmd->addr); | ||
5123 | @@ -133,26 +134,27 @@ static struct cache_req *cache_rpm_request(struct rpmh_ctrlr *ctrlr, | ||
5124 | |||
5125 | req->addr = cmd->addr; | ||
5126 | req->sleep_val = req->wake_val = UINT_MAX; | ||
5127 | - INIT_LIST_HEAD(&req->list); | ||
5128 | list_add_tail(&req->list, &ctrlr->cache); | ||
5129 | |||
5130 | existing: | ||
5131 | + old_sleep_val = req->sleep_val; | ||
5132 | + old_wake_val = req->wake_val; | ||
5133 | + | ||
5134 | switch (state) { | ||
5135 | case RPMH_ACTIVE_ONLY_STATE: | ||
5136 | - if (req->sleep_val != UINT_MAX) | ||
5137 | - req->wake_val = cmd->data; | ||
5138 | - break; | ||
5139 | case RPMH_WAKE_ONLY_STATE: | ||
5140 | req->wake_val = cmd->data; | ||
5141 | break; | ||
5142 | case RPMH_SLEEP_STATE: | ||
5143 | req->sleep_val = cmd->data; | ||
5144 | break; | ||
5145 | - default: | ||
5146 | - break; | ||
5147 | } | ||
5148 | |||
5149 | - ctrlr->dirty = true; | ||
5150 | + ctrlr->dirty = (req->sleep_val != old_sleep_val || | ||
5151 | + req->wake_val != old_wake_val) && | ||
5152 | + req->sleep_val != UINT_MAX && | ||
5153 | + req->wake_val != UINT_MAX; | ||
5154 | + | ||
5155 | unlock: | ||
5156 | spin_unlock_irqrestore(&ctrlr->cache_lock, flags); | ||
5157 | |||
5158 | @@ -287,6 +289,7 @@ static void cache_batch(struct rpmh_ctrlr *ctrlr, struct batch_cache_req *req) | ||
5159 | |||
5160 | spin_lock_irqsave(&ctrlr->cache_lock, flags); | ||
5161 | list_add_tail(&req->list, &ctrlr->batch_cache); | ||
5162 | + ctrlr->dirty = true; | ||
5163 | spin_unlock_irqrestore(&ctrlr->cache_lock, flags); | ||
5164 | } | ||
5165 | |||
5166 | @@ -314,18 +317,6 @@ static int flush_batch(struct rpmh_ctrlr *ctrlr) | ||
5167 | return ret; | ||
5168 | } | ||
5169 | |||
5170 | -static void invalidate_batch(struct rpmh_ctrlr *ctrlr) | ||
5171 | -{ | ||
5172 | - struct batch_cache_req *req, *tmp; | ||
5173 | - unsigned long flags; | ||
5174 | - | ||
5175 | - spin_lock_irqsave(&ctrlr->cache_lock, flags); | ||
5176 | - list_for_each_entry_safe(req, tmp, &ctrlr->batch_cache, list) | ||
5177 | - kfree(req); | ||
5178 | - INIT_LIST_HEAD(&ctrlr->batch_cache); | ||
5179 | - spin_unlock_irqrestore(&ctrlr->cache_lock, flags); | ||
5180 | -} | ||
5181 | - | ||
5182 | /** | ||
5183 | * rpmh_write_batch: Write multiple sets of RPMH commands and wait for the | ||
5184 | * batch to finish. | ||
5185 | @@ -465,6 +456,13 @@ int rpmh_flush(const struct device *dev) | ||
5186 | return 0; | ||
5187 | } | ||
5188 | |||
5189 | + /* Invalidate the TCSes first to avoid stale data */ | ||
5190 | + do { | ||
5191 | + ret = rpmh_rsc_invalidate(ctrlr_to_drv(ctrlr)); | ||
5192 | + } while (ret == -EAGAIN); | ||
5193 | + if (ret) | ||
5194 | + return ret; | ||
5195 | + | ||
5196 | /* First flush the cached batch requests */ | ||
5197 | ret = flush_batch(ctrlr); | ||
5198 | if (ret) | ||
5199 | @@ -496,25 +494,25 @@ int rpmh_flush(const struct device *dev) | ||
5200 | EXPORT_SYMBOL(rpmh_flush); | ||
5201 | |||
5202 | /** | ||
5203 | - * rpmh_invalidate: Invalidate all sleep and active sets | ||
5204 | - * sets. | ||
5205 | + * rpmh_invalidate: Invalidate sleep and wake sets in batch_cache | ||
5206 | * | ||
5207 | * @dev: The device making the request | ||
5208 | * | ||
5209 | - * Invalidate the sleep and active values in the TCS blocks. | ||
5210 | + * Invalidate the sleep and wake values in batch_cache. | ||
5211 | */ | ||
5212 | int rpmh_invalidate(const struct device *dev) | ||
5213 | { | ||
5214 | struct rpmh_ctrlr *ctrlr = get_rpmh_ctrlr(dev); | ||
5215 | - int ret; | ||
5216 | + struct batch_cache_req *req, *tmp; | ||
5217 | + unsigned long flags; | ||
5218 | |||
5219 | - invalidate_batch(ctrlr); | ||
5220 | + spin_lock_irqsave(&ctrlr->cache_lock, flags); | ||
5221 | + list_for_each_entry_safe(req, tmp, &ctrlr->batch_cache, list) | ||
5222 | + kfree(req); | ||
5223 | + INIT_LIST_HEAD(&ctrlr->batch_cache); | ||
5224 | ctrlr->dirty = true; | ||
5225 | + spin_unlock_irqrestore(&ctrlr->cache_lock, flags); | ||
5226 | |||
5227 | - do { | ||
5228 | - ret = rpmh_rsc_invalidate(ctrlr_to_drv(ctrlr)); | ||
5229 | - } while (ret == -EAGAIN); | ||
5230 | - | ||
5231 | - return ret; | ||
5232 | + return 0; | ||
5233 | } | ||
5234 | EXPORT_SYMBOL(rpmh_invalidate); | ||
5235 | diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c | ||
5236 | index a39ea5061dc5..176696f8f38d 100644 | ||
5237 | --- a/drivers/soc/qcom/socinfo.c | ||
5238 | +++ b/drivers/soc/qcom/socinfo.c | ||
5239 | @@ -428,6 +428,8 @@ static int qcom_socinfo_probe(struct platform_device *pdev) | ||
5240 | qs->attr.family = "Snapdragon"; | ||
5241 | qs->attr.machine = socinfo_machine(&pdev->dev, | ||
5242 | le32_to_cpu(info->id)); | ||
5243 | + qs->attr.soc_id = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u", | ||
5244 | + le32_to_cpu(info->id)); | ||
5245 | qs->attr.revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u.%u", | ||
5246 | SOCINFO_MAJOR(le32_to_cpu(info->ver)), | ||
5247 | SOCINFO_MINOR(le32_to_cpu(info->ver))); | ||
5248 | diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c | ||
5249 | index d1839707128a..243af8198d1c 100644 | ||
5250 | --- a/drivers/soundwire/intel.c | ||
5251 | +++ b/drivers/soundwire/intel.c | ||
5252 | @@ -842,8 +842,9 @@ static int intel_create_dai(struct sdw_cdns *cdns, | ||
5253 | |||
5254 | /* TODO: Read supported rates/formats from hardware */ | ||
5255 | for (i = off; i < (off + num); i++) { | ||
5256 | - dais[i].name = kasprintf(GFP_KERNEL, "SDW%d Pin%d", | ||
5257 | - cdns->instance, i); | ||
5258 | + dais[i].name = devm_kasprintf(cdns->dev, GFP_KERNEL, | ||
5259 | + "SDW%d Pin%d", | ||
5260 | + cdns->instance, i); | ||
5261 | if (!dais[i].name) | ||
5262 | return -ENOMEM; | ||
5263 | |||
5264 | diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c | ||
5265 | index 3e0e27731922..c7560d7d1627 100644 | ||
5266 | --- a/drivers/spi/spi-fsl-dspi.c | ||
5267 | +++ b/drivers/spi/spi-fsl-dspi.c | ||
5268 | @@ -1184,20 +1184,7 @@ static int dspi_remove(struct platform_device *pdev) | ||
5269 | |||
5270 | static void dspi_shutdown(struct platform_device *pdev) | ||
5271 | { | ||
5272 | - struct spi_controller *ctlr = platform_get_drvdata(pdev); | ||
5273 | - struct fsl_dspi *dspi = spi_controller_get_devdata(ctlr); | ||
5274 | - | ||
5275 | - /* Disable RX and TX */ | ||
5276 | - regmap_update_bits(dspi->regmap, SPI_MCR, | ||
5277 | - SPI_MCR_DIS_TXF | SPI_MCR_DIS_RXF, | ||
5278 | - SPI_MCR_DIS_TXF | SPI_MCR_DIS_RXF); | ||
5279 | - | ||
5280 | - /* Stop Running */ | ||
5281 | - regmap_update_bits(dspi->regmap, SPI_MCR, SPI_MCR_HALT, SPI_MCR_HALT); | ||
5282 | - | ||
5283 | - dspi_release_dma(dspi); | ||
5284 | - clk_disable_unprepare(dspi->clk); | ||
5285 | - spi_unregister_controller(dspi->ctlr); | ||
5286 | + dspi_remove(pdev); | ||
5287 | } | ||
5288 | |||
5289 | static struct platform_driver fsl_dspi_driver = { | ||
5290 | diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c | ||
5291 | index 9613cfe3c0a2..09f983524d51 100644 | ||
5292 | --- a/drivers/spi/spi-sprd-adi.c | ||
5293 | +++ b/drivers/spi/spi-sprd-adi.c | ||
5294 | @@ -384,9 +384,9 @@ static int sprd_adi_restart_handler(struct notifier_block *this, | ||
5295 | sprd_adi_write(sadi, sadi->slave_pbase + REG_WDG_LOCK, WDG_UNLOCK_KEY); | ||
5296 | |||
5297 | /* Load the watchdog timeout value, 50ms is always enough. */ | ||
5298 | + sprd_adi_write(sadi, sadi->slave_pbase + REG_WDG_LOAD_HIGH, 0); | ||
5299 | sprd_adi_write(sadi, sadi->slave_pbase + REG_WDG_LOAD_LOW, | ||
5300 | WDG_LOAD_VAL & WDG_LOAD_MASK); | ||
5301 | - sprd_adi_write(sadi, sadi->slave_pbase + REG_WDG_LOAD_HIGH, 0); | ||
5302 | |||
5303 | /* Start the watchdog to reset system */ | ||
5304 | sprd_adi_read(sadi, sadi->slave_pbase + REG_WDG_CTRL, &val); | ||
5305 | diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c | ||
5306 | index ec7967be9e2f..956df79035d5 100644 | ||
5307 | --- a/drivers/spi/spi-sun6i.c | ||
5308 | +++ b/drivers/spi/spi-sun6i.c | ||
5309 | @@ -198,7 +198,7 @@ static int sun6i_spi_transfer_one(struct spi_master *master, | ||
5310 | struct spi_transfer *tfr) | ||
5311 | { | ||
5312 | struct sun6i_spi *sspi = spi_master_get_devdata(master); | ||
5313 | - unsigned int mclk_rate, div, timeout; | ||
5314 | + unsigned int mclk_rate, div, div_cdr1, div_cdr2, timeout; | ||
5315 | unsigned int start, end, tx_time; | ||
5316 | unsigned int trig_level; | ||
5317 | unsigned int tx_len = 0; | ||
5318 | @@ -287,14 +287,12 @@ static int sun6i_spi_transfer_one(struct spi_master *master, | ||
5319 | * First try CDR2, and if we can't reach the expected | ||
5320 | * frequency, fall back to CDR1. | ||
5321 | */ | ||
5322 | - div = mclk_rate / (2 * tfr->speed_hz); | ||
5323 | - if (div <= (SUN6I_CLK_CTL_CDR2_MASK + 1)) { | ||
5324 | - if (div > 0) | ||
5325 | - div--; | ||
5326 | - | ||
5327 | - reg = SUN6I_CLK_CTL_CDR2(div) | SUN6I_CLK_CTL_DRS; | ||
5328 | + div_cdr1 = DIV_ROUND_UP(mclk_rate, tfr->speed_hz); | ||
5329 | + div_cdr2 = DIV_ROUND_UP(div_cdr1, 2); | ||
5330 | + if (div_cdr2 <= (SUN6I_CLK_CTL_CDR2_MASK + 1)) { | ||
5331 | + reg = SUN6I_CLK_CTL_CDR2(div_cdr2 - 1) | SUN6I_CLK_CTL_DRS; | ||
5332 | } else { | ||
5333 | - div = ilog2(mclk_rate) - ilog2(tfr->speed_hz); | ||
5334 | + div = min(SUN6I_CLK_CTL_CDR1_MASK, order_base_2(div_cdr1)); | ||
5335 | reg = SUN6I_CLK_CTL_CDR1(div); | ||
5336 | } | ||
5337 | |||
5338 | diff --git a/drivers/staging/comedi/drivers/addi_apci_1500.c b/drivers/staging/comedi/drivers/addi_apci_1500.c | ||
5339 | index 45ad4ba92f94..689acd69a1b9 100644 | ||
5340 | --- a/drivers/staging/comedi/drivers/addi_apci_1500.c | ||
5341 | +++ b/drivers/staging/comedi/drivers/addi_apci_1500.c | ||
5342 | @@ -456,9 +456,9 @@ static int apci1500_di_cfg_trig(struct comedi_device *dev, | ||
5343 | unsigned int lo_mask = data[5] << shift; | ||
5344 | unsigned int chan_mask = hi_mask | lo_mask; | ||
5345 | unsigned int old_mask = (1 << shift) - 1; | ||
5346 | - unsigned int pm = devpriv->pm[trig] & old_mask; | ||
5347 | - unsigned int pt = devpriv->pt[trig] & old_mask; | ||
5348 | - unsigned int pp = devpriv->pp[trig] & old_mask; | ||
5349 | + unsigned int pm; | ||
5350 | + unsigned int pt; | ||
5351 | + unsigned int pp; | ||
5352 | |||
5353 | if (trig > 1) { | ||
5354 | dev_dbg(dev->class_dev, | ||
5355 | @@ -471,6 +471,10 @@ static int apci1500_di_cfg_trig(struct comedi_device *dev, | ||
5356 | return -EINVAL; | ||
5357 | } | ||
5358 | |||
5359 | + pm = devpriv->pm[trig] & old_mask; | ||
5360 | + pt = devpriv->pt[trig] & old_mask; | ||
5361 | + pp = devpriv->pp[trig] & old_mask; | ||
5362 | + | ||
5363 | switch (data[2]) { | ||
5364 | case COMEDI_DIGITAL_TRIG_DISABLE: | ||
5365 | /* clear trigger configuration */ | ||
5366 | diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c | ||
5367 | index 6b9865c786ba..c37886a26712 100644 | ||
5368 | --- a/drivers/thermal/cpu_cooling.c | ||
5369 | +++ b/drivers/thermal/cpu_cooling.c | ||
5370 | @@ -210,11 +210,11 @@ static u32 cpu_power_to_freq(struct cpufreq_cooling_device *cpufreq_cdev, | ||
5371 | int i; | ||
5372 | struct freq_table *freq_table = cpufreq_cdev->freq_table; | ||
5373 | |||
5374 | - for (i = 1; i <= cpufreq_cdev->max_level; i++) | ||
5375 | - if (power > freq_table[i].power) | ||
5376 | + for (i = 0; i < cpufreq_cdev->max_level; i++) | ||
5377 | + if (power >= freq_table[i].power) | ||
5378 | break; | ||
5379 | |||
5380 | - return freq_table[i - 1].frequency; | ||
5381 | + return freq_table[i].frequency; | ||
5382 | } | ||
5383 | |||
5384 | /** | ||
5385 | diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c | ||
5386 | index bb6754a5342c..85511c1160b7 100644 | ||
5387 | --- a/drivers/thermal/imx_thermal.c | ||
5388 | +++ b/drivers/thermal/imx_thermal.c | ||
5389 | @@ -656,7 +656,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match); | ||
5390 | static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) | ||
5391 | { | ||
5392 | struct device_node *np; | ||
5393 | - int ret; | ||
5394 | + int ret = 0; | ||
5395 | |||
5396 | data->policy = cpufreq_cpu_get(0); | ||
5397 | if (!data->policy) { | ||
5398 | @@ -671,11 +671,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) | ||
5399 | if (IS_ERR(data->cdev)) { | ||
5400 | ret = PTR_ERR(data->cdev); | ||
5401 | cpufreq_cpu_put(data->policy); | ||
5402 | - return ret; | ||
5403 | } | ||
5404 | } | ||
5405 | |||
5406 | - return 0; | ||
5407 | + of_node_put(np); | ||
5408 | + | ||
5409 | + return ret; | ||
5410 | } | ||
5411 | |||
5412 | static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data) | ||
5413 | diff --git a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c b/drivers/thermal/intel/int340x_thermal/int3403_thermal.c | ||
5414 | index a7bbd8584ae2..e7b6f6f256a9 100644 | ||
5415 | --- a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c | ||
5416 | +++ b/drivers/thermal/intel/int340x_thermal/int3403_thermal.c | ||
5417 | @@ -74,7 +74,7 @@ static void int3403_notify(acpi_handle handle, | ||
5418 | THERMAL_TRIP_CHANGED); | ||
5419 | break; | ||
5420 | default: | ||
5421 | - dev_err(&priv->pdev->dev, "Unsupported event [0x%x]\n", event); | ||
5422 | + dev_dbg(&priv->pdev->dev, "Unsupported event [0x%x]\n", event); | ||
5423 | break; | ||
5424 | } | ||
5425 | } | ||
5426 | diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c | ||
5427 | index d6fabd0a7da6..2783973b101c 100644 | ||
5428 | --- a/drivers/thermal/mtk_thermal.c | ||
5429 | +++ b/drivers/thermal/mtk_thermal.c | ||
5430 | @@ -594,8 +594,7 @@ static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank) | ||
5431 | u32 raw; | ||
5432 | |||
5433 | for (i = 0; i < conf->bank_data[bank->id].num_sensors; i++) { | ||
5434 | - raw = readl(mt->thermal_base + | ||
5435 | - conf->msr[conf->bank_data[bank->id].sensors[i]]); | ||
5436 | + raw = readl(mt->thermal_base + conf->msr[i]); | ||
5437 | |||
5438 | temp = raw_to_mcelsius(mt, | ||
5439 | conf->bank_data[bank->id].sensors[i], | ||
5440 | @@ -736,8 +735,7 @@ static void mtk_thermal_init_bank(struct mtk_thermal *mt, int num, | ||
5441 | |||
5442 | for (i = 0; i < conf->bank_data[num].num_sensors; i++) | ||
5443 | writel(conf->sensor_mux_values[conf->bank_data[num].sensors[i]], | ||
5444 | - mt->thermal_base + | ||
5445 | - conf->adcpnp[conf->bank_data[num].sensors[i]]); | ||
5446 | + mt->thermal_base + conf->adcpnp[i]); | ||
5447 | |||
5448 | writel((1 << conf->bank_data[num].num_sensors) - 1, | ||
5449 | controller_base + TEMP_MONCTL0); | ||
5450 | diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c | ||
5451 | index e34525970682..5d483e996514 100644 | ||
5452 | --- a/drivers/tty/serial/mxs-auart.c | ||
5453 | +++ b/drivers/tty/serial/mxs-auart.c | ||
5454 | @@ -1701,21 +1701,21 @@ static int mxs_auart_probe(struct platform_device *pdev) | ||
5455 | irq = platform_get_irq(pdev, 0); | ||
5456 | if (irq < 0) { | ||
5457 | ret = irq; | ||
5458 | - goto out_disable_clks; | ||
5459 | + goto out_iounmap; | ||
5460 | } | ||
5461 | |||
5462 | s->port.irq = irq; | ||
5463 | ret = devm_request_irq(&pdev->dev, irq, mxs_auart_irq_handle, 0, | ||
5464 | dev_name(&pdev->dev), s); | ||
5465 | if (ret) | ||
5466 | - goto out_disable_clks; | ||
5467 | + goto out_iounmap; | ||
5468 | |||
5469 | platform_set_drvdata(pdev, s); | ||
5470 | |||
5471 | ret = mxs_auart_init_gpios(s, &pdev->dev); | ||
5472 | if (ret) { | ||
5473 | dev_err(&pdev->dev, "Failed to initialize GPIOs.\n"); | ||
5474 | - goto out_disable_clks; | ||
5475 | + goto out_iounmap; | ||
5476 | } | ||
5477 | |||
5478 | /* | ||
5479 | @@ -1723,7 +1723,7 @@ static int mxs_auart_probe(struct platform_device *pdev) | ||
5480 | */ | ||
5481 | ret = mxs_auart_request_gpio_irq(s); | ||
5482 | if (ret) | ||
5483 | - goto out_disable_clks; | ||
5484 | + goto out_iounmap; | ||
5485 | |||
5486 | auart_port[s->port.line] = s; | ||
5487 | |||
5488 | @@ -1749,6 +1749,9 @@ out_free_qpio_irq: | ||
5489 | mxs_auart_free_gpio_irq(s); | ||
5490 | auart_port[pdev->id] = NULL; | ||
5491 | |||
5492 | +out_iounmap: | ||
5493 | + iounmap(s->port.membase); | ||
5494 | + | ||
5495 | out_disable_clks: | ||
5496 | if (is_asm9260_auart(s)) { | ||
5497 | clk_disable_unprepare(s->clk); | ||
5498 | @@ -1764,6 +1767,7 @@ static int mxs_auart_remove(struct platform_device *pdev) | ||
5499 | uart_remove_one_port(&auart_driver, &s->port); | ||
5500 | auart_port[pdev->id] = NULL; | ||
5501 | mxs_auart_free_gpio_irq(s); | ||
5502 | + iounmap(s->port.membase); | ||
5503 | if (is_asm9260_auart(s)) { | ||
5504 | clk_disable_unprepare(s->clk); | ||
5505 | clk_disable_unprepare(s->clk_ahb); | ||
5506 | diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c | ||
5507 | index 3cb9aacfe0b2..fe098cf14e6a 100644 | ||
5508 | --- a/drivers/tty/serial/xilinx_uartps.c | ||
5509 | +++ b/drivers/tty/serial/xilinx_uartps.c | ||
5510 | @@ -1445,7 +1445,6 @@ static int cdns_uart_probe(struct platform_device *pdev) | ||
5511 | cdns_uart_uart_driver.nr = CDNS_UART_NR_PORTS; | ||
5512 | #ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE | ||
5513 | cdns_uart_uart_driver.cons = &cdns_uart_console; | ||
5514 | - cdns_uart_console.index = id; | ||
5515 | #endif | ||
5516 | |||
5517 | rc = uart_register_driver(&cdns_uart_uart_driver); | ||
5518 | diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c | ||
5519 | index 1303b165055b..538adf9c47bb 100644 | ||
5520 | --- a/drivers/uio/uio_pdrv_genirq.c | ||
5521 | +++ b/drivers/uio/uio_pdrv_genirq.c | ||
5522 | @@ -152,9 +152,9 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev) | ||
5523 | priv->pdev = pdev; | ||
5524 | |||
5525 | if (!uioinfo->irq) { | ||
5526 | - ret = platform_get_irq(pdev, 0); | ||
5527 | + ret = platform_get_irq_optional(pdev, 0); | ||
5528 | uioinfo->irq = ret; | ||
5529 | - if (ret == -ENXIO && pdev->dev.of_node) | ||
5530 | + if (ret == -ENXIO) | ||
5531 | uioinfo->irq = UIO_IRQ_NONE; | ||
5532 | else if (ret < 0) { | ||
5533 | dev_err(&pdev->dev, "failed to get IRQ\n"); | ||
5534 | diff --git a/drivers/usb/c67x00/c67x00-sched.c b/drivers/usb/c67x00/c67x00-sched.c | ||
5535 | index 633c52de3bb3..9865750bc31e 100644 | ||
5536 | --- a/drivers/usb/c67x00/c67x00-sched.c | ||
5537 | +++ b/drivers/usb/c67x00/c67x00-sched.c | ||
5538 | @@ -486,7 +486,7 @@ c67x00_giveback_urb(struct c67x00_hcd *c67x00, struct urb *urb, int status) | ||
5539 | c67x00_release_urb(c67x00, urb); | ||
5540 | usb_hcd_unlink_urb_from_ep(c67x00_hcd_to_hcd(c67x00), urb); | ||
5541 | spin_unlock(&c67x00->lock); | ||
5542 | - usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, urbp->status); | ||
5543 | + usb_hcd_giveback_urb(c67x00_hcd_to_hcd(c67x00), urb, status); | ||
5544 | spin_lock(&c67x00->lock); | ||
5545 | } | ||
5546 | |||
5547 | diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c | ||
5548 | index 98ee575ee500..b7da2a273c45 100644 | ||
5549 | --- a/drivers/usb/chipidea/core.c | ||
5550 | +++ b/drivers/usb/chipidea/core.c | ||
5551 | @@ -1261,6 +1261,29 @@ static void ci_controller_suspend(struct ci_hdrc *ci) | ||
5552 | enable_irq(ci->irq); | ||
5553 | } | ||
5554 | |||
5555 | +/* | ||
5556 | + * Handle the wakeup interrupt triggered by extcon connector | ||
5557 | + * We need to call ci_irq again for extcon since the first | ||
5558 | + * interrupt (wakeup int) only let the controller be out of | ||
5559 | + * low power mode, but not handle any interrupts. | ||
5560 | + */ | ||
5561 | +static void ci_extcon_wakeup_int(struct ci_hdrc *ci) | ||
5562 | +{ | ||
5563 | + struct ci_hdrc_cable *cable_id, *cable_vbus; | ||
5564 | + u32 otgsc = hw_read_otgsc(ci, ~0); | ||
5565 | + | ||
5566 | + cable_id = &ci->platdata->id_extcon; | ||
5567 | + cable_vbus = &ci->platdata->vbus_extcon; | ||
5568 | + | ||
5569 | + if (!IS_ERR(cable_id->edev) && ci->is_otg && | ||
5570 | + (otgsc & OTGSC_IDIE) && (otgsc & OTGSC_IDIS)) | ||
5571 | + ci_irq(ci->irq, ci); | ||
5572 | + | ||
5573 | + if (!IS_ERR(cable_vbus->edev) && ci->is_otg && | ||
5574 | + (otgsc & OTGSC_BSVIE) && (otgsc & OTGSC_BSVIS)) | ||
5575 | + ci_irq(ci->irq, ci); | ||
5576 | +} | ||
5577 | + | ||
5578 | static int ci_controller_resume(struct device *dev) | ||
5579 | { | ||
5580 | struct ci_hdrc *ci = dev_get_drvdata(dev); | ||
5581 | @@ -1293,6 +1316,7 @@ static int ci_controller_resume(struct device *dev) | ||
5582 | enable_irq(ci->irq); | ||
5583 | if (ci_otg_is_fsm_mode(ci)) | ||
5584 | ci_otg_fsm_wakeup_by_srp(ci); | ||
5585 | + ci_extcon_wakeup_int(ci); | ||
5586 | } | ||
5587 | |||
5588 | return 0; | ||
5589 | diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c | ||
5590 | index 15e55808cf4e..4e14c4f7fed7 100644 | ||
5591 | --- a/drivers/usb/dwc2/platform.c | ||
5592 | +++ b/drivers/usb/dwc2/platform.c | ||
5593 | @@ -337,7 +337,8 @@ static void dwc2_driver_shutdown(struct platform_device *dev) | ||
5594 | { | ||
5595 | struct dwc2_hsotg *hsotg = platform_get_drvdata(dev); | ||
5596 | |||
5597 | - disable_irq(hsotg->irq); | ||
5598 | + dwc2_disable_global_interrupts(hsotg); | ||
5599 | + synchronize_irq(hsotg->irq); | ||
5600 | } | ||
5601 | |||
5602 | /** | ||
5603 | diff --git a/drivers/usb/gadget/function/f_uac1_legacy.c b/drivers/usb/gadget/function/f_uac1_legacy.c | ||
5604 | index 6677ae932de0..06ee6e901808 100644 | ||
5605 | --- a/drivers/usb/gadget/function/f_uac1_legacy.c | ||
5606 | +++ b/drivers/usb/gadget/function/f_uac1_legacy.c | ||
5607 | @@ -336,7 +336,9 @@ static int f_audio_out_ep_complete(struct usb_ep *ep, struct usb_request *req) | ||
5608 | |||
5609 | /* Copy buffer is full, add it to the play_queue */ | ||
5610 | if (audio_buf_size - copy_buf->actual < req->actual) { | ||
5611 | + spin_lock_irq(&audio->lock); | ||
5612 | list_add_tail(©_buf->list, &audio->play_queue); | ||
5613 | + spin_unlock_irq(&audio->lock); | ||
5614 | schedule_work(&audio->playback_work); | ||
5615 | copy_buf = f_audio_buffer_alloc(audio_buf_size); | ||
5616 | if (IS_ERR(copy_buf)) | ||
5617 | diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c | ||
5618 | index 58e5b015d40e..bebe814f55e6 100644 | ||
5619 | --- a/drivers/usb/gadget/udc/atmel_usba_udc.c | ||
5620 | +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c | ||
5621 | @@ -870,7 +870,7 @@ static int usba_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req) | ||
5622 | u32 status; | ||
5623 | |||
5624 | DBG(DBG_GADGET | DBG_QUEUE, "ep_dequeue: %s, req %p\n", | ||
5625 | - ep->ep.name, req); | ||
5626 | + ep->ep.name, _req); | ||
5627 | |||
5628 | spin_lock_irqsave(&udc->lock, flags); | ||
5629 | |||
5630 | diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c | ||
5631 | index e9a49007cce4..e4fc3f66d43b 100644 | ||
5632 | --- a/drivers/usb/host/ehci-platform.c | ||
5633 | +++ b/drivers/usb/host/ehci-platform.c | ||
5634 | @@ -455,10 +455,6 @@ static int ehci_platform_resume(struct device *dev) | ||
5635 | |||
5636 | ehci_resume(hcd, priv->reset_on_resume); | ||
5637 | |||
5638 | - pm_runtime_disable(dev); | ||
5639 | - pm_runtime_set_active(dev); | ||
5640 | - pm_runtime_enable(dev); | ||
5641 | - | ||
5642 | if (priv->quirk_poll) | ||
5643 | quirk_poll_init(priv); | ||
5644 | |||
5645 | diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c | ||
5646 | index 4a8456f12a73..7addfc2cbadc 100644 | ||
5647 | --- a/drivers/usb/host/ohci-platform.c | ||
5648 | +++ b/drivers/usb/host/ohci-platform.c | ||
5649 | @@ -299,11 +299,6 @@ static int ohci_platform_resume(struct device *dev) | ||
5650 | } | ||
5651 | |||
5652 | ohci_resume(hcd, false); | ||
5653 | - | ||
5654 | - pm_runtime_disable(dev); | ||
5655 | - pm_runtime_set_active(dev); | ||
5656 | - pm_runtime_enable(dev); | ||
5657 | - | ||
5658 | return 0; | ||
5659 | } | ||
5660 | #endif /* CONFIG_PM_SLEEP */ | ||
5661 | diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c | ||
5662 | index 60d06e9b600f..52c625c02341 100644 | ||
5663 | --- a/drivers/usb/host/xhci-plat.c | ||
5664 | +++ b/drivers/usb/host/xhci-plat.c | ||
5665 | @@ -410,15 +410,7 @@ static int __maybe_unused xhci_plat_resume(struct device *dev) | ||
5666 | if (ret) | ||
5667 | return ret; | ||
5668 | |||
5669 | - ret = xhci_resume(xhci, 0); | ||
5670 | - if (ret) | ||
5671 | - return ret; | ||
5672 | - | ||
5673 | - pm_runtime_disable(dev); | ||
5674 | - pm_runtime_set_active(dev); | ||
5675 | - pm_runtime_enable(dev); | ||
5676 | - | ||
5677 | - return 0; | ||
5678 | + return xhci_resume(xhci, 0); | ||
5679 | } | ||
5680 | |||
5681 | static int __maybe_unused xhci_plat_runtime_suspend(struct device *dev) | ||
5682 | diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c | ||
5683 | index dcdd541b3291..390bc4b25045 100644 | ||
5684 | --- a/drivers/usb/serial/ch341.c | ||
5685 | +++ b/drivers/usb/serial/ch341.c | ||
5686 | @@ -81,6 +81,7 @@ | ||
5687 | |||
5688 | static const struct usb_device_id id_table[] = { | ||
5689 | { USB_DEVICE(0x4348, 0x5523) }, | ||
5690 | + { USB_DEVICE(0x1a86, 0x7522) }, | ||
5691 | { USB_DEVICE(0x1a86, 0x7523) }, | ||
5692 | { USB_DEVICE(0x1a86, 0x5523) }, | ||
5693 | { }, | ||
5694 | diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c | ||
5695 | index 216edd5826ca..ecda82198798 100644 | ||
5696 | --- a/drivers/usb/serial/cypress_m8.c | ||
5697 | +++ b/drivers/usb/serial/cypress_m8.c | ||
5698 | @@ -59,6 +59,7 @@ static const struct usb_device_id id_table_earthmate[] = { | ||
5699 | |||
5700 | static const struct usb_device_id id_table_cyphidcomrs232[] = { | ||
5701 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, | ||
5702 | + { USB_DEVICE(VENDOR_ID_SAI, PRODUCT_ID_CYPHIDCOM) }, | ||
5703 | { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, | ||
5704 | { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) }, | ||
5705 | { } /* Terminating entry */ | ||
5706 | @@ -73,6 +74,7 @@ static const struct usb_device_id id_table_combined[] = { | ||
5707 | { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB) }, | ||
5708 | { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB_LT20) }, | ||
5709 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, | ||
5710 | + { USB_DEVICE(VENDOR_ID_SAI, PRODUCT_ID_CYPHIDCOM) }, | ||
5711 | { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, | ||
5712 | { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) }, | ||
5713 | { USB_DEVICE(VENDOR_ID_DAZZLE, PRODUCT_ID_CA42) }, | ||
5714 | diff --git a/drivers/usb/serial/cypress_m8.h b/drivers/usb/serial/cypress_m8.h | ||
5715 | index 35e223751c0e..16b7410ad057 100644 | ||
5716 | --- a/drivers/usb/serial/cypress_m8.h | ||
5717 | +++ b/drivers/usb/serial/cypress_m8.h | ||
5718 | @@ -25,6 +25,9 @@ | ||
5719 | #define VENDOR_ID_CYPRESS 0x04b4 | ||
5720 | #define PRODUCT_ID_CYPHIDCOM 0x5500 | ||
5721 | |||
5722 | +/* Simply Automated HID->COM UPB PIM (using Cypress PID 0x5500) */ | ||
5723 | +#define VENDOR_ID_SAI 0x17dd | ||
5724 | + | ||
5725 | /* FRWD Dongle - a GPS sports watch */ | ||
5726 | #define VENDOR_ID_FRWD 0x6737 | ||
5727 | #define PRODUCT_ID_CYPHIDCOM_FRWD 0x0001 | ||
5728 | diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c | ||
5729 | index d5bff69b1769..b8dfeb4fb2ed 100644 | ||
5730 | --- a/drivers/usb/serial/iuu_phoenix.c | ||
5731 | +++ b/drivers/usb/serial/iuu_phoenix.c | ||
5732 | @@ -697,14 +697,16 @@ static int iuu_uart_write(struct tty_struct *tty, struct usb_serial_port *port, | ||
5733 | struct iuu_private *priv = usb_get_serial_port_data(port); | ||
5734 | unsigned long flags; | ||
5735 | |||
5736 | - if (count > 256) | ||
5737 | - return -ENOMEM; | ||
5738 | - | ||
5739 | spin_lock_irqsave(&priv->lock, flags); | ||
5740 | |||
5741 | + count = min(count, 256 - priv->writelen); | ||
5742 | + if (count == 0) | ||
5743 | + goto out; | ||
5744 | + | ||
5745 | /* fill the buffer */ | ||
5746 | memcpy(priv->writebuf + priv->writelen, buf, count); | ||
5747 | priv->writelen += count; | ||
5748 | +out: | ||
5749 | spin_unlock_irqrestore(&priv->lock, flags); | ||
5750 | |||
5751 | return count; | ||
5752 | diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c | ||
5753 | index 254a8bbeea67..9b7cee98ea60 100644 | ||
5754 | --- a/drivers/usb/serial/option.c | ||
5755 | +++ b/drivers/usb/serial/option.c | ||
5756 | @@ -245,6 +245,7 @@ static void option_instat_callback(struct urb *urb); | ||
5757 | /* These Quectel products use Quectel's vendor ID */ | ||
5758 | #define QUECTEL_PRODUCT_EC21 0x0121 | ||
5759 | #define QUECTEL_PRODUCT_EC25 0x0125 | ||
5760 | +#define QUECTEL_PRODUCT_EG95 0x0195 | ||
5761 | #define QUECTEL_PRODUCT_BG96 0x0296 | ||
5762 | #define QUECTEL_PRODUCT_EP06 0x0306 | ||
5763 | #define QUECTEL_PRODUCT_EM12 0x0512 | ||
5764 | @@ -1097,6 +1098,8 @@ static const struct usb_device_id option_ids[] = { | ||
5765 | .driver_info = RSVD(4) }, | ||
5766 | { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC25), | ||
5767 | .driver_info = RSVD(4) }, | ||
5768 | + { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95), | ||
5769 | + .driver_info = RSVD(4) }, | ||
5770 | { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), | ||
5771 | .driver_info = RSVD(4) }, | ||
5772 | { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff), | ||
5773 | @@ -2028,6 +2031,9 @@ static const struct usb_device_id option_ids[] = { | ||
5774 | .driver_info = RSVD(4) | RSVD(5) }, | ||
5775 | { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */ | ||
5776 | .driver_info = RSVD(6) }, | ||
5777 | + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */ | ||
5778 | + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */ | ||
5779 | + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */ | ||
5780 | { } /* Terminating entry */ | ||
5781 | }; | ||
5782 | MODULE_DEVICE_TABLE(usb, option_ids); | ||
5783 | diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c | ||
5784 | index 2307b0329aec..95bfdb8ac8a2 100644 | ||
5785 | --- a/drivers/virt/vboxguest/vboxguest_core.c | ||
5786 | +++ b/drivers/virt/vboxguest/vboxguest_core.c | ||
5787 | @@ -1443,7 +1443,7 @@ static int vbg_ioctl_change_guest_capabilities(struct vbg_dev *gdev, | ||
5788 | or_mask = caps->u.in.or_mask; | ||
5789 | not_mask = caps->u.in.not_mask; | ||
5790 | |||
5791 | - if ((or_mask | not_mask) & ~VMMDEV_EVENT_VALID_EVENT_MASK) | ||
5792 | + if ((or_mask | not_mask) & ~VMMDEV_GUEST_CAPABILITIES_MASK) | ||
5793 | return -EINVAL; | ||
5794 | |||
5795 | ret = vbg_set_session_capabilities(gdev, session, or_mask, not_mask, | ||
5796 | @@ -1519,7 +1519,8 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data) | ||
5797 | |||
5798 | /* For VMMDEV_REQUEST hdr->type != VBG_IOCTL_HDR_TYPE_DEFAULT */ | ||
5799 | if (req_no_size == VBG_IOCTL_VMMDEV_REQUEST(0) || | ||
5800 | - req == VBG_IOCTL_VMMDEV_REQUEST_BIG) | ||
5801 | + req == VBG_IOCTL_VMMDEV_REQUEST_BIG || | ||
5802 | + req == VBG_IOCTL_VMMDEV_REQUEST_BIG_ALT) | ||
5803 | return vbg_ioctl_vmmrequest(gdev, session, data); | ||
5804 | |||
5805 | if (hdr->type != VBG_IOCTL_HDR_TYPE_DEFAULT) | ||
5806 | @@ -1557,6 +1558,7 @@ int vbg_core_ioctl(struct vbg_session *session, unsigned int req, void *data) | ||
5807 | case VBG_IOCTL_HGCM_CALL(0): | ||
5808 | return vbg_ioctl_hgcm_call(gdev, session, f32bit, data); | ||
5809 | case VBG_IOCTL_LOG(0): | ||
5810 | + case VBG_IOCTL_LOG_ALT(0): | ||
5811 | return vbg_ioctl_log(data); | ||
5812 | } | ||
5813 | |||
5814 | diff --git a/drivers/virt/vboxguest/vboxguest_core.h b/drivers/virt/vboxguest/vboxguest_core.h | ||
5815 | index 4188c12b839f..77c3a9c8255d 100644 | ||
5816 | --- a/drivers/virt/vboxguest/vboxguest_core.h | ||
5817 | +++ b/drivers/virt/vboxguest/vboxguest_core.h | ||
5818 | @@ -15,6 +15,21 @@ | ||
5819 | #include <linux/vboxguest.h> | ||
5820 | #include "vmmdev.h" | ||
5821 | |||
5822 | +/* | ||
5823 | + * The mainline kernel version (this version) of the vboxguest module | ||
5824 | + * contained a bug where it defined VBGL_IOCTL_VMMDEV_REQUEST_BIG and | ||
5825 | + * VBGL_IOCTL_LOG using _IOC(_IOC_READ | _IOC_WRITE, 'V', ...) instead | ||
5826 | + * of _IO(V, ...) as the out of tree VirtualBox upstream version does. | ||
5827 | + * | ||
5828 | + * These _ALT definitions keep compatibility with the wrong defines the | ||
5829 | + * mainline kernel version used for a while. | ||
5830 | + * Note the VirtualBox userspace bits have always been built against | ||
5831 | + * VirtualBox upstream's headers, so this is likely not necessary. But | ||
5832 | + * we must never break our ABI so we keep these around to be 100% sure. | ||
5833 | + */ | ||
5834 | +#define VBG_IOCTL_VMMDEV_REQUEST_BIG_ALT _IOC(_IOC_READ | _IOC_WRITE, 'V', 3, 0) | ||
5835 | +#define VBG_IOCTL_LOG_ALT(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 9, s) | ||
5836 | + | ||
5837 | struct vbg_session; | ||
5838 | |||
5839 | /** VBox guest memory balloon. */ | ||
5840 | diff --git a/drivers/virt/vboxguest/vboxguest_linux.c b/drivers/virt/vboxguest/vboxguest_linux.c | ||
5841 | index 6e8c0f1c1056..32c2c52f7e84 100644 | ||
5842 | --- a/drivers/virt/vboxguest/vboxguest_linux.c | ||
5843 | +++ b/drivers/virt/vboxguest/vboxguest_linux.c | ||
5844 | @@ -131,7 +131,8 @@ static long vbg_misc_device_ioctl(struct file *filp, unsigned int req, | ||
5845 | * the need for a bounce-buffer and another copy later on. | ||
5846 | */ | ||
5847 | is_vmmdev_req = (req & ~IOCSIZE_MASK) == VBG_IOCTL_VMMDEV_REQUEST(0) || | ||
5848 | - req == VBG_IOCTL_VMMDEV_REQUEST_BIG; | ||
5849 | + req == VBG_IOCTL_VMMDEV_REQUEST_BIG || | ||
5850 | + req == VBG_IOCTL_VMMDEV_REQUEST_BIG_ALT; | ||
5851 | |||
5852 | if (is_vmmdev_req) | ||
5853 | buf = vbg_req_alloc(size, VBG_IOCTL_HDR_TYPE_DEFAULT, | ||
5854 | diff --git a/drivers/virt/vboxguest/vmmdev.h b/drivers/virt/vboxguest/vmmdev.h | ||
5855 | index 6337b8d75d96..21f408120e3f 100644 | ||
5856 | --- a/drivers/virt/vboxguest/vmmdev.h | ||
5857 | +++ b/drivers/virt/vboxguest/vmmdev.h | ||
5858 | @@ -206,6 +206,8 @@ VMMDEV_ASSERT_SIZE(vmmdev_mask, 24 + 8); | ||
5859 | * not. | ||
5860 | */ | ||
5861 | #define VMMDEV_GUEST_SUPPORTS_GRAPHICS BIT(2) | ||
5862 | +/* The mask of valid capabilities, for sanity checking. */ | ||
5863 | +#define VMMDEV_GUEST_CAPABILITIES_MASK 0x00000007U | ||
5864 | |||
5865 | /** struct vmmdev_hypervisorinfo - Hypervisor info structure. */ | ||
5866 | struct vmmdev_hypervisorinfo { | ||
5867 | diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c | ||
5868 | index fe1552cc8a0a..eafc49de4d7f 100644 | ||
5869 | --- a/fs/cifs/transport.c | ||
5870 | +++ b/fs/cifs/transport.c | ||
5871 | @@ -528,7 +528,7 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int num_credits, | ||
5872 | const int timeout, const int flags, | ||
5873 | unsigned int *instance) | ||
5874 | { | ||
5875 | - int rc; | ||
5876 | + long rc; | ||
5877 | int *credits; | ||
5878 | int optype; | ||
5879 | long int t; | ||
5880 | diff --git a/fs/fuse/file.c b/fs/fuse/file.c | ||
5881 | index 66214707a945..f8d8a8e34b80 100644 | ||
5882 | --- a/fs/fuse/file.c | ||
5883 | +++ b/fs/fuse/file.c | ||
5884 | @@ -18,6 +18,7 @@ | ||
5885 | #include <linux/swap.h> | ||
5886 | #include <linux/falloc.h> | ||
5887 | #include <linux/uio.h> | ||
5888 | +#include <linux/fs.h> | ||
5889 | |||
5890 | static struct page **fuse_pages_alloc(unsigned int npages, gfp_t flags, | ||
5891 | struct fuse_page_desc **desc) | ||
5892 | @@ -2148,10 +2149,8 @@ static int fuse_writepages(struct address_space *mapping, | ||
5893 | |||
5894 | err = write_cache_pages(mapping, wbc, fuse_writepages_fill, &data); | ||
5895 | if (data.wpa) { | ||
5896 | - /* Ignore errors if we can write at least one page */ | ||
5897 | WARN_ON(!data.wpa->ia.ap.num_pages); | ||
5898 | fuse_writepages_send(&data); | ||
5899 | - err = 0; | ||
5900 | } | ||
5901 | if (data.ff) | ||
5902 | fuse_file_put(data.ff, false, false); | ||
5903 | @@ -2760,7 +2759,16 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg, | ||
5904 | struct iovec *iov = iov_page; | ||
5905 | |||
5906 | iov->iov_base = (void __user *)arg; | ||
5907 | - iov->iov_len = _IOC_SIZE(cmd); | ||
5908 | + | ||
5909 | + switch (cmd) { | ||
5910 | + case FS_IOC_GETFLAGS: | ||
5911 | + case FS_IOC_SETFLAGS: | ||
5912 | + iov->iov_len = sizeof(int); | ||
5913 | + break; | ||
5914 | + default: | ||
5915 | + iov->iov_len = _IOC_SIZE(cmd); | ||
5916 | + break; | ||
5917 | + } | ||
5918 | |||
5919 | if (_IOC_DIR(cmd) & _IOC_WRITE) { | ||
5920 | in_iov = iov; | ||
5921 | diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c | ||
5922 | index 16aec32f7f3d..5dca643a257c 100644 | ||
5923 | --- a/fs/fuse/inode.c | ||
5924 | +++ b/fs/fuse/inode.c | ||
5925 | @@ -121,10 +121,12 @@ static void fuse_evict_inode(struct inode *inode) | ||
5926 | } | ||
5927 | } | ||
5928 | |||
5929 | -static int fuse_remount_fs(struct super_block *sb, int *flags, char *data) | ||
5930 | +static int fuse_reconfigure(struct fs_context *fc) | ||
5931 | { | ||
5932 | + struct super_block *sb = fc->root->d_sb; | ||
5933 | + | ||
5934 | sync_filesystem(sb); | ||
5935 | - if (*flags & SB_MANDLOCK) | ||
5936 | + if (fc->sb_flags & SB_MANDLOCK) | ||
5937 | return -EINVAL; | ||
5938 | |||
5939 | return 0; | ||
5940 | @@ -473,6 +475,13 @@ static int fuse_parse_param(struct fs_context *fc, struct fs_parameter *param) | ||
5941 | struct fuse_fs_context *ctx = fc->fs_private; | ||
5942 | int opt; | ||
5943 | |||
5944 | + /* | ||
5945 | + * Ignore options coming from mount(MS_REMOUNT) for backward | ||
5946 | + * compatibility. | ||
5947 | + */ | ||
5948 | + if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE) | ||
5949 | + return 0; | ||
5950 | + | ||
5951 | opt = fs_parse(fc, &fuse_fs_parameters, param, &result); | ||
5952 | if (opt < 0) | ||
5953 | return opt; | ||
5954 | @@ -815,7 +824,6 @@ static const struct super_operations fuse_super_operations = { | ||
5955 | .evict_inode = fuse_evict_inode, | ||
5956 | .write_inode = fuse_write_inode, | ||
5957 | .drop_inode = generic_delete_inode, | ||
5958 | - .remount_fs = fuse_remount_fs, | ||
5959 | .put_super = fuse_put_super, | ||
5960 | .umount_begin = fuse_umount_begin, | ||
5961 | .statfs = fuse_statfs, | ||
5962 | @@ -1289,6 +1297,7 @@ static int fuse_get_tree(struct fs_context *fc) | ||
5963 | static const struct fs_context_operations fuse_context_ops = { | ||
5964 | .free = fuse_free_fc, | ||
5965 | .parse_param = fuse_parse_param, | ||
5966 | + .reconfigure = fuse_reconfigure, | ||
5967 | .get_tree = fuse_get_tree, | ||
5968 | }; | ||
5969 | |||
5970 | diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c | ||
5971 | index c26c864590cc..e0c55765b06d 100644 | ||
5972 | --- a/fs/gfs2/ops_fstype.c | ||
5973 | +++ b/fs/gfs2/ops_fstype.c | ||
5974 | @@ -1168,7 +1168,17 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) | ||
5975 | goto fail_per_node; | ||
5976 | } | ||
5977 | |||
5978 | - if (!sb_rdonly(sb)) { | ||
5979 | + if (sb_rdonly(sb)) { | ||
5980 | + struct gfs2_holder freeze_gh; | ||
5981 | + | ||
5982 | + error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, | ||
5983 | + GL_EXACT, &freeze_gh); | ||
5984 | + if (error) { | ||
5985 | + fs_err(sdp, "can't make FS RO: %d\n", error); | ||
5986 | + goto fail_per_node; | ||
5987 | + } | ||
5988 | + gfs2_glock_dq_uninit(&freeze_gh); | ||
5989 | + } else { | ||
5990 | error = gfs2_make_fs_rw(sdp); | ||
5991 | if (error) { | ||
5992 | fs_err(sdp, "can't make FS RW: %d\n", error); | ||
5993 | diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c | ||
5994 | index 33c17c69aeaa..1a1bd2fe6e98 100644 | ||
5995 | --- a/fs/nfs/nfs4proc.c | ||
5996 | +++ b/fs/nfs/nfs4proc.c | ||
5997 | @@ -774,6 +774,14 @@ static void nfs4_slot_sequence_acked(struct nfs4_slot *slot, | ||
5998 | slot->seq_nr_last_acked = seqnr; | ||
5999 | } | ||
6000 | |||
6001 | +static void nfs4_probe_sequence(struct nfs_client *client, const struct cred *cred, | ||
6002 | + struct nfs4_slot *slot) | ||
6003 | +{ | ||
6004 | + struct rpc_task *task = _nfs41_proc_sequence(client, cred, slot, true); | ||
6005 | + if (!IS_ERR(task)) | ||
6006 | + rpc_put_task_async(task); | ||
6007 | +} | ||
6008 | + | ||
6009 | static int nfs41_sequence_process(struct rpc_task *task, | ||
6010 | struct nfs4_sequence_res *res) | ||
6011 | { | ||
6012 | @@ -790,6 +798,7 @@ static int nfs41_sequence_process(struct rpc_task *task, | ||
6013 | goto out; | ||
6014 | |||
6015 | session = slot->table->session; | ||
6016 | + clp = session->clp; | ||
6017 | |||
6018 | trace_nfs4_sequence_done(session, res); | ||
6019 | |||
6020 | @@ -804,7 +813,6 @@ static int nfs41_sequence_process(struct rpc_task *task, | ||
6021 | nfs4_slot_sequence_acked(slot, slot->seq_nr); | ||
6022 | /* Update the slot's sequence and clientid lease timer */ | ||
6023 | slot->seq_done = 1; | ||
6024 | - clp = session->clp; | ||
6025 | do_renew_lease(clp, res->sr_timestamp); | ||
6026 | /* Check sequence flags */ | ||
6027 | nfs41_handle_sequence_flag_errors(clp, res->sr_status_flags, | ||
6028 | @@ -852,10 +860,18 @@ static int nfs41_sequence_process(struct rpc_task *task, | ||
6029 | /* | ||
6030 | * Were one or more calls using this slot interrupted? | ||
6031 | * If the server never received the request, then our | ||
6032 | - * transmitted slot sequence number may be too high. | ||
6033 | + * transmitted slot sequence number may be too high. However, | ||
6034 | + * if the server did receive the request then it might | ||
6035 | + * accidentally give us a reply with a mismatched operation. | ||
6036 | + * We can sort this out by sending a lone sequence operation | ||
6037 | + * to the server on the same slot. | ||
6038 | */ | ||
6039 | if ((s32)(slot->seq_nr - slot->seq_nr_last_acked) > 1) { | ||
6040 | slot->seq_nr--; | ||
6041 | + if (task->tk_msg.rpc_proc != &nfs4_procedures[NFSPROC4_CLNT_SEQUENCE]) { | ||
6042 | + nfs4_probe_sequence(clp, task->tk_msg.rpc_cred, slot); | ||
6043 | + res->sr_slot = NULL; | ||
6044 | + } | ||
6045 | goto retry_nowait; | ||
6046 | } | ||
6047 | /* | ||
6048 | diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c | ||
6049 | index 73c9775215b3..11dd8177770d 100644 | ||
6050 | --- a/fs/overlayfs/export.c | ||
6051 | +++ b/fs/overlayfs/export.c | ||
6052 | @@ -482,7 +482,7 @@ static struct dentry *ovl_lookup_real_inode(struct super_block *sb, | ||
6053 | if (IS_ERR_OR_NULL(this)) | ||
6054 | return this; | ||
6055 | |||
6056 | - if (WARN_ON(ovl_dentry_real_at(this, layer->idx) != real)) { | ||
6057 | + if (ovl_dentry_real_at(this, layer->idx) != real) { | ||
6058 | dput(this); | ||
6059 | this = ERR_PTR(-EIO); | ||
6060 | } | ||
6061 | diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c | ||
6062 | index 15e4fa288475..7a08a576f7b2 100644 | ||
6063 | --- a/fs/overlayfs/file.c | ||
6064 | +++ b/fs/overlayfs/file.c | ||
6065 | @@ -21,13 +21,16 @@ static char ovl_whatisit(struct inode *inode, struct inode *realinode) | ||
6066 | return 'm'; | ||
6067 | } | ||
6068 | |||
6069 | +/* No atime modificaton nor notify on underlying */ | ||
6070 | +#define OVL_OPEN_FLAGS (O_NOATIME | FMODE_NONOTIFY) | ||
6071 | + | ||
6072 | static struct file *ovl_open_realfile(const struct file *file, | ||
6073 | struct inode *realinode) | ||
6074 | { | ||
6075 | struct inode *inode = file_inode(file); | ||
6076 | struct file *realfile; | ||
6077 | const struct cred *old_cred; | ||
6078 | - int flags = file->f_flags | O_NOATIME | FMODE_NONOTIFY; | ||
6079 | + int flags = file->f_flags | OVL_OPEN_FLAGS; | ||
6080 | |||
6081 | old_cred = ovl_override_creds(inode->i_sb); | ||
6082 | realfile = open_with_fake_path(&file->f_path, flags, realinode, | ||
6083 | @@ -48,8 +51,7 @@ static int ovl_change_flags(struct file *file, unsigned int flags) | ||
6084 | struct inode *inode = file_inode(file); | ||
6085 | int err; | ||
6086 | |||
6087 | - /* No atime modificaton on underlying */ | ||
6088 | - flags |= O_NOATIME | FMODE_NONOTIFY; | ||
6089 | + flags |= OVL_OPEN_FLAGS; | ||
6090 | |||
6091 | /* If some flag changed that cannot be changed then something's amiss */ | ||
6092 | if (WARN_ON((file->f_flags ^ flags) & ~OVL_SETFL_MASK)) | ||
6093 | @@ -102,7 +104,7 @@ static int ovl_real_fdget_meta(const struct file *file, struct fd *real, | ||
6094 | } | ||
6095 | |||
6096 | /* Did the flags change since open? */ | ||
6097 | - if (unlikely((file->f_flags ^ real->file->f_flags) & ~O_NOATIME)) | ||
6098 | + if (unlikely((file->f_flags ^ real->file->f_flags) & ~OVL_OPEN_FLAGS)) | ||
6099 | return ovl_change_flags(real->file, file->f_flags); | ||
6100 | |||
6101 | return 0; | ||
6102 | diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c | ||
6103 | index 7621ff176d15..d6b724beb304 100644 | ||
6104 | --- a/fs/overlayfs/super.c | ||
6105 | +++ b/fs/overlayfs/super.c | ||
6106 | @@ -1258,6 +1258,18 @@ static bool ovl_lower_uuid_ok(struct ovl_fs *ofs, const uuid_t *uuid) | ||
6107 | if (!ofs->config.nfs_export && !ofs->upper_mnt) | ||
6108 | return true; | ||
6109 | |||
6110 | + /* | ||
6111 | + * We allow using single lower with null uuid for index and nfs_export | ||
6112 | + * for example to support those features with single lower squashfs. | ||
6113 | + * To avoid regressions in setups of overlay with re-formatted lower | ||
6114 | + * squashfs, do not allow decoding origin with lower null uuid unless | ||
6115 | + * user opted-in to one of the new features that require following the | ||
6116 | + * lower inode of non-dir upper. | ||
6117 | + */ | ||
6118 | + if (!ofs->config.index && !ofs->config.metacopy && !ofs->config.xino && | ||
6119 | + uuid_is_null(uuid)) | ||
6120 | + return false; | ||
6121 | + | ||
6122 | for (i = 0; i < ofs->numlowerfs; i++) { | ||
6123 | /* | ||
6124 | * We use uuid to associate an overlay lower file handle with a | ||
6125 | @@ -1344,14 +1356,23 @@ static int ovl_get_lower_layers(struct super_block *sb, struct ovl_fs *ofs, | ||
6126 | if (err < 0) | ||
6127 | goto out; | ||
6128 | |||
6129 | + /* | ||
6130 | + * Check if lower root conflicts with this overlay layers before | ||
6131 | + * checking if it is in-use as upperdir/workdir of "another" | ||
6132 | + * mount, because we do not bother to check in ovl_is_inuse() if | ||
6133 | + * the upperdir/workdir is in fact in-use by our | ||
6134 | + * upperdir/workdir. | ||
6135 | + */ | ||
6136 | err = ovl_setup_trap(sb, stack[i].dentry, &trap, "lowerdir"); | ||
6137 | if (err) | ||
6138 | goto out; | ||
6139 | |||
6140 | if (ovl_is_inuse(stack[i].dentry)) { | ||
6141 | err = ovl_report_in_use(ofs, "lowerdir"); | ||
6142 | - if (err) | ||
6143 | + if (err) { | ||
6144 | + iput(trap); | ||
6145 | goto out; | ||
6146 | + } | ||
6147 | } | ||
6148 | |||
6149 | mnt = clone_private_mount(&stack[i]); | ||
6150 | diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h | ||
6151 | index bff1def62eed..d5338b9ee550 100644 | ||
6152 | --- a/include/linux/blkdev.h | ||
6153 | +++ b/include/linux/blkdev.h | ||
6154 | @@ -592,6 +592,7 @@ struct request_queue { | ||
6155 | u64 write_hints[BLK_MAX_WRITE_HINTS]; | ||
6156 | }; | ||
6157 | |||
6158 | +/* Keep blk_queue_flag_name[] in sync with the definitions below */ | ||
6159 | #define QUEUE_FLAG_STOPPED 0 /* queue is stopped */ | ||
6160 | #define QUEUE_FLAG_DYING 1 /* queue being torn down */ | ||
6161 | #define QUEUE_FLAG_NOMERGES 3 /* disable merge attempts */ | ||
6162 | diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h | ||
6163 | index 430e219e3aba..1ccfa3779e18 100644 | ||
6164 | --- a/include/linux/cgroup-defs.h | ||
6165 | +++ b/include/linux/cgroup-defs.h | ||
6166 | @@ -797,7 +797,9 @@ struct sock_cgroup_data { | ||
6167 | union { | ||
6168 | #ifdef __LITTLE_ENDIAN | ||
6169 | struct { | ||
6170 | - u8 is_data; | ||
6171 | + u8 is_data : 1; | ||
6172 | + u8 no_refcnt : 1; | ||
6173 | + u8 unused : 6; | ||
6174 | u8 padding; | ||
6175 | u16 prioidx; | ||
6176 | u32 classid; | ||
6177 | @@ -807,7 +809,9 @@ struct sock_cgroup_data { | ||
6178 | u32 classid; | ||
6179 | u16 prioidx; | ||
6180 | u8 padding; | ||
6181 | - u8 is_data; | ||
6182 | + u8 unused : 6; | ||
6183 | + u8 no_refcnt : 1; | ||
6184 | + u8 is_data : 1; | ||
6185 | } __packed; | ||
6186 | #endif | ||
6187 | u64 val; | ||
6188 | diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h | ||
6189 | index 57577075d204..202852383ae9 100644 | ||
6190 | --- a/include/linux/cgroup.h | ||
6191 | +++ b/include/linux/cgroup.h | ||
6192 | @@ -822,6 +822,7 @@ extern spinlock_t cgroup_sk_update_lock; | ||
6193 | |||
6194 | void cgroup_sk_alloc_disable(void); | ||
6195 | void cgroup_sk_alloc(struct sock_cgroup_data *skcd); | ||
6196 | +void cgroup_sk_clone(struct sock_cgroup_data *skcd); | ||
6197 | void cgroup_sk_free(struct sock_cgroup_data *skcd); | ||
6198 | |||
6199 | static inline struct cgroup *sock_cgroup_ptr(struct sock_cgroup_data *skcd) | ||
6200 | @@ -835,7 +836,7 @@ static inline struct cgroup *sock_cgroup_ptr(struct sock_cgroup_data *skcd) | ||
6201 | */ | ||
6202 | v = READ_ONCE(skcd->val); | ||
6203 | |||
6204 | - if (v & 1) | ||
6205 | + if (v & 3) | ||
6206 | return &cgrp_dfl_root.cgrp; | ||
6207 | |||
6208 | return (struct cgroup *)(unsigned long)v ?: &cgrp_dfl_root.cgrp; | ||
6209 | @@ -847,6 +848,7 @@ static inline struct cgroup *sock_cgroup_ptr(struct sock_cgroup_data *skcd) | ||
6210 | #else /* CONFIG_CGROUP_DATA */ | ||
6211 | |||
6212 | static inline void cgroup_sk_alloc(struct sock_cgroup_data *skcd) {} | ||
6213 | +static inline void cgroup_sk_clone(struct sock_cgroup_data *skcd) {} | ||
6214 | static inline void cgroup_sk_free(struct sock_cgroup_data *skcd) {} | ||
6215 | |||
6216 | #endif /* CONFIG_CGROUP_DATA */ | ||
6217 | diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h | ||
6218 | index b05e855f1ddd..41a518336673 100644 | ||
6219 | --- a/include/linux/if_vlan.h | ||
6220 | +++ b/include/linux/if_vlan.h | ||
6221 | @@ -25,6 +25,8 @@ | ||
6222 | #define VLAN_ETH_DATA_LEN 1500 /* Max. octets in payload */ | ||
6223 | #define VLAN_ETH_FRAME_LEN 1518 /* Max. octets in frame sans FCS */ | ||
6224 | |||
6225 | +#define VLAN_MAX_DEPTH 8 /* Max. number of nested VLAN tags parsed */ | ||
6226 | + | ||
6227 | /* | ||
6228 | * struct vlan_hdr - vlan header | ||
6229 | * @h_vlan_TCI: priority and VLAN ID | ||
6230 | @@ -577,10 +579,10 @@ static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci) | ||
6231 | * Returns the EtherType of the packet, regardless of whether it is | ||
6232 | * vlan encapsulated (normal or hardware accelerated) or not. | ||
6233 | */ | ||
6234 | -static inline __be16 __vlan_get_protocol(struct sk_buff *skb, __be16 type, | ||
6235 | +static inline __be16 __vlan_get_protocol(const struct sk_buff *skb, __be16 type, | ||
6236 | int *depth) | ||
6237 | { | ||
6238 | - unsigned int vlan_depth = skb->mac_len; | ||
6239 | + unsigned int vlan_depth = skb->mac_len, parse_depth = VLAN_MAX_DEPTH; | ||
6240 | |||
6241 | /* if type is 802.1Q/AD then the header should already be | ||
6242 | * present at mac_len - VLAN_HLEN (if mac_len > 0), or at | ||
6243 | @@ -595,13 +597,12 @@ static inline __be16 __vlan_get_protocol(struct sk_buff *skb, __be16 type, | ||
6244 | vlan_depth = ETH_HLEN; | ||
6245 | } | ||
6246 | do { | ||
6247 | - struct vlan_hdr *vh; | ||
6248 | + struct vlan_hdr vhdr, *vh; | ||
6249 | |||
6250 | - if (unlikely(!pskb_may_pull(skb, | ||
6251 | - vlan_depth + VLAN_HLEN))) | ||
6252 | + vh = skb_header_pointer(skb, vlan_depth, sizeof(vhdr), &vhdr); | ||
6253 | + if (unlikely(!vh || !--parse_depth)) | ||
6254 | return 0; | ||
6255 | |||
6256 | - vh = (struct vlan_hdr *)(skb->data + vlan_depth); | ||
6257 | type = vh->h_vlan_encapsulated_proto; | ||
6258 | vlan_depth += VLAN_HLEN; | ||
6259 | } while (eth_type_vlan(type)); | ||
6260 | @@ -620,11 +621,25 @@ static inline __be16 __vlan_get_protocol(struct sk_buff *skb, __be16 type, | ||
6261 | * Returns the EtherType of the packet, regardless of whether it is | ||
6262 | * vlan encapsulated (normal or hardware accelerated) or not. | ||
6263 | */ | ||
6264 | -static inline __be16 vlan_get_protocol(struct sk_buff *skb) | ||
6265 | +static inline __be16 vlan_get_protocol(const struct sk_buff *skb) | ||
6266 | { | ||
6267 | return __vlan_get_protocol(skb, skb->protocol, NULL); | ||
6268 | } | ||
6269 | |||
6270 | +/* A getter for the SKB protocol field which will handle VLAN tags consistently | ||
6271 | + * whether VLAN acceleration is enabled or not. | ||
6272 | + */ | ||
6273 | +static inline __be16 skb_protocol(const struct sk_buff *skb, bool skip_vlan) | ||
6274 | +{ | ||
6275 | + if (!skip_vlan) | ||
6276 | + /* VLAN acceleration strips the VLAN header from the skb and | ||
6277 | + * moves it to skb->vlan_proto | ||
6278 | + */ | ||
6279 | + return skb_vlan_tag_present(skb) ? skb->vlan_proto : skb->protocol; | ||
6280 | + | ||
6281 | + return vlan_get_protocol(skb); | ||
6282 | +} | ||
6283 | + | ||
6284 | static inline void vlan_set_encap_proto(struct sk_buff *skb, | ||
6285 | struct vlan_hdr *vhdr) | ||
6286 | { | ||
6287 | diff --git a/include/linux/input/elan-i2c-ids.h b/include/linux/input/elan-i2c-ids.h | ||
6288 | index 1ecb6b45812c..520858d12680 100644 | ||
6289 | --- a/include/linux/input/elan-i2c-ids.h | ||
6290 | +++ b/include/linux/input/elan-i2c-ids.h | ||
6291 | @@ -67,8 +67,15 @@ static const struct acpi_device_id elan_acpi_id[] = { | ||
6292 | { "ELAN062B", 0 }, | ||
6293 | { "ELAN062C", 0 }, | ||
6294 | { "ELAN062D", 0 }, | ||
6295 | + { "ELAN062E", 0 }, /* Lenovo V340 Whiskey Lake U */ | ||
6296 | + { "ELAN062F", 0 }, /* Lenovo V340 Comet Lake U */ | ||
6297 | { "ELAN0631", 0 }, | ||
6298 | { "ELAN0632", 0 }, | ||
6299 | + { "ELAN0633", 0 }, /* Lenovo S145 */ | ||
6300 | + { "ELAN0634", 0 }, /* Lenovo V340 Ice lake */ | ||
6301 | + { "ELAN0635", 0 }, /* Lenovo V1415-IIL */ | ||
6302 | + { "ELAN0636", 0 }, /* Lenovo V1415-Dali */ | ||
6303 | + { "ELAN0637", 0 }, /* Lenovo V1415-IGLR */ | ||
6304 | { "ELAN1000", 0 }, | ||
6305 | { } | ||
6306 | }; | ||
6307 | diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h | ||
6308 | index 2cbde6542849..5fcc9bc9e751 100644 | ||
6309 | --- a/include/linux/platform_data/ti-sysc.h | ||
6310 | +++ b/include/linux/platform_data/ti-sysc.h | ||
6311 | @@ -49,6 +49,7 @@ struct sysc_regbits { | ||
6312 | s8 emufree_shift; | ||
6313 | }; | ||
6314 | |||
6315 | +#define SYSC_MODULE_QUIRK_RTC_UNLOCK BIT(22) | ||
6316 | #define SYSC_QUIRK_CLKDM_NOAUTO BIT(21) | ||
6317 | #define SYSC_QUIRK_FORCE_MSTANDBY BIT(20) | ||
6318 | #define SYSC_MODULE_QUIRK_AESS BIT(19) | ||
6319 | diff --git a/include/net/dst.h b/include/net/dst.h | ||
6320 | index 3448cf865ede..433f7c1ce8a9 100644 | ||
6321 | --- a/include/net/dst.h | ||
6322 | +++ b/include/net/dst.h | ||
6323 | @@ -401,7 +401,15 @@ static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, co | ||
6324 | static inline struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst, | ||
6325 | struct sk_buff *skb) | ||
6326 | { | ||
6327 | - struct neighbour *n = dst->ops->neigh_lookup(dst, skb, NULL); | ||
6328 | + struct neighbour *n = NULL; | ||
6329 | + | ||
6330 | + /* The packets from tunnel devices (eg bareudp) may have only | ||
6331 | + * metadata in the dst pointer of skb. Hence a pointer check of | ||
6332 | + * neigh_lookup is needed. | ||
6333 | + */ | ||
6334 | + if (dst->ops->neigh_lookup) | ||
6335 | + n = dst->ops->neigh_lookup(dst, skb, NULL); | ||
6336 | + | ||
6337 | return IS_ERR(n) ? NULL : n; | ||
6338 | } | ||
6339 | |||
6340 | diff --git a/include/net/genetlink.h b/include/net/genetlink.h | ||
6341 | index 9292f1c588b7..2d9e67a69cbe 100644 | ||
6342 | --- a/include/net/genetlink.h | ||
6343 | +++ b/include/net/genetlink.h | ||
6344 | @@ -35,12 +35,6 @@ struct genl_info; | ||
6345 | * do additional, common, filtering and return an error | ||
6346 | * @post_doit: called after an operation's doit callback, it may | ||
6347 | * undo operations done by pre_doit, for example release locks | ||
6348 | - * @mcast_bind: a socket bound to the given multicast group (which | ||
6349 | - * is given as the offset into the groups array) | ||
6350 | - * @mcast_unbind: a socket was unbound from the given multicast group. | ||
6351 | - * Note that unbind() will not be called symmetrically if the | ||
6352 | - * generic netlink family is removed while there are still open | ||
6353 | - * sockets. | ||
6354 | * @attrbuf: buffer to store parsed attributes (private) | ||
6355 | * @mcgrps: multicast groups used by this family | ||
6356 | * @n_mcgrps: number of multicast groups | ||
6357 | @@ -64,8 +58,6 @@ struct genl_family { | ||
6358 | void (*post_doit)(const struct genl_ops *ops, | ||
6359 | struct sk_buff *skb, | ||
6360 | struct genl_info *info); | ||
6361 | - int (*mcast_bind)(struct net *net, int group); | ||
6362 | - void (*mcast_unbind)(struct net *net, int group); | ||
6363 | struct nlattr ** attrbuf; /* private */ | ||
6364 | const struct genl_ops * ops; | ||
6365 | const struct genl_multicast_group *mcgrps; | ||
6366 | diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h | ||
6367 | index 0f0d1efe06dd..e1eaf1780288 100644 | ||
6368 | --- a/include/net/inet_ecn.h | ||
6369 | +++ b/include/net/inet_ecn.h | ||
6370 | @@ -4,6 +4,7 @@ | ||
6371 | |||
6372 | #include <linux/ip.h> | ||
6373 | #include <linux/skbuff.h> | ||
6374 | +#include <linux/if_vlan.h> | ||
6375 | |||
6376 | #include <net/inet_sock.h> | ||
6377 | #include <net/dsfield.h> | ||
6378 | @@ -172,7 +173,7 @@ static inline void ipv6_copy_dscp(unsigned int dscp, struct ipv6hdr *inner) | ||
6379 | |||
6380 | static inline int INET_ECN_set_ce(struct sk_buff *skb) | ||
6381 | { | ||
6382 | - switch (skb->protocol) { | ||
6383 | + switch (skb_protocol(skb, true)) { | ||
6384 | case cpu_to_be16(ETH_P_IP): | ||
6385 | if (skb_network_header(skb) + sizeof(struct iphdr) <= | ||
6386 | skb_tail_pointer(skb)) | ||
6387 | @@ -191,7 +192,7 @@ static inline int INET_ECN_set_ce(struct sk_buff *skb) | ||
6388 | |||
6389 | static inline int INET_ECN_set_ect1(struct sk_buff *skb) | ||
6390 | { | ||
6391 | - switch (skb->protocol) { | ||
6392 | + switch (skb_protocol(skb, true)) { | ||
6393 | case cpu_to_be16(ETH_P_IP): | ||
6394 | if (skb_network_header(skb) + sizeof(struct iphdr) <= | ||
6395 | skb_tail_pointer(skb)) | ||
6396 | @@ -272,12 +273,16 @@ static inline int IP_ECN_decapsulate(const struct iphdr *oiph, | ||
6397 | { | ||
6398 | __u8 inner; | ||
6399 | |||
6400 | - if (skb->protocol == htons(ETH_P_IP)) | ||
6401 | + switch (skb_protocol(skb, true)) { | ||
6402 | + case htons(ETH_P_IP): | ||
6403 | inner = ip_hdr(skb)->tos; | ||
6404 | - else if (skb->protocol == htons(ETH_P_IPV6)) | ||
6405 | + break; | ||
6406 | + case htons(ETH_P_IPV6): | ||
6407 | inner = ipv6_get_dsfield(ipv6_hdr(skb)); | ||
6408 | - else | ||
6409 | + break; | ||
6410 | + default: | ||
6411 | return 0; | ||
6412 | + } | ||
6413 | |||
6414 | return INET_ECN_decapsulate(skb, oiph->tos, inner); | ||
6415 | } | ||
6416 | @@ -287,12 +292,16 @@ static inline int IP6_ECN_decapsulate(const struct ipv6hdr *oipv6h, | ||
6417 | { | ||
6418 | __u8 inner; | ||
6419 | |||
6420 | - if (skb->protocol == htons(ETH_P_IP)) | ||
6421 | + switch (skb_protocol(skb, true)) { | ||
6422 | + case htons(ETH_P_IP): | ||
6423 | inner = ip_hdr(skb)->tos; | ||
6424 | - else if (skb->protocol == htons(ETH_P_IPV6)) | ||
6425 | + break; | ||
6426 | + case htons(ETH_P_IPV6): | ||
6427 | inner = ipv6_get_dsfield(ipv6_hdr(skb)); | ||
6428 | - else | ||
6429 | + break; | ||
6430 | + default: | ||
6431 | return 0; | ||
6432 | + } | ||
6433 | |||
6434 | return INET_ECN_decapsulate(skb, ipv6_get_dsfield(oipv6h), inner); | ||
6435 | } | ||
6436 | diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h | ||
6437 | index 6a70845bd9ab..cee1c084e9f4 100644 | ||
6438 | --- a/include/net/pkt_sched.h | ||
6439 | +++ b/include/net/pkt_sched.h | ||
6440 | @@ -128,17 +128,6 @@ static inline void qdisc_run(struct Qdisc *q) | ||
6441 | } | ||
6442 | } | ||
6443 | |||
6444 | -static inline __be16 tc_skb_protocol(const struct sk_buff *skb) | ||
6445 | -{ | ||
6446 | - /* We need to take extra care in case the skb came via | ||
6447 | - * vlan accelerated path. In that case, use skb->vlan_proto | ||
6448 | - * as the original vlan header was already stripped. | ||
6449 | - */ | ||
6450 | - if (skb_vlan_tag_present(skb)) | ||
6451 | - return skb->vlan_proto; | ||
6452 | - return skb->protocol; | ||
6453 | -} | ||
6454 | - | ||
6455 | /* Calculate maximal size of packet seen by hard_start_xmit | ||
6456 | routine of this device. | ||
6457 | */ | ||
6458 | diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h | ||
6459 | index ba9efdc848f9..059b6e45a028 100644 | ||
6460 | --- a/include/trace/events/rxrpc.h | ||
6461 | +++ b/include/trace/events/rxrpc.h | ||
6462 | @@ -400,7 +400,7 @@ enum rxrpc_tx_point { | ||
6463 | EM(rxrpc_cong_begin_retransmission, " Retrans") \ | ||
6464 | EM(rxrpc_cong_cleared_nacks, " Cleared") \ | ||
6465 | EM(rxrpc_cong_new_low_nack, " NewLowN") \ | ||
6466 | - EM(rxrpc_cong_no_change, "") \ | ||
6467 | + EM(rxrpc_cong_no_change, " -") \ | ||
6468 | EM(rxrpc_cong_progress, " Progres") \ | ||
6469 | EM(rxrpc_cong_retransmit_again, " ReTxAgn") \ | ||
6470 | EM(rxrpc_cong_rtt_window_end, " RttWinE") \ | ||
6471 | diff --git a/include/uapi/linux/vboxguest.h b/include/uapi/linux/vboxguest.h | ||
6472 | index 9cec58a6a5ea..f79d7abe27db 100644 | ||
6473 | --- a/include/uapi/linux/vboxguest.h | ||
6474 | +++ b/include/uapi/linux/vboxguest.h | ||
6475 | @@ -103,7 +103,7 @@ VMMDEV_ASSERT_SIZE(vbg_ioctl_driver_version_info, 24 + 20); | ||
6476 | |||
6477 | |||
6478 | /* IOCTL to perform a VMM Device request larger then 1KB. */ | ||
6479 | -#define VBG_IOCTL_VMMDEV_REQUEST_BIG _IOC(_IOC_READ | _IOC_WRITE, 'V', 3, 0) | ||
6480 | +#define VBG_IOCTL_VMMDEV_REQUEST_BIG _IO('V', 3) | ||
6481 | |||
6482 | |||
6483 | /** VBG_IOCTL_HGCM_CONNECT data structure. */ | ||
6484 | @@ -198,7 +198,7 @@ struct vbg_ioctl_log { | ||
6485 | } u; | ||
6486 | }; | ||
6487 | |||
6488 | -#define VBG_IOCTL_LOG(s) _IOC(_IOC_READ | _IOC_WRITE, 'V', 9, s) | ||
6489 | +#define VBG_IOCTL_LOG(s) _IO('V', 9) | ||
6490 | |||
6491 | |||
6492 | /** VBG_IOCTL_WAIT_FOR_EVENTS data structure. */ | ||
6493 | diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c | ||
6494 | index 7c9e97553a00..35faf082a709 100644 | ||
6495 | --- a/kernel/cgroup/cgroup.c | ||
6496 | +++ b/kernel/cgroup/cgroup.c | ||
6497 | @@ -6379,18 +6379,8 @@ void cgroup_sk_alloc_disable(void) | ||
6498 | |||
6499 | void cgroup_sk_alloc(struct sock_cgroup_data *skcd) | ||
6500 | { | ||
6501 | - if (cgroup_sk_alloc_disabled) | ||
6502 | - return; | ||
6503 | - | ||
6504 | - /* Socket clone path */ | ||
6505 | - if (skcd->val) { | ||
6506 | - /* | ||
6507 | - * We might be cloning a socket which is left in an empty | ||
6508 | - * cgroup and the cgroup might have already been rmdir'd. | ||
6509 | - * Don't use cgroup_get_live(). | ||
6510 | - */ | ||
6511 | - cgroup_get(sock_cgroup_ptr(skcd)); | ||
6512 | - cgroup_bpf_get(sock_cgroup_ptr(skcd)); | ||
6513 | + if (cgroup_sk_alloc_disabled) { | ||
6514 | + skcd->no_refcnt = 1; | ||
6515 | return; | ||
6516 | } | ||
6517 | |||
6518 | @@ -6415,10 +6405,27 @@ void cgroup_sk_alloc(struct sock_cgroup_data *skcd) | ||
6519 | rcu_read_unlock(); | ||
6520 | } | ||
6521 | |||
6522 | +void cgroup_sk_clone(struct sock_cgroup_data *skcd) | ||
6523 | +{ | ||
6524 | + if (skcd->val) { | ||
6525 | + if (skcd->no_refcnt) | ||
6526 | + return; | ||
6527 | + /* | ||
6528 | + * We might be cloning a socket which is left in an empty | ||
6529 | + * cgroup and the cgroup might have already been rmdir'd. | ||
6530 | + * Don't use cgroup_get_live(). | ||
6531 | + */ | ||
6532 | + cgroup_get(sock_cgroup_ptr(skcd)); | ||
6533 | + cgroup_bpf_get(sock_cgroup_ptr(skcd)); | ||
6534 | + } | ||
6535 | +} | ||
6536 | + | ||
6537 | void cgroup_sk_free(struct sock_cgroup_data *skcd) | ||
6538 | { | ||
6539 | struct cgroup *cgrp = sock_cgroup_ptr(skcd); | ||
6540 | |||
6541 | + if (skcd->no_refcnt) | ||
6542 | + return; | ||
6543 | cgroup_bpf_put(cgrp); | ||
6544 | cgroup_put(cgrp); | ||
6545 | } | ||
6546 | diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c | ||
6547 | index b304c17d53a3..df73685de114 100644 | ||
6548 | --- a/kernel/irq/manage.c | ||
6549 | +++ b/kernel/irq/manage.c | ||
6550 | @@ -194,9 +194,9 @@ void irq_set_thread_affinity(struct irq_desc *desc) | ||
6551 | set_bit(IRQTF_AFFINITY, &action->thread_flags); | ||
6552 | } | ||
6553 | |||
6554 | +#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK | ||
6555 | static void irq_validate_effective_affinity(struct irq_data *data) | ||
6556 | { | ||
6557 | -#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK | ||
6558 | const struct cpumask *m = irq_data_get_effective_affinity_mask(data); | ||
6559 | struct irq_chip *chip = irq_data_get_irq_chip(data); | ||
6560 | |||
6561 | @@ -204,9 +204,19 @@ static void irq_validate_effective_affinity(struct irq_data *data) | ||
6562 | return; | ||
6563 | pr_warn_once("irq_chip %s did not update eff. affinity mask of irq %u\n", | ||
6564 | chip->name, data->irq); | ||
6565 | -#endif | ||
6566 | } | ||
6567 | |||
6568 | +static inline void irq_init_effective_affinity(struct irq_data *data, | ||
6569 | + const struct cpumask *mask) | ||
6570 | +{ | ||
6571 | + cpumask_copy(irq_data_get_effective_affinity_mask(data), mask); | ||
6572 | +} | ||
6573 | +#else | ||
6574 | +static inline void irq_validate_effective_affinity(struct irq_data *data) { } | ||
6575 | +static inline void irq_init_effective_affinity(struct irq_data *data, | ||
6576 | + const struct cpumask *mask) { } | ||
6577 | +#endif | ||
6578 | + | ||
6579 | int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask, | ||
6580 | bool force) | ||
6581 | { | ||
6582 | @@ -265,6 +275,26 @@ static int irq_try_set_affinity(struct irq_data *data, | ||
6583 | return ret; | ||
6584 | } | ||
6585 | |||
6586 | +static bool irq_set_affinity_deactivated(struct irq_data *data, | ||
6587 | + const struct cpumask *mask, bool force) | ||
6588 | +{ | ||
6589 | + struct irq_desc *desc = irq_data_to_desc(data); | ||
6590 | + | ||
6591 | + /* | ||
6592 | + * If the interrupt is not yet activated, just store the affinity | ||
6593 | + * mask and do not call the chip driver at all. On activation the | ||
6594 | + * driver has to make sure anyway that the interrupt is in a | ||
6595 | + * useable state so startup works. | ||
6596 | + */ | ||
6597 | + if (!IS_ENABLED(CONFIG_IRQ_DOMAIN_HIERARCHY) || irqd_is_activated(data)) | ||
6598 | + return false; | ||
6599 | + | ||
6600 | + cpumask_copy(desc->irq_common_data.affinity, mask); | ||
6601 | + irq_init_effective_affinity(data, mask); | ||
6602 | + irqd_set(data, IRQD_AFFINITY_SET); | ||
6603 | + return true; | ||
6604 | +} | ||
6605 | + | ||
6606 | int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask, | ||
6607 | bool force) | ||
6608 | { | ||
6609 | @@ -275,6 +305,9 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask, | ||
6610 | if (!chip || !chip->irq_set_affinity) | ||
6611 | return -EINVAL; | ||
6612 | |||
6613 | + if (irq_set_affinity_deactivated(data, mask, force)) | ||
6614 | + return 0; | ||
6615 | + | ||
6616 | if (irq_can_move_pcntxt(data) && !irqd_is_setaffinity_pending(data)) { | ||
6617 | ret = irq_try_set_affinity(data, mask, force); | ||
6618 | } else { | ||
6619 | diff --git a/kernel/sched/core.c b/kernel/sched/core.c | ||
6620 | index 8b3e99d095ae..38ae3cf9d173 100644 | ||
6621 | --- a/kernel/sched/core.c | ||
6622 | +++ b/kernel/sched/core.c | ||
6623 | @@ -2889,6 +2889,7 @@ int sched_fork(unsigned long clone_flags, struct task_struct *p) | ||
6624 | * Silence PROVE_RCU. | ||
6625 | */ | ||
6626 | raw_spin_lock_irqsave(&p->pi_lock, flags); | ||
6627 | + rseq_migrate(p); | ||
6628 | /* | ||
6629 | * We're setting the CPU for the first time, we don't migrate, | ||
6630 | * so use __set_task_cpu(). | ||
6631 | @@ -2953,6 +2954,7 @@ void wake_up_new_task(struct task_struct *p) | ||
6632 | * as we're not fully set-up yet. | ||
6633 | */ | ||
6634 | p->recent_used_cpu = task_cpu(p); | ||
6635 | + rseq_migrate(p); | ||
6636 | __set_task_cpu(p, select_task_rq(p, task_cpu(p), SD_BALANCE_FORK, 0)); | ||
6637 | #endif | ||
6638 | rq = __task_rq_lock(p, &rf); | ||
6639 | diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c | ||
6640 | index 2f81e4ae844e..9b16080093be 100644 | ||
6641 | --- a/kernel/sched/fair.c | ||
6642 | +++ b/kernel/sched/fair.c | ||
6643 | @@ -3824,7 +3824,11 @@ static inline void update_misfit_status(struct task_struct *p, struct rq *rq) | ||
6644 | return; | ||
6645 | } | ||
6646 | |||
6647 | - rq->misfit_task_load = task_h_load(p); | ||
6648 | + /* | ||
6649 | + * Make sure that misfit_task_load will not be null even if | ||
6650 | + * task_h_load() returns 0. | ||
6651 | + */ | ||
6652 | + rq->misfit_task_load = max_t(unsigned long, task_h_load(p), 1); | ||
6653 | } | ||
6654 | |||
6655 | #else /* CONFIG_SMP */ | ||
6656 | @@ -7407,7 +7411,15 @@ static int detach_tasks(struct lb_env *env) | ||
6657 | if (!can_migrate_task(p, env)) | ||
6658 | goto next; | ||
6659 | |||
6660 | - load = task_h_load(p); | ||
6661 | + /* | ||
6662 | + * Depending of the number of CPUs and tasks and the | ||
6663 | + * cgroup hierarchy, task_h_load() can return a null | ||
6664 | + * value. Make sure that env->imbalance decreases | ||
6665 | + * otherwise detach_tasks() will stop only after | ||
6666 | + * detaching up to loop_max tasks. | ||
6667 | + */ | ||
6668 | + load = max_t(unsigned long, task_h_load(p), 1); | ||
6669 | + | ||
6670 | |||
6671 | if (sched_feat(LB_MIN) && load < 16 && !env->sd->nr_balance_failed) | ||
6672 | goto next; | ||
6673 | diff --git a/kernel/time/timer.c b/kernel/time/timer.c | ||
6674 | index 4820823515e9..1e9b81a930c0 100644 | ||
6675 | --- a/kernel/time/timer.c | ||
6676 | +++ b/kernel/time/timer.c | ||
6677 | @@ -522,8 +522,8 @@ static int calc_wheel_index(unsigned long expires, unsigned long clk) | ||
6678 | * Force expire obscene large timeouts to expire at the | ||
6679 | * capacity limit of the wheel. | ||
6680 | */ | ||
6681 | - if (expires >= WHEEL_TIMEOUT_CUTOFF) | ||
6682 | - expires = WHEEL_TIMEOUT_MAX; | ||
6683 | + if (delta >= WHEEL_TIMEOUT_CUTOFF) | ||
6684 | + expires = clk + WHEEL_TIMEOUT_MAX; | ||
6685 | |||
6686 | idx = calc_index(expires, LVL_DEPTH - 1); | ||
6687 | } | ||
6688 | @@ -585,7 +585,15 @@ trigger_dyntick_cpu(struct timer_base *base, struct timer_list *timer) | ||
6689 | * Set the next expiry time and kick the CPU so it can reevaluate the | ||
6690 | * wheel: | ||
6691 | */ | ||
6692 | - base->next_expiry = timer->expires; | ||
6693 | + if (time_before(timer->expires, base->clk)) { | ||
6694 | + /* | ||
6695 | + * Prevent from forward_timer_base() moving the base->clk | ||
6696 | + * backward | ||
6697 | + */ | ||
6698 | + base->next_expiry = base->clk; | ||
6699 | + } else { | ||
6700 | + base->next_expiry = timer->expires; | ||
6701 | + } | ||
6702 | wake_up_nohz_cpu(base->cpu); | ||
6703 | } | ||
6704 | |||
6705 | @@ -897,10 +905,13 @@ static inline void forward_timer_base(struct timer_base *base) | ||
6706 | * If the next expiry value is > jiffies, then we fast forward to | ||
6707 | * jiffies otherwise we forward to the next expiry value. | ||
6708 | */ | ||
6709 | - if (time_after(base->next_expiry, jnow)) | ||
6710 | + if (time_after(base->next_expiry, jnow)) { | ||
6711 | base->clk = jnow; | ||
6712 | - else | ||
6713 | + } else { | ||
6714 | + if (WARN_ON_ONCE(time_before(base->next_expiry, base->clk))) | ||
6715 | + return; | ||
6716 | base->clk = base->next_expiry; | ||
6717 | + } | ||
6718 | #endif | ||
6719 | } | ||
6720 | |||
6721 | diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c | ||
6722 | index ad12fe3fca8c..ee2902b51d45 100644 | ||
6723 | --- a/net/bridge/br_multicast.c | ||
6724 | +++ b/net/bridge/br_multicast.c | ||
6725 | @@ -1007,7 +1007,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br, | ||
6726 | nsrcs_offset = len + offsetof(struct mld2_grec, grec_nsrcs); | ||
6727 | |||
6728 | if (skb_transport_offset(skb) + ipv6_transport_len(skb) < | ||
6729 | - nsrcs_offset + sizeof(_nsrcs)) | ||
6730 | + nsrcs_offset + sizeof(__nsrcs)) | ||
6731 | return -EINVAL; | ||
6732 | |||
6733 | _nsrcs = skb_header_pointer(skb, nsrcs_offset, | ||
6734 | diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c | ||
6735 | index e513b8876d13..a8481da37f1a 100644 | ||
6736 | --- a/net/ceph/osd_client.c | ||
6737 | +++ b/net/ceph/osd_client.c | ||
6738 | @@ -445,6 +445,7 @@ static void target_copy(struct ceph_osd_request_target *dest, | ||
6739 | dest->size = src->size; | ||
6740 | dest->min_size = src->min_size; | ||
6741 | dest->sort_bitwise = src->sort_bitwise; | ||
6742 | + dest->recovery_deletes = src->recovery_deletes; | ||
6743 | |||
6744 | dest->flags = src->flags; | ||
6745 | dest->paused = src->paused; | ||
6746 | diff --git a/net/core/filter.c b/net/core/filter.c | ||
6747 | index a0a492f7cf9c..bd1e46d61d8a 100644 | ||
6748 | --- a/net/core/filter.c | ||
6749 | +++ b/net/core/filter.c | ||
6750 | @@ -5730,12 +5730,16 @@ BPF_CALL_1(bpf_skb_ecn_set_ce, struct sk_buff *, skb) | ||
6751 | { | ||
6752 | unsigned int iphdr_len; | ||
6753 | |||
6754 | - if (skb->protocol == cpu_to_be16(ETH_P_IP)) | ||
6755 | + switch (skb_protocol(skb, true)) { | ||
6756 | + case cpu_to_be16(ETH_P_IP): | ||
6757 | iphdr_len = sizeof(struct iphdr); | ||
6758 | - else if (skb->protocol == cpu_to_be16(ETH_P_IPV6)) | ||
6759 | + break; | ||
6760 | + case cpu_to_be16(ETH_P_IPV6): | ||
6761 | iphdr_len = sizeof(struct ipv6hdr); | ||
6762 | - else | ||
6763 | + break; | ||
6764 | + default: | ||
6765 | return 0; | ||
6766 | + } | ||
6767 | |||
6768 | if (skb_headlen(skb) < iphdr_len) | ||
6769 | return 0; | ||
6770 | diff --git a/net/core/sock.c b/net/core/sock.c | ||
6771 | index 078791a6649a..33a232974374 100644 | ||
6772 | --- a/net/core/sock.c | ||
6773 | +++ b/net/core/sock.c | ||
6774 | @@ -1837,7 +1837,7 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority) | ||
6775 | /* sk->sk_memcg will be populated at accept() time */ | ||
6776 | newsk->sk_memcg = NULL; | ||
6777 | |||
6778 | - cgroup_sk_alloc(&newsk->sk_cgrp_data); | ||
6779 | + cgroup_sk_clone(&newsk->sk_cgrp_data); | ||
6780 | |||
6781 | rcu_read_lock(); | ||
6782 | filter = rcu_dereference(sk->sk_filter); | ||
6783 | diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c | ||
6784 | index ac95ba78b903..73f46cb5e51d 100644 | ||
6785 | --- a/net/ipv4/icmp.c | ||
6786 | +++ b/net/ipv4/icmp.c | ||
6787 | @@ -427,7 +427,7 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb) | ||
6788 | |||
6789 | ipcm_init(&ipc); | ||
6790 | inet->tos = ip_hdr(skb)->tos; | ||
6791 | - sk->sk_mark = mark; | ||
6792 | + ipc.sockc.mark = mark; | ||
6793 | daddr = ipc.addr = ip_hdr(skb)->saddr; | ||
6794 | saddr = fib_compute_spec_dst(skb); | ||
6795 | |||
6796 | @@ -709,10 +709,10 @@ void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info, | ||
6797 | icmp_param.skb = skb_in; | ||
6798 | icmp_param.offset = skb_network_offset(skb_in); | ||
6799 | inet_sk(sk)->tos = tos; | ||
6800 | - sk->sk_mark = mark; | ||
6801 | ipcm_init(&ipc); | ||
6802 | ipc.addr = iph->saddr; | ||
6803 | ipc.opt = &icmp_param.replyopts.opt; | ||
6804 | + ipc.sockc.mark = mark; | ||
6805 | |||
6806 | rt = icmp_route_lookup(net, &fl4, skb_in, iph, saddr, tos, mark, | ||
6807 | type, code, &icmp_param); | ||
6808 | diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c | ||
6809 | index b268ee1c1b44..b36c4a3159e5 100644 | ||
6810 | --- a/net/ipv4/ip_output.c | ||
6811 | +++ b/net/ipv4/ip_output.c | ||
6812 | @@ -1704,7 +1704,7 @@ void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb, | ||
6813 | sk->sk_protocol = ip_hdr(skb)->protocol; | ||
6814 | sk->sk_bound_dev_if = arg->bound_dev_if; | ||
6815 | sk->sk_sndbuf = sysctl_wmem_default; | ||
6816 | - sk->sk_mark = fl4.flowi4_mark; | ||
6817 | + ipc.sockc.mark = fl4.flowi4_mark; | ||
6818 | err = ip_append_data(sk, &fl4, ip_reply_glue_bits, arg->iov->iov_base, | ||
6819 | len, 0, &ipc, &rt, MSG_DONTWAIT); | ||
6820 | if (unlikely(err)) { | ||
6821 | diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c | ||
6822 | index 535427292194..df6fbefe44d4 100644 | ||
6823 | --- a/net/ipv4/ping.c | ||
6824 | +++ b/net/ipv4/ping.c | ||
6825 | @@ -786,6 +786,9 @@ static int ping_v4_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) | ||
6826 | inet_sk_flowi_flags(sk), faddr, saddr, 0, 0, | ||
6827 | sk->sk_uid); | ||
6828 | |||
6829 | + fl4.fl4_icmp_type = user_icmph.type; | ||
6830 | + fl4.fl4_icmp_code = user_icmph.code; | ||
6831 | + | ||
6832 | security_sk_classify_flow(sk, flowi4_to_flowi(&fl4)); | ||
6833 | rt = ip_route_output_flow(net, &fl4, sk); | ||
6834 | if (IS_ERR(rt)) { | ||
6835 | diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c | ||
6836 | index fe3cdeddd097..840901154210 100644 | ||
6837 | --- a/net/ipv4/tcp.c | ||
6838 | +++ b/net/ipv4/tcp.c | ||
6839 | @@ -2631,6 +2631,9 @@ int tcp_disconnect(struct sock *sk, int flags) | ||
6840 | tp->window_clamp = 0; | ||
6841 | tp->delivered = 0; | ||
6842 | tp->delivered_ce = 0; | ||
6843 | + if (icsk->icsk_ca_ops->release) | ||
6844 | + icsk->icsk_ca_ops->release(sk); | ||
6845 | + memset(icsk->icsk_ca_priv, 0, sizeof(icsk->icsk_ca_priv)); | ||
6846 | tcp_set_ca_state(sk, TCP_CA_Open); | ||
6847 | tp->is_sack_reneg = 0; | ||
6848 | tcp_clear_retrans(tp); | ||
6849 | @@ -3085,10 +3088,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level, | ||
6850 | #ifdef CONFIG_TCP_MD5SIG | ||
6851 | case TCP_MD5SIG: | ||
6852 | case TCP_MD5SIG_EXT: | ||
6853 | - if ((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)) | ||
6854 | - err = tp->af_specific->md5_parse(sk, optname, optval, optlen); | ||
6855 | - else | ||
6856 | - err = -EINVAL; | ||
6857 | + err = tp->af_specific->md5_parse(sk, optname, optval, optlen); | ||
6858 | break; | ||
6859 | #endif | ||
6860 | case TCP_USER_TIMEOUT: | ||
6861 | @@ -3844,10 +3844,13 @@ EXPORT_SYMBOL(tcp_md5_hash_skb_data); | ||
6862 | |||
6863 | int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, const struct tcp_md5sig_key *key) | ||
6864 | { | ||
6865 | + u8 keylen = READ_ONCE(key->keylen); /* paired with WRITE_ONCE() in tcp_md5_do_add */ | ||
6866 | struct scatterlist sg; | ||
6867 | |||
6868 | - sg_init_one(&sg, key->key, key->keylen); | ||
6869 | - ahash_request_set_crypt(hp->md5_req, &sg, NULL, key->keylen); | ||
6870 | + sg_init_one(&sg, key->key, keylen); | ||
6871 | + ahash_request_set_crypt(hp->md5_req, &sg, NULL, keylen); | ||
6872 | + | ||
6873 | + /* tcp_md5_do_add() might change key->key under us */ | ||
6874 | return crypto_ahash_update(hp->md5_req); | ||
6875 | } | ||
6876 | EXPORT_SYMBOL(tcp_md5_hash_key); | ||
6877 | diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c | ||
6878 | index c445a81d144e..d7a1f2ef6c52 100644 | ||
6879 | --- a/net/ipv4/tcp_cong.c | ||
6880 | +++ b/net/ipv4/tcp_cong.c | ||
6881 | @@ -197,7 +197,7 @@ static void tcp_reinit_congestion_control(struct sock *sk, | ||
6882 | icsk->icsk_ca_setsockopt = 1; | ||
6883 | memset(icsk->icsk_ca_priv, 0, sizeof(icsk->icsk_ca_priv)); | ||
6884 | |||
6885 | - if (sk->sk_state != TCP_CLOSE) | ||
6886 | + if (!((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN))) | ||
6887 | tcp_init_congestion_control(sk); | ||
6888 | } | ||
6889 | |||
6890 | diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c | ||
6891 | index 3e63dc9c3eba..6d331307beca 100644 | ||
6892 | --- a/net/ipv4/tcp_input.c | ||
6893 | +++ b/net/ipv4/tcp_input.c | ||
6894 | @@ -4564,6 +4564,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb) | ||
6895 | |||
6896 | if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) { | ||
6897 | NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP); | ||
6898 | + sk->sk_data_ready(sk); | ||
6899 | tcp_drop(sk, skb); | ||
6900 | return; | ||
6901 | } | ||
6902 | @@ -4807,6 +4808,7 @@ queue_and_out: | ||
6903 | sk_forced_mem_schedule(sk, skb->truesize); | ||
6904 | else if (tcp_try_rmem_schedule(sk, skb, skb->truesize)) { | ||
6905 | NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRCVQDROP); | ||
6906 | + sk->sk_data_ready(sk); | ||
6907 | goto drop; | ||
6908 | } | ||
6909 | |||
6910 | diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c | ||
6911 | index eda64871f983..35f963690a70 100644 | ||
6912 | --- a/net/ipv4/tcp_ipv4.c | ||
6913 | +++ b/net/ipv4/tcp_ipv4.c | ||
6914 | @@ -1077,9 +1077,18 @@ int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr, | ||
6915 | |||
6916 | key = tcp_md5_do_lookup_exact(sk, addr, family, prefixlen); | ||
6917 | if (key) { | ||
6918 | - /* Pre-existing entry - just update that one. */ | ||
6919 | + /* Pre-existing entry - just update that one. | ||
6920 | + * Note that the key might be used concurrently. | ||
6921 | + */ | ||
6922 | memcpy(key->key, newkey, newkeylen); | ||
6923 | - key->keylen = newkeylen; | ||
6924 | + | ||
6925 | + /* Pairs with READ_ONCE() in tcp_md5_hash_key(). | ||
6926 | + * Also note that a reader could catch new key->keylen value | ||
6927 | + * but old key->key[], this is the reason we use __GFP_ZERO | ||
6928 | + * at sock_kmalloc() time below these lines. | ||
6929 | + */ | ||
6930 | + WRITE_ONCE(key->keylen, newkeylen); | ||
6931 | + | ||
6932 | return 0; | ||
6933 | } | ||
6934 | |||
6935 | @@ -1095,7 +1104,7 @@ int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr, | ||
6936 | rcu_assign_pointer(tp->md5sig_info, md5sig); | ||
6937 | } | ||
6938 | |||
6939 | - key = sock_kmalloc(sk, sizeof(*key), gfp); | ||
6940 | + key = sock_kmalloc(sk, sizeof(*key), gfp | __GFP_ZERO); | ||
6941 | if (!key) | ||
6942 | return -ENOMEM; | ||
6943 | if (!tcp_alloc_md5sig_pool()) { | ||
6944 | diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c | ||
6945 | index c8d03c1b4c6b..5dc7485c4076 100644 | ||
6946 | --- a/net/ipv4/tcp_output.c | ||
6947 | +++ b/net/ipv4/tcp_output.c | ||
6948 | @@ -662,7 +662,8 @@ static unsigned int tcp_synack_options(const struct sock *sk, | ||
6949 | unsigned int mss, struct sk_buff *skb, | ||
6950 | struct tcp_out_options *opts, | ||
6951 | const struct tcp_md5sig_key *md5, | ||
6952 | - struct tcp_fastopen_cookie *foc) | ||
6953 | + struct tcp_fastopen_cookie *foc, | ||
6954 | + enum tcp_synack_type synack_type) | ||
6955 | { | ||
6956 | struct inet_request_sock *ireq = inet_rsk(req); | ||
6957 | unsigned int remaining = MAX_TCP_OPTION_SPACE; | ||
6958 | @@ -677,7 +678,8 @@ static unsigned int tcp_synack_options(const struct sock *sk, | ||
6959 | * rather than TS in order to fit in better with old, | ||
6960 | * buggy kernels, but that was deemed to be unnecessary. | ||
6961 | */ | ||
6962 | - ireq->tstamp_ok &= !ireq->sack_ok; | ||
6963 | + if (synack_type != TCP_SYNACK_COOKIE) | ||
6964 | + ireq->tstamp_ok &= !ireq->sack_ok; | ||
6965 | } | ||
6966 | #endif | ||
6967 | |||
6968 | @@ -3326,7 +3328,7 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst, | ||
6969 | #endif | ||
6970 | skb_set_hash(skb, tcp_rsk(req)->txhash, PKT_HASH_TYPE_L4); | ||
6971 | tcp_header_size = tcp_synack_options(sk, req, mss, skb, &opts, md5, | ||
6972 | - foc) + sizeof(*th); | ||
6973 | + foc, synack_type) + sizeof(*th); | ||
6974 | |||
6975 | skb_push(skb, tcp_header_size); | ||
6976 | skb_reset_transport_header(skb); | ||
6977 | diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c | ||
6978 | index 62c997201970..7d3a3894f785 100644 | ||
6979 | --- a/net/ipv6/icmp.c | ||
6980 | +++ b/net/ipv6/icmp.c | ||
6981 | @@ -535,7 +535,6 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info, | ||
6982 | if (!sk) | ||
6983 | goto out_bh_enable; | ||
6984 | |||
6985 | - sk->sk_mark = mark; | ||
6986 | np = inet6_sk(sk); | ||
6987 | |||
6988 | if (!icmpv6_xrlim_allow(sk, type, &fl6)) | ||
6989 | @@ -552,6 +551,7 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info, | ||
6990 | fl6.flowi6_oif = np->ucast_oif; | ||
6991 | |||
6992 | ipcm6_init_sk(&ipc6, np); | ||
6993 | + ipc6.sockc.mark = mark; | ||
6994 | fl6.flowlabel = ip6_make_flowinfo(ipc6.tclass, fl6.flowlabel); | ||
6995 | |||
6996 | dst = icmpv6_route_lookup(net, skb, sk, &fl6); | ||
6997 | @@ -720,7 +720,6 @@ static void icmpv6_echo_reply(struct sk_buff *skb) | ||
6998 | sk = icmpv6_xmit_lock(net); | ||
6999 | if (!sk) | ||
7000 | goto out_bh_enable; | ||
7001 | - sk->sk_mark = mark; | ||
7002 | np = inet6_sk(sk); | ||
7003 | |||
7004 | if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr)) | ||
7005 | @@ -748,6 +747,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb) | ||
7006 | ipcm6_init_sk(&ipc6, np); | ||
7007 | ipc6.hlimit = ip6_sk_dst_hoplimit(np, &fl6, dst); | ||
7008 | ipc6.tclass = ipv6_get_dsfield(ipv6_hdr(skb)); | ||
7009 | + ipc6.sockc.mark = mark; | ||
7010 | |||
7011 | if (ip6_append_data(sk, icmpv6_getfrag, &msg, | ||
7012 | skb->len + sizeof(struct icmp6hdr), | ||
7013 | diff --git a/net/ipv6/route.c b/net/ipv6/route.c | ||
7014 | index 3b4af0a8bca6..94ade43d5a45 100644 | ||
7015 | --- a/net/ipv6/route.c | ||
7016 | +++ b/net/ipv6/route.c | ||
7017 | @@ -431,9 +431,12 @@ void fib6_select_path(const struct net *net, struct fib6_result *res, | ||
7018 | struct fib6_info *sibling, *next_sibling; | ||
7019 | struct fib6_info *match = res->f6i; | ||
7020 | |||
7021 | - if ((!match->fib6_nsiblings && !match->nh) || have_oif_match) | ||
7022 | + if (!match->nh && (!match->fib6_nsiblings || have_oif_match)) | ||
7023 | goto out; | ||
7024 | |||
7025 | + if (match->nh && have_oif_match && res->nh) | ||
7026 | + return; | ||
7027 | + | ||
7028 | /* We might have already computed the hash for ICMPv6 errors. In such | ||
7029 | * case it will always be non-zero. Otherwise now is the time to do it. | ||
7030 | */ | ||
7031 | @@ -3406,7 +3409,7 @@ static bool fib6_is_reject(u32 flags, struct net_device *dev, int addr_type) | ||
7032 | if ((flags & RTF_REJECT) || | ||
7033 | (dev && (dev->flags & IFF_LOOPBACK) && | ||
7034 | !(addr_type & IPV6_ADDR_LOOPBACK) && | ||
7035 | - !(flags & RTF_LOCAL))) | ||
7036 | + !(flags & (RTF_ANYCAST | RTF_LOCAL)))) | ||
7037 | return true; | ||
7038 | |||
7039 | return false; | ||
7040 | diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c | ||
7041 | index 6dc3bfa12b1e..95805a6331be 100644 | ||
7042 | --- a/net/l2tp/l2tp_core.c | ||
7043 | +++ b/net/l2tp/l2tp_core.c | ||
7044 | @@ -1030,6 +1030,7 @@ static void l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, | ||
7045 | |||
7046 | /* Queue the packet to IP for output */ | ||
7047 | skb->ignore_df = 1; | ||
7048 | + skb_dst_drop(skb); | ||
7049 | #if IS_ENABLED(CONFIG_IPV6) | ||
7050 | if (l2tp_sk_is_v6(tunnel->sock)) | ||
7051 | error = inet6_csk_xmit(tunnel->sock, skb, NULL); | ||
7052 | @@ -1101,10 +1102,6 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len | ||
7053 | goto out_unlock; | ||
7054 | } | ||
7055 | |||
7056 | - /* Get routing info from the tunnel socket */ | ||
7057 | - skb_dst_drop(skb); | ||
7058 | - skb_dst_set(skb, sk_dst_check(sk, 0)); | ||
7059 | - | ||
7060 | inet = inet_sk(sk); | ||
7061 | fl = &inet->cork.fl; | ||
7062 | switch (tunnel->encap) { | ||
7063 | diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c | ||
7064 | index c74f44dfaa22..5abb7f9b7ee5 100644 | ||
7065 | --- a/net/llc/af_llc.c | ||
7066 | +++ b/net/llc/af_llc.c | ||
7067 | @@ -273,6 +273,10 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) | ||
7068 | |||
7069 | if (!sock_flag(sk, SOCK_ZAPPED)) | ||
7070 | goto out; | ||
7071 | + if (!addr->sllc_arphrd) | ||
7072 | + addr->sllc_arphrd = ARPHRD_ETHER; | ||
7073 | + if (addr->sllc_arphrd != ARPHRD_ETHER) | ||
7074 | + goto out; | ||
7075 | rc = -ENODEV; | ||
7076 | if (sk->sk_bound_dev_if) { | ||
7077 | llc->dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if); | ||
7078 | @@ -328,7 +332,9 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) | ||
7079 | if (unlikely(!sock_flag(sk, SOCK_ZAPPED) || addrlen != sizeof(*addr))) | ||
7080 | goto out; | ||
7081 | rc = -EAFNOSUPPORT; | ||
7082 | - if (unlikely(addr->sllc_family != AF_LLC)) | ||
7083 | + if (!addr->sllc_arphrd) | ||
7084 | + addr->sllc_arphrd = ARPHRD_ETHER; | ||
7085 | + if (unlikely(addr->sllc_family != AF_LLC || addr->sllc_arphrd != ARPHRD_ETHER)) | ||
7086 | goto out; | ||
7087 | dprintk("%s: binding %02X\n", __func__, addr->sllc_sap); | ||
7088 | rc = -ENODEV; | ||
7089 | @@ -336,8 +342,6 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) | ||
7090 | if (sk->sk_bound_dev_if) { | ||
7091 | llc->dev = dev_get_by_index_rcu(&init_net, sk->sk_bound_dev_if); | ||
7092 | if (llc->dev) { | ||
7093 | - if (!addr->sllc_arphrd) | ||
7094 | - addr->sllc_arphrd = llc->dev->type; | ||
7095 | if (is_zero_ether_addr(addr->sllc_mac)) | ||
7096 | memcpy(addr->sllc_mac, llc->dev->dev_addr, | ||
7097 | IFHWADDRLEN); | ||
7098 | diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c | ||
7099 | index efccd1ac9a66..102b8d6b5612 100644 | ||
7100 | --- a/net/netlink/genetlink.c | ||
7101 | +++ b/net/netlink/genetlink.c | ||
7102 | @@ -989,60 +989,11 @@ static struct genl_family genl_ctrl __ro_after_init = { | ||
7103 | .netnsok = true, | ||
7104 | }; | ||
7105 | |||
7106 | -static int genl_bind(struct net *net, int group) | ||
7107 | -{ | ||
7108 | - struct genl_family *f; | ||
7109 | - int err = -ENOENT; | ||
7110 | - unsigned int id; | ||
7111 | - | ||
7112 | - down_read(&cb_lock); | ||
7113 | - | ||
7114 | - idr_for_each_entry(&genl_fam_idr, f, id) { | ||
7115 | - if (group >= f->mcgrp_offset && | ||
7116 | - group < f->mcgrp_offset + f->n_mcgrps) { | ||
7117 | - int fam_grp = group - f->mcgrp_offset; | ||
7118 | - | ||
7119 | - if (!f->netnsok && net != &init_net) | ||
7120 | - err = -ENOENT; | ||
7121 | - else if (f->mcast_bind) | ||
7122 | - err = f->mcast_bind(net, fam_grp); | ||
7123 | - else | ||
7124 | - err = 0; | ||
7125 | - break; | ||
7126 | - } | ||
7127 | - } | ||
7128 | - up_read(&cb_lock); | ||
7129 | - | ||
7130 | - return err; | ||
7131 | -} | ||
7132 | - | ||
7133 | -static void genl_unbind(struct net *net, int group) | ||
7134 | -{ | ||
7135 | - struct genl_family *f; | ||
7136 | - unsigned int id; | ||
7137 | - | ||
7138 | - down_read(&cb_lock); | ||
7139 | - | ||
7140 | - idr_for_each_entry(&genl_fam_idr, f, id) { | ||
7141 | - if (group >= f->mcgrp_offset && | ||
7142 | - group < f->mcgrp_offset + f->n_mcgrps) { | ||
7143 | - int fam_grp = group - f->mcgrp_offset; | ||
7144 | - | ||
7145 | - if (f->mcast_unbind) | ||
7146 | - f->mcast_unbind(net, fam_grp); | ||
7147 | - break; | ||
7148 | - } | ||
7149 | - } | ||
7150 | - up_read(&cb_lock); | ||
7151 | -} | ||
7152 | - | ||
7153 | static int __net_init genl_pernet_init(struct net *net) | ||
7154 | { | ||
7155 | struct netlink_kernel_cfg cfg = { | ||
7156 | .input = genl_rcv, | ||
7157 | .flags = NL_CFG_F_NONROOT_RECV, | ||
7158 | - .bind = genl_bind, | ||
7159 | - .unbind = genl_unbind, | ||
7160 | }; | ||
7161 | |||
7162 | /* we'll bump the group number right afterwards */ | ||
7163 | diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c | ||
7164 | index 2b43cacf82af..1a8f2f85ea1a 100644 | ||
7165 | --- a/net/sched/act_connmark.c | ||
7166 | +++ b/net/sched/act_connmark.c | ||
7167 | @@ -43,17 +43,20 @@ static int tcf_connmark_act(struct sk_buff *skb, const struct tc_action *a, | ||
7168 | tcf_lastuse_update(&ca->tcf_tm); | ||
7169 | bstats_update(&ca->tcf_bstats, skb); | ||
7170 | |||
7171 | - if (skb->protocol == htons(ETH_P_IP)) { | ||
7172 | + switch (skb_protocol(skb, true)) { | ||
7173 | + case htons(ETH_P_IP): | ||
7174 | if (skb->len < sizeof(struct iphdr)) | ||
7175 | goto out; | ||
7176 | |||
7177 | proto = NFPROTO_IPV4; | ||
7178 | - } else if (skb->protocol == htons(ETH_P_IPV6)) { | ||
7179 | + break; | ||
7180 | + case htons(ETH_P_IPV6): | ||
7181 | if (skb->len < sizeof(struct ipv6hdr)) | ||
7182 | goto out; | ||
7183 | |||
7184 | proto = NFPROTO_IPV6; | ||
7185 | - } else { | ||
7186 | + break; | ||
7187 | + default: | ||
7188 | goto out; | ||
7189 | } | ||
7190 | |||
7191 | diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c | ||
7192 | index d3cfad88dc3a..428b1ae00123 100644 | ||
7193 | --- a/net/sched/act_csum.c | ||
7194 | +++ b/net/sched/act_csum.c | ||
7195 | @@ -587,7 +587,7 @@ static int tcf_csum_act(struct sk_buff *skb, const struct tc_action *a, | ||
7196 | goto drop; | ||
7197 | |||
7198 | update_flags = params->update_flags; | ||
7199 | - protocol = tc_skb_protocol(skb); | ||
7200 | + protocol = skb_protocol(skb, false); | ||
7201 | again: | ||
7202 | switch (protocol) { | ||
7203 | case cpu_to_be16(ETH_P_IP): | ||
7204 | diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c | ||
7205 | index 0586546c20d7..e0060aefbf9d 100644 | ||
7206 | --- a/net/sched/act_ct.c | ||
7207 | +++ b/net/sched/act_ct.c | ||
7208 | @@ -100,7 +100,7 @@ static u8 tcf_ct_skb_nf_family(struct sk_buff *skb) | ||
7209 | { | ||
7210 | u8 family = NFPROTO_UNSPEC; | ||
7211 | |||
7212 | - switch (skb->protocol) { | ||
7213 | + switch (skb_protocol(skb, true)) { | ||
7214 | case htons(ETH_P_IP): | ||
7215 | family = NFPROTO_IPV4; | ||
7216 | break; | ||
7217 | @@ -222,6 +222,7 @@ static int ct_nat_execute(struct sk_buff *skb, struct nf_conn *ct, | ||
7218 | const struct nf_nat_range2 *range, | ||
7219 | enum nf_nat_manip_type maniptype) | ||
7220 | { | ||
7221 | + __be16 proto = skb_protocol(skb, true); | ||
7222 | int hooknum, err = NF_ACCEPT; | ||
7223 | |||
7224 | /* See HOOK2MANIP(). */ | ||
7225 | @@ -233,14 +234,13 @@ static int ct_nat_execute(struct sk_buff *skb, struct nf_conn *ct, | ||
7226 | switch (ctinfo) { | ||
7227 | case IP_CT_RELATED: | ||
7228 | case IP_CT_RELATED_REPLY: | ||
7229 | - if (skb->protocol == htons(ETH_P_IP) && | ||
7230 | + if (proto == htons(ETH_P_IP) && | ||
7231 | ip_hdr(skb)->protocol == IPPROTO_ICMP) { | ||
7232 | if (!nf_nat_icmp_reply_translation(skb, ct, ctinfo, | ||
7233 | hooknum)) | ||
7234 | err = NF_DROP; | ||
7235 | goto out; | ||
7236 | - } else if (IS_ENABLED(CONFIG_IPV6) && | ||
7237 | - skb->protocol == htons(ETH_P_IPV6)) { | ||
7238 | + } else if (IS_ENABLED(CONFIG_IPV6) && proto == htons(ETH_P_IPV6)) { | ||
7239 | __be16 frag_off; | ||
7240 | u8 nexthdr = ipv6_hdr(skb)->nexthdr; | ||
7241 | int hdrlen = ipv6_skip_exthdr(skb, | ||
7242 | @@ -993,4 +993,3 @@ MODULE_AUTHOR("Yossi Kuperman <yossiku@mellanox.com>"); | ||
7243 | MODULE_AUTHOR("Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>"); | ||
7244 | MODULE_DESCRIPTION("Connection tracking action"); | ||
7245 | MODULE_LICENSE("GPL v2"); | ||
7246 | - | ||
7247 | diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c | ||
7248 | index f45995a6237a..a91fcee810ef 100644 | ||
7249 | --- a/net/sched/act_ctinfo.c | ||
7250 | +++ b/net/sched/act_ctinfo.c | ||
7251 | @@ -96,19 +96,22 @@ static int tcf_ctinfo_act(struct sk_buff *skb, const struct tc_action *a, | ||
7252 | action = READ_ONCE(ca->tcf_action); | ||
7253 | |||
7254 | wlen = skb_network_offset(skb); | ||
7255 | - if (tc_skb_protocol(skb) == htons(ETH_P_IP)) { | ||
7256 | + switch (skb_protocol(skb, true)) { | ||
7257 | + case htons(ETH_P_IP): | ||
7258 | wlen += sizeof(struct iphdr); | ||
7259 | if (!pskb_may_pull(skb, wlen)) | ||
7260 | goto out; | ||
7261 | |||
7262 | proto = NFPROTO_IPV4; | ||
7263 | - } else if (tc_skb_protocol(skb) == htons(ETH_P_IPV6)) { | ||
7264 | + break; | ||
7265 | + case htons(ETH_P_IPV6): | ||
7266 | wlen += sizeof(struct ipv6hdr); | ||
7267 | if (!pskb_may_pull(skb, wlen)) | ||
7268 | goto out; | ||
7269 | |||
7270 | proto = NFPROTO_IPV6; | ||
7271 | - } else { | ||
7272 | + break; | ||
7273 | + default: | ||
7274 | goto out; | ||
7275 | } | ||
7276 | |||
7277 | diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c | ||
7278 | index db570d2bd0e0..f786775699b5 100644 | ||
7279 | --- a/net/sched/act_mpls.c | ||
7280 | +++ b/net/sched/act_mpls.c | ||
7281 | @@ -82,7 +82,7 @@ static int tcf_mpls_act(struct sk_buff *skb, const struct tc_action *a, | ||
7282 | goto drop; | ||
7283 | break; | ||
7284 | case TCA_MPLS_ACT_PUSH: | ||
7285 | - new_lse = tcf_mpls_get_lse(NULL, p, !eth_p_mpls(skb->protocol)); | ||
7286 | + new_lse = tcf_mpls_get_lse(NULL, p, !eth_p_mpls(skb_protocol(skb, true))); | ||
7287 | if (skb_mpls_push(skb, new_lse, p->tcfm_proto, mac_len, | ||
7288 | skb->dev && skb->dev->type == ARPHRD_ETHER)) | ||
7289 | goto drop; | ||
7290 | diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c | ||
7291 | index 6a8d3337c577..f98b2791ecec 100644 | ||
7292 | --- a/net/sched/act_skbedit.c | ||
7293 | +++ b/net/sched/act_skbedit.c | ||
7294 | @@ -41,7 +41,7 @@ static int tcf_skbedit_act(struct sk_buff *skb, const struct tc_action *a, | ||
7295 | if (params->flags & SKBEDIT_F_INHERITDSFIELD) { | ||
7296 | int wlen = skb_network_offset(skb); | ||
7297 | |||
7298 | - switch (tc_skb_protocol(skb)) { | ||
7299 | + switch (skb_protocol(skb, true)) { | ||
7300 | case htons(ETH_P_IP): | ||
7301 | wlen += sizeof(struct iphdr); | ||
7302 | if (!pskb_may_pull(skb, wlen)) | ||
7303 | diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c | ||
7304 | index 68c8fc6f535c..d7604417367d 100644 | ||
7305 | --- a/net/sched/cls_api.c | ||
7306 | +++ b/net/sched/cls_api.c | ||
7307 | @@ -1571,7 +1571,7 @@ int tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp, | ||
7308 | reclassify: | ||
7309 | #endif | ||
7310 | for (; tp; tp = rcu_dereference_bh(tp->next)) { | ||
7311 | - __be16 protocol = tc_skb_protocol(skb); | ||
7312 | + __be16 protocol = skb_protocol(skb, false); | ||
7313 | int err; | ||
7314 | |||
7315 | if (tp->protocol != protocol && | ||
7316 | diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c | ||
7317 | index 80ae7b9fa90a..ab53a93b2f2b 100644 | ||
7318 | --- a/net/sched/cls_flow.c | ||
7319 | +++ b/net/sched/cls_flow.c | ||
7320 | @@ -80,7 +80,7 @@ static u32 flow_get_dst(const struct sk_buff *skb, const struct flow_keys *flow) | ||
7321 | if (dst) | ||
7322 | return ntohl(dst); | ||
7323 | |||
7324 | - return addr_fold(skb_dst(skb)) ^ (__force u16) tc_skb_protocol(skb); | ||
7325 | + return addr_fold(skb_dst(skb)) ^ (__force u16)skb_protocol(skb, true); | ||
7326 | } | ||
7327 | |||
7328 | static u32 flow_get_proto(const struct sk_buff *skb, | ||
7329 | @@ -104,7 +104,7 @@ static u32 flow_get_proto_dst(const struct sk_buff *skb, | ||
7330 | if (flow->ports.ports) | ||
7331 | return ntohs(flow->ports.dst); | ||
7332 | |||
7333 | - return addr_fold(skb_dst(skb)) ^ (__force u16) tc_skb_protocol(skb); | ||
7334 | + return addr_fold(skb_dst(skb)) ^ (__force u16)skb_protocol(skb, true); | ||
7335 | } | ||
7336 | |||
7337 | static u32 flow_get_iif(const struct sk_buff *skb) | ||
7338 | @@ -151,7 +151,7 @@ static u32 flow_get_nfct(const struct sk_buff *skb) | ||
7339 | static u32 flow_get_nfct_src(const struct sk_buff *skb, | ||
7340 | const struct flow_keys *flow) | ||
7341 | { | ||
7342 | - switch (tc_skb_protocol(skb)) { | ||
7343 | + switch (skb_protocol(skb, true)) { | ||
7344 | case htons(ETH_P_IP): | ||
7345 | return ntohl(CTTUPLE(skb, src.u3.ip)); | ||
7346 | case htons(ETH_P_IPV6): | ||
7347 | @@ -164,7 +164,7 @@ fallback: | ||
7348 | static u32 flow_get_nfct_dst(const struct sk_buff *skb, | ||
7349 | const struct flow_keys *flow) | ||
7350 | { | ||
7351 | - switch (tc_skb_protocol(skb)) { | ||
7352 | + switch (skb_protocol(skb, true)) { | ||
7353 | case htons(ETH_P_IP): | ||
7354 | return ntohl(CTTUPLE(skb, dst.u3.ip)); | ||
7355 | case htons(ETH_P_IPV6): | ||
7356 | diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c | ||
7357 | index 1d270540e74d..c5a0f2c2635e 100644 | ||
7358 | --- a/net/sched/cls_flower.c | ||
7359 | +++ b/net/sched/cls_flower.c | ||
7360 | @@ -310,7 +310,7 @@ static int fl_classify(struct sk_buff *skb, const struct tcf_proto *tp, | ||
7361 | /* skb_flow_dissect() does not set n_proto in case an unknown | ||
7362 | * protocol, so do it rather here. | ||
7363 | */ | ||
7364 | - skb_key.basic.n_proto = skb->protocol; | ||
7365 | + skb_key.basic.n_proto = skb_protocol(skb, false); | ||
7366 | skb_flow_dissect_tunnel_info(skb, &mask->dissector, &skb_key); | ||
7367 | skb_flow_dissect_ct(skb, &mask->dissector, &skb_key, | ||
7368 | fl_ct_info_to_flower_map, | ||
7369 | diff --git a/net/sched/em_ipset.c b/net/sched/em_ipset.c | ||
7370 | index df00566d327d..c95cf86fb431 100644 | ||
7371 | --- a/net/sched/em_ipset.c | ||
7372 | +++ b/net/sched/em_ipset.c | ||
7373 | @@ -59,7 +59,7 @@ static int em_ipset_match(struct sk_buff *skb, struct tcf_ematch *em, | ||
7374 | }; | ||
7375 | int ret, network_offset; | ||
7376 | |||
7377 | - switch (tc_skb_protocol(skb)) { | ||
7378 | + switch (skb_protocol(skb, true)) { | ||
7379 | case htons(ETH_P_IP): | ||
7380 | state.pf = NFPROTO_IPV4; | ||
7381 | if (!pskb_network_may_pull(skb, sizeof(struct iphdr))) | ||
7382 | diff --git a/net/sched/em_ipt.c b/net/sched/em_ipt.c | ||
7383 | index 9fff6480acc6..e2c157df3f8b 100644 | ||
7384 | --- a/net/sched/em_ipt.c | ||
7385 | +++ b/net/sched/em_ipt.c | ||
7386 | @@ -212,7 +212,7 @@ static int em_ipt_match(struct sk_buff *skb, struct tcf_ematch *em, | ||
7387 | struct nf_hook_state state; | ||
7388 | int ret; | ||
7389 | |||
7390 | - switch (tc_skb_protocol(skb)) { | ||
7391 | + switch (skb_protocol(skb, true)) { | ||
7392 | case htons(ETH_P_IP): | ||
7393 | if (!pskb_network_may_pull(skb, sizeof(struct iphdr))) | ||
7394 | return 0; | ||
7395 | diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c | ||
7396 | index 3177dcb17316..ad007cdcec97 100644 | ||
7397 | --- a/net/sched/em_meta.c | ||
7398 | +++ b/net/sched/em_meta.c | ||
7399 | @@ -195,7 +195,7 @@ META_COLLECTOR(int_priority) | ||
7400 | META_COLLECTOR(int_protocol) | ||
7401 | { | ||
7402 | /* Let userspace take care of the byte ordering */ | ||
7403 | - dst->value = tc_skb_protocol(skb); | ||
7404 | + dst->value = skb_protocol(skb, false); | ||
7405 | } | ||
7406 | |||
7407 | META_COLLECTOR(int_pkttype) | ||
7408 | diff --git a/net/sched/sch_atm.c b/net/sched/sch_atm.c | ||
7409 | index f4f9b8cdbffb..6385995dc700 100644 | ||
7410 | --- a/net/sched/sch_atm.c | ||
7411 | +++ b/net/sched/sch_atm.c | ||
7412 | @@ -553,16 +553,16 @@ static int atm_tc_init(struct Qdisc *sch, struct nlattr *opt, | ||
7413 | if (!p->link.q) | ||
7414 | p->link.q = &noop_qdisc; | ||
7415 | pr_debug("atm_tc_init: link (%p) qdisc %p\n", &p->link, p->link.q); | ||
7416 | + p->link.vcc = NULL; | ||
7417 | + p->link.sock = NULL; | ||
7418 | + p->link.common.classid = sch->handle; | ||
7419 | + p->link.ref = 1; | ||
7420 | |||
7421 | err = tcf_block_get(&p->link.block, &p->link.filter_list, sch, | ||
7422 | extack); | ||
7423 | if (err) | ||
7424 | return err; | ||
7425 | |||
7426 | - p->link.vcc = NULL; | ||
7427 | - p->link.sock = NULL; | ||
7428 | - p->link.common.classid = sch->handle; | ||
7429 | - p->link.ref = 1; | ||
7430 | tasklet_init(&p->task, sch_atm_dequeue, (unsigned long)sch); | ||
7431 | return 0; | ||
7432 | } | ||
7433 | diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c | ||
7434 | index 5d605bab9afc..896c0562cb42 100644 | ||
7435 | --- a/net/sched/sch_cake.c | ||
7436 | +++ b/net/sched/sch_cake.c | ||
7437 | @@ -592,7 +592,7 @@ static void cake_update_flowkeys(struct flow_keys *keys, | ||
7438 | struct nf_conntrack_tuple tuple = {}; | ||
7439 | bool rev = !skb->_nfct; | ||
7440 | |||
7441 | - if (tc_skb_protocol(skb) != htons(ETH_P_IP)) | ||
7442 | + if (skb_protocol(skb, true) != htons(ETH_P_IP)) | ||
7443 | return; | ||
7444 | |||
7445 | if (!nf_ct_get_tuple_skb(&tuple, skb)) | ||
7446 | @@ -1521,7 +1521,7 @@ static u8 cake_handle_diffserv(struct sk_buff *skb, bool wash) | ||
7447 | u16 *buf, buf_; | ||
7448 | u8 dscp; | ||
7449 | |||
7450 | - switch (tc_skb_protocol(skb)) { | ||
7451 | + switch (skb_protocol(skb, true)) { | ||
7452 | case htons(ETH_P_IP): | ||
7453 | buf = skb_header_pointer(skb, offset, sizeof(buf_), &buf_); | ||
7454 | if (unlikely(!buf)) | ||
7455 | diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c | ||
7456 | index 05605b30bef3..2b88710994d7 100644 | ||
7457 | --- a/net/sched/sch_dsmark.c | ||
7458 | +++ b/net/sched/sch_dsmark.c | ||
7459 | @@ -210,7 +210,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch, | ||
7460 | if (p->set_tc_index) { | ||
7461 | int wlen = skb_network_offset(skb); | ||
7462 | |||
7463 | - switch (tc_skb_protocol(skb)) { | ||
7464 | + switch (skb_protocol(skb, true)) { | ||
7465 | case htons(ETH_P_IP): | ||
7466 | wlen += sizeof(struct iphdr); | ||
7467 | if (!pskb_may_pull(skb, wlen) || | ||
7468 | @@ -303,7 +303,7 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch) | ||
7469 | index = skb->tc_index & (p->indices - 1); | ||
7470 | pr_debug("index %d->%d\n", skb->tc_index, index); | ||
7471 | |||
7472 | - switch (tc_skb_protocol(skb)) { | ||
7473 | + switch (skb_protocol(skb, true)) { | ||
7474 | case htons(ETH_P_IP): | ||
7475 | ipv4_change_dsfield(ip_hdr(skb), p->mv[index].mask, | ||
7476 | p->mv[index].value); | ||
7477 | @@ -320,7 +320,7 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch) | ||
7478 | */ | ||
7479 | if (p->mv[index].mask != 0xff || p->mv[index].value) | ||
7480 | pr_warn("%s: unsupported protocol %d\n", | ||
7481 | - __func__, ntohs(tc_skb_protocol(skb))); | ||
7482 | + __func__, ntohs(skb_protocol(skb, true))); | ||
7483 | break; | ||
7484 | } | ||
7485 | |||
7486 | diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c | ||
7487 | index 689ef6f3ded8..2f1f0a378408 100644 | ||
7488 | --- a/net/sched/sch_teql.c | ||
7489 | +++ b/net/sched/sch_teql.c | ||
7490 | @@ -239,7 +239,7 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, | ||
7491 | char haddr[MAX_ADDR_LEN]; | ||
7492 | |||
7493 | neigh_ha_snapshot(haddr, n, dev); | ||
7494 | - err = dev_hard_header(skb, dev, ntohs(tc_skb_protocol(skb)), | ||
7495 | + err = dev_hard_header(skb, dev, ntohs(skb_protocol(skb, false)), | ||
7496 | haddr, NULL, skb->len); | ||
7497 | |||
7498 | if (err < 0) | ||
7499 | diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c | ||
7500 | index c56e6cfc4a62..21970185485f 100644 | ||
7501 | --- a/net/sunrpc/xprtrdma/rpc_rdma.c | ||
7502 | +++ b/net/sunrpc/xprtrdma/rpc_rdma.c | ||
7503 | @@ -71,7 +71,7 @@ static unsigned int rpcrdma_max_call_header_size(unsigned int maxsegs) | ||
7504 | size = RPCRDMA_HDRLEN_MIN; | ||
7505 | |||
7506 | /* Maximum Read list size */ | ||
7507 | - size = maxsegs * rpcrdma_readchunk_maxsz * sizeof(__be32); | ||
7508 | + size += maxsegs * rpcrdma_readchunk_maxsz * sizeof(__be32); | ||
7509 | |||
7510 | /* Minimal Read chunk size */ | ||
7511 | size += sizeof(__be32); /* segment count */ | ||
7512 | @@ -96,7 +96,7 @@ static unsigned int rpcrdma_max_reply_header_size(unsigned int maxsegs) | ||
7513 | size = RPCRDMA_HDRLEN_MIN; | ||
7514 | |||
7515 | /* Maximum Write list size */ | ||
7516 | - size = sizeof(__be32); /* segment count */ | ||
7517 | + size += sizeof(__be32); /* segment count */ | ||
7518 | size += maxsegs * rpcrdma_segment_maxsz * sizeof(__be32); | ||
7519 | size += sizeof(__be32); /* list discriminator */ | ||
7520 | |||
7521 | diff --git a/security/apparmor/match.c b/security/apparmor/match.c | ||
7522 | index 6ccd3734a841..43669403f755 100644 | ||
7523 | --- a/security/apparmor/match.c | ||
7524 | +++ b/security/apparmor/match.c | ||
7525 | @@ -97,6 +97,9 @@ static struct table_header *unpack_table(char *blob, size_t bsize) | ||
7526 | th.td_flags == YYTD_DATA8)) | ||
7527 | goto out; | ||
7528 | |||
7529 | + /* if we have a table it must have some entries */ | ||
7530 | + if (th.td_lolen == 0) | ||
7531 | + goto out; | ||
7532 | tsize = table_size(th.td_lolen, th.td_flags); | ||
7533 | if (bsize < tsize) | ||
7534 | goto out; | ||
7535 | @@ -198,6 +201,8 @@ static int verify_dfa(struct aa_dfa *dfa) | ||
7536 | |||
7537 | state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; | ||
7538 | trans_count = dfa->tables[YYTD_ID_NXT]->td_lolen; | ||
7539 | + if (state_count == 0) | ||
7540 | + goto out; | ||
7541 | for (i = 0; i < state_count; i++) { | ||
7542 | if (!(BASE_TABLE(dfa)[i] & MATCH_FLAG_DIFF_ENCODE) && | ||
7543 | (DEFAULT_TABLE(dfa)[i] >= state_count)) | ||
7544 | diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c | ||
7545 | index 160e00e8007a..6ffdf3d2d526 100644 | ||
7546 | --- a/sound/pci/hda/patch_realtek.c | ||
7547 | +++ b/sound/pci/hda/patch_realtek.c | ||
7548 | @@ -6117,6 +6117,8 @@ enum { | ||
7549 | ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS, | ||
7550 | ALC269VC_FIXUP_ACER_HEADSET_MIC, | ||
7551 | ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE, | ||
7552 | + ALC289_FIXUP_ASUS_G401, | ||
7553 | + ALC256_FIXUP_ACER_MIC_NO_PRESENCE, | ||
7554 | }; | ||
7555 | |||
7556 | static const struct hda_fixup alc269_fixups[] = { | ||
7557 | @@ -7082,7 +7084,7 @@ static const struct hda_fixup alc269_fixups[] = { | ||
7558 | { } | ||
7559 | }, | ||
7560 | .chained = true, | ||
7561 | - .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | ||
7562 | + .chain_id = ALC269_FIXUP_HEADSET_MIC | ||
7563 | }, | ||
7564 | [ALC294_FIXUP_ASUS_HEADSET_MIC] = { | ||
7565 | .type = HDA_FIXUP_PINS, | ||
7566 | @@ -7091,7 +7093,7 @@ static const struct hda_fixup alc269_fixups[] = { | ||
7567 | { } | ||
7568 | }, | ||
7569 | .chained = true, | ||
7570 | - .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | ||
7571 | + .chain_id = ALC269_FIXUP_HEADSET_MIC | ||
7572 | }, | ||
7573 | [ALC294_FIXUP_ASUS_SPK] = { | ||
7574 | .type = HDA_FIXUP_VERBS, | ||
7575 | @@ -7099,6 +7101,8 @@ static const struct hda_fixup alc269_fixups[] = { | ||
7576 | /* Set EAPD high */ | ||
7577 | { 0x20, AC_VERB_SET_COEF_INDEX, 0x40 }, | ||
7578 | { 0x20, AC_VERB_SET_PROC_COEF, 0x8800 }, | ||
7579 | + { 0x20, AC_VERB_SET_COEF_INDEX, 0x0f }, | ||
7580 | + { 0x20, AC_VERB_SET_PROC_COEF, 0x7774 }, | ||
7581 | { } | ||
7582 | }, | ||
7583 | .chained = true, | ||
7584 | @@ -7324,6 +7328,22 @@ static const struct hda_fixup alc269_fixups[] = { | ||
7585 | .chained = true, | ||
7586 | .chain_id = ALC269_FIXUP_HEADSET_MIC | ||
7587 | }, | ||
7588 | + [ALC289_FIXUP_ASUS_G401] = { | ||
7589 | + .type = HDA_FIXUP_PINS, | ||
7590 | + .v.pins = (const struct hda_pintbl[]) { | ||
7591 | + { 0x19, 0x03a11020 }, /* headset mic with jack detect */ | ||
7592 | + { } | ||
7593 | + }, | ||
7594 | + }, | ||
7595 | + [ALC256_FIXUP_ACER_MIC_NO_PRESENCE] = { | ||
7596 | + .type = HDA_FIXUP_PINS, | ||
7597 | + .v.pins = (const struct hda_pintbl[]) { | ||
7598 | + { 0x19, 0x02a11120 }, /* use as headset mic, without its own jack detect */ | ||
7599 | + { } | ||
7600 | + }, | ||
7601 | + .chained = true, | ||
7602 | + .chain_id = ALC256_FIXUP_ASUS_HEADSET_MODE | ||
7603 | + }, | ||
7604 | }; | ||
7605 | |||
7606 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { | ||
7607 | @@ -7352,6 +7372,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | ||
7608 | SND_PCI_QUIRK(0x1025, 0x1308, "Acer Aspire Z24-890", ALC286_FIXUP_ACER_AIO_HEADSET_MIC), | ||
7609 | SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), | ||
7610 | SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), | ||
7611 | + SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), | ||
7612 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), | ||
7613 | SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), | ||
7614 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), | ||
7615 | @@ -7495,6 +7516,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | ||
7616 | SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), | ||
7617 | SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), | ||
7618 | SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), | ||
7619 | + SND_PCI_QUIRK(0x1043, 0x194e, "ASUS UX563FD", ALC294_FIXUP_ASUS_HPE), | ||
7620 | SND_PCI_QUIRK(0x1043, 0x19ce, "ASUS B9450FA", ALC294_FIXUP_ASUS_HPE), | ||
7621 | SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), | ||
7622 | SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), | ||
7623 | @@ -7504,6 +7526,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | ||
7624 | SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), | ||
7625 | SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | ||
7626 | SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), | ||
7627 | + SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_G401), | ||
7628 | SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), | ||
7629 | SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), | ||
7630 | SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), | ||
7631 | diff --git a/sound/usb/card.c b/sound/usb/card.c | ||
7632 | index f9a64e9526f5..230d862cfa3a 100644 | ||
7633 | --- a/sound/usb/card.c | ||
7634 | +++ b/sound/usb/card.c | ||
7635 | @@ -659,10 +659,14 @@ static int usb_audio_probe(struct usb_interface *intf, | ||
7636 | goto __error; | ||
7637 | } | ||
7638 | |||
7639 | - /* we are allowed to call snd_card_register() many times */ | ||
7640 | - err = snd_card_register(chip->card); | ||
7641 | - if (err < 0) | ||
7642 | - goto __error; | ||
7643 | + /* we are allowed to call snd_card_register() many times, but first | ||
7644 | + * check to see if a device needs to skip it or do anything special | ||
7645 | + */ | ||
7646 | + if (!snd_usb_registration_quirk(chip, ifnum)) { | ||
7647 | + err = snd_card_register(chip->card); | ||
7648 | + if (err < 0) | ||
7649 | + goto __error; | ||
7650 | + } | ||
7651 | |||
7652 | if (quirk && quirk->shares_media_device) { | ||
7653 | /* don't want to fail when snd_media_device_create() fails */ | ||
7654 | diff --git a/sound/usb/clock.c b/sound/usb/clock.c | ||
7655 | index a48313dfa967..b118cf97607f 100644 | ||
7656 | --- a/sound/usb/clock.c | ||
7657 | +++ b/sound/usb/clock.c | ||
7658 | @@ -151,16 +151,15 @@ static int uac_clock_selector_set_val(struct snd_usb_audio *chip, int selector_i | ||
7659 | return ret; | ||
7660 | } | ||
7661 | |||
7662 | -/* | ||
7663 | - * Assume the clock is valid if clock source supports only one single sample | ||
7664 | - * rate, the terminal is connected directly to it (there is no clock selector) | ||
7665 | - * and clock type is internal. This is to deal with some Denon DJ controllers | ||
7666 | - * that always reports that clock is invalid. | ||
7667 | - */ | ||
7668 | static bool uac_clock_source_is_valid_quirk(struct snd_usb_audio *chip, | ||
7669 | struct audioformat *fmt, | ||
7670 | int source_id) | ||
7671 | { | ||
7672 | + bool ret = false; | ||
7673 | + int count; | ||
7674 | + unsigned char data; | ||
7675 | + struct usb_device *dev = chip->dev; | ||
7676 | + | ||
7677 | if (fmt->protocol == UAC_VERSION_2) { | ||
7678 | struct uac_clock_source_descriptor *cs_desc = | ||
7679 | snd_usb_find_clock_source(chip->ctrl_intf, source_id); | ||
7680 | @@ -168,13 +167,51 @@ static bool uac_clock_source_is_valid_quirk(struct snd_usb_audio *chip, | ||
7681 | if (!cs_desc) | ||
7682 | return false; | ||
7683 | |||
7684 | - return (fmt->nr_rates == 1 && | ||
7685 | - (fmt->clock & 0xff) == cs_desc->bClockID && | ||
7686 | - (cs_desc->bmAttributes & 0x3) != | ||
7687 | - UAC_CLOCK_SOURCE_TYPE_EXT); | ||
7688 | + /* | ||
7689 | + * Assume the clock is valid if clock source supports only one | ||
7690 | + * single sample rate, the terminal is connected directly to it | ||
7691 | + * (there is no clock selector) and clock type is internal. | ||
7692 | + * This is to deal with some Denon DJ controllers that always | ||
7693 | + * reports that clock is invalid. | ||
7694 | + */ | ||
7695 | + if (fmt->nr_rates == 1 && | ||
7696 | + (fmt->clock & 0xff) == cs_desc->bClockID && | ||
7697 | + (cs_desc->bmAttributes & 0x3) != | ||
7698 | + UAC_CLOCK_SOURCE_TYPE_EXT) | ||
7699 | + return true; | ||
7700 | + } | ||
7701 | + | ||
7702 | + /* | ||
7703 | + * MOTU MicroBook IIc | ||
7704 | + * Sample rate changes takes more than 2 seconds for this device. Clock | ||
7705 | + * validity request returns false during that period. | ||
7706 | + */ | ||
7707 | + if (chip->usb_id == USB_ID(0x07fd, 0x0004)) { | ||
7708 | + count = 0; | ||
7709 | + | ||
7710 | + while ((!ret) && (count < 50)) { | ||
7711 | + int err; | ||
7712 | + | ||
7713 | + msleep(100); | ||
7714 | + | ||
7715 | + err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR, | ||
7716 | + USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, | ||
7717 | + UAC2_CS_CONTROL_CLOCK_VALID << 8, | ||
7718 | + snd_usb_ctrl_intf(chip) | (source_id << 8), | ||
7719 | + &data, sizeof(data)); | ||
7720 | + if (err < 0) { | ||
7721 | + dev_warn(&dev->dev, | ||
7722 | + "%s(): cannot get clock validity for id %d\n", | ||
7723 | + __func__, source_id); | ||
7724 | + return false; | ||
7725 | + } | ||
7726 | + | ||
7727 | + ret = !!data; | ||
7728 | + count++; | ||
7729 | + } | ||
7730 | } | ||
7731 | |||
7732 | - return false; | ||
7733 | + return ret; | ||
7734 | } | ||
7735 | |||
7736 | static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, | ||
7737 | diff --git a/sound/usb/line6/capture.c b/sound/usb/line6/capture.c | ||
7738 | index 82abef3fe90d..4b6e99e055dc 100644 | ||
7739 | --- a/sound/usb/line6/capture.c | ||
7740 | +++ b/sound/usb/line6/capture.c | ||
7741 | @@ -287,6 +287,8 @@ int line6_create_audio_in_urbs(struct snd_line6_pcm *line6pcm) | ||
7742 | urb->interval = LINE6_ISO_INTERVAL; | ||
7743 | urb->error_count = 0; | ||
7744 | urb->complete = audio_in_callback; | ||
7745 | + if (usb_urb_ep_type_check(urb)) | ||
7746 | + return -EINVAL; | ||
7747 | } | ||
7748 | |||
7749 | return 0; | ||
7750 | diff --git a/sound/usb/line6/driver.c b/sound/usb/line6/driver.c | ||
7751 | index 4f096685ed65..0caf53f5764c 100644 | ||
7752 | --- a/sound/usb/line6/driver.c | ||
7753 | +++ b/sound/usb/line6/driver.c | ||
7754 | @@ -820,7 +820,7 @@ void line6_disconnect(struct usb_interface *interface) | ||
7755 | if (WARN_ON(usbdev != line6->usbdev)) | ||
7756 | return; | ||
7757 | |||
7758 | - cancel_delayed_work(&line6->startup_work); | ||
7759 | + cancel_delayed_work_sync(&line6->startup_work); | ||
7760 | |||
7761 | if (line6->urb_listen != NULL) | ||
7762 | line6_stop_listen(line6); | ||
7763 | diff --git a/sound/usb/line6/playback.c b/sound/usb/line6/playback.c | ||
7764 | index 2e8ead3f9bc2..797ced329b79 100644 | ||
7765 | --- a/sound/usb/line6/playback.c | ||
7766 | +++ b/sound/usb/line6/playback.c | ||
7767 | @@ -432,6 +432,8 @@ int line6_create_audio_out_urbs(struct snd_line6_pcm *line6pcm) | ||
7768 | urb->interval = LINE6_ISO_INTERVAL; | ||
7769 | urb->error_count = 0; | ||
7770 | urb->complete = audio_out_callback; | ||
7771 | + if (usb_urb_ep_type_check(urb)) | ||
7772 | + return -EINVAL; | ||
7773 | } | ||
7774 | |||
7775 | return 0; | ||
7776 | diff --git a/sound/usb/midi.c b/sound/usb/midi.c | ||
7777 | index b737f0ec77d0..0cb4142b05f6 100644 | ||
7778 | --- a/sound/usb/midi.c | ||
7779 | +++ b/sound/usb/midi.c | ||
7780 | @@ -1499,6 +1499,8 @@ void snd_usbmidi_disconnect(struct list_head *p) | ||
7781 | spin_unlock_irq(&umidi->disc_lock); | ||
7782 | up_write(&umidi->disc_rwsem); | ||
7783 | |||
7784 | + del_timer_sync(&umidi->error_timer); | ||
7785 | + | ||
7786 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) { | ||
7787 | struct snd_usb_midi_endpoint *ep = &umidi->endpoints[i]; | ||
7788 | if (ep->out) | ||
7789 | @@ -1525,7 +1527,6 @@ void snd_usbmidi_disconnect(struct list_head *p) | ||
7790 | ep->in = NULL; | ||
7791 | } | ||
7792 | } | ||
7793 | - del_timer_sync(&umidi->error_timer); | ||
7794 | } | ||
7795 | EXPORT_SYMBOL(snd_usbmidi_disconnect); | ||
7796 | |||
7797 | @@ -2282,16 +2283,22 @@ void snd_usbmidi_input_stop(struct list_head *p) | ||
7798 | } | ||
7799 | EXPORT_SYMBOL(snd_usbmidi_input_stop); | ||
7800 | |||
7801 | -static void snd_usbmidi_input_start_ep(struct snd_usb_midi_in_endpoint *ep) | ||
7802 | +static void snd_usbmidi_input_start_ep(struct snd_usb_midi *umidi, | ||
7803 | + struct snd_usb_midi_in_endpoint *ep) | ||
7804 | { | ||
7805 | unsigned int i; | ||
7806 | + unsigned long flags; | ||
7807 | |||
7808 | if (!ep) | ||
7809 | return; | ||
7810 | for (i = 0; i < INPUT_URBS; ++i) { | ||
7811 | struct urb *urb = ep->urbs[i]; | ||
7812 | - urb->dev = ep->umidi->dev; | ||
7813 | - snd_usbmidi_submit_urb(urb, GFP_KERNEL); | ||
7814 | + spin_lock_irqsave(&umidi->disc_lock, flags); | ||
7815 | + if (!atomic_read(&urb->use_count)) { | ||
7816 | + urb->dev = ep->umidi->dev; | ||
7817 | + snd_usbmidi_submit_urb(urb, GFP_ATOMIC); | ||
7818 | + } | ||
7819 | + spin_unlock_irqrestore(&umidi->disc_lock, flags); | ||
7820 | } | ||
7821 | } | ||
7822 | |||
7823 | @@ -2307,7 +2314,7 @@ void snd_usbmidi_input_start(struct list_head *p) | ||
7824 | if (umidi->input_running || !umidi->opened[1]) | ||
7825 | return; | ||
7826 | for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) | ||
7827 | - snd_usbmidi_input_start_ep(umidi->endpoints[i].in); | ||
7828 | + snd_usbmidi_input_start_ep(umidi, umidi->endpoints[i].in); | ||
7829 | umidi->input_running = 1; | ||
7830 | } | ||
7831 | EXPORT_SYMBOL(snd_usbmidi_input_start); | ||
7832 | diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c | ||
7833 | index d5706b8b68a1..086244c70743 100644 | ||
7834 | --- a/sound/usb/pcm.c | ||
7835 | +++ b/sound/usb/pcm.c | ||
7836 | @@ -344,7 +344,12 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, | ||
7837 | ep = 0x81; | ||
7838 | ifnum = 1; | ||
7839 | goto add_sync_ep_from_ifnum; | ||
7840 | - case USB_ID(0x07fd, 0x0004): /* MOTU MicroBook II */ | ||
7841 | + case USB_ID(0x07fd, 0x0004): /* MOTU MicroBook II/IIc */ | ||
7842 | + /* MicroBook IIc */ | ||
7843 | + if (altsd->bInterfaceClass == USB_CLASS_AUDIO) | ||
7844 | + return 0; | ||
7845 | + | ||
7846 | + /* MicroBook II */ | ||
7847 | ep = 0x84; | ||
7848 | ifnum = 0; | ||
7849 | goto add_sync_ep_from_ifnum; | ||
7850 | diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h | ||
7851 | index 8d1805d9e5a7..562179492a33 100644 | ||
7852 | --- a/sound/usb/quirks-table.h | ||
7853 | +++ b/sound/usb/quirks-table.h | ||
7854 | @@ -2776,90 +2776,6 @@ YAMAHA_DEVICE(0x7010, "UB99"), | ||
7855 | .type = QUIRK_MIDI_NOVATION | ||
7856 | } | ||
7857 | }, | ||
7858 | -{ | ||
7859 | - /* | ||
7860 | - * Focusrite Scarlett Solo 2nd generation | ||
7861 | - * Reports that playback should use Synch: Synchronous | ||
7862 | - * while still providing a feedback endpoint. Synchronous causes | ||
7863 | - * snapping on some sample rates. | ||
7864 | - * Force it to use Synch: Asynchronous. | ||
7865 | - */ | ||
7866 | - USB_DEVICE(0x1235, 0x8205), | ||
7867 | - .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { | ||
7868 | - .ifnum = QUIRK_ANY_INTERFACE, | ||
7869 | - .type = QUIRK_COMPOSITE, | ||
7870 | - .data = (const struct snd_usb_audio_quirk[]) { | ||
7871 | - { | ||
7872 | - .ifnum = 1, | ||
7873 | - .type = QUIRK_AUDIO_FIXED_ENDPOINT, | ||
7874 | - .data = & (const struct audioformat) { | ||
7875 | - .formats = SNDRV_PCM_FMTBIT_S32_LE, | ||
7876 | - .channels = 2, | ||
7877 | - .iface = 1, | ||
7878 | - .altsetting = 1, | ||
7879 | - .altset_idx = 1, | ||
7880 | - .attributes = 0, | ||
7881 | - .endpoint = 0x01, | ||
7882 | - .ep_attr = USB_ENDPOINT_XFER_ISOC | | ||
7883 | - USB_ENDPOINT_SYNC_ASYNC, | ||
7884 | - .protocol = UAC_VERSION_2, | ||
7885 | - .rates = SNDRV_PCM_RATE_44100 | | ||
7886 | - SNDRV_PCM_RATE_48000 | | ||
7887 | - SNDRV_PCM_RATE_88200 | | ||
7888 | - SNDRV_PCM_RATE_96000 | | ||
7889 | - SNDRV_PCM_RATE_176400 | | ||
7890 | - SNDRV_PCM_RATE_192000, | ||
7891 | - .rate_min = 44100, | ||
7892 | - .rate_max = 192000, | ||
7893 | - .nr_rates = 6, | ||
7894 | - .rate_table = (unsigned int[]) { | ||
7895 | - 44100, 48000, 88200, | ||
7896 | - 96000, 176400, 192000 | ||
7897 | - }, | ||
7898 | - .clock = 41 | ||
7899 | - } | ||
7900 | - }, | ||
7901 | - { | ||
7902 | - .ifnum = 2, | ||
7903 | - .type = QUIRK_AUDIO_FIXED_ENDPOINT, | ||
7904 | - .data = & (const struct audioformat) { | ||
7905 | - .formats = SNDRV_PCM_FMTBIT_S32_LE, | ||
7906 | - .channels = 2, | ||
7907 | - .iface = 2, | ||
7908 | - .altsetting = 1, | ||
7909 | - .altset_idx = 1, | ||
7910 | - .attributes = 0, | ||
7911 | - .endpoint = 0x82, | ||
7912 | - .ep_attr = USB_ENDPOINT_XFER_ISOC | | ||
7913 | - USB_ENDPOINT_SYNC_ASYNC | | ||
7914 | - USB_ENDPOINT_USAGE_IMPLICIT_FB, | ||
7915 | - .protocol = UAC_VERSION_2, | ||
7916 | - .rates = SNDRV_PCM_RATE_44100 | | ||
7917 | - SNDRV_PCM_RATE_48000 | | ||
7918 | - SNDRV_PCM_RATE_88200 | | ||
7919 | - SNDRV_PCM_RATE_96000 | | ||
7920 | - SNDRV_PCM_RATE_176400 | | ||
7921 | - SNDRV_PCM_RATE_192000, | ||
7922 | - .rate_min = 44100, | ||
7923 | - .rate_max = 192000, | ||
7924 | - .nr_rates = 6, | ||
7925 | - .rate_table = (unsigned int[]) { | ||
7926 | - 44100, 48000, 88200, | ||
7927 | - 96000, 176400, 192000 | ||
7928 | - }, | ||
7929 | - .clock = 41 | ||
7930 | - } | ||
7931 | - }, | ||
7932 | - { | ||
7933 | - .ifnum = 3, | ||
7934 | - .type = QUIRK_IGNORE_INTERFACE | ||
7935 | - }, | ||
7936 | - { | ||
7937 | - .ifnum = -1 | ||
7938 | - } | ||
7939 | - } | ||
7940 | - } | ||
7941 | -}, | ||
7942 | |||
7943 | /* Access Music devices */ | ||
7944 | { | ||
7945 | @@ -3492,7 +3408,7 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"), | ||
7946 | }, | ||
7947 | /* MOTU Microbook II */ | ||
7948 | { | ||
7949 | - USB_DEVICE(0x07fd, 0x0004), | ||
7950 | + USB_DEVICE_VENDOR_SPEC(0x07fd, 0x0004), | ||
7951 | .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { | ||
7952 | .vendor_name = "MOTU", | ||
7953 | .product_name = "MicroBookII", | ||
7954 | diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c | ||
7955 | index bf5083a20b6d..a8bb953cc468 100644 | ||
7956 | --- a/sound/usb/quirks.c | ||
7957 | +++ b/sound/usb/quirks.c | ||
7958 | @@ -1316,7 +1316,15 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev, | ||
7959 | case USB_ID(0x2466, 0x8010): /* Fractal Audio Axe-Fx 3 */ | ||
7960 | return snd_usb_axefx3_boot_quirk(dev); | ||
7961 | case USB_ID(0x07fd, 0x0004): /* MOTU MicroBook II */ | ||
7962 | - return snd_usb_motu_microbookii_boot_quirk(dev); | ||
7963 | + /* | ||
7964 | + * For some reason interface 3 with vendor-spec class is | ||
7965 | + * detected on MicroBook IIc. | ||
7966 | + */ | ||
7967 | + if (get_iface_desc(intf->altsetting)->bInterfaceClass == | ||
7968 | + USB_CLASS_VENDOR_SPEC && | ||
7969 | + get_iface_desc(intf->altsetting)->bInterfaceNumber < 3) | ||
7970 | + return snd_usb_motu_microbookii_boot_quirk(dev); | ||
7971 | + break; | ||
7972 | } | ||
7973 | |||
7974 | return 0; | ||
7975 | @@ -1764,5 +1772,62 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip, | ||
7976 | else | ||
7977 | fp->ep_attr |= USB_ENDPOINT_SYNC_SYNC; | ||
7978 | break; | ||
7979 | + case USB_ID(0x07fd, 0x0004): /* MOTU MicroBook IIc */ | ||
7980 | + /* | ||
7981 | + * MaxPacketsOnly attribute is erroneously set in endpoint | ||
7982 | + * descriptors. As a result this card produces noise with | ||
7983 | + * all sample rates other than 96 KHz. | ||
7984 | + */ | ||
7985 | + fp->attributes &= ~UAC_EP_CS_ATTR_FILL_MAX; | ||
7986 | + break; | ||
7987 | + case USB_ID(0x1235, 0x8202): /* Focusrite Scarlett 2i2 2nd gen */ | ||
7988 | + case USB_ID(0x1235, 0x8205): /* Focusrite Scarlett Solo 2nd gen */ | ||
7989 | + /* | ||
7990 | + * Reports that playback should use Synch: Synchronous | ||
7991 | + * while still providing a feedback endpoint. | ||
7992 | + * Synchronous causes snapping on some sample rates. | ||
7993 | + * Force it to use Synch: Asynchronous. | ||
7994 | + */ | ||
7995 | + if (stream == SNDRV_PCM_STREAM_PLAYBACK) { | ||
7996 | + fp->ep_attr &= ~USB_ENDPOINT_SYNCTYPE; | ||
7997 | + fp->ep_attr |= USB_ENDPOINT_SYNC_ASYNC; | ||
7998 | + } | ||
7999 | + break; | ||
8000 | } | ||
8001 | } | ||
8002 | + | ||
8003 | +/* | ||
8004 | + * registration quirk: | ||
8005 | + * the registration is skipped if a device matches with the given ID, | ||
8006 | + * unless the interface reaches to the defined one. This is for delaying | ||
8007 | + * the registration until the last known interface, so that the card and | ||
8008 | + * devices appear at the same time. | ||
8009 | + */ | ||
8010 | + | ||
8011 | +struct registration_quirk { | ||
8012 | + unsigned int usb_id; /* composed via USB_ID() */ | ||
8013 | + unsigned int interface; /* the interface to trigger register */ | ||
8014 | +}; | ||
8015 | + | ||
8016 | +#define REG_QUIRK_ENTRY(vendor, product, iface) \ | ||
8017 | + { .usb_id = USB_ID(vendor, product), .interface = (iface) } | ||
8018 | + | ||
8019 | +static const struct registration_quirk registration_quirks[] = { | ||
8020 | + REG_QUIRK_ENTRY(0x0951, 0x16d8, 2), /* Kingston HyperX AMP */ | ||
8021 | + REG_QUIRK_ENTRY(0x0951, 0x16ed, 2), /* Kingston HyperX Cloud Alpha S */ | ||
8022 | + REG_QUIRK_ENTRY(0x0951, 0x16ea, 2), /* Kingston HyperX Cloud Flight S */ | ||
8023 | + { 0 } /* terminator */ | ||
8024 | +}; | ||
8025 | + | ||
8026 | +/* return true if skipping registration */ | ||
8027 | +bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface) | ||
8028 | +{ | ||
8029 | + const struct registration_quirk *q; | ||
8030 | + | ||
8031 | + for (q = registration_quirks; q->usb_id; q++) | ||
8032 | + if (chip->usb_id == q->usb_id) | ||
8033 | + return iface != q->interface; | ||
8034 | + | ||
8035 | + /* Register as normal */ | ||
8036 | + return false; | ||
8037 | +} | ||
8038 | diff --git a/sound/usb/quirks.h b/sound/usb/quirks.h | ||
8039 | index df0355843a4c..c76cf24a640a 100644 | ||
8040 | --- a/sound/usb/quirks.h | ||
8041 | +++ b/sound/usb/quirks.h | ||
8042 | @@ -51,4 +51,6 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip, | ||
8043 | struct audioformat *fp, | ||
8044 | int stream); | ||
8045 | |||
8046 | +bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface); | ||
8047 | + | ||
8048 | #endif /* __USBAUDIO_QUIRKS_H */ | ||
8049 | diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c | ||
8050 | index ebdd130557fb..5156aa971fbb 100644 | ||
8051 | --- a/tools/perf/util/stat.c | ||
8052 | +++ b/tools/perf/util/stat.c | ||
8053 | @@ -367,8 +367,10 @@ int perf_stat_process_counter(struct perf_stat_config *config, | ||
8054 | * interval mode, otherwise overall avg running | ||
8055 | * averages will be shown for each interval. | ||
8056 | */ | ||
8057 | - if (config->interval) | ||
8058 | - init_stats(ps->res_stats); | ||
8059 | + if (config->interval) { | ||
8060 | + for (i = 0; i < 3; i++) | ||
8061 | + init_stats(&ps->res_stats[i]); | ||
8062 | + } | ||
8063 | |||
8064 | if (counter->per_pkg) | ||
8065 | zero_per_pkg(counter); | ||
8066 | diff --git a/tools/testing/selftests/net/fib_nexthops.sh b/tools/testing/selftests/net/fib_nexthops.sh | ||
8067 | index 6560ed796ac4..09830b88ec8c 100755 | ||
8068 | --- a/tools/testing/selftests/net/fib_nexthops.sh | ||
8069 | +++ b/tools/testing/selftests/net/fib_nexthops.sh | ||
8070 | @@ -512,6 +512,19 @@ ipv6_fcnal_runtime() | ||
8071 | run_cmd "$IP nexthop add id 86 via 2001:db8:91::2 dev veth1" | ||
8072 | run_cmd "$IP ro add 2001:db8:101::1/128 nhid 81" | ||
8073 | |||
8074 | + # rpfilter and default route | ||
8075 | + $IP nexthop flush >/dev/null 2>&1 | ||
8076 | + run_cmd "ip netns exec me ip6tables -t mangle -I PREROUTING 1 -m rpfilter --invert -j DROP" | ||
8077 | + run_cmd "$IP nexthop add id 91 via 2001:db8:91::2 dev veth1" | ||
8078 | + run_cmd "$IP nexthop add id 92 via 2001:db8:92::2 dev veth3" | ||
8079 | + run_cmd "$IP nexthop add id 93 group 91/92" | ||
8080 | + run_cmd "$IP -6 ro add default nhid 91" | ||
8081 | + run_cmd "ip netns exec me ping -c1 -w1 2001:db8:101::1" | ||
8082 | + log_test $? 0 "Nexthop with default route and rpfilter" | ||
8083 | + run_cmd "$IP -6 ro replace default nhid 93" | ||
8084 | + run_cmd "ip netns exec me ping -c1 -w1 2001:db8:101::1" | ||
8085 | + log_test $? 0 "Nexthop with multipath default route and rpfilter" | ||
8086 | + | ||
8087 | # TO-DO: | ||
8088 | # existing route with old nexthop; append route with new nexthop | ||
8089 | # existing route with old nexthop; replace route with new |