Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.19 commit in: /
Date: Thu, 15 Sep 2022 11:09:21
Message-Id: 1663240145.4c8a0a4020ed1952402fcaf2a05f18ebc2d6979a.mpagano@gentoo
1 commit: 4c8a0a4020ed1952402fcaf2a05f18ebc2d6979a
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 15 11:09:05 2022 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 15 11:09:05 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=4c8a0a40
7
8 Linux patch 4.19.258
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1257_linux-4.19.258.patch | 1908 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 1912 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index dff212f8..f372055b 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -1071,6 +1071,10 @@ Patch: 1256_linux-4.19.257.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.19.257
23
24 +Patch: 1257_linux-4.19.258.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.19.258
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/1257_linux-4.19.258.patch b/1257_linux-4.19.258.patch
33 new file mode 100644
34 index 00000000..65f5957f
35 --- /dev/null
36 +++ b/1257_linux-4.19.258.patch
37 @@ -0,0 +1,1908 @@
38 +diff --git a/Makefile b/Makefile
39 +index 18ccab9a01b06..e35356f7a1e66 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 19
46 +-SUBLEVEL = 257
47 ++SUBLEVEL = 258
48 + EXTRAVERSION =
49 + NAME = "People's Front"
50 +
51 +diff --git a/arch/arm64/kernel/cacheinfo.c b/arch/arm64/kernel/cacheinfo.c
52 +index d17414cbb89a8..473935695efb7 100644
53 +--- a/arch/arm64/kernel/cacheinfo.c
54 ++++ b/arch/arm64/kernel/cacheinfo.c
55 +@@ -47,7 +47,8 @@ static void ci_leaf_init(struct cacheinfo *this_leaf,
56 +
57 + int init_cache_level(unsigned int cpu)
58 + {
59 +- unsigned int ctype, level, leaves, fw_level;
60 ++ unsigned int ctype, level, leaves;
61 ++ int fw_level;
62 + struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
63 +
64 + for (level = 1, leaves = 0; level <= MAX_CACHE_LEVEL; level++) {
65 +@@ -65,6 +66,9 @@ int init_cache_level(unsigned int cpu)
66 + else
67 + fw_level = acpi_find_last_cache_level(cpu);
68 +
69 ++ if (fw_level < 0)
70 ++ return fw_level;
71 ++
72 + if (level < fw_level) {
73 + /*
74 + * some external caches not specified in CLIDR_EL1
75 +diff --git a/arch/mips/loongson32/ls1c/board.c b/arch/mips/loongson32/ls1c/board.c
76 +index eb2d913c694fd..2d9675a6782c3 100644
77 +--- a/arch/mips/loongson32/ls1c/board.c
78 ++++ b/arch/mips/loongson32/ls1c/board.c
79 +@@ -19,7 +19,6 @@ static struct platform_device *ls1c_platform_devices[] __initdata = {
80 + static int __init ls1c_platform_init(void)
81 + {
82 + ls1x_serial_set_uartclk(&ls1x_uart_pdev);
83 +- ls1x_rtc_set_extclk(&ls1x_rtc_pdev);
84 +
85 + return platform_add_devices(ls1c_platform_devices,
86 + ARRAY_SIZE(ls1c_platform_devices));
87 +diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
88 +index f56cbab64ac10..92bc2fa7e6929 100644
89 +--- a/arch/parisc/kernel/head.S
90 ++++ b/arch/parisc/kernel/head.S
91 +@@ -22,7 +22,7 @@
92 + #include <linux/linkage.h>
93 + #include <linux/init.h>
94 +
95 +- .level PA_ASM_LEVEL
96 ++ .level 1.1
97 +
98 + __INITDATA
99 + ENTRY(boot_args)
100 +@@ -69,6 +69,47 @@ $bss_loop:
101 + stw,ma %arg2,4(%r1)
102 + stw,ma %arg3,4(%r1)
103 +
104 ++#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20)
105 ++ /* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU
106 ++ * and halt kernel if we detect a PA1.x CPU. */
107 ++ ldi 32,%r10
108 ++ mtctl %r10,%cr11
109 ++ .level 2.0
110 ++ mfctl,w %cr11,%r10
111 ++ .level 1.1
112 ++ comib,<>,n 0,%r10,$cpu_ok
113 ++
114 ++ load32 PA(msg1),%arg0
115 ++ ldi msg1_end-msg1,%arg1
116 ++$iodc_panic:
117 ++ copy %arg0, %r10
118 ++ copy %arg1, %r11
119 ++ load32 PA(init_stack),%sp
120 ++#define MEM_CONS 0x3A0
121 ++ ldw MEM_CONS+32(%r0),%arg0 // HPA
122 ++ ldi ENTRY_IO_COUT,%arg1
123 ++ ldw MEM_CONS+36(%r0),%arg2 // SPA
124 ++ ldw MEM_CONS+8(%r0),%arg3 // layers
125 ++ load32 PA(__bss_start),%r1
126 ++ stw %r1,-52(%sp) // arg4
127 ++ stw %r0,-56(%sp) // arg5
128 ++ stw %r10,-60(%sp) // arg6 = ptr to text
129 ++ stw %r11,-64(%sp) // arg7 = len
130 ++ stw %r0,-68(%sp) // arg8
131 ++ load32 PA(.iodc_panic_ret), %rp
132 ++ ldw MEM_CONS+40(%r0),%r1 // ENTRY_IODC
133 ++ bv,n (%r1)
134 ++.iodc_panic_ret:
135 ++ b . /* wait endless with ... */
136 ++ or %r10,%r10,%r10 /* qemu idle sleep */
137 ++msg1: .ascii "Can't boot kernel which was built for PA8x00 CPUs on this machine.\r\n"
138 ++msg1_end:
139 ++
140 ++$cpu_ok:
141 ++#endif
142 ++
143 ++ .level PA_ASM_LEVEL
144 ++
145 + /* Initialize startup VM. Just map first 16/32 MB of memory */
146 + load32 PA(swapper_pg_dir),%r4
147 + mtctl %r4,%cr24 /* Initialize kernel root pointer */
148 +diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
149 +index 2d1afa58a4b6b..23e5751940841 100644
150 +--- a/arch/s390/include/asm/hugetlb.h
151 ++++ b/arch/s390/include/asm/hugetlb.h
152 +@@ -30,9 +30,11 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
153 + static inline int prepare_hugepage_range(struct file *file,
154 + unsigned long addr, unsigned long len)
155 + {
156 +- if (len & ~HPAGE_MASK)
157 ++ struct hstate *h = hstate_file(file);
158 ++
159 ++ if (len & ~huge_page_mask(h))
160 + return -EINVAL;
161 +- if (addr & ~HPAGE_MASK)
162 ++ if (addr & ~huge_page_mask(h))
163 + return -EINVAL;
164 + return 0;
165 + }
166 +diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
167 +index 18ede6e806b91..160a05c6ce881 100644
168 +--- a/arch/s390/kernel/vmlinux.lds.S
169 ++++ b/arch/s390/kernel/vmlinux.lds.S
170 +@@ -121,6 +121,7 @@ SECTIONS
171 + /*
172 + * Table with the patch locations to undo expolines
173 + */
174 ++ . = ALIGN(4);
175 + .nospec_call_table : {
176 + __nospec_call_start = . ;
177 + *(.s390_indirect*)
178 +diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
179 +index 747549934fe32..17a236a8b2370 100644
180 +--- a/arch/x86/include/asm/nospec-branch.h
181 ++++ b/arch/x86/include/asm/nospec-branch.h
182 +@@ -35,6 +35,7 @@
183 + * the optimal version — two calls, each with their own speculation
184 + * trap should their return address end up getting used, in a loop.
185 + */
186 ++#ifdef CONFIG_X86_64
187 + #define __FILL_RETURN_BUFFER(reg, nr, sp) \
188 + mov $(nr/2), reg; \
189 + 771: \
190 +@@ -55,6 +56,19 @@
191 + add $(BITS_PER_LONG/8) * nr, sp; \
192 + /* barrier for jnz misprediction */ \
193 + lfence;
194 ++#else
195 ++/*
196 ++ * i386 doesn't unconditionally have LFENCE, as such it can't
197 ++ * do a loop.
198 ++ */
199 ++#define __FILL_RETURN_BUFFER(reg, nr, sp) \
200 ++ .rept nr; \
201 ++ call 772f; \
202 ++ int3; \
203 ++772:; \
204 ++ .endr; \
205 ++ add $(BITS_PER_LONG/8) * nr, sp;
206 ++#endif
207 +
208 + /* Sequence to mitigate PBRSB on eIBRS CPUs */
209 + #define __ISSUE_UNBALANCED_RET_GUARD(sp) \
210 +diff --git a/drivers/android/binder.c b/drivers/android/binder.c
211 +index 35c13be4adc60..3e57d5682b693 100644
212 +--- a/drivers/android/binder.c
213 ++++ b/drivers/android/binder.c
214 +@@ -1809,6 +1809,18 @@ static int binder_inc_ref_for_node(struct binder_proc *proc,
215 + }
216 + ret = binder_inc_ref_olocked(ref, strong, target_list);
217 + *rdata = ref->data;
218 ++ if (ret && ref == new_ref) {
219 ++ /*
220 ++ * Cleanup the failed reference here as the target
221 ++ * could now be dead and have already released its
222 ++ * references by now. Calling on the new reference
223 ++ * with strong=0 and a tmp_refs will not decrement
224 ++ * the node. The new_ref gets kfree'd below.
225 ++ */
226 ++ binder_cleanup_ref_olocked(new_ref);
227 ++ ref = NULL;
228 ++ }
229 ++
230 + binder_proc_unlock(proc);
231 + if (new_ref && ref != new_ref)
232 + /*
233 +diff --git a/drivers/base/dd.c b/drivers/base/dd.c
234 +index 26ba7a99b7d5b..63390a416b445 100644
235 +--- a/drivers/base/dd.c
236 ++++ b/drivers/base/dd.c
237 +@@ -738,6 +738,11 @@ static int __device_attach_driver(struct device_driver *drv, void *_data)
238 + } else if (ret == -EPROBE_DEFER) {
239 + dev_dbg(dev, "Device match requests probe deferral\n");
240 + driver_deferred_probe_add(dev);
241 ++ /*
242 ++ * Device can't match with a driver right now, so don't attempt
243 ++ * to match or bind with other drivers on the bus.
244 ++ */
245 ++ return ret;
246 + } else if (ret < 0) {
247 + dev_dbg(dev, "Bus failed to match device: %d", ret);
248 + return ret;
249 +@@ -891,6 +896,11 @@ static int __driver_attach(struct device *dev, void *data)
250 + } else if (ret == -EPROBE_DEFER) {
251 + dev_dbg(dev, "Device match requests probe deferral\n");
252 + driver_deferred_probe_add(dev);
253 ++ /*
254 ++ * Driver could not match with device, but may match with
255 ++ * another device on the bus.
256 ++ */
257 ++ return 0;
258 + } else if (ret < 0) {
259 + dev_dbg(dev, "Bus failed to match device: %d", ret);
260 + return ret;
261 +diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
262 +index 32606d1094fe4..53ac3a0e741d7 100644
263 +--- a/drivers/clk/clk.c
264 ++++ b/drivers/clk/clk.c
265 +@@ -732,10 +732,9 @@ static void clk_core_unprepare(struct clk_core *core)
266 + if (core->ops->unprepare)
267 + core->ops->unprepare(core->hw);
268 +
269 +- clk_pm_runtime_put(core);
270 +-
271 + trace_clk_unprepare_complete(core);
272 + clk_core_unprepare(core->parent);
273 ++ clk_pm_runtime_put(core);
274 + }
275 +
276 + static void clk_core_unprepare_lock(struct clk_core *core)
277 +diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c
278 +index 96688986da56a..94aae1e67c996 100644
279 +--- a/drivers/firmware/efi/capsule-loader.c
280 ++++ b/drivers/firmware/efi/capsule-loader.c
281 +@@ -243,29 +243,6 @@ failed:
282 + return ret;
283 + }
284 +
285 +-/**
286 +- * efi_capsule_flush - called by file close or file flush
287 +- * @file: file pointer
288 +- * @id: not used
289 +- *
290 +- * If a capsule is being partially uploaded then calling this function
291 +- * will be treated as upload termination and will free those completed
292 +- * buffer pages and -ECANCELED will be returned.
293 +- **/
294 +-static int efi_capsule_flush(struct file *file, fl_owner_t id)
295 +-{
296 +- int ret = 0;
297 +- struct capsule_info *cap_info = file->private_data;
298 +-
299 +- if (cap_info->index > 0) {
300 +- pr_err("capsule upload not complete\n");
301 +- efi_free_all_buff_pages(cap_info);
302 +- ret = -ECANCELED;
303 +- }
304 +-
305 +- return ret;
306 +-}
307 +-
308 + /**
309 + * efi_capsule_release - called by file close
310 + * @inode: not used
311 +@@ -278,6 +255,13 @@ static int efi_capsule_release(struct inode *inode, struct file *file)
312 + {
313 + struct capsule_info *cap_info = file->private_data;
314 +
315 ++ if (cap_info->index > 0 &&
316 ++ (cap_info->header.headersize == 0 ||
317 ++ cap_info->count < cap_info->total_size)) {
318 ++ pr_err("capsule upload not complete\n");
319 ++ efi_free_all_buff_pages(cap_info);
320 ++ }
321 ++
322 + kfree(cap_info->pages);
323 + kfree(cap_info->phys);
324 + kfree(file->private_data);
325 +@@ -325,7 +309,6 @@ static const struct file_operations efi_capsule_fops = {
326 + .owner = THIS_MODULE,
327 + .open = efi_capsule_open,
328 + .write = efi_capsule_write,
329 +- .flush = efi_capsule_flush,
330 + .release = efi_capsule_release,
331 + .llseek = no_llseek,
332 + };
333 +diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
334 +index d8ae6a23e6133..d36bea68a67e1 100644
335 +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
336 ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
337 +@@ -1771,7 +1771,8 @@ static void gfx_v9_0_gpu_init(struct amdgpu_device *adev)
338 +
339 + gfx_v9_0_tiling_mode_table_init(adev);
340 +
341 +- gfx_v9_0_setup_rb(adev);
342 ++ if (adev->gfx.num_gfx_rings)
343 ++ gfx_v9_0_setup_rb(adev);
344 + gfx_v9_0_get_cu_info(adev, &adev->gfx.cu_info);
345 + adev->gfx.config.db_debug2 = RREG32_SOC15(GC, 0, mmDB_DEBUG2);
346 +
347 +diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
348 +index c963eec58c702..923bc097a00b2 100644
349 +--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
350 ++++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
351 +@@ -155,6 +155,7 @@ static void mmhub_v1_0_init_cache_regs(struct amdgpu_device *adev)
352 + tmp = REG_SET_FIELD(tmp, VM_L2_CNTL2, INVALIDATE_L2_CACHE, 1);
353 + WREG32_SOC15(MMHUB, 0, mmVM_L2_CNTL2, tmp);
354 +
355 ++ tmp = mmVM_L2_CNTL3_DEFAULT;
356 + if (adev->gmc.translate_further) {
357 + tmp = REG_SET_FIELD(tmp, VM_L2_CNTL3, BANK_SELECT, 12);
358 + tmp = REG_SET_FIELD(tmp, VM_L2_CNTL3,
359 +diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
360 +index 94c1089ecf59e..1bde4b618d151 100644
361 +--- a/drivers/gpu/drm/i915/gvt/handlers.c
362 ++++ b/drivers/gpu/drm/i915/gvt/handlers.c
363 +@@ -651,7 +651,7 @@ static int update_fdi_rx_iir_status(struct intel_vgpu *vgpu,
364 + else if (FDI_RX_IMR_TO_PIPE(offset) != INVALID_INDEX)
365 + index = FDI_RX_IMR_TO_PIPE(offset);
366 + else {
367 +- gvt_vgpu_err("Unsupport registers %x\n", offset);
368 ++ gvt_vgpu_err("Unsupported registers %x\n", offset);
369 + return -EINVAL;
370 + }
371 +
372 +diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
373 +index dcdfb1bb54f98..ad9d693e11da7 100644
374 +--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c
375 ++++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
376 +@@ -105,7 +105,7 @@ static const char * const dsi_8996_bus_clk_names[] = {
377 + static const struct msm_dsi_config msm8996_dsi_cfg = {
378 + .io_offset = DSI_6G_REG_SHIFT,
379 + .reg_cfg = {
380 +- .num = 2,
381 ++ .num = 3,
382 + .regs = {
383 + {"vdda", 18160, 1 }, /* 1.25 V */
384 + {"vcca", 17000, 32 }, /* 0.925 V */
385 +diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
386 +index f01e245cd0eee..bed0cd72e3ebd 100644
387 +--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
388 ++++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
389 +@@ -355,7 +355,7 @@ int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing *timing,
390 + } else {
391 + timing->shared_timings.clk_pre =
392 + linear_inter(tmax, tmin, pcnt2, 0, false);
393 +- timing->shared_timings.clk_pre_inc_by_2 = 0;
394 ++ timing->shared_timings.clk_pre_inc_by_2 = 0;
395 + }
396 +
397 + timing->ta_go = 3;
398 +diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
399 +index 59c8a6647ff21..cc1c07963116c 100644
400 +--- a/drivers/gpu/drm/radeon/radeon_device.c
401 ++++ b/drivers/gpu/drm/radeon/radeon_device.c
402 +@@ -1625,6 +1625,9 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend,
403 + if (r) {
404 + /* delay GPU reset to resume */
405 + radeon_fence_driver_force_completion(rdev, i);
406 ++ } else {
407 ++ /* finish executing delayed work */
408 ++ flush_delayed_work(&rdev->fence_drv[i].lockup_work);
409 + }
410 + }
411 +
412 +diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
413 +index a3974cddef079..534a175a6e4cf 100644
414 +--- a/drivers/hwmon/gpio-fan.c
415 ++++ b/drivers/hwmon/gpio-fan.c
416 +@@ -404,6 +404,9 @@ static int gpio_fan_set_cur_state(struct thermal_cooling_device *cdev,
417 + if (!fan_data)
418 + return -EINVAL;
419 +
420 ++ if (state >= fan_data->num_speed)
421 ++ return -EINVAL;
422 ++
423 + set_fan_speed(fan_data, state);
424 + return 0;
425 + }
426 +diff --git a/drivers/infiniband/hw/mlx5/mad.c b/drivers/infiniband/hw/mlx5/mad.c
427 +index cdf6e26ebc87d..fb6dcd12db254 100644
428 +--- a/drivers/infiniband/hw/mlx5/mad.c
429 ++++ b/drivers/infiniband/hw/mlx5/mad.c
430 +@@ -216,6 +216,12 @@ static int process_pma_cmd(struct mlx5_ib_dev *dev, u8 port_num,
431 + mdev = dev->mdev;
432 + mdev_port_num = 1;
433 + }
434 ++ if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1) {
435 ++ /* set local port to one for Function-Per-Port HCA. */
436 ++ mdev = dev->mdev;
437 ++ mdev_port_num = 1;
438 ++ }
439 ++
440 + /* Declaring support of extended counters */
441 + if (in_mad->mad_hdr.attr_id == IB_PMA_CLASS_PORT_INFO) {
442 + struct ib_class_port_info cpi = {};
443 +diff --git a/drivers/input/misc/rk805-pwrkey.c b/drivers/input/misc/rk805-pwrkey.c
444 +index 921003963a53c..cdcad5c01e3c0 100644
445 +--- a/drivers/input/misc/rk805-pwrkey.c
446 ++++ b/drivers/input/misc/rk805-pwrkey.c
447 +@@ -106,6 +106,7 @@ static struct platform_driver rk805_pwrkey_driver = {
448 + };
449 + module_platform_driver(rk805_pwrkey_driver);
450 +
451 ++MODULE_ALIAS("platform:rk805-pwrkey");
452 + MODULE_AUTHOR("Joseph Chen <chenjh@××××××××××.com>");
453 + MODULE_DESCRIPTION("RK805 PMIC Power Key driver");
454 + MODULE_LICENSE("GPL");
455 +diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
456 +index c1832a8487140..2fa4becdaee92 100644
457 +--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
458 ++++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
459 +@@ -178,6 +178,10 @@ void i40e_notify_client_of_netdev_close(struct i40e_vsi *vsi, bool reset)
460 + "Cannot locate client instance close routine\n");
461 + return;
462 + }
463 ++ if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {
464 ++ dev_dbg(&pf->pdev->dev, "Client is not open, abort close\n");
465 ++ return;
466 ++ }
467 + cdev->client->ops->close(&cdev->lan_info, cdev->client, reset);
468 + clear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);
469 + i40e_client_release_qvlist(&cdev->lan_info);
470 +@@ -376,7 +380,6 @@ void i40e_client_subtask(struct i40e_pf *pf)
471 + /* Remove failed client instance */
472 + clear_bit(__I40E_CLIENT_INSTANCE_OPENED,
473 + &cdev->state);
474 +- i40e_client_del_instance(pf);
475 + return;
476 + }
477 + }
478 +diff --git a/drivers/net/ethernet/rocker/rocker_ofdpa.c b/drivers/net/ethernet/rocker/rocker_ofdpa.c
479 +index 6473cc68c2d5c..4039e1fc6e92a 100644
480 +--- a/drivers/net/ethernet/rocker/rocker_ofdpa.c
481 ++++ b/drivers/net/ethernet/rocker/rocker_ofdpa.c
482 +@@ -1276,7 +1276,7 @@ static int ofdpa_port_ipv4_neigh(struct ofdpa_port *ofdpa_port,
483 + bool removing;
484 + int err = 0;
485 +
486 +- entry = kzalloc(sizeof(*entry), GFP_KERNEL);
487 ++ entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
488 + if (!entry)
489 + return -ENOMEM;
490 +
491 +diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c
492 +index a686926bba71e..6ef5523f4e717 100644
493 +--- a/drivers/net/ieee802154/adf7242.c
494 ++++ b/drivers/net/ieee802154/adf7242.c
495 +@@ -1318,10 +1318,11 @@ static int adf7242_remove(struct spi_device *spi)
496 +
497 + debugfs_remove_recursive(lp->debugfs_root);
498 +
499 ++ ieee802154_unregister_hw(lp->hw);
500 ++
501 + cancel_delayed_work_sync(&lp->work);
502 + destroy_workqueue(lp->wqueue);
503 +
504 +- ieee802154_unregister_hw(lp->hw);
505 + mutex_destroy(&lp->bmux);
506 + ieee802154_free_hw(lp->hw);
507 +
508 +diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c
509 +index 9e2ed98f7df2b..cffa0cb517204 100644
510 +--- a/drivers/net/phy/dp83822.c
511 ++++ b/drivers/net/phy/dp83822.c
512 +@@ -204,7 +204,6 @@ static int dp83822_config_intr(struct phy_device *phydev)
513 + return misr_status;
514 +
515 + misr_status |= (DP83822_RX_ERR_HF_INT_EN |
516 +- DP83822_FALSE_CARRIER_HF_INT_EN |
517 + DP83822_ANEG_COMPLETE_INT_EN |
518 + DP83822_DUP_MODE_CHANGE_INT_EN |
519 + DP83822_SPEED_CHANGED_INT_EN |
520 +diff --git a/drivers/net/wireless/intel/iwlegacy/4965-rs.c b/drivers/net/wireless/intel/iwlegacy/4965-rs.c
521 +index f204e139e5f02..cfa54d35ba2e0 100644
522 +--- a/drivers/net/wireless/intel/iwlegacy/4965-rs.c
523 ++++ b/drivers/net/wireless/intel/iwlegacy/4965-rs.c
524 +@@ -2422,7 +2422,7 @@ il4965_rs_fill_link_cmd(struct il_priv *il, struct il_lq_sta *lq_sta,
525 + /* Repeat initial/next rate.
526 + * For legacy IL_NUMBER_TRY == 1, this loop will not execute.
527 + * For HT IL_HT_NUMBER_TRY == 3, this executes twice. */
528 +- while (repeat_rate > 0) {
529 ++ while (repeat_rate > 0 && idx < (LINK_QUAL_MAX_RETRY_NUM - 1)) {
530 + if (is_legacy(tbl_type.lq_type)) {
531 + if (ant_toggle_cnt < NUM_TRY_BEFORE_ANT_TOGGLE)
532 + ant_toggle_cnt++;
533 +@@ -2441,8 +2441,6 @@ il4965_rs_fill_link_cmd(struct il_priv *il, struct il_lq_sta *lq_sta,
534 + cpu_to_le32(new_rate);
535 + repeat_rate--;
536 + idx++;
537 +- if (idx >= LINK_QUAL_MAX_RETRY_NUM)
538 +- goto out;
539 + }
540 +
541 + il4965_rs_get_tbl_info_from_mcs(new_rate, lq_sta->band,
542 +@@ -2487,7 +2485,6 @@ il4965_rs_fill_link_cmd(struct il_priv *il, struct il_lq_sta *lq_sta,
543 + repeat_rate--;
544 + }
545 +
546 +-out:
547 + lq_cmd->agg_params.agg_frame_cnt_limit = LINK_QUAL_AGG_FRAME_LIMIT_DEF;
548 + lq_cmd->agg_params.agg_dis_start_th = LINK_QUAL_AGG_DISABLE_START_DEF;
549 +
550 +diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
551 +index 6efab7a06c5fc..73ee74d6e7a3d 100644
552 +--- a/drivers/parisc/ccio-dma.c
553 ++++ b/drivers/parisc/ccio-dma.c
554 +@@ -1390,15 +1390,17 @@ ccio_init_resource(struct resource *res, char *name, void __iomem *ioaddr)
555 + }
556 + }
557 +
558 +-static void __init ccio_init_resources(struct ioc *ioc)
559 ++static int __init ccio_init_resources(struct ioc *ioc)
560 + {
561 + struct resource *res = ioc->mmio_region;
562 + char *name = kmalloc(14, GFP_KERNEL);
563 +-
564 ++ if (unlikely(!name))
565 ++ return -ENOMEM;
566 + snprintf(name, 14, "GSC Bus [%d/]", ioc->hw_path);
567 +
568 + ccio_init_resource(res, name, &ioc->ioc_regs->io_io_low);
569 + ccio_init_resource(res + 1, name, &ioc->ioc_regs->io_io_low_hv);
570 ++ return 0;
571 + }
572 +
573 + static int new_ioc_area(struct resource *res, unsigned long size,
574 +@@ -1552,7 +1554,10 @@ static int __init ccio_probe(struct parisc_device *dev)
575 + return -ENOMEM;
576 + }
577 + ccio_ioc_init(ioc);
578 +- ccio_init_resources(ioc);
579 ++ if (ccio_init_resources(ioc)) {
580 ++ kfree(ioc);
581 ++ return -ENOMEM;
582 ++ }
583 + hppa_dma_ops = &ccio_ops;
584 + dev->dev.platform_data = kzalloc(sizeof(struct pci_hba_data), GFP_KERNEL);
585 +
586 +diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c
587 +index 682fc49d172cb..e8440850b73ac 100644
588 +--- a/drivers/platform/x86/pmc_atom.c
589 ++++ b/drivers/platform/x86/pmc_atom.c
590 +@@ -253,7 +253,7 @@ static void pmc_power_off(void)
591 + pm1_cnt_port = acpi_base_addr + PM1_CNT;
592 +
593 + pm1_cnt_value = inl(pm1_cnt_port);
594 +- pm1_cnt_value &= SLEEP_TYPE_MASK;
595 ++ pm1_cnt_value &= ~SLEEP_TYPE_MASK;
596 + pm1_cnt_value |= SLEEP_TYPE_S5;
597 + pm1_cnt_value |= SLEEP_ENABLE;
598 +
599 +diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
600 +index d899f216245e5..c8d97dc2ca63d 100644
601 +--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
602 ++++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
603 +@@ -3215,6 +3215,7 @@ static struct fw_event_work *dequeue_next_fw_event(struct MPT3SAS_ADAPTER *ioc)
604 + fw_event = list_first_entry(&ioc->fw_event_list,
605 + struct fw_event_work, list);
606 + list_del_init(&fw_event->list);
607 ++ fw_event_work_put(fw_event);
608 + }
609 + spin_unlock_irqrestore(&ioc->fw_event_lock, flags);
610 +
611 +@@ -3249,7 +3250,6 @@ _scsih_fw_event_cleanup_queue(struct MPT3SAS_ADAPTER *ioc)
612 + if (cancel_work_sync(&fw_event->work))
613 + fw_event_work_put(fw_event);
614 +
615 +- fw_event_work_put(fw_event);
616 + }
617 + }
618 +
619 +diff --git a/drivers/soc/bcm/brcmstb/pm/pm-arm.c b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
620 +index f4ad45a1efabe..fd124e0850207 100644
621 +--- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c
622 ++++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c
623 +@@ -689,13 +689,14 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
624 + const struct of_device_id *of_id = NULL;
625 + struct device_node *dn;
626 + void __iomem *base;
627 +- int ret, i;
628 ++ int ret, i, s;
629 +
630 + /* AON ctrl registers */
631 + base = brcmstb_ioremap_match(aon_ctrl_dt_ids, 0, NULL);
632 + if (IS_ERR(base)) {
633 + pr_err("error mapping AON_CTRL\n");
634 +- return PTR_ERR(base);
635 ++ ret = PTR_ERR(base);
636 ++ goto aon_err;
637 + }
638 + ctrl.aon_ctrl_base = base;
639 +
640 +@@ -705,8 +706,10 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
641 + /* Assume standard offset */
642 + ctrl.aon_sram = ctrl.aon_ctrl_base +
643 + AON_CTRL_SYSTEM_DATA_RAM_OFS;
644 ++ s = 0;
645 + } else {
646 + ctrl.aon_sram = base;
647 ++ s = 1;
648 + }
649 +
650 + writel_relaxed(0, ctrl.aon_sram + AON_REG_PANIC);
651 +@@ -716,7 +719,8 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
652 + (const void **)&ddr_phy_data);
653 + if (IS_ERR(base)) {
654 + pr_err("error mapping DDR PHY\n");
655 +- return PTR_ERR(base);
656 ++ ret = PTR_ERR(base);
657 ++ goto ddr_phy_err;
658 + }
659 + ctrl.support_warm_boot = ddr_phy_data->supports_warm_boot;
660 + ctrl.pll_status_offset = ddr_phy_data->pll_status_offset;
661 +@@ -736,17 +740,20 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
662 + for_each_matching_node(dn, ddr_shimphy_dt_ids) {
663 + i = ctrl.num_memc;
664 + if (i >= MAX_NUM_MEMC) {
665 ++ of_node_put(dn);
666 + pr_warn("too many MEMCs (max %d)\n", MAX_NUM_MEMC);
667 + break;
668 + }
669 +
670 + base = of_io_request_and_map(dn, 0, dn->full_name);
671 + if (IS_ERR(base)) {
672 ++ of_node_put(dn);
673 + if (!ctrl.support_warm_boot)
674 + break;
675 +
676 + pr_err("error mapping DDR SHIMPHY %d\n", i);
677 +- return PTR_ERR(base);
678 ++ ret = PTR_ERR(base);
679 ++ goto ddr_shimphy_err;
680 + }
681 + ctrl.memcs[i].ddr_shimphy_base = base;
682 + ctrl.num_memc++;
683 +@@ -757,14 +764,18 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
684 + for_each_matching_node(dn, brcmstb_memc_of_match) {
685 + base = of_iomap(dn, 0);
686 + if (!base) {
687 ++ of_node_put(dn);
688 + pr_err("error mapping DDR Sequencer %d\n", i);
689 +- return -ENOMEM;
690 ++ ret = -ENOMEM;
691 ++ goto brcmstb_memc_err;
692 + }
693 +
694 + of_id = of_match_node(brcmstb_memc_of_match, dn);
695 + if (!of_id) {
696 + iounmap(base);
697 +- return -EINVAL;
698 ++ of_node_put(dn);
699 ++ ret = -EINVAL;
700 ++ goto brcmstb_memc_err;
701 + }
702 +
703 + ddr_seq_data = of_id->data;
704 +@@ -784,21 +795,24 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
705 + dn = of_find_matching_node(NULL, sram_dt_ids);
706 + if (!dn) {
707 + pr_err("SRAM not found\n");
708 +- return -EINVAL;
709 ++ ret = -EINVAL;
710 ++ goto brcmstb_memc_err;
711 + }
712 +
713 + ret = brcmstb_init_sram(dn);
714 + of_node_put(dn);
715 + if (ret) {
716 + pr_err("error setting up SRAM for PM\n");
717 +- return ret;
718 ++ goto brcmstb_memc_err;
719 + }
720 +
721 + ctrl.pdev = pdev;
722 +
723 + ctrl.s3_params = kmalloc(sizeof(*ctrl.s3_params), GFP_KERNEL);
724 +- if (!ctrl.s3_params)
725 +- return -ENOMEM;
726 ++ if (!ctrl.s3_params) {
727 ++ ret = -ENOMEM;
728 ++ goto s3_params_err;
729 ++ }
730 + ctrl.s3_params_pa = dma_map_single(&pdev->dev, ctrl.s3_params,
731 + sizeof(*ctrl.s3_params),
732 + DMA_TO_DEVICE);
733 +@@ -818,7 +832,21 @@ static int brcmstb_pm_probe(struct platform_device *pdev)
734 +
735 + out:
736 + kfree(ctrl.s3_params);
737 +-
738 ++s3_params_err:
739 ++ iounmap(ctrl.boot_sram);
740 ++brcmstb_memc_err:
741 ++ for (i--; i >= 0; i--)
742 ++ iounmap(ctrl.memcs[i].ddr_ctrl);
743 ++ddr_shimphy_err:
744 ++ for (i = 0; i < ctrl.num_memc; i++)
745 ++ iounmap(ctrl.memcs[i].ddr_shimphy_base);
746 ++
747 ++ iounmap(ctrl.memcs[0].ddr_phy_base);
748 ++ddr_phy_err:
749 ++ iounmap(ctrl.aon_ctrl_base);
750 ++ if (s)
751 ++ iounmap(ctrl.aon_sram);
752 ++aon_err:
753 + pr_warn("PM: initialization failed with code %d\n", ret);
754 +
755 + return ret;
756 +diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c
757 +index 63bc811681d96..fb092d4ec5219 100644
758 +--- a/drivers/staging/rtl8712/rtl8712_cmd.c
759 ++++ b/drivers/staging/rtl8712/rtl8712_cmd.c
760 +@@ -129,34 +129,6 @@ static void r871x_internal_cmd_hdl(struct _adapter *padapter, u8 *pbuf)
761 + kfree(pdrvcmd->pbuf);
762 + }
763 +
764 +-static u8 read_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
765 +-{
766 +- void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
767 +- struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
768 +-
769 +- /* invoke cmd->callback function */
770 +- pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
771 +- if (!pcmd_callback)
772 +- r8712_free_cmd_obj(pcmd);
773 +- else
774 +- pcmd_callback(padapter, pcmd);
775 +- return H2C_SUCCESS;
776 +-}
777 +-
778 +-static u8 write_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
779 +-{
780 +- void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
781 +- struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
782 +-
783 +- /* invoke cmd->callback function */
784 +- pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
785 +- if (!pcmd_callback)
786 +- r8712_free_cmd_obj(pcmd);
787 +- else
788 +- pcmd_callback(padapter, pcmd);
789 +- return H2C_SUCCESS;
790 +-}
791 +-
792 + static u8 read_bbreg_hdl(struct _adapter *padapter, u8 *pbuf)
793 + {
794 + struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
795 +@@ -225,14 +197,6 @@ static struct cmd_obj *cmd_hdl_filter(struct _adapter *padapter,
796 + pcmd_r = NULL;
797 +
798 + switch (pcmd->cmdcode) {
799 +- case GEN_CMD_CODE(_Read_MACREG):
800 +- read_macreg_hdl(padapter, (u8 *)pcmd);
801 +- pcmd_r = pcmd;
802 +- break;
803 +- case GEN_CMD_CODE(_Write_MACREG):
804 +- write_macreg_hdl(padapter, (u8 *)pcmd);
805 +- pcmd_r = pcmd;
806 +- break;
807 + case GEN_CMD_CODE(_Read_BBREG):
808 + read_bbreg_hdl(padapter, (u8 *)pcmd);
809 + break;
810 +diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
811 +index 37a7f4c735d05..dcdfd3767a487 100644
812 +--- a/drivers/thunderbolt/ctl.c
813 ++++ b/drivers/thunderbolt/ctl.c
814 +@@ -387,7 +387,7 @@ static void tb_ctl_rx_submit(struct ctl_pkg *pkg)
815 +
816 + static int tb_async_error(const struct ctl_pkg *pkg)
817 + {
818 +- const struct cfg_error_pkg *error = (const struct cfg_error_pkg *)pkg;
819 ++ const struct cfg_error_pkg *error = pkg->buffer;
820 +
821 + if (pkg->frame.eof != TB_CFG_PKG_ERROR)
822 + return false;
823 +diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
824 +index b757fd1bdbfa5..069d02354c825 100644
825 +--- a/drivers/tty/serial/fsl_lpuart.c
826 ++++ b/drivers/tty/serial/fsl_lpuart.c
827 +@@ -1102,9 +1102,9 @@ static int lpuart_config_rs485(struct uart_port *port,
828 + * Note: UART is assumed to be active high.
829 + */
830 + if (rs485->flags & SER_RS485_RTS_ON_SEND)
831 +- modem &= ~UARTMODEM_TXRTSPOL;
832 +- else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
833 + modem |= UARTMODEM_TXRTSPOL;
834 ++ else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
835 ++ modem &= ~UARTMODEM_TXRTSPOL;
836 + }
837 +
838 + /* Store the new configuration */
839 +diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
840 +index 198bf54568cc4..c9083d853076a 100644
841 +--- a/drivers/tty/vt/vt.c
842 ++++ b/drivers/tty/vt/vt.c
843 +@@ -4518,9 +4518,11 @@ static int con_font_set(struct vc_data *vc, struct console_font_op *op)
844 + console_lock();
845 + if (vc->vc_mode != KD_TEXT)
846 + rc = -EINVAL;
847 +- else if (vc->vc_sw->con_font_set)
848 ++ else if (vc->vc_sw->con_font_set) {
849 ++ if (vc_is_sel(vc))
850 ++ clear_selection();
851 + rc = vc->vc_sw->con_font_set(vc, &font, op->flags);
852 +- else
853 ++ } else
854 + rc = -ENOSYS;
855 + console_unlock();
856 + kfree(font.data);
857 +@@ -4547,9 +4549,11 @@ static int con_font_default(struct vc_data *vc, struct console_font_op *op)
858 + console_unlock();
859 + return -EINVAL;
860 + }
861 +- if (vc->vc_sw->con_font_default)
862 ++ if (vc->vc_sw->con_font_default) {
863 ++ if (vc_is_sel(vc))
864 ++ clear_selection();
865 + rc = vc->vc_sw->con_font_default(vc, &font, s);
866 +- else
867 ++ } else
868 + rc = -ENOSYS;
869 + console_unlock();
870 + if (!rc) {
871 +diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
872 +index 0522bd2d9d3cc..e927631c79c67 100644
873 +--- a/drivers/usb/class/cdc-acm.c
874 ++++ b/drivers/usb/class/cdc-acm.c
875 +@@ -1883,6 +1883,9 @@ static const struct usb_device_id acm_ids[] = {
876 + { USB_DEVICE(0x09d8, 0x0320), /* Elatec GmbH TWN3 */
877 + .driver_info = NO_UNION_NORMAL, /* has misplaced union descriptor */
878 + },
879 ++ { USB_DEVICE(0x0c26, 0x0020), /* Icom ICF3400 Serie */
880 ++ .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
881 ++ },
882 + { USB_DEVICE(0x0ca6, 0xa050), /* Castles VEGA3000 */
883 + .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
884 + },
885 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
886 +index 29cc2aa5abff5..4d04c75ac3815 100644
887 +--- a/drivers/usb/core/hub.c
888 ++++ b/drivers/usb/core/hub.c
889 +@@ -5851,6 +5851,11 @@ re_enumerate_no_bos:
890 + * the reset is over (using their post_reset method).
891 + *
892 + * Return: The same as for usb_reset_and_verify_device().
893 ++ * However, if a reset is already in progress (for instance, if a
894 ++ * driver doesn't have pre_ or post_reset() callbacks, and while
895 ++ * being unbound or re-bound during the ongoing reset its disconnect()
896 ++ * or probe() routine tries to perform a second, nested reset), the
897 ++ * routine returns -EINPROGRESS.
898 + *
899 + * Note:
900 + * The caller must own the device lock. For example, it's safe to use
901 +@@ -5884,6 +5889,10 @@ int usb_reset_device(struct usb_device *udev)
902 + return -EISDIR;
903 + }
904 +
905 ++ if (udev->reset_in_progress)
906 ++ return -EINPROGRESS;
907 ++ udev->reset_in_progress = 1;
908 ++
909 + port_dev = hub->ports[udev->portnum - 1];
910 +
911 + /*
912 +@@ -5948,6 +5957,7 @@ int usb_reset_device(struct usb_device *udev)
913 +
914 + usb_autosuspend_device(udev);
915 + memalloc_noio_restore(noio_flag);
916 ++ udev->reset_in_progress = 0;
917 + return ret;
918 + }
919 + EXPORT_SYMBOL_GPL(usb_reset_device);
920 +diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
921 +index a9e86f5e6eaa3..4f30994960191 100644
922 +--- a/drivers/usb/dwc2/platform.c
923 ++++ b/drivers/usb/dwc2/platform.c
924 +@@ -142,9 +142,9 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
925 + } else if (hsotg->plat && hsotg->plat->phy_init) {
926 + ret = hsotg->plat->phy_init(pdev, hsotg->plat->phy_type);
927 + } else {
928 +- ret = phy_power_on(hsotg->phy);
929 ++ ret = phy_init(hsotg->phy);
930 + if (ret == 0)
931 +- ret = phy_init(hsotg->phy);
932 ++ ret = phy_power_on(hsotg->phy);
933 + }
934 +
935 + return ret;
936 +@@ -176,9 +176,9 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg)
937 + } else if (hsotg->plat && hsotg->plat->phy_exit) {
938 + ret = hsotg->plat->phy_exit(pdev, hsotg->plat->phy_type);
939 + } else {
940 +- ret = phy_exit(hsotg->phy);
941 ++ ret = phy_power_off(hsotg->phy);
942 + if (ret == 0)
943 +- ret = phy_power_off(hsotg->phy);
944 ++ ret = phy_exit(hsotg->phy);
945 + }
946 + if (ret)
947 + return ret;
948 +diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
949 +index 984faecdd7ecb..465aabb6e96c8 100644
950 +--- a/drivers/usb/dwc3/core.c
951 ++++ b/drivers/usb/dwc3/core.c
952 +@@ -673,15 +673,16 @@ static void dwc3_core_exit(struct dwc3 *dwc)
953 + {
954 + dwc3_event_buffers_cleanup(dwc);
955 +
956 ++ usb_phy_set_suspend(dwc->usb2_phy, 1);
957 ++ usb_phy_set_suspend(dwc->usb3_phy, 1);
958 ++ phy_power_off(dwc->usb2_generic_phy);
959 ++ phy_power_off(dwc->usb3_generic_phy);
960 ++
961 + usb_phy_shutdown(dwc->usb2_phy);
962 + usb_phy_shutdown(dwc->usb3_phy);
963 + phy_exit(dwc->usb2_generic_phy);
964 + phy_exit(dwc->usb3_generic_phy);
965 +
966 +- usb_phy_set_suspend(dwc->usb2_phy, 1);
967 +- usb_phy_set_suspend(dwc->usb3_phy, 1);
968 +- phy_power_off(dwc->usb2_generic_phy);
969 +- phy_power_off(dwc->usb3_generic_phy);
970 + clk_bulk_disable(dwc->num_clks, dwc->clks);
971 + clk_bulk_unprepare(dwc->num_clks, dwc->clks);
972 + reset_control_assert(dwc->reset);
973 +@@ -1509,16 +1510,16 @@ err5:
974 + dwc3_debugfs_exit(dwc);
975 + dwc3_event_buffers_cleanup(dwc);
976 +
977 +- usb_phy_shutdown(dwc->usb2_phy);
978 +- usb_phy_shutdown(dwc->usb3_phy);
979 +- phy_exit(dwc->usb2_generic_phy);
980 +- phy_exit(dwc->usb3_generic_phy);
981 +-
982 + usb_phy_set_suspend(dwc->usb2_phy, 1);
983 + usb_phy_set_suspend(dwc->usb3_phy, 1);
984 + phy_power_off(dwc->usb2_generic_phy);
985 + phy_power_off(dwc->usb3_generic_phy);
986 +
987 ++ usb_phy_shutdown(dwc->usb2_phy);
988 ++ usb_phy_shutdown(dwc->usb3_phy);
989 ++ phy_exit(dwc->usb2_generic_phy);
990 ++ phy_exit(dwc->usb3_generic_phy);
991 ++
992 + dwc3_ulpi_exit(dwc);
993 +
994 + err4:
995 +diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
996 +index 5bb5384f36125..9d5320562e81f 100644
997 +--- a/drivers/usb/dwc3/dwc3-qcom.c
998 ++++ b/drivers/usb/dwc3/dwc3-qcom.c
999 +@@ -173,6 +173,14 @@ static int dwc3_qcom_register_extcon(struct dwc3_qcom *qcom)
1000 + return 0;
1001 + }
1002 +
1003 ++/* Only usable in contexts where the role can not change. */
1004 ++static bool dwc3_qcom_is_host(struct dwc3_qcom *qcom)
1005 ++{
1006 ++ struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3);
1007 ++
1008 ++ return dwc->xhci;
1009 ++}
1010 ++
1011 + static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom)
1012 + {
1013 + if (qcom->hs_phy_irq) {
1014 +@@ -280,7 +288,11 @@ static irqreturn_t qcom_dwc3_resume_irq(int irq, void *data)
1015 + if (qcom->pm_suspended)
1016 + return IRQ_HANDLED;
1017 +
1018 +- if (dwc->xhci)
1019 ++ /*
1020 ++ * This is safe as role switching is done from a freezable workqueue
1021 ++ * and the wakeup interrupts are disabled as part of resume.
1022 ++ */
1023 ++ if (dwc3_qcom_is_host(qcom))
1024 + pm_runtime_resume(&dwc->xhci->dev);
1025 +
1026 + return IRQ_HANDLED;
1027 +diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
1028 +index 1a3878a3be78f..124e9f80dccd8 100644
1029 +--- a/drivers/usb/dwc3/host.c
1030 ++++ b/drivers/usb/dwc3/host.c
1031 +@@ -142,4 +142,5 @@ void dwc3_host_exit(struct dwc3 *dwc)
1032 + phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
1033 + dev_name(dwc->dev));
1034 + platform_device_unregister(dwc->xhci);
1035 ++ dwc->xhci = NULL;
1036 + }
1037 +diff --git a/drivers/usb/gadget/function/storage_common.c b/drivers/usb/gadget/function/storage_common.c
1038 +index f7e6c42558eb7..021984921f919 100644
1039 +--- a/drivers/usb/gadget/function/storage_common.c
1040 ++++ b/drivers/usb/gadget/function/storage_common.c
1041 +@@ -294,8 +294,10 @@ EXPORT_SYMBOL_GPL(fsg_lun_fsync_sub);
1042 + void store_cdrom_address(u8 *dest, int msf, u32 addr)
1043 + {
1044 + if (msf) {
1045 +- /* Convert to Minutes-Seconds-Frames */
1046 +- addr >>= 2; /* Convert to 2048-byte frames */
1047 ++ /*
1048 ++ * Convert to Minutes-Seconds-Frames.
1049 ++ * Sector size is already set to 2048 bytes.
1050 ++ */
1051 + addr += 2*75; /* Lead-in occupies 2 seconds */
1052 + dest[3] = addr % 75; /* Frames */
1053 + addr /= 75;
1054 +diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
1055 +index e40370ed7d8a5..b5a18817c8071 100644
1056 +--- a/drivers/usb/host/xhci-hub.c
1057 ++++ b/drivers/usb/host/xhci-hub.c
1058 +@@ -565,7 +565,7 @@ struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd)
1059 + * It will release and re-aquire the lock while calling ACPI
1060 + * method.
1061 + */
1062 +-void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd,
1063 ++static void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd,
1064 + u16 index, bool on, unsigned long *flags)
1065 + {
1066 + struct xhci_hub *rhub;
1067 +@@ -1464,6 +1464,17 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
1068 +
1069 + status = bus_state->resuming_ports;
1070 +
1071 ++ /*
1072 ++ * SS devices are only visible to roothub after link training completes.
1073 ++ * Keep polling roothubs for a grace period after xHC start
1074 ++ */
1075 ++ if (xhci->run_graceperiod) {
1076 ++ if (time_before(jiffies, xhci->run_graceperiod))
1077 ++ status = 1;
1078 ++ else
1079 ++ xhci->run_graceperiod = 0;
1080 ++ }
1081 ++
1082 + mask = PORT_CSC | PORT_PEC | PORT_OCC | PORT_PLC | PORT_WRC | PORT_CEC;
1083 +
1084 + /* For each port, did anything change? If so, set that bit in buf. */
1085 +diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
1086 +index 677587479d260..7fef6d9ed04f8 100644
1087 +--- a/drivers/usb/host/xhci.c
1088 ++++ b/drivers/usb/host/xhci.c
1089 +@@ -149,9 +149,11 @@ int xhci_start(struct xhci_hcd *xhci)
1090 + xhci_err(xhci, "Host took too long to start, "
1091 + "waited %u microseconds.\n",
1092 + XHCI_MAX_HALT_USEC);
1093 +- if (!ret)
1094 ++ if (!ret) {
1095 + /* clear state flags. Including dying, halted or removing */
1096 + xhci->xhc_state = 0;
1097 ++ xhci->run_graceperiod = jiffies + msecs_to_jiffies(500);
1098 ++ }
1099 +
1100 + return ret;
1101 + }
1102 +@@ -774,8 +776,6 @@ static void xhci_stop(struct usb_hcd *hcd)
1103 + void xhci_shutdown(struct usb_hcd *hcd)
1104 + {
1105 + struct xhci_hcd *xhci = hcd_to_xhci(hcd);
1106 +- unsigned long flags;
1107 +- int i;
1108 +
1109 + if (xhci->quirks & XHCI_SPURIOUS_REBOOT)
1110 + usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev));
1111 +@@ -791,21 +791,12 @@ void xhci_shutdown(struct usb_hcd *hcd)
1112 + del_timer_sync(&xhci->shared_hcd->rh_timer);
1113 + }
1114 +
1115 +- spin_lock_irqsave(&xhci->lock, flags);
1116 ++ spin_lock_irq(&xhci->lock);
1117 + xhci_halt(xhci);
1118 +-
1119 +- /* Power off USB2 ports*/
1120 +- for (i = 0; i < xhci->usb2_rhub.num_ports; i++)
1121 +- xhci_set_port_power(xhci, xhci->main_hcd, i, false, &flags);
1122 +-
1123 +- /* Power off USB3 ports*/
1124 +- for (i = 0; i < xhci->usb3_rhub.num_ports; i++)
1125 +- xhci_set_port_power(xhci, xhci->shared_hcd, i, false, &flags);
1126 +-
1127 + /* Workaround for spurious wakeups at shutdown with HSW */
1128 + if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
1129 + xhci_reset(xhci, XHCI_RESET_SHORT_USEC);
1130 +- spin_unlock_irqrestore(&xhci->lock, flags);
1131 ++ spin_unlock_irq(&xhci->lock);
1132 +
1133 + xhci_cleanup_msix(xhci);
1134 +
1135 +diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
1136 +index 3b29dfc6f79e3..029ffcb13d62e 100644
1137 +--- a/drivers/usb/host/xhci.h
1138 ++++ b/drivers/usb/host/xhci.h
1139 +@@ -1811,7 +1811,7 @@ struct xhci_hcd {
1140 +
1141 + /* Host controller watchdog timer structures */
1142 + unsigned int xhc_state;
1143 +-
1144 ++ unsigned long run_graceperiod;
1145 + u32 command;
1146 + struct s3_save s3;
1147 + /* Host controller is dying - not responding to commands. "I'm not dead yet!"
1148 +@@ -2145,8 +2145,6 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
1149 + int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
1150 + int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1);
1151 + struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd);
1152 +-void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, u16 index,
1153 +- bool on, unsigned long *flags);
1154 +
1155 + void xhci_hc_died(struct xhci_hcd *xhci);
1156 +
1157 +diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
1158 +index f789b60ed8c17..7eabb1bfafde5 100644
1159 +--- a/drivers/usb/serial/ch341.c
1160 ++++ b/drivers/usb/serial/ch341.c
1161 +@@ -96,6 +96,8 @@ struct ch341_private {
1162 + u8 mcr;
1163 + u8 msr;
1164 + u8 lcr;
1165 ++
1166 ++ u8 version;
1167 + };
1168 +
1169 + static void ch341_set_termios(struct tty_struct *tty,
1170 +@@ -174,13 +176,20 @@ static int ch341_set_baudrate_lcr(struct usb_device *dev,
1171 + /*
1172 + * CH341A buffers data until a full endpoint-size packet (32 bytes)
1173 + * has been received unless bit 7 is set.
1174 ++ *
1175 ++ * At least one device with version 0x27 appears to have this bit
1176 ++ * inverted.
1177 + */
1178 +- a |= BIT(7);
1179 ++ if (priv->version > 0x27)
1180 ++ a |= BIT(7);
1181 +
1182 + r = ch341_control_out(dev, CH341_REQ_WRITE_REG, 0x1312, a);
1183 + if (r)
1184 + return r;
1185 +
1186 ++ if (priv->version < 0x30)
1187 ++ return 0;
1188 ++
1189 + r = ch341_control_out(dev, CH341_REQ_WRITE_REG, 0x2518, lcr);
1190 + if (r)
1191 + return r;
1192 +@@ -232,7 +241,9 @@ static int ch341_configure(struct usb_device *dev, struct ch341_private *priv)
1193 + r = ch341_control_in(dev, CH341_REQ_READ_VERSION, 0, 0, buffer, size);
1194 + if (r < 0)
1195 + goto out;
1196 +- dev_dbg(&dev->dev, "Chip version: 0x%02x\n", buffer[0]);
1197 ++
1198 ++ priv->version = buffer[0];
1199 ++ dev_dbg(&dev->dev, "Chip version: 0x%02x\n", priv->version);
1200 +
1201 + r = ch341_control_out(dev, CH341_REQ_SERIAL_INIT, 0, 0);
1202 + if (r < 0)
1203 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
1204 +index 95a5c73f3f787..c7c6d5d1dfbc8 100644
1205 +--- a/drivers/usb/serial/cp210x.c
1206 ++++ b/drivers/usb/serial/cp210x.c
1207 +@@ -131,6 +131,7 @@ static const struct usb_device_id id_table[] = {
1208 + { USB_DEVICE(0x10C4, 0x83AA) }, /* Mark-10 Digital Force Gauge */
1209 + { USB_DEVICE(0x10C4, 0x83D8) }, /* DekTec DTA Plus VHF/UHF Booster/Attenuator */
1210 + { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */
1211 ++ { USB_DEVICE(0x10C4, 0x8414) }, /* Decagon USB Cable Adapter */
1212 + { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */
1213 + { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */
1214 + { USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */
1215 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1216 +index 7fa56728696dd..623b54a5cd498 100644
1217 +--- a/drivers/usb/serial/ftdi_sio.c
1218 ++++ b/drivers/usb/serial/ftdi_sio.c
1219 +@@ -1035,6 +1035,8 @@ static const struct usb_device_id id_table_combined[] = {
1220 + /* IDS GmbH devices */
1221 + { USB_DEVICE(IDS_VID, IDS_SI31A_PID) },
1222 + { USB_DEVICE(IDS_VID, IDS_CM31A_PID) },
1223 ++ /* Omron devices */
1224 ++ { USB_DEVICE(OMRON_VID, OMRON_CS1W_CIF31_PID) },
1225 + /* U-Blox devices */
1226 + { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) },
1227 + { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) },
1228 +diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1229 +index 4e92c165c86bf..31c8ccabbbb78 100644
1230 +--- a/drivers/usb/serial/ftdi_sio_ids.h
1231 ++++ b/drivers/usb/serial/ftdi_sio_ids.h
1232 +@@ -661,6 +661,12 @@
1233 + #define INFINEON_TRIBOARD_TC1798_PID 0x0028 /* DAS JTAG TriBoard TC1798 V1.0 */
1234 + #define INFINEON_TRIBOARD_TC2X7_PID 0x0043 /* DAS JTAG TriBoard TC2X7 V1.0 */
1235 +
1236 ++/*
1237 ++ * Omron corporation (https://www.omron.com)
1238 ++ */
1239 ++ #define OMRON_VID 0x0590
1240 ++ #define OMRON_CS1W_CIF31_PID 0x00b2
1241 ++
1242 + /*
1243 + * Acton Research Corp.
1244 + */
1245 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1246 +index d7ea64e8b0249..fe4e340ac66ee 100644
1247 +--- a/drivers/usb/serial/option.c
1248 ++++ b/drivers/usb/serial/option.c
1249 +@@ -253,6 +253,7 @@ static void option_instat_callback(struct urb *urb);
1250 + #define QUECTEL_PRODUCT_BG96 0x0296
1251 + #define QUECTEL_PRODUCT_EP06 0x0306
1252 + #define QUECTEL_PRODUCT_EM05G 0x030a
1253 ++#define QUECTEL_PRODUCT_EM060K 0x030b
1254 + #define QUECTEL_PRODUCT_EM12 0x0512
1255 + #define QUECTEL_PRODUCT_RM500Q 0x0800
1256 + #define QUECTEL_PRODUCT_EC200S_CN 0x6002
1257 +@@ -438,6 +439,8 @@ static void option_instat_callback(struct urb *urb);
1258 + #define CINTERION_PRODUCT_MV31_2_RMNET 0x00b9
1259 + #define CINTERION_PRODUCT_MV32_WA 0x00f1
1260 + #define CINTERION_PRODUCT_MV32_WB 0x00f2
1261 ++#define CINTERION_PRODUCT_MV32_WA_RMNET 0x00f3
1262 ++#define CINTERION_PRODUCT_MV32_WB_RMNET 0x00f4
1263 +
1264 + /* Olivetti products */
1265 + #define OLIVETTI_VENDOR_ID 0x0b3c
1266 +@@ -573,6 +576,10 @@ static void option_instat_callback(struct urb *urb);
1267 + #define WETELECOM_PRODUCT_6802 0x6802
1268 + #define WETELECOM_PRODUCT_WMD300 0x6803
1269 +
1270 ++/* OPPO products */
1271 ++#define OPPO_VENDOR_ID 0x22d9
1272 ++#define OPPO_PRODUCT_R11 0x276c
1273 ++
1274 +
1275 + /* Device flags */
1276 +
1277 +@@ -1138,6 +1145,9 @@ static const struct usb_device_id option_ids[] = {
1278 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },
1279 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff),
1280 + .driver_info = RSVD(6) | ZLP },
1281 ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) },
1282 ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x30) },
1283 ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x40) },
1284 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
1285 + .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
1286 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
1287 +@@ -1993,8 +2003,12 @@ static const struct usb_device_id option_ids[] = {
1288 + .driver_info = RSVD(0)},
1289 + { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WA, 0xff),
1290 + .driver_info = RSVD(3)},
1291 ++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WA_RMNET, 0xff),
1292 ++ .driver_info = RSVD(0) },
1293 + { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WB, 0xff),
1294 + .driver_info = RSVD(3)},
1295 ++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WB_RMNET, 0xff),
1296 ++ .driver_info = RSVD(0) },
1297 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100),
1298 + .driver_info = RSVD(4) },
1299 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120),
1300 +@@ -2155,6 +2169,7 @@ static const struct usb_device_id option_ids[] = {
1301 + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
1302 + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
1303 + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
1304 ++ { USB_DEVICE_AND_INTERFACE_INFO(OPPO_VENDOR_ID, OPPO_PRODUCT_R11, 0xff, 0xff, 0x30) },
1305 + { } /* Terminating entry */
1306 + };
1307 + MODULE_DEVICE_TABLE(usb, option_ids);
1308 +diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
1309 +index 66e7f5d123c46..6a59950a63a03 100644
1310 +--- a/drivers/usb/storage/unusual_devs.h
1311 ++++ b/drivers/usb/storage/unusual_devs.h
1312 +@@ -2294,6 +2294,13 @@ UNUSUAL_DEV( 0x1e74, 0x4621, 0x0000, 0x0000,
1313 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1314 + US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ),
1315 +
1316 ++/* Reported by Witold Lipieta <witold.lipieta@×××××××××.com> */
1317 ++UNUSUAL_DEV( 0x1fc9, 0x0117, 0x0100, 0x0100,
1318 ++ "NXP Semiconductors",
1319 ++ "PN7462AU",
1320 ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1321 ++ US_FL_IGNORE_RESIDUE ),
1322 ++
1323 + /* Supplied with some Castlewood ORB removable drives */
1324 + UNUSUAL_DEV( 0x2027, 0xa001, 0x0000, 0x9999,
1325 + "Double-H Technology",
1326 +diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
1327 +index 3f06e94771a72..52cdc06e1deac 100644
1328 +--- a/drivers/usb/typec/altmodes/displayport.c
1329 ++++ b/drivers/usb/typec/altmodes/displayport.c
1330 +@@ -91,8 +91,8 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
1331 + case DP_STATUS_CON_UFP_D:
1332 + case DP_STATUS_CON_BOTH: /* NOTE: First acting as DP source */
1333 + conf |= DP_CONF_UFP_U_AS_UFP_D;
1334 +- pin_assign = DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo) &
1335 +- DP_CAP_UFP_D_PIN_ASSIGN(dp->port->vdo);
1336 ++ pin_assign = DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo) &
1337 ++ DP_CAP_PIN_ASSIGN_DFP_D(dp->port->vdo);
1338 + break;
1339 + default:
1340 + break;
1341 +diff --git a/drivers/video/fbdev/chipsfb.c b/drivers/video/fbdev/chipsfb.c
1342 +index 413b465e69d8e..7ca149ab86d20 100644
1343 +--- a/drivers/video/fbdev/chipsfb.c
1344 ++++ b/drivers/video/fbdev/chipsfb.c
1345 +@@ -432,6 +432,7 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
1346 + err_release_fb:
1347 + framebuffer_release(p);
1348 + err_disable:
1349 ++ pci_disable_device(dp);
1350 + err_out:
1351 + return rc;
1352 + }
1353 +diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
1354 +index e5126fad57c5a..4661ecaf6741c 100644
1355 +--- a/fs/debugfs/inode.c
1356 ++++ b/fs/debugfs/inode.c
1357 +@@ -766,6 +766,28 @@ void debugfs_remove_recursive(struct dentry *dentry)
1358 + }
1359 + EXPORT_SYMBOL_GPL(debugfs_remove_recursive);
1360 +
1361 ++/**
1362 ++ * debugfs_lookup_and_remove - lookup a directory or file and recursively remove it
1363 ++ * @name: a pointer to a string containing the name of the item to look up.
1364 ++ * @parent: a pointer to the parent dentry of the item.
1365 ++ *
1366 ++ * This is the equlivant of doing something like
1367 ++ * debugfs_remove(debugfs_lookup(..)) but with the proper reference counting
1368 ++ * handled for the directory being looked up.
1369 ++ */
1370 ++void debugfs_lookup_and_remove(const char *name, struct dentry *parent)
1371 ++{
1372 ++ struct dentry *dentry;
1373 ++
1374 ++ dentry = debugfs_lookup(name, parent);
1375 ++ if (!dentry)
1376 ++ return;
1377 ++
1378 ++ debugfs_remove(dentry);
1379 ++ dput(dentry);
1380 ++}
1381 ++EXPORT_SYMBOL_GPL(debugfs_lookup_and_remove);
1382 ++
1383 + /**
1384 + * debugfs_rename - rename a file/directory in the debugfs filesystem
1385 + * @old_dir: a pointer to the parent dentry for the renamed object. This
1386 +diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
1387 +index 9d5b0a0a651f1..87fbaa84b0dfb 100644
1388 +--- a/include/linux/buffer_head.h
1389 ++++ b/include/linux/buffer_head.h
1390 +@@ -136,6 +136,17 @@ BUFFER_FNS(Defer_Completion, defer_completion)
1391 +
1392 + static __always_inline void set_buffer_uptodate(struct buffer_head *bh)
1393 + {
1394 ++ /*
1395 ++ * If somebody else already set this uptodate, they will
1396 ++ * have done the memory barrier, and a reader will thus
1397 ++ * see *some* valid buffer state.
1398 ++ *
1399 ++ * Any other serialization (with IO errors or whatever that
1400 ++ * might clear the bit) has to come from other state (eg BH_Lock).
1401 ++ */
1402 ++ if (test_bit(BH_Uptodate, &bh->b_state))
1403 ++ return;
1404 ++
1405 + /*
1406 + * make it consistent with folio_mark_uptodate
1407 + * pairs with smp_load_acquire in buffer_uptodate
1408 +diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
1409 +index 3bc1034c57e66..2a4638bb40338 100644
1410 +--- a/include/linux/debugfs.h
1411 ++++ b/include/linux/debugfs.h
1412 +@@ -85,6 +85,8 @@ struct dentry *debugfs_create_automount(const char *name,
1413 + void debugfs_remove(struct dentry *dentry);
1414 + void debugfs_remove_recursive(struct dentry *dentry);
1415 +
1416 ++void debugfs_lookup_and_remove(const char *name, struct dentry *parent);
1417 ++
1418 + const struct file_operations *debugfs_real_fops(const struct file *filp);
1419 +
1420 + int debugfs_file_get(struct dentry *dentry);
1421 +@@ -217,6 +219,10 @@ static inline void debugfs_remove(struct dentry *dentry)
1422 + static inline void debugfs_remove_recursive(struct dentry *dentry)
1423 + { }
1424 +
1425 ++static inline void debugfs_lookup_and_remove(const char *name,
1426 ++ struct dentry *parent)
1427 ++{ }
1428 ++
1429 + const struct file_operations *debugfs_real_fops(const struct file *filp);
1430 +
1431 + static inline int debugfs_file_get(struct dentry *dentry)
1432 +diff --git a/include/linux/platform_data/x86/pmc_atom.h b/include/linux/platform_data/x86/pmc_atom.h
1433 +index e4905fe69c381..e4cfcb6f16633 100644
1434 +--- a/include/linux/platform_data/x86/pmc_atom.h
1435 ++++ b/include/linux/platform_data/x86/pmc_atom.h
1436 +@@ -16,6 +16,8 @@
1437 + #ifndef PMC_ATOM_H
1438 + #define PMC_ATOM_H
1439 +
1440 ++#include <linux/bits.h>
1441 ++
1442 + /* ValleyView Power Control Unit PCI Device ID */
1443 + #define PCI_DEVICE_ID_VLV_PMC 0x0F1C
1444 + /* CherryTrail Power Control Unit PCI Device ID */
1445 +@@ -148,9 +150,9 @@
1446 + #define ACPI_MMIO_REG_LEN 0x100
1447 +
1448 + #define PM1_CNT 0x4
1449 +-#define SLEEP_TYPE_MASK 0xFFFFECFF
1450 ++#define SLEEP_TYPE_MASK GENMASK(12, 10)
1451 + #define SLEEP_TYPE_S5 0x1C00
1452 +-#define SLEEP_ENABLE 0x2000
1453 ++#define SLEEP_ENABLE BIT(13)
1454 +
1455 + extern int pmc_atom_read(int offset, u32 *value);
1456 + extern int pmc_atom_write(int offset, u32 value);
1457 +diff --git a/include/linux/usb.h b/include/linux/usb.h
1458 +index ff010d1fd1c78..744023c91404a 100644
1459 +--- a/include/linux/usb.h
1460 ++++ b/include/linux/usb.h
1461 +@@ -580,6 +580,7 @@ struct usb3_lpm_parameters {
1462 + * @level: number of USB hub ancestors
1463 + * @can_submit: URBs may be submitted
1464 + * @persist_enabled: USB_PERSIST enabled for this device
1465 ++ * @reset_in_progress: the device is being reset
1466 + * @have_langid: whether string_langid is valid
1467 + * @authorized: policy has said we can use it;
1468 + * (user space) policy determines if we authorize this device to be
1469 +@@ -664,6 +665,7 @@ struct usb_device {
1470 +
1471 + unsigned can_submit:1;
1472 + unsigned persist_enabled:1;
1473 ++ unsigned reset_in_progress:1;
1474 + unsigned have_langid:1;
1475 + unsigned authorized:1;
1476 + unsigned authenticated:1;
1477 +diff --git a/include/linux/usb/typec_dp.h b/include/linux/usb/typec_dp.h
1478 +index 55ae781d60a9e..92460ccd16ad3 100644
1479 +--- a/include/linux/usb/typec_dp.h
1480 ++++ b/include/linux/usb/typec_dp.h
1481 +@@ -68,6 +68,11 @@ enum {
1482 + #define DP_CAP_USB BIT(7)
1483 + #define DP_CAP_DFP_D_PIN_ASSIGN(_cap_) (((_cap_) & GENMASK(15, 8)) >> 8)
1484 + #define DP_CAP_UFP_D_PIN_ASSIGN(_cap_) (((_cap_) & GENMASK(23, 16)) >> 16)
1485 ++/* Get pin assignment taking plug & receptacle into consideration */
1486 ++#define DP_CAP_PIN_ASSIGN_UFP_D(_cap_) ((_cap_ & DP_CAP_RECEPTACLE) ? \
1487 ++ DP_CAP_UFP_D_PIN_ASSIGN(_cap_) : DP_CAP_DFP_D_PIN_ASSIGN(_cap_))
1488 ++#define DP_CAP_PIN_ASSIGN_DFP_D(_cap_) ((_cap_ & DP_CAP_RECEPTACLE) ? \
1489 ++ DP_CAP_DFP_D_PIN_ASSIGN(_cap_) : DP_CAP_UFP_D_PIN_ASSIGN(_cap_))
1490 +
1491 + /* DisplayPort Status Update VDO bits */
1492 + #define DP_STATUS_CONNECTION(_status_) ((_status_) & 3)
1493 +diff --git a/kernel/kprobes.c b/kernel/kprobes.c
1494 +index b2fcad8635bcf..b2f01e61f0eec 100644
1495 +--- a/kernel/kprobes.c
1496 ++++ b/kernel/kprobes.c
1497 +@@ -1568,6 +1568,7 @@ static int check_kprobe_address_safe(struct kprobe *p,
1498 + /* Ensure it is not in reserved area nor out of text */
1499 + if (!(core_kernel_text((unsigned long) p->addr) ||
1500 + is_module_text_address((unsigned long) p->addr)) ||
1501 ++ in_gate_area_no_mm((unsigned long) p->addr) ||
1502 + within_kprobe_blacklist((unsigned long) p->addr) ||
1503 + jump_label_text_reserved(p->addr, p->addr) ||
1504 + find_bug((unsigned long)p->addr)) {
1505 +diff --git a/mm/kmemleak.c b/mm/kmemleak.c
1506 +index 639acbb91fd53..f54734abf9466 100644
1507 +--- a/mm/kmemleak.c
1508 ++++ b/mm/kmemleak.c
1509 +@@ -1196,7 +1196,7 @@ EXPORT_SYMBOL(kmemleak_no_scan);
1510 + void __ref kmemleak_alloc_phys(phys_addr_t phys, size_t size, int min_count,
1511 + gfp_t gfp)
1512 + {
1513 +- if (PHYS_PFN(phys) >= min_low_pfn && PHYS_PFN(phys) < max_low_pfn)
1514 ++ if (!IS_ENABLED(CONFIG_HIGHMEM) || PHYS_PFN(phys) < max_low_pfn)
1515 + kmemleak_alloc(__va(phys), size, min_count, gfp);
1516 + }
1517 + EXPORT_SYMBOL(kmemleak_alloc_phys);
1518 +@@ -1210,7 +1210,7 @@ EXPORT_SYMBOL(kmemleak_alloc_phys);
1519 + */
1520 + void __ref kmemleak_free_part_phys(phys_addr_t phys, size_t size)
1521 + {
1522 +- if (PHYS_PFN(phys) >= min_low_pfn && PHYS_PFN(phys) < max_low_pfn)
1523 ++ if (!IS_ENABLED(CONFIG_HIGHMEM) || PHYS_PFN(phys) < max_low_pfn)
1524 + kmemleak_free_part(__va(phys), size);
1525 + }
1526 + EXPORT_SYMBOL(kmemleak_free_part_phys);
1527 +@@ -1222,7 +1222,7 @@ EXPORT_SYMBOL(kmemleak_free_part_phys);
1528 + */
1529 + void __ref kmemleak_not_leak_phys(phys_addr_t phys)
1530 + {
1531 +- if (PHYS_PFN(phys) >= min_low_pfn && PHYS_PFN(phys) < max_low_pfn)
1532 ++ if (!IS_ENABLED(CONFIG_HIGHMEM) || PHYS_PFN(phys) < max_low_pfn)
1533 + kmemleak_not_leak(__va(phys));
1534 + }
1535 + EXPORT_SYMBOL(kmemleak_not_leak_phys);
1536 +@@ -1234,7 +1234,7 @@ EXPORT_SYMBOL(kmemleak_not_leak_phys);
1537 + */
1538 + void __ref kmemleak_ignore_phys(phys_addr_t phys)
1539 + {
1540 +- if (PHYS_PFN(phys) >= min_low_pfn && PHYS_PFN(phys) < max_low_pfn)
1541 ++ if (!IS_ENABLED(CONFIG_HIGHMEM) || PHYS_PFN(phys) < max_low_pfn)
1542 + kmemleak_ignore(__va(phys));
1543 + }
1544 + EXPORT_SYMBOL(kmemleak_ignore_phys);
1545 +diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
1546 +index 55c7cdf5e7b83..35642dc96852a 100644
1547 +--- a/net/bridge/br_netfilter_hooks.c
1548 ++++ b/net/bridge/br_netfilter_hooks.c
1549 +@@ -385,6 +385,7 @@ static int br_nf_pre_routing_finish(struct net *net, struct sock *sk, struct sk_
1550 + /* - Bridged-and-DNAT'ed traffic doesn't
1551 + * require ip_forwarding. */
1552 + if (rt->dst.dev == dev) {
1553 ++ skb_dst_drop(skb);
1554 + skb_dst_set(skb, &rt->dst);
1555 + goto bridged_dnat;
1556 + }
1557 +@@ -414,6 +415,7 @@ bridged_dnat:
1558 + kfree_skb(skb);
1559 + return 0;
1560 + }
1561 ++ skb_dst_drop(skb);
1562 + skb_dst_set_noref(skb, &rt->dst);
1563 + }
1564 +
1565 +diff --git a/net/bridge/br_netfilter_ipv6.c b/net/bridge/br_netfilter_ipv6.c
1566 +index 09d5e0c7b3ba4..995d86777e7cb 100644
1567 +--- a/net/bridge/br_netfilter_ipv6.c
1568 ++++ b/net/bridge/br_netfilter_ipv6.c
1569 +@@ -201,6 +201,7 @@ static int br_nf_pre_routing_finish_ipv6(struct net *net, struct sock *sk, struc
1570 + kfree_skb(skb);
1571 + return 0;
1572 + }
1573 ++ skb_dst_drop(skb);
1574 + skb_dst_set_noref(skb, &rt->dst);
1575 + }
1576 +
1577 +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
1578 +index e1d065ea5a158..aac5d5b739268 100644
1579 +--- a/net/ipv4/tcp_input.c
1580 ++++ b/net/ipv4/tcp_input.c
1581 +@@ -2372,6 +2372,21 @@ static inline bool tcp_may_undo(const struct tcp_sock *tp)
1582 + return tp->undo_marker && (!tp->undo_retrans || tcp_packet_delayed(tp));
1583 + }
1584 +
1585 ++static bool tcp_is_non_sack_preventing_reopen(struct sock *sk)
1586 ++{
1587 ++ struct tcp_sock *tp = tcp_sk(sk);
1588 ++
1589 ++ if (tp->snd_una == tp->high_seq && tcp_is_reno(tp)) {
1590 ++ /* Hold old state until something *above* high_seq
1591 ++ * is ACKed. For Reno it is MUST to prevent false
1592 ++ * fast retransmits (RFC2582). SACK TCP is safe. */
1593 ++ if (!tcp_any_retrans_done(sk))
1594 ++ tp->retrans_stamp = 0;
1595 ++ return true;
1596 ++ }
1597 ++ return false;
1598 ++}
1599 ++
1600 + /* People celebrate: "We love our President!" */
1601 + static bool tcp_try_undo_recovery(struct sock *sk)
1602 + {
1603 +@@ -2394,14 +2409,8 @@ static bool tcp_try_undo_recovery(struct sock *sk)
1604 + } else if (tp->rack.reo_wnd_persist) {
1605 + tp->rack.reo_wnd_persist--;
1606 + }
1607 +- if (tp->snd_una == tp->high_seq && tcp_is_reno(tp)) {
1608 +- /* Hold old state until something *above* high_seq
1609 +- * is ACKed. For Reno it is MUST to prevent false
1610 +- * fast retransmits (RFC2582). SACK TCP is safe. */
1611 +- if (!tcp_any_retrans_done(sk))
1612 +- tp->retrans_stamp = 0;
1613 ++ if (tcp_is_non_sack_preventing_reopen(sk))
1614 + return true;
1615 +- }
1616 + tcp_set_ca_state(sk, TCP_CA_Open);
1617 + tp->is_sack_reneg = 0;
1618 + return false;
1619 +@@ -2437,6 +2446,8 @@ static bool tcp_try_undo_loss(struct sock *sk, bool frto_undo)
1620 + NET_INC_STATS(sock_net(sk),
1621 + LINUX_MIB_TCPSPURIOUSRTOS);
1622 + inet_csk(sk)->icsk_retransmits = 0;
1623 ++ if (tcp_is_non_sack_preventing_reopen(sk))
1624 ++ return true;
1625 + if (frto_undo || tcp_is_sack(tp)) {
1626 + tcp_set_ca_state(sk, TCP_CA_Open);
1627 + tp->is_sack_reneg = 0;
1628 +@@ -3468,11 +3479,11 @@ static void tcp_send_challenge_ack(struct sock *sk, const struct sk_buff *skb)
1629 +
1630 + /* Then check host-wide RFC 5961 rate limit. */
1631 + now = jiffies / HZ;
1632 +- if (now != challenge_timestamp) {
1633 ++ if (now != READ_ONCE(challenge_timestamp)) {
1634 + u32 ack_limit = READ_ONCE(net->ipv4.sysctl_tcp_challenge_ack_limit);
1635 + u32 half = (ack_limit + 1) >> 1;
1636 +
1637 +- challenge_timestamp = now;
1638 ++ WRITE_ONCE(challenge_timestamp, now);
1639 + WRITE_ONCE(challenge_count, half + prandom_u32_max(ack_limit));
1640 + }
1641 + count = READ_ONCE(challenge_count);
1642 +diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c
1643 +index 9b2f272ca1649..89d55770ac74b 100644
1644 +--- a/net/ipv6/seg6.c
1645 ++++ b/net/ipv6/seg6.c
1646 +@@ -130,6 +130,11 @@ static int seg6_genl_sethmac(struct sk_buff *skb, struct genl_info *info)
1647 + goto out_unlock;
1648 + }
1649 +
1650 ++ if (slen > nla_len(info->attrs[SEG6_ATTR_SECRET])) {
1651 ++ err = -EINVAL;
1652 ++ goto out_unlock;
1653 ++ }
1654 ++
1655 + if (hinfo) {
1656 + err = seg6_hmac_info_del(net, hmackeyid);
1657 + if (err)
1658 +diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
1659 +index b919db02c7f9e..ef2543a4c1fc5 100644
1660 +--- a/net/kcm/kcmsock.c
1661 ++++ b/net/kcm/kcmsock.c
1662 +@@ -1412,12 +1412,6 @@ static int kcm_attach(struct socket *sock, struct socket *csock,
1663 + psock->sk = csk;
1664 + psock->bpf_prog = prog;
1665 +
1666 +- err = strp_init(&psock->strp, csk, &cb);
1667 +- if (err) {
1668 +- kmem_cache_free(kcm_psockp, psock);
1669 +- goto out;
1670 +- }
1671 +-
1672 + write_lock_bh(&csk->sk_callback_lock);
1673 +
1674 + /* Check if sk_user_data is aready by KCM or someone else.
1675 +@@ -1425,13 +1419,18 @@ static int kcm_attach(struct socket *sock, struct socket *csock,
1676 + */
1677 + if (csk->sk_user_data) {
1678 + write_unlock_bh(&csk->sk_callback_lock);
1679 +- strp_stop(&psock->strp);
1680 +- strp_done(&psock->strp);
1681 + kmem_cache_free(kcm_psockp, psock);
1682 + err = -EALREADY;
1683 + goto out;
1684 + }
1685 +
1686 ++ err = strp_init(&psock->strp, csk, &cb);
1687 ++ if (err) {
1688 ++ write_unlock_bh(&csk->sk_callback_lock);
1689 ++ kmem_cache_free(kcm_psockp, psock);
1690 ++ goto out;
1691 ++ }
1692 ++
1693 + psock->save_data_ready = csk->sk_data_ready;
1694 + psock->save_write_space = csk->sk_write_space;
1695 + psock->save_state_change = csk->sk_state_change;
1696 +diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
1697 +index fa13eef25f2c9..38383b7e44190 100644
1698 +--- a/net/mac80211/ibss.c
1699 ++++ b/net/mac80211/ibss.c
1700 +@@ -544,6 +544,10 @@ int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata)
1701 +
1702 + sdata_assert_lock(sdata);
1703 +
1704 ++ /* When not connected/joined, sending CSA doesn't make sense. */
1705 ++ if (ifibss->state != IEEE80211_IBSS_MLME_JOINED)
1706 ++ return -ENOLINK;
1707 ++
1708 + /* update cfg80211 bss information with the new channel */
1709 + if (!is_zero_ether_addr(ifibss->bssid)) {
1710 + cbss = cfg80211_get_bss(sdata->local->hw.wiphy,
1711 +diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c
1712 +index 4dcf6e18563a6..060ccd0e14ce7 100644
1713 +--- a/net/mac802154/rx.c
1714 ++++ b/net/mac802154/rx.c
1715 +@@ -52,7 +52,7 @@ ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata,
1716 +
1717 + switch (mac_cb(skb)->dest.mode) {
1718 + case IEEE802154_ADDR_NONE:
1719 +- if (mac_cb(skb)->dest.mode != IEEE802154_ADDR_NONE)
1720 ++ if (hdr->source.mode != IEEE802154_ADDR_NONE)
1721 + /* FIXME: check if we are PAN coordinator */
1722 + skb->pkt_type = PACKET_OTHERHOST;
1723 + else
1724 +diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c
1725 +index 4099f4d79bae7..b7436935b57d0 100644
1726 +--- a/net/netfilter/nf_conntrack_irc.c
1727 ++++ b/net/netfilter/nf_conntrack_irc.c
1728 +@@ -187,8 +187,9 @@ static int help(struct sk_buff *skb, unsigned int protoff,
1729 +
1730 + /* dcc_ip can be the internal OR external (NAT'ed) IP */
1731 + tuple = &ct->tuplehash[dir].tuple;
1732 +- if (tuple->src.u3.ip != dcc_ip &&
1733 +- tuple->dst.u3.ip != dcc_ip) {
1734 ++ if ((tuple->src.u3.ip != dcc_ip &&
1735 ++ ct->tuplehash[!dir].tuple.dst.u3.ip != dcc_ip) ||
1736 ++ dcc_port == 0) {
1737 + net_warn_ratelimited("Forged DCC command from %pI4: %pI4:%u\n",
1738 + &tuple->src.u3.ip,
1739 + &dcc_ip, dcc_port);
1740 +diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c
1741 +index 81d205acb1b6a..a8ef8efa62fc0 100644
1742 +--- a/net/sched/sch_sfb.c
1743 ++++ b/net/sched/sch_sfb.c
1744 +@@ -139,15 +139,15 @@ static void increment_one_qlen(u32 sfbhash, u32 slot, struct sfb_sched_data *q)
1745 + }
1746 + }
1747 +
1748 +-static void increment_qlen(const struct sk_buff *skb, struct sfb_sched_data *q)
1749 ++static void increment_qlen(const struct sfb_skb_cb *cb, struct sfb_sched_data *q)
1750 + {
1751 + u32 sfbhash;
1752 +
1753 +- sfbhash = sfb_hash(skb, 0);
1754 ++ sfbhash = cb->hashes[0];
1755 + if (sfbhash)
1756 + increment_one_qlen(sfbhash, 0, q);
1757 +
1758 +- sfbhash = sfb_hash(skb, 1);
1759 ++ sfbhash = cb->hashes[1];
1760 + if (sfbhash)
1761 + increment_one_qlen(sfbhash, 1, q);
1762 + }
1763 +@@ -285,8 +285,10 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch,
1764 + {
1765 +
1766 + struct sfb_sched_data *q = qdisc_priv(sch);
1767 ++ unsigned int len = qdisc_pkt_len(skb);
1768 + struct Qdisc *child = q->qdisc;
1769 + struct tcf_proto *fl;
1770 ++ struct sfb_skb_cb cb;
1771 + int i;
1772 + u32 p_min = ~0;
1773 + u32 minqlen = ~0;
1774 +@@ -403,11 +405,12 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch,
1775 + }
1776 +
1777 + enqueue:
1778 ++ memcpy(&cb, sfb_skb_cb(skb), sizeof(cb));
1779 + ret = qdisc_enqueue(skb, child, to_free);
1780 + if (likely(ret == NET_XMIT_SUCCESS)) {
1781 +- qdisc_qstats_backlog_inc(sch, skb);
1782 ++ sch->qstats.backlog += len;
1783 + sch->q.qlen++;
1784 +- increment_qlen(skb, q);
1785 ++ increment_qlen(&cb, q);
1786 + } else if (net_xmit_drop_count(ret)) {
1787 + q->stats.childdrop++;
1788 + qdisc_qstats_drop(sch);
1789 +diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
1790 +index 4c904ab29e0e6..dcd00b514c3f9 100644
1791 +--- a/net/smc/af_smc.c
1792 ++++ b/net/smc/af_smc.c
1793 +@@ -1031,7 +1031,6 @@ static void smc_listen_out_connected(struct smc_sock *new_smc)
1794 + {
1795 + struct sock *newsmcsk = &new_smc->sk;
1796 +
1797 +- sk_refcnt_debug_inc(newsmcsk);
1798 + if (newsmcsk->sk_state == SMC_INIT)
1799 + newsmcsk->sk_state = SMC_ACTIVE;
1800 +
1801 +diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
1802 +index d05fa7c36d001..b1abf4848bbc7 100644
1803 +--- a/net/sunrpc/xprt.c
1804 ++++ b/net/sunrpc/xprt.c
1805 +@@ -1550,9 +1550,9 @@ static void xprt_destroy(struct rpc_xprt *xprt)
1806 + * is cleared. We use ->transport_lock to ensure the mod_timer()
1807 + * can only run *before* del_time_sync(), never after.
1808 + */
1809 +- spin_lock(&xprt->transport_lock);
1810 ++ spin_lock_bh(&xprt->transport_lock);
1811 + del_timer_sync(&xprt->timer);
1812 +- spin_unlock(&xprt->transport_lock);
1813 ++ spin_unlock_bh(&xprt->transport_lock);
1814 +
1815 + /*
1816 + * Destroy sockets etc from the system workqueue so they can
1817 +diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
1818 +index 7b6c1c5c30dc8..0268857a3cfed 100644
1819 +--- a/net/tipc/monitor.c
1820 ++++ b/net/tipc/monitor.c
1821 +@@ -130,7 +130,7 @@ static void map_set(u64 *up_map, int i, unsigned int v)
1822 +
1823 + static int map_get(u64 up_map, int i)
1824 + {
1825 +- return (up_map & (1 << i)) >> i;
1826 ++ return (up_map & (1ULL << i)) >> i;
1827 + }
1828 +
1829 + static struct tipc_peer *peer_prev(struct tipc_peer *peer)
1830 +diff --git a/net/wireless/debugfs.c b/net/wireless/debugfs.c
1831 +index 30fc6eb352bcc..e6410487e25da 100644
1832 +--- a/net/wireless/debugfs.c
1833 ++++ b/net/wireless/debugfs.c
1834 +@@ -68,9 +68,10 @@ static ssize_t ht40allow_map_read(struct file *file,
1835 + {
1836 + struct wiphy *wiphy = file->private_data;
1837 + char *buf;
1838 +- unsigned int offset = 0, buf_size = PAGE_SIZE, i, r;
1839 ++ unsigned int offset = 0, buf_size = PAGE_SIZE, i;
1840 + enum nl80211_band band;
1841 + struct ieee80211_supported_band *sband;
1842 ++ ssize_t r;
1843 +
1844 + buf = kzalloc(buf_size, GFP_KERNEL);
1845 + if (!buf)
1846 +diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c
1847 +index b7bef25b34cca..838c3c8b403cb 100644
1848 +--- a/sound/core/seq/oss/seq_oss_midi.c
1849 ++++ b/sound/core/seq/oss/seq_oss_midi.c
1850 +@@ -280,7 +280,9 @@ snd_seq_oss_midi_clear_all(void)
1851 + void
1852 + snd_seq_oss_midi_setup(struct seq_oss_devinfo *dp)
1853 + {
1854 ++ spin_lock_irq(&register_lock);
1855 + dp->max_mididev = max_midi_devs;
1856 ++ spin_unlock_irq(&register_lock);
1857 + }
1858 +
1859 + /*
1860 +diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
1861 +index aaf9c419c3dde..96cd8b7d790ea 100644
1862 +--- a/sound/core/seq/seq_clientmgr.c
1863 ++++ b/sound/core/seq/seq_clientmgr.c
1864 +@@ -136,13 +136,13 @@ struct snd_seq_client *snd_seq_client_use_ptr(int clientid)
1865 + spin_unlock_irqrestore(&clients_lock, flags);
1866 + #ifdef CONFIG_MODULES
1867 + if (!in_interrupt()) {
1868 +- static char client_requested[SNDRV_SEQ_GLOBAL_CLIENTS];
1869 +- static char card_requested[SNDRV_CARDS];
1870 ++ static DECLARE_BITMAP(client_requested, SNDRV_SEQ_GLOBAL_CLIENTS);
1871 ++ static DECLARE_BITMAP(card_requested, SNDRV_CARDS);
1872 ++
1873 + if (clientid < SNDRV_SEQ_GLOBAL_CLIENTS) {
1874 + int idx;
1875 +
1876 +- if (!client_requested[clientid]) {
1877 +- client_requested[clientid] = 1;
1878 ++ if (!test_and_set_bit(clientid, client_requested)) {
1879 + for (idx = 0; idx < 15; idx++) {
1880 + if (seq_client_load[idx] < 0)
1881 + break;
1882 +@@ -157,10 +157,8 @@ struct snd_seq_client *snd_seq_client_use_ptr(int clientid)
1883 + int card = (clientid - SNDRV_SEQ_GLOBAL_CLIENTS) /
1884 + SNDRV_SEQ_CLIENTS_PER_CARD;
1885 + if (card < snd_ecards_limit) {
1886 +- if (! card_requested[card]) {
1887 +- card_requested[card] = 1;
1888 ++ if (!test_and_set_bit(card, card_requested))
1889 + snd_request_card(card);
1890 +- }
1891 + snd_seq_device_load_drivers();
1892 + }
1893 + }
1894 +diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
1895 +index 3c65e52b014c1..1948d064fc953 100644
1896 +--- a/sound/drivers/aloop.c
1897 ++++ b/sound/drivers/aloop.c
1898 +@@ -477,17 +477,18 @@ static unsigned int loopback_pos_update(struct loopback_cable *cable)
1899 + cable->streams[SNDRV_PCM_STREAM_PLAYBACK];
1900 + struct loopback_pcm *dpcm_capt =
1901 + cable->streams[SNDRV_PCM_STREAM_CAPTURE];
1902 +- unsigned long delta_play = 0, delta_capt = 0;
1903 ++ unsigned long delta_play = 0, delta_capt = 0, cur_jiffies;
1904 + unsigned int running, count1, count2;
1905 +
1906 ++ cur_jiffies = jiffies;
1907 + running = cable->running ^ cable->pause;
1908 + if (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) {
1909 +- delta_play = jiffies - dpcm_play->last_jiffies;
1910 ++ delta_play = cur_jiffies - dpcm_play->last_jiffies;
1911 + dpcm_play->last_jiffies += delta_play;
1912 + }
1913 +
1914 + if (running & (1 << SNDRV_PCM_STREAM_CAPTURE)) {
1915 +- delta_capt = jiffies - dpcm_capt->last_jiffies;
1916 ++ delta_capt = cur_jiffies - dpcm_capt->last_jiffies;
1917 + dpcm_capt->last_jiffies += delta_capt;
1918 + }
1919 +
1920 +diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
1921 +index 9f2b6097f486d..623776b13f8da 100644
1922 +--- a/sound/pci/emu10k1/emupcm.c
1923 ++++ b/sound/pci/emu10k1/emupcm.c
1924 +@@ -137,7 +137,7 @@ static int snd_emu10k1_pcm_channel_alloc(struct snd_emu10k1_pcm * epcm, int voic
1925 + epcm->voices[0]->epcm = epcm;
1926 + if (voices > 1) {
1927 + for (i = 1; i < voices; i++) {
1928 +- epcm->voices[i] = &epcm->emu->voices[epcm->voices[0]->number + i];
1929 ++ epcm->voices[i] = &epcm->emu->voices[(epcm->voices[0]->number + i) % NUM_G];
1930 + epcm->voices[i]->epcm = epcm;
1931 + }
1932 + }
1933 +diff --git a/sound/usb/stream.c b/sound/usb/stream.c
1934 +index 9a950aaf5e356..1cfb30465df7d 100644
1935 +--- a/sound/usb/stream.c
1936 ++++ b/sound/usb/stream.c
1937 +@@ -1111,7 +1111,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no)
1938 + * Dallas DS4201 workaround: It presents 5 altsettings, but the last
1939 + * one misses syncpipe, and does not produce any sound.
1940 + */
1941 +- if (chip->usb_id == USB_ID(0x04fa, 0x4201))
1942 ++ if (chip->usb_id == USB_ID(0x04fa, 0x4201) && num >= 4)
1943 + num = 4;
1944 +
1945 + for (i = 0; i < num; i++) {