/[linux-patches]/genpatches-2.6/tags/2.6.32-47/1020_linux-2.6.32.21.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.32-47/1020_linux-2.6.32.21.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2037 - (show annotations) (download)
Wed Dec 28 14:38:55 2011 UTC (6 years, 6 months ago) by psomas
File size: 68313 byte(s)
2.6.32-47 release
1 diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
2 index bbecccd..1df6457 100644
3 --- a/arch/arm/include/asm/ptrace.h
4 +++ b/arch/arm/include/asm/ptrace.h
5 @@ -150,15 +150,24 @@ struct pt_regs {
6 */
7 static inline int valid_user_regs(struct pt_regs *regs)
8 {
9 - if (user_mode(regs) && (regs->ARM_cpsr & PSR_I_BIT) == 0) {
10 - regs->ARM_cpsr &= ~(PSR_F_BIT | PSR_A_BIT);
11 - return 1;
12 + unsigned long mode = regs->ARM_cpsr & MODE_MASK;
13 +
14 + /*
15 + * Always clear the F (FIQ) and A (delayed abort) bits
16 + */
17 + regs->ARM_cpsr &= ~(PSR_F_BIT | PSR_A_BIT);
18 +
19 + if ((regs->ARM_cpsr & PSR_I_BIT) == 0) {
20 + if (mode == USR_MODE)
21 + return 1;
22 + if (elf_hwcap & HWCAP_26BIT && mode == USR26_MODE)
23 + return 1;
24 }
25
26 /*
27 * Force CPSR to something logical...
28 */
29 - regs->ARM_cpsr &= PSR_f | PSR_s | (PSR_x & ~PSR_A_BIT) | PSR_T_BIT | MODE32_BIT;
30 + regs->ARM_cpsr &= PSR_f | PSR_s | PSR_x | PSR_T_BIT | MODE32_BIT;
31 if (!(elf_hwcap & HWCAP_26BIT))
32 regs->ARM_cpsr |= USR_MODE;
33
34 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
35 index 7546e2c..c107b74 100644
36 --- a/arch/powerpc/Makefile
37 +++ b/arch/powerpc/Makefile
38 @@ -159,7 +159,7 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
39 all: zImage
40
41 # With make 3.82 we cannot mix normal and wildcard targets
42 -BOOT_TARGETS1 := zImage zImage.initrd uImaged
43 +BOOT_TARGETS1 := zImage zImage.initrd uImage
44 BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
45
46 PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
47 diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h
48 index f2e4800..f5cc06f 100644
49 --- a/arch/sparc/include/asm/atomic_64.h
50 +++ b/arch/sparc/include/asm/atomic_64.h
51 @@ -20,14 +20,14 @@
52 #define atomic64_set(v, i) (((v)->counter) = i)
53
54 extern void atomic_add(int, atomic_t *);
55 -extern void atomic64_add(int, atomic64_t *);
56 +extern void atomic64_add(long, atomic64_t *);
57 extern void atomic_sub(int, atomic_t *);
58 -extern void atomic64_sub(int, atomic64_t *);
59 +extern void atomic64_sub(long, atomic64_t *);
60
61 extern int atomic_add_ret(int, atomic_t *);
62 -extern int atomic64_add_ret(int, atomic64_t *);
63 +extern long atomic64_add_ret(long, atomic64_t *);
64 extern int atomic_sub_ret(int, atomic_t *);
65 -extern int atomic64_sub_ret(int, atomic64_t *);
66 +extern long atomic64_sub_ret(long, atomic64_t *);
67
68 #define atomic_dec_return(v) atomic_sub_ret(1, v)
69 #define atomic64_dec_return(v) atomic64_sub_ret(1, v)
70 @@ -91,7 +91,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
71 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
72 #define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
73
74 -static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
75 +static inline long atomic64_add_unless(atomic64_t *v, long a, long u)
76 {
77 long c, old;
78 c = atomic64_read(v);
79 diff --git a/arch/sparc/include/asm/parport.h b/arch/sparc/include/asm/parport.h
80 index ff9ead6..43cf002 100644
81 --- a/arch/sparc/include/asm/parport.h
82 +++ b/arch/sparc/include/asm/parport.h
83 @@ -228,6 +228,10 @@ static const struct of_device_id ecpp_match[] = {
84 .name = "parallel",
85 .compatible = "ns87317-ecpp",
86 },
87 + {
88 + .name = "parallel",
89 + .compatible = "pnpALI,1533,3",
90 + },
91 {},
92 };
93
94 diff --git a/arch/sparc/include/asm/rwsem-const.h b/arch/sparc/include/asm/rwsem-const.h
95 index a303c9d..e4c61a1 100644
96 --- a/arch/sparc/include/asm/rwsem-const.h
97 +++ b/arch/sparc/include/asm/rwsem-const.h
98 @@ -5,7 +5,7 @@
99 #define RWSEM_UNLOCKED_VALUE 0x00000000
100 #define RWSEM_ACTIVE_BIAS 0x00000001
101 #define RWSEM_ACTIVE_MASK 0x0000ffff
102 -#define RWSEM_WAITING_BIAS 0xffff0000
103 +#define RWSEM_WAITING_BIAS (-0x00010000)
104 #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
105 #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
106
107 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
108 index fbc161d..cb5a57c 100644
109 --- a/arch/x86/Kconfig
110 +++ b/arch/x86/Kconfig
111 @@ -227,6 +227,11 @@ config X86_32_LAZY_GS
112
113 config KTIME_SCALAR
114 def_bool X86_32
115 +
116 +config ARCH_CPU_PROBE_RELEASE
117 + def_bool y
118 + depends on HOTPLUG_CPU
119 +
120 source "init/Kconfig"
121 source "kernel/Kconfig.freezer"
122
123 diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
124 index bc9cd5a..6702ab7 100644
125 --- a/arch/x86/kernel/apic/apic.c
126 +++ b/arch/x86/kernel/apic/apic.c
127 @@ -51,6 +51,7 @@
128 #include <asm/smp.h>
129 #include <asm/mce.h>
130 #include <asm/kvm_para.h>
131 +#include <asm/tsc.h>
132
133 unsigned int num_processors;
134
135 @@ -1172,8 +1173,13 @@ static void __cpuinit lapic_setup_esr(void)
136 */
137 void __cpuinit setup_local_APIC(void)
138 {
139 - unsigned int value;
140 - int i, j;
141 + unsigned int value, queued;
142 + int i, j, acked = 0;
143 + unsigned long long tsc = 0, ntsc;
144 + long long max_loops = cpu_khz;
145 +
146 + if (cpu_has_tsc)
147 + rdtscll(tsc);
148
149 if (disable_apic) {
150 arch_disable_smp_support();
151 @@ -1225,13 +1231,32 @@ void __cpuinit setup_local_APIC(void)
152 * the interrupt. Hence a vector might get locked. It was noticed
153 * for timer irq (vector 0x31). Issue an extra EOI to clear ISR.
154 */
155 - for (i = APIC_ISR_NR - 1; i >= 0; i--) {
156 - value = apic_read(APIC_ISR + i*0x10);
157 - for (j = 31; j >= 0; j--) {
158 - if (value & (1<<j))
159 - ack_APIC_irq();
160 + do {
161 + queued = 0;
162 + for (i = APIC_ISR_NR - 1; i >= 0; i--)
163 + queued |= apic_read(APIC_IRR + i*0x10);
164 +
165 + for (i = APIC_ISR_NR - 1; i >= 0; i--) {
166 + value = apic_read(APIC_ISR + i*0x10);
167 + for (j = 31; j >= 0; j--) {
168 + if (value & (1<<j)) {
169 + ack_APIC_irq();
170 + acked++;
171 + }
172 + }
173 }
174 - }
175 + if (acked > 256) {
176 + printk(KERN_ERR "LAPIC pending interrupts after %d EOI\n",
177 + acked);
178 + break;
179 + }
180 + if (cpu_has_tsc) {
181 + rdtscll(ntsc);
182 + max_loops = (cpu_khz << 10) - (ntsc - tsc);
183 + } else
184 + max_loops--;
185 + } while (queued && max_loops > 0);
186 + WARN_ON(max_loops <= 0);
187
188 /*
189 * Now that we are all set up, enable the APIC
190 diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
191 index 9f9fded..1acd1c4 100644
192 --- a/arch/x86/kernel/apic/io_apic.c
193 +++ b/arch/x86/kernel/apic/io_apic.c
194 @@ -1736,6 +1736,8 @@ __apicdebuginit(void) print_IO_APIC(void)
195 struct irq_pin_list *entry;
196
197 cfg = desc->chip_data;
198 + if (!cfg)
199 + continue;
200 entry = cfg->irq_2_pin;
201 if (!entry)
202 continue;
203 diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
204 index 28e963d..29ec560 100644
205 --- a/arch/x86/kernel/smpboot.c
206 +++ b/arch/x86/kernel/smpboot.c
207 @@ -88,6 +88,25 @@ DEFINE_PER_CPU(int, cpu_state) = { 0 };
208 static DEFINE_PER_CPU(struct task_struct *, idle_thread_array);
209 #define get_idle_for_cpu(x) (per_cpu(idle_thread_array, x))
210 #define set_idle_for_cpu(x, p) (per_cpu(idle_thread_array, x) = (p))
211 +
212 +/*
213 + * We need this for trampoline_base protection from concurrent accesses when
214 + * off- and onlining cores wildly.
215 + */
216 +static DEFINE_MUTEX(x86_cpu_hotplug_driver_mutex);
217 +
218 +void cpu_hotplug_driver_lock()
219 +{
220 + mutex_lock(&x86_cpu_hotplug_driver_mutex);
221 +}
222 +
223 +void cpu_hotplug_driver_unlock()
224 +{
225 + mutex_unlock(&x86_cpu_hotplug_driver_mutex);
226 +}
227 +
228 +ssize_t arch_cpu_probe(const char *buf, size_t count) { return -1; }
229 +ssize_t arch_cpu_release(const char *buf, size_t count) { return -1; }
230 #else
231 static struct task_struct *idle_thread_array[NR_CPUS] __cpuinitdata ;
232 #define get_idle_for_cpu(x) (idle_thread_array[(x)])
233 diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
234 index f1fb411..c41ad50 100644
235 --- a/arch/x86/oprofile/nmi_int.c
236 +++ b/arch/x86/oprofile/nmi_int.c
237 @@ -584,6 +584,18 @@ static int __init ppro_init(char **cpu_type)
238 if (force_arch_perfmon && cpu_has_arch_perfmon)
239 return 0;
240
241 + /*
242 + * Documentation on identifying Intel processors by CPU family
243 + * and model can be found in the Intel Software Developer's
244 + * Manuals (SDM):
245 + *
246 + * http://www.intel.com/products/processor/manuals/
247 + *
248 + * As of May 2010 the documentation for this was in the:
249 + * "Intel 64 and IA-32 Architectures Software Developer's
250 + * Manual Volume 3B: System Programming Guide", "Table B-1
251 + * CPUID Signature Values of DisplayFamily_DisplayModel".
252 + */
253 switch (cpu_model) {
254 case 0 ... 2:
255 *cpu_type = "i386/ppro";
256 @@ -605,12 +617,13 @@ static int __init ppro_init(char **cpu_type)
257 case 15: case 23:
258 *cpu_type = "i386/core_2";
259 break;
260 + case 0x1a:
261 + case 0x1e:
262 case 0x2e:
263 - case 26:
264 spec = &op_arch_perfmon_spec;
265 *cpu_type = "i386/core_i7";
266 break;
267 - case 28:
268 + case 0x1c:
269 *cpu_type = "i386/atom";
270 break;
271 default:
272 diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
273 index a75ca63..0e27d98 100644
274 --- a/drivers/gpu/drm/drm_drv.c
275 +++ b/drivers/gpu/drm/drm_drv.c
276 @@ -470,7 +470,9 @@ int drm_ioctl(struct inode *inode, struct file *filp,
277 retcode = -EFAULT;
278 goto err_i1;
279 }
280 - }
281 + } else
282 + memset(kdata, 0, _IOC_SIZE(cmd));
283 +
284 retcode = func(dev, kdata, file_priv);
285
286 if (cmd & IOC_OUT) {
287 diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
288 index 952c844..176a6df 100644
289 --- a/drivers/gpu/drm/i915/i915_gem.c
290 +++ b/drivers/gpu/drm/i915/i915_gem.c
291 @@ -2262,8 +2262,9 @@ i915_gem_object_get_pages(struct drm_gem_object *obj,
292 mapping = inode->i_mapping;
293 for (i = 0; i < page_count; i++) {
294 page = read_cache_page_gfp(mapping, i,
295 - mapping_gfp_mask (mapping) |
296 + GFP_HIGHUSER |
297 __GFP_COLD |
298 + __GFP_RECLAIMABLE |
299 gfpmask);
300 if (IS_ERR(page))
301 goto err_pages;
302 diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
303 index 88d5e3a..4f5c733 100644
304 --- a/drivers/gpu/drm/i915/intel_display.c
305 +++ b/drivers/gpu/drm/i915/intel_display.c
306 @@ -1402,6 +1402,7 @@ static void igdng_enable_pll_edp (struct drm_crtc *crtc)
307 dpa_ctl = I915_READ(DP_A);
308 dpa_ctl |= DP_PLL_ENABLE;
309 I915_WRITE(DP_A, dpa_ctl);
310 + POSTING_READ(DP_A);
311 udelay(200);
312 }
313
314 diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
315 index 22ce4d6..7547ec6 100644
316 --- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
317 +++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c
318 @@ -261,7 +261,7 @@ static uint8_t radeon_compute_pll_gain(uint16_t ref_freq, uint16_t ref_div,
319 if (!ref_div)
320 return 1;
321
322 - vcoFreq = ((unsigned)ref_freq & fb_div) / ref_div;
323 + vcoFreq = ((unsigned)ref_freq * fb_div) / ref_div;
324
325 /*
326 * This is horribly crude: the VCO frequency range is divided into
327 diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c
328 index 4a64b85..68e69a4 100644
329 --- a/drivers/hwmon/pc87360.c
330 +++ b/drivers/hwmon/pc87360.c
331 @@ -1610,11 +1610,8 @@ static struct pc87360_data *pc87360_update_device(struct device *dev)
332
333 static int __init pc87360_device_add(unsigned short address)
334 {
335 - struct resource res = {
336 - .name = "pc87360",
337 - .flags = IORESOURCE_IO,
338 - };
339 - int err, i;
340 + struct resource res[3];
341 + int err, i, res_count;
342
343 pdev = platform_device_alloc("pc87360", address);
344 if (!pdev) {
345 @@ -1623,22 +1620,28 @@ static int __init pc87360_device_add(unsigned short address)
346 goto exit;
347 }
348
349 + memset(res, 0, 3 * sizeof(struct resource));
350 + res_count = 0;
351 for (i = 0; i < 3; i++) {
352 if (!extra_isa[i])
353 continue;
354 - res.start = extra_isa[i];
355 - res.end = extra_isa[i] + PC87360_EXTENT - 1;
356 + res[res_count].start = extra_isa[i];
357 + res[res_count].end = extra_isa[i] + PC87360_EXTENT - 1;
358 + res[res_count].name = "pc87360",
359 + res[res_count].flags = IORESOURCE_IO,
360
361 - err = acpi_check_resource_conflict(&res);
362 + err = acpi_check_resource_conflict(&res[res_count]);
363 if (err)
364 goto exit_device_put;
365
366 - err = platform_device_add_resources(pdev, &res, 1);
367 - if (err) {
368 - printk(KERN_ERR "pc87360: Device resource[%d] "
369 - "addition failed (%d)\n", i, err);
370 - goto exit_device_put;
371 - }
372 + res_count++;
373 + }
374 +
375 + err = platform_device_add_resources(pdev, res, res_count);
376 + if (err) {
377 + printk(KERN_ERR "pc87360: Device resources addition failed "
378 + "(%d)\n", err);
379 + goto exit_device_put;
380 }
381
382 err = platform_device_add(pdev);
383 diff --git a/drivers/isdn/sc/ioctl.c b/drivers/isdn/sc/ioctl.c
384 index 1081091..2655e3a 100644
385 --- a/drivers/isdn/sc/ioctl.c
386 +++ b/drivers/isdn/sc/ioctl.c
387 @@ -174,7 +174,7 @@ int sc_ioctl(int card, scs_ioctl *data)
388 pr_debug("%s: SCIOGETSPID: ioctl received\n",
389 sc_adapter[card]->devicename);
390
391 - spid = kmalloc(SCIOC_SPIDSIZE, GFP_KERNEL);
392 + spid = kzalloc(SCIOC_SPIDSIZE, GFP_KERNEL);
393 if (!spid) {
394 kfree(rcvmsg);
395 return -ENOMEM;
396 @@ -194,7 +194,7 @@ int sc_ioctl(int card, scs_ioctl *data)
397 kfree(rcvmsg);
398 return status;
399 }
400 - strcpy(spid, rcvmsg->msg_data.byte_array);
401 + strlcpy(spid, rcvmsg->msg_data.byte_array, SCIOC_SPIDSIZE);
402
403 /*
404 * Package the switch type and send to user space
405 @@ -272,12 +272,12 @@ int sc_ioctl(int card, scs_ioctl *data)
406 return status;
407 }
408
409 - dn = kmalloc(SCIOC_DNSIZE, GFP_KERNEL);
410 + dn = kzalloc(SCIOC_DNSIZE, GFP_KERNEL);
411 if (!dn) {
412 kfree(rcvmsg);
413 return -ENOMEM;
414 }
415 - strcpy(dn, rcvmsg->msg_data.byte_array);
416 + strlcpy(dn, rcvmsg->msg_data.byte_array, SCIOC_DNSIZE);
417 kfree(rcvmsg);
418
419 /*
420 @@ -348,7 +348,7 @@ int sc_ioctl(int card, scs_ioctl *data)
421 pr_debug("%s: SCIOSTAT: ioctl received\n",
422 sc_adapter[card]->devicename);
423
424 - bi = kmalloc (sizeof(boardInfo), GFP_KERNEL);
425 + bi = kzalloc(sizeof(boardInfo), GFP_KERNEL);
426 if (!bi) {
427 kfree(rcvmsg);
428 return -ENOMEM;
429 diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
430 index d19854c..818b617 100644
431 --- a/drivers/md/dm-ioctl.c
432 +++ b/drivers/md/dm-ioctl.c
433 @@ -249,40 +249,46 @@ static void __hash_remove(struct hash_cell *hc)
434
435 static void dm_hash_remove_all(int keep_open_devices)
436 {
437 - int i, dev_skipped, dev_removed;
438 + int i, dev_skipped;
439 struct hash_cell *hc;
440 - struct list_head *tmp, *n;
441 + struct mapped_device *md;
442 +
443 +retry:
444 + dev_skipped = 0;
445
446 down_write(&_hash_lock);
447
448 -retry:
449 - dev_skipped = dev_removed = 0;
450 for (i = 0; i < NUM_BUCKETS; i++) {
451 - list_for_each_safe (tmp, n, _name_buckets + i) {
452 - hc = list_entry(tmp, struct hash_cell, name_list);
453 + list_for_each_entry(hc, _name_buckets + i, name_list) {
454 + md = hc->md;
455 + dm_get(md);
456
457 - if (keep_open_devices &&
458 - dm_lock_for_deletion(hc->md)) {
459 + if (keep_open_devices && dm_lock_for_deletion(md)) {
460 + dm_put(md);
461 dev_skipped++;
462 continue;
463 }
464 +
465 __hash_remove(hc);
466 - dev_removed = 1;
467 - }
468 - }
469
470 - /*
471 - * Some mapped devices may be using other mapped devices, so if any
472 - * still exist, repeat until we make no further progress.
473 - */
474 - if (dev_skipped) {
475 - if (dev_removed)
476 - goto retry;
477 + up_write(&_hash_lock);
478
479 - DMWARN("remove_all left %d open device(s)", dev_skipped);
480 + dm_put(md);
481 +
482 + /*
483 + * Some mapped devices may be using other mapped
484 + * devices, so repeat until we make no further
485 + * progress. If a new mapped device is created
486 + * here it will also get removed.
487 + */
488 + goto retry;
489 + }
490 }
491
492 up_write(&_hash_lock);
493 +
494 + if (dev_skipped)
495 + DMWARN("remove_all left %d open device(s)", dev_skipped);
496 }
497
498 static int dm_hash_rename(uint32_t cookie, const char *old, const char *new)
499 diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
500 index 32d0b87..f336c69 100644
501 --- a/drivers/md/dm-mpath.c
502 +++ b/drivers/md/dm-mpath.c
503 @@ -691,6 +691,7 @@ static struct priority_group *parse_priority_group(struct arg_set *as,
504
505 if (as->argc < nr_params) {
506 ti->error = "not enough path parameters";
507 + r = -EINVAL;
508 goto bad;
509 }
510
511 diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
512 index bd83fa0..46bd7e2 100644
513 --- a/drivers/memstick/core/mspro_block.c
514 +++ b/drivers/memstick/core/mspro_block.c
515 @@ -1330,13 +1330,14 @@ static void mspro_block_remove(struct memstick_dev *card)
516 struct mspro_block_data *msb = memstick_get_drvdata(card);
517 unsigned long flags;
518
519 - del_gendisk(msb->disk);
520 - dev_dbg(&card->dev, "mspro block remove\n");
521 spin_lock_irqsave(&msb->q_lock, flags);
522 msb->eject = 1;
523 blk_start_queue(msb->queue);
524 spin_unlock_irqrestore(&msb->q_lock, flags);
525
526 + del_gendisk(msb->disk);
527 + dev_dbg(&card->dev, "mspro block remove\n");
528 +
529 blk_cleanup_queue(msb->queue);
530 msb->queue = NULL;
531
532 diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
533 index 6ea520a..776183f 100644
534 --- a/drivers/mtd/nand/pxa3xx_nand.c
535 +++ b/drivers/mtd/nand/pxa3xx_nand.c
536 @@ -316,7 +316,7 @@ static struct pxa3xx_nand_flash *builtin_flash_types[] = {
537 #define tAR_NDTR1(r) (((r) >> 0) & 0xf)
538
539 /* convert nano-seconds to nand flash controller clock cycles */
540 -#define ns2cycle(ns, clk) (int)(((ns) * (clk / 1000000) / 1000) - 1)
541 +#define ns2cycle(ns, clk) (int)((ns) * (clk / 1000000) / 1000)
542
543 /* convert nand flash controller clock cycles to nano-seconds */
544 #define cycle2ns(c, clk) ((((c) + 1) * 1000000 + clk / 500) / (clk / 1000))
545 diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
546 index 7ee61d4..ce166ae 100644
547 --- a/drivers/net/wireless/ath/ath5k/base.c
548 +++ b/drivers/net/wireless/ath/ath5k/base.c
549 @@ -48,6 +48,7 @@
550 #include <linux/netdevice.h>
551 #include <linux/cache.h>
552 #include <linux/pci.h>
553 +#include <linux/pci-aspm.h>
554 #include <linux/ethtool.h>
555 #include <linux/uaccess.h>
556
557 @@ -448,6 +449,26 @@ ath5k_pci_probe(struct pci_dev *pdev,
558 int ret;
559 u8 csz;
560
561 + /*
562 + * L0s needs to be disabled on all ath5k cards.
563 + *
564 + * For distributions shipping with CONFIG_PCIEASPM (this will be enabled
565 + * by default in the future in 2.6.36) this will also mean both L1 and
566 + * L0s will be disabled when a pre 1.1 PCIe device is detected. We do
567 + * know L1 works correctly even for all ath5k pre 1.1 PCIe devices
568 + * though but cannot currently undue the effect of a blacklist, for
569 + * details you can read pcie_aspm_sanity_check() and see how it adjusts
570 + * the device link capability.
571 + *
572 + * It may be possible in the future to implement some PCI API to allow
573 + * drivers to override blacklists for pre 1.1 PCIe but for now it is
574 + * best to accept that both L0s and L1 will be disabled completely for
575 + * distributions shipping with CONFIG_PCIEASPM rather than having this
576 + * issue present. Motivation for adding this new API will be to help
577 + * with power consumption for some of these devices.
578 + */
579 + pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S);
580 +
581 ret = pci_enable_device(pdev);
582 if (ret) {
583 dev_err(&pdev->dev, "can't enable device\n");
584 diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
585 index d919e96..7905285 100644
586 --- a/drivers/pcmcia/pcmcia_resource.c
587 +++ b/drivers/pcmcia/pcmcia_resource.c
588 @@ -39,7 +39,7 @@ module_param(io_speed, int, 0444);
589 #ifdef CONFIG_PCMCIA_PROBE
590 #include <asm/irq.h>
591 /* mask of IRQs already reserved by other cards, we should avoid using them */
592 -static u8 pcmcia_used_irq[NR_IRQS];
593 +static u8 pcmcia_used_irq[32];
594 #endif
595
596
597 @@ -719,6 +719,9 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
598 for (try = 0; try < 64; try++) {
599 irq = try % 32;
600
601 + if (irq > NR_IRQS)
602 + continue;
603 +
604 /* marked as available by driver, and not blocked by userspace? */
605 if (!((mask >> irq) & 1))
606 continue;
607 diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
608 index 317e8dc..6416a0f 100644
609 --- a/drivers/usb/host/xhci-ring.c
610 +++ b/drivers/usb/host/xhci-ring.c
611 @@ -124,7 +124,7 @@ static void next_trb(struct xhci_hcd *xhci,
612 *seg = (*seg)->next;
613 *trb = ((*seg)->trbs);
614 } else {
615 - *trb = (*trb)++;
616 + (*trb)++;
617 }
618 }
619
620 diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
621 index ae4b181..99bde5fc 100644
622 --- a/drivers/usb/serial/cp210x.c
623 +++ b/drivers/usb/serial/cp210x.c
624 @@ -223,8 +223,8 @@ static struct usb_serial_driver cp210x_device = {
625 #define BITS_STOP_2 0x0002
626
627 /* CP210X_SET_BREAK */
628 -#define BREAK_ON 0x0000
629 -#define BREAK_OFF 0x0001
630 +#define BREAK_ON 0x0001
631 +#define BREAK_OFF 0x0000
632
633 /* CP210X_(SET_MHS|GET_MDMSTS) */
634 #define CONTROL_DTR 0x0001
635 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
636 index b2353a9..813ec3d 100644
637 --- a/drivers/usb/serial/ftdi_sio.c
638 +++ b/drivers/usb/serial/ftdi_sio.c
639 @@ -185,6 +185,7 @@ static struct usb_device_id id_table_combined [] = {
640 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
641 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
642 { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
643 + { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) },
644 { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) },
645 { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) },
646 { USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) },
647 @@ -756,6 +757,8 @@ static struct usb_device_id id_table_combined [] = {
648 { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID),
649 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
650 { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) },
651 + { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID),
652 + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
653 { }, /* Optional parameter entry */
654 { } /* Terminating entry */
655 };
656 @@ -1410,7 +1413,7 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port)
657 }
658
659 /* set max packet size based on descriptor */
660 - priv->max_packet_size = ep_desc->wMaxPacketSize;
661 + priv->max_packet_size = le16_to_cpu(ep_desc->wMaxPacketSize);
662
663 dev_info(&udev->dev, "Setting MaxPacketSize %d\n", priv->max_packet_size);
664 }
665 diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
666 index a0a7796..52c3b68 100644
667 --- a/drivers/usb/serial/ftdi_sio_ids.h
668 +++ b/drivers/usb/serial/ftdi_sio_ids.h
669 @@ -110,6 +110,9 @@
670 /* Propox devices */
671 #define FTDI_PROPOX_JTAGCABLEII_PID 0xD738
672
673 +/* Lenz LI-USB Computer Interface. */
674 +#define FTDI_LENZ_LIUSB_PID 0xD780
675 +
676 /*
677 * Xsens Technologies BV products (http://www.xsens.com).
678 */
679 @@ -996,6 +999,12 @@
680 #define ALTI2_N3_PID 0x6001 /* Neptune 3 */
681
682 /*
683 + * Ionics PlugComputer
684 + */
685 +#define IONICS_VID 0x1c0c
686 +#define IONICS_PLUGCOMPUTER_PID 0x0102
687 +
688 +/*
689 * Dresden Elektronic Sensor Terminal Board
690 */
691 #define DE_VID 0x1cf1 /* Vendor ID */
692 diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
693 index d4cc0f7..fbdbac5 100644
694 --- a/drivers/usb/serial/io_ti.c
695 +++ b/drivers/usb/serial/io_ti.c
696 @@ -1157,7 +1157,7 @@ static int download_fw(struct edgeport_serial *serial)
697
698 /* Check if we have an old version in the I2C and
699 update if necessary */
700 - if (download_cur_ver != download_new_ver) {
701 + if (download_cur_ver < download_new_ver) {
702 dbg("%s - Update I2C dld from %d.%d to %d.%d",
703 __func__,
704 firmware_version->Ver_Major,
705 diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c
706 index 5ceaa4c..061a083 100644
707 --- a/drivers/usb/serial/navman.c
708 +++ b/drivers/usb/serial/navman.c
709 @@ -24,6 +24,7 @@ static int debug;
710
711 static struct usb_device_id id_table [] = {
712 { USB_DEVICE(0x0a99, 0x0001) }, /* Talon Technology device */
713 + { USB_DEVICE(0x0df7, 0x0900) }, /* Mobile Action i-gotU */
714 { },
715 };
716 MODULE_DEVICE_TABLE(usb, id_table);
717 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
718 index e864052..19cedb9 100644
719 --- a/drivers/usb/serial/option.c
720 +++ b/drivers/usb/serial/option.c
721 @@ -375,6 +375,10 @@ static int option_resume(struct usb_serial *serial);
722 #define OLIVETTI_VENDOR_ID 0x0b3c
723 #define OLIVETTI_PRODUCT_OLICARD100 0xc000
724
725 +/* Celot products */
726 +#define CELOT_VENDOR_ID 0x211f
727 +#define CELOT_PRODUCT_CT680M 0x6801
728 +
729 static struct usb_device_id option_ids[] = {
730 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
731 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
732 @@ -874,10 +878,9 @@ static struct usb_device_id option_ids[] = {
733 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) },
734 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)},
735 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)},
736 -
737 { USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) },
738 -
739 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) },
740 + { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */
741 { } /* Terminating entry */
742 };
743 MODULE_DEVICE_TABLE(usb, option_ids);
744 diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
745 index 9ec1a49..ecb1708 100644
746 --- a/drivers/usb/serial/pl2303.c
747 +++ b/drivers/usb/serial/pl2303.c
748 @@ -95,6 +95,7 @@ static struct usb_device_id id_table [] = {
749 { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) },
750 { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) },
751 { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) },
752 + { USB_DEVICE(ZEAGLE_VENDOR_ID, ZEAGLE_N2ITION3_PRODUCT_ID) },
753 { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) },
754 { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) },
755 { } /* Terminating entry */
756 diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
757 index d640dc9..01bc64b 100644
758 --- a/drivers/usb/serial/pl2303.h
759 +++ b/drivers/usb/serial/pl2303.h
760 @@ -127,6 +127,10 @@
761 #define CRESSI_VENDOR_ID 0x04b8
762 #define CRESSI_EDY_PRODUCT_ID 0x0521
763
764 +/* Zeagle dive computer interface */
765 +#define ZEAGLE_VENDOR_ID 0x04b8
766 +#define ZEAGLE_N2ITION3_PRODUCT_ID 0x0522
767 +
768 /* Sony, USB data cable for CMD-Jxx mobile phones */
769 #define SONY_VENDOR_ID 0x054c
770 #define SONY_QN3USB_PRODUCT_ID 0x0437
771 diff --git a/drivers/video/sunxvr500.c b/drivers/video/sunxvr500.c
772 index 4cd5049..3803745 100644
773 --- a/drivers/video/sunxvr500.c
774 +++ b/drivers/video/sunxvr500.c
775 @@ -242,11 +242,27 @@ static int __devinit e3d_set_fbinfo(struct e3d_info *ep)
776 static int __devinit e3d_pci_register(struct pci_dev *pdev,
777 const struct pci_device_id *ent)
778 {
779 + struct device_node *of_node;
780 + const char *device_type;
781 struct fb_info *info;
782 struct e3d_info *ep;
783 unsigned int line_length;
784 int err;
785
786 + of_node = pci_device_to_OF_node(pdev);
787 + if (!of_node) {
788 + printk(KERN_ERR "e3d: Cannot find OF node of %s\n",
789 + pci_name(pdev));
790 + return -ENODEV;
791 + }
792 +
793 + device_type = of_get_property(of_node, "device_type", NULL);
794 + if (!device_type) {
795 + printk(KERN_INFO "e3d: Ignoring secondary output device "
796 + "at %s\n", pci_name(pdev));
797 + return -ENODEV;
798 + }
799 +
800 err = pci_enable_device(pdev);
801 if (err < 0) {
802 printk(KERN_ERR "e3d: Cannot enable PCI device %s\n",
803 @@ -265,13 +281,7 @@ static int __devinit e3d_pci_register(struct pci_dev *pdev,
804 ep->info = info;
805 ep->pdev = pdev;
806 spin_lock_init(&ep->lock);
807 - ep->of_node = pci_device_to_OF_node(pdev);
808 - if (!ep->of_node) {
809 - printk(KERN_ERR "e3d: Cannot find OF node of %s\n",
810 - pci_name(pdev));
811 - err = -ENODEV;
812 - goto err_release_fb;
813 - }
814 + ep->of_node = of_node;
815
816 /* Read the PCI base register of the frame buffer, which we
817 * need in order to interpret the RAMDAC_VID_*FB* values in
818 diff --git a/firmware/Makefile b/firmware/Makefile
819 index f4ca0c7..aeabd95 100644
820 --- a/firmware/Makefile
821 +++ b/firmware/Makefile
822 @@ -140,7 +140,7 @@ fw-shipped-$(CONFIG_YAM) += yam/1200.bin yam/9600.bin
823 fw-shipped-all := $(fw-shipped-y) $(fw-shipped-m) $(fw-shipped-)
824
825 # Directories which we _might_ need to create, so we have a rule for them.
826 -firmware-dirs := $(sort $(patsubst %,$(objtree)/$(obj)/%/,$(dir $(fw-external-y) $(fw-shipped-all))))
827 +firmware-dirs := $(sort $(addprefix $(objtree)/$(obj)/,$(dir $(fw-external-y) $(fw-shipped-all))))
828
829 quiet_cmd_mkdir = MKDIR $(patsubst $(objtree)/%,%,$@)
830 cmd_mkdir = mkdir -p $@
831 diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
832 index f3032c9..e85b63c 100644
833 --- a/fs/ext4/balloc.c
834 +++ b/fs/ext4/balloc.c
835 @@ -189,9 +189,6 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
836 * when a file system is mounted (see ext4_fill_super).
837 */
838
839 -
840 -#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1)
841 -
842 /**
843 * ext4_get_group_desc() -- load group descriptor from disk
844 * @sb: super block
845 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
846 index fa6b79f..0773352 100644
847 --- a/fs/ext4/ext4.h
848 +++ b/fs/ext4/ext4.h
849 @@ -1888,6 +1888,8 @@ static inline void set_bitmap_uptodate(struct buffer_head *bh)
850 set_bit(BH_BITMAP_UPTODATE, &(bh)->b_state);
851 }
852
853 +#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1)
854 +
855 #endif /* __KERNEL__ */
856
857 #endif /* _EXT4_H */
858 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
859 index 99482ea..f375559 100644
860 --- a/fs/ext4/extents.c
861 +++ b/fs/ext4/extents.c
862 @@ -1948,7 +1948,7 @@ ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block,
863
864 BUG_ON(cex->ec_type != EXT4_EXT_CACHE_GAP &&
865 cex->ec_type != EXT4_EXT_CACHE_EXTENT);
866 - if (block >= cex->ec_block && block < cex->ec_block + cex->ec_len) {
867 + if (in_range(block, cex->ec_block, cex->ec_len)) {
868 ex->ee_block = cpu_to_le32(cex->ec_block);
869 ext4_ext_store_pblock(ex, cex->ec_start);
870 ex->ee_len = cpu_to_le16(cex->ec_len);
871 @@ -3302,7 +3302,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
872 */
873 ee_len = ext4_ext_get_actual_len(ex);
874 /* if found extent covers block, simply return it */
875 - if (iblock >= ee_block && iblock < ee_block + ee_len) {
876 + if (in_range(iblock, ee_block, ee_len)) {
877 newblock = iblock - ee_block + ee_start;
878 /* number of remaining blocks in the extent */
879 allocated = ee_len - (iblock - ee_block);
880 diff --git a/fs/ext4/mballoc.h b/fs/ext4/mballoc.h
881 index 0ca8110..ceb9d41 100644
882 --- a/fs/ext4/mballoc.h
883 +++ b/fs/ext4/mballoc.h
884 @@ -221,8 +221,6 @@ struct ext4_buddy {
885 #define EXT4_MB_BITMAP(e4b) ((e4b)->bd_bitmap)
886 #define EXT4_MB_BUDDY(e4b) ((e4b)->bd_buddy)
887
888 -#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1)
889 -
890 static inline ext4_fsblk_t ext4_grp_offs_to_block(struct super_block *sb,
891 struct ext4_free_extent *fex)
892 {
893 diff --git a/fs/nfs/super.c b/fs/nfs/super.c
894 index a53b9e5..c0173a8 100644
895 --- a/fs/nfs/super.c
896 +++ b/fs/nfs/super.c
897 @@ -616,6 +616,13 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
898
899 if (nfss->options & NFS_OPTION_FSCACHE)
900 seq_printf(m, ",fsc");
901 +
902 + if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG) {
903 + if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONE)
904 + seq_printf(m, ",lookupcache=none");
905 + else
906 + seq_printf(m, ",lookupcache=pos");
907 + }
908 }
909
910 /*
911 diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
912 index d8fe53a..c8288df 100644
913 --- a/fs/ocfs2/acl.c
914 +++ b/fs/ocfs2/acl.c
915 @@ -293,12 +293,30 @@ static int ocfs2_set_acl(handle_t *handle,
916
917 int ocfs2_check_acl(struct inode *inode, int mask)
918 {
919 - struct posix_acl *acl = ocfs2_get_acl(inode, ACL_TYPE_ACCESS);
920 + struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
921 + struct buffer_head *di_bh = NULL;
922 + struct posix_acl *acl;
923 + int ret = -EAGAIN;
924
925 - if (IS_ERR(acl))
926 + if (!(osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL))
927 + return ret;
928 +
929 + ret = ocfs2_read_inode_block(inode, &di_bh);
930 + if (ret < 0) {
931 + mlog_errno(ret);
932 + return ret;
933 + }
934 +
935 + acl = ocfs2_get_acl_nolock(inode, ACL_TYPE_ACCESS, di_bh);
936 +
937 + brelse(di_bh);
938 +
939 + if (IS_ERR(acl)) {
940 + mlog_errno(PTR_ERR(acl));
941 return PTR_ERR(acl);
942 + }
943 if (acl) {
944 - int ret = posix_acl_permission(inode, acl, mask);
945 + ret = posix_acl_permission(inode, acl, mask);
946 posix_acl_release(acl);
947 return ret;
948 }
949 @@ -347,7 +365,7 @@ int ocfs2_init_acl(handle_t *handle,
950 {
951 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
952 struct posix_acl *acl = NULL;
953 - int ret = 0;
954 + int ret = 0, ret2;
955 mode_t mode;
956
957 if (!S_ISLNK(inode->i_mode)) {
958 @@ -384,7 +402,12 @@ int ocfs2_init_acl(handle_t *handle,
959 mode = inode->i_mode;
960 ret = posix_acl_create_masq(clone, &mode);
961 if (ret >= 0) {
962 - ret = ocfs2_acl_set_mode(inode, di_bh, handle, mode);
963 + ret2 = ocfs2_acl_set_mode(inode, di_bh, handle, mode);
964 + if (ret2) {
965 + mlog_errno(ret2);
966 + ret = ret2;
967 + goto cleanup;
968 + }
969 if (ret > 0) {
970 ret = ocfs2_set_acl(handle, inode,
971 di_bh, ACL_TYPE_ACCESS,
972 diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
973 index 83bcaf2..ef1ac9a 100644
974 --- a/fs/ocfs2/dlm/dlmmaster.c
975 +++ b/fs/ocfs2/dlm/dlmmaster.c
976 @@ -511,8 +511,6 @@ static void dlm_lockres_release(struct kref *kref)
977
978 atomic_dec(&dlm->res_cur_count);
979
980 - dlm_put(dlm);
981 -
982 if (!hlist_unhashed(&res->hash_node) ||
983 !list_empty(&res->granted) ||
984 !list_empty(&res->converting) ||
985 @@ -585,8 +583,6 @@ static void dlm_init_lockres(struct dlm_ctxt *dlm,
986 res->migration_pending = 0;
987 res->inflight_locks = 0;
988
989 - /* put in dlm_lockres_release */
990 - dlm_grab(dlm);
991 res->dlm = dlm;
992
993 kref_init(&res->refs);
994 @@ -3046,8 +3042,6 @@ int dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data,
995 /* check for pre-existing lock */
996 spin_lock(&dlm->spinlock);
997 res = __dlm_lookup_lockres(dlm, name, namelen, hash);
998 - spin_lock(&dlm->master_lock);
999 -
1000 if (res) {
1001 spin_lock(&res->spinlock);
1002 if (res->state & DLM_LOCK_RES_RECOVERING) {
1003 @@ -3065,14 +3059,15 @@ int dlm_migrate_request_handler(struct o2net_msg *msg, u32 len, void *data,
1004 spin_unlock(&res->spinlock);
1005 }
1006
1007 + spin_lock(&dlm->master_lock);
1008 /* ignore status. only nonzero status would BUG. */
1009 ret = dlm_add_migration_mle(dlm, res, mle, &oldmle,
1010 name, namelen,
1011 migrate->new_master,
1012 migrate->master);
1013
1014 -unlock:
1015 spin_unlock(&dlm->master_lock);
1016 +unlock:
1017 spin_unlock(&dlm->spinlock);
1018
1019 if (oldmle) {
1020 diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
1021 index d9fa3d2..3492550 100644
1022 --- a/fs/ocfs2/dlm/dlmrecovery.c
1023 +++ b/fs/ocfs2/dlm/dlmrecovery.c
1024 @@ -1941,6 +1941,8 @@ void dlm_move_lockres_to_recovery_list(struct dlm_ctxt *dlm,
1025 struct list_head *queue;
1026 struct dlm_lock *lock, *next;
1027
1028 + assert_spin_locked(&dlm->spinlock);
1029 + assert_spin_locked(&res->spinlock);
1030 res->state |= DLM_LOCK_RES_RECOVERING;
1031 if (!list_empty(&res->recovering)) {
1032 mlog(0,
1033 @@ -2265,19 +2267,15 @@ static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node)
1034 /* zero the lvb if necessary */
1035 dlm_revalidate_lvb(dlm, res, dead_node);
1036 if (res->owner == dead_node) {
1037 - if (res->state & DLM_LOCK_RES_DROPPING_REF)
1038 - mlog(0, "%s:%.*s: owned by "
1039 - "dead node %u, this node was "
1040 - "dropping its ref when it died. "
1041 - "continue, dropping the flag.\n",
1042 - dlm->name, res->lockname.len,
1043 - res->lockname.name, dead_node);
1044 -
1045 - /* the wake_up for this will happen when the
1046 - * RECOVERING flag is dropped later */
1047 - res->state &= ~DLM_LOCK_RES_DROPPING_REF;
1048 + if (res->state & DLM_LOCK_RES_DROPPING_REF) {
1049 + mlog(ML_NOTICE, "Ignore %.*s for "
1050 + "recovery as it is being freed\n",
1051 + res->lockname.len,
1052 + res->lockname.name);
1053 + } else
1054 + dlm_move_lockres_to_recovery_list(dlm,
1055 + res);
1056
1057 - dlm_move_lockres_to_recovery_list(dlm, res);
1058 } else if (res->owner == dlm->node_num) {
1059 dlm_free_dead_locks(dlm, res, dead_node);
1060 __dlm_lockres_calc_usage(dlm, res);
1061 diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c
1062 index 52ec020..86491f5 100644
1063 --- a/fs/ocfs2/dlm/dlmthread.c
1064 +++ b/fs/ocfs2/dlm/dlmthread.c
1065 @@ -93,19 +93,27 @@ int __dlm_lockres_has_locks(struct dlm_lock_resource *res)
1066 * truly ready to be freed. */
1067 int __dlm_lockres_unused(struct dlm_lock_resource *res)
1068 {
1069 - if (!__dlm_lockres_has_locks(res) &&
1070 - (list_empty(&res->dirty) && !(res->state & DLM_LOCK_RES_DIRTY))) {
1071 - /* try not to scan the bitmap unless the first two
1072 - * conditions are already true */
1073 - int bit = find_next_bit(res->refmap, O2NM_MAX_NODES, 0);
1074 - if (bit >= O2NM_MAX_NODES) {
1075 - /* since the bit for dlm->node_num is not
1076 - * set, inflight_locks better be zero */
1077 - BUG_ON(res->inflight_locks != 0);
1078 - return 1;
1079 - }
1080 - }
1081 - return 0;
1082 + int bit;
1083 +
1084 + if (__dlm_lockres_has_locks(res))
1085 + return 0;
1086 +
1087 + if (!list_empty(&res->dirty) || res->state & DLM_LOCK_RES_DIRTY)
1088 + return 0;
1089 +
1090 + if (res->state & DLM_LOCK_RES_RECOVERING)
1091 + return 0;
1092 +
1093 + bit = find_next_bit(res->refmap, O2NM_MAX_NODES, 0);
1094 + if (bit < O2NM_MAX_NODES)
1095 + return 0;
1096 +
1097 + /*
1098 + * since the bit for dlm->node_num is not set, inflight_locks better
1099 + * be zero
1100 + */
1101 + BUG_ON(res->inflight_locks != 0);
1102 + return 1;
1103 }
1104
1105
1106 @@ -153,45 +161,25 @@ void dlm_lockres_calc_usage(struct dlm_ctxt *dlm,
1107 spin_unlock(&dlm->spinlock);
1108 }
1109
1110 -static int dlm_purge_lockres(struct dlm_ctxt *dlm,
1111 +static void dlm_purge_lockres(struct dlm_ctxt *dlm,
1112 struct dlm_lock_resource *res)
1113 {
1114 int master;
1115 int ret = 0;
1116
1117 - spin_lock(&res->spinlock);
1118 - if (!__dlm_lockres_unused(res)) {
1119 - mlog(0, "%s:%.*s: tried to purge but not unused\n",
1120 - dlm->name, res->lockname.len, res->lockname.name);
1121 - __dlm_print_one_lock_resource(res);
1122 - spin_unlock(&res->spinlock);
1123 - BUG();
1124 - }
1125 -
1126 - if (res->state & DLM_LOCK_RES_MIGRATING) {
1127 - mlog(0, "%s:%.*s: Delay dropref as this lockres is "
1128 - "being remastered\n", dlm->name, res->lockname.len,
1129 - res->lockname.name);
1130 - /* Re-add the lockres to the end of the purge list */
1131 - if (!list_empty(&res->purge)) {
1132 - list_del_init(&res->purge);
1133 - list_add_tail(&res->purge, &dlm->purge_list);
1134 - }
1135 - spin_unlock(&res->spinlock);
1136 - return 0;
1137 - }
1138 + assert_spin_locked(&dlm->spinlock);
1139 + assert_spin_locked(&res->spinlock);
1140
1141 master = (res->owner == dlm->node_num);
1142
1143 - if (!master)
1144 - res->state |= DLM_LOCK_RES_DROPPING_REF;
1145 - spin_unlock(&res->spinlock);
1146
1147 mlog(0, "purging lockres %.*s, master = %d\n", res->lockname.len,
1148 res->lockname.name, master);
1149
1150 if (!master) {
1151 + res->state |= DLM_LOCK_RES_DROPPING_REF;
1152 /* drop spinlock... retake below */
1153 + spin_unlock(&res->spinlock);
1154 spin_unlock(&dlm->spinlock);
1155
1156 spin_lock(&res->spinlock);
1157 @@ -209,31 +197,35 @@ static int dlm_purge_lockres(struct dlm_ctxt *dlm,
1158 mlog(0, "%s:%.*s: dlm_deref_lockres returned %d\n",
1159 dlm->name, res->lockname.len, res->lockname.name, ret);
1160 spin_lock(&dlm->spinlock);
1161 + spin_lock(&res->spinlock);
1162 }
1163
1164 - spin_lock(&res->spinlock);
1165 if (!list_empty(&res->purge)) {
1166 mlog(0, "removing lockres %.*s:%p from purgelist, "
1167 "master = %d\n", res->lockname.len, res->lockname.name,
1168 res, master);
1169 list_del_init(&res->purge);
1170 - spin_unlock(&res->spinlock);
1171 dlm_lockres_put(res);
1172 dlm->purge_count--;
1173 - } else
1174 - spin_unlock(&res->spinlock);
1175 + }
1176 +
1177 + if (!__dlm_lockres_unused(res)) {
1178 + mlog(ML_ERROR, "found lockres %s:%.*s: in use after deref\n",
1179 + dlm->name, res->lockname.len, res->lockname.name);
1180 + __dlm_print_one_lock_resource(res);
1181 + BUG();
1182 + }
1183
1184 __dlm_unhash_lockres(res);
1185
1186 /* lockres is not in the hash now. drop the flag and wake up
1187 * any processes waiting in dlm_get_lock_resource. */
1188 if (!master) {
1189 - spin_lock(&res->spinlock);
1190 res->state &= ~DLM_LOCK_RES_DROPPING_REF;
1191 spin_unlock(&res->spinlock);
1192 wake_up(&res->wq);
1193 - }
1194 - return 0;
1195 + } else
1196 + spin_unlock(&res->spinlock);
1197 }
1198
1199 static void dlm_run_purge_list(struct dlm_ctxt *dlm,
1200 @@ -252,17 +244,7 @@ static void dlm_run_purge_list(struct dlm_ctxt *dlm,
1201 lockres = list_entry(dlm->purge_list.next,
1202 struct dlm_lock_resource, purge);
1203
1204 - /* Status of the lockres *might* change so double
1205 - * check. If the lockres is unused, holding the dlm
1206 - * spinlock will prevent people from getting and more
1207 - * refs on it -- there's no need to keep the lockres
1208 - * spinlock. */
1209 spin_lock(&lockres->spinlock);
1210 - unused = __dlm_lockres_unused(lockres);
1211 - spin_unlock(&lockres->spinlock);
1212 -
1213 - if (!unused)
1214 - continue;
1215
1216 purge_jiffies = lockres->last_used +
1217 msecs_to_jiffies(DLM_PURGE_INTERVAL_MS);
1218 @@ -274,15 +256,29 @@ static void dlm_run_purge_list(struct dlm_ctxt *dlm,
1219 * in tail order, we can stop at the first
1220 * unpurgable resource -- anyone added after
1221 * him will have a greater last_used value */
1222 + spin_unlock(&lockres->spinlock);
1223 break;
1224 }
1225
1226 + /* Status of the lockres *might* change so double
1227 + * check. If the lockres is unused, holding the dlm
1228 + * spinlock will prevent people from getting and more
1229 + * refs on it. */
1230 + unused = __dlm_lockres_unused(lockres);
1231 + if (!unused ||
1232 + (lockres->state & DLM_LOCK_RES_MIGRATING)) {
1233 + mlog(0, "lockres %s:%.*s: is in use or "
1234 + "being remastered, used %d, state %d\n",
1235 + dlm->name, lockres->lockname.len,
1236 + lockres->lockname.name, !unused, lockres->state);
1237 + list_move_tail(&dlm->purge_list, &lockres->purge);
1238 + spin_unlock(&lockres->spinlock);
1239 + continue;
1240 + }
1241 +
1242 dlm_lockres_get(lockres);
1243
1244 - /* This may drop and reacquire the dlm spinlock if it
1245 - * has to do migration. */
1246 - if (dlm_purge_lockres(dlm, lockres))
1247 - BUG();
1248 + dlm_purge_lockres(dlm, lockres);
1249
1250 dlm_lockres_put(lockres);
1251
1252 diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
1253 index bb0465f..10e9527 100644
1254 --- a/fs/ocfs2/refcounttree.c
1255 +++ b/fs/ocfs2/refcounttree.c
1256 @@ -2454,16 +2454,26 @@ static int ocfs2_calc_refcount_meta_credits(struct super_block *sb,
1257 len = min((u64)cpos + clusters, le64_to_cpu(rec.r_cpos) +
1258 le32_to_cpu(rec.r_clusters)) - cpos;
1259 /*
1260 - * If the refcount rec already exist, cool. We just need
1261 - * to check whether there is a split. Otherwise we just need
1262 - * to increase the refcount.
1263 - * If we will insert one, increases recs_add.
1264 - *
1265 * We record all the records which will be inserted to the
1266 * same refcount block, so that we can tell exactly whether
1267 * we need a new refcount block or not.
1268 + *
1269 + * If we will insert a new one, this is easy and only happens
1270 + * during adding refcounted flag to the extent, so we don't
1271 + * have a chance of spliting. We just need one record.
1272 + *
1273 + * If the refcount rec already exists, that would be a little
1274 + * complicated. we may have to:
1275 + * 1) split at the beginning if the start pos isn't aligned.
1276 + * we need 1 more record in this case.
1277 + * 2) split int the end if the end pos isn't aligned.
1278 + * we need 1 more record in this case.
1279 + * 3) split in the middle because of file system fragmentation.
1280 + * we need 2 more records in this case(we can't detect this
1281 + * beforehand, so always think of the worst case).
1282 */
1283 if (rec.r_refcount) {
1284 + recs_add += 2;
1285 /* Check whether we need a split at the beginning. */
1286 if (cpos == start_cpos &&
1287 cpos != le64_to_cpu(rec.r_cpos))
1288 diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
1289 index 84a524a..9d12ed5 100644
1290 --- a/include/linux/mm_types.h
1291 +++ b/include/linux/mm_types.h
1292 @@ -138,7 +138,7 @@ struct vm_area_struct {
1293 within vm_mm. */
1294
1295 /* linked list of VM areas per task, sorted by address */
1296 - struct vm_area_struct *vm_next;
1297 + struct vm_area_struct *vm_next, *vm_prev;
1298
1299 pgprot_t vm_page_prot; /* Access permissions of this VMA. */
1300 unsigned long vm_flags; /* Flags, see mm.h. */
1301 diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
1302 index 6a664c3..7dc97d1 100644
1303 --- a/include/sound/emu10k1.h
1304 +++ b/include/sound/emu10k1.h
1305 @@ -1707,6 +1707,7 @@ struct snd_emu10k1 {
1306 unsigned int card_type; /* EMU10K1_CARD_* */
1307 unsigned int ecard_ctrl; /* ecard control bits */
1308 unsigned long dma_mask; /* PCI DMA mask */
1309 + unsigned int delay_pcm_irq; /* in samples */
1310 int max_cache_pages; /* max memory size / PAGE_SIZE */
1311 struct snd_dma_buffer silent_page; /* silent page */
1312 struct snd_dma_buffer ptb_pages; /* page table pages */
1313 diff --git a/kernel/fork.c b/kernel/fork.c
1314 index ce2f585..9f3b066 100644
1315 --- a/kernel/fork.c
1316 +++ b/kernel/fork.c
1317 @@ -277,7 +277,7 @@ out:
1318 #ifdef CONFIG_MMU
1319 static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
1320 {
1321 - struct vm_area_struct *mpnt, *tmp, **pprev;
1322 + struct vm_area_struct *mpnt, *tmp, *prev, **pprev;
1323 struct rb_node **rb_link, *rb_parent;
1324 int retval;
1325 unsigned long charge;
1326 @@ -305,6 +305,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
1327 if (retval)
1328 goto out;
1329
1330 + prev = NULL;
1331 for (mpnt = oldmm->mmap; mpnt; mpnt = mpnt->vm_next) {
1332 struct file *file;
1333
1334 @@ -333,7 +334,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
1335 vma_set_policy(tmp, pol);
1336 tmp->vm_flags &= ~VM_LOCKED;
1337 tmp->vm_mm = mm;
1338 - tmp->vm_next = NULL;
1339 + tmp->vm_next = tmp->vm_prev = NULL;
1340 anon_vma_link(tmp);
1341 file = tmp->vm_file;
1342 if (file) {
1343 @@ -367,6 +368,8 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
1344 */
1345 *pprev = tmp;
1346 pprev = &tmp->vm_next;
1347 + tmp->vm_prev = prev;
1348 + prev = tmp;
1349
1350 __vma_link_rb(mm, tmp, rb_link, rb_parent);
1351 rb_link = &tmp->vm_rb.rb_right;
1352 diff --git a/mm/memory.c b/mm/memory.c
1353 index babb991..194dc17 100644
1354 --- a/mm/memory.c
1355 +++ b/mm/memory.c
1356 @@ -2640,11 +2640,18 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo
1357 {
1358 address &= PAGE_MASK;
1359 if ((vma->vm_flags & VM_GROWSDOWN) && address == vma->vm_start) {
1360 - address -= PAGE_SIZE;
1361 - if (find_vma(vma->vm_mm, address) != vma)
1362 - return -ENOMEM;
1363 + struct vm_area_struct *prev = vma->vm_prev;
1364 +
1365 + /*
1366 + * Is there a mapping abutting this one below?
1367 + *
1368 + * That's only ok if it's the same stack mapping
1369 + * that has gotten split..
1370 + */
1371 + if (prev && prev->vm_end == address)
1372 + return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM;
1373
1374 - expand_stack(vma, address);
1375 + expand_stack(vma, address - PAGE_SIZE);
1376 }
1377 return 0;
1378 }
1379 diff --git a/mm/mlock.c b/mm/mlock.c
1380 index 524d2a4..380ea89 100644
1381 --- a/mm/mlock.c
1382 +++ b/mm/mlock.c
1383 @@ -138,6 +138,19 @@ void munlock_vma_page(struct page *page)
1384 }
1385 }
1386
1387 +/* Is the vma a continuation of the stack vma above it? */
1388 +static inline int vma_stack_continue(struct vm_area_struct *vma, unsigned long addr)
1389 +{
1390 + return vma && (vma->vm_end == addr) && (vma->vm_flags & VM_GROWSDOWN);
1391 +}
1392 +
1393 +static inline int stack_guard_page(struct vm_area_struct *vma, unsigned long addr)
1394 +{
1395 + return (vma->vm_flags & VM_GROWSDOWN) &&
1396 + (vma->vm_start == addr) &&
1397 + !vma_stack_continue(vma->vm_prev, addr);
1398 +}
1399 +
1400 /**
1401 * __mlock_vma_pages_range() - mlock a range of pages in the vma.
1402 * @vma: target vma
1403 @@ -171,11 +184,9 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
1404 gup_flags |= FOLL_WRITE;
1405
1406 /* We don't try to access the guard page of a stack vma */
1407 - if (vma->vm_flags & VM_GROWSDOWN) {
1408 - if (start == vma->vm_start) {
1409 - start += PAGE_SIZE;
1410 - nr_pages--;
1411 - }
1412 + if (stack_guard_page(vma, start)) {
1413 + addr += PAGE_SIZE;
1414 + nr_pages--;
1415 }
1416
1417 while (nr_pages > 0) {
1418 diff --git a/mm/mmap.c b/mm/mmap.c
1419 index ae19746..b309c75 100644
1420 --- a/mm/mmap.c
1421 +++ b/mm/mmap.c
1422 @@ -389,17 +389,23 @@ static inline void
1423 __vma_link_list(struct mm_struct *mm, struct vm_area_struct *vma,
1424 struct vm_area_struct *prev, struct rb_node *rb_parent)
1425 {
1426 + struct vm_area_struct *next;
1427 +
1428 + vma->vm_prev = prev;
1429 if (prev) {
1430 - vma->vm_next = prev->vm_next;
1431 + next = prev->vm_next;
1432 prev->vm_next = vma;
1433 } else {
1434 mm->mmap = vma;
1435 if (rb_parent)
1436 - vma->vm_next = rb_entry(rb_parent,
1437 + next = rb_entry(rb_parent,
1438 struct vm_area_struct, vm_rb);
1439 else
1440 - vma->vm_next = NULL;
1441 + next = NULL;
1442 }
1443 + vma->vm_next = next;
1444 + if (next)
1445 + next->vm_prev = vma;
1446 }
1447
1448 void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma,
1449 @@ -487,7 +493,11 @@ static inline void
1450 __vma_unlink(struct mm_struct *mm, struct vm_area_struct *vma,
1451 struct vm_area_struct *prev)
1452 {
1453 - prev->vm_next = vma->vm_next;
1454 + struct vm_area_struct *next = vma->vm_next;
1455 +
1456 + prev->vm_next = next;
1457 + if (next)
1458 + next->vm_prev = prev;
1459 rb_erase(&vma->vm_rb, &mm->mm_rb);
1460 if (mm->mmap_cache == vma)
1461 mm->mmap_cache = prev;
1462 @@ -1798,6 +1808,7 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
1463 unsigned long addr;
1464
1465 insertion_point = (prev ? &prev->vm_next : &mm->mmap);
1466 + vma->vm_prev = NULL;
1467 do {
1468 rb_erase(&vma->vm_rb, &mm->mm_rb);
1469 mm->map_count--;
1470 @@ -1805,6 +1816,8 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
1471 vma = vma->vm_next;
1472 } while (vma && vma->vm_start < end);
1473 *insertion_point = vma;
1474 + if (vma)
1475 + vma->vm_prev = prev;
1476 tail_vma->vm_next = NULL;
1477 if (mm->unmap_area == arch_unmap_area)
1478 addr = prev ? prev->vm_end : mm->mmap_base;
1479 diff --git a/mm/nommu.c b/mm/nommu.c
1480 index 9876fa0..ebb3154 100644
1481 --- a/mm/nommu.c
1482 +++ b/mm/nommu.c
1483 @@ -608,7 +608,7 @@ static void protect_vma(struct vm_area_struct *vma, unsigned long flags)
1484 */
1485 static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma)
1486 {
1487 - struct vm_area_struct *pvma, **pp;
1488 + struct vm_area_struct *pvma, **pp, *next;
1489 struct address_space *mapping;
1490 struct rb_node **p, *parent;
1491
1492 @@ -668,8 +668,11 @@ static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma)
1493 break;
1494 }
1495
1496 - vma->vm_next = *pp;
1497 + next = *pp;
1498 *pp = vma;
1499 + vma->vm_next = next;
1500 + if (next)
1501 + next->vm_prev = vma;
1502 }
1503
1504 /*
1505 diff --git a/mm/slab.c b/mm/slab.c
1506 index 5d1a782..c8d466a 100644
1507 --- a/mm/slab.c
1508 +++ b/mm/slab.c
1509 @@ -2249,8 +2249,8 @@ kmem_cache_create (const char *name, size_t size, size_t align,
1510 }
1511 #if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
1512 if (size >= malloc_sizes[INDEX_L3 + 1].cs_size
1513 - && cachep->obj_size > cache_line_size() && size < PAGE_SIZE) {
1514 - cachep->obj_offset += PAGE_SIZE - size;
1515 + && cachep->obj_size > cache_line_size() && ALIGN(size, align) < PAGE_SIZE) {
1516 + cachep->obj_offset += PAGE_SIZE - ALIGN(size, align);
1517 size = PAGE_SIZE;
1518 }
1519 #endif
1520 diff --git a/mm/vmscan.c b/mm/vmscan.c
1521 index 692807f..4649929 100644
1522 --- a/mm/vmscan.c
1523 +++ b/mm/vmscan.c
1524 @@ -1083,6 +1083,48 @@ static int too_many_isolated(struct zone *zone, int file,
1525 }
1526
1527 /*
1528 + * Returns true if the caller should wait to clean dirty/writeback pages.
1529 + *
1530 + * If we are direct reclaiming for contiguous pages and we do not reclaim
1531 + * everything in the list, try again and wait for writeback IO to complete.
1532 + * This will stall high-order allocations noticeably. Only do that when really
1533 + * need to free the pages under high memory pressure.
1534 + */
1535 +static inline bool should_reclaim_stall(unsigned long nr_taken,
1536 + unsigned long nr_freed,
1537 + int priority,
1538 + int lumpy_reclaim,
1539 + struct scan_control *sc)
1540 +{
1541 + int lumpy_stall_priority;
1542 +
1543 + /* kswapd should not stall on sync IO */
1544 + if (current_is_kswapd())
1545 + return false;
1546 +
1547 + /* Only stall on lumpy reclaim */
1548 + if (!lumpy_reclaim)
1549 + return false;
1550 +
1551 + /* If we have relaimed everything on the isolated list, no stall */
1552 + if (nr_freed == nr_taken)
1553 + return false;
1554 +
1555 + /*
1556 + * For high-order allocations, there are two stall thresholds.
1557 + * High-cost allocations stall immediately where as lower
1558 + * order allocations such as stacks require the scanning
1559 + * priority to be much higher before stalling.
1560 + */
1561 + if (sc->order > PAGE_ALLOC_COSTLY_ORDER)
1562 + lumpy_stall_priority = DEF_PRIORITY;
1563 + else
1564 + lumpy_stall_priority = DEF_PRIORITY / 3;
1565 +
1566 + return priority <= lumpy_stall_priority;
1567 +}
1568 +
1569 +/*
1570 * shrink_inactive_list() is a helper for shrink_zone(). It returns the number
1571 * of reclaimed pages
1572 */
1573 @@ -1176,14 +1218,9 @@ static unsigned long shrink_inactive_list(unsigned long max_scan,
1574 nr_scanned += nr_scan;
1575 nr_freed = shrink_page_list(&page_list, sc, PAGEOUT_IO_ASYNC);
1576
1577 - /*
1578 - * If we are direct reclaiming for contiguous pages and we do
1579 - * not reclaim everything in the list, try again and wait
1580 - * for IO to complete. This will stall high-order allocations
1581 - * but that should be acceptable to the caller
1582 - */
1583 - if (nr_freed < nr_taken && !current_is_kswapd() &&
1584 - lumpy_reclaim) {
1585 + /* Check if we should syncronously wait for writeback */
1586 + if (should_reclaim_stall(nr_taken, nr_freed, priority,
1587 + lumpy_reclaim, sc)) {
1588 congestion_wait(BLK_RW_ASYNC, HZ/10);
1589
1590 /*
1591 diff --git a/net/can/bcm.c b/net/can/bcm.c
1592 index e8d58f3..ff8c690 100644
1593 --- a/net/can/bcm.c
1594 +++ b/net/can/bcm.c
1595 @@ -59,6 +59,13 @@
1596 #include <net/sock.h>
1597 #include <net/net_namespace.h>
1598
1599 +/*
1600 + * To send multiple CAN frame content within TX_SETUP or to filter
1601 + * CAN messages with multiplex index within RX_SETUP, the number of
1602 + * different filters is limited to 256 due to the one byte index value.
1603 + */
1604 +#define MAX_NFRAMES 256
1605 +
1606 /* use of last_frames[index].can_dlc */
1607 #define RX_RECV 0x40 /* received data for this element */
1608 #define RX_THR 0x80 /* element not been sent due to throttle feature */
1609 @@ -88,16 +95,16 @@ struct bcm_op {
1610 struct list_head list;
1611 int ifindex;
1612 canid_t can_id;
1613 - int flags;
1614 + u32 flags;
1615 unsigned long frames_abs, frames_filtered;
1616 struct timeval ival1, ival2;
1617 struct hrtimer timer, thrtimer;
1618 struct tasklet_struct tsklet, thrtsklet;
1619 ktime_t rx_stamp, kt_ival1, kt_ival2, kt_lastmsg;
1620 int rx_ifindex;
1621 - int count;
1622 - int nframes;
1623 - int currframe;
1624 + u32 count;
1625 + u32 nframes;
1626 + u32 currframe;
1627 struct can_frame *frames;
1628 struct can_frame *last_frames;
1629 struct can_frame sframe;
1630 @@ -174,7 +181,7 @@ static int bcm_proc_show(struct seq_file *m, void *v)
1631
1632 seq_printf(m, "rx_op: %03X %-5s ",
1633 op->can_id, bcm_proc_getifname(ifname, op->ifindex));
1634 - seq_printf(m, "[%d]%c ", op->nframes,
1635 + seq_printf(m, "[%u]%c ", op->nframes,
1636 (op->flags & RX_CHECK_DLC)?'d':' ');
1637 if (op->kt_ival1.tv64)
1638 seq_printf(m, "timeo=%lld ",
1639 @@ -197,7 +204,7 @@ static int bcm_proc_show(struct seq_file *m, void *v)
1640
1641 list_for_each_entry(op, &bo->tx_ops, list) {
1642
1643 - seq_printf(m, "tx_op: %03X %s [%d] ",
1644 + seq_printf(m, "tx_op: %03X %s [%u] ",
1645 op->can_id,
1646 bcm_proc_getifname(ifname, op->ifindex),
1647 op->nframes);
1648 @@ -282,7 +289,7 @@ static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head,
1649 struct can_frame *firstframe;
1650 struct sockaddr_can *addr;
1651 struct sock *sk = op->sk;
1652 - int datalen = head->nframes * CFSIZ;
1653 + unsigned int datalen = head->nframes * CFSIZ;
1654 int err;
1655
1656 skb = alloc_skb(sizeof(*head) + datalen, gfp_any());
1657 @@ -467,7 +474,7 @@ rx_changed_settime:
1658 * bcm_rx_cmp_to_index - (bit)compares the currently received data to formerly
1659 * received data stored in op->last_frames[]
1660 */
1661 -static void bcm_rx_cmp_to_index(struct bcm_op *op, int index,
1662 +static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index,
1663 const struct can_frame *rxdata)
1664 {
1665 /*
1666 @@ -553,7 +560,8 @@ static enum hrtimer_restart bcm_rx_timeout_handler(struct hrtimer *hrtimer)
1667 /*
1668 * bcm_rx_do_flush - helper for bcm_rx_thr_flush
1669 */
1670 -static inline int bcm_rx_do_flush(struct bcm_op *op, int update, int index)
1671 +static inline int bcm_rx_do_flush(struct bcm_op *op, int update,
1672 + unsigned int index)
1673 {
1674 if ((op->last_frames) && (op->last_frames[index].can_dlc & RX_THR)) {
1675 if (update)
1676 @@ -574,7 +582,7 @@ static int bcm_rx_thr_flush(struct bcm_op *op, int update)
1677 int updated = 0;
1678
1679 if (op->nframes > 1) {
1680 - int i;
1681 + unsigned int i;
1682
1683 /* for MUX filter we start at index 1 */
1684 for (i = 1; i < op->nframes; i++)
1685 @@ -623,7 +631,7 @@ static void bcm_rx_handler(struct sk_buff *skb, void *data)
1686 {
1687 struct bcm_op *op = (struct bcm_op *)data;
1688 const struct can_frame *rxframe = (struct can_frame *)skb->data;
1689 - int i;
1690 + unsigned int i;
1691
1692 /* disable timeout */
1693 hrtimer_cancel(&op->timer);
1694 @@ -823,14 +831,15 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
1695 {
1696 struct bcm_sock *bo = bcm_sk(sk);
1697 struct bcm_op *op;
1698 - int i, err;
1699 + unsigned int i;
1700 + int err;
1701
1702 /* we need a real device to send frames */
1703 if (!ifindex)
1704 return -ENODEV;
1705
1706 - /* we need at least one can_frame */
1707 - if (msg_head->nframes < 1)
1708 + /* check nframes boundaries - we need at least one can_frame */
1709 + if (msg_head->nframes < 1 || msg_head->nframes > MAX_NFRAMES)
1710 return -EINVAL;
1711
1712 /* check the given can_id */
1713 @@ -994,6 +1003,10 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
1714 msg_head->nframes = 0;
1715 }
1716
1717 + /* the first element contains the mux-mask => MAX_NFRAMES + 1 */
1718 + if (msg_head->nframes > MAX_NFRAMES + 1)
1719 + return -EINVAL;
1720 +
1721 if ((msg_head->flags & RX_RTR_FRAME) &&
1722 ((msg_head->nframes != 1) ||
1723 (!(msg_head->can_id & CAN_RTR_FLAG))))
1724 diff --git a/net/core/dev.c b/net/core/dev.c
1725 index 74d0cce..915d0ae 100644
1726 --- a/net/core/dev.c
1727 +++ b/net/core/dev.c
1728 @@ -2519,7 +2519,7 @@ pull:
1729 put_page(skb_shinfo(skb)->frags[0].page);
1730 memmove(skb_shinfo(skb)->frags,
1731 skb_shinfo(skb)->frags + 1,
1732 - --skb_shinfo(skb)->nr_frags);
1733 + --skb_shinfo(skb)->nr_frags * sizeof(skb_frag_t));
1734 }
1735 }
1736
1737 diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
1738 index 19e9800..5a7dcdf 100644
1739 --- a/net/netlink/af_netlink.c
1740 +++ b/net/netlink/af_netlink.c
1741 @@ -1363,7 +1363,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
1742 struct netlink_sock *nlk = nlk_sk(sk);
1743 int noblock = flags&MSG_DONTWAIT;
1744 size_t copied;
1745 - struct sk_buff *skb, *frag __maybe_unused = NULL;
1746 + struct sk_buff *skb, *data_skb;
1747 int err;
1748
1749 if (flags&MSG_OOB)
1750 @@ -1375,45 +1375,35 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
1751 if (skb == NULL)
1752 goto out;
1753
1754 + data_skb = skb;
1755 +
1756 #ifdef CONFIG_COMPAT_NETLINK_MESSAGES
1757 if (unlikely(skb_shinfo(skb)->frag_list)) {
1758 - bool need_compat = !!(flags & MSG_CMSG_COMPAT);
1759 -
1760 /*
1761 - * If this skb has a frag_list, then here that means that
1762 - * we will have to use the frag_list skb for compat tasks
1763 - * and the regular skb for non-compat tasks.
1764 + * If this skb has a frag_list, then here that means that we
1765 + * will have to use the frag_list skb's data for compat tasks
1766 + * and the regular skb's data for normal (non-compat) tasks.
1767 *
1768 - * The skb might (and likely will) be cloned, so we can't
1769 - * just reset frag_list and go on with things -- we need to
1770 - * keep that. For the compat case that's easy -- simply get
1771 - * a reference to the compat skb and free the regular one
1772 - * including the frag. For the non-compat case, we need to
1773 - * avoid sending the frag to the user -- so assign NULL but
1774 - * restore it below before freeing the skb.
1775 + * If we need to send the compat skb, assign it to the
1776 + * 'data_skb' variable so that it will be used below for data
1777 + * copying. We keep 'skb' for everything else, including
1778 + * freeing both later.
1779 */
1780 - if (need_compat) {
1781 - struct sk_buff *compskb = skb_shinfo(skb)->frag_list;
1782 - skb_get(compskb);
1783 - kfree_skb(skb);
1784 - skb = compskb;
1785 - } else {
1786 - frag = skb_shinfo(skb)->frag_list;
1787 - skb_shinfo(skb)->frag_list = NULL;
1788 - }
1789 + if (flags & MSG_CMSG_COMPAT)
1790 + data_skb = skb_shinfo(skb)->frag_list;
1791 }
1792 #endif
1793
1794 msg->msg_namelen = 0;
1795
1796 - copied = skb->len;
1797 + copied = data_skb->len;
1798 if (len < copied) {
1799 msg->msg_flags |= MSG_TRUNC;
1800 copied = len;
1801 }
1802
1803 - skb_reset_transport_header(skb);
1804 - err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied);
1805 + skb_reset_transport_header(data_skb);
1806 + err = skb_copy_datagram_iovec(data_skb, 0, msg->msg_iov, copied);
1807
1808 if (msg->msg_name) {
1809 struct sockaddr_nl *addr = (struct sockaddr_nl *)msg->msg_name;
1810 @@ -1433,11 +1423,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
1811 }
1812 siocb->scm->creds = *NETLINK_CREDS(skb);
1813 if (flags & MSG_TRUNC)
1814 - copied = skb->len;
1815 -
1816 -#ifdef CONFIG_COMPAT_NETLINK_MESSAGES
1817 - skb_shinfo(skb)->frag_list = frag;
1818 -#endif
1819 + copied = data_skb->len;
1820
1821 skb_free_datagram(sk, skb);
1822
1823 diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c
1824 index d885ba3..37e198c 100644
1825 --- a/net/sched/act_nat.c
1826 +++ b/net/sched/act_nat.c
1827 @@ -240,7 +240,7 @@ static int tcf_nat(struct sk_buff *skb, struct tc_action *a,
1828 iph->saddr = new_addr;
1829
1830 inet_proto_csum_replace4(&icmph->checksum, skb, addr, new_addr,
1831 - 1);
1832 + 0);
1833 break;
1834 }
1835 default:
1836 diff --git a/scripts/mkmakefile b/scripts/mkmakefile
1837 index 67d59c7..5325423 100644
1838 --- a/scripts/mkmakefile
1839 +++ b/scripts/mkmakefile
1840 @@ -44,7 +44,9 @@ all:
1841
1842 Makefile:;
1843
1844 -\$(all) %/: all
1845 +\$(all): all
1846 @:
1847
1848 +%/: all
1849 + @:
1850 EOF
1851 diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
1852 index 7ba779d..e6d2d97 100644
1853 --- a/sound/core/pcm_native.c
1854 +++ b/sound/core/pcm_native.c
1855 @@ -972,6 +972,10 @@ static int snd_pcm_do_pause(struct snd_pcm_substream *substream, int push)
1856 {
1857 if (substream->runtime->trigger_master != substream)
1858 return 0;
1859 + /* some drivers might use hw_ptr to recover from the pause -
1860 + update the hw_ptr now */
1861 + if (push)
1862 + snd_pcm_update_hw_ptr(substream);
1863 /* The jiffies check in snd_pcm_update_hw_ptr*() is done by
1864 * a delta betwen the current jiffies, this gives a large enough
1865 * delta, effectively to skip the check once.
1866 diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
1867 index 168af67..92626f3 100644
1868 --- a/sound/pci/emu10k1/emu10k1.c
1869 +++ b/sound/pci/emu10k1/emu10k1.c
1870 @@ -52,6 +52,7 @@ static int max_synth_voices[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 64};
1871 static int max_buffer_size[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 128};
1872 static int enable_ir[SNDRV_CARDS];
1873 static uint subsystem[SNDRV_CARDS]; /* Force card subsystem model */
1874 +static uint delay_pcm_irq[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
1875
1876 module_param_array(index, int, NULL, 0444);
1877 MODULE_PARM_DESC(index, "Index value for the EMU10K1 soundcard.");
1878 @@ -73,6 +74,8 @@ module_param_array(enable_ir, bool, NULL, 0444);
1879 MODULE_PARM_DESC(enable_ir, "Enable IR.");
1880 module_param_array(subsystem, uint, NULL, 0444);
1881 MODULE_PARM_DESC(subsystem, "Force card subsystem model.");
1882 +module_param_array(delay_pcm_irq, uint, NULL, 0444);
1883 +MODULE_PARM_DESC(delay_pcm_irq, "Delay PCM interrupt by specified number of samples (default 0).");
1884 /*
1885 * Class 0401: 1102:0008 (rev 00) Subsystem: 1102:1001 -> Audigy2 Value Model:SB0400
1886 */
1887 @@ -127,6 +130,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
1888 &emu)) < 0)
1889 goto error;
1890 card->private_data = emu;
1891 + emu->delay_pcm_irq = delay_pcm_irq[dev] & 0x1f;
1892 if ((err = snd_emu10k1_pcm(emu, 0, NULL)) < 0)
1893 goto error;
1894 if ((err = snd_emu10k1_pcm_mic(emu, 1, NULL)) < 0)
1895 diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
1896 index 55b83ef..622bace 100644
1897 --- a/sound/pci/emu10k1/emupcm.c
1898 +++ b/sound/pci/emu10k1/emupcm.c
1899 @@ -332,7 +332,7 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu,
1900 evoice->epcm->ccca_start_addr = start_addr + ccis;
1901 if (extra) {
1902 start_addr += ccis;
1903 - end_addr += ccis;
1904 + end_addr += ccis + emu->delay_pcm_irq;
1905 }
1906 if (stereo && !extra) {
1907 snd_emu10k1_ptr_write(emu, CPF, voice, CPF_STEREO_MASK);
1908 @@ -360,7 +360,9 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu,
1909 /* Assumption that PT is already 0 so no harm overwriting */
1910 snd_emu10k1_ptr_write(emu, PTRX, voice, (send_amount[0] << 8) | send_amount[1]);
1911 snd_emu10k1_ptr_write(emu, DSL, voice, end_addr | (send_amount[3] << 24));
1912 - snd_emu10k1_ptr_write(emu, PSST, voice, start_addr | (send_amount[2] << 24));
1913 + snd_emu10k1_ptr_write(emu, PSST, voice,
1914 + (start_addr + (extra ? emu->delay_pcm_irq : 0)) |
1915 + (send_amount[2] << 24));
1916 if (emu->card_capabilities->emu_model)
1917 pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */
1918 else
1919 @@ -732,6 +734,23 @@ static void snd_emu10k1_playback_stop_voice(struct snd_emu10k1 *emu, struct snd_
1920 snd_emu10k1_ptr_write(emu, IP, voice, 0);
1921 }
1922
1923 +static inline void snd_emu10k1_playback_mangle_extra(struct snd_emu10k1 *emu,
1924 + struct snd_emu10k1_pcm *epcm,
1925 + struct snd_pcm_substream *substream,
1926 + struct snd_pcm_runtime *runtime)
1927 +{
1928 + unsigned int ptr, period_pos;
1929 +
1930 + /* try to sychronize the current position for the interrupt
1931 + source voice */
1932 + period_pos = runtime->status->hw_ptr - runtime->hw_ptr_interrupt;
1933 + period_pos %= runtime->period_size;
1934 + ptr = snd_emu10k1_ptr_read(emu, CCCA, epcm->extra->number);
1935 + ptr &= ~0x00ffffff;
1936 + ptr |= epcm->ccca_start_addr + period_pos;
1937 + snd_emu10k1_ptr_write(emu, CCCA, epcm->extra->number, ptr);
1938 +}
1939 +
1940 static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream,
1941 int cmd)
1942 {
1943 @@ -753,6 +772,8 @@ static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream,
1944 /* follow thru */
1945 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
1946 case SNDRV_PCM_TRIGGER_RESUME:
1947 + if (cmd == SNDRV_PCM_TRIGGER_PAUSE_RELEASE)
1948 + snd_emu10k1_playback_mangle_extra(emu, epcm, substream, runtime);
1949 mix = &emu->pcm_mixer[substream->number];
1950 snd_emu10k1_playback_prepare_voice(emu, epcm->voices[0], 1, 0, mix);
1951 snd_emu10k1_playback_prepare_voice(emu, epcm->voices[1], 0, 0, mix);
1952 @@ -869,8 +890,9 @@ static snd_pcm_uframes_t snd_emu10k1_playback_pointer(struct snd_pcm_substream *
1953 #endif
1954 /*
1955 printk(KERN_DEBUG
1956 - "ptr = 0x%x, buffer_size = 0x%x, period_size = 0x%x\n",
1957 - ptr, runtime->buffer_size, runtime->period_size);
1958 + "ptr = 0x%lx, buffer_size = 0x%lx, period_size = 0x%lx\n",
1959 + (long)ptr, (long)runtime->buffer_size,
1960 + (long)runtime->period_size);
1961 */
1962 return ptr;
1963 }
1964 diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
1965 index 6a47672..7c3ce5f 100644
1966 --- a/sound/pci/emu10k1/memory.c
1967 +++ b/sound/pci/emu10k1/memory.c
1968 @@ -309,8 +309,10 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
1969 if (snd_BUG_ON(!hdr))
1970 return NULL;
1971
1972 + idx = runtime->period_size >= runtime->buffer_size ?
1973 + (emu->delay_pcm_irq * 2) : 0;
1974 mutex_lock(&hdr->block_mutex);
1975 - blk = search_empty(emu, runtime->dma_bytes);
1976 + blk = search_empty(emu, runtime->dma_bytes + idx);
1977 if (blk == NULL) {
1978 mutex_unlock(&hdr->block_mutex);
1979 return NULL;
1980 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1981 index aa2ec23..7b4e74d 100644
1982 --- a/sound/pci/hda/patch_realtek.c
1983 +++ b/sound/pci/hda/patch_realtek.c
1984 @@ -6455,6 +6455,7 @@ static int patch_alc260(struct hda_codec *codec)
1985
1986 spec->stream_analog_playback = &alc260_pcm_analog_playback;
1987 spec->stream_analog_capture = &alc260_pcm_analog_capture;
1988 + spec->stream_analog_alt_capture = &alc260_pcm_analog_capture;
1989
1990 spec->stream_digital_playback = &alc260_pcm_digital_playback;
1991 spec->stream_digital_capture = &alc260_pcm_digital_capture;
1992 diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
1993 index aac20fb..4196e3d 100644
1994 --- a/sound/pci/intel8x0.c
1995 +++ b/sound/pci/intel8x0.c
1996 @@ -1776,6 +1776,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
1997 },
1998 {
1999 .subvendor = 0x1014,
2000 + .subdevice = 0x0534,
2001 + .name = "ThinkPad X31",
2002 + .type = AC97_TUNE_INV_EAPD
2003 + },
2004 + {
2005 + .subvendor = 0x1014,
2006 .subdevice = 0x1f00,
2007 .name = "MS-9128",
2008 .type = AC97_TUNE_ALC_JACK
2009 diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
2010 index b5ca02e..246b7c6 100644
2011 --- a/sound/pci/riptide/riptide.c
2012 +++ b/sound/pci/riptide/riptide.c
2013 @@ -1224,15 +1224,14 @@ static int try_to_load_firmware(struct cmdif *cif, struct snd_riptide *chip)
2014 firmware.firmware.ASIC, firmware.firmware.CODEC,
2015 firmware.firmware.AUXDSP, firmware.firmware.PROG);
2016
2017 + if (!chip)
2018 + return 1;
2019 +
2020 for (i = 0; i < FIRMWARE_VERSIONS; i++) {
2021 if (!memcmp(&firmware_versions[i], &firmware, sizeof(firmware)))
2022 - break;
2023 - }
2024 - if (i >= FIRMWARE_VERSIONS)
2025 - return 0; /* no match */
2026 + return 1; /* OK */
2027
2028 - if (!chip)
2029 - return 1; /* OK */
2030 + }
2031
2032 snd_printdd("Writing Firmware\n");
2033 if (!chip->fw_entry) {
2034 diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
2035 index 6bded8c..c1e767d 100644
2036 --- a/sound/soc/codecs/wm8580.c
2037 +++ b/sound/soc/codecs/wm8580.c
2038 @@ -268,9 +268,9 @@ SOC_DOUBLE("DAC2 Invert Switch", WM8580_DAC_CONTROL4, 2, 3, 1, 0),
2039 SOC_DOUBLE("DAC3 Invert Switch", WM8580_DAC_CONTROL4, 4, 5, 1, 0),
2040
2041 SOC_SINGLE("DAC ZC Switch", WM8580_DAC_CONTROL5, 5, 1, 0),
2042 -SOC_SINGLE("DAC1 Switch", WM8580_DAC_CONTROL5, 0, 1, 0),
2043 -SOC_SINGLE("DAC2 Switch", WM8580_DAC_CONTROL5, 1, 1, 0),
2044 -SOC_SINGLE("DAC3 Switch", WM8580_DAC_CONTROL5, 2, 1, 0),
2045 +SOC_SINGLE("DAC1 Switch", WM8580_DAC_CONTROL5, 0, 1, 1),
2046 +SOC_SINGLE("DAC2 Switch", WM8580_DAC_CONTROL5, 1, 1, 1),
2047 +SOC_SINGLE("DAC3 Switch", WM8580_DAC_CONTROL5, 2, 1, 1),
2048
2049 SOC_DOUBLE("ADC Mute Switch", WM8580_ADC_CONTROL1, 0, 1, 1, 0),
2050 SOC_SINGLE("ADC High-Pass Filter Switch", WM8580_ADC_CONTROL1, 4, 1, 0),
2051 diff --git a/sound/soc/codecs/wm8776.c b/sound/soc/codecs/wm8776.c
2052 index 8286c62..38a53a6 100644
2053 --- a/sound/soc/codecs/wm8776.c
2054 +++ b/sound/soc/codecs/wm8776.c
2055 @@ -177,13 +177,6 @@ static int wm8776_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
2056 case SND_SOC_DAIFMT_LEFT_J:
2057 iface |= 0x0001;
2058 break;
2059 - /* FIXME: CHECK A/B */
2060 - case SND_SOC_DAIFMT_DSP_A:
2061 - iface |= 0x0003;
2062 - break;
2063 - case SND_SOC_DAIFMT_DSP_B:
2064 - iface |= 0x0007;
2065 - break;
2066 default:
2067 return -EINVAL;
2068 }

  ViewVC Help
Powered by ViewVC 1.1.20