Magellan Linux

Contents of /trunk/kernel26-alx/patches-2.6.26-r1/0100-2.6.26.1-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 681 - (show annotations) (download)
Wed Sep 17 19:42:13 2008 UTC (15 years, 7 months ago) by niro
File size: 69765 byte(s)
-2.6.26-alx-r1

1 diff --git a/Documentation/networking/udplite.txt b/Documentation/networking/udplite.txt
2 index 3870f28..855d8da 100644
3 --- a/Documentation/networking/udplite.txt
4 +++ b/Documentation/networking/udplite.txt
5 @@ -148,7 +148,7 @@
6 getsockopt(sockfd, SOL_SOCKET, SO_NO_CHECK, &value, ...);
7
8 is meaningless (as in TCP). Packets with a zero checksum field are
9 - illegal (cf. RFC 3828, sec. 3.1) will be silently discarded.
10 + illegal (cf. RFC 3828, sec. 3.1) and will be silently discarded.
11
12 4) Fragmentation
13
14 diff --git a/Documentation/video4linux/cx18.txt b/Documentation/video4linux/cx18.txt
15 index 6842c26..63f3aef 100644
16 --- a/Documentation/video4linux/cx18.txt
17 +++ b/Documentation/video4linux/cx18.txt
18 @@ -23,14 +23,8 @@ encoder chip:
19
20 Firmware:
21
22 -The firmware needs to be extracted from the Windows Hauppauge HVR-1600
23 -driver, available here:
24 +You can obtain the firmware files here:
25
26 -http://hauppauge.lightpath.net/software/install_cd/hauppauge_cd_3.4d1.zip
27 +http://dl.ivtvdriver.org/ivtv/firmware/cx18-firmware.tar.gz
28
29 -Unzip, then copy the following files to the firmware directory
30 -and rename them as follows:
31 -
32 -Drivers/Driver18/hcw18apu.rom -> v4l-cx23418-apu.fw
33 -Drivers/Driver18/hcw18enc.rom -> v4l-cx23418-cpu.fw
34 -Drivers/Driver18/hcw18mlC.rom -> v4l-cx23418-dig.fw
35 +Untar and copy the .fw files to your firmware directory.
36 diff --git a/Makefile b/Makefile
37 index e3c5eb6..c536d7b 100644
38 --- a/Makefile
39 +++ b/Makefile
40 @@ -1133,7 +1133,8 @@ clean: archclean $(clean-dirs)
41 @find . $(RCS_FIND_IGNORE) \
42 \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
43 -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
44 - -o -name '*.symtypes' -o -name 'modules.order' \) \
45 + -o -name '*.symtypes' -o -name 'modules.order' \
46 + -o -name 'Module.markers' \) \
47 -type f -print | xargs rm -f
48
49 # mrproper - Delete all generated files, including .config
50 diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
51 index 318b811..5152ba0 100644
52 --- a/arch/ia64/kvm/kvm-ia64.c
53 +++ b/arch/ia64/kvm/kvm-ia64.c
54 @@ -1460,6 +1460,9 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
55 return 0;
56 }
57
58 +void kvm_arch_flush_shadow(struct kvm *kvm)
59 +{
60 +}
61
62 long kvm_arch_dev_ioctl(struct file *filp,
63 unsigned int ioctl, unsigned long arg)
64 diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
65 index 777e0f3..1eaa3e4 100644
66 --- a/arch/powerpc/kvm/powerpc.c
67 +++ b/arch/powerpc/kvm/powerpc.c
68 @@ -167,6 +167,10 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
69 return 0;
70 }
71
72 +void kvm_arch_flush_shadow(struct kvm *kvm)
73 +{
74 +}
75 +
76 struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
77 {
78 struct kvm_vcpu *vcpu;
79 diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c b/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
80 index 69288f6..3233fe8 100644
81 --- a/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
82 +++ b/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
83 @@ -96,6 +96,12 @@ static int pmi_notifier(struct notifier_block *nb,
84 struct cpufreq_frequency_table *cbe_freqs;
85 u8 node;
86
87 + /* Should this really be called for CPUFREQ_ADJUST, CPUFREQ_INCOMPATIBLE
88 + * and CPUFREQ_NOTIFY policy events?)
89 + */
90 + if (event == CPUFREQ_START)
91 + return 0;
92 +
93 cbe_freqs = cpufreq_frequency_get_table(policy->cpu);
94 node = cbe_cpu_to_node(policy->cpu);
95
96 diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
97 index 6558b09..b19c170 100644
98 --- a/arch/s390/kvm/kvm-s390.c
99 +++ b/arch/s390/kvm/kvm-s390.c
100 @@ -672,6 +672,10 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
101 return 0;
102 }
103
104 +void kvm_arch_flush_shadow(struct kvm *kvm)
105 +{
106 +}
107 +
108 gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn)
109 {
110 return gfn;
111 diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
112 index b441a26..c481673 100644
113 --- a/arch/sparc64/kernel/irq.c
114 +++ b/arch/sparc64/kernel/irq.c
115 @@ -621,8 +621,9 @@ unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino)
116 unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino)
117 {
118 struct irq_handler_data *data;
119 - struct ino_bucket *bucket;
120 unsigned long hv_err, cookie;
121 + struct ino_bucket *bucket;
122 + struct irq_desc *desc;
123 unsigned int virt_irq;
124
125 bucket = kzalloc(sizeof(struct ino_bucket), GFP_ATOMIC);
126 @@ -643,6 +644,13 @@ unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino)
127 if (unlikely(!data))
128 return 0;
129
130 + /* In order to make the LDC channel startup sequence easier,
131 + * especially wrt. locking, we do not let request_irq() enable
132 + * the interrupt.
133 + */
134 + desc = irq_desc + virt_irq;
135 + desc->status |= IRQ_NOAUTOEN;
136 +
137 set_irq_chip_data(virt_irq, data);
138
139 /* Catch accidental accesses to these things. IMAP/ICLR handling
140 diff --git a/arch/sparc64/kernel/ldc.c b/arch/sparc64/kernel/ldc.c
141 index 63969f6..d689823 100644
142 --- a/arch/sparc64/kernel/ldc.c
143 +++ b/arch/sparc64/kernel/ldc.c
144 @@ -1,6 +1,6 @@
145 /* ldc.c: Logical Domain Channel link-layer protocol driver.
146 *
147 - * Copyright (C) 2007 David S. Miller <davem@davemloft.net>
148 + * Copyright (C) 2007, 2008 David S. Miller <davem@davemloft.net>
149 */
150
151 #include <linux/kernel.h>
152 @@ -23,8 +23,8 @@
153
154 #define DRV_MODULE_NAME "ldc"
155 #define PFX DRV_MODULE_NAME ": "
156 -#define DRV_MODULE_VERSION "1.0"
157 -#define DRV_MODULE_RELDATE "June 25, 2007"
158 +#define DRV_MODULE_VERSION "1.1"
159 +#define DRV_MODULE_RELDATE "July 22, 2008"
160
161 static char version[] __devinitdata =
162 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
163 @@ -1235,13 +1235,9 @@ int ldc_bind(struct ldc_channel *lp, const char *name)
164 unsigned long hv_err, flags;
165 int err = -EINVAL;
166
167 - spin_lock_irqsave(&lp->lock, flags);
168 -
169 - if (!name)
170 - goto out_err;
171 -
172 - if (lp->state != LDC_STATE_INIT)
173 - goto out_err;
174 + if (!name ||
175 + (lp->state != LDC_STATE_INIT))
176 + return -EINVAL;
177
178 snprintf(lp->rx_irq_name, LDC_IRQ_NAME_MAX, "%s RX", name);
179 snprintf(lp->tx_irq_name, LDC_IRQ_NAME_MAX, "%s TX", name);
180 @@ -1250,25 +1246,32 @@ int ldc_bind(struct ldc_channel *lp, const char *name)
181 IRQF_SAMPLE_RANDOM | IRQF_SHARED,
182 lp->rx_irq_name, lp);
183 if (err)
184 - goto out_err;
185 + return err;
186
187 err = request_irq(lp->cfg.tx_irq, ldc_tx,
188 IRQF_SAMPLE_RANDOM | IRQF_SHARED,
189 lp->tx_irq_name, lp);
190 - if (err)
191 - goto out_free_rx_irq;
192 + if (err) {
193 + free_irq(lp->cfg.rx_irq, lp);
194 + return err;
195 + }
196 +
197
198 + spin_lock_irqsave(&lp->lock, flags);
199 +
200 + enable_irq(lp->cfg.rx_irq);
201 + enable_irq(lp->cfg.tx_irq);
202
203 lp->flags |= LDC_FLAG_REGISTERED_IRQS;
204
205 err = -ENODEV;
206 hv_err = sun4v_ldc_tx_qconf(lp->id, 0, 0);
207 if (hv_err)
208 - goto out_free_tx_irq;
209 + goto out_free_irqs;
210
211 hv_err = sun4v_ldc_tx_qconf(lp->id, lp->tx_ra, lp->tx_num_entries);
212 if (hv_err)
213 - goto out_free_tx_irq;
214 + goto out_free_irqs;
215
216 hv_err = sun4v_ldc_rx_qconf(lp->id, 0, 0);
217 if (hv_err)
218 @@ -1304,14 +1307,11 @@ out_unmap_rx:
219 out_unmap_tx:
220 sun4v_ldc_tx_qconf(lp->id, 0, 0);
221
222 -out_free_tx_irq:
223 +out_free_irqs:
224 lp->flags &= ~LDC_FLAG_REGISTERED_IRQS;
225 free_irq(lp->cfg.tx_irq, lp);
226 -
227 -out_free_rx_irq:
228 free_irq(lp->cfg.rx_irq, lp);
229
230 -out_err:
231 spin_unlock_irqrestore(&lp->lock, flags);
232
233 return err;
234 diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
235 index e5d2389..f464023 100644
236 --- a/arch/sparc64/kernel/time.c
237 +++ b/arch/sparc64/kernel/time.c
238 @@ -883,6 +883,16 @@ static struct notifier_block sparc64_cpufreq_notifier_block = {
239 .notifier_call = sparc64_cpufreq_notifier
240 };
241
242 +static int __init register_sparc64_cpufreq_notifier(void)
243 +{
244 +
245 + cpufreq_register_notifier(&sparc64_cpufreq_notifier_block,
246 + CPUFREQ_TRANSITION_NOTIFIER);
247 + return 0;
248 +}
249 +
250 +core_initcall(register_sparc64_cpufreq_notifier);
251 +
252 #endif /* CONFIG_CPU_FREQ */
253
254 static int sparc64_next_event(unsigned long delta,
255 @@ -1049,11 +1059,6 @@ void __init time_init(void)
256 sparc64_clockevent.mult, sparc64_clockevent.shift);
257
258 setup_sparc64_timer();
259 -
260 -#ifdef CONFIG_CPU_FREQ
261 - cpufreq_register_notifier(&sparc64_cpufreq_notifier_block,
262 - CPUFREQ_TRANSITION_NOTIFIER);
263 -#endif
264 }
265
266 unsigned long long sched_clock(void)
267 diff --git a/arch/um/include/init.h b/arch/um/include/init.h
268 index b00a957..37dd097 100644
269 --- a/arch/um/include/init.h
270 +++ b/arch/um/include/init.h
271 @@ -45,6 +45,8 @@ typedef void (*exitcall_t)(void);
272 # define __section(S) __attribute__ ((__section__(#S)))
273 #endif
274
275 +#if __GNUC__ == 3
276 +
277 #if __GNUC_MINOR__ >= 3
278 # define __used __attribute__((__used__))
279 #else
280 @@ -52,6 +54,12 @@ typedef void (*exitcall_t)(void);
281 #endif
282
283 #else
284 +#if __GNUC__ == 4
285 +# define __used __attribute__((__used__))
286 +#endif
287 +#endif
288 +
289 +#else
290 #include <linux/compiler.h>
291 #endif
292 /* These are for everybody (although not all archs will actually
293 diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
294 index 2ad6301..dd138a2 100644
295 --- a/arch/x86/Kconfig.cpu
296 +++ b/arch/x86/Kconfig.cpu
297 @@ -414,4 +414,4 @@ config X86_MINIMUM_CPU_FAMILY
298
299 config X86_DEBUGCTLMSR
300 def_bool y
301 - depends on !(M586MMX || M586TSC || M586 || M486 || M386)
302 + depends on !(MK6 || MWINCHIPC6 || MWINCHIP2 || MWINCHIP3D || MCYRIXIII || M586MMX || M586TSC || M586 || M486 || M386)
303 diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
304 index 36af01f..130711f 100644
305 --- a/arch/x86/kernel/acpi/sleep.c
306 +++ b/arch/x86/kernel/acpi/sleep.c
307 @@ -23,6 +23,15 @@ static unsigned long acpi_realmode;
308 static char temp_stack[10240];
309 #endif
310
311 +/* XXX: this macro should move to asm-x86/segment.h and be shared with the
312 + boot code... */
313 +#define GDT_ENTRY(flags, base, limit) \
314 + (((u64)(base & 0xff000000) << 32) | \
315 + ((u64)flags << 40) | \
316 + ((u64)(limit & 0x00ff0000) << 32) | \
317 + ((u64)(base & 0x00ffffff) << 16) | \
318 + ((u64)(limit & 0x0000ffff)))
319 +
320 /**
321 * acpi_save_state_mem - save kernel state
322 *
323 @@ -58,11 +67,11 @@ int acpi_save_state_mem(void)
324 ((char *)&header->wakeup_gdt - (char *)acpi_realmode))
325 << 16);
326 /* GDT[1]: real-mode-like code segment */
327 - header->wakeup_gdt[1] = (0x009bULL << 40) +
328 - ((u64)acpi_wakeup_address << 16) + 0xffff;
329 + header->wakeup_gdt[1] =
330 + GDT_ENTRY(0x809b, acpi_wakeup_address, 0xfffff);
331 /* GDT[2]: real-mode-like data segment */
332 - header->wakeup_gdt[2] = (0x0093ULL << 40) +
333 - ((u64)acpi_wakeup_address << 16) + 0xffff;
334 + header->wakeup_gdt[2] =
335 + GDT_ENTRY(0x8093, acpi_wakeup_address, 0xfffff);
336
337 #ifndef CONFIG_64BIT
338 store_gdt((struct desc_ptr *)&header->pmode_gdt);
339 diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
340 index 95e80e5..eb9ddd8 100644
341 --- a/arch/x86/kernel/i387.c
342 +++ b/arch/x86/kernel/i387.c
343 @@ -162,7 +162,7 @@ int xfpregs_get(struct task_struct *target, const struct user_regset *regset,
344 int ret;
345
346 if (!cpu_has_fxsr)
347 - return -EIO;
348 + return -ENODEV;
349
350 ret = init_fpu(target);
351 if (ret)
352 @@ -179,7 +179,7 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
353 int ret;
354
355 if (!cpu_has_fxsr)
356 - return -EIO;
357 + return -ENODEV;
358
359 ret = init_fpu(target);
360 if (ret)
361 diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
362 index a7835f2..77040b6 100644
363 --- a/arch/x86/kernel/ptrace.c
364 +++ b/arch/x86/kernel/ptrace.c
365 @@ -943,13 +943,13 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
366 return copy_regset_to_user(child, &user_x86_32_view,
367 REGSET_XFP,
368 0, sizeof(struct user_fxsr_struct),
369 - datap);
370 + datap) ? -EIO : 0;
371
372 case PTRACE_SETFPXREGS: /* Set the child extended FPU state. */
373 return copy_regset_from_user(child, &user_x86_32_view,
374 REGSET_XFP,
375 0, sizeof(struct user_fxsr_struct),
376 - datap);
377 + datap) ? -EIO : 0;
378 #endif
379
380 #if defined CONFIG_X86_32 || defined CONFIG_IA32_EMULATION
381 diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
382 index f6be7d5..d834b36 100644
383 --- a/arch/x86/kernel/reboot.c
384 +++ b/arch/x86/kernel/reboot.c
385 @@ -177,6 +177,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
386 DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
387 },
388 },
389 + { /* Handle problems with rebooting on Dell T5400's */
390 + .callback = set_bios_reboot,
391 + .ident = "Dell Precision T5400",
392 + .matches = {
393 + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
394 + DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
395 + },
396 + },
397 { /* Handle problems with rebooting on HP laptops */
398 .callback = set_bios_reboot,
399 .ident = "HP Compaq Laptop",
400 diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
401 index 7e7c396..c26d811 100644
402 --- a/arch/x86/kvm/mmu.c
403 +++ b/arch/x86/kvm/mmu.c
404 @@ -1171,9 +1171,10 @@ static int __direct_map(struct kvm_vcpu *vcpu, gpa_t v, int write,
405 return -ENOMEM;
406 }
407
408 - table[index] = __pa(new_table->spt)
409 - | PT_PRESENT_MASK | PT_WRITABLE_MASK
410 - | shadow_user_mask | shadow_x_mask;
411 + set_shadow_pte(&table[index],
412 + __pa(new_table->spt)
413 + | PT_PRESENT_MASK | PT_WRITABLE_MASK
414 + | shadow_user_mask | shadow_x_mask);
415 }
416 table_addr = table[index] & PT64_BASE_ADDR_MASK;
417 }
418 @@ -1968,6 +1969,8 @@ static int mmu_shrink(int nr_to_scan, gfp_t gfp_mask)
419 list_for_each_entry(kvm, &vm_list, vm_list) {
420 int npages;
421
422 + if (!down_read_trylock(&kvm->slots_lock))
423 + continue;
424 spin_lock(&kvm->mmu_lock);
425 npages = kvm->arch.n_alloc_mmu_pages -
426 kvm->arch.n_free_mmu_pages;
427 @@ -1980,6 +1983,7 @@ static int mmu_shrink(int nr_to_scan, gfp_t gfp_mask)
428 nr_to_scan--;
429
430 spin_unlock(&kvm->mmu_lock);
431 + up_read(&kvm->slots_lock);
432 }
433 if (kvm_freed)
434 list_move_tail(&kvm_freed->vm_list, &vm_list);
435 diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
436 index 6b0d5fa..06992d6 100644
437 --- a/arch/x86/kvm/svm.c
438 +++ b/arch/x86/kvm/svm.c
439 @@ -270,19 +270,11 @@ static int has_svm(void)
440
441 static void svm_hardware_disable(void *garbage)
442 {
443 - struct svm_cpu_data *svm_data
444 - = per_cpu(svm_data, raw_smp_processor_id());
445 -
446 - if (svm_data) {
447 - uint64_t efer;
448 + uint64_t efer;
449
450 - wrmsrl(MSR_VM_HSAVE_PA, 0);
451 - rdmsrl(MSR_EFER, efer);
452 - wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK);
453 - per_cpu(svm_data, raw_smp_processor_id()) = NULL;
454 - __free_page(svm_data->save_area);
455 - kfree(svm_data);
456 - }
457 + wrmsrl(MSR_VM_HSAVE_PA, 0);
458 + rdmsrl(MSR_EFER, efer);
459 + wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK);
460 }
461
462 static void svm_hardware_enable(void *garbage)
463 @@ -321,6 +313,19 @@ static void svm_hardware_enable(void *garbage)
464 page_to_pfn(svm_data->save_area) << PAGE_SHIFT);
465 }
466
467 +static void svm_cpu_uninit(int cpu)
468 +{
469 + struct svm_cpu_data *svm_data
470 + = per_cpu(svm_data, raw_smp_processor_id());
471 +
472 + if (!svm_data)
473 + return;
474 +
475 + per_cpu(svm_data, raw_smp_processor_id()) = NULL;
476 + __free_page(svm_data->save_area);
477 + kfree(svm_data);
478 +}
479 +
480 static int svm_cpu_init(int cpu)
481 {
482 struct svm_cpu_data *svm_data;
483 @@ -458,6 +463,11 @@ err:
484
485 static __exit void svm_hardware_unsetup(void)
486 {
487 + int cpu;
488 +
489 + for_each_online_cpu(cpu)
490 + svm_cpu_uninit(cpu);
491 +
492 __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER);
493 iopm_base = 0;
494 }
495 diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
496 index 540e951..2ce9063 100644
497 --- a/arch/x86/kvm/vmx.c
498 +++ b/arch/x86/kvm/vmx.c
499 @@ -88,6 +88,7 @@ static inline struct vcpu_vmx *to_vmx(struct kvm_vcpu *vcpu)
500 }
501
502 static int init_rmode(struct kvm *kvm);
503 +static u64 construct_eptp(unsigned long root_hpa);
504
505 static DEFINE_PER_CPU(struct vmcs *, vmxarea);
506 static DEFINE_PER_CPU(struct vmcs *, current_vmcs);
507 @@ -1389,6 +1390,8 @@ static void exit_lmode(struct kvm_vcpu *vcpu)
508 static void vmx_flush_tlb(struct kvm_vcpu *vcpu)
509 {
510 vpid_sync_vcpu_all(to_vmx(vcpu));
511 + if (vm_need_ept())
512 + ept_sync_context(construct_eptp(vcpu->arch.mmu.root_hpa));
513 }
514
515 static void vmx_decache_cr4_guest_bits(struct kvm_vcpu *vcpu)
516 @@ -1420,7 +1423,7 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0,
517 if (!(cr0 & X86_CR0_PG)) {
518 /* From paging/starting to nonpaging */
519 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL,
520 - vmcs_config.cpu_based_exec_ctrl |
521 + vmcs_read32(CPU_BASED_VM_EXEC_CONTROL) |
522 (CPU_BASED_CR3_LOAD_EXITING |
523 CPU_BASED_CR3_STORE_EXITING));
524 vcpu->arch.cr0 = cr0;
525 @@ -1430,7 +1433,7 @@ static void ept_update_paging_mode_cr0(unsigned long *hw_cr0,
526 } else if (!is_paging(vcpu)) {
527 /* From nonpaging to paging */
528 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL,
529 - vmcs_config.cpu_based_exec_ctrl &
530 + vmcs_read32(CPU_BASED_VM_EXEC_CONTROL) &
531 ~(CPU_BASED_CR3_LOAD_EXITING |
532 CPU_BASED_CR3_STORE_EXITING));
533 vcpu->arch.cr0 = cr0;
534 diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
535 index 63a77ca..5a7406e 100644
536 --- a/arch/x86/kvm/x86.c
537 +++ b/arch/x86/kvm/x86.c
538 @@ -4016,6 +4016,11 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
539 return 0;
540 }
541
542 +void kvm_arch_flush_shadow(struct kvm *kvm)
543 +{
544 + kvm_mmu_zap_all(kvm);
545 +}
546 +
547 int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
548 {
549 return vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE
550 diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
551 index 932f216..d41b9bc 100644
552 --- a/arch/x86/kvm/x86_emulate.c
553 +++ b/arch/x86/kvm/x86_emulate.c
554 @@ -1666,7 +1666,7 @@ special_insn:
555 break;
556 case 0xf4: /* hlt */
557 ctxt->vcpu->arch.halt_request = 1;
558 - goto done;
559 + break;
560 case 0xf5: /* cmc */
561 /* complement carry flag from eflags reg */
562 ctxt->eflags ^= EFLG_CF;
563 diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
564 index 819dad9..7b27710 100644
565 --- a/arch/x86/mm/init_64.c
566 +++ b/arch/x86/mm/init_64.c
567 @@ -579,7 +579,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, unsigned lon
568 else
569 pud = alloc_low_page(&pud_phys);
570
571 - next = start + PGDIR_SIZE;
572 + next = (start + PGDIR_SIZE) & PGDIR_MASK;
573 if (next > end)
574 next = end;
575 last_map_addr = phys_pud_init(pud, __pa(start), __pa(next));
576 diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
577 index d80b2d1..8c06a53 100644
578 --- a/drivers/acpi/processor_perflib.c
579 +++ b/drivers/acpi/processor_perflib.c
580 @@ -64,7 +64,13 @@ static DEFINE_MUTEX(performance_mutex);
581 * policy is adjusted accordingly.
582 */
583
584 -static unsigned int ignore_ppc = 0;
585 +/* ignore_ppc:
586 + * -1 -> cpufreq low level drivers not initialized -> _PSS, etc. not called yet
587 + * ignore _PPC
588 + * 0 -> cpufreq low level drivers initialized -> consider _PPC values
589 + * 1 -> ignore _PPC totally -> forced by user through boot param
590 + */
591 +static unsigned int ignore_ppc = -1;
592 module_param(ignore_ppc, uint, 0644);
593 MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \
594 "limited by BIOS, this should help");
595 @@ -72,7 +78,7 @@ MODULE_PARM_DESC(ignore_ppc, "If the frequency of your machine gets wrongly" \
596 #define PPC_REGISTERED 1
597 #define PPC_IN_USE 2
598
599 -static int acpi_processor_ppc_status = 0;
600 +static int acpi_processor_ppc_status;
601
602 static int acpi_processor_ppc_notifier(struct notifier_block *nb,
603 unsigned long event, void *data)
604 @@ -81,6 +87,11 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb,
605 struct acpi_processor *pr;
606 unsigned int ppc = 0;
607
608 + if (event == CPUFREQ_START && ignore_ppc <= 0) {
609 + ignore_ppc = 0;
610 + return 0;
611 + }
612 +
613 if (ignore_ppc)
614 return 0;
615
616 diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
617 index 1d41496..0471ef5 100644
618 --- a/drivers/cpufreq/cpufreq.c
619 +++ b/drivers/cpufreq/cpufreq.c
620 @@ -825,6 +825,9 @@ static int cpufreq_add_dev(struct sys_device *sys_dev)
621 policy->user_policy.min = policy->cpuinfo.min_freq;
622 policy->user_policy.max = policy->cpuinfo.max_freq;
623
624 + blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
625 + CPUFREQ_START, policy);
626 +
627 #ifdef CONFIG_SMP
628
629 #ifdef CONFIG_HOTPLUG_CPU
630 diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c
631 index 0ec0f43..4e6b052 100644
632 --- a/drivers/dma/iop-adma.c
633 +++ b/drivers/dma/iop-adma.c
634 @@ -1387,6 +1387,8 @@ static void iop_chan_start_null_xor(struct iop_adma_chan *iop_chan)
635 spin_unlock_bh(&iop_chan->lock);
636 }
637
638 +MODULE_ALIAS("platform:iop-adma");
639 +
640 static struct platform_driver iop_adma_driver = {
641 .probe = iop_adma_probe,
642 .remove = iop_adma_remove,
643 diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
644 index 68e7f19..0cc854e 100644
645 --- a/drivers/ide/ide-cd.c
646 +++ b/drivers/ide/ide-cd.c
647 @@ -1308,13 +1308,30 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
648 req.cmd_flags |= REQ_QUIET;
649
650 stat = ide_cd_queue_pc(drive, &req);
651 - if (stat == 0) {
652 - *capacity = 1 + be32_to_cpu(capbuf.lba);
653 - *sectors_per_frame =
654 - be32_to_cpu(capbuf.blocklen) >> SECTOR_BITS;
655 + if (stat)
656 + return stat;
657 +
658 + /*
659 + * Sanity check the given block size
660 + */
661 + switch (capbuf.blocklen) {
662 + case __constant_cpu_to_be32(512):
663 + case __constant_cpu_to_be32(1024):
664 + case __constant_cpu_to_be32(2048):
665 + case __constant_cpu_to_be32(4096):
666 + break;
667 + default:
668 + printk(KERN_ERR "%s: weird block size %u\n",
669 + drive->name, capbuf.blocklen);
670 + printk(KERN_ERR "%s: default to 2kb block size\n",
671 + drive->name);
672 + capbuf.blocklen = __constant_cpu_to_be32(2048);
673 + break;
674 }
675
676 - return stat;
677 + *capacity = 1 + be32_to_cpu(capbuf.lba);
678 + *sectors_per_frame = be32_to_cpu(capbuf.blocklen) >> SECTOR_BITS;
679 + return 0;
680 }
681
682 static int cdrom_read_tocentry(ide_drive_t *drive, int trackno, int msf_flag,
683 diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c
684 index c4d40fe..3dd20bf 100644
685 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c
686 +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c
687 @@ -1117,6 +1117,7 @@ struct usb_device_id dib0700_usb_id_table[] = {
688 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_HT_EXPRESS) },
689 { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_T_XXS) },
690 { USB_DEVICE(USB_VID_LEADTEK, USB_PID_WINFAST_DTV_DONGLE_STK7700P_2) },
691 + { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009) },
692 { 0 } /* Terminating entry */
693 };
694 MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table);
695 @@ -1372,7 +1373,7 @@ struct dvb_usb_device_properties dib0700_devices[] = {
696 }
697 },
698
699 - .num_device_descs = 2,
700 + .num_device_descs = 3,
701 .devices = {
702 { "DiBcom STK7070PD reference design",
703 { &dib0700_usb_id_table[17], NULL },
704 @@ -1381,6 +1382,10 @@ struct dvb_usb_device_properties dib0700_devices[] = {
705 { "Pinnacle PCTV Dual DVB-T Diversity Stick",
706 { &dib0700_usb_id_table[18], NULL },
707 { NULL },
708 + },
709 + { "Hauppauge Nova-TD Stick (52009)",
710 + { &dib0700_usb_id_table[35], NULL },
711 + { NULL },
712 }
713 }
714 }, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
715 diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
716 index 34245d1..31ded10 100644
717 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
718 +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h
719 @@ -132,6 +132,7 @@
720 #define USB_PID_HAUPPAUGE_NOVA_T_STICK_3 0x7070
721 #define USB_PID_HAUPPAUGE_MYTV_T 0x7080
722 #define USB_PID_HAUPPAUGE_NOVA_TD_STICK 0x9580
723 +#define USB_PID_HAUPPAUGE_NOVA_TD_STICK_52009 0x5200
724 #define USB_PID_AVERMEDIA_EXPRESS 0xb568
725 #define USB_PID_AVERMEDIA_VOLAR 0xa807
726 #define USB_PID_AVERMEDIA_VOLAR_2 0xb808
727 diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
728 index 5ccb0ae..e00717d 100644
729 --- a/drivers/media/video/Kconfig
730 +++ b/drivers/media/video/Kconfig
731 @@ -793,13 +793,7 @@ menuconfig V4L_USB_DRIVERS
732
733 if V4L_USB_DRIVERS && USB
734
735 -config USB_VIDEO_CLASS
736 - tristate "USB Video Class (UVC)"
737 - ---help---
738 - Support for the USB Video Class (UVC). Currently only video
739 - input devices, such as webcams, are supported.
740 -
741 - For more information see: <http://linux-uvc.berlios.de/>
742 +source "drivers/media/video/uvc/Kconfig"
743
744 source "drivers/media/video/pvrusb2/Kconfig"
745
746 diff --git a/drivers/media/video/cx18/cx18-firmware.c b/drivers/media/video/cx18/cx18-firmware.c
747 index 2694ce3..9dda2ca 100644
748 --- a/drivers/media/video/cx18/cx18-firmware.c
749 +++ b/drivers/media/video/cx18/cx18-firmware.c
750 @@ -90,7 +90,7 @@
751 #define CX18_DSP0_INTERRUPT_MASK 0xd0004C
752
753 /* Encoder/decoder firmware sizes */
754 -#define CX18_FW_CPU_SIZE (174716)
755 +#define CX18_FW_CPU_SIZE (158332)
756 #define CX18_FW_APU_SIZE (141200)
757
758 #define APU_ROM_SYNC1 0x6D676553 /* "mgeS" */
759 diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c
760 index c4cc2f3..ad143f1 100644
761 --- a/drivers/media/video/cx23885/cx23885-core.c
762 +++ b/drivers/media/video/cx23885/cx23885-core.c
763 @@ -76,6 +76,117 @@ LIST_HEAD(cx23885_devlist);
764 * 0x00010ea0 0x00010xxx Free
765 */
766
767 +static struct sram_channel cx23885_sram_channels[] = {
768 + [SRAM_CH01] = {
769 + .name = "VID A",
770 + .cmds_start = 0x10000,
771 + .ctrl_start = 0x10380,
772 + .cdt = 0x104c0,
773 + .fifo_start = 0x40,
774 + .fifo_size = 0x2800,
775 + .ptr1_reg = DMA1_PTR1,
776 + .ptr2_reg = DMA1_PTR2,
777 + .cnt1_reg = DMA1_CNT1,
778 + .cnt2_reg = DMA1_CNT2,
779 + },
780 + [SRAM_CH02] = {
781 + .name = "ch2",
782 + .cmds_start = 0x0,
783 + .ctrl_start = 0x0,
784 + .cdt = 0x0,
785 + .fifo_start = 0x0,
786 + .fifo_size = 0x0,
787 + .ptr1_reg = DMA2_PTR1,
788 + .ptr2_reg = DMA2_PTR2,
789 + .cnt1_reg = DMA2_CNT1,
790 + .cnt2_reg = DMA2_CNT2,
791 + },
792 + [SRAM_CH03] = {
793 + .name = "TS1 B",
794 + .cmds_start = 0x100A0,
795 + .ctrl_start = 0x10400,
796 + .cdt = 0x10580,
797 + .fifo_start = 0x5000,
798 + .fifo_size = 0x1000,
799 + .ptr1_reg = DMA3_PTR1,
800 + .ptr2_reg = DMA3_PTR2,
801 + .cnt1_reg = DMA3_CNT1,
802 + .cnt2_reg = DMA3_CNT2,
803 + },
804 + [SRAM_CH04] = {
805 + .name = "ch4",
806 + .cmds_start = 0x0,
807 + .ctrl_start = 0x0,
808 + .cdt = 0x0,
809 + .fifo_start = 0x0,
810 + .fifo_size = 0x0,
811 + .ptr1_reg = DMA4_PTR1,
812 + .ptr2_reg = DMA4_PTR2,
813 + .cnt1_reg = DMA4_CNT1,
814 + .cnt2_reg = DMA4_CNT2,
815 + },
816 + [SRAM_CH05] = {
817 + .name = "ch5",
818 + .cmds_start = 0x0,
819 + .ctrl_start = 0x0,
820 + .cdt = 0x0,
821 + .fifo_start = 0x0,
822 + .fifo_size = 0x0,
823 + .ptr1_reg = DMA5_PTR1,
824 + .ptr2_reg = DMA5_PTR2,
825 + .cnt1_reg = DMA5_CNT1,
826 + .cnt2_reg = DMA5_CNT2,
827 + },
828 + [SRAM_CH06] = {
829 + .name = "TS2 C",
830 + .cmds_start = 0x10140,
831 + .ctrl_start = 0x10440,
832 + .cdt = 0x105e0,
833 + .fifo_start = 0x6000,
834 + .fifo_size = 0x1000,
835 + .ptr1_reg = DMA5_PTR1,
836 + .ptr2_reg = DMA5_PTR2,
837 + .cnt1_reg = DMA5_CNT1,
838 + .cnt2_reg = DMA5_CNT2,
839 + },
840 + [SRAM_CH07] = {
841 + .name = "ch7",
842 + .cmds_start = 0x0,
843 + .ctrl_start = 0x0,
844 + .cdt = 0x0,
845 + .fifo_start = 0x0,
846 + .fifo_size = 0x0,
847 + .ptr1_reg = DMA6_PTR1,
848 + .ptr2_reg = DMA6_PTR2,
849 + .cnt1_reg = DMA6_CNT1,
850 + .cnt2_reg = DMA6_CNT2,
851 + },
852 + [SRAM_CH08] = {
853 + .name = "ch8",
854 + .cmds_start = 0x0,
855 + .ctrl_start = 0x0,
856 + .cdt = 0x0,
857 + .fifo_start = 0x0,
858 + .fifo_size = 0x0,
859 + .ptr1_reg = DMA7_PTR1,
860 + .ptr2_reg = DMA7_PTR2,
861 + .cnt1_reg = DMA7_CNT1,
862 + .cnt2_reg = DMA7_CNT2,
863 + },
864 + [SRAM_CH09] = {
865 + .name = "ch9",
866 + .cmds_start = 0x0,
867 + .ctrl_start = 0x0,
868 + .cdt = 0x0,
869 + .fifo_start = 0x0,
870 + .fifo_size = 0x0,
871 + .ptr1_reg = DMA8_PTR1,
872 + .ptr2_reg = DMA8_PTR2,
873 + .cnt1_reg = DMA8_CNT1,
874 + .cnt2_reg = DMA8_CNT2,
875 + },
876 +};
877 +
878 static struct sram_channel cx23887_sram_channels[] = {
879 [SRAM_CH01] = {
880 .name = "VID A",
881 @@ -104,8 +215,8 @@ static struct sram_channel cx23887_sram_channels[] = {
882 [SRAM_CH03] = {
883 .name = "TS1 B",
884 .cmds_start = 0x100A0,
885 - .ctrl_start = 0x10780,
886 - .cdt = 0x10400,
887 + .ctrl_start = 0x10630,
888 + .cdt = 0x10870,
889 .fifo_start = 0x5000,
890 .fifo_size = 0x1000,
891 .ptr1_reg = DMA3_PTR1,
892 @@ -140,7 +251,7 @@ static struct sram_channel cx23887_sram_channels[] = {
893 [SRAM_CH06] = {
894 .name = "TS2 C",
895 .cmds_start = 0x10140,
896 - .ctrl_start = 0x10680,
897 + .ctrl_start = 0x10670,
898 .cdt = 0x108d0,
899 .fifo_start = 0x6000,
900 .fifo_size = 0x1000,
901 @@ -460,6 +571,7 @@ static void cx23885_reset(struct cx23885_dev *dev)
902 cx_write(AUDIO_INT_INT_STAT, 0xffffffff);
903 cx_write(AUDIO_EXT_INT_STAT, 0xffffffff);
904 cx_write(CLK_DELAY, cx_read(CLK_DELAY) & 0x80000000);
905 + cx_write(PAD_CTRL, 0x00500300);
906
907 mdelay(100);
908
909 @@ -625,7 +737,6 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
910 atomic_inc(&dev->refcount);
911
912 dev->nr = cx23885_devcount++;
913 - dev->sram_channels = cx23887_sram_channels;
914 sprintf(dev->name, "cx23885[%d]", dev->nr);
915
916 mutex_lock(&devlist);
917 @@ -637,11 +748,13 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
918 dev->bridge = CX23885_BRIDGE_887;
919 /* Apply a sensible clock frequency for the PCIe bridge */
920 dev->clk_freq = 25000000;
921 + dev->sram_channels = cx23887_sram_channels;
922 } else
923 if(dev->pci->device == 0x8852) {
924 dev->bridge = CX23885_BRIDGE_885;
925 /* Apply a sensible clock frequency for the PCIe bridge */
926 dev->clk_freq = 28000000;
927 + dev->sram_channels = cx23885_sram_channels;
928 } else
929 BUG();
930
931 @@ -1042,6 +1155,9 @@ static int cx23885_start_dma(struct cx23885_tsport *port,
932 dprintk(1, "%s() w: %d, h: %d, f: %d\n", __func__,
933 buf->vb.width, buf->vb.height, buf->vb.field);
934
935 + /* Stop the fifo and risc engine for this port */
936 + cx_clear(port->reg_dma_ctl, port->dma_ctl_val);
937 +
938 /* setup fifo + format */
939 cx23885_sram_channel_setup(dev,
940 &dev->sram_channels[ port->sram_chno ],
941 @@ -1083,7 +1199,21 @@ static int cx23885_start_dma(struct cx23885_tsport *port,
942 cx_write(port->reg_gpcnt_ctl, 3);
943 q->count = 1;
944
945 - if (cx23885_boards[dev->board].portb & CX23885_MPEG_ENCODER) {
946 + /* Set VIDB pins to input */
947 + if (cx23885_boards[dev->board].portb == CX23885_MPEG_DVB) {
948 + reg = cx_read(PAD_CTRL);
949 + reg &= ~0x3; /* Clear TS1_OE & TS1_SOP_OE */
950 + cx_write(PAD_CTRL, reg);
951 + }
952 +
953 + /* Set VIDC pins to input */
954 + if (cx23885_boards[dev->board].portc == CX23885_MPEG_DVB) {
955 + reg = cx_read(PAD_CTRL);
956 + reg &= ~0x4; /* Clear TS2_SOP_OE */
957 + cx_write(PAD_CTRL, reg);
958 + }
959 +
960 + if (cx23885_boards[dev->board].portb == CX23885_MPEG_ENCODER) {
961
962 reg = cx_read(PAD_CTRL);
963 reg = reg & ~0x1; /* Clear TS1_OE */
964 @@ -1133,7 +1263,7 @@ static int cx23885_stop_dma(struct cx23885_tsport *port)
965 cx_clear(port->reg_ts_int_msk, port->ts_int_msk_val);
966 cx_clear(port->reg_dma_ctl, port->dma_ctl_val);
967
968 - if (cx23885_boards[dev->board].portb & CX23885_MPEG_ENCODER) {
969 + if (cx23885_boards[dev->board].portb == CX23885_MPEG_ENCODER) {
970
971 reg = cx_read(PAD_CTRL);
972
973 diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
974 index 2618cfa..0227cf9 100644
975 --- a/drivers/media/video/saa7134/saa7134-cards.c
976 +++ b/drivers/media/video/saa7134/saa7134-cards.c
977 @@ -5703,9 +5703,6 @@ int saa7134_board_init2(struct saa7134_dev *dev)
978 unsigned char buf;
979 int board;
980
981 - dev->tuner_type = saa7134_boards[dev->board].tuner_type;
982 - dev->tuner_addr = saa7134_boards[dev->board].tuner_addr;
983 -
984 switch (dev->board) {
985 case SAA7134_BOARD_BMK_MPEX_NOTUNER:
986 case SAA7134_BOARD_BMK_MPEX_TUNER:
987 diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
988 index 2c19cd0..69f340d 100644
989 --- a/drivers/media/video/saa7134/saa7134-core.c
990 +++ b/drivers/media/video/saa7134/saa7134-core.c
991 @@ -946,11 +946,12 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
992 dev->board = SAA7134_BOARD_UNKNOWN;
993 }
994 dev->autodetected = card[dev->nr] != dev->board;
995 - dev->tuner_type = saa7134_boards[dev->board].tuner_type;
996 + dev->tuner_type = saa7134_boards[dev->board].tuner_type;
997 + dev->tuner_addr = saa7134_boards[dev->board].tuner_addr;
998 dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf;
999 if (UNSET != tuner[dev->nr])
1000 dev->tuner_type = tuner[dev->nr];
1001 - printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
1002 + printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
1003 dev->name,pci_dev->subsystem_vendor,
1004 pci_dev->subsystem_device,saa7134_boards[dev->board].name,
1005 dev->board, dev->autodetected ?
1006 diff --git a/drivers/media/video/uvc/Kconfig b/drivers/media/video/uvc/Kconfig
1007 new file mode 100644
1008 index 0000000..c2d9760
1009 --- /dev/null
1010 +++ b/drivers/media/video/uvc/Kconfig
1011 @@ -0,0 +1,17 @@
1012 +config USB_VIDEO_CLASS
1013 + tristate "USB Video Class (UVC)"
1014 + ---help---
1015 + Support for the USB Video Class (UVC). Currently only video
1016 + input devices, such as webcams, are supported.
1017 +
1018 + For more information see: <http://linux-uvc.berlios.de/>
1019 +
1020 +config USB_VIDEO_CLASS_INPUT_EVDEV
1021 + bool "UVC input events device support"
1022 + default y
1023 + depends on USB_VIDEO_CLASS && INPUT
1024 + ---help---
1025 + This option makes USB Video Class devices register an input device
1026 + to report button events.
1027 +
1028 + If you are in doubt, say Y.
1029 diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c
1030 index 60ced58..9d954d2 100644
1031 --- a/drivers/media/video/uvc/uvc_driver.c
1032 +++ b/drivers/media/video/uvc/uvc_driver.c
1033 @@ -298,7 +298,8 @@ static int uvc_parse_format(struct uvc_device *dev,
1034 switch (buffer[2]) {
1035 case VS_FORMAT_UNCOMPRESSED:
1036 case VS_FORMAT_FRAME_BASED:
1037 - if (buflen < 27) {
1038 + n = buffer[2] == VS_FORMAT_UNCOMPRESSED ? 27 : 28;
1039 + if (buflen < n) {
1040 uvc_trace(UVC_TRACE_DESCR, "device %d videostreaming"
1041 "interface %d FORMAT error\n",
1042 dev->udev->devnum,
1043 @@ -1891,6 +1892,15 @@ static struct usb_device_id uvc_ids[] = {
1044 .bInterfaceSubClass = 1,
1045 .bInterfaceProtocol = 0,
1046 .driver_info = UVC_QUIRK_PROBE_MINMAX },
1047 + /* Medion Akoya Mini E1210 */
1048 + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
1049 + | USB_DEVICE_ID_MATCH_INT_INFO,
1050 + .idVendor = 0x5986,
1051 + .idProduct = 0x0141,
1052 + .bInterfaceClass = USB_CLASS_VIDEO,
1053 + .bInterfaceSubClass = 1,
1054 + .bInterfaceProtocol = 0,
1055 + .driver_info = UVC_QUIRK_PROBE_MINMAX },
1056 /* Acer OrbiCam - Unknown vendor */
1057 { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
1058 | USB_DEVICE_ID_MATCH_INT_INFO,
1059 diff --git a/drivers/media/video/uvc/uvc_status.c b/drivers/media/video/uvc/uvc_status.c
1060 index be9084e..eb2f970 100644
1061 --- a/drivers/media/video/uvc/uvc_status.c
1062 +++ b/drivers/media/video/uvc/uvc_status.c
1063 @@ -22,6 +22,7 @@
1064 /* --------------------------------------------------------------------------
1065 * Input device
1066 */
1067 +#ifdef CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV
1068 static int uvc_input_init(struct uvc_device *dev)
1069 {
1070 struct usb_device *udev = dev->udev;
1071 @@ -67,6 +68,19 @@ static void uvc_input_cleanup(struct uvc_device *dev)
1072 input_unregister_device(dev->input);
1073 }
1074
1075 +static void uvc_input_report_key(struct uvc_device *dev, unsigned int code,
1076 + int value)
1077 +{
1078 + if (dev->input)
1079 + input_report_key(dev->input, code, value);
1080 +}
1081 +
1082 +#else
1083 +#define uvc_input_init(dev)
1084 +#define uvc_input_cleanup(dev)
1085 +#define uvc_input_report_key(dev, code, value)
1086 +#endif /* CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV */
1087 +
1088 /* --------------------------------------------------------------------------
1089 * Status interrupt endpoint
1090 */
1091 @@ -83,8 +97,7 @@ static void uvc_event_streaming(struct uvc_device *dev, __u8 *data, int len)
1092 return;
1093 uvc_trace(UVC_TRACE_STATUS, "Button (intf %u) %s len %d\n",
1094 data[1], data[3] ? "pressed" : "released", len);
1095 - if (dev->input)
1096 - input_report_key(dev->input, BTN_0, data[3]);
1097 + uvc_input_report_key(dev, BTN_0, data[3]);
1098 } else {
1099 uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x "
1100 "len %d.\n", data[1], data[2], data[3], len);
1101 @@ -203,5 +216,5 @@ int uvc_status_resume(struct uvc_device *dev)
1102 if (dev->int_urb == NULL)
1103 return 0;
1104
1105 - return usb_submit_urb(dev->int_urb, GFP_KERNEL);
1106 + return usb_submit_urb(dev->int_urb, GFP_NOIO);
1107 }
1108 diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
1109 index 6faf1fb..817af2e 100644
1110 --- a/drivers/media/video/uvc/uvc_video.c
1111 +++ b/drivers/media/video/uvc/uvc_video.c
1112 @@ -554,9 +554,56 @@ static void uvc_video_complete(struct urb *urb)
1113 }
1114
1115 /*
1116 + * Free transfer buffers.
1117 + */
1118 +static void uvc_free_urb_buffers(struct uvc_video_device *video)
1119 +{
1120 + unsigned int i;
1121 +
1122 + for (i = 0; i < UVC_URBS; ++i) {
1123 + if (video->urb_buffer[i]) {
1124 + usb_buffer_free(video->dev->udev, video->urb_size,
1125 + video->urb_buffer[i], video->urb_dma[i]);
1126 + video->urb_buffer[i] = NULL;
1127 + }
1128 + }
1129 +
1130 + video->urb_size = 0;
1131 +}
1132 +
1133 +/*
1134 + * Allocate transfer buffers. This function can be called with buffers
1135 + * already allocated when resuming from suspend, in which case it will
1136 + * return without touching the buffers.
1137 + *
1138 + * Return 0 on success or -ENOMEM when out of memory.
1139 + */
1140 +static int uvc_alloc_urb_buffers(struct uvc_video_device *video,
1141 + unsigned int size)
1142 +{
1143 + unsigned int i;
1144 +
1145 + /* Buffers are already allocated, bail out. */
1146 + if (video->urb_size)
1147 + return 0;
1148 +
1149 + for (i = 0; i < UVC_URBS; ++i) {
1150 + video->urb_buffer[i] = usb_buffer_alloc(video->dev->udev,
1151 + size, GFP_KERNEL, &video->urb_dma[i]);
1152 + if (video->urb_buffer[i] == NULL) {
1153 + uvc_free_urb_buffers(video);
1154 + return -ENOMEM;
1155 + }
1156 + }
1157 +
1158 + video->urb_size = size;
1159 + return 0;
1160 +}
1161 +
1162 +/*
1163 * Uninitialize isochronous/bulk URBs and free transfer buffers.
1164 */
1165 -static void uvc_uninit_video(struct uvc_video_device *video)
1166 +static void uvc_uninit_video(struct uvc_video_device *video, int free_buffers)
1167 {
1168 struct urb *urb;
1169 unsigned int i;
1170 @@ -566,19 +613,12 @@ static void uvc_uninit_video(struct uvc_video_device *video)
1171 continue;
1172
1173 usb_kill_urb(urb);
1174 - /* urb->transfer_buffer_length is not touched by USB core, so
1175 - * we can use it here as the buffer length.
1176 - */
1177 - if (video->urb_buffer[i]) {
1178 - usb_buffer_free(video->dev->udev,
1179 - urb->transfer_buffer_length,
1180 - video->urb_buffer[i], urb->transfer_dma);
1181 - video->urb_buffer[i] = NULL;
1182 - }
1183 -
1184 usb_free_urb(urb);
1185 video->urb[i] = NULL;
1186 }
1187 +
1188 + if (free_buffers)
1189 + uvc_free_urb_buffers(video);
1190 }
1191
1192 /*
1193 @@ -586,7 +626,7 @@ static void uvc_uninit_video(struct uvc_video_device *video)
1194 * is given by the endpoint.
1195 */
1196 static int uvc_init_video_isoc(struct uvc_video_device *video,
1197 - struct usb_host_endpoint *ep)
1198 + struct usb_host_endpoint *ep, gfp_t gfp_flags)
1199 {
1200 struct urb *urb;
1201 unsigned int npackets, i, j;
1202 @@ -610,18 +650,13 @@ static int uvc_init_video_isoc(struct uvc_video_device *video,
1203
1204 size = npackets * psize;
1205
1206 + if (uvc_alloc_urb_buffers(video, size) < 0)
1207 + return -ENOMEM;
1208 +
1209 for (i = 0; i < UVC_URBS; ++i) {
1210 - urb = usb_alloc_urb(npackets, GFP_KERNEL);
1211 + urb = usb_alloc_urb(npackets, gfp_flags);
1212 if (urb == NULL) {
1213 - uvc_uninit_video(video);
1214 - return -ENOMEM;
1215 - }
1216 -
1217 - video->urb_buffer[i] = usb_buffer_alloc(video->dev->udev,
1218 - size, GFP_KERNEL, &urb->transfer_dma);
1219 - if (video->urb_buffer[i] == NULL) {
1220 - usb_free_urb(urb);
1221 - uvc_uninit_video(video);
1222 + uvc_uninit_video(video, 1);
1223 return -ENOMEM;
1224 }
1225
1226 @@ -632,6 +667,7 @@ static int uvc_init_video_isoc(struct uvc_video_device *video,
1227 urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP;
1228 urb->interval = ep->desc.bInterval;
1229 urb->transfer_buffer = video->urb_buffer[i];
1230 + urb->transfer_dma = video->urb_dma[i];
1231 urb->complete = uvc_video_complete;
1232 urb->number_of_packets = npackets;
1233 urb->transfer_buffer_length = size;
1234 @@ -652,7 +688,7 @@ static int uvc_init_video_isoc(struct uvc_video_device *video,
1235 * given by the endpoint.
1236 */
1237 static int uvc_init_video_bulk(struct uvc_video_device *video,
1238 - struct usb_host_endpoint *ep)
1239 + struct usb_host_endpoint *ep, gfp_t gfp_flags)
1240 {
1241 struct urb *urb;
1242 unsigned int pipe, i;
1243 @@ -671,20 +707,15 @@ static int uvc_init_video_bulk(struct uvc_video_device *video,
1244 if (size > psize * UVC_MAX_ISO_PACKETS)
1245 size = psize * UVC_MAX_ISO_PACKETS;
1246
1247 + if (uvc_alloc_urb_buffers(video, size) < 0)
1248 + return -ENOMEM;
1249 +
1250 pipe = usb_rcvbulkpipe(video->dev->udev, ep->desc.bEndpointAddress);
1251
1252 for (i = 0; i < UVC_URBS; ++i) {
1253 - urb = usb_alloc_urb(0, GFP_KERNEL);
1254 + urb = usb_alloc_urb(0, gfp_flags);
1255 if (urb == NULL) {
1256 - uvc_uninit_video(video);
1257 - return -ENOMEM;
1258 - }
1259 -
1260 - video->urb_buffer[i] = usb_buffer_alloc(video->dev->udev,
1261 - size, GFP_KERNEL, &urb->transfer_dma);
1262 - if (video->urb_buffer[i] == NULL) {
1263 - usb_free_urb(urb);
1264 - uvc_uninit_video(video);
1265 + uvc_uninit_video(video, 1);
1266 return -ENOMEM;
1267 }
1268
1269 @@ -692,6 +723,7 @@ static int uvc_init_video_bulk(struct uvc_video_device *video,
1270 video->urb_buffer[i], size, uvc_video_complete,
1271 video);
1272 urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
1273 + urb->transfer_dma = video->urb_dma[i];
1274
1275 video->urb[i] = urb;
1276 }
1277 @@ -702,7 +734,7 @@ static int uvc_init_video_bulk(struct uvc_video_device *video,
1278 /*
1279 * Initialize isochronous/bulk URBs and allocate transfer buffers.
1280 */
1281 -static int uvc_init_video(struct uvc_video_device *video)
1282 +static int uvc_init_video(struct uvc_video_device *video, gfp_t gfp_flags)
1283 {
1284 struct usb_interface *intf = video->streaming->intf;
1285 struct usb_host_interface *alts;
1286 @@ -747,7 +779,7 @@ static int uvc_init_video(struct uvc_video_device *video)
1287 if ((ret = usb_set_interface(video->dev->udev, intfnum, i)) < 0)
1288 return ret;
1289
1290 - ret = uvc_init_video_isoc(video, ep);
1291 + ret = uvc_init_video_isoc(video, ep, gfp_flags);
1292 } else {
1293 /* Bulk endpoint, proceed to URB initialization. */
1294 ep = uvc_find_endpoint(&intf->altsetting[0],
1295 @@ -755,7 +787,7 @@ static int uvc_init_video(struct uvc_video_device *video)
1296 if (ep == NULL)
1297 return -EIO;
1298
1299 - ret = uvc_init_video_bulk(video, ep);
1300 + ret = uvc_init_video_bulk(video, ep, gfp_flags);
1301 }
1302
1303 if (ret < 0)
1304 @@ -763,10 +795,10 @@ static int uvc_init_video(struct uvc_video_device *video)
1305
1306 /* Submit the URBs. */
1307 for (i = 0; i < UVC_URBS; ++i) {
1308 - if ((ret = usb_submit_urb(video->urb[i], GFP_KERNEL)) < 0) {
1309 + if ((ret = usb_submit_urb(video->urb[i], gfp_flags)) < 0) {
1310 uvc_printk(KERN_ERR, "Failed to submit URB %u "
1311 "(%d).\n", i, ret);
1312 - uvc_uninit_video(video);
1313 + uvc_uninit_video(video, 1);
1314 return ret;
1315 }
1316 }
1317 @@ -791,7 +823,7 @@ int uvc_video_suspend(struct uvc_video_device *video)
1318 return 0;
1319
1320 video->frozen = 1;
1321 - uvc_uninit_video(video);
1322 + uvc_uninit_video(video, 0);
1323 usb_set_interface(video->dev->udev, video->streaming->intfnum, 0);
1324 return 0;
1325 }
1326 @@ -818,7 +850,7 @@ int uvc_video_resume(struct uvc_video_device *video)
1327 if (!uvc_queue_streaming(&video->queue))
1328 return 0;
1329
1330 - if ((ret = uvc_init_video(video)) < 0)
1331 + if ((ret = uvc_init_video(video, GFP_NOIO)) < 0)
1332 uvc_queue_enable(&video->queue, 0);
1333
1334 return ret;
1335 @@ -920,7 +952,7 @@ int uvc_video_enable(struct uvc_video_device *video, int enable)
1336 int ret;
1337
1338 if (!enable) {
1339 - uvc_uninit_video(video);
1340 + uvc_uninit_video(video, 1);
1341 usb_set_interface(video->dev->udev,
1342 video->streaming->intfnum, 0);
1343 uvc_queue_enable(&video->queue, 0);
1344 @@ -930,5 +962,5 @@ int uvc_video_enable(struct uvc_video_device *video, int enable)
1345 if ((ret = uvc_queue_enable(&video->queue, 1)) < 0)
1346 return ret;
1347
1348 - return uvc_init_video(video);
1349 + return uvc_init_video(video, GFP_KERNEL);
1350 }
1351 diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
1352 index a995a78..2444b8a 100644
1353 --- a/drivers/media/video/uvc/uvcvideo.h
1354 +++ b/drivers/media/video/uvc/uvcvideo.h
1355 @@ -602,6 +602,8 @@ struct uvc_video_device {
1356
1357 struct urb *urb[UVC_URBS];
1358 char *urb_buffer[UVC_URBS];
1359 + dma_addr_t urb_dma[UVC_URBS];
1360 + unsigned int urb_size;
1361
1362 __u8 last_fid;
1363 };
1364 diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
1365 index d89475d..5c35e63 100644
1366 --- a/drivers/mmc/host/pxamci.c
1367 +++ b/drivers/mmc/host/pxamci.c
1368 @@ -177,7 +177,7 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
1369 if (dalgn)
1370 DALGN |= (1 << host->dma);
1371 else
1372 - DALGN &= (1 << host->dma);
1373 + DALGN &= ~(1 << host->dma);
1374 DDADR(host->dma) = host->sg_dma;
1375 DCSR(host->dma) = DCSR_RUN;
1376 }
1377 diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
1378 index ae9629f..c258a05 100644
1379 --- a/drivers/net/hamradio/hdlcdrv.c
1380 +++ b/drivers/net/hamradio/hdlcdrv.c
1381 @@ -88,6 +88,7 @@
1382 static inline void append_crc_ccitt(unsigned char *buffer, int len)
1383 {
1384 unsigned int crc = crc_ccitt(0xffff, buffer, len) ^ 0xffff;
1385 + buffer += len;
1386 *buffer++ = crc;
1387 *buffer++ = crc >> 8;
1388 }
1389 diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
1390 index 8f04609..e248f80 100644
1391 --- a/drivers/net/ixgbe/ixgbe_main.c
1392 +++ b/drivers/net/ixgbe/ixgbe_main.c
1393 @@ -70,8 +70,6 @@ static struct pci_device_id ixgbe_pci_tbl[] = {
1394 board_82598 },
1395 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_SINGLE_PORT),
1396 board_82598 },
1397 - {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AT_DUAL_PORT),
1398 - board_82598 },
1399 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_CX4),
1400 board_82598 },
1401
1402 diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
1403 index e0d76c7..9e28d91 100644
1404 --- a/drivers/net/myri10ge/myri10ge.c
1405 +++ b/drivers/net/myri10ge/myri10ge.c
1406 @@ -3126,6 +3126,8 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1407
1408 mgp = netdev_priv(netdev);
1409 mgp->dev = netdev;
1410 + mgp->ss.mgp = mgp;
1411 + mgp->ss.dev = mgp->dev;
1412 netif_napi_add(netdev, &mgp->ss.napi, myri10ge_poll, myri10ge_napi_weight);
1413 mgp->pdev = pdev;
1414 mgp->csum_flag = MXGEFW_FLAGS_CKSUM;
1415 @@ -3213,26 +3215,26 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1416 for (i = 0; i < ETH_ALEN; i++)
1417 netdev->dev_addr[i] = mgp->mac_addr[i];
1418
1419 - /* allocate rx done ring */
1420 - bytes = mgp->max_intr_slots * sizeof(*mgp->ss.rx_done.entry);
1421 - mgp->ss.rx_done.entry = dma_alloc_coherent(&pdev->dev, bytes,
1422 - &mgp->ss.rx_done.bus, GFP_KERNEL);
1423 - if (mgp->ss.rx_done.entry == NULL)
1424 - goto abort_with_ioremap;
1425 - memset(mgp->ss.rx_done.entry, 0, bytes);
1426 -
1427 myri10ge_select_firmware(mgp);
1428
1429 status = myri10ge_load_firmware(mgp);
1430 if (status != 0) {
1431 dev_err(&pdev->dev, "failed to load firmware\n");
1432 - goto abort_with_rx_done;
1433 + goto abort_with_ioremap;
1434 }
1435
1436 + /* allocate rx done ring */
1437 + bytes = mgp->max_intr_slots * sizeof(*mgp->ss.rx_done.entry);
1438 + mgp->ss.rx_done.entry = dma_alloc_coherent(&pdev->dev, bytes,
1439 + &mgp->ss.rx_done.bus, GFP_KERNEL);
1440 + if (mgp->ss.rx_done.entry == NULL)
1441 + goto abort_with_firmware;
1442 + memset(mgp->ss.rx_done.entry, 0, bytes);
1443 +
1444 status = myri10ge_reset(mgp);
1445 if (status != 0) {
1446 dev_err(&pdev->dev, "failed reset\n");
1447 - goto abort_with_firmware;
1448 + goto abort_with_rx_done;
1449 }
1450
1451 pci_set_drvdata(pdev, mgp);
1452 @@ -3258,7 +3260,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1453 * is set to correct value if MSI is enabled */
1454 status = myri10ge_request_irq(mgp);
1455 if (status != 0)
1456 - goto abort_with_firmware;
1457 + goto abort_with_rx_done;
1458 netdev->irq = pdev->irq;
1459 myri10ge_free_irq(mgp);
1460
1461 @@ -3287,14 +3289,14 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1462 abort_with_state:
1463 pci_restore_state(pdev);
1464
1465 -abort_with_firmware:
1466 - myri10ge_dummy_rdma(mgp, 0);
1467 -
1468 abort_with_rx_done:
1469 bytes = mgp->max_intr_slots * sizeof(*mgp->ss.rx_done.entry);
1470 dma_free_coherent(&pdev->dev, bytes,
1471 mgp->ss.rx_done.entry, mgp->ss.rx_done.bus);
1472
1473 +abort_with_firmware:
1474 + myri10ge_dummy_rdma(mgp, 0);
1475 +
1476 abort_with_ioremap:
1477 iounmap(mgp->sram);
1478
1479 diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
1480 index 635b9ac..e57905c 100644
1481 --- a/drivers/net/wireless/ath5k/base.c
1482 +++ b/drivers/net/wireless/ath5k/base.c
1483 @@ -487,9 +487,6 @@ ath5k_pci_probe(struct pci_dev *pdev,
1484 /* Set private data */
1485 pci_set_drvdata(pdev, hw);
1486
1487 - /* Enable msi for devices that support it */
1488 - pci_enable_msi(pdev);
1489 -
1490 /* Setup interrupt handler */
1491 ret = request_irq(pdev->irq, ath5k_intr, IRQF_SHARED, "ath", sc);
1492 if (ret) {
1493 @@ -567,7 +564,6 @@ err_ah:
1494 err_irq:
1495 free_irq(pdev->irq, sc);
1496 err_free:
1497 - pci_disable_msi(pdev);
1498 ieee80211_free_hw(hw);
1499 err_map:
1500 pci_iounmap(pdev, mem);
1501 @@ -589,7 +585,6 @@ ath5k_pci_remove(struct pci_dev *pdev)
1502 ath5k_detach(pdev, hw);
1503 ath5k_hw_detach(sc->ah);
1504 free_irq(pdev->irq, sc);
1505 - pci_disable_msi(pdev);
1506 pci_iounmap(pdev, sc->iobase);
1507 pci_release_region(pdev, 0);
1508 pci_disable_device(pdev);
1509 diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
1510 index 3e612d0..9bba3ec 100644
1511 --- a/drivers/net/wireless/b43legacy/main.c
1512 +++ b/drivers/net/wireless/b43legacy/main.c
1513 @@ -3862,10 +3862,10 @@ static int b43legacy_resume(struct ssb_device *dev)
1514 goto out;
1515 }
1516 }
1517 - mutex_unlock(&wl->mutex);
1518
1519 b43legacydbg(wl, "Device resumed.\n");
1520 out:
1521 + mutex_unlock(&wl->mutex);
1522 return err;
1523 }
1524
1525 diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c
1526 index 39e64ab..67c7a01 100644
1527 --- a/drivers/rtc/rtc-at91rm9200.c
1528 +++ b/drivers/rtc/rtc-at91rm9200.c
1529 @@ -175,8 +175,10 @@ static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
1530 | BIN2BCD(tm.tm_mday) << 24
1531 | AT91_RTC_DATEEN | AT91_RTC_MTHEN);
1532
1533 - if (alrm->enabled)
1534 + if (alrm->enabled) {
1535 + at91_sys_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
1536 at91_sys_write(AT91_RTC_IER, AT91_RTC_ALARM);
1537 + }
1538
1539 pr_debug("%s(): %4d-%02d-%02d %02d:%02d:%02d\n", __func__,
1540 at91_alarm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour,
1541 @@ -195,28 +197,22 @@ static int at91_rtc_ioctl(struct device *dev, unsigned int cmd,
1542
1543 pr_debug("%s(): cmd=%08x, arg=%08lx.\n", __func__, cmd, arg);
1544
1545 + /* important: scrub old status before enabling IRQs */
1546 switch (cmd) {
1547 case RTC_AIE_OFF: /* alarm off */
1548 at91_sys_write(AT91_RTC_IDR, AT91_RTC_ALARM);
1549 break;
1550 case RTC_AIE_ON: /* alarm on */
1551 + at91_sys_write(AT91_RTC_SCCR, AT91_RTC_ALARM);
1552 at91_sys_write(AT91_RTC_IER, AT91_RTC_ALARM);
1553 break;
1554 case RTC_UIE_OFF: /* update off */
1555 - case RTC_PIE_OFF: /* periodic off */
1556 at91_sys_write(AT91_RTC_IDR, AT91_RTC_SECEV);
1557 break;
1558 case RTC_UIE_ON: /* update on */
1559 - case RTC_PIE_ON: /* periodic on */
1560 + at91_sys_write(AT91_RTC_SCCR, AT91_RTC_SECEV);
1561 at91_sys_write(AT91_RTC_IER, AT91_RTC_SECEV);
1562 break;
1563 - case RTC_IRQP_READ: /* read periodic alarm frequency */
1564 - ret = put_user(AT91_RTC_FREQ, (unsigned long *) arg);
1565 - break;
1566 - case RTC_IRQP_SET: /* set periodic alarm frequency */
1567 - if (arg != AT91_RTC_FREQ)
1568 - ret = -EINVAL;
1569 - break;
1570 default:
1571 ret = -ENOIOCTLCMD;
1572 break;
1573 diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
1574 index 681d623..d8a1f91 100644
1575 --- a/drivers/spi/mpc52xx_psc_spi.c
1576 +++ b/drivers/spi/mpc52xx_psc_spi.c
1577 @@ -148,7 +148,6 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
1578 unsigned rfalarm;
1579 unsigned send_at_once = MPC52xx_PSC_BUFSIZE;
1580 unsigned recv_at_once;
1581 - unsigned bpw = mps->bits_per_word / 8;
1582
1583 if (!t->tx_buf && !t->rx_buf && t->len)
1584 return -EINVAL;
1585 @@ -164,22 +163,15 @@ static int mpc52xx_psc_spi_transfer_rxtx(struct spi_device *spi,
1586 }
1587
1588 dev_dbg(&spi->dev, "send %d bytes...\n", send_at_once);
1589 - if (tx_buf) {
1590 - for (; send_at_once; sb++, send_at_once--) {
1591 - /* set EOF flag */
1592 - if (mps->bits_per_word
1593 - && (sb + 1) % bpw == 0)
1594 - out_8(&psc->ircr2, 0x01);
1595 + for (; send_at_once; sb++, send_at_once--) {
1596 + /* set EOF flag before the last word is sent */
1597 + if (send_at_once == 1)
1598 + out_8(&psc->ircr2, 0x01);
1599 +
1600 + if (tx_buf)
1601 out_8(&psc->mpc52xx_psc_buffer_8, tx_buf[sb]);
1602 - }
1603 - } else {
1604 - for (; send_at_once; sb++, send_at_once--) {
1605 - /* set EOF flag */
1606 - if (mps->bits_per_word
1607 - && ((sb + 1) % bpw) == 0)
1608 - out_8(&psc->ircr2, 0x01);
1609 + else
1610 out_8(&psc->mpc52xx_psc_buffer_8, 0);
1611 - }
1612 }
1613
1614
1615 diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
1616 index 0cb0d77..db1db4c 100644
1617 --- a/drivers/usb/serial/usb-serial.c
1618 +++ b/drivers/usb/serial/usb-serial.c
1619 @@ -283,7 +283,10 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
1620 }
1621
1622 if (port->open_count == 0) {
1623 - usb_autopm_put_interface(port->serial->interface);
1624 + mutex_lock(&port->serial->disc_mutex);
1625 + if (!port->serial->disconnected)
1626 + usb_autopm_put_interface(port->serial->interface);
1627 + mutex_unlock(&port->serial->disc_mutex);
1628 module_put(port->serial->type->driver.owner);
1629 }
1630
1631 diff --git a/fs/dquot.c b/fs/dquot.c
1632 index 5ac77da..ad88cf6 100644
1633 --- a/fs/dquot.c
1634 +++ b/fs/dquot.c
1635 @@ -562,6 +562,8 @@ static struct shrinker dqcache_shrinker = {
1636 */
1637 static void dqput(struct dquot *dquot)
1638 {
1639 + int ret;
1640 +
1641 if (!dquot)
1642 return;
1643 #ifdef __DQUOT_PARANOIA
1644 @@ -594,7 +596,19 @@ we_slept:
1645 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags) && dquot_dirty(dquot)) {
1646 spin_unlock(&dq_list_lock);
1647 /* Commit dquot before releasing */
1648 - dquot->dq_sb->dq_op->write_dquot(dquot);
1649 + ret = dquot->dq_sb->dq_op->write_dquot(dquot);
1650 + if (ret < 0) {
1651 + printk(KERN_ERR "VFS: cannot write quota structure on "
1652 + "device %s (error %d). Quota may get out of "
1653 + "sync!\n", dquot->dq_sb->s_id, ret);
1654 + /*
1655 + * We clear dirty bit anyway, so that we avoid
1656 + * infinite loop here
1657 + */
1658 + spin_lock(&dq_list_lock);
1659 + clear_dquot_dirty(dquot);
1660 + spin_unlock(&dq_list_lock);
1661 + }
1662 goto we_slept;
1663 }
1664 /* Clear flag in case dquot was inactive (something bad happened) */
1665 diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
1666 index e2832bc..a82e0cb 100644
1667 --- a/fs/ecryptfs/crypto.c
1668 +++ b/fs/ecryptfs/crypto.c
1669 @@ -474,8 +474,8 @@ int ecryptfs_encrypt_page(struct page *page)
1670 {
1671 struct inode *ecryptfs_inode;
1672 struct ecryptfs_crypt_stat *crypt_stat;
1673 - char *enc_extent_virt = NULL;
1674 - struct page *enc_extent_page;
1675 + char *enc_extent_virt;
1676 + struct page *enc_extent_page = NULL;
1677 loff_t extent_offset;
1678 int rc = 0;
1679
1680 @@ -491,14 +491,14 @@ int ecryptfs_encrypt_page(struct page *page)
1681 page->index);
1682 goto out;
1683 }
1684 - enc_extent_virt = kmalloc(PAGE_CACHE_SIZE, GFP_USER);
1685 - if (!enc_extent_virt) {
1686 + enc_extent_page = alloc_page(GFP_USER);
1687 + if (!enc_extent_page) {
1688 rc = -ENOMEM;
1689 ecryptfs_printk(KERN_ERR, "Error allocating memory for "
1690 "encrypted extent\n");
1691 goto out;
1692 }
1693 - enc_extent_page = virt_to_page(enc_extent_virt);
1694 + enc_extent_virt = kmap(enc_extent_page);
1695 for (extent_offset = 0;
1696 extent_offset < (PAGE_CACHE_SIZE / crypt_stat->extent_size);
1697 extent_offset++) {
1698 @@ -526,7 +526,10 @@ int ecryptfs_encrypt_page(struct page *page)
1699 }
1700 }
1701 out:
1702 - kfree(enc_extent_virt);
1703 + if (enc_extent_page) {
1704 + kunmap(enc_extent_page);
1705 + __free_page(enc_extent_page);
1706 + }
1707 return rc;
1708 }
1709
1710 @@ -608,8 +611,8 @@ int ecryptfs_decrypt_page(struct page *page)
1711 {
1712 struct inode *ecryptfs_inode;
1713 struct ecryptfs_crypt_stat *crypt_stat;
1714 - char *enc_extent_virt = NULL;
1715 - struct page *enc_extent_page;
1716 + char *enc_extent_virt;
1717 + struct page *enc_extent_page = NULL;
1718 unsigned long extent_offset;
1719 int rc = 0;
1720
1721 @@ -626,14 +629,14 @@ int ecryptfs_decrypt_page(struct page *page)
1722 page->index);
1723 goto out;
1724 }
1725 - enc_extent_virt = kmalloc(PAGE_CACHE_SIZE, GFP_USER);
1726 - if (!enc_extent_virt) {
1727 + enc_extent_page = alloc_page(GFP_USER);
1728 + if (!enc_extent_page) {
1729 rc = -ENOMEM;
1730 ecryptfs_printk(KERN_ERR, "Error allocating memory for "
1731 "encrypted extent\n");
1732 goto out;
1733 }
1734 - enc_extent_page = virt_to_page(enc_extent_virt);
1735 + enc_extent_virt = kmap(enc_extent_page);
1736 for (extent_offset = 0;
1737 extent_offset < (PAGE_CACHE_SIZE / crypt_stat->extent_size);
1738 extent_offset++) {
1739 @@ -661,7 +664,10 @@ int ecryptfs_decrypt_page(struct page *page)
1740 }
1741 }
1742 out:
1743 - kfree(enc_extent_virt);
1744 + if (enc_extent_page) {
1745 + kunmap(enc_extent_page);
1746 + __free_page(enc_extent_page);
1747 + }
1748 return rc;
1749 }
1750
1751 diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c
1752 index 6bd48f0..c2fb2dd 100644
1753 --- a/fs/isofs/rock.c
1754 +++ b/fs/isofs/rock.c
1755 @@ -209,6 +209,11 @@ repeat:
1756
1757 while (rs.len > 2) { /* There may be one byte for padding somewhere */
1758 rr = (struct rock_ridge *)rs.chr;
1759 + /*
1760 + * Ignore rock ridge info if rr->len is out of range, but
1761 + * don't return -EIO because that would make the file
1762 + * invisible.
1763 + */
1764 if (rr->len < 3)
1765 goto out; /* Something got screwed up here */
1766 sig = isonum_721(rs.chr);
1767 @@ -216,8 +221,12 @@ repeat:
1768 goto eio;
1769 rs.chr += rr->len;
1770 rs.len -= rr->len;
1771 + /*
1772 + * As above, just ignore the rock ridge info if rr->len
1773 + * is bogus.
1774 + */
1775 if (rs.len < 0)
1776 - goto eio; /* corrupted isofs */
1777 + goto out; /* Something got screwed up here */
1778
1779 switch (sig) {
1780 case SIG('R', 'R'):
1781 @@ -307,6 +316,11 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
1782 repeat:
1783 while (rs.len > 2) { /* There may be one byte for padding somewhere */
1784 rr = (struct rock_ridge *)rs.chr;
1785 + /*
1786 + * Ignore rock ridge info if rr->len is out of range, but
1787 + * don't return -EIO because that would make the file
1788 + * invisible.
1789 + */
1790 if (rr->len < 3)
1791 goto out; /* Something got screwed up here */
1792 sig = isonum_721(rs.chr);
1793 @@ -314,8 +328,12 @@ repeat:
1794 goto eio;
1795 rs.chr += rr->len;
1796 rs.len -= rr->len;
1797 + /*
1798 + * As above, just ignore the rock ridge info if rr->len
1799 + * is bogus.
1800 + */
1801 if (rs.len < 0)
1802 - goto eio; /* corrupted isofs */
1803 + goto out; /* Something got screwed up here */
1804
1805 switch (sig) {
1806 #ifndef CONFIG_ZISOFS /* No flag for SF or ZF */
1807 diff --git a/fs/libfs.c b/fs/libfs.c
1808 index baeb71e..1add676 100644
1809 --- a/fs/libfs.c
1810 +++ b/fs/libfs.c
1811 @@ -216,8 +216,8 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
1812
1813 s->s_flags = MS_NOUSER;
1814 s->s_maxbytes = ~0ULL;
1815 - s->s_blocksize = 1024;
1816 - s->s_blocksize_bits = 10;
1817 + s->s_blocksize = PAGE_SIZE;
1818 + s->s_blocksize_bits = PAGE_SHIFT;
1819 s->s_magic = magic;
1820 s->s_op = ops ? ops : &simple_super_operations;
1821 s->s_time_gran = 1;
1822 diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
1823 index c492449..1eaa39a 100644
1824 --- a/fs/proc/task_mmu.c
1825 +++ b/fs/proc/task_mmu.c
1826 @@ -636,7 +636,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
1827 struct pagemapread pm;
1828 int pagecount;
1829 int ret = -ESRCH;
1830 - struct mm_walk pagemap_walk;
1831 + struct mm_walk pagemap_walk = {};
1832 unsigned long src;
1833 unsigned long svpfn;
1834 unsigned long start_vaddr;
1835 diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
1836 index 5c60bfc..9a1db20 100644
1837 --- a/include/asm-arm/bitops.h
1838 +++ b/include/asm-arm/bitops.h
1839 @@ -277,9 +277,16 @@ static inline int constant_fls(int x)
1840 * the clz instruction for much better code efficiency.
1841 */
1842
1843 -#define fls(x) \
1844 +#define __fls(x) \
1845 ( __builtin_constant_p(x) ? constant_fls(x) : \
1846 ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) )
1847 +
1848 +/* Implement fls() in C so that 64-bit args are suitably truncated */
1849 +static inline int fls(int x)
1850 +{
1851 + return __fls(x);
1852 +}
1853 +
1854 #define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })
1855 #define __ffs(x) (ffs(x) - 1)
1856 #define ffz(x) __ffs( ~(x) )
1857 diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
1858 index f054778..5a544bf 100644
1859 --- a/include/asm-generic/vmlinux.lds.h
1860 +++ b/include/asm-generic/vmlinux.lds.h
1861 @@ -204,6 +204,7 @@
1862 * during second ld run in second ld pass when generating System.map */
1863 #define TEXT_TEXT \
1864 ALIGN_FUNCTION(); \
1865 + *(.text.hot) \
1866 *(.text) \
1867 *(.ref.text) \
1868 *(.text.init.refok) \
1869 @@ -213,7 +214,8 @@
1870 CPU_KEEP(init.text) \
1871 CPU_KEEP(exit.text) \
1872 MEM_KEEP(init.text) \
1873 - MEM_KEEP(exit.text)
1874 + MEM_KEEP(exit.text) \
1875 + *(.text.unlikely)
1876
1877
1878 /* sched.text is aling to function alignment to secure we have same
1879 diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
1880 index 3158960..38e7ba6 100644
1881 --- a/include/asm-sparc64/io.h
1882 +++ b/include/asm-sparc64/io.h
1883 @@ -16,7 +16,6 @@
1884 /* BIO layer definitions. */
1885 extern unsigned long kern_base, kern_size;
1886 #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
1887 -#define BIO_VMERGE_BOUNDARY 8192
1888
1889 static inline u8 _inb(unsigned long addr)
1890 {
1891 diff --git a/include/asm-x86/signal.h b/include/asm-x86/signal.h
1892 index f15186d..6dac493 100644
1893 --- a/include/asm-x86/signal.h
1894 +++ b/include/asm-x86/signal.h
1895 @@ -181,12 +181,12 @@ typedef struct sigaltstack {
1896 #ifdef __KERNEL__
1897 #include <asm/sigcontext.h>
1898
1899 -#ifdef __386__
1900 +#ifdef __i386__
1901
1902 #define __HAVE_ARCH_SIG_BITOPS
1903
1904 #define sigaddset(set,sig) \
1905 - (__builtin_constantp(sig) \
1906 + (__builtin_constant_p(sig) \
1907 ? __const_sigaddset((set), (sig)) \
1908 : __gen_sigaddset((set), (sig)))
1909
1910 diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
1911 index e7e91db..07cb761 100644
1912 --- a/include/linux/cpufreq.h
1913 +++ b/include/linux/cpufreq.h
1914 @@ -109,6 +109,7 @@ struct cpufreq_policy {
1915 #define CPUFREQ_ADJUST (0)
1916 #define CPUFREQ_INCOMPATIBLE (1)
1917 #define CPUFREQ_NOTIFY (2)
1918 +#define CPUFREQ_START (3)
1919
1920 #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */
1921 #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */
1922 diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
1923 index cde056e..0bfd97f 100644
1924 --- a/include/linux/ipv6.h
1925 +++ b/include/linux/ipv6.h
1926 @@ -123,6 +123,7 @@ struct ipv6hdr {
1927 struct in6_addr daddr;
1928 };
1929
1930 +#ifdef __KERNEL__
1931 /*
1932 * This structure contains configuration options per IPv6 link.
1933 */
1934 @@ -165,6 +166,7 @@ struct ipv6_devconf {
1935 #endif
1936 void *sysctl;
1937 };
1938 +#endif
1939
1940 /* index values for the variables in ipv6_devconf */
1941 enum {
1942 diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
1943 index de9d1df..d413e89 100644
1944 --- a/include/linux/kvm_host.h
1945 +++ b/include/linux/kvm_host.h
1946 @@ -166,6 +166,7 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
1947 struct kvm_userspace_memory_region *mem,
1948 struct kvm_memory_slot old,
1949 int user_alloc);
1950 +void kvm_arch_flush_shadow(struct kvm *kvm);
1951 gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn);
1952 struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
1953 unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn);
1954 diff --git a/kernel/cpuset.c b/kernel/cpuset.c
1955 index 798b3ab..2a028f5 100644
1956 --- a/kernel/cpuset.c
1957 +++ b/kernel/cpuset.c
1958 @@ -679,7 +679,9 @@ restart:
1959 if (apn == b->pn) {
1960 cpus_or(*dp, *dp, b->cpus_allowed);
1961 b->pn = -1;
1962 - update_domain_attr(dattr, b);
1963 + if (dattr)
1964 + update_domain_attr(dattr
1965 + + nslot, b);
1966 }
1967 }
1968 nslot++;
1969 diff --git a/kernel/marker.c b/kernel/marker.c
1970 index b5a9fe1..39e7596 100644
1971 --- a/kernel/marker.c
1972 +++ b/kernel/marker.c
1973 @@ -127,6 +127,11 @@ void marker_probe_cb(const struct marker *mdata, void *call_private,
1974 struct marker_probe_closure *multi;
1975 int i;
1976 /*
1977 + * Read mdata->ptype before mdata->multi.
1978 + */
1979 + smp_rmb();
1980 + multi = mdata->multi;
1981 + /*
1982 * multi points to an array, therefore accessing the array
1983 * depends on reading multi. However, even in this case,
1984 * we must insure that the pointer is read _before_ the array
1985 @@ -134,7 +139,6 @@ void marker_probe_cb(const struct marker *mdata, void *call_private,
1986 * in the fast path, so put the explicit barrier here.
1987 */
1988 smp_read_barrier_depends();
1989 - multi = mdata->multi;
1990 for (i = 0; multi[i].func; i++) {
1991 va_start(args, fmt);
1992 multi[i].func(multi[i].probe_private, call_private, fmt,
1993 @@ -177,6 +181,11 @@ void marker_probe_cb_noarg(const struct marker *mdata,
1994 struct marker_probe_closure *multi;
1995 int i;
1996 /*
1997 + * Read mdata->ptype before mdata->multi.
1998 + */
1999 + smp_rmb();
2000 + multi = mdata->multi;
2001 + /*
2002 * multi points to an array, therefore accessing the array
2003 * depends on reading multi. However, even in this case,
2004 * we must insure that the pointer is read _before_ the array
2005 @@ -184,7 +193,6 @@ void marker_probe_cb_noarg(const struct marker *mdata,
2006 * in the fast path, so put the explicit barrier here.
2007 */
2008 smp_read_barrier_depends();
2009 - multi = mdata->multi;
2010 for (i = 0; multi[i].func; i++)
2011 multi[i].func(multi[i].probe_private, call_private, fmt,
2012 &args);
2013 diff --git a/kernel/rcupreempt.c b/kernel/rcupreempt.c
2014 index 41d275a..379c25e 100644
2015 --- a/kernel/rcupreempt.c
2016 +++ b/kernel/rcupreempt.c
2017 @@ -567,7 +567,7 @@ rcu_try_flip_waitack_needed(int cpu)
2018 * that this CPU already acknowledged the counter.
2019 */
2020
2021 - if ((curr - snap) > 2 || (snap & 0x1) == 0)
2022 + if ((curr - snap) > 2 || (curr & 0x1) == 0)
2023 return 0;
2024
2025 /* We need this CPU to explicitly acknowledge the counter flip. */
2026 diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
2027 index 5b9b467..0fea0ee 100644
2028 --- a/kernel/sys_ni.c
2029 +++ b/kernel/sys_ni.c
2030 @@ -59,6 +59,7 @@ cond_syscall(sys_epoll_create);
2031 cond_syscall(sys_epoll_ctl);
2032 cond_syscall(sys_epoll_wait);
2033 cond_syscall(sys_epoll_pwait);
2034 +cond_syscall(compat_sys_epoll_pwait);
2035 cond_syscall(sys_semget);
2036 cond_syscall(sys_semop);
2037 cond_syscall(sys_semtimedop);
2038 diff --git a/mm/filemap.c b/mm/filemap.c
2039 index 1e6a7d3..4f32423 100644
2040 --- a/mm/filemap.c
2041 +++ b/mm/filemap.c
2042 @@ -1778,7 +1778,7 @@ void iov_iter_advance(struct iov_iter *i, size_t bytes)
2043 * The !iov->iov_len check ensures we skip over unlikely
2044 * zero-length segments (without overruning the iovec).
2045 */
2046 - while (bytes || unlikely(!iov->iov_len && i->count)) {
2047 + while (bytes || unlikely(i->count && !iov->iov_len)) {
2048 int copy;
2049
2050 copy = min(bytes, iov->iov_len - base);
2051 diff --git a/mm/shmem.c b/mm/shmem.c
2052 index e2a6ae1..8f8412b 100644
2053 --- a/mm/shmem.c
2054 +++ b/mm/shmem.c
2055 @@ -1503,7 +1503,6 @@ shmem_get_inode(struct super_block *sb, int mode, dev_t dev)
2056 inode->i_uid = current->fsuid;
2057 inode->i_gid = current->fsgid;
2058 inode->i_blocks = 0;
2059 - inode->i_mapping->a_ops = &shmem_aops;
2060 inode->i_mapping->backing_dev_info = &shmem_backing_dev_info;
2061 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
2062 inode->i_generation = get_seconds();
2063 @@ -1518,6 +1517,7 @@ shmem_get_inode(struct super_block *sb, int mode, dev_t dev)
2064 init_special_inode(inode, mode, dev);
2065 break;
2066 case S_IFREG:
2067 + inode->i_mapping->a_ops = &shmem_aops;
2068 inode->i_op = &shmem_inode_operations;
2069 inode->i_fop = &shmem_file_operations;
2070 mpol_shared_policy_init(&info->policy,
2071 @@ -1907,6 +1907,7 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
2072 return error;
2073 }
2074 unlock_page(page);
2075 + inode->i_mapping->a_ops = &shmem_aops;
2076 inode->i_op = &shmem_symlink_inode_operations;
2077 kaddr = kmap_atomic(page, KM_USER0);
2078 memcpy(kaddr, symname, len);
2079 diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
2080 index cad73b7..c443a7f 100644
2081 --- a/net/ipv4/tcp_input.c
2082 +++ b/net/ipv4/tcp_input.c
2083 @@ -3273,6 +3273,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
2084 * log. Something worked...
2085 */
2086 sk->sk_err_soft = 0;
2087 + icsk->icsk_probes_out = 0;
2088 tp->rcv_tstamp = tcp_time_stamp;
2089 prior_packets = tp->packets_out;
2090 if (!prior_packets)
2091 @@ -3305,8 +3306,6 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
2092 return 1;
2093
2094 no_queue:
2095 - icsk->icsk_probes_out = 0;
2096 -
2097 /* If this ack opens up a zero window, clear backoff. It was
2098 * being used to time the probes, and is probably far higher than
2099 * it needs to be for normal retransmission.
2100 diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
2101 index 56fcda3..9f3f7ba 100644
2102 --- a/net/ipv4/udp.c
2103 +++ b/net/ipv4/udp.c
2104 @@ -1319,6 +1319,8 @@ int udp_lib_setsockopt(struct sock *sk, int level, int optname,
2105 return -ENOPROTOOPT;
2106 if (val != 0 && val < 8) /* Illegal coverage: use default (8) */
2107 val = 8;
2108 + else if (val > USHORT_MAX)
2109 + val = USHORT_MAX;
2110 up->pcslen = val;
2111 up->pcflag |= UDPLITE_SEND_CC;
2112 break;
2113 @@ -1331,6 +1333,8 @@ int udp_lib_setsockopt(struct sock *sk, int level, int optname,
2114 return -ENOPROTOOPT;
2115 if (val != 0 && val < 8) /* Avoid silly minimal values. */
2116 val = 8;
2117 + else if (val > USHORT_MAX)
2118 + val = USHORT_MAX;
2119 up->pcrlen = val;
2120 up->pcflag |= UDPLITE_RECV_CC;
2121 break;
2122 diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
2123 index 1ee4fa1..918fde4 100644
2124 --- a/net/ipv6/ip6_fib.c
2125 +++ b/net/ipv6/ip6_fib.c
2126 @@ -663,7 +663,7 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt,
2127
2128 static __inline__ void fib6_start_gc(struct net *net, struct rt6_info *rt)
2129 {
2130 - if (net->ipv6.ip6_fib_timer->expires == 0 &&
2131 + if (!timer_pending(net->ipv6.ip6_fib_timer) &&
2132 (rt->rt6i_flags & (RTF_EXPIRES|RTF_CACHE)))
2133 mod_timer(net->ipv6.ip6_fib_timer, jiffies +
2134 net->ipv6.sysctl.ip6_rt_gc_interval);
2135 @@ -671,7 +671,7 @@ static __inline__ void fib6_start_gc(struct net *net, struct rt6_info *rt)
2136
2137 void fib6_force_start_gc(struct net *net)
2138 {
2139 - if (net->ipv6.ip6_fib_timer->expires == 0)
2140 + if (!timer_pending(net->ipv6.ip6_fib_timer))
2141 mod_timer(net->ipv6.ip6_fib_timer, jiffies +
2142 net->ipv6.sysctl.ip6_rt_gc_interval);
2143 }
2144 diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
2145 index 17092d6..9ee9783 100644
2146 --- a/scripts/Makefile.modpost
2147 +++ b/scripts/Makefile.modpost
2148 @@ -101,6 +101,7 @@ quiet_cmd_kernel-mod = MODPOST $@
2149 cmd_kernel-mod = $(modpost) $@
2150
2151 vmlinux.o: FORCE
2152 + @rm -fr $(kernelmarkersfile)
2153 $(call cmd,kernel-mod)
2154
2155 # Declare generated files as targets for modpost
2156 diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
2157 index a07f91a..8f038e6 100644
2158 --- a/scripts/mod/modpost.c
2159 +++ b/scripts/mod/modpost.c
2160 @@ -1992,7 +1992,8 @@ static void read_markers(const char *fname)
2161 mod->skip = 1;
2162 }
2163
2164 - add_marker(mod, marker, fmt);
2165 + if (!mod->skip)
2166 + add_marker(mod, marker, fmt);
2167 }
2168 return;
2169 fail:
2170 diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
2171 index bbcee2c..a69b420 100644
2172 --- a/sound/pci/trident/trident_main.c
2173 +++ b/sound/pci/trident/trident_main.c
2174 @@ -1590,7 +1590,10 @@ static int snd_trident_trigger(struct snd_pcm_substream *substream,
2175 if (spdif_flag) {
2176 if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
2177 outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS));
2178 - outb(trident->spdif_pcm_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
2179 + val = trident->spdif_pcm_ctrl;
2180 + if (!go)
2181 + val &= ~(0x28);
2182 + outb(val, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
2183 } else {
2184 outl(trident->spdif_pcm_bits, TRID_REG(trident, SI_SPDIF_CS));
2185 val = inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) | SPDIF_EN;
2186 diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
2187 index 2d29e26..0262847 100644
2188 --- a/virt/kvm/kvm_main.c
2189 +++ b/virt/kvm/kvm_main.c
2190 @@ -377,6 +377,9 @@ int __kvm_set_memory_region(struct kvm *kvm,
2191 if (mem->slot >= kvm->nmemslots)
2192 kvm->nmemslots = mem->slot + 1;
2193
2194 + if (!npages)
2195 + kvm_arch_flush_shadow(kvm);
2196 +
2197 *memslot = new;
2198
2199 r = kvm_arch_set_memory_region(kvm, mem, old, user_alloc);