/[linux-patches]/genpatches-2.6/tags/2.6.32-47/1025_linux-2.6.32.26.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.32-47/1025_linux-2.6.32.26.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2037 - (show annotations) (download)
Wed Dec 28 14:38:55 2011 UTC (6 years ago) by psomas
File size: 50891 byte(s)
2.6.32-47 release
1 diff --git a/arch/powerpc/kernel/ppc970-pmu.c b/arch/powerpc/kernel/ppc970-pmu.c
2 index 4795744..ec9b95f 100644
3 --- a/arch/powerpc/kernel/ppc970-pmu.c
4 +++ b/arch/powerpc/kernel/ppc970-pmu.c
5 @@ -173,9 +173,11 @@ static int p970_marked_instr_event(u64 event)
6 switch (unit) {
7 case PM_VPU:
8 mask = 0x4c; /* byte 0 bits 2,3,6 */
9 + break;
10 case PM_LSU0:
11 /* byte 2 bits 0,2,3,4,6; all of byte 1 */
12 mask = 0x085dff00;
13 + break;
14 case PM_LSU1L:
15 mask = 0x50 << 24; /* byte 3 bits 4,6 */
16 break;
17 diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
18 index 2cbf0a2..1efb1fa 100644
19 --- a/arch/x86/include/asm/cpufeature.h
20 +++ b/arch/x86/include/asm/cpufeature.h
21 @@ -150,7 +150,7 @@
22 #define X86_FEATURE_3DNOWPREFETCH (6*32+ 8) /* 3DNow prefetch instructions */
23 #define X86_FEATURE_OSVW (6*32+ 9) /* OS Visible Workaround */
24 #define X86_FEATURE_IBS (6*32+10) /* Instruction Based Sampling */
25 -#define X86_FEATURE_SSE5 (6*32+11) /* SSE-5 */
26 +#define X86_FEATURE_XOP (6*32+11) /* extended AVX instructions */
27 #define X86_FEATURE_SKINIT (6*32+12) /* SKINIT/STGI instructions */
28 #define X86_FEATURE_WDT (6*32+13) /* Watchdog timer */
29 #define X86_FEATURE_NODEID_MSR (6*32+19) /* NodeId MSR */
30 diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
31 index 7373932..6a63b86 100644
32 --- a/arch/x86/include/asm/io.h
33 +++ b/arch/x86/include/asm/io.h
34 @@ -172,6 +172,7 @@ static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
35
36 extern void iounmap(volatile void __iomem *addr);
37
38 +extern void set_iounmap_nonlazy(void);
39
40 #ifdef CONFIG_X86_32
41 # include "io_32.h"
42 diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
43 index 9113954..600807b 100644
44 --- a/arch/x86/include/asm/kvm_host.h
45 +++ b/arch/x86/include/asm/kvm_host.h
46 @@ -674,20 +674,6 @@ static inline struct kvm_mmu_page *page_header(hpa_t shadow_page)
47 return (struct kvm_mmu_page *)page_private(page);
48 }
49
50 -static inline u16 kvm_read_fs(void)
51 -{
52 - u16 seg;
53 - asm("mov %%fs, %0" : "=g"(seg));
54 - return seg;
55 -}
56 -
57 -static inline u16 kvm_read_gs(void)
58 -{
59 - u16 seg;
60 - asm("mov %%gs, %0" : "=g"(seg));
61 - return seg;
62 -}
63 -
64 static inline u16 kvm_read_ldt(void)
65 {
66 u16 ldt;
67 @@ -695,16 +681,6 @@ static inline u16 kvm_read_ldt(void)
68 return ldt;
69 }
70
71 -static inline void kvm_load_fs(u16 sel)
72 -{
73 - asm("mov %0, %%fs" : : "rm"(sel));
74 -}
75 -
76 -static inline void kvm_load_gs(u16 sel)
77 -{
78 - asm("mov %0, %%gs" : : "rm"(sel));
79 -}
80 -
81 static inline void kvm_load_ldt(u16 sel)
82 {
83 asm("lldt %0" : : "rm"(sel));
84 diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
85 index 4cfc908..4c2f63c 100644
86 --- a/arch/x86/include/asm/smp.h
87 +++ b/arch/x86/include/asm/smp.h
88 @@ -50,7 +50,7 @@ struct smp_ops {
89 void (*smp_prepare_cpus)(unsigned max_cpus);
90 void (*smp_cpus_done)(unsigned max_cpus);
91
92 - void (*smp_send_stop)(void);
93 + void (*stop_other_cpus)(int wait);
94 void (*smp_send_reschedule)(int cpu);
95
96 int (*cpu_up)(unsigned cpu);
97 @@ -73,7 +73,12 @@ extern struct smp_ops smp_ops;
98
99 static inline void smp_send_stop(void)
100 {
101 - smp_ops.smp_send_stop();
102 + smp_ops.stop_other_cpus(0);
103 +}
104 +
105 +static inline void stop_other_cpus(void)
106 +{
107 + smp_ops.stop_other_cpus(1);
108 }
109
110 static inline void smp_prepare_boot_cpu(void)
111 diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
112 index 420e43e..d850eeb 100644
113 --- a/arch/x86/kernel/apic/io_apic.c
114 +++ b/arch/x86/kernel/apic/io_apic.c
115 @@ -1410,6 +1410,7 @@ int setup_ioapic_entry(int apic_id, int irq,
116 irte.dlvry_mode = apic->irq_delivery_mode;
117 irte.vector = vector;
118 irte.dest_id = IRTE_DEST(destination);
119 + irte.redir_hint = 1;
120
121 /* Set source-id of interrupt request */
122 set_ioapic_sid(&irte, apic_id);
123 @@ -3289,6 +3290,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
124 irte.dlvry_mode = apic->irq_delivery_mode;
125 irte.vector = cfg->vector;
126 irte.dest_id = IRTE_DEST(dest);
127 + irte.redir_hint = 1;
128
129 /* Set source-id of interrupt request */
130 set_msi_sid(&irte, pdev);
131 diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
132 index 73c86db..650c6a5 100644
133 --- a/arch/x86/kernel/cpu/mtrr/cleanup.c
134 +++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
135 @@ -948,7 +948,7 @@ int __init amd_special_default_mtrr(void)
136
137 if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
138 return 0;
139 - if (boot_cpu_data.x86 < 0xf || boot_cpu_data.x86 > 0x11)
140 + if (boot_cpu_data.x86 < 0xf)
141 return 0;
142 /* In case some hypervisor doesn't pass SYSCFG through: */
143 if (rdmsr_safe(MSR_K8_SYSCFG, &l, &h) < 0)
144 diff --git a/arch/x86/kernel/crash_dump_64.c b/arch/x86/kernel/crash_dump_64.c
145 index 045b36c..9948288 100644
146 --- a/arch/x86/kernel/crash_dump_64.c
147 +++ b/arch/x86/kernel/crash_dump_64.c
148 @@ -34,7 +34,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
149 if (!csize)
150 return 0;
151
152 - vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
153 + vaddr = ioremap_cache(pfn << PAGE_SHIFT, PAGE_SIZE);
154 if (!vaddr)
155 return -ENOMEM;
156
157 @@ -46,6 +46,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
158 } else
159 memcpy(buf, vaddr + offset, csize);
160
161 + set_iounmap_nonlazy();
162 iounmap(vaddr);
163 return csize;
164 }
165 diff --git a/arch/x86/kernel/olpc.c b/arch/x86/kernel/olpc.c
166 index 4006c52..38faf72 100644
167 --- a/arch/x86/kernel/olpc.c
168 +++ b/arch/x86/kernel/olpc.c
169 @@ -115,6 +115,7 @@ int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
170 unsigned long flags;
171 int ret = -EIO;
172 int i;
173 + int restarts = 0;
174
175 spin_lock_irqsave(&ec_lock, flags);
176
177 @@ -171,7 +172,9 @@ restart:
178 if (wait_on_obf(0x6c, 1)) {
179 printk(KERN_ERR "olpc-ec: timeout waiting for"
180 " EC to provide data!\n");
181 - goto restart;
182 + if (restarts++ < 10)
183 + goto restart;
184 + goto err;
185 }
186 outbuf[i] = inb(0x68);
187 printk(KERN_DEBUG "olpc-ec: received 0x%x\n",
188 diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
189 index 269c2a3..200fcde 100644
190 --- a/arch/x86/kernel/reboot.c
191 +++ b/arch/x86/kernel/reboot.c
192 @@ -633,7 +633,7 @@ void native_machine_shutdown(void)
193 /* O.K Now that I'm on the appropriate processor,
194 * stop all of the others.
195 */
196 - smp_send_stop();
197 + stop_other_cpus();
198 #endif
199
200 lapic_shutdown();
201 diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
202 index ec1de97..29f0a78 100644
203 --- a/arch/x86/kernel/smp.c
204 +++ b/arch/x86/kernel/smp.c
205 @@ -158,10 +158,10 @@ asmlinkage void smp_reboot_interrupt(void)
206 irq_exit();
207 }
208
209 -static void native_smp_send_stop(void)
210 +static void native_stop_other_cpus(int wait)
211 {
212 unsigned long flags;
213 - unsigned long wait;
214 + unsigned long timeout;
215
216 if (reboot_force)
217 return;
218 @@ -178,9 +178,12 @@ static void native_smp_send_stop(void)
219 if (num_online_cpus() > 1) {
220 apic->send_IPI_allbutself(REBOOT_VECTOR);
221
222 - /* Don't wait longer than a second */
223 - wait = USEC_PER_SEC;
224 - while (num_online_cpus() > 1 && wait--)
225 + /*
226 + * Don't wait longer than a second if the caller
227 + * didn't ask us to wait.
228 + */
229 + timeout = USEC_PER_SEC;
230 + while (num_online_cpus() > 1 && (wait || timeout--))
231 udelay(1);
232 }
233
234 @@ -226,7 +229,7 @@ struct smp_ops smp_ops = {
235 .smp_prepare_cpus = native_smp_prepare_cpus,
236 .smp_cpus_done = native_smp_cpus_done,
237
238 - .smp_send_stop = native_smp_send_stop,
239 + .stop_other_cpus = native_stop_other_cpus,
240 .smp_send_reschedule = native_smp_send_reschedule,
241
242 .cpu_up = native_cpu_up,
243 diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
244 index 8faa821..3bc2707 100644
245 --- a/arch/x86/kvm/paging_tmpl.h
246 +++ b/arch/x86/kvm/paging_tmpl.h
247 @@ -318,8 +318,32 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
248 break;
249 }
250
251 - if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep))
252 - continue;
253 + if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep)) {
254 + struct kvm_mmu_page *child;
255 + unsigned direct_access;
256 +
257 + if (level != gw->level)
258 + continue;
259 +
260 + /*
261 + * For the direct sp, if the guest pte's dirty bit
262 + * changed form clean to dirty, it will corrupt the
263 + * sp's access: allow writable in the read-only sp,
264 + * so we should update the spte at this point to get
265 + * a new sp with the correct access.
266 + */
267 + direct_access = gw->pt_access & gw->pte_access;
268 + if (!is_dirty_gpte(gw->ptes[gw->level - 1]))
269 + direct_access &= ~ACC_WRITE_MASK;
270 +
271 + child = page_header(*sptep & PT64_BASE_ADDR_MASK);
272 + if (child->role.access == direct_access)
273 + continue;
274 +
275 + mmu_page_remove_parent_pte(child, sptep);
276 + __set_spte(sptep, shadow_trap_nonpresent_pte);
277 + kvm_flush_remote_tlbs(vcpu->kvm);
278 + }
279
280 if (is_large_pte(*sptep)) {
281 rmap_remove(vcpu->kvm, sptep);
282 @@ -336,6 +360,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
283 /* advance table_gfn when emulating 1gb pages with 4k */
284 if (delta == 0)
285 table_gfn += PT_INDEX(addr, level);
286 + access &= gw->pte_access;
287 } else {
288 direct = 0;
289 table_gfn = gw->table_gfn[level - 2];
290 diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
291 index 61ba669..253153d 100644
292 --- a/arch/x86/kvm/svm.c
293 +++ b/arch/x86/kvm/svm.c
294 @@ -621,7 +621,6 @@ static void init_vmcb(struct vcpu_svm *svm)
295
296 control->iopm_base_pa = iopm_base;
297 control->msrpm_base_pa = __pa(svm->msrpm);
298 - control->tsc_offset = 0;
299 control->int_ctl = V_INTR_MASKING_MASK;
300
301 init_seg(&save->es);
302 @@ -754,6 +753,7 @@ static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)
303 svm->vmcb_pa = page_to_pfn(page) << PAGE_SHIFT;
304 svm->asid_generation = 0;
305 init_vmcb(svm);
306 + svm->vmcb->control.tsc_offset = 0-native_read_tsc();
307
308 fx_init(&svm->vcpu);
309 svm->vcpu.fpu_active = 1;
310 @@ -795,17 +795,18 @@ static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
311 int i;
312
313 if (unlikely(cpu != vcpu->cpu)) {
314 - u64 tsc_this, delta;
315 -
316 - /*
317 - * Make sure that the guest sees a monotonically
318 - * increasing TSC.
319 - */
320 - rdtscll(tsc_this);
321 - delta = vcpu->arch.host_tsc - tsc_this;
322 - svm->vmcb->control.tsc_offset += delta;
323 - if (is_nested(svm))
324 - svm->nested.hsave->control.tsc_offset += delta;
325 + u64 delta;
326 +
327 + if (check_tsc_unstable()) {
328 + /*
329 + * Make sure that the guest sees a monotonically
330 + * increasing TSC.
331 + */
332 + delta = vcpu->arch.host_tsc - native_read_tsc();
333 + svm->vmcb->control.tsc_offset += delta;
334 + if (is_nested(svm))
335 + svm->nested.hsave->control.tsc_offset += delta;
336 + }
337 vcpu->cpu = cpu;
338 kvm_migrate_timers(vcpu);
339 svm->asid_generation = 0;
340 @@ -2111,7 +2112,7 @@ static int cpuid_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
341 static int iret_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
342 {
343 ++svm->vcpu.stat.nmi_window_exits;
344 - svm->vmcb->control.intercept &= ~(1UL << INTERCEPT_IRET);
345 + svm->vmcb->control.intercept &= ~(1ULL << INTERCEPT_IRET);
346 svm->vcpu.arch.hflags |= HF_IRET_MASK;
347 return 1;
348 }
349 @@ -2506,7 +2507,7 @@ static void svm_inject_nmi(struct kvm_vcpu *vcpu)
350
351 svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_NMI;
352 vcpu->arch.hflags |= HF_NMI_MASK;
353 - svm->vmcb->control.intercept |= (1UL << INTERCEPT_IRET);
354 + svm->vmcb->control.intercept |= (1ULL << INTERCEPT_IRET);
355 ++vcpu->stat.nmi_injections;
356 }
357
358 @@ -2697,8 +2698,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
359 sync_lapic_to_cr8(vcpu);
360
361 save_host_msrs(vcpu);
362 - fs_selector = kvm_read_fs();
363 - gs_selector = kvm_read_gs();
364 + savesegment(fs, fs_selector);
365 + savesegment(gs, gs_selector);
366 ldt_selector = kvm_read_ldt();
367 svm->vmcb->save.cr2 = vcpu->arch.cr2;
368 /* required for live migration with NPT */
369 @@ -2785,10 +2786,15 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
370 vcpu->arch.regs[VCPU_REGS_RSP] = svm->vmcb->save.rsp;
371 vcpu->arch.regs[VCPU_REGS_RIP] = svm->vmcb->save.rip;
372
373 - kvm_load_fs(fs_selector);
374 - kvm_load_gs(gs_selector);
375 - kvm_load_ldt(ldt_selector);
376 load_host_msrs(vcpu);
377 + loadsegment(fs, fs_selector);
378 +#ifdef CONFIG_X86_64
379 + load_gs_index(gs_selector);
380 + wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs);
381 +#else
382 + loadsegment(gs, gs_selector);
383 +#endif
384 + kvm_load_ldt(ldt_selector);
385
386 reload_tss(vcpu);
387
388 diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
389 index 6a28d5d..d00c643 100644
390 --- a/arch/x86/kvm/vmx.c
391 +++ b/arch/x86/kvm/vmx.c
392 @@ -130,6 +130,7 @@ static u64 construct_eptp(unsigned long root_hpa);
393 static DEFINE_PER_CPU(struct vmcs *, vmxarea);
394 static DEFINE_PER_CPU(struct vmcs *, current_vmcs);
395 static DEFINE_PER_CPU(struct list_head, vcpus_on_cpu);
396 +static DEFINE_PER_CPU(struct desc_ptr, host_gdt);
397
398 static unsigned long *vmx_io_bitmap_a;
399 static unsigned long *vmx_io_bitmap_b;
400 @@ -628,7 +629,7 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
401 */
402 vmx->host_state.ldt_sel = kvm_read_ldt();
403 vmx->host_state.gs_ldt_reload_needed = vmx->host_state.ldt_sel;
404 - vmx->host_state.fs_sel = kvm_read_fs();
405 + savesegment(fs, vmx->host_state.fs_sel);
406 if (!(vmx->host_state.fs_sel & 7)) {
407 vmcs_write16(HOST_FS_SELECTOR, vmx->host_state.fs_sel);
408 vmx->host_state.fs_reload_needed = 0;
409 @@ -636,7 +637,7 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
410 vmcs_write16(HOST_FS_SELECTOR, 0);
411 vmx->host_state.fs_reload_needed = 1;
412 }
413 - vmx->host_state.gs_sel = kvm_read_gs();
414 + savesegment(gs, vmx->host_state.gs_sel);
415 if (!(vmx->host_state.gs_sel & 7))
416 vmcs_write16(HOST_GS_SELECTOR, vmx->host_state.gs_sel);
417 else {
418 @@ -664,32 +665,27 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
419
420 static void __vmx_load_host_state(struct vcpu_vmx *vmx)
421 {
422 - unsigned long flags;
423 -
424 if (!vmx->host_state.loaded)
425 return;
426
427 ++vmx->vcpu.stat.host_state_reload;
428 vmx->host_state.loaded = 0;
429 if (vmx->host_state.fs_reload_needed)
430 - kvm_load_fs(vmx->host_state.fs_sel);
431 + loadsegment(fs, vmx->host_state.fs_sel);
432 if (vmx->host_state.gs_ldt_reload_needed) {
433 kvm_load_ldt(vmx->host_state.ldt_sel);
434 - /*
435 - * If we have to reload gs, we must take care to
436 - * preserve our gs base.
437 - */
438 - local_irq_save(flags);
439 - kvm_load_gs(vmx->host_state.gs_sel);
440 #ifdef CONFIG_X86_64
441 - wrmsrl(MSR_GS_BASE, vmcs_readl(HOST_GS_BASE));
442 + load_gs_index(vmx->host_state.gs_sel);
443 + wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs);
444 +#else
445 + loadsegment(gs, vmx->host_state.gs_sel);
446 #endif
447 - local_irq_restore(flags);
448 }
449 reload_tss();
450 save_msrs(vmx->guest_msrs, vmx->save_nmsrs);
451 load_msrs(vmx->host_msrs, vmx->save_nmsrs);
452 reload_host_efer(vmx);
453 + load_gdt(&__get_cpu_var(host_gdt));
454 }
455
456 static void vmx_load_host_state(struct vcpu_vmx *vmx)
457 @@ -1176,6 +1172,8 @@ static void hardware_enable(void *garbage)
458 asm volatile (ASM_VMX_VMXON_RAX
459 : : "a"(&phys_addr), "m"(phys_addr)
460 : "memory", "cc");
461 +
462 + store_gdt(&__get_cpu_var(host_gdt));
463 }
464
465 static void vmclear_local_vcpus(void)
466 @@ -2338,8 +2336,8 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
467 vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */
468 vmcs_write16(HOST_DS_SELECTOR, __KERNEL_DS); /* 22.2.4 */
469 vmcs_write16(HOST_ES_SELECTOR, __KERNEL_DS); /* 22.2.4 */
470 - vmcs_write16(HOST_FS_SELECTOR, kvm_read_fs()); /* 22.2.4 */
471 - vmcs_write16(HOST_GS_SELECTOR, kvm_read_gs()); /* 22.2.4 */
472 + vmcs_write16(HOST_FS_SELECTOR, 0); /* 22.2.4 */
473 + vmcs_write16(HOST_GS_SELECTOR, 0); /* 22.2.4 */
474 vmcs_write16(HOST_SS_SELECTOR, __KERNEL_DS); /* 22.2.4 */
475 #ifdef CONFIG_X86_64
476 rdmsrl(MSR_FS_BASE, a);
477 diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
478 index 281ac63..724a6ad 100644
479 --- a/arch/x86/kvm/x86.c
480 +++ b/arch/x86/kvm/x86.c
481 @@ -1485,7 +1485,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
482 const u32 kvm_supported_word6_x86_features =
483 F(LAHF_LM) | F(CMP_LEGACY) | F(SVM) | 0 /* ExtApicSpace */ |
484 F(CR8_LEGACY) | F(ABM) | F(SSE4A) | F(MISALIGNSSE) |
485 - F(3DNOWPREFETCH) | 0 /* OSVW */ | 0 /* IBS */ | F(SSE5) |
486 + F(3DNOWPREFETCH) | 0 /* OSVW */ | 0 /* IBS */ | F(XOP) |
487 0 /* SKINIT */ | 0 /* WDT */;
488
489 /* all calls to cpuid_count() should be made on the same cpu */
490 diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
491 index 942ccf1..7f8d2b2 100644
492 --- a/arch/x86/xen/enlighten.c
493 +++ b/arch/x86/xen/enlighten.c
494 @@ -998,7 +998,7 @@ static void xen_reboot(int reason)
495 struct sched_shutdown r = { .reason = reason };
496
497 #ifdef CONFIG_SMP
498 - smp_send_stop();
499 + stop_other_cpus();
500 #endif
501
502 if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r))
503 diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
504 index 360f8d8..ca5f56e 100644
505 --- a/arch/x86/xen/smp.c
506 +++ b/arch/x86/xen/smp.c
507 @@ -396,9 +396,9 @@ static void stop_self(void *v)
508 BUG();
509 }
510
511 -static void xen_smp_send_stop(void)
512 +static void xen_stop_other_cpus(int wait)
513 {
514 - smp_call_function(stop_self, NULL, 0);
515 + smp_call_function(stop_self, NULL, wait);
516 }
517
518 static void xen_smp_send_reschedule(int cpu)
519 @@ -466,7 +466,7 @@ static const struct smp_ops xen_smp_ops __initdata = {
520 .cpu_disable = xen_cpu_disable,
521 .play_dead = xen_play_dead,
522
523 - .smp_send_stop = xen_smp_send_stop,
524 + .stop_other_cpus = xen_stop_other_cpus,
525 .smp_send_reschedule = xen_smp_send_reschedule,
526
527 .send_call_func_ipi = xen_smp_send_call_function_ipi,
528 diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
529 index 4895f0e..e3d4eda 100644
530 --- a/drivers/bluetooth/hci_ldisc.c
531 +++ b/drivers/bluetooth/hci_ldisc.c
532 @@ -258,9 +258,16 @@ static int hci_uart_tty_open(struct tty_struct *tty)
533
534 BT_DBG("tty %p", tty);
535
536 + /* FIXME: This btw is bogus, nothing requires the old ldisc to clear
537 + the pointer */
538 if (hu)
539 return -EEXIST;
540
541 + /* Error if the tty has no write op instead of leaving an exploitable
542 + hole */
543 + if (tty->ops->write == NULL)
544 + return -EOPNOTSUPP;
545 +
546 if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) {
547 BT_ERR("Can't allocate control structure");
548 return -ENFILE;
549 diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
550 index caf6e4d..a08c899 100644
551 --- a/drivers/char/pcmcia/synclink_cs.c
552 +++ b/drivers/char/pcmcia/synclink_cs.c
553 @@ -4164,6 +4164,8 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
554 if (cmd != SIOCWANDEV)
555 return hdlc_ioctl(dev, ifr, cmd);
556
557 + memset(&new_line, 0, size);
558 +
559 switch(ifr->ifr_settings.type) {
560 case IF_GET_IFACE: /* return current sync_serial_settings */
561
562 diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
563 index c76677a..f2cee6e 100644
564 --- a/drivers/misc/sgi-xp/xpc_uv.c
565 +++ b/drivers/misc/sgi-xp/xpc_uv.c
566 @@ -409,6 +409,7 @@ xpc_process_activate_IRQ_rcvd_uv(void)
567 static void
568 xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
569 struct xpc_activate_mq_msghdr_uv *msg_hdr,
570 + int part_setup,
571 int *wakeup_hb_checker)
572 {
573 unsigned long irq_flags;
574 @@ -473,6 +474,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
575 case XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREQUEST_UV: {
576 struct xpc_activate_mq_msg_chctl_closerequest_uv *msg;
577
578 + if (!part_setup)
579 + break;
580 +
581 msg = container_of(msg_hdr, struct
582 xpc_activate_mq_msg_chctl_closerequest_uv,
583 hdr);
584 @@ -489,6 +493,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
585 case XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREPLY_UV: {
586 struct xpc_activate_mq_msg_chctl_closereply_uv *msg;
587
588 + if (!part_setup)
589 + break;
590 +
591 msg = container_of(msg_hdr, struct
592 xpc_activate_mq_msg_chctl_closereply_uv,
593 hdr);
594 @@ -503,6 +510,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
595 case XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREQUEST_UV: {
596 struct xpc_activate_mq_msg_chctl_openrequest_uv *msg;
597
598 + if (!part_setup)
599 + break;
600 +
601 msg = container_of(msg_hdr, struct
602 xpc_activate_mq_msg_chctl_openrequest_uv,
603 hdr);
604 @@ -520,6 +530,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
605 case XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREPLY_UV: {
606 struct xpc_activate_mq_msg_chctl_openreply_uv *msg;
607
608 + if (!part_setup)
609 + break;
610 +
611 msg = container_of(msg_hdr, struct
612 xpc_activate_mq_msg_chctl_openreply_uv, hdr);
613 args = &part->remote_openclose_args[msg->ch_number];
614 @@ -537,6 +550,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
615 case XPC_ACTIVATE_MQ_MSG_CHCTL_OPENCOMPLETE_UV: {
616 struct xpc_activate_mq_msg_chctl_opencomplete_uv *msg;
617
618 + if (!part_setup)
619 + break;
620 +
621 msg = container_of(msg_hdr, struct
622 xpc_activate_mq_msg_chctl_opencomplete_uv, hdr);
623 spin_lock_irqsave(&part->chctl_lock, irq_flags);
624 @@ -613,6 +629,7 @@ xpc_handle_activate_IRQ_uv(int irq, void *dev_id)
625
626 part_referenced = xpc_part_ref(part);
627 xpc_handle_activate_mq_msg_uv(part, msg_hdr,
628 + part_referenced,
629 &wakeup_hb_checker);
630 if (part_referenced)
631 xpc_part_deref(part);
632 diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c
633 index 8e3818f..2c31eb4 100644
634 --- a/drivers/net/wireless/p54/eeprom.c
635 +++ b/drivers/net/wireless/p54/eeprom.c
636 @@ -261,8 +261,10 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev)
637 list->max_entries = max_channel_num;
638 list->channels = kzalloc(sizeof(struct p54_channel_entry) *
639 max_channel_num, GFP_KERNEL);
640 - if (!list->channels)
641 + if (!list->channels) {
642 + ret = -ENOMEM;
643 goto free;
644 + }
645
646 for (i = 0; i < max_channel_num; i++) {
647 if (i < priv->iq_autocal_len) {
648 diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
649 index 805284d..ab406c9 100644
650 --- a/drivers/net/wireless/p54/p54usb.c
651 +++ b/drivers/net/wireless/p54/p54usb.c
652 @@ -32,8 +32,17 @@ MODULE_ALIAS("prism54usb");
653 MODULE_FIRMWARE("isl3886usb");
654 MODULE_FIRMWARE("isl3887usb");
655
656 +/*
657 + * Note:
658 + *
659 + * Always update our wiki's device list (located at:
660 + * http://wireless.kernel.org/en/users/Drivers/p54/devices ),
661 + * whenever you add a new device.
662 + */
663 +
664 static struct usb_device_id p54u_table[] __devinitdata = {
665 /* Version 1 devices (pci chip + net2280) */
666 + {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */
667 {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */
668 {USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */
669 {USB_DEVICE(0x07aa, 0x001c)}, /* Corega CG-WLUSB2GT */
670 @@ -45,7 +54,9 @@ static struct usb_device_id p54u_table[] __devinitdata = {
671 {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */
672 {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */
673 {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */
674 + {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */
675 {USB_DEVICE(0x124a, 0x4023)}, /* Shuttle PN15, Airvast WM168g, IOGear GWU513 */
676 + {USB_DEVICE(0x1630, 0x0005)}, /* 2Wire 802.11g USB (v1) / Z-Com */
677 {USB_DEVICE(0x1915, 0x2234)}, /* Linksys WUSB54G OEM */
678 {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */
679 {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */
680 @@ -58,6 +69,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
681 {USB_DEVICE(0x050d, 0x7050)}, /* Belkin F5D7050 ver 1000 */
682 {USB_DEVICE(0x0572, 0x2000)}, /* Cohiba Proto board */
683 {USB_DEVICE(0x0572, 0x2002)}, /* Cohiba Proto board */
684 + {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */
685 {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
686 {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
687 {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
688 @@ -77,6 +89,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
689 {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */
690 {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */
691 {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
692 + {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */
693 {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */
694 {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */
695 {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */
696 @@ -929,8 +942,8 @@ static int __devinit p54u_probe(struct usb_interface *intf,
697 #ifdef CONFIG_PM
698 /* ISL3887 needs a full reset on resume */
699 udev->reset_resume = 1;
700 +#endif /* CONFIG_PM */
701 err = p54u_device_reset(dev);
702 -#endif
703
704 priv->hw_type = P54U_3887;
705 dev->extra_tx_headroom += sizeof(struct lm87_tx_hdr);
706 diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
707 index 9e8fce0..bb96d74 100644
708 --- a/drivers/scsi/gdth.c
709 +++ b/drivers/scsi/gdth.c
710 @@ -4174,6 +4174,14 @@ static int ioc_general(void __user *arg, char *cmnd)
711 ha = gdth_find_ha(gen.ionode);
712 if (!ha)
713 return -EFAULT;
714 +
715 + if (gen.data_len > INT_MAX)
716 + return -EINVAL;
717 + if (gen.sense_len > INT_MAX)
718 + return -EINVAL;
719 + if (gen.data_len + gen.sense_len > INT_MAX)
720 + return -EINVAL;
721 +
722 if (gen.data_len + gen.sense_len != 0) {
723 if (!(buf = gdth_ioctl_alloc(ha, gen.data_len + gen.sense_len,
724 FALSE, &paddr)))
725 diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
726 index 816ab97..0ee989f 100644
727 --- a/drivers/scsi/libsas/sas_ata.c
728 +++ b/drivers/scsi/libsas/sas_ata.c
729 @@ -346,6 +346,7 @@ static int sas_ata_scr_read(struct ata_link *link, unsigned int sc_reg_in,
730 static struct ata_port_operations sas_sata_ops = {
731 .phy_reset = sas_ata_phy_reset,
732 .post_internal_cmd = sas_ata_post_internal,
733 + .qc_defer = ata_std_qc_defer,
734 .qc_prep = ata_noop_qc_prep,
735 .qc_issue = sas_ata_qc_issue,
736 .qc_fill_rtf = sas_ata_qc_fill_rtf,
737 diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
738 index 41d712e..b87fc30 100644
739 --- a/drivers/scsi/scsi_lib.c
740 +++ b/drivers/scsi/scsi_lib.c
741 @@ -2432,7 +2432,8 @@ scsi_internal_device_unblock(struct scsi_device *sdev)
742 sdev->sdev_state = SDEV_RUNNING;
743 else if (sdev->sdev_state == SDEV_CREATED_BLOCK)
744 sdev->sdev_state = SDEV_CREATED;
745 - else
746 + else if (sdev->sdev_state != SDEV_CANCEL &&
747 + sdev->sdev_state != SDEV_OFFLINE)
748 return -EINVAL;
749
750 spin_lock_irqsave(q->queue_lock, flags);
751 diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
752 index 392d8db..ad136c2 100644
753 --- a/drivers/scsi/scsi_sysfs.c
754 +++ b/drivers/scsi/scsi_sysfs.c
755 @@ -954,10 +954,11 @@ static void __scsi_remove_target(struct scsi_target *starget)
756 list_for_each_entry(sdev, &shost->__devices, siblings) {
757 if (sdev->channel != starget->channel ||
758 sdev->id != starget->id ||
759 - sdev->sdev_state == SDEV_DEL)
760 + scsi_device_get(sdev))
761 continue;
762 spin_unlock_irqrestore(shost->host_lock, flags);
763 scsi_remove_device(sdev);
764 + scsi_device_put(sdev);
765 spin_lock_irqsave(shost->host_lock, flags);
766 goto restart;
767 }
768 diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
769 index 7694a95..81a9d25 100644
770 --- a/drivers/scsi/sd.c
771 +++ b/drivers/scsi/sd.c
772 @@ -2049,11 +2049,10 @@ static void sd_probe_async(void *data, async_cookie_t cookie)
773 index = sdkp->index;
774 dev = &sdp->sdev_gendev;
775
776 - if (index < SD_MAX_DISKS) {
777 - gd->major = sd_major((index & 0xf0) >> 4);
778 - gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);
779 - gd->minors = SD_MINORS;
780 - }
781 + gd->major = sd_major((index & 0xf0) >> 4);
782 + gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);
783 + gd->minors = SD_MINORS;
784 +
785 gd->fops = &sd_fops;
786 gd->private_data = &sdkp->driver;
787 gd->queue = sdkp->device->request_queue;
788 @@ -2142,6 +2141,12 @@ static int sd_probe(struct device *dev)
789 if (error)
790 goto out_put;
791
792 + if (index >= SD_MAX_DISKS) {
793 + error = -ENODEV;
794 + sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name space exhausted.\n");
795 + goto out_free_index;
796 + }
797 +
798 error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN);
799 if (error)
800 goto out_free_index;
801 diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c
802 index a2566f1..af3832b 100644
803 --- a/drivers/staging/usbip/usbip_event.c
804 +++ b/drivers/staging/usbip/usbip_event.c
805 @@ -38,21 +38,13 @@ static int event_handler(struct usbip_device *ud)
806 ud->eh_ops.shutdown(ud);
807
808 ud->event &= ~USBIP_EH_SHUTDOWN;
809 -
810 - break;
811 }
812
813 - /* Stop the error handler. */
814 - if (ud->event & USBIP_EH_BYE)
815 - return -1;
816 -
817 /* Reset the device. */
818 if (ud->event & USBIP_EH_RESET) {
819 ud->eh_ops.reset(ud);
820
821 ud->event &= ~USBIP_EH_RESET;
822 -
823 - break;
824 }
825
826 /* Mark the device as unusable. */
827 @@ -60,13 +52,11 @@ static int event_handler(struct usbip_device *ud)
828 ud->eh_ops.unusable(ud);
829
830 ud->event &= ~USBIP_EH_UNUSABLE;
831 -
832 - break;
833 }
834
835 - /* NOTREACHED */
836 - printk(KERN_ERR "%s: unknown event\n", __func__);
837 - return -1;
838 + /* Stop the error handler. */
839 + if (ud->event & USBIP_EH_BYE)
840 + return -1;
841 }
842
843 return 0;
844 diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
845 index 6e91fc2..c201802 100644
846 --- a/drivers/staging/usbip/vhci_hcd.c
847 +++ b/drivers/staging/usbip/vhci_hcd.c
848 @@ -163,6 +163,8 @@ void rh_port_disconnect(int rhport)
849 * spin_unlock(&vdev->ud.lock); */
850
851 spin_unlock_irqrestore(&the_controller->lock, flags);
852 +
853 + usb_hcd_poll_rh_status(vhci_to_hcd(the_controller));
854 }
855
856
857 diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
858 index 7456e29..12254e1 100644
859 --- a/drivers/usb/core/hub.c
860 +++ b/drivers/usb/core/hub.c
861 @@ -2821,13 +2821,16 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
862 else
863 i = udev->descriptor.bMaxPacketSize0;
864 if (le16_to_cpu(udev->ep0.desc.wMaxPacketSize) != i) {
865 - if (udev->speed != USB_SPEED_FULL ||
866 + if (udev->speed == USB_SPEED_LOW ||
867 !(i == 8 || i == 16 || i == 32 || i == 64)) {
868 - dev_err(&udev->dev, "ep0 maxpacket = %d\n", i);
869 + dev_err(&udev->dev, "Invalid ep0 maxpacket: %d\n", i);
870 retval = -EMSGSIZE;
871 goto fail;
872 }
873 - dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
874 + if (udev->speed == USB_SPEED_FULL)
875 + dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
876 + else
877 + dev_warn(&udev->dev, "Using ep0 maxpacket: %d\n", i);
878 udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i);
879 usb_ep0_reinit(udev);
880 }
881 diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
882 index 1ca6545..409cc94 100644
883 --- a/drivers/usb/core/message.c
884 +++ b/drivers/usb/core/message.c
885 @@ -1185,13 +1185,6 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
886 {
887 int i;
888
889 - dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
890 - skip_ep0 ? "non-ep0" : "all");
891 - for (i = skip_ep0; i < 16; ++i) {
892 - usb_disable_endpoint(dev, i, true);
893 - usb_disable_endpoint(dev, i + USB_DIR_IN, true);
894 - }
895 -
896 /* getting rid of interfaces will disconnect
897 * any drivers bound to them (a key side effect)
898 */
899 @@ -1221,6 +1214,13 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
900 if (dev->state == USB_STATE_CONFIGURED)
901 usb_set_device_state(dev, USB_STATE_ADDRESS);
902 }
903 +
904 + dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
905 + skip_ep0 ? "non-ep0" : "all");
906 + for (i = skip_ep0; i < 16; ++i) {
907 + usb_disable_endpoint(dev, i, true);
908 + usb_disable_endpoint(dev, i + USB_DIR_IN, true);
909 + }
910 }
911
912 /**
913 diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
914 index 4e970cf..23d4ce3 100644
915 --- a/drivers/usb/gadget/atmel_usba_udc.c
916 +++ b/drivers/usb/gadget/atmel_usba_udc.c
917 @@ -2013,6 +2013,9 @@ static int __init usba_udc_probe(struct platform_device *pdev)
918 } else {
919 disable_irq(gpio_to_irq(udc->vbus_pin));
920 }
921 + } else {
922 + /* gpio_request fail so use -EINVAL for gpio_is_valid */
923 + ubc->vbus_pin = -EINVAL;
924 }
925 }
926
927 diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
928 index fcec87e..51e8f0f 100644
929 --- a/drivers/usb/musb/blackfin.c
930 +++ b/drivers/usb/musb/blackfin.c
931 @@ -248,8 +248,10 @@ int __init musb_platform_init(struct musb *musb)
932
933 usb_nop_xceiv_register();
934 musb->xceiv = otg_get_transceiver();
935 - if (!musb->xceiv)
936 + if (!musb->xceiv) {
937 + gpio_free(musb->config->gpio_vrsel);
938 return -ENODEV;
939 + }
940
941 if (ANOMALY_05000346) {
942 bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value);
943 diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
944 index 93c4923..9f8f0d0 100644
945 --- a/drivers/usb/serial/cp210x.c
946 +++ b/drivers/usb/serial/cp210x.c
947 @@ -56,6 +56,7 @@ static int cp210x_carrier_raised(struct usb_serial_port *p);
948 static int debug;
949
950 static struct usb_device_id id_table [] = {
951 + { USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */
952 { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */
953 { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
954 { USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */
955 @@ -133,6 +134,7 @@ static struct usb_device_id id_table [] = {
956 { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
957 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
958 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
959 + { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
960 { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
961 { } /* Terminating Entry */
962 };
963 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
964 index a7044b1..6b5720e 100644
965 --- a/drivers/usb/serial/ftdi_sio.c
966 +++ b/drivers/usb/serial/ftdi_sio.c
967 @@ -182,6 +182,7 @@ static struct usb_device_id id_table_combined [] = {
968 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_SNIFFER_PID) },
969 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) },
970 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) },
971 + { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) },
972 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
973 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
974 { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
975 @@ -680,7 +681,6 @@ static struct usb_device_id id_table_combined [] = {
976 { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) },
977 { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) },
978 { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) },
979 - { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
980 { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) },
981 { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) },
982 { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) },
983 @@ -721,8 +721,37 @@ static struct usb_device_id id_table_combined [] = {
984 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
985 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
986 { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
987 +
988 + /* Papouch devices based on FTDI chip */
989 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_PID) },
990 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_PID) },
991 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_PID) },
992 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_2_PID) },
993 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_2_PID) },
994 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_2_PID) },
995 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485S_PID) },
996 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485C_PID) },
997 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_LEC_PID) },
998 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB232_PID) },
999 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
1000 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_IRAMP_PID) },
1001 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK5_PID) },
1002 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO8x8_PID) },
1003 { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) },
1004 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x2_PID) },
1005 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO10x1_PID) },
1006 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO30x3_PID) },
1007 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO60x3_PID) },
1008 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x16_PID) },
1009 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO3x32_PID) },
1010 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK6_PID) },
1011 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_UPSUSB_PID) },
1012 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_MU_PID) },
1013 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SIMUKEY_PID) },
1014 { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) },
1015 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMUX_PID) },
1016 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMSR_PID) },
1017 +
1018 { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) },
1019 { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
1020 { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) },
1021 @@ -757,6 +786,7 @@ static struct usb_device_id id_table_combined [] = {
1022 { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID),
1023 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1024 { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) },
1025 + { USB_DEVICE(FTDI_VID, ACCESIO_COM4SM_PID) },
1026 { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID),
1027 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1028 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) },
1029 @@ -767,6 +797,9 @@ static struct usb_device_id id_table_combined [] = {
1030 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) },
1031 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) },
1032 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) },
1033 + { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) },
1034 + { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) },
1035 + { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) },
1036 { }, /* Optional parameter entry */
1037 { } /* Terminating entry */
1038 };
1039 diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1040 index 30d3011..6ad578e 100644
1041 --- a/drivers/usb/serial/ftdi_sio_ids.h
1042 +++ b/drivers/usb/serial/ftdi_sio_ids.h
1043 @@ -61,6 +61,7 @@
1044 #define FTDI_OPENDCC_SNIFFER_PID 0xBFD9
1045 #define FTDI_OPENDCC_THROTTLE_PID 0xBFDA
1046 #define FTDI_OPENDCC_GATEWAY_PID 0xBFDB
1047 +#define FTDI_OPENDCC_GBM_PID 0xBFDC
1048
1049 /*
1050 * RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com)
1051 @@ -1029,9 +1030,34 @@
1052 */
1053
1054 #define PAPOUCH_VID 0x5050 /* Vendor ID */
1055 +#define PAPOUCH_SB485_PID 0x0100 /* Papouch SB485 USB-485/422 Converter */
1056 +#define PAPOUCH_AP485_PID 0x0101 /* AP485 USB-RS485 Converter */
1057 +#define PAPOUCH_SB422_PID 0x0102 /* Papouch SB422 USB-RS422 Converter */
1058 +#define PAPOUCH_SB485_2_PID 0x0103 /* Papouch SB485 USB-485/422 Converter */
1059 +#define PAPOUCH_AP485_2_PID 0x0104 /* AP485 USB-RS485 Converter */
1060 +#define PAPOUCH_SB422_2_PID 0x0105 /* Papouch SB422 USB-RS422 Converter */
1061 +#define PAPOUCH_SB485S_PID 0x0106 /* Papouch SB485S USB-485/422 Converter */
1062 +#define PAPOUCH_SB485C_PID 0x0107 /* Papouch SB485C USB-485/422 Converter */
1063 +#define PAPOUCH_LEC_PID 0x0300 /* LEC USB Converter */
1064 +#define PAPOUCH_SB232_PID 0x0301 /* Papouch SB232 USB-RS232 Converter */
1065 #define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */
1066 -#define PAPOUCH_QUIDO4x4_PID 0x0900 /* Quido 4/4 Module */
1067 +#define PAPOUCH_IRAMP_PID 0x0500 /* Papouch IRAmp Duplex */
1068 +#define PAPOUCH_DRAK5_PID 0x0700 /* Papouch DRAK5 */
1069 +#define PAPOUCH_QUIDO8x8_PID 0x0800 /* Papouch Quido 8/8 Module */
1070 +#define PAPOUCH_QUIDO4x4_PID 0x0900 /* Papouch Quido 4/4 Module */
1071 +#define PAPOUCH_QUIDO2x2_PID 0x0a00 /* Papouch Quido 2/2 Module */
1072 +#define PAPOUCH_QUIDO10x1_PID 0x0b00 /* Papouch Quido 10/1 Module */
1073 +#define PAPOUCH_QUIDO30x3_PID 0x0c00 /* Papouch Quido 30/3 Module */
1074 +#define PAPOUCH_QUIDO60x3_PID 0x0d00 /* Papouch Quido 60(100)/3 Module */
1075 +#define PAPOUCH_QUIDO2x16_PID 0x0e00 /* Papouch Quido 2/16 Module */
1076 +#define PAPOUCH_QUIDO3x32_PID 0x0f00 /* Papouch Quido 3/32 Module */
1077 +#define PAPOUCH_DRAK6_PID 0x1000 /* Papouch DRAK6 */
1078 +#define PAPOUCH_UPSUSB_PID 0x8000 /* Papouch UPS-USB adapter */
1079 +#define PAPOUCH_MU_PID 0x8001 /* MU controller */
1080 +#define PAPOUCH_SIMUKEY_PID 0x8002 /* Papouch SimuKey */
1081 #define PAPOUCH_AD4USB_PID 0x8003 /* AD4USB Measurement Module */
1082 +#define PAPOUCH_GMUX_PID 0x8004 /* Papouch GOLIATH MUX */
1083 +#define PAPOUCH_GMSR_PID 0x8005 /* Papouch GOLIATH MSR */
1084
1085 /*
1086 * Marvell SheevaPlug
1087 @@ -1070,3 +1096,14 @@
1088 * Submitted by John G. Rogers
1089 */
1090 #define SEGWAY_RMP200_PID 0xe729
1091 +
1092 +
1093 +/*
1094 + * Accesio USB Data Acquisition products (http://www.accesio.com/)
1095 + */
1096 +#define ACCESIO_COM4SM_PID 0xD578
1097 +
1098 +/* www.sciencescope.co.uk educational dataloggers */
1099 +#define FTDI_SCIENCESCOPE_LOGBOOKML_PID 0xFF18
1100 +#define FTDI_SCIENCESCOPE_LS_LOGBOOK_PID 0xFF1C
1101 +#define FTDI_SCIENCESCOPE_HS_LOGBOOK_PID 0xFF1D
1102 diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
1103 index 80f59b6..db7cf08 100644
1104 --- a/drivers/usb/serial/opticon.c
1105 +++ b/drivers/usb/serial/opticon.c
1106 @@ -99,8 +99,8 @@ static void opticon_bulk_callback(struct urb *urb)
1107 available_room = tty_buffer_request_room(tty,
1108 data_length);
1109 if (available_room) {
1110 - tty_insert_flip_string(tty, data,
1111 - available_room);
1112 + tty_insert_flip_string(tty, data + 2,
1113 + data_length);
1114 tty_flip_buffer_push(tty);
1115 }
1116 tty_kref_put(tty);
1117 @@ -134,7 +134,7 @@ exit:
1118 priv->bulk_address),
1119 priv->bulk_in_buffer, priv->buffer_size,
1120 opticon_bulk_callback, priv);
1121 - result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
1122 + result = usb_submit_urb(priv->bulk_read_urb, GFP_ATOMIC);
1123 if (result)
1124 dev_err(&port->dev,
1125 "%s - failed resubmitting read urb, error %d\n",
1126 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1127 index 19cedb9..72c2309 100644
1128 --- a/drivers/usb/serial/option.c
1129 +++ b/drivers/usb/serial/option.c
1130 @@ -582,6 +582,7 @@ static struct usb_device_id option_ids[] = {
1131 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0011, 0xff, 0xff, 0xff) },
1132 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff) },
1133 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) },
1134 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) },
1135 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) },
1136 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) },
1137 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff) },
1138 @@ -593,38 +594,52 @@ static struct usb_device_id option_ids[] = {
1139 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0023, 0xff, 0xff, 0xff) },
1140 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) },
1141 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff) },
1142 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) },
1143 + /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) }, */
1144 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) },
1145 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) },
1146 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) },
1147 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626, 0xff, 0xff, 0xff) },
1148 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0032, 0xff, 0xff, 0xff) },
1149 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0033, 0xff, 0xff, 0xff) },
1150 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0034, 0xff, 0xff, 0xff) },
1151 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0037, 0xff, 0xff, 0xff) },
1152 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0038, 0xff, 0xff, 0xff) },
1153 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0039, 0xff, 0xff, 0xff) },
1154 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0040, 0xff, 0xff, 0xff) },
1155 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0042, 0xff, 0xff, 0xff) },
1156 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0043, 0xff, 0xff, 0xff) },
1157 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0044, 0xff, 0xff, 0xff) },
1158 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0048, 0xff, 0xff, 0xff) },
1159 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0049, 0xff, 0xff, 0xff) },
1160 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0050, 0xff, 0xff, 0xff) },
1161 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) },
1162 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff) },
1163 + /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0053, 0xff, 0xff, 0xff) }, */
1164 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) },
1165 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff) },
1166 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0056, 0xff, 0xff, 0xff) },
1167 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) },
1168 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff) },
1169 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
1170 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) },
1171 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) },
1172 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff) },
1173 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0064, 0xff, 0xff, 0xff) },
1174 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0065, 0xff, 0xff, 0xff) },
1175 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) },
1176 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0067, 0xff, 0xff, 0xff) },
1177 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) },
1178 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
1179 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) },
1180 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0077, 0xff, 0xff, 0xff) },
1181 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) },
1182 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0079, 0xff, 0xff, 0xff) },
1183 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0082, 0xff, 0xff, 0xff) },
1184 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0083, 0xff, 0xff, 0xff) },
1185 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0086, 0xff, 0xff, 0xff) },
1186 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) },
1187 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
1188 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0087, 0xff, 0xff, 0xff) },
1189 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff) },
1190 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xff) },
1191 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0106, 0xff, 0xff, 0xff) },
1192 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0108, 0xff, 0xff, 0xff) },
1193 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0113, 0xff, 0xff, 0xff) },
1194 @@ -840,6 +855,8 @@ static struct usb_device_id option_ids[] = {
1195 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
1196 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) },
1197 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) },
1198 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) },
1199 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
1200 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
1201 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
1202 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
1203 diff --git a/fs/pipe.c b/fs/pipe.c
1204 index ae17d02..d0cc080 100644
1205 --- a/fs/pipe.c
1206 +++ b/fs/pipe.c
1207 @@ -363,7 +363,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
1208 error = ops->confirm(pipe, buf);
1209 if (error) {
1210 if (!ret)
1211 - error = ret;
1212 + ret = error;
1213 break;
1214 }
1215
1216 diff --git a/kernel/futex.c b/kernel/futex.c
1217 index 3071911..09dbee2 100644
1218 --- a/kernel/futex.c
1219 +++ b/kernel/futex.c
1220 @@ -1363,7 +1363,6 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q)
1221 {
1222 struct futex_hash_bucket *hb;
1223
1224 - get_futex_key_refs(&q->key);
1225 hb = hash_futex(&q->key);
1226 q->lock_ptr = &hb->lock;
1227
1228 @@ -1375,7 +1374,6 @@ static inline void
1229 queue_unlock(struct futex_q *q, struct futex_hash_bucket *hb)
1230 {
1231 spin_unlock(&hb->lock);
1232 - drop_futex_key_refs(&q->key);
1233 }
1234
1235 /**
1236 @@ -1480,8 +1478,6 @@ static void unqueue_me_pi(struct futex_q *q)
1237 q->pi_state = NULL;
1238
1239 spin_unlock(q->lock_ptr);
1240 -
1241 - drop_futex_key_refs(&q->key);
1242 }
1243
1244 /*
1245 @@ -1812,7 +1808,10 @@ static int futex_wait(u32 __user *uaddr, int fshared,
1246 }
1247
1248 retry:
1249 - /* Prepare to wait on uaddr. */
1250 + /*
1251 + * Prepare to wait on uaddr. On success, holds hb lock and increments
1252 + * q.key refs.
1253 + */
1254 ret = futex_wait_setup(uaddr, val, fshared, &q, &hb);
1255 if (ret)
1256 goto out;
1257 @@ -1822,24 +1821,23 @@ retry:
1258
1259 /* If we were woken (and unqueued), we succeeded, whatever. */
1260 ret = 0;
1261 + /* unqueue_me() drops q.key ref */
1262 if (!unqueue_me(&q))
1263 - goto out_put_key;
1264 + goto out;
1265 ret = -ETIMEDOUT;
1266 if (to && !to->task)
1267 - goto out_put_key;
1268 + goto out;
1269
1270 /*
1271 * We expect signal_pending(current), but we might be the
1272 * victim of a spurious wakeup as well.
1273 */
1274 - if (!signal_pending(current)) {
1275 - put_futex_key(fshared, &q.key);
1276 + if (!signal_pending(current))
1277 goto retry;
1278 - }
1279
1280 ret = -ERESTARTSYS;
1281 if (!abs_time)
1282 - goto out_put_key;
1283 + goto out;
1284
1285 restart = &current_thread_info()->restart_block;
1286 restart->fn = futex_wait_restart;
1287 @@ -1856,8 +1854,6 @@ retry:
1288
1289 ret = -ERESTART_RESTARTBLOCK;
1290
1291 -out_put_key:
1292 - put_futex_key(fshared, &q.key);
1293 out:
1294 if (to) {
1295 hrtimer_cancel(&to->timer);
1296 @@ -2236,7 +2232,10 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared,
1297 q.rt_waiter = &rt_waiter;
1298 q.requeue_pi_key = &key2;
1299
1300 - /* Prepare to wait on uaddr. */
1301 + /*
1302 + * Prepare to wait on uaddr. On success, increments q.key (key1) ref
1303 + * count.
1304 + */
1305 ret = futex_wait_setup(uaddr, val, fshared, &q, &hb);
1306 if (ret)
1307 goto out_key2;
1308 @@ -2254,7 +2253,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared,
1309 * In order for us to be here, we know our q.key == key2, and since
1310 * we took the hb->lock above, we also know that futex_requeue() has
1311 * completed and we no longer have to concern ourselves with a wakeup
1312 - * race with the atomic proxy lock acquition by the requeue code.
1313 + * race with the atomic proxy lock acquisition by the requeue code. The
1314 + * futex_requeue dropped our key1 reference and incremented our key2
1315 + * reference count.
1316 */
1317
1318 /* Check if the requeue code acquired the second futex for us. */
1319 diff --git a/kernel/sched.c b/kernel/sched.c
1320 index a675fd6..9652eca 100644
1321 --- a/kernel/sched.c
1322 +++ b/kernel/sched.c
1323 @@ -741,7 +741,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
1324 size_t cnt, loff_t *ppos)
1325 {
1326 char buf[64];
1327 - char *cmp = buf;
1328 + char *cmp;
1329 int neg = 0;
1330 int i;
1331
1332 @@ -752,6 +752,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
1333 return -EFAULT;
1334
1335 buf[cnt] = 0;
1336 + cmp = strstrip(buf);
1337
1338 if (strncmp(buf, "NO_", 3) == 0) {
1339 neg = 1;
1340 @@ -759,9 +760,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
1341 }
1342
1343 for (i = 0; sched_feat_names[i]; i++) {
1344 - int len = strlen(sched_feat_names[i]);
1345 -
1346 - if (strncmp(cmp, sched_feat_names[i], len) == 0) {
1347 + if (strcmp(cmp, sched_feat_names[i]) == 0) {
1348 if (neg)
1349 sysctl_sched_features &= ~(1UL << i);
1350 else
1351 diff --git a/mm/vmalloc.c b/mm/vmalloc.c
1352 index c228731..680dcbb 100644
1353 --- a/mm/vmalloc.c
1354 +++ b/mm/vmalloc.c
1355 @@ -513,6 +513,15 @@ static atomic_t vmap_lazy_nr = ATOMIC_INIT(0);
1356 static void purge_fragmented_blocks_allcpus(void);
1357
1358 /*
1359 + * called before a call to iounmap() if the caller wants vm_area_struct's
1360 + * immediately freed.
1361 + */
1362 +void set_iounmap_nonlazy(void)
1363 +{
1364 + atomic_set(&vmap_lazy_nr, lazy_max_pages()+1);
1365 +}
1366 +
1367 +/*
1368 * Purges all lazily-freed vmap areas.
1369 *
1370 * If sync is 0 then don't purge if there is already a purge in progress.

  ViewVC Help
Powered by ViewVC 1.1.20