Annotation of /trunk/kernel-alx/patches-4.19/0110-4.19.11-all-fixes.patch
Parent Directory | Revision Log
Revision 3389 -
(hide annotations)
(download)
Fri Aug 2 11:47:24 2019 UTC (5 years, 1 month ago) by niro
File size: 55181 byte(s)
Fri Aug 2 11:47:24 2019 UTC (5 years, 1 month ago) by niro
File size: 55181 byte(s)
-linux-4.19.11
1 | niro | 3389 | diff --git a/Makefile b/Makefile |
2 | index 36d9de42def3..676155d4dc3e 100644 | ||
3 | --- a/Makefile | ||
4 | +++ b/Makefile | ||
5 | @@ -1,7 +1,7 @@ | ||
6 | # SPDX-License-Identifier: GPL-2.0 | ||
7 | VERSION = 4 | ||
8 | PATCHLEVEL = 19 | ||
9 | -SUBLEVEL = 10 | ||
10 | +SUBLEVEL = 11 | ||
11 | EXTRAVERSION = | ||
12 | NAME = "People's Front" | ||
13 | |||
14 | diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts | ||
15 | index 4adb85e66be3..93762244be7f 100644 | ||
16 | --- a/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts | ||
17 | +++ b/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts | ||
18 | @@ -31,7 +31,7 @@ | ||
19 | |||
20 | wifi_pwrseq: wifi-pwrseq { | ||
21 | compatible = "mmc-pwrseq-simple"; | ||
22 | - reset-gpios = <&expgpio 1 GPIO_ACTIVE_HIGH>; | ||
23 | + reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; | ||
24 | }; | ||
25 | }; | ||
26 | |||
27 | diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts | ||
28 | index c318bcbc6ba7..89e6fd547c75 100644 | ||
29 | --- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts | ||
30 | +++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts | ||
31 | @@ -26,7 +26,7 @@ | ||
32 | |||
33 | wifi_pwrseq: wifi-pwrseq { | ||
34 | compatible = "mmc-pwrseq-simple"; | ||
35 | - reset-gpios = <&expgpio 1 GPIO_ACTIVE_HIGH>; | ||
36 | + reset-gpios = <&expgpio 1 GPIO_ACTIVE_LOW>; | ||
37 | }; | ||
38 | }; | ||
39 | |||
40 | diff --git a/arch/arm/boot/dts/qcom-apq8064-arrow-sd-600eval.dts b/arch/arm/boot/dts/qcom-apq8064-arrow-sd-600eval.dts | ||
41 | index 76b56eafaab9..f714a20649d7 100644 | ||
42 | --- a/arch/arm/boot/dts/qcom-apq8064-arrow-sd-600eval.dts | ||
43 | +++ b/arch/arm/boot/dts/qcom-apq8064-arrow-sd-600eval.dts | ||
44 | @@ -387,6 +387,11 @@ | ||
45 | hpd-gpio = <&tlmm_pinmux 72 GPIO_ACTIVE_HIGH>; | ||
46 | |||
47 | ports { | ||
48 | + port@0 { | ||
49 | + endpoint { | ||
50 | + remote-endpoint = <&mdp_dtv_out>; | ||
51 | + }; | ||
52 | + }; | ||
53 | port@1 { | ||
54 | endpoint { | ||
55 | remote-endpoint = <&hdmi_con>; | ||
56 | diff --git a/arch/arm/mach-mmp/cputype.h b/arch/arm/mach-mmp/cputype.h | ||
57 | index 446edaeb78a7..a96abcf521b4 100644 | ||
58 | --- a/arch/arm/mach-mmp/cputype.h | ||
59 | +++ b/arch/arm/mach-mmp/cputype.h | ||
60 | @@ -44,10 +44,12 @@ static inline int cpu_is_pxa910(void) | ||
61 | #define cpu_is_pxa910() (0) | ||
62 | #endif | ||
63 | |||
64 | -#ifdef CONFIG_CPU_MMP2 | ||
65 | +#if defined(CONFIG_CPU_MMP2) || defined(CONFIG_MACH_MMP2_DT) | ||
66 | static inline int cpu_is_mmp2(void) | ||
67 | { | ||
68 | - return (((read_cpuid_id() >> 8) & 0xff) == 0x58); | ||
69 | + return (((read_cpuid_id() >> 8) & 0xff) == 0x58) && | ||
70 | + (((mmp_chip_id & 0xfff) == 0x410) || | ||
71 | + ((mmp_chip_id & 0xfff) == 0x610)); | ||
72 | } | ||
73 | #else | ||
74 | #define cpu_is_mmp2() (0) | ||
75 | diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c | ||
76 | index 072c51fb07d7..c389f2bef938 100644 | ||
77 | --- a/arch/arm64/mm/dma-mapping.c | ||
78 | +++ b/arch/arm64/mm/dma-mapping.c | ||
79 | @@ -587,9 +587,9 @@ static void *__iommu_alloc_attrs(struct device *dev, size_t size, | ||
80 | prot, | ||
81 | __builtin_return_address(0)); | ||
82 | if (addr) { | ||
83 | - memset(addr, 0, size); | ||
84 | if (!coherent) | ||
85 | __dma_flush_area(page_to_virt(page), iosize); | ||
86 | + memset(addr, 0, size); | ||
87 | } else { | ||
88 | iommu_dma_unmap_page(dev, *handle, iosize, 0, attrs); | ||
89 | dma_release_from_contiguous(dev, page, | ||
90 | diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c | ||
91 | index 33b34a58fc62..5b9dce17f0c9 100644 | ||
92 | --- a/arch/powerpc/kernel/legacy_serial.c | ||
93 | +++ b/arch/powerpc/kernel/legacy_serial.c | ||
94 | @@ -372,6 +372,8 @@ void __init find_legacy_serial_ports(void) | ||
95 | |||
96 | /* Now find out if one of these is out firmware console */ | ||
97 | path = of_get_property(of_chosen, "linux,stdout-path", NULL); | ||
98 | + if (path == NULL) | ||
99 | + path = of_get_property(of_chosen, "stdout-path", NULL); | ||
100 | if (path != NULL) { | ||
101 | stdout = of_find_node_by_path(path); | ||
102 | if (stdout) | ||
103 | @@ -595,8 +597,10 @@ static int __init check_legacy_serial_console(void) | ||
104 | /* We are getting a weird phandle from OF ... */ | ||
105 | /* ... So use the full path instead */ | ||
106 | name = of_get_property(of_chosen, "linux,stdout-path", NULL); | ||
107 | + if (name == NULL) | ||
108 | + name = of_get_property(of_chosen, "stdout-path", NULL); | ||
109 | if (name == NULL) { | ||
110 | - DBG(" no linux,stdout-path !\n"); | ||
111 | + DBG(" no stdout-path !\n"); | ||
112 | return -ENODEV; | ||
113 | } | ||
114 | prom_stdout = of_find_node_by_path(name); | ||
115 | diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c | ||
116 | index dab616a33b8d..f2197654be07 100644 | ||
117 | --- a/arch/powerpc/kernel/msi.c | ||
118 | +++ b/arch/powerpc/kernel/msi.c | ||
119 | @@ -34,5 +34,10 @@ void arch_teardown_msi_irqs(struct pci_dev *dev) | ||
120 | { | ||
121 | struct pci_controller *phb = pci_bus_to_host(dev->bus); | ||
122 | |||
123 | - phb->controller_ops.teardown_msi_irqs(dev); | ||
124 | + /* | ||
125 | + * We can be called even when arch_setup_msi_irqs() returns -ENOSYS, | ||
126 | + * so check the pointer again. | ||
127 | + */ | ||
128 | + if (phb->controller_ops.teardown_msi_irqs) | ||
129 | + phb->controller_ops.teardown_msi_irqs(dev); | ||
130 | } | ||
131 | diff --git a/arch/x86/Makefile b/arch/x86/Makefile | ||
132 | index 9298f0f3817a..b84f61bc5e7a 100644 | ||
133 | --- a/arch/x86/Makefile | ||
134 | +++ b/arch/x86/Makefile | ||
135 | @@ -223,9 +223,6 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables | ||
136 | |||
137 | # Avoid indirect branches in kernel to deal with Spectre | ||
138 | ifdef CONFIG_RETPOLINE | ||
139 | -ifeq ($(RETPOLINE_CFLAGS),) | ||
140 | - $(error You are building kernel with non-retpoline compiler, please update your compiler.) | ||
141 | -endif | ||
142 | KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) | ||
143 | endif | ||
144 | |||
145 | @@ -303,6 +300,13 @@ ifndef CC_HAVE_ASM_GOTO | ||
146 | @echo Compiler lacks asm-goto support. | ||
147 | @exit 1 | ||
148 | endif | ||
149 | +ifdef CONFIG_RETPOLINE | ||
150 | +ifeq ($(RETPOLINE_CFLAGS),) | ||
151 | + @echo "You are building kernel with non-retpoline compiler." >&2 | ||
152 | + @echo "Please update your compiler." >&2 | ||
153 | + @false | ||
154 | +endif | ||
155 | +endif | ||
156 | |||
157 | archclean: | ||
158 | $(Q)rm -rf $(objtree)/arch/i386 | ||
159 | diff --git a/block/bio.c b/block/bio.c | ||
160 | index c4ef8aa46452..55a5386fd431 100644 | ||
161 | --- a/block/bio.c | ||
162 | +++ b/block/bio.c | ||
163 | @@ -1262,7 +1262,8 @@ struct bio *bio_copy_user_iov(struct request_queue *q, | ||
164 | if (ret) | ||
165 | goto cleanup; | ||
166 | } else { | ||
167 | - zero_fill_bio(bio); | ||
168 | + if (bmd->is_our_pages) | ||
169 | + zero_fill_bio(bio); | ||
170 | iov_iter_advance(iter, bio->bi_iter.bi_size); | ||
171 | } | ||
172 | |||
173 | diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | ||
174 | index 8816c697b205..387f1cf1dc20 100644 | ||
175 | --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | ||
176 | +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c | ||
177 | @@ -330,7 +330,9 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, | ||
178 | case CHIP_TOPAZ: | ||
179 | if (((adev->pdev->device == 0x6900) && (adev->pdev->revision == 0x81)) || | ||
180 | ((adev->pdev->device == 0x6900) && (adev->pdev->revision == 0x83)) || | ||
181 | - ((adev->pdev->device == 0x6907) && (adev->pdev->revision == 0x87))) { | ||
182 | + ((adev->pdev->device == 0x6907) && (adev->pdev->revision == 0x87)) || | ||
183 | + ((adev->pdev->device == 0x6900) && (adev->pdev->revision == 0xD1)) || | ||
184 | + ((adev->pdev->device == 0x6900) && (adev->pdev->revision == 0xD3))) { | ||
185 | info->is_kicker = true; | ||
186 | strcpy(fw_name, "amdgpu/topaz_k_smc.bin"); | ||
187 | } else | ||
188 | @@ -351,7 +353,6 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, | ||
189 | if (type == CGS_UCODE_ID_SMU) { | ||
190 | if (((adev->pdev->device == 0x67ef) && | ||
191 | ((adev->pdev->revision == 0xe0) || | ||
192 | - (adev->pdev->revision == 0xe2) || | ||
193 | (adev->pdev->revision == 0xe5))) || | ||
194 | ((adev->pdev->device == 0x67ff) && | ||
195 | ((adev->pdev->revision == 0xcf) || | ||
196 | @@ -359,8 +360,13 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, | ||
197 | (adev->pdev->revision == 0xff)))) { | ||
198 | info->is_kicker = true; | ||
199 | strcpy(fw_name, "amdgpu/polaris11_k_smc.bin"); | ||
200 | - } else | ||
201 | + } else if ((adev->pdev->device == 0x67ef) && | ||
202 | + (adev->pdev->revision == 0xe2)) { | ||
203 | + info->is_kicker = true; | ||
204 | + strcpy(fw_name, "amdgpu/polaris11_k2_smc.bin"); | ||
205 | + } else { | ||
206 | strcpy(fw_name, "amdgpu/polaris11_smc.bin"); | ||
207 | + } | ||
208 | } else if (type == CGS_UCODE_ID_SMU_SK) { | ||
209 | strcpy(fw_name, "amdgpu/polaris11_smc_sk.bin"); | ||
210 | } | ||
211 | @@ -375,17 +381,35 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device, | ||
212 | (adev->pdev->revision == 0xe7) || | ||
213 | (adev->pdev->revision == 0xef))) || | ||
214 | ((adev->pdev->device == 0x6fdf) && | ||
215 | - (adev->pdev->revision == 0xef))) { | ||
216 | + ((adev->pdev->revision == 0xef) || | ||
217 | + (adev->pdev->revision == 0xff)))) { | ||
218 | info->is_kicker = true; | ||
219 | strcpy(fw_name, "amdgpu/polaris10_k_smc.bin"); | ||
220 | - } else | ||
221 | + } else if ((adev->pdev->device == 0x67df) && | ||
222 | + ((adev->pdev->revision == 0xe1) || | ||
223 | + (adev->pdev->revision == 0xf7))) { | ||
224 | + info->is_kicker = true; | ||
225 | + strcpy(fw_name, "amdgpu/polaris10_k2_smc.bin"); | ||
226 | + } else { | ||
227 | strcpy(fw_name, "amdgpu/polaris10_smc.bin"); | ||
228 | + } | ||
229 | } else if (type == CGS_UCODE_ID_SMU_SK) { | ||
230 | strcpy(fw_name, "amdgpu/polaris10_smc_sk.bin"); | ||
231 | } | ||
232 | break; | ||
233 | case CHIP_POLARIS12: | ||
234 | - strcpy(fw_name, "amdgpu/polaris12_smc.bin"); | ||
235 | + if (((adev->pdev->device == 0x6987) && | ||
236 | + ((adev->pdev->revision == 0xc0) || | ||
237 | + (adev->pdev->revision == 0xc3))) || | ||
238 | + ((adev->pdev->device == 0x6981) && | ||
239 | + ((adev->pdev->revision == 0x00) || | ||
240 | + (adev->pdev->revision == 0x01) || | ||
241 | + (adev->pdev->revision == 0x10)))) { | ||
242 | + info->is_kicker = true; | ||
243 | + strcpy(fw_name, "amdgpu/polaris12_k_smc.bin"); | ||
244 | + } else { | ||
245 | + strcpy(fw_name, "amdgpu/polaris12_smc.bin"); | ||
246 | + } | ||
247 | break; | ||
248 | case CHIP_VEGAM: | ||
249 | strcpy(fw_name, "amdgpu/vegam_smc.bin"); | ||
250 | diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | ||
251 | index 0f41d8647376..8e26e1ca14c6 100644 | ||
252 | --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | ||
253 | +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | ||
254 | @@ -761,7 +761,13 @@ static const struct pci_device_id pciidlist[] = { | ||
255 | {0x1002, 0x6864, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, | ||
256 | {0x1002, 0x6867, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, | ||
257 | {0x1002, 0x6868, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, | ||
258 | + {0x1002, 0x6869, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, | ||
259 | + {0x1002, 0x686a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, | ||
260 | + {0x1002, 0x686b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, | ||
261 | {0x1002, 0x686c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, | ||
262 | + {0x1002, 0x686d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, | ||
263 | + {0x1002, 0x686e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, | ||
264 | + {0x1002, 0x686f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, | ||
265 | {0x1002, 0x687f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10}, | ||
266 | /* Vega 12 */ | ||
267 | {0x1002, 0x69A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA12}, | ||
268 | diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c | ||
269 | index 29ac74f40dce..1427675d0e5a 100644 | ||
270 | --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c | ||
271 | +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c | ||
272 | @@ -326,7 +326,13 @@ static const struct kfd_deviceid supported_devices[] = { | ||
273 | { 0x6864, &vega10_device_info }, /* Vega10 */ | ||
274 | { 0x6867, &vega10_device_info }, /* Vega10 */ | ||
275 | { 0x6868, &vega10_device_info }, /* Vega10 */ | ||
276 | + { 0x6869, &vega10_device_info }, /* Vega10 */ | ||
277 | + { 0x686A, &vega10_device_info }, /* Vega10 */ | ||
278 | + { 0x686B, &vega10_device_info }, /* Vega10 */ | ||
279 | { 0x686C, &vega10_vf_device_info }, /* Vega10 vf*/ | ||
280 | + { 0x686D, &vega10_device_info }, /* Vega10 */ | ||
281 | + { 0x686E, &vega10_device_info }, /* Vega10 */ | ||
282 | + { 0x686F, &vega10_device_info }, /* Vega10 */ | ||
283 | { 0x687F, &vega10_device_info }, /* Vega10 */ | ||
284 | }; | ||
285 | |||
286 | diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h b/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h | ||
287 | index 62f36ba2435b..c1a99dfe4913 100644 | ||
288 | --- a/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h | ||
289 | +++ b/drivers/gpu/drm/amd/powerplay/inc/smu7_ppsmc.h | ||
290 | @@ -386,6 +386,8 @@ typedef uint16_t PPSMC_Result; | ||
291 | #define PPSMC_MSG_AgmResetPsm ((uint16_t) 0x403) | ||
292 | #define PPSMC_MSG_ReadVftCell ((uint16_t) 0x404) | ||
293 | |||
294 | +#define PPSMC_MSG_ApplyAvfsCksOffVoltage ((uint16_t) 0x415) | ||
295 | + | ||
296 | #define PPSMC_MSG_GFX_CU_PG_ENABLE ((uint16_t) 0x280) | ||
297 | #define PPSMC_MSG_GFX_CU_PG_DISABLE ((uint16_t) 0x281) | ||
298 | #define PPSMC_MSG_GetCurrPkgPwr ((uint16_t) 0x282) | ||
299 | diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | ||
300 | index 1276f168ff68..5b67f575cd34 100644 | ||
301 | --- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | ||
302 | +++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | ||
303 | @@ -1984,6 +1984,12 @@ int polaris10_thermal_avfs_enable(struct pp_hwmgr *hwmgr) | ||
304 | |||
305 | smum_send_msg_to_smc(hwmgr, PPSMC_MSG_EnableAvfs); | ||
306 | |||
307 | + /* Apply avfs cks-off voltages to avoid the overshoot | ||
308 | + * when switching to the highest sclk frequency | ||
309 | + */ | ||
310 | + if (data->apply_avfs_cks_off_voltage) | ||
311 | + smum_send_msg_to_smc(hwmgr, PPSMC_MSG_ApplyAvfsCksOffVoltage); | ||
312 | + | ||
313 | return 0; | ||
314 | } | ||
315 | |||
316 | diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c | ||
317 | index 99d5e4f98f49..a6edd5df33b0 100644 | ||
318 | --- a/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c | ||
319 | +++ b/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c | ||
320 | @@ -37,10 +37,13 @@ MODULE_FIRMWARE("amdgpu/fiji_smc.bin"); | ||
321 | MODULE_FIRMWARE("amdgpu/polaris10_smc.bin"); | ||
322 | MODULE_FIRMWARE("amdgpu/polaris10_smc_sk.bin"); | ||
323 | MODULE_FIRMWARE("amdgpu/polaris10_k_smc.bin"); | ||
324 | +MODULE_FIRMWARE("amdgpu/polaris10_k2_smc.bin"); | ||
325 | MODULE_FIRMWARE("amdgpu/polaris11_smc.bin"); | ||
326 | MODULE_FIRMWARE("amdgpu/polaris11_smc_sk.bin"); | ||
327 | MODULE_FIRMWARE("amdgpu/polaris11_k_smc.bin"); | ||
328 | +MODULE_FIRMWARE("amdgpu/polaris11_k2_smc.bin"); | ||
329 | MODULE_FIRMWARE("amdgpu/polaris12_smc.bin"); | ||
330 | +MODULE_FIRMWARE("amdgpu/polaris12_k_smc.bin"); | ||
331 | MODULE_FIRMWARE("amdgpu/vegam_smc.bin"); | ||
332 | MODULE_FIRMWARE("amdgpu/vega10_smc.bin"); | ||
333 | MODULE_FIRMWARE("amdgpu/vega10_acg_smc.bin"); | ||
334 | diff --git a/drivers/gpu/drm/i915/gvt/fb_decoder.c b/drivers/gpu/drm/i915/gvt/fb_decoder.c | ||
335 | index 481896fb712a..85e6736f0a32 100644 | ||
336 | --- a/drivers/gpu/drm/i915/gvt/fb_decoder.c | ||
337 | +++ b/drivers/gpu/drm/i915/gvt/fb_decoder.c | ||
338 | @@ -235,7 +235,7 @@ int intel_vgpu_decode_primary_plane(struct intel_vgpu *vgpu, | ||
339 | plane->bpp = skl_pixel_formats[fmt].bpp; | ||
340 | plane->drm_format = skl_pixel_formats[fmt].drm_format; | ||
341 | } else { | ||
342 | - plane->tiled = !!(val & DISPPLANE_TILED); | ||
343 | + plane->tiled = val & DISPPLANE_TILED; | ||
344 | fmt = bdw_format_to_drm(val & DISPPLANE_PIXFORMAT_MASK); | ||
345 | plane->bpp = bdw_pixel_formats[fmt].bpp; | ||
346 | plane->drm_format = bdw_pixel_formats[fmt].drm_format; | ||
347 | diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c | ||
348 | index 75ea87ebf9b0..6937ef0b4bfc 100644 | ||
349 | --- a/drivers/gpu/drm/i915/intel_lrc.c | ||
350 | +++ b/drivers/gpu/drm/i915/intel_lrc.c | ||
351 | @@ -442,8 +442,13 @@ static u64 execlists_update_context(struct i915_request *rq) | ||
352 | * may not be visible to the HW prior to the completion of the UC | ||
353 | * register write and that we may begin execution from the context | ||
354 | * before its image is complete leading to invalid PD chasing. | ||
355 | + * | ||
356 | + * Furthermore, Braswell, at least, wants a full mb to be sure that | ||
357 | + * the writes are coherent in memory (visible to the GPU) prior to | ||
358 | + * execution, and not just visible to other CPUs (as is the result of | ||
359 | + * wmb). | ||
360 | */ | ||
361 | - wmb(); | ||
362 | + mb(); | ||
363 | return ce->lrc_desc; | ||
364 | } | ||
365 | |||
366 | diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_dbg.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_dbg.c | ||
367 | index ae2aee7ed9e1..e741d26185df 100644 | ||
368 | --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_dbg.c | ||
369 | +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_dbg.c | ||
370 | @@ -1962,7 +1962,7 @@ static void _dpu_dbg_dump_dpu_dbg_bus(struct dpu_dbg_dpu_debug_bus *bus) | ||
371 | u32 *dump_addr = NULL; | ||
372 | u32 status = 0; | ||
373 | struct dpu_debug_bus_entry *head; | ||
374 | - phys_addr_t phys = 0; | ||
375 | + dma_addr_t dma = 0; | ||
376 | int list_size; | ||
377 | int i; | ||
378 | u32 offset; | ||
379 | @@ -2000,7 +2000,7 @@ static void _dpu_dbg_dump_dpu_dbg_bus(struct dpu_dbg_dpu_debug_bus *bus) | ||
380 | if (in_mem) { | ||
381 | if (!(*dump_mem)) | ||
382 | *dump_mem = dma_alloc_coherent(dpu_dbg_base.dev, | ||
383 | - list_size, &phys, GFP_KERNEL); | ||
384 | + list_size, &dma, GFP_KERNEL); | ||
385 | |||
386 | if (*dump_mem) { | ||
387 | dump_addr = *dump_mem; | ||
388 | @@ -2101,7 +2101,7 @@ static void _dpu_dbg_dump_vbif_dbg_bus(struct dpu_dbg_vbif_debug_bus *bus) | ||
389 | u32 value, d0, d1; | ||
390 | unsigned long reg, reg1, reg2; | ||
391 | struct vbif_debug_bus_entry *head; | ||
392 | - phys_addr_t phys = 0; | ||
393 | + dma_addr_t dma = 0; | ||
394 | int i, list_size = 0; | ||
395 | void __iomem *mem_base = NULL; | ||
396 | struct vbif_debug_bus_entry *dbg_bus; | ||
397 | @@ -2151,7 +2151,7 @@ static void _dpu_dbg_dump_vbif_dbg_bus(struct dpu_dbg_vbif_debug_bus *bus) | ||
398 | if (in_mem) { | ||
399 | if (!(*dump_mem)) | ||
400 | *dump_mem = dma_alloc_coherent(dpu_dbg_base.dev, | ||
401 | - list_size, &phys, GFP_KERNEL); | ||
402 | + list_size, &dma, GFP_KERNEL); | ||
403 | |||
404 | if (*dump_mem) { | ||
405 | dump_addr = *dump_mem; | ||
406 | diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c | ||
407 | index faf7009c0a3c..2abcd7bf104f 100644 | ||
408 | --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c | ||
409 | +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c | ||
410 | @@ -197,6 +197,22 @@ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp, | ||
411 | /****************************************************************************** | ||
412 | * EVO channel helpers | ||
413 | *****************************************************************************/ | ||
414 | +static void | ||
415 | +evo_flush(struct nv50_dmac *dmac) | ||
416 | +{ | ||
417 | + /* Push buffer fetches are not coherent with BAR1, we need to ensure | ||
418 | + * writes have been flushed right through to VRAM before writing PUT. | ||
419 | + */ | ||
420 | + if (dmac->push.type & NVIF_MEM_VRAM) { | ||
421 | + struct nvif_device *device = dmac->base.device; | ||
422 | + nvif_wr32(&device->object, 0x070000, 0x00000001); | ||
423 | + nvif_msec(device, 2000, | ||
424 | + if (!(nvif_rd32(&device->object, 0x070000) & 0x00000002)) | ||
425 | + break; | ||
426 | + ); | ||
427 | + } | ||
428 | +} | ||
429 | + | ||
430 | u32 * | ||
431 | evo_wait(struct nv50_dmac *evoc, int nr) | ||
432 | { | ||
433 | @@ -207,6 +223,7 @@ evo_wait(struct nv50_dmac *evoc, int nr) | ||
434 | mutex_lock(&dmac->lock); | ||
435 | if (put + nr >= (PAGE_SIZE / 4) - 8) { | ||
436 | dmac->ptr[put] = 0x20000000; | ||
437 | + evo_flush(dmac); | ||
438 | |||
439 | nvif_wr32(&dmac->base.user, 0x0000, 0x00000000); | ||
440 | if (nvif_msec(device, 2000, | ||
441 | @@ -229,17 +246,7 @@ evo_kick(u32 *push, struct nv50_dmac *evoc) | ||
442 | { | ||
443 | struct nv50_dmac *dmac = evoc; | ||
444 | |||
445 | - /* Push buffer fetches are not coherent with BAR1, we need to ensure | ||
446 | - * writes have been flushed right through to VRAM before writing PUT. | ||
447 | - */ | ||
448 | - if (dmac->push.type & NVIF_MEM_VRAM) { | ||
449 | - struct nvif_device *device = dmac->base.device; | ||
450 | - nvif_wr32(&device->object, 0x070000, 0x00000001); | ||
451 | - nvif_msec(device, 2000, | ||
452 | - if (!(nvif_rd32(&device->object, 0x070000) & 0x00000002)) | ||
453 | - break; | ||
454 | - ); | ||
455 | - } | ||
456 | + evo_flush(dmac); | ||
457 | |||
458 | nvif_wr32(&dmac->base.user, 0x0000, (push - dmac->ptr) << 2); | ||
459 | mutex_unlock(&dmac->lock); | ||
460 | @@ -1226,6 +1233,7 @@ nv50_mstm_del(struct nv50_mstm **pmstm) | ||
461 | { | ||
462 | struct nv50_mstm *mstm = *pmstm; | ||
463 | if (mstm) { | ||
464 | + drm_dp_mst_topology_mgr_destroy(&mstm->mgr); | ||
465 | kfree(*pmstm); | ||
466 | *pmstm = NULL; | ||
467 | } | ||
468 | diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c | ||
469 | index 05368fa4f956..f814d37b1db2 100644 | ||
470 | --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c | ||
471 | +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c | ||
472 | @@ -442,11 +442,6 @@ static int rockchip_drm_platform_remove(struct platform_device *pdev) | ||
473 | return 0; | ||
474 | } | ||
475 | |||
476 | -static void rockchip_drm_platform_shutdown(struct platform_device *pdev) | ||
477 | -{ | ||
478 | - rockchip_drm_platform_remove(pdev); | ||
479 | -} | ||
480 | - | ||
481 | static const struct of_device_id rockchip_drm_dt_ids[] = { | ||
482 | { .compatible = "rockchip,display-subsystem", }, | ||
483 | { /* sentinel */ }, | ||
484 | @@ -456,7 +451,6 @@ MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ids); | ||
485 | static struct platform_driver rockchip_drm_platform_driver = { | ||
486 | .probe = rockchip_drm_platform_probe, | ||
487 | .remove = rockchip_drm_platform_remove, | ||
488 | - .shutdown = rockchip_drm_platform_shutdown, | ||
489 | .driver = { | ||
490 | .name = "rockchip-drm", | ||
491 | .of_match_table = rockchip_drm_dt_ids, | ||
492 | diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c | ||
493 | index a4f956c6d567..a19fbff16861 100644 | ||
494 | --- a/drivers/i2c/busses/i2c-aspeed.c | ||
495 | +++ b/drivers/i2c/busses/i2c-aspeed.c | ||
496 | @@ -555,7 +555,7 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id) | ||
497 | spin_lock(&bus->lock); | ||
498 | |||
499 | #if IS_ENABLED(CONFIG_I2C_SLAVE) | ||
500 | - if (aspeed_i2c_slave_irq(bus)) { | ||
501 | + if (IS_ENABLED(CONFIG_I2C_SLAVE) && aspeed_i2c_slave_irq(bus)) { | ||
502 | dev_dbg(bus->dev, "irq handled by slave.\n"); | ||
503 | ret = true; | ||
504 | goto out; | ||
505 | @@ -564,7 +564,9 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id) | ||
506 | |||
507 | ret = aspeed_i2c_master_irq(bus); | ||
508 | |||
509 | +#if IS_ENABLED(CONFIG_I2C_SLAVE) | ||
510 | out: | ||
511 | +#endif | ||
512 | spin_unlock(&bus->lock); | ||
513 | return ret ? IRQ_HANDLED : IRQ_NONE; | ||
514 | } | ||
515 | diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-metadata.c | ||
516 | index 5936de71883f..6fc93834da44 100644 | ||
517 | --- a/drivers/md/dm-cache-metadata.c | ||
518 | +++ b/drivers/md/dm-cache-metadata.c | ||
519 | @@ -930,6 +930,10 @@ static int blocks_are_clean_separate_dirty(struct dm_cache_metadata *cmd, | ||
520 | bool dirty_flag; | ||
521 | *result = true; | ||
522 | |||
523 | + if (from_cblock(cmd->cache_blocks) == 0) | ||
524 | + /* Nothing to do */ | ||
525 | + return 0; | ||
526 | + | ||
527 | r = dm_bitset_cursor_begin(&cmd->dirty_info, cmd->dirty_root, | ||
528 | from_cblock(cmd->cache_blocks), &cmd->dirty_cursor); | ||
529 | if (r) { | ||
530 | diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c | ||
531 | index aaf1ad481ee8..1f225a1e08dd 100644 | ||
532 | --- a/drivers/md/dm-thin.c | ||
533 | +++ b/drivers/md/dm-thin.c | ||
534 | @@ -195,7 +195,7 @@ static void throttle_unlock(struct throttle *t) | ||
535 | struct dm_thin_new_mapping; | ||
536 | |||
537 | /* | ||
538 | - * The pool runs in 4 modes. Ordered in degraded order for comparisons. | ||
539 | + * The pool runs in various modes. Ordered in degraded order for comparisons. | ||
540 | */ | ||
541 | enum pool_mode { | ||
542 | PM_WRITE, /* metadata may be changed */ | ||
543 | @@ -282,9 +282,38 @@ struct pool { | ||
544 | mempool_t mapping_pool; | ||
545 | }; | ||
546 | |||
547 | -static enum pool_mode get_pool_mode(struct pool *pool); | ||
548 | static void metadata_operation_failed(struct pool *pool, const char *op, int r); | ||
549 | |||
550 | +static enum pool_mode get_pool_mode(struct pool *pool) | ||
551 | +{ | ||
552 | + return pool->pf.mode; | ||
553 | +} | ||
554 | + | ||
555 | +static void notify_of_pool_mode_change(struct pool *pool) | ||
556 | +{ | ||
557 | + const char *descs[] = { | ||
558 | + "write", | ||
559 | + "out-of-data-space", | ||
560 | + "read-only", | ||
561 | + "read-only", | ||
562 | + "fail" | ||
563 | + }; | ||
564 | + const char *extra_desc = NULL; | ||
565 | + enum pool_mode mode = get_pool_mode(pool); | ||
566 | + | ||
567 | + if (mode == PM_OUT_OF_DATA_SPACE) { | ||
568 | + if (!pool->pf.error_if_no_space) | ||
569 | + extra_desc = " (queue IO)"; | ||
570 | + else | ||
571 | + extra_desc = " (error IO)"; | ||
572 | + } | ||
573 | + | ||
574 | + dm_table_event(pool->ti->table); | ||
575 | + DMINFO("%s: switching pool to %s%s mode", | ||
576 | + dm_device_name(pool->pool_md), | ||
577 | + descs[(int)mode], extra_desc ? : ""); | ||
578 | +} | ||
579 | + | ||
580 | /* | ||
581 | * Target context for a pool. | ||
582 | */ | ||
583 | @@ -2351,8 +2380,6 @@ static void do_waker(struct work_struct *ws) | ||
584 | queue_delayed_work(pool->wq, &pool->waker, COMMIT_PERIOD); | ||
585 | } | ||
586 | |||
587 | -static void notify_of_pool_mode_change_to_oods(struct pool *pool); | ||
588 | - | ||
589 | /* | ||
590 | * We're holding onto IO to allow userland time to react. After the | ||
591 | * timeout either the pool will have been resized (and thus back in | ||
592 | @@ -2365,7 +2392,7 @@ static void do_no_space_timeout(struct work_struct *ws) | ||
593 | |||
594 | if (get_pool_mode(pool) == PM_OUT_OF_DATA_SPACE && !pool->pf.error_if_no_space) { | ||
595 | pool->pf.error_if_no_space = true; | ||
596 | - notify_of_pool_mode_change_to_oods(pool); | ||
597 | + notify_of_pool_mode_change(pool); | ||
598 | error_retry_list_with_code(pool, BLK_STS_NOSPC); | ||
599 | } | ||
600 | } | ||
601 | @@ -2433,26 +2460,6 @@ static void noflush_work(struct thin_c *tc, void (*fn)(struct work_struct *)) | ||
602 | |||
603 | /*----------------------------------------------------------------*/ | ||
604 | |||
605 | -static enum pool_mode get_pool_mode(struct pool *pool) | ||
606 | -{ | ||
607 | - return pool->pf.mode; | ||
608 | -} | ||
609 | - | ||
610 | -static void notify_of_pool_mode_change(struct pool *pool, const char *new_mode) | ||
611 | -{ | ||
612 | - dm_table_event(pool->ti->table); | ||
613 | - DMINFO("%s: switching pool to %s mode", | ||
614 | - dm_device_name(pool->pool_md), new_mode); | ||
615 | -} | ||
616 | - | ||
617 | -static void notify_of_pool_mode_change_to_oods(struct pool *pool) | ||
618 | -{ | ||
619 | - if (!pool->pf.error_if_no_space) | ||
620 | - notify_of_pool_mode_change(pool, "out-of-data-space (queue IO)"); | ||
621 | - else | ||
622 | - notify_of_pool_mode_change(pool, "out-of-data-space (error IO)"); | ||
623 | -} | ||
624 | - | ||
625 | static bool passdown_enabled(struct pool_c *pt) | ||
626 | { | ||
627 | return pt->adjusted_pf.discard_passdown; | ||
628 | @@ -2501,8 +2508,6 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) | ||
629 | |||
630 | switch (new_mode) { | ||
631 | case PM_FAIL: | ||
632 | - if (old_mode != new_mode) | ||
633 | - notify_of_pool_mode_change(pool, "failure"); | ||
634 | dm_pool_metadata_read_only(pool->pmd); | ||
635 | pool->process_bio = process_bio_fail; | ||
636 | pool->process_discard = process_bio_fail; | ||
637 | @@ -2516,8 +2521,6 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) | ||
638 | |||
639 | case PM_OUT_OF_METADATA_SPACE: | ||
640 | case PM_READ_ONLY: | ||
641 | - if (!is_read_only_pool_mode(old_mode)) | ||
642 | - notify_of_pool_mode_change(pool, "read-only"); | ||
643 | dm_pool_metadata_read_only(pool->pmd); | ||
644 | pool->process_bio = process_bio_read_only; | ||
645 | pool->process_discard = process_bio_success; | ||
646 | @@ -2538,8 +2541,6 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) | ||
647 | * alarming rate. Adjust your low water mark if you're | ||
648 | * frequently seeing this mode. | ||
649 | */ | ||
650 | - if (old_mode != new_mode) | ||
651 | - notify_of_pool_mode_change_to_oods(pool); | ||
652 | pool->out_of_data_space = true; | ||
653 | pool->process_bio = process_bio_read_only; | ||
654 | pool->process_discard = process_discard_bio; | ||
655 | @@ -2552,8 +2553,6 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) | ||
656 | break; | ||
657 | |||
658 | case PM_WRITE: | ||
659 | - if (old_mode != new_mode) | ||
660 | - notify_of_pool_mode_change(pool, "write"); | ||
661 | if (old_mode == PM_OUT_OF_DATA_SPACE) | ||
662 | cancel_delayed_work_sync(&pool->no_space_timeout); | ||
663 | pool->out_of_data_space = false; | ||
664 | @@ -2573,6 +2572,9 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) | ||
665 | * doesn't cause an unexpected mode transition on resume. | ||
666 | */ | ||
667 | pt->adjusted_pf.mode = new_mode; | ||
668 | + | ||
669 | + if (old_mode != new_mode) | ||
670 | + notify_of_pool_mode_change(pool); | ||
671 | } | ||
672 | |||
673 | static void abort_transaction(struct pool *pool) | ||
674 | diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c | ||
675 | index a44183ff4be0..85fb2baa8a7f 100644 | ||
676 | --- a/drivers/md/dm-zoned-target.c | ||
677 | +++ b/drivers/md/dm-zoned-target.c | ||
678 | @@ -20,7 +20,6 @@ struct dmz_bioctx { | ||
679 | struct dm_zone *zone; | ||
680 | struct bio *bio; | ||
681 | atomic_t ref; | ||
682 | - blk_status_t status; | ||
683 | }; | ||
684 | |||
685 | /* | ||
686 | @@ -78,65 +77,66 @@ static inline void dmz_bio_endio(struct bio *bio, blk_status_t status) | ||
687 | { | ||
688 | struct dmz_bioctx *bioctx = dm_per_bio_data(bio, sizeof(struct dmz_bioctx)); | ||
689 | |||
690 | - if (bioctx->status == BLK_STS_OK && status != BLK_STS_OK) | ||
691 | - bioctx->status = status; | ||
692 | - bio_endio(bio); | ||
693 | + if (status != BLK_STS_OK && bio->bi_status == BLK_STS_OK) | ||
694 | + bio->bi_status = status; | ||
695 | + | ||
696 | + if (atomic_dec_and_test(&bioctx->ref)) { | ||
697 | + struct dm_zone *zone = bioctx->zone; | ||
698 | + | ||
699 | + if (zone) { | ||
700 | + if (bio->bi_status != BLK_STS_OK && | ||
701 | + bio_op(bio) == REQ_OP_WRITE && | ||
702 | + dmz_is_seq(zone)) | ||
703 | + set_bit(DMZ_SEQ_WRITE_ERR, &zone->flags); | ||
704 | + dmz_deactivate_zone(zone); | ||
705 | + } | ||
706 | + bio_endio(bio); | ||
707 | + } | ||
708 | } | ||
709 | |||
710 | /* | ||
711 | - * Partial clone read BIO completion callback. This terminates the | ||
712 | + * Completion callback for an internally cloned target BIO. This terminates the | ||
713 | * target BIO when there are no more references to its context. | ||
714 | */ | ||
715 | -static void dmz_read_bio_end_io(struct bio *bio) | ||
716 | +static void dmz_clone_endio(struct bio *clone) | ||
717 | { | ||
718 | - struct dmz_bioctx *bioctx = bio->bi_private; | ||
719 | - blk_status_t status = bio->bi_status; | ||
720 | + struct dmz_bioctx *bioctx = clone->bi_private; | ||
721 | + blk_status_t status = clone->bi_status; | ||
722 | |||
723 | - bio_put(bio); | ||
724 | + bio_put(clone); | ||
725 | dmz_bio_endio(bioctx->bio, status); | ||
726 | } | ||
727 | |||
728 | /* | ||
729 | - * Issue a BIO to a zone. The BIO may only partially process the | ||
730 | + * Issue a clone of a target BIO. The clone may only partially process the | ||
731 | * original target BIO. | ||
732 | */ | ||
733 | -static int dmz_submit_read_bio(struct dmz_target *dmz, struct dm_zone *zone, | ||
734 | - struct bio *bio, sector_t chunk_block, | ||
735 | - unsigned int nr_blocks) | ||
736 | +static int dmz_submit_bio(struct dmz_target *dmz, struct dm_zone *zone, | ||
737 | + struct bio *bio, sector_t chunk_block, | ||
738 | + unsigned int nr_blocks) | ||
739 | { | ||
740 | struct dmz_bioctx *bioctx = dm_per_bio_data(bio, sizeof(struct dmz_bioctx)); | ||
741 | - sector_t sector; | ||
742 | struct bio *clone; | ||
743 | |||
744 | - /* BIO remap sector */ | ||
745 | - sector = dmz_start_sect(dmz->metadata, zone) + dmz_blk2sect(chunk_block); | ||
746 | - | ||
747 | - /* If the read is not partial, there is no need to clone the BIO */ | ||
748 | - if (nr_blocks == dmz_bio_blocks(bio)) { | ||
749 | - /* Setup and submit the BIO */ | ||
750 | - bio->bi_iter.bi_sector = sector; | ||
751 | - atomic_inc(&bioctx->ref); | ||
752 | - generic_make_request(bio); | ||
753 | - return 0; | ||
754 | - } | ||
755 | - | ||
756 | - /* Partial BIO: we need to clone the BIO */ | ||
757 | clone = bio_clone_fast(bio, GFP_NOIO, &dmz->bio_set); | ||
758 | if (!clone) | ||
759 | return -ENOMEM; | ||
760 | |||
761 | - /* Setup the clone */ | ||
762 | - clone->bi_iter.bi_sector = sector; | ||
763 | + bio_set_dev(clone, dmz->dev->bdev); | ||
764 | + clone->bi_iter.bi_sector = | ||
765 | + dmz_start_sect(dmz->metadata, zone) + dmz_blk2sect(chunk_block); | ||
766 | clone->bi_iter.bi_size = dmz_blk2sect(nr_blocks) << SECTOR_SHIFT; | ||
767 | - clone->bi_end_io = dmz_read_bio_end_io; | ||
768 | + clone->bi_end_io = dmz_clone_endio; | ||
769 | clone->bi_private = bioctx; | ||
770 | |||
771 | bio_advance(bio, clone->bi_iter.bi_size); | ||
772 | |||
773 | - /* Submit the clone */ | ||
774 | atomic_inc(&bioctx->ref); | ||
775 | generic_make_request(clone); | ||
776 | |||
777 | + if (bio_op(bio) == REQ_OP_WRITE && dmz_is_seq(zone)) | ||
778 | + zone->wp_block += nr_blocks; | ||
779 | + | ||
780 | return 0; | ||
781 | } | ||
782 | |||
783 | @@ -214,7 +214,7 @@ static int dmz_handle_read(struct dmz_target *dmz, struct dm_zone *zone, | ||
784 | if (nr_blocks) { | ||
785 | /* Valid blocks found: read them */ | ||
786 | nr_blocks = min_t(unsigned int, nr_blocks, end_block - chunk_block); | ||
787 | - ret = dmz_submit_read_bio(dmz, rzone, bio, chunk_block, nr_blocks); | ||
788 | + ret = dmz_submit_bio(dmz, rzone, bio, chunk_block, nr_blocks); | ||
789 | if (ret) | ||
790 | return ret; | ||
791 | chunk_block += nr_blocks; | ||
792 | @@ -228,25 +228,6 @@ static int dmz_handle_read(struct dmz_target *dmz, struct dm_zone *zone, | ||
793 | return 0; | ||
794 | } | ||
795 | |||
796 | -/* | ||
797 | - * Issue a write BIO to a zone. | ||
798 | - */ | ||
799 | -static void dmz_submit_write_bio(struct dmz_target *dmz, struct dm_zone *zone, | ||
800 | - struct bio *bio, sector_t chunk_block, | ||
801 | - unsigned int nr_blocks) | ||
802 | -{ | ||
803 | - struct dmz_bioctx *bioctx = dm_per_bio_data(bio, sizeof(struct dmz_bioctx)); | ||
804 | - | ||
805 | - /* Setup and submit the BIO */ | ||
806 | - bio_set_dev(bio, dmz->dev->bdev); | ||
807 | - bio->bi_iter.bi_sector = dmz_start_sect(dmz->metadata, zone) + dmz_blk2sect(chunk_block); | ||
808 | - atomic_inc(&bioctx->ref); | ||
809 | - generic_make_request(bio); | ||
810 | - | ||
811 | - if (dmz_is_seq(zone)) | ||
812 | - zone->wp_block += nr_blocks; | ||
813 | -} | ||
814 | - | ||
815 | /* | ||
816 | * Write blocks directly in a data zone, at the write pointer. | ||
817 | * If a buffer zone is assigned, invalidate the blocks written | ||
818 | @@ -265,7 +246,9 @@ static int dmz_handle_direct_write(struct dmz_target *dmz, | ||
819 | return -EROFS; | ||
820 | |||
821 | /* Submit write */ | ||
822 | - dmz_submit_write_bio(dmz, zone, bio, chunk_block, nr_blocks); | ||
823 | + ret = dmz_submit_bio(dmz, zone, bio, chunk_block, nr_blocks); | ||
824 | + if (ret) | ||
825 | + return ret; | ||
826 | |||
827 | /* | ||
828 | * Validate the blocks in the data zone and invalidate | ||
829 | @@ -301,7 +284,9 @@ static int dmz_handle_buffered_write(struct dmz_target *dmz, | ||
830 | return -EROFS; | ||
831 | |||
832 | /* Submit write */ | ||
833 | - dmz_submit_write_bio(dmz, bzone, bio, chunk_block, nr_blocks); | ||
834 | + ret = dmz_submit_bio(dmz, bzone, bio, chunk_block, nr_blocks); | ||
835 | + if (ret) | ||
836 | + return ret; | ||
837 | |||
838 | /* | ||
839 | * Validate the blocks in the buffer zone | ||
840 | @@ -600,7 +585,6 @@ static int dmz_map(struct dm_target *ti, struct bio *bio) | ||
841 | bioctx->zone = NULL; | ||
842 | bioctx->bio = bio; | ||
843 | atomic_set(&bioctx->ref, 1); | ||
844 | - bioctx->status = BLK_STS_OK; | ||
845 | |||
846 | /* Set the BIO pending in the flush list */ | ||
847 | if (!nr_sectors && bio_op(bio) == REQ_OP_WRITE) { | ||
848 | @@ -623,35 +607,6 @@ static int dmz_map(struct dm_target *ti, struct bio *bio) | ||
849 | return DM_MAPIO_SUBMITTED; | ||
850 | } | ||
851 | |||
852 | -/* | ||
853 | - * Completed target BIO processing. | ||
854 | - */ | ||
855 | -static int dmz_end_io(struct dm_target *ti, struct bio *bio, blk_status_t *error) | ||
856 | -{ | ||
857 | - struct dmz_bioctx *bioctx = dm_per_bio_data(bio, sizeof(struct dmz_bioctx)); | ||
858 | - | ||
859 | - if (bioctx->status == BLK_STS_OK && *error) | ||
860 | - bioctx->status = *error; | ||
861 | - | ||
862 | - if (!atomic_dec_and_test(&bioctx->ref)) | ||
863 | - return DM_ENDIO_INCOMPLETE; | ||
864 | - | ||
865 | - /* Done */ | ||
866 | - bio->bi_status = bioctx->status; | ||
867 | - | ||
868 | - if (bioctx->zone) { | ||
869 | - struct dm_zone *zone = bioctx->zone; | ||
870 | - | ||
871 | - if (*error && bio_op(bio) == REQ_OP_WRITE) { | ||
872 | - if (dmz_is_seq(zone)) | ||
873 | - set_bit(DMZ_SEQ_WRITE_ERR, &zone->flags); | ||
874 | - } | ||
875 | - dmz_deactivate_zone(zone); | ||
876 | - } | ||
877 | - | ||
878 | - return DM_ENDIO_DONE; | ||
879 | -} | ||
880 | - | ||
881 | /* | ||
882 | * Get zoned device information. | ||
883 | */ | ||
884 | @@ -947,7 +902,6 @@ static struct target_type dmz_type = { | ||
885 | .ctr = dmz_ctr, | ||
886 | .dtr = dmz_dtr, | ||
887 | .map = dmz_map, | ||
888 | - .end_io = dmz_end_io, | ||
889 | .io_hints = dmz_io_hints, | ||
890 | .prepare_ioctl = dmz_prepare_ioctl, | ||
891 | .postsuspend = dmz_suspend, | ||
892 | diff --git a/drivers/md/dm.c b/drivers/md/dm.c | ||
893 | index 45abb54037fc..07d2949a8746 100644 | ||
894 | --- a/drivers/md/dm.c | ||
895 | +++ b/drivers/md/dm.c | ||
896 | @@ -1592,6 +1592,8 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, | ||
897 | return ret; | ||
898 | } | ||
899 | |||
900 | + blk_queue_split(md->queue, &bio); | ||
901 | + | ||
902 | init_clone_info(&ci, md, map, bio); | ||
903 | |||
904 | if (bio->bi_opf & REQ_PREFLUSH) { | ||
905 | diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c | ||
906 | index 5653e8eebe2b..16c7b20cbf61 100644 | ||
907 | --- a/drivers/media/common/videobuf2/videobuf2-core.c | ||
908 | +++ b/drivers/media/common/videobuf2/videobuf2-core.c | ||
909 | @@ -1755,10 +1755,8 @@ int vb2_core_streamon(struct vb2_queue *q, unsigned int type) | ||
910 | if (ret) | ||
911 | return ret; | ||
912 | ret = vb2_start_streaming(q); | ||
913 | - if (ret) { | ||
914 | - __vb2_queue_cancel(q); | ||
915 | + if (ret) | ||
916 | return ret; | ||
917 | - } | ||
918 | } | ||
919 | |||
920 | q->streaming = 1; | ||
921 | diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c | ||
922 | index e201ccb3fda4..f6755b86eba2 100644 | ||
923 | --- a/drivers/mmc/core/block.c | ||
924 | +++ b/drivers/mmc/core/block.c | ||
925 | @@ -472,7 +472,7 @@ out: | ||
926 | static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, | ||
927 | struct mmc_blk_ioc_data *idata) | ||
928 | { | ||
929 | - struct mmc_command cmd = {}; | ||
930 | + struct mmc_command cmd = {}, sbc = {}; | ||
931 | struct mmc_data data = {}; | ||
932 | struct mmc_request mrq = {}; | ||
933 | struct scatterlist sg; | ||
934 | @@ -550,10 +550,15 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, | ||
935 | } | ||
936 | |||
937 | if (idata->rpmb) { | ||
938 | - err = mmc_set_blockcount(card, data.blocks, | ||
939 | - idata->ic.write_flag & (1 << 31)); | ||
940 | - if (err) | ||
941 | - return err; | ||
942 | + sbc.opcode = MMC_SET_BLOCK_COUNT; | ||
943 | + /* | ||
944 | + * We don't do any blockcount validation because the max size | ||
945 | + * may be increased by a future standard. We just copy the | ||
946 | + * 'Reliable Write' bit here. | ||
947 | + */ | ||
948 | + sbc.arg = data.blocks | (idata->ic.write_flag & BIT(31)); | ||
949 | + sbc.flags = MMC_RSP_R1 | MMC_CMD_AC; | ||
950 | + mrq.sbc = &sbc; | ||
951 | } | ||
952 | |||
953 | if ((MMC_EXTRACT_INDEX_FROM_ARG(cmd.arg) == EXT_CSD_SANITIZE_START) && | ||
954 | diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c | ||
955 | index adf32682f27a..c60a7625b1fa 100644 | ||
956 | --- a/drivers/mmc/host/omap.c | ||
957 | +++ b/drivers/mmc/host/omap.c | ||
958 | @@ -104,6 +104,7 @@ struct mmc_omap_slot { | ||
959 | unsigned int vdd; | ||
960 | u16 saved_con; | ||
961 | u16 bus_mode; | ||
962 | + u16 power_mode; | ||
963 | unsigned int fclk_freq; | ||
964 | |||
965 | struct tasklet_struct cover_tasklet; | ||
966 | @@ -1157,7 +1158,7 @@ static void mmc_omap_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | ||
967 | struct mmc_omap_slot *slot = mmc_priv(mmc); | ||
968 | struct mmc_omap_host *host = slot->host; | ||
969 | int i, dsor; | ||
970 | - int clk_enabled; | ||
971 | + int clk_enabled, init_stream; | ||
972 | |||
973 | mmc_omap_select_slot(slot, 0); | ||
974 | |||
975 | @@ -1167,6 +1168,7 @@ static void mmc_omap_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | ||
976 | slot->vdd = ios->vdd; | ||
977 | |||
978 | clk_enabled = 0; | ||
979 | + init_stream = 0; | ||
980 | switch (ios->power_mode) { | ||
981 | case MMC_POWER_OFF: | ||
982 | mmc_omap_set_power(slot, 0, ios->vdd); | ||
983 | @@ -1174,13 +1176,17 @@ static void mmc_omap_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | ||
984 | case MMC_POWER_UP: | ||
985 | /* Cannot touch dsor yet, just power up MMC */ | ||
986 | mmc_omap_set_power(slot, 1, ios->vdd); | ||
987 | + slot->power_mode = ios->power_mode; | ||
988 | goto exit; | ||
989 | case MMC_POWER_ON: | ||
990 | mmc_omap_fclk_enable(host, 1); | ||
991 | clk_enabled = 1; | ||
992 | dsor |= 1 << 11; | ||
993 | + if (slot->power_mode != MMC_POWER_ON) | ||
994 | + init_stream = 1; | ||
995 | break; | ||
996 | } | ||
997 | + slot->power_mode = ios->power_mode; | ||
998 | |||
999 | if (slot->bus_mode != ios->bus_mode) { | ||
1000 | if (slot->pdata->set_bus_mode != NULL) | ||
1001 | @@ -1196,7 +1202,7 @@ static void mmc_omap_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | ||
1002 | for (i = 0; i < 2; i++) | ||
1003 | OMAP_MMC_WRITE(host, CON, dsor); | ||
1004 | slot->saved_con = dsor; | ||
1005 | - if (ios->power_mode == MMC_POWER_ON) { | ||
1006 | + if (init_stream) { | ||
1007 | /* worst case at 400kHz, 80 cycles makes 200 microsecs */ | ||
1008 | int usecs = 250; | ||
1009 | |||
1010 | @@ -1234,6 +1240,7 @@ static int mmc_omap_new_slot(struct mmc_omap_host *host, int id) | ||
1011 | slot->host = host; | ||
1012 | slot->mmc = mmc; | ||
1013 | slot->id = id; | ||
1014 | + slot->power_mode = MMC_POWER_UNDEFINED; | ||
1015 | slot->pdata = &host->pdata->slots[id]; | ||
1016 | |||
1017 | host->slots[id] = slot; | ||
1018 | diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c | ||
1019 | index 88347ce78f23..d264391616f9 100644 | ||
1020 | --- a/drivers/mmc/host/sdhci-omap.c | ||
1021 | +++ b/drivers/mmc/host/sdhci-omap.c | ||
1022 | @@ -288,9 +288,9 @@ static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode) | ||
1023 | struct device *dev = omap_host->dev; | ||
1024 | struct mmc_ios *ios = &mmc->ios; | ||
1025 | u32 start_window = 0, max_window = 0; | ||
1026 | + bool dcrc_was_enabled = false; | ||
1027 | u8 cur_match, prev_match = 0; | ||
1028 | u32 length = 0, max_len = 0; | ||
1029 | - u32 ier = host->ier; | ||
1030 | u32 phase_delay = 0; | ||
1031 | int ret = 0; | ||
1032 | u32 reg; | ||
1033 | @@ -317,9 +317,10 @@ static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode) | ||
1034 | * during the tuning procedure. So disable it during the | ||
1035 | * tuning procedure. | ||
1036 | */ | ||
1037 | - ier &= ~SDHCI_INT_DATA_CRC; | ||
1038 | - sdhci_writel(host, ier, SDHCI_INT_ENABLE); | ||
1039 | - sdhci_writel(host, ier, SDHCI_SIGNAL_ENABLE); | ||
1040 | + if (host->ier & SDHCI_INT_DATA_CRC) { | ||
1041 | + host->ier &= ~SDHCI_INT_DATA_CRC; | ||
1042 | + dcrc_was_enabled = true; | ||
1043 | + } | ||
1044 | |||
1045 | while (phase_delay <= MAX_PHASE_DELAY) { | ||
1046 | sdhci_omap_set_dll(omap_host, phase_delay); | ||
1047 | @@ -366,6 +367,9 @@ tuning_error: | ||
1048 | |||
1049 | ret: | ||
1050 | sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); | ||
1051 | + /* Reenable forbidden interrupt */ | ||
1052 | + if (dcrc_was_enabled) | ||
1053 | + host->ier |= SDHCI_INT_DATA_CRC; | ||
1054 | sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); | ||
1055 | sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); | ||
1056 | return ret; | ||
1057 | diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c | ||
1058 | index 1b3fbd9bd5c5..654051e00117 100644 | ||
1059 | --- a/drivers/mmc/host/sdhci.c | ||
1060 | +++ b/drivers/mmc/host/sdhci.c | ||
1061 | @@ -193,8 +193,12 @@ void sdhci_reset(struct sdhci_host *host, u8 mask) | ||
1062 | timeout = ktime_add_ms(ktime_get(), 100); | ||
1063 | |||
1064 | /* hw clears the bit when it's done */ | ||
1065 | - while (sdhci_readb(host, SDHCI_SOFTWARE_RESET) & mask) { | ||
1066 | - if (ktime_after(ktime_get(), timeout)) { | ||
1067 | + while (1) { | ||
1068 | + bool timedout = ktime_after(ktime_get(), timeout); | ||
1069 | + | ||
1070 | + if (!(sdhci_readb(host, SDHCI_SOFTWARE_RESET) & mask)) | ||
1071 | + break; | ||
1072 | + if (timedout) { | ||
1073 | pr_err("%s: Reset 0x%x never completed.\n", | ||
1074 | mmc_hostname(host->mmc), (int)mask); | ||
1075 | sdhci_dumpregs(host); | ||
1076 | @@ -1495,9 +1499,13 @@ void sdhci_enable_clk(struct sdhci_host *host, u16 clk) | ||
1077 | |||
1078 | /* Wait max 20 ms */ | ||
1079 | timeout = ktime_add_ms(ktime_get(), 20); | ||
1080 | - while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL)) | ||
1081 | - & SDHCI_CLOCK_INT_STABLE)) { | ||
1082 | - if (ktime_after(ktime_get(), timeout)) { | ||
1083 | + while (1) { | ||
1084 | + bool timedout = ktime_after(ktime_get(), timeout); | ||
1085 | + | ||
1086 | + clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL); | ||
1087 | + if (clk & SDHCI_CLOCK_INT_STABLE) | ||
1088 | + break; | ||
1089 | + if (timedout) { | ||
1090 | pr_err("%s: Internal clock never stabilised.\n", | ||
1091 | mmc_hostname(host->mmc)); | ||
1092 | sdhci_dumpregs(host); | ||
1093 | diff --git a/drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c b/drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c | ||
1094 | index 6624499eae72..4ada80317a3b 100644 | ||
1095 | --- a/drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c | ||
1096 | +++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c | ||
1097 | @@ -568,7 +568,7 @@ static const struct sunxi_desc_pin sun8i_a83t_pins[] = { | ||
1098 | SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 11), | ||
1099 | SUNXI_FUNCTION(0x0, "gpio_in"), | ||
1100 | SUNXI_FUNCTION(0x1, "gpio_out"), | ||
1101 | - SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)), /* PH_EINT11 */ | ||
1102 | + SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 11)), /* PH_EINT11 */ | ||
1103 | }; | ||
1104 | |||
1105 | static const struct sunxi_pinctrl_desc sun8i_a83t_pinctrl_data = { | ||
1106 | diff --git a/drivers/scsi/raid_class.c b/drivers/scsi/raid_class.c | ||
1107 | index ea88906d2cc5..5c3d6e1e0145 100644 | ||
1108 | --- a/drivers/scsi/raid_class.c | ||
1109 | +++ b/drivers/scsi/raid_class.c | ||
1110 | @@ -63,8 +63,7 @@ static int raid_match(struct attribute_container *cont, struct device *dev) | ||
1111 | * emulated RAID devices, so start with SCSI */ | ||
1112 | struct raid_internal *i = ac_to_raid_internal(cont); | ||
1113 | |||
1114 | -#if defined(CONFIG_SCSI) || defined(CONFIG_SCSI_MODULE) | ||
1115 | - if (scsi_is_sdev_device(dev)) { | ||
1116 | + if (IS_ENABLED(CONFIG_SCSI) && scsi_is_sdev_device(dev)) { | ||
1117 | struct scsi_device *sdev = to_scsi_device(dev); | ||
1118 | |||
1119 | if (i->f->cookie != sdev->host->hostt) | ||
1120 | @@ -72,7 +71,6 @@ static int raid_match(struct attribute_container *cont, struct device *dev) | ||
1121 | |||
1122 | return i->f->is_raid(dev); | ||
1123 | } | ||
1124 | -#endif | ||
1125 | /* FIXME: look at other subsystems too */ | ||
1126 | return 0; | ||
1127 | } | ||
1128 | diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c | ||
1129 | index 8be4d6786c61..14a9d18306cb 100644 | ||
1130 | --- a/drivers/slimbus/qcom-ngd-ctrl.c | ||
1131 | +++ b/drivers/slimbus/qcom-ngd-ctrl.c | ||
1132 | @@ -1467,7 +1467,7 @@ static int qcom_slim_ngd_remove(struct platform_device *pdev) | ||
1133 | return 0; | ||
1134 | } | ||
1135 | |||
1136 | -static int qcom_slim_ngd_runtime_idle(struct device *dev) | ||
1137 | +static int __maybe_unused qcom_slim_ngd_runtime_idle(struct device *dev) | ||
1138 | { | ||
1139 | struct qcom_slim_ngd_ctrl *ctrl = dev_get_drvdata(dev); | ||
1140 | |||
1141 | @@ -1477,8 +1477,7 @@ static int qcom_slim_ngd_runtime_idle(struct device *dev) | ||
1142 | return -EAGAIN; | ||
1143 | } | ||
1144 | |||
1145 | -#ifdef CONFIG_PM | ||
1146 | -static int qcom_slim_ngd_runtime_suspend(struct device *dev) | ||
1147 | +static int __maybe_unused qcom_slim_ngd_runtime_suspend(struct device *dev) | ||
1148 | { | ||
1149 | struct qcom_slim_ngd_ctrl *ctrl = dev_get_drvdata(dev); | ||
1150 | int ret = 0; | ||
1151 | @@ -1491,7 +1490,6 @@ static int qcom_slim_ngd_runtime_suspend(struct device *dev) | ||
1152 | |||
1153 | return ret; | ||
1154 | } | ||
1155 | -#endif | ||
1156 | |||
1157 | static const struct dev_pm_ops qcom_slim_ngd_dev_pm_ops = { | ||
1158 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, | ||
1159 | diff --git a/drivers/staging/olpc_dcon/Kconfig b/drivers/staging/olpc_dcon/Kconfig | ||
1160 | index c91a56f77bcb..192cc8d0853f 100644 | ||
1161 | --- a/drivers/staging/olpc_dcon/Kconfig | ||
1162 | +++ b/drivers/staging/olpc_dcon/Kconfig | ||
1163 | @@ -2,6 +2,7 @@ config FB_OLPC_DCON | ||
1164 | tristate "One Laptop Per Child Display CONtroller support" | ||
1165 | depends on OLPC && FB | ||
1166 | depends on I2C | ||
1167 | + depends on BACKLIGHT_LCD_SUPPORT | ||
1168 | depends on (GPIO_CS5535 || GPIO_CS5535=n) | ||
1169 | select BACKLIGHT_CLASS_DEVICE | ||
1170 | help | ||
1171 | diff --git a/fs/aio.c b/fs/aio.c | ||
1172 | index 04c4d6218978..44551d96eaa4 100644 | ||
1173 | --- a/fs/aio.c | ||
1174 | +++ b/fs/aio.c | ||
1175 | @@ -45,6 +45,7 @@ | ||
1176 | |||
1177 | #include <asm/kmap_types.h> | ||
1178 | #include <linux/uaccess.h> | ||
1179 | +#include <linux/nospec.h> | ||
1180 | |||
1181 | #include "internal.h" | ||
1182 | |||
1183 | @@ -1038,6 +1039,7 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id) | ||
1184 | if (!table || id >= table->nr) | ||
1185 | goto out; | ||
1186 | |||
1187 | + id = array_index_nospec(id, table->nr); | ||
1188 | ctx = rcu_dereference(table->table[id]); | ||
1189 | if (ctx && ctx->user_id == ctx_id) { | ||
1190 | if (percpu_ref_tryget_live(&ctx->users)) | ||
1191 | diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c | ||
1192 | index 0979609d6eba..82a13221775e 100644 | ||
1193 | --- a/fs/fuse/dir.c | ||
1194 | +++ b/fs/fuse/dir.c | ||
1195 | @@ -1439,7 +1439,7 @@ static int fuse_dir_open(struct inode *inode, struct file *file) | ||
1196 | |||
1197 | static int fuse_dir_release(struct inode *inode, struct file *file) | ||
1198 | { | ||
1199 | - fuse_release_common(file, FUSE_RELEASEDIR); | ||
1200 | + fuse_release_common(file, true); | ||
1201 | |||
1202 | return 0; | ||
1203 | } | ||
1204 | diff --git a/fs/fuse/file.c b/fs/fuse/file.c | ||
1205 | index a0ffed34b85d..fbd6978479cb 100644 | ||
1206 | --- a/fs/fuse/file.c | ||
1207 | +++ b/fs/fuse/file.c | ||
1208 | @@ -87,12 +87,12 @@ static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req) | ||
1209 | iput(req->misc.release.inode); | ||
1210 | } | ||
1211 | |||
1212 | -static void fuse_file_put(struct fuse_file *ff, bool sync) | ||
1213 | +static void fuse_file_put(struct fuse_file *ff, bool sync, bool isdir) | ||
1214 | { | ||
1215 | if (refcount_dec_and_test(&ff->count)) { | ||
1216 | struct fuse_req *req = ff->reserved_req; | ||
1217 | |||
1218 | - if (ff->fc->no_open) { | ||
1219 | + if (ff->fc->no_open && !isdir) { | ||
1220 | /* | ||
1221 | * Drop the release request when client does not | ||
1222 | * implement 'open' | ||
1223 | @@ -245,10 +245,11 @@ static void fuse_prepare_release(struct fuse_file *ff, int flags, int opcode) | ||
1224 | req->in.args[0].value = inarg; | ||
1225 | } | ||
1226 | |||
1227 | -void fuse_release_common(struct file *file, int opcode) | ||
1228 | +void fuse_release_common(struct file *file, bool isdir) | ||
1229 | { | ||
1230 | struct fuse_file *ff = file->private_data; | ||
1231 | struct fuse_req *req = ff->reserved_req; | ||
1232 | + int opcode = isdir ? FUSE_RELEASEDIR : FUSE_RELEASE; | ||
1233 | |||
1234 | fuse_prepare_release(ff, file->f_flags, opcode); | ||
1235 | |||
1236 | @@ -270,7 +271,7 @@ void fuse_release_common(struct file *file, int opcode) | ||
1237 | * synchronous RELEASE is allowed (and desirable) in this case | ||
1238 | * because the server can be trusted not to screw up. | ||
1239 | */ | ||
1240 | - fuse_file_put(ff, ff->fc->destroy_req != NULL); | ||
1241 | + fuse_file_put(ff, ff->fc->destroy_req != NULL, isdir); | ||
1242 | } | ||
1243 | |||
1244 | static int fuse_open(struct inode *inode, struct file *file) | ||
1245 | @@ -286,7 +287,7 @@ static int fuse_release(struct inode *inode, struct file *file) | ||
1246 | if (fc->writeback_cache) | ||
1247 | write_inode_now(inode, 1); | ||
1248 | |||
1249 | - fuse_release_common(file, FUSE_RELEASE); | ||
1250 | + fuse_release_common(file, false); | ||
1251 | |||
1252 | /* return value is ignored by VFS */ | ||
1253 | return 0; | ||
1254 | @@ -300,7 +301,7 @@ void fuse_sync_release(struct fuse_file *ff, int flags) | ||
1255 | * iput(NULL) is a no-op and since the refcount is 1 and everything's | ||
1256 | * synchronous, we are fine with not doing igrab() here" | ||
1257 | */ | ||
1258 | - fuse_file_put(ff, true); | ||
1259 | + fuse_file_put(ff, true, false); | ||
1260 | } | ||
1261 | EXPORT_SYMBOL_GPL(fuse_sync_release); | ||
1262 | |||
1263 | @@ -805,7 +806,7 @@ static void fuse_readpages_end(struct fuse_conn *fc, struct fuse_req *req) | ||
1264 | put_page(page); | ||
1265 | } | ||
1266 | if (req->ff) | ||
1267 | - fuse_file_put(req->ff, false); | ||
1268 | + fuse_file_put(req->ff, false, false); | ||
1269 | } | ||
1270 | |||
1271 | static void fuse_send_readpages(struct fuse_req *req, struct file *file) | ||
1272 | @@ -1459,7 +1460,7 @@ static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req) | ||
1273 | __free_page(req->pages[i]); | ||
1274 | |||
1275 | if (req->ff) | ||
1276 | - fuse_file_put(req->ff, false); | ||
1277 | + fuse_file_put(req->ff, false, false); | ||
1278 | } | ||
1279 | |||
1280 | static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req) | ||
1281 | @@ -1616,7 +1617,7 @@ int fuse_write_inode(struct inode *inode, struct writeback_control *wbc) | ||
1282 | ff = __fuse_write_file_get(fc, fi); | ||
1283 | err = fuse_flush_times(inode, ff); | ||
1284 | if (ff) | ||
1285 | - fuse_file_put(ff, 0); | ||
1286 | + fuse_file_put(ff, false, false); | ||
1287 | |||
1288 | return err; | ||
1289 | } | ||
1290 | @@ -1930,7 +1931,7 @@ static int fuse_writepages(struct address_space *mapping, | ||
1291 | err = 0; | ||
1292 | } | ||
1293 | if (data.ff) | ||
1294 | - fuse_file_put(data.ff, false); | ||
1295 | + fuse_file_put(data.ff, false, false); | ||
1296 | |||
1297 | kfree(data.orig_pages); | ||
1298 | out: | ||
1299 | diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h | ||
1300 | index f78e9614bb5f..cec8b8e74969 100644 | ||
1301 | --- a/fs/fuse/fuse_i.h | ||
1302 | +++ b/fs/fuse/fuse_i.h | ||
1303 | @@ -749,7 +749,7 @@ void fuse_sync_release(struct fuse_file *ff, int flags); | ||
1304 | /** | ||
1305 | * Send RELEASE or RELEASEDIR request | ||
1306 | */ | ||
1307 | -void fuse_release_common(struct file *file, int opcode); | ||
1308 | +void fuse_release_common(struct file *file, bool isdir); | ||
1309 | |||
1310 | /** | ||
1311 | * Send FSYNC or FSYNCDIR request | ||
1312 | diff --git a/fs/iomap.c b/fs/iomap.c | ||
1313 | index ec15cf2ec696..37da7a61a6c5 100644 | ||
1314 | --- a/fs/iomap.c | ||
1315 | +++ b/fs/iomap.c | ||
1316 | @@ -117,6 +117,12 @@ iomap_page_create(struct inode *inode, struct page *page) | ||
1317 | atomic_set(&iop->read_count, 0); | ||
1318 | atomic_set(&iop->write_count, 0); | ||
1319 | bitmap_zero(iop->uptodate, PAGE_SIZE / SECTOR_SIZE); | ||
1320 | + | ||
1321 | + /* | ||
1322 | + * migrate_page_move_mapping() assumes that pages with private data have | ||
1323 | + * their count elevated by 1. | ||
1324 | + */ | ||
1325 | + get_page(page); | ||
1326 | set_page_private(page, (unsigned long)iop); | ||
1327 | SetPagePrivate(page); | ||
1328 | return iop; | ||
1329 | @@ -133,6 +139,7 @@ iomap_page_release(struct page *page) | ||
1330 | WARN_ON_ONCE(atomic_read(&iop->write_count)); | ||
1331 | ClearPagePrivate(page); | ||
1332 | set_page_private(page, 0); | ||
1333 | + put_page(page); | ||
1334 | kfree(iop); | ||
1335 | } | ||
1336 | |||
1337 | diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c | ||
1338 | index 3bbde0a9f48f..b2aadd3e1fec 100644 | ||
1339 | --- a/fs/overlayfs/dir.c | ||
1340 | +++ b/fs/overlayfs/dir.c | ||
1341 | @@ -652,6 +652,18 @@ static int ovl_symlink(struct inode *dir, struct dentry *dentry, | ||
1342 | return ovl_create_object(dentry, S_IFLNK, 0, link); | ||
1343 | } | ||
1344 | |||
1345 | +static int ovl_set_link_redirect(struct dentry *dentry) | ||
1346 | +{ | ||
1347 | + const struct cred *old_cred; | ||
1348 | + int err; | ||
1349 | + | ||
1350 | + old_cred = ovl_override_creds(dentry->d_sb); | ||
1351 | + err = ovl_set_redirect(dentry, false); | ||
1352 | + revert_creds(old_cred); | ||
1353 | + | ||
1354 | + return err; | ||
1355 | +} | ||
1356 | + | ||
1357 | static int ovl_link(struct dentry *old, struct inode *newdir, | ||
1358 | struct dentry *new) | ||
1359 | { | ||
1360 | @@ -672,7 +684,7 @@ static int ovl_link(struct dentry *old, struct inode *newdir, | ||
1361 | goto out_drop_write; | ||
1362 | |||
1363 | if (ovl_is_metacopy_dentry(old)) { | ||
1364 | - err = ovl_set_redirect(old, false); | ||
1365 | + err = ovl_set_link_redirect(old); | ||
1366 | if (err) | ||
1367 | goto out_drop_write; | ||
1368 | } | ||
1369 | diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c | ||
1370 | index 8fa37cd7818a..54e5d17d7f3e 100644 | ||
1371 | --- a/fs/overlayfs/export.c | ||
1372 | +++ b/fs/overlayfs/export.c | ||
1373 | @@ -754,9 +754,8 @@ static struct dentry *ovl_lower_fh_to_d(struct super_block *sb, | ||
1374 | goto out; | ||
1375 | } | ||
1376 | |||
1377 | - /* Otherwise, get a connected non-upper dir or disconnected non-dir */ | ||
1378 | - if (d_is_dir(origin.dentry) && | ||
1379 | - (origin.dentry->d_flags & DCACHE_DISCONNECTED)) { | ||
1380 | + /* Find origin.dentry again with ovl_acceptable() layer check */ | ||
1381 | + if (d_is_dir(origin.dentry)) { | ||
1382 | dput(origin.dentry); | ||
1383 | origin.dentry = NULL; | ||
1384 | err = ovl_check_origin_fh(ofs, fh, true, NULL, &stack); | ||
1385 | @@ -769,6 +768,7 @@ static struct dentry *ovl_lower_fh_to_d(struct super_block *sb, | ||
1386 | goto out_err; | ||
1387 | } | ||
1388 | |||
1389 | + /* Get a connected non-upper dir or disconnected non-dir */ | ||
1390 | dentry = ovl_get_dentry(sb, NULL, &origin, index); | ||
1391 | |||
1392 | out: | ||
1393 | diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c | ||
1394 | index cd58939dc977..7a85e609fc27 100644 | ||
1395 | --- a/fs/userfaultfd.c | ||
1396 | +++ b/fs/userfaultfd.c | ||
1397 | @@ -1566,7 +1566,6 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx, | ||
1398 | cond_resched(); | ||
1399 | |||
1400 | BUG_ON(!vma_can_userfault(vma)); | ||
1401 | - WARN_ON(!(vma->vm_flags & VM_MAYWRITE)); | ||
1402 | |||
1403 | /* | ||
1404 | * Nothing to do: this vma is already registered into this | ||
1405 | @@ -1575,6 +1574,8 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx, | ||
1406 | if (!vma->vm_userfaultfd_ctx.ctx) | ||
1407 | goto skip; | ||
1408 | |||
1409 | + WARN_ON(!(vma->vm_flags & VM_MAYWRITE)); | ||
1410 | + | ||
1411 | if (vma->vm_start > start) | ||
1412 | start = vma->vm_start; | ||
1413 | vma_end = min(end, vma->vm_end); | ||
1414 | diff --git a/init/Kconfig b/init/Kconfig | ||
1415 | index 1e234e2f1cba..317d5ccb5191 100644 | ||
1416 | --- a/init/Kconfig | ||
1417 | +++ b/init/Kconfig | ||
1418 | @@ -415,6 +415,11 @@ config IRQ_TIME_ACCOUNTING | ||
1419 | |||
1420 | If in doubt, say N here. | ||
1421 | |||
1422 | +config HAVE_SCHED_AVG_IRQ | ||
1423 | + def_bool y | ||
1424 | + depends on IRQ_TIME_ACCOUNTING || PARAVIRT_TIME_ACCOUNTING | ||
1425 | + depends on SMP | ||
1426 | + | ||
1427 | config BSD_PROCESS_ACCT | ||
1428 | bool "BSD Process Accounting" | ||
1429 | depends on MULTIUSER | ||
1430 | diff --git a/kernel/sched/core.c b/kernel/sched/core.c | ||
1431 | index 2beda4b726e2..13ddfa46d741 100644 | ||
1432 | --- a/kernel/sched/core.c | ||
1433 | +++ b/kernel/sched/core.c | ||
1434 | @@ -135,9 +135,8 @@ static void update_rq_clock_task(struct rq *rq, s64 delta) | ||
1435 | * In theory, the compile should just see 0 here, and optimize out the call | ||
1436 | * to sched_rt_avg_update. But I don't trust it... | ||
1437 | */ | ||
1438 | -#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING) | ||
1439 | - s64 steal = 0, irq_delta = 0; | ||
1440 | -#endif | ||
1441 | + s64 __maybe_unused steal = 0, irq_delta = 0; | ||
1442 | + | ||
1443 | #ifdef CONFIG_IRQ_TIME_ACCOUNTING | ||
1444 | irq_delta = irq_time_read(cpu_of(rq)) - rq->prev_irq_time; | ||
1445 | |||
1446 | @@ -177,7 +176,7 @@ static void update_rq_clock_task(struct rq *rq, s64 delta) | ||
1447 | |||
1448 | rq->clock_task += delta; | ||
1449 | |||
1450 | -#ifdef HAVE_SCHED_AVG_IRQ | ||
1451 | +#ifdef CONFIG_HAVE_SCHED_AVG_IRQ | ||
1452 | if ((irq_delta + steal) && sched_feat(NONTASK_CAPACITY)) | ||
1453 | update_irq_load_avg(rq, irq_delta + steal); | ||
1454 | #endif | ||
1455 | diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c | ||
1456 | index 1162552dc3cc..eabbf6b10b44 100644 | ||
1457 | --- a/kernel/sched/fair.c | ||
1458 | +++ b/kernel/sched/fair.c | ||
1459 | @@ -7361,7 +7361,7 @@ static inline bool others_have_blocked(struct rq *rq) | ||
1460 | if (READ_ONCE(rq->avg_dl.util_avg)) | ||
1461 | return true; | ||
1462 | |||
1463 | -#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING) | ||
1464 | +#ifdef CONFIG_HAVE_SCHED_AVG_IRQ | ||
1465 | if (READ_ONCE(rq->avg_irq.util_avg)) | ||
1466 | return true; | ||
1467 | #endif | ||
1468 | diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c | ||
1469 | index 35475c0c5419..48a126486435 100644 | ||
1470 | --- a/kernel/sched/pelt.c | ||
1471 | +++ b/kernel/sched/pelt.c | ||
1472 | @@ -358,7 +358,7 @@ int update_dl_rq_load_avg(u64 now, struct rq *rq, int running) | ||
1473 | return 0; | ||
1474 | } | ||
1475 | |||
1476 | -#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING) | ||
1477 | +#ifdef CONFIG_HAVE_SCHED_AVG_IRQ | ||
1478 | /* | ||
1479 | * irq: | ||
1480 | * | ||
1481 | diff --git a/kernel/sched/pelt.h b/kernel/sched/pelt.h | ||
1482 | index d2894db28955..7e56b489ff32 100644 | ||
1483 | --- a/kernel/sched/pelt.h | ||
1484 | +++ b/kernel/sched/pelt.h | ||
1485 | @@ -6,7 +6,7 @@ int __update_load_avg_cfs_rq(u64 now, int cpu, struct cfs_rq *cfs_rq); | ||
1486 | int update_rt_rq_load_avg(u64 now, struct rq *rq, int running); | ||
1487 | int update_dl_rq_load_avg(u64 now, struct rq *rq, int running); | ||
1488 | |||
1489 | -#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING) | ||
1490 | +#ifdef CONFIG_HAVE_SCHED_AVG_IRQ | ||
1491 | int update_irq_load_avg(struct rq *rq, u64 running); | ||
1492 | #else | ||
1493 | static inline int | ||
1494 | diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h | ||
1495 | index 6c25bbe87bd3..b63172288f7b 100644 | ||
1496 | --- a/kernel/sched/sched.h | ||
1497 | +++ b/kernel/sched/sched.h | ||
1498 | @@ -859,8 +859,7 @@ struct rq { | ||
1499 | |||
1500 | struct sched_avg avg_rt; | ||
1501 | struct sched_avg avg_dl; | ||
1502 | -#if defined(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING) | ||
1503 | -#define HAVE_SCHED_AVG_IRQ | ||
1504 | +#ifdef CONFIG_HAVE_SCHED_AVG_IRQ | ||
1505 | struct sched_avg avg_irq; | ||
1506 | #endif | ||
1507 | u64 idle_stamp; | ||
1508 | @@ -2215,7 +2214,7 @@ static inline unsigned long cpu_util_rt(struct rq *rq) | ||
1509 | } | ||
1510 | #endif | ||
1511 | |||
1512 | -#ifdef HAVE_SCHED_AVG_IRQ | ||
1513 | +#ifdef CONFIG_HAVE_SCHED_AVG_IRQ | ||
1514 | static inline unsigned long cpu_util_irq(struct rq *rq) | ||
1515 | { | ||
1516 | return rq->avg_irq.util_avg; | ||
1517 | diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c | ||
1518 | index 77734451cb05..e23eb9fc77aa 100644 | ||
1519 | --- a/kernel/trace/ftrace.c | ||
1520 | +++ b/kernel/trace/ftrace.c | ||
1521 | @@ -5460,6 +5460,7 @@ void ftrace_destroy_filter_files(struct ftrace_ops *ops) | ||
1522 | if (ops->flags & FTRACE_OPS_FL_ENABLED) | ||
1523 | ftrace_shutdown(ops, 0); | ||
1524 | ops->flags |= FTRACE_OPS_FL_DELETED; | ||
1525 | + ftrace_free_filter(ops); | ||
1526 | mutex_unlock(&ftrace_lock); | ||
1527 | } | ||
1528 | |||
1529 | diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c | ||
1530 | index 84a65173b1e9..5574e862de8d 100644 | ||
1531 | --- a/kernel/trace/trace_events_filter.c | ||
1532 | +++ b/kernel/trace/trace_events_filter.c | ||
1533 | @@ -570,11 +570,13 @@ predicate_parse(const char *str, int nr_parens, int nr_preds, | ||
1534 | } | ||
1535 | } | ||
1536 | |||
1537 | + kfree(op_stack); | ||
1538 | + kfree(inverts); | ||
1539 | return prog; | ||
1540 | out_free: | ||
1541 | kfree(op_stack); | ||
1542 | - kfree(prog_stack); | ||
1543 | kfree(inverts); | ||
1544 | + kfree(prog_stack); | ||
1545 | return ERR_PTR(ret); | ||
1546 | } | ||
1547 | |||
1548 | @@ -1718,6 +1720,7 @@ static int create_filter(struct trace_event_call *call, | ||
1549 | err = process_preds(call, filter_string, *filterp, pe); | ||
1550 | if (err && set_str) | ||
1551 | append_filter_err(pe, *filterp); | ||
1552 | + create_filter_finish(pe); | ||
1553 | |||
1554 | return err; | ||
1555 | } | ||
1556 | diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c | ||
1557 | index 2152d1e530cb..cd12ecb66eb9 100644 | ||
1558 | --- a/kernel/trace/trace_events_trigger.c | ||
1559 | +++ b/kernel/trace/trace_events_trigger.c | ||
1560 | @@ -732,8 +732,10 @@ int set_trigger_filter(char *filter_str, | ||
1561 | |||
1562 | /* The filter is for the 'trigger' event, not the triggered event */ | ||
1563 | ret = create_event_filter(file->event_call, filter_str, false, &filter); | ||
1564 | - if (ret) | ||
1565 | - goto out; | ||
1566 | + /* | ||
1567 | + * If create_event_filter() fails, filter still needs to be freed. | ||
1568 | + * Which the calling code will do with data->filter. | ||
1569 | + */ | ||
1570 | assign: | ||
1571 | tmp = rcu_access_pointer(data->filter); | ||
1572 | |||
1573 | diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py | ||
1574 | index 5056fb3b897d..e559c6294c39 100755 | ||
1575 | --- a/scripts/spdxcheck.py | ||
1576 | +++ b/scripts/spdxcheck.py | ||
1577 | @@ -168,6 +168,7 @@ class id_parser(object): | ||
1578 | self.curline = 0 | ||
1579 | try: | ||
1580 | for line in fd: | ||
1581 | + line = line.decode(locale.getpreferredencoding(False), errors='ignore') | ||
1582 | self.curline += 1 | ||
1583 | if self.curline > maxlines: | ||
1584 | break | ||
1585 | @@ -249,12 +250,13 @@ if __name__ == '__main__': | ||
1586 | |||
1587 | try: | ||
1588 | if len(args.path) and args.path[0] == '-': | ||
1589 | - parser.parse_lines(sys.stdin, args.maxlines, '-') | ||
1590 | + stdin = os.fdopen(sys.stdin.fileno(), 'rb') | ||
1591 | + parser.parse_lines(stdin, args.maxlines, '-') | ||
1592 | else: | ||
1593 | if args.path: | ||
1594 | for p in args.path: | ||
1595 | if os.path.isfile(p): | ||
1596 | - parser.parse_lines(open(p), args.maxlines, p) | ||
1597 | + parser.parse_lines(open(p, 'rb'), args.maxlines, p) | ||
1598 | elif os.path.isdir(p): | ||
1599 | scan_git_subtree(repo.head.reference.commit.tree, p) | ||
1600 | else: |