1 |
commit: 048f70c6366464670e5f4f4742e94ce3778411c1 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Feb 1 10:31:33 2020 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Feb 1 10:31:33 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=048f70c6 |
7 |
|
8 |
Linux patch 5.4.17 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1016_linux-5.4.17.patch | 4118 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 4122 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 85cdd05..e94c70b 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -107,6 +107,10 @@ Patch: 1015_linux-5.4.16.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.4.16 |
23 |
|
24 |
+Patch: 1016_linux-5.4.17.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.4.17 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1016_linux-5.4.17.patch b/1016_linux-5.4.17.patch |
33 |
new file mode 100644 |
34 |
index 0000000..3a901e1 |
35 |
--- /dev/null |
36 |
+++ b/1016_linux-5.4.17.patch |
37 |
@@ -0,0 +1,4118 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index e16d2e58ed4b..a363a539a092 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 4 |
46 |
+-SUBLEVEL = 16 |
47 |
++SUBLEVEL = 17 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Kleptomaniac Octopus |
50 |
+ |
51 |
+diff --git a/arch/arc/plat-eznps/Kconfig b/arch/arc/plat-eznps/Kconfig |
52 |
+index a376a50d3fea..a931d0a256d0 100644 |
53 |
+--- a/arch/arc/plat-eznps/Kconfig |
54 |
++++ b/arch/arc/plat-eznps/Kconfig |
55 |
+@@ -7,7 +7,7 @@ |
56 |
+ menuconfig ARC_PLAT_EZNPS |
57 |
+ bool "\"EZchip\" ARC dev platform" |
58 |
+ select CPU_BIG_ENDIAN |
59 |
+- select CLKSRC_NPS |
60 |
++ select CLKSRC_NPS if !PHYS_ADDR_T_64BIT |
61 |
+ select EZNPS_GIC |
62 |
+ select EZCHIP_NPS_MANAGEMENT_ENET if ETHERNET |
63 |
+ help |
64 |
+diff --git a/arch/arm/configs/aspeed_g5_defconfig b/arch/arm/configs/aspeed_g5_defconfig |
65 |
+index 597536cc9573..b87508c7056c 100644 |
66 |
+--- a/arch/arm/configs/aspeed_g5_defconfig |
67 |
++++ b/arch/arm/configs/aspeed_g5_defconfig |
68 |
+@@ -139,6 +139,7 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=6 |
69 |
+ CONFIG_SERIAL_8250_EXTENDED=y |
70 |
+ CONFIG_SERIAL_8250_ASPEED_VUART=y |
71 |
+ CONFIG_SERIAL_8250_SHARE_IRQ=y |
72 |
++CONFIG_SERIAL_8250_DW=y |
73 |
+ CONFIG_SERIAL_OF_PLATFORM=y |
74 |
+ CONFIG_ASPEED_KCS_IPMI_BMC=y |
75 |
+ CONFIG_ASPEED_BT_IPMI_BMC=y |
76 |
+diff --git a/arch/arm64/kvm/debug.c b/arch/arm64/kvm/debug.c |
77 |
+index 43487f035385..7a7e425616b5 100644 |
78 |
+--- a/arch/arm64/kvm/debug.c |
79 |
++++ b/arch/arm64/kvm/debug.c |
80 |
+@@ -101,7 +101,7 @@ void kvm_arm_reset_debug_ptr(struct kvm_vcpu *vcpu) |
81 |
+ void kvm_arm_setup_debug(struct kvm_vcpu *vcpu) |
82 |
+ { |
83 |
+ bool trap_debug = !(vcpu->arch.flags & KVM_ARM64_DEBUG_DIRTY); |
84 |
+- unsigned long mdscr; |
85 |
++ unsigned long mdscr, orig_mdcr_el2 = vcpu->arch.mdcr_el2; |
86 |
+ |
87 |
+ trace_kvm_arm_setup_debug(vcpu, vcpu->guest_debug); |
88 |
+ |
89 |
+@@ -197,6 +197,10 @@ void kvm_arm_setup_debug(struct kvm_vcpu *vcpu) |
90 |
+ if (vcpu_read_sys_reg(vcpu, MDSCR_EL1) & (DBG_MDSCR_KDE | DBG_MDSCR_MDE)) |
91 |
+ vcpu->arch.flags |= KVM_ARM64_DEBUG_DIRTY; |
92 |
+ |
93 |
++ /* Write mdcr_el2 changes since vcpu_load on VHE systems */ |
94 |
++ if (has_vhe() && orig_mdcr_el2 != vcpu->arch.mdcr_el2) |
95 |
++ write_sysreg(vcpu->arch.mdcr_el2, mdcr_el2); |
96 |
++ |
97 |
+ trace_kvm_arm_set_dreg32("MDCR_EL2", vcpu->arch.mdcr_el2); |
98 |
+ trace_kvm_arm_set_dreg32("MDSCR_EL1", vcpu_read_sys_reg(vcpu, MDSCR_EL1)); |
99 |
+ } |
100 |
+diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S |
101 |
+index d7086b985f27..4049f2c46387 100644 |
102 |
+--- a/arch/um/include/asm/common.lds.S |
103 |
++++ b/arch/um/include/asm/common.lds.S |
104 |
+@@ -83,8 +83,8 @@ |
105 |
+ __preinit_array_end = .; |
106 |
+ } |
107 |
+ .init_array : { |
108 |
+- /* dummy - we call this ourselves */ |
109 |
+ __init_array_start = .; |
110 |
++ *(.init_array) |
111 |
+ __init_array_end = .; |
112 |
+ } |
113 |
+ .fini_array : { |
114 |
+diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S |
115 |
+index c69d69ee96be..f5001481010c 100644 |
116 |
+--- a/arch/um/kernel/dyn.lds.S |
117 |
++++ b/arch/um/kernel/dyn.lds.S |
118 |
+@@ -103,6 +103,7 @@ SECTIONS |
119 |
+ be empty, which isn't pretty. */ |
120 |
+ . = ALIGN(32 / 8); |
121 |
+ .preinit_array : { *(.preinit_array) } |
122 |
++ .init_array : { *(.init_array) } |
123 |
+ .fini_array : { *(.fini_array) } |
124 |
+ .data : { |
125 |
+ INIT_TASK_DATA(KERNEL_STACK_SIZE) |
126 |
+diff --git a/crypto/af_alg.c b/crypto/af_alg.c |
127 |
+index 0dceaabc6321..3d8e53010cda 100644 |
128 |
+--- a/crypto/af_alg.c |
129 |
++++ b/crypto/af_alg.c |
130 |
+@@ -134,11 +134,13 @@ void af_alg_release_parent(struct sock *sk) |
131 |
+ sk = ask->parent; |
132 |
+ ask = alg_sk(sk); |
133 |
+ |
134 |
+- lock_sock(sk); |
135 |
++ local_bh_disable(); |
136 |
++ bh_lock_sock(sk); |
137 |
+ ask->nokey_refcnt -= nokey; |
138 |
+ if (!last) |
139 |
+ last = !--ask->refcnt; |
140 |
+- release_sock(sk); |
141 |
++ bh_unlock_sock(sk); |
142 |
++ local_bh_enable(); |
143 |
+ |
144 |
+ if (last) |
145 |
+ sock_put(sk); |
146 |
+diff --git a/crypto/pcrypt.c b/crypto/pcrypt.c |
147 |
+index 543792e0ebf0..81bbea7f2ba6 100644 |
148 |
+--- a/crypto/pcrypt.c |
149 |
++++ b/crypto/pcrypt.c |
150 |
+@@ -362,11 +362,12 @@ err: |
151 |
+ |
152 |
+ static void __exit pcrypt_exit(void) |
153 |
+ { |
154 |
++ crypto_unregister_template(&pcrypt_tmpl); |
155 |
++ |
156 |
+ pcrypt_fini_padata(pencrypt); |
157 |
+ pcrypt_fini_padata(pdecrypt); |
158 |
+ |
159 |
+ kset_unregister(pcrypt_kset); |
160 |
+- crypto_unregister_template(&pcrypt_tmpl); |
161 |
+ } |
162 |
+ |
163 |
+ subsys_initcall(pcrypt_init); |
164 |
+diff --git a/drivers/android/binder.c b/drivers/android/binder.c |
165 |
+index 976a69420c16..254f87b627fe 100644 |
166 |
+--- a/drivers/android/binder.c |
167 |
++++ b/drivers/android/binder.c |
168 |
+@@ -5203,10 +5203,11 @@ err_bad_arg: |
169 |
+ |
170 |
+ static int binder_open(struct inode *nodp, struct file *filp) |
171 |
+ { |
172 |
+- struct binder_proc *proc; |
173 |
++ struct binder_proc *proc, *itr; |
174 |
+ struct binder_device *binder_dev; |
175 |
+ struct binderfs_info *info; |
176 |
+ struct dentry *binder_binderfs_dir_entry_proc = NULL; |
177 |
++ bool existing_pid = false; |
178 |
+ |
179 |
+ binder_debug(BINDER_DEBUG_OPEN_CLOSE, "%s: %d:%d\n", __func__, |
180 |
+ current->group_leader->pid, current->pid); |
181 |
+@@ -5239,19 +5240,24 @@ static int binder_open(struct inode *nodp, struct file *filp) |
182 |
+ filp->private_data = proc; |
183 |
+ |
184 |
+ mutex_lock(&binder_procs_lock); |
185 |
++ hlist_for_each_entry(itr, &binder_procs, proc_node) { |
186 |
++ if (itr->pid == proc->pid) { |
187 |
++ existing_pid = true; |
188 |
++ break; |
189 |
++ } |
190 |
++ } |
191 |
+ hlist_add_head(&proc->proc_node, &binder_procs); |
192 |
+ mutex_unlock(&binder_procs_lock); |
193 |
+ |
194 |
+- if (binder_debugfs_dir_entry_proc) { |
195 |
++ if (binder_debugfs_dir_entry_proc && !existing_pid) { |
196 |
+ char strbuf[11]; |
197 |
+ |
198 |
+ snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); |
199 |
+ /* |
200 |
+- * proc debug entries are shared between contexts, so |
201 |
+- * this will fail if the process tries to open the driver |
202 |
+- * again with a different context. The priting code will |
203 |
+- * anyway print all contexts that a given PID has, so this |
204 |
+- * is not a problem. |
205 |
++ * proc debug entries are shared between contexts. |
206 |
++ * Only create for the first PID to avoid debugfs log spamming |
207 |
++ * The printing code will anyway print all contexts for a given |
208 |
++ * PID so this is not a problem. |
209 |
+ */ |
210 |
+ proc->debugfs_entry = debugfs_create_file(strbuf, 0444, |
211 |
+ binder_debugfs_dir_entry_proc, |
212 |
+@@ -5259,19 +5265,16 @@ static int binder_open(struct inode *nodp, struct file *filp) |
213 |
+ &proc_fops); |
214 |
+ } |
215 |
+ |
216 |
+- if (binder_binderfs_dir_entry_proc) { |
217 |
++ if (binder_binderfs_dir_entry_proc && !existing_pid) { |
218 |
+ char strbuf[11]; |
219 |
+ struct dentry *binderfs_entry; |
220 |
+ |
221 |
+ snprintf(strbuf, sizeof(strbuf), "%u", proc->pid); |
222 |
+ /* |
223 |
+ * Similar to debugfs, the process specific log file is shared |
224 |
+- * between contexts. If the file has already been created for a |
225 |
+- * process, the following binderfs_create_file() call will |
226 |
+- * fail with error code EEXIST if another context of the same |
227 |
+- * process invoked binder_open(). This is ok since same as |
228 |
+- * debugfs, the log file will contain information on all |
229 |
+- * contexts of a given PID. |
230 |
++ * between contexts. Only create for the first PID. |
231 |
++ * This is ok since same as debugfs, the log file will contain |
232 |
++ * information on all contexts of a given PID. |
233 |
+ */ |
234 |
+ binderfs_entry = binderfs_create_file(binder_binderfs_dir_entry_proc, |
235 |
+ strbuf, &proc_fops, (void *)(unsigned long)proc->pid); |
236 |
+@@ -5281,10 +5284,8 @@ static int binder_open(struct inode *nodp, struct file *filp) |
237 |
+ int error; |
238 |
+ |
239 |
+ error = PTR_ERR(binderfs_entry); |
240 |
+- if (error != -EEXIST) { |
241 |
+- pr_warn("Unable to create file %s in binderfs (error %d)\n", |
242 |
+- strbuf, error); |
243 |
+- } |
244 |
++ pr_warn("Unable to create file %s in binderfs (error %d)\n", |
245 |
++ strbuf, error); |
246 |
+ } |
247 |
+ } |
248 |
+ |
249 |
+diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c |
250 |
+index b23d1e4bad33..9d0d65efcd94 100644 |
251 |
+--- a/drivers/atm/eni.c |
252 |
++++ b/drivers/atm/eni.c |
253 |
+@@ -374,7 +374,7 @@ static int do_rx_dma(struct atm_vcc *vcc,struct sk_buff *skb, |
254 |
+ here = (eni_vcc->descr+skip) & (eni_vcc->words-1); |
255 |
+ dma[j++] = (here << MID_DMA_COUNT_SHIFT) | (vcc->vci |
256 |
+ << MID_DMA_VCI_SHIFT) | MID_DT_JK; |
257 |
+- j++; |
258 |
++ dma[j++] = 0; |
259 |
+ } |
260 |
+ here = (eni_vcc->descr+size+skip) & (eni_vcc->words-1); |
261 |
+ if (!eff) size += skip; |
262 |
+@@ -447,7 +447,7 @@ static int do_rx_dma(struct atm_vcc *vcc,struct sk_buff *skb, |
263 |
+ if (size != eff) { |
264 |
+ dma[j++] = (here << MID_DMA_COUNT_SHIFT) | |
265 |
+ (vcc->vci << MID_DMA_VCI_SHIFT) | MID_DT_JK; |
266 |
+- j++; |
267 |
++ dma[j++] = 0; |
268 |
+ } |
269 |
+ if (!j || j > 2*RX_DMA_BUF) { |
270 |
+ printk(KERN_CRIT DEV_LABEL "!j or j too big!!!\n"); |
271 |
+diff --git a/drivers/base/component.c b/drivers/base/component.c |
272 |
+index 532a3a5d8f63..1fdbd6ff2058 100644 |
273 |
+--- a/drivers/base/component.c |
274 |
++++ b/drivers/base/component.c |
275 |
+@@ -102,11 +102,11 @@ static int component_devices_show(struct seq_file *s, void *data) |
276 |
+ seq_printf(s, "%-40s %20s\n", "device name", "status"); |
277 |
+ seq_puts(s, "-------------------------------------------------------------\n"); |
278 |
+ for (i = 0; i < match->num; i++) { |
279 |
+- struct device *d = (struct device *)match->compare[i].data; |
280 |
++ struct component *component = match->compare[i].component; |
281 |
+ |
282 |
+- seq_printf(s, "%-40s %20s\n", dev_name(d), |
283 |
+- match->compare[i].component ? |
284 |
+- "registered" : "not registered"); |
285 |
++ seq_printf(s, "%-40s %20s\n", |
286 |
++ component ? dev_name(component->dev) : "(unknown)", |
287 |
++ component ? (component->bound ? "bound" : "not bound") : "not registered"); |
288 |
+ } |
289 |
+ mutex_unlock(&component_mutex); |
290 |
+ |
291 |
+diff --git a/drivers/base/test/test_async_driver_probe.c b/drivers/base/test/test_async_driver_probe.c |
292 |
+index f4b1d8e54daf..3bb7beb127a9 100644 |
293 |
+--- a/drivers/base/test/test_async_driver_probe.c |
294 |
++++ b/drivers/base/test/test_async_driver_probe.c |
295 |
+@@ -44,7 +44,8 @@ static int test_probe(struct platform_device *pdev) |
296 |
+ * performing an async init on that node. |
297 |
+ */ |
298 |
+ if (dev->driver->probe_type == PROBE_PREFER_ASYNCHRONOUS) { |
299 |
+- if (dev_to_node(dev) != numa_node_id()) { |
300 |
++ if (IS_ENABLED(CONFIG_NUMA) && |
301 |
++ dev_to_node(dev) != numa_node_id()) { |
302 |
+ dev_warn(dev, "NUMA node mismatch %d != %d\n", |
303 |
+ dev_to_node(dev), numa_node_id()); |
304 |
+ atomic_inc(&warnings); |
305 |
+diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c |
306 |
+index 2d2e6d862068..f02a4bdc0ca7 100644 |
307 |
+--- a/drivers/bluetooth/btbcm.c |
308 |
++++ b/drivers/bluetooth/btbcm.c |
309 |
+@@ -440,6 +440,12 @@ int btbcm_finalize(struct hci_dev *hdev) |
310 |
+ |
311 |
+ set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); |
312 |
+ |
313 |
++ /* Some devices ship with the controller default address. |
314 |
++ * Allow the bootloader to set a valid address through the |
315 |
++ * device tree. |
316 |
++ */ |
317 |
++ set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); |
318 |
++ |
319 |
+ return 0; |
320 |
+ } |
321 |
+ EXPORT_SYMBOL_GPL(btbcm_finalize); |
322 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
323 |
+index 04cf767d0708..4e7ef35f1c8f 100644 |
324 |
+--- a/drivers/bluetooth/btusb.c |
325 |
++++ b/drivers/bluetooth/btusb.c |
326 |
+@@ -2585,7 +2585,7 @@ static void btusb_mtk_wmt_recv(struct urb *urb) |
327 |
+ * and being processed the events from there then. |
328 |
+ */ |
329 |
+ if (test_bit(BTUSB_TX_WAIT_VND_EVT, &data->flags)) { |
330 |
+- data->evt_skb = skb_clone(skb, GFP_KERNEL); |
331 |
++ data->evt_skb = skb_clone(skb, GFP_ATOMIC); |
332 |
+ if (!data->evt_skb) |
333 |
+ goto err_out; |
334 |
+ } |
335 |
+diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c |
336 |
+index abbf281ee337..d9846265a5cd 100644 |
337 |
+--- a/drivers/bus/ti-sysc.c |
338 |
++++ b/drivers/bus/ti-sysc.c |
339 |
+@@ -923,6 +923,9 @@ set_midle: |
340 |
+ return -EINVAL; |
341 |
+ } |
342 |
+ |
343 |
++ if (ddata->cfg.quirks & SYSC_QUIRK_SWSUP_MSTANDBY) |
344 |
++ best_mode = SYSC_IDLE_NO; |
345 |
++ |
346 |
+ reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift); |
347 |
+ reg |= best_mode << regbits->midle_shift; |
348 |
+ sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); |
349 |
+@@ -984,6 +987,10 @@ static int sysc_disable_module(struct device *dev) |
350 |
+ return ret; |
351 |
+ } |
352 |
+ |
353 |
++ if (ddata->cfg.quirks & (SYSC_QUIRK_SWSUP_MSTANDBY) || |
354 |
++ ddata->cfg.quirks & (SYSC_QUIRK_FORCE_MSTANDBY)) |
355 |
++ best_mode = SYSC_IDLE_FORCE; |
356 |
++ |
357 |
+ reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift); |
358 |
+ reg |= best_mode << regbits->midle_shift; |
359 |
+ sysc_write(ddata, ddata->offsets[SYSC_SYSCONFIG], reg); |
360 |
+@@ -1242,6 +1249,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { |
361 |
+ SYSC_QUIRK_SWSUP_SIDLE), |
362 |
+ |
363 |
+ /* Quirks that need to be set based on detected module */ |
364 |
++ SYSC_QUIRK("aess", 0, 0, 0x10, -1, 0x40000000, 0xffffffff, |
365 |
++ SYSC_MODULE_QUIRK_AESS), |
366 |
+ SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x00000006, 0xffffffff, |
367 |
+ SYSC_MODULE_QUIRK_HDQ1W), |
368 |
+ SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x0000000a, 0xffffffff, |
369 |
+@@ -1257,6 +1266,10 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { |
370 |
+ SYSC_QUIRK("gpu", 0x50000000, 0x14, -1, -1, 0x00010201, 0xffffffff, 0), |
371 |
+ SYSC_QUIRK("gpu", 0x50000000, 0xfe00, 0xfe10, -1, 0x40000000 , 0xffffffff, |
372 |
+ SYSC_MODULE_QUIRK_SGX), |
373 |
++ SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050, |
374 |
++ 0xffffffff, SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), |
375 |
++ SYSC_QUIRK("usb_otg_hs", 0, 0, 0x10, -1, 0x4ea2080d, 0xffffffff, |
376 |
++ SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY), |
377 |
+ SYSC_QUIRK("wdt", 0, 0, 0x10, 0x14, 0x502a0500, 0xfffff0f0, |
378 |
+ SYSC_MODULE_QUIRK_WDT), |
379 |
+ /* Watchdog on am3 and am4 */ |
380 |
+@@ -1266,7 +1279,6 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { |
381 |
+ #ifdef DEBUG |
382 |
+ SYSC_QUIRK("adc", 0, 0, 0x10, -1, 0x47300001, 0xffffffff, 0), |
383 |
+ SYSC_QUIRK("atl", 0, 0, -1, -1, 0x0a070100, 0xffffffff, 0), |
384 |
+- SYSC_QUIRK("aess", 0, 0, 0x10, -1, 0x40000000, 0xffffffff, 0), |
385 |
+ SYSC_QUIRK("cm", 0, 0, -1, -1, 0x40000301, 0xffffffff, 0), |
386 |
+ SYSC_QUIRK("control", 0, 0, 0x10, -1, 0x40000900, 0xffffffff, 0), |
387 |
+ SYSC_QUIRK("cpgmac", 0, 0x1200, 0x1208, 0x1204, 0x4edb1902, |
388 |
+@@ -1315,8 +1327,6 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { |
389 |
+ SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000008, 0xffffffff, 0), |
390 |
+ SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, 0x14, 0x50700100, 0xffffffff, 0), |
391 |
+ SYSC_QUIRK("usb_host_hs", 0, 0, 0x10, -1, 0x50700101, 0xffffffff, 0), |
392 |
+- SYSC_QUIRK("usb_otg_hs", 0, 0x400, 0x404, 0x408, 0x00000050, |
393 |
+- 0xffffffff, 0), |
394 |
+ SYSC_QUIRK("vfpe", 0, 0, 0x104, -1, 0x4d001200, 0xffffffff, 0), |
395 |
+ #endif |
396 |
+ }; |
397 |
+@@ -1400,6 +1410,14 @@ static void sysc_clk_enable_quirk_hdq1w(struct sysc *ddata) |
398 |
+ sysc_write(ddata, offset, val); |
399 |
+ } |
400 |
+ |
401 |
++/* AESS (Audio Engine SubSystem) needs autogating set after enable */ |
402 |
++static void sysc_module_enable_quirk_aess(struct sysc *ddata) |
403 |
++{ |
404 |
++ int offset = 0x7c; /* AESS_AUTO_GATING_ENABLE */ |
405 |
++ |
406 |
++ sysc_write(ddata, offset, 1); |
407 |
++} |
408 |
++ |
409 |
+ /* I2C needs extra enable bit toggling for reset */ |
410 |
+ static void sysc_clk_quirk_i2c(struct sysc *ddata, bool enable) |
411 |
+ { |
412 |
+@@ -1482,6 +1500,9 @@ static void sysc_init_module_quirks(struct sysc *ddata) |
413 |
+ return; |
414 |
+ } |
415 |
+ |
416 |
++ if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_AESS) |
417 |
++ ddata->module_enable_quirk = sysc_module_enable_quirk_aess; |
418 |
++ |
419 |
+ if (ddata->cfg.quirks & SYSC_MODULE_QUIRK_SGX) |
420 |
+ ddata->module_enable_quirk = sysc_module_enable_quirk_sgx; |
421 |
+ |
422 |
+diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c |
423 |
+index db22777d59b4..62930351ccd9 100644 |
424 |
+--- a/drivers/crypto/caam/ctrl.c |
425 |
++++ b/drivers/crypto/caam/ctrl.c |
426 |
+@@ -685,11 +685,9 @@ static int caam_probe(struct platform_device *pdev) |
427 |
+ of_node_put(np); |
428 |
+ |
429 |
+ if (!ctrlpriv->mc_en) |
430 |
+- clrsetbits_32(&ctrl->mcr, MCFGR_AWCACHE_MASK | MCFGR_LONG_PTR, |
431 |
++ clrsetbits_32(&ctrl->mcr, MCFGR_AWCACHE_MASK, |
432 |
+ MCFGR_AWCACHE_CACH | MCFGR_AWCACHE_BUFF | |
433 |
+- MCFGR_WDENABLE | MCFGR_LARGE_BURST | |
434 |
+- (sizeof(dma_addr_t) == sizeof(u64) ? |
435 |
+- MCFGR_LONG_PTR : 0)); |
436 |
++ MCFGR_WDENABLE | MCFGR_LARGE_BURST); |
437 |
+ |
438 |
+ handle_imx6_err005766(&ctrl->mcr); |
439 |
+ |
440 |
+diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c |
441 |
+index 38ee38b37ae6..01dd418bdadc 100644 |
442 |
+--- a/drivers/crypto/chelsio/chcr_algo.c |
443 |
++++ b/drivers/crypto/chelsio/chcr_algo.c |
444 |
+@@ -3194,9 +3194,6 @@ static int chcr_gcm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) |
445 |
+ aeadctx->mayverify = VERIFY_SW; |
446 |
+ break; |
447 |
+ default: |
448 |
+- |
449 |
+- crypto_tfm_set_flags((struct crypto_tfm *) tfm, |
450 |
+- CRYPTO_TFM_RES_BAD_KEY_LEN); |
451 |
+ return -EINVAL; |
452 |
+ } |
453 |
+ return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); |
454 |
+@@ -3221,8 +3218,6 @@ static int chcr_4106_4309_setauthsize(struct crypto_aead *tfm, |
455 |
+ aeadctx->mayverify = VERIFY_HW; |
456 |
+ break; |
457 |
+ default: |
458 |
+- crypto_tfm_set_flags((struct crypto_tfm *)tfm, |
459 |
+- CRYPTO_TFM_RES_BAD_KEY_LEN); |
460 |
+ return -EINVAL; |
461 |
+ } |
462 |
+ return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); |
463 |
+@@ -3263,8 +3258,6 @@ static int chcr_ccm_setauthsize(struct crypto_aead *tfm, |
464 |
+ aeadctx->mayverify = VERIFY_HW; |
465 |
+ break; |
466 |
+ default: |
467 |
+- crypto_tfm_set_flags((struct crypto_tfm *)tfm, |
468 |
+- CRYPTO_TFM_RES_BAD_KEY_LEN); |
469 |
+ return -EINVAL; |
470 |
+ } |
471 |
+ return crypto_aead_setauthsize(aeadctx->sw_cipher, authsize); |
472 |
+@@ -3289,8 +3282,7 @@ static int chcr_ccm_common_setkey(struct crypto_aead *aead, |
473 |
+ ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_256; |
474 |
+ mk_size = CHCR_KEYCTX_MAC_KEY_SIZE_256; |
475 |
+ } else { |
476 |
+- crypto_tfm_set_flags((struct crypto_tfm *)aead, |
477 |
+- CRYPTO_TFM_RES_BAD_KEY_LEN); |
478 |
++ crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN); |
479 |
+ aeadctx->enckey_len = 0; |
480 |
+ return -EINVAL; |
481 |
+ } |
482 |
+@@ -3328,8 +3320,7 @@ static int chcr_aead_rfc4309_setkey(struct crypto_aead *aead, const u8 *key, |
483 |
+ int error; |
484 |
+ |
485 |
+ if (keylen < 3) { |
486 |
+- crypto_tfm_set_flags((struct crypto_tfm *)aead, |
487 |
+- CRYPTO_TFM_RES_BAD_KEY_LEN); |
488 |
++ crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN); |
489 |
+ aeadctx->enckey_len = 0; |
490 |
+ return -EINVAL; |
491 |
+ } |
492 |
+@@ -3379,8 +3370,7 @@ static int chcr_gcm_setkey(struct crypto_aead *aead, const u8 *key, |
493 |
+ } else if (keylen == AES_KEYSIZE_256) { |
494 |
+ ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_256; |
495 |
+ } else { |
496 |
+- crypto_tfm_set_flags((struct crypto_tfm *)aead, |
497 |
+- CRYPTO_TFM_RES_BAD_KEY_LEN); |
498 |
++ crypto_aead_set_flags(aead, CRYPTO_TFM_RES_BAD_KEY_LEN); |
499 |
+ pr_err("GCM: Invalid key length %d\n", keylen); |
500 |
+ ret = -EINVAL; |
501 |
+ goto out; |
502 |
+diff --git a/drivers/crypto/vmx/aes_xts.c b/drivers/crypto/vmx/aes_xts.c |
503 |
+index d59e736882f6..9fee1b1532a4 100644 |
504 |
+--- a/drivers/crypto/vmx/aes_xts.c |
505 |
++++ b/drivers/crypto/vmx/aes_xts.c |
506 |
+@@ -84,6 +84,9 @@ static int p8_aes_xts_crypt(struct skcipher_request *req, int enc) |
507 |
+ u8 tweak[AES_BLOCK_SIZE]; |
508 |
+ int ret; |
509 |
+ |
510 |
++ if (req->cryptlen < AES_BLOCK_SIZE) |
511 |
++ return -EINVAL; |
512 |
++ |
513 |
+ if (!crypto_simd_usable() || (req->cryptlen % XTS_BLOCK_SIZE) != 0) { |
514 |
+ struct skcipher_request *subreq = skcipher_request_ctx(req); |
515 |
+ |
516 |
+diff --git a/drivers/extcon/extcon-intel-cht-wc.c b/drivers/extcon/extcon-intel-cht-wc.c |
517 |
+index 9d32150e68db..771f6f4cf92e 100644 |
518 |
+--- a/drivers/extcon/extcon-intel-cht-wc.c |
519 |
++++ b/drivers/extcon/extcon-intel-cht-wc.c |
520 |
+@@ -338,6 +338,7 @@ static int cht_wc_extcon_probe(struct platform_device *pdev) |
521 |
+ struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent); |
522 |
+ struct cht_wc_extcon_data *ext; |
523 |
+ unsigned long mask = ~(CHT_WC_PWRSRC_VBUS | CHT_WC_PWRSRC_USBID_MASK); |
524 |
++ int pwrsrc_sts, id; |
525 |
+ int irq, ret; |
526 |
+ |
527 |
+ irq = platform_get_irq(pdev, 0); |
528 |
+@@ -387,8 +388,19 @@ static int cht_wc_extcon_probe(struct platform_device *pdev) |
529 |
+ goto disable_sw_control; |
530 |
+ } |
531 |
+ |
532 |
+- /* Route D+ and D- to PMIC for initial charger detection */ |
533 |
+- cht_wc_extcon_set_phymux(ext, MUX_SEL_PMIC); |
534 |
++ ret = regmap_read(ext->regmap, CHT_WC_PWRSRC_STS, &pwrsrc_sts); |
535 |
++ if (ret) { |
536 |
++ dev_err(ext->dev, "Error reading pwrsrc status: %d\n", ret); |
537 |
++ goto disable_sw_control; |
538 |
++ } |
539 |
++ |
540 |
++ /* |
541 |
++ * If no USB host or device connected, route D+ and D- to PMIC for |
542 |
++ * initial charger detection |
543 |
++ */ |
544 |
++ id = cht_wc_extcon_get_id(ext, pwrsrc_sts); |
545 |
++ if (id != INTEL_USB_ID_GND) |
546 |
++ cht_wc_extcon_set_phymux(ext, MUX_SEL_PMIC); |
547 |
+ |
548 |
+ /* Get initial state */ |
549 |
+ cht_wc_extcon_pwrsrc_event(ext); |
550 |
+diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig |
551 |
+index ceb908f7dbe5..f9263426af03 100644 |
552 |
+--- a/drivers/gpio/Kconfig |
553 |
++++ b/drivers/gpio/Kconfig |
554 |
+@@ -1120,6 +1120,7 @@ config GPIO_MADERA |
555 |
+ config GPIO_MAX77620 |
556 |
+ tristate "GPIO support for PMIC MAX77620 and MAX20024" |
557 |
+ depends on MFD_MAX77620 |
558 |
++ select GPIOLIB_IRQCHIP |
559 |
+ help |
560 |
+ GPIO driver for MAX77620 and MAX20024 PMIC from Maxim Semiconductor. |
561 |
+ MAX77620 PMIC has 8 pins that can be configured as GPIOs. The |
562 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |
563 |
+index 33a1099e2f33..bb9a2771a0f9 100644 |
564 |
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |
565 |
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c |
566 |
+@@ -1023,6 +1023,7 @@ static const struct pci_device_id pciidlist[] = { |
567 |
+ |
568 |
+ /* Navi12 */ |
569 |
+ {0x1002, 0x7360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI12|AMD_EXP_HW_SUPPORT}, |
570 |
++ {0x1002, 0x7362, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_NAVI12|AMD_EXP_HW_SUPPORT}, |
571 |
+ |
572 |
+ {0, 0, 0} |
573 |
+ }; |
574 |
+diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |
575 |
+index 4e9c15c409ba..360c87ba4595 100644 |
576 |
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |
577 |
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |
578 |
+@@ -3266,27 +3266,21 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing) |
579 |
+ return color_space; |
580 |
+ } |
581 |
+ |
582 |
+-static void reduce_mode_colour_depth(struct dc_crtc_timing *timing_out) |
583 |
+-{ |
584 |
+- if (timing_out->display_color_depth <= COLOR_DEPTH_888) |
585 |
+- return; |
586 |
+- |
587 |
+- timing_out->display_color_depth--; |
588 |
+-} |
589 |
+- |
590 |
+-static void adjust_colour_depth_from_display_info(struct dc_crtc_timing *timing_out, |
591 |
+- const struct drm_display_info *info) |
592 |
++static bool adjust_colour_depth_from_display_info( |
593 |
++ struct dc_crtc_timing *timing_out, |
594 |
++ const struct drm_display_info *info) |
595 |
+ { |
596 |
++ enum dc_color_depth depth = timing_out->display_color_depth; |
597 |
+ int normalized_clk; |
598 |
+- if (timing_out->display_color_depth <= COLOR_DEPTH_888) |
599 |
+- return; |
600 |
+ do { |
601 |
+ normalized_clk = timing_out->pix_clk_100hz / 10; |
602 |
+ /* YCbCr 4:2:0 requires additional adjustment of 1/2 */ |
603 |
+ if (timing_out->pixel_encoding == PIXEL_ENCODING_YCBCR420) |
604 |
+ normalized_clk /= 2; |
605 |
+ /* Adjusting pix clock following on HDMI spec based on colour depth */ |
606 |
+- switch (timing_out->display_color_depth) { |
607 |
++ switch (depth) { |
608 |
++ case COLOR_DEPTH_888: |
609 |
++ break; |
610 |
+ case COLOR_DEPTH_101010: |
611 |
+ normalized_clk = (normalized_clk * 30) / 24; |
612 |
+ break; |
613 |
+@@ -3297,14 +3291,15 @@ static void adjust_colour_depth_from_display_info(struct dc_crtc_timing *timing_ |
614 |
+ normalized_clk = (normalized_clk * 48) / 24; |
615 |
+ break; |
616 |
+ default: |
617 |
+- return; |
618 |
++ /* The above depths are the only ones valid for HDMI. */ |
619 |
++ return false; |
620 |
+ } |
621 |
+- if (normalized_clk <= info->max_tmds_clock) |
622 |
+- return; |
623 |
+- reduce_mode_colour_depth(timing_out); |
624 |
+- |
625 |
+- } while (timing_out->display_color_depth > COLOR_DEPTH_888); |
626 |
+- |
627 |
++ if (normalized_clk <= info->max_tmds_clock) { |
628 |
++ timing_out->display_color_depth = depth; |
629 |
++ return true; |
630 |
++ } |
631 |
++ } while (--depth > COLOR_DEPTH_666); |
632 |
++ return false; |
633 |
+ } |
634 |
+ |
635 |
+ static void fill_stream_properties_from_drm_display_mode( |
636 |
+@@ -3370,8 +3365,14 @@ static void fill_stream_properties_from_drm_display_mode( |
637 |
+ |
638 |
+ stream->out_transfer_func->type = TF_TYPE_PREDEFINED; |
639 |
+ stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB; |
640 |
+- if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) |
641 |
+- adjust_colour_depth_from_display_info(timing_out, info); |
642 |
++ if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) { |
643 |
++ if (!adjust_colour_depth_from_display_info(timing_out, info) && |
644 |
++ drm_mode_is_420_also(info, mode_in) && |
645 |
++ timing_out->pixel_encoding != PIXEL_ENCODING_YCBCR420) { |
646 |
++ timing_out->pixel_encoding = PIXEL_ENCODING_YCBCR420; |
647 |
++ adjust_colour_depth_from_display_info(timing_out, info); |
648 |
++ } |
649 |
++ } |
650 |
+ } |
651 |
+ |
652 |
+ static void fill_audio_info(struct audio_info *audio_info, |
653 |
+diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c |
654 |
+index 8063b1d567b1..e6e4c841fb06 100644 |
655 |
+--- a/drivers/hid/hid-asus.c |
656 |
++++ b/drivers/hid/hid-asus.c |
657 |
+@@ -261,7 +261,8 @@ static int asus_event(struct hid_device *hdev, struct hid_field *field, |
658 |
+ struct hid_usage *usage, __s32 value) |
659 |
+ { |
660 |
+ if ((usage->hid & HID_USAGE_PAGE) == 0xff310000 && |
661 |
+- (usage->hid & HID_USAGE) != 0x00 && !usage->type) { |
662 |
++ (usage->hid & HID_USAGE) != 0x00 && |
663 |
++ (usage->hid & HID_USAGE) != 0xff && !usage->type) { |
664 |
+ hid_warn(hdev, "Unmapped Asus vendor usagepage code 0x%02x\n", |
665 |
+ usage->hid & HID_USAGE); |
666 |
+ } |
667 |
+diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h |
668 |
+index 6273e7178e78..5fc82029a03b 100644 |
669 |
+--- a/drivers/hid/hid-ids.h |
670 |
++++ b/drivers/hid/hid-ids.h |
671 |
+@@ -631,6 +631,7 @@ |
672 |
+ #define USB_VENDOR_ID_ITE 0x048d |
673 |
+ #define USB_DEVICE_ID_ITE_LENOVO_YOGA 0x8386 |
674 |
+ #define USB_DEVICE_ID_ITE_LENOVO_YOGA2 0x8350 |
675 |
++#define I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720 0x837a |
676 |
+ #define USB_DEVICE_ID_ITE_LENOVO_YOGA900 0x8396 |
677 |
+ #define USB_DEVICE_ID_ITE8595 0x8595 |
678 |
+ |
679 |
+@@ -730,6 +731,7 @@ |
680 |
+ #define USB_DEVICE_ID_LG_MULTITOUCH 0x0064 |
681 |
+ #define USB_DEVICE_ID_LG_MELFAS_MT 0x6007 |
682 |
+ #define I2C_DEVICE_ID_LG_8001 0x8001 |
683 |
++#define I2C_DEVICE_ID_LG_7010 0x7010 |
684 |
+ |
685 |
+ #define USB_VENDOR_ID_LOGITECH 0x046d |
686 |
+ #define USB_DEVICE_ID_LOGITECH_AUDIOHUB 0x0a0e |
687 |
+@@ -1098,6 +1100,7 @@ |
688 |
+ #define USB_DEVICE_ID_SYNAPTICS_LTS2 0x1d10 |
689 |
+ #define USB_DEVICE_ID_SYNAPTICS_HD 0x0ac3 |
690 |
+ #define USB_DEVICE_ID_SYNAPTICS_QUAD_HD 0x1ac3 |
691 |
++#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012 0x2968 |
692 |
+ #define USB_DEVICE_ID_SYNAPTICS_TP_V103 0x5710 |
693 |
+ #define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5 0x81a7 |
694 |
+ |
695 |
+diff --git a/drivers/hid/hid-ite.c b/drivers/hid/hid-ite.c |
696 |
+index a45f2352618d..c436e12feb23 100644 |
697 |
+--- a/drivers/hid/hid-ite.c |
698 |
++++ b/drivers/hid/hid-ite.c |
699 |
+@@ -40,6 +40,9 @@ static int ite_event(struct hid_device *hdev, struct hid_field *field, |
700 |
+ static const struct hid_device_id ite_devices[] = { |
701 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_ITE, USB_DEVICE_ID_ITE8595) }, |
702 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_258A, USB_DEVICE_ID_258A_6A88) }, |
703 |
++ /* ITE8595 USB kbd ctlr, with Synaptics touchpad connected to it. */ |
704 |
++ { HID_USB_DEVICE(USB_VENDOR_ID_SYNAPTICS, |
705 |
++ USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012) }, |
706 |
+ { } |
707 |
+ }; |
708 |
+ MODULE_DEVICE_TABLE(hid, ite_devices); |
709 |
+diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c |
710 |
+index 3cfeb1629f79..362805ddf377 100644 |
711 |
+--- a/drivers/hid/hid-multitouch.c |
712 |
++++ b/drivers/hid/hid-multitouch.c |
713 |
+@@ -1019,7 +1019,7 @@ static int mt_process_slot(struct mt_device *td, struct input_dev *input, |
714 |
+ tool = MT_TOOL_DIAL; |
715 |
+ else if (unlikely(!confidence_state)) { |
716 |
+ tool = MT_TOOL_PALM; |
717 |
+- if (!active && |
718 |
++ if (!active && mt && |
719 |
+ input_mt_is_active(&mt->slots[slotnum])) { |
720 |
+ /* |
721 |
+ * The non-confidence was reported for |
722 |
+@@ -1985,6 +1985,9 @@ static const struct hid_device_id mt_devices[] = { |
723 |
+ { .driver_data = MT_CLS_LG, |
724 |
+ HID_USB_DEVICE(USB_VENDOR_ID_LG, |
725 |
+ USB_DEVICE_ID_LG_MELFAS_MT) }, |
726 |
++ { .driver_data = MT_CLS_LG, |
727 |
++ HID_DEVICE(BUS_I2C, HID_GROUP_GENERIC, |
728 |
++ USB_VENDOR_ID_LG, I2C_DEVICE_ID_LG_7010) }, |
729 |
+ |
730 |
+ /* MosArt panels */ |
731 |
+ { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE, |
732 |
+diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c |
733 |
+index 9a35af1e2662..fa58a7cbb3ff 100644 |
734 |
+--- a/drivers/hid/hid-quirks.c |
735 |
++++ b/drivers/hid/hid-quirks.c |
736 |
+@@ -174,6 +174,7 @@ static const struct hid_device_id hid_quirks[] = { |
737 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET), HID_QUIRK_MULTI_INPUT }, |
738 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, |
739 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, |
740 |
++ { HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT }, |
741 |
+ |
742 |
+ { 0 } |
743 |
+ }; |
744 |
+diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c |
745 |
+index 8dae0f9b819e..6286204d4c56 100644 |
746 |
+--- a/drivers/hid/hid-steam.c |
747 |
++++ b/drivers/hid/hid-steam.c |
748 |
+@@ -768,8 +768,12 @@ static int steam_probe(struct hid_device *hdev, |
749 |
+ |
750 |
+ if (steam->quirks & STEAM_QUIRK_WIRELESS) { |
751 |
+ hid_info(hdev, "Steam wireless receiver connected"); |
752 |
++ /* If using a wireless adaptor ask for connection status */ |
753 |
++ steam->connected = false; |
754 |
+ steam_request_conn_status(steam); |
755 |
+ } else { |
756 |
++ /* A wired connection is always present */ |
757 |
++ steam->connected = true; |
758 |
+ ret = steam_register(steam); |
759 |
+ if (ret) { |
760 |
+ hid_err(hdev, |
761 |
+diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c |
762 |
+index ac44bf752ff1..479934f7d241 100644 |
763 |
+--- a/drivers/hid/i2c-hid/i2c-hid-core.c |
764 |
++++ b/drivers/hid/i2c-hid/i2c-hid-core.c |
765 |
+@@ -49,6 +49,8 @@ |
766 |
+ #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1) |
767 |
+ #define I2C_HID_QUIRK_BOGUS_IRQ BIT(4) |
768 |
+ #define I2C_HID_QUIRK_RESET_ON_RESUME BIT(5) |
769 |
++#define I2C_HID_QUIRK_BAD_INPUT_SIZE BIT(6) |
770 |
++ |
771 |
+ |
772 |
+ /* flags */ |
773 |
+ #define I2C_HID_STARTED 0 |
774 |
+@@ -177,6 +179,8 @@ static const struct i2c_hid_quirks { |
775 |
+ I2C_HID_QUIRK_BOGUS_IRQ }, |
776 |
+ { USB_VENDOR_ID_ALPS_JP, HID_ANY_ID, |
777 |
+ I2C_HID_QUIRK_RESET_ON_RESUME }, |
778 |
++ { USB_VENDOR_ID_ITE, I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720, |
779 |
++ I2C_HID_QUIRK_BAD_INPUT_SIZE }, |
780 |
+ { 0, 0 } |
781 |
+ }; |
782 |
+ |
783 |
+@@ -498,9 +502,15 @@ static void i2c_hid_get_input(struct i2c_hid *ihid) |
784 |
+ } |
785 |
+ |
786 |
+ if ((ret_size > size) || (ret_size < 2)) { |
787 |
+- dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n", |
788 |
+- __func__, size, ret_size); |
789 |
+- return; |
790 |
++ if (ihid->quirks & I2C_HID_QUIRK_BAD_INPUT_SIZE) { |
791 |
++ ihid->inbuf[0] = size & 0xff; |
792 |
++ ihid->inbuf[1] = size >> 8; |
793 |
++ ret_size = size; |
794 |
++ } else { |
795 |
++ dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n", |
796 |
++ __func__, size, ret_size); |
797 |
++ return; |
798 |
++ } |
799 |
+ } |
800 |
+ |
801 |
+ i2c_hid_dbg(ihid, "input: %*ph\n", ret_size, ihid->inbuf); |
802 |
+diff --git a/drivers/hid/intel-ish-hid/ipc/hw-ish.h b/drivers/hid/intel-ish-hid/ipc/hw-ish.h |
803 |
+index 6c1e6110867f..1fb294ca463e 100644 |
804 |
+--- a/drivers/hid/intel-ish-hid/ipc/hw-ish.h |
805 |
++++ b/drivers/hid/intel-ish-hid/ipc/hw-ish.h |
806 |
+@@ -24,7 +24,9 @@ |
807 |
+ #define ICL_MOBILE_DEVICE_ID 0x34FC |
808 |
+ #define SPT_H_DEVICE_ID 0xA135 |
809 |
+ #define CML_LP_DEVICE_ID 0x02FC |
810 |
++#define CMP_H_DEVICE_ID 0x06FC |
811 |
+ #define EHL_Ax_DEVICE_ID 0x4BB3 |
812 |
++#define TGL_LP_DEVICE_ID 0xA0FC |
813 |
+ |
814 |
+ #define REVISION_ID_CHT_A0 0x6 |
815 |
+ #define REVISION_ID_CHT_Ax_SI 0x0 |
816 |
+diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c |
817 |
+index 784dcc8c7022..f491d8b4e24c 100644 |
818 |
+--- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c |
819 |
++++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c |
820 |
+@@ -34,7 +34,9 @@ static const struct pci_device_id ish_pci_tbl[] = { |
821 |
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, ICL_MOBILE_DEVICE_ID)}, |
822 |
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, SPT_H_DEVICE_ID)}, |
823 |
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, CML_LP_DEVICE_ID)}, |
824 |
++ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, CMP_H_DEVICE_ID)}, |
825 |
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, EHL_Ax_DEVICE_ID)}, |
826 |
++ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, TGL_LP_DEVICE_ID)}, |
827 |
+ {0, } |
828 |
+ }; |
829 |
+ MODULE_DEVICE_TABLE(pci, ish_pci_tbl); |
830 |
+diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c |
831 |
+index ccb74529bc78..d99a9d407671 100644 |
832 |
+--- a/drivers/hid/wacom_wac.c |
833 |
++++ b/drivers/hid/wacom_wac.c |
834 |
+@@ -2096,14 +2096,16 @@ static void wacom_wac_pad_event(struct hid_device *hdev, struct hid_field *field |
835 |
+ (hdev->product == 0x34d || hdev->product == 0x34e || /* MobileStudio Pro */ |
836 |
+ hdev->product == 0x357 || hdev->product == 0x358 || /* Intuos Pro 2 */ |
837 |
+ hdev->product == 0x392 || /* Intuos Pro 2 */ |
838 |
+- hdev->product == 0x398 || hdev->product == 0x399)) { /* MobileStudio Pro */ |
839 |
++ hdev->product == 0x398 || hdev->product == 0x399 || /* MobileStudio Pro */ |
840 |
++ hdev->product == 0x3AA)) { /* MobileStudio Pro */ |
841 |
+ value = (field->logical_maximum - value); |
842 |
+ |
843 |
+ if (hdev->product == 0x357 || hdev->product == 0x358 || |
844 |
+ hdev->product == 0x392) |
845 |
+ value = wacom_offset_rotation(input, usage, value, 3, 16); |
846 |
+ else if (hdev->product == 0x34d || hdev->product == 0x34e || |
847 |
+- hdev->product == 0x398 || hdev->product == 0x399) |
848 |
++ hdev->product == 0x398 || hdev->product == 0x399 || |
849 |
++ hdev->product == 0x3AA) |
850 |
+ value = wacom_offset_rotation(input, usage, value, 1, 2); |
851 |
+ } |
852 |
+ else { |
853 |
+diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c |
854 |
+index e493242c266e..0339ecdd06bd 100644 |
855 |
+--- a/drivers/iio/adc/stm32-dfsdm-adc.c |
856 |
++++ b/drivers/iio/adc/stm32-dfsdm-adc.c |
857 |
+@@ -1204,6 +1204,8 @@ static int stm32_dfsdm_single_conv(struct iio_dev *indio_dev, |
858 |
+ |
859 |
+ stm32_dfsdm_stop_conv(adc); |
860 |
+ |
861 |
++ stm32_dfsdm_process_data(adc, res); |
862 |
++ |
863 |
+ stop_dfsdm: |
864 |
+ stm32_dfsdm_stop_dfsdm(adc->dfsdm); |
865 |
+ |
866 |
+diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c |
867 |
+index c0acbb5d2ffb..b21f72dd473c 100644 |
868 |
+--- a/drivers/iio/gyro/st_gyro_core.c |
869 |
++++ b/drivers/iio/gyro/st_gyro_core.c |
870 |
+@@ -139,7 +139,6 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = { |
871 |
+ [2] = LSM330DLC_GYRO_DEV_NAME, |
872 |
+ [3] = L3G4IS_GYRO_DEV_NAME, |
873 |
+ [4] = LSM330_GYRO_DEV_NAME, |
874 |
+- [5] = LSM9DS0_GYRO_DEV_NAME, |
875 |
+ }, |
876 |
+ .ch = (struct iio_chan_spec *)st_gyro_16bit_channels, |
877 |
+ .odr = { |
878 |
+@@ -209,6 +208,80 @@ static const struct st_sensor_settings st_gyro_sensors_settings[] = { |
879 |
+ .multi_read_bit = true, |
880 |
+ .bootime = 2, |
881 |
+ }, |
882 |
++ { |
883 |
++ .wai = 0xd4, |
884 |
++ .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, |
885 |
++ .sensors_supported = { |
886 |
++ [0] = LSM9DS0_GYRO_DEV_NAME, |
887 |
++ }, |
888 |
++ .ch = (struct iio_chan_spec *)st_gyro_16bit_channels, |
889 |
++ .odr = { |
890 |
++ .addr = 0x20, |
891 |
++ .mask = GENMASK(7, 6), |
892 |
++ .odr_avl = { |
893 |
++ { .hz = 95, .value = 0x00, }, |
894 |
++ { .hz = 190, .value = 0x01, }, |
895 |
++ { .hz = 380, .value = 0x02, }, |
896 |
++ { .hz = 760, .value = 0x03, }, |
897 |
++ }, |
898 |
++ }, |
899 |
++ .pw = { |
900 |
++ .addr = 0x20, |
901 |
++ .mask = BIT(3), |
902 |
++ .value_on = ST_SENSORS_DEFAULT_POWER_ON_VALUE, |
903 |
++ .value_off = ST_SENSORS_DEFAULT_POWER_OFF_VALUE, |
904 |
++ }, |
905 |
++ .enable_axis = { |
906 |
++ .addr = ST_SENSORS_DEFAULT_AXIS_ADDR, |
907 |
++ .mask = ST_SENSORS_DEFAULT_AXIS_MASK, |
908 |
++ }, |
909 |
++ .fs = { |
910 |
++ .addr = 0x23, |
911 |
++ .mask = GENMASK(5, 4), |
912 |
++ .fs_avl = { |
913 |
++ [0] = { |
914 |
++ .num = ST_GYRO_FS_AVL_245DPS, |
915 |
++ .value = 0x00, |
916 |
++ .gain = IIO_DEGREE_TO_RAD(8750), |
917 |
++ }, |
918 |
++ [1] = { |
919 |
++ .num = ST_GYRO_FS_AVL_500DPS, |
920 |
++ .value = 0x01, |
921 |
++ .gain = IIO_DEGREE_TO_RAD(17500), |
922 |
++ }, |
923 |
++ [2] = { |
924 |
++ .num = ST_GYRO_FS_AVL_2000DPS, |
925 |
++ .value = 0x02, |
926 |
++ .gain = IIO_DEGREE_TO_RAD(70000), |
927 |
++ }, |
928 |
++ }, |
929 |
++ }, |
930 |
++ .bdu = { |
931 |
++ .addr = 0x23, |
932 |
++ .mask = BIT(7), |
933 |
++ }, |
934 |
++ .drdy_irq = { |
935 |
++ .int2 = { |
936 |
++ .addr = 0x22, |
937 |
++ .mask = BIT(3), |
938 |
++ }, |
939 |
++ /* |
940 |
++ * The sensor has IHL (active low) and open |
941 |
++ * drain settings, but only for INT1 and not |
942 |
++ * for the DRDY line on INT2. |
943 |
++ */ |
944 |
++ .stat_drdy = { |
945 |
++ .addr = ST_SENSORS_DEFAULT_STAT_ADDR, |
946 |
++ .mask = GENMASK(2, 0), |
947 |
++ }, |
948 |
++ }, |
949 |
++ .sim = { |
950 |
++ .addr = 0x23, |
951 |
++ .value = BIT(0), |
952 |
++ }, |
953 |
++ .multi_read_bit = true, |
954 |
++ .bootime = 2, |
955 |
++ }, |
956 |
+ { |
957 |
+ .wai = 0xd7, |
958 |
+ .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, |
959 |
+diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c |
960 |
+index dd555078258c..454695b372c8 100644 |
961 |
+--- a/drivers/iommu/amd_iommu.c |
962 |
++++ b/drivers/iommu/amd_iommu.c |
963 |
+@@ -226,71 +226,61 @@ static struct iommu_dev_data *search_dev_data(u16 devid) |
964 |
+ return NULL; |
965 |
+ } |
966 |
+ |
967 |
+-static int __last_alias(struct pci_dev *pdev, u16 alias, void *data) |
968 |
++static int clone_alias(struct pci_dev *pdev, u16 alias, void *data) |
969 |
+ { |
970 |
+- *(u16 *)data = alias; |
971 |
+- return 0; |
972 |
+-} |
973 |
+- |
974 |
+-static u16 get_alias(struct device *dev) |
975 |
+-{ |
976 |
+- struct pci_dev *pdev = to_pci_dev(dev); |
977 |
+- u16 devid, ivrs_alias, pci_alias; |
978 |
+- |
979 |
+- /* The callers make sure that get_device_id() does not fail here */ |
980 |
+- devid = get_device_id(dev); |
981 |
++ u16 devid = pci_dev_id(pdev); |
982 |
+ |
983 |
+- /* For ACPI HID devices, we simply return the devid as such */ |
984 |
+- if (!dev_is_pci(dev)) |
985 |
+- return devid; |
986 |
++ if (devid == alias) |
987 |
++ return 0; |
988 |
+ |
989 |
+- ivrs_alias = amd_iommu_alias_table[devid]; |
990 |
++ amd_iommu_rlookup_table[alias] = |
991 |
++ amd_iommu_rlookup_table[devid]; |
992 |
++ memcpy(amd_iommu_dev_table[alias].data, |
993 |
++ amd_iommu_dev_table[devid].data, |
994 |
++ sizeof(amd_iommu_dev_table[alias].data)); |
995 |
+ |
996 |
+- pci_for_each_dma_alias(pdev, __last_alias, &pci_alias); |
997 |
++ return 0; |
998 |
++} |
999 |
+ |
1000 |
+- if (ivrs_alias == pci_alias) |
1001 |
+- return ivrs_alias; |
1002 |
++static void clone_aliases(struct pci_dev *pdev) |
1003 |
++{ |
1004 |
++ if (!pdev) |
1005 |
++ return; |
1006 |
+ |
1007 |
+ /* |
1008 |
+- * DMA alias showdown |
1009 |
+- * |
1010 |
+- * The IVRS is fairly reliable in telling us about aliases, but it |
1011 |
+- * can't know about every screwy device. If we don't have an IVRS |
1012 |
+- * reported alias, use the PCI reported alias. In that case we may |
1013 |
+- * still need to initialize the rlookup and dev_table entries if the |
1014 |
+- * alias is to a non-existent device. |
1015 |
++ * The IVRS alias stored in the alias table may not be |
1016 |
++ * part of the PCI DMA aliases if it's bus differs |
1017 |
++ * from the original device. |
1018 |
+ */ |
1019 |
+- if (ivrs_alias == devid) { |
1020 |
+- if (!amd_iommu_rlookup_table[pci_alias]) { |
1021 |
+- amd_iommu_rlookup_table[pci_alias] = |
1022 |
+- amd_iommu_rlookup_table[devid]; |
1023 |
+- memcpy(amd_iommu_dev_table[pci_alias].data, |
1024 |
+- amd_iommu_dev_table[devid].data, |
1025 |
+- sizeof(amd_iommu_dev_table[pci_alias].data)); |
1026 |
+- } |
1027 |
++ clone_alias(pdev, amd_iommu_alias_table[pci_dev_id(pdev)], NULL); |
1028 |
+ |
1029 |
+- return pci_alias; |
1030 |
+- } |
1031 |
++ pci_for_each_dma_alias(pdev, clone_alias, NULL); |
1032 |
++} |
1033 |
+ |
1034 |
+- pci_info(pdev, "Using IVRS reported alias %02x:%02x.%d " |
1035 |
+- "for device [%04x:%04x], kernel reported alias " |
1036 |
+- "%02x:%02x.%d\n", PCI_BUS_NUM(ivrs_alias), PCI_SLOT(ivrs_alias), |
1037 |
+- PCI_FUNC(ivrs_alias), pdev->vendor, pdev->device, |
1038 |
+- PCI_BUS_NUM(pci_alias), PCI_SLOT(pci_alias), |
1039 |
+- PCI_FUNC(pci_alias)); |
1040 |
++static struct pci_dev *setup_aliases(struct device *dev) |
1041 |
++{ |
1042 |
++ struct pci_dev *pdev = to_pci_dev(dev); |
1043 |
++ u16 ivrs_alias; |
1044 |
++ |
1045 |
++ /* For ACPI HID devices, there are no aliases */ |
1046 |
++ if (!dev_is_pci(dev)) |
1047 |
++ return NULL; |
1048 |
+ |
1049 |
+ /* |
1050 |
+- * If we don't have a PCI DMA alias and the IVRS alias is on the same |
1051 |
+- * bus, then the IVRS table may know about a quirk that we don't. |
1052 |
++ * Add the IVRS alias to the pci aliases if it is on the same |
1053 |
++ * bus. The IVRS table may know about a quirk that we don't. |
1054 |
+ */ |
1055 |
+- if (pci_alias == devid && |
1056 |
++ ivrs_alias = amd_iommu_alias_table[pci_dev_id(pdev)]; |
1057 |
++ if (ivrs_alias != pci_dev_id(pdev) && |
1058 |
+ PCI_BUS_NUM(ivrs_alias) == pdev->bus->number) { |
1059 |
+ pci_add_dma_alias(pdev, ivrs_alias & 0xff); |
1060 |
+ pci_info(pdev, "Added PCI DMA alias %02x.%d\n", |
1061 |
+ PCI_SLOT(ivrs_alias), PCI_FUNC(ivrs_alias)); |
1062 |
+ } |
1063 |
+ |
1064 |
+- return ivrs_alias; |
1065 |
++ clone_aliases(pdev); |
1066 |
++ |
1067 |
++ return pdev; |
1068 |
+ } |
1069 |
+ |
1070 |
+ static struct iommu_dev_data *find_dev_data(u16 devid) |
1071 |
+@@ -428,7 +418,7 @@ static int iommu_init_device(struct device *dev) |
1072 |
+ if (!dev_data) |
1073 |
+ return -ENOMEM; |
1074 |
+ |
1075 |
+- dev_data->alias = get_alias(dev); |
1076 |
++ dev_data->pdev = setup_aliases(dev); |
1077 |
+ |
1078 |
+ /* |
1079 |
+ * By default we use passthrough mode for IOMMUv2 capable device. |
1080 |
+@@ -453,20 +443,16 @@ static int iommu_init_device(struct device *dev) |
1081 |
+ |
1082 |
+ static void iommu_ignore_device(struct device *dev) |
1083 |
+ { |
1084 |
+- u16 alias; |
1085 |
+ int devid; |
1086 |
+ |
1087 |
+ devid = get_device_id(dev); |
1088 |
+ if (devid < 0) |
1089 |
+ return; |
1090 |
+ |
1091 |
+- alias = get_alias(dev); |
1092 |
+- |
1093 |
++ amd_iommu_rlookup_table[devid] = NULL; |
1094 |
+ memset(&amd_iommu_dev_table[devid], 0, sizeof(struct dev_table_entry)); |
1095 |
+- memset(&amd_iommu_dev_table[alias], 0, sizeof(struct dev_table_entry)); |
1096 |
+ |
1097 |
+- amd_iommu_rlookup_table[devid] = NULL; |
1098 |
+- amd_iommu_rlookup_table[alias] = NULL; |
1099 |
++ setup_aliases(dev); |
1100 |
+ } |
1101 |
+ |
1102 |
+ static void iommu_uninit_device(struct device *dev) |
1103 |
+@@ -1236,6 +1222,13 @@ static int device_flush_iotlb(struct iommu_dev_data *dev_data, |
1104 |
+ return iommu_queue_command(iommu, &cmd); |
1105 |
+ } |
1106 |
+ |
1107 |
++static int device_flush_dte_alias(struct pci_dev *pdev, u16 alias, void *data) |
1108 |
++{ |
1109 |
++ struct amd_iommu *iommu = data; |
1110 |
++ |
1111 |
++ return iommu_flush_dte(iommu, alias); |
1112 |
++} |
1113 |
++ |
1114 |
+ /* |
1115 |
+ * Command send function for invalidating a device table entry |
1116 |
+ */ |
1117 |
+@@ -1246,14 +1239,22 @@ static int device_flush_dte(struct iommu_dev_data *dev_data) |
1118 |
+ int ret; |
1119 |
+ |
1120 |
+ iommu = amd_iommu_rlookup_table[dev_data->devid]; |
1121 |
+- alias = dev_data->alias; |
1122 |
+ |
1123 |
+- ret = iommu_flush_dte(iommu, dev_data->devid); |
1124 |
+- if (!ret && alias != dev_data->devid) |
1125 |
+- ret = iommu_flush_dte(iommu, alias); |
1126 |
++ if (dev_data->pdev) |
1127 |
++ ret = pci_for_each_dma_alias(dev_data->pdev, |
1128 |
++ device_flush_dte_alias, iommu); |
1129 |
++ else |
1130 |
++ ret = iommu_flush_dte(iommu, dev_data->devid); |
1131 |
+ if (ret) |
1132 |
+ return ret; |
1133 |
+ |
1134 |
++ alias = amd_iommu_alias_table[dev_data->devid]; |
1135 |
++ if (alias != dev_data->devid) { |
1136 |
++ ret = iommu_flush_dte(iommu, alias); |
1137 |
++ if (ret) |
1138 |
++ return ret; |
1139 |
++ } |
1140 |
++ |
1141 |
+ if (dev_data->ats.enabled) |
1142 |
+ ret = device_flush_iotlb(dev_data, 0, ~0UL); |
1143 |
+ |
1144 |
+@@ -2035,11 +2036,9 @@ static void do_attach(struct iommu_dev_data *dev_data, |
1145 |
+ struct protection_domain *domain) |
1146 |
+ { |
1147 |
+ struct amd_iommu *iommu; |
1148 |
+- u16 alias; |
1149 |
+ bool ats; |
1150 |
+ |
1151 |
+ iommu = amd_iommu_rlookup_table[dev_data->devid]; |
1152 |
+- alias = dev_data->alias; |
1153 |
+ ats = dev_data->ats.enabled; |
1154 |
+ |
1155 |
+ /* Update data structures */ |
1156 |
+@@ -2052,8 +2051,7 @@ static void do_attach(struct iommu_dev_data *dev_data, |
1157 |
+ |
1158 |
+ /* Update device table */ |
1159 |
+ set_dte_entry(dev_data->devid, domain, ats, dev_data->iommu_v2); |
1160 |
+- if (alias != dev_data->devid) |
1161 |
+- set_dte_entry(alias, domain, ats, dev_data->iommu_v2); |
1162 |
++ clone_aliases(dev_data->pdev); |
1163 |
+ |
1164 |
+ device_flush_dte(dev_data); |
1165 |
+ } |
1166 |
+@@ -2062,17 +2060,14 @@ static void do_detach(struct iommu_dev_data *dev_data) |
1167 |
+ { |
1168 |
+ struct protection_domain *domain = dev_data->domain; |
1169 |
+ struct amd_iommu *iommu; |
1170 |
+- u16 alias; |
1171 |
+ |
1172 |
+ iommu = amd_iommu_rlookup_table[dev_data->devid]; |
1173 |
+- alias = dev_data->alias; |
1174 |
+ |
1175 |
+ /* Update data structures */ |
1176 |
+ dev_data->domain = NULL; |
1177 |
+ list_del(&dev_data->list); |
1178 |
+ clear_dte_entry(dev_data->devid); |
1179 |
+- if (alias != dev_data->devid) |
1180 |
+- clear_dte_entry(alias); |
1181 |
++ clone_aliases(dev_data->pdev); |
1182 |
+ |
1183 |
+ /* Flush the DTE entry */ |
1184 |
+ device_flush_dte(dev_data); |
1185 |
+@@ -2384,13 +2379,7 @@ static void update_device_table(struct protection_domain *domain) |
1186 |
+ list_for_each_entry(dev_data, &domain->dev_list, list) { |
1187 |
+ set_dte_entry(dev_data->devid, domain, dev_data->ats.enabled, |
1188 |
+ dev_data->iommu_v2); |
1189 |
+- |
1190 |
+- if (dev_data->devid == dev_data->alias) |
1191 |
+- continue; |
1192 |
+- |
1193 |
+- /* There is an alias, update device table entry for it */ |
1194 |
+- set_dte_entry(dev_data->alias, domain, dev_data->ats.enabled, |
1195 |
+- dev_data->iommu_v2); |
1196 |
++ clone_aliases(dev_data->pdev); |
1197 |
+ } |
1198 |
+ } |
1199 |
+ |
1200 |
+@@ -3752,7 +3741,20 @@ static void set_remap_table_entry(struct amd_iommu *iommu, u16 devid, |
1201 |
+ iommu_flush_dte(iommu, devid); |
1202 |
+ } |
1203 |
+ |
1204 |
+-static struct irq_remap_table *alloc_irq_table(u16 devid) |
1205 |
++static int set_remap_table_entry_alias(struct pci_dev *pdev, u16 alias, |
1206 |
++ void *data) |
1207 |
++{ |
1208 |
++ struct irq_remap_table *table = data; |
1209 |
++ |
1210 |
++ irq_lookup_table[alias] = table; |
1211 |
++ set_dte_irq_entry(alias, table); |
1212 |
++ |
1213 |
++ iommu_flush_dte(amd_iommu_rlookup_table[alias], alias); |
1214 |
++ |
1215 |
++ return 0; |
1216 |
++} |
1217 |
++ |
1218 |
++static struct irq_remap_table *alloc_irq_table(u16 devid, struct pci_dev *pdev) |
1219 |
+ { |
1220 |
+ struct irq_remap_table *table = NULL; |
1221 |
+ struct irq_remap_table *new_table = NULL; |
1222 |
+@@ -3798,7 +3800,12 @@ static struct irq_remap_table *alloc_irq_table(u16 devid) |
1223 |
+ table = new_table; |
1224 |
+ new_table = NULL; |
1225 |
+ |
1226 |
+- set_remap_table_entry(iommu, devid, table); |
1227 |
++ if (pdev) |
1228 |
++ pci_for_each_dma_alias(pdev, set_remap_table_entry_alias, |
1229 |
++ table); |
1230 |
++ else |
1231 |
++ set_remap_table_entry(iommu, devid, table); |
1232 |
++ |
1233 |
+ if (devid != alias) |
1234 |
+ set_remap_table_entry(iommu, alias, table); |
1235 |
+ |
1236 |
+@@ -3815,7 +3822,8 @@ out_unlock: |
1237 |
+ return table; |
1238 |
+ } |
1239 |
+ |
1240 |
+-static int alloc_irq_index(u16 devid, int count, bool align) |
1241 |
++static int alloc_irq_index(u16 devid, int count, bool align, |
1242 |
++ struct pci_dev *pdev) |
1243 |
+ { |
1244 |
+ struct irq_remap_table *table; |
1245 |
+ int index, c, alignment = 1; |
1246 |
+@@ -3825,7 +3833,7 @@ static int alloc_irq_index(u16 devid, int count, bool align) |
1247 |
+ if (!iommu) |
1248 |
+ return -ENODEV; |
1249 |
+ |
1250 |
+- table = alloc_irq_table(devid); |
1251 |
++ table = alloc_irq_table(devid, pdev); |
1252 |
+ if (!table) |
1253 |
+ return -ENODEV; |
1254 |
+ |
1255 |
+@@ -4258,7 +4266,7 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, |
1256 |
+ struct irq_remap_table *table; |
1257 |
+ struct amd_iommu *iommu; |
1258 |
+ |
1259 |
+- table = alloc_irq_table(devid); |
1260 |
++ table = alloc_irq_table(devid, NULL); |
1261 |
+ if (table) { |
1262 |
+ if (!table->min_index) { |
1263 |
+ /* |
1264 |
+@@ -4275,11 +4283,15 @@ static int irq_remapping_alloc(struct irq_domain *domain, unsigned int virq, |
1265 |
+ } else { |
1266 |
+ index = -ENOMEM; |
1267 |
+ } |
1268 |
+- } else { |
1269 |
++ } else if (info->type == X86_IRQ_ALLOC_TYPE_MSI || |
1270 |
++ info->type == X86_IRQ_ALLOC_TYPE_MSIX) { |
1271 |
+ bool align = (info->type == X86_IRQ_ALLOC_TYPE_MSI); |
1272 |
+ |
1273 |
+- index = alloc_irq_index(devid, nr_irqs, align); |
1274 |
++ index = alloc_irq_index(devid, nr_irqs, align, info->msi_dev); |
1275 |
++ } else { |
1276 |
++ index = alloc_irq_index(devid, nr_irqs, false, NULL); |
1277 |
+ } |
1278 |
++ |
1279 |
+ if (index < 0) { |
1280 |
+ pr_warn("Failed to allocate IRTE\n"); |
1281 |
+ ret = index; |
1282 |
+diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h |
1283 |
+index 17bd5a349119..fc956479b94e 100644 |
1284 |
+--- a/drivers/iommu/amd_iommu_types.h |
1285 |
++++ b/drivers/iommu/amd_iommu_types.h |
1286 |
+@@ -639,8 +639,8 @@ struct iommu_dev_data { |
1287 |
+ struct list_head list; /* For domain->dev_list */ |
1288 |
+ struct llist_node dev_data_list; /* For global dev_data_list */ |
1289 |
+ struct protection_domain *domain; /* Domain the device is bound to */ |
1290 |
++ struct pci_dev *pdev; |
1291 |
+ u16 devid; /* PCI Device ID */ |
1292 |
+- u16 alias; /* Alias Device ID */ |
1293 |
+ bool iommu_v2; /* Device can make use of IOMMUv2 */ |
1294 |
+ bool passthrough; /* Device is identity mapped */ |
1295 |
+ struct { |
1296 |
+diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c |
1297 |
+index 51456e7f264f..c68a1f072c31 100644 |
1298 |
+--- a/drivers/iommu/dma-iommu.c |
1299 |
++++ b/drivers/iommu/dma-iommu.c |
1300 |
+@@ -1177,7 +1177,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr) |
1301 |
+ { |
1302 |
+ struct device *dev = msi_desc_to_dev(desc); |
1303 |
+ struct iommu_domain *domain = iommu_get_domain_for_dev(dev); |
1304 |
+- struct iommu_dma_cookie *cookie; |
1305 |
+ struct iommu_dma_msi_page *msi_page; |
1306 |
+ static DEFINE_MUTEX(msi_prepare_lock); /* see below */ |
1307 |
+ |
1308 |
+@@ -1186,8 +1185,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr) |
1309 |
+ return 0; |
1310 |
+ } |
1311 |
+ |
1312 |
+- cookie = domain->iova_cookie; |
1313 |
+- |
1314 |
+ /* |
1315 |
+ * In fact the whole prepare operation should already be serialised by |
1316 |
+ * irq_domain_mutex further up the callchain, but that's pretty subtle |
1317 |
+diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c b/drivers/media/usb/dvb-usb-v2/dvbsky.c |
1318 |
+index 617a306f6815..dc380c0c9536 100644 |
1319 |
+--- a/drivers/media/usb/dvb-usb-v2/dvbsky.c |
1320 |
++++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c |
1321 |
+@@ -792,6 +792,9 @@ static const struct usb_device_id dvbsky_id_table[] = { |
1322 |
+ { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C, |
1323 |
+ &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230C", |
1324 |
+ RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, |
1325 |
++ { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C_LITE, |
1326 |
++ &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230C Lite", |
1327 |
++ NULL) }, |
1328 |
+ { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C2, |
1329 |
+ &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230C v2", |
1330 |
+ RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, |
1331 |
+diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c |
1332 |
+index 1767f30a1676..b33030e3385c 100644 |
1333 |
+--- a/drivers/mfd/intel-lpss-pci.c |
1334 |
++++ b/drivers/mfd/intel-lpss-pci.c |
1335 |
+@@ -140,7 +140,7 @@ static const struct intel_lpss_platform_info cnl_i2c_info = { |
1336 |
+ }; |
1337 |
+ |
1338 |
+ static const struct pci_device_id intel_lpss_pci_ids[] = { |
1339 |
+- /* CML */ |
1340 |
++ /* CML-LP */ |
1341 |
+ { PCI_VDEVICE(INTEL, 0x02a8), (kernel_ulong_t)&spt_uart_info }, |
1342 |
+ { PCI_VDEVICE(INTEL, 0x02a9), (kernel_ulong_t)&spt_uart_info }, |
1343 |
+ { PCI_VDEVICE(INTEL, 0x02aa), (kernel_ulong_t)&spt_info }, |
1344 |
+@@ -153,6 +153,17 @@ static const struct pci_device_id intel_lpss_pci_ids[] = { |
1345 |
+ { PCI_VDEVICE(INTEL, 0x02ea), (kernel_ulong_t)&cnl_i2c_info }, |
1346 |
+ { PCI_VDEVICE(INTEL, 0x02eb), (kernel_ulong_t)&cnl_i2c_info }, |
1347 |
+ { PCI_VDEVICE(INTEL, 0x02fb), (kernel_ulong_t)&spt_info }, |
1348 |
++ /* CML-H */ |
1349 |
++ { PCI_VDEVICE(INTEL, 0x06a8), (kernel_ulong_t)&spt_uart_info }, |
1350 |
++ { PCI_VDEVICE(INTEL, 0x06a9), (kernel_ulong_t)&spt_uart_info }, |
1351 |
++ { PCI_VDEVICE(INTEL, 0x06aa), (kernel_ulong_t)&spt_info }, |
1352 |
++ { PCI_VDEVICE(INTEL, 0x06ab), (kernel_ulong_t)&spt_info }, |
1353 |
++ { PCI_VDEVICE(INTEL, 0x06c7), (kernel_ulong_t)&spt_uart_info }, |
1354 |
++ { PCI_VDEVICE(INTEL, 0x06e8), (kernel_ulong_t)&cnl_i2c_info }, |
1355 |
++ { PCI_VDEVICE(INTEL, 0x06e9), (kernel_ulong_t)&cnl_i2c_info }, |
1356 |
++ { PCI_VDEVICE(INTEL, 0x06ea), (kernel_ulong_t)&cnl_i2c_info }, |
1357 |
++ { PCI_VDEVICE(INTEL, 0x06eb), (kernel_ulong_t)&cnl_i2c_info }, |
1358 |
++ { PCI_VDEVICE(INTEL, 0x06fb), (kernel_ulong_t)&spt_info }, |
1359 |
+ /* BXT A-Step */ |
1360 |
+ { PCI_VDEVICE(INTEL, 0x0aac), (kernel_ulong_t)&bxt_i2c_info }, |
1361 |
+ { PCI_VDEVICE(INTEL, 0x0aae), (kernel_ulong_t)&bxt_i2c_info }, |
1362 |
+diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c |
1363 |
+index c681f6fab342..a9793ea6933b 100644 |
1364 |
+--- a/drivers/misc/mei/hdcp/mei_hdcp.c |
1365 |
++++ b/drivers/misc/mei/hdcp/mei_hdcp.c |
1366 |
+@@ -758,11 +758,38 @@ static const struct component_master_ops mei_component_master_ops = { |
1367 |
+ .unbind = mei_component_master_unbind, |
1368 |
+ }; |
1369 |
+ |
1370 |
++/** |
1371 |
++ * mei_hdcp_component_match - compare function for matching mei hdcp. |
1372 |
++ * |
1373 |
++ * The function checks if the driver is i915, the subcomponent is HDCP |
1374 |
++ * and the grand parent of hdcp and the parent of i915 are the same |
1375 |
++ * PCH device. |
1376 |
++ * |
1377 |
++ * @dev: master device |
1378 |
++ * @subcomponent: subcomponent to match (I915_COMPONENT_HDCP) |
1379 |
++ * @data: compare data (mei hdcp device) |
1380 |
++ * |
1381 |
++ * Return: |
1382 |
++ * * 1 - if components match |
1383 |
++ * * 0 - otherwise |
1384 |
++ */ |
1385 |
+ static int mei_hdcp_component_match(struct device *dev, int subcomponent, |
1386 |
+ void *data) |
1387 |
+ { |
1388 |
+- return !strcmp(dev->driver->name, "i915") && |
1389 |
+- subcomponent == I915_COMPONENT_HDCP; |
1390 |
++ struct device *base = data; |
1391 |
++ |
1392 |
++ if (strcmp(dev->driver->name, "i915") || |
1393 |
++ subcomponent != I915_COMPONENT_HDCP) |
1394 |
++ return 0; |
1395 |
++ |
1396 |
++ base = base->parent; |
1397 |
++ if (!base) |
1398 |
++ return 0; |
1399 |
++ |
1400 |
++ base = base->parent; |
1401 |
++ dev = dev->parent; |
1402 |
++ |
1403 |
++ return (base && dev && dev == base); |
1404 |
+ } |
1405 |
+ |
1406 |
+ static int mei_hdcp_probe(struct mei_cl_device *cldev, |
1407 |
+@@ -786,7 +813,7 @@ static int mei_hdcp_probe(struct mei_cl_device *cldev, |
1408 |
+ |
1409 |
+ master_match = NULL; |
1410 |
+ component_match_add_typed(&cldev->dev, &master_match, |
1411 |
+- mei_hdcp_component_match, comp_master); |
1412 |
++ mei_hdcp_component_match, &cldev->dev); |
1413 |
+ if (IS_ERR_OR_NULL(master_match)) { |
1414 |
+ ret = -ENOMEM; |
1415 |
+ goto err_exit; |
1416 |
+diff --git a/drivers/misc/mei/hw-me-regs.h b/drivers/misc/mei/hw-me-regs.h |
1417 |
+index b359f06f05e7..69d9b1736bf9 100644 |
1418 |
+--- a/drivers/misc/mei/hw-me-regs.h |
1419 |
++++ b/drivers/misc/mei/hw-me-regs.h |
1420 |
+@@ -81,8 +81,12 @@ |
1421 |
+ |
1422 |
+ #define MEI_DEV_ID_CMP_LP 0x02e0 /* Comet Point LP */ |
1423 |
+ #define MEI_DEV_ID_CMP_LP_3 0x02e4 /* Comet Point LP 3 (iTouch) */ |
1424 |
++ |
1425 |
+ #define MEI_DEV_ID_CMP_V 0xA3BA /* Comet Point Lake V */ |
1426 |
+ |
1427 |
++#define MEI_DEV_ID_CMP_H 0x06e0 /* Comet Lake H */ |
1428 |
++#define MEI_DEV_ID_CMP_H_3 0x06e4 /* Comet Lake H 3 (iTouch) */ |
1429 |
++ |
1430 |
+ #define MEI_DEV_ID_ICP_LP 0x34E0 /* Ice Lake Point LP */ |
1431 |
+ |
1432 |
+ #define MEI_DEV_ID_TGP_LP 0xA0E0 /* Tiger Lake Point LP */ |
1433 |
+diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c |
1434 |
+index ce43415a536c..309cb8a23381 100644 |
1435 |
+--- a/drivers/misc/mei/pci-me.c |
1436 |
++++ b/drivers/misc/mei/pci-me.c |
1437 |
+@@ -99,6 +99,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = { |
1438 |
+ {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_LP, MEI_ME_PCH12_CFG)}, |
1439 |
+ {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_LP_3, MEI_ME_PCH8_CFG)}, |
1440 |
+ {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_V, MEI_ME_PCH12_CFG)}, |
1441 |
++ {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_H, MEI_ME_PCH12_CFG)}, |
1442 |
++ {MEI_PCI_DEVICE(MEI_DEV_ID_CMP_H_3, MEI_ME_PCH8_CFG)}, |
1443 |
+ |
1444 |
+ {MEI_PCI_DEVICE(MEI_DEV_ID_ICP_LP, MEI_ME_PCH12_CFG)}, |
1445 |
+ |
1446 |
+diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c |
1447 |
+index 642a9667db4d..c9ea365c248c 100644 |
1448 |
+--- a/drivers/mmc/host/sdhci-pci-core.c |
1449 |
++++ b/drivers/mmc/host/sdhci-pci-core.c |
1450 |
+@@ -21,6 +21,7 @@ |
1451 |
+ #include <linux/mmc/mmc.h> |
1452 |
+ #include <linux/scatterlist.h> |
1453 |
+ #include <linux/io.h> |
1454 |
++#include <linux/iopoll.h> |
1455 |
+ #include <linux/gpio.h> |
1456 |
+ #include <linux/pm_runtime.h> |
1457 |
+ #include <linux/mmc/slot-gpio.h> |
1458 |
+@@ -1598,11 +1599,59 @@ static int amd_probe(struct sdhci_pci_chip *chip) |
1459 |
+ return 0; |
1460 |
+ } |
1461 |
+ |
1462 |
++static u32 sdhci_read_present_state(struct sdhci_host *host) |
1463 |
++{ |
1464 |
++ return sdhci_readl(host, SDHCI_PRESENT_STATE); |
1465 |
++} |
1466 |
++ |
1467 |
++void amd_sdhci_reset(struct sdhci_host *host, u8 mask) |
1468 |
++{ |
1469 |
++ struct sdhci_pci_slot *slot = sdhci_priv(host); |
1470 |
++ struct pci_dev *pdev = slot->chip->pdev; |
1471 |
++ u32 present_state; |
1472 |
++ |
1473 |
++ /* |
1474 |
++ * SDHC 0x7906 requires a hard reset to clear all internal state. |
1475 |
++ * Otherwise it can get into a bad state where the DATA lines are always |
1476 |
++ * read as zeros. |
1477 |
++ */ |
1478 |
++ if (pdev->device == 0x7906 && (mask & SDHCI_RESET_ALL)) { |
1479 |
++ pci_clear_master(pdev); |
1480 |
++ |
1481 |
++ pci_save_state(pdev); |
1482 |
++ |
1483 |
++ pci_set_power_state(pdev, PCI_D3cold); |
1484 |
++ pr_debug("%s: power_state=%u\n", mmc_hostname(host->mmc), |
1485 |
++ pdev->current_state); |
1486 |
++ pci_set_power_state(pdev, PCI_D0); |
1487 |
++ |
1488 |
++ pci_restore_state(pdev); |
1489 |
++ |
1490 |
++ /* |
1491 |
++ * SDHCI_RESET_ALL says the card detect logic should not be |
1492 |
++ * reset, but since we need to reset the entire controller |
1493 |
++ * we should wait until the card detect logic has stabilized. |
1494 |
++ * |
1495 |
++ * This normally takes about 40ms. |
1496 |
++ */ |
1497 |
++ readx_poll_timeout( |
1498 |
++ sdhci_read_present_state, |
1499 |
++ host, |
1500 |
++ present_state, |
1501 |
++ present_state & SDHCI_CD_STABLE, |
1502 |
++ 10000, |
1503 |
++ 100000 |
1504 |
++ ); |
1505 |
++ } |
1506 |
++ |
1507 |
++ return sdhci_reset(host, mask); |
1508 |
++} |
1509 |
++ |
1510 |
+ static const struct sdhci_ops amd_sdhci_pci_ops = { |
1511 |
+ .set_clock = sdhci_set_clock, |
1512 |
+ .enable_dma = sdhci_pci_enable_dma, |
1513 |
+ .set_bus_width = sdhci_set_bus_width, |
1514 |
+- .reset = sdhci_reset, |
1515 |
++ .reset = amd_sdhci_reset, |
1516 |
+ .set_uhs_signaling = sdhci_set_uhs_signaling, |
1517 |
+ }; |
1518 |
+ |
1519 |
+@@ -1681,6 +1730,8 @@ static const struct pci_device_id pci_ids[] = { |
1520 |
+ SDHCI_PCI_DEVICE(INTEL, CML_EMMC, intel_glk_emmc), |
1521 |
+ SDHCI_PCI_DEVICE(INTEL, CML_SD, intel_byt_sd), |
1522 |
+ SDHCI_PCI_DEVICE(INTEL, CMLH_SD, intel_byt_sd), |
1523 |
++ SDHCI_PCI_DEVICE(INTEL, JSL_EMMC, intel_glk_emmc), |
1524 |
++ SDHCI_PCI_DEVICE(INTEL, JSL_SD, intel_byt_sd), |
1525 |
+ SDHCI_PCI_DEVICE(O2, 8120, o2), |
1526 |
+ SDHCI_PCI_DEVICE(O2, 8220, o2), |
1527 |
+ SDHCI_PCI_DEVICE(O2, 8221, o2), |
1528 |
+diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h |
1529 |
+index 558202fe64c6..981bbbe63aff 100644 |
1530 |
+--- a/drivers/mmc/host/sdhci-pci.h |
1531 |
++++ b/drivers/mmc/host/sdhci-pci.h |
1532 |
+@@ -55,6 +55,8 @@ |
1533 |
+ #define PCI_DEVICE_ID_INTEL_CML_EMMC 0x02c4 |
1534 |
+ #define PCI_DEVICE_ID_INTEL_CML_SD 0x02f5 |
1535 |
+ #define PCI_DEVICE_ID_INTEL_CMLH_SD 0x06f5 |
1536 |
++#define PCI_DEVICE_ID_INTEL_JSL_EMMC 0x4dc4 |
1537 |
++#define PCI_DEVICE_ID_INTEL_JSL_SD 0x4df8 |
1538 |
+ |
1539 |
+ #define PCI_DEVICE_ID_SYSKONNECT_8000 0x8000 |
1540 |
+ #define PCI_DEVICE_ID_VIA_95D0 0x95d0 |
1541 |
+diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c |
1542 |
+index d797912e665a..b233756345f8 100644 |
1543 |
+--- a/drivers/net/can/m_can/tcan4x5x.c |
1544 |
++++ b/drivers/net/can/m_can/tcan4x5x.c |
1545 |
+@@ -164,6 +164,28 @@ static void tcan4x5x_check_wake(struct tcan4x5x_priv *priv) |
1546 |
+ } |
1547 |
+ } |
1548 |
+ |
1549 |
++static int tcan4x5x_reset(struct tcan4x5x_priv *priv) |
1550 |
++{ |
1551 |
++ int ret = 0; |
1552 |
++ |
1553 |
++ if (priv->reset_gpio) { |
1554 |
++ gpiod_set_value(priv->reset_gpio, 1); |
1555 |
++ |
1556 |
++ /* tpulse_width minimum 30us */ |
1557 |
++ usleep_range(30, 100); |
1558 |
++ gpiod_set_value(priv->reset_gpio, 0); |
1559 |
++ } else { |
1560 |
++ ret = regmap_write(priv->regmap, TCAN4X5X_CONFIG, |
1561 |
++ TCAN4X5X_SW_RESET); |
1562 |
++ if (ret) |
1563 |
++ return ret; |
1564 |
++ } |
1565 |
++ |
1566 |
++ usleep_range(700, 1000); |
1567 |
++ |
1568 |
++ return ret; |
1569 |
++} |
1570 |
++ |
1571 |
+ static int regmap_spi_gather_write(void *context, const void *reg, |
1572 |
+ size_t reg_len, const void *val, |
1573 |
+ size_t val_len) |
1574 |
+@@ -341,6 +363,7 @@ static int tcan4x5x_init(struct m_can_classdev *cdev) |
1575 |
+ static int tcan4x5x_parse_config(struct m_can_classdev *cdev) |
1576 |
+ { |
1577 |
+ struct tcan4x5x_priv *tcan4x5x = cdev->device_data; |
1578 |
++ int ret; |
1579 |
+ |
1580 |
+ tcan4x5x->device_wake_gpio = devm_gpiod_get(cdev->dev, "device-wake", |
1581 |
+ GPIOD_OUT_HIGH); |
1582 |
+@@ -354,7 +377,9 @@ static int tcan4x5x_parse_config(struct m_can_classdev *cdev) |
1583 |
+ if (IS_ERR(tcan4x5x->reset_gpio)) |
1584 |
+ tcan4x5x->reset_gpio = NULL; |
1585 |
+ |
1586 |
+- usleep_range(700, 1000); |
1587 |
++ ret = tcan4x5x_reset(tcan4x5x); |
1588 |
++ if (ret) |
1589 |
++ return ret; |
1590 |
+ |
1591 |
+ tcan4x5x->device_state_gpio = devm_gpiod_get_optional(cdev->dev, |
1592 |
+ "device-state", |
1593 |
+diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c |
1594 |
+index 97ab0dd25552..1a7710c399d7 100644 |
1595 |
+--- a/drivers/net/ethernet/broadcom/b44.c |
1596 |
++++ b/drivers/net/ethernet/broadcom/b44.c |
1597 |
+@@ -1519,8 +1519,10 @@ static int b44_magic_pattern(u8 *macaddr, u8 *ppattern, u8 *pmask, int offset) |
1598 |
+ int ethaddr_bytes = ETH_ALEN; |
1599 |
+ |
1600 |
+ memset(ppattern + offset, 0xff, magicsync); |
1601 |
+- for (j = 0; j < magicsync; j++) |
1602 |
+- set_bit(len++, (unsigned long *) pmask); |
1603 |
++ for (j = 0; j < magicsync; j++) { |
1604 |
++ pmask[len >> 3] |= BIT(len & 7); |
1605 |
++ len++; |
1606 |
++ } |
1607 |
+ |
1608 |
+ for (j = 0; j < B44_MAX_PATTERNS; j++) { |
1609 |
+ if ((B44_PATTERN_SIZE - len) >= ETH_ALEN) |
1610 |
+@@ -1532,7 +1534,8 @@ static int b44_magic_pattern(u8 *macaddr, u8 *ppattern, u8 *pmask, int offset) |
1611 |
+ for (k = 0; k< ethaddr_bytes; k++) { |
1612 |
+ ppattern[offset + magicsync + |
1613 |
+ (j * ETH_ALEN) + k] = macaddr[k]; |
1614 |
+- set_bit(len++, (unsigned long *) pmask); |
1615 |
++ pmask[len >> 3] |= BIT(len & 7); |
1616 |
++ len++; |
1617 |
+ } |
1618 |
+ } |
1619 |
+ return len - 1; |
1620 |
+diff --git a/drivers/net/ethernet/google/gve/gve_rx.c b/drivers/net/ethernet/google/gve/gve_rx.c |
1621 |
+index edec61dfc868..9f52e72ff641 100644 |
1622 |
+--- a/drivers/net/ethernet/google/gve/gve_rx.c |
1623 |
++++ b/drivers/net/ethernet/google/gve/gve_rx.c |
1624 |
+@@ -418,8 +418,6 @@ bool gve_clean_rx_done(struct gve_rx_ring *rx, int budget, |
1625 |
+ rx->cnt = cnt; |
1626 |
+ rx->fill_cnt += work_done; |
1627 |
+ |
1628 |
+- /* restock desc ring slots */ |
1629 |
+- dma_wmb(); /* Ensure descs are visible before ringing doorbell */ |
1630 |
+ gve_rx_write_doorbell(priv, rx); |
1631 |
+ return gve_rx_work_pending(rx); |
1632 |
+ } |
1633 |
+diff --git a/drivers/net/ethernet/google/gve/gve_tx.c b/drivers/net/ethernet/google/gve/gve_tx.c |
1634 |
+index f4889431f9b7..d0244feb0301 100644 |
1635 |
+--- a/drivers/net/ethernet/google/gve/gve_tx.c |
1636 |
++++ b/drivers/net/ethernet/google/gve/gve_tx.c |
1637 |
+@@ -487,10 +487,6 @@ netdev_tx_t gve_tx(struct sk_buff *skb, struct net_device *dev) |
1638 |
+ * may have added descriptors without ringing the doorbell. |
1639 |
+ */ |
1640 |
+ |
1641 |
+- /* Ensure tx descs from a prior gve_tx are visible before |
1642 |
+- * ringing doorbell. |
1643 |
+- */ |
1644 |
+- dma_wmb(); |
1645 |
+ gve_tx_put_doorbell(priv, tx->q_resources, tx->req); |
1646 |
+ return NETDEV_TX_BUSY; |
1647 |
+ } |
1648 |
+@@ -505,8 +501,6 @@ netdev_tx_t gve_tx(struct sk_buff *skb, struct net_device *dev) |
1649 |
+ if (!netif_xmit_stopped(tx->netdev_txq) && netdev_xmit_more()) |
1650 |
+ return NETDEV_TX_OK; |
1651 |
+ |
1652 |
+- /* Ensure tx descs are visible before ringing doorbell */ |
1653 |
+- dma_wmb(); |
1654 |
+ gve_tx_put_doorbell(priv, tx->q_resources, tx->req); |
1655 |
+ return NETDEV_TX_OK; |
1656 |
+ } |
1657 |
+diff --git a/drivers/net/ethernet/mellanox/mlxsw/minimal.c b/drivers/net/ethernet/mellanox/mlxsw/minimal.c |
1658 |
+index 471b0ca6d69a..55dfba990e6e 100644 |
1659 |
+--- a/drivers/net/ethernet/mellanox/mlxsw/minimal.c |
1660 |
++++ b/drivers/net/ethernet/mellanox/mlxsw/minimal.c |
1661 |
+@@ -204,8 +204,8 @@ mlxsw_m_port_create(struct mlxsw_m *mlxsw_m, u8 local_port, u8 module) |
1662 |
+ |
1663 |
+ err_register_netdev: |
1664 |
+ mlxsw_m->ports[local_port] = NULL; |
1665 |
+- free_netdev(dev); |
1666 |
+ err_dev_addr_get: |
1667 |
++ free_netdev(dev); |
1668 |
+ err_alloc_etherdev: |
1669 |
+ mlxsw_core_port_fini(mlxsw_m->core, local_port); |
1670 |
+ return err; |
1671 |
+diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c |
1672 |
+index 41ddd8fff2a7..8bd2912bf713 100644 |
1673 |
+--- a/drivers/net/ethernet/socionext/netsec.c |
1674 |
++++ b/drivers/net/ethernet/socionext/netsec.c |
1675 |
+@@ -928,7 +928,6 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget) |
1676 |
+ struct netsec_rx_pkt_info rx_info; |
1677 |
+ enum dma_data_direction dma_dir; |
1678 |
+ struct bpf_prog *xdp_prog; |
1679 |
+- struct sk_buff *skb = NULL; |
1680 |
+ u16 xdp_xmit = 0; |
1681 |
+ u32 xdp_act = 0; |
1682 |
+ int done = 0; |
1683 |
+@@ -942,7 +941,8 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget) |
1684 |
+ struct netsec_de *de = dring->vaddr + (DESC_SZ * idx); |
1685 |
+ struct netsec_desc *desc = &dring->desc[idx]; |
1686 |
+ struct page *page = virt_to_page(desc->addr); |
1687 |
+- u32 xdp_result = XDP_PASS; |
1688 |
++ u32 xdp_result = NETSEC_XDP_PASS; |
1689 |
++ struct sk_buff *skb = NULL; |
1690 |
+ u16 pkt_len, desc_len; |
1691 |
+ dma_addr_t dma_handle; |
1692 |
+ struct xdp_buff xdp; |
1693 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
1694 |
+index 1b3520d0e59e..06dd65c419c4 100644 |
1695 |
+--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
1696 |
++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |
1697 |
+@@ -105,6 +105,7 @@ MODULE_PARM_DESC(chain_mode, "To use chain instead of ring mode"); |
1698 |
+ static irqreturn_t stmmac_interrupt(int irq, void *dev_id); |
1699 |
+ |
1700 |
+ #ifdef CONFIG_DEBUG_FS |
1701 |
++static const struct net_device_ops stmmac_netdev_ops; |
1702 |
+ static void stmmac_init_fs(struct net_device *dev); |
1703 |
+ static void stmmac_exit_fs(struct net_device *dev); |
1704 |
+ #endif |
1705 |
+@@ -4175,6 +4176,34 @@ static int stmmac_dma_cap_show(struct seq_file *seq, void *v) |
1706 |
+ } |
1707 |
+ DEFINE_SHOW_ATTRIBUTE(stmmac_dma_cap); |
1708 |
+ |
1709 |
++/* Use network device events to rename debugfs file entries. |
1710 |
++ */ |
1711 |
++static int stmmac_device_event(struct notifier_block *unused, |
1712 |
++ unsigned long event, void *ptr) |
1713 |
++{ |
1714 |
++ struct net_device *dev = netdev_notifier_info_to_dev(ptr); |
1715 |
++ struct stmmac_priv *priv = netdev_priv(dev); |
1716 |
++ |
1717 |
++ if (dev->netdev_ops != &stmmac_netdev_ops) |
1718 |
++ goto done; |
1719 |
++ |
1720 |
++ switch (event) { |
1721 |
++ case NETDEV_CHANGENAME: |
1722 |
++ if (priv->dbgfs_dir) |
1723 |
++ priv->dbgfs_dir = debugfs_rename(stmmac_fs_dir, |
1724 |
++ priv->dbgfs_dir, |
1725 |
++ stmmac_fs_dir, |
1726 |
++ dev->name); |
1727 |
++ break; |
1728 |
++ } |
1729 |
++done: |
1730 |
++ return NOTIFY_DONE; |
1731 |
++} |
1732 |
++ |
1733 |
++static struct notifier_block stmmac_notifier = { |
1734 |
++ .notifier_call = stmmac_device_event, |
1735 |
++}; |
1736 |
++ |
1737 |
+ static void stmmac_init_fs(struct net_device *dev) |
1738 |
+ { |
1739 |
+ struct stmmac_priv *priv = netdev_priv(dev); |
1740 |
+@@ -4189,12 +4218,15 @@ static void stmmac_init_fs(struct net_device *dev) |
1741 |
+ /* Entry to report the DMA HW features */ |
1742 |
+ debugfs_create_file("dma_cap", 0444, priv->dbgfs_dir, dev, |
1743 |
+ &stmmac_dma_cap_fops); |
1744 |
++ |
1745 |
++ register_netdevice_notifier(&stmmac_notifier); |
1746 |
+ } |
1747 |
+ |
1748 |
+ static void stmmac_exit_fs(struct net_device *dev) |
1749 |
+ { |
1750 |
+ struct stmmac_priv *priv = netdev_priv(dev); |
1751 |
+ |
1752 |
++ unregister_netdevice_notifier(&stmmac_notifier); |
1753 |
+ debugfs_remove_recursive(priv->dbgfs_dir); |
1754 |
+ } |
1755 |
+ #endif /* CONFIG_DEBUG_FS */ |
1756 |
+diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c |
1757 |
+index e2e679a01b65..77ccf3672ede 100644 |
1758 |
+--- a/drivers/net/wan/sdla.c |
1759 |
++++ b/drivers/net/wan/sdla.c |
1760 |
+@@ -708,7 +708,7 @@ static netdev_tx_t sdla_transmit(struct sk_buff *skb, |
1761 |
+ |
1762 |
+ spin_lock_irqsave(&sdla_lock, flags); |
1763 |
+ SDLA_WINDOW(dev, addr); |
1764 |
+- pbuf = (void *)(((int) dev->mem_start) + (addr & SDLA_ADDR_MASK)); |
1765 |
++ pbuf = (void *)(dev->mem_start + (addr & SDLA_ADDR_MASK)); |
1766 |
+ __sdla_write(dev, pbuf->buf_addr, skb->data, skb->len); |
1767 |
+ SDLA_WINDOW(dev, addr); |
1768 |
+ pbuf->opp_flag = 1; |
1769 |
+diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c |
1770 |
+index fb649d85b8fc..dd0c32379375 100644 |
1771 |
+--- a/drivers/net/wireless/ath/ath9k/hif_usb.c |
1772 |
++++ b/drivers/net/wireless/ath/ath9k/hif_usb.c |
1773 |
+@@ -1216,7 +1216,7 @@ err_fw: |
1774 |
+ static int send_eject_command(struct usb_interface *interface) |
1775 |
+ { |
1776 |
+ struct usb_device *udev = interface_to_usbdev(interface); |
1777 |
+- struct usb_host_interface *iface_desc = &interface->altsetting[0]; |
1778 |
++ struct usb_host_interface *iface_desc = interface->cur_altsetting; |
1779 |
+ struct usb_endpoint_descriptor *endpoint; |
1780 |
+ unsigned char *cmd; |
1781 |
+ u8 bulk_out_ep; |
1782 |
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c |
1783 |
+index 06f3c01f10b3..7cdfde9b3dea 100644 |
1784 |
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c |
1785 |
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c |
1786 |
+@@ -1348,7 +1348,7 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) |
1787 |
+ goto fail; |
1788 |
+ } |
1789 |
+ |
1790 |
+- desc = &intf->altsetting[0].desc; |
1791 |
++ desc = &intf->cur_altsetting->desc; |
1792 |
+ if ((desc->bInterfaceClass != USB_CLASS_VENDOR_SPEC) || |
1793 |
+ (desc->bInterfaceSubClass != 2) || |
1794 |
+ (desc->bInterfaceProtocol != 0xff)) { |
1795 |
+@@ -1361,7 +1361,7 @@ brcmf_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) |
1796 |
+ |
1797 |
+ num_of_eps = desc->bNumEndpoints; |
1798 |
+ for (ep = 0; ep < num_of_eps; ep++) { |
1799 |
+- endpoint = &intf->altsetting[0].endpoint[ep].desc; |
1800 |
++ endpoint = &intf->cur_altsetting->endpoint[ep].desc; |
1801 |
+ endpoint_num = usb_endpoint_num(endpoint); |
1802 |
+ if (!usb_endpoint_xfer_bulk(endpoint)) |
1803 |
+ continue; |
1804 |
+diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c |
1805 |
+index 40a8b941ad5c..8c79b963bcff 100644 |
1806 |
+--- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c |
1807 |
++++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c |
1808 |
+@@ -1608,9 +1608,9 @@ static int ezusb_probe(struct usb_interface *interface, |
1809 |
+ /* set up the endpoint information */ |
1810 |
+ /* check out the endpoints */ |
1811 |
+ |
1812 |
+- iface_desc = &interface->altsetting[0].desc; |
1813 |
++ iface_desc = &interface->cur_altsetting->desc; |
1814 |
+ for (i = 0; i < iface_desc->bNumEndpoints; ++i) { |
1815 |
+- ep = &interface->altsetting[0].endpoint[i].desc; |
1816 |
++ ep = &interface->cur_altsetting->endpoint[i].desc; |
1817 |
+ |
1818 |
+ if (usb_endpoint_is_bulk_in(ep)) { |
1819 |
+ /* we found a bulk in endpoint */ |
1820 |
+diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c |
1821 |
+index e7d96ac673b7..3499b211dad5 100644 |
1822 |
+--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c |
1823 |
++++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c |
1824 |
+@@ -5915,7 +5915,7 @@ static int rtl8xxxu_parse_usb(struct rtl8xxxu_priv *priv, |
1825 |
+ u8 dir, xtype, num; |
1826 |
+ int ret = 0; |
1827 |
+ |
1828 |
+- host_interface = &interface->altsetting[0]; |
1829 |
++ host_interface = interface->cur_altsetting; |
1830 |
+ interface_desc = &host_interface->desc; |
1831 |
+ endpoints = interface_desc->bNumEndpoints; |
1832 |
+ |
1833 |
+diff --git a/drivers/net/wireless/rsi/rsi_91x_hal.c b/drivers/net/wireless/rsi/rsi_91x_hal.c |
1834 |
+index f84250bdb8cf..6f8d5f9a9f7e 100644 |
1835 |
+--- a/drivers/net/wireless/rsi/rsi_91x_hal.c |
1836 |
++++ b/drivers/net/wireless/rsi/rsi_91x_hal.c |
1837 |
+@@ -622,6 +622,7 @@ static int bl_cmd(struct rsi_hw *adapter, u8 cmd, u8 exp_resp, char *str) |
1838 |
+ bl_start_cmd_timer(adapter, timeout); |
1839 |
+ status = bl_write_cmd(adapter, cmd, exp_resp, ®out_val); |
1840 |
+ if (status < 0) { |
1841 |
++ bl_stop_cmd_timer(adapter); |
1842 |
+ rsi_dbg(ERR_ZONE, |
1843 |
+ "%s: Command %s (%0x) writing failed..\n", |
1844 |
+ __func__, str, cmd); |
1845 |
+@@ -737,10 +738,9 @@ static int ping_pong_write(struct rsi_hw *adapter, u8 cmd, u8 *addr, u32 size) |
1846 |
+ } |
1847 |
+ |
1848 |
+ status = bl_cmd(adapter, cmd_req, cmd_resp, str); |
1849 |
+- if (status) { |
1850 |
+- bl_stop_cmd_timer(adapter); |
1851 |
++ if (status) |
1852 |
+ return status; |
1853 |
+- } |
1854 |
++ |
1855 |
+ return 0; |
1856 |
+ } |
1857 |
+ |
1858 |
+@@ -828,10 +828,9 @@ static int auto_fw_upgrade(struct rsi_hw *adapter, u8 *flash_content, |
1859 |
+ |
1860 |
+ status = bl_cmd(adapter, EOF_REACHED, FW_LOADING_SUCCESSFUL, |
1861 |
+ "EOF_REACHED"); |
1862 |
+- if (status) { |
1863 |
+- bl_stop_cmd_timer(adapter); |
1864 |
++ if (status) |
1865 |
+ return status; |
1866 |
+- } |
1867 |
++ |
1868 |
+ rsi_dbg(INFO_ZONE, "FW loading is done and FW is running..\n"); |
1869 |
+ return 0; |
1870 |
+ } |
1871 |
+@@ -849,6 +848,7 @@ static int rsi_hal_prepare_fwload(struct rsi_hw *adapter) |
1872 |
+ ®out_val, |
1873 |
+ RSI_COMMON_REG_SIZE); |
1874 |
+ if (status < 0) { |
1875 |
++ bl_stop_cmd_timer(adapter); |
1876 |
+ rsi_dbg(ERR_ZONE, |
1877 |
+ "%s: REGOUT read failed\n", __func__); |
1878 |
+ return status; |
1879 |
+diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c |
1880 |
+index 23a1d00b5f38..d6cdabef264d 100644 |
1881 |
+--- a/drivers/net/wireless/rsi/rsi_91x_usb.c |
1882 |
++++ b/drivers/net/wireless/rsi/rsi_91x_usb.c |
1883 |
+@@ -16,6 +16,7 @@ |
1884 |
+ */ |
1885 |
+ |
1886 |
+ #include <linux/module.h> |
1887 |
++#include <linux/types.h> |
1888 |
+ #include <net/rsi_91x.h> |
1889 |
+ #include "rsi_usb.h" |
1890 |
+ #include "rsi_hal.h" |
1891 |
+@@ -29,7 +30,7 @@ MODULE_PARM_DESC(dev_oper_mode, |
1892 |
+ "9[Wi-Fi STA + BT LE], 13[Wi-Fi STA + BT classic + BT LE]\n" |
1893 |
+ "6[AP + BT classic], 14[AP + BT classic + BT LE]"); |
1894 |
+ |
1895 |
+-static int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num); |
1896 |
++static int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num, gfp_t flags); |
1897 |
+ |
1898 |
+ /** |
1899 |
+ * rsi_usb_card_write() - This function writes to the USB Card. |
1900 |
+@@ -117,7 +118,7 @@ static int rsi_find_bulk_in_and_out_endpoints(struct usb_interface *interface, |
1901 |
+ __le16 buffer_size; |
1902 |
+ int ii, bin_found = 0, bout_found = 0; |
1903 |
+ |
1904 |
+- iface_desc = &(interface->altsetting[0]); |
1905 |
++ iface_desc = interface->cur_altsetting; |
1906 |
+ |
1907 |
+ for (ii = 0; ii < iface_desc->desc.bNumEndpoints; ++ii) { |
1908 |
+ endpoint = &(iface_desc->endpoint[ii].desc); |
1909 |
+@@ -285,20 +286,29 @@ static void rsi_rx_done_handler(struct urb *urb) |
1910 |
+ status = 0; |
1911 |
+ |
1912 |
+ out: |
1913 |
+- if (rsi_rx_urb_submit(dev->priv, rx_cb->ep_num)) |
1914 |
++ if (rsi_rx_urb_submit(dev->priv, rx_cb->ep_num, GFP_ATOMIC)) |
1915 |
+ rsi_dbg(ERR_ZONE, "%s: Failed in urb submission", __func__); |
1916 |
+ |
1917 |
+ if (status) |
1918 |
+ dev_kfree_skb(rx_cb->rx_skb); |
1919 |
+ } |
1920 |
+ |
1921 |
++static void rsi_rx_urb_kill(struct rsi_hw *adapter, u8 ep_num) |
1922 |
++{ |
1923 |
++ struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)adapter->rsi_dev; |
1924 |
++ struct rx_usb_ctrl_block *rx_cb = &dev->rx_cb[ep_num - 1]; |
1925 |
++ struct urb *urb = rx_cb->rx_urb; |
1926 |
++ |
1927 |
++ usb_kill_urb(urb); |
1928 |
++} |
1929 |
++ |
1930 |
+ /** |
1931 |
+ * rsi_rx_urb_submit() - This function submits the given URB to the USB stack. |
1932 |
+ * @adapter: Pointer to the adapter structure. |
1933 |
+ * |
1934 |
+ * Return: 0 on success, a negative error code on failure. |
1935 |
+ */ |
1936 |
+-static int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num) |
1937 |
++static int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num, gfp_t mem_flags) |
1938 |
+ { |
1939 |
+ struct rsi_91x_usbdev *dev = (struct rsi_91x_usbdev *)adapter->rsi_dev; |
1940 |
+ struct rx_usb_ctrl_block *rx_cb = &dev->rx_cb[ep_num - 1]; |
1941 |
+@@ -328,9 +338,11 @@ static int rsi_rx_urb_submit(struct rsi_hw *adapter, u8 ep_num) |
1942 |
+ rsi_rx_done_handler, |
1943 |
+ rx_cb); |
1944 |
+ |
1945 |
+- status = usb_submit_urb(urb, GFP_KERNEL); |
1946 |
+- if (status) |
1947 |
++ status = usb_submit_urb(urb, mem_flags); |
1948 |
++ if (status) { |
1949 |
+ rsi_dbg(ERR_ZONE, "%s: Failed in urb submission\n", __func__); |
1950 |
++ dev_kfree_skb(skb); |
1951 |
++ } |
1952 |
+ |
1953 |
+ return status; |
1954 |
+ } |
1955 |
+@@ -816,17 +828,20 @@ static int rsi_probe(struct usb_interface *pfunction, |
1956 |
+ rsi_dbg(INIT_ZONE, "%s: Device Init Done\n", __func__); |
1957 |
+ } |
1958 |
+ |
1959 |
+- status = rsi_rx_urb_submit(adapter, WLAN_EP); |
1960 |
++ status = rsi_rx_urb_submit(adapter, WLAN_EP, GFP_KERNEL); |
1961 |
+ if (status) |
1962 |
+ goto err1; |
1963 |
+ |
1964 |
+ if (adapter->priv->coex_mode > 1) { |
1965 |
+- status = rsi_rx_urb_submit(adapter, BT_EP); |
1966 |
++ status = rsi_rx_urb_submit(adapter, BT_EP, GFP_KERNEL); |
1967 |
+ if (status) |
1968 |
+- goto err1; |
1969 |
++ goto err_kill_wlan_urb; |
1970 |
+ } |
1971 |
+ |
1972 |
+ return 0; |
1973 |
++ |
1974 |
++err_kill_wlan_urb: |
1975 |
++ rsi_rx_urb_kill(adapter, WLAN_EP); |
1976 |
+ err1: |
1977 |
+ rsi_deinit_usb_interface(adapter); |
1978 |
+ err: |
1979 |
+@@ -857,6 +872,10 @@ static void rsi_disconnect(struct usb_interface *pfunction) |
1980 |
+ adapter->priv->bt_adapter = NULL; |
1981 |
+ } |
1982 |
+ |
1983 |
++ if (adapter->priv->coex_mode > 1) |
1984 |
++ rsi_rx_urb_kill(adapter, BT_EP); |
1985 |
++ rsi_rx_urb_kill(adapter, WLAN_EP); |
1986 |
++ |
1987 |
+ rsi_reset_card(adapter); |
1988 |
+ rsi_deinit_usb_interface(adapter); |
1989 |
+ rsi_91x_deinit(adapter); |
1990 |
+diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c |
1991 |
+index 7b5c2fe5bd4d..8ff0374126e4 100644 |
1992 |
+--- a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c |
1993 |
++++ b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c |
1994 |
+@@ -1263,7 +1263,7 @@ static void print_id(struct usb_device *udev) |
1995 |
+ static int eject_installer(struct usb_interface *intf) |
1996 |
+ { |
1997 |
+ struct usb_device *udev = interface_to_usbdev(intf); |
1998 |
+- struct usb_host_interface *iface_desc = &intf->altsetting[0]; |
1999 |
++ struct usb_host_interface *iface_desc = intf->cur_altsetting; |
2000 |
+ struct usb_endpoint_descriptor *endpoint; |
2001 |
+ unsigned char *cmd; |
2002 |
+ u8 bulk_out_ep; |
2003 |
+diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c |
2004 |
+index 1593b8494ebb..2f88b1ff7ada 100644 |
2005 |
+--- a/drivers/pci/quirks.c |
2006 |
++++ b/drivers/pci/quirks.c |
2007 |
+@@ -4080,6 +4080,40 @@ static void quirk_mic_x200_dma_alias(struct pci_dev *pdev) |
2008 |
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2260, quirk_mic_x200_dma_alias); |
2009 |
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2264, quirk_mic_x200_dma_alias); |
2010 |
+ |
2011 |
++/* |
2012 |
++ * Intel Visual Compute Accelerator (VCA) is a family of PCIe add-in devices |
2013 |
++ * exposing computational units via Non Transparent Bridges (NTB, PEX 87xx). |
2014 |
++ * |
2015 |
++ * Similarly to MIC x200, we need to add DMA aliases to allow buffer access |
2016 |
++ * when IOMMU is enabled. These aliases allow computational unit access to |
2017 |
++ * host memory. These aliases mark the whole VCA device as one IOMMU |
2018 |
++ * group. |
2019 |
++ * |
2020 |
++ * All possible slot numbers (0x20) are used, since we are unable to tell |
2021 |
++ * what slot is used on other side. This quirk is intended for both host |
2022 |
++ * and computational unit sides. The VCA devices have up to five functions |
2023 |
++ * (four for DMA channels and one additional). |
2024 |
++ */ |
2025 |
++static void quirk_pex_vca_alias(struct pci_dev *pdev) |
2026 |
++{ |
2027 |
++ const unsigned int num_pci_slots = 0x20; |
2028 |
++ unsigned int slot; |
2029 |
++ |
2030 |
++ for (slot = 0; slot < num_pci_slots; slot++) { |
2031 |
++ pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x0)); |
2032 |
++ pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x1)); |
2033 |
++ pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x2)); |
2034 |
++ pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x3)); |
2035 |
++ pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x4)); |
2036 |
++ } |
2037 |
++} |
2038 |
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2954, quirk_pex_vca_alias); |
2039 |
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2955, quirk_pex_vca_alias); |
2040 |
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2956, quirk_pex_vca_alias); |
2041 |
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2958, quirk_pex_vca_alias); |
2042 |
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2959, quirk_pex_vca_alias); |
2043 |
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x295A, quirk_pex_vca_alias); |
2044 |
++ |
2045 |
+ /* |
2046 |
+ * The IOMMU and interrupt controller on Broadcom Vulcan/Cavium ThunderX2 are |
2047 |
+ * associated not at the root bus, but at a bridge below. This quirk avoids |
2048 |
+diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c |
2049 |
+index ce7345745b42..2a3966d059e7 100644 |
2050 |
+--- a/drivers/perf/fsl_imx8_ddr_perf.c |
2051 |
++++ b/drivers/perf/fsl_imx8_ddr_perf.c |
2052 |
+@@ -45,7 +45,8 @@ |
2053 |
+ static DEFINE_IDA(ddr_ida); |
2054 |
+ |
2055 |
+ /* DDR Perf hardware feature */ |
2056 |
+-#define DDR_CAP_AXI_ID_FILTER 0x1 /* support AXI ID filter */ |
2057 |
++#define DDR_CAP_AXI_ID_FILTER 0x1 /* support AXI ID filter */ |
2058 |
++#define DDR_CAP_AXI_ID_FILTER_ENHANCED 0x3 /* support enhanced AXI ID filter */ |
2059 |
+ |
2060 |
+ struct fsl_ddr_devtype_data { |
2061 |
+ unsigned int quirks; /* quirks needed for different DDR Perf core */ |
2062 |
+@@ -178,6 +179,36 @@ static const struct attribute_group *attr_groups[] = { |
2063 |
+ NULL, |
2064 |
+ }; |
2065 |
+ |
2066 |
++static bool ddr_perf_is_filtered(struct perf_event *event) |
2067 |
++{ |
2068 |
++ return event->attr.config == 0x41 || event->attr.config == 0x42; |
2069 |
++} |
2070 |
++ |
2071 |
++static u32 ddr_perf_filter_val(struct perf_event *event) |
2072 |
++{ |
2073 |
++ return event->attr.config1; |
2074 |
++} |
2075 |
++ |
2076 |
++static bool ddr_perf_filters_compatible(struct perf_event *a, |
2077 |
++ struct perf_event *b) |
2078 |
++{ |
2079 |
++ if (!ddr_perf_is_filtered(a)) |
2080 |
++ return true; |
2081 |
++ if (!ddr_perf_is_filtered(b)) |
2082 |
++ return true; |
2083 |
++ return ddr_perf_filter_val(a) == ddr_perf_filter_val(b); |
2084 |
++} |
2085 |
++ |
2086 |
++static bool ddr_perf_is_enhanced_filtered(struct perf_event *event) |
2087 |
++{ |
2088 |
++ unsigned int filt; |
2089 |
++ struct ddr_pmu *pmu = to_ddr_pmu(event->pmu); |
2090 |
++ |
2091 |
++ filt = pmu->devtype_data->quirks & DDR_CAP_AXI_ID_FILTER_ENHANCED; |
2092 |
++ return (filt == DDR_CAP_AXI_ID_FILTER_ENHANCED) && |
2093 |
++ ddr_perf_is_filtered(event); |
2094 |
++} |
2095 |
++ |
2096 |
+ static u32 ddr_perf_alloc_counter(struct ddr_pmu *pmu, int event) |
2097 |
+ { |
2098 |
+ int i; |
2099 |
+@@ -209,27 +240,17 @@ static void ddr_perf_free_counter(struct ddr_pmu *pmu, int counter) |
2100 |
+ |
2101 |
+ static u32 ddr_perf_read_counter(struct ddr_pmu *pmu, int counter) |
2102 |
+ { |
2103 |
+- return readl_relaxed(pmu->base + COUNTER_READ + counter * 4); |
2104 |
+-} |
2105 |
+- |
2106 |
+-static bool ddr_perf_is_filtered(struct perf_event *event) |
2107 |
+-{ |
2108 |
+- return event->attr.config == 0x41 || event->attr.config == 0x42; |
2109 |
+-} |
2110 |
++ struct perf_event *event = pmu->events[counter]; |
2111 |
++ void __iomem *base = pmu->base; |
2112 |
+ |
2113 |
+-static u32 ddr_perf_filter_val(struct perf_event *event) |
2114 |
+-{ |
2115 |
+- return event->attr.config1; |
2116 |
+-} |
2117 |
+- |
2118 |
+-static bool ddr_perf_filters_compatible(struct perf_event *a, |
2119 |
+- struct perf_event *b) |
2120 |
+-{ |
2121 |
+- if (!ddr_perf_is_filtered(a)) |
2122 |
+- return true; |
2123 |
+- if (!ddr_perf_is_filtered(b)) |
2124 |
+- return true; |
2125 |
+- return ddr_perf_filter_val(a) == ddr_perf_filter_val(b); |
2126 |
++ /* |
2127 |
++ * return bytes instead of bursts from ddr transaction for |
2128 |
++ * axid-read and axid-write event if PMU core supports enhanced |
2129 |
++ * filter. |
2130 |
++ */ |
2131 |
++ base += ddr_perf_is_enhanced_filtered(event) ? COUNTER_DPCR1 : |
2132 |
++ COUNTER_READ; |
2133 |
++ return readl_relaxed(base + counter * 4); |
2134 |
+ } |
2135 |
+ |
2136 |
+ static int ddr_perf_event_init(struct perf_event *event) |
2137 |
+diff --git a/drivers/phy/motorola/phy-cpcap-usb.c b/drivers/phy/motorola/phy-cpcap-usb.c |
2138 |
+index 9a38741d3546..5baf64dfb24d 100644 |
2139 |
+--- a/drivers/phy/motorola/phy-cpcap-usb.c |
2140 |
++++ b/drivers/phy/motorola/phy-cpcap-usb.c |
2141 |
+@@ -115,7 +115,7 @@ struct cpcap_usb_ints_state { |
2142 |
+ enum cpcap_gpio_mode { |
2143 |
+ CPCAP_DM_DP, |
2144 |
+ CPCAP_MDM_RX_TX, |
2145 |
+- CPCAP_UNKNOWN, |
2146 |
++ CPCAP_UNKNOWN_DISABLED, /* Seems to disable USB lines */ |
2147 |
+ CPCAP_OTG_DM_DP, |
2148 |
+ }; |
2149 |
+ |
2150 |
+@@ -381,7 +381,8 @@ static int cpcap_usb_set_uart_mode(struct cpcap_phy_ddata *ddata) |
2151 |
+ { |
2152 |
+ int error; |
2153 |
+ |
2154 |
+- error = cpcap_usb_gpio_set_mode(ddata, CPCAP_DM_DP); |
2155 |
++ /* Disable lines to prevent glitches from waking up mdm6600 */ |
2156 |
++ error = cpcap_usb_gpio_set_mode(ddata, CPCAP_UNKNOWN_DISABLED); |
2157 |
+ if (error) |
2158 |
+ goto out_err; |
2159 |
+ |
2160 |
+@@ -408,6 +409,11 @@ static int cpcap_usb_set_uart_mode(struct cpcap_phy_ddata *ddata) |
2161 |
+ if (error) |
2162 |
+ goto out_err; |
2163 |
+ |
2164 |
++ /* Enable UART mode */ |
2165 |
++ error = cpcap_usb_gpio_set_mode(ddata, CPCAP_DM_DP); |
2166 |
++ if (error) |
2167 |
++ goto out_err; |
2168 |
++ |
2169 |
+ return 0; |
2170 |
+ |
2171 |
+ out_err: |
2172 |
+@@ -420,7 +426,8 @@ static int cpcap_usb_set_usb_mode(struct cpcap_phy_ddata *ddata) |
2173 |
+ { |
2174 |
+ int error; |
2175 |
+ |
2176 |
+- error = cpcap_usb_gpio_set_mode(ddata, CPCAP_OTG_DM_DP); |
2177 |
++ /* Disable lines to prevent glitches from waking up mdm6600 */ |
2178 |
++ error = cpcap_usb_gpio_set_mode(ddata, CPCAP_UNKNOWN_DISABLED); |
2179 |
+ if (error) |
2180 |
+ return error; |
2181 |
+ |
2182 |
+@@ -460,6 +467,11 @@ static int cpcap_usb_set_usb_mode(struct cpcap_phy_ddata *ddata) |
2183 |
+ if (error) |
2184 |
+ goto out_err; |
2185 |
+ |
2186 |
++ /* Enable USB mode */ |
2187 |
++ error = cpcap_usb_gpio_set_mode(ddata, CPCAP_OTG_DM_DP); |
2188 |
++ if (error) |
2189 |
++ goto out_err; |
2190 |
++ |
2191 |
+ return 0; |
2192 |
+ |
2193 |
+ out_err: |
2194 |
+diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c |
2195 |
+index 39e8deb8001e..27dd20a7fe13 100644 |
2196 |
+--- a/drivers/phy/qualcomm/phy-qcom-qmp.c |
2197 |
++++ b/drivers/phy/qualcomm/phy-qcom-qmp.c |
2198 |
+@@ -66,7 +66,7 @@ |
2199 |
+ /* QPHY_V3_PCS_MISC_CLAMP_ENABLE register bits */ |
2200 |
+ #define CLAMP_EN BIT(0) /* enables i/o clamp_n */ |
2201 |
+ |
2202 |
+-#define PHY_INIT_COMPLETE_TIMEOUT 1000 |
2203 |
++#define PHY_INIT_COMPLETE_TIMEOUT 10000 |
2204 |
+ #define POWER_DOWN_DELAY_US_MIN 10 |
2205 |
+ #define POWER_DOWN_DELAY_US_MAX 11 |
2206 |
+ |
2207 |
+diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c |
2208 |
+index d27be2836bc2..74e988f839e8 100644 |
2209 |
+--- a/drivers/platform/x86/dell-laptop.c |
2210 |
++++ b/drivers/platform/x86/dell-laptop.c |
2211 |
+@@ -33,6 +33,7 @@ |
2212 |
+ |
2213 |
+ struct quirk_entry { |
2214 |
+ bool touchpad_led; |
2215 |
++ bool kbd_led_not_present; |
2216 |
+ bool kbd_led_levels_off_1; |
2217 |
+ bool kbd_missing_ac_tag; |
2218 |
+ |
2219 |
+@@ -73,6 +74,10 @@ static struct quirk_entry quirk_dell_latitude_e6410 = { |
2220 |
+ .kbd_led_levels_off_1 = true, |
2221 |
+ }; |
2222 |
+ |
2223 |
++static struct quirk_entry quirk_dell_inspiron_1012 = { |
2224 |
++ .kbd_led_not_present = true, |
2225 |
++}; |
2226 |
++ |
2227 |
+ static struct platform_driver platform_driver = { |
2228 |
+ .driver = { |
2229 |
+ .name = "dell-laptop", |
2230 |
+@@ -310,6 +315,24 @@ static const struct dmi_system_id dell_quirks[] __initconst = { |
2231 |
+ }, |
2232 |
+ .driver_data = &quirk_dell_latitude_e6410, |
2233 |
+ }, |
2234 |
++ { |
2235 |
++ .callback = dmi_matched, |
2236 |
++ .ident = "Dell Inspiron 1012", |
2237 |
++ .matches = { |
2238 |
++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), |
2239 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"), |
2240 |
++ }, |
2241 |
++ .driver_data = &quirk_dell_inspiron_1012, |
2242 |
++ }, |
2243 |
++ { |
2244 |
++ .callback = dmi_matched, |
2245 |
++ .ident = "Dell Inspiron 1018", |
2246 |
++ .matches = { |
2247 |
++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), |
2248 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1018"), |
2249 |
++ }, |
2250 |
++ .driver_data = &quirk_dell_inspiron_1012, |
2251 |
++ }, |
2252 |
+ { } |
2253 |
+ }; |
2254 |
+ |
2255 |
+@@ -1493,6 +1516,9 @@ static void kbd_init(void) |
2256 |
+ { |
2257 |
+ int ret; |
2258 |
+ |
2259 |
++ if (quirks && quirks->kbd_led_not_present) |
2260 |
++ return; |
2261 |
++ |
2262 |
+ ret = kbd_init_info(); |
2263 |
+ kbd_init_tokens(); |
2264 |
+ |
2265 |
+diff --git a/drivers/power/supply/ingenic-battery.c b/drivers/power/supply/ingenic-battery.c |
2266 |
+index 35816d4b3012..2748715c4c75 100644 |
2267 |
+--- a/drivers/power/supply/ingenic-battery.c |
2268 |
++++ b/drivers/power/supply/ingenic-battery.c |
2269 |
+@@ -100,10 +100,17 @@ static int ingenic_battery_set_scale(struct ingenic_battery *bat) |
2270 |
+ return -EINVAL; |
2271 |
+ } |
2272 |
+ |
2273 |
+- return iio_write_channel_attribute(bat->channel, |
2274 |
+- scale_raw[best_idx], |
2275 |
+- scale_raw[best_idx + 1], |
2276 |
+- IIO_CHAN_INFO_SCALE); |
2277 |
++ /* Only set scale if there is more than one (fractional) entry */ |
2278 |
++ if (scale_len > 2) { |
2279 |
++ ret = iio_write_channel_attribute(bat->channel, |
2280 |
++ scale_raw[best_idx], |
2281 |
++ scale_raw[best_idx + 1], |
2282 |
++ IIO_CHAN_INFO_SCALE); |
2283 |
++ if (ret) |
2284 |
++ return ret; |
2285 |
++ } |
2286 |
++ |
2287 |
++ return 0; |
2288 |
+ } |
2289 |
+ |
2290 |
+ static enum power_supply_property ingenic_battery_properties[] = { |
2291 |
+diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c |
2292 |
+index 45972056ed8c..11cac7e10663 100644 |
2293 |
+--- a/drivers/spi/spi-dw.c |
2294 |
++++ b/drivers/spi/spi-dw.c |
2295 |
+@@ -172,9 +172,11 @@ static inline u32 rx_max(struct dw_spi *dws) |
2296 |
+ |
2297 |
+ static void dw_writer(struct dw_spi *dws) |
2298 |
+ { |
2299 |
+- u32 max = tx_max(dws); |
2300 |
++ u32 max; |
2301 |
+ u16 txw = 0; |
2302 |
+ |
2303 |
++ spin_lock(&dws->buf_lock); |
2304 |
++ max = tx_max(dws); |
2305 |
+ while (max--) { |
2306 |
+ /* Set the tx word if the transfer's original "tx" is not null */ |
2307 |
+ if (dws->tx_end - dws->len) { |
2308 |
+@@ -186,13 +188,16 @@ static void dw_writer(struct dw_spi *dws) |
2309 |
+ dw_write_io_reg(dws, DW_SPI_DR, txw); |
2310 |
+ dws->tx += dws->n_bytes; |
2311 |
+ } |
2312 |
++ spin_unlock(&dws->buf_lock); |
2313 |
+ } |
2314 |
+ |
2315 |
+ static void dw_reader(struct dw_spi *dws) |
2316 |
+ { |
2317 |
+- u32 max = rx_max(dws); |
2318 |
++ u32 max; |
2319 |
+ u16 rxw; |
2320 |
+ |
2321 |
++ spin_lock(&dws->buf_lock); |
2322 |
++ max = rx_max(dws); |
2323 |
+ while (max--) { |
2324 |
+ rxw = dw_read_io_reg(dws, DW_SPI_DR); |
2325 |
+ /* Care rx only if the transfer's original "rx" is not null */ |
2326 |
+@@ -204,6 +209,7 @@ static void dw_reader(struct dw_spi *dws) |
2327 |
+ } |
2328 |
+ dws->rx += dws->n_bytes; |
2329 |
+ } |
2330 |
++ spin_unlock(&dws->buf_lock); |
2331 |
+ } |
2332 |
+ |
2333 |
+ static void int_error_stop(struct dw_spi *dws, const char *msg) |
2334 |
+@@ -276,18 +282,20 @@ static int dw_spi_transfer_one(struct spi_controller *master, |
2335 |
+ { |
2336 |
+ struct dw_spi *dws = spi_controller_get_devdata(master); |
2337 |
+ struct chip_data *chip = spi_get_ctldata(spi); |
2338 |
++ unsigned long flags; |
2339 |
+ u8 imask = 0; |
2340 |
+ u16 txlevel = 0; |
2341 |
+ u32 cr0; |
2342 |
+ int ret; |
2343 |
+ |
2344 |
+ dws->dma_mapped = 0; |
2345 |
+- |
2346 |
++ spin_lock_irqsave(&dws->buf_lock, flags); |
2347 |
+ dws->tx = (void *)transfer->tx_buf; |
2348 |
+ dws->tx_end = dws->tx + transfer->len; |
2349 |
+ dws->rx = transfer->rx_buf; |
2350 |
+ dws->rx_end = dws->rx + transfer->len; |
2351 |
+ dws->len = transfer->len; |
2352 |
++ spin_unlock_irqrestore(&dws->buf_lock, flags); |
2353 |
+ |
2354 |
+ spi_enable_chip(dws, 0); |
2355 |
+ |
2356 |
+@@ -471,6 +479,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) |
2357 |
+ dws->type = SSI_MOTO_SPI; |
2358 |
+ dws->dma_inited = 0; |
2359 |
+ dws->dma_addr = (dma_addr_t)(dws->paddr + DW_SPI_DR); |
2360 |
++ spin_lock_init(&dws->buf_lock); |
2361 |
+ |
2362 |
+ spi_controller_set_devdata(master, dws); |
2363 |
+ |
2364 |
+diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h |
2365 |
+index c9c15881e982..f3a2f157a2b1 100644 |
2366 |
+--- a/drivers/spi/spi-dw.h |
2367 |
++++ b/drivers/spi/spi-dw.h |
2368 |
+@@ -120,6 +120,7 @@ struct dw_spi { |
2369 |
+ size_t len; |
2370 |
+ void *tx; |
2371 |
+ void *tx_end; |
2372 |
++ spinlock_t buf_lock; |
2373 |
+ void *rx; |
2374 |
+ void *rx_end; |
2375 |
+ int dma_mapped; |
2376 |
+diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c |
2377 |
+index 9f92165fe09f..2fd843b18297 100644 |
2378 |
+--- a/drivers/spi/spi-pxa2xx.c |
2379 |
++++ b/drivers/spi/spi-pxa2xx.c |
2380 |
+@@ -1461,6 +1461,10 @@ static const struct pci_device_id pxa2xx_spi_pci_compound_match[] = { |
2381 |
+ { PCI_VDEVICE(INTEL, 0x02aa), LPSS_CNL_SSP }, |
2382 |
+ { PCI_VDEVICE(INTEL, 0x02ab), LPSS_CNL_SSP }, |
2383 |
+ { PCI_VDEVICE(INTEL, 0x02fb), LPSS_CNL_SSP }, |
2384 |
++ /* CML-H */ |
2385 |
++ { PCI_VDEVICE(INTEL, 0x06aa), LPSS_CNL_SSP }, |
2386 |
++ { PCI_VDEVICE(INTEL, 0x06ab), LPSS_CNL_SSP }, |
2387 |
++ { PCI_VDEVICE(INTEL, 0x06fb), LPSS_CNL_SSP }, |
2388 |
+ /* TGL-LP */ |
2389 |
+ { PCI_VDEVICE(INTEL, 0xa0aa), LPSS_CNL_SSP }, |
2390 |
+ { PCI_VDEVICE(INTEL, 0xa0ab), LPSS_CNL_SSP }, |
2391 |
+diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c |
2392 |
+index 26a31854c636..c48956f0ef29 100644 |
2393 |
+--- a/drivers/staging/most/net/net.c |
2394 |
++++ b/drivers/staging/most/net/net.c |
2395 |
+@@ -81,6 +81,11 @@ static int skb_to_mamac(const struct sk_buff *skb, struct mbo *mbo) |
2396 |
+ unsigned int payload_len = skb->len - ETH_HLEN; |
2397 |
+ unsigned int mdp_len = payload_len + MDP_HDR_LEN; |
2398 |
+ |
2399 |
++ if (mdp_len < skb->len) { |
2400 |
++ pr_err("drop: too large packet! (%u)\n", skb->len); |
2401 |
++ return -EINVAL; |
2402 |
++ } |
2403 |
++ |
2404 |
+ if (mbo->buffer_length < mdp_len) { |
2405 |
+ pr_err("drop: too small buffer! (%d for %d)\n", |
2406 |
+ mbo->buffer_length, mdp_len); |
2407 |
+@@ -128,6 +133,11 @@ static int skb_to_mep(const struct sk_buff *skb, struct mbo *mbo) |
2408 |
+ u8 *buff = mbo->virt_address; |
2409 |
+ unsigned int mep_len = skb->len + MEP_HDR_LEN; |
2410 |
+ |
2411 |
++ if (mep_len < skb->len) { |
2412 |
++ pr_err("drop: too large packet! (%u)\n", skb->len); |
2413 |
++ return -EINVAL; |
2414 |
++ } |
2415 |
++ |
2416 |
+ if (mbo->buffer_length < mep_len) { |
2417 |
+ pr_err("drop: too small buffer! (%d for %d)\n", |
2418 |
+ mbo->buffer_length, mep_len); |
2419 |
+diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c |
2420 |
+index 6b98827da57f..3633c924848e 100644 |
2421 |
+--- a/drivers/staging/mt7621-pci/pci-mt7621.c |
2422 |
++++ b/drivers/staging/mt7621-pci/pci-mt7621.c |
2423 |
+@@ -29,15 +29,14 @@ |
2424 |
+ #include <linux/phy/phy.h> |
2425 |
+ #include <linux/platform_device.h> |
2426 |
+ #include <linux/reset.h> |
2427 |
++#include <linux/sys_soc.h> |
2428 |
+ #include <mt7621.h> |
2429 |
+ #include <ralink_regs.h> |
2430 |
+ |
2431 |
+ #include "../../pci/pci.h" |
2432 |
+ |
2433 |
+ /* sysctl */ |
2434 |
+-#define MT7621_CHIP_REV_ID 0x0c |
2435 |
+ #define MT7621_GPIO_MODE 0x60 |
2436 |
+-#define CHIP_REV_MT7621_E2 0x0101 |
2437 |
+ |
2438 |
+ /* MediaTek specific configuration registers */ |
2439 |
+ #define PCIE_FTS_NUM 0x70c |
2440 |
+@@ -126,6 +125,8 @@ struct mt7621_pcie_port { |
2441 |
+ * @ports: pointer to PCIe port information |
2442 |
+ * @perst: gpio reset |
2443 |
+ * @rst: pointer to pcie reset |
2444 |
++ * @resets_inverted: depends on chip revision |
2445 |
++ * reset lines are inverted. |
2446 |
+ */ |
2447 |
+ struct mt7621_pcie { |
2448 |
+ void __iomem *base; |
2449 |
+@@ -140,6 +141,7 @@ struct mt7621_pcie { |
2450 |
+ struct list_head ports; |
2451 |
+ struct gpio_desc *perst; |
2452 |
+ struct reset_control *rst; |
2453 |
++ bool resets_inverted; |
2454 |
+ }; |
2455 |
+ |
2456 |
+ static inline u32 pcie_read(struct mt7621_pcie *pcie, u32 reg) |
2457 |
+@@ -229,9 +231,9 @@ static inline void mt7621_pcie_port_clk_disable(struct mt7621_pcie_port *port) |
2458 |
+ |
2459 |
+ static inline void mt7621_control_assert(struct mt7621_pcie_port *port) |
2460 |
+ { |
2461 |
+- u32 chip_rev_id = rt_sysc_r32(MT7621_CHIP_REV_ID); |
2462 |
++ struct mt7621_pcie *pcie = port->pcie; |
2463 |
+ |
2464 |
+- if ((chip_rev_id & 0xFFFF) == CHIP_REV_MT7621_E2) |
2465 |
++ if (pcie->resets_inverted) |
2466 |
+ reset_control_assert(port->pcie_rst); |
2467 |
+ else |
2468 |
+ reset_control_deassert(port->pcie_rst); |
2469 |
+@@ -239,9 +241,9 @@ static inline void mt7621_control_assert(struct mt7621_pcie_port *port) |
2470 |
+ |
2471 |
+ static inline void mt7621_control_deassert(struct mt7621_pcie_port *port) |
2472 |
+ { |
2473 |
+- u32 chip_rev_id = rt_sysc_r32(MT7621_CHIP_REV_ID); |
2474 |
++ struct mt7621_pcie *pcie = port->pcie; |
2475 |
+ |
2476 |
+- if ((chip_rev_id & 0xFFFF) == CHIP_REV_MT7621_E2) |
2477 |
++ if (pcie->resets_inverted) |
2478 |
+ reset_control_deassert(port->pcie_rst); |
2479 |
+ else |
2480 |
+ reset_control_assert(port->pcie_rst); |
2481 |
+@@ -641,9 +643,14 @@ static int mt7621_pcie_register_host(struct pci_host_bridge *host, |
2482 |
+ return pci_host_probe(host); |
2483 |
+ } |
2484 |
+ |
2485 |
++static const struct soc_device_attribute mt7621_pci_quirks_match[] = { |
2486 |
++ { .soc_id = "mt7621", .revision = "E2" } |
2487 |
++}; |
2488 |
++ |
2489 |
+ static int mt7621_pci_probe(struct platform_device *pdev) |
2490 |
+ { |
2491 |
+ struct device *dev = &pdev->dev; |
2492 |
++ const struct soc_device_attribute *attr; |
2493 |
+ struct mt7621_pcie *pcie; |
2494 |
+ struct pci_host_bridge *bridge; |
2495 |
+ int err; |
2496 |
+@@ -661,6 +668,10 @@ static int mt7621_pci_probe(struct platform_device *pdev) |
2497 |
+ platform_set_drvdata(pdev, pcie); |
2498 |
+ INIT_LIST_HEAD(&pcie->ports); |
2499 |
+ |
2500 |
++ attr = soc_device_match(mt7621_pci_quirks_match); |
2501 |
++ if (attr) |
2502 |
++ pcie->resets_inverted = true; |
2503 |
++ |
2504 |
+ err = mt7621_pcie_parse_dt(pcie); |
2505 |
+ if (err) { |
2506 |
+ dev_err(dev, "Parsing DT failed\n"); |
2507 |
+diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h |
2508 |
+index 50e1c8918040..e2fabe818b19 100644 |
2509 |
+--- a/drivers/staging/vt6656/device.h |
2510 |
++++ b/drivers/staging/vt6656/device.h |
2511 |
+@@ -52,6 +52,8 @@ |
2512 |
+ #define RATE_AUTO 12 |
2513 |
+ |
2514 |
+ #define MAX_RATE 12 |
2515 |
++#define VNT_B_RATES (BIT(RATE_1M) | BIT(RATE_2M) |\ |
2516 |
++ BIT(RATE_5M) | BIT(RATE_11M)) |
2517 |
+ |
2518 |
+ /* |
2519 |
+ * device specific |
2520 |
+diff --git a/drivers/staging/vt6656/int.c b/drivers/staging/vt6656/int.c |
2521 |
+index f40947955675..af215860be4c 100644 |
2522 |
+--- a/drivers/staging/vt6656/int.c |
2523 |
++++ b/drivers/staging/vt6656/int.c |
2524 |
+@@ -99,9 +99,11 @@ static int vnt_int_report_rate(struct vnt_private *priv, u8 pkt_no, u8 tsr) |
2525 |
+ |
2526 |
+ info->status.rates[0].count = tx_retry; |
2527 |
+ |
2528 |
+- if (!(tsr & (TSR_TMO | TSR_RETRYTMO))) { |
2529 |
++ if (!(tsr & TSR_TMO)) { |
2530 |
+ info->status.rates[0].idx = idx; |
2531 |
+- info->flags |= IEEE80211_TX_STAT_ACK; |
2532 |
++ |
2533 |
++ if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
2534 |
++ info->flags |= IEEE80211_TX_STAT_ACK; |
2535 |
+ } |
2536 |
+ |
2537 |
+ ieee80211_tx_status_irqsafe(priv->hw, context->skb); |
2538 |
+diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c |
2539 |
+index c26882e2bb80..69a48383611f 100644 |
2540 |
+--- a/drivers/staging/vt6656/main_usb.c |
2541 |
++++ b/drivers/staging/vt6656/main_usb.c |
2542 |
+@@ -1016,6 +1016,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id) |
2543 |
+ ieee80211_hw_set(priv->hw, RX_INCLUDES_FCS); |
2544 |
+ ieee80211_hw_set(priv->hw, REPORTS_TX_ACK_STATUS); |
2545 |
+ ieee80211_hw_set(priv->hw, SUPPORTS_PS); |
2546 |
++ ieee80211_hw_set(priv->hw, PS_NULLFUNC_STACK); |
2547 |
+ |
2548 |
+ priv->hw->max_signal = 100; |
2549 |
+ |
2550 |
+diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c |
2551 |
+index 4e9cfacf75f2..ab6141f361af 100644 |
2552 |
+--- a/drivers/staging/vt6656/rxtx.c |
2553 |
++++ b/drivers/staging/vt6656/rxtx.c |
2554 |
+@@ -278,11 +278,9 @@ static u16 vnt_rxtx_datahead_g(struct vnt_usb_send_context *tx_context, |
2555 |
+ PK_TYPE_11B, &buf->b); |
2556 |
+ |
2557 |
+ /* Get Duration and TimeStamp */ |
2558 |
+- if (ieee80211_is_pspoll(hdr->frame_control)) { |
2559 |
+- __le16 dur = cpu_to_le16(priv->current_aid | BIT(14) | BIT(15)); |
2560 |
+- |
2561 |
+- buf->duration_a = dur; |
2562 |
+- buf->duration_b = dur; |
2563 |
++ if (ieee80211_is_nullfunc(hdr->frame_control)) { |
2564 |
++ buf->duration_a = hdr->duration_id; |
2565 |
++ buf->duration_b = hdr->duration_id; |
2566 |
+ } else { |
2567 |
+ buf->duration_a = vnt_get_duration_le(priv, |
2568 |
+ tx_context->pkt_type, need_ack); |
2569 |
+@@ -371,10 +369,8 @@ static u16 vnt_rxtx_datahead_ab(struct vnt_usb_send_context *tx_context, |
2570 |
+ tx_context->pkt_type, &buf->ab); |
2571 |
+ |
2572 |
+ /* Get Duration and TimeStampOff */ |
2573 |
+- if (ieee80211_is_pspoll(hdr->frame_control)) { |
2574 |
+- __le16 dur = cpu_to_le16(priv->current_aid | BIT(14) | BIT(15)); |
2575 |
+- |
2576 |
+- buf->duration = dur; |
2577 |
++ if (ieee80211_is_nullfunc(hdr->frame_control)) { |
2578 |
++ buf->duration = hdr->duration_id; |
2579 |
+ } else { |
2580 |
+ buf->duration = vnt_get_duration_le(priv, tx_context->pkt_type, |
2581 |
+ need_ack); |
2582 |
+@@ -815,10 +811,14 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) |
2583 |
+ if (info->band == NL80211_BAND_5GHZ) { |
2584 |
+ pkt_type = PK_TYPE_11A; |
2585 |
+ } else { |
2586 |
+- if (tx_rate->flags & IEEE80211_TX_RC_USE_CTS_PROTECT) |
2587 |
+- pkt_type = PK_TYPE_11GB; |
2588 |
+- else |
2589 |
+- pkt_type = PK_TYPE_11GA; |
2590 |
++ if (tx_rate->flags & IEEE80211_TX_RC_USE_CTS_PROTECT) { |
2591 |
++ if (priv->basic_rates & VNT_B_RATES) |
2592 |
++ pkt_type = PK_TYPE_11GB; |
2593 |
++ else |
2594 |
++ pkt_type = PK_TYPE_11GA; |
2595 |
++ } else { |
2596 |
++ pkt_type = PK_TYPE_11A; |
2597 |
++ } |
2598 |
+ } |
2599 |
+ } else { |
2600 |
+ pkt_type = PK_TYPE_11B; |
2601 |
+diff --git a/drivers/staging/wlan-ng/prism2mgmt.c b/drivers/staging/wlan-ng/prism2mgmt.c |
2602 |
+index 7350fe5d96a3..a8860d2aee68 100644 |
2603 |
+--- a/drivers/staging/wlan-ng/prism2mgmt.c |
2604 |
++++ b/drivers/staging/wlan-ng/prism2mgmt.c |
2605 |
+@@ -959,7 +959,7 @@ int prism2mgmt_flashdl_state(struct wlandevice *wlandev, void *msgp) |
2606 |
+ } |
2607 |
+ } |
2608 |
+ |
2609 |
+- return 0; |
2610 |
++ return result; |
2611 |
+ } |
2612 |
+ |
2613 |
+ /*---------------------------------------------------------------- |
2614 |
+diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c |
2615 |
+index 8ce700c1a7fc..4997c519ebb3 100644 |
2616 |
+--- a/drivers/tty/serial/8250/8250_bcm2835aux.c |
2617 |
++++ b/drivers/tty/serial/8250/8250_bcm2835aux.c |
2618 |
+@@ -113,7 +113,7 @@ static int bcm2835aux_serial_remove(struct platform_device *pdev) |
2619 |
+ { |
2620 |
+ struct bcm2835aux_data *data = platform_get_drvdata(pdev); |
2621 |
+ |
2622 |
+- serial8250_unregister_port(data->uart.port.line); |
2623 |
++ serial8250_unregister_port(data->line); |
2624 |
+ clk_disable_unprepare(data->clk); |
2625 |
+ |
2626 |
+ return 0; |
2627 |
+diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c |
2628 |
+index 34f602c3a882..9d8c660dc289 100644 |
2629 |
+--- a/drivers/tty/serial/imx.c |
2630 |
++++ b/drivers/tty/serial/imx.c |
2631 |
+@@ -700,22 +700,33 @@ static void imx_uart_start_tx(struct uart_port *port) |
2632 |
+ } |
2633 |
+ } |
2634 |
+ |
2635 |
+-static irqreturn_t imx_uart_rtsint(int irq, void *dev_id) |
2636 |
++static irqreturn_t __imx_uart_rtsint(int irq, void *dev_id) |
2637 |
+ { |
2638 |
+ struct imx_port *sport = dev_id; |
2639 |
+ u32 usr1; |
2640 |
+ |
2641 |
+- spin_lock(&sport->port.lock); |
2642 |
+- |
2643 |
+ imx_uart_writel(sport, USR1_RTSD, USR1); |
2644 |
+ usr1 = imx_uart_readl(sport, USR1) & USR1_RTSS; |
2645 |
+ uart_handle_cts_change(&sport->port, !!usr1); |
2646 |
+ wake_up_interruptible(&sport->port.state->port.delta_msr_wait); |
2647 |
+ |
2648 |
+- spin_unlock(&sport->port.lock); |
2649 |
+ return IRQ_HANDLED; |
2650 |
+ } |
2651 |
+ |
2652 |
++static irqreturn_t imx_uart_rtsint(int irq, void *dev_id) |
2653 |
++{ |
2654 |
++ struct imx_port *sport = dev_id; |
2655 |
++ irqreturn_t ret; |
2656 |
++ |
2657 |
++ spin_lock(&sport->port.lock); |
2658 |
++ |
2659 |
++ ret = __imx_uart_rtsint(irq, dev_id); |
2660 |
++ |
2661 |
++ spin_unlock(&sport->port.lock); |
2662 |
++ |
2663 |
++ return ret; |
2664 |
++} |
2665 |
++ |
2666 |
+ static irqreturn_t imx_uart_txint(int irq, void *dev_id) |
2667 |
+ { |
2668 |
+ struct imx_port *sport = dev_id; |
2669 |
+@@ -726,14 +737,12 @@ static irqreturn_t imx_uart_txint(int irq, void *dev_id) |
2670 |
+ return IRQ_HANDLED; |
2671 |
+ } |
2672 |
+ |
2673 |
+-static irqreturn_t imx_uart_rxint(int irq, void *dev_id) |
2674 |
++static irqreturn_t __imx_uart_rxint(int irq, void *dev_id) |
2675 |
+ { |
2676 |
+ struct imx_port *sport = dev_id; |
2677 |
+ unsigned int rx, flg, ignored = 0; |
2678 |
+ struct tty_port *port = &sport->port.state->port; |
2679 |
+ |
2680 |
+- spin_lock(&sport->port.lock); |
2681 |
+- |
2682 |
+ while (imx_uart_readl(sport, USR2) & USR2_RDR) { |
2683 |
+ u32 usr2; |
2684 |
+ |
2685 |
+@@ -792,11 +801,25 @@ static irqreturn_t imx_uart_rxint(int irq, void *dev_id) |
2686 |
+ } |
2687 |
+ |
2688 |
+ out: |
2689 |
+- spin_unlock(&sport->port.lock); |
2690 |
+ tty_flip_buffer_push(port); |
2691 |
++ |
2692 |
+ return IRQ_HANDLED; |
2693 |
+ } |
2694 |
+ |
2695 |
++static irqreturn_t imx_uart_rxint(int irq, void *dev_id) |
2696 |
++{ |
2697 |
++ struct imx_port *sport = dev_id; |
2698 |
++ irqreturn_t ret; |
2699 |
++ |
2700 |
++ spin_lock(&sport->port.lock); |
2701 |
++ |
2702 |
++ ret = __imx_uart_rxint(irq, dev_id); |
2703 |
++ |
2704 |
++ spin_unlock(&sport->port.lock); |
2705 |
++ |
2706 |
++ return ret; |
2707 |
++} |
2708 |
++ |
2709 |
+ static void imx_uart_clear_rx_errors(struct imx_port *sport); |
2710 |
+ |
2711 |
+ /* |
2712 |
+@@ -855,6 +878,8 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id) |
2713 |
+ unsigned int usr1, usr2, ucr1, ucr2, ucr3, ucr4; |
2714 |
+ irqreturn_t ret = IRQ_NONE; |
2715 |
+ |
2716 |
++ spin_lock(&sport->port.lock); |
2717 |
++ |
2718 |
+ usr1 = imx_uart_readl(sport, USR1); |
2719 |
+ usr2 = imx_uart_readl(sport, USR2); |
2720 |
+ ucr1 = imx_uart_readl(sport, UCR1); |
2721 |
+@@ -888,27 +913,25 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id) |
2722 |
+ usr2 &= ~USR2_ORE; |
2723 |
+ |
2724 |
+ if (usr1 & (USR1_RRDY | USR1_AGTIM)) { |
2725 |
+- imx_uart_rxint(irq, dev_id); |
2726 |
++ __imx_uart_rxint(irq, dev_id); |
2727 |
+ ret = IRQ_HANDLED; |
2728 |
+ } |
2729 |
+ |
2730 |
+ if ((usr1 & USR1_TRDY) || (usr2 & USR2_TXDC)) { |
2731 |
+- imx_uart_txint(irq, dev_id); |
2732 |
++ imx_uart_transmit_buffer(sport); |
2733 |
+ ret = IRQ_HANDLED; |
2734 |
+ } |
2735 |
+ |
2736 |
+ if (usr1 & USR1_DTRD) { |
2737 |
+ imx_uart_writel(sport, USR1_DTRD, USR1); |
2738 |
+ |
2739 |
+- spin_lock(&sport->port.lock); |
2740 |
+ imx_uart_mctrl_check(sport); |
2741 |
+- spin_unlock(&sport->port.lock); |
2742 |
+ |
2743 |
+ ret = IRQ_HANDLED; |
2744 |
+ } |
2745 |
+ |
2746 |
+ if (usr1 & USR1_RTSD) { |
2747 |
+- imx_uart_rtsint(irq, dev_id); |
2748 |
++ __imx_uart_rtsint(irq, dev_id); |
2749 |
+ ret = IRQ_HANDLED; |
2750 |
+ } |
2751 |
+ |
2752 |
+@@ -923,6 +946,8 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id) |
2753 |
+ ret = IRQ_HANDLED; |
2754 |
+ } |
2755 |
+ |
2756 |
++ spin_unlock(&sport->port.lock); |
2757 |
++ |
2758 |
+ return ret; |
2759 |
+ } |
2760 |
+ |
2761 |
+diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c |
2762 |
+index 97d6ae3c4df2..cede7a8e3605 100644 |
2763 |
+--- a/drivers/usb/dwc3/core.c |
2764 |
++++ b/drivers/usb/dwc3/core.c |
2765 |
+@@ -1209,6 +1209,9 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc) |
2766 |
+ /* do nothing */ |
2767 |
+ break; |
2768 |
+ } |
2769 |
++ |
2770 |
++ /* de-assert DRVVBUS for HOST and OTG mode */ |
2771 |
++ dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE); |
2772 |
+ } |
2773 |
+ |
2774 |
+ static void dwc3_get_properties(struct dwc3 *dwc) |
2775 |
+diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c |
2776 |
+index 294276f7deb9..7051611229c9 100644 |
2777 |
+--- a/drivers/usb/dwc3/dwc3-pci.c |
2778 |
++++ b/drivers/usb/dwc3/dwc3-pci.c |
2779 |
+@@ -34,6 +34,7 @@ |
2780 |
+ #define PCI_DEVICE_ID_INTEL_GLK 0x31aa |
2781 |
+ #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee |
2782 |
+ #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e |
2783 |
++#define PCI_DEVICE_ID_INTEL_CNPV 0xa3b0 |
2784 |
+ #define PCI_DEVICE_ID_INTEL_ICLLP 0x34ee |
2785 |
+ #define PCI_DEVICE_ID_INTEL_EHLLP 0x4b7e |
2786 |
+ #define PCI_DEVICE_ID_INTEL_TGPLP 0xa0ee |
2787 |
+@@ -342,6 +343,9 @@ static const struct pci_device_id dwc3_pci_id_table[] = { |
2788 |
+ { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_CNPH), |
2789 |
+ (kernel_ulong_t) &dwc3_pci_intel_properties, }, |
2790 |
+ |
2791 |
++ { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_CNPV), |
2792 |
++ (kernel_ulong_t) &dwc3_pci_intel_properties, }, |
2793 |
++ |
2794 |
+ { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_ICLLP), |
2795 |
+ (kernel_ulong_t) &dwc3_pci_intel_properties, }, |
2796 |
+ |
2797 |
+diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c |
2798 |
+index dc172513a4aa..b8e24ccba9f3 100644 |
2799 |
+--- a/drivers/usb/host/xhci-tegra.c |
2800 |
++++ b/drivers/usb/host/xhci-tegra.c |
2801 |
+@@ -1413,6 +1413,7 @@ MODULE_FIRMWARE("nvidia/tegra210/xusb.bin"); |
2802 |
+ |
2803 |
+ static const char * const tegra186_supply_names[] = { |
2804 |
+ }; |
2805 |
++MODULE_FIRMWARE("nvidia/tegra186/xusb.bin"); |
2806 |
+ |
2807 |
+ static const struct tegra_xusb_phy_type tegra186_phy_types[] = { |
2808 |
+ { .name = "usb3", .num = 3, }, |
2809 |
+diff --git a/drivers/usb/musb/jz4740.c b/drivers/usb/musb/jz4740.c |
2810 |
+index 5261f8dfedec..e3b8c84ccdb8 100644 |
2811 |
+--- a/drivers/usb/musb/jz4740.c |
2812 |
++++ b/drivers/usb/musb/jz4740.c |
2813 |
+@@ -75,14 +75,17 @@ static struct musb_hdrc_platform_data jz4740_musb_platform_data = { |
2814 |
+ static int jz4740_musb_init(struct musb *musb) |
2815 |
+ { |
2816 |
+ struct device *dev = musb->controller->parent; |
2817 |
++ int err; |
2818 |
+ |
2819 |
+ if (dev->of_node) |
2820 |
+ musb->xceiv = devm_usb_get_phy_by_phandle(dev, "phys", 0); |
2821 |
+ else |
2822 |
+ musb->xceiv = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2); |
2823 |
+ if (IS_ERR(musb->xceiv)) { |
2824 |
+- dev_err(dev, "No transceiver configured\n"); |
2825 |
+- return PTR_ERR(musb->xceiv); |
2826 |
++ err = PTR_ERR(musb->xceiv); |
2827 |
++ if (err != -EPROBE_DEFER) |
2828 |
++ dev_err(dev, "No transceiver configured: %d", err); |
2829 |
++ return err; |
2830 |
+ } |
2831 |
+ |
2832 |
+ /* Silicon does not implement ConfigData register. |
2833 |
+diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c |
2834 |
+index 302eb9530859..627bea7e6cfb 100644 |
2835 |
+--- a/drivers/usb/serial/ir-usb.c |
2836 |
++++ b/drivers/usb/serial/ir-usb.c |
2837 |
+@@ -45,9 +45,10 @@ static int buffer_size; |
2838 |
+ static int xbof = -1; |
2839 |
+ |
2840 |
+ static int ir_startup (struct usb_serial *serial); |
2841 |
+-static int ir_open(struct tty_struct *tty, struct usb_serial_port *port); |
2842 |
+-static int ir_prepare_write_buffer(struct usb_serial_port *port, |
2843 |
+- void *dest, size_t size); |
2844 |
++static int ir_write(struct tty_struct *tty, struct usb_serial_port *port, |
2845 |
++ const unsigned char *buf, int count); |
2846 |
++static int ir_write_room(struct tty_struct *tty); |
2847 |
++static void ir_write_bulk_callback(struct urb *urb); |
2848 |
+ static void ir_process_read_urb(struct urb *urb); |
2849 |
+ static void ir_set_termios(struct tty_struct *tty, |
2850 |
+ struct usb_serial_port *port, struct ktermios *old_termios); |
2851 |
+@@ -77,8 +78,9 @@ static struct usb_serial_driver ir_device = { |
2852 |
+ .num_ports = 1, |
2853 |
+ .set_termios = ir_set_termios, |
2854 |
+ .attach = ir_startup, |
2855 |
+- .open = ir_open, |
2856 |
+- .prepare_write_buffer = ir_prepare_write_buffer, |
2857 |
++ .write = ir_write, |
2858 |
++ .write_room = ir_write_room, |
2859 |
++ .write_bulk_callback = ir_write_bulk_callback, |
2860 |
+ .process_read_urb = ir_process_read_urb, |
2861 |
+ }; |
2862 |
+ |
2863 |
+@@ -195,6 +197,9 @@ static int ir_startup(struct usb_serial *serial) |
2864 |
+ struct usb_irda_cs_descriptor *irda_desc; |
2865 |
+ int rates; |
2866 |
+ |
2867 |
++ if (serial->num_bulk_in < 1 || serial->num_bulk_out < 1) |
2868 |
++ return -ENODEV; |
2869 |
++ |
2870 |
+ irda_desc = irda_usb_find_class_desc(serial, 0); |
2871 |
+ if (!irda_desc) { |
2872 |
+ dev_err(&serial->dev->dev, |
2873 |
+@@ -251,35 +256,102 @@ static int ir_startup(struct usb_serial *serial) |
2874 |
+ return 0; |
2875 |
+ } |
2876 |
+ |
2877 |
+-static int ir_open(struct tty_struct *tty, struct usb_serial_port *port) |
2878 |
++static int ir_write(struct tty_struct *tty, struct usb_serial_port *port, |
2879 |
++ const unsigned char *buf, int count) |
2880 |
+ { |
2881 |
+- int i; |
2882 |
++ struct urb *urb = NULL; |
2883 |
++ unsigned long flags; |
2884 |
++ int ret; |
2885 |
+ |
2886 |
+- for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) |
2887 |
+- port->write_urbs[i]->transfer_flags = URB_ZERO_PACKET; |
2888 |
++ if (port->bulk_out_size == 0) |
2889 |
++ return -EINVAL; |
2890 |
+ |
2891 |
+- /* Start reading from the device */ |
2892 |
+- return usb_serial_generic_open(tty, port); |
2893 |
+-} |
2894 |
++ if (count == 0) |
2895 |
++ return 0; |
2896 |
+ |
2897 |
+-static int ir_prepare_write_buffer(struct usb_serial_port *port, |
2898 |
+- void *dest, size_t size) |
2899 |
+-{ |
2900 |
+- unsigned char *buf = dest; |
2901 |
+- int count; |
2902 |
++ count = min(count, port->bulk_out_size - 1); |
2903 |
++ |
2904 |
++ spin_lock_irqsave(&port->lock, flags); |
2905 |
++ if (__test_and_clear_bit(0, &port->write_urbs_free)) { |
2906 |
++ urb = port->write_urbs[0]; |
2907 |
++ port->tx_bytes += count; |
2908 |
++ } |
2909 |
++ spin_unlock_irqrestore(&port->lock, flags); |
2910 |
++ |
2911 |
++ if (!urb) |
2912 |
++ return 0; |
2913 |
+ |
2914 |
+ /* |
2915 |
+ * The first byte of the packet we send to the device contains an |
2916 |
+- * inbound header which indicates an additional number of BOFs and |
2917 |
++ * outbound header which indicates an additional number of BOFs and |
2918 |
+ * a baud rate change. |
2919 |
+ * |
2920 |
+ * See section 5.4.2.2 of the USB IrDA spec. |
2921 |
+ */ |
2922 |
+- *buf = ir_xbof | ir_baud; |
2923 |
++ *(u8 *)urb->transfer_buffer = ir_xbof | ir_baud; |
2924 |
++ |
2925 |
++ memcpy(urb->transfer_buffer + 1, buf, count); |
2926 |
++ |
2927 |
++ urb->transfer_buffer_length = count + 1; |
2928 |
++ urb->transfer_flags = URB_ZERO_PACKET; |
2929 |
++ |
2930 |
++ ret = usb_submit_urb(urb, GFP_ATOMIC); |
2931 |
++ if (ret) { |
2932 |
++ dev_err(&port->dev, "failed to submit write urb: %d\n", ret); |
2933 |
++ |
2934 |
++ spin_lock_irqsave(&port->lock, flags); |
2935 |
++ __set_bit(0, &port->write_urbs_free); |
2936 |
++ port->tx_bytes -= count; |
2937 |
++ spin_unlock_irqrestore(&port->lock, flags); |
2938 |
++ |
2939 |
++ return ret; |
2940 |
++ } |
2941 |
++ |
2942 |
++ return count; |
2943 |
++} |
2944 |
++ |
2945 |
++static void ir_write_bulk_callback(struct urb *urb) |
2946 |
++{ |
2947 |
++ struct usb_serial_port *port = urb->context; |
2948 |
++ int status = urb->status; |
2949 |
++ unsigned long flags; |
2950 |
++ |
2951 |
++ spin_lock_irqsave(&port->lock, flags); |
2952 |
++ __set_bit(0, &port->write_urbs_free); |
2953 |
++ port->tx_bytes -= urb->transfer_buffer_length - 1; |
2954 |
++ spin_unlock_irqrestore(&port->lock, flags); |
2955 |
++ |
2956 |
++ switch (status) { |
2957 |
++ case 0: |
2958 |
++ break; |
2959 |
++ case -ENOENT: |
2960 |
++ case -ECONNRESET: |
2961 |
++ case -ESHUTDOWN: |
2962 |
++ dev_dbg(&port->dev, "write urb stopped: %d\n", status); |
2963 |
++ return; |
2964 |
++ case -EPIPE: |
2965 |
++ dev_err(&port->dev, "write urb stopped: %d\n", status); |
2966 |
++ return; |
2967 |
++ default: |
2968 |
++ dev_err(&port->dev, "nonzero write-urb status: %d\n", status); |
2969 |
++ break; |
2970 |
++ } |
2971 |
++ |
2972 |
++ usb_serial_port_softint(port); |
2973 |
++} |
2974 |
++ |
2975 |
++static int ir_write_room(struct tty_struct *tty) |
2976 |
++{ |
2977 |
++ struct usb_serial_port *port = tty->driver_data; |
2978 |
++ int count = 0; |
2979 |
++ |
2980 |
++ if (port->bulk_out_size == 0) |
2981 |
++ return 0; |
2982 |
++ |
2983 |
++ if (test_bit(0, &port->write_urbs_free)) |
2984 |
++ count = port->bulk_out_size - 1; |
2985 |
+ |
2986 |
+- count = kfifo_out_locked(&port->write_fifo, buf + 1, size - 1, |
2987 |
+- &port->lock); |
2988 |
+- return count + 1; |
2989 |
++ return count; |
2990 |
+ } |
2991 |
+ |
2992 |
+ static void ir_process_read_urb(struct urb *urb) |
2993 |
+@@ -332,34 +404,34 @@ static void ir_set_termios(struct tty_struct *tty, |
2994 |
+ |
2995 |
+ switch (baud) { |
2996 |
+ case 2400: |
2997 |
+- ir_baud = USB_IRDA_BR_2400; |
2998 |
++ ir_baud = USB_IRDA_LS_2400; |
2999 |
+ break; |
3000 |
+ case 9600: |
3001 |
+- ir_baud = USB_IRDA_BR_9600; |
3002 |
++ ir_baud = USB_IRDA_LS_9600; |
3003 |
+ break; |
3004 |
+ case 19200: |
3005 |
+- ir_baud = USB_IRDA_BR_19200; |
3006 |
++ ir_baud = USB_IRDA_LS_19200; |
3007 |
+ break; |
3008 |
+ case 38400: |
3009 |
+- ir_baud = USB_IRDA_BR_38400; |
3010 |
++ ir_baud = USB_IRDA_LS_38400; |
3011 |
+ break; |
3012 |
+ case 57600: |
3013 |
+- ir_baud = USB_IRDA_BR_57600; |
3014 |
++ ir_baud = USB_IRDA_LS_57600; |
3015 |
+ break; |
3016 |
+ case 115200: |
3017 |
+- ir_baud = USB_IRDA_BR_115200; |
3018 |
++ ir_baud = USB_IRDA_LS_115200; |
3019 |
+ break; |
3020 |
+ case 576000: |
3021 |
+- ir_baud = USB_IRDA_BR_576000; |
3022 |
++ ir_baud = USB_IRDA_LS_576000; |
3023 |
+ break; |
3024 |
+ case 1152000: |
3025 |
+- ir_baud = USB_IRDA_BR_1152000; |
3026 |
++ ir_baud = USB_IRDA_LS_1152000; |
3027 |
+ break; |
3028 |
+ case 4000000: |
3029 |
+- ir_baud = USB_IRDA_BR_4000000; |
3030 |
++ ir_baud = USB_IRDA_LS_4000000; |
3031 |
+ break; |
3032 |
+ default: |
3033 |
+- ir_baud = USB_IRDA_BR_9600; |
3034 |
++ ir_baud = USB_IRDA_LS_9600; |
3035 |
+ baud = 9600; |
3036 |
+ } |
3037 |
+ |
3038 |
+diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h |
3039 |
+index d0bdebd87ce3..1b23741036ee 100644 |
3040 |
+--- a/drivers/usb/storage/unusual_uas.h |
3041 |
++++ b/drivers/usb/storage/unusual_uas.h |
3042 |
+@@ -87,12 +87,15 @@ UNUSUAL_DEV(0x2537, 0x1068, 0x0000, 0x9999, |
3043 |
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
3044 |
+ US_FL_IGNORE_UAS), |
3045 |
+ |
3046 |
+-/* Reported-by: Takeo Nakayama <javhera@×××.com> */ |
3047 |
++/* |
3048 |
++ * Initially Reported-by: Takeo Nakayama <javhera@×××.com> |
3049 |
++ * UAS Ignore Reported by Steven Ellis <sellis@××××××.com> |
3050 |
++ */ |
3051 |
+ UNUSUAL_DEV(0x357d, 0x7788, 0x0000, 0x9999, |
3052 |
+ "JMicron", |
3053 |
+ "JMS566", |
3054 |
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
3055 |
+- US_FL_NO_REPORT_OPCODES), |
3056 |
++ US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS), |
3057 |
+ |
3058 |
+ /* Reported-by: Hans de Goede <hdegoede@××××××.com> */ |
3059 |
+ UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999, |
3060 |
+diff --git a/drivers/usb/typec/tcpm/fusb302.c b/drivers/usb/typec/tcpm/fusb302.c |
3061 |
+index ed8655c6af8c..b498960ff72b 100644 |
3062 |
+--- a/drivers/usb/typec/tcpm/fusb302.c |
3063 |
++++ b/drivers/usb/typec/tcpm/fusb302.c |
3064 |
+@@ -1666,7 +1666,7 @@ static const struct property_entry port_props[] = { |
3065 |
+ PROPERTY_ENTRY_STRING("try-power-role", "sink"), |
3066 |
+ PROPERTY_ENTRY_U32_ARRAY("source-pdos", src_pdo), |
3067 |
+ PROPERTY_ENTRY_U32_ARRAY("sink-pdos", snk_pdo), |
3068 |
+- PROPERTY_ENTRY_U32("op-sink-microwatt", 2500), |
3069 |
++ PROPERTY_ENTRY_U32("op-sink-microwatt", 2500000), |
3070 |
+ { } |
3071 |
+ }; |
3072 |
+ |
3073 |
+diff --git a/drivers/usb/typec/tcpm/wcove.c b/drivers/usb/typec/tcpm/wcove.c |
3074 |
+index edc271da14f4..9b745f432c91 100644 |
3075 |
+--- a/drivers/usb/typec/tcpm/wcove.c |
3076 |
++++ b/drivers/usb/typec/tcpm/wcove.c |
3077 |
+@@ -597,7 +597,7 @@ static const struct property_entry wcove_props[] = { |
3078 |
+ PROPERTY_ENTRY_STRING("try-power-role", "sink"), |
3079 |
+ PROPERTY_ENTRY_U32_ARRAY("source-pdos", src_pdo), |
3080 |
+ PROPERTY_ENTRY_U32_ARRAY("sink-pdos", snk_pdo), |
3081 |
+- PROPERTY_ENTRY_U32("op-sink-microwatt", 15000), |
3082 |
++ PROPERTY_ENTRY_U32("op-sink-microwatt", 15000000), |
3083 |
+ { } |
3084 |
+ }; |
3085 |
+ |
3086 |
+diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig |
3087 |
+index 4c761abc5688..e2745f686196 100644 |
3088 |
+--- a/drivers/watchdog/Kconfig |
3089 |
++++ b/drivers/watchdog/Kconfig |
3090 |
+@@ -687,6 +687,7 @@ config MAX63XX_WATCHDOG |
3091 |
+ config MAX77620_WATCHDOG |
3092 |
+ tristate "Maxim Max77620 Watchdog Timer" |
3093 |
+ depends on MFD_MAX77620 || COMPILE_TEST |
3094 |
++ select WATCHDOG_CORE |
3095 |
+ help |
3096 |
+ This is the driver for the Max77620 watchdog timer. |
3097 |
+ Say 'Y' here to enable the watchdog timer support for |
3098 |
+diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c |
3099 |
+index 1cccf8eb1c5d..8e6dfe76f9c9 100644 |
3100 |
+--- a/drivers/watchdog/orion_wdt.c |
3101 |
++++ b/drivers/watchdog/orion_wdt.c |
3102 |
+@@ -602,7 +602,7 @@ static int orion_wdt_probe(struct platform_device *pdev) |
3103 |
+ set_bit(WDOG_HW_RUNNING, &dev->wdt.status); |
3104 |
+ |
3105 |
+ /* Request the IRQ only after the watchdog is disabled */ |
3106 |
+- irq = platform_get_irq(pdev, 0); |
3107 |
++ irq = platform_get_irq_optional(pdev, 0); |
3108 |
+ if (irq > 0) { |
3109 |
+ /* |
3110 |
+ * Not all supported platforms specify an interrupt for the |
3111 |
+@@ -617,7 +617,7 @@ static int orion_wdt_probe(struct platform_device *pdev) |
3112 |
+ } |
3113 |
+ |
3114 |
+ /* Optional 2nd interrupt for pretimeout */ |
3115 |
+- irq = platform_get_irq(pdev, 1); |
3116 |
++ irq = platform_get_irq_optional(pdev, 1); |
3117 |
+ if (irq > 0) { |
3118 |
+ orion_wdt_info.options |= WDIOF_PRETIMEOUT; |
3119 |
+ ret = devm_request_irq(&pdev->dev, irq, orion_wdt_pre_irq, |
3120 |
+diff --git a/drivers/watchdog/rn5t618_wdt.c b/drivers/watchdog/rn5t618_wdt.c |
3121 |
+index 234876047431..6e524c8e26a8 100644 |
3122 |
+--- a/drivers/watchdog/rn5t618_wdt.c |
3123 |
++++ b/drivers/watchdog/rn5t618_wdt.c |
3124 |
+@@ -188,6 +188,7 @@ static struct platform_driver rn5t618_wdt_driver = { |
3125 |
+ |
3126 |
+ module_platform_driver(rn5t618_wdt_driver); |
3127 |
+ |
3128 |
++MODULE_ALIAS("platform:rn5t618-wdt"); |
3129 |
+ MODULE_AUTHOR("Beniamino Galvani <b.galvani@×××××.com>"); |
3130 |
+ MODULE_DESCRIPTION("RN5T618 watchdog driver"); |
3131 |
+ MODULE_LICENSE("GPL v2"); |
3132 |
+diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h |
3133 |
+index f55e53486e74..53611d7e9d28 100644 |
3134 |
+--- a/fs/cifs/cifsglob.h |
3135 |
++++ b/fs/cifs/cifsglob.h |
3136 |
+@@ -1538,6 +1538,7 @@ struct mid_q_entry { |
3137 |
+ mid_callback_t *callback; /* call completion callback */ |
3138 |
+ mid_handle_t *handle; /* call handle mid callback */ |
3139 |
+ void *callback_data; /* general purpose pointer for callback */ |
3140 |
++ struct task_struct *creator; |
3141 |
+ void *resp_buf; /* pointer to received SMB header */ |
3142 |
+ unsigned int resp_buf_size; |
3143 |
+ int mid_state; /* wish this were enum but can not pass to wait_event */ |
3144 |
+diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c |
3145 |
+index 766974fe637a..14265b4bbcc0 100644 |
3146 |
+--- a/fs/cifs/smb2misc.c |
3147 |
++++ b/fs/cifs/smb2misc.c |
3148 |
+@@ -750,7 +750,7 @@ __smb2_handle_cancelled_close(struct cifs_tcon *tcon, __u64 persistent_fid, |
3149 |
+ { |
3150 |
+ struct close_cancelled_open *cancelled; |
3151 |
+ |
3152 |
+- cancelled = kzalloc(sizeof(*cancelled), GFP_KERNEL); |
3153 |
++ cancelled = kzalloc(sizeof(*cancelled), GFP_ATOMIC); |
3154 |
+ if (!cancelled) |
3155 |
+ return -ENOMEM; |
3156 |
+ |
3157 |
+diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c |
3158 |
+index b5c1cba3e6a1..662256fa2a18 100644 |
3159 |
+--- a/fs/cifs/smb2ops.c |
3160 |
++++ b/fs/cifs/smb2ops.c |
3161 |
+@@ -1461,7 +1461,9 @@ smb2_ioctl_query_info(const unsigned int xid, |
3162 |
+ COMPOUND_FID, COMPOUND_FID, |
3163 |
+ qi.info_type, true, buffer, |
3164 |
+ qi.output_buffer_length, |
3165 |
+- CIFSMaxBufSize); |
3166 |
++ CIFSMaxBufSize - |
3167 |
++ MAX_SMB2_CREATE_RESPONSE_SIZE - |
3168 |
++ MAX_SMB2_CLOSE_RESPONSE_SIZE); |
3169 |
+ } |
3170 |
+ } else if (qi.flags == PASSTHRU_SET_INFO) { |
3171 |
+ /* Can eventually relax perm check since server enforces too */ |
3172 |
+@@ -2634,7 +2636,10 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, |
3173 |
+ |
3174 |
+ rc = SMB2_ioctl_init(tcon, &rqst[1], fid.persistent_fid, |
3175 |
+ fid.volatile_fid, FSCTL_GET_REPARSE_POINT, |
3176 |
+- true /* is_fctl */, NULL, 0, CIFSMaxBufSize); |
3177 |
++ true /* is_fctl */, NULL, 0, |
3178 |
++ CIFSMaxBufSize - |
3179 |
++ MAX_SMB2_CREATE_RESPONSE_SIZE - |
3180 |
++ MAX_SMB2_CLOSE_RESPONSE_SIZE); |
3181 |
+ if (rc) |
3182 |
+ goto querty_exit; |
3183 |
+ |
3184 |
+diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c |
3185 |
+index 148d7942c796..805652969065 100644 |
3186 |
+--- a/fs/cifs/smb2transport.c |
3187 |
++++ b/fs/cifs/smb2transport.c |
3188 |
+@@ -599,6 +599,8 @@ smb2_mid_entry_alloc(const struct smb2_sync_hdr *shdr, |
3189 |
+ * The default is for the mid to be synchronous, so the |
3190 |
+ * default callback just wakes up the current task. |
3191 |
+ */ |
3192 |
++ get_task_struct(current); |
3193 |
++ temp->creator = current; |
3194 |
+ temp->callback = cifs_wake_up_task; |
3195 |
+ temp->callback_data = current; |
3196 |
+ |
3197 |
+diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c |
3198 |
+index 755434d5e4e7..e67a43fd037c 100644 |
3199 |
+--- a/fs/cifs/transport.c |
3200 |
++++ b/fs/cifs/transport.c |
3201 |
+@@ -76,6 +76,8 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server) |
3202 |
+ * The default is for the mid to be synchronous, so the |
3203 |
+ * default callback just wakes up the current task. |
3204 |
+ */ |
3205 |
++ get_task_struct(current); |
3206 |
++ temp->creator = current; |
3207 |
+ temp->callback = cifs_wake_up_task; |
3208 |
+ temp->callback_data = current; |
3209 |
+ |
3210 |
+@@ -158,6 +160,7 @@ static void _cifs_mid_q_entry_release(struct kref *refcount) |
3211 |
+ } |
3212 |
+ } |
3213 |
+ #endif |
3214 |
++ put_task_struct(midEntry->creator); |
3215 |
+ |
3216 |
+ mempool_free(midEntry, cifs_mid_poolp); |
3217 |
+ } |
3218 |
+diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c |
3219 |
+index 87846aad594b..8fd45eb89424 100644 |
3220 |
+--- a/fs/debugfs/file.c |
3221 |
++++ b/fs/debugfs/file.c |
3222 |
+@@ -142,18 +142,21 @@ EXPORT_SYMBOL_GPL(debugfs_file_put); |
3223 |
+ * We also need to exclude any file that has ways to write or alter it as root |
3224 |
+ * can bypass the permissions check. |
3225 |
+ */ |
3226 |
+-static bool debugfs_is_locked_down(struct inode *inode, |
3227 |
+- struct file *filp, |
3228 |
+- const struct file_operations *real_fops) |
3229 |
++static int debugfs_locked_down(struct inode *inode, |
3230 |
++ struct file *filp, |
3231 |
++ const struct file_operations *real_fops) |
3232 |
+ { |
3233 |
+ if ((inode->i_mode & 07777) == 0444 && |
3234 |
+ !(filp->f_mode & FMODE_WRITE) && |
3235 |
+ !real_fops->unlocked_ioctl && |
3236 |
+ !real_fops->compat_ioctl && |
3237 |
+ !real_fops->mmap) |
3238 |
+- return false; |
3239 |
++ return 0; |
3240 |
+ |
3241 |
+- return security_locked_down(LOCKDOWN_DEBUGFS); |
3242 |
++ if (security_locked_down(LOCKDOWN_DEBUGFS)) |
3243 |
++ return -EPERM; |
3244 |
++ |
3245 |
++ return 0; |
3246 |
+ } |
3247 |
+ |
3248 |
+ static int open_proxy_open(struct inode *inode, struct file *filp) |
3249 |
+@@ -168,7 +171,7 @@ static int open_proxy_open(struct inode *inode, struct file *filp) |
3250 |
+ |
3251 |
+ real_fops = debugfs_real_fops(filp); |
3252 |
+ |
3253 |
+- r = debugfs_is_locked_down(inode, filp, real_fops); |
3254 |
++ r = debugfs_locked_down(inode, filp, real_fops); |
3255 |
+ if (r) |
3256 |
+ goto out; |
3257 |
+ |
3258 |
+@@ -298,7 +301,7 @@ static int full_proxy_open(struct inode *inode, struct file *filp) |
3259 |
+ |
3260 |
+ real_fops = debugfs_real_fops(filp); |
3261 |
+ |
3262 |
+- r = debugfs_is_locked_down(inode, filp, real_fops); |
3263 |
++ r = debugfs_locked_down(inode, filp, real_fops); |
3264 |
+ if (r) |
3265 |
+ goto out; |
3266 |
+ |
3267 |
+diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h |
3268 |
+index b5b7a3423ca8..8cfe570fdece 100644 |
3269 |
+--- a/include/linux/platform_data/ti-sysc.h |
3270 |
++++ b/include/linux/platform_data/ti-sysc.h |
3271 |
+@@ -49,6 +49,8 @@ struct sysc_regbits { |
3272 |
+ s8 emufree_shift; |
3273 |
+ }; |
3274 |
+ |
3275 |
++#define SYSC_QUIRK_FORCE_MSTANDBY BIT(20) |
3276 |
++#define SYSC_MODULE_QUIRK_AESS BIT(19) |
3277 |
+ #define SYSC_MODULE_QUIRK_SGX BIT(18) |
3278 |
+ #define SYSC_MODULE_QUIRK_HDQ1W BIT(17) |
3279 |
+ #define SYSC_MODULE_QUIRK_I2C BIT(16) |
3280 |
+diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h |
3281 |
+index d0b37e937037..971c9264179e 100644 |
3282 |
+--- a/include/linux/power/smartreflex.h |
3283 |
++++ b/include/linux/power/smartreflex.h |
3284 |
+@@ -293,6 +293,9 @@ struct omap_sr_data { |
3285 |
+ struct voltagedomain *voltdm; |
3286 |
+ }; |
3287 |
+ |
3288 |
++ |
3289 |
++extern struct omap_sr_data omap_sr_pdata[OMAP_SR_NR]; |
3290 |
++ |
3291 |
+ #ifdef CONFIG_POWER_AVS_OMAP |
3292 |
+ |
3293 |
+ /* Smartreflex module enable/disable interface */ |
3294 |
+diff --git a/include/linux/usb/irda.h b/include/linux/usb/irda.h |
3295 |
+index 396d2b043e64..556a801efce3 100644 |
3296 |
+--- a/include/linux/usb/irda.h |
3297 |
++++ b/include/linux/usb/irda.h |
3298 |
+@@ -119,11 +119,22 @@ struct usb_irda_cs_descriptor { |
3299 |
+ * 6 - 115200 bps |
3300 |
+ * 7 - 576000 bps |
3301 |
+ * 8 - 1.152 Mbps |
3302 |
+- * 9 - 5 mbps |
3303 |
++ * 9 - 4 Mbps |
3304 |
+ * 10..15 - Reserved |
3305 |
+ */ |
3306 |
+ #define USB_IRDA_STATUS_LINK_SPEED 0x0f |
3307 |
+ |
3308 |
++#define USB_IRDA_LS_NO_CHANGE 0 |
3309 |
++#define USB_IRDA_LS_2400 1 |
3310 |
++#define USB_IRDA_LS_9600 2 |
3311 |
++#define USB_IRDA_LS_19200 3 |
3312 |
++#define USB_IRDA_LS_38400 4 |
3313 |
++#define USB_IRDA_LS_57600 5 |
3314 |
++#define USB_IRDA_LS_115200 6 |
3315 |
++#define USB_IRDA_LS_576000 7 |
3316 |
++#define USB_IRDA_LS_1152000 8 |
3317 |
++#define USB_IRDA_LS_4000000 9 |
3318 |
++ |
3319 |
+ /* The following is a 4-bit value used only for |
3320 |
+ * outbound header: |
3321 |
+ * |
3322 |
+diff --git a/include/media/dvb-usb-ids.h b/include/media/dvb-usb-ids.h |
3323 |
+index 7ce4e8332421..1409230ad3a4 100644 |
3324 |
+--- a/include/media/dvb-usb-ids.h |
3325 |
++++ b/include/media/dvb-usb-ids.h |
3326 |
+@@ -389,6 +389,7 @@ |
3327 |
+ #define USB_PID_MYGICA_T230 0xc688 |
3328 |
+ #define USB_PID_MYGICA_T230C 0xc689 |
3329 |
+ #define USB_PID_MYGICA_T230C2 0xc68a |
3330 |
++#define USB_PID_MYGICA_T230C_LITE 0xc699 |
3331 |
+ #define USB_PID_ELGATO_EYETV_DIVERSITY 0x0011 |
3332 |
+ #define USB_PID_ELGATO_EYETV_DTT 0x0021 |
3333 |
+ #define USB_PID_ELGATO_EYETV_DTT_2 0x003f |
3334 |
+diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h |
3335 |
+index e553fc80eb23..9976ad2f54fd 100644 |
3336 |
+--- a/include/net/pkt_cls.h |
3337 |
++++ b/include/net/pkt_cls.h |
3338 |
+@@ -141,31 +141,38 @@ __cls_set_class(unsigned long *clp, unsigned long cl) |
3339 |
+ return xchg(clp, cl); |
3340 |
+ } |
3341 |
+ |
3342 |
+-static inline unsigned long |
3343 |
+-cls_set_class(struct Qdisc *q, unsigned long *clp, unsigned long cl) |
3344 |
++static inline void |
3345 |
++__tcf_bind_filter(struct Qdisc *q, struct tcf_result *r, unsigned long base) |
3346 |
+ { |
3347 |
+- unsigned long old_cl; |
3348 |
++ unsigned long cl; |
3349 |
+ |
3350 |
+- sch_tree_lock(q); |
3351 |
+- old_cl = __cls_set_class(clp, cl); |
3352 |
+- sch_tree_unlock(q); |
3353 |
+- return old_cl; |
3354 |
++ cl = q->ops->cl_ops->bind_tcf(q, base, r->classid); |
3355 |
++ cl = __cls_set_class(&r->class, cl); |
3356 |
++ if (cl) |
3357 |
++ q->ops->cl_ops->unbind_tcf(q, cl); |
3358 |
+ } |
3359 |
+ |
3360 |
+ static inline void |
3361 |
+ tcf_bind_filter(struct tcf_proto *tp, struct tcf_result *r, unsigned long base) |
3362 |
+ { |
3363 |
+ struct Qdisc *q = tp->chain->block->q; |
3364 |
+- unsigned long cl; |
3365 |
+ |
3366 |
+ /* Check q as it is not set for shared blocks. In that case, |
3367 |
+ * setting class is not supported. |
3368 |
+ */ |
3369 |
+ if (!q) |
3370 |
+ return; |
3371 |
+- cl = q->ops->cl_ops->bind_tcf(q, base, r->classid); |
3372 |
+- cl = cls_set_class(q, &r->class, cl); |
3373 |
+- if (cl) |
3374 |
++ sch_tree_lock(q); |
3375 |
++ __tcf_bind_filter(q, r, base); |
3376 |
++ sch_tree_unlock(q); |
3377 |
++} |
3378 |
++ |
3379 |
++static inline void |
3380 |
++__tcf_unbind_filter(struct Qdisc *q, struct tcf_result *r) |
3381 |
++{ |
3382 |
++ unsigned long cl; |
3383 |
++ |
3384 |
++ if ((cl = __cls_set_class(&r->class, 0)) != 0) |
3385 |
+ q->ops->cl_ops->unbind_tcf(q, cl); |
3386 |
+ } |
3387 |
+ |
3388 |
+@@ -173,12 +180,10 @@ static inline void |
3389 |
+ tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r) |
3390 |
+ { |
3391 |
+ struct Qdisc *q = tp->chain->block->q; |
3392 |
+- unsigned long cl; |
3393 |
+ |
3394 |
+ if (!q) |
3395 |
+ return; |
3396 |
+- if ((cl = __cls_set_class(&r->class, 0)) != 0) |
3397 |
+- q->ops->cl_ops->unbind_tcf(q, cl); |
3398 |
++ __tcf_unbind_filter(q, r); |
3399 |
+ } |
3400 |
+ |
3401 |
+ struct tcf_exts { |
3402 |
+diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h |
3403 |
+index 32e418dba133..d334e4609dd4 100644 |
3404 |
+--- a/include/net/sch_generic.h |
3405 |
++++ b/include/net/sch_generic.h |
3406 |
+@@ -318,7 +318,8 @@ struct tcf_proto_ops { |
3407 |
+ void *type_data); |
3408 |
+ void (*hw_del)(struct tcf_proto *tp, |
3409 |
+ void *type_data); |
3410 |
+- void (*bind_class)(void *, u32, unsigned long); |
3411 |
++ void (*bind_class)(void *, u32, unsigned long, |
3412 |
++ void *, unsigned long); |
3413 |
+ void * (*tmplt_create)(struct net *net, |
3414 |
+ struct tcf_chain *chain, |
3415 |
+ struct nlattr **tca, |
3416 |
+diff --git a/include/net/udp.h b/include/net/udp.h |
3417 |
+index bad74f780831..8f163d674f07 100644 |
3418 |
+--- a/include/net/udp.h |
3419 |
++++ b/include/net/udp.h |
3420 |
+@@ -476,6 +476,9 @@ static inline struct sk_buff *udp_rcv_segment(struct sock *sk, |
3421 |
+ if (!inet_get_convert_csum(sk)) |
3422 |
+ features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
3423 |
+ |
3424 |
++ if (skb->pkt_type == PACKET_LOOPBACK) |
3425 |
++ skb->ip_summed = CHECKSUM_PARTIAL; |
3426 |
++ |
3427 |
+ /* the GSO CB lays after the UDP one, no need to save and restore any |
3428 |
+ * CB fragment |
3429 |
+ */ |
3430 |
+diff --git a/init/Kconfig b/init/Kconfig |
3431 |
+index b4daad2bac23..0328b53d09ad 100644 |
3432 |
+--- a/init/Kconfig |
3433 |
++++ b/init/Kconfig |
3434 |
+@@ -54,6 +54,7 @@ config CC_DISABLE_WARN_MAYBE_UNINITIALIZED |
3435 |
+ |
3436 |
+ config CONSTRUCTORS |
3437 |
+ bool |
3438 |
++ depends on !UML |
3439 |
+ |
3440 |
+ config IRQ_WORK |
3441 |
+ bool |
3442 |
+diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig |
3443 |
+index 060e8e726755..3941a9c48f83 100644 |
3444 |
+--- a/kernel/gcov/Kconfig |
3445 |
++++ b/kernel/gcov/Kconfig |
3446 |
+@@ -4,7 +4,7 @@ menu "GCOV-based kernel profiling" |
3447 |
+ config GCOV_KERNEL |
3448 |
+ bool "Enable gcov-based kernel profiling" |
3449 |
+ depends on DEBUG_FS |
3450 |
+- select CONSTRUCTORS |
3451 |
++ select CONSTRUCTORS if !UML |
3452 |
+ default n |
3453 |
+ ---help--- |
3454 |
+ This option enables gcov-based code profiling (e.g. for code coverage |
3455 |
+diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c |
3456 |
+index 0cc9ce917222..9e19d5a3aac8 100644 |
3457 |
+--- a/net/bluetooth/hci_core.c |
3458 |
++++ b/net/bluetooth/hci_core.c |
3459 |
+@@ -1444,11 +1444,20 @@ static int hci_dev_do_open(struct hci_dev *hdev) |
3460 |
+ |
3461 |
+ if (hci_dev_test_flag(hdev, HCI_SETUP) || |
3462 |
+ test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) { |
3463 |
++ bool invalid_bdaddr; |
3464 |
++ |
3465 |
+ hci_sock_dev_event(hdev, HCI_DEV_SETUP); |
3466 |
+ |
3467 |
+ if (hdev->setup) |
3468 |
+ ret = hdev->setup(hdev); |
3469 |
+ |
3470 |
++ /* The transport driver can set the quirk to mark the |
3471 |
++ * BD_ADDR invalid before creating the HCI device or in |
3472 |
++ * its setup callback. |
3473 |
++ */ |
3474 |
++ invalid_bdaddr = test_bit(HCI_QUIRK_INVALID_BDADDR, |
3475 |
++ &hdev->quirks); |
3476 |
++ |
3477 |
+ if (ret) |
3478 |
+ goto setup_failed; |
3479 |
+ |
3480 |
+@@ -1457,20 +1466,33 @@ static int hci_dev_do_open(struct hci_dev *hdev) |
3481 |
+ hci_dev_get_bd_addr_from_property(hdev); |
3482 |
+ |
3483 |
+ if (bacmp(&hdev->public_addr, BDADDR_ANY) && |
3484 |
+- hdev->set_bdaddr) |
3485 |
++ hdev->set_bdaddr) { |
3486 |
+ ret = hdev->set_bdaddr(hdev, |
3487 |
+ &hdev->public_addr); |
3488 |
++ |
3489 |
++ /* If setting of the BD_ADDR from the device |
3490 |
++ * property succeeds, then treat the address |
3491 |
++ * as valid even if the invalid BD_ADDR |
3492 |
++ * quirk indicates otherwise. |
3493 |
++ */ |
3494 |
++ if (!ret) |
3495 |
++ invalid_bdaddr = false; |
3496 |
++ } |
3497 |
+ } |
3498 |
+ |
3499 |
+ setup_failed: |
3500 |
+ /* The transport driver can set these quirks before |
3501 |
+ * creating the HCI device or in its setup callback. |
3502 |
+ * |
3503 |
++ * For the invalid BD_ADDR quirk it is possible that |
3504 |
++ * it becomes a valid address if the bootloader does |
3505 |
++ * provide it (see above). |
3506 |
++ * |
3507 |
+ * In case any of them is set, the controller has to |
3508 |
+ * start up as unconfigured. |
3509 |
+ */ |
3510 |
+ if (test_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks) || |
3511 |
+- test_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks)) |
3512 |
++ invalid_bdaddr) |
3513 |
+ hci_dev_set_flag(hdev, HCI_UNCONFIGURED); |
3514 |
+ |
3515 |
+ /* For an unconfigured controller it is required to |
3516 |
+diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c |
3517 |
+index fc34fd1668d6..3737d32ad11a 100644 |
3518 |
+--- a/net/ipv4/nexthop.c |
3519 |
++++ b/net/ipv4/nexthop.c |
3520 |
+@@ -322,7 +322,9 @@ static size_t nh_nlmsg_size_single(struct nexthop *nh) |
3521 |
+ |
3522 |
+ static size_t nh_nlmsg_size(struct nexthop *nh) |
3523 |
+ { |
3524 |
+- size_t sz = nla_total_size(4); /* NHA_ID */ |
3525 |
++ size_t sz = NLMSG_ALIGN(sizeof(struct nhmsg)); |
3526 |
++ |
3527 |
++ sz += nla_total_size(4); /* NHA_ID */ |
3528 |
+ |
3529 |
+ if (nh->is_group) |
3530 |
+ sz += nh_nlmsg_size_grp(nh); |
3531 |
+diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c |
3532 |
+index 86bd133b4fa0..96d54e5bf7bc 100644 |
3533 |
+--- a/net/rxrpc/input.c |
3534 |
++++ b/net/rxrpc/input.c |
3535 |
+@@ -413,7 +413,7 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb) |
3536 |
+ { |
3537 |
+ struct rxrpc_skb_priv *sp = rxrpc_skb(skb); |
3538 |
+ enum rxrpc_call_state state; |
3539 |
+- unsigned int j; |
3540 |
++ unsigned int j, nr_subpackets; |
3541 |
+ rxrpc_serial_t serial = sp->hdr.serial, ack_serial = 0; |
3542 |
+ rxrpc_seq_t seq0 = sp->hdr.seq, hard_ack; |
3543 |
+ bool immediate_ack = false, jumbo_bad = false; |
3544 |
+@@ -457,7 +457,8 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb) |
3545 |
+ call->ackr_prev_seq = seq0; |
3546 |
+ hard_ack = READ_ONCE(call->rx_hard_ack); |
3547 |
+ |
3548 |
+- if (sp->nr_subpackets > 1) { |
3549 |
++ nr_subpackets = sp->nr_subpackets; |
3550 |
++ if (nr_subpackets > 1) { |
3551 |
+ if (call->nr_jumbo_bad > 3) { |
3552 |
+ ack = RXRPC_ACK_NOSPACE; |
3553 |
+ ack_serial = serial; |
3554 |
+@@ -465,11 +466,11 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb) |
3555 |
+ } |
3556 |
+ } |
3557 |
+ |
3558 |
+- for (j = 0; j < sp->nr_subpackets; j++) { |
3559 |
++ for (j = 0; j < nr_subpackets; j++) { |
3560 |
+ rxrpc_serial_t serial = sp->hdr.serial + j; |
3561 |
+ rxrpc_seq_t seq = seq0 + j; |
3562 |
+ unsigned int ix = seq & RXRPC_RXTX_BUFF_MASK; |
3563 |
+- bool terminal = (j == sp->nr_subpackets - 1); |
3564 |
++ bool terminal = (j == nr_subpackets - 1); |
3565 |
+ bool last = terminal && (sp->rx_flags & RXRPC_SKB_INCL_LAST); |
3566 |
+ u8 flags, annotation = j; |
3567 |
+ |
3568 |
+@@ -506,7 +507,7 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb) |
3569 |
+ } |
3570 |
+ |
3571 |
+ if (call->rxtx_buffer[ix]) { |
3572 |
+- rxrpc_input_dup_data(call, seq, sp->nr_subpackets > 1, |
3573 |
++ rxrpc_input_dup_data(call, seq, nr_subpackets > 1, |
3574 |
+ &jumbo_bad); |
3575 |
+ if (ack != RXRPC_ACK_DUPLICATE) { |
3576 |
+ ack = RXRPC_ACK_DUPLICATE; |
3577 |
+@@ -564,6 +565,7 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb) |
3578 |
+ * ring. |
3579 |
+ */ |
3580 |
+ skb = NULL; |
3581 |
++ sp = NULL; |
3582 |
+ } |
3583 |
+ |
3584 |
+ if (last) { |
3585 |
+diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c |
3586 |
+index 4aafbe3d435c..f256a7c69093 100644 |
3587 |
+--- a/net/sched/cls_basic.c |
3588 |
++++ b/net/sched/cls_basic.c |
3589 |
+@@ -263,12 +263,17 @@ skip: |
3590 |
+ } |
3591 |
+ } |
3592 |
+ |
3593 |
+-static void basic_bind_class(void *fh, u32 classid, unsigned long cl) |
3594 |
++static void basic_bind_class(void *fh, u32 classid, unsigned long cl, void *q, |
3595 |
++ unsigned long base) |
3596 |
+ { |
3597 |
+ struct basic_filter *f = fh; |
3598 |
+ |
3599 |
+- if (f && f->res.classid == classid) |
3600 |
+- f->res.class = cl; |
3601 |
++ if (f && f->res.classid == classid) { |
3602 |
++ if (cl) |
3603 |
++ __tcf_bind_filter(q, &f->res, base); |
3604 |
++ else |
3605 |
++ __tcf_unbind_filter(q, &f->res); |
3606 |
++ } |
3607 |
+ } |
3608 |
+ |
3609 |
+ static int basic_dump(struct net *net, struct tcf_proto *tp, void *fh, |
3610 |
+diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c |
3611 |
+index 8229ed4a67be..6e3e63db0e01 100644 |
3612 |
+--- a/net/sched/cls_bpf.c |
3613 |
++++ b/net/sched/cls_bpf.c |
3614 |
+@@ -631,12 +631,17 @@ nla_put_failure: |
3615 |
+ return -1; |
3616 |
+ } |
3617 |
+ |
3618 |
+-static void cls_bpf_bind_class(void *fh, u32 classid, unsigned long cl) |
3619 |
++static void cls_bpf_bind_class(void *fh, u32 classid, unsigned long cl, |
3620 |
++ void *q, unsigned long base) |
3621 |
+ { |
3622 |
+ struct cls_bpf_prog *prog = fh; |
3623 |
+ |
3624 |
+- if (prog && prog->res.classid == classid) |
3625 |
+- prog->res.class = cl; |
3626 |
++ if (prog && prog->res.classid == classid) { |
3627 |
++ if (cl) |
3628 |
++ __tcf_bind_filter(q, &prog->res, base); |
3629 |
++ else |
3630 |
++ __tcf_unbind_filter(q, &prog->res); |
3631 |
++ } |
3632 |
+ } |
3633 |
+ |
3634 |
+ static void cls_bpf_walk(struct tcf_proto *tp, struct tcf_walker *arg, |
3635 |
+diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c |
3636 |
+index 5cf8163710c8..7394e01c0c9c 100644 |
3637 |
+--- a/net/sched/cls_flower.c |
3638 |
++++ b/net/sched/cls_flower.c |
3639 |
+@@ -2511,12 +2511,17 @@ nla_put_failure: |
3640 |
+ return -EMSGSIZE; |
3641 |
+ } |
3642 |
+ |
3643 |
+-static void fl_bind_class(void *fh, u32 classid, unsigned long cl) |
3644 |
++static void fl_bind_class(void *fh, u32 classid, unsigned long cl, void *q, |
3645 |
++ unsigned long base) |
3646 |
+ { |
3647 |
+ struct cls_fl_filter *f = fh; |
3648 |
+ |
3649 |
+- if (f && f->res.classid == classid) |
3650 |
+- f->res.class = cl; |
3651 |
++ if (f && f->res.classid == classid) { |
3652 |
++ if (cl) |
3653 |
++ __tcf_bind_filter(q, &f->res, base); |
3654 |
++ else |
3655 |
++ __tcf_unbind_filter(q, &f->res); |
3656 |
++ } |
3657 |
+ } |
3658 |
+ |
3659 |
+ static bool fl_delete_empty(struct tcf_proto *tp) |
3660 |
+diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c |
3661 |
+index c9496c920d6f..ec945294626a 100644 |
3662 |
+--- a/net/sched/cls_fw.c |
3663 |
++++ b/net/sched/cls_fw.c |
3664 |
+@@ -419,12 +419,17 @@ nla_put_failure: |
3665 |
+ return -1; |
3666 |
+ } |
3667 |
+ |
3668 |
+-static void fw_bind_class(void *fh, u32 classid, unsigned long cl) |
3669 |
++static void fw_bind_class(void *fh, u32 classid, unsigned long cl, void *q, |
3670 |
++ unsigned long base) |
3671 |
+ { |
3672 |
+ struct fw_filter *f = fh; |
3673 |
+ |
3674 |
+- if (f && f->res.classid == classid) |
3675 |
+- f->res.class = cl; |
3676 |
++ if (f && f->res.classid == classid) { |
3677 |
++ if (cl) |
3678 |
++ __tcf_bind_filter(q, &f->res, base); |
3679 |
++ else |
3680 |
++ __tcf_unbind_filter(q, &f->res); |
3681 |
++ } |
3682 |
+ } |
3683 |
+ |
3684 |
+ static struct tcf_proto_ops cls_fw_ops __read_mostly = { |
3685 |
+diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c |
3686 |
+index 7fc2eb62aa98..039cc86974f4 100644 |
3687 |
+--- a/net/sched/cls_matchall.c |
3688 |
++++ b/net/sched/cls_matchall.c |
3689 |
+@@ -393,12 +393,17 @@ nla_put_failure: |
3690 |
+ return -1; |
3691 |
+ } |
3692 |
+ |
3693 |
+-static void mall_bind_class(void *fh, u32 classid, unsigned long cl) |
3694 |
++static void mall_bind_class(void *fh, u32 classid, unsigned long cl, void *q, |
3695 |
++ unsigned long base) |
3696 |
+ { |
3697 |
+ struct cls_mall_head *head = fh; |
3698 |
+ |
3699 |
+- if (head && head->res.classid == classid) |
3700 |
+- head->res.class = cl; |
3701 |
++ if (head && head->res.classid == classid) { |
3702 |
++ if (cl) |
3703 |
++ __tcf_bind_filter(q, &head->res, base); |
3704 |
++ else |
3705 |
++ __tcf_unbind_filter(q, &head->res); |
3706 |
++ } |
3707 |
+ } |
3708 |
+ |
3709 |
+ static struct tcf_proto_ops cls_mall_ops __read_mostly = { |
3710 |
+diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c |
3711 |
+index 2d9e0b4484ea..6f8786b06bde 100644 |
3712 |
+--- a/net/sched/cls_route.c |
3713 |
++++ b/net/sched/cls_route.c |
3714 |
+@@ -641,12 +641,17 @@ nla_put_failure: |
3715 |
+ return -1; |
3716 |
+ } |
3717 |
+ |
3718 |
+-static void route4_bind_class(void *fh, u32 classid, unsigned long cl) |
3719 |
++static void route4_bind_class(void *fh, u32 classid, unsigned long cl, void *q, |
3720 |
++ unsigned long base) |
3721 |
+ { |
3722 |
+ struct route4_filter *f = fh; |
3723 |
+ |
3724 |
+- if (f && f->res.classid == classid) |
3725 |
+- f->res.class = cl; |
3726 |
++ if (f && f->res.classid == classid) { |
3727 |
++ if (cl) |
3728 |
++ __tcf_bind_filter(q, &f->res, base); |
3729 |
++ else |
3730 |
++ __tcf_unbind_filter(q, &f->res); |
3731 |
++ } |
3732 |
+ } |
3733 |
+ |
3734 |
+ static struct tcf_proto_ops cls_route4_ops __read_mostly = { |
3735 |
+diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h |
3736 |
+index 2f3c03b25d5d..c22624131949 100644 |
3737 |
+--- a/net/sched/cls_rsvp.h |
3738 |
++++ b/net/sched/cls_rsvp.h |
3739 |
+@@ -738,12 +738,17 @@ nla_put_failure: |
3740 |
+ return -1; |
3741 |
+ } |
3742 |
+ |
3743 |
+-static void rsvp_bind_class(void *fh, u32 classid, unsigned long cl) |
3744 |
++static void rsvp_bind_class(void *fh, u32 classid, unsigned long cl, void *q, |
3745 |
++ unsigned long base) |
3746 |
+ { |
3747 |
+ struct rsvp_filter *f = fh; |
3748 |
+ |
3749 |
+- if (f && f->res.classid == classid) |
3750 |
+- f->res.class = cl; |
3751 |
++ if (f && f->res.classid == classid) { |
3752 |
++ if (cl) |
3753 |
++ __tcf_bind_filter(q, &f->res, base); |
3754 |
++ else |
3755 |
++ __tcf_unbind_filter(q, &f->res); |
3756 |
++ } |
3757 |
+ } |
3758 |
+ |
3759 |
+ static struct tcf_proto_ops RSVP_OPS __read_mostly = { |
3760 |
+diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c |
3761 |
+index e573e5a5c794..3d4a1280352f 100644 |
3762 |
+--- a/net/sched/cls_tcindex.c |
3763 |
++++ b/net/sched/cls_tcindex.c |
3764 |
+@@ -654,12 +654,17 @@ nla_put_failure: |
3765 |
+ return -1; |
3766 |
+ } |
3767 |
+ |
3768 |
+-static void tcindex_bind_class(void *fh, u32 classid, unsigned long cl) |
3769 |
++static void tcindex_bind_class(void *fh, u32 classid, unsigned long cl, |
3770 |
++ void *q, unsigned long base) |
3771 |
+ { |
3772 |
+ struct tcindex_filter_result *r = fh; |
3773 |
+ |
3774 |
+- if (r && r->res.classid == classid) |
3775 |
+- r->res.class = cl; |
3776 |
++ if (r && r->res.classid == classid) { |
3777 |
++ if (cl) |
3778 |
++ __tcf_bind_filter(q, &r->res, base); |
3779 |
++ else |
3780 |
++ __tcf_unbind_filter(q, &r->res); |
3781 |
++ } |
3782 |
+ } |
3783 |
+ |
3784 |
+ static struct tcf_proto_ops cls_tcindex_ops __read_mostly = { |
3785 |
+diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c |
3786 |
+index a0e6fac613de..e15ff335953d 100644 |
3787 |
+--- a/net/sched/cls_u32.c |
3788 |
++++ b/net/sched/cls_u32.c |
3789 |
+@@ -1255,12 +1255,17 @@ static int u32_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb, |
3790 |
+ return 0; |
3791 |
+ } |
3792 |
+ |
3793 |
+-static void u32_bind_class(void *fh, u32 classid, unsigned long cl) |
3794 |
++static void u32_bind_class(void *fh, u32 classid, unsigned long cl, void *q, |
3795 |
++ unsigned long base) |
3796 |
+ { |
3797 |
+ struct tc_u_knode *n = fh; |
3798 |
+ |
3799 |
+- if (n && n->res.classid == classid) |
3800 |
+- n->res.class = cl; |
3801 |
++ if (n && n->res.classid == classid) { |
3802 |
++ if (cl) |
3803 |
++ __tcf_bind_filter(q, &n->res, base); |
3804 |
++ else |
3805 |
++ __tcf_unbind_filter(q, &n->res); |
3806 |
++ } |
3807 |
+ } |
3808 |
+ |
3809 |
+ static int u32_dump(struct net *net, struct tcf_proto *tp, void *fh, |
3810 |
+diff --git a/net/sched/ematch.c b/net/sched/ematch.c |
3811 |
+index d0140a92694a..dd3b8c11a2e0 100644 |
3812 |
+--- a/net/sched/ematch.c |
3813 |
++++ b/net/sched/ematch.c |
3814 |
+@@ -238,6 +238,9 @@ static int tcf_em_validate(struct tcf_proto *tp, |
3815 |
+ goto errout; |
3816 |
+ |
3817 |
+ if (em->ops->change) { |
3818 |
++ err = -EINVAL; |
3819 |
++ if (em_hdr->flags & TCF_EM_SIMPLE) |
3820 |
++ goto errout; |
3821 |
+ err = em->ops->change(net, data, data_len, em); |
3822 |
+ if (err < 0) |
3823 |
+ goto errout; |
3824 |
+diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c |
3825 |
+index 1047825d9f48..50794125bf02 100644 |
3826 |
+--- a/net/sched/sch_api.c |
3827 |
++++ b/net/sched/sch_api.c |
3828 |
+@@ -1891,8 +1891,9 @@ static int tclass_del_notify(struct net *net, |
3829 |
+ |
3830 |
+ struct tcf_bind_args { |
3831 |
+ struct tcf_walker w; |
3832 |
+- u32 classid; |
3833 |
++ unsigned long base; |
3834 |
+ unsigned long cl; |
3835 |
++ u32 classid; |
3836 |
+ }; |
3837 |
+ |
3838 |
+ static int tcf_node_bind(struct tcf_proto *tp, void *n, struct tcf_walker *arg) |
3839 |
+@@ -1903,28 +1904,30 @@ static int tcf_node_bind(struct tcf_proto *tp, void *n, struct tcf_walker *arg) |
3840 |
+ struct Qdisc *q = tcf_block_q(tp->chain->block); |
3841 |
+ |
3842 |
+ sch_tree_lock(q); |
3843 |
+- tp->ops->bind_class(n, a->classid, a->cl); |
3844 |
++ tp->ops->bind_class(n, a->classid, a->cl, q, a->base); |
3845 |
+ sch_tree_unlock(q); |
3846 |
+ } |
3847 |
+ return 0; |
3848 |
+ } |
3849 |
+ |
3850 |
+-static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid, |
3851 |
+- unsigned long new_cl) |
3852 |
++struct tc_bind_class_args { |
3853 |
++ struct qdisc_walker w; |
3854 |
++ unsigned long new_cl; |
3855 |
++ u32 portid; |
3856 |
++ u32 clid; |
3857 |
++}; |
3858 |
++ |
3859 |
++static int tc_bind_class_walker(struct Qdisc *q, unsigned long cl, |
3860 |
++ struct qdisc_walker *w) |
3861 |
+ { |
3862 |
++ struct tc_bind_class_args *a = (struct tc_bind_class_args *)w; |
3863 |
+ const struct Qdisc_class_ops *cops = q->ops->cl_ops; |
3864 |
+ struct tcf_block *block; |
3865 |
+ struct tcf_chain *chain; |
3866 |
+- unsigned long cl; |
3867 |
+ |
3868 |
+- cl = cops->find(q, portid); |
3869 |
+- if (!cl) |
3870 |
+- return; |
3871 |
+- if (!cops->tcf_block) |
3872 |
+- return; |
3873 |
+ block = cops->tcf_block(q, cl, NULL); |
3874 |
+ if (!block) |
3875 |
+- return; |
3876 |
++ return 0; |
3877 |
+ for (chain = tcf_get_next_chain(block, NULL); |
3878 |
+ chain; |
3879 |
+ chain = tcf_get_next_chain(block, chain)) { |
3880 |
+@@ -1935,11 +1938,29 @@ static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid, |
3881 |
+ struct tcf_bind_args arg = {}; |
3882 |
+ |
3883 |
+ arg.w.fn = tcf_node_bind; |
3884 |
+- arg.classid = clid; |
3885 |
+- arg.cl = new_cl; |
3886 |
++ arg.classid = a->clid; |
3887 |
++ arg.base = cl; |
3888 |
++ arg.cl = a->new_cl; |
3889 |
+ tp->ops->walk(tp, &arg.w, true); |
3890 |
+ } |
3891 |
+ } |
3892 |
++ |
3893 |
++ return 0; |
3894 |
++} |
3895 |
++ |
3896 |
++static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid, |
3897 |
++ unsigned long new_cl) |
3898 |
++{ |
3899 |
++ const struct Qdisc_class_ops *cops = q->ops->cl_ops; |
3900 |
++ struct tc_bind_class_args args = {}; |
3901 |
++ |
3902 |
++ if (!cops->tcf_block) |
3903 |
++ return; |
3904 |
++ args.portid = portid; |
3905 |
++ args.clid = clid; |
3906 |
++ args.new_cl = new_cl; |
3907 |
++ args.w.fn = tc_bind_class_walker; |
3908 |
++ q->ops->cl_ops->walk(q, &args.w); |
3909 |
+ } |
3910 |
+ |
3911 |
+ #else |
3912 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
3913 |
+index d293488dc3dd..68832f52c1ad 100644 |
3914 |
+--- a/sound/pci/hda/patch_realtek.c |
3915 |
++++ b/sound/pci/hda/patch_realtek.c |
3916 |
+@@ -7563,20 +7563,6 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { |
3917 |
+ {0x19, 0x02a11020}, |
3918 |
+ {0x1a, 0x02a11030}, |
3919 |
+ {0x21, 0x0221101f}), |
3920 |
+- SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
3921 |
+- {0x12, 0x90a60140}, |
3922 |
+- {0x14, 0x90170110}, |
3923 |
+- {0x21, 0x02211020}), |
3924 |
+- SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
3925 |
+- {0x12, 0x90a60140}, |
3926 |
+- {0x14, 0x90170150}, |
3927 |
+- {0x21, 0x02211020}), |
3928 |
+- SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
3929 |
+- {0x21, 0x02211020}), |
3930 |
+- SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
3931 |
+- {0x12, 0x40000000}, |
3932 |
+- {0x14, 0x90170110}, |
3933 |
+- {0x21, 0x02211020}), |
3934 |
+ SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE, |
3935 |
+ {0x14, 0x90170110}, |
3936 |
+ {0x21, 0x02211020}), |
3937 |
+@@ -7901,6 +7887,9 @@ static const struct snd_hda_pin_quirk alc269_fallback_pin_fixup_tbl[] = { |
3938 |
+ SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
3939 |
+ {0x19, 0x40000000}, |
3940 |
+ {0x1a, 0x40000000}), |
3941 |
++ SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, |
3942 |
++ {0x19, 0x40000000}, |
3943 |
++ {0x1a, 0x40000000}), |
3944 |
+ {} |
3945 |
+ }; |
3946 |
+ |
3947 |
+diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl_audmix.c |
3948 |
+index a1db1bce330f..5faecbeb5497 100644 |
3949 |
+--- a/sound/soc/fsl/fsl_audmix.c |
3950 |
++++ b/sound/soc/fsl/fsl_audmix.c |
3951 |
+@@ -505,15 +505,20 @@ static int fsl_audmix_probe(struct platform_device *pdev) |
3952 |
+ ARRAY_SIZE(fsl_audmix_dai)); |
3953 |
+ if (ret) { |
3954 |
+ dev_err(dev, "failed to register ASoC DAI\n"); |
3955 |
+- return ret; |
3956 |
++ goto err_disable_pm; |
3957 |
+ } |
3958 |
+ |
3959 |
+ priv->pdev = platform_device_register_data(dev, mdrv, 0, NULL, 0); |
3960 |
+ if (IS_ERR(priv->pdev)) { |
3961 |
+ ret = PTR_ERR(priv->pdev); |
3962 |
+ dev_err(dev, "failed to register platform %s: %d\n", mdrv, ret); |
3963 |
++ goto err_disable_pm; |
3964 |
+ } |
3965 |
+ |
3966 |
++ return 0; |
3967 |
++ |
3968 |
++err_disable_pm: |
3969 |
++ pm_runtime_disable(dev); |
3970 |
+ return ret; |
3971 |
+ } |
3972 |
+ |
3973 |
+@@ -521,6 +526,8 @@ static int fsl_audmix_remove(struct platform_device *pdev) |
3974 |
+ { |
3975 |
+ struct fsl_audmix *priv = dev_get_drvdata(&pdev->dev); |
3976 |
+ |
3977 |
++ pm_runtime_disable(&pdev->dev); |
3978 |
++ |
3979 |
+ if (priv->pdev) |
3980 |
+ platform_device_unregister(priv->pdev); |
3981 |
+ |
3982 |
+diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c b/sound/soc/intel/boards/cht_bsw_rt5645.c |
3983 |
+index 8879c3be29d5..c68a5b85a4a0 100644 |
3984 |
+--- a/sound/soc/intel/boards/cht_bsw_rt5645.c |
3985 |
++++ b/sound/soc/intel/boards/cht_bsw_rt5645.c |
3986 |
+@@ -48,6 +48,7 @@ struct cht_mc_private { |
3987 |
+ #define CHT_RT5645_SSP2_AIF2 BIT(16) /* default is using AIF1 */ |
3988 |
+ #define CHT_RT5645_SSP0_AIF1 BIT(17) |
3989 |
+ #define CHT_RT5645_SSP0_AIF2 BIT(18) |
3990 |
++#define CHT_RT5645_PMC_PLT_CLK_0 BIT(19) |
3991 |
+ |
3992 |
+ static unsigned long cht_rt5645_quirk = 0; |
3993 |
+ |
3994 |
+@@ -59,6 +60,8 @@ static void log_quirks(struct device *dev) |
3995 |
+ dev_info(dev, "quirk SSP0_AIF1 enabled"); |
3996 |
+ if (cht_rt5645_quirk & CHT_RT5645_SSP0_AIF2) |
3997 |
+ dev_info(dev, "quirk SSP0_AIF2 enabled"); |
3998 |
++ if (cht_rt5645_quirk & CHT_RT5645_PMC_PLT_CLK_0) |
3999 |
++ dev_info(dev, "quirk PMC_PLT_CLK_0 enabled"); |
4000 |
+ } |
4001 |
+ |
4002 |
+ static int platform_clock_control(struct snd_soc_dapm_widget *w, |
4003 |
+@@ -226,15 +229,21 @@ static int cht_aif1_hw_params(struct snd_pcm_substream *substream, |
4004 |
+ return 0; |
4005 |
+ } |
4006 |
+ |
4007 |
+-/* uncomment when we have a real quirk |
4008 |
+ static int cht_rt5645_quirk_cb(const struct dmi_system_id *id) |
4009 |
+ { |
4010 |
+ cht_rt5645_quirk = (unsigned long)id->driver_data; |
4011 |
+ return 1; |
4012 |
+ } |
4013 |
+-*/ |
4014 |
+ |
4015 |
+ static const struct dmi_system_id cht_rt5645_quirk_table[] = { |
4016 |
++ { |
4017 |
++ /* Strago family Chromebooks */ |
4018 |
++ .callback = cht_rt5645_quirk_cb, |
4019 |
++ .matches = { |
4020 |
++ DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_Strago"), |
4021 |
++ }, |
4022 |
++ .driver_data = (void *)CHT_RT5645_PMC_PLT_CLK_0, |
4023 |
++ }, |
4024 |
+ { |
4025 |
+ }, |
4026 |
+ }; |
4027 |
+@@ -526,6 +535,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev) |
4028 |
+ int dai_index = 0; |
4029 |
+ int ret_val = 0; |
4030 |
+ int i; |
4031 |
++ const char *mclk_name; |
4032 |
+ |
4033 |
+ drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); |
4034 |
+ if (!drv) |
4035 |
+@@ -662,11 +672,15 @@ static int snd_cht_mc_probe(struct platform_device *pdev) |
4036 |
+ if (ret_val) |
4037 |
+ return ret_val; |
4038 |
+ |
4039 |
+- drv->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3"); |
4040 |
++ if (cht_rt5645_quirk & CHT_RT5645_PMC_PLT_CLK_0) |
4041 |
++ mclk_name = "pmc_plt_clk_0"; |
4042 |
++ else |
4043 |
++ mclk_name = "pmc_plt_clk_3"; |
4044 |
++ |
4045 |
++ drv->mclk = devm_clk_get(&pdev->dev, mclk_name); |
4046 |
+ if (IS_ERR(drv->mclk)) { |
4047 |
+- dev_err(&pdev->dev, |
4048 |
+- "Failed to get MCLK from pmc_plt_clk_3: %ld\n", |
4049 |
+- PTR_ERR(drv->mclk)); |
4050 |
++ dev_err(&pdev->dev, "Failed to get MCLK from %s: %ld\n", |
4051 |
++ mclk_name, PTR_ERR(drv->mclk)); |
4052 |
+ return PTR_ERR(drv->mclk); |
4053 |
+ } |
4054 |
+ |
4055 |
+diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c |
4056 |
+index fd2d22ddc81b..7ccbca47240d 100644 |
4057 |
+--- a/sound/soc/soc-topology.c |
4058 |
++++ b/sound/soc/soc-topology.c |
4059 |
+@@ -548,12 +548,12 @@ static void remove_link(struct snd_soc_component *comp, |
4060 |
+ if (dobj->ops && dobj->ops->link_unload) |
4061 |
+ dobj->ops->link_unload(comp, dobj); |
4062 |
+ |
4063 |
++ list_del(&dobj->list); |
4064 |
++ snd_soc_remove_dai_link(comp->card, link); |
4065 |
++ |
4066 |
+ kfree(link->name); |
4067 |
+ kfree(link->stream_name); |
4068 |
+ kfree(link->cpus->dai_name); |
4069 |
+- |
4070 |
+- list_del(&dobj->list); |
4071 |
+- snd_soc_remove_dai_link(comp->card, link); |
4072 |
+ kfree(link); |
4073 |
+ } |
4074 |
+ |
4075 |
+diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c |
4076 |
+index 8796f385be76..896d21984b73 100644 |
4077 |
+--- a/sound/soc/sof/intel/hda-dai.c |
4078 |
++++ b/sound/soc/sof/intel/hda-dai.c |
4079 |
+@@ -216,6 +216,8 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream, |
4080 |
+ link_dev = hda_link_stream_assign(bus, substream); |
4081 |
+ if (!link_dev) |
4082 |
+ return -EBUSY; |
4083 |
++ |
4084 |
++ snd_soc_dai_set_dma_data(dai, substream, (void *)link_dev); |
4085 |
+ } |
4086 |
+ |
4087 |
+ stream_tag = hdac_stream(link_dev)->stream_tag; |
4088 |
+@@ -228,8 +230,6 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream, |
4089 |
+ if (ret < 0) |
4090 |
+ return ret; |
4091 |
+ |
4092 |
+- snd_soc_dai_set_dma_data(dai, substream, (void *)link_dev); |
4093 |
+- |
4094 |
+ link = snd_hdac_ext_bus_get_link(bus, codec_dai->component->name); |
4095 |
+ if (!link) |
4096 |
+ return -EINVAL; |
4097 |
+@@ -361,6 +361,13 @@ static int hda_link_hw_free(struct snd_pcm_substream *substream, |
4098 |
+ bus = hstream->bus; |
4099 |
+ rtd = snd_pcm_substream_chip(substream); |
4100 |
+ link_dev = snd_soc_dai_get_dma_data(dai, substream); |
4101 |
++ |
4102 |
++ if (!link_dev) { |
4103 |
++ dev_dbg(dai->dev, |
4104 |
++ "%s: link_dev is not assigned\n", __func__); |
4105 |
++ return -EINVAL; |
4106 |
++ } |
4107 |
++ |
4108 |
+ hda_stream = hstream_to_sof_hda_stream(link_dev); |
4109 |
+ |
4110 |
+ /* free the link DMA channel in the FW */ |
4111 |
+diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c |
4112 |
+index 086eeeab8679..7b6d69783e16 100644 |
4113 |
+--- a/sound/soc/sof/ipc.c |
4114 |
++++ b/sound/soc/sof/ipc.c |
4115 |
+@@ -834,6 +834,9 @@ void snd_sof_ipc_free(struct snd_sof_dev *sdev) |
4116 |
+ { |
4117 |
+ struct snd_sof_ipc *ipc = sdev->ipc; |
4118 |
+ |
4119 |
++ if (!ipc) |
4120 |
++ return; |
4121 |
++ |
4122 |
+ /* disable sending of ipc's */ |
4123 |
+ mutex_lock(&ipc->tx_mutex); |
4124 |
+ ipc->disable_ipc_tx = true; |
4125 |
+diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h |
4126 |
+index 54a50699bbfd..9f77cbaac01c 100644 |
4127 |
+--- a/tools/testing/selftests/bpf/bpf_helpers.h |
4128 |
++++ b/tools/testing/selftests/bpf/bpf_helpers.h |
4129 |
+@@ -3,7 +3,7 @@ |
4130 |
+ #define __BPF_HELPERS__ |
4131 |
+ |
4132 |
+ #define __uint(name, val) int (*name)[val] |
4133 |
+-#define __type(name, val) val *name |
4134 |
++#define __type(name, val) typeof(val) *name |
4135 |
+ |
4136 |
+ /* helper macro to print out debug messages */ |
4137 |
+ #define bpf_printk(fmt, ...) \ |
4138 |
+diff --git a/tools/testing/selftests/bpf/progs/test_get_stack_rawtp.c b/tools/testing/selftests/bpf/progs/test_get_stack_rawtp.c |
4139 |
+index f8ffa3f3d44b..6cc4479ac9df 100644 |
4140 |
+--- a/tools/testing/selftests/bpf/progs/test_get_stack_rawtp.c |
4141 |
++++ b/tools/testing/selftests/bpf/progs/test_get_stack_rawtp.c |
4142 |
+@@ -47,12 +47,11 @@ struct { |
4143 |
+ * issue and avoid complicated C programming massaging. |
4144 |
+ * This is an acceptable workaround since there is one entry here. |
4145 |
+ */ |
4146 |
+-typedef __u64 raw_stack_trace_t[2 * MAX_STACK_RAWTP]; |
4147 |
+ struct { |
4148 |
+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY); |
4149 |
+ __uint(max_entries, 1); |
4150 |
+ __type(key, __u32); |
4151 |
+- __type(value, raw_stack_trace_t); |
4152 |
++ __type(value, __u64[2 * MAX_STACK_RAWTP]); |
4153 |
+ } rawdata_map SEC(".maps"); |
4154 |
+ |
4155 |
+ SEC("raw_tracepoint/sys_enter") |