Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:3.18 commit in: /
Date: Tue, 28 Apr 2015 14:40:25
Message-Id: 1430155081.7aba46559287bc51c362786a611c31b910e0934b.mpagano@gentoo
1 commit: 7aba46559287bc51c362786a611c31b910e0934b
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Mon Apr 27 17:18:01 2015 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Mon Apr 27 17:18:01 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=7aba4655
7
8 Linux patch 3.18.12
9
10 0000_README | 4 +
11 1011_linux-3.18.12.patch | 2634 ++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 2638 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index 7616ed8..8dd852f 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -87,6 +87,10 @@ Patch: 1010_linux-3.18.11.patch
19 From: http://www.kernel.org
20 Desc: Linux 3.18.11
21
22 +Patch: 1011_linux-3.18.12.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 3.18.12
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/1011_linux-3.18.12.patch b/1011_linux-3.18.12.patch
31 new file mode 100644
32 index 0000000..182f8ae
33 --- /dev/null
34 +++ b/1011_linux-3.18.12.patch
35 @@ -0,0 +1,2634 @@
36 +diff --git a/Makefile b/Makefile
37 +index da8dc1350de3..d64f6bf7cd55 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,6 +1,6 @@
41 + VERSION = 3
42 + PATCHLEVEL = 18
43 +-SUBLEVEL = 11
44 ++SUBLEVEL = 12
45 + EXTRAVERSION =
46 + NAME = Diseased Newt
47 +
48 +diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h
49 +index a9eee33dfa62..101a42bde728 100644
50 +--- a/arch/arm64/include/asm/mmu_context.h
51 ++++ b/arch/arm64/include/asm/mmu_context.h
52 +@@ -151,6 +151,15 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
53 + {
54 + unsigned int cpu = smp_processor_id();
55 +
56 ++ /*
57 ++ * init_mm.pgd does not contain any user mappings and it is always
58 ++ * active for kernel addresses in TTBR1. Just set the reserved TTBR0.
59 ++ */
60 ++ if (next == &init_mm) {
61 ++ cpu_set_reserved_ttbr0();
62 ++ return;
63 ++ }
64 ++
65 + if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next)) || prev != next)
66 + check_and_switch_context(next, tsk);
67 + }
68 +diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi
69 +index 1382fec9e8c5..7fcb1ac0f232 100644
70 +--- a/arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi
71 ++++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-0.dtsi
72 +@@ -50,6 +50,7 @@ ethernet@b0000 {
73 + fsl,num_tx_queues = <0x8>;
74 + fsl,magic-packet;
75 + local-mac-address = [ 00 00 00 00 00 00 ];
76 ++ ranges;
77 +
78 + queue-group@b0000 {
79 + #address-cells = <1>;
80 +diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi
81 +index 221cd2ea5b31..9f25427c1527 100644
82 +--- a/arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi
83 ++++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-1.dtsi
84 +@@ -50,6 +50,7 @@ ethernet@b1000 {
85 + fsl,num_tx_queues = <0x8>;
86 + fsl,magic-packet;
87 + local-mac-address = [ 00 00 00 00 00 00 ];
88 ++ ranges;
89 +
90 + queue-group@b1000 {
91 + #address-cells = <1>;
92 +diff --git a/arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi b/arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi
93 +index 61456c317609..cd7c318ab131 100644
94 +--- a/arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi
95 ++++ b/arch/powerpc/boot/dts/fsl/pq3-etsec2-2.dtsi
96 +@@ -49,6 +49,7 @@ ethernet@b2000 {
97 + fsl,num_tx_queues = <0x8>;
98 + fsl,magic-packet;
99 + local-mac-address = [ 00 00 00 00 00 00 ];
100 ++ ranges;
101 +
102 + queue-group@b2000 {
103 + #address-cells = <1>;
104 +diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
105 +index 72e783ea0681..5e0198425194 100644
106 +--- a/arch/powerpc/kernel/exceptions-64s.S
107 ++++ b/arch/powerpc/kernel/exceptions-64s.S
108 +@@ -1399,7 +1399,7 @@ machine_check_handle_early:
109 + bne 9f /* continue in V mode if we are. */
110 +
111 + 5:
112 +-#ifdef CONFIG_KVM_BOOK3S_64_HV
113 ++#ifdef CONFIG_KVM_BOOK3S_64_HANDLER
114 + /*
115 + * We are coming from kernel context. Check if we are coming from
116 + * guest. if yes, then we can continue. We will fall through
117 +diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
118 +index e7cb6d4a871a..f8c9ff7886e1 100644
119 +--- a/arch/powerpc/platforms/pseries/mobility.c
120 ++++ b/arch/powerpc/platforms/pseries/mobility.c
121 +@@ -25,10 +25,10 @@
122 + static struct kobject *mobility_kobj;
123 +
124 + struct update_props_workarea {
125 +- u32 phandle;
126 +- u32 state;
127 +- u64 reserved;
128 +- u32 nprops;
129 ++ __be32 phandle;
130 ++ __be32 state;
131 ++ __be64 reserved;
132 ++ __be32 nprops;
133 + } __packed;
134 +
135 + #define NODE_ACTION_MASK 0xff000000
136 +@@ -54,11 +54,11 @@ static int mobility_rtas_call(int token, char *buf, s32 scope)
137 + return rc;
138 + }
139 +
140 +-static int delete_dt_node(u32 phandle)
141 ++static int delete_dt_node(__be32 phandle)
142 + {
143 + struct device_node *dn;
144 +
145 +- dn = of_find_node_by_phandle(phandle);
146 ++ dn = of_find_node_by_phandle(be32_to_cpu(phandle));
147 + if (!dn)
148 + return -ENOENT;
149 +
150 +@@ -127,7 +127,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop,
151 + return 0;
152 + }
153 +
154 +-static int update_dt_node(u32 phandle, s32 scope)
155 ++static int update_dt_node(__be32 phandle, s32 scope)
156 + {
157 + struct update_props_workarea *upwa;
158 + struct device_node *dn;
159 +@@ -136,6 +136,7 @@ static int update_dt_node(u32 phandle, s32 scope)
160 + char *prop_data;
161 + char *rtas_buf;
162 + int update_properties_token;
163 ++ u32 nprops;
164 + u32 vd;
165 +
166 + update_properties_token = rtas_token("ibm,update-properties");
167 +@@ -146,7 +147,7 @@ static int update_dt_node(u32 phandle, s32 scope)
168 + if (!rtas_buf)
169 + return -ENOMEM;
170 +
171 +- dn = of_find_node_by_phandle(phandle);
172 ++ dn = of_find_node_by_phandle(be32_to_cpu(phandle));
173 + if (!dn) {
174 + kfree(rtas_buf);
175 + return -ENOENT;
176 +@@ -162,6 +163,7 @@ static int update_dt_node(u32 phandle, s32 scope)
177 + break;
178 +
179 + prop_data = rtas_buf + sizeof(*upwa);
180 ++ nprops = be32_to_cpu(upwa->nprops);
181 +
182 + /* On the first call to ibm,update-properties for a node the
183 + * the first property value descriptor contains an empty
184 +@@ -170,17 +172,17 @@ static int update_dt_node(u32 phandle, s32 scope)
185 + */
186 + if (*prop_data == 0) {
187 + prop_data++;
188 +- vd = *(u32 *)prop_data;
189 ++ vd = be32_to_cpu(*(__be32 *)prop_data);
190 + prop_data += vd + sizeof(vd);
191 +- upwa->nprops--;
192 ++ nprops--;
193 + }
194 +
195 +- for (i = 0; i < upwa->nprops; i++) {
196 ++ for (i = 0; i < nprops; i++) {
197 + char *prop_name;
198 +
199 + prop_name = prop_data;
200 + prop_data += strlen(prop_name) + 1;
201 +- vd = *(u32 *)prop_data;
202 ++ vd = be32_to_cpu(*(__be32 *)prop_data);
203 + prop_data += sizeof(vd);
204 +
205 + switch (vd) {
206 +@@ -212,13 +214,13 @@ static int update_dt_node(u32 phandle, s32 scope)
207 + return 0;
208 + }
209 +
210 +-static int add_dt_node(u32 parent_phandle, u32 drc_index)
211 ++static int add_dt_node(__be32 parent_phandle, __be32 drc_index)
212 + {
213 + struct device_node *dn;
214 + struct device_node *parent_dn;
215 + int rc;
216 +
217 +- parent_dn = of_find_node_by_phandle(parent_phandle);
218 ++ parent_dn = of_find_node_by_phandle(be32_to_cpu(parent_phandle));
219 + if (!parent_dn)
220 + return -ENOENT;
221 +
222 +@@ -237,7 +239,7 @@ static int add_dt_node(u32 parent_phandle, u32 drc_index)
223 + int pseries_devicetree_update(s32 scope)
224 + {
225 + char *rtas_buf;
226 +- u32 *data;
227 ++ __be32 *data;
228 + int update_nodes_token;
229 + int rc;
230 +
231 +@@ -254,17 +256,17 @@ int pseries_devicetree_update(s32 scope)
232 + if (rc && rc != 1)
233 + break;
234 +
235 +- data = (u32 *)rtas_buf + 4;
236 +- while (*data & NODE_ACTION_MASK) {
237 ++ data = (__be32 *)rtas_buf + 4;
238 ++ while (be32_to_cpu(*data) & NODE_ACTION_MASK) {
239 + int i;
240 +- u32 action = *data & NODE_ACTION_MASK;
241 +- int node_count = *data & NODE_COUNT_MASK;
242 ++ u32 action = be32_to_cpu(*data) & NODE_ACTION_MASK;
243 ++ u32 node_count = be32_to_cpu(*data) & NODE_COUNT_MASK;
244 +
245 + data++;
246 +
247 + for (i = 0; i < node_count; i++) {
248 +- u32 phandle = *data++;
249 +- u32 drc_index;
250 ++ __be32 phandle = *data++;
251 ++ __be32 drc_index;
252 +
253 + switch (action) {
254 + case DELETE_DT_NODE:
255 +diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h
256 +index 0da5865df5b1..8e1f5f67e25f 100644
257 +--- a/drivers/base/regmap/internal.h
258 ++++ b/drivers/base/regmap/internal.h
259 +@@ -237,4 +237,12 @@ extern struct regcache_ops regcache_rbtree_ops;
260 + extern struct regcache_ops regcache_lzo_ops;
261 + extern struct regcache_ops regcache_flat_ops;
262 +
263 ++static inline const char *regmap_name(const struct regmap *map)
264 ++{
265 ++ if (map->dev)
266 ++ return dev_name(map->dev);
267 ++
268 ++ return map->name;
269 ++}
270 ++
271 + #endif
272 +diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
273 +index f3e8fe0cc650..9d09c5bb5874 100644
274 +--- a/drivers/base/regmap/regcache-rbtree.c
275 ++++ b/drivers/base/regmap/regcache-rbtree.c
276 +@@ -307,7 +307,7 @@ static int regcache_rbtree_insert_to_block(struct regmap *map,
277 + if (pos == 0) {
278 + memmove(blk + offset * map->cache_word_size,
279 + blk, rbnode->blklen * map->cache_word_size);
280 +- bitmap_shift_right(present, present, offset, blklen);
281 ++ bitmap_shift_left(present, present, offset, blklen);
282 + }
283 +
284 + /* update the rbnode block, its size and the base register */
285 +diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
286 +index f1280dc356d0..e5c1eda6a4c1 100644
287 +--- a/drivers/base/regmap/regcache.c
288 ++++ b/drivers/base/regmap/regcache.c
289 +@@ -213,7 +213,7 @@ int regcache_read(struct regmap *map,
290 + ret = map->cache_ops->read(map, reg, value);
291 +
292 + if (ret == 0)
293 +- trace_regmap_reg_read_cache(map->dev, reg, *value);
294 ++ trace_regmap_reg_read_cache(map, reg, *value);
295 +
296 + return ret;
297 + }
298 +@@ -306,7 +306,7 @@ int regcache_sync(struct regmap *map)
299 + dev_dbg(map->dev, "Syncing %s cache\n",
300 + map->cache_ops->name);
301 + name = map->cache_ops->name;
302 +- trace_regcache_sync(map->dev, name, "start");
303 ++ trace_regcache_sync(map, name, "start");
304 +
305 + if (!map->cache_dirty)
306 + goto out;
307 +@@ -341,7 +341,7 @@ out:
308 +
309 + regmap_async_complete(map);
310 +
311 +- trace_regcache_sync(map->dev, name, "stop");
312 ++ trace_regcache_sync(map, name, "stop");
313 +
314 + return ret;
315 + }
316 +@@ -376,7 +376,7 @@ int regcache_sync_region(struct regmap *map, unsigned int min,
317 + name = map->cache_ops->name;
318 + dev_dbg(map->dev, "Syncing %s cache from %d-%d\n", name, min, max);
319 +
320 +- trace_regcache_sync(map->dev, name, "start region");
321 ++ trace_regcache_sync(map, name, "start region");
322 +
323 + if (!map->cache_dirty)
324 + goto out;
325 +@@ -396,7 +396,7 @@ out:
326 +
327 + regmap_async_complete(map);
328 +
329 +- trace_regcache_sync(map->dev, name, "stop region");
330 ++ trace_regcache_sync(map, name, "stop region");
331 +
332 + return ret;
333 + }
334 +@@ -423,7 +423,7 @@ int regcache_drop_region(struct regmap *map, unsigned int min,
335 +
336 + map->lock(map->lock_arg);
337 +
338 +- trace_regcache_drop_region(map->dev, min, max);
339 ++ trace_regcache_drop_region(map, min, max);
340 +
341 + ret = map->cache_ops->drop(map, min, max);
342 +
343 +@@ -450,7 +450,7 @@ void regcache_cache_only(struct regmap *map, bool enable)
344 + map->lock(map->lock_arg);
345 + WARN_ON(map->cache_bypass && enable);
346 + map->cache_only = enable;
347 +- trace_regmap_cache_only(map->dev, enable);
348 ++ trace_regmap_cache_only(map, enable);
349 + map->unlock(map->lock_arg);
350 + }
351 + EXPORT_SYMBOL_GPL(regcache_cache_only);
352 +@@ -488,7 +488,7 @@ void regcache_cache_bypass(struct regmap *map, bool enable)
353 + map->lock(map->lock_arg);
354 + WARN_ON(map->cache_only && enable);
355 + map->cache_bypass = enable;
356 +- trace_regmap_cache_bypass(map->dev, enable);
357 ++ trace_regmap_cache_bypass(map, enable);
358 + map->unlock(map->lock_arg);
359 + }
360 + EXPORT_SYMBOL_GPL(regcache_cache_bypass);
361 +diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
362 +index d2f8a818d200..ee731bb7d957 100644
363 +--- a/drivers/base/regmap/regmap.c
364 ++++ b/drivers/base/regmap/regmap.c
365 +@@ -1280,7 +1280,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,
366 + if (map->async && map->bus->async_write) {
367 + struct regmap_async *async;
368 +
369 +- trace_regmap_async_write_start(map->dev, reg, val_len);
370 ++ trace_regmap_async_write_start(map, reg, val_len);
371 +
372 + spin_lock_irqsave(&map->async_lock, flags);
373 + async = list_first_entry_or_null(&map->async_free,
374 +@@ -1338,8 +1338,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,
375 + return ret;
376 + }
377 +
378 +- trace_regmap_hw_write_start(map->dev, reg,
379 +- val_len / map->format.val_bytes);
380 ++ trace_regmap_hw_write_start(map, reg, val_len / map->format.val_bytes);
381 +
382 + /* If we're doing a single register write we can probably just
383 + * send the work_buf directly, otherwise try to do a gather
384 +@@ -1371,8 +1370,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,
385 + kfree(buf);
386 + }
387 +
388 +- trace_regmap_hw_write_done(map->dev, reg,
389 +- val_len / map->format.val_bytes);
390 ++ trace_regmap_hw_write_done(map, reg, val_len / map->format.val_bytes);
391 +
392 + return ret;
393 + }
394 +@@ -1406,12 +1404,12 @@ static int _regmap_bus_formatted_write(void *context, unsigned int reg,
395 +
396 + map->format.format_write(map, reg, val);
397 +
398 +- trace_regmap_hw_write_start(map->dev, reg, 1);
399 ++ trace_regmap_hw_write_start(map, reg, 1);
400 +
401 + ret = map->bus->write(map->bus_context, map->work_buf,
402 + map->format.buf_size);
403 +
404 +- trace_regmap_hw_write_done(map->dev, reg, 1);
405 ++ trace_regmap_hw_write_done(map, reg, 1);
406 +
407 + return ret;
408 + }
409 +@@ -1469,7 +1467,7 @@ int _regmap_write(struct regmap *map, unsigned int reg,
410 + dev_info(map->dev, "%x <= %x\n", reg, val);
411 + #endif
412 +
413 +- trace_regmap_reg_write(map->dev, reg, val);
414 ++ trace_regmap_reg_write(map, reg, val);
415 +
416 + return map->reg_write(context, reg, val);
417 + }
418 +@@ -1772,7 +1770,7 @@ static int _regmap_raw_multi_reg_write(struct regmap *map,
419 + for (i = 0; i < num_regs; i++) {
420 + int reg = regs[i].reg;
421 + int val = regs[i].def;
422 +- trace_regmap_hw_write_start(map->dev, reg, 1);
423 ++ trace_regmap_hw_write_start(map, reg, 1);
424 + map->format.format_reg(u8, reg, map->reg_shift);
425 + u8 += reg_bytes + pad_bytes;
426 + map->format.format_val(u8, val, 0);
427 +@@ -1787,7 +1785,7 @@ static int _regmap_raw_multi_reg_write(struct regmap *map,
428 +
429 + for (i = 0; i < num_regs; i++) {
430 + int reg = regs[i].reg;
431 +- trace_regmap_hw_write_done(map->dev, reg, 1);
432 ++ trace_regmap_hw_write_done(map, reg, 1);
433 + }
434 + return ret;
435 + }
436 +@@ -2058,15 +2056,13 @@ static int _regmap_raw_read(struct regmap *map, unsigned int reg, void *val,
437 + */
438 + u8[0] |= map->read_flag_mask;
439 +
440 +- trace_regmap_hw_read_start(map->dev, reg,
441 +- val_len / map->format.val_bytes);
442 ++ trace_regmap_hw_read_start(map, reg, val_len / map->format.val_bytes);
443 +
444 + ret = map->bus->read(map->bus_context, map->work_buf,
445 + map->format.reg_bytes + map->format.pad_bytes,
446 + val, val_len);
447 +
448 +- trace_regmap_hw_read_done(map->dev, reg,
449 +- val_len / map->format.val_bytes);
450 ++ trace_regmap_hw_read_done(map, reg, val_len / map->format.val_bytes);
451 +
452 + return ret;
453 + }
454 +@@ -2122,7 +2118,7 @@ static int _regmap_read(struct regmap *map, unsigned int reg,
455 + dev_info(map->dev, "%x => %x\n", reg, *val);
456 + #endif
457 +
458 +- trace_regmap_reg_read(map->dev, reg, *val);
459 ++ trace_regmap_reg_read(map, reg, *val);
460 +
461 + if (!map->cache_bypass)
462 + regcache_write(map, reg, *val);
463 +@@ -2479,7 +2475,7 @@ void regmap_async_complete_cb(struct regmap_async *async, int ret)
464 + struct regmap *map = async->map;
465 + bool wake;
466 +
467 +- trace_regmap_async_io_complete(map->dev);
468 ++ trace_regmap_async_io_complete(map);
469 +
470 + spin_lock(&map->async_lock);
471 + list_move(&async->list, &map->async_free);
472 +@@ -2524,7 +2520,7 @@ int regmap_async_complete(struct regmap *map)
473 + if (!map->bus || !map->bus->async_write)
474 + return 0;
475 +
476 +- trace_regmap_async_complete_start(map->dev);
477 ++ trace_regmap_async_complete_start(map);
478 +
479 + wait_event(map->async_waitq, regmap_async_is_done(map));
480 +
481 +@@ -2533,7 +2529,7 @@ int regmap_async_complete(struct regmap *map)
482 + map->async_ret = 0;
483 + spin_unlock_irqrestore(&map->async_lock, flags);
484 +
485 +- trace_regmap_async_complete_done(map->dev);
486 ++ trace_regmap_async_complete_done(map);
487 +
488 + return ret;
489 + }
490 +diff --git a/drivers/clocksource/time-efm32.c b/drivers/clocksource/time-efm32.c
491 +index bba62f9deefb..ec57ba2bbd87 100644
492 +--- a/drivers/clocksource/time-efm32.c
493 ++++ b/drivers/clocksource/time-efm32.c
494 +@@ -225,12 +225,12 @@ static int __init efm32_clockevent_init(struct device_node *np)
495 + clock_event_ddata.base = base;
496 + clock_event_ddata.periodic_top = DIV_ROUND_CLOSEST(rate, 1024 * HZ);
497 +
498 +- setup_irq(irq, &efm32_clock_event_irq);
499 +-
500 + clockevents_config_and_register(&clock_event_ddata.evtdev,
501 + DIV_ROUND_CLOSEST(rate, 1024),
502 + 0xf, 0xffff);
503 +
504 ++ setup_irq(irq, &efm32_clock_event_irq);
505 ++
506 + return 0;
507 +
508 + err_get_irq:
509 +diff --git a/drivers/clocksource/timer-sun5i.c b/drivers/clocksource/timer-sun5i.c
510 +index 02268448dc85..5dcbf90b8015 100644
511 +--- a/drivers/clocksource/timer-sun5i.c
512 ++++ b/drivers/clocksource/timer-sun5i.c
513 +@@ -178,10 +178,6 @@ static void __init sun5i_timer_init(struct device_node *node)
514 +
515 + ticks_per_jiffy = DIV_ROUND_UP(rate, HZ);
516 +
517 +- ret = setup_irq(irq, &sun5i_timer_irq);
518 +- if (ret)
519 +- pr_warn("failed to setup irq %d\n", irq);
520 +-
521 + /* Enable timer0 interrupt */
522 + val = readl(timer_base + TIMER_IRQ_EN_REG);
523 + writel(val | TIMER_IRQ_EN(0), timer_base + TIMER_IRQ_EN_REG);
524 +@@ -191,6 +187,10 @@ static void __init sun5i_timer_init(struct device_node *node)
525 +
526 + clockevents_config_and_register(&sun5i_clockevent, rate,
527 + TIMER_SYNC_TICKS, 0xffffffff);
528 ++
529 ++ ret = setup_irq(irq, &sun5i_timer_irq);
530 ++ if (ret)
531 ++ pr_warn("failed to setup irq %d\n", irq);
532 + }
533 + CLOCKSOURCE_OF_DECLARE(sun5i_a13, "allwinner,sun5i-a13-hstimer",
534 + sun5i_timer_init);
535 +diff --git a/drivers/cpuidle/cpuidle-mvebu-v7.c b/drivers/cpuidle/cpuidle-mvebu-v7.c
536 +index 45371bb16214..6066d790fd0e 100644
537 +--- a/drivers/cpuidle/cpuidle-mvebu-v7.c
538 ++++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
539 +@@ -37,11 +37,11 @@ static int mvebu_v7_enter_idle(struct cpuidle_device *dev,
540 + deepidle = true;
541 +
542 + ret = mvebu_v7_cpu_suspend(deepidle);
543 ++ cpu_pm_exit();
544 ++
545 + if (ret)
546 + return ret;
547 +
548 +- cpu_pm_exit();
549 +-
550 + return index;
551 + }
552 +
553 +diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
554 +index a630161473a4..c396e1b69d93 100644
555 +--- a/drivers/dma/dw/platform.c
556 ++++ b/drivers/dma/dw/platform.c
557 +@@ -25,6 +25,8 @@
558 +
559 + #include "internal.h"
560 +
561 ++#define DRV_NAME "dw_dmac"
562 ++
563 + static struct dma_chan *dw_dma_of_xlate(struct of_phandle_args *dma_spec,
564 + struct of_dma *ofdma)
565 + {
566 +@@ -279,7 +281,7 @@ static struct platform_driver dw_driver = {
567 + .remove = dw_remove,
568 + .shutdown = dw_shutdown,
569 + .driver = {
570 +- .name = "dw_dmac",
571 ++ .name = DRV_NAME,
572 + .pm = &dw_dev_pm_ops,
573 + .of_match_table = of_match_ptr(dw_dma_of_id_table),
574 + .acpi_match_table = ACPI_PTR(dw_dma_acpi_id_table),
575 +@@ -300,3 +302,4 @@ module_exit(dw_exit);
576 +
577 + MODULE_LICENSE("GPL v2");
578 + MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller platform driver");
579 ++MODULE_ALIAS("platform:" DRV_NAME);
580 +diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
581 +index 3cdaac8944eb..a46c4af2ac98 100644
582 +--- a/drivers/edac/sb_edac.c
583 ++++ b/drivers/edac/sb_edac.c
584 +@@ -135,6 +135,7 @@ static inline int sad_pkg(const struct interleave_pkg *table, u32 reg,
585 +
586 + #define TOLM 0x80
587 + #define TOHM 0x84
588 ++#define HASWELL_TOLM 0xd0
589 + #define HASWELL_TOHM_0 0xd4
590 + #define HASWELL_TOHM_1 0xd8
591 +
592 +@@ -706,8 +707,8 @@ static u64 haswell_get_tolm(struct sbridge_pvt *pvt)
593 + {
594 + u32 reg;
595 +
596 +- pci_read_config_dword(pvt->info.pci_vtd, TOLM, &reg);
597 +- return (GET_BITFIELD(reg, 26, 31) << 26) | 0x1ffffff;
598 ++ pci_read_config_dword(pvt->info.pci_vtd, HASWELL_TOLM, &reg);
599 ++ return (GET_BITFIELD(reg, 26, 31) << 26) | 0x3ffffff;
600 + }
601 +
602 + static u64 haswell_get_tohm(struct sbridge_pvt *pvt)
603 +@@ -848,7 +849,7 @@ static int get_dimm_config(struct mem_ctl_info *mci)
604 + else
605 + edac_dbg(0, "Memory is unregistered\n");
606 +
607 +- if (mtype == MEM_DDR4 || MEM_RDDR4)
608 ++ if (mtype == MEM_DDR4 || mtype == MEM_RDDR4)
609 + banks = 16;
610 + else
611 + banks = 8;
612 +diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
613 +index 23e26e0768b5..2176874a41b1 100644
614 +--- a/drivers/input/mouse/synaptics.c
615 ++++ b/drivers/input/mouse/synaptics.c
616 +@@ -120,32 +120,41 @@ void synaptics_reset(struct psmouse *psmouse)
617 +
618 + static bool cr48_profile_sensor;
619 +
620 ++#define ANY_BOARD_ID 0
621 + struct min_max_quirk {
622 + const char * const *pnp_ids;
623 ++ struct {
624 ++ unsigned long int min, max;
625 ++ } board_id;
626 + int x_min, x_max, y_min, y_max;
627 + };
628 +
629 + static const struct min_max_quirk min_max_pnpid_table[] = {
630 + {
631 + (const char * const []){"LEN0033", NULL},
632 ++ {ANY_BOARD_ID, ANY_BOARD_ID},
633 + 1024, 5052, 2258, 4832
634 + },
635 + {
636 +- (const char * const []){"LEN0035", "LEN0042", NULL},
637 ++ (const char * const []){"LEN0042", NULL},
638 ++ {ANY_BOARD_ID, ANY_BOARD_ID},
639 + 1232, 5710, 1156, 4696
640 + },
641 + {
642 + (const char * const []){"LEN0034", "LEN0036", "LEN0037",
643 + "LEN0039", "LEN2002", "LEN2004",
644 + NULL},
645 ++ {ANY_BOARD_ID, 2961},
646 + 1024, 5112, 2024, 4832
647 + },
648 + {
649 + (const char * const []){"LEN2001", NULL},
650 ++ {ANY_BOARD_ID, ANY_BOARD_ID},
651 + 1024, 5022, 2508, 4832
652 + },
653 + {
654 + (const char * const []){"LEN2006", NULL},
655 ++ {ANY_BOARD_ID, ANY_BOARD_ID},
656 + 1264, 5675, 1171, 4688
657 + },
658 + { }
659 +@@ -241,6 +250,10 @@ static int synaptics_board_id(struct psmouse *psmouse)
660 + struct synaptics_data *priv = psmouse->private;
661 + unsigned char bid[3];
662 +
663 ++ /* firmwares prior 7.5 have no board_id encoded */
664 ++ if (SYN_ID_FULL(priv->identity) < 0x705)
665 ++ return 0;
666 ++
667 + if (synaptics_send_cmd(psmouse, SYN_QUE_MODES, bid))
668 + return -1;
669 + priv->board_id = ((bid[0] & 0xfc) << 6) | bid[1];
670 +@@ -343,7 +356,6 @@ static int synaptics_resolution(struct psmouse *psmouse)
671 + {
672 + struct synaptics_data *priv = psmouse->private;
673 + unsigned char resp[3];
674 +- int i;
675 +
676 + if (SYN_ID_MAJOR(priv->identity) < 4)
677 + return 0;
678 +@@ -355,17 +367,6 @@ static int synaptics_resolution(struct psmouse *psmouse)
679 + }
680 + }
681 +
682 +- for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) {
683 +- if (psmouse_matches_pnp_id(psmouse,
684 +- min_max_pnpid_table[i].pnp_ids)) {
685 +- priv->x_min = min_max_pnpid_table[i].x_min;
686 +- priv->x_max = min_max_pnpid_table[i].x_max;
687 +- priv->y_min = min_max_pnpid_table[i].y_min;
688 +- priv->y_max = min_max_pnpid_table[i].y_max;
689 +- return 0;
690 +- }
691 +- }
692 +-
693 + if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 5 &&
694 + SYN_CAP_MAX_DIMENSIONS(priv->ext_cap_0c)) {
695 + if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MAX_COORDS, resp)) {
696 +@@ -374,23 +375,69 @@ static int synaptics_resolution(struct psmouse *psmouse)
697 + } else {
698 + priv->x_max = (resp[0] << 5) | ((resp[1] & 0x0f) << 1);
699 + priv->y_max = (resp[2] << 5) | ((resp[1] & 0xf0) >> 3);
700 ++ psmouse_info(psmouse,
701 ++ "queried max coordinates: x [..%d], y [..%d]\n",
702 ++ priv->x_max, priv->y_max);
703 + }
704 + }
705 +
706 +- if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 7 &&
707 +- SYN_CAP_MIN_DIMENSIONS(priv->ext_cap_0c)) {
708 ++ if (SYN_CAP_MIN_DIMENSIONS(priv->ext_cap_0c) &&
709 ++ (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 7 ||
710 ++ /*
711 ++ * Firmware v8.1 does not report proper number of extended
712 ++ * capabilities, but has been proven to report correct min
713 ++ * coordinates.
714 ++ */
715 ++ SYN_ID_FULL(priv->identity) == 0x801)) {
716 + if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_MIN_COORDS, resp)) {
717 + psmouse_warn(psmouse,
718 + "device claims to have min coordinates query, but I'm not able to read it.\n");
719 + } else {
720 + priv->x_min = (resp[0] << 5) | ((resp[1] & 0x0f) << 1);
721 + priv->y_min = (resp[2] << 5) | ((resp[1] & 0xf0) >> 3);
722 ++ psmouse_info(psmouse,
723 ++ "queried min coordinates: x [%d..], y [%d..]\n",
724 ++ priv->x_min, priv->y_min);
725 + }
726 + }
727 +
728 + return 0;
729 + }
730 +
731 ++/*
732 ++ * Apply quirk(s) if the hardware matches
733 ++ */
734 ++
735 ++static void synaptics_apply_quirks(struct psmouse *psmouse)
736 ++{
737 ++ struct synaptics_data *priv = psmouse->private;
738 ++ int i;
739 ++
740 ++ for (i = 0; min_max_pnpid_table[i].pnp_ids; i++) {
741 ++ if (!psmouse_matches_pnp_id(psmouse,
742 ++ min_max_pnpid_table[i].pnp_ids))
743 ++ continue;
744 ++
745 ++ if (min_max_pnpid_table[i].board_id.min != ANY_BOARD_ID &&
746 ++ priv->board_id < min_max_pnpid_table[i].board_id.min)
747 ++ continue;
748 ++
749 ++ if (min_max_pnpid_table[i].board_id.max != ANY_BOARD_ID &&
750 ++ priv->board_id > min_max_pnpid_table[i].board_id.max)
751 ++ continue;
752 ++
753 ++ priv->x_min = min_max_pnpid_table[i].x_min;
754 ++ priv->x_max = min_max_pnpid_table[i].x_max;
755 ++ priv->y_min = min_max_pnpid_table[i].y_min;
756 ++ priv->y_max = min_max_pnpid_table[i].y_max;
757 ++ psmouse_info(psmouse,
758 ++ "quirked min/max coordinates: x [%d..%d], y [%d..%d]\n",
759 ++ priv->x_min, priv->x_max,
760 ++ priv->y_min, priv->y_max);
761 ++ break;
762 ++ }
763 ++}
764 ++
765 + static int synaptics_query_hardware(struct psmouse *psmouse)
766 + {
767 + if (synaptics_identify(psmouse))
768 +@@ -406,6 +453,8 @@ static int synaptics_query_hardware(struct psmouse *psmouse)
769 + if (synaptics_resolution(psmouse))
770 + return -1;
771 +
772 ++ synaptics_apply_quirks(psmouse);
773 ++
774 + return 0;
775 + }
776 +
777 +@@ -613,6 +662,18 @@ static void synaptics_parse_agm(const unsigned char buf[],
778 + priv->agm_pending = true;
779 + }
780 +
781 ++static void synaptics_parse_ext_buttons(const unsigned char buf[],
782 ++ struct synaptics_data *priv,
783 ++ struct synaptics_hw_state *hw)
784 ++{
785 ++ unsigned int ext_bits =
786 ++ (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) + 1) >> 1;
787 ++ unsigned int ext_mask = GENMASK(ext_bits - 1, 0);
788 ++
789 ++ hw->ext_buttons = buf[4] & ext_mask;
790 ++ hw->ext_buttons |= (buf[5] & ext_mask) << ext_bits;
791 ++}
792 ++
793 + static bool is_forcepad;
794 +
795 + static int synaptics_parse_hw_state(const unsigned char buf[],
796 +@@ -699,28 +760,9 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
797 + hw->down = ((buf[0] ^ buf[3]) & 0x02) ? 1 : 0;
798 + }
799 +
800 +- if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) &&
801 ++ if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) > 0 &&
802 + ((buf[0] ^ buf[3]) & 0x02)) {
803 +- switch (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
804 +- default:
805 +- /*
806 +- * if nExtBtn is greater than 8 it should be
807 +- * considered invalid and treated as 0
808 +- */
809 +- break;
810 +- case 8:
811 +- hw->ext_buttons |= ((buf[5] & 0x08)) ? 0x80 : 0;
812 +- hw->ext_buttons |= ((buf[4] & 0x08)) ? 0x40 : 0;
813 +- case 6:
814 +- hw->ext_buttons |= ((buf[5] & 0x04)) ? 0x20 : 0;
815 +- hw->ext_buttons |= ((buf[4] & 0x04)) ? 0x10 : 0;
816 +- case 4:
817 +- hw->ext_buttons |= ((buf[5] & 0x02)) ? 0x08 : 0;
818 +- hw->ext_buttons |= ((buf[4] & 0x02)) ? 0x04 : 0;
819 +- case 2:
820 +- hw->ext_buttons |= ((buf[5] & 0x01)) ? 0x02 : 0;
821 +- hw->ext_buttons |= ((buf[4] & 0x01)) ? 0x01 : 0;
822 +- }
823 ++ synaptics_parse_ext_buttons(buf, priv, hw);
824 + }
825 + } else {
826 + hw->x = (((buf[1] & 0x1f) << 8) | buf[2]);
827 +@@ -782,12 +824,35 @@ static void synaptics_report_semi_mt_data(struct input_dev *dev,
828 + }
829 + }
830 +
831 ++static void synaptics_report_ext_buttons(struct psmouse *psmouse,
832 ++ const struct synaptics_hw_state *hw)
833 ++{
834 ++ struct input_dev *dev = psmouse->dev;
835 ++ struct synaptics_data *priv = psmouse->private;
836 ++ int ext_bits = (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) + 1) >> 1;
837 ++ int i;
838 ++
839 ++ if (!SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
840 ++ return;
841 ++
842 ++ /* Bug in FW 8.1, buttons are reported only when ExtBit is 1 */
843 ++ if (SYN_ID_FULL(priv->identity) == 0x801 &&
844 ++ !((psmouse->packet[0] ^ psmouse->packet[3]) & 0x02))
845 ++ return;
846 ++
847 ++ for (i = 0; i < ext_bits; i++) {
848 ++ input_report_key(dev, BTN_0 + 2 * i,
849 ++ hw->ext_buttons & (1 << i));
850 ++ input_report_key(dev, BTN_1 + 2 * i,
851 ++ hw->ext_buttons & (1 << (i + ext_bits)));
852 ++ }
853 ++}
854 ++
855 + static void synaptics_report_buttons(struct psmouse *psmouse,
856 + const struct synaptics_hw_state *hw)
857 + {
858 + struct input_dev *dev = psmouse->dev;
859 + struct synaptics_data *priv = psmouse->private;
860 +- int i;
861 +
862 + input_report_key(dev, BTN_LEFT, hw->left);
863 + input_report_key(dev, BTN_RIGHT, hw->right);
864 +@@ -800,8 +865,7 @@ static void synaptics_report_buttons(struct psmouse *psmouse,
865 + input_report_key(dev, BTN_BACK, hw->down);
866 + }
867 +
868 +- for (i = 0; i < SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap); i++)
869 +- input_report_key(dev, BTN_0 + i, hw->ext_buttons & (1 << i));
870 ++ synaptics_report_ext_buttons(psmouse, hw);
871 + }
872 +
873 + static void synaptics_report_slot(struct input_dev *dev, int slot,
874 +diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
875 +index 37de0173b6d2..74adcd2c967e 100644
876 +--- a/drivers/md/dm-io.c
877 ++++ b/drivers/md/dm-io.c
878 +@@ -289,9 +289,16 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where,
879 + struct request_queue *q = bdev_get_queue(where->bdev);
880 + unsigned short logical_block_size = queue_logical_block_size(q);
881 + sector_t num_sectors;
882 ++ unsigned int uninitialized_var(special_cmd_max_sectors);
883 +
884 +- /* Reject unsupported discard requests */
885 +- if ((rw & REQ_DISCARD) && !blk_queue_discard(q)) {
886 ++ /*
887 ++ * Reject unsupported discard and write same requests.
888 ++ */
889 ++ if (rw & REQ_DISCARD)
890 ++ special_cmd_max_sectors = q->limits.max_discard_sectors;
891 ++ else if (rw & REQ_WRITE_SAME)
892 ++ special_cmd_max_sectors = q->limits.max_write_same_sectors;
893 ++ if ((rw & (REQ_DISCARD | REQ_WRITE_SAME)) && special_cmd_max_sectors == 0) {
894 + dec_count(io, region, -EOPNOTSUPP);
895 + return;
896 + }
897 +@@ -317,7 +324,7 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where,
898 + store_io_and_region_in_bio(bio, io, region);
899 +
900 + if (rw & REQ_DISCARD) {
901 +- num_sectors = min_t(sector_t, q->limits.max_discard_sectors, remaining);
902 ++ num_sectors = min_t(sector_t, special_cmd_max_sectors, remaining);
903 + bio->bi_iter.bi_size = num_sectors << SECTOR_SHIFT;
904 + remaining -= num_sectors;
905 + } else if (rw & REQ_WRITE_SAME) {
906 +@@ -326,7 +333,7 @@ static void do_region(int rw, unsigned region, struct dm_io_region *where,
907 + */
908 + dp->get_page(dp, &page, &len, &offset);
909 + bio_add_page(bio, page, logical_block_size, offset);
910 +- num_sectors = min_t(sector_t, q->limits.max_write_same_sectors, remaining);
911 ++ num_sectors = min_t(sector_t, special_cmd_max_sectors, remaining);
912 + bio->bi_iter.bi_size = num_sectors << SECTOR_SHIFT;
913 +
914 + offset = 0;
915 +diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
916 +index 8b204ae216ab..33de9f7a7180 100644
917 +--- a/drivers/md/dm-snap.c
918 ++++ b/drivers/md/dm-snap.c
919 +@@ -20,6 +20,8 @@
920 + #include <linux/log2.h>
921 + #include <linux/dm-kcopyd.h>
922 +
923 ++#include "dm.h"
924 ++
925 + #include "dm-exception-store.h"
926 +
927 + #define DM_MSG_PREFIX "snapshots"
928 +@@ -291,12 +293,23 @@ struct origin {
929 + };
930 +
931 + /*
932 ++ * This structure is allocated for each origin target
933 ++ */
934 ++struct dm_origin {
935 ++ struct dm_dev *dev;
936 ++ struct dm_target *ti;
937 ++ unsigned split_boundary;
938 ++ struct list_head hash_list;
939 ++};
940 ++
941 ++/*
942 + * Size of the hash table for origin volumes. If we make this
943 + * the size of the minors list then it should be nearly perfect
944 + */
945 + #define ORIGIN_HASH_SIZE 256
946 + #define ORIGIN_MASK 0xFF
947 + static struct list_head *_origins;
948 ++static struct list_head *_dm_origins;
949 + static struct rw_semaphore _origins_lock;
950 +
951 + static DECLARE_WAIT_QUEUE_HEAD(_pending_exceptions_done);
952 +@@ -310,12 +323,22 @@ static int init_origin_hash(void)
953 + _origins = kmalloc(ORIGIN_HASH_SIZE * sizeof(struct list_head),
954 + GFP_KERNEL);
955 + if (!_origins) {
956 +- DMERR("unable to allocate memory");
957 ++ DMERR("unable to allocate memory for _origins");
958 + return -ENOMEM;
959 + }
960 +-
961 + for (i = 0; i < ORIGIN_HASH_SIZE; i++)
962 + INIT_LIST_HEAD(_origins + i);
963 ++
964 ++ _dm_origins = kmalloc(ORIGIN_HASH_SIZE * sizeof(struct list_head),
965 ++ GFP_KERNEL);
966 ++ if (!_dm_origins) {
967 ++ DMERR("unable to allocate memory for _dm_origins");
968 ++ kfree(_origins);
969 ++ return -ENOMEM;
970 ++ }
971 ++ for (i = 0; i < ORIGIN_HASH_SIZE; i++)
972 ++ INIT_LIST_HEAD(_dm_origins + i);
973 ++
974 + init_rwsem(&_origins_lock);
975 +
976 + return 0;
977 +@@ -324,6 +347,7 @@ static int init_origin_hash(void)
978 + static void exit_origin_hash(void)
979 + {
980 + kfree(_origins);
981 ++ kfree(_dm_origins);
982 + }
983 +
984 + static unsigned origin_hash(struct block_device *bdev)
985 +@@ -350,6 +374,30 @@ static void __insert_origin(struct origin *o)
986 + list_add_tail(&o->hash_list, sl);
987 + }
988 +
989 ++static struct dm_origin *__lookup_dm_origin(struct block_device *origin)
990 ++{
991 ++ struct list_head *ol;
992 ++ struct dm_origin *o;
993 ++
994 ++ ol = &_dm_origins[origin_hash(origin)];
995 ++ list_for_each_entry (o, ol, hash_list)
996 ++ if (bdev_equal(o->dev->bdev, origin))
997 ++ return o;
998 ++
999 ++ return NULL;
1000 ++}
1001 ++
1002 ++static void __insert_dm_origin(struct dm_origin *o)
1003 ++{
1004 ++ struct list_head *sl = &_dm_origins[origin_hash(o->dev->bdev)];
1005 ++ list_add_tail(&o->hash_list, sl);
1006 ++}
1007 ++
1008 ++static void __remove_dm_origin(struct dm_origin *o)
1009 ++{
1010 ++ list_del(&o->hash_list);
1011 ++}
1012 ++
1013 + /*
1014 + * _origins_lock must be held when calling this function.
1015 + * Returns number of snapshots registered using the supplied cow device, plus:
1016 +@@ -1840,9 +1888,40 @@ static int snapshot_preresume(struct dm_target *ti)
1017 + static void snapshot_resume(struct dm_target *ti)
1018 + {
1019 + struct dm_snapshot *s = ti->private;
1020 +- struct dm_snapshot *snap_src = NULL, *snap_dest = NULL;
1021 ++ struct dm_snapshot *snap_src = NULL, *snap_dest = NULL, *snap_merging = NULL;
1022 ++ struct dm_origin *o;
1023 ++ struct mapped_device *origin_md = NULL;
1024 ++ bool must_restart_merging = false;
1025 +
1026 + down_read(&_origins_lock);
1027 ++
1028 ++ o = __lookup_dm_origin(s->origin->bdev);
1029 ++ if (o)
1030 ++ origin_md = dm_table_get_md(o->ti->table);
1031 ++ if (!origin_md) {
1032 ++ (void) __find_snapshots_sharing_cow(s, NULL, NULL, &snap_merging);
1033 ++ if (snap_merging)
1034 ++ origin_md = dm_table_get_md(snap_merging->ti->table);
1035 ++ }
1036 ++ if (origin_md == dm_table_get_md(ti->table))
1037 ++ origin_md = NULL;
1038 ++ if (origin_md) {
1039 ++ if (dm_hold(origin_md))
1040 ++ origin_md = NULL;
1041 ++ }
1042 ++
1043 ++ up_read(&_origins_lock);
1044 ++
1045 ++ if (origin_md) {
1046 ++ dm_internal_suspend(origin_md);
1047 ++ if (snap_merging && test_bit(RUNNING_MERGE, &snap_merging->state_bits)) {
1048 ++ must_restart_merging = true;
1049 ++ stop_merge(snap_merging);
1050 ++ }
1051 ++ }
1052 ++
1053 ++ down_read(&_origins_lock);
1054 ++
1055 + (void) __find_snapshots_sharing_cow(s, &snap_src, &snap_dest, NULL);
1056 + if (snap_src && snap_dest) {
1057 + down_write(&snap_src->lock);
1058 +@@ -1851,8 +1930,16 @@ static void snapshot_resume(struct dm_target *ti)
1059 + up_write(&snap_dest->lock);
1060 + up_write(&snap_src->lock);
1061 + }
1062 ++
1063 + up_read(&_origins_lock);
1064 +
1065 ++ if (origin_md) {
1066 ++ if (must_restart_merging)
1067 ++ start_merge(snap_merging);
1068 ++ dm_internal_resume(origin_md);
1069 ++ dm_put(origin_md);
1070 ++ }
1071 ++
1072 + /* Now we have correct chunk size, reregister */
1073 + reregister_snapshot(s);
1074 +
1075 +@@ -2133,11 +2220,6 @@ static int origin_write_extent(struct dm_snapshot *merging_snap,
1076 + * Origin: maps a linear range of a device, with hooks for snapshotting.
1077 + */
1078 +
1079 +-struct dm_origin {
1080 +- struct dm_dev *dev;
1081 +- unsigned split_boundary;
1082 +-};
1083 +-
1084 + /*
1085 + * Construct an origin mapping: <dev_path>
1086 + * The context for an origin is merely a 'struct dm_dev *'
1087 +@@ -2166,6 +2248,7 @@ static int origin_ctr(struct dm_target *ti, unsigned int argc, char **argv)
1088 + goto bad_open;
1089 + }
1090 +
1091 ++ o->ti = ti;
1092 + ti->private = o;
1093 + ti->num_flush_bios = 1;
1094 +
1095 +@@ -2180,6 +2263,7 @@ bad_alloc:
1096 + static void origin_dtr(struct dm_target *ti)
1097 + {
1098 + struct dm_origin *o = ti->private;
1099 ++
1100 + dm_put_device(ti, o->dev);
1101 + kfree(o);
1102 + }
1103 +@@ -2216,6 +2300,19 @@ static void origin_resume(struct dm_target *ti)
1104 + struct dm_origin *o = ti->private;
1105 +
1106 + o->split_boundary = get_origin_minimum_chunksize(o->dev->bdev);
1107 ++
1108 ++ down_write(&_origins_lock);
1109 ++ __insert_dm_origin(o);
1110 ++ up_write(&_origins_lock);
1111 ++}
1112 ++
1113 ++static void origin_postsuspend(struct dm_target *ti)
1114 ++{
1115 ++ struct dm_origin *o = ti->private;
1116 ++
1117 ++ down_write(&_origins_lock);
1118 ++ __remove_dm_origin(o);
1119 ++ up_write(&_origins_lock);
1120 + }
1121 +
1122 + static void origin_status(struct dm_target *ti, status_type_t type,
1123 +@@ -2258,12 +2355,13 @@ static int origin_iterate_devices(struct dm_target *ti,
1124 +
1125 + static struct target_type origin_target = {
1126 + .name = "snapshot-origin",
1127 +- .version = {1, 8, 1},
1128 ++ .version = {1, 9, 0},
1129 + .module = THIS_MODULE,
1130 + .ctr = origin_ctr,
1131 + .dtr = origin_dtr,
1132 + .map = origin_map,
1133 + .resume = origin_resume,
1134 ++ .postsuspend = origin_postsuspend,
1135 + .status = origin_status,
1136 + .merge = origin_merge,
1137 + .iterate_devices = origin_iterate_devices,
1138 +@@ -2271,7 +2369,7 @@ static struct target_type origin_target = {
1139 +
1140 + static struct target_type snapshot_target = {
1141 + .name = "snapshot",
1142 +- .version = {1, 12, 0},
1143 ++ .version = {1, 13, 0},
1144 + .module = THIS_MODULE,
1145 + .ctr = snapshot_ctr,
1146 + .dtr = snapshot_dtr,
1147 +@@ -2285,7 +2383,7 @@ static struct target_type snapshot_target = {
1148 +
1149 + static struct target_type merge_target = {
1150 + .name = dm_snapshot_merge_target_name,
1151 +- .version = {1, 2, 0},
1152 ++ .version = {1, 3, 0},
1153 + .module = THIS_MODULE,
1154 + .ctr = snapshot_ctr,
1155 + .dtr = snapshot_dtr,
1156 +diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
1157 +index ac6b0ff161ea..0801e35b9940 100644
1158 +--- a/drivers/md/dm-thin.c
1159 ++++ b/drivers/md/dm-thin.c
1160 +@@ -2003,17 +2003,6 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio)
1161 + return DM_MAPIO_REMAPPED;
1162 +
1163 + case -ENODATA:
1164 +- if (get_pool_mode(tc->pool) == PM_READ_ONLY) {
1165 +- /*
1166 +- * This block isn't provisioned, and we have no way
1167 +- * of doing so.
1168 +- */
1169 +- handle_unserviceable_bio(tc->pool, bio);
1170 +- cell_defer_no_holder_no_free(tc, &cell1);
1171 +- return DM_MAPIO_SUBMITTED;
1172 +- }
1173 +- /* fall through */
1174 +-
1175 + case -EWOULDBLOCK:
1176 + /*
1177 + * In future, the failed dm_thin_find_block above could
1178 +diff --git a/drivers/md/dm.c b/drivers/md/dm.c
1179 +index cec85c5bae9e..042114fbd200 100644
1180 +--- a/drivers/md/dm.c
1181 ++++ b/drivers/md/dm.c
1182 +@@ -2507,6 +2507,19 @@ void dm_get(struct mapped_device *md)
1183 + BUG_ON(test_bit(DMF_FREEING, &md->flags));
1184 + }
1185 +
1186 ++int dm_hold(struct mapped_device *md)
1187 ++{
1188 ++ spin_lock(&_minor_lock);
1189 ++ if (test_bit(DMF_FREEING, &md->flags)) {
1190 ++ spin_unlock(&_minor_lock);
1191 ++ return -EBUSY;
1192 ++ }
1193 ++ dm_get(md);
1194 ++ spin_unlock(&_minor_lock);
1195 ++ return 0;
1196 ++}
1197 ++EXPORT_SYMBOL_GPL(dm_hold);
1198 ++
1199 + const char *dm_device_name(struct mapped_device *md)
1200 + {
1201 + return md->name;
1202 +@@ -2526,10 +2539,16 @@ static void __dm_destroy(struct mapped_device *md, bool wait)
1203 + set_bit(DMF_FREEING, &md->flags);
1204 + spin_unlock(&_minor_lock);
1205 +
1206 ++ /*
1207 ++ * Take suspend_lock so that presuspend and postsuspend methods
1208 ++ * do not race with internal suspend.
1209 ++ */
1210 ++ mutex_lock(&md->suspend_lock);
1211 + if (!dm_suspended_md(md)) {
1212 + dm_table_presuspend_targets(map);
1213 + dm_table_postsuspend_targets(map);
1214 + }
1215 ++ mutex_unlock(&md->suspend_lock);
1216 +
1217 + /* dm_put_live_table must be before msleep, otherwise deadlock is possible */
1218 + dm_put_live_table(md, srcu_idx);
1219 +@@ -2881,6 +2900,7 @@ void dm_internal_suspend(struct mapped_device *md)
1220 + flush_workqueue(md->wq);
1221 + dm_wait_for_completion(md, TASK_UNINTERRUPTIBLE);
1222 + }
1223 ++EXPORT_SYMBOL_GPL(dm_internal_suspend);
1224 +
1225 + void dm_internal_resume(struct mapped_device *md)
1226 + {
1227 +@@ -2892,6 +2912,7 @@ void dm_internal_resume(struct mapped_device *md)
1228 + done:
1229 + mutex_unlock(&md->suspend_lock);
1230 + }
1231 ++EXPORT_SYMBOL_GPL(dm_internal_resume);
1232 +
1233 + /*-----------------------------------------------------------------
1234 + * Event notification.
1235 +diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
1236 +index bd2696136eee..177fa31e5aad 100644
1237 +--- a/drivers/mfd/kempld-core.c
1238 ++++ b/drivers/mfd/kempld-core.c
1239 +@@ -740,7 +740,7 @@ static int __init kempld_init(void)
1240 + for (id = kempld_dmi_table;
1241 + id->matches[0].slot != DMI_NONE; id++)
1242 + if (strstr(id->ident, force_device_id))
1243 +- if (id->callback && id->callback(id))
1244 ++ if (id->callback && !id->callback(id))
1245 + break;
1246 + if (id->matches[0].slot == DMI_NONE)
1247 + return -ENODEV;
1248 +diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
1249 +index e2e3aaf501a2..30f088be6a1a 100644
1250 +--- a/drivers/net/ethernet/amd/pcnet32.c
1251 ++++ b/drivers/net/ethernet/amd/pcnet32.c
1252 +@@ -1543,7 +1543,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1253 + {
1254 + struct pcnet32_private *lp;
1255 + int i, media;
1256 +- int fdx, mii, fset, dxsuflo;
1257 ++ int fdx, mii, fset, dxsuflo, sram;
1258 + int chip_version;
1259 + char *chipname;
1260 + struct net_device *dev;
1261 +@@ -1580,7 +1580,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1262 + }
1263 +
1264 + /* initialize variables */
1265 +- fdx = mii = fset = dxsuflo = 0;
1266 ++ fdx = mii = fset = dxsuflo = sram = 0;
1267 + chip_version = (chip_version >> 12) & 0xffff;
1268 +
1269 + switch (chip_version) {
1270 +@@ -1613,6 +1613,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1271 + chipname = "PCnet/FAST III 79C973"; /* PCI */
1272 + fdx = 1;
1273 + mii = 1;
1274 ++ sram = 1;
1275 + break;
1276 + case 0x2626:
1277 + chipname = "PCnet/Home 79C978"; /* PCI */
1278 +@@ -1636,6 +1637,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1279 + chipname = "PCnet/FAST III 79C975"; /* PCI */
1280 + fdx = 1;
1281 + mii = 1;
1282 ++ sram = 1;
1283 + break;
1284 + case 0x2628:
1285 + chipname = "PCnet/PRO 79C976";
1286 +@@ -1664,6 +1666,31 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1287 + dxsuflo = 1;
1288 + }
1289 +
1290 ++ /*
1291 ++ * The Am79C973/Am79C975 controllers come with 12K of SRAM
1292 ++ * which we can use for the Tx/Rx buffers but most importantly,
1293 ++ * the use of SRAM allow us to use the BCR18:NOUFLO bit to avoid
1294 ++ * Tx fifo underflows.
1295 ++ */
1296 ++ if (sram) {
1297 ++ /*
1298 ++ * The SRAM is being configured in two steps. First we
1299 ++ * set the SRAM size in the BCR25:SRAM_SIZE bits. According
1300 ++ * to the datasheet, each bit corresponds to a 512-byte
1301 ++ * page so we can have at most 24 pages. The SRAM_SIZE
1302 ++ * holds the value of the upper 8 bits of the 16-bit SRAM size.
1303 ++ * The low 8-bits start at 0x00 and end at 0xff. So the
1304 ++ * address range is from 0x0000 up to 0x17ff. Therefore,
1305 ++ * the SRAM_SIZE is set to 0x17. The next step is to set
1306 ++ * the BCR26:SRAM_BND midway through so the Tx and Rx
1307 ++ * buffers can share the SRAM equally.
1308 ++ */
1309 ++ a->write_bcr(ioaddr, 25, 0x17);
1310 ++ a->write_bcr(ioaddr, 26, 0xc);
1311 ++ /* And finally enable the NOUFLO bit */
1312 ++ a->write_bcr(ioaddr, 18, a->read_bcr(ioaddr, 18) | (1 << 11));
1313 ++ }
1314 ++
1315 + dev = alloc_etherdev(sizeof(*lp));
1316 + if (!dev) {
1317 + ret = -ENOMEM;
1318 +diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
1319 +index 40b6d1d006d7..af2486965782 100644
1320 +--- a/drivers/net/wireless/rtlwifi/base.c
1321 ++++ b/drivers/net/wireless/rtlwifi/base.c
1322 +@@ -1314,8 +1314,11 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx)
1323 + }
1324 +
1325 + return true;
1326 +- } else if (0x86DD == ether_type) {
1327 +- return true;
1328 ++ } else if (ETH_P_IPV6 == ether_type) {
1329 ++ /* TODO: Handle any IPv6 cases that need special handling.
1330 ++ * For now, always return false
1331 ++ */
1332 ++ goto end;
1333 + }
1334 +
1335 + end:
1336 +diff --git a/drivers/of/irq.c b/drivers/of/irq.c
1337 +index 1471e0a223a5..b97363adca0b 100644
1338 +--- a/drivers/of/irq.c
1339 ++++ b/drivers/of/irq.c
1340 +@@ -290,7 +290,7 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar
1341 + struct device_node *p;
1342 + const __be32 *intspec, *tmp, *addr;
1343 + u32 intsize, intlen;
1344 +- int i, res = -EINVAL;
1345 ++ int i, res;
1346 +
1347 + pr_debug("of_irq_parse_one: dev=%s, index=%d\n", of_node_full_name(device), index);
1348 +
1349 +@@ -323,15 +323,19 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar
1350 +
1351 + /* Get size of interrupt specifier */
1352 + tmp = of_get_property(p, "#interrupt-cells", NULL);
1353 +- if (tmp == NULL)
1354 ++ if (tmp == NULL) {
1355 ++ res = -EINVAL;
1356 + goto out;
1357 ++ }
1358 + intsize = be32_to_cpu(*tmp);
1359 +
1360 + pr_debug(" intsize=%d intlen=%d\n", intsize, intlen);
1361 +
1362 + /* Check index */
1363 +- if ((index + 1) * intsize > intlen)
1364 ++ if ((index + 1) * intsize > intlen) {
1365 ++ res = -EINVAL;
1366 + goto out;
1367 ++ }
1368 +
1369 + /* Copy intspec into irq structure */
1370 + intspec += index * intsize;
1371 +diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
1372 +index ff5eec5af817..2733112b3527 100644
1373 +--- a/drivers/phy/phy-core.c
1374 ++++ b/drivers/phy/phy-core.c
1375 +@@ -51,7 +51,9 @@ static void devm_phy_consume(struct device *dev, void *res)
1376 +
1377 + static int devm_phy_match(struct device *dev, void *res, void *match_data)
1378 + {
1379 +- return res == match_data;
1380 ++ struct phy **phy = res;
1381 ++
1382 ++ return *phy == match_data;
1383 + }
1384 +
1385 + static struct phy *phy_lookup(struct device *device, const char *port)
1386 +diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
1387 +index 1878e5b567ef..1a7f5fc11623 100644
1388 +--- a/drivers/regulator/palmas-regulator.c
1389 ++++ b/drivers/regulator/palmas-regulator.c
1390 +@@ -1572,6 +1572,10 @@ static int palmas_regulators_probe(struct platform_device *pdev)
1391 + if (!pmic)
1392 + return -ENOMEM;
1393 +
1394 ++ if (of_device_is_compatible(node, "ti,tps659038-pmic"))
1395 ++ palmas_generic_regs_info[PALMAS_REG_REGEN2].ctrl_addr =
1396 ++ TPS659038_REGEN2_CTRL;
1397 ++
1398 + pmic->dev = &pdev->dev;
1399 + pmic->palmas = palmas;
1400 + palmas->pmic = pmic;
1401 +diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
1402 +index 73f9feecda72..272a2646a759 100644
1403 +--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
1404 ++++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
1405 +@@ -1598,7 +1598,7 @@ static int tcm_qla2xxx_check_initiator_node_acl(
1406 + /*
1407 + * Finally register the new FC Nexus with TCM
1408 + */
1409 +- __transport_register_session(se_nacl->se_tpg, se_nacl, se_sess, sess);
1410 ++ transport_register_session(se_nacl->se_tpg, se_nacl, se_sess, sess);
1411 +
1412 + return 0;
1413 + }
1414 +diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
1415 +index 9f83d2950748..6976f8aa8562 100644
1416 +--- a/drivers/spi/spi-qup.c
1417 ++++ b/drivers/spi/spi-qup.c
1418 +@@ -489,7 +489,7 @@ static int spi_qup_probe(struct platform_device *pdev)
1419 + struct resource *res;
1420 + struct device *dev;
1421 + void __iomem *base;
1422 +- u32 max_freq, iomode;
1423 ++ u32 max_freq, iomode, num_cs;
1424 + int ret, irq, size;
1425 +
1426 + dev = &pdev->dev;
1427 +@@ -541,10 +541,11 @@ static int spi_qup_probe(struct platform_device *pdev)
1428 + }
1429 +
1430 + /* use num-cs unless not present or out of range */
1431 +- if (of_property_read_u16(dev->of_node, "num-cs",
1432 +- &master->num_chipselect) ||
1433 +- (master->num_chipselect > SPI_NUM_CHIPSELECTS))
1434 ++ if (of_property_read_u32(dev->of_node, "num-cs", &num_cs) ||
1435 ++ num_cs > SPI_NUM_CHIPSELECTS)
1436 + master->num_chipselect = SPI_NUM_CHIPSELECTS;
1437 ++ else
1438 ++ master->num_chipselect = num_cs;
1439 +
1440 + master->bus_num = pdev->id;
1441 + master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP;
1442 +diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
1443 +index 50f20f243981..1c72be19e70e 100644
1444 +--- a/drivers/spi/spi.c
1445 ++++ b/drivers/spi/spi.c
1446 +@@ -1073,13 +1073,14 @@ void spi_finalize_current_message(struct spi_master *master)
1447 + "failed to unprepare message: %d\n", ret);
1448 + }
1449 + }
1450 ++
1451 ++ trace_spi_message_done(mesg);
1452 ++
1453 + master->cur_msg_prepared = false;
1454 +
1455 + mesg->state = NULL;
1456 + if (mesg->complete)
1457 + mesg->complete(mesg->context);
1458 +-
1459 +- trace_spi_message_done(mesg);
1460 + }
1461 + EXPORT_SYMBOL_GPL(spi_finalize_current_message);
1462 +
1463 +diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
1464 +index e505af91bfd0..fb62e8dd11ba 100644
1465 +--- a/drivers/staging/vt6655/rf.c
1466 ++++ b/drivers/staging/vt6655/rf.c
1467 +@@ -923,6 +923,7 @@ bool RFbSetPower(
1468 + break;
1469 + case RATE_6M:
1470 + case RATE_9M:
1471 ++ case RATE_12M:
1472 + case RATE_18M:
1473 + byPwr = pDevice->abyOFDMPwrTbl[uCH];
1474 + if (pDevice->byRFType == RF_UW2452)
1475 +diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
1476 +index c42cde59f598..c4286ccac320 100644
1477 +--- a/drivers/staging/vt6656/rf.c
1478 ++++ b/drivers/staging/vt6656/rf.c
1479 +@@ -640,6 +640,7 @@ int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel)
1480 + break;
1481 + case RATE_6M:
1482 + case RATE_9M:
1483 ++ case RATE_12M:
1484 + case RATE_18M:
1485 + case RATE_24M:
1486 + case RATE_36M:
1487 +diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c
1488 +index 97b486c3dda1..583e755d8091 100644
1489 +--- a/drivers/target/tcm_fc/tfc_io.c
1490 ++++ b/drivers/target/tcm_fc/tfc_io.c
1491 +@@ -359,7 +359,7 @@ void ft_invl_hw_context(struct ft_cmd *cmd)
1492 + ep = fc_seq_exch(seq);
1493 + if (ep) {
1494 + lport = ep->lp;
1495 +- if (lport && (ep->xid <= lport->lro_xid))
1496 ++ if (lport && (ep->xid <= lport->lro_xid)) {
1497 + /*
1498 + * "ddp_done" trigger invalidation of HW
1499 + * specific DDP context
1500 +@@ -374,6 +374,7 @@ void ft_invl_hw_context(struct ft_cmd *cmd)
1501 + * identified using ep->xid)
1502 + */
1503 + cmd->was_ddp_setup = 0;
1504 ++ }
1505 + }
1506 + }
1507 + }
1508 +diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
1509 +index 0444d3f8971a..c42bf8da56db 100644
1510 +--- a/drivers/usb/chipidea/udc.c
1511 ++++ b/drivers/usb/chipidea/udc.c
1512 +@@ -933,6 +933,13 @@ __acquires(hwep->lock)
1513 + return retval;
1514 + }
1515 +
1516 ++static int otg_a_alt_hnp_support(struct ci_hdrc *ci)
1517 ++{
1518 ++ dev_warn(&ci->gadget.dev,
1519 ++ "connect the device to an alternate port if you want HNP\n");
1520 ++ return isr_setup_status_phase(ci);
1521 ++}
1522 ++
1523 + /**
1524 + * isr_setup_packet_handler: setup packet handler
1525 + * @ci: UDC descriptor
1526 +@@ -1065,6 +1072,10 @@ __acquires(ci->lock)
1527 + ci);
1528 + }
1529 + break;
1530 ++ case USB_DEVICE_A_ALT_HNP_SUPPORT:
1531 ++ if (ci_otg_is_fsm_mode(ci))
1532 ++ err = otg_a_alt_hnp_support(ci);
1533 ++ break;
1534 + default:
1535 + goto delegate;
1536 + }
1537 +diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c
1538 +index 98e8340a5bb1..c812fefe0e50 100644
1539 +--- a/drivers/usb/common/usb-otg-fsm.c
1540 ++++ b/drivers/usb/common/usb-otg-fsm.c
1541 +@@ -150,9 +150,9 @@ static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
1542 + break;
1543 + case OTG_STATE_B_PERIPHERAL:
1544 + otg_chrg_vbus(fsm, 0);
1545 +- otg_loc_conn(fsm, 1);
1546 + otg_loc_sof(fsm, 0);
1547 + otg_set_protocol(fsm, PROTO_GADGET);
1548 ++ otg_loc_conn(fsm, 1);
1549 + break;
1550 + case OTG_STATE_B_WAIT_ACON:
1551 + otg_chrg_vbus(fsm, 0);
1552 +@@ -213,10 +213,10 @@ static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
1553 +
1554 + break;
1555 + case OTG_STATE_A_PERIPHERAL:
1556 +- otg_loc_conn(fsm, 1);
1557 + otg_loc_sof(fsm, 0);
1558 + otg_set_protocol(fsm, PROTO_GADGET);
1559 + otg_drv_vbus(fsm, 1);
1560 ++ otg_loc_conn(fsm, 1);
1561 + otg_add_timer(fsm, A_BIDL_ADIS);
1562 + break;
1563 + case OTG_STATE_A_WAIT_VFALL:
1564 +diff --git a/drivers/usb/phy/phy-am335x-control.c b/drivers/usb/phy/phy-am335x-control.c
1565 +index 35b6083b7999..d5eca7b9c555 100644
1566 +--- a/drivers/usb/phy/phy-am335x-control.c
1567 ++++ b/drivers/usb/phy/phy-am335x-control.c
1568 +@@ -126,6 +126,9 @@ struct phy_control *am335x_get_phy_control(struct device *dev)
1569 + return NULL;
1570 +
1571 + dev = bus_find_device(&platform_bus_type, NULL, node, match);
1572 ++ if (!dev)
1573 ++ return NULL;
1574 ++
1575 + ctrl_usb = dev_get_drvdata(dev);
1576 + if (!ctrl_usb)
1577 + return NULL;
1578 +diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h
1579 +index cd047d0cc7a6..cd4ba61330c8 100644
1580 +--- a/drivers/usb/storage/unusual_uas.h
1581 ++++ b/drivers/usb/storage/unusual_uas.h
1582 +@@ -103,6 +103,13 @@ UNUSUAL_DEV(0x0bc2, 0xab2a, 0x0000, 0x9999,
1583 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1584 + US_FL_NO_ATA_1X),
1585 +
1586 ++/* Reported-by: Benjamin Tissoires <benjamin.tissoires@××××××.com> */
1587 ++UNUSUAL_DEV(0x13fd, 0x3940, 0x0000, 0x9999,
1588 ++ "Initio Corporation",
1589 ++ "",
1590 ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1591 ++ US_FL_NO_ATA_1X),
1592 ++
1593 + /* Reported-by: Tom Arild Naess <tanaess@×××××.com> */
1594 + UNUSUAL_DEV(0x152d, 0x0539, 0x0000, 0x9999,
1595 + "JMicron",
1596 +diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
1597 +index c9703d4d6f67..440d78f39c01 100644
1598 +--- a/drivers/virtio/virtio_balloon.c
1599 ++++ b/drivers/virtio/virtio_balloon.c
1600 +@@ -28,6 +28,7 @@
1601 + #include <linux/slab.h>
1602 + #include <linux/module.h>
1603 + #include <linux/balloon_compaction.h>
1604 ++#include <linux/wait.h>
1605 +
1606 + /*
1607 + * Balloon device works in 4K page units. So each page is pointed to by
1608 +@@ -290,17 +291,25 @@ static void update_balloon_size(struct virtio_balloon *vb)
1609 + static int balloon(void *_vballoon)
1610 + {
1611 + struct virtio_balloon *vb = _vballoon;
1612 ++ DEFINE_WAIT_FUNC(wait, woken_wake_function);
1613 +
1614 + set_freezable();
1615 + while (!kthread_should_stop()) {
1616 + s64 diff;
1617 +
1618 + try_to_freeze();
1619 +- wait_event_interruptible(vb->config_change,
1620 +- (diff = towards_target(vb)) != 0
1621 +- || vb->need_stats_update
1622 +- || kthread_should_stop()
1623 +- || freezing(current));
1624 ++
1625 ++ add_wait_queue(&vb->config_change, &wait);
1626 ++ for (;;) {
1627 ++ if ((diff = towards_target(vb)) != 0 ||
1628 ++ vb->need_stats_update ||
1629 ++ kthread_should_stop() ||
1630 ++ freezing(current))
1631 ++ break;
1632 ++ wait_woken(&wait, TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT);
1633 ++ }
1634 ++ remove_wait_queue(&vb->config_change, &wait);
1635 ++
1636 + if (vb->need_stats_update)
1637 + stats_handle_request(vb);
1638 + if (diff > 0)
1639 +@@ -443,6 +452,8 @@ static int virtballoon_probe(struct virtio_device *vdev)
1640 + if (err)
1641 + goto out_free_vb;
1642 +
1643 ++ virtio_device_ready(vdev);
1644 ++
1645 + vb->thread = kthread_run(balloon, vb, "vballoon");
1646 + if (IS_ERR(vb->thread)) {
1647 + err = PTR_ERR(vb->thread);
1648 +diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c
1649 +index 6e560d56094b..754fdf8c6356 100644
1650 +--- a/fs/hfsplus/brec.c
1651 ++++ b/fs/hfsplus/brec.c
1652 +@@ -131,13 +131,16 @@ skip:
1653 + hfs_bnode_write(node, entry, data_off + key_len, entry_len);
1654 + hfs_bnode_dump(node);
1655 +
1656 +- if (new_node) {
1657 +- /* update parent key if we inserted a key
1658 +- * at the start of the first node
1659 +- */
1660 +- if (!rec && new_node != node)
1661 +- hfs_brec_update_parent(fd);
1662 ++ /*
1663 ++ * update parent key if we inserted a key
1664 ++ * at the start of the node and it is not the new node
1665 ++ */
1666 ++ if (!rec && new_node != node) {
1667 ++ hfs_bnode_read_key(node, fd->search_key, data_off + size);
1668 ++ hfs_brec_update_parent(fd);
1669 ++ }
1670 +
1671 ++ if (new_node) {
1672 + hfs_bnode_put(fd->bnode);
1673 + if (!new_node->parent) {
1674 + hfs_btree_inc_height(tree);
1675 +@@ -168,9 +171,6 @@ skip:
1676 + goto again;
1677 + }
1678 +
1679 +- if (!rec)
1680 +- hfs_brec_update_parent(fd);
1681 +-
1682 + return 0;
1683 + }
1684 +
1685 +@@ -370,6 +370,8 @@ again:
1686 + if (IS_ERR(parent))
1687 + return PTR_ERR(parent);
1688 + __hfs_brec_find(parent, fd, hfs_find_rec_by_key);
1689 ++ if (fd->record < 0)
1690 ++ return -ENOENT;
1691 + hfs_bnode_dump(parent);
1692 + rec = fd->record;
1693 +
1694 +diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
1695 +index e1707de043ae..c51706b7a36e 100644
1696 +--- a/include/linux/device-mapper.h
1697 ++++ b/include/linux/device-mapper.h
1698 +@@ -366,6 +366,7 @@ int dm_create(int minor, struct mapped_device **md);
1699 + */
1700 + struct mapped_device *dm_get_md(dev_t dev);
1701 + void dm_get(struct mapped_device *md);
1702 ++int dm_hold(struct mapped_device *md);
1703 + void dm_put(struct mapped_device *md);
1704 +
1705 + /*
1706 +diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
1707 +index fb0390a1a498..ee7b1ce7a6f8 100644
1708 +--- a/include/linux/mfd/palmas.h
1709 ++++ b/include/linux/mfd/palmas.h
1710 +@@ -2999,6 +2999,9 @@ enum usb_irq_events {
1711 + #define PALMAS_GPADC_TRIM15 0x0E
1712 + #define PALMAS_GPADC_TRIM16 0x0F
1713 +
1714 ++/* TPS659038 regen2_ctrl offset iss different from palmas */
1715 ++#define TPS659038_REGEN2_CTRL 0x12
1716 ++
1717 + /* TPS65917 Interrupt registers */
1718 +
1719 + /* Registers for function INTERRUPT */
1720 +diff --git a/include/linux/wait.h b/include/linux/wait.h
1721 +index e4a8eb9312ea..fc0e99395fbb 100644
1722 +--- a/include/linux/wait.h
1723 ++++ b/include/linux/wait.h
1724 +@@ -13,9 +13,12 @@ typedef struct __wait_queue wait_queue_t;
1725 + typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key);
1726 + int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key);
1727 +
1728 ++/* __wait_queue::flags */
1729 ++#define WQ_FLAG_EXCLUSIVE 0x01
1730 ++#define WQ_FLAG_WOKEN 0x02
1731 ++
1732 + struct __wait_queue {
1733 + unsigned int flags;
1734 +-#define WQ_FLAG_EXCLUSIVE 0x01
1735 + void *private;
1736 + wait_queue_func_t func;
1737 + struct list_head task_list;
1738 +@@ -830,6 +833,8 @@ void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int sta
1739 + long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state);
1740 + void finish_wait(wait_queue_head_t *q, wait_queue_t *wait);
1741 + void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, unsigned int mode, void *key);
1742 ++long wait_woken(wait_queue_t *wait, unsigned mode, long timeout);
1743 ++int woken_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
1744 + int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
1745 + int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
1746 +
1747 +diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h
1748 +index 23d561512f64..22317d2b52ab 100644
1749 +--- a/include/trace/events/regmap.h
1750 ++++ b/include/trace/events/regmap.h
1751 +@@ -7,27 +7,26 @@
1752 + #include <linux/ktime.h>
1753 + #include <linux/tracepoint.h>
1754 +
1755 +-struct device;
1756 +-struct regmap;
1757 ++#include "../../../drivers/base/regmap/internal.h"
1758 +
1759 + /*
1760 + * Log register events
1761 + */
1762 + DECLARE_EVENT_CLASS(regmap_reg,
1763 +
1764 +- TP_PROTO(struct device *dev, unsigned int reg,
1765 ++ TP_PROTO(struct regmap *map, unsigned int reg,
1766 + unsigned int val),
1767 +
1768 +- TP_ARGS(dev, reg, val),
1769 ++ TP_ARGS(map, reg, val),
1770 +
1771 + TP_STRUCT__entry(
1772 +- __string( name, dev_name(dev) )
1773 +- __field( unsigned int, reg )
1774 +- __field( unsigned int, val )
1775 ++ __string( name, regmap_name(map) )
1776 ++ __field( unsigned int, reg )
1777 ++ __field( unsigned int, val )
1778 + ),
1779 +
1780 + TP_fast_assign(
1781 +- __assign_str(name, dev_name(dev));
1782 ++ __assign_str(name, regmap_name(map));
1783 + __entry->reg = reg;
1784 + __entry->val = val;
1785 + ),
1786 +@@ -39,45 +38,45 @@ DECLARE_EVENT_CLASS(regmap_reg,
1787 +
1788 + DEFINE_EVENT(regmap_reg, regmap_reg_write,
1789 +
1790 +- TP_PROTO(struct device *dev, unsigned int reg,
1791 ++ TP_PROTO(struct regmap *map, unsigned int reg,
1792 + unsigned int val),
1793 +
1794 +- TP_ARGS(dev, reg, val)
1795 ++ TP_ARGS(map, reg, val)
1796 +
1797 + );
1798 +
1799 + DEFINE_EVENT(regmap_reg, regmap_reg_read,
1800 +
1801 +- TP_PROTO(struct device *dev, unsigned int reg,
1802 ++ TP_PROTO(struct regmap *map, unsigned int reg,
1803 + unsigned int val),
1804 +
1805 +- TP_ARGS(dev, reg, val)
1806 ++ TP_ARGS(map, reg, val)
1807 +
1808 + );
1809 +
1810 + DEFINE_EVENT(regmap_reg, regmap_reg_read_cache,
1811 +
1812 +- TP_PROTO(struct device *dev, unsigned int reg,
1813 ++ TP_PROTO(struct regmap *map, unsigned int reg,
1814 + unsigned int val),
1815 +
1816 +- TP_ARGS(dev, reg, val)
1817 ++ TP_ARGS(map, reg, val)
1818 +
1819 + );
1820 +
1821 + DECLARE_EVENT_CLASS(regmap_block,
1822 +
1823 +- TP_PROTO(struct device *dev, unsigned int reg, int count),
1824 ++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
1825 +
1826 +- TP_ARGS(dev, reg, count),
1827 ++ TP_ARGS(map, reg, count),
1828 +
1829 + TP_STRUCT__entry(
1830 +- __string( name, dev_name(dev) )
1831 +- __field( unsigned int, reg )
1832 +- __field( int, count )
1833 ++ __string( name, regmap_name(map) )
1834 ++ __field( unsigned int, reg )
1835 ++ __field( int, count )
1836 + ),
1837 +
1838 + TP_fast_assign(
1839 +- __assign_str(name, dev_name(dev));
1840 ++ __assign_str(name, regmap_name(map));
1841 + __entry->reg = reg;
1842 + __entry->count = count;
1843 + ),
1844 +@@ -89,48 +88,48 @@ DECLARE_EVENT_CLASS(regmap_block,
1845 +
1846 + DEFINE_EVENT(regmap_block, regmap_hw_read_start,
1847 +
1848 +- TP_PROTO(struct device *dev, unsigned int reg, int count),
1849 ++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
1850 +
1851 +- TP_ARGS(dev, reg, count)
1852 ++ TP_ARGS(map, reg, count)
1853 + );
1854 +
1855 + DEFINE_EVENT(regmap_block, regmap_hw_read_done,
1856 +
1857 +- TP_PROTO(struct device *dev, unsigned int reg, int count),
1858 ++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
1859 +
1860 +- TP_ARGS(dev, reg, count)
1861 ++ TP_ARGS(map, reg, count)
1862 + );
1863 +
1864 + DEFINE_EVENT(regmap_block, regmap_hw_write_start,
1865 +
1866 +- TP_PROTO(struct device *dev, unsigned int reg, int count),
1867 ++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
1868 +
1869 +- TP_ARGS(dev, reg, count)
1870 ++ TP_ARGS(map, reg, count)
1871 + );
1872 +
1873 + DEFINE_EVENT(regmap_block, regmap_hw_write_done,
1874 +
1875 +- TP_PROTO(struct device *dev, unsigned int reg, int count),
1876 ++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
1877 +
1878 +- TP_ARGS(dev, reg, count)
1879 ++ TP_ARGS(map, reg, count)
1880 + );
1881 +
1882 + TRACE_EVENT(regcache_sync,
1883 +
1884 +- TP_PROTO(struct device *dev, const char *type,
1885 ++ TP_PROTO(struct regmap *map, const char *type,
1886 + const char *status),
1887 +
1888 +- TP_ARGS(dev, type, status),
1889 ++ TP_ARGS(map, type, status),
1890 +
1891 + TP_STRUCT__entry(
1892 +- __string( name, dev_name(dev) )
1893 +- __string( status, status )
1894 +- __string( type, type )
1895 +- __field( int, type )
1896 ++ __string( name, regmap_name(map) )
1897 ++ __string( status, status )
1898 ++ __string( type, type )
1899 ++ __field( int, type )
1900 + ),
1901 +
1902 + TP_fast_assign(
1903 +- __assign_str(name, dev_name(dev));
1904 ++ __assign_str(name, regmap_name(map));
1905 + __assign_str(status, status);
1906 + __assign_str(type, type);
1907 + ),
1908 +@@ -141,17 +140,17 @@ TRACE_EVENT(regcache_sync,
1909 +
1910 + DECLARE_EVENT_CLASS(regmap_bool,
1911 +
1912 +- TP_PROTO(struct device *dev, bool flag),
1913 ++ TP_PROTO(struct regmap *map, bool flag),
1914 +
1915 +- TP_ARGS(dev, flag),
1916 ++ TP_ARGS(map, flag),
1917 +
1918 + TP_STRUCT__entry(
1919 +- __string( name, dev_name(dev) )
1920 +- __field( int, flag )
1921 ++ __string( name, regmap_name(map) )
1922 ++ __field( int, flag )
1923 + ),
1924 +
1925 + TP_fast_assign(
1926 +- __assign_str(name, dev_name(dev));
1927 ++ __assign_str(name, regmap_name(map));
1928 + __entry->flag = flag;
1929 + ),
1930 +
1931 +@@ -161,32 +160,32 @@ DECLARE_EVENT_CLASS(regmap_bool,
1932 +
1933 + DEFINE_EVENT(regmap_bool, regmap_cache_only,
1934 +
1935 +- TP_PROTO(struct device *dev, bool flag),
1936 ++ TP_PROTO(struct regmap *map, bool flag),
1937 +
1938 +- TP_ARGS(dev, flag)
1939 ++ TP_ARGS(map, flag)
1940 +
1941 + );
1942 +
1943 + DEFINE_EVENT(regmap_bool, regmap_cache_bypass,
1944 +
1945 +- TP_PROTO(struct device *dev, bool flag),
1946 ++ TP_PROTO(struct regmap *map, bool flag),
1947 +
1948 +- TP_ARGS(dev, flag)
1949 ++ TP_ARGS(map, flag)
1950 +
1951 + );
1952 +
1953 + DECLARE_EVENT_CLASS(regmap_async,
1954 +
1955 +- TP_PROTO(struct device *dev),
1956 ++ TP_PROTO(struct regmap *map),
1957 +
1958 +- TP_ARGS(dev),
1959 ++ TP_ARGS(map),
1960 +
1961 + TP_STRUCT__entry(
1962 +- __string( name, dev_name(dev) )
1963 ++ __string( name, regmap_name(map) )
1964 + ),
1965 +
1966 + TP_fast_assign(
1967 +- __assign_str(name, dev_name(dev));
1968 ++ __assign_str(name, regmap_name(map));
1969 + ),
1970 +
1971 + TP_printk("%s", __get_str(name))
1972 +@@ -194,50 +193,50 @@ DECLARE_EVENT_CLASS(regmap_async,
1973 +
1974 + DEFINE_EVENT(regmap_block, regmap_async_write_start,
1975 +
1976 +- TP_PROTO(struct device *dev, unsigned int reg, int count),
1977 ++ TP_PROTO(struct regmap *map, unsigned int reg, int count),
1978 +
1979 +- TP_ARGS(dev, reg, count)
1980 ++ TP_ARGS(map, reg, count)
1981 + );
1982 +
1983 + DEFINE_EVENT(regmap_async, regmap_async_io_complete,
1984 +
1985 +- TP_PROTO(struct device *dev),
1986 ++ TP_PROTO(struct regmap *map),
1987 +
1988 +- TP_ARGS(dev)
1989 ++ TP_ARGS(map)
1990 +
1991 + );
1992 +
1993 + DEFINE_EVENT(regmap_async, regmap_async_complete_start,
1994 +
1995 +- TP_PROTO(struct device *dev),
1996 ++ TP_PROTO(struct regmap *map),
1997 +
1998 +- TP_ARGS(dev)
1999 ++ TP_ARGS(map)
2000 +
2001 + );
2002 +
2003 + DEFINE_EVENT(regmap_async, regmap_async_complete_done,
2004 +
2005 +- TP_PROTO(struct device *dev),
2006 ++ TP_PROTO(struct regmap *map),
2007 +
2008 +- TP_ARGS(dev)
2009 ++ TP_ARGS(map)
2010 +
2011 + );
2012 +
2013 + TRACE_EVENT(regcache_drop_region,
2014 +
2015 +- TP_PROTO(struct device *dev, unsigned int from,
2016 ++ TP_PROTO(struct regmap *map, unsigned int from,
2017 + unsigned int to),
2018 +
2019 +- TP_ARGS(dev, from, to),
2020 ++ TP_ARGS(map, from, to),
2021 +
2022 + TP_STRUCT__entry(
2023 +- __string( name, dev_name(dev) )
2024 +- __field( unsigned int, from )
2025 +- __field( unsigned int, to )
2026 ++ __string( name, regmap_name(map) )
2027 ++ __field( unsigned int, from )
2028 ++ __field( unsigned int, to )
2029 + ),
2030 +
2031 + TP_fast_assign(
2032 +- __assign_str(name, dev_name(dev));
2033 ++ __assign_str(name, regmap_name(map));
2034 + __entry->from = from;
2035 + __entry->to = to;
2036 + ),
2037 +diff --git a/kernel/events/core.c b/kernel/events/core.c
2038 +index 2ab023803945..e631dacdb165 100644
2039 +--- a/kernel/events/core.c
2040 ++++ b/kernel/events/core.c
2041 +@@ -4412,6 +4412,13 @@ static void perf_pending_event(struct irq_work *entry)
2042 + {
2043 + struct perf_event *event = container_of(entry,
2044 + struct perf_event, pending);
2045 ++ int rctx;
2046 ++
2047 ++ rctx = perf_swevent_get_recursion_context();
2048 ++ /*
2049 ++ * If we 'fail' here, that's OK, it means recursion is already disabled
2050 ++ * and we won't recurse 'further'.
2051 ++ */
2052 +
2053 + if (event->pending_disable) {
2054 + event->pending_disable = 0;
2055 +@@ -4422,6 +4429,9 @@ static void perf_pending_event(struct irq_work *entry)
2056 + event->pending_wakeup = 0;
2057 + perf_event_wakeup(event);
2058 + }
2059 ++
2060 ++ if (rctx >= 0)
2061 ++ perf_swevent_put_recursion_context(rctx);
2062 + }
2063 +
2064 + /*
2065 +diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c
2066 +index 5a62915f47a8..4dae1885db6f 100644
2067 +--- a/kernel/sched/wait.c
2068 ++++ b/kernel/sched/wait.c
2069 +@@ -297,6 +297,67 @@ int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *
2070 + }
2071 + EXPORT_SYMBOL(autoremove_wake_function);
2072 +
2073 ++
2074 ++/*
2075 ++ * DEFINE_WAIT_FUNC(wait, woken_wake_func);
2076 ++ *
2077 ++ * add_wait_queue(&wq, &wait);
2078 ++ * for (;;) {
2079 ++ * if (condition)
2080 ++ * break;
2081 ++ *
2082 ++ * p->state = mode; condition = true;
2083 ++ * smp_mb(); // A smp_wmb(); // C
2084 ++ * if (!wait->flags & WQ_FLAG_WOKEN) wait->flags |= WQ_FLAG_WOKEN;
2085 ++ * schedule() try_to_wake_up();
2086 ++ * p->state = TASK_RUNNING; ~~~~~~~~~~~~~~~~~~
2087 ++ * wait->flags &= ~WQ_FLAG_WOKEN; condition = true;
2088 ++ * smp_mb() // B smp_wmb(); // C
2089 ++ * wait->flags |= WQ_FLAG_WOKEN;
2090 ++ * }
2091 ++ * remove_wait_queue(&wq, &wait);
2092 ++ *
2093 ++ */
2094 ++long wait_woken(wait_queue_t *wait, unsigned mode, long timeout)
2095 ++{
2096 ++ set_current_state(mode); /* A */
2097 ++ /*
2098 ++ * The above implies an smp_mb(), which matches with the smp_wmb() from
2099 ++ * woken_wake_function() such that if we observe WQ_FLAG_WOKEN we must
2100 ++ * also observe all state before the wakeup.
2101 ++ */
2102 ++ if (!(wait->flags & WQ_FLAG_WOKEN))
2103 ++ timeout = schedule_timeout(timeout);
2104 ++ __set_current_state(TASK_RUNNING);
2105 ++
2106 ++ /*
2107 ++ * The below implies an smp_mb(), it too pairs with the smp_wmb() from
2108 ++ * woken_wake_function() such that we must either observe the wait
2109 ++ * condition being true _OR_ WQ_FLAG_WOKEN such that we will not miss
2110 ++ * an event.
2111 ++ */
2112 ++ set_mb(wait->flags, wait->flags & ~WQ_FLAG_WOKEN); /* B */
2113 ++
2114 ++ return timeout;
2115 ++}
2116 ++EXPORT_SYMBOL(wait_woken);
2117 ++
2118 ++int woken_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key)
2119 ++{
2120 ++ /*
2121 ++ * Although this function is called under waitqueue lock, LOCK
2122 ++ * doesn't imply write barrier and the users expects write
2123 ++ * barrier semantics on wakeup functions. The following
2124 ++ * smp_wmb() is equivalent to smp_wmb() in try_to_wake_up()
2125 ++ * and is paired with set_mb() in wait_woken().
2126 ++ */
2127 ++ smp_wmb(); /* C */
2128 ++ wait->flags |= WQ_FLAG_WOKEN;
2129 ++
2130 ++ return default_wake_function(wait, mode, sync, key);
2131 ++}
2132 ++EXPORT_SYMBOL(woken_wake_function);
2133 ++
2134 + int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *arg)
2135 + {
2136 + struct wait_bit_key *key = arg;
2137 +diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
2138 +index 8d1653caffdb..56a65536c8f1 100644
2139 +--- a/net/ceph/messenger.c
2140 ++++ b/net/ceph/messenger.c
2141 +@@ -484,7 +484,7 @@ static int ceph_tcp_connect(struct ceph_connection *con)
2142 + IPPROTO_TCP, &sock);
2143 + if (ret)
2144 + return ret;
2145 +- sock->sk->sk_allocation = GFP_NOFS | __GFP_MEMALLOC;
2146 ++ sock->sk->sk_allocation = GFP_NOFS;
2147 +
2148 + #ifdef CONFIG_LOCKDEP
2149 + lockdep_set_class(&sock->sk->sk_lock, &socket_class);
2150 +@@ -510,8 +510,6 @@ static int ceph_tcp_connect(struct ceph_connection *con)
2151 + return ret;
2152 + }
2153 +
2154 +- sk_set_memalloc(sock->sk);
2155 +-
2156 + con->sock = sock;
2157 + return 0;
2158 + }
2159 +@@ -2772,11 +2770,8 @@ static void con_work(struct work_struct *work)
2160 + {
2161 + struct ceph_connection *con = container_of(work, struct ceph_connection,
2162 + work.work);
2163 +- unsigned long pflags = current->flags;
2164 + bool fault;
2165 +
2166 +- current->flags |= PF_MEMALLOC;
2167 +-
2168 + mutex_lock(&con->mutex);
2169 + while (true) {
2170 + int ret;
2171 +@@ -2830,8 +2825,6 @@ static void con_work(struct work_struct *work)
2172 + con_fault_finish(con);
2173 +
2174 + con->ops->put(con);
2175 +-
2176 +- tsk_restore_flags(current, pflags, PF_MEMALLOC);
2177 + }
2178 +
2179 + /*
2180 +diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
2181 +index 8c68da30595d..91c1aca65ae9 100644
2182 +--- a/net/mac80211/ieee80211_i.h
2183 ++++ b/net/mac80211/ieee80211_i.h
2184 +@@ -58,13 +58,24 @@ struct ieee80211_local;
2185 + #define IEEE80211_UNSET_POWER_LEVEL INT_MIN
2186 +
2187 + /*
2188 +- * Some APs experience problems when working with U-APSD. Decrease the
2189 +- * probability of that happening by using legacy mode for all ACs but VO.
2190 +- * The AP that caused us trouble was a Cisco 4410N. It ignores our
2191 +- * setting, and always treats non-VO ACs as legacy.
2192 ++ * Some APs experience problems when working with U-APSD. Decreasing the
2193 ++ * probability of that happening by using legacy mode for all ACs but VO isn't
2194 ++ * enough.
2195 ++ *
2196 ++ * Cisco 4410N originally forced us to enable VO by default only because it
2197 ++ * treated non-VO ACs as legacy.
2198 ++ *
2199 ++ * However some APs (notably Netgear R7000) silently reclassify packets to
2200 ++ * different ACs. Since u-APSD ACs require trigger frames for frame retrieval
2201 ++ * clients would never see some frames (e.g. ARP responses) or would fetch them
2202 ++ * accidentally after a long time.
2203 ++ *
2204 ++ * It makes little sense to enable u-APSD queues by default because it needs
2205 ++ * userspace applications to be aware of it to actually take advantage of the
2206 ++ * possible additional powersavings. Implicitly depending on driver autotrigger
2207 ++ * frame support doesn't make much sense.
2208 + */
2209 +-#define IEEE80211_DEFAULT_UAPSD_QUEUES \
2210 +- IEEE80211_WMM_IE_STA_QOSINFO_AC_VO
2211 ++#define IEEE80211_DEFAULT_UAPSD_QUEUES 0
2212 +
2213 + #define IEEE80211_DEFAULT_MAX_SP_LEN \
2214 + IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL
2215 +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
2216 +index 7d6379bd2cb8..bb77d6d7258a 100644
2217 +--- a/net/mac80211/rx.c
2218 ++++ b/net/mac80211/rx.c
2219 +@@ -2108,6 +2108,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
2220 + hdr = (struct ieee80211_hdr *) skb->data;
2221 + mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);
2222 +
2223 ++ if (ieee80211_drop_unencrypted(rx, hdr->frame_control))
2224 ++ return RX_DROP_MONITOR;
2225 ++
2226 + /* frame is in RMC, don't forward */
2227 + if (ieee80211_is_data(hdr->frame_control) &&
2228 + is_multicast_ether_addr(hdr->addr1) &&
2229 +diff --git a/net/mac80211/util.c b/net/mac80211/util.c
2230 +index 3c61060a4d2b..0043256df486 100644
2231 +--- a/net/mac80211/util.c
2232 ++++ b/net/mac80211/util.c
2233 +@@ -3050,7 +3050,7 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata,
2234 + wdev_iter = &sdata_iter->wdev;
2235 +
2236 + if (sdata_iter == sdata ||
2237 +- rcu_access_pointer(sdata_iter->vif.chanctx_conf) == NULL ||
2238 ++ !ieee80211_sdata_running(sdata_iter) ||
2239 + local->hw.wiphy->software_iftypes & BIT(wdev_iter->iftype))
2240 + continue;
2241 +
2242 +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
2243 +index 213048ad31c7..5fed79cfe45a 100644
2244 +--- a/net/wireless/nl80211.c
2245 ++++ b/net/wireless/nl80211.c
2246 +@@ -4311,6 +4311,16 @@ static int nl80211_new_station(struct sk_buff *skb, struct genl_info *info)
2247 + if (parse_station_flags(info, dev->ieee80211_ptr->iftype, &params))
2248 + return -EINVAL;
2249 +
2250 ++ /* HT/VHT requires QoS, but if we don't have that just ignore HT/VHT
2251 ++ * as userspace might just pass through the capabilities from the IEs
2252 ++ * directly, rather than enforcing this restriction and returning an
2253 ++ * error in this case.
2254 ++ */
2255 ++ if (!(params.sta_flags_set & BIT(NL80211_STA_FLAG_WME))) {
2256 ++ params.ht_capa = NULL;
2257 ++ params.vht_capa = NULL;
2258 ++ }
2259 ++
2260 + /* When you run into this, adjust the code below for the new flag */
2261 + BUILD_BUG_ON(NL80211_STA_FLAG_MAX != 7);
2262 +
2263 +diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c
2264 +index ce3cdca9fc62..01ab70a7f59f 100644
2265 +--- a/sound/soc/codecs/adav80x.c
2266 ++++ b/sound/soc/codecs/adav80x.c
2267 +@@ -317,7 +317,7 @@ static int adav80x_put_deemph(struct snd_kcontrol *kcontrol,
2268 + {
2269 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2270 + struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);
2271 +- unsigned int deemph = ucontrol->value.enumerated.item[0];
2272 ++ unsigned int deemph = ucontrol->value.integer.value[0];
2273 +
2274 + if (deemph > 1)
2275 + return -EINVAL;
2276 +@@ -333,7 +333,7 @@ static int adav80x_get_deemph(struct snd_kcontrol *kcontrol,
2277 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2278 + struct adav80x *adav80x = snd_soc_codec_get_drvdata(codec);
2279 +
2280 +- ucontrol->value.enumerated.item[0] = adav80x->deemph;
2281 ++ ucontrol->value.integer.value[0] = adav80x->deemph;
2282 + return 0;
2283 + };
2284 +
2285 +diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c
2286 +index 7afe8f482088..570ec04fe411 100644
2287 +--- a/sound/soc/codecs/ak4641.c
2288 ++++ b/sound/soc/codecs/ak4641.c
2289 +@@ -76,7 +76,7 @@ static int ak4641_put_deemph(struct snd_kcontrol *kcontrol,
2290 + {
2291 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2292 + struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec);
2293 +- int deemph = ucontrol->value.enumerated.item[0];
2294 ++ int deemph = ucontrol->value.integer.value[0];
2295 +
2296 + if (deemph > 1)
2297 + return -EINVAL;
2298 +@@ -92,7 +92,7 @@ static int ak4641_get_deemph(struct snd_kcontrol *kcontrol,
2299 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2300 + struct ak4641_priv *ak4641 = snd_soc_codec_get_drvdata(codec);
2301 +
2302 +- ucontrol->value.enumerated.item[0] = ak4641->deemph;
2303 ++ ucontrol->value.integer.value[0] = ak4641->deemph;
2304 + return 0;
2305 + };
2306 +
2307 +diff --git a/sound/soc/codecs/ak4671.c b/sound/soc/codecs/ak4671.c
2308 +index 998fa0c5a0b9..61a31802cf79 100644
2309 +--- a/sound/soc/codecs/ak4671.c
2310 ++++ b/sound/soc/codecs/ak4671.c
2311 +@@ -343,25 +343,25 @@ static const struct snd_soc_dapm_widget ak4671_dapm_widgets[] = {
2312 + };
2313 +
2314 + static const struct snd_soc_dapm_route ak4671_intercon[] = {
2315 +- {"DAC Left", "NULL", "PMPLL"},
2316 +- {"DAC Right", "NULL", "PMPLL"},
2317 +- {"ADC Left", "NULL", "PMPLL"},
2318 +- {"ADC Right", "NULL", "PMPLL"},
2319 ++ {"DAC Left", NULL, "PMPLL"},
2320 ++ {"DAC Right", NULL, "PMPLL"},
2321 ++ {"ADC Left", NULL, "PMPLL"},
2322 ++ {"ADC Right", NULL, "PMPLL"},
2323 +
2324 + /* Outputs */
2325 +- {"LOUT1", "NULL", "LOUT1 Mixer"},
2326 +- {"ROUT1", "NULL", "ROUT1 Mixer"},
2327 +- {"LOUT2", "NULL", "LOUT2 Mix Amp"},
2328 +- {"ROUT2", "NULL", "ROUT2 Mix Amp"},
2329 +- {"LOUT3", "NULL", "LOUT3 Mixer"},
2330 +- {"ROUT3", "NULL", "ROUT3 Mixer"},
2331 ++ {"LOUT1", NULL, "LOUT1 Mixer"},
2332 ++ {"ROUT1", NULL, "ROUT1 Mixer"},
2333 ++ {"LOUT2", NULL, "LOUT2 Mix Amp"},
2334 ++ {"ROUT2", NULL, "ROUT2 Mix Amp"},
2335 ++ {"LOUT3", NULL, "LOUT3 Mixer"},
2336 ++ {"ROUT3", NULL, "ROUT3 Mixer"},
2337 +
2338 + {"LOUT1 Mixer", "DACL", "DAC Left"},
2339 + {"ROUT1 Mixer", "DACR", "DAC Right"},
2340 + {"LOUT2 Mixer", "DACHL", "DAC Left"},
2341 + {"ROUT2 Mixer", "DACHR", "DAC Right"},
2342 +- {"LOUT2 Mix Amp", "NULL", "LOUT2 Mixer"},
2343 +- {"ROUT2 Mix Amp", "NULL", "ROUT2 Mixer"},
2344 ++ {"LOUT2 Mix Amp", NULL, "LOUT2 Mixer"},
2345 ++ {"ROUT2 Mix Amp", NULL, "ROUT2 Mixer"},
2346 + {"LOUT3 Mixer", "DACSL", "DAC Left"},
2347 + {"ROUT3 Mixer", "DACSR", "DAC Right"},
2348 +
2349 +@@ -381,18 +381,18 @@ static const struct snd_soc_dapm_route ak4671_intercon[] = {
2350 + {"LIN2", NULL, "Mic Bias"},
2351 + {"RIN2", NULL, "Mic Bias"},
2352 +
2353 +- {"ADC Left", "NULL", "LIN MUX"},
2354 +- {"ADC Right", "NULL", "RIN MUX"},
2355 ++ {"ADC Left", NULL, "LIN MUX"},
2356 ++ {"ADC Right", NULL, "RIN MUX"},
2357 +
2358 + /* Analog Loops */
2359 +- {"LIN1 Mixing Circuit", "NULL", "LIN1"},
2360 +- {"RIN1 Mixing Circuit", "NULL", "RIN1"},
2361 +- {"LIN2 Mixing Circuit", "NULL", "LIN2"},
2362 +- {"RIN2 Mixing Circuit", "NULL", "RIN2"},
2363 +- {"LIN3 Mixing Circuit", "NULL", "LIN3"},
2364 +- {"RIN3 Mixing Circuit", "NULL", "RIN3"},
2365 +- {"LIN4 Mixing Circuit", "NULL", "LIN4"},
2366 +- {"RIN4 Mixing Circuit", "NULL", "RIN4"},
2367 ++ {"LIN1 Mixing Circuit", NULL, "LIN1"},
2368 ++ {"RIN1 Mixing Circuit", NULL, "RIN1"},
2369 ++ {"LIN2 Mixing Circuit", NULL, "LIN2"},
2370 ++ {"RIN2 Mixing Circuit", NULL, "RIN2"},
2371 ++ {"LIN3 Mixing Circuit", NULL, "LIN3"},
2372 ++ {"RIN3 Mixing Circuit", NULL, "RIN3"},
2373 ++ {"LIN4 Mixing Circuit", NULL, "LIN4"},
2374 ++ {"RIN4 Mixing Circuit", NULL, "RIN4"},
2375 +
2376 + {"LOUT1 Mixer", "LINL1", "LIN1 Mixing Circuit"},
2377 + {"ROUT1 Mixer", "RINR1", "RIN1 Mixing Circuit"},
2378 +diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
2379 +index 93cec52f4733..6ec074fec068 100644
2380 +--- a/sound/soc/codecs/cs4271.c
2381 ++++ b/sound/soc/codecs/cs4271.c
2382 +@@ -287,7 +287,7 @@ static int cs4271_get_deemph(struct snd_kcontrol *kcontrol,
2383 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2384 + struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
2385 +
2386 +- ucontrol->value.enumerated.item[0] = cs4271->deemph;
2387 ++ ucontrol->value.integer.value[0] = cs4271->deemph;
2388 + return 0;
2389 + }
2390 +
2391 +@@ -297,7 +297,7 @@ static int cs4271_put_deemph(struct snd_kcontrol *kcontrol,
2392 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2393 + struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
2394 +
2395 +- cs4271->deemph = ucontrol->value.enumerated.item[0];
2396 ++ cs4271->deemph = ucontrol->value.integer.value[0];
2397 + return cs4271_set_deemph(codec);
2398 + }
2399 +
2400 +diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c
2401 +index 61b2f9a2eef1..e3110c67f3b2 100644
2402 +--- a/sound/soc/codecs/da732x.c
2403 ++++ b/sound/soc/codecs/da732x.c
2404 +@@ -876,11 +876,11 @@ static const struct snd_soc_dapm_widget da732x_dapm_widgets[] = {
2405 +
2406 + static const struct snd_soc_dapm_route da732x_dapm_routes[] = {
2407 + /* Inputs */
2408 +- {"AUX1L PGA", "NULL", "AUX1L"},
2409 +- {"AUX1R PGA", "NULL", "AUX1R"},
2410 ++ {"AUX1L PGA", NULL, "AUX1L"},
2411 ++ {"AUX1R PGA", NULL, "AUX1R"},
2412 + {"MIC1 PGA", NULL, "MIC1"},
2413 +- {"MIC2 PGA", "NULL", "MIC2"},
2414 +- {"MIC3 PGA", "NULL", "MIC3"},
2415 ++ {"MIC2 PGA", NULL, "MIC2"},
2416 ++ {"MIC3 PGA", NULL, "MIC3"},
2417 +
2418 + /* Capture Path */
2419 + {"ADC1 Left MUX", "MIC1", "MIC1 PGA"},
2420 +diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c
2421 +index f27325155ace..c5f35a07e8e4 100644
2422 +--- a/sound/soc/codecs/es8328.c
2423 ++++ b/sound/soc/codecs/es8328.c
2424 +@@ -120,7 +120,7 @@ static int es8328_get_deemph(struct snd_kcontrol *kcontrol,
2425 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2426 + struct es8328_priv *es8328 = snd_soc_codec_get_drvdata(codec);
2427 +
2428 +- ucontrol->value.enumerated.item[0] = es8328->deemph;
2429 ++ ucontrol->value.integer.value[0] = es8328->deemph;
2430 + return 0;
2431 + }
2432 +
2433 +@@ -129,7 +129,7 @@ static int es8328_put_deemph(struct snd_kcontrol *kcontrol,
2434 + {
2435 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2436 + struct es8328_priv *es8328 = snd_soc_codec_get_drvdata(codec);
2437 +- int deemph = ucontrol->value.enumerated.item[0];
2438 ++ int deemph = ucontrol->value.integer.value[0];
2439 + int ret;
2440 +
2441 + if (deemph > 1)
2442 +diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c
2443 +index a722a023c262..477e13d30971 100644
2444 +--- a/sound/soc/codecs/pcm1681.c
2445 ++++ b/sound/soc/codecs/pcm1681.c
2446 +@@ -118,7 +118,7 @@ static int pcm1681_get_deemph(struct snd_kcontrol *kcontrol,
2447 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2448 + struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec);
2449 +
2450 +- ucontrol->value.enumerated.item[0] = priv->deemph;
2451 ++ ucontrol->value.integer.value[0] = priv->deemph;
2452 +
2453 + return 0;
2454 + }
2455 +@@ -129,7 +129,7 @@ static int pcm1681_put_deemph(struct snd_kcontrol *kcontrol,
2456 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2457 + struct pcm1681_private *priv = snd_soc_codec_get_drvdata(codec);
2458 +
2459 +- priv->deemph = ucontrol->value.enumerated.item[0];
2460 ++ priv->deemph = ucontrol->value.integer.value[0];
2461 +
2462 + return pcm1681_set_deemph(codec);
2463 + }
2464 +diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
2465 +index f1287ff8dd29..7de7431efcb3 100644
2466 +--- a/sound/soc/codecs/sgtl5000.c
2467 ++++ b/sound/soc/codecs/sgtl5000.c
2468 +@@ -1136,13 +1136,7 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)
2469 + /* Enable VDDC charge pump */
2470 + ana_pwr |= SGTL5000_VDDC_CHRGPMP_POWERUP;
2471 + } else if (vddio >= 3100 && vdda >= 3100) {
2472 +- /*
2473 +- * if vddio and vddd > 3.1v,
2474 +- * charge pump should be clean before set ana_pwr
2475 +- */
2476 +- snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER,
2477 +- SGTL5000_VDDC_CHRGPMP_POWERUP, 0);
2478 +-
2479 ++ ana_pwr &= ~SGTL5000_VDDC_CHRGPMP_POWERUP;
2480 + /* VDDC use VDDIO rail */
2481 + lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD;
2482 + lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO <<
2483 +diff --git a/sound/soc/codecs/sn95031.c b/sound/soc/codecs/sn95031.c
2484 +index cf8fa40662f0..01af05172452 100644
2485 +--- a/sound/soc/codecs/sn95031.c
2486 ++++ b/sound/soc/codecs/sn95031.c
2487 +@@ -531,8 +531,8 @@ static const struct snd_soc_dapm_route sn95031_audio_map[] = {
2488 + /* speaker map */
2489 + { "IHFOUTL", NULL, "Speaker Rail"},
2490 + { "IHFOUTR", NULL, "Speaker Rail"},
2491 +- { "IHFOUTL", "NULL", "Speaker Left Playback"},
2492 +- { "IHFOUTR", "NULL", "Speaker Right Playback"},
2493 ++ { "IHFOUTL", NULL, "Speaker Left Playback"},
2494 ++ { "IHFOUTR", NULL, "Speaker Right Playback"},
2495 + { "Speaker Left Playback", NULL, "Speaker Left Filter"},
2496 + { "Speaker Right Playback", NULL, "Speaker Right Filter"},
2497 + { "Speaker Left Filter", NULL, "IHFDAC Left"},
2498 +diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
2499 +index 249ef5c4c762..32942bed34b1 100644
2500 +--- a/sound/soc/codecs/tas5086.c
2501 ++++ b/sound/soc/codecs/tas5086.c
2502 +@@ -281,7 +281,7 @@ static int tas5086_get_deemph(struct snd_kcontrol *kcontrol,
2503 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2504 + struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);
2505 +
2506 +- ucontrol->value.enumerated.item[0] = priv->deemph;
2507 ++ ucontrol->value.integer.value[0] = priv->deemph;
2508 +
2509 + return 0;
2510 + }
2511 +@@ -292,7 +292,7 @@ static int tas5086_put_deemph(struct snd_kcontrol *kcontrol,
2512 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2513 + struct tas5086_private *priv = snd_soc_codec_get_drvdata(codec);
2514 +
2515 +- priv->deemph = ucontrol->value.enumerated.item[0];
2516 ++ priv->deemph = ucontrol->value.integer.value[0];
2517 +
2518 + return tas5086_set_deemph(codec);
2519 + }
2520 +diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
2521 +index 34ef65c52a7d..8eeab47a4235 100644
2522 +--- a/sound/soc/codecs/wm2000.c
2523 ++++ b/sound/soc/codecs/wm2000.c
2524 +@@ -610,7 +610,7 @@ static int wm2000_anc_mode_get(struct snd_kcontrol *kcontrol,
2525 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2526 + struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
2527 +
2528 +- ucontrol->value.enumerated.item[0] = wm2000->anc_active;
2529 ++ ucontrol->value.integer.value[0] = wm2000->anc_active;
2530 +
2531 + return 0;
2532 + }
2533 +@@ -620,7 +620,7 @@ static int wm2000_anc_mode_put(struct snd_kcontrol *kcontrol,
2534 + {
2535 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2536 + struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
2537 +- int anc_active = ucontrol->value.enumerated.item[0];
2538 ++ int anc_active = ucontrol->value.integer.value[0];
2539 + int ret;
2540 +
2541 + if (anc_active > 1)
2542 +@@ -643,7 +643,7 @@ static int wm2000_speaker_get(struct snd_kcontrol *kcontrol,
2543 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2544 + struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
2545 +
2546 +- ucontrol->value.enumerated.item[0] = wm2000->spk_ena;
2547 ++ ucontrol->value.integer.value[0] = wm2000->spk_ena;
2548 +
2549 + return 0;
2550 + }
2551 +@@ -653,7 +653,7 @@ static int wm2000_speaker_put(struct snd_kcontrol *kcontrol,
2552 + {
2553 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2554 + struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev);
2555 +- int val = ucontrol->value.enumerated.item[0];
2556 ++ int val = ucontrol->value.integer.value[0];
2557 + int ret;
2558 +
2559 + if (val > 1)
2560 +diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
2561 +index eebb3280bfad..19a53dca3433 100644
2562 +--- a/sound/soc/codecs/wm8731.c
2563 ++++ b/sound/soc/codecs/wm8731.c
2564 +@@ -122,7 +122,7 @@ static int wm8731_get_deemph(struct snd_kcontrol *kcontrol,
2565 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2566 + struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
2567 +
2568 +- ucontrol->value.enumerated.item[0] = wm8731->deemph;
2569 ++ ucontrol->value.integer.value[0] = wm8731->deemph;
2570 +
2571 + return 0;
2572 + }
2573 +@@ -132,7 +132,7 @@ static int wm8731_put_deemph(struct snd_kcontrol *kcontrol,
2574 + {
2575 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2576 + struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(codec);
2577 +- int deemph = ucontrol->value.enumerated.item[0];
2578 ++ int deemph = ucontrol->value.integer.value[0];
2579 + int ret = 0;
2580 +
2581 + if (deemph > 1)
2582 +diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
2583 +index c038b3e04398..5b758756dd80 100644
2584 +--- a/sound/soc/codecs/wm8903.c
2585 ++++ b/sound/soc/codecs/wm8903.c
2586 +@@ -441,7 +441,7 @@ static int wm8903_get_deemph(struct snd_kcontrol *kcontrol,
2587 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2588 + struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
2589 +
2590 +- ucontrol->value.enumerated.item[0] = wm8903->deemph;
2591 ++ ucontrol->value.integer.value[0] = wm8903->deemph;
2592 +
2593 + return 0;
2594 + }
2595 +@@ -451,7 +451,7 @@ static int wm8903_put_deemph(struct snd_kcontrol *kcontrol,
2596 + {
2597 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2598 + struct wm8903_priv *wm8903 = snd_soc_codec_get_drvdata(codec);
2599 +- int deemph = ucontrol->value.enumerated.item[0];
2600 ++ int deemph = ucontrol->value.integer.value[0];
2601 + int ret = 0;
2602 +
2603 + if (deemph > 1)
2604 +diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
2605 +index 4d2d2b1380d5..af2446f16cdd 100644
2606 +--- a/sound/soc/codecs/wm8904.c
2607 ++++ b/sound/soc/codecs/wm8904.c
2608 +@@ -525,7 +525,7 @@ static int wm8904_get_deemph(struct snd_kcontrol *kcontrol,
2609 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2610 + struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
2611 +
2612 +- ucontrol->value.enumerated.item[0] = wm8904->deemph;
2613 ++ ucontrol->value.integer.value[0] = wm8904->deemph;
2614 + return 0;
2615 + }
2616 +
2617 +@@ -534,7 +534,7 @@ static int wm8904_put_deemph(struct snd_kcontrol *kcontrol,
2618 + {
2619 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2620 + struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
2621 +- int deemph = ucontrol->value.enumerated.item[0];
2622 ++ int deemph = ucontrol->value.integer.value[0];
2623 +
2624 + if (deemph > 1)
2625 + return -EINVAL;
2626 +diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c
2627 +index 09d91d9dc4ee..7d0b01bcab4b 100644
2628 +--- a/sound/soc/codecs/wm8955.c
2629 ++++ b/sound/soc/codecs/wm8955.c
2630 +@@ -393,7 +393,7 @@ static int wm8955_get_deemph(struct snd_kcontrol *kcontrol,
2631 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2632 + struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec);
2633 +
2634 +- ucontrol->value.enumerated.item[0] = wm8955->deemph;
2635 ++ ucontrol->value.integer.value[0] = wm8955->deemph;
2636 + return 0;
2637 + }
2638 +
2639 +@@ -402,7 +402,7 @@ static int wm8955_put_deemph(struct snd_kcontrol *kcontrol,
2640 + {
2641 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2642 + struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec);
2643 +- int deemph = ucontrol->value.enumerated.item[0];
2644 ++ int deemph = ucontrol->value.integer.value[0];
2645 +
2646 + if (deemph > 1)
2647 + return -EINVAL;
2648 +diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
2649 +index 641f940c138d..ab9931c280b2 100644
2650 +--- a/sound/soc/codecs/wm8960.c
2651 ++++ b/sound/soc/codecs/wm8960.c
2652 +@@ -181,7 +181,7 @@ static int wm8960_get_deemph(struct snd_kcontrol *kcontrol,
2653 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2654 + struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
2655 +
2656 +- ucontrol->value.enumerated.item[0] = wm8960->deemph;
2657 ++ ucontrol->value.integer.value[0] = wm8960->deemph;
2658 + return 0;
2659 + }
2660 +
2661 +@@ -190,7 +190,7 @@ static int wm8960_put_deemph(struct snd_kcontrol *kcontrol,
2662 + {
2663 + struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);
2664 + struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
2665 +- int deemph = ucontrol->value.enumerated.item[0];
2666 ++ int deemph = ucontrol->value.integer.value[0];
2667 +
2668 + if (deemph > 1)
2669 + return -EINVAL;