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