Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.2 commit in: /
Date: Fri, 06 Sep 2019 17:26:38
Message-Id: 1567790775.50acba1d52c3a0eeae20f935118bf8e76cab062b.mpagano@gentoo
1 commit: 50acba1d52c3a0eeae20f935118bf8e76cab062b
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 6 17:26:15 2019 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 6 17:26:15 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=50acba1d
7
8 Linux patch 5.2.12 and 5.2.13
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 1011_linux-5.2.12.patch | 5532 +++++++++++++++++++++++++++++++++++++++++++++++
13 1012_linux-5.2.13.patch | 92 +
14 2 files changed, 5624 insertions(+)
15
16 diff --git a/1011_linux-5.2.12.patch b/1011_linux-5.2.12.patch
17 new file mode 100644
18 index 0000000..0df54ef
19 --- /dev/null
20 +++ b/1011_linux-5.2.12.patch
21 @@ -0,0 +1,5532 @@
22 +diff --git a/Makefile b/Makefile
23 +index a3b26dcfc5c8..e26d52d93bb1 100644
24 +--- a/Makefile
25 ++++ b/Makefile
26 +@@ -1,7 +1,7 @@
27 + # SPDX-License-Identifier: GPL-2.0
28 + VERSION = 5
29 + PATCHLEVEL = 2
30 +-SUBLEVEL = 11
31 ++SUBLEVEL = 12
32 + EXTRAVERSION =
33 + NAME = Bobtail Squid
34 +
35 +diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
36 +index ae63eedea1c1..68faf535f40a 100644
37 +--- a/arch/arm64/kernel/cpufeature.c
38 ++++ b/arch/arm64/kernel/cpufeature.c
39 +@@ -184,9 +184,17 @@ static const struct arm64_ftr_bits ftr_id_aa64zfr0[] = {
40 + };
41 +
42 + static const struct arm64_ftr_bits ftr_id_aa64mmfr0[] = {
43 +- S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64MMFR0_TGRAN4_SHIFT, 4, ID_AA64MMFR0_TGRAN4_NI),
44 +- S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64MMFR0_TGRAN64_SHIFT, 4, ID_AA64MMFR0_TGRAN64_NI),
45 +- ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64MMFR0_TGRAN16_SHIFT, 4, ID_AA64MMFR0_TGRAN16_NI),
46 ++ /*
47 ++ * We already refuse to boot CPUs that don't support our configured
48 ++ * page size, so we can only detect mismatches for a page size other
49 ++ * than the one we're currently using. Unfortunately, SoCs like this
50 ++ * exist in the wild so, even though we don't like it, we'll have to go
51 ++ * along with it and treat them as non-strict.
52 ++ */
53 ++ S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64MMFR0_TGRAN4_SHIFT, 4, ID_AA64MMFR0_TGRAN4_NI),
54 ++ S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64MMFR0_TGRAN64_SHIFT, 4, ID_AA64MMFR0_TGRAN64_NI),
55 ++ ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64MMFR0_TGRAN16_SHIFT, 4, ID_AA64MMFR0_TGRAN16_NI),
56 ++
57 + ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_AA64MMFR0_BIGENDEL0_SHIFT, 4, 0),
58 + /* Linux shouldn't care about secure memory */
59 + ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64MMFR0_SNSMEM_SHIFT, 4, 0),
60 +diff --git a/arch/powerpc/kvm/book3s_64_vio.c b/arch/powerpc/kvm/book3s_64_vio.c
61 +index 5bf05cc774e2..446d91d6cf70 100644
62 +--- a/arch/powerpc/kvm/book3s_64_vio.c
63 ++++ b/arch/powerpc/kvm/book3s_64_vio.c
64 +@@ -696,8 +696,10 @@ long kvmppc_h_put_tce_indirect(struct kvm_vcpu *vcpu,
65 + }
66 + tce = be64_to_cpu(tce);
67 +
68 +- if (kvmppc_tce_to_ua(vcpu->kvm, tce, &ua))
69 +- return H_PARAMETER;
70 ++ if (kvmppc_tce_to_ua(vcpu->kvm, tce, &ua)) {
71 ++ ret = H_PARAMETER;
72 ++ goto unlock_exit;
73 ++ }
74 +
75 + list_for_each_entry_lockless(stit, &stt->iommu_tables, next) {
76 + ret = kvmppc_tce_iommu_map(vcpu->kvm, stt,
77 +diff --git a/arch/powerpc/kvm/book3s_64_vio_hv.c b/arch/powerpc/kvm/book3s_64_vio_hv.c
78 +index f50bbeedfc66..b4f20f13b860 100644
79 +--- a/arch/powerpc/kvm/book3s_64_vio_hv.c
80 ++++ b/arch/powerpc/kvm/book3s_64_vio_hv.c
81 +@@ -556,8 +556,10 @@ long kvmppc_rm_h_put_tce_indirect(struct kvm_vcpu *vcpu,
82 + unsigned long tce = be64_to_cpu(((u64 *)tces)[i]);
83 +
84 + ua = 0;
85 +- if (kvmppc_rm_tce_to_ua(vcpu->kvm, tce, &ua, NULL))
86 +- return H_PARAMETER;
87 ++ if (kvmppc_rm_tce_to_ua(vcpu->kvm, tce, &ua, NULL)) {
88 ++ ret = H_PARAMETER;
89 ++ goto unlock_exit;
90 ++ }
91 +
92 + list_for_each_entry_lockless(stit, &stt->iommu_tables, next) {
93 + ret = kvmppc_rm_tce_iommu_map(vcpu->kvm, stt,
94 +diff --git a/arch/riscv/include/asm/tlbflush.h b/arch/riscv/include/asm/tlbflush.h
95 +index 687dd19735a7..4d9bbe8438bf 100644
96 +--- a/arch/riscv/include/asm/tlbflush.h
97 ++++ b/arch/riscv/include/asm/tlbflush.h
98 +@@ -53,10 +53,17 @@ static inline void remote_sfence_vma(struct cpumask *cmask, unsigned long start,
99 + }
100 +
101 + #define flush_tlb_all() sbi_remote_sfence_vma(NULL, 0, -1)
102 +-#define flush_tlb_page(vma, addr) flush_tlb_range(vma, addr, 0)
103 ++
104 + #define flush_tlb_range(vma, start, end) \
105 + remote_sfence_vma(mm_cpumask((vma)->vm_mm), start, (end) - (start))
106 +-#define flush_tlb_mm(mm) \
107 ++
108 ++static inline void flush_tlb_page(struct vm_area_struct *vma,
109 ++ unsigned long addr)
110 ++{
111 ++ flush_tlb_range(vma, addr, addr + PAGE_SIZE);
112 ++}
113 ++
114 ++#define flush_tlb_mm(mm) \
115 + remote_sfence_vma(mm_cpumask(mm), 0, -1)
116 +
117 + #endif /* CONFIG_SMP */
118 +diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
119 +index 2f067b443326..97c3a1c9502e 100644
120 +--- a/arch/x86/kernel/apic/apic.c
121 ++++ b/arch/x86/kernel/apic/apic.c
122 +@@ -1152,6 +1152,10 @@ void clear_local_APIC(void)
123 + apic_write(APIC_LVT0, v | APIC_LVT_MASKED);
124 + v = apic_read(APIC_LVT1);
125 + apic_write(APIC_LVT1, v | APIC_LVT_MASKED);
126 ++ if (!x2apic_enabled()) {
127 ++ v = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
128 ++ apic_write(APIC_LDR, v);
129 ++ }
130 + if (maxlvt >= 4) {
131 + v = apic_read(APIC_LVTPC);
132 + apic_write(APIC_LVTPC, v | APIC_LVT_MASKED);
133 +diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c
134 +index afee386ff711..caedd8d60d36 100644
135 +--- a/arch/x86/kernel/apic/bigsmp_32.c
136 ++++ b/arch/x86/kernel/apic/bigsmp_32.c
137 +@@ -38,32 +38,12 @@ static int bigsmp_early_logical_apicid(int cpu)
138 + return early_per_cpu(x86_cpu_to_apicid, cpu);
139 + }
140 +
141 +-static inline unsigned long calculate_ldr(int cpu)
142 +-{
143 +- unsigned long val, id;
144 +-
145 +- val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
146 +- id = per_cpu(x86_bios_cpu_apicid, cpu);
147 +- val |= SET_APIC_LOGICAL_ID(id);
148 +-
149 +- return val;
150 +-}
151 +-
152 + /*
153 +- * Set up the logical destination ID.
154 +- *
155 +- * Intel recommends to set DFR, LDR and TPR before enabling
156 +- * an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel
157 +- * document number 292116). So here it goes...
158 ++ * bigsmp enables physical destination mode
159 ++ * and doesn't use LDR and DFR
160 + */
161 + static void bigsmp_init_apic_ldr(void)
162 + {
163 +- unsigned long val;
164 +- int cpu = smp_processor_id();
165 +-
166 +- apic_write(APIC_DFR, APIC_DFR_FLAT);
167 +- val = calculate_ldr(cpu);
168 +- apic_write(APIC_LDR, val);
169 + }
170 +
171 + static void bigsmp_setup_apic_routing(void)
172 +diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
173 +index e9d0bc3a5e88..00fccf952d9b 100644
174 +--- a/arch/x86/kernel/ptrace.c
175 ++++ b/arch/x86/kernel/ptrace.c
176 +@@ -644,11 +644,10 @@ static unsigned long ptrace_get_debugreg(struct task_struct *tsk, int n)
177 + {
178 + struct thread_struct *thread = &tsk->thread;
179 + unsigned long val = 0;
180 +- int index = n;
181 +
182 + if (n < HBP_NUM) {
183 ++ int index = array_index_nospec(n, HBP_NUM);
184 + struct perf_event *bp = thread->ptrace_bps[index];
185 +- index = array_index_nospec(index, HBP_NUM);
186 +
187 + if (bp)
188 + val = bp->hw.info.address;
189 +diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
190 +index 918b5092a85f..0b16309898c6 100644
191 +--- a/arch/x86/kernel/uprobes.c
192 ++++ b/arch/x86/kernel/uprobes.c
193 +@@ -508,9 +508,12 @@ struct uprobe_xol_ops {
194 + void (*abort)(struct arch_uprobe *, struct pt_regs *);
195 + };
196 +
197 +-static inline int sizeof_long(void)
198 ++static inline int sizeof_long(struct pt_regs *regs)
199 + {
200 +- return in_ia32_syscall() ? 4 : 8;
201 ++ /*
202 ++ * Check registers for mode as in_xxx_syscall() does not apply here.
203 ++ */
204 ++ return user_64bit_mode(regs) ? 8 : 4;
205 + }
206 +
207 + static int default_pre_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs)
208 +@@ -521,9 +524,9 @@ static int default_pre_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs)
209 +
210 + static int emulate_push_stack(struct pt_regs *regs, unsigned long val)
211 + {
212 +- unsigned long new_sp = regs->sp - sizeof_long();
213 ++ unsigned long new_sp = regs->sp - sizeof_long(regs);
214 +
215 +- if (copy_to_user((void __user *)new_sp, &val, sizeof_long()))
216 ++ if (copy_to_user((void __user *)new_sp, &val, sizeof_long(regs)))
217 + return -EFAULT;
218 +
219 + regs->sp = new_sp;
220 +@@ -556,7 +559,7 @@ static int default_post_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs
221 + long correction = utask->vaddr - utask->xol_vaddr;
222 + regs->ip += correction;
223 + } else if (auprobe->defparam.fixups & UPROBE_FIX_CALL) {
224 +- regs->sp += sizeof_long(); /* Pop incorrect return address */
225 ++ regs->sp += sizeof_long(regs); /* Pop incorrect return address */
226 + if (emulate_push_stack(regs, utask->vaddr + auprobe->defparam.ilen))
227 + return -ERESTART;
228 + }
229 +@@ -675,7 +678,7 @@ static int branch_post_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs)
230 + * "call" insn was executed out-of-line. Just restore ->sp and restart.
231 + * We could also restore ->ip and try to call branch_emulate_op() again.
232 + */
233 +- regs->sp += sizeof_long();
234 ++ regs->sp += sizeof_long(regs);
235 + return -ERESTART;
236 + }
237 +
238 +@@ -1056,7 +1059,7 @@ bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
239 + unsigned long
240 + arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs *regs)
241 + {
242 +- int rasize = sizeof_long(), nleft;
243 ++ int rasize = sizeof_long(regs), nleft;
244 + unsigned long orig_ret_vaddr = 0; /* clear high bits for 32-bit apps */
245 +
246 + if (copy_from_user(&orig_ret_vaddr, (void __user *)regs->sp, rasize))
247 +diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
248 +index a39e38f13029..742ecf5b6c00 100644
249 +--- a/arch/x86/kvm/hyperv.c
250 ++++ b/arch/x86/kvm/hyperv.c
251 +@@ -1783,7 +1783,7 @@ int kvm_vm_ioctl_hv_eventfd(struct kvm *kvm, struct kvm_hyperv_eventfd *args)
252 + int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid,
253 + struct kvm_cpuid_entry2 __user *entries)
254 + {
255 +- uint16_t evmcs_ver = kvm_x86_ops->nested_get_evmcs_version(vcpu);
256 ++ uint16_t evmcs_ver = 0;
257 + struct kvm_cpuid_entry2 cpuid_entries[] = {
258 + { .function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS },
259 + { .function = HYPERV_CPUID_INTERFACE },
260 +@@ -1795,6 +1795,9 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid,
261 + };
262 + int i, nent = ARRAY_SIZE(cpuid_entries);
263 +
264 ++ if (kvm_x86_ops->nested_get_evmcs_version)
265 ++ evmcs_ver = kvm_x86_ops->nested_get_evmcs_version(vcpu);
266 ++
267 + /* Skip NESTED_FEATURES if eVMCS is not supported */
268 + if (!evmcs_ver)
269 + --nent;
270 +diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
271 +index 4dabc318adb8..8d22c79f5333 100644
272 +--- a/arch/x86/kvm/lapic.c
273 ++++ b/arch/x86/kvm/lapic.c
274 +@@ -212,6 +212,9 @@ static void recalculate_apic_map(struct kvm *kvm)
275 + if (!apic_x2apic_mode(apic) && !new->phys_map[xapic_id])
276 + new->phys_map[xapic_id] = apic;
277 +
278 ++ if (!kvm_apic_sw_enabled(apic))
279 ++ continue;
280 ++
281 + ldr = kvm_lapic_get_reg(apic, APIC_LDR);
282 +
283 + if (apic_x2apic_mode(apic)) {
284 +@@ -254,6 +257,8 @@ static inline void apic_set_spiv(struct kvm_lapic *apic, u32 val)
285 + static_key_slow_dec_deferred(&apic_sw_disabled);
286 + else
287 + static_key_slow_inc(&apic_sw_disabled.key);
288 ++
289 ++ recalculate_apic_map(apic->vcpu->kvm);
290 + }
291 + }
292 +
293 +diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
294 +index 14384a1ec53f..2c7daa3b968d 100644
295 +--- a/arch/x86/kvm/svm.c
296 ++++ b/arch/x86/kvm/svm.c
297 +@@ -7107,12 +7107,6 @@ failed:
298 + return ret;
299 + }
300 +
301 +-static uint16_t nested_get_evmcs_version(struct kvm_vcpu *vcpu)
302 +-{
303 +- /* Not supported */
304 +- return 0;
305 +-}
306 +-
307 + static int nested_enable_evmcs(struct kvm_vcpu *vcpu,
308 + uint16_t *vmcs_version)
309 + {
310 +@@ -7283,7 +7277,7 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = {
311 + .mem_enc_unreg_region = svm_unregister_enc_region,
312 +
313 + .nested_enable_evmcs = nested_enable_evmcs,
314 +- .nested_get_evmcs_version = nested_get_evmcs_version,
315 ++ .nested_get_evmcs_version = NULL,
316 +
317 + .need_emulation_on_page_fault = svm_need_emulation_on_page_fault,
318 + };
319 +diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
320 +index 4b830c0adcf8..d5c12d5a5905 100644
321 +--- a/arch/x86/kvm/vmx/vmx.c
322 ++++ b/arch/x86/kvm/vmx/vmx.c
323 +@@ -7733,6 +7733,7 @@ static struct kvm_x86_ops vmx_x86_ops __ro_after_init = {
324 + .set_nested_state = NULL,
325 + .get_vmcs12_pages = NULL,
326 + .nested_enable_evmcs = NULL,
327 ++ .nested_get_evmcs_version = NULL,
328 + .need_emulation_on_page_fault = vmx_need_emulation_on_page_fault,
329 + };
330 +
331 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
332 +index cbced8ff29d4..1f80fd560ede 100644
333 +--- a/arch/x86/kvm/x86.c
334 ++++ b/arch/x86/kvm/x86.c
335 +@@ -6547,12 +6547,13 @@ restart:
336 + unsigned long rflags = kvm_x86_ops->get_rflags(vcpu);
337 + toggle_interruptibility(vcpu, ctxt->interruptibility);
338 + vcpu->arch.emulate_regs_need_sync_to_vcpu = false;
339 +- kvm_rip_write(vcpu, ctxt->eip);
340 +- if (r == EMULATE_DONE && ctxt->tf)
341 +- kvm_vcpu_do_singlestep(vcpu, &r);
342 + if (!ctxt->have_exception ||
343 +- exception_type(ctxt->exception.vector) == EXCPT_TRAP)
344 ++ exception_type(ctxt->exception.vector) == EXCPT_TRAP) {
345 ++ kvm_rip_write(vcpu, ctxt->eip);
346 ++ if (r == EMULATE_DONE && ctxt->tf)
347 ++ kvm_vcpu_do_singlestep(vcpu, &r);
348 + __kvm_set_rflags(vcpu, ctxt->eflags);
349 ++ }
350 +
351 + /*
352 + * For STI, interrupts are shadowed; so KVM_REQ_EVENT will
353 +diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
354 +index 6a9a77a403c9..e14e95ea7338 100644
355 +--- a/arch/x86/mm/pageattr.c
356 ++++ b/arch/x86/mm/pageattr.c
357 +@@ -516,7 +516,7 @@ static inline void check_conflict(int warnlvl, pgprot_t prot, pgprotval_t val,
358 + */
359 + static inline pgprot_t static_protections(pgprot_t prot, unsigned long start,
360 + unsigned long pfn, unsigned long npg,
361 +- int warnlvl)
362 ++ unsigned long lpsize, int warnlvl)
363 + {
364 + pgprotval_t forbidden, res;
365 + unsigned long end;
366 +@@ -535,9 +535,17 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long start,
367 + check_conflict(warnlvl, prot, res, start, end, pfn, "Text NX");
368 + forbidden = res;
369 +
370 +- res = protect_kernel_text_ro(start, end);
371 +- check_conflict(warnlvl, prot, res, start, end, pfn, "Text RO");
372 +- forbidden |= res;
373 ++ /*
374 ++ * Special case to preserve a large page. If the change spawns the
375 ++ * full large page mapping then there is no point to split it
376 ++ * up. Happens with ftrace and is going to be removed once ftrace
377 ++ * switched to text_poke().
378 ++ */
379 ++ if (lpsize != (npg * PAGE_SIZE) || (start & (lpsize - 1))) {
380 ++ res = protect_kernel_text_ro(start, end);
381 ++ check_conflict(warnlvl, prot, res, start, end, pfn, "Text RO");
382 ++ forbidden |= res;
383 ++ }
384 +
385 + /* Check the PFN directly */
386 + res = protect_pci_bios(pfn, pfn + npg - 1);
387 +@@ -819,7 +827,7 @@ static int __should_split_large_page(pte_t *kpte, unsigned long address,
388 + * extra conditional required here.
389 + */
390 + chk_prot = static_protections(old_prot, lpaddr, old_pfn, numpages,
391 +- CPA_CONFLICT);
392 ++ psize, CPA_CONFLICT);
393 +
394 + if (WARN_ON_ONCE(pgprot_val(chk_prot) != pgprot_val(old_prot))) {
395 + /*
396 +@@ -855,7 +863,7 @@ static int __should_split_large_page(pte_t *kpte, unsigned long address,
397 + * protection requirement in the large page.
398 + */
399 + new_prot = static_protections(req_prot, lpaddr, old_pfn, numpages,
400 +- CPA_DETECT);
401 ++ psize, CPA_DETECT);
402 +
403 + /*
404 + * If there is a conflict, split the large page.
405 +@@ -906,7 +914,8 @@ static void split_set_pte(struct cpa_data *cpa, pte_t *pte, unsigned long pfn,
406 + if (!cpa->force_static_prot)
407 + goto set;
408 +
409 +- prot = static_protections(ref_prot, address, pfn, npg, CPA_PROTECT);
410 ++ /* Hand in lpsize = 0 to enforce the protection mechanism */
411 ++ prot = static_protections(ref_prot, address, pfn, npg, 0, CPA_PROTECT);
412 +
413 + if (pgprot_val(prot) == pgprot_val(ref_prot))
414 + goto set;
415 +@@ -1503,7 +1512,8 @@ repeat:
416 + pgprot_val(new_prot) |= pgprot_val(cpa->mask_set);
417 +
418 + cpa_inc_4k_install();
419 +- new_prot = static_protections(new_prot, address, pfn, 1,
420 ++ /* Hand in lpsize = 0 to enforce the protection mechanism */
421 ++ new_prot = static_protections(new_prot, address, pfn, 1, 0,
422 + CPA_PROTECT);
423 +
424 + new_prot = pgprot_clear_protnone_bits(new_prot);
425 +diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c
426 +index e06de63497cf..e6bd727da503 100644
427 +--- a/drivers/auxdisplay/panel.c
428 ++++ b/drivers/auxdisplay/panel.c
429 +@@ -1617,6 +1617,8 @@ static void panel_attach(struct parport *port)
430 + return;
431 +
432 + err_lcd_unreg:
433 ++ if (scan_timer.function)
434 ++ del_timer_sync(&scan_timer);
435 + if (lcd.enabled)
436 + charlcd_unregister(lcd.charlcd);
437 + err_unreg_device:
438 +diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
439 +index 3ac6a5d18071..b90dbcd99c03 100644
440 +--- a/drivers/block/xen-blkback/xenbus.c
441 ++++ b/drivers/block/xen-blkback/xenbus.c
442 +@@ -965,6 +965,7 @@ static int read_per_ring_refs(struct xen_blkif_ring *ring, const char *dir)
443 + }
444 + }
445 +
446 ++ err = -ENOMEM;
447 + for (i = 0; i < nr_grefs * XEN_BLKIF_REQS_PER_PAGE; i++) {
448 + req = kzalloc(sizeof(*req), GFP_KERNEL);
449 + if (!req)
450 +@@ -987,7 +988,7 @@ static int read_per_ring_refs(struct xen_blkif_ring *ring, const char *dir)
451 + err = xen_blkif_map(ring, ring_ref, nr_grefs, evtchn);
452 + if (err) {
453 + xenbus_dev_fatal(dev, err, "mapping ring-ref port %u", evtchn);
454 +- return err;
455 ++ goto fail;
456 + }
457 +
458 + return 0;
459 +@@ -1007,8 +1008,7 @@ fail:
460 + }
461 + kfree(req);
462 + }
463 +- return -ENOMEM;
464 +-
465 ++ return err;
466 + }
467 +
468 + static int connect_ring(struct backend_info *be)
469 +diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c
470 +index 19d7b6ff2f17..20c957185af2 100644
471 +--- a/drivers/bus/hisi_lpc.c
472 ++++ b/drivers/bus/hisi_lpc.c
473 +@@ -456,6 +456,17 @@ struct hisi_lpc_acpi_cell {
474 + size_t pdata_size;
475 + };
476 +
477 ++static void hisi_lpc_acpi_remove(struct device *hostdev)
478 ++{
479 ++ struct acpi_device *adev = ACPI_COMPANION(hostdev);
480 ++ struct acpi_device *child;
481 ++
482 ++ device_for_each_child(hostdev, NULL, hisi_lpc_acpi_remove_subdev);
483 ++
484 ++ list_for_each_entry(child, &adev->children, node)
485 ++ acpi_device_clear_enumerated(child);
486 ++}
487 ++
488 + /*
489 + * hisi_lpc_acpi_probe - probe children for ACPI FW
490 + * @hostdev: LPC host device pointer
491 +@@ -555,8 +566,7 @@ static int hisi_lpc_acpi_probe(struct device *hostdev)
492 + return 0;
493 +
494 + fail:
495 +- device_for_each_child(hostdev, NULL,
496 +- hisi_lpc_acpi_remove_subdev);
497 ++ hisi_lpc_acpi_remove(hostdev);
498 + return ret;
499 + }
500 +
501 +@@ -569,6 +579,10 @@ static int hisi_lpc_acpi_probe(struct device *dev)
502 + {
503 + return -ENODEV;
504 + }
505 ++
506 ++static void hisi_lpc_acpi_remove(struct device *hostdev)
507 ++{
508 ++}
509 + #endif // CONFIG_ACPI
510 +
511 + /*
512 +@@ -606,24 +620,27 @@ static int hisi_lpc_probe(struct platform_device *pdev)
513 + range->fwnode = dev->fwnode;
514 + range->flags = LOGIC_PIO_INDIRECT;
515 + range->size = PIO_INDIRECT_SIZE;
516 ++ range->hostdata = lpcdev;
517 ++ range->ops = &hisi_lpc_ops;
518 ++ lpcdev->io_host = range;
519 +
520 + ret = logic_pio_register_range(range);
521 + if (ret) {
522 + dev_err(dev, "register IO range failed (%d)!\n", ret);
523 + return ret;
524 + }
525 +- lpcdev->io_host = range;
526 +
527 + /* register the LPC host PIO resources */
528 + if (acpi_device)
529 + ret = hisi_lpc_acpi_probe(dev);
530 + else
531 + ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
532 +- if (ret)
533 ++ if (ret) {
534 ++ logic_pio_unregister_range(range);
535 + return ret;
536 ++ }
537 +
538 +- lpcdev->io_host->hostdata = lpcdev;
539 +- lpcdev->io_host->ops = &hisi_lpc_ops;
540 ++ dev_set_drvdata(dev, lpcdev);
541 +
542 + io_end = lpcdev->io_host->io_start + lpcdev->io_host->size;
543 + dev_info(dev, "registered range [%pa - %pa]\n",
544 +@@ -632,6 +649,23 @@ static int hisi_lpc_probe(struct platform_device *pdev)
545 + return ret;
546 + }
547 +
548 ++static int hisi_lpc_remove(struct platform_device *pdev)
549 ++{
550 ++ struct device *dev = &pdev->dev;
551 ++ struct acpi_device *acpi_device = ACPI_COMPANION(dev);
552 ++ struct hisi_lpc_dev *lpcdev = dev_get_drvdata(dev);
553 ++ struct logic_pio_hwaddr *range = lpcdev->io_host;
554 ++
555 ++ if (acpi_device)
556 ++ hisi_lpc_acpi_remove(dev);
557 ++ else
558 ++ of_platform_depopulate(dev);
559 ++
560 ++ logic_pio_unregister_range(range);
561 ++
562 ++ return 0;
563 ++}
564 ++
565 + static const struct of_device_id hisi_lpc_of_match[] = {
566 + { .compatible = "hisilicon,hip06-lpc", },
567 + { .compatible = "hisilicon,hip07-lpc", },
568 +@@ -645,5 +679,6 @@ static struct platform_driver hisi_lpc_driver = {
569 + .acpi_match_table = ACPI_PTR(hisi_lpc_acpi_match),
570 + },
571 + .probe = hisi_lpc_probe,
572 ++ .remove = hisi_lpc_remove,
573 + };
574 + builtin_platform_driver(hisi_lpc_driver);
575 +diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c
576 +index f79eede71c62..edefa669153f 100644
577 +--- a/drivers/crypto/ccp/ccp-dev.c
578 ++++ b/drivers/crypto/ccp/ccp-dev.c
579 +@@ -540,6 +540,10 @@ int ccp_dev_suspend(struct sp_device *sp, pm_message_t state)
580 + unsigned long flags;
581 + unsigned int i;
582 +
583 ++ /* If there's no device there's nothing to do */
584 ++ if (!ccp)
585 ++ return 0;
586 ++
587 + spin_lock_irqsave(&ccp->cmd_lock, flags);
588 +
589 + ccp->suspending = 1;
590 +@@ -564,6 +568,10 @@ int ccp_dev_resume(struct sp_device *sp)
591 + unsigned long flags;
592 + unsigned int i;
593 +
594 ++ /* If there's no device there's nothing to do */
595 ++ if (!ccp)
596 ++ return 0;
597 ++
598 + spin_lock_irqsave(&ccp->cmd_lock, flags);
599 +
600 + ccp->suspending = 0;
601 +diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
602 +index 89d710899010..de8bfd9a76e9 100644
603 +--- a/drivers/dma/ste_dma40.c
604 ++++ b/drivers/dma/ste_dma40.c
605 +@@ -142,7 +142,7 @@ enum d40_events {
606 + * when the DMA hw is powered off.
607 + * TODO: Add save/restore of D40_DREG_GCC on dma40 v3 or later, if that works.
608 + */
609 +-static u32 d40_backup_regs[] = {
610 ++static __maybe_unused u32 d40_backup_regs[] = {
611 + D40_DREG_LCPA,
612 + D40_DREG_LCLA,
613 + D40_DREG_PRMSE,
614 +@@ -211,7 +211,7 @@ static u32 d40_backup_regs_v4b[] = {
615 +
616 + #define BACKUP_REGS_SZ_V4B ARRAY_SIZE(d40_backup_regs_v4b)
617 +
618 +-static u32 d40_backup_regs_chan[] = {
619 ++static __maybe_unused u32 d40_backup_regs_chan[] = {
620 + D40_CHAN_REG_SSCFG,
621 + D40_CHAN_REG_SSELT,
622 + D40_CHAN_REG_SSPTR,
623 +diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
624 +index d6e919d3936a..1311de74bfdd 100644
625 +--- a/drivers/dma/stm32-mdma.c
626 ++++ b/drivers/dma/stm32-mdma.c
627 +@@ -1366,7 +1366,7 @@ static irqreturn_t stm32_mdma_irq_handler(int irq, void *devid)
628 +
629 + chan = &dmadev->chan[id];
630 + if (!chan) {
631 +- dev_err(chan2dev(chan), "MDMA channel not initialized\n");
632 ++ dev_dbg(mdma2dev(dmadev), "MDMA channel not initialized\n");
633 + goto exit;
634 + }
635 +
636 +diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c
637 +index ba2489d4ea24..ba27802efcd0 100644
638 +--- a/drivers/dma/ti/omap-dma.c
639 ++++ b/drivers/dma/ti/omap-dma.c
640 +@@ -1234,7 +1234,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_interleaved(
641 + if (src_icg) {
642 + d->ccr |= CCR_SRC_AMODE_DBLIDX;
643 + d->ei = 1;
644 +- d->fi = src_icg;
645 ++ d->fi = src_icg + 1;
646 + } else if (xt->src_inc) {
647 + d->ccr |= CCR_SRC_AMODE_POSTINC;
648 + d->fi = 0;
649 +@@ -1249,7 +1249,7 @@ static struct dma_async_tx_descriptor *omap_dma_prep_dma_interleaved(
650 + if (dst_icg) {
651 + d->ccr |= CCR_DST_AMODE_DBLIDX;
652 + sg->ei = 1;
653 +- sg->fi = dst_icg;
654 ++ sg->fi = dst_icg + 1;
655 + } else if (xt->dst_inc) {
656 + d->ccr |= CCR_DST_AMODE_POSTINC;
657 + sg->fi = 0;
658 +diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
659 +index 343153d47e5b..004dc03ccf09 100644
660 +--- a/drivers/fsi/fsi-scom.c
661 ++++ b/drivers/fsi/fsi-scom.c
662 +@@ -38,8 +38,7 @@
663 + #define SCOM_STATUS_PIB_RESP_MASK 0x00007000
664 + #define SCOM_STATUS_PIB_RESP_SHIFT 12
665 +
666 +-#define SCOM_STATUS_ANY_ERR (SCOM_STATUS_ERR_SUMMARY | \
667 +- SCOM_STATUS_PROTECTION | \
668 ++#define SCOM_STATUS_ANY_ERR (SCOM_STATUS_PROTECTION | \
669 + SCOM_STATUS_PARITY | \
670 + SCOM_STATUS_PIB_ABORT | \
671 + SCOM_STATUS_PIB_RESP_MASK)
672 +@@ -251,11 +250,6 @@ static int handle_fsi2pib_status(struct scom_device *scom, uint32_t status)
673 + /* Return -EBUSY on PIB abort to force a retry */
674 + if (status & SCOM_STATUS_PIB_ABORT)
675 + return -EBUSY;
676 +- if (status & SCOM_STATUS_ERR_SUMMARY) {
677 +- fsi_device_write(scom->fsi_dev, SCOM_FSI2PIB_RESET_REG, &dummy,
678 +- sizeof(uint32_t));
679 +- return -EIO;
680 +- }
681 + return 0;
682 + }
683 +
684 +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
685 +index 9b384a94d2f3..3e35a8f2c5e5 100644
686 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
687 ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
688 +@@ -574,6 +574,7 @@ static const struct amdgpu_px_quirk amdgpu_px_quirk_list[] = {
689 + { 0x1002, 0x6900, 0x1002, 0x0124, AMDGPU_PX_QUIRK_FORCE_ATPX },
690 + { 0x1002, 0x6900, 0x1028, 0x0812, AMDGPU_PX_QUIRK_FORCE_ATPX },
691 + { 0x1002, 0x6900, 0x1028, 0x0813, AMDGPU_PX_QUIRK_FORCE_ATPX },
692 ++ { 0x1002, 0x699f, 0x1028, 0x0814, AMDGPU_PX_QUIRK_FORCE_ATPX },
693 + { 0x1002, 0x6900, 0x1025, 0x125A, AMDGPU_PX_QUIRK_FORCE_ATPX },
694 + { 0x1002, 0x6900, 0x17AA, 0x3806, AMDGPU_PX_QUIRK_FORCE_ATPX },
695 + { 0, 0, 0, 0, 0 },
696 +diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
697 +index 0332177c0302..2a3090c45e6b 100644
698 +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
699 ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
700 +@@ -588,14 +588,14 @@ static void gfx_v9_0_check_if_need_gfxoff(struct amdgpu_device *adev)
701 + case CHIP_VEGA20:
702 + break;
703 + case CHIP_RAVEN:
704 +- if (adev->rev_id >= 0x8 || adev->pdev->device == 0x15d8)
705 +- break;
706 +- if ((adev->gfx.rlc_fw_version != 106 &&
707 +- adev->gfx.rlc_fw_version < 531) ||
708 +- (adev->gfx.rlc_fw_version == 53815) ||
709 +- (adev->gfx.rlc_feature_version < 1) ||
710 +- !adev->gfx.rlc.is_rlc_v2_1)
711 ++ if (!(adev->rev_id >= 0x8 || adev->pdev->device == 0x15d8)
712 ++ &&((adev->gfx.rlc_fw_version != 106 &&
713 ++ adev->gfx.rlc_fw_version < 531) ||
714 ++ (adev->gfx.rlc_fw_version == 53815) ||
715 ++ (adev->gfx.rlc_feature_version < 1) ||
716 ++ !adev->gfx.rlc.is_rlc_v2_1))
717 + adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
718 ++
719 + if (adev->pm.pp_feature & PP_GFXOFF_MASK)
720 + adev->pg_flags |= AMD_PG_SUPPORT_GFX_PG |
721 + AMD_PG_SUPPORT_CP |
722 +diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c
723 +index 2854399856ba..4aebe21e6ad9 100644
724 +--- a/drivers/gpu/drm/ast/ast_main.c
725 ++++ b/drivers/gpu/drm/ast/ast_main.c
726 +@@ -131,8 +131,8 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)
727 +
728 +
729 + /* Enable extended register access */
730 +- ast_enable_mmio(dev);
731 + ast_open_key(ast);
732 ++ ast_enable_mmio(dev);
733 +
734 + /* Find out whether P2A works or whether to use device-tree */
735 + ast_detect_config_mode(dev, &scu_rev);
736 +@@ -576,6 +576,9 @@ void ast_driver_unload(struct drm_device *dev)
737 + {
738 + struct ast_private *ast = dev->dev_private;
739 +
740 ++ /* enable standard VGA decode */
741 ++ ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x04);
742 ++
743 + ast_release_firmware(dev);
744 + kfree(ast->dp501_fw_addr);
745 + ast_mode_fini(dev);
746 +diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
747 +index 97fed0627d1c..74da15a3341a 100644
748 +--- a/drivers/gpu/drm/ast/ast_mode.c
749 ++++ b/drivers/gpu/drm/ast/ast_mode.c
750 +@@ -601,7 +601,7 @@ static int ast_crtc_mode_set(struct drm_crtc *crtc,
751 + return -EINVAL;
752 + ast_open_key(ast);
753 +
754 +- ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04);
755 ++ ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06);
756 +
757 + ast_set_std_reg(crtc, adjusted_mode, &vbios_mode);
758 + ast_set_crtc_reg(crtc, adjusted_mode, &vbios_mode);
759 +diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c
760 +index f7d421359d56..c1d1ac51d1c2 100644
761 +--- a/drivers/gpu/drm/ast/ast_post.c
762 ++++ b/drivers/gpu/drm/ast/ast_post.c
763 +@@ -46,7 +46,7 @@ void ast_enable_mmio(struct drm_device *dev)
764 + {
765 + struct ast_private *ast = dev->dev_private;
766 +
767 +- ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xa1, 0xff, 0x04);
768 ++ ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06);
769 + }
770 +
771 +
772 +diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
773 +index 3a8af9978ebd..791f164bdadc 100644
774 +--- a/drivers/gpu/drm/bridge/ti-tfp410.c
775 ++++ b/drivers/gpu/drm/bridge/ti-tfp410.c
776 +@@ -66,7 +66,12 @@ static int tfp410_get_modes(struct drm_connector *connector)
777 +
778 + drm_connector_update_edid_property(connector, edid);
779 +
780 +- return drm_add_edid_modes(connector, edid);
781 ++ ret = drm_add_edid_modes(connector, edid);
782 ++
783 ++ kfree(edid);
784 ++
785 ++ return ret;
786 ++
787 + fallback:
788 + /* No EDID, fallback on the XGA standard modes */
789 + ret = drm_add_modes_noedid(connector, 1920, 1200);
790 +diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
791 +index 1ad88e6d7c04..d485d49c473b 100644
792 +--- a/drivers/gpu/drm/i915/i915_drv.c
793 ++++ b/drivers/gpu/drm/i915/i915_drv.c
794 +@@ -1569,6 +1569,12 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv)
795 +
796 + pci_set_master(pdev);
797 +
798 ++ /*
799 ++ * We don't have a max segment size, so set it to the max so sg's
800 ++ * debugging layer doesn't complain
801 ++ */
802 ++ dma_set_max_seg_size(&pdev->dev, UINT_MAX);
803 ++
804 + /* overlay on gen2 is broken and can't address above 1G */
805 + if (IS_GEN(dev_priv, 2)) {
806 + ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(30));
807 +diff --git a/drivers/gpu/drm/i915/i915_vgpu.c b/drivers/gpu/drm/i915/i915_vgpu.c
808 +index 94d3992b599d..724627afdedc 100644
809 +--- a/drivers/gpu/drm/i915/i915_vgpu.c
810 ++++ b/drivers/gpu/drm/i915/i915_vgpu.c
811 +@@ -101,6 +101,9 @@ static struct _balloon_info_ bl_info;
812 + static void vgt_deballoon_space(struct i915_ggtt *ggtt,
813 + struct drm_mm_node *node)
814 + {
815 ++ if (!drm_mm_node_allocated(node))
816 ++ return;
817 ++
818 + DRM_DEBUG_DRIVER("deballoon space: range [0x%llx - 0x%llx] %llu KiB.\n",
819 + node->start,
820 + node->start + node->size,
821 +diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
822 +index 8839eaea8371..d89120dcac67 100644
823 +--- a/drivers/gpu/drm/i915/intel_dp_mst.c
824 ++++ b/drivers/gpu/drm/i915/intel_dp_mst.c
825 +@@ -535,7 +535,15 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
826 +
827 + intel_attach_force_audio_property(connector);
828 + intel_attach_broadcast_rgb_property(connector);
829 +- drm_connector_attach_max_bpc_property(connector, 6, 12);
830 ++
831 ++ /*
832 ++ * Reuse the prop from the SST connector because we're
833 ++ * not allowed to create new props after device registration.
834 ++ */
835 ++ connector->max_bpc_property =
836 ++ intel_dp->attached_connector->base.max_bpc_property;
837 ++ if (connector->max_bpc_property)
838 ++ drm_connector_attach_max_bpc_property(connector, 6, 12);
839 +
840 + return connector;
841 +
842 +diff --git a/drivers/gpu/drm/i915/intel_vdsc.c b/drivers/gpu/drm/i915/intel_vdsc.c
843 +index 3f9921ba4a76..eb978e7238c2 100644
844 +--- a/drivers/gpu/drm/i915/intel_vdsc.c
845 ++++ b/drivers/gpu/drm/i915/intel_vdsc.c
846 +@@ -539,7 +539,7 @@ static void intel_configure_pps_for_dsc_encoder(struct intel_encoder *encoder,
847 + pps_val |= DSC_PIC_HEIGHT(vdsc_cfg->pic_height) |
848 + DSC_PIC_WIDTH(vdsc_cfg->pic_width / num_vdsc_instances);
849 + DRM_INFO("PPS2 = 0x%08x\n", pps_val);
850 +- if (encoder->type == INTEL_OUTPUT_EDP) {
851 ++ if (cpu_transcoder == TRANSCODER_EDP) {
852 + I915_WRITE(DSCA_PICTURE_PARAMETER_SET_2, pps_val);
853 + /*
854 + * If 2 VDSC instances are needed, configure PPS for second
855 +diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
856 +index 35ddbec1375a..671c90f34ede 100644
857 +--- a/drivers/gpu/drm/scheduler/sched_entity.c
858 ++++ b/drivers/gpu/drm/scheduler/sched_entity.c
859 +@@ -95,7 +95,7 @@ static bool drm_sched_entity_is_idle(struct drm_sched_entity *entity)
860 + rmb(); /* for list_empty to work without lock */
861 +
862 + if (list_empty(&entity->list) ||
863 +- spsc_queue_peek(&entity->job_queue) == NULL)
864 ++ spsc_queue_count(&entity->job_queue) == 0)
865 + return true;
866 +
867 + return false;
868 +@@ -281,7 +281,7 @@ void drm_sched_entity_fini(struct drm_sched_entity *entity)
869 + /* Consumption of existing IBs wasn't completed. Forcefully
870 + * remove them here.
871 + */
872 +- if (spsc_queue_peek(&entity->job_queue)) {
873 ++ if (spsc_queue_count(&entity->job_queue)) {
874 + if (sched) {
875 + /* Park the kernel for a moment to make sure it isn't processing
876 + * our enity.
877 +diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
878 +index 34e2b3f9d540..4effce12607b 100644
879 +--- a/drivers/hid/hid-logitech-hidpp.c
880 ++++ b/drivers/hid/hid-logitech-hidpp.c
881 +@@ -3769,8 +3769,6 @@ static const struct hid_device_id hidpp_devices[] = {
882 + HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC332) },
883 + { /* Logitech G502 Hero Gaming Mouse over USB */
884 + HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC08B) },
885 +- { /* Logitech G700 Gaming Mouse over USB */
886 +- HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC06B) },
887 + { /* Logitech G700s Gaming Mouse over USB */
888 + HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, 0xC07C) },
889 + { /* Logitech G703 Gaming Mouse over USB */
890 +diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c
891 +index c0378c3de9a4..91dfeba62485 100644
892 +--- a/drivers/hwtracing/intel_th/pci.c
893 ++++ b/drivers/hwtracing/intel_th/pci.c
894 +@@ -164,6 +164,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
895 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa1a6),
896 + .driver_data = (kernel_ulong_t)0,
897 + },
898 ++ {
899 ++ /* Lewisburg PCH */
900 ++ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa226),
901 ++ .driver_data = (kernel_ulong_t)0,
902 ++ },
903 + {
904 + /* Gemini Lake */
905 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x318e),
906 +@@ -199,6 +204,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
907 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x45c5),
908 + .driver_data = (kernel_ulong_t)&intel_th_2x,
909 + },
910 ++ {
911 ++ /* Tiger Lake PCH */
912 ++ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa0a6),
913 ++ .driver_data = (kernel_ulong_t)&intel_th_2x,
914 ++ },
915 + { 0 },
916 + };
917 +
918 +diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
919 +index e55b902560de..181e7ff1ec4f 100644
920 +--- a/drivers/hwtracing/stm/core.c
921 ++++ b/drivers/hwtracing/stm/core.c
922 +@@ -1276,7 +1276,6 @@ int stm_source_register_device(struct device *parent,
923 +
924 + err:
925 + put_device(&src->dev);
926 +- kfree(src);
927 +
928 + return err;
929 + }
930 +diff --git a/drivers/i2c/busses/i2c-emev2.c b/drivers/i2c/busses/i2c-emev2.c
931 +index 35b302d983e0..959d4912ec0d 100644
932 +--- a/drivers/i2c/busses/i2c-emev2.c
933 ++++ b/drivers/i2c/busses/i2c-emev2.c
934 +@@ -69,6 +69,7 @@ struct em_i2c_device {
935 + struct completion msg_done;
936 + struct clk *sclk;
937 + struct i2c_client *slave;
938 ++ int irq;
939 + };
940 +
941 + static inline void em_clear_set_bit(struct em_i2c_device *priv, u8 clear, u8 set, u8 reg)
942 +@@ -339,6 +340,12 @@ static int em_i2c_unreg_slave(struct i2c_client *slave)
943 +
944 + writeb(0, priv->base + I2C_OFS_SVA0);
945 +
946 ++ /*
947 ++ * Wait for interrupt to finish. New slave irqs cannot happen because we
948 ++ * cleared the slave address and, thus, only extension codes will be
949 ++ * detected which do not use the slave ptr.
950 ++ */
951 ++ synchronize_irq(priv->irq);
952 + priv->slave = NULL;
953 +
954 + return 0;
955 +@@ -355,7 +362,7 @@ static int em_i2c_probe(struct platform_device *pdev)
956 + {
957 + struct em_i2c_device *priv;
958 + struct resource *r;
959 +- int irq, ret;
960 ++ int ret;
961 +
962 + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
963 + if (!priv)
964 +@@ -390,8 +397,8 @@ static int em_i2c_probe(struct platform_device *pdev)
965 +
966 + em_i2c_reset(&priv->adap);
967 +
968 +- irq = platform_get_irq(pdev, 0);
969 +- ret = devm_request_irq(&pdev->dev, irq, em_i2c_irq_handler, 0,
970 ++ priv->irq = platform_get_irq(pdev, 0);
971 ++ ret = devm_request_irq(&pdev->dev, priv->irq, em_i2c_irq_handler, 0,
972 + "em_i2c", priv);
973 + if (ret)
974 + goto err_clk;
975 +@@ -401,7 +408,8 @@ static int em_i2c_probe(struct platform_device *pdev)
976 + if (ret)
977 + goto err_clk;
978 +
979 +- dev_info(&pdev->dev, "Added i2c controller %d, irq %d\n", priv->adap.nr, irq);
980 ++ dev_info(&pdev->dev, "Added i2c controller %d, irq %d\n", priv->adap.nr,
981 ++ priv->irq);
982 +
983 + return 0;
984 +
985 +diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
986 +index c46c4bddc7ca..cba325eb852f 100644
987 +--- a/drivers/i2c/busses/i2c-piix4.c
988 ++++ b/drivers/i2c/busses/i2c-piix4.c
989 +@@ -91,7 +91,7 @@
990 + #define SB800_PIIX4_PORT_IDX_MASK 0x06
991 + #define SB800_PIIX4_PORT_IDX_SHIFT 1
992 +
993 +-/* On kerncz, SmBus0Sel is at bit 20:19 of PMx00 DecodeEn */
994 ++/* On kerncz and Hudson2, SmBus0Sel is at bit 20:19 of PMx00 DecodeEn */
995 + #define SB800_PIIX4_PORT_IDX_KERNCZ 0x02
996 + #define SB800_PIIX4_PORT_IDX_MASK_KERNCZ 0x18
997 + #define SB800_PIIX4_PORT_IDX_SHIFT_KERNCZ 3
998 +@@ -358,18 +358,16 @@ static int piix4_setup_sb800(struct pci_dev *PIIX4_dev,
999 + /* Find which register is used for port selection */
1000 + if (PIIX4_dev->vendor == PCI_VENDOR_ID_AMD ||
1001 + PIIX4_dev->vendor == PCI_VENDOR_ID_HYGON) {
1002 +- switch (PIIX4_dev->device) {
1003 +- case PCI_DEVICE_ID_AMD_KERNCZ_SMBUS:
1004 ++ if (PIIX4_dev->device == PCI_DEVICE_ID_AMD_KERNCZ_SMBUS ||
1005 ++ (PIIX4_dev->device == PCI_DEVICE_ID_AMD_HUDSON2_SMBUS &&
1006 ++ PIIX4_dev->revision >= 0x1F)) {
1007 + piix4_port_sel_sb800 = SB800_PIIX4_PORT_IDX_KERNCZ;
1008 + piix4_port_mask_sb800 = SB800_PIIX4_PORT_IDX_MASK_KERNCZ;
1009 + piix4_port_shift_sb800 = SB800_PIIX4_PORT_IDX_SHIFT_KERNCZ;
1010 +- break;
1011 +- case PCI_DEVICE_ID_AMD_HUDSON2_SMBUS:
1012 +- default:
1013 ++ } else {
1014 + piix4_port_sel_sb800 = SB800_PIIX4_PORT_IDX_ALT;
1015 + piix4_port_mask_sb800 = SB800_PIIX4_PORT_IDX_MASK;
1016 + piix4_port_shift_sb800 = SB800_PIIX4_PORT_IDX_SHIFT;
1017 +- break;
1018 + }
1019 + } else {
1020 + if (!request_muxed_region(SB800_PIIX4_SMB_IDX, 2,
1021 +diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
1022 +index d39a4606f72d..531c01100b56 100644
1023 +--- a/drivers/i2c/busses/i2c-rcar.c
1024 ++++ b/drivers/i2c/busses/i2c-rcar.c
1025 +@@ -139,6 +139,7 @@ struct rcar_i2c_priv {
1026 + enum dma_data_direction dma_direction;
1027 +
1028 + struct reset_control *rstc;
1029 ++ int irq;
1030 + };
1031 +
1032 + #define rcar_i2c_priv_to_dev(p) ((p)->adap.dev.parent)
1033 +@@ -861,9 +862,11 @@ static int rcar_unreg_slave(struct i2c_client *slave)
1034 +
1035 + WARN_ON(!priv->slave);
1036 +
1037 ++ /* disable irqs and ensure none is running before clearing ptr */
1038 + rcar_i2c_write(priv, ICSIER, 0);
1039 + rcar_i2c_write(priv, ICSCR, 0);
1040 +
1041 ++ synchronize_irq(priv->irq);
1042 + priv->slave = NULL;
1043 +
1044 + pm_runtime_put(rcar_i2c_priv_to_dev(priv));
1045 +@@ -918,7 +921,7 @@ static int rcar_i2c_probe(struct platform_device *pdev)
1046 + struct i2c_adapter *adap;
1047 + struct device *dev = &pdev->dev;
1048 + struct i2c_timings i2c_t;
1049 +- int irq, ret;
1050 ++ int ret;
1051 +
1052 + /* Otherwise logic will break because some bytes must always use PIO */
1053 + BUILD_BUG_ON_MSG(RCAR_MIN_DMA_LEN < 3, "Invalid min DMA length");
1054 +@@ -984,10 +987,10 @@ static int rcar_i2c_probe(struct platform_device *pdev)
1055 + pm_runtime_put(dev);
1056 +
1057 +
1058 +- irq = platform_get_irq(pdev, 0);
1059 +- ret = devm_request_irq(dev, irq, rcar_i2c_irq, 0, dev_name(dev), priv);
1060 ++ priv->irq = platform_get_irq(pdev, 0);
1061 ++ ret = devm_request_irq(dev, priv->irq, rcar_i2c_irq, 0, dev_name(dev), priv);
1062 + if (ret < 0) {
1063 +- dev_err(dev, "cannot get irq %d\n", irq);
1064 ++ dev_err(dev, "cannot get irq %d\n", priv->irq);
1065 + goto out_pm_disable;
1066 + }
1067 +
1068 +diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c
1069 +index e4b13a32692a..5e5f7dd82c50 100644
1070 +--- a/drivers/infiniband/core/umem_odp.c
1071 ++++ b/drivers/infiniband/core/umem_odp.c
1072 +@@ -114,10 +114,6 @@ static int ib_umem_notifier_release_trampoline(struct ib_umem_odp *umem_odp,
1073 + * prevent any further fault handling on this MR.
1074 + */
1075 + ib_umem_notifier_start_account(umem_odp);
1076 +- umem_odp->dying = 1;
1077 +- /* Make sure that the fact the umem is dying is out before we release
1078 +- * all pending page faults. */
1079 +- smp_wmb();
1080 + complete_all(&umem_odp->notifier_completion);
1081 + umem->context->invalidate_range(umem_odp, ib_umem_start(umem),
1082 + ib_umem_end(umem));
1083 +diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c
1084 +index f6e5351ba4d5..fda3dfd6f87b 100644
1085 +--- a/drivers/infiniband/hw/mlx5/odp.c
1086 ++++ b/drivers/infiniband/hw/mlx5/odp.c
1087 +@@ -581,7 +581,6 @@ static int pagefault_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr,
1088 + u32 flags)
1089 + {
1090 + int npages = 0, current_seq, page_shift, ret, np;
1091 +- bool implicit = false;
1092 + struct ib_umem_odp *odp_mr = to_ib_umem_odp(mr->umem);
1093 + bool downgrade = flags & MLX5_PF_FLAGS_DOWNGRADE;
1094 + bool prefetch = flags & MLX5_PF_FLAGS_PREFETCH;
1095 +@@ -596,7 +595,6 @@ static int pagefault_mr(struct mlx5_ib_dev *dev, struct mlx5_ib_mr *mr,
1096 + if (IS_ERR(odp))
1097 + return PTR_ERR(odp);
1098 + mr = odp->private;
1099 +- implicit = true;
1100 + } else {
1101 + odp = odp_mr;
1102 + }
1103 +@@ -684,19 +682,15 @@ next_mr:
1104 +
1105 + out:
1106 + if (ret == -EAGAIN) {
1107 +- if (implicit || !odp->dying) {
1108 +- unsigned long timeout =
1109 +- msecs_to_jiffies(MMU_NOTIFIER_TIMEOUT);
1110 +-
1111 +- if (!wait_for_completion_timeout(
1112 +- &odp->notifier_completion,
1113 +- timeout)) {
1114 +- mlx5_ib_warn(dev, "timeout waiting for mmu notifier. seq %d against %d. notifiers_count=%d\n",
1115 +- current_seq, odp->notifiers_seq, odp->notifiers_count);
1116 +- }
1117 +- } else {
1118 +- /* The MR is being killed, kill the QP as well. */
1119 +- ret = -EFAULT;
1120 ++ unsigned long timeout = msecs_to_jiffies(MMU_NOTIFIER_TIMEOUT);
1121 ++
1122 ++ if (!wait_for_completion_timeout(&odp->notifier_completion,
1123 ++ timeout)) {
1124 ++ mlx5_ib_warn(
1125 ++ dev,
1126 ++ "timeout waiting for mmu notifier. seq %d against %d. notifiers_count=%d\n",
1127 ++ current_seq, odp->notifiers_seq,
1128 ++ odp->notifiers_count);
1129 + }
1130 + }
1131 +
1132 +diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
1133 +index 379318266468..8c02d2283d64 100644
1134 +--- a/drivers/iommu/dma-iommu.c
1135 ++++ b/drivers/iommu/dma-iommu.c
1136 +@@ -710,7 +710,7 @@ static int __finalise_sg(struct device *dev, struct scatterlist *sg, int nents,
1137 + * - and wouldn't make the resulting output segment too long
1138 + */
1139 + if (cur_len && !s_iova_off && (dma_addr & seg_mask) &&
1140 +- (cur_len + s_length <= max_len)) {
1141 ++ (max_len - cur_len >= s_length)) {
1142 + /* ...then concatenate it with the previous one */
1143 + cur_len += s_length;
1144 + } else {
1145 +diff --git a/drivers/media/platform/omap/omap_vout_vrfb.c b/drivers/media/platform/omap/omap_vout_vrfb.c
1146 +index 29e3f5da59c1..11ec048929e8 100644
1147 +--- a/drivers/media/platform/omap/omap_vout_vrfb.c
1148 ++++ b/drivers/media/platform/omap/omap_vout_vrfb.c
1149 +@@ -253,8 +253,7 @@ int omap_vout_prepare_vrfb(struct omap_vout_device *vout,
1150 + */
1151 +
1152 + pixsize = vout->bpp * vout->vrfb_bpp;
1153 +- dst_icg = ((MAX_PIXELS_PER_LINE * pixsize) -
1154 +- (vout->pix.width * vout->bpp)) + 1;
1155 ++ dst_icg = MAX_PIXELS_PER_LINE * pixsize - vout->pix.width * vout->bpp;
1156 +
1157 + xt->src_start = vout->buf_phy_addr[vb->i];
1158 + xt->dst_start = vout->vrfb_context[vb->i].paddr[0];
1159 +diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
1160 +index 02d116b01a1a..ac6b252a1ddc 100644
1161 +--- a/drivers/misc/habanalabs/goya/goya.c
1162 ++++ b/drivers/misc/habanalabs/goya/goya.c
1163 +@@ -2716,9 +2716,10 @@ void goya_ring_doorbell(struct hl_device *hdev, u32 hw_queue_id, u32 pi)
1164 + GOYA_ASYNC_EVENT_ID_PI_UPDATE);
1165 + }
1166 +
1167 +-void goya_flush_pq_write(struct hl_device *hdev, u64 *pq, u64 exp_val)
1168 ++void goya_pqe_write(struct hl_device *hdev, __le64 *pqe, struct hl_bd *bd)
1169 + {
1170 +- /* Not needed in Goya */
1171 ++ /* The QMANs are on the SRAM so need to copy to IO space */
1172 ++ memcpy_toio((void __iomem *) pqe, bd, sizeof(struct hl_bd));
1173 + }
1174 +
1175 + static void *goya_dma_alloc_coherent(struct hl_device *hdev, size_t size,
1176 +@@ -3310,9 +3311,11 @@ static int goya_validate_dma_pkt_no_mmu(struct hl_device *hdev,
1177 + int rc;
1178 +
1179 + dev_dbg(hdev->dev, "DMA packet details:\n");
1180 +- dev_dbg(hdev->dev, "source == 0x%llx\n", user_dma_pkt->src_addr);
1181 +- dev_dbg(hdev->dev, "destination == 0x%llx\n", user_dma_pkt->dst_addr);
1182 +- dev_dbg(hdev->dev, "size == %u\n", user_dma_pkt->tsize);
1183 ++ dev_dbg(hdev->dev, "source == 0x%llx\n",
1184 ++ le64_to_cpu(user_dma_pkt->src_addr));
1185 ++ dev_dbg(hdev->dev, "destination == 0x%llx\n",
1186 ++ le64_to_cpu(user_dma_pkt->dst_addr));
1187 ++ dev_dbg(hdev->dev, "size == %u\n", le32_to_cpu(user_dma_pkt->tsize));
1188 +
1189 + ctl = le32_to_cpu(user_dma_pkt->ctl);
1190 + user_dir = (ctl & GOYA_PKT_LIN_DMA_CTL_DMA_DIR_MASK) >>
1191 +@@ -3341,9 +3344,11 @@ static int goya_validate_dma_pkt_mmu(struct hl_device *hdev,
1192 + struct packet_lin_dma *user_dma_pkt)
1193 + {
1194 + dev_dbg(hdev->dev, "DMA packet details:\n");
1195 +- dev_dbg(hdev->dev, "source == 0x%llx\n", user_dma_pkt->src_addr);
1196 +- dev_dbg(hdev->dev, "destination == 0x%llx\n", user_dma_pkt->dst_addr);
1197 +- dev_dbg(hdev->dev, "size == %u\n", user_dma_pkt->tsize);
1198 ++ dev_dbg(hdev->dev, "source == 0x%llx\n",
1199 ++ le64_to_cpu(user_dma_pkt->src_addr));
1200 ++ dev_dbg(hdev->dev, "destination == 0x%llx\n",
1201 ++ le64_to_cpu(user_dma_pkt->dst_addr));
1202 ++ dev_dbg(hdev->dev, "size == %u\n", le32_to_cpu(user_dma_pkt->tsize));
1203 +
1204 + /*
1205 + * WA for HW-23.
1206 +@@ -3383,7 +3388,8 @@ static int goya_validate_wreg32(struct hl_device *hdev,
1207 +
1208 + dev_dbg(hdev->dev, "WREG32 packet details:\n");
1209 + dev_dbg(hdev->dev, "reg_offset == 0x%x\n", reg_offset);
1210 +- dev_dbg(hdev->dev, "value == 0x%x\n", wreg_pkt->value);
1211 ++ dev_dbg(hdev->dev, "value == 0x%x\n",
1212 ++ le32_to_cpu(wreg_pkt->value));
1213 +
1214 + if (reg_offset != (mmDMA_CH_0_WR_COMP_ADDR_LO & 0x1FFF)) {
1215 + dev_err(hdev->dev, "WREG32 packet with illegal address 0x%x\n",
1216 +@@ -3425,12 +3431,13 @@ static int goya_validate_cb(struct hl_device *hdev,
1217 + while (cb_parsed_length < parser->user_cb_size) {
1218 + enum packet_id pkt_id;
1219 + u16 pkt_size;
1220 +- void *user_pkt;
1221 ++ struct goya_packet *user_pkt;
1222 +
1223 +- user_pkt = (void *) (uintptr_t)
1224 ++ user_pkt = (struct goya_packet *) (uintptr_t)
1225 + (parser->user_cb->kernel_address + cb_parsed_length);
1226 +
1227 +- pkt_id = (enum packet_id) (((*(u64 *) user_pkt) &
1228 ++ pkt_id = (enum packet_id) (
1229 ++ (le64_to_cpu(user_pkt->header) &
1230 + PACKET_HEADER_PACKET_ID_MASK) >>
1231 + PACKET_HEADER_PACKET_ID_SHIFT);
1232 +
1233 +@@ -3450,7 +3457,8 @@ static int goya_validate_cb(struct hl_device *hdev,
1234 + * need to validate here as well because patch_cb() is
1235 + * not called in MMU path while this function is called
1236 + */
1237 +- rc = goya_validate_wreg32(hdev, parser, user_pkt);
1238 ++ rc = goya_validate_wreg32(hdev,
1239 ++ parser, (struct packet_wreg32 *) user_pkt);
1240 + break;
1241 +
1242 + case PACKET_WREG_BULK:
1243 +@@ -3478,10 +3486,10 @@ static int goya_validate_cb(struct hl_device *hdev,
1244 + case PACKET_LIN_DMA:
1245 + if (is_mmu)
1246 + rc = goya_validate_dma_pkt_mmu(hdev, parser,
1247 +- user_pkt);
1248 ++ (struct packet_lin_dma *) user_pkt);
1249 + else
1250 + rc = goya_validate_dma_pkt_no_mmu(hdev, parser,
1251 +- user_pkt);
1252 ++ (struct packet_lin_dma *) user_pkt);
1253 + break;
1254 +
1255 + case PACKET_MSG_LONG:
1256 +@@ -3654,15 +3662,16 @@ static int goya_patch_cb(struct hl_device *hdev,
1257 + enum packet_id pkt_id;
1258 + u16 pkt_size;
1259 + u32 new_pkt_size = 0;
1260 +- void *user_pkt, *kernel_pkt;
1261 ++ struct goya_packet *user_pkt, *kernel_pkt;
1262 +
1263 +- user_pkt = (void *) (uintptr_t)
1264 ++ user_pkt = (struct goya_packet *) (uintptr_t)
1265 + (parser->user_cb->kernel_address + cb_parsed_length);
1266 +- kernel_pkt = (void *) (uintptr_t)
1267 ++ kernel_pkt = (struct goya_packet *) (uintptr_t)
1268 + (parser->patched_cb->kernel_address +
1269 + cb_patched_cur_length);
1270 +
1271 +- pkt_id = (enum packet_id) (((*(u64 *) user_pkt) &
1272 ++ pkt_id = (enum packet_id) (
1273 ++ (le64_to_cpu(user_pkt->header) &
1274 + PACKET_HEADER_PACKET_ID_MASK) >>
1275 + PACKET_HEADER_PACKET_ID_SHIFT);
1276 +
1277 +@@ -3677,15 +3686,18 @@ static int goya_patch_cb(struct hl_device *hdev,
1278 +
1279 + switch (pkt_id) {
1280 + case PACKET_LIN_DMA:
1281 +- rc = goya_patch_dma_packet(hdev, parser, user_pkt,
1282 +- kernel_pkt, &new_pkt_size);
1283 ++ rc = goya_patch_dma_packet(hdev, parser,
1284 ++ (struct packet_lin_dma *) user_pkt,
1285 ++ (struct packet_lin_dma *) kernel_pkt,
1286 ++ &new_pkt_size);
1287 + cb_patched_cur_length += new_pkt_size;
1288 + break;
1289 +
1290 + case PACKET_WREG_32:
1291 + memcpy(kernel_pkt, user_pkt, pkt_size);
1292 + cb_patched_cur_length += pkt_size;
1293 +- rc = goya_validate_wreg32(hdev, parser, kernel_pkt);
1294 ++ rc = goya_validate_wreg32(hdev, parser,
1295 ++ (struct packet_wreg32 *) kernel_pkt);
1296 + break;
1297 +
1298 + case PACKET_WREG_BULK:
1299 +@@ -4245,6 +4257,8 @@ static int goya_unmask_irq_arr(struct hl_device *hdev, u32 *irq_arr,
1300 + size_t total_pkt_size;
1301 + long result;
1302 + int rc;
1303 ++ int irq_num_entries, irq_arr_index;
1304 ++ __le32 *goya_irq_arr;
1305 +
1306 + total_pkt_size = sizeof(struct armcp_unmask_irq_arr_packet) +
1307 + irq_arr_size;
1308 +@@ -4262,8 +4276,16 @@ static int goya_unmask_irq_arr(struct hl_device *hdev, u32 *irq_arr,
1309 + if (!pkt)
1310 + return -ENOMEM;
1311 +
1312 +- pkt->length = cpu_to_le32(irq_arr_size / sizeof(irq_arr[0]));
1313 +- memcpy(&pkt->irqs, irq_arr, irq_arr_size);
1314 ++ irq_num_entries = irq_arr_size / sizeof(irq_arr[0]);
1315 ++ pkt->length = cpu_to_le32(irq_num_entries);
1316 ++
1317 ++ /* We must perform any necessary endianness conversation on the irq
1318 ++ * array being passed to the goya hardware
1319 ++ */
1320 ++ for (irq_arr_index = 0, goya_irq_arr = (__le32 *) &pkt->irqs;
1321 ++ irq_arr_index < irq_num_entries ; irq_arr_index++)
1322 ++ goya_irq_arr[irq_arr_index] =
1323 ++ cpu_to_le32(irq_arr[irq_arr_index]);
1324 +
1325 + pkt->armcp_pkt.ctl = cpu_to_le32(ARMCP_PACKET_UNMASK_RAZWI_IRQ_ARRAY <<
1326 + ARMCP_PKT_CTL_OPCODE_SHIFT);
1327 +@@ -4778,7 +4800,7 @@ static const struct hl_asic_funcs goya_funcs = {
1328 + .resume = goya_resume,
1329 + .cb_mmap = goya_cb_mmap,
1330 + .ring_doorbell = goya_ring_doorbell,
1331 +- .flush_pq_write = goya_flush_pq_write,
1332 ++ .pqe_write = goya_pqe_write,
1333 + .asic_dma_alloc_coherent = goya_dma_alloc_coherent,
1334 + .asic_dma_free_coherent = goya_dma_free_coherent,
1335 + .get_int_queue_base = goya_get_int_queue_base,
1336 +diff --git a/drivers/misc/habanalabs/goya/goyaP.h b/drivers/misc/habanalabs/goya/goyaP.h
1337 +index c83cab0d641e..e2040fd331ca 100644
1338 +--- a/drivers/misc/habanalabs/goya/goyaP.h
1339 ++++ b/drivers/misc/habanalabs/goya/goyaP.h
1340 +@@ -170,7 +170,7 @@ int goya_late_init(struct hl_device *hdev);
1341 + void goya_late_fini(struct hl_device *hdev);
1342 +
1343 + void goya_ring_doorbell(struct hl_device *hdev, u32 hw_queue_id, u32 pi);
1344 +-void goya_flush_pq_write(struct hl_device *hdev, u64 *pq, u64 exp_val);
1345 ++void goya_pqe_write(struct hl_device *hdev, __le64 *pqe, struct hl_bd *bd);
1346 + void goya_update_eq_ci(struct hl_device *hdev, u32 val);
1347 + void goya_restore_phase_topology(struct hl_device *hdev);
1348 + int goya_context_switch(struct hl_device *hdev, u32 asid);
1349 +diff --git a/drivers/misc/habanalabs/habanalabs.h b/drivers/misc/habanalabs/habanalabs.h
1350 +index adef7d9d7488..d56ab65d5b2a 100644
1351 +--- a/drivers/misc/habanalabs/habanalabs.h
1352 ++++ b/drivers/misc/habanalabs/habanalabs.h
1353 +@@ -449,7 +449,11 @@ enum hl_pll_frequency {
1354 + * @resume: handles IP specific H/W or SW changes for resume.
1355 + * @cb_mmap: maps a CB.
1356 + * @ring_doorbell: increment PI on a given QMAN.
1357 +- * @flush_pq_write: flush PQ entry write if necessary, WARN if flushing failed.
1358 ++ * @pqe_write: Write the PQ entry to the PQ. This is ASIC-specific
1359 ++ * function because the PQs are located in different memory areas
1360 ++ * per ASIC (SRAM, DRAM, Host memory) and therefore, the method of
1361 ++ * writing the PQE must match the destination memory area
1362 ++ * properties.
1363 + * @asic_dma_alloc_coherent: Allocate coherent DMA memory by calling
1364 + * dma_alloc_coherent(). This is ASIC function because
1365 + * its implementation is not trivial when the driver
1366 +@@ -518,7 +522,8 @@ struct hl_asic_funcs {
1367 + int (*cb_mmap)(struct hl_device *hdev, struct vm_area_struct *vma,
1368 + u64 kaddress, phys_addr_t paddress, u32 size);
1369 + void (*ring_doorbell)(struct hl_device *hdev, u32 hw_queue_id, u32 pi);
1370 +- void (*flush_pq_write)(struct hl_device *hdev, u64 *pq, u64 exp_val);
1371 ++ void (*pqe_write)(struct hl_device *hdev, __le64 *pqe,
1372 ++ struct hl_bd *bd);
1373 + void* (*asic_dma_alloc_coherent)(struct hl_device *hdev, size_t size,
1374 + dma_addr_t *dma_handle, gfp_t flag);
1375 + void (*asic_dma_free_coherent)(struct hl_device *hdev, size_t size,
1376 +diff --git a/drivers/misc/habanalabs/hw_queue.c b/drivers/misc/habanalabs/hw_queue.c
1377 +index 2894d8975933..bb7679474727 100644
1378 +--- a/drivers/misc/habanalabs/hw_queue.c
1379 ++++ b/drivers/misc/habanalabs/hw_queue.c
1380 +@@ -290,23 +290,19 @@ static void int_hw_queue_schedule_job(struct hl_cs_job *job)
1381 + struct hl_device *hdev = job->cs->ctx->hdev;
1382 + struct hl_hw_queue *q = &hdev->kernel_queues[job->hw_queue_id];
1383 + struct hl_bd bd;
1384 +- u64 *pi, *pbd = (u64 *) &bd;
1385 ++ __le64 *pi;
1386 +
1387 + bd.ctl = 0;
1388 +- bd.len = __cpu_to_le32(job->job_cb_size);
1389 +- bd.ptr = __cpu_to_le64((u64) (uintptr_t) job->user_cb);
1390 ++ bd.len = cpu_to_le32(job->job_cb_size);
1391 ++ bd.ptr = cpu_to_le64((u64) (uintptr_t) job->user_cb);
1392 +
1393 +- pi = (u64 *) (uintptr_t) (q->kernel_address +
1394 ++ pi = (__le64 *) (uintptr_t) (q->kernel_address +
1395 + ((q->pi & (q->int_queue_len - 1)) * sizeof(bd)));
1396 +
1397 +- pi[0] = pbd[0];
1398 +- pi[1] = pbd[1];
1399 +-
1400 + q->pi++;
1401 + q->pi &= ((q->int_queue_len << 1) - 1);
1402 +
1403 +- /* Flush PQ entry write. Relevant only for specific ASICs */
1404 +- hdev->asic_funcs->flush_pq_write(hdev, pi, pbd[0]);
1405 ++ hdev->asic_funcs->pqe_write(hdev, pi, &bd);
1406 +
1407 + hdev->asic_funcs->ring_doorbell(hdev, q->hw_queue_id, q->pi);
1408 + }
1409 +diff --git a/drivers/misc/habanalabs/include/goya/goya_packets.h b/drivers/misc/habanalabs/include/goya/goya_packets.h
1410 +index a14407b975e4..ef54bad20509 100644
1411 +--- a/drivers/misc/habanalabs/include/goya/goya_packets.h
1412 ++++ b/drivers/misc/habanalabs/include/goya/goya_packets.h
1413 +@@ -52,6 +52,19 @@ enum goya_dma_direction {
1414 + #define GOYA_PKT_CTL_MB_SHIFT 31
1415 + #define GOYA_PKT_CTL_MB_MASK 0x80000000
1416 +
1417 ++/* All packets have, at least, an 8-byte header, which contains
1418 ++ * the packet type. The kernel driver uses the packet header for packet
1419 ++ * validation and to perform any necessary required preparation before
1420 ++ * sending them off to the hardware.
1421 ++ */
1422 ++struct goya_packet {
1423 ++ __le64 header;
1424 ++ /* The rest of the packet data follows. Use the corresponding
1425 ++ * packet_XXX struct to deference the data, based on packet type
1426 ++ */
1427 ++ u8 contents[0];
1428 ++};
1429 ++
1430 + struct packet_nop {
1431 + __le32 reserved;
1432 + __le32 ctl;
1433 +diff --git a/drivers/misc/habanalabs/irq.c b/drivers/misc/habanalabs/irq.c
1434 +index ea9f72ff456c..199791b57caf 100644
1435 +--- a/drivers/misc/habanalabs/irq.c
1436 ++++ b/drivers/misc/habanalabs/irq.c
1437 +@@ -80,8 +80,7 @@ irqreturn_t hl_irq_handler_cq(int irq, void *arg)
1438 + struct hl_cs_job *job;
1439 + bool shadow_index_valid;
1440 + u16 shadow_index;
1441 +- u32 *cq_entry;
1442 +- u32 *cq_base;
1443 ++ struct hl_cq_entry *cq_entry, *cq_base;
1444 +
1445 + if (hdev->disabled) {
1446 + dev_dbg(hdev->dev,
1447 +@@ -90,29 +89,29 @@ irqreturn_t hl_irq_handler_cq(int irq, void *arg)
1448 + return IRQ_HANDLED;
1449 + }
1450 +
1451 +- cq_base = (u32 *) (uintptr_t) cq->kernel_address;
1452 ++ cq_base = (struct hl_cq_entry *) (uintptr_t) cq->kernel_address;
1453 +
1454 + while (1) {
1455 +- bool entry_ready = ((cq_base[cq->ci] & CQ_ENTRY_READY_MASK)
1456 ++ bool entry_ready = ((le32_to_cpu(cq_base[cq->ci].data) &
1457 ++ CQ_ENTRY_READY_MASK)
1458 + >> CQ_ENTRY_READY_SHIFT);
1459 +
1460 + if (!entry_ready)
1461 + break;
1462 +
1463 +- cq_entry = (u32 *) &cq_base[cq->ci];
1464 ++ cq_entry = (struct hl_cq_entry *) &cq_base[cq->ci];
1465 +
1466 +- /*
1467 +- * Make sure we read CQ entry contents after we've
1468 ++ /* Make sure we read CQ entry contents after we've
1469 + * checked the ownership bit.
1470 + */
1471 + dma_rmb();
1472 +
1473 +- shadow_index_valid =
1474 +- ((*cq_entry & CQ_ENTRY_SHADOW_INDEX_VALID_MASK)
1475 ++ shadow_index_valid = ((le32_to_cpu(cq_entry->data) &
1476 ++ CQ_ENTRY_SHADOW_INDEX_VALID_MASK)
1477 + >> CQ_ENTRY_SHADOW_INDEX_VALID_SHIFT);
1478 +
1479 +- shadow_index = (u16)
1480 +- ((*cq_entry & CQ_ENTRY_SHADOW_INDEX_MASK)
1481 ++ shadow_index = (u16) ((le32_to_cpu(cq_entry->data) &
1482 ++ CQ_ENTRY_SHADOW_INDEX_MASK)
1483 + >> CQ_ENTRY_SHADOW_INDEX_SHIFT);
1484 +
1485 + queue = &hdev->kernel_queues[cq->hw_queue_id];
1486 +@@ -122,8 +121,7 @@ irqreturn_t hl_irq_handler_cq(int irq, void *arg)
1487 + queue_work(hdev->cq_wq, &job->finish_work);
1488 + }
1489 +
1490 +- /*
1491 +- * Update ci of the context's queue. There is no
1492 ++ /* Update ci of the context's queue. There is no
1493 + * need to protect it with spinlock because this update is
1494 + * done only inside IRQ and there is a different IRQ per
1495 + * queue
1496 +@@ -131,7 +129,8 @@ irqreturn_t hl_irq_handler_cq(int irq, void *arg)
1497 + queue->ci = hl_queue_inc_ptr(queue->ci);
1498 +
1499 + /* Clear CQ entry ready bit */
1500 +- cq_base[cq->ci] &= ~CQ_ENTRY_READY_MASK;
1501 ++ cq_entry->data = cpu_to_le32(le32_to_cpu(cq_entry->data) &
1502 ++ ~CQ_ENTRY_READY_MASK);
1503 +
1504 + cq->ci = hl_cq_inc_ptr(cq->ci);
1505 +
1506 +diff --git a/drivers/misc/habanalabs/memory.c b/drivers/misc/habanalabs/memory.c
1507 +index 693877e37fd8..924a438ba973 100644
1508 +--- a/drivers/misc/habanalabs/memory.c
1509 ++++ b/drivers/misc/habanalabs/memory.c
1510 +@@ -1629,6 +1629,8 @@ void hl_vm_ctx_fini(struct hl_ctx *ctx)
1511 + dev_dbg(hdev->dev,
1512 + "page list 0x%p of asid %d is still alive\n",
1513 + phys_pg_list, ctx->asid);
1514 ++ atomic64_sub(phys_pg_list->total_size,
1515 ++ &hdev->dram_used_mem);
1516 + free_phys_pg_pack(hdev, phys_pg_list);
1517 + idr_remove(&vm->phys_pg_pack_handles, i);
1518 + }
1519 +diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c
1520 +index 17f839dee976..018da2c3f92b 100644
1521 +--- a/drivers/misc/lkdtm/bugs.c
1522 ++++ b/drivers/misc/lkdtm/bugs.c
1523 +@@ -22,7 +22,7 @@ struct lkdtm_list {
1524 + * recurse past the end of THREAD_SIZE by default.
1525 + */
1526 + #if defined(CONFIG_FRAME_WARN) && (CONFIG_FRAME_WARN > 0)
1527 +-#define REC_STACK_SIZE (CONFIG_FRAME_WARN / 2)
1528 ++#define REC_STACK_SIZE (_AC(CONFIG_FRAME_WARN, UL) / 2)
1529 + #else
1530 + #define REC_STACK_SIZE (THREAD_SIZE / 8)
1531 + #endif
1532 +@@ -91,7 +91,7 @@ void lkdtm_LOOP(void)
1533 +
1534 + void lkdtm_EXHAUST_STACK(void)
1535 + {
1536 +- pr_info("Calling function with %d frame size to depth %d ...\n",
1537 ++ pr_info("Calling function with %lu frame size to depth %d ...\n",
1538 + REC_STACK_SIZE, recur_count);
1539 + recursive_loop(recur_count);
1540 + pr_info("FAIL: survived without exhausting stack?!\n");
1541 +diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h
1542 +index 6c0173772162..77f7dff7098d 100644
1543 +--- a/drivers/misc/mei/hw-me-regs.h
1544 ++++ b/drivers/misc/mei/hw-me-regs.h
1545 +@@ -81,6 +81,8 @@
1546 +
1547 + #define MEI_DEV_ID_ICP_LP 0x34E0 /* Ice Lake Point LP */
1548 +
1549 ++#define MEI_DEV_ID_TGP_LP 0xA0E0 /* Tiger Lake Point LP */
1550 ++
1551 + #define MEI_DEV_ID_MCC 0x4B70 /* Mule Creek Canyon (EHL) */
1552 + #define MEI_DEV_ID_MCC_4 0x4B75 /* Mule Creek Canyon 4 (EHL) */
1553 +
1554 +diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c
1555 +index 57cb68f5cc64..541538eff8b1 100644
1556 +--- a/drivers/misc/mei/pci-me.c
1557 ++++ b/drivers/misc/mei/pci-me.c
1558 +@@ -98,6 +98,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
1559 +
1560 + {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)},
1561 +
1562 ++ {MEI_PCI_DEVICE(MEI_DEV_ID_TGP_LP, MEI_ME_PCH12_CFG)},
1563 ++
1564 + {MEI_PCI_DEVICE(MEI_DEV_ID_MCC, MEI_ME_PCH12_CFG)},
1565 + {MEI_PCI_DEVICE(MEI_DEV_ID_MCC_4, MEI_ME_PCH8_CFG)},
1566 +
1567 +diff --git a/drivers/misc/vmw_vmci/vmci_doorbell.c b/drivers/misc/vmw_vmci/vmci_doorbell.c
1568 +index bad89b6e0802..345addd9306d 100644
1569 +--- a/drivers/misc/vmw_vmci/vmci_doorbell.c
1570 ++++ b/drivers/misc/vmw_vmci/vmci_doorbell.c
1571 +@@ -310,7 +310,8 @@ int vmci_dbell_host_context_notify(u32 src_cid, struct vmci_handle handle)
1572 +
1573 + entry = container_of(resource, struct dbell_entry, resource);
1574 + if (entry->run_delayed) {
1575 +- schedule_work(&entry->work);
1576 ++ if (!schedule_work(&entry->work))
1577 ++ vmci_resource_put(resource);
1578 + } else {
1579 + entry->notify_cb(entry->client_data);
1580 + vmci_resource_put(resource);
1581 +@@ -361,7 +362,8 @@ static void dbell_fire_entries(u32 notify_idx)
1582 + atomic_read(&dbell->active) == 1) {
1583 + if (dbell->run_delayed) {
1584 + vmci_resource_get(&dbell->resource);
1585 +- schedule_work(&dbell->work);
1586 ++ if (!schedule_work(&dbell->work))
1587 ++ vmci_resource_put(&dbell->resource);
1588 + } else {
1589 + dbell->notify_cb(dbell->client_data);
1590 + }
1591 +diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
1592 +index d681e8aaca83..fe914ff5f5d6 100644
1593 +--- a/drivers/mmc/core/sd.c
1594 ++++ b/drivers/mmc/core/sd.c
1595 +@@ -1292,6 +1292,12 @@ int mmc_attach_sd(struct mmc_host *host)
1596 + goto err;
1597 + }
1598 +
1599 ++ /*
1600 ++ * Some SD cards claims an out of spec VDD voltage range. Let's treat
1601 ++ * these bits as being in-valid and especially also bit7.
1602 ++ */
1603 ++ ocr &= ~0x7FFF;
1604 ++
1605 + rocr = mmc_select_voltage(host, ocr);
1606 +
1607 + /*
1608 +diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c
1609 +index 163d1cf4367e..44139fceac24 100644
1610 +--- a/drivers/mmc/host/sdhci-cadence.c
1611 ++++ b/drivers/mmc/host/sdhci-cadence.c
1612 +@@ -369,6 +369,7 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
1613 + host->mmc_host_ops.execute_tuning = sdhci_cdns_execute_tuning;
1614 + host->mmc_host_ops.hs400_enhanced_strobe =
1615 + sdhci_cdns_hs400_enhanced_strobe;
1616 ++ sdhci_enable_v4_mode(host);
1617 +
1618 + sdhci_get_of_property(pdev);
1619 +
1620 +diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
1621 +index e377b9bc55a4..d4993582f0f6 100644
1622 +--- a/drivers/mmc/host/sdhci-of-at91.c
1623 ++++ b/drivers/mmc/host/sdhci-of-at91.c
1624 +@@ -357,6 +357,9 @@ static int sdhci_at91_probe(struct platform_device *pdev)
1625 + pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
1626 + pm_runtime_use_autosuspend(&pdev->dev);
1627 +
1628 ++ /* HS200 is broken at this moment */
1629 ++ host->quirks2 = SDHCI_QUIRK2_BROKEN_HS200;
1630 ++
1631 + ret = sdhci_add_host(host);
1632 + if (ret)
1633 + goto pm_runtime_disable;
1634 +diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
1635 +index 06f84a4d79e0..fc892a8d882f 100644
1636 +--- a/drivers/mmc/host/sdhci-sprd.c
1637 ++++ b/drivers/mmc/host/sdhci-sprd.c
1638 +@@ -174,10 +174,11 @@ static inline void _sdhci_sprd_set_clock(struct sdhci_host *host,
1639 + struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host);
1640 + u32 div, val, mask;
1641 +
1642 +- div = sdhci_sprd_calc_div(sprd_host->base_rate, clk);
1643 ++ sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
1644 +
1645 +- clk |= ((div & 0x300) >> 2) | ((div & 0xFF) << 8);
1646 +- sdhci_enable_clk(host, clk);
1647 ++ div = sdhci_sprd_calc_div(sprd_host->base_rate, clk);
1648 ++ div = ((div & 0x300) >> 2) | ((div & 0xFF) << 8);
1649 ++ sdhci_enable_clk(host, div);
1650 +
1651 + /* enable auto gate sdhc_enable_auto_gate */
1652 + val = sdhci_readl(host, SDHCI_SPRD_REG_32_BUSY_POSI);
1653 +@@ -284,6 +285,17 @@ static void sdhci_sprd_hw_reset(struct sdhci_host *host)
1654 + usleep_range(300, 500);
1655 + }
1656 +
1657 ++static unsigned int sdhci_sprd_get_max_timeout_count(struct sdhci_host *host)
1658 ++{
1659 ++ /* The Spredtrum controller actual maximum timeout count is 1 << 31 */
1660 ++ return 1 << 31;
1661 ++}
1662 ++
1663 ++static unsigned int sdhci_sprd_get_ro(struct sdhci_host *host)
1664 ++{
1665 ++ return 0;
1666 ++}
1667 ++
1668 + static struct sdhci_ops sdhci_sprd_ops = {
1669 + .read_l = sdhci_sprd_readl,
1670 + .write_l = sdhci_sprd_writel,
1671 +@@ -295,6 +307,8 @@ static struct sdhci_ops sdhci_sprd_ops = {
1672 + .reset = sdhci_reset,
1673 + .set_uhs_signaling = sdhci_sprd_set_uhs_signaling,
1674 + .hw_reset = sdhci_sprd_hw_reset,
1675 ++ .get_max_timeout_count = sdhci_sprd_get_max_timeout_count,
1676 ++ .get_ro = sdhci_sprd_get_ro,
1677 + };
1678 +
1679 + static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq)
1680 +@@ -318,9 +332,12 @@ static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq)
1681 + }
1682 +
1683 + static const struct sdhci_pltfm_data sdhci_sprd_pdata = {
1684 +- .quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK,
1685 ++ .quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
1686 ++ SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
1687 ++ SDHCI_QUIRK_MISSING_CAPS,
1688 + .quirks2 = SDHCI_QUIRK2_BROKEN_HS200 |
1689 +- SDHCI_QUIRK2_USE_32BIT_BLK_CNT,
1690 ++ SDHCI_QUIRK2_USE_32BIT_BLK_CNT |
1691 ++ SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
1692 + .ops = &sdhci_sprd_ops,
1693 + };
1694 +
1695 +@@ -386,6 +403,16 @@ static int sdhci_sprd_probe(struct platform_device *pdev)
1696 +
1697 + sdhci_enable_v4_mode(host);
1698 +
1699 ++ /*
1700 ++ * Supply the existing CAPS, but clear the UHS-I modes. This
1701 ++ * will allow these modes to be specified only by device
1702 ++ * tree properties through mmc_of_parse().
1703 ++ */
1704 ++ host->caps = sdhci_readl(host, SDHCI_CAPABILITIES);
1705 ++ host->caps1 = sdhci_readl(host, SDHCI_CAPABILITIES_1);
1706 ++ host->caps1 &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_SDR104 |
1707 ++ SDHCI_SUPPORT_DDR50);
1708 ++
1709 + ret = sdhci_setup_host(host);
1710 + if (ret)
1711 + goto pm_runtime_disable;
1712 +diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
1713 +index 781a3e106d9a..e6b0f21679c1 100644
1714 +--- a/drivers/mmc/host/sdhci-tegra.c
1715 ++++ b/drivers/mmc/host/sdhci-tegra.c
1716 +@@ -258,6 +258,16 @@ static void tegra210_sdhci_writew(struct sdhci_host *host, u16 val, int reg)
1717 + }
1718 + }
1719 +
1720 ++static unsigned int tegra_sdhci_get_ro(struct sdhci_host *host)
1721 ++{
1722 ++ /*
1723 ++ * Write-enable shall be assumed if GPIO is missing in a board's
1724 ++ * device-tree because SDHCI's WRITE_PROTECT bit doesn't work on
1725 ++ * Tegra.
1726 ++ */
1727 ++ return mmc_gpio_get_ro(host->mmc);
1728 ++}
1729 ++
1730 + static bool tegra_sdhci_is_pad_and_regulator_valid(struct sdhci_host *host)
1731 + {
1732 + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
1733 +@@ -1224,6 +1234,7 @@ static const struct cqhci_host_ops sdhci_tegra_cqhci_ops = {
1734 + };
1735 +
1736 + static const struct sdhci_ops tegra_sdhci_ops = {
1737 ++ .get_ro = tegra_sdhci_get_ro,
1738 + .read_w = tegra_sdhci_readw,
1739 + .write_l = tegra_sdhci_writel,
1740 + .set_clock = tegra_sdhci_set_clock,
1741 +@@ -1279,6 +1290,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra30 = {
1742 + };
1743 +
1744 + static const struct sdhci_ops tegra114_sdhci_ops = {
1745 ++ .get_ro = tegra_sdhci_get_ro,
1746 + .read_w = tegra_sdhci_readw,
1747 + .write_w = tegra_sdhci_writew,
1748 + .write_l = tegra_sdhci_writel,
1749 +@@ -1332,6 +1344,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra124 = {
1750 + };
1751 +
1752 + static const struct sdhci_ops tegra210_sdhci_ops = {
1753 ++ .get_ro = tegra_sdhci_get_ro,
1754 + .read_w = tegra_sdhci_readw,
1755 + .write_w = tegra210_sdhci_writew,
1756 + .write_l = tegra_sdhci_writel,
1757 +@@ -1366,6 +1379,7 @@ static const struct sdhci_tegra_soc_data soc_data_tegra210 = {
1758 + };
1759 +
1760 + static const struct sdhci_ops tegra186_sdhci_ops = {
1761 ++ .get_ro = tegra_sdhci_get_ro,
1762 + .read_w = tegra_sdhci_readw,
1763 + .write_l = tegra_sdhci_writel,
1764 + .set_clock = tegra_sdhci_set_clock,
1765 +diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
1766 +index 4e3026f9abed..962dbb3acd77 100644
1767 +--- a/drivers/net/ethernet/ti/cpsw.c
1768 ++++ b/drivers/net/ethernet/ti/cpsw.c
1769 +@@ -2372,6 +2372,7 @@ static int cpsw_probe(struct platform_device *pdev)
1770 + if (!cpsw)
1771 + return -ENOMEM;
1772 +
1773 ++ platform_set_drvdata(pdev, cpsw);
1774 + cpsw->dev = dev;
1775 +
1776 + mode = devm_gpiod_get_array_optional(dev, "mode", GPIOD_OUT_LOW);
1777 +@@ -2476,7 +2477,6 @@ static int cpsw_probe(struct platform_device *pdev)
1778 + goto clean_cpts;
1779 + }
1780 +
1781 +- platform_set_drvdata(pdev, ndev);
1782 + priv = netdev_priv(ndev);
1783 + priv->cpsw = cpsw;
1784 + priv->ndev = ndev;
1785 +diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
1786 +index a9c846c59289..55b713255b8e 100644
1787 +--- a/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
1788 ++++ b/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
1789 +@@ -80,8 +80,11 @@
1790 + #define IWL_22000_QU_B_HR_B_FW_PRE "iwlwifi-Qu-b0-hr-b0-"
1791 + #define IWL_22000_HR_B_FW_PRE "iwlwifi-QuQnj-b0-hr-b0-"
1792 + #define IWL_22000_HR_A0_FW_PRE "iwlwifi-QuQnj-a0-hr-a0-"
1793 ++#define IWL_QU_C_HR_B_FW_PRE "iwlwifi-Qu-c0-hr-b0-"
1794 + #define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0-"
1795 ++#define IWL_QU_C_JF_B_FW_PRE "iwlwifi-Qu-c0-jf-b0-"
1796 + #define IWL_QUZ_A_HR_B_FW_PRE "iwlwifi-QuZ-a0-hr-b0-"
1797 ++#define IWL_QUZ_A_JF_B_FW_PRE "iwlwifi-QuZ-a0-jf-b0-"
1798 + #define IWL_QNJ_B_JF_B_FW_PRE "iwlwifi-QuQnj-b0-jf-b0-"
1799 + #define IWL_CC_A_FW_PRE "iwlwifi-cc-a0-"
1800 + #define IWL_22000_SO_A_JF_B_FW_PRE "iwlwifi-so-a0-jf-b0-"
1801 +@@ -106,6 +109,10 @@
1802 + IWL_22000_HR_A0_FW_PRE __stringify(api) ".ucode"
1803 + #define IWL_QUZ_A_HR_B_MODULE_FIRMWARE(api) \
1804 + IWL_QUZ_A_HR_B_FW_PRE __stringify(api) ".ucode"
1805 ++#define IWL_QUZ_A_JF_B_MODULE_FIRMWARE(api) \
1806 ++ IWL_QUZ_A_JF_B_FW_PRE __stringify(api) ".ucode"
1807 ++#define IWL_QU_C_HR_B_MODULE_FIRMWARE(api) \
1808 ++ IWL_QU_C_HR_B_FW_PRE __stringify(api) ".ucode"
1809 + #define IWL_QU_B_JF_B_MODULE_FIRMWARE(api) \
1810 + IWL_QU_B_JF_B_FW_PRE __stringify(api) ".ucode"
1811 + #define IWL_QNJ_B_JF_B_MODULE_FIRMWARE(api) \
1812 +@@ -241,6 +248,42 @@ const struct iwl_cfg iwl_ax101_cfg_qu_hr = {
1813 + .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1814 + };
1815 +
1816 ++const struct iwl_cfg iwl_ax201_cfg_qu_hr = {
1817 ++ .name = "Intel(R) Wi-Fi 6 AX201 160MHz",
1818 ++ .fw_name_pre = IWL_22000_QU_B_HR_B_FW_PRE,
1819 ++ IWL_DEVICE_22500,
1820 ++ /*
1821 ++ * This device doesn't support receiving BlockAck with a large bitmap
1822 ++ * so we need to restrict the size of transmitted aggregation to the
1823 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
1824 ++ */
1825 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1826 ++};
1827 ++
1828 ++const struct iwl_cfg iwl_ax101_cfg_qu_c0_hr_b0 = {
1829 ++ .name = "Intel(R) Wi-Fi 6 AX101",
1830 ++ .fw_name_pre = IWL_QU_C_HR_B_FW_PRE,
1831 ++ IWL_DEVICE_22500,
1832 ++ /*
1833 ++ * This device doesn't support receiving BlockAck with a large bitmap
1834 ++ * so we need to restrict the size of transmitted aggregation to the
1835 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
1836 ++ */
1837 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1838 ++};
1839 ++
1840 ++const struct iwl_cfg iwl_ax201_cfg_qu_c0_hr_b0 = {
1841 ++ .name = "Intel(R) Wi-Fi 6 AX201 160MHz",
1842 ++ .fw_name_pre = IWL_QU_C_HR_B_FW_PRE,
1843 ++ IWL_DEVICE_22500,
1844 ++ /*
1845 ++ * This device doesn't support receiving BlockAck with a large bitmap
1846 ++ * so we need to restrict the size of transmitted aggregation to the
1847 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
1848 ++ */
1849 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1850 ++};
1851 ++
1852 + const struct iwl_cfg iwl_ax101_cfg_quz_hr = {
1853 + .name = "Intel(R) Wi-Fi 6 AX101",
1854 + .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE,
1855 +@@ -253,6 +296,42 @@ const struct iwl_cfg iwl_ax101_cfg_quz_hr = {
1856 + .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1857 + };
1858 +
1859 ++const struct iwl_cfg iwl_ax201_cfg_quz_hr = {
1860 ++ .name = "Intel(R) Wi-Fi 6 AX201 160MHz",
1861 ++ .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE,
1862 ++ IWL_DEVICE_22500,
1863 ++ /*
1864 ++ * This device doesn't support receiving BlockAck with a large bitmap
1865 ++ * so we need to restrict the size of transmitted aggregation to the
1866 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
1867 ++ */
1868 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1869 ++};
1870 ++
1871 ++const struct iwl_cfg iwl_ax1650s_cfg_quz_hr = {
1872 ++ .name = "Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201D2W)",
1873 ++ .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE,
1874 ++ IWL_DEVICE_22500,
1875 ++ /*
1876 ++ * This device doesn't support receiving BlockAck with a large bitmap
1877 ++ * so we need to restrict the size of transmitted aggregation to the
1878 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
1879 ++ */
1880 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1881 ++};
1882 ++
1883 ++const struct iwl_cfg iwl_ax1650i_cfg_quz_hr = {
1884 ++ .name = "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW)",
1885 ++ .fw_name_pre = IWL_QUZ_A_HR_B_FW_PRE,
1886 ++ IWL_DEVICE_22500,
1887 ++ /*
1888 ++ * This device doesn't support receiving BlockAck with a large bitmap
1889 ++ * so we need to restrict the size of transmitted aggregation to the
1890 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
1891 ++ */
1892 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1893 ++};
1894 ++
1895 + const struct iwl_cfg iwl_ax200_cfg_cc = {
1896 + .name = "Intel(R) Wi-Fi 6 AX200 160MHz",
1897 + .fw_name_pre = IWL_CC_A_FW_PRE,
1898 +@@ -321,6 +400,30 @@ const struct iwl_cfg iwl9560_2ac_160_cfg_qu_b0_jf_b0 = {
1899 + IWL_DEVICE_22500,
1900 + };
1901 +
1902 ++const struct iwl_cfg iwl9461_2ac_cfg_qu_c0_jf_b0 = {
1903 ++ .name = "Intel(R) Wireless-AC 9461",
1904 ++ .fw_name_pre = IWL_QU_C_JF_B_FW_PRE,
1905 ++ IWL_DEVICE_22500,
1906 ++};
1907 ++
1908 ++const struct iwl_cfg iwl9462_2ac_cfg_qu_c0_jf_b0 = {
1909 ++ .name = "Intel(R) Wireless-AC 9462",
1910 ++ .fw_name_pre = IWL_QU_C_JF_B_FW_PRE,
1911 ++ IWL_DEVICE_22500,
1912 ++};
1913 ++
1914 ++const struct iwl_cfg iwl9560_2ac_cfg_qu_c0_jf_b0 = {
1915 ++ .name = "Intel(R) Wireless-AC 9560",
1916 ++ .fw_name_pre = IWL_QU_C_JF_B_FW_PRE,
1917 ++ IWL_DEVICE_22500,
1918 ++};
1919 ++
1920 ++const struct iwl_cfg iwl9560_2ac_160_cfg_qu_c0_jf_b0 = {
1921 ++ .name = "Intel(R) Wireless-AC 9560 160MHz",
1922 ++ .fw_name_pre = IWL_QU_C_JF_B_FW_PRE,
1923 ++ IWL_DEVICE_22500,
1924 ++};
1925 ++
1926 + const struct iwl_cfg iwl9560_2ac_cfg_qnj_jf_b0 = {
1927 + .name = "Intel(R) Wireless-AC 9560 160MHz",
1928 + .fw_name_pre = IWL_QNJ_B_JF_B_FW_PRE,
1929 +@@ -333,6 +436,90 @@ const struct iwl_cfg iwl9560_2ac_cfg_qnj_jf_b0 = {
1930 + .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1931 + };
1932 +
1933 ++const struct iwl_cfg iwl9560_2ac_cfg_quz_a0_jf_b0_soc = {
1934 ++ .name = "Intel(R) Wireless-AC 9560 160MHz",
1935 ++ .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
1936 ++ IWL_DEVICE_22500,
1937 ++ /*
1938 ++ * This device doesn't support receiving BlockAck with a large bitmap
1939 ++ * so we need to restrict the size of transmitted aggregation to the
1940 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
1941 ++ */
1942 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1943 ++ .integrated = true,
1944 ++ .soc_latency = 5000,
1945 ++};
1946 ++
1947 ++const struct iwl_cfg iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc = {
1948 ++ .name = "Intel(R) Wireless-AC 9560 160MHz",
1949 ++ .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
1950 ++ IWL_DEVICE_22500,
1951 ++ /*
1952 ++ * This device doesn't support receiving BlockAck with a large bitmap
1953 ++ * so we need to restrict the size of transmitted aggregation to the
1954 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
1955 ++ */
1956 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1957 ++ .integrated = true,
1958 ++ .soc_latency = 5000,
1959 ++};
1960 ++
1961 ++const struct iwl_cfg iwl9461_2ac_cfg_quz_a0_jf_b0_soc = {
1962 ++ .name = "Intel(R) Dual Band Wireless AC 9461",
1963 ++ .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
1964 ++ IWL_DEVICE_22500,
1965 ++ /*
1966 ++ * This device doesn't support receiving BlockAck with a large bitmap
1967 ++ * so we need to restrict the size of transmitted aggregation to the
1968 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
1969 ++ */
1970 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1971 ++ .integrated = true,
1972 ++ .soc_latency = 5000,
1973 ++};
1974 ++
1975 ++const struct iwl_cfg iwl9462_2ac_cfg_quz_a0_jf_b0_soc = {
1976 ++ .name = "Intel(R) Dual Band Wireless AC 9462",
1977 ++ .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
1978 ++ IWL_DEVICE_22500,
1979 ++ /*
1980 ++ * This device doesn't support receiving BlockAck with a large bitmap
1981 ++ * so we need to restrict the size of transmitted aggregation to the
1982 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
1983 ++ */
1984 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1985 ++ .integrated = true,
1986 ++ .soc_latency = 5000,
1987 ++};
1988 ++
1989 ++const struct iwl_cfg iwl9560_killer_s_2ac_cfg_quz_a0_jf_b0_soc = {
1990 ++ .name = "Killer (R) Wireless-AC 1550s Wireless Network Adapter (9560NGW)",
1991 ++ .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
1992 ++ IWL_DEVICE_22500,
1993 ++ /*
1994 ++ * This device doesn't support receiving BlockAck with a large bitmap
1995 ++ * so we need to restrict the size of transmitted aggregation to the
1996 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
1997 ++ */
1998 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
1999 ++ .integrated = true,
2000 ++ .soc_latency = 5000,
2001 ++};
2002 ++
2003 ++const struct iwl_cfg iwl9560_killer_i_2ac_cfg_quz_a0_jf_b0_soc = {
2004 ++ .name = "Killer (R) Wireless-AC 1550i Wireless Network Adapter (9560NGW)",
2005 ++ .fw_name_pre = IWL_QUZ_A_JF_B_FW_PRE,
2006 ++ IWL_DEVICE_22500,
2007 ++ /*
2008 ++ * This device doesn't support receiving BlockAck with a large bitmap
2009 ++ * so we need to restrict the size of transmitted aggregation to the
2010 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
2011 ++ */
2012 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
2013 ++ .integrated = true,
2014 ++ .soc_latency = 5000,
2015 ++};
2016 ++
2017 + const struct iwl_cfg killer1550i_2ac_cfg_qu_b0_jf_b0 = {
2018 + .name = "Killer (R) Wireless-AC 1550i Wireless Network Adapter (9560NGW)",
2019 + .fw_name_pre = IWL_QU_B_JF_B_FW_PRE,
2020 +@@ -369,6 +556,30 @@ const struct iwl_cfg killer1650i_2ax_cfg_qu_b0_hr_b0 = {
2021 + .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
2022 + };
2023 +
2024 ++const struct iwl_cfg killer1650s_2ax_cfg_qu_c0_hr_b0 = {
2025 ++ .name = "Killer(R) Wi-Fi 6 AX1650i 160MHz Wireless Network Adapter (201NGW)",
2026 ++ .fw_name_pre = IWL_QU_C_HR_B_FW_PRE,
2027 ++ IWL_DEVICE_22500,
2028 ++ /*
2029 ++ * This device doesn't support receiving BlockAck with a large bitmap
2030 ++ * so we need to restrict the size of transmitted aggregation to the
2031 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
2032 ++ */
2033 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
2034 ++};
2035 ++
2036 ++const struct iwl_cfg killer1650i_2ax_cfg_qu_c0_hr_b0 = {
2037 ++ .name = "Killer(R) Wi-Fi 6 AX1650s 160MHz Wireless Network Adapter (201D2W)",
2038 ++ .fw_name_pre = IWL_QU_C_HR_B_FW_PRE,
2039 ++ IWL_DEVICE_22500,
2040 ++ /*
2041 ++ * This device doesn't support receiving BlockAck with a large bitmap
2042 ++ * so we need to restrict the size of transmitted aggregation to the
2043 ++ * HT size; mac80211 would otherwise pick the HE max (256) by default.
2044 ++ */
2045 ++ .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
2046 ++};
2047 ++
2048 + const struct iwl_cfg iwl22000_2ax_cfg_jf = {
2049 + .name = "Intel(R) Dual Band Wireless AX 22000",
2050 + .fw_name_pre = IWL_QU_B_JF_B_FW_PRE,
2051 +@@ -424,12 +635,12 @@ const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0 = {
2052 + };
2053 +
2054 + const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0 = {
2055 +- .name = "Intel(R) Wi-Fi 6 AX201 160MHz",
2056 ++ .name = "Intel(R) Wi-Fi 7 AX210 160MHz",
2057 + .fw_name_pre = IWL_22000_SO_A_HR_B_FW_PRE,
2058 + IWL_DEVICE_AX210,
2059 + };
2060 +
2061 +-const struct iwl_cfg iwlax210_2ax_cfg_so_gf_a0 = {
2062 ++const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0 = {
2063 + .name = "Intel(R) Wi-Fi 7 AX211 160MHz",
2064 + .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE,
2065 + .uhb_supported = true,
2066 +@@ -443,8 +654,8 @@ const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0 = {
2067 + IWL_DEVICE_AX210,
2068 + };
2069 +
2070 +-const struct iwl_cfg iwlax210_2ax_cfg_so_gf4_a0 = {
2071 +- .name = "Intel(R) Wi-Fi 7 AX210 160MHz",
2072 ++const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0 = {
2073 ++ .name = "Intel(R) Wi-Fi 7 AX411 160MHz",
2074 + .fw_name_pre = IWL_22000_SO_A_GF4_A_FW_PRE,
2075 + IWL_DEVICE_AX210,
2076 + };
2077 +@@ -455,8 +666,10 @@ MODULE_FIRMWARE(IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
2078 + MODULE_FIRMWARE(IWL_22000_HR_B_F0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
2079 + MODULE_FIRMWARE(IWL_22000_HR_B_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
2080 + MODULE_FIRMWARE(IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
2081 ++MODULE_FIRMWARE(IWL_QU_C_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
2082 + MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
2083 + MODULE_FIRMWARE(IWL_QUZ_A_HR_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
2084 ++MODULE_FIRMWARE(IWL_QUZ_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
2085 + MODULE_FIRMWARE(IWL_QNJ_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
2086 + MODULE_FIRMWARE(IWL_CC_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
2087 + MODULE_FIRMWARE(IWL_22000_SO_A_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
2088 +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
2089 +index f3e69edf8907..6c04f8223aff 100644
2090 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
2091 ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
2092 +@@ -540,14 +540,20 @@ extern const struct iwl_cfg iwl9260_killer_2ac_cfg;
2093 + extern const struct iwl_cfg iwl9270_2ac_cfg;
2094 + extern const struct iwl_cfg iwl9460_2ac_cfg;
2095 + extern const struct iwl_cfg iwl9560_2ac_cfg;
2096 ++extern const struct iwl_cfg iwl9560_2ac_cfg_quz_a0_jf_b0_soc;
2097 + extern const struct iwl_cfg iwl9560_2ac_160_cfg;
2098 ++extern const struct iwl_cfg iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc;
2099 + extern const struct iwl_cfg iwl9460_2ac_cfg_soc;
2100 + extern const struct iwl_cfg iwl9461_2ac_cfg_soc;
2101 ++extern const struct iwl_cfg iwl9461_2ac_cfg_quz_a0_jf_b0_soc;
2102 + extern const struct iwl_cfg iwl9462_2ac_cfg_soc;
2103 ++extern const struct iwl_cfg iwl9462_2ac_cfg_quz_a0_jf_b0_soc;
2104 + extern const struct iwl_cfg iwl9560_2ac_cfg_soc;
2105 + extern const struct iwl_cfg iwl9560_2ac_160_cfg_soc;
2106 + extern const struct iwl_cfg iwl9560_killer_2ac_cfg_soc;
2107 + extern const struct iwl_cfg iwl9560_killer_s_2ac_cfg_soc;
2108 ++extern const struct iwl_cfg iwl9560_killer_i_2ac_cfg_quz_a0_jf_b0_soc;
2109 ++extern const struct iwl_cfg iwl9560_killer_s_2ac_cfg_quz_a0_jf_b0_soc;
2110 + extern const struct iwl_cfg iwl9460_2ac_cfg_shared_clk;
2111 + extern const struct iwl_cfg iwl9461_2ac_cfg_shared_clk;
2112 + extern const struct iwl_cfg iwl9462_2ac_cfg_shared_clk;
2113 +@@ -559,17 +565,30 @@ extern const struct iwl_cfg iwl22000_2ac_cfg_hr;
2114 + extern const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb;
2115 + extern const struct iwl_cfg iwl22000_2ac_cfg_jf;
2116 + extern const struct iwl_cfg iwl_ax101_cfg_qu_hr;
2117 ++extern const struct iwl_cfg iwl_ax101_cfg_qu_c0_hr_b0;
2118 + extern const struct iwl_cfg iwl_ax101_cfg_quz_hr;
2119 + extern const struct iwl_cfg iwl22000_2ax_cfg_hr;
2120 + extern const struct iwl_cfg iwl_ax200_cfg_cc;
2121 ++extern const struct iwl_cfg iwl_ax201_cfg_qu_hr;
2122 ++extern const struct iwl_cfg iwl_ax201_cfg_qu_hr;
2123 ++extern const struct iwl_cfg iwl_ax201_cfg_qu_c0_hr_b0;
2124 ++extern const struct iwl_cfg iwl_ax201_cfg_quz_hr;
2125 ++extern const struct iwl_cfg iwl_ax1650i_cfg_quz_hr;
2126 ++extern const struct iwl_cfg iwl_ax1650s_cfg_quz_hr;
2127 + extern const struct iwl_cfg killer1650s_2ax_cfg_qu_b0_hr_b0;
2128 + extern const struct iwl_cfg killer1650i_2ax_cfg_qu_b0_hr_b0;
2129 ++extern const struct iwl_cfg killer1650s_2ax_cfg_qu_c0_hr_b0;
2130 ++extern const struct iwl_cfg killer1650i_2ax_cfg_qu_c0_hr_b0;
2131 + extern const struct iwl_cfg killer1650x_2ax_cfg;
2132 + extern const struct iwl_cfg killer1650w_2ax_cfg;
2133 + extern const struct iwl_cfg iwl9461_2ac_cfg_qu_b0_jf_b0;
2134 + extern const struct iwl_cfg iwl9462_2ac_cfg_qu_b0_jf_b0;
2135 + extern const struct iwl_cfg iwl9560_2ac_cfg_qu_b0_jf_b0;
2136 + extern const struct iwl_cfg iwl9560_2ac_160_cfg_qu_b0_jf_b0;
2137 ++extern const struct iwl_cfg iwl9461_2ac_cfg_qu_c0_jf_b0;
2138 ++extern const struct iwl_cfg iwl9462_2ac_cfg_qu_c0_jf_b0;
2139 ++extern const struct iwl_cfg iwl9560_2ac_cfg_qu_c0_jf_b0;
2140 ++extern const struct iwl_cfg iwl9560_2ac_160_cfg_qu_c0_jf_b0;
2141 + extern const struct iwl_cfg killer1550i_2ac_cfg_qu_b0_jf_b0;
2142 + extern const struct iwl_cfg killer1550s_2ac_cfg_qu_b0_jf_b0;
2143 + extern const struct iwl_cfg iwl22000_2ax_cfg_jf;
2144 +@@ -580,9 +599,9 @@ extern const struct iwl_cfg iwl9560_2ac_cfg_qnj_jf_b0;
2145 + extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0;
2146 + extern const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0;
2147 + extern const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0;
2148 +-extern const struct iwl_cfg iwlax210_2ax_cfg_so_gf_a0;
2149 ++extern const struct iwl_cfg iwlax211_2ax_cfg_so_gf_a0;
2150 + extern const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0;
2151 +-extern const struct iwl_cfg iwlax210_2ax_cfg_so_gf4_a0;
2152 ++extern const struct iwl_cfg iwlax411_2ax_cfg_so_gf4_a0;
2153 + #endif /* CPTCFG_IWLMVM || CPTCFG_IWLFMAC */
2154 +
2155 + #endif /* __IWL_CONFIG_H__ */
2156 +diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
2157 +index 93da96a7247c..cb4c5514a556 100644
2158 +--- a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
2159 ++++ b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
2160 +@@ -328,6 +328,8 @@ enum {
2161 + #define CSR_HW_REV_TYPE_NONE (0x00001F0)
2162 + #define CSR_HW_REV_TYPE_QNJ (0x0000360)
2163 + #define CSR_HW_REV_TYPE_QNJ_B0 (0x0000364)
2164 ++#define CSR_HW_REV_TYPE_QU_B0 (0x0000334)
2165 ++#define CSR_HW_REV_TYPE_QU_C0 (0x0000338)
2166 + #define CSR_HW_REV_TYPE_QUZ (0x0000354)
2167 + #define CSR_HW_REV_TYPE_HR_CDB (0x0000340)
2168 + #define CSR_HW_REV_TYPE_SO (0x0000370)
2169 +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
2170 +index cd035061cdd5..54cb4950f32f 100644
2171 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
2172 ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
2173 +@@ -513,62 +513,56 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2174 + {IWL_PCI_DEVICE(0x24FD, 0x9074, iwl8265_2ac_cfg)},
2175 +
2176 + /* 9000 Series */
2177 +- {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_160_cfg_soc)},
2178 +- {IWL_PCI_DEVICE(0x02F0, 0x0034, iwl9560_2ac_cfg_soc)},
2179 +- {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_160_cfg_soc)},
2180 +- {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_160_cfg_soc)},
2181 +- {IWL_PCI_DEVICE(0x02F0, 0x0040, iwl_ax101_cfg_qu_hr)},
2182 +- {IWL_PCI_DEVICE(0x02F0, 0x0044, iwl_ax101_cfg_qu_hr)},
2183 +- {IWL_PCI_DEVICE(0x02F0, 0x0060, iwl9461_2ac_cfg_soc)},
2184 +- {IWL_PCI_DEVICE(0x02F0, 0x0064, iwl9461_2ac_cfg_soc)},
2185 +- {IWL_PCI_DEVICE(0x02F0, 0x00A0, iwl9462_2ac_cfg_soc)},
2186 +- {IWL_PCI_DEVICE(0x02F0, 0x00A4, iwl9462_2ac_cfg_soc)},
2187 +- {IWL_PCI_DEVICE(0x02F0, 0x0230, iwl9560_2ac_cfg_soc)},
2188 +- {IWL_PCI_DEVICE(0x02F0, 0x0234, iwl9560_2ac_cfg_soc)},
2189 +- {IWL_PCI_DEVICE(0x02F0, 0x0238, iwl9560_2ac_cfg_soc)},
2190 +- {IWL_PCI_DEVICE(0x02F0, 0x023C, iwl9560_2ac_cfg_soc)},
2191 +- {IWL_PCI_DEVICE(0x02F0, 0x0244, iwl_ax101_cfg_qu_hr)},
2192 +- {IWL_PCI_DEVICE(0x02F0, 0x0260, iwl9461_2ac_cfg_soc)},
2193 +- {IWL_PCI_DEVICE(0x02F0, 0x0264, iwl9461_2ac_cfg_soc)},
2194 +- {IWL_PCI_DEVICE(0x02F0, 0x02A0, iwl9462_2ac_cfg_soc)},
2195 +- {IWL_PCI_DEVICE(0x02F0, 0x02A4, iwl9462_2ac_cfg_soc)},
2196 +- {IWL_PCI_DEVICE(0x02F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)},
2197 +- {IWL_PCI_DEVICE(0x02F0, 0x1552, iwl9560_killer_2ac_cfg_soc)},
2198 +- {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_160_cfg_soc)},
2199 +- {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_160_cfg_soc)},
2200 +- {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_160_cfg_soc)},
2201 +- {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_160_cfg_soc)},
2202 +- {IWL_PCI_DEVICE(0x02F0, 0x40A4, iwl9462_2ac_cfg_soc)},
2203 +- {IWL_PCI_DEVICE(0x02F0, 0x4234, iwl9560_2ac_cfg_soc)},
2204 +- {IWL_PCI_DEVICE(0x02F0, 0x42A4, iwl9462_2ac_cfg_soc)},
2205 +- {IWL_PCI_DEVICE(0x06F0, 0x0030, iwl9560_2ac_160_cfg_soc)},
2206 +- {IWL_PCI_DEVICE(0x06F0, 0x0034, iwl9560_2ac_cfg_soc)},
2207 +- {IWL_PCI_DEVICE(0x06F0, 0x0038, iwl9560_2ac_160_cfg_soc)},
2208 +- {IWL_PCI_DEVICE(0x06F0, 0x003C, iwl9560_2ac_160_cfg_soc)},
2209 +- {IWL_PCI_DEVICE(0x06F0, 0x0040, iwl_ax101_cfg_qu_hr)},
2210 +- {IWL_PCI_DEVICE(0x06F0, 0x0044, iwl_ax101_cfg_qu_hr)},
2211 +- {IWL_PCI_DEVICE(0x06F0, 0x0060, iwl9461_2ac_cfg_soc)},
2212 +- {IWL_PCI_DEVICE(0x06F0, 0x0064, iwl9461_2ac_cfg_soc)},
2213 +- {IWL_PCI_DEVICE(0x06F0, 0x00A0, iwl9462_2ac_cfg_soc)},
2214 +- {IWL_PCI_DEVICE(0x06F0, 0x00A4, iwl9462_2ac_cfg_soc)},
2215 +- {IWL_PCI_DEVICE(0x06F0, 0x0230, iwl9560_2ac_cfg_soc)},
2216 +- {IWL_PCI_DEVICE(0x06F0, 0x0234, iwl9560_2ac_cfg_soc)},
2217 +- {IWL_PCI_DEVICE(0x06F0, 0x0238, iwl9560_2ac_cfg_soc)},
2218 +- {IWL_PCI_DEVICE(0x06F0, 0x023C, iwl9560_2ac_cfg_soc)},
2219 +- {IWL_PCI_DEVICE(0x06F0, 0x0244, iwl_ax101_cfg_qu_hr)},
2220 +- {IWL_PCI_DEVICE(0x06F0, 0x0260, iwl9461_2ac_cfg_soc)},
2221 +- {IWL_PCI_DEVICE(0x06F0, 0x0264, iwl9461_2ac_cfg_soc)},
2222 +- {IWL_PCI_DEVICE(0x06F0, 0x02A0, iwl9462_2ac_cfg_soc)},
2223 +- {IWL_PCI_DEVICE(0x06F0, 0x02A4, iwl9462_2ac_cfg_soc)},
2224 +- {IWL_PCI_DEVICE(0x06F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)},
2225 +- {IWL_PCI_DEVICE(0x06F0, 0x1552, iwl9560_killer_2ac_cfg_soc)},
2226 +- {IWL_PCI_DEVICE(0x06F0, 0x2030, iwl9560_2ac_160_cfg_soc)},
2227 +- {IWL_PCI_DEVICE(0x06F0, 0x2034, iwl9560_2ac_160_cfg_soc)},
2228 +- {IWL_PCI_DEVICE(0x06F0, 0x4030, iwl9560_2ac_160_cfg_soc)},
2229 +- {IWL_PCI_DEVICE(0x06F0, 0x4034, iwl9560_2ac_160_cfg_soc)},
2230 +- {IWL_PCI_DEVICE(0x06F0, 0x40A4, iwl9462_2ac_cfg_soc)},
2231 +- {IWL_PCI_DEVICE(0x06F0, 0x4234, iwl9560_2ac_cfg_soc)},
2232 +- {IWL_PCI_DEVICE(0x06F0, 0x42A4, iwl9462_2ac_cfg_soc)},
2233 ++ {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2234 ++ {IWL_PCI_DEVICE(0x02F0, 0x0034, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2235 ++ {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2236 ++ {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2237 ++ {IWL_PCI_DEVICE(0x02F0, 0x0060, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
2238 ++ {IWL_PCI_DEVICE(0x02F0, 0x0064, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
2239 ++ {IWL_PCI_DEVICE(0x02F0, 0x00A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2240 ++ {IWL_PCI_DEVICE(0x02F0, 0x00A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2241 ++ {IWL_PCI_DEVICE(0x02F0, 0x0230, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2242 ++ {IWL_PCI_DEVICE(0x02F0, 0x0234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2243 ++ {IWL_PCI_DEVICE(0x02F0, 0x0238, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2244 ++ {IWL_PCI_DEVICE(0x02F0, 0x023C, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2245 ++ {IWL_PCI_DEVICE(0x02F0, 0x0260, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
2246 ++ {IWL_PCI_DEVICE(0x02F0, 0x0264, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
2247 ++ {IWL_PCI_DEVICE(0x02F0, 0x02A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2248 ++ {IWL_PCI_DEVICE(0x02F0, 0x02A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2249 ++ {IWL_PCI_DEVICE(0x02F0, 0x1551, iwl9560_killer_s_2ac_cfg_quz_a0_jf_b0_soc)},
2250 ++ {IWL_PCI_DEVICE(0x02F0, 0x1552, iwl9560_killer_i_2ac_cfg_quz_a0_jf_b0_soc)},
2251 ++ {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2252 ++ {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2253 ++ {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2254 ++ {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2255 ++ {IWL_PCI_DEVICE(0x02F0, 0x40A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2256 ++ {IWL_PCI_DEVICE(0x02F0, 0x4234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2257 ++ {IWL_PCI_DEVICE(0x02F0, 0x42A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2258 ++ {IWL_PCI_DEVICE(0x06F0, 0x0030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2259 ++ {IWL_PCI_DEVICE(0x06F0, 0x0034, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2260 ++ {IWL_PCI_DEVICE(0x06F0, 0x0038, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2261 ++ {IWL_PCI_DEVICE(0x06F0, 0x003C, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2262 ++ {IWL_PCI_DEVICE(0x06F0, 0x0060, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
2263 ++ {IWL_PCI_DEVICE(0x06F0, 0x0064, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
2264 ++ {IWL_PCI_DEVICE(0x06F0, 0x00A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2265 ++ {IWL_PCI_DEVICE(0x06F0, 0x00A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2266 ++ {IWL_PCI_DEVICE(0x06F0, 0x0230, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2267 ++ {IWL_PCI_DEVICE(0x06F0, 0x0234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2268 ++ {IWL_PCI_DEVICE(0x06F0, 0x0238, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2269 ++ {IWL_PCI_DEVICE(0x06F0, 0x023C, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2270 ++ {IWL_PCI_DEVICE(0x06F0, 0x0260, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
2271 ++ {IWL_PCI_DEVICE(0x06F0, 0x0264, iwl9461_2ac_cfg_quz_a0_jf_b0_soc)},
2272 ++ {IWL_PCI_DEVICE(0x06F0, 0x02A0, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2273 ++ {IWL_PCI_DEVICE(0x06F0, 0x02A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2274 ++ {IWL_PCI_DEVICE(0x06F0, 0x1551, iwl9560_killer_s_2ac_cfg_quz_a0_jf_b0_soc)},
2275 ++ {IWL_PCI_DEVICE(0x06F0, 0x1552, iwl9560_killer_i_2ac_cfg_quz_a0_jf_b0_soc)},
2276 ++ {IWL_PCI_DEVICE(0x06F0, 0x2030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2277 ++ {IWL_PCI_DEVICE(0x06F0, 0x2034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2278 ++ {IWL_PCI_DEVICE(0x06F0, 0x4030, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2279 ++ {IWL_PCI_DEVICE(0x06F0, 0x4034, iwl9560_2ac_160_cfg_quz_a0_jf_b0_soc)},
2280 ++ {IWL_PCI_DEVICE(0x06F0, 0x40A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2281 ++ {IWL_PCI_DEVICE(0x06F0, 0x4234, iwl9560_2ac_cfg_quz_a0_jf_b0_soc)},
2282 ++ {IWL_PCI_DEVICE(0x06F0, 0x42A4, iwl9462_2ac_cfg_quz_a0_jf_b0_soc)},
2283 + {IWL_PCI_DEVICE(0x2526, 0x0010, iwl9260_2ac_160_cfg)},
2284 + {IWL_PCI_DEVICE(0x2526, 0x0014, iwl9260_2ac_160_cfg)},
2285 + {IWL_PCI_DEVICE(0x2526, 0x0018, iwl9260_2ac_160_cfg)},
2286 +@@ -610,6 +604,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2287 + {IWL_PCI_DEVICE(0x2526, 0x40A4, iwl9460_2ac_cfg)},
2288 + {IWL_PCI_DEVICE(0x2526, 0x4234, iwl9560_2ac_cfg_soc)},
2289 + {IWL_PCI_DEVICE(0x2526, 0x42A4, iwl9462_2ac_cfg_soc)},
2290 ++ {IWL_PCI_DEVICE(0x2526, 0x6014, iwl9260_2ac_160_cfg)},
2291 + {IWL_PCI_DEVICE(0x2526, 0x8014, iwl9260_2ac_160_cfg)},
2292 + {IWL_PCI_DEVICE(0x2526, 0x8010, iwl9260_2ac_160_cfg)},
2293 + {IWL_PCI_DEVICE(0x2526, 0xA014, iwl9260_2ac_160_cfg)},
2294 +@@ -621,7 +616,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2295 + {IWL_PCI_DEVICE(0x2720, 0x0034, iwl9560_2ac_160_cfg)},
2296 + {IWL_PCI_DEVICE(0x2720, 0x0038, iwl9560_2ac_160_cfg)},
2297 + {IWL_PCI_DEVICE(0x2720, 0x003C, iwl9560_2ac_160_cfg)},
2298 +- {IWL_PCI_DEVICE(0x2720, 0x0044, iwl_ax101_cfg_qu_hr)},
2299 + {IWL_PCI_DEVICE(0x2720, 0x0060, iwl9461_2ac_cfg_soc)},
2300 + {IWL_PCI_DEVICE(0x2720, 0x0064, iwl9461_2ac_cfg_soc)},
2301 + {IWL_PCI_DEVICE(0x2720, 0x00A0, iwl9462_2ac_cfg_soc)},
2302 +@@ -630,7 +624,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2303 + {IWL_PCI_DEVICE(0x2720, 0x0234, iwl9560_2ac_cfg)},
2304 + {IWL_PCI_DEVICE(0x2720, 0x0238, iwl9560_2ac_cfg)},
2305 + {IWL_PCI_DEVICE(0x2720, 0x023C, iwl9560_2ac_cfg)},
2306 +- {IWL_PCI_DEVICE(0x2720, 0x0244, iwl_ax101_cfg_qu_hr)},
2307 + {IWL_PCI_DEVICE(0x2720, 0x0260, iwl9461_2ac_cfg_soc)},
2308 + {IWL_PCI_DEVICE(0x2720, 0x0264, iwl9461_2ac_cfg_soc)},
2309 + {IWL_PCI_DEVICE(0x2720, 0x02A0, iwl9462_2ac_cfg_soc)},
2310 +@@ -708,7 +701,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2311 + {IWL_PCI_DEVICE(0x34F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)},
2312 + {IWL_PCI_DEVICE(0x34F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)},
2313 + {IWL_PCI_DEVICE(0x34F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)},
2314 +- {IWL_PCI_DEVICE(0x34F0, 0x0044, iwl_ax101_cfg_qu_hr)},
2315 + {IWL_PCI_DEVICE(0x34F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)},
2316 + {IWL_PCI_DEVICE(0x34F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)},
2317 + {IWL_PCI_DEVICE(0x34F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)},
2318 +@@ -717,7 +709,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2319 + {IWL_PCI_DEVICE(0x34F0, 0x0234, iwl9560_2ac_cfg_qu_b0_jf_b0)},
2320 + {IWL_PCI_DEVICE(0x34F0, 0x0238, iwl9560_2ac_cfg_qu_b0_jf_b0)},
2321 + {IWL_PCI_DEVICE(0x34F0, 0x023C, iwl9560_2ac_cfg_qu_b0_jf_b0)},
2322 +- {IWL_PCI_DEVICE(0x34F0, 0x0244, iwl_ax101_cfg_qu_hr)},
2323 + {IWL_PCI_DEVICE(0x34F0, 0x0260, iwl9461_2ac_cfg_qu_b0_jf_b0)},
2324 + {IWL_PCI_DEVICE(0x34F0, 0x0264, iwl9461_2ac_cfg_qu_b0_jf_b0)},
2325 + {IWL_PCI_DEVICE(0x34F0, 0x02A0, iwl9462_2ac_cfg_qu_b0_jf_b0)},
2326 +@@ -764,7 +755,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2327 + {IWL_PCI_DEVICE(0x43F0, 0x0034, iwl9560_2ac_cfg_soc)},
2328 + {IWL_PCI_DEVICE(0x43F0, 0x0038, iwl9560_2ac_160_cfg_soc)},
2329 + {IWL_PCI_DEVICE(0x43F0, 0x003C, iwl9560_2ac_160_cfg_soc)},
2330 +- {IWL_PCI_DEVICE(0x43F0, 0x0044, iwl_ax101_cfg_qu_hr)},
2331 + {IWL_PCI_DEVICE(0x43F0, 0x0060, iwl9461_2ac_cfg_soc)},
2332 + {IWL_PCI_DEVICE(0x43F0, 0x0064, iwl9461_2ac_cfg_soc)},
2333 + {IWL_PCI_DEVICE(0x43F0, 0x00A0, iwl9462_2ac_cfg_soc)},
2334 +@@ -773,7 +763,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2335 + {IWL_PCI_DEVICE(0x43F0, 0x0234, iwl9560_2ac_cfg_soc)},
2336 + {IWL_PCI_DEVICE(0x43F0, 0x0238, iwl9560_2ac_cfg_soc)},
2337 + {IWL_PCI_DEVICE(0x43F0, 0x023C, iwl9560_2ac_cfg_soc)},
2338 +- {IWL_PCI_DEVICE(0x43F0, 0x0244, iwl_ax101_cfg_qu_hr)},
2339 + {IWL_PCI_DEVICE(0x43F0, 0x0260, iwl9461_2ac_cfg_soc)},
2340 + {IWL_PCI_DEVICE(0x43F0, 0x0264, iwl9461_2ac_cfg_soc)},
2341 + {IWL_PCI_DEVICE(0x43F0, 0x02A0, iwl9462_2ac_cfg_soc)},
2342 +@@ -833,7 +822,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2343 + {IWL_PCI_DEVICE(0xA0F0, 0x0034, iwl9560_2ac_cfg_soc)},
2344 + {IWL_PCI_DEVICE(0xA0F0, 0x0038, iwl9560_2ac_160_cfg_soc)},
2345 + {IWL_PCI_DEVICE(0xA0F0, 0x003C, iwl9560_2ac_160_cfg_soc)},
2346 +- {IWL_PCI_DEVICE(0xA0F0, 0x0044, iwl_ax101_cfg_qu_hr)},
2347 + {IWL_PCI_DEVICE(0xA0F0, 0x0060, iwl9461_2ac_cfg_soc)},
2348 + {IWL_PCI_DEVICE(0xA0F0, 0x0064, iwl9461_2ac_cfg_soc)},
2349 + {IWL_PCI_DEVICE(0xA0F0, 0x00A0, iwl9462_2ac_cfg_soc)},
2350 +@@ -842,7 +830,6 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2351 + {IWL_PCI_DEVICE(0xA0F0, 0x0234, iwl9560_2ac_cfg_soc)},
2352 + {IWL_PCI_DEVICE(0xA0F0, 0x0238, iwl9560_2ac_cfg_soc)},
2353 + {IWL_PCI_DEVICE(0xA0F0, 0x023C, iwl9560_2ac_cfg_soc)},
2354 +- {IWL_PCI_DEVICE(0xA0F0, 0x0244, iwl_ax101_cfg_qu_hr)},
2355 + {IWL_PCI_DEVICE(0xA0F0, 0x0260, iwl9461_2ac_cfg_soc)},
2356 + {IWL_PCI_DEVICE(0xA0F0, 0x0264, iwl9461_2ac_cfg_soc)},
2357 + {IWL_PCI_DEVICE(0xA0F0, 0x02A0, iwl9462_2ac_cfg_soc)},
2358 +@@ -890,63 +877,80 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2359 + {IWL_PCI_DEVICE(0x2720, 0x0030, iwl9560_2ac_cfg_qnj_jf_b0)},
2360 +
2361 + /* 22000 Series */
2362 +- {IWL_PCI_DEVICE(0x02F0, 0x0070, iwl_ax101_cfg_qu_hr)},
2363 +- {IWL_PCI_DEVICE(0x02F0, 0x0074, iwl_ax101_cfg_qu_hr)},
2364 +- {IWL_PCI_DEVICE(0x02F0, 0x0078, iwl_ax101_cfg_qu_hr)},
2365 +- {IWL_PCI_DEVICE(0x02F0, 0x007C, iwl_ax101_cfg_qu_hr)},
2366 +- {IWL_PCI_DEVICE(0x02F0, 0x0310, iwl_ax101_cfg_qu_hr)},
2367 +- {IWL_PCI_DEVICE(0x02F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)},
2368 +- {IWL_PCI_DEVICE(0x02F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)},
2369 +- {IWL_PCI_DEVICE(0x02F0, 0x4070, iwl_ax101_cfg_qu_hr)},
2370 +- {IWL_PCI_DEVICE(0x06F0, 0x0070, iwl_ax101_cfg_qu_hr)},
2371 +- {IWL_PCI_DEVICE(0x06F0, 0x0074, iwl_ax101_cfg_qu_hr)},
2372 +- {IWL_PCI_DEVICE(0x06F0, 0x0078, iwl_ax101_cfg_qu_hr)},
2373 +- {IWL_PCI_DEVICE(0x06F0, 0x007C, iwl_ax101_cfg_qu_hr)},
2374 +- {IWL_PCI_DEVICE(0x06F0, 0x0310, iwl_ax101_cfg_qu_hr)},
2375 +- {IWL_PCI_DEVICE(0x06F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)},
2376 +- {IWL_PCI_DEVICE(0x06F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)},
2377 +- {IWL_PCI_DEVICE(0x06F0, 0x4070, iwl_ax101_cfg_qu_hr)},
2378 ++ {IWL_PCI_DEVICE(0x02F0, 0x0070, iwl_ax201_cfg_quz_hr)},
2379 ++ {IWL_PCI_DEVICE(0x02F0, 0x0074, iwl_ax201_cfg_quz_hr)},
2380 ++ {IWL_PCI_DEVICE(0x02F0, 0x0078, iwl_ax201_cfg_quz_hr)},
2381 ++ {IWL_PCI_DEVICE(0x02F0, 0x007C, iwl_ax201_cfg_quz_hr)},
2382 ++ {IWL_PCI_DEVICE(0x02F0, 0x0244, iwl_ax101_cfg_quz_hr)},
2383 ++ {IWL_PCI_DEVICE(0x02F0, 0x0310, iwl_ax201_cfg_quz_hr)},
2384 ++ {IWL_PCI_DEVICE(0x02F0, 0x1651, iwl_ax1650s_cfg_quz_hr)},
2385 ++ {IWL_PCI_DEVICE(0x02F0, 0x1652, iwl_ax1650i_cfg_quz_hr)},
2386 ++ {IWL_PCI_DEVICE(0x02F0, 0x2074, iwl_ax201_cfg_quz_hr)},
2387 ++ {IWL_PCI_DEVICE(0x02F0, 0x4070, iwl_ax201_cfg_quz_hr)},
2388 ++ {IWL_PCI_DEVICE(0x02F0, 0x4244, iwl_ax101_cfg_quz_hr)},
2389 ++ {IWL_PCI_DEVICE(0x06F0, 0x0070, iwl_ax201_cfg_quz_hr)},
2390 ++ {IWL_PCI_DEVICE(0x06F0, 0x0074, iwl_ax201_cfg_quz_hr)},
2391 ++ {IWL_PCI_DEVICE(0x06F0, 0x0078, iwl_ax201_cfg_quz_hr)},
2392 ++ {IWL_PCI_DEVICE(0x06F0, 0x007C, iwl_ax201_cfg_quz_hr)},
2393 ++ {IWL_PCI_DEVICE(0x06F0, 0x0244, iwl_ax101_cfg_quz_hr)},
2394 ++ {IWL_PCI_DEVICE(0x06F0, 0x0310, iwl_ax201_cfg_quz_hr)},
2395 ++ {IWL_PCI_DEVICE(0x06F0, 0x1651, iwl_ax1650s_cfg_quz_hr)},
2396 ++ {IWL_PCI_DEVICE(0x06F0, 0x1652, iwl_ax1650i_cfg_quz_hr)},
2397 ++ {IWL_PCI_DEVICE(0x06F0, 0x2074, iwl_ax201_cfg_quz_hr)},
2398 ++ {IWL_PCI_DEVICE(0x06F0, 0x4070, iwl_ax201_cfg_quz_hr)},
2399 ++ {IWL_PCI_DEVICE(0x06F0, 0x4244, iwl_ax101_cfg_quz_hr)},
2400 + {IWL_PCI_DEVICE(0x2720, 0x0000, iwl_ax101_cfg_qu_hr)},
2401 + {IWL_PCI_DEVICE(0x2720, 0x0040, iwl_ax101_cfg_qu_hr)},
2402 +- {IWL_PCI_DEVICE(0x2720, 0x0070, iwl22000_2ac_cfg_hr_cdb)},
2403 +- {IWL_PCI_DEVICE(0x2720, 0x0074, iwl_ax101_cfg_qu_hr)},
2404 +- {IWL_PCI_DEVICE(0x2720, 0x0078, iwl_ax101_cfg_qu_hr)},
2405 +- {IWL_PCI_DEVICE(0x2720, 0x007C, iwl_ax101_cfg_qu_hr)},
2406 ++ {IWL_PCI_DEVICE(0x2720, 0x0044, iwl_ax101_cfg_qu_hr)},
2407 ++ {IWL_PCI_DEVICE(0x2720, 0x0070, iwl_ax201_cfg_qu_hr)},
2408 ++ {IWL_PCI_DEVICE(0x2720, 0x0074, iwl_ax201_cfg_qu_hr)},
2409 ++ {IWL_PCI_DEVICE(0x2720, 0x0078, iwl_ax201_cfg_qu_hr)},
2410 ++ {IWL_PCI_DEVICE(0x2720, 0x007C, iwl_ax201_cfg_qu_hr)},
2411 + {IWL_PCI_DEVICE(0x2720, 0x0090, iwl22000_2ac_cfg_hr_cdb)},
2412 +- {IWL_PCI_DEVICE(0x2720, 0x0310, iwl22000_2ac_cfg_hr_cdb)},
2413 +- {IWL_PCI_DEVICE(0x2720, 0x0A10, iwl22000_2ac_cfg_hr_cdb)},
2414 ++ {IWL_PCI_DEVICE(0x2720, 0x0244, iwl_ax101_cfg_qu_hr)},
2415 ++ {IWL_PCI_DEVICE(0x2720, 0x0310, iwl_ax201_cfg_qu_hr)},
2416 ++ {IWL_PCI_DEVICE(0x2720, 0x0A10, iwl_ax201_cfg_qu_hr)},
2417 + {IWL_PCI_DEVICE(0x2720, 0x1080, iwl_ax101_cfg_qu_hr)},
2418 + {IWL_PCI_DEVICE(0x2720, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)},
2419 + {IWL_PCI_DEVICE(0x2720, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)},
2420 +- {IWL_PCI_DEVICE(0x2720, 0x4070, iwl_ax101_cfg_qu_hr)},
2421 +- {IWL_PCI_DEVICE(0x34F0, 0x0040, iwl_ax101_cfg_qu_hr)},
2422 +- {IWL_PCI_DEVICE(0x34F0, 0x0070, iwl_ax101_cfg_qu_hr)},
2423 +- {IWL_PCI_DEVICE(0x34F0, 0x0074, iwl_ax101_cfg_qu_hr)},
2424 +- {IWL_PCI_DEVICE(0x34F0, 0x0078, iwl_ax101_cfg_qu_hr)},
2425 +- {IWL_PCI_DEVICE(0x34F0, 0x007C, iwl_ax101_cfg_qu_hr)},
2426 +- {IWL_PCI_DEVICE(0x34F0, 0x0310, iwl_ax101_cfg_qu_hr)},
2427 ++ {IWL_PCI_DEVICE(0x2720, 0x2074, iwl_ax201_cfg_qu_hr)},
2428 ++ {IWL_PCI_DEVICE(0x2720, 0x4070, iwl_ax201_cfg_qu_hr)},
2429 ++ {IWL_PCI_DEVICE(0x2720, 0x4244, iwl_ax101_cfg_qu_hr)},
2430 ++ {IWL_PCI_DEVICE(0x34F0, 0x0044, iwl_ax101_cfg_qu_hr)},
2431 ++ {IWL_PCI_DEVICE(0x34F0, 0x0070, iwl_ax201_cfg_qu_hr)},
2432 ++ {IWL_PCI_DEVICE(0x34F0, 0x0074, iwl_ax201_cfg_qu_hr)},
2433 ++ {IWL_PCI_DEVICE(0x34F0, 0x0078, iwl_ax201_cfg_qu_hr)},
2434 ++ {IWL_PCI_DEVICE(0x34F0, 0x007C, iwl_ax201_cfg_qu_hr)},
2435 ++ {IWL_PCI_DEVICE(0x34F0, 0x0244, iwl_ax101_cfg_qu_hr)},
2436 ++ {IWL_PCI_DEVICE(0x34F0, 0x0310, iwl_ax201_cfg_qu_hr)},
2437 + {IWL_PCI_DEVICE(0x34F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)},
2438 + {IWL_PCI_DEVICE(0x34F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)},
2439 +- {IWL_PCI_DEVICE(0x34F0, 0x4070, iwl_ax101_cfg_qu_hr)},
2440 +- {IWL_PCI_DEVICE(0x43F0, 0x0040, iwl_ax101_cfg_qu_hr)},
2441 +- {IWL_PCI_DEVICE(0x43F0, 0x0070, iwl_ax101_cfg_qu_hr)},
2442 +- {IWL_PCI_DEVICE(0x43F0, 0x0074, iwl_ax101_cfg_qu_hr)},
2443 +- {IWL_PCI_DEVICE(0x43F0, 0x0078, iwl_ax101_cfg_qu_hr)},
2444 +- {IWL_PCI_DEVICE(0x43F0, 0x007C, iwl_ax101_cfg_qu_hr)},
2445 ++ {IWL_PCI_DEVICE(0x34F0, 0x2074, iwl_ax201_cfg_qu_hr)},
2446 ++ {IWL_PCI_DEVICE(0x34F0, 0x4070, iwl_ax201_cfg_qu_hr)},
2447 ++ {IWL_PCI_DEVICE(0x34F0, 0x4244, iwl_ax101_cfg_qu_hr)},
2448 ++ {IWL_PCI_DEVICE(0x43F0, 0x0044, iwl_ax101_cfg_qu_hr)},
2449 ++ {IWL_PCI_DEVICE(0x43F0, 0x0070, iwl_ax201_cfg_qu_hr)},
2450 ++ {IWL_PCI_DEVICE(0x43F0, 0x0074, iwl_ax201_cfg_qu_hr)},
2451 ++ {IWL_PCI_DEVICE(0x43F0, 0x0078, iwl_ax201_cfg_qu_hr)},
2452 ++ {IWL_PCI_DEVICE(0x43F0, 0x007C, iwl_ax201_cfg_qu_hr)},
2453 ++ {IWL_PCI_DEVICE(0x43F0, 0x0244, iwl_ax101_cfg_qu_hr)},
2454 + {IWL_PCI_DEVICE(0x43F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)},
2455 + {IWL_PCI_DEVICE(0x43F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)},
2456 +- {IWL_PCI_DEVICE(0x43F0, 0x4070, iwl_ax101_cfg_qu_hr)},
2457 +- {IWL_PCI_DEVICE(0xA0F0, 0x0000, iwl_ax101_cfg_qu_hr)},
2458 +- {IWL_PCI_DEVICE(0xA0F0, 0x0040, iwl_ax101_cfg_qu_hr)},
2459 +- {IWL_PCI_DEVICE(0xA0F0, 0x0070, iwl_ax101_cfg_qu_hr)},
2460 +- {IWL_PCI_DEVICE(0xA0F0, 0x0074, iwl_ax101_cfg_qu_hr)},
2461 +- {IWL_PCI_DEVICE(0xA0F0, 0x0078, iwl_ax101_cfg_qu_hr)},
2462 +- {IWL_PCI_DEVICE(0xA0F0, 0x007C, iwl_ax101_cfg_qu_hr)},
2463 +- {IWL_PCI_DEVICE(0xA0F0, 0x00B0, iwl_ax101_cfg_qu_hr)},
2464 +- {IWL_PCI_DEVICE(0xA0F0, 0x0A10, iwl_ax101_cfg_qu_hr)},
2465 ++ {IWL_PCI_DEVICE(0x43F0, 0x2074, iwl_ax201_cfg_qu_hr)},
2466 ++ {IWL_PCI_DEVICE(0x43F0, 0x4070, iwl_ax201_cfg_qu_hr)},
2467 ++ {IWL_PCI_DEVICE(0x43F0, 0x4244, iwl_ax101_cfg_qu_hr)},
2468 ++ {IWL_PCI_DEVICE(0xA0F0, 0x0044, iwl_ax101_cfg_qu_hr)},
2469 ++ {IWL_PCI_DEVICE(0xA0F0, 0x0070, iwl_ax201_cfg_qu_hr)},
2470 ++ {IWL_PCI_DEVICE(0xA0F0, 0x0074, iwl_ax201_cfg_qu_hr)},
2471 ++ {IWL_PCI_DEVICE(0xA0F0, 0x0078, iwl_ax201_cfg_qu_hr)},
2472 ++ {IWL_PCI_DEVICE(0xA0F0, 0x007C, iwl_ax201_cfg_qu_hr)},
2473 ++ {IWL_PCI_DEVICE(0xA0F0, 0x0244, iwl_ax101_cfg_qu_hr)},
2474 ++ {IWL_PCI_DEVICE(0xA0F0, 0x0A10, iwl_ax201_cfg_qu_hr)},
2475 + {IWL_PCI_DEVICE(0xA0F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)},
2476 + {IWL_PCI_DEVICE(0xA0F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)},
2477 +- {IWL_PCI_DEVICE(0xA0F0, 0x4070, iwl_ax101_cfg_qu_hr)},
2478 ++ {IWL_PCI_DEVICE(0xA0F0, 0x2074, iwl_ax201_cfg_qu_hr)},
2479 ++ {IWL_PCI_DEVICE(0xA0F0, 0x4070, iwl_ax201_cfg_qu_hr)},
2480 ++ {IWL_PCI_DEVICE(0xA0F0, 0x4244, iwl_ax101_cfg_qu_hr)},
2481 +
2482 + {IWL_PCI_DEVICE(0x2723, 0x0080, iwl_ax200_cfg_cc)},
2483 + {IWL_PCI_DEVICE(0x2723, 0x0084, iwl_ax200_cfg_cc)},
2484 +@@ -958,13 +962,20 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
2485 + {IWL_PCI_DEVICE(0x2723, 0x4080, iwl_ax200_cfg_cc)},
2486 + {IWL_PCI_DEVICE(0x2723, 0x4088, iwl_ax200_cfg_cc)},
2487 +
2488 +- {IWL_PCI_DEVICE(0x2725, 0x0090, iwlax210_2ax_cfg_so_hr_a0)},
2489 +- {IWL_PCI_DEVICE(0x7A70, 0x0090, iwlax210_2ax_cfg_so_hr_a0)},
2490 +- {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax210_2ax_cfg_so_hr_a0)},
2491 +- {IWL_PCI_DEVICE(0x2725, 0x0020, iwlax210_2ax_cfg_so_hr_a0)},
2492 +- {IWL_PCI_DEVICE(0x2725, 0x0310, iwlax210_2ax_cfg_so_hr_a0)},
2493 +- {IWL_PCI_DEVICE(0x2725, 0x0A10, iwlax210_2ax_cfg_so_hr_a0)},
2494 +- {IWL_PCI_DEVICE(0x2725, 0x00B0, iwlax210_2ax_cfg_so_hr_a0)},
2495 ++ {IWL_PCI_DEVICE(0x2725, 0x0090, iwlax211_2ax_cfg_so_gf_a0)},
2496 ++ {IWL_PCI_DEVICE(0x2725, 0x0020, iwlax210_2ax_cfg_ty_gf_a0)},
2497 ++ {IWL_PCI_DEVICE(0x2725, 0x0310, iwlax210_2ax_cfg_ty_gf_a0)},
2498 ++ {IWL_PCI_DEVICE(0x2725, 0x0510, iwlax210_2ax_cfg_ty_gf_a0)},
2499 ++ {IWL_PCI_DEVICE(0x2725, 0x0A10, iwlax210_2ax_cfg_ty_gf_a0)},
2500 ++ {IWL_PCI_DEVICE(0x2725, 0x00B0, iwlax411_2ax_cfg_so_gf4_a0)},
2501 ++ {IWL_PCI_DEVICE(0x7A70, 0x0090, iwlax211_2ax_cfg_so_gf_a0)},
2502 ++ {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax211_2ax_cfg_so_gf_a0)},
2503 ++ {IWL_PCI_DEVICE(0x7A70, 0x0510, iwlax211_2ax_cfg_so_gf_a0)},
2504 ++ {IWL_PCI_DEVICE(0x7A70, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)},
2505 ++ {IWL_PCI_DEVICE(0x7AF0, 0x0090, iwlax211_2ax_cfg_so_gf_a0)},
2506 ++ {IWL_PCI_DEVICE(0x7AF0, 0x0310, iwlax211_2ax_cfg_so_gf_a0)},
2507 ++ {IWL_PCI_DEVICE(0x7AF0, 0x0510, iwlax211_2ax_cfg_so_gf_a0)},
2508 ++ {IWL_PCI_DEVICE(0x7AF0, 0x0A10, iwlax211_2ax_cfg_so_gf_a0)},
2509 +
2510 + #endif /* CONFIG_IWLMVM */
2511 +
2512 +@@ -1028,6 +1039,31 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2513 + }
2514 + iwl_trans->cfg = cfg;
2515 + }
2516 ++
2517 ++ /*
2518 ++ * This is a hack to switch from Qu B0 to Qu C0. We need to
2519 ++ * do this for all cfgs that use Qu B0. All this code is in
2520 ++ * urgent need for a refactor, but for now this is the easiest
2521 ++ * thing to do to support Qu C-step.
2522 ++ */
2523 ++ if (iwl_trans->hw_rev == CSR_HW_REV_TYPE_QU_C0) {
2524 ++ if (iwl_trans->cfg == &iwl_ax101_cfg_qu_hr)
2525 ++ iwl_trans->cfg = &iwl_ax101_cfg_qu_c0_hr_b0;
2526 ++ else if (iwl_trans->cfg == &iwl_ax201_cfg_qu_hr)
2527 ++ iwl_trans->cfg = &iwl_ax201_cfg_qu_c0_hr_b0;
2528 ++ else if (iwl_trans->cfg == &iwl9461_2ac_cfg_qu_b0_jf_b0)
2529 ++ iwl_trans->cfg = &iwl9461_2ac_cfg_qu_c0_jf_b0;
2530 ++ else if (iwl_trans->cfg == &iwl9462_2ac_cfg_qu_b0_jf_b0)
2531 ++ iwl_trans->cfg = &iwl9462_2ac_cfg_qu_c0_jf_b0;
2532 ++ else if (iwl_trans->cfg == &iwl9560_2ac_cfg_qu_b0_jf_b0)
2533 ++ iwl_trans->cfg = &iwl9560_2ac_cfg_qu_c0_jf_b0;
2534 ++ else if (iwl_trans->cfg == &iwl9560_2ac_160_cfg_qu_b0_jf_b0)
2535 ++ iwl_trans->cfg = &iwl9560_2ac_160_cfg_qu_c0_jf_b0;
2536 ++ else if (iwl_trans->cfg == &killer1650s_2ax_cfg_qu_b0_hr_b0)
2537 ++ iwl_trans->cfg = &killer1650s_2ax_cfg_qu_c0_hr_b0;
2538 ++ else if (iwl_trans->cfg == &killer1650i_2ax_cfg_qu_b0_hr_b0)
2539 ++ iwl_trans->cfg = &killer1650i_2ax_cfg_qu_c0_hr_b0;
2540 ++ }
2541 + #endif
2542 +
2543 + pci_set_drvdata(pdev, iwl_trans);
2544 +diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
2545 +index 199eddea82a9..dc95a5abc4d6 100644
2546 +--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
2547 ++++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
2548 +@@ -3569,10 +3569,10 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
2549 + trans->cfg = &iwlax210_2ax_cfg_so_jf_a0;
2550 + } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
2551 + CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_GF)) {
2552 +- trans->cfg = &iwlax210_2ax_cfg_so_gf_a0;
2553 ++ trans->cfg = &iwlax211_2ax_cfg_so_gf_a0;
2554 + } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
2555 + CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_GF4)) {
2556 +- trans->cfg = &iwlax210_2ax_cfg_so_gf4_a0;
2557 ++ trans->cfg = &iwlax411_2ax_cfg_so_gf4_a0;
2558 + }
2559 + } else if (cfg == &iwl_ax101_cfg_qu_hr) {
2560 + if ((CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
2561 +@@ -3600,10 +3600,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
2562 + }
2563 + } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
2564 + CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) &&
2565 +- ((trans->cfg != &iwl_ax200_cfg_cc &&
2566 +- trans->cfg != &killer1650x_2ax_cfg &&
2567 +- trans->cfg != &killer1650w_2ax_cfg) ||
2568 +- trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0)) {
2569 ++ trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0) {
2570 + u32 hw_status;
2571 +
2572 + hw_status = iwl_read_prph(trans, UMAG_GEN_HW_STATUS);
2573 +diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
2574 +index 8ecbf81a906f..889b76deb703 100644
2575 +--- a/drivers/net/wireless/mediatek/mt76/mt76.h
2576 ++++ b/drivers/net/wireless/mediatek/mt76/mt76.h
2577 +@@ -30,6 +30,7 @@
2578 + #define MT_TX_RING_SIZE 256
2579 + #define MT_MCU_RING_SIZE 32
2580 + #define MT_RX_BUF_SIZE 2048
2581 ++#define MT_SKB_HEAD_LEN 128
2582 +
2583 + struct mt76_dev;
2584 + struct mt76_wcid;
2585 +diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
2586 +index 2dc67e68c6a2..109309b5d24a 100644
2587 +--- a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
2588 ++++ b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
2589 +@@ -136,11 +136,11 @@ static const struct ieee80211_ops mt76x0u_ops = {
2590 + .release_buffered_frames = mt76_release_buffered_frames,
2591 + };
2592 +
2593 +-static int mt76x0u_init_hardware(struct mt76x02_dev *dev)
2594 ++static int mt76x0u_init_hardware(struct mt76x02_dev *dev, bool reset)
2595 + {
2596 + int err;
2597 +
2598 +- mt76x0_chip_onoff(dev, true, true);
2599 ++ mt76x0_chip_onoff(dev, true, reset);
2600 +
2601 + if (!mt76x02_wait_for_mac(&dev->mt76))
2602 + return -ETIMEDOUT;
2603 +@@ -173,7 +173,7 @@ static int mt76x0u_register_device(struct mt76x02_dev *dev)
2604 + if (err < 0)
2605 + goto out_err;
2606 +
2607 +- err = mt76x0u_init_hardware(dev);
2608 ++ err = mt76x0u_init_hardware(dev, true);
2609 + if (err < 0)
2610 + goto out_err;
2611 +
2612 +@@ -309,7 +309,7 @@ static int __maybe_unused mt76x0_resume(struct usb_interface *usb_intf)
2613 + if (ret < 0)
2614 + goto err;
2615 +
2616 +- ret = mt76x0u_init_hardware(dev);
2617 ++ ret = mt76x0u_init_hardware(dev, false);
2618 + if (ret)
2619 + goto err;
2620 +
2621 +diff --git a/drivers/net/wireless/mediatek/mt76/usb.c b/drivers/net/wireless/mediatek/mt76/usb.c
2622 +index bbaa1365bbda..dd90427b2d67 100644
2623 +--- a/drivers/net/wireless/mediatek/mt76/usb.c
2624 ++++ b/drivers/net/wireless/mediatek/mt76/usb.c
2625 +@@ -429,6 +429,42 @@ static int mt76u_get_rx_entry_len(u8 *data, u32 data_len)
2626 + return dma_len;
2627 + }
2628 +
2629 ++static struct sk_buff *
2630 ++mt76u_build_rx_skb(void *data, int len, int buf_size)
2631 ++{
2632 ++ struct sk_buff *skb;
2633 ++
2634 ++ if (SKB_WITH_OVERHEAD(buf_size) < MT_DMA_HDR_LEN + len) {
2635 ++ struct page *page;
2636 ++
2637 ++ /* slow path, not enough space for data and
2638 ++ * skb_shared_info
2639 ++ */
2640 ++ skb = alloc_skb(MT_SKB_HEAD_LEN, GFP_ATOMIC);
2641 ++ if (!skb)
2642 ++ return NULL;
2643 ++
2644 ++ skb_put_data(skb, data + MT_DMA_HDR_LEN, MT_SKB_HEAD_LEN);
2645 ++ data += (MT_DMA_HDR_LEN + MT_SKB_HEAD_LEN);
2646 ++ page = virt_to_head_page(data);
2647 ++ skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
2648 ++ page, data - page_address(page),
2649 ++ len - MT_SKB_HEAD_LEN, buf_size);
2650 ++
2651 ++ return skb;
2652 ++ }
2653 ++
2654 ++ /* fast path */
2655 ++ skb = build_skb(data, buf_size);
2656 ++ if (!skb)
2657 ++ return NULL;
2658 ++
2659 ++ skb_reserve(skb, MT_DMA_HDR_LEN);
2660 ++ __skb_put(skb, len);
2661 ++
2662 ++ return skb;
2663 ++}
2664 ++
2665 + static int
2666 + mt76u_process_rx_entry(struct mt76_dev *dev, struct urb *urb)
2667 + {
2668 +@@ -446,19 +482,11 @@ mt76u_process_rx_entry(struct mt76_dev *dev, struct urb *urb)
2669 + return 0;
2670 +
2671 + data_len = min_t(int, len, data_len - MT_DMA_HDR_LEN);
2672 +- if (MT_DMA_HDR_LEN + data_len > SKB_WITH_OVERHEAD(q->buf_size)) {
2673 +- dev_err_ratelimited(dev->dev, "rx data too big %d\n", data_len);
2674 +- return 0;
2675 +- }
2676 +-
2677 +- skb = build_skb(data, q->buf_size);
2678 ++ skb = mt76u_build_rx_skb(data, data_len, q->buf_size);
2679 + if (!skb)
2680 + return 0;
2681 +
2682 +- skb_reserve(skb, MT_DMA_HDR_LEN);
2683 +- __skb_put(skb, data_len);
2684 + len -= data_len;
2685 +-
2686 + while (len > 0 && nsgs < urb->num_sgs) {
2687 + data_len = min_t(int, len, urb->sg[nsgs].length);
2688 + skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
2689 +diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
2690 +index 5deb4deb3820..601509b3251a 100644
2691 +--- a/drivers/nvme/host/core.c
2692 ++++ b/drivers/nvme/host/core.c
2693 +@@ -1268,6 +1268,9 @@ static u32 nvme_passthru_start(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
2694 + */
2695 + if (effects & (NVME_CMD_EFFECTS_LBCC | NVME_CMD_EFFECTS_CSE_MASK)) {
2696 + mutex_lock(&ctrl->scan_lock);
2697 ++ mutex_lock(&ctrl->subsys->lock);
2698 ++ nvme_mpath_start_freeze(ctrl->subsys);
2699 ++ nvme_mpath_wait_freeze(ctrl->subsys);
2700 + nvme_start_freeze(ctrl);
2701 + nvme_wait_freeze(ctrl);
2702 + }
2703 +@@ -1298,6 +1301,8 @@ static void nvme_passthru_end(struct nvme_ctrl *ctrl, u32 effects)
2704 + nvme_update_formats(ctrl);
2705 + if (effects & (NVME_CMD_EFFECTS_LBCC | NVME_CMD_EFFECTS_CSE_MASK)) {
2706 + nvme_unfreeze(ctrl);
2707 ++ nvme_mpath_unfreeze(ctrl->subsys);
2708 ++ mutex_unlock(&ctrl->subsys->lock);
2709 + mutex_unlock(&ctrl->scan_lock);
2710 + }
2711 + if (effects & NVME_CMD_EFFECTS_CCC)
2712 +@@ -1668,6 +1673,7 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
2713 + if (ns->head->disk) {
2714 + nvme_update_disk_info(ns->head->disk, ns, id);
2715 + blk_queue_stack_limits(ns->head->disk->queue, ns->queue);
2716 ++ revalidate_disk(ns->head->disk);
2717 + }
2718 + #endif
2719 + }
2720 +@@ -2439,6 +2445,7 @@ static int nvme_init_subsystem(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
2721 + if (ret) {
2722 + dev_err(ctrl->device,
2723 + "failed to register subsystem device.\n");
2724 ++ put_device(&subsys->dev);
2725 + goto out_unlock;
2726 + }
2727 + ida_init(&subsys->ns_ida);
2728 +@@ -2461,7 +2468,6 @@ out_put_subsystem:
2729 + nvme_put_subsystem(subsys);
2730 + out_unlock:
2731 + mutex_unlock(&nvme_subsystems_lock);
2732 +- put_device(&subsys->dev);
2733 + return ret;
2734 + }
2735 +
2736 +@@ -3523,6 +3529,13 @@ void nvme_remove_namespaces(struct nvme_ctrl *ctrl)
2737 + struct nvme_ns *ns, *next;
2738 + LIST_HEAD(ns_list);
2739 +
2740 ++ /*
2741 ++ * make sure to requeue I/O to all namespaces as these
2742 ++ * might result from the scan itself and must complete
2743 ++ * for the scan_work to make progress
2744 ++ */
2745 ++ nvme_mpath_clear_ctrl_paths(ctrl);
2746 ++
2747 + /* prevent racing with ns scanning */
2748 + flush_work(&ctrl->scan_work);
2749 +
2750 +diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
2751 +index e942b3e84068..747c0d4f9ff5 100644
2752 +--- a/drivers/nvme/host/multipath.c
2753 ++++ b/drivers/nvme/host/multipath.c
2754 +@@ -12,6 +12,36 @@ module_param(multipath, bool, 0444);
2755 + MODULE_PARM_DESC(multipath,
2756 + "turn on native support for multiple controllers per subsystem");
2757 +
2758 ++void nvme_mpath_unfreeze(struct nvme_subsystem *subsys)
2759 ++{
2760 ++ struct nvme_ns_head *h;
2761 ++
2762 ++ lockdep_assert_held(&subsys->lock);
2763 ++ list_for_each_entry(h, &subsys->nsheads, entry)
2764 ++ if (h->disk)
2765 ++ blk_mq_unfreeze_queue(h->disk->queue);
2766 ++}
2767 ++
2768 ++void nvme_mpath_wait_freeze(struct nvme_subsystem *subsys)
2769 ++{
2770 ++ struct nvme_ns_head *h;
2771 ++
2772 ++ lockdep_assert_held(&subsys->lock);
2773 ++ list_for_each_entry(h, &subsys->nsheads, entry)
2774 ++ if (h->disk)
2775 ++ blk_mq_freeze_queue_wait(h->disk->queue);
2776 ++}
2777 ++
2778 ++void nvme_mpath_start_freeze(struct nvme_subsystem *subsys)
2779 ++{
2780 ++ struct nvme_ns_head *h;
2781 ++
2782 ++ lockdep_assert_held(&subsys->lock);
2783 ++ list_for_each_entry(h, &subsys->nsheads, entry)
2784 ++ if (h->disk)
2785 ++ blk_freeze_queue_start(h->disk->queue);
2786 ++}
2787 ++
2788 + /*
2789 + * If multipathing is enabled we need to always use the subsystem instance
2790 + * number for numbering our devices to avoid conflicts between subsystems that
2791 +@@ -104,18 +134,34 @@ static const char *nvme_ana_state_names[] = {
2792 + [NVME_ANA_CHANGE] = "change",
2793 + };
2794 +
2795 +-void nvme_mpath_clear_current_path(struct nvme_ns *ns)
2796 ++bool nvme_mpath_clear_current_path(struct nvme_ns *ns)
2797 + {
2798 + struct nvme_ns_head *head = ns->head;
2799 ++ bool changed = false;
2800 + int node;
2801 +
2802 + if (!head)
2803 +- return;
2804 ++ goto out;
2805 +
2806 + for_each_node(node) {
2807 +- if (ns == rcu_access_pointer(head->current_path[node]))
2808 ++ if (ns == rcu_access_pointer(head->current_path[node])) {
2809 + rcu_assign_pointer(head->current_path[node], NULL);
2810 ++ changed = true;
2811 ++ }
2812 + }
2813 ++out:
2814 ++ return changed;
2815 ++}
2816 ++
2817 ++void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl)
2818 ++{
2819 ++ struct nvme_ns *ns;
2820 ++
2821 ++ mutex_lock(&ctrl->scan_lock);
2822 ++ list_for_each_entry(ns, &ctrl->namespaces, list)
2823 ++ if (nvme_mpath_clear_current_path(ns))
2824 ++ kblockd_schedule_work(&ns->head->requeue_work);
2825 ++ mutex_unlock(&ctrl->scan_lock);
2826 + }
2827 +
2828 + static struct nvme_ns *__nvme_find_path(struct nvme_ns_head *head, int node)
2829 +@@ -218,6 +264,24 @@ inline struct nvme_ns *nvme_find_path(struct nvme_ns_head *head)
2830 + return ns;
2831 + }
2832 +
2833 ++static bool nvme_available_path(struct nvme_ns_head *head)
2834 ++{
2835 ++ struct nvme_ns *ns;
2836 ++
2837 ++ list_for_each_entry_rcu(ns, &head->list, siblings) {
2838 ++ switch (ns->ctrl->state) {
2839 ++ case NVME_CTRL_LIVE:
2840 ++ case NVME_CTRL_RESETTING:
2841 ++ case NVME_CTRL_CONNECTING:
2842 ++ /* fallthru */
2843 ++ return true;
2844 ++ default:
2845 ++ break;
2846 ++ }
2847 ++ }
2848 ++ return false;
2849 ++}
2850 ++
2851 + static blk_qc_t nvme_ns_head_make_request(struct request_queue *q,
2852 + struct bio *bio)
2853 + {
2854 +@@ -244,14 +308,14 @@ static blk_qc_t nvme_ns_head_make_request(struct request_queue *q,
2855 + disk_devt(ns->head->disk),
2856 + bio->bi_iter.bi_sector);
2857 + ret = direct_make_request(bio);
2858 +- } else if (!list_empty_careful(&head->list)) {
2859 +- dev_warn_ratelimited(dev, "no path available - requeuing I/O\n");
2860 ++ } else if (nvme_available_path(head)) {
2861 ++ dev_warn_ratelimited(dev, "no usable path - requeuing I/O\n");
2862 +
2863 + spin_lock_irq(&head->requeue_lock);
2864 + bio_list_add(&head->requeue_list, bio);
2865 + spin_unlock_irq(&head->requeue_lock);
2866 + } else {
2867 +- dev_warn_ratelimited(dev, "no path - failing I/O\n");
2868 ++ dev_warn_ratelimited(dev, "no available path - failing I/O\n");
2869 +
2870 + bio->bi_status = BLK_STS_IOERR;
2871 + bio_endio(bio);
2872 +diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
2873 +index 7391cd0a7739..81215ca32671 100644
2874 +--- a/drivers/nvme/host/nvme.h
2875 ++++ b/drivers/nvme/host/nvme.h
2876 +@@ -477,6 +477,9 @@ static inline bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl)
2877 + return ctrl->ana_log_buf != NULL;
2878 + }
2879 +
2880 ++void nvme_mpath_unfreeze(struct nvme_subsystem *subsys);
2881 ++void nvme_mpath_wait_freeze(struct nvme_subsystem *subsys);
2882 ++void nvme_mpath_start_freeze(struct nvme_subsystem *subsys);
2883 + void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns,
2884 + struct nvme_ctrl *ctrl, int *flags);
2885 + void nvme_failover_req(struct request *req);
2886 +@@ -487,7 +490,8 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head);
2887 + int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id);
2888 + void nvme_mpath_uninit(struct nvme_ctrl *ctrl);
2889 + void nvme_mpath_stop(struct nvme_ctrl *ctrl);
2890 +-void nvme_mpath_clear_current_path(struct nvme_ns *ns);
2891 ++bool nvme_mpath_clear_current_path(struct nvme_ns *ns);
2892 ++void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl);
2893 + struct nvme_ns *nvme_find_path(struct nvme_ns_head *head);
2894 +
2895 + static inline void nvme_mpath_check_last_path(struct nvme_ns *ns)
2896 +@@ -535,7 +539,11 @@ static inline void nvme_mpath_add_disk(struct nvme_ns *ns,
2897 + static inline void nvme_mpath_remove_disk(struct nvme_ns_head *head)
2898 + {
2899 + }
2900 +-static inline void nvme_mpath_clear_current_path(struct nvme_ns *ns)
2901 ++static inline bool nvme_mpath_clear_current_path(struct nvme_ns *ns)
2902 ++{
2903 ++ return false;
2904 ++}
2905 ++static inline void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl)
2906 + {
2907 + }
2908 + static inline void nvme_mpath_check_last_path(struct nvme_ns *ns)
2909 +@@ -555,6 +563,15 @@ static inline void nvme_mpath_uninit(struct nvme_ctrl *ctrl)
2910 + static inline void nvme_mpath_stop(struct nvme_ctrl *ctrl)
2911 + {
2912 + }
2913 ++static inline void nvme_mpath_unfreeze(struct nvme_subsystem *subsys)
2914 ++{
2915 ++}
2916 ++static inline void nvme_mpath_wait_freeze(struct nvme_subsystem *subsys)
2917 ++{
2918 ++}
2919 ++static inline void nvme_mpath_start_freeze(struct nvme_subsystem *subsys)
2920 ++{
2921 ++}
2922 + #endif /* CONFIG_NVME_MULTIPATH */
2923 +
2924 + #ifdef CONFIG_NVM
2925 +diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
2926 +index f9959eaaa185..09ffd21d1809 100644
2927 +--- a/drivers/nvme/host/pci.c
2928 ++++ b/drivers/nvme/host/pci.c
2929 +@@ -2712,7 +2712,7 @@ static void nvme_async_probe(void *data, async_cookie_t cookie)
2930 + {
2931 + struct nvme_dev *dev = data;
2932 +
2933 +- nvme_reset_ctrl_sync(&dev->ctrl);
2934 ++ flush_work(&dev->ctrl.reset_work);
2935 + flush_work(&dev->ctrl.scan_work);
2936 + nvme_put_ctrl(&dev->ctrl);
2937 + }
2938 +@@ -2778,6 +2778,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2939 +
2940 + dev_info(dev->ctrl.device, "pci function %s\n", dev_name(&pdev->dev));
2941 +
2942 ++ nvme_reset_ctrl(&dev->ctrl);
2943 + nvme_get_ctrl(&dev->ctrl);
2944 + async_schedule(nvme_async_probe, dev);
2945 +
2946 +diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
2947 +index 97f668a39ae1..7b074323bcdf 100644
2948 +--- a/drivers/nvme/host/rdma.c
2949 ++++ b/drivers/nvme/host/rdma.c
2950 +@@ -562,13 +562,17 @@ out_destroy_cm_id:
2951 + return ret;
2952 + }
2953 +
2954 ++static void __nvme_rdma_stop_queue(struct nvme_rdma_queue *queue)
2955 ++{
2956 ++ rdma_disconnect(queue->cm_id);
2957 ++ ib_drain_qp(queue->qp);
2958 ++}
2959 ++
2960 + static void nvme_rdma_stop_queue(struct nvme_rdma_queue *queue)
2961 + {
2962 + if (!test_and_clear_bit(NVME_RDMA_Q_LIVE, &queue->flags))
2963 + return;
2964 +-
2965 +- rdma_disconnect(queue->cm_id);
2966 +- ib_drain_qp(queue->qp);
2967 ++ __nvme_rdma_stop_queue(queue);
2968 + }
2969 +
2970 + static void nvme_rdma_free_queue(struct nvme_rdma_queue *queue)
2971 +@@ -607,11 +611,13 @@ static int nvme_rdma_start_queue(struct nvme_rdma_ctrl *ctrl, int idx)
2972 + else
2973 + ret = nvmf_connect_admin_queue(&ctrl->ctrl);
2974 +
2975 +- if (!ret)
2976 ++ if (!ret) {
2977 + set_bit(NVME_RDMA_Q_LIVE, &queue->flags);
2978 +- else
2979 ++ } else {
2980 ++ __nvme_rdma_stop_queue(queue);
2981 + dev_info(ctrl->ctrl.device,
2982 + "failed to connect queue: %d ret=%d\n", idx, ret);
2983 ++ }
2984 + return ret;
2985 + }
2986 +
2987 +diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
2988 +index 08dd5af357f7..3854363118cc 100644
2989 +--- a/drivers/nvme/target/configfs.c
2990 ++++ b/drivers/nvme/target/configfs.c
2991 +@@ -673,6 +673,7 @@ static void nvmet_port_subsys_drop_link(struct config_item *parent,
2992 +
2993 + found:
2994 + list_del(&p->entry);
2995 ++ nvmet_port_del_ctrls(port, subsys);
2996 + nvmet_port_disc_changed(port, subsys);
2997 +
2998 + if (list_empty(&port->subsystems))
2999 +diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
3000 +index 7734a6acff85..396cbc7ea353 100644
3001 +--- a/drivers/nvme/target/core.c
3002 ++++ b/drivers/nvme/target/core.c
3003 +@@ -43,6 +43,9 @@ inline u16 errno_to_nvme_status(struct nvmet_req *req, int errno)
3004 + u16 status;
3005 +
3006 + switch (errno) {
3007 ++ case 0:
3008 ++ status = NVME_SC_SUCCESS;
3009 ++ break;
3010 + case -ENOSPC:
3011 + req->error_loc = offsetof(struct nvme_rw_command, length);
3012 + status = NVME_SC_CAP_EXCEEDED | NVME_SC_DNR;
3013 +@@ -277,6 +280,18 @@ void nvmet_unregister_transport(const struct nvmet_fabrics_ops *ops)
3014 + }
3015 + EXPORT_SYMBOL_GPL(nvmet_unregister_transport);
3016 +
3017 ++void nvmet_port_del_ctrls(struct nvmet_port *port, struct nvmet_subsys *subsys)
3018 ++{
3019 ++ struct nvmet_ctrl *ctrl;
3020 ++
3021 ++ mutex_lock(&subsys->lock);
3022 ++ list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry) {
3023 ++ if (ctrl->port == port)
3024 ++ ctrl->ops->delete_ctrl(ctrl);
3025 ++ }
3026 ++ mutex_unlock(&subsys->lock);
3027 ++}
3028 ++
3029 + int nvmet_enable_port(struct nvmet_port *port)
3030 + {
3031 + const struct nvmet_fabrics_ops *ops;
3032 +diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
3033 +index 9e211ad6bdd3..da9cd07461fb 100644
3034 +--- a/drivers/nvme/target/loop.c
3035 ++++ b/drivers/nvme/target/loop.c
3036 +@@ -654,6 +654,14 @@ static void nvme_loop_remove_port(struct nvmet_port *port)
3037 + mutex_lock(&nvme_loop_ports_mutex);
3038 + list_del_init(&port->entry);
3039 + mutex_unlock(&nvme_loop_ports_mutex);
3040 ++
3041 ++ /*
3042 ++ * Ensure any ctrls that are in the process of being
3043 ++ * deleted are in fact deleted before we return
3044 ++ * and free the port. This is to prevent active
3045 ++ * ctrls from using a port after it's freed.
3046 ++ */
3047 ++ flush_workqueue(nvme_delete_wq);
3048 + }
3049 +
3050 + static const struct nvmet_fabrics_ops nvme_loop_ops = {
3051 +diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
3052 +index c25d88fc9dec..b6b0d483e0c5 100644
3053 +--- a/drivers/nvme/target/nvmet.h
3054 ++++ b/drivers/nvme/target/nvmet.h
3055 +@@ -415,6 +415,9 @@ void nvmet_port_send_ana_event(struct nvmet_port *port);
3056 + int nvmet_register_transport(const struct nvmet_fabrics_ops *ops);
3057 + void nvmet_unregister_transport(const struct nvmet_fabrics_ops *ops);
3058 +
3059 ++void nvmet_port_del_ctrls(struct nvmet_port *port,
3060 ++ struct nvmet_subsys *subsys);
3061 ++
3062 + int nvmet_enable_port(struct nvmet_port *port);
3063 + void nvmet_disable_port(struct nvmet_port *port);
3064 +
3065 +diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
3066 +index 682789bb8ab3..57ed2e2024bf 100644
3067 +--- a/drivers/soundwire/cadence_master.c
3068 ++++ b/drivers/soundwire/cadence_master.c
3069 +@@ -80,8 +80,8 @@
3070 +
3071 + #define CDNS_MCP_INTSET 0x4C
3072 +
3073 +-#define CDNS_SDW_SLAVE_STAT 0x50
3074 +-#define CDNS_MCP_SLAVE_STAT_MASK BIT(1, 0)
3075 ++#define CDNS_MCP_SLAVE_STAT 0x50
3076 ++#define CDNS_MCP_SLAVE_STAT_MASK GENMASK(1, 0)
3077 +
3078 + #define CDNS_MCP_SLAVE_INTSTAT0 0x54
3079 + #define CDNS_MCP_SLAVE_INTSTAT1 0x58
3080 +@@ -95,8 +95,8 @@
3081 + #define CDNS_MCP_SLAVE_INTMASK0 0x5C
3082 + #define CDNS_MCP_SLAVE_INTMASK1 0x60
3083 +
3084 +-#define CDNS_MCP_SLAVE_INTMASK0_MASK GENMASK(30, 0)
3085 +-#define CDNS_MCP_SLAVE_INTMASK1_MASK GENMASK(16, 0)
3086 ++#define CDNS_MCP_SLAVE_INTMASK0_MASK GENMASK(31, 0)
3087 ++#define CDNS_MCP_SLAVE_INTMASK1_MASK GENMASK(15, 0)
3088 +
3089 + #define CDNS_MCP_PORT_INTSTAT 0x64
3090 + #define CDNS_MCP_PDI_STAT 0x6C
3091 +diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
3092 +index 6a5ee8e6da10..67ad40b0a05b 100644
3093 +--- a/drivers/usb/chipidea/udc.c
3094 ++++ b/drivers/usb/chipidea/udc.c
3095 +@@ -709,12 +709,6 @@ static int _gadget_stop_activity(struct usb_gadget *gadget)
3096 + struct ci_hdrc *ci = container_of(gadget, struct ci_hdrc, gadget);
3097 + unsigned long flags;
3098 +
3099 +- spin_lock_irqsave(&ci->lock, flags);
3100 +- ci->gadget.speed = USB_SPEED_UNKNOWN;
3101 +- ci->remote_wakeup = 0;
3102 +- ci->suspended = 0;
3103 +- spin_unlock_irqrestore(&ci->lock, flags);
3104 +-
3105 + /* flush all endpoints */
3106 + gadget_for_each_ep(ep, gadget) {
3107 + usb_ep_fifo_flush(ep);
3108 +@@ -732,6 +726,12 @@ static int _gadget_stop_activity(struct usb_gadget *gadget)
3109 + ci->status = NULL;
3110 + }
3111 +
3112 ++ spin_lock_irqsave(&ci->lock, flags);
3113 ++ ci->gadget.speed = USB_SPEED_UNKNOWN;
3114 ++ ci->remote_wakeup = 0;
3115 ++ ci->suspended = 0;
3116 ++ spin_unlock_irqrestore(&ci->lock, flags);
3117 ++
3118 + return 0;
3119 + }
3120 +
3121 +@@ -1303,6 +1303,10 @@ static int ep_disable(struct usb_ep *ep)
3122 + return -EBUSY;
3123 +
3124 + spin_lock_irqsave(hwep->lock, flags);
3125 ++ if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) {
3126 ++ spin_unlock_irqrestore(hwep->lock, flags);
3127 ++ return 0;
3128 ++ }
3129 +
3130 + /* only internal SW should disable ctrl endpts */
3131 +
3132 +@@ -1392,6 +1396,10 @@ static int ep_queue(struct usb_ep *ep, struct usb_request *req,
3133 + return -EINVAL;
3134 +
3135 + spin_lock_irqsave(hwep->lock, flags);
3136 ++ if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) {
3137 ++ spin_unlock_irqrestore(hwep->lock, flags);
3138 ++ return 0;
3139 ++ }
3140 + retval = _ep_queue(ep, req, gfp_flags);
3141 + spin_unlock_irqrestore(hwep->lock, flags);
3142 + return retval;
3143 +@@ -1415,8 +1423,8 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req)
3144 + return -EINVAL;
3145 +
3146 + spin_lock_irqsave(hwep->lock, flags);
3147 +-
3148 +- hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
3149 ++ if (hwep->ci->gadget.speed != USB_SPEED_UNKNOWN)
3150 ++ hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
3151 +
3152 + list_for_each_entry_safe(node, tmpnode, &hwreq->tds, td) {
3153 + dma_pool_free(hwep->td_pool, node->ptr, node->dma);
3154 +@@ -1487,6 +1495,10 @@ static void ep_fifo_flush(struct usb_ep *ep)
3155 + }
3156 +
3157 + spin_lock_irqsave(hwep->lock, flags);
3158 ++ if (hwep->ci->gadget.speed == USB_SPEED_UNKNOWN) {
3159 ++ spin_unlock_irqrestore(hwep->lock, flags);
3160 ++ return;
3161 ++ }
3162 +
3163 + hw_ep_flush(hwep->ci, hwep->num, hwep->dir);
3164 +
3165 +@@ -1559,6 +1571,10 @@ static int ci_udc_wakeup(struct usb_gadget *_gadget)
3166 + int ret = 0;
3167 +
3168 + spin_lock_irqsave(&ci->lock, flags);
3169 ++ if (ci->gadget.speed == USB_SPEED_UNKNOWN) {
3170 ++ spin_unlock_irqrestore(&ci->lock, flags);
3171 ++ return 0;
3172 ++ }
3173 + if (!ci->remote_wakeup) {
3174 + ret = -EOPNOTSUPP;
3175 + goto out;
3176 +diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
3177 +index 9e9caff905d5..4929c5883068 100644
3178 +--- a/drivers/usb/class/cdc-wdm.c
3179 ++++ b/drivers/usb/class/cdc-wdm.c
3180 +@@ -587,10 +587,20 @@ static int wdm_flush(struct file *file, fl_owner_t id)
3181 + {
3182 + struct wdm_device *desc = file->private_data;
3183 +
3184 +- wait_event(desc->wait, !test_bit(WDM_IN_USE, &desc->flags));
3185 ++ wait_event(desc->wait,
3186 ++ /*
3187 ++ * needs both flags. We cannot do with one
3188 ++ * because resetting it would cause a race
3189 ++ * with write() yet we need to signal
3190 ++ * a disconnect
3191 ++ */
3192 ++ !test_bit(WDM_IN_USE, &desc->flags) ||
3193 ++ test_bit(WDM_DISCONNECTING, &desc->flags));
3194 +
3195 + /* cannot dereference desc->intf if WDM_DISCONNECTING */
3196 +- if (desc->werr < 0 && !test_bit(WDM_DISCONNECTING, &desc->flags))
3197 ++ if (test_bit(WDM_DISCONNECTING, &desc->flags))
3198 ++ return -ENODEV;
3199 ++ if (desc->werr < 0)
3200 + dev_err(&desc->intf->dev, "Error in flush path: %d\n",
3201 + desc->werr);
3202 +
3203 +@@ -974,8 +984,6 @@ static void wdm_disconnect(struct usb_interface *intf)
3204 + spin_lock_irqsave(&desc->iuspin, flags);
3205 + set_bit(WDM_DISCONNECTING, &desc->flags);
3206 + set_bit(WDM_READ, &desc->flags);
3207 +- /* to terminate pending flushes */
3208 +- clear_bit(WDM_IN_USE, &desc->flags);
3209 + spin_unlock_irqrestore(&desc->iuspin, flags);
3210 + wake_up_all(&desc->wait);
3211 + mutex_lock(&desc->rlock);
3212 +diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
3213 +index 4942122b2346..36858ddd8d9b 100644
3214 +--- a/drivers/usb/class/usbtmc.c
3215 ++++ b/drivers/usb/class/usbtmc.c
3216 +@@ -2362,8 +2362,11 @@ static int usbtmc_probe(struct usb_interface *intf,
3217 + goto err_put;
3218 + }
3219 +
3220 ++ retcode = -EINVAL;
3221 + data->bulk_in = bulk_in->bEndpointAddress;
3222 + data->wMaxPacketSize = usb_endpoint_maxp(bulk_in);
3223 ++ if (!data->wMaxPacketSize)
3224 ++ goto err_put;
3225 + dev_dbg(&intf->dev, "Found bulk in endpoint at %u\n", data->bulk_in);
3226 +
3227 + data->bulk_out = bulk_out->bEndpointAddress;
3228 +diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
3229 +index 03432467b05f..7537681355f6 100644
3230 +--- a/drivers/usb/core/hcd-pci.c
3231 ++++ b/drivers/usb/core/hcd-pci.c
3232 +@@ -216,17 +216,18 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
3233 + /* EHCI, OHCI */
3234 + hcd->rsrc_start = pci_resource_start(dev, 0);
3235 + hcd->rsrc_len = pci_resource_len(dev, 0);
3236 +- if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
3237 +- driver->description)) {
3238 ++ if (!devm_request_mem_region(&dev->dev, hcd->rsrc_start,
3239 ++ hcd->rsrc_len, driver->description)) {
3240 + dev_dbg(&dev->dev, "controller already in use\n");
3241 + retval = -EBUSY;
3242 + goto put_hcd;
3243 + }
3244 +- hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len);
3245 ++ hcd->regs = devm_ioremap_nocache(&dev->dev, hcd->rsrc_start,
3246 ++ hcd->rsrc_len);
3247 + if (hcd->regs == NULL) {
3248 + dev_dbg(&dev->dev, "error mapping memory\n");
3249 + retval = -EFAULT;
3250 +- goto release_mem_region;
3251 ++ goto put_hcd;
3252 + }
3253 +
3254 + } else {
3255 +@@ -240,8 +241,8 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
3256 +
3257 + hcd->rsrc_start = pci_resource_start(dev, region);
3258 + hcd->rsrc_len = pci_resource_len(dev, region);
3259 +- if (request_region(hcd->rsrc_start, hcd->rsrc_len,
3260 +- driver->description))
3261 ++ if (devm_request_region(&dev->dev, hcd->rsrc_start,
3262 ++ hcd->rsrc_len, driver->description))
3263 + break;
3264 + }
3265 + if (region == PCI_ROM_RESOURCE) {
3266 +@@ -275,20 +276,13 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
3267 + }
3268 +
3269 + if (retval != 0)
3270 +- goto unmap_registers;
3271 ++ goto put_hcd;
3272 + device_wakeup_enable(hcd->self.controller);
3273 +
3274 + if (pci_dev_run_wake(dev))
3275 + pm_runtime_put_noidle(&dev->dev);
3276 + return retval;
3277 +
3278 +-unmap_registers:
3279 +- if (driver->flags & HCD_MEMORY) {
3280 +- iounmap(hcd->regs);
3281 +-release_mem_region:
3282 +- release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
3283 +- } else
3284 +- release_region(hcd->rsrc_start, hcd->rsrc_len);
3285 + put_hcd:
3286 + usb_put_hcd(hcd);
3287 + disable_pci:
3288 +@@ -347,14 +341,6 @@ void usb_hcd_pci_remove(struct pci_dev *dev)
3289 + dev_set_drvdata(&dev->dev, NULL);
3290 + up_read(&companions_rwsem);
3291 + }
3292 +-
3293 +- if (hcd->driver->flags & HCD_MEMORY) {
3294 +- iounmap(hcd->regs);
3295 +- release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
3296 +- } else {
3297 +- release_region(hcd->rsrc_start, hcd->rsrc_len);
3298 +- }
3299 +-
3300 + usb_put_hcd(hcd);
3301 + pci_disable_device(dev);
3302 + }
3303 +diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
3304 +index b8a15840b4ff..dfcabadeed01 100644
3305 +--- a/drivers/usb/gadget/composite.c
3306 ++++ b/drivers/usb/gadget/composite.c
3307 +@@ -1976,6 +1976,7 @@ void composite_disconnect(struct usb_gadget *gadget)
3308 + * disconnect callbacks?
3309 + */
3310 + spin_lock_irqsave(&cdev->lock, flags);
3311 ++ cdev->suspended = 0;
3312 + if (cdev->config)
3313 + reset_config(cdev);
3314 + if (cdev->driver->disconnect)
3315 +diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
3316 +index 043f97ad8f22..f2bc8d037067 100644
3317 +--- a/drivers/usb/gadget/function/f_mass_storage.c
3318 ++++ b/drivers/usb/gadget/function/f_mass_storage.c
3319 +@@ -261,7 +261,7 @@ struct fsg_common;
3320 + struct fsg_common {
3321 + struct usb_gadget *gadget;
3322 + struct usb_composite_dev *cdev;
3323 +- struct fsg_dev *fsg, *new_fsg;
3324 ++ struct fsg_dev *fsg;
3325 + wait_queue_head_t io_wait;
3326 + wait_queue_head_t fsg_wait;
3327 +
3328 +@@ -290,6 +290,7 @@ struct fsg_common {
3329 + unsigned int bulk_out_maxpacket;
3330 + enum fsg_state state; /* For exception handling */
3331 + unsigned int exception_req_tag;
3332 ++ void *exception_arg;
3333 +
3334 + enum data_direction data_dir;
3335 + u32 data_size;
3336 +@@ -391,7 +392,8 @@ static int fsg_set_halt(struct fsg_dev *fsg, struct usb_ep *ep)
3337 +
3338 + /* These routines may be called in process context or in_irq */
3339 +
3340 +-static void raise_exception(struct fsg_common *common, enum fsg_state new_state)
3341 ++static void __raise_exception(struct fsg_common *common, enum fsg_state new_state,
3342 ++ void *arg)
3343 + {
3344 + unsigned long flags;
3345 +
3346 +@@ -404,6 +406,7 @@ static void raise_exception(struct fsg_common *common, enum fsg_state new_state)
3347 + if (common->state <= new_state) {
3348 + common->exception_req_tag = common->ep0_req_tag;
3349 + common->state = new_state;
3350 ++ common->exception_arg = arg;
3351 + if (common->thread_task)
3352 + send_sig_info(SIGUSR1, SEND_SIG_PRIV,
3353 + common->thread_task);
3354 +@@ -411,6 +414,10 @@ static void raise_exception(struct fsg_common *common, enum fsg_state new_state)
3355 + spin_unlock_irqrestore(&common->lock, flags);
3356 + }
3357 +
3358 ++static void raise_exception(struct fsg_common *common, enum fsg_state new_state)
3359 ++{
3360 ++ __raise_exception(common, new_state, NULL);
3361 ++}
3362 +
3363 + /*-------------------------------------------------------------------------*/
3364 +
3365 +@@ -2285,16 +2292,16 @@ reset:
3366 + static int fsg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
3367 + {
3368 + struct fsg_dev *fsg = fsg_from_func(f);
3369 +- fsg->common->new_fsg = fsg;
3370 +- raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
3371 ++
3372 ++ __raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE, fsg);
3373 + return USB_GADGET_DELAYED_STATUS;
3374 + }
3375 +
3376 + static void fsg_disable(struct usb_function *f)
3377 + {
3378 + struct fsg_dev *fsg = fsg_from_func(f);
3379 +- fsg->common->new_fsg = NULL;
3380 +- raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
3381 ++
3382 ++ __raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE, NULL);
3383 + }
3384 +
3385 +
3386 +@@ -2307,6 +2314,7 @@ static void handle_exception(struct fsg_common *common)
3387 + enum fsg_state old_state;
3388 + struct fsg_lun *curlun;
3389 + unsigned int exception_req_tag;
3390 ++ struct fsg_dev *new_fsg;
3391 +
3392 + /*
3393 + * Clear the existing signals. Anything but SIGUSR1 is converted
3394 +@@ -2360,6 +2368,7 @@ static void handle_exception(struct fsg_common *common)
3395 + common->next_buffhd_to_fill = &common->buffhds[0];
3396 + common->next_buffhd_to_drain = &common->buffhds[0];
3397 + exception_req_tag = common->exception_req_tag;
3398 ++ new_fsg = common->exception_arg;
3399 + old_state = common->state;
3400 + common->state = FSG_STATE_NORMAL;
3401 +
3402 +@@ -2413,8 +2422,8 @@ static void handle_exception(struct fsg_common *common)
3403 + break;
3404 +
3405 + case FSG_STATE_CONFIG_CHANGE:
3406 +- do_set_interface(common, common->new_fsg);
3407 +- if (common->new_fsg)
3408 ++ do_set_interface(common, new_fsg);
3409 ++ if (new_fsg)
3410 + usb_composite_setup_continue(common->cdev);
3411 + break;
3412 +
3413 +@@ -2989,8 +2998,7 @@ static void fsg_unbind(struct usb_configuration *c, struct usb_function *f)
3414 +
3415 + DBG(fsg, "unbind\n");
3416 + if (fsg->common->fsg == fsg) {
3417 +- fsg->common->new_fsg = NULL;
3418 +- raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
3419 ++ __raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE, NULL);
3420 + /* FIXME: make interruptible or killable somehow? */
3421 + wait_event(common->fsg_wait, common->fsg != fsg);
3422 + }
3423 +diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c
3424 +index 0da68df259c8..7bf621d40c5a 100644
3425 +--- a/drivers/usb/host/fotg210-hcd.c
3426 ++++ b/drivers/usb/host/fotg210-hcd.c
3427 +@@ -1628,6 +1628,10 @@ static int fotg210_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
3428 + /* see what we found out */
3429 + temp = check_reset_complete(fotg210, wIndex, status_reg,
3430 + fotg210_readl(fotg210, status_reg));
3431 ++
3432 ++ /* restart schedule */
3433 ++ fotg210->command |= CMD_RUN;
3434 ++ fotg210_writel(fotg210, fotg210->command, &fotg210->regs->command);
3435 + }
3436 +
3437 + if (!(temp & (PORT_RESUME|PORT_RESET))) {
3438 +diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
3439 +index 210181fd98d2..af11887f5f9e 100644
3440 +--- a/drivers/usb/host/ohci-hcd.c
3441 ++++ b/drivers/usb/host/ohci-hcd.c
3442 +@@ -418,8 +418,7 @@ static void ohci_usb_reset (struct ohci_hcd *ohci)
3443 + * other cases where the next software may expect clean state from the
3444 + * "firmware". this is bus-neutral, unlike shutdown() methods.
3445 + */
3446 +-static void
3447 +-ohci_shutdown (struct usb_hcd *hcd)
3448 ++static void _ohci_shutdown(struct usb_hcd *hcd)
3449 + {
3450 + struct ohci_hcd *ohci;
3451 +
3452 +@@ -435,6 +434,16 @@ ohci_shutdown (struct usb_hcd *hcd)
3453 + ohci->rh_state = OHCI_RH_HALTED;
3454 + }
3455 +
3456 ++static void ohci_shutdown(struct usb_hcd *hcd)
3457 ++{
3458 ++ struct ohci_hcd *ohci = hcd_to_ohci(hcd);
3459 ++ unsigned long flags;
3460 ++
3461 ++ spin_lock_irqsave(&ohci->lock, flags);
3462 ++ _ohci_shutdown(hcd);
3463 ++ spin_unlock_irqrestore(&ohci->lock, flags);
3464 ++}
3465 ++
3466 + /*-------------------------------------------------------------------------*
3467 + * HC functions
3468 + *-------------------------------------------------------------------------*/
3469 +@@ -752,7 +761,7 @@ static void io_watchdog_func(struct timer_list *t)
3470 + died:
3471 + usb_hc_died(ohci_to_hcd(ohci));
3472 + ohci_dump(ohci);
3473 +- ohci_shutdown(ohci_to_hcd(ohci));
3474 ++ _ohci_shutdown(ohci_to_hcd(ohci));
3475 + goto done;
3476 + } else {
3477 + /* No write back because the done queue was empty */
3478 +diff --git a/drivers/usb/host/xhci-rcar.c b/drivers/usb/host/xhci-rcar.c
3479 +index 8616c52849c6..2b0ccd150209 100644
3480 +--- a/drivers/usb/host/xhci-rcar.c
3481 ++++ b/drivers/usb/host/xhci-rcar.c
3482 +@@ -104,7 +104,7 @@ static int xhci_rcar_is_gen2(struct device *dev)
3483 + return of_device_is_compatible(node, "renesas,xhci-r8a7790") ||
3484 + of_device_is_compatible(node, "renesas,xhci-r8a7791") ||
3485 + of_device_is_compatible(node, "renesas,xhci-r8a7793") ||
3486 +- of_device_is_compatible(node, "renensas,rcar-gen2-xhci");
3487 ++ of_device_is_compatible(node, "renesas,rcar-gen2-xhci");
3488 + }
3489 +
3490 + static int xhci_rcar_is_gen3(struct device *dev)
3491 +diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
3492 +index cc794e25a0b6..1d9ce9cbc831 100644
3493 +--- a/drivers/usb/storage/realtek_cr.c
3494 ++++ b/drivers/usb/storage/realtek_cr.c
3495 +@@ -38,7 +38,7 @@ MODULE_LICENSE("GPL");
3496 +
3497 + static int auto_delink_en = 1;
3498 + module_param(auto_delink_en, int, S_IRUGO | S_IWUSR);
3499 +-MODULE_PARM_DESC(auto_delink_en, "enable auto delink");
3500 ++MODULE_PARM_DESC(auto_delink_en, "auto delink mode (0=firmware, 1=software [default])");
3501 +
3502 + #ifdef CONFIG_REALTEK_AUTOPM
3503 + static int ss_en = 1;
3504 +@@ -996,12 +996,15 @@ static int init_realtek_cr(struct us_data *us)
3505 + goto INIT_FAIL;
3506 + }
3507 +
3508 +- if (CHECK_FW_VER(chip, 0x5888) || CHECK_FW_VER(chip, 0x5889) ||
3509 +- CHECK_FW_VER(chip, 0x5901))
3510 +- SET_AUTO_DELINK(chip);
3511 +- if (STATUS_LEN(chip) == 16) {
3512 +- if (SUPPORT_AUTO_DELINK(chip))
3513 ++ if (CHECK_PID(chip, 0x0138) || CHECK_PID(chip, 0x0158) ||
3514 ++ CHECK_PID(chip, 0x0159)) {
3515 ++ if (CHECK_FW_VER(chip, 0x5888) || CHECK_FW_VER(chip, 0x5889) ||
3516 ++ CHECK_FW_VER(chip, 0x5901))
3517 + SET_AUTO_DELINK(chip);
3518 ++ if (STATUS_LEN(chip) == 16) {
3519 ++ if (SUPPORT_AUTO_DELINK(chip))
3520 ++ SET_AUTO_DELINK(chip);
3521 ++ }
3522 + }
3523 + #ifdef CONFIG_REALTEK_AUTOPM
3524 + if (ss_en)
3525 +diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
3526 +index ea0d27a94afe..1cd9b6305b06 100644
3527 +--- a/drivers/usb/storage/unusual_devs.h
3528 ++++ b/drivers/usb/storage/unusual_devs.h
3529 +@@ -2100,7 +2100,7 @@ UNUSUAL_DEV( 0x14cd, 0x6600, 0x0201, 0x0201,
3530 + US_FL_IGNORE_RESIDUE ),
3531 +
3532 + /* Reported by Michael Büsch <m@××××.ch> */
3533 +-UNUSUAL_DEV( 0x152d, 0x0567, 0x0114, 0x0116,
3534 ++UNUSUAL_DEV( 0x152d, 0x0567, 0x0114, 0x0117,
3535 + "JMicron",
3536 + "USB to ATA/ATAPI Bridge",
3537 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
3538 +diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
3539 +index 15abe1d9958f..bcfdb55fd198 100644
3540 +--- a/drivers/usb/typec/tcpm/tcpm.c
3541 ++++ b/drivers/usb/typec/tcpm/tcpm.c
3542 +@@ -1446,7 +1446,7 @@ static enum pdo_err tcpm_caps_err(struct tcpm_port *port, const u32 *pdo,
3543 + else if ((pdo_min_voltage(pdo[i]) ==
3544 + pdo_min_voltage(pdo[i - 1])) &&
3545 + (pdo_max_voltage(pdo[i]) ==
3546 +- pdo_min_voltage(pdo[i - 1])))
3547 ++ pdo_max_voltage(pdo[i - 1])))
3548 + return PDO_ERR_DUPE_PDO;
3549 + break;
3550 + /*
3551 +diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c
3552 +index 560c1c54c177..f4937a91e516 100644
3553 +--- a/drivers/watchdog/bcm2835_wdt.c
3554 ++++ b/drivers/watchdog/bcm2835_wdt.c
3555 +@@ -240,6 +240,7 @@ module_param(nowayout, bool, 0);
3556 + MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
3557 + __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
3558 +
3559 ++MODULE_ALIAS("platform:bcm2835-wdt");
3560 + MODULE_AUTHOR("Lubomir Rintel <lkundrak@××.sk>");
3561 + MODULE_DESCRIPTION("Driver for Broadcom BCM2835 watchdog timer");
3562 + MODULE_LICENSE("GPL");
3563 +diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c
3564 +index 3451be03667f..00033a481ba0 100644
3565 +--- a/fs/afs/cmservice.c
3566 ++++ b/fs/afs/cmservice.c
3567 +@@ -502,18 +502,14 @@ static void SRXAFSCB_ProbeUuid(struct work_struct *work)
3568 + struct afs_call *call = container_of(work, struct afs_call, work);
3569 + struct afs_uuid *r = call->request;
3570 +
3571 +- struct {
3572 +- __be32 match;
3573 +- } reply;
3574 +-
3575 + _enter("");
3576 +
3577 + if (memcmp(r, &call->net->uuid, sizeof(call->net->uuid)) == 0)
3578 +- reply.match = htonl(0);
3579 ++ afs_send_empty_reply(call);
3580 + else
3581 +- reply.match = htonl(1);
3582 ++ rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
3583 ++ 1, 1, "K-1");
3584 +
3585 +- afs_send_simple_reply(call, &reply, sizeof(reply));
3586 + afs_put_call(call);
3587 + _leave("");
3588 + }
3589 +diff --git a/fs/afs/dir.c b/fs/afs/dir.c
3590 +index da9563d62b32..9620f19308f5 100644
3591 +--- a/fs/afs/dir.c
3592 ++++ b/fs/afs/dir.c
3593 +@@ -441,7 +441,7 @@ static int afs_dir_iterate_block(struct afs_vnode *dvnode,
3594 + * iterate through the data blob that lists the contents of an AFS directory
3595 + */
3596 + static int afs_dir_iterate(struct inode *dir, struct dir_context *ctx,
3597 +- struct key *key)
3598 ++ struct key *key, afs_dataversion_t *_dir_version)
3599 + {
3600 + struct afs_vnode *dvnode = AFS_FS_I(dir);
3601 + struct afs_xdr_dir_page *dbuf;
3602 +@@ -461,6 +461,7 @@ static int afs_dir_iterate(struct inode *dir, struct dir_context *ctx,
3603 + req = afs_read_dir(dvnode, key);
3604 + if (IS_ERR(req))
3605 + return PTR_ERR(req);
3606 ++ *_dir_version = req->data_version;
3607 +
3608 + /* round the file position up to the next entry boundary */
3609 + ctx->pos += sizeof(union afs_xdr_dirent) - 1;
3610 +@@ -515,7 +516,10 @@ out:
3611 + */
3612 + static int afs_readdir(struct file *file, struct dir_context *ctx)
3613 + {
3614 +- return afs_dir_iterate(file_inode(file), ctx, afs_file_key(file));
3615 ++ afs_dataversion_t dir_version;
3616 ++
3617 ++ return afs_dir_iterate(file_inode(file), ctx, afs_file_key(file),
3618 ++ &dir_version);
3619 + }
3620 +
3621 + /*
3622 +@@ -556,7 +560,8 @@ static int afs_lookup_one_filldir(struct dir_context *ctx, const char *name,
3623 + * - just returns the FID the dentry name maps to if found
3624 + */
3625 + static int afs_do_lookup_one(struct inode *dir, struct dentry *dentry,
3626 +- struct afs_fid *fid, struct key *key)
3627 ++ struct afs_fid *fid, struct key *key,
3628 ++ afs_dataversion_t *_dir_version)
3629 + {
3630 + struct afs_super_info *as = dir->i_sb->s_fs_info;
3631 + struct afs_lookup_one_cookie cookie = {
3632 +@@ -569,7 +574,7 @@ static int afs_do_lookup_one(struct inode *dir, struct dentry *dentry,
3633 + _enter("{%lu},%p{%pd},", dir->i_ino, dentry, dentry);
3634 +
3635 + /* search the directory */
3636 +- ret = afs_dir_iterate(dir, &cookie.ctx, key);
3637 ++ ret = afs_dir_iterate(dir, &cookie.ctx, key, _dir_version);
3638 + if (ret < 0) {
3639 + _leave(" = %d [iter]", ret);
3640 + return ret;
3641 +@@ -643,6 +648,7 @@ static struct inode *afs_do_lookup(struct inode *dir, struct dentry *dentry,
3642 + struct afs_server *server;
3643 + struct afs_vnode *dvnode = AFS_FS_I(dir), *vnode;
3644 + struct inode *inode = NULL, *ti;
3645 ++ afs_dataversion_t data_version = READ_ONCE(dvnode->status.data_version);
3646 + int ret, i;
3647 +
3648 + _enter("{%lu},%p{%pd},", dir->i_ino, dentry, dentry);
3649 +@@ -670,12 +676,14 @@ static struct inode *afs_do_lookup(struct inode *dir, struct dentry *dentry,
3650 + cookie->fids[i].vid = as->volume->vid;
3651 +
3652 + /* search the directory */
3653 +- ret = afs_dir_iterate(dir, &cookie->ctx, key);
3654 ++ ret = afs_dir_iterate(dir, &cookie->ctx, key, &data_version);
3655 + if (ret < 0) {
3656 + inode = ERR_PTR(ret);
3657 + goto out;
3658 + }
3659 +
3660 ++ dentry->d_fsdata = (void *)(unsigned long)data_version;
3661 ++
3662 + inode = ERR_PTR(-ENOENT);
3663 + if (!cookie->found)
3664 + goto out;
3665 +@@ -969,7 +977,8 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
3666 + struct dentry *parent;
3667 + struct inode *inode;
3668 + struct key *key;
3669 +- long dir_version, de_version;
3670 ++ afs_dataversion_t dir_version;
3671 ++ long de_version;
3672 + int ret;
3673 +
3674 + if (flags & LOOKUP_RCU)
3675 +@@ -1015,20 +1024,20 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
3676 + * on a 32-bit system, we only have 32 bits in the dentry to store the
3677 + * version.
3678 + */
3679 +- dir_version = (long)dir->status.data_version;
3680 ++ dir_version = dir->status.data_version;
3681 + de_version = (long)dentry->d_fsdata;
3682 +- if (de_version == dir_version)
3683 +- goto out_valid;
3684 ++ if (de_version == (long)dir_version)
3685 ++ goto out_valid_noupdate;
3686 +
3687 +- dir_version = (long)dir->invalid_before;
3688 +- if (de_version - dir_version >= 0)
3689 ++ dir_version = dir->invalid_before;
3690 ++ if (de_version - (long)dir_version >= 0)
3691 + goto out_valid;
3692 +
3693 + _debug("dir modified");
3694 + afs_stat_v(dir, n_reval);
3695 +
3696 + /* search the directory for this vnode */
3697 +- ret = afs_do_lookup_one(&dir->vfs_inode, dentry, &fid, key);
3698 ++ ret = afs_do_lookup_one(&dir->vfs_inode, dentry, &fid, key, &dir_version);
3699 + switch (ret) {
3700 + case 0:
3701 + /* the filename maps to something */
3702 +@@ -1081,7 +1090,8 @@ static int afs_d_revalidate(struct dentry *dentry, unsigned int flags)
3703 + }
3704 +
3705 + out_valid:
3706 +- dentry->d_fsdata = (void *)dir_version;
3707 ++ dentry->d_fsdata = (void *)(unsigned long)dir_version;
3708 ++out_valid_noupdate:
3709 + dput(parent);
3710 + key_put(key);
3711 + _leave(" = 1 [valid]");
3712 +@@ -1186,6 +1196,20 @@ static void afs_prep_for_new_inode(struct afs_fs_cursor *fc,
3713 + iget_data->cb_s_break = fc->cbi->server->cb_s_break;
3714 + }
3715 +
3716 ++/*
3717 ++ * Note that a dentry got changed. We need to set d_fsdata to the data version
3718 ++ * number derived from the result of the operation. It doesn't matter if
3719 ++ * d_fsdata goes backwards as we'll just revalidate.
3720 ++ */
3721 ++static void afs_update_dentry_version(struct afs_fs_cursor *fc,
3722 ++ struct dentry *dentry,
3723 ++ struct afs_status_cb *scb)
3724 ++{
3725 ++ if (fc->ac.error == 0)
3726 ++ dentry->d_fsdata =
3727 ++ (void *)(unsigned long)scb->status.data_version;
3728 ++}
3729 ++
3730 + /*
3731 + * create a directory on an AFS filesystem
3732 + */
3733 +@@ -1228,6 +1252,7 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
3734 + afs_check_for_remote_deletion(&fc, dvnode);
3735 + afs_vnode_commit_status(&fc, dvnode, fc.cb_break,
3736 + &data_version, &scb[0]);
3737 ++ afs_update_dentry_version(&fc, dentry, &scb[0]);
3738 + afs_vnode_new_inode(&fc, dentry, &iget_data, &scb[1]);
3739 + ret = afs_end_vnode_operation(&fc);
3740 + if (ret < 0)
3741 +@@ -1320,6 +1345,7 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry)
3742 +
3743 + afs_vnode_commit_status(&fc, dvnode, fc.cb_break,
3744 + &data_version, scb);
3745 ++ afs_update_dentry_version(&fc, dentry, scb);
3746 + ret = afs_end_vnode_operation(&fc);
3747 + if (ret == 0) {
3748 + afs_dir_remove_subdir(dentry);
3749 +@@ -1461,6 +1487,7 @@ static int afs_unlink(struct inode *dir, struct dentry *dentry)
3750 + &data_version, &scb[0]);
3751 + afs_vnode_commit_status(&fc, vnode, fc.cb_break_2,
3752 + &data_version_2, &scb[1]);
3753 ++ afs_update_dentry_version(&fc, dentry, &scb[0]);
3754 + ret = afs_end_vnode_operation(&fc);
3755 + if (ret == 0 && !(scb[1].have_status || scb[1].have_error))
3756 + ret = afs_dir_remove_link(dvnode, dentry, key);
3757 +@@ -1529,6 +1556,7 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
3758 + afs_check_for_remote_deletion(&fc, dvnode);
3759 + afs_vnode_commit_status(&fc, dvnode, fc.cb_break,
3760 + &data_version, &scb[0]);
3761 ++ afs_update_dentry_version(&fc, dentry, &scb[0]);
3762 + afs_vnode_new_inode(&fc, dentry, &iget_data, &scb[1]);
3763 + ret = afs_end_vnode_operation(&fc);
3764 + if (ret < 0)
3765 +@@ -1610,6 +1638,7 @@ static int afs_link(struct dentry *from, struct inode *dir,
3766 + afs_vnode_commit_status(&fc, vnode, fc.cb_break_2,
3767 + NULL, &scb[1]);
3768 + ihold(&vnode->vfs_inode);
3769 ++ afs_update_dentry_version(&fc, dentry, &scb[0]);
3770 + d_instantiate(dentry, &vnode->vfs_inode);
3771 +
3772 + mutex_unlock(&vnode->io_lock);
3773 +@@ -1689,6 +1718,7 @@ static int afs_symlink(struct inode *dir, struct dentry *dentry,
3774 + afs_check_for_remote_deletion(&fc, dvnode);
3775 + afs_vnode_commit_status(&fc, dvnode, fc.cb_break,
3776 + &data_version, &scb[0]);
3777 ++ afs_update_dentry_version(&fc, dentry, &scb[0]);
3778 + afs_vnode_new_inode(&fc, dentry, &iget_data, &scb[1]);
3779 + ret = afs_end_vnode_operation(&fc);
3780 + if (ret < 0)
3781 +@@ -1794,6 +1824,17 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
3782 + }
3783 + }
3784 +
3785 ++ /* This bit is potentially nasty as there's a potential race with
3786 ++ * afs_d_revalidate{,_rcu}(). We have to change d_fsdata on the dentry
3787 ++ * to reflect it's new parent's new data_version after the op, but
3788 ++ * d_revalidate may see old_dentry between the op having taken place
3789 ++ * and the version being updated.
3790 ++ *
3791 ++ * So drop the old_dentry for now to make other threads go through
3792 ++ * lookup instead - which we hold a lock against.
3793 ++ */
3794 ++ d_drop(old_dentry);
3795 ++
3796 + ret = -ERESTARTSYS;
3797 + if (afs_begin_vnode_operation(&fc, orig_dvnode, key, true)) {
3798 + afs_dataversion_t orig_data_version;
3799 +@@ -1805,9 +1846,9 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
3800 + if (orig_dvnode != new_dvnode) {
3801 + if (mutex_lock_interruptible_nested(&new_dvnode->io_lock, 1) < 0) {
3802 + afs_end_vnode_operation(&fc);
3803 +- goto error_rehash;
3804 ++ goto error_rehash_old;
3805 + }
3806 +- new_data_version = new_dvnode->status.data_version;
3807 ++ new_data_version = new_dvnode->status.data_version + 1;
3808 + } else {
3809 + new_data_version = orig_data_version;
3810 + new_scb = &scb[0];
3811 +@@ -1830,7 +1871,7 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
3812 + }
3813 + ret = afs_end_vnode_operation(&fc);
3814 + if (ret < 0)
3815 +- goto error_rehash;
3816 ++ goto error_rehash_old;
3817 + }
3818 +
3819 + if (ret == 0) {
3820 +@@ -1856,10 +1897,26 @@ static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
3821 + drop_nlink(new_inode);
3822 + spin_unlock(&new_inode->i_lock);
3823 + }
3824 ++
3825 ++ /* Now we can update d_fsdata on the dentries to reflect their
3826 ++ * new parent's data_version.
3827 ++ *
3828 ++ * Note that if we ever implement RENAME_EXCHANGE, we'll have
3829 ++ * to update both dentries with opposing dir versions.
3830 ++ */
3831 ++ if (new_dvnode != orig_dvnode) {
3832 ++ afs_update_dentry_version(&fc, old_dentry, &scb[1]);
3833 ++ afs_update_dentry_version(&fc, new_dentry, &scb[1]);
3834 ++ } else {
3835 ++ afs_update_dentry_version(&fc, old_dentry, &scb[0]);
3836 ++ afs_update_dentry_version(&fc, new_dentry, &scb[0]);
3837 ++ }
3838 + d_move(old_dentry, new_dentry);
3839 + goto error_tmp;
3840 + }
3841 +
3842 ++error_rehash_old:
3843 ++ d_rehash(new_dentry);
3844 + error_rehash:
3845 + if (rehash)
3846 + d_rehash(rehash);
3847 +diff --git a/fs/afs/file.c b/fs/afs/file.c
3848 +index 8fd7d3b9a1b1..87beabc7114e 100644
3849 +--- a/fs/afs/file.c
3850 ++++ b/fs/afs/file.c
3851 +@@ -191,11 +191,13 @@ void afs_put_read(struct afs_read *req)
3852 + int i;
3853 +
3854 + if (refcount_dec_and_test(&req->usage)) {
3855 +- for (i = 0; i < req->nr_pages; i++)
3856 +- if (req->pages[i])
3857 +- put_page(req->pages[i]);
3858 +- if (req->pages != req->array)
3859 +- kfree(req->pages);
3860 ++ if (req->pages) {
3861 ++ for (i = 0; i < req->nr_pages; i++)
3862 ++ if (req->pages[i])
3863 ++ put_page(req->pages[i]);
3864 ++ if (req->pages != req->array)
3865 ++ kfree(req->pages);
3866 ++ }
3867 + kfree(req);
3868 + }
3869 + }
3870 +diff --git a/fs/afs/vlclient.c b/fs/afs/vlclient.c
3871 +index d7e0fd3c00df..cfb0ac4bd039 100644
3872 +--- a/fs/afs/vlclient.c
3873 ++++ b/fs/afs/vlclient.c
3874 +@@ -56,23 +56,24 @@ static int afs_deliver_vl_get_entry_by_name_u(struct afs_call *call)
3875 + struct afs_uuid__xdr *xdr;
3876 + struct afs_uuid *uuid;
3877 + int j;
3878 ++ int n = entry->nr_servers;
3879 +
3880 + tmp = ntohl(uvldb->serverFlags[i]);
3881 + if (tmp & AFS_VLSF_DONTUSE ||
3882 + (new_only && !(tmp & AFS_VLSF_NEWREPSITE)))
3883 + continue;
3884 + if (tmp & AFS_VLSF_RWVOL) {
3885 +- entry->fs_mask[i] |= AFS_VOL_VTM_RW;
3886 ++ entry->fs_mask[n] |= AFS_VOL_VTM_RW;
3887 + if (vlflags & AFS_VLF_BACKEXISTS)
3888 +- entry->fs_mask[i] |= AFS_VOL_VTM_BAK;
3889 ++ entry->fs_mask[n] |= AFS_VOL_VTM_BAK;
3890 + }
3891 + if (tmp & AFS_VLSF_ROVOL)
3892 +- entry->fs_mask[i] |= AFS_VOL_VTM_RO;
3893 +- if (!entry->fs_mask[i])
3894 ++ entry->fs_mask[n] |= AFS_VOL_VTM_RO;
3895 ++ if (!entry->fs_mask[n])
3896 + continue;
3897 +
3898 + xdr = &uvldb->serverNumber[i];
3899 +- uuid = (struct afs_uuid *)&entry->fs_server[i];
3900 ++ uuid = (struct afs_uuid *)&entry->fs_server[n];
3901 + uuid->time_low = xdr->time_low;
3902 + uuid->time_mid = htons(ntohl(xdr->time_mid));
3903 + uuid->time_hi_and_version = htons(ntohl(xdr->time_hi_and_version));
3904 +diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
3905 +index 5faf057f6f37..b8f472087902 100644
3906 +--- a/fs/btrfs/extent-tree.c
3907 ++++ b/fs/btrfs/extent-tree.c
3908 +@@ -11226,6 +11226,7 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range)
3909 + struct btrfs_device *device;
3910 + struct list_head *devices;
3911 + u64 group_trimmed;
3912 ++ u64 range_end = U64_MAX;
3913 + u64 start;
3914 + u64 end;
3915 + u64 trimmed = 0;
3916 +@@ -11235,16 +11236,23 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range)
3917 + int dev_ret = 0;
3918 + int ret = 0;
3919 +
3920 ++ /*
3921 ++ * Check range overflow if range->len is set.
3922 ++ * The default range->len is U64_MAX.
3923 ++ */
3924 ++ if (range->len != U64_MAX &&
3925 ++ check_add_overflow(range->start, range->len, &range_end))
3926 ++ return -EINVAL;
3927 ++
3928 + cache = btrfs_lookup_first_block_group(fs_info, range->start);
3929 + for (; cache; cache = next_block_group(cache)) {
3930 +- if (cache->key.objectid >= (range->start + range->len)) {
3931 ++ if (cache->key.objectid >= range_end) {
3932 + btrfs_put_block_group(cache);
3933 + break;
3934 + }
3935 +
3936 + start = max(range->start, cache->key.objectid);
3937 +- end = min(range->start + range->len,
3938 +- cache->key.objectid + cache->key.offset);
3939 ++ end = min(range_end, cache->key.objectid + cache->key.offset);
3940 +
3941 + if (end - start >= range->minlen) {
3942 + if (!block_group_cache_done(cache)) {
3943 +diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
3944 +index 0cb442406168..222d7115db71 100644
3945 +--- a/fs/nfs/direct.c
3946 ++++ b/fs/nfs/direct.c
3947 +@@ -401,15 +401,21 @@ static void nfs_direct_read_completion(struct nfs_pgio_header *hdr)
3948 + unsigned long bytes = 0;
3949 + struct nfs_direct_req *dreq = hdr->dreq;
3950 +
3951 +- if (test_bit(NFS_IOHDR_REDO, &hdr->flags))
3952 +- goto out_put;
3953 +-
3954 + spin_lock(&dreq->lock);
3955 +- if (test_bit(NFS_IOHDR_ERROR, &hdr->flags) && (hdr->good_bytes == 0))
3956 ++ if (test_bit(NFS_IOHDR_ERROR, &hdr->flags))
3957 + dreq->error = hdr->error;
3958 +- else
3959 ++
3960 ++ if (test_bit(NFS_IOHDR_REDO, &hdr->flags)) {
3961 ++ spin_unlock(&dreq->lock);
3962 ++ goto out_put;
3963 ++ }
3964 ++
3965 ++ if (hdr->good_bytes != 0)
3966 + nfs_direct_good_bytes(dreq, hdr);
3967 +
3968 ++ if (test_bit(NFS_IOHDR_EOF, &hdr->flags))
3969 ++ dreq->error = 0;
3970 ++
3971 + spin_unlock(&dreq->lock);
3972 +
3973 + while (!list_empty(&hdr->pages)) {
3974 +@@ -782,16 +788,19 @@ static void nfs_direct_write_completion(struct nfs_pgio_header *hdr)
3975 + bool request_commit = false;
3976 + struct nfs_page *req = nfs_list_entry(hdr->pages.next);
3977 +
3978 +- if (test_bit(NFS_IOHDR_REDO, &hdr->flags))
3979 +- goto out_put;
3980 +-
3981 + nfs_init_cinfo_from_dreq(&cinfo, dreq);
3982 +
3983 + spin_lock(&dreq->lock);
3984 +
3985 + if (test_bit(NFS_IOHDR_ERROR, &hdr->flags))
3986 + dreq->error = hdr->error;
3987 +- if (dreq->error == 0) {
3988 ++
3989 ++ if (test_bit(NFS_IOHDR_REDO, &hdr->flags)) {
3990 ++ spin_unlock(&dreq->lock);
3991 ++ goto out_put;
3992 ++ }
3993 ++
3994 ++ if (hdr->good_bytes != 0) {
3995 + nfs_direct_good_bytes(dreq, hdr);
3996 + if (nfs_write_need_commit(hdr)) {
3997 + if (dreq->flags == NFS_ODIRECT_RESCHED_WRITES)
3998 +diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c
3999 +index bcff3bf5ae09..c67cdbb36ce7 100644
4000 +--- a/fs/nfs/flexfilelayout/flexfilelayout.c
4001 ++++ b/fs/nfs/flexfilelayout/flexfilelayout.c
4002 +@@ -1128,8 +1128,6 @@ static int ff_layout_async_handle_error_v4(struct rpc_task *task,
4003 + break;
4004 + case -NFS4ERR_RETRY_UNCACHED_REP:
4005 + break;
4006 +- case -EAGAIN:
4007 +- return -NFS4ERR_RESET_TO_PNFS;
4008 + /* Invalidate Layout errors */
4009 + case -NFS4ERR_PNFS_NO_LAYOUT:
4010 + case -ESTALE: /* mapped NFS4ERR_STALE */
4011 +@@ -1190,7 +1188,6 @@ static int ff_layout_async_handle_error_v3(struct rpc_task *task,
4012 + case -EBADHANDLE:
4013 + case -ELOOP:
4014 + case -ENOSPC:
4015 +- case -EAGAIN:
4016 + break;
4017 + case -EJUKEBOX:
4018 + nfs_inc_stats(lseg->pls_layout->plh_inode, NFSIOS_DELAY);
4019 +@@ -1425,16 +1422,6 @@ static void ff_layout_read_prepare_v4(struct rpc_task *task, void *data)
4020 + ff_layout_read_prepare_common(task, hdr);
4021 + }
4022 +
4023 +-static void
4024 +-ff_layout_io_prepare_transmit(struct rpc_task *task,
4025 +- void *data)
4026 +-{
4027 +- struct nfs_pgio_header *hdr = data;
4028 +-
4029 +- if (!pnfs_is_valid_lseg(hdr->lseg))
4030 +- rpc_exit(task, -EAGAIN);
4031 +-}
4032 +-
4033 + static void ff_layout_read_call_done(struct rpc_task *task, void *data)
4034 + {
4035 + struct nfs_pgio_header *hdr = data;
4036 +@@ -1720,7 +1707,6 @@ static void ff_layout_commit_release(void *data)
4037 +
4038 + static const struct rpc_call_ops ff_layout_read_call_ops_v3 = {
4039 + .rpc_call_prepare = ff_layout_read_prepare_v3,
4040 +- .rpc_call_prepare_transmit = ff_layout_io_prepare_transmit,
4041 + .rpc_call_done = ff_layout_read_call_done,
4042 + .rpc_count_stats = ff_layout_read_count_stats,
4043 + .rpc_release = ff_layout_read_release,
4044 +@@ -1728,7 +1714,6 @@ static const struct rpc_call_ops ff_layout_read_call_ops_v3 = {
4045 +
4046 + static const struct rpc_call_ops ff_layout_read_call_ops_v4 = {
4047 + .rpc_call_prepare = ff_layout_read_prepare_v4,
4048 +- .rpc_call_prepare_transmit = ff_layout_io_prepare_transmit,
4049 + .rpc_call_done = ff_layout_read_call_done,
4050 + .rpc_count_stats = ff_layout_read_count_stats,
4051 + .rpc_release = ff_layout_read_release,
4052 +@@ -1736,7 +1721,6 @@ static const struct rpc_call_ops ff_layout_read_call_ops_v4 = {
4053 +
4054 + static const struct rpc_call_ops ff_layout_write_call_ops_v3 = {
4055 + .rpc_call_prepare = ff_layout_write_prepare_v3,
4056 +- .rpc_call_prepare_transmit = ff_layout_io_prepare_transmit,
4057 + .rpc_call_done = ff_layout_write_call_done,
4058 + .rpc_count_stats = ff_layout_write_count_stats,
4059 + .rpc_release = ff_layout_write_release,
4060 +@@ -1744,7 +1728,6 @@ static const struct rpc_call_ops ff_layout_write_call_ops_v3 = {
4061 +
4062 + static const struct rpc_call_ops ff_layout_write_call_ops_v4 = {
4063 + .rpc_call_prepare = ff_layout_write_prepare_v4,
4064 +- .rpc_call_prepare_transmit = ff_layout_io_prepare_transmit,
4065 + .rpc_call_done = ff_layout_write_call_done,
4066 + .rpc_count_stats = ff_layout_write_count_stats,
4067 + .rpc_release = ff_layout_write_release,
4068 +diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
4069 +index 6ef5278326b6..8b6211753228 100644
4070 +--- a/fs/nfs/pagelist.c
4071 ++++ b/fs/nfs/pagelist.c
4072 +@@ -1253,20 +1253,23 @@ static void nfs_pageio_complete_mirror(struct nfs_pageio_descriptor *desc,
4073 + int nfs_pageio_resend(struct nfs_pageio_descriptor *desc,
4074 + struct nfs_pgio_header *hdr)
4075 + {
4076 +- LIST_HEAD(failed);
4077 ++ LIST_HEAD(pages);
4078 +
4079 + desc->pg_io_completion = hdr->io_completion;
4080 + desc->pg_dreq = hdr->dreq;
4081 +- while (!list_empty(&hdr->pages)) {
4082 +- struct nfs_page *req = nfs_list_entry(hdr->pages.next);
4083 ++ list_splice_init(&hdr->pages, &pages);
4084 ++ while (!list_empty(&pages)) {
4085 ++ struct nfs_page *req = nfs_list_entry(pages.next);
4086 +
4087 + if (!nfs_pageio_add_request(desc, req))
4088 +- nfs_list_move_request(req, &failed);
4089 ++ break;
4090 + }
4091 + nfs_pageio_complete(desc);
4092 +- if (!list_empty(&failed)) {
4093 +- list_move(&failed, &hdr->pages);
4094 +- return desc->pg_error < 0 ? desc->pg_error : -EIO;
4095 ++ if (!list_empty(&pages)) {
4096 ++ int err = desc->pg_error < 0 ? desc->pg_error : -EIO;
4097 ++ hdr->completion_ops->error_cleanup(&pages, err);
4098 ++ nfs_set_pgio_error(hdr, err, hdr->io_start);
4099 ++ return err;
4100 + }
4101 + return 0;
4102 + }
4103 +diff --git a/include/linux/logic_pio.h b/include/linux/logic_pio.h
4104 +index cbd9d8495690..88e1e6304a71 100644
4105 +--- a/include/linux/logic_pio.h
4106 ++++ b/include/linux/logic_pio.h
4107 +@@ -117,6 +117,7 @@ struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode);
4108 + unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,
4109 + resource_size_t hw_addr, resource_size_t size);
4110 + int logic_pio_register_range(struct logic_pio_hwaddr *newrange);
4111 ++void logic_pio_unregister_range(struct logic_pio_hwaddr *range);
4112 + resource_size_t logic_pio_to_hwaddr(unsigned long pio);
4113 + unsigned long logic_pio_trans_cpuaddr(resource_size_t hw_addr);
4114 +
4115 +diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
4116 +index d0e451868f02..c72dfd518782 100644
4117 +--- a/include/linux/sunrpc/sched.h
4118 ++++ b/include/linux/sunrpc/sched.h
4119 +@@ -98,7 +98,6 @@ typedef void (*rpc_action)(struct rpc_task *);
4120 +
4121 + struct rpc_call_ops {
4122 + void (*rpc_call_prepare)(struct rpc_task *, void *);
4123 +- void (*rpc_call_prepare_transmit)(struct rpc_task *, void *);
4124 + void (*rpc_call_done)(struct rpc_task *, void *);
4125 + void (*rpc_count_stats)(struct rpc_task *, void *);
4126 + void (*rpc_release)(void *);
4127 +diff --git a/include/net/addrconf.h b/include/net/addrconf.h
4128 +index becdad576859..3f62b347b04a 100644
4129 +--- a/include/net/addrconf.h
4130 ++++ b/include/net/addrconf.h
4131 +@@ -206,7 +206,7 @@ static inline int ipv6_mc_may_pull(struct sk_buff *skb,
4132 + unsigned int len)
4133 + {
4134 + if (skb_transport_offset(skb) + ipv6_transport_len(skb) < len)
4135 +- return -EINVAL;
4136 ++ return 0;
4137 +
4138 + return pskb_may_pull(skb, len);
4139 + }
4140 +diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
4141 +index 42d17f730780..d2146277071f 100644
4142 +--- a/kernel/bpf/syscall.c
4143 ++++ b/kernel/bpf/syscall.c
4144 +@@ -1686,20 +1686,26 @@ static int bpf_prog_load(union bpf_attr *attr, union bpf_attr __user *uattr)
4145 + if (err)
4146 + goto free_used_maps;
4147 +
4148 +- err = bpf_prog_new_fd(prog);
4149 +- if (err < 0) {
4150 +- /* failed to allocate fd.
4151 +- * bpf_prog_put() is needed because the above
4152 +- * bpf_prog_alloc_id() has published the prog
4153 +- * to the userspace and the userspace may
4154 +- * have refcnt-ed it through BPF_PROG_GET_FD_BY_ID.
4155 +- */
4156 +- bpf_prog_put(prog);
4157 +- return err;
4158 +- }
4159 +-
4160 ++ /* Upon success of bpf_prog_alloc_id(), the BPF prog is
4161 ++ * effectively publicly exposed. However, retrieving via
4162 ++ * bpf_prog_get_fd_by_id() will take another reference,
4163 ++ * therefore it cannot be gone underneath us.
4164 ++ *
4165 ++ * Only for the time /after/ successful bpf_prog_new_fd()
4166 ++ * and before returning to userspace, we might just hold
4167 ++ * one reference and any parallel close on that fd could
4168 ++ * rip everything out. Hence, below notifications must
4169 ++ * happen before bpf_prog_new_fd().
4170 ++ *
4171 ++ * Also, any failure handling from this point onwards must
4172 ++ * be using bpf_prog_put() given the program is exposed.
4173 ++ */
4174 + bpf_prog_kallsyms_add(prog);
4175 + perf_event_bpf_event(prog, PERF_BPF_EVENT_PROG_LOAD, 0);
4176 ++
4177 ++ err = bpf_prog_new_fd(prog);
4178 ++ if (err < 0)
4179 ++ bpf_prog_put(prog);
4180 + return err;
4181 +
4182 + free_used_maps:
4183 +diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
4184 +index 2c2772e9702a..9912be7a970d 100644
4185 +--- a/kernel/dma/direct.c
4186 ++++ b/kernel/dma/direct.c
4187 +@@ -55,9 +55,6 @@ u64 dma_direct_get_required_mask(struct device *dev)
4188 + {
4189 + u64 max_dma = phys_to_dma_direct(dev, (max_pfn - 1) << PAGE_SHIFT);
4190 +
4191 +- if (dev->bus_dma_mask && dev->bus_dma_mask < max_dma)
4192 +- max_dma = dev->bus_dma_mask;
4193 +-
4194 + return (1ULL << (fls64(max_dma) - 1)) * 2 - 1;
4195 + }
4196 +
4197 +diff --git a/kernel/locking/rwsem-xadd.c b/kernel/locking/rwsem-xadd.c
4198 +index 0b1f77957240..385ebcfc31a6 100644
4199 +--- a/kernel/locking/rwsem-xadd.c
4200 ++++ b/kernel/locking/rwsem-xadd.c
4201 +@@ -454,6 +454,8 @@ __rwsem_down_read_failed_common(struct rw_semaphore *sem, int state)
4202 + * been set in the count.
4203 + */
4204 + if (atomic_long_read(&sem->count) >= 0) {
4205 ++ /* Provide lock ACQUIRE */
4206 ++ smp_acquire__after_ctrl_dep();
4207 + raw_spin_unlock_irq(&sem->wait_lock);
4208 + rwsem_set_reader_owned(sem);
4209 + lockevent_inc(rwsem_rlock_fast);
4210 +@@ -483,8 +485,10 @@ __rwsem_down_read_failed_common(struct rw_semaphore *sem, int state)
4211 + /* wait to be given the lock */
4212 + while (true) {
4213 + set_current_state(state);
4214 +- if (!waiter.task)
4215 ++ if (!smp_load_acquire(&waiter.task)) {
4216 ++ /* Orders against rwsem_mark_wake()'s smp_store_release() */
4217 + break;
4218 ++ }
4219 + if (signal_pending_state(state, current)) {
4220 + raw_spin_lock_irq(&sem->wait_lock);
4221 + if (waiter.task)
4222 +diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
4223 +index 208220d526e8..2373311b4a43 100644
4224 +--- a/kernel/trace/ftrace.c
4225 ++++ b/kernel/trace/ftrace.c
4226 +@@ -3095,6 +3095,14 @@ t_probe_next(struct seq_file *m, loff_t *pos)
4227 + hnd = &iter->probe_entry->hlist;
4228 +
4229 + hash = iter->probe->ops.func_hash->filter_hash;
4230 ++
4231 ++ /*
4232 ++ * A probe being registered may temporarily have an empty hash
4233 ++ * and it's at the end of the func_probes list.
4234 ++ */
4235 ++ if (!hash || hash == EMPTY_HASH)
4236 ++ return NULL;
4237 ++
4238 + size = 1 << hash->size_bits;
4239 +
4240 + retry:
4241 +@@ -4320,12 +4328,21 @@ register_ftrace_function_probe(char *glob, struct trace_array *tr,
4242 +
4243 + mutex_unlock(&ftrace_lock);
4244 +
4245 ++ /*
4246 ++ * Note, there's a small window here that the func_hash->filter_hash
4247 ++ * may be NULL or empty. Need to be carefule when reading the loop.
4248 ++ */
4249 + mutex_lock(&probe->ops.func_hash->regex_lock);
4250 +
4251 + orig_hash = &probe->ops.func_hash->filter_hash;
4252 + old_hash = *orig_hash;
4253 + hash = alloc_and_copy_ftrace_hash(FTRACE_HASH_DEFAULT_BITS, old_hash);
4254 +
4255 ++ if (!hash) {
4256 ++ ret = -ENOMEM;
4257 ++ goto out;
4258 ++ }
4259 ++
4260 + ret = ftrace_match_records(hash, glob, strlen(glob));
4261 +
4262 + /* Nothing found? */
4263 +diff --git a/lib/logic_pio.c b/lib/logic_pio.c
4264 +index feea48fd1a0d..905027574e5d 100644
4265 +--- a/lib/logic_pio.c
4266 ++++ b/lib/logic_pio.c
4267 +@@ -35,7 +35,7 @@ int logic_pio_register_range(struct logic_pio_hwaddr *new_range)
4268 + struct logic_pio_hwaddr *range;
4269 + resource_size_t start;
4270 + resource_size_t end;
4271 +- resource_size_t mmio_sz = 0;
4272 ++ resource_size_t mmio_end = 0;
4273 + resource_size_t iio_sz = MMIO_UPPER_LIMIT;
4274 + int ret = 0;
4275 +
4276 +@@ -46,7 +46,7 @@ int logic_pio_register_range(struct logic_pio_hwaddr *new_range)
4277 + end = new_range->hw_start + new_range->size;
4278 +
4279 + mutex_lock(&io_range_mutex);
4280 +- list_for_each_entry_rcu(range, &io_range_list, list) {
4281 ++ list_for_each_entry(range, &io_range_list, list) {
4282 + if (range->fwnode == new_range->fwnode) {
4283 + /* range already there */
4284 + goto end_register;
4285 +@@ -56,7 +56,7 @@ int logic_pio_register_range(struct logic_pio_hwaddr *new_range)
4286 + /* for MMIO ranges we need to check for overlap */
4287 + if (start >= range->hw_start + range->size ||
4288 + end < range->hw_start) {
4289 +- mmio_sz += range->size;
4290 ++ mmio_end = range->io_start + range->size;
4291 + } else {
4292 + ret = -EFAULT;
4293 + goto end_register;
4294 +@@ -69,16 +69,16 @@ int logic_pio_register_range(struct logic_pio_hwaddr *new_range)
4295 +
4296 + /* range not registered yet, check for available space */
4297 + if (new_range->flags == LOGIC_PIO_CPU_MMIO) {
4298 +- if (mmio_sz + new_range->size - 1 > MMIO_UPPER_LIMIT) {
4299 ++ if (mmio_end + new_range->size - 1 > MMIO_UPPER_LIMIT) {
4300 + /* if it's too big check if 64K space can be reserved */
4301 +- if (mmio_sz + SZ_64K - 1 > MMIO_UPPER_LIMIT) {
4302 ++ if (mmio_end + SZ_64K - 1 > MMIO_UPPER_LIMIT) {
4303 + ret = -E2BIG;
4304 + goto end_register;
4305 + }
4306 + new_range->size = SZ_64K;
4307 + pr_warn("Requested IO range too big, new size set to 64K\n");
4308 + }
4309 +- new_range->io_start = mmio_sz;
4310 ++ new_range->io_start = mmio_end;
4311 + } else if (new_range->flags == LOGIC_PIO_INDIRECT) {
4312 + if (iio_sz + new_range->size - 1 > IO_SPACE_LIMIT) {
4313 + ret = -E2BIG;
4314 +@@ -98,6 +98,20 @@ end_register:
4315 + return ret;
4316 + }
4317 +
4318 ++/**
4319 ++ * logic_pio_unregister_range - unregister a logical PIO range for a host
4320 ++ * @range: pointer to the IO range which has been already registered.
4321 ++ *
4322 ++ * Unregister a previously-registered IO range node.
4323 ++ */
4324 ++void logic_pio_unregister_range(struct logic_pio_hwaddr *range)
4325 ++{
4326 ++ mutex_lock(&io_range_mutex);
4327 ++ list_del_rcu(&range->list);
4328 ++ mutex_unlock(&io_range_mutex);
4329 ++ synchronize_rcu();
4330 ++}
4331 ++
4332 + /**
4333 + * find_io_range_by_fwnode - find logical PIO range for given FW node
4334 + * @fwnode: FW node handle associated with logical PIO range
4335 +@@ -108,26 +122,38 @@ end_register:
4336 + */
4337 + struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode)
4338 + {
4339 +- struct logic_pio_hwaddr *range;
4340 ++ struct logic_pio_hwaddr *range, *found_range = NULL;
4341 +
4342 ++ rcu_read_lock();
4343 + list_for_each_entry_rcu(range, &io_range_list, list) {
4344 +- if (range->fwnode == fwnode)
4345 +- return range;
4346 ++ if (range->fwnode == fwnode) {
4347 ++ found_range = range;
4348 ++ break;
4349 ++ }
4350 + }
4351 +- return NULL;
4352 ++ rcu_read_unlock();
4353 ++
4354 ++ return found_range;
4355 + }
4356 +
4357 + /* Return a registered range given an input PIO token */
4358 + static struct logic_pio_hwaddr *find_io_range(unsigned long pio)
4359 + {
4360 +- struct logic_pio_hwaddr *range;
4361 ++ struct logic_pio_hwaddr *range, *found_range = NULL;
4362 +
4363 ++ rcu_read_lock();
4364 + list_for_each_entry_rcu(range, &io_range_list, list) {
4365 +- if (in_range(pio, range->io_start, range->size))
4366 +- return range;
4367 ++ if (in_range(pio, range->io_start, range->size)) {
4368 ++ found_range = range;
4369 ++ break;
4370 ++ }
4371 + }
4372 +- pr_err("PIO entry token %lx invalid\n", pio);
4373 +- return NULL;
4374 ++ rcu_read_unlock();
4375 ++
4376 ++ if (!found_range)
4377 ++ pr_err("PIO entry token 0x%lx invalid\n", pio);
4378 ++
4379 ++ return found_range;
4380 + }
4381 +
4382 + /**
4383 +@@ -180,14 +206,23 @@ unsigned long logic_pio_trans_cpuaddr(resource_size_t addr)
4384 + {
4385 + struct logic_pio_hwaddr *range;
4386 +
4387 ++ rcu_read_lock();
4388 + list_for_each_entry_rcu(range, &io_range_list, list) {
4389 + if (range->flags != LOGIC_PIO_CPU_MMIO)
4390 + continue;
4391 +- if (in_range(addr, range->hw_start, range->size))
4392 +- return addr - range->hw_start + range->io_start;
4393 ++ if (in_range(addr, range->hw_start, range->size)) {
4394 ++ unsigned long cpuaddr;
4395 ++
4396 ++ cpuaddr = addr - range->hw_start + range->io_start;
4397 ++
4398 ++ rcu_read_unlock();
4399 ++ return cpuaddr;
4400 ++ }
4401 + }
4402 +- pr_err("addr %llx not registered in io_range_list\n",
4403 +- (unsigned long long) addr);
4404 ++ rcu_read_unlock();
4405 ++
4406 ++ pr_err("addr %pa not registered in io_range_list\n", &addr);
4407 ++
4408 + return ~0UL;
4409 + }
4410 +
4411 +diff --git a/mm/memcontrol.c b/mm/memcontrol.c
4412 +index bb783c27ba21..30ebecf67527 100644
4413 +--- a/mm/memcontrol.c
4414 ++++ b/mm/memcontrol.c
4415 +@@ -748,15 +748,13 @@ void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx,
4416 + /* Update memcg */
4417 + __mod_memcg_state(memcg, idx, val);
4418 +
4419 ++ /* Update lruvec */
4420 ++ __this_cpu_add(pn->lruvec_stat_local->count[idx], val);
4421 ++
4422 + x = val + __this_cpu_read(pn->lruvec_stat_cpu->count[idx]);
4423 + if (unlikely(abs(x) > MEMCG_CHARGE_BATCH)) {
4424 + struct mem_cgroup_per_node *pi;
4425 +
4426 +- /*
4427 +- * Batch local counters to keep them in sync with
4428 +- * the hierarchical ones.
4429 +- */
4430 +- __this_cpu_add(pn->lruvec_stat_local->count[idx], x);
4431 + for (pi = pn; pi; pi = parent_nodeinfo(pi, pgdat->node_id))
4432 + atomic_long_add(x, &pi->lruvec_stat[idx]);
4433 + x = 0;
4434 +@@ -3161,7 +3159,7 @@ static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg)
4435 +
4436 + for_each_online_cpu(cpu)
4437 + for (i = 0; i < MEMCG_NR_STAT; i++)
4438 +- stat[i] += raw_cpu_read(memcg->vmstats_percpu->stat[i]);
4439 ++ stat[i] += per_cpu(memcg->vmstats_percpu->stat[i], cpu);
4440 +
4441 + for (mi = memcg; mi; mi = parent_mem_cgroup(mi))
4442 + for (i = 0; i < MEMCG_NR_STAT; i++)
4443 +@@ -3176,8 +3174,8 @@ static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg)
4444 +
4445 + for_each_online_cpu(cpu)
4446 + for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
4447 +- stat[i] += raw_cpu_read(
4448 +- pn->lruvec_stat_cpu->count[i]);
4449 ++ stat[i] += per_cpu(
4450 ++ pn->lruvec_stat_cpu->count[i], cpu);
4451 +
4452 + for (pi = pn; pi; pi = parent_nodeinfo(pi, node))
4453 + for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
4454 +@@ -3196,8 +3194,8 @@ static void memcg_flush_percpu_vmevents(struct mem_cgroup *memcg)
4455 +
4456 + for_each_online_cpu(cpu)
4457 + for (i = 0; i < NR_VM_EVENT_ITEMS; i++)
4458 +- events[i] += raw_cpu_read(
4459 +- memcg->vmstats_percpu->events[i]);
4460 ++ events[i] += per_cpu(memcg->vmstats_percpu->events[i],
4461 ++ cpu);
4462 +
4463 + for (mi = memcg; mi; mi = parent_mem_cgroup(mi))
4464 + for (i = 0; i < NR_VM_EVENT_ITEMS; i++)
4465 +diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
4466 +index 515b00801af2..7d62ef2daf83 100644
4467 +--- a/mm/zsmalloc.c
4468 ++++ b/mm/zsmalloc.c
4469 +@@ -2432,7 +2432,9 @@ struct zs_pool *zs_create_pool(const char *name)
4470 + if (!pool->name)
4471 + goto err;
4472 +
4473 ++#ifdef CONFIG_COMPACTION
4474 + init_waitqueue_head(&pool->migration_wait);
4475 ++#endif
4476 +
4477 + if (create_cache(pool))
4478 + goto err;
4479 +diff --git a/net/core/stream.c b/net/core/stream.c
4480 +index e94bb02a5629..4f1d4aa5fb38 100644
4481 +--- a/net/core/stream.c
4482 ++++ b/net/core/stream.c
4483 +@@ -120,7 +120,6 @@ int sk_stream_wait_memory(struct sock *sk, long *timeo_p)
4484 + int err = 0;
4485 + long vm_wait = 0;
4486 + long current_timeo = *timeo_p;
4487 +- bool noblock = (*timeo_p ? false : true);
4488 + DEFINE_WAIT_FUNC(wait, woken_wake_function);
4489 +
4490 + if (sk_stream_memory_free(sk))
4491 +@@ -133,11 +132,8 @@ int sk_stream_wait_memory(struct sock *sk, long *timeo_p)
4492 +
4493 + if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN))
4494 + goto do_error;
4495 +- if (!*timeo_p) {
4496 +- if (noblock)
4497 +- set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
4498 +- goto do_nonblock;
4499 +- }
4500 ++ if (!*timeo_p)
4501 ++ goto do_eagain;
4502 + if (signal_pending(current))
4503 + goto do_interrupted;
4504 + sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk);
4505 +@@ -169,7 +165,13 @@ out:
4506 + do_error:
4507 + err = -EPIPE;
4508 + goto out;
4509 +-do_nonblock:
4510 ++do_eagain:
4511 ++ /* Make sure that whenever EAGAIN is returned, EPOLLOUT event can
4512 ++ * be generated later.
4513 ++ * When TCP receives ACK packets that make room, tcp_check_space()
4514 ++ * only calls tcp_new_space() if SOCK_NOSPACE is set.
4515 ++ */
4516 ++ set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
4517 + err = -EAGAIN;
4518 + goto out;
4519 + do_interrupted:
4520 +diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
4521 +index 15c72065df79..08c02dbb3d69 100644
4522 +--- a/net/hsr/hsr_device.c
4523 ++++ b/net/hsr/hsr_device.c
4524 +@@ -229,7 +229,6 @@ static int hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)
4525 + master = hsr_port_get_hsr(hsr, HSR_PT_MASTER);
4526 + skb->dev = master->dev;
4527 + hsr_forward_skb(skb, master);
4528 +-
4529 + return NETDEV_TX_OK;
4530 + }
4531 +
4532 +@@ -344,8 +343,9 @@ static void hsr_announce(struct timer_list *t)
4533 + rcu_read_unlock();
4534 + }
4535 +
4536 +-/* According to comments in the declaration of struct net_device, this function
4537 +- * is "Called from unregister, can be used to call free_netdev". Ok then...
4538 ++/* This has to be called after all the readers are gone.
4539 ++ * Otherwise we would have to check the return value of
4540 ++ * hsr_port_get_hsr().
4541 + */
4542 + static void hsr_dev_destroy(struct net_device *hsr_dev)
4543 + {
4544 +@@ -356,15 +356,14 @@ static void hsr_dev_destroy(struct net_device *hsr_dev)
4545 +
4546 + hsr_debugfs_term(hsr);
4547 +
4548 +- rtnl_lock();
4549 + hsr_for_each_port(hsr, port)
4550 + hsr_del_port(port);
4551 +- rtnl_unlock();
4552 +
4553 + del_timer_sync(&hsr->prune_timer);
4554 + del_timer_sync(&hsr->announce_timer);
4555 +
4556 +- synchronize_rcu();
4557 ++ hsr_del_self_node(&hsr->self_node_db);
4558 ++ hsr_del_nodes(&hsr->node_db);
4559 + }
4560 +
4561 + static const struct net_device_ops hsr_device_ops = {
4562 +@@ -373,6 +372,7 @@ static const struct net_device_ops hsr_device_ops = {
4563 + .ndo_stop = hsr_dev_close,
4564 + .ndo_start_xmit = hsr_dev_xmit,
4565 + .ndo_fix_features = hsr_fix_features,
4566 ++ .ndo_uninit = hsr_dev_destroy,
4567 + };
4568 +
4569 + static struct device_type hsr_type = {
4570 +@@ -391,7 +391,6 @@ void hsr_dev_setup(struct net_device *dev)
4571 + dev->priv_flags |= IFF_NO_QUEUE;
4572 +
4573 + dev->needs_free_netdev = true;
4574 +- dev->priv_destructor = hsr_dev_destroy;
4575 +
4576 + dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA |
4577 + NETIF_F_GSO_MASK | NETIF_F_HW_CSUM |
4578 +@@ -495,7 +494,7 @@ fail:
4579 + hsr_for_each_port(hsr, port)
4580 + hsr_del_port(port);
4581 + err_add_port:
4582 +- hsr_del_node(&hsr->self_node_db);
4583 ++ hsr_del_self_node(&hsr->self_node_db);
4584 +
4585 + return res;
4586 + }
4587 +diff --git a/net/hsr/hsr_framereg.c b/net/hsr/hsr_framereg.c
4588 +index 2d7a19750436..292be446007b 100644
4589 +--- a/net/hsr/hsr_framereg.c
4590 ++++ b/net/hsr/hsr_framereg.c
4591 +@@ -104,7 +104,7 @@ int hsr_create_self_node(struct list_head *self_node_db,
4592 + return 0;
4593 + }
4594 +
4595 +-void hsr_del_node(struct list_head *self_node_db)
4596 ++void hsr_del_self_node(struct list_head *self_node_db)
4597 + {
4598 + struct hsr_node *node;
4599 +
4600 +@@ -117,6 +117,15 @@ void hsr_del_node(struct list_head *self_node_db)
4601 + }
4602 + }
4603 +
4604 ++void hsr_del_nodes(struct list_head *node_db)
4605 ++{
4606 ++ struct hsr_node *node;
4607 ++ struct hsr_node *tmp;
4608 ++
4609 ++ list_for_each_entry_safe(node, tmp, node_db, mac_list)
4610 ++ kfree(node);
4611 ++}
4612 ++
4613 + /* Allocate an hsr_node and add it to node_db. 'addr' is the node's address_A;
4614 + * seq_out is used to initialize filtering of outgoing duplicate frames
4615 + * originating from the newly added node.
4616 +diff --git a/net/hsr/hsr_framereg.h b/net/hsr/hsr_framereg.h
4617 +index a3bdcdab469d..89a3ce38151d 100644
4618 +--- a/net/hsr/hsr_framereg.h
4619 ++++ b/net/hsr/hsr_framereg.h
4620 +@@ -12,7 +12,8 @@
4621 +
4622 + struct hsr_node;
4623 +
4624 +-void hsr_del_node(struct list_head *self_node_db);
4625 ++void hsr_del_self_node(struct list_head *self_node_db);
4626 ++void hsr_del_nodes(struct list_head *node_db);
4627 + struct hsr_node *hsr_add_node(struct list_head *node_db, unsigned char addr[],
4628 + u16 seq_out);
4629 + struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb,
4630 +diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
4631 +index 7c857c72aad1..92b3d2d1139e 100644
4632 +--- a/net/ipv4/icmp.c
4633 ++++ b/net/ipv4/icmp.c
4634 +@@ -582,7 +582,13 @@ void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
4635 +
4636 + if (!rt)
4637 + goto out;
4638 +- net = dev_net(rt->dst.dev);
4639 ++
4640 ++ if (rt->dst.dev)
4641 ++ net = dev_net(rt->dst.dev);
4642 ++ else if (skb_in->dev)
4643 ++ net = dev_net(skb_in->dev);
4644 ++ else
4645 ++ goto out;
4646 +
4647 + /*
4648 + * Find the original header. It is expected to be valid, of course.
4649 +diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
4650 +index 85107bf812f2..b5b0834ec5ee 100644
4651 +--- a/net/ipv4/igmp.c
4652 ++++ b/net/ipv4/igmp.c
4653 +@@ -1474,7 +1474,7 @@ EXPORT_SYMBOL(__ip_mc_inc_group);
4654 +
4655 + void ip_mc_inc_group(struct in_device *in_dev, __be32 addr)
4656 + {
4657 +- __ip_mc_inc_group(in_dev, addr, MCAST_EXCLUDE);
4658 ++ __ip_mc_inc_group(in_dev, addr, GFP_KERNEL);
4659 + }
4660 + EXPORT_SYMBOL(ip_mc_inc_group);
4661 +
4662 +@@ -2196,7 +2196,7 @@ static int __ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr,
4663 + iml->sflist = NULL;
4664 + iml->sfmode = mode;
4665 + rcu_assign_pointer(inet->mc_list, iml);
4666 +- __ip_mc_inc_group(in_dev, addr, mode);
4667 ++ ____ip_mc_inc_group(in_dev, addr, mode, GFP_KERNEL);
4668 + err = 0;
4669 + done:
4670 + return err;
4671 +diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
4672 +index 081bb517e40d..2454fce6fbfa 100644
4673 +--- a/net/ipv6/addrconf.c
4674 ++++ b/net/ipv6/addrconf.c
4675 +@@ -1045,7 +1045,8 @@ ipv6_add_addr(struct inet6_dev *idev, struct ifa6_config *cfg,
4676 + int err = 0;
4677 +
4678 + if (addr_type == IPV6_ADDR_ANY ||
4679 +- addr_type & IPV6_ADDR_MULTICAST ||
4680 ++ (addr_type & IPV6_ADDR_MULTICAST &&
4681 ++ !(cfg->ifa_flags & IFA_F_MCAUTOJOIN)) ||
4682 + (!(idev->dev->flags & IFF_LOOPBACK) &&
4683 + !netif_is_l3_master(idev->dev) &&
4684 + addr_type & IPV6_ADDR_LOOPBACK))
4685 +diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
4686 +index b8288125e05d..1c55d3b7bc15 100644
4687 +--- a/net/mac80211/cfg.c
4688 ++++ b/net/mac80211/cfg.c
4689 +@@ -1543,6 +1543,11 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
4690 + if (is_multicast_ether_addr(mac))
4691 + return -EINVAL;
4692 +
4693 ++ if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER) &&
4694 ++ sdata->vif.type == NL80211_IFTYPE_STATION &&
4695 ++ !sdata->u.mgd.associated)
4696 ++ return -EINVAL;
4697 ++
4698 + sta = sta_info_alloc(sdata, mac, GFP_KERNEL);
4699 + if (!sta)
4700 + return -ENOMEM;
4701 +@@ -1550,10 +1555,6 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
4702 + if (params->sta_flags_set & BIT(NL80211_STA_FLAG_TDLS_PEER))
4703 + sta->sta.tdls = true;
4704 +
4705 +- if (sta->sta.tdls && sdata->vif.type == NL80211_IFTYPE_STATION &&
4706 +- !sdata->u.mgd.associated)
4707 +- return -EINVAL;
4708 +-
4709 + err = sta_apply_parameters(local, sta, params);
4710 + if (err) {
4711 + sta_info_free(local, sta);
4712 +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
4713 +index 3c1ab870fefe..768d14c9a716 100644
4714 +--- a/net/mac80211/rx.c
4715 ++++ b/net/mac80211/rx.c
4716 +@@ -2447,11 +2447,13 @@ static void ieee80211_deliver_skb_to_local_stack(struct sk_buff *skb,
4717 + skb->protocol == cpu_to_be16(ETH_P_PREAUTH)) &&
4718 + sdata->control_port_over_nl80211)) {
4719 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
4720 +- bool noencrypt = status->flag & RX_FLAG_DECRYPTED;
4721 ++ bool noencrypt = !(status->flag & RX_FLAG_DECRYPTED);
4722 +
4723 + cfg80211_rx_control_port(dev, skb, noencrypt);
4724 + dev_kfree_skb(skb);
4725 + } else {
4726 ++ memset(skb->cb, 0, sizeof(skb->cb));
4727 ++
4728 + /* deliver to local stack */
4729 + if (rx->napi)
4730 + napi_gro_receive(rx->napi, skb);
4731 +@@ -2546,8 +2548,6 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
4732 +
4733 + if (skb) {
4734 + skb->protocol = eth_type_trans(skb, dev);
4735 +- memset(skb->cb, 0, sizeof(skb->cb));
4736 +-
4737 + ieee80211_deliver_skb_to_local_stack(skb, rx);
4738 + }
4739 +
4740 +diff --git a/net/mpls/mpls_iptunnel.c b/net/mpls/mpls_iptunnel.c
4741 +index d25e91d7bdc1..44b675016393 100644
4742 +--- a/net/mpls/mpls_iptunnel.c
4743 ++++ b/net/mpls/mpls_iptunnel.c
4744 +@@ -133,12 +133,12 @@ static int mpls_xmit(struct sk_buff *skb)
4745 + mpls_stats_inc_outucastpkts(out_dev, skb);
4746 +
4747 + if (rt) {
4748 +- if (rt->rt_gw_family == AF_INET)
4749 +- err = neigh_xmit(NEIGH_ARP_TABLE, out_dev, &rt->rt_gw4,
4750 +- skb);
4751 +- else if (rt->rt_gw_family == AF_INET6)
4752 ++ if (rt->rt_gw_family == AF_INET6)
4753 + err = neigh_xmit(NEIGH_ND_TABLE, out_dev, &rt->rt_gw6,
4754 + skb);
4755 ++ else
4756 ++ err = neigh_xmit(NEIGH_ARP_TABLE, out_dev, &rt->rt_gw4,
4757 ++ skb);
4758 + } else if (rt6) {
4759 + if (ipv6_addr_v4mapped(&rt6->rt6i_gateway)) {
4760 + /* 6PE (RFC 4798) */
4761 +diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
4762 +index 848c6eb55064..4d7896135e73 100644
4763 +--- a/net/openvswitch/conntrack.c
4764 ++++ b/net/openvswitch/conntrack.c
4765 +@@ -67,6 +67,7 @@ struct ovs_conntrack_info {
4766 + struct md_mark mark;
4767 + struct md_labels labels;
4768 + char timeout[CTNL_TIMEOUT_NAME_MAX];
4769 ++ struct nf_ct_timeout *nf_ct_timeout;
4770 + #if IS_ENABLED(CONFIG_NF_NAT)
4771 + struct nf_nat_range2 range; /* Only present for SRC NAT and DST NAT. */
4772 + #endif
4773 +@@ -697,6 +698,14 @@ static bool skb_nfct_cached(struct net *net,
4774 + if (help && rcu_access_pointer(help->helper) != info->helper)
4775 + return false;
4776 + }
4777 ++ if (info->nf_ct_timeout) {
4778 ++ struct nf_conn_timeout *timeout_ext;
4779 ++
4780 ++ timeout_ext = nf_ct_timeout_find(ct);
4781 ++ if (!timeout_ext || info->nf_ct_timeout !=
4782 ++ rcu_dereference(timeout_ext->timeout))
4783 ++ return false;
4784 ++ }
4785 + /* Force conntrack entry direction to the current packet? */
4786 + if (info->force && CTINFO2DIR(ctinfo) != IP_CT_DIR_ORIGINAL) {
4787 + /* Delete the conntrack entry if confirmed, else just release
4788 +@@ -1657,6 +1666,10 @@ int ovs_ct_copy_action(struct net *net, const struct nlattr *attr,
4789 + ct_info.timeout))
4790 + pr_info_ratelimited("Failed to associated timeout "
4791 + "policy `%s'\n", ct_info.timeout);
4792 ++ else
4793 ++ ct_info.nf_ct_timeout = rcu_dereference(
4794 ++ nf_ct_timeout_find(ct_info.ct)->timeout);
4795 ++
4796 + }
4797 +
4798 + if (helper) {
4799 +diff --git a/net/smc/smc_tx.c b/net/smc/smc_tx.c
4800 +index f0de323d15d6..6c8f09c1ce51 100644
4801 +--- a/net/smc/smc_tx.c
4802 ++++ b/net/smc/smc_tx.c
4803 +@@ -76,13 +76,11 @@ static int smc_tx_wait(struct smc_sock *smc, int flags)
4804 + DEFINE_WAIT_FUNC(wait, woken_wake_function);
4805 + struct smc_connection *conn = &smc->conn;
4806 + struct sock *sk = &smc->sk;
4807 +- bool noblock;
4808 + long timeo;
4809 + int rc = 0;
4810 +
4811 + /* similar to sk_stream_wait_memory */
4812 + timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT);
4813 +- noblock = timeo ? false : true;
4814 + add_wait_queue(sk_sleep(sk), &wait);
4815 + while (1) {
4816 + sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
4817 +@@ -97,8 +95,8 @@ static int smc_tx_wait(struct smc_sock *smc, int flags)
4818 + break;
4819 + }
4820 + if (!timeo) {
4821 +- if (noblock)
4822 +- set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
4823 ++ /* ensure EPOLLOUT is subsequently generated */
4824 ++ set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
4825 + rc = -EAGAIN;
4826 + break;
4827 + }
4828 +diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
4829 +index 9e1743b364ec..a680d28c231e 100644
4830 +--- a/net/sunrpc/clnt.c
4831 ++++ b/net/sunrpc/clnt.c
4832 +@@ -1893,6 +1893,7 @@ call_bind(struct rpc_task *task)
4833 + static void
4834 + call_bind_status(struct rpc_task *task)
4835 + {
4836 ++ struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
4837 + int status = -EIO;
4838 +
4839 + if (rpc_task_transmitted(task)) {
4840 +@@ -1900,14 +1901,15 @@ call_bind_status(struct rpc_task *task)
4841 + return;
4842 + }
4843 +
4844 +- if (task->tk_status >= 0) {
4845 +- dprint_status(task);
4846 ++ dprint_status(task);
4847 ++ trace_rpc_bind_status(task);
4848 ++ if (task->tk_status >= 0)
4849 ++ goto out_next;
4850 ++ if (xprt_bound(xprt)) {
4851 + task->tk_status = 0;
4852 +- task->tk_action = call_connect;
4853 +- return;
4854 ++ goto out_next;
4855 + }
4856 +
4857 +- trace_rpc_bind_status(task);
4858 + switch (task->tk_status) {
4859 + case -ENOMEM:
4860 + dprintk("RPC: %5u rpcbind out of memory\n", task->tk_pid);
4861 +@@ -1966,7 +1968,9 @@ call_bind_status(struct rpc_task *task)
4862 +
4863 + rpc_call_rpcerror(task, status);
4864 + return;
4865 +-
4866 ++out_next:
4867 ++ task->tk_action = call_connect;
4868 ++ return;
4869 + retry_timeout:
4870 + task->tk_status = 0;
4871 + task->tk_action = call_bind;
4872 +@@ -2013,6 +2017,7 @@ call_connect(struct rpc_task *task)
4873 + static void
4874 + call_connect_status(struct rpc_task *task)
4875 + {
4876 ++ struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
4877 + struct rpc_clnt *clnt = task->tk_client;
4878 + int status = task->tk_status;
4879 +
4880 +@@ -2022,8 +2027,17 @@ call_connect_status(struct rpc_task *task)
4881 + }
4882 +
4883 + dprint_status(task);
4884 +-
4885 + trace_rpc_connect_status(task);
4886 ++
4887 ++ if (task->tk_status == 0) {
4888 ++ clnt->cl_stats->netreconn++;
4889 ++ goto out_next;
4890 ++ }
4891 ++ if (xprt_connected(xprt)) {
4892 ++ task->tk_status = 0;
4893 ++ goto out_next;
4894 ++ }
4895 ++
4896 + task->tk_status = 0;
4897 + switch (status) {
4898 + case -ECONNREFUSED:
4899 +@@ -2054,13 +2068,12 @@ call_connect_status(struct rpc_task *task)
4900 + case -EAGAIN:
4901 + case -ETIMEDOUT:
4902 + goto out_retry;
4903 +- case 0:
4904 +- clnt->cl_stats->netreconn++;
4905 +- task->tk_action = call_transmit;
4906 +- return;
4907 + }
4908 + rpc_call_rpcerror(task, status);
4909 + return;
4910 ++out_next:
4911 ++ task->tk_action = call_transmit;
4912 ++ return;
4913 + out_retry:
4914 + /* Check for timeouts before looping back to call_bind */
4915 + task->tk_action = call_bind;
4916 +diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
4917 +index 5ddd34ad64b9..f7a995bd2a6c 100644
4918 +--- a/net/sunrpc/xprt.c
4919 ++++ b/net/sunrpc/xprt.c
4920 +@@ -1380,13 +1380,6 @@ xprt_request_transmit(struct rpc_rqst *req, struct rpc_task *snd_task)
4921 + status = -EBADMSG;
4922 + goto out_dequeue;
4923 + }
4924 +- if (task->tk_ops->rpc_call_prepare_transmit) {
4925 +- task->tk_ops->rpc_call_prepare_transmit(task,
4926 +- task->tk_calldata);
4927 +- status = task->tk_status;
4928 +- if (status < 0)
4929 +- goto out_dequeue;
4930 +- }
4931 + if (RPC_SIGNALLED(task)) {
4932 + status = -ERESTARTSYS;
4933 + goto out_dequeue;
4934 +diff --git a/net/wireless/reg.c b/net/wireless/reg.c
4935 +index 4831ad745f91..327479ce69f5 100644
4936 +--- a/net/wireless/reg.c
4937 ++++ b/net/wireless/reg.c
4938 +@@ -2788,7 +2788,7 @@ static void reg_process_pending_hints(void)
4939 +
4940 + /* When last_request->processed becomes true this will be rescheduled */
4941 + if (lr && !lr->processed) {
4942 +- reg_process_hint(lr);
4943 ++ pr_debug("Pending regulatory request, waiting for it to be processed...\n");
4944 + return;
4945 + }
4946 +
4947 +diff --git a/net/wireless/util.c b/net/wireless/util.c
4948 +index d0e35b7b9e35..e74837824cea 100644
4949 +--- a/net/wireless/util.c
4950 ++++ b/net/wireless/util.c
4951 +@@ -233,25 +233,30 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
4952 +
4953 + switch (params->cipher) {
4954 + case WLAN_CIPHER_SUITE_TKIP:
4955 ++ /* Extended Key ID can only be used with CCMP/GCMP ciphers */
4956 ++ if ((pairwise && key_idx) ||
4957 ++ params->mode != NL80211_KEY_RX_TX)
4958 ++ return -EINVAL;
4959 ++ break;
4960 + case WLAN_CIPHER_SUITE_CCMP:
4961 + case WLAN_CIPHER_SUITE_CCMP_256:
4962 + case WLAN_CIPHER_SUITE_GCMP:
4963 + case WLAN_CIPHER_SUITE_GCMP_256:
4964 +- /* IEEE802.11-2016 allows only 0 and - when using Extended Key
4965 +- * ID - 1 as index for pairwise keys.
4966 ++ /* IEEE802.11-2016 allows only 0 and - when supporting
4967 ++ * Extended Key ID - 1 as index for pairwise keys.
4968 + * @NL80211_KEY_NO_TX is only allowed for pairwise keys when
4969 + * the driver supports Extended Key ID.
4970 + * @NL80211_KEY_SET_TX can't be set when installing and
4971 + * validating a key.
4972 + */
4973 +- if (params->mode == NL80211_KEY_NO_TX) {
4974 +- if (!wiphy_ext_feature_isset(&rdev->wiphy,
4975 +- NL80211_EXT_FEATURE_EXT_KEY_ID))
4976 +- return -EINVAL;
4977 +- else if (!pairwise || key_idx < 0 || key_idx > 1)
4978 ++ if ((params->mode == NL80211_KEY_NO_TX && !pairwise) ||
4979 ++ params->mode == NL80211_KEY_SET_TX)
4980 ++ return -EINVAL;
4981 ++ if (wiphy_ext_feature_isset(&rdev->wiphy,
4982 ++ NL80211_EXT_FEATURE_EXT_KEY_ID)) {
4983 ++ if (pairwise && (key_idx < 0 || key_idx > 1))
4984 + return -EINVAL;
4985 +- } else if ((pairwise && key_idx) ||
4986 +- params->mode == NL80211_KEY_SET_TX) {
4987 ++ } else if (pairwise && key_idx) {
4988 + return -EINVAL;
4989 + }
4990 + break;
4991 +diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
4992 +index 82be7780bbe8..d5342687fdca 100644
4993 +--- a/net/xfrm/xfrm_policy.c
4994 ++++ b/net/xfrm/xfrm_policy.c
4995 +@@ -3272,7 +3272,7 @@ decode_session4(struct sk_buff *skb, struct flowi *fl, bool reverse)
4996 + struct flowi4 *fl4 = &fl->u.ip4;
4997 + int oif = 0;
4998 +
4999 +- if (skb_dst(skb))
5000 ++ if (skb_dst(skb) && skb_dst(skb)->dev)
5001 + oif = skb_dst(skb)->dev->ifindex;
5002 +
5003 + memset(fl4, 0, sizeof(struct flowi4));
5004 +@@ -3390,7 +3390,7 @@ decode_session6(struct sk_buff *skb, struct flowi *fl, bool reverse)
5005 +
5006 + nexthdr = nh[nhoff];
5007 +
5008 +- if (skb_dst(skb))
5009 ++ if (skb_dst(skb) && skb_dst(skb)->dev)
5010 + oif = skb_dst(skb)->dev->ifindex;
5011 +
5012 + memset(fl6, 0, sizeof(struct flowi6));
5013 +diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
5014 +index 7737b2670064..6d9592f0ae1d 100644
5015 +--- a/sound/core/seq/seq_clientmgr.c
5016 ++++ b/sound/core/seq/seq_clientmgr.c
5017 +@@ -1835,8 +1835,7 @@ static int snd_seq_ioctl_get_client_pool(struct snd_seq_client *client,
5018 + if (cptr->type == USER_CLIENT) {
5019 + info->input_pool = cptr->data.user.fifo_pool_size;
5020 + info->input_free = info->input_pool;
5021 +- if (cptr->data.user.fifo)
5022 +- info->input_free = snd_seq_unused_cells(cptr->data.user.fifo->pool);
5023 ++ info->input_free = snd_seq_fifo_unused_cells(cptr->data.user.fifo);
5024 + } else {
5025 + info->input_pool = 0;
5026 + info->input_free = 0;
5027 +diff --git a/sound/core/seq/seq_fifo.c b/sound/core/seq/seq_fifo.c
5028 +index ea69261f269a..eaaa8b5830bb 100644
5029 +--- a/sound/core/seq/seq_fifo.c
5030 ++++ b/sound/core/seq/seq_fifo.c
5031 +@@ -263,3 +263,20 @@ int snd_seq_fifo_resize(struct snd_seq_fifo *f, int poolsize)
5032 +
5033 + return 0;
5034 + }
5035 ++
5036 ++/* get the number of unused cells safely */
5037 ++int snd_seq_fifo_unused_cells(struct snd_seq_fifo *f)
5038 ++{
5039 ++ unsigned long flags;
5040 ++ int cells;
5041 ++
5042 ++ if (!f)
5043 ++ return 0;
5044 ++
5045 ++ snd_use_lock_use(&f->use_lock);
5046 ++ spin_lock_irqsave(&f->lock, flags);
5047 ++ cells = snd_seq_unused_cells(f->pool);
5048 ++ spin_unlock_irqrestore(&f->lock, flags);
5049 ++ snd_use_lock_free(&f->use_lock);
5050 ++ return cells;
5051 ++}
5052 +diff --git a/sound/core/seq/seq_fifo.h b/sound/core/seq/seq_fifo.h
5053 +index edc68743943d..b56a7b897c9c 100644
5054 +--- a/sound/core/seq/seq_fifo.h
5055 ++++ b/sound/core/seq/seq_fifo.h
5056 +@@ -53,5 +53,7 @@ int snd_seq_fifo_poll_wait(struct snd_seq_fifo *f, struct file *file, poll_table
5057 + /* resize pool in fifo */
5058 + int snd_seq_fifo_resize(struct snd_seq_fifo *f, int poolsize);
5059 +
5060 ++/* get the number of unused cells safely */
5061 ++int snd_seq_fifo_unused_cells(struct snd_seq_fifo *f);
5062 +
5063 + #endif
5064 +diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
5065 +index c3096796ee05..c41865e1222c 100644
5066 +--- a/sound/pci/hda/patch_ca0132.c
5067 ++++ b/sound/pci/hda/patch_ca0132.c
5068 +@@ -1175,6 +1175,7 @@ static const struct snd_pci_quirk ca0132_quirks[] = {
5069 + SND_PCI_QUIRK(0x1028, 0x0708, "Alienware 15 R2 2016", QUIRK_ALIENWARE),
5070 + SND_PCI_QUIRK(0x1102, 0x0010, "Sound Blaster Z", QUIRK_SBZ),
5071 + SND_PCI_QUIRK(0x1102, 0x0023, "Sound Blaster Z", QUIRK_SBZ),
5072 ++ SND_PCI_QUIRK(0x1102, 0x0027, "Sound Blaster Z", QUIRK_SBZ),
5073 + SND_PCI_QUIRK(0x1102, 0x0033, "Sound Blaster ZxR", QUIRK_SBZ),
5074 + SND_PCI_QUIRK(0x1458, 0xA016, "Recon3Di", QUIRK_R3DI),
5075 + SND_PCI_QUIRK(0x1458, 0xA026, "Gigabyte G1.Sniper Z97", QUIRK_R3DI),
5076 +diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
5077 +index 14298ef45b21..968d3caab6ac 100644
5078 +--- a/sound/pci/hda/patch_conexant.c
5079 ++++ b/sound/pci/hda/patch_conexant.c
5080 +@@ -611,18 +611,20 @@ static void cxt_fixup_hp_gate_mic_jack(struct hda_codec *codec,
5081 +
5082 + /* update LED status via GPIO */
5083 + static void cxt_update_gpio_led(struct hda_codec *codec, unsigned int mask,
5084 +- bool enabled)
5085 ++ bool led_on)
5086 + {
5087 + struct conexant_spec *spec = codec->spec;
5088 + unsigned int oldval = spec->gpio_led;
5089 +
5090 + if (spec->mute_led_polarity)
5091 +- enabled = !enabled;
5092 ++ led_on = !led_on;
5093 +
5094 +- if (enabled)
5095 +- spec->gpio_led &= ~mask;
5096 +- else
5097 ++ if (led_on)
5098 + spec->gpio_led |= mask;
5099 ++ else
5100 ++ spec->gpio_led &= ~mask;
5101 ++ codec_dbg(codec, "mask:%d enabled:%d gpio_led:%d\n",
5102 ++ mask, led_on, spec->gpio_led);
5103 + if (spec->gpio_led != oldval)
5104 + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
5105 + spec->gpio_led);
5106 +@@ -633,8 +635,8 @@ static void cxt_fixup_gpio_mute_hook(void *private_data, int enabled)
5107 + {
5108 + struct hda_codec *codec = private_data;
5109 + struct conexant_spec *spec = codec->spec;
5110 +-
5111 +- cxt_update_gpio_led(codec, spec->gpio_mute_led_mask, enabled);
5112 ++ /* muted -> LED on */
5113 ++ cxt_update_gpio_led(codec, spec->gpio_mute_led_mask, !enabled);
5114 + }
5115 +
5116 + /* turn on/off mic-mute LED via GPIO per capture hook */
5117 +@@ -656,7 +658,6 @@ static void cxt_fixup_mute_led_gpio(struct hda_codec *codec,
5118 + { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x03 },
5119 + {}
5120 + };
5121 +- codec_info(codec, "action: %d gpio_led: %d\n", action, spec->gpio_led);
5122 +
5123 + if (action == HDA_FIXUP_ACT_PRE_PROBE) {
5124 + spec->gen.vmaster_mute.hook = cxt_fixup_gpio_mute_hook;
5125 +diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
5126 +index dd0f43a1c5e1..6aeba0d66ec5 100644
5127 +--- a/sound/soc/soc-core.c
5128 ++++ b/sound/soc/soc-core.c
5129 +@@ -1605,11 +1605,8 @@ static int soc_probe_link_dais(struct snd_soc_card *card,
5130 + }
5131 + }
5132 +
5133 +- if (dai_link->dai_fmt) {
5134 +- ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt);
5135 +- if (ret)
5136 +- return ret;
5137 +- }
5138 ++ if (dai_link->dai_fmt)
5139 ++ snd_soc_runtime_set_dai_fmt(rtd, dai_link->dai_fmt);
5140 +
5141 + ret = soc_post_component_init(rtd, dai_link->name);
5142 + if (ret)
5143 +diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c
5144 +index 2c03e0f6bf72..f70211e6b174 100644
5145 +--- a/sound/usb/line6/pcm.c
5146 ++++ b/sound/usb/line6/pcm.c
5147 +@@ -550,6 +550,15 @@ int line6_init_pcm(struct usb_line6 *line6,
5148 + line6pcm->volume_monitor = 255;
5149 + line6pcm->line6 = line6;
5150 +
5151 ++ spin_lock_init(&line6pcm->out.lock);
5152 ++ spin_lock_init(&line6pcm->in.lock);
5153 ++ line6pcm->impulse_period = LINE6_IMPULSE_DEFAULT_PERIOD;
5154 ++
5155 ++ line6->line6pcm = line6pcm;
5156 ++
5157 ++ pcm->private_data = line6pcm;
5158 ++ pcm->private_free = line6_cleanup_pcm;
5159 ++
5160 + line6pcm->max_packet_size_in =
5161 + usb_maxpacket(line6->usbdev,
5162 + usb_rcvisocpipe(line6->usbdev, ep_read), 0);
5163 +@@ -562,15 +571,6 @@ int line6_init_pcm(struct usb_line6 *line6,
5164 + return -EINVAL;
5165 + }
5166 +
5167 +- spin_lock_init(&line6pcm->out.lock);
5168 +- spin_lock_init(&line6pcm->in.lock);
5169 +- line6pcm->impulse_period = LINE6_IMPULSE_DEFAULT_PERIOD;
5170 +-
5171 +- line6->line6pcm = line6pcm;
5172 +-
5173 +- pcm->private_data = line6pcm;
5174 +- pcm->private_free = line6_cleanup_pcm;
5175 +-
5176 + err = line6_create_audio_out_urbs(line6pcm);
5177 + if (err < 0)
5178 + return err;
5179 +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
5180 +index b5927c3d5bc0..eceab19766db 100644
5181 +--- a/sound/usb/mixer.c
5182 ++++ b/sound/usb/mixer.c
5183 +@@ -739,7 +739,6 @@ static int uac_mixer_unit_get_channels(struct mixer_build *state,
5184 + struct uac_mixer_unit_descriptor *desc)
5185 + {
5186 + int mu_channels;
5187 +- void *c;
5188 +
5189 + if (desc->bLength < sizeof(*desc))
5190 + return -EINVAL;
5191 +@@ -762,13 +761,6 @@ static int uac_mixer_unit_get_channels(struct mixer_build *state,
5192 + break;
5193 + }
5194 +
5195 +- if (!mu_channels)
5196 +- return 0;
5197 +-
5198 +- c = uac_mixer_unit_bmControls(desc, state->mixer->protocol);
5199 +- if (c - (void *)desc + (mu_channels - 1) / 8 >= desc->bLength)
5200 +- return 0; /* no bmControls -> skip */
5201 +-
5202 + return mu_channels;
5203 + }
5204 +
5205 +@@ -2009,6 +2001,31 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
5206 + * Mixer Unit
5207 + */
5208 +
5209 ++/* check whether the given in/out overflows bmMixerControls matrix */
5210 ++static bool mixer_bitmap_overflow(struct uac_mixer_unit_descriptor *desc,
5211 ++ int protocol, int num_ins, int num_outs)
5212 ++{
5213 ++ u8 *hdr = (u8 *)desc;
5214 ++ u8 *c = uac_mixer_unit_bmControls(desc, protocol);
5215 ++ size_t rest; /* remaining bytes after bmMixerControls */
5216 ++
5217 ++ switch (protocol) {
5218 ++ case UAC_VERSION_1:
5219 ++ default:
5220 ++ rest = 1; /* iMixer */
5221 ++ break;
5222 ++ case UAC_VERSION_2:
5223 ++ rest = 2; /* bmControls + iMixer */
5224 ++ break;
5225 ++ case UAC_VERSION_3:
5226 ++ rest = 6; /* bmControls + wMixerDescrStr */
5227 ++ break;
5228 ++ }
5229 ++
5230 ++ /* overflow? */
5231 ++ return c + (num_ins * num_outs + 7) / 8 + rest > hdr + hdr[0];
5232 ++}
5233 ++
5234 + /*
5235 + * build a mixer unit control
5236 + *
5237 +@@ -2137,6 +2154,9 @@ static int parse_audio_mixer_unit(struct mixer_build *state, int unitid,
5238 + if (err < 0)
5239 + return err;
5240 + num_ins += iterm.channels;
5241 ++ if (mixer_bitmap_overflow(desc, state->mixer->protocol,
5242 ++ num_ins, num_outs))
5243 ++ break;
5244 + for (; ich < num_ins; ich++) {
5245 + int och, ich_has_controls = 0;
5246 +
5247 +diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
5248 +index 199fa157a411..27dcb3743690 100644
5249 +--- a/sound/usb/mixer_quirks.c
5250 ++++ b/sound/usb/mixer_quirks.c
5251 +@@ -1155,17 +1155,17 @@ void snd_emuusb_set_samplerate(struct snd_usb_audio *chip,
5252 + {
5253 + struct usb_mixer_interface *mixer;
5254 + struct usb_mixer_elem_info *cval;
5255 +- int unitid = 12; /* SamleRate ExtensionUnit ID */
5256 ++ int unitid = 12; /* SampleRate ExtensionUnit ID */
5257 +
5258 + list_for_each_entry(mixer, &chip->mixer_list, list) {
5259 +- cval = mixer_elem_list_to_info(mixer->id_elems[unitid]);
5260 +- if (cval) {
5261 ++ if (mixer->id_elems[unitid]) {
5262 ++ cval = mixer_elem_list_to_info(mixer->id_elems[unitid]);
5263 + snd_usb_mixer_set_ctl_value(cval, UAC_SET_CUR,
5264 + cval->control << 8,
5265 + samplerate_id);
5266 + snd_usb_mixer_notify_id(mixer, unitid);
5267 ++ break;
5268 + }
5269 +- break;
5270 + }
5271 + }
5272 +
5273 +diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
5274 +index 75b96929f76c..e4bbf79de956 100644
5275 +--- a/sound/usb/pcm.c
5276 ++++ b/sound/usb/pcm.c
5277 +@@ -339,6 +339,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
5278 + ep = 0x81;
5279 + ifnum = 2;
5280 + goto add_sync_ep_from_ifnum;
5281 ++ case USB_ID(0x1397, 0x0001): /* Behringer UFX1604 */
5282 + case USB_ID(0x1397, 0x0002): /* Behringer UFX1204 */
5283 + ep = 0x81;
5284 + ifnum = 1;
5285 +diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
5286 +index d7e06fe0270e..0ce50c319cfd 100644
5287 +--- a/tools/hv/hv_kvp_daemon.c
5288 ++++ b/tools/hv/hv_kvp_daemon.c
5289 +@@ -1386,6 +1386,8 @@ int main(int argc, char *argv[])
5290 + daemonize = 0;
5291 + break;
5292 + case 'h':
5293 ++ print_usage(argv);
5294 ++ exit(0);
5295 + default:
5296 + print_usage(argv);
5297 + exit(EXIT_FAILURE);
5298 +diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
5299 +index efe1e34dd91b..8f813f5233d4 100644
5300 +--- a/tools/hv/hv_vss_daemon.c
5301 ++++ b/tools/hv/hv_vss_daemon.c
5302 +@@ -218,6 +218,8 @@ int main(int argc, char *argv[])
5303 + daemonize = 0;
5304 + break;
5305 + case 'h':
5306 ++ print_usage(argv);
5307 ++ exit(0);
5308 + default:
5309 + print_usage(argv);
5310 + exit(EXIT_FAILURE);
5311 +diff --git a/tools/hv/lsvmbus b/tools/hv/lsvmbus
5312 +index 55e7374bade0..099f2c44dbed 100644
5313 +--- a/tools/hv/lsvmbus
5314 ++++ b/tools/hv/lsvmbus
5315 +@@ -4,10 +4,10 @@
5316 + import os
5317 + from optparse import OptionParser
5318 +
5319 ++help_msg = "print verbose messages. Try -vv, -vvv for more verbose messages"
5320 + parser = OptionParser()
5321 +-parser.add_option("-v", "--verbose", dest="verbose",
5322 +- help="print verbose messages. Try -vv, -vvv for \
5323 +- more verbose messages", action="count")
5324 ++parser.add_option(
5325 ++ "-v", "--verbose", dest="verbose", help=help_msg, action="count")
5326 +
5327 + (options, args) = parser.parse_args()
5328 +
5329 +@@ -21,27 +21,28 @@ if not os.path.isdir(vmbus_sys_path):
5330 + exit(-1)
5331 +
5332 + vmbus_dev_dict = {
5333 +- '{0e0b6031-5213-4934-818b-38d90ced39db}' : '[Operating system shutdown]',
5334 +- '{9527e630-d0ae-497b-adce-e80ab0175caf}' : '[Time Synchronization]',
5335 +- '{57164f39-9115-4e78-ab55-382f3bd5422d}' : '[Heartbeat]',
5336 +- '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}' : '[Data Exchange]',
5337 +- '{35fa2e29-ea23-4236-96ae-3a6ebacba440}' : '[Backup (volume checkpoint)]',
5338 +- '{34d14be3-dee4-41c8-9ae7-6b174977c192}' : '[Guest services]',
5339 +- '{525074dc-8985-46e2-8057-a307dc18a502}' : '[Dynamic Memory]',
5340 +- '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}' : 'Synthetic mouse',
5341 +- '{f912ad6d-2b17-48ea-bd65-f927a61c7684}' : 'Synthetic keyboard',
5342 +- '{da0a7802-e377-4aac-8e77-0558eb1073f8}' : 'Synthetic framebuffer adapter',
5343 +- '{f8615163-df3e-46c5-913f-f2d2f965ed0e}' : 'Synthetic network adapter',
5344 +- '{32412632-86cb-44a2-9b5c-50d1417354f5}' : 'Synthetic IDE Controller',
5345 +- '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}' : 'Synthetic SCSI Controller',
5346 +- '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}' : 'Synthetic fiber channel adapter',
5347 +- '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}' : 'Synthetic RDMA adapter',
5348 +- '{44c4f61d-4444-4400-9d52-802e27ede19f}' : 'PCI Express pass-through',
5349 +- '{276aacf4-ac15-426c-98dd-7521ad3f01fe}' : '[Reserved system device]',
5350 +- '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}' : '[Reserved system device]',
5351 +- '{3375baf4-9e15-4b30-b765-67acb10d607b}' : '[Reserved system device]',
5352 ++ '{0e0b6031-5213-4934-818b-38d90ced39db}': '[Operating system shutdown]',
5353 ++ '{9527e630-d0ae-497b-adce-e80ab0175caf}': '[Time Synchronization]',
5354 ++ '{57164f39-9115-4e78-ab55-382f3bd5422d}': '[Heartbeat]',
5355 ++ '{a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}': '[Data Exchange]',
5356 ++ '{35fa2e29-ea23-4236-96ae-3a6ebacba440}': '[Backup (volume checkpoint)]',
5357 ++ '{34d14be3-dee4-41c8-9ae7-6b174977c192}': '[Guest services]',
5358 ++ '{525074dc-8985-46e2-8057-a307dc18a502}': '[Dynamic Memory]',
5359 ++ '{cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}': 'Synthetic mouse',
5360 ++ '{f912ad6d-2b17-48ea-bd65-f927a61c7684}': 'Synthetic keyboard',
5361 ++ '{da0a7802-e377-4aac-8e77-0558eb1073f8}': 'Synthetic framebuffer adapter',
5362 ++ '{f8615163-df3e-46c5-913f-f2d2f965ed0e}': 'Synthetic network adapter',
5363 ++ '{32412632-86cb-44a2-9b5c-50d1417354f5}': 'Synthetic IDE Controller',
5364 ++ '{ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}': 'Synthetic SCSI Controller',
5365 ++ '{2f9bcc4a-0069-4af3-b76b-6fd0be528cda}': 'Synthetic fiber channel adapter',
5366 ++ '{8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}': 'Synthetic RDMA adapter',
5367 ++ '{44c4f61d-4444-4400-9d52-802e27ede19f}': 'PCI Express pass-through',
5368 ++ '{276aacf4-ac15-426c-98dd-7521ad3f01fe}': '[Reserved system device]',
5369 ++ '{f8e65716-3cb3-4a06-9a60-1889c5cccab5}': '[Reserved system device]',
5370 ++ '{3375baf4-9e15-4b30-b765-67acb10d607b}': '[Reserved system device]',
5371 + }
5372 +
5373 ++
5374 + def get_vmbus_dev_attr(dev_name, attr):
5375 + try:
5376 + f = open('%s/%s/%s' % (vmbus_sys_path, dev_name, attr), 'r')
5377 +@@ -52,6 +53,7 @@ def get_vmbus_dev_attr(dev_name, attr):
5378 +
5379 + return lines
5380 +
5381 ++
5382 + class VMBus_Dev:
5383 + pass
5384 +
5385 +@@ -66,12 +68,13 @@ for f in os.listdir(vmbus_sys_path):
5386 +
5387 + chn_vp_mapping = get_vmbus_dev_attr(f, 'channel_vp_mapping')
5388 + chn_vp_mapping = [c.strip() for c in chn_vp_mapping]
5389 +- chn_vp_mapping = sorted(chn_vp_mapping,
5390 +- key = lambda c : int(c.split(':')[0]))
5391 ++ chn_vp_mapping = sorted(
5392 ++ chn_vp_mapping, key=lambda c: int(c.split(':')[0]))
5393 +
5394 +- chn_vp_mapping = ['\tRel_ID=%s, target_cpu=%s' %
5395 +- (c.split(':')[0], c.split(':')[1])
5396 +- for c in chn_vp_mapping]
5397 ++ chn_vp_mapping = [
5398 ++ '\tRel_ID=%s, target_cpu=%s' %
5399 ++ (c.split(':')[0], c.split(':')[1]) for c in chn_vp_mapping
5400 ++ ]
5401 + d = VMBus_Dev()
5402 + d.sysfs_path = '%s/%s' % (vmbus_sys_path, f)
5403 + d.vmbus_id = vmbus_id
5404 +@@ -85,7 +88,7 @@ for f in os.listdir(vmbus_sys_path):
5405 + vmbus_dev_list.append(d)
5406 +
5407 +
5408 +-vmbus_dev_list = sorted(vmbus_dev_list, key = lambda d : int(d.vmbus_id))
5409 ++vmbus_dev_list = sorted(vmbus_dev_list, key=lambda d: int(d.vmbus_id))
5410 +
5411 + format0 = '%2s: %s'
5412 + format1 = '%2s: Class_ID = %s - %s\n%s'
5413 +@@ -95,9 +98,15 @@ for d in vmbus_dev_list:
5414 + if verbose == 0:
5415 + print(('VMBUS ID ' + format0) % (d.vmbus_id, d.dev_desc))
5416 + elif verbose == 1:
5417 +- print (('VMBUS ID ' + format1) % \
5418 +- (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping))
5419 ++ print(
5420 ++ ('VMBUS ID ' + format1) %
5421 ++ (d.vmbus_id, d.class_id, d.dev_desc, d.chn_vp_mapping)
5422 ++ )
5423 + else:
5424 +- print (('VMBUS ID ' + format2) % \
5425 +- (d.vmbus_id, d.class_id, d.dev_desc, \
5426 +- d.device_id, d.sysfs_path, d.chn_vp_mapping))
5427 ++ print(
5428 ++ ('VMBUS ID ' + format2) %
5429 ++ (
5430 ++ d.vmbus_id, d.class_id, d.dev_desc,
5431 ++ d.device_id, d.sysfs_path, d.chn_vp_mapping
5432 ++ )
5433 ++ )
5434 +diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
5435 +index 75fc4fb9901c..1cd28ebf8443 100644
5436 +--- a/tools/power/x86/turbostat/turbostat.c
5437 ++++ b/tools/power/x86/turbostat/turbostat.c
5438 +@@ -4002,7 +4002,7 @@ void rapl_probe_amd(unsigned int family, unsigned int model)
5439 + rapl_energy_units = ldexp(1.0, -(msr >> 8 & 0x1f));
5440 + rapl_power_units = ldexp(1.0, -(msr & 0xf));
5441 +
5442 +- tdp = get_tdp_amd(model);
5443 ++ tdp = get_tdp_amd(family);
5444 +
5445 + rapl_joule_counter_range = 0xFFFFFFFF * rapl_energy_units / tdp;
5446 + if (!quiet)
5447 +diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
5448 +index b9e88ccc289b..adced69d026e 100644
5449 +--- a/tools/testing/selftests/bpf/Makefile
5450 ++++ b/tools/testing/selftests/bpf/Makefile
5451 +@@ -61,7 +61,8 @@ TEST_PROGS := test_kmod.sh \
5452 + TEST_PROGS_EXTENDED := with_addr.sh \
5453 + with_tunnels.sh \
5454 + tcp_client.py \
5455 +- tcp_server.py
5456 ++ tcp_server.py \
5457 ++ test_xdp_vlan.sh
5458 +
5459 + # Compile but not part of 'make run_tests'
5460 + TEST_GEN_PROGS_EXTENDED = test_libbpf_open test_sock_addr test_skb_cgroup_id_user \
5461 +diff --git a/virt/kvm/arm/vgic/vgic-mmio.c b/virt/kvm/arm/vgic/vgic-mmio.c
5462 +index 3ba7278fb533..b249220025bc 100644
5463 +--- a/virt/kvm/arm/vgic/vgic-mmio.c
5464 ++++ b/virt/kvm/arm/vgic/vgic-mmio.c
5465 +@@ -195,6 +195,12 @@ static void vgic_hw_irq_spending(struct kvm_vcpu *vcpu, struct vgic_irq *irq,
5466 + vgic_irq_set_phys_active(irq, true);
5467 + }
5468 +
5469 ++static bool is_vgic_v2_sgi(struct kvm_vcpu *vcpu, struct vgic_irq *irq)
5470 ++{
5471 ++ return (vgic_irq_is_sgi(irq->intid) &&
5472 ++ vcpu->kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V2);
5473 ++}
5474 ++
5475 + void vgic_mmio_write_spending(struct kvm_vcpu *vcpu,
5476 + gpa_t addr, unsigned int len,
5477 + unsigned long val)
5478 +@@ -207,6 +213,12 @@ void vgic_mmio_write_spending(struct kvm_vcpu *vcpu,
5479 + for_each_set_bit(i, &val, len * 8) {
5480 + struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i);
5481 +
5482 ++ /* GICD_ISPENDR0 SGI bits are WI */
5483 ++ if (is_vgic_v2_sgi(vcpu, irq)) {
5484 ++ vgic_put_irq(vcpu->kvm, irq);
5485 ++ continue;
5486 ++ }
5487 ++
5488 + raw_spin_lock_irqsave(&irq->irq_lock, flags);
5489 + if (irq->hw)
5490 + vgic_hw_irq_spending(vcpu, irq, is_uaccess);
5491 +@@ -254,6 +266,12 @@ void vgic_mmio_write_cpending(struct kvm_vcpu *vcpu,
5492 + for_each_set_bit(i, &val, len * 8) {
5493 + struct vgic_irq *irq = vgic_get_irq(vcpu->kvm, vcpu, intid + i);
5494 +
5495 ++ /* GICD_ICPENDR0 SGI bits are WI */
5496 ++ if (is_vgic_v2_sgi(vcpu, irq)) {
5497 ++ vgic_put_irq(vcpu->kvm, irq);
5498 ++ continue;
5499 ++ }
5500 ++
5501 + raw_spin_lock_irqsave(&irq->irq_lock, flags);
5502 +
5503 + if (irq->hw)
5504 +diff --git a/virt/kvm/arm/vgic/vgic-v2.c b/virt/kvm/arm/vgic/vgic-v2.c
5505 +index 96aab77d0471..b00aa304c260 100644
5506 +--- a/virt/kvm/arm/vgic/vgic-v2.c
5507 ++++ b/virt/kvm/arm/vgic/vgic-v2.c
5508 +@@ -184,7 +184,10 @@ void vgic_v2_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr)
5509 + if (vgic_irq_is_sgi(irq->intid)) {
5510 + u32 src = ffs(irq->source);
5511 +
5512 +- BUG_ON(!src);
5513 ++ if (WARN_RATELIMIT(!src, "No SGI source for INTID %d\n",
5514 ++ irq->intid))
5515 ++ return;
5516 ++
5517 + val |= (src - 1) << GICH_LR_PHYSID_CPUID_SHIFT;
5518 + irq->source &= ~(1 << (src - 1));
5519 + if (irq->source) {
5520 +diff --git a/virt/kvm/arm/vgic/vgic-v3.c b/virt/kvm/arm/vgic/vgic-v3.c
5521 +index 0c653a1e5215..a4ad431c92a9 100644
5522 +--- a/virt/kvm/arm/vgic/vgic-v3.c
5523 ++++ b/virt/kvm/arm/vgic/vgic-v3.c
5524 +@@ -167,7 +167,10 @@ void vgic_v3_populate_lr(struct kvm_vcpu *vcpu, struct vgic_irq *irq, int lr)
5525 + model == KVM_DEV_TYPE_ARM_VGIC_V2) {
5526 + u32 src = ffs(irq->source);
5527 +
5528 +- BUG_ON(!src);
5529 ++ if (WARN_RATELIMIT(!src, "No SGI source for INTID %d\n",
5530 ++ irq->intid))
5531 ++ return;
5532 ++
5533 + val |= (src - 1) << GICH_LR_PHYSID_CPUID_SHIFT;
5534 + irq->source &= ~(1 << (src - 1));
5535 + if (irq->source) {
5536 +diff --git a/virt/kvm/arm/vgic/vgic.c b/virt/kvm/arm/vgic/vgic.c
5537 +index 13d4b38a94ec..e7bde65ba67c 100644
5538 +--- a/virt/kvm/arm/vgic/vgic.c
5539 ++++ b/virt/kvm/arm/vgic/vgic.c
5540 +@@ -254,6 +254,13 @@ static int vgic_irq_cmp(void *priv, struct list_head *a, struct list_head *b)
5541 + bool penda, pendb;
5542 + int ret;
5543 +
5544 ++ /*
5545 ++ * list_sort may call this function with the same element when
5546 ++ * the list is fairly long.
5547 ++ */
5548 ++ if (unlikely(irqa == irqb))
5549 ++ return 0;
5550 ++
5551 + raw_spin_lock(&irqa->irq_lock);
5552 + raw_spin_lock_nested(&irqb->irq_lock, SINGLE_DEPTH_NESTING);
5553 +
5554
5555 diff --git a/1012_linux-5.2.13.patch b/1012_linux-5.2.13.patch
5556 new file mode 100644
5557 index 0000000..c8f98ac
5558 --- /dev/null
5559 +++ b/1012_linux-5.2.13.patch
5560 @@ -0,0 +1,92 @@
5561 +diff --git a/Makefile b/Makefile
5562 +index e26d52d93bb1..288284de8858 100644
5563 +--- a/Makefile
5564 ++++ b/Makefile
5565 +@@ -1,7 +1,7 @@
5566 + # SPDX-License-Identifier: GPL-2.0
5567 + VERSION = 5
5568 + PATCHLEVEL = 2
5569 +-SUBLEVEL = 12
5570 ++SUBLEVEL = 13
5571 + EXTRAVERSION =
5572 + NAME = Bobtail Squid
5573 +
5574 +diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
5575 +index a47c7add4e0e..a4345052abd2 100644
5576 +--- a/drivers/input/mouse/elantech.c
5577 ++++ b/drivers/input/mouse/elantech.c
5578 +@@ -1807,30 +1807,6 @@ static int elantech_create_smbus(struct psmouse *psmouse,
5579 + leave_breadcrumbs);
5580 + }
5581 +
5582 +-static bool elantech_use_host_notify(struct psmouse *psmouse,
5583 +- struct elantech_device_info *info)
5584 +-{
5585 +- if (ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version))
5586 +- return true;
5587 +-
5588 +- switch (info->bus) {
5589 +- case ETP_BUS_PS2_ONLY:
5590 +- /* expected case */
5591 +- break;
5592 +- case ETP_BUS_SMB_HST_NTFY_ONLY:
5593 +- case ETP_BUS_PS2_SMB_HST_NTFY:
5594 +- /* SMbus implementation is stable since 2018 */
5595 +- if (dmi_get_bios_year() >= 2018)
5596 +- return true;
5597 +- default:
5598 +- psmouse_dbg(psmouse,
5599 +- "Ignoring SMBus bus provider %d\n", info->bus);
5600 +- break;
5601 +- }
5602 +-
5603 +- return false;
5604 +-}
5605 +-
5606 + /**
5607 + * elantech_setup_smbus - called once the PS/2 devices are enumerated
5608 + * and decides to instantiate a SMBus InterTouch device.
5609 +@@ -1850,7 +1826,7 @@ static int elantech_setup_smbus(struct psmouse *psmouse,
5610 + * i2c_blacklist_pnp_ids.
5611 + * Old ICs are up to the user to decide.
5612 + */
5613 +- if (!elantech_use_host_notify(psmouse, info) ||
5614 ++ if (!ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version) ||
5615 + psmouse_matches_pnp_id(psmouse, i2c_blacklist_pnp_ids))
5616 + return -ENXIO;
5617 + }
5618 +@@ -1870,6 +1846,34 @@ static int elantech_setup_smbus(struct psmouse *psmouse,
5619 + return 0;
5620 + }
5621 +
5622 ++static bool elantech_use_host_notify(struct psmouse *psmouse,
5623 ++ struct elantech_device_info *info)
5624 ++{
5625 ++ if (ETP_NEW_IC_SMBUS_HOST_NOTIFY(info->fw_version))
5626 ++ return true;
5627 ++
5628 ++ switch (info->bus) {
5629 ++ case ETP_BUS_PS2_ONLY:
5630 ++ /* expected case */
5631 ++ break;
5632 ++ case ETP_BUS_SMB_ALERT_ONLY:
5633 ++ /* fall-through */
5634 ++ case ETP_BUS_PS2_SMB_ALERT:
5635 ++ psmouse_dbg(psmouse, "Ignoring SMBus provider through alert protocol.\n");
5636 ++ break;
5637 ++ case ETP_BUS_SMB_HST_NTFY_ONLY:
5638 ++ /* fall-through */
5639 ++ case ETP_BUS_PS2_SMB_HST_NTFY:
5640 ++ return true;
5641 ++ default:
5642 ++ psmouse_dbg(psmouse,
5643 ++ "Ignoring SMBus bus provider %d.\n",
5644 ++ info->bus);
5645 ++ }
5646 ++
5647 ++ return false;
5648 ++}
5649 ++
5650 + int elantech_init_smbus(struct psmouse *psmouse)
5651 + {
5652 + struct elantech_device_info info;