Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.10 commit in: /
Date: Thu, 08 Sep 2022 10:46:20
Message-Id: 1662633965.0fbc7d9ba25f59820591cc22dac9de945298103d.mpagano@gentoo
1 commit: 0fbc7d9ba25f59820591cc22dac9de945298103d
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 8 10:46:05 2022 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 8 10:46:05 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=0fbc7d9b
7
8 Linux patch 5.10.142
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1141_linux-5.10.142.patch | 2472 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2476 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 1da294a6..75caafbb 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -607,6 +607,10 @@ Patch: 1140_linux-5.10.141.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.10.141
23
24 +Patch: 1141_linux-5.10.142.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.10.142
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/1141_linux-5.10.142.patch b/1141_linux-5.10.142.patch
33 new file mode 100644
34 index 00000000..9c622600
35 --- /dev/null
36 +++ b/1141_linux-5.10.142.patch
37 @@ -0,0 +1,2472 @@
38 +diff --git a/Makefile b/Makefile
39 +index d2833d29d65f5..655fe095459b3 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 5
45 + PATCHLEVEL = 10
46 +-SUBLEVEL = 141
47 ++SUBLEVEL = 142
48 + EXTRAVERSION =
49 + NAME = Dare mighty things
50 +
51 +diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
52 +index d34276f3c495f..b0a3063ab1b1b 100644
53 +--- a/arch/powerpc/kernel/systbl.S
54 ++++ b/arch/powerpc/kernel/systbl.S
55 +@@ -18,6 +18,7 @@
56 + .p2align 3
57 + #define __SYSCALL(nr, entry) .8byte entry
58 + #else
59 ++ .p2align 2
60 + #define __SYSCALL(nr, entry) .long entry
61 + #endif
62 +
63 +diff --git a/arch/riscv/mm/pageattr.c b/arch/riscv/mm/pageattr.c
64 +index 19fecb362d815..09f6be19ba7b3 100644
65 +--- a/arch/riscv/mm/pageattr.c
66 ++++ b/arch/riscv/mm/pageattr.c
67 +@@ -118,10 +118,10 @@ static int __set_memory(unsigned long addr, int numpages, pgprot_t set_mask,
68 + if (!numpages)
69 + return 0;
70 +
71 +- mmap_read_lock(&init_mm);
72 ++ mmap_write_lock(&init_mm);
73 + ret = walk_page_range_novma(&init_mm, start, end, &pageattr_ops, NULL,
74 + &masks);
75 +- mmap_read_unlock(&init_mm);
76 ++ mmap_write_unlock(&init_mm);
77 +
78 + flush_tlb_kernel_range(start, end);
79 +
80 +diff --git a/arch/s390/include/asm/hugetlb.h b/arch/s390/include/asm/hugetlb.h
81 +index 60f9241e5e4a6..d3642fb634bd9 100644
82 +--- a/arch/s390/include/asm/hugetlb.h
83 ++++ b/arch/s390/include/asm/hugetlb.h
84 +@@ -28,9 +28,11 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
85 + static inline int prepare_hugepage_range(struct file *file,
86 + unsigned long addr, unsigned long len)
87 + {
88 +- if (len & ~HPAGE_MASK)
89 ++ struct hstate *h = hstate_file(file);
90 ++
91 ++ if (len & ~huge_page_mask(h))
92 + return -EINVAL;
93 +- if (addr & ~HPAGE_MASK)
94 ++ if (addr & ~huge_page_mask(h))
95 + return -EINVAL;
96 + return 0;
97 + }
98 +diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
99 +index 177ccfbda40a9..9505bdb0aa544 100644
100 +--- a/arch/s390/kernel/vmlinux.lds.S
101 ++++ b/arch/s390/kernel/vmlinux.lds.S
102 +@@ -122,6 +122,7 @@ SECTIONS
103 + /*
104 + * Table with the patch locations to undo expolines
105 + */
106 ++ . = ALIGN(4);
107 + .nospec_call_table : {
108 + __nospec_call_start = . ;
109 + *(.s390_indirect*)
110 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
111 +index 5f4f855bb3b10..c5a08ec348e6f 100644
112 +--- a/arch/x86/kvm/x86.c
113 ++++ b/arch/x86/kvm/x86.c
114 +@@ -1364,12 +1364,32 @@ static const u32 msr_based_features_all[] = {
115 + static u32 msr_based_features[ARRAY_SIZE(msr_based_features_all)];
116 + static unsigned int num_msr_based_features;
117 +
118 ++/*
119 ++ * Some IA32_ARCH_CAPABILITIES bits have dependencies on MSRs that KVM
120 ++ * does not yet virtualize. These include:
121 ++ * 10 - MISC_PACKAGE_CTRLS
122 ++ * 11 - ENERGY_FILTERING_CTL
123 ++ * 12 - DOITM
124 ++ * 18 - FB_CLEAR_CTRL
125 ++ * 21 - XAPIC_DISABLE_STATUS
126 ++ * 23 - OVERCLOCKING_STATUS
127 ++ */
128 ++
129 ++#define KVM_SUPPORTED_ARCH_CAP \
130 ++ (ARCH_CAP_RDCL_NO | ARCH_CAP_IBRS_ALL | ARCH_CAP_RSBA | \
131 ++ ARCH_CAP_SKIP_VMENTRY_L1DFLUSH | ARCH_CAP_SSB_NO | ARCH_CAP_MDS_NO | \
132 ++ ARCH_CAP_PSCHANGE_MC_NO | ARCH_CAP_TSX_CTRL_MSR | ARCH_CAP_TAA_NO | \
133 ++ ARCH_CAP_SBDR_SSDP_NO | ARCH_CAP_FBSDP_NO | ARCH_CAP_PSDP_NO | \
134 ++ ARCH_CAP_FB_CLEAR | ARCH_CAP_RRSBA | ARCH_CAP_PBRSB_NO)
135 ++
136 + static u64 kvm_get_arch_capabilities(void)
137 + {
138 + u64 data = 0;
139 +
140 +- if (boot_cpu_has(X86_FEATURE_ARCH_CAPABILITIES))
141 ++ if (boot_cpu_has(X86_FEATURE_ARCH_CAPABILITIES)) {
142 + rdmsrl(MSR_IA32_ARCH_CAPABILITIES, data);
143 ++ data &= KVM_SUPPORTED_ARCH_CAP;
144 ++ }
145 +
146 + /*
147 + * If nx_huge_pages is enabled, KVM's shadow paging will ensure that
148 +@@ -1417,9 +1437,6 @@ static u64 kvm_get_arch_capabilities(void)
149 + */
150 + }
151 +
152 +- /* Guests don't need to know "Fill buffer clear control" exists */
153 +- data &= ~ARCH_CAP_FB_CLEAR_CTRL;
154 +-
155 + return data;
156 + }
157 +
158 +diff --git a/drivers/android/binder.c b/drivers/android/binder.c
159 +index a5d5247c4f3e8..cfb1393a0891a 100644
160 +--- a/drivers/android/binder.c
161 ++++ b/drivers/android/binder.c
162 +@@ -1744,6 +1744,18 @@ static int binder_inc_ref_for_node(struct binder_proc *proc,
163 + }
164 + ret = binder_inc_ref_olocked(ref, strong, target_list);
165 + *rdata = ref->data;
166 ++ if (ret && ref == new_ref) {
167 ++ /*
168 ++ * Cleanup the failed reference here as the target
169 ++ * could now be dead and have already released its
170 ++ * references by now. Calling on the new reference
171 ++ * with strong=0 and a tmp_refs will not decrement
172 ++ * the node. The new_ref gets kfree'd below.
173 ++ */
174 ++ binder_cleanup_ref_olocked(new_ref);
175 ++ ref = NULL;
176 ++ }
177 ++
178 + binder_proc_unlock(proc);
179 + if (new_ref && ref != new_ref)
180 + /*
181 +diff --git a/drivers/base/dd.c b/drivers/base/dd.c
182 +index b5441741274bb..72ef9e83a84b2 100644
183 +--- a/drivers/base/dd.c
184 ++++ b/drivers/base/dd.c
185 +@@ -837,6 +837,11 @@ static int __device_attach_driver(struct device_driver *drv, void *_data)
186 + } else if (ret == -EPROBE_DEFER) {
187 + dev_dbg(dev, "Device match requests probe deferral\n");
188 + driver_deferred_probe_add(dev);
189 ++ /*
190 ++ * Device can't match with a driver right now, so don't attempt
191 ++ * to match or bind with other drivers on the bus.
192 ++ */
193 ++ return ret;
194 + } else if (ret < 0) {
195 + dev_dbg(dev, "Bus failed to match device: %d\n", ret);
196 + return ret;
197 +@@ -1076,6 +1081,11 @@ static int __driver_attach(struct device *dev, void *data)
198 + } else if (ret == -EPROBE_DEFER) {
199 + dev_dbg(dev, "Device match requests probe deferral\n");
200 + driver_deferred_probe_add(dev);
201 ++ /*
202 ++ * Driver could not match with device, but may match with
203 ++ * another device on the bus.
204 ++ */
205 ++ return 0;
206 + } else if (ret < 0) {
207 + dev_dbg(dev, "Bus failed to match device: %d\n", ret);
208 + return ret;
209 +diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
210 +index 040829e2d0162..5eff34767b775 100644
211 +--- a/drivers/block/xen-blkback/common.h
212 ++++ b/drivers/block/xen-blkback/common.h
213 +@@ -226,6 +226,9 @@ struct xen_vbd {
214 + sector_t size;
215 + unsigned int flush_support:1;
216 + unsigned int discard_secure:1;
217 ++ /* Connect-time cached feature_persistent parameter value */
218 ++ unsigned int feature_gnt_persistent_parm:1;
219 ++ /* Persistent grants feature negotiation result */
220 + unsigned int feature_gnt_persistent:1;
221 + unsigned int overflow_max_grants:1;
222 + };
223 +diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
224 +index 44782b15b9fdb..ddea362959318 100644
225 +--- a/drivers/block/xen-blkback/xenbus.c
226 ++++ b/drivers/block/xen-blkback/xenbus.c
227 +@@ -911,7 +911,7 @@ again:
228 + xen_blkbk_barrier(xbt, be, be->blkif->vbd.flush_support);
229 +
230 + err = xenbus_printf(xbt, dev->nodename, "feature-persistent", "%u",
231 +- be->blkif->vbd.feature_gnt_persistent);
232 ++ be->blkif->vbd.feature_gnt_persistent_parm);
233 + if (err) {
234 + xenbus_dev_fatal(dev, err, "writing %s/feature-persistent",
235 + dev->nodename);
236 +@@ -1089,7 +1089,9 @@ static int connect_ring(struct backend_info *be)
237 + return -ENOSYS;
238 + }
239 +
240 +- blkif->vbd.feature_gnt_persistent = feature_persistent &&
241 ++ blkif->vbd.feature_gnt_persistent_parm = feature_persistent;
242 ++ blkif->vbd.feature_gnt_persistent =
243 ++ blkif->vbd.feature_gnt_persistent_parm &&
244 + xenbus_read_unsigned(dev->otherend, "feature-persistent", 0);
245 +
246 + blkif->vbd.overflow_max_grants = 0;
247 +diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
248 +index 03e079a6f0721..9d5460f6e0ff1 100644
249 +--- a/drivers/block/xen-blkfront.c
250 ++++ b/drivers/block/xen-blkfront.c
251 +@@ -211,6 +211,9 @@ struct blkfront_info
252 + unsigned int feature_fua:1;
253 + unsigned int feature_discard:1;
254 + unsigned int feature_secdiscard:1;
255 ++ /* Connect-time cached feature_persistent parameter */
256 ++ unsigned int feature_persistent_parm:1;
257 ++ /* Persistent grants feature negotiation result */
258 + unsigned int feature_persistent:1;
259 + unsigned int bounce:1;
260 + unsigned int discard_granularity;
261 +@@ -1941,7 +1944,7 @@ again:
262 + goto abort_transaction;
263 + }
264 + err = xenbus_printf(xbt, dev->nodename, "feature-persistent", "%u",
265 +- info->feature_persistent);
266 ++ info->feature_persistent_parm);
267 + if (err)
268 + dev_warn(&dev->dev,
269 + "writing persistent grants feature to xenbus");
270 +@@ -2391,7 +2394,8 @@ static void blkfront_gather_backend_features(struct blkfront_info *info)
271 + if (xenbus_read_unsigned(info->xbdev->otherend, "feature-discard", 0))
272 + blkfront_setup_discard(info);
273 +
274 +- if (feature_persistent)
275 ++ info->feature_persistent_parm = feature_persistent;
276 ++ if (info->feature_persistent_parm)
277 + info->feature_persistent =
278 + !!xenbus_read_unsigned(info->xbdev->otherend,
279 + "feature-persistent", 0);
280 +diff --git a/drivers/clk/bcm/clk-raspberrypi.c b/drivers/clk/bcm/clk-raspberrypi.c
281 +index f89b9cfc43099..969227e2df215 100644
282 +--- a/drivers/clk/bcm/clk-raspberrypi.c
283 ++++ b/drivers/clk/bcm/clk-raspberrypi.c
284 +@@ -139,7 +139,7 @@ static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
285 + ret = raspberrypi_clock_property(rpi->firmware, data,
286 + RPI_FIRMWARE_GET_CLOCK_RATE, &val);
287 + if (ret)
288 +- return ret;
289 ++ return 0;
290 +
291 + return val;
292 + }
293 +@@ -156,7 +156,7 @@ static int raspberrypi_fw_set_rate(struct clk_hw *hw, unsigned long rate,
294 + ret = raspberrypi_clock_property(rpi->firmware, data,
295 + RPI_FIRMWARE_SET_CLOCK_RATE, &_rate);
296 + if (ret)
297 +- dev_err_ratelimited(rpi->dev, "Failed to change %s frequency: %d",
298 ++ dev_err_ratelimited(rpi->dev, "Failed to change %s frequency: %d\n",
299 + clk_hw_get_name(hw), ret);
300 +
301 + return ret;
302 +@@ -208,7 +208,7 @@ static struct clk_hw *raspberrypi_clk_register(struct raspberrypi_clk *rpi,
303 + RPI_FIRMWARE_GET_MIN_CLOCK_RATE,
304 + &min_rate);
305 + if (ret) {
306 +- dev_err(rpi->dev, "Failed to get clock %d min freq: %d",
307 ++ dev_err(rpi->dev, "Failed to get clock %d min freq: %d\n",
308 + id, ret);
309 + return ERR_PTR(ret);
310 + }
311 +@@ -251,8 +251,13 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi,
312 + struct rpi_firmware_get_clocks_response *clks;
313 + int ret;
314 +
315 ++ /*
316 ++ * The firmware doesn't guarantee that the last element of
317 ++ * RPI_FIRMWARE_GET_CLOCKS is zeroed. So allocate an additional
318 ++ * zero element as sentinel.
319 ++ */
320 + clks = devm_kcalloc(rpi->dev,
321 +- sizeof(*clks), RPI_FIRMWARE_NUM_CLK_ID,
322 ++ RPI_FIRMWARE_NUM_CLK_ID + 1, sizeof(*clks),
323 + GFP_KERNEL);
324 + if (!clks)
325 + return -ENOMEM;
326 +diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
327 +index 2e56cc0a3bce6..b355d3d40f63a 100644
328 +--- a/drivers/clk/clk.c
329 ++++ b/drivers/clk/clk.c
330 +@@ -846,10 +846,9 @@ static void clk_core_unprepare(struct clk_core *core)
331 + if (core->ops->unprepare)
332 + core->ops->unprepare(core->hw);
333 +
334 +- clk_pm_runtime_put(core);
335 +-
336 + trace_clk_unprepare_complete(core);
337 + clk_core_unprepare(core->parent);
338 ++ clk_pm_runtime_put(core);
339 + }
340 +
341 + static void clk_core_unprepare_lock(struct clk_core *core)
342 +diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
343 +index 957be5f69406a..3ad1a9e432c8a 100644
344 +--- a/drivers/gpio/gpio-pca953x.c
345 ++++ b/drivers/gpio/gpio-pca953x.c
346 +@@ -1162,7 +1162,9 @@ static int pca953x_suspend(struct device *dev)
347 + {
348 + struct pca953x_chip *chip = dev_get_drvdata(dev);
349 +
350 ++ mutex_lock(&chip->i2c_lock);
351 + regcache_cache_only(chip->regmap, true);
352 ++ mutex_unlock(&chip->i2c_lock);
353 +
354 + if (atomic_read(&chip->wakeup_path))
355 + device_set_wakeup_path(dev);
356 +@@ -1185,13 +1187,17 @@ static int pca953x_resume(struct device *dev)
357 + }
358 + }
359 +
360 ++ mutex_lock(&chip->i2c_lock);
361 + regcache_cache_only(chip->regmap, false);
362 + regcache_mark_dirty(chip->regmap);
363 + ret = pca953x_regcache_sync(dev);
364 +- if (ret)
365 ++ if (ret) {
366 ++ mutex_unlock(&chip->i2c_lock);
367 + return ret;
368 ++ }
369 +
370 + ret = regcache_sync(chip->regmap);
371 ++ mutex_unlock(&chip->i2c_lock);
372 + if (ret) {
373 + dev_err(dev, "Failed to restore register map: %d\n", ret);
374 + return ret;
375 +diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
376 +index 46beb155d835f..8eb1842f14cea 100644
377 +--- a/drivers/gpu/drm/i915/display/intel_quirks.c
378 ++++ b/drivers/gpu/drm/i915/display/intel_quirks.c
379 +@@ -156,6 +156,9 @@ static struct intel_quirk intel_quirks[] = {
380 + /* ASRock ITX*/
381 + { 0x3185, 0x1849, 0x2212, quirk_increase_ddi_disabled_time },
382 + { 0x3184, 0x1849, 0x2212, quirk_increase_ddi_disabled_time },
383 ++ /* ECS Liva Q2 */
384 ++ { 0x3185, 0x1019, 0xa94d, quirk_increase_ddi_disabled_time },
385 ++ { 0x3184, 0x1019, 0xa94d, quirk_increase_ddi_disabled_time },
386 + };
387 +
388 + void intel_init_quirks(struct drm_i915_private *i915)
389 +diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
390 +index 0b1ea29dcffac..606e6c315fe24 100644
391 +--- a/drivers/gpu/drm/i915/gvt/handlers.c
392 ++++ b/drivers/gpu/drm/i915/gvt/handlers.c
393 +@@ -660,7 +660,7 @@ static int update_fdi_rx_iir_status(struct intel_vgpu *vgpu,
394 + else if (FDI_RX_IMR_TO_PIPE(offset) != INVALID_INDEX)
395 + index = FDI_RX_IMR_TO_PIPE(offset);
396 + else {
397 +- gvt_vgpu_err("Unsupport registers %x\n", offset);
398 ++ gvt_vgpu_err("Unsupported registers %x\n", offset);
399 + return -EINVAL;
400 + }
401 +
402 +diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c
403 +index b9ca844ce2ad0..9fac55c24214a 100644
404 +--- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
405 ++++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c
406 +@@ -1205,7 +1205,7 @@ static int dp_ctrl_link_train_2(struct dp_ctrl_private *ctrl,
407 + if (ret)
408 + return ret;
409 +
410 +- dp_ctrl_train_pattern_set(ctrl, pattern | DP_RECOVERED_CLOCK_OUT_EN);
411 ++ dp_ctrl_train_pattern_set(ctrl, pattern);
412 +
413 + for (tries = 0; tries <= maximum_retries; tries++) {
414 + drm_dp_link_train_channel_eq_delay(ctrl->panel->dpcd);
415 +diff --git a/drivers/gpu/drm/msm/dsi/dsi_cfg.c b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
416 +index d255bea87ca41..73f066ef6f406 100644
417 +--- a/drivers/gpu/drm/msm/dsi/dsi_cfg.c
418 ++++ b/drivers/gpu/drm/msm/dsi/dsi_cfg.c
419 +@@ -117,7 +117,7 @@ static const char * const dsi_8996_bus_clk_names[] = {
420 + static const struct msm_dsi_config msm8996_dsi_cfg = {
421 + .io_offset = DSI_6G_REG_SHIFT,
422 + .reg_cfg = {
423 +- .num = 2,
424 ++ .num = 3,
425 + .regs = {
426 + {"vdda", 18160, 1 }, /* 1.25 V */
427 + {"vcca", 17000, 32 }, /* 0.925 V */
428 +@@ -156,7 +156,7 @@ static const char * const dsi_sdm660_bus_clk_names[] = {
429 + static const struct msm_dsi_config sdm660_dsi_cfg = {
430 + .io_offset = DSI_6G_REG_SHIFT,
431 + .reg_cfg = {
432 +- .num = 2,
433 ++ .num = 1,
434 + .regs = {
435 + {"vdda", 12560, 4 }, /* 1.2 V */
436 + },
437 +diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
438 +index e07986ab52c22..2e0be85ec3947 100644
439 +--- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
440 ++++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c
441 +@@ -345,7 +345,7 @@ int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing *timing,
442 + } else {
443 + timing->shared_timings.clk_pre =
444 + linear_inter(tmax, tmin, pcnt2, 0, false);
445 +- timing->shared_timings.clk_pre_inc_by_2 = 0;
446 ++ timing->shared_timings.clk_pre_inc_by_2 = 0;
447 + }
448 +
449 + timing->ta_go = 3;
450 +diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
451 +index 3ea4021f267cf..d96e435cc42b1 100644
452 +--- a/drivers/hwmon/gpio-fan.c
453 ++++ b/drivers/hwmon/gpio-fan.c
454 +@@ -391,6 +391,9 @@ static int gpio_fan_set_cur_state(struct thermal_cooling_device *cdev,
455 + if (!fan_data)
456 + return -EINVAL;
457 +
458 ++ if (state >= fan_data->num_speed)
459 ++ return -EINVAL;
460 ++
461 + set_fan_speed(fan_data, state);
462 + return 0;
463 + }
464 +diff --git a/drivers/iio/adc/ad7292.c b/drivers/iio/adc/ad7292.c
465 +index ab204e9199e99..3e6ece05854d8 100644
466 +--- a/drivers/iio/adc/ad7292.c
467 ++++ b/drivers/iio/adc/ad7292.c
468 +@@ -289,10 +289,8 @@ static int ad7292_probe(struct spi_device *spi)
469 +
470 + ret = devm_add_action_or_reset(&spi->dev,
471 + ad7292_regulator_disable, st);
472 +- if (ret) {
473 +- regulator_disable(st->reg);
474 ++ if (ret)
475 + return ret;
476 +- }
477 +
478 + ret = regulator_get_voltage(st->reg);
479 + if (ret < 0)
480 +diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c
481 +index e573da5397bb3..65278270a75ce 100644
482 +--- a/drivers/iio/adc/mcp3911.c
483 ++++ b/drivers/iio/adc/mcp3911.c
484 +@@ -38,8 +38,8 @@
485 + #define MCP3911_CHANNEL(x) (MCP3911_REG_CHANNEL0 + x * 3)
486 + #define MCP3911_OFFCAL(x) (MCP3911_REG_OFFCAL_CH0 + x * 6)
487 +
488 +-/* Internal voltage reference in uV */
489 +-#define MCP3911_INT_VREF_UV 1200000
490 ++/* Internal voltage reference in mV */
491 ++#define MCP3911_INT_VREF_MV 1200
492 +
493 + #define MCP3911_REG_READ(reg, id) ((((reg) << 1) | ((id) << 5) | (1 << 0)) & 0xff)
494 + #define MCP3911_REG_WRITE(reg, id) ((((reg) << 1) | ((id) << 5) | (0 << 0)) & 0xff)
495 +@@ -111,6 +111,8 @@ static int mcp3911_read_raw(struct iio_dev *indio_dev,
496 + if (ret)
497 + goto out;
498 +
499 ++ *val = sign_extend32(*val, 23);
500 ++
501 + ret = IIO_VAL_INT;
502 + break;
503 +
504 +@@ -135,11 +137,18 @@ static int mcp3911_read_raw(struct iio_dev *indio_dev,
505 +
506 + *val = ret / 1000;
507 + } else {
508 +- *val = MCP3911_INT_VREF_UV;
509 ++ *val = MCP3911_INT_VREF_MV;
510 + }
511 +
512 +- *val2 = 24;
513 +- ret = IIO_VAL_FRACTIONAL_LOG2;
514 ++ /*
515 ++ * For 24bit Conversion
516 ++ * Raw = ((Voltage)/(Vref) * 2^23 * Gain * 1.5
517 ++ * Voltage = Raw * (Vref)/(2^23 * Gain * 1.5)
518 ++ */
519 ++
520 ++ /* val2 = (2^23 * 1.5) */
521 ++ *val2 = 12582912;
522 ++ ret = IIO_VAL_FRACTIONAL;
523 + break;
524 + }
525 +
526 +diff --git a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c
527 +index f95a81b9fac72..2380546d79782 100644
528 +--- a/drivers/input/joystick/iforce/iforce-serio.c
529 ++++ b/drivers/input/joystick/iforce/iforce-serio.c
530 +@@ -39,7 +39,7 @@ static void iforce_serio_xmit(struct iforce *iforce)
531 +
532 + again:
533 + if (iforce->xmit.head == iforce->xmit.tail) {
534 +- clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
535 ++ iforce_clear_xmit_and_wake(iforce);
536 + spin_unlock_irqrestore(&iforce->xmit_lock, flags);
537 + return;
538 + }
539 +@@ -64,7 +64,7 @@ again:
540 + if (test_and_clear_bit(IFORCE_XMIT_AGAIN, iforce->xmit_flags))
541 + goto again;
542 +
543 +- clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
544 ++ iforce_clear_xmit_and_wake(iforce);
545 +
546 + spin_unlock_irqrestore(&iforce->xmit_lock, flags);
547 + }
548 +@@ -169,7 +169,7 @@ static irqreturn_t iforce_serio_irq(struct serio *serio,
549 + iforce_serio->cmd_response_len = iforce_serio->len;
550 +
551 + /* Signal that command is done */
552 +- wake_up(&iforce->wait);
553 ++ wake_up_all(&iforce->wait);
554 + } else if (likely(iforce->type)) {
555 + iforce_process_packet(iforce, iforce_serio->id,
556 + iforce_serio->data_in,
557 +diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c
558 +index ea58805c480fa..cba92bd590a8d 100644
559 +--- a/drivers/input/joystick/iforce/iforce-usb.c
560 ++++ b/drivers/input/joystick/iforce/iforce-usb.c
561 +@@ -30,7 +30,7 @@ static void __iforce_usb_xmit(struct iforce *iforce)
562 + spin_lock_irqsave(&iforce->xmit_lock, flags);
563 +
564 + if (iforce->xmit.head == iforce->xmit.tail) {
565 +- clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
566 ++ iforce_clear_xmit_and_wake(iforce);
567 + spin_unlock_irqrestore(&iforce->xmit_lock, flags);
568 + return;
569 + }
570 +@@ -58,9 +58,9 @@ static void __iforce_usb_xmit(struct iforce *iforce)
571 + XMIT_INC(iforce->xmit.tail, n);
572 +
573 + if ( (n=usb_submit_urb(iforce_usb->out, GFP_ATOMIC)) ) {
574 +- clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
575 + dev_warn(&iforce_usb->intf->dev,
576 + "usb_submit_urb failed %d\n", n);
577 ++ iforce_clear_xmit_and_wake(iforce);
578 + }
579 +
580 + /* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended.
581 +@@ -175,15 +175,15 @@ static void iforce_usb_out(struct urb *urb)
582 + struct iforce *iforce = &iforce_usb->iforce;
583 +
584 + if (urb->status) {
585 +- clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
586 + dev_dbg(&iforce_usb->intf->dev, "urb->status %d, exiting\n",
587 + urb->status);
588 ++ iforce_clear_xmit_and_wake(iforce);
589 + return;
590 + }
591 +
592 + __iforce_usb_xmit(iforce);
593 +
594 +- wake_up(&iforce->wait);
595 ++ wake_up_all(&iforce->wait);
596 + }
597 +
598 + static int iforce_usb_probe(struct usb_interface *intf,
599 +diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h
600 +index 6aa761ebbdf77..9ccb9107ccbef 100644
601 +--- a/drivers/input/joystick/iforce/iforce.h
602 ++++ b/drivers/input/joystick/iforce/iforce.h
603 +@@ -119,6 +119,12 @@ static inline int iforce_get_id_packet(struct iforce *iforce, u8 id,
604 + response_data, response_len);
605 + }
606 +
607 ++static inline void iforce_clear_xmit_and_wake(struct iforce *iforce)
608 ++{
609 ++ clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
610 ++ wake_up_all(&iforce->wait);
611 ++}
612 ++
613 + /* Public functions */
614 + /* iforce-main.c */
615 + int iforce_init_device(struct device *parent, u16 bustype,
616 +diff --git a/drivers/input/misc/rk805-pwrkey.c b/drivers/input/misc/rk805-pwrkey.c
617 +index 3fb64dbda1a21..76873aa005b41 100644
618 +--- a/drivers/input/misc/rk805-pwrkey.c
619 ++++ b/drivers/input/misc/rk805-pwrkey.c
620 +@@ -98,6 +98,7 @@ static struct platform_driver rk805_pwrkey_driver = {
621 + };
622 + module_platform_driver(rk805_pwrkey_driver);
623 +
624 ++MODULE_ALIAS("platform:rk805-pwrkey");
625 + MODULE_AUTHOR("Joseph Chen <chenjh@××××××××××.com>");
626 + MODULE_DESCRIPTION("RK805 PMIC Power Key driver");
627 + MODULE_LICENSE("GPL");
628 +diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
629 +index dbb5a4f44bda5..de4cf6eb5258b 100644
630 +--- a/drivers/media/rc/mceusb.c
631 ++++ b/drivers/media/rc/mceusb.c
632 +@@ -1416,42 +1416,37 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
633 + {
634 + int ret;
635 + struct device *dev = ir->dev;
636 +- char *data;
637 +-
638 +- data = kzalloc(USB_CTRL_MSG_SZ, GFP_KERNEL);
639 +- if (!data) {
640 +- dev_err(dev, "%s: memory allocation failed!", __func__);
641 +- return;
642 +- }
643 ++ char data[USB_CTRL_MSG_SZ];
644 +
645 + /*
646 + * This is a strange one. Windows issues a set address to the device
647 + * on the receive control pipe and expect a certain value pair back
648 + */
649 +- ret = usb_control_msg(ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0),
650 +- USB_REQ_SET_ADDRESS, USB_TYPE_VENDOR, 0, 0,
651 +- data, USB_CTRL_MSG_SZ, 3000);
652 ++ ret = usb_control_msg_recv(ir->usbdev, 0, USB_REQ_SET_ADDRESS,
653 ++ USB_DIR_IN | USB_TYPE_VENDOR,
654 ++ 0, 0, data, USB_CTRL_MSG_SZ, 3000,
655 ++ GFP_KERNEL);
656 + dev_dbg(dev, "set address - ret = %d", ret);
657 + dev_dbg(dev, "set address - data[0] = %d, data[1] = %d",
658 + data[0], data[1]);
659 +
660 + /* set feature: bit rate 38400 bps */
661 +- ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
662 +- USB_REQ_SET_FEATURE, USB_TYPE_VENDOR,
663 +- 0xc04e, 0x0000, NULL, 0, 3000);
664 ++ ret = usb_control_msg_send(ir->usbdev, 0,
665 ++ USB_REQ_SET_FEATURE, USB_TYPE_VENDOR,
666 ++ 0xc04e, 0x0000, NULL, 0, 3000, GFP_KERNEL);
667 +
668 + dev_dbg(dev, "set feature - ret = %d", ret);
669 +
670 + /* bRequest 4: set char length to 8 bits */
671 +- ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
672 +- 4, USB_TYPE_VENDOR,
673 +- 0x0808, 0x0000, NULL, 0, 3000);
674 ++ ret = usb_control_msg_send(ir->usbdev, 0,
675 ++ 4, USB_TYPE_VENDOR,
676 ++ 0x0808, 0x0000, NULL, 0, 3000, GFP_KERNEL);
677 + dev_dbg(dev, "set char length - retB = %d", ret);
678 +
679 + /* bRequest 2: set handshaking to use DTR/DSR */
680 +- ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
681 +- 2, USB_TYPE_VENDOR,
682 +- 0x0000, 0x0100, NULL, 0, 3000);
683 ++ ret = usb_control_msg_send(ir->usbdev, 0,
684 ++ 2, USB_TYPE_VENDOR,
685 ++ 0x0000, 0x0100, NULL, 0, 3000, GFP_KERNEL);
686 + dev_dbg(dev, "set handshake - retC = %d", ret);
687 +
688 + /* device resume */
689 +@@ -1459,8 +1454,6 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
690 +
691 + /* get hw/sw revision? */
692 + mce_command_out(ir, GET_REVISION, sizeof(GET_REVISION));
693 +-
694 +- kfree(data);
695 + }
696 +
697 + static void mceusb_gen2_init(struct mceusb_dev *ir)
698 +diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
699 +index 65f24b6150aa3..2c3142b4b5dd7 100644
700 +--- a/drivers/misc/fastrpc.c
701 ++++ b/drivers/misc/fastrpc.c
702 +@@ -1548,7 +1548,12 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
703 + of_property_read_u32(dev->of_node, "qcom,nsessions", &sessions);
704 +
705 + spin_lock_irqsave(&cctx->lock, flags);
706 +- sess = &cctx->session[cctx->sesscount];
707 ++ if (cctx->sesscount >= FASTRPC_MAX_SESSIONS) {
708 ++ dev_err(&pdev->dev, "too many sessions\n");
709 ++ spin_unlock_irqrestore(&cctx->lock, flags);
710 ++ return -ENOSPC;
711 ++ }
712 ++ sess = &cctx->session[cctx->sesscount++];
713 + sess->used = false;
714 + sess->valid = true;
715 + sess->dev = dev;
716 +@@ -1561,13 +1566,12 @@ static int fastrpc_cb_probe(struct platform_device *pdev)
717 + struct fastrpc_session_ctx *dup_sess;
718 +
719 + for (i = 1; i < sessions; i++) {
720 +- if (cctx->sesscount++ >= FASTRPC_MAX_SESSIONS)
721 ++ if (cctx->sesscount >= FASTRPC_MAX_SESSIONS)
722 + break;
723 +- dup_sess = &cctx->session[cctx->sesscount];
724 ++ dup_sess = &cctx->session[cctx->sesscount++];
725 + memcpy(dup_sess, sess, sizeof(*dup_sess));
726 + }
727 + }
728 +- cctx->sesscount++;
729 + spin_unlock_irqrestore(&cctx->lock, flags);
730 + rc = dma_set_mask(dev, DMA_BIT_MASK(32));
731 + if (rc) {
732 +diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
733 +index bac343a8d569a..0b09cdaaeb6c1 100644
734 +--- a/drivers/mmc/core/sd.c
735 ++++ b/drivers/mmc/core/sd.c
736 +@@ -1107,7 +1107,7 @@ retry:
737 + mmc_remove_card(card);
738 + goto retry;
739 + }
740 +- goto done;
741 ++ goto cont;
742 + }
743 + }
744 +
745 +@@ -1143,7 +1143,7 @@ retry:
746 + mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
747 + }
748 + }
749 +-
750 ++cont:
751 + if (host->cqe_ops && !host->cqe_enabled) {
752 + err = host->cqe_ops->cqe_enable(host, card);
753 + if (!err) {
754 +@@ -1161,7 +1161,7 @@ retry:
755 + err = -EINVAL;
756 + goto free_card;
757 + }
758 +-done:
759 ++
760 + host->card = card;
761 + return 0;
762 +
763 +diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c
764 +index d11fcfd927c0b..85ea073b742fb 100644
765 +--- a/drivers/net/ethernet/cortina/gemini.c
766 ++++ b/drivers/net/ethernet/cortina/gemini.c
767 +@@ -1920,7 +1920,7 @@ static void gmac_get_stats64(struct net_device *netdev,
768 +
769 + /* Racing with RX NAPI */
770 + do {
771 +- start = u64_stats_fetch_begin(&port->rx_stats_syncp);
772 ++ start = u64_stats_fetch_begin_irq(&port->rx_stats_syncp);
773 +
774 + stats->rx_packets = port->stats.rx_packets;
775 + stats->rx_bytes = port->stats.rx_bytes;
776 +@@ -1932,11 +1932,11 @@ static void gmac_get_stats64(struct net_device *netdev,
777 + stats->rx_crc_errors = port->stats.rx_crc_errors;
778 + stats->rx_frame_errors = port->stats.rx_frame_errors;
779 +
780 +- } while (u64_stats_fetch_retry(&port->rx_stats_syncp, start));
781 ++ } while (u64_stats_fetch_retry_irq(&port->rx_stats_syncp, start));
782 +
783 + /* Racing with MIB and TX completion interrupts */
784 + do {
785 +- start = u64_stats_fetch_begin(&port->ir_stats_syncp);
786 ++ start = u64_stats_fetch_begin_irq(&port->ir_stats_syncp);
787 +
788 + stats->tx_errors = port->stats.tx_errors;
789 + stats->tx_packets = port->stats.tx_packets;
790 +@@ -1946,15 +1946,15 @@ static void gmac_get_stats64(struct net_device *netdev,
791 + stats->rx_missed_errors = port->stats.rx_missed_errors;
792 + stats->rx_fifo_errors = port->stats.rx_fifo_errors;
793 +
794 +- } while (u64_stats_fetch_retry(&port->ir_stats_syncp, start));
795 ++ } while (u64_stats_fetch_retry_irq(&port->ir_stats_syncp, start));
796 +
797 + /* Racing with hard_start_xmit */
798 + do {
799 +- start = u64_stats_fetch_begin(&port->tx_stats_syncp);
800 ++ start = u64_stats_fetch_begin_irq(&port->tx_stats_syncp);
801 +
802 + stats->tx_dropped = port->stats.tx_dropped;
803 +
804 +- } while (u64_stats_fetch_retry(&port->tx_stats_syncp, start));
805 ++ } while (u64_stats_fetch_retry_irq(&port->tx_stats_syncp, start));
806 +
807 + stats->rx_dropped += stats->rx_missed_errors;
808 + }
809 +@@ -2032,18 +2032,18 @@ static void gmac_get_ethtool_stats(struct net_device *netdev,
810 + /* Racing with MIB interrupt */
811 + do {
812 + p = values;
813 +- start = u64_stats_fetch_begin(&port->ir_stats_syncp);
814 ++ start = u64_stats_fetch_begin_irq(&port->ir_stats_syncp);
815 +
816 + for (i = 0; i < RX_STATS_NUM; i++)
817 + *p++ = port->hw_stats[i];
818 +
819 +- } while (u64_stats_fetch_retry(&port->ir_stats_syncp, start));
820 ++ } while (u64_stats_fetch_retry_irq(&port->ir_stats_syncp, start));
821 + values = p;
822 +
823 + /* Racing with RX NAPI */
824 + do {
825 + p = values;
826 +- start = u64_stats_fetch_begin(&port->rx_stats_syncp);
827 ++ start = u64_stats_fetch_begin_irq(&port->rx_stats_syncp);
828 +
829 + for (i = 0; i < RX_STATUS_NUM; i++)
830 + *p++ = port->rx_stats[i];
831 +@@ -2051,13 +2051,13 @@ static void gmac_get_ethtool_stats(struct net_device *netdev,
832 + *p++ = port->rx_csum_stats[i];
833 + *p++ = port->rx_napi_exits;
834 +
835 +- } while (u64_stats_fetch_retry(&port->rx_stats_syncp, start));
836 ++ } while (u64_stats_fetch_retry_irq(&port->rx_stats_syncp, start));
837 + values = p;
838 +
839 + /* Racing with TX start_xmit */
840 + do {
841 + p = values;
842 +- start = u64_stats_fetch_begin(&port->tx_stats_syncp);
843 ++ start = u64_stats_fetch_begin_irq(&port->tx_stats_syncp);
844 +
845 + for (i = 0; i < TX_MAX_FRAGS; i++) {
846 + *values++ = port->tx_frag_stats[i];
847 +@@ -2066,7 +2066,7 @@ static void gmac_get_ethtool_stats(struct net_device *netdev,
848 + *values++ = port->tx_frags_linearized;
849 + *values++ = port->tx_hw_csummed;
850 +
851 +- } while (u64_stats_fetch_retry(&port->tx_stats_syncp, start));
852 ++ } while (u64_stats_fetch_retry_irq(&port->tx_stats_syncp, start));
853 + }
854 +
855 + static int gmac_get_ksettings(struct net_device *netdev,
856 +diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
857 +index 7b44769bd87c3..c53a043139446 100644
858 +--- a/drivers/net/ethernet/google/gve/gve_ethtool.c
859 ++++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
860 +@@ -172,14 +172,14 @@ gve_get_ethtool_stats(struct net_device *netdev,
861 + struct gve_rx_ring *rx = &priv->rx[ring];
862 +
863 + start =
864 +- u64_stats_fetch_begin(&priv->rx[ring].statss);
865 ++ u64_stats_fetch_begin_irq(&priv->rx[ring].statss);
866 + tmp_rx_pkts = rx->rpackets;
867 + tmp_rx_bytes = rx->rbytes;
868 + tmp_rx_skb_alloc_fail = rx->rx_skb_alloc_fail;
869 + tmp_rx_buf_alloc_fail = rx->rx_buf_alloc_fail;
870 + tmp_rx_desc_err_dropped_pkt =
871 + rx->rx_desc_err_dropped_pkt;
872 +- } while (u64_stats_fetch_retry(&priv->rx[ring].statss,
873 ++ } while (u64_stats_fetch_retry_irq(&priv->rx[ring].statss,
874 + start));
875 + rx_pkts += tmp_rx_pkts;
876 + rx_bytes += tmp_rx_bytes;
877 +@@ -193,10 +193,10 @@ gve_get_ethtool_stats(struct net_device *netdev,
878 + if (priv->tx) {
879 + do {
880 + start =
881 +- u64_stats_fetch_begin(&priv->tx[ring].statss);
882 ++ u64_stats_fetch_begin_irq(&priv->tx[ring].statss);
883 + tmp_tx_pkts = priv->tx[ring].pkt_done;
884 + tmp_tx_bytes = priv->tx[ring].bytes_done;
885 +- } while (u64_stats_fetch_retry(&priv->tx[ring].statss,
886 ++ } while (u64_stats_fetch_retry_irq(&priv->tx[ring].statss,
887 + start));
888 + tx_pkts += tmp_tx_pkts;
889 + tx_bytes += tmp_tx_bytes;
890 +@@ -254,13 +254,13 @@ gve_get_ethtool_stats(struct net_device *netdev,
891 + data[i++] = rx->cnt;
892 + do {
893 + start =
894 +- u64_stats_fetch_begin(&priv->rx[ring].statss);
895 ++ u64_stats_fetch_begin_irq(&priv->rx[ring].statss);
896 + tmp_rx_bytes = rx->rbytes;
897 + tmp_rx_skb_alloc_fail = rx->rx_skb_alloc_fail;
898 + tmp_rx_buf_alloc_fail = rx->rx_buf_alloc_fail;
899 + tmp_rx_desc_err_dropped_pkt =
900 + rx->rx_desc_err_dropped_pkt;
901 +- } while (u64_stats_fetch_retry(&priv->rx[ring].statss,
902 ++ } while (u64_stats_fetch_retry_irq(&priv->rx[ring].statss,
903 + start));
904 + data[i++] = tmp_rx_bytes;
905 + /* rx dropped packets */
906 +@@ -313,9 +313,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
907 + data[i++] = tx->done;
908 + do {
909 + start =
910 +- u64_stats_fetch_begin(&priv->tx[ring].statss);
911 ++ u64_stats_fetch_begin_irq(&priv->tx[ring].statss);
912 + tmp_tx_bytes = tx->bytes_done;
913 +- } while (u64_stats_fetch_retry(&priv->tx[ring].statss,
914 ++ } while (u64_stats_fetch_retry_irq(&priv->tx[ring].statss,
915 + start));
916 + data[i++] = tmp_tx_bytes;
917 + data[i++] = tx->wake_queue;
918 +diff --git a/drivers/net/ethernet/google/gve/gve_main.c b/drivers/net/ethernet/google/gve/gve_main.c
919 +index 6cb75bb1ed052..f0c1e6c80b61c 100644
920 +--- a/drivers/net/ethernet/google/gve/gve_main.c
921 ++++ b/drivers/net/ethernet/google/gve/gve_main.c
922 +@@ -40,10 +40,10 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
923 + for (ring = 0; ring < priv->rx_cfg.num_queues; ring++) {
924 + do {
925 + start =
926 +- u64_stats_fetch_begin(&priv->rx[ring].statss);
927 ++ u64_stats_fetch_begin_irq(&priv->rx[ring].statss);
928 + packets = priv->rx[ring].rpackets;
929 + bytes = priv->rx[ring].rbytes;
930 +- } while (u64_stats_fetch_retry(&priv->rx[ring].statss,
931 ++ } while (u64_stats_fetch_retry_irq(&priv->rx[ring].statss,
932 + start));
933 + s->rx_packets += packets;
934 + s->rx_bytes += bytes;
935 +@@ -53,10 +53,10 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s)
936 + for (ring = 0; ring < priv->tx_cfg.num_queues; ring++) {
937 + do {
938 + start =
939 +- u64_stats_fetch_begin(&priv->tx[ring].statss);
940 ++ u64_stats_fetch_begin_irq(&priv->tx[ring].statss);
941 + packets = priv->tx[ring].pkt_done;
942 + bytes = priv->tx[ring].bytes_done;
943 +- } while (u64_stats_fetch_retry(&priv->tx[ring].statss,
944 ++ } while (u64_stats_fetch_retry_irq(&priv->tx[ring].statss,
945 + start));
946 + s->tx_packets += packets;
947 + s->tx_bytes += bytes;
948 +@@ -1041,9 +1041,9 @@ void gve_handle_report_stats(struct gve_priv *priv)
949 + if (priv->tx) {
950 + for (idx = 0; idx < priv->tx_cfg.num_queues; idx++) {
951 + do {
952 +- start = u64_stats_fetch_begin(&priv->tx[idx].statss);
953 ++ start = u64_stats_fetch_begin_irq(&priv->tx[idx].statss);
954 + tx_bytes = priv->tx[idx].bytes_done;
955 +- } while (u64_stats_fetch_retry(&priv->tx[idx].statss, start));
956 ++ } while (u64_stats_fetch_retry_irq(&priv->tx[idx].statss, start));
957 + stats[stats_idx++] = (struct stats) {
958 + .stat_name = cpu_to_be32(TX_WAKE_CNT),
959 + .value = cpu_to_be64(priv->tx[idx].wake_queue),
960 +diff --git a/drivers/net/ethernet/huawei/hinic/hinic_rx.c b/drivers/net/ethernet/huawei/hinic/hinic_rx.c
961 +index 04b19af63fd61..30ab05289e8df 100644
962 +--- a/drivers/net/ethernet/huawei/hinic/hinic_rx.c
963 ++++ b/drivers/net/ethernet/huawei/hinic/hinic_rx.c
964 +@@ -74,14 +74,14 @@ void hinic_rxq_get_stats(struct hinic_rxq *rxq, struct hinic_rxq_stats *stats)
965 + unsigned int start;
966 +
967 + do {
968 +- start = u64_stats_fetch_begin(&rxq_stats->syncp);
969 ++ start = u64_stats_fetch_begin_irq(&rxq_stats->syncp);
970 + stats->pkts = rxq_stats->pkts;
971 + stats->bytes = rxq_stats->bytes;
972 + stats->errors = rxq_stats->csum_errors +
973 + rxq_stats->other_errors;
974 + stats->csum_errors = rxq_stats->csum_errors;
975 + stats->other_errors = rxq_stats->other_errors;
976 +- } while (u64_stats_fetch_retry(&rxq_stats->syncp, start));
977 ++ } while (u64_stats_fetch_retry_irq(&rxq_stats->syncp, start));
978 + }
979 +
980 + /**
981 +diff --git a/drivers/net/ethernet/huawei/hinic/hinic_tx.c b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
982 +index d13514a8160e8..c12d814ac94a6 100644
983 +--- a/drivers/net/ethernet/huawei/hinic/hinic_tx.c
984 ++++ b/drivers/net/ethernet/huawei/hinic/hinic_tx.c
985 +@@ -98,14 +98,14 @@ void hinic_txq_get_stats(struct hinic_txq *txq, struct hinic_txq_stats *stats)
986 + unsigned int start;
987 +
988 + do {
989 +- start = u64_stats_fetch_begin(&txq_stats->syncp);
990 ++ start = u64_stats_fetch_begin_irq(&txq_stats->syncp);
991 + stats->pkts = txq_stats->pkts;
992 + stats->bytes = txq_stats->bytes;
993 + stats->tx_busy = txq_stats->tx_busy;
994 + stats->tx_wake = txq_stats->tx_wake;
995 + stats->tx_dropped = txq_stats->tx_dropped;
996 + stats->big_frags_pkts = txq_stats->big_frags_pkts;
997 +- } while (u64_stats_fetch_retry(&txq_stats->syncp, start));
998 ++ } while (u64_stats_fetch_retry_irq(&txq_stats->syncp, start));
999 + }
1000 +
1001 + /**
1002 +diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
1003 +index dfc1f32cda2b3..5ab230aab2cd8 100644
1004 +--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
1005 ++++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
1006 +@@ -3373,21 +3373,21 @@ static void nfp_net_stat64(struct net_device *netdev,
1007 + unsigned int start;
1008 +
1009 + do {
1010 +- start = u64_stats_fetch_begin(&r_vec->rx_sync);
1011 ++ start = u64_stats_fetch_begin_irq(&r_vec->rx_sync);
1012 + data[0] = r_vec->rx_pkts;
1013 + data[1] = r_vec->rx_bytes;
1014 + data[2] = r_vec->rx_drops;
1015 +- } while (u64_stats_fetch_retry(&r_vec->rx_sync, start));
1016 ++ } while (u64_stats_fetch_retry_irq(&r_vec->rx_sync, start));
1017 + stats->rx_packets += data[0];
1018 + stats->rx_bytes += data[1];
1019 + stats->rx_dropped += data[2];
1020 +
1021 + do {
1022 +- start = u64_stats_fetch_begin(&r_vec->tx_sync);
1023 ++ start = u64_stats_fetch_begin_irq(&r_vec->tx_sync);
1024 + data[0] = r_vec->tx_pkts;
1025 + data[1] = r_vec->tx_bytes;
1026 + data[2] = r_vec->tx_errors;
1027 +- } while (u64_stats_fetch_retry(&r_vec->tx_sync, start));
1028 ++ } while (u64_stats_fetch_retry_irq(&r_vec->tx_sync, start));
1029 + stats->tx_packets += data[0];
1030 + stats->tx_bytes += data[1];
1031 + stats->tx_errors += data[2];
1032 +diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
1033 +index bf8590ef0964b..3977aa2f59bd1 100644
1034 +--- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
1035 ++++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
1036 +@@ -494,7 +494,7 @@ static u64 *nfp_vnic_get_sw_stats(struct net_device *netdev, u64 *data)
1037 + unsigned int start;
1038 +
1039 + do {
1040 +- start = u64_stats_fetch_begin(&nn->r_vecs[i].rx_sync);
1041 ++ start = u64_stats_fetch_begin_irq(&nn->r_vecs[i].rx_sync);
1042 + data[0] = nn->r_vecs[i].rx_pkts;
1043 + tmp[0] = nn->r_vecs[i].hw_csum_rx_ok;
1044 + tmp[1] = nn->r_vecs[i].hw_csum_rx_inner_ok;
1045 +@@ -502,10 +502,10 @@ static u64 *nfp_vnic_get_sw_stats(struct net_device *netdev, u64 *data)
1046 + tmp[3] = nn->r_vecs[i].hw_csum_rx_error;
1047 + tmp[4] = nn->r_vecs[i].rx_replace_buf_alloc_fail;
1048 + tmp[5] = nn->r_vecs[i].hw_tls_rx;
1049 +- } while (u64_stats_fetch_retry(&nn->r_vecs[i].rx_sync, start));
1050 ++ } while (u64_stats_fetch_retry_irq(&nn->r_vecs[i].rx_sync, start));
1051 +
1052 + do {
1053 +- start = u64_stats_fetch_begin(&nn->r_vecs[i].tx_sync);
1054 ++ start = u64_stats_fetch_begin_irq(&nn->r_vecs[i].tx_sync);
1055 + data[1] = nn->r_vecs[i].tx_pkts;
1056 + data[2] = nn->r_vecs[i].tx_busy;
1057 + tmp[6] = nn->r_vecs[i].hw_csum_tx;
1058 +@@ -515,7 +515,7 @@ static u64 *nfp_vnic_get_sw_stats(struct net_device *netdev, u64 *data)
1059 + tmp[10] = nn->r_vecs[i].hw_tls_tx;
1060 + tmp[11] = nn->r_vecs[i].tls_tx_fallback;
1061 + tmp[12] = nn->r_vecs[i].tls_tx_no_fallback;
1062 +- } while (u64_stats_fetch_retry(&nn->r_vecs[i].tx_sync, start));
1063 ++ } while (u64_stats_fetch_retry_irq(&nn->r_vecs[i].tx_sync, start));
1064 +
1065 + data += NN_RVEC_PER_Q_STATS;
1066 +
1067 +diff --git a/drivers/net/ethernet/rocker/rocker_ofdpa.c b/drivers/net/ethernet/rocker/rocker_ofdpa.c
1068 +index 8157666209798..e4d919de7e3fc 100644
1069 +--- a/drivers/net/ethernet/rocker/rocker_ofdpa.c
1070 ++++ b/drivers/net/ethernet/rocker/rocker_ofdpa.c
1071 +@@ -1273,7 +1273,7 @@ static int ofdpa_port_ipv4_neigh(struct ofdpa_port *ofdpa_port,
1072 + bool removing;
1073 + int err = 0;
1074 +
1075 +- entry = kzalloc(sizeof(*entry), GFP_KERNEL);
1076 ++ entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
1077 + if (!entry)
1078 + return -ENOMEM;
1079 +
1080 +diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c
1081 +index 7db9cbd0f5ded..07adbeec19787 100644
1082 +--- a/drivers/net/ieee802154/adf7242.c
1083 ++++ b/drivers/net/ieee802154/adf7242.c
1084 +@@ -1310,10 +1310,11 @@ static int adf7242_remove(struct spi_device *spi)
1085 +
1086 + debugfs_remove_recursive(lp->debugfs_root);
1087 +
1088 ++ ieee802154_unregister_hw(lp->hw);
1089 ++
1090 + cancel_delayed_work_sync(&lp->work);
1091 + destroy_workqueue(lp->wqueue);
1092 +
1093 +- ieee802154_unregister_hw(lp->hw);
1094 + mutex_destroy(&lp->bmux);
1095 + ieee802154_free_hw(lp->hw);
1096 +
1097 +diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
1098 +index ad6dbf0110526..4fb0638a55b44 100644
1099 +--- a/drivers/net/netdevsim/netdev.c
1100 ++++ b/drivers/net/netdevsim/netdev.c
1101 +@@ -67,10 +67,10 @@ nsim_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
1102 + unsigned int start;
1103 +
1104 + do {
1105 +- start = u64_stats_fetch_begin(&ns->syncp);
1106 ++ start = u64_stats_fetch_begin_irq(&ns->syncp);
1107 + stats->tx_bytes = ns->tx_bytes;
1108 + stats->tx_packets = ns->tx_packets;
1109 +- } while (u64_stats_fetch_retry(&ns->syncp, start));
1110 ++ } while (u64_stats_fetch_retry_irq(&ns->syncp, start));
1111 + }
1112 +
1113 + static int
1114 +diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c
1115 +index a9d2a4b98e570..4b0739f95f8b9 100644
1116 +--- a/drivers/platform/x86/pmc_atom.c
1117 ++++ b/drivers/platform/x86/pmc_atom.c
1118 +@@ -244,7 +244,7 @@ static void pmc_power_off(void)
1119 + pm1_cnt_port = acpi_base_addr + PM1_CNT;
1120 +
1121 + pm1_cnt_value = inl(pm1_cnt_port);
1122 +- pm1_cnt_value &= SLEEP_TYPE_MASK;
1123 ++ pm1_cnt_value &= ~SLEEP_TYPE_MASK;
1124 + pm1_cnt_value |= SLEEP_TYPE_S5;
1125 + pm1_cnt_value |= SLEEP_ENABLE;
1126 +
1127 +diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c
1128 +index ff3cb09c57a63..30e965c410ffd 100644
1129 +--- a/drivers/staging/rtl8712/rtl8712_cmd.c
1130 ++++ b/drivers/staging/rtl8712/rtl8712_cmd.c
1131 +@@ -117,34 +117,6 @@ static void r871x_internal_cmd_hdl(struct _adapter *padapter, u8 *pbuf)
1132 + kfree(pdrvcmd->pbuf);
1133 + }
1134 +
1135 +-static u8 read_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
1136 +-{
1137 +- void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
1138 +- struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
1139 +-
1140 +- /* invoke cmd->callback function */
1141 +- pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
1142 +- if (!pcmd_callback)
1143 +- r8712_free_cmd_obj(pcmd);
1144 +- else
1145 +- pcmd_callback(padapter, pcmd);
1146 +- return H2C_SUCCESS;
1147 +-}
1148 +-
1149 +-static u8 write_macreg_hdl(struct _adapter *padapter, u8 *pbuf)
1150 +-{
1151 +- void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
1152 +- struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
1153 +-
1154 +- /* invoke cmd->callback function */
1155 +- pcmd_callback = cmd_callback[pcmd->cmdcode].callback;
1156 +- if (!pcmd_callback)
1157 +- r8712_free_cmd_obj(pcmd);
1158 +- else
1159 +- pcmd_callback(padapter, pcmd);
1160 +- return H2C_SUCCESS;
1161 +-}
1162 +-
1163 + static u8 read_bbreg_hdl(struct _adapter *padapter, u8 *pbuf)
1164 + {
1165 + struct cmd_obj *pcmd = (struct cmd_obj *)pbuf;
1166 +@@ -213,14 +185,6 @@ static struct cmd_obj *cmd_hdl_filter(struct _adapter *padapter,
1167 + pcmd_r = NULL;
1168 +
1169 + switch (pcmd->cmdcode) {
1170 +- case GEN_CMD_CODE(_Read_MACREG):
1171 +- read_macreg_hdl(padapter, (u8 *)pcmd);
1172 +- pcmd_r = pcmd;
1173 +- break;
1174 +- case GEN_CMD_CODE(_Write_MACREG):
1175 +- write_macreg_hdl(padapter, (u8 *)pcmd);
1176 +- pcmd_r = pcmd;
1177 +- break;
1178 + case GEN_CMD_CODE(_Read_BBREG):
1179 + read_bbreg_hdl(padapter, (u8 *)pcmd);
1180 + break;
1181 +diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
1182 +index 9894b8f630648..772acb190f507 100644
1183 +--- a/drivers/thunderbolt/ctl.c
1184 ++++ b/drivers/thunderbolt/ctl.c
1185 +@@ -396,7 +396,7 @@ static void tb_ctl_rx_submit(struct ctl_pkg *pkg)
1186 +
1187 + static int tb_async_error(const struct ctl_pkg *pkg)
1188 + {
1189 +- const struct cfg_error_pkg *error = (const struct cfg_error_pkg *)pkg;
1190 ++ const struct cfg_error_pkg *error = pkg->buffer;
1191 +
1192 + if (pkg->frame.eof != TB_CFG_PKG_ERROR)
1193 + return false;
1194 +diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
1195 +index 52a603a6f9b88..a2c4eab0b4703 100644
1196 +--- a/drivers/tty/serial/fsl_lpuart.c
1197 ++++ b/drivers/tty/serial/fsl_lpuart.c
1198 +@@ -1376,9 +1376,9 @@ static int lpuart32_config_rs485(struct uart_port *port,
1199 + * Note: UART is assumed to be active high.
1200 + */
1201 + if (rs485->flags & SER_RS485_RTS_ON_SEND)
1202 +- modem &= ~UARTMODEM_TXRTSPOL;
1203 +- else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
1204 + modem |= UARTMODEM_TXRTSPOL;
1205 ++ else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
1206 ++ modem &= ~UARTMODEM_TXRTSPOL;
1207 + }
1208 +
1209 + /* Store the new configuration */
1210 +@@ -2138,6 +2138,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
1211 + uart_update_timeout(port, termios->c_cflag, baud);
1212 +
1213 + /* wait transmit engin complete */
1214 ++ lpuart32_write(&sport->port, 0, UARTMODIR);
1215 + lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC);
1216 +
1217 + /* disable transmit and receive */
1218 +diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
1219 +index a4d005fa2569d..0252c0562dbc8 100644
1220 +--- a/drivers/tty/vt/vt.c
1221 ++++ b/drivers/tty/vt/vt.c
1222 +@@ -4671,9 +4671,11 @@ static int con_font_set(struct vc_data *vc, struct console_font_op *op)
1223 + console_lock();
1224 + if (vc->vc_mode != KD_TEXT)
1225 + rc = -EINVAL;
1226 +- else if (vc->vc_sw->con_font_set)
1227 ++ else if (vc->vc_sw->con_font_set) {
1228 ++ if (vc_is_sel(vc))
1229 ++ clear_selection();
1230 + rc = vc->vc_sw->con_font_set(vc, &font, op->flags);
1231 +- else
1232 ++ } else
1233 + rc = -ENOSYS;
1234 + console_unlock();
1235 + kfree(font.data);
1236 +@@ -4700,9 +4702,11 @@ static int con_font_default(struct vc_data *vc, struct console_font_op *op)
1237 + console_unlock();
1238 + return -EINVAL;
1239 + }
1240 +- if (vc->vc_sw->con_font_default)
1241 ++ if (vc->vc_sw->con_font_default) {
1242 ++ if (vc_is_sel(vc))
1243 ++ clear_selection();
1244 + rc = vc->vc_sw->con_font_default(vc, &font, s);
1245 +- else
1246 ++ } else
1247 + rc = -ENOSYS;
1248 + console_unlock();
1249 + if (!rc) {
1250 +diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
1251 +index 7950d5b3af429..070b838c7da98 100644
1252 +--- a/drivers/usb/class/cdc-acm.c
1253 ++++ b/drivers/usb/class/cdc-acm.c
1254 +@@ -1830,6 +1830,9 @@ static const struct usb_device_id acm_ids[] = {
1255 + { USB_DEVICE(0x09d8, 0x0320), /* Elatec GmbH TWN3 */
1256 + .driver_info = NO_UNION_NORMAL, /* has misplaced union descriptor */
1257 + },
1258 ++ { USB_DEVICE(0x0c26, 0x0020), /* Icom ICF3400 Serie */
1259 ++ .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
1260 ++ },
1261 + { USB_DEVICE(0x0ca6, 0xa050), /* Castles VEGA3000 */
1262 + .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
1263 + },
1264 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
1265 +index 18ee3914b4686..53b3d77fba6a2 100644
1266 +--- a/drivers/usb/core/hub.c
1267 ++++ b/drivers/usb/core/hub.c
1268 +@@ -5967,6 +5967,11 @@ re_enumerate_no_bos:
1269 + * the reset is over (using their post_reset method).
1270 + *
1271 + * Return: The same as for usb_reset_and_verify_device().
1272 ++ * However, if a reset is already in progress (for instance, if a
1273 ++ * driver doesn't have pre_ or post_reset() callbacks, and while
1274 ++ * being unbound or re-bound during the ongoing reset its disconnect()
1275 ++ * or probe() routine tries to perform a second, nested reset), the
1276 ++ * routine returns -EINPROGRESS.
1277 + *
1278 + * Note:
1279 + * The caller must own the device lock. For example, it's safe to use
1280 +@@ -6000,6 +6005,10 @@ int usb_reset_device(struct usb_device *udev)
1281 + return -EISDIR;
1282 + }
1283 +
1284 ++ if (udev->reset_in_progress)
1285 ++ return -EINPROGRESS;
1286 ++ udev->reset_in_progress = 1;
1287 ++
1288 + port_dev = hub->ports[udev->portnum - 1];
1289 +
1290 + /*
1291 +@@ -6064,6 +6073,7 @@ int usb_reset_device(struct usb_device *udev)
1292 +
1293 + usb_autosuspend_device(udev);
1294 + memalloc_noio_restore(noio_flag);
1295 ++ udev->reset_in_progress = 0;
1296 + return ret;
1297 + }
1298 + EXPORT_SYMBOL_GPL(usb_reset_device);
1299 +diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
1300 +index 49d333f02af4e..8851db646ef53 100644
1301 +--- a/drivers/usb/dwc2/platform.c
1302 ++++ b/drivers/usb/dwc2/platform.c
1303 +@@ -154,9 +154,9 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
1304 + } else if (hsotg->plat && hsotg->plat->phy_init) {
1305 + ret = hsotg->plat->phy_init(pdev, hsotg->plat->phy_type);
1306 + } else {
1307 +- ret = phy_power_on(hsotg->phy);
1308 ++ ret = phy_init(hsotg->phy);
1309 + if (ret == 0)
1310 +- ret = phy_init(hsotg->phy);
1311 ++ ret = phy_power_on(hsotg->phy);
1312 + }
1313 +
1314 + return ret;
1315 +@@ -188,9 +188,9 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg)
1316 + } else if (hsotg->plat && hsotg->plat->phy_exit) {
1317 + ret = hsotg->plat->phy_exit(pdev, hsotg->plat->phy_type);
1318 + } else {
1319 +- ret = phy_exit(hsotg->phy);
1320 ++ ret = phy_power_off(hsotg->phy);
1321 + if (ret == 0)
1322 +- ret = phy_power_off(hsotg->phy);
1323 ++ ret = phy_exit(hsotg->phy);
1324 + }
1325 + if (ret)
1326 + return ret;
1327 +diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
1328 +index 572cf34459aa7..5aae7504f78a1 100644
1329 +--- a/drivers/usb/dwc3/core.c
1330 ++++ b/drivers/usb/dwc3/core.c
1331 +@@ -728,15 +728,16 @@ static void dwc3_core_exit(struct dwc3 *dwc)
1332 + {
1333 + dwc3_event_buffers_cleanup(dwc);
1334 +
1335 ++ usb_phy_set_suspend(dwc->usb2_phy, 1);
1336 ++ usb_phy_set_suspend(dwc->usb3_phy, 1);
1337 ++ phy_power_off(dwc->usb2_generic_phy);
1338 ++ phy_power_off(dwc->usb3_generic_phy);
1339 ++
1340 + usb_phy_shutdown(dwc->usb2_phy);
1341 + usb_phy_shutdown(dwc->usb3_phy);
1342 + phy_exit(dwc->usb2_generic_phy);
1343 + phy_exit(dwc->usb3_generic_phy);
1344 +
1345 +- usb_phy_set_suspend(dwc->usb2_phy, 1);
1346 +- usb_phy_set_suspend(dwc->usb3_phy, 1);
1347 +- phy_power_off(dwc->usb2_generic_phy);
1348 +- phy_power_off(dwc->usb3_generic_phy);
1349 + clk_bulk_disable_unprepare(dwc->num_clks, dwc->clks);
1350 + reset_control_assert(dwc->reset);
1351 + }
1352 +@@ -1606,16 +1607,16 @@ err5:
1353 + dwc3_debugfs_exit(dwc);
1354 + dwc3_event_buffers_cleanup(dwc);
1355 +
1356 +- usb_phy_shutdown(dwc->usb2_phy);
1357 +- usb_phy_shutdown(dwc->usb3_phy);
1358 +- phy_exit(dwc->usb2_generic_phy);
1359 +- phy_exit(dwc->usb3_generic_phy);
1360 +-
1361 + usb_phy_set_suspend(dwc->usb2_phy, 1);
1362 + usb_phy_set_suspend(dwc->usb3_phy, 1);
1363 + phy_power_off(dwc->usb2_generic_phy);
1364 + phy_power_off(dwc->usb3_generic_phy);
1365 +
1366 ++ usb_phy_shutdown(dwc->usb2_phy);
1367 ++ usb_phy_shutdown(dwc->usb3_phy);
1368 ++ phy_exit(dwc->usb2_generic_phy);
1369 ++ phy_exit(dwc->usb3_generic_phy);
1370 ++
1371 + dwc3_ulpi_exit(dwc);
1372 +
1373 + err4:
1374 +diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
1375 +index 915fa4197d770..ca3a35fd8f746 100644
1376 +--- a/drivers/usb/dwc3/dwc3-qcom.c
1377 ++++ b/drivers/usb/dwc3/dwc3-qcom.c
1378 +@@ -296,6 +296,14 @@ static void dwc3_qcom_interconnect_exit(struct dwc3_qcom *qcom)
1379 + icc_put(qcom->icc_path_apps);
1380 + }
1381 +
1382 ++/* Only usable in contexts where the role can not change. */
1383 ++static bool dwc3_qcom_is_host(struct dwc3_qcom *qcom)
1384 ++{
1385 ++ struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3);
1386 ++
1387 ++ return dwc->xhci;
1388 ++}
1389 ++
1390 + static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom)
1391 + {
1392 + if (qcom->hs_phy_irq) {
1393 +@@ -411,7 +419,11 @@ static irqreturn_t qcom_dwc3_resume_irq(int irq, void *data)
1394 + if (qcom->pm_suspended)
1395 + return IRQ_HANDLED;
1396 +
1397 +- if (dwc->xhci)
1398 ++ /*
1399 ++ * This is safe as role switching is done from a freezable workqueue
1400 ++ * and the wakeup interrupts are disabled as part of resume.
1401 ++ */
1402 ++ if (dwc3_qcom_is_host(qcom))
1403 + pm_runtime_resume(&dwc->xhci->dev);
1404 +
1405 + return IRQ_HANDLED;
1406 +diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
1407 +index e195176580de1..86bc2bec9038d 100644
1408 +--- a/drivers/usb/dwc3/host.c
1409 ++++ b/drivers/usb/dwc3/host.c
1410 +@@ -10,8 +10,13 @@
1411 + #include <linux/acpi.h>
1412 + #include <linux/platform_device.h>
1413 +
1414 ++#include "../host/xhci-plat.h"
1415 + #include "core.h"
1416 +
1417 ++static const struct xhci_plat_priv dwc3_xhci_plat_priv = {
1418 ++ .quirks = XHCI_SKIP_PHY_INIT,
1419 ++};
1420 ++
1421 + static int dwc3_host_get_irq(struct dwc3 *dwc)
1422 + {
1423 + struct platform_device *dwc3_pdev = to_platform_device(dwc->dev);
1424 +@@ -87,6 +92,11 @@ int dwc3_host_init(struct dwc3 *dwc)
1425 + goto err;
1426 + }
1427 +
1428 ++ ret = platform_device_add_data(xhci, &dwc3_xhci_plat_priv,
1429 ++ sizeof(dwc3_xhci_plat_priv));
1430 ++ if (ret)
1431 ++ goto err;
1432 ++
1433 + memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
1434 +
1435 + if (dwc->usb3_lpm_capable)
1436 +@@ -130,4 +140,5 @@ err:
1437 + void dwc3_host_exit(struct dwc3 *dwc)
1438 + {
1439 + platform_device_unregister(dwc->xhci);
1440 ++ dwc->xhci = NULL;
1441 + }
1442 +diff --git a/drivers/usb/gadget/function/storage_common.c b/drivers/usb/gadget/function/storage_common.c
1443 +index f7e6c42558eb7..021984921f919 100644
1444 +--- a/drivers/usb/gadget/function/storage_common.c
1445 ++++ b/drivers/usb/gadget/function/storage_common.c
1446 +@@ -294,8 +294,10 @@ EXPORT_SYMBOL_GPL(fsg_lun_fsync_sub);
1447 + void store_cdrom_address(u8 *dest, int msf, u32 addr)
1448 + {
1449 + if (msf) {
1450 +- /* Convert to Minutes-Seconds-Frames */
1451 +- addr >>= 2; /* Convert to 2048-byte frames */
1452 ++ /*
1453 ++ * Convert to Minutes-Seconds-Frames.
1454 ++ * Sector size is already set to 2048 bytes.
1455 ++ */
1456 + addr += 2*75; /* Lead-in occupies 2 seconds */
1457 + dest[3] = addr % 75; /* Frames */
1458 + addr /= 75;
1459 +diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
1460 +index 94adae8b19f00..7bb3067418076 100644
1461 +--- a/drivers/usb/host/xhci-hub.c
1462 ++++ b/drivers/usb/host/xhci-hub.c
1463 +@@ -566,7 +566,7 @@ struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd)
1464 + * It will release and re-aquire the lock while calling ACPI
1465 + * method.
1466 + */
1467 +-void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd,
1468 ++static void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd,
1469 + u16 index, bool on, unsigned long *flags)
1470 + __must_hold(&xhci->lock)
1471 + {
1472 +@@ -1561,6 +1561,17 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
1473 +
1474 + status = bus_state->resuming_ports;
1475 +
1476 ++ /*
1477 ++ * SS devices are only visible to roothub after link training completes.
1478 ++ * Keep polling roothubs for a grace period after xHC start
1479 ++ */
1480 ++ if (xhci->run_graceperiod) {
1481 ++ if (time_before(jiffies, xhci->run_graceperiod))
1482 ++ status = 1;
1483 ++ else
1484 ++ xhci->run_graceperiod = 0;
1485 ++ }
1486 ++
1487 + mask = PORT_CSC | PORT_PEC | PORT_OCC | PORT_PLC | PORT_WRC | PORT_CEC;
1488 +
1489 + /* For each port, did anything change? If so, set that bit in buf. */
1490 +diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
1491 +index 997de5f294f15..7b16b6b45af7d 100644
1492 +--- a/drivers/usb/host/xhci.c
1493 ++++ b/drivers/usb/host/xhci.c
1494 +@@ -149,9 +149,11 @@ int xhci_start(struct xhci_hcd *xhci)
1495 + xhci_err(xhci, "Host took too long to start, "
1496 + "waited %u microseconds.\n",
1497 + XHCI_MAX_HALT_USEC);
1498 +- if (!ret)
1499 ++ if (!ret) {
1500 + /* clear state flags. Including dying, halted or removing */
1501 + xhci->xhc_state = 0;
1502 ++ xhci->run_graceperiod = jiffies + msecs_to_jiffies(500);
1503 ++ }
1504 +
1505 + return ret;
1506 + }
1507 +@@ -775,8 +777,6 @@ static void xhci_stop(struct usb_hcd *hcd)
1508 + void xhci_shutdown(struct usb_hcd *hcd)
1509 + {
1510 + struct xhci_hcd *xhci = hcd_to_xhci(hcd);
1511 +- unsigned long flags;
1512 +- int i;
1513 +
1514 + if (xhci->quirks & XHCI_SPURIOUS_REBOOT)
1515 + usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev));
1516 +@@ -792,21 +792,12 @@ void xhci_shutdown(struct usb_hcd *hcd)
1517 + del_timer_sync(&xhci->shared_hcd->rh_timer);
1518 + }
1519 +
1520 +- spin_lock_irqsave(&xhci->lock, flags);
1521 ++ spin_lock_irq(&xhci->lock);
1522 + xhci_halt(xhci);
1523 +-
1524 +- /* Power off USB2 ports*/
1525 +- for (i = 0; i < xhci->usb2_rhub.num_ports; i++)
1526 +- xhci_set_port_power(xhci, xhci->main_hcd, i, false, &flags);
1527 +-
1528 +- /* Power off USB3 ports*/
1529 +- for (i = 0; i < xhci->usb3_rhub.num_ports; i++)
1530 +- xhci_set_port_power(xhci, xhci->shared_hcd, i, false, &flags);
1531 +-
1532 + /* Workaround for spurious wakeups at shutdown with HSW */
1533 + if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
1534 + xhci_reset(xhci, XHCI_RESET_SHORT_USEC);
1535 +- spin_unlock_irqrestore(&xhci->lock, flags);
1536 ++ spin_unlock_irq(&xhci->lock);
1537 +
1538 + xhci_cleanup_msix(xhci);
1539 +
1540 +diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
1541 +index f87e5fe57f225..6f16a05b19584 100644
1542 +--- a/drivers/usb/host/xhci.h
1543 ++++ b/drivers/usb/host/xhci.h
1544 +@@ -1816,7 +1816,7 @@ struct xhci_hcd {
1545 +
1546 + /* Host controller watchdog timer structures */
1547 + unsigned int xhc_state;
1548 +-
1549 ++ unsigned long run_graceperiod;
1550 + u32 command;
1551 + struct s3_save s3;
1552 + /* Host controller is dying - not responding to commands. "I'm not dead yet!"
1553 +@@ -2162,8 +2162,6 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, u16 wIndex,
1554 + int xhci_hub_status_data(struct usb_hcd *hcd, char *buf);
1555 + int xhci_find_raw_port_number(struct usb_hcd *hcd, int port1);
1556 + struct xhci_hub *xhci_get_rhub(struct usb_hcd *hcd);
1557 +-void xhci_set_port_power(struct xhci_hcd *xhci, struct usb_hcd *hcd, u16 index,
1558 +- bool on, unsigned long *flags);
1559 +
1560 + void xhci_hc_died(struct xhci_hcd *xhci);
1561 +
1562 +diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
1563 +index a2a38fc76ca53..97a250e75ab7f 100644
1564 +--- a/drivers/usb/serial/ch341.c
1565 ++++ b/drivers/usb/serial/ch341.c
1566 +@@ -97,7 +97,10 @@ struct ch341_private {
1567 + u8 mcr;
1568 + u8 msr;
1569 + u8 lcr;
1570 ++
1571 + unsigned long quirks;
1572 ++ u8 version;
1573 ++
1574 + unsigned long break_end;
1575 + };
1576 +
1577 +@@ -256,8 +259,12 @@ static int ch341_set_baudrate_lcr(struct usb_device *dev,
1578 + /*
1579 + * CH341A buffers data until a full endpoint-size packet (32 bytes)
1580 + * has been received unless bit 7 is set.
1581 ++ *
1582 ++ * At least one device with version 0x27 appears to have this bit
1583 ++ * inverted.
1584 + */
1585 +- val |= BIT(7);
1586 ++ if (priv->version > 0x27)
1587 ++ val |= BIT(7);
1588 +
1589 + r = ch341_control_out(dev, CH341_REQ_WRITE_REG,
1590 + CH341_REG_DIVISOR << 8 | CH341_REG_PRESCALER,
1591 +@@ -271,6 +278,9 @@ static int ch341_set_baudrate_lcr(struct usb_device *dev,
1592 + * (stop bits, parity and word length). Version 0x30 and above use
1593 + * CH341_REG_LCR only and CH341_REG_LCR2 is always set to zero.
1594 + */
1595 ++ if (priv->version < 0x30)
1596 ++ return 0;
1597 ++
1598 + r = ch341_control_out(dev, CH341_REQ_WRITE_REG,
1599 + CH341_REG_LCR2 << 8 | CH341_REG_LCR, lcr);
1600 + if (r)
1601 +@@ -323,7 +333,9 @@ static int ch341_configure(struct usb_device *dev, struct ch341_private *priv)
1602 + r = ch341_control_in(dev, CH341_REQ_READ_VERSION, 0, 0, buffer, size);
1603 + if (r < 0)
1604 + goto out;
1605 +- dev_dbg(&dev->dev, "Chip version: 0x%02x\n", buffer[0]);
1606 ++
1607 ++ priv->version = buffer[0];
1608 ++ dev_dbg(&dev->dev, "Chip version: 0x%02x\n", priv->version);
1609 +
1610 + r = ch341_control_out(dev, CH341_REQ_SERIAL_INIT, 0, 0);
1611 + if (r < 0)
1612 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
1613 +index 067b206bd2527..6b5ba6180c307 100644
1614 +--- a/drivers/usb/serial/cp210x.c
1615 ++++ b/drivers/usb/serial/cp210x.c
1616 +@@ -134,6 +134,7 @@ static const struct usb_device_id id_table[] = {
1617 + { USB_DEVICE(0x10C4, 0x83AA) }, /* Mark-10 Digital Force Gauge */
1618 + { USB_DEVICE(0x10C4, 0x83D8) }, /* DekTec DTA Plus VHF/UHF Booster/Attenuator */
1619 + { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */
1620 ++ { USB_DEVICE(0x10C4, 0x8414) }, /* Decagon USB Cable Adapter */
1621 + { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */
1622 + { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */
1623 + { USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */
1624 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1625 +index 8f980fc6efc19..5480bacba39fc 100644
1626 +--- a/drivers/usb/serial/ftdi_sio.c
1627 ++++ b/drivers/usb/serial/ftdi_sio.c
1628 +@@ -1045,6 +1045,8 @@ static const struct usb_device_id id_table_combined[] = {
1629 + /* IDS GmbH devices */
1630 + { USB_DEVICE(IDS_VID, IDS_SI31A_PID) },
1631 + { USB_DEVICE(IDS_VID, IDS_CM31A_PID) },
1632 ++ /* Omron devices */
1633 ++ { USB_DEVICE(OMRON_VID, OMRON_CS1W_CIF31_PID) },
1634 + /* U-Blox devices */
1635 + { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) },
1636 + { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) },
1637 +diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1638 +index 4e92c165c86bf..31c8ccabbbb78 100644
1639 +--- a/drivers/usb/serial/ftdi_sio_ids.h
1640 ++++ b/drivers/usb/serial/ftdi_sio_ids.h
1641 +@@ -661,6 +661,12 @@
1642 + #define INFINEON_TRIBOARD_TC1798_PID 0x0028 /* DAS JTAG TriBoard TC1798 V1.0 */
1643 + #define INFINEON_TRIBOARD_TC2X7_PID 0x0043 /* DAS JTAG TriBoard TC2X7 V1.0 */
1644 +
1645 ++/*
1646 ++ * Omron corporation (https://www.omron.com)
1647 ++ */
1648 ++ #define OMRON_VID 0x0590
1649 ++ #define OMRON_CS1W_CIF31_PID 0x00b2
1650 ++
1651 + /*
1652 + * Acton Research Corp.
1653 + */
1654 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1655 +index 44e06b95584e5..211e03a204072 100644
1656 +--- a/drivers/usb/serial/option.c
1657 ++++ b/drivers/usb/serial/option.c
1658 +@@ -253,6 +253,7 @@ static void option_instat_callback(struct urb *urb);
1659 + #define QUECTEL_PRODUCT_BG96 0x0296
1660 + #define QUECTEL_PRODUCT_EP06 0x0306
1661 + #define QUECTEL_PRODUCT_EM05G 0x030a
1662 ++#define QUECTEL_PRODUCT_EM060K 0x030b
1663 + #define QUECTEL_PRODUCT_EM12 0x0512
1664 + #define QUECTEL_PRODUCT_RM500Q 0x0800
1665 + #define QUECTEL_PRODUCT_EC200S_CN 0x6002
1666 +@@ -438,6 +439,8 @@ static void option_instat_callback(struct urb *urb);
1667 + #define CINTERION_PRODUCT_MV31_2_RMNET 0x00b9
1668 + #define CINTERION_PRODUCT_MV32_WA 0x00f1
1669 + #define CINTERION_PRODUCT_MV32_WB 0x00f2
1670 ++#define CINTERION_PRODUCT_MV32_WA_RMNET 0x00f3
1671 ++#define CINTERION_PRODUCT_MV32_WB_RMNET 0x00f4
1672 +
1673 + /* Olivetti products */
1674 + #define OLIVETTI_VENDOR_ID 0x0b3c
1675 +@@ -573,6 +576,10 @@ static void option_instat_callback(struct urb *urb);
1676 + #define WETELECOM_PRODUCT_6802 0x6802
1677 + #define WETELECOM_PRODUCT_WMD300 0x6803
1678 +
1679 ++/* OPPO products */
1680 ++#define OPPO_VENDOR_ID 0x22d9
1681 ++#define OPPO_PRODUCT_R11 0x276c
1682 ++
1683 +
1684 + /* Device flags */
1685 +
1686 +@@ -1138,6 +1145,9 @@ static const struct usb_device_id option_ids[] = {
1687 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },
1688 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff),
1689 + .driver_info = RSVD(6) | ZLP },
1690 ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) },
1691 ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x30) },
1692 ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x40) },
1693 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
1694 + .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
1695 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
1696 +@@ -1993,8 +2003,12 @@ static const struct usb_device_id option_ids[] = {
1697 + .driver_info = RSVD(0)},
1698 + { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WA, 0xff),
1699 + .driver_info = RSVD(3)},
1700 ++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WA_RMNET, 0xff),
1701 ++ .driver_info = RSVD(0) },
1702 + { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WB, 0xff),
1703 + .driver_info = RSVD(3)},
1704 ++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WB_RMNET, 0xff),
1705 ++ .driver_info = RSVD(0) },
1706 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100),
1707 + .driver_info = RSVD(4) },
1708 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120),
1709 +@@ -2155,6 +2169,7 @@ static const struct usb_device_id option_ids[] = {
1710 + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1404, 0xff) }, /* GosunCn GM500 RNDIS */
1711 + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */
1712 + { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */
1713 ++ { USB_DEVICE_AND_INTERFACE_INFO(OPPO_VENDOR_ID, OPPO_PRODUCT_R11, 0xff, 0xff, 0x30) },
1714 + { } /* Terminating entry */
1715 + };
1716 + MODULE_DEVICE_TABLE(usb, option_ids);
1717 +diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
1718 +index 1a05e3dcfec8a..4993227ab2930 100644
1719 +--- a/drivers/usb/storage/unusual_devs.h
1720 ++++ b/drivers/usb/storage/unusual_devs.h
1721 +@@ -2294,6 +2294,13 @@ UNUSUAL_DEV( 0x1e74, 0x4621, 0x0000, 0x0000,
1722 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1723 + US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ),
1724 +
1725 ++/* Reported by Witold Lipieta <witold.lipieta@×××××××××.com> */
1726 ++UNUSUAL_DEV( 0x1fc9, 0x0117, 0x0100, 0x0100,
1727 ++ "NXP Semiconductors",
1728 ++ "PN7462AU",
1729 ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1730 ++ US_FL_IGNORE_RESIDUE ),
1731 ++
1732 + /* Supplied with some Castlewood ORB removable drives */
1733 + UNUSUAL_DEV( 0x2027, 0xa001, 0x0000, 0x9999,
1734 + "Double-H Technology",
1735 +diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c
1736 +index e62e5e3da01e4..5e293ccf0e904 100644
1737 +--- a/drivers/usb/typec/altmodes/displayport.c
1738 ++++ b/drivers/usb/typec/altmodes/displayport.c
1739 +@@ -88,8 +88,8 @@ static int dp_altmode_configure(struct dp_altmode *dp, u8 con)
1740 + case DP_STATUS_CON_UFP_D:
1741 + case DP_STATUS_CON_BOTH: /* NOTE: First acting as DP source */
1742 + conf |= DP_CONF_UFP_U_AS_UFP_D;
1743 +- pin_assign = DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo) &
1744 +- DP_CAP_UFP_D_PIN_ASSIGN(dp->port->vdo);
1745 ++ pin_assign = DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo) &
1746 ++ DP_CAP_PIN_ASSIGN_DFP_D(dp->port->vdo);
1747 + break;
1748 + default:
1749 + break;
1750 +diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
1751 +index 5c83d41766c85..0a2d24d6ac6f7 100644
1752 +--- a/drivers/xen/grant-table.c
1753 ++++ b/drivers/xen/grant-table.c
1754 +@@ -981,6 +981,9 @@ int gnttab_dma_alloc_pages(struct gnttab_dma_alloc_args *args)
1755 + size_t size;
1756 + int i, ret;
1757 +
1758 ++ if (args->nr_pages < 0 || args->nr_pages > (INT_MAX >> PAGE_SHIFT))
1759 ++ return -ENOMEM;
1760 ++
1761 + size = args->nr_pages << PAGE_SHIFT;
1762 + if (args->coherent)
1763 + args->vaddr = dma_alloc_coherent(args->dev, size,
1764 +diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
1765 +index 2fdf178aa76f6..d4d89e0738ff4 100644
1766 +--- a/fs/btrfs/volumes.c
1767 ++++ b/fs/btrfs/volumes.c
1768 +@@ -540,15 +540,47 @@ error:
1769 + return ret;
1770 + }
1771 +
1772 +-static bool device_path_matched(const char *path, struct btrfs_device *device)
1773 ++/*
1774 ++ * Check if the device in the path matches the device in the given struct device.
1775 ++ *
1776 ++ * Returns:
1777 ++ * true If it is the same device.
1778 ++ * false If it is not the same device or on error.
1779 ++ */
1780 ++static bool device_matched(const struct btrfs_device *device, const char *path)
1781 + {
1782 +- int found;
1783 ++ char *device_name;
1784 ++ struct block_device *bdev_old;
1785 ++ struct block_device *bdev_new;
1786 ++
1787 ++ /*
1788 ++ * If we are looking for a device with the matching dev_t, then skip
1789 ++ * device without a name (a missing device).
1790 ++ */
1791 ++ if (!device->name)
1792 ++ return false;
1793 ++
1794 ++ device_name = kzalloc(BTRFS_PATH_NAME_MAX, GFP_KERNEL);
1795 ++ if (!device_name)
1796 ++ return false;
1797 +
1798 + rcu_read_lock();
1799 +- found = strcmp(rcu_str_deref(device->name), path);
1800 ++ scnprintf(device_name, BTRFS_PATH_NAME_MAX, "%s", rcu_str_deref(device->name));
1801 + rcu_read_unlock();
1802 +
1803 +- return found == 0;
1804 ++ bdev_old = lookup_bdev(device_name);
1805 ++ kfree(device_name);
1806 ++ if (IS_ERR(bdev_old))
1807 ++ return false;
1808 ++
1809 ++ bdev_new = lookup_bdev(path);
1810 ++ if (IS_ERR(bdev_new))
1811 ++ return false;
1812 ++
1813 ++ if (bdev_old == bdev_new)
1814 ++ return true;
1815 ++
1816 ++ return false;
1817 + }
1818 +
1819 + /*
1820 +@@ -581,9 +613,7 @@ static int btrfs_free_stale_devices(const char *path,
1821 + &fs_devices->devices, dev_list) {
1822 + if (skip_device && skip_device == device)
1823 + continue;
1824 +- if (path && !device->name)
1825 +- continue;
1826 +- if (path && !device_path_matched(path, device))
1827 ++ if (path && !device_matched(device, path))
1828 + continue;
1829 + if (fs_devices->opened) {
1830 + /* for an already deleted device return 0 */
1831 +diff --git a/include/linux/platform_data/x86/pmc_atom.h b/include/linux/platform_data/x86/pmc_atom.h
1832 +index 022bcea9edec5..99a9b09dc839d 100644
1833 +--- a/include/linux/platform_data/x86/pmc_atom.h
1834 ++++ b/include/linux/platform_data/x86/pmc_atom.h
1835 +@@ -7,6 +7,8 @@
1836 + #ifndef PMC_ATOM_H
1837 + #define PMC_ATOM_H
1838 +
1839 ++#include <linux/bits.h>
1840 ++
1841 + /* ValleyView Power Control Unit PCI Device ID */
1842 + #define PCI_DEVICE_ID_VLV_PMC 0x0F1C
1843 + /* CherryTrail Power Control Unit PCI Device ID */
1844 +@@ -139,9 +141,9 @@
1845 + #define ACPI_MMIO_REG_LEN 0x100
1846 +
1847 + #define PM1_CNT 0x4
1848 +-#define SLEEP_TYPE_MASK 0xFFFFECFF
1849 ++#define SLEEP_TYPE_MASK GENMASK(12, 10)
1850 + #define SLEEP_TYPE_S5 0x1C00
1851 +-#define SLEEP_ENABLE 0x2000
1852 ++#define SLEEP_ENABLE BIT(13)
1853 +
1854 + extern int pmc_atom_read(int offset, u32 *value);
1855 + extern int pmc_atom_write(int offset, u32 value);
1856 +diff --git a/include/linux/usb.h b/include/linux/usb.h
1857 +index d6a41841b93e4..a093667991bb9 100644
1858 +--- a/include/linux/usb.h
1859 ++++ b/include/linux/usb.h
1860 +@@ -580,6 +580,7 @@ struct usb3_lpm_parameters {
1861 + * @devaddr: device address, XHCI: assigned by HW, others: same as devnum
1862 + * @can_submit: URBs may be submitted
1863 + * @persist_enabled: USB_PERSIST enabled for this device
1864 ++ * @reset_in_progress: the device is being reset
1865 + * @have_langid: whether string_langid is valid
1866 + * @authorized: policy has said we can use it;
1867 + * (user space) policy determines if we authorize this device to be
1868 +@@ -665,6 +666,7 @@ struct usb_device {
1869 +
1870 + unsigned can_submit:1;
1871 + unsigned persist_enabled:1;
1872 ++ unsigned reset_in_progress:1;
1873 + unsigned have_langid:1;
1874 + unsigned authorized:1;
1875 + unsigned authenticated:1;
1876 +diff --git a/include/linux/usb/typec_dp.h b/include/linux/usb/typec_dp.h
1877 +index fc4c7edb2e8a4..296909ea04f26 100644
1878 +--- a/include/linux/usb/typec_dp.h
1879 ++++ b/include/linux/usb/typec_dp.h
1880 +@@ -73,6 +73,11 @@ enum {
1881 + #define DP_CAP_USB BIT(7)
1882 + #define DP_CAP_DFP_D_PIN_ASSIGN(_cap_) (((_cap_) & GENMASK(15, 8)) >> 8)
1883 + #define DP_CAP_UFP_D_PIN_ASSIGN(_cap_) (((_cap_) & GENMASK(23, 16)) >> 16)
1884 ++/* Get pin assignment taking plug & receptacle into consideration */
1885 ++#define DP_CAP_PIN_ASSIGN_UFP_D(_cap_) ((_cap_ & DP_CAP_RECEPTACLE) ? \
1886 ++ DP_CAP_UFP_D_PIN_ASSIGN(_cap_) : DP_CAP_DFP_D_PIN_ASSIGN(_cap_))
1887 ++#define DP_CAP_PIN_ASSIGN_DFP_D(_cap_) ((_cap_ & DP_CAP_RECEPTACLE) ? \
1888 ++ DP_CAP_DFP_D_PIN_ASSIGN(_cap_) : DP_CAP_UFP_D_PIN_ASSIGN(_cap_))
1889 +
1890 + /* DisplayPort Status Update VDO bits */
1891 + #define DP_STATUS_CONNECTION(_status_) ((_status_) & 3)
1892 +diff --git a/kernel/bpf/cgroup.c b/kernel/bpf/cgroup.c
1893 +index d154e52dd7ae0..6d92e393e1bc6 100644
1894 +--- a/kernel/bpf/cgroup.c
1895 ++++ b/kernel/bpf/cgroup.c
1896 +@@ -695,8 +695,10 @@ static void purge_effective_progs(struct cgroup *cgrp, struct bpf_prog *prog,
1897 + pos++;
1898 + }
1899 + }
1900 ++
1901 ++ /* no link or prog match, skip the cgroup of this layer */
1902 ++ continue;
1903 + found:
1904 +- BUG_ON(!cg);
1905 + progs = rcu_dereference_protected(
1906 + desc->bpf.effective[type],
1907 + lockdep_is_held(&cgroup_mutex));
1908 +diff --git a/mm/pagewalk.c b/mm/pagewalk.c
1909 +index e81640d9f1770..371ec21a19899 100644
1910 +--- a/mm/pagewalk.c
1911 ++++ b/mm/pagewalk.c
1912 +@@ -71,7 +71,7 @@ static int walk_pmd_range(pud_t *pud, unsigned long addr, unsigned long end,
1913 + do {
1914 + again:
1915 + next = pmd_addr_end(addr, end);
1916 +- if (pmd_none(*pmd) || (!walk->vma && !walk->no_vma)) {
1917 ++ if (pmd_none(*pmd)) {
1918 + if (ops->pte_hole)
1919 + err = ops->pte_hole(addr, next, depth, walk);
1920 + if (err)
1921 +@@ -129,7 +129,7 @@ static int walk_pud_range(p4d_t *p4d, unsigned long addr, unsigned long end,
1922 + do {
1923 + again:
1924 + next = pud_addr_end(addr, end);
1925 +- if (pud_none(*pud) || (!walk->vma && !walk->no_vma)) {
1926 ++ if (pud_none(*pud)) {
1927 + if (ops->pte_hole)
1928 + err = ops->pte_hole(addr, next, depth, walk);
1929 + if (err)
1930 +@@ -318,19 +318,19 @@ static int __walk_page_range(unsigned long start, unsigned long end,
1931 + struct vm_area_struct *vma = walk->vma;
1932 + const struct mm_walk_ops *ops = walk->ops;
1933 +
1934 +- if (vma && ops->pre_vma) {
1935 ++ if (ops->pre_vma) {
1936 + err = ops->pre_vma(start, end, walk);
1937 + if (err)
1938 + return err;
1939 + }
1940 +
1941 +- if (vma && is_vm_hugetlb_page(vma)) {
1942 ++ if (is_vm_hugetlb_page(vma)) {
1943 + if (ops->hugetlb_entry)
1944 + err = walk_hugetlb_range(start, end, walk);
1945 + } else
1946 + err = walk_pgd_range(start, end, walk);
1947 +
1948 +- if (vma && ops->post_vma)
1949 ++ if (ops->post_vma)
1950 + ops->post_vma(walk);
1951 +
1952 + return err;
1953 +@@ -402,9 +402,13 @@ int walk_page_range(struct mm_struct *mm, unsigned long start,
1954 + if (!vma) { /* after the last vma */
1955 + walk.vma = NULL;
1956 + next = end;
1957 ++ if (ops->pte_hole)
1958 ++ err = ops->pte_hole(start, next, -1, &walk);
1959 + } else if (start < vma->vm_start) { /* outside vma */
1960 + walk.vma = NULL;
1961 + next = min(end, vma->vm_start);
1962 ++ if (ops->pte_hole)
1963 ++ err = ops->pte_hole(start, next, -1, &walk);
1964 + } else { /* inside vma */
1965 + walk.vma = vma;
1966 + next = min(end, vma->vm_end);
1967 +@@ -422,9 +426,8 @@ int walk_page_range(struct mm_struct *mm, unsigned long start,
1968 + }
1969 + if (err < 0)
1970 + break;
1971 +- }
1972 +- if (walk.vma || walk.ops->pte_hole)
1973 + err = __walk_page_range(start, next, &walk);
1974 ++ }
1975 + if (err)
1976 + break;
1977 + } while (start = next, start < end);
1978 +@@ -453,9 +456,9 @@ int walk_page_range_novma(struct mm_struct *mm, unsigned long start,
1979 + if (start >= end || !walk.mm)
1980 + return -EINVAL;
1981 +
1982 +- mmap_assert_locked(walk.mm);
1983 ++ mmap_assert_write_locked(walk.mm);
1984 +
1985 +- return __walk_page_range(start, end, &walk);
1986 ++ return walk_pgd_range(start, end, &walk);
1987 + }
1988 +
1989 + int walk_page_vma(struct vm_area_struct *vma, const struct mm_walk_ops *ops,
1990 +diff --git a/mm/ptdump.c b/mm/ptdump.c
1991 +index 93f2f63dc52dc..a917bf55c61ea 100644
1992 +--- a/mm/ptdump.c
1993 ++++ b/mm/ptdump.c
1994 +@@ -141,13 +141,13 @@ void ptdump_walk_pgd(struct ptdump_state *st, struct mm_struct *mm, pgd_t *pgd)
1995 + {
1996 + const struct ptdump_range *range = st->range;
1997 +
1998 +- mmap_read_lock(mm);
1999 ++ mmap_write_lock(mm);
2000 + while (range->start != range->end) {
2001 + walk_page_range_novma(mm, range->start, range->end,
2002 + &ptdump_ops, pgd, st);
2003 + range++;
2004 + }
2005 +- mmap_read_unlock(mm);
2006 ++ mmap_write_unlock(mm);
2007 +
2008 + /* Flush out the last page */
2009 + st->note_page(st, 0, -1, 0);
2010 +diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
2011 +index 0df4594b49c78..af8a4255cf1ba 100644
2012 +--- a/net/ipv4/fib_frontend.c
2013 ++++ b/net/ipv4/fib_frontend.c
2014 +@@ -389,7 +389,7 @@ static int __fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
2015 + dev_match = dev_match || (res.type == RTN_LOCAL &&
2016 + dev == net->loopback_dev);
2017 + if (dev_match) {
2018 +- ret = FIB_RES_NHC(res)->nhc_scope >= RT_SCOPE_HOST;
2019 ++ ret = FIB_RES_NHC(res)->nhc_scope >= RT_SCOPE_LINK;
2020 + return ret;
2021 + }
2022 + if (no_addr)
2023 +@@ -401,7 +401,7 @@ static int __fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
2024 + ret = 0;
2025 + if (fib_lookup(net, &fl4, &res, FIB_LOOKUP_IGNORE_LINKSTATE) == 0) {
2026 + if (res.type == RTN_UNICAST)
2027 +- ret = FIB_RES_NHC(res)->nhc_scope >= RT_SCOPE_HOST;
2028 ++ ret = FIB_RES_NHC(res)->nhc_scope >= RT_SCOPE_LINK;
2029 + }
2030 + return ret;
2031 +
2032 +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
2033 +index 41b44b311e8a0..e62500d6fe0d0 100644
2034 +--- a/net/ipv4/tcp_input.c
2035 ++++ b/net/ipv4/tcp_input.c
2036 +@@ -3599,11 +3599,11 @@ static void tcp_send_challenge_ack(struct sock *sk, const struct sk_buff *skb)
2037 +
2038 + /* Then check host-wide RFC 5961 rate limit. */
2039 + now = jiffies / HZ;
2040 +- if (now != challenge_timestamp) {
2041 ++ if (now != READ_ONCE(challenge_timestamp)) {
2042 + u32 ack_limit = READ_ONCE(net->ipv4.sysctl_tcp_challenge_ack_limit);
2043 + u32 half = (ack_limit + 1) >> 1;
2044 +
2045 +- challenge_timestamp = now;
2046 ++ WRITE_ONCE(challenge_timestamp, now);
2047 + WRITE_ONCE(challenge_count, half + prandom_u32_max(ack_limit));
2048 + }
2049 + count = READ_ONCE(challenge_count);
2050 +diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
2051 +index 56dad9565bc93..18469f1f707e5 100644
2052 +--- a/net/kcm/kcmsock.c
2053 ++++ b/net/kcm/kcmsock.c
2054 +@@ -1411,12 +1411,6 @@ static int kcm_attach(struct socket *sock, struct socket *csock,
2055 + psock->sk = csk;
2056 + psock->bpf_prog = prog;
2057 +
2058 +- err = strp_init(&psock->strp, csk, &cb);
2059 +- if (err) {
2060 +- kmem_cache_free(kcm_psockp, psock);
2061 +- goto out;
2062 +- }
2063 +-
2064 + write_lock_bh(&csk->sk_callback_lock);
2065 +
2066 + /* Check if sk_user_data is aready by KCM or someone else.
2067 +@@ -1424,13 +1418,18 @@ static int kcm_attach(struct socket *sock, struct socket *csock,
2068 + */
2069 + if (csk->sk_user_data) {
2070 + write_unlock_bh(&csk->sk_callback_lock);
2071 +- strp_stop(&psock->strp);
2072 +- strp_done(&psock->strp);
2073 + kmem_cache_free(kcm_psockp, psock);
2074 + err = -EALREADY;
2075 + goto out;
2076 + }
2077 +
2078 ++ err = strp_init(&psock->strp, csk, &cb);
2079 ++ if (err) {
2080 ++ write_unlock_bh(&csk->sk_callback_lock);
2081 ++ kmem_cache_free(kcm_psockp, psock);
2082 ++ goto out;
2083 ++ }
2084 ++
2085 + psock->save_data_ready = csk->sk_data_ready;
2086 + psock->save_write_space = csk->sk_write_space;
2087 + psock->save_state_change = csk->sk_state_change;
2088 +diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
2089 +index a7ac53a2f00d8..78ae58ec397a0 100644
2090 +--- a/net/mac80211/ibss.c
2091 ++++ b/net/mac80211/ibss.c
2092 +@@ -541,6 +541,10 @@ int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata)
2093 +
2094 + sdata_assert_lock(sdata);
2095 +
2096 ++ /* When not connected/joined, sending CSA doesn't make sense. */
2097 ++ if (ifibss->state != IEEE80211_IBSS_MLME_JOINED)
2098 ++ return -ENOLINK;
2099 ++
2100 + /* update cfg80211 bss information with the new channel */
2101 + if (!is_zero_ether_addr(ifibss->bssid)) {
2102 + cbss = cfg80211_get_bss(sdata->local->hw.wiphy,
2103 +diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
2104 +index 887f945bb12d4..d6afaacaf7ef8 100644
2105 +--- a/net/mac80211/scan.c
2106 ++++ b/net/mac80211/scan.c
2107 +@@ -461,16 +461,19 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
2108 + scan_req = rcu_dereference_protected(local->scan_req,
2109 + lockdep_is_held(&local->mtx));
2110 +
2111 +- if (scan_req != local->int_scan_req) {
2112 +- local->scan_info.aborted = aborted;
2113 +- cfg80211_scan_done(scan_req, &local->scan_info);
2114 +- }
2115 + RCU_INIT_POINTER(local->scan_req, NULL);
2116 + RCU_INIT_POINTER(local->scan_sdata, NULL);
2117 +
2118 + local->scanning = 0;
2119 + local->scan_chandef.chan = NULL;
2120 +
2121 ++ synchronize_rcu();
2122 ++
2123 ++ if (scan_req != local->int_scan_req) {
2124 ++ local->scan_info.aborted = aborted;
2125 ++ cfg80211_scan_done(scan_req, &local->scan_info);
2126 ++ }
2127 ++
2128 + /* Set power back to normal operating levels. */
2129 + ieee80211_hw_config(local, 0);
2130 +
2131 +diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
2132 +index 461c03737da8d..cee39ae52245c 100644
2133 +--- a/net/mac80211/sta_info.c
2134 ++++ b/net/mac80211/sta_info.c
2135 +@@ -2175,9 +2175,9 @@ static inline u64 sta_get_tidstats_msdu(struct ieee80211_sta_rx_stats *rxstats,
2136 + u64 value;
2137 +
2138 + do {
2139 +- start = u64_stats_fetch_begin(&rxstats->syncp);
2140 ++ start = u64_stats_fetch_begin_irq(&rxstats->syncp);
2141 + value = rxstats->msdu[tid];
2142 +- } while (u64_stats_fetch_retry(&rxstats->syncp, start));
2143 ++ } while (u64_stats_fetch_retry_irq(&rxstats->syncp, start));
2144 +
2145 + return value;
2146 + }
2147 +@@ -2241,9 +2241,9 @@ static inline u64 sta_get_stats_bytes(struct ieee80211_sta_rx_stats *rxstats)
2148 + u64 value;
2149 +
2150 + do {
2151 +- start = u64_stats_fetch_begin(&rxstats->syncp);
2152 ++ start = u64_stats_fetch_begin_irq(&rxstats->syncp);
2153 + value = rxstats->bytes;
2154 +- } while (u64_stats_fetch_retry(&rxstats->syncp, start));
2155 ++ } while (u64_stats_fetch_retry_irq(&rxstats->syncp, start));
2156 +
2157 + return value;
2158 + }
2159 +diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c
2160 +index b8ce84618a55b..c439125ef2b91 100644
2161 +--- a/net/mac802154/rx.c
2162 ++++ b/net/mac802154/rx.c
2163 +@@ -44,7 +44,7 @@ ieee802154_subif_frame(struct ieee802154_sub_if_data *sdata,
2164 +
2165 + switch (mac_cb(skb)->dest.mode) {
2166 + case IEEE802154_ADDR_NONE:
2167 +- if (mac_cb(skb)->dest.mode != IEEE802154_ADDR_NONE)
2168 ++ if (hdr->source.mode != IEEE802154_ADDR_NONE)
2169 + /* FIXME: check if we are PAN coordinator */
2170 + skb->pkt_type = PACKET_OTHERHOST;
2171 + else
2172 +diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
2173 +index 9c047c148a112..72398149e4d4f 100644
2174 +--- a/net/mpls/af_mpls.c
2175 ++++ b/net/mpls/af_mpls.c
2176 +@@ -1078,9 +1078,9 @@ static void mpls_get_stats(struct mpls_dev *mdev,
2177 +
2178 + p = per_cpu_ptr(mdev->stats, i);
2179 + do {
2180 +- start = u64_stats_fetch_begin(&p->syncp);
2181 ++ start = u64_stats_fetch_begin_irq(&p->syncp);
2182 + local = p->stats;
2183 +- } while (u64_stats_fetch_retry(&p->syncp, start));
2184 ++ } while (u64_stats_fetch_retry_irq(&p->syncp, start));
2185 +
2186 + stats->rx_packets += local.rx_packets;
2187 + stats->rx_bytes += local.rx_bytes;
2188 +diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
2189 +index 68f1e89430b3b..ecdd9e83f2f49 100644
2190 +--- a/net/sched/sch_generic.c
2191 ++++ b/net/sched/sch_generic.c
2192 +@@ -1057,6 +1057,21 @@ struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
2193 + }
2194 + EXPORT_SYMBOL(dev_graft_qdisc);
2195 +
2196 ++static void shutdown_scheduler_queue(struct net_device *dev,
2197 ++ struct netdev_queue *dev_queue,
2198 ++ void *_qdisc_default)
2199 ++{
2200 ++ struct Qdisc *qdisc = dev_queue->qdisc_sleeping;
2201 ++ struct Qdisc *qdisc_default = _qdisc_default;
2202 ++
2203 ++ if (qdisc) {
2204 ++ rcu_assign_pointer(dev_queue->qdisc, qdisc_default);
2205 ++ dev_queue->qdisc_sleeping = qdisc_default;
2206 ++
2207 ++ qdisc_put(qdisc);
2208 ++ }
2209 ++}
2210 ++
2211 + static void attach_one_default_qdisc(struct net_device *dev,
2212 + struct netdev_queue *dev_queue,
2213 + void *_unused)
2214 +@@ -1104,6 +1119,7 @@ static void attach_default_qdiscs(struct net_device *dev)
2215 + if (qdisc == &noop_qdisc) {
2216 + netdev_warn(dev, "default qdisc (%s) fail, fallback to %s\n",
2217 + default_qdisc_ops->id, noqueue_qdisc_ops.id);
2218 ++ netdev_for_each_tx_queue(dev, shutdown_scheduler_queue, &noop_qdisc);
2219 + dev->priv_flags |= IFF_NO_QUEUE;
2220 + netdev_for_each_tx_queue(dev, attach_one_default_qdisc, NULL);
2221 + qdisc = txq->qdisc_sleeping;
2222 +@@ -1357,21 +1373,6 @@ void dev_init_scheduler(struct net_device *dev)
2223 + timer_setup(&dev->watchdog_timer, dev_watchdog, 0);
2224 + }
2225 +
2226 +-static void shutdown_scheduler_queue(struct net_device *dev,
2227 +- struct netdev_queue *dev_queue,
2228 +- void *_qdisc_default)
2229 +-{
2230 +- struct Qdisc *qdisc = dev_queue->qdisc_sleeping;
2231 +- struct Qdisc *qdisc_default = _qdisc_default;
2232 +-
2233 +- if (qdisc) {
2234 +- rcu_assign_pointer(dev_queue->qdisc, qdisc_default);
2235 +- dev_queue->qdisc_sleeping = qdisc_default;
2236 +-
2237 +- qdisc_put(qdisc);
2238 +- }
2239 +-}
2240 +-
2241 + void dev_shutdown(struct net_device *dev)
2242 + {
2243 + netdev_for_each_tx_queue(dev, shutdown_scheduler_queue, &noop_qdisc);
2244 +diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
2245 +index 78e79029dc631..6eb17004a9e44 100644
2246 +--- a/net/sched/sch_tbf.c
2247 ++++ b/net/sched/sch_tbf.c
2248 +@@ -342,6 +342,7 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt,
2249 + struct nlattr *tb[TCA_TBF_MAX + 1];
2250 + struct tc_tbf_qopt *qopt;
2251 + struct Qdisc *child = NULL;
2252 ++ struct Qdisc *old = NULL;
2253 + struct psched_ratecfg rate;
2254 + struct psched_ratecfg peak;
2255 + u64 max_size;
2256 +@@ -433,7 +434,7 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt,
2257 + sch_tree_lock(sch);
2258 + if (child) {
2259 + qdisc_tree_flush_backlog(q->qdisc);
2260 +- qdisc_put(q->qdisc);
2261 ++ old = q->qdisc;
2262 + q->qdisc = child;
2263 + }
2264 + q->limit = qopt->limit;
2265 +@@ -453,6 +454,7 @@ static int tbf_change(struct Qdisc *sch, struct nlattr *opt,
2266 + memcpy(&q->peak, &peak, sizeof(struct psched_ratecfg));
2267 +
2268 + sch_tree_unlock(sch);
2269 ++ qdisc_put(old);
2270 + err = 0;
2271 +
2272 + tbf_offload_change(sch);
2273 +diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
2274 +index 5d7710dd95145..41cbc7c89c9d2 100644
2275 +--- a/net/smc/af_smc.c
2276 ++++ b/net/smc/af_smc.c
2277 +@@ -1325,7 +1325,6 @@ static void smc_listen_out_connected(struct smc_sock *new_smc)
2278 + {
2279 + struct sock *newsmcsk = &new_smc->sk;
2280 +
2281 +- sk_refcnt_debug_inc(newsmcsk);
2282 + if (newsmcsk->sk_state == SMC_INIT)
2283 + newsmcsk->sk_state = SMC_ACTIVE;
2284 +
2285 +diff --git a/net/wireless/debugfs.c b/net/wireless/debugfs.c
2286 +index 76b845f68ac89..d80b06d669593 100644
2287 +--- a/net/wireless/debugfs.c
2288 ++++ b/net/wireless/debugfs.c
2289 +@@ -65,9 +65,10 @@ static ssize_t ht40allow_map_read(struct file *file,
2290 + {
2291 + struct wiphy *wiphy = file->private_data;
2292 + char *buf;
2293 +- unsigned int offset = 0, buf_size = PAGE_SIZE, i, r;
2294 ++ unsigned int offset = 0, buf_size = PAGE_SIZE, i;
2295 + enum nl80211_band band;
2296 + struct ieee80211_supported_band *sband;
2297 ++ ssize_t r;
2298 +
2299 + buf = kzalloc(buf_size, GFP_KERNEL);
2300 + if (!buf)
2301 +diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c
2302 +index 2ddfe22266517..f73ee0798aeab 100644
2303 +--- a/sound/core/seq/oss/seq_oss_midi.c
2304 ++++ b/sound/core/seq/oss/seq_oss_midi.c
2305 +@@ -267,7 +267,9 @@ snd_seq_oss_midi_clear_all(void)
2306 + void
2307 + snd_seq_oss_midi_setup(struct seq_oss_devinfo *dp)
2308 + {
2309 ++ spin_lock_irq(&register_lock);
2310 + dp->max_mididev = max_midi_devs;
2311 ++ spin_unlock_irq(&register_lock);
2312 + }
2313 +
2314 + /*
2315 +diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
2316 +index cc93157fa9500..0363670a56e7c 100644
2317 +--- a/sound/core/seq/seq_clientmgr.c
2318 ++++ b/sound/core/seq/seq_clientmgr.c
2319 +@@ -121,13 +121,13 @@ struct snd_seq_client *snd_seq_client_use_ptr(int clientid)
2320 + spin_unlock_irqrestore(&clients_lock, flags);
2321 + #ifdef CONFIG_MODULES
2322 + if (!in_interrupt()) {
2323 +- static char client_requested[SNDRV_SEQ_GLOBAL_CLIENTS];
2324 +- static char card_requested[SNDRV_CARDS];
2325 ++ static DECLARE_BITMAP(client_requested, SNDRV_SEQ_GLOBAL_CLIENTS);
2326 ++ static DECLARE_BITMAP(card_requested, SNDRV_CARDS);
2327 ++
2328 + if (clientid < SNDRV_SEQ_GLOBAL_CLIENTS) {
2329 + int idx;
2330 +
2331 +- if (!client_requested[clientid]) {
2332 +- client_requested[clientid] = 1;
2333 ++ if (!test_and_set_bit(clientid, client_requested)) {
2334 + for (idx = 0; idx < 15; idx++) {
2335 + if (seq_client_load[idx] < 0)
2336 + break;
2337 +@@ -142,10 +142,8 @@ struct snd_seq_client *snd_seq_client_use_ptr(int clientid)
2338 + int card = (clientid - SNDRV_SEQ_GLOBAL_CLIENTS) /
2339 + SNDRV_SEQ_CLIENTS_PER_CARD;
2340 + if (card < snd_ecards_limit) {
2341 +- if (! card_requested[card]) {
2342 +- card_requested[card] = 1;
2343 ++ if (!test_and_set_bit(card, card_requested))
2344 + snd_request_card(card);
2345 +- }
2346 + snd_seq_device_load_drivers();
2347 + }
2348 + }
2349 +diff --git a/sound/hda/intel-nhlt.c b/sound/hda/intel-nhlt.c
2350 +index e2237239d922a..8714891f50b0a 100644
2351 +--- a/sound/hda/intel-nhlt.c
2352 ++++ b/sound/hda/intel-nhlt.c
2353 +@@ -55,20 +55,26 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
2354 +
2355 + /* find max number of channels based on format_configuration */
2356 + if (fmt_configs->fmt_count) {
2357 +- dev_dbg(dev, "%s: found %d format definitions\n",
2358 +- __func__, fmt_configs->fmt_count);
2359 ++ struct nhlt_fmt_cfg *fmt_cfg = fmt_configs->fmt_config;
2360 ++
2361 ++ dev_dbg(dev, "found %d format definitions\n",
2362 ++ fmt_configs->fmt_count);
2363 +
2364 + for (i = 0; i < fmt_configs->fmt_count; i++) {
2365 + struct wav_fmt_ext *fmt_ext;
2366 +
2367 +- fmt_ext = &fmt_configs->fmt_config[i].fmt_ext;
2368 ++ fmt_ext = &fmt_cfg->fmt_ext;
2369 +
2370 + if (fmt_ext->fmt.channels > max_ch)
2371 + max_ch = fmt_ext->fmt.channels;
2372 ++
2373 ++ /* Move to the next nhlt_fmt_cfg */
2374 ++ fmt_cfg = (struct nhlt_fmt_cfg *)(fmt_cfg->config.caps +
2375 ++ fmt_cfg->config.size);
2376 + }
2377 +- dev_dbg(dev, "%s: max channels found %d\n", __func__, max_ch);
2378 ++ dev_dbg(dev, "max channels found %d\n", max_ch);
2379 + } else {
2380 +- dev_dbg(dev, "%s: No format information found\n", __func__);
2381 ++ dev_dbg(dev, "No format information found\n");
2382 + }
2383 +
2384 + if (cfg->device_config.config_type != NHLT_CONFIG_TYPE_MIC_ARRAY) {
2385 +@@ -95,17 +101,16 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt)
2386 + }
2387 +
2388 + if (dmic_geo > 0) {
2389 +- dev_dbg(dev, "%s: Array with %d dmics\n", __func__, dmic_geo);
2390 ++ dev_dbg(dev, "Array with %d dmics\n", dmic_geo);
2391 + }
2392 + if (max_ch > dmic_geo) {
2393 +- dev_dbg(dev, "%s: max channels %d exceed dmic number %d\n",
2394 +- __func__, max_ch, dmic_geo);
2395 ++ dev_dbg(dev, "max channels %d exceed dmic number %d\n",
2396 ++ max_ch, dmic_geo);
2397 + }
2398 + }
2399 + }
2400 +
2401 +- dev_dbg(dev, "%s: dmic number %d max_ch %d\n",
2402 +- __func__, dmic_geo, max_ch);
2403 ++ dev_dbg(dev, "dmic number %d max_ch %d\n", dmic_geo, max_ch);
2404 +
2405 + return dmic_geo;
2406 + }
2407 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
2408 +index 6e679c86b6fa3..78f4f684a3c72 100644
2409 +--- a/sound/pci/hda/patch_realtek.c
2410 ++++ b/sound/pci/hda/patch_realtek.c
2411 +@@ -4628,6 +4628,48 @@ static void alc236_fixup_hp_mute_led_micmute_vref(struct hda_codec *codec,
2412 + alc236_fixup_hp_micmute_led_vref(codec, fix, action);
2413 + }
2414 +
2415 ++static inline void alc298_samsung_write_coef_pack(struct hda_codec *codec,
2416 ++ const unsigned short coefs[2])
2417 ++{
2418 ++ alc_write_coef_idx(codec, 0x23, coefs[0]);
2419 ++ alc_write_coef_idx(codec, 0x25, coefs[1]);
2420 ++ alc_write_coef_idx(codec, 0x26, 0xb011);
2421 ++}
2422 ++
2423 ++struct alc298_samsung_amp_desc {
2424 ++ unsigned char nid;
2425 ++ unsigned short init_seq[2][2];
2426 ++};
2427 ++
2428 ++static void alc298_fixup_samsung_amp(struct hda_codec *codec,
2429 ++ const struct hda_fixup *fix, int action)
2430 ++{
2431 ++ int i, j;
2432 ++ static const unsigned short init_seq[][2] = {
2433 ++ { 0x19, 0x00 }, { 0x20, 0xc0 }, { 0x22, 0x44 }, { 0x23, 0x08 },
2434 ++ { 0x24, 0x85 }, { 0x25, 0x41 }, { 0x35, 0x40 }, { 0x36, 0x01 },
2435 ++ { 0x38, 0x81 }, { 0x3a, 0x03 }, { 0x3b, 0x81 }, { 0x40, 0x3e },
2436 ++ { 0x41, 0x07 }, { 0x400, 0x1 }
2437 ++ };
2438 ++ static const struct alc298_samsung_amp_desc amps[] = {
2439 ++ { 0x3a, { { 0x18, 0x1 }, { 0x26, 0x0 } } },
2440 ++ { 0x39, { { 0x18, 0x2 }, { 0x26, 0x1 } } }
2441 ++ };
2442 ++
2443 ++ if (action != HDA_FIXUP_ACT_INIT)
2444 ++ return;
2445 ++
2446 ++ for (i = 0; i < ARRAY_SIZE(amps); i++) {
2447 ++ alc_write_coef_idx(codec, 0x22, amps[i].nid);
2448 ++
2449 ++ for (j = 0; j < ARRAY_SIZE(amps[i].init_seq); j++)
2450 ++ alc298_samsung_write_coef_pack(codec, amps[i].init_seq[j]);
2451 ++
2452 ++ for (j = 0; j < ARRAY_SIZE(init_seq); j++)
2453 ++ alc298_samsung_write_coef_pack(codec, init_seq[j]);
2454 ++ }
2455 ++}
2456 ++
2457 + #if IS_REACHABLE(CONFIG_INPUT)
2458 + static void gpio2_mic_hotkey_event(struct hda_codec *codec,
2459 + struct hda_jack_callback *event)
2460 +@@ -6787,6 +6829,7 @@ enum {
2461 + ALC236_FIXUP_HP_GPIO_LED,
2462 + ALC236_FIXUP_HP_MUTE_LED,
2463 + ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF,
2464 ++ ALC298_FIXUP_SAMSUNG_AMP,
2465 + ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
2466 + ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET,
2467 + ALC295_FIXUP_ASUS_MIC_NO_PRESENCE,
2468 +@@ -8140,6 +8183,12 @@ static const struct hda_fixup alc269_fixups[] = {
2469 + .type = HDA_FIXUP_FUNC,
2470 + .v.func = alc236_fixup_hp_mute_led_micmute_vref,
2471 + },
2472 ++ [ALC298_FIXUP_SAMSUNG_AMP] = {
2473 ++ .type = HDA_FIXUP_FUNC,
2474 ++ .v.func = alc298_fixup_samsung_amp,
2475 ++ .chained = true,
2476 ++ .chain_id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET
2477 ++ },
2478 + [ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET] = {
2479 + .type = HDA_FIXUP_VERBS,
2480 + .v.verbs = (const struct hda_verb[]) {
2481 +@@ -8914,13 +8963,13 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
2482 + SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK),
2483 + SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE),
2484 + SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
2485 +- SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
2486 +- SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
2487 +- SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
2488 +- SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
2489 ++ SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
2490 ++ SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
2491 ++ SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
2492 ++ SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
2493 + SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8),
2494 +- SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
2495 +- SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
2496 ++ SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP),
2497 ++ SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP),
2498 + SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),
2499 + SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
2500 + SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
2501 +@@ -9280,7 +9329,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
2502 + {.id = ALC299_FIXUP_PREDATOR_SPK, .name = "predator-spk"},
2503 + {.id = ALC298_FIXUP_HUAWEI_MBX_STEREO, .name = "huawei-mbx-stereo"},
2504 + {.id = ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE, .name = "alc256-medion-headset"},
2505 +- {.id = ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc298-samsung-headphone"},
2506 ++ {.id = ALC298_FIXUP_SAMSUNG_AMP, .name = "alc298-samsung-amp"},
2507 + {.id = ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET, .name = "alc256-samsung-headphone"},
2508 + {.id = ALC255_FIXUP_XIAOMI_HEADSET_MIC, .name = "alc255-xiaomi-headset"},
2509 + {.id = ALC274_FIXUP_HP_MIC, .name = "alc274-hp-mic-detect"},