Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.4 commit in: /
Date: Wed, 15 Nov 2017 16:44:11
Message-Id: 1510764096.18f95728d58727052a448f88bf6af01466fa695e.alicef@gentoo
1 commit: 18f95728d58727052a448f88bf6af01466fa695e
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 15 16:41:36 2017 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 15 16:41:36 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=18f95728
7
8 linux kernel 4.4.98
9
10 0000_README | 4 +
11 1097_linux-4.4.98.patch | 1881 +++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 1885 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index cc06fad..ba7ec36 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -431,6 +431,10 @@ Patch: 1096_linux-4.4.97.patch
19 From: http://www.kernel.org
20 Desc: Linux 4.4.97
21
22 +Patch: 1097_linux-4.4.98.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 4.4.98
25 +
26 Patch: 1500_XATTR_USER_PREFIX.patch
27 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
28 Desc: Support for namespace user.pax.* on tmpfs.
29
30 diff --git a/1097_linux-4.4.98.patch b/1097_linux-4.4.98.patch
31 new file mode 100644
32 index 0000000..38d2d5f
33 --- /dev/null
34 +++ b/1097_linux-4.4.98.patch
35 @@ -0,0 +1,1881 @@
36 +diff --git a/Makefile b/Makefile
37 +index fb1a40d64ba8..5d62e23347f9 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,6 +1,6 @@
41 + VERSION = 4
42 + PATCHLEVEL = 4
43 +-SUBLEVEL = 97
44 ++SUBLEVEL = 98
45 + EXTRAVERSION =
46 + NAME = Blurry Fish Butt
47 +
48 +diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
49 +index c5e1943e5427..09ebd37e01e0 100644
50 +--- a/arch/arm/configs/omap2plus_defconfig
51 ++++ b/arch/arm/configs/omap2plus_defconfig
52 +@@ -221,6 +221,7 @@ CONFIG_SERIO=m
53 + CONFIG_SERIAL_8250=y
54 + CONFIG_SERIAL_8250_CONSOLE=y
55 + CONFIG_SERIAL_8250_NR_UARTS=32
56 ++CONFIG_SERIAL_8250_RUNTIME_UARTS=6
57 + CONFIG_SERIAL_8250_EXTENDED=y
58 + CONFIG_SERIAL_8250_MANY_PORTS=y
59 + CONFIG_SERIAL_8250_SHARE_IRQ=y
60 +diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
61 +index bc698383e822..c92b535150a0 100644
62 +--- a/arch/arm/kernel/traps.c
63 ++++ b/arch/arm/kernel/traps.c
64 +@@ -132,30 +132,26 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
65 + set_fs(fs);
66 + }
67 +
68 +-static void dump_instr(const char *lvl, struct pt_regs *regs)
69 ++static void __dump_instr(const char *lvl, struct pt_regs *regs)
70 + {
71 + unsigned long addr = instruction_pointer(regs);
72 + const int thumb = thumb_mode(regs);
73 + const int width = thumb ? 4 : 8;
74 +- mm_segment_t fs;
75 + char str[sizeof("00000000 ") * 5 + 2 + 1], *p = str;
76 + int i;
77 +
78 + /*
79 +- * We need to switch to kernel mode so that we can use __get_user
80 +- * to safely read from kernel space. Note that we now dump the
81 +- * code first, just in case the backtrace kills us.
82 ++ * Note that we now dump the code first, just in case the backtrace
83 ++ * kills us.
84 + */
85 +- fs = get_fs();
86 +- set_fs(KERNEL_DS);
87 +
88 + for (i = -4; i < 1 + !!thumb; i++) {
89 + unsigned int val, bad;
90 +
91 + if (thumb)
92 +- bad = __get_user(val, &((u16 *)addr)[i]);
93 ++ bad = get_user(val, &((u16 *)addr)[i]);
94 + else
95 +- bad = __get_user(val, &((u32 *)addr)[i]);
96 ++ bad = get_user(val, &((u32 *)addr)[i]);
97 +
98 + if (!bad)
99 + p += sprintf(p, i == 0 ? "(%0*x) " : "%0*x ",
100 +@@ -166,8 +162,20 @@ static void dump_instr(const char *lvl, struct pt_regs *regs)
101 + }
102 + }
103 + printk("%sCode: %s\n", lvl, str);
104 ++}
105 +
106 +- set_fs(fs);
107 ++static void dump_instr(const char *lvl, struct pt_regs *regs)
108 ++{
109 ++ mm_segment_t fs;
110 ++
111 ++ if (!user_mode(regs)) {
112 ++ fs = get_fs();
113 ++ set_fs(KERNEL_DS);
114 ++ __dump_instr(lvl, regs);
115 ++ set_fs(fs);
116 ++ } else {
117 ++ __dump_instr(lvl, regs);
118 ++ }
119 + }
120 +
121 + #ifdef CONFIG_ARM_UNWIND
122 +diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
123 +index 58fca9ad5fcc..3446b6fb3acb 100644
124 +--- a/arch/mips/ar7/platform.c
125 ++++ b/arch/mips/ar7/platform.c
126 +@@ -576,6 +576,7 @@ static int __init ar7_register_uarts(void)
127 + uart_port.type = PORT_AR7;
128 + uart_port.uartclk = clk_get_rate(bus_clk) / 2;
129 + uart_port.iotype = UPIO_MEM32;
130 ++ uart_port.flags = UPF_FIXED_TYPE;
131 + uart_port.regshift = 2;
132 +
133 + uart_port.line = 0;
134 +@@ -654,6 +655,10 @@ static int __init ar7_register_devices(void)
135 + u32 val;
136 + int res;
137 +
138 ++ res = ar7_gpio_init();
139 ++ if (res)
140 ++ pr_warn("unable to register gpios: %d\n", res);
141 ++
142 + res = ar7_register_uarts();
143 + if (res)
144 + pr_err("unable to setup uart(s): %d\n", res);
145 +diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
146 +index a23adc49d50f..36aabee9cba4 100644
147 +--- a/arch/mips/ar7/prom.c
148 ++++ b/arch/mips/ar7/prom.c
149 +@@ -246,8 +246,6 @@ void __init prom_init(void)
150 + ar7_init_cmdline(fw_arg0, (char **)fw_arg1);
151 + ar7_init_env((struct env_var *)fw_arg2);
152 + console_config();
153 +-
154 +- ar7_gpio_init();
155 + }
156 +
157 + #define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4)))
158 +diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h
159 +index 6516e9da5133..b836ddec82b7 100644
160 +--- a/arch/mips/include/asm/mips-cm.h
161 ++++ b/arch/mips/include/asm/mips-cm.h
162 +@@ -238,8 +238,8 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80)
163 + #define CM_GCR_BASE_GCRBASE_MSK (_ULCAST_(0x1ffff) << 15)
164 + #define CM_GCR_BASE_CMDEFTGT_SHF 0
165 + #define CM_GCR_BASE_CMDEFTGT_MSK (_ULCAST_(0x3) << 0)
166 +-#define CM_GCR_BASE_CMDEFTGT_DISABLED 0
167 +-#define CM_GCR_BASE_CMDEFTGT_MEM 1
168 ++#define CM_GCR_BASE_CMDEFTGT_MEM 0
169 ++#define CM_GCR_BASE_CMDEFTGT_RESERVED 1
170 + #define CM_GCR_BASE_CMDEFTGT_IOCU0 2
171 + #define CM_GCR_BASE_CMDEFTGT_IOCU1 3
172 +
173 +diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
174 +index 477ba026c3e5..163b3449a8de 100644
175 +--- a/arch/mips/kernel/process.c
176 ++++ b/arch/mips/kernel/process.c
177 +@@ -49,9 +49,7 @@
178 + #ifdef CONFIG_HOTPLUG_CPU
179 + void arch_cpu_idle_dead(void)
180 + {
181 +- /* What the heck is this check doing ? */
182 +- if (!cpumask_test_cpu(smp_processor_id(), &cpu_callin_map))
183 +- play_dead();
184 ++ play_dead();
185 + }
186 + #endif
187 +
188 +diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
189 +index 7fef02a9eb85..4af08c197177 100644
190 +--- a/arch/mips/kernel/smp.c
191 ++++ b/arch/mips/kernel/smp.c
192 +@@ -64,6 +64,9 @@ EXPORT_SYMBOL(cpu_sibling_map);
193 + cpumask_t cpu_core_map[NR_CPUS] __read_mostly;
194 + EXPORT_SYMBOL(cpu_core_map);
195 +
196 ++static DECLARE_COMPLETION(cpu_starting);
197 ++static DECLARE_COMPLETION(cpu_running);
198 ++
199 + /*
200 + * A logcal cpu mask containing only one VPE per core to
201 + * reduce the number of IPIs on large MT systems.
202 +@@ -174,9 +177,12 @@ asmlinkage void start_secondary(void)
203 + cpumask_set_cpu(cpu, &cpu_coherent_mask);
204 + notify_cpu_starting(cpu);
205 +
206 +- cpumask_set_cpu(cpu, &cpu_callin_map);
207 ++ /* Notify boot CPU that we're starting & ready to sync counters */
208 ++ complete(&cpu_starting);
209 ++
210 + synchronise_count_slave(cpu);
211 +
212 ++ /* The CPU is running and counters synchronised, now mark it online */
213 + set_cpu_online(cpu, true);
214 +
215 + set_cpu_sibling_map(cpu);
216 +@@ -184,6 +190,12 @@ asmlinkage void start_secondary(void)
217 +
218 + calculate_cpu_foreign_map();
219 +
220 ++ /*
221 ++ * Notify boot CPU that we're up & online and it can safely return
222 ++ * from __cpu_up
223 ++ */
224 ++ complete(&cpu_running);
225 ++
226 + /*
227 + * irq will be enabled in ->smp_finish(), enabling it too early
228 + * is dangerous.
229 +@@ -242,22 +254,23 @@ void smp_prepare_boot_cpu(void)
230 + {
231 + set_cpu_possible(0, true);
232 + set_cpu_online(0, true);
233 +- cpumask_set_cpu(0, &cpu_callin_map);
234 + }
235 +
236 + int __cpu_up(unsigned int cpu, struct task_struct *tidle)
237 + {
238 + mp_ops->boot_secondary(cpu, tidle);
239 +
240 +- /*
241 +- * Trust is futile. We should really have timeouts ...
242 +- */
243 +- while (!cpumask_test_cpu(cpu, &cpu_callin_map)) {
244 +- udelay(100);
245 +- schedule();
246 ++ /* Wait for CPU to start and be ready to sync counters */
247 ++ if (!wait_for_completion_timeout(&cpu_starting,
248 ++ msecs_to_jiffies(1000))) {
249 ++ pr_crit("CPU%u: failed to start\n", cpu);
250 ++ return -EIO;
251 + }
252 +
253 + synchronise_count_master(cpu);
254 ++
255 ++ /* Wait for CPU to finish startup & mark itself online before return */
256 ++ wait_for_completion(&cpu_running);
257 + return 0;
258 + }
259 +
260 +diff --git a/arch/mips/mm/uasm-micromips.c b/arch/mips/mm/uasm-micromips.c
261 +index d78178daea4b..e2fe48dd67b5 100644
262 +--- a/arch/mips/mm/uasm-micromips.c
263 ++++ b/arch/mips/mm/uasm-micromips.c
264 +@@ -75,7 +75,7 @@ static struct insn insn_table_MM[] = {
265 + { insn_jr, M(mm_pool32a_op, 0, 0, 0, mm_jalr_op, mm_pool32axf_op), RS },
266 + { insn_lb, M(mm_lb32_op, 0, 0, 0, 0, 0), RT | RS | SIMM },
267 + { insn_ld, 0, 0 },
268 +- { insn_lh, M(mm_lh32_op, 0, 0, 0, 0, 0), RS | RS | SIMM },
269 ++ { insn_lh, M(mm_lh32_op, 0, 0, 0, 0, 0), RT | RS | SIMM },
270 + { insn_ll, M(mm_pool32c_op, 0, 0, (mm_ll_func << 1), 0, 0), RS | RT | SIMM },
271 + { insn_lld, 0, 0 },
272 + { insn_lui, M(mm_pool32i_op, mm_lui_op, 0, 0, 0, 0), RS | SIMM },
273 +diff --git a/arch/powerpc/boot/dts/fsl/kmcoge4.dts b/arch/powerpc/boot/dts/fsl/kmcoge4.dts
274 +index 6858ec9ef295..1a953d9edf1e 100644
275 +--- a/arch/powerpc/boot/dts/fsl/kmcoge4.dts
276 ++++ b/arch/powerpc/boot/dts/fsl/kmcoge4.dts
277 +@@ -83,6 +83,10 @@
278 + };
279 + };
280 +
281 ++ sdhc@114000 {
282 ++ status = "disabled";
283 ++ };
284 ++
285 + i2c@119000 {
286 + status = "disabled";
287 + };
288 +diff --git a/arch/powerpc/kvm/book3s_hv_rm_xics.c b/arch/powerpc/kvm/book3s_hv_rm_xics.c
289 +index 24f58076d49e..1d2bc84338bf 100644
290 +--- a/arch/powerpc/kvm/book3s_hv_rm_xics.c
291 ++++ b/arch/powerpc/kvm/book3s_hv_rm_xics.c
292 +@@ -280,6 +280,7 @@ static void icp_rm_deliver_irq(struct kvmppc_xics *xics, struct kvmppc_icp *icp,
293 + */
294 + if (reject && reject != XICS_IPI) {
295 + arch_spin_unlock(&ics->lock);
296 ++ icp->n_reject++;
297 + new_irq = reject;
298 + goto again;
299 + }
300 +@@ -611,10 +612,8 @@ int kvmppc_rm_h_eoi(struct kvm_vcpu *vcpu, unsigned long xirr)
301 + state = &ics->irq_state[src];
302 +
303 + /* Still asserted, resend it */
304 +- if (state->asserted) {
305 +- icp->n_reject++;
306 ++ if (state->asserted)
307 + icp_rm_deliver_irq(xics, icp, irq);
308 +- }
309 +
310 + if (!hlist_empty(&vcpu->kvm->irq_ack_notifier_list)) {
311 + icp->rm_action |= XICS_RM_NOTIFY_EOI;
312 +diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
313 +index 538c10db3537..8dc315b212c2 100644
314 +--- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c
315 ++++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
316 +@@ -165,7 +165,6 @@ static struct plat_sci_port scif2_platform_data = {
317 + .scscr = SCSCR_TE | SCSCR_RE,
318 + .type = PORT_IRDA,
319 + .ops = &sh770x_sci_port_ops,
320 +- .regshift = 1,
321 + };
322 +
323 + static struct resource scif2_resources[] = {
324 +diff --git a/arch/x86/crypto/sha-mb/sha1_mb_mgr_flush_avx2.S b/arch/x86/crypto/sha-mb/sha1_mb_mgr_flush_avx2.S
325 +index 85c4e1cf7172..e1693457c178 100644
326 +--- a/arch/x86/crypto/sha-mb/sha1_mb_mgr_flush_avx2.S
327 ++++ b/arch/x86/crypto/sha-mb/sha1_mb_mgr_flush_avx2.S
328 +@@ -174,8 +174,8 @@ LABEL skip_ %I
329 + .endr
330 +
331 + # Find min length
332 +- vmovdqa _lens+0*16(state), %xmm0
333 +- vmovdqa _lens+1*16(state), %xmm1
334 ++ vmovdqu _lens+0*16(state), %xmm0
335 ++ vmovdqu _lens+1*16(state), %xmm1
336 +
337 + vpminud %xmm1, %xmm0, %xmm2 # xmm2 has {D,C,B,A}
338 + vpalignr $8, %xmm2, %xmm3, %xmm3 # xmm3 has {x,x,D,C}
339 +@@ -195,8 +195,8 @@ LABEL skip_ %I
340 + vpsubd %xmm2, %xmm0, %xmm0
341 + vpsubd %xmm2, %xmm1, %xmm1
342 +
343 +- vmovdqa %xmm0, _lens+0*16(state)
344 +- vmovdqa %xmm1, _lens+1*16(state)
345 ++ vmovdqu %xmm0, _lens+0*16(state)
346 ++ vmovdqu %xmm1, _lens+1*16(state)
347 +
348 + # "state" and "args" are the same address, arg1
349 + # len is arg2
350 +@@ -260,8 +260,8 @@ ENTRY(sha1_mb_mgr_get_comp_job_avx2)
351 + jc .return_null
352 +
353 + # Find min length
354 +- vmovdqa _lens(state), %xmm0
355 +- vmovdqa _lens+1*16(state), %xmm1
356 ++ vmovdqu _lens(state), %xmm0
357 ++ vmovdqu _lens+1*16(state), %xmm1
358 +
359 + vpminud %xmm1, %xmm0, %xmm2 # xmm2 has {D,C,B,A}
360 + vpalignr $8, %xmm2, %xmm3, %xmm3 # xmm3 has {x,x,D,C}
361 +diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
362 +index b8c75f3aade8..d788b0cdc0ad 100644
363 +--- a/arch/x86/include/asm/uaccess.h
364 ++++ b/arch/x86/include/asm/uaccess.h
365 +@@ -7,6 +7,7 @@
366 + #include <linux/compiler.h>
367 + #include <linux/thread_info.h>
368 + #include <linux/string.h>
369 ++#include <linux/preempt.h>
370 + #include <asm/asm.h>
371 + #include <asm/page.h>
372 + #include <asm/smap.h>
373 +@@ -66,6 +67,12 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
374 + __chk_range_not_ok((unsigned long __force)(addr), size, limit); \
375 + })
376 +
377 ++#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
378 ++# define WARN_ON_IN_IRQ() WARN_ON_ONCE(!in_task())
379 ++#else
380 ++# define WARN_ON_IN_IRQ()
381 ++#endif
382 ++
383 + /**
384 + * access_ok: - Checks if a user space pointer is valid
385 + * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE. Note that
386 +@@ -86,8 +93,11 @@ static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, un
387 + * checks that the pointer is in the user space range - after calling
388 + * this function, memory access functions may still return -EFAULT.
389 + */
390 +-#define access_ok(type, addr, size) \
391 +- likely(!__range_not_ok(addr, size, user_addr_max()))
392 ++#define access_ok(type, addr, size) \
393 ++({ \
394 ++ WARN_ON_IN_IRQ(); \
395 ++ likely(!__range_not_ok(addr, size, user_addr_max())); \
396 ++})
397 +
398 + /*
399 + * The exception table consists of pairs of addresses relative to the
400 +diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c
401 +index d90528ea5412..12c051d19e4b 100644
402 +--- a/arch/x86/oprofile/op_model_ppro.c
403 ++++ b/arch/x86/oprofile/op_model_ppro.c
404 +@@ -212,8 +212,8 @@ static void arch_perfmon_setup_counters(void)
405 + eax.full = cpuid_eax(0xa);
406 +
407 + /* Workaround for BIOS bugs in 6/15. Taken from perfmon2 */
408 +- if (eax.split.version_id == 0 && __this_cpu_read(cpu_info.x86) == 6 &&
409 +- __this_cpu_read(cpu_info.x86_model) == 15) {
410 ++ if (eax.split.version_id == 0 && boot_cpu_data.x86 == 6 &&
411 ++ boot_cpu_data.x86_model == 15) {
412 + eax.split.version_id = 2;
413 + eax.split.num_counters = 2;
414 + eax.split.bit_width = 40;
415 +diff --git a/crypto/asymmetric_keys/pkcs7_parser.c b/crypto/asymmetric_keys/pkcs7_parser.c
416 +index 2516e97c58f1..5e5a8adac0ba 100644
417 +--- a/crypto/asymmetric_keys/pkcs7_parser.c
418 ++++ b/crypto/asymmetric_keys/pkcs7_parser.c
419 +@@ -87,7 +87,7 @@ EXPORT_SYMBOL_GPL(pkcs7_free_message);
420 + static int pkcs7_check_authattrs(struct pkcs7_message *msg)
421 + {
422 + struct pkcs7_signed_info *sinfo;
423 +- bool want;
424 ++ bool want = false;
425 +
426 + sinfo = msg->signed_infos;
427 + if (!sinfo)
428 +diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
429 +index fbdddd6f94b8..ca3bcc81b623 100644
430 +--- a/drivers/block/rbd.c
431 ++++ b/drivers/block/rbd.c
432 +@@ -2736,7 +2736,7 @@ static int rbd_img_obj_parent_read_full(struct rbd_obj_request *obj_request)
433 + * from the parent.
434 + */
435 + page_count = (u32)calc_pages_for(0, length);
436 +- pages = ceph_alloc_page_vector(page_count, GFP_KERNEL);
437 ++ pages = ceph_alloc_page_vector(page_count, GFP_NOIO);
438 + if (IS_ERR(pages)) {
439 + result = PTR_ERR(pages);
440 + pages = NULL;
441 +@@ -2863,7 +2863,7 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
442 + */
443 + size = sizeof (__le64) + sizeof (__le32) + sizeof (__le32);
444 + page_count = (u32)calc_pages_for(0, size);
445 +- pages = ceph_alloc_page_vector(page_count, GFP_KERNEL);
446 ++ pages = ceph_alloc_page_vector(page_count, GFP_NOIO);
447 + if (IS_ERR(pages))
448 + return PTR_ERR(pages);
449 +
450 +diff --git a/drivers/crypto/vmx/aes_ctr.c b/drivers/crypto/vmx/aes_ctr.c
451 +index 72f138985e18..d83ab4bac8b1 100644
452 +--- a/drivers/crypto/vmx/aes_ctr.c
453 ++++ b/drivers/crypto/vmx/aes_ctr.c
454 +@@ -80,11 +80,13 @@ static int p8_aes_ctr_setkey(struct crypto_tfm *tfm, const u8 *key,
455 + int ret;
456 + struct p8_aes_ctr_ctx *ctx = crypto_tfm_ctx(tfm);
457 +
458 ++ preempt_disable();
459 + pagefault_disable();
460 + enable_kernel_altivec();
461 + enable_kernel_vsx();
462 + ret = aes_p8_set_encrypt_key(key, keylen * 8, &ctx->enc_key);
463 + pagefault_enable();
464 ++ preempt_enable();
465 +
466 + ret += crypto_blkcipher_setkey(ctx->fallback, key, keylen);
467 + return ret;
468 +@@ -99,11 +101,13 @@ static void p8_aes_ctr_final(struct p8_aes_ctr_ctx *ctx,
469 + u8 *dst = walk->dst.virt.addr;
470 + unsigned int nbytes = walk->nbytes;
471 +
472 ++ preempt_disable();
473 + pagefault_disable();
474 + enable_kernel_altivec();
475 + enable_kernel_vsx();
476 + aes_p8_encrypt(ctrblk, keystream, &ctx->enc_key);
477 + pagefault_enable();
478 ++ preempt_enable();
479 +
480 + crypto_xor(keystream, src, nbytes);
481 + memcpy(dst, keystream, nbytes);
482 +@@ -132,6 +136,7 @@ static int p8_aes_ctr_crypt(struct blkcipher_desc *desc,
483 + blkcipher_walk_init(&walk, dst, src, nbytes);
484 + ret = blkcipher_walk_virt_block(desc, &walk, AES_BLOCK_SIZE);
485 + while ((nbytes = walk.nbytes) >= AES_BLOCK_SIZE) {
486 ++ preempt_disable();
487 + pagefault_disable();
488 + enable_kernel_altivec();
489 + enable_kernel_vsx();
490 +@@ -143,6 +148,7 @@ static int p8_aes_ctr_crypt(struct blkcipher_desc *desc,
491 + &ctx->enc_key,
492 + walk.iv);
493 + pagefault_enable();
494 ++ preempt_enable();
495 +
496 + /* We need to update IV mostly for last bytes/round */
497 + inc = (nbytes & AES_BLOCK_MASK) / AES_BLOCK_SIZE;
498 +diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
499 +index 7dd6728dd092..ccc2044af831 100644
500 +--- a/drivers/gpu/drm/drm_drv.c
501 ++++ b/drivers/gpu/drm/drm_drv.c
502 +@@ -312,7 +312,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
503 + ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root);
504 + if (ret) {
505 + DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n");
506 +- return ret;
507 ++ goto err_debugfs;
508 + }
509 +
510 + ret = device_add(minor->kdev);
511 +diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
512 +index f3f31f995878..be3971b22a02 100644
513 +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
514 ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
515 +@@ -708,7 +708,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
516 + * allocation taken by fbdev
517 + */
518 + if (!(dev_priv->capabilities & SVGA_CAP_3D))
519 +- mem_size *= 2;
520 ++ mem_size *= 3;
521 +
522 + dev_priv->max_mob_pages = mem_size * 1024 / PAGE_SIZE;
523 + dev_priv->prim_bb_mem =
524 +diff --git a/drivers/iio/trigger/iio-trig-interrupt.c b/drivers/iio/trigger/iio-trig-interrupt.c
525 +index 572bc6f02ca8..e18f12b74610 100644
526 +--- a/drivers/iio/trigger/iio-trig-interrupt.c
527 ++++ b/drivers/iio/trigger/iio-trig-interrupt.c
528 +@@ -58,7 +58,7 @@ static int iio_interrupt_trigger_probe(struct platform_device *pdev)
529 + trig_info = kzalloc(sizeof(*trig_info), GFP_KERNEL);
530 + if (!trig_info) {
531 + ret = -ENOMEM;
532 +- goto error_put_trigger;
533 ++ goto error_free_trigger;
534 + }
535 + iio_trigger_set_drvdata(trig, trig_info);
536 + trig_info->irq = irq;
537 +@@ -83,8 +83,8 @@ error_release_irq:
538 + free_irq(irq, trig);
539 + error_free_trig_info:
540 + kfree(trig_info);
541 +-error_put_trigger:
542 +- iio_trigger_put(trig);
543 ++error_free_trigger:
544 ++ iio_trigger_free(trig);
545 + error_ret:
546 + return ret;
547 + }
548 +@@ -99,7 +99,7 @@ static int iio_interrupt_trigger_remove(struct platform_device *pdev)
549 + iio_trigger_unregister(trig);
550 + free_irq(trig_info->irq, trig);
551 + kfree(trig_info);
552 +- iio_trigger_put(trig);
553 ++ iio_trigger_free(trig);
554 +
555 + return 0;
556 + }
557 +diff --git a/drivers/iio/trigger/iio-trig-sysfs.c b/drivers/iio/trigger/iio-trig-sysfs.c
558 +index 3dfab2bc6d69..202e8b89caf2 100644
559 +--- a/drivers/iio/trigger/iio-trig-sysfs.c
560 ++++ b/drivers/iio/trigger/iio-trig-sysfs.c
561 +@@ -174,7 +174,7 @@ static int iio_sysfs_trigger_probe(int id)
562 + return 0;
563 +
564 + out2:
565 +- iio_trigger_put(t->trig);
566 ++ iio_trigger_free(t->trig);
567 + free_t:
568 + kfree(t);
569 + out1:
570 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
571 +index 2018d24344de..f74b11542603 100644
572 +--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
573 ++++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
574 +@@ -1373,7 +1373,7 @@ static void ipoib_cm_tx_reap(struct work_struct *work)
575 +
576 + while (!list_empty(&priv->cm.reap_list)) {
577 + p = list_entry(priv->cm.reap_list.next, typeof(*p), list);
578 +- list_del(&p->list);
579 ++ list_del_init(&p->list);
580 + spin_unlock_irqrestore(&priv->lock, flags);
581 + netif_tx_unlock_bh(dev);
582 + ipoib_cm_tx_destroy(p);
583 +diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c
584 +index 0fd612dd76ed..aaf43befffaa 100644
585 +--- a/drivers/input/keyboard/mpr121_touchkey.c
586 ++++ b/drivers/input/keyboard/mpr121_touchkey.c
587 +@@ -87,7 +87,8 @@ static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
588 + struct mpr121_touchkey *mpr121 = dev_id;
589 + struct i2c_client *client = mpr121->client;
590 + struct input_dev *input = mpr121->input_dev;
591 +- unsigned int key_num, key_val, pressed;
592 ++ unsigned long bit_changed;
593 ++ unsigned int key_num;
594 + int reg;
595 +
596 + reg = i2c_smbus_read_byte_data(client, ELE_TOUCH_STATUS_1_ADDR);
597 +@@ -105,18 +106,22 @@ static irqreturn_t mpr_touchkey_interrupt(int irq, void *dev_id)
598 +
599 + reg &= TOUCH_STATUS_MASK;
600 + /* use old press bit to figure out which bit changed */
601 +- key_num = ffs(reg ^ mpr121->statusbits) - 1;
602 +- pressed = reg & (1 << key_num);
603 ++ bit_changed = reg ^ mpr121->statusbits;
604 + mpr121->statusbits = reg;
605 ++ for_each_set_bit(key_num, &bit_changed, mpr121->keycount) {
606 ++ unsigned int key_val, pressed;
607 +
608 +- key_val = mpr121->keycodes[key_num];
609 ++ pressed = reg & BIT(key_num);
610 ++ key_val = mpr121->keycodes[key_num];
611 +
612 +- input_event(input, EV_MSC, MSC_SCAN, key_num);
613 +- input_report_key(input, key_val, pressed);
614 +- input_sync(input);
615 ++ input_event(input, EV_MSC, MSC_SCAN, key_num);
616 ++ input_report_key(input, key_val, pressed);
617 ++
618 ++ dev_dbg(&client->dev, "key %d %d %s\n", key_num, key_val,
619 ++ pressed ? "pressed" : "released");
620 +
621 +- dev_dbg(&client->dev, "key %d %d %s\n", key_num, key_val,
622 +- pressed ? "pressed" : "released");
623 ++ }
624 ++ input_sync(input);
625 +
626 + out:
627 + return IRQ_HANDLED;
628 +@@ -231,6 +236,7 @@ static int mpr_touchkey_probe(struct i2c_client *client,
629 + input_dev->id.bustype = BUS_I2C;
630 + input_dev->dev.parent = &client->dev;
631 + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
632 ++ input_set_capability(input_dev, EV_MSC, MSC_SCAN);
633 +
634 + input_dev->keycode = mpr121->keycodes;
635 + input_dev->keycodesize = sizeof(mpr121->keycodes[0]);
636 +diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
637 +index b8c50d883b2c..c9d491bc85e0 100644
638 +--- a/drivers/input/mouse/elan_i2c_core.c
639 ++++ b/drivers/input/mouse/elan_i2c_core.c
640 +@@ -1240,6 +1240,7 @@ static const struct acpi_device_id elan_acpi_id[] = {
641 + { "ELAN0605", 0 },
642 + { "ELAN0609", 0 },
643 + { "ELAN060B", 0 },
644 ++ { "ELAN060C", 0 },
645 + { "ELAN0611", 0 },
646 + { "ELAN1000", 0 },
647 + { }
648 +diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
649 +index 00df3832faab..64f1eb8fdcbc 100644
650 +--- a/drivers/iommu/arm-smmu-v3.c
651 ++++ b/drivers/iommu/arm-smmu-v3.c
652 +@@ -1033,13 +1033,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_device *smmu, u32 sid,
653 + }
654 + }
655 +
656 +- /* Nuke the existing Config, as we're going to rewrite it */
657 +- val &= ~(STRTAB_STE_0_CFG_MASK << STRTAB_STE_0_CFG_SHIFT);
658 +-
659 +- if (ste->valid)
660 +- val |= STRTAB_STE_0_V;
661 +- else
662 +- val &= ~STRTAB_STE_0_V;
663 ++ /* Nuke the existing STE_0 value, as we're going to rewrite it */
664 ++ val = ste->valid ? STRTAB_STE_0_V : 0;
665 +
666 + if (ste->bypass) {
667 + val |= disable_bypass ? STRTAB_STE_0_CFG_ABORT
668 +@@ -1068,7 +1063,6 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_device *smmu, u32 sid,
669 + val |= (ste->s1_cfg->cdptr_dma & STRTAB_STE_0_S1CTXPTR_MASK
670 + << STRTAB_STE_0_S1CTXPTR_SHIFT) |
671 + STRTAB_STE_0_CFG_S1_TRANS;
672 +-
673 + }
674 +
675 + if (ste->s2_cfg) {
676 +diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
677 +index 01adcdc52346..a9e2722f5e22 100644
678 +--- a/drivers/media/i2c/adv7604.c
679 ++++ b/drivers/media/i2c/adv7604.c
680 +@@ -2856,6 +2856,9 @@ static int adv76xx_parse_dt(struct adv76xx_state *state)
681 + state->pdata.alt_data_sat = 1;
682 + state->pdata.op_format_mode_sel = ADV7604_OP_FORMAT_MODE0;
683 + state->pdata.bus_order = ADV7604_BUS_ORDER_RGB;
684 ++ state->pdata.dr_str_data = ADV76XX_DR_STR_MEDIUM_HIGH;
685 ++ state->pdata.dr_str_clk = ADV76XX_DR_STR_MEDIUM_HIGH;
686 ++ state->pdata.dr_str_sync = ADV76XX_DR_STR_MEDIUM_HIGH;
687 +
688 + return 0;
689 + }
690 +diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c
691 +index cf7c18947189..d065c0e2d18e 100644
692 +--- a/drivers/net/can/c_can/c_can_pci.c
693 ++++ b/drivers/net/can/c_can/c_can_pci.c
694 +@@ -178,7 +178,6 @@ static int c_can_pci_probe(struct pci_dev *pdev,
695 + break;
696 + case BOSCH_D_CAN:
697 + priv->regs = reg_map_d_can;
698 +- priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
699 + break;
700 + default:
701 + ret = -EINVAL;
702 +diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
703 +index e36d10520e24..717530eac70c 100644
704 +--- a/drivers/net/can/c_can/c_can_platform.c
705 ++++ b/drivers/net/can/c_can/c_can_platform.c
706 +@@ -320,7 +320,6 @@ static int c_can_plat_probe(struct platform_device *pdev)
707 + break;
708 + case BOSCH_D_CAN:
709 + priv->regs = reg_map_d_can;
710 +- priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
711 + priv->read_reg = c_can_plat_read_reg_aligned_to_16bit;
712 + priv->write_reg = c_can_plat_write_reg_aligned_to_16bit;
713 + priv->read_reg32 = d_can_plat_read_reg32;
714 +diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c
715 +index b0c80859f746..1ac2090a1721 100644
716 +--- a/drivers/net/can/sun4i_can.c
717 ++++ b/drivers/net/can/sun4i_can.c
718 +@@ -539,6 +539,13 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status)
719 + }
720 + stats->rx_over_errors++;
721 + stats->rx_errors++;
722 ++
723 ++ /* reset the CAN IP by entering reset mode
724 ++ * ignoring timeout error
725 ++ */
726 ++ set_reset_mode(dev);
727 ++ set_normal_mode(dev);
728 ++
729 + /* clear bit */
730 + sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG);
731 + }
732 +@@ -653,8 +660,9 @@ static irqreturn_t sun4i_can_interrupt(int irq, void *dev_id)
733 + netif_wake_queue(dev);
734 + can_led_event(dev, CAN_LED_EVENT_TX);
735 + }
736 +- if (isrc & SUN4I_INT_RBUF_VLD) {
737 +- /* receive interrupt */
738 ++ if ((isrc & SUN4I_INT_RBUF_VLD) &&
739 ++ !(isrc & SUN4I_INT_DATA_OR)) {
740 ++ /* receive interrupt - don't read if overrun occurred */
741 + while (status & SUN4I_STA_RBUF_RDY) {
742 + /* RX buffer is not empty */
743 + sun4i_can_rx(dev);
744 +diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
745 +index e0e94b855bbe..1228d0da4075 100644
746 +--- a/drivers/net/usb/cdc_ncm.c
747 ++++ b/drivers/net/usb/cdc_ncm.c
748 +@@ -724,8 +724,10 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
749 + u8 *buf;
750 + int len;
751 + int temp;
752 ++ int err;
753 + u8 iface_no;
754 + struct usb_cdc_parsed_header hdr;
755 ++ u16 curr_ntb_format;
756 +
757 + ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
758 + if (!ctx)
759 +@@ -823,6 +825,32 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
760 + goto error2;
761 + }
762 +
763 ++ /*
764 ++ * Some Huawei devices have been observed to come out of reset in NDP32 mode.
765 ++ * Let's check if this is the case, and set the device to NDP16 mode again if
766 ++ * needed.
767 ++ */
768 ++ if (ctx->drvflags & CDC_NCM_FLAG_RESET_NTB16) {
769 ++ err = usbnet_read_cmd(dev, USB_CDC_GET_NTB_FORMAT,
770 ++ USB_TYPE_CLASS | USB_DIR_IN | USB_RECIP_INTERFACE,
771 ++ 0, iface_no, &curr_ntb_format, 2);
772 ++ if (err < 0) {
773 ++ goto error2;
774 ++ }
775 ++
776 ++ if (curr_ntb_format == USB_CDC_NCM_NTB32_FORMAT) {
777 ++ dev_info(&intf->dev, "resetting NTB format to 16-bit");
778 ++ err = usbnet_write_cmd(dev, USB_CDC_SET_NTB_FORMAT,
779 ++ USB_TYPE_CLASS | USB_DIR_OUT
780 ++ | USB_RECIP_INTERFACE,
781 ++ USB_CDC_NCM_NTB16_FORMAT,
782 ++ iface_no, NULL, 0);
783 ++
784 ++ if (err < 0)
785 ++ goto error2;
786 ++ }
787 ++ }
788 ++
789 + cdc_ncm_find_endpoints(dev, ctx->data);
790 + cdc_ncm_find_endpoints(dev, ctx->control);
791 + if (!dev->in || !dev->out || !dev->status) {
792 +diff --git a/drivers/net/usb/huawei_cdc_ncm.c b/drivers/net/usb/huawei_cdc_ncm.c
793 +index 2680a65cd5e4..63f28908afda 100644
794 +--- a/drivers/net/usb/huawei_cdc_ncm.c
795 ++++ b/drivers/net/usb/huawei_cdc_ncm.c
796 +@@ -80,6 +80,12 @@ static int huawei_cdc_ncm_bind(struct usbnet *usbnet_dev,
797 + * be at the end of the frame.
798 + */
799 + drvflags |= CDC_NCM_FLAG_NDP_TO_END;
800 ++
801 ++ /* Additionally, it has been reported that some Huawei E3372H devices, with
802 ++ * firmware version 21.318.01.00.541, come out of reset in NTB32 format mode, hence
803 ++ * needing to be set to the NTB16 one again.
804 ++ */
805 ++ drvflags |= CDC_NCM_FLAG_RESET_NTB16;
806 + ret = cdc_ncm_bind_common(usbnet_dev, intf, 1, drvflags);
807 + if (ret)
808 + goto err;
809 +diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
810 +index 72ee1c305cc4..02db20b26749 100644
811 +--- a/drivers/net/xen-netback/netback.c
812 ++++ b/drivers/net/xen-netback/netback.c
813 +@@ -67,6 +67,7 @@ module_param(rx_drain_timeout_msecs, uint, 0444);
814 + unsigned int rx_stall_timeout_msecs = 60000;
815 + module_param(rx_stall_timeout_msecs, uint, 0444);
816 +
817 ++#define MAX_QUEUES_DEFAULT 8
818 + unsigned int xenvif_max_queues;
819 + module_param_named(max_queues, xenvif_max_queues, uint, 0644);
820 + MODULE_PARM_DESC(max_queues,
821 +@@ -2157,11 +2158,12 @@ static int __init netback_init(void)
822 + if (!xen_domain())
823 + return -ENODEV;
824 +
825 +- /* Allow as many queues as there are CPUs if user has not
826 ++ /* Allow as many queues as there are CPUs but max. 8 if user has not
827 + * specified a value.
828 + */
829 + if (xenvif_max_queues == 0)
830 +- xenvif_max_queues = num_online_cpus();
831 ++ xenvif_max_queues = min_t(unsigned int, MAX_QUEUES_DEFAULT,
832 ++ num_online_cpus());
833 +
834 + if (fatal_skb_slots < XEN_NETBK_LEGACY_SLOTS_MAX) {
835 + pr_info("fatal_skb_slots too small (%d), bump it to XEN_NETBK_LEGACY_SLOTS_MAX (%d)\n",
836 +diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
837 +index 53b79c5f0559..379d08f76146 100644
838 +--- a/drivers/pci/host/pci-mvebu.c
839 ++++ b/drivers/pci/host/pci-mvebu.c
840 +@@ -131,6 +131,12 @@ struct mvebu_pcie {
841 + int nports;
842 + };
843 +
844 ++struct mvebu_pcie_window {
845 ++ phys_addr_t base;
846 ++ phys_addr_t remap;
847 ++ size_t size;
848 ++};
849 ++
850 + /* Structure representing one PCIe interface */
851 + struct mvebu_pcie_port {
852 + char *name;
853 +@@ -148,10 +154,8 @@ struct mvebu_pcie_port {
854 + struct mvebu_sw_pci_bridge bridge;
855 + struct device_node *dn;
856 + struct mvebu_pcie *pcie;
857 +- phys_addr_t memwin_base;
858 +- size_t memwin_size;
859 +- phys_addr_t iowin_base;
860 +- size_t iowin_size;
861 ++ struct mvebu_pcie_window memwin;
862 ++ struct mvebu_pcie_window iowin;
863 + u32 saved_pcie_stat;
864 + };
865 +
866 +@@ -377,23 +381,45 @@ static void mvebu_pcie_add_windows(struct mvebu_pcie_port *port,
867 + }
868 + }
869 +
870 ++static void mvebu_pcie_set_window(struct mvebu_pcie_port *port,
871 ++ unsigned int target, unsigned int attribute,
872 ++ const struct mvebu_pcie_window *desired,
873 ++ struct mvebu_pcie_window *cur)
874 ++{
875 ++ if (desired->base == cur->base && desired->remap == cur->remap &&
876 ++ desired->size == cur->size)
877 ++ return;
878 ++
879 ++ if (cur->size != 0) {
880 ++ mvebu_pcie_del_windows(port, cur->base, cur->size);
881 ++ cur->size = 0;
882 ++ cur->base = 0;
883 ++
884 ++ /*
885 ++ * If something tries to change the window while it is enabled
886 ++ * the change will not be done atomically. That would be
887 ++ * difficult to do in the general case.
888 ++ */
889 ++ }
890 ++
891 ++ if (desired->size == 0)
892 ++ return;
893 ++
894 ++ mvebu_pcie_add_windows(port, target, attribute, desired->base,
895 ++ desired->size, desired->remap);
896 ++ *cur = *desired;
897 ++}
898 ++
899 + static void mvebu_pcie_handle_iobase_change(struct mvebu_pcie_port *port)
900 + {
901 +- phys_addr_t iobase;
902 ++ struct mvebu_pcie_window desired = {};
903 +
904 + /* Are the new iobase/iolimit values invalid? */
905 + if (port->bridge.iolimit < port->bridge.iobase ||
906 + port->bridge.iolimitupper < port->bridge.iobaseupper ||
907 + !(port->bridge.command & PCI_COMMAND_IO)) {
908 +-
909 +- /* If a window was configured, remove it */
910 +- if (port->iowin_base) {
911 +- mvebu_pcie_del_windows(port, port->iowin_base,
912 +- port->iowin_size);
913 +- port->iowin_base = 0;
914 +- port->iowin_size = 0;
915 +- }
916 +-
917 ++ mvebu_pcie_set_window(port, port->io_target, port->io_attr,
918 ++ &desired, &port->iowin);
919 + return;
920 + }
921 +
922 +@@ -410,32 +436,27 @@ static void mvebu_pcie_handle_iobase_change(struct mvebu_pcie_port *port)
923 + * specifications. iobase is the bus address, port->iowin_base
924 + * is the CPU address.
925 + */
926 +- iobase = ((port->bridge.iobase & 0xF0) << 8) |
927 +- (port->bridge.iobaseupper << 16);
928 +- port->iowin_base = port->pcie->io.start + iobase;
929 +- port->iowin_size = ((0xFFF | ((port->bridge.iolimit & 0xF0) << 8) |
930 +- (port->bridge.iolimitupper << 16)) -
931 +- iobase) + 1;
932 +-
933 +- mvebu_pcie_add_windows(port, port->io_target, port->io_attr,
934 +- port->iowin_base, port->iowin_size,
935 +- iobase);
936 ++ desired.remap = ((port->bridge.iobase & 0xF0) << 8) |
937 ++ (port->bridge.iobaseupper << 16);
938 ++ desired.base = port->pcie->io.start + desired.remap;
939 ++ desired.size = ((0xFFF | ((port->bridge.iolimit & 0xF0) << 8) |
940 ++ (port->bridge.iolimitupper << 16)) -
941 ++ desired.remap) +
942 ++ 1;
943 ++
944 ++ mvebu_pcie_set_window(port, port->io_target, port->io_attr, &desired,
945 ++ &port->iowin);
946 + }
947 +
948 + static void mvebu_pcie_handle_membase_change(struct mvebu_pcie_port *port)
949 + {
950 ++ struct mvebu_pcie_window desired = {.remap = MVEBU_MBUS_NO_REMAP};
951 ++
952 + /* Are the new membase/memlimit values invalid? */
953 + if (port->bridge.memlimit < port->bridge.membase ||
954 + !(port->bridge.command & PCI_COMMAND_MEMORY)) {
955 +-
956 +- /* If a window was configured, remove it */
957 +- if (port->memwin_base) {
958 +- mvebu_pcie_del_windows(port, port->memwin_base,
959 +- port->memwin_size);
960 +- port->memwin_base = 0;
961 +- port->memwin_size = 0;
962 +- }
963 +-
964 ++ mvebu_pcie_set_window(port, port->mem_target, port->mem_attr,
965 ++ &desired, &port->memwin);
966 + return;
967 + }
968 +
969 +@@ -445,14 +466,12 @@ static void mvebu_pcie_handle_membase_change(struct mvebu_pcie_port *port)
970 + * window to setup, according to the PCI-to-PCI bridge
971 + * specifications.
972 + */
973 +- port->memwin_base = ((port->bridge.membase & 0xFFF0) << 16);
974 +- port->memwin_size =
975 +- (((port->bridge.memlimit & 0xFFF0) << 16) | 0xFFFFF) -
976 +- port->memwin_base + 1;
977 +-
978 +- mvebu_pcie_add_windows(port, port->mem_target, port->mem_attr,
979 +- port->memwin_base, port->memwin_size,
980 +- MVEBU_MBUS_NO_REMAP);
981 ++ desired.base = ((port->bridge.membase & 0xFFF0) << 16);
982 ++ desired.size = (((port->bridge.memlimit & 0xFFF0) << 16) | 0xFFFFF) -
983 ++ desired.base + 1;
984 ++
985 ++ mvebu_pcie_set_window(port, port->mem_target, port->mem_attr, &desired,
986 ++ &port->memwin);
987 + }
988 +
989 + /*
990 +diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
991 +index af2046c87806..847f75601591 100644
992 +--- a/drivers/platform/x86/hp-wmi.c
993 ++++ b/drivers/platform/x86/hp-wmi.c
994 +@@ -249,7 +249,7 @@ static int hp_wmi_display_state(void)
995 + int ret = hp_wmi_perform_query(HPWMI_DISPLAY_QUERY, 0, &state,
996 + sizeof(state), sizeof(state));
997 + if (ret)
998 +- return -EINVAL;
999 ++ return ret < 0 ? ret : -EINVAL;
1000 + return state;
1001 + }
1002 +
1003 +@@ -259,7 +259,7 @@ static int hp_wmi_hddtemp_state(void)
1004 + int ret = hp_wmi_perform_query(HPWMI_HDDTEMP_QUERY, 0, &state,
1005 + sizeof(state), sizeof(state));
1006 + if (ret)
1007 +- return -EINVAL;
1008 ++ return ret < 0 ? ret : -EINVAL;
1009 + return state;
1010 + }
1011 +
1012 +@@ -269,7 +269,7 @@ static int hp_wmi_als_state(void)
1013 + int ret = hp_wmi_perform_query(HPWMI_ALS_QUERY, 0, &state,
1014 + sizeof(state), sizeof(state));
1015 + if (ret)
1016 +- return -EINVAL;
1017 ++ return ret < 0 ? ret : -EINVAL;
1018 + return state;
1019 + }
1020 +
1021 +@@ -280,7 +280,7 @@ static int hp_wmi_dock_state(void)
1022 + sizeof(state), sizeof(state));
1023 +
1024 + if (ret)
1025 +- return -EINVAL;
1026 ++ return ret < 0 ? ret : -EINVAL;
1027 +
1028 + return state & 0x1;
1029 + }
1030 +@@ -291,7 +291,7 @@ static int hp_wmi_tablet_state(void)
1031 + int ret = hp_wmi_perform_query(HPWMI_HARDWARE_QUERY, 0, &state,
1032 + sizeof(state), sizeof(state));
1033 + if (ret)
1034 +- return ret;
1035 ++ return ret < 0 ? ret : -EINVAL;
1036 +
1037 + return (state & 0x4) ? 1 : 0;
1038 + }
1039 +@@ -324,7 +324,7 @@ static int __init hp_wmi_enable_hotkeys(void)
1040 + int ret = hp_wmi_perform_query(HPWMI_BIOS_QUERY, 1, &value,
1041 + sizeof(value), 0);
1042 + if (ret)
1043 +- return -EINVAL;
1044 ++ return ret < 0 ? ret : -EINVAL;
1045 + return 0;
1046 + }
1047 +
1048 +@@ -337,7 +337,7 @@ static int hp_wmi_set_block(void *data, bool blocked)
1049 + ret = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1,
1050 + &query, sizeof(query), 0);
1051 + if (ret)
1052 +- return -EINVAL;
1053 ++ return ret < 0 ? ret : -EINVAL;
1054 + return 0;
1055 + }
1056 +
1057 +@@ -429,7 +429,7 @@ static int hp_wmi_post_code_state(void)
1058 + int ret = hp_wmi_perform_query(HPWMI_POSTCODEERROR_QUERY, 0, &state,
1059 + sizeof(state), sizeof(state));
1060 + if (ret)
1061 +- return -EINVAL;
1062 ++ return ret < 0 ? ret : -EINVAL;
1063 + return state;
1064 + }
1065 +
1066 +@@ -495,7 +495,7 @@ static ssize_t set_als(struct device *dev, struct device_attribute *attr,
1067 + int ret = hp_wmi_perform_query(HPWMI_ALS_QUERY, 1, &tmp,
1068 + sizeof(tmp), sizeof(tmp));
1069 + if (ret)
1070 +- return -EINVAL;
1071 ++ return ret < 0 ? ret : -EINVAL;
1072 +
1073 + return count;
1074 + }
1075 +@@ -516,7 +516,7 @@ static ssize_t set_postcode(struct device *dev, struct device_attribute *attr,
1076 + ret = hp_wmi_perform_query(HPWMI_POSTCODEERROR_QUERY, 1, &tmp,
1077 + sizeof(tmp), sizeof(tmp));
1078 + if (ret)
1079 +- return -EINVAL;
1080 ++ return ret < 0 ? ret : -EINVAL;
1081 +
1082 + return count;
1083 + }
1084 +@@ -573,10 +573,12 @@ static void hp_wmi_notify(u32 value, void *context)
1085 +
1086 + switch (event_id) {
1087 + case HPWMI_DOCK_EVENT:
1088 +- input_report_switch(hp_wmi_input_dev, SW_DOCK,
1089 +- hp_wmi_dock_state());
1090 +- input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
1091 +- hp_wmi_tablet_state());
1092 ++ if (test_bit(SW_DOCK, hp_wmi_input_dev->swbit))
1093 ++ input_report_switch(hp_wmi_input_dev, SW_DOCK,
1094 ++ hp_wmi_dock_state());
1095 ++ if (test_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit))
1096 ++ input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
1097 ++ hp_wmi_tablet_state());
1098 + input_sync(hp_wmi_input_dev);
1099 + break;
1100 + case HPWMI_PARK_HDD:
1101 +@@ -649,6 +651,7 @@ static int __init hp_wmi_input_setup(void)
1102 + {
1103 + acpi_status status;
1104 + int err;
1105 ++ int val;
1106 +
1107 + hp_wmi_input_dev = input_allocate_device();
1108 + if (!hp_wmi_input_dev)
1109 +@@ -659,17 +662,26 @@ static int __init hp_wmi_input_setup(void)
1110 + hp_wmi_input_dev->id.bustype = BUS_HOST;
1111 +
1112 + __set_bit(EV_SW, hp_wmi_input_dev->evbit);
1113 +- __set_bit(SW_DOCK, hp_wmi_input_dev->swbit);
1114 +- __set_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit);
1115 ++
1116 ++ /* Dock */
1117 ++ val = hp_wmi_dock_state();
1118 ++ if (!(val < 0)) {
1119 ++ __set_bit(SW_DOCK, hp_wmi_input_dev->swbit);
1120 ++ input_report_switch(hp_wmi_input_dev, SW_DOCK, val);
1121 ++ }
1122 ++
1123 ++ /* Tablet mode */
1124 ++ val = hp_wmi_tablet_state();
1125 ++ if (!(val < 0)) {
1126 ++ __set_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit);
1127 ++ input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE, val);
1128 ++ }
1129 +
1130 + err = sparse_keymap_setup(hp_wmi_input_dev, hp_wmi_keymap, NULL);
1131 + if (err)
1132 + goto err_free_dev;
1133 +
1134 + /* Set initial hardware state */
1135 +- input_report_switch(hp_wmi_input_dev, SW_DOCK, hp_wmi_dock_state());
1136 +- input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
1137 +- hp_wmi_tablet_state());
1138 + input_sync(hp_wmi_input_dev);
1139 +
1140 + if (!hp_wmi_bios_2009_later() && hp_wmi_bios_2008_later())
1141 +@@ -982,10 +994,12 @@ static int hp_wmi_resume_handler(struct device *device)
1142 + * changed.
1143 + */
1144 + if (hp_wmi_input_dev) {
1145 +- input_report_switch(hp_wmi_input_dev, SW_DOCK,
1146 +- hp_wmi_dock_state());
1147 +- input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
1148 +- hp_wmi_tablet_state());
1149 ++ if (test_bit(SW_DOCK, hp_wmi_input_dev->swbit))
1150 ++ input_report_switch(hp_wmi_input_dev, SW_DOCK,
1151 ++ hp_wmi_dock_state());
1152 ++ if (test_bit(SW_TABLET_MODE, hp_wmi_input_dev->swbit))
1153 ++ input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
1154 ++ hp_wmi_tablet_state());
1155 + input_sync(hp_wmi_input_dev);
1156 + }
1157 +
1158 +diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
1159 +index 741f3ee81cfe..5006cb6ce62d 100644
1160 +--- a/drivers/s390/net/qeth_core.h
1161 ++++ b/drivers/s390/net/qeth_core.h
1162 +@@ -909,7 +909,6 @@ void qeth_clear_thread_running_bit(struct qeth_card *, unsigned long);
1163 + int qeth_core_hardsetup_card(struct qeth_card *);
1164 + void qeth_print_status_message(struct qeth_card *);
1165 + int qeth_init_qdio_queues(struct qeth_card *);
1166 +-int qeth_send_startlan(struct qeth_card *);
1167 + int qeth_send_ipa_cmd(struct qeth_card *, struct qeth_cmd_buffer *,
1168 + int (*reply_cb)
1169 + (struct qeth_card *, struct qeth_reply *, unsigned long),
1170 +diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
1171 +index d10bf3da8e5f..e5b9506698b1 100644
1172 +--- a/drivers/s390/net/qeth_core_main.c
1173 ++++ b/drivers/s390/net/qeth_core_main.c
1174 +@@ -2955,7 +2955,7 @@ int qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob,
1175 + }
1176 + EXPORT_SYMBOL_GPL(qeth_send_ipa_cmd);
1177 +
1178 +-int qeth_send_startlan(struct qeth_card *card)
1179 ++static int qeth_send_startlan(struct qeth_card *card)
1180 + {
1181 + int rc;
1182 + struct qeth_cmd_buffer *iob;
1183 +@@ -2968,7 +2968,6 @@ int qeth_send_startlan(struct qeth_card *card)
1184 + rc = qeth_send_ipa_cmd(card, iob, NULL, NULL);
1185 + return rc;
1186 + }
1187 +-EXPORT_SYMBOL_GPL(qeth_send_startlan);
1188 +
1189 + static int qeth_default_setadapterparms_cb(struct qeth_card *card,
1190 + struct qeth_reply *reply, unsigned long data)
1191 +@@ -5080,6 +5079,20 @@ retriable:
1192 + goto out;
1193 + }
1194 +
1195 ++ rc = qeth_send_startlan(card);
1196 ++ if (rc) {
1197 ++ QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
1198 ++ if (rc == IPA_RC_LAN_OFFLINE) {
1199 ++ dev_warn(&card->gdev->dev,
1200 ++ "The LAN is offline\n");
1201 ++ card->lan_online = 0;
1202 ++ } else {
1203 ++ rc = -ENODEV;
1204 ++ goto out;
1205 ++ }
1206 ++ } else
1207 ++ card->lan_online = 1;
1208 ++
1209 + card->options.ipa4.supported_funcs = 0;
1210 + card->options.ipa6.supported_funcs = 0;
1211 + card->options.adp.supported_funcs = 0;
1212 +@@ -5091,14 +5104,14 @@ retriable:
1213 + if (qeth_is_supported(card, IPA_SETADAPTERPARMS)) {
1214 + rc = qeth_query_setadapterparms(card);
1215 + if (rc < 0) {
1216 +- QETH_DBF_TEXT_(SETUP, 2, "6err%d", rc);
1217 ++ QETH_DBF_TEXT_(SETUP, 2, "7err%d", rc);
1218 + goto out;
1219 + }
1220 + }
1221 + if (qeth_adp_supported(card, IPA_SETADP_SET_DIAG_ASSIST)) {
1222 + rc = qeth_query_setdiagass(card);
1223 + if (rc < 0) {
1224 +- QETH_DBF_TEXT_(SETUP, 2, "7err%d", rc);
1225 ++ QETH_DBF_TEXT_(SETUP, 2, "8err%d", rc);
1226 + goto out;
1227 + }
1228 + }
1229 +diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
1230 +index bf1e0e39334d..58bcb3c9a86a 100644
1231 +--- a/drivers/s390/net/qeth_l2_main.c
1232 ++++ b/drivers/s390/net/qeth_l2_main.c
1233 +@@ -1203,21 +1203,6 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
1234 + /* softsetup */
1235 + QETH_DBF_TEXT(SETUP, 2, "softsetp");
1236 +
1237 +- rc = qeth_send_startlan(card);
1238 +- if (rc) {
1239 +- QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
1240 +- if (rc == 0xe080) {
1241 +- dev_warn(&card->gdev->dev,
1242 +- "The LAN is offline\n");
1243 +- card->lan_online = 0;
1244 +- goto contin;
1245 +- }
1246 +- rc = -ENODEV;
1247 +- goto out_remove;
1248 +- } else
1249 +- card->lan_online = 1;
1250 +-
1251 +-contin:
1252 + if ((card->info.type == QETH_CARD_TYPE_OSD) ||
1253 + (card->info.type == QETH_CARD_TYPE_OSX)) {
1254 + if (qeth_l2_start_ipassists(card))
1255 +diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
1256 +index 285fe0b2c753..bf3c1b2301db 100644
1257 +--- a/drivers/s390/net/qeth_l3_main.c
1258 ++++ b/drivers/s390/net/qeth_l3_main.c
1259 +@@ -3298,21 +3298,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
1260 + /* softsetup */
1261 + QETH_DBF_TEXT(SETUP, 2, "softsetp");
1262 +
1263 +- rc = qeth_send_startlan(card);
1264 +- if (rc) {
1265 +- QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
1266 +- if (rc == 0xe080) {
1267 +- dev_warn(&card->gdev->dev,
1268 +- "The LAN is offline\n");
1269 +- card->lan_online = 0;
1270 +- goto contin;
1271 +- }
1272 +- rc = -ENODEV;
1273 +- goto out_remove;
1274 +- } else
1275 +- card->lan_online = 1;
1276 +-
1277 +-contin:
1278 + rc = qeth_l3_setadapter_parms(card);
1279 + if (rc)
1280 + QETH_DBF_TEXT_(SETUP, 2, "2err%04x", rc);
1281 +diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
1282 +index 035dd456d7d6..737747354db6 100644
1283 +--- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
1284 ++++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
1285 +@@ -259,7 +259,7 @@ out_free_irq:
1286 + out1:
1287 + iio_trigger_unregister(st->trig);
1288 + out:
1289 +- iio_trigger_put(st->trig);
1290 ++ iio_trigger_free(st->trig);
1291 + return ret;
1292 + }
1293 +
1294 +@@ -272,7 +272,7 @@ static int iio_bfin_tmr_trigger_remove(struct platform_device *pdev)
1295 + peripheral_free(st->t->pin);
1296 + free_irq(st->irq, st);
1297 + iio_trigger_unregister(st->trig);
1298 +- iio_trigger_put(st->trig);
1299 ++ iio_trigger_free(st->trig);
1300 +
1301 + return 0;
1302 + }
1303 +diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
1304 +index 235e150d7b81..80d0ffe7abc1 100644
1305 +--- a/drivers/tty/serial/sh-sci.c
1306 ++++ b/drivers/tty/serial/sh-sci.c
1307 +@@ -163,18 +163,17 @@ static const struct plat_sci_reg sci_regmap[SCIx_NR_REGTYPES][SCIx_NR_REGS] = {
1308 + },
1309 +
1310 + /*
1311 +- * Common definitions for legacy IrDA ports, dependent on
1312 +- * regshift value.
1313 ++ * Common definitions for legacy IrDA ports.
1314 + */
1315 + [SCIx_IRDA_REGTYPE] = {
1316 + [SCSMR] = { 0x00, 8 },
1317 +- [SCBRR] = { 0x01, 8 },
1318 +- [SCSCR] = { 0x02, 8 },
1319 +- [SCxTDR] = { 0x03, 8 },
1320 +- [SCxSR] = { 0x04, 8 },
1321 +- [SCxRDR] = { 0x05, 8 },
1322 +- [SCFCR] = { 0x06, 8 },
1323 +- [SCFDR] = { 0x07, 16 },
1324 ++ [SCBRR] = { 0x02, 8 },
1325 ++ [SCSCR] = { 0x04, 8 },
1326 ++ [SCxTDR] = { 0x06, 8 },
1327 ++ [SCxSR] = { 0x08, 16 },
1328 ++ [SCxRDR] = { 0x0a, 8 },
1329 ++ [SCFCR] = { 0x0c, 8 },
1330 ++ [SCFDR] = { 0x0e, 16 },
1331 + [SCTFDR] = sci_reg_invalid,
1332 + [SCRFDR] = sci_reg_invalid,
1333 + [SCSPTR] = sci_reg_invalid,
1334 +diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
1335 +index 5c0952995280..87a83d925eea 100644
1336 +--- a/drivers/usb/core/hcd.c
1337 ++++ b/drivers/usb/core/hcd.c
1338 +@@ -2997,6 +2997,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
1339 + }
1340 +
1341 + usb_put_invalidate_rhdev(hcd);
1342 ++ hcd->flags = 0;
1343 + }
1344 + EXPORT_SYMBOL_GPL(usb_remove_hcd);
1345 +
1346 +diff --git a/drivers/video/fbdev/pmag-ba-fb.c b/drivers/video/fbdev/pmag-ba-fb.c
1347 +index 914a52ba8477..77837665ce89 100644
1348 +--- a/drivers/video/fbdev/pmag-ba-fb.c
1349 ++++ b/drivers/video/fbdev/pmag-ba-fb.c
1350 +@@ -129,7 +129,7 @@ static struct fb_ops pmagbafb_ops = {
1351 + /*
1352 + * Turn the hardware cursor off.
1353 + */
1354 +-static void __init pmagbafb_erase_cursor(struct fb_info *info)
1355 ++static void pmagbafb_erase_cursor(struct fb_info *info)
1356 + {
1357 + struct pmagbafb_par *par = info->par;
1358 +
1359 +diff --git a/include/linux/phy.h b/include/linux/phy.h
1360 +index b64825d6ad26..5bc4b9d563a9 100644
1361 +--- a/include/linux/phy.h
1362 ++++ b/include/linux/phy.h
1363 +@@ -136,11 +136,7 @@ static inline const char *phy_modes(phy_interface_t interface)
1364 + /* Used when trying to connect to a specific phy (mii bus id:phy device id) */
1365 + #define PHY_ID_FMT "%s:%02x"
1366 +
1367 +-/*
1368 +- * Need to be a little smaller than phydev->dev.bus_id to leave room
1369 +- * for the ":%02x"
1370 +- */
1371 +-#define MII_BUS_ID_SIZE (20 - 3)
1372 ++#define MII_BUS_ID_SIZE 61
1373 +
1374 + /* Or MII_ADDR_C45 into regnum for read/write on mii_bus to enable the 21 bit
1375 + IEEE 802.3ae clause 45 addressing mode used by 10GIGE phy chips. */
1376 +@@ -599,7 +595,7 @@ struct phy_driver {
1377 + /* A Structure for boards to register fixups with the PHY Lib */
1378 + struct phy_fixup {
1379 + struct list_head list;
1380 +- char bus_id[20];
1381 ++ char bus_id[MII_BUS_ID_SIZE + 3];
1382 + u32 phy_uid;
1383 + u32 phy_uid_mask;
1384 + int (*run)(struct phy_device *phydev);
1385 +diff --git a/include/linux/preempt.h b/include/linux/preempt.h
1386 +index 75e4e30677f1..7eeceac52dea 100644
1387 +--- a/include/linux/preempt.h
1388 ++++ b/include/linux/preempt.h
1389 +@@ -65,19 +65,24 @@
1390 +
1391 + /*
1392 + * Are we doing bottom half or hardware interrupt processing?
1393 +- * Are we in a softirq context? Interrupt context?
1394 +- * in_softirq - Are we currently processing softirq or have bh disabled?
1395 +- * in_serving_softirq - Are we currently processing softirq?
1396 ++ *
1397 ++ * in_irq() - We're in (hard) IRQ context
1398 ++ * in_softirq() - We have BH disabled, or are processing softirqs
1399 ++ * in_interrupt() - We're in NMI,IRQ,SoftIRQ context or have BH disabled
1400 ++ * in_serving_softirq() - We're in softirq context
1401 ++ * in_nmi() - We're in NMI context
1402 ++ * in_task() - We're in task context
1403 ++ *
1404 ++ * Note: due to the BH disabled confusion: in_softirq(),in_interrupt() really
1405 ++ * should not be used in new code.
1406 + */
1407 + #define in_irq() (hardirq_count())
1408 + #define in_softirq() (softirq_count())
1409 + #define in_interrupt() (irq_count())
1410 + #define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
1411 +-
1412 +-/*
1413 +- * Are we in NMI context?
1414 +- */
1415 +-#define in_nmi() (preempt_count() & NMI_MASK)
1416 ++#define in_nmi() (preempt_count() & NMI_MASK)
1417 ++#define in_task() (!(preempt_count() & \
1418 ++ (NMI_MASK | HARDIRQ_MASK | SOFTIRQ_OFFSET)))
1419 +
1420 + /*
1421 + * The preempt_count offset after preempt_disable();
1422 +diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
1423 +index 3a375d07d0dc..6670e9b34f20 100644
1424 +--- a/include/linux/usb/cdc_ncm.h
1425 ++++ b/include/linux/usb/cdc_ncm.h
1426 +@@ -82,6 +82,7 @@
1427 +
1428 + /* Driver flags */
1429 + #define CDC_NCM_FLAG_NDP_TO_END 0x02 /* NDP is placed at end of frame */
1430 ++#define CDC_NCM_FLAG_RESET_NTB16 0x08 /* set NDP16 one more time after altsetting switch */
1431 +
1432 + #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \
1433 + (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE)
1434 +diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
1435 +index feb58d455560..4b9ee3009aa0 100644
1436 +--- a/include/sound/seq_kernel.h
1437 ++++ b/include/sound/seq_kernel.h
1438 +@@ -49,7 +49,8 @@ typedef union snd_seq_timestamp snd_seq_timestamp_t;
1439 + #define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS 200
1440 +
1441 + /* max delivery path length */
1442 +-#define SNDRV_SEQ_MAX_HOPS 10
1443 ++/* NOTE: this shouldn't be greater than MAX_LOCKDEP_SUBCLASSES */
1444 ++#define SNDRV_SEQ_MAX_HOPS 8
1445 +
1446 + /* max size of event size */
1447 + #define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff
1448 +diff --git a/kernel/workqueue_internal.h b/kernel/workqueue_internal.h
1449 +index 45215870ac6c..3fa9c146fccb 100644
1450 +--- a/kernel/workqueue_internal.h
1451 ++++ b/kernel/workqueue_internal.h
1452 +@@ -9,6 +9,7 @@
1453 +
1454 + #include <linux/workqueue.h>
1455 + #include <linux/kthread.h>
1456 ++#include <linux/preempt.h>
1457 +
1458 + struct worker_pool;
1459 +
1460 +@@ -59,7 +60,7 @@ struct worker {
1461 + */
1462 + static inline struct worker *current_wq_worker(void)
1463 + {
1464 +- if (current->flags & PF_WQ_WORKER)
1465 ++ if (in_task() && (current->flags & PF_WQ_WORKER))
1466 + return kthread_data(current);
1467 + return NULL;
1468 + }
1469 +diff --git a/lib/asn1_decoder.c b/lib/asn1_decoder.c
1470 +index faa2a3f017f8..4fa2e54b3f59 100644
1471 +--- a/lib/asn1_decoder.c
1472 ++++ b/lib/asn1_decoder.c
1473 +@@ -227,7 +227,7 @@ next_op:
1474 + hdr = 2;
1475 +
1476 + /* Extract a tag from the data */
1477 +- if (unlikely(dp >= datalen - 1))
1478 ++ if (unlikely(datalen - dp < 2))
1479 + goto data_overrun_error;
1480 + tag = data[dp++];
1481 + if (unlikely((tag & 0x1f) == ASN1_LONG_TAG))
1482 +@@ -273,7 +273,7 @@ next_op:
1483 + int n = len - 0x80;
1484 + if (unlikely(n > 2))
1485 + goto length_too_long;
1486 +- if (unlikely(dp >= datalen - n))
1487 ++ if (unlikely(n > datalen - dp))
1488 + goto data_overrun_error;
1489 + hdr += n;
1490 + for (len = 0; n > 0; n--) {
1491 +diff --git a/lib/test_firmware.c b/lib/test_firmware.c
1492 +index 86374c1c49a4..841191061816 100644
1493 +--- a/lib/test_firmware.c
1494 ++++ b/lib/test_firmware.c
1495 +@@ -65,14 +65,19 @@ static ssize_t trigger_request_store(struct device *dev,
1496 + release_firmware(test_firmware);
1497 + test_firmware = NULL;
1498 + rc = request_firmware(&test_firmware, name, dev);
1499 +- if (rc)
1500 ++ if (rc) {
1501 + pr_info("load of '%s' failed: %d\n", name, rc);
1502 +- pr_info("loaded: %zu\n", test_firmware ? test_firmware->size : 0);
1503 ++ goto out;
1504 ++ }
1505 ++ pr_info("loaded: %zu\n", test_firmware->size);
1506 ++ rc = count;
1507 ++
1508 ++out:
1509 + mutex_unlock(&test_fw_mutex);
1510 +
1511 + kfree(name);
1512 +
1513 +- return count;
1514 ++ return rc;
1515 + }
1516 + static DEVICE_ATTR_WO(trigger_request);
1517 +
1518 +diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
1519 +index ff7736f7ff42..fc0c09e770e6 100644
1520 +--- a/net/dsa/Kconfig
1521 ++++ b/net/dsa/Kconfig
1522 +@@ -1,12 +1,13 @@
1523 + config HAVE_NET_DSA
1524 + def_bool y
1525 +- depends on NETDEVICES && !S390
1526 ++ depends on INET && NETDEVICES && !S390
1527 +
1528 + # Drivers must select NET_DSA and the appropriate tagging format
1529 +
1530 + config NET_DSA
1531 + tristate "Distributed Switch Architecture"
1532 +- depends on HAVE_NET_DSA && NET_SWITCHDEV
1533 ++ depends on HAVE_NET_DSA
1534 ++ select NET_SWITCHDEV
1535 + select PHYLIB
1536 + ---help---
1537 + Say Y if you want to enable support for the hardware switches supported
1538 +diff --git a/net/ipv4/ah4.c b/net/ipv4/ah4.c
1539 +index f2a71025a770..22377c8ff14b 100644
1540 +--- a/net/ipv4/ah4.c
1541 ++++ b/net/ipv4/ah4.c
1542 +@@ -270,6 +270,9 @@ static void ah_input_done(struct crypto_async_request *base, int err)
1543 + int ihl = ip_hdrlen(skb);
1544 + int ah_hlen = (ah->hdrlen + 2) << 2;
1545 +
1546 ++ if (err)
1547 ++ goto out;
1548 ++
1549 + work_iph = AH_SKB_CB(skb)->tmp;
1550 + auth_data = ah_tmp_auth(work_iph, ihl);
1551 + icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len);
1552 +diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c
1553 +index 9dfaf4d55ee0..a97a5bf716be 100644
1554 +--- a/net/netfilter/nft_meta.c
1555 ++++ b/net/netfilter/nft_meta.c
1556 +@@ -151,8 +151,34 @@ void nft_meta_get_eval(const struct nft_expr *expr,
1557 + else
1558 + *dest = PACKET_BROADCAST;
1559 + break;
1560 ++ case NFPROTO_NETDEV:
1561 ++ switch (skb->protocol) {
1562 ++ case htons(ETH_P_IP): {
1563 ++ int noff = skb_network_offset(skb);
1564 ++ struct iphdr *iph, _iph;
1565 ++
1566 ++ iph = skb_header_pointer(skb, noff,
1567 ++ sizeof(_iph), &_iph);
1568 ++ if (!iph)
1569 ++ goto err;
1570 ++
1571 ++ if (ipv4_is_multicast(iph->daddr))
1572 ++ *dest = PACKET_MULTICAST;
1573 ++ else
1574 ++ *dest = PACKET_BROADCAST;
1575 ++
1576 ++ break;
1577 ++ }
1578 ++ case htons(ETH_P_IPV6):
1579 ++ *dest = PACKET_MULTICAST;
1580 ++ break;
1581 ++ default:
1582 ++ WARN_ON_ONCE(1);
1583 ++ goto err;
1584 ++ }
1585 ++ break;
1586 + default:
1587 +- WARN_ON(1);
1588 ++ WARN_ON_ONCE(1);
1589 + goto err;
1590 + }
1591 + break;
1592 +diff --git a/security/keys/trusted.c b/security/keys/trusted.c
1593 +index 509aedcf8310..214ae2dc7f64 100644
1594 +--- a/security/keys/trusted.c
1595 ++++ b/security/keys/trusted.c
1596 +@@ -69,7 +69,7 @@ static int TSS_sha1(const unsigned char *data, unsigned int datalen,
1597 + }
1598 +
1599 + ret = crypto_shash_digest(&sdesc->shash, data, datalen, digest);
1600 +- kfree(sdesc);
1601 ++ kzfree(sdesc);
1602 + return ret;
1603 + }
1604 +
1605 +@@ -113,7 +113,7 @@ static int TSS_rawhmac(unsigned char *digest, const unsigned char *key,
1606 + if (!ret)
1607 + ret = crypto_shash_final(&sdesc->shash, digest);
1608 + out:
1609 +- kfree(sdesc);
1610 ++ kzfree(sdesc);
1611 + return ret;
1612 + }
1613 +
1614 +@@ -164,7 +164,7 @@ static int TSS_authhmac(unsigned char *digest, const unsigned char *key,
1615 + paramdigest, TPM_NONCE_SIZE, h1,
1616 + TPM_NONCE_SIZE, h2, 1, &c, 0, 0);
1617 + out:
1618 +- kfree(sdesc);
1619 ++ kzfree(sdesc);
1620 + return ret;
1621 + }
1622 +
1623 +@@ -245,7 +245,7 @@ static int TSS_checkhmac1(unsigned char *buffer,
1624 + if (memcmp(testhmac, authdata, SHA1_DIGEST_SIZE))
1625 + ret = -EINVAL;
1626 + out:
1627 +- kfree(sdesc);
1628 ++ kzfree(sdesc);
1629 + return ret;
1630 + }
1631 +
1632 +@@ -346,7 +346,7 @@ static int TSS_checkhmac2(unsigned char *buffer,
1633 + if (memcmp(testhmac2, authdata2, SHA1_DIGEST_SIZE))
1634 + ret = -EINVAL;
1635 + out:
1636 +- kfree(sdesc);
1637 ++ kzfree(sdesc);
1638 + return ret;
1639 + }
1640 +
1641 +@@ -563,7 +563,7 @@ static int tpm_seal(struct tpm_buf *tb, uint16_t keytype,
1642 + *bloblen = storedsize;
1643 + }
1644 + out:
1645 +- kfree(td);
1646 ++ kzfree(td);
1647 + return ret;
1648 + }
1649 +
1650 +@@ -677,7 +677,7 @@ static int key_seal(struct trusted_key_payload *p,
1651 + if (ret < 0)
1652 + pr_info("trusted_key: srkseal failed (%d)\n", ret);
1653 +
1654 +- kfree(tb);
1655 ++ kzfree(tb);
1656 + return ret;
1657 + }
1658 +
1659 +@@ -702,7 +702,7 @@ static int key_unseal(struct trusted_key_payload *p,
1660 + /* pull migratable flag out of sealed key */
1661 + p->migratable = p->key[--p->key_len];
1662 +
1663 +- kfree(tb);
1664 ++ kzfree(tb);
1665 + return ret;
1666 + }
1667 +
1668 +@@ -984,12 +984,12 @@ static int trusted_instantiate(struct key *key,
1669 + if (!ret && options->pcrlock)
1670 + ret = pcrlock(options->pcrlock);
1671 + out:
1672 +- kfree(datablob);
1673 +- kfree(options);
1674 ++ kzfree(datablob);
1675 ++ kzfree(options);
1676 + if (!ret)
1677 + rcu_assign_keypointer(key, payload);
1678 + else
1679 +- kfree(payload);
1680 ++ kzfree(payload);
1681 + return ret;
1682 + }
1683 +
1684 +@@ -998,8 +998,7 @@ static void trusted_rcu_free(struct rcu_head *rcu)
1685 + struct trusted_key_payload *p;
1686 +
1687 + p = container_of(rcu, struct trusted_key_payload, rcu);
1688 +- memset(p->key, 0, p->key_len);
1689 +- kfree(p);
1690 ++ kzfree(p);
1691 + }
1692 +
1693 + /*
1694 +@@ -1041,13 +1040,13 @@ static int trusted_update(struct key *key, struct key_preparsed_payload *prep)
1695 + ret = datablob_parse(datablob, new_p, new_o);
1696 + if (ret != Opt_update) {
1697 + ret = -EINVAL;
1698 +- kfree(new_p);
1699 ++ kzfree(new_p);
1700 + goto out;
1701 + }
1702 +
1703 + if (!new_o->keyhandle) {
1704 + ret = -EINVAL;
1705 +- kfree(new_p);
1706 ++ kzfree(new_p);
1707 + goto out;
1708 + }
1709 +
1710 +@@ -1061,22 +1060,22 @@ static int trusted_update(struct key *key, struct key_preparsed_payload *prep)
1711 + ret = key_seal(new_p, new_o);
1712 + if (ret < 0) {
1713 + pr_info("trusted_key: key_seal failed (%d)\n", ret);
1714 +- kfree(new_p);
1715 ++ kzfree(new_p);
1716 + goto out;
1717 + }
1718 + if (new_o->pcrlock) {
1719 + ret = pcrlock(new_o->pcrlock);
1720 + if (ret < 0) {
1721 + pr_info("trusted_key: pcrlock failed (%d)\n", ret);
1722 +- kfree(new_p);
1723 ++ kzfree(new_p);
1724 + goto out;
1725 + }
1726 + }
1727 + rcu_assign_keypointer(key, new_p);
1728 + call_rcu(&p->rcu, trusted_rcu_free);
1729 + out:
1730 +- kfree(datablob);
1731 +- kfree(new_o);
1732 ++ kzfree(datablob);
1733 ++ kzfree(new_o);
1734 + return ret;
1735 + }
1736 +
1737 +@@ -1095,34 +1094,30 @@ static long trusted_read(const struct key *key, char __user *buffer,
1738 + p = rcu_dereference_key(key);
1739 + if (!p)
1740 + return -EINVAL;
1741 +- if (!buffer || buflen <= 0)
1742 +- return 2 * p->blob_len;
1743 +- ascii_buf = kmalloc(2 * p->blob_len, GFP_KERNEL);
1744 +- if (!ascii_buf)
1745 +- return -ENOMEM;
1746 +
1747 +- bufp = ascii_buf;
1748 +- for (i = 0; i < p->blob_len; i++)
1749 +- bufp = hex_byte_pack(bufp, p->blob[i]);
1750 +- if ((copy_to_user(buffer, ascii_buf, 2 * p->blob_len)) != 0) {
1751 +- kfree(ascii_buf);
1752 +- return -EFAULT;
1753 ++ if (buffer && buflen >= 2 * p->blob_len) {
1754 ++ ascii_buf = kmalloc(2 * p->blob_len, GFP_KERNEL);
1755 ++ if (!ascii_buf)
1756 ++ return -ENOMEM;
1757 ++
1758 ++ bufp = ascii_buf;
1759 ++ for (i = 0; i < p->blob_len; i++)
1760 ++ bufp = hex_byte_pack(bufp, p->blob[i]);
1761 ++ if (copy_to_user(buffer, ascii_buf, 2 * p->blob_len) != 0) {
1762 ++ kzfree(ascii_buf);
1763 ++ return -EFAULT;
1764 ++ }
1765 ++ kzfree(ascii_buf);
1766 + }
1767 +- kfree(ascii_buf);
1768 + return 2 * p->blob_len;
1769 + }
1770 +
1771 + /*
1772 +- * trusted_destroy - before freeing the key, clear the decrypted data
1773 ++ * trusted_destroy - clear and free the key's payload
1774 + */
1775 + static void trusted_destroy(struct key *key)
1776 + {
1777 +- struct trusted_key_payload *p = key->payload.data[0];
1778 +-
1779 +- if (!p)
1780 +- return;
1781 +- memset(p->key, 0, p->key_len);
1782 +- kfree(key->payload.data[0]);
1783 ++ kzfree(key->payload.data[0]);
1784 + }
1785 +
1786 + struct key_type key_type_trusted = {
1787 +diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c
1788 +index aaff9ee32695..b30b2139e3f0 100644
1789 +--- a/sound/core/seq/oss/seq_oss_midi.c
1790 ++++ b/sound/core/seq/oss/seq_oss_midi.c
1791 +@@ -612,9 +612,7 @@ send_midi_event(struct seq_oss_devinfo *dp, struct snd_seq_event *ev, struct seq
1792 + if (!dp->timer->running)
1793 + len = snd_seq_oss_timer_start(dp->timer);
1794 + if (ev->type == SNDRV_SEQ_EVENT_SYSEX) {
1795 +- if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
1796 +- snd_seq_oss_readq_puts(dp->readq, mdev->seq_device,
1797 +- ev->data.ext.ptr, ev->data.ext.len);
1798 ++ snd_seq_oss_readq_sysex(dp->readq, mdev->seq_device, ev);
1799 + } else {
1800 + len = snd_midi_event_decode(mdev->coder, msg, sizeof(msg), ev);
1801 + if (len > 0)
1802 +diff --git a/sound/core/seq/oss/seq_oss_readq.c b/sound/core/seq/oss/seq_oss_readq.c
1803 +index 046cb586fb2f..06b21226b4e7 100644
1804 +--- a/sound/core/seq/oss/seq_oss_readq.c
1805 ++++ b/sound/core/seq/oss/seq_oss_readq.c
1806 +@@ -117,6 +117,35 @@ snd_seq_oss_readq_puts(struct seq_oss_readq *q, int dev, unsigned char *data, in
1807 + return 0;
1808 + }
1809 +
1810 ++/*
1811 ++ * put MIDI sysex bytes; the event buffer may be chained, thus it has
1812 ++ * to be expanded via snd_seq_dump_var_event().
1813 ++ */
1814 ++struct readq_sysex_ctx {
1815 ++ struct seq_oss_readq *readq;
1816 ++ int dev;
1817 ++};
1818 ++
1819 ++static int readq_dump_sysex(void *ptr, void *buf, int count)
1820 ++{
1821 ++ struct readq_sysex_ctx *ctx = ptr;
1822 ++
1823 ++ return snd_seq_oss_readq_puts(ctx->readq, ctx->dev, buf, count);
1824 ++}
1825 ++
1826 ++int snd_seq_oss_readq_sysex(struct seq_oss_readq *q, int dev,
1827 ++ struct snd_seq_event *ev)
1828 ++{
1829 ++ struct readq_sysex_ctx ctx = {
1830 ++ .readq = q,
1831 ++ .dev = dev
1832 ++ };
1833 ++
1834 ++ if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
1835 ++ return 0;
1836 ++ return snd_seq_dump_var_event(ev, readq_dump_sysex, &ctx);
1837 ++}
1838 ++
1839 + /*
1840 + * copy an event to input queue:
1841 + * return zero if enqueued
1842 +diff --git a/sound/core/seq/oss/seq_oss_readq.h b/sound/core/seq/oss/seq_oss_readq.h
1843 +index f1463f1f449e..8d033ca2d23f 100644
1844 +--- a/sound/core/seq/oss/seq_oss_readq.h
1845 ++++ b/sound/core/seq/oss/seq_oss_readq.h
1846 +@@ -44,6 +44,8 @@ void snd_seq_oss_readq_delete(struct seq_oss_readq *q);
1847 + void snd_seq_oss_readq_clear(struct seq_oss_readq *readq);
1848 + unsigned int snd_seq_oss_readq_poll(struct seq_oss_readq *readq, struct file *file, poll_table *wait);
1849 + int snd_seq_oss_readq_puts(struct seq_oss_readq *readq, int dev, unsigned char *data, int len);
1850 ++int snd_seq_oss_readq_sysex(struct seq_oss_readq *q, int dev,
1851 ++ struct snd_seq_event *ev);
1852 + int snd_seq_oss_readq_put_event(struct seq_oss_readq *readq, union evrec *ev);
1853 + int snd_seq_oss_readq_put_timestamp(struct seq_oss_readq *readq, unsigned long curt, int seq_mode);
1854 + int snd_seq_oss_readq_pick(struct seq_oss_readq *q, union evrec *rec);
1855 +diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh
1856 +index c4366dc74e01..856a1f327b3f 100755
1857 +--- a/tools/testing/selftests/firmware/fw_filesystem.sh
1858 ++++ b/tools/testing/selftests/firmware/fw_filesystem.sh
1859 +@@ -48,8 +48,16 @@ echo "ABCD0123" >"$FW"
1860 +
1861 + NAME=$(basename "$FW")
1862 +
1863 ++if printf '\000' >"$DIR"/trigger_request 2> /dev/null; then
1864 ++ echo "$0: empty filename should not succeed" >&2
1865 ++ exit 1
1866 ++fi
1867 ++
1868 + # Request a firmware that doesn't exist, it should fail.
1869 +-echo -n "nope-$NAME" >"$DIR"/trigger_request
1870 ++if echo -n "nope-$NAME" >"$DIR"/trigger_request 2> /dev/null; then
1871 ++ echo "$0: firmware shouldn't have loaded" >&2
1872 ++ exit 1
1873 ++fi
1874 + if diff -q "$FW" /dev/test_firmware >/dev/null ; then
1875 + echo "$0: firmware was not expected to match" >&2
1876 + exit 1
1877 +diff --git a/tools/testing/selftests/firmware/fw_userhelper.sh b/tools/testing/selftests/firmware/fw_userhelper.sh
1878 +index b9983f8e09f6..01c626a1f226 100755
1879 +--- a/tools/testing/selftests/firmware/fw_userhelper.sh
1880 ++++ b/tools/testing/selftests/firmware/fw_userhelper.sh
1881 +@@ -64,9 +64,33 @@ trap "test_finish" EXIT
1882 + echo "ABCD0123" >"$FW"
1883 + NAME=$(basename "$FW")
1884 +
1885 ++DEVPATH="$DIR"/"nope-$NAME"/loading
1886 ++
1887 + # Test failure when doing nothing (timeout works).
1888 +-echo 1 >/sys/class/firmware/timeout
1889 +-echo -n "$NAME" >"$DIR"/trigger_request
1890 ++echo -n 2 >/sys/class/firmware/timeout
1891 ++echo -n "nope-$NAME" >"$DIR"/trigger_request 2>/dev/null &
1892 ++
1893 ++# Give the kernel some time to load the loading file, must be less
1894 ++# than the timeout above.
1895 ++sleep 1
1896 ++if [ ! -f $DEVPATH ]; then
1897 ++ echo "$0: fallback mechanism immediately cancelled"
1898 ++ echo ""
1899 ++ echo "The file never appeared: $DEVPATH"
1900 ++ echo ""
1901 ++ echo "This might be a distribution udev rule setup by your distribution"
1902 ++ echo "to immediately cancel all fallback requests, this must be"
1903 ++ echo "removed before running these tests. To confirm look for"
1904 ++ echo "a firmware rule like /lib/udev/rules.d/50-firmware.rules"
1905 ++ echo "and see if you have something like this:"
1906 ++ echo ""
1907 ++ echo "SUBSYSTEM==\"firmware\", ACTION==\"add\", ATTR{loading}=\"-1\""
1908 ++ echo ""
1909 ++ echo "If you do remove this file or comment out this line before"
1910 ++ echo "proceeding with these tests."
1911 ++ exit 1
1912 ++fi
1913 ++
1914 + if diff -q "$FW" /dev/test_firmware >/dev/null ; then
1915 + echo "$0: firmware was not expected to match" >&2
1916 + exit 1