Magellan Linux

Annotation of /trunk/kernel-alx/patches-4.9/0161-4.9.62-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3046 - (hide annotations) (download)
Wed Dec 20 11:49:32 2017 UTC (6 years, 4 months ago) by niro
File size: 97221 byte(s)
-linux-4.9.62
1 niro 3046 diff --git a/Documentation/devicetree/bindings/arm/davinci.txt b/Documentation/devicetree/bindings/arm/davinci.txt
2     index f0841ce725b5..715622c36260 100644
3     --- a/Documentation/devicetree/bindings/arm/davinci.txt
4     +++ b/Documentation/devicetree/bindings/arm/davinci.txt
5     @@ -13,6 +13,10 @@ EnBW AM1808 based CMC board
6     Required root node properties:
7     - compatible = "enbw,cmc", "ti,da850;
8    
9     +LEGO MINDSTORMS EV3 (AM1808 based)
10     +Required root node properties:
11     + - compatible = "lego,ev3", "ti,da850";
12     +
13     Generic DaVinci Boards
14     ----------------------
15    
16     diff --git a/Documentation/devicetree/bindings/clock/qoriq-clock.txt b/Documentation/devicetree/bindings/clock/qoriq-clock.txt
17     index 16a3ec433119..1bd2c76396f4 100644
18     --- a/Documentation/devicetree/bindings/clock/qoriq-clock.txt
19     +++ b/Documentation/devicetree/bindings/clock/qoriq-clock.txt
20     @@ -31,6 +31,7 @@ Required properties:
21     * "fsl,t4240-clockgen"
22     * "fsl,b4420-clockgen"
23     * "fsl,b4860-clockgen"
24     + * "fsl,ls1012a-clockgen"
25     * "fsl,ls1021a-clockgen"
26     Chassis-version clock strings include:
27     * "fsl,qoriq-clockgen-1.0": for chassis 1.0 clocks
28     diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
29     index bceffffb7502..f949a22bcd74 100644
30     --- a/Documentation/devicetree/bindings/vendor-prefixes.txt
31     +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
32     @@ -154,6 +154,7 @@ kosagi Sutajio Ko-Usagi PTE Ltd.
33     kyo Kyocera Corporation
34     lacie LaCie
35     lantiq Lantiq Semiconductor
36     +lego LEGO Systems A/S
37     lenovo Lenovo Group Ltd.
38     lg LG Corporation
39     linux Linux-specific binding
40     diff --git a/Makefile b/Makefile
41     index b56b99e20b30..8ab48891d088 100644
42     --- a/Makefile
43     +++ b/Makefile
44     @@ -1,6 +1,6 @@
45     VERSION = 4
46     PATCHLEVEL = 9
47     -SUBLEVEL = 61
48     +SUBLEVEL = 62
49     EXTRAVERSION =
50     NAME = Roaring Lionus
51    
52     diff --git a/arch/arm/boot/dts/imx53-qsb-common.dtsi b/arch/arm/boot/dts/imx53-qsb-common.dtsi
53     index c05e7cfd0cbc..40b3e31935d0 100644
54     --- a/arch/arm/boot/dts/imx53-qsb-common.dtsi
55     +++ b/arch/arm/boot/dts/imx53-qsb-common.dtsi
56     @@ -215,16 +215,16 @@
57    
58     pinctrl_fec: fecgrp {
59     fsl,pins = <
60     - MX53_PAD_FEC_MDC__FEC_MDC 0x80000000
61     - MX53_PAD_FEC_MDIO__FEC_MDIO 0x80000000
62     - MX53_PAD_FEC_REF_CLK__FEC_TX_CLK 0x80000000
63     - MX53_PAD_FEC_RX_ER__FEC_RX_ER 0x80000000
64     - MX53_PAD_FEC_CRS_DV__FEC_RX_DV 0x80000000
65     - MX53_PAD_FEC_RXD1__FEC_RDATA_1 0x80000000
66     - MX53_PAD_FEC_RXD0__FEC_RDATA_0 0x80000000
67     - MX53_PAD_FEC_TX_EN__FEC_TX_EN 0x80000000
68     - MX53_PAD_FEC_TXD1__FEC_TDATA_1 0x80000000
69     - MX53_PAD_FEC_TXD0__FEC_TDATA_0 0x80000000
70     + MX53_PAD_FEC_MDC__FEC_MDC 0x4
71     + MX53_PAD_FEC_MDIO__FEC_MDIO 0x1fc
72     + MX53_PAD_FEC_REF_CLK__FEC_TX_CLK 0x180
73     + MX53_PAD_FEC_RX_ER__FEC_RX_ER 0x180
74     + MX53_PAD_FEC_CRS_DV__FEC_RX_DV 0x180
75     + MX53_PAD_FEC_RXD1__FEC_RDATA_1 0x180
76     + MX53_PAD_FEC_RXD0__FEC_RDATA_0 0x180
77     + MX53_PAD_FEC_TX_EN__FEC_TX_EN 0x4
78     + MX53_PAD_FEC_TXD1__FEC_TDATA_1 0x4
79     + MX53_PAD_FEC_TXD0__FEC_TDATA_0 0x4
80     >;
81     };
82    
83     diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi
84     index a3ef7341c051..4d329b2908be 100644
85     --- a/arch/arm/boot/dts/stih410.dtsi
86     +++ b/arch/arm/boot/dts/stih410.dtsi
87     @@ -131,7 +131,7 @@
88     <&clk_s_d2_quadfs 0>;
89    
90     assigned-clock-rates = <297000000>,
91     - <108000000>,
92     + <297000000>,
93     <0>,
94     <400000000>,
95     <400000000>;
96     diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
97     index 53e1a884a1ea..66d71963761d 100644
98     --- a/arch/arm/configs/omap2plus_defconfig
99     +++ b/arch/arm/configs/omap2plus_defconfig
100     @@ -216,6 +216,7 @@ CONFIG_SERIO=m
101     CONFIG_SERIAL_8250=y
102     CONFIG_SERIAL_8250_CONSOLE=y
103     CONFIG_SERIAL_8250_NR_UARTS=32
104     +CONFIG_SERIAL_8250_RUNTIME_UARTS=6
105     CONFIG_SERIAL_8250_EXTENDED=y
106     CONFIG_SERIAL_8250_MANY_PORTS=y
107     CONFIG_SERIAL_8250_SHARE_IRQ=y
108     diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
109     index 9688ec0c6ef4..1b304897aa12 100644
110     --- a/arch/arm/kernel/traps.c
111     +++ b/arch/arm/kernel/traps.c
112     @@ -152,30 +152,26 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
113     set_fs(fs);
114     }
115    
116     -static void dump_instr(const char *lvl, struct pt_regs *regs)
117     +static void __dump_instr(const char *lvl, struct pt_regs *regs)
118     {
119     unsigned long addr = instruction_pointer(regs);
120     const int thumb = thumb_mode(regs);
121     const int width = thumb ? 4 : 8;
122     - mm_segment_t fs;
123     char str[sizeof("00000000 ") * 5 + 2 + 1], *p = str;
124     int i;
125    
126     /*
127     - * We need to switch to kernel mode so that we can use __get_user
128     - * to safely read from kernel space. Note that we now dump the
129     - * code first, just in case the backtrace kills us.
130     + * Note that we now dump the code first, just in case the backtrace
131     + * kills us.
132     */
133     - fs = get_fs();
134     - set_fs(KERNEL_DS);
135    
136     for (i = -4; i < 1 + !!thumb; i++) {
137     unsigned int val, bad;
138    
139     if (thumb)
140     - bad = __get_user(val, &((u16 *)addr)[i]);
141     + bad = get_user(val, &((u16 *)addr)[i]);
142     else
143     - bad = __get_user(val, &((u32 *)addr)[i]);
144     + bad = get_user(val, &((u32 *)addr)[i]);
145    
146     if (!bad)
147     p += sprintf(p, i == 0 ? "(%0*x) " : "%0*x ",
148     @@ -186,8 +182,20 @@ static void dump_instr(const char *lvl, struct pt_regs *regs)
149     }
150     }
151     printk("%sCode: %s\n", lvl, str);
152     +}
153    
154     - set_fs(fs);
155     +static void dump_instr(const char *lvl, struct pt_regs *regs)
156     +{
157     + mm_segment_t fs;
158     +
159     + if (!user_mode(regs)) {
160     + fs = get_fs();
161     + set_fs(KERNEL_DS);
162     + __dump_instr(lvl, regs);
163     + set_fs(fs);
164     + } else {
165     + __dump_instr(lvl, regs);
166     + }
167     }
168    
169     #ifdef CONFIG_ARM_UNWIND
170     diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
171     index b5bf46ce873b..cab3574ab7d9 100644
172     --- a/arch/arm64/mm/dma-mapping.c
173     +++ b/arch/arm64/mm/dma-mapping.c
174     @@ -836,14 +836,21 @@ static bool do_iommu_attach(struct device *dev, const struct iommu_ops *ops,
175     * then the IOMMU core will have already configured a group for this
176     * device, and allocated the default domain for that group.
177     */
178     - if (!domain || iommu_dma_init_domain(domain, dma_base, size, dev)) {
179     - pr_warn("Failed to set up IOMMU for device %s; retaining platform DMA ops\n",
180     - dev_name(dev));
181     - return false;
182     + if (!domain)
183     + goto out_err;
184     +
185     + if (domain->type == IOMMU_DOMAIN_DMA) {
186     + if (iommu_dma_init_domain(domain, dma_base, size, dev))
187     + goto out_err;
188     +
189     + dev->archdata.dma_ops = &iommu_dma_ops;
190     }
191    
192     - dev->archdata.dma_ops = &iommu_dma_ops;
193     return true;
194     +out_err:
195     + pr_warn("Failed to set up IOMMU for device %s; retaining platform DMA ops\n",
196     + dev_name(dev));
197     + return false;
198     }
199    
200     static void queue_iommu_attach(struct device *dev, const struct iommu_ops *ops,
201     diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
202     index 58fca9ad5fcc..3446b6fb3acb 100644
203     --- a/arch/mips/ar7/platform.c
204     +++ b/arch/mips/ar7/platform.c
205     @@ -576,6 +576,7 @@ static int __init ar7_register_uarts(void)
206     uart_port.type = PORT_AR7;
207     uart_port.uartclk = clk_get_rate(bus_clk) / 2;
208     uart_port.iotype = UPIO_MEM32;
209     + uart_port.flags = UPF_FIXED_TYPE;
210     uart_port.regshift = 2;
211    
212     uart_port.line = 0;
213     @@ -654,6 +655,10 @@ static int __init ar7_register_devices(void)
214     u32 val;
215     int res;
216    
217     + res = ar7_gpio_init();
218     + if (res)
219     + pr_warn("unable to register gpios: %d\n", res);
220     +
221     res = ar7_register_uarts();
222     if (res)
223     pr_err("unable to setup uart(s): %d\n", res);
224     diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
225     index a23adc49d50f..36aabee9cba4 100644
226     --- a/arch/mips/ar7/prom.c
227     +++ b/arch/mips/ar7/prom.c
228     @@ -246,8 +246,6 @@ void __init prom_init(void)
229     ar7_init_cmdline(fw_arg0, (char **)fw_arg1);
230     ar7_init_env((struct env_var *)fw_arg2);
231     console_config();
232     -
233     - ar7_gpio_init();
234     }
235    
236     #define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4)))
237     diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h
238     index 2e4180797b21..b6845db453a3 100644
239     --- a/arch/mips/include/asm/mips-cm.h
240     +++ b/arch/mips/include/asm/mips-cm.h
241     @@ -239,8 +239,8 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80)
242     #define CM_GCR_BASE_GCRBASE_MSK (_ULCAST_(0x1ffff) << 15)
243     #define CM_GCR_BASE_CMDEFTGT_SHF 0
244     #define CM_GCR_BASE_CMDEFTGT_MSK (_ULCAST_(0x3) << 0)
245     -#define CM_GCR_BASE_CMDEFTGT_DISABLED 0
246     -#define CM_GCR_BASE_CMDEFTGT_MEM 1
247     +#define CM_GCR_BASE_CMDEFTGT_MEM 0
248     +#define CM_GCR_BASE_CMDEFTGT_RESERVED 1
249     #define CM_GCR_BASE_CMDEFTGT_IOCU0 2
250     #define CM_GCR_BASE_CMDEFTGT_IOCU1 3
251    
252     diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
253     index 1b50958a1373..c558bce989cd 100644
254     --- a/arch/mips/kernel/process.c
255     +++ b/arch/mips/kernel/process.c
256     @@ -50,9 +50,7 @@
257     #ifdef CONFIG_HOTPLUG_CPU
258     void arch_cpu_idle_dead(void)
259     {
260     - /* What the heck is this check doing ? */
261     - if (!cpumask_test_cpu(smp_processor_id(), &cpu_callin_map))
262     - play_dead();
263     + play_dead();
264     }
265     #endif
266    
267     diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c
268     index 6d0f1321e084..47c9646f93b3 100644
269     --- a/arch/mips/kernel/smp-bmips.c
270     +++ b/arch/mips/kernel/smp-bmips.c
271     @@ -587,11 +587,11 @@ void __init bmips_cpu_setup(void)
272    
273     /* Flush and enable RAC */
274     cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
275     - __raw_writel(cfg | 0x100, BMIPS_RAC_CONFIG);
276     + __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
277     __raw_readl(cbr + BMIPS_RAC_CONFIG);
278    
279     cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG);
280     - __raw_writel(cfg | 0xf, BMIPS_RAC_CONFIG);
281     + __raw_writel(cfg | 0xf, cbr + BMIPS_RAC_CONFIG);
282     __raw_readl(cbr + BMIPS_RAC_CONFIG);
283    
284     cfg = __raw_readl(cbr + BMIPS_RAC_ADDRESS_RANGE);
285     diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
286     index 7ebb1918e2ac..95ba4271af6a 100644
287     --- a/arch/mips/kernel/smp.c
288     +++ b/arch/mips/kernel/smp.c
289     @@ -68,6 +68,9 @@ EXPORT_SYMBOL(cpu_sibling_map);
290     cpumask_t cpu_core_map[NR_CPUS] __read_mostly;
291     EXPORT_SYMBOL(cpu_core_map);
292    
293     +static DECLARE_COMPLETION(cpu_starting);
294     +static DECLARE_COMPLETION(cpu_running);
295     +
296     /*
297     * A logcal cpu mask containing only one VPE per core to
298     * reduce the number of IPIs on large MT systems.
299     @@ -369,9 +372,12 @@ asmlinkage void start_secondary(void)
300     cpumask_set_cpu(cpu, &cpu_coherent_mask);
301     notify_cpu_starting(cpu);
302    
303     - cpumask_set_cpu(cpu, &cpu_callin_map);
304     + /* Notify boot CPU that we're starting & ready to sync counters */
305     + complete(&cpu_starting);
306     +
307     synchronise_count_slave(cpu);
308    
309     + /* The CPU is running and counters synchronised, now mark it online */
310     set_cpu_online(cpu, true);
311    
312     set_cpu_sibling_map(cpu);
313     @@ -379,6 +385,12 @@ asmlinkage void start_secondary(void)
314    
315     calculate_cpu_foreign_map();
316    
317     + /*
318     + * Notify boot CPU that we're up & online and it can safely return
319     + * from __cpu_up
320     + */
321     + complete(&cpu_running);
322     +
323     /*
324     * irq will be enabled in ->smp_finish(), enabling it too early
325     * is dangerous.
326     @@ -430,22 +442,23 @@ void smp_prepare_boot_cpu(void)
327     {
328     set_cpu_possible(0, true);
329     set_cpu_online(0, true);
330     - cpumask_set_cpu(0, &cpu_callin_map);
331     }
332    
333     int __cpu_up(unsigned int cpu, struct task_struct *tidle)
334     {
335     mp_ops->boot_secondary(cpu, tidle);
336    
337     - /*
338     - * Trust is futile. We should really have timeouts ...
339     - */
340     - while (!cpumask_test_cpu(cpu, &cpu_callin_map)) {
341     - udelay(100);
342     - schedule();
343     + /* Wait for CPU to start and be ready to sync counters */
344     + if (!wait_for_completion_timeout(&cpu_starting,
345     + msecs_to_jiffies(1000))) {
346     + pr_crit("CPU%u: failed to start\n", cpu);
347     + return -EIO;
348     }
349    
350     synchronise_count_master(cpu);
351     +
352     + /* Wait for CPU to finish startup & mark itself online before return */
353     + wait_for_completion(&cpu_running);
354     return 0;
355     }
356    
357     diff --git a/arch/mips/mm/uasm-micromips.c b/arch/mips/mm/uasm-micromips.c
358     index 277cf52d80e1..6c17cba7f383 100644
359     --- a/arch/mips/mm/uasm-micromips.c
360     +++ b/arch/mips/mm/uasm-micromips.c
361     @@ -80,7 +80,7 @@ static struct insn insn_table_MM[] = {
362     { insn_jr, M(mm_pool32a_op, 0, 0, 0, mm_jalr_op, mm_pool32axf_op), RS },
363     { insn_lb, M(mm_lb32_op, 0, 0, 0, 0, 0), RT | RS | SIMM },
364     { insn_ld, 0, 0 },
365     - { insn_lh, M(mm_lh32_op, 0, 0, 0, 0, 0), RS | RS | SIMM },
366     + { insn_lh, M(mm_lh32_op, 0, 0, 0, 0, 0), RT | RS | SIMM },
367     { insn_ll, M(mm_pool32c_op, 0, 0, (mm_ll_func << 1), 0, 0), RS | RT | SIMM },
368     { insn_lld, 0, 0 },
369     { insn_lui, M(mm_pool32i_op, mm_lui_op, 0, 0, 0, 0), RS | SIMM },
370     diff --git a/arch/powerpc/boot/dts/fsl/kmcoge4.dts b/arch/powerpc/boot/dts/fsl/kmcoge4.dts
371     index ae70a24094b0..e103c0f3f650 100644
372     --- a/arch/powerpc/boot/dts/fsl/kmcoge4.dts
373     +++ b/arch/powerpc/boot/dts/fsl/kmcoge4.dts
374     @@ -83,6 +83,10 @@
375     };
376     };
377    
378     + sdhc@114000 {
379     + status = "disabled";
380     + };
381     +
382     i2c@119000 {
383     status = "disabled";
384     };
385     diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
386     index bc3f7d0d7b79..f1d7e996e673 100644
387     --- a/arch/powerpc/kernel/time.c
388     +++ b/arch/powerpc/kernel/time.c
389     @@ -407,6 +407,7 @@ void arch_vtime_task_switch(struct task_struct *prev)
390     struct cpu_accounting_data *acct = get_accounting(current);
391    
392     acct->starttime = get_accounting(prev)->starttime;
393     + acct->startspurr = get_accounting(prev)->startspurr;
394     acct->system_time = 0;
395     acct->user_time = 0;
396     }
397     diff --git a/arch/powerpc/kvm/book3s_hv_rm_xics.c b/arch/powerpc/kvm/book3s_hv_rm_xics.c
398     index a0ea63ac2b52..a8e3498a853f 100644
399     --- a/arch/powerpc/kvm/book3s_hv_rm_xics.c
400     +++ b/arch/powerpc/kvm/book3s_hv_rm_xics.c
401     @@ -376,6 +376,7 @@ static void icp_rm_deliver_irq(struct kvmppc_xics *xics, struct kvmppc_icp *icp,
402     */
403     if (reject && reject != XICS_IPI) {
404     arch_spin_unlock(&ics->lock);
405     + icp->n_reject++;
406     new_irq = reject;
407     goto again;
408     }
409     @@ -707,10 +708,8 @@ int kvmppc_rm_h_eoi(struct kvm_vcpu *vcpu, unsigned long xirr)
410     state = &ics->irq_state[src];
411    
412     /* Still asserted, resend it */
413     - if (state->asserted) {
414     - icp->n_reject++;
415     + if (state->asserted)
416     icp_rm_deliver_irq(xics, icp, irq);
417     - }
418    
419     if (!hlist_empty(&vcpu->kvm->irq_ack_notifier_list)) {
420     icp->rm_action |= XICS_RM_NOTIFY_EOI;
421     diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
422     index 2374c5b46bbc..0c196861bc38 100644
423     --- a/arch/s390/kernel/early.c
424     +++ b/arch/s390/kernel/early.c
425     @@ -363,6 +363,18 @@ static inline void save_vector_registers(void)
426     #endif
427     }
428    
429     +static int __init topology_setup(char *str)
430     +{
431     + bool enabled;
432     + int rc;
433     +
434     + rc = kstrtobool(str, &enabled);
435     + if (!rc && !enabled)
436     + S390_lowcore.machine_flags &= ~MACHINE_HAS_TOPOLOGY;
437     + return rc;
438     +}
439     +early_param("topology", topology_setup);
440     +
441     static int __init disable_vector_extension(char *str)
442     {
443     S390_lowcore.machine_flags &= ~MACHINE_FLAG_VX;
444     diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
445     index 8705ee66c087..239f29508f0b 100644
446     --- a/arch/s390/kernel/topology.c
447     +++ b/arch/s390/kernel/topology.c
448     @@ -37,7 +37,6 @@ static void set_topology_timer(void);
449     static void topology_work_fn(struct work_struct *work);
450     static struct sysinfo_15_1_x *tl_info;
451    
452     -static bool topology_enabled = true;
453     static DECLARE_WORK(topology_work, topology_work_fn);
454    
455     /*
456     @@ -56,7 +55,7 @@ static cpumask_t cpu_group_map(struct mask_info *info, unsigned int cpu)
457     cpumask_t mask;
458    
459     cpumask_copy(&mask, cpumask_of(cpu));
460     - if (!topology_enabled || !MACHINE_HAS_TOPOLOGY)
461     + if (!MACHINE_HAS_TOPOLOGY)
462     return mask;
463     for (; info; info = info->next) {
464     if (cpumask_test_cpu(cpu, &info->mask))
465     @@ -71,7 +70,7 @@ static cpumask_t cpu_thread_map(unsigned int cpu)
466     int i;
467    
468     cpumask_copy(&mask, cpumask_of(cpu));
469     - if (!topology_enabled || !MACHINE_HAS_TOPOLOGY)
470     + if (!MACHINE_HAS_TOPOLOGY)
471     return mask;
472     cpu -= cpu % (smp_cpu_mtid + 1);
473     for (i = 0; i <= smp_cpu_mtid; i++)
474     @@ -413,12 +412,6 @@ static const struct cpumask *cpu_drawer_mask(int cpu)
475     return &per_cpu(cpu_topology, cpu).drawer_mask;
476     }
477    
478     -static int __init early_parse_topology(char *p)
479     -{
480     - return kstrtobool(p, &topology_enabled);
481     -}
482     -early_param("topology", early_parse_topology);
483     -
484     static struct sched_domain_topology_level s390_topology[] = {
485     { cpu_thread_mask, cpu_smt_flags, SD_INIT_NAME(SMT) },
486     { cpu_coregroup_mask, cpu_core_flags, SD_INIT_NAME(MC) },
487     diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
488     index 538c10db3537..8dc315b212c2 100644
489     --- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c
490     +++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
491     @@ -165,7 +165,6 @@ static struct plat_sci_port scif2_platform_data = {
492     .scscr = SCSCR_TE | SCSCR_RE,
493     .type = PORT_IRDA,
494     .ops = &sh770x_sci_port_ops,
495     - .regshift = 1,
496     };
497    
498     static struct resource scif2_resources[] = {
499     diff --git a/arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S b/arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S
500     index 96df6a39d7e2..a2ae6891e1fc 100644
501     --- a/arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S
502     +++ b/arch/x86/crypto/sha1-mb/sha1_mb_mgr_flush_avx2.S
503     @@ -157,8 +157,8 @@ LABEL skip_ %I
504     .endr
505    
506     # Find min length
507     - vmovdqa _lens+0*16(state), %xmm0
508     - vmovdqa _lens+1*16(state), %xmm1
509     + vmovdqu _lens+0*16(state), %xmm0
510     + vmovdqu _lens+1*16(state), %xmm1
511    
512     vpminud %xmm1, %xmm0, %xmm2 # xmm2 has {D,C,B,A}
513     vpalignr $8, %xmm2, %xmm3, %xmm3 # xmm3 has {x,x,D,C}
514     @@ -178,8 +178,8 @@ LABEL skip_ %I
515     vpsubd %xmm2, %xmm0, %xmm0
516     vpsubd %xmm2, %xmm1, %xmm1
517    
518     - vmovdqa %xmm0, _lens+0*16(state)
519     - vmovdqa %xmm1, _lens+1*16(state)
520     + vmovdqu %xmm0, _lens+0*16(state)
521     + vmovdqu %xmm1, _lens+1*16(state)
522    
523     # "state" and "args" are the same address, arg1
524     # len is arg2
525     @@ -235,8 +235,8 @@ ENTRY(sha1_mb_mgr_get_comp_job_avx2)
526     jc .return_null
527    
528     # Find min length
529     - vmovdqa _lens(state), %xmm0
530     - vmovdqa _lens+1*16(state), %xmm1
531     + vmovdqu _lens(state), %xmm0
532     + vmovdqu _lens+1*16(state), %xmm1
533    
534     vpminud %xmm1, %xmm0, %xmm2 # xmm2 has {D,C,B,A}
535     vpalignr $8, %xmm2, %xmm3, %xmm3 # xmm3 has {x,x,D,C}
536     diff --git a/arch/x86/crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S b/arch/x86/crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S
537     index a78a0694ddef..ec9bee661d50 100644
538     --- a/arch/x86/crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S
539     +++ b/arch/x86/crypto/sha256-mb/sha256_mb_mgr_flush_avx2.S
540     @@ -155,8 +155,8 @@ LABEL skip_ %I
541     .endr
542    
543     # Find min length
544     - vmovdqa _lens+0*16(state), %xmm0
545     - vmovdqa _lens+1*16(state), %xmm1
546     + vmovdqu _lens+0*16(state), %xmm0
547     + vmovdqu _lens+1*16(state), %xmm1
548    
549     vpminud %xmm1, %xmm0, %xmm2 # xmm2 has {D,C,B,A}
550     vpalignr $8, %xmm2, %xmm3, %xmm3 # xmm3 has {x,x,D,C}
551     @@ -176,8 +176,8 @@ LABEL skip_ %I
552     vpsubd %xmm2, %xmm0, %xmm0
553     vpsubd %xmm2, %xmm1, %xmm1
554    
555     - vmovdqa %xmm0, _lens+0*16(state)
556     - vmovdqa %xmm1, _lens+1*16(state)
557     + vmovdqu %xmm0, _lens+0*16(state)
558     + vmovdqu %xmm1, _lens+1*16(state)
559    
560     # "state" and "args" are the same address, arg1
561     # len is arg2
562     @@ -234,8 +234,8 @@ ENTRY(sha256_mb_mgr_get_comp_job_avx2)
563     jc .return_null
564    
565     # Find min length
566     - vmovdqa _lens(state), %xmm0
567     - vmovdqa _lens+1*16(state), %xmm1
568     + vmovdqu _lens(state), %xmm0
569     + vmovdqu _lens+1*16(state), %xmm1
570    
571     vpminud %xmm1, %xmm0, %xmm2 # xmm2 has {D,C,B,A}
572     vpalignr $8, %xmm2, %xmm3, %xmm3 # xmm3 has {x,x,D,C}
573     diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
574     index a300aa10ebc5..dead0f3921f3 100644
575     --- a/arch/x86/include/asm/uaccess.h
576     +++ b/arch/x86/include/asm/uaccess.h
577     @@ -68,6 +68,12 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
578     __chk_range_not_ok((unsigned long __force)(addr), size, limit); \
579     })
580    
581     +#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
582     +# define WARN_ON_IN_IRQ() WARN_ON_ONCE(!in_task())
583     +#else
584     +# define WARN_ON_IN_IRQ()
585     +#endif
586     +
587     /**
588     * access_ok: - Checks if a user space pointer is valid
589     * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE. Note that
590     @@ -88,8 +94,11 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
591     * checks that the pointer is in the user space range - after calling
592     * this function, memory access functions may still return -EFAULT.
593     */
594     -#define access_ok(type, addr, size) \
595     - likely(!__range_not_ok(addr, size, user_addr_max()))
596     +#define access_ok(type, addr, size) \
597     +({ \
598     + WARN_ON_IN_IRQ(); \
599     + likely(!__range_not_ok(addr, size, user_addr_max())); \
600     +})
601    
602     /*
603     * These are the main single-value transfer routines. They automatically
604     diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
605     index 36171bcd91f8..9fe7b9e1ae30 100644
606     --- a/arch/x86/kernel/smpboot.c
607     +++ b/arch/x86/kernel/smpboot.c
608     @@ -180,6 +180,12 @@ static void smp_callin(void)
609     */
610     smp_store_cpu_info(cpuid);
611    
612     + /*
613     + * The topology information must be up to date before
614     + * calibrate_delay() and notify_cpu_starting().
615     + */
616     + set_cpu_sibling_map(raw_smp_processor_id());
617     +
618     /*
619     * Get our bogomips.
620     * Update loops_per_jiffy in cpu_data. Previous call to
621     @@ -190,11 +196,6 @@ static void smp_callin(void)
622     cpu_data(cpuid).loops_per_jiffy = loops_per_jiffy;
623     pr_debug("Stack at about %p\n", &cpuid);
624    
625     - /*
626     - * This must be done before setting cpu_online_mask
627     - * or calling notify_cpu_starting.
628     - */
629     - set_cpu_sibling_map(raw_smp_processor_id());
630     wmb();
631    
632     notify_cpu_starting(cpuid);
633     diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
634     index 6e57edf33d75..44bf5cf417d3 100644
635     --- a/arch/x86/kernel/tsc.c
636     +++ b/arch/x86/kernel/tsc.c
637     @@ -1382,12 +1382,10 @@ void __init tsc_init(void)
638     unsigned long calibrate_delay_is_known(void)
639     {
640     int sibling, cpu = smp_processor_id();
641     - struct cpumask *mask = topology_core_cpumask(cpu);
642     + int constant_tsc = cpu_has(&cpu_data(cpu), X86_FEATURE_CONSTANT_TSC);
643     + const struct cpumask *mask = topology_core_cpumask(cpu);
644    
645     - if (!tsc_disabled && !cpu_has(&cpu_data(cpu), X86_FEATURE_CONSTANT_TSC))
646     - return 0;
647     -
648     - if (!mask)
649     + if (tsc_disabled || !constant_tsc || !mask)
650     return 0;
651    
652     sibling = cpumask_any_but(mask, cpu);
653     diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
654     index 350f7096baac..7913b6921959 100644
655     --- a/arch/x86/oprofile/op_model_ppro.c
656     +++ b/arch/x86/oprofile/op_model_ppro.c
657     @@ -212,8 +212,8 @@ static void arch_perfmon_setup_counters(void)
658     eax.full = cpuid_eax(0xa);
659    
660     /* Workaround for BIOS bugs in 6/15. Taken from perfmon2 */
661     - if (eax.split.version_id == 0 && __this_cpu_read(cpu_info.x86) == 6 &&
662     - __this_cpu_read(cpu_info.x86_model) == 15) {
663     + if (eax.split.version_id == 0 && boot_cpu_data.x86 == 6 &&
664     + boot_cpu_data.x86_model == 15) {
665     eax.split.version_id = 2;
666     eax.split.num_counters = 2;
667     eax.split.bit_width = 40;
668     diff --git a/crypto/ccm.c b/crypto/ccm.c
669     index 006d8575ef5c..b3ace633fae9 100644
670     --- a/crypto/ccm.c
671     +++ b/crypto/ccm.c
672     @@ -413,7 +413,7 @@ static int crypto_ccm_decrypt(struct aead_request *req)
673     unsigned int cryptlen = req->cryptlen;
674     u8 *authtag = pctx->auth_tag;
675     u8 *odata = pctx->odata;
676     - u8 *iv = req->iv;
677     + u8 *iv = pctx->idata;
678     int err;
679    
680     cryptlen -= authsize;
681     @@ -429,6 +429,8 @@ static int crypto_ccm_decrypt(struct aead_request *req)
682     if (req->src != req->dst)
683     dst = pctx->dst;
684    
685     + memcpy(iv, req->iv, 16);
686     +
687     skcipher_request_set_tfm(skreq, ctx->ctr);
688     skcipher_request_set_callback(skreq, pctx->flags,
689     crypto_ccm_decrypt_done, req);
690     diff --git a/drivers/base/power/opp/of.c b/drivers/base/power/opp/of.c
691     index 5552211e6fcd..b52c617947ad 100644
692     --- a/drivers/base/power/opp/of.c
693     +++ b/drivers/base/power/opp/of.c
694     @@ -386,7 +386,7 @@ static int _of_add_opp_table_v1(struct device *dev)
695     {
696     const struct property *prop;
697     const __be32 *val;
698     - int nr;
699     + int nr, ret;
700    
701     prop = of_find_property(dev->of_node, "operating-points", NULL);
702     if (!prop)
703     @@ -409,9 +409,13 @@ static int _of_add_opp_table_v1(struct device *dev)
704     unsigned long freq = be32_to_cpup(val++) * 1000;
705     unsigned long volt = be32_to_cpup(val++);
706    
707     - if (_opp_add_v1(dev, freq, volt, false))
708     - dev_warn(dev, "%s: Failed to add OPP %ld\n",
709     - __func__, freq);
710     + ret = _opp_add_v1(dev, freq, volt, false);
711     + if (ret) {
712     + dev_err(dev, "%s: Failed to add OPP %ld (%d)\n",
713     + __func__, freq, ret);
714     + dev_pm_opp_of_remove_table(dev);
715     + return ret;
716     + }
717     nr -= 2;
718     }
719    
720     diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
721     index 7b274ff4632c..24f4b544d270 100644
722     --- a/drivers/block/rbd.c
723     +++ b/drivers/block/rbd.c
724     @@ -2788,7 +2788,7 @@ static int rbd_img_obj_parent_read_full(struct rbd_obj_request *obj_request)
725     * from the parent.
726     */
727     page_count = (u32)calc_pages_for(0, length);
728     - pages = ceph_alloc_page_vector(page_count, GFP_KERNEL);
729     + pages = ceph_alloc_page_vector(page_count, GFP_NOIO);
730     if (IS_ERR(pages)) {
731     result = PTR_ERR(pages);
732     pages = NULL;
733     @@ -2922,7 +2922,7 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
734     */
735     size = sizeof (__le64) + sizeof (__le32) + sizeof (__le32);
736     page_count = (u32)calc_pages_for(0, size);
737     - pages = ceph_alloc_page_vector(page_count, GFP_KERNEL);
738     + pages = ceph_alloc_page_vector(page_count, GFP_NOIO);
739     if (IS_ERR(pages)) {
740     ret = PTR_ERR(pages);
741     goto fail_stat_request;
742     diff --git a/drivers/clk/mvebu/ap806-system-controller.c b/drivers/clk/mvebu/ap806-system-controller.c
743     index 02023baf86c9..962e0c5f6f4d 100644
744     --- a/drivers/clk/mvebu/ap806-system-controller.c
745     +++ b/drivers/clk/mvebu/ap806-system-controller.c
746     @@ -55,21 +55,39 @@ static int ap806_syscon_clk_probe(struct platform_device *pdev)
747    
748     freq_mode = reg & AP806_SAR_CLKFREQ_MODE_MASK;
749     switch (freq_mode) {
750     - case 0x0 ... 0x5:
751     + case 0x0:
752     + case 0x1:
753     cpuclk_freq = 2000;
754     break;
755     - case 0x6 ... 0xB:
756     + case 0x6:
757     + case 0x7:
758     cpuclk_freq = 1800;
759     break;
760     - case 0xC ... 0x11:
761     + case 0x4:
762     + case 0xB:
763     + case 0xD:
764     cpuclk_freq = 1600;
765     break;
766     - case 0x12 ... 0x16:
767     + case 0x1a:
768     cpuclk_freq = 1400;
769     break;
770     - case 0x17 ... 0x19:
771     + case 0x14:
772     + case 0x17:
773     cpuclk_freq = 1300;
774     break;
775     + case 0x19:
776     + cpuclk_freq = 1200;
777     + break;
778     + case 0x13:
779     + case 0x1d:
780     + cpuclk_freq = 1000;
781     + break;
782     + case 0x1c:
783     + cpuclk_freq = 800;
784     + break;
785     + case 0x1b:
786     + cpuclk_freq = 600;
787     + break;
788     default:
789     dev_err(&pdev->dev, "invalid SAR value\n");
790     return -EINVAL;
791     diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c
792     index ea1608682d7f..2fe057326552 100644
793     --- a/drivers/clk/samsung/clk-exynos5433.c
794     +++ b/drivers/clk/samsung/clk-exynos5433.c
795     @@ -2559,8 +2559,10 @@ static const struct samsung_fixed_rate_clock disp_fixed_clks[] __initconst = {
796     FRATE(0, "phyclk_mipidphy1_bitclkdiv8_phy", NULL, 0, 188000000),
797     FRATE(0, "phyclk_mipidphy1_rxclkesc0_phy", NULL, 0, 100000000),
798     /* PHY clocks from MIPI_DPHY0 */
799     - FRATE(0, "phyclk_mipidphy0_bitclkdiv8_phy", NULL, 0, 188000000),
800     - FRATE(0, "phyclk_mipidphy0_rxclkesc0_phy", NULL, 0, 100000000),
801     + FRATE(CLK_PHYCLK_MIPIDPHY0_BITCLKDIV8_PHY, "phyclk_mipidphy0_bitclkdiv8_phy",
802     + NULL, 0, 188000000),
803     + FRATE(CLK_PHYCLK_MIPIDPHY0_RXCLKESC0_PHY, "phyclk_mipidphy0_rxclkesc0_phy",
804     + NULL, 0, 100000000),
805     /* PHY clocks from HDMI_PHY */
806     FRATE(CLK_PHYCLK_HDMIPHY_TMDS_CLKO_PHY, "phyclk_hdmiphy_tmds_clko_phy",
807     NULL, 0, 300000000),
808     diff --git a/drivers/crypto/vmx/aes_ctr.c b/drivers/crypto/vmx/aes_ctr.c
809     index 38ed10d761d0..7cf6d31c1123 100644
810     --- a/drivers/crypto/vmx/aes_ctr.c
811     +++ b/drivers/crypto/vmx/aes_ctr.c
812     @@ -80,11 +80,13 @@ static int p8_aes_ctr_setkey(struct crypto_tfm *tfm, const u8 *key,
813     int ret;
814     struct p8_aes_ctr_ctx *ctx = crypto_tfm_ctx(tfm);
815    
816     + preempt_disable();
817     pagefault_disable();
818     enable_kernel_vsx();
819     ret = aes_p8_set_encrypt_key(key, keylen * 8, &ctx->enc_key);
820     disable_kernel_vsx();
821     pagefault_enable();
822     + preempt_enable();
823    
824     ret += crypto_blkcipher_setkey(ctx->fallback, key, keylen);
825     return ret;
826     @@ -99,11 +101,13 @@ static void p8_aes_ctr_final(struct p8_aes_ctr_ctx *ctx,
827     u8 *dst = walk->dst.virt.addr;
828     unsigned int nbytes = walk->nbytes;
829    
830     + preempt_disable();
831     pagefault_disable();
832     enable_kernel_vsx();
833     aes_p8_encrypt(ctrblk, keystream, &ctx->enc_key);
834     disable_kernel_vsx();
835     pagefault_enable();
836     + preempt_enable();
837    
838     crypto_xor(keystream, src, nbytes);
839     memcpy(dst, keystream, nbytes);
840     @@ -132,6 +136,7 @@ static int p8_aes_ctr_crypt(struct blkcipher_desc *desc,
841     blkcipher_walk_init(&walk, dst, src, nbytes);
842     ret = blkcipher_walk_virt_block(desc, &walk, AES_BLOCK_SIZE);
843     while ((nbytes = walk.nbytes) >= AES_BLOCK_SIZE) {
844     + preempt_disable();
845     pagefault_disable();
846     enable_kernel_vsx();
847     aes_p8_ctr32_encrypt_blocks(walk.src.virt.addr,
848     @@ -143,6 +148,7 @@ static int p8_aes_ctr_crypt(struct blkcipher_desc *desc,
849     walk.iv);
850     disable_kernel_vsx();
851     pagefault_enable();
852     + preempt_enable();
853    
854     /* We need to update IV mostly for last bytes/round */
855     inc = (nbytes & AES_BLOCK_MASK) / AES_BLOCK_SIZE;
856     diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
857     index ee181c53626f..6e197c1c213d 100644
858     --- a/drivers/edac/amd64_edac.c
859     +++ b/drivers/edac/amd64_edac.c
860     @@ -2984,8 +2984,11 @@ static int __init amd64_edac_init(void)
861     int err = -ENODEV;
862     int i;
863    
864     + if (!x86_match_cpu(amd64_cpuids))
865     + return -ENODEV;
866     +
867     if (amd_cache_northbridges() < 0)
868     - goto err_ret;
869     + return -ENODEV;
870    
871     opstate_init();
872    
873     @@ -2998,14 +3001,16 @@ static int __init amd64_edac_init(void)
874     if (!msrs)
875     goto err_free;
876    
877     - for (i = 0; i < amd_nb_num(); i++)
878     - if (probe_one_instance(i)) {
879     + for (i = 0; i < amd_nb_num(); i++) {
880     + err = probe_one_instance(i);
881     + if (err) {
882     /* unwind properly */
883     while (--i >= 0)
884     remove_one_instance(i);
885    
886     goto err_pci;
887     }
888     + }
889    
890     setup_pci_device();
891    
892     @@ -3025,7 +3030,6 @@ static int __init amd64_edac_init(void)
893     kfree(ecc_stngs);
894     ecc_stngs = NULL;
895    
896     -err_ret:
897     return err;
898     }
899    
900     diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
901     index c08870479054..dcb5f9481735 100644
902     --- a/drivers/edac/amd64_edac.h
903     +++ b/drivers/edac/amd64_edac.h
904     @@ -16,6 +16,7 @@
905     #include <linux/slab.h>
906     #include <linux/mmzone.h>
907     #include <linux/edac.h>
908     +#include <asm/cpu_device_id.h>
909     #include <asm/msr.h>
910     #include "edac_core.h"
911     #include "mce_amd.h"
912     diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
913     index afe0480d95c9..8b009b549e45 100644
914     --- a/drivers/gpu/drm/arm/malidp_planes.c
915     +++ b/drivers/gpu/drm/arm/malidp_planes.c
916     @@ -182,7 +182,8 @@ static void malidp_de_plane_update(struct drm_plane *plane,
917    
918     /* setup the rotation and axis flip bits */
919     if (plane->state->rotation & DRM_ROTATE_MASK)
920     - val = ilog2(plane->state->rotation & DRM_ROTATE_MASK) << LAYER_ROT_OFFSET;
921     + val |= ilog2(plane->state->rotation & DRM_ROTATE_MASK) <<
922     + LAYER_ROT_OFFSET;
923     if (plane->state->rotation & DRM_REFLECT_X)
924     val |= LAYER_H_FLIP;
925     if (plane->state->rotation & DRM_REFLECT_Y)
926     diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
927     index 213d892b6fa3..a68f94daf9b6 100644
928     --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
929     +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
930     @@ -325,7 +325,7 @@ static void adv7511_set_link_config(struct adv7511 *adv7511,
931     adv7511->rgb = config->input_colorspace == HDMI_COLORSPACE_RGB;
932     }
933    
934     -static void adv7511_power_on(struct adv7511 *adv7511)
935     +static void __adv7511_power_on(struct adv7511 *adv7511)
936     {
937     adv7511->current_edid_segment = -1;
938    
939     @@ -354,6 +354,11 @@ static void adv7511_power_on(struct adv7511 *adv7511)
940     regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER2,
941     ADV7511_REG_POWER2_HPD_SRC_MASK,
942     ADV7511_REG_POWER2_HPD_SRC_NONE);
943     +}
944     +
945     +static void adv7511_power_on(struct adv7511 *adv7511)
946     +{
947     + __adv7511_power_on(adv7511);
948    
949     /*
950     * Most of the registers are reset during power down or when HPD is low.
951     @@ -362,21 +367,23 @@ static void adv7511_power_on(struct adv7511 *adv7511)
952    
953     if (adv7511->type == ADV7533)
954     adv7533_dsi_power_on(adv7511);
955     -
956     adv7511->powered = true;
957     }
958    
959     -static void adv7511_power_off(struct adv7511 *adv7511)
960     +static void __adv7511_power_off(struct adv7511 *adv7511)
961     {
962     /* TODO: setup additional power down modes */
963     regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER,
964     ADV7511_POWER_POWER_DOWN,
965     ADV7511_POWER_POWER_DOWN);
966     regcache_mark_dirty(adv7511->regmap);
967     +}
968    
969     +static void adv7511_power_off(struct adv7511 *adv7511)
970     +{
971     + __adv7511_power_off(adv7511);
972     if (adv7511->type == ADV7533)
973     adv7533_dsi_power_off(adv7511);
974     -
975     adv7511->powered = false;
976     }
977    
978     @@ -567,23 +574,20 @@ static int adv7511_get_modes(struct adv7511 *adv7511,
979    
980     /* Reading the EDID only works if the device is powered */
981     if (!adv7511->powered) {
982     - regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER,
983     - ADV7511_POWER_POWER_DOWN, 0);
984     - if (adv7511->i2c_main->irq) {
985     - regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(0),
986     - ADV7511_INT0_EDID_READY);
987     - regmap_write(adv7511->regmap, ADV7511_REG_INT_ENABLE(1),
988     - ADV7511_INT1_DDC_ERROR);
989     - }
990     - adv7511->current_edid_segment = -1;
991     + unsigned int edid_i2c_addr =
992     + (adv7511->i2c_main->addr << 1) + 4;
993     +
994     + __adv7511_power_on(adv7511);
995     +
996     + /* Reset the EDID_I2C_ADDR register as it might be cleared */
997     + regmap_write(adv7511->regmap, ADV7511_REG_EDID_I2C_ADDR,
998     + edid_i2c_addr);
999     }
1000    
1001     edid = drm_do_get_edid(connector, adv7511_get_edid_block, adv7511);
1002    
1003     if (!adv7511->powered)
1004     - regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER,
1005     - ADV7511_POWER_POWER_DOWN,
1006     - ADV7511_POWER_POWER_DOWN);
1007     + __adv7511_power_off(adv7511);
1008    
1009     kfree(adv7511->edid);
1010     adv7511->edid = edid;
1011     diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
1012     index 362b8cd68a24..80a903bd317d 100644
1013     --- a/drivers/gpu/drm/drm_drv.c
1014     +++ b/drivers/gpu/drm/drm_drv.c
1015     @@ -218,7 +218,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
1016     ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root);
1017     if (ret) {
1018     DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
1019     - return ret;
1020     + goto err_debugfs;
1021     }
1022    
1023     ret = device_add(minor->kdev);
1024     diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
1025     index a19ec06f9e42..3ce9ba30d827 100644
1026     --- a/drivers/gpu/drm/i915/intel_drv.h
1027     +++ b/drivers/gpu/drm/i915/intel_drv.h
1028     @@ -457,7 +457,6 @@ struct intel_crtc_scaler_state {
1029    
1030     struct intel_pipe_wm {
1031     struct intel_wm_level wm[5];
1032     - struct intel_wm_level raw_wm[5];
1033     uint32_t linetime;
1034     bool fbc_wm_enabled;
1035     bool pipe_enabled;
1036     diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
1037     index 49de4760cc16..277a8026460b 100644
1038     --- a/drivers/gpu/drm/i915/intel_pm.c
1039     +++ b/drivers/gpu/drm/i915/intel_pm.c
1040     @@ -27,6 +27,7 @@
1041    
1042     #include <linux/cpufreq.h>
1043     #include <drm/drm_plane_helper.h>
1044     +#include <drm/drm_atomic_helper.h>
1045     #include "i915_drv.h"
1046     #include "intel_drv.h"
1047     #include "../../../platform/x86/intel_ips.h"
1048     @@ -2017,9 +2018,9 @@ static void ilk_compute_wm_level(const struct drm_i915_private *dev_priv,
1049     const struct intel_crtc *intel_crtc,
1050     int level,
1051     struct intel_crtc_state *cstate,
1052     - struct intel_plane_state *pristate,
1053     - struct intel_plane_state *sprstate,
1054     - struct intel_plane_state *curstate,
1055     + const struct intel_plane_state *pristate,
1056     + const struct intel_plane_state *sprstate,
1057     + const struct intel_plane_state *curstate,
1058     struct intel_wm_level *result)
1059     {
1060     uint16_t pri_latency = dev_priv->wm.pri_latency[level];
1061     @@ -2341,28 +2342,24 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *cstate)
1062     struct intel_pipe_wm *pipe_wm;
1063     struct drm_device *dev = state->dev;
1064     const struct drm_i915_private *dev_priv = to_i915(dev);
1065     - struct intel_plane *intel_plane;
1066     - struct intel_plane_state *pristate = NULL;
1067     - struct intel_plane_state *sprstate = NULL;
1068     - struct intel_plane_state *curstate = NULL;
1069     + struct drm_plane *plane;
1070     + const struct drm_plane_state *plane_state;
1071     + const struct intel_plane_state *pristate = NULL;
1072     + const struct intel_plane_state *sprstate = NULL;
1073     + const struct intel_plane_state *curstate = NULL;
1074     int level, max_level = ilk_wm_max_level(dev), usable_level;
1075     struct ilk_wm_maximums max;
1076    
1077     pipe_wm = &cstate->wm.ilk.optimal;
1078    
1079     - for_each_intel_plane_on_crtc(dev, intel_crtc, intel_plane) {
1080     - struct intel_plane_state *ps;
1081     + drm_atomic_crtc_state_for_each_plane_state(plane, plane_state, &cstate->base) {
1082     + const struct intel_plane_state *ps = to_intel_plane_state(plane_state);
1083    
1084     - ps = intel_atomic_get_existing_plane_state(state,
1085     - intel_plane);
1086     - if (!ps)
1087     - continue;
1088     -
1089     - if (intel_plane->base.type == DRM_PLANE_TYPE_PRIMARY)
1090     + if (plane->type == DRM_PLANE_TYPE_PRIMARY)
1091     pristate = ps;
1092     - else if (intel_plane->base.type == DRM_PLANE_TYPE_OVERLAY)
1093     + else if (plane->type == DRM_PLANE_TYPE_OVERLAY)
1094     sprstate = ps;
1095     - else if (intel_plane->base.type == DRM_PLANE_TYPE_CURSOR)
1096     + else if (plane->type == DRM_PLANE_TYPE_CURSOR)
1097     curstate = ps;
1098     }
1099    
1100     @@ -2384,11 +2381,9 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *cstate)
1101     if (pipe_wm->sprites_scaled)
1102     usable_level = 0;
1103    
1104     - ilk_compute_wm_level(dev_priv, intel_crtc, 0, cstate,
1105     - pristate, sprstate, curstate, &pipe_wm->raw_wm[0]);
1106     -
1107     memset(&pipe_wm->wm, 0, sizeof(pipe_wm->wm));
1108     - pipe_wm->wm[0] = pipe_wm->raw_wm[0];
1109     + ilk_compute_wm_level(dev_priv, intel_crtc, 0, cstate,
1110     + pristate, sprstate, curstate, &pipe_wm->wm[0]);
1111    
1112     if (IS_HASWELL(dev) || IS_BROADWELL(dev))
1113     pipe_wm->linetime = hsw_compute_linetime_wm(cstate);
1114     @@ -2398,8 +2393,8 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *cstate)
1115    
1116     ilk_compute_wm_reg_maximums(dev, 1, &max);
1117    
1118     - for (level = 1; level <= max_level; level++) {
1119     - struct intel_wm_level *wm = &pipe_wm->raw_wm[level];
1120     + for (level = 1; level <= usable_level; level++) {
1121     + struct intel_wm_level *wm = &pipe_wm->wm[level];
1122    
1123     ilk_compute_wm_level(dev_priv, intel_crtc, level, cstate,
1124     pristate, sprstate, curstate, wm);
1125     @@ -2409,13 +2404,10 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *cstate)
1126     * register maximums since such watermarks are
1127     * always invalid.
1128     */
1129     - if (level > usable_level)
1130     - continue;
1131     -
1132     - if (ilk_validate_wm_level(level, &max, wm))
1133     - pipe_wm->wm[level] = *wm;
1134     - else
1135     - usable_level = level;
1136     + if (!ilk_validate_wm_level(level, &max, wm)) {
1137     + memset(wm, 0, sizeof(*wm));
1138     + break;
1139     + }
1140     }
1141    
1142     return 0;
1143     diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
1144     index 36005bdf3749..29abd28c19b3 100644
1145     --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
1146     +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
1147     @@ -721,7 +721,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
1148     * allocation taken by fbdev
1149     */
1150     if (!(dev_priv->capabilities & SVGA_CAP_3D))
1151     - mem_size *= 2;
1152     + mem_size *= 3;
1153    
1154     dev_priv->max_mob_pages = mem_size * 1024 / PAGE_SIZE;
1155     dev_priv->prim_bb_mem =
1156     diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c
1157     index f2b3bd7bf862..b4f643fb3b1e 100644
1158     --- a/drivers/iio/magnetometer/mag3110.c
1159     +++ b/drivers/iio/magnetometer/mag3110.c
1160     @@ -222,29 +222,39 @@ static int mag3110_write_raw(struct iio_dev *indio_dev,
1161     int val, int val2, long mask)
1162     {
1163     struct mag3110_data *data = iio_priv(indio_dev);
1164     - int rate;
1165     + int rate, ret;
1166    
1167     - if (iio_buffer_enabled(indio_dev))
1168     - return -EBUSY;
1169     + ret = iio_device_claim_direct_mode(indio_dev);
1170     + if (ret)
1171     + return ret;
1172    
1173     switch (mask) {
1174     case IIO_CHAN_INFO_SAMP_FREQ:
1175     rate = mag3110_get_samp_freq_index(data, val, val2);
1176     - if (rate < 0)
1177     - return -EINVAL;
1178     + if (rate < 0) {
1179     + ret = -EINVAL;
1180     + break;
1181     + }
1182    
1183     data->ctrl_reg1 &= ~MAG3110_CTRL_DR_MASK;
1184     data->ctrl_reg1 |= rate << MAG3110_CTRL_DR_SHIFT;
1185     - return i2c_smbus_write_byte_data(data->client,
1186     + ret = i2c_smbus_write_byte_data(data->client,
1187     MAG3110_CTRL_REG1, data->ctrl_reg1);
1188     + break;
1189     case IIO_CHAN_INFO_CALIBBIAS:
1190     - if (val < -10000 || val > 10000)
1191     - return -EINVAL;
1192     - return i2c_smbus_write_word_swapped(data->client,
1193     + if (val < -10000 || val > 10000) {
1194     + ret = -EINVAL;
1195     + break;
1196     + }
1197     + ret = i2c_smbus_write_word_swapped(data->client,
1198     MAG3110_OFF_X + 2 * chan->scan_index, val << 1);
1199     + break;
1200     default:
1201     - return -EINVAL;
1202     + ret = -EINVAL;
1203     + break;
1204     }
1205     + iio_device_release_direct_mode(indio_dev);
1206     + return ret;
1207     }
1208    
1209     static irqreturn_t mag3110_trigger_handler(int irq, void *p)
1210     diff --git a/drivers/iio/pressure/ms5611_core.c b/drivers/iio/pressure/ms5611_core.c
1211     index a74ed1f0c880..8cc7156b5ace 100644
1212     --- a/drivers/iio/pressure/ms5611_core.c
1213     +++ b/drivers/iio/pressure/ms5611_core.c
1214     @@ -308,6 +308,7 @@ static int ms5611_write_raw(struct iio_dev *indio_dev,
1215     {
1216     struct ms5611_state *st = iio_priv(indio_dev);
1217     const struct ms5611_osr *osr = NULL;
1218     + int ret;
1219    
1220     if (mask != IIO_CHAN_INFO_OVERSAMPLING_RATIO)
1221     return -EINVAL;
1222     @@ -321,12 +322,11 @@ static int ms5611_write_raw(struct iio_dev *indio_dev,
1223     if (!osr)
1224     return -EINVAL;
1225    
1226     - mutex_lock(&st->lock);
1227     + ret = iio_device_claim_direct_mode(indio_dev);
1228     + if (ret)
1229     + return ret;
1230    
1231     - if (iio_buffer_enabled(indio_dev)) {
1232     - mutex_unlock(&st->lock);
1233     - return -EBUSY;
1234     - }
1235     + mutex_lock(&st->lock);
1236    
1237     if (chan->type == IIO_TEMP)
1238     st->temp_osr = osr;
1239     @@ -334,6 +334,8 @@ static int ms5611_write_raw(struct iio_dev *indio_dev,
1240     st->pressure_osr = osr;
1241    
1242     mutex_unlock(&st->lock);
1243     + iio_device_release_direct_mode(indio_dev);
1244     +
1245     return 0;
1246     }
1247    
1248     diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c
1249     index 1f06282ec793..9ea147f1a50d 100644
1250     --- a/drivers/iio/proximity/sx9500.c
1251     +++ b/drivers/iio/proximity/sx9500.c
1252     @@ -387,14 +387,18 @@ static int sx9500_read_raw(struct iio_dev *indio_dev,
1253     int *val, int *val2, long mask)
1254     {
1255     struct sx9500_data *data = iio_priv(indio_dev);
1256     + int ret;
1257    
1258     switch (chan->type) {
1259     case IIO_PROXIMITY:
1260     switch (mask) {
1261     case IIO_CHAN_INFO_RAW:
1262     - if (iio_buffer_enabled(indio_dev))
1263     - return -EBUSY;
1264     - return sx9500_read_proximity(data, chan, val);
1265     + ret = iio_device_claim_direct_mode(indio_dev);
1266     + if (ret)
1267     + return ret;
1268     + ret = sx9500_read_proximity(data, chan, val);
1269     + iio_device_release_direct_mode(indio_dev);
1270     + return ret;
1271     case IIO_CHAN_INFO_SAMP_FREQ:
1272     return sx9500_read_samp_freq(data, val, val2);
1273     default:
1274     diff --git a/drivers/iio/trigger/iio-trig-interrupt.c b/drivers/iio/trigger/iio-trig-interrupt.c
1275     index 572bc6f02ca8..e18f12b74610 100644
1276     --- a/drivers/iio/trigger/iio-trig-interrupt.c
1277     +++ b/drivers/iio/trigger/iio-trig-interrupt.c
1278     @@ -58,7 +58,7 @@ static int iio_interrupt_trigger_probe(struct platform_device *pdev)
1279     trig_info = kzalloc(sizeof(*trig_info), GFP_KERNEL);
1280     if (!trig_info) {
1281     ret = -ENOMEM;
1282     - goto error_put_trigger;
1283     + goto error_free_trigger;
1284     }
1285     iio_trigger_set_drvdata(trig, trig_info);
1286     trig_info->irq = irq;
1287     @@ -83,8 +83,8 @@ static int iio_interrupt_trigger_probe(struct platform_device *pdev)
1288     free_irq(irq, trig);
1289     error_free_trig_info:
1290     kfree(trig_info);
1291     -error_put_trigger:
1292     - iio_trigger_put(trig);
1293     +error_free_trigger:
1294     + iio_trigger_free(trig);
1295     error_ret:
1296     return ret;
1297     }
1298     @@ -99,7 +99,7 @@ static int iio_interrupt_trigger_remove(struct platform_device *pdev)
1299     iio_trigger_unregister(trig);
1300     free_irq(trig_info->irq, trig);
1301     kfree(trig_info);
1302     - iio_trigger_put(trig);
1303     + iio_trigger_free(trig);
1304    
1305     return 0;
1306     }
1307     diff --git a/drivers/iio/trigger/iio-trig-sysfs.c b/drivers/iio/trigger/iio-trig-sysfs.c
1308     index 3dfab2bc6d69..202e8b89caf2 100644
1309     --- a/drivers/iio/trigger/iio-trig-sysfs.c
1310     +++ b/drivers/iio/trigger/iio-trig-sysfs.c
1311     @@ -174,7 +174,7 @@ static int iio_sysfs_trigger_probe(int id)
1312     return 0;
1313    
1314     out2:
1315     - iio_trigger_put(t->trig);
1316     + iio_trigger_free(t->trig);
1317     free_t:
1318     kfree(t);
1319     out1:
1320     diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
1321     index 9f46be52335e..9d084780ac91 100644
1322     --- a/drivers/infiniband/sw/rxe/rxe_req.c
1323     +++ b/drivers/infiniband/sw/rxe/rxe_req.c
1324     @@ -633,6 +633,7 @@ int rxe_requester(void *arg)
1325     goto exit;
1326     }
1327     rmr->state = RXE_MEM_STATE_FREE;
1328     + rxe_drop_ref(rmr);
1329     wqe->state = wqe_state_done;
1330     wqe->status = IB_WC_SUCCESS;
1331     } else if (wqe->wr.opcode == IB_WR_REG_MR) {
1332     diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
1333     index 69ed4e0d7a0d..7705820cdac6 100644
1334     --- a/drivers/infiniband/sw/rxe/rxe_resp.c
1335     +++ b/drivers/infiniband/sw/rxe/rxe_resp.c
1336     @@ -893,6 +893,7 @@ static enum resp_states do_complete(struct rxe_qp *qp,
1337     return RESPST_ERROR;
1338     }
1339     rmr->state = RXE_MEM_STATE_FREE;
1340     + rxe_drop_ref(rmr);
1341     }
1342    
1343     wc->qp = &qp->ibqp;
1344     diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
1345     index 0616a65f0d78..75761667be59 100644
1346     --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
1347     +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
1348     @@ -1392,7 +1392,7 @@ static void ipoib_cm_tx_reap(struct work_struct *work)
1349    
1350     while (!list_empty(&priv->cm.reap_list)) {
1351     p = list_entry(priv->cm.reap_list.next, typeof(*p), list);
1352     - list_del(&p->list);
1353     + list_del_init(&p->list);
1354     spin_unlock_irqrestore(&priv->lock, flags);
1355     netif_tx_unlock_bh(dev);
1356     ipoib_cm_tx_destroy(p);
1357     diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c
1358     index 0fd612dd76ed..aaf43befffaa 100644
1359     --- a/drivers/input/keyboard/mpr121_touchkey.c
1360     +++ b/drivers/input/keyboard/mpr121_touchkey.c
1361     @@ -87,7 +87,8 @@ static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
1362     struct mpr121_touchkey *mpr121 = dev_id;
1363     struct i2c_client *client = mpr121->client;
1364     struct input_dev *input = mpr121->input_dev;
1365     - unsigned int key_num, key_val, pressed;
1366     + unsigned long bit_changed;
1367     + unsigned int key_num;
1368     int reg;
1369    
1370     reg = i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_1_ADDR);
1371     @@ -105,18 +106,22 @@ static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
1372    
1373     reg &= TOUCH_STATUS_MASK;
1374     /* use old press bit to figure out which bit changed */
1375     - key_num = ffs(reg ^ mpr121->statusbits) - 1;
1376     - pressed = reg & (1 << key_num);
1377     + bit_changed = reg ^ mpr121->statusbits;
1378     mpr121->statusbits = reg;
1379     + for_each_set_bit(key_num, &bit_changed, mpr121->keycount) {
1380     + unsigned int key_val, pressed;
1381    
1382     - key_val = mpr121->keycodes[key_num];
1383     + pressed = reg & BIT(key_num);
1384     + key_val = mpr121->keycodes[key_num];
1385    
1386     - input_event(input, EV_MSC, MSC_SCAN, key_num);
1387     - input_report_key(input, key_val, pressed);
1388     - input_sync(input);
1389     + input_event(input, EV_MSC, MSC_SCAN, key_num);
1390     + input_report_key(input, key_val, pressed);
1391     +
1392     + dev_dbg(&client->dev, "key %d %d %s\n", key_num, key_val,
1393     + pressed ? "pressed" : "released");
1394    
1395     - dev_dbg(&client->dev, "key %d %d %s\n", key_num, key_val,
1396     - pressed ? "pressed" : "released");
1397     + }
1398     + input_sync(input);
1399    
1400     out:
1401     return IRQ_HANDLED;
1402     @@ -231,6 +236,7 @@ static int mpr_touchkey_probe(struct i2c_client *client,
1403     input_dev->id.bustype = BUS_I2C;
1404     input_dev->dev.parent = &client->dev;
1405     input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
1406     + input_set_capability(input_dev, EV_MSC, MSC_SCAN);
1407    
1408     input_dev->keycode = mpr121->keycodes;
1409     input_dev->keycodesize = sizeof(mpr121->keycodes[0]);
1410     diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
1411     index b8c50d883b2c..c9d491bc85e0 100644
1412     --- a/drivers/input/mouse/elan_i2c_core.c
1413     +++ b/drivers/input/mouse/elan_i2c_core.c
1414     @@ -1240,6 +1240,7 @@ static const struct acpi_device_id elan_acpi_id[] = {
1415     { "ELAN0605", 0 },
1416     { "ELAN0609", 0 },
1417     { "ELAN060B", 0 },
1418     + { "ELAN060C", 0 },
1419     { "ELAN0611", 0 },
1420     { "ELAN1000", 0 },
1421     { }
1422     diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
1423     index e6f9b2d745ca..d3d975ae24b7 100644
1424     --- a/drivers/iommu/arm-smmu-v3.c
1425     +++ b/drivers/iommu/arm-smmu-v3.c
1426     @@ -1040,13 +1040,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_device *smmu, u32 sid,
1427     }
1428     }
1429    
1430     - /* Nuke the existing Config, as we're going to rewrite it */
1431     - val &= ~(STRTAB_STE_0_CFG_MASK << STRTAB_STE_0_CFG_SHIFT);
1432     -
1433     - if (ste->valid)
1434     - val |= STRTAB_STE_0_V;
1435     - else
1436     - val &= ~STRTAB_STE_0_V;
1437     + /* Nuke the existing STE_0 value, as we're going to rewrite it */
1438     + val = ste->valid ? STRTAB_STE_0_V : 0;
1439    
1440     if (ste->bypass) {
1441     val |= disable_bypass ? STRTAB_STE_0_CFG_ABORT
1442     @@ -1081,7 +1076,6 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_device *smmu, u32 sid,
1443     val |= (ste->s1_cfg->cdptr_dma & STRTAB_STE_0_S1CTXPTR_MASK
1444     << STRTAB_STE_0_S1CTXPTR_SHIFT) |
1445     STRTAB_STE_0_CFG_S1_TRANS;
1446     -
1447     }
1448    
1449     if (ste->s2_cfg) {
1450     diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
1451     index 4003831de712..7b1935ab03c8 100644
1452     --- a/drivers/media/i2c/adv7604.c
1453     +++ b/drivers/media/i2c/adv7604.c
1454     @@ -3118,6 +3118,9 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
1455     state->pdata.blank_data = 1;
1456     state->pdata.op_format_mode_sel = ADV7604_OP_FORMAT_MODE0;
1457     state->pdata.bus_order = ADV7604_BUS_ORDER_RGB;
1458     + state->pdata.dr_str_data = ADV76XX_DR_STR_MEDIUM_HIGH;
1459     + state->pdata.dr_str_clk = ADV76XX_DR_STR_MEDIUM_HIGH;
1460     + state->pdata.dr_str_sync = ADV76XX_DR_STR_MEDIUM_HIGH;
1461    
1462     return 0;
1463     }
1464     diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
1465     index fa4fe02cfef4..eef202d4399b 100644
1466     --- a/drivers/misc/cxl/pci.c
1467     +++ b/drivers/misc/cxl/pci.c
1468     @@ -1620,6 +1620,9 @@ static void cxl_pci_remove_adapter(struct cxl *adapter)
1469     cxl_sysfs_adapter_remove(adapter);
1470     cxl_debugfs_adapter_remove(adapter);
1471    
1472     + /* Flush adapter datacache as its about to be removed */
1473     + cxl_data_cache_flush(adapter);
1474     +
1475     cxl_deconfigure_adapter(adapter);
1476    
1477     device_unregister(&adapter->dev);
1478     diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
1479     index cf7c18947189..d065c0e2d18e 100644
1480     --- a/drivers/net/can/c_can/c_can_pci.c
1481     +++ b/drivers/net/can/c_can/c_can_pci.c
1482     @@ -178,7 +178,6 @@ static int c_can_pci_probe(struct pci_dev *pdev,
1483     break;
1484     case BOSCH_D_CAN:
1485     priv->regs = reg_map_d_can;
1486     - priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
1487     break;
1488     default:
1489     ret = -EINVAL;
1490     diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
1491     index e36d10520e24..717530eac70c 100644
1492     --- a/drivers/net/can/c_can/c_can_platform.c
1493     +++ b/drivers/net/can/c_can/c_can_platform.c
1494     @@ -320,7 +320,6 @@ static int c_can_plat_probe(struct platform_device *pdev)
1495     break;
1496     case BOSCH_D_CAN:
1497     priv->regs = reg_map_d_can;
1498     - priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
1499     priv->read_reg = c_can_plat_read_reg_aligned_to_16bit;
1500     priv->write_reg = c_can_plat_write_reg_aligned_to_16bit;
1501     priv->read_reg32 = d_can_plat_read_reg32;
1502     diff --git a/drivers/net/can/ifi_canfd/ifi_canfd.c b/drivers/net/can/ifi_canfd/ifi_canfd.c
1503     index 481895b2f9f4..c06ef438f23f 100644
1504     --- a/drivers/net/can/ifi_canfd/ifi_canfd.c
1505     +++ b/drivers/net/can/ifi_canfd/ifi_canfd.c
1506     @@ -670,9 +670,9 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev)
1507     priv->base + IFI_CANFD_FTIME);
1508    
1509     /* Configure transmitter delay */
1510     - tdc = (dbt->brp * (dbt->phase_seg1 + 1)) & IFI_CANFD_TDELAY_MASK;
1511     - writel(IFI_CANFD_TDELAY_EN | IFI_CANFD_TDELAY_ABS | tdc,
1512     - priv->base + IFI_CANFD_TDELAY);
1513     + tdc = dbt->brp * (dbt->prop_seg + dbt->phase_seg1);
1514     + tdc &= IFI_CANFD_TDELAY_MASK;
1515     + writel(IFI_CANFD_TDELAY_EN | tdc, priv->base + IFI_CANFD_TDELAY);
1516     }
1517    
1518     static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id,
1519     diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c
1520     index b0c80859f746..1ac2090a1721 100644
1521     --- a/drivers/net/can/sun4i_can.c
1522     +++ b/drivers/net/can/sun4i_can.c
1523     @@ -539,6 +539,13 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status)
1524     }
1525     stats->rx_over_errors++;
1526     stats->rx_errors++;
1527     +
1528     + /* reset the CAN IP by entering reset mode
1529     + * ignoring timeout error
1530     + */
1531     + set_reset_mode(dev);
1532     + set_normal_mode(dev);
1533     +
1534     /* clear bit */
1535     sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG);
1536     }
1537     @@ -653,8 +660,9 @@ static irqreturn_t sun4i_can_interrupt(int irq, void *dev_id)
1538     netif_wake_queue(dev);
1539     can_led_event(dev, CAN_LED_EVENT_TX);
1540     }
1541     - if (isrc & SUN4I_INT_RBUF_VLD) {
1542     - /* receive interrupt */
1543     + if ((isrc & SUN4I_INT_RBUF_VLD) &&
1544     + !(isrc & SUN4I_INT_DATA_OR)) {
1545     + /* receive interrupt - don't read if overrun occurred */
1546     while (status & SUN4I_STA_RBUF_RDY) {
1547     /* RX buffer is not empty */
1548     sun4i_can_rx(dev);
1549     diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
1550     index afbfc0f656f3..dc6d3b0a0be8 100644
1551     --- a/drivers/net/usb/cdc_ncm.c
1552     +++ b/drivers/net/usb/cdc_ncm.c
1553     @@ -769,8 +769,10 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
1554     u8 *buf;
1555     int len;
1556     int temp;
1557     + int err;
1558     u8 iface_no;
1559     struct usb_cdc_parsed_header hdr;
1560     + u16 curr_ntb_format;
1561    
1562     ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
1563     if (!ctx)
1564     @@ -875,6 +877,32 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
1565     goto error2;
1566     }
1567    
1568     + /*
1569     + * Some Huawei devices have been observed to come out of reset in NDP32 mode.
1570     + * Let's check if this is the case, and set the device to NDP16 mode again if
1571     + * needed.
1572     + */
1573     + if (ctx->drvflags & CDC_NCM_FLAG_RESET_NTB16) {
1574     + err = usbnet_read_cmd(dev, USB_CDC_GET_NTB_FORMAT,
1575     + USB_TYPE_CLASS | USB_DIR_IN | USB_RECIP_INTERFACE,
1576     + 0, iface_no, &curr_ntb_format, 2);
1577     + if (err < 0) {
1578     + goto error2;
1579     + }
1580     +
1581     + if (curr_ntb_format == USB_CDC_NCM_NTB32_FORMAT) {
1582     + dev_info(&intf->dev, "resetting NTB format to 16-bit");
1583     + err = usbnet_write_cmd(dev, USB_CDC_SET_NTB_FORMAT,
1584     + USB_TYPE_CLASS | USB_DIR_OUT
1585     + | USB_RECIP_INTERFACE,
1586     + USB_CDC_NCM_NTB16_FORMAT,
1587     + iface_no, NULL, 0);
1588     +
1589     + if (err < 0)
1590     + goto error2;
1591     + }
1592     + }
1593     +
1594     cdc_ncm_find_endpoints(dev, ctx->data);
1595     cdc_ncm_find_endpoints(dev, ctx->control);
1596     if (!dev->in || !dev->out || !dev->status) {
1597     diff --git a/drivers/net/usb/huawei_cdc_ncm.c b/drivers/net/usb/huawei_cdc_ncm.c
1598     index 2680a65cd5e4..63f28908afda 100644
1599     --- a/drivers/net/usb/huawei_cdc_ncm.c
1600     +++ b/drivers/net/usb/huawei_cdc_ncm.c
1601     @@ -80,6 +80,12 @@ static int huawei_cdc_ncm_bind(struct usbnet *usbnet_dev,
1602     * be at the end of the frame.
1603     */
1604     drvflags |= CDC_NCM_FLAG_NDP_TO_END;
1605     +
1606     + /* Additionally, it has been reported that some Huawei E3372H devices, with
1607     + * firmware version 21.318.01.00.541, come out of reset in NTB32 format mode, hence
1608     + * needing to be set to the NTB16 one again.
1609     + */
1610     + drvflags |= CDC_NCM_FLAG_RESET_NTB16;
1611     ret = cdc_ncm_bind_common(usbnet_dev, intf, 1, drvflags);
1612     if (ret)
1613     goto err;
1614     diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
1615     index e1d59da2ad20..ca8797c65312 100644
1616     --- a/drivers/net/wireless/ath/wcn36xx/main.c
1617     +++ b/drivers/net/wireless/ath/wcn36xx/main.c
1618     @@ -1165,11 +1165,12 @@ static int wcn36xx_remove(struct platform_device *pdev)
1619     wcn36xx_dbg(WCN36XX_DBG_MAC, "platform remove\n");
1620    
1621     release_firmware(wcn->nv);
1622     - mutex_destroy(&wcn->hal_mutex);
1623    
1624     ieee80211_unregister_hw(hw);
1625     iounmap(wcn->dxe_base);
1626     iounmap(wcn->ccu_base);
1627     +
1628     + mutex_destroy(&wcn->hal_mutex);
1629     ieee80211_free_hw(hw);
1630    
1631     return 0;
1632     diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
1633     index 27960b0bfbcd..425a89c635d0 100644
1634     --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
1635     +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
1636     @@ -6572,8 +6572,7 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp)
1637     wiphy->bands[NL80211_BAND_5GHZ] = band;
1638     }
1639     }
1640     - err = brcmf_setup_wiphybands(wiphy);
1641     - return err;
1642     + return 0;
1643     }
1644    
1645     static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg)
1646     @@ -6938,6 +6937,12 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
1647     goto priv_out;
1648     }
1649    
1650     + err = brcmf_setup_wiphybands(wiphy);
1651     + if (err) {
1652     + brcmf_err("Setting wiphy bands failed (%d)\n", err);
1653     + goto wiphy_unreg_out;
1654     + }
1655     +
1656     /* If cfg80211 didn't disable 40MHz HT CAP in wiphy_register(),
1657     * setup 40MHz in 2GHz band and enable OBSS scanning.
1658     */
1659     diff --git a/drivers/net/wireless/marvell/libertas/cmd.c b/drivers/net/wireless/marvell/libertas/cmd.c
1660     index 301170cccfff..033ff881c751 100644
1661     --- a/drivers/net/wireless/marvell/libertas/cmd.c
1662     +++ b/drivers/net/wireless/marvell/libertas/cmd.c
1663     @@ -305,7 +305,7 @@ int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action,
1664     }
1665    
1666     lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
1667     - return 0;
1668     + return ret;
1669     }
1670    
1671     static int lbs_wait_for_ds_awake(struct lbs_private *priv)
1672     diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
1673     index 4b0bb6b4f6f1..c636e6065548 100644
1674     --- a/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
1675     +++ b/drivers/net/wireless/ralink/rt2x00/rt2800usb.c
1676     @@ -646,10 +646,9 @@ static void rt2800usb_txdone_nostatus(struct rt2x00_dev *rt2x00dev)
1677     !test_bit(ENTRY_DATA_STATUS_PENDING, &entry->flags))
1678     break;
1679    
1680     - if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags))
1681     + if (test_bit(ENTRY_DATA_IO_FAILED, &entry->flags) ||
1682     + rt2800usb_entry_txstatus_timeout(entry))
1683     rt2x00lib_txdone_noinfo(entry, TXDONE_FAILURE);
1684     - else if (rt2800usb_entry_txstatus_timeout(entry))
1685     - rt2x00lib_txdone_noinfo(entry, TXDONE_UNKNOWN);
1686     else
1687     break;
1688     }
1689     diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
1690     index d9b5b73c35a0..a7bdb1ffac2e 100644
1691     --- a/drivers/net/xen-netback/netback.c
1692     +++ b/drivers/net/xen-netback/netback.c
1693     @@ -67,6 +67,7 @@ module_param(rx_drain_timeout_msecs, uint, 0444);
1694     unsigned int rx_stall_timeout_msecs = 60000;
1695     module_param(rx_stall_timeout_msecs, uint, 0444);
1696    
1697     +#define MAX_QUEUES_DEFAULT 8
1698     unsigned int xenvif_max_queues;
1699     module_param_named(max_queues, xenvif_max_queues, uint, 0644);
1700     MODULE_PARM_DESC(max_queues,
1701     @@ -1626,11 +1627,12 @@ static int __init netback_init(void)
1702     if (!xen_domain())
1703     return -ENODEV;
1704    
1705     - /* Allow as many queues as there are CPUs if user has not
1706     + /* Allow as many queues as there are CPUs but max. 8 if user has not
1707     * specified a value.
1708     */
1709     if (xenvif_max_queues == 0)
1710     - xenvif_max_queues = num_online_cpus();
1711     + xenvif_max_queues = min_t(unsigned int, MAX_QUEUES_DEFAULT,
1712     + num_online_cpus());
1713    
1714     if (fatal_skb_slots < XEN_NETBK_LEGACY_SLOTS_MAX) {
1715     pr_info("fatal_skb_slots too small (%d), bump it to XEN_NETBK_LEGACY_SLOTS_MAX (%d)\n",
1716     diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
1717     index 45a89d969700..90e0b6f134ad 100644
1718     --- a/drivers/pci/host/pci-mvebu.c
1719     +++ b/drivers/pci/host/pci-mvebu.c
1720     @@ -133,6 +133,12 @@ struct mvebu_pcie {
1721     int nports;
1722     };
1723    
1724     +struct mvebu_pcie_window {
1725     + phys_addr_t base;
1726     + phys_addr_t remap;
1727     + size_t size;
1728     +};
1729     +
1730     /* Structure representing one PCIe interface */
1731     struct mvebu_pcie_port {
1732     char *name;
1733     @@ -150,10 +156,8 @@ struct mvebu_pcie_port {
1734     struct mvebu_sw_pci_bridge bridge;
1735     struct device_node *dn;
1736     struct mvebu_pcie *pcie;
1737     - phys_addr_t memwin_base;
1738     - size_t memwin_size;
1739     - phys_addr_t iowin_base;
1740     - size_t iowin_size;
1741     + struct mvebu_pcie_window memwin;
1742     + struct mvebu_pcie_window iowin;
1743     u32 saved_pcie_stat;
1744     };
1745    
1746     @@ -379,23 +383,45 @@ static void mvebu_pcie_add_windows(struct mvebu_pcie_port *port,
1747     }
1748     }
1749    
1750     +static void mvebu_pcie_set_window(struct mvebu_pcie_port *port,
1751     + unsigned int target, unsigned int attribute,
1752     + const struct mvebu_pcie_window *desired,
1753     + struct mvebu_pcie_window *cur)
1754     +{
1755     + if (desired->base == cur->base && desired->remap == cur->remap &&
1756     + desired->size == cur->size)
1757     + return;
1758     +
1759     + if (cur->size != 0) {
1760     + mvebu_pcie_del_windows(port, cur->base, cur->size);
1761     + cur->size = 0;
1762     + cur->base = 0;
1763     +
1764     + /*
1765     + * If something tries to change the window while it is enabled
1766     + * the change will not be done atomically. That would be
1767     + * difficult to do in the general case.
1768     + */
1769     + }
1770     +
1771     + if (desired->size == 0)
1772     + return;
1773     +
1774     + mvebu_pcie_add_windows(port, target, attribute, desired->base,
1775     + desired->size, desired->remap);
1776     + *cur = *desired;
1777     +}
1778     +
1779     static void mvebu_pcie_handle_iobase_change(struct mvebu_pcie_port *port)
1780     {
1781     - phys_addr_t iobase;
1782     + struct mvebu_pcie_window desired = {};
1783    
1784     /* Are the new iobase/iolimit values invalid? */
1785     if (port->bridge.iolimit < port->bridge.iobase ||
1786     port->bridge.iolimitupper < port->bridge.iobaseupper ||
1787     !(port->bridge.command & PCI_COMMAND_IO)) {
1788     -
1789     - /* If a window was configured, remove it */
1790     - if (port->iowin_base) {
1791     - mvebu_pcie_del_windows(port, port->iowin_base,
1792     - port->iowin_size);
1793     - port->iowin_base = 0;
1794     - port->iowin_size = 0;
1795     - }
1796     -
1797     + mvebu_pcie_set_window(port, port->io_target, port->io_attr,
1798     + &desired, &port->iowin);
1799     return;
1800     }
1801    
1802     @@ -412,32 +438,27 @@ static void mvebu_pcie_handle_iobase_change(struct mvebu_pcie_port *port)
1803     * specifications. iobase is the bus address, port->iowin_base
1804     * is the CPU address.
1805     */
1806     - iobase = ((port->bridge.iobase & 0xF0) << 8) |
1807     - (port->bridge.iobaseupper << 16);
1808     - port->iowin_base = port->pcie->io.start + iobase;
1809     - port->iowin_size = ((0xFFF | ((port->bridge.iolimit & 0xF0) << 8) |
1810     - (port->bridge.iolimitupper << 16)) -
1811     - iobase) + 1;
1812     -
1813     - mvebu_pcie_add_windows(port, port->io_target, port->io_attr,
1814     - port->iowin_base, port->iowin_size,
1815     - iobase);
1816     + desired.remap = ((port->bridge.iobase & 0xF0) << 8) |
1817     + (port->bridge.iobaseupper << 16);
1818     + desired.base = port->pcie->io.start + desired.remap;
1819     + desired.size = ((0xFFF | ((port->bridge.iolimit & 0xF0) << 8) |
1820     + (port->bridge.iolimitupper << 16)) -
1821     + desired.remap) +
1822     + 1;
1823     +
1824     + mvebu_pcie_set_window(port, port->io_target, port->io_attr, &desired,
1825     + &port->iowin);
1826     }
1827    
1828     static void mvebu_pcie_handle_membase_change(struct mvebu_pcie_port *port)
1829     {
1830     + struct mvebu_pcie_window desired = {.remap = MVEBU_MBUS_NO_REMAP};
1831     +
1832     /* Are the new membase/memlimit values invalid? */
1833     if (port->bridge.memlimit < port->bridge.membase ||
1834     !(port->bridge.command & PCI_COMMAND_MEMORY)) {
1835     -
1836     - /* If a window was configured, remove it */
1837     - if (port->memwin_base) {
1838     - mvebu_pcie_del_windows(port, port->memwin_base,
1839     - port->memwin_size);
1840     - port->memwin_base = 0;
1841     - port->memwin_size = 0;
1842     - }
1843     -
1844     + mvebu_pcie_set_window(port, port->mem_target, port->mem_attr,
1845     + &desired, &port->memwin);
1846     return;
1847     }
1848    
1849     @@ -447,14 +468,12 @@ static void mvebu_pcie_handle_membase_change(struct mvebu_pcie_port *port)
1850     * window to setup, according to the PCI-to-PCI bridge
1851     * specifications.
1852     */
1853     - port->memwin_base = ((port->bridge.membase & 0xFFF0) << 16);
1854     - port->memwin_size =
1855     - (((port->bridge.memlimit & 0xFFF0) << 16) | 0xFFFFF) -
1856     - port->memwin_base + 1;
1857     -
1858     - mvebu_pcie_add_windows(port, port->mem_target, port->mem_attr,
1859     - port->memwin_base, port->memwin_size,
1860     - MVEBU_MBUS_NO_REMAP);
1861     + desired.base = ((port->bridge.membase & 0xFFF0) << 16);
1862     + desired.size = (((port->bridge.memlimit & 0xFFF0) << 16) | 0xFFFFF) -
1863     + desired.base + 1;
1864     +
1865     + mvebu_pcie_set_window(port, port->mem_target, port->mem_attr, &desired,
1866     + &port->memwin);
1867     }
1868    
1869     /*
1870     diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c
1871     index 5419de8e20b1..0a965026b134 100644
1872     --- a/drivers/pinctrl/intel/pinctrl-baytrail.c
1873     +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
1874     @@ -1466,7 +1466,7 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
1875     val & BYT_INPUT_EN ? " " : "in",
1876     val & BYT_OUTPUT_EN ? " " : "out",
1877     val & BYT_LEVEL ? "hi" : "lo",
1878     - comm->pad_map[i], comm->pad_map[i] * 32,
1879     + comm->pad_map[i], comm->pad_map[i] * 16,
1880     conf0 & 0x7,
1881     conf0 & BYT_TRIG_NEG ? " fall" : " ",
1882     conf0 & BYT_TRIG_POS ? " rise" : " ",
1883     diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
1884     index 96ffda493266..454cb2ee3cee 100644
1885     --- a/drivers/platform/x86/hp-wmi.c
1886     +++ b/drivers/platform/x86/hp-wmi.c
1887     @@ -248,7 +248,7 @@ static int hp_wmi_display_state(void)
1888     int ret = hp_wmi_perform_query(HPWMI_DISPLAY_QUERY, 0, &state,
1889     sizeof(state), sizeof(state));
1890     if (ret)
1891     - return -EINVAL;
1892     + return ret < 0 ? ret : -EINVAL;
1893     return state;
1894     }
1895    
1896     @@ -258,7 +258,7 @@ static int hp_wmi_hddtemp_state(void)
1897     int ret = hp_wmi_perform_query(HPWMI_HDDTEMP_QUERY, 0, &state,
1898     sizeof(state), sizeof(state));
1899     if (ret)
1900     - return -EINVAL;
1901     + return ret < 0 ? ret : -EINVAL;
1902     return state;
1903     }
1904    
1905     @@ -268,7 +268,7 @@ static int hp_wmi_als_state(void)
1906     int ret = hp_wmi_perform_query(HPWMI_ALS_QUERY, 0, &state,
1907     sizeof(state), sizeof(state));
1908     if (ret)
1909     - return -EINVAL;
1910     + return ret < 0 ? ret : -EINVAL;
1911     return state;
1912     }
1913    
1914     @@ -279,7 +279,7 @@ static int hp_wmi_dock_state(void)
1915     sizeof(state), sizeof(state));
1916    
1917     if (ret)
1918     - return -EINVAL;
1919     + return ret < 0 ? ret : -EINVAL;
1920    
1921     return state & 0x1;
1922     }
1923     @@ -290,7 +290,7 @@ static int hp_wmi_tablet_state(void)
1924     int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, &state,
1925     sizeof(state), sizeof(state));
1926     if (ret)
1927     - return ret;
1928     + return ret < 0 ? ret : -EINVAL;
1929    
1930     return (state & 0x4) ? 1 : 0;
1931     }
1932     @@ -323,7 +323,7 @@ static int __init hp_wmi_enable_hotkeys(void)
1933     int ret = hp_wmi_perform_query(HPWMI_BIOS_QUERY, 1, &value,
1934     sizeof(value), 0);
1935     if (ret)
1936     - return -EINVAL;
1937     + return ret < 0 ? ret : -EINVAL;
1938     return 0;
1939     }
1940    
1941     @@ -336,7 +336,7 @@ static int hp_wmi_set_block(void *data, bool blocked)
1942     ret = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1,
1943     &query, sizeof(query), 0);
1944     if (ret)
1945     - return -EINVAL;
1946     + return ret < 0 ? ret : -EINVAL;
1947     return 0;
1948     }
1949    
1950     @@ -428,7 +428,7 @@ static int hp_wmi_post_code_state(void)
1951     int ret = hp_wmi_perform_query(HPWMI_POSTCODEERROR_QUERY, 0, &state,
1952     sizeof(state), sizeof(state));
1953     if (ret)
1954     - return -EINVAL;
1955     + return ret < 0 ? ret : -EINVAL;
1956     return state;
1957     }
1958    
1959     @@ -494,7 +494,7 @@ static ssize_t set_als(struct device *dev, struct device_attribute *attr,
1960     int ret = hp_wmi_perform_query(HPWMI_ALS_QUERY, 1, &tmp,
1961     sizeof(tmp), sizeof(tmp));
1962     if (ret)
1963     - return -EINVAL;
1964     + return ret < 0 ? ret : -EINVAL;
1965    
1966     return count;
1967     }
1968     @@ -515,7 +515,7 @@ static ssize_t set_postcode(struct device *dev, struct device_attribute *attr,
1969     ret = hp_wmi_perform_query(HPWMI_POSTCODEERROR_QUERY, 1, &tmp,
1970     sizeof(tmp), sizeof(tmp));
1971     if (ret)
1972     - return -EINVAL;
1973     + return ret < 0 ? ret : -EINVAL;
1974    
1975     return count;
1976     }
1977     @@ -572,10 +572,12 @@ static void hp_wmi_notify(u32 value, void *context)
1978    
1979     switch (event_id) {
1980     case HPWMI_DOCK_EVENT:
1981     - input_report_switch(hp_wmi_input_dev, SW_DOCK,
1982     - hp_wmi_dock_state());
1983     - input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
1984     - hp_wmi_tablet_state());
1985     + if (test_bit(SW_DOCK, hp_wmi_input_dev->swbit))
1986     + input_report_switch(hp_wmi_input_dev, SW_DOCK,
1987     + hp_wmi_dock_state());
1988     + if (test_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit))
1989     + input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
1990     + hp_wmi_tablet_state());
1991     input_sync(hp_wmi_input_dev);
1992     break;
1993     case HPWMI_PARK_HDD:
1994     @@ -644,6 +646,7 @@ static int __init hp_wmi_input_setup(void)
1995     {
1996     acpi_status status;
1997     int err;
1998     + int val;
1999    
2000     hp_wmi_input_dev = input_allocate_device();
2001     if (!hp_wmi_input_dev)
2002     @@ -654,17 +657,26 @@ static int __init hp_wmi_input_setup(void)
2003     hp_wmi_input_dev->id.bustype = BUS_HOST;
2004    
2005     __set_bit(EV_SW, hp_wmi_input_dev->evbit);
2006     - __set_bit(SW_DOCK, hp_wmi_input_dev->swbit);
2007     - __set_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit);
2008     +
2009     + /* Dock */
2010     + val = hp_wmi_dock_state();
2011     + if (!(val < 0)) {
2012     + __set_bit(SW_DOCK, hp_wmi_input_dev->swbit);
2013     + input_report_switch(hp_wmi_input_dev, SW_DOCK, val);
2014     + }
2015     +
2016     + /* Tablet mode */
2017     + val = hp_wmi_tablet_state();
2018     + if (!(val < 0)) {
2019     + __set_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit);
2020     + input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE, val);
2021     + }
2022    
2023     err = sparse_keymap_setup(hp_wmi_input_dev, hp_wmi_keymap, NULL);
2024     if (err)
2025     goto err_free_dev;
2026    
2027     /* Set initial hardware state */
2028     - input_report_switch(hp_wmi_input_dev, SW_DOCK, hp_wmi_dock_state());
2029     - input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
2030     - hp_wmi_tablet_state());
2031     input_sync(hp_wmi_input_dev);
2032    
2033     if (!hp_wmi_bios_2009_later() && hp_wmi_bios_2008_later())
2034     @@ -950,10 +962,12 @@ static int hp_wmi_resume_handler(struct device *device)
2035     * changed.
2036     */
2037     if (hp_wmi_input_dev) {
2038     - input_report_switch(hp_wmi_input_dev, SW_DOCK,
2039     - hp_wmi_dock_state());
2040     - input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
2041     - hp_wmi_tablet_state());
2042     + if (test_bit(SW_DOCK, hp_wmi_input_dev->swbit))
2043     + input_report_switch(hp_wmi_input_dev, SW_DOCK,
2044     + hp_wmi_dock_state());
2045     + if (test_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit))
2046     + input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
2047     + hp_wmi_tablet_state());
2048     input_sync(hp_wmi_input_dev);
2049     }
2050    
2051     diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
2052     index f3756ca6f349..d55e6438bb5e 100644
2053     --- a/drivers/s390/net/qeth_core.h
2054     +++ b/drivers/s390/net/qeth_core.h
2055     @@ -921,7 +921,6 @@ void qeth_clear_thread_running_bit(struct qeth_card *, unsigned long);
2056     int qeth_core_hardsetup_card(struct qeth_card *);
2057     void qeth_print_status_message(struct qeth_card *);
2058     int qeth_init_qdio_queues(struct qeth_card *);
2059     -int qeth_send_startlan(struct qeth_card *);
2060     int qeth_send_ipa_cmd(struct qeth_card *, struct qeth_cmd_buffer *,
2061     int (*reply_cb)
2062     (struct qeth_card *, struct qeth_reply *, unsigned long),
2063     diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
2064     index e8c48309ebe9..21ef8023430f 100644
2065     --- a/drivers/s390/net/qeth_core_main.c
2066     +++ b/drivers/s390/net/qeth_core_main.c
2067     @@ -2944,7 +2944,7 @@ int qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
2068     }
2069     EXPORT_SYMBOL_GPL(qeth_send_ipa_cmd);
2070    
2071     -int qeth_send_startlan(struct qeth_card *card)
2072     +static int qeth_send_startlan(struct qeth_card *card)
2073     {
2074     int rc;
2075     struct qeth_cmd_buffer *iob;
2076     @@ -2957,7 +2957,6 @@ int qeth_send_startlan(struct qeth_card *card)
2077     rc = qeth_send_ipa_cmd(card, iob, NULL, NULL);
2078     return rc;
2079     }
2080     -EXPORT_SYMBOL_GPL(qeth_send_startlan);
2081    
2082     static int qeth_default_setadapterparms_cb(struct qeth_card *card,
2083     struct qeth_reply *reply, unsigned long data)
2084     @@ -5091,6 +5090,20 @@ int qeth_core_hardsetup_card(struct qeth_card *card)
2085     goto out;
2086     }
2087    
2088     + rc = qeth_send_startlan(card);
2089     + if (rc) {
2090     + QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
2091     + if (rc == IPA_RC_LAN_OFFLINE) {
2092     + dev_warn(&card->gdev->dev,
2093     + "The LAN is offline\n");
2094     + card->lan_online = 0;
2095     + } else {
2096     + rc = -ENODEV;
2097     + goto out;
2098     + }
2099     + } else
2100     + card->lan_online = 1;
2101     +
2102     card->options.ipa4.supported_funcs = 0;
2103     card->options.ipa6.supported_funcs = 0;
2104     card->options.adp.supported_funcs = 0;
2105     @@ -5102,14 +5115,14 @@ int qeth_core_hardsetup_card(struct qeth_card *card)
2106     if (qeth_is_supported(card, IPA_SETADAPTERPARMS)) {
2107     rc = qeth_query_setadapterparms(card);
2108     if (rc < 0) {
2109     - QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
2110     + QETH_DBF_TEXT_(SETUP, 2, "7err%d", rc);
2111     goto out;
2112     }
2113     }
2114     if (qeth_adp_supported(card, IPA_SETADP_SET_DIAG_ASSIST)) {
2115     rc = qeth_query_setdiagass(card);
2116     if (rc < 0) {
2117     - QETH_DBF_TEXT_(SETUP, 2, "7err%d", rc);
2118     + QETH_DBF_TEXT_(SETUP, 2, "8err%d", rc);
2119     goto out;
2120     }
2121     }
2122     diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
2123     index 5d010aa89852..8530477caab8 100644
2124     --- a/drivers/s390/net/qeth_l2_main.c
2125     +++ b/drivers/s390/net/qeth_l2_main.c
2126     @@ -1204,21 +1204,6 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
2127     /* softsetup */
2128     QETH_DBF_TEXT(SETUP, 2, "softsetp");
2129    
2130     - rc = qeth_send_startlan(card);
2131     - if (rc) {
2132     - QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
2133     - if (rc == 0xe080) {
2134     - dev_warn(&card->gdev->dev,
2135     - "The LAN is offline\n");
2136     - card->lan_online = 0;
2137     - goto contin;
2138     - }
2139     - rc = -ENODEV;
2140     - goto out_remove;
2141     - } else
2142     - card->lan_online = 1;
2143     -
2144     -contin:
2145     if ((card->info.type == QETH_CARD_TYPE_OSD) ||
2146     (card->info.type == QETH_CARD_TYPE_OSX)) {
2147     rc = qeth_l2_start_ipassists(card);
2148     diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
2149     index 171be5ec2ece..03a2619166ca 100644
2150     --- a/drivers/s390/net/qeth_l3_main.c
2151     +++ b/drivers/s390/net/qeth_l3_main.c
2152     @@ -3230,21 +3230,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
2153     /* softsetup */
2154     QETH_DBF_TEXT(SETUP, 2, "softsetp");
2155    
2156     - rc = qeth_send_startlan(card);
2157     - if (rc) {
2158     - QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
2159     - if (rc == 0xe080) {
2160     - dev_warn(&card->gdev->dev,
2161     - "The LAN is offline\n");
2162     - card->lan_online = 0;
2163     - goto contin;
2164     - }
2165     - rc = -ENODEV;
2166     - goto out_remove;
2167     - } else
2168     - card->lan_online = 1;
2169     -
2170     -contin:
2171     rc = qeth_l3_setadapter_parms(card);
2172     if (rc)
2173     QETH_DBF_TEXT_(SETUP, 2, "2err%04x", rc);
2174     diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
2175     index 0e00a5ce0f00..cffe42f5775d 100644
2176     --- a/drivers/s390/net/qeth_l3_sys.c
2177     +++ b/drivers/s390/net/qeth_l3_sys.c
2178     @@ -692,15 +692,15 @@ static ssize_t qeth_l3_dev_vipa_add_show(char *buf, struct qeth_card *card,
2179     enum qeth_prot_versions proto)
2180     {
2181     struct qeth_ipaddr *ipaddr;
2182     - struct hlist_node *tmp;
2183     char addr_str[40];
2184     + int str_len = 0;
2185     int entry_len; /* length of 1 entry string, differs between v4 and v6 */
2186     - int i = 0;
2187     + int i;
2188    
2189     entry_len = (proto == QETH_PROT_IPV4)? 12 : 40;
2190     entry_len += 2; /* \n + terminator */
2191     spin_lock_bh(&card->ip_lock);
2192     - hash_for_each_safe(card->ip_htable, i, tmp, ipaddr, hnode) {
2193     + hash_for_each(card->ip_htable, i, ipaddr, hnode) {
2194     if (ipaddr->proto != proto)
2195     continue;
2196     if (ipaddr->type != QETH_IP_TYPE_VIPA)
2197     @@ -708,16 +708,17 @@ static ssize_t qeth_l3_dev_vipa_add_show(char *buf, struct qeth_card *card,
2198     /* String must not be longer than PAGE_SIZE. So we check if
2199     * string length gets near PAGE_SIZE. Then we can savely display
2200     * the next IPv6 address (worst case, compared to IPv4) */
2201     - if ((PAGE_SIZE - i) <= entry_len)
2202     + if ((PAGE_SIZE - str_len) <= entry_len)
2203     break;
2204     qeth_l3_ipaddr_to_string(proto, (const u8 *)&ipaddr->u,
2205     addr_str);
2206     - i += snprintf(buf + i, PAGE_SIZE - i, "%s\n", addr_str);
2207     + str_len += snprintf(buf + str_len, PAGE_SIZE - str_len, "%s\n",
2208     + addr_str);
2209     }
2210     spin_unlock_bh(&card->ip_lock);
2211     - i += snprintf(buf + i, PAGE_SIZE - i, "\n");
2212     + str_len += snprintf(buf + str_len, PAGE_SIZE - str_len, "\n");
2213    
2214     - return i;
2215     + return str_len;
2216     }
2217    
2218     static ssize_t qeth_l3_dev_vipa_add4_show(struct device *dev,
2219     @@ -854,15 +855,15 @@ static ssize_t qeth_l3_dev_rxip_add_show(char *buf, struct qeth_card *card,
2220     enum qeth_prot_versions proto)
2221     {
2222     struct qeth_ipaddr *ipaddr;
2223     - struct hlist_node *tmp;
2224     char addr_str[40];
2225     + int str_len = 0;
2226     int entry_len; /* length of 1 entry string, differs between v4 and v6 */
2227     - int i = 0;
2228     + int i;
2229    
2230     entry_len = (proto == QETH_PROT_IPV4)? 12 : 40;
2231     entry_len += 2; /* \n + terminator */
2232     spin_lock_bh(&card->ip_lock);
2233     - hash_for_each_safe(card->ip_htable, i, tmp, ipaddr, hnode) {
2234     + hash_for_each(card->ip_htable, i, ipaddr, hnode) {
2235     if (ipaddr->proto != proto)
2236     continue;
2237     if (ipaddr->type != QETH_IP_TYPE_RXIP)
2238     @@ -870,16 +871,17 @@ static ssize_t qeth_l3_dev_rxip_add_show(char *buf, struct qeth_card *card,
2239     /* String must not be longer than PAGE_SIZE. So we check if
2240     * string length gets near PAGE_SIZE. Then we can savely display
2241     * the next IPv6 address (worst case, compared to IPv4) */
2242     - if ((PAGE_SIZE - i) <= entry_len)
2243     + if ((PAGE_SIZE - str_len) <= entry_len)
2244     break;
2245     qeth_l3_ipaddr_to_string(proto, (const u8 *)&ipaddr->u,
2246     addr_str);
2247     - i += snprintf(buf + i, PAGE_SIZE - i, "%s\n", addr_str);
2248     + str_len += snprintf(buf + str_len, PAGE_SIZE - str_len, "%s\n",
2249     + addr_str);
2250     }
2251     spin_unlock_bh(&card->ip_lock);
2252     - i += snprintf(buf + i, PAGE_SIZE - i, "\n");
2253     + str_len += snprintf(buf + str_len, PAGE_SIZE - str_len, "\n");
2254    
2255     - return i;
2256     + return str_len;
2257     }
2258    
2259     static ssize_t qeth_l3_dev_rxip_add4_show(struct device *dev,
2260     diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
2261     index 38dca69a06eb..ce500a509aa2 100644
2262     --- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
2263     +++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
2264     @@ -260,7 +260,7 @@ static int iio_bfin_tmr_trigger_probe(struct platform_device *pdev)
2265     out1:
2266     iio_trigger_unregister(st->trig);
2267     out:
2268     - iio_trigger_put(st->trig);
2269     + iio_trigger_free(st->trig);
2270     return ret;
2271     }
2272    
2273     @@ -273,7 +273,7 @@ static int iio_bfin_tmr_trigger_remove(struct platform_device *pdev)
2274     peripheral_free(st->t->pin);
2275     free_irq(st->irq, st);
2276     iio_trigger_unregister(st->trig);
2277     - iio_trigger_put(st->trig);
2278     + iio_trigger_free(st->trig);
2279    
2280     return 0;
2281     }
2282     diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
2283     index 7e97a1ccab23..15eaea53b3df 100644
2284     --- a/drivers/tty/serial/sh-sci.c
2285     +++ b/drivers/tty/serial/sh-sci.c
2286     @@ -193,18 +193,17 @@ static const struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
2287     },
2288    
2289     /*
2290     - * Common definitions for legacy IrDA ports, dependent on
2291     - * regshift value.
2292     + * Common definitions for legacy IrDA ports.
2293     */
2294     [SCIx_IRDA_REGTYPE] = {
2295     [SCSMR] = { 0x00, 8 },
2296     - [SCBRR] = { 0x01, 8 },
2297     - [SCSCR] = { 0x02, 8 },
2298     - [SCxTDR] = { 0x03, 8 },
2299     - [SCxSR] = { 0x04, 8 },
2300     - [SCxRDR] = { 0x05, 8 },
2301     - [SCFCR] = { 0x06, 8 },
2302     - [SCFDR] = { 0x07, 16 },
2303     + [SCBRR] = { 0x02, 8 },
2304     + [SCSCR] = { 0x04, 8 },
2305     + [SCxTDR] = { 0x06, 8 },
2306     + [SCxSR] = { 0x08, 16 },
2307     + [SCxRDR] = { 0x0a, 8 },
2308     + [SCFCR] = { 0x0c, 8 },
2309     + [SCFDR] = { 0x0e, 16 },
2310     [SCTFDR] = sci_reg_invalid,
2311     [SCRFDR] = sci_reg_invalid,
2312     [SCSPTR] = sci_reg_invalid,
2313     diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
2314     index 882fc4e08284..fcc7aa248ce7 100644
2315     --- a/drivers/usb/core/hcd.c
2316     +++ b/drivers/usb/core/hcd.c
2317     @@ -3023,6 +3023,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
2318     }
2319    
2320     usb_put_invalidate_rhdev(hcd);
2321     + hcd->flags = 0;
2322     }
2323     EXPORT_SYMBOL_GPL(usb_remove_hcd);
2324    
2325     diff --git a/drivers/video/fbdev/pmag-ba-fb.c b/drivers/video/fbdev/pmag-ba-fb.c
2326     index 5872bc4af3ce..df02fb4b7fd1 100644
2327     --- a/drivers/video/fbdev/pmag-ba-fb.c
2328     +++ b/drivers/video/fbdev/pmag-ba-fb.c
2329     @@ -129,7 +129,7 @@ static struct fb_ops pmagbafb_ops = {
2330     /*
2331     * Turn the hardware cursor off.
2332     */
2333     -static void __init pmagbafb_erase_cursor(struct fb_info *info)
2334     +static void pmagbafb_erase_cursor(struct fb_info *info)
2335     {
2336     struct pmagbafb_par *par = info->par;
2337    
2338     diff --git a/include/dt-bindings/clock/exynos5433.h b/include/dt-bindings/clock/exynos5433.h
2339     index 4fa6bb2136e3..be39d23e6a32 100644
2340     --- a/include/dt-bindings/clock/exynos5433.h
2341     +++ b/include/dt-bindings/clock/exynos5433.h
2342     @@ -771,7 +771,10 @@
2343    
2344     #define CLK_PCLK_DECON 113
2345    
2346     -#define DISP_NR_CLK 114
2347     +#define CLK_PHYCLK_MIPIDPHY0_BITCLKDIV8_PHY 114
2348     +#define CLK_PHYCLK_MIPIDPHY0_RXCLKESC0_PHY 115
2349     +
2350     +#define DISP_NR_CLK 116
2351    
2352     /* CMU_AUD */
2353     #define CLK_MOUT_AUD_PLL_USER 1
2354     diff --git a/include/linux/phy.h b/include/linux/phy.h
2355     index 8431c8c0c320..a04d69ab7c34 100644
2356     --- a/include/linux/phy.h
2357     +++ b/include/linux/phy.h
2358     @@ -142,11 +142,7 @@ static inline const char *phy_modes(phy_interface_t interface)
2359     /* Used when trying to connect to a specific phy (mii bus id:phy device id) */
2360     #define PHY_ID_FMT "%s:%02x"
2361    
2362     -/*
2363     - * Need to be a little smaller than phydev->dev.bus_id to leave room
2364     - * for the ":%02x"
2365     - */
2366     -#define MII_BUS_ID_SIZE (20 - 3)
2367     +#define MII_BUS_ID_SIZE 61
2368    
2369     /* Or MII_ADDR_C45 into regnum for read/write on mii_bus to enable the 21 bit
2370     IEEE 802.3ae clause 45 addressing mode used by 10GIGE phy chips. */
2371     @@ -602,7 +598,7 @@ struct phy_driver {
2372     /* A Structure for boards to register fixups with the PHY Lib */
2373     struct phy_fixup {
2374     struct list_head list;
2375     - char bus_id[20];
2376     + char bus_id[MII_BUS_ID_SIZE + 3];
2377     u32 phy_uid;
2378     u32 phy_uid_mask;
2379     int (*run)(struct phy_device *phydev);
2380     diff --git a/include/linux/preempt.h b/include/linux/preempt.h
2381     index 75e4e30677f1..7eeceac52dea 100644
2382     --- a/include/linux/preempt.h
2383     +++ b/include/linux/preempt.h
2384     @@ -65,19 +65,24 @@
2385    
2386     /*
2387     * Are we doing bottom half or hardware interrupt processing?
2388     - * Are we in a softirq context? Interrupt context?
2389     - * in_softirq - Are we currently processing softirq or have bh disabled?
2390     - * in_serving_softirq - Are we currently processing softirq?
2391     + *
2392     + * in_irq() - We're in (hard) IRQ context
2393     + * in_softirq() - We have BH disabled, or are processing softirqs
2394     + * in_interrupt() - We're in NMI,IRQ,SoftIRQ context or have BH disabled
2395     + * in_serving_softirq() - We're in softirq context
2396     + * in_nmi() - We're in NMI context
2397     + * in_task() - We're in task context
2398     + *
2399     + * Note: due to the BH disabled confusion: in_softirq(),in_interrupt() really
2400     + * should not be used in new code.
2401     */
2402     #define in_irq() (hardirq_count())
2403     #define in_softirq() (softirq_count())
2404     #define in_interrupt() (irq_count())
2405     #define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
2406     -
2407     -/*
2408     - * Are we in NMI context?
2409     - */
2410     -#define in_nmi() (preempt_count() & NMI_MASK)
2411     +#define in_nmi() (preempt_count() & NMI_MASK)
2412     +#define in_task() (!(preempt_count() & \
2413     + (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET)))
2414    
2415     /*
2416     * The preempt_count offset after preempt_disable();
2417     diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
2418     index 00d232406f18..b0fad110817b 100644
2419     --- a/include/linux/usb/cdc_ncm.h
2420     +++ b/include/linux/usb/cdc_ncm.h
2421     @@ -83,6 +83,7 @@
2422     /* Driver flags */
2423     #define CDC_NCM_FLAG_NDP_TO_END 0x02 /* NDP is placed at end of frame */
2424     #define CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE 0x04 /* Avoid altsetting toggle during init */
2425     +#define CDC_NCM_FLAG_RESET_NTB16 0x08 /* set NDP16 one more time after altsetting switch */
2426    
2427     #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \
2428     (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE)
2429     diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
2430     index feb58d455560..4b9ee3009aa0 100644
2431     --- a/include/sound/seq_kernel.h
2432     +++ b/include/sound/seq_kernel.h
2433     @@ -49,7 +49,8 @@ typedef union snd_seq_timestamp snd_seq_timestamp_t;
2434     #define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS 200
2435    
2436     /* max delivery path length */
2437     -#define SNDRV_SEQ_MAX_HOPS 10
2438     +/* NOTE: this shouldn't be greater than MAX_LOCKDEP_SUBCLASSES */
2439     +#define SNDRV_SEQ_MAX_HOPS 8
2440    
2441     /* max size of event size */
2442     #define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff
2443     diff --git a/kernel/sched/core.c b/kernel/sched/core.c
2444     index 02e7ad860b52..78181c03d9c7 100644
2445     --- a/kernel/sched/core.c
2446     +++ b/kernel/sched/core.c
2447     @@ -7961,6 +7961,7 @@ void sched_move_task(struct task_struct *tsk)
2448     struct rq *rq;
2449    
2450     rq = task_rq_lock(tsk, &rf);
2451     + update_rq_clock(rq);
2452    
2453     running = task_current(rq, tsk);
2454     queued = task_on_rq_queued(tsk);
2455     diff --git a/kernel/workqueue_internal.h b/kernel/workqueue_internal.h
2456     index 8635417c587b..29fa81f0f51a 100644
2457     --- a/kernel/workqueue_internal.h
2458     +++ b/kernel/workqueue_internal.h
2459     @@ -9,6 +9,7 @@
2460    
2461     #include <linux/workqueue.h>
2462     #include <linux/kthread.h>
2463     +#include <linux/preempt.h>
2464    
2465     struct worker_pool;
2466    
2467     @@ -59,7 +60,7 @@ struct worker {
2468     */
2469     static inline struct worker *current_wq_worker(void)
2470     {
2471     - if (current->flags & PF_WQ_WORKER)
2472     + if (in_task() && (current->flags & PF_WQ_WORKER))
2473     return kthread_data(current);
2474     return NULL;
2475     }
2476     diff --git a/lib/asn1_decoder.c b/lib/asn1_decoder.c
2477     index fef5d2e114be..1ef0cec38d78 100644
2478     --- a/lib/asn1_decoder.c
2479     +++ b/lib/asn1_decoder.c
2480     @@ -228,7 +228,7 @@ int asn1_ber_decoder(const struct asn1_decoder *decoder,
2481     hdr = 2;
2482    
2483     /* Extract a tag from the data */
2484     - if (unlikely(dp >= datalen - 1))
2485     + if (unlikely(datalen - dp < 2))
2486     goto data_overrun_error;
2487     tag = data[dp++];
2488     if (unlikely((tag & 0x1f) == ASN1_LONG_TAG))
2489     @@ -274,7 +274,7 @@ int asn1_ber_decoder(const struct asn1_decoder *decoder,
2490     int n = len - 0x80;
2491     if (unlikely(n > 2))
2492     goto length_too_long;
2493     - if (unlikely(dp >= datalen - n))
2494     + if (unlikely(n > datalen - dp))
2495     goto data_overrun_error;
2496     hdr += n;
2497     for (len = 0; n > 0; n--) {
2498     diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
2499     index 96e47c539bee..39bb5b3a82f2 100644
2500     --- a/net/dsa/Kconfig
2501     +++ b/net/dsa/Kconfig
2502     @@ -1,12 +1,13 @@
2503     config HAVE_NET_DSA
2504     def_bool y
2505     - depends on NETDEVICES && !S390
2506     + depends on INET && NETDEVICES && !S390
2507    
2508     # Drivers must select NET_DSA and the appropriate tagging format
2509    
2510     config NET_DSA
2511     tristate "Distributed Switch Architecture"
2512     - depends on HAVE_NET_DSA && NET_SWITCHDEV
2513     + depends on HAVE_NET_DSA
2514     + select NET_SWITCHDEV
2515     select PHYLIB
2516     ---help---
2517     Say Y if you want to enable support for the hardware switches supported
2518     diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
2519     index f2a71025a770..22377c8ff14b 100644
2520     --- a/net/ipv4/ah4.c
2521     +++ b/net/ipv4/ah4.c
2522     @@ -270,6 +270,9 @@ static void ah_input_done(struct crypto_async_request *base, int err)
2523     int ihl = ip_hdrlen(skb);
2524     int ah_hlen = (ah->hdrlen + 2) << 2;
2525    
2526     + if (err)
2527     + goto out;
2528     +
2529     work_iph = AH_SKB_CB(skb)->tmp;
2530     auth_data = ah_tmp_auth(work_iph, ihl);
2531     icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len);
2532     diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c
2533     index 6c1e0246706e..7c3395513ff0 100644
2534     --- a/net/netfilter/nft_meta.c
2535     +++ b/net/netfilter/nft_meta.c
2536     @@ -159,8 +159,34 @@ void nft_meta_get_eval(const struct nft_expr *expr,
2537     else
2538     *dest = PACKET_BROADCAST;
2539     break;
2540     + case NFPROTO_NETDEV:
2541     + switch (skb->protocol) {
2542     + case htons(ETH_P_IP): {
2543     + int noff = skb_network_offset(skb);
2544     + struct iphdr *iph, _iph;
2545     +
2546     + iph = skb_header_pointer(skb, noff,
2547     + sizeof(_iph), &_iph);
2548     + if (!iph)
2549     + goto err;
2550     +
2551     + if (ipv4_is_multicast(iph->daddr))
2552     + *dest = PACKET_MULTICAST;
2553     + else
2554     + *dest = PACKET_BROADCAST;
2555     +
2556     + break;
2557     + }
2558     + case htons(ETH_P_IPV6):
2559     + *dest = PACKET_MULTICAST;
2560     + break;
2561     + default:
2562     + WARN_ON_ONCE(1);
2563     + goto err;
2564     + }
2565     + break;
2566     default:
2567     - WARN_ON(1);
2568     + WARN_ON_ONCE(1);
2569     goto err;
2570     }
2571     break;
2572     diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
2573     index 41b8cb115801..7d3a98b2d55a 100644
2574     --- a/security/apparmor/lsm.c
2575     +++ b/security/apparmor/lsm.c
2576     @@ -671,9 +671,9 @@ enum profile_mode aa_g_profile_mode = APPARMOR_ENFORCE;
2577     module_param_call(mode, param_set_mode, param_get_mode,
2578     &aa_g_profile_mode, S_IRUSR | S_IWUSR);
2579    
2580     -#ifdef CONFIG_SECURITY_APPARMOR_HASH
2581     /* whether policy verification hashing is enabled */
2582     bool aa_g_hash_policy = IS_ENABLED(CONFIG_SECURITY_APPARMOR_HASH_DEFAULT);
2583     +#ifdef CONFIG_SECURITY_APPARMOR_HASH
2584     module_param_named(hash_policy, aa_g_hash_policy, aabool, S_IRUSR | S_IWUSR);
2585     #endif
2586    
2587     diff --git a/security/keys/trusted.c b/security/keys/trusted.c
2588     index f4db42e669e9..4ba2f6b91242 100644
2589     --- a/security/keys/trusted.c
2590     +++ b/security/keys/trusted.c
2591     @@ -70,7 +70,7 @@ static int TSS_sha1(const unsigned char *data, unsigned int datalen,
2592     }
2593    
2594     ret = crypto_shash_digest(&sdesc->shash, data, datalen, digest);
2595     - kfree(sdesc);
2596     + kzfree(sdesc);
2597     return ret;
2598     }
2599    
2600     @@ -114,7 +114,7 @@ static int TSS_rawhmac(unsigned char *digest, const unsigned char *key,
2601     if (!ret)
2602     ret = crypto_shash_final(&sdesc->shash, digest);
2603     out:
2604     - kfree(sdesc);
2605     + kzfree(sdesc);
2606     return ret;
2607     }
2608    
2609     @@ -165,7 +165,7 @@ static int TSS_authhmac(unsigned char *digest, const unsigned char *key,
2610     paramdigest, TPM_NONCE_SIZE, h1,
2611     TPM_NONCE_SIZE, h2, 1, &c, 0, 0);
2612     out:
2613     - kfree(sdesc);
2614     + kzfree(sdesc);
2615     return ret;
2616     }
2617    
2618     @@ -246,7 +246,7 @@ static int TSS_checkhmac1(unsigned char *buffer,
2619     if (memcmp(testhmac, authdata, SHA1_DIGEST_SIZE))
2620     ret = -EINVAL;
2621     out:
2622     - kfree(sdesc);
2623     + kzfree(sdesc);
2624     return ret;
2625     }
2626    
2627     @@ -347,7 +347,7 @@ static int TSS_checkhmac2(unsigned char *buffer,
2628     if (memcmp(testhmac2, authdata2, SHA1_DIGEST_SIZE))
2629     ret = -EINVAL;
2630     out:
2631     - kfree(sdesc);
2632     + kzfree(sdesc);
2633     return ret;
2634     }
2635    
2636     @@ -564,7 +564,7 @@ static int tpm_seal(struct tpm_buf *tb, uint16_t keytype,
2637     *bloblen = storedsize;
2638     }
2639     out:
2640     - kfree(td);
2641     + kzfree(td);
2642     return ret;
2643     }
2644    
2645     @@ -678,7 +678,7 @@ static int key_seal(struct trusted_key_payload *p,
2646     if (ret < 0)
2647     pr_info("trusted_key: srkseal failed (%d)\n", ret);
2648    
2649     - kfree(tb);
2650     + kzfree(tb);
2651     return ret;
2652     }
2653    
2654     @@ -703,7 +703,7 @@ static int key_unseal(struct trusted_key_payload *p,
2655     /* pull migratable flag out of sealed key */
2656     p->migratable = p->key[--p->key_len];
2657    
2658     - kfree(tb);
2659     + kzfree(tb);
2660     return ret;
2661     }
2662    
2663     @@ -1037,12 +1037,12 @@ static int trusted_instantiate(struct key *key,
2664     if (!ret && options->pcrlock)
2665     ret = pcrlock(options->pcrlock);
2666     out:
2667     - kfree(datablob);
2668     - kfree(options);
2669     + kzfree(datablob);
2670     + kzfree(options);
2671     if (!ret)
2672     rcu_assign_keypointer(key, payload);
2673     else
2674     - kfree(payload);
2675     + kzfree(payload);
2676     return ret;
2677     }
2678    
2679     @@ -1051,8 +1051,7 @@ static void trusted_rcu_free(struct rcu_head *rcu)
2680     struct trusted_key_payload *p;
2681    
2682     p = container_of(rcu, struct trusted_key_payload, rcu);
2683     - memset(p->key, 0, p->key_len);
2684     - kfree(p);
2685     + kzfree(p);
2686     }
2687    
2688     /*
2689     @@ -1094,13 +1093,13 @@ static int trusted_update(struct key *key, struct key_preparsed_payload *prep)
2690     ret = datablob_parse(datablob, new_p, new_o);
2691     if (ret != Opt_update) {
2692     ret = -EINVAL;
2693     - kfree(new_p);
2694     + kzfree(new_p);
2695     goto out;
2696     }
2697    
2698     if (!new_o->keyhandle) {
2699     ret = -EINVAL;
2700     - kfree(new_p);
2701     + kzfree(new_p);
2702     goto out;
2703     }
2704    
2705     @@ -1114,22 +1113,22 @@ static int trusted_update(struct key *key, struct key_preparsed_payload *prep)
2706     ret = key_seal(new_p, new_o);
2707     if (ret < 0) {
2708     pr_info("trusted_key: key_seal failed (%d)\n", ret);
2709     - kfree(new_p);
2710     + kzfree(new_p);
2711     goto out;
2712     }
2713     if (new_o->pcrlock) {
2714     ret = pcrlock(new_o->pcrlock);
2715     if (ret < 0) {
2716     pr_info("trusted_key: pcrlock failed (%d)\n", ret);
2717     - kfree(new_p);
2718     + kzfree(new_p);
2719     goto out;
2720     }
2721     }
2722     rcu_assign_keypointer(key, new_p);
2723     call_rcu(&p->rcu, trusted_rcu_free);
2724     out:
2725     - kfree(datablob);
2726     - kfree(new_o);
2727     + kzfree(datablob);
2728     + kzfree(new_o);
2729     return ret;
2730     }
2731    
2732     @@ -1148,34 +1147,30 @@ static long trusted_read(const struct key *key, char __user *buffer,
2733     p = rcu_dereference_key(key);
2734     if (!p)
2735     return -EINVAL;
2736     - if (!buffer || buflen <= 0)
2737     - return 2 * p->blob_len;
2738     - ascii_buf = kmalloc(2 * p->blob_len, GFP_KERNEL);
2739     - if (!ascii_buf)
2740     - return -ENOMEM;
2741    
2742     - bufp = ascii_buf;
2743     - for (i = 0; i < p->blob_len; i++)
2744     - bufp = hex_byte_pack(bufp, p->blob[i]);
2745     - if ((copy_to_user(buffer, ascii_buf, 2 * p->blob_len)) != 0) {
2746     - kfree(ascii_buf);
2747     - return -EFAULT;
2748     + if (buffer && buflen >= 2 * p->blob_len) {
2749     + ascii_buf = kmalloc(2 * p->blob_len, GFP_KERNEL);
2750     + if (!ascii_buf)
2751     + return -ENOMEM;
2752     +
2753     + bufp = ascii_buf;
2754     + for (i = 0; i < p->blob_len; i++)
2755     + bufp = hex_byte_pack(bufp, p->blob[i]);
2756     + if (copy_to_user(buffer, ascii_buf, 2 * p->blob_len) != 0) {
2757     + kzfree(ascii_buf);
2758     + return -EFAULT;
2759     + }
2760     + kzfree(ascii_buf);
2761     }
2762     - kfree(ascii_buf);
2763     return 2 * p->blob_len;
2764     }
2765    
2766     /*
2767     - * trusted_destroy - before freeing the key, clear the decrypted data
2768     + * trusted_destroy - clear and free the key's payload
2769     */
2770     static void trusted_destroy(struct key *key)
2771     {
2772     - struct trusted_key_payload *p = key->payload.data[0];
2773     -
2774     - if (!p)
2775     - return;
2776     - memset(p->key, 0, p->key_len);
2777     - kfree(key->payload.data[0]);
2778     + kzfree(key->payload.data[0]);
2779     }
2780    
2781     struct key_type key_type_trusted = {
2782     diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c
2783     index aaff9ee32695..b30b2139e3f0 100644
2784     --- a/sound/core/seq/oss/seq_oss_midi.c
2785     +++ b/sound/core/seq/oss/seq_oss_midi.c
2786     @@ -612,9 +612,7 @@ send_midi_event(struct seq_oss_devinfo *dp, struct snd_seq_event *ev, struct seq
2787     if (!dp->timer->running)
2788     len = snd_seq_oss_timer_start(dp->timer);
2789     if (ev->type == SNDRV_SEQ_EVENT_SYSEX) {
2790     - if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
2791     - snd_seq_oss_readq_puts(dp->readq, mdev->seq_device,
2792     - ev->data.ext.ptr, ev->data.ext.len);
2793     + snd_seq_oss_readq_sysex(dp->readq, mdev->seq_device, ev);
2794     } else {
2795     len = snd_midi_event_decode(mdev->coder, msg, sizeof(msg), ev);
2796     if (len > 0)
2797     diff --git a/sound/core/seq/oss/seq_oss_readq.c b/sound/core/seq/oss/seq_oss_readq.c
2798     index 046cb586fb2f..06b21226b4e7 100644
2799     --- a/sound/core/seq/oss/seq_oss_readq.c
2800     +++ b/sound/core/seq/oss/seq_oss_readq.c
2801     @@ -117,6 +117,35 @@ snd_seq_oss_readq_puts(struct seq_oss_readq *q, int dev, unsigned char *data, in
2802     return 0;
2803     }
2804    
2805     +/*
2806     + * put MIDI sysex bytes; the event buffer may be chained, thus it has
2807     + * to be expanded via snd_seq_dump_var_event().
2808     + */
2809     +struct readq_sysex_ctx {
2810     + struct seq_oss_readq *readq;
2811     + int dev;
2812     +};
2813     +
2814     +static int readq_dump_sysex(void *ptr, void *buf, int count)
2815     +{
2816     + struct readq_sysex_ctx *ctx = ptr;
2817     +
2818     + return snd_seq_oss_readq_puts(ctx->readq, ctx->dev, buf, count);
2819     +}
2820     +
2821     +int snd_seq_oss_readq_sysex(struct seq_oss_readq *q, int dev,
2822     + struct snd_seq_event *ev)
2823     +{
2824     + struct readq_sysex_ctx ctx = {
2825     + .readq = q,
2826     + .dev = dev
2827     + };
2828     +
2829     + if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
2830     + return 0;
2831     + return snd_seq_dump_var_event(ev, readq_dump_sysex, &ctx);
2832     +}
2833     +
2834     /*
2835     * copy an event to input queue:
2836     * return zero if enqueued
2837     diff --git a/sound/core/seq/oss/seq_oss_readq.h b/sound/core/seq/oss/seq_oss_readq.h
2838     index f1463f1f449e..8d033ca2d23f 100644
2839     --- a/sound/core/seq/oss/seq_oss_readq.h
2840     +++ b/sound/core/seq/oss/seq_oss_readq.h
2841     @@ -44,6 +44,8 @@ void snd_seq_oss_readq_delete(struct seq_oss_readq *q);
2842     void snd_seq_oss_readq_clear(struct seq_oss_readq *readq);
2843     unsigned int snd_seq_oss_readq_poll(struct seq_oss_readq *readq, struct file *file, poll_table *wait);
2844     int snd_seq_oss_readq_puts(struct seq_oss_readq *readq, int dev, unsigned char *data, int len);
2845     +int snd_seq_oss_readq_sysex(struct seq_oss_readq *q, int dev,
2846     + struct snd_seq_event *ev);
2847     int snd_seq_oss_readq_put_event(struct seq_oss_readq *readq, union evrec *ev);
2848     int snd_seq_oss_readq_put_timestamp(struct seq_oss_readq *readq, unsigned long curt, int seq_mode);
2849     int snd_seq_oss_readq_pick(struct seq_oss_readq *q, union evrec *rec);
2850     diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
2851     index 88fbb3a1e660..048de15d6937 100644
2852     --- a/sound/soc/sunxi/sun4i-spdif.c
2853     +++ b/sound/soc/sunxi/sun4i-spdif.c
2854     @@ -403,14 +403,6 @@ static struct snd_soc_dai_driver sun4i_spdif_dai = {
2855     .name = "spdif",
2856     };
2857    
2858     -static const struct snd_soc_dapm_widget dit_widgets[] = {
2859     - SND_SOC_DAPM_OUTPUT("spdif-out"),
2860     -};
2861     -
2862     -static const struct snd_soc_dapm_route dit_routes[] = {
2863     - { "spdif-out", NULL, "Playback" },
2864     -};
2865     -
2866     static const struct of_device_id sun4i_spdif_of_match[] = {
2867     { .compatible = "allwinner,sun4i-a10-spdif", },
2868     { .compatible = "allwinner,sun6i-a31-spdif", },
2869     diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh
2870     index 5c495ad7958a..d8ac9ba67688 100755
2871     --- a/tools/testing/selftests/firmware/fw_filesystem.sh
2872     +++ b/tools/testing/selftests/firmware/fw_filesystem.sh
2873     @@ -48,18 +48,18 @@ echo "ABCD0123" >"$FW"
2874    
2875     NAME=$(basename "$FW")
2876    
2877     -if printf '\000' >"$DIR"/trigger_request; then
2878     +if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then
2879     echo "$0: empty filename should not succeed" >&2
2880     exit 1
2881     fi
2882    
2883     -if printf '\000' >"$DIR"/trigger_async_request; then
2884     +if printf '\000' >"$DIR"/trigger_async_request 2> /dev/null; then
2885     echo "$0: empty filename should not succeed (async)" >&2
2886     exit 1
2887     fi
2888    
2889     # Request a firmware that doesn't exist, it should fail.
2890     -if echo -n "nope-$NAME" >"$DIR"/trigger_request; then
2891     +if echo -n "nope-$NAME" >"$DIR"/trigger_request 2> /dev/null; then
2892     echo "$0: firmware shouldn't have loaded" >&2
2893     exit 1
2894     fi
2895     diff --git a/tools/testing/selftests/firmware/fw_userhelper.sh b/tools/testing/selftests/firmware/fw_userhelper.sh
2896     index b9983f8e09f6..01c626a1f226 100755
2897     --- a/tools/testing/selftests/firmware/fw_userhelper.sh
2898     +++ b/tools/testing/selftests/firmware/fw_userhelper.sh
2899     @@ -64,9 +64,33 @@ trap "test_finish" EXIT
2900     echo "ABCD0123" >"$FW"
2901     NAME=$(basename "$FW")
2902    
2903     +DEVPATH="$DIR"/"nope-$NAME"/loading
2904     +
2905     # Test failure when doing nothing (timeout works).
2906     -echo 1 >/sys/class/firmware/timeout
2907     -echo -n "$NAME" >"$DIR"/trigger_request
2908     +echo -n 2 >/sys/class/firmware/timeout
2909     +echo -n "nope-$NAME" >"$DIR"/trigger_request 2>/dev/null &
2910     +
2911     +# Give the kernel some time to load the loading file, must be less
2912     +# than the timeout above.
2913     +sleep 1
2914     +if [ ! -f $DEVPATH ]; then
2915     + echo "$0: fallback mechanism immediately cancelled"
2916     + echo ""
2917     + echo "The file never appeared: $DEVPATH"
2918     + echo ""
2919     + echo "This might be a distribution udev rule setup by your distribution"
2920     + echo "to immediately cancel all fallback requests, this must be"
2921     + echo "removed before running these tests. To confirm look for"
2922     + echo "a firmware rule like /lib/udev/rules.d/50-firmware.rules"
2923     + echo "and see if you have something like this:"
2924     + echo ""
2925     + echo "SUBSYSTEM==\"firmware\", ACTION==\"add\", ATTR{loading}=\"-1\""
2926     + echo ""
2927     + echo "If you do remove this file or comment out this line before"
2928     + echo "proceeding with these tests."
2929     + exit 1
2930     +fi
2931     +
2932     if diff -q "$FW" /dev/test_firmware >/dev/null ; then
2933     echo "$0: firmware was not expected to match" >&2
2934     exit 1