Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.4 commit in: /
Date: Wed, 28 Jul 2021 12:39:52
Message-Id: 1627475977.a9625f49cc19be85b2641f04db485c8b9250ac2a.mpagano@gentoo
1 commit: a9625f49cc19be85b2641f04db485c8b9250ac2a
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jul 28 12:39:37 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 28 12:39:37 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=a9625f49
7
8 Linux patch 4.4.277
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1276_linux-4.4.277.patch | 1791 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 1795 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 145c6d9..a79b6ce 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -1147,6 +1147,10 @@ Patch: 1275_linux-4.4.276.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.4.276
23
24 +Patch: 1276_linux-4.4.277.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.4.277
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/1276_linux-4.4.277.patch b/1276_linux-4.4.277.patch
33 new file mode 100644
34 index 0000000..f486a3c
35 --- /dev/null
36 +++ b/1276_linux-4.4.277.patch
37 @@ -0,0 +1,1791 @@
38 +diff --git a/Makefile b/Makefile
39 +index 8855bdd51f81f..6a486a5d614bd 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,6 +1,6 @@
43 + VERSION = 4
44 + PATCHLEVEL = 4
45 +-SUBLEVEL = 276
46 ++SUBLEVEL = 277
47 + EXTRAVERSION =
48 + NAME = Blurry Fish Butt
49 +
50 +diff --git a/arch/arm/boot/dts/bcm63138.dtsi b/arch/arm/boot/dts/bcm63138.dtsi
51 +index 34cd640512509..84efc3d16f585 100644
52 +--- a/arch/arm/boot/dts/bcm63138.dtsi
53 ++++ b/arch/arm/boot/dts/bcm63138.dtsi
54 +@@ -152,7 +152,7 @@
55 + status = "disabled";
56 + };
57 +
58 +- nand: nand@2000 {
59 ++ nand_controller: nand-controller@2000 {
60 + #address-cells = <1>;
61 + #size-cells = <0>;
62 + compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.0", "brcm,brcmnand";
63 +diff --git a/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts b/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts
64 +index 0bb8d17e4c2d0..e51c9b079432a 100644
65 +--- a/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts
66 ++++ b/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts
67 +@@ -13,10 +13,10 @@
68 + };
69 + };
70 +
71 +-&nand {
72 ++&nand_controller {
73 + status = "okay";
74 +
75 +- nandcs@1 {
76 ++ nand@1 {
77 + compatible = "brcm,nandcs";
78 + reg = <1>;
79 + nand-ecc-step-size = <512>;
80 +diff --git a/arch/arm/boot/dts/bcm7445.dtsi b/arch/arm/boot/dts/bcm7445.dtsi
81 +index 4791321969b3f..3f002f2047f18 100644
82 +--- a/arch/arm/boot/dts/bcm7445.dtsi
83 ++++ b/arch/arm/boot/dts/bcm7445.dtsi
84 +@@ -149,7 +149,7 @@
85 + reg-names = "aon-ctrl", "aon-sram";
86 + };
87 +
88 +- nand: nand@3e2800 {
89 ++ nand_controller: nand-controller@3e2800 {
90 + status = "disabled";
91 + #address-cells = <1>;
92 + #size-cells = <0>;
93 +diff --git a/arch/arm/boot/dts/bcm963138dvt.dts b/arch/arm/boot/dts/bcm963138dvt.dts
94 +index 370aa2cfddf20..439cff69e948f 100644
95 +--- a/arch/arm/boot/dts/bcm963138dvt.dts
96 ++++ b/arch/arm/boot/dts/bcm963138dvt.dts
97 +@@ -29,10 +29,10 @@
98 + status = "okay";
99 + };
100 +
101 +-&nand {
102 ++&nand_controller {
103 + status = "okay";
104 +
105 +- nandcs@0 {
106 ++ nand@0 {
107 + compatible = "brcm,nandcs";
108 + reg = <0>;
109 + nand-ecc-strength = <4>;
110 +diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
111 +index cae04e8060362..e3e3a7a08d087 100644
112 +--- a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
113 ++++ b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi
114 +@@ -307,8 +307,8 @@
115 + fsl,pins = <
116 + MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1
117 + MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1
118 +- MX6QDL_PAD_EIM_D30__UART3_RTS_B 0x1b0b1
119 +- MX6QDL_PAD_EIM_D31__UART3_CTS_B 0x1b0b1
120 ++ MX6QDL_PAD_EIM_D31__UART3_RTS_B 0x1b0b1
121 ++ MX6QDL_PAD_EIM_D30__UART3_CTS_B 0x1b0b1
122 + >;
123 + };
124 +
125 +@@ -383,6 +383,7 @@
126 + &uart3 {
127 + pinctrl-names = "default";
128 + pinctrl-0 = <&pinctrl_uart3>;
129 ++ uart-has-rtscts;
130 + status = "disabled";
131 + };
132 +
133 +diff --git a/arch/arm/mach-imx/suspend-imx53.S b/arch/arm/mach-imx/suspend-imx53.S
134 +index 5ed078ad110aa..f12d24104075b 100644
135 +--- a/arch/arm/mach-imx/suspend-imx53.S
136 ++++ b/arch/arm/mach-imx/suspend-imx53.S
137 +@@ -33,11 +33,11 @@
138 + * ^
139 + * ^
140 + * imx53_suspend code
141 +- * PM_INFO structure(imx53_suspend_info)
142 ++ * PM_INFO structure(imx5_cpu_suspend_info)
143 + * ======================== low address =======================
144 + */
145 +
146 +-/* Offsets of members of struct imx53_suspend_info */
147 ++/* Offsets of members of struct imx5_cpu_suspend_info */
148 + #define SUSPEND_INFO_MX53_M4IF_V_OFFSET 0x0
149 + #define SUSPEND_INFO_MX53_IOMUXC_V_OFFSET 0x4
150 + #define SUSPEND_INFO_MX53_IO_COUNT_OFFSET 0x8
151 +diff --git a/arch/powerpc/kvm/book3s_rtas.c b/arch/powerpc/kvm/book3s_rtas.c
152 +index b1b2273d1f6d3..308744830f55d 100644
153 +--- a/arch/powerpc/kvm/book3s_rtas.c
154 ++++ b/arch/powerpc/kvm/book3s_rtas.c
155 +@@ -230,6 +230,17 @@ int kvmppc_rtas_hcall(struct kvm_vcpu *vcpu)
156 + * value so we can restore it on the way out.
157 + */
158 + orig_rets = args.rets;
159 ++ if (be32_to_cpu(args.nargs) >= ARRAY_SIZE(args.args)) {
160 ++ /*
161 ++ * Don't overflow our args array: ensure there is room for
162 ++ * at least rets[0] (even if the call specifies 0 nret).
163 ++ *
164 ++ * Each handler must then check for the correct nargs and nret
165 ++ * values, but they may always return failure in rets[0].
166 ++ */
167 ++ rc = -EINVAL;
168 ++ goto fail;
169 ++ }
170 + args.rets = &args.args[be32_to_cpu(args.nargs)];
171 +
172 + mutex_lock(&vcpu->kvm->arch.rtas_token_lock);
173 +@@ -257,9 +268,17 @@ int kvmppc_rtas_hcall(struct kvm_vcpu *vcpu)
174 + fail:
175 + /*
176 + * We only get here if the guest has called RTAS with a bogus
177 +- * args pointer. That means we can't get to the args, and so we
178 +- * can't fail the RTAS call. So fail right out to userspace,
179 +- * which should kill the guest.
180 ++ * args pointer or nargs/nret values that would overflow the
181 ++ * array. That means we can't get to the args, and so we can't
182 ++ * fail the RTAS call. So fail right out to userspace, which
183 ++ * should kill the guest.
184 ++ *
185 ++ * SLOF should actually pass the hcall return value from the
186 ++ * rtas handler call in r3, so enter_rtas could be modified to
187 ++ * return a failure indication in r3 and we could return such
188 ++ * errors to the guest rather than failing to host userspace.
189 ++ * However old guests that don't test for failure could then
190 ++ * continue silently after errors, so for now we won't do this.
191 + */
192 + return rc;
193 + }
194 +diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h
195 +index 836c56290499b..6dd874d5ba7bf 100644
196 +--- a/arch/s390/include/asm/ftrace.h
197 ++++ b/arch/s390/include/asm/ftrace.h
198 +@@ -19,6 +19,7 @@ void ftrace_caller(void);
199 +
200 + extern char ftrace_graph_caller_end;
201 + extern unsigned long ftrace_plt;
202 ++extern void *ftrace_func;
203 +
204 + struct dyn_arch_ftrace { };
205 +
206 +diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c
207 +index e0eaf11134b44..6617fae13bd38 100644
208 +--- a/arch/s390/kernel/ftrace.c
209 ++++ b/arch/s390/kernel/ftrace.c
210 +@@ -55,6 +55,7 @@
211 + * > brasl %r0,ftrace_caller # offset 0
212 + */
213 +
214 ++void *ftrace_func __read_mostly = ftrace_stub;
215 + unsigned long ftrace_plt;
216 +
217 + static inline void ftrace_generate_orig_insn(struct ftrace_insn *insn)
218 +@@ -164,6 +165,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
219 +
220 + int ftrace_update_ftrace_func(ftrace_func_t func)
221 + {
222 ++ ftrace_func = func;
223 + return 0;
224 + }
225 +
226 +diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S
227 +index 68425e68e65a2..9eb55077896ca 100644
228 +--- a/arch/s390/kernel/mcount.S
229 ++++ b/arch/s390/kernel/mcount.S
230 +@@ -56,13 +56,13 @@ ENTRY(ftrace_caller)
231 + #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
232 + aghik %r2,%r0,-MCOUNT_INSN_SIZE
233 + lgrl %r4,function_trace_op
234 +- lgrl %r1,ftrace_trace_function
235 ++ lgrl %r1,ftrace_func
236 + #else
237 + lgr %r2,%r0
238 + aghi %r2,-MCOUNT_INSN_SIZE
239 + larl %r4,function_trace_op
240 + lg %r4,0(%r4)
241 +- larl %r1,ftrace_trace_function
242 ++ larl %r1,ftrace_func
243 + lg %r1,0(%r1)
244 + #endif
245 + lgr %r3,%r14
246 +diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
247 +index bcf409997d6dc..c5c3056f4c4a4 100644
248 +--- a/arch/s390/net/bpf_jit_comp.c
249 ++++ b/arch/s390/net/bpf_jit_comp.c
250 +@@ -115,7 +115,7 @@ static inline void reg_set_seen(struct bpf_jit *jit, u32 b1)
251 + {
252 + u32 r1 = reg2hex[b1];
253 +
254 +- if (!jit->seen_reg[r1] && r1 >= 6 && r1 <= 15)
255 ++ if (r1 >= 6 && r1 <= 15 && !jit->seen_reg[r1])
256 + jit->seen_reg[r1] = 1;
257 + }
258 +
259 +diff --git a/arch/x86/include/asm/fpu/internal.h b/arch/x86/include/asm/fpu/internal.h
260 +index 66a5e60f60c41..4fb38927128c4 100644
261 +--- a/arch/x86/include/asm/fpu/internal.h
262 ++++ b/arch/x86/include/asm/fpu/internal.h
263 +@@ -217,6 +217,14 @@ static inline void copy_fxregs_to_kernel(struct fpu *fpu)
264 + }
265 + }
266 +
267 ++static inline void fxsave(struct fxregs_state *fx)
268 ++{
269 ++ if (IS_ENABLED(CONFIG_X86_32))
270 ++ asm volatile( "fxsave %[fx]" : [fx] "=m" (*fx));
271 ++ else
272 ++ asm volatile("fxsaveq %[fx]" : [fx] "=m" (*fx));
273 ++}
274 ++
275 + /* These macros all use (%edi)/(%rdi) as the single memory argument. */
276 + #define XSAVE ".byte " REX_PREFIX "0x0f,0xae,0x27"
277 + #define XSAVEOPT ".byte " REX_PREFIX "0x0f,0xae,0x37"
278 +@@ -286,28 +294,6 @@ static inline void copy_fxregs_to_kernel(struct fpu *fpu)
279 + : "D" (st), "m" (*st), "a" (lmask), "d" (hmask) \
280 + : "memory")
281 +
282 +-/*
283 +- * This function is called only during boot time when x86 caps are not set
284 +- * up and alternative can not be used yet.
285 +- */
286 +-static inline void copy_xregs_to_kernel_booting(struct xregs_state *xstate)
287 +-{
288 +- u64 mask = -1;
289 +- u32 lmask = mask;
290 +- u32 hmask = mask >> 32;
291 +- int err;
292 +-
293 +- WARN_ON(system_state != SYSTEM_BOOTING);
294 +-
295 +- if (static_cpu_has(X86_FEATURE_XSAVES))
296 +- XSTATE_OP(XSAVES, xstate, lmask, hmask, err);
297 +- else
298 +- XSTATE_OP(XSAVE, xstate, lmask, hmask, err);
299 +-
300 +- /* We should never fault when copying to a kernel buffer: */
301 +- WARN_ON_FPU(err);
302 +-}
303 +-
304 + /*
305 + * This function is called only during boot time when x86 caps are not set
306 + * up and alternative can not be used yet.
307 +diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
308 +index 3fa200ecca623..1ff1adbc843bb 100644
309 +--- a/arch/x86/kernel/fpu/xstate.c
310 ++++ b/arch/x86/kernel/fpu/xstate.c
311 +@@ -292,6 +292,23 @@ static void __init setup_xstate_comp(void)
312 + }
313 + }
314 +
315 ++/*
316 ++ * All supported features have either init state all zeros or are
317 ++ * handled in setup_init_fpu() individually. This is an explicit
318 ++ * feature list and does not use XFEATURE_MASK*SUPPORTED to catch
319 ++ * newly added supported features at build time and make people
320 ++ * actually look at the init state for the new feature.
321 ++ */
322 ++#define XFEATURES_INIT_FPSTATE_HANDLED \
323 ++ (XFEATURE_MASK_FP | \
324 ++ XFEATURE_MASK_SSE | \
325 ++ XFEATURE_MASK_YMM | \
326 ++ XFEATURE_MASK_OPMASK | \
327 ++ XFEATURE_MASK_ZMM_Hi256 | \
328 ++ XFEATURE_MASK_Hi16_ZMM | \
329 ++ XFEATURE_MASK_BNDREGS | \
330 ++ XFEATURE_MASK_BNDCSR)
331 ++
332 + /*
333 + * setup the xstate image representing the init state
334 + */
335 +@@ -299,6 +316,8 @@ static void __init setup_init_fpu_buf(void)
336 + {
337 + static int on_boot_cpu = 1;
338 +
339 ++ BUILD_BUG_ON(XCNTXT_MASK != XFEATURES_INIT_FPSTATE_HANDLED);
340 ++
341 + WARN_ON_FPU(!on_boot_cpu);
342 + on_boot_cpu = 0;
343 +
344 +@@ -319,10 +338,22 @@ static void __init setup_init_fpu_buf(void)
345 + copy_kernel_to_xregs_booting(&init_fpstate.xsave);
346 +
347 + /*
348 +- * Dump the init state again. This is to identify the init state
349 +- * of any feature which is not represented by all zero's.
350 ++ * All components are now in init state. Read the state back so
351 ++ * that init_fpstate contains all non-zero init state. This only
352 ++ * works with XSAVE, but not with XSAVEOPT and XSAVES because
353 ++ * those use the init optimization which skips writing data for
354 ++ * components in init state.
355 ++ *
356 ++ * XSAVE could be used, but that would require to reshuffle the
357 ++ * data when XSAVES is available because XSAVES uses xstate
358 ++ * compaction. But doing so is a pointless exercise because most
359 ++ * components have an all zeros init state except for the legacy
360 ++ * ones (FP and SSE). Those can be saved with FXSAVE into the
361 ++ * legacy area. Adding new features requires to ensure that init
362 ++ * state is all zeroes or if not to add the necessary handling
363 ++ * here.
364 + */
365 +- copy_xregs_to_kernel_booting(&init_fpstate.xsave);
366 ++ fxsave(&init_fpstate.fxsave);
367 + }
368 +
369 + static int xfeature_is_supervisor(int xfeature_nr)
370 +diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
371 +index 68c9e5478fec8..057c9df500d33 100644
372 +--- a/drivers/iio/accel/bma180.c
373 ++++ b/drivers/iio/accel/bma180.c
374 +@@ -49,7 +49,7 @@ struct bma180_part_info {
375 +
376 + u8 int_reset_reg, int_reset_mask;
377 + u8 sleep_reg, sleep_mask;
378 +- u8 bw_reg, bw_mask;
379 ++ u8 bw_reg, bw_mask, bw_offset;
380 + u8 scale_reg, scale_mask;
381 + u8 power_reg, power_mask, lowpower_val;
382 + u8 int_enable_reg, int_enable_mask;
383 +@@ -105,6 +105,7 @@ struct bma180_part_info {
384 +
385 + #define BMA250_RANGE_MASK GENMASK(3, 0) /* Range of accel values */
386 + #define BMA250_BW_MASK GENMASK(4, 0) /* Accel bandwidth */
387 ++#define BMA250_BW_OFFSET 8
388 + #define BMA250_SUSPEND_MASK BIT(7) /* chip will sleep */
389 + #define BMA250_LOWPOWER_MASK BIT(6)
390 + #define BMA250_DATA_INTEN_MASK BIT(4)
391 +@@ -242,7 +243,8 @@ static int bma180_set_bw(struct bma180_data *data, int val)
392 + for (i = 0; i < data->part_info->num_bw; ++i) {
393 + if (data->part_info->bw_table[i] == val) {
394 + ret = bma180_set_bits(data, data->part_info->bw_reg,
395 +- data->part_info->bw_mask, i);
396 ++ data->part_info->bw_mask,
397 ++ i + data->part_info->bw_offset);
398 + if (ret) {
399 + dev_err(&data->client->dev,
400 + "failed to set bandwidth\n");
401 +@@ -624,32 +626,53 @@ static const struct iio_chan_spec bma250_channels[] = {
402 +
403 + static const struct bma180_part_info bma180_part_info[] = {
404 + [BMA180] = {
405 +- bma180_channels, ARRAY_SIZE(bma180_channels),
406 +- bma180_scale_table, ARRAY_SIZE(bma180_scale_table),
407 +- bma180_bw_table, ARRAY_SIZE(bma180_bw_table),
408 +- BMA180_CTRL_REG0, BMA180_RESET_INT,
409 +- BMA180_CTRL_REG0, BMA180_SLEEP,
410 +- BMA180_BW_TCS, BMA180_BW,
411 +- BMA180_OFFSET_LSB1, BMA180_RANGE,
412 +- BMA180_TCO_Z, BMA180_MODE_CONFIG, BMA180_LOW_POWER,
413 +- BMA180_CTRL_REG3, BMA180_NEW_DATA_INT,
414 +- BMA180_RESET,
415 +- bma180_chip_config,
416 +- bma180_chip_disable,
417 ++ .channels = bma180_channels,
418 ++ .num_channels = ARRAY_SIZE(bma180_channels),
419 ++ .scale_table = bma180_scale_table,
420 ++ .num_scales = ARRAY_SIZE(bma180_scale_table),
421 ++ .bw_table = bma180_bw_table,
422 ++ .num_bw = ARRAY_SIZE(bma180_bw_table),
423 ++ .int_reset_reg = BMA180_CTRL_REG0,
424 ++ .int_reset_mask = BMA180_RESET_INT,
425 ++ .sleep_reg = BMA180_CTRL_REG0,
426 ++ .sleep_mask = BMA180_SLEEP,
427 ++ .bw_reg = BMA180_BW_TCS,
428 ++ .bw_mask = BMA180_BW,
429 ++ .scale_reg = BMA180_OFFSET_LSB1,
430 ++ .scale_mask = BMA180_RANGE,
431 ++ .power_reg = BMA180_TCO_Z,
432 ++ .power_mask = BMA180_MODE_CONFIG,
433 ++ .lowpower_val = BMA180_LOW_POWER,
434 ++ .int_enable_reg = BMA180_CTRL_REG3,
435 ++ .int_enable_mask = BMA180_NEW_DATA_INT,
436 ++ .softreset_reg = BMA180_RESET,
437 ++ .chip_config = bma180_chip_config,
438 ++ .chip_disable = bma180_chip_disable,
439 + },
440 + [BMA250] = {
441 +- bma250_channels, ARRAY_SIZE(bma250_channels),
442 +- bma250_scale_table, ARRAY_SIZE(bma250_scale_table),
443 +- bma250_bw_table, ARRAY_SIZE(bma250_bw_table),
444 +- BMA250_INT_RESET_REG, BMA250_INT_RESET_MASK,
445 +- BMA250_POWER_REG, BMA250_SUSPEND_MASK,
446 +- BMA250_BW_REG, BMA250_BW_MASK,
447 +- BMA250_RANGE_REG, BMA250_RANGE_MASK,
448 +- BMA250_POWER_REG, BMA250_LOWPOWER_MASK, 1,
449 +- BMA250_INT_ENABLE_REG, BMA250_DATA_INTEN_MASK,
450 +- BMA250_RESET_REG,
451 +- bma250_chip_config,
452 +- bma250_chip_disable,
453 ++ .channels = bma250_channels,
454 ++ .num_channels = ARRAY_SIZE(bma250_channels),
455 ++ .scale_table = bma250_scale_table,
456 ++ .num_scales = ARRAY_SIZE(bma250_scale_table),
457 ++ .bw_table = bma250_bw_table,
458 ++ .num_bw = ARRAY_SIZE(bma250_bw_table),
459 ++ .int_reset_reg = BMA250_INT_RESET_REG,
460 ++ .int_reset_mask = BMA250_INT_RESET_MASK,
461 ++ .sleep_reg = BMA250_POWER_REG,
462 ++ .sleep_mask = BMA250_SUSPEND_MASK,
463 ++ .bw_reg = BMA250_BW_REG,
464 ++ .bw_mask = BMA250_BW_MASK,
465 ++ .bw_offset = BMA250_BW_OFFSET,
466 ++ .scale_reg = BMA250_RANGE_REG,
467 ++ .scale_mask = BMA250_RANGE_MASK,
468 ++ .power_reg = BMA250_POWER_REG,
469 ++ .power_mask = BMA250_LOWPOWER_MASK,
470 ++ .lowpower_val = 1,
471 ++ .int_enable_reg = BMA250_INT_ENABLE_REG,
472 ++ .int_enable_mask = BMA250_DATA_INTEN_MASK,
473 ++ .softreset_reg = BMA250_RESET_REG,
474 ++ .chip_config = bma250_chip_config,
475 ++ .chip_disable = bma250_chip_disable,
476 + },
477 + };
478 +
479 +diff --git a/drivers/media/pci/ngene/ngene-core.c b/drivers/media/pci/ngene/ngene-core.c
480 +index 1b92d836a564f..f0b9899008777 100644
481 +--- a/drivers/media/pci/ngene/ngene-core.c
482 ++++ b/drivers/media/pci/ngene/ngene-core.c
483 +@@ -402,7 +402,7 @@ static int ngene_command_config_free_buf(struct ngene *dev, u8 *config)
484 +
485 + com.cmd.hdr.Opcode = CMD_CONFIGURE_FREE_BUFFER;
486 + com.cmd.hdr.Length = 6;
487 +- memcpy(&com.cmd.ConfigureBuffers.config, config, 6);
488 ++ memcpy(&com.cmd.ConfigureFreeBuffers.config, config, 6);
489 + com.in_len = 6;
490 + com.out_len = 0;
491 +
492 +diff --git a/drivers/media/pci/ngene/ngene.h b/drivers/media/pci/ngene/ngene.h
493 +index fa30930d70477..da154c4065459 100644
494 +--- a/drivers/media/pci/ngene/ngene.h
495 ++++ b/drivers/media/pci/ngene/ngene.h
496 +@@ -407,12 +407,14 @@ enum _BUFFER_CONFIGS {
497 +
498 + struct FW_CONFIGURE_FREE_BUFFERS {
499 + struct FW_HEADER hdr;
500 +- u8 UVI1_BufferLength;
501 +- u8 UVI2_BufferLength;
502 +- u8 TVO_BufferLength;
503 +- u8 AUD1_BufferLength;
504 +- u8 AUD2_BufferLength;
505 +- u8 TVA_BufferLength;
506 ++ struct {
507 ++ u8 UVI1_BufferLength;
508 ++ u8 UVI2_BufferLength;
509 ++ u8 TVO_BufferLength;
510 ++ u8 AUD1_BufferLength;
511 ++ u8 AUD2_BufferLength;
512 ++ u8 TVA_BufferLength;
513 ++ } __packed config;
514 + } __attribute__ ((__packed__));
515 +
516 + struct FW_CONFIGURE_UART {
517 +diff --git a/drivers/memory/fsl_ifc.c b/drivers/memory/fsl_ifc.c
518 +index 65b984d64350b..26b37ba4feda6 100644
519 +--- a/drivers/memory/fsl_ifc.c
520 ++++ b/drivers/memory/fsl_ifc.c
521 +@@ -228,7 +228,8 @@ static int fsl_ifc_ctrl_probe(struct platform_device *dev)
522 + fsl_ifc_ctrl_dev->regs = of_iomap(dev->dev.of_node, 0);
523 + if (!fsl_ifc_ctrl_dev->regs) {
524 + dev_err(&dev->dev, "failed to get memory region\n");
525 +- return -ENODEV;
526 ++ ret = -ENODEV;
527 ++ goto err;
528 + }
529 +
530 + version = ifc_in32(&fsl_ifc_ctrl_dev->regs->ifc_rev) &
531 +@@ -305,7 +306,6 @@ err_irq:
532 + free_irq(fsl_ifc_ctrl_dev->irq, fsl_ifc_ctrl_dev);
533 + irq_dispose_mapping(fsl_ifc_ctrl_dev->irq);
534 + err:
535 +- iounmap(fsl_ifc_ctrl_dev->gregs);
536 + return ret;
537 + }
538 +
539 +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
540 +index 3a6cebff9f426..a1f9f68575f44 100644
541 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
542 ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
543 +@@ -1094,7 +1094,7 @@ static void bcmgenet_power_up(struct bcmgenet_priv *priv,
544 + switch (mode) {
545 + case GENET_POWER_PASSIVE:
546 + reg &= ~(EXT_PWR_DOWN_DLL | EXT_PWR_DOWN_PHY |
547 +- EXT_PWR_DOWN_BIAS);
548 ++ EXT_PWR_DOWN_BIAS | EXT_ENERGY_DET_MASK);
549 + /* fallthrough */
550 + case GENET_POWER_CABLE_SENSE:
551 + /* enable APD */
552 +@@ -2663,15 +2663,21 @@ static void bcmgenet_set_hw_addr(struct bcmgenet_priv *priv,
553 + /* Returns a reusable dma control register value */
554 + static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv)
555 + {
556 ++ unsigned int i;
557 + u32 reg;
558 + u32 dma_ctrl;
559 +
560 + /* disable DMA */
561 + dma_ctrl = 1 << (DESC_INDEX + DMA_RING_BUF_EN_SHIFT) | DMA_EN;
562 ++ for (i = 0; i < priv->hw_params->tx_queues; i++)
563 ++ dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
564 + reg = bcmgenet_tdma_readl(priv, DMA_CTRL);
565 + reg &= ~dma_ctrl;
566 + bcmgenet_tdma_writel(priv, reg, DMA_CTRL);
567 +
568 ++ dma_ctrl = 1 << (DESC_INDEX + DMA_RING_BUF_EN_SHIFT) | DMA_EN;
569 ++ for (i = 0; i < priv->hw_params->rx_queues; i++)
570 ++ dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
571 + reg = bcmgenet_rdma_readl(priv, DMA_CTRL);
572 + reg &= ~dma_ctrl;
573 + bcmgenet_rdma_writel(priv, reg, DMA_CTRL);
574 +@@ -2902,12 +2908,6 @@ static int bcmgenet_open(struct net_device *dev)
575 +
576 + bcmgenet_set_hw_addr(priv, dev->dev_addr);
577 +
578 +- if (priv->internal_phy) {
579 +- reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT);
580 +- reg |= EXT_ENERGY_DET_MASK;
581 +- bcmgenet_ext_writel(priv, reg, EXT_EXT_PWR_MGMT);
582 +- }
583 +-
584 + /* Disable RX/TX DMA and flush TX queues */
585 + dma_ctrl = bcmgenet_dma_disable(priv);
586 +
587 +@@ -3595,7 +3595,6 @@ static int bcmgenet_resume(struct device *d)
588 + struct bcmgenet_priv *priv = netdev_priv(dev);
589 + unsigned long dma_ctrl;
590 + int ret;
591 +- u32 reg;
592 +
593 + if (!netif_running(dev))
594 + return 0;
595 +@@ -3630,12 +3629,6 @@ static int bcmgenet_resume(struct device *d)
596 +
597 + bcmgenet_set_hw_addr(priv, dev->dev_addr);
598 +
599 +- if (priv->internal_phy) {
600 +- reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT);
601 +- reg |= EXT_ENERGY_DET_MASK;
602 +- bcmgenet_ext_writel(priv, reg, EXT_EXT_PWR_MGMT);
603 +- }
604 +-
605 + if (priv->wolopts)
606 + bcmgenet_power_up(priv, GENET_POWER_WOL_MAGIC);
607 +
608 +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
609 +index b97122926d3aa..df107ed672206 100644
610 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
611 ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c
612 +@@ -167,12 +167,6 @@ int bcmgenet_wol_power_down_cfg(struct bcmgenet_priv *priv,
613 + reg |= CMD_RX_EN;
614 + bcmgenet_umac_writel(priv, reg, UMAC_CMD);
615 +
616 +- if (priv->hw_params->flags & GENET_HAS_EXT) {
617 +- reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT);
618 +- reg &= ~EXT_ENERGY_DET_MASK;
619 +- bcmgenet_ext_writel(priv, reg, EXT_EXT_PWR_MGMT);
620 +- }
621 +-
622 + /* Enable the MPD interrupt */
623 + cpu_mask_clear = UMAC_IRQ_MPD_R;
624 +
625 +diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
626 +index 5f03ab3dfa191..8fdbc24b3cba9 100644
627 +--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
628 ++++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
629 +@@ -2503,6 +2503,7 @@ static int i40evf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
630 + err_ioremap:
631 + free_netdev(netdev);
632 + err_alloc_etherdev:
633 ++ pci_disable_pcie_error_reporting(pdev);
634 + pci_release_regions(pdev);
635 + err_pci_reg:
636 + err_dma:
637 +diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
638 +index 682f527608987..6ccbf21547d03 100644
639 +--- a/drivers/net/ethernet/intel/igb/igb_main.c
640 ++++ b/drivers/net/ethernet/intel/igb/igb_main.c
641 +@@ -945,6 +945,7 @@ static void igb_configure_msix(struct igb_adapter *adapter)
642 + **/
643 + static int igb_request_msix(struct igb_adapter *adapter)
644 + {
645 ++ unsigned int num_q_vectors = adapter->num_q_vectors;
646 + struct net_device *netdev = adapter->netdev;
647 + int i, err = 0, vector = 0, free_vector = 0;
648 +
649 +@@ -953,7 +954,13 @@ static int igb_request_msix(struct igb_adapter *adapter)
650 + if (err)
651 + goto err_out;
652 +
653 +- for (i = 0; i < adapter->num_q_vectors; i++) {
654 ++ if (num_q_vectors > MAX_Q_VECTORS) {
655 ++ num_q_vectors = MAX_Q_VECTORS;
656 ++ dev_warn(&adapter->pdev->dev,
657 ++ "The number of queue vectors (%d) is higher than max allowed (%d)\n",
658 ++ adapter->num_q_vectors, MAX_Q_VECTORS);
659 ++ }
660 ++ for (i = 0; i < num_q_vectors; i++) {
661 + struct igb_q_vector *q_vector = adapter->q_vector[i];
662 +
663 + vector++;
664 +diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c
665 +index 374e691b11da6..295b5176bcf1e 100644
666 +--- a/drivers/net/ethernet/moxa/moxart_ether.c
667 ++++ b/drivers/net/ethernet/moxa/moxart_ether.c
668 +@@ -518,10 +518,8 @@ static int moxart_mac_probe(struct platform_device *pdev)
669 + SET_NETDEV_DEV(ndev, &pdev->dev);
670 +
671 + ret = register_netdev(ndev);
672 +- if (ret) {
673 +- free_netdev(ndev);
674 ++ if (ret)
675 + goto init_fail;
676 +- }
677 +
678 + netdev_dbg(ndev, "%s: IRQ=%d address=%pM\n",
679 + __func__, ndev->irq, ndev->dev_addr);
680 +diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c
681 +index 399a89f30826e..bc1638b0073ff 100644
682 +--- a/drivers/net/ethernet/ti/tlan.c
683 ++++ b/drivers/net/ethernet/ti/tlan.c
684 +@@ -313,9 +313,8 @@ static void tlan_remove_one(struct pci_dev *pdev)
685 + pci_release_regions(pdev);
686 + #endif
687 +
688 +- free_netdev(dev);
689 +-
690 + cancel_work_sync(&priv->tlan_tqueue);
691 ++ free_netdev(dev);
692 + }
693 +
694 + static void tlan_start(struct net_device *dev)
695 +diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
696 +index def3208dd2905..9b5832b46deca 100644
697 +--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
698 ++++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
699 +@@ -500,7 +500,7 @@ ahc_inq(struct ahc_softc *ahc, u_int port)
700 + return ((ahc_inb(ahc, port))
701 + | (ahc_inb(ahc, port+1) << 8)
702 + | (ahc_inb(ahc, port+2) << 16)
703 +- | (ahc_inb(ahc, port+3) << 24)
704 ++ | (((uint64_t)ahc_inb(ahc, port+3)) << 24)
705 + | (((uint64_t)ahc_inb(ahc, port+4)) << 32)
706 + | (((uint64_t)ahc_inb(ahc, port+5)) << 40)
707 + | (((uint64_t)ahc_inb(ahc, port+6)) << 48)
708 +diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
709 +index e0159e6a10652..39d03300d3d9a 100644
710 +--- a/drivers/scsi/scsi_transport_iscsi.c
711 ++++ b/drivers/scsi/scsi_transport_iscsi.c
712 +@@ -427,39 +427,10 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
713 + struct device *dev = container_of(kobj, struct device, kobj);
714 + struct iscsi_iface *iface = iscsi_dev_to_iface(dev);
715 + struct iscsi_transport *t = iface->transport;
716 +- int param;
717 +- int param_type;
718 ++ int param = -1;
719 +
720 + if (attr == &dev_attr_iface_enabled.attr)
721 + param = ISCSI_NET_PARAM_IFACE_ENABLE;
722 +- else if (attr == &dev_attr_iface_vlan_id.attr)
723 +- param = ISCSI_NET_PARAM_VLAN_ID;
724 +- else if (attr == &dev_attr_iface_vlan_priority.attr)
725 +- param = ISCSI_NET_PARAM_VLAN_PRIORITY;
726 +- else if (attr == &dev_attr_iface_vlan_enabled.attr)
727 +- param = ISCSI_NET_PARAM_VLAN_ENABLED;
728 +- else if (attr == &dev_attr_iface_mtu.attr)
729 +- param = ISCSI_NET_PARAM_MTU;
730 +- else if (attr == &dev_attr_iface_port.attr)
731 +- param = ISCSI_NET_PARAM_PORT;
732 +- else if (attr == &dev_attr_iface_ipaddress_state.attr)
733 +- param = ISCSI_NET_PARAM_IPADDR_STATE;
734 +- else if (attr == &dev_attr_iface_delayed_ack_en.attr)
735 +- param = ISCSI_NET_PARAM_DELAYED_ACK_EN;
736 +- else if (attr == &dev_attr_iface_tcp_nagle_disable.attr)
737 +- param = ISCSI_NET_PARAM_TCP_NAGLE_DISABLE;
738 +- else if (attr == &dev_attr_iface_tcp_wsf_disable.attr)
739 +- param = ISCSI_NET_PARAM_TCP_WSF_DISABLE;
740 +- else if (attr == &dev_attr_iface_tcp_wsf.attr)
741 +- param = ISCSI_NET_PARAM_TCP_WSF;
742 +- else if (attr == &dev_attr_iface_tcp_timer_scale.attr)
743 +- param = ISCSI_NET_PARAM_TCP_TIMER_SCALE;
744 +- else if (attr == &dev_attr_iface_tcp_timestamp_en.attr)
745 +- param = ISCSI_NET_PARAM_TCP_TIMESTAMP_EN;
746 +- else if (attr == &dev_attr_iface_cache_id.attr)
747 +- param = ISCSI_NET_PARAM_CACHE_ID;
748 +- else if (attr == &dev_attr_iface_redirect_en.attr)
749 +- param = ISCSI_NET_PARAM_REDIRECT_EN;
750 + else if (attr == &dev_attr_iface_def_taskmgmt_tmo.attr)
751 + param = ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO;
752 + else if (attr == &dev_attr_iface_header_digest.attr)
753 +@@ -496,6 +467,38 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
754 + param = ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN;
755 + else if (attr == &dev_attr_iface_initiator_name.attr)
756 + param = ISCSI_IFACE_PARAM_INITIATOR_NAME;
757 ++
758 ++ if (param != -1)
759 ++ return t->attr_is_visible(ISCSI_IFACE_PARAM, param);
760 ++
761 ++ if (attr == &dev_attr_iface_vlan_id.attr)
762 ++ param = ISCSI_NET_PARAM_VLAN_ID;
763 ++ else if (attr == &dev_attr_iface_vlan_priority.attr)
764 ++ param = ISCSI_NET_PARAM_VLAN_PRIORITY;
765 ++ else if (attr == &dev_attr_iface_vlan_enabled.attr)
766 ++ param = ISCSI_NET_PARAM_VLAN_ENABLED;
767 ++ else if (attr == &dev_attr_iface_mtu.attr)
768 ++ param = ISCSI_NET_PARAM_MTU;
769 ++ else if (attr == &dev_attr_iface_port.attr)
770 ++ param = ISCSI_NET_PARAM_PORT;
771 ++ else if (attr == &dev_attr_iface_ipaddress_state.attr)
772 ++ param = ISCSI_NET_PARAM_IPADDR_STATE;
773 ++ else if (attr == &dev_attr_iface_delayed_ack_en.attr)
774 ++ param = ISCSI_NET_PARAM_DELAYED_ACK_EN;
775 ++ else if (attr == &dev_attr_iface_tcp_nagle_disable.attr)
776 ++ param = ISCSI_NET_PARAM_TCP_NAGLE_DISABLE;
777 ++ else if (attr == &dev_attr_iface_tcp_wsf_disable.attr)
778 ++ param = ISCSI_NET_PARAM_TCP_WSF_DISABLE;
779 ++ else if (attr == &dev_attr_iface_tcp_wsf.attr)
780 ++ param = ISCSI_NET_PARAM_TCP_WSF;
781 ++ else if (attr == &dev_attr_iface_tcp_timer_scale.attr)
782 ++ param = ISCSI_NET_PARAM_TCP_TIMER_SCALE;
783 ++ else if (attr == &dev_attr_iface_tcp_timestamp_en.attr)
784 ++ param = ISCSI_NET_PARAM_TCP_TIMESTAMP_EN;
785 ++ else if (attr == &dev_attr_iface_cache_id.attr)
786 ++ param = ISCSI_NET_PARAM_CACHE_ID;
787 ++ else if (attr == &dev_attr_iface_redirect_en.attr)
788 ++ param = ISCSI_NET_PARAM_REDIRECT_EN;
789 + else if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) {
790 + if (attr == &dev_attr_ipv4_iface_ipaddress.attr)
791 + param = ISCSI_NET_PARAM_IPV4_ADDR;
792 +@@ -586,32 +589,7 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj,
793 + return 0;
794 + }
795 +
796 +- switch (param) {
797 +- case ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO:
798 +- case ISCSI_IFACE_PARAM_HDRDGST_EN:
799 +- case ISCSI_IFACE_PARAM_DATADGST_EN:
800 +- case ISCSI_IFACE_PARAM_IMM_DATA_EN:
801 +- case ISCSI_IFACE_PARAM_INITIAL_R2T_EN:
802 +- case ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN:
803 +- case ISCSI_IFACE_PARAM_PDU_INORDER_EN:
804 +- case ISCSI_IFACE_PARAM_ERL:
805 +- case ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH:
806 +- case ISCSI_IFACE_PARAM_FIRST_BURST:
807 +- case ISCSI_IFACE_PARAM_MAX_R2T:
808 +- case ISCSI_IFACE_PARAM_MAX_BURST:
809 +- case ISCSI_IFACE_PARAM_CHAP_AUTH_EN:
810 +- case ISCSI_IFACE_PARAM_BIDI_CHAP_EN:
811 +- case ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL:
812 +- case ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN:
813 +- case ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN:
814 +- case ISCSI_IFACE_PARAM_INITIATOR_NAME:
815 +- param_type = ISCSI_IFACE_PARAM;
816 +- break;
817 +- default:
818 +- param_type = ISCSI_NET_PARAM;
819 +- }
820 +-
821 +- return t->attr_is_visible(param_type, param);
822 ++ return t->attr_is_visible(ISCSI_NET_PARAM, param);
823 + }
824 +
825 + static struct attribute *iscsi_iface_attrs[] = {
826 +diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
827 +index 6081178193661..a2ffa10e5a411 100644
828 +--- a/drivers/target/target_core_sbc.c
829 ++++ b/drivers/target/target_core_sbc.c
830 +@@ -37,7 +37,7 @@
831 + #include "target_core_alua.h"
832 +
833 + static sense_reason_t
834 +-sbc_check_prot(struct se_device *, struct se_cmd *, unsigned char *, u32, bool);
835 ++sbc_check_prot(struct se_device *, struct se_cmd *, unsigned char, u32, bool);
836 + static sense_reason_t sbc_execute_unmap(struct se_cmd *cmd);
837 +
838 + static sense_reason_t
839 +@@ -311,14 +311,14 @@ static inline unsigned long long transport_lba_64_ext(unsigned char *cdb)
840 + }
841 +
842 + static sense_reason_t
843 +-sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *ops)
844 ++sbc_setup_write_same(struct se_cmd *cmd, unsigned char flags, struct sbc_ops *ops)
845 + {
846 + struct se_device *dev = cmd->se_dev;
847 + sector_t end_lba = dev->transport->get_blocks(dev) + 1;
848 + unsigned int sectors = sbc_get_write_same_sectors(cmd);
849 + sense_reason_t ret;
850 +
851 +- if ((flags[0] & 0x04) || (flags[0] & 0x02)) {
852 ++ if ((flags & 0x04) || (flags & 0x02)) {
853 + pr_err("WRITE_SAME PBDATA and LBDATA"
854 + " bits not supported for Block Discard"
855 + " Emulation\n");
856 +@@ -340,7 +340,7 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *o
857 + }
858 +
859 + /* We always have ANC_SUP == 0 so setting ANCHOR is always an error */
860 +- if (flags[0] & 0x10) {
861 ++ if (flags & 0x10) {
862 + pr_warn("WRITE SAME with ANCHOR not supported\n");
863 + return TCM_INVALID_CDB_FIELD;
864 + }
865 +@@ -348,7 +348,7 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *o
866 + * Special case for WRITE_SAME w/ UNMAP=1 that ends up getting
867 + * translated into block discard requests within backend code.
868 + */
869 +- if (flags[0] & 0x08) {
870 ++ if (flags & 0x08) {
871 + if (!ops->execute_unmap)
872 + return TCM_UNSUPPORTED_SCSI_OPCODE;
873 +
874 +@@ -363,7 +363,7 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *o
875 + if (!ops->execute_write_same)
876 + return TCM_UNSUPPORTED_SCSI_OPCODE;
877 +
878 +- ret = sbc_check_prot(dev, cmd, &cmd->t_task_cdb[0], sectors, true);
879 ++ ret = sbc_check_prot(dev, cmd, flags >> 5, sectors, true);
880 + if (ret)
881 + return ret;
882 +
883 +@@ -721,10 +721,9 @@ sbc_set_prot_op_checks(u8 protect, bool fabric_prot, enum target_prot_type prot_
884 + }
885 +
886 + static sense_reason_t
887 +-sbc_check_prot(struct se_device *dev, struct se_cmd *cmd, unsigned char *cdb,
888 ++sbc_check_prot(struct se_device *dev, struct se_cmd *cmd, unsigned char protect,
889 + u32 sectors, bool is_write)
890 + {
891 +- u8 protect = cdb[1] >> 5;
892 + int sp_ops = cmd->se_sess->sup_prot_ops;
893 + int pi_prot_type = dev->dev_attrib.pi_prot_type;
894 + bool fabric_prot = false;
895 +@@ -772,7 +771,7 @@ sbc_check_prot(struct se_device *dev, struct se_cmd *cmd, unsigned char *cdb,
896 + /* Fallthrough */
897 + default:
898 + pr_err("Unable to determine pi_prot_type for CDB: 0x%02x "
899 +- "PROTECT: 0x%02x\n", cdb[0], protect);
900 ++ "PROTECT: 0x%02x\n", cmd->t_task_cdb[0], protect);
901 + return TCM_INVALID_CDB_FIELD;
902 + }
903 +
904 +@@ -847,7 +846,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
905 + if (sbc_check_dpofua(dev, cmd, cdb))
906 + return TCM_INVALID_CDB_FIELD;
907 +
908 +- ret = sbc_check_prot(dev, cmd, cdb, sectors, false);
909 ++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, false);
910 + if (ret)
911 + return ret;
912 +
913 +@@ -861,7 +860,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
914 + if (sbc_check_dpofua(dev, cmd, cdb))
915 + return TCM_INVALID_CDB_FIELD;
916 +
917 +- ret = sbc_check_prot(dev, cmd, cdb, sectors, false);
918 ++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, false);
919 + if (ret)
920 + return ret;
921 +
922 +@@ -875,7 +874,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
923 + if (sbc_check_dpofua(dev, cmd, cdb))
924 + return TCM_INVALID_CDB_FIELD;
925 +
926 +- ret = sbc_check_prot(dev, cmd, cdb, sectors, false);
927 ++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, false);
928 + if (ret)
929 + return ret;
930 +
931 +@@ -896,7 +895,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
932 + if (sbc_check_dpofua(dev, cmd, cdb))
933 + return TCM_INVALID_CDB_FIELD;
934 +
935 +- ret = sbc_check_prot(dev, cmd, cdb, sectors, true);
936 ++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, true);
937 + if (ret)
938 + return ret;
939 +
940 +@@ -910,7 +909,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
941 + if (sbc_check_dpofua(dev, cmd, cdb))
942 + return TCM_INVALID_CDB_FIELD;
943 +
944 +- ret = sbc_check_prot(dev, cmd, cdb, sectors, true);
945 ++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, true);
946 + if (ret)
947 + return ret;
948 +
949 +@@ -924,7 +923,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
950 + if (sbc_check_dpofua(dev, cmd, cdb))
951 + return TCM_INVALID_CDB_FIELD;
952 +
953 +- ret = sbc_check_prot(dev, cmd, cdb, sectors, true);
954 ++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, true);
955 + if (ret)
956 + return ret;
957 +
958 +@@ -983,7 +982,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
959 + size = sbc_get_size(cmd, 1);
960 + cmd->t_task_lba = get_unaligned_be64(&cdb[12]);
961 +
962 +- ret = sbc_setup_write_same(cmd, &cdb[10], ops);
963 ++ ret = sbc_setup_write_same(cmd, cdb[10], ops);
964 + if (ret)
965 + return ret;
966 + break;
967 +@@ -1076,7 +1075,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
968 + size = sbc_get_size(cmd, 1);
969 + cmd->t_task_lba = get_unaligned_be64(&cdb[2]);
970 +
971 +- ret = sbc_setup_write_same(cmd, &cdb[1], ops);
972 ++ ret = sbc_setup_write_same(cmd, cdb[1], ops);
973 + if (ret)
974 + return ret;
975 + break;
976 +@@ -1094,7 +1093,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
977 + * Follow sbcr26 with WRITE_SAME (10) and check for the existence
978 + * of byte 1 bit 3 UNMAP instead of original reserved field
979 + */
980 +- ret = sbc_setup_write_same(cmd, &cdb[1], ops);
981 ++ ret = sbc_setup_write_same(cmd, cdb[1], ops);
982 + if (ret)
983 + return ret;
984 + break;
985 +diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
986 +index a6df07786362e..94497787a0764 100644
987 +--- a/drivers/thermal/thermal_core.c
988 ++++ b/drivers/thermal/thermal_core.c
989 +@@ -1956,7 +1956,7 @@ unregister:
990 + EXPORT_SYMBOL_GPL(thermal_zone_device_register);
991 +
992 + /**
993 +- * thermal_device_unregister - removes the registered thermal zone device
994 ++ * thermal_zone_device_unregister - removes the registered thermal zone device
995 + * @tz: the thermal zone device to remove
996 + */
997 + void thermal_zone_device_unregister(struct thermal_zone_device *tz)
998 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
999 +index 6e2bf3e69a0ad..6910a6d7c63e1 100644
1000 +--- a/drivers/usb/core/hub.c
1001 ++++ b/drivers/usb/core/hub.c
1002 +@@ -3836,6 +3836,47 @@ static int usb_set_lpm_timeout(struct usb_device *udev,
1003 + return 0;
1004 + }
1005 +
1006 ++/*
1007 ++ * Don't allow device intiated U1/U2 if the system exit latency + one bus
1008 ++ * interval is greater than the minimum service interval of any active
1009 ++ * periodic endpoint. See USB 3.2 section 9.4.9
1010 ++ */
1011 ++static bool usb_device_may_initiate_lpm(struct usb_device *udev,
1012 ++ enum usb3_link_state state)
1013 ++{
1014 ++ unsigned int sel; /* us */
1015 ++ int i, j;
1016 ++
1017 ++ if (state == USB3_LPM_U1)
1018 ++ sel = DIV_ROUND_UP(udev->u1_params.sel, 1000);
1019 ++ else if (state == USB3_LPM_U2)
1020 ++ sel = DIV_ROUND_UP(udev->u2_params.sel, 1000);
1021 ++ else
1022 ++ return false;
1023 ++
1024 ++ for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
1025 ++ struct usb_interface *intf;
1026 ++ struct usb_endpoint_descriptor *desc;
1027 ++ unsigned int interval;
1028 ++
1029 ++ intf = udev->actconfig->interface[i];
1030 ++ if (!intf)
1031 ++ continue;
1032 ++
1033 ++ for (j = 0; j < intf->cur_altsetting->desc.bNumEndpoints; j++) {
1034 ++ desc = &intf->cur_altsetting->endpoint[j].desc;
1035 ++
1036 ++ if (usb_endpoint_xfer_int(desc) ||
1037 ++ usb_endpoint_xfer_isoc(desc)) {
1038 ++ interval = (1 << (desc->bInterval - 1)) * 125;
1039 ++ if (sel + 125 > interval)
1040 ++ return false;
1041 ++ }
1042 ++ }
1043 ++ }
1044 ++ return true;
1045 ++}
1046 ++
1047 + /*
1048 + * Enable the hub-initiated U1/U2 idle timeouts, and enable device-initiated
1049 + * U1/U2 entry.
1050 +@@ -3908,20 +3949,23 @@ static void usb_enable_link_state(struct usb_hcd *hcd, struct usb_device *udev,
1051 + * U1/U2_ENABLE
1052 + */
1053 + if (udev->actconfig &&
1054 +- usb_set_device_initiated_lpm(udev, state, true) == 0) {
1055 +- if (state == USB3_LPM_U1)
1056 +- udev->usb3_lpm_u1_enabled = 1;
1057 +- else if (state == USB3_LPM_U2)
1058 +- udev->usb3_lpm_u2_enabled = 1;
1059 +- } else {
1060 +- /* Don't request U1/U2 entry if the device
1061 +- * cannot transition to U1/U2.
1062 +- */
1063 +- usb_set_lpm_timeout(udev, state, 0);
1064 +- hcd->driver->disable_usb3_lpm_timeout(hcd, udev, state);
1065 ++ usb_device_may_initiate_lpm(udev, state)) {
1066 ++ if (usb_set_device_initiated_lpm(udev, state, true)) {
1067 ++ /*
1068 ++ * Request to enable device initiated U1/U2 failed,
1069 ++ * better to turn off lpm in this case.
1070 ++ */
1071 ++ usb_set_lpm_timeout(udev, state, 0);
1072 ++ hcd->driver->disable_usb3_lpm_timeout(hcd, udev, state);
1073 ++ return;
1074 ++ }
1075 + }
1076 +-}
1077 +
1078 ++ if (state == USB3_LPM_U1)
1079 ++ udev->usb3_lpm_u1_enabled = 1;
1080 ++ else if (state == USB3_LPM_U2)
1081 ++ udev->usb3_lpm_u2_enabled = 1;
1082 ++}
1083 + /*
1084 + * Disable the hub-initiated U1/U2 idle timeouts, and disable device-initiated
1085 + * U1/U2 entry.
1086 +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
1087 +index 3dfd584a1ef3d..2ca6ed207e26e 100644
1088 +--- a/drivers/usb/core/quirks.c
1089 ++++ b/drivers/usb/core/quirks.c
1090 +@@ -325,10 +325,6 @@ static const struct usb_device_id usb_quirk_list[] = {
1091 + /* DJI CineSSD */
1092 + { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },
1093 +
1094 +- /* Fibocom L850-GL LTE Modem */
1095 +- { USB_DEVICE(0x2cb7, 0x0007), .driver_info =
1096 +- USB_QUIRK_IGNORE_REMOTE_WAKEUP },
1097 +-
1098 + /* INTEL VALUE SSD */
1099 + { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
1100 +
1101 +diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
1102 +index bd98706d1ce9d..2f8a5fa28a802 100644
1103 +--- a/drivers/usb/host/max3421-hcd.c
1104 ++++ b/drivers/usb/host/max3421-hcd.c
1105 +@@ -149,8 +149,6 @@ struct max3421_hcd {
1106 + */
1107 + struct urb *curr_urb;
1108 + enum scheduling_pass sched_pass;
1109 +- struct usb_device *loaded_dev; /* dev that's loaded into the chip */
1110 +- int loaded_epnum; /* epnum whose toggles are loaded */
1111 + int urb_done; /* > 0 -> no errors, < 0: errno */
1112 + size_t curr_len;
1113 + u8 hien;
1114 +@@ -488,39 +486,17 @@ max3421_set_speed(struct usb_hcd *hcd, struct usb_device *dev)
1115 + * Caller must NOT hold HCD spinlock.
1116 + */
1117 + static void
1118 +-max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum,
1119 +- int force_toggles)
1120 ++max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum)
1121 + {
1122 +- struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd);
1123 +- int old_epnum, same_ep, rcvtog, sndtog;
1124 +- struct usb_device *old_dev;
1125 ++ int rcvtog, sndtog;
1126 + u8 hctl;
1127 +
1128 +- old_dev = max3421_hcd->loaded_dev;
1129 +- old_epnum = max3421_hcd->loaded_epnum;
1130 +-
1131 +- same_ep = (dev == old_dev && epnum == old_epnum);
1132 +- if (same_ep && !force_toggles)
1133 +- return;
1134 +-
1135 +- if (old_dev && !same_ep) {
1136 +- /* save the old end-points toggles: */
1137 +- u8 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL);
1138 +-
1139 +- rcvtog = (hrsl >> MAX3421_HRSL_RCVTOGRD_BIT) & 1;
1140 +- sndtog = (hrsl >> MAX3421_HRSL_SNDTOGRD_BIT) & 1;
1141 +-
1142 +- /* no locking: HCD (i.e., we) own toggles, don't we? */
1143 +- usb_settoggle(old_dev, old_epnum, 0, rcvtog);
1144 +- usb_settoggle(old_dev, old_epnum, 1, sndtog);
1145 +- }
1146 + /* setup new endpoint's toggle bits: */
1147 + rcvtog = usb_gettoggle(dev, epnum, 0);
1148 + sndtog = usb_gettoggle(dev, epnum, 1);
1149 + hctl = (BIT(rcvtog + MAX3421_HCTL_RCVTOG0_BIT) |
1150 + BIT(sndtog + MAX3421_HCTL_SNDTOG0_BIT));
1151 +
1152 +- max3421_hcd->loaded_epnum = epnum;
1153 + spi_wr8(hcd, MAX3421_REG_HCTL, hctl);
1154 +
1155 + /*
1156 +@@ -528,7 +504,6 @@ max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum,
1157 + * address-assignment so it's best to just always load the
1158 + * address whenever the end-point changed/was forced.
1159 + */
1160 +- max3421_hcd->loaded_dev = dev;
1161 + spi_wr8(hcd, MAX3421_REG_PERADDR, dev->devnum);
1162 + }
1163 +
1164 +@@ -663,7 +638,7 @@ max3421_select_and_start_urb(struct usb_hcd *hcd)
1165 + struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd);
1166 + struct urb *urb, *curr_urb = NULL;
1167 + struct max3421_ep *max3421_ep;
1168 +- int epnum, force_toggles = 0;
1169 ++ int epnum;
1170 + struct usb_host_endpoint *ep;
1171 + struct list_head *pos;
1172 + unsigned long flags;
1173 +@@ -773,7 +748,6 @@ done:
1174 + usb_settoggle(urb->dev, epnum, 0, 1);
1175 + usb_settoggle(urb->dev, epnum, 1, 1);
1176 + max3421_ep->pkt_state = PKT_STATE_SETUP;
1177 +- force_toggles = 1;
1178 + } else
1179 + max3421_ep->pkt_state = PKT_STATE_TRANSFER;
1180 + }
1181 +@@ -781,7 +755,7 @@ done:
1182 + spin_unlock_irqrestore(&max3421_hcd->lock, flags);
1183 +
1184 + max3421_ep->last_active = max3421_hcd->frame_number;
1185 +- max3421_set_address(hcd, urb->dev, epnum, force_toggles);
1186 ++ max3421_set_address(hcd, urb->dev, epnum);
1187 + max3421_set_speed(hcd, urb->dev);
1188 + max3421_next_transfer(hcd, 0);
1189 + return 1;
1190 +@@ -1382,6 +1356,16 @@ max3421_urb_done(struct usb_hcd *hcd)
1191 + status = 0;
1192 + urb = max3421_hcd->curr_urb;
1193 + if (urb) {
1194 ++ /* save the old end-points toggles: */
1195 ++ u8 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL);
1196 ++ int rcvtog = (hrsl >> MAX3421_HRSL_RCVTOGRD_BIT) & 1;
1197 ++ int sndtog = (hrsl >> MAX3421_HRSL_SNDTOGRD_BIT) & 1;
1198 ++ int epnum = usb_endpoint_num(&urb->ep->desc);
1199 ++
1200 ++ /* no locking: HCD (i.e., we) own toggles, don't we? */
1201 ++ usb_settoggle(urb->dev, epnum, 0, rcvtog);
1202 ++ usb_settoggle(urb->dev, epnum, 1, sndtog);
1203 ++
1204 + max3421_hcd->curr_urb = NULL;
1205 + spin_lock_irqsave(&max3421_hcd->lock, flags);
1206 + usb_hcd_unlink_urb_from_ep(hcd, urb);
1207 +diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
1208 +index 74d5975bf98f1..6113b9da00c67 100644
1209 +--- a/drivers/usb/host/xhci-hub.c
1210 ++++ b/drivers/usb/host/xhci-hub.c
1211 +@@ -1268,11 +1268,12 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
1212 + * Inform the usbcore about resume-in-progress by returning
1213 + * a non-zero value even if there are no status changes.
1214 + */
1215 ++ spin_lock_irqsave(&xhci->lock, flags);
1216 ++
1217 + status = bus_state->resuming_ports;
1218 +
1219 + mask = PORT_CSC | PORT_PEC | PORT_OCC | PORT_PLC | PORT_WRC | PORT_CEC;
1220 +
1221 +- spin_lock_irqsave(&xhci->lock, flags);
1222 + /* For each port, did anything change? If so, set that bit in buf. */
1223 + for (i = 0; i < max_ports; i++) {
1224 + temp = readl(port_array[i]);
1225 +diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
1226 +index 7d329c6bc65f1..793bd764385af 100644
1227 +--- a/drivers/usb/renesas_usbhs/fifo.c
1228 ++++ b/drivers/usb/renesas_usbhs/fifo.c
1229 +@@ -115,6 +115,8 @@ static struct dma_chan *usbhsf_dma_chan_get(struct usbhs_fifo *fifo,
1230 + #define usbhsf_dma_map(p) __usbhsf_dma_map_ctrl(p, 1)
1231 + #define usbhsf_dma_unmap(p) __usbhsf_dma_map_ctrl(p, 0)
1232 + static int __usbhsf_dma_map_ctrl(struct usbhs_pkt *pkt, int map);
1233 ++static void usbhsf_tx_irq_ctrl(struct usbhs_pipe *pipe, int enable);
1234 ++static void usbhsf_rx_irq_ctrl(struct usbhs_pipe *pipe, int enable);
1235 + struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
1236 + {
1237 + struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
1238 +@@ -138,6 +140,11 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
1239 + dmaengine_terminate_all(chan);
1240 + usbhsf_fifo_clear(pipe, fifo);
1241 + usbhsf_dma_unmap(pkt);
1242 ++ } else {
1243 ++ if (usbhs_pipe_is_dir_in(pipe))
1244 ++ usbhsf_rx_irq_ctrl(pipe, 0);
1245 ++ else
1246 ++ usbhsf_tx_irq_ctrl(pipe, 0);
1247 + }
1248 +
1249 + usbhs_pipe_running(pipe, 0);
1250 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
1251 +index 91462ff9a99d0..f039b85d5f57f 100644
1252 +--- a/drivers/usb/serial/cp210x.c
1253 ++++ b/drivers/usb/serial/cp210x.c
1254 +@@ -152,6 +152,7 @@ static const struct usb_device_id id_table[] = {
1255 + { USB_DEVICE(0x10C4, 0x89A4) }, /* CESINEL FTBC Flexible Thyristor Bridge Controller */
1256 + { USB_DEVICE(0x10C4, 0x89FB) }, /* Qivicon ZigBee USB Radio Stick */
1257 + { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */
1258 ++ { USB_DEVICE(0x10C4, 0x8A5B) }, /* CEL EM3588 ZigBee USB Stick */
1259 + { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */
1260 + { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */
1261 + { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
1262 +@@ -199,8 +200,8 @@ static const struct usb_device_id id_table[] = {
1263 + { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */
1264 + { USB_DEVICE(0x1901, 0x0195) }, /* GE B850/B650/B450 CP2104 DP UART interface */
1265 + { USB_DEVICE(0x1901, 0x0196) }, /* GE B850 CP2105 DP UART interface */
1266 +- { USB_DEVICE(0x1901, 0x0197) }, /* GE CS1000 Display serial interface */
1267 +- { USB_DEVICE(0x1901, 0x0198) }, /* GE CS1000 M.2 Key E serial interface */
1268 ++ { USB_DEVICE(0x1901, 0x0197) }, /* GE CS1000 M.2 Key E serial interface */
1269 ++ { USB_DEVICE(0x1901, 0x0198) }, /* GE CS1000 Display serial interface */
1270 + { USB_DEVICE(0x199B, 0xBA30) }, /* LORD WSDA-200-USB */
1271 + { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */
1272 + { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
1273 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1274 +index 6faa9ac538877..b9017e85cc1ab 100644
1275 +--- a/drivers/usb/serial/option.c
1276 ++++ b/drivers/usb/serial/option.c
1277 +@@ -241,6 +241,7 @@ static void option_instat_callback(struct urb *urb);
1278 + #define QUECTEL_PRODUCT_UC15 0x9090
1279 + /* These u-blox products use Qualcomm's vendor ID */
1280 + #define UBLOX_PRODUCT_R410M 0x90b2
1281 ++#define UBLOX_PRODUCT_R6XX 0x90fa
1282 + /* These Yuga products use Qualcomm's vendor ID */
1283 + #define YUGA_PRODUCT_CLM920_NC5 0x9625
1284 +
1285 +@@ -1098,6 +1099,8 @@ static const struct usb_device_id option_ids[] = {
1286 + /* u-blox products using Qualcomm vendor ID */
1287 + { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M),
1288 + .driver_info = RSVD(1) | RSVD(3) },
1289 ++ { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R6XX),
1290 ++ .driver_info = RSVD(3) },
1291 + /* Quectel products using Quectel vendor ID */
1292 + { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21),
1293 + .driver_info = RSVD(4) },
1294 +diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h
1295 +index 7f4245b01baee..648130903b034 100644
1296 +--- a/drivers/usb/storage/unusual_uas.h
1297 ++++ b/drivers/usb/storage/unusual_uas.h
1298 +@@ -54,6 +54,13 @@ UNUSUAL_DEV(0x059f, 0x105f, 0x0000, 0x9999,
1299 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1300 + US_FL_NO_REPORT_OPCODES),
1301 +
1302 ++/* Reported-by: Julian Sikorski <belegdol@×××××.com> */
1303 ++UNUSUAL_DEV(0x059f, 0x1061, 0x0000, 0x9999,
1304 ++ "LaCie",
1305 ++ "Rugged USB3-FW",
1306 ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1307 ++ US_FL_IGNORE_UAS),
1308 ++
1309 + /*
1310 + * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI
1311 + * commands in UAS mode. Observed with the 1.28 firmware; are there others?
1312 +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
1313 +index 6d846ff696fb3..da4ad006739db 100644
1314 +--- a/fs/btrfs/inode.c
1315 ++++ b/fs/btrfs/inode.c
1316 +@@ -476,7 +476,7 @@ again:
1317 + * inode has not been flagged as nocompress. This flag can
1318 + * change at any time if we discover bad compression ratios.
1319 + */
1320 +- if (inode_need_compress(inode)) {
1321 ++ if (nr_pages > 1 && inode_need_compress(inode)) {
1322 + WARN_ON(pages);
1323 + pages = kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS);
1324 + if (!pages) {
1325 +diff --git a/fs/proc/base.c b/fs/proc/base.c
1326 +index b1ff8eb618021..4d68f5a9e4aa3 100644
1327 +--- a/fs/proc/base.c
1328 ++++ b/fs/proc/base.c
1329 +@@ -887,7 +887,7 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
1330 + flags |= FOLL_WRITE;
1331 +
1332 + while (count > 0) {
1333 +- int this_len = min_t(int, count, PAGE_SIZE);
1334 ++ size_t this_len = min_t(size_t, count, PAGE_SIZE);
1335 +
1336 + if (write && copy_from_user(page, buf, this_len)) {
1337 + copied = -EFAULT;
1338 +diff --git a/include/net/dst_metadata.h b/include/net/dst_metadata.h
1339 +index 30a56ab2ccfb0..4cee368cb91c2 100644
1340 +--- a/include/net/dst_metadata.h
1341 ++++ b/include/net/dst_metadata.h
1342 +@@ -31,7 +31,9 @@ static inline struct ip_tunnel_info *skb_tunnel_info(struct sk_buff *skb)
1343 + return &md_dst->u.tun_info;
1344 +
1345 + dst = skb_dst(skb);
1346 +- if (dst && dst->lwtstate)
1347 ++ if (dst && dst->lwtstate &&
1348 ++ (dst->lwtstate->type == LWTUNNEL_ENCAP_IP ||
1349 ++ dst->lwtstate->type == LWTUNNEL_ENCAP_IP6))
1350 + return lwt_tun_info(dst->lwtstate);
1351 +
1352 + return NULL;
1353 +diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
1354 +index 8d0a9b1fc39a3..69e226324f681 100644
1355 +--- a/include/net/ip6_route.h
1356 ++++ b/include/net/ip6_route.h
1357 +@@ -181,7 +181,7 @@ static inline bool ipv6_anycast_destination(const struct dst_entry *dst,
1358 + int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb,
1359 + int (*output)(struct net *, struct sock *, struct sk_buff *));
1360 +
1361 +-static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
1362 ++static inline unsigned int ip6_skb_dst_mtu(struct sk_buff *skb)
1363 + {
1364 + struct ipv6_pinfo *np = skb->sk && !dev_recursion_level() ?
1365 + inet6_sk(skb->sk) : NULL;
1366 +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
1367 +index 15952d0e340be..e00f17070cb2c 100644
1368 +--- a/kernel/sched/fair.c
1369 ++++ b/kernel/sched/fair.c
1370 +@@ -3852,7 +3852,7 @@ static const u64 cfs_bandwidth_slack_period = 5 * NSEC_PER_MSEC;
1371 + static int runtime_refresh_within(struct cfs_bandwidth *cfs_b, u64 min_expire)
1372 + {
1373 + struct hrtimer *refresh_timer = &cfs_b->period_timer;
1374 +- u64 remaining;
1375 ++ s64 remaining;
1376 +
1377 + /* if the call-back is running a quota refresh is already occurring */
1378 + if (hrtimer_callback_running(refresh_timer))
1379 +@@ -3860,7 +3860,7 @@ static int runtime_refresh_within(struct cfs_bandwidth *cfs_b, u64 min_expire)
1380 +
1381 + /* is a quota refresh about to occur? */
1382 + remaining = ktime_to_ns(hrtimer_expires_remaining(refresh_timer));
1383 +- if (remaining < min_expire)
1384 ++ if (remaining < (s64)min_expire)
1385 + return 1;
1386 +
1387 + return 0;
1388 +diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
1389 +index 1ec760f6bf58b..19b30ff90cc4b 100644
1390 +--- a/kernel/trace/ring_buffer.c
1391 ++++ b/kernel/trace/ring_buffer.c
1392 +@@ -3086,10 +3086,30 @@ static bool rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer)
1393 + if (unlikely(!head))
1394 + return true;
1395 +
1396 +- return reader->read == rb_page_commit(reader) &&
1397 +- (commit == reader ||
1398 +- (commit == head &&
1399 +- head->read == rb_page_commit(commit)));
1400 ++ /* Reader should exhaust content in reader page */
1401 ++ if (reader->read != rb_page_commit(reader))
1402 ++ return false;
1403 ++
1404 ++ /*
1405 ++ * If writers are committing on the reader page, knowing all
1406 ++ * committed content has been read, the ring buffer is empty.
1407 ++ */
1408 ++ if (commit == reader)
1409 ++ return true;
1410 ++
1411 ++ /*
1412 ++ * If writers are committing on a page other than reader page
1413 ++ * and head page, there should always be content to read.
1414 ++ */
1415 ++ if (commit != head)
1416 ++ return false;
1417 ++
1418 ++ /*
1419 ++ * Writers are committing on the head page, we just need
1420 ++ * to care about there're committed data, and the reader will
1421 ++ * swap reader page with head page when it is to read data.
1422 ++ */
1423 ++ return rb_page_commit(commit) == 0;
1424 + }
1425 +
1426 + /**
1427 +diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
1428 +index aa209b1066c96..3cfd413aa2c88 100644
1429 +--- a/net/caif/caif_socket.c
1430 ++++ b/net/caif/caif_socket.c
1431 +@@ -539,7 +539,8 @@ static int caif_seqpkt_sendmsg(struct socket *sock, struct msghdr *msg,
1432 + goto err;
1433 +
1434 + ret = -EINVAL;
1435 +- if (unlikely(msg->msg_iter.iov->iov_base == NULL))
1436 ++ if (unlikely(msg->msg_iter.nr_segs == 0) ||
1437 ++ unlikely(msg->msg_iter.iov->iov_base == NULL))
1438 + goto err;
1439 + noblock = msg->msg_flags & MSG_DONTWAIT;
1440 +
1441 +diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
1442 +index 9d8fcdefefc01..ee297964fcd26 100644
1443 +--- a/net/decnet/af_decnet.c
1444 ++++ b/net/decnet/af_decnet.c
1445 +@@ -823,7 +823,7 @@ static int dn_auto_bind(struct socket *sock)
1446 + static int dn_confirm_accept(struct sock *sk, long *timeo, gfp_t allocation)
1447 + {
1448 + struct dn_scp *scp = DN_SK(sk);
1449 +- DEFINE_WAIT(wait);
1450 ++ DEFINE_WAIT_FUNC(wait, woken_wake_function);
1451 + int err;
1452 +
1453 + if (scp->state != DN_CR)
1454 +@@ -833,11 +833,11 @@ static int dn_confirm_accept(struct sock *sk, long *timeo, gfp_t allocation)
1455 + scp->segsize_loc = dst_metric_advmss(__sk_dst_get(sk));
1456 + dn_send_conn_conf(sk, allocation);
1457 +
1458 +- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1459 ++ add_wait_queue(sk_sleep(sk), &wait);
1460 + for(;;) {
1461 + release_sock(sk);
1462 + if (scp->state == DN_CC)
1463 +- *timeo = schedule_timeout(*timeo);
1464 ++ *timeo = wait_woken(&wait, TASK_INTERRUPTIBLE, *timeo);
1465 + lock_sock(sk);
1466 + err = 0;
1467 + if (scp->state == DN_RUN)
1468 +@@ -851,9 +851,8 @@ static int dn_confirm_accept(struct sock *sk, long *timeo, gfp_t allocation)
1469 + err = -EAGAIN;
1470 + if (!*timeo)
1471 + break;
1472 +- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1473 + }
1474 +- finish_wait(sk_sleep(sk), &wait);
1475 ++ remove_wait_queue(sk_sleep(sk), &wait);
1476 + if (err == 0) {
1477 + sk->sk_socket->state = SS_CONNECTED;
1478 + } else if (scp->state != DN_CC) {
1479 +@@ -865,7 +864,7 @@ static int dn_confirm_accept(struct sock *sk, long *timeo, gfp_t allocation)
1480 + static int dn_wait_run(struct sock *sk, long *timeo)
1481 + {
1482 + struct dn_scp *scp = DN_SK(sk);
1483 +- DEFINE_WAIT(wait);
1484 ++ DEFINE_WAIT_FUNC(wait, woken_wake_function);
1485 + int err = 0;
1486 +
1487 + if (scp->state == DN_RUN)
1488 +@@ -874,11 +873,11 @@ static int dn_wait_run(struct sock *sk, long *timeo)
1489 + if (!*timeo)
1490 + return -EALREADY;
1491 +
1492 +- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1493 ++ add_wait_queue(sk_sleep(sk), &wait);
1494 + for(;;) {
1495 + release_sock(sk);
1496 + if (scp->state == DN_CI || scp->state == DN_CC)
1497 +- *timeo = schedule_timeout(*timeo);
1498 ++ *timeo = wait_woken(&wait, TASK_INTERRUPTIBLE, *timeo);
1499 + lock_sock(sk);
1500 + err = 0;
1501 + if (scp->state == DN_RUN)
1502 +@@ -892,9 +891,8 @@ static int dn_wait_run(struct sock *sk, long *timeo)
1503 + err = -ETIMEDOUT;
1504 + if (!*timeo)
1505 + break;
1506 +- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1507 + }
1508 +- finish_wait(sk_sleep(sk), &wait);
1509 ++ remove_wait_queue(sk_sleep(sk), &wait);
1510 + out:
1511 + if (err == 0) {
1512 + sk->sk_socket->state = SS_CONNECTED;
1513 +@@ -1039,16 +1037,16 @@ static void dn_user_copy(struct sk_buff *skb, struct optdata_dn *opt)
1514 +
1515 + static struct sk_buff *dn_wait_for_connect(struct sock *sk, long *timeo)
1516 + {
1517 +- DEFINE_WAIT(wait);
1518 ++ DEFINE_WAIT_FUNC(wait, woken_wake_function);
1519 + struct sk_buff *skb = NULL;
1520 + int err = 0;
1521 +
1522 +- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1523 ++ add_wait_queue(sk_sleep(sk), &wait);
1524 + for(;;) {
1525 + release_sock(sk);
1526 + skb = skb_dequeue(&sk->sk_receive_queue);
1527 + if (skb == NULL) {
1528 +- *timeo = schedule_timeout(*timeo);
1529 ++ *timeo = wait_woken(&wait, TASK_INTERRUPTIBLE, *timeo);
1530 + skb = skb_dequeue(&sk->sk_receive_queue);
1531 + }
1532 + lock_sock(sk);
1533 +@@ -1063,9 +1061,8 @@ static struct sk_buff *dn_wait_for_connect(struct sock *sk, long *timeo)
1534 + err = -EAGAIN;
1535 + if (!*timeo)
1536 + break;
1537 +- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
1538 + }
1539 +- finish_wait(sk_sleep(sk), &wait);
1540 ++ remove_wait_queue(sk_sleep(sk), &wait);
1541 +
1542 + return skb == NULL ? ERR_PTR(err) : skb;
1543 + }
1544 +diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
1545 +index 3826745a160e5..bb6d251ce103c 100644
1546 +--- a/net/ipv4/tcp_ipv4.c
1547 ++++ b/net/ipv4/tcp_ipv4.c
1548 +@@ -277,7 +277,7 @@ void tcp_v4_mtu_reduced(struct sock *sk)
1549 +
1550 + if ((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE))
1551 + return;
1552 +- mtu = tcp_sk(sk)->mtu_info;
1553 ++ mtu = READ_ONCE(tcp_sk(sk)->mtu_info);
1554 + dst = inet_csk_update_pmtu(sk, mtu);
1555 + if (!dst)
1556 + return;
1557 +@@ -444,7 +444,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
1558 + if (sk->sk_state == TCP_LISTEN)
1559 + goto out;
1560 +
1561 +- tp->mtu_info = info;
1562 ++ WRITE_ONCE(tp->mtu_info, info);
1563 + if (!sock_owned_by_user(sk)) {
1564 + tcp_v4_mtu_reduced(sk);
1565 + } else {
1566 +diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
1567 +index db037082e6f25..3f061bbf842af 100644
1568 +--- a/net/ipv4/tcp_output.c
1569 ++++ b/net/ipv4/tcp_output.c
1570 +@@ -1353,6 +1353,7 @@ int tcp_mtu_to_mss(struct sock *sk, int pmtu)
1571 + return __tcp_mtu_to_mss(sk, pmtu) -
1572 + (tcp_sk(sk)->tcp_header_len - sizeof(struct tcphdr));
1573 + }
1574 ++EXPORT_SYMBOL(tcp_mtu_to_mss);
1575 +
1576 + /* Inverse of above */
1577 + int tcp_mss_to_mtu(struct sock *sk, int mss)
1578 +diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
1579 +index 53e15514d90d2..68c9d033c7182 100644
1580 +--- a/net/ipv6/tcp_ipv6.c
1581 ++++ b/net/ipv6/tcp_ipv6.c
1582 +@@ -308,11 +308,20 @@ failure:
1583 + static void tcp_v6_mtu_reduced(struct sock *sk)
1584 + {
1585 + struct dst_entry *dst;
1586 ++ u32 mtu;
1587 +
1588 + if ((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE))
1589 + return;
1590 +
1591 +- dst = inet6_csk_update_pmtu(sk, tcp_sk(sk)->mtu_info);
1592 ++ mtu = READ_ONCE(tcp_sk(sk)->mtu_info);
1593 ++
1594 ++ /* Drop requests trying to increase our current mss.
1595 ++ * Check done in __ip6_rt_update_pmtu() is too late.
1596 ++ */
1597 ++ if (tcp_mtu_to_mss(sk, mtu) >= tcp_sk(sk)->mss_cache)
1598 ++ return;
1599 ++
1600 ++ dst = inet6_csk_update_pmtu(sk, mtu);
1601 + if (!dst)
1602 + return;
1603 +
1604 +@@ -391,6 +400,8 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
1605 + }
1606 +
1607 + if (type == ICMPV6_PKT_TOOBIG) {
1608 ++ u32 mtu = ntohl(info);
1609 ++
1610 + /* We are not interested in TCP_LISTEN and open_requests
1611 + * (SYN-ACKs send out by Linux are always <576bytes so
1612 + * they should go through unfragmented).
1613 +@@ -401,7 +412,11 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
1614 + if (!ip6_sk_accept_pmtu(sk))
1615 + goto out;
1616 +
1617 +- tp->mtu_info = ntohl(info);
1618 ++ if (mtu < IPV6_MIN_MTU)
1619 ++ goto out;
1620 ++
1621 ++ WRITE_ONCE(tp->mtu_info, mtu);
1622 ++
1623 + if (!sock_owned_by_user(sk))
1624 + tcp_v6_mtu_reduced(sk);
1625 + else if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED,
1626 +diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
1627 +index b2dc9a820c6a5..ef6cc9eb0e45e 100644
1628 +--- a/net/ipv6/xfrm6_output.c
1629 ++++ b/net/ipv6/xfrm6_output.c
1630 +@@ -141,7 +141,7 @@ static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
1631 + {
1632 + struct dst_entry *dst = skb_dst(skb);
1633 + struct xfrm_state *x = dst->xfrm;
1634 +- int mtu;
1635 ++ unsigned int mtu;
1636 + bool toobig;
1637 +
1638 + #ifdef CONFIG_NETFILTER
1639 +diff --git a/net/netrom/nr_timer.c b/net/netrom/nr_timer.c
1640 +index f0ecaec1ff3da..d1a0b70567432 100644
1641 +--- a/net/netrom/nr_timer.c
1642 ++++ b/net/netrom/nr_timer.c
1643 +@@ -125,11 +125,9 @@ static void nr_heartbeat_expiry(unsigned long param)
1644 + is accepted() it isn't 'dead' so doesn't get removed. */
1645 + if (sock_flag(sk, SOCK_DESTROY) ||
1646 + (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) {
1647 +- sock_hold(sk);
1648 + bh_unlock_sock(sk);
1649 + nr_destroy_socket(sk);
1650 +- sock_put(sk);
1651 +- return;
1652 ++ goto out;
1653 + }
1654 + break;
1655 +
1656 +@@ -150,6 +148,8 @@ static void nr_heartbeat_expiry(unsigned long param)
1657 +
1658 + nr_start_heartbeat(sk);
1659 + bh_unlock_sock(sk);
1660 ++out:
1661 ++ sock_put(sk);
1662 + }
1663 +
1664 + static void nr_t2timer_expiry(unsigned long param)
1665 +@@ -163,6 +163,7 @@ static void nr_t2timer_expiry(unsigned long param)
1666 + nr_enquiry_response(sk);
1667 + }
1668 + bh_unlock_sock(sk);
1669 ++ sock_put(sk);
1670 + }
1671 +
1672 + static void nr_t4timer_expiry(unsigned long param)
1673 +@@ -172,6 +173,7 @@ static void nr_t4timer_expiry(unsigned long param)
1674 + bh_lock_sock(sk);
1675 + nr_sk(sk)->condition &= ~NR_COND_PEER_RX_BUSY;
1676 + bh_unlock_sock(sk);
1677 ++ sock_put(sk);
1678 + }
1679 +
1680 + static void nr_idletimer_expiry(unsigned long param)
1681 +@@ -200,6 +202,7 @@ static void nr_idletimer_expiry(unsigned long param)
1682 + sock_set_flag(sk, SOCK_DEAD);
1683 + }
1684 + bh_unlock_sock(sk);
1685 ++ sock_put(sk);
1686 + }
1687 +
1688 + static void nr_t1timer_expiry(unsigned long param)
1689 +@@ -212,8 +215,7 @@ static void nr_t1timer_expiry(unsigned long param)
1690 + case NR_STATE_1:
1691 + if (nr->n2count == nr->n2) {
1692 + nr_disconnect(sk, ETIMEDOUT);
1693 +- bh_unlock_sock(sk);
1694 +- return;
1695 ++ goto out;
1696 + } else {
1697 + nr->n2count++;
1698 + nr_write_internal(sk, NR_CONNREQ);
1699 +@@ -223,8 +225,7 @@ static void nr_t1timer_expiry(unsigned long param)
1700 + case NR_STATE_2:
1701 + if (nr->n2count == nr->n2) {
1702 + nr_disconnect(sk, ETIMEDOUT);
1703 +- bh_unlock_sock(sk);
1704 +- return;
1705 ++ goto out;
1706 + } else {
1707 + nr->n2count++;
1708 + nr_write_internal(sk, NR_DISCREQ);
1709 +@@ -234,8 +235,7 @@ static void nr_t1timer_expiry(unsigned long param)
1710 + case NR_STATE_3:
1711 + if (nr->n2count == nr->n2) {
1712 + nr_disconnect(sk, ETIMEDOUT);
1713 +- bh_unlock_sock(sk);
1714 +- return;
1715 ++ goto out;
1716 + } else {
1717 + nr->n2count++;
1718 + nr_requeue_frames(sk);
1719 +@@ -244,5 +244,7 @@ static void nr_t1timer_expiry(unsigned long param)
1720 + }
1721 +
1722 + nr_start_t1timer(sk);
1723 ++out:
1724 + bh_unlock_sock(sk);
1725 ++ sock_put(sk);
1726 + }
1727 +diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
1728 +index 6fdc97ef6023d..cb73747002edb 100755
1729 +--- a/scripts/mkcompile_h
1730 ++++ b/scripts/mkcompile_h
1731 +@@ -82,15 +82,23 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
1732 + # Only replace the real compile.h if the new one is different,
1733 + # in order to preserve the timestamp and avoid unnecessary
1734 + # recompilations.
1735 +-# We don't consider the file changed if only the date/time changed.
1736 ++# We don't consider the file changed if only the date/time changed,
1737 ++# unless KBUILD_BUILD_TIMESTAMP was explicitly set (e.g. for
1738 ++# reproducible builds with that value referring to a commit timestamp).
1739 + # A kernel config change will increase the generation number, thus
1740 + # causing compile.h to be updated (including date/time) due to the
1741 + # changed comment in the
1742 + # first line.
1743 +
1744 ++if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then
1745 ++ IGNORE_PATTERN="UTS_VERSION"
1746 ++else
1747 ++ IGNORE_PATTERN="NOT_A_PATTERN_TO_BE_MATCHED"
1748 ++fi
1749 ++
1750 + if [ -r $TARGET ] && \
1751 +- grep -v 'UTS_VERSION' $TARGET > .tmpver.1 && \
1752 +- grep -v 'UTS_VERSION' .tmpcompile > .tmpver.2 && \
1753 ++ grep -v $IGNORE_PATTERN $TARGET > .tmpver.1 && \
1754 ++ grep -v $IGNORE_PATTERN .tmpcompile > .tmpver.2 && \
1755 + cmp -s .tmpver.1 .tmpver.2; then
1756 + rm -f .tmpcompile
1757 + else
1758 +diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c
1759 +index 90fa57ad14c04..23834691f4d32 100644
1760 +--- a/sound/isa/sb/sb16_csp.c
1761 ++++ b/sound/isa/sb/sb16_csp.c
1762 +@@ -828,6 +828,7 @@ static int snd_sb_csp_start(struct snd_sb_csp * p, int sample_width, int channel
1763 + mixR = snd_sbmixer_read(p->chip, SB_DSP4_PCM_DEV + 1);
1764 + snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV, mixL & 0x7);
1765 + snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV + 1, mixR & 0x7);
1766 ++ spin_unlock_irqrestore(&p->chip->mixer_lock, flags);
1767 +
1768 + spin_lock(&p->chip->reg_lock);
1769 + set_mode_register(p->chip, 0xc0); /* c0 = STOP */
1770 +@@ -867,6 +868,7 @@ static int snd_sb_csp_start(struct snd_sb_csp * p, int sample_width, int channel
1771 + spin_unlock(&p->chip->reg_lock);
1772 +
1773 + /* restore PCM volume */
1774 ++ spin_lock_irqsave(&p->chip->mixer_lock, flags);
1775 + snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV, mixL);
1776 + snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV + 1, mixR);
1777 + spin_unlock_irqrestore(&p->chip->mixer_lock, flags);
1778 +@@ -892,6 +894,7 @@ static int snd_sb_csp_stop(struct snd_sb_csp * p)
1779 + mixR = snd_sbmixer_read(p->chip, SB_DSP4_PCM_DEV + 1);
1780 + snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV, mixL & 0x7);
1781 + snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV + 1, mixR & 0x7);
1782 ++ spin_unlock_irqrestore(&p->chip->mixer_lock, flags);
1783 +
1784 + spin_lock(&p->chip->reg_lock);
1785 + if (p->running & SNDRV_SB_CSP_ST_QSOUND) {
1786 +@@ -906,6 +909,7 @@ static int snd_sb_csp_stop(struct snd_sb_csp * p)
1787 + spin_unlock(&p->chip->reg_lock);
1788 +
1789 + /* restore PCM volume */
1790 ++ spin_lock_irqsave(&p->chip->mixer_lock, flags);
1791 + snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV, mixL);
1792 + snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV + 1, mixR);
1793 + spin_unlock_irqrestore(&p->chip->mixer_lock, flags);
1794 +diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
1795 +index 6ebfdee3e2c6d..661cca25ae5d5 100644
1796 +--- a/tools/perf/tests/bpf.c
1797 ++++ b/tools/perf/tests/bpf.c
1798 +@@ -1,4 +1,5 @@
1799 + #include <stdio.h>
1800 ++#include <stdlib.h>
1801 + #include <sys/epoll.h>
1802 + #include <util/bpf-loader.h>
1803 + #include <util/evlist.h>
1804 +@@ -176,6 +177,7 @@ static int __test__bpf(int idx)
1805 + bpf_testcase_table[idx].target_func,
1806 + bpf_testcase_table[idx].expect_result);
1807 + out:
1808 ++ free(obj_buf);
1809 + bpf__clear();
1810 + return ret;
1811 + }
1812 +diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
1813 +index e3b3b92e44587..7476757680ed9 100644
1814 +--- a/tools/perf/util/probe-file.c
1815 ++++ b/tools/perf/util/probe-file.c
1816 +@@ -318,10 +318,10 @@ int probe_file__del_events(int fd, struct strfilter *filter)
1817 +
1818 + ret = probe_file__get_events(fd, filter, namelist);
1819 + if (ret < 0)
1820 +- return ret;
1821 ++ goto out;
1822 +
1823 + ret = probe_file__del_strlist(fd, namelist);
1824 ++out:
1825 + strlist__delete(namelist);
1826 +-
1827 + return ret;
1828 + }