Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.14 commit in: /
Date: Tue, 29 Oct 2019 14:00:01
Message-Id: 1572357542.97e5d037000a0fa49726a9806603c481c9cd8a6f.mpagano@gentoo
1 commit: 97e5d037000a0fa49726a9806603c481c9cd8a6f
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 25 10:51:45 2019 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 29 13:59:02 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=97e5d037
7
8 Linux patch 4.14.130
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1129_linux-4.14.130.patch | 1473 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 1477 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index dc6e2d8..5805bb9 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -559,6 +559,10 @@ Patch: 1128_linux-4.14.129.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.14.129
23
24 +Patch: 1129_linux-4.14.130.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.14.130
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/1129_linux-4.14.130.patch b/1129_linux-4.14.130.patch
33 new file mode 100644
34 index 0000000..ff52749
35 --- /dev/null
36 +++ b/1129_linux-4.14.130.patch
37 @@ -0,0 +1,1473 @@
38 +diff --git a/Makefile b/Makefile
39 +index 2a55dd5bee0a..9d0715c300b1 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 14
46 +-SUBLEVEL = 129
47 ++SUBLEVEL = 130
48 + EXTRAVERSION =
49 + NAME = Petit Gorille
50 +
51 +@@ -650,6 +650,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
52 + KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
53 + KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
54 + KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context)
55 ++KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
56 + KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias)
57 +
58 + ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
59 +@@ -716,7 +717,6 @@ ifeq ($(cc-name),clang)
60 + KBUILD_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
61 + KBUILD_CFLAGS += $(call cc-disable-warning, format-invalid-specifier)
62 + KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
63 +-KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
64 + # Quiet clang warning: comparison of unsigned expression < 0 is always false
65 + KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
66 + # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the
67 +diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts
68 +index 8f627c200d60..57d81c6aa379 100644
69 +--- a/arch/arc/boot/dts/hsdk.dts
70 ++++ b/arch/arc/boot/dts/hsdk.dts
71 +@@ -163,12 +163,16 @@
72 + interrupt-names = "macirq";
73 + phy-mode = "rgmii";
74 + snps,pbl = <32>;
75 ++ snps,multicast-filter-bins = <256>;
76 + clocks = <&gmacclk>;
77 + clock-names = "stmmaceth";
78 + phy-handle = <&phy0>;
79 + resets = <&cgu_rst HSDK_ETH_RESET>;
80 + reset-names = "stmmaceth";
81 +
82 ++ tx-fifo-depth = <4096>;
83 ++ rx-fifo-depth = <4096>;
84 ++
85 + mdio {
86 + #address-cells = <1>;
87 + #size-cells = <0>;
88 +diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h
89 +index d819de1c5d10..3ea4112c8302 100644
90 +--- a/arch/arc/include/asm/cmpxchg.h
91 ++++ b/arch/arc/include/asm/cmpxchg.h
92 +@@ -92,8 +92,11 @@ __cmpxchg(volatile void *ptr, unsigned long expected, unsigned long new)
93 +
94 + #endif /* CONFIG_ARC_HAS_LLSC */
95 +
96 +-#define cmpxchg(ptr, o, n) ((typeof(*(ptr)))__cmpxchg((ptr), \
97 +- (unsigned long)(o), (unsigned long)(n)))
98 ++#define cmpxchg(ptr, o, n) ({ \
99 ++ (typeof(*(ptr)))__cmpxchg((ptr), \
100 ++ (unsigned long)(o), \
101 ++ (unsigned long)(n)); \
102 ++})
103 +
104 + /*
105 + * atomic_cmpxchg is same as cmpxchg
106 +@@ -198,8 +201,11 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr,
107 + return __xchg_bad_pointer();
108 + }
109 +
110 +-#define xchg(ptr, with) ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), \
111 +- sizeof(*(ptr))))
112 ++#define xchg(ptr, with) ({ \
113 ++ (typeof(*(ptr)))__xchg((unsigned long)(with), \
114 ++ (ptr), \
115 ++ sizeof(*(ptr))); \
116 ++})
117 +
118 + #endif /* CONFIG_ARC_PLAT_EZNPS */
119 +
120 +diff --git a/arch/arc/mm/tlb.c b/arch/arc/mm/tlb.c
121 +index 8ceefbf72fb0..e5817b9b2c3f 100644
122 +--- a/arch/arc/mm/tlb.c
123 ++++ b/arch/arc/mm/tlb.c
124 +@@ -902,9 +902,11 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address,
125 + struct pt_regs *regs)
126 + {
127 + struct cpuinfo_arc_mmu *mmu = &cpuinfo_arc700[smp_processor_id()].mmu;
128 +- unsigned int pd0[mmu->ways];
129 + unsigned long flags;
130 +- int set;
131 ++ int set, n_ways = mmu->ways;
132 ++
133 ++ n_ways = min(n_ways, 4);
134 ++ BUG_ON(mmu->ways > 4);
135 +
136 + local_irq_save(flags);
137 +
138 +@@ -912,9 +914,10 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address,
139 + for (set = 0; set < mmu->sets; set++) {
140 +
141 + int is_valid, way;
142 ++ unsigned int pd0[4];
143 +
144 + /* read out all the ways of current set */
145 +- for (way = 0, is_valid = 0; way < mmu->ways; way++) {
146 ++ for (way = 0, is_valid = 0; way < n_ways; way++) {
147 + write_aux_reg(ARC_REG_TLBINDEX,
148 + SET_WAY_TO_IDX(mmu, set, way));
149 + write_aux_reg(ARC_REG_TLBCOMMAND, TLBRead);
150 +@@ -928,14 +931,14 @@ void do_tlb_overlap_fault(unsigned long cause, unsigned long address,
151 + continue;
152 +
153 + /* Scan the set for duplicate ways: needs a nested loop */
154 +- for (way = 0; way < mmu->ways - 1; way++) {
155 ++ for (way = 0; way < n_ways - 1; way++) {
156 +
157 + int n;
158 +
159 + if (!pd0[way])
160 + continue;
161 +
162 +- for (n = way + 1; n < mmu->ways; n++) {
163 ++ for (n = way + 1; n < n_ways; n++) {
164 + if (pd0[way] != pd0[n])
165 + continue;
166 +
167 +diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi b/arch/arm/boot/dts/am57xx-idk-common.dtsi
168 +index 97aa8e6a56da..9afebbfc4422 100644
169 +--- a/arch/arm/boot/dts/am57xx-idk-common.dtsi
170 ++++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi
171 +@@ -405,6 +405,7 @@
172 + vqmmc-supply = <&ldo1_reg>;
173 + bus-width = <4>;
174 + cd-gpios = <&gpio6 27 GPIO_ACTIVE_LOW>; /* gpio 219 */
175 ++ no-1-8-v;
176 + };
177 +
178 + &mmc2 {
179 +diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c b/arch/arm/mach-imx/cpuidle-imx6sx.c
180 +index edb888ac5ad3..c6aa77dfd00a 100644
181 +--- a/arch/arm/mach-imx/cpuidle-imx6sx.c
182 ++++ b/arch/arm/mach-imx/cpuidle-imx6sx.c
183 +@@ -15,6 +15,7 @@
184 +
185 + #include "common.h"
186 + #include "cpuidle.h"
187 ++#include "hardware.h"
188 +
189 + static int imx6sx_idle_finish(unsigned long val)
190 + {
191 +@@ -108,7 +109,7 @@ int __init imx6sx_cpuidle_init(void)
192 + * except for power up sw2iso which need to be
193 + * larger than LDO ramp up time.
194 + */
195 +- imx_gpc_set_arm_power_up_timing(0xf, 1);
196 ++ imx_gpc_set_arm_power_up_timing(cpu_is_imx6sx() ? 0xf : 0x2, 1);
197 + imx_gpc_set_arm_power_down_timing(1, 1);
198 +
199 + return cpuidle_register(&imx6sx_cpuidle_driver, NULL);
200 +diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c
201 +index f7a0645ccb82..6305e91ffc44 100644
202 +--- a/arch/mips/kernel/uprobes.c
203 ++++ b/arch/mips/kernel/uprobes.c
204 +@@ -112,9 +112,6 @@ int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs)
205 + */
206 + aup->resume_epc = regs->cp0_epc + 4;
207 + if (insn_has_delay_slot((union mips_instruction) aup->insn[0])) {
208 +- unsigned long epc;
209 +-
210 +- epc = regs->cp0_epc;
211 + __compute_return_epc_for_insn(regs,
212 + (union mips_instruction) aup->insn[0]);
213 + aup->resume_epc = regs->cp0_epc;
214 +diff --git a/arch/parisc/math-emu/cnv_float.h b/arch/parisc/math-emu/cnv_float.h
215 +index 933423fa5144..b0db61188a61 100644
216 +--- a/arch/parisc/math-emu/cnv_float.h
217 ++++ b/arch/parisc/math-emu/cnv_float.h
218 +@@ -60,19 +60,19 @@
219 + ((exponent < (SGL_P - 1)) ? \
220 + (Sall(sgl_value) << (SGL_EXP_LENGTH + 1 + exponent)) : FALSE)
221 +
222 +-#define Int_isinexact_to_sgl(int_value) (int_value << 33 - SGL_EXP_LENGTH)
223 ++#define Int_isinexact_to_sgl(int_value) ((int_value << 33 - SGL_EXP_LENGTH) != 0)
224 +
225 + #define Sgl_roundnearest_from_int(int_value,sgl_value) \
226 + if (int_value & 1<<(SGL_EXP_LENGTH - 2)) /* round bit */ \
227 +- if ((int_value << 34 - SGL_EXP_LENGTH) || Slow(sgl_value)) \
228 ++ if (((int_value << 34 - SGL_EXP_LENGTH) != 0) || Slow(sgl_value)) \
229 + Sall(sgl_value)++
230 +
231 + #define Dint_isinexact_to_sgl(dint_valueA,dint_valueB) \
232 +- ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB))
233 ++ (((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) != 0) || Dintp2(dint_valueB))
234 +
235 + #define Sgl_roundnearest_from_dint(dint_valueA,dint_valueB,sgl_value) \
236 + if (Dintp1(dint_valueA) & 1<<(SGL_EXP_LENGTH - 2)) \
237 +- if ((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) || \
238 ++ if (((Dintp1(dint_valueA) << 34 - SGL_EXP_LENGTH) != 0) || \
239 + Dintp2(dint_valueB) || Slow(sgl_value)) Sall(sgl_value)++
240 +
241 + #define Dint_isinexact_to_dbl(dint_value) \
242 +diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h
243 +index b991bd31b383..031fc1bb23ac 100644
244 +--- a/arch/powerpc/include/asm/ppc-opcode.h
245 ++++ b/arch/powerpc/include/asm/ppc-opcode.h
246 +@@ -324,6 +324,7 @@
247 + #define PPC_INST_MULLI 0x1c000000
248 + #define PPC_INST_DIVWU 0x7c000396
249 + #define PPC_INST_DIVD 0x7c0003d2
250 ++#define PPC_INST_DIVDU 0x7c000392
251 + #define PPC_INST_RLWINM 0x54000000
252 + #define PPC_INST_RLWIMI 0x50000000
253 + #define PPC_INST_RLDICL 0x78000000
254 +diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h
255 +index 68dece206048..e5c1d30ee968 100644
256 +--- a/arch/powerpc/net/bpf_jit.h
257 ++++ b/arch/powerpc/net/bpf_jit.h
258 +@@ -116,7 +116,7 @@
259 + ___PPC_RA(a) | IMM_L(i))
260 + #define PPC_DIVWU(d, a, b) EMIT(PPC_INST_DIVWU | ___PPC_RT(d) | \
261 + ___PPC_RA(a) | ___PPC_RB(b))
262 +-#define PPC_DIVD(d, a, b) EMIT(PPC_INST_DIVD | ___PPC_RT(d) | \
263 ++#define PPC_DIVDU(d, a, b) EMIT(PPC_INST_DIVDU | ___PPC_RT(d) | \
264 + ___PPC_RA(a) | ___PPC_RB(b))
265 + #define PPC_AND(d, a, b) EMIT(PPC_INST_AND | ___PPC_RA(d) | \
266 + ___PPC_RS(a) | ___PPC_RB(b))
267 +diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c
268 +index 3a21d3956ad4..70e8216a39f0 100644
269 +--- a/arch/powerpc/net/bpf_jit_comp64.c
270 ++++ b/arch/powerpc/net/bpf_jit_comp64.c
271 +@@ -415,12 +415,12 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
272 + PPC_LI(b2p[BPF_REG_0], 0);
273 + PPC_JMP(exit_addr);
274 + if (BPF_OP(code) == BPF_MOD) {
275 +- PPC_DIVD(b2p[TMP_REG_1], dst_reg, src_reg);
276 ++ PPC_DIVDU(b2p[TMP_REG_1], dst_reg, src_reg);
277 + PPC_MULD(b2p[TMP_REG_1], src_reg,
278 + b2p[TMP_REG_1]);
279 + PPC_SUB(dst_reg, dst_reg, b2p[TMP_REG_1]);
280 + } else
281 +- PPC_DIVD(dst_reg, dst_reg, src_reg);
282 ++ PPC_DIVDU(dst_reg, dst_reg, src_reg);
283 + break;
284 + case BPF_ALU | BPF_MOD | BPF_K: /* (u32) dst %= (u32) imm */
285 + case BPF_ALU | BPF_DIV | BPF_K: /* (u32) dst /= (u32) imm */
286 +@@ -448,7 +448,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
287 + break;
288 + case BPF_ALU64:
289 + if (BPF_OP(code) == BPF_MOD) {
290 +- PPC_DIVD(b2p[TMP_REG_2], dst_reg,
291 ++ PPC_DIVDU(b2p[TMP_REG_2], dst_reg,
292 + b2p[TMP_REG_1]);
293 + PPC_MULD(b2p[TMP_REG_1],
294 + b2p[TMP_REG_1],
295 +@@ -456,7 +456,7 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image,
296 + PPC_SUB(dst_reg, dst_reg,
297 + b2p[TMP_REG_1]);
298 + } else
299 +- PPC_DIVD(dst_reg, dst_reg,
300 ++ PPC_DIVDU(dst_reg, dst_reg,
301 + b2p[TMP_REG_1]);
302 + break;
303 + }
304 +diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c
305 +index 1ef6156b1530..8f24f3d60b8c 100644
306 +--- a/arch/sparc/kernel/mdesc.c
307 ++++ b/arch/sparc/kernel/mdesc.c
308 +@@ -355,6 +355,8 @@ static int get_vdev_port_node_info(struct mdesc_handle *md, u64 node,
309 +
310 + node_info->vdev_port.id = *idp;
311 + node_info->vdev_port.name = kstrdup_const(name, GFP_KERNEL);
312 ++ if (!node_info->vdev_port.name)
313 ++ return -1;
314 + node_info->vdev_port.parent_cfg_hdl = *parent_cfg_hdlp;
315 +
316 + return 0;
317 +diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
318 +index eceb0215bdee..58ea64a29d5f 100644
319 +--- a/arch/sparc/kernel/perf_event.c
320 ++++ b/arch/sparc/kernel/perf_event.c
321 +@@ -891,6 +891,10 @@ static int sparc_perf_event_set_period(struct perf_event *event,
322 + s64 period = hwc->sample_period;
323 + int ret = 0;
324 +
325 ++ /* The period may have been changed by PERF_EVENT_IOC_PERIOD */
326 ++ if (unlikely(period != hwc->last_period))
327 ++ left = period - (hwc->last_period - left);
328 ++
329 + if (unlikely(left <= -period)) {
330 + left = period;
331 + local64_set(&hwc->period_left, left);
332 +diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
333 +index 08175df7a69e..66eefe1919a4 100644
334 +--- a/arch/xtensa/kernel/setup.c
335 ++++ b/arch/xtensa/kernel/setup.c
336 +@@ -310,7 +310,8 @@ extern char _SecondaryResetVector_text_start;
337 + extern char _SecondaryResetVector_text_end;
338 + #endif
339 +
340 +-static inline int mem_reserve(unsigned long start, unsigned long end)
341 ++static inline int __init_memblock mem_reserve(unsigned long start,
342 ++ unsigned long end)
343 + {
344 + return memblock_reserve(start, end - start);
345 + }
346 +diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c
347 +index 72b22b805412..6f03700a94be 100644
348 +--- a/drivers/gpu/drm/arm/hdlcd_crtc.c
349 ++++ b/drivers/gpu/drm/arm/hdlcd_crtc.c
350 +@@ -186,20 +186,20 @@ static void hdlcd_crtc_atomic_disable(struct drm_crtc *crtc,
351 + clk_disable_unprepare(hdlcd->clk);
352 + }
353 +
354 +-static int hdlcd_crtc_atomic_check(struct drm_crtc *crtc,
355 +- struct drm_crtc_state *state)
356 ++static enum drm_mode_status hdlcd_crtc_mode_valid(struct drm_crtc *crtc,
357 ++ const struct drm_display_mode *mode)
358 + {
359 + struct hdlcd_drm_private *hdlcd = crtc_to_hdlcd_priv(crtc);
360 +- struct drm_display_mode *mode = &state->adjusted_mode;
361 + long rate, clk_rate = mode->clock * 1000;
362 +
363 + rate = clk_round_rate(hdlcd->clk, clk_rate);
364 +- if (rate != clk_rate) {
365 ++ /* 0.1% seems a close enough tolerance for the TDA19988 on Juno */
366 ++ if (abs(rate - clk_rate) * 1000 > clk_rate) {
367 + /* clock required by mode not supported by hardware */
368 +- return -EINVAL;
369 ++ return MODE_NOCLOCK;
370 + }
371 +
372 +- return 0;
373 ++ return MODE_OK;
374 + }
375 +
376 + static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc,
377 +@@ -220,7 +220,7 @@ static void hdlcd_crtc_atomic_begin(struct drm_crtc *crtc,
378 + }
379 +
380 + static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = {
381 +- .atomic_check = hdlcd_crtc_atomic_check,
382 ++ .mode_valid = hdlcd_crtc_mode_valid,
383 + .atomic_begin = hdlcd_crtc_atomic_begin,
384 + .atomic_enable = hdlcd_crtc_atomic_enable,
385 + .atomic_disable = hdlcd_crtc_atomic_disable,
386 +diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
387 +index c9790e2c3440..7b53065e9882 100644
388 +--- a/drivers/hwmon/hwmon.c
389 ++++ b/drivers/hwmon/hwmon.c
390 +@@ -608,7 +608,7 @@ __hwmon_device_register(struct device *dev, const char *name, void *drvdata,
391 + if (err)
392 + goto free_hwmon;
393 +
394 +- if (dev && chip && chip->ops->read &&
395 ++ if (dev && dev->of_node && chip && chip->ops->read &&
396 + chip->info[0]->type == hwmon_chip &&
397 + (chip->info[0]->config[0] & HWMON_C_REGISTER_TZ)) {
398 + const struct hwmon_channel_info **info = chip->info;
399 +diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
400 +index 924f3ca41c65..cb9064ac4977 100644
401 +--- a/drivers/hwmon/pmbus/pmbus_core.c
402 ++++ b/drivers/hwmon/pmbus/pmbus_core.c
403 +@@ -1055,7 +1055,8 @@ static int pmbus_add_sensor_attrs_one(struct i2c_client *client,
404 + const struct pmbus_driver_info *info,
405 + const char *name,
406 + int index, int page,
407 +- const struct pmbus_sensor_attr *attr)
408 ++ const struct pmbus_sensor_attr *attr,
409 ++ bool paged)
410 + {
411 + struct pmbus_sensor *base;
412 + bool upper = !!(attr->gbit & 0xff00); /* need to check STATUS_WORD */
413 +@@ -1063,7 +1064,7 @@ static int pmbus_add_sensor_attrs_one(struct i2c_client *client,
414 +
415 + if (attr->label) {
416 + ret = pmbus_add_label(data, name, index, attr->label,
417 +- attr->paged ? page + 1 : 0);
418 ++ paged ? page + 1 : 0);
419 + if (ret)
420 + return ret;
421 + }
422 +@@ -1096,6 +1097,30 @@ static int pmbus_add_sensor_attrs_one(struct i2c_client *client,
423 + return 0;
424 + }
425 +
426 ++static bool pmbus_sensor_is_paged(const struct pmbus_driver_info *info,
427 ++ const struct pmbus_sensor_attr *attr)
428 ++{
429 ++ int p;
430 ++
431 ++ if (attr->paged)
432 ++ return true;
433 ++
434 ++ /*
435 ++ * Some attributes may be present on more than one page despite
436 ++ * not being marked with the paged attribute. If that is the case,
437 ++ * then treat the sensor as being paged and add the page suffix to the
438 ++ * attribute name.
439 ++ * We don't just add the paged attribute to all such attributes, in
440 ++ * order to maintain the un-suffixed labels in the case where the
441 ++ * attribute is only on page 0.
442 ++ */
443 ++ for (p = 1; p < info->pages; p++) {
444 ++ if (info->func[p] & attr->func)
445 ++ return true;
446 ++ }
447 ++ return false;
448 ++}
449 ++
450 + static int pmbus_add_sensor_attrs(struct i2c_client *client,
451 + struct pmbus_data *data,
452 + const char *name,
453 +@@ -1109,14 +1134,15 @@ static int pmbus_add_sensor_attrs(struct i2c_client *client,
454 + index = 1;
455 + for (i = 0; i < nattrs; i++) {
456 + int page, pages;
457 ++ bool paged = pmbus_sensor_is_paged(info, attrs);
458 +
459 +- pages = attrs->paged ? info->pages : 1;
460 ++ pages = paged ? info->pages : 1;
461 + for (page = 0; page < pages; page++) {
462 + if (!(info->func[page] & attrs->func))
463 + continue;
464 + ret = pmbus_add_sensor_attrs_one(client, data, info,
465 + name, index, page,
466 +- attrs);
467 ++ attrs, paged);
468 + if (ret)
469 + return ret;
470 + index++;
471 +diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c
472 +index db33ad985a12..69a79fdfa23e 100644
473 +--- a/drivers/infiniband/hw/hfi1/chip.c
474 ++++ b/drivers/infiniband/hw/hfi1/chip.c
475 +@@ -9823,6 +9823,7 @@ void hfi1_quiet_serdes(struct hfi1_pportdata *ppd)
476 +
477 + /* disable the port */
478 + clear_rcvctrl(dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK);
479 ++ cancel_work_sync(&ppd->freeze_work);
480 + }
481 +
482 + static inline int init_cpu_counters(struct hfi1_devdata *dd)
483 +diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
484 +index 6f6c14df383e..b38e3808836c 100644
485 +--- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c
486 ++++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
487 +@@ -324,6 +324,9 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd,
488 + u32 *tidlist = NULL;
489 + struct tid_user_buf *tidbuf;
490 +
491 ++ if (!PAGE_ALIGNED(tinfo->vaddr))
492 ++ return -EINVAL;
493 ++
494 + tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL);
495 + if (!tidbuf)
496 + return -ENOMEM;
497 +diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c
498 +index 2e8854ba18cf..f4372afa0e81 100644
499 +--- a/drivers/infiniband/hw/hfi1/verbs.c
500 ++++ b/drivers/infiniband/hw/hfi1/verbs.c
501 +@@ -1400,8 +1400,6 @@ static void hfi1_fill_device_attr(struct hfi1_devdata *dd)
502 + rdi->dparms.props.max_cq = hfi1_max_cqs;
503 + rdi->dparms.props.max_ah = hfi1_max_ahs;
504 + rdi->dparms.props.max_cqe = hfi1_max_cqes;
505 +- rdi->dparms.props.max_mr = rdi->lkey_table.max;
506 +- rdi->dparms.props.max_fmr = rdi->lkey_table.max;
507 + rdi->dparms.props.max_map_per_fmr = 32767;
508 + rdi->dparms.props.max_pd = hfi1_max_pds;
509 + rdi->dparms.props.max_qp_rd_atom = HFI1_MAX_RDMA_ATOMIC;
510 +diff --git a/drivers/infiniband/hw/hfi1/verbs_txreq.c b/drivers/infiniband/hw/hfi1/verbs_txreq.c
511 +index c4ab2d5b4502..8f766dd3f61c 100644
512 +--- a/drivers/infiniband/hw/hfi1/verbs_txreq.c
513 ++++ b/drivers/infiniband/hw/hfi1/verbs_txreq.c
514 +@@ -100,7 +100,7 @@ struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev,
515 + if (ib_rvt_state_ops[qp->state] & RVT_PROCESS_RECV_OK) {
516 + struct hfi1_qp_priv *priv;
517 +
518 +- tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC);
519 ++ tx = kmem_cache_alloc(dev->verbs_txreq_cache, VERBS_TXREQ_GFP);
520 + if (tx)
521 + goto out;
522 + priv = qp->priv;
523 +diff --git a/drivers/infiniband/hw/hfi1/verbs_txreq.h b/drivers/infiniband/hw/hfi1/verbs_txreq.h
524 +index 22fc5ddf01ca..22c9e128cafb 100644
525 +--- a/drivers/infiniband/hw/hfi1/verbs_txreq.h
526 ++++ b/drivers/infiniband/hw/hfi1/verbs_txreq.h
527 +@@ -72,6 +72,7 @@ struct hfi1_ibdev;
528 + struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev,
529 + struct rvt_qp *qp);
530 +
531 ++#define VERBS_TXREQ_GFP (GFP_ATOMIC | __GFP_NOWARN)
532 + static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev,
533 + struct rvt_qp *qp)
534 + __must_hold(&qp->slock)
535 +@@ -79,7 +80,7 @@ static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev,
536 + struct verbs_txreq *tx;
537 + struct hfi1_qp_priv *priv = qp->priv;
538 +
539 +- tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC);
540 ++ tx = kmem_cache_alloc(dev->verbs_txreq_cache, VERBS_TXREQ_GFP);
541 + if (unlikely(!tx)) {
542 + /* call slow path to get the lock */
543 + tx = __get_txreq(dev, qp);
544 +diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c
545 +index 9d92aeb8d9a1..350bc29a066f 100644
546 +--- a/drivers/infiniband/hw/qib/qib_verbs.c
547 ++++ b/drivers/infiniband/hw/qib/qib_verbs.c
548 +@@ -1495,8 +1495,6 @@ static void qib_fill_device_attr(struct qib_devdata *dd)
549 + rdi->dparms.props.max_cq = ib_qib_max_cqs;
550 + rdi->dparms.props.max_cqe = ib_qib_max_cqes;
551 + rdi->dparms.props.max_ah = ib_qib_max_ahs;
552 +- rdi->dparms.props.max_mr = rdi->lkey_table.max;
553 +- rdi->dparms.props.max_fmr = rdi->lkey_table.max;
554 + rdi->dparms.props.max_map_per_fmr = 32767;
555 + rdi->dparms.props.max_qp_rd_atom = QIB_MAX_RDMA_ATOMIC;
556 + rdi->dparms.props.max_qp_init_rd_atom = 255;
557 +diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c
558 +index e7013d2d4f0e..d5b51f4cb49a 100644
559 +--- a/drivers/infiniband/sw/rdmavt/mr.c
560 ++++ b/drivers/infiniband/sw/rdmavt/mr.c
561 +@@ -96,6 +96,8 @@ int rvt_driver_mr_init(struct rvt_dev_info *rdi)
562 + for (i = 0; i < rdi->lkey_table.max; i++)
563 + RCU_INIT_POINTER(rdi->lkey_table.table[i], NULL);
564 +
565 ++ rdi->dparms.props.max_mr = rdi->lkey_table.max;
566 ++ rdi->dparms.props.max_fmr = rdi->lkey_table.max;
567 + return 0;
568 + }
569 +
570 +diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
571 +index 22df09ae809e..b0309876f4bb 100644
572 +--- a/drivers/infiniband/sw/rdmavt/qp.c
573 ++++ b/drivers/infiniband/sw/rdmavt/qp.c
574 +@@ -412,7 +412,8 @@ static int alloc_qpn(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt,
575 + offset = qpt->incr | ((offset & 1) ^ 1);
576 + }
577 + /* there can be no set bits in low-order QoS bits */
578 +- WARN_ON(offset & (BIT(rdi->dparms.qos_shift) - 1));
579 ++ WARN_ON(rdi->dparms.qos_shift > 1 &&
580 ++ offset & ((BIT(rdi->dparms.qos_shift - 1) - 1) << 1));
581 + qpn = mk_qpn(qpt, map, offset);
582 + }
583 +
584 +diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
585 +index 8c95d3f78072..4330f181e2bc 100644
586 +--- a/drivers/input/misc/uinput.c
587 ++++ b/drivers/input/misc/uinput.c
588 +@@ -1012,13 +1012,31 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
589 +
590 + #ifdef CONFIG_COMPAT
591 +
592 +-#define UI_SET_PHYS_COMPAT _IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t)
593 ++/*
594 ++ * These IOCTLs change their size and thus their numbers between
595 ++ * 32 and 64 bits.
596 ++ */
597 ++#define UI_SET_PHYS_COMPAT \
598 ++ _IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t)
599 ++#define UI_BEGIN_FF_UPLOAD_COMPAT \
600 ++ _IOWR(UINPUT_IOCTL_BASE, 200, struct uinput_ff_upload_compat)
601 ++#define UI_END_FF_UPLOAD_COMPAT \
602 ++ _IOW(UINPUT_IOCTL_BASE, 201, struct uinput_ff_upload_compat)
603 +
604 + static long uinput_compat_ioctl(struct file *file,
605 + unsigned int cmd, unsigned long arg)
606 + {
607 +- if (cmd == UI_SET_PHYS_COMPAT)
608 ++ switch (cmd) {
609 ++ case UI_SET_PHYS_COMPAT:
610 + cmd = UI_SET_PHYS;
611 ++ break;
612 ++ case UI_BEGIN_FF_UPLOAD_COMPAT:
613 ++ cmd = UI_BEGIN_FF_UPLOAD;
614 ++ break;
615 ++ case UI_END_FF_UPLOAD_COMPAT:
616 ++ cmd = UI_END_FF_UPLOAD;
617 ++ break;
618 ++ }
619 +
620 + return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg));
621 + }
622 +diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
623 +index e9ec5d10e0a9..a5f279da83a1 100644
624 +--- a/drivers/input/mouse/synaptics.c
625 ++++ b/drivers/input/mouse/synaptics.c
626 +@@ -179,6 +179,8 @@ static const char * const smbus_pnp_ids[] = {
627 + "LEN0096", /* X280 */
628 + "LEN0097", /* X280 -> ALPS trackpoint */
629 + "LEN200f", /* T450s */
630 ++ "LEN2054", /* E480 */
631 ++ "LEN2055", /* E580 */
632 + "SYN3052", /* HP EliteBook 840 G4 */
633 + "SYN3221", /* HP 15-ay000 */
634 + NULL
635 +diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
636 +index cc43687ca241..7ee8c9082021 100644
637 +--- a/drivers/mmc/core/sdio.c
638 ++++ b/drivers/mmc/core/sdio.c
639 +@@ -907,6 +907,10 @@ static int mmc_sdio_pre_suspend(struct mmc_host *host)
640 + */
641 + static int mmc_sdio_suspend(struct mmc_host *host)
642 + {
643 ++ /* Prevent processing of SDIO IRQs in suspended state. */
644 ++ mmc_card_set_suspended(host->card);
645 ++ cancel_delayed_work_sync(&host->sdio_irq_work);
646 ++
647 + mmc_claim_host(host);
648 +
649 + if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host))
650 +@@ -962,13 +966,20 @@ static int mmc_sdio_resume(struct mmc_host *host)
651 + err = sdio_enable_4bit_bus(host->card);
652 + }
653 +
654 +- if (!err && host->sdio_irqs) {
655 ++ if (err)
656 ++ goto out;
657 ++
658 ++ /* Allow SDIO IRQs to be processed again. */
659 ++ mmc_card_clr_suspended(host->card);
660 ++
661 ++ if (host->sdio_irqs) {
662 + if (!(host->caps2 & MMC_CAP2_SDIO_IRQ_NOTHREAD))
663 + wake_up_process(host->sdio_irq_thread);
664 + else if (host->caps & MMC_CAP_SDIO_IRQ)
665 + host->ops->enable_sdio_irq(host, 1);
666 + }
667 +
668 ++out:
669 + mmc_release_host(host);
670 +
671 + host->pm_flags &= ~MMC_PM_KEEP_POWER;
672 +diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
673 +index c771843e4c15..2fdd84c67f19 100644
674 +--- a/drivers/mmc/core/sdio_irq.c
675 ++++ b/drivers/mmc/core/sdio_irq.c
676 +@@ -38,6 +38,10 @@ static int process_sdio_pending_irqs(struct mmc_host *host)
677 + unsigned char pending;
678 + struct sdio_func *func;
679 +
680 ++ /* Don't process SDIO IRQs if the card is suspended. */
681 ++ if (mmc_card_suspended(card))
682 ++ return 0;
683 ++
684 + /*
685 + * Optimization, if there is only 1 function interrupt registered
686 + * and we know an IRQ was signaled then call irq handler directly.
687 +diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
688 +index 9ef501fd153f..7280f3a8aa04 100644
689 +--- a/drivers/net/can/flexcan.c
690 ++++ b/drivers/net/can/flexcan.c
691 +@@ -177,7 +177,7 @@
692 + #define FLEXCAN_MB_CNT_LENGTH(x) (((x) & 0xf) << 16)
693 + #define FLEXCAN_MB_CNT_TIMESTAMP(x) ((x) & 0xffff)
694 +
695 +-#define FLEXCAN_TIMEOUT_US (50)
696 ++#define FLEXCAN_TIMEOUT_US (250)
697 +
698 + /* FLEXCAN hardware feature flags
699 + *
700 +diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
701 +index 172b13012e10..086603de1859 100644
702 +--- a/drivers/net/dsa/mv88e6xxx/chip.c
703 ++++ b/drivers/net/dsa/mv88e6xxx/chip.c
704 +@@ -1075,7 +1075,7 @@ static int mv88e6xxx_vtu_get(struct mv88e6xxx_chip *chip, u16 vid,
705 + int err;
706 +
707 + if (!vid)
708 +- return -EINVAL;
709 ++ return -EOPNOTSUPP;
710 +
711 + entry->vid = vid - 1;
712 + entry->valid = false;
713 +diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
714 +index 14df03f60e05..523d52fbaafe 100644
715 +--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
716 ++++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
717 +@@ -338,6 +338,7 @@ static int __lb_setup(struct net_device *ndev,
718 + static int __lb_up(struct net_device *ndev,
719 + enum hnae_loop loop_mode)
720 + {
721 ++#define NIC_LB_TEST_WAIT_PHY_LINK_TIME 300
722 + struct hns_nic_priv *priv = netdev_priv(ndev);
723 + struct hnae_handle *h = priv->ae_handle;
724 + int speed, duplex;
725 +@@ -364,6 +365,9 @@ static int __lb_up(struct net_device *ndev,
726 +
727 + h->dev->ops->adjust_link(h, speed, duplex);
728 +
729 ++ /* wait adjust link done and phy ready */
730 ++ msleep(NIC_LB_TEST_WAIT_PHY_LINK_TIME);
731 ++
732 + return 0;
733 + }
734 +
735 +diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
736 +index 3fd71cf5cd60..9ba699cbdbc5 100644
737 +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
738 ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
739 +@@ -1788,6 +1788,7 @@ static void mtk_poll_controller(struct net_device *dev)
740 +
741 + static int mtk_start_dma(struct mtk_eth *eth)
742 + {
743 ++ u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0;
744 + int err;
745 +
746 + err = mtk_dma_init(eth);
747 +@@ -1804,7 +1805,7 @@ static int mtk_start_dma(struct mtk_eth *eth)
748 + MTK_QDMA_GLO_CFG);
749 +
750 + mtk_w32(eth,
751 +- MTK_RX_DMA_EN | MTK_RX_2B_OFFSET |
752 ++ MTK_RX_DMA_EN | rx_2b_offset |
753 + MTK_RX_BT_32DWORDS | MTK_MULTI_EN,
754 + MTK_PDMA_GLO_CFG);
755 +
756 +@@ -2304,13 +2305,13 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
757 +
758 + switch (cmd->cmd) {
759 + case ETHTOOL_GRXRINGS:
760 +- if (dev->features & NETIF_F_LRO) {
761 ++ if (dev->hw_features & NETIF_F_LRO) {
762 + cmd->data = MTK_MAX_RX_RING_NUM;
763 + ret = 0;
764 + }
765 + break;
766 + case ETHTOOL_GRXCLSRLCNT:
767 +- if (dev->features & NETIF_F_LRO) {
768 ++ if (dev->hw_features & NETIF_F_LRO) {
769 + struct mtk_mac *mac = netdev_priv(dev);
770 +
771 + cmd->rule_cnt = mac->hwlro_ip_cnt;
772 +@@ -2318,11 +2319,11 @@ static int mtk_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
773 + }
774 + break;
775 + case ETHTOOL_GRXCLSRULE:
776 +- if (dev->features & NETIF_F_LRO)
777 ++ if (dev->hw_features & NETIF_F_LRO)
778 + ret = mtk_hwlro_get_fdir_entry(dev, cmd);
779 + break;
780 + case ETHTOOL_GRXCLSRLALL:
781 +- if (dev->features & NETIF_F_LRO)
782 ++ if (dev->hw_features & NETIF_F_LRO)
783 + ret = mtk_hwlro_get_fdir_all(dev, cmd,
784 + rule_locs);
785 + break;
786 +@@ -2339,11 +2340,11 @@ static int mtk_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd)
787 +
788 + switch (cmd->cmd) {
789 + case ETHTOOL_SRXCLSRLINS:
790 +- if (dev->features & NETIF_F_LRO)
791 ++ if (dev->hw_features & NETIF_F_LRO)
792 + ret = mtk_hwlro_add_ipaddr(dev, cmd);
793 + break;
794 + case ETHTOOL_SRXCLSRLDEL:
795 +- if (dev->features & NETIF_F_LRO)
796 ++ if (dev->hw_features & NETIF_F_LRO)
797 + ret = mtk_hwlro_del_ipaddr(dev, cmd);
798 + break;
799 + default:
800 +diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c
801 +index d629dddb0e89..09f6795cce53 100644
802 +--- a/drivers/net/ipvlan/ipvlan_main.c
803 ++++ b/drivers/net/ipvlan/ipvlan_main.c
804 +@@ -188,7 +188,7 @@ static void ipvlan_port_destroy(struct net_device *dev)
805 + }
806 +
807 + #define IPVLAN_FEATURES \
808 +- (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
809 ++ (NETIF_F_SG | NETIF_F_CSUM_MASK | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \
810 + NETIF_F_GSO | NETIF_F_TSO | NETIF_F_GSO_ROBUST | \
811 + NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO | NETIF_F_RXCSUM | \
812 + NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER)
813 +diff --git a/drivers/net/phy/bcm-phy-lib.c b/drivers/net/phy/bcm-phy-lib.c
814 +index 8d96c6f048d0..d5e0833d69b9 100644
815 +--- a/drivers/net/phy/bcm-phy-lib.c
816 ++++ b/drivers/net/phy/bcm-phy-lib.c
817 +@@ -341,8 +341,8 @@ void bcm_phy_get_strings(struct phy_device *phydev, u8 *data)
818 + unsigned int i;
819 +
820 + for (i = 0; i < ARRAY_SIZE(bcm_phy_hw_stats); i++)
821 +- memcpy(data + i * ETH_GSTRING_LEN,
822 +- bcm_phy_hw_stats[i].string, ETH_GSTRING_LEN);
823 ++ strlcpy(data + i * ETH_GSTRING_LEN,
824 ++ bcm_phy_hw_stats[i].string, ETH_GSTRING_LEN);
825 + }
826 + EXPORT_SYMBOL_GPL(bcm_phy_get_strings);
827 +
828 +diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
829 +index d98ffb1ce629..768ac752a6e3 100644
830 +--- a/drivers/nvme/host/core.c
831 ++++ b/drivers/nvme/host/core.c
832 +@@ -2477,7 +2477,8 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl, unsigned nn)
833 + {
834 + struct nvme_ns *ns;
835 + __le32 *ns_list;
836 +- unsigned i, j, nsid, prev = 0, num_lists = DIV_ROUND_UP(nn, 1024);
837 ++ unsigned i, j, nsid, prev = 0;
838 ++ unsigned num_lists = DIV_ROUND_UP_ULL((u64)nn, 1024);
839 + int ret = 0;
840 +
841 + ns_list = kzalloc(0x1000, GFP_KERNEL);
842 +diff --git a/drivers/parport/share.c b/drivers/parport/share.c
843 +index 5dc53d420ca8..7b4ee33c1935 100644
844 +--- a/drivers/parport/share.c
845 ++++ b/drivers/parport/share.c
846 +@@ -895,6 +895,7 @@ parport_register_dev_model(struct parport *port, const char *name,
847 + par_dev->devmodel = true;
848 + ret = device_register(&par_dev->dev);
849 + if (ret) {
850 ++ kfree(par_dev->state);
851 + put_device(&par_dev->dev);
852 + goto err_put_port;
853 + }
854 +@@ -912,6 +913,7 @@ parport_register_dev_model(struct parport *port, const char *name,
855 + spin_unlock(&port->physport->pardevice_lock);
856 + pr_debug("%s: cannot grant exclusive access for device %s\n",
857 + port->name, name);
858 ++ kfree(par_dev->state);
859 + device_unregister(&par_dev->dev);
860 + goto err_put_port;
861 + }
862 +diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
863 +index 11ae67842edf..2845316db554 100644
864 +--- a/drivers/s390/net/qeth_l2_main.c
865 ++++ b/drivers/s390/net/qeth_l2_main.c
866 +@@ -1998,7 +1998,7 @@ static void qeth_bridgeport_an_set_cb(void *priv,
867 +
868 + l2entry = (struct qdio_brinfo_entry_l2 *)entry;
869 + code = IPA_ADDR_CHANGE_CODE_MACADDR;
870 +- if (l2entry->addr_lnid.lnid)
871 ++ if (l2entry->addr_lnid.lnid < VLAN_N_VID)
872 + code |= IPA_ADDR_CHANGE_CODE_VLANID;
873 + qeth_bridge_emit_host_event(card, anev_reg_unreg, code,
874 + (struct net_if_token *)&l2entry->nit,
875 +diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
876 +index d34351c6b9af..4055753b495a 100644
877 +--- a/drivers/scsi/smartpqi/smartpqi_init.c
878 ++++ b/drivers/scsi/smartpqi/smartpqi_init.c
879 +@@ -3686,8 +3686,10 @@ static int pqi_submit_raid_request_synchronous(struct pqi_ctrl_info *ctrl_info,
880 + return -ETIMEDOUT;
881 + msecs_blocked =
882 + jiffies_to_msecs(jiffies - start_jiffies);
883 +- if (msecs_blocked >= timeout_msecs)
884 +- return -ETIMEDOUT;
885 ++ if (msecs_blocked >= timeout_msecs) {
886 ++ rc = -ETIMEDOUT;
887 ++ goto out;
888 ++ }
889 + timeout_msecs -= msecs_blocked;
890 + }
891 + }
892 +diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c
893 +index e82bde077296..8992354d4e2c 100644
894 +--- a/drivers/scsi/ufs/ufshcd-pltfrm.c
895 ++++ b/drivers/scsi/ufs/ufshcd-pltfrm.c
896 +@@ -340,24 +340,21 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
897 + goto dealloc_host;
898 + }
899 +
900 +- pm_runtime_set_active(&pdev->dev);
901 +- pm_runtime_enable(&pdev->dev);
902 +-
903 + ufshcd_init_lanes_per_dir(hba);
904 +
905 + err = ufshcd_init(hba, mmio_base, irq);
906 + if (err) {
907 + dev_err(dev, "Initialization failed\n");
908 +- goto out_disable_rpm;
909 ++ goto dealloc_host;
910 + }
911 +
912 + platform_set_drvdata(pdev, hba);
913 +
914 ++ pm_runtime_set_active(&pdev->dev);
915 ++ pm_runtime_enable(&pdev->dev);
916 ++
917 + return 0;
918 +
919 +-out_disable_rpm:
920 +- pm_runtime_disable(&pdev->dev);
921 +- pm_runtime_set_suspended(&pdev->dev);
922 + dealloc_host:
923 + ufshcd_dealloc_host(hba);
924 + out:
925 +diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
926 +index d8f0a1ccd9b1..60c9184bad3b 100644
927 +--- a/drivers/scsi/ufs/ufshcd.c
928 ++++ b/drivers/scsi/ufs/ufshcd.c
929 +@@ -1788,7 +1788,8 @@ int ufshcd_copy_query_response(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
930 + memcpy(&query_res->upiu_res, &lrbp->ucd_rsp_ptr->qr, QUERY_OSF_SIZE);
931 +
932 + /* Get the descriptor */
933 +- if (lrbp->ucd_rsp_ptr->qr.opcode == UPIU_QUERY_OPCODE_READ_DESC) {
934 ++ if (hba->dev_cmd.query.descriptor &&
935 ++ lrbp->ucd_rsp_ptr->qr.opcode == UPIU_QUERY_OPCODE_READ_DESC) {
936 + u8 *descp = (u8 *)lrbp->ucd_rsp_ptr +
937 + GENERAL_UPIU_REQUEST_SIZE;
938 + u16 resp_len;
939 +diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
940 +index fe8a90543ea3..340f97404034 100644
941 +--- a/drivers/usb/chipidea/udc.c
942 ++++ b/drivers/usb/chipidea/udc.c
943 +@@ -1620,6 +1620,25 @@ static int ci_udc_pullup(struct usb_gadget *_gadget, int is_on)
944 + static int ci_udc_start(struct usb_gadget *gadget,
945 + struct usb_gadget_driver *driver);
946 + static int ci_udc_stop(struct usb_gadget *gadget);
947 ++
948 ++/* Match ISOC IN from the highest endpoint */
949 ++static struct usb_ep *ci_udc_match_ep(struct usb_gadget *gadget,
950 ++ struct usb_endpoint_descriptor *desc,
951 ++ struct usb_ss_ep_comp_descriptor *comp_desc)
952 ++{
953 ++ struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
954 ++ struct usb_ep *ep;
955 ++
956 ++ if (usb_endpoint_xfer_isoc(desc) && usb_endpoint_dir_in(desc)) {
957 ++ list_for_each_entry_reverse(ep, &ci->gadget.ep_list, ep_list) {
958 ++ if (ep->caps.dir_in && !ep->claimed)
959 ++ return ep;
960 ++ }
961 ++ }
962 ++
963 ++ return NULL;
964 ++}
965 ++
966 + /**
967 + * Device operations part of the API to the USB controller hardware,
968 + * which don't involve endpoints (or i/o)
969 +@@ -1633,6 +1652,7 @@ static const struct usb_gadget_ops usb_gadget_ops = {
970 + .vbus_draw = ci_udc_vbus_draw,
971 + .udc_start = ci_udc_start,
972 + .udc_stop = ci_udc_stop,
973 ++ .match_ep = ci_udc_match_ep,
974 + };
975 +
976 + static int init_eps(struct ci_hdrc *ci)
977 +diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c
978 +index ab852b8e3e37..3a4e15b39cc1 100644
979 +--- a/fs/btrfs/reada.c
980 ++++ b/fs/btrfs/reada.c
981 +@@ -759,6 +759,7 @@ static void __reada_start_machine(struct btrfs_fs_info *fs_info)
982 + u64 total = 0;
983 + int i;
984 +
985 ++again:
986 + do {
987 + enqueued = 0;
988 + mutex_lock(&fs_devices->device_list_mutex);
989 +@@ -770,6 +771,10 @@ static void __reada_start_machine(struct btrfs_fs_info *fs_info)
990 + mutex_unlock(&fs_devices->device_list_mutex);
991 + total += enqueued;
992 + } while (enqueued && total < 10000);
993 ++ if (fs_devices->seed) {
994 ++ fs_devices = fs_devices->seed;
995 ++ goto again;
996 ++ }
997 +
998 + if (enqueued == 0)
999 + return;
1000 +diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
1001 +index 92c9cdf4704d..49911bdc17ec 100644
1002 +--- a/fs/cifs/smb2maperror.c
1003 ++++ b/fs/cifs/smb2maperror.c
1004 +@@ -456,7 +456,7 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
1005 + {STATUS_FILE_INVALID, -EIO, "STATUS_FILE_INVALID"},
1006 + {STATUS_ALLOTTED_SPACE_EXCEEDED, -EIO,
1007 + "STATUS_ALLOTTED_SPACE_EXCEEDED"},
1008 +- {STATUS_INSUFFICIENT_RESOURCES, -EREMOTEIO,
1009 ++ {STATUS_INSUFFICIENT_RESOURCES, -EAGAIN,
1010 + "STATUS_INSUFFICIENT_RESOURCES"},
1011 + {STATUS_DFS_EXIT_PATH_FOUND, -EIO, "STATUS_DFS_EXIT_PATH_FOUND"},
1012 + {STATUS_DEVICE_DATA_ERROR, -EIO, "STATUS_DEVICE_DATA_ERROR"},
1013 +diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
1014 +index b619a190ff12..6cd4d5b48239 100644
1015 +--- a/include/net/bluetooth/hci_core.h
1016 ++++ b/include/net/bluetooth/hci_core.h
1017 +@@ -178,6 +178,9 @@ struct adv_info {
1018 +
1019 + #define HCI_MAX_SHORT_NAME_LENGTH 10
1020 +
1021 ++/* Min encryption key size to match with SMP */
1022 ++#define HCI_MIN_ENC_KEY_SIZE 7
1023 ++
1024 + /* Default LE RPA expiry time, 15 minutes */
1025 + #define HCI_DEFAULT_RPA_TIMEOUT (15 * 60)
1026 +
1027 +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
1028 +index ace0e8f6f2b4..76267d82f157 100644
1029 +--- a/kernel/trace/trace.c
1030 ++++ b/kernel/trace/trace.c
1031 +@@ -8249,12 +8249,8 @@ void ftrace_dump(enum ftrace_dump_mode oops_dump_mode)
1032 +
1033 + cnt++;
1034 +
1035 +- /* reset all but tr, trace, and overruns */
1036 +- memset(&iter.seq, 0,
1037 +- sizeof(struct trace_iterator) -
1038 +- offsetof(struct trace_iterator, seq));
1039 ++ trace_iterator_reset(&iter);
1040 + iter.iter_flags |= TRACE_FILE_LAT_FMT;
1041 +- iter.pos = -1;
1042 +
1043 + if (trace_find_next_entry_inc(&iter) != NULL) {
1044 + int ret;
1045 +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
1046 +index a51e32de7c5f..dbb212c40a41 100644
1047 +--- a/kernel/trace/trace.h
1048 ++++ b/kernel/trace/trace.h
1049 +@@ -1871,4 +1871,22 @@ static inline int tracing_alloc_snapshot_instance(struct trace_array *tr)
1050 +
1051 + extern struct trace_iterator *tracepoint_print_iter;
1052 +
1053 ++/*
1054 ++ * Reset the state of the trace_iterator so that it can read consumed data.
1055 ++ * Normally, the trace_iterator is used for reading the data when it is not
1056 ++ * consumed, and must retain state.
1057 ++ */
1058 ++static __always_inline void trace_iterator_reset(struct trace_iterator *iter)
1059 ++{
1060 ++ const size_t offset = offsetof(struct trace_iterator, seq);
1061 ++
1062 ++ /*
1063 ++ * Keep gcc from complaining about overwriting more than just one
1064 ++ * member in the structure.
1065 ++ */
1066 ++ memset((char *)iter + offset, 0, sizeof(struct trace_iterator) - offset);
1067 ++
1068 ++ iter->pos = -1;
1069 ++}
1070 ++
1071 + #endif /* _LINUX_KERNEL_TRACE_H */
1072 +diff --git a/kernel/trace/trace_kdb.c b/kernel/trace/trace_kdb.c
1073 +index 810d78a8d14c..2905a3dd94c1 100644
1074 +--- a/kernel/trace/trace_kdb.c
1075 ++++ b/kernel/trace/trace_kdb.c
1076 +@@ -41,12 +41,8 @@ static void ftrace_dump_buf(int skip_lines, long cpu_file)
1077 +
1078 + kdb_printf("Dumping ftrace buffer:\n");
1079 +
1080 +- /* reset all but tr, trace, and overruns */
1081 +- memset(&iter.seq, 0,
1082 +- sizeof(struct trace_iterator) -
1083 +- offsetof(struct trace_iterator, seq));
1084 ++ trace_iterator_reset(&iter);
1085 + iter.iter_flags |= TRACE_FILE_LAT_FMT;
1086 +- iter.pos = -1;
1087 +
1088 + if (cpu_file == RING_BUFFER_ALL_CPUS) {
1089 + for_each_tracing_cpu(cpu) {
1090 +diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
1091 +index cc061495f653..bd41b78d131d 100644
1092 +--- a/net/bluetooth/hci_conn.c
1093 ++++ b/net/bluetooth/hci_conn.c
1094 +@@ -1281,8 +1281,16 @@ auth:
1095 + return 0;
1096 +
1097 + encrypt:
1098 +- if (test_bit(HCI_CONN_ENCRYPT, &conn->flags))
1099 ++ if (test_bit(HCI_CONN_ENCRYPT, &conn->flags)) {
1100 ++ /* Ensure that the encryption key size has been read,
1101 ++ * otherwise stall the upper layer responses.
1102 ++ */
1103 ++ if (!conn->enc_key_size)
1104 ++ return 0;
1105 ++
1106 ++ /* Nothing else needed, all requirements are met */
1107 + return 1;
1108 ++ }
1109 +
1110 + hci_conn_encrypt(conn);
1111 + return 0;
1112 +diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
1113 +index b510da76170e..e9698592cf98 100644
1114 +--- a/net/bluetooth/l2cap_core.c
1115 ++++ b/net/bluetooth/l2cap_core.c
1116 +@@ -1340,6 +1340,21 @@ static void l2cap_request_info(struct l2cap_conn *conn)
1117 + sizeof(req), &req);
1118 + }
1119 +
1120 ++static bool l2cap_check_enc_key_size(struct hci_conn *hcon)
1121 ++{
1122 ++ /* The minimum encryption key size needs to be enforced by the
1123 ++ * host stack before establishing any L2CAP connections. The
1124 ++ * specification in theory allows a minimum of 1, but to align
1125 ++ * BR/EDR and LE transports, a minimum of 7 is chosen.
1126 ++ *
1127 ++ * This check might also be called for unencrypted connections
1128 ++ * that have no key size requirements. Ensure that the link is
1129 ++ * actually encrypted before enforcing a key size.
1130 ++ */
1131 ++ return (!test_bit(HCI_CONN_ENCRYPT, &hcon->flags) ||
1132 ++ hcon->enc_key_size > HCI_MIN_ENC_KEY_SIZE);
1133 ++}
1134 ++
1135 + static void l2cap_do_start(struct l2cap_chan *chan)
1136 + {
1137 + struct l2cap_conn *conn = chan->conn;
1138 +@@ -1357,9 +1372,14 @@ static void l2cap_do_start(struct l2cap_chan *chan)
1139 + if (!(conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_DONE))
1140 + return;
1141 +
1142 +- if (l2cap_chan_check_security(chan, true) &&
1143 +- __l2cap_no_conn_pending(chan))
1144 ++ if (!l2cap_chan_check_security(chan, true) ||
1145 ++ !__l2cap_no_conn_pending(chan))
1146 ++ return;
1147 ++
1148 ++ if (l2cap_check_enc_key_size(conn->hcon))
1149 + l2cap_start_connection(chan);
1150 ++ else
1151 ++ __set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
1152 + }
1153 +
1154 + static inline int l2cap_mode_supported(__u8 mode, __u32 feat_mask)
1155 +@@ -1438,7 +1458,10 @@ static void l2cap_conn_start(struct l2cap_conn *conn)
1156 + continue;
1157 + }
1158 +
1159 +- l2cap_start_connection(chan);
1160 ++ if (l2cap_check_enc_key_size(conn->hcon))
1161 ++ l2cap_start_connection(chan);
1162 ++ else
1163 ++ l2cap_chan_close(chan, ECONNREFUSED);
1164 +
1165 + } else if (chan->state == BT_CONNECT2) {
1166 + struct l2cap_conn_rsp rsp;
1167 +@@ -7455,7 +7478,7 @@ static void l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
1168 + }
1169 +
1170 + if (chan->state == BT_CONNECT) {
1171 +- if (!status)
1172 ++ if (!status && l2cap_check_enc_key_size(hcon))
1173 + l2cap_start_connection(chan);
1174 + else
1175 + __set_chan_timer(chan, L2CAP_DISC_TIMEOUT);
1176 +@@ -7464,7 +7487,7 @@ static void l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
1177 + struct l2cap_conn_rsp rsp;
1178 + __u16 res, stat;
1179 +
1180 +- if (!status) {
1181 ++ if (!status && l2cap_check_enc_key_size(hcon)) {
1182 + if (test_bit(FLAG_DEFER_SETUP, &chan->flags)) {
1183 + res = L2CAP_CR_PEND;
1184 + stat = L2CAP_CS_AUTHOR_PEND;
1185 +diff --git a/net/can/af_can.c b/net/can/af_can.c
1186 +index e3626e8500c2..9de9678fa7d0 100644
1187 +--- a/net/can/af_can.c
1188 ++++ b/net/can/af_can.c
1189 +@@ -105,6 +105,7 @@ EXPORT_SYMBOL(can_ioctl);
1190 + static void can_sock_destruct(struct sock *sk)
1191 + {
1192 + skb_queue_purge(&sk->sk_receive_queue);
1193 ++ skb_queue_purge(&sk->sk_error_queue);
1194 + }
1195 +
1196 + static const struct can_proto *can_get_proto(int protocol)
1197 +diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
1198 +index 894937bcd479..a133acb43eb1 100644
1199 +--- a/net/mac80211/ieee80211_i.h
1200 ++++ b/net/mac80211/ieee80211_i.h
1201 +@@ -2150,6 +2150,9 @@ void ieee80211_tdls_cancel_channel_switch(struct wiphy *wiphy,
1202 + const u8 *addr);
1203 + void ieee80211_teardown_tdls_peers(struct ieee80211_sub_if_data *sdata);
1204 + void ieee80211_tdls_chsw_work(struct work_struct *wk);
1205 ++void ieee80211_tdls_handle_disconnect(struct ieee80211_sub_if_data *sdata,
1206 ++ const u8 *peer, u16 reason);
1207 ++const char *ieee80211_get_reason_code_string(u16 reason_code);
1208 +
1209 + extern const struct ethtool_ops ieee80211_ethtool_ops;
1210 +
1211 +diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
1212 +index 33bd6da00a1c..960a57f7c983 100644
1213 +--- a/net/mac80211/mlme.c
1214 ++++ b/net/mac80211/mlme.c
1215 +@@ -2744,7 +2744,7 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
1216 + #define case_WLAN(type) \
1217 + case WLAN_REASON_##type: return #type
1218 +
1219 +-static const char *ieee80211_get_reason_code_string(u16 reason_code)
1220 ++const char *ieee80211_get_reason_code_string(u16 reason_code)
1221 + {
1222 + switch (reason_code) {
1223 + case_WLAN(UNSPECIFIED);
1224 +@@ -2809,6 +2809,11 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
1225 + if (len < 24 + 2)
1226 + return;
1227 +
1228 ++ if (!ether_addr_equal(mgmt->bssid, mgmt->sa)) {
1229 ++ ieee80211_tdls_handle_disconnect(sdata, mgmt->sa, reason_code);
1230 ++ return;
1231 ++ }
1232 ++
1233 + if (ifmgd->associated &&
1234 + ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid)) {
1235 + const u8 *bssid = ifmgd->associated->bssid;
1236 +@@ -2858,6 +2863,11 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
1237 +
1238 + reason_code = le16_to_cpu(mgmt->u.disassoc.reason_code);
1239 +
1240 ++ if (!ether_addr_equal(mgmt->bssid, mgmt->sa)) {
1241 ++ ieee80211_tdls_handle_disconnect(sdata, mgmt->sa, reason_code);
1242 ++ return;
1243 ++ }
1244 ++
1245 + sdata_info(sdata, "disassociated from %pM (Reason: %u=%s)\n",
1246 + mgmt->sa, reason_code,
1247 + ieee80211_get_reason_code_string(reason_code));
1248 +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
1249 +index 1512e547a5e0..4a6b3c7b35e3 100644
1250 +--- a/net/mac80211/rx.c
1251 ++++ b/net/mac80211/rx.c
1252 +@@ -3589,6 +3589,8 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
1253 + case NL80211_IFTYPE_STATION:
1254 + if (!bssid && !sdata->u.mgd.use_4addr)
1255 + return false;
1256 ++ if (ieee80211_is_robust_mgmt_frame(skb) && !rx->sta)
1257 ++ return false;
1258 + if (multicast)
1259 + return true;
1260 + return ether_addr_equal(sdata->vif.addr, hdr->addr1);
1261 +diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
1262 +index 6e7aa65cf345..7a32b6820397 100644
1263 +--- a/net/mac80211/tdls.c
1264 ++++ b/net/mac80211/tdls.c
1265 +@@ -1988,3 +1988,26 @@ void ieee80211_tdls_chsw_work(struct work_struct *wk)
1266 + }
1267 + rtnl_unlock();
1268 + }
1269 ++
1270 ++void ieee80211_tdls_handle_disconnect(struct ieee80211_sub_if_data *sdata,
1271 ++ const u8 *peer, u16 reason)
1272 ++{
1273 ++ struct ieee80211_sta *sta;
1274 ++
1275 ++ rcu_read_lock();
1276 ++ sta = ieee80211_find_sta(&sdata->vif, peer);
1277 ++ if (!sta || !sta->tdls) {
1278 ++ rcu_read_unlock();
1279 ++ return;
1280 ++ }
1281 ++ rcu_read_unlock();
1282 ++
1283 ++ tdls_dbg(sdata, "disconnected from TDLS peer %pM (Reason: %u=%s)\n",
1284 ++ peer, reason,
1285 ++ ieee80211_get_reason_code_string(reason));
1286 ++
1287 ++ ieee80211_tdls_oper_request(&sdata->vif, peer,
1288 ++ NL80211_TDLS_TEARDOWN,
1289 ++ WLAN_REASON_TDLS_TEARDOWN_UNREACHABLE,
1290 ++ GFP_ATOMIC);
1291 ++}
1292 +diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
1293 +index 0d722ea98a1b..e3bb69ba6887 100644
1294 +--- a/net/mac80211/wpa.c
1295 ++++ b/net/mac80211/wpa.c
1296 +@@ -1169,7 +1169,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx)
1297 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
1298 + struct ieee80211_key *key = rx->key;
1299 + struct ieee80211_mmie_16 *mmie;
1300 +- u8 aad[GMAC_AAD_LEN], mic[GMAC_MIC_LEN], ipn[6], nonce[GMAC_NONCE_LEN];
1301 ++ u8 aad[GMAC_AAD_LEN], *mic, ipn[6], nonce[GMAC_NONCE_LEN];
1302 + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
1303 +
1304 + if (!ieee80211_is_mgmt(hdr->frame_control))
1305 +@@ -1200,13 +1200,18 @@ ieee80211_crypto_aes_gmac_decrypt(struct ieee80211_rx_data *rx)
1306 + memcpy(nonce, hdr->addr2, ETH_ALEN);
1307 + memcpy(nonce + ETH_ALEN, ipn, 6);
1308 +
1309 ++ mic = kmalloc(GMAC_MIC_LEN, GFP_ATOMIC);
1310 ++ if (!mic)
1311 ++ return RX_DROP_UNUSABLE;
1312 + if (ieee80211_aes_gmac(key->u.aes_gmac.tfm, aad, nonce,
1313 + skb->data + 24, skb->len - 24,
1314 + mic) < 0 ||
1315 + crypto_memneq(mic, mmie->mic, sizeof(mmie->mic))) {
1316 + key->u.aes_gmac.icverrors++;
1317 ++ kfree(mic);
1318 + return RX_DROP_UNUSABLE;
1319 + }
1320 ++ kfree(mic);
1321 + }
1322 +
1323 + memcpy(key->u.aes_gmac.rx_pn, ipn, 6);
1324 +diff --git a/net/wireless/core.c b/net/wireless/core.c
1325 +index 45cbade9ad68..0e08629b15d1 100644
1326 +--- a/net/wireless/core.c
1327 ++++ b/net/wireless/core.c
1328 +@@ -498,7 +498,7 @@ use_default_name:
1329 + &rdev->rfkill_ops, rdev);
1330 +
1331 + if (!rdev->rfkill) {
1332 +- kfree(rdev);
1333 ++ wiphy_free(&rdev->wiphy);
1334 + return NULL;
1335 + }
1336 +
1337 +diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl
1338 +index 16dc157f9662..a3f895c216b6 100755
1339 +--- a/scripts/checkstack.pl
1340 ++++ b/scripts/checkstack.pl
1341 +@@ -45,7 +45,7 @@ my (@stack, $re, $dre, $x, $xs, $funcre);
1342 + $x = "[0-9a-f]"; # hex character
1343 + $xs = "[0-9a-f ]"; # hex character or space
1344 + $funcre = qr/^$x* <(.*)>:$/;
1345 +- if ($arch eq 'aarch64') {
1346 ++ if ($arch =~ '^(aarch|arm)64$') {
1347 + #ffffffc0006325cc: a9bb7bfd stp x29, x30, [sp, #-80]!
1348 + $re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o;
1349 + } elsif ($arch eq 'arm') {
1350 +diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
1351 +index 4ede87c30f8b..2cef8d4404cc 100644
1352 +--- a/security/apparmor/policy_unpack.c
1353 ++++ b/security/apparmor/policy_unpack.c
1354 +@@ -259,7 +259,7 @@ static bool unpack_nameX(struct aa_ext *e, enum aa_code code, const char *name)
1355 + char *tag = NULL;
1356 + size_t size = unpack_u16_chunk(e, &tag);
1357 + /* if a name is specified it must match. otherwise skip tag */
1358 +- if (name && (!size || strcmp(name, tag)))
1359 ++ if (name && (!size || tag[size-1] != '\0' || strcmp(name, tag)))
1360 + goto fail;
1361 + } else if (name) {
1362 + /* if a name is specified and there is no name tag fail */
1363 +diff --git a/tools/objtool/check.c b/tools/objtool/check.c
1364 +index 95326c6a7a24..7d748e272572 100644
1365 +--- a/tools/objtool/check.c
1366 ++++ b/tools/objtool/check.c
1367 +@@ -814,7 +814,7 @@ static int add_switch_table(struct objtool_file *file, struct instruction *insn,
1368 + struct symbol *pfunc = insn->func->pfunc;
1369 + unsigned int prev_offset = 0;
1370 +
1371 +- list_for_each_entry_from(rela, &file->rodata->rela->rela_list, list) {
1372 ++ list_for_each_entry_from(rela, &table->rela_sec->rela_list, list) {
1373 + if (rela == next_table)
1374 + break;
1375 +
1376 +@@ -904,6 +904,7 @@ static struct rela *find_switch_table(struct objtool_file *file,
1377 + {
1378 + struct rela *text_rela, *rodata_rela;
1379 + struct instruction *orig_insn = insn;
1380 ++ struct section *rodata_sec;
1381 + unsigned long table_offset;
1382 +
1383 + /*
1384 +@@ -931,10 +932,13 @@ static struct rela *find_switch_table(struct objtool_file *file,
1385 + /* look for a relocation which references .rodata */
1386 + text_rela = find_rela_by_dest_range(insn->sec, insn->offset,
1387 + insn->len);
1388 +- if (!text_rela || text_rela->sym != file->rodata->sym)
1389 ++ if (!text_rela || text_rela->sym->type != STT_SECTION ||
1390 ++ !text_rela->sym->sec->rodata)
1391 + continue;
1392 +
1393 + table_offset = text_rela->addend;
1394 ++ rodata_sec = text_rela->sym->sec;
1395 ++
1396 + if (text_rela->type == R_X86_64_PC32)
1397 + table_offset += 4;
1398 +
1399 +@@ -942,10 +946,10 @@ static struct rela *find_switch_table(struct objtool_file *file,
1400 + * Make sure the .rodata address isn't associated with a
1401 + * symbol. gcc jump tables are anonymous data.
1402 + */
1403 +- if (find_symbol_containing(file->rodata, table_offset))
1404 ++ if (find_symbol_containing(rodata_sec, table_offset))
1405 + continue;
1406 +
1407 +- rodata_rela = find_rela_by_dest(file->rodata, table_offset);
1408 ++ rodata_rela = find_rela_by_dest(rodata_sec, table_offset);
1409 + if (rodata_rela) {
1410 + /*
1411 + * Use of RIP-relative switch jumps is quite rare, and
1412 +@@ -1030,7 +1034,7 @@ static int add_switch_table_alts(struct objtool_file *file)
1413 + struct symbol *func;
1414 + int ret;
1415 +
1416 +- if (!file->rodata || !file->rodata->rela)
1417 ++ if (!file->rodata)
1418 + return 0;
1419 +
1420 + for_each_sec(file, sec) {
1421 +@@ -1175,10 +1179,33 @@ static int read_retpoline_hints(struct objtool_file *file)
1422 + return 0;
1423 + }
1424 +
1425 ++static void mark_rodata(struct objtool_file *file)
1426 ++{
1427 ++ struct section *sec;
1428 ++ bool found = false;
1429 ++
1430 ++ /*
1431 ++ * This searches for the .rodata section or multiple .rodata.func_name
1432 ++ * sections if -fdata-sections is being used. The .str.1.1 and .str.1.8
1433 ++ * rodata sections are ignored as they don't contain jump tables.
1434 ++ */
1435 ++ for_each_sec(file, sec) {
1436 ++ if (!strncmp(sec->name, ".rodata", 7) &&
1437 ++ !strstr(sec->name, ".str1.")) {
1438 ++ sec->rodata = true;
1439 ++ found = true;
1440 ++ }
1441 ++ }
1442 ++
1443 ++ file->rodata = found;
1444 ++}
1445 ++
1446 + static int decode_sections(struct objtool_file *file)
1447 + {
1448 + int ret;
1449 +
1450 ++ mark_rodata(file);
1451 ++
1452 + ret = decode_instructions(file);
1453 + if (ret)
1454 + return ret;
1455 +@@ -2150,7 +2177,6 @@ int check(const char *_objname, bool orc)
1456 + INIT_LIST_HEAD(&file.insn_list);
1457 + hash_init(file.insn_hash);
1458 + file.whitelist = find_section_by_name(file.elf, ".discard.func_stack_frame_non_standard");
1459 +- file.rodata = find_section_by_name(file.elf, ".rodata");
1460 + file.c_file = find_section_by_name(file.elf, ".comment");
1461 + file.ignore_unreachables = no_unreachable;
1462 + file.hints = false;
1463 +diff --git a/tools/objtool/check.h b/tools/objtool/check.h
1464 +index c6b68fcb926f..a039521b6753 100644
1465 +--- a/tools/objtool/check.h
1466 ++++ b/tools/objtool/check.h
1467 +@@ -60,8 +60,8 @@ struct objtool_file {
1468 + struct elf *elf;
1469 + struct list_head insn_list;
1470 + DECLARE_HASHTABLE(insn_hash, 16);
1471 +- struct section *rodata, *whitelist;
1472 +- bool ignore_unreachables, c_file, hints;
1473 ++ struct section *whitelist;
1474 ++ bool ignore_unreachables, c_file, hints, rodata;
1475 + };
1476 +
1477 + int check(const char *objname, bool orc);
1478 +diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
1479 +index dd4ed7c3c062..e6cef5a160e7 100644
1480 +--- a/tools/objtool/elf.c
1481 ++++ b/tools/objtool/elf.c
1482 +@@ -390,6 +390,7 @@ static int read_relas(struct elf *elf)
1483 + rela->offset = rela->rela.r_offset;
1484 + symndx = GELF_R_SYM(rela->rela.r_info);
1485 + rela->sym = find_symbol_by_index(elf, symndx);
1486 ++ rela->rela_sec = sec;
1487 + if (!rela->sym) {
1488 + WARN("can't find rela entry symbol %d for %s",
1489 + symndx, sec->name);
1490 +diff --git a/tools/objtool/elf.h b/tools/objtool/elf.h
1491 +index de5cd2ddded9..bc97ed86b9cd 100644
1492 +--- a/tools/objtool/elf.h
1493 ++++ b/tools/objtool/elf.h
1494 +@@ -48,7 +48,7 @@ struct section {
1495 + char *name;
1496 + int idx;
1497 + unsigned int len;
1498 +- bool changed, text;
1499 ++ bool changed, text, rodata;
1500 + };
1501 +
1502 + struct symbol {
1503 +@@ -68,6 +68,7 @@ struct rela {
1504 + struct list_head list;
1505 + struct hlist_node hash;
1506 + GElf_Rela rela;
1507 ++ struct section *rela_sec;
1508 + struct symbol *sym;
1509 + unsigned int type;
1510 + unsigned long offset;