Magellan Linux

Annotation of /trunk/kernel-alx/patches-5.4/0116-5.4.17-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


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