1 |
commit: 59915f204ee359cbaa6db7ac3927f1515da15eab |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed May 18 09:46:52 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed May 18 09:46:52 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=59915f20 |
7 |
|
8 |
Linux patch 5.15.41 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1040_linux-5.15.41.patch | 3108 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 3112 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 15dd23f4..35817db8 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -203,6 +203,10 @@ Patch: 1039_linux-5.15.40.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.15.40 |
23 |
|
24 |
+Patch: 1040_linux-5.15.41.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.15.41 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1040_linux-5.15.41.patch b/1040_linux-5.15.41.patch |
33 |
new file mode 100644 |
34 |
index 00000000..c47684ed |
35 |
--- /dev/null |
36 |
+++ b/1040_linux-5.15.41.patch |
37 |
@@ -0,0 +1,3108 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index d8003cb5b6ba7..c940e6542c8fd 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 15 |
46 |
+-SUBLEVEL = 40 |
47 |
++SUBLEVEL = 41 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Trick or Treat |
50 |
+ |
51 |
+diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h |
52 |
+index f74944c6fe8d3..79d246ac93ab6 100644 |
53 |
+--- a/arch/arm/include/asm/io.h |
54 |
++++ b/arch/arm/include/asm/io.h |
55 |
+@@ -436,6 +436,9 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *addr); |
56 |
+ #define ARCH_HAS_VALID_PHYS_ADDR_RANGE |
57 |
+ extern int valid_phys_addr_range(phys_addr_t addr, size_t size); |
58 |
+ extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); |
59 |
++extern bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, |
60 |
++ unsigned long flags); |
61 |
++#define arch_memremap_can_ram_remap arch_memremap_can_ram_remap |
62 |
+ #endif |
63 |
+ |
64 |
+ /* |
65 |
+diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c |
66 |
+index 80fb5a4a5c050..2660bdfcad4d0 100644 |
67 |
+--- a/arch/arm/mm/ioremap.c |
68 |
++++ b/arch/arm/mm/ioremap.c |
69 |
+@@ -479,3 +479,11 @@ void __init early_ioremap_init(void) |
70 |
+ { |
71 |
+ early_ioremap_setup(); |
72 |
+ } |
73 |
++ |
74 |
++bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, |
75 |
++ unsigned long flags) |
76 |
++{ |
77 |
++ unsigned long pfn = PHYS_PFN(offset); |
78 |
++ |
79 |
++ return memblock_is_map_memory(pfn); |
80 |
++} |
81 |
+diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h |
82 |
+index 7fd836bea7eb4..3995652daf81a 100644 |
83 |
+--- a/arch/arm64/include/asm/io.h |
84 |
++++ b/arch/arm64/include/asm/io.h |
85 |
+@@ -192,4 +192,8 @@ extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size); |
86 |
+ extern int valid_phys_addr_range(phys_addr_t addr, size_t size); |
87 |
+ extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); |
88 |
+ |
89 |
++extern bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, |
90 |
++ unsigned long flags); |
91 |
++#define arch_memremap_can_ram_remap arch_memremap_can_ram_remap |
92 |
++ |
93 |
+ #endif /* __ASM_IO_H */ |
94 |
+diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile |
95 |
+index 3f1490bfb938a..749e31475e413 100644 |
96 |
+--- a/arch/arm64/kernel/Makefile |
97 |
++++ b/arch/arm64/kernel/Makefile |
98 |
+@@ -74,6 +74,10 @@ obj-$(CONFIG_ARM64_MTE) += mte.o |
99 |
+ obj-y += vdso-wrap.o |
100 |
+ obj-$(CONFIG_COMPAT_VDSO) += vdso32-wrap.o |
101 |
+ |
102 |
++# Force dependency (vdso*-wrap.S includes vdso.so through incbin) |
103 |
++$(obj)/vdso-wrap.o: $(obj)/vdso/vdso.so |
104 |
++$(obj)/vdso32-wrap.o: $(obj)/vdso32/vdso.so |
105 |
++ |
106 |
+ obj-y += probes/ |
107 |
+ head-y := head.o |
108 |
+ extra-y += $(head-y) vmlinux.lds |
109 |
+diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile |
110 |
+index 945e6bb326e3e..b5d8f72e8b32e 100644 |
111 |
+--- a/arch/arm64/kernel/vdso/Makefile |
112 |
++++ b/arch/arm64/kernel/vdso/Makefile |
113 |
+@@ -48,9 +48,6 @@ GCOV_PROFILE := n |
114 |
+ targets += vdso.lds |
115 |
+ CPPFLAGS_vdso.lds += -P -C -U$(ARCH) |
116 |
+ |
117 |
+-# Force dependency (incbin is bad) |
118 |
+-$(obj)/vdso.o : $(obj)/vdso.so |
119 |
+- |
120 |
+ # Link rule for the .so file, .lds has to be first |
121 |
+ $(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE |
122 |
+ $(call if_changed,vdsold_and_vdso_check) |
123 |
+diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile |
124 |
+index 3514269ac75fb..83e9399e38368 100644 |
125 |
+--- a/arch/arm64/kernel/vdso32/Makefile |
126 |
++++ b/arch/arm64/kernel/vdso32/Makefile |
127 |
+@@ -144,9 +144,6 @@ obj-vdso := $(c-obj-vdso) $(c-obj-vdso-gettimeofday) $(asm-obj-vdso) |
128 |
+ targets += vdso.lds |
129 |
+ CPPFLAGS_vdso.lds += -P -C -U$(ARCH) |
130 |
+ |
131 |
+-# Force dependency (vdso.s includes vdso.so through incbin) |
132 |
+-$(obj)/vdso.o: $(obj)/vdso.so |
133 |
+- |
134 |
+ include/generated/vdso32-offsets.h: $(obj)/vdso.so.dbg FORCE |
135 |
+ $(call if_changed,vdsosym) |
136 |
+ |
137 |
+diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c |
138 |
+index b7c81dacabf07..b21f91cd830db 100644 |
139 |
+--- a/arch/arm64/mm/ioremap.c |
140 |
++++ b/arch/arm64/mm/ioremap.c |
141 |
+@@ -99,3 +99,11 @@ void __init early_ioremap_init(void) |
142 |
+ { |
143 |
+ early_ioremap_setup(); |
144 |
+ } |
145 |
++ |
146 |
++bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, |
147 |
++ unsigned long flags) |
148 |
++{ |
149 |
++ unsigned long pfn = PHYS_PFN(offset); |
150 |
++ |
151 |
++ return pfn_is_map_memory(pfn); |
152 |
++} |
153 |
+diff --git a/arch/powerpc/kvm/book3s_32_sr.S b/arch/powerpc/kvm/book3s_32_sr.S |
154 |
+index e3ab9df6cf199..6cfcd20d46686 100644 |
155 |
+--- a/arch/powerpc/kvm/book3s_32_sr.S |
156 |
++++ b/arch/powerpc/kvm/book3s_32_sr.S |
157 |
+@@ -122,11 +122,27 @@ |
158 |
+ |
159 |
+ /* 0x0 - 0xb */ |
160 |
+ |
161 |
+- /* 'current->mm' needs to be in r4 */ |
162 |
+- tophys(r4, r2) |
163 |
+- lwz r4, MM(r4) |
164 |
+- tophys(r4, r4) |
165 |
+- /* This only clobbers r0, r3, r4 and r5 */ |
166 |
++ /* switch_mmu_context() needs paging, let's enable it */ |
167 |
++ mfmsr r9 |
168 |
++ ori r11, r9, MSR_DR |
169 |
++ mtmsr r11 |
170 |
++ sync |
171 |
++ |
172 |
++ /* switch_mmu_context() clobbers r12, rescue it */ |
173 |
++ SAVE_GPR(12, r1) |
174 |
++ |
175 |
++ /* Calling switch_mmu_context(<inv>, current->mm, <inv>); */ |
176 |
++ lwz r4, MM(r2) |
177 |
+ bl switch_mmu_context |
178 |
+ |
179 |
++ /* restore r12 */ |
180 |
++ REST_GPR(12, r1) |
181 |
++ |
182 |
++ /* Disable paging again */ |
183 |
++ mfmsr r9 |
184 |
++ li r6, MSR_DR |
185 |
++ andc r9, r9, r6 |
186 |
++ mtmsr r9 |
187 |
++ sync |
188 |
++ |
189 |
+ .endm |
190 |
+diff --git a/arch/s390/Makefile b/arch/s390/Makefile |
191 |
+index d4fd1426a8226..c7b7a60f6405d 100644 |
192 |
+--- a/arch/s390/Makefile |
193 |
++++ b/arch/s390/Makefile |
194 |
+@@ -32,6 +32,16 @@ KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector |
195 |
+ KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member) |
196 |
+ KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g) |
197 |
+ KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,)) |
198 |
++ |
199 |
++ifdef CONFIG_CC_IS_GCC |
200 |
++ ifeq ($(call cc-ifversion, -ge, 1200, y), y) |
201 |
++ ifeq ($(call cc-ifversion, -lt, 1300, y), y) |
202 |
++ KBUILD_CFLAGS += $(call cc-disable-warning, array-bounds) |
203 |
++ KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, array-bounds) |
204 |
++ endif |
205 |
++ endif |
206 |
++endif |
207 |
++ |
208 |
+ UTS_MACHINE := s390x |
209 |
+ STACK_SIZE := $(if $(CONFIG_KASAN),65536,16384) |
210 |
+ CHECKFLAGS += -D__s390__ -D__s390x__ |
211 |
+diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c |
212 |
+index 36098226a9573..b01f5d2caad04 100644 |
213 |
+--- a/arch/x86/mm/init_64.c |
214 |
++++ b/arch/x86/mm/init_64.c |
215 |
+@@ -902,6 +902,8 @@ static void __meminit vmemmap_use_sub_pmd(unsigned long start, unsigned long end |
216 |
+ |
217 |
+ static void __meminit vmemmap_use_new_sub_pmd(unsigned long start, unsigned long end) |
218 |
+ { |
219 |
++ const unsigned long page = ALIGN_DOWN(start, PMD_SIZE); |
220 |
++ |
221 |
+ vmemmap_flush_unused_pmd(); |
222 |
+ |
223 |
+ /* |
224 |
+@@ -914,8 +916,7 @@ static void __meminit vmemmap_use_new_sub_pmd(unsigned long start, unsigned long |
225 |
+ * Mark with PAGE_UNUSED the unused parts of the new memmap range |
226 |
+ */ |
227 |
+ if (!IS_ALIGNED(start, PMD_SIZE)) |
228 |
+- memset((void *)start, PAGE_UNUSED, |
229 |
+- start - ALIGN_DOWN(start, PMD_SIZE)); |
230 |
++ memset((void *)page, PAGE_UNUSED, start - page); |
231 |
+ |
232 |
+ /* |
233 |
+ * We want to avoid memset(PAGE_UNUSED) when populating the vmemmap of |
234 |
+diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c |
235 |
+index ef904b8b112e6..04ede46f75123 100644 |
236 |
+--- a/drivers/base/firmware_loader/main.c |
237 |
++++ b/drivers/base/firmware_loader/main.c |
238 |
+@@ -795,6 +795,8 @@ _request_firmware(const struct firmware **firmware_p, const char *name, |
239 |
+ size_t offset, u32 opt_flags) |
240 |
+ { |
241 |
+ struct firmware *fw = NULL; |
242 |
++ struct cred *kern_cred = NULL; |
243 |
++ const struct cred *old_cred; |
244 |
+ bool nondirect = false; |
245 |
+ int ret; |
246 |
+ |
247 |
+@@ -811,6 +813,18 @@ _request_firmware(const struct firmware **firmware_p, const char *name, |
248 |
+ if (ret <= 0) /* error or already assigned */ |
249 |
+ goto out; |
250 |
+ |
251 |
++ /* |
252 |
++ * We are about to try to access the firmware file. Because we may have been |
253 |
++ * called by a driver when serving an unrelated request from userland, we use |
254 |
++ * the kernel credentials to read the file. |
255 |
++ */ |
256 |
++ kern_cred = prepare_kernel_cred(NULL); |
257 |
++ if (!kern_cred) { |
258 |
++ ret = -ENOMEM; |
259 |
++ goto out; |
260 |
++ } |
261 |
++ old_cred = override_creds(kern_cred); |
262 |
++ |
263 |
+ ret = fw_get_filesystem_firmware(device, fw->priv, "", NULL); |
264 |
+ |
265 |
+ /* Only full reads can support decompression, platform, and sysfs. */ |
266 |
+@@ -836,6 +850,9 @@ _request_firmware(const struct firmware **firmware_p, const char *name, |
267 |
+ } else |
268 |
+ ret = assign_fw(fw, device); |
269 |
+ |
270 |
++ revert_creds(old_cred); |
271 |
++ put_cred(kern_cred); |
272 |
++ |
273 |
+ out: |
274 |
+ if (ret < 0) { |
275 |
+ fw_abort_batch_reqs(fw); |
276 |
+diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c |
277 |
+index 61e20ae7b08b7..a1f09437b2b41 100644 |
278 |
+--- a/drivers/dma-buf/dma-buf.c |
279 |
++++ b/drivers/dma-buf/dma-buf.c |
280 |
+@@ -572,10 +572,6 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info) |
281 |
+ file->f_mode |= FMODE_LSEEK; |
282 |
+ dmabuf->file = file; |
283 |
+ |
284 |
+- ret = dma_buf_stats_setup(dmabuf); |
285 |
+- if (ret) |
286 |
+- goto err_sysfs; |
287 |
+- |
288 |
+ mutex_init(&dmabuf->lock); |
289 |
+ INIT_LIST_HEAD(&dmabuf->attachments); |
290 |
+ |
291 |
+@@ -583,6 +579,10 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info) |
292 |
+ list_add(&dmabuf->list_node, &db_list.head); |
293 |
+ mutex_unlock(&db_list.lock); |
294 |
+ |
295 |
++ ret = dma_buf_stats_setup(dmabuf); |
296 |
++ if (ret) |
297 |
++ goto err_sysfs; |
298 |
++ |
299 |
+ return dmabuf; |
300 |
+ |
301 |
+ err_sysfs: |
302 |
+diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c |
303 |
+index 8acdb244b99f7..952a8aa69b9ee 100644 |
304 |
+--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c |
305 |
++++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c |
306 |
+@@ -1386,14 +1386,8 @@ static int smu_disable_dpms(struct smu_context *smu) |
307 |
+ { |
308 |
+ struct amdgpu_device *adev = smu->adev; |
309 |
+ int ret = 0; |
310 |
+- /* |
311 |
+- * TODO: (adev->in_suspend && !adev->in_s0ix) is added to pair |
312 |
+- * the workaround which always reset the asic in suspend. |
313 |
+- * It's likely that workaround will be dropped in the future. |
314 |
+- * Then the change here should be dropped together. |
315 |
+- */ |
316 |
+ bool use_baco = !smu->is_apu && |
317 |
+- (((amdgpu_in_reset(adev) || (adev->in_suspend && !adev->in_s0ix)) && |
318 |
++ ((amdgpu_in_reset(adev) && |
319 |
+ (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)) || |
320 |
+ ((adev->in_runpm || adev->in_s4) && amdgpu_asic_supports_baco(adev))); |
321 |
+ |
322 |
+diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c |
323 |
+index 12965a832f94a..aa8ed08fe9a7c 100644 |
324 |
+--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c |
325 |
++++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c |
326 |
+@@ -46,8 +46,9 @@ static bool |
327 |
+ nouveau_get_backlight_name(char backlight_name[BL_NAME_SIZE], |
328 |
+ struct nouveau_backlight *bl) |
329 |
+ { |
330 |
+- const int nb = ida_simple_get(&bl_ida, 0, 0, GFP_KERNEL); |
331 |
+- if (nb < 0 || nb >= 100) |
332 |
++ const int nb = ida_alloc_max(&bl_ida, 99, GFP_KERNEL); |
333 |
++ |
334 |
++ if (nb < 0) |
335 |
+ return false; |
336 |
+ if (nb > 0) |
337 |
+ snprintf(backlight_name, BL_NAME_SIZE, "nv_backlight%d", nb); |
338 |
+@@ -411,7 +412,7 @@ nouveau_backlight_init(struct drm_connector *connector) |
339 |
+ nv_encoder, ops, &props); |
340 |
+ if (IS_ERR(bl->dev)) { |
341 |
+ if (bl->id >= 0) |
342 |
+- ida_simple_remove(&bl_ida, bl->id); |
343 |
++ ida_free(&bl_ida, bl->id); |
344 |
+ ret = PTR_ERR(bl->dev); |
345 |
+ goto fail_alloc; |
346 |
+ } |
347 |
+@@ -439,7 +440,7 @@ nouveau_backlight_fini(struct drm_connector *connector) |
348 |
+ return; |
349 |
+ |
350 |
+ if (bl->id >= 0) |
351 |
+- ida_simple_remove(&bl_ida, bl->id); |
352 |
++ ida_free(&bl_ida, bl->id); |
353 |
+ |
354 |
+ backlight_device_unregister(bl->dev); |
355 |
+ nv_conn->backlight = NULL; |
356 |
+diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c |
357 |
+index d0d52c1d4aee0..950a3de3e1166 100644 |
358 |
+--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c |
359 |
++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c |
360 |
+@@ -123,7 +123,7 @@ nvkm_device_tegra_probe_iommu(struct nvkm_device_tegra *tdev) |
361 |
+ |
362 |
+ mutex_init(&tdev->iommu.mutex); |
363 |
+ |
364 |
+- if (iommu_present(&platform_bus_type)) { |
365 |
++ if (device_iommu_mapped(dev)) { |
366 |
+ tdev->iommu.domain = iommu_domain_alloc(&platform_bus_type); |
367 |
+ if (!tdev->iommu.domain) |
368 |
+ goto error; |
369 |
+diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c |
370 |
+index 07887cbfd9cb6..ef7bea7c43a0f 100644 |
371 |
+--- a/drivers/gpu/drm/vc4/vc4_hdmi.c |
372 |
++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c |
373 |
+@@ -38,6 +38,7 @@ |
374 |
+ #include <drm/drm_scdc_helper.h> |
375 |
+ #include <linux/clk.h> |
376 |
+ #include <linux/component.h> |
377 |
++#include <linux/gpio/consumer.h> |
378 |
+ #include <linux/i2c.h> |
379 |
+ #include <linux/of_address.h> |
380 |
+ #include <linux/of_gpio.h> |
381 |
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c b/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c |
382 |
+index a3bfbb6c3e14a..162dfeb1cc5ad 100644 |
383 |
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c |
384 |
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c |
385 |
+@@ -528,7 +528,7 @@ int vmw_cmd_send_fence(struct vmw_private *dev_priv, uint32_t *seqno) |
386 |
+ *seqno = atomic_add_return(1, &dev_priv->marker_seq); |
387 |
+ } while (*seqno == 0); |
388 |
+ |
389 |
+- if (!(vmw_fifo_caps(dev_priv) & SVGA_FIFO_CAP_FENCE)) { |
390 |
++ if (!vmw_has_fences(dev_priv)) { |
391 |
+ |
392 |
+ /* |
393 |
+ * Don't request hardware to send a fence. The |
394 |
+@@ -675,11 +675,14 @@ int vmw_cmd_emit_dummy_query(struct vmw_private *dev_priv, |
395 |
+ */ |
396 |
+ bool vmw_cmd_supported(struct vmw_private *vmw) |
397 |
+ { |
398 |
+- if ((vmw->capabilities & (SVGA_CAP_COMMAND_BUFFERS | |
399 |
+- SVGA_CAP_CMD_BUFFERS_2)) != 0) |
400 |
+- return true; |
401 |
++ bool has_cmdbufs = |
402 |
++ (vmw->capabilities & (SVGA_CAP_COMMAND_BUFFERS | |
403 |
++ SVGA_CAP_CMD_BUFFERS_2)) != 0; |
404 |
++ if (vmw_is_svga_v3(vmw)) |
405 |
++ return (has_cmdbufs && |
406 |
++ (vmw->capabilities & SVGA_CAP_GBOBJECTS) != 0); |
407 |
+ /* |
408 |
+ * We have FIFO cmd's |
409 |
+ */ |
410 |
+- return vmw->fifo_mem != NULL; |
411 |
++ return has_cmdbufs || vmw->fifo_mem != NULL; |
412 |
+ } |
413 |
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |
414 |
+index f9f28516ffb41..288e883177bea 100644 |
415 |
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |
416 |
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h |
417 |
+@@ -1677,4 +1677,12 @@ static inline void vmw_irq_status_write(struct vmw_private *vmw, |
418 |
+ outl(status, vmw->io_start + SVGA_IRQSTATUS_PORT); |
419 |
+ } |
420 |
+ |
421 |
++static inline bool vmw_has_fences(struct vmw_private *vmw) |
422 |
++{ |
423 |
++ if ((vmw->capabilities & (SVGA_CAP_COMMAND_BUFFERS | |
424 |
++ SVGA_CAP_CMD_BUFFERS_2)) != 0) |
425 |
++ return true; |
426 |
++ return (vmw_fifo_caps(vmw) & SVGA_FIFO_CAP_FENCE) != 0; |
427 |
++} |
428 |
++ |
429 |
+ #endif |
430 |
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
431 |
+index d18c6a56e3dca..f18ed03a8b2d6 100644 |
432 |
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
433 |
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c |
434 |
+@@ -490,7 +490,7 @@ static int vmw_fb_kms_detach(struct vmw_fb_par *par, |
435 |
+ |
436 |
+ static int vmw_fb_kms_framebuffer(struct fb_info *info) |
437 |
+ { |
438 |
+- struct drm_mode_fb_cmd2 mode_cmd; |
439 |
++ struct drm_mode_fb_cmd2 mode_cmd = {0}; |
440 |
+ struct vmw_fb_par *par = info->par; |
441 |
+ struct fb_var_screeninfo *var = &info->var; |
442 |
+ struct drm_framebuffer *cur_fb; |
443 |
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c |
444 |
+index b4d9d7258a546..b32ddbb992de2 100644 |
445 |
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c |
446 |
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c |
447 |
+@@ -85,6 +85,22 @@ fman_from_fence(struct vmw_fence_obj *fence) |
448 |
+ return container_of(fence->base.lock, struct vmw_fence_manager, lock); |
449 |
+ } |
450 |
+ |
451 |
++static u32 vmw_fence_goal_read(struct vmw_private *vmw) |
452 |
++{ |
453 |
++ if ((vmw->capabilities2 & SVGA_CAP2_EXTRA_REGS) != 0) |
454 |
++ return vmw_read(vmw, SVGA_REG_FENCE_GOAL); |
455 |
++ else |
456 |
++ return vmw_fifo_mem_read(vmw, SVGA_FIFO_FENCE_GOAL); |
457 |
++} |
458 |
++ |
459 |
++static void vmw_fence_goal_write(struct vmw_private *vmw, u32 value) |
460 |
++{ |
461 |
++ if ((vmw->capabilities2 & SVGA_CAP2_EXTRA_REGS) != 0) |
462 |
++ vmw_write(vmw, SVGA_REG_FENCE_GOAL, value); |
463 |
++ else |
464 |
++ vmw_fifo_mem_write(vmw, SVGA_FIFO_FENCE_GOAL, value); |
465 |
++} |
466 |
++ |
467 |
+ /* |
468 |
+ * Note on fencing subsystem usage of irqs: |
469 |
+ * Typically the vmw_fences_update function is called |
470 |
+@@ -400,7 +416,7 @@ static bool vmw_fence_goal_new_locked(struct vmw_fence_manager *fman, |
471 |
+ if (likely(!fman->seqno_valid)) |
472 |
+ return false; |
473 |
+ |
474 |
+- goal_seqno = vmw_fifo_mem_read(fman->dev_priv, SVGA_FIFO_FENCE_GOAL); |
475 |
++ goal_seqno = vmw_fence_goal_read(fman->dev_priv); |
476 |
+ if (likely(passed_seqno - goal_seqno >= VMW_FENCE_WRAP)) |
477 |
+ return false; |
478 |
+ |
479 |
+@@ -408,9 +424,8 @@ static bool vmw_fence_goal_new_locked(struct vmw_fence_manager *fman, |
480 |
+ list_for_each_entry(fence, &fman->fence_list, head) { |
481 |
+ if (!list_empty(&fence->seq_passed_actions)) { |
482 |
+ fman->seqno_valid = true; |
483 |
+- vmw_fifo_mem_write(fman->dev_priv, |
484 |
+- SVGA_FIFO_FENCE_GOAL, |
485 |
+- fence->base.seqno); |
486 |
++ vmw_fence_goal_write(fman->dev_priv, |
487 |
++ fence->base.seqno); |
488 |
+ break; |
489 |
+ } |
490 |
+ } |
491 |
+@@ -442,13 +457,12 @@ static bool vmw_fence_goal_check_locked(struct vmw_fence_obj *fence) |
492 |
+ if (dma_fence_is_signaled_locked(&fence->base)) |
493 |
+ return false; |
494 |
+ |
495 |
+- goal_seqno = vmw_fifo_mem_read(fman->dev_priv, SVGA_FIFO_FENCE_GOAL); |
496 |
++ goal_seqno = vmw_fence_goal_read(fman->dev_priv); |
497 |
+ if (likely(fman->seqno_valid && |
498 |
+ goal_seqno - fence->base.seqno < VMW_FENCE_WRAP)) |
499 |
+ return false; |
500 |
+ |
501 |
+- vmw_fifo_mem_write(fman->dev_priv, SVGA_FIFO_FENCE_GOAL, |
502 |
+- fence->base.seqno); |
503 |
++ vmw_fence_goal_write(fman->dev_priv, fence->base.seqno); |
504 |
+ fman->seqno_valid = true; |
505 |
+ |
506 |
+ return true; |
507 |
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c |
508 |
+index c5191de365ca1..fe4732bf2c9d2 100644 |
509 |
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c |
510 |
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_irq.c |
511 |
+@@ -32,6 +32,14 @@ |
512 |
+ |
513 |
+ #define VMW_FENCE_WRAP (1 << 24) |
514 |
+ |
515 |
++static u32 vmw_irqflag_fence_goal(struct vmw_private *vmw) |
516 |
++{ |
517 |
++ if ((vmw->capabilities2 & SVGA_CAP2_EXTRA_REGS) != 0) |
518 |
++ return SVGA_IRQFLAG_REG_FENCE_GOAL; |
519 |
++ else |
520 |
++ return SVGA_IRQFLAG_FENCE_GOAL; |
521 |
++} |
522 |
++ |
523 |
+ /** |
524 |
+ * vmw_thread_fn - Deferred (process context) irq handler |
525 |
+ * |
526 |
+@@ -96,7 +104,7 @@ static irqreturn_t vmw_irq_handler(int irq, void *arg) |
527 |
+ wake_up_all(&dev_priv->fifo_queue); |
528 |
+ |
529 |
+ if ((masked_status & (SVGA_IRQFLAG_ANY_FENCE | |
530 |
+- SVGA_IRQFLAG_FENCE_GOAL)) && |
531 |
++ vmw_irqflag_fence_goal(dev_priv))) && |
532 |
+ !test_and_set_bit(VMW_IRQTHREAD_FENCE, dev_priv->irqthread_pending)) |
533 |
+ ret = IRQ_WAKE_THREAD; |
534 |
+ |
535 |
+@@ -137,8 +145,7 @@ bool vmw_seqno_passed(struct vmw_private *dev_priv, |
536 |
+ if (likely(dev_priv->last_read_seqno - seqno < VMW_FENCE_WRAP)) |
537 |
+ return true; |
538 |
+ |
539 |
+- if (!(vmw_fifo_caps(dev_priv) & SVGA_FIFO_CAP_FENCE) && |
540 |
+- vmw_fifo_idle(dev_priv, seqno)) |
541 |
++ if (!vmw_has_fences(dev_priv) && vmw_fifo_idle(dev_priv, seqno)) |
542 |
+ return true; |
543 |
+ |
544 |
+ /** |
545 |
+@@ -160,6 +167,7 @@ int vmw_fallback_wait(struct vmw_private *dev_priv, |
546 |
+ unsigned long timeout) |
547 |
+ { |
548 |
+ struct vmw_fifo_state *fifo_state = dev_priv->fifo; |
549 |
++ bool fifo_down = false; |
550 |
+ |
551 |
+ uint32_t count = 0; |
552 |
+ uint32_t signal_seq; |
553 |
+@@ -176,12 +184,14 @@ int vmw_fallback_wait(struct vmw_private *dev_priv, |
554 |
+ */ |
555 |
+ |
556 |
+ if (fifo_idle) { |
557 |
+- down_read(&fifo_state->rwsem); |
558 |
+ if (dev_priv->cman) { |
559 |
+ ret = vmw_cmdbuf_idle(dev_priv->cman, interruptible, |
560 |
+ 10*HZ); |
561 |
+ if (ret) |
562 |
+ goto out_err; |
563 |
++ } else if (fifo_state) { |
564 |
++ down_read(&fifo_state->rwsem); |
565 |
++ fifo_down = true; |
566 |
+ } |
567 |
+ } |
568 |
+ |
569 |
+@@ -218,12 +228,12 @@ int vmw_fallback_wait(struct vmw_private *dev_priv, |
570 |
+ } |
571 |
+ } |
572 |
+ finish_wait(&dev_priv->fence_queue, &__wait); |
573 |
+- if (ret == 0 && fifo_idle) |
574 |
++ if (ret == 0 && fifo_idle && fifo_state) |
575 |
+ vmw_fence_write(dev_priv, signal_seq); |
576 |
+ |
577 |
+ wake_up_all(&dev_priv->fence_queue); |
578 |
+ out_err: |
579 |
+- if (fifo_idle) |
580 |
++ if (fifo_down) |
581 |
+ up_read(&fifo_state->rwsem); |
582 |
+ |
583 |
+ return ret; |
584 |
+@@ -266,13 +276,13 @@ void vmw_seqno_waiter_remove(struct vmw_private *dev_priv) |
585 |
+ |
586 |
+ void vmw_goal_waiter_add(struct vmw_private *dev_priv) |
587 |
+ { |
588 |
+- vmw_generic_waiter_add(dev_priv, SVGA_IRQFLAG_FENCE_GOAL, |
589 |
++ vmw_generic_waiter_add(dev_priv, vmw_irqflag_fence_goal(dev_priv), |
590 |
+ &dev_priv->goal_queue_waiters); |
591 |
+ } |
592 |
+ |
593 |
+ void vmw_goal_waiter_remove(struct vmw_private *dev_priv) |
594 |
+ { |
595 |
+- vmw_generic_waiter_remove(dev_priv, SVGA_IRQFLAG_FENCE_GOAL, |
596 |
++ vmw_generic_waiter_remove(dev_priv, vmw_irqflag_fence_goal(dev_priv), |
597 |
+ &dev_priv->goal_queue_waiters); |
598 |
+ } |
599 |
+ |
600 |
+diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c |
601 |
+index 14e8f665b13be..50c64e7813be1 100644 |
602 |
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c |
603 |
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c |
604 |
+@@ -1336,7 +1336,6 @@ vmw_kms_new_framebuffer(struct vmw_private *dev_priv, |
605 |
+ ret = vmw_kms_new_framebuffer_surface(dev_priv, surface, &vfb, |
606 |
+ mode_cmd, |
607 |
+ is_bo_proxy); |
608 |
+- |
609 |
+ /* |
610 |
+ * vmw_create_bo_proxy() adds a reference that is no longer |
611 |
+ * needed |
612 |
+@@ -1398,13 +1397,16 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev, |
613 |
+ ret = vmw_user_lookup_handle(dev_priv, tfile, |
614 |
+ mode_cmd->handles[0], |
615 |
+ &surface, &bo); |
616 |
+- if (ret) |
617 |
++ if (ret) { |
618 |
++ DRM_ERROR("Invalid buffer object handle %u (0x%x).\n", |
619 |
++ mode_cmd->handles[0], mode_cmd->handles[0]); |
620 |
+ goto err_out; |
621 |
++ } |
622 |
+ |
623 |
+ |
624 |
+ if (!bo && |
625 |
+ !vmw_kms_srf_ok(dev_priv, mode_cmd->width, mode_cmd->height)) { |
626 |
+- DRM_ERROR("Surface size cannot exceed %dx%d", |
627 |
++ DRM_ERROR("Surface size cannot exceed %dx%d\n", |
628 |
+ dev_priv->texture_max_width, |
629 |
+ dev_priv->texture_max_height); |
630 |
+ goto err_out; |
631 |
+diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig |
632 |
+index ccdaeafed0bb7..51f1caa10d113 100644 |
633 |
+--- a/drivers/hwmon/Kconfig |
634 |
++++ b/drivers/hwmon/Kconfig |
635 |
+@@ -944,7 +944,7 @@ config SENSORS_LTC4261 |
636 |
+ |
637 |
+ config SENSORS_LTQ_CPUTEMP |
638 |
+ bool "Lantiq cpu temperature sensor driver" |
639 |
+- depends on LANTIQ |
640 |
++ depends on SOC_XWAY |
641 |
+ help |
642 |
+ If you say yes here you get support for the temperature |
643 |
+ sensor inside your CPU. |
644 |
+diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c |
645 |
+index 4dec793fd07d5..94b35723ee7ad 100644 |
646 |
+--- a/drivers/hwmon/f71882fg.c |
647 |
++++ b/drivers/hwmon/f71882fg.c |
648 |
+@@ -1577,8 +1577,9 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr, |
649 |
+ temp *= 125; |
650 |
+ if (sign) |
651 |
+ temp -= 128000; |
652 |
+- } else |
653 |
+- temp = data->temp[nr] * 1000; |
654 |
++ } else { |
655 |
++ temp = ((s8)data->temp[nr]) * 1000; |
656 |
++ } |
657 |
+ |
658 |
+ return sprintf(buf, "%d\n", temp); |
659 |
+ } |
660 |
+diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c |
661 |
+index 9dc210b55e69b..48466b0a4bb05 100644 |
662 |
+--- a/drivers/hwmon/tmp401.c |
663 |
++++ b/drivers/hwmon/tmp401.c |
664 |
+@@ -730,10 +730,21 @@ static int tmp401_probe(struct i2c_client *client) |
665 |
+ return 0; |
666 |
+ } |
667 |
+ |
668 |
++static const struct of_device_id __maybe_unused tmp4xx_of_match[] = { |
669 |
++ { .compatible = "ti,tmp401", }, |
670 |
++ { .compatible = "ti,tmp411", }, |
671 |
++ { .compatible = "ti,tmp431", }, |
672 |
++ { .compatible = "ti,tmp432", }, |
673 |
++ { .compatible = "ti,tmp435", }, |
674 |
++ { }, |
675 |
++}; |
676 |
++MODULE_DEVICE_TABLE(of, tmp4xx_of_match); |
677 |
++ |
678 |
+ static struct i2c_driver tmp401_driver = { |
679 |
+ .class = I2C_CLASS_HWMON, |
680 |
+ .driver = { |
681 |
+ .name = "tmp401", |
682 |
++ .of_match_table = of_match_ptr(tmp4xx_of_match), |
683 |
+ }, |
684 |
+ .probe_new = tmp401_probe, |
685 |
+ .id_table = tmp401_id, |
686 |
+diff --git a/drivers/infiniband/hw/irdma/cm.c b/drivers/infiniband/hw/irdma/cm.c |
687 |
+index 082a3ddb0fa3b..632f65e53b63f 100644 |
688 |
+--- a/drivers/infiniband/hw/irdma/cm.c |
689 |
++++ b/drivers/infiniband/hw/irdma/cm.c |
690 |
+@@ -3242,15 +3242,10 @@ enum irdma_status_code irdma_setup_cm_core(struct irdma_device *iwdev, |
691 |
+ */ |
692 |
+ void irdma_cleanup_cm_core(struct irdma_cm_core *cm_core) |
693 |
+ { |
694 |
+- unsigned long flags; |
695 |
+- |
696 |
+ if (!cm_core) |
697 |
+ return; |
698 |
+ |
699 |
+- spin_lock_irqsave(&cm_core->ht_lock, flags); |
700 |
+- if (timer_pending(&cm_core->tcp_timer)) |
701 |
+- del_timer_sync(&cm_core->tcp_timer); |
702 |
+- spin_unlock_irqrestore(&cm_core->ht_lock, flags); |
703 |
++ del_timer_sync(&cm_core->tcp_timer); |
704 |
+ |
705 |
+ destroy_workqueue(cm_core->event_wq); |
706 |
+ cm_core->dev->ws_reset(&cm_core->iwdev->vsi); |
707 |
+diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c |
708 |
+index 9050ca1f4285c..808f6e7a80482 100644 |
709 |
+--- a/drivers/interconnect/core.c |
710 |
++++ b/drivers/interconnect/core.c |
711 |
+@@ -1087,9 +1087,15 @@ static int of_count_icc_providers(struct device_node *np) |
712 |
+ { |
713 |
+ struct device_node *child; |
714 |
+ int count = 0; |
715 |
++ const struct of_device_id __maybe_unused ignore_list[] = { |
716 |
++ { .compatible = "qcom,sc7180-ipa-virt" }, |
717 |
++ { .compatible = "qcom,sdx55-ipa-virt" }, |
718 |
++ {} |
719 |
++ }; |
720 |
+ |
721 |
+ for_each_available_child_of_node(np, child) { |
722 |
+- if (of_property_read_bool(child, "#interconnect-cells")) |
723 |
++ if (of_property_read_bool(child, "#interconnect-cells") && |
724 |
++ likely(!of_match_node(ignore_list, child))) |
725 |
+ count++; |
726 |
+ count += of_count_icc_providers(child); |
727 |
+ } |
728 |
+diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-nvidia.c b/drivers/iommu/arm/arm-smmu/arm-smmu-nvidia.c |
729 |
+index 01e9b50b10a18..87bf522b9d2ee 100644 |
730 |
+--- a/drivers/iommu/arm/arm-smmu/arm-smmu-nvidia.c |
731 |
++++ b/drivers/iommu/arm/arm-smmu/arm-smmu-nvidia.c |
732 |
+@@ -258,6 +258,34 @@ static void nvidia_smmu_probe_finalize(struct arm_smmu_device *smmu, struct devi |
733 |
+ dev_name(dev), err); |
734 |
+ } |
735 |
+ |
736 |
++static int nvidia_smmu_init_context(struct arm_smmu_domain *smmu_domain, |
737 |
++ struct io_pgtable_cfg *pgtbl_cfg, |
738 |
++ struct device *dev) |
739 |
++{ |
740 |
++ struct arm_smmu_device *smmu = smmu_domain->smmu; |
741 |
++ const struct device_node *np = smmu->dev->of_node; |
742 |
++ |
743 |
++ /* |
744 |
++ * Tegra194 and Tegra234 SoCs have the erratum that causes walk cache |
745 |
++ * entries to not be invalidated correctly. The problem is that the walk |
746 |
++ * cache index generated for IOVA is not same across translation and |
747 |
++ * invalidation requests. This is leading to page faults when PMD entry |
748 |
++ * is released during unmap and populated with new PTE table during |
749 |
++ * subsequent map request. Disabling large page mappings avoids the |
750 |
++ * release of PMD entry and avoid translations seeing stale PMD entry in |
751 |
++ * walk cache. |
752 |
++ * Fix this by limiting the page mappings to PAGE_SIZE on Tegra194 and |
753 |
++ * Tegra234. |
754 |
++ */ |
755 |
++ if (of_device_is_compatible(np, "nvidia,tegra234-smmu") || |
756 |
++ of_device_is_compatible(np, "nvidia,tegra194-smmu")) { |
757 |
++ smmu->pgsize_bitmap = PAGE_SIZE; |
758 |
++ pgtbl_cfg->pgsize_bitmap = smmu->pgsize_bitmap; |
759 |
++ } |
760 |
++ |
761 |
++ return 0; |
762 |
++} |
763 |
++ |
764 |
+ static const struct arm_smmu_impl nvidia_smmu_impl = { |
765 |
+ .read_reg = nvidia_smmu_read_reg, |
766 |
+ .write_reg = nvidia_smmu_write_reg, |
767 |
+@@ -268,10 +296,12 @@ static const struct arm_smmu_impl nvidia_smmu_impl = { |
768 |
+ .global_fault = nvidia_smmu_global_fault, |
769 |
+ .context_fault = nvidia_smmu_context_fault, |
770 |
+ .probe_finalize = nvidia_smmu_probe_finalize, |
771 |
++ .init_context = nvidia_smmu_init_context, |
772 |
+ }; |
773 |
+ |
774 |
+ static const struct arm_smmu_impl nvidia_smmu_single_impl = { |
775 |
+ .probe_finalize = nvidia_smmu_probe_finalize, |
776 |
++ .init_context = nvidia_smmu_init_context, |
777 |
+ }; |
778 |
+ |
779 |
+ struct arm_smmu_device *nvidia_smmu_impl_init(struct arm_smmu_device *smmu) |
780 |
+diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c |
781 |
+index 2e314e3021d8b..b3a43a3d90e49 100644 |
782 |
+--- a/drivers/net/dsa/bcm_sf2.c |
783 |
++++ b/drivers/net/dsa/bcm_sf2.c |
784 |
+@@ -796,6 +796,9 @@ static void bcm_sf2_sw_mac_link_down(struct dsa_switch *ds, int port, |
785 |
+ struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); |
786 |
+ u32 reg, offset; |
787 |
+ |
788 |
++ if (priv->wol_ports_mask & BIT(port)) |
789 |
++ return; |
790 |
++ |
791 |
+ if (port != core_readl(priv, CORE_IMP0_PRT_ID)) { |
792 |
+ if (priv->type == BCM4908_DEVICE_ID || |
793 |
+ priv->type == BCM7445_DEVICE_ID) |
794 |
+diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c |
795 |
+index 3a529ee8c8340..831833911a525 100644 |
796 |
+--- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c |
797 |
++++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c |
798 |
+@@ -449,7 +449,7 @@ static int aq_pm_freeze(struct device *dev) |
799 |
+ |
800 |
+ static int aq_pm_suspend_poweroff(struct device *dev) |
801 |
+ { |
802 |
+- return aq_suspend_common(dev, false); |
803 |
++ return aq_suspend_common(dev, true); |
804 |
+ } |
805 |
+ |
806 |
+ static int aq_pm_thaw(struct device *dev) |
807 |
+@@ -459,7 +459,7 @@ static int aq_pm_thaw(struct device *dev) |
808 |
+ |
809 |
+ static int aq_pm_resume_restore(struct device *dev) |
810 |
+ { |
811 |
+- return atl_resume_common(dev, false); |
812 |
++ return atl_resume_common(dev, true); |
813 |
+ } |
814 |
+ |
815 |
+ static const struct dev_pm_ops aq_pm_ops = { |
816 |
+diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
817 |
+index 8bcc39b1575c2..ea13917537526 100644 |
818 |
+--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
819 |
++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
820 |
+@@ -3950,6 +3950,10 @@ static int bcmgenet_probe(struct platform_device *pdev) |
821 |
+ goto err; |
822 |
+ } |
823 |
+ priv->wol_irq = platform_get_irq_optional(pdev, 2); |
824 |
++ if (priv->wol_irq == -EPROBE_DEFER) { |
825 |
++ err = priv->wol_irq; |
826 |
++ goto err; |
827 |
++ } |
828 |
+ |
829 |
+ priv->base = devm_platform_ioremap_resource(pdev, 0); |
830 |
+ if (IS_ERR(priv->base)) { |
831 |
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c |
832 |
+index 64144b6171d72..b1c9f65ab10f6 100644 |
833 |
+--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c |
834 |
++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c |
835 |
+@@ -2793,14 +2793,14 @@ int t4_get_raw_vpd_params(struct adapter *adapter, struct vpd_params *p) |
836 |
+ goto out; |
837 |
+ na = ret; |
838 |
+ |
839 |
+- memcpy(p->id, vpd + id, min_t(int, id_len, ID_LEN)); |
840 |
++ memcpy(p->id, vpd + id, min_t(unsigned int, id_len, ID_LEN)); |
841 |
+ strim(p->id); |
842 |
+- memcpy(p->sn, vpd + sn, min_t(int, sn_len, SERNUM_LEN)); |
843 |
++ memcpy(p->sn, vpd + sn, min_t(unsigned int, sn_len, SERNUM_LEN)); |
844 |
+ strim(p->sn); |
845 |
+- memcpy(p->pn, vpd + pn, min_t(int, pn_len, PN_LEN)); |
846 |
++ memcpy(p->pn, vpd + pn, min_t(unsigned int, pn_len, PN_LEN)); |
847 |
+ strim(p->pn); |
848 |
+- memcpy(p->na, vpd + na, min_t(int, na_len, MACADDR_LEN)); |
849 |
+- strim((char *)p->na); |
850 |
++ memcpy(p->na, vpd + na, min_t(unsigned int, na_len, MACADDR_LEN)); |
851 |
++ strim(p->na); |
852 |
+ |
853 |
+ out: |
854 |
+ vfree(vpd); |
855 |
+diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c |
856 |
+index ad73dd2540e71..29387f0814e9b 100644 |
857 |
+--- a/drivers/net/ethernet/intel/i40e/i40e_main.c |
858 |
++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c |
859 |
+@@ -7535,42 +7535,43 @@ static void i40e_free_macvlan_channels(struct i40e_vsi *vsi) |
860 |
+ static int i40e_fwd_ring_up(struct i40e_vsi *vsi, struct net_device *vdev, |
861 |
+ struct i40e_fwd_adapter *fwd) |
862 |
+ { |
863 |
++ struct i40e_channel *ch = NULL, *ch_tmp, *iter; |
864 |
+ int ret = 0, num_tc = 1, i, aq_err; |
865 |
+- struct i40e_channel *ch, *ch_tmp; |
866 |
+ struct i40e_pf *pf = vsi->back; |
867 |
+ struct i40e_hw *hw = &pf->hw; |
868 |
+ |
869 |
+- if (list_empty(&vsi->macvlan_list)) |
870 |
+- return -EINVAL; |
871 |
+- |
872 |
+ /* Go through the list and find an available channel */ |
873 |
+- list_for_each_entry_safe(ch, ch_tmp, &vsi->macvlan_list, list) { |
874 |
+- if (!i40e_is_channel_macvlan(ch)) { |
875 |
+- ch->fwd = fwd; |
876 |
++ list_for_each_entry_safe(iter, ch_tmp, &vsi->macvlan_list, list) { |
877 |
++ if (!i40e_is_channel_macvlan(iter)) { |
878 |
++ iter->fwd = fwd; |
879 |
+ /* record configuration for macvlan interface in vdev */ |
880 |
+ for (i = 0; i < num_tc; i++) |
881 |
+ netdev_bind_sb_channel_queue(vsi->netdev, vdev, |
882 |
+ i, |
883 |
+- ch->num_queue_pairs, |
884 |
+- ch->base_queue); |
885 |
+- for (i = 0; i < ch->num_queue_pairs; i++) { |
886 |
++ iter->num_queue_pairs, |
887 |
++ iter->base_queue); |
888 |
++ for (i = 0; i < iter->num_queue_pairs; i++) { |
889 |
+ struct i40e_ring *tx_ring, *rx_ring; |
890 |
+ u16 pf_q; |
891 |
+ |
892 |
+- pf_q = ch->base_queue + i; |
893 |
++ pf_q = iter->base_queue + i; |
894 |
+ |
895 |
+ /* Get to TX ring ptr */ |
896 |
+ tx_ring = vsi->tx_rings[pf_q]; |
897 |
+- tx_ring->ch = ch; |
898 |
++ tx_ring->ch = iter; |
899 |
+ |
900 |
+ /* Get the RX ring ptr */ |
901 |
+ rx_ring = vsi->rx_rings[pf_q]; |
902 |
+- rx_ring->ch = ch; |
903 |
++ rx_ring->ch = iter; |
904 |
+ } |
905 |
++ ch = iter; |
906 |
+ break; |
907 |
+ } |
908 |
+ } |
909 |
+ |
910 |
++ if (!ch) |
911 |
++ return -EINVAL; |
912 |
++ |
913 |
+ /* Guarantee all rings are updated before we update the |
914 |
+ * MAC address filter. |
915 |
+ */ |
916 |
+diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h |
917 |
+index df65bb494695c..89bca2ed895a0 100644 |
918 |
+--- a/drivers/net/ethernet/intel/ice/ice.h |
919 |
++++ b/drivers/net/ethernet/intel/ice/ice.h |
920 |
+@@ -452,6 +452,7 @@ struct ice_pf { |
921 |
+ struct mutex avail_q_mutex; /* protects access to avail_[rx|tx]qs */ |
922 |
+ struct mutex sw_mutex; /* lock for protecting VSI alloc flow */ |
923 |
+ struct mutex tc_mutex; /* lock to protect TC changes */ |
924 |
++ struct mutex adev_mutex; /* lock to protect aux device access */ |
925 |
+ u32 msg_enable; |
926 |
+ struct ice_ptp ptp; |
927 |
+ u16 num_rdma_msix; /* Total MSIX vectors for RDMA driver */ |
928 |
+diff --git a/drivers/net/ethernet/intel/ice/ice_idc.c b/drivers/net/ethernet/intel/ice/ice_idc.c |
929 |
+index a2714988dd96f..1dd3622991c65 100644 |
930 |
+--- a/drivers/net/ethernet/intel/ice/ice_idc.c |
931 |
++++ b/drivers/net/ethernet/intel/ice/ice_idc.c |
932 |
+@@ -37,14 +37,17 @@ void ice_send_event_to_aux(struct ice_pf *pf, struct iidc_event *event) |
933 |
+ if (WARN_ON_ONCE(!in_task())) |
934 |
+ return; |
935 |
+ |
936 |
++ mutex_lock(&pf->adev_mutex); |
937 |
+ if (!pf->adev) |
938 |
+- return; |
939 |
++ goto finish; |
940 |
+ |
941 |
+ device_lock(&pf->adev->dev); |
942 |
+ iadrv = ice_get_auxiliary_drv(pf); |
943 |
+ if (iadrv && iadrv->event_handler) |
944 |
+ iadrv->event_handler(pf, event); |
945 |
+ device_unlock(&pf->adev->dev); |
946 |
++finish: |
947 |
++ mutex_unlock(&pf->adev_mutex); |
948 |
+ } |
949 |
+ |
950 |
+ /** |
951 |
+@@ -285,7 +288,6 @@ int ice_plug_aux_dev(struct ice_pf *pf) |
952 |
+ return -ENOMEM; |
953 |
+ |
954 |
+ adev = &iadev->adev; |
955 |
+- pf->adev = adev; |
956 |
+ iadev->pf = pf; |
957 |
+ |
958 |
+ adev->id = pf->aux_idx; |
959 |
+@@ -295,18 +297,20 @@ int ice_plug_aux_dev(struct ice_pf *pf) |
960 |
+ |
961 |
+ ret = auxiliary_device_init(adev); |
962 |
+ if (ret) { |
963 |
+- pf->adev = NULL; |
964 |
+ kfree(iadev); |
965 |
+ return ret; |
966 |
+ } |
967 |
+ |
968 |
+ ret = auxiliary_device_add(adev); |
969 |
+ if (ret) { |
970 |
+- pf->adev = NULL; |
971 |
+ auxiliary_device_uninit(adev); |
972 |
+ return ret; |
973 |
+ } |
974 |
+ |
975 |
++ mutex_lock(&pf->adev_mutex); |
976 |
++ pf->adev = adev; |
977 |
++ mutex_unlock(&pf->adev_mutex); |
978 |
++ |
979 |
+ return 0; |
980 |
+ } |
981 |
+ |
982 |
+@@ -315,12 +319,17 @@ int ice_plug_aux_dev(struct ice_pf *pf) |
983 |
+ */ |
984 |
+ void ice_unplug_aux_dev(struct ice_pf *pf) |
985 |
+ { |
986 |
+- if (!pf->adev) |
987 |
+- return; |
988 |
++ struct auxiliary_device *adev; |
989 |
+ |
990 |
+- auxiliary_device_delete(pf->adev); |
991 |
+- auxiliary_device_uninit(pf->adev); |
992 |
++ mutex_lock(&pf->adev_mutex); |
993 |
++ adev = pf->adev; |
994 |
+ pf->adev = NULL; |
995 |
++ mutex_unlock(&pf->adev_mutex); |
996 |
++ |
997 |
++ if (adev) { |
998 |
++ auxiliary_device_delete(adev); |
999 |
++ auxiliary_device_uninit(adev); |
1000 |
++ } |
1001 |
+ } |
1002 |
+ |
1003 |
+ /** |
1004 |
+diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c |
1005 |
+index f330bd0acf9f2..27b5c75ce3868 100644 |
1006 |
+--- a/drivers/net/ethernet/intel/ice/ice_main.c |
1007 |
++++ b/drivers/net/ethernet/intel/ice/ice_main.c |
1008 |
+@@ -3447,6 +3447,7 @@ u16 ice_get_avail_rxq_count(struct ice_pf *pf) |
1009 |
+ static void ice_deinit_pf(struct ice_pf *pf) |
1010 |
+ { |
1011 |
+ ice_service_task_stop(pf); |
1012 |
++ mutex_destroy(&pf->adev_mutex); |
1013 |
+ mutex_destroy(&pf->sw_mutex); |
1014 |
+ mutex_destroy(&pf->tc_mutex); |
1015 |
+ mutex_destroy(&pf->avail_q_mutex); |
1016 |
+@@ -3527,6 +3528,7 @@ static int ice_init_pf(struct ice_pf *pf) |
1017 |
+ |
1018 |
+ mutex_init(&pf->sw_mutex); |
1019 |
+ mutex_init(&pf->tc_mutex); |
1020 |
++ mutex_init(&pf->adev_mutex); |
1021 |
+ |
1022 |
+ INIT_HLIST_HEAD(&pf->aq_wait_list); |
1023 |
+ spin_lock_init(&pf->aq_wait_lock); |
1024 |
+diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c |
1025 |
+index eb91936825795..ef26ff351b57e 100644 |
1026 |
+--- a/drivers/net/ethernet/intel/ice/ice_ptp.c |
1027 |
++++ b/drivers/net/ethernet/intel/ice/ice_ptp.c |
1028 |
+@@ -1375,6 +1375,7 @@ ice_ptp_init_tx_e810(struct ice_pf *pf, struct ice_ptp_tx *tx) |
1029 |
+ |
1030 |
+ /** |
1031 |
+ * ice_ptp_tx_tstamp_cleanup - Cleanup old timestamp requests that got dropped |
1032 |
++ * @hw: pointer to the hw struct |
1033 |
+ * @tx: PTP Tx tracker to clean up |
1034 |
+ * |
1035 |
+ * Loop through the Tx timestamp requests and see if any of them have been |
1036 |
+@@ -1383,7 +1384,7 @@ ice_ptp_init_tx_e810(struct ice_pf *pf, struct ice_ptp_tx *tx) |
1037 |
+ * timestamp will never be captured. This might happen if the packet gets |
1038 |
+ * discarded before it reaches the PHY timestamping block. |
1039 |
+ */ |
1040 |
+-static void ice_ptp_tx_tstamp_cleanup(struct ice_ptp_tx *tx) |
1041 |
++static void ice_ptp_tx_tstamp_cleanup(struct ice_hw *hw, struct ice_ptp_tx *tx) |
1042 |
+ { |
1043 |
+ u8 idx; |
1044 |
+ |
1045 |
+@@ -1392,11 +1393,16 @@ static void ice_ptp_tx_tstamp_cleanup(struct ice_ptp_tx *tx) |
1046 |
+ |
1047 |
+ for_each_set_bit(idx, tx->in_use, tx->len) { |
1048 |
+ struct sk_buff *skb; |
1049 |
++ u64 raw_tstamp; |
1050 |
+ |
1051 |
+ /* Check if this SKB has been waiting for too long */ |
1052 |
+ if (time_is_after_jiffies(tx->tstamps[idx].start + 2 * HZ)) |
1053 |
+ continue; |
1054 |
+ |
1055 |
++ /* Read tstamp to be able to use this register again */ |
1056 |
++ ice_read_phy_tstamp(hw, tx->quad, idx + tx->quad_offset, |
1057 |
++ &raw_tstamp); |
1058 |
++ |
1059 |
+ spin_lock(&tx->lock); |
1060 |
+ skb = tx->tstamps[idx].skb; |
1061 |
+ tx->tstamps[idx].skb = NULL; |
1062 |
+@@ -1418,7 +1424,7 @@ static void ice_ptp_periodic_work(struct kthread_work *work) |
1063 |
+ |
1064 |
+ ice_ptp_update_cached_phctime(pf); |
1065 |
+ |
1066 |
+- ice_ptp_tx_tstamp_cleanup(&pf->ptp.port.tx); |
1067 |
++ ice_ptp_tx_tstamp_cleanup(&pf->hw, &pf->ptp.port.tx); |
1068 |
+ |
1069 |
+ /* Run twice a second */ |
1070 |
+ kthread_queue_delayed_work(ptp->kworker, &ptp->work, |
1071 |
+diff --git a/drivers/net/ethernet/mediatek/mtk_ppe.c b/drivers/net/ethernet/mediatek/mtk_ppe.c |
1072 |
+index 3ad10c793308e..66298e2235c91 100644 |
1073 |
+--- a/drivers/net/ethernet/mediatek/mtk_ppe.c |
1074 |
++++ b/drivers/net/ethernet/mediatek/mtk_ppe.c |
1075 |
+@@ -395,7 +395,7 @@ static void mtk_ppe_init_foe_table(struct mtk_ppe *ppe) |
1076 |
+ static const u8 skip[] = { 12, 25, 38, 51, 76, 89, 102 }; |
1077 |
+ int i, k; |
1078 |
+ |
1079 |
+- memset(ppe->foe_table, 0, MTK_PPE_ENTRIES * sizeof(ppe->foe_table)); |
1080 |
++ memset(ppe->foe_table, 0, MTK_PPE_ENTRIES * sizeof(*ppe->foe_table)); |
1081 |
+ |
1082 |
+ if (!IS_ENABLED(CONFIG_SOC_MT7621)) |
1083 |
+ return; |
1084 |
+diff --git a/drivers/net/ethernet/mscc/ocelot_flower.c b/drivers/net/ethernet/mscc/ocelot_flower.c |
1085 |
+index f1323af99b0c0..a3a5ad5dbb0e0 100644 |
1086 |
+--- a/drivers/net/ethernet/mscc/ocelot_flower.c |
1087 |
++++ b/drivers/net/ethernet/mscc/ocelot_flower.c |
1088 |
+@@ -206,9 +206,10 @@ static int ocelot_flower_parse_action(struct ocelot *ocelot, int port, |
1089 |
+ filter->type = OCELOT_VCAP_FILTER_OFFLOAD; |
1090 |
+ break; |
1091 |
+ case FLOW_ACTION_TRAP: |
1092 |
+- if (filter->block_id != VCAP_IS2) { |
1093 |
++ if (filter->block_id != VCAP_IS2 || |
1094 |
++ filter->lookup != 0) { |
1095 |
+ NL_SET_ERR_MSG_MOD(extack, |
1096 |
+- "Trap action can only be offloaded to VCAP IS2"); |
1097 |
++ "Trap action can only be offloaded to VCAP IS2 lookup 0"); |
1098 |
+ return -EOPNOTSUPP; |
1099 |
+ } |
1100 |
+ if (filter->goto_target != -1) { |
1101 |
+diff --git a/drivers/net/ethernet/mscc/ocelot_vcap.c b/drivers/net/ethernet/mscc/ocelot_vcap.c |
1102 |
+index 99d7376a70a74..732a4ef22518d 100644 |
1103 |
+--- a/drivers/net/ethernet/mscc/ocelot_vcap.c |
1104 |
++++ b/drivers/net/ethernet/mscc/ocelot_vcap.c |
1105 |
+@@ -373,7 +373,6 @@ static void is2_entry_set(struct ocelot *ocelot, int ix, |
1106 |
+ OCELOT_VCAP_BIT_0); |
1107 |
+ vcap_key_set(vcap, &data, VCAP_IS2_HK_IGR_PORT_MASK, 0, |
1108 |
+ ~filter->ingress_port_mask); |
1109 |
+- vcap_key_bit_set(vcap, &data, VCAP_IS2_HK_FIRST, OCELOT_VCAP_BIT_ANY); |
1110 |
+ vcap_key_bit_set(vcap, &data, VCAP_IS2_HK_HOST_MATCH, |
1111 |
+ OCELOT_VCAP_BIT_ANY); |
1112 |
+ vcap_key_bit_set(vcap, &data, VCAP_IS2_HK_L2_MC, filter->dmac_mc); |
1113 |
+@@ -1153,6 +1152,8 @@ int ocelot_vcap_filter_add(struct ocelot *ocelot, |
1114 |
+ struct ocelot_vcap_filter *tmp; |
1115 |
+ |
1116 |
+ tmp = ocelot_vcap_block_find_filter_by_index(block, i); |
1117 |
++ /* Read back the filter's counters before moving it */ |
1118 |
++ vcap_entry_get(ocelot, i - 1, tmp); |
1119 |
+ vcap_entry_set(ocelot, i, tmp); |
1120 |
+ } |
1121 |
+ |
1122 |
+@@ -1192,7 +1193,11 @@ int ocelot_vcap_filter_del(struct ocelot *ocelot, |
1123 |
+ struct ocelot_vcap_filter del_filter; |
1124 |
+ int i, index; |
1125 |
+ |
1126 |
++ /* Need to inherit the block_id so that vcap_entry_set() |
1127 |
++ * does not get confused and knows where to install it. |
1128 |
++ */ |
1129 |
+ memset(&del_filter, 0, sizeof(del_filter)); |
1130 |
++ del_filter.block_id = filter->block_id; |
1131 |
+ |
1132 |
+ /* Gets index of the filter */ |
1133 |
+ index = ocelot_vcap_block_get_filter_index(block, filter); |
1134 |
+@@ -1207,6 +1212,8 @@ int ocelot_vcap_filter_del(struct ocelot *ocelot, |
1135 |
+ struct ocelot_vcap_filter *tmp; |
1136 |
+ |
1137 |
+ tmp = ocelot_vcap_block_find_filter_by_index(block, i); |
1138 |
++ /* Read back the filter's counters before moving it */ |
1139 |
++ vcap_entry_get(ocelot, i + 1, tmp); |
1140 |
+ vcap_entry_set(ocelot, i, tmp); |
1141 |
+ } |
1142 |
+ |
1143 |
+diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c |
1144 |
+index 40fa5bce2ac2c..d324c292318b3 100644 |
1145 |
+--- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c |
1146 |
++++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c |
1147 |
+@@ -255,7 +255,7 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
1148 |
+ |
1149 |
+ err = ionic_map_bars(ionic); |
1150 |
+ if (err) |
1151 |
+- goto err_out_pci_disable_device; |
1152 |
++ goto err_out_pci_release_regions; |
1153 |
+ |
1154 |
+ /* Configure the device */ |
1155 |
+ err = ionic_setup(ionic); |
1156 |
+@@ -359,6 +359,7 @@ err_out_teardown: |
1157 |
+ |
1158 |
+ err_out_unmap_bars: |
1159 |
+ ionic_unmap_bars(ionic); |
1160 |
++err_out_pci_release_regions: |
1161 |
+ pci_release_regions(pdev); |
1162 |
+ err_out_pci_disable_device: |
1163 |
+ pci_disable_device(pdev); |
1164 |
+diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c |
1165 |
+index e7e2223aebbf5..f5a4d8f4fd114 100644 |
1166 |
+--- a/drivers/net/ethernet/sfc/ef10.c |
1167 |
++++ b/drivers/net/ethernet/sfc/ef10.c |
1168 |
+@@ -3579,6 +3579,11 @@ static int efx_ef10_mtd_probe(struct efx_nic *efx) |
1169 |
+ n_parts++; |
1170 |
+ } |
1171 |
+ |
1172 |
++ if (!n_parts) { |
1173 |
++ kfree(parts); |
1174 |
++ return 0; |
1175 |
++ } |
1176 |
++ |
1177 |
+ rc = efx_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts)); |
1178 |
+ fail: |
1179 |
+ if (rc) |
1180 |
+diff --git a/drivers/net/ethernet/sfc/efx_channels.c b/drivers/net/ethernet/sfc/efx_channels.c |
1181 |
+index 1f8cfd8060082..d5f2ccd3bca44 100644 |
1182 |
+--- a/drivers/net/ethernet/sfc/efx_channels.c |
1183 |
++++ b/drivers/net/ethernet/sfc/efx_channels.c |
1184 |
+@@ -844,7 +844,9 @@ static void efx_set_xdp_channels(struct efx_nic *efx) |
1185 |
+ |
1186 |
+ int efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries) |
1187 |
+ { |
1188 |
+- struct efx_channel *other_channel[EFX_MAX_CHANNELS], *channel; |
1189 |
++ struct efx_channel *other_channel[EFX_MAX_CHANNELS], *channel, |
1190 |
++ *ptp_channel = efx_ptp_channel(efx); |
1191 |
++ struct efx_ptp_data *ptp_data = efx->ptp_data; |
1192 |
+ unsigned int i, next_buffer_table = 0; |
1193 |
+ u32 old_rxq_entries, old_txq_entries; |
1194 |
+ int rc, rc2; |
1195 |
+@@ -897,11 +899,8 @@ int efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries) |
1196 |
+ old_txq_entries = efx->txq_entries; |
1197 |
+ efx->rxq_entries = rxq_entries; |
1198 |
+ efx->txq_entries = txq_entries; |
1199 |
+- for (i = 0; i < efx->n_channels; i++) { |
1200 |
+- channel = efx->channel[i]; |
1201 |
+- efx->channel[i] = other_channel[i]; |
1202 |
+- other_channel[i] = channel; |
1203 |
+- } |
1204 |
++ for (i = 0; i < efx->n_channels; i++) |
1205 |
++ swap(efx->channel[i], other_channel[i]); |
1206 |
+ |
1207 |
+ /* Restart buffer table allocation */ |
1208 |
+ efx->next_buffer_table = next_buffer_table; |
1209 |
+@@ -918,6 +917,7 @@ int efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries) |
1210 |
+ |
1211 |
+ efx_set_xdp_channels(efx); |
1212 |
+ out: |
1213 |
++ efx->ptp_data = NULL; |
1214 |
+ /* Destroy unused channel structures */ |
1215 |
+ for (i = 0; i < efx->n_channels; i++) { |
1216 |
+ channel = other_channel[i]; |
1217 |
+@@ -928,6 +928,7 @@ out: |
1218 |
+ } |
1219 |
+ } |
1220 |
+ |
1221 |
++ efx->ptp_data = ptp_data; |
1222 |
+ rc2 = efx_soft_enable_interrupts(efx); |
1223 |
+ if (rc2) { |
1224 |
+ rc = rc ? rc : rc2; |
1225 |
+@@ -944,11 +945,9 @@ rollback: |
1226 |
+ /* Swap back */ |
1227 |
+ efx->rxq_entries = old_rxq_entries; |
1228 |
+ efx->txq_entries = old_txq_entries; |
1229 |
+- for (i = 0; i < efx->n_channels; i++) { |
1230 |
+- channel = efx->channel[i]; |
1231 |
+- efx->channel[i] = other_channel[i]; |
1232 |
+- other_channel[i] = channel; |
1233 |
+- } |
1234 |
++ for (i = 0; i < efx->n_channels; i++) |
1235 |
++ swap(efx->channel[i], other_channel[i]); |
1236 |
++ efx_ptp_update_channel(efx, ptp_channel); |
1237 |
+ goto out; |
1238 |
+ } |
1239 |
+ |
1240 |
+diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c |
1241 |
+index 797e51802ccbb..725b0f38813a9 100644 |
1242 |
+--- a/drivers/net/ethernet/sfc/ptp.c |
1243 |
++++ b/drivers/net/ethernet/sfc/ptp.c |
1244 |
+@@ -45,6 +45,7 @@ |
1245 |
+ #include "farch_regs.h" |
1246 |
+ #include "tx.h" |
1247 |
+ #include "nic.h" /* indirectly includes ptp.h */ |
1248 |
++#include "efx_channels.h" |
1249 |
+ |
1250 |
+ /* Maximum number of events expected to make up a PTP event */ |
1251 |
+ #define MAX_EVENT_FRAGS 3 |
1252 |
+@@ -541,6 +542,12 @@ struct efx_channel *efx_ptp_channel(struct efx_nic *efx) |
1253 |
+ return efx->ptp_data ? efx->ptp_data->channel : NULL; |
1254 |
+ } |
1255 |
+ |
1256 |
++void efx_ptp_update_channel(struct efx_nic *efx, struct efx_channel *channel) |
1257 |
++{ |
1258 |
++ if (efx->ptp_data) |
1259 |
++ efx->ptp_data->channel = channel; |
1260 |
++} |
1261 |
++ |
1262 |
+ static u32 last_sync_timestamp_major(struct efx_nic *efx) |
1263 |
+ { |
1264 |
+ struct efx_channel *channel = efx_ptp_channel(efx); |
1265 |
+@@ -1443,6 +1450,11 @@ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel) |
1266 |
+ int rc = 0; |
1267 |
+ unsigned int pos; |
1268 |
+ |
1269 |
++ if (efx->ptp_data) { |
1270 |
++ efx->ptp_data->channel = channel; |
1271 |
++ return 0; |
1272 |
++ } |
1273 |
++ |
1274 |
+ ptp = kzalloc(sizeof(struct efx_ptp_data), GFP_KERNEL); |
1275 |
+ efx->ptp_data = ptp; |
1276 |
+ if (!efx->ptp_data) |
1277 |
+@@ -2179,7 +2191,7 @@ static const struct efx_channel_type efx_ptp_channel_type = { |
1278 |
+ .pre_probe = efx_ptp_probe_channel, |
1279 |
+ .post_remove = efx_ptp_remove_channel, |
1280 |
+ .get_name = efx_ptp_get_channel_name, |
1281 |
+- /* no copy operation; there is no need to reallocate this channel */ |
1282 |
++ .copy = efx_copy_channel, |
1283 |
+ .receive_skb = efx_ptp_rx, |
1284 |
+ .want_txqs = efx_ptp_want_txqs, |
1285 |
+ .keep_eventq = false, |
1286 |
+diff --git a/drivers/net/ethernet/sfc/ptp.h b/drivers/net/ethernet/sfc/ptp.h |
1287 |
+index 9855e8c9e544d..7b1ef7002b3f0 100644 |
1288 |
+--- a/drivers/net/ethernet/sfc/ptp.h |
1289 |
++++ b/drivers/net/ethernet/sfc/ptp.h |
1290 |
+@@ -16,6 +16,7 @@ struct ethtool_ts_info; |
1291 |
+ int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel); |
1292 |
+ void efx_ptp_defer_probe_with_channel(struct efx_nic *efx); |
1293 |
+ struct efx_channel *efx_ptp_channel(struct efx_nic *efx); |
1294 |
++void efx_ptp_update_channel(struct efx_nic *efx, struct efx_channel *channel); |
1295 |
+ void efx_ptp_remove(struct efx_nic *efx); |
1296 |
+ int efx_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr); |
1297 |
+ int efx_ptp_get_ts_config(struct efx_nic *efx, struct ifreq *ifr); |
1298 |
+diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c |
1299 |
+index 642472de5a08b..97c1d1ecba34c 100644 |
1300 |
+--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c |
1301 |
++++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c |
1302 |
+@@ -934,8 +934,6 @@ static int xemaclite_open(struct net_device *dev) |
1303 |
+ xemaclite_disable_interrupts(lp); |
1304 |
+ |
1305 |
+ if (lp->phy_node) { |
1306 |
+- u32 bmcr; |
1307 |
+- |
1308 |
+ lp->phy_dev = of_phy_connect(lp->ndev, lp->phy_node, |
1309 |
+ xemaclite_adjust_link, 0, |
1310 |
+ PHY_INTERFACE_MODE_MII); |
1311 |
+@@ -946,19 +944,6 @@ static int xemaclite_open(struct net_device *dev) |
1312 |
+ |
1313 |
+ /* EmacLite doesn't support giga-bit speeds */ |
1314 |
+ phy_set_max_speed(lp->phy_dev, SPEED_100); |
1315 |
+- |
1316 |
+- /* Don't advertise 1000BASE-T Full/Half duplex speeds */ |
1317 |
+- phy_write(lp->phy_dev, MII_CTRL1000, 0); |
1318 |
+- |
1319 |
+- /* Advertise only 10 and 100mbps full/half duplex speeds */ |
1320 |
+- phy_write(lp->phy_dev, MII_ADVERTISE, ADVERTISE_ALL | |
1321 |
+- ADVERTISE_CSMA); |
1322 |
+- |
1323 |
+- /* Restart auto negotiation */ |
1324 |
+- bmcr = phy_read(lp->phy_dev, MII_BMCR); |
1325 |
+- bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART); |
1326 |
+- phy_write(lp->phy_dev, MII_BMCR, bmcr); |
1327 |
+- |
1328 |
+ phy_start(lp->phy_dev); |
1329 |
+ } |
1330 |
+ |
1331 |
+diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c |
1332 |
+index e2ac61f44c945..64d829ed98876 100644 |
1333 |
+--- a/drivers/net/phy/micrel.c |
1334 |
++++ b/drivers/net/phy/micrel.c |
1335 |
+@@ -1544,6 +1544,7 @@ static struct phy_driver ksphy_driver[] = { |
1336 |
+ .name = "Micrel KS8737", |
1337 |
+ /* PHY_BASIC_FEATURES */ |
1338 |
+ .driver_data = &ks8737_type, |
1339 |
++ .probe = kszphy_probe, |
1340 |
+ .config_init = kszphy_config_init, |
1341 |
+ .config_intr = kszphy_config_intr, |
1342 |
+ .handle_interrupt = kszphy_handle_interrupt, |
1343 |
+@@ -1669,8 +1670,8 @@ static struct phy_driver ksphy_driver[] = { |
1344 |
+ .config_init = ksz8061_config_init, |
1345 |
+ .config_intr = kszphy_config_intr, |
1346 |
+ .handle_interrupt = kszphy_handle_interrupt, |
1347 |
+- .suspend = kszphy_suspend, |
1348 |
+- .resume = kszphy_resume, |
1349 |
++ .suspend = genphy_suspend, |
1350 |
++ .resume = genphy_resume, |
1351 |
+ }, { |
1352 |
+ .phy_id = PHY_ID_KSZ9021, |
1353 |
+ .phy_id_mask = 0x000ffffe, |
1354 |
+diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c |
1355 |
+index beb2b66da1324..f122026c46826 100644 |
1356 |
+--- a/drivers/net/phy/phy.c |
1357 |
++++ b/drivers/net/phy/phy.c |
1358 |
+@@ -970,8 +970,13 @@ static irqreturn_t phy_interrupt(int irq, void *phy_dat) |
1359 |
+ { |
1360 |
+ struct phy_device *phydev = phy_dat; |
1361 |
+ struct phy_driver *drv = phydev->drv; |
1362 |
++ irqreturn_t ret; |
1363 |
+ |
1364 |
+- return drv->handle_interrupt(phydev); |
1365 |
++ mutex_lock(&phydev->lock); |
1366 |
++ ret = drv->handle_interrupt(phydev); |
1367 |
++ mutex_unlock(&phydev->lock); |
1368 |
++ |
1369 |
++ return ret; |
1370 |
+ } |
1371 |
+ |
1372 |
+ /** |
1373 |
+diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c |
1374 |
+index 4720b24ca51b5..90dfefc1f5f8d 100644 |
1375 |
+--- a/drivers/net/phy/sfp.c |
1376 |
++++ b/drivers/net/phy/sfp.c |
1377 |
+@@ -250,6 +250,7 @@ struct sfp { |
1378 |
+ struct sfp_eeprom_id id; |
1379 |
+ unsigned int module_power_mW; |
1380 |
+ unsigned int module_t_start_up; |
1381 |
++ bool tx_fault_ignore; |
1382 |
+ |
1383 |
+ #if IS_ENABLED(CONFIG_HWMON) |
1384 |
+ struct sfp_diag diag; |
1385 |
+@@ -1945,6 +1946,12 @@ static int sfp_sm_mod_probe(struct sfp *sfp, bool report) |
1386 |
+ else |
1387 |
+ sfp->module_t_start_up = T_START_UP; |
1388 |
+ |
1389 |
++ if (!memcmp(id.base.vendor_name, "HUAWEI ", 16) && |
1390 |
++ !memcmp(id.base.vendor_pn, "MA5671A ", 16)) |
1391 |
++ sfp->tx_fault_ignore = true; |
1392 |
++ else |
1393 |
++ sfp->tx_fault_ignore = false; |
1394 |
++ |
1395 |
+ return 0; |
1396 |
+ } |
1397 |
+ |
1398 |
+@@ -2397,7 +2404,10 @@ static void sfp_check_state(struct sfp *sfp) |
1399 |
+ mutex_lock(&sfp->st_mutex); |
1400 |
+ state = sfp_get_state(sfp); |
1401 |
+ changed = state ^ sfp->state; |
1402 |
+- changed &= SFP_F_PRESENT | SFP_F_LOS | SFP_F_TX_FAULT; |
1403 |
++ if (sfp->tx_fault_ignore) |
1404 |
++ changed &= SFP_F_PRESENT | SFP_F_LOS; |
1405 |
++ else |
1406 |
++ changed &= SFP_F_PRESENT | SFP_F_LOS | SFP_F_TX_FAULT; |
1407 |
+ |
1408 |
+ for (i = 0; i < GPIO_MAX; i++) |
1409 |
+ if (changed & BIT(i)) |
1410 |
+diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c |
1411 |
+index 125479b5c0d61..fc4197bf2478e 100644 |
1412 |
+--- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c |
1413 |
++++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c |
1414 |
+@@ -322,7 +322,7 @@ void iwl_dbg_tlv_del_timers(struct iwl_trans *trans) |
1415 |
+ struct iwl_dbg_tlv_timer_node *node, *tmp; |
1416 |
+ |
1417 |
+ list_for_each_entry_safe(node, tmp, timer_list, list) { |
1418 |
+- del_timer(&node->timer); |
1419 |
++ del_timer_sync(&node->timer); |
1420 |
+ list_del(&node->list); |
1421 |
+ kfree(node); |
1422 |
+ } |
1423 |
+diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c |
1424 |
+index 0aeb1e1ec93ff..c3189e2c7c93a 100644 |
1425 |
+--- a/drivers/net/wireless/mac80211_hwsim.c |
1426 |
++++ b/drivers/net/wireless/mac80211_hwsim.c |
1427 |
+@@ -2336,11 +2336,13 @@ static void hw_scan_work(struct work_struct *work) |
1428 |
+ if (req->ie_len) |
1429 |
+ skb_put_data(probe, req->ie, req->ie_len); |
1430 |
+ |
1431 |
++ rcu_read_lock(); |
1432 |
+ if (!ieee80211_tx_prepare_skb(hwsim->hw, |
1433 |
+ hwsim->hw_scan_vif, |
1434 |
+ probe, |
1435 |
+ hwsim->tmp_chan->band, |
1436 |
+ NULL)) { |
1437 |
++ rcu_read_unlock(); |
1438 |
+ kfree_skb(probe); |
1439 |
+ continue; |
1440 |
+ } |
1441 |
+@@ -2348,6 +2350,7 @@ static void hw_scan_work(struct work_struct *work) |
1442 |
+ local_bh_disable(); |
1443 |
+ mac80211_hwsim_tx_frame(hwsim->hw, probe, |
1444 |
+ hwsim->tmp_chan); |
1445 |
++ rcu_read_unlock(); |
1446 |
+ local_bh_enable(); |
1447 |
+ } |
1448 |
+ } |
1449 |
+diff --git a/drivers/platform/surface/aggregator/core.c b/drivers/platform/surface/aggregator/core.c |
1450 |
+index c61bbeeec2dfd..54f86df77a37b 100644 |
1451 |
+--- a/drivers/platform/surface/aggregator/core.c |
1452 |
++++ b/drivers/platform/surface/aggregator/core.c |
1453 |
+@@ -816,7 +816,7 @@ err_cpkg: |
1454 |
+ err_bus: |
1455 |
+ return status; |
1456 |
+ } |
1457 |
+-module_init(ssam_core_init); |
1458 |
++subsys_initcall(ssam_core_init); |
1459 |
+ |
1460 |
+ static void __exit ssam_core_exit(void) |
1461 |
+ { |
1462 |
+diff --git a/drivers/s390/net/ctcm_mpc.c b/drivers/s390/net/ctcm_mpc.c |
1463 |
+index f0436f555c62a..be03cb123ef48 100644 |
1464 |
+--- a/drivers/s390/net/ctcm_mpc.c |
1465 |
++++ b/drivers/s390/net/ctcm_mpc.c |
1466 |
+@@ -626,8 +626,6 @@ static void mpc_rcvd_sweep_resp(struct mpcg_info *mpcginfo) |
1467 |
+ ctcm_clear_busy_do(dev); |
1468 |
+ } |
1469 |
+ |
1470 |
+- kfree(mpcginfo); |
1471 |
+- |
1472 |
+ return; |
1473 |
+ |
1474 |
+ } |
1475 |
+@@ -1192,10 +1190,10 @@ static void ctcmpc_unpack_skb(struct channel *ch, struct sk_buff *pskb) |
1476 |
+ CTCM_FUNTAIL, dev->name); |
1477 |
+ priv->stats.rx_dropped++; |
1478 |
+ /* mpcginfo only used for non-data transfers */ |
1479 |
+- kfree(mpcginfo); |
1480 |
+ if (do_debug_data) |
1481 |
+ ctcmpc_dump_skb(pskb, -8); |
1482 |
+ } |
1483 |
++ kfree(mpcginfo); |
1484 |
+ } |
1485 |
+ done: |
1486 |
+ |
1487 |
+@@ -1977,7 +1975,6 @@ static void mpc_action_rcvd_xid0(fsm_instance *fsm, int event, void *arg) |
1488 |
+ } |
1489 |
+ break; |
1490 |
+ } |
1491 |
+- kfree(mpcginfo); |
1492 |
+ |
1493 |
+ CTCM_PR_DEBUG("ctcmpc:%s() %s xid2:%i xid7:%i xidt_p2:%i \n", |
1494 |
+ __func__, ch->id, grp->outstanding_xid2, |
1495 |
+@@ -2038,7 +2035,6 @@ static void mpc_action_rcvd_xid7(fsm_instance *fsm, int event, void *arg) |
1496 |
+ mpc_validate_xid(mpcginfo); |
1497 |
+ break; |
1498 |
+ } |
1499 |
+- kfree(mpcginfo); |
1500 |
+ return; |
1501 |
+ } |
1502 |
+ |
1503 |
+diff --git a/drivers/s390/net/ctcm_sysfs.c b/drivers/s390/net/ctcm_sysfs.c |
1504 |
+index ded1930a00b2d..e3813a7aa5e68 100644 |
1505 |
+--- a/drivers/s390/net/ctcm_sysfs.c |
1506 |
++++ b/drivers/s390/net/ctcm_sysfs.c |
1507 |
+@@ -39,11 +39,12 @@ static ssize_t ctcm_buffer_write(struct device *dev, |
1508 |
+ struct ctcm_priv *priv = dev_get_drvdata(dev); |
1509 |
+ int rc; |
1510 |
+ |
1511 |
+- ndev = priv->channel[CTCM_READ]->netdev; |
1512 |
+- if (!(priv && priv->channel[CTCM_READ] && ndev)) { |
1513 |
++ if (!(priv && priv->channel[CTCM_READ] && |
1514 |
++ priv->channel[CTCM_READ]->netdev)) { |
1515 |
+ CTCM_DBF_TEXT(SETUP, CTC_DBF_ERROR, "bfnondev"); |
1516 |
+ return -ENODEV; |
1517 |
+ } |
1518 |
++ ndev = priv->channel[CTCM_READ]->netdev; |
1519 |
+ |
1520 |
+ rc = kstrtouint(buf, 0, &bs1); |
1521 |
+ if (rc) |
1522 |
+diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c |
1523 |
+index 440219bcaa2be..06a322bdced6d 100644 |
1524 |
+--- a/drivers/s390/net/lcs.c |
1525 |
++++ b/drivers/s390/net/lcs.c |
1526 |
+@@ -1735,10 +1735,11 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd) |
1527 |
+ lcs_schedule_recovery(card); |
1528 |
+ break; |
1529 |
+ case LCS_CMD_STOPLAN: |
1530 |
+- pr_warn("Stoplan for %s initiated by LGW\n", |
1531 |
+- card->dev->name); |
1532 |
+- if (card->dev) |
1533 |
++ if (card->dev) { |
1534 |
++ pr_warn("Stoplan for %s initiated by LGW\n", |
1535 |
++ card->dev->name); |
1536 |
+ netif_carrier_off(card->dev); |
1537 |
++ } |
1538 |
+ break; |
1539 |
+ default: |
1540 |
+ LCS_DBF_TEXT(5, trace, "noLGWcmd"); |
1541 |
+diff --git a/drivers/slimbus/qcom-ctrl.c b/drivers/slimbus/qcom-ctrl.c |
1542 |
+index f04b961b96cd4..ec58091fc948a 100644 |
1543 |
+--- a/drivers/slimbus/qcom-ctrl.c |
1544 |
++++ b/drivers/slimbus/qcom-ctrl.c |
1545 |
+@@ -510,9 +510,9 @@ static int qcom_slim_probe(struct platform_device *pdev) |
1546 |
+ } |
1547 |
+ |
1548 |
+ ctrl->irq = platform_get_irq(pdev, 0); |
1549 |
+- if (!ctrl->irq) { |
1550 |
++ if (ctrl->irq < 0) { |
1551 |
+ dev_err(&pdev->dev, "no slimbus IRQ\n"); |
1552 |
+- return -ENODEV; |
1553 |
++ return ctrl->irq; |
1554 |
+ } |
1555 |
+ |
1556 |
+ sctrl = &ctrl->ctrl; |
1557 |
+diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c |
1558 |
+index 2294d5b633b5b..1767503de7446 100644 |
1559 |
+--- a/drivers/tty/n_gsm.c |
1560 |
++++ b/drivers/tty/n_gsm.c |
1561 |
+@@ -1587,6 +1587,7 @@ static void gsm_dlci_data(struct gsm_dlci *dlci, const u8 *data, int clen) |
1562 |
+ if (len == 0) |
1563 |
+ return; |
1564 |
+ } |
1565 |
++ len--; |
1566 |
+ slen++; |
1567 |
+ tty = tty_port_tty_get(port); |
1568 |
+ if (tty) { |
1569 |
+@@ -2275,6 +2276,7 @@ static void gsm_copy_config_values(struct gsm_mux *gsm, |
1570 |
+ |
1571 |
+ static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c) |
1572 |
+ { |
1573 |
++ int ret = 0; |
1574 |
+ int need_close = 0; |
1575 |
+ int need_restart = 0; |
1576 |
+ |
1577 |
+@@ -2342,10 +2344,13 @@ static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c) |
1578 |
+ * FIXME: We need to separate activation/deactivation from adding |
1579 |
+ * and removing from the mux array |
1580 |
+ */ |
1581 |
+- if (need_restart) |
1582 |
+- gsm_activate_mux(gsm); |
1583 |
+- if (gsm->initiator && need_close) |
1584 |
+- gsm_dlci_begin_open(gsm->dlci[0]); |
1585 |
++ if (gsm->dead) { |
1586 |
++ ret = gsm_activate_mux(gsm); |
1587 |
++ if (ret) |
1588 |
++ return ret; |
1589 |
++ if (gsm->initiator) |
1590 |
++ gsm_dlci_begin_open(gsm->dlci[0]); |
1591 |
++ } |
1592 |
+ return 0; |
1593 |
+ } |
1594 |
+ |
1595 |
+diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c |
1596 |
+index fb65dc601b237..de48a58460f47 100644 |
1597 |
+--- a/drivers/tty/serial/8250/8250_mtk.c |
1598 |
++++ b/drivers/tty/serial/8250/8250_mtk.c |
1599 |
+@@ -37,6 +37,7 @@ |
1600 |
+ #define MTK_UART_IER_RTSI 0x40 /* Enable RTS Modem status interrupt */ |
1601 |
+ #define MTK_UART_IER_CTSI 0x80 /* Enable CTS Modem status interrupt */ |
1602 |
+ |
1603 |
++#define MTK_UART_EFR 38 /* I/O: Extended Features Register */ |
1604 |
+ #define MTK_UART_EFR_EN 0x10 /* Enable enhancement feature */ |
1605 |
+ #define MTK_UART_EFR_RTS 0x40 /* Enable hardware rx flow control */ |
1606 |
+ #define MTK_UART_EFR_CTS 0x80 /* Enable hardware tx flow control */ |
1607 |
+@@ -53,6 +54,9 @@ |
1608 |
+ #define MTK_UART_TX_TRIGGER 1 |
1609 |
+ #define MTK_UART_RX_TRIGGER MTK_UART_RX_SIZE |
1610 |
+ |
1611 |
++#define MTK_UART_XON1 40 /* I/O: Xon character 1 */ |
1612 |
++#define MTK_UART_XOFF1 42 /* I/O: Xoff character 1 */ |
1613 |
++ |
1614 |
+ #ifdef CONFIG_SERIAL_8250_DMA |
1615 |
+ enum dma_rx_status { |
1616 |
+ DMA_RX_START = 0, |
1617 |
+@@ -169,7 +173,7 @@ static void mtk8250_dma_enable(struct uart_8250_port *up) |
1618 |
+ MTK_UART_DMA_EN_RX | MTK_UART_DMA_EN_TX); |
1619 |
+ |
1620 |
+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
1621 |
+- serial_out(up, UART_EFR, UART_EFR_ECB); |
1622 |
++ serial_out(up, MTK_UART_EFR, UART_EFR_ECB); |
1623 |
+ serial_out(up, UART_LCR, lcr); |
1624 |
+ |
1625 |
+ if (dmaengine_slave_config(dma->rxchan, &dma->rxconf) != 0) |
1626 |
+@@ -232,7 +236,7 @@ static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode) |
1627 |
+ int lcr = serial_in(up, UART_LCR); |
1628 |
+ |
1629 |
+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
1630 |
+- serial_out(up, UART_EFR, UART_EFR_ECB); |
1631 |
++ serial_out(up, MTK_UART_EFR, UART_EFR_ECB); |
1632 |
+ serial_out(up, UART_LCR, lcr); |
1633 |
+ lcr = serial_in(up, UART_LCR); |
1634 |
+ |
1635 |
+@@ -241,7 +245,7 @@ static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode) |
1636 |
+ serial_out(up, MTK_UART_ESCAPE_DAT, MTK_UART_ESCAPE_CHAR); |
1637 |
+ serial_out(up, MTK_UART_ESCAPE_EN, 0x00); |
1638 |
+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
1639 |
+- serial_out(up, UART_EFR, serial_in(up, UART_EFR) & |
1640 |
++ serial_out(up, MTK_UART_EFR, serial_in(up, MTK_UART_EFR) & |
1641 |
+ (~(MTK_UART_EFR_HW_FC | MTK_UART_EFR_SW_FC_MASK))); |
1642 |
+ serial_out(up, UART_LCR, lcr); |
1643 |
+ mtk8250_disable_intrs(up, MTK_UART_IER_XOFFI | |
1644 |
+@@ -255,8 +259,8 @@ static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode) |
1645 |
+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
1646 |
+ |
1647 |
+ /*enable hw flow control*/ |
1648 |
+- serial_out(up, UART_EFR, MTK_UART_EFR_HW_FC | |
1649 |
+- (serial_in(up, UART_EFR) & |
1650 |
++ serial_out(up, MTK_UART_EFR, MTK_UART_EFR_HW_FC | |
1651 |
++ (serial_in(up, MTK_UART_EFR) & |
1652 |
+ (~(MTK_UART_EFR_HW_FC | MTK_UART_EFR_SW_FC_MASK)))); |
1653 |
+ |
1654 |
+ serial_out(up, UART_LCR, lcr); |
1655 |
+@@ -270,12 +274,12 @@ static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode) |
1656 |
+ serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
1657 |
+ |
1658 |
+ /*enable sw flow control */ |
1659 |
+- serial_out(up, UART_EFR, MTK_UART_EFR_XON1_XOFF1 | |
1660 |
+- (serial_in(up, UART_EFR) & |
1661 |
++ serial_out(up, MTK_UART_EFR, MTK_UART_EFR_XON1_XOFF1 | |
1662 |
++ (serial_in(up, MTK_UART_EFR) & |
1663 |
+ (~(MTK_UART_EFR_HW_FC | MTK_UART_EFR_SW_FC_MASK)))); |
1664 |
+ |
1665 |
+- serial_out(up, UART_XON1, START_CHAR(port->state->port.tty)); |
1666 |
+- serial_out(up, UART_XOFF1, STOP_CHAR(port->state->port.tty)); |
1667 |
++ serial_out(up, MTK_UART_XON1, START_CHAR(port->state->port.tty)); |
1668 |
++ serial_out(up, MTK_UART_XOFF1, STOP_CHAR(port->state->port.tty)); |
1669 |
+ serial_out(up, UART_LCR, lcr); |
1670 |
+ mtk8250_disable_intrs(up, MTK_UART_IER_CTSI|MTK_UART_IER_RTSI); |
1671 |
+ mtk8250_enable_intrs(up, MTK_UART_IER_XOFFI); |
1672 |
+diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c |
1673 |
+index 13ac36e2da4f0..c7f81aa1ce912 100644 |
1674 |
+--- a/drivers/tty/serial/digicolor-usart.c |
1675 |
++++ b/drivers/tty/serial/digicolor-usart.c |
1676 |
+@@ -471,11 +471,10 @@ static int digicolor_uart_probe(struct platform_device *pdev) |
1677 |
+ if (IS_ERR(uart_clk)) |
1678 |
+ return PTR_ERR(uart_clk); |
1679 |
+ |
1680 |
+- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1681 |
+- dp->port.mapbase = res->start; |
1682 |
+- dp->port.membase = devm_ioremap_resource(&pdev->dev, res); |
1683 |
++ dp->port.membase = devm_platform_get_and_ioremap_resource(pdev, 0, &res); |
1684 |
+ if (IS_ERR(dp->port.membase)) |
1685 |
+ return PTR_ERR(dp->port.membase); |
1686 |
++ dp->port.mapbase = res->start; |
1687 |
+ |
1688 |
+ irq = platform_get_irq(pdev, 0); |
1689 |
+ if (irq < 0) |
1690 |
+diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c |
1691 |
+index ac5112def40d1..33e5eba6ff043 100644 |
1692 |
+--- a/drivers/tty/serial/fsl_lpuart.c |
1693 |
++++ b/drivers/tty/serial/fsl_lpuart.c |
1694 |
+@@ -2650,6 +2650,7 @@ static int lpuart_probe(struct platform_device *pdev) |
1695 |
+ struct device_node *np = pdev->dev.of_node; |
1696 |
+ struct lpuart_port *sport; |
1697 |
+ struct resource *res; |
1698 |
++ irq_handler_t handler; |
1699 |
+ int ret; |
1700 |
+ |
1701 |
+ sport = devm_kzalloc(&pdev->dev, sizeof(*sport), GFP_KERNEL); |
1702 |
+@@ -2727,17 +2728,11 @@ static int lpuart_probe(struct platform_device *pdev) |
1703 |
+ |
1704 |
+ if (lpuart_is_32(sport)) { |
1705 |
+ lpuart_reg.cons = LPUART32_CONSOLE; |
1706 |
+- ret = devm_request_irq(&pdev->dev, sport->port.irq, lpuart32_int, 0, |
1707 |
+- DRIVER_NAME, sport); |
1708 |
++ handler = lpuart32_int; |
1709 |
+ } else { |
1710 |
+ lpuart_reg.cons = LPUART_CONSOLE; |
1711 |
+- ret = devm_request_irq(&pdev->dev, sport->port.irq, lpuart_int, 0, |
1712 |
+- DRIVER_NAME, sport); |
1713 |
++ handler = lpuart_int; |
1714 |
+ } |
1715 |
+- |
1716 |
+- if (ret) |
1717 |
+- goto failed_irq_request; |
1718 |
+- |
1719 |
+ ret = uart_add_one_port(&lpuart_reg, &sport->port); |
1720 |
+ if (ret) |
1721 |
+ goto failed_attach_port; |
1722 |
+@@ -2759,13 +2754,18 @@ static int lpuart_probe(struct platform_device *pdev) |
1723 |
+ |
1724 |
+ sport->port.rs485_config(&sport->port, &sport->port.rs485); |
1725 |
+ |
1726 |
++ ret = devm_request_irq(&pdev->dev, sport->port.irq, handler, 0, |
1727 |
++ DRIVER_NAME, sport); |
1728 |
++ if (ret) |
1729 |
++ goto failed_irq_request; |
1730 |
++ |
1731 |
+ return 0; |
1732 |
+ |
1733 |
++failed_irq_request: |
1734 |
+ failed_get_rs485: |
1735 |
+ failed_reset: |
1736 |
+ uart_remove_one_port(&lpuart_reg, &sport->port); |
1737 |
+ failed_attach_port: |
1738 |
+-failed_irq_request: |
1739 |
+ lpuart_disable_clks(sport); |
1740 |
+ failed_clock_enable: |
1741 |
+ failed_out_of_range: |
1742 |
+diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c |
1743 |
+index fdf79bcf7eb09..0d99ba64ea528 100644 |
1744 |
+--- a/drivers/usb/class/cdc-wdm.c |
1745 |
++++ b/drivers/usb/class/cdc-wdm.c |
1746 |
+@@ -774,6 +774,7 @@ static int wdm_release(struct inode *inode, struct file *file) |
1747 |
+ poison_urbs(desc); |
1748 |
+ spin_lock_irq(&desc->iuspin); |
1749 |
+ desc->resp_count = 0; |
1750 |
++ clear_bit(WDM_RESPONDING, &desc->flags); |
1751 |
+ spin_unlock_irq(&desc->iuspin); |
1752 |
+ desc->manage_power(desc->intf, 0); |
1753 |
+ unpoison_urbs(desc); |
1754 |
+diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c |
1755 |
+index 9d87c0fb8f92e..bf0a3fc2d7767 100644 |
1756 |
+--- a/drivers/usb/gadget/function/f_uvc.c |
1757 |
++++ b/drivers/usb/gadget/function/f_uvc.c |
1758 |
+@@ -884,17 +884,42 @@ static void uvc_free(struct usb_function *f) |
1759 |
+ kfree(uvc); |
1760 |
+ } |
1761 |
+ |
1762 |
+-static void uvc_unbind(struct usb_configuration *c, struct usb_function *f) |
1763 |
++static void uvc_function_unbind(struct usb_configuration *c, |
1764 |
++ struct usb_function *f) |
1765 |
+ { |
1766 |
+ struct usb_composite_dev *cdev = c->cdev; |
1767 |
+ struct uvc_device *uvc = to_uvc(f); |
1768 |
++ long wait_ret = 1; |
1769 |
+ |
1770 |
+- uvcg_info(f, "%s\n", __func__); |
1771 |
++ uvcg_info(f, "%s()\n", __func__); |
1772 |
++ |
1773 |
++ /* If we know we're connected via v4l2, then there should be a cleanup |
1774 |
++ * of the device from userspace either via UVC_EVENT_DISCONNECT or |
1775 |
++ * though the video device removal uevent. Allow some time for the |
1776 |
++ * application to close out before things get deleted. |
1777 |
++ */ |
1778 |
++ if (uvc->func_connected) { |
1779 |
++ uvcg_dbg(f, "waiting for clean disconnect\n"); |
1780 |
++ wait_ret = wait_event_interruptible_timeout(uvc->func_connected_queue, |
1781 |
++ uvc->func_connected == false, msecs_to_jiffies(500)); |
1782 |
++ uvcg_dbg(f, "done waiting with ret: %ld\n", wait_ret); |
1783 |
++ } |
1784 |
+ |
1785 |
+ device_remove_file(&uvc->vdev.dev, &dev_attr_function_name); |
1786 |
+ video_unregister_device(&uvc->vdev); |
1787 |
+ v4l2_device_unregister(&uvc->v4l2_dev); |
1788 |
+ |
1789 |
++ if (uvc->func_connected) { |
1790 |
++ /* Wait for the release to occur to ensure there are no longer any |
1791 |
++ * pending operations that may cause panics when resources are cleaned |
1792 |
++ * up. |
1793 |
++ */ |
1794 |
++ uvcg_warn(f, "%s no clean disconnect, wait for release\n", __func__); |
1795 |
++ wait_ret = wait_event_interruptible_timeout(uvc->func_connected_queue, |
1796 |
++ uvc->func_connected == false, msecs_to_jiffies(1000)); |
1797 |
++ uvcg_dbg(f, "done waiting for release with ret: %ld\n", wait_ret); |
1798 |
++ } |
1799 |
++ |
1800 |
+ usb_ep_free_request(cdev->gadget->ep0, uvc->control_req); |
1801 |
+ kfree(uvc->control_buf); |
1802 |
+ |
1803 |
+@@ -913,6 +938,7 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi) |
1804 |
+ |
1805 |
+ mutex_init(&uvc->video.mutex); |
1806 |
+ uvc->state = UVC_STATE_DISCONNECTED; |
1807 |
++ init_waitqueue_head(&uvc->func_connected_queue); |
1808 |
+ opts = fi_to_f_uvc_opts(fi); |
1809 |
+ |
1810 |
+ mutex_lock(&opts->lock); |
1811 |
+@@ -943,7 +969,7 @@ static struct usb_function *uvc_alloc(struct usb_function_instance *fi) |
1812 |
+ /* Register the function. */ |
1813 |
+ uvc->func.name = "uvc"; |
1814 |
+ uvc->func.bind = uvc_function_bind; |
1815 |
+- uvc->func.unbind = uvc_unbind; |
1816 |
++ uvc->func.unbind = uvc_function_unbind; |
1817 |
+ uvc->func.get_alt = uvc_function_get_alt; |
1818 |
+ uvc->func.set_alt = uvc_function_set_alt; |
1819 |
+ uvc->func.disable = uvc_function_disable; |
1820 |
+diff --git a/drivers/usb/gadget/function/uvc.h b/drivers/usb/gadget/function/uvc.h |
1821 |
+index 9d5f17b551bbd..0966c5aa24921 100644 |
1822 |
+--- a/drivers/usb/gadget/function/uvc.h |
1823 |
++++ b/drivers/usb/gadget/function/uvc.h |
1824 |
+@@ -14,6 +14,7 @@ |
1825 |
+ #include <linux/spinlock.h> |
1826 |
+ #include <linux/usb/composite.h> |
1827 |
+ #include <linux/videodev2.h> |
1828 |
++#include <linux/wait.h> |
1829 |
+ |
1830 |
+ #include <media/v4l2-device.h> |
1831 |
+ #include <media/v4l2-dev.h> |
1832 |
+@@ -127,6 +128,7 @@ struct uvc_device { |
1833 |
+ struct usb_function func; |
1834 |
+ struct uvc_video video; |
1835 |
+ bool func_connected; |
1836 |
++ wait_queue_head_t func_connected_queue; |
1837 |
+ |
1838 |
+ /* Descriptors */ |
1839 |
+ struct { |
1840 |
+diff --git a/drivers/usb/gadget/function/uvc_v4l2.c b/drivers/usb/gadget/function/uvc_v4l2.c |
1841 |
+index 197c26f7aec63..65abd55ce2348 100644 |
1842 |
+--- a/drivers/usb/gadget/function/uvc_v4l2.c |
1843 |
++++ b/drivers/usb/gadget/function/uvc_v4l2.c |
1844 |
+@@ -252,10 +252,11 @@ uvc_v4l2_subscribe_event(struct v4l2_fh *fh, |
1845 |
+ |
1846 |
+ static void uvc_v4l2_disable(struct uvc_device *uvc) |
1847 |
+ { |
1848 |
+- uvc->func_connected = false; |
1849 |
+ uvc_function_disconnect(uvc); |
1850 |
+ uvcg_video_enable(&uvc->video, 0); |
1851 |
+ uvcg_free_buffers(&uvc->video.queue); |
1852 |
++ uvc->func_connected = false; |
1853 |
++ wake_up_interruptible(&uvc->func_connected_queue); |
1854 |
+ } |
1855 |
+ |
1856 |
+ static int |
1857 |
+diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c |
1858 |
+index b4c84b3635074..f91a304320563 100644 |
1859 |
+--- a/drivers/usb/host/xhci-mtk-sch.c |
1860 |
++++ b/drivers/usb/host/xhci-mtk-sch.c |
1861 |
+@@ -465,7 +465,7 @@ static int check_fs_bus_bw(struct mu3h_sch_ep_info *sch_ep, int offset) |
1862 |
+ */ |
1863 |
+ for (j = 0; j < sch_ep->num_budget_microframes; j++) { |
1864 |
+ k = XHCI_MTK_BW_INDEX(base + j); |
1865 |
+- tmp = tt->fs_bus_bw[k] + sch_ep->bw_budget_table[j]; |
1866 |
++ tmp = tt->fs_bus_bw[k] + sch_ep->bw_cost_per_microframe; |
1867 |
+ if (tmp > FS_PAYLOAD_MAX) |
1868 |
+ return -ESCH_BW_OVERFLOW; |
1869 |
+ } |
1870 |
+@@ -539,19 +539,17 @@ static int check_sch_tt(struct mu3h_sch_ep_info *sch_ep, u32 offset) |
1871 |
+ static void update_sch_tt(struct mu3h_sch_ep_info *sch_ep, bool used) |
1872 |
+ { |
1873 |
+ struct mu3h_sch_tt *tt = sch_ep->sch_tt; |
1874 |
++ int bw_updated; |
1875 |
+ u32 base; |
1876 |
+- int i, j, k; |
1877 |
++ int i, j; |
1878 |
++ |
1879 |
++ bw_updated = sch_ep->bw_cost_per_microframe * (used ? 1 : -1); |
1880 |
+ |
1881 |
+ for (i = 0; i < sch_ep->num_esit; i++) { |
1882 |
+ base = sch_ep->offset + i * sch_ep->esit; |
1883 |
+ |
1884 |
+- for (j = 0; j < sch_ep->num_budget_microframes; j++) { |
1885 |
+- k = XHCI_MTK_BW_INDEX(base + j); |
1886 |
+- if (used) |
1887 |
+- tt->fs_bus_bw[k] += sch_ep->bw_budget_table[j]; |
1888 |
+- else |
1889 |
+- tt->fs_bus_bw[k] -= sch_ep->bw_budget_table[j]; |
1890 |
+- } |
1891 |
++ for (j = 0; j < sch_ep->num_budget_microframes; j++) |
1892 |
++ tt->fs_bus_bw[XHCI_MTK_BW_INDEX(base + j)] += bw_updated; |
1893 |
+ } |
1894 |
+ |
1895 |
+ if (used) |
1896 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
1897 |
+index 1364ce7f0abf0..152ad882657d7 100644 |
1898 |
+--- a/drivers/usb/serial/option.c |
1899 |
++++ b/drivers/usb/serial/option.c |
1900 |
+@@ -2123,10 +2123,14 @@ static const struct usb_device_id option_ids[] = { |
1901 |
+ .driver_info = RSVD(3) }, |
1902 |
+ { USB_DEVICE(0x1508, 0x1001), /* Fibocom NL668 (IOT version) */ |
1903 |
+ .driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, |
1904 |
++ { USB_DEVICE(0x1782, 0x4d10) }, /* Fibocom L610 (AT mode) */ |
1905 |
++ { USB_DEVICE_INTERFACE_CLASS(0x1782, 0x4d11, 0xff) }, /* Fibocom L610 (ECM/RNDIS mode) */ |
1906 |
+ { USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */ |
1907 |
+ .driver_info = RSVD(4) | RSVD(5) }, |
1908 |
+ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */ |
1909 |
+ .driver_info = RSVD(6) }, |
1910 |
++ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0106, 0xff) }, /* Fibocom MA510 (ECM mode w/ diag intf.) */ |
1911 |
++ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x010a, 0xff) }, /* Fibocom MA510 (ECM mode) */ |
1912 |
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */ |
1913 |
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */ |
1914 |
+ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */ |
1915 |
+diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c |
1916 |
+index 88b284d61681a..1d878d05a6584 100644 |
1917 |
+--- a/drivers/usb/serial/pl2303.c |
1918 |
++++ b/drivers/usb/serial/pl2303.c |
1919 |
+@@ -106,6 +106,7 @@ static const struct usb_device_id id_table[] = { |
1920 |
+ { USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) }, |
1921 |
+ { USB_DEVICE(HP_VENDOR_ID, HP_LCM960_PRODUCT_ID) }, |
1922 |
+ { USB_DEVICE(HP_VENDOR_ID, HP_LM920_PRODUCT_ID) }, |
1923 |
++ { USB_DEVICE(HP_VENDOR_ID, HP_LM930_PRODUCT_ID) }, |
1924 |
+ { USB_DEVICE(HP_VENDOR_ID, HP_LM940_PRODUCT_ID) }, |
1925 |
+ { USB_DEVICE(HP_VENDOR_ID, HP_TD620_PRODUCT_ID) }, |
1926 |
+ { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) }, |
1927 |
+diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h |
1928 |
+index c5406452b774e..732f9b13ad5d5 100644 |
1929 |
+--- a/drivers/usb/serial/pl2303.h |
1930 |
++++ b/drivers/usb/serial/pl2303.h |
1931 |
+@@ -135,6 +135,7 @@ |
1932 |
+ #define HP_TD620_PRODUCT_ID 0x0956 |
1933 |
+ #define HP_LD960_PRODUCT_ID 0x0b39 |
1934 |
+ #define HP_LD381_PRODUCT_ID 0x0f7f |
1935 |
++#define HP_LM930_PRODUCT_ID 0x0f9b |
1936 |
+ #define HP_LCM220_PRODUCT_ID 0x3139 |
1937 |
+ #define HP_LCM960_PRODUCT_ID 0x3239 |
1938 |
+ #define HP_LD220_PRODUCT_ID 0x3524 |
1939 |
+diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c |
1940 |
+index c18bf8164bc2e..586ef5551e76e 100644 |
1941 |
+--- a/drivers/usb/serial/qcserial.c |
1942 |
++++ b/drivers/usb/serial/qcserial.c |
1943 |
+@@ -166,6 +166,8 @@ static const struct usb_device_id id_table[] = { |
1944 |
+ {DEVICE_SWI(0x1199, 0x9090)}, /* Sierra Wireless EM7565 QDL */ |
1945 |
+ {DEVICE_SWI(0x1199, 0x9091)}, /* Sierra Wireless EM7565 */ |
1946 |
+ {DEVICE_SWI(0x1199, 0x90d2)}, /* Sierra Wireless EM9191 QDL */ |
1947 |
++ {DEVICE_SWI(0x1199, 0xc080)}, /* Sierra Wireless EM7590 QDL */ |
1948 |
++ {DEVICE_SWI(0x1199, 0xc081)}, /* Sierra Wireless EM7590 */ |
1949 |
+ {DEVICE_SWI(0x413c, 0x81a2)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */ |
1950 |
+ {DEVICE_SWI(0x413c, 0x81a3)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */ |
1951 |
+ {DEVICE_SWI(0x413c, 0x81a4)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */ |
1952 |
+diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c |
1953 |
+index 7d540afdb7cc3..64e248117c41a 100644 |
1954 |
+--- a/drivers/usb/typec/tcpm/tcpci.c |
1955 |
++++ b/drivers/usb/typec/tcpm/tcpci.c |
1956 |
+@@ -877,7 +877,7 @@ static int tcpci_remove(struct i2c_client *client) |
1957 |
+ /* Disable chip interrupts before unregistering port */ |
1958 |
+ err = tcpci_write16(chip->tcpci, TCPC_ALERT_MASK, 0); |
1959 |
+ if (err < 0) |
1960 |
+- return err; |
1961 |
++ dev_warn(&client->dev, "Failed to disable irqs (%pe)\n", ERR_PTR(err)); |
1962 |
+ |
1963 |
+ tcpci_unregister_port(chip->tcpci); |
1964 |
+ |
1965 |
+diff --git a/drivers/usb/typec/tcpm/tcpci_mt6360.c b/drivers/usb/typec/tcpm/tcpci_mt6360.c |
1966 |
+index f1bd9e09bc87f..8a952eaf90163 100644 |
1967 |
+--- a/drivers/usb/typec/tcpm/tcpci_mt6360.c |
1968 |
++++ b/drivers/usb/typec/tcpm/tcpci_mt6360.c |
1969 |
+@@ -15,6 +15,9 @@ |
1970 |
+ |
1971 |
+ #include "tcpci.h" |
1972 |
+ |
1973 |
++#define MT6360_REG_PHYCTRL1 0x80 |
1974 |
++#define MT6360_REG_PHYCTRL3 0x82 |
1975 |
++#define MT6360_REG_PHYCTRL7 0x86 |
1976 |
+ #define MT6360_REG_VCONNCTRL1 0x8C |
1977 |
+ #define MT6360_REG_MODECTRL2 0x8F |
1978 |
+ #define MT6360_REG_SWRESET 0xA0 |
1979 |
+@@ -22,6 +25,8 @@ |
1980 |
+ #define MT6360_REG_DRPCTRL1 0xA2 |
1981 |
+ #define MT6360_REG_DRPCTRL2 0xA3 |
1982 |
+ #define MT6360_REG_I2CTORST 0xBF |
1983 |
++#define MT6360_REG_PHYCTRL11 0xCA |
1984 |
++#define MT6360_REG_RXCTRL1 0xCE |
1985 |
+ #define MT6360_REG_RXCTRL2 0xCF |
1986 |
+ #define MT6360_REG_CTDCTRL2 0xEC |
1987 |
+ |
1988 |
+@@ -106,6 +111,27 @@ static int mt6360_tcpc_init(struct tcpci *tcpci, struct tcpci_data *tdata) |
1989 |
+ if (ret) |
1990 |
+ return ret; |
1991 |
+ |
1992 |
++ /* BMC PHY */ |
1993 |
++ ret = mt6360_tcpc_write16(regmap, MT6360_REG_PHYCTRL1, 0x3A70); |
1994 |
++ if (ret) |
1995 |
++ return ret; |
1996 |
++ |
1997 |
++ ret = regmap_write(regmap, MT6360_REG_PHYCTRL3, 0x82); |
1998 |
++ if (ret) |
1999 |
++ return ret; |
2000 |
++ |
2001 |
++ ret = regmap_write(regmap, MT6360_REG_PHYCTRL7, 0x36); |
2002 |
++ if (ret) |
2003 |
++ return ret; |
2004 |
++ |
2005 |
++ ret = mt6360_tcpc_write16(regmap, MT6360_REG_PHYCTRL11, 0x3C60); |
2006 |
++ if (ret) |
2007 |
++ return ret; |
2008 |
++ |
2009 |
++ ret = regmap_write(regmap, MT6360_REG_RXCTRL1, 0xE8); |
2010 |
++ if (ret) |
2011 |
++ return ret; |
2012 |
++ |
2013 |
+ /* Set shipping mode off, AUTOIDLE on */ |
2014 |
+ return regmap_write(regmap, MT6360_REG_MODECTRL2, 0x7A); |
2015 |
+ } |
2016 |
+diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c |
2017 |
+index ea42ba6445b2d..b3d5f884c5445 100644 |
2018 |
+--- a/drivers/video/fbdev/efifb.c |
2019 |
++++ b/drivers/video/fbdev/efifb.c |
2020 |
+@@ -243,6 +243,10 @@ error: |
2021 |
+ static inline void efifb_show_boot_graphics(struct fb_info *info) {} |
2022 |
+ #endif |
2023 |
+ |
2024 |
++/* |
2025 |
++ * fb_ops.fb_destroy is called by the last put_fb_info() call at the end |
2026 |
++ * of unregister_framebuffer() or fb_release(). Do any cleanup here. |
2027 |
++ */ |
2028 |
+ static void efifb_destroy(struct fb_info *info) |
2029 |
+ { |
2030 |
+ if (efifb_pci_dev) |
2031 |
+@@ -254,10 +258,13 @@ static void efifb_destroy(struct fb_info *info) |
2032 |
+ else |
2033 |
+ memunmap(info->screen_base); |
2034 |
+ } |
2035 |
++ |
2036 |
+ if (request_mem_succeeded) |
2037 |
+ release_mem_region(info->apertures->ranges[0].base, |
2038 |
+ info->apertures->ranges[0].size); |
2039 |
+ fb_dealloc_cmap(&info->cmap); |
2040 |
++ |
2041 |
++ framebuffer_release(info); |
2042 |
+ } |
2043 |
+ |
2044 |
+ static const struct fb_ops efifb_ops = { |
2045 |
+@@ -620,9 +627,9 @@ static int efifb_remove(struct platform_device *pdev) |
2046 |
+ { |
2047 |
+ struct fb_info *info = platform_get_drvdata(pdev); |
2048 |
+ |
2049 |
++ /* efifb_destroy takes care of info cleanup */ |
2050 |
+ unregister_framebuffer(info); |
2051 |
+ sysfs_remove_groups(&pdev->dev.kobj, efifb_groups); |
2052 |
+- framebuffer_release(info); |
2053 |
+ |
2054 |
+ return 0; |
2055 |
+ } |
2056 |
+diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c |
2057 |
+index b63074fd892e5..a2e3a46900252 100644 |
2058 |
+--- a/drivers/video/fbdev/simplefb.c |
2059 |
++++ b/drivers/video/fbdev/simplefb.c |
2060 |
+@@ -70,12 +70,18 @@ struct simplefb_par; |
2061 |
+ static void simplefb_clocks_destroy(struct simplefb_par *par); |
2062 |
+ static void simplefb_regulators_destroy(struct simplefb_par *par); |
2063 |
+ |
2064 |
++/* |
2065 |
++ * fb_ops.fb_destroy is called by the last put_fb_info() call at the end |
2066 |
++ * of unregister_framebuffer() or fb_release(). Do any cleanup here. |
2067 |
++ */ |
2068 |
+ static void simplefb_destroy(struct fb_info *info) |
2069 |
+ { |
2070 |
+ simplefb_regulators_destroy(info->par); |
2071 |
+ simplefb_clocks_destroy(info->par); |
2072 |
+ if (info->screen_base) |
2073 |
+ iounmap(info->screen_base); |
2074 |
++ |
2075 |
++ framebuffer_release(info); |
2076 |
+ } |
2077 |
+ |
2078 |
+ static const struct fb_ops simplefb_ops = { |
2079 |
+@@ -520,8 +526,8 @@ static int simplefb_remove(struct platform_device *pdev) |
2080 |
+ { |
2081 |
+ struct fb_info *info = platform_get_drvdata(pdev); |
2082 |
+ |
2083 |
++ /* simplefb_destroy takes care of info cleanup */ |
2084 |
+ unregister_framebuffer(info); |
2085 |
+- framebuffer_release(info); |
2086 |
+ |
2087 |
+ return 0; |
2088 |
+ } |
2089 |
+diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c |
2090 |
+index df6de5a9dd4cd..e25e8de5ff672 100644 |
2091 |
+--- a/drivers/video/fbdev/vesafb.c |
2092 |
++++ b/drivers/video/fbdev/vesafb.c |
2093 |
+@@ -179,6 +179,10 @@ static int vesafb_setcolreg(unsigned regno, unsigned red, unsigned green, |
2094 |
+ return err; |
2095 |
+ } |
2096 |
+ |
2097 |
++/* |
2098 |
++ * fb_ops.fb_destroy is called by the last put_fb_info() call at the end |
2099 |
++ * of unregister_framebuffer() or fb_release(). Do any cleanup here. |
2100 |
++ */ |
2101 |
+ static void vesafb_destroy(struct fb_info *info) |
2102 |
+ { |
2103 |
+ struct vesafb_par *par = info->par; |
2104 |
+@@ -188,6 +192,8 @@ static void vesafb_destroy(struct fb_info *info) |
2105 |
+ if (info->screen_base) |
2106 |
+ iounmap(info->screen_base); |
2107 |
+ release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size); |
2108 |
++ |
2109 |
++ framebuffer_release(info); |
2110 |
+ } |
2111 |
+ |
2112 |
+ static struct fb_ops vesafb_ops = { |
2113 |
+@@ -484,10 +490,10 @@ static int vesafb_remove(struct platform_device *pdev) |
2114 |
+ { |
2115 |
+ struct fb_info *info = platform_get_drvdata(pdev); |
2116 |
+ |
2117 |
++ /* vesafb_destroy takes care of info cleanup */ |
2118 |
+ unregister_framebuffer(info); |
2119 |
+ if (((struct vesafb_par *)(info->par))->region) |
2120 |
+ release_region(0x3c0, 32); |
2121 |
+- framebuffer_release(info); |
2122 |
+ |
2123 |
+ return 0; |
2124 |
+ } |
2125 |
+diff --git a/fs/ceph/file.c b/fs/ceph/file.c |
2126 |
+index 6180df6f8e61e..e34d52df4a13c 100644 |
2127 |
+--- a/fs/ceph/file.c |
2128 |
++++ b/fs/ceph/file.c |
2129 |
+@@ -592,9 +592,15 @@ static int ceph_finish_async_create(struct inode *dir, struct dentry *dentry, |
2130 |
+ iinfo.change_attr = 1; |
2131 |
+ ceph_encode_timespec64(&iinfo.btime, &now); |
2132 |
+ |
2133 |
+- iinfo.xattr_len = ARRAY_SIZE(xattr_buf); |
2134 |
+- iinfo.xattr_data = xattr_buf; |
2135 |
+- memset(iinfo.xattr_data, 0, iinfo.xattr_len); |
2136 |
++ if (req->r_pagelist) { |
2137 |
++ iinfo.xattr_len = req->r_pagelist->length; |
2138 |
++ iinfo.xattr_data = req->r_pagelist->mapped_tail; |
2139 |
++ } else { |
2140 |
++ /* fake it */ |
2141 |
++ iinfo.xattr_len = ARRAY_SIZE(xattr_buf); |
2142 |
++ iinfo.xattr_data = xattr_buf; |
2143 |
++ memset(iinfo.xattr_data, 0, iinfo.xattr_len); |
2144 |
++ } |
2145 |
+ |
2146 |
+ in.ino = cpu_to_le64(vino.ino); |
2147 |
+ in.snapid = cpu_to_le64(CEPH_NOSNAP); |
2148 |
+@@ -706,6 +712,10 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry, |
2149 |
+ err = ceph_security_init_secctx(dentry, mode, &as_ctx); |
2150 |
+ if (err < 0) |
2151 |
+ goto out_ctx; |
2152 |
++ /* Async create can't handle more than a page of xattrs */ |
2153 |
++ if (as_ctx.pagelist && |
2154 |
++ !list_is_singular(&as_ctx.pagelist->head)) |
2155 |
++ try_async = false; |
2156 |
+ } else if (!d_in_lookup(dentry)) { |
2157 |
+ /* If it's not being looked up, it's negative */ |
2158 |
+ return -ENOENT; |
2159 |
+diff --git a/fs/file_table.c b/fs/file_table.c |
2160 |
+index 45437f8e1003e..e8c9016703ad6 100644 |
2161 |
+--- a/fs/file_table.c |
2162 |
++++ b/fs/file_table.c |
2163 |
+@@ -375,6 +375,7 @@ void __fput_sync(struct file *file) |
2164 |
+ } |
2165 |
+ |
2166 |
+ EXPORT_SYMBOL(fput); |
2167 |
++EXPORT_SYMBOL(__fput_sync); |
2168 |
+ |
2169 |
+ void __init files_init(void) |
2170 |
+ { |
2171 |
+diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c |
2172 |
+index 81ec192ce0673..85b4259f104a2 100644 |
2173 |
+--- a/fs/fs-writeback.c |
2174 |
++++ b/fs/fs-writeback.c |
2175 |
+@@ -1739,6 +1739,10 @@ static int writeback_single_inode(struct inode *inode, |
2176 |
+ */ |
2177 |
+ if (!(inode->i_state & I_DIRTY_ALL)) |
2178 |
+ inode_cgwb_move_to_attached(inode, wb); |
2179 |
++ else if (!(inode->i_state & I_SYNC_QUEUED) && |
2180 |
++ (inode->i_state & I_DIRTY)) |
2181 |
++ redirty_tail_locked(inode, wb); |
2182 |
++ |
2183 |
+ spin_unlock(&wb->list_lock); |
2184 |
+ inode_sync_complete(inode); |
2185 |
+ out: |
2186 |
+diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c |
2187 |
+index fbdb7a30470a3..f785af2aa23cf 100644 |
2188 |
+--- a/fs/gfs2/bmap.c |
2189 |
++++ b/fs/gfs2/bmap.c |
2190 |
+@@ -1154,13 +1154,12 @@ static int gfs2_iomap_end(struct inode *inode, loff_t pos, loff_t length, |
2191 |
+ |
2192 |
+ if (length != written && (iomap->flags & IOMAP_F_NEW)) { |
2193 |
+ /* Deallocate blocks that were just allocated. */ |
2194 |
+- loff_t blockmask = i_blocksize(inode) - 1; |
2195 |
+- loff_t end = (pos + length) & ~blockmask; |
2196 |
++ loff_t hstart = round_up(pos + written, i_blocksize(inode)); |
2197 |
++ loff_t hend = iomap->offset + iomap->length; |
2198 |
+ |
2199 |
+- pos = (pos + written + blockmask) & ~blockmask; |
2200 |
+- if (pos < end) { |
2201 |
+- truncate_pagecache_range(inode, pos, end - 1); |
2202 |
+- punch_hole(ip, pos, end - pos); |
2203 |
++ if (hstart < hend) { |
2204 |
++ truncate_pagecache_range(inode, hstart, hend - 1); |
2205 |
++ punch_hole(ip, hstart, hend - hstart); |
2206 |
+ } |
2207 |
+ } |
2208 |
+ |
2209 |
+diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c |
2210 |
+index 0d444a90f513a..fb3cad38b1497 100644 |
2211 |
+--- a/fs/nfs/fs_context.c |
2212 |
++++ b/fs/nfs/fs_context.c |
2213 |
+@@ -514,7 +514,7 @@ static int nfs_fs_context_parse_param(struct fs_context *fc, |
2214 |
+ if (result.negated) |
2215 |
+ ctx->flags &= ~NFS_MOUNT_SOFTREVAL; |
2216 |
+ else |
2217 |
+- ctx->flags &= NFS_MOUNT_SOFTREVAL; |
2218 |
++ ctx->flags |= NFS_MOUNT_SOFTREVAL; |
2219 |
+ break; |
2220 |
+ case Opt_posix: |
2221 |
+ if (result.negated) |
2222 |
+diff --git a/fs/proc/fd.c b/fs/proc/fd.c |
2223 |
+index 172c86270b312..913bef0d2a36c 100644 |
2224 |
+--- a/fs/proc/fd.c |
2225 |
++++ b/fs/proc/fd.c |
2226 |
+@@ -72,7 +72,7 @@ out: |
2227 |
+ return 0; |
2228 |
+ } |
2229 |
+ |
2230 |
+-static int seq_fdinfo_open(struct inode *inode, struct file *file) |
2231 |
++static int proc_fdinfo_access_allowed(struct inode *inode) |
2232 |
+ { |
2233 |
+ bool allowed = false; |
2234 |
+ struct task_struct *task = get_proc_task(inode); |
2235 |
+@@ -86,6 +86,16 @@ static int seq_fdinfo_open(struct inode *inode, struct file *file) |
2236 |
+ if (!allowed) |
2237 |
+ return -EACCES; |
2238 |
+ |
2239 |
++ return 0; |
2240 |
++} |
2241 |
++ |
2242 |
++static int seq_fdinfo_open(struct inode *inode, struct file *file) |
2243 |
++{ |
2244 |
++ int ret = proc_fdinfo_access_allowed(inode); |
2245 |
++ |
2246 |
++ if (ret) |
2247 |
++ return ret; |
2248 |
++ |
2249 |
+ return single_open(file, seq_show, inode); |
2250 |
+ } |
2251 |
+ |
2252 |
+@@ -348,12 +358,23 @@ static int proc_readfdinfo(struct file *file, struct dir_context *ctx) |
2253 |
+ proc_fdinfo_instantiate); |
2254 |
+ } |
2255 |
+ |
2256 |
++static int proc_open_fdinfo(struct inode *inode, struct file *file) |
2257 |
++{ |
2258 |
++ int ret = proc_fdinfo_access_allowed(inode); |
2259 |
++ |
2260 |
++ if (ret) |
2261 |
++ return ret; |
2262 |
++ |
2263 |
++ return 0; |
2264 |
++} |
2265 |
++ |
2266 |
+ const struct inode_operations proc_fdinfo_inode_operations = { |
2267 |
+ .lookup = proc_lookupfdinfo, |
2268 |
+ .setattr = proc_setattr, |
2269 |
+ }; |
2270 |
+ |
2271 |
+ const struct file_operations proc_fdinfo_operations = { |
2272 |
++ .open = proc_open_fdinfo, |
2273 |
+ .read = generic_read_dir, |
2274 |
+ .iterate_shared = proc_readfdinfo, |
2275 |
+ .llseek = generic_file_llseek, |
2276 |
+diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h |
2277 |
+index 2c6b9e4162254..7c2d77d75a888 100644 |
2278 |
+--- a/include/linux/netdev_features.h |
2279 |
++++ b/include/linux/netdev_features.h |
2280 |
+@@ -169,7 +169,7 @@ enum { |
2281 |
+ #define NETIF_F_HW_HSR_FWD __NETIF_F(HW_HSR_FWD) |
2282 |
+ #define NETIF_F_HW_HSR_DUP __NETIF_F(HW_HSR_DUP) |
2283 |
+ |
2284 |
+-/* Finds the next feature with the highest number of the range of start till 0. |
2285 |
++/* Finds the next feature with the highest number of the range of start-1 till 0. |
2286 |
+ */ |
2287 |
+ static inline int find_next_netdev_feature(u64 feature, unsigned long start) |
2288 |
+ { |
2289 |
+@@ -188,7 +188,7 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start) |
2290 |
+ for ((bit) = find_next_netdev_feature((mask_addr), \ |
2291 |
+ NETDEV_FEATURE_COUNT); \ |
2292 |
+ (bit) >= 0; \ |
2293 |
+- (bit) = find_next_netdev_feature((mask_addr), (bit) - 1)) |
2294 |
++ (bit) = find_next_netdev_feature((mask_addr), (bit))) |
2295 |
+ |
2296 |
+ /* Features valid for ethtool to change */ |
2297 |
+ /* = all defined minus driver/device-class-related */ |
2298 |
+diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h |
2299 |
+index a4661646adc9c..9fcf5ffc4f9ad 100644 |
2300 |
+--- a/include/linux/sunrpc/clnt.h |
2301 |
++++ b/include/linux/sunrpc/clnt.h |
2302 |
+@@ -159,6 +159,7 @@ struct rpc_add_xprt_test { |
2303 |
+ #define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9) |
2304 |
+ #define RPC_CLNT_CREATE_SOFTERR (1UL << 10) |
2305 |
+ #define RPC_CLNT_CREATE_REUSEPORT (1UL << 11) |
2306 |
++#define RPC_CLNT_CREATE_CONNECTED (1UL << 12) |
2307 |
+ |
2308 |
+ struct rpc_clnt *rpc_create(struct rpc_create_args *args); |
2309 |
+ struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
2310 |
+diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h |
2311 |
+index f72ec113ae568..98e1ec1a14f03 100644 |
2312 |
+--- a/include/net/inet_hashtables.h |
2313 |
++++ b/include/net/inet_hashtables.h |
2314 |
+@@ -425,7 +425,7 @@ static inline void sk_rcv_saddr_set(struct sock *sk, __be32 addr) |
2315 |
+ } |
2316 |
+ |
2317 |
+ int __inet_hash_connect(struct inet_timewait_death_row *death_row, |
2318 |
+- struct sock *sk, u32 port_offset, |
2319 |
++ struct sock *sk, u64 port_offset, |
2320 |
+ int (*check_established)(struct inet_timewait_death_row *, |
2321 |
+ struct sock *, __u16, |
2322 |
+ struct inet_timewait_sock **)); |
2323 |
+diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h |
2324 |
+index d7d2495f83c27..dac91aa38c5af 100644 |
2325 |
+--- a/include/net/secure_seq.h |
2326 |
++++ b/include/net/secure_seq.h |
2327 |
+@@ -4,8 +4,8 @@ |
2328 |
+ |
2329 |
+ #include <linux/types.h> |
2330 |
+ |
2331 |
+-u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); |
2332 |
+-u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, |
2333 |
++u64 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); |
2334 |
++u64 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, |
2335 |
+ __be16 dport); |
2336 |
+ u32 secure_tcp_seq(__be32 saddr, __be32 daddr, |
2337 |
+ __be16 sport, __be16 dport); |
2338 |
+diff --git a/include/net/tc_act/tc_pedit.h b/include/net/tc_act/tc_pedit.h |
2339 |
+index 748cf87a4d7ea..3e02709a1df65 100644 |
2340 |
+--- a/include/net/tc_act/tc_pedit.h |
2341 |
++++ b/include/net/tc_act/tc_pedit.h |
2342 |
+@@ -14,6 +14,7 @@ struct tcf_pedit { |
2343 |
+ struct tc_action common; |
2344 |
+ unsigned char tcfp_nkeys; |
2345 |
+ unsigned char tcfp_flags; |
2346 |
++ u32 tcfp_off_max_hint; |
2347 |
+ struct tc_pedit_key *tcfp_keys; |
2348 |
+ struct tcf_pedit_key_ex *tcfp_keys_ex; |
2349 |
+ }; |
2350 |
+diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h |
2351 |
+index 6bcb8c7a31751..2a598fb45bf4f 100644 |
2352 |
+--- a/include/trace/events/sunrpc.h |
2353 |
++++ b/include/trace/events/sunrpc.h |
2354 |
+@@ -976,7 +976,6 @@ DEFINE_RPC_XPRT_LIFETIME_EVENT(connect); |
2355 |
+ DEFINE_RPC_XPRT_LIFETIME_EVENT(disconnect_auto); |
2356 |
+ DEFINE_RPC_XPRT_LIFETIME_EVENT(disconnect_done); |
2357 |
+ DEFINE_RPC_XPRT_LIFETIME_EVENT(disconnect_force); |
2358 |
+-DEFINE_RPC_XPRT_LIFETIME_EVENT(disconnect_cleanup); |
2359 |
+ DEFINE_RPC_XPRT_LIFETIME_EVENT(destroy); |
2360 |
+ |
2361 |
+ DECLARE_EVENT_CLASS(rpc_xprt_event, |
2362 |
+diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h |
2363 |
+index 80d76b75bccd9..7aa2eb7662050 100644 |
2364 |
+--- a/include/uapi/linux/virtio_ids.h |
2365 |
++++ b/include/uapi/linux/virtio_ids.h |
2366 |
+@@ -73,12 +73,12 @@ |
2367 |
+ * Virtio Transitional IDs |
2368 |
+ */ |
2369 |
+ |
2370 |
+-#define VIRTIO_TRANS_ID_NET 1000 /* transitional virtio net */ |
2371 |
+-#define VIRTIO_TRANS_ID_BLOCK 1001 /* transitional virtio block */ |
2372 |
+-#define VIRTIO_TRANS_ID_BALLOON 1002 /* transitional virtio balloon */ |
2373 |
+-#define VIRTIO_TRANS_ID_CONSOLE 1003 /* transitional virtio console */ |
2374 |
+-#define VIRTIO_TRANS_ID_SCSI 1004 /* transitional virtio SCSI */ |
2375 |
+-#define VIRTIO_TRANS_ID_RNG 1005 /* transitional virtio rng */ |
2376 |
+-#define VIRTIO_TRANS_ID_9P 1009 /* transitional virtio 9p console */ |
2377 |
++#define VIRTIO_TRANS_ID_NET 0x1000 /* transitional virtio net */ |
2378 |
++#define VIRTIO_TRANS_ID_BLOCK 0x1001 /* transitional virtio block */ |
2379 |
++#define VIRTIO_TRANS_ID_BALLOON 0x1002 /* transitional virtio balloon */ |
2380 |
++#define VIRTIO_TRANS_ID_CONSOLE 0x1003 /* transitional virtio console */ |
2381 |
++#define VIRTIO_TRANS_ID_SCSI 0x1004 /* transitional virtio SCSI */ |
2382 |
++#define VIRTIO_TRANS_ID_RNG 0x1005 /* transitional virtio rng */ |
2383 |
++#define VIRTIO_TRANS_ID_9P 0x1009 /* transitional virtio 9p console */ |
2384 |
+ |
2385 |
+ #endif /* _LINUX_VIRTIO_IDS_H */ |
2386 |
+diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c |
2387 |
+index f6794602ab10c..31f94c6ea0a55 100644 |
2388 |
+--- a/kernel/cgroup/cpuset.c |
2389 |
++++ b/kernel/cgroup/cpuset.c |
2390 |
+@@ -3347,8 +3347,11 @@ static struct notifier_block cpuset_track_online_nodes_nb = { |
2391 |
+ */ |
2392 |
+ void __init cpuset_init_smp(void) |
2393 |
+ { |
2394 |
+- cpumask_copy(top_cpuset.cpus_allowed, cpu_active_mask); |
2395 |
+- top_cpuset.mems_allowed = node_states[N_MEMORY]; |
2396 |
++ /* |
2397 |
++ * cpus_allowd/mems_allowed set to v2 values in the initial |
2398 |
++ * cpuset_bind() call will be reset to v1 values in another |
2399 |
++ * cpuset_bind() call when v1 cpuset is mounted. |
2400 |
++ */ |
2401 |
+ top_cpuset.old_mems_allowed = top_cpuset.mems_allowed; |
2402 |
+ |
2403 |
+ cpumask_copy(top_cpuset.effective_cpus, cpu_active_mask); |
2404 |
+diff --git a/lib/dim/net_dim.c b/lib/dim/net_dim.c |
2405 |
+index 06811d866775c..53f6b9c6e9366 100644 |
2406 |
+--- a/lib/dim/net_dim.c |
2407 |
++++ b/lib/dim/net_dim.c |
2408 |
+@@ -12,41 +12,41 @@ |
2409 |
+ * Each profile size must be of NET_DIM_PARAMS_NUM_PROFILES |
2410 |
+ */ |
2411 |
+ #define NET_DIM_PARAMS_NUM_PROFILES 5 |
2412 |
+-#define NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE 256 |
2413 |
+-#define NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE 128 |
2414 |
++#define NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE 256 |
2415 |
++#define NET_DIM_DEFAULT_TX_CQ_PKTS_FROM_EQE 128 |
2416 |
+ #define NET_DIM_DEF_PROFILE_CQE 1 |
2417 |
+ #define NET_DIM_DEF_PROFILE_EQE 1 |
2418 |
+ |
2419 |
+ #define NET_DIM_RX_EQE_PROFILES { \ |
2420 |
+- {1, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \ |
2421 |
+- {8, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \ |
2422 |
+- {64, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \ |
2423 |
+- {128, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \ |
2424 |
+- {256, NET_DIM_DEFAULT_RX_CQ_MODERATION_PKTS_FROM_EQE}, \ |
2425 |
++ {.usec = 1, .pkts = NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE,}, \ |
2426 |
++ {.usec = 8, .pkts = NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE,}, \ |
2427 |
++ {.usec = 64, .pkts = NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE,}, \ |
2428 |
++ {.usec = 128, .pkts = NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE,}, \ |
2429 |
++ {.usec = 256, .pkts = NET_DIM_DEFAULT_RX_CQ_PKTS_FROM_EQE,} \ |
2430 |
+ } |
2431 |
+ |
2432 |
+ #define NET_DIM_RX_CQE_PROFILES { \ |
2433 |
+- {2, 256}, \ |
2434 |
+- {8, 128}, \ |
2435 |
+- {16, 64}, \ |
2436 |
+- {32, 64}, \ |
2437 |
+- {64, 64} \ |
2438 |
++ {.usec = 2, .pkts = 256,}, \ |
2439 |
++ {.usec = 8, .pkts = 128,}, \ |
2440 |
++ {.usec = 16, .pkts = 64,}, \ |
2441 |
++ {.usec = 32, .pkts = 64,}, \ |
2442 |
++ {.usec = 64, .pkts = 64,} \ |
2443 |
+ } |
2444 |
+ |
2445 |
+ #define NET_DIM_TX_EQE_PROFILES { \ |
2446 |
+- {1, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \ |
2447 |
+- {8, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \ |
2448 |
+- {32, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \ |
2449 |
+- {64, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE}, \ |
2450 |
+- {128, NET_DIM_DEFAULT_TX_CQ_MODERATION_PKTS_FROM_EQE} \ |
2451 |
++ {.usec = 1, .pkts = NET_DIM_DEFAULT_TX_CQ_PKTS_FROM_EQE,}, \ |
2452 |
++ {.usec = 8, .pkts = NET_DIM_DEFAULT_TX_CQ_PKTS_FROM_EQE,}, \ |
2453 |
++ {.usec = 32, .pkts = NET_DIM_DEFAULT_TX_CQ_PKTS_FROM_EQE,}, \ |
2454 |
++ {.usec = 64, .pkts = NET_DIM_DEFAULT_TX_CQ_PKTS_FROM_EQE,}, \ |
2455 |
++ {.usec = 128, .pkts = NET_DIM_DEFAULT_TX_CQ_PKTS_FROM_EQE,} \ |
2456 |
+ } |
2457 |
+ |
2458 |
+ #define NET_DIM_TX_CQE_PROFILES { \ |
2459 |
+- {5, 128}, \ |
2460 |
+- {8, 64}, \ |
2461 |
+- {16, 32}, \ |
2462 |
+- {32, 32}, \ |
2463 |
+- {64, 32} \ |
2464 |
++ {.usec = 5, .pkts = 128,}, \ |
2465 |
++ {.usec = 8, .pkts = 64,}, \ |
2466 |
++ {.usec = 16, .pkts = 32,}, \ |
2467 |
++ {.usec = 32, .pkts = 32,}, \ |
2468 |
++ {.usec = 64, .pkts = 32,} \ |
2469 |
+ } |
2470 |
+ |
2471 |
+ static const struct dim_cq_moder |
2472 |
+diff --git a/mm/huge_memory.c b/mm/huge_memory.c |
2473 |
+index c5142d237e482..8cc150a883615 100644 |
2474 |
+--- a/mm/huge_memory.c |
2475 |
++++ b/mm/huge_memory.c |
2476 |
+@@ -2617,11 +2617,16 @@ int split_huge_page_to_list(struct page *page, struct list_head *list) |
2477 |
+ struct address_space *mapping = NULL; |
2478 |
+ int extra_pins, ret; |
2479 |
+ pgoff_t end; |
2480 |
++ bool is_hzp; |
2481 |
+ |
2482 |
+- VM_BUG_ON_PAGE(is_huge_zero_page(head), head); |
2483 |
+ VM_BUG_ON_PAGE(!PageLocked(head), head); |
2484 |
+ VM_BUG_ON_PAGE(!PageCompound(head), head); |
2485 |
+ |
2486 |
++ is_hzp = is_huge_zero_page(head); |
2487 |
++ VM_WARN_ON_ONCE_PAGE(is_hzp, head); |
2488 |
++ if (is_hzp) |
2489 |
++ return -EBUSY; |
2490 |
++ |
2491 |
+ if (PageWriteback(head)) |
2492 |
+ return -EBUSY; |
2493 |
+ |
2494 |
+diff --git a/mm/memory-failure.c b/mm/memory-failure.c |
2495 |
+index 6b1556b4972e3..c3ceb74369334 100644 |
2496 |
+--- a/mm/memory-failure.c |
2497 |
++++ b/mm/memory-failure.c |
2498 |
+@@ -1217,7 +1217,7 @@ try_again: |
2499 |
+ } |
2500 |
+ out: |
2501 |
+ if (ret == -EIO) |
2502 |
+- dump_page(p, "hwpoison: unhandlable page"); |
2503 |
++ pr_err("Memory failure: %#lx: unhandlable page.\n", page_to_pfn(p)); |
2504 |
+ |
2505 |
+ return ret; |
2506 |
+ } |
2507 |
+@@ -1691,19 +1691,6 @@ try_again: |
2508 |
+ } |
2509 |
+ |
2510 |
+ if (PageTransHuge(hpage)) { |
2511 |
+- /* |
2512 |
+- * Bail out before SetPageHasHWPoisoned() if hpage is |
2513 |
+- * huge_zero_page, although PG_has_hwpoisoned is not |
2514 |
+- * checked in set_huge_zero_page(). |
2515 |
+- * |
2516 |
+- * TODO: Handle memory failure of huge_zero_page thoroughly. |
2517 |
+- */ |
2518 |
+- if (is_huge_zero_page(hpage)) { |
2519 |
+- action_result(pfn, MF_MSG_UNSPLIT_THP, MF_IGNORED); |
2520 |
+- res = -EBUSY; |
2521 |
+- goto unlock_mutex; |
2522 |
+- } |
2523 |
+- |
2524 |
+ /* |
2525 |
+ * The flag must be set after the refcount is bumped |
2526 |
+ * otherwise it may race with THP split. |
2527 |
+diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c |
2528 |
+index 0899a729a23f4..c120c7c6d25fc 100644 |
2529 |
+--- a/net/batman-adv/fragmentation.c |
2530 |
++++ b/net/batman-adv/fragmentation.c |
2531 |
+@@ -475,6 +475,17 @@ int batadv_frag_send_packet(struct sk_buff *skb, |
2532 |
+ goto free_skb; |
2533 |
+ } |
2534 |
+ |
2535 |
++ /* GRO might have added fragments to the fragment list instead of |
2536 |
++ * frags[]. But this is not handled by skb_split and must be |
2537 |
++ * linearized to avoid incorrect length information after all |
2538 |
++ * batman-adv fragments were created and submitted to the |
2539 |
++ * hard-interface |
2540 |
++ */ |
2541 |
++ if (skb_has_frag_list(skb) && __skb_linearize(skb)) { |
2542 |
++ ret = -ENOMEM; |
2543 |
++ goto free_skb; |
2544 |
++ } |
2545 |
++ |
2546 |
+ /* Create one header to be copied to all fragments */ |
2547 |
+ frag_header.packet_type = BATADV_UNICAST_FRAG; |
2548 |
+ frag_header.version = BATADV_COMPAT_VERSION; |
2549 |
+diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c |
2550 |
+index b5bc680d47553..7131cd1fb2ad5 100644 |
2551 |
+--- a/net/core/secure_seq.c |
2552 |
++++ b/net/core/secure_seq.c |
2553 |
+@@ -22,6 +22,8 @@ |
2554 |
+ static siphash_key_t net_secret __read_mostly; |
2555 |
+ static siphash_key_t ts_secret __read_mostly; |
2556 |
+ |
2557 |
++#define EPHEMERAL_PORT_SHUFFLE_PERIOD (10 * HZ) |
2558 |
++ |
2559 |
+ static __always_inline void net_secret_init(void) |
2560 |
+ { |
2561 |
+ net_get_random_once(&net_secret, sizeof(net_secret)); |
2562 |
+@@ -94,17 +96,19 @@ u32 secure_tcpv6_seq(const __be32 *saddr, const __be32 *daddr, |
2563 |
+ } |
2564 |
+ EXPORT_SYMBOL(secure_tcpv6_seq); |
2565 |
+ |
2566 |
+-u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, |
2567 |
++u64 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, |
2568 |
+ __be16 dport) |
2569 |
+ { |
2570 |
+ const struct { |
2571 |
+ struct in6_addr saddr; |
2572 |
+ struct in6_addr daddr; |
2573 |
++ unsigned int timeseed; |
2574 |
+ __be16 dport; |
2575 |
+ } __aligned(SIPHASH_ALIGNMENT) combined = { |
2576 |
+ .saddr = *(struct in6_addr *)saddr, |
2577 |
+ .daddr = *(struct in6_addr *)daddr, |
2578 |
+- .dport = dport |
2579 |
++ .timeseed = jiffies / EPHEMERAL_PORT_SHUFFLE_PERIOD, |
2580 |
++ .dport = dport, |
2581 |
+ }; |
2582 |
+ net_secret_init(); |
2583 |
+ return siphash(&combined, offsetofend(typeof(combined), dport), |
2584 |
+@@ -142,11 +146,13 @@ u32 secure_tcp_seq(__be32 saddr, __be32 daddr, |
2585 |
+ } |
2586 |
+ EXPORT_SYMBOL_GPL(secure_tcp_seq); |
2587 |
+ |
2588 |
+-u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport) |
2589 |
++u64 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport) |
2590 |
+ { |
2591 |
+ net_secret_init(); |
2592 |
+- return siphash_3u32((__force u32)saddr, (__force u32)daddr, |
2593 |
+- (__force u16)dport, &net_secret); |
2594 |
++ return siphash_4u32((__force u32)saddr, (__force u32)daddr, |
2595 |
++ (__force u16)dport, |
2596 |
++ jiffies / EPHEMERAL_PORT_SHUFFLE_PERIOD, |
2597 |
++ &net_secret); |
2598 |
+ } |
2599 |
+ EXPORT_SYMBOL_GPL(secure_ipv4_port_ephemeral); |
2600 |
+ #endif |
2601 |
+diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c |
2602 |
+index 7bd1e10086f0a..ee9c587031b4b 100644 |
2603 |
+--- a/net/ipv4/inet_hashtables.c |
2604 |
++++ b/net/ipv4/inet_hashtables.c |
2605 |
+@@ -504,7 +504,7 @@ not_unique: |
2606 |
+ return -EADDRNOTAVAIL; |
2607 |
+ } |
2608 |
+ |
2609 |
+-static u32 inet_sk_port_offset(const struct sock *sk) |
2610 |
++static u64 inet_sk_port_offset(const struct sock *sk) |
2611 |
+ { |
2612 |
+ const struct inet_sock *inet = inet_sk(sk); |
2613 |
+ |
2614 |
+@@ -726,15 +726,17 @@ EXPORT_SYMBOL_GPL(inet_unhash); |
2615 |
+ * Note that we use 32bit integers (vs RFC 'short integers') |
2616 |
+ * because 2^16 is not a multiple of num_ephemeral and this |
2617 |
+ * property might be used by clever attacker. |
2618 |
+- * RFC claims using TABLE_LENGTH=10 buckets gives an improvement, |
2619 |
+- * we use 256 instead to really give more isolation and |
2620 |
+- * privacy, this only consumes 1 KB of kernel memory. |
2621 |
++ * RFC claims using TABLE_LENGTH=10 buckets gives an improvement, though |
2622 |
++ * attacks were since demonstrated, thus we use 65536 instead to really |
2623 |
++ * give more isolation and privacy, at the expense of 256kB of kernel |
2624 |
++ * memory. |
2625 |
+ */ |
2626 |
+-#define INET_TABLE_PERTURB_SHIFT 8 |
2627 |
+-static u32 table_perturb[1 << INET_TABLE_PERTURB_SHIFT]; |
2628 |
++#define INET_TABLE_PERTURB_SHIFT 16 |
2629 |
++#define INET_TABLE_PERTURB_SIZE (1 << INET_TABLE_PERTURB_SHIFT) |
2630 |
++static u32 *table_perturb; |
2631 |
+ |
2632 |
+ int __inet_hash_connect(struct inet_timewait_death_row *death_row, |
2633 |
+- struct sock *sk, u32 port_offset, |
2634 |
++ struct sock *sk, u64 port_offset, |
2635 |
+ int (*check_established)(struct inet_timewait_death_row *, |
2636 |
+ struct sock *, __u16, struct inet_timewait_sock **)) |
2637 |
+ { |
2638 |
+@@ -774,10 +776,13 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row, |
2639 |
+ if (likely(remaining > 1)) |
2640 |
+ remaining &= ~1U; |
2641 |
+ |
2642 |
+- net_get_random_once(table_perturb, sizeof(table_perturb)); |
2643 |
+- index = hash_32(port_offset, INET_TABLE_PERTURB_SHIFT); |
2644 |
++ net_get_random_once(table_perturb, |
2645 |
++ INET_TABLE_PERTURB_SIZE * sizeof(*table_perturb)); |
2646 |
++ index = port_offset & (INET_TABLE_PERTURB_SIZE - 1); |
2647 |
++ |
2648 |
++ offset = READ_ONCE(table_perturb[index]) + (port_offset >> 32); |
2649 |
++ offset %= remaining; |
2650 |
+ |
2651 |
+- offset = (READ_ONCE(table_perturb[index]) + port_offset) % remaining; |
2652 |
+ /* In first pass we try ports of @low parity. |
2653 |
+ * inet_csk_get_port() does the opposite choice. |
2654 |
+ */ |
2655 |
+@@ -831,11 +836,12 @@ next_port: |
2656 |
+ return -EADDRNOTAVAIL; |
2657 |
+ |
2658 |
+ ok: |
2659 |
+- /* If our first attempt found a candidate, skip next candidate |
2660 |
+- * in 1/16 of cases to add some noise. |
2661 |
++ /* Here we want to add a little bit of randomness to the next source |
2662 |
++ * port that will be chosen. We use a max() with a random here so that |
2663 |
++ * on low contention the randomness is maximal and on high contention |
2664 |
++ * it may be inexistent. |
2665 |
+ */ |
2666 |
+- if (!i && !(prandom_u32() % 16)) |
2667 |
+- i = 2; |
2668 |
++ i = max_t(int, i, (prandom_u32() & 7) * 2); |
2669 |
+ WRITE_ONCE(table_perturb[index], READ_ONCE(table_perturb[index]) + i + 2); |
2670 |
+ |
2671 |
+ /* Head lock still held and bh's disabled */ |
2672 |
+@@ -859,7 +865,7 @@ ok: |
2673 |
+ int inet_hash_connect(struct inet_timewait_death_row *death_row, |
2674 |
+ struct sock *sk) |
2675 |
+ { |
2676 |
+- u32 port_offset = 0; |
2677 |
++ u64 port_offset = 0; |
2678 |
+ |
2679 |
+ if (!inet_sk(sk)->inet_num) |
2680 |
+ port_offset = inet_sk_port_offset(sk); |
2681 |
+@@ -909,6 +915,12 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name, |
2682 |
+ low_limit, |
2683 |
+ high_limit); |
2684 |
+ init_hashinfo_lhash2(h); |
2685 |
++ |
2686 |
++ /* this one is used for source ports of outgoing connections */ |
2687 |
++ table_perturb = kmalloc_array(INET_TABLE_PERTURB_SIZE, |
2688 |
++ sizeof(*table_perturb), GFP_KERNEL); |
2689 |
++ if (!table_perturb) |
2690 |
++ panic("TCP: failed to alloc table_perturb"); |
2691 |
+ } |
2692 |
+ |
2693 |
+ int inet_hashinfo2_init_mod(struct inet_hashinfo *h) |
2694 |
+diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c |
2695 |
+index 36e89b6873876..c4a2565da2806 100644 |
2696 |
+--- a/net/ipv4/ping.c |
2697 |
++++ b/net/ipv4/ping.c |
2698 |
+@@ -305,6 +305,7 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk, |
2699 |
+ struct net *net = sock_net(sk); |
2700 |
+ if (sk->sk_family == AF_INET) { |
2701 |
+ struct sockaddr_in *addr = (struct sockaddr_in *) uaddr; |
2702 |
++ u32 tb_id = RT_TABLE_LOCAL; |
2703 |
+ int chk_addr_ret; |
2704 |
+ |
2705 |
+ if (addr_len < sizeof(*addr)) |
2706 |
+@@ -320,8 +321,10 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk, |
2707 |
+ |
2708 |
+ if (addr->sin_addr.s_addr == htonl(INADDR_ANY)) |
2709 |
+ chk_addr_ret = RTN_LOCAL; |
2710 |
+- else |
2711 |
+- chk_addr_ret = inet_addr_type(net, addr->sin_addr.s_addr); |
2712 |
++ else { |
2713 |
++ tb_id = l3mdev_fib_table_by_index(net, sk->sk_bound_dev_if) ? : tb_id; |
2714 |
++ chk_addr_ret = inet_addr_type_table(net, addr->sin_addr.s_addr, tb_id); |
2715 |
++ } |
2716 |
+ |
2717 |
+ if ((!inet_can_nonlocal_bind(net, isk) && |
2718 |
+ chk_addr_ret != RTN_LOCAL) || |
2719 |
+@@ -359,6 +362,14 @@ static int ping_check_bind_addr(struct sock *sk, struct inet_sock *isk, |
2720 |
+ return -ENODEV; |
2721 |
+ } |
2722 |
+ } |
2723 |
++ |
2724 |
++ if (!dev && sk->sk_bound_dev_if) { |
2725 |
++ dev = dev_get_by_index_rcu(net, sk->sk_bound_dev_if); |
2726 |
++ if (!dev) { |
2727 |
++ rcu_read_unlock(); |
2728 |
++ return -ENODEV; |
2729 |
++ } |
2730 |
++ } |
2731 |
+ has_addr = pingv6_ops.ipv6_chk_addr(net, &addr->sin6_addr, dev, |
2732 |
+ scoped); |
2733 |
+ rcu_read_unlock(); |
2734 |
+diff --git a/net/ipv4/route.c b/net/ipv4/route.c |
2735 |
+index ed9b6842a9a0c..6e8020a3bd677 100644 |
2736 |
+--- a/net/ipv4/route.c |
2737 |
++++ b/net/ipv4/route.c |
2738 |
+@@ -1754,6 +1754,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr, |
2739 |
+ #endif |
2740 |
+ RT_CACHE_STAT_INC(in_slow_mc); |
2741 |
+ |
2742 |
++ skb_dst_drop(skb); |
2743 |
+ skb_dst_set(skb, &rth->dst); |
2744 |
+ return 0; |
2745 |
+ } |
2746 |
+diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c |
2747 |
+index 0a2e7f2283911..40203255ed88b 100644 |
2748 |
+--- a/net/ipv6/inet6_hashtables.c |
2749 |
++++ b/net/ipv6/inet6_hashtables.c |
2750 |
+@@ -308,7 +308,7 @@ not_unique: |
2751 |
+ return -EADDRNOTAVAIL; |
2752 |
+ } |
2753 |
+ |
2754 |
+-static u32 inet6_sk_port_offset(const struct sock *sk) |
2755 |
++static u64 inet6_sk_port_offset(const struct sock *sk) |
2756 |
+ { |
2757 |
+ const struct inet_sock *inet = inet_sk(sk); |
2758 |
+ |
2759 |
+@@ -320,7 +320,7 @@ static u32 inet6_sk_port_offset(const struct sock *sk) |
2760 |
+ int inet6_hash_connect(struct inet_timewait_death_row *death_row, |
2761 |
+ struct sock *sk) |
2762 |
+ { |
2763 |
+- u32 port_offset = 0; |
2764 |
++ u64 port_offset = 0; |
2765 |
+ |
2766 |
+ if (!inet_sk(sk)->inet_num) |
2767 |
+ port_offset = inet6_sk_port_offset(sk); |
2768 |
+diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c |
2769 |
+index c8332452c1182..1548f532dc1ad 100644 |
2770 |
+--- a/net/mac80211/mlme.c |
2771 |
++++ b/net/mac80211/mlme.c |
2772 |
+@@ -3541,6 +3541,12 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, |
2773 |
+ cbss->transmitted_bss->bssid); |
2774 |
+ bss_conf->bssid_indicator = cbss->max_bssid_indicator; |
2775 |
+ bss_conf->bssid_index = cbss->bssid_index; |
2776 |
++ } else { |
2777 |
++ bss_conf->nontransmitted = false; |
2778 |
++ memset(bss_conf->transmitter_bssid, 0, |
2779 |
++ sizeof(bss_conf->transmitter_bssid)); |
2780 |
++ bss_conf->bssid_indicator = 0; |
2781 |
++ bss_conf->bssid_index = 0; |
2782 |
+ } |
2783 |
+ |
2784 |
+ /* |
2785 |
+diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c |
2786 |
+index fb7f7b17c78c0..974d32632ef41 100644 |
2787 |
+--- a/net/netlink/af_netlink.c |
2788 |
++++ b/net/netlink/af_netlink.c |
2789 |
+@@ -1996,7 +1996,6 @@ static int netlink_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, |
2790 |
+ copied = len; |
2791 |
+ } |
2792 |
+ |
2793 |
+- skb_reset_transport_header(data_skb); |
2794 |
+ err = skb_copy_datagram_msg(data_skb, 0, msg, copied); |
2795 |
+ |
2796 |
+ if (msg->msg_name) { |
2797 |
+diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c |
2798 |
+index c6c862c459cc3..cfadd613644a5 100644 |
2799 |
+--- a/net/sched/act_pedit.c |
2800 |
++++ b/net/sched/act_pedit.c |
2801 |
+@@ -149,7 +149,7 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla, |
2802 |
+ struct nlattr *pattr; |
2803 |
+ struct tcf_pedit *p; |
2804 |
+ int ret = 0, err; |
2805 |
+- int ksize; |
2806 |
++ int i, ksize; |
2807 |
+ u32 index; |
2808 |
+ |
2809 |
+ if (!nla) { |
2810 |
+@@ -228,6 +228,18 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla, |
2811 |
+ p->tcfp_nkeys = parm->nkeys; |
2812 |
+ } |
2813 |
+ memcpy(p->tcfp_keys, parm->keys, ksize); |
2814 |
++ p->tcfp_off_max_hint = 0; |
2815 |
++ for (i = 0; i < p->tcfp_nkeys; ++i) { |
2816 |
++ u32 cur = p->tcfp_keys[i].off; |
2817 |
++ |
2818 |
++ /* The AT option can read a single byte, we can bound the actual |
2819 |
++ * value with uchar max. |
2820 |
++ */ |
2821 |
++ cur += (0xff & p->tcfp_keys[i].offmask) >> p->tcfp_keys[i].shift; |
2822 |
++ |
2823 |
++ /* Each key touches 4 bytes starting from the computed offset */ |
2824 |
++ p->tcfp_off_max_hint = max(p->tcfp_off_max_hint, cur + 4); |
2825 |
++ } |
2826 |
+ |
2827 |
+ p->tcfp_flags = parm->flags; |
2828 |
+ goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch); |
2829 |
+@@ -308,13 +320,18 @@ static int tcf_pedit_act(struct sk_buff *skb, const struct tc_action *a, |
2830 |
+ struct tcf_result *res) |
2831 |
+ { |
2832 |
+ struct tcf_pedit *p = to_pedit(a); |
2833 |
++ u32 max_offset; |
2834 |
+ int i; |
2835 |
+ |
2836 |
+- if (skb_unclone(skb, GFP_ATOMIC)) |
2837 |
+- return p->tcf_action; |
2838 |
+- |
2839 |
+ spin_lock(&p->tcf_lock); |
2840 |
+ |
2841 |
++ max_offset = (skb_transport_header_was_set(skb) ? |
2842 |
++ skb_transport_offset(skb) : |
2843 |
++ skb_network_offset(skb)) + |
2844 |
++ p->tcfp_off_max_hint; |
2845 |
++ if (skb_ensure_writable(skb, min(skb->len, max_offset))) |
2846 |
++ goto unlock; |
2847 |
++ |
2848 |
+ tcf_lastuse_update(&p->tcf_tm); |
2849 |
+ |
2850 |
+ if (p->tcfp_nkeys > 0) { |
2851 |
+@@ -403,6 +420,7 @@ bad: |
2852 |
+ p->tcf_qstats.overlimits++; |
2853 |
+ done: |
2854 |
+ bstats_update(&p->tcf_bstats, skb); |
2855 |
++unlock: |
2856 |
+ spin_unlock(&p->tcf_lock); |
2857 |
+ return p->tcf_action; |
2858 |
+ } |
2859 |
+diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c |
2860 |
+index 170b733bc7367..45b0575520da4 100644 |
2861 |
+--- a/net/smc/smc_rx.c |
2862 |
++++ b/net/smc/smc_rx.c |
2863 |
+@@ -354,12 +354,12 @@ int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, |
2864 |
+ } |
2865 |
+ break; |
2866 |
+ } |
2867 |
++ if (!timeo) |
2868 |
++ return -EAGAIN; |
2869 |
+ if (signal_pending(current)) { |
2870 |
+ read_done = sock_intr_errno(timeo); |
2871 |
+ break; |
2872 |
+ } |
2873 |
+- if (!timeo) |
2874 |
+- return -EAGAIN; |
2875 |
+ } |
2876 |
+ |
2877 |
+ if (!smc_rx_data_available(conn)) { |
2878 |
+diff --git a/net/sunrpc/auth_gss/gss_rpc_upcall.c b/net/sunrpc/auth_gss/gss_rpc_upcall.c |
2879 |
+index 61c276bddaf25..f549e4c05defc 100644 |
2880 |
+--- a/net/sunrpc/auth_gss/gss_rpc_upcall.c |
2881 |
++++ b/net/sunrpc/auth_gss/gss_rpc_upcall.c |
2882 |
+@@ -98,6 +98,7 @@ static int gssp_rpc_create(struct net *net, struct rpc_clnt **_clnt) |
2883 |
+ * done without the correct namespace: |
2884 |
+ */ |
2885 |
+ .flags = RPC_CLNT_CREATE_NOPING | |
2886 |
++ RPC_CLNT_CREATE_CONNECTED | |
2887 |
+ RPC_CLNT_CREATE_NO_IDLE_TIMEOUT |
2888 |
+ }; |
2889 |
+ struct rpc_clnt *clnt; |
2890 |
+diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c |
2891 |
+index e4b9a38f12e07..0a0818e55879a 100644 |
2892 |
+--- a/net/sunrpc/clnt.c |
2893 |
++++ b/net/sunrpc/clnt.c |
2894 |
+@@ -76,6 +76,7 @@ static int rpc_encode_header(struct rpc_task *task, |
2895 |
+ static int rpc_decode_header(struct rpc_task *task, |
2896 |
+ struct xdr_stream *xdr); |
2897 |
+ static int rpc_ping(struct rpc_clnt *clnt); |
2898 |
++static int rpc_ping_noreply(struct rpc_clnt *clnt); |
2899 |
+ static void rpc_check_timeout(struct rpc_task *task); |
2900 |
+ |
2901 |
+ static void rpc_register_client(struct rpc_clnt *clnt) |
2902 |
+@@ -483,6 +484,12 @@ static struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args, |
2903 |
+ rpc_shutdown_client(clnt); |
2904 |
+ return ERR_PTR(err); |
2905 |
+ } |
2906 |
++ } else if (args->flags & RPC_CLNT_CREATE_CONNECTED) { |
2907 |
++ int err = rpc_ping_noreply(clnt); |
2908 |
++ if (err != 0) { |
2909 |
++ rpc_shutdown_client(clnt); |
2910 |
++ return ERR_PTR(err); |
2911 |
++ } |
2912 |
+ } |
2913 |
+ |
2914 |
+ clnt->cl_softrtry = 1; |
2915 |
+@@ -2704,6 +2711,10 @@ static const struct rpc_procinfo rpcproc_null = { |
2916 |
+ .p_decode = rpcproc_decode_null, |
2917 |
+ }; |
2918 |
+ |
2919 |
++static const struct rpc_procinfo rpcproc_null_noreply = { |
2920 |
++ .p_encode = rpcproc_encode_null, |
2921 |
++}; |
2922 |
++ |
2923 |
+ static void |
2924 |
+ rpc_null_call_prepare(struct rpc_task *task, void *data) |
2925 |
+ { |
2926 |
+@@ -2757,6 +2768,28 @@ static int rpc_ping(struct rpc_clnt *clnt) |
2927 |
+ return status; |
2928 |
+ } |
2929 |
+ |
2930 |
++static int rpc_ping_noreply(struct rpc_clnt *clnt) |
2931 |
++{ |
2932 |
++ struct rpc_message msg = { |
2933 |
++ .rpc_proc = &rpcproc_null_noreply, |
2934 |
++ }; |
2935 |
++ struct rpc_task_setup task_setup_data = { |
2936 |
++ .rpc_client = clnt, |
2937 |
++ .rpc_message = &msg, |
2938 |
++ .callback_ops = &rpc_null_ops, |
2939 |
++ .flags = RPC_TASK_SOFT | RPC_TASK_SOFTCONN | RPC_TASK_NULLCREDS, |
2940 |
++ }; |
2941 |
++ struct rpc_task *task; |
2942 |
++ int status; |
2943 |
++ |
2944 |
++ task = rpc_run_task(&task_setup_data); |
2945 |
++ if (IS_ERR(task)) |
2946 |
++ return PTR_ERR(task); |
2947 |
++ status = task->tk_status; |
2948 |
++ rpc_put_task(task); |
2949 |
++ return status; |
2950 |
++} |
2951 |
++ |
2952 |
+ struct rpc_cb_add_xprt_calldata { |
2953 |
+ struct rpc_xprt_switch *xps; |
2954 |
+ struct rpc_xprt *xprt; |
2955 |
+diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c |
2956 |
+index e4adb780b69e8..2db834318d141 100644 |
2957 |
+--- a/net/sunrpc/xprt.c |
2958 |
++++ b/net/sunrpc/xprt.c |
2959 |
+@@ -929,12 +929,7 @@ void xprt_connect(struct rpc_task *task) |
2960 |
+ if (!xprt_lock_write(xprt, task)) |
2961 |
+ return; |
2962 |
+ |
2963 |
+- if (test_and_clear_bit(XPRT_CLOSE_WAIT, &xprt->state)) { |
2964 |
+- trace_xprt_disconnect_cleanup(xprt); |
2965 |
+- xprt->ops->close(xprt); |
2966 |
+- } |
2967 |
+- |
2968 |
+- if (!xprt_connected(xprt)) { |
2969 |
++ if (!xprt_connected(xprt) && !test_bit(XPRT_CLOSE_WAIT, &xprt->state)) { |
2970 |
+ task->tk_rqstp->rq_connect_cookie = xprt->connect_cookie; |
2971 |
+ rpc_sleep_on_timeout(&xprt->pending, task, NULL, |
2972 |
+ xprt_request_timeout(task->tk_rqstp)); |
2973 |
+diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c |
2974 |
+index 95a86f3fb5c6b..897dfce7dd271 100644 |
2975 |
+--- a/net/sunrpc/xprtsock.c |
2976 |
++++ b/net/sunrpc/xprtsock.c |
2977 |
+@@ -880,7 +880,7 @@ static int xs_local_send_request(struct rpc_rqst *req) |
2978 |
+ |
2979 |
+ /* Close the stream if the previous transmission was incomplete */ |
2980 |
+ if (xs_send_request_was_aborted(transport, req)) { |
2981 |
+- xs_close(xprt); |
2982 |
++ xprt_force_disconnect(xprt); |
2983 |
+ return -ENOTCONN; |
2984 |
+ } |
2985 |
+ |
2986 |
+@@ -918,7 +918,7 @@ static int xs_local_send_request(struct rpc_rqst *req) |
2987 |
+ -status); |
2988 |
+ fallthrough; |
2989 |
+ case -EPIPE: |
2990 |
+- xs_close(xprt); |
2991 |
++ xprt_force_disconnect(xprt); |
2992 |
+ status = -ENOTCONN; |
2993 |
+ } |
2994 |
+ |
2995 |
+@@ -1205,6 +1205,16 @@ static void xs_reset_transport(struct sock_xprt *transport) |
2996 |
+ |
2997 |
+ if (sk == NULL) |
2998 |
+ return; |
2999 |
++ /* |
3000 |
++ * Make sure we're calling this in a context from which it is safe |
3001 |
++ * to call __fput_sync(). In practice that means rpciod and the |
3002 |
++ * system workqueue. |
3003 |
++ */ |
3004 |
++ if (!(current->flags & PF_WQ_WORKER)) { |
3005 |
++ WARN_ON_ONCE(1); |
3006 |
++ set_bit(XPRT_CLOSE_WAIT, &xprt->state); |
3007 |
++ return; |
3008 |
++ } |
3009 |
+ |
3010 |
+ if (atomic_read(&transport->xprt.swapper)) |
3011 |
+ sk_clear_memalloc(sk); |
3012 |
+@@ -1228,7 +1238,7 @@ static void xs_reset_transport(struct sock_xprt *transport) |
3013 |
+ mutex_unlock(&transport->recv_mutex); |
3014 |
+ |
3015 |
+ trace_rpc_socket_close(xprt, sock); |
3016 |
+- fput(filp); |
3017 |
++ __fput_sync(filp); |
3018 |
+ |
3019 |
+ xprt_disconnect_done(xprt); |
3020 |
+ } |
3021 |
+diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c |
3022 |
+index a40553e83f8b2..f3e3d009cf1cf 100644 |
3023 |
+--- a/net/tls/tls_device.c |
3024 |
++++ b/net/tls/tls_device.c |
3025 |
+@@ -1347,7 +1347,10 @@ static int tls_device_down(struct net_device *netdev) |
3026 |
+ |
3027 |
+ /* Device contexts for RX and TX will be freed in on sk_destruct |
3028 |
+ * by tls_device_free_ctx. rx_conf and tx_conf stay in TLS_HW. |
3029 |
++ * Now release the ref taken above. |
3030 |
+ */ |
3031 |
++ if (refcount_dec_and_test(&ctx->refcount)) |
3032 |
++ tls_device_free_ctx(ctx); |
3033 |
+ } |
3034 |
+ |
3035 |
+ up_write(&device_offload_lock); |
3036 |
+diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c |
3037 |
+index b45ec35cd63c3..62b41ca050a20 100644 |
3038 |
+--- a/sound/soc/codecs/max98090.c |
3039 |
++++ b/sound/soc/codecs/max98090.c |
3040 |
+@@ -413,6 +413,9 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, |
3041 |
+ |
3042 |
+ val = (val >> mc->shift) & mask; |
3043 |
+ |
3044 |
++ if (sel < 0 || sel > mc->max) |
3045 |
++ return -EINVAL; |
3046 |
++ |
3047 |
+ *select = sel; |
3048 |
+ |
3049 |
+ /* Setting a volume is only valid if it is already On */ |
3050 |
+@@ -427,7 +430,7 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, |
3051 |
+ mask << mc->shift, |
3052 |
+ sel << mc->shift); |
3053 |
+ |
3054 |
+- return 0; |
3055 |
++ return *select != val; |
3056 |
+ } |
3057 |
+ |
3058 |
+ static const char *max98090_perf_pwr_text[] = |
3059 |
+diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c |
3060 |
+index 63ee35ebeaabb..f32ba64c5ddab 100644 |
3061 |
+--- a/sound/soc/soc-ops.c |
3062 |
++++ b/sound/soc/soc-ops.c |
3063 |
+@@ -519,7 +519,15 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, |
3064 |
+ unsigned int mask = (1 << fls(max)) - 1; |
3065 |
+ unsigned int invert = mc->invert; |
3066 |
+ unsigned int val, val_mask; |
3067 |
+- int err, ret; |
3068 |
++ int err, ret, tmp; |
3069 |
++ |
3070 |
++ tmp = ucontrol->value.integer.value[0]; |
3071 |
++ if (tmp < 0) |
3072 |
++ return -EINVAL; |
3073 |
++ if (mc->platform_max && tmp > mc->platform_max) |
3074 |
++ return -EINVAL; |
3075 |
++ if (tmp > mc->max - mc->min + 1) |
3076 |
++ return -EINVAL; |
3077 |
+ |
3078 |
+ if (invert) |
3079 |
+ val = (max - ucontrol->value.integer.value[0]) & mask; |
3080 |
+@@ -534,6 +542,14 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, |
3081 |
+ ret = err; |
3082 |
+ |
3083 |
+ if (snd_soc_volsw_is_stereo(mc)) { |
3084 |
++ tmp = ucontrol->value.integer.value[1]; |
3085 |
++ if (tmp < 0) |
3086 |
++ return -EINVAL; |
3087 |
++ if (mc->platform_max && tmp > mc->platform_max) |
3088 |
++ return -EINVAL; |
3089 |
++ if (tmp > mc->max - mc->min + 1) |
3090 |
++ return -EINVAL; |
3091 |
++ |
3092 |
+ if (invert) |
3093 |
+ val = (max - ucontrol->value.integer.value[1]) & mask; |
3094 |
+ else |
3095 |
+diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c |
3096 |
+index bc9e707656789..b773289c928d4 100644 |
3097 |
+--- a/sound/soc/sof/sof-pci-dev.c |
3098 |
++++ b/sound/soc/sof/sof-pci-dev.c |
3099 |
+@@ -129,6 +129,11 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) |
3100 |
+ |
3101 |
+ dev_dbg(&pci->dev, "PCI DSP detected"); |
3102 |
+ |
3103 |
++ if (!desc) { |
3104 |
++ dev_err(dev, "error: no matching PCI descriptor\n"); |
3105 |
++ return -ENODEV; |
3106 |
++ } |
3107 |
++ |
3108 |
+ if (!desc->ops) { |
3109 |
+ dev_err(dev, "error: no matching PCI descriptor ops\n"); |
3110 |
+ return -ENODEV; |
3111 |
+diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile |
3112 |
+index a7fde142e8146..d8ae7cc012749 100644 |
3113 |
+--- a/tools/testing/selftests/vm/Makefile |
3114 |
++++ b/tools/testing/selftests/vm/Makefile |
3115 |
+@@ -54,9 +54,9 @@ CAN_BUILD_I386 := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_32bit_prog |
3116 |
+ CAN_BUILD_X86_64 := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_64bit_program.c) |
3117 |
+ CAN_BUILD_WITH_NOPIE := $(shell ./../x86/check_cc.sh "$(CC)" ../x86/trivial_program.c -no-pie) |
3118 |
+ |
3119 |
+-TARGETS := protection_keys |
3120 |
+-BINARIES_32 := $(TARGETS:%=%_32) |
3121 |
+-BINARIES_64 := $(TARGETS:%=%_64) |
3122 |
++VMTARGETS := protection_keys |
3123 |
++BINARIES_32 := $(VMTARGETS:%=%_32) |
3124 |
++BINARIES_64 := $(VMTARGETS:%=%_64) |
3125 |
+ |
3126 |
+ ifeq ($(CAN_BUILD_WITH_NOPIE),1) |
3127 |
+ CFLAGS += -no-pie |
3128 |
+@@ -109,7 +109,7 @@ $(BINARIES_32): CFLAGS += -m32 -mxsave |
3129 |
+ $(BINARIES_32): LDLIBS += -lrt -ldl -lm |
3130 |
+ $(BINARIES_32): $(OUTPUT)/%_32: %.c |
3131 |
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@ |
3132 |
+-$(foreach t,$(TARGETS),$(eval $(call gen-target-rule-32,$(t)))) |
3133 |
++$(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-32,$(t)))) |
3134 |
+ endif |
3135 |
+ |
3136 |
+ ifeq ($(CAN_BUILD_X86_64),1) |
3137 |
+@@ -117,7 +117,7 @@ $(BINARIES_64): CFLAGS += -m64 -mxsave |
3138 |
+ $(BINARIES_64): LDLIBS += -lrt -ldl |
3139 |
+ $(BINARIES_64): $(OUTPUT)/%_64: %.c |
3140 |
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(notdir $^) $(LDLIBS) -o $@ |
3141 |
+-$(foreach t,$(TARGETS),$(eval $(call gen-target-rule-64,$(t)))) |
3142 |
++$(foreach t,$(VMTARGETS),$(eval $(call gen-target-rule-64,$(t)))) |
3143 |
+ endif |
3144 |
+ |
3145 |
+ # x86_64 users should be encouraged to install 32-bit libraries |