1 |
commit: f61861b22544740f604006aa8cbfe1c734790cae |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 5 12:02:27 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 5 12:02:27 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f61861b2 |
7 |
|
8 |
Linux patch 5.19.7 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1006_linux-5.19.7.patch | 3011 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 3015 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 3deab328..e6423950 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -67,6 +67,10 @@ Patch: 1005_linux-5.19.6.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.19.6 |
23 |
|
24 |
+Patch: 1006_linux-5.19.7.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.19.7 |
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/1006_linux-5.19.7.patch b/1006_linux-5.19.7.patch |
33 |
new file mode 100644 |
34 |
index 00000000..db3fad36 |
35 |
--- /dev/null |
36 |
+++ b/1006_linux-5.19.7.patch |
37 |
@@ -0,0 +1,3011 @@ |
38 |
+diff --git a/Documentation/arm64/silicon-errata.rst b/Documentation/arm64/silicon-errata.rst |
39 |
+index 0b4235b1f8c46..33b04db8408f9 100644 |
40 |
+--- a/Documentation/arm64/silicon-errata.rst |
41 |
++++ b/Documentation/arm64/silicon-errata.rst |
42 |
+@@ -106,6 +106,8 @@ stable kernels. |
43 |
+ +----------------+-----------------+-----------------+-----------------------------+ |
44 |
+ | ARM | Cortex-A510 | #2077057 | ARM64_ERRATUM_2077057 | |
45 |
+ +----------------+-----------------+-----------------+-----------------------------+ |
46 |
++| ARM | Cortex-A510 | #2441009 | ARM64_ERRATUM_2441009 | |
47 |
+++----------------+-----------------+-----------------+-----------------------------+ |
48 |
+ | ARM | Cortex-A710 | #2119858 | ARM64_ERRATUM_2119858 | |
49 |
+ +----------------+-----------------+-----------------+-----------------------------+ |
50 |
+ | ARM | Cortex-A710 | #2054223 | ARM64_ERRATUM_2054223 | |
51 |
+diff --git a/Documentation/sphinx/kerneldoc-preamble.sty b/Documentation/sphinx/kerneldoc-preamble.sty |
52 |
+index 2a29cbe51396d..9707e033c8c45 100644 |
53 |
+--- a/Documentation/sphinx/kerneldoc-preamble.sty |
54 |
++++ b/Documentation/sphinx/kerneldoc-preamble.sty |
55 |
+@@ -70,8 +70,16 @@ |
56 |
+ |
57 |
+ % Translations have Asian (CJK) characters which are only displayed if |
58 |
+ % xeCJK is used |
59 |
++\usepackage{ifthen} |
60 |
++\newboolean{enablecjk} |
61 |
++\setboolean{enablecjk}{false} |
62 |
+ \IfFontExistsTF{Noto Sans CJK SC}{ |
63 |
+- % Load xeCJK when CJK font is available |
64 |
++ \IfFileExists{xeCJK.sty}{ |
65 |
++ \setboolean{enablecjk}{true} |
66 |
++ }{} |
67 |
++}{} |
68 |
++\ifthenelse{\boolean{enablecjk}}{ |
69 |
++ % Load xeCJK when both the Noto Sans CJK font and xeCJK.sty are available. |
70 |
+ \usepackage{xeCJK} |
71 |
+ % Noto CJK fonts don't provide slant shape. [AutoFakeSlant] permits |
72 |
+ % its emulation. |
73 |
+@@ -196,7 +204,7 @@ |
74 |
+ % Inactivate CJK after tableofcontents |
75 |
+ \apptocmd{\sphinxtableofcontents}{\kerneldocCJKoff}{}{} |
76 |
+ \xeCJKsetup{CJKspace = true}% For inter-phrase space of Korean TOC |
77 |
+-}{ % No CJK font found |
78 |
++}{ % Don't enable CJK |
79 |
+ % Custom macros to on/off CJK and switch CJK fonts (Dummy) |
80 |
+ \newcommand{\kerneldocCJKon}{} |
81 |
+ \newcommand{\kerneldocCJKoff}{} |
82 |
+@@ -204,14 +212,16 @@ |
83 |
+ %% and ignore the argument (#1) in their definitions, whole contents of |
84 |
+ %% CJK chapters can be ignored. |
85 |
+ \newcommand{\kerneldocBeginSC}[1]{% |
86 |
+- %% Put a note on missing CJK fonts in place of zh_CN translation. |
87 |
+- \begin{sphinxadmonition}{note}{Note on missing fonts:} |
88 |
++ %% Put a note on missing CJK fonts or the xecjk package in place of |
89 |
++ %% zh_CN translation. |
90 |
++ \begin{sphinxadmonition}{note}{Note on missing fonts and a package:} |
91 |
+ Translations of Simplified Chinese (zh\_CN), Traditional Chinese |
92 |
+ (zh\_TW), Korean (ko\_KR), and Japanese (ja\_JP) were skipped |
93 |
+- due to the lack of suitable font families. |
94 |
++ due to the lack of suitable font families and/or the texlive-xecjk |
95 |
++ package. |
96 |
+ |
97 |
+ If you want them, please install ``Noto Sans CJK'' font families |
98 |
+- by following instructions from |
99 |
++ along with the texlive-xecjk package by following instructions from |
100 |
+ \sphinxcode{./scripts/sphinx-pre-install}. |
101 |
+ Having optional ``Noto Serif CJK'' font families will improve |
102 |
+ the looks of those translations. |
103 |
+diff --git a/Documentation/tools/rtla/rtla-timerlat-hist.rst b/Documentation/tools/rtla/rtla-timerlat-hist.rst |
104 |
+index e12eae1f33019..6bf7f0ca45564 100644 |
105 |
+--- a/Documentation/tools/rtla/rtla-timerlat-hist.rst |
106 |
++++ b/Documentation/tools/rtla/rtla-timerlat-hist.rst |
107 |
+@@ -33,7 +33,7 @@ EXAMPLE |
108 |
+ ======= |
109 |
+ In the example below, **rtla timerlat hist** is set to run for *10* minutes, |
110 |
+ in the cpus *0-4*, *skipping zero* only lines. Moreover, **rtla timerlat |
111 |
+-hist** will change the priority of the *timelat* threads to run under |
112 |
++hist** will change the priority of the *timerlat* threads to run under |
113 |
+ *SCHED_DEADLINE* priority, with a *10us* runtime every *1ms* period. The |
114 |
+ *1ms* period is also passed to the *timerlat* tracer:: |
115 |
+ |
116 |
+diff --git a/Makefile b/Makefile |
117 |
+index cb68101ea070a..3d88923df694e 100644 |
118 |
+--- a/Makefile |
119 |
++++ b/Makefile |
120 |
+@@ -1,7 +1,7 @@ |
121 |
+ # SPDX-License-Identifier: GPL-2.0 |
122 |
+ VERSION = 5 |
123 |
+ PATCHLEVEL = 19 |
124 |
+-SUBLEVEL = 6 |
125 |
++SUBLEVEL = 7 |
126 |
+ EXTRAVERSION = |
127 |
+ NAME = Superb Owl |
128 |
+ |
129 |
+diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig |
130 |
+index a5d1b561ed53f..001eaba5a6b4b 100644 |
131 |
+--- a/arch/arm64/Kconfig |
132 |
++++ b/arch/arm64/Kconfig |
133 |
+@@ -838,6 +838,23 @@ config ARM64_ERRATUM_2224489 |
134 |
+ |
135 |
+ If unsure, say Y. |
136 |
+ |
137 |
++config ARM64_ERRATUM_2441009 |
138 |
++ bool "Cortex-A510: Completion of affected memory accesses might not be guaranteed by completion of a TLBI" |
139 |
++ default y |
140 |
++ select ARM64_WORKAROUND_REPEAT_TLBI |
141 |
++ help |
142 |
++ This option adds a workaround for ARM Cortex-A510 erratum #2441009. |
143 |
++ |
144 |
++ Under very rare circumstances, affected Cortex-A510 CPUs |
145 |
++ may not handle a race between a break-before-make sequence on one |
146 |
++ CPU, and another CPU accessing the same page. This could allow a |
147 |
++ store to a page that has been unmapped. |
148 |
++ |
149 |
++ Work around this by adding the affected CPUs to the list that needs |
150 |
++ TLB sequences to be done twice. |
151 |
++ |
152 |
++ If unsure, say Y. |
153 |
++ |
154 |
+ config ARM64_ERRATUM_2064142 |
155 |
+ bool "Cortex-A510: 2064142: workaround TRBE register writes while disabled" |
156 |
+ depends on CORESIGHT_TRBE |
157 |
+diff --git a/arch/arm64/kernel/cacheinfo.c b/arch/arm64/kernel/cacheinfo.c |
158 |
+index 587543c6c51cb..97c42be71338a 100644 |
159 |
+--- a/arch/arm64/kernel/cacheinfo.c |
160 |
++++ b/arch/arm64/kernel/cacheinfo.c |
161 |
+@@ -45,7 +45,8 @@ static void ci_leaf_init(struct cacheinfo *this_leaf, |
162 |
+ |
163 |
+ int init_cache_level(unsigned int cpu) |
164 |
+ { |
165 |
+- unsigned int ctype, level, leaves, fw_level; |
166 |
++ unsigned int ctype, level, leaves; |
167 |
++ int fw_level; |
168 |
+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); |
169 |
+ |
170 |
+ for (level = 1, leaves = 0; level <= MAX_CACHE_LEVEL; level++) { |
171 |
+@@ -63,6 +64,9 @@ int init_cache_level(unsigned int cpu) |
172 |
+ else |
173 |
+ fw_level = acpi_find_last_cache_level(cpu); |
174 |
+ |
175 |
++ if (fw_level < 0) |
176 |
++ return fw_level; |
177 |
++ |
178 |
+ if (level < fw_level) { |
179 |
+ /* |
180 |
+ * some external caches not specified in CLIDR_EL1 |
181 |
+diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c |
182 |
+index b374e258f705f..5f4117dae8888 100644 |
183 |
+--- a/arch/arm64/kernel/cpu_errata.c |
184 |
++++ b/arch/arm64/kernel/cpu_errata.c |
185 |
+@@ -213,6 +213,12 @@ static const struct arm64_cpu_capabilities arm64_repeat_tlbi_list[] = { |
186 |
+ /* Kryo4xx Gold (rcpe to rfpe) => (r0p0 to r3p0) */ |
187 |
+ ERRATA_MIDR_RANGE(MIDR_QCOM_KRYO_4XX_GOLD, 0xc, 0xe, 0xf, 0xe), |
188 |
+ }, |
189 |
++#endif |
190 |
++#ifdef CONFIG_ARM64_ERRATUM_2441009 |
191 |
++ { |
192 |
++ /* Cortex-A510 r0p0 -> r1p1. Fixed in r1p2 */ |
193 |
++ ERRATA_MIDR_RANGE(MIDR_CORTEX_A510, 0, 0, 1, 1), |
194 |
++ }, |
195 |
+ #endif |
196 |
+ {}, |
197 |
+ }; |
198 |
+@@ -490,7 +496,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = { |
199 |
+ #endif |
200 |
+ #ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI |
201 |
+ { |
202 |
+- .desc = "Qualcomm erratum 1009, or ARM erratum 1286807", |
203 |
++ .desc = "Qualcomm erratum 1009, or ARM erratum 1286807, 2441009", |
204 |
+ .capability = ARM64_WORKAROUND_REPEAT_TLBI, |
205 |
+ .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, |
206 |
+ .matches = cpucap_multi_entry_cap_matches, |
207 |
+diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c |
208 |
+index f0bc4dc3e9bf0..6511d15ace45e 100644 |
209 |
+--- a/arch/s390/hypfs/hypfs_diag.c |
210 |
++++ b/arch/s390/hypfs/hypfs_diag.c |
211 |
+@@ -437,7 +437,7 @@ __init int hypfs_diag_init(void) |
212 |
+ int rc; |
213 |
+ |
214 |
+ if (diag204_probe()) { |
215 |
+- pr_err("The hardware system does not support hypfs\n"); |
216 |
++ pr_info("The hardware system does not support hypfs\n"); |
217 |
+ return -ENODATA; |
218 |
+ } |
219 |
+ |
220 |
+diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c |
221 |
+index 5c97f48cea91d..ee919bfc81867 100644 |
222 |
+--- a/arch/s390/hypfs/inode.c |
223 |
++++ b/arch/s390/hypfs/inode.c |
224 |
+@@ -496,9 +496,9 @@ fail_hypfs_sprp_exit: |
225 |
+ hypfs_vm_exit(); |
226 |
+ fail_hypfs_diag_exit: |
227 |
+ hypfs_diag_exit(); |
228 |
++ pr_err("Initialization of hypfs failed with rc=%i\n", rc); |
229 |
+ fail_dbfs_exit: |
230 |
+ hypfs_dbfs_exit(); |
231 |
+- pr_err("Initialization of hypfs failed with rc=%i\n", rc); |
232 |
+ return rc; |
233 |
+ } |
234 |
+ device_initcall(hypfs_init) |
235 |
+diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c |
236 |
+index 7981a25983764..5d437c0c842cb 100644 |
237 |
+--- a/drivers/android/binder_alloc.c |
238 |
++++ b/drivers/android/binder_alloc.c |
239 |
+@@ -315,12 +315,19 @@ static inline void binder_alloc_set_vma(struct binder_alloc *alloc, |
240 |
+ { |
241 |
+ unsigned long vm_start = 0; |
242 |
+ |
243 |
++ /* |
244 |
++ * Allow clearing the vma with holding just the read lock to allow |
245 |
++ * munmapping downgrade of the write lock before freeing and closing the |
246 |
++ * file using binder_alloc_vma_close(). |
247 |
++ */ |
248 |
+ if (vma) { |
249 |
+ vm_start = vma->vm_start; |
250 |
+ alloc->vma_vm_mm = vma->vm_mm; |
251 |
++ mmap_assert_write_locked(alloc->vma_vm_mm); |
252 |
++ } else { |
253 |
++ mmap_assert_locked(alloc->vma_vm_mm); |
254 |
+ } |
255 |
+ |
256 |
+- mmap_assert_write_locked(alloc->vma_vm_mm); |
257 |
+ alloc->vma_addr = vm_start; |
258 |
+ } |
259 |
+ |
260 |
+diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c |
261 |
+index 9631f2fd2faf7..38e8767ec3715 100644 |
262 |
+--- a/drivers/dma-buf/udmabuf.c |
263 |
++++ b/drivers/dma-buf/udmabuf.c |
264 |
+@@ -368,7 +368,23 @@ static struct miscdevice udmabuf_misc = { |
265 |
+ |
266 |
+ static int __init udmabuf_dev_init(void) |
267 |
+ { |
268 |
+- return misc_register(&udmabuf_misc); |
269 |
++ int ret; |
270 |
++ |
271 |
++ ret = misc_register(&udmabuf_misc); |
272 |
++ if (ret < 0) { |
273 |
++ pr_err("Could not initialize udmabuf device\n"); |
274 |
++ return ret; |
275 |
++ } |
276 |
++ |
277 |
++ ret = dma_coerce_mask_and_coherent(udmabuf_misc.this_device, |
278 |
++ DMA_BIT_MASK(64)); |
279 |
++ if (ret < 0) { |
280 |
++ pr_err("Could not setup DMA mask for udmabuf device\n"); |
281 |
++ misc_deregister(&udmabuf_misc); |
282 |
++ return ret; |
283 |
++ } |
284 |
++ |
285 |
++ return 0; |
286 |
+ } |
287 |
+ |
288 |
+ static void __exit udmabuf_dev_exit(void) |
289 |
+diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c |
290 |
+index 5654c5e9862b1..037db21de510c 100644 |
291 |
+--- a/drivers/firmware/tegra/bpmp.c |
292 |
++++ b/drivers/firmware/tegra/bpmp.c |
293 |
+@@ -201,7 +201,7 @@ static ssize_t __tegra_bpmp_channel_read(struct tegra_bpmp_channel *channel, |
294 |
+ int err; |
295 |
+ |
296 |
+ if (data && size > 0) |
297 |
+- memcpy(data, channel->ib->data, size); |
298 |
++ memcpy_fromio(data, channel->ib->data, size); |
299 |
+ |
300 |
+ err = tegra_bpmp_ack_response(channel); |
301 |
+ if (err < 0) |
302 |
+@@ -245,7 +245,7 @@ static ssize_t __tegra_bpmp_channel_write(struct tegra_bpmp_channel *channel, |
303 |
+ channel->ob->flags = flags; |
304 |
+ |
305 |
+ if (data && size > 0) |
306 |
+- memcpy(channel->ob->data, data, size); |
307 |
++ memcpy_toio(channel->ob->data, data, size); |
308 |
+ |
309 |
+ return tegra_bpmp_post_request(channel); |
310 |
+ } |
311 |
+@@ -420,7 +420,7 @@ void tegra_bpmp_mrq_return(struct tegra_bpmp_channel *channel, int code, |
312 |
+ channel->ob->code = code; |
313 |
+ |
314 |
+ if (data && size > 0) |
315 |
+- memcpy(channel->ob->data, data, size); |
316 |
++ memcpy_toio(channel->ob->data, data, size); |
317 |
+ |
318 |
+ err = tegra_bpmp_post_response(channel); |
319 |
+ if (WARN_ON(err < 0)) |
320 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h |
321 |
+index 30ce6bb6fa77a..310754b1f6702 100644 |
322 |
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h |
323 |
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h |
324 |
+@@ -313,7 +313,7 @@ enum amdgpu_kiq_irq { |
325 |
+ AMDGPU_CP_KIQ_IRQ_DRIVER0 = 0, |
326 |
+ AMDGPU_CP_KIQ_IRQ_LAST |
327 |
+ }; |
328 |
+- |
329 |
++#define SRIOV_USEC_TIMEOUT 1200000 /* wait 12 * 100ms for SRIOV */ |
330 |
+ #define MAX_KIQ_REG_WAIT 5000 /* in usecs, 5ms */ |
331 |
+ #define MAX_KIQ_REG_BAILOUT_INTERVAL 5 /* in msecs, 5ms */ |
332 |
+ #define MAX_KIQ_REG_TRY 1000 |
333 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c |
334 |
+index 9077dfccaf3cf..809408c8c79a1 100644 |
335 |
+--- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c |
336 |
++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c |
337 |
+@@ -416,6 +416,7 @@ static int gmc_v10_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev, |
338 |
+ uint32_t seq; |
339 |
+ uint16_t queried_pasid; |
340 |
+ bool ret; |
341 |
++ u32 usec_timeout = amdgpu_sriov_vf(adev) ? SRIOV_USEC_TIMEOUT : adev->usec_timeout; |
342 |
+ struct amdgpu_ring *ring = &adev->gfx.kiq.ring; |
343 |
+ struct amdgpu_kiq *kiq = &adev->gfx.kiq; |
344 |
+ |
345 |
+@@ -434,7 +435,7 @@ static int gmc_v10_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev, |
346 |
+ |
347 |
+ amdgpu_ring_commit(ring); |
348 |
+ spin_unlock(&adev->gfx.kiq.ring_lock); |
349 |
+- r = amdgpu_fence_wait_polling(ring, seq, adev->usec_timeout); |
350 |
++ r = amdgpu_fence_wait_polling(ring, seq, usec_timeout); |
351 |
+ if (r < 1) { |
352 |
+ dev_err(adev->dev, "wait for kiq fence error: %ld.\n", r); |
353 |
+ return -ETIME; |
354 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c |
355 |
+index 22761a3bb8181..566c1243c051b 100644 |
356 |
+--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c |
357 |
++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c |
358 |
+@@ -896,6 +896,7 @@ static int gmc_v9_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev, |
359 |
+ uint32_t seq; |
360 |
+ uint16_t queried_pasid; |
361 |
+ bool ret; |
362 |
++ u32 usec_timeout = amdgpu_sriov_vf(adev) ? SRIOV_USEC_TIMEOUT : adev->usec_timeout; |
363 |
+ struct amdgpu_ring *ring = &adev->gfx.kiq.ring; |
364 |
+ struct amdgpu_kiq *kiq = &adev->gfx.kiq; |
365 |
+ |
366 |
+@@ -935,7 +936,7 @@ static int gmc_v9_0_flush_gpu_tlb_pasid(struct amdgpu_device *adev, |
367 |
+ |
368 |
+ amdgpu_ring_commit(ring); |
369 |
+ spin_unlock(&adev->gfx.kiq.ring_lock); |
370 |
+- r = amdgpu_fence_wait_polling(ring, seq, adev->usec_timeout); |
371 |
++ r = amdgpu_fence_wait_polling(ring, seq, usec_timeout); |
372 |
+ if (r < 1) { |
373 |
+ dev_err(adev->dev, "wait for kiq fence error: %ld.\n", r); |
374 |
+ up_read(&adev->reset_domain->sem); |
375 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c |
376 |
+index 92dc60a9d2094..085e613f3646d 100644 |
377 |
+--- a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c |
378 |
++++ b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c |
379 |
+@@ -727,6 +727,7 @@ static const struct amd_ip_funcs ih_v6_0_ip_funcs = { |
380 |
+ static const struct amdgpu_ih_funcs ih_v6_0_funcs = { |
381 |
+ .get_wptr = ih_v6_0_get_wptr, |
382 |
+ .decode_iv = amdgpu_ih_decode_iv_helper, |
383 |
++ .decode_iv_ts = amdgpu_ih_decode_iv_ts_helper, |
384 |
+ .set_rptr = ih_v6_0_set_rptr |
385 |
+ }; |
386 |
+ |
387 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c |
388 |
+index 4b5396d3e60f6..eec13cb5bf758 100644 |
389 |
+--- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c |
390 |
++++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c |
391 |
+@@ -409,9 +409,11 @@ static u32 navi10_ih_get_wptr(struct amdgpu_device *adev, |
392 |
+ u32 wptr, tmp; |
393 |
+ struct amdgpu_ih_regs *ih_regs; |
394 |
+ |
395 |
+- if (ih == &adev->irq.ih) { |
396 |
++ if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) { |
397 |
+ /* Only ring0 supports writeback. On other rings fall back |
398 |
+ * to register-based code with overflow checking below. |
399 |
++ * ih_soft ring doesn't have any backing hardware registers, |
400 |
++ * update wptr and return. |
401 |
+ */ |
402 |
+ wptr = le32_to_cpu(*ih->wptr_cpu); |
403 |
+ |
404 |
+@@ -483,6 +485,9 @@ static void navi10_ih_set_rptr(struct amdgpu_device *adev, |
405 |
+ { |
406 |
+ struct amdgpu_ih_regs *ih_regs; |
407 |
+ |
408 |
++ if (ih == &adev->irq.ih_soft) |
409 |
++ return; |
410 |
++ |
411 |
+ if (ih->use_doorbell) { |
412 |
+ /* XXX check if swapping is necessary on BE */ |
413 |
+ *ih->rptr_cpu = ih->rptr; |
414 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c |
415 |
+index a2588200ea580..0b2ac418e4ac4 100644 |
416 |
+--- a/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c |
417 |
++++ b/drivers/gpu/drm/amd/amdgpu/psp_v12_0.c |
418 |
+@@ -101,6 +101,16 @@ static int psp_v12_0_init_microcode(struct psp_context *psp) |
419 |
+ adev->psp.dtm_context.context.bin_desc.start_addr = |
420 |
+ (uint8_t *)adev->psp.hdcp_context.context.bin_desc.start_addr + |
421 |
+ le32_to_cpu(ta_hdr->dtm.offset_bytes); |
422 |
++ |
423 |
++ if (adev->apu_flags & AMD_APU_IS_RENOIR) { |
424 |
++ adev->psp.securedisplay_context.context.bin_desc.fw_version = |
425 |
++ le32_to_cpu(ta_hdr->securedisplay.fw_version); |
426 |
++ adev->psp.securedisplay_context.context.bin_desc.size_bytes = |
427 |
++ le32_to_cpu(ta_hdr->securedisplay.size_bytes); |
428 |
++ adev->psp.securedisplay_context.context.bin_desc.start_addr = |
429 |
++ (uint8_t *)adev->psp.hdcp_context.context.bin_desc.start_addr + |
430 |
++ le32_to_cpu(ta_hdr->securedisplay.offset_bytes); |
431 |
++ } |
432 |
+ } |
433 |
+ |
434 |
+ return 0; |
435 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c |
436 |
+index 9e18a2b22607b..8d5c452a91007 100644 |
437 |
+--- a/drivers/gpu/drm/amd/amdgpu/soc21.c |
438 |
++++ b/drivers/gpu/drm/amd/amdgpu/soc21.c |
439 |
+@@ -530,8 +530,10 @@ static int soc21_common_early_init(void *handle) |
440 |
+ case IP_VERSION(11, 0, 0): |
441 |
+ adev->cg_flags = AMD_CG_SUPPORT_GFX_CGCG | |
442 |
+ AMD_CG_SUPPORT_GFX_CGLS | |
443 |
++#if 0 |
444 |
+ AMD_CG_SUPPORT_GFX_3D_CGCG | |
445 |
+ AMD_CG_SUPPORT_GFX_3D_CGLS | |
446 |
++#endif |
447 |
+ AMD_CG_SUPPORT_GFX_MGCG | |
448 |
+ AMD_CG_SUPPORT_REPEATER_FGCG | |
449 |
+ AMD_CG_SUPPORT_GFX_FGCG | |
450 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c |
451 |
+index cdd599a081258..03b7066471f9a 100644 |
452 |
+--- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c |
453 |
++++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c |
454 |
+@@ -334,9 +334,11 @@ static u32 vega10_ih_get_wptr(struct amdgpu_device *adev, |
455 |
+ u32 wptr, tmp; |
456 |
+ struct amdgpu_ih_regs *ih_regs; |
457 |
+ |
458 |
+- if (ih == &adev->irq.ih) { |
459 |
++ if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) { |
460 |
+ /* Only ring0 supports writeback. On other rings fall back |
461 |
+ * to register-based code with overflow checking below. |
462 |
++ * ih_soft ring doesn't have any backing hardware registers, |
463 |
++ * update wptr and return. |
464 |
+ */ |
465 |
+ wptr = le32_to_cpu(*ih->wptr_cpu); |
466 |
+ |
467 |
+@@ -409,6 +411,9 @@ static void vega10_ih_set_rptr(struct amdgpu_device *adev, |
468 |
+ { |
469 |
+ struct amdgpu_ih_regs *ih_regs; |
470 |
+ |
471 |
++ if (ih == &adev->irq.ih_soft) |
472 |
++ return; |
473 |
++ |
474 |
+ if (ih->use_doorbell) { |
475 |
+ /* XXX check if swapping is necessary on BE */ |
476 |
+ *ih->rptr_cpu = ih->rptr; |
477 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c |
478 |
+index 3b4eb8285943c..2022ffbb8dba5 100644 |
479 |
+--- a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c |
480 |
++++ b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c |
481 |
+@@ -385,9 +385,11 @@ static u32 vega20_ih_get_wptr(struct amdgpu_device *adev, |
482 |
+ u32 wptr, tmp; |
483 |
+ struct amdgpu_ih_regs *ih_regs; |
484 |
+ |
485 |
+- if (ih == &adev->irq.ih) { |
486 |
++ if (ih == &adev->irq.ih || ih == &adev->irq.ih_soft) { |
487 |
+ /* Only ring0 supports writeback. On other rings fall back |
488 |
+ * to register-based code with overflow checking below. |
489 |
++ * ih_soft ring doesn't have any backing hardware registers, |
490 |
++ * update wptr and return. |
491 |
+ */ |
492 |
+ wptr = le32_to_cpu(*ih->wptr_cpu); |
493 |
+ |
494 |
+@@ -461,6 +463,9 @@ static void vega20_ih_set_rptr(struct amdgpu_device *adev, |
495 |
+ { |
496 |
+ struct amdgpu_ih_regs *ih_regs; |
497 |
+ |
498 |
++ if (ih == &adev->irq.ih_soft) |
499 |
++ return; |
500 |
++ |
501 |
+ if (ih->use_doorbell) { |
502 |
+ /* XXX check if swapping is necessary on BE */ |
503 |
+ *ih->rptr_cpu = ih->rptr; |
504 |
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c |
505 |
+index 1c7016958d6d9..bfca17ca399c6 100644 |
506 |
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c |
507 |
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c |
508 |
+@@ -814,7 +814,7 @@ static int kfd_ioctl_wait_events(struct file *filp, struct kfd_process *p, |
509 |
+ err = kfd_wait_on_events(p, args->num_events, |
510 |
+ (void __user *)args->events_ptr, |
511 |
+ (args->wait_for_all != 0), |
512 |
+- args->timeout, &args->wait_result); |
513 |
++ &args->timeout, &args->wait_result); |
514 |
+ |
515 |
+ return err; |
516 |
+ } |
517 |
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c |
518 |
+index 4df9c36146ba9..cbc20d779e5aa 100644 |
519 |
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c |
520 |
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c |
521 |
+@@ -895,7 +895,8 @@ static long user_timeout_to_jiffies(uint32_t user_timeout_ms) |
522 |
+ return msecs_to_jiffies(user_timeout_ms) + 1; |
523 |
+ } |
524 |
+ |
525 |
+-static void free_waiters(uint32_t num_events, struct kfd_event_waiter *waiters) |
526 |
++static void free_waiters(uint32_t num_events, struct kfd_event_waiter *waiters, |
527 |
++ bool undo_auto_reset) |
528 |
+ { |
529 |
+ uint32_t i; |
530 |
+ |
531 |
+@@ -904,6 +905,9 @@ static void free_waiters(uint32_t num_events, struct kfd_event_waiter *waiters) |
532 |
+ spin_lock(&waiters[i].event->lock); |
533 |
+ remove_wait_queue(&waiters[i].event->wq, |
534 |
+ &waiters[i].wait); |
535 |
++ if (undo_auto_reset && waiters[i].activated && |
536 |
++ waiters[i].event && waiters[i].event->auto_reset) |
537 |
++ set_event(waiters[i].event); |
538 |
+ spin_unlock(&waiters[i].event->lock); |
539 |
+ } |
540 |
+ |
541 |
+@@ -912,7 +916,7 @@ static void free_waiters(uint32_t num_events, struct kfd_event_waiter *waiters) |
542 |
+ |
543 |
+ int kfd_wait_on_events(struct kfd_process *p, |
544 |
+ uint32_t num_events, void __user *data, |
545 |
+- bool all, uint32_t user_timeout_ms, |
546 |
++ bool all, uint32_t *user_timeout_ms, |
547 |
+ uint32_t *wait_result) |
548 |
+ { |
549 |
+ struct kfd_event_data __user *events = |
550 |
+@@ -921,7 +925,7 @@ int kfd_wait_on_events(struct kfd_process *p, |
551 |
+ int ret = 0; |
552 |
+ |
553 |
+ struct kfd_event_waiter *event_waiters = NULL; |
554 |
+- long timeout = user_timeout_to_jiffies(user_timeout_ms); |
555 |
++ long timeout = user_timeout_to_jiffies(*user_timeout_ms); |
556 |
+ |
557 |
+ event_waiters = alloc_event_waiters(num_events); |
558 |
+ if (!event_waiters) { |
559 |
+@@ -971,15 +975,11 @@ int kfd_wait_on_events(struct kfd_process *p, |
560 |
+ } |
561 |
+ |
562 |
+ if (signal_pending(current)) { |
563 |
+- /* |
564 |
+- * This is wrong when a nonzero, non-infinite timeout |
565 |
+- * is specified. We need to use |
566 |
+- * ERESTARTSYS_RESTARTBLOCK, but struct restart_block |
567 |
+- * contains a union with data for each user and it's |
568 |
+- * in generic kernel code that I don't want to |
569 |
+- * touch yet. |
570 |
+- */ |
571 |
+ ret = -ERESTARTSYS; |
572 |
++ if (*user_timeout_ms != KFD_EVENT_TIMEOUT_IMMEDIATE && |
573 |
++ *user_timeout_ms != KFD_EVENT_TIMEOUT_INFINITE) |
574 |
++ *user_timeout_ms = jiffies_to_msecs( |
575 |
++ max(0l, timeout-1)); |
576 |
+ break; |
577 |
+ } |
578 |
+ |
579 |
+@@ -1020,7 +1020,7 @@ int kfd_wait_on_events(struct kfd_process *p, |
580 |
+ event_waiters, events); |
581 |
+ |
582 |
+ out_unlock: |
583 |
+- free_waiters(num_events, event_waiters); |
584 |
++ free_waiters(num_events, event_waiters, ret == -ERESTARTSYS); |
585 |
+ mutex_unlock(&p->event_mutex); |
586 |
+ out: |
587 |
+ if (ret) |
588 |
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h |
589 |
+index 2585d6e61d422..c6eec54b8102f 100644 |
590 |
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h |
591 |
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h |
592 |
+@@ -1314,7 +1314,7 @@ void kfd_event_free_process(struct kfd_process *p); |
593 |
+ int kfd_event_mmap(struct kfd_process *process, struct vm_area_struct *vma); |
594 |
+ int kfd_wait_on_events(struct kfd_process *p, |
595 |
+ uint32_t num_events, void __user *data, |
596 |
+- bool all, uint32_t user_timeout_ms, |
597 |
++ bool all, uint32_t *user_timeout_ms, |
598 |
+ uint32_t *wait_result); |
599 |
+ void kfd_signal_event_interrupt(u32 pasid, uint32_t partial_id, |
600 |
+ uint32_t valid_id_bits); |
601 |
+diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c |
602 |
+index f144494011882..9dbd965d8afb3 100644 |
603 |
+--- a/drivers/gpu/drm/amd/display/dc/core/dc.c |
604 |
++++ b/drivers/gpu/drm/amd/display/dc/core/dc.c |
605 |
+@@ -1067,8 +1067,15 @@ static void disable_dangling_plane(struct dc *dc, struct dc_state *context) |
606 |
+ struct dc_stream_state *old_stream = |
607 |
+ dc->current_state->res_ctx.pipe_ctx[i].stream; |
608 |
+ bool should_disable = true; |
609 |
+- bool pipe_split_change = |
610 |
+- context->res_ctx.pipe_ctx[i].top_pipe != dc->current_state->res_ctx.pipe_ctx[i].top_pipe; |
611 |
++ bool pipe_split_change = false; |
612 |
++ |
613 |
++ if ((context->res_ctx.pipe_ctx[i].top_pipe) && |
614 |
++ (dc->current_state->res_ctx.pipe_ctx[i].top_pipe)) |
615 |
++ pipe_split_change = context->res_ctx.pipe_ctx[i].top_pipe->pipe_idx != |
616 |
++ dc->current_state->res_ctx.pipe_ctx[i].top_pipe->pipe_idx; |
617 |
++ else |
618 |
++ pipe_split_change = context->res_ctx.pipe_ctx[i].top_pipe != |
619 |
++ dc->current_state->res_ctx.pipe_ctx[i].top_pipe; |
620 |
+ |
621 |
+ for (j = 0; j < context->stream_count; j++) { |
622 |
+ if (old_stream == context->streams[j]) { |
623 |
+@@ -3783,6 +3790,7 @@ void dc_enable_dmub_outbox(struct dc *dc) |
624 |
+ struct dc_context *dc_ctx = dc->ctx; |
625 |
+ |
626 |
+ dmub_enable_outbox_notification(dc_ctx->dmub_srv); |
627 |
++ DC_LOG_DC("%s: dmub outbox notifications enabled\n", __func__); |
628 |
+ } |
629 |
+ |
630 |
+ /** |
631 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dc_link.h b/drivers/gpu/drm/amd/display/dc/dc_link.h |
632 |
+index a3c37ee3f849c..f96f53c1bc258 100644 |
633 |
+--- a/drivers/gpu/drm/amd/display/dc/dc_link.h |
634 |
++++ b/drivers/gpu/drm/amd/display/dc/dc_link.h |
635 |
+@@ -337,6 +337,7 @@ enum dc_detect_reason { |
636 |
+ DETECT_REASON_HPDRX, |
637 |
+ DETECT_REASON_FALLBACK, |
638 |
+ DETECT_REASON_RETRAIN, |
639 |
++ DETECT_REASON_TDR, |
640 |
+ }; |
641 |
+ |
642 |
+ bool dc_link_detect(struct dc_link *dc_link, enum dc_detect_reason reason); |
643 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c |
644 |
+index 845aa8a1027d8..c4040adb88b03 100644 |
645 |
+--- a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c |
646 |
++++ b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c |
647 |
+@@ -545,9 +545,11 @@ static void dce112_get_pix_clk_dividers_helper ( |
648 |
+ switch (pix_clk_params->color_depth) { |
649 |
+ case COLOR_DEPTH_101010: |
650 |
+ actual_pixel_clock_100hz = (actual_pixel_clock_100hz * 5) >> 2; |
651 |
++ actual_pixel_clock_100hz -= actual_pixel_clock_100hz % 10; |
652 |
+ break; |
653 |
+ case COLOR_DEPTH_121212: |
654 |
+ actual_pixel_clock_100hz = (actual_pixel_clock_100hz * 6) >> 2; |
655 |
++ actual_pixel_clock_100hz -= actual_pixel_clock_100hz % 10; |
656 |
+ break; |
657 |
+ case COLOR_DEPTH_161616: |
658 |
+ actual_pixel_clock_100hz = actual_pixel_clock_100hz * 2; |
659 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c |
660 |
+index e3a62873c0e70..d9ab279915355 100644 |
661 |
+--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c |
662 |
++++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c |
663 |
+@@ -108,6 +108,7 @@ void dcn10_lock_all_pipes(struct dc *dc, |
664 |
+ */ |
665 |
+ if (pipe_ctx->top_pipe || |
666 |
+ !pipe_ctx->stream || |
667 |
++ !pipe_ctx->plane_state || |
668 |
+ !tg->funcs->is_tg_enabled(tg)) |
669 |
+ continue; |
670 |
+ |
671 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c |
672 |
+index 11019c2c62ccb..8192f1967e924 100644 |
673 |
+--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c |
674 |
++++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c |
675 |
+@@ -126,6 +126,12 @@ struct mpcc *mpc1_get_mpcc_for_dpp(struct mpc_tree *tree, int dpp_id) |
676 |
+ while (tmp_mpcc != NULL) { |
677 |
+ if (tmp_mpcc->dpp_id == dpp_id) |
678 |
+ return tmp_mpcc; |
679 |
++ |
680 |
++ /* avoid circular linked list */ |
681 |
++ ASSERT(tmp_mpcc != tmp_mpcc->mpcc_bot); |
682 |
++ if (tmp_mpcc == tmp_mpcc->mpcc_bot) |
683 |
++ break; |
684 |
++ |
685 |
+ tmp_mpcc = tmp_mpcc->mpcc_bot; |
686 |
+ } |
687 |
+ return NULL; |
688 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c |
689 |
+index b1671b00ce405..2349977b0abb2 100644 |
690 |
+--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c |
691 |
++++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c |
692 |
+@@ -464,6 +464,11 @@ void optc1_enable_optc_clock(struct timing_generator *optc, bool enable) |
693 |
+ OTG_CLOCK_ON, 1, |
694 |
+ 1, 1000); |
695 |
+ } else { |
696 |
++ |
697 |
++ //last chance to clear underflow, otherwise, it will always there due to clock is off. |
698 |
++ if (optc->funcs->is_optc_underflow_occurred(optc) == true) |
699 |
++ optc->funcs->clear_optc_underflow(optc); |
700 |
++ |
701 |
+ REG_UPDATE_2(OTG_CLOCK_CONTROL, |
702 |
+ OTG_CLOCK_GATE_DIS, 0, |
703 |
+ OTG_CLOCK_EN, 0); |
704 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c |
705 |
+index 15734db0cdea4..f3c311d093197 100644 |
706 |
+--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c |
707 |
++++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_mpc.c |
708 |
+@@ -531,6 +531,12 @@ static struct mpcc *mpc2_get_mpcc_for_dpp(struct mpc_tree *tree, int dpp_id) |
709 |
+ while (tmp_mpcc != NULL) { |
710 |
+ if (tmp_mpcc->dpp_id == 0xf || tmp_mpcc->dpp_id == dpp_id) |
711 |
+ return tmp_mpcc; |
712 |
++ |
713 |
++ /* avoid circular linked list */ |
714 |
++ ASSERT(tmp_mpcc != tmp_mpcc->mpcc_bot); |
715 |
++ if (tmp_mpcc == tmp_mpcc->mpcc_bot) |
716 |
++ break; |
717 |
++ |
718 |
+ tmp_mpcc = tmp_mpcc->mpcc_bot; |
719 |
+ } |
720 |
+ return NULL; |
721 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c |
722 |
+index c5e200d09038f..5752271f22dfe 100644 |
723 |
+--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c |
724 |
++++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c |
725 |
+@@ -67,9 +67,15 @@ static uint32_t convert_and_clamp( |
726 |
+ void dcn21_dchvm_init(struct hubbub *hubbub) |
727 |
+ { |
728 |
+ struct dcn20_hubbub *hubbub1 = TO_DCN20_HUBBUB(hubbub); |
729 |
+- uint32_t riommu_active; |
730 |
++ uint32_t riommu_active, prefetch_done; |
731 |
+ int i; |
732 |
+ |
733 |
++ REG_GET(DCHVM_RIOMMU_STAT0, HOSTVM_PREFETCH_DONE, &prefetch_done); |
734 |
++ |
735 |
++ if (prefetch_done) { |
736 |
++ hubbub->riommu_active = true; |
737 |
++ return; |
738 |
++ } |
739 |
+ //Init DCHVM block |
740 |
+ REG_UPDATE(DCHVM_CTRL0, HOSTVM_INIT_REQ, 1); |
741 |
+ |
742 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c |
743 |
+index 6a4dcafb9bba5..dc3e8df706b34 100644 |
744 |
+--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c |
745 |
++++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c |
746 |
+@@ -86,7 +86,7 @@ bool hubp3_program_surface_flip_and_addr( |
747 |
+ VMID, address->vmid); |
748 |
+ |
749 |
+ if (address->type == PLN_ADDR_TYPE_GRPH_STEREO) { |
750 |
+- REG_UPDATE(DCSURF_FLIP_CONTROL, SURFACE_FLIP_MODE_FOR_STEREOSYNC, 0x1); |
751 |
++ REG_UPDATE(DCSURF_FLIP_CONTROL, SURFACE_FLIP_MODE_FOR_STEREOSYNC, 0); |
752 |
+ REG_UPDATE(DCSURF_FLIP_CONTROL, SURFACE_FLIP_IN_STEREOSYNC, 0x1); |
753 |
+ |
754 |
+ } else { |
755 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_stream_encoder.h b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_stream_encoder.h |
756 |
+index 7c77c71591a08..82c3b3ac1f0d0 100644 |
757 |
+--- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_stream_encoder.h |
758 |
++++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_stream_encoder.h |
759 |
+@@ -162,7 +162,8 @@ |
760 |
+ SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_SDP_AUDIO_CONTROL0, AIP_ENABLE, mask_sh),\ |
761 |
+ SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_SDP_AUDIO_CONTROL0, ACM_ENABLE, mask_sh),\ |
762 |
+ SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_VID_CRC_CONTROL, CRC_ENABLE, mask_sh),\ |
763 |
+- SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_VID_CRC_CONTROL, CRC_CONT_MODE_ENABLE, mask_sh) |
764 |
++ SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_VID_CRC_CONTROL, CRC_CONT_MODE_ENABLE, mask_sh),\ |
765 |
++ SE_SF(DP_SYM32_ENC0_DP_SYM32_ENC_HBLANK_CONTROL, HBLANK_MINIMUM_SYMBOL_WIDTH, mask_sh) |
766 |
+ |
767 |
+ |
768 |
+ #define DCN3_1_HPO_DP_STREAM_ENC_REG_FIELD_LIST(type) \ |
769 |
+diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c |
770 |
+index 03fa63d56fa65..948151e735739 100644 |
771 |
+--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c |
772 |
++++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c |
773 |
+@@ -615,10 +615,6 @@ static void build_vrr_infopacket_data_v1(const struct mod_vrr_params *vrr, |
774 |
+ * Note: We should never go above the field rate of the mode timing set. |
775 |
+ */ |
776 |
+ infopacket->sb[8] = (unsigned char)((vrr->max_refresh_in_uhz + 500000) / 1000000); |
777 |
+- |
778 |
+- /* FreeSync HDR */ |
779 |
+- infopacket->sb[9] = 0; |
780 |
+- infopacket->sb[10] = 0; |
781 |
+ } |
782 |
+ |
783 |
+ static void build_vrr_infopacket_data_v3(const struct mod_vrr_params *vrr, |
784 |
+@@ -686,10 +682,6 @@ static void build_vrr_infopacket_data_v3(const struct mod_vrr_params *vrr, |
785 |
+ |
786 |
+ /* PB16 : Reserved bits 7:1, FixedRate bit 0 */ |
787 |
+ infopacket->sb[16] = (vrr->state == VRR_STATE_ACTIVE_FIXED) ? 1 : 0; |
788 |
+- |
789 |
+- //FreeSync HDR |
790 |
+- infopacket->sb[9] = 0; |
791 |
+- infopacket->sb[10] = 0; |
792 |
+ } |
793 |
+ |
794 |
+ static void build_vrr_infopacket_fs2_data(enum color_transfer_func app_tf, |
795 |
+@@ -774,8 +766,7 @@ static void build_vrr_infopacket_header_v2(enum signal_type signal, |
796 |
+ /* HB2 = [Bits 7:5 = 0] [Bits 4:0 = Length = 0x09] */ |
797 |
+ infopacket->hb2 = 0x09; |
798 |
+ |
799 |
+- *payload_size = 0x0A; |
800 |
+- |
801 |
++ *payload_size = 0x09; |
802 |
+ } else if (dc_is_dp_signal(signal)) { |
803 |
+ |
804 |
+ /* HEADER */ |
805 |
+@@ -824,9 +815,9 @@ static void build_vrr_infopacket_header_v3(enum signal_type signal, |
806 |
+ infopacket->hb1 = version; |
807 |
+ |
808 |
+ /* HB2 = [Bits 7:5 = 0] [Bits 4:0 = Length] */ |
809 |
+- *payload_size = 0x10; |
810 |
+- infopacket->hb2 = *payload_size - 1; //-1 for checksum |
811 |
++ infopacket->hb2 = 0x10; |
812 |
+ |
813 |
++ *payload_size = 0x10; |
814 |
+ } else if (dc_is_dp_signal(signal)) { |
815 |
+ |
816 |
+ /* HEADER */ |
817 |
+diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c |
818 |
+index 78f3d9e722bb7..32bb6b1d95261 100644 |
819 |
+--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c |
820 |
++++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c |
821 |
+@@ -4281,6 +4281,7 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = { |
822 |
+ .dump_pptable = sienna_cichlid_dump_pptable, |
823 |
+ .init_microcode = smu_v11_0_init_microcode, |
824 |
+ .load_microcode = smu_v11_0_load_microcode, |
825 |
++ .fini_microcode = smu_v11_0_fini_microcode, |
826 |
+ .init_smc_tables = sienna_cichlid_init_smc_tables, |
827 |
+ .fini_smc_tables = smu_v11_0_fini_smc_tables, |
828 |
+ .init_power = smu_v11_0_init_power, |
829 |
+diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c |
830 |
+index 5aa08c031f721..1d8a9e5b3cc08 100644 |
831 |
+--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c |
832 |
++++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c |
833 |
+@@ -203,6 +203,9 @@ int smu_v13_0_init_pptable_microcode(struct smu_context *smu) |
834 |
+ if (!adev->scpm_enabled) |
835 |
+ return 0; |
836 |
+ |
837 |
++ if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 7)) |
838 |
++ return 0; |
839 |
++ |
840 |
+ /* override pptable_id from driver parameter */ |
841 |
+ if (amdgpu_smu_pptable_id >= 0) { |
842 |
+ pptable_id = amdgpu_smu_pptable_id; |
843 |
+@@ -210,13 +213,6 @@ int smu_v13_0_init_pptable_microcode(struct smu_context *smu) |
844 |
+ } else { |
845 |
+ pptable_id = smu->smu_table.boot_values.pp_table_id; |
846 |
+ |
847 |
+- if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 7) && |
848 |
+- pptable_id == 3667) |
849 |
+- pptable_id = 36671; |
850 |
+- |
851 |
+- if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 7) && |
852 |
+- pptable_id == 3688) |
853 |
+- pptable_id = 36881; |
854 |
+ /* |
855 |
+ * Temporary solution for SMU V13.0.0 with SCPM enabled: |
856 |
+ * - use 36831 signed pptable when pp_table_id is 3683 |
857 |
+diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c |
858 |
+index 7432b3e76d3d7..201546c369945 100644 |
859 |
+--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c |
860 |
++++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c |
861 |
+@@ -1583,7 +1583,9 @@ static const struct pptable_funcs smu_v13_0_0_ppt_funcs = { |
862 |
+ .dump_pptable = smu_v13_0_0_dump_pptable, |
863 |
+ .init_microcode = smu_v13_0_init_microcode, |
864 |
+ .load_microcode = smu_v13_0_load_microcode, |
865 |
++ .fini_microcode = smu_v13_0_fini_microcode, |
866 |
+ .init_smc_tables = smu_v13_0_0_init_smc_tables, |
867 |
++ .fini_smc_tables = smu_v13_0_fini_smc_tables, |
868 |
+ .init_power = smu_v13_0_init_power, |
869 |
+ .fini_power = smu_v13_0_fini_power, |
870 |
+ .check_fw_status = smu_v13_0_check_fw_status, |
871 |
+diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c |
872 |
+index 5a17b51aa0f9f..7df360c25d51e 100644 |
873 |
+--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c |
874 |
++++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_4_ppt.c |
875 |
+@@ -190,6 +190,9 @@ static int smu_v13_0_4_fini_smc_tables(struct smu_context *smu) |
876 |
+ kfree(smu_table->watermarks_table); |
877 |
+ smu_table->watermarks_table = NULL; |
878 |
+ |
879 |
++ kfree(smu_table->gpu_metrics_table); |
880 |
++ smu_table->gpu_metrics_table = NULL; |
881 |
++ |
882 |
+ return 0; |
883 |
+ } |
884 |
+ |
885 |
+diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c |
886 |
+index 4e1861fb2c6a4..9cde13b07dd26 100644 |
887 |
+--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c |
888 |
++++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c |
889 |
+@@ -1539,7 +1539,9 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = { |
890 |
+ .dump_pptable = smu_v13_0_7_dump_pptable, |
891 |
+ .init_microcode = smu_v13_0_init_microcode, |
892 |
+ .load_microcode = smu_v13_0_load_microcode, |
893 |
++ .fini_microcode = smu_v13_0_fini_microcode, |
894 |
+ .init_smc_tables = smu_v13_0_7_init_smc_tables, |
895 |
++ .fini_smc_tables = smu_v13_0_fini_smc_tables, |
896 |
+ .init_power = smu_v13_0_init_power, |
897 |
+ .check_fw_status = smu_v13_0_7_check_fw_status, |
898 |
+ .setup_pptable = smu_v13_0_7_setup_pptable, |
899 |
+diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig |
900 |
+index 061be9a6619df..b0f3117102ca5 100644 |
901 |
+--- a/drivers/gpu/drm/vc4/Kconfig |
902 |
++++ b/drivers/gpu/drm/vc4/Kconfig |
903 |
+@@ -8,6 +8,7 @@ config DRM_VC4 |
904 |
+ depends on DRM |
905 |
+ depends on SND && SND_SOC |
906 |
+ depends on COMMON_CLK |
907 |
++ depends on PM |
908 |
+ select DRM_DISPLAY_HDMI_HELPER |
909 |
+ select DRM_DISPLAY_HELPER |
910 |
+ select DRM_KMS_HELPER |
911 |
+diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c |
912 |
+index 23ff6aa5e8f60..199bc398817fa 100644 |
913 |
+--- a/drivers/gpu/drm/vc4/vc4_hdmi.c |
914 |
++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c |
915 |
+@@ -2875,7 +2875,7 @@ static int vc5_hdmi_init_resources(struct vc4_hdmi *vc4_hdmi) |
916 |
+ return 0; |
917 |
+ } |
918 |
+ |
919 |
+-static int __maybe_unused vc4_hdmi_runtime_suspend(struct device *dev) |
920 |
++static int vc4_hdmi_runtime_suspend(struct device *dev) |
921 |
+ { |
922 |
+ struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); |
923 |
+ |
924 |
+@@ -2992,17 +2992,15 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) |
925 |
+ vc4_hdmi->disable_4kp60 = true; |
926 |
+ } |
927 |
+ |
928 |
++ pm_runtime_enable(dev); |
929 |
++ |
930 |
+ /* |
931 |
+- * We need to have the device powered up at this point to call |
932 |
+- * our reset hook and for the CEC init. |
933 |
++ * We need to have the device powered up at this point to call |
934 |
++ * our reset hook and for the CEC init. |
935 |
+ */ |
936 |
+- ret = vc4_hdmi_runtime_resume(dev); |
937 |
++ ret = pm_runtime_resume_and_get(dev); |
938 |
+ if (ret) |
939 |
+- goto err_put_ddc; |
940 |
+- |
941 |
+- pm_runtime_get_noresume(dev); |
942 |
+- pm_runtime_set_active(dev); |
943 |
+- pm_runtime_enable(dev); |
944 |
++ goto err_disable_runtime_pm; |
945 |
+ |
946 |
+ if ((of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi0") || |
947 |
+ of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi1")) && |
948 |
+@@ -3048,6 +3046,7 @@ err_destroy_conn: |
949 |
+ err_destroy_encoder: |
950 |
+ drm_encoder_cleanup(encoder); |
951 |
+ pm_runtime_put_sync(dev); |
952 |
++err_disable_runtime_pm: |
953 |
+ pm_runtime_disable(dev); |
954 |
+ err_put_ddc: |
955 |
+ put_device(&vc4_hdmi->ddc->dev); |
956 |
+diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c |
957 |
+index 1441787a154a8..9b97dc0695e3a 100644 |
958 |
+--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c |
959 |
++++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c |
960 |
+@@ -285,11 +285,29 @@ static int amd_sfh_irq_init(struct amd_mp2_dev *privdata) |
961 |
+ return 0; |
962 |
+ } |
963 |
+ |
964 |
++static const struct dmi_system_id dmi_nodevs[] = { |
965 |
++ { |
966 |
++ /* |
967 |
++ * Google Chromebooks use Chrome OS Embedded Controller Sensor |
968 |
++ * Hub instead of Sensor Hub Fusion and leaves MP2 |
969 |
++ * uninitialized, which disables all functionalities, even |
970 |
++ * including the registers necessary for feature detections. |
971 |
++ */ |
972 |
++ .matches = { |
973 |
++ DMI_MATCH(DMI_SYS_VENDOR, "Google"), |
974 |
++ }, |
975 |
++ }, |
976 |
++ { } |
977 |
++}; |
978 |
++ |
979 |
+ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
980 |
+ { |
981 |
+ struct amd_mp2_dev *privdata; |
982 |
+ int rc; |
983 |
+ |
984 |
++ if (dmi_first_match(dmi_nodevs)) |
985 |
++ return -ENODEV; |
986 |
++ |
987 |
+ privdata = devm_kzalloc(&pdev->dev, sizeof(*privdata), GFP_KERNEL); |
988 |
+ if (!privdata) |
989 |
+ return -ENOMEM; |
990 |
+diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c |
991 |
+index 08c9a9a60ae47..b59c3dafa6a48 100644 |
992 |
+--- a/drivers/hid/hid-asus.c |
993 |
++++ b/drivers/hid/hid-asus.c |
994 |
+@@ -1212,6 +1212,13 @@ static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
995 |
+ rdesc = new_rdesc; |
996 |
+ } |
997 |
+ |
998 |
++ if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD && |
999 |
++ *rsize == 331 && rdesc[190] == 0x85 && rdesc[191] == 0x5a && |
1000 |
++ rdesc[204] == 0x95 && rdesc[205] == 0x05) { |
1001 |
++ hid_info(hdev, "Fixing up Asus N-KEY keyb report descriptor\n"); |
1002 |
++ rdesc[205] = 0x01; |
1003 |
++ } |
1004 |
++ |
1005 |
+ return rdesc; |
1006 |
+ } |
1007 |
+ |
1008 |
+diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h |
1009 |
+index 9c4e92a9c6460..bc550e884f37b 100644 |
1010 |
+--- a/drivers/hid/hid-ids.h |
1011 |
++++ b/drivers/hid/hid-ids.h |
1012 |
+@@ -185,6 +185,8 @@ |
1013 |
+ #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 0x029c |
1014 |
+ #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 0x029a |
1015 |
+ #define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021 0x029f |
1016 |
++#define USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT 0x8102 |
1017 |
++#define USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLAY 0x8302 |
1018 |
+ |
1019 |
+ #define USB_VENDOR_ID_ASUS 0x0486 |
1020 |
+ #define USB_DEVICE_ID_ASUS_T91MT 0x0185 |
1021 |
+@@ -414,6 +416,7 @@ |
1022 |
+ #define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706 |
1023 |
+ #define I2C_DEVICE_ID_SURFACE_GO_TOUCHSCREEN 0x261A |
1024 |
+ #define I2C_DEVICE_ID_SURFACE_GO2_TOUCHSCREEN 0x2A1C |
1025 |
++#define I2C_DEVICE_ID_LENOVO_YOGA_C630_TOUCHSCREEN 0x279F |
1026 |
+ |
1027 |
+ #define USB_VENDOR_ID_ELECOM 0x056e |
1028 |
+ #define USB_DEVICE_ID_ELECOM_BM084 0x0061 |
1029 |
+diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c |
1030 |
+index 48c1c02c69f4e..859aeb07542e3 100644 |
1031 |
+--- a/drivers/hid/hid-input.c |
1032 |
++++ b/drivers/hid/hid-input.c |
1033 |
+@@ -383,6 +383,8 @@ static const struct hid_device_id hid_battery_quirks[] = { |
1034 |
+ HID_BATTERY_QUIRK_IGNORE }, |
1035 |
+ { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_SURFACE_GO2_TOUCHSCREEN), |
1036 |
+ HID_BATTERY_QUIRK_IGNORE }, |
1037 |
++ { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_LENOVO_YOGA_C630_TOUCHSCREEN), |
1038 |
++ HID_BATTERY_QUIRK_IGNORE }, |
1039 |
+ {} |
1040 |
+ }; |
1041 |
+ |
1042 |
+@@ -1532,7 +1534,10 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct |
1043 |
+ * assume ours |
1044 |
+ */ |
1045 |
+ if (!report->tool) |
1046 |
+- hid_report_set_tool(report, input, usage->code); |
1047 |
++ report->tool = usage->code; |
1048 |
++ |
1049 |
++ /* drivers may have changed the value behind our back, resend it */ |
1050 |
++ hid_report_set_tool(report, input, report->tool); |
1051 |
+ } else { |
1052 |
+ hid_report_release_tool(report, input, usage->code); |
1053 |
+ } |
1054 |
+diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c |
1055 |
+index 4b1173957c17c..f33a03c96ba68 100644 |
1056 |
+--- a/drivers/hid/hid-nintendo.c |
1057 |
++++ b/drivers/hid/hid-nintendo.c |
1058 |
+@@ -1222,6 +1222,7 @@ static void joycon_parse_report(struct joycon_ctlr *ctlr, |
1059 |
+ |
1060 |
+ spin_lock_irqsave(&ctlr->lock, flags); |
1061 |
+ if (IS_ENABLED(CONFIG_NINTENDO_FF) && rep->vibrator_report && |
1062 |
++ ctlr->ctlr_state != JOYCON_CTLR_STATE_REMOVED && |
1063 |
+ (msecs - ctlr->rumble_msecs) >= JC_RUMBLE_PERIOD_MS && |
1064 |
+ (ctlr->rumble_queue_head != ctlr->rumble_queue_tail || |
1065 |
+ ctlr->rumble_zero_countdown > 0)) { |
1066 |
+@@ -1546,12 +1547,13 @@ static int joycon_set_rumble(struct joycon_ctlr *ctlr, u16 amp_r, u16 amp_l, |
1067 |
+ ctlr->rumble_queue_head = 0; |
1068 |
+ memcpy(ctlr->rumble_data[ctlr->rumble_queue_head], data, |
1069 |
+ JC_RUMBLE_DATA_SIZE); |
1070 |
+- spin_unlock_irqrestore(&ctlr->lock, flags); |
1071 |
+ |
1072 |
+ /* don't wait for the periodic send (reduces latency) */ |
1073 |
+- if (schedule_now) |
1074 |
++ if (schedule_now && ctlr->ctlr_state != JOYCON_CTLR_STATE_REMOVED) |
1075 |
+ queue_work(ctlr->rumble_queue, &ctlr->rumble_worker); |
1076 |
+ |
1077 |
++ spin_unlock_irqrestore(&ctlr->lock, flags); |
1078 |
++ |
1079 |
+ return 0; |
1080 |
+ } |
1081 |
+ |
1082 |
+diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c |
1083 |
+index dc67717d2dabc..70f602c64fd13 100644 |
1084 |
+--- a/drivers/hid/hid-quirks.c |
1085 |
++++ b/drivers/hid/hid-quirks.c |
1086 |
+@@ -314,6 +314,8 @@ static const struct hid_device_id hid_have_special_driver[] = { |
1087 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, |
1088 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021) }, |
1089 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021) }, |
1090 |
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT) }, |
1091 |
++ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLAY) }, |
1092 |
+ #endif |
1093 |
+ #if IS_ENABLED(CONFIG_HID_APPLEIR) |
1094 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) }, |
1095 |
+diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c |
1096 |
+index a3b151b29bd71..fc616db4231bb 100644 |
1097 |
+--- a/drivers/hid/hid-steam.c |
1098 |
++++ b/drivers/hid/hid-steam.c |
1099 |
+@@ -134,6 +134,11 @@ static int steam_recv_report(struct steam_device *steam, |
1100 |
+ int ret; |
1101 |
+ |
1102 |
+ r = steam->hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0]; |
1103 |
++ if (!r) { |
1104 |
++ hid_err(steam->hdev, "No HID_FEATURE_REPORT submitted - nothing to read\n"); |
1105 |
++ return -EINVAL; |
1106 |
++ } |
1107 |
++ |
1108 |
+ if (hid_report_len(r) < 64) |
1109 |
+ return -EINVAL; |
1110 |
+ |
1111 |
+@@ -165,6 +170,11 @@ static int steam_send_report(struct steam_device *steam, |
1112 |
+ int ret; |
1113 |
+ |
1114 |
+ r = steam->hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0]; |
1115 |
++ if (!r) { |
1116 |
++ hid_err(steam->hdev, "No HID_FEATURE_REPORT submitted - nothing to read\n"); |
1117 |
++ return -EINVAL; |
1118 |
++ } |
1119 |
++ |
1120 |
+ if (hid_report_len(r) < 64) |
1121 |
+ return -EINVAL; |
1122 |
+ |
1123 |
+diff --git a/drivers/hid/hid-thrustmaster.c b/drivers/hid/hid-thrustmaster.c |
1124 |
+index c3e6d69fdfbd9..cf1679b0d4fbb 100644 |
1125 |
+--- a/drivers/hid/hid-thrustmaster.c |
1126 |
++++ b/drivers/hid/hid-thrustmaster.c |
1127 |
+@@ -67,12 +67,13 @@ static const struct tm_wheel_info tm_wheels_infos[] = { |
1128 |
+ {0x0200, 0x0005, "Thrustmaster T300RS (Missing Attachment)"}, |
1129 |
+ {0x0206, 0x0005, "Thrustmaster T300RS"}, |
1130 |
+ {0x0209, 0x0005, "Thrustmaster T300RS (Open Wheel Attachment)"}, |
1131 |
++ {0x020a, 0x0005, "Thrustmaster T300RS (Sparco R383 Mod)"}, |
1132 |
+ {0x0204, 0x0005, "Thrustmaster T300 Ferrari Alcantara Edition"}, |
1133 |
+ {0x0002, 0x0002, "Thrustmaster T500RS"} |
1134 |
+ //{0x0407, 0x0001, "Thrustmaster TMX"} |
1135 |
+ }; |
1136 |
+ |
1137 |
+-static const uint8_t tm_wheels_infos_length = 4; |
1138 |
++static const uint8_t tm_wheels_infos_length = 7; |
1139 |
+ |
1140 |
+ /* |
1141 |
+ * This structs contains (in little endian) the response data |
1142 |
+diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c |
1143 |
+index 681614a8302a5..197b1e7bf029e 100644 |
1144 |
+--- a/drivers/hid/hidraw.c |
1145 |
++++ b/drivers/hid/hidraw.c |
1146 |
+@@ -350,6 +350,8 @@ static int hidraw_release(struct inode * inode, struct file * file) |
1147 |
+ down_write(&minors_rwsem); |
1148 |
+ |
1149 |
+ spin_lock_irqsave(&hidraw_table[minor]->list_lock, flags); |
1150 |
++ for (int i = list->tail; i < list->head; i++) |
1151 |
++ kfree(list->buffer[i].value); |
1152 |
+ list_del(&list->node); |
1153 |
+ spin_unlock_irqrestore(&hidraw_table[minor]->list_lock, flags); |
1154 |
+ kfree(list); |
1155 |
+diff --git a/drivers/hid/intel-ish-hid/ipc/hw-ish.h b/drivers/hid/intel-ish-hid/ipc/hw-ish.h |
1156 |
+index e600dbf04dfc6..fc108f19a64c3 100644 |
1157 |
+--- a/drivers/hid/intel-ish-hid/ipc/hw-ish.h |
1158 |
++++ b/drivers/hid/intel-ish-hid/ipc/hw-ish.h |
1159 |
+@@ -32,6 +32,7 @@ |
1160 |
+ #define ADL_P_DEVICE_ID 0x51FC |
1161 |
+ #define ADL_N_DEVICE_ID 0x54FC |
1162 |
+ #define RPL_S_DEVICE_ID 0x7A78 |
1163 |
++#define MTL_P_DEVICE_ID 0x7E45 |
1164 |
+ |
1165 |
+ #define REVISION_ID_CHT_A0 0x6 |
1166 |
+ #define REVISION_ID_CHT_Ax_SI 0x0 |
1167 |
+diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c |
1168 |
+index 2c67ec17bec6f..7120b30ac51d0 100644 |
1169 |
+--- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c |
1170 |
++++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c |
1171 |
+@@ -43,6 +43,7 @@ static const struct pci_device_id ish_pci_tbl[] = { |
1172 |
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, ADL_P_DEVICE_ID)}, |
1173 |
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, ADL_N_DEVICE_ID)}, |
1174 |
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, RPL_S_DEVICE_ID)}, |
1175 |
++ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MTL_P_DEVICE_ID)}, |
1176 |
+ {0, } |
1177 |
+ }; |
1178 |
+ MODULE_DEVICE_TABLE(pci, ish_pci_tbl); |
1179 |
+diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c |
1180 |
+index a9666373af6b9..92d6db1ad00f5 100644 |
1181 |
+--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c |
1182 |
++++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c |
1183 |
+@@ -2610,6 +2610,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, |
1184 |
+ del_timer_sync(&hdw->encoder_run_timer); |
1185 |
+ del_timer_sync(&hdw->encoder_wait_timer); |
1186 |
+ flush_work(&hdw->workpoll); |
1187 |
++ v4l2_device_unregister(&hdw->v4l2_dev); |
1188 |
+ usb_free_urb(hdw->ctl_read_urb); |
1189 |
+ usb_free_urb(hdw->ctl_write_urb); |
1190 |
+ kfree(hdw->ctl_read_buffer); |
1191 |
+diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c |
1192 |
+index 9da4489dc345a..378a26a1825c4 100644 |
1193 |
+--- a/drivers/mmc/host/mtk-sd.c |
1194 |
++++ b/drivers/mmc/host/mtk-sd.c |
1195 |
+@@ -2414,6 +2414,9 @@ static void msdc_cqe_disable(struct mmc_host *mmc, bool recovery) |
1196 |
+ /* disable busy check */ |
1197 |
+ sdr_clr_bits(host->base + MSDC_PATCH_BIT1, MSDC_PB1_BUSY_CHECK_SEL); |
1198 |
+ |
1199 |
++ val = readl(host->base + MSDC_INT); |
1200 |
++ writel(val, host->base + MSDC_INT); |
1201 |
++ |
1202 |
+ if (recovery) { |
1203 |
+ sdr_set_field(host->base + MSDC_DMA_CTRL, |
1204 |
+ MSDC_DMA_CTRL_STOP, 1); |
1205 |
+@@ -2871,11 +2874,14 @@ static int __maybe_unused msdc_suspend(struct device *dev) |
1206 |
+ { |
1207 |
+ struct mmc_host *mmc = dev_get_drvdata(dev); |
1208 |
+ int ret; |
1209 |
++ u32 val; |
1210 |
+ |
1211 |
+ if (mmc->caps2 & MMC_CAP2_CQE) { |
1212 |
+ ret = cqhci_suspend(mmc); |
1213 |
+ if (ret) |
1214 |
+ return ret; |
1215 |
++ val = readl(((struct msdc_host *)mmc_priv(mmc))->base + MSDC_INT); |
1216 |
++ writel(val, ((struct msdc_host *)mmc_priv(mmc))->base + MSDC_INT); |
1217 |
+ } |
1218 |
+ |
1219 |
+ return pm_runtime_force_suspend(dev); |
1220 |
+diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c |
1221 |
+index bac874ab0b33a..335c88fd849c4 100644 |
1222 |
+--- a/drivers/mmc/host/sdhci-of-dwcmshc.c |
1223 |
++++ b/drivers/mmc/host/sdhci-of-dwcmshc.c |
1224 |
+@@ -15,6 +15,7 @@ |
1225 |
+ #include <linux/module.h> |
1226 |
+ #include <linux/of.h> |
1227 |
+ #include <linux/of_device.h> |
1228 |
++#include <linux/reset.h> |
1229 |
+ #include <linux/sizes.h> |
1230 |
+ |
1231 |
+ #include "sdhci-pltfm.h" |
1232 |
+@@ -55,14 +56,15 @@ |
1233 |
+ #define DLL_LOCK_WO_TMOUT(x) \ |
1234 |
+ ((((x) & DWCMSHC_EMMC_DLL_LOCKED) == DWCMSHC_EMMC_DLL_LOCKED) && \ |
1235 |
+ (((x) & DWCMSHC_EMMC_DLL_TIMEOUT) == 0)) |
1236 |
+-#define RK3568_MAX_CLKS 3 |
1237 |
++#define RK35xx_MAX_CLKS 3 |
1238 |
+ |
1239 |
+ #define BOUNDARY_OK(addr, len) \ |
1240 |
+ ((addr | (SZ_128M - 1)) == ((addr + len - 1) | (SZ_128M - 1))) |
1241 |
+ |
1242 |
+-struct rk3568_priv { |
1243 |
++struct rk35xx_priv { |
1244 |
+ /* Rockchip specified optional clocks */ |
1245 |
+- struct clk_bulk_data rockchip_clks[RK3568_MAX_CLKS]; |
1246 |
++ struct clk_bulk_data rockchip_clks[RK35xx_MAX_CLKS]; |
1247 |
++ struct reset_control *reset; |
1248 |
+ u8 txclk_tapnum; |
1249 |
+ }; |
1250 |
+ |
1251 |
+@@ -176,7 +178,7 @@ static void dwcmshc_rk3568_set_clock(struct sdhci_host *host, unsigned int clock |
1252 |
+ { |
1253 |
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
1254 |
+ struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host); |
1255 |
+- struct rk3568_priv *priv = dwc_priv->priv; |
1256 |
++ struct rk35xx_priv *priv = dwc_priv->priv; |
1257 |
+ u8 txclk_tapnum = DLL_TXCLK_TAPNUM_DEFAULT; |
1258 |
+ u32 extra, reg; |
1259 |
+ int err; |
1260 |
+@@ -255,6 +257,21 @@ static void dwcmshc_rk3568_set_clock(struct sdhci_host *host, unsigned int clock |
1261 |
+ sdhci_writel(host, extra, DWCMSHC_EMMC_DLL_STRBIN); |
1262 |
+ } |
1263 |
+ |
1264 |
++static void rk35xx_sdhci_reset(struct sdhci_host *host, u8 mask) |
1265 |
++{ |
1266 |
++ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
1267 |
++ struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host); |
1268 |
++ struct rk35xx_priv *priv = dwc_priv->priv; |
1269 |
++ |
1270 |
++ if (mask & SDHCI_RESET_ALL && priv->reset) { |
1271 |
++ reset_control_assert(priv->reset); |
1272 |
++ udelay(1); |
1273 |
++ reset_control_deassert(priv->reset); |
1274 |
++ } |
1275 |
++ |
1276 |
++ sdhci_reset(host, mask); |
1277 |
++} |
1278 |
++ |
1279 |
+ static const struct sdhci_ops sdhci_dwcmshc_ops = { |
1280 |
+ .set_clock = sdhci_set_clock, |
1281 |
+ .set_bus_width = sdhci_set_bus_width, |
1282 |
+@@ -264,12 +281,12 @@ static const struct sdhci_ops sdhci_dwcmshc_ops = { |
1283 |
+ .adma_write_desc = dwcmshc_adma_write_desc, |
1284 |
+ }; |
1285 |
+ |
1286 |
+-static const struct sdhci_ops sdhci_dwcmshc_rk3568_ops = { |
1287 |
++static const struct sdhci_ops sdhci_dwcmshc_rk35xx_ops = { |
1288 |
+ .set_clock = dwcmshc_rk3568_set_clock, |
1289 |
+ .set_bus_width = sdhci_set_bus_width, |
1290 |
+ .set_uhs_signaling = dwcmshc_set_uhs_signaling, |
1291 |
+ .get_max_clock = sdhci_pltfm_clk_get_max_clock, |
1292 |
+- .reset = sdhci_reset, |
1293 |
++ .reset = rk35xx_sdhci_reset, |
1294 |
+ .adma_write_desc = dwcmshc_adma_write_desc, |
1295 |
+ }; |
1296 |
+ |
1297 |
+@@ -279,30 +296,46 @@ static const struct sdhci_pltfm_data sdhci_dwcmshc_pdata = { |
1298 |
+ .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN, |
1299 |
+ }; |
1300 |
+ |
1301 |
+-static const struct sdhci_pltfm_data sdhci_dwcmshc_rk3568_pdata = { |
1302 |
+- .ops = &sdhci_dwcmshc_rk3568_ops, |
1303 |
++#ifdef CONFIG_ACPI |
1304 |
++static const struct sdhci_pltfm_data sdhci_dwcmshc_bf3_pdata = { |
1305 |
++ .ops = &sdhci_dwcmshc_ops, |
1306 |
++ .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN, |
1307 |
++ .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | |
1308 |
++ SDHCI_QUIRK2_ACMD23_BROKEN, |
1309 |
++}; |
1310 |
++#endif |
1311 |
++ |
1312 |
++static const struct sdhci_pltfm_data sdhci_dwcmshc_rk35xx_pdata = { |
1313 |
++ .ops = &sdhci_dwcmshc_rk35xx_ops, |
1314 |
+ .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN | |
1315 |
+ SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, |
1316 |
+ .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN | |
1317 |
+ SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN, |
1318 |
+ }; |
1319 |
+ |
1320 |
+-static int dwcmshc_rk3568_init(struct sdhci_host *host, struct dwcmshc_priv *dwc_priv) |
1321 |
++static int dwcmshc_rk35xx_init(struct sdhci_host *host, struct dwcmshc_priv *dwc_priv) |
1322 |
+ { |
1323 |
+ int err; |
1324 |
+- struct rk3568_priv *priv = dwc_priv->priv; |
1325 |
++ struct rk35xx_priv *priv = dwc_priv->priv; |
1326 |
++ |
1327 |
++ priv->reset = devm_reset_control_array_get_optional_exclusive(mmc_dev(host->mmc)); |
1328 |
++ if (IS_ERR(priv->reset)) { |
1329 |
++ err = PTR_ERR(priv->reset); |
1330 |
++ dev_err(mmc_dev(host->mmc), "failed to get reset control %d\n", err); |
1331 |
++ return err; |
1332 |
++ } |
1333 |
+ |
1334 |
+ priv->rockchip_clks[0].id = "axi"; |
1335 |
+ priv->rockchip_clks[1].id = "block"; |
1336 |
+ priv->rockchip_clks[2].id = "timer"; |
1337 |
+- err = devm_clk_bulk_get_optional(mmc_dev(host->mmc), RK3568_MAX_CLKS, |
1338 |
++ err = devm_clk_bulk_get_optional(mmc_dev(host->mmc), RK35xx_MAX_CLKS, |
1339 |
+ priv->rockchip_clks); |
1340 |
+ if (err) { |
1341 |
+ dev_err(mmc_dev(host->mmc), "failed to get clocks %d\n", err); |
1342 |
+ return err; |
1343 |
+ } |
1344 |
+ |
1345 |
+- err = clk_bulk_prepare_enable(RK3568_MAX_CLKS, priv->rockchip_clks); |
1346 |
++ err = clk_bulk_prepare_enable(RK35xx_MAX_CLKS, priv->rockchip_clks); |
1347 |
+ if (err) { |
1348 |
+ dev_err(mmc_dev(host->mmc), "failed to enable clocks %d\n", err); |
1349 |
+ return err; |
1350 |
+@@ -324,7 +357,7 @@ static int dwcmshc_rk3568_init(struct sdhci_host *host, struct dwcmshc_priv *dwc |
1351 |
+ static const struct of_device_id sdhci_dwcmshc_dt_ids[] = { |
1352 |
+ { |
1353 |
+ .compatible = "rockchip,rk3568-dwcmshc", |
1354 |
+- .data = &sdhci_dwcmshc_rk3568_pdata, |
1355 |
++ .data = &sdhci_dwcmshc_rk35xx_pdata, |
1356 |
+ }, |
1357 |
+ { |
1358 |
+ .compatible = "snps,dwcmshc-sdhci", |
1359 |
+@@ -336,7 +369,10 @@ MODULE_DEVICE_TABLE(of, sdhci_dwcmshc_dt_ids); |
1360 |
+ |
1361 |
+ #ifdef CONFIG_ACPI |
1362 |
+ static const struct acpi_device_id sdhci_dwcmshc_acpi_ids[] = { |
1363 |
+- { .id = "MLNXBF30" }, |
1364 |
++ { |
1365 |
++ .id = "MLNXBF30", |
1366 |
++ .driver_data = (kernel_ulong_t)&sdhci_dwcmshc_bf3_pdata, |
1367 |
++ }, |
1368 |
+ {} |
1369 |
+ }; |
1370 |
+ #endif |
1371 |
+@@ -347,12 +383,12 @@ static int dwcmshc_probe(struct platform_device *pdev) |
1372 |
+ struct sdhci_pltfm_host *pltfm_host; |
1373 |
+ struct sdhci_host *host; |
1374 |
+ struct dwcmshc_priv *priv; |
1375 |
+- struct rk3568_priv *rk_priv = NULL; |
1376 |
++ struct rk35xx_priv *rk_priv = NULL; |
1377 |
+ const struct sdhci_pltfm_data *pltfm_data; |
1378 |
+ int err; |
1379 |
+ u32 extra; |
1380 |
+ |
1381 |
+- pltfm_data = of_device_get_match_data(&pdev->dev); |
1382 |
++ pltfm_data = device_get_match_data(&pdev->dev); |
1383 |
+ if (!pltfm_data) { |
1384 |
+ dev_err(&pdev->dev, "Error: No device match data found\n"); |
1385 |
+ return -ENODEV; |
1386 |
+@@ -402,8 +438,8 @@ static int dwcmshc_probe(struct platform_device *pdev) |
1387 |
+ host->mmc_host_ops.request = dwcmshc_request; |
1388 |
+ host->mmc_host_ops.hs400_enhanced_strobe = dwcmshc_hs400_enhanced_strobe; |
1389 |
+ |
1390 |
+- if (pltfm_data == &sdhci_dwcmshc_rk3568_pdata) { |
1391 |
+- rk_priv = devm_kzalloc(&pdev->dev, sizeof(struct rk3568_priv), GFP_KERNEL); |
1392 |
++ if (pltfm_data == &sdhci_dwcmshc_rk35xx_pdata) { |
1393 |
++ rk_priv = devm_kzalloc(&pdev->dev, sizeof(struct rk35xx_priv), GFP_KERNEL); |
1394 |
+ if (!rk_priv) { |
1395 |
+ err = -ENOMEM; |
1396 |
+ goto err_clk; |
1397 |
+@@ -411,7 +447,7 @@ static int dwcmshc_probe(struct platform_device *pdev) |
1398 |
+ |
1399 |
+ priv->priv = rk_priv; |
1400 |
+ |
1401 |
+- err = dwcmshc_rk3568_init(host, priv); |
1402 |
++ err = dwcmshc_rk35xx_init(host, priv); |
1403 |
+ if (err) |
1404 |
+ goto err_clk; |
1405 |
+ } |
1406 |
+@@ -428,7 +464,7 @@ err_clk: |
1407 |
+ clk_disable_unprepare(pltfm_host->clk); |
1408 |
+ clk_disable_unprepare(priv->bus_clk); |
1409 |
+ if (rk_priv) |
1410 |
+- clk_bulk_disable_unprepare(RK3568_MAX_CLKS, |
1411 |
++ clk_bulk_disable_unprepare(RK35xx_MAX_CLKS, |
1412 |
+ rk_priv->rockchip_clks); |
1413 |
+ free_pltfm: |
1414 |
+ sdhci_pltfm_free(pdev); |
1415 |
+@@ -440,14 +476,14 @@ static int dwcmshc_remove(struct platform_device *pdev) |
1416 |
+ struct sdhci_host *host = platform_get_drvdata(pdev); |
1417 |
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
1418 |
+ struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host); |
1419 |
+- struct rk3568_priv *rk_priv = priv->priv; |
1420 |
++ struct rk35xx_priv *rk_priv = priv->priv; |
1421 |
+ |
1422 |
+ sdhci_remove_host(host, 0); |
1423 |
+ |
1424 |
+ clk_disable_unprepare(pltfm_host->clk); |
1425 |
+ clk_disable_unprepare(priv->bus_clk); |
1426 |
+ if (rk_priv) |
1427 |
+- clk_bulk_disable_unprepare(RK3568_MAX_CLKS, |
1428 |
++ clk_bulk_disable_unprepare(RK35xx_MAX_CLKS, |
1429 |
+ rk_priv->rockchip_clks); |
1430 |
+ sdhci_pltfm_free(pdev); |
1431 |
+ |
1432 |
+@@ -460,7 +496,7 @@ static int dwcmshc_suspend(struct device *dev) |
1433 |
+ struct sdhci_host *host = dev_get_drvdata(dev); |
1434 |
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
1435 |
+ struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host); |
1436 |
+- struct rk3568_priv *rk_priv = priv->priv; |
1437 |
++ struct rk35xx_priv *rk_priv = priv->priv; |
1438 |
+ int ret; |
1439 |
+ |
1440 |
+ ret = sdhci_suspend_host(host); |
1441 |
+@@ -472,7 +508,7 @@ static int dwcmshc_suspend(struct device *dev) |
1442 |
+ clk_disable_unprepare(priv->bus_clk); |
1443 |
+ |
1444 |
+ if (rk_priv) |
1445 |
+- clk_bulk_disable_unprepare(RK3568_MAX_CLKS, |
1446 |
++ clk_bulk_disable_unprepare(RK35xx_MAX_CLKS, |
1447 |
+ rk_priv->rockchip_clks); |
1448 |
+ |
1449 |
+ return ret; |
1450 |
+@@ -483,7 +519,7 @@ static int dwcmshc_resume(struct device *dev) |
1451 |
+ struct sdhci_host *host = dev_get_drvdata(dev); |
1452 |
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); |
1453 |
+ struct dwcmshc_priv *priv = sdhci_pltfm_priv(pltfm_host); |
1454 |
+- struct rk3568_priv *rk_priv = priv->priv; |
1455 |
++ struct rk35xx_priv *rk_priv = priv->priv; |
1456 |
+ int ret; |
1457 |
+ |
1458 |
+ ret = clk_prepare_enable(pltfm_host->clk); |
1459 |
+@@ -497,7 +533,7 @@ static int dwcmshc_resume(struct device *dev) |
1460 |
+ } |
1461 |
+ |
1462 |
+ if (rk_priv) { |
1463 |
+- ret = clk_bulk_prepare_enable(RK3568_MAX_CLKS, |
1464 |
++ ret = clk_bulk_prepare_enable(RK35xx_MAX_CLKS, |
1465 |
+ rk_priv->rockchip_clks); |
1466 |
+ if (ret) |
1467 |
+ return ret; |
1468 |
+diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c |
1469 |
+index 1d6e3b641b2e6..d928b75f37803 100644 |
1470 |
+--- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c |
1471 |
++++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c |
1472 |
+@@ -710,7 +710,7 @@ static void lan966x_cleanup_ports(struct lan966x *lan966x) |
1473 |
+ disable_irq(lan966x->xtr_irq); |
1474 |
+ lan966x->xtr_irq = -ENXIO; |
1475 |
+ |
1476 |
+- if (lan966x->ana_irq) { |
1477 |
++ if (lan966x->ana_irq > 0) { |
1478 |
+ disable_irq(lan966x->ana_irq); |
1479 |
+ lan966x->ana_irq = -ENXIO; |
1480 |
+ } |
1481 |
+@@ -718,10 +718,10 @@ static void lan966x_cleanup_ports(struct lan966x *lan966x) |
1482 |
+ if (lan966x->fdma) |
1483 |
+ devm_free_irq(lan966x->dev, lan966x->fdma_irq, lan966x); |
1484 |
+ |
1485 |
+- if (lan966x->ptp_irq) |
1486 |
++ if (lan966x->ptp_irq > 0) |
1487 |
+ devm_free_irq(lan966x->dev, lan966x->ptp_irq, lan966x); |
1488 |
+ |
1489 |
+- if (lan966x->ptp_ext_irq) |
1490 |
++ if (lan966x->ptp_ext_irq > 0) |
1491 |
+ devm_free_irq(lan966x->dev, lan966x->ptp_ext_irq, lan966x); |
1492 |
+ } |
1493 |
+ |
1494 |
+@@ -1049,7 +1049,7 @@ static int lan966x_probe(struct platform_device *pdev) |
1495 |
+ } |
1496 |
+ |
1497 |
+ lan966x->ana_irq = platform_get_irq_byname(pdev, "ana"); |
1498 |
+- if (lan966x->ana_irq) { |
1499 |
++ if (lan966x->ana_irq > 0) { |
1500 |
+ err = devm_request_threaded_irq(&pdev->dev, lan966x->ana_irq, NULL, |
1501 |
+ lan966x_ana_irq_handler, IRQF_ONESHOT, |
1502 |
+ "ana irq", lan966x); |
1503 |
+diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c |
1504 |
+index 1ac7fec47d6fb..604feeb84ee40 100644 |
1505 |
+--- a/drivers/pci/pcie/portdrv_core.c |
1506 |
++++ b/drivers/pci/pcie/portdrv_core.c |
1507 |
+@@ -222,8 +222,15 @@ static int get_port_device_capability(struct pci_dev *dev) |
1508 |
+ |
1509 |
+ #ifdef CONFIG_PCIEAER |
1510 |
+ if (dev->aer_cap && pci_aer_available() && |
1511 |
+- (pcie_ports_native || host->native_aer)) |
1512 |
++ (pcie_ports_native || host->native_aer)) { |
1513 |
+ services |= PCIE_PORT_SERVICE_AER; |
1514 |
++ |
1515 |
++ /* |
1516 |
++ * Disable AER on this port in case it's been enabled by the |
1517 |
++ * BIOS (the AER service driver will enable it when necessary). |
1518 |
++ */ |
1519 |
++ pci_disable_pcie_error_reporting(dev); |
1520 |
++ } |
1521 |
+ #endif |
1522 |
+ |
1523 |
+ /* Root Ports and Root Complex Event Collectors may generate PMEs */ |
1524 |
+diff --git a/drivers/platform/x86/serial-multi-instantiate.c b/drivers/platform/x86/serial-multi-instantiate.c |
1525 |
+index 1e8063b7c169e..e98007197cf52 100644 |
1526 |
+--- a/drivers/platform/x86/serial-multi-instantiate.c |
1527 |
++++ b/drivers/platform/x86/serial-multi-instantiate.c |
1528 |
+@@ -329,6 +329,7 @@ static const struct acpi_device_id smi_acpi_ids[] = { |
1529 |
+ { "CSC3551", (unsigned long)&cs35l41_hda }, |
1530 |
+ /* Non-conforming _HID for Cirrus Logic already released */ |
1531 |
+ { "CLSA0100", (unsigned long)&cs35l41_hda }, |
1532 |
++ { "CLSA0101", (unsigned long)&cs35l41_hda }, |
1533 |
+ { } |
1534 |
+ }; |
1535 |
+ MODULE_DEVICE_TABLE(acpi, smi_acpi_ids); |
1536 |
+diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c |
1537 |
+index 7886497253ccf..cafcf260394cd 100644 |
1538 |
+--- a/drivers/usb/gadget/udc/core.c |
1539 |
++++ b/drivers/usb/gadget/udc/core.c |
1540 |
+@@ -1728,13 +1728,14 @@ static int usb_udc_uevent(struct device *dev, struct kobj_uevent_env *env) |
1541 |
+ return ret; |
1542 |
+ } |
1543 |
+ |
1544 |
+- if (udc->driver) { |
1545 |
++ mutex_lock(&udc_lock); |
1546 |
++ if (udc->driver) |
1547 |
+ ret = add_uevent_var(env, "USB_UDC_DRIVER=%s", |
1548 |
+ udc->driver->function); |
1549 |
+- if (ret) { |
1550 |
+- dev_err(dev, "failed to add uevent USB_UDC_DRIVER\n"); |
1551 |
+- return ret; |
1552 |
+- } |
1553 |
++ mutex_unlock(&udc_lock); |
1554 |
++ if (ret) { |
1555 |
++ dev_err(dev, "failed to add uevent USB_UDC_DRIVER\n"); |
1556 |
++ return ret; |
1557 |
+ } |
1558 |
+ |
1559 |
+ return 0; |
1560 |
+diff --git a/drivers/video/fbdev/pm2fb.c b/drivers/video/fbdev/pm2fb.c |
1561 |
+index d3be2c64f1c08..8fd79deb1e2ae 100644 |
1562 |
+--- a/drivers/video/fbdev/pm2fb.c |
1563 |
++++ b/drivers/video/fbdev/pm2fb.c |
1564 |
+@@ -617,6 +617,11 @@ static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) |
1565 |
+ return -EINVAL; |
1566 |
+ } |
1567 |
+ |
1568 |
++ if (!var->pixclock) { |
1569 |
++ DPRINTK("pixclock is zero\n"); |
1570 |
++ return -EINVAL; |
1571 |
++ } |
1572 |
++ |
1573 |
+ if (PICOS2KHZ(var->pixclock) > PM2_MAX_PIXCLOCK) { |
1574 |
+ DPRINTK("pixclock too high (%ldKHz)\n", |
1575 |
+ PICOS2KHZ(var->pixclock)); |
1576 |
+diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c |
1577 |
+index 6e556031a8f3a..ebfa35fe1c38b 100644 |
1578 |
+--- a/fs/btrfs/ctree.c |
1579 |
++++ b/fs/btrfs/ctree.c |
1580 |
+@@ -2075,6 +2075,9 @@ cow_done: |
1581 |
+ |
1582 |
+ if (!p->skip_locking) { |
1583 |
+ level = btrfs_header_level(b); |
1584 |
++ |
1585 |
++ btrfs_maybe_reset_lockdep_class(root, b); |
1586 |
++ |
1587 |
+ if (level <= write_lock_level) { |
1588 |
+ btrfs_tree_lock(b); |
1589 |
+ p->locks[level] = BTRFS_WRITE_LOCK; |
1590 |
+diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h |
1591 |
+index 7d3ca3ea0bcec..4d8acd7e63eb5 100644 |
1592 |
+--- a/fs/btrfs/ctree.h |
1593 |
++++ b/fs/btrfs/ctree.h |
1594 |
+@@ -1146,6 +1146,8 @@ enum { |
1595 |
+ BTRFS_ROOT_ORPHAN_CLEANUP, |
1596 |
+ /* This root has a drop operation that was started previously. */ |
1597 |
+ BTRFS_ROOT_UNFINISHED_DROP, |
1598 |
++ /* This reloc root needs to have its buffers lockdep class reset. */ |
1599 |
++ BTRFS_ROOT_RESET_LOCKDEP_CLASS, |
1600 |
+ }; |
1601 |
+ |
1602 |
+ static inline void btrfs_wake_unfinished_drop(struct btrfs_fs_info *fs_info) |
1603 |
+diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c |
1604 |
+index bc30306615837..a2505cfc6bc10 100644 |
1605 |
+--- a/fs/btrfs/disk-io.c |
1606 |
++++ b/fs/btrfs/disk-io.c |
1607 |
+@@ -121,88 +121,6 @@ struct async_submit_bio { |
1608 |
+ blk_status_t status; |
1609 |
+ }; |
1610 |
+ |
1611 |
+-/* |
1612 |
+- * Lockdep class keys for extent_buffer->lock's in this root. For a given |
1613 |
+- * eb, the lockdep key is determined by the btrfs_root it belongs to and |
1614 |
+- * the level the eb occupies in the tree. |
1615 |
+- * |
1616 |
+- * Different roots are used for different purposes and may nest inside each |
1617 |
+- * other and they require separate keysets. As lockdep keys should be |
1618 |
+- * static, assign keysets according to the purpose of the root as indicated |
1619 |
+- * by btrfs_root->root_key.objectid. This ensures that all special purpose |
1620 |
+- * roots have separate keysets. |
1621 |
+- * |
1622 |
+- * Lock-nesting across peer nodes is always done with the immediate parent |
1623 |
+- * node locked thus preventing deadlock. As lockdep doesn't know this, use |
1624 |
+- * subclass to avoid triggering lockdep warning in such cases. |
1625 |
+- * |
1626 |
+- * The key is set by the readpage_end_io_hook after the buffer has passed |
1627 |
+- * csum validation but before the pages are unlocked. It is also set by |
1628 |
+- * btrfs_init_new_buffer on freshly allocated blocks. |
1629 |
+- * |
1630 |
+- * We also add a check to make sure the highest level of the tree is the |
1631 |
+- * same as our lockdep setup here. If BTRFS_MAX_LEVEL changes, this code |
1632 |
+- * needs update as well. |
1633 |
+- */ |
1634 |
+-#ifdef CONFIG_DEBUG_LOCK_ALLOC |
1635 |
+-# if BTRFS_MAX_LEVEL != 8 |
1636 |
+-# error |
1637 |
+-# endif |
1638 |
+- |
1639 |
+-#define DEFINE_LEVEL(stem, level) \ |
1640 |
+- .names[level] = "btrfs-" stem "-0" #level, |
1641 |
+- |
1642 |
+-#define DEFINE_NAME(stem) \ |
1643 |
+- DEFINE_LEVEL(stem, 0) \ |
1644 |
+- DEFINE_LEVEL(stem, 1) \ |
1645 |
+- DEFINE_LEVEL(stem, 2) \ |
1646 |
+- DEFINE_LEVEL(stem, 3) \ |
1647 |
+- DEFINE_LEVEL(stem, 4) \ |
1648 |
+- DEFINE_LEVEL(stem, 5) \ |
1649 |
+- DEFINE_LEVEL(stem, 6) \ |
1650 |
+- DEFINE_LEVEL(stem, 7) |
1651 |
+- |
1652 |
+-static struct btrfs_lockdep_keyset { |
1653 |
+- u64 id; /* root objectid */ |
1654 |
+- /* Longest entry: btrfs-free-space-00 */ |
1655 |
+- char names[BTRFS_MAX_LEVEL][20]; |
1656 |
+- struct lock_class_key keys[BTRFS_MAX_LEVEL]; |
1657 |
+-} btrfs_lockdep_keysets[] = { |
1658 |
+- { .id = BTRFS_ROOT_TREE_OBJECTID, DEFINE_NAME("root") }, |
1659 |
+- { .id = BTRFS_EXTENT_TREE_OBJECTID, DEFINE_NAME("extent") }, |
1660 |
+- { .id = BTRFS_CHUNK_TREE_OBJECTID, DEFINE_NAME("chunk") }, |
1661 |
+- { .id = BTRFS_DEV_TREE_OBJECTID, DEFINE_NAME("dev") }, |
1662 |
+- { .id = BTRFS_CSUM_TREE_OBJECTID, DEFINE_NAME("csum") }, |
1663 |
+- { .id = BTRFS_QUOTA_TREE_OBJECTID, DEFINE_NAME("quota") }, |
1664 |
+- { .id = BTRFS_TREE_LOG_OBJECTID, DEFINE_NAME("log") }, |
1665 |
+- { .id = BTRFS_TREE_RELOC_OBJECTID, DEFINE_NAME("treloc") }, |
1666 |
+- { .id = BTRFS_DATA_RELOC_TREE_OBJECTID, DEFINE_NAME("dreloc") }, |
1667 |
+- { .id = BTRFS_UUID_TREE_OBJECTID, DEFINE_NAME("uuid") }, |
1668 |
+- { .id = BTRFS_FREE_SPACE_TREE_OBJECTID, DEFINE_NAME("free-space") }, |
1669 |
+- { .id = 0, DEFINE_NAME("tree") }, |
1670 |
+-}; |
1671 |
+- |
1672 |
+-#undef DEFINE_LEVEL |
1673 |
+-#undef DEFINE_NAME |
1674 |
+- |
1675 |
+-void btrfs_set_buffer_lockdep_class(u64 objectid, struct extent_buffer *eb, |
1676 |
+- int level) |
1677 |
+-{ |
1678 |
+- struct btrfs_lockdep_keyset *ks; |
1679 |
+- |
1680 |
+- BUG_ON(level >= ARRAY_SIZE(ks->keys)); |
1681 |
+- |
1682 |
+- /* find the matching keyset, id 0 is the default entry */ |
1683 |
+- for (ks = btrfs_lockdep_keysets; ks->id; ks++) |
1684 |
+- if (ks->id == objectid) |
1685 |
+- break; |
1686 |
+- |
1687 |
+- lockdep_set_class_and_name(&eb->lock, |
1688 |
+- &ks->keys[level], ks->names[level]); |
1689 |
+-} |
1690 |
+- |
1691 |
+-#endif |
1692 |
+- |
1693 |
+ /* |
1694 |
+ * Compute the csum of a btree block and store the result to provided buffer. |
1695 |
+ */ |
1696 |
+diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h |
1697 |
+index 4ee8c42c9f783..b4962b7d7117d 100644 |
1698 |
+--- a/fs/btrfs/disk-io.h |
1699 |
++++ b/fs/btrfs/disk-io.h |
1700 |
+@@ -148,14 +148,4 @@ int btrfs_init_root_free_objectid(struct btrfs_root *root); |
1701 |
+ int __init btrfs_end_io_wq_init(void); |
1702 |
+ void __cold btrfs_end_io_wq_exit(void); |
1703 |
+ |
1704 |
+-#ifdef CONFIG_DEBUG_LOCK_ALLOC |
1705 |
+-void btrfs_set_buffer_lockdep_class(u64 objectid, |
1706 |
+- struct extent_buffer *eb, int level); |
1707 |
+-#else |
1708 |
+-static inline void btrfs_set_buffer_lockdep_class(u64 objectid, |
1709 |
+- struct extent_buffer *eb, int level) |
1710 |
+-{ |
1711 |
+-} |
1712 |
+-#endif |
1713 |
+- |
1714 |
+ #endif |
1715 |
+diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c |
1716 |
+index ced3fc76063f1..92f3f5ed8bf1e 100644 |
1717 |
+--- a/fs/btrfs/extent-tree.c |
1718 |
++++ b/fs/btrfs/extent-tree.c |
1719 |
+@@ -4871,6 +4871,7 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
1720 |
+ { |
1721 |
+ struct btrfs_fs_info *fs_info = root->fs_info; |
1722 |
+ struct extent_buffer *buf; |
1723 |
++ u64 lockdep_owner = owner; |
1724 |
+ |
1725 |
+ buf = btrfs_find_create_tree_block(fs_info, bytenr, owner, level); |
1726 |
+ if (IS_ERR(buf)) |
1727 |
+@@ -4889,12 +4890,27 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
1728 |
+ return ERR_PTR(-EUCLEAN); |
1729 |
+ } |
1730 |
+ |
1731 |
++ /* |
1732 |
++ * The reloc trees are just snapshots, so we need them to appear to be |
1733 |
++ * just like any other fs tree WRT lockdep. |
1734 |
++ * |
1735 |
++ * The exception however is in replace_path() in relocation, where we |
1736 |
++ * hold the lock on the original fs root and then search for the reloc |
1737 |
++ * root. At that point we need to make sure any reloc root buffers are |
1738 |
++ * set to the BTRFS_TREE_RELOC_OBJECTID lockdep class in order to make |
1739 |
++ * lockdep happy. |
1740 |
++ */ |
1741 |
++ if (lockdep_owner == BTRFS_TREE_RELOC_OBJECTID && |
1742 |
++ !test_bit(BTRFS_ROOT_RESET_LOCKDEP_CLASS, &root->state)) |
1743 |
++ lockdep_owner = BTRFS_FS_TREE_OBJECTID; |
1744 |
++ |
1745 |
+ /* |
1746 |
+ * This needs to stay, because we could allocate a freed block from an |
1747 |
+ * old tree into a new tree, so we need to make sure this new block is |
1748 |
+ * set to the appropriate level and owner. |
1749 |
+ */ |
1750 |
+- btrfs_set_buffer_lockdep_class(owner, buf, level); |
1751 |
++ btrfs_set_buffer_lockdep_class(lockdep_owner, buf, level); |
1752 |
++ |
1753 |
+ __btrfs_tree_lock(buf, nest); |
1754 |
+ btrfs_clean_tree_block(buf); |
1755 |
+ clear_bit(EXTENT_BUFFER_STALE, &buf->bflags); |
1756 |
+diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c |
1757 |
+index cda25018ebd74..5785ed241f6f8 100644 |
1758 |
+--- a/fs/btrfs/extent_io.c |
1759 |
++++ b/fs/btrfs/extent_io.c |
1760 |
+@@ -6228,6 +6228,7 @@ struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info, |
1761 |
+ struct extent_buffer *exists = NULL; |
1762 |
+ struct page *p; |
1763 |
+ struct address_space *mapping = fs_info->btree_inode->i_mapping; |
1764 |
++ u64 lockdep_owner = owner_root; |
1765 |
+ int uptodate = 1; |
1766 |
+ int ret; |
1767 |
+ |
1768 |
+@@ -6252,7 +6253,15 @@ struct extent_buffer *alloc_extent_buffer(struct btrfs_fs_info *fs_info, |
1769 |
+ eb = __alloc_extent_buffer(fs_info, start, len); |
1770 |
+ if (!eb) |
1771 |
+ return ERR_PTR(-ENOMEM); |
1772 |
+- btrfs_set_buffer_lockdep_class(owner_root, eb, level); |
1773 |
++ |
1774 |
++ /* |
1775 |
++ * The reloc trees are just snapshots, so we need them to appear to be |
1776 |
++ * just like any other fs tree WRT lockdep. |
1777 |
++ */ |
1778 |
++ if (lockdep_owner == BTRFS_TREE_RELOC_OBJECTID) |
1779 |
++ lockdep_owner = BTRFS_FS_TREE_OBJECTID; |
1780 |
++ |
1781 |
++ btrfs_set_buffer_lockdep_class(lockdep_owner, eb, level); |
1782 |
+ |
1783 |
+ num_pages = num_extent_pages(eb); |
1784 |
+ for (i = 0; i < num_pages; i++, index++) { |
1785 |
+diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c |
1786 |
+index 33461b4f9c8b5..9063072b399bd 100644 |
1787 |
+--- a/fs/btrfs/locking.c |
1788 |
++++ b/fs/btrfs/locking.c |
1789 |
+@@ -13,6 +13,93 @@ |
1790 |
+ #include "extent_io.h" |
1791 |
+ #include "locking.h" |
1792 |
+ |
1793 |
++/* |
1794 |
++ * Lockdep class keys for extent_buffer->lock's in this root. For a given |
1795 |
++ * eb, the lockdep key is determined by the btrfs_root it belongs to and |
1796 |
++ * the level the eb occupies in the tree. |
1797 |
++ * |
1798 |
++ * Different roots are used for different purposes and may nest inside each |
1799 |
++ * other and they require separate keysets. As lockdep keys should be |
1800 |
++ * static, assign keysets according to the purpose of the root as indicated |
1801 |
++ * by btrfs_root->root_key.objectid. This ensures that all special purpose |
1802 |
++ * roots have separate keysets. |
1803 |
++ * |
1804 |
++ * Lock-nesting across peer nodes is always done with the immediate parent |
1805 |
++ * node locked thus preventing deadlock. As lockdep doesn't know this, use |
1806 |
++ * subclass to avoid triggering lockdep warning in such cases. |
1807 |
++ * |
1808 |
++ * The key is set by the readpage_end_io_hook after the buffer has passed |
1809 |
++ * csum validation but before the pages are unlocked. It is also set by |
1810 |
++ * btrfs_init_new_buffer on freshly allocated blocks. |
1811 |
++ * |
1812 |
++ * We also add a check to make sure the highest level of the tree is the |
1813 |
++ * same as our lockdep setup here. If BTRFS_MAX_LEVEL changes, this code |
1814 |
++ * needs update as well. |
1815 |
++ */ |
1816 |
++#ifdef CONFIG_DEBUG_LOCK_ALLOC |
1817 |
++#if BTRFS_MAX_LEVEL != 8 |
1818 |
++#error |
1819 |
++#endif |
1820 |
++ |
1821 |
++#define DEFINE_LEVEL(stem, level) \ |
1822 |
++ .names[level] = "btrfs-" stem "-0" #level, |
1823 |
++ |
1824 |
++#define DEFINE_NAME(stem) \ |
1825 |
++ DEFINE_LEVEL(stem, 0) \ |
1826 |
++ DEFINE_LEVEL(stem, 1) \ |
1827 |
++ DEFINE_LEVEL(stem, 2) \ |
1828 |
++ DEFINE_LEVEL(stem, 3) \ |
1829 |
++ DEFINE_LEVEL(stem, 4) \ |
1830 |
++ DEFINE_LEVEL(stem, 5) \ |
1831 |
++ DEFINE_LEVEL(stem, 6) \ |
1832 |
++ DEFINE_LEVEL(stem, 7) |
1833 |
++ |
1834 |
++static struct btrfs_lockdep_keyset { |
1835 |
++ u64 id; /* root objectid */ |
1836 |
++ /* Longest entry: btrfs-free-space-00 */ |
1837 |
++ char names[BTRFS_MAX_LEVEL][20]; |
1838 |
++ struct lock_class_key keys[BTRFS_MAX_LEVEL]; |
1839 |
++} btrfs_lockdep_keysets[] = { |
1840 |
++ { .id = BTRFS_ROOT_TREE_OBJECTID, DEFINE_NAME("root") }, |
1841 |
++ { .id = BTRFS_EXTENT_TREE_OBJECTID, DEFINE_NAME("extent") }, |
1842 |
++ { .id = BTRFS_CHUNK_TREE_OBJECTID, DEFINE_NAME("chunk") }, |
1843 |
++ { .id = BTRFS_DEV_TREE_OBJECTID, DEFINE_NAME("dev") }, |
1844 |
++ { .id = BTRFS_CSUM_TREE_OBJECTID, DEFINE_NAME("csum") }, |
1845 |
++ { .id = BTRFS_QUOTA_TREE_OBJECTID, DEFINE_NAME("quota") }, |
1846 |
++ { .id = BTRFS_TREE_LOG_OBJECTID, DEFINE_NAME("log") }, |
1847 |
++ { .id = BTRFS_TREE_RELOC_OBJECTID, DEFINE_NAME("treloc") }, |
1848 |
++ { .id = BTRFS_DATA_RELOC_TREE_OBJECTID, DEFINE_NAME("dreloc") }, |
1849 |
++ { .id = BTRFS_UUID_TREE_OBJECTID, DEFINE_NAME("uuid") }, |
1850 |
++ { .id = BTRFS_FREE_SPACE_TREE_OBJECTID, DEFINE_NAME("free-space") }, |
1851 |
++ { .id = 0, DEFINE_NAME("tree") }, |
1852 |
++}; |
1853 |
++ |
1854 |
++#undef DEFINE_LEVEL |
1855 |
++#undef DEFINE_NAME |
1856 |
++ |
1857 |
++void btrfs_set_buffer_lockdep_class(u64 objectid, struct extent_buffer *eb, int level) |
1858 |
++{ |
1859 |
++ struct btrfs_lockdep_keyset *ks; |
1860 |
++ |
1861 |
++ BUG_ON(level >= ARRAY_SIZE(ks->keys)); |
1862 |
++ |
1863 |
++ /* Find the matching keyset, id 0 is the default entry */ |
1864 |
++ for (ks = btrfs_lockdep_keysets; ks->id; ks++) |
1865 |
++ if (ks->id == objectid) |
1866 |
++ break; |
1867 |
++ |
1868 |
++ lockdep_set_class_and_name(&eb->lock, &ks->keys[level], ks->names[level]); |
1869 |
++} |
1870 |
++ |
1871 |
++void btrfs_maybe_reset_lockdep_class(struct btrfs_root *root, struct extent_buffer *eb) |
1872 |
++{ |
1873 |
++ if (test_bit(BTRFS_ROOT_RESET_LOCKDEP_CLASS, &root->state)) |
1874 |
++ btrfs_set_buffer_lockdep_class(root->root_key.objectid, |
1875 |
++ eb, btrfs_header_level(eb)); |
1876 |
++} |
1877 |
++ |
1878 |
++#endif |
1879 |
++ |
1880 |
+ /* |
1881 |
+ * Extent buffer locking |
1882 |
+ * ===================== |
1883 |
+@@ -164,6 +251,8 @@ struct extent_buffer *btrfs_lock_root_node(struct btrfs_root *root) |
1884 |
+ |
1885 |
+ while (1) { |
1886 |
+ eb = btrfs_root_node(root); |
1887 |
++ |
1888 |
++ btrfs_maybe_reset_lockdep_class(root, eb); |
1889 |
+ btrfs_tree_lock(eb); |
1890 |
+ if (eb == root->node) |
1891 |
+ break; |
1892 |
+@@ -185,6 +274,8 @@ struct extent_buffer *btrfs_read_lock_root_node(struct btrfs_root *root) |
1893 |
+ |
1894 |
+ while (1) { |
1895 |
+ eb = btrfs_root_node(root); |
1896 |
++ |
1897 |
++ btrfs_maybe_reset_lockdep_class(root, eb); |
1898 |
+ btrfs_tree_read_lock(eb); |
1899 |
+ if (eb == root->node) |
1900 |
+ break; |
1901 |
+diff --git a/fs/btrfs/locking.h b/fs/btrfs/locking.h |
1902 |
+index bbc45534ae9a6..ab268be09bb54 100644 |
1903 |
+--- a/fs/btrfs/locking.h |
1904 |
++++ b/fs/btrfs/locking.h |
1905 |
+@@ -131,4 +131,18 @@ void btrfs_drew_write_unlock(struct btrfs_drew_lock *lock); |
1906 |
+ void btrfs_drew_read_lock(struct btrfs_drew_lock *lock); |
1907 |
+ void btrfs_drew_read_unlock(struct btrfs_drew_lock *lock); |
1908 |
+ |
1909 |
++#ifdef CONFIG_DEBUG_LOCK_ALLOC |
1910 |
++void btrfs_set_buffer_lockdep_class(u64 objectid, struct extent_buffer *eb, int level); |
1911 |
++void btrfs_maybe_reset_lockdep_class(struct btrfs_root *root, struct extent_buffer *eb); |
1912 |
++#else |
1913 |
++static inline void btrfs_set_buffer_lockdep_class(u64 objectid, |
1914 |
++ struct extent_buffer *eb, int level) |
1915 |
++{ |
1916 |
++} |
1917 |
++static inline void btrfs_maybe_reset_lockdep_class(struct btrfs_root *root, |
1918 |
++ struct extent_buffer *eb) |
1919 |
++{ |
1920 |
++} |
1921 |
++#endif |
1922 |
++ |
1923 |
+ #endif |
1924 |
+diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c |
1925 |
+index 33411baf5c7a3..45c02aba2492b 100644 |
1926 |
+--- a/fs/btrfs/relocation.c |
1927 |
++++ b/fs/btrfs/relocation.c |
1928 |
+@@ -1326,7 +1326,9 @@ again: |
1929 |
+ btrfs_release_path(path); |
1930 |
+ |
1931 |
+ path->lowest_level = level; |
1932 |
++ set_bit(BTRFS_ROOT_RESET_LOCKDEP_CLASS, &src->state); |
1933 |
+ ret = btrfs_search_slot(trans, src, &key, path, 0, 1); |
1934 |
++ clear_bit(BTRFS_ROOT_RESET_LOCKDEP_CLASS, &src->state); |
1935 |
+ path->lowest_level = 0; |
1936 |
+ if (ret) { |
1937 |
+ if (ret > 0) |
1938 |
+diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c |
1939 |
+index 9e0e0ae2288cd..43f905ab0a18d 100644 |
1940 |
+--- a/fs/btrfs/tree-checker.c |
1941 |
++++ b/fs/btrfs/tree-checker.c |
1942 |
+@@ -1233,7 +1233,8 @@ static void extent_err(const struct extent_buffer *eb, int slot, |
1943 |
+ } |
1944 |
+ |
1945 |
+ static int check_extent_item(struct extent_buffer *leaf, |
1946 |
+- struct btrfs_key *key, int slot) |
1947 |
++ struct btrfs_key *key, int slot, |
1948 |
++ struct btrfs_key *prev_key) |
1949 |
+ { |
1950 |
+ struct btrfs_fs_info *fs_info = leaf->fs_info; |
1951 |
+ struct btrfs_extent_item *ei; |
1952 |
+@@ -1453,6 +1454,26 @@ static int check_extent_item(struct extent_buffer *leaf, |
1953 |
+ total_refs, inline_refs); |
1954 |
+ return -EUCLEAN; |
1955 |
+ } |
1956 |
++ |
1957 |
++ if ((prev_key->type == BTRFS_EXTENT_ITEM_KEY) || |
1958 |
++ (prev_key->type == BTRFS_METADATA_ITEM_KEY)) { |
1959 |
++ u64 prev_end = prev_key->objectid; |
1960 |
++ |
1961 |
++ if (prev_key->type == BTRFS_METADATA_ITEM_KEY) |
1962 |
++ prev_end += fs_info->nodesize; |
1963 |
++ else |
1964 |
++ prev_end += prev_key->offset; |
1965 |
++ |
1966 |
++ if (unlikely(prev_end > key->objectid)) { |
1967 |
++ extent_err(leaf, slot, |
1968 |
++ "previous extent [%llu %u %llu] overlaps current extent [%llu %u %llu]", |
1969 |
++ prev_key->objectid, prev_key->type, |
1970 |
++ prev_key->offset, key->objectid, key->type, |
1971 |
++ key->offset); |
1972 |
++ return -EUCLEAN; |
1973 |
++ } |
1974 |
++ } |
1975 |
++ |
1976 |
+ return 0; |
1977 |
+ } |
1978 |
+ |
1979 |
+@@ -1621,7 +1642,7 @@ static int check_leaf_item(struct extent_buffer *leaf, |
1980 |
+ break; |
1981 |
+ case BTRFS_EXTENT_ITEM_KEY: |
1982 |
+ case BTRFS_METADATA_ITEM_KEY: |
1983 |
+- ret = check_extent_item(leaf, key, slot); |
1984 |
++ ret = check_extent_item(leaf, key, slot, prev_key); |
1985 |
+ break; |
1986 |
+ case BTRFS_TREE_BLOCK_REF_KEY: |
1987 |
+ case BTRFS_SHARED_DATA_REF_KEY: |
1988 |
+diff --git a/fs/ksmbd/mgmt/tree_connect.c b/fs/ksmbd/mgmt/tree_connect.c |
1989 |
+index 0d28e723a28c7..940385c6a9135 100644 |
1990 |
+--- a/fs/ksmbd/mgmt/tree_connect.c |
1991 |
++++ b/fs/ksmbd/mgmt/tree_connect.c |
1992 |
+@@ -18,7 +18,7 @@ |
1993 |
+ struct ksmbd_tree_conn_status |
1994 |
+ ksmbd_tree_conn_connect(struct ksmbd_session *sess, char *share_name) |
1995 |
+ { |
1996 |
+- struct ksmbd_tree_conn_status status = {-EINVAL, NULL}; |
1997 |
++ struct ksmbd_tree_conn_status status = {-ENOENT, NULL}; |
1998 |
+ struct ksmbd_tree_connect_response *resp = NULL; |
1999 |
+ struct ksmbd_share_config *sc; |
2000 |
+ struct ksmbd_tree_connect *tree_conn = NULL; |
2001 |
+diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c |
2002 |
+index a9c33d15ca1fb..35f5ea1c9dfcd 100644 |
2003 |
+--- a/fs/ksmbd/smb2pdu.c |
2004 |
++++ b/fs/ksmbd/smb2pdu.c |
2005 |
+@@ -1930,8 +1930,9 @@ out_err1: |
2006 |
+ rsp->hdr.Status = STATUS_SUCCESS; |
2007 |
+ rc = 0; |
2008 |
+ break; |
2009 |
++ case -ENOENT: |
2010 |
+ case KSMBD_TREE_CONN_STATUS_NO_SHARE: |
2011 |
+- rsp->hdr.Status = STATUS_BAD_NETWORK_PATH; |
2012 |
++ rsp->hdr.Status = STATUS_BAD_NETWORK_NAME; |
2013 |
+ break; |
2014 |
+ case -ENOMEM: |
2015 |
+ case KSMBD_TREE_CONN_STATUS_NOMEM: |
2016 |
+@@ -2314,15 +2315,15 @@ static int smb2_remove_smb_xattrs(struct path *path) |
2017 |
+ name += strlen(name) + 1) { |
2018 |
+ ksmbd_debug(SMB, "%s, len %zd\n", name, strlen(name)); |
2019 |
+ |
2020 |
+- if (strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) && |
2021 |
+- strncmp(&name[XATTR_USER_PREFIX_LEN], DOS_ATTRIBUTE_PREFIX, |
2022 |
+- DOS_ATTRIBUTE_PREFIX_LEN) && |
2023 |
+- strncmp(&name[XATTR_USER_PREFIX_LEN], STREAM_PREFIX, STREAM_PREFIX_LEN)) |
2024 |
+- continue; |
2025 |
+- |
2026 |
+- err = ksmbd_vfs_remove_xattr(user_ns, path->dentry, name); |
2027 |
+- if (err) |
2028 |
+- ksmbd_debug(SMB, "remove xattr failed : %s\n", name); |
2029 |
++ if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) && |
2030 |
++ !strncmp(&name[XATTR_USER_PREFIX_LEN], STREAM_PREFIX, |
2031 |
++ STREAM_PREFIX_LEN)) { |
2032 |
++ err = ksmbd_vfs_remove_xattr(user_ns, path->dentry, |
2033 |
++ name); |
2034 |
++ if (err) |
2035 |
++ ksmbd_debug(SMB, "remove xattr failed : %s\n", |
2036 |
++ name); |
2037 |
++ } |
2038 |
+ } |
2039 |
+ out: |
2040 |
+ kvfree(xattr_list); |
2041 |
+diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c |
2042 |
+index 3629049decac1..e3d443ccb9be6 100644 |
2043 |
+--- a/fs/ntfs3/xattr.c |
2044 |
++++ b/fs/ntfs3/xattr.c |
2045 |
+@@ -118,7 +118,7 @@ static int ntfs_read_ea(struct ntfs_inode *ni, struct EA_FULL **ea, |
2046 |
+ |
2047 |
+ run_init(&run); |
2048 |
+ |
2049 |
+- err = attr_load_runs(attr_ea, ni, &run, NULL); |
2050 |
++ err = attr_load_runs_range(ni, ATTR_EA, NULL, 0, &run, 0, size); |
2051 |
+ if (!err) |
2052 |
+ err = ntfs_read_run_nb(sbi, &run, 0, ea_p, size, NULL); |
2053 |
+ run_close(&run); |
2054 |
+@@ -444,6 +444,11 @@ update_ea: |
2055 |
+ /* Delete xattr, ATTR_EA */ |
2056 |
+ ni_remove_attr_le(ni, attr, mi, le); |
2057 |
+ } else if (attr->non_res) { |
2058 |
++ err = attr_load_runs_range(ni, ATTR_EA, NULL, 0, &ea_run, 0, |
2059 |
++ size); |
2060 |
++ if (err) |
2061 |
++ goto out; |
2062 |
++ |
2063 |
+ err = ntfs_sb_write_run(sbi, &ea_run, 0, ea_all, size, 0); |
2064 |
+ if (err) |
2065 |
+ goto out; |
2066 |
+diff --git a/include/linux/rmap.h b/include/linux/rmap.h |
2067 |
+index bf80adca980b9..b89b4b86951f8 100644 |
2068 |
+--- a/include/linux/rmap.h |
2069 |
++++ b/include/linux/rmap.h |
2070 |
+@@ -41,12 +41,15 @@ struct anon_vma { |
2071 |
+ atomic_t refcount; |
2072 |
+ |
2073 |
+ /* |
2074 |
+- * Count of child anon_vmas and VMAs which points to this anon_vma. |
2075 |
++ * Count of child anon_vmas. Equals to the count of all anon_vmas that |
2076 |
++ * have ->parent pointing to this one, including itself. |
2077 |
+ * |
2078 |
+ * This counter is used for making decision about reusing anon_vma |
2079 |
+ * instead of forking new one. See comments in function anon_vma_clone. |
2080 |
+ */ |
2081 |
+- unsigned degree; |
2082 |
++ unsigned long num_children; |
2083 |
++ /* Count of VMAs whose ->anon_vma pointer points to this object. */ |
2084 |
++ unsigned long num_active_vmas; |
2085 |
+ |
2086 |
+ struct anon_vma *parent; /* Parent of this anon_vma */ |
2087 |
+ |
2088 |
+diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h |
2089 |
+index d3d10556f0fae..2f41364a6791e 100644 |
2090 |
+--- a/include/linux/skbuff.h |
2091 |
++++ b/include/linux/skbuff.h |
2092 |
+@@ -2624,6 +2624,14 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset) |
2093 |
+ |
2094 |
+ #endif /* NET_SKBUFF_DATA_USES_OFFSET */ |
2095 |
+ |
2096 |
++static inline void skb_assert_len(struct sk_buff *skb) |
2097 |
++{ |
2098 |
++#ifdef CONFIG_DEBUG_NET |
2099 |
++ if (WARN_ONCE(!skb->len, "%s\n", __func__)) |
2100 |
++ DO_ONCE_LITE(skb_dump, KERN_ERR, skb, false); |
2101 |
++#endif /* CONFIG_DEBUG_NET */ |
2102 |
++} |
2103 |
++ |
2104 |
+ /* |
2105 |
+ * Add data to an sk_buff |
2106 |
+ */ |
2107 |
+diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h |
2108 |
+index c5a2d6f50f25b..c5bdc5975a5c6 100644 |
2109 |
+--- a/include/linux/skmsg.h |
2110 |
++++ b/include/linux/skmsg.h |
2111 |
+@@ -277,7 +277,8 @@ static inline void sk_msg_sg_copy_clear(struct sk_msg *msg, u32 start) |
2112 |
+ |
2113 |
+ static inline struct sk_psock *sk_psock(const struct sock *sk) |
2114 |
+ { |
2115 |
+- return rcu_dereference_sk_user_data(sk); |
2116 |
++ return __rcu_dereference_sk_user_data_with_flags(sk, |
2117 |
++ SK_USER_DATA_PSOCK); |
2118 |
+ } |
2119 |
+ |
2120 |
+ static inline void sk_psock_set_state(struct sk_psock *psock, |
2121 |
+diff --git a/include/net/sock.h b/include/net/sock.h |
2122 |
+index 13944ceea7ed0..bf45b572f2897 100644 |
2123 |
+--- a/include/net/sock.h |
2124 |
++++ b/include/net/sock.h |
2125 |
+@@ -545,14 +545,26 @@ enum sk_pacing { |
2126 |
+ SK_PACING_FQ = 2, |
2127 |
+ }; |
2128 |
+ |
2129 |
+-/* Pointer stored in sk_user_data might not be suitable for copying |
2130 |
+- * when cloning the socket. For instance, it can point to a reference |
2131 |
+- * counted object. sk_user_data bottom bit is set if pointer must not |
2132 |
+- * be copied. |
2133 |
++/* flag bits in sk_user_data |
2134 |
++ * |
2135 |
++ * - SK_USER_DATA_NOCOPY: Pointer stored in sk_user_data might |
2136 |
++ * not be suitable for copying when cloning the socket. For instance, |
2137 |
++ * it can point to a reference counted object. sk_user_data bottom |
2138 |
++ * bit is set if pointer must not be copied. |
2139 |
++ * |
2140 |
++ * - SK_USER_DATA_BPF: Mark whether sk_user_data field is |
2141 |
++ * managed/owned by a BPF reuseport array. This bit should be set |
2142 |
++ * when sk_user_data's sk is added to the bpf's reuseport_array. |
2143 |
++ * |
2144 |
++ * - SK_USER_DATA_PSOCK: Mark whether pointer stored in |
2145 |
++ * sk_user_data points to psock type. This bit should be set |
2146 |
++ * when sk_user_data is assigned to a psock object. |
2147 |
+ */ |
2148 |
+ #define SK_USER_DATA_NOCOPY 1UL |
2149 |
+-#define SK_USER_DATA_BPF 2UL /* Managed by BPF */ |
2150 |
+-#define SK_USER_DATA_PTRMASK ~(SK_USER_DATA_NOCOPY | SK_USER_DATA_BPF) |
2151 |
++#define SK_USER_DATA_BPF 2UL |
2152 |
++#define SK_USER_DATA_PSOCK 4UL |
2153 |
++#define SK_USER_DATA_PTRMASK ~(SK_USER_DATA_NOCOPY | SK_USER_DATA_BPF |\ |
2154 |
++ SK_USER_DATA_PSOCK) |
2155 |
+ |
2156 |
+ /** |
2157 |
+ * sk_user_data_is_nocopy - Test if sk_user_data pointer must not be copied |
2158 |
+@@ -565,24 +577,40 @@ static inline bool sk_user_data_is_nocopy(const struct sock *sk) |
2159 |
+ |
2160 |
+ #define __sk_user_data(sk) ((*((void __rcu **)&(sk)->sk_user_data))) |
2161 |
+ |
2162 |
++/** |
2163 |
++ * __rcu_dereference_sk_user_data_with_flags - return the pointer |
2164 |
++ * only if argument flags all has been set in sk_user_data. Otherwise |
2165 |
++ * return NULL |
2166 |
++ * |
2167 |
++ * @sk: socket |
2168 |
++ * @flags: flag bits |
2169 |
++ */ |
2170 |
++static inline void * |
2171 |
++__rcu_dereference_sk_user_data_with_flags(const struct sock *sk, |
2172 |
++ uintptr_t flags) |
2173 |
++{ |
2174 |
++ uintptr_t sk_user_data = (uintptr_t)rcu_dereference(__sk_user_data(sk)); |
2175 |
++ |
2176 |
++ WARN_ON_ONCE(flags & SK_USER_DATA_PTRMASK); |
2177 |
++ |
2178 |
++ if ((sk_user_data & flags) == flags) |
2179 |
++ return (void *)(sk_user_data & SK_USER_DATA_PTRMASK); |
2180 |
++ return NULL; |
2181 |
++} |
2182 |
++ |
2183 |
+ #define rcu_dereference_sk_user_data(sk) \ |
2184 |
++ __rcu_dereference_sk_user_data_with_flags(sk, 0) |
2185 |
++#define __rcu_assign_sk_user_data_with_flags(sk, ptr, flags) \ |
2186 |
+ ({ \ |
2187 |
+- void *__tmp = rcu_dereference(__sk_user_data((sk))); \ |
2188 |
+- (void *)((uintptr_t)__tmp & SK_USER_DATA_PTRMASK); \ |
2189 |
+-}) |
2190 |
+-#define rcu_assign_sk_user_data(sk, ptr) \ |
2191 |
+-({ \ |
2192 |
+- uintptr_t __tmp = (uintptr_t)(ptr); \ |
2193 |
+- WARN_ON_ONCE(__tmp & ~SK_USER_DATA_PTRMASK); \ |
2194 |
+- rcu_assign_pointer(__sk_user_data((sk)), __tmp); \ |
2195 |
+-}) |
2196 |
+-#define rcu_assign_sk_user_data_nocopy(sk, ptr) \ |
2197 |
+-({ \ |
2198 |
+- uintptr_t __tmp = (uintptr_t)(ptr); \ |
2199 |
+- WARN_ON_ONCE(__tmp & ~SK_USER_DATA_PTRMASK); \ |
2200 |
++ uintptr_t __tmp1 = (uintptr_t)(ptr), \ |
2201 |
++ __tmp2 = (uintptr_t)(flags); \ |
2202 |
++ WARN_ON_ONCE(__tmp1 & ~SK_USER_DATA_PTRMASK); \ |
2203 |
++ WARN_ON_ONCE(__tmp2 & SK_USER_DATA_PTRMASK); \ |
2204 |
+ rcu_assign_pointer(__sk_user_data((sk)), \ |
2205 |
+- __tmp | SK_USER_DATA_NOCOPY); \ |
2206 |
++ __tmp1 | __tmp2); \ |
2207 |
+ }) |
2208 |
++#define rcu_assign_sk_user_data(sk, ptr) \ |
2209 |
++ __rcu_assign_sk_user_data_with_flags(sk, ptr, 0) |
2210 |
+ |
2211 |
+ static inline |
2212 |
+ struct net *sock_net(const struct sock *sk) |
2213 |
+diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c |
2214 |
+index 601ccf1b2f091..4baa99363b166 100644 |
2215 |
+--- a/kernel/trace/ftrace.c |
2216 |
++++ b/kernel/trace/ftrace.c |
2217 |
+@@ -2937,6 +2937,16 @@ int ftrace_startup(struct ftrace_ops *ops, int command) |
2218 |
+ |
2219 |
+ ftrace_startup_enable(command); |
2220 |
+ |
2221 |
++ /* |
2222 |
++ * If ftrace is in an undefined state, we just remove ops from list |
2223 |
++ * to prevent the NULL pointer, instead of totally rolling it back and |
2224 |
++ * free trampoline, because those actions could cause further damage. |
2225 |
++ */ |
2226 |
++ if (unlikely(ftrace_disabled)) { |
2227 |
++ __unregister_ftrace_function(ops); |
2228 |
++ return -ENODEV; |
2229 |
++ } |
2230 |
++ |
2231 |
+ ops->flags &= ~FTRACE_OPS_FL_ADDING; |
2232 |
+ |
2233 |
+ return 0; |
2234 |
+diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig |
2235 |
+index 2082af43d51fb..0717a0dcefed1 100644 |
2236 |
+--- a/lib/crypto/Kconfig |
2237 |
++++ b/lib/crypto/Kconfig |
2238 |
+@@ -33,7 +33,6 @@ config CRYPTO_ARCH_HAVE_LIB_CHACHA |
2239 |
+ |
2240 |
+ config CRYPTO_LIB_CHACHA_GENERIC |
2241 |
+ tristate |
2242 |
+- select XOR_BLOCKS |
2243 |
+ help |
2244 |
+ This symbol can be depended upon by arch implementations of the |
2245 |
+ ChaCha library interface that require the generic code as a |
2246 |
+diff --git a/mm/rmap.c b/mm/rmap.c |
2247 |
+index 746c05acad270..f6dd281df410e 100644 |
2248 |
+--- a/mm/rmap.c |
2249 |
++++ b/mm/rmap.c |
2250 |
+@@ -93,7 +93,8 @@ static inline struct anon_vma *anon_vma_alloc(void) |
2251 |
+ anon_vma = kmem_cache_alloc(anon_vma_cachep, GFP_KERNEL); |
2252 |
+ if (anon_vma) { |
2253 |
+ atomic_set(&anon_vma->refcount, 1); |
2254 |
+- anon_vma->degree = 1; /* Reference for first vma */ |
2255 |
++ anon_vma->num_children = 0; |
2256 |
++ anon_vma->num_active_vmas = 0; |
2257 |
+ anon_vma->parent = anon_vma; |
2258 |
+ /* |
2259 |
+ * Initialise the anon_vma root to point to itself. If called |
2260 |
+@@ -201,6 +202,7 @@ int __anon_vma_prepare(struct vm_area_struct *vma) |
2261 |
+ anon_vma = anon_vma_alloc(); |
2262 |
+ if (unlikely(!anon_vma)) |
2263 |
+ goto out_enomem_free_avc; |
2264 |
++ anon_vma->num_children++; /* self-parent link for new root */ |
2265 |
+ allocated = anon_vma; |
2266 |
+ } |
2267 |
+ |
2268 |
+@@ -210,8 +212,7 @@ int __anon_vma_prepare(struct vm_area_struct *vma) |
2269 |
+ if (likely(!vma->anon_vma)) { |
2270 |
+ vma->anon_vma = anon_vma; |
2271 |
+ anon_vma_chain_link(vma, avc, anon_vma); |
2272 |
+- /* vma reference or self-parent link for new root */ |
2273 |
+- anon_vma->degree++; |
2274 |
++ anon_vma->num_active_vmas++; |
2275 |
+ allocated = NULL; |
2276 |
+ avc = NULL; |
2277 |
+ } |
2278 |
+@@ -296,19 +297,19 @@ int anon_vma_clone(struct vm_area_struct *dst, struct vm_area_struct *src) |
2279 |
+ anon_vma_chain_link(dst, avc, anon_vma); |
2280 |
+ |
2281 |
+ /* |
2282 |
+- * Reuse existing anon_vma if its degree lower than two, |
2283 |
+- * that means it has no vma and only one anon_vma child. |
2284 |
++ * Reuse existing anon_vma if it has no vma and only one |
2285 |
++ * anon_vma child. |
2286 |
+ * |
2287 |
+- * Do not choose parent anon_vma, otherwise first child |
2288 |
+- * will always reuse it. Root anon_vma is never reused: |
2289 |
++ * Root anon_vma is never reused: |
2290 |
+ * it has self-parent reference and at least one child. |
2291 |
+ */ |
2292 |
+ if (!dst->anon_vma && src->anon_vma && |
2293 |
+- anon_vma != src->anon_vma && anon_vma->degree < 2) |
2294 |
++ anon_vma->num_children < 2 && |
2295 |
++ anon_vma->num_active_vmas == 0) |
2296 |
+ dst->anon_vma = anon_vma; |
2297 |
+ } |
2298 |
+ if (dst->anon_vma) |
2299 |
+- dst->anon_vma->degree++; |
2300 |
++ dst->anon_vma->num_active_vmas++; |
2301 |
+ unlock_anon_vma_root(root); |
2302 |
+ return 0; |
2303 |
+ |
2304 |
+@@ -358,6 +359,7 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma) |
2305 |
+ anon_vma = anon_vma_alloc(); |
2306 |
+ if (!anon_vma) |
2307 |
+ goto out_error; |
2308 |
++ anon_vma->num_active_vmas++; |
2309 |
+ avc = anon_vma_chain_alloc(GFP_KERNEL); |
2310 |
+ if (!avc) |
2311 |
+ goto out_error_free_anon_vma; |
2312 |
+@@ -378,7 +380,7 @@ int anon_vma_fork(struct vm_area_struct *vma, struct vm_area_struct *pvma) |
2313 |
+ vma->anon_vma = anon_vma; |
2314 |
+ anon_vma_lock_write(anon_vma); |
2315 |
+ anon_vma_chain_link(vma, avc, anon_vma); |
2316 |
+- anon_vma->parent->degree++; |
2317 |
++ anon_vma->parent->num_children++; |
2318 |
+ anon_vma_unlock_write(anon_vma); |
2319 |
+ |
2320 |
+ return 0; |
2321 |
+@@ -410,7 +412,7 @@ void unlink_anon_vmas(struct vm_area_struct *vma) |
2322 |
+ * to free them outside the lock. |
2323 |
+ */ |
2324 |
+ if (RB_EMPTY_ROOT(&anon_vma->rb_root.rb_root)) { |
2325 |
+- anon_vma->parent->degree--; |
2326 |
++ anon_vma->parent->num_children--; |
2327 |
+ continue; |
2328 |
+ } |
2329 |
+ |
2330 |
+@@ -418,7 +420,7 @@ void unlink_anon_vmas(struct vm_area_struct *vma) |
2331 |
+ anon_vma_chain_free(avc); |
2332 |
+ } |
2333 |
+ if (vma->anon_vma) { |
2334 |
+- vma->anon_vma->degree--; |
2335 |
++ vma->anon_vma->num_active_vmas--; |
2336 |
+ |
2337 |
+ /* |
2338 |
+ * vma would still be needed after unlink, and anon_vma will be prepared |
2339 |
+@@ -436,7 +438,8 @@ void unlink_anon_vmas(struct vm_area_struct *vma) |
2340 |
+ list_for_each_entry_safe(avc, next, &vma->anon_vma_chain, same_vma) { |
2341 |
+ struct anon_vma *anon_vma = avc->anon_vma; |
2342 |
+ |
2343 |
+- VM_WARN_ON(anon_vma->degree); |
2344 |
++ VM_WARN_ON(anon_vma->num_children); |
2345 |
++ VM_WARN_ON(anon_vma->num_active_vmas); |
2346 |
+ put_anon_vma(anon_vma); |
2347 |
+ |
2348 |
+ list_del(&avc->same_vma); |
2349 |
+diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c |
2350 |
+index f18d0c72713f1..48fbd0ae882bf 100644 |
2351 |
+--- a/net/bluetooth/l2cap_core.c |
2352 |
++++ b/net/bluetooth/l2cap_core.c |
2353 |
+@@ -1991,11 +1991,11 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm, |
2354 |
+ src_match = !bacmp(&c->src, src); |
2355 |
+ dst_match = !bacmp(&c->dst, dst); |
2356 |
+ if (src_match && dst_match) { |
2357 |
+- c = l2cap_chan_hold_unless_zero(c); |
2358 |
+- if (c) { |
2359 |
+- read_unlock(&chan_list_lock); |
2360 |
+- return c; |
2361 |
+- } |
2362 |
++ if (!l2cap_chan_hold_unless_zero(c)) |
2363 |
++ continue; |
2364 |
++ |
2365 |
++ read_unlock(&chan_list_lock); |
2366 |
++ return c; |
2367 |
+ } |
2368 |
+ |
2369 |
+ /* Closest match */ |
2370 |
+diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c |
2371 |
+index 56f059b3c242d..42f8de4ebbd7e 100644 |
2372 |
+--- a/net/bpf/test_run.c |
2373 |
++++ b/net/bpf/test_run.c |
2374 |
+@@ -955,6 +955,9 @@ static int convert___skb_to_skb(struct sk_buff *skb, struct __sk_buff *__skb) |
2375 |
+ { |
2376 |
+ struct qdisc_skb_cb *cb = (struct qdisc_skb_cb *)skb->cb; |
2377 |
+ |
2378 |
++ if (!skb->len) |
2379 |
++ return -EINVAL; |
2380 |
++ |
2381 |
+ if (!__skb) |
2382 |
+ return 0; |
2383 |
+ |
2384 |
+diff --git a/net/core/dev.c b/net/core/dev.c |
2385 |
+index a77a979a4bf75..ecaeb3ef8e5c3 100644 |
2386 |
+--- a/net/core/dev.c |
2387 |
++++ b/net/core/dev.c |
2388 |
+@@ -4168,6 +4168,7 @@ int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev) |
2389 |
+ bool again = false; |
2390 |
+ |
2391 |
+ skb_reset_mac_header(skb); |
2392 |
++ skb_assert_len(skb); |
2393 |
+ |
2394 |
+ if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_SCHED_TSTAMP)) |
2395 |
+ __skb_tstamp_tx(skb, NULL, NULL, skb->sk, SCM_TSTAMP_SCHED); |
2396 |
+diff --git a/net/core/neighbour.c b/net/core/neighbour.c |
2397 |
+index 54625287ee5b0..fbaa557ed7ece 100644 |
2398 |
+--- a/net/core/neighbour.c |
2399 |
++++ b/net/core/neighbour.c |
2400 |
+@@ -307,11 +307,26 @@ static int neigh_del_timer(struct neighbour *n) |
2401 |
+ return 0; |
2402 |
+ } |
2403 |
+ |
2404 |
+-static void pneigh_queue_purge(struct sk_buff_head *list) |
2405 |
++static void pneigh_queue_purge(struct sk_buff_head *list, struct net *net) |
2406 |
+ { |
2407 |
++ struct sk_buff_head tmp; |
2408 |
++ unsigned long flags; |
2409 |
+ struct sk_buff *skb; |
2410 |
+ |
2411 |
+- while ((skb = skb_dequeue(list)) != NULL) { |
2412 |
++ skb_queue_head_init(&tmp); |
2413 |
++ spin_lock_irqsave(&list->lock, flags); |
2414 |
++ skb = skb_peek(list); |
2415 |
++ while (skb != NULL) { |
2416 |
++ struct sk_buff *skb_next = skb_peek_next(skb, list); |
2417 |
++ if (net == NULL || net_eq(dev_net(skb->dev), net)) { |
2418 |
++ __skb_unlink(skb, list); |
2419 |
++ __skb_queue_tail(&tmp, skb); |
2420 |
++ } |
2421 |
++ skb = skb_next; |
2422 |
++ } |
2423 |
++ spin_unlock_irqrestore(&list->lock, flags); |
2424 |
++ |
2425 |
++ while ((skb = __skb_dequeue(&tmp))) { |
2426 |
+ dev_put(skb->dev); |
2427 |
+ kfree_skb(skb); |
2428 |
+ } |
2429 |
+@@ -385,9 +400,9 @@ static int __neigh_ifdown(struct neigh_table *tbl, struct net_device *dev, |
2430 |
+ write_lock_bh(&tbl->lock); |
2431 |
+ neigh_flush_dev(tbl, dev, skip_perm); |
2432 |
+ pneigh_ifdown_and_unlock(tbl, dev); |
2433 |
+- |
2434 |
+- del_timer_sync(&tbl->proxy_timer); |
2435 |
+- pneigh_queue_purge(&tbl->proxy_queue); |
2436 |
++ pneigh_queue_purge(&tbl->proxy_queue, dev_net(dev)); |
2437 |
++ if (skb_queue_empty_lockless(&tbl->proxy_queue)) |
2438 |
++ del_timer_sync(&tbl->proxy_timer); |
2439 |
+ return 0; |
2440 |
+ } |
2441 |
+ |
2442 |
+@@ -1787,7 +1802,7 @@ int neigh_table_clear(int index, struct neigh_table *tbl) |
2443 |
+ cancel_delayed_work_sync(&tbl->managed_work); |
2444 |
+ cancel_delayed_work_sync(&tbl->gc_work); |
2445 |
+ del_timer_sync(&tbl->proxy_timer); |
2446 |
+- pneigh_queue_purge(&tbl->proxy_queue); |
2447 |
++ pneigh_queue_purge(&tbl->proxy_queue, NULL); |
2448 |
+ neigh_ifdown(tbl, NULL); |
2449 |
+ if (atomic_read(&tbl->entries)) |
2450 |
+ pr_crit("neighbour leakage\n"); |
2451 |
+diff --git a/net/core/skmsg.c b/net/core/skmsg.c |
2452 |
+index a8dbea559c7f6..84209e661171e 100644 |
2453 |
+--- a/net/core/skmsg.c |
2454 |
++++ b/net/core/skmsg.c |
2455 |
+@@ -735,7 +735,9 @@ struct sk_psock *sk_psock_init(struct sock *sk, int node) |
2456 |
+ sk_psock_set_state(psock, SK_PSOCK_TX_ENABLED); |
2457 |
+ refcount_set(&psock->refcnt, 1); |
2458 |
+ |
2459 |
+- rcu_assign_sk_user_data_nocopy(sk, psock); |
2460 |
++ __rcu_assign_sk_user_data_with_flags(sk, psock, |
2461 |
++ SK_USER_DATA_NOCOPY | |
2462 |
++ SK_USER_DATA_PSOCK); |
2463 |
+ sock_hold(sk); |
2464 |
+ |
2465 |
+ out: |
2466 |
+diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig |
2467 |
+index ddc54b6d18ee4..8c0fea1bdc8d6 100644 |
2468 |
+--- a/net/netfilter/Kconfig |
2469 |
++++ b/net/netfilter/Kconfig |
2470 |
+@@ -144,7 +144,6 @@ config NF_CONNTRACK_ZONES |
2471 |
+ |
2472 |
+ config NF_CONNTRACK_PROCFS |
2473 |
+ bool "Supply CT list in procfs (OBSOLETE)" |
2474 |
+- default y |
2475 |
+ depends on PROC_FS |
2476 |
+ help |
2477 |
+ This option enables for the list of known conntrack entries |
2478 |
+diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c |
2479 |
+index ca6e92a229239..492bd35cccc09 100644 |
2480 |
+--- a/net/packet/af_packet.c |
2481 |
++++ b/net/packet/af_packet.c |
2482 |
+@@ -3037,8 +3037,8 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) |
2483 |
+ if (err) |
2484 |
+ goto out_free; |
2485 |
+ |
2486 |
+- if (sock->type == SOCK_RAW && |
2487 |
+- !dev_validate_header(dev, skb->data, len)) { |
2488 |
++ if ((sock->type == SOCK_RAW && |
2489 |
++ !dev_validate_header(dev, skb->data, len)) || !skb->len) { |
2490 |
+ err = -EINVAL; |
2491 |
+ goto out_free; |
2492 |
+ } |
2493 |
+diff --git a/sound/pci/hda/patch_cs8409-tables.c b/sound/pci/hda/patch_cs8409-tables.c |
2494 |
+index 4f4cc82159179..5b140301ca666 100644 |
2495 |
+--- a/sound/pci/hda/patch_cs8409-tables.c |
2496 |
++++ b/sound/pci/hda/patch_cs8409-tables.c |
2497 |
+@@ -546,6 +546,10 @@ const struct snd_pci_quirk cs8409_fixup_tbl[] = { |
2498 |
+ SND_PCI_QUIRK(0x1028, 0x0BD6, "Dolphin", CS8409_DOLPHIN), |
2499 |
+ SND_PCI_QUIRK(0x1028, 0x0BD7, "Dolphin", CS8409_DOLPHIN), |
2500 |
+ SND_PCI_QUIRK(0x1028, 0x0BD8, "Dolphin", CS8409_DOLPHIN), |
2501 |
++ SND_PCI_QUIRK(0x1028, 0x0C43, "Dolphin", CS8409_DOLPHIN), |
2502 |
++ SND_PCI_QUIRK(0x1028, 0x0C50, "Dolphin", CS8409_DOLPHIN), |
2503 |
++ SND_PCI_QUIRK(0x1028, 0x0C51, "Dolphin", CS8409_DOLPHIN), |
2504 |
++ SND_PCI_QUIRK(0x1028, 0x0C52, "Dolphin", CS8409_DOLPHIN), |
2505 |
+ {} /* terminator */ |
2506 |
+ }; |
2507 |
+ |
2508 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
2509 |
+index 1ae9674fa8a3c..b44b882f8378c 100644 |
2510 |
+--- a/sound/pci/hda/patch_realtek.c |
2511 |
++++ b/sound/pci/hda/patch_realtek.c |
2512 |
+@@ -9248,6 +9248,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
2513 |
+ SND_PCI_QUIRK(0x1043, 0x1271, "ASUS X430UN", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), |
2514 |
+ SND_PCI_QUIRK(0x1043, 0x1290, "ASUS X441SA", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
2515 |
+ SND_PCI_QUIRK(0x1043, 0x12a0, "ASUS X441UV", ALC233_FIXUP_EAPD_COEF_AND_MIC_NO_PRESENCE), |
2516 |
++ SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2), |
2517 |
+ SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), |
2518 |
+ SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), |
2519 |
+ SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE), |
2520 |
+@@ -9268,6 +9269,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
2521 |
+ SND_PCI_QUIRK(0x1043, 0x19e1, "ASUS UX581LV", ALC295_FIXUP_ASUS_MIC_NO_PRESENCE), |
2522 |
+ SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), |
2523 |
+ SND_PCI_QUIRK(0x1043, 0x1a30, "ASUS X705UD", ALC256_FIXUP_ASUS_MIC), |
2524 |
++ SND_PCI_QUIRK(0x1043, 0x1a8f, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2), |
2525 |
+ SND_PCI_QUIRK(0x1043, 0x1b11, "ASUS UX431DA", ALC294_FIXUP_ASUS_COEF_1B), |
2526 |
+ SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), |
2527 |
+ SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), |
2528 |
+diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c |
2529 |
+index 18b3da9211e32..5ada0d318d0ff 100644 |
2530 |
+--- a/sound/soc/codecs/rt5640.c |
2531 |
++++ b/sound/soc/codecs/rt5640.c |
2532 |
+@@ -1986,7 +1986,7 @@ static int rt5640_set_bias_level(struct snd_soc_component *component, |
2533 |
+ snd_soc_component_write(component, RT5640_PWR_MIXER, 0x0000); |
2534 |
+ if (rt5640->jd_src == RT5640_JD_SRC_HDA_HEADER) |
2535 |
+ snd_soc_component_write(component, RT5640_PWR_ANLG1, |
2536 |
+- 0x0018); |
2537 |
++ 0x2818); |
2538 |
+ else |
2539 |
+ snd_soc_component_write(component, RT5640_PWR_ANLG1, |
2540 |
+ 0x0000); |
2541 |
+@@ -2592,7 +2592,8 @@ static void rt5640_enable_hda_jack_detect( |
2542 |
+ snd_soc_component_update_bits(component, RT5640_DUMMY1, 0x400, 0x0); |
2543 |
+ |
2544 |
+ snd_soc_component_update_bits(component, RT5640_PWR_ANLG1, |
2545 |
+- RT5640_PWR_VREF2, RT5640_PWR_VREF2); |
2546 |
++ RT5640_PWR_VREF2 | RT5640_PWR_MB | RT5640_PWR_BG, |
2547 |
++ RT5640_PWR_VREF2 | RT5640_PWR_MB | RT5640_PWR_BG); |
2548 |
+ usleep_range(10000, 15000); |
2549 |
+ snd_soc_component_update_bits(component, RT5640_PWR_ANLG1, |
2550 |
+ RT5640_PWR_FV2, RT5640_PWR_FV2); |
2551 |
+diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c |
2552 |
+index e392de7a262ef..3d74acffec11f 100644 |
2553 |
+--- a/sound/soc/sh/rz-ssi.c |
2554 |
++++ b/sound/soc/sh/rz-ssi.c |
2555 |
+@@ -1016,32 +1016,36 @@ static int rz_ssi_probe(struct platform_device *pdev) |
2556 |
+ |
2557 |
+ ssi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); |
2558 |
+ if (IS_ERR(ssi->rstc)) { |
2559 |
+- rz_ssi_release_dma_channels(ssi); |
2560 |
+- return PTR_ERR(ssi->rstc); |
2561 |
++ ret = PTR_ERR(ssi->rstc); |
2562 |
++ goto err_reset; |
2563 |
+ } |
2564 |
+ |
2565 |
+ reset_control_deassert(ssi->rstc); |
2566 |
+ pm_runtime_enable(&pdev->dev); |
2567 |
+ ret = pm_runtime_resume_and_get(&pdev->dev); |
2568 |
+ if (ret < 0) { |
2569 |
+- rz_ssi_release_dma_channels(ssi); |
2570 |
+- pm_runtime_disable(ssi->dev); |
2571 |
+- reset_control_assert(ssi->rstc); |
2572 |
+- return dev_err_probe(ssi->dev, ret, "pm_runtime_resume_and_get failed\n"); |
2573 |
++ dev_err(&pdev->dev, "pm_runtime_resume_and_get failed\n"); |
2574 |
++ goto err_pm; |
2575 |
+ } |
2576 |
+ |
2577 |
+ ret = devm_snd_soc_register_component(&pdev->dev, &rz_ssi_soc_component, |
2578 |
+ rz_ssi_soc_dai, |
2579 |
+ ARRAY_SIZE(rz_ssi_soc_dai)); |
2580 |
+ if (ret < 0) { |
2581 |
+- rz_ssi_release_dma_channels(ssi); |
2582 |
+- |
2583 |
+- pm_runtime_put(ssi->dev); |
2584 |
+- pm_runtime_disable(ssi->dev); |
2585 |
+- reset_control_assert(ssi->rstc); |
2586 |
+ dev_err(&pdev->dev, "failed to register snd component\n"); |
2587 |
++ goto err_snd_soc; |
2588 |
+ } |
2589 |
+ |
2590 |
++ return 0; |
2591 |
++ |
2592 |
++err_snd_soc: |
2593 |
++ pm_runtime_put(ssi->dev); |
2594 |
++err_pm: |
2595 |
++ pm_runtime_disable(ssi->dev); |
2596 |
++ reset_control_assert(ssi->rstc); |
2597 |
++err_reset: |
2598 |
++ rz_ssi_release_dma_channels(ssi); |
2599 |
++ |
2600 |
+ return ret; |
2601 |
+ } |
2602 |
+ |
2603 |
+diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c |
2604 |
+index 168fd802d70bd..9bfead5efc4c1 100644 |
2605 |
+--- a/sound/usb/quirks.c |
2606 |
++++ b/sound/usb/quirks.c |
2607 |
+@@ -1903,6 +1903,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { |
2608 |
+ QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER), |
2609 |
+ DEVICE_FLG(0x21b4, 0x0081, /* AudioQuest DragonFly */ |
2610 |
+ QUIRK_FLAG_GET_SAMPLE_RATE), |
2611 |
++ DEVICE_FLG(0x2522, 0x0007, /* LH Labs Geek Out HD Audio 1V5 */ |
2612 |
++ QUIRK_FLAG_SET_IFACE_FIRST), |
2613 |
+ DEVICE_FLG(0x2708, 0x0002, /* Audient iD14 */ |
2614 |
+ QUIRK_FLAG_IGNORE_CTL_ERROR), |
2615 |
+ DEVICE_FLG(0x2912, 0x30c8, /* Audioengine D1 */ |
2616 |
+diff --git a/tools/testing/selftests/netfilter/nft_flowtable.sh b/tools/testing/selftests/netfilter/nft_flowtable.sh |
2617 |
+index d4ffebb989f88..c336e6c148d1f 100755 |
2618 |
+--- a/tools/testing/selftests/netfilter/nft_flowtable.sh |
2619 |
++++ b/tools/testing/selftests/netfilter/nft_flowtable.sh |
2620 |
+@@ -14,6 +14,11 @@ |
2621 |
+ # nft_flowtable.sh -o8000 -l1500 -r2000 |
2622 |
+ # |
2623 |
+ |
2624 |
++sfx=$(mktemp -u "XXXXXXXX") |
2625 |
++ns1="ns1-$sfx" |
2626 |
++ns2="ns2-$sfx" |
2627 |
++nsr1="nsr1-$sfx" |
2628 |
++nsr2="nsr2-$sfx" |
2629 |
+ |
2630 |
+ # Kselftest framework requirement - SKIP code is 4. |
2631 |
+ ksft_skip=4 |
2632 |
+@@ -36,18 +41,17 @@ checktool (){ |
2633 |
+ checktool "nft --version" "run test without nft tool" |
2634 |
+ checktool "ip -Version" "run test without ip tool" |
2635 |
+ checktool "which nc" "run test without nc (netcat)" |
2636 |
+-checktool "ip netns add nsr1" "create net namespace" |
2637 |
++checktool "ip netns add $nsr1" "create net namespace $nsr1" |
2638 |
+ |
2639 |
+-ip netns add ns1 |
2640 |
+-ip netns add ns2 |
2641 |
+- |
2642 |
+-ip netns add nsr2 |
2643 |
++ip netns add $ns1 |
2644 |
++ip netns add $ns2 |
2645 |
++ip netns add $nsr2 |
2646 |
+ |
2647 |
+ cleanup() { |
2648 |
+- for i in 1 2; do |
2649 |
+- ip netns del ns$i |
2650 |
+- ip netns del nsr$i |
2651 |
+- done |
2652 |
++ ip netns del $ns1 |
2653 |
++ ip netns del $ns2 |
2654 |
++ ip netns del $nsr1 |
2655 |
++ ip netns del $nsr2 |
2656 |
+ |
2657 |
+ rm -f "$ns1in" "$ns1out" |
2658 |
+ rm -f "$ns2in" "$ns2out" |
2659 |
+@@ -59,22 +63,21 @@ trap cleanup EXIT |
2660 |
+ |
2661 |
+ sysctl -q net.netfilter.nf_log_all_netns=1 |
2662 |
+ |
2663 |
+-ip link add veth0 netns nsr1 type veth peer name eth0 netns ns1 |
2664 |
+-ip link add veth1 netns nsr1 type veth peer name veth0 netns nsr2 |
2665 |
++ip link add veth0 netns $nsr1 type veth peer name eth0 netns $ns1 |
2666 |
++ip link add veth1 netns $nsr1 type veth peer name veth0 netns $nsr2 |
2667 |
+ |
2668 |
+-ip link add veth1 netns nsr2 type veth peer name eth0 netns ns2 |
2669 |
++ip link add veth1 netns $nsr2 type veth peer name eth0 netns $ns2 |
2670 |
+ |
2671 |
+ for dev in lo veth0 veth1; do |
2672 |
+- for i in 1 2; do |
2673 |
+- ip -net nsr$i link set $dev up |
2674 |
+- done |
2675 |
++ ip -net $nsr1 link set $dev up |
2676 |
++ ip -net $nsr2 link set $dev up |
2677 |
+ done |
2678 |
+ |
2679 |
+-ip -net nsr1 addr add 10.0.1.1/24 dev veth0 |
2680 |
+-ip -net nsr1 addr add dead:1::1/64 dev veth0 |
2681 |
++ip -net $nsr1 addr add 10.0.1.1/24 dev veth0 |
2682 |
++ip -net $nsr1 addr add dead:1::1/64 dev veth0 |
2683 |
+ |
2684 |
+-ip -net nsr2 addr add 10.0.2.1/24 dev veth1 |
2685 |
+-ip -net nsr2 addr add dead:2::1/64 dev veth1 |
2686 |
++ip -net $nsr2 addr add 10.0.2.1/24 dev veth1 |
2687 |
++ip -net $nsr2 addr add dead:2::1/64 dev veth1 |
2688 |
+ |
2689 |
+ # set different MTUs so we need to push packets coming from ns1 (large MTU) |
2690 |
+ # to ns2 (smaller MTU) to stack either to perform fragmentation (ip_no_pmtu_disc=1), |
2691 |
+@@ -106,49 +109,56 @@ do |
2692 |
+ esac |
2693 |
+ done |
2694 |
+ |
2695 |
+-if ! ip -net nsr1 link set veth0 mtu $omtu; then |
2696 |
++if ! ip -net $nsr1 link set veth0 mtu $omtu; then |
2697 |
+ exit 1 |
2698 |
+ fi |
2699 |
+ |
2700 |
+-ip -net ns1 link set eth0 mtu $omtu |
2701 |
++ip -net $ns1 link set eth0 mtu $omtu |
2702 |
+ |
2703 |
+-if ! ip -net nsr2 link set veth1 mtu $rmtu; then |
2704 |
++if ! ip -net $nsr2 link set veth1 mtu $rmtu; then |
2705 |
+ exit 1 |
2706 |
+ fi |
2707 |
+ |
2708 |
+-ip -net ns2 link set eth0 mtu $rmtu |
2709 |
++ip -net $ns2 link set eth0 mtu $rmtu |
2710 |
+ |
2711 |
+ # transfer-net between nsr1 and nsr2. |
2712 |
+ # these addresses are not used for connections. |
2713 |
+-ip -net nsr1 addr add 192.168.10.1/24 dev veth1 |
2714 |
+-ip -net nsr1 addr add fee1:2::1/64 dev veth1 |
2715 |
+- |
2716 |
+-ip -net nsr2 addr add 192.168.10.2/24 dev veth0 |
2717 |
+-ip -net nsr2 addr add fee1:2::2/64 dev veth0 |
2718 |
+- |
2719 |
+-for i in 1 2; do |
2720 |
+- ip netns exec nsr$i sysctl net.ipv4.conf.veth0.forwarding=1 > /dev/null |
2721 |
+- ip netns exec nsr$i sysctl net.ipv4.conf.veth1.forwarding=1 > /dev/null |
2722 |
+- |
2723 |
+- ip -net ns$i link set lo up |
2724 |
+- ip -net ns$i link set eth0 up |
2725 |
+- ip -net ns$i addr add 10.0.$i.99/24 dev eth0 |
2726 |
+- ip -net ns$i route add default via 10.0.$i.1 |
2727 |
+- ip -net ns$i addr add dead:$i::99/64 dev eth0 |
2728 |
+- ip -net ns$i route add default via dead:$i::1 |
2729 |
+- if ! ip netns exec ns$i sysctl net.ipv4.tcp_no_metrics_save=1 > /dev/null; then |
2730 |
++ip -net $nsr1 addr add 192.168.10.1/24 dev veth1 |
2731 |
++ip -net $nsr1 addr add fee1:2::1/64 dev veth1 |
2732 |
++ |
2733 |
++ip -net $nsr2 addr add 192.168.10.2/24 dev veth0 |
2734 |
++ip -net $nsr2 addr add fee1:2::2/64 dev veth0 |
2735 |
++ |
2736 |
++for i in 0 1; do |
2737 |
++ ip netns exec $nsr1 sysctl net.ipv4.conf.veth$i.forwarding=1 > /dev/null |
2738 |
++ ip netns exec $nsr2 sysctl net.ipv4.conf.veth$i.forwarding=1 > /dev/null |
2739 |
++done |
2740 |
++ |
2741 |
++for ns in $ns1 $ns2;do |
2742 |
++ ip -net $ns link set lo up |
2743 |
++ ip -net $ns link set eth0 up |
2744 |
++ |
2745 |
++ if ! ip netns exec $ns sysctl net.ipv4.tcp_no_metrics_save=1 > /dev/null; then |
2746 |
+ echo "ERROR: Check Originator/Responder values (problem during address addition)" |
2747 |
+ exit 1 |
2748 |
+ fi |
2749 |
+- |
2750 |
+ # don't set ip DF bit for first two tests |
2751 |
+- ip netns exec ns$i sysctl net.ipv4.ip_no_pmtu_disc=1 > /dev/null |
2752 |
++ ip netns exec $ns sysctl net.ipv4.ip_no_pmtu_disc=1 > /dev/null |
2753 |
+ done |
2754 |
+ |
2755 |
+-ip -net nsr1 route add default via 192.168.10.2 |
2756 |
+-ip -net nsr2 route add default via 192.168.10.1 |
2757 |
++ip -net $ns1 addr add 10.0.1.99/24 dev eth0 |
2758 |
++ip -net $ns2 addr add 10.0.2.99/24 dev eth0 |
2759 |
++ip -net $ns1 route add default via 10.0.1.1 |
2760 |
++ip -net $ns2 route add default via 10.0.2.1 |
2761 |
++ip -net $ns1 addr add dead:1::99/64 dev eth0 |
2762 |
++ip -net $ns2 addr add dead:2::99/64 dev eth0 |
2763 |
++ip -net $ns1 route add default via dead:1::1 |
2764 |
++ip -net $ns2 route add default via dead:2::1 |
2765 |
++ |
2766 |
++ip -net $nsr1 route add default via 192.168.10.2 |
2767 |
++ip -net $nsr2 route add default via 192.168.10.1 |
2768 |
+ |
2769 |
+-ip netns exec nsr1 nft -f - <<EOF |
2770 |
++ip netns exec $nsr1 nft -f - <<EOF |
2771 |
+ table inet filter { |
2772 |
+ flowtable f1 { |
2773 |
+ hook ingress priority 0 |
2774 |
+@@ -197,18 +207,18 @@ if [ $? -ne 0 ]; then |
2775 |
+ fi |
2776 |
+ |
2777 |
+ # test basic connectivity |
2778 |
+-if ! ip netns exec ns1 ping -c 1 -q 10.0.2.99 > /dev/null; then |
2779 |
+- echo "ERROR: ns1 cannot reach ns2" 1>&2 |
2780 |
++if ! ip netns exec $ns1 ping -c 1 -q 10.0.2.99 > /dev/null; then |
2781 |
++ echo "ERROR: $ns1 cannot reach ns2" 1>&2 |
2782 |
+ exit 1 |
2783 |
+ fi |
2784 |
+ |
2785 |
+-if ! ip netns exec ns2 ping -c 1 -q 10.0.1.99 > /dev/null; then |
2786 |
+- echo "ERROR: ns2 cannot reach ns1" 1>&2 |
2787 |
++if ! ip netns exec $ns2 ping -c 1 -q 10.0.1.99 > /dev/null; then |
2788 |
++ echo "ERROR: $ns2 cannot reach $ns1" 1>&2 |
2789 |
+ exit 1 |
2790 |
+ fi |
2791 |
+ |
2792 |
+ if [ $ret -eq 0 ];then |
2793 |
+- echo "PASS: netns routing/connectivity: ns1 can reach ns2" |
2794 |
++ echo "PASS: netns routing/connectivity: $ns1 can reach $ns2" |
2795 |
+ fi |
2796 |
+ |
2797 |
+ ns1in=$(mktemp) |
2798 |
+@@ -312,24 +322,24 @@ make_file "$ns2in" |
2799 |
+ |
2800 |
+ # First test: |
2801 |
+ # No PMTU discovery, nsr1 is expected to fragment packets from ns1 to ns2 as needed. |
2802 |
+-if test_tcp_forwarding ns1 ns2; then |
2803 |
++if test_tcp_forwarding $ns1 $ns2; then |
2804 |
+ echo "PASS: flow offloaded for ns1/ns2" |
2805 |
+ else |
2806 |
+ echo "FAIL: flow offload for ns1/ns2:" 1>&2 |
2807 |
+- ip netns exec nsr1 nft list ruleset |
2808 |
++ ip netns exec $nsr1 nft list ruleset |
2809 |
+ ret=1 |
2810 |
+ fi |
2811 |
+ |
2812 |
+ # delete default route, i.e. ns2 won't be able to reach ns1 and |
2813 |
+ # will depend on ns1 being masqueraded in nsr1. |
2814 |
+ # expect ns1 has nsr1 address. |
2815 |
+-ip -net ns2 route del default via 10.0.2.1 |
2816 |
+-ip -net ns2 route del default via dead:2::1 |
2817 |
+-ip -net ns2 route add 192.168.10.1 via 10.0.2.1 |
2818 |
++ip -net $ns2 route del default via 10.0.2.1 |
2819 |
++ip -net $ns2 route del default via dead:2::1 |
2820 |
++ip -net $ns2 route add 192.168.10.1 via 10.0.2.1 |
2821 |
+ |
2822 |
+ # Second test: |
2823 |
+ # Same, but with NAT enabled. |
2824 |
+-ip netns exec nsr1 nft -f - <<EOF |
2825 |
++ip netns exec $nsr1 nft -f - <<EOF |
2826 |
+ table ip nat { |
2827 |
+ chain prerouting { |
2828 |
+ type nat hook prerouting priority 0; policy accept; |
2829 |
+@@ -343,47 +353,47 @@ table ip nat { |
2830 |
+ } |
2831 |
+ EOF |
2832 |
+ |
2833 |
+-if test_tcp_forwarding_nat ns1 ns2; then |
2834 |
++if test_tcp_forwarding_nat $ns1 $ns2; then |
2835 |
+ echo "PASS: flow offloaded for ns1/ns2 with NAT" |
2836 |
+ else |
2837 |
+ echo "FAIL: flow offload for ns1/ns2 with NAT" 1>&2 |
2838 |
+- ip netns exec nsr1 nft list ruleset |
2839 |
++ ip netns exec $nsr1 nft list ruleset |
2840 |
+ ret=1 |
2841 |
+ fi |
2842 |
+ |
2843 |
+ # Third test: |
2844 |
+ # Same as second test, but with PMTU discovery enabled. |
2845 |
+-handle=$(ip netns exec nsr1 nft -a list table inet filter | grep something-to-grep-for | cut -d \# -f 2) |
2846 |
++handle=$(ip netns exec $nsr1 nft -a list table inet filter | grep something-to-grep-for | cut -d \# -f 2) |
2847 |
+ |
2848 |
+-if ! ip netns exec nsr1 nft delete rule inet filter forward $handle; then |
2849 |
++if ! ip netns exec $nsr1 nft delete rule inet filter forward $handle; then |
2850 |
+ echo "FAIL: Could not delete large-packet accept rule" |
2851 |
+ exit 1 |
2852 |
+ fi |
2853 |
+ |
2854 |
+-ip netns exec ns1 sysctl net.ipv4.ip_no_pmtu_disc=0 > /dev/null |
2855 |
+-ip netns exec ns2 sysctl net.ipv4.ip_no_pmtu_disc=0 > /dev/null |
2856 |
++ip netns exec $ns1 sysctl net.ipv4.ip_no_pmtu_disc=0 > /dev/null |
2857 |
++ip netns exec $ns2 sysctl net.ipv4.ip_no_pmtu_disc=0 > /dev/null |
2858 |
+ |
2859 |
+-if test_tcp_forwarding_nat ns1 ns2; then |
2860 |
++if test_tcp_forwarding_nat $ns1 $ns2; then |
2861 |
+ echo "PASS: flow offloaded for ns1/ns2 with NAT and pmtu discovery" |
2862 |
+ else |
2863 |
+ echo "FAIL: flow offload for ns1/ns2 with NAT and pmtu discovery" 1>&2 |
2864 |
+- ip netns exec nsr1 nft list ruleset |
2865 |
++ ip netns exec $nsr1 nft list ruleset |
2866 |
+ fi |
2867 |
+ |
2868 |
+ # Another test: |
2869 |
+ # Add bridge interface br0 to Router1, with NAT enabled. |
2870 |
+-ip -net nsr1 link add name br0 type bridge |
2871 |
+-ip -net nsr1 addr flush dev veth0 |
2872 |
+-ip -net nsr1 link set up dev veth0 |
2873 |
+-ip -net nsr1 link set veth0 master br0 |
2874 |
+-ip -net nsr1 addr add 10.0.1.1/24 dev br0 |
2875 |
+-ip -net nsr1 addr add dead:1::1/64 dev br0 |
2876 |
+-ip -net nsr1 link set up dev br0 |
2877 |
++ip -net $nsr1 link add name br0 type bridge |
2878 |
++ip -net $nsr1 addr flush dev veth0 |
2879 |
++ip -net $nsr1 link set up dev veth0 |
2880 |
++ip -net $nsr1 link set veth0 master br0 |
2881 |
++ip -net $nsr1 addr add 10.0.1.1/24 dev br0 |
2882 |
++ip -net $nsr1 addr add dead:1::1/64 dev br0 |
2883 |
++ip -net $nsr1 link set up dev br0 |
2884 |
+ |
2885 |
+-ip netns exec nsr1 sysctl net.ipv4.conf.br0.forwarding=1 > /dev/null |
2886 |
++ip netns exec $nsr1 sysctl net.ipv4.conf.br0.forwarding=1 > /dev/null |
2887 |
+ |
2888 |
+ # br0 with NAT enabled. |
2889 |
+-ip netns exec nsr1 nft -f - <<EOF |
2890 |
++ip netns exec $nsr1 nft -f - <<EOF |
2891 |
+ flush table ip nat |
2892 |
+ table ip nat { |
2893 |
+ chain prerouting { |
2894 |
+@@ -398,59 +408,59 @@ table ip nat { |
2895 |
+ } |
2896 |
+ EOF |
2897 |
+ |
2898 |
+-if test_tcp_forwarding_nat ns1 ns2; then |
2899 |
++if test_tcp_forwarding_nat $ns1 $ns2; then |
2900 |
+ echo "PASS: flow offloaded for ns1/ns2 with bridge NAT" |
2901 |
+ else |
2902 |
+ echo "FAIL: flow offload for ns1/ns2 with bridge NAT" 1>&2 |
2903 |
+- ip netns exec nsr1 nft list ruleset |
2904 |
++ ip netns exec $nsr1 nft list ruleset |
2905 |
+ ret=1 |
2906 |
+ fi |
2907 |
+ |
2908 |
+ # Another test: |
2909 |
+ # Add bridge interface br0 to Router1, with NAT and VLAN. |
2910 |
+-ip -net nsr1 link set veth0 nomaster |
2911 |
+-ip -net nsr1 link set down dev veth0 |
2912 |
+-ip -net nsr1 link add link veth0 name veth0.10 type vlan id 10 |
2913 |
+-ip -net nsr1 link set up dev veth0 |
2914 |
+-ip -net nsr1 link set up dev veth0.10 |
2915 |
+-ip -net nsr1 link set veth0.10 master br0 |
2916 |
+- |
2917 |
+-ip -net ns1 addr flush dev eth0 |
2918 |
+-ip -net ns1 link add link eth0 name eth0.10 type vlan id 10 |
2919 |
+-ip -net ns1 link set eth0 up |
2920 |
+-ip -net ns1 link set eth0.10 up |
2921 |
+-ip -net ns1 addr add 10.0.1.99/24 dev eth0.10 |
2922 |
+-ip -net ns1 route add default via 10.0.1.1 |
2923 |
+-ip -net ns1 addr add dead:1::99/64 dev eth0.10 |
2924 |
+- |
2925 |
+-if test_tcp_forwarding_nat ns1 ns2; then |
2926 |
++ip -net $nsr1 link set veth0 nomaster |
2927 |
++ip -net $nsr1 link set down dev veth0 |
2928 |
++ip -net $nsr1 link add link veth0 name veth0.10 type vlan id 10 |
2929 |
++ip -net $nsr1 link set up dev veth0 |
2930 |
++ip -net $nsr1 link set up dev veth0.10 |
2931 |
++ip -net $nsr1 link set veth0.10 master br0 |
2932 |
++ |
2933 |
++ip -net $ns1 addr flush dev eth0 |
2934 |
++ip -net $ns1 link add link eth0 name eth0.10 type vlan id 10 |
2935 |
++ip -net $ns1 link set eth0 up |
2936 |
++ip -net $ns1 link set eth0.10 up |
2937 |
++ip -net $ns1 addr add 10.0.1.99/24 dev eth0.10 |
2938 |
++ip -net $ns1 route add default via 10.0.1.1 |
2939 |
++ip -net $ns1 addr add dead:1::99/64 dev eth0.10 |
2940 |
++ |
2941 |
++if test_tcp_forwarding_nat $ns1 $ns2; then |
2942 |
+ echo "PASS: flow offloaded for ns1/ns2 with bridge NAT and VLAN" |
2943 |
+ else |
2944 |
+ echo "FAIL: flow offload for ns1/ns2 with bridge NAT and VLAN" 1>&2 |
2945 |
+- ip netns exec nsr1 nft list ruleset |
2946 |
++ ip netns exec $nsr1 nft list ruleset |
2947 |
+ ret=1 |
2948 |
+ fi |
2949 |
+ |
2950 |
+ # restore test topology (remove bridge and VLAN) |
2951 |
+-ip -net nsr1 link set veth0 nomaster |
2952 |
+-ip -net nsr1 link set veth0 down |
2953 |
+-ip -net nsr1 link set veth0.10 down |
2954 |
+-ip -net nsr1 link delete veth0.10 type vlan |
2955 |
+-ip -net nsr1 link delete br0 type bridge |
2956 |
+-ip -net ns1 addr flush dev eth0.10 |
2957 |
+-ip -net ns1 link set eth0.10 down |
2958 |
+-ip -net ns1 link set eth0 down |
2959 |
+-ip -net ns1 link delete eth0.10 type vlan |
2960 |
++ip -net $nsr1 link set veth0 nomaster |
2961 |
++ip -net $nsr1 link set veth0 down |
2962 |
++ip -net $nsr1 link set veth0.10 down |
2963 |
++ip -net $nsr1 link delete veth0.10 type vlan |
2964 |
++ip -net $nsr1 link delete br0 type bridge |
2965 |
++ip -net $ns1 addr flush dev eth0.10 |
2966 |
++ip -net $ns1 link set eth0.10 down |
2967 |
++ip -net $ns1 link set eth0 down |
2968 |
++ip -net $ns1 link delete eth0.10 type vlan |
2969 |
+ |
2970 |
+ # restore address in ns1 and nsr1 |
2971 |
+-ip -net ns1 link set eth0 up |
2972 |
+-ip -net ns1 addr add 10.0.1.99/24 dev eth0 |
2973 |
+-ip -net ns1 route add default via 10.0.1.1 |
2974 |
+-ip -net ns1 addr add dead:1::99/64 dev eth0 |
2975 |
+-ip -net ns1 route add default via dead:1::1 |
2976 |
+-ip -net nsr1 addr add 10.0.1.1/24 dev veth0 |
2977 |
+-ip -net nsr1 addr add dead:1::1/64 dev veth0 |
2978 |
+-ip -net nsr1 link set up dev veth0 |
2979 |
++ip -net $ns1 link set eth0 up |
2980 |
++ip -net $ns1 addr add 10.0.1.99/24 dev eth0 |
2981 |
++ip -net $ns1 route add default via 10.0.1.1 |
2982 |
++ip -net $ns1 addr add dead:1::99/64 dev eth0 |
2983 |
++ip -net $ns1 route add default via dead:1::1 |
2984 |
++ip -net $nsr1 addr add 10.0.1.1/24 dev veth0 |
2985 |
++ip -net $nsr1 addr add dead:1::1/64 dev veth0 |
2986 |
++ip -net $nsr1 link set up dev veth0 |
2987 |
+ |
2988 |
+ KEY_SHA="0x"$(ps -xaf | sha1sum | cut -d " " -f 1) |
2989 |
+ KEY_AES="0x"$(ps -xaf | md5sum | cut -d " " -f 1) |
2990 |
+@@ -480,23 +490,23 @@ do_esp() { |
2991 |
+ |
2992 |
+ } |
2993 |
+ |
2994 |
+-do_esp nsr1 192.168.10.1 192.168.10.2 10.0.1.0/24 10.0.2.0/24 $SPI1 $SPI2 |
2995 |
++do_esp $nsr1 192.168.10.1 192.168.10.2 10.0.1.0/24 10.0.2.0/24 $SPI1 $SPI2 |
2996 |
+ |
2997 |
+-do_esp nsr2 192.168.10.2 192.168.10.1 10.0.2.0/24 10.0.1.0/24 $SPI2 $SPI1 |
2998 |
++do_esp $nsr2 192.168.10.2 192.168.10.1 10.0.2.0/24 10.0.1.0/24 $SPI2 $SPI1 |
2999 |
+ |
3000 |
+-ip netns exec nsr1 nft delete table ip nat |
3001 |
++ip netns exec $nsr1 nft delete table ip nat |
3002 |
+ |
3003 |
+ # restore default routes |
3004 |
+-ip -net ns2 route del 192.168.10.1 via 10.0.2.1 |
3005 |
+-ip -net ns2 route add default via 10.0.2.1 |
3006 |
+-ip -net ns2 route add default via dead:2::1 |
3007 |
++ip -net $ns2 route del 192.168.10.1 via 10.0.2.1 |
3008 |
++ip -net $ns2 route add default via 10.0.2.1 |
3009 |
++ip -net $ns2 route add default via dead:2::1 |
3010 |
+ |
3011 |
+-if test_tcp_forwarding ns1 ns2; then |
3012 |
++if test_tcp_forwarding $ns1 $ns2; then |
3013 |
+ echo "PASS: ipsec tunnel mode for ns1/ns2" |
3014 |
+ else |
3015 |
+ echo "FAIL: ipsec tunnel mode for ns1/ns2" |
3016 |
+- ip netns exec nsr1 nft list ruleset 1>&2 |
3017 |
+- ip netns exec nsr1 cat /proc/net/xfrm_stat 1>&2 |
3018 |
++ ip netns exec $nsr1 nft list ruleset 1>&2 |
3019 |
++ ip netns exec $nsr1 cat /proc/net/xfrm_stat 1>&2 |
3020 |
+ fi |
3021 |
+ |
3022 |
+ exit $ret |
3023 |
+diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c |
3024 |
+index f3ec628f5e519..4b48af8a83096 100644 |
3025 |
+--- a/tools/tracing/rtla/src/timerlat_hist.c |
3026 |
++++ b/tools/tracing/rtla/src/timerlat_hist.c |
3027 |
+@@ -892,7 +892,7 @@ int timerlat_hist_main(int argc, char *argv[]) |
3028 |
+ return_value = 0; |
3029 |
+ |
3030 |
+ if (trace_is_off(&tool->trace, &record->trace)) { |
3031 |
+- printf("rtla timelat hit stop tracing\n"); |
3032 |
++ printf("rtla timerlat hit stop tracing\n"); |
3033 |
+ if (params->trace_output) { |
3034 |
+ printf(" Saving trace to %s\n", params->trace_output); |
3035 |
+ save_trace_to_file(record->trace.inst, params->trace_output); |
3036 |
+diff --git a/tools/tracing/rtla/src/timerlat_top.c b/tools/tracing/rtla/src/timerlat_top.c |
3037 |
+index 35452a1d45e9f..3342719352222 100644 |
3038 |
+--- a/tools/tracing/rtla/src/timerlat_top.c |
3039 |
++++ b/tools/tracing/rtla/src/timerlat_top.c |
3040 |
+@@ -687,7 +687,7 @@ int timerlat_top_main(int argc, char *argv[]) |
3041 |
+ return_value = 0; |
3042 |
+ |
3043 |
+ if (trace_is_off(&top->trace, &record->trace)) { |
3044 |
+- printf("rtla timelat hit stop tracing\n"); |
3045 |
++ printf("rtla timerlat hit stop tracing\n"); |
3046 |
+ if (params->trace_output) { |
3047 |
+ printf(" Saving trace to %s\n", params->trace_output); |
3048 |
+ save_trace_to_file(record->trace.inst, params->trace_output); |