1 |
commit: b7735e17fd523355ba6a2acdbe904dca2f28b6e8 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 26 12:27:38 2020 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 26 12:27:38 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=b7735e17 |
7 |
|
8 |
Linux patch 5.4.15 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1014_linux-5.4.15.patch | 4477 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 4481 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index b9c4fa1..34417c5 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -99,6 +99,10 @@ Patch: 1013_linux-5.4.14.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.4.14 |
23 |
|
24 |
+Patch: 1014_linux-5.4.15.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.4.15 |
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/1014_linux-5.4.15.patch b/1014_linux-5.4.15.patch |
33 |
new file mode 100644 |
34 |
index 0000000..ef45a17 |
35 |
--- /dev/null |
36 |
+++ b/1014_linux-5.4.15.patch |
37 |
@@ -0,0 +1,4477 @@ |
38 |
+diff --git a/Documentation/devicetree/bindings/rng/omap3_rom_rng.txt b/Documentation/devicetree/bindings/rng/omap3_rom_rng.txt |
39 |
+new file mode 100644 |
40 |
+index 000000000000..f315c9723bd2 |
41 |
+--- /dev/null |
42 |
++++ b/Documentation/devicetree/bindings/rng/omap3_rom_rng.txt |
43 |
+@@ -0,0 +1,27 @@ |
44 |
++OMAP ROM RNG driver binding |
45 |
++ |
46 |
++Secure SoCs may provide RNG via secure ROM calls like Nokia N900 does. The |
47 |
++implementation can depend on the SoC secure ROM used. |
48 |
++ |
49 |
++- compatible: |
50 |
++ Usage: required |
51 |
++ Value type: <string> |
52 |
++ Definition: must be "nokia,n900-rom-rng" |
53 |
++ |
54 |
++- clocks: |
55 |
++ Usage: required |
56 |
++ Value type: <prop-encoded-array> |
57 |
++ Definition: reference to the the RNG interface clock |
58 |
++ |
59 |
++- clock-names: |
60 |
++ Usage: required |
61 |
++ Value type: <stringlist> |
62 |
++ Definition: must be "ick" |
63 |
++ |
64 |
++Example: |
65 |
++ |
66 |
++ rom_rng: rng { |
67 |
++ compatible = "nokia,n900-rom-rng"; |
68 |
++ clocks = <&rng_ick>; |
69 |
++ clock-names = "ick"; |
70 |
++ }; |
71 |
+diff --git a/Makefile b/Makefile |
72 |
+index 2b2080d08bb2..30600e309c73 100644 |
73 |
+--- a/Makefile |
74 |
++++ b/Makefile |
75 |
+@@ -1,7 +1,7 @@ |
76 |
+ # SPDX-License-Identifier: GPL-2.0 |
77 |
+ VERSION = 5 |
78 |
+ PATCHLEVEL = 4 |
79 |
+-SUBLEVEL = 14 |
80 |
++SUBLEVEL = 15 |
81 |
+ EXTRAVERSION = |
82 |
+ NAME = Kleptomaniac Octopus |
83 |
+ |
84 |
+diff --git a/arch/arm/boot/dts/logicpd-torpedo-37xx-devkit-28.dts b/arch/arm/boot/dts/logicpd-torpedo-37xx-devkit-28.dts |
85 |
+index 07ac99b9cda6..cdb89b3e2a9b 100644 |
86 |
+--- a/arch/arm/boot/dts/logicpd-torpedo-37xx-devkit-28.dts |
87 |
++++ b/arch/arm/boot/dts/logicpd-torpedo-37xx-devkit-28.dts |
88 |
+@@ -11,22 +11,6 @@ |
89 |
+ #include "logicpd-torpedo-37xx-devkit.dts" |
90 |
+ |
91 |
+ &lcd0 { |
92 |
+- |
93 |
+- label = "28"; |
94 |
+- |
95 |
+- panel-timing { |
96 |
+- clock-frequency = <9000000>; |
97 |
+- hactive = <480>; |
98 |
+- vactive = <272>; |
99 |
+- hfront-porch = <3>; |
100 |
+- hback-porch = <2>; |
101 |
+- hsync-len = <42>; |
102 |
+- vback-porch = <3>; |
103 |
+- vfront-porch = <2>; |
104 |
+- vsync-len = <11>; |
105 |
+- hsync-active = <1>; |
106 |
+- vsync-active = <1>; |
107 |
+- de-active = <1>; |
108 |
+- pixelclk-active = <0>; |
109 |
+- }; |
110 |
++ /* To make it work, set CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=4 */ |
111 |
++ compatible = "logicpd,type28"; |
112 |
+ }; |
113 |
+diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts |
114 |
+index 84a5ade1e865..63659880eeb3 100644 |
115 |
+--- a/arch/arm/boot/dts/omap3-n900.dts |
116 |
++++ b/arch/arm/boot/dts/omap3-n900.dts |
117 |
+@@ -155,6 +155,12 @@ |
118 |
+ pwms = <&pwm9 0 26316 0>; /* 38000 Hz */ |
119 |
+ }; |
120 |
+ |
121 |
++ rom_rng: rng { |
122 |
++ compatible = "nokia,n900-rom-rng"; |
123 |
++ clocks = <&rng_ick>; |
124 |
++ clock-names = "ick"; |
125 |
++ }; |
126 |
++ |
127 |
+ /* controlled (enabled/disabled) directly by bcm2048 and wl1251 */ |
128 |
+ vctcxo: vctcxo { |
129 |
+ compatible = "fixed-clock"; |
130 |
+diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c |
131 |
+index 439e143cad7b..46012ca812f4 100644 |
132 |
+--- a/arch/arm/mach-omap2/display.c |
133 |
++++ b/arch/arm/mach-omap2/display.c |
134 |
+@@ -265,6 +265,7 @@ static int __init omapdss_init_of(void) |
135 |
+ r = of_platform_populate(node, NULL, NULL, &pdev->dev); |
136 |
+ if (r) { |
137 |
+ pr_err("Unable to populate DSS submodule devices\n"); |
138 |
++ put_device(&pdev->dev); |
139 |
+ return r; |
140 |
+ } |
141 |
+ |
142 |
+diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c |
143 |
+index 33688e1d9acf..247e3f8acffe 100644 |
144 |
+--- a/arch/arm/mach-omap2/pdata-quirks.c |
145 |
++++ b/arch/arm/mach-omap2/pdata-quirks.c |
146 |
+@@ -268,14 +268,6 @@ static void __init am3517_evm_legacy_init(void) |
147 |
+ am35xx_emac_reset(); |
148 |
+ } |
149 |
+ |
150 |
+-static struct platform_device omap3_rom_rng_device = { |
151 |
+- .name = "omap3-rom-rng", |
152 |
+- .id = -1, |
153 |
+- .dev = { |
154 |
+- .platform_data = rx51_secure_rng_call, |
155 |
+- }, |
156 |
+-}; |
157 |
+- |
158 |
+ static void __init nokia_n900_legacy_init(void) |
159 |
+ { |
160 |
+ hsmmc2_internal_input_clk(); |
161 |
+@@ -291,9 +283,6 @@ static void __init nokia_n900_legacy_init(void) |
162 |
+ pr_warn("RX-51: Not enabling ARM errata 430973 workaround\n"); |
163 |
+ pr_warn("Thumb binaries may crash randomly without this workaround\n"); |
164 |
+ } |
165 |
+- |
166 |
+- pr_info("RX-51: Registering OMAP3 HWRNG device\n"); |
167 |
+- platform_device_register(&omap3_rom_rng_device); |
168 |
+ } |
169 |
+ } |
170 |
+ |
171 |
+@@ -538,6 +527,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { |
172 |
+ OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL), |
173 |
+ OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0", |
174 |
+ &am35xx_emac_pdata), |
175 |
++ OF_DEV_AUXDATA("nokia,n900-rom-rng", 0, NULL, rx51_secure_rng_call), |
176 |
+ /* McBSP modules with sidetone core */ |
177 |
+ #if IS_ENABLED(CONFIG_SND_SOC_OMAP_MCBSP) |
178 |
+ OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49022000, "49022000.mcbsp", &mcbsp_pdata), |
179 |
+diff --git a/arch/powerpc/include/asm/archrandom.h b/arch/powerpc/include/asm/archrandom.h |
180 |
+index 9c63b596e6ce..a09595f00cab 100644 |
181 |
+--- a/arch/powerpc/include/asm/archrandom.h |
182 |
++++ b/arch/powerpc/include/asm/archrandom.h |
183 |
+@@ -28,7 +28,7 @@ static inline int arch_get_random_seed_int(unsigned int *v) |
184 |
+ unsigned long val; |
185 |
+ int rc; |
186 |
+ |
187 |
+- rc = arch_get_random_long(&val); |
188 |
++ rc = arch_get_random_seed_long(&val); |
189 |
+ if (rc) |
190 |
+ *v = val; |
191 |
+ |
192 |
+diff --git a/arch/powerpc/include/asm/security_features.h b/arch/powerpc/include/asm/security_features.h |
193 |
+index ccf44c135389..7c05e95a5c44 100644 |
194 |
+--- a/arch/powerpc/include/asm/security_features.h |
195 |
++++ b/arch/powerpc/include/asm/security_features.h |
196 |
+@@ -9,7 +9,7 @@ |
197 |
+ #define _ASM_POWERPC_SECURITY_FEATURES_H |
198 |
+ |
199 |
+ |
200 |
+-extern unsigned long powerpc_security_features; |
201 |
++extern u64 powerpc_security_features; |
202 |
+ extern bool rfi_flush; |
203 |
+ |
204 |
+ /* These are bit flags */ |
205 |
+@@ -24,17 +24,17 @@ void setup_stf_barrier(void); |
206 |
+ void do_stf_barrier_fixups(enum stf_barrier_type types); |
207 |
+ void setup_count_cache_flush(void); |
208 |
+ |
209 |
+-static inline void security_ftr_set(unsigned long feature) |
210 |
++static inline void security_ftr_set(u64 feature) |
211 |
+ { |
212 |
+ powerpc_security_features |= feature; |
213 |
+ } |
214 |
+ |
215 |
+-static inline void security_ftr_clear(unsigned long feature) |
216 |
++static inline void security_ftr_clear(u64 feature) |
217 |
+ { |
218 |
+ powerpc_security_features &= ~feature; |
219 |
+ } |
220 |
+ |
221 |
+-static inline bool security_ftr_enabled(unsigned long feature) |
222 |
++static inline bool security_ftr_enabled(u64 feature) |
223 |
+ { |
224 |
+ return !!(powerpc_security_features & feature); |
225 |
+ } |
226 |
+diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S |
227 |
+index adf0505dbe02..519d49547e2f 100644 |
228 |
+--- a/arch/powerpc/kernel/head_fsl_booke.S |
229 |
++++ b/arch/powerpc/kernel/head_fsl_booke.S |
230 |
+@@ -238,6 +238,9 @@ set_ivor: |
231 |
+ |
232 |
+ bl early_init |
233 |
+ |
234 |
++#ifdef CONFIG_KASAN |
235 |
++ bl kasan_early_init |
236 |
++#endif |
237 |
+ #ifdef CONFIG_RELOCATABLE |
238 |
+ mr r3,r30 |
239 |
+ mr r4,r31 |
240 |
+@@ -264,9 +267,6 @@ set_ivor: |
241 |
+ /* |
242 |
+ * Decide what sort of machine this is and initialize the MMU. |
243 |
+ */ |
244 |
+-#ifdef CONFIG_KASAN |
245 |
+- bl kasan_early_init |
246 |
+-#endif |
247 |
+ mr r3,r30 |
248 |
+ mr r4,r31 |
249 |
+ bl machine_init |
250 |
+diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c |
251 |
+index 100f1b57ec2f..eba9d4ee4baf 100644 |
252 |
+--- a/arch/powerpc/kernel/prom_init.c |
253 |
++++ b/arch/powerpc/kernel/prom_init.c |
254 |
+@@ -1053,7 +1053,7 @@ static const struct ibm_arch_vec ibm_architecture_vec_template __initconst = { |
255 |
+ .reserved2 = 0, |
256 |
+ .reserved3 = 0, |
257 |
+ .subprocessors = 1, |
258 |
+- .byte22 = OV5_FEAT(OV5_DRMEM_V2), |
259 |
++ .byte22 = OV5_FEAT(OV5_DRMEM_V2) | OV5_FEAT(OV5_DRC_INFO), |
260 |
+ .intarch = 0, |
261 |
+ .mmu = 0, |
262 |
+ .hash_ext = 0, |
263 |
+diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c |
264 |
+index d341b464f23c..1740a66cea84 100644 |
265 |
+--- a/arch/powerpc/kernel/security.c |
266 |
++++ b/arch/powerpc/kernel/security.c |
267 |
+@@ -16,7 +16,7 @@ |
268 |
+ #include <asm/setup.h> |
269 |
+ |
270 |
+ |
271 |
+-unsigned long powerpc_security_features __read_mostly = SEC_FTR_DEFAULT; |
272 |
++u64 powerpc_security_features __read_mostly = SEC_FTR_DEFAULT; |
273 |
+ |
274 |
+ enum count_cache_flush_type { |
275 |
+ COUNT_CACHE_FLUSH_NONE = 0x1, |
276 |
+@@ -109,7 +109,7 @@ device_initcall(barrier_nospec_debugfs_init); |
277 |
+ static __init int security_feature_debugfs_init(void) |
278 |
+ { |
279 |
+ debugfs_create_x64("security_features", 0400, powerpc_debugfs_root, |
280 |
+- (u64 *)&powerpc_security_features); |
281 |
++ &powerpc_security_features); |
282 |
+ return 0; |
283 |
+ } |
284 |
+ device_initcall(security_feature_debugfs_init); |
285 |
+diff --git a/block/bio-integrity.c b/block/bio-integrity.c |
286 |
+index fb95dbb21dd8..bf62c25cde8f 100644 |
287 |
+--- a/block/bio-integrity.c |
288 |
++++ b/block/bio-integrity.c |
289 |
+@@ -87,7 +87,7 @@ EXPORT_SYMBOL(bio_integrity_alloc); |
290 |
+ * Description: Used to free the integrity portion of a bio. Usually |
291 |
+ * called from bio_free(). |
292 |
+ */ |
293 |
+-static void bio_integrity_free(struct bio *bio) |
294 |
++void bio_integrity_free(struct bio *bio) |
295 |
+ { |
296 |
+ struct bio_integrity_payload *bip = bio_integrity(bio); |
297 |
+ struct bio_set *bs = bio->bi_pool; |
298 |
+diff --git a/block/bio.c b/block/bio.c |
299 |
+index 906da3581a3e..94d697217887 100644 |
300 |
+--- a/block/bio.c |
301 |
++++ b/block/bio.c |
302 |
+@@ -233,6 +233,9 @@ fallback: |
303 |
+ void bio_uninit(struct bio *bio) |
304 |
+ { |
305 |
+ bio_disassociate_blkg(bio); |
306 |
++ |
307 |
++ if (bio_integrity(bio)) |
308 |
++ bio_integrity_free(bio); |
309 |
+ } |
310 |
+ EXPORT_SYMBOL(bio_uninit); |
311 |
+ |
312 |
+diff --git a/block/blk.h b/block/blk.h |
313 |
+index ffea1691470e..ee3d5664d962 100644 |
314 |
+--- a/block/blk.h |
315 |
++++ b/block/blk.h |
316 |
+@@ -122,6 +122,7 @@ static inline void blk_rq_bio_prep(struct request *rq, struct bio *bio, |
317 |
+ #ifdef CONFIG_BLK_DEV_INTEGRITY |
318 |
+ void blk_flush_integrity(void); |
319 |
+ bool __bio_integrity_endio(struct bio *); |
320 |
++void bio_integrity_free(struct bio *bio); |
321 |
+ static inline bool bio_integrity_endio(struct bio *bio) |
322 |
+ { |
323 |
+ if (bio_integrity(bio)) |
324 |
+@@ -167,6 +168,9 @@ static inline bool bio_integrity_endio(struct bio *bio) |
325 |
+ { |
326 |
+ return true; |
327 |
+ } |
328 |
++static inline void bio_integrity_free(struct bio *bio) |
329 |
++{ |
330 |
++} |
331 |
+ #endif /* CONFIG_BLK_DEV_INTEGRITY */ |
332 |
+ |
333 |
+ unsigned long blk_rq_timeout(unsigned long timeout); |
334 |
+diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c |
335 |
+index 00ec4f2bf015..c05050f474cd 100644 |
336 |
+--- a/drivers/acpi/acpi_platform.c |
337 |
++++ b/drivers/acpi/acpi_platform.c |
338 |
+@@ -31,6 +31,44 @@ static const struct acpi_device_id forbidden_id_list[] = { |
339 |
+ {"", 0}, |
340 |
+ }; |
341 |
+ |
342 |
++static struct platform_device *acpi_platform_device_find_by_companion(struct acpi_device *adev) |
343 |
++{ |
344 |
++ struct device *dev; |
345 |
++ |
346 |
++ dev = bus_find_device_by_acpi_dev(&platform_bus_type, adev); |
347 |
++ return dev ? to_platform_device(dev) : NULL; |
348 |
++} |
349 |
++ |
350 |
++static int acpi_platform_device_remove_notify(struct notifier_block *nb, |
351 |
++ unsigned long value, void *arg) |
352 |
++{ |
353 |
++ struct acpi_device *adev = arg; |
354 |
++ struct platform_device *pdev; |
355 |
++ |
356 |
++ switch (value) { |
357 |
++ case ACPI_RECONFIG_DEVICE_ADD: |
358 |
++ /* Nothing to do here */ |
359 |
++ break; |
360 |
++ case ACPI_RECONFIG_DEVICE_REMOVE: |
361 |
++ if (!acpi_device_enumerated(adev)) |
362 |
++ break; |
363 |
++ |
364 |
++ pdev = acpi_platform_device_find_by_companion(adev); |
365 |
++ if (!pdev) |
366 |
++ break; |
367 |
++ |
368 |
++ platform_device_unregister(pdev); |
369 |
++ put_device(&pdev->dev); |
370 |
++ break; |
371 |
++ } |
372 |
++ |
373 |
++ return NOTIFY_OK; |
374 |
++} |
375 |
++ |
376 |
++static struct notifier_block acpi_platform_notifier = { |
377 |
++ .notifier_call = acpi_platform_device_remove_notify, |
378 |
++}; |
379 |
++ |
380 |
+ static void acpi_platform_fill_resource(struct acpi_device *adev, |
381 |
+ const struct resource *src, struct resource *dest) |
382 |
+ { |
383 |
+@@ -130,3 +168,8 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev, |
384 |
+ return pdev; |
385 |
+ } |
386 |
+ EXPORT_SYMBOL_GPL(acpi_create_platform_device); |
387 |
++ |
388 |
++void __init acpi_platform_init(void) |
389 |
++{ |
390 |
++ acpi_reconfig_notifier_register(&acpi_platform_notifier); |
391 |
++} |
392 |
+diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c |
393 |
+index aad6be5c0af0..915650bf519f 100644 |
394 |
+--- a/drivers/acpi/scan.c |
395 |
++++ b/drivers/acpi/scan.c |
396 |
+@@ -2174,6 +2174,7 @@ int __init acpi_scan_init(void) |
397 |
+ acpi_pci_root_init(); |
398 |
+ acpi_pci_link_init(); |
399 |
+ acpi_processor_init(); |
400 |
++ acpi_platform_init(); |
401 |
+ acpi_lpss_init(); |
402 |
+ acpi_apd_init(); |
403 |
+ acpi_cmos_rtc_init(); |
404 |
+diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c |
405 |
+index a1f3f0994f9f..d5b4905e2adb 100644 |
406 |
+--- a/drivers/base/swnode.c |
407 |
++++ b/drivers/base/swnode.c |
408 |
+@@ -520,7 +520,10 @@ software_node_get_parent(const struct fwnode_handle *fwnode) |
409 |
+ { |
410 |
+ struct swnode *swnode = to_swnode(fwnode); |
411 |
+ |
412 |
+- return swnode ? (swnode->parent ? &swnode->parent->fwnode : NULL) : NULL; |
413 |
++ if (!swnode || !swnode->parent) |
414 |
++ return NULL; |
415 |
++ |
416 |
++ return fwnode_handle_get(&swnode->parent->fwnode); |
417 |
+ } |
418 |
+ |
419 |
+ static struct fwnode_handle * |
420 |
+diff --git a/drivers/char/hw_random/omap3-rom-rng.c b/drivers/char/hw_random/omap3-rom-rng.c |
421 |
+index 648e39ce6bd9..8df3cad7c97a 100644 |
422 |
+--- a/drivers/char/hw_random/omap3-rom-rng.c |
423 |
++++ b/drivers/char/hw_random/omap3-rom-rng.c |
424 |
+@@ -20,6 +20,8 @@ |
425 |
+ #include <linux/workqueue.h> |
426 |
+ #include <linux/clk.h> |
427 |
+ #include <linux/err.h> |
428 |
++#include <linux/of.h> |
429 |
++#include <linux/of_device.h> |
430 |
+ #include <linux/platform_device.h> |
431 |
+ |
432 |
+ #define RNG_RESET 0x01 |
433 |
+@@ -86,14 +88,18 @@ static int omap3_rom_rng_read(struct hwrng *rng, void *data, size_t max, bool w) |
434 |
+ |
435 |
+ static struct hwrng omap3_rom_rng_ops = { |
436 |
+ .name = "omap3-rom", |
437 |
+- .read = omap3_rom_rng_read, |
438 |
+ }; |
439 |
+ |
440 |
+ static int omap3_rom_rng_probe(struct platform_device *pdev) |
441 |
+ { |
442 |
+ int ret = 0; |
443 |
+ |
444 |
+- pr_info("initializing\n"); |
445 |
++ omap3_rom_rng_ops.read = of_device_get_match_data(&pdev->dev); |
446 |
++ if (!omap3_rom_rng_ops.read) { |
447 |
++ dev_err(&pdev->dev, "missing rom code handler\n"); |
448 |
++ |
449 |
++ return -ENODEV; |
450 |
++ } |
451 |
+ |
452 |
+ omap3_rom_rng_call = pdev->dev.platform_data; |
453 |
+ if (!omap3_rom_rng_call) { |
454 |
+@@ -126,9 +132,16 @@ static int omap3_rom_rng_remove(struct platform_device *pdev) |
455 |
+ return 0; |
456 |
+ } |
457 |
+ |
458 |
++static const struct of_device_id omap_rom_rng_match[] = { |
459 |
++ { .compatible = "nokia,n900-rom-rng", .data = omap3_rom_rng_read, }, |
460 |
++ { /* sentinel */ }, |
461 |
++}; |
462 |
++MODULE_DEVICE_TABLE(of, omap_rom_rng_match); |
463 |
++ |
464 |
+ static struct platform_driver omap3_rom_rng_driver = { |
465 |
+ .driver = { |
466 |
+ .name = "omap3-rom-rng", |
467 |
++ .of_match_table = omap_rom_rng_match, |
468 |
+ }, |
469 |
+ .probe = omap3_rom_rng_probe, |
470 |
+ .remove = omap3_rom_rng_remove, |
471 |
+diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c |
472 |
+index 3c8a559506e8..0b6e7f8d9729 100644 |
473 |
+--- a/drivers/char/ipmi/ipmi_msghandler.c |
474 |
++++ b/drivers/char/ipmi/ipmi_msghandler.c |
475 |
+@@ -3039,8 +3039,11 @@ static int __ipmi_bmc_register(struct ipmi_smi *intf, |
476 |
+ bmc->pdev.name = "ipmi_bmc"; |
477 |
+ |
478 |
+ rv = ida_simple_get(&ipmi_bmc_ida, 0, 0, GFP_KERNEL); |
479 |
+- if (rv < 0) |
480 |
++ if (rv < 0) { |
481 |
++ kfree(bmc); |
482 |
+ goto out; |
483 |
++ } |
484 |
++ |
485 |
+ bmc->pdev.dev.driver = &ipmidriver.driver; |
486 |
+ bmc->pdev.id = rv; |
487 |
+ bmc->pdev.dev.release = release_bmc_device; |
488 |
+diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig |
489 |
+index 8eabf7b20101..7316312935c8 100644 |
490 |
+--- a/drivers/crypto/Kconfig |
491 |
++++ b/drivers/crypto/Kconfig |
492 |
+@@ -333,6 +333,7 @@ config CRYPTO_DEV_PPC4XX |
493 |
+ depends on PPC && 4xx |
494 |
+ select CRYPTO_HASH |
495 |
+ select CRYPTO_AEAD |
496 |
++ select CRYPTO_AES |
497 |
+ select CRYPTO_LIB_AES |
498 |
+ select CRYPTO_CCM |
499 |
+ select CRYPTO_CTR |
500 |
+diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c |
501 |
+index 1369c5fa3087..07df012893bb 100644 |
502 |
+--- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c |
503 |
++++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c |
504 |
+@@ -175,7 +175,7 @@ static int sun4i_hash(struct ahash_request *areq) |
505 |
+ */ |
506 |
+ unsigned int i = 0, end, fill, min_fill, nwait, nbw = 0, j = 0, todo; |
507 |
+ unsigned int in_i = 0; |
508 |
+- u32 spaces, rx_cnt = SS_RX_DEFAULT, bf[32] = {0}, wb = 0, v, ivmode = 0; |
509 |
++ u32 spaces, rx_cnt = SS_RX_DEFAULT, bf[32] = {0}, v, ivmode = 0; |
510 |
+ struct sun4i_req_ctx *op = ahash_request_ctx(areq); |
511 |
+ struct crypto_ahash *tfm = crypto_ahash_reqtfm(areq); |
512 |
+ struct sun4i_tfm_ctx *tfmctx = crypto_ahash_ctx(tfm); |
513 |
+@@ -184,6 +184,7 @@ static int sun4i_hash(struct ahash_request *areq) |
514 |
+ struct sg_mapping_iter mi; |
515 |
+ int in_r, err = 0; |
516 |
+ size_t copied = 0; |
517 |
++ __le32 wb = 0; |
518 |
+ |
519 |
+ dev_dbg(ss->dev, "%s %s bc=%llu len=%u mode=%x wl=%u h0=%0x", |
520 |
+ __func__, crypto_tfm_alg_name(areq->base.tfm), |
521 |
+@@ -395,7 +396,7 @@ hash_final: |
522 |
+ |
523 |
+ nbw = op->len - 4 * nwait; |
524 |
+ if (nbw) { |
525 |
+- wb = *(u32 *)(op->buf + nwait * 4); |
526 |
++ wb = cpu_to_le32(*(u32 *)(op->buf + nwait * 4)); |
527 |
+ wb &= GENMASK((nbw * 8) - 1, 0); |
528 |
+ |
529 |
+ op->byte_count += nbw; |
530 |
+@@ -404,7 +405,7 @@ hash_final: |
531 |
+ |
532 |
+ /* write the remaining bytes of the nbw buffer */ |
533 |
+ wb |= ((1 << 7) << (nbw * 8)); |
534 |
+- bf[j++] = wb; |
535 |
++ bf[j++] = le32_to_cpu(wb); |
536 |
+ |
537 |
+ /* |
538 |
+ * number of space to pad to obtain 64o minus 8(size) minus 4 (final 1) |
539 |
+@@ -423,13 +424,13 @@ hash_final: |
540 |
+ |
541 |
+ /* write the length of data */ |
542 |
+ if (op->mode == SS_OP_SHA1) { |
543 |
+- __be64 bits = cpu_to_be64(op->byte_count << 3); |
544 |
+- bf[j++] = lower_32_bits(bits); |
545 |
+- bf[j++] = upper_32_bits(bits); |
546 |
++ __be64 *bits = (__be64 *)&bf[j]; |
547 |
++ *bits = cpu_to_be64(op->byte_count << 3); |
548 |
++ j += 2; |
549 |
+ } else { |
550 |
+- __le64 bits = op->byte_count << 3; |
551 |
+- bf[j++] = lower_32_bits(bits); |
552 |
+- bf[j++] = upper_32_bits(bits); |
553 |
++ __le64 *bits = (__le64 *)&bf[j]; |
554 |
++ *bits = cpu_to_le64(op->byte_count << 3); |
555 |
++ j += 2; |
556 |
+ } |
557 |
+ writesl(ss->base + SS_RXFIFO, bf, j); |
558 |
+ |
559 |
+@@ -471,7 +472,7 @@ hash_final: |
560 |
+ } |
561 |
+ } else { |
562 |
+ for (i = 0; i < 4; i++) { |
563 |
+- v = readl(ss->base + SS_MD0 + i * 4); |
564 |
++ v = cpu_to_le32(readl(ss->base + SS_MD0 + i * 4)); |
565 |
+ memcpy(areq->result + i * 4, &v, 4); |
566 |
+ } |
567 |
+ } |
568 |
+diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c |
569 |
+index ba7c4f07fcd6..80b780e49971 100644 |
570 |
+--- a/drivers/dma/ti/edma.c |
571 |
++++ b/drivers/dma/ti/edma.c |
572 |
+@@ -2403,8 +2403,10 @@ static int edma_probe(struct platform_device *pdev) |
573 |
+ |
574 |
+ ecc->tc_list = devm_kcalloc(dev, ecc->num_tc, |
575 |
+ sizeof(*ecc->tc_list), GFP_KERNEL); |
576 |
+- if (!ecc->tc_list) |
577 |
+- return -ENOMEM; |
578 |
++ if (!ecc->tc_list) { |
579 |
++ ret = -ENOMEM; |
580 |
++ goto err_reg1; |
581 |
++ } |
582 |
+ |
583 |
+ for (i = 0;; i++) { |
584 |
+ ret = of_parse_phandle_with_fixed_args(node, "ti,tptcs", |
585 |
+diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c |
586 |
+index 4a8012e3cb8c..601af4edad5e 100644 |
587 |
+--- a/drivers/firmware/arm_scmi/perf.c |
588 |
++++ b/drivers/firmware/arm_scmi/perf.c |
589 |
+@@ -323,7 +323,7 @@ static void scmi_perf_fc_ring_db(struct scmi_fc_db_info *db) |
590 |
+ |
591 |
+ if (db->mask) |
592 |
+ val = ioread64_hi_lo(db->addr) & db->mask; |
593 |
+- iowrite64_hi_lo(db->set, db->addr); |
594 |
++ iowrite64_hi_lo(db->set | val, db->addr); |
595 |
+ } |
596 |
+ #endif |
597 |
+ } |
598 |
+diff --git a/drivers/firmware/imx/imx-dsp.c b/drivers/firmware/imx/imx-dsp.c |
599 |
+index a43d2db5cbdb..4265e9dbed84 100644 |
600 |
+--- a/drivers/firmware/imx/imx-dsp.c |
601 |
++++ b/drivers/firmware/imx/imx-dsp.c |
602 |
+@@ -114,7 +114,7 @@ static int imx_dsp_probe(struct platform_device *pdev) |
603 |
+ |
604 |
+ dev_info(dev, "NXP i.MX DSP IPC initialized\n"); |
605 |
+ |
606 |
+- return devm_of_platform_populate(dev); |
607 |
++ return 0; |
608 |
+ out: |
609 |
+ kfree(chan_name); |
610 |
+ for (j = 0; j < i; j++) { |
611 |
+diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c |
612 |
+index 43ffec3a6fbb..7ee5b7f53aeb 100644 |
613 |
+--- a/drivers/gpio/gpiolib-of.c |
614 |
++++ b/drivers/gpio/gpiolib-of.c |
615 |
+@@ -909,16 +909,13 @@ int of_gpiochip_add(struct gpio_chip *chip) |
616 |
+ of_node_get(chip->of_node); |
617 |
+ |
618 |
+ ret = of_gpiochip_scan_gpios(chip); |
619 |
+- if (ret) { |
620 |
++ if (ret) |
621 |
+ of_node_put(chip->of_node); |
622 |
+- gpiochip_remove_pin_ranges(chip); |
623 |
+- } |
624 |
+ |
625 |
+ return ret; |
626 |
+ } |
627 |
+ |
628 |
+ void of_gpiochip_remove(struct gpio_chip *chip) |
629 |
+ { |
630 |
+- gpiochip_remove_pin_ranges(chip); |
631 |
+ of_node_put(chip->of_node); |
632 |
+ } |
633 |
+diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c |
634 |
+index 3d9524a2abc4..2476306e7030 100644 |
635 |
+--- a/drivers/gpio/gpiolib.c |
636 |
++++ b/drivers/gpio/gpiolib.c |
637 |
+@@ -1452,6 +1452,7 @@ err_remove_of_chip: |
638 |
+ gpiochip_free_hogs(chip); |
639 |
+ of_gpiochip_remove(chip); |
640 |
+ err_free_gpiochip_mask: |
641 |
++ gpiochip_remove_pin_ranges(chip); |
642 |
+ gpiochip_free_valid_mask(chip); |
643 |
+ err_remove_from_list: |
644 |
+ spin_lock_irqsave(&gpio_lock, flags); |
645 |
+@@ -1507,8 +1508,8 @@ void gpiochip_remove(struct gpio_chip *chip) |
646 |
+ gdev->chip = NULL; |
647 |
+ gpiochip_irqchip_remove(chip); |
648 |
+ acpi_gpiochip_remove(chip); |
649 |
+- gpiochip_remove_pin_ranges(chip); |
650 |
+ of_gpiochip_remove(chip); |
651 |
++ gpiochip_remove_pin_ranges(chip); |
652 |
+ gpiochip_free_valid_mask(chip); |
653 |
+ /* |
654 |
+ * We accept no more calls into the driver from this point, so |
655 |
+diff --git a/drivers/gpio/sgpio-aspeed.c b/drivers/gpio/sgpio-aspeed.c |
656 |
+index 7e99860ca447..8319812593e3 100644 |
657 |
+--- a/drivers/gpio/sgpio-aspeed.c |
658 |
++++ b/drivers/gpio/sgpio-aspeed.c |
659 |
+@@ -107,7 +107,7 @@ static void __iomem *bank_reg(struct aspeed_sgpio *gpio, |
660 |
+ return gpio->base + bank->irq_regs + GPIO_IRQ_STATUS; |
661 |
+ default: |
662 |
+ /* acturally if code runs to here, it's an error case */ |
663 |
+- BUG_ON(1); |
664 |
++ BUG(); |
665 |
+ } |
666 |
+ } |
667 |
+ |
668 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c |
669 |
+index 395c2259f979..9d778a0b2c5e 100644 |
670 |
+--- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c |
671 |
++++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c |
672 |
+@@ -423,7 +423,6 @@ static void vcn_v2_5_mc_resume(struct amdgpu_device *adev) |
673 |
+ * vcn_v2_5_disable_clock_gating - disable VCN clock gating |
674 |
+ * |
675 |
+ * @adev: amdgpu_device pointer |
676 |
+- * @sw: enable SW clock gating |
677 |
+ * |
678 |
+ * Disable clock gating for VCN block |
679 |
+ */ |
680 |
+@@ -542,7 +541,6 @@ static void vcn_v2_5_disable_clock_gating(struct amdgpu_device *adev) |
681 |
+ * vcn_v2_5_enable_clock_gating - enable VCN clock gating |
682 |
+ * |
683 |
+ * @adev: amdgpu_device pointer |
684 |
+- * @sw: enable SW clock gating |
685 |
+ * |
686 |
+ * Enable clock gating for VCN block |
687 |
+ */ |
688 |
+diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c |
689 |
+index fa8ad7db2b3a..d306cc711997 100644 |
690 |
+--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c |
691 |
++++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c |
692 |
+@@ -1421,6 +1421,7 @@ static int pp_get_asic_baco_capability(void *handle, bool *cap) |
693 |
+ { |
694 |
+ struct pp_hwmgr *hwmgr = handle; |
695 |
+ |
696 |
++ *cap = false; |
697 |
+ if (!hwmgr) |
698 |
+ return -EINVAL; |
699 |
+ |
700 |
+diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c |
701 |
+index e41fd94ae5a9..b3d2b91575cb 100644 |
702 |
+--- a/drivers/gpu/drm/i915/gem/i915_gem_context.c |
703 |
++++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c |
704 |
+@@ -2094,8 +2094,7 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data, |
705 |
+ ext_data.fpriv = file->driver_priv; |
706 |
+ if (client_is_banned(ext_data.fpriv)) { |
707 |
+ DRM_DEBUG("client %s[%d] banned from creating ctx\n", |
708 |
+- current->comm, |
709 |
+- pid_nr(get_task_pid(current, PIDTYPE_PID))); |
710 |
++ current->comm, task_pid_nr(current)); |
711 |
+ return -EIO; |
712 |
+ } |
713 |
+ |
714 |
+diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c |
715 |
+index ad47cc95459e..bf5fcc3e5379 100644 |
716 |
+--- a/drivers/gpu/drm/panel/panel-lvds.c |
717 |
++++ b/drivers/gpu/drm/panel/panel-lvds.c |
718 |
+@@ -197,7 +197,6 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds) |
719 |
+ static int panel_lvds_probe(struct platform_device *pdev) |
720 |
+ { |
721 |
+ struct panel_lvds *lvds; |
722 |
+- struct device_node *np; |
723 |
+ int ret; |
724 |
+ |
725 |
+ lvds = devm_kzalloc(&pdev->dev, sizeof(*lvds), GFP_KERNEL); |
726 |
+@@ -243,14 +242,9 @@ static int panel_lvds_probe(struct platform_device *pdev) |
727 |
+ return ret; |
728 |
+ } |
729 |
+ |
730 |
+- np = of_parse_phandle(lvds->dev->of_node, "backlight", 0); |
731 |
+- if (np) { |
732 |
+- lvds->backlight = of_find_backlight_by_node(np); |
733 |
+- of_node_put(np); |
734 |
+- |
735 |
+- if (!lvds->backlight) |
736 |
+- return -EPROBE_DEFER; |
737 |
+- } |
738 |
++ lvds->backlight = devm_of_find_backlight(lvds->dev); |
739 |
++ if (IS_ERR(lvds->backlight)) |
740 |
++ return PTR_ERR(lvds->backlight); |
741 |
+ |
742 |
+ /* |
743 |
+ * TODO: Handle all power supplies specified in the DT node in a generic |
744 |
+@@ -266,14 +260,10 @@ static int panel_lvds_probe(struct platform_device *pdev) |
745 |
+ |
746 |
+ ret = drm_panel_add(&lvds->panel); |
747 |
+ if (ret < 0) |
748 |
+- goto error; |
749 |
++ return ret; |
750 |
+ |
751 |
+ dev_set_drvdata(lvds->dev, lvds); |
752 |
+ return 0; |
753 |
+- |
754 |
+-error: |
755 |
+- put_device(&lvds->backlight->dev); |
756 |
+- return ret; |
757 |
+ } |
758 |
+ |
759 |
+ static int panel_lvds_remove(struct platform_device *pdev) |
760 |
+@@ -284,9 +274,6 @@ static int panel_lvds_remove(struct platform_device *pdev) |
761 |
+ |
762 |
+ panel_lvds_disable(&lvds->panel); |
763 |
+ |
764 |
+- if (lvds->backlight) |
765 |
+- put_device(&lvds->backlight->dev); |
766 |
+- |
767 |
+ return 0; |
768 |
+ } |
769 |
+ |
770 |
+diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c |
771 |
+index 12ff77dacc95..c1eb8cfe6aeb 100644 |
772 |
+--- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c |
773 |
++++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c |
774 |
+@@ -53,8 +53,10 @@ static int panfrost_devfreq_target(struct device *dev, unsigned long *freq, |
775 |
+ if (err) { |
776 |
+ dev_err(dev, "Cannot set frequency %lu (%d)\n", target_rate, |
777 |
+ err); |
778 |
+- regulator_set_voltage(pfdev->regulator, pfdev->devfreq.cur_volt, |
779 |
+- pfdev->devfreq.cur_volt); |
780 |
++ if (pfdev->regulator) |
781 |
++ regulator_set_voltage(pfdev->regulator, |
782 |
++ pfdev->devfreq.cur_volt, |
783 |
++ pfdev->devfreq.cur_volt); |
784 |
+ return err; |
785 |
+ } |
786 |
+ |
787 |
+diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c |
788 |
+index 62eab82a64f9..897442754fd0 100644 |
789 |
+--- a/drivers/gpu/drm/radeon/cik.c |
790 |
++++ b/drivers/gpu/drm/radeon/cik.c |
791 |
+@@ -6969,8 +6969,8 @@ static int cik_irq_init(struct radeon_device *rdev) |
792 |
+ } |
793 |
+ |
794 |
+ /* setup interrupt control */ |
795 |
+- /* XXX this should actually be a bus address, not an MC address. same on older asics */ |
796 |
+- WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8); |
797 |
++ /* set dummy read address to dummy page address */ |
798 |
++ WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8); |
799 |
+ interrupt_cntl = RREG32(INTERRUPT_CNTL); |
800 |
+ /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi |
801 |
+ * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN |
802 |
+diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c |
803 |
+index e937cc01910d..033bc466a862 100644 |
804 |
+--- a/drivers/gpu/drm/radeon/r600.c |
805 |
++++ b/drivers/gpu/drm/radeon/r600.c |
806 |
+@@ -3696,8 +3696,8 @@ int r600_irq_init(struct radeon_device *rdev) |
807 |
+ } |
808 |
+ |
809 |
+ /* setup interrupt control */ |
810 |
+- /* set dummy read address to ring address */ |
811 |
+- WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8); |
812 |
++ /* set dummy read address to dummy page address */ |
813 |
++ WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8); |
814 |
+ interrupt_cntl = RREG32(INTERRUPT_CNTL); |
815 |
+ /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi |
816 |
+ * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN |
817 |
+diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c |
818 |
+index 05894d198a79..1d8efb0eefdb 100644 |
819 |
+--- a/drivers/gpu/drm/radeon/si.c |
820 |
++++ b/drivers/gpu/drm/radeon/si.c |
821 |
+@@ -5997,8 +5997,8 @@ static int si_irq_init(struct radeon_device *rdev) |
822 |
+ } |
823 |
+ |
824 |
+ /* setup interrupt control */ |
825 |
+- /* set dummy read address to ring address */ |
826 |
+- WREG32(INTERRUPT_CNTL2, rdev->ih.gpu_addr >> 8); |
827 |
++ /* set dummy read address to dummy page address */ |
828 |
++ WREG32(INTERRUPT_CNTL2, rdev->dummy_page.addr >> 8); |
829 |
+ interrupt_cntl = RREG32(INTERRUPT_CNTL); |
830 |
+ /* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi |
831 |
+ * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN |
832 |
+diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c |
833 |
+index 3fc7e6899cab..50c11a7f0467 100644 |
834 |
+--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c |
835 |
++++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c |
836 |
+@@ -16,6 +16,7 @@ |
837 |
+ #include <linux/of_graph.h> |
838 |
+ #include <linux/platform_device.h> |
839 |
+ #include <linux/slab.h> |
840 |
++#include <linux/sys_soc.h> |
841 |
+ |
842 |
+ #include <drm/drm_atomic.h> |
843 |
+ #include <drm/drm_atomic_helper.h> |
844 |
+@@ -842,8 +843,23 @@ static int rcar_lvds_get_clocks(struct rcar_lvds *lvds) |
845 |
+ return 0; |
846 |
+ } |
847 |
+ |
848 |
++static const struct rcar_lvds_device_info rcar_lvds_r8a7790es1_info = { |
849 |
++ .gen = 2, |
850 |
++ .quirks = RCAR_LVDS_QUIRK_LANES, |
851 |
++ .pll_setup = rcar_lvds_pll_setup_gen2, |
852 |
++}; |
853 |
++ |
854 |
++static const struct soc_device_attribute lvds_quirk_matches[] = { |
855 |
++ { |
856 |
++ .soc_id = "r8a7790", .revision = "ES1.*", |
857 |
++ .data = &rcar_lvds_r8a7790es1_info, |
858 |
++ }, |
859 |
++ { /* sentinel */ } |
860 |
++}; |
861 |
++ |
862 |
+ static int rcar_lvds_probe(struct platform_device *pdev) |
863 |
+ { |
864 |
++ const struct soc_device_attribute *attr; |
865 |
+ struct rcar_lvds *lvds; |
866 |
+ struct resource *mem; |
867 |
+ int ret; |
868 |
+@@ -857,6 +873,10 @@ static int rcar_lvds_probe(struct platform_device *pdev) |
869 |
+ lvds->dev = &pdev->dev; |
870 |
+ lvds->info = of_device_get_match_data(&pdev->dev); |
871 |
+ |
872 |
++ attr = soc_device_match(lvds_quirk_matches); |
873 |
++ if (attr) |
874 |
++ lvds->info = attr->data; |
875 |
++ |
876 |
+ ret = rcar_lvds_parse_dt(lvds); |
877 |
+ if (ret < 0) |
878 |
+ return ret; |
879 |
+@@ -893,12 +913,6 @@ static const struct rcar_lvds_device_info rcar_lvds_gen2_info = { |
880 |
+ .pll_setup = rcar_lvds_pll_setup_gen2, |
881 |
+ }; |
882 |
+ |
883 |
+-static const struct rcar_lvds_device_info rcar_lvds_r8a7790_info = { |
884 |
+- .gen = 2, |
885 |
+- .quirks = RCAR_LVDS_QUIRK_LANES, |
886 |
+- .pll_setup = rcar_lvds_pll_setup_gen2, |
887 |
+-}; |
888 |
+- |
889 |
+ static const struct rcar_lvds_device_info rcar_lvds_gen3_info = { |
890 |
+ .gen = 3, |
891 |
+ .quirks = RCAR_LVDS_QUIRK_PWD, |
892 |
+@@ -930,7 +944,7 @@ static const struct of_device_id rcar_lvds_of_table[] = { |
893 |
+ { .compatible = "renesas,r8a7744-lvds", .data = &rcar_lvds_gen2_info }, |
894 |
+ { .compatible = "renesas,r8a774a1-lvds", .data = &rcar_lvds_gen3_info }, |
895 |
+ { .compatible = "renesas,r8a774c0-lvds", .data = &rcar_lvds_r8a77990_info }, |
896 |
+- { .compatible = "renesas,r8a7790-lvds", .data = &rcar_lvds_r8a7790_info }, |
897 |
++ { .compatible = "renesas,r8a7790-lvds", .data = &rcar_lvds_gen2_info }, |
898 |
+ { .compatible = "renesas,r8a7791-lvds", .data = &rcar_lvds_gen2_info }, |
899 |
+ { .compatible = "renesas,r8a7793-lvds", .data = &rcar_lvds_gen2_info }, |
900 |
+ { .compatible = "renesas,r8a7795-lvds", .data = &rcar_lvds_gen3_info }, |
901 |
+diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c |
902 |
+index 613404f86668..84e3decb17b1 100644 |
903 |
+--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c |
904 |
++++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c |
905 |
+@@ -1040,10 +1040,41 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, |
906 |
+ struct drm_display_mode *adjusted_mode) |
907 |
+ { |
908 |
+ struct vop *vop = to_vop(crtc); |
909 |
++ unsigned long rate; |
910 |
+ |
911 |
+- adjusted_mode->clock = |
912 |
+- DIV_ROUND_UP(clk_round_rate(vop->dclk, |
913 |
+- adjusted_mode->clock * 1000), 1000); |
914 |
++ /* |
915 |
++ * Clock craziness. |
916 |
++ * |
917 |
++ * Key points: |
918 |
++ * |
919 |
++ * - DRM works in in kHz. |
920 |
++ * - Clock framework works in Hz. |
921 |
++ * - Rockchip's clock driver picks the clock rate that is the |
922 |
++ * same _OR LOWER_ than the one requested. |
923 |
++ * |
924 |
++ * Action plan: |
925 |
++ * |
926 |
++ * 1. When DRM gives us a mode, we should add 999 Hz to it. That way |
927 |
++ * if the clock we need is 60000001 Hz (~60 MHz) and DRM tells us to |
928 |
++ * make 60000 kHz then the clock framework will actually give us |
929 |
++ * the right clock. |
930 |
++ * |
931 |
++ * NOTE: if the PLL (maybe through a divider) could actually make |
932 |
++ * a clock rate 999 Hz higher instead of the one we want then this |
933 |
++ * could be a problem. Unfortunately there's not much we can do |
934 |
++ * since it's baked into DRM to use kHz. It shouldn't matter in |
935 |
++ * practice since Rockchip PLLs are controlled by tables and |
936 |
++ * even if there is a divider in the middle I wouldn't expect PLL |
937 |
++ * rates in the table that are just a few kHz different. |
938 |
++ * |
939 |
++ * 2. Get the clock framework to round the rate for us to tell us |
940 |
++ * what it will actually make. |
941 |
++ * |
942 |
++ * 3. Store the rounded up rate so that we don't need to worry about |
943 |
++ * this in the actual clk_set_rate(). |
944 |
++ */ |
945 |
++ rate = clk_round_rate(vop->dclk, adjusted_mode->clock * 1000 + 999); |
946 |
++ adjusted_mode->clock = DIV_ROUND_UP(rate, 1000); |
947 |
+ |
948 |
+ return true; |
949 |
+ } |
950 |
+diff --git a/drivers/i2c/busses/i2c-stm32.c b/drivers/i2c/busses/i2c-stm32.c |
951 |
+index 07d5dfce68d4..1da347e6a358 100644 |
952 |
+--- a/drivers/i2c/busses/i2c-stm32.c |
953 |
++++ b/drivers/i2c/busses/i2c-stm32.c |
954 |
+@@ -20,13 +20,13 @@ struct stm32_i2c_dma *stm32_i2c_dma_request(struct device *dev, |
955 |
+ |
956 |
+ dma = devm_kzalloc(dev, sizeof(*dma), GFP_KERNEL); |
957 |
+ if (!dma) |
958 |
+- return NULL; |
959 |
++ return ERR_PTR(-ENOMEM); |
960 |
+ |
961 |
+ /* Request and configure I2C TX dma channel */ |
962 |
+- dma->chan_tx = dma_request_slave_channel(dev, "tx"); |
963 |
+- if (!dma->chan_tx) { |
964 |
++ dma->chan_tx = dma_request_chan(dev, "tx"); |
965 |
++ if (IS_ERR(dma->chan_tx)) { |
966 |
+ dev_dbg(dev, "can't request DMA tx channel\n"); |
967 |
+- ret = -EINVAL; |
968 |
++ ret = PTR_ERR(dma->chan_tx); |
969 |
+ goto fail_al; |
970 |
+ } |
971 |
+ |
972 |
+@@ -42,10 +42,10 @@ struct stm32_i2c_dma *stm32_i2c_dma_request(struct device *dev, |
973 |
+ } |
974 |
+ |
975 |
+ /* Request and configure I2C RX dma channel */ |
976 |
+- dma->chan_rx = dma_request_slave_channel(dev, "rx"); |
977 |
+- if (!dma->chan_rx) { |
978 |
++ dma->chan_rx = dma_request_chan(dev, "rx"); |
979 |
++ if (IS_ERR(dma->chan_rx)) { |
980 |
+ dev_err(dev, "can't request DMA rx channel\n"); |
981 |
+- ret = -EINVAL; |
982 |
++ ret = PTR_ERR(dma->chan_rx); |
983 |
+ goto fail_tx; |
984 |
+ } |
985 |
+ |
986 |
+@@ -75,7 +75,7 @@ fail_al: |
987 |
+ devm_kfree(dev, dma); |
988 |
+ dev_info(dev, "can't use DMA\n"); |
989 |
+ |
990 |
+- return NULL; |
991 |
++ return ERR_PTR(ret); |
992 |
+ } |
993 |
+ |
994 |
+ void stm32_i2c_dma_free(struct stm32_i2c_dma *dma) |
995 |
+diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c |
996 |
+index 84cfed17ff4f..b2634afe066d 100644 |
997 |
+--- a/drivers/i2c/busses/i2c-stm32f7.c |
998 |
++++ b/drivers/i2c/busses/i2c-stm32f7.c |
999 |
+@@ -1267,8 +1267,8 @@ static int stm32f7_i2c_get_free_slave_id(struct stm32f7_i2c_dev *i2c_dev, |
1000 |
+ * slave[0] supports 7-bit and 10-bit slave address |
1001 |
+ * slave[1] supports 7-bit slave address only |
1002 |
+ */ |
1003 |
+- for (i = 0; i < STM32F7_I2C_MAX_SLAVE; i++) { |
1004 |
+- if (i == 1 && (slave->flags & I2C_CLIENT_PEC)) |
1005 |
++ for (i = STM32F7_I2C_MAX_SLAVE - 1; i >= 0; i--) { |
1006 |
++ if (i == 1 && (slave->flags & I2C_CLIENT_TEN)) |
1007 |
+ continue; |
1008 |
+ if (!i2c_dev->slave[i]) { |
1009 |
+ *id = i; |
1010 |
+@@ -1955,6 +1955,15 @@ static int stm32f7_i2c_probe(struct platform_device *pdev) |
1011 |
+ i2c_dev->dma = stm32_i2c_dma_request(i2c_dev->dev, phy_addr, |
1012 |
+ STM32F7_I2C_TXDR, |
1013 |
+ STM32F7_I2C_RXDR); |
1014 |
++ if (PTR_ERR(i2c_dev->dma) == -ENODEV) |
1015 |
++ i2c_dev->dma = NULL; |
1016 |
++ else if (IS_ERR(i2c_dev->dma)) { |
1017 |
++ ret = PTR_ERR(i2c_dev->dma); |
1018 |
++ if (ret != -EPROBE_DEFER) |
1019 |
++ dev_err(&pdev->dev, |
1020 |
++ "Failed to request dma error %i\n", ret); |
1021 |
++ goto clk_free; |
1022 |
++ } |
1023 |
+ |
1024 |
+ platform_set_drvdata(pdev, i2c_dev); |
1025 |
+ |
1026 |
+diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c |
1027 |
+index 59ff088c7d75..9feaec3c8329 100644 |
1028 |
+--- a/drivers/leds/leds-tlc591xx.c |
1029 |
++++ b/drivers/leds/leds-tlc591xx.c |
1030 |
+@@ -13,6 +13,7 @@ |
1031 |
+ #include <linux/slab.h> |
1032 |
+ |
1033 |
+ #define TLC591XX_MAX_LEDS 16 |
1034 |
++#define TLC591XX_MAX_BRIGHTNESS 256 |
1035 |
+ |
1036 |
+ #define TLC591XX_REG_MODE1 0x00 |
1037 |
+ #define MODE1_RESPON_ADDR_MASK 0xF0 |
1038 |
+@@ -112,11 +113,11 @@ tlc591xx_brightness_set(struct led_classdev *led_cdev, |
1039 |
+ struct tlc591xx_priv *priv = led->priv; |
1040 |
+ int err; |
1041 |
+ |
1042 |
+- switch (brightness) { |
1043 |
++ switch ((int)brightness) { |
1044 |
+ case 0: |
1045 |
+ err = tlc591xx_set_ledout(priv, led, LEDOUT_OFF); |
1046 |
+ break; |
1047 |
+- case LED_FULL: |
1048 |
++ case TLC591XX_MAX_BRIGHTNESS: |
1049 |
+ err = tlc591xx_set_ledout(priv, led, LEDOUT_ON); |
1050 |
+ break; |
1051 |
+ default: |
1052 |
+@@ -157,7 +158,7 @@ tlc591xx_configure(struct device *dev, |
1053 |
+ led->priv = priv; |
1054 |
+ led->led_no = i; |
1055 |
+ led->ldev.brightness_set_blocking = tlc591xx_brightness_set; |
1056 |
+- led->ldev.max_brightness = LED_FULL; |
1057 |
++ led->ldev.max_brightness = TLC591XX_MAX_BRIGHTNESS; |
1058 |
+ err = led_classdev_register(dev, &led->ldev); |
1059 |
+ if (err < 0) { |
1060 |
+ dev_err(dev, "couldn't register LED %s\n", |
1061 |
+diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c |
1062 |
+index 9355db29d2f9..1767f30a1676 100644 |
1063 |
+--- a/drivers/mfd/intel-lpss-pci.c |
1064 |
++++ b/drivers/mfd/intel-lpss-pci.c |
1065 |
+@@ -122,6 +122,18 @@ static const struct intel_lpss_platform_info apl_i2c_info = { |
1066 |
+ .properties = apl_i2c_properties, |
1067 |
+ }; |
1068 |
+ |
1069 |
++static struct property_entry glk_i2c_properties[] = { |
1070 |
++ PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 313), |
1071 |
++ PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171), |
1072 |
++ PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 290), |
1073 |
++ { }, |
1074 |
++}; |
1075 |
++ |
1076 |
++static const struct intel_lpss_platform_info glk_i2c_info = { |
1077 |
++ .clk_rate = 133000000, |
1078 |
++ .properties = glk_i2c_properties, |
1079 |
++}; |
1080 |
++ |
1081 |
+ static const struct intel_lpss_platform_info cnl_i2c_info = { |
1082 |
+ .clk_rate = 216000000, |
1083 |
+ .properties = spt_i2c_properties, |
1084 |
+@@ -174,14 +186,14 @@ static const struct pci_device_id intel_lpss_pci_ids[] = { |
1085 |
+ { PCI_VDEVICE(INTEL, 0x1ac6), (kernel_ulong_t)&bxt_info }, |
1086 |
+ { PCI_VDEVICE(INTEL, 0x1aee), (kernel_ulong_t)&bxt_uart_info }, |
1087 |
+ /* GLK */ |
1088 |
+- { PCI_VDEVICE(INTEL, 0x31ac), (kernel_ulong_t)&bxt_i2c_info }, |
1089 |
+- { PCI_VDEVICE(INTEL, 0x31ae), (kernel_ulong_t)&bxt_i2c_info }, |
1090 |
+- { PCI_VDEVICE(INTEL, 0x31b0), (kernel_ulong_t)&bxt_i2c_info }, |
1091 |
+- { PCI_VDEVICE(INTEL, 0x31b2), (kernel_ulong_t)&bxt_i2c_info }, |
1092 |
+- { PCI_VDEVICE(INTEL, 0x31b4), (kernel_ulong_t)&bxt_i2c_info }, |
1093 |
+- { PCI_VDEVICE(INTEL, 0x31b6), (kernel_ulong_t)&bxt_i2c_info }, |
1094 |
+- { PCI_VDEVICE(INTEL, 0x31b8), (kernel_ulong_t)&bxt_i2c_info }, |
1095 |
+- { PCI_VDEVICE(INTEL, 0x31ba), (kernel_ulong_t)&bxt_i2c_info }, |
1096 |
++ { PCI_VDEVICE(INTEL, 0x31ac), (kernel_ulong_t)&glk_i2c_info }, |
1097 |
++ { PCI_VDEVICE(INTEL, 0x31ae), (kernel_ulong_t)&glk_i2c_info }, |
1098 |
++ { PCI_VDEVICE(INTEL, 0x31b0), (kernel_ulong_t)&glk_i2c_info }, |
1099 |
++ { PCI_VDEVICE(INTEL, 0x31b2), (kernel_ulong_t)&glk_i2c_info }, |
1100 |
++ { PCI_VDEVICE(INTEL, 0x31b4), (kernel_ulong_t)&glk_i2c_info }, |
1101 |
++ { PCI_VDEVICE(INTEL, 0x31b6), (kernel_ulong_t)&glk_i2c_info }, |
1102 |
++ { PCI_VDEVICE(INTEL, 0x31b8), (kernel_ulong_t)&glk_i2c_info }, |
1103 |
++ { PCI_VDEVICE(INTEL, 0x31ba), (kernel_ulong_t)&glk_i2c_info }, |
1104 |
+ { PCI_VDEVICE(INTEL, 0x31bc), (kernel_ulong_t)&bxt_uart_info }, |
1105 |
+ { PCI_VDEVICE(INTEL, 0x31be), (kernel_ulong_t)&bxt_uart_info }, |
1106 |
+ { PCI_VDEVICE(INTEL, 0x31c0), (kernel_ulong_t)&bxt_uart_info }, |
1107 |
+diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h |
1108 |
+index 2d2d9ea8be4f..3dba15bccce2 100644 |
1109 |
+--- a/drivers/mmc/core/quirks.h |
1110 |
++++ b/drivers/mmc/core/quirks.h |
1111 |
+@@ -119,7 +119,14 @@ static const struct mmc_fixup mmc_ext_csd_fixups[] = { |
1112 |
+ END_FIXUP |
1113 |
+ }; |
1114 |
+ |
1115 |
++ |
1116 |
+ static const struct mmc_fixup sdio_fixup_methods[] = { |
1117 |
++ SDIO_FIXUP(SDIO_VENDOR_ID_TI_WL1251, SDIO_DEVICE_ID_TI_WL1251, |
1118 |
++ add_quirk, MMC_QUIRK_NONSTD_FUNC_IF), |
1119 |
++ |
1120 |
++ SDIO_FIXUP(SDIO_VENDOR_ID_TI_WL1251, SDIO_DEVICE_ID_TI_WL1251, |
1121 |
++ add_quirk, MMC_QUIRK_DISABLE_CD), |
1122 |
++ |
1123 |
+ SDIO_FIXUP(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271, |
1124 |
+ add_quirk, MMC_QUIRK_NONSTD_FUNC_IF), |
1125 |
+ |
1126 |
+diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c |
1127 |
+index b4b82b9c5cd6..fcbe01f61aa4 100644 |
1128 |
+--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c |
1129 |
++++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c |
1130 |
+@@ -1600,13 +1600,15 @@ static int dpaa_eth_refill_bpools(struct dpaa_priv *priv) |
1131 |
+ * Skb freeing is not handled here. |
1132 |
+ * |
1133 |
+ * This function may be called on error paths in the Tx function, so guard |
1134 |
+- * against cases when not all fd relevant fields were filled in. |
1135 |
++ * against cases when not all fd relevant fields were filled in. To avoid |
1136 |
++ * reading the invalid transmission timestamp for the error paths set ts to |
1137 |
++ * false. |
1138 |
+ * |
1139 |
+ * Return the skb backpointer, since for S/G frames the buffer containing it |
1140 |
+ * gets freed here. |
1141 |
+ */ |
1142 |
+ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv, |
1143 |
+- const struct qm_fd *fd) |
1144 |
++ const struct qm_fd *fd, bool ts) |
1145 |
+ { |
1146 |
+ const enum dma_data_direction dma_dir = DMA_TO_DEVICE; |
1147 |
+ struct device *dev = priv->net_dev->dev.parent; |
1148 |
+@@ -1620,18 +1622,6 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv, |
1149 |
+ skbh = (struct sk_buff **)phys_to_virt(addr); |
1150 |
+ skb = *skbh; |
1151 |
+ |
1152 |
+- if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) { |
1153 |
+- memset(&shhwtstamps, 0, sizeof(shhwtstamps)); |
1154 |
+- |
1155 |
+- if (!fman_port_get_tstamp(priv->mac_dev->port[TX], (void *)skbh, |
1156 |
+- &ns)) { |
1157 |
+- shhwtstamps.hwtstamp = ns_to_ktime(ns); |
1158 |
+- skb_tstamp_tx(skb, &shhwtstamps); |
1159 |
+- } else { |
1160 |
+- dev_warn(dev, "fman_port_get_tstamp failed!\n"); |
1161 |
+- } |
1162 |
+- } |
1163 |
+- |
1164 |
+ if (unlikely(qm_fd_get_format(fd) == qm_fd_sg)) { |
1165 |
+ nr_frags = skb_shinfo(skb)->nr_frags; |
1166 |
+ dma_unmap_single(dev, addr, |
1167 |
+@@ -1654,14 +1644,29 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv, |
1168 |
+ dma_unmap_page(dev, qm_sg_addr(&sgt[i]), |
1169 |
+ qm_sg_entry_get_len(&sgt[i]), dma_dir); |
1170 |
+ } |
1171 |
+- |
1172 |
+- /* Free the page frag that we allocated on Tx */ |
1173 |
+- skb_free_frag(phys_to_virt(addr)); |
1174 |
+ } else { |
1175 |
+ dma_unmap_single(dev, addr, |
1176 |
+ skb_tail_pointer(skb) - (u8 *)skbh, dma_dir); |
1177 |
+ } |
1178 |
+ |
1179 |
++ /* DMA unmapping is required before accessing the HW provided info */ |
1180 |
++ if (ts && priv->tx_tstamp && |
1181 |
++ skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) { |
1182 |
++ memset(&shhwtstamps, 0, sizeof(shhwtstamps)); |
1183 |
++ |
1184 |
++ if (!fman_port_get_tstamp(priv->mac_dev->port[TX], (void *)skbh, |
1185 |
++ &ns)) { |
1186 |
++ shhwtstamps.hwtstamp = ns_to_ktime(ns); |
1187 |
++ skb_tstamp_tx(skb, &shhwtstamps); |
1188 |
++ } else { |
1189 |
++ dev_warn(dev, "fman_port_get_tstamp failed!\n"); |
1190 |
++ } |
1191 |
++ } |
1192 |
++ |
1193 |
++ if (qm_fd_get_format(fd) == qm_fd_sg) |
1194 |
++ /* Free the page frag that we allocated on Tx */ |
1195 |
++ skb_free_frag(phys_to_virt(addr)); |
1196 |
++ |
1197 |
+ return skb; |
1198 |
+ } |
1199 |
+ |
1200 |
+@@ -2114,7 +2119,7 @@ dpaa_start_xmit(struct sk_buff *skb, struct net_device *net_dev) |
1201 |
+ if (likely(dpaa_xmit(priv, percpu_stats, queue_mapping, &fd) == 0)) |
1202 |
+ return NETDEV_TX_OK; |
1203 |
+ |
1204 |
+- dpaa_cleanup_tx_fd(priv, &fd); |
1205 |
++ dpaa_cleanup_tx_fd(priv, &fd, false); |
1206 |
+ skb_to_fd_failed: |
1207 |
+ enomem: |
1208 |
+ percpu_stats->tx_errors++; |
1209 |
+@@ -2160,7 +2165,7 @@ static void dpaa_tx_error(struct net_device *net_dev, |
1210 |
+ |
1211 |
+ percpu_priv->stats.tx_errors++; |
1212 |
+ |
1213 |
+- skb = dpaa_cleanup_tx_fd(priv, fd); |
1214 |
++ skb = dpaa_cleanup_tx_fd(priv, fd, false); |
1215 |
+ dev_kfree_skb(skb); |
1216 |
+ } |
1217 |
+ |
1218 |
+@@ -2200,7 +2205,7 @@ static void dpaa_tx_conf(struct net_device *net_dev, |
1219 |
+ |
1220 |
+ percpu_priv->tx_confirm++; |
1221 |
+ |
1222 |
+- skb = dpaa_cleanup_tx_fd(priv, fd); |
1223 |
++ skb = dpaa_cleanup_tx_fd(priv, fd, true); |
1224 |
+ |
1225 |
+ consume_skb(skb); |
1226 |
+ } |
1227 |
+@@ -2430,7 +2435,7 @@ static void egress_ern(struct qman_portal *portal, |
1228 |
+ percpu_priv->stats.tx_fifo_errors++; |
1229 |
+ count_ern(percpu_priv, msg); |
1230 |
+ |
1231 |
+- skb = dpaa_cleanup_tx_fd(priv, fd); |
1232 |
++ skb = dpaa_cleanup_tx_fd(priv, fd, false); |
1233 |
+ dev_kfree_skb_any(skb); |
1234 |
+ } |
1235 |
+ |
1236 |
+diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c |
1237 |
+index 0aa1c34019bb..dc9a6c36cac0 100644 |
1238 |
+--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c |
1239 |
++++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c |
1240 |
+@@ -216,7 +216,7 @@ static void dpaa2_eth_get_ethtool_stats(struct net_device *net_dev, |
1241 |
+ if (err == -EINVAL) |
1242 |
+ /* Older firmware versions don't support all pages */ |
1243 |
+ memset(&dpni_stats, 0, sizeof(dpni_stats)); |
1244 |
+- else |
1245 |
++ else if (err) |
1246 |
+ netdev_warn(net_dev, "dpni_get_stats(%d) failed\n", j); |
1247 |
+ |
1248 |
+ num_cnt = dpni_stats_page_size[j] / sizeof(u64); |
1249 |
+diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c |
1250 |
+index c0637a0cbfe8..e92a00a61755 100644 |
1251 |
+--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c |
1252 |
++++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c |
1253 |
+@@ -1873,8 +1873,8 @@ static int ice_vc_get_stats_msg(struct ice_vf *vf, u8 *msg) |
1254 |
+ enum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS; |
1255 |
+ struct virtchnl_queue_select *vqs = |
1256 |
+ (struct virtchnl_queue_select *)msg; |
1257 |
++ struct ice_eth_stats stats = { 0 }; |
1258 |
+ struct ice_pf *pf = vf->pf; |
1259 |
+- struct ice_eth_stats stats; |
1260 |
+ struct ice_vsi *vsi; |
1261 |
+ |
1262 |
+ if (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) { |
1263 |
+@@ -1893,7 +1893,6 @@ static int ice_vc_get_stats_msg(struct ice_vf *vf, u8 *msg) |
1264 |
+ goto error_param; |
1265 |
+ } |
1266 |
+ |
1267 |
+- memset(&stats, 0, sizeof(struct ice_eth_stats)); |
1268 |
+ ice_update_eth_stats(vsi); |
1269 |
+ |
1270 |
+ stats = vsi->eth_stats; |
1271 |
+diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
1272 |
+index 947122c68493..96711e34d248 100644 |
1273 |
+--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
1274 |
++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c |
1275 |
+@@ -1615,8 +1615,11 @@ static void __mlx5e_tc_del_fdb_peer_flow(struct mlx5e_tc_flow *flow) |
1276 |
+ |
1277 |
+ flow_flag_clear(flow, DUP); |
1278 |
+ |
1279 |
+- mlx5e_tc_del_fdb_flow(flow->peer_flow->priv, flow->peer_flow); |
1280 |
+- kfree(flow->peer_flow); |
1281 |
++ if (refcount_dec_and_test(&flow->peer_flow->refcnt)) { |
1282 |
++ mlx5e_tc_del_fdb_flow(flow->peer_flow->priv, flow->peer_flow); |
1283 |
++ kfree(flow->peer_flow); |
1284 |
++ } |
1285 |
++ |
1286 |
+ flow->peer_flow = NULL; |
1287 |
+ } |
1288 |
+ |
1289 |
+diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c |
1290 |
+index f9e6744d8fd6..41ddd8fff2a7 100644 |
1291 |
+--- a/drivers/net/ethernet/socionext/netsec.c |
1292 |
++++ b/drivers/net/ethernet/socionext/netsec.c |
1293 |
+@@ -847,8 +847,8 @@ static u32 netsec_xdp_queue_one(struct netsec_priv *priv, |
1294 |
+ enum dma_data_direction dma_dir = |
1295 |
+ page_pool_get_dma_dir(rx_ring->page_pool); |
1296 |
+ |
1297 |
+- dma_handle = page_pool_get_dma_addr(page) + |
1298 |
+- NETSEC_RXBUF_HEADROOM; |
1299 |
++ dma_handle = page_pool_get_dma_addr(page) + xdpf->headroom + |
1300 |
++ sizeof(*xdpf); |
1301 |
+ dma_sync_single_for_device(priv->dev, dma_handle, xdpf->len, |
1302 |
+ dma_dir); |
1303 |
+ tx_desc.buf_type = TYPE_NETSEC_XDP_TX; |
1304 |
+diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c |
1305 |
+index 676006f32f91..479325eeaf8a 100644 |
1306 |
+--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c |
1307 |
++++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c |
1308 |
+@@ -1790,10 +1790,6 @@ static int axienet_probe(struct platform_device *pdev) |
1309 |
+ /* Check for these resources directly on the Ethernet node. */ |
1310 |
+ struct resource *res = platform_get_resource(pdev, |
1311 |
+ IORESOURCE_MEM, 1); |
1312 |
+- if (!res) { |
1313 |
+- dev_err(&pdev->dev, "unable to get DMA memory resource\n"); |
1314 |
+- goto free_netdev; |
1315 |
+- } |
1316 |
+ lp->dma_regs = devm_ioremap_resource(&pdev->dev, res); |
1317 |
+ lp->rx_irq = platform_get_irq(pdev, 1); |
1318 |
+ lp->tx_irq = platform_get_irq(pdev, 0); |
1319 |
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c |
1320 |
+index 78e3e689a733..0dee358864f3 100644 |
1321 |
+--- a/drivers/net/hyperv/netvsc_drv.c |
1322 |
++++ b/drivers/net/hyperv/netvsc_drv.c |
1323 |
+@@ -285,9 +285,9 @@ static inline u32 netvsc_get_hash( |
1324 |
+ else if (flow.basic.n_proto == htons(ETH_P_IPV6)) |
1325 |
+ hash = jhash2((u32 *)&flow.addrs.v6addrs, 8, hashrnd); |
1326 |
+ else |
1327 |
+- hash = 0; |
1328 |
++ return 0; |
1329 |
+ |
1330 |
+- skb_set_hash(skb, hash, PKT_HASH_TYPE_L3); |
1331 |
++ __skb_set_sw_hash(skb, hash, false); |
1332 |
+ } |
1333 |
+ |
1334 |
+ return hash; |
1335 |
+@@ -795,8 +795,7 @@ static struct sk_buff *netvsc_alloc_recv_skb(struct net_device *net, |
1336 |
+ skb->protocol == htons(ETH_P_IP)) |
1337 |
+ netvsc_comp_ipcsum(skb); |
1338 |
+ |
1339 |
+- /* Do L4 checksum offload if enabled and present. |
1340 |
+- */ |
1341 |
++ /* Do L4 checksum offload if enabled and present. */ |
1342 |
+ if (csum_info && (net->features & NETIF_F_RXCSUM)) { |
1343 |
+ if (csum_info->receive.tcp_checksum_succeeded || |
1344 |
+ csum_info->receive.udp_checksum_succeeded) |
1345 |
+diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c |
1346 |
+index 937d0059e8ac..5e956089bf52 100644 |
1347 |
+--- a/drivers/net/phy/broadcom.c |
1348 |
++++ b/drivers/net/phy/broadcom.c |
1349 |
+@@ -26,18 +26,13 @@ MODULE_DESCRIPTION("Broadcom PHY driver"); |
1350 |
+ MODULE_AUTHOR("Maciej W. Rozycki"); |
1351 |
+ MODULE_LICENSE("GPL"); |
1352 |
+ |
1353 |
++static int bcm54xx_config_clock_delay(struct phy_device *phydev); |
1354 |
++ |
1355 |
+ static int bcm54210e_config_init(struct phy_device *phydev) |
1356 |
+ { |
1357 |
+ int val; |
1358 |
+ |
1359 |
+- val = bcm54xx_auxctl_read(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC); |
1360 |
+- val &= ~MII_BCM54XX_AUXCTL_SHDWSEL_MISC_RGMII_SKEW_EN; |
1361 |
+- val |= MII_BCM54XX_AUXCTL_MISC_WREN; |
1362 |
+- bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_MISC, val); |
1363 |
+- |
1364 |
+- val = bcm_phy_read_shadow(phydev, BCM54810_SHD_CLK_CTL); |
1365 |
+- val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN; |
1366 |
+- bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val); |
1367 |
++ bcm54xx_config_clock_delay(phydev); |
1368 |
+ |
1369 |
+ if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) { |
1370 |
+ val = phy_read(phydev, MII_CTRL1000); |
1371 |
+diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h |
1372 |
+index 8aec7ccf2d79..502814c26b33 100644 |
1373 |
+--- a/drivers/net/wireless/mediatek/mt76/mt76.h |
1374 |
++++ b/drivers/net/wireless/mediatek/mt76/mt76.h |
1375 |
+@@ -367,8 +367,8 @@ enum mt76u_in_ep { |
1376 |
+ |
1377 |
+ enum mt76u_out_ep { |
1378 |
+ MT_EP_OUT_INBAND_CMD, |
1379 |
+- MT_EP_OUT_AC_BK, |
1380 |
+ MT_EP_OUT_AC_BE, |
1381 |
++ MT_EP_OUT_AC_BK, |
1382 |
+ MT_EP_OUT_AC_VI, |
1383 |
+ MT_EP_OUT_AC_VO, |
1384 |
+ MT_EP_OUT_HCCA, |
1385 |
+@@ -799,7 +799,8 @@ static inline int |
1386 |
+ mt76u_bulk_msg(struct mt76_dev *dev, void *data, int len, int *actual_len, |
1387 |
+ int timeout) |
1388 |
+ { |
1389 |
+- struct usb_device *udev = to_usb_device(dev->dev); |
1390 |
++ struct usb_interface *uintf = to_usb_interface(dev->dev); |
1391 |
++ struct usb_device *udev = interface_to_usbdev(uintf); |
1392 |
+ struct mt76_usb *usb = &dev->usb; |
1393 |
+ unsigned int pipe; |
1394 |
+ |
1395 |
+diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c |
1396 |
+index 00a445d27599..65d404e61404 100644 |
1397 |
+--- a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c |
1398 |
++++ b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c |
1399 |
+@@ -226,7 +226,7 @@ static int mt76x0u_probe(struct usb_interface *usb_intf, |
1400 |
+ u32 mac_rev; |
1401 |
+ int ret; |
1402 |
+ |
1403 |
+- mdev = mt76_alloc_device(&usb_dev->dev, sizeof(*dev), &mt76x0u_ops, |
1404 |
++ mdev = mt76_alloc_device(&usb_intf->dev, sizeof(*dev), &mt76x0u_ops, |
1405 |
+ &drv_ops); |
1406 |
+ if (!mdev) |
1407 |
+ return -ENOMEM; |
1408 |
+diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c |
1409 |
+index da5e0f9a8bae..8b26c6108186 100644 |
1410 |
+--- a/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c |
1411 |
++++ b/drivers/net/wireless/mediatek/mt76/mt76x2/usb.c |
1412 |
+@@ -39,7 +39,7 @@ static int mt76x2u_probe(struct usb_interface *intf, |
1413 |
+ struct mt76_dev *mdev; |
1414 |
+ int err; |
1415 |
+ |
1416 |
+- mdev = mt76_alloc_device(&udev->dev, sizeof(*dev), &mt76x2u_ops, |
1417 |
++ mdev = mt76_alloc_device(&intf->dev, sizeof(*dev), &mt76x2u_ops, |
1418 |
+ &drv_ops); |
1419 |
+ if (!mdev) |
1420 |
+ return -ENOMEM; |
1421 |
+diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c |
1422 |
+index 20c6fe510e9d..05aa42bd9808 100644 |
1423 |
+--- a/drivers/net/wireless/mediatek/mt76/usb.c |
1424 |
++++ b/drivers/net/wireless/mediatek/mt76/usb.c |
1425 |
+@@ -20,7 +20,8 @@ static int __mt76u_vendor_request(struct mt76_dev *dev, u8 req, |
1426 |
+ u8 req_type, u16 val, u16 offset, |
1427 |
+ void *buf, size_t len) |
1428 |
+ { |
1429 |
+- struct usb_device *udev = to_usb_device(dev->dev); |
1430 |
++ struct usb_interface *uintf = to_usb_interface(dev->dev); |
1431 |
++ struct usb_device *udev = interface_to_usbdev(uintf); |
1432 |
+ unsigned int pipe; |
1433 |
+ int i, ret; |
1434 |
+ |
1435 |
+@@ -235,7 +236,8 @@ mt76u_rd_rp(struct mt76_dev *dev, u32 base, |
1436 |
+ |
1437 |
+ static bool mt76u_check_sg(struct mt76_dev *dev) |
1438 |
+ { |
1439 |
+- struct usb_device *udev = to_usb_device(dev->dev); |
1440 |
++ struct usb_interface *uintf = to_usb_interface(dev->dev); |
1441 |
++ struct usb_device *udev = interface_to_usbdev(uintf); |
1442 |
+ |
1443 |
+ return (!disable_usb_sg && udev->bus->sg_tablesize > 0 && |
1444 |
+ (udev->bus->no_sg_constraint || |
1445 |
+@@ -370,7 +372,8 @@ mt76u_fill_bulk_urb(struct mt76_dev *dev, int dir, int index, |
1446 |
+ struct urb *urb, usb_complete_t complete_fn, |
1447 |
+ void *context) |
1448 |
+ { |
1449 |
+- struct usb_device *udev = to_usb_device(dev->dev); |
1450 |
++ struct usb_interface *uintf = to_usb_interface(dev->dev); |
1451 |
++ struct usb_device *udev = interface_to_usbdev(uintf); |
1452 |
+ unsigned int pipe; |
1453 |
+ |
1454 |
+ if (dir == USB_DIR_IN) |
1455 |
+@@ -952,6 +955,7 @@ int mt76u_init(struct mt76_dev *dev, |
1456 |
+ .rd_rp = mt76u_rd_rp, |
1457 |
+ .type = MT76_BUS_USB, |
1458 |
+ }; |
1459 |
++ struct usb_device *udev = interface_to_usbdev(intf); |
1460 |
+ struct mt76_usb *usb = &dev->usb; |
1461 |
+ |
1462 |
+ tasklet_init(&usb->rx_tasklet, mt76u_rx_tasklet, (unsigned long)dev); |
1463 |
+@@ -965,6 +969,8 @@ int mt76u_init(struct mt76_dev *dev, |
1464 |
+ dev->bus = &mt76u_ops; |
1465 |
+ dev->queue_ops = &usb_queue_ops; |
1466 |
+ |
1467 |
++ dev_set_drvdata(&udev->dev, dev); |
1468 |
++ |
1469 |
+ usb->sg_en = mt76u_check_sg(dev); |
1470 |
+ |
1471 |
+ return mt76u_set_endpoints(intf, usb); |
1472 |
+diff --git a/drivers/net/wireless/mediatek/mt7601u/phy.c b/drivers/net/wireless/mediatek/mt7601u/phy.c |
1473 |
+index 06f5702ab4bd..d863ab4a66c9 100644 |
1474 |
+--- a/drivers/net/wireless/mediatek/mt7601u/phy.c |
1475 |
++++ b/drivers/net/wireless/mediatek/mt7601u/phy.c |
1476 |
+@@ -213,7 +213,7 @@ int mt7601u_wait_bbp_ready(struct mt7601u_dev *dev) |
1477 |
+ |
1478 |
+ do { |
1479 |
+ val = mt7601u_bbp_rr(dev, MT_BBP_REG_VERSION); |
1480 |
+- if (val && ~val) |
1481 |
++ if (val && val != 0xff) |
1482 |
+ break; |
1483 |
+ } while (--i); |
1484 |
+ |
1485 |
+diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c |
1486 |
+index f1cdcd61c54a..c99f1912e266 100644 |
1487 |
+--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c |
1488 |
++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c |
1489 |
+@@ -5839,8 +5839,7 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) |
1490 |
+ rt2800_register_write(rt2x00dev, TX_TXBF_CFG_0, 0x8000fc21); |
1491 |
+ rt2800_register_write(rt2x00dev, TX_TXBF_CFG_3, 0x00009c40); |
1492 |
+ } else if (rt2x00_rt(rt2x00dev, RT5390) || |
1493 |
+- rt2x00_rt(rt2x00dev, RT5392) || |
1494 |
+- rt2x00_rt(rt2x00dev, RT6352)) { |
1495 |
++ rt2x00_rt(rt2x00dev, RT5392)) { |
1496 |
+ rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404); |
1497 |
+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606); |
1498 |
+ rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); |
1499 |
+@@ -5854,8 +5853,6 @@ static int rt2800_init_registers(struct rt2x00_dev *rt2x00dev) |
1500 |
+ rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000401); |
1501 |
+ rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x000C0000); |
1502 |
+ rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); |
1503 |
+- rt2800_register_write(rt2x00dev, MIMO_PS_CFG, 0x00000002); |
1504 |
+- rt2800_register_write(rt2x00dev, TX_PIN_CFG, 0x00150F0F); |
1505 |
+ rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000); |
1506 |
+ rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0); |
1507 |
+ rt2800_register_write(rt2x00dev, TX1_BB_GAIN_ATTEN, 0x0); |
1508 |
+diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c |
1509 |
+index b082e2cc95f5..35dbdb3c4f1e 100644 |
1510 |
+--- a/drivers/net/wireless/realtek/rtw88/fw.c |
1511 |
++++ b/drivers/net/wireless/realtek/rtw88/fw.c |
1512 |
+@@ -498,9 +498,6 @@ static void rtw_rsvd_page_list_to_buf(struct rtw_dev *rtwdev, u8 page_size, |
1513 |
+ { |
1514 |
+ struct sk_buff *skb = rsvd_pkt->skb; |
1515 |
+ |
1516 |
+- if (rsvd_pkt->add_txdesc) |
1517 |
+- rtw_fill_rsvd_page_desc(rtwdev, skb); |
1518 |
+- |
1519 |
+ if (page >= 1) |
1520 |
+ memcpy(buf + page_margin + page_size * (page - 1), |
1521 |
+ skb->data, skb->len); |
1522 |
+@@ -625,16 +622,37 @@ static u8 *rtw_build_rsvd_page(struct rtw_dev *rtwdev, |
1523 |
+ list_for_each_entry(rsvd_pkt, &rtwdev->rsvd_page_list, list) { |
1524 |
+ iter = rtw_get_rsvd_page_skb(hw, vif, rsvd_pkt->type); |
1525 |
+ if (!iter) { |
1526 |
+- rtw_err(rtwdev, "fail to build rsvd packet\n"); |
1527 |
++ rtw_err(rtwdev, "failed to build rsvd packet\n"); |
1528 |
+ goto release_skb; |
1529 |
+ } |
1530 |
++ |
1531 |
++ /* Fill the tx_desc for the rsvd pkt that requires one. |
1532 |
++ * And iter->len will be added with size of tx_desc_sz. |
1533 |
++ */ |
1534 |
++ if (rsvd_pkt->add_txdesc) |
1535 |
++ rtw_fill_rsvd_page_desc(rtwdev, iter); |
1536 |
++ |
1537 |
+ rsvd_pkt->skb = iter; |
1538 |
+ rsvd_pkt->page = total_page; |
1539 |
+- if (rsvd_pkt->add_txdesc) |
1540 |
++ |
1541 |
++ /* Reserved page is downloaded via TX path, and TX path will |
1542 |
++ * generate a tx_desc at the header to describe length of |
1543 |
++ * the buffer. If we are not counting page numbers with the |
1544 |
++ * size of tx_desc added at the first rsvd_pkt (usually a |
1545 |
++ * beacon, firmware default refer to the first page as the |
1546 |
++ * content of beacon), we could generate a buffer which size |
1547 |
++ * is smaller than the actual size of the whole rsvd_page |
1548 |
++ */ |
1549 |
++ if (total_page == 0) { |
1550 |
++ if (rsvd_pkt->type != RSVD_BEACON) { |
1551 |
++ rtw_err(rtwdev, "first page should be a beacon\n"); |
1552 |
++ goto release_skb; |
1553 |
++ } |
1554 |
+ total_page += rtw_len_to_page(iter->len + tx_desc_sz, |
1555 |
+ page_size); |
1556 |
+- else |
1557 |
++ } else { |
1558 |
+ total_page += rtw_len_to_page(iter->len, page_size); |
1559 |
++ } |
1560 |
+ } |
1561 |
+ |
1562 |
+ if (total_page > rtwdev->fifo.rsvd_drv_pg_num) { |
1563 |
+@@ -647,13 +665,24 @@ static u8 *rtw_build_rsvd_page(struct rtw_dev *rtwdev, |
1564 |
+ if (!buf) |
1565 |
+ goto release_skb; |
1566 |
+ |
1567 |
++ /* Copy the content of each rsvd_pkt to the buf, and they should |
1568 |
++ * be aligned to the pages. |
1569 |
++ * |
1570 |
++ * Note that the first rsvd_pkt is a beacon no matter what vif->type. |
1571 |
++ * And that rsvd_pkt does not require tx_desc because when it goes |
1572 |
++ * through TX path, the TX path will generate one for it. |
1573 |
++ */ |
1574 |
+ list_for_each_entry(rsvd_pkt, &rtwdev->rsvd_page_list, list) { |
1575 |
+ rtw_rsvd_page_list_to_buf(rtwdev, page_size, page_margin, |
1576 |
+ page, buf, rsvd_pkt); |
1577 |
+- page += rtw_len_to_page(rsvd_pkt->skb->len, page_size); |
1578 |
+- } |
1579 |
+- list_for_each_entry(rsvd_pkt, &rtwdev->rsvd_page_list, list) |
1580 |
++ if (page == 0) |
1581 |
++ page += rtw_len_to_page(rsvd_pkt->skb->len + |
1582 |
++ tx_desc_sz, page_size); |
1583 |
++ else |
1584 |
++ page += rtw_len_to_page(rsvd_pkt->skb->len, page_size); |
1585 |
++ |
1586 |
+ kfree_skb(rsvd_pkt->skb); |
1587 |
++ } |
1588 |
+ |
1589 |
+ return buf; |
1590 |
+ |
1591 |
+@@ -706,6 +735,11 @@ int rtw_fw_download_rsvd_page(struct rtw_dev *rtwdev, struct ieee80211_vif *vif) |
1592 |
+ goto free; |
1593 |
+ } |
1594 |
+ |
1595 |
++ /* The last thing is to download the *ONLY* beacon again, because |
1596 |
++ * the previous tx_desc is to describe the total rsvd page. Download |
1597 |
++ * the beacon again to replace the TX desc header, and we will get |
1598 |
++ * a correct tx_desc for the beacon in the rsvd page. |
1599 |
++ */ |
1600 |
+ ret = rtw_download_beacon(rtwdev, vif); |
1601 |
+ if (ret) { |
1602 |
+ rtw_err(rtwdev, "failed to download beacon\n"); |
1603 |
+diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c |
1604 |
+index 7a3a4911bde2..806af37192bc 100644 |
1605 |
+--- a/drivers/net/wireless/realtek/rtw88/main.c |
1606 |
++++ b/drivers/net/wireless/realtek/rtw88/main.c |
1607 |
+@@ -1048,19 +1048,19 @@ static int rtw_chip_efuse_info_setup(struct rtw_dev *rtwdev) |
1608 |
+ /* power on mac to read efuse */ |
1609 |
+ ret = rtw_chip_efuse_enable(rtwdev); |
1610 |
+ if (ret) |
1611 |
+- goto out; |
1612 |
++ goto out_unlock; |
1613 |
+ |
1614 |
+ ret = rtw_parse_efuse_map(rtwdev); |
1615 |
+ if (ret) |
1616 |
+- goto out; |
1617 |
++ goto out_disable; |
1618 |
+ |
1619 |
+ ret = rtw_dump_hw_feature(rtwdev); |
1620 |
+ if (ret) |
1621 |
+- goto out; |
1622 |
++ goto out_disable; |
1623 |
+ |
1624 |
+ ret = rtw_check_supported_rfe(rtwdev); |
1625 |
+ if (ret) |
1626 |
+- goto out; |
1627 |
++ goto out_disable; |
1628 |
+ |
1629 |
+ if (efuse->crystal_cap == 0xff) |
1630 |
+ efuse->crystal_cap = 0; |
1631 |
+@@ -1087,9 +1087,10 @@ static int rtw_chip_efuse_info_setup(struct rtw_dev *rtwdev) |
1632 |
+ efuse->ext_pa_5g = efuse->pa_type_5g & BIT(0) ? 1 : 0; |
1633 |
+ efuse->ext_lna_2g = efuse->lna_type_5g & BIT(3) ? 1 : 0; |
1634 |
+ |
1635 |
++out_disable: |
1636 |
+ rtw_chip_efuse_disable(rtwdev); |
1637 |
+ |
1638 |
+-out: |
1639 |
++out_unlock: |
1640 |
+ mutex_unlock(&rtwdev->mutex); |
1641 |
+ return ret; |
1642 |
+ } |
1643 |
+diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c |
1644 |
+index a45a6447b01d..32f37d08d5bc 100644 |
1645 |
+--- a/drivers/pci/controller/pcie-mobiveil.c |
1646 |
++++ b/drivers/pci/controller/pcie-mobiveil.c |
1647 |
+@@ -235,7 +235,7 @@ static int mobiveil_pcie_write(void __iomem *addr, int size, u32 val) |
1648 |
+ return PCIBIOS_SUCCESSFUL; |
1649 |
+ } |
1650 |
+ |
1651 |
+-static u32 csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size) |
1652 |
++static u32 mobiveil_csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size) |
1653 |
+ { |
1654 |
+ void *addr; |
1655 |
+ u32 val; |
1656 |
+@@ -250,7 +250,8 @@ static u32 csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size) |
1657 |
+ return val; |
1658 |
+ } |
1659 |
+ |
1660 |
+-static void csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, size_t size) |
1661 |
++static void mobiveil_csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, |
1662 |
++ size_t size) |
1663 |
+ { |
1664 |
+ void *addr; |
1665 |
+ int ret; |
1666 |
+@@ -262,19 +263,19 @@ static void csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, size_t size) |
1667 |
+ dev_err(&pcie->pdev->dev, "write CSR address failed\n"); |
1668 |
+ } |
1669 |
+ |
1670 |
+-static u32 csr_readl(struct mobiveil_pcie *pcie, u32 off) |
1671 |
++static u32 mobiveil_csr_readl(struct mobiveil_pcie *pcie, u32 off) |
1672 |
+ { |
1673 |
+- return csr_read(pcie, off, 0x4); |
1674 |
++ return mobiveil_csr_read(pcie, off, 0x4); |
1675 |
+ } |
1676 |
+ |
1677 |
+-static void csr_writel(struct mobiveil_pcie *pcie, u32 val, u32 off) |
1678 |
++static void mobiveil_csr_writel(struct mobiveil_pcie *pcie, u32 val, u32 off) |
1679 |
+ { |
1680 |
+- csr_write(pcie, val, off, 0x4); |
1681 |
++ mobiveil_csr_write(pcie, val, off, 0x4); |
1682 |
+ } |
1683 |
+ |
1684 |
+ static bool mobiveil_pcie_link_up(struct mobiveil_pcie *pcie) |
1685 |
+ { |
1686 |
+- return (csr_readl(pcie, LTSSM_STATUS) & |
1687 |
++ return (mobiveil_csr_readl(pcie, LTSSM_STATUS) & |
1688 |
+ LTSSM_STATUS_L0_MASK) == LTSSM_STATUS_L0; |
1689 |
+ } |
1690 |
+ |
1691 |
+@@ -323,7 +324,7 @@ static void __iomem *mobiveil_pcie_map_bus(struct pci_bus *bus, |
1692 |
+ PCI_SLOT(devfn) << PAB_DEVICE_SHIFT | |
1693 |
+ PCI_FUNC(devfn) << PAB_FUNCTION_SHIFT; |
1694 |
+ |
1695 |
+- csr_writel(pcie, value, PAB_AXI_AMAP_PEX_WIN_L(WIN_NUM_0)); |
1696 |
++ mobiveil_csr_writel(pcie, value, PAB_AXI_AMAP_PEX_WIN_L(WIN_NUM_0)); |
1697 |
+ |
1698 |
+ return pcie->config_axi_slave_base + where; |
1699 |
+ } |
1700 |
+@@ -353,13 +354,14 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) |
1701 |
+ chained_irq_enter(chip, desc); |
1702 |
+ |
1703 |
+ /* read INTx status */ |
1704 |
+- val = csr_readl(pcie, PAB_INTP_AMBA_MISC_STAT); |
1705 |
+- mask = csr_readl(pcie, PAB_INTP_AMBA_MISC_ENB); |
1706 |
++ val = mobiveil_csr_readl(pcie, PAB_INTP_AMBA_MISC_STAT); |
1707 |
++ mask = mobiveil_csr_readl(pcie, PAB_INTP_AMBA_MISC_ENB); |
1708 |
+ intr_status = val & mask; |
1709 |
+ |
1710 |
+ /* Handle INTx */ |
1711 |
+ if (intr_status & PAB_INTP_INTX_MASK) { |
1712 |
+- shifted_status = csr_readl(pcie, PAB_INTP_AMBA_MISC_STAT); |
1713 |
++ shifted_status = mobiveil_csr_readl(pcie, |
1714 |
++ PAB_INTP_AMBA_MISC_STAT); |
1715 |
+ shifted_status &= PAB_INTP_INTX_MASK; |
1716 |
+ shifted_status >>= PAB_INTX_START; |
1717 |
+ do { |
1718 |
+@@ -373,12 +375,13 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) |
1719 |
+ bit); |
1720 |
+ |
1721 |
+ /* clear interrupt handled */ |
1722 |
+- csr_writel(pcie, 1 << (PAB_INTX_START + bit), |
1723 |
+- PAB_INTP_AMBA_MISC_STAT); |
1724 |
++ mobiveil_csr_writel(pcie, |
1725 |
++ 1 << (PAB_INTX_START + bit), |
1726 |
++ PAB_INTP_AMBA_MISC_STAT); |
1727 |
+ } |
1728 |
+ |
1729 |
+- shifted_status = csr_readl(pcie, |
1730 |
+- PAB_INTP_AMBA_MISC_STAT); |
1731 |
++ shifted_status = mobiveil_csr_readl(pcie, |
1732 |
++ PAB_INTP_AMBA_MISC_STAT); |
1733 |
+ shifted_status &= PAB_INTP_INTX_MASK; |
1734 |
+ shifted_status >>= PAB_INTX_START; |
1735 |
+ } while (shifted_status != 0); |
1736 |
+@@ -413,7 +416,7 @@ static void mobiveil_pcie_isr(struct irq_desc *desc) |
1737 |
+ } |
1738 |
+ |
1739 |
+ /* Clear the interrupt status */ |
1740 |
+- csr_writel(pcie, intr_status, PAB_INTP_AMBA_MISC_STAT); |
1741 |
++ mobiveil_csr_writel(pcie, intr_status, PAB_INTP_AMBA_MISC_STAT); |
1742 |
+ chained_irq_exit(chip, desc); |
1743 |
+ } |
1744 |
+ |
1745 |
+@@ -474,24 +477,24 @@ static void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, |
1746 |
+ return; |
1747 |
+ } |
1748 |
+ |
1749 |
+- value = csr_readl(pcie, PAB_PEX_AMAP_CTRL(win_num)); |
1750 |
++ value = mobiveil_csr_readl(pcie, PAB_PEX_AMAP_CTRL(win_num)); |
1751 |
+ value &= ~(AMAP_CTRL_TYPE_MASK << AMAP_CTRL_TYPE_SHIFT | WIN_SIZE_MASK); |
1752 |
+ value |= type << AMAP_CTRL_TYPE_SHIFT | 1 << AMAP_CTRL_EN_SHIFT | |
1753 |
+ (lower_32_bits(size64) & WIN_SIZE_MASK); |
1754 |
+- csr_writel(pcie, value, PAB_PEX_AMAP_CTRL(win_num)); |
1755 |
++ mobiveil_csr_writel(pcie, value, PAB_PEX_AMAP_CTRL(win_num)); |
1756 |
+ |
1757 |
+- csr_writel(pcie, upper_32_bits(size64), |
1758 |
+- PAB_EXT_PEX_AMAP_SIZEN(win_num)); |
1759 |
++ mobiveil_csr_writel(pcie, upper_32_bits(size64), |
1760 |
++ PAB_EXT_PEX_AMAP_SIZEN(win_num)); |
1761 |
+ |
1762 |
+- csr_writel(pcie, lower_32_bits(cpu_addr), |
1763 |
+- PAB_PEX_AMAP_AXI_WIN(win_num)); |
1764 |
+- csr_writel(pcie, upper_32_bits(cpu_addr), |
1765 |
+- PAB_EXT_PEX_AMAP_AXI_WIN(win_num)); |
1766 |
++ mobiveil_csr_writel(pcie, lower_32_bits(cpu_addr), |
1767 |
++ PAB_PEX_AMAP_AXI_WIN(win_num)); |
1768 |
++ mobiveil_csr_writel(pcie, upper_32_bits(cpu_addr), |
1769 |
++ PAB_EXT_PEX_AMAP_AXI_WIN(win_num)); |
1770 |
+ |
1771 |
+- csr_writel(pcie, lower_32_bits(pci_addr), |
1772 |
+- PAB_PEX_AMAP_PEX_WIN_L(win_num)); |
1773 |
+- csr_writel(pcie, upper_32_bits(pci_addr), |
1774 |
+- PAB_PEX_AMAP_PEX_WIN_H(win_num)); |
1775 |
++ mobiveil_csr_writel(pcie, lower_32_bits(pci_addr), |
1776 |
++ PAB_PEX_AMAP_PEX_WIN_L(win_num)); |
1777 |
++ mobiveil_csr_writel(pcie, upper_32_bits(pci_addr), |
1778 |
++ PAB_PEX_AMAP_PEX_WIN_H(win_num)); |
1779 |
+ |
1780 |
+ pcie->ib_wins_configured++; |
1781 |
+ } |
1782 |
+@@ -515,27 +518,29 @@ static void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, |
1783 |
+ * program Enable Bit to 1, Type Bit to (00) base 2, AXI Window Size Bit |
1784 |
+ * to 4 KB in PAB_AXI_AMAP_CTRL register |
1785 |
+ */ |
1786 |
+- value = csr_readl(pcie, PAB_AXI_AMAP_CTRL(win_num)); |
1787 |
++ value = mobiveil_csr_readl(pcie, PAB_AXI_AMAP_CTRL(win_num)); |
1788 |
+ value &= ~(WIN_TYPE_MASK << WIN_TYPE_SHIFT | WIN_SIZE_MASK); |
1789 |
+ value |= 1 << WIN_ENABLE_SHIFT | type << WIN_TYPE_SHIFT | |
1790 |
+ (lower_32_bits(size64) & WIN_SIZE_MASK); |
1791 |
+- csr_writel(pcie, value, PAB_AXI_AMAP_CTRL(win_num)); |
1792 |
++ mobiveil_csr_writel(pcie, value, PAB_AXI_AMAP_CTRL(win_num)); |
1793 |
+ |
1794 |
+- csr_writel(pcie, upper_32_bits(size64), PAB_EXT_AXI_AMAP_SIZE(win_num)); |
1795 |
++ mobiveil_csr_writel(pcie, upper_32_bits(size64), |
1796 |
++ PAB_EXT_AXI_AMAP_SIZE(win_num)); |
1797 |
+ |
1798 |
+ /* |
1799 |
+ * program AXI window base with appropriate value in |
1800 |
+ * PAB_AXI_AMAP_AXI_WIN0 register |
1801 |
+ */ |
1802 |
+- csr_writel(pcie, lower_32_bits(cpu_addr) & (~AXI_WINDOW_ALIGN_MASK), |
1803 |
+- PAB_AXI_AMAP_AXI_WIN(win_num)); |
1804 |
+- csr_writel(pcie, upper_32_bits(cpu_addr), |
1805 |
+- PAB_EXT_AXI_AMAP_AXI_WIN(win_num)); |
1806 |
++ mobiveil_csr_writel(pcie, |
1807 |
++ lower_32_bits(cpu_addr) & (~AXI_WINDOW_ALIGN_MASK), |
1808 |
++ PAB_AXI_AMAP_AXI_WIN(win_num)); |
1809 |
++ mobiveil_csr_writel(pcie, upper_32_bits(cpu_addr), |
1810 |
++ PAB_EXT_AXI_AMAP_AXI_WIN(win_num)); |
1811 |
+ |
1812 |
+- csr_writel(pcie, lower_32_bits(pci_addr), |
1813 |
+- PAB_AXI_AMAP_PEX_WIN_L(win_num)); |
1814 |
+- csr_writel(pcie, upper_32_bits(pci_addr), |
1815 |
+- PAB_AXI_AMAP_PEX_WIN_H(win_num)); |
1816 |
++ mobiveil_csr_writel(pcie, lower_32_bits(pci_addr), |
1817 |
++ PAB_AXI_AMAP_PEX_WIN_L(win_num)); |
1818 |
++ mobiveil_csr_writel(pcie, upper_32_bits(pci_addr), |
1819 |
++ PAB_AXI_AMAP_PEX_WIN_H(win_num)); |
1820 |
+ |
1821 |
+ pcie->ob_wins_configured++; |
1822 |
+ } |
1823 |
+@@ -579,42 +584,42 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) |
1824 |
+ struct resource_entry *win; |
1825 |
+ |
1826 |
+ /* setup bus numbers */ |
1827 |
+- value = csr_readl(pcie, PCI_PRIMARY_BUS); |
1828 |
++ value = mobiveil_csr_readl(pcie, PCI_PRIMARY_BUS); |
1829 |
+ value &= 0xff000000; |
1830 |
+ value |= 0x00ff0100; |
1831 |
+- csr_writel(pcie, value, PCI_PRIMARY_BUS); |
1832 |
++ mobiveil_csr_writel(pcie, value, PCI_PRIMARY_BUS); |
1833 |
+ |
1834 |
+ /* |
1835 |
+ * program Bus Master Enable Bit in Command Register in PAB Config |
1836 |
+ * Space |
1837 |
+ */ |
1838 |
+- value = csr_readl(pcie, PCI_COMMAND); |
1839 |
++ value = mobiveil_csr_readl(pcie, PCI_COMMAND); |
1840 |
+ value |= PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; |
1841 |
+- csr_writel(pcie, value, PCI_COMMAND); |
1842 |
++ mobiveil_csr_writel(pcie, value, PCI_COMMAND); |
1843 |
+ |
1844 |
+ /* |
1845 |
+ * program PIO Enable Bit to 1 (and PEX PIO Enable to 1) in PAB_CTRL |
1846 |
+ * register |
1847 |
+ */ |
1848 |
+- pab_ctrl = csr_readl(pcie, PAB_CTRL); |
1849 |
++ pab_ctrl = mobiveil_csr_readl(pcie, PAB_CTRL); |
1850 |
+ pab_ctrl |= (1 << AMBA_PIO_ENABLE_SHIFT) | (1 << PEX_PIO_ENABLE_SHIFT); |
1851 |
+- csr_writel(pcie, pab_ctrl, PAB_CTRL); |
1852 |
++ mobiveil_csr_writel(pcie, pab_ctrl, PAB_CTRL); |
1853 |
+ |
1854 |
+- csr_writel(pcie, (PAB_INTP_INTX_MASK | PAB_INTP_MSI_MASK), |
1855 |
+- PAB_INTP_AMBA_MISC_ENB); |
1856 |
++ mobiveil_csr_writel(pcie, (PAB_INTP_INTX_MASK | PAB_INTP_MSI_MASK), |
1857 |
++ PAB_INTP_AMBA_MISC_ENB); |
1858 |
+ |
1859 |
+ /* |
1860 |
+ * program PIO Enable Bit to 1 and Config Window Enable Bit to 1 in |
1861 |
+ * PAB_AXI_PIO_CTRL Register |
1862 |
+ */ |
1863 |
+- value = csr_readl(pcie, PAB_AXI_PIO_CTRL); |
1864 |
++ value = mobiveil_csr_readl(pcie, PAB_AXI_PIO_CTRL); |
1865 |
+ value |= APIO_EN_MASK; |
1866 |
+- csr_writel(pcie, value, PAB_AXI_PIO_CTRL); |
1867 |
++ mobiveil_csr_writel(pcie, value, PAB_AXI_PIO_CTRL); |
1868 |
+ |
1869 |
+ /* Enable PCIe PIO master */ |
1870 |
+- value = csr_readl(pcie, PAB_PEX_PIO_CTRL); |
1871 |
++ value = mobiveil_csr_readl(pcie, PAB_PEX_PIO_CTRL); |
1872 |
+ value |= 1 << PIO_ENABLE_SHIFT; |
1873 |
+- csr_writel(pcie, value, PAB_PEX_PIO_CTRL); |
1874 |
++ mobiveil_csr_writel(pcie, value, PAB_PEX_PIO_CTRL); |
1875 |
+ |
1876 |
+ /* |
1877 |
+ * we'll program one outbound window for config reads and |
1878 |
+@@ -647,10 +652,10 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie) |
1879 |
+ } |
1880 |
+ |
1881 |
+ /* fixup for PCIe class register */ |
1882 |
+- value = csr_readl(pcie, PAB_INTP_AXI_PIO_CLASS); |
1883 |
++ value = mobiveil_csr_readl(pcie, PAB_INTP_AXI_PIO_CLASS); |
1884 |
+ value &= 0xff; |
1885 |
+ value |= (PCI_CLASS_BRIDGE_PCI << 16); |
1886 |
+- csr_writel(pcie, value, PAB_INTP_AXI_PIO_CLASS); |
1887 |
++ mobiveil_csr_writel(pcie, value, PAB_INTP_AXI_PIO_CLASS); |
1888 |
+ |
1889 |
+ /* setup MSI hardware registers */ |
1890 |
+ mobiveil_pcie_enable_msi(pcie); |
1891 |
+@@ -668,9 +673,9 @@ static void mobiveil_mask_intx_irq(struct irq_data *data) |
1892 |
+ pcie = irq_desc_get_chip_data(desc); |
1893 |
+ mask = 1 << ((data->hwirq + PAB_INTX_START) - 1); |
1894 |
+ raw_spin_lock_irqsave(&pcie->intx_mask_lock, flags); |
1895 |
+- shifted_val = csr_readl(pcie, PAB_INTP_AMBA_MISC_ENB); |
1896 |
++ shifted_val = mobiveil_csr_readl(pcie, PAB_INTP_AMBA_MISC_ENB); |
1897 |
+ shifted_val &= ~mask; |
1898 |
+- csr_writel(pcie, shifted_val, PAB_INTP_AMBA_MISC_ENB); |
1899 |
++ mobiveil_csr_writel(pcie, shifted_val, PAB_INTP_AMBA_MISC_ENB); |
1900 |
+ raw_spin_unlock_irqrestore(&pcie->intx_mask_lock, flags); |
1901 |
+ } |
1902 |
+ |
1903 |
+@@ -684,9 +689,9 @@ static void mobiveil_unmask_intx_irq(struct irq_data *data) |
1904 |
+ pcie = irq_desc_get_chip_data(desc); |
1905 |
+ mask = 1 << ((data->hwirq + PAB_INTX_START) - 1); |
1906 |
+ raw_spin_lock_irqsave(&pcie->intx_mask_lock, flags); |
1907 |
+- shifted_val = csr_readl(pcie, PAB_INTP_AMBA_MISC_ENB); |
1908 |
++ shifted_val = mobiveil_csr_readl(pcie, PAB_INTP_AMBA_MISC_ENB); |
1909 |
+ shifted_val |= mask; |
1910 |
+- csr_writel(pcie, shifted_val, PAB_INTP_AMBA_MISC_ENB); |
1911 |
++ mobiveil_csr_writel(pcie, shifted_val, PAB_INTP_AMBA_MISC_ENB); |
1912 |
+ raw_spin_unlock_irqrestore(&pcie->intx_mask_lock, flags); |
1913 |
+ } |
1914 |
+ |
1915 |
+diff --git a/drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c b/drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c |
1916 |
+index 544d64a84cc0..6e457967653e 100644 |
1917 |
+--- a/drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c |
1918 |
++++ b/drivers/phy/lantiq/phy-lantiq-vrx200-pcie.c |
1919 |
+@@ -323,7 +323,8 @@ static int ltq_vrx200_pcie_phy_power_on(struct phy *phy) |
1920 |
+ goto err_disable_pdi_clk; |
1921 |
+ |
1922 |
+ /* Check if we are in "startup ready" status */ |
1923 |
+- if (ltq_vrx200_pcie_phy_wait_for_pll(phy) != 0) |
1924 |
++ ret = ltq_vrx200_pcie_phy_wait_for_pll(phy); |
1925 |
++ if (ret) |
1926 |
+ goto err_disable_phy_clk; |
1927 |
+ |
1928 |
+ ltq_vrx200_pcie_phy_apply_workarounds(phy); |
1929 |
+diff --git a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c |
1930 |
+index 2b97fb1185a0..9ca20c947283 100644 |
1931 |
+--- a/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c |
1932 |
++++ b/drivers/phy/rockchip/phy-rockchip-inno-hdmi.c |
1933 |
+@@ -603,6 +603,8 @@ static long inno_hdmi_phy_rk3228_clk_round_rate(struct clk_hw *hw, |
1934 |
+ { |
1935 |
+ const struct pre_pll_config *cfg = pre_pll_cfg_table; |
1936 |
+ |
1937 |
++ rate = (rate / 1000) * 1000; |
1938 |
++ |
1939 |
+ for (; cfg->pixclock != 0; cfg++) |
1940 |
+ if (cfg->pixclock == rate && !cfg->fracdiv) |
1941 |
+ break; |
1942 |
+@@ -755,6 +757,8 @@ static long inno_hdmi_phy_rk3328_clk_round_rate(struct clk_hw *hw, |
1943 |
+ { |
1944 |
+ const struct pre_pll_config *cfg = pre_pll_cfg_table; |
1945 |
+ |
1946 |
++ rate = (rate / 1000) * 1000; |
1947 |
++ |
1948 |
+ for (; cfg->pixclock != 0; cfg++) |
1949 |
+ if (cfg->pixclock == rate) |
1950 |
+ break; |
1951 |
+diff --git a/drivers/phy/ti/phy-gmii-sel.c b/drivers/phy/ti/phy-gmii-sel.c |
1952 |
+index a52c5bb35033..a28bd15297f5 100644 |
1953 |
+--- a/drivers/phy/ti/phy-gmii-sel.c |
1954 |
++++ b/drivers/phy/ti/phy-gmii-sel.c |
1955 |
+@@ -69,11 +69,11 @@ static int phy_gmii_sel_mode(struct phy *phy, enum phy_mode mode, int submode) |
1956 |
+ break; |
1957 |
+ |
1958 |
+ case PHY_INTERFACE_MODE_RGMII: |
1959 |
++ case PHY_INTERFACE_MODE_RGMII_RXID: |
1960 |
+ gmii_sel_mode = AM33XX_GMII_SEL_MODE_RGMII; |
1961 |
+ break; |
1962 |
+ |
1963 |
+ case PHY_INTERFACE_MODE_RGMII_ID: |
1964 |
+- case PHY_INTERFACE_MODE_RGMII_RXID: |
1965 |
+ case PHY_INTERFACE_MODE_RGMII_TXID: |
1966 |
+ gmii_sel_mode = AM33XX_GMII_SEL_MODE_RGMII; |
1967 |
+ rgmii_id = 1; |
1968 |
+diff --git a/drivers/platform/chrome/wilco_ec/telemetry.c b/drivers/platform/chrome/wilco_ec/telemetry.c |
1969 |
+index b9d03c33d8dc..1176d543191a 100644 |
1970 |
+--- a/drivers/platform/chrome/wilco_ec/telemetry.c |
1971 |
++++ b/drivers/platform/chrome/wilco_ec/telemetry.c |
1972 |
+@@ -406,8 +406,8 @@ static int telem_device_remove(struct platform_device *pdev) |
1973 |
+ struct telem_device_data *dev_data = platform_get_drvdata(pdev); |
1974 |
+ |
1975 |
+ cdev_device_del(&dev_data->cdev, &dev_data->dev); |
1976 |
+- put_device(&dev_data->dev); |
1977 |
+ ida_simple_remove(&telem_ida, MINOR(dev_data->dev.devt)); |
1978 |
++ put_device(&dev_data->dev); |
1979 |
+ |
1980 |
+ return 0; |
1981 |
+ } |
1982 |
+diff --git a/drivers/power/supply/bd70528-charger.c b/drivers/power/supply/bd70528-charger.c |
1983 |
+index 1bb32b7226d7..b8e1ec106627 100644 |
1984 |
+--- a/drivers/power/supply/bd70528-charger.c |
1985 |
++++ b/drivers/power/supply/bd70528-charger.c |
1986 |
+@@ -741,3 +741,4 @@ module_platform_driver(bd70528_power); |
1987 |
+ MODULE_AUTHOR("Matti Vaittinen <matti.vaittinen@×××××××××××××.com>"); |
1988 |
+ MODULE_DESCRIPTION("BD70528 power-supply driver"); |
1989 |
+ MODULE_LICENSE("GPL"); |
1990 |
++MODULE_ALIAS("platform:bd70528-power"); |
1991 |
+diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c |
1992 |
+index 6f5840a1a82d..05273725a9ff 100644 |
1993 |
+--- a/drivers/pwm/pwm-sun4i.c |
1994 |
++++ b/drivers/pwm/pwm-sun4i.c |
1995 |
+@@ -137,10 +137,10 @@ static void sun4i_pwm_get_state(struct pwm_chip *chip, |
1996 |
+ |
1997 |
+ val = sun4i_pwm_readl(sun4i_pwm, PWM_CH_PRD(pwm->hwpwm)); |
1998 |
+ |
1999 |
+- tmp = prescaler * NSEC_PER_SEC * PWM_REG_DTY(val); |
2000 |
++ tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_DTY(val); |
2001 |
+ state->duty_cycle = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); |
2002 |
+ |
2003 |
+- tmp = prescaler * NSEC_PER_SEC * PWM_REG_PRD(val); |
2004 |
++ tmp = (u64)prescaler * NSEC_PER_SEC * PWM_REG_PRD(val); |
2005 |
+ state->period = DIV_ROUND_CLOSEST_ULL(tmp, clk_rate); |
2006 |
+ } |
2007 |
+ |
2008 |
+diff --git a/drivers/regulator/bd70528-regulator.c b/drivers/regulator/bd70528-regulator.c |
2009 |
+index 6041839ec38c..5bf8a2dc5fe7 100644 |
2010 |
+--- a/drivers/regulator/bd70528-regulator.c |
2011 |
++++ b/drivers/regulator/bd70528-regulator.c |
2012 |
+@@ -285,3 +285,4 @@ module_platform_driver(bd70528_regulator); |
2013 |
+ MODULE_AUTHOR("Matti Vaittinen <matti.vaittinen@×××××××××××××.com>"); |
2014 |
+ MODULE_DESCRIPTION("BD70528 voltage regulator driver"); |
2015 |
+ MODULE_LICENSE("GPL"); |
2016 |
++MODULE_ALIAS("platform:bd70528-pmic"); |
2017 |
+diff --git a/drivers/rtc/rtc-bd70528.c b/drivers/rtc/rtc-bd70528.c |
2018 |
+index ddfef4d43bab..627037aa66a8 100644 |
2019 |
+--- a/drivers/rtc/rtc-bd70528.c |
2020 |
++++ b/drivers/rtc/rtc-bd70528.c |
2021 |
+@@ -491,4 +491,4 @@ module_platform_driver(bd70528_rtc); |
2022 |
+ MODULE_AUTHOR("Matti Vaittinen <matti.vaittinen@×××××××××××××.com>"); |
2023 |
+ MODULE_DESCRIPTION("BD70528 RTC driver"); |
2024 |
+ MODULE_LICENSE("GPL"); |
2025 |
+-MODULE_ALIAS("platofrm:bd70528-rtc"); |
2026 |
++MODULE_ALIAS("platform:bd70528-rtc"); |
2027 |
+diff --git a/drivers/s390/crypto/pkey_api.c b/drivers/s390/crypto/pkey_api.c |
2028 |
+index 9de3d46b3253..e17fac20127e 100644 |
2029 |
+--- a/drivers/s390/crypto/pkey_api.c |
2030 |
++++ b/drivers/s390/crypto/pkey_api.c |
2031 |
+@@ -740,8 +740,10 @@ static void *_copy_apqns_from_user(void __user *uapqns, size_t nr_apqns) |
2032 |
+ kapqns = kmalloc(nbytes, GFP_KERNEL); |
2033 |
+ if (!kapqns) |
2034 |
+ return ERR_PTR(-ENOMEM); |
2035 |
+- if (copy_from_user(kapqns, uapqns, nbytes)) |
2036 |
++ if (copy_from_user(kapqns, uapqns, nbytes)) { |
2037 |
++ kfree(kapqns); |
2038 |
+ return ERR_PTR(-EFAULT); |
2039 |
++ } |
2040 |
+ } |
2041 |
+ |
2042 |
+ return kapqns; |
2043 |
+diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h |
2044 |
+index 65e31df37b1f..820f2c29376c 100644 |
2045 |
+--- a/drivers/s390/net/qeth_core.h |
2046 |
++++ b/drivers/s390/net/qeth_core.h |
2047 |
+@@ -620,6 +620,7 @@ struct qeth_ipato { |
2048 |
+ |
2049 |
+ struct qeth_channel { |
2050 |
+ struct ccw_device *ccwdev; |
2051 |
++ struct qeth_cmd_buffer *active_cmd; |
2052 |
+ enum qeth_channel_states state; |
2053 |
+ atomic_t irq_pending; |
2054 |
+ }; |
2055 |
+@@ -1024,6 +1025,8 @@ int qeth_do_run_thread(struct qeth_card *, unsigned long); |
2056 |
+ void qeth_clear_thread_start_bit(struct qeth_card *, unsigned long); |
2057 |
+ void qeth_clear_thread_running_bit(struct qeth_card *, unsigned long); |
2058 |
+ int qeth_core_hardsetup_card(struct qeth_card *card, bool *carrier_ok); |
2059 |
++int qeth_stop_channel(struct qeth_channel *channel); |
2060 |
++ |
2061 |
+ void qeth_print_status_message(struct qeth_card *); |
2062 |
+ int qeth_init_qdio_queues(struct qeth_card *); |
2063 |
+ int qeth_send_ipa_cmd(struct qeth_card *, struct qeth_cmd_buffer *, |
2064 |
+diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c |
2065 |
+index 5be4d800e4ba..23852888eb2c 100644 |
2066 |
+--- a/drivers/s390/net/qeth_core_main.c |
2067 |
++++ b/drivers/s390/net/qeth_core_main.c |
2068 |
+@@ -515,7 +515,9 @@ static int __qeth_issue_next_read(struct qeth_card *card) |
2069 |
+ |
2070 |
+ QETH_CARD_TEXT(card, 6, "noirqpnd"); |
2071 |
+ rc = ccw_device_start(channel->ccwdev, ccw, (addr_t) iob, 0, 0); |
2072 |
+- if (rc) { |
2073 |
++ if (!rc) { |
2074 |
++ channel->active_cmd = iob; |
2075 |
++ } else { |
2076 |
+ QETH_DBF_MESSAGE(2, "error %i on device %x when starting next read ccw!\n", |
2077 |
+ rc, CARD_DEVID(card)); |
2078 |
+ atomic_set(&channel->irq_pending, 0); |
2079 |
+@@ -986,8 +988,21 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, |
2080 |
+ QETH_CARD_TEXT(card, 5, "data"); |
2081 |
+ } |
2082 |
+ |
2083 |
+- if (qeth_intparm_is_iob(intparm)) |
2084 |
+- iob = (struct qeth_cmd_buffer *) __va((addr_t)intparm); |
2085 |
++ if (intparm == 0) { |
2086 |
++ QETH_CARD_TEXT(card, 5, "irqunsol"); |
2087 |
++ } else if ((addr_t)intparm != (addr_t)channel->active_cmd) { |
2088 |
++ QETH_CARD_TEXT(card, 5, "irqunexp"); |
2089 |
++ |
2090 |
++ dev_err(&cdev->dev, |
2091 |
++ "Received IRQ with intparm %lx, expected %px\n", |
2092 |
++ intparm, channel->active_cmd); |
2093 |
++ if (channel->active_cmd) |
2094 |
++ qeth_cancel_cmd(channel->active_cmd, -EIO); |
2095 |
++ } else { |
2096 |
++ iob = (struct qeth_cmd_buffer *) (addr_t)intparm; |
2097 |
++ } |
2098 |
++ |
2099 |
++ channel->active_cmd = NULL; |
2100 |
+ |
2101 |
+ rc = qeth_check_irb_error(card, cdev, irb); |
2102 |
+ if (rc) { |
2103 |
+@@ -1007,15 +1022,10 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, |
2104 |
+ if (irb->scsw.cmd.fctl & (SCSW_FCTL_HALT_FUNC)) |
2105 |
+ channel->state = CH_STATE_HALTED; |
2106 |
+ |
2107 |
+- if (intparm == QETH_CLEAR_CHANNEL_PARM) { |
2108 |
+- QETH_CARD_TEXT(card, 6, "clrchpar"); |
2109 |
+- /* we don't have to handle this further */ |
2110 |
+- intparm = 0; |
2111 |
+- } |
2112 |
+- if (intparm == QETH_HALT_CHANNEL_PARM) { |
2113 |
+- QETH_CARD_TEXT(card, 6, "hltchpar"); |
2114 |
+- /* we don't have to handle this further */ |
2115 |
+- intparm = 0; |
2116 |
++ if (iob && (irb->scsw.cmd.fctl & (SCSW_FCTL_CLEAR_FUNC | |
2117 |
++ SCSW_FCTL_HALT_FUNC))) { |
2118 |
++ qeth_cancel_cmd(iob, -ECANCELED); |
2119 |
++ iob = NULL; |
2120 |
+ } |
2121 |
+ |
2122 |
+ cstat = irb->scsw.cmd.cstat; |
2123 |
+@@ -1408,7 +1418,7 @@ static int qeth_clear_channel(struct qeth_card *card, |
2124 |
+ |
2125 |
+ QETH_CARD_TEXT(card, 3, "clearch"); |
2126 |
+ spin_lock_irq(get_ccwdev_lock(channel->ccwdev)); |
2127 |
+- rc = ccw_device_clear(channel->ccwdev, QETH_CLEAR_CHANNEL_PARM); |
2128 |
++ rc = ccw_device_clear(channel->ccwdev, (addr_t)channel->active_cmd); |
2129 |
+ spin_unlock_irq(get_ccwdev_lock(channel->ccwdev)); |
2130 |
+ |
2131 |
+ if (rc) |
2132 |
+@@ -1430,7 +1440,7 @@ static int qeth_halt_channel(struct qeth_card *card, |
2133 |
+ |
2134 |
+ QETH_CARD_TEXT(card, 3, "haltch"); |
2135 |
+ spin_lock_irq(get_ccwdev_lock(channel->ccwdev)); |
2136 |
+- rc = ccw_device_halt(channel->ccwdev, QETH_HALT_CHANNEL_PARM); |
2137 |
++ rc = ccw_device_halt(channel->ccwdev, (addr_t)channel->active_cmd); |
2138 |
+ spin_unlock_irq(get_ccwdev_lock(channel->ccwdev)); |
2139 |
+ |
2140 |
+ if (rc) |
2141 |
+@@ -1444,6 +1454,25 @@ static int qeth_halt_channel(struct qeth_card *card, |
2142 |
+ return 0; |
2143 |
+ } |
2144 |
+ |
2145 |
++int qeth_stop_channel(struct qeth_channel *channel) |
2146 |
++{ |
2147 |
++ struct ccw_device *cdev = channel->ccwdev; |
2148 |
++ int rc; |
2149 |
++ |
2150 |
++ rc = ccw_device_set_offline(cdev); |
2151 |
++ |
2152 |
++ spin_lock_irq(get_ccwdev_lock(cdev)); |
2153 |
++ if (channel->active_cmd) { |
2154 |
++ dev_err(&cdev->dev, "Stopped channel while cmd %px was still active\n", |
2155 |
++ channel->active_cmd); |
2156 |
++ channel->active_cmd = NULL; |
2157 |
++ } |
2158 |
++ spin_unlock_irq(get_ccwdev_lock(cdev)); |
2159 |
++ |
2160 |
++ return rc; |
2161 |
++} |
2162 |
++EXPORT_SYMBOL_GPL(qeth_stop_channel); |
2163 |
++ |
2164 |
+ static int qeth_halt_channels(struct qeth_card *card) |
2165 |
+ { |
2166 |
+ int rc1 = 0, rc2 = 0, rc3 = 0; |
2167 |
+@@ -1747,6 +1776,8 @@ static int qeth_send_control_data(struct qeth_card *card, |
2168 |
+ spin_lock_irq(get_ccwdev_lock(channel->ccwdev)); |
2169 |
+ rc = ccw_device_start_timeout(channel->ccwdev, __ccw_from_cmd(iob), |
2170 |
+ (addr_t) iob, 0, 0, timeout); |
2171 |
++ if (!rc) |
2172 |
++ channel->active_cmd = iob; |
2173 |
+ spin_unlock_irq(get_ccwdev_lock(channel->ccwdev)); |
2174 |
+ if (rc) { |
2175 |
+ QETH_DBF_MESSAGE(2, "qeth_send_control_data on device %x: ccw_device_start rc = %i\n", |
2176 |
+@@ -4625,12 +4656,12 @@ EXPORT_SYMBOL_GPL(qeth_vm_request_mac); |
2177 |
+ |
2178 |
+ static void qeth_determine_capabilities(struct qeth_card *card) |
2179 |
+ { |
2180 |
++ struct qeth_channel *channel = &card->data; |
2181 |
++ struct ccw_device *ddev = channel->ccwdev; |
2182 |
+ int rc; |
2183 |
+- struct ccw_device *ddev; |
2184 |
+ int ddev_offline = 0; |
2185 |
+ |
2186 |
+ QETH_CARD_TEXT(card, 2, "detcapab"); |
2187 |
+- ddev = CARD_DDEV(card); |
2188 |
+ if (!ddev->online) { |
2189 |
+ ddev_offline = 1; |
2190 |
+ rc = ccw_device_set_online(ddev); |
2191 |
+@@ -4669,7 +4700,7 @@ static void qeth_determine_capabilities(struct qeth_card *card) |
2192 |
+ |
2193 |
+ out_offline: |
2194 |
+ if (ddev_offline == 1) |
2195 |
+- ccw_device_set_offline(ddev); |
2196 |
++ qeth_stop_channel(channel); |
2197 |
+ out: |
2198 |
+ return; |
2199 |
+ } |
2200 |
+@@ -4870,9 +4901,9 @@ retry: |
2201 |
+ QETH_DBF_MESSAGE(2, "Retrying to do IDX activates on device %x.\n", |
2202 |
+ CARD_DEVID(card)); |
2203 |
+ rc = qeth_qdio_clear_card(card, !IS_IQD(card)); |
2204 |
+- ccw_device_set_offline(CARD_DDEV(card)); |
2205 |
+- ccw_device_set_offline(CARD_WDEV(card)); |
2206 |
+- ccw_device_set_offline(CARD_RDEV(card)); |
2207 |
++ qeth_stop_channel(&card->data); |
2208 |
++ qeth_stop_channel(&card->write); |
2209 |
++ qeth_stop_channel(&card->read); |
2210 |
+ qdio_free(CARD_DDEV(card)); |
2211 |
+ rc = ccw_device_set_online(CARD_RDEV(card)); |
2212 |
+ if (rc) |
2213 |
+diff --git a/drivers/s390/net/qeth_core_mpc.h b/drivers/s390/net/qeth_core_mpc.h |
2214 |
+index b7c17b5c823b..65038539b324 100644 |
2215 |
+--- a/drivers/s390/net/qeth_core_mpc.h |
2216 |
++++ b/drivers/s390/net/qeth_core_mpc.h |
2217 |
+@@ -28,20 +28,6 @@ extern unsigned char IPA_PDU_HEADER[]; |
2218 |
+ #define QETH_TIMEOUT (10 * HZ) |
2219 |
+ #define QETH_IPA_TIMEOUT (45 * HZ) |
2220 |
+ |
2221 |
+-#define QETH_CLEAR_CHANNEL_PARM -10 |
2222 |
+-#define QETH_HALT_CHANNEL_PARM -11 |
2223 |
+- |
2224 |
+-static inline bool qeth_intparm_is_iob(unsigned long intparm) |
2225 |
+-{ |
2226 |
+- switch (intparm) { |
2227 |
+- case QETH_CLEAR_CHANNEL_PARM: |
2228 |
+- case QETH_HALT_CHANNEL_PARM: |
2229 |
+- case 0: |
2230 |
+- return false; |
2231 |
+- } |
2232 |
+- return true; |
2233 |
+-} |
2234 |
+- |
2235 |
+ /*****************************************************************************/ |
2236 |
+ /* IP Assist related definitions */ |
2237 |
+ /*****************************************************************************/ |
2238 |
+diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c |
2239 |
+index 11e3292c0adf..59e220749ad1 100644 |
2240 |
+--- a/drivers/s390/net/qeth_l2_main.c |
2241 |
++++ b/drivers/s390/net/qeth_l2_main.c |
2242 |
+@@ -877,9 +877,9 @@ static int qeth_l2_set_online(struct ccwgroup_device *gdev) |
2243 |
+ |
2244 |
+ out_remove: |
2245 |
+ qeth_l2_stop_card(card); |
2246 |
+- ccw_device_set_offline(CARD_DDEV(card)); |
2247 |
+- ccw_device_set_offline(CARD_WDEV(card)); |
2248 |
+- ccw_device_set_offline(CARD_RDEV(card)); |
2249 |
++ qeth_stop_channel(&card->data); |
2250 |
++ qeth_stop_channel(&card->write); |
2251 |
++ qeth_stop_channel(&card->read); |
2252 |
+ qdio_free(CARD_DDEV(card)); |
2253 |
+ |
2254 |
+ mutex_unlock(&card->conf_mutex); |
2255 |
+@@ -910,9 +910,9 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev, |
2256 |
+ rtnl_unlock(); |
2257 |
+ |
2258 |
+ qeth_l2_stop_card(card); |
2259 |
+- rc = ccw_device_set_offline(CARD_DDEV(card)); |
2260 |
+- rc2 = ccw_device_set_offline(CARD_WDEV(card)); |
2261 |
+- rc3 = ccw_device_set_offline(CARD_RDEV(card)); |
2262 |
++ rc = qeth_stop_channel(&card->data); |
2263 |
++ rc2 = qeth_stop_channel(&card->write); |
2264 |
++ rc3 = qeth_stop_channel(&card->read); |
2265 |
+ if (!rc) |
2266 |
+ rc = (rc2) ? rc2 : rc3; |
2267 |
+ if (rc) |
2268 |
+diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c |
2269 |
+index 5152970a9aa4..a1c23e998f97 100644 |
2270 |
+--- a/drivers/s390/net/qeth_l3_main.c |
2271 |
++++ b/drivers/s390/net/qeth_l3_main.c |
2272 |
+@@ -2383,9 +2383,9 @@ static int qeth_l3_set_online(struct ccwgroup_device *gdev) |
2273 |
+ return 0; |
2274 |
+ out_remove: |
2275 |
+ qeth_l3_stop_card(card); |
2276 |
+- ccw_device_set_offline(CARD_DDEV(card)); |
2277 |
+- ccw_device_set_offline(CARD_WDEV(card)); |
2278 |
+- ccw_device_set_offline(CARD_RDEV(card)); |
2279 |
++ qeth_stop_channel(&card->data); |
2280 |
++ qeth_stop_channel(&card->write); |
2281 |
++ qeth_stop_channel(&card->read); |
2282 |
+ qdio_free(CARD_DDEV(card)); |
2283 |
+ |
2284 |
+ mutex_unlock(&card->conf_mutex); |
2285 |
+@@ -2421,9 +2421,10 @@ static int __qeth_l3_set_offline(struct ccwgroup_device *cgdev, |
2286 |
+ call_netdevice_notifiers(NETDEV_REBOOT, card->dev); |
2287 |
+ rtnl_unlock(); |
2288 |
+ } |
2289 |
+- rc = ccw_device_set_offline(CARD_DDEV(card)); |
2290 |
+- rc2 = ccw_device_set_offline(CARD_WDEV(card)); |
2291 |
+- rc3 = ccw_device_set_offline(CARD_RDEV(card)); |
2292 |
++ |
2293 |
++ rc = qeth_stop_channel(&card->data); |
2294 |
++ rc2 = qeth_stop_channel(&card->write); |
2295 |
++ rc3 = qeth_stop_channel(&card->read); |
2296 |
+ if (!rc) |
2297 |
+ rc = (rc2) ? rc2 : rc3; |
2298 |
+ if (rc) |
2299 |
+diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c |
2300 |
+index 25a6a25b17a2..1e38bb967871 100644 |
2301 |
+--- a/drivers/scsi/ufs/ufshcd.c |
2302 |
++++ b/drivers/scsi/ufs/ufshcd.c |
2303 |
+@@ -6779,23 +6779,13 @@ static void ufshcd_init_desc_sizes(struct ufs_hba *hba) |
2304 |
+ &hba->desc_size.geom_desc); |
2305 |
+ if (err) |
2306 |
+ hba->desc_size.geom_desc = QUERY_DESC_GEOMETRY_DEF_SIZE; |
2307 |
++ |
2308 |
+ err = ufshcd_read_desc_length(hba, QUERY_DESC_IDN_HEALTH, 0, |
2309 |
+ &hba->desc_size.hlth_desc); |
2310 |
+ if (err) |
2311 |
+ hba->desc_size.hlth_desc = QUERY_DESC_HEALTH_DEF_SIZE; |
2312 |
+ } |
2313 |
+ |
2314 |
+-static void ufshcd_def_desc_sizes(struct ufs_hba *hba) |
2315 |
+-{ |
2316 |
+- hba->desc_size.dev_desc = QUERY_DESC_DEVICE_DEF_SIZE; |
2317 |
+- hba->desc_size.pwr_desc = QUERY_DESC_POWER_DEF_SIZE; |
2318 |
+- hba->desc_size.interc_desc = QUERY_DESC_INTERCONNECT_DEF_SIZE; |
2319 |
+- hba->desc_size.conf_desc = QUERY_DESC_CONFIGURATION_DEF_SIZE; |
2320 |
+- hba->desc_size.unit_desc = QUERY_DESC_UNIT_DEF_SIZE; |
2321 |
+- hba->desc_size.geom_desc = QUERY_DESC_GEOMETRY_DEF_SIZE; |
2322 |
+- hba->desc_size.hlth_desc = QUERY_DESC_HEALTH_DEF_SIZE; |
2323 |
+-} |
2324 |
+- |
2325 |
+ static struct ufs_ref_clk ufs_ref_clk_freqs[] = { |
2326 |
+ {19200000, REF_CLK_FREQ_19_2_MHZ}, |
2327 |
+ {26000000, REF_CLK_FREQ_26_MHZ}, |
2328 |
+@@ -8283,9 +8273,6 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) |
2329 |
+ hba->mmio_base = mmio_base; |
2330 |
+ hba->irq = irq; |
2331 |
+ |
2332 |
+- /* Set descriptor lengths to specification defaults */ |
2333 |
+- ufshcd_def_desc_sizes(hba); |
2334 |
+- |
2335 |
+ err = ufshcd_hba_init(hba); |
2336 |
+ if (err) |
2337 |
+ goto out_error; |
2338 |
+diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c |
2339 |
+index 48f7ac238861..f3d8d53ab84d 100644 |
2340 |
+--- a/drivers/soc/aspeed/aspeed-lpc-snoop.c |
2341 |
++++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c |
2342 |
+@@ -97,13 +97,13 @@ static ssize_t snoop_file_read(struct file *file, char __user *buffer, |
2343 |
+ return ret ? ret : copied; |
2344 |
+ } |
2345 |
+ |
2346 |
+-static unsigned int snoop_file_poll(struct file *file, |
2347 |
++static __poll_t snoop_file_poll(struct file *file, |
2348 |
+ struct poll_table_struct *pt) |
2349 |
+ { |
2350 |
+ struct aspeed_lpc_snoop_channel *chan = snoop_file_to_chan(file); |
2351 |
+ |
2352 |
+ poll_wait(file, &chan->wq, pt); |
2353 |
+- return !kfifo_is_empty(&chan->fifo) ? POLLIN : 0; |
2354 |
++ return !kfifo_is_empty(&chan->fifo) ? EPOLLIN : 0; |
2355 |
+ } |
2356 |
+ |
2357 |
+ static const struct file_operations snoop_fops = { |
2358 |
+diff --git a/drivers/soc/qcom/llcc-slice.c b/drivers/soc/qcom/llcc-slice.c |
2359 |
+index 9090ea12eaf3..4a6111635f82 100644 |
2360 |
+--- a/drivers/soc/qcom/llcc-slice.c |
2361 |
++++ b/drivers/soc/qcom/llcc-slice.c |
2362 |
+@@ -48,7 +48,7 @@ |
2363 |
+ |
2364 |
+ static struct llcc_drv_data *drv_data = (void *) -EPROBE_DEFER; |
2365 |
+ |
2366 |
+-static const struct regmap_config llcc_regmap_config = { |
2367 |
++static struct regmap_config llcc_regmap_config = { |
2368 |
+ .reg_bits = 32, |
2369 |
+ .reg_stride = 4, |
2370 |
+ .val_bits = 32, |
2371 |
+@@ -323,6 +323,7 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, |
2372 |
+ if (IS_ERR(base)) |
2373 |
+ return ERR_CAST(base); |
2374 |
+ |
2375 |
++ llcc_regmap_config.name = name; |
2376 |
+ return devm_regmap_init_mmio(&pdev->dev, base, &llcc_regmap_config); |
2377 |
+ } |
2378 |
+ |
2379 |
+diff --git a/drivers/soc/renesas/renesas-soc.c b/drivers/soc/renesas/renesas-soc.c |
2380 |
+index 3299cf5365f3..6651755e9f20 100644 |
2381 |
+--- a/drivers/soc/renesas/renesas-soc.c |
2382 |
++++ b/drivers/soc/renesas/renesas-soc.c |
2383 |
+@@ -326,7 +326,7 @@ static int __init renesas_soc_init(void) |
2384 |
+ if (np) { |
2385 |
+ chipid = of_iomap(np, 0); |
2386 |
+ of_node_put(np); |
2387 |
+- } else if (soc->id) { |
2388 |
++ } else if (soc->id && family->reg) { |
2389 |
+ chipid = ioremap(family->reg, 4); |
2390 |
+ } |
2391 |
+ if (chipid) { |
2392 |
+diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c |
2393 |
+index 9f9c1c677cf4..0447afa970f5 100644 |
2394 |
+--- a/drivers/soc/tegra/pmc.c |
2395 |
++++ b/drivers/soc/tegra/pmc.c |
2396 |
+@@ -1899,6 +1899,20 @@ static int tegra_pmc_irq_alloc(struct irq_domain *domain, unsigned int virq, |
2397 |
+ event->id, |
2398 |
+ &pmc->irq, pmc); |
2399 |
+ |
2400 |
++ /* |
2401 |
++ * GPIOs don't have an equivalent interrupt in the |
2402 |
++ * parent controller (GIC). However some code, such |
2403 |
++ * as the one in irq_get_irqchip_state(), require a |
2404 |
++ * valid IRQ chip to be set. Make sure that's the |
2405 |
++ * case by passing NULL here, which will install a |
2406 |
++ * dummy IRQ chip for the interrupt in the parent |
2407 |
++ * domain. |
2408 |
++ */ |
2409 |
++ if (domain->parent) |
2410 |
++ irq_domain_set_hwirq_and_chip(domain->parent, |
2411 |
++ virq, 0, NULL, |
2412 |
++ NULL); |
2413 |
++ |
2414 |
+ break; |
2415 |
+ } |
2416 |
+ } |
2417 |
+@@ -1908,10 +1922,22 @@ static int tegra_pmc_irq_alloc(struct irq_domain *domain, unsigned int virq, |
2418 |
+ * dummy hardware IRQ number. This is used in the ->irq_set_type() |
2419 |
+ * and ->irq_set_wake() callbacks to return early for these IRQs. |
2420 |
+ */ |
2421 |
+- if (i == soc->num_wake_events) |
2422 |
++ if (i == soc->num_wake_events) { |
2423 |
+ err = irq_domain_set_hwirq_and_chip(domain, virq, ULONG_MAX, |
2424 |
+ &pmc->irq, pmc); |
2425 |
+ |
2426 |
++ /* |
2427 |
++ * Interrupts without a wake event don't have a corresponding |
2428 |
++ * interrupt in the parent controller (GIC). Pass NULL for the |
2429 |
++ * chip here, which causes a dummy IRQ chip to be installed |
2430 |
++ * for the interrupt in the parent domain, to make this |
2431 |
++ * explicit. |
2432 |
++ */ |
2433 |
++ if (domain->parent) |
2434 |
++ irq_domain_set_hwirq_and_chip(domain->parent, virq, 0, |
2435 |
++ NULL, NULL); |
2436 |
++ } |
2437 |
++ |
2438 |
+ return err; |
2439 |
+ } |
2440 |
+ |
2441 |
+diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c |
2442 |
+index 13b0269a0abc..cf2367ba08d6 100644 |
2443 |
+--- a/drivers/tee/optee/call.c |
2444 |
++++ b/drivers/tee/optee/call.c |
2445 |
+@@ -554,6 +554,13 @@ static int check_mem_type(unsigned long start, size_t num_pages) |
2446 |
+ struct mm_struct *mm = current->mm; |
2447 |
+ int rc; |
2448 |
+ |
2449 |
++ /* |
2450 |
++ * Allow kernel address to register with OP-TEE as kernel |
2451 |
++ * pages are configured as normal memory only. |
2452 |
++ */ |
2453 |
++ if (virt_addr_valid(start)) |
2454 |
++ return 0; |
2455 |
++ |
2456 |
+ down_read(&mm->mmap_sem); |
2457 |
+ rc = __check_mem_type(find_vma(mm, start), |
2458 |
+ start + num_pages * PAGE_SIZE); |
2459 |
+diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c |
2460 |
+index 1854a3db7345..b830e0a87fba 100644 |
2461 |
+--- a/drivers/tee/optee/core.c |
2462 |
++++ b/drivers/tee/optee/core.c |
2463 |
+@@ -643,11 +643,6 @@ static struct optee *optee_probe(struct device_node *np) |
2464 |
+ if (optee->sec_caps & OPTEE_SMC_SEC_CAP_DYNAMIC_SHM) |
2465 |
+ pr_info("dynamic shared memory is enabled\n"); |
2466 |
+ |
2467 |
+- rc = optee_enumerate_devices(); |
2468 |
+- if (rc) |
2469 |
+- goto err; |
2470 |
+- |
2471 |
+- pr_info("initialized driver\n"); |
2472 |
+ return optee; |
2473 |
+ err: |
2474 |
+ if (optee) { |
2475 |
+@@ -702,9 +697,10 @@ static struct optee *optee_svc; |
2476 |
+ |
2477 |
+ static int __init optee_driver_init(void) |
2478 |
+ { |
2479 |
+- struct device_node *fw_np; |
2480 |
+- struct device_node *np; |
2481 |
+- struct optee *optee; |
2482 |
++ struct device_node *fw_np = NULL; |
2483 |
++ struct device_node *np = NULL; |
2484 |
++ struct optee *optee = NULL; |
2485 |
++ int rc = 0; |
2486 |
+ |
2487 |
+ /* Node is supposed to be below /firmware */ |
2488 |
+ fw_np = of_find_node_by_name(NULL, "firmware"); |
2489 |
+@@ -723,6 +719,14 @@ static int __init optee_driver_init(void) |
2490 |
+ if (IS_ERR(optee)) |
2491 |
+ return PTR_ERR(optee); |
2492 |
+ |
2493 |
++ rc = optee_enumerate_devices(); |
2494 |
++ if (rc) { |
2495 |
++ optee_remove(optee); |
2496 |
++ return rc; |
2497 |
++ } |
2498 |
++ |
2499 |
++ pr_info("initialized driver\n"); |
2500 |
++ |
2501 |
+ optee_svc = optee; |
2502 |
+ |
2503 |
+ return 0; |
2504 |
+diff --git a/drivers/tee/optee/shm_pool.c b/drivers/tee/optee/shm_pool.c |
2505 |
+index de1d9b8fad90..d767eebf30bd 100644 |
2506 |
+--- a/drivers/tee/optee/shm_pool.c |
2507 |
++++ b/drivers/tee/optee/shm_pool.c |
2508 |
+@@ -17,6 +17,7 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, |
2509 |
+ { |
2510 |
+ unsigned int order = get_order(size); |
2511 |
+ struct page *page; |
2512 |
++ int rc = 0; |
2513 |
+ |
2514 |
+ page = alloc_pages(GFP_KERNEL | __GFP_ZERO, order); |
2515 |
+ if (!page) |
2516 |
+@@ -26,12 +27,34 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, |
2517 |
+ shm->paddr = page_to_phys(page); |
2518 |
+ shm->size = PAGE_SIZE << order; |
2519 |
+ |
2520 |
+- return 0; |
2521 |
++ if (shm->flags & TEE_SHM_DMA_BUF) { |
2522 |
++ unsigned int nr_pages = 1 << order, i; |
2523 |
++ struct page **pages; |
2524 |
++ |
2525 |
++ pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL); |
2526 |
++ if (!pages) |
2527 |
++ return -ENOMEM; |
2528 |
++ |
2529 |
++ for (i = 0; i < nr_pages; i++) { |
2530 |
++ pages[i] = page; |
2531 |
++ page++; |
2532 |
++ } |
2533 |
++ |
2534 |
++ shm->flags |= TEE_SHM_REGISTER; |
2535 |
++ rc = optee_shm_register(shm->ctx, shm, pages, nr_pages, |
2536 |
++ (unsigned long)shm->kaddr); |
2537 |
++ kfree(pages); |
2538 |
++ } |
2539 |
++ |
2540 |
++ return rc; |
2541 |
+ } |
2542 |
+ |
2543 |
+ static void pool_op_free(struct tee_shm_pool_mgr *poolm, |
2544 |
+ struct tee_shm *shm) |
2545 |
+ { |
2546 |
++ if (shm->flags & TEE_SHM_DMA_BUF) |
2547 |
++ optee_shm_unregister(shm->ctx, shm); |
2548 |
++ |
2549 |
+ free_pages((unsigned long)shm->kaddr, get_order(shm->size)); |
2550 |
+ shm->kaddr = NULL; |
2551 |
+ } |
2552 |
+diff --git a/drivers/watchdog/sprd_wdt.c b/drivers/watchdog/sprd_wdt.c |
2553 |
+index 0bb17b046140..65cb55f3916f 100644 |
2554 |
+--- a/drivers/watchdog/sprd_wdt.c |
2555 |
++++ b/drivers/watchdog/sprd_wdt.c |
2556 |
+@@ -327,10 +327,9 @@ static int sprd_wdt_probe(struct platform_device *pdev) |
2557 |
+ |
2558 |
+ static int __maybe_unused sprd_wdt_pm_suspend(struct device *dev) |
2559 |
+ { |
2560 |
+- struct watchdog_device *wdd = dev_get_drvdata(dev); |
2561 |
+ struct sprd_wdt *wdt = dev_get_drvdata(dev); |
2562 |
+ |
2563 |
+- if (watchdog_active(wdd)) |
2564 |
++ if (watchdog_active(&wdt->wdd)) |
2565 |
+ sprd_wdt_stop(&wdt->wdd); |
2566 |
+ sprd_wdt_disable(wdt); |
2567 |
+ |
2568 |
+@@ -339,7 +338,6 @@ static int __maybe_unused sprd_wdt_pm_suspend(struct device *dev) |
2569 |
+ |
2570 |
+ static int __maybe_unused sprd_wdt_pm_resume(struct device *dev) |
2571 |
+ { |
2572 |
+- struct watchdog_device *wdd = dev_get_drvdata(dev); |
2573 |
+ struct sprd_wdt *wdt = dev_get_drvdata(dev); |
2574 |
+ int ret; |
2575 |
+ |
2576 |
+@@ -347,7 +345,7 @@ static int __maybe_unused sprd_wdt_pm_resume(struct device *dev) |
2577 |
+ if (ret) |
2578 |
+ return ret; |
2579 |
+ |
2580 |
+- if (watchdog_active(wdd)) { |
2581 |
++ if (watchdog_active(&wdt->wdd)) { |
2582 |
+ ret = sprd_wdt_start(&wdt->wdd); |
2583 |
+ if (ret) { |
2584 |
+ sprd_wdt_disable(wdt); |
2585 |
+diff --git a/fs/afs/dir_edit.c b/fs/afs/dir_edit.c |
2586 |
+index d4fbe5f85f1b..b108528bf010 100644 |
2587 |
+--- a/fs/afs/dir_edit.c |
2588 |
++++ b/fs/afs/dir_edit.c |
2589 |
+@@ -68,13 +68,11 @@ static int afs_find_contig_bits(union afs_xdr_dir_block *block, unsigned int nr_ |
2590 |
+ static void afs_set_contig_bits(union afs_xdr_dir_block *block, |
2591 |
+ int bit, unsigned int nr_slots) |
2592 |
+ { |
2593 |
+- u64 mask, before, after; |
2594 |
++ u64 mask; |
2595 |
+ |
2596 |
+ mask = (1 << nr_slots) - 1; |
2597 |
+ mask <<= bit; |
2598 |
+ |
2599 |
+- before = *(u64 *)block->hdr.bitmap; |
2600 |
+- |
2601 |
+ block->hdr.bitmap[0] |= (u8)(mask >> 0 * 8); |
2602 |
+ block->hdr.bitmap[1] |= (u8)(mask >> 1 * 8); |
2603 |
+ block->hdr.bitmap[2] |= (u8)(mask >> 2 * 8); |
2604 |
+@@ -83,8 +81,6 @@ static void afs_set_contig_bits(union afs_xdr_dir_block *block, |
2605 |
+ block->hdr.bitmap[5] |= (u8)(mask >> 5 * 8); |
2606 |
+ block->hdr.bitmap[6] |= (u8)(mask >> 6 * 8); |
2607 |
+ block->hdr.bitmap[7] |= (u8)(mask >> 7 * 8); |
2608 |
+- |
2609 |
+- after = *(u64 *)block->hdr.bitmap; |
2610 |
+ } |
2611 |
+ |
2612 |
+ /* |
2613 |
+@@ -93,13 +89,11 @@ static void afs_set_contig_bits(union afs_xdr_dir_block *block, |
2614 |
+ static void afs_clear_contig_bits(union afs_xdr_dir_block *block, |
2615 |
+ int bit, unsigned int nr_slots) |
2616 |
+ { |
2617 |
+- u64 mask, before, after; |
2618 |
++ u64 mask; |
2619 |
+ |
2620 |
+ mask = (1 << nr_slots) - 1; |
2621 |
+ mask <<= bit; |
2622 |
+ |
2623 |
+- before = *(u64 *)block->hdr.bitmap; |
2624 |
+- |
2625 |
+ block->hdr.bitmap[0] &= ~(u8)(mask >> 0 * 8); |
2626 |
+ block->hdr.bitmap[1] &= ~(u8)(mask >> 1 * 8); |
2627 |
+ block->hdr.bitmap[2] &= ~(u8)(mask >> 2 * 8); |
2628 |
+@@ -108,8 +102,6 @@ static void afs_clear_contig_bits(union afs_xdr_dir_block *block, |
2629 |
+ block->hdr.bitmap[5] &= ~(u8)(mask >> 5 * 8); |
2630 |
+ block->hdr.bitmap[6] &= ~(u8)(mask >> 6 * 8); |
2631 |
+ block->hdr.bitmap[7] &= ~(u8)(mask >> 7 * 8); |
2632 |
+- |
2633 |
+- after = *(u64 *)block->hdr.bitmap; |
2634 |
+ } |
2635 |
+ |
2636 |
+ /* |
2637 |
+diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig |
2638 |
+index c4b1a89b8845..f2f81561ebb6 100644 |
2639 |
+--- a/fs/nfsd/Kconfig |
2640 |
++++ b/fs/nfsd/Kconfig |
2641 |
+@@ -73,6 +73,7 @@ config NFSD_V4 |
2642 |
+ select NFSD_V3 |
2643 |
+ select FS_POSIX_ACL |
2644 |
+ select SUNRPC_GSS |
2645 |
++ select CRYPTO_MD5 |
2646 |
+ select CRYPTO_SHA256 |
2647 |
+ select GRACE_PERIOD |
2648 |
+ help |
2649 |
+diff --git a/fs/xfs/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c |
2650 |
+index cd6c7210a373..c7de17deeae6 100644 |
2651 |
+--- a/fs/xfs/xfs_quotaops.c |
2652 |
++++ b/fs/xfs/xfs_quotaops.c |
2653 |
+@@ -201,6 +201,9 @@ xfs_fs_rm_xquota( |
2654 |
+ if (XFS_IS_QUOTA_ON(mp)) |
2655 |
+ return -EINVAL; |
2656 |
+ |
2657 |
++ if (uflags & ~(FS_USER_QUOTA | FS_GROUP_QUOTA | FS_PROJ_QUOTA)) |
2658 |
++ return -EINVAL; |
2659 |
++ |
2660 |
+ if (uflags & FS_USER_QUOTA) |
2661 |
+ flags |= XFS_DQ_USER; |
2662 |
+ if (uflags & FS_GROUP_QUOTA) |
2663 |
+diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h |
2664 |
+index d1a5d5df02f5..08b25c02b5a1 100644 |
2665 |
+--- a/include/linux/mmc/sdio_ids.h |
2666 |
++++ b/include/linux/mmc/sdio_ids.h |
2667 |
+@@ -71,6 +71,8 @@ |
2668 |
+ |
2669 |
+ #define SDIO_VENDOR_ID_TI 0x0097 |
2670 |
+ #define SDIO_DEVICE_ID_TI_WL1271 0x4076 |
2671 |
++#define SDIO_VENDOR_ID_TI_WL1251 0x104c |
2672 |
++#define SDIO_DEVICE_ID_TI_WL1251 0x9066 |
2673 |
+ |
2674 |
+ #define SDIO_VENDOR_ID_STE 0x0020 |
2675 |
+ #define SDIO_DEVICE_ID_STE_CW1200 0x2280 |
2676 |
+diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c |
2677 |
+index 3867864cdc2f..3d3d61b5985b 100644 |
2678 |
+--- a/kernel/bpf/devmap.c |
2679 |
++++ b/kernel/bpf/devmap.c |
2680 |
+@@ -74,7 +74,7 @@ struct bpf_dtab_netdev { |
2681 |
+ |
2682 |
+ struct bpf_dtab { |
2683 |
+ struct bpf_map map; |
2684 |
+- struct bpf_dtab_netdev **netdev_map; |
2685 |
++ struct bpf_dtab_netdev **netdev_map; /* DEVMAP type only */ |
2686 |
+ struct list_head __percpu *flush_list; |
2687 |
+ struct list_head list; |
2688 |
+ |
2689 |
+@@ -101,6 +101,12 @@ static struct hlist_head *dev_map_create_hash(unsigned int entries) |
2690 |
+ return hash; |
2691 |
+ } |
2692 |
+ |
2693 |
++static inline struct hlist_head *dev_map_index_hash(struct bpf_dtab *dtab, |
2694 |
++ int idx) |
2695 |
++{ |
2696 |
++ return &dtab->dev_index_head[idx & (dtab->n_buckets - 1)]; |
2697 |
++} |
2698 |
++ |
2699 |
+ static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr *attr) |
2700 |
+ { |
2701 |
+ int err, cpu; |
2702 |
+@@ -120,8 +126,7 @@ static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr *attr) |
2703 |
+ bpf_map_init_from_attr(&dtab->map, attr); |
2704 |
+ |
2705 |
+ /* make sure page count doesn't overflow */ |
2706 |
+- cost = (u64) dtab->map.max_entries * sizeof(struct bpf_dtab_netdev *); |
2707 |
+- cost += sizeof(struct list_head) * num_possible_cpus(); |
2708 |
++ cost = (u64) sizeof(struct list_head) * num_possible_cpus(); |
2709 |
+ |
2710 |
+ if (attr->map_type == BPF_MAP_TYPE_DEVMAP_HASH) { |
2711 |
+ dtab->n_buckets = roundup_pow_of_two(dtab->map.max_entries); |
2712 |
+@@ -129,6 +134,8 @@ static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr *attr) |
2713 |
+ if (!dtab->n_buckets) /* Overflow check */ |
2714 |
+ return -EINVAL; |
2715 |
+ cost += (u64) sizeof(struct hlist_head) * dtab->n_buckets; |
2716 |
++ } else { |
2717 |
++ cost += (u64) dtab->map.max_entries * sizeof(struct bpf_dtab_netdev *); |
2718 |
+ } |
2719 |
+ |
2720 |
+ /* if map size is larger than memlock limit, reject it */ |
2721 |
+@@ -143,24 +150,22 @@ static int dev_map_init_map(struct bpf_dtab *dtab, union bpf_attr *attr) |
2722 |
+ for_each_possible_cpu(cpu) |
2723 |
+ INIT_LIST_HEAD(per_cpu_ptr(dtab->flush_list, cpu)); |
2724 |
+ |
2725 |
+- dtab->netdev_map = bpf_map_area_alloc(dtab->map.max_entries * |
2726 |
+- sizeof(struct bpf_dtab_netdev *), |
2727 |
+- dtab->map.numa_node); |
2728 |
+- if (!dtab->netdev_map) |
2729 |
+- goto free_percpu; |
2730 |
+- |
2731 |
+ if (attr->map_type == BPF_MAP_TYPE_DEVMAP_HASH) { |
2732 |
+ dtab->dev_index_head = dev_map_create_hash(dtab->n_buckets); |
2733 |
+ if (!dtab->dev_index_head) |
2734 |
+- goto free_map_area; |
2735 |
++ goto free_percpu; |
2736 |
+ |
2737 |
+ spin_lock_init(&dtab->index_lock); |
2738 |
++ } else { |
2739 |
++ dtab->netdev_map = bpf_map_area_alloc(dtab->map.max_entries * |
2740 |
++ sizeof(struct bpf_dtab_netdev *), |
2741 |
++ dtab->map.numa_node); |
2742 |
++ if (!dtab->netdev_map) |
2743 |
++ goto free_percpu; |
2744 |
+ } |
2745 |
+ |
2746 |
+ return 0; |
2747 |
+ |
2748 |
+-free_map_area: |
2749 |
+- bpf_map_area_free(dtab->netdev_map); |
2750 |
+ free_percpu: |
2751 |
+ free_percpu(dtab->flush_list); |
2752 |
+ free_charge: |
2753 |
+@@ -228,21 +233,40 @@ static void dev_map_free(struct bpf_map *map) |
2754 |
+ cond_resched(); |
2755 |
+ } |
2756 |
+ |
2757 |
+- for (i = 0; i < dtab->map.max_entries; i++) { |
2758 |
+- struct bpf_dtab_netdev *dev; |
2759 |
++ if (dtab->map.map_type == BPF_MAP_TYPE_DEVMAP_HASH) { |
2760 |
++ for (i = 0; i < dtab->n_buckets; i++) { |
2761 |
++ struct bpf_dtab_netdev *dev; |
2762 |
++ struct hlist_head *head; |
2763 |
++ struct hlist_node *next; |
2764 |
+ |
2765 |
+- dev = dtab->netdev_map[i]; |
2766 |
+- if (!dev) |
2767 |
+- continue; |
2768 |
++ head = dev_map_index_hash(dtab, i); |
2769 |
+ |
2770 |
+- free_percpu(dev->bulkq); |
2771 |
+- dev_put(dev->dev); |
2772 |
+- kfree(dev); |
2773 |
++ hlist_for_each_entry_safe(dev, next, head, index_hlist) { |
2774 |
++ hlist_del_rcu(&dev->index_hlist); |
2775 |
++ free_percpu(dev->bulkq); |
2776 |
++ dev_put(dev->dev); |
2777 |
++ kfree(dev); |
2778 |
++ } |
2779 |
++ } |
2780 |
++ |
2781 |
++ kfree(dtab->dev_index_head); |
2782 |
++ } else { |
2783 |
++ for (i = 0; i < dtab->map.max_entries; i++) { |
2784 |
++ struct bpf_dtab_netdev *dev; |
2785 |
++ |
2786 |
++ dev = dtab->netdev_map[i]; |
2787 |
++ if (!dev) |
2788 |
++ continue; |
2789 |
++ |
2790 |
++ free_percpu(dev->bulkq); |
2791 |
++ dev_put(dev->dev); |
2792 |
++ kfree(dev); |
2793 |
++ } |
2794 |
++ |
2795 |
++ bpf_map_area_free(dtab->netdev_map); |
2796 |
+ } |
2797 |
+ |
2798 |
+ free_percpu(dtab->flush_list); |
2799 |
+- bpf_map_area_free(dtab->netdev_map); |
2800 |
+- kfree(dtab->dev_index_head); |
2801 |
+ kfree(dtab); |
2802 |
+ } |
2803 |
+ |
2804 |
+@@ -263,12 +287,6 @@ static int dev_map_get_next_key(struct bpf_map *map, void *key, void *next_key) |
2805 |
+ return 0; |
2806 |
+ } |
2807 |
+ |
2808 |
+-static inline struct hlist_head *dev_map_index_hash(struct bpf_dtab *dtab, |
2809 |
+- int idx) |
2810 |
+-{ |
2811 |
+- return &dtab->dev_index_head[idx & (dtab->n_buckets - 1)]; |
2812 |
+-} |
2813 |
+- |
2814 |
+ struct bpf_dtab_netdev *__dev_map_hash_lookup_elem(struct bpf_map *map, u32 key) |
2815 |
+ { |
2816 |
+ struct bpf_dtab *dtab = container_of(map, struct bpf_dtab, map); |
2817 |
+diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c |
2818 |
+index 8402b29c280f..867fd72cb260 100644 |
2819 |
+--- a/kernel/dma/direct.c |
2820 |
++++ b/kernel/dma/direct.c |
2821 |
+@@ -375,7 +375,7 @@ dma_addr_t dma_direct_map_resource(struct device *dev, phys_addr_t paddr, |
2822 |
+ { |
2823 |
+ dma_addr_t dma_addr = paddr; |
2824 |
+ |
2825 |
+- if (unlikely(!dma_direct_possible(dev, dma_addr, size))) { |
2826 |
++ if (unlikely(!dma_capable(dev, dma_addr, size))) { |
2827 |
+ report_addr(dev, dma_addr, size); |
2828 |
+ return DMA_MAPPING_ERROR; |
2829 |
+ } |
2830 |
+diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h |
2831 |
+index 2defc7fe74c3..fa08d55f7040 100644 |
2832 |
+--- a/kernel/rcu/tree_plugin.h |
2833 |
++++ b/kernel/rcu/tree_plugin.h |
2834 |
+@@ -1946,7 +1946,7 @@ static void nocb_gp_wait(struct rcu_data *my_rdp) |
2835 |
+ int __maybe_unused cpu = my_rdp->cpu; |
2836 |
+ unsigned long cur_gp_seq; |
2837 |
+ unsigned long flags; |
2838 |
+- bool gotcbs; |
2839 |
++ bool gotcbs = false; |
2840 |
+ unsigned long j = jiffies; |
2841 |
+ bool needwait_gp = false; // This prevents actual uninitialized use. |
2842 |
+ bool needwake; |
2843 |
+diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c |
2844 |
+index a8a08030a8f7..08bdee0480b3 100644 |
2845 |
+--- a/kernel/sched/deadline.c |
2846 |
++++ b/kernel/sched/deadline.c |
2847 |
+@@ -1743,13 +1743,16 @@ static void start_hrtick_dl(struct rq *rq, struct task_struct *p) |
2848 |
+ } |
2849 |
+ #endif |
2850 |
+ |
2851 |
+-static void set_next_task_dl(struct rq *rq, struct task_struct *p) |
2852 |
++static void set_next_task_dl(struct rq *rq, struct task_struct *p, bool first) |
2853 |
+ { |
2854 |
+ p->se.exec_start = rq_clock_task(rq); |
2855 |
+ |
2856 |
+ /* You can't push away the running task */ |
2857 |
+ dequeue_pushable_dl_task(rq, p); |
2858 |
+ |
2859 |
++ if (!first) |
2860 |
++ return; |
2861 |
++ |
2862 |
+ if (hrtick_enabled(rq)) |
2863 |
+ start_hrtick_dl(rq, p); |
2864 |
+ |
2865 |
+@@ -1785,7 +1788,7 @@ pick_next_task_dl(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) |
2866 |
+ dl_se = pick_next_dl_entity(rq, dl_rq); |
2867 |
+ BUG_ON(!dl_se); |
2868 |
+ p = dl_task_of(dl_se); |
2869 |
+- set_next_task_dl(rq, p); |
2870 |
++ set_next_task_dl(rq, p, true); |
2871 |
+ return p; |
2872 |
+ } |
2873 |
+ |
2874 |
+diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c |
2875 |
+index 69a81a5709ff..c87a798d1456 100644 |
2876 |
+--- a/kernel/sched/fair.c |
2877 |
++++ b/kernel/sched/fair.c |
2878 |
+@@ -3504,9 +3504,6 @@ update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq) |
2879 |
+ cfs_rq->load_last_update_time_copy = sa->last_update_time; |
2880 |
+ #endif |
2881 |
+ |
2882 |
+- if (decayed) |
2883 |
+- cfs_rq_util_change(cfs_rq, 0); |
2884 |
+- |
2885 |
+ return decayed; |
2886 |
+ } |
2887 |
+ |
2888 |
+@@ -3616,8 +3613,12 @@ static inline void update_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s |
2889 |
+ attach_entity_load_avg(cfs_rq, se, SCHED_CPUFREQ_MIGRATION); |
2890 |
+ update_tg_load_avg(cfs_rq, 0); |
2891 |
+ |
2892 |
+- } else if (decayed && (flags & UPDATE_TG)) |
2893 |
+- update_tg_load_avg(cfs_rq, 0); |
2894 |
++ } else if (decayed) { |
2895 |
++ cfs_rq_util_change(cfs_rq, 0); |
2896 |
++ |
2897 |
++ if (flags & UPDATE_TG) |
2898 |
++ update_tg_load_avg(cfs_rq, 0); |
2899 |
++ } |
2900 |
+ } |
2901 |
+ |
2902 |
+ #ifndef CONFIG_64BIT |
2903 |
+@@ -7517,6 +7518,28 @@ static inline bool others_have_blocked(struct rq *rq) { return false; } |
2904 |
+ static inline void update_blocked_load_status(struct rq *rq, bool has_blocked) {} |
2905 |
+ #endif |
2906 |
+ |
2907 |
++static bool __update_blocked_others(struct rq *rq, bool *done) |
2908 |
++{ |
2909 |
++ const struct sched_class *curr_class; |
2910 |
++ u64 now = rq_clock_pelt(rq); |
2911 |
++ bool decayed; |
2912 |
++ |
2913 |
++ /* |
2914 |
++ * update_load_avg() can call cpufreq_update_util(). Make sure that RT, |
2915 |
++ * DL and IRQ signals have been updated before updating CFS. |
2916 |
++ */ |
2917 |
++ curr_class = rq->curr->sched_class; |
2918 |
++ |
2919 |
++ decayed = update_rt_rq_load_avg(now, rq, curr_class == &rt_sched_class) | |
2920 |
++ update_dl_rq_load_avg(now, rq, curr_class == &dl_sched_class) | |
2921 |
++ update_irq_load_avg(rq, 0); |
2922 |
++ |
2923 |
++ if (others_have_blocked(rq)) |
2924 |
++ *done = false; |
2925 |
++ |
2926 |
++ return decayed; |
2927 |
++} |
2928 |
++ |
2929 |
+ #ifdef CONFIG_FAIR_GROUP_SCHED |
2930 |
+ |
2931 |
+ static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) |
2932 |
+@@ -7536,29 +7559,11 @@ static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) |
2933 |
+ return true; |
2934 |
+ } |
2935 |
+ |
2936 |
+-static void update_blocked_averages(int cpu) |
2937 |
++static bool __update_blocked_fair(struct rq *rq, bool *done) |
2938 |
+ { |
2939 |
+- struct rq *rq = cpu_rq(cpu); |
2940 |
+ struct cfs_rq *cfs_rq, *pos; |
2941 |
+- const struct sched_class *curr_class; |
2942 |
+- struct rq_flags rf; |
2943 |
+- bool done = true; |
2944 |
+- |
2945 |
+- rq_lock_irqsave(rq, &rf); |
2946 |
+- update_rq_clock(rq); |
2947 |
+- |
2948 |
+- /* |
2949 |
+- * update_cfs_rq_load_avg() can call cpufreq_update_util(). Make sure |
2950 |
+- * that RT, DL and IRQ signals have been updated before updating CFS. |
2951 |
+- */ |
2952 |
+- curr_class = rq->curr->sched_class; |
2953 |
+- update_rt_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &rt_sched_class); |
2954 |
+- update_dl_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &dl_sched_class); |
2955 |
+- update_irq_load_avg(rq, 0); |
2956 |
+- |
2957 |
+- /* Don't need periodic decay once load/util_avg are null */ |
2958 |
+- if (others_have_blocked(rq)) |
2959 |
+- done = false; |
2960 |
++ bool decayed = false; |
2961 |
++ int cpu = cpu_of(rq); |
2962 |
+ |
2963 |
+ /* |
2964 |
+ * Iterates the task_group tree in a bottom up fashion, see |
2965 |
+@@ -7567,9 +7572,13 @@ static void update_blocked_averages(int cpu) |
2966 |
+ for_each_leaf_cfs_rq_safe(rq, cfs_rq, pos) { |
2967 |
+ struct sched_entity *se; |
2968 |
+ |
2969 |
+- if (update_cfs_rq_load_avg(cfs_rq_clock_pelt(cfs_rq), cfs_rq)) |
2970 |
++ if (update_cfs_rq_load_avg(cfs_rq_clock_pelt(cfs_rq), cfs_rq)) { |
2971 |
+ update_tg_load_avg(cfs_rq, 0); |
2972 |
+ |
2973 |
++ if (cfs_rq == &rq->cfs) |
2974 |
++ decayed = true; |
2975 |
++ } |
2976 |
++ |
2977 |
+ /* Propagate pending load changes to the parent, if any: */ |
2978 |
+ se = cfs_rq->tg->se[cpu]; |
2979 |
+ if (se && !skip_blocked_update(se)) |
2980 |
+@@ -7584,11 +7593,10 @@ static void update_blocked_averages(int cpu) |
2981 |
+ |
2982 |
+ /* Don't need periodic decay once load/util_avg are null */ |
2983 |
+ if (cfs_rq_has_blocked(cfs_rq)) |
2984 |
+- done = false; |
2985 |
++ *done = false; |
2986 |
+ } |
2987 |
+ |
2988 |
+- update_blocked_load_status(rq, !done); |
2989 |
+- rq_unlock_irqrestore(rq, &rf); |
2990 |
++ return decayed; |
2991 |
+ } |
2992 |
+ |
2993 |
+ /* |
2994 |
+@@ -7638,29 +7646,16 @@ static unsigned long task_h_load(struct task_struct *p) |
2995 |
+ cfs_rq_load_avg(cfs_rq) + 1); |
2996 |
+ } |
2997 |
+ #else |
2998 |
+-static inline void update_blocked_averages(int cpu) |
2999 |
++static bool __update_blocked_fair(struct rq *rq, bool *done) |
3000 |
+ { |
3001 |
+- struct rq *rq = cpu_rq(cpu); |
3002 |
+ struct cfs_rq *cfs_rq = &rq->cfs; |
3003 |
+- const struct sched_class *curr_class; |
3004 |
+- struct rq_flags rf; |
3005 |
+- |
3006 |
+- rq_lock_irqsave(rq, &rf); |
3007 |
+- update_rq_clock(rq); |
3008 |
+- |
3009 |
+- /* |
3010 |
+- * update_cfs_rq_load_avg() can call cpufreq_update_util(). Make sure |
3011 |
+- * that RT, DL and IRQ signals have been updated before updating CFS. |
3012 |
+- */ |
3013 |
+- curr_class = rq->curr->sched_class; |
3014 |
+- update_rt_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &rt_sched_class); |
3015 |
+- update_dl_rq_load_avg(rq_clock_pelt(rq), rq, curr_class == &dl_sched_class); |
3016 |
+- update_irq_load_avg(rq, 0); |
3017 |
++ bool decayed; |
3018 |
+ |
3019 |
+- update_cfs_rq_load_avg(cfs_rq_clock_pelt(cfs_rq), cfs_rq); |
3020 |
++ decayed = update_cfs_rq_load_avg(cfs_rq_clock_pelt(cfs_rq), cfs_rq); |
3021 |
++ if (cfs_rq_has_blocked(cfs_rq)) |
3022 |
++ *done = false; |
3023 |
+ |
3024 |
+- update_blocked_load_status(rq, cfs_rq_has_blocked(cfs_rq) || others_have_blocked(rq)); |
3025 |
+- rq_unlock_irqrestore(rq, &rf); |
3026 |
++ return decayed; |
3027 |
+ } |
3028 |
+ |
3029 |
+ static unsigned long task_h_load(struct task_struct *p) |
3030 |
+@@ -7669,6 +7664,24 @@ static unsigned long task_h_load(struct task_struct *p) |
3031 |
+ } |
3032 |
+ #endif |
3033 |
+ |
3034 |
++static void update_blocked_averages(int cpu) |
3035 |
++{ |
3036 |
++ bool decayed = false, done = true; |
3037 |
++ struct rq *rq = cpu_rq(cpu); |
3038 |
++ struct rq_flags rf; |
3039 |
++ |
3040 |
++ rq_lock_irqsave(rq, &rf); |
3041 |
++ update_rq_clock(rq); |
3042 |
++ |
3043 |
++ decayed |= __update_blocked_others(rq, &done); |
3044 |
++ decayed |= __update_blocked_fair(rq, &done); |
3045 |
++ |
3046 |
++ update_blocked_load_status(rq, !done); |
3047 |
++ if (decayed) |
3048 |
++ cpufreq_update_util(rq, 0); |
3049 |
++ rq_unlock_irqrestore(rq, &rf); |
3050 |
++} |
3051 |
++ |
3052 |
+ /********** Helpers for find_busiest_group ************************/ |
3053 |
+ |
3054 |
+ /* |
3055 |
+@@ -10151,7 +10164,7 @@ static void switched_to_fair(struct rq *rq, struct task_struct *p) |
3056 |
+ * This routine is mostly called to set cfs_rq->curr field when a task |
3057 |
+ * migrates between groups/classes. |
3058 |
+ */ |
3059 |
+-static void set_next_task_fair(struct rq *rq, struct task_struct *p) |
3060 |
++static void set_next_task_fair(struct rq *rq, struct task_struct *p, bool first) |
3061 |
+ { |
3062 |
+ struct sched_entity *se = &p->se; |
3063 |
+ |
3064 |
+diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c |
3065 |
+index f65ef1e2f204..131e7c86cf06 100644 |
3066 |
+--- a/kernel/sched/idle.c |
3067 |
++++ b/kernel/sched/idle.c |
3068 |
+@@ -385,7 +385,7 @@ static void put_prev_task_idle(struct rq *rq, struct task_struct *prev) |
3069 |
+ { |
3070 |
+ } |
3071 |
+ |
3072 |
+-static void set_next_task_idle(struct rq *rq, struct task_struct *next) |
3073 |
++static void set_next_task_idle(struct rq *rq, struct task_struct *next, bool first) |
3074 |
+ { |
3075 |
+ update_idle_core(rq); |
3076 |
+ schedstat_inc(rq->sched_goidle); |
3077 |
+@@ -399,7 +399,7 @@ pick_next_task_idle(struct rq *rq, struct task_struct *prev, struct rq_flags *rf |
3078 |
+ if (prev) |
3079 |
+ put_prev_task(rq, prev); |
3080 |
+ |
3081 |
+- set_next_task_idle(rq, next); |
3082 |
++ set_next_task_idle(rq, next, true); |
3083 |
+ |
3084 |
+ return next; |
3085 |
+ } |
3086 |
+diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c |
3087 |
+index 9b8adc01be3d..7bf917e4d63a 100644 |
3088 |
+--- a/kernel/sched/rt.c |
3089 |
++++ b/kernel/sched/rt.c |
3090 |
+@@ -1515,13 +1515,16 @@ static void check_preempt_curr_rt(struct rq *rq, struct task_struct *p, int flag |
3091 |
+ #endif |
3092 |
+ } |
3093 |
+ |
3094 |
+-static inline void set_next_task_rt(struct rq *rq, struct task_struct *p) |
3095 |
++static inline void set_next_task_rt(struct rq *rq, struct task_struct *p, bool first) |
3096 |
+ { |
3097 |
+ p->se.exec_start = rq_clock_task(rq); |
3098 |
+ |
3099 |
+ /* The running task is never eligible for pushing */ |
3100 |
+ dequeue_pushable_task(rq, p); |
3101 |
+ |
3102 |
++ if (!first) |
3103 |
++ return; |
3104 |
++ |
3105 |
+ /* |
3106 |
+ * If prev task was rt, put_prev_task() has already updated the |
3107 |
+ * utilization. We only care of the case where we start to schedule a |
3108 |
+@@ -1575,7 +1578,7 @@ pick_next_task_rt(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) |
3109 |
+ return NULL; |
3110 |
+ |
3111 |
+ p = _pick_next_task_rt(rq); |
3112 |
+- set_next_task_rt(rq, p); |
3113 |
++ set_next_task_rt(rq, p, true); |
3114 |
+ return p; |
3115 |
+ } |
3116 |
+ |
3117 |
+diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h |
3118 |
+index 49ed949f850c..e5e2605778c9 100644 |
3119 |
+--- a/kernel/sched/sched.h |
3120 |
++++ b/kernel/sched/sched.h |
3121 |
+@@ -1728,7 +1728,7 @@ struct sched_class { |
3122 |
+ struct task_struct *prev, |
3123 |
+ struct rq_flags *rf); |
3124 |
+ void (*put_prev_task)(struct rq *rq, struct task_struct *p); |
3125 |
+- void (*set_next_task)(struct rq *rq, struct task_struct *p); |
3126 |
++ void (*set_next_task)(struct rq *rq, struct task_struct *p, bool first); |
3127 |
+ |
3128 |
+ #ifdef CONFIG_SMP |
3129 |
+ int (*balance)(struct rq *rq, struct task_struct *prev, struct rq_flags *rf); |
3130 |
+@@ -1780,7 +1780,7 @@ static inline void put_prev_task(struct rq *rq, struct task_struct *prev) |
3131 |
+ static inline void set_next_task(struct rq *rq, struct task_struct *next) |
3132 |
+ { |
3133 |
+ WARN_ON_ONCE(rq->curr != next); |
3134 |
+- next->sched_class->set_next_task(rq, next); |
3135 |
++ next->sched_class->set_next_task(rq, next, false); |
3136 |
+ } |
3137 |
+ |
3138 |
+ #ifdef CONFIG_SMP |
3139 |
+diff --git a/kernel/sched/stop_task.c b/kernel/sched/stop_task.c |
3140 |
+index c0640739e05e..02dc0a8e3925 100644 |
3141 |
+--- a/kernel/sched/stop_task.c |
3142 |
++++ b/kernel/sched/stop_task.c |
3143 |
+@@ -29,7 +29,7 @@ check_preempt_curr_stop(struct rq *rq, struct task_struct *p, int flags) |
3144 |
+ /* we're never preempted */ |
3145 |
+ } |
3146 |
+ |
3147 |
+-static void set_next_task_stop(struct rq *rq, struct task_struct *stop) |
3148 |
++static void set_next_task_stop(struct rq *rq, struct task_struct *stop, bool first) |
3149 |
+ { |
3150 |
+ stop->se.exec_start = rq_clock_task(rq); |
3151 |
+ } |
3152 |
+@@ -42,7 +42,7 @@ pick_next_task_stop(struct rq *rq, struct task_struct *prev, struct rq_flags *rf |
3153 |
+ if (!sched_stop_runnable(rq)) |
3154 |
+ return NULL; |
3155 |
+ |
3156 |
+- set_next_task_stop(rq, rq->stop); |
3157 |
++ set_next_task_stop(rq, rq->stop, true); |
3158 |
+ return rq->stop; |
3159 |
+ } |
3160 |
+ |
3161 |
+diff --git a/kernel/workqueue.c b/kernel/workqueue.c |
3162 |
+index 649687622654..e9c63b79e03f 100644 |
3163 |
+--- a/kernel/workqueue.c |
3164 |
++++ b/kernel/workqueue.c |
3165 |
+@@ -425,7 +425,8 @@ static void workqueue_sysfs_unregister(struct workqueue_struct *wq); |
3166 |
+ * ignored. |
3167 |
+ */ |
3168 |
+ #define for_each_pwq(pwq, wq) \ |
3169 |
+- list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node) \ |
3170 |
++ list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node, \ |
3171 |
++ lockdep_is_held(&wq->mutex)) \ |
3172 |
+ if (({ assert_rcu_or_wq_mutex(wq); false; })) { } \ |
3173 |
+ else |
3174 |
+ |
3175 |
+diff --git a/net/core/neighbour.c b/net/core/neighbour.c |
3176 |
+index f2452496ad9f..920784a9b7ff 100644 |
3177 |
+--- a/net/core/neighbour.c |
3178 |
++++ b/net/core/neighbour.c |
3179 |
+@@ -2049,8 +2049,8 @@ static int neightbl_fill_info(struct sk_buff *skb, struct neigh_table *tbl, |
3180 |
+ goto nla_put_failure; |
3181 |
+ { |
3182 |
+ unsigned long now = jiffies; |
3183 |
+- unsigned int flush_delta = now - tbl->last_flush; |
3184 |
+- unsigned int rand_delta = now - tbl->last_rand; |
3185 |
++ long flush_delta = now - tbl->last_flush; |
3186 |
++ long rand_delta = now - tbl->last_rand; |
3187 |
+ struct neigh_hash_table *nht; |
3188 |
+ struct ndt_config ndc = { |
3189 |
+ .ndtc_key_len = tbl->key_len, |
3190 |
+diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c |
3191 |
+index b4db68e5caa9..4c826b8bf9b1 100644 |
3192 |
+--- a/net/core/net-sysfs.c |
3193 |
++++ b/net/core/net-sysfs.c |
3194 |
+@@ -1462,14 +1462,17 @@ static int netdev_queue_add_kobject(struct net_device *dev, int index) |
3195 |
+ struct kobject *kobj = &queue->kobj; |
3196 |
+ int error = 0; |
3197 |
+ |
3198 |
++ /* Kobject_put later will trigger netdev_queue_release call |
3199 |
++ * which decreases dev refcount: Take that reference here |
3200 |
++ */ |
3201 |
++ dev_hold(queue->dev); |
3202 |
++ |
3203 |
+ kobj->kset = dev->queues_kset; |
3204 |
+ error = kobject_init_and_add(kobj, &netdev_queue_ktype, NULL, |
3205 |
+ "tx-%u", index); |
3206 |
+ if (error) |
3207 |
+ goto err; |
3208 |
+ |
3209 |
+- dev_hold(queue->dev); |
3210 |
+- |
3211 |
+ #ifdef CONFIG_BQL |
3212 |
+ error = sysfs_create_group(kobj, &dql_group); |
3213 |
+ if (error) |
3214 |
+diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c |
3215 |
+index 23f67b8fdeaa..3eed90bfa2bf 100644 |
3216 |
+--- a/net/openvswitch/datapath.c |
3217 |
++++ b/net/openvswitch/datapath.c |
3218 |
+@@ -1667,6 +1667,7 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) |
3219 |
+ ovs_dp_reset_user_features(skb, info); |
3220 |
+ } |
3221 |
+ |
3222 |
++ ovs_unlock(); |
3223 |
+ goto err_destroy_meters; |
3224 |
+ } |
3225 |
+ |
3226 |
+@@ -1683,7 +1684,6 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) |
3227 |
+ return 0; |
3228 |
+ |
3229 |
+ err_destroy_meters: |
3230 |
+- ovs_unlock(); |
3231 |
+ ovs_meters_exit(dp); |
3232 |
+ err_destroy_ports_array: |
3233 |
+ kfree(dp->ports); |
3234 |
+diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c |
3235 |
+index 529d4ce945db..118cd66b7516 100644 |
3236 |
+--- a/net/packet/af_packet.c |
3237 |
++++ b/net/packet/af_packet.c |
3238 |
+@@ -1296,15 +1296,21 @@ static void packet_sock_destruct(struct sock *sk) |
3239 |
+ |
3240 |
+ static bool fanout_flow_is_huge(struct packet_sock *po, struct sk_buff *skb) |
3241 |
+ { |
3242 |
+- u32 rxhash; |
3243 |
++ u32 *history = po->rollover->history; |
3244 |
++ u32 victim, rxhash; |
3245 |
+ int i, count = 0; |
3246 |
+ |
3247 |
+ rxhash = skb_get_hash(skb); |
3248 |
+ for (i = 0; i < ROLLOVER_HLEN; i++) |
3249 |
+- if (po->rollover->history[i] == rxhash) |
3250 |
++ if (READ_ONCE(history[i]) == rxhash) |
3251 |
+ count++; |
3252 |
+ |
3253 |
+- po->rollover->history[prandom_u32() % ROLLOVER_HLEN] = rxhash; |
3254 |
++ victim = prandom_u32() % ROLLOVER_HLEN; |
3255 |
++ |
3256 |
++ /* Avoid dirtying the cache line if possible */ |
3257 |
++ if (READ_ONCE(history[victim]) != rxhash) |
3258 |
++ WRITE_ONCE(history[victim], rxhash); |
3259 |
++ |
3260 |
+ return count > (ROLLOVER_HLEN >> 1); |
3261 |
+ } |
3262 |
+ |
3263 |
+diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c |
3264 |
+index 8be2f209982b..908b60a72d95 100644 |
3265 |
+--- a/net/sunrpc/auth_gss/svcauth_gss.c |
3266 |
++++ b/net/sunrpc/auth_gss/svcauth_gss.c |
3267 |
+@@ -1075,24 +1075,32 @@ gss_read_verf(struct rpc_gss_wire_cred *gc, |
3268 |
+ return 0; |
3269 |
+ } |
3270 |
+ |
3271 |
+-/* Ok this is really heavily depending on a set of semantics in |
3272 |
+- * how rqstp is set up by svc_recv and pages laid down by the |
3273 |
+- * server when reading a request. We are basically guaranteed that |
3274 |
+- * the token lays all down linearly across a set of pages, starting |
3275 |
+- * at iov_base in rq_arg.head[0] which happens to be the first of a |
3276 |
+- * set of pages stored in rq_pages[]. |
3277 |
+- * rq_arg.head[0].iov_base will provide us the page_base to pass |
3278 |
+- * to the upcall. |
3279 |
+- */ |
3280 |
+-static inline int |
3281 |
+-gss_read_proxy_verf(struct svc_rqst *rqstp, |
3282 |
+- struct rpc_gss_wire_cred *gc, __be32 *authp, |
3283 |
+- struct xdr_netobj *in_handle, |
3284 |
+- struct gssp_in_token *in_token) |
3285 |
++static void gss_free_in_token_pages(struct gssp_in_token *in_token) |
3286 |
+ { |
3287 |
+- struct kvec *argv = &rqstp->rq_arg.head[0]; |
3288 |
+ u32 inlen; |
3289 |
+- int res; |
3290 |
++ int i; |
3291 |
++ |
3292 |
++ i = 0; |
3293 |
++ inlen = in_token->page_len; |
3294 |
++ while (inlen) { |
3295 |
++ if (in_token->pages[i]) |
3296 |
++ put_page(in_token->pages[i]); |
3297 |
++ inlen -= inlen > PAGE_SIZE ? PAGE_SIZE : inlen; |
3298 |
++ } |
3299 |
++ |
3300 |
++ kfree(in_token->pages); |
3301 |
++ in_token->pages = NULL; |
3302 |
++} |
3303 |
++ |
3304 |
++static int gss_read_proxy_verf(struct svc_rqst *rqstp, |
3305 |
++ struct rpc_gss_wire_cred *gc, __be32 *authp, |
3306 |
++ struct xdr_netobj *in_handle, |
3307 |
++ struct gssp_in_token *in_token) |
3308 |
++{ |
3309 |
++ struct kvec *argv = &rqstp->rq_arg.head[0]; |
3310 |
++ unsigned int page_base, length; |
3311 |
++ int pages, i, res; |
3312 |
++ size_t inlen; |
3313 |
+ |
3314 |
+ res = gss_read_common_verf(gc, argv, authp, in_handle); |
3315 |
+ if (res) |
3316 |
+@@ -1102,10 +1110,36 @@ gss_read_proxy_verf(struct svc_rqst *rqstp, |
3317 |
+ if (inlen > (argv->iov_len + rqstp->rq_arg.page_len)) |
3318 |
+ return SVC_DENIED; |
3319 |
+ |
3320 |
+- in_token->pages = rqstp->rq_pages; |
3321 |
+- in_token->page_base = (ulong)argv->iov_base & ~PAGE_MASK; |
3322 |
++ pages = DIV_ROUND_UP(inlen, PAGE_SIZE); |
3323 |
++ in_token->pages = kcalloc(pages, sizeof(struct page *), GFP_KERNEL); |
3324 |
++ if (!in_token->pages) |
3325 |
++ return SVC_DENIED; |
3326 |
++ in_token->page_base = 0; |
3327 |
+ in_token->page_len = inlen; |
3328 |
++ for (i = 0; i < pages; i++) { |
3329 |
++ in_token->pages[i] = alloc_page(GFP_KERNEL); |
3330 |
++ if (!in_token->pages[i]) { |
3331 |
++ gss_free_in_token_pages(in_token); |
3332 |
++ return SVC_DENIED; |
3333 |
++ } |
3334 |
++ } |
3335 |
+ |
3336 |
++ length = min_t(unsigned int, inlen, argv->iov_len); |
3337 |
++ memcpy(page_address(in_token->pages[0]), argv->iov_base, length); |
3338 |
++ inlen -= length; |
3339 |
++ |
3340 |
++ i = 1; |
3341 |
++ page_base = rqstp->rq_arg.page_base; |
3342 |
++ while (inlen) { |
3343 |
++ length = min_t(unsigned int, inlen, PAGE_SIZE); |
3344 |
++ memcpy(page_address(in_token->pages[i]), |
3345 |
++ page_address(rqstp->rq_arg.pages[i]) + page_base, |
3346 |
++ length); |
3347 |
++ |
3348 |
++ inlen -= length; |
3349 |
++ page_base = 0; |
3350 |
++ i++; |
3351 |
++ } |
3352 |
+ return 0; |
3353 |
+ } |
3354 |
+ |
3355 |
+@@ -1280,8 +1314,11 @@ static int svcauth_gss_proxy_init(struct svc_rqst *rqstp, |
3356 |
+ break; |
3357 |
+ case GSS_S_COMPLETE: |
3358 |
+ status = gss_proxy_save_rsc(sn->rsc_cache, &ud, &handle); |
3359 |
+- if (status) |
3360 |
++ if (status) { |
3361 |
++ pr_info("%s: gss_proxy_save_rsc failed (%d)\n", |
3362 |
++ __func__, status); |
3363 |
+ goto out; |
3364 |
++ } |
3365 |
+ cli_handle.data = (u8 *)&handle; |
3366 |
+ cli_handle.len = sizeof(handle); |
3367 |
+ break; |
3368 |
+@@ -1292,15 +1329,20 @@ static int svcauth_gss_proxy_init(struct svc_rqst *rqstp, |
3369 |
+ |
3370 |
+ /* Got an answer to the upcall; use it: */ |
3371 |
+ if (gss_write_init_verf(sn->rsc_cache, rqstp, |
3372 |
+- &cli_handle, &ud.major_status)) |
3373 |
++ &cli_handle, &ud.major_status)) { |
3374 |
++ pr_info("%s: gss_write_init_verf failed\n", __func__); |
3375 |
+ goto out; |
3376 |
++ } |
3377 |
+ if (gss_write_resv(resv, PAGE_SIZE, |
3378 |
+ &cli_handle, &ud.out_token, |
3379 |
+- ud.major_status, ud.minor_status)) |
3380 |
++ ud.major_status, ud.minor_status)) { |
3381 |
++ pr_info("%s: gss_write_resv failed\n", __func__); |
3382 |
+ goto out; |
3383 |
++ } |
3384 |
+ |
3385 |
+ ret = SVC_COMPLETE; |
3386 |
+ out: |
3387 |
++ gss_free_in_token_pages(&ud.in_token); |
3388 |
+ gssp_free_upcall_data(&ud); |
3389 |
+ return ret; |
3390 |
+ } |
3391 |
+diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c |
3392 |
+index 14ba9e72a204..f3104be8ff5d 100644 |
3393 |
+--- a/net/sunrpc/xdr.c |
3394 |
++++ b/net/sunrpc/xdr.c |
3395 |
+@@ -436,13 +436,12 @@ xdr_shrink_bufhead(struct xdr_buf *buf, size_t len) |
3396 |
+ } |
3397 |
+ |
3398 |
+ /** |
3399 |
+- * xdr_shrink_pagelen |
3400 |
++ * xdr_shrink_pagelen - shrinks buf->pages by up to @len bytes |
3401 |
+ * @buf: xdr_buf |
3402 |
+ * @len: bytes to remove from buf->pages |
3403 |
+ * |
3404 |
+- * Shrinks XDR buffer's page array buf->pages by |
3405 |
+- * 'len' bytes. The extra data is not lost, but is instead |
3406 |
+- * moved into the tail. |
3407 |
++ * The extra data is not lost, but is instead moved into buf->tail. |
3408 |
++ * Returns the actual number of bytes moved. |
3409 |
+ */ |
3410 |
+ static unsigned int |
3411 |
+ xdr_shrink_pagelen(struct xdr_buf *buf, size_t len) |
3412 |
+@@ -455,8 +454,8 @@ xdr_shrink_pagelen(struct xdr_buf *buf, size_t len) |
3413 |
+ |
3414 |
+ result = 0; |
3415 |
+ tail = buf->tail; |
3416 |
+- BUG_ON (len > pglen); |
3417 |
+- |
3418 |
++ if (len > buf->page_len) |
3419 |
++ len = buf-> page_len; |
3420 |
+ tailbuf_len = buf->buflen - buf->head->iov_len - buf->page_len; |
3421 |
+ |
3422 |
+ /* Shift the tail first */ |
3423 |
+diff --git a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c |
3424 |
+index d1fcc41d5eb5..908e78bb87c6 100644 |
3425 |
+--- a/net/sunrpc/xprtrdma/svc_rdma_backchannel.c |
3426 |
++++ b/net/sunrpc/xprtrdma/svc_rdma_backchannel.c |
3427 |
+@@ -195,6 +195,7 @@ rpcrdma_bc_send_request(struct svcxprt_rdma *rdma, struct rpc_rqst *rqst) |
3428 |
+ pr_info("%s: %*ph\n", __func__, 64, rqst->rq_buffer); |
3429 |
+ #endif |
3430 |
+ |
3431 |
++ rqst->rq_xtime = ktime_get(); |
3432 |
+ rc = svc_rdma_bc_sendto(rdma, rqst, ctxt); |
3433 |
+ if (rc) { |
3434 |
+ svc_rdma_send_ctxt_put(rdma, ctxt); |
3435 |
+diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c |
3436 |
+index 70e52f567b2a..5361b98f31ae 100644 |
3437 |
+--- a/net/sunrpc/xprtsock.c |
3438 |
++++ b/net/sunrpc/xprtsock.c |
3439 |
+@@ -2659,6 +2659,8 @@ static int bc_sendto(struct rpc_rqst *req) |
3440 |
+ .iov_len = sizeof(marker), |
3441 |
+ }; |
3442 |
+ |
3443 |
++ req->rq_xtime = ktime_get(); |
3444 |
++ |
3445 |
+ len = kernel_sendmsg(transport->sock, &msg, &iov, 1, iov.iov_len); |
3446 |
+ if (len != iov.iov_len) |
3447 |
+ return -EAGAIN; |
3448 |
+@@ -2684,7 +2686,6 @@ static int bc_send_request(struct rpc_rqst *req) |
3449 |
+ struct svc_xprt *xprt; |
3450 |
+ int len; |
3451 |
+ |
3452 |
+- dprintk("sending request with xid: %08x\n", ntohl(req->rq_xid)); |
3453 |
+ /* |
3454 |
+ * Get the server socket associated with this callback xprt |
3455 |
+ */ |
3456 |
+diff --git a/net/tipc/link.c b/net/tipc/link.c |
3457 |
+index 999eab592de8..a9d8a81e80cf 100644 |
3458 |
+--- a/net/tipc/link.c |
3459 |
++++ b/net/tipc/link.c |
3460 |
+@@ -1084,7 +1084,7 @@ static bool link_retransmit_failure(struct tipc_link *l, struct tipc_link *r, |
3461 |
+ return false; |
3462 |
+ |
3463 |
+ if (!time_after(jiffies, TIPC_SKB_CB(skb)->retr_stamp + |
3464 |
+- msecs_to_jiffies(r->tolerance))) |
3465 |
++ msecs_to_jiffies(r->tolerance * 10))) |
3466 |
+ return false; |
3467 |
+ |
3468 |
+ hdr = buf_msg(skb); |
3469 |
+diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c |
3470 |
+index 6a6eae88442f..58708b4c7719 100644 |
3471 |
+--- a/net/tipc/monitor.c |
3472 |
++++ b/net/tipc/monitor.c |
3473 |
+@@ -665,6 +665,21 @@ void tipc_mon_delete(struct net *net, int bearer_id) |
3474 |
+ kfree(mon); |
3475 |
+ } |
3476 |
+ |
3477 |
++void tipc_mon_reinit_self(struct net *net) |
3478 |
++{ |
3479 |
++ struct tipc_monitor *mon; |
3480 |
++ int bearer_id; |
3481 |
++ |
3482 |
++ for (bearer_id = 0; bearer_id < MAX_BEARERS; bearer_id++) { |
3483 |
++ mon = tipc_monitor(net, bearer_id); |
3484 |
++ if (!mon) |
3485 |
++ continue; |
3486 |
++ write_lock_bh(&mon->lock); |
3487 |
++ mon->self->addr = tipc_own_addr(net); |
3488 |
++ write_unlock_bh(&mon->lock); |
3489 |
++ } |
3490 |
++} |
3491 |
++ |
3492 |
+ int tipc_nl_monitor_set_threshold(struct net *net, u32 cluster_size) |
3493 |
+ { |
3494 |
+ struct tipc_net *tn = tipc_net(net); |
3495 |
+diff --git a/net/tipc/monitor.h b/net/tipc/monitor.h |
3496 |
+index 2a21b93e0d04..ed63d2e650b0 100644 |
3497 |
+--- a/net/tipc/monitor.h |
3498 |
++++ b/net/tipc/monitor.h |
3499 |
+@@ -77,6 +77,7 @@ int __tipc_nl_add_monitor(struct net *net, struct tipc_nl_msg *msg, |
3500 |
+ u32 bearer_id); |
3501 |
+ int tipc_nl_add_monitor_peer(struct net *net, struct tipc_nl_msg *msg, |
3502 |
+ u32 bearer_id, u32 *prev_node); |
3503 |
++void tipc_mon_reinit_self(struct net *net); |
3504 |
+ |
3505 |
+ extern const int tipc_max_domain_size; |
3506 |
+ #endif |
3507 |
+diff --git a/net/tipc/net.c b/net/tipc/net.c |
3508 |
+index 85707c185360..2de3cec9929d 100644 |
3509 |
+--- a/net/tipc/net.c |
3510 |
++++ b/net/tipc/net.c |
3511 |
+@@ -42,6 +42,7 @@ |
3512 |
+ #include "node.h" |
3513 |
+ #include "bcast.h" |
3514 |
+ #include "netlink.h" |
3515 |
++#include "monitor.h" |
3516 |
+ |
3517 |
+ /* |
3518 |
+ * The TIPC locking policy is designed to ensure a very fine locking |
3519 |
+@@ -136,6 +137,7 @@ static void tipc_net_finalize(struct net *net, u32 addr) |
3520 |
+ tipc_set_node_addr(net, addr); |
3521 |
+ tipc_named_reinit(net); |
3522 |
+ tipc_sk_reinit(net); |
3523 |
++ tipc_mon_reinit_self(net); |
3524 |
+ tipc_nametbl_publish(net, TIPC_CFG_SRV, addr, addr, |
3525 |
+ TIPC_CLUSTER_SCOPE, 0, addr); |
3526 |
+ } |
3527 |
+diff --git a/net/tipc/socket.c b/net/tipc/socket.c |
3528 |
+index 79d06c21ebe3..aea951a1f805 100644 |
3529 |
+--- a/net/tipc/socket.c |
3530 |
++++ b/net/tipc/socket.c |
3531 |
+@@ -504,7 +504,7 @@ static void __tipc_shutdown(struct socket *sock, int error) |
3532 |
+ struct sock *sk = sock->sk; |
3533 |
+ struct tipc_sock *tsk = tipc_sk(sk); |
3534 |
+ struct net *net = sock_net(sk); |
3535 |
+- long timeout = CONN_TIMEOUT_DEFAULT; |
3536 |
++ long timeout = msecs_to_jiffies(CONN_TIMEOUT_DEFAULT); |
3537 |
+ u32 dnode = tsk_peer_node(tsk); |
3538 |
+ struct sk_buff *skb; |
3539 |
+ |
3540 |
+@@ -1396,8 +1396,10 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen) |
3541 |
+ rc = tipc_msg_build(hdr, m, 0, dlen, mtu, &pkts); |
3542 |
+ if (unlikely(rc != dlen)) |
3543 |
+ return rc; |
3544 |
+- if (unlikely(syn && !tipc_msg_skb_clone(&pkts, &sk->sk_write_queue))) |
3545 |
++ if (unlikely(syn && !tipc_msg_skb_clone(&pkts, &sk->sk_write_queue))) { |
3546 |
++ __skb_queue_purge(&pkts); |
3547 |
+ return -ENOMEM; |
3548 |
++ } |
3549 |
+ |
3550 |
+ trace_tipc_sk_sendmsg(sk, skb_peek(&pkts), TIPC_DUMP_SK_SNDQ, " "); |
3551 |
+ rc = tipc_node_xmit(net, &pkts, dnode, tsk->portid); |
3552 |
+@@ -2685,6 +2687,7 @@ static void tipc_sk_timeout(struct timer_list *t) |
3553 |
+ if (sock_owned_by_user(sk)) { |
3554 |
+ sk_reset_timer(sk, &sk->sk_timer, jiffies + HZ / 20); |
3555 |
+ bh_unlock_sock(sk); |
3556 |
++ sock_put(sk); |
3557 |
+ return; |
3558 |
+ } |
3559 |
+ |
3560 |
+diff --git a/samples/bpf/sockex1_kern.c b/samples/bpf/sockex1_kern.c |
3561 |
+index ed18e9a4909c..43e38ce594d4 100644 |
3562 |
+--- a/samples/bpf/sockex1_kern.c |
3563 |
++++ b/samples/bpf/sockex1_kern.c |
3564 |
+@@ -4,12 +4,12 @@ |
3565 |
+ #include <uapi/linux/ip.h> |
3566 |
+ #include "bpf_helpers.h" |
3567 |
+ |
3568 |
+-struct bpf_map_def SEC("maps") my_map = { |
3569 |
+- .type = BPF_MAP_TYPE_ARRAY, |
3570 |
+- .key_size = sizeof(u32), |
3571 |
+- .value_size = sizeof(long), |
3572 |
+- .max_entries = 256, |
3573 |
+-}; |
3574 |
++struct { |
3575 |
++ __uint(type, BPF_MAP_TYPE_ARRAY); |
3576 |
++ __type(key, u32); |
3577 |
++ __type(value, long); |
3578 |
++ __uint(max_entries, 256); |
3579 |
++} my_map SEC(".maps"); |
3580 |
+ |
3581 |
+ SEC("socket1") |
3582 |
+ int bpf_prog1(struct __sk_buff *skb) |
3583 |
+diff --git a/samples/bpf/sockex2_kern.c b/samples/bpf/sockex2_kern.c |
3584 |
+index f2f9dbc021b0..ae4bdc89b599 100644 |
3585 |
+--- a/samples/bpf/sockex2_kern.c |
3586 |
++++ b/samples/bpf/sockex2_kern.c |
3587 |
+@@ -189,12 +189,12 @@ struct pair { |
3588 |
+ long bytes; |
3589 |
+ }; |
3590 |
+ |
3591 |
+-struct bpf_map_def SEC("maps") hash_map = { |
3592 |
+- .type = BPF_MAP_TYPE_HASH, |
3593 |
+- .key_size = sizeof(__be32), |
3594 |
+- .value_size = sizeof(struct pair), |
3595 |
+- .max_entries = 1024, |
3596 |
+-}; |
3597 |
++struct { |
3598 |
++ __uint(type, BPF_MAP_TYPE_HASH); |
3599 |
++ __type(key, __be32); |
3600 |
++ __type(value, struct pair); |
3601 |
++ __uint(max_entries, 1024); |
3602 |
++} hash_map SEC(".maps"); |
3603 |
+ |
3604 |
+ SEC("socket2") |
3605 |
+ int bpf_prog2(struct __sk_buff *skb) |
3606 |
+diff --git a/samples/bpf/xdp1_kern.c b/samples/bpf/xdp1_kern.c |
3607 |
+index 219742106bfd..db6870aee42c 100644 |
3608 |
+--- a/samples/bpf/xdp1_kern.c |
3609 |
++++ b/samples/bpf/xdp1_kern.c |
3610 |
+@@ -14,12 +14,12 @@ |
3611 |
+ #include <linux/ipv6.h> |
3612 |
+ #include "bpf_helpers.h" |
3613 |
+ |
3614 |
+-struct bpf_map_def SEC("maps") rxcnt = { |
3615 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
3616 |
+- .key_size = sizeof(u32), |
3617 |
+- .value_size = sizeof(long), |
3618 |
+- .max_entries = 256, |
3619 |
+-}; |
3620 |
++struct { |
3621 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
3622 |
++ __type(key, u32); |
3623 |
++ __type(value, long); |
3624 |
++ __uint(max_entries, 256); |
3625 |
++} rxcnt SEC(".maps"); |
3626 |
+ |
3627 |
+ static int parse_ipv4(void *data, u64 nh_off, void *data_end) |
3628 |
+ { |
3629 |
+diff --git a/samples/bpf/xdp2_kern.c b/samples/bpf/xdp2_kern.c |
3630 |
+index e01288867d15..c74b52c6d945 100644 |
3631 |
+--- a/samples/bpf/xdp2_kern.c |
3632 |
++++ b/samples/bpf/xdp2_kern.c |
3633 |
+@@ -14,12 +14,12 @@ |
3634 |
+ #include <linux/ipv6.h> |
3635 |
+ #include "bpf_helpers.h" |
3636 |
+ |
3637 |
+-struct bpf_map_def SEC("maps") rxcnt = { |
3638 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
3639 |
+- .key_size = sizeof(u32), |
3640 |
+- .value_size = sizeof(long), |
3641 |
+- .max_entries = 256, |
3642 |
+-}; |
3643 |
++struct { |
3644 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
3645 |
++ __type(key, u32); |
3646 |
++ __type(value, long); |
3647 |
++ __uint(max_entries, 256); |
3648 |
++} rxcnt SEC(".maps"); |
3649 |
+ |
3650 |
+ static void swap_src_dst_mac(void *data) |
3651 |
+ { |
3652 |
+diff --git a/samples/bpf/xdp_adjust_tail_kern.c b/samples/bpf/xdp_adjust_tail_kern.c |
3653 |
+index 411fdb21f8bc..cd9ff2a40a39 100644 |
3654 |
+--- a/samples/bpf/xdp_adjust_tail_kern.c |
3655 |
++++ b/samples/bpf/xdp_adjust_tail_kern.c |
3656 |
+@@ -25,12 +25,12 @@ |
3657 |
+ #define ICMP_TOOBIG_SIZE 98 |
3658 |
+ #define ICMP_TOOBIG_PAYLOAD_SIZE 92 |
3659 |
+ |
3660 |
+-struct bpf_map_def SEC("maps") icmpcnt = { |
3661 |
+- .type = BPF_MAP_TYPE_ARRAY, |
3662 |
+- .key_size = sizeof(__u32), |
3663 |
+- .value_size = sizeof(__u64), |
3664 |
+- .max_entries = 1, |
3665 |
+-}; |
3666 |
++struct { |
3667 |
++ __uint(type, BPF_MAP_TYPE_ARRAY); |
3668 |
++ __type(key, __u32); |
3669 |
++ __type(value, __u64); |
3670 |
++ __uint(max_entries, 1); |
3671 |
++} icmpcnt SEC(".maps"); |
3672 |
+ |
3673 |
+ static __always_inline void count_icmp(void) |
3674 |
+ { |
3675 |
+diff --git a/samples/bpf/xdp_fwd_kern.c b/samples/bpf/xdp_fwd_kern.c |
3676 |
+index 701a30f258b1..d013029aeaa2 100644 |
3677 |
+--- a/samples/bpf/xdp_fwd_kern.c |
3678 |
++++ b/samples/bpf/xdp_fwd_kern.c |
3679 |
+@@ -23,13 +23,12 @@ |
3680 |
+ |
3681 |
+ #define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) |
3682 |
+ |
3683 |
+-/* For TX-traffic redirect requires net_device ifindex to be in this devmap */ |
3684 |
+-struct bpf_map_def SEC("maps") xdp_tx_ports = { |
3685 |
+- .type = BPF_MAP_TYPE_DEVMAP, |
3686 |
+- .key_size = sizeof(int), |
3687 |
+- .value_size = sizeof(int), |
3688 |
+- .max_entries = 64, |
3689 |
+-}; |
3690 |
++struct { |
3691 |
++ __uint(type, BPF_MAP_TYPE_DEVMAP); |
3692 |
++ __uint(key_size, sizeof(int)); |
3693 |
++ __uint(value_size, sizeof(int)); |
3694 |
++ __uint(max_entries, 64); |
3695 |
++} xdp_tx_ports SEC(".maps"); |
3696 |
+ |
3697 |
+ /* from include/net/ip.h */ |
3698 |
+ static __always_inline int ip_decrease_ttl(struct iphdr *iph) |
3699 |
+diff --git a/samples/bpf/xdp_redirect_cpu_kern.c b/samples/bpf/xdp_redirect_cpu_kern.c |
3700 |
+index a306d1c75622..cfcc31e51197 100644 |
3701 |
+--- a/samples/bpf/xdp_redirect_cpu_kern.c |
3702 |
++++ b/samples/bpf/xdp_redirect_cpu_kern.c |
3703 |
+@@ -18,12 +18,12 @@ |
3704 |
+ #define MAX_CPUS 64 /* WARNING - sync with _user.c */ |
3705 |
+ |
3706 |
+ /* Special map type that can XDP_REDIRECT frames to another CPU */ |
3707 |
+-struct bpf_map_def SEC("maps") cpu_map = { |
3708 |
+- .type = BPF_MAP_TYPE_CPUMAP, |
3709 |
+- .key_size = sizeof(u32), |
3710 |
+- .value_size = sizeof(u32), |
3711 |
+- .max_entries = MAX_CPUS, |
3712 |
+-}; |
3713 |
++struct { |
3714 |
++ __uint(type, BPF_MAP_TYPE_CPUMAP); |
3715 |
++ __uint(key_size, sizeof(u32)); |
3716 |
++ __uint(value_size, sizeof(u32)); |
3717 |
++ __uint(max_entries, MAX_CPUS); |
3718 |
++} cpu_map SEC(".maps"); |
3719 |
+ |
3720 |
+ /* Common stats data record to keep userspace more simple */ |
3721 |
+ struct datarec { |
3722 |
+@@ -35,67 +35,67 @@ struct datarec { |
3723 |
+ /* Count RX packets, as XDP bpf_prog doesn't get direct TX-success |
3724 |
+ * feedback. Redirect TX errors can be caught via a tracepoint. |
3725 |
+ */ |
3726 |
+-struct bpf_map_def SEC("maps") rx_cnt = { |
3727 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
3728 |
+- .key_size = sizeof(u32), |
3729 |
+- .value_size = sizeof(struct datarec), |
3730 |
+- .max_entries = 1, |
3731 |
+-}; |
3732 |
++struct { |
3733 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
3734 |
++ __type(key, u32); |
3735 |
++ __type(value, struct datarec); |
3736 |
++ __uint(max_entries, 1); |
3737 |
++} rx_cnt SEC(".maps"); |
3738 |
+ |
3739 |
+ /* Used by trace point */ |
3740 |
+-struct bpf_map_def SEC("maps") redirect_err_cnt = { |
3741 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
3742 |
+- .key_size = sizeof(u32), |
3743 |
+- .value_size = sizeof(struct datarec), |
3744 |
+- .max_entries = 2, |
3745 |
++struct { |
3746 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
3747 |
++ __type(key, u32); |
3748 |
++ __type(value, struct datarec); |
3749 |
++ __uint(max_entries, 2); |
3750 |
+ /* TODO: have entries for all possible errno's */ |
3751 |
+-}; |
3752 |
++} redirect_err_cnt SEC(".maps"); |
3753 |
+ |
3754 |
+ /* Used by trace point */ |
3755 |
+-struct bpf_map_def SEC("maps") cpumap_enqueue_cnt = { |
3756 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
3757 |
+- .key_size = sizeof(u32), |
3758 |
+- .value_size = sizeof(struct datarec), |
3759 |
+- .max_entries = MAX_CPUS, |
3760 |
+-}; |
3761 |
++struct { |
3762 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
3763 |
++ __type(key, u32); |
3764 |
++ __type(value, struct datarec); |
3765 |
++ __uint(max_entries, MAX_CPUS); |
3766 |
++} cpumap_enqueue_cnt SEC(".maps"); |
3767 |
+ |
3768 |
+ /* Used by trace point */ |
3769 |
+-struct bpf_map_def SEC("maps") cpumap_kthread_cnt = { |
3770 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
3771 |
+- .key_size = sizeof(u32), |
3772 |
+- .value_size = sizeof(struct datarec), |
3773 |
+- .max_entries = 1, |
3774 |
+-}; |
3775 |
++struct { |
3776 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
3777 |
++ __type(key, u32); |
3778 |
++ __type(value, struct datarec); |
3779 |
++ __uint(max_entries, 1); |
3780 |
++} cpumap_kthread_cnt SEC(".maps"); |
3781 |
+ |
3782 |
+ /* Set of maps controlling available CPU, and for iterating through |
3783 |
+ * selectable redirect CPUs. |
3784 |
+ */ |
3785 |
+-struct bpf_map_def SEC("maps") cpus_available = { |
3786 |
+- .type = BPF_MAP_TYPE_ARRAY, |
3787 |
+- .key_size = sizeof(u32), |
3788 |
+- .value_size = sizeof(u32), |
3789 |
+- .max_entries = MAX_CPUS, |
3790 |
+-}; |
3791 |
+-struct bpf_map_def SEC("maps") cpus_count = { |
3792 |
+- .type = BPF_MAP_TYPE_ARRAY, |
3793 |
+- .key_size = sizeof(u32), |
3794 |
+- .value_size = sizeof(u32), |
3795 |
+- .max_entries = 1, |
3796 |
+-}; |
3797 |
+-struct bpf_map_def SEC("maps") cpus_iterator = { |
3798 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
3799 |
+- .key_size = sizeof(u32), |
3800 |
+- .value_size = sizeof(u32), |
3801 |
+- .max_entries = 1, |
3802 |
+-}; |
3803 |
++struct { |
3804 |
++ __uint(type, BPF_MAP_TYPE_ARRAY); |
3805 |
++ __type(key, u32); |
3806 |
++ __type(value, u32); |
3807 |
++ __uint(max_entries, MAX_CPUS); |
3808 |
++} cpus_available SEC(".maps"); |
3809 |
++struct { |
3810 |
++ __uint(type, BPF_MAP_TYPE_ARRAY); |
3811 |
++ __type(key, u32); |
3812 |
++ __type(value, u32); |
3813 |
++ __uint(max_entries, 1); |
3814 |
++} cpus_count SEC(".maps"); |
3815 |
++struct { |
3816 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
3817 |
++ __type(key, u32); |
3818 |
++ __type(value, u32); |
3819 |
++ __uint(max_entries, 1); |
3820 |
++} cpus_iterator SEC(".maps"); |
3821 |
+ |
3822 |
+ /* Used by trace point */ |
3823 |
+-struct bpf_map_def SEC("maps") exception_cnt = { |
3824 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
3825 |
+- .key_size = sizeof(u32), |
3826 |
+- .value_size = sizeof(struct datarec), |
3827 |
+- .max_entries = 1, |
3828 |
+-}; |
3829 |
++struct { |
3830 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
3831 |
++ __type(key, u32); |
3832 |
++ __type(value, struct datarec); |
3833 |
++ __uint(max_entries, 1); |
3834 |
++} exception_cnt SEC(".maps"); |
3835 |
+ |
3836 |
+ /* Helper parse functions */ |
3837 |
+ |
3838 |
+diff --git a/samples/bpf/xdp_redirect_kern.c b/samples/bpf/xdp_redirect_kern.c |
3839 |
+index 8abb151e385f..1f0b7d05abb2 100644 |
3840 |
+--- a/samples/bpf/xdp_redirect_kern.c |
3841 |
++++ b/samples/bpf/xdp_redirect_kern.c |
3842 |
+@@ -19,22 +19,22 @@ |
3843 |
+ #include <linux/ipv6.h> |
3844 |
+ #include "bpf_helpers.h" |
3845 |
+ |
3846 |
+-struct bpf_map_def SEC("maps") tx_port = { |
3847 |
+- .type = BPF_MAP_TYPE_ARRAY, |
3848 |
+- .key_size = sizeof(int), |
3849 |
+- .value_size = sizeof(int), |
3850 |
+- .max_entries = 1, |
3851 |
+-}; |
3852 |
++struct { |
3853 |
++ __uint(type, BPF_MAP_TYPE_ARRAY); |
3854 |
++ __type(key, int); |
3855 |
++ __type(value, int); |
3856 |
++ __uint(max_entries, 1); |
3857 |
++} tx_port SEC(".maps"); |
3858 |
+ |
3859 |
+ /* Count RX packets, as XDP bpf_prog doesn't get direct TX-success |
3860 |
+ * feedback. Redirect TX errors can be caught via a tracepoint. |
3861 |
+ */ |
3862 |
+-struct bpf_map_def SEC("maps") rxcnt = { |
3863 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
3864 |
+- .key_size = sizeof(u32), |
3865 |
+- .value_size = sizeof(long), |
3866 |
+- .max_entries = 1, |
3867 |
+-}; |
3868 |
++struct { |
3869 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
3870 |
++ __type(key, u32); |
3871 |
++ __type(value, long); |
3872 |
++ __uint(max_entries, 1); |
3873 |
++} rxcnt SEC(".maps"); |
3874 |
+ |
3875 |
+ static void swap_src_dst_mac(void *data) |
3876 |
+ { |
3877 |
+diff --git a/samples/bpf/xdp_redirect_map_kern.c b/samples/bpf/xdp_redirect_map_kern.c |
3878 |
+index 740a529ba84f..4631b484c432 100644 |
3879 |
+--- a/samples/bpf/xdp_redirect_map_kern.c |
3880 |
++++ b/samples/bpf/xdp_redirect_map_kern.c |
3881 |
+@@ -19,22 +19,22 @@ |
3882 |
+ #include <linux/ipv6.h> |
3883 |
+ #include "bpf_helpers.h" |
3884 |
+ |
3885 |
+-struct bpf_map_def SEC("maps") tx_port = { |
3886 |
+- .type = BPF_MAP_TYPE_DEVMAP, |
3887 |
+- .key_size = sizeof(int), |
3888 |
+- .value_size = sizeof(int), |
3889 |
+- .max_entries = 100, |
3890 |
+-}; |
3891 |
++struct { |
3892 |
++ __uint(type, BPF_MAP_TYPE_DEVMAP); |
3893 |
++ __uint(key_size, sizeof(int)); |
3894 |
++ __uint(value_size, sizeof(int)); |
3895 |
++ __uint(max_entries, 100); |
3896 |
++} tx_port SEC(".maps"); |
3897 |
+ |
3898 |
+ /* Count RX packets, as XDP bpf_prog doesn't get direct TX-success |
3899 |
+ * feedback. Redirect TX errors can be caught via a tracepoint. |
3900 |
+ */ |
3901 |
+-struct bpf_map_def SEC("maps") rxcnt = { |
3902 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
3903 |
+- .key_size = sizeof(u32), |
3904 |
+- .value_size = sizeof(long), |
3905 |
+- .max_entries = 1, |
3906 |
+-}; |
3907 |
++struct { |
3908 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
3909 |
++ __type(key, u32); |
3910 |
++ __type(value, long); |
3911 |
++ __uint(max_entries, 1); |
3912 |
++} rxcnt SEC(".maps"); |
3913 |
+ |
3914 |
+ static void swap_src_dst_mac(void *data) |
3915 |
+ { |
3916 |
+diff --git a/samples/bpf/xdp_router_ipv4_kern.c b/samples/bpf/xdp_router_ipv4_kern.c |
3917 |
+index 993f56bc7b9a..bf11efc8e949 100644 |
3918 |
+--- a/samples/bpf/xdp_router_ipv4_kern.c |
3919 |
++++ b/samples/bpf/xdp_router_ipv4_kern.c |
3920 |
+@@ -42,44 +42,44 @@ struct direct_map { |
3921 |
+ }; |
3922 |
+ |
3923 |
+ /* Map for trie implementation*/ |
3924 |
+-struct bpf_map_def SEC("maps") lpm_map = { |
3925 |
+- .type = BPF_MAP_TYPE_LPM_TRIE, |
3926 |
+- .key_size = 8, |
3927 |
+- .value_size = sizeof(struct trie_value), |
3928 |
+- .max_entries = 50, |
3929 |
+- .map_flags = BPF_F_NO_PREALLOC, |
3930 |
+-}; |
3931 |
++struct { |
3932 |
++ __uint(type, BPF_MAP_TYPE_LPM_TRIE); |
3933 |
++ __uint(key_size, 8); |
3934 |
++ __uint(value_size, sizeof(struct trie_value)); |
3935 |
++ __uint(max_entries, 50); |
3936 |
++ __uint(map_flags, BPF_F_NO_PREALLOC); |
3937 |
++} lpm_map SEC(".maps"); |
3938 |
+ |
3939 |
+ /* Map for counter*/ |
3940 |
+-struct bpf_map_def SEC("maps") rxcnt = { |
3941 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
3942 |
+- .key_size = sizeof(u32), |
3943 |
+- .value_size = sizeof(u64), |
3944 |
+- .max_entries = 256, |
3945 |
+-}; |
3946 |
++struct { |
3947 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
3948 |
++ __type(key, u32); |
3949 |
++ __type(value, u64); |
3950 |
++ __uint(max_entries, 256); |
3951 |
++} rxcnt SEC(".maps"); |
3952 |
+ |
3953 |
+ /* Map for ARP table*/ |
3954 |
+-struct bpf_map_def SEC("maps") arp_table = { |
3955 |
+- .type = BPF_MAP_TYPE_HASH, |
3956 |
+- .key_size = sizeof(__be32), |
3957 |
+- .value_size = sizeof(__be64), |
3958 |
+- .max_entries = 50, |
3959 |
+-}; |
3960 |
++struct { |
3961 |
++ __uint(type, BPF_MAP_TYPE_HASH); |
3962 |
++ __type(key, __be32); |
3963 |
++ __type(value, __be64); |
3964 |
++ __uint(max_entries, 50); |
3965 |
++} arp_table SEC(".maps"); |
3966 |
+ |
3967 |
+ /* Map to keep the exact match entries in the route table*/ |
3968 |
+-struct bpf_map_def SEC("maps") exact_match = { |
3969 |
+- .type = BPF_MAP_TYPE_HASH, |
3970 |
+- .key_size = sizeof(__be32), |
3971 |
+- .value_size = sizeof(struct direct_map), |
3972 |
+- .max_entries = 50, |
3973 |
+-}; |
3974 |
+- |
3975 |
+-struct bpf_map_def SEC("maps") tx_port = { |
3976 |
+- .type = BPF_MAP_TYPE_DEVMAP, |
3977 |
+- .key_size = sizeof(int), |
3978 |
+- .value_size = sizeof(int), |
3979 |
+- .max_entries = 100, |
3980 |
+-}; |
3981 |
++struct { |
3982 |
++ __uint(type, BPF_MAP_TYPE_HASH); |
3983 |
++ __type(key, __be32); |
3984 |
++ __type(value, struct direct_map); |
3985 |
++ __uint(max_entries, 50); |
3986 |
++} exact_match SEC(".maps"); |
3987 |
++ |
3988 |
++struct { |
3989 |
++ __uint(type, BPF_MAP_TYPE_DEVMAP); |
3990 |
++ __uint(key_size, sizeof(int)); |
3991 |
++ __uint(value_size, sizeof(int)); |
3992 |
++ __uint(max_entries, 100); |
3993 |
++} tx_port SEC(".maps"); |
3994 |
+ |
3995 |
+ /* Function to set source and destination mac of the packet */ |
3996 |
+ static inline void set_src_dst_mac(void *data, void *src, void *dst) |
3997 |
+diff --git a/samples/bpf/xdp_rxq_info_kern.c b/samples/bpf/xdp_rxq_info_kern.c |
3998 |
+index 222a83eed1cb..272d0f82a6b5 100644 |
3999 |
+--- a/samples/bpf/xdp_rxq_info_kern.c |
4000 |
++++ b/samples/bpf/xdp_rxq_info_kern.c |
4001 |
+@@ -23,12 +23,13 @@ enum cfg_options_flags { |
4002 |
+ READ_MEM = 0x1U, |
4003 |
+ SWAP_MAC = 0x2U, |
4004 |
+ }; |
4005 |
+-struct bpf_map_def SEC("maps") config_map = { |
4006 |
+- .type = BPF_MAP_TYPE_ARRAY, |
4007 |
+- .key_size = sizeof(int), |
4008 |
+- .value_size = sizeof(struct config), |
4009 |
+- .max_entries = 1, |
4010 |
+-}; |
4011 |
++ |
4012 |
++struct { |
4013 |
++ __uint(type, BPF_MAP_TYPE_ARRAY); |
4014 |
++ __type(key, int); |
4015 |
++ __type(value, struct config); |
4016 |
++ __uint(max_entries, 1); |
4017 |
++} config_map SEC(".maps"); |
4018 |
+ |
4019 |
+ /* Common stats data record (shared with userspace) */ |
4020 |
+ struct datarec { |
4021 |
+@@ -36,22 +37,22 @@ struct datarec { |
4022 |
+ __u64 issue; |
4023 |
+ }; |
4024 |
+ |
4025 |
+-struct bpf_map_def SEC("maps") stats_global_map = { |
4026 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
4027 |
+- .key_size = sizeof(u32), |
4028 |
+- .value_size = sizeof(struct datarec), |
4029 |
+- .max_entries = 1, |
4030 |
+-}; |
4031 |
++struct { |
4032 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
4033 |
++ __type(key, u32); |
4034 |
++ __type(value, struct datarec); |
4035 |
++ __uint(max_entries, 1); |
4036 |
++} stats_global_map SEC(".maps"); |
4037 |
+ |
4038 |
+ #define MAX_RXQs 64 |
4039 |
+ |
4040 |
+ /* Stats per rx_queue_index (per CPU) */ |
4041 |
+-struct bpf_map_def SEC("maps") rx_queue_index_map = { |
4042 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
4043 |
+- .key_size = sizeof(u32), |
4044 |
+- .value_size = sizeof(struct datarec), |
4045 |
+- .max_entries = MAX_RXQs + 1, |
4046 |
+-}; |
4047 |
++struct { |
4048 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
4049 |
++ __type(key, u32); |
4050 |
++ __type(value, struct datarec); |
4051 |
++ __uint(max_entries, MAX_RXQs + 1); |
4052 |
++} rx_queue_index_map SEC(".maps"); |
4053 |
+ |
4054 |
+ static __always_inline |
4055 |
+ void swap_src_dst_mac(void *data) |
4056 |
+diff --git a/samples/bpf/xdp_rxq_info_user.c b/samples/bpf/xdp_rxq_info_user.c |
4057 |
+index c7e4e45d824a..b88df17853b8 100644 |
4058 |
+--- a/samples/bpf/xdp_rxq_info_user.c |
4059 |
++++ b/samples/bpf/xdp_rxq_info_user.c |
4060 |
+@@ -489,9 +489,9 @@ int main(int argc, char **argv) |
4061 |
+ if (bpf_prog_load_xattr(&prog_load_attr, &obj, &prog_fd)) |
4062 |
+ return EXIT_FAIL; |
4063 |
+ |
4064 |
+- map = bpf_map__next(NULL, obj); |
4065 |
+- stats_global_map = bpf_map__next(map, obj); |
4066 |
+- rx_queue_index_map = bpf_map__next(stats_global_map, obj); |
4067 |
++ map = bpf_object__find_map_by_name(obj, "config_map"); |
4068 |
++ stats_global_map = bpf_object__find_map_by_name(obj, "stats_global_map"); |
4069 |
++ rx_queue_index_map = bpf_object__find_map_by_name(obj, "rx_queue_index_map"); |
4070 |
+ if (!map || !stats_global_map || !rx_queue_index_map) { |
4071 |
+ printf("finding a map in obj file failed\n"); |
4072 |
+ return EXIT_FAIL; |
4073 |
+diff --git a/samples/bpf/xdp_tx_iptunnel_kern.c b/samples/bpf/xdp_tx_iptunnel_kern.c |
4074 |
+index 0f4f6e8c8611..6db450a5c1ca 100644 |
4075 |
+--- a/samples/bpf/xdp_tx_iptunnel_kern.c |
4076 |
++++ b/samples/bpf/xdp_tx_iptunnel_kern.c |
4077 |
+@@ -19,19 +19,19 @@ |
4078 |
+ #include "bpf_helpers.h" |
4079 |
+ #include "xdp_tx_iptunnel_common.h" |
4080 |
+ |
4081 |
+-struct bpf_map_def SEC("maps") rxcnt = { |
4082 |
+- .type = BPF_MAP_TYPE_PERCPU_ARRAY, |
4083 |
+- .key_size = sizeof(__u32), |
4084 |
+- .value_size = sizeof(__u64), |
4085 |
+- .max_entries = 256, |
4086 |
+-}; |
4087 |
+- |
4088 |
+-struct bpf_map_def SEC("maps") vip2tnl = { |
4089 |
+- .type = BPF_MAP_TYPE_HASH, |
4090 |
+- .key_size = sizeof(struct vip), |
4091 |
+- .value_size = sizeof(struct iptnl_info), |
4092 |
+- .max_entries = MAX_IPTNL_ENTRIES, |
4093 |
+-}; |
4094 |
++struct { |
4095 |
++ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
4096 |
++ __type(key, __u32); |
4097 |
++ __type(value, __u64); |
4098 |
++ __uint(max_entries, 256); |
4099 |
++} rxcnt SEC(".maps"); |
4100 |
++ |
4101 |
++struct { |
4102 |
++ __uint(type, BPF_MAP_TYPE_HASH); |
4103 |
++ __type(key, struct vip); |
4104 |
++ __type(value, struct iptnl_info); |
4105 |
++ __uint(max_entries, MAX_IPTNL_ENTRIES); |
4106 |
++} vip2tnl SEC(".maps"); |
4107 |
+ |
4108 |
+ static __always_inline void count_tx(u32 protocol) |
4109 |
+ { |
4110 |
+diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh |
4111 |
+index 2998ddb323e3..436379940356 100755 |
4112 |
+--- a/scripts/link-vmlinux.sh |
4113 |
++++ b/scripts/link-vmlinux.sh |
4114 |
+@@ -127,8 +127,9 @@ gen_btf() |
4115 |
+ cut -d, -f1 | cut -d' ' -f2) |
4116 |
+ bin_format=$(LANG=C ${OBJDUMP} -f ${1} | grep 'file format' | \ |
4117 |
+ awk '{print $4}') |
4118 |
+- ${OBJCOPY} --set-section-flags .BTF=alloc -O binary \ |
4119 |
+- --only-section=.BTF ${1} .btf.vmlinux.bin 2>/dev/null |
4120 |
++ ${OBJCOPY} --change-section-address .BTF=0 \ |
4121 |
++ --set-section-flags .BTF=alloc -O binary \ |
4122 |
++ --only-section=.BTF ${1} .btf.vmlinux.bin |
4123 |
+ ${OBJCOPY} -I binary -O ${bin_format} -B ${bin_arch} \ |
4124 |
+ --rename-section .data=.BTF .btf.vmlinux.bin ${2} |
4125 |
+ } |
4126 |
+diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c |
4127 |
+index cbb933532981..9d0485959308 100644 |
4128 |
+--- a/tools/lib/bpf/bpf.c |
4129 |
++++ b/tools/lib/bpf/bpf.c |
4130 |
+@@ -189,7 +189,7 @@ static void * |
4131 |
+ alloc_zero_tailing_info(const void *orecord, __u32 cnt, |
4132 |
+ __u32 actual_rec_size, __u32 expected_rec_size) |
4133 |
+ { |
4134 |
+- __u64 info_len = actual_rec_size * cnt; |
4135 |
++ __u64 info_len = (__u64)actual_rec_size * cnt; |
4136 |
+ void *info, *nrecord; |
4137 |
+ int i; |
4138 |
+ |
4139 |
+diff --git a/tools/lib/bpf/bpf_prog_linfo.c b/tools/lib/bpf/bpf_prog_linfo.c |
4140 |
+index 8c67561c93b0..3ed1a27b5f7c 100644 |
4141 |
+--- a/tools/lib/bpf/bpf_prog_linfo.c |
4142 |
++++ b/tools/lib/bpf/bpf_prog_linfo.c |
4143 |
+@@ -101,6 +101,7 @@ struct bpf_prog_linfo *bpf_prog_linfo__new(const struct bpf_prog_info *info) |
4144 |
+ { |
4145 |
+ struct bpf_prog_linfo *prog_linfo; |
4146 |
+ __u32 nr_linfo, nr_jited_func; |
4147 |
++ __u64 data_sz; |
4148 |
+ |
4149 |
+ nr_linfo = info->nr_line_info; |
4150 |
+ |
4151 |
+@@ -122,11 +123,11 @@ struct bpf_prog_linfo *bpf_prog_linfo__new(const struct bpf_prog_info *info) |
4152 |
+ /* Copy xlated line_info */ |
4153 |
+ prog_linfo->nr_linfo = nr_linfo; |
4154 |
+ prog_linfo->rec_size = info->line_info_rec_size; |
4155 |
+- prog_linfo->raw_linfo = malloc(nr_linfo * prog_linfo->rec_size); |
4156 |
++ data_sz = (__u64)nr_linfo * prog_linfo->rec_size; |
4157 |
++ prog_linfo->raw_linfo = malloc(data_sz); |
4158 |
+ if (!prog_linfo->raw_linfo) |
4159 |
+ goto err_free; |
4160 |
+- memcpy(prog_linfo->raw_linfo, (void *)(long)info->line_info, |
4161 |
+- nr_linfo * prog_linfo->rec_size); |
4162 |
++ memcpy(prog_linfo->raw_linfo, (void *)(long)info->line_info, data_sz); |
4163 |
+ |
4164 |
+ nr_jited_func = info->nr_jited_ksyms; |
4165 |
+ if (!nr_jited_func || |
4166 |
+@@ -142,13 +143,12 @@ struct bpf_prog_linfo *bpf_prog_linfo__new(const struct bpf_prog_info *info) |
4167 |
+ /* Copy jited_line_info */ |
4168 |
+ prog_linfo->nr_jited_func = nr_jited_func; |
4169 |
+ prog_linfo->jited_rec_size = info->jited_line_info_rec_size; |
4170 |
+- prog_linfo->raw_jited_linfo = malloc(nr_linfo * |
4171 |
+- prog_linfo->jited_rec_size); |
4172 |
++ data_sz = (__u64)nr_linfo * prog_linfo->jited_rec_size; |
4173 |
++ prog_linfo->raw_jited_linfo = malloc(data_sz); |
4174 |
+ if (!prog_linfo->raw_jited_linfo) |
4175 |
+ goto err_free; |
4176 |
+ memcpy(prog_linfo->raw_jited_linfo, |
4177 |
+- (void *)(long)info->jited_line_info, |
4178 |
+- nr_linfo * prog_linfo->jited_rec_size); |
4179 |
++ (void *)(long)info->jited_line_info, data_sz); |
4180 |
+ |
4181 |
+ /* Number of jited_line_info per jited func */ |
4182 |
+ prog_linfo->nr_jited_linfo_per_func = malloc(nr_jited_func * |
4183 |
+diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c |
4184 |
+index 1aa189a9112a..d606a358480d 100644 |
4185 |
+--- a/tools/lib/bpf/btf.c |
4186 |
++++ b/tools/lib/bpf/btf.c |
4187 |
+@@ -269,10 +269,9 @@ __s64 btf__resolve_size(const struct btf *btf, __u32 type_id) |
4188 |
+ t = btf__type_by_id(btf, type_id); |
4189 |
+ } |
4190 |
+ |
4191 |
++done: |
4192 |
+ if (size < 0) |
4193 |
+ return -EINVAL; |
4194 |
+- |
4195 |
+-done: |
4196 |
+ if (nelems && size > UINT32_MAX / nelems) |
4197 |
+ return -E2BIG; |
4198 |
+ |
4199 |
+diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c |
4200 |
+index a267cd0c0ce2..d98838c5820c 100644 |
4201 |
+--- a/tools/lib/bpf/libbpf.c |
4202 |
++++ b/tools/lib/bpf/libbpf.c |
4203 |
+@@ -3220,6 +3220,7 @@ bpf_program__reloc_text(struct bpf_program *prog, struct bpf_object *obj, |
4204 |
+ pr_warning("oom in prog realloc\n"); |
4205 |
+ return -ENOMEM; |
4206 |
+ } |
4207 |
++ prog->insns = new_insn; |
4208 |
+ |
4209 |
+ if (obj->btf_ext) { |
4210 |
+ err = bpf_program_reloc_btf_ext(prog, obj, |
4211 |
+@@ -3231,7 +3232,6 @@ bpf_program__reloc_text(struct bpf_program *prog, struct bpf_object *obj, |
4212 |
+ |
4213 |
+ memcpy(new_insn + prog->insns_cnt, text->insns, |
4214 |
+ text->insns_cnt * sizeof(*insn)); |
4215 |
+- prog->insns = new_insn; |
4216 |
+ prog->main_prog_cnt = prog->insns_cnt; |
4217 |
+ prog->insns_cnt = new_cnt; |
4218 |
+ pr_debug("added %zd insn from %s to prog %s\n", |
4219 |
+diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c |
4220 |
+index 70f9e10de286..0c7386b0e42e 100644 |
4221 |
+--- a/tools/lib/bpf/xsk.c |
4222 |
++++ b/tools/lib/bpf/xsk.c |
4223 |
+@@ -73,6 +73,21 @@ struct xsk_nl_info { |
4224 |
+ int fd; |
4225 |
+ }; |
4226 |
+ |
4227 |
++/* Up until and including Linux 5.3 */ |
4228 |
++struct xdp_ring_offset_v1 { |
4229 |
++ __u64 producer; |
4230 |
++ __u64 consumer; |
4231 |
++ __u64 desc; |
4232 |
++}; |
4233 |
++ |
4234 |
++/* Up until and including Linux 5.3 */ |
4235 |
++struct xdp_mmap_offsets_v1 { |
4236 |
++ struct xdp_ring_offset_v1 rx; |
4237 |
++ struct xdp_ring_offset_v1 tx; |
4238 |
++ struct xdp_ring_offset_v1 fr; |
4239 |
++ struct xdp_ring_offset_v1 cr; |
4240 |
++}; |
4241 |
++ |
4242 |
+ int xsk_umem__fd(const struct xsk_umem *umem) |
4243 |
+ { |
4244 |
+ return umem ? umem->fd : -EINVAL; |
4245 |
+@@ -133,6 +148,58 @@ static int xsk_set_xdp_socket_config(struct xsk_socket_config *cfg, |
4246 |
+ return 0; |
4247 |
+ } |
4248 |
+ |
4249 |
++static void xsk_mmap_offsets_v1(struct xdp_mmap_offsets *off) |
4250 |
++{ |
4251 |
++ struct xdp_mmap_offsets_v1 off_v1; |
4252 |
++ |
4253 |
++ /* getsockopt on a kernel <= 5.3 has no flags fields. |
4254 |
++ * Copy over the offsets to the correct places in the >=5.4 format |
4255 |
++ * and put the flags where they would have been on that kernel. |
4256 |
++ */ |
4257 |
++ memcpy(&off_v1, off, sizeof(off_v1)); |
4258 |
++ |
4259 |
++ off->rx.producer = off_v1.rx.producer; |
4260 |
++ off->rx.consumer = off_v1.rx.consumer; |
4261 |
++ off->rx.desc = off_v1.rx.desc; |
4262 |
++ off->rx.flags = off_v1.rx.consumer + sizeof(__u32); |
4263 |
++ |
4264 |
++ off->tx.producer = off_v1.tx.producer; |
4265 |
++ off->tx.consumer = off_v1.tx.consumer; |
4266 |
++ off->tx.desc = off_v1.tx.desc; |
4267 |
++ off->tx.flags = off_v1.tx.consumer + sizeof(__u32); |
4268 |
++ |
4269 |
++ off->fr.producer = off_v1.fr.producer; |
4270 |
++ off->fr.consumer = off_v1.fr.consumer; |
4271 |
++ off->fr.desc = off_v1.fr.desc; |
4272 |
++ off->fr.flags = off_v1.fr.consumer + sizeof(__u32); |
4273 |
++ |
4274 |
++ off->cr.producer = off_v1.cr.producer; |
4275 |
++ off->cr.consumer = off_v1.cr.consumer; |
4276 |
++ off->cr.desc = off_v1.cr.desc; |
4277 |
++ off->cr.flags = off_v1.cr.consumer + sizeof(__u32); |
4278 |
++} |
4279 |
++ |
4280 |
++static int xsk_get_mmap_offsets(int fd, struct xdp_mmap_offsets *off) |
4281 |
++{ |
4282 |
++ socklen_t optlen; |
4283 |
++ int err; |
4284 |
++ |
4285 |
++ optlen = sizeof(*off); |
4286 |
++ err = getsockopt(fd, SOL_XDP, XDP_MMAP_OFFSETS, off, &optlen); |
4287 |
++ if (err) |
4288 |
++ return err; |
4289 |
++ |
4290 |
++ if (optlen == sizeof(*off)) |
4291 |
++ return 0; |
4292 |
++ |
4293 |
++ if (optlen == sizeof(struct xdp_mmap_offsets_v1)) { |
4294 |
++ xsk_mmap_offsets_v1(off); |
4295 |
++ return 0; |
4296 |
++ } |
4297 |
++ |
4298 |
++ return -EINVAL; |
4299 |
++} |
4300 |
++ |
4301 |
+ int xsk_umem__create_v0_0_4(struct xsk_umem **umem_ptr, void *umem_area, |
4302 |
+ __u64 size, struct xsk_ring_prod *fill, |
4303 |
+ struct xsk_ring_cons *comp, |
4304 |
+@@ -141,7 +208,6 @@ int xsk_umem__create_v0_0_4(struct xsk_umem **umem_ptr, void *umem_area, |
4305 |
+ struct xdp_mmap_offsets off; |
4306 |
+ struct xdp_umem_reg mr; |
4307 |
+ struct xsk_umem *umem; |
4308 |
+- socklen_t optlen; |
4309 |
+ void *map; |
4310 |
+ int err; |
4311 |
+ |
4312 |
+@@ -190,8 +256,7 @@ int xsk_umem__create_v0_0_4(struct xsk_umem **umem_ptr, void *umem_area, |
4313 |
+ goto out_socket; |
4314 |
+ } |
4315 |
+ |
4316 |
+- optlen = sizeof(off); |
4317 |
+- err = getsockopt(umem->fd, SOL_XDP, XDP_MMAP_OFFSETS, &off, &optlen); |
4318 |
++ err = xsk_get_mmap_offsets(umem->fd, &off); |
4319 |
+ if (err) { |
4320 |
+ err = -errno; |
4321 |
+ goto out_socket; |
4322 |
+@@ -499,7 +564,6 @@ int xsk_socket__create(struct xsk_socket **xsk_ptr, const char *ifname, |
4323 |
+ struct sockaddr_xdp sxdp = {}; |
4324 |
+ struct xdp_mmap_offsets off; |
4325 |
+ struct xsk_socket *xsk; |
4326 |
+- socklen_t optlen; |
4327 |
+ int err; |
4328 |
+ |
4329 |
+ if (!umem || !xsk_ptr || !rx || !tx) |
4330 |
+@@ -558,8 +622,7 @@ int xsk_socket__create(struct xsk_socket **xsk_ptr, const char *ifname, |
4331 |
+ } |
4332 |
+ } |
4333 |
+ |
4334 |
+- optlen = sizeof(off); |
4335 |
+- err = getsockopt(xsk->fd, SOL_XDP, XDP_MMAP_OFFSETS, &off, &optlen); |
4336 |
++ err = xsk_get_mmap_offsets(xsk->fd, &off); |
4337 |
+ if (err) { |
4338 |
+ err = -errno; |
4339 |
+ goto out_socket; |
4340 |
+@@ -645,7 +708,6 @@ out_xsk_alloc: |
4341 |
+ int xsk_umem__delete(struct xsk_umem *umem) |
4342 |
+ { |
4343 |
+ struct xdp_mmap_offsets off; |
4344 |
+- socklen_t optlen; |
4345 |
+ int err; |
4346 |
+ |
4347 |
+ if (!umem) |
4348 |
+@@ -654,8 +716,7 @@ int xsk_umem__delete(struct xsk_umem *umem) |
4349 |
+ if (umem->refcount) |
4350 |
+ return -EBUSY; |
4351 |
+ |
4352 |
+- optlen = sizeof(off); |
4353 |
+- err = getsockopt(umem->fd, SOL_XDP, XDP_MMAP_OFFSETS, &off, &optlen); |
4354 |
++ err = xsk_get_mmap_offsets(umem->fd, &off); |
4355 |
+ if (!err) { |
4356 |
+ munmap(umem->fill->ring - off.fr.desc, |
4357 |
+ off.fr.desc + umem->config.fill_size * sizeof(__u64)); |
4358 |
+@@ -673,7 +734,6 @@ void xsk_socket__delete(struct xsk_socket *xsk) |
4359 |
+ { |
4360 |
+ size_t desc_sz = sizeof(struct xdp_desc); |
4361 |
+ struct xdp_mmap_offsets off; |
4362 |
+- socklen_t optlen; |
4363 |
+ int err; |
4364 |
+ |
4365 |
+ if (!xsk) |
4366 |
+@@ -684,8 +744,7 @@ void xsk_socket__delete(struct xsk_socket *xsk) |
4367 |
+ close(xsk->prog_fd); |
4368 |
+ } |
4369 |
+ |
4370 |
+- optlen = sizeof(off); |
4371 |
+- err = getsockopt(xsk->fd, SOL_XDP, XDP_MMAP_OFFSETS, &off, &optlen); |
4372 |
++ err = xsk_get_mmap_offsets(xsk->fd, &off); |
4373 |
+ if (!err) { |
4374 |
+ if (xsk->rx) { |
4375 |
+ munmap(xsk->rx->ring - off.rx.desc, |
4376 |
+diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c |
4377 |
+index 888814df758d..ea277ce63a46 100644 |
4378 |
+--- a/tools/perf/util/machine.c |
4379 |
++++ b/tools/perf/util/machine.c |
4380 |
+@@ -767,24 +767,6 @@ int machine__process_ksymbol(struct machine *machine __maybe_unused, |
4381 |
+ return machine__process_ksymbol_register(machine, event, sample); |
4382 |
+ } |
4383 |
+ |
4384 |
+-static void dso__adjust_kmod_long_name(struct dso *dso, const char *filename) |
4385 |
+-{ |
4386 |
+- const char *dup_filename; |
4387 |
+- |
4388 |
+- if (!filename || !dso || !dso->long_name) |
4389 |
+- return; |
4390 |
+- if (dso->long_name[0] != '[') |
4391 |
+- return; |
4392 |
+- if (!strchr(filename, '/')) |
4393 |
+- return; |
4394 |
+- |
4395 |
+- dup_filename = strdup(filename); |
4396 |
+- if (!dup_filename) |
4397 |
+- return; |
4398 |
+- |
4399 |
+- dso__set_long_name(dso, dup_filename, true); |
4400 |
+-} |
4401 |
+- |
4402 |
+ struct map *machine__findnew_module_map(struct machine *machine, u64 start, |
4403 |
+ const char *filename) |
4404 |
+ { |
4405 |
+@@ -796,15 +778,8 @@ struct map *machine__findnew_module_map(struct machine *machine, u64 start, |
4406 |
+ return NULL; |
4407 |
+ |
4408 |
+ map = map_groups__find_by_name(&machine->kmaps, m.name); |
4409 |
+- if (map) { |
4410 |
+- /* |
4411 |
+- * If the map's dso is an offline module, give dso__load() |
4412 |
+- * a chance to find the file path of that module by fixing |
4413 |
+- * long_name. |
4414 |
+- */ |
4415 |
+- dso__adjust_kmod_long_name(map->dso, filename); |
4416 |
++ if (map) |
4417 |
+ goto out; |
4418 |
+- } |
4419 |
+ |
4420 |
+ dso = machine__findnew_module_dso(machine, &m, filename); |
4421 |
+ if (dso == NULL) |
4422 |
+diff --git a/tools/testing/selftests/cgroup/test_freezer.c b/tools/testing/selftests/cgroup/test_freezer.c |
4423 |
+index 0fc1b6d4b0f9..62a27ab3c2f3 100644 |
4424 |
+--- a/tools/testing/selftests/cgroup/test_freezer.c |
4425 |
++++ b/tools/testing/selftests/cgroup/test_freezer.c |
4426 |
+@@ -72,6 +72,7 @@ static int cg_prepare_for_wait(const char *cgroup) |
4427 |
+ if (ret == -1) { |
4428 |
+ debug("Error: inotify_add_watch() failed\n"); |
4429 |
+ close(fd); |
4430 |
++ fd = -1; |
4431 |
+ } |
4432 |
+ |
4433 |
+ return fd; |
4434 |
+diff --git a/tools/testing/selftests/gen_kselftest_tar.sh b/tools/testing/selftests/gen_kselftest_tar.sh |
4435 |
+index a27e2eec3586..8b2b6088540d 100755 |
4436 |
+--- a/tools/testing/selftests/gen_kselftest_tar.sh |
4437 |
++++ b/tools/testing/selftests/gen_kselftest_tar.sh |
4438 |
+@@ -38,16 +38,21 @@ main() |
4439 |
+ esac |
4440 |
+ fi |
4441 |
+ |
4442 |
+- install_dir=./kselftest |
4443 |
++ # Create working directory. |
4444 |
++ dest=`pwd` |
4445 |
++ install_work="$dest"/kselftest_install |
4446 |
++ install_name=kselftest |
4447 |
++ install_dir="$install_work"/"$install_name" |
4448 |
++ mkdir -p "$install_dir" |
4449 |
+ |
4450 |
+-# Run install using INSTALL_KSFT_PATH override to generate install |
4451 |
+-# directory |
4452 |
+-./kselftest_install.sh |
4453 |
+-tar $copts kselftest${ext} $install_dir |
4454 |
+-echo "Kselftest archive kselftest${ext} created!" |
4455 |
++ # Run install using INSTALL_KSFT_PATH override to generate install |
4456 |
++ # directory |
4457 |
++ ./kselftest_install.sh "$install_dir" |
4458 |
++ (cd "$install_work"; tar $copts "$dest"/kselftest${ext} $install_name) |
4459 |
++ echo "Kselftest archive kselftest${ext} created!" |
4460 |
+ |
4461 |
+-# clean up install directory |
4462 |
+-rm -rf kselftest |
4463 |
++ # clean up top-level install work directory |
4464 |
++ rm -rf "$install_work" |
4465 |
+ } |
4466 |
+ |
4467 |
+ main "$@" |
4468 |
+diff --git a/tools/testing/selftests/kselftest_install.sh b/tools/testing/selftests/kselftest_install.sh |
4469 |
+index e2e1911d62d5..407af7da7037 100755 |
4470 |
+--- a/tools/testing/selftests/kselftest_install.sh |
4471 |
++++ b/tools/testing/selftests/kselftest_install.sh |
4472 |
+@@ -6,30 +6,30 @@ |
4473 |
+ # Author: Shuah Khan <shuahkh@×××××××××××.com> |
4474 |
+ # Copyright (C) 2015 Samsung Electronics Co., Ltd. |
4475 |
+ |
4476 |
+-install_loc=`pwd` |
4477 |
+- |
4478 |
+ main() |
4479 |
+ { |
4480 |
+- if [ $(basename $install_loc) != "selftests" ]; then |
4481 |
++ base_dir=`pwd` |
4482 |
++ install_dir="$base_dir"/kselftest_install |
4483 |
++ |
4484 |
++ # Make sure we're in the selftests top-level directory. |
4485 |
++ if [ $(basename "$base_dir") != "selftests" ]; then |
4486 |
+ echo "$0: Please run it in selftests directory ..." |
4487 |
+ exit 1; |
4488 |
+ fi |
4489 |
++ |
4490 |
++ # Only allow installation into an existing location. |
4491 |
+ if [ "$#" -eq 0 ]; then |
4492 |
+- echo "$0: Installing in default location - $install_loc ..." |
4493 |
++ echo "$0: Installing in default location - $install_dir ..." |
4494 |
+ elif [ ! -d "$1" ]; then |
4495 |
+ echo "$0: $1 doesn't exist!!" |
4496 |
+ exit 1; |
4497 |
+ else |
4498 |
+- install_loc=$1 |
4499 |
+- echo "$0: Installing in specified location - $install_loc ..." |
4500 |
++ install_dir="$1" |
4501 |
++ echo "$0: Installing in specified location - $install_dir ..." |
4502 |
+ fi |
4503 |
+ |
4504 |
+- install_dir=$install_loc/kselftest_install |
4505 |
+- |
4506 |
+-# Create install directory |
4507 |
+- mkdir -p $install_dir |
4508 |
+-# Build tests |
4509 |
+- KSFT_INSTALL_PATH=$install_dir make install |
4510 |
++ # Build tests |
4511 |
++ KSFT_INSTALL_PATH="$install_dir" make install |
4512 |
+ } |
4513 |
+ |
4514 |
+ main "$@" |