1 |
commit: 72dbacc4c141b44f8f6e5469e9709ff3f0a56998 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Nov 1 20:31:03 2020 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Nov 1 20:31:03 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=72dbacc4 |
7 |
|
8 |
Linux patch 5.4.74 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1073_linux-5.4.74.patch | 1507 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 1511 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 6920241..638dbe8 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -335,6 +335,10 @@ Patch: 1072_linux-5.4.73.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.4.73 |
23 |
|
24 |
+Patch: 1073_linux-5.4.74.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.4.74 |
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/1073_linux-5.4.74.patch b/1073_linux-5.4.74.patch |
33 |
new file mode 100644 |
34 |
index 0000000..7dc395f |
35 |
--- /dev/null |
36 |
+++ b/1073_linux-5.4.74.patch |
37 |
@@ -0,0 +1,1507 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index f9a8d76a693eb..3be5a9c352b9c 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 4 |
46 |
+-SUBLEVEL = 73 |
47 |
++SUBLEVEL = 74 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Kleptomaniac Octopus |
50 |
+ |
51 |
+diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile |
52 |
+index 96abe558aea8b..cd8f3cdabfd07 100644 |
53 |
+--- a/arch/arm64/Makefile |
54 |
++++ b/arch/arm64/Makefile |
55 |
+@@ -10,7 +10,7 @@ |
56 |
+ # |
57 |
+ # Copyright (C) 1995-2001 by Russell King |
58 |
+ |
59 |
+-LDFLAGS_vmlinux :=--no-undefined -X |
60 |
++LDFLAGS_vmlinux :=--no-undefined -X -z norelro |
61 |
+ CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET) |
62 |
+ GZFLAGS :=-9 |
63 |
+ |
64 |
+@@ -18,7 +18,7 @@ ifeq ($(CONFIG_RELOCATABLE), y) |
65 |
+ # Pass --no-apply-dynamic-relocs to restore pre-binutils-2.27 behaviour |
66 |
+ # for relative relocs, since this leads to better Image compression |
67 |
+ # with the relocation offsets always being zero. |
68 |
+-LDFLAGS_vmlinux += -shared -Bsymbolic -z notext -z norelro \ |
69 |
++LDFLAGS_vmlinux += -shared -Bsymbolic -z notext \ |
70 |
+ $(call ld-option, --no-apply-dynamic-relocs) |
71 |
+ endif |
72 |
+ |
73 |
+diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c |
74 |
+index d2e738c455566..1e16c4e00e771 100644 |
75 |
+--- a/arch/arm64/kernel/cpu_errata.c |
76 |
++++ b/arch/arm64/kernel/cpu_errata.c |
77 |
+@@ -492,6 +492,12 @@ out_printmsg: |
78 |
+ return required; |
79 |
+ } |
80 |
+ |
81 |
++static void cpu_enable_ssbd_mitigation(const struct arm64_cpu_capabilities *cap) |
82 |
++{ |
83 |
++ if (ssbd_state != ARM64_SSBD_FORCE_DISABLE) |
84 |
++ cap->matches(cap, SCOPE_LOCAL_CPU); |
85 |
++} |
86 |
++ |
87 |
+ /* known invulnerable cores */ |
88 |
+ static const struct midr_range arm64_ssb_cpus[] = { |
89 |
+ MIDR_ALL_VERSIONS(MIDR_CORTEX_A35), |
90 |
+@@ -635,6 +641,12 @@ check_branch_predictor(const struct arm64_cpu_capabilities *entry, int scope) |
91 |
+ return (need_wa > 0); |
92 |
+ } |
93 |
+ |
94 |
++static void |
95 |
++cpu_enable_branch_predictor_hardening(const struct arm64_cpu_capabilities *cap) |
96 |
++{ |
97 |
++ cap->matches(cap, SCOPE_LOCAL_CPU); |
98 |
++} |
99 |
++ |
100 |
+ static const __maybe_unused struct midr_range tx2_family_cpus[] = { |
101 |
+ MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN), |
102 |
+ MIDR_ALL_VERSIONS(MIDR_CAVIUM_THUNDERX2), |
103 |
+@@ -894,9 +906,11 @@ const struct arm64_cpu_capabilities arm64_errata[] = { |
104 |
+ }, |
105 |
+ #endif |
106 |
+ { |
107 |
++ .desc = "Branch predictor hardening", |
108 |
+ .capability = ARM64_HARDEN_BRANCH_PREDICTOR, |
109 |
+ .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, |
110 |
+ .matches = check_branch_predictor, |
111 |
++ .cpu_enable = cpu_enable_branch_predictor_hardening, |
112 |
+ }, |
113 |
+ #ifdef CONFIG_HARDEN_EL2_VECTORS |
114 |
+ { |
115 |
+@@ -910,6 +924,7 @@ const struct arm64_cpu_capabilities arm64_errata[] = { |
116 |
+ .capability = ARM64_SSBD, |
117 |
+ .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, |
118 |
+ .matches = has_ssbd_mitigation, |
119 |
++ .cpu_enable = cpu_enable_ssbd_mitigation, |
120 |
+ .midr_range_list = arm64_ssb_cpus, |
121 |
+ }, |
122 |
+ #ifdef CONFIG_ARM64_ERRATUM_1418040 |
123 |
+diff --git a/arch/openrisc/include/asm/uaccess.h b/arch/openrisc/include/asm/uaccess.h |
124 |
+index 17c24f14615fb..6839f8fcf76b2 100644 |
125 |
+--- a/arch/openrisc/include/asm/uaccess.h |
126 |
++++ b/arch/openrisc/include/asm/uaccess.h |
127 |
+@@ -164,19 +164,19 @@ struct __large_struct { |
128 |
+ |
129 |
+ #define __get_user_nocheck(x, ptr, size) \ |
130 |
+ ({ \ |
131 |
+- long __gu_err, __gu_val; \ |
132 |
+- __get_user_size(__gu_val, (ptr), (size), __gu_err); \ |
133 |
+- (x) = (__force __typeof__(*(ptr)))__gu_val; \ |
134 |
++ long __gu_err; \ |
135 |
++ __get_user_size((x), (ptr), (size), __gu_err); \ |
136 |
+ __gu_err; \ |
137 |
+ }) |
138 |
+ |
139 |
+ #define __get_user_check(x, ptr, size) \ |
140 |
+ ({ \ |
141 |
+- long __gu_err = -EFAULT, __gu_val = 0; \ |
142 |
+- const __typeof__(*(ptr)) * __gu_addr = (ptr); \ |
143 |
+- if (access_ok(__gu_addr, size)) \ |
144 |
+- __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ |
145 |
+- (x) = (__force __typeof__(*(ptr)))__gu_val; \ |
146 |
++ long __gu_err = -EFAULT; \ |
147 |
++ const __typeof__(*(ptr)) *__gu_addr = (ptr); \ |
148 |
++ if (access_ok(__gu_addr, size)) \ |
149 |
++ __get_user_size((x), __gu_addr, (size), __gu_err); \ |
150 |
++ else \ |
151 |
++ (x) = (__typeof__(*(ptr))) 0; \ |
152 |
+ __gu_err; \ |
153 |
+ }) |
154 |
+ |
155 |
+@@ -190,11 +190,13 @@ do { \ |
156 |
+ case 2: __get_user_asm(x, ptr, retval, "l.lhz"); break; \ |
157 |
+ case 4: __get_user_asm(x, ptr, retval, "l.lwz"); break; \ |
158 |
+ case 8: __get_user_asm2(x, ptr, retval); break; \ |
159 |
+- default: (x) = __get_user_bad(); \ |
160 |
++ default: (x) = (__typeof__(*(ptr)))__get_user_bad(); \ |
161 |
+ } \ |
162 |
+ } while (0) |
163 |
+ |
164 |
+ #define __get_user_asm(x, addr, err, op) \ |
165 |
++{ \ |
166 |
++ unsigned long __gu_tmp; \ |
167 |
+ __asm__ __volatile__( \ |
168 |
+ "1: "op" %1,0(%2)\n" \ |
169 |
+ "2:\n" \ |
170 |
+@@ -208,10 +210,14 @@ do { \ |
171 |
+ " .align 2\n" \ |
172 |
+ " .long 1b,3b\n" \ |
173 |
+ ".previous" \ |
174 |
+- : "=r"(err), "=r"(x) \ |
175 |
+- : "r"(addr), "i"(-EFAULT), "0"(err)) |
176 |
++ : "=r"(err), "=r"(__gu_tmp) \ |
177 |
++ : "r"(addr), "i"(-EFAULT), "0"(err)); \ |
178 |
++ (x) = (__typeof__(*(addr)))__gu_tmp; \ |
179 |
++} |
180 |
+ |
181 |
+ #define __get_user_asm2(x, addr, err) \ |
182 |
++{ \ |
183 |
++ unsigned long long __gu_tmp; \ |
184 |
+ __asm__ __volatile__( \ |
185 |
+ "1: l.lwz %1,0(%2)\n" \ |
186 |
+ "2: l.lwz %H1,4(%2)\n" \ |
187 |
+@@ -228,8 +234,11 @@ do { \ |
188 |
+ " .long 1b,4b\n" \ |
189 |
+ " .long 2b,4b\n" \ |
190 |
+ ".previous" \ |
191 |
+- : "=r"(err), "=&r"(x) \ |
192 |
+- : "r"(addr), "i"(-EFAULT), "0"(err)) |
193 |
++ : "=r"(err), "=&r"(__gu_tmp) \ |
194 |
++ : "r"(addr), "i"(-EFAULT), "0"(err)); \ |
195 |
++ (x) = (__typeof__(*(addr)))( \ |
196 |
++ (__typeof__((x)-(x)))__gu_tmp); \ |
197 |
++} |
198 |
+ |
199 |
+ /* more complex routines */ |
200 |
+ |
201 |
+diff --git a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S |
202 |
+index d9b734d0c8cc7..3c6e01520a973 100644 |
203 |
+--- a/arch/x86/crypto/crc32c-pcl-intel-asm_64.S |
204 |
++++ b/arch/x86/crypto/crc32c-pcl-intel-asm_64.S |
205 |
+@@ -170,7 +170,7 @@ continue_block: |
206 |
+ |
207 |
+ ## branch into array |
208 |
+ lea jump_table(%rip), bufp |
209 |
+- movzxw (bufp, %rax, 2), len |
210 |
++ movzwq (bufp, %rax, 2), len |
211 |
+ lea crc_array(%rip), bufp |
212 |
+ lea (bufp, len, 1), bufp |
213 |
+ JMP_NOSPEC bufp |
214 |
+diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c |
215 |
+index 26c36357c4c9c..a023cbe21230a 100644 |
216 |
+--- a/arch/x86/events/amd/ibs.c |
217 |
++++ b/arch/x86/events/amd/ibs.c |
218 |
+@@ -89,6 +89,7 @@ struct perf_ibs { |
219 |
+ u64 max_period; |
220 |
+ unsigned long offset_mask[1]; |
221 |
+ int offset_max; |
222 |
++ unsigned int fetch_count_reset_broken : 1; |
223 |
+ struct cpu_perf_ibs __percpu *pcpu; |
224 |
+ |
225 |
+ struct attribute **format_attrs; |
226 |
+@@ -363,7 +364,12 @@ perf_ibs_event_update(struct perf_ibs *perf_ibs, struct perf_event *event, |
227 |
+ static inline void perf_ibs_enable_event(struct perf_ibs *perf_ibs, |
228 |
+ struct hw_perf_event *hwc, u64 config) |
229 |
+ { |
230 |
+- wrmsrl(hwc->config_base, hwc->config | config | perf_ibs->enable_mask); |
231 |
++ u64 tmp = hwc->config | config; |
232 |
++ |
233 |
++ if (perf_ibs->fetch_count_reset_broken) |
234 |
++ wrmsrl(hwc->config_base, tmp & ~perf_ibs->enable_mask); |
235 |
++ |
236 |
++ wrmsrl(hwc->config_base, tmp | perf_ibs->enable_mask); |
237 |
+ } |
238 |
+ |
239 |
+ /* |
240 |
+@@ -733,6 +739,13 @@ static __init void perf_event_ibs_init(void) |
241 |
+ { |
242 |
+ struct attribute **attr = ibs_op_format_attrs; |
243 |
+ |
244 |
++ /* |
245 |
++ * Some chips fail to reset the fetch count when it is written; instead |
246 |
++ * they need a 0-1 transition of IbsFetchEn. |
247 |
++ */ |
248 |
++ if (boot_cpu_data.x86 >= 0x16 && boot_cpu_data.x86 <= 0x18) |
249 |
++ perf_ibs_fetch.fetch_count_reset_broken = 1; |
250 |
++ |
251 |
+ perf_ibs_pmu_init(&perf_ibs_fetch, "ibs_fetch"); |
252 |
+ |
253 |
+ if (ibs_caps & IBS_CAPS_OPCNT) { |
254 |
+diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c |
255 |
+index 43867bc853687..eea5a0f3b959b 100644 |
256 |
+--- a/arch/x86/pci/intel_mid_pci.c |
257 |
++++ b/arch/x86/pci/intel_mid_pci.c |
258 |
+@@ -33,6 +33,7 @@ |
259 |
+ #include <asm/hw_irq.h> |
260 |
+ #include <asm/io_apic.h> |
261 |
+ #include <asm/intel-mid.h> |
262 |
++#include <asm/acpi.h> |
263 |
+ |
264 |
+ #define PCIE_CAP_OFFSET 0x100 |
265 |
+ |
266 |
+diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c |
267 |
+index 6d4d8a5700b71..3e66feff524a8 100644 |
268 |
+--- a/arch/x86/xen/enlighten_pv.c |
269 |
++++ b/arch/x86/xen/enlighten_pv.c |
270 |
+@@ -1382,6 +1382,15 @@ asmlinkage __visible void __init xen_start_kernel(void) |
271 |
+ x86_init.mpparse.get_smp_config = x86_init_uint_noop; |
272 |
+ |
273 |
+ xen_boot_params_init_edd(); |
274 |
++ |
275 |
++#ifdef CONFIG_ACPI |
276 |
++ /* |
277 |
++ * Disable selecting "Firmware First mode" for correctable |
278 |
++ * memory errors, as this is the duty of the hypervisor to |
279 |
++ * decide. |
280 |
++ */ |
281 |
++ acpi_disable_cmcff = 1; |
282 |
++#endif |
283 |
+ } |
284 |
+ |
285 |
+ if (!boot_params.screen_info.orig_video_isVGA) |
286 |
+diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h |
287 |
+index 3dbf398c92eaf..9ef62e647cd20 100644 |
288 |
+--- a/drivers/ata/ahci.h |
289 |
++++ b/drivers/ata/ahci.h |
290 |
+@@ -240,6 +240,8 @@ enum { |
291 |
+ as default lpm_policy */ |
292 |
+ AHCI_HFLAG_SUSPEND_PHYS = (1 << 26), /* handle PHYs during |
293 |
+ suspend/resume */ |
294 |
++ AHCI_HFLAG_IGN_NOTSUPP_POWER_ON = (1 << 27), /* ignore -EOPNOTSUPP |
295 |
++ from phy_power_on() */ |
296 |
+ |
297 |
+ /* ap->flags bits */ |
298 |
+ |
299 |
+diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c |
300 |
+index d4bba3ace45d7..3ad46d26d9d51 100644 |
301 |
+--- a/drivers/ata/ahci_mvebu.c |
302 |
++++ b/drivers/ata/ahci_mvebu.c |
303 |
+@@ -227,7 +227,7 @@ static const struct ahci_mvebu_plat_data ahci_mvebu_armada_380_plat_data = { |
304 |
+ |
305 |
+ static const struct ahci_mvebu_plat_data ahci_mvebu_armada_3700_plat_data = { |
306 |
+ .plat_config = ahci_mvebu_armada_3700_config, |
307 |
+- .flags = AHCI_HFLAG_SUSPEND_PHYS, |
308 |
++ .flags = AHCI_HFLAG_SUSPEND_PHYS | AHCI_HFLAG_IGN_NOTSUPP_POWER_ON, |
309 |
+ }; |
310 |
+ |
311 |
+ static const struct of_device_id ahci_mvebu_of_match[] = { |
312 |
+diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c |
313 |
+index 129556fcf6be7..a1cbb894e5f0a 100644 |
314 |
+--- a/drivers/ata/libahci_platform.c |
315 |
++++ b/drivers/ata/libahci_platform.c |
316 |
+@@ -59,7 +59,7 @@ int ahci_platform_enable_phys(struct ahci_host_priv *hpriv) |
317 |
+ } |
318 |
+ |
319 |
+ rc = phy_power_on(hpriv->phys[i]); |
320 |
+- if (rc) { |
321 |
++ if (rc && !(rc == -EOPNOTSUPP && (hpriv->flags & AHCI_HFLAG_IGN_NOTSUPP_POWER_ON))) { |
322 |
+ phy_exit(hpriv->phys[i]); |
323 |
+ goto disable_phys; |
324 |
+ } |
325 |
+diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c |
326 |
+index 141ac600b64c8..44b0ed8f6bb8a 100644 |
327 |
+--- a/drivers/ata/sata_rcar.c |
328 |
++++ b/drivers/ata/sata_rcar.c |
329 |
+@@ -120,7 +120,7 @@ |
330 |
+ /* Descriptor table word 0 bit (when DTA32M = 1) */ |
331 |
+ #define SATA_RCAR_DTEND BIT(0) |
332 |
+ |
333 |
+-#define SATA_RCAR_DMA_BOUNDARY 0x1FFFFFFEUL |
334 |
++#define SATA_RCAR_DMA_BOUNDARY 0x1FFFFFFFUL |
335 |
+ |
336 |
+ /* Gen2 Physical Layer Control Registers */ |
337 |
+ #define RCAR_GEN2_PHY_CTL1_REG 0x1704 |
338 |
+diff --git a/drivers/crypto/chelsio/chtls/chtls_cm.c b/drivers/crypto/chelsio/chtls/chtls_cm.c |
339 |
+index 9b410ffafc4dd..e2c64c943cfc7 100644 |
340 |
+--- a/drivers/crypto/chelsio/chtls/chtls_cm.c |
341 |
++++ b/drivers/crypto/chelsio/chtls/chtls_cm.c |
342 |
+@@ -692,14 +692,13 @@ static int chtls_pass_open_rpl(struct chtls_dev *cdev, struct sk_buff *skb) |
343 |
+ if (rpl->status != CPL_ERR_NONE) { |
344 |
+ pr_info("Unexpected PASS_OPEN_RPL status %u for STID %u\n", |
345 |
+ rpl->status, stid); |
346 |
+- return CPL_RET_BUF_DONE; |
347 |
++ } else { |
348 |
++ cxgb4_free_stid(cdev->tids, stid, listen_ctx->lsk->sk_family); |
349 |
++ sock_put(listen_ctx->lsk); |
350 |
++ kfree(listen_ctx); |
351 |
++ module_put(THIS_MODULE); |
352 |
+ } |
353 |
+- cxgb4_free_stid(cdev->tids, stid, listen_ctx->lsk->sk_family); |
354 |
+- sock_put(listen_ctx->lsk); |
355 |
+- kfree(listen_ctx); |
356 |
+- module_put(THIS_MODULE); |
357 |
+- |
358 |
+- return 0; |
359 |
++ return CPL_RET_BUF_DONE; |
360 |
+ } |
361 |
+ |
362 |
+ static int chtls_close_listsrv_rpl(struct chtls_dev *cdev, struct sk_buff *skb) |
363 |
+@@ -716,15 +715,13 @@ static int chtls_close_listsrv_rpl(struct chtls_dev *cdev, struct sk_buff *skb) |
364 |
+ if (rpl->status != CPL_ERR_NONE) { |
365 |
+ pr_info("Unexpected CLOSE_LISTSRV_RPL status %u for STID %u\n", |
366 |
+ rpl->status, stid); |
367 |
+- return CPL_RET_BUF_DONE; |
368 |
++ } else { |
369 |
++ cxgb4_free_stid(cdev->tids, stid, listen_ctx->lsk->sk_family); |
370 |
++ sock_put(listen_ctx->lsk); |
371 |
++ kfree(listen_ctx); |
372 |
++ module_put(THIS_MODULE); |
373 |
+ } |
374 |
+- |
375 |
+- cxgb4_free_stid(cdev->tids, stid, listen_ctx->lsk->sk_family); |
376 |
+- sock_put(listen_ctx->lsk); |
377 |
+- kfree(listen_ctx); |
378 |
+- module_put(THIS_MODULE); |
379 |
+- |
380 |
+- return 0; |
381 |
++ return CPL_RET_BUF_DONE; |
382 |
+ } |
383 |
+ |
384 |
+ static void chtls_purge_wr_queue(struct sock *sk) |
385 |
+@@ -1369,7 +1366,6 @@ static void add_to_reap_list(struct sock *sk) |
386 |
+ struct chtls_sock *csk = sk->sk_user_data; |
387 |
+ |
388 |
+ local_bh_disable(); |
389 |
+- bh_lock_sock(sk); |
390 |
+ release_tcp_port(sk); /* release the port immediately */ |
391 |
+ |
392 |
+ spin_lock(&reap_list_lock); |
393 |
+@@ -1378,7 +1374,6 @@ static void add_to_reap_list(struct sock *sk) |
394 |
+ if (!csk->passive_reap_next) |
395 |
+ schedule_work(&reap_task); |
396 |
+ spin_unlock(&reap_list_lock); |
397 |
+- bh_unlock_sock(sk); |
398 |
+ local_bh_enable(); |
399 |
+ } |
400 |
+ |
401 |
+diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c |
402 |
+index a5903cfc83523..4c44d7c0c2c1f 100644 |
403 |
+--- a/drivers/crypto/chelsio/chtls/chtls_io.c |
404 |
++++ b/drivers/crypto/chelsio/chtls/chtls_io.c |
405 |
+@@ -1537,6 +1537,7 @@ skip_copy: |
406 |
+ tp->urg_data = 0; |
407 |
+ |
408 |
+ if ((avail + offset) >= skb->len) { |
409 |
++ struct sk_buff *next_skb; |
410 |
+ if (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_TLS_HDR) { |
411 |
+ tp->copied_seq += skb->len; |
412 |
+ hws->rcvpld = skb->hdr_len; |
413 |
+@@ -1546,8 +1547,10 @@ skip_copy: |
414 |
+ chtls_free_skb(sk, skb); |
415 |
+ buffers_freed++; |
416 |
+ hws->copied_seq = 0; |
417 |
+- if (copied >= target && |
418 |
+- !skb_peek(&sk->sk_receive_queue)) |
419 |
++ next_skb = skb_peek(&sk->sk_receive_queue); |
420 |
++ if (copied >= target && !next_skb) |
421 |
++ break; |
422 |
++ if (ULP_SKB_CB(next_skb)->flags & ULPCB_FLAG_TLS_HDR) |
423 |
+ break; |
424 |
+ } |
425 |
+ } while (len > 0); |
426 |
+diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c |
427 |
+index 1753a9801b704..8beed4197e73e 100644 |
428 |
+--- a/drivers/infiniband/core/addr.c |
429 |
++++ b/drivers/infiniband/core/addr.c |
430 |
+@@ -645,13 +645,12 @@ static void process_one_req(struct work_struct *_work) |
431 |
+ req->callback = NULL; |
432 |
+ |
433 |
+ spin_lock_bh(&lock); |
434 |
++ /* |
435 |
++ * Although the work will normally have been canceled by the workqueue, |
436 |
++ * it can still be requeued as long as it is on the req_list. |
437 |
++ */ |
438 |
++ cancel_delayed_work(&req->work); |
439 |
+ if (!list_empty(&req->list)) { |
440 |
+- /* |
441 |
+- * Although the work will normally have been canceled by the |
442 |
+- * workqueue, it can still be requeued as long as it is on the |
443 |
+- * req_list. |
444 |
+- */ |
445 |
+- cancel_delayed_work(&req->work); |
446 |
+ list_del_init(&req->list); |
447 |
+ kfree(req); |
448 |
+ } |
449 |
+diff --git a/drivers/misc/cardreader/rtsx_pcr.c b/drivers/misc/cardreader/rtsx_pcr.c |
450 |
+index 4fd57052ddd3d..4c707d8dc3eb3 100644 |
451 |
+--- a/drivers/misc/cardreader/rtsx_pcr.c |
452 |
++++ b/drivers/misc/cardreader/rtsx_pcr.c |
453 |
+@@ -1189,10 +1189,6 @@ void rtsx_pci_init_ocp(struct rtsx_pcr *pcr) |
454 |
+ rtsx_pci_write_register(pcr, REG_OCPGLITCH, |
455 |
+ SD_OCP_GLITCH_MASK, pcr->hw_param.ocp_glitch); |
456 |
+ rtsx_pci_enable_ocp(pcr); |
457 |
+- } else { |
458 |
+- /* OC power down */ |
459 |
+- rtsx_pci_write_register(pcr, FPDCTL, OC_POWER_DOWN, |
460 |
+- OC_POWER_DOWN); |
461 |
+ } |
462 |
+ } |
463 |
+ } |
464 |
+diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c |
465 |
+index 25a9dd9c0c1b5..2ba899f5659ff 100644 |
466 |
+--- a/drivers/misc/cxl/pci.c |
467 |
++++ b/drivers/misc/cxl/pci.c |
468 |
+@@ -393,8 +393,8 @@ int cxl_calc_capp_routing(struct pci_dev *dev, u64 *chipid, |
469 |
+ *capp_unit_id = get_capp_unit_id(np, *phb_index); |
470 |
+ of_node_put(np); |
471 |
+ if (!*capp_unit_id) { |
472 |
+- pr_err("cxl: invalid capp unit id (phb_index: %d)\n", |
473 |
+- *phb_index); |
474 |
++ pr_err("cxl: No capp unit found for PHB[%lld,%d]. Make sure the adapter is on a capi-compatible slot\n", |
475 |
++ *chipid, *phb_index); |
476 |
+ return -ENODEV; |
477 |
+ } |
478 |
+ |
479 |
+diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c |
480 |
+index 4f4fd80762610..cdd3764760ed9 100644 |
481 |
+--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c |
482 |
++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c |
483 |
+@@ -1160,16 +1160,6 @@ static void bnxt_queue_sp_work(struct bnxt *bp) |
484 |
+ schedule_work(&bp->sp_task); |
485 |
+ } |
486 |
+ |
487 |
+-static void bnxt_cancel_sp_work(struct bnxt *bp) |
488 |
+-{ |
489 |
+- if (BNXT_PF(bp)) { |
490 |
+- flush_workqueue(bnxt_pf_wq); |
491 |
+- } else { |
492 |
+- cancel_work_sync(&bp->sp_task); |
493 |
+- cancel_delayed_work_sync(&bp->fw_reset_task); |
494 |
+- } |
495 |
+-} |
496 |
+- |
497 |
+ static void bnxt_sched_reset(struct bnxt *bp, struct bnxt_rx_ring_info *rxr) |
498 |
+ { |
499 |
+ if (!rxr->bnapi->in_reset) { |
500 |
+@@ -4204,7 +4194,8 @@ static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len, |
501 |
+ u32 bar_offset = BNXT_GRCPF_REG_CHIMP_COMM; |
502 |
+ u16 dst = BNXT_HWRM_CHNL_CHIMP; |
503 |
+ |
504 |
+- if (BNXT_NO_FW_ACCESS(bp)) |
505 |
++ if (BNXT_NO_FW_ACCESS(bp) && |
506 |
++ le16_to_cpu(req->req_type) != HWRM_FUNC_RESET) |
507 |
+ return -EBUSY; |
508 |
+ |
509 |
+ if (msg_len > BNXT_HWRM_MAX_REQ_LEN) { |
510 |
+@@ -9193,7 +9184,10 @@ int bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init) |
511 |
+ { |
512 |
+ int rc = 0; |
513 |
+ |
514 |
+- rc = __bnxt_open_nic(bp, irq_re_init, link_re_init); |
515 |
++ if (test_bit(BNXT_STATE_ABORT_ERR, &bp->state)) |
516 |
++ rc = -EIO; |
517 |
++ if (!rc) |
518 |
++ rc = __bnxt_open_nic(bp, irq_re_init, link_re_init); |
519 |
+ if (rc) { |
520 |
+ netdev_err(bp->dev, "nic open fail (rc: %x)\n", rc); |
521 |
+ dev_close(bp->dev); |
522 |
+@@ -11392,13 +11386,15 @@ static void bnxt_remove_one(struct pci_dev *pdev) |
523 |
+ if (BNXT_PF(bp)) |
524 |
+ bnxt_sriov_disable(bp); |
525 |
+ |
526 |
++ pci_disable_pcie_error_reporting(pdev); |
527 |
++ unregister_netdev(dev); |
528 |
+ clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state); |
529 |
+- bnxt_cancel_sp_work(bp); |
530 |
++ /* Flush any pending tasks */ |
531 |
++ cancel_work_sync(&bp->sp_task); |
532 |
++ cancel_delayed_work_sync(&bp->fw_reset_task); |
533 |
+ bp->sp_event = 0; |
534 |
+ |
535 |
+ bnxt_dl_fw_reporters_destroy(bp, true); |
536 |
+- pci_disable_pcie_error_reporting(pdev); |
537 |
+- unregister_netdev(dev); |
538 |
+ bnxt_dl_unregister(bp); |
539 |
+ bnxt_shutdown_tc(bp); |
540 |
+ |
541 |
+@@ -12045,6 +12041,9 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev, |
542 |
+ return PCI_ERS_RESULT_DISCONNECT; |
543 |
+ } |
544 |
+ |
545 |
++ if (state == pci_channel_io_frozen) |
546 |
++ set_bit(BNXT_STATE_PCI_CHANNEL_IO_FROZEN, &bp->state); |
547 |
++ |
548 |
+ if (netif_running(netdev)) |
549 |
+ bnxt_close(netdev); |
550 |
+ |
551 |
+@@ -12068,7 +12067,7 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) |
552 |
+ { |
553 |
+ struct net_device *netdev = pci_get_drvdata(pdev); |
554 |
+ struct bnxt *bp = netdev_priv(netdev); |
555 |
+- int err = 0; |
556 |
++ int err = 0, off; |
557 |
+ pci_ers_result_t result = PCI_ERS_RESULT_DISCONNECT; |
558 |
+ |
559 |
+ netdev_info(bp->dev, "PCI Slot Reset\n"); |
560 |
+@@ -12080,6 +12079,20 @@ static pci_ers_result_t bnxt_io_slot_reset(struct pci_dev *pdev) |
561 |
+ "Cannot re-enable PCI device after reset.\n"); |
562 |
+ } else { |
563 |
+ pci_set_master(pdev); |
564 |
++ /* Upon fatal error, our device internal logic that latches to |
565 |
++ * BAR value is getting reset and will restore only upon |
566 |
++ * rewritting the BARs. |
567 |
++ * |
568 |
++ * As pci_restore_state() does not re-write the BARs if the |
569 |
++ * value is same as saved value earlier, driver needs to |
570 |
++ * write the BARs to 0 to force restore, in case of fatal error. |
571 |
++ */ |
572 |
++ if (test_and_clear_bit(BNXT_STATE_PCI_CHANNEL_IO_FROZEN, |
573 |
++ &bp->state)) { |
574 |
++ for (off = PCI_BASE_ADDRESS_0; |
575 |
++ off <= PCI_BASE_ADDRESS_5; off += 4) |
576 |
++ pci_write_config_dword(bp->pdev, off, 0); |
577 |
++ } |
578 |
+ pci_restore_state(pdev); |
579 |
+ pci_save_state(pdev); |
580 |
+ |
581 |
+diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h |
582 |
+index d2dd852d27da9..510ff01bdad8c 100644 |
583 |
+--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h |
584 |
++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h |
585 |
+@@ -1627,6 +1627,7 @@ struct bnxt { |
586 |
+ #define BNXT_STATE_IN_FW_RESET 4 |
587 |
+ #define BNXT_STATE_ABORT_ERR 5 |
588 |
+ #define BNXT_STATE_FW_FATAL_COND 6 |
589 |
++#define BNXT_STATE_PCI_CHANNEL_IO_FROZEN 8 |
590 |
+ |
591 |
+ #define BNXT_NO_FW_ACCESS(bp) \ |
592 |
+ (test_bit(BNXT_STATE_FW_FATAL_COND, &(bp)->state) || \ |
593 |
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c |
594 |
+index 137ff00605d94..202af8dc79662 100644 |
595 |
+--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c |
596 |
++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c |
597 |
+@@ -145,13 +145,13 @@ static int configure_filter_smac(struct adapter *adap, struct filter_entry *f) |
598 |
+ int err; |
599 |
+ |
600 |
+ /* do a set-tcb for smac-sel and CWR bit.. */ |
601 |
+- err = set_tcb_tflag(adap, f, f->tid, TF_CCTRL_CWR_S, 1, 1); |
602 |
+- if (err) |
603 |
+- goto smac_err; |
604 |
+- |
605 |
+ err = set_tcb_field(adap, f, f->tid, TCB_SMAC_SEL_W, |
606 |
+ TCB_SMAC_SEL_V(TCB_SMAC_SEL_M), |
607 |
+ TCB_SMAC_SEL_V(f->smt->idx), 1); |
608 |
++ if (err) |
609 |
++ goto smac_err; |
610 |
++ |
611 |
++ err = set_tcb_tflag(adap, f, f->tid, TF_CCTRL_CWR_S, 1, 1); |
612 |
+ if (!err) |
613 |
+ return 0; |
614 |
+ |
615 |
+@@ -612,6 +612,7 @@ int set_filter_wr(struct adapter *adapter, int fidx) |
616 |
+ FW_FILTER_WR_DIRSTEERHASH_V(f->fs.dirsteerhash) | |
617 |
+ FW_FILTER_WR_LPBK_V(f->fs.action == FILTER_SWITCH) | |
618 |
+ FW_FILTER_WR_DMAC_V(f->fs.newdmac) | |
619 |
++ FW_FILTER_WR_SMAC_V(f->fs.newsmac) | |
620 |
+ FW_FILTER_WR_INSVLAN_V(f->fs.newvlan == VLAN_INSERT || |
621 |
+ f->fs.newvlan == VLAN_REWRITE) | |
622 |
+ FW_FILTER_WR_RMVLAN_V(f->fs.newvlan == VLAN_REMOVE || |
623 |
+@@ -629,7 +630,7 @@ int set_filter_wr(struct adapter *adapter, int fidx) |
624 |
+ FW_FILTER_WR_OVLAN_VLD_V(f->fs.val.ovlan_vld) | |
625 |
+ FW_FILTER_WR_IVLAN_VLDM_V(f->fs.mask.ivlan_vld) | |
626 |
+ FW_FILTER_WR_OVLAN_VLDM_V(f->fs.mask.ovlan_vld)); |
627 |
+- fwr->smac_sel = 0; |
628 |
++ fwr->smac_sel = f->smt->idx; |
629 |
+ fwr->rx_chan_rx_rpl_iq = |
630 |
+ htons(FW_FILTER_WR_RX_CHAN_V(0) | |
631 |
+ FW_FILTER_WR_RX_RPL_IQ_V(adapter->sge.fw_evtq.abs_id)); |
632 |
+@@ -1048,11 +1049,8 @@ static void mk_act_open_req6(struct filter_entry *f, struct sk_buff *skb, |
633 |
+ TX_QUEUE_V(f->fs.nat_mode) | |
634 |
+ T5_OPT_2_VALID_F | |
635 |
+ RX_CHANNEL_V(cxgb4_port_e2cchan(f->dev)) | |
636 |
+- CONG_CNTRL_V((f->fs.action == FILTER_DROP) | |
637 |
+- (f->fs.dirsteer << 1)) | |
638 |
+ PACE_V((f->fs.maskhash) | |
639 |
+- ((f->fs.dirsteerhash) << 1)) | |
640 |
+- CCTRL_ECN_V(f->fs.action == FILTER_SWITCH)); |
641 |
++ ((f->fs.dirsteerhash) << 1))); |
642 |
+ } |
643 |
+ |
644 |
+ static void mk_act_open_req(struct filter_entry *f, struct sk_buff *skb, |
645 |
+@@ -1088,11 +1086,8 @@ static void mk_act_open_req(struct filter_entry *f, struct sk_buff *skb, |
646 |
+ TX_QUEUE_V(f->fs.nat_mode) | |
647 |
+ T5_OPT_2_VALID_F | |
648 |
+ RX_CHANNEL_V(cxgb4_port_e2cchan(f->dev)) | |
649 |
+- CONG_CNTRL_V((f->fs.action == FILTER_DROP) | |
650 |
+- (f->fs.dirsteer << 1)) | |
651 |
+ PACE_V((f->fs.maskhash) | |
652 |
+- ((f->fs.dirsteerhash) << 1)) | |
653 |
+- CCTRL_ECN_V(f->fs.action == FILTER_SWITCH)); |
654 |
++ ((f->fs.dirsteerhash) << 1))); |
655 |
+ } |
656 |
+ |
657 |
+ static int cxgb4_set_hash_filter(struct net_device *dev, |
658 |
+@@ -1748,6 +1743,20 @@ void hash_filter_rpl(struct adapter *adap, const struct cpl_act_open_rpl *rpl) |
659 |
+ } |
660 |
+ return; |
661 |
+ } |
662 |
++ switch (f->fs.action) { |
663 |
++ case FILTER_PASS: |
664 |
++ if (f->fs.dirsteer) |
665 |
++ set_tcb_tflag(adap, f, tid, |
666 |
++ TF_DIRECT_STEER_S, 1, 1); |
667 |
++ break; |
668 |
++ case FILTER_DROP: |
669 |
++ set_tcb_tflag(adap, f, tid, TF_DROP_S, 1, 1); |
670 |
++ break; |
671 |
++ case FILTER_SWITCH: |
672 |
++ set_tcb_tflag(adap, f, tid, TF_LPBK_S, 1, 1); |
673 |
++ break; |
674 |
++ } |
675 |
++ |
676 |
+ break; |
677 |
+ |
678 |
+ default: |
679 |
+@@ -1808,22 +1817,11 @@ void filter_rpl(struct adapter *adap, const struct cpl_set_tcb_rpl *rpl) |
680 |
+ if (ctx) |
681 |
+ ctx->result = 0; |
682 |
+ } else if (ret == FW_FILTER_WR_FLT_ADDED) { |
683 |
+- int err = 0; |
684 |
+- |
685 |
+- if (f->fs.newsmac) |
686 |
+- err = configure_filter_smac(adap, f); |
687 |
+- |
688 |
+- if (!err) { |
689 |
+- f->pending = 0; /* async setup completed */ |
690 |
+- f->valid = 1; |
691 |
+- if (ctx) { |
692 |
+- ctx->result = 0; |
693 |
+- ctx->tid = idx; |
694 |
+- } |
695 |
+- } else { |
696 |
+- clear_filter(adap, f); |
697 |
+- if (ctx) |
698 |
+- ctx->result = err; |
699 |
++ f->pending = 0; /* async setup completed */ |
700 |
++ f->valid = 1; |
701 |
++ if (ctx) { |
702 |
++ ctx->result = 0; |
703 |
++ ctx->tid = idx; |
704 |
+ } |
705 |
+ } else { |
706 |
+ /* Something went wrong. Issue a warning about the |
707 |
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h b/drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h |
708 |
+index 1b9afb192f7f8..358f0fe402701 100644 |
709 |
+--- a/drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h |
710 |
++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h |
711 |
+@@ -50,6 +50,10 @@ |
712 |
+ #define TCB_RQ_START_M 0x3ffffffULL |
713 |
+ #define TCB_RQ_START_V(x) ((x) << TCB_RQ_START_S) |
714 |
+ |
715 |
++#define TF_DROP_S 22 |
716 |
++#define TF_DIRECT_STEER_S 23 |
717 |
++#define TF_LPBK_S 59 |
718 |
++ |
719 |
+ #define TF_CCTRL_ECE_S 60 |
720 |
+ #define TF_CCTRL_CWR_S 61 |
721 |
+ #define TF_CCTRL_RFR_S 62 |
722 |
+diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c |
723 |
+index 7d7e712691b92..9b09dd95e8781 100644 |
724 |
+--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c |
725 |
++++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c |
726 |
+@@ -2782,8 +2782,8 @@ static void hclgevf_uninit_hdev(struct hclgevf_dev *hdev) |
727 |
+ hclgevf_uninit_msi(hdev); |
728 |
+ } |
729 |
+ |
730 |
+- hclgevf_pci_uninit(hdev); |
731 |
+ hclgevf_cmd_uninit(hdev); |
732 |
++ hclgevf_pci_uninit(hdev); |
733 |
+ } |
734 |
+ |
735 |
+ static int hclgevf_init_ae_dev(struct hnae3_ae_dev *ae_dev) |
736 |
+diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c |
737 |
+index 48105a2eebe4d..91559a52c7adb 100644 |
738 |
+--- a/drivers/net/ethernet/ibm/ibmvnic.c |
739 |
++++ b/drivers/net/ethernet/ibm/ibmvnic.c |
740 |
+@@ -1735,9 +1735,13 @@ static int ibmvnic_set_mac(struct net_device *netdev, void *p) |
741 |
+ int rc; |
742 |
+ |
743 |
+ rc = 0; |
744 |
+- ether_addr_copy(adapter->mac_addr, addr->sa_data); |
745 |
+- if (adapter->state != VNIC_PROBED) |
746 |
++ if (!is_valid_ether_addr(addr->sa_data)) |
747 |
++ return -EADDRNOTAVAIL; |
748 |
++ |
749 |
++ if (adapter->state != VNIC_PROBED) { |
750 |
++ ether_addr_copy(adapter->mac_addr, addr->sa_data); |
751 |
+ rc = __ibmvnic_set_mac(netdev, addr->sa_data); |
752 |
++ } |
753 |
+ |
754 |
+ return rc; |
755 |
+ } |
756 |
+diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c |
757 |
+index c7c3fc7d1126c..7277706847b18 100644 |
758 |
+--- a/drivers/net/ethernet/mellanox/mlxsw/core.c |
759 |
++++ b/drivers/net/ethernet/mellanox/mlxsw/core.c |
760 |
+@@ -1281,6 +1281,8 @@ void mlxsw_core_bus_device_unregister(struct mlxsw_core *mlxsw_core, |
761 |
+ if (!reload) |
762 |
+ devlink_resources_unregister(devlink, NULL); |
763 |
+ mlxsw_core->bus->fini(mlxsw_core->bus_priv); |
764 |
++ if (!reload) |
765 |
++ devlink_free(devlink); |
766 |
+ |
767 |
+ return; |
768 |
+ |
769 |
+diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c |
770 |
+index f838abdb35e1d..d8881ba773dee 100644 |
771 |
+--- a/drivers/net/ethernet/realtek/r8169_main.c |
772 |
++++ b/drivers/net/ethernet/realtek/r8169_main.c |
773 |
+@@ -6264,7 +6264,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) |
774 |
+ } |
775 |
+ |
776 |
+ rtl_irq_disable(tp); |
777 |
+- napi_schedule_irqoff(&tp->napi); |
778 |
++ napi_schedule(&tp->napi); |
779 |
+ out: |
780 |
+ rtl_ack_events(tp, status); |
781 |
+ |
782 |
+@@ -6470,7 +6470,7 @@ static int rtl_open(struct net_device *dev) |
783 |
+ rtl_request_firmware(tp); |
784 |
+ |
785 |
+ retval = request_irq(pci_irq_vector(pdev, 0), rtl8169_interrupt, |
786 |
+- IRQF_NO_THREAD | IRQF_SHARED, dev->name, tp); |
787 |
++ IRQF_SHARED, dev->name, tp); |
788 |
+ if (retval < 0) |
789 |
+ goto err_release_fw_2; |
790 |
+ |
791 |
+diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c |
792 |
+index 30cdabf64ccc1..551799fb3842d 100644 |
793 |
+--- a/drivers/net/ethernet/renesas/ravb_main.c |
794 |
++++ b/drivers/net/ethernet/renesas/ravb_main.c |
795 |
+@@ -1741,12 +1741,16 @@ static int ravb_hwtstamp_get(struct net_device *ndev, struct ifreq *req) |
796 |
+ config.flags = 0; |
797 |
+ config.tx_type = priv->tstamp_tx_ctrl ? HWTSTAMP_TX_ON : |
798 |
+ HWTSTAMP_TX_OFF; |
799 |
+- if (priv->tstamp_rx_ctrl & RAVB_RXTSTAMP_TYPE_V2_L2_EVENT) |
800 |
++ switch (priv->tstamp_rx_ctrl & RAVB_RXTSTAMP_TYPE) { |
801 |
++ case RAVB_RXTSTAMP_TYPE_V2_L2_EVENT: |
802 |
+ config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT; |
803 |
+- else if (priv->tstamp_rx_ctrl & RAVB_RXTSTAMP_TYPE_ALL) |
804 |
++ break; |
805 |
++ case RAVB_RXTSTAMP_TYPE_ALL: |
806 |
+ config.rx_filter = HWTSTAMP_FILTER_ALL; |
807 |
+- else |
808 |
++ break; |
809 |
++ default: |
810 |
+ config.rx_filter = HWTSTAMP_FILTER_NONE; |
811 |
++ } |
812 |
+ |
813 |
+ return copy_to_user(req->ifr_data, &config, sizeof(config)) ? |
814 |
+ -EFAULT : 0; |
815 |
+diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c |
816 |
+index 634bdea38ecb3..4e19c3149848b 100644 |
817 |
+--- a/drivers/net/gtp.c |
818 |
++++ b/drivers/net/gtp.c |
819 |
+@@ -663,10 +663,6 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, |
820 |
+ |
821 |
+ gtp = netdev_priv(dev); |
822 |
+ |
823 |
+- err = gtp_encap_enable(gtp, data); |
824 |
+- if (err < 0) |
825 |
+- return err; |
826 |
+- |
827 |
+ if (!data[IFLA_GTP_PDP_HASHSIZE]) { |
828 |
+ hashsize = 1024; |
829 |
+ } else { |
830 |
+@@ -677,12 +673,16 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, |
831 |
+ |
832 |
+ err = gtp_hashtable_new(gtp, hashsize); |
833 |
+ if (err < 0) |
834 |
+- goto out_encap; |
835 |
++ return err; |
836 |
++ |
837 |
++ err = gtp_encap_enable(gtp, data); |
838 |
++ if (err < 0) |
839 |
++ goto out_hashtable; |
840 |
+ |
841 |
+ err = register_netdevice(dev); |
842 |
+ if (err < 0) { |
843 |
+ netdev_dbg(dev, "failed to register new netdev %d\n", err); |
844 |
+- goto out_hashtable; |
845 |
++ goto out_encap; |
846 |
+ } |
847 |
+ |
848 |
+ gn = net_generic(dev_net(dev), gtp_net_id); |
849 |
+@@ -693,11 +693,11 @@ static int gtp_newlink(struct net *src_net, struct net_device *dev, |
850 |
+ |
851 |
+ return 0; |
852 |
+ |
853 |
++out_encap: |
854 |
++ gtp_encap_disable(gtp); |
855 |
+ out_hashtable: |
856 |
+ kfree(gtp->addr_hash); |
857 |
+ kfree(gtp->tid_hash); |
858 |
+-out_encap: |
859 |
+- gtp_encap_disable(gtp); |
860 |
+ return err; |
861 |
+ } |
862 |
+ |
863 |
+diff --git a/drivers/net/wireless/intersil/p54/p54pci.c b/drivers/net/wireless/intersil/p54/p54pci.c |
864 |
+index 80ad0b7eaef43..f8c6027cab6b4 100644 |
865 |
+--- a/drivers/net/wireless/intersil/p54/p54pci.c |
866 |
++++ b/drivers/net/wireless/intersil/p54/p54pci.c |
867 |
+@@ -329,10 +329,12 @@ static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb) |
868 |
+ struct p54p_desc *desc; |
869 |
+ dma_addr_t mapping; |
870 |
+ u32 idx, i; |
871 |
++ __le32 device_addr; |
872 |
+ |
873 |
+ spin_lock_irqsave(&priv->lock, flags); |
874 |
+ idx = le32_to_cpu(ring_control->host_idx[1]); |
875 |
+ i = idx % ARRAY_SIZE(ring_control->tx_data); |
876 |
++ device_addr = ((struct p54_hdr *)skb->data)->req_id; |
877 |
+ |
878 |
+ mapping = pci_map_single(priv->pdev, skb->data, skb->len, |
879 |
+ PCI_DMA_TODEVICE); |
880 |
+@@ -346,7 +348,7 @@ static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb) |
881 |
+ |
882 |
+ desc = &ring_control->tx_data[i]; |
883 |
+ desc->host_addr = cpu_to_le32(mapping); |
884 |
+- desc->device_addr = ((struct p54_hdr *)skb->data)->req_id; |
885 |
++ desc->device_addr = device_addr; |
886 |
+ desc->len = cpu_to_le16(skb->len); |
887 |
+ desc->flags = 0; |
888 |
+ |
889 |
+diff --git a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c |
890 |
+index 1a138be8bd6a0..810f25a476321 100644 |
891 |
+--- a/drivers/phy/marvell/phy-mvebu-a3700-comphy.c |
892 |
++++ b/drivers/phy/marvell/phy-mvebu-a3700-comphy.c |
893 |
+@@ -26,7 +26,6 @@ |
894 |
+ #define COMPHY_SIP_POWER_ON 0x82000001 |
895 |
+ #define COMPHY_SIP_POWER_OFF 0x82000002 |
896 |
+ #define COMPHY_SIP_PLL_LOCK 0x82000003 |
897 |
+-#define COMPHY_FW_NOT_SUPPORTED (-1) |
898 |
+ |
899 |
+ #define COMPHY_FW_MODE_SATA 0x1 |
900 |
+ #define COMPHY_FW_MODE_SGMII 0x2 |
901 |
+@@ -112,10 +111,19 @@ static int mvebu_a3700_comphy_smc(unsigned long function, unsigned long lane, |
902 |
+ unsigned long mode) |
903 |
+ { |
904 |
+ struct arm_smccc_res res; |
905 |
++ s32 ret; |
906 |
+ |
907 |
+ arm_smccc_smc(function, lane, mode, 0, 0, 0, 0, 0, &res); |
908 |
++ ret = res.a0; |
909 |
+ |
910 |
+- return res.a0; |
911 |
++ switch (ret) { |
912 |
++ case SMCCC_RET_SUCCESS: |
913 |
++ return 0; |
914 |
++ case SMCCC_RET_NOT_SUPPORTED: |
915 |
++ return -EOPNOTSUPP; |
916 |
++ default: |
917 |
++ return -EINVAL; |
918 |
++ } |
919 |
+ } |
920 |
+ |
921 |
+ static int mvebu_a3700_comphy_get_fw_mode(int lane, int port, |
922 |
+@@ -220,7 +228,7 @@ static int mvebu_a3700_comphy_power_on(struct phy *phy) |
923 |
+ } |
924 |
+ |
925 |
+ ret = mvebu_a3700_comphy_smc(COMPHY_SIP_POWER_ON, lane->id, fw_param); |
926 |
+- if (ret == COMPHY_FW_NOT_SUPPORTED) |
927 |
++ if (ret == -EOPNOTSUPP) |
928 |
+ dev_err(lane->dev, |
929 |
+ "unsupported SMC call, try updating your firmware\n"); |
930 |
+ |
931 |
+diff --git a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c |
932 |
+index e3b87c94aaf69..849351b4805f5 100644 |
933 |
+--- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c |
934 |
++++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c |
935 |
+@@ -123,7 +123,6 @@ |
936 |
+ |
937 |
+ #define COMPHY_SIP_POWER_ON 0x82000001 |
938 |
+ #define COMPHY_SIP_POWER_OFF 0x82000002 |
939 |
+-#define COMPHY_FW_NOT_SUPPORTED (-1) |
940 |
+ |
941 |
+ /* |
942 |
+ * A lane is described by the following bitfields: |
943 |
+@@ -273,10 +272,19 @@ static int mvebu_comphy_smc(unsigned long function, unsigned long phys, |
944 |
+ unsigned long lane, unsigned long mode) |
945 |
+ { |
946 |
+ struct arm_smccc_res res; |
947 |
++ s32 ret; |
948 |
+ |
949 |
+ arm_smccc_smc(function, phys, lane, mode, 0, 0, 0, 0, &res); |
950 |
++ ret = res.a0; |
951 |
+ |
952 |
+- return res.a0; |
953 |
++ switch (ret) { |
954 |
++ case SMCCC_RET_SUCCESS: |
955 |
++ return 0; |
956 |
++ case SMCCC_RET_NOT_SUPPORTED: |
957 |
++ return -EOPNOTSUPP; |
958 |
++ default: |
959 |
++ return -EINVAL; |
960 |
++ } |
961 |
+ } |
962 |
+ |
963 |
+ static int mvebu_comphy_get_mode(bool fw_mode, int lane, int port, |
964 |
+@@ -819,7 +827,7 @@ static int mvebu_comphy_power_on(struct phy *phy) |
965 |
+ if (!ret) |
966 |
+ return ret; |
967 |
+ |
968 |
+- if (ret == COMPHY_FW_NOT_SUPPORTED) |
969 |
++ if (ret == -EOPNOTSUPP) |
970 |
+ dev_err(priv->dev, |
971 |
+ "unsupported SMC call, try updating your firmware\n"); |
972 |
+ |
973 |
+diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c |
974 |
+index a8a538b34b535..16720c97a4dde 100644 |
975 |
+--- a/drivers/tty/serial/amba-pl011.c |
976 |
++++ b/drivers/tty/serial/amba-pl011.c |
977 |
+@@ -313,8 +313,9 @@ static void pl011_write(unsigned int val, const struct uart_amba_port *uap, |
978 |
+ */ |
979 |
+ static int pl011_fifo_to_tty(struct uart_amba_port *uap) |
980 |
+ { |
981 |
+- u16 status; |
982 |
+ unsigned int ch, flag, fifotaken; |
983 |
++ int sysrq; |
984 |
++ u16 status; |
985 |
+ |
986 |
+ for (fifotaken = 0; fifotaken != 256; fifotaken++) { |
987 |
+ status = pl011_read(uap, REG_FR); |
988 |
+@@ -349,10 +350,12 @@ static int pl011_fifo_to_tty(struct uart_amba_port *uap) |
989 |
+ flag = TTY_FRAME; |
990 |
+ } |
991 |
+ |
992 |
+- if (uart_handle_sysrq_char(&uap->port, ch & 255)) |
993 |
+- continue; |
994 |
++ spin_unlock(&uap->port.lock); |
995 |
++ sysrq = uart_handle_sysrq_char(&uap->port, ch & 255); |
996 |
++ spin_lock(&uap->port.lock); |
997 |
+ |
998 |
+- uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag); |
999 |
++ if (!sysrq) |
1000 |
++ uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag); |
1001 |
+ } |
1002 |
+ |
1003 |
+ return fifotaken; |
1004 |
+diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c |
1005 |
+index 0b184256034fb..9b148f78323f0 100644 |
1006 |
+--- a/drivers/tty/serial/qcom_geni_serial.c |
1007 |
++++ b/drivers/tty/serial/qcom_geni_serial.c |
1008 |
+@@ -970,7 +970,7 @@ static void qcom_geni_serial_set_termios(struct uart_port *uport, |
1009 |
+ sampling_rate = UART_OVERSAMPLING; |
1010 |
+ /* Sampling rate is halved for IP versions >= 2.5 */ |
1011 |
+ ver = geni_se_get_qup_hw_version(&port->se); |
1012 |
+- if (GENI_SE_VERSION_MAJOR(ver) >= 2 && GENI_SE_VERSION_MINOR(ver) >= 5) |
1013 |
++ if (ver >= QUP_SE_VERSION_2_5) |
1014 |
+ sampling_rate /= 2; |
1015 |
+ |
1016 |
+ clk_rate = get_clk_div_rate(baud, sampling_rate, &clk_div); |
1017 |
+diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c |
1018 |
+index 81401f386c9ce..246864bbb3e4e 100644 |
1019 |
+--- a/drivers/xen/gntdev.c |
1020 |
++++ b/drivers/xen/gntdev.c |
1021 |
+@@ -831,17 +831,18 @@ struct gntdev_copy_batch { |
1022 |
+ s16 __user *status[GNTDEV_COPY_BATCH]; |
1023 |
+ unsigned int nr_ops; |
1024 |
+ unsigned int nr_pages; |
1025 |
++ bool writeable; |
1026 |
+ }; |
1027 |
+ |
1028 |
+ static int gntdev_get_page(struct gntdev_copy_batch *batch, void __user *virt, |
1029 |
+- bool writeable, unsigned long *gfn) |
1030 |
++ unsigned long *gfn) |
1031 |
+ { |
1032 |
+ unsigned long addr = (unsigned long)virt; |
1033 |
+ struct page *page; |
1034 |
+ unsigned long xen_pfn; |
1035 |
+ int ret; |
1036 |
+ |
1037 |
+- ret = get_user_pages_fast(addr, 1, writeable ? FOLL_WRITE : 0, &page); |
1038 |
++ ret = get_user_pages_fast(addr, 1, batch->writeable ? FOLL_WRITE : 0, &page); |
1039 |
+ if (ret < 0) |
1040 |
+ return ret; |
1041 |
+ |
1042 |
+@@ -857,9 +858,13 @@ static void gntdev_put_pages(struct gntdev_copy_batch *batch) |
1043 |
+ { |
1044 |
+ unsigned int i; |
1045 |
+ |
1046 |
+- for (i = 0; i < batch->nr_pages; i++) |
1047 |
++ for (i = 0; i < batch->nr_pages; i++) { |
1048 |
++ if (batch->writeable && !PageDirty(batch->pages[i])) |
1049 |
++ set_page_dirty_lock(batch->pages[i]); |
1050 |
+ put_page(batch->pages[i]); |
1051 |
++ } |
1052 |
+ batch->nr_pages = 0; |
1053 |
++ batch->writeable = false; |
1054 |
+ } |
1055 |
+ |
1056 |
+ static int gntdev_copy(struct gntdev_copy_batch *batch) |
1057 |
+@@ -948,8 +953,9 @@ static int gntdev_grant_copy_seg(struct gntdev_copy_batch *batch, |
1058 |
+ virt = seg->source.virt + copied; |
1059 |
+ off = (unsigned long)virt & ~XEN_PAGE_MASK; |
1060 |
+ len = min(len, (size_t)XEN_PAGE_SIZE - off); |
1061 |
++ batch->writeable = false; |
1062 |
+ |
1063 |
+- ret = gntdev_get_page(batch, virt, false, &gfn); |
1064 |
++ ret = gntdev_get_page(batch, virt, &gfn); |
1065 |
+ if (ret < 0) |
1066 |
+ return ret; |
1067 |
+ |
1068 |
+@@ -967,8 +973,9 @@ static int gntdev_grant_copy_seg(struct gntdev_copy_batch *batch, |
1069 |
+ virt = seg->dest.virt + copied; |
1070 |
+ off = (unsigned long)virt & ~XEN_PAGE_MASK; |
1071 |
+ len = min(len, (size_t)XEN_PAGE_SIZE - off); |
1072 |
++ batch->writeable = true; |
1073 |
+ |
1074 |
+- ret = gntdev_get_page(batch, virt, true, &gfn); |
1075 |
++ ret = gntdev_get_page(batch, virt, &gfn); |
1076 |
+ if (ret < 0) |
1077 |
+ return ret; |
1078 |
+ |
1079 |
+diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c |
1080 |
+index fa4f6447ddad6..9760a52800b42 100644 |
1081 |
+--- a/fs/efivarfs/super.c |
1082 |
++++ b/fs/efivarfs/super.c |
1083 |
+@@ -141,6 +141,9 @@ static int efivarfs_callback(efi_char16_t *name16, efi_guid_t vendor, |
1084 |
+ |
1085 |
+ name[len + EFI_VARIABLE_GUID_LEN+1] = '\0'; |
1086 |
+ |
1087 |
++ /* replace invalid slashes like kobject_set_name_vargs does for /sys/firmware/efi/vars. */ |
1088 |
++ strreplace(name, '/', '!'); |
1089 |
++ |
1090 |
+ inode = efivarfs_get_inode(sb, d_inode(root), S_IFREG | 0644, 0, |
1091 |
+ is_removable); |
1092 |
+ if (!inode) |
1093 |
+diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c |
1094 |
+index b766c3ee5fa8c..503bea20cde26 100644 |
1095 |
+--- a/fs/erofs/xattr.c |
1096 |
++++ b/fs/erofs/xattr.c |
1097 |
+@@ -473,8 +473,6 @@ static int erofs_xattr_generic_get(const struct xattr_handler *handler, |
1098 |
+ return -EOPNOTSUPP; |
1099 |
+ break; |
1100 |
+ case EROFS_XATTR_INDEX_TRUSTED: |
1101 |
+- if (!capable(CAP_SYS_ADMIN)) |
1102 |
+- return -EPERM; |
1103 |
+ break; |
1104 |
+ case EROFS_XATTR_INDEX_SECURITY: |
1105 |
+ break; |
1106 |
+diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c |
1107 |
+index f9022b7028754..40c262b3f9ff5 100644 |
1108 |
+--- a/fs/fuse/dev.c |
1109 |
++++ b/fs/fuse/dev.c |
1110 |
+@@ -786,15 +786,16 @@ static int fuse_try_move_page(struct fuse_copy_state *cs, struct page **pagep) |
1111 |
+ struct page *newpage; |
1112 |
+ struct pipe_buffer *buf = cs->pipebufs; |
1113 |
+ |
1114 |
++ get_page(oldpage); |
1115 |
+ err = unlock_request(cs->req); |
1116 |
+ if (err) |
1117 |
+- return err; |
1118 |
++ goto out_put_old; |
1119 |
+ |
1120 |
+ fuse_copy_finish(cs); |
1121 |
+ |
1122 |
+ err = pipe_buf_confirm(cs->pipe, buf); |
1123 |
+ if (err) |
1124 |
+- return err; |
1125 |
++ goto out_put_old; |
1126 |
+ |
1127 |
+ BUG_ON(!cs->nr_segs); |
1128 |
+ cs->currbuf = buf; |
1129 |
+@@ -834,7 +835,7 @@ static int fuse_try_move_page(struct fuse_copy_state *cs, struct page **pagep) |
1130 |
+ err = replace_page_cache_page(oldpage, newpage, GFP_KERNEL); |
1131 |
+ if (err) { |
1132 |
+ unlock_page(newpage); |
1133 |
+- return err; |
1134 |
++ goto out_put_old; |
1135 |
+ } |
1136 |
+ |
1137 |
+ get_page(newpage); |
1138 |
+@@ -853,14 +854,19 @@ static int fuse_try_move_page(struct fuse_copy_state *cs, struct page **pagep) |
1139 |
+ if (err) { |
1140 |
+ unlock_page(newpage); |
1141 |
+ put_page(newpage); |
1142 |
+- return err; |
1143 |
++ goto out_put_old; |
1144 |
+ } |
1145 |
+ |
1146 |
+ unlock_page(oldpage); |
1147 |
++ /* Drop ref for ap->pages[] array */ |
1148 |
+ put_page(oldpage); |
1149 |
+ cs->len = 0; |
1150 |
+ |
1151 |
+- return 0; |
1152 |
++ err = 0; |
1153 |
++out_put_old: |
1154 |
++ /* Drop ref obtained in this function */ |
1155 |
++ put_page(oldpage); |
1156 |
++ return err; |
1157 |
+ |
1158 |
+ out_fallback_unlock: |
1159 |
+ unlock_page(newpage); |
1160 |
+@@ -869,10 +875,10 @@ out_fallback: |
1161 |
+ cs->offset = buf->offset; |
1162 |
+ |
1163 |
+ err = lock_request(cs->req); |
1164 |
+- if (err) |
1165 |
+- return err; |
1166 |
++ if (!err) |
1167 |
++ err = 1; |
1168 |
+ |
1169 |
+- return 1; |
1170 |
++ goto out_put_old; |
1171 |
+ } |
1172 |
+ |
1173 |
+ static int fuse_ref_page(struct fuse_copy_state *cs, struct page *page, |
1174 |
+@@ -884,14 +890,16 @@ static int fuse_ref_page(struct fuse_copy_state *cs, struct page *page, |
1175 |
+ if (cs->nr_segs == cs->pipe->buffers) |
1176 |
+ return -EIO; |
1177 |
+ |
1178 |
++ get_page(page); |
1179 |
+ err = unlock_request(cs->req); |
1180 |
+- if (err) |
1181 |
++ if (err) { |
1182 |
++ put_page(page); |
1183 |
+ return err; |
1184 |
++ } |
1185 |
+ |
1186 |
+ fuse_copy_finish(cs); |
1187 |
+ |
1188 |
+ buf = cs->pipebufs; |
1189 |
+- get_page(page); |
1190 |
+ buf->page = page; |
1191 |
+ buf->offset = offset; |
1192 |
+ buf->len = count; |
1193 |
+diff --git a/include/linux/mtd/pfow.h b/include/linux/mtd/pfow.h |
1194 |
+index 122f3439e1af2..c65d7a3be3c69 100644 |
1195 |
+--- a/include/linux/mtd/pfow.h |
1196 |
++++ b/include/linux/mtd/pfow.h |
1197 |
+@@ -128,7 +128,7 @@ static inline void print_drs_error(unsigned dsr) |
1198 |
+ |
1199 |
+ if (!(dsr & DSR_AVAILABLE)) |
1200 |
+ printk(KERN_NOTICE"DSR.15: (0) Device not Available\n"); |
1201 |
+- if (prog_status & 0x03) |
1202 |
++ if ((prog_status & 0x03) == 0x03) |
1203 |
+ printk(KERN_NOTICE"DSR.9,8: (11) Attempt to program invalid " |
1204 |
+ "half with 41h command\n"); |
1205 |
+ else if (prog_status & 0x02) |
1206 |
+diff --git a/include/linux/pm.h b/include/linux/pm.h |
1207 |
+index 4c441be03079d..c1d21e9a864f3 100644 |
1208 |
+--- a/include/linux/pm.h |
1209 |
++++ b/include/linux/pm.h |
1210 |
+@@ -598,7 +598,7 @@ struct dev_pm_info { |
1211 |
+ #endif |
1212 |
+ #ifdef CONFIG_PM |
1213 |
+ struct hrtimer suspend_timer; |
1214 |
+- unsigned long timer_expires; |
1215 |
++ u64 timer_expires; |
1216 |
+ struct work_struct work; |
1217 |
+ wait_queue_head_t wait_queue; |
1218 |
+ struct wake_irq *wakeirq; |
1219 |
+diff --git a/include/linux/qcom-geni-se.h b/include/linux/qcom-geni-se.h |
1220 |
+index dd464943f717a..5b90eff50bf6e 100644 |
1221 |
+--- a/include/linux/qcom-geni-se.h |
1222 |
++++ b/include/linux/qcom-geni-se.h |
1223 |
+@@ -229,6 +229,9 @@ struct geni_se { |
1224 |
+ #define GENI_SE_VERSION_MINOR(ver) ((ver & HW_VER_MINOR_MASK) >> HW_VER_MINOR_SHFT) |
1225 |
+ #define GENI_SE_VERSION_STEP(ver) (ver & HW_VER_STEP_MASK) |
1226 |
+ |
1227 |
++/* QUP SE VERSION value for major number 2 and minor number 5 */ |
1228 |
++#define QUP_SE_VERSION_2_5 0x20050000 |
1229 |
++ |
1230 |
+ #if IS_ENABLED(CONFIG_QCOM_GENI_SE) |
1231 |
+ |
1232 |
+ u32 geni_se_get_qup_hw_version(struct geni_se *se); |
1233 |
+diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h |
1234 |
+index bc2c73f549622..a576bcbba2fcc 100644 |
1235 |
+--- a/include/net/netfilter/nf_tables.h |
1236 |
++++ b/include/net/netfilter/nf_tables.h |
1237 |
+@@ -872,6 +872,12 @@ static inline struct nft_expr *nft_expr_last(const struct nft_rule *rule) |
1238 |
+ return (struct nft_expr *)&rule->data[rule->dlen]; |
1239 |
+ } |
1240 |
+ |
1241 |
++static inline bool nft_expr_more(const struct nft_rule *rule, |
1242 |
++ const struct nft_expr *expr) |
1243 |
++{ |
1244 |
++ return expr != nft_expr_last(rule) && expr->ops; |
1245 |
++} |
1246 |
++ |
1247 |
+ static inline struct nft_userdata *nft_userdata(const struct nft_rule *rule) |
1248 |
+ { |
1249 |
+ return (void *)&rule->data[rule->dlen]; |
1250 |
+diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h |
1251 |
+index 77c6be96d6762..8649422e760cc 100644 |
1252 |
+--- a/include/uapi/linux/bpf.h |
1253 |
++++ b/include/uapi/linux/bpf.h |
1254 |
+@@ -1294,8 +1294,8 @@ union bpf_attr { |
1255 |
+ * Return |
1256 |
+ * The return value depends on the result of the test, and can be: |
1257 |
+ * |
1258 |
+- * * 0, if the *skb* task belongs to the cgroup2. |
1259 |
+- * * 1, if the *skb* task does not belong to the cgroup2. |
1260 |
++ * * 0, if current task belongs to the cgroup2. |
1261 |
++ * * 1, if current task does not belong to the cgroup2. |
1262 |
+ * * A negative error code, if an error occurred. |
1263 |
+ * |
1264 |
+ * int bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags) |
1265 |
+diff --git a/net/core/sock.c b/net/core/sock.c |
1266 |
+index 1b765e62658f0..33543d59a10d6 100644 |
1267 |
+--- a/net/core/sock.c |
1268 |
++++ b/net/core/sock.c |
1269 |
+@@ -923,7 +923,6 @@ set_rcvbuf: |
1270 |
+ } else { |
1271 |
+ sock_reset_flag(sk, SOCK_RCVTSTAMP); |
1272 |
+ sock_reset_flag(sk, SOCK_RCVTSTAMPNS); |
1273 |
+- sock_reset_flag(sk, SOCK_TSTAMP_NEW); |
1274 |
+ } |
1275 |
+ break; |
1276 |
+ |
1277 |
+diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
1278 |
+index 97f2b11ce2034..d3ced6a39bcf1 100644 |
1279 |
+--- a/net/ipv4/tcp.c |
1280 |
++++ b/net/ipv4/tcp.c |
1281 |
+@@ -484,6 +484,8 @@ static inline bool tcp_stream_is_readable(const struct tcp_sock *tp, |
1282 |
+ return true; |
1283 |
+ if (tcp_rmem_pressure(sk)) |
1284 |
+ return true; |
1285 |
++ if (tcp_receive_window(tp) <= inet_csk(sk)->icsk_ack.rcv_mss) |
1286 |
++ return true; |
1287 |
+ } |
1288 |
+ if (sk->sk_prot->stream_memory_read) |
1289 |
+ return sk->sk_prot->stream_memory_read(sk); |
1290 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
1291 |
+index 62f8ba4048180..54fd6bc5adcca 100644 |
1292 |
+--- a/net/ipv4/tcp_input.c |
1293 |
++++ b/net/ipv4/tcp_input.c |
1294 |
+@@ -4774,7 +4774,8 @@ void tcp_data_ready(struct sock *sk) |
1295 |
+ int avail = tp->rcv_nxt - tp->copied_seq; |
1296 |
+ |
1297 |
+ if (avail < sk->sk_rcvlowat && !tcp_rmem_pressure(sk) && |
1298 |
+- !sock_flag(sk, SOCK_DONE)) |
1299 |
++ !sock_flag(sk, SOCK_DONE) && |
1300 |
++ tcp_receive_window(tp) > inet_csk(sk)->icsk_ack.rcv_mss) |
1301 |
+ return; |
1302 |
+ |
1303 |
+ sk->sk_data_ready(sk); |
1304 |
+diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c |
1305 |
+index ff2d2b514506e..5a77b7a177229 100644 |
1306 |
+--- a/net/netfilter/nf_tables_api.c |
1307 |
++++ b/net/netfilter/nf_tables_api.c |
1308 |
+@@ -254,7 +254,7 @@ static void nft_rule_expr_activate(const struct nft_ctx *ctx, |
1309 |
+ struct nft_expr *expr; |
1310 |
+ |
1311 |
+ expr = nft_expr_first(rule); |
1312 |
+- while (expr != nft_expr_last(rule) && expr->ops) { |
1313 |
++ while (nft_expr_more(rule, expr)) { |
1314 |
+ if (expr->ops->activate) |
1315 |
+ expr->ops->activate(ctx, expr); |
1316 |
+ |
1317 |
+@@ -269,7 +269,7 @@ static void nft_rule_expr_deactivate(const struct nft_ctx *ctx, |
1318 |
+ struct nft_expr *expr; |
1319 |
+ |
1320 |
+ expr = nft_expr_first(rule); |
1321 |
+- while (expr != nft_expr_last(rule) && expr->ops) { |
1322 |
++ while (nft_expr_more(rule, expr)) { |
1323 |
+ if (expr->ops->deactivate) |
1324 |
+ expr->ops->deactivate(ctx, expr, phase); |
1325 |
+ |
1326 |
+@@ -2642,7 +2642,7 @@ static void nf_tables_rule_destroy(const struct nft_ctx *ctx, |
1327 |
+ * is called on error from nf_tables_newrule(). |
1328 |
+ */ |
1329 |
+ expr = nft_expr_first(rule); |
1330 |
+- while (expr != nft_expr_last(rule) && expr->ops) { |
1331 |
++ while (nft_expr_more(rule, expr)) { |
1332 |
+ next = nft_expr_next(expr); |
1333 |
+ nf_tables_expr_destroy(ctx, expr); |
1334 |
+ expr = next; |
1335 |
+diff --git a/net/netfilter/nf_tables_offload.c b/net/netfilter/nf_tables_offload.c |
1336 |
+index 914cd0618d5a6..c480549a7f946 100644 |
1337 |
+--- a/net/netfilter/nf_tables_offload.c |
1338 |
++++ b/net/netfilter/nf_tables_offload.c |
1339 |
+@@ -37,7 +37,7 @@ struct nft_flow_rule *nft_flow_rule_create(struct net *net, |
1340 |
+ struct nft_expr *expr; |
1341 |
+ |
1342 |
+ expr = nft_expr_first(rule); |
1343 |
+- while (expr->ops && expr != nft_expr_last(rule)) { |
1344 |
++ while (nft_expr_more(rule, expr)) { |
1345 |
+ if (expr->ops->offload_flags & NFT_OFFLOAD_F_ACTION) |
1346 |
+ num_actions++; |
1347 |
+ |
1348 |
+@@ -61,7 +61,7 @@ struct nft_flow_rule *nft_flow_rule_create(struct net *net, |
1349 |
+ ctx->net = net; |
1350 |
+ ctx->dep.type = NFT_OFFLOAD_DEP_UNSPEC; |
1351 |
+ |
1352 |
+- while (expr->ops && expr != nft_expr_last(rule)) { |
1353 |
++ while (nft_expr_more(rule, expr)) { |
1354 |
+ if (!expr->ops->offload) { |
1355 |
+ err = -EOPNOTSUPP; |
1356 |
+ goto err_out; |
1357 |
+diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c |
1358 |
+index f496c99d98266..7954021ade33d 100644 |
1359 |
+--- a/net/sched/act_mpls.c |
1360 |
++++ b/net/sched/act_mpls.c |
1361 |
+@@ -408,6 +408,7 @@ static void __exit mpls_cleanup_module(void) |
1362 |
+ module_init(mpls_init_module); |
1363 |
+ module_exit(mpls_cleanup_module); |
1364 |
+ |
1365 |
++MODULE_SOFTDEP("post: mpls_gso"); |
1366 |
+ MODULE_AUTHOR("Netronome Systems <oss-drivers@×××××××××.com>"); |
1367 |
+ MODULE_LICENSE("GPL"); |
1368 |
+ MODULE_DESCRIPTION("MPLS manipulation actions"); |
1369 |
+diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c |
1370 |
+index 42e557d48e4e3..f4101a920d1f9 100644 |
1371 |
+--- a/net/sched/sch_netem.c |
1372 |
++++ b/net/sched/sch_netem.c |
1373 |
+@@ -330,7 +330,7 @@ static s64 tabledist(s64 mu, s32 sigma, |
1374 |
+ |
1375 |
+ /* default uniform distribution */ |
1376 |
+ if (dist == NULL) |
1377 |
+- return ((rnd % (2 * sigma)) + mu) - sigma; |
1378 |
++ return ((rnd % (2 * (u32)sigma)) + mu) - sigma; |
1379 |
+ |
1380 |
+ t = dist->table[rnd % dist->size]; |
1381 |
+ x = (sigma % NETEM_DIST_SCALE) * t; |
1382 |
+@@ -812,6 +812,10 @@ static void get_slot(struct netem_sched_data *q, const struct nlattr *attr) |
1383 |
+ q->slot_config.max_packets = INT_MAX; |
1384 |
+ if (q->slot_config.max_bytes == 0) |
1385 |
+ q->slot_config.max_bytes = INT_MAX; |
1386 |
++ |
1387 |
++ /* capping dist_jitter to the range acceptable by tabledist() */ |
1388 |
++ q->slot_config.dist_jitter = min_t(__s64, INT_MAX, abs(q->slot_config.dist_jitter)); |
1389 |
++ |
1390 |
+ q->slot.packets_left = q->slot_config.max_packets; |
1391 |
+ q->slot.bytes_left = q->slot_config.max_bytes; |
1392 |
+ if (q->slot_config.min_delay | q->slot_config.max_delay | |
1393 |
+@@ -1037,6 +1041,9 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt, |
1394 |
+ if (tb[TCA_NETEM_SLOT]) |
1395 |
+ get_slot(q, tb[TCA_NETEM_SLOT]); |
1396 |
+ |
1397 |
++ /* capping jitter to the range acceptable by tabledist() */ |
1398 |
++ q->jitter = min_t(s64, abs(q->jitter), INT_MAX); |
1399 |
++ |
1400 |
+ return ret; |
1401 |
+ |
1402 |
+ get_table_failure: |
1403 |
+diff --git a/net/tipc/msg.c b/net/tipc/msg.c |
1404 |
+index b0ed3c944b2d1..46e89c992c2dc 100644 |
1405 |
+--- a/net/tipc/msg.c |
1406 |
++++ b/net/tipc/msg.c |
1407 |
+@@ -140,12 +140,11 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf) |
1408 |
+ if (fragid == FIRST_FRAGMENT) { |
1409 |
+ if (unlikely(head)) |
1410 |
+ goto err; |
1411 |
+- if (skb_cloned(frag)) |
1412 |
+- frag = skb_copy(frag, GFP_ATOMIC); |
1413 |
++ *buf = NULL; |
1414 |
++ frag = skb_unshare(frag, GFP_ATOMIC); |
1415 |
+ if (unlikely(!frag)) |
1416 |
+ goto err; |
1417 |
+ head = *headbuf = frag; |
1418 |
+- *buf = NULL; |
1419 |
+ TIPC_SKB_CB(head)->tail = NULL; |
1420 |
+ if (skb_is_nonlinear(head)) { |
1421 |
+ skb_walk_frags(head, tail) { |
1422 |
+diff --git a/scripts/setlocalversion b/scripts/setlocalversion |
1423 |
+index a2998b118ef9e..45609dba7d724 100755 |
1424 |
+--- a/scripts/setlocalversion |
1425 |
++++ b/scripts/setlocalversion |
1426 |
+@@ -45,7 +45,7 @@ scm_version() |
1427 |
+ |
1428 |
+ # Check for git and a git repo. |
1429 |
+ if test -z "$(git rev-parse --show-cdup 2>/dev/null)" && |
1430 |
+- head=`git rev-parse --verify --short HEAD 2>/dev/null`; then |
1431 |
++ head=$(git rev-parse --verify HEAD 2>/dev/null); then |
1432 |
+ |
1433 |
+ # If we are at a tagged commit (like "v2.6.30-rc6"), we ignore |
1434 |
+ # it, because this version is defined in the top level Makefile. |
1435 |
+@@ -59,11 +59,22 @@ scm_version() |
1436 |
+ fi |
1437 |
+ # If we are past a tagged commit (like |
1438 |
+ # "v2.6.30-rc5-302-g72357d5"), we pretty print it. |
1439 |
+- if atag="`git describe 2>/dev/null`"; then |
1440 |
+- echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' |
1441 |
+- |
1442 |
+- # If we don't have a tag at all we print -g{commitish}. |
1443 |
++ # |
1444 |
++ # Ensure the abbreviated sha1 has exactly 12 |
1445 |
++ # hex characters, to make the output |
1446 |
++ # independent of git version, local |
1447 |
++ # core.abbrev settings and/or total number of |
1448 |
++ # objects in the current repository - passing |
1449 |
++ # --abbrev=12 ensures a minimum of 12, and the |
1450 |
++ # awk substr() then picks the 'g' and first 12 |
1451 |
++ # hex chars. |
1452 |
++ if atag="$(git describe --abbrev=12 2>/dev/null)"; then |
1453 |
++ echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),substr($(NF),0,13))}' |
1454 |
++ |
1455 |
++ # If we don't have a tag at all we print -g{commitish}, |
1456 |
++ # again using exactly 12 hex chars. |
1457 |
+ else |
1458 |
++ head="$(echo $head | cut -c1-12)" |
1459 |
+ printf '%s%s' -g $head |
1460 |
+ fi |
1461 |
+ fi |
1462 |
+diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c |
1463 |
+index a2c393385db09..615094eda36d6 100644 |
1464 |
+--- a/security/integrity/evm/evm_main.c |
1465 |
++++ b/security/integrity/evm/evm_main.c |
1466 |
+@@ -183,6 +183,12 @@ static enum integrity_status evm_verify_hmac(struct dentry *dentry, |
1467 |
+ break; |
1468 |
+ case EVM_IMA_XATTR_DIGSIG: |
1469 |
+ case EVM_XATTR_PORTABLE_DIGSIG: |
1470 |
++ /* accept xattr with non-empty signature field */ |
1471 |
++ if (xattr_len <= sizeof(struct signature_v2_hdr)) { |
1472 |
++ evm_status = INTEGRITY_FAIL; |
1473 |
++ goto out; |
1474 |
++ } |
1475 |
++ |
1476 |
+ hdr = (struct signature_v2_hdr *)xattr_data; |
1477 |
+ digest.hdr.algo = hdr->hash_algo; |
1478 |
+ rc = evm_calc_hash(dentry, xattr_name, xattr_value, |
1479 |
+diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h |
1480 |
+index 77c6be96d6762..8649422e760cc 100644 |
1481 |
+--- a/tools/include/uapi/linux/bpf.h |
1482 |
++++ b/tools/include/uapi/linux/bpf.h |
1483 |
+@@ -1294,8 +1294,8 @@ union bpf_attr { |
1484 |
+ * Return |
1485 |
+ * The return value depends on the result of the test, and can be: |
1486 |
+ * |
1487 |
+- * * 0, if the *skb* task belongs to the cgroup2. |
1488 |
+- * * 1, if the *skb* task does not belong to the cgroup2. |
1489 |
++ * * 0, if current task belongs to the cgroup2. |
1490 |
++ * * 1, if current task does not belong to the cgroup2. |
1491 |
+ * * A negative error code, if an error occurred. |
1492 |
+ * |
1493 |
+ * int bpf_skb_change_tail(struct sk_buff *skb, u32 len, u64 flags) |
1494 |
+diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c |
1495 |
+index 27a4112848c2b..e8c34b0a8b00c 100644 |
1496 |
+--- a/tools/objtool/orc_gen.c |
1497 |
++++ b/tools/objtool/orc_gen.c |
1498 |
+@@ -88,11 +88,6 @@ static int create_orc_entry(struct section *u_sec, struct section *ip_relasec, |
1499 |
+ struct orc_entry *orc; |
1500 |
+ struct rela *rela; |
1501 |
+ |
1502 |
+- if (!insn_sec->sym) { |
1503 |
+- WARN("missing symbol for section %s", insn_sec->name); |
1504 |
+- return -1; |
1505 |
+- } |
1506 |
+- |
1507 |
+ /* populate ORC data */ |
1508 |
+ orc = (struct orc_entry *)u_sec->data->d_buf + idx; |
1509 |
+ memcpy(orc, o, sizeof(*orc)); |
1510 |
+@@ -105,8 +100,32 @@ static int create_orc_entry(struct section *u_sec, struct section *ip_relasec, |
1511 |
+ } |
1512 |
+ memset(rela, 0, sizeof(*rela)); |
1513 |
+ |
1514 |
+- rela->sym = insn_sec->sym; |
1515 |
+- rela->addend = insn_off; |
1516 |
++ if (insn_sec->sym) { |
1517 |
++ rela->sym = insn_sec->sym; |
1518 |
++ rela->addend = insn_off; |
1519 |
++ } else { |
1520 |
++ /* |
1521 |
++ * The Clang assembler doesn't produce section symbols, so we |
1522 |
++ * have to reference the function symbol instead: |
1523 |
++ */ |
1524 |
++ rela->sym = find_symbol_containing(insn_sec, insn_off); |
1525 |
++ if (!rela->sym) { |
1526 |
++ /* |
1527 |
++ * Hack alert. This happens when we need to reference |
1528 |
++ * the NOP pad insn immediately after the function. |
1529 |
++ */ |
1530 |
++ rela->sym = find_symbol_containing(insn_sec, |
1531 |
++ insn_off - 1); |
1532 |
++ } |
1533 |
++ if (!rela->sym) { |
1534 |
++ WARN("missing symbol for insn at offset 0x%lx\n", |
1535 |
++ insn_off); |
1536 |
++ return -1; |
1537 |
++ } |
1538 |
++ |
1539 |
++ rela->addend = insn_off - rela->sym->offset; |
1540 |
++ } |
1541 |
++ |
1542 |
+ rela->type = R_X86_64_PC32; |
1543 |
+ rela->offset = idx * sizeof(int); |
1544 |
+ |