1 |
commit: 55290dfd472ad243ed25eea59e4fc6a24470ee6c |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 1 17:04:13 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 1 17:04:13 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=55290dfd |
7 |
|
8 |
Linux patch 4.19.241 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1240_linux-4.19.241.patch | 486 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 490 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 72dcbc8d..467db0c8 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -999,6 +999,10 @@ Patch: 1239_linux-4.19.240.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.19.240 |
23 |
|
24 |
+Patch: 1240_linux-4.19.241.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.19.241 |
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/1240_linux-4.19.241.patch b/1240_linux-4.19.241.patch |
33 |
new file mode 100644 |
34 |
index 00000000..3d258971 |
35 |
--- /dev/null |
36 |
+++ b/1240_linux-4.19.241.patch |
37 |
@@ -0,0 +1,486 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 546e52f8a05fa..58fb76d1d7d38 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 19 |
46 |
+-SUBLEVEL = 240 |
47 |
++SUBLEVEL = 241 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = "People's Front" |
50 |
+ |
51 |
+diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c |
52 |
+index 9cfd3ac027b71..7fc0806bbdc91 100644 |
53 |
+--- a/arch/ia64/kernel/kprobes.c |
54 |
++++ b/arch/ia64/kernel/kprobes.c |
55 |
+@@ -409,10 +409,83 @@ static void kretprobe_trampoline(void) |
56 |
+ { |
57 |
+ } |
58 |
+ |
59 |
++/* |
60 |
++ * At this point the target function has been tricked into |
61 |
++ * returning into our trampoline. Lookup the associated instance |
62 |
++ * and then: |
63 |
++ * - call the handler function |
64 |
++ * - cleanup by marking the instance as unused |
65 |
++ * - long jump back to the original return address |
66 |
++ */ |
67 |
+ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) |
68 |
+ { |
69 |
+- regs->cr_iip = __kretprobe_trampoline_handler(regs, |
70 |
+- dereference_function_descriptor(kretprobe_trampoline), NULL); |
71 |
++ struct kretprobe_instance *ri = NULL; |
72 |
++ struct hlist_head *head, empty_rp; |
73 |
++ struct hlist_node *tmp; |
74 |
++ unsigned long flags, orig_ret_address = 0; |
75 |
++ unsigned long trampoline_address = |
76 |
++ (unsigned long)dereference_function_descriptor(kretprobe_trampoline); |
77 |
++ |
78 |
++ INIT_HLIST_HEAD(&empty_rp); |
79 |
++ kretprobe_hash_lock(current, &head, &flags); |
80 |
++ |
81 |
++ /* |
82 |
++ * It is possible to have multiple instances associated with a given |
83 |
++ * task either because an multiple functions in the call path |
84 |
++ * have a return probe installed on them, and/or more than one return |
85 |
++ * return probe was registered for a target function. |
86 |
++ * |
87 |
++ * We can handle this because: |
88 |
++ * - instances are always inserted at the head of the list |
89 |
++ * - when multiple return probes are registered for the same |
90 |
++ * function, the first instance's ret_addr will point to the |
91 |
++ * real return address, and all the rest will point to |
92 |
++ * kretprobe_trampoline |
93 |
++ */ |
94 |
++ hlist_for_each_entry_safe(ri, tmp, head, hlist) { |
95 |
++ if (ri->task != current) |
96 |
++ /* another task is sharing our hash bucket */ |
97 |
++ continue; |
98 |
++ |
99 |
++ orig_ret_address = (unsigned long)ri->ret_addr; |
100 |
++ if (orig_ret_address != trampoline_address) |
101 |
++ /* |
102 |
++ * This is the real return address. Any other |
103 |
++ * instances associated with this task are for |
104 |
++ * other calls deeper on the call stack |
105 |
++ */ |
106 |
++ break; |
107 |
++ } |
108 |
++ |
109 |
++ regs->cr_iip = orig_ret_address; |
110 |
++ |
111 |
++ hlist_for_each_entry_safe(ri, tmp, head, hlist) { |
112 |
++ if (ri->task != current) |
113 |
++ /* another task is sharing our hash bucket */ |
114 |
++ continue; |
115 |
++ |
116 |
++ if (ri->rp && ri->rp->handler) |
117 |
++ ri->rp->handler(ri, regs); |
118 |
++ |
119 |
++ orig_ret_address = (unsigned long)ri->ret_addr; |
120 |
++ recycle_rp_inst(ri, &empty_rp); |
121 |
++ |
122 |
++ if (orig_ret_address != trampoline_address) |
123 |
++ /* |
124 |
++ * This is the real return address. Any other |
125 |
++ * instances associated with this task are for |
126 |
++ * other calls deeper on the call stack |
127 |
++ */ |
128 |
++ break; |
129 |
++ } |
130 |
++ kretprobe_assert(ri, orig_ret_address, trampoline_address); |
131 |
++ |
132 |
++ kretprobe_hash_unlock(current, &flags); |
133 |
++ |
134 |
++ hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) { |
135 |
++ hlist_del(&ri->hlist); |
136 |
++ kfree(ri); |
137 |
++ } |
138 |
+ /* |
139 |
+ * By returning a non-zero value, we are telling |
140 |
+ * kprobe_handler() that we don't want the post_handler |
141 |
+@@ -425,7 +498,6 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri, |
142 |
+ struct pt_regs *regs) |
143 |
+ { |
144 |
+ ri->ret_addr = (kprobe_opcode_t *)regs->b0; |
145 |
+- ri->fp = NULL; |
146 |
+ |
147 |
+ /* Replace the return addr with trampoline addr */ |
148 |
+ regs->b0 = (unsigned long)dereference_function_descriptor(kretprobe_trampoline); |
149 |
+diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h |
150 |
+index 35fb5b11955a0..4fdae1c182df8 100644 |
151 |
+--- a/arch/powerpc/include/asm/exception-64s.h |
152 |
++++ b/arch/powerpc/include/asm/exception-64s.h |
153 |
+@@ -48,11 +48,12 @@ |
154 |
+ #define EX_CCR 52 |
155 |
+ #define EX_CFAR 56 |
156 |
+ #define EX_PPR 64 |
157 |
++#define EX_LR 72 |
158 |
+ #if defined(CONFIG_RELOCATABLE) |
159 |
+-#define EX_CTR 72 |
160 |
+-#define EX_SIZE 10 /* size in u64 units */ |
161 |
++#define EX_CTR 80 |
162 |
++#define EX_SIZE 11 /* size in u64 units */ |
163 |
+ #else |
164 |
+-#define EX_SIZE 9 /* size in u64 units */ |
165 |
++#define EX_SIZE 10 /* size in u64 units */ |
166 |
+ #endif |
167 |
+ |
168 |
+ /* |
169 |
+@@ -60,14 +61,6 @@ |
170 |
+ */ |
171 |
+ #define MAX_MCE_DEPTH 4 |
172 |
+ |
173 |
+-/* |
174 |
+- * EX_LR is only used in EXSLB and where it does not overlap with EX_DAR |
175 |
+- * EX_CCR similarly with DSISR, but being 4 byte registers there is a hole |
176 |
+- * in the save area so it's not necessary to overlap them. Could be used |
177 |
+- * for future savings though if another 4 byte register was to be saved. |
178 |
+- */ |
179 |
+-#define EX_LR EX_DAR |
180 |
+- |
181 |
+ /* |
182 |
+ * EX_R3 is only used by the bad_stack handler. bad_stack reloads and |
183 |
+ * saves DAR from SPRN_DAR, and EX_DAR is not used. So EX_R3 can overlap |
184 |
+@@ -243,10 +236,22 @@ |
185 |
+ * PPR save/restore macros used in exceptions_64s.S |
186 |
+ * Used for P7 or later processors |
187 |
+ */ |
188 |
+-#define SAVE_PPR(area, ra, rb) \ |
189 |
++#define SAVE_PPR(area, ra) \ |
190 |
++BEGIN_FTR_SECTION_NESTED(940) \ |
191 |
++ ld ra,area+EX_PPR(r13); /* Read PPR from paca */ \ |
192 |
++ std ra,RESULT(r1); /* Store PPR in RESULT for now */ \ |
193 |
++END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,940) |
194 |
++ |
195 |
++/* |
196 |
++ * This is called after we are finished accessing 'area', so we can now take |
197 |
++ * SLB faults accessing the thread struct, which will use PACA_EXSLB area. |
198 |
++ * This is required because the large_addr_slb handler uses EXSLB and it also |
199 |
++ * uses the common exception macros including this PPR saving. |
200 |
++ */ |
201 |
++#define MOVE_PPR_TO_THREAD(ra, rb) \ |
202 |
+ BEGIN_FTR_SECTION_NESTED(940) \ |
203 |
+ ld ra,PACACURRENT(r13); \ |
204 |
+- ld rb,area+EX_PPR(r13); /* Read PPR from paca */ \ |
205 |
++ ld rb,RESULT(r1); /* Read PPR from stack */ \ |
206 |
+ std rb,TASKTHREADPPR(ra); \ |
207 |
+ END_FTR_SECTION_NESTED(CPU_FTR_HAS_PPR,CPU_FTR_HAS_PPR,940) |
208 |
+ |
209 |
+@@ -515,9 +520,11 @@ END_FTR_SECTION_NESTED(ftr,ftr,943) |
210 |
+ 3: EXCEPTION_PROLOG_COMMON_1(); \ |
211 |
+ beq 4f; /* if from kernel mode */ \ |
212 |
+ ACCOUNT_CPU_USER_ENTRY(r13, r9, r10); \ |
213 |
+- SAVE_PPR(area, r9, r10); \ |
214 |
++ SAVE_PPR(area, r9); \ |
215 |
+ 4: EXCEPTION_PROLOG_COMMON_2(area) \ |
216 |
+- EXCEPTION_PROLOG_COMMON_3(n) \ |
217 |
++ beq 5f; /* if from kernel mode */ \ |
218 |
++ MOVE_PPR_TO_THREAD(r9, r10); \ |
219 |
++5: EXCEPTION_PROLOG_COMMON_3(n) \ |
220 |
+ ACCOUNT_STOLEN_TIME |
221 |
+ |
222 |
+ /* Save original regs values from save area to stack frame. */ |
223 |
+diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig |
224 |
+index 60662771bd465..940132e705c15 100644 |
225 |
+--- a/drivers/block/Kconfig |
226 |
++++ b/drivers/block/Kconfig |
227 |
+@@ -39,6 +39,22 @@ config BLK_DEV_FD |
228 |
+ To compile this driver as a module, choose M here: the |
229 |
+ module will be called floppy. |
230 |
+ |
231 |
++config BLK_DEV_FD_RAWCMD |
232 |
++ bool "Support for raw floppy disk commands (DEPRECATED)" |
233 |
++ depends on BLK_DEV_FD |
234 |
++ help |
235 |
++ If you want to use actual physical floppies and expect to do |
236 |
++ special low-level hardware accesses to them (access and use |
237 |
++ non-standard formats, for example), then enable this. |
238 |
++ |
239 |
++ Note that the code enabled by this option is rarely used and |
240 |
++ might be unstable or insecure, and distros should not enable it. |
241 |
++ |
242 |
++ Note: FDRAWCMD is deprecated and will be removed from the kernel |
243 |
++ in the near future. |
244 |
++ |
245 |
++ If unsure, say N. |
246 |
++ |
247 |
+ config AMIGA_FLOPPY |
248 |
+ tristate "Amiga floppy support" |
249 |
+ depends on AMIGA |
250 |
+diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c |
251 |
+index e6e95e67c40ee..97c8fc4d6e7bd 100644 |
252 |
+--- a/drivers/block/floppy.c |
253 |
++++ b/drivers/block/floppy.c |
254 |
+@@ -3023,6 +3023,8 @@ static const char *drive_name(int type, int drive) |
255 |
+ return "(null)"; |
256 |
+ } |
257 |
+ |
258 |
++#ifdef CONFIG_BLK_DEV_FD_RAWCMD |
259 |
++ |
260 |
+ /* raw commands */ |
261 |
+ static void raw_cmd_done(int flag) |
262 |
+ { |
263 |
+@@ -3234,6 +3236,35 @@ static int raw_cmd_ioctl(int cmd, void __user *param) |
264 |
+ return ret; |
265 |
+ } |
266 |
+ |
267 |
++static int floppy_raw_cmd_ioctl(int type, int drive, int cmd, |
268 |
++ void __user *param) |
269 |
++{ |
270 |
++ int ret; |
271 |
++ |
272 |
++ pr_warn_once("Note: FDRAWCMD is deprecated and will be removed from the kernel in the near future.\n"); |
273 |
++ |
274 |
++ if (type) |
275 |
++ return -EINVAL; |
276 |
++ if (lock_fdc(drive)) |
277 |
++ return -EINTR; |
278 |
++ set_floppy(drive); |
279 |
++ ret = raw_cmd_ioctl(cmd, param); |
280 |
++ if (ret == -EINTR) |
281 |
++ return -EINTR; |
282 |
++ process_fd_request(); |
283 |
++ return ret; |
284 |
++} |
285 |
++ |
286 |
++#else /* CONFIG_BLK_DEV_FD_RAWCMD */ |
287 |
++ |
288 |
++static int floppy_raw_cmd_ioctl(int type, int drive, int cmd, |
289 |
++ void __user *param) |
290 |
++{ |
291 |
++ return -EOPNOTSUPP; |
292 |
++} |
293 |
++ |
294 |
++#endif |
295 |
++ |
296 |
+ static int invalidate_drive(struct block_device *bdev) |
297 |
+ { |
298 |
+ /* invalidate the buffer track to force a reread */ |
299 |
+@@ -3421,7 +3452,6 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int |
300 |
+ { |
301 |
+ int drive = (long)bdev->bd_disk->private_data; |
302 |
+ int type = ITYPE(UDRS->fd_device); |
303 |
+- int i; |
304 |
+ int ret; |
305 |
+ int size; |
306 |
+ union inparam { |
307 |
+@@ -3572,16 +3602,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int |
308 |
+ outparam = UDRWE; |
309 |
+ break; |
310 |
+ case FDRAWCMD: |
311 |
+- if (type) |
312 |
+- return -EINVAL; |
313 |
+- if (lock_fdc(drive)) |
314 |
+- return -EINTR; |
315 |
+- set_floppy(drive); |
316 |
+- i = raw_cmd_ioctl(cmd, (void __user *)param); |
317 |
+- if (i == -EINTR) |
318 |
+- return -EINTR; |
319 |
+- process_fd_request(); |
320 |
+- return i; |
321 |
++ return floppy_raw_cmd_ioctl(type, drive, cmd, (void __user *)param); |
322 |
+ case FDTWADDLE: |
323 |
+ if (lock_fdc(drive)) |
324 |
+ return -EINTR; |
325 |
+diff --git a/drivers/lightnvm/Kconfig b/drivers/lightnvm/Kconfig |
326 |
+index 20706da7aa1cf..38cd49a3aeed1 100644 |
327 |
+--- a/drivers/lightnvm/Kconfig |
328 |
++++ b/drivers/lightnvm/Kconfig |
329 |
+@@ -4,7 +4,7 @@ |
330 |
+ |
331 |
+ menuconfig NVM |
332 |
+ bool "Open-Channel SSD target support" |
333 |
+- depends on BLOCK && PCI |
334 |
++ depends on BLOCK && PCI && BROKEN |
335 |
+ select BLK_DEV_NVME |
336 |
+ help |
337 |
+ Say Y here to get to enable Open-channel SSDs. |
338 |
+diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c |
339 |
+index 7a33a52eaccaa..9d2e1ce536ec0 100644 |
340 |
+--- a/drivers/media/platform/vicodec/vicodec-core.c |
341 |
++++ b/drivers/media/platform/vicodec/vicodec-core.c |
342 |
+@@ -1297,12 +1297,12 @@ static int vicodec_release(struct file *file) |
343 |
+ struct video_device *vfd = video_devdata(file); |
344 |
+ struct vicodec_ctx *ctx = file2ctx(file); |
345 |
+ |
346 |
+- v4l2_fh_del(&ctx->fh); |
347 |
+- v4l2_fh_exit(&ctx->fh); |
348 |
+- v4l2_ctrl_handler_free(&ctx->hdl); |
349 |
+ mutex_lock(vfd->lock); |
350 |
+ v4l2_m2m_ctx_release(ctx->fh.m2m_ctx); |
351 |
+ mutex_unlock(vfd->lock); |
352 |
++ v4l2_fh_del(&ctx->fh); |
353 |
++ v4l2_fh_exit(&ctx->fh); |
354 |
++ v4l2_ctrl_handler_free(&ctx->hdl); |
355 |
+ kfree(ctx); |
356 |
+ |
357 |
+ return 0; |
358 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c b/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c |
359 |
+index 729df169faa21..8b50afcdb52df 100644 |
360 |
+--- a/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c |
361 |
++++ b/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c |
362 |
+@@ -68,6 +68,10 @@ |
363 |
+ #define TSE_PCS_USE_SGMII_ENA BIT(0) |
364 |
+ #define TSE_PCS_IF_USE_SGMII 0x03 |
365 |
+ |
366 |
++#define SGMII_ADAPTER_CTRL_REG 0x00 |
367 |
++#define SGMII_ADAPTER_DISABLE 0x0001 |
368 |
++#define SGMII_ADAPTER_ENABLE 0x0000 |
369 |
++ |
370 |
+ #define AUTONEGO_LINK_TIMER 20 |
371 |
+ |
372 |
+ static int tse_pcs_reset(void __iomem *base, struct tse_pcs *pcs) |
373 |
+@@ -209,8 +213,12 @@ void tse_pcs_fix_mac_speed(struct tse_pcs *pcs, struct phy_device *phy_dev, |
374 |
+ unsigned int speed) |
375 |
+ { |
376 |
+ void __iomem *tse_pcs_base = pcs->tse_pcs_base; |
377 |
++ void __iomem *sgmii_adapter_base = pcs->sgmii_adapter_base; |
378 |
+ u32 val; |
379 |
+ |
380 |
++ writew(SGMII_ADAPTER_ENABLE, |
381 |
++ sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); |
382 |
++ |
383 |
+ pcs->autoneg = phy_dev->autoneg; |
384 |
+ |
385 |
+ if (phy_dev->autoneg == AUTONEG_ENABLE) { |
386 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h b/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h |
387 |
+index 254199f2efdbf..2f5882450b06a 100644 |
388 |
+--- a/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h |
389 |
++++ b/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.h |
390 |
+@@ -21,10 +21,6 @@ |
391 |
+ #include <linux/phy.h> |
392 |
+ #include <linux/timer.h> |
393 |
+ |
394 |
+-#define SGMII_ADAPTER_CTRL_REG 0x00 |
395 |
+-#define SGMII_ADAPTER_ENABLE 0x0000 |
396 |
+-#define SGMII_ADAPTER_DISABLE 0x0001 |
397 |
+- |
398 |
+ struct tse_pcs { |
399 |
+ struct device *dev; |
400 |
+ void __iomem *tse_pcs_base; |
401 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c |
402 |
+index 32ead4a4b4604..33407df6bea69 100644 |
403 |
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c |
404 |
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c |
405 |
+@@ -29,6 +29,9 @@ |
406 |
+ |
407 |
+ #include "altr_tse_pcs.h" |
408 |
+ |
409 |
++#define SGMII_ADAPTER_CTRL_REG 0x00 |
410 |
++#define SGMII_ADAPTER_DISABLE 0x0001 |
411 |
++ |
412 |
+ #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII 0x0 |
413 |
+ #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII 0x1 |
414 |
+ #define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RMII 0x2 |
415 |
+@@ -62,14 +65,16 @@ static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed) |
416 |
+ { |
417 |
+ struct socfpga_dwmac *dwmac = (struct socfpga_dwmac *)priv; |
418 |
+ void __iomem *splitter_base = dwmac->splitter_base; |
419 |
++ void __iomem *tse_pcs_base = dwmac->pcs.tse_pcs_base; |
420 |
+ void __iomem *sgmii_adapter_base = dwmac->pcs.sgmii_adapter_base; |
421 |
+ struct device *dev = dwmac->dev; |
422 |
+ struct net_device *ndev = dev_get_drvdata(dev); |
423 |
+ struct phy_device *phy_dev = ndev->phydev; |
424 |
+ u32 val; |
425 |
+ |
426 |
+- writew(SGMII_ADAPTER_DISABLE, |
427 |
+- sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); |
428 |
++ if ((tse_pcs_base) && (sgmii_adapter_base)) |
429 |
++ writew(SGMII_ADAPTER_DISABLE, |
430 |
++ sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); |
431 |
+ |
432 |
+ if (splitter_base) { |
433 |
+ val = readl(splitter_base + EMAC_SPLITTER_CTRL_REG); |
434 |
+@@ -91,9 +96,7 @@ static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed) |
435 |
+ writel(val, splitter_base + EMAC_SPLITTER_CTRL_REG); |
436 |
+ } |
437 |
+ |
438 |
+- writew(SGMII_ADAPTER_ENABLE, |
439 |
+- sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); |
440 |
+- if (phy_dev) |
441 |
++ if (tse_pcs_base && sgmii_adapter_base) |
442 |
+ tse_pcs_fix_mac_speed(&dwmac->pcs, phy_dev, speed); |
443 |
+ } |
444 |
+ |
445 |
+diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c |
446 |
+index 29431e3eebee3..87094189af740 100644 |
447 |
+--- a/drivers/net/hamradio/6pack.c |
448 |
++++ b/drivers/net/hamradio/6pack.c |
449 |
+@@ -311,7 +311,6 @@ static void sp_setup(struct net_device *dev) |
450 |
+ { |
451 |
+ /* Finish setting up the DEVICE info. */ |
452 |
+ dev->netdev_ops = &sp_netdev_ops; |
453 |
+- dev->needs_free_netdev = true; |
454 |
+ dev->mtu = SIXP_MTU; |
455 |
+ dev->hard_header_len = AX25_MAX_HEADER_LEN; |
456 |
+ dev->header_ops = &ax25_header_ops; |
457 |
+@@ -679,9 +678,11 @@ static void sixpack_close(struct tty_struct *tty) |
458 |
+ del_timer_sync(&sp->tx_t); |
459 |
+ del_timer_sync(&sp->resync_t); |
460 |
+ |
461 |
+- /* Free all 6pack frame buffers. */ |
462 |
++ /* Free all 6pack frame buffers after unreg. */ |
463 |
+ kfree(sp->rbuff); |
464 |
+ kfree(sp->xbuff); |
465 |
++ |
466 |
++ free_netdev(sp->dev); |
467 |
+ } |
468 |
+ |
469 |
+ /* Perform I/O control on an active 6pack channel. */ |
470 |
+diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c |
471 |
+index 5eee26cf9011f..d30256ac35372 100644 |
472 |
+--- a/net/sched/cls_u32.c |
473 |
++++ b/net/sched/cls_u32.c |
474 |
+@@ -404,15 +404,20 @@ static int u32_init(struct tcf_proto *tp) |
475 |
+ return 0; |
476 |
+ } |
477 |
+ |
478 |
+-static int u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n, |
479 |
+- bool free_pf) |
480 |
++static void __u32_destroy_key(struct tc_u_knode *n) |
481 |
+ { |
482 |
+ struct tc_u_hnode *ht = rtnl_dereference(n->ht_down); |
483 |
+ |
484 |
+ tcf_exts_destroy(&n->exts); |
485 |
+- tcf_exts_put_net(&n->exts); |
486 |
+ if (ht && --ht->refcnt == 0) |
487 |
+ kfree(ht); |
488 |
++ kfree(n); |
489 |
++} |
490 |
++ |
491 |
++static void u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n, |
492 |
++ bool free_pf) |
493 |
++{ |
494 |
++ tcf_exts_put_net(&n->exts); |
495 |
+ #ifdef CONFIG_CLS_U32_PERF |
496 |
+ if (free_pf) |
497 |
+ free_percpu(n->pf); |
498 |
+@@ -421,8 +426,7 @@ static int u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n, |
499 |
+ if (free_pf) |
500 |
+ free_percpu(n->pcpu_success); |
501 |
+ #endif |
502 |
+- kfree(n); |
503 |
+- return 0; |
504 |
++ __u32_destroy_key(n); |
505 |
+ } |
506 |
+ |
507 |
+ /* u32_delete_key_rcu should be called when free'ing a copied |
508 |
+@@ -965,13 +969,13 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, |
509 |
+ tca[TCA_RATE], ovr, extack); |
510 |
+ |
511 |
+ if (err) { |
512 |
+- u32_destroy_key(tp, new, false); |
513 |
++ __u32_destroy_key(new); |
514 |
+ return err; |
515 |
+ } |
516 |
+ |
517 |
+ err = u32_replace_hw_knode(tp, new, flags, extack); |
518 |
+ if (err) { |
519 |
+- u32_destroy_key(tp, new, false); |
520 |
++ __u32_destroy_key(new); |
521 |
+ return err; |
522 |
+ } |
523 |
+ |