Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1828 - genpatches-2.6/trunk/2.6.36
Date: Mon, 22 Nov 2010 22:46:02
Message-Id: 20101122224550.E970920051@flycatcher.gentoo.org
1 Author: mpagano
2 Date: 2010-11-22 22:45:50 +0000 (Mon, 22 Nov 2010)
3 New Revision: 1828
4
5 Added:
6 genpatches-2.6/trunk/2.6.36/1000_linux-2.6.36.1.patch
7 Removed:
8 genpatches-2.6/trunk/2.6.36/1800_automated-per-tty-task-groups.patch
9 Modified:
10 genpatches-2.6/trunk/2.6.36/0000_README
11 Log:
12 Removal of cgroups tty scheduler patch. Linux version 2.6.36.1
13
14 Modified: genpatches-2.6/trunk/2.6.36/0000_README
15 ===================================================================
16 --- genpatches-2.6/trunk/2.6.36/0000_README 2010-11-21 00:34:02 UTC (rev 1827)
17 +++ genpatches-2.6/trunk/2.6.36/0000_README 2010-11-22 22:45:50 UTC (rev 1828)
18 @@ -39,9 +39,9 @@
19 Individual Patch Descriptions:
20 --------------------------------------------------------------------------
21
22 -Patch: 1800_automated-per-tty-task-groups.patch
23 -From: http://bugs.gentoo.org/show_bug.cgi?id=346021
24 -Desc: Automatically create task groups per tty, to improve desktop interactivity
25 +Patch: 1000_linux-2.6.36.1.patch
26 +From: http://www.kernel.org
27 +Desc: Linux 2.6.36.1
28
29 Patch: 2700_disable-sticky-PCM-stream-assignment-for-AD-codecs.patch
30 From: http://bugs.gentoo.org/show_bug.cgi?id=344153
31
32 Added: genpatches-2.6/trunk/2.6.36/1000_linux-2.6.36.1.patch
33 ===================================================================
34 --- genpatches-2.6/trunk/2.6.36/1000_linux-2.6.36.1.patch (rev 0)
35 +++ genpatches-2.6/trunk/2.6.36/1000_linux-2.6.36.1.patch 2010-11-22 22:45:50 UTC (rev 1828)
36 @@ -0,0 +1,1788 @@
37 +diff --git a/arch/arm/include/asm/kgdb.h b/arch/arm/include/asm/kgdb.h
38 +index 0826599..48066ce 100644
39 +--- a/arch/arm/include/asm/kgdb.h
40 ++++ b/arch/arm/include/asm/kgdb.h
41 +@@ -70,7 +70,8 @@ extern int kgdb_fault_expected;
42 + #define _GP_REGS 16
43 + #define _FP_REGS 8
44 + #define _EXTRA_REGS 2
45 +-#define DBG_MAX_REG_NUM (_GP_REGS + (_FP_REGS * 3) + _EXTRA_REGS)
46 ++#define GDB_MAX_REGS (_GP_REGS + (_FP_REGS * 3) + _EXTRA_REGS)
47 ++#define DBG_MAX_REG_NUM (_GP_REGS + _FP_REGS + _EXTRA_REGS)
48 +
49 + #define KGDB_MAX_NO_CPUS 1
50 + #define BUFMAX 400
51 +@@ -93,7 +94,7 @@ extern int kgdb_fault_expected;
52 + #define _SPT 13
53 + #define _LR 14
54 + #define _PC 15
55 +-#define _CPSR (DBG_MAX_REG_NUM - 1)
56 ++#define _CPSR (GDB_MAX_REGS - 1)
57 +
58 + /*
59 + * So that we can denote the end of a frame for tracing,
60 +diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c
61 +index d6e8b4d..778c2f7 100644
62 +--- a/arch/arm/kernel/kgdb.c
63 ++++ b/arch/arm/kernel/kgdb.c
64 +@@ -79,7 +79,7 @@ sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task)
65 + return;
66 +
67 + /* Initialize to zero */
68 +- for (regno = 0; regno < DBG_MAX_REG_NUM; regno++)
69 ++ for (regno = 0; regno < GDB_MAX_REGS; regno++)
70 + gdb_regs[regno] = 0;
71 +
72 + /* Otherwise, we have only some registers from switch_to() */
73 +diff --git a/arch/arm/mach-cns3xxx/include/mach/debug-macro.S b/arch/arm/mach-cns3xxx/include/mach/debug-macro.S
74 +index d16ce7e..9b50442 100644
75 +--- a/arch/arm/mach-cns3xxx/include/mach/debug-macro.S
76 ++++ b/arch/arm/mach-cns3xxx/include/mach/debug-macro.S
77 +@@ -10,7 +10,7 @@
78 + * published by the Free Software Foundation.
79 + */
80 +
81 +- .macro addruart,rx
82 ++ .macro addruart,rx,rtmp
83 + mrc p15, 0, \rx, c1, c0
84 + tst \rx, #1 @ MMU enabled?
85 + moveq \rx, #0x10000000
86 +diff --git a/arch/powerpc/kernel/ppc970-pmu.c b/arch/powerpc/kernel/ppc970-pmu.c
87 +index 8eff48e..3fee685 100644
88 +--- a/arch/powerpc/kernel/ppc970-pmu.c
89 ++++ b/arch/powerpc/kernel/ppc970-pmu.c
90 +@@ -169,9 +169,11 @@ static int p970_marked_instr_event(u64 event)
91 + switch (unit) {
92 + case PM_VPU:
93 + mask = 0x4c; /* byte 0 bits 2,3,6 */
94 ++ break;
95 + case PM_LSU0:
96 + /* byte 2 bits 0,2,3,4,6; all of byte 1 */
97 + mask = 0x085dff00;
98 ++ break;
99 + case PM_LSU1L:
100 + mask = 0x50 << 24; /* byte 3 bits 4,6 */
101 + break;
102 +diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
103 +index 3f76523..f857bd3 100644
104 +--- a/arch/x86/include/asm/cpufeature.h
105 ++++ b/arch/x86/include/asm/cpufeature.h
106 +@@ -152,7 +152,7 @@
107 + #define X86_FEATURE_3DNOWPREFETCH (6*32+ 8) /* 3DNow prefetch instructions */
108 + #define X86_FEATURE_OSVW (6*32+ 9) /* OS Visible Workaround */
109 + #define X86_FEATURE_IBS (6*32+10) /* Instruction Based Sampling */
110 +-#define X86_FEATURE_SSE5 (6*32+11) /* SSE-5 */
111 ++#define X86_FEATURE_XOP (6*32+11) /* extended AVX instructions */
112 + #define X86_FEATURE_SKINIT (6*32+12) /* SKINIT/STGI instructions */
113 + #define X86_FEATURE_WDT (6*32+13) /* Watchdog timer */
114 + #define X86_FEATURE_NODEID_MSR (6*32+19) /* NodeId MSR */
115 +diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
116 +index 30a3e97..6a45ec4 100644
117 +--- a/arch/x86/include/asm/io.h
118 ++++ b/arch/x86/include/asm/io.h
119 +@@ -206,6 +206,7 @@ static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
120 +
121 + extern void iounmap(volatile void __iomem *addr);
122 +
123 ++extern void set_iounmap_nonlazy(void);
124 +
125 + #ifdef __KERNEL__
126 +
127 +diff --git a/arch/x86/include/asm/mrst.h b/arch/x86/include/asm/mrst.h
128 +index 1635074..33fc296 100644
129 +--- a/arch/x86/include/asm/mrst.h
130 ++++ b/arch/x86/include/asm/mrst.h
131 +@@ -26,7 +26,7 @@ enum mrst_cpu_type {
132 + };
133 +
134 + extern enum mrst_cpu_type __mrst_cpu_chip;
135 +-static enum mrst_cpu_type mrst_identify_cpu(void)
136 ++static inline enum mrst_cpu_type mrst_identify_cpu(void)
137 + {
138 + return __mrst_cpu_chip;
139 + }
140 +diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
141 +index 4cfc908..4c2f63c 100644
142 +--- a/arch/x86/include/asm/smp.h
143 ++++ b/arch/x86/include/asm/smp.h
144 +@@ -50,7 +50,7 @@ struct smp_ops {
145 + void (*smp_prepare_cpus)(unsigned max_cpus);
146 + void (*smp_cpus_done)(unsigned max_cpus);
147 +
148 +- void (*smp_send_stop)(void);
149 ++ void (*stop_other_cpus)(int wait);
150 + void (*smp_send_reschedule)(int cpu);
151 +
152 + int (*cpu_up)(unsigned cpu);
153 +@@ -73,7 +73,12 @@ extern struct smp_ops smp_ops;
154 +
155 + static inline void smp_send_stop(void)
156 + {
157 +- smp_ops.smp_send_stop();
158 ++ smp_ops.stop_other_cpus(0);
159 ++}
160 ++
161 ++static inline void stop_other_cpus(void)
162 ++{
163 ++ smp_ops.stop_other_cpus(1);
164 + }
165 +
166 + static inline void smp_prepare_boot_cpu(void)
167 +diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
168 +index 5c5b8f3..ad1515d 100644
169 +--- a/arch/x86/kernel/apic/io_apic.c
170 ++++ b/arch/x86/kernel/apic/io_apic.c
171 +@@ -1397,6 +1397,7 @@ int setup_ioapic_entry(int apic_id, int irq,
172 + irte.dlvry_mode = apic->irq_delivery_mode;
173 + irte.vector = vector;
174 + irte.dest_id = IRTE_DEST(destination);
175 ++ irte.redir_hint = 1;
176 +
177 + /* Set source-id of interrupt request */
178 + set_ioapic_sid(&irte, apic_id);
179 +@@ -3348,6 +3349,7 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq,
180 + irte.dlvry_mode = apic->irq_delivery_mode;
181 + irte.vector = cfg->vector;
182 + irte.dest_id = IRTE_DEST(dest);
183 ++ irte.redir_hint = 1;
184 +
185 + /* Set source-id of interrupt request */
186 + if (pdev)
187 +diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c
188 +index c5f59d0..ac140c7 100644
189 +--- a/arch/x86/kernel/cpu/mtrr/cleanup.c
190 ++++ b/arch/x86/kernel/cpu/mtrr/cleanup.c
191 +@@ -827,7 +827,7 @@ int __init amd_special_default_mtrr(void)
192 +
193 + if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
194 + return 0;
195 +- if (boot_cpu_data.x86 < 0xf || boot_cpu_data.x86 > 0x11)
196 ++ if (boot_cpu_data.x86 < 0xf)
197 + return 0;
198 + /* In case some hypervisor doesn't pass SYSCFG through: */
199 + if (rdmsr_safe(MSR_K8_SYSCFG, &l, &h) < 0)
200 +diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c
201 +index c2897b7..46d5844 100644
202 +--- a/arch/x86/kernel/cpu/perf_event_amd.c
203 ++++ b/arch/x86/kernel/cpu/perf_event_amd.c
204 +@@ -52,7 +52,7 @@ static __initconst const u64 amd_hw_cache_event_ids
205 + [ C(DTLB) ] = {
206 + [ C(OP_READ) ] = {
207 + [ C(RESULT_ACCESS) ] = 0x0040, /* Data Cache Accesses */
208 +- [ C(RESULT_MISS) ] = 0x0046, /* L1 DTLB and L2 DLTB Miss */
209 ++ [ C(RESULT_MISS) ] = 0x0746, /* L1_DTLB_AND_L2_DLTB_MISS.ALL */
210 + },
211 + [ C(OP_WRITE) ] = {
212 + [ C(RESULT_ACCESS) ] = 0,
213 +@@ -66,7 +66,7 @@ static __initconst const u64 amd_hw_cache_event_ids
214 + [ C(ITLB) ] = {
215 + [ C(OP_READ) ] = {
216 + [ C(RESULT_ACCESS) ] = 0x0080, /* Instruction fecthes */
217 +- [ C(RESULT_MISS) ] = 0x0085, /* Instr. fetch ITLB misses */
218 ++ [ C(RESULT_MISS) ] = 0x0385, /* L1_ITLB_AND_L2_ITLB_MISS.ALL */
219 + },
220 + [ C(OP_WRITE) ] = {
221 + [ C(RESULT_ACCESS) ] = -1,
222 +diff --git a/arch/x86/kernel/crash_dump_64.c b/arch/x86/kernel/crash_dump_64.c
223 +index 045b36c..9948288 100644
224 +--- a/arch/x86/kernel/crash_dump_64.c
225 ++++ b/arch/x86/kernel/crash_dump_64.c
226 +@@ -34,7 +34,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
227 + if (!csize)
228 + return 0;
229 +
230 +- vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
231 ++ vaddr = ioremap_cache(pfn << PAGE_SHIFT, PAGE_SIZE);
232 + if (!vaddr)
233 + return -ENOMEM;
234 +
235 +@@ -46,6 +46,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
236 + } else
237 + memcpy(buf, vaddr + offset, csize);
238 +
239 ++ set_iounmap_nonlazy();
240 + iounmap(vaddr);
241 + return csize;
242 + }
243 +diff --git a/arch/x86/kernel/olpc.c b/arch/x86/kernel/olpc.c
244 +index 0e0cdde..a2bd899 100644
245 +--- a/arch/x86/kernel/olpc.c
246 ++++ b/arch/x86/kernel/olpc.c
247 +@@ -114,6 +114,7 @@ int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
248 + unsigned long flags;
249 + int ret = -EIO;
250 + int i;
251 ++ int restarts = 0;
252 +
253 + spin_lock_irqsave(&ec_lock, flags);
254 +
255 +@@ -169,7 +170,9 @@ restart:
256 + if (wait_on_obf(0x6c, 1)) {
257 + printk(KERN_ERR "olpc-ec: timeout waiting for"
258 + " EC to provide data!\n");
259 +- goto restart;
260 ++ if (restarts++ < 10)
261 ++ goto restart;
262 ++ goto err;
263 + }
264 + outbuf[i] = inb(0x68);
265 + pr_devel("olpc-ec: received 0x%x\n", outbuf[i]);
266 +diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
267 +index e3af342..76a0d71 100644
268 +--- a/arch/x86/kernel/reboot.c
269 ++++ b/arch/x86/kernel/reboot.c
270 +@@ -641,7 +641,7 @@ void native_machine_shutdown(void)
271 + /* O.K Now that I'm on the appropriate processor,
272 + * stop all of the others.
273 + */
274 +- smp_send_stop();
275 ++ stop_other_cpus();
276 + #endif
277 +
278 + lapic_shutdown();
279 +diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
280 +index d801210..513deac 100644
281 +--- a/arch/x86/kernel/smp.c
282 ++++ b/arch/x86/kernel/smp.c
283 +@@ -159,10 +159,10 @@ asmlinkage void smp_reboot_interrupt(void)
284 + irq_exit();
285 + }
286 +
287 +-static void native_smp_send_stop(void)
288 ++static void native_stop_other_cpus(int wait)
289 + {
290 + unsigned long flags;
291 +- unsigned long wait;
292 ++ unsigned long timeout;
293 +
294 + if (reboot_force)
295 + return;
296 +@@ -179,9 +179,12 @@ static void native_smp_send_stop(void)
297 + if (num_online_cpus() > 1) {
298 + apic->send_IPI_allbutself(REBOOT_VECTOR);
299 +
300 +- /* Don't wait longer than a second */
301 +- wait = USEC_PER_SEC;
302 +- while (num_online_cpus() > 1 && wait--)
303 ++ /*
304 ++ * Don't wait longer than a second if the caller
305 ++ * didn't ask us to wait.
306 ++ */
307 ++ timeout = USEC_PER_SEC;
308 ++ while (num_online_cpus() > 1 && (wait || timeout--))
309 + udelay(1);
310 + }
311 +
312 +@@ -227,7 +230,7 @@ struct smp_ops smp_ops = {
313 + .smp_prepare_cpus = native_smp_prepare_cpus,
314 + .smp_cpus_done = native_smp_cpus_done,
315 +
316 +- .smp_send_stop = native_smp_send_stop,
317 ++ .stop_other_cpus = native_stop_other_cpus,
318 + .smp_send_reschedule = native_smp_send_reschedule,
319 +
320 + .cpu_up = native_cpu_up,
321 +diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
322 +index 60788de..9f4edeb 100644
323 +--- a/arch/x86/kernel/traps.c
324 ++++ b/arch/x86/kernel/traps.c
325 +@@ -575,6 +575,7 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code)
326 + if (regs->flags & X86_VM_MASK) {
327 + handle_vm86_trap((struct kernel_vm86_regs *) regs,
328 + error_code, 1);
329 ++ preempt_conditional_cli(regs);
330 + return;
331 + }
332 +
333 +diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
334 +index 5ffb562..61fb985 100644
335 +--- a/arch/x86/kernel/vm86_32.c
336 ++++ b/arch/x86/kernel/vm86_32.c
337 +@@ -551,8 +551,14 @@ cannot_handle:
338 + int handle_vm86_trap(struct kernel_vm86_regs *regs, long error_code, int trapno)
339 + {
340 + if (VMPI.is_vm86pus) {
341 +- if ((trapno == 3) || (trapno == 1))
342 +- return_to_32bit(regs, VM86_TRAP + (trapno << 8));
343 ++ if ((trapno == 3) || (trapno == 1)) {
344 ++ KVM86->regs32->ax = VM86_TRAP + (trapno << 8);
345 ++ /* setting this flag forces the code in entry_32.S to
346 ++ call save_v86_state() and change the stack pointer
347 ++ to KVM86->regs32 */
348 ++ set_thread_flag(TIF_IRET);
349 ++ return 0;
350 ++ }
351 + do_int(regs, trapno, (unsigned char __user *) (regs->pt.ss << 4), SP(regs));
352 + return 0;
353 + }
354 +diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
355 +index 8a3f9f6..2a02a65 100644
356 +--- a/arch/x86/kvm/svm.c
357 ++++ b/arch/x86/kvm/svm.c
358 +@@ -88,6 +88,14 @@ struct nested_state {
359 + /* A VMEXIT is required but not yet emulated */
360 + bool exit_required;
361 +
362 ++ /*
363 ++ * If we vmexit during an instruction emulation we need this to restore
364 ++ * the l1 guest rip after the emulation
365 ++ */
366 ++ unsigned long vmexit_rip;
367 ++ unsigned long vmexit_rsp;
368 ++ unsigned long vmexit_rax;
369 ++
370 + /* cache for intercepts of the guest */
371 + u16 intercept_cr_read;
372 + u16 intercept_cr_write;
373 +@@ -1206,8 +1214,12 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
374 + if (old == new) {
375 + /* cr0 write with ts and mp unchanged */
376 + svm->vmcb->control.exit_code = SVM_EXIT_CR0_SEL_WRITE;
377 +- if (nested_svm_exit_handled(svm) == NESTED_EXIT_DONE)
378 ++ if (nested_svm_exit_handled(svm) == NESTED_EXIT_DONE) {
379 ++ svm->nested.vmexit_rip = kvm_rip_read(vcpu);
380 ++ svm->nested.vmexit_rsp = kvm_register_read(vcpu, VCPU_REGS_RSP);
381 ++ svm->nested.vmexit_rax = kvm_register_read(vcpu, VCPU_REGS_RAX);
382 + return;
383 ++ }
384 + }
385 + }
386 +
387 +@@ -2399,6 +2411,23 @@ static int emulate_on_interception(struct vcpu_svm *svm)
388 + return emulate_instruction(&svm->vcpu, 0, 0, 0) == EMULATE_DONE;
389 + }
390 +
391 ++static int cr0_write_interception(struct vcpu_svm *svm)
392 ++{
393 ++ struct kvm_vcpu *vcpu = &svm->vcpu;
394 ++ int r;
395 ++
396 ++ r = emulate_instruction(&svm->vcpu, 0, 0, 0);
397 ++
398 ++ if (svm->nested.vmexit_rip) {
399 ++ kvm_register_write(vcpu, VCPU_REGS_RIP, svm->nested.vmexit_rip);
400 ++ kvm_register_write(vcpu, VCPU_REGS_RSP, svm->nested.vmexit_rsp);
401 ++ kvm_register_write(vcpu, VCPU_REGS_RAX, svm->nested.vmexit_rax);
402 ++ svm->nested.vmexit_rip = 0;
403 ++ }
404 ++
405 ++ return r == EMULATE_DONE;
406 ++}
407 ++
408 + static int cr8_write_interception(struct vcpu_svm *svm)
409 + {
410 + struct kvm_run *kvm_run = svm->vcpu.run;
411 +@@ -2672,7 +2701,7 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm) = {
412 + [SVM_EXIT_READ_CR4] = emulate_on_interception,
413 + [SVM_EXIT_READ_CR8] = emulate_on_interception,
414 + [SVM_EXIT_CR0_SEL_WRITE] = emulate_on_interception,
415 +- [SVM_EXIT_WRITE_CR0] = emulate_on_interception,
416 ++ [SVM_EXIT_WRITE_CR0] = cr0_write_interception,
417 + [SVM_EXIT_WRITE_CR3] = emulate_on_interception,
418 + [SVM_EXIT_WRITE_CR4] = emulate_on_interception,
419 + [SVM_EXIT_WRITE_CR8] = cr8_write_interception,
420 +@@ -3354,6 +3383,10 @@ static void svm_cpuid_update(struct kvm_vcpu *vcpu)
421 + static void svm_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
422 + {
423 + switch (func) {
424 ++ case 0x80000001:
425 ++ if (nested)
426 ++ entry->ecx |= (1 << 2); /* Set SVM bit */
427 ++ break;
428 + case 0x8000000A:
429 + entry->eax = 1; /* SVM revision 1 */
430 + entry->ebx = 8; /* Lets support 8 ASIDs in case we add proper
431 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
432 +index 3a09c62..a4a427b 100644
433 +--- a/arch/x86/kvm/x86.c
434 ++++ b/arch/x86/kvm/x86.c
435 +@@ -1994,9 +1994,9 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
436 + 0 /* Reserved, AES */ | F(XSAVE) | 0 /* OSXSAVE */ | F(AVX);
437 + /* cpuid 0x80000001.ecx */
438 + const u32 kvm_supported_word6_x86_features =
439 +- F(LAHF_LM) | F(CMP_LEGACY) | F(SVM) | 0 /* ExtApicSpace */ |
440 ++ F(LAHF_LM) | F(CMP_LEGACY) | 0 /*SVM*/ | 0 /* ExtApicSpace */ |
441 + F(CR8_LEGACY) | F(ABM) | F(SSE4A) | F(MISALIGNSSE) |
442 +- F(3DNOWPREFETCH) | 0 /* OSVW */ | 0 /* IBS */ | F(SSE5) |
443 ++ F(3DNOWPREFETCH) | 0 /* OSVW */ | 0 /* IBS */ | F(XOP) |
444 + 0 /* SKINIT */ | 0 /* WDT */;
445 +
446 + /* all calls to cpuid_count() should be made on the same cpu */
447 +diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
448 +index 7d46c84..44f8086 100644
449 +--- a/arch/x86/xen/enlighten.c
450 ++++ b/arch/x86/xen/enlighten.c
451 +@@ -1018,7 +1018,7 @@ static void xen_reboot(int reason)
452 + struct sched_shutdown r = { .reason = reason };
453 +
454 + #ifdef CONFIG_SMP
455 +- smp_send_stop();
456 ++ stop_other_cpus();
457 + #endif
458 +
459 + if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r))
460 +diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
461 +index 25f232b..f4d0100 100644
462 +--- a/arch/x86/xen/smp.c
463 ++++ b/arch/x86/xen/smp.c
464 +@@ -400,9 +400,9 @@ static void stop_self(void *v)
465 + BUG();
466 + }
467 +
468 +-static void xen_smp_send_stop(void)
469 ++static void xen_stop_other_cpus(int wait)
470 + {
471 +- smp_call_function(stop_self, NULL, 0);
472 ++ smp_call_function(stop_self, NULL, wait);
473 + }
474 +
475 + static void xen_smp_send_reschedule(int cpu)
476 +@@ -470,7 +470,7 @@ static const struct smp_ops xen_smp_ops __initdata = {
477 + .cpu_disable = xen_cpu_disable,
478 + .play_dead = xen_play_dead,
479 +
480 +- .smp_send_stop = xen_smp_send_stop,
481 ++ .stop_other_cpus = xen_stop_other_cpus,
482 + .smp_send_reschedule = xen_smp_send_reschedule,
483 +
484 + .send_call_func_ipi = xen_smp_send_call_function_ipi,
485 +diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
486 +index e5fdeeb..d1a0f5b 100644
487 +--- a/drivers/ata/ahci.h
488 ++++ b/drivers/ata/ahci.h
489 +@@ -72,6 +72,7 @@ enum {
490 + AHCI_CMD_RESET = (1 << 8),
491 + AHCI_CMD_CLR_BUSY = (1 << 10),
492 +
493 ++ RX_FIS_PIO_SETUP = 0x20, /* offset of PIO Setup FIS data */
494 + RX_FIS_D2H_REG = 0x40, /* offset of D2H Register FIS data */
495 + RX_FIS_SDB = 0x58, /* offset of SDB FIS data */
496 + RX_FIS_UNK = 0x60, /* offset of Unknown FIS data */
497 +diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
498 +index 8eea309..137514d 100644
499 +--- a/drivers/ata/libahci.c
500 ++++ b/drivers/ata/libahci.c
501 +@@ -1830,12 +1830,24 @@ static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc)
502 + static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc)
503 + {
504 + struct ahci_port_priv *pp = qc->ap->private_data;
505 +- u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
506 ++ u8 *rx_fis = pp->rx_fis;
507 +
508 + if (pp->fbs_enabled)
509 +- d2h_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ;
510 ++ rx_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ;
511 ++
512 ++ /*
513 ++ * After a successful execution of an ATA PIO data-in command,
514 ++ * the device doesn't send D2H Reg FIS to update the TF and
515 ++ * the host should take TF and E_Status from the preceding PIO
516 ++ * Setup FIS.
517 ++ */
518 ++ if (qc->tf.protocol == ATA_PROT_PIO && qc->dma_dir == DMA_FROM_DEVICE &&
519 ++ !(qc->flags & ATA_QCFLAG_FAILED)) {
520 ++ ata_tf_from_fis(rx_fis + RX_FIS_PIO_SETUP, &qc->result_tf);
521 ++ qc->result_tf.command = (rx_fis + RX_FIS_PIO_SETUP)[15];
522 ++ } else
523 ++ ata_tf_from_fis(rx_fis + RX_FIS_D2H_REG, &qc->result_tf);
524 +
525 +- ata_tf_from_fis(d2h_fis, &qc->result_tf);
526 + return true;
527 + }
528 +
529 +diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
530 +index 998833d..17361ba 100644
531 +--- a/drivers/bluetooth/hci_ldisc.c
532 ++++ b/drivers/bluetooth/hci_ldisc.c
533 +@@ -256,9 +256,16 @@ static int hci_uart_tty_open(struct tty_struct *tty)
534 +
535 + BT_DBG("tty %p", tty);
536 +
537 ++ /* FIXME: This btw is bogus, nothing requires the old ldisc to clear
538 ++ the pointer */
539 + if (hu)
540 + return -EEXIST;
541 +
542 ++ /* Error if the tty has no write op instead of leaving an exploitable
543 ++ hole */
544 ++ if (tty->ops->write == NULL)
545 ++ return -EOPNOTSUPP;
546 ++
547 + if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) {
548 + BT_ERR("Can't allocate control structure");
549 + return -ENFILE;
550 +diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
551 +index 9ecd6be..45f9fad 100644
552 +--- a/drivers/char/pcmcia/synclink_cs.c
553 ++++ b/drivers/char/pcmcia/synclink_cs.c
554 +@@ -4127,6 +4127,8 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
555 + if (cmd != SIOCWANDEV)
556 + return hdlc_ioctl(dev, ifr, cmd);
557 +
558 ++ memset(&new_line, 0, size);
559 ++
560 + switch(ifr->ifr_settings.type) {
561 + case IF_GET_IFACE: /* return current sync_serial_settings */
562 +
563 +diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
564 +index c37ef64..cf88588 100644
565 +--- a/drivers/idle/intel_idle.c
566 ++++ b/drivers/idle/intel_idle.c
567 +@@ -276,7 +276,7 @@ static int intel_idle_probe(void)
568 +
569 + case 0x1C: /* 28 - Atom Processor */
570 + case 0x26: /* 38 - Lincroft Atom Processor */
571 +- lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */
572 ++ lapic_timer_reliable_states = (1 << 1); /* C1 */
573 + cpuidle_state_table = atom_cstates;
574 + break;
575 + #ifdef FUTURE_USE
576 +diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c
577 +index 1f59ee2..17bbacb 100644
578 +--- a/drivers/misc/sgi-xp/xpc_uv.c
579 ++++ b/drivers/misc/sgi-xp/xpc_uv.c
580 +@@ -417,6 +417,7 @@ xpc_process_activate_IRQ_rcvd_uv(void)
581 + static void
582 + xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
583 + struct xpc_activate_mq_msghdr_uv *msg_hdr,
584 ++ int part_setup,
585 + int *wakeup_hb_checker)
586 + {
587 + unsigned long irq_flags;
588 +@@ -481,6 +482,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
589 + case XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREQUEST_UV: {
590 + struct xpc_activate_mq_msg_chctl_closerequest_uv *msg;
591 +
592 ++ if (!part_setup)
593 ++ break;
594 ++
595 + msg = container_of(msg_hdr, struct
596 + xpc_activate_mq_msg_chctl_closerequest_uv,
597 + hdr);
598 +@@ -497,6 +501,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
599 + case XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREPLY_UV: {
600 + struct xpc_activate_mq_msg_chctl_closereply_uv *msg;
601 +
602 ++ if (!part_setup)
603 ++ break;
604 ++
605 + msg = container_of(msg_hdr, struct
606 + xpc_activate_mq_msg_chctl_closereply_uv,
607 + hdr);
608 +@@ -511,6 +518,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
609 + case XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREQUEST_UV: {
610 + struct xpc_activate_mq_msg_chctl_openrequest_uv *msg;
611 +
612 ++ if (!part_setup)
613 ++ break;
614 ++
615 + msg = container_of(msg_hdr, struct
616 + xpc_activate_mq_msg_chctl_openrequest_uv,
617 + hdr);
618 +@@ -528,6 +538,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
619 + case XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREPLY_UV: {
620 + struct xpc_activate_mq_msg_chctl_openreply_uv *msg;
621 +
622 ++ if (!part_setup)
623 ++ break;
624 ++
625 + msg = container_of(msg_hdr, struct
626 + xpc_activate_mq_msg_chctl_openreply_uv, hdr);
627 + args = &part->remote_openclose_args[msg->ch_number];
628 +@@ -545,6 +558,9 @@ xpc_handle_activate_mq_msg_uv(struct xpc_partition *part,
629 + case XPC_ACTIVATE_MQ_MSG_CHCTL_OPENCOMPLETE_UV: {
630 + struct xpc_activate_mq_msg_chctl_opencomplete_uv *msg;
631 +
632 ++ if (!part_setup)
633 ++ break;
634 ++
635 + msg = container_of(msg_hdr, struct
636 + xpc_activate_mq_msg_chctl_opencomplete_uv, hdr);
637 + spin_lock_irqsave(&part->chctl_lock, irq_flags);
638 +@@ -621,6 +637,7 @@ xpc_handle_activate_IRQ_uv(int irq, void *dev_id)
639 +
640 + part_referenced = xpc_part_ref(part);
641 + xpc_handle_activate_mq_msg_uv(part, msg_hdr,
642 ++ part_referenced,
643 + &wakeup_hb_checker);
644 + if (part_referenced)
645 + xpc_part_deref(part);
646 +diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c
647 +index 78347041..0a7ce37 100644
648 +--- a/drivers/net/wireless/p54/eeprom.c
649 ++++ b/drivers/net/wireless/p54/eeprom.c
650 +@@ -260,8 +260,10 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev)
651 + list->max_entries = max_channel_num;
652 + list->channels = kzalloc(sizeof(struct p54_channel_entry) *
653 + max_channel_num, GFP_KERNEL);
654 +- if (!list->channels)
655 ++ if (!list->channels) {
656 ++ ret = -ENOMEM;
657 + goto free;
658 ++ }
659 +
660 + for (i = 0; i < max_channel_num; i++) {
661 + if (i < priv->iq_autocal_len) {
662 +diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
663 +index ad59595..d5bc21e 100644
664 +--- a/drivers/net/wireless/p54/p54usb.c
665 ++++ b/drivers/net/wireless/p54/p54usb.c
666 +@@ -33,8 +33,17 @@ MODULE_ALIAS("prism54usb");
667 + MODULE_FIRMWARE("isl3886usb");
668 + MODULE_FIRMWARE("isl3887usb");
669 +
670 ++/*
671 ++ * Note:
672 ++ *
673 ++ * Always update our wiki's device list (located at:
674 ++ * http://wireless.kernel.org/en/users/Drivers/p54/devices ),
675 ++ * whenever you add a new device.
676 ++ */
677 ++
678 + static struct usb_device_id p54u_table[] __devinitdata = {
679 + /* Version 1 devices (pci chip + net2280) */
680 ++ {USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */
681 + {USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */
682 + {USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */
683 + {USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */
684 +@@ -47,7 +56,9 @@ static struct usb_device_id p54u_table[] __devinitdata = {
685 + {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */
686 + {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */
687 + {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */
688 ++ {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */
689 + {USB_DEVICE(0x124a, 0x4023)}, /* Shuttle PN15, Airvast WM168g, IOGear GWU513 */
690 ++ {USB_DEVICE(0x1630, 0x0005)}, /* 2Wire 802.11g USB (v1) / Z-Com */
691 + {USB_DEVICE(0x1915, 0x2234)}, /* Linksys WUSB54G OEM */
692 + {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */
693 + {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */
694 +@@ -60,6 +71,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
695 + {USB_DEVICE(0x050d, 0x7050)}, /* Belkin F5D7050 ver 1000 */
696 + {USB_DEVICE(0x0572, 0x2000)}, /* Cohiba Proto board */
697 + {USB_DEVICE(0x0572, 0x2002)}, /* Cohiba Proto board */
698 ++ {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */
699 + {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
700 + {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
701 + {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
702 +@@ -80,6 +92,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
703 + {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */
704 + {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */
705 + {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
706 ++ {USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */
707 + {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */
708 + {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */
709 + {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */
710 +@@ -930,8 +943,8 @@ static int __devinit p54u_probe(struct usb_interface *intf,
711 + #ifdef CONFIG_PM
712 + /* ISL3887 needs a full reset on resume */
713 + udev->reset_resume = 1;
714 ++#endif /* CONFIG_PM */
715 + err = p54u_device_reset(dev);
716 +-#endif
717 +
718 + priv->hw_type = P54U_3887;
719 + dev->extra_tx_headroom += sizeof(struct lm87_tx_hdr);
720 +diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
721 +index b756e07..e8acb1c 100644
722 +--- a/drivers/platform/x86/asus-laptop.c
723 ++++ b/drivers/platform/x86/asus-laptop.c
724 +@@ -1065,9 +1065,9 @@ static ssize_t store_gps(struct device *dev, struct device_attribute *attr,
725 + */
726 + static int asus_gps_rfkill_set(void *data, bool blocked)
727 + {
728 +- acpi_handle handle = data;
729 ++ struct asus_laptop *asus = data;
730 +
731 +- return asus_gps_switch(handle, !blocked);
732 ++ return asus_gps_switch(asus, !blocked);
733 + }
734 +
735 + static const struct rfkill_ops asus_gps_rfkill_ops = {
736 +@@ -1094,7 +1094,7 @@ static int asus_rfkill_init(struct asus_laptop *asus)
737 +
738 + asus->gps_rfkill = rfkill_alloc("asus-gps", &asus->platform_device->dev,
739 + RFKILL_TYPE_GPS,
740 +- &asus_gps_rfkill_ops, NULL);
741 ++ &asus_gps_rfkill_ops, asus);
742 + if (!asus->gps_rfkill)
743 + return -EINVAL;
744 +
745 +diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
746 +index b860d65..4cf7ffa 100644
747 +--- a/drivers/scsi/gdth.c
748 ++++ b/drivers/scsi/gdth.c
749 +@@ -4175,6 +4175,14 @@ static int ioc_general(void __user *arg, char *cmnd)
750 + ha = gdth_find_ha(gen.ionode);
751 + if (!ha)
752 + return -EFAULT;
753 ++
754 ++ if (gen.data_len > INT_MAX)
755 ++ return -EINVAL;
756 ++ if (gen.sense_len > INT_MAX)
757 ++ return -EINVAL;
758 ++ if (gen.data_len + gen.sense_len > INT_MAX)
759 ++ return -EINVAL;
760 ++
761 + if (gen.data_len + gen.sense_len != 0) {
762 + if (!(buf = gdth_ioctl_alloc(ha, gen.data_len + gen.sense_len,
763 + FALSE, &paddr)))
764 +diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
765 +index 042153c..ddbade7 100644
766 +--- a/drivers/scsi/libsas/sas_ata.c
767 ++++ b/drivers/scsi/libsas/sas_ata.c
768 +@@ -347,6 +347,7 @@ static int sas_ata_scr_read(struct ata_link *link, unsigned int sc_reg_in,
769 + static struct ata_port_operations sas_sata_ops = {
770 + .phy_reset = sas_ata_phy_reset,
771 + .post_internal_cmd = sas_ata_post_internal,
772 ++ .qc_defer = ata_std_qc_defer,
773 + .qc_prep = ata_noop_qc_prep,
774 + .qc_issue = sas_ata_qc_issue,
775 + .qc_fill_rtf = sas_ata_qc_fill_rtf,
776 +diff --git a/drivers/scsi/pmcraid.h b/drivers/scsi/pmcraid.h
777 +index 6cfa014..dd78f9e 100644
778 +--- a/drivers/scsi/pmcraid.h
779 ++++ b/drivers/scsi/pmcraid.h
780 +@@ -568,7 +568,6 @@ struct pmcraid_cmd {
781 + struct pmcraid_control_block *ioa_cb;
782 + dma_addr_t ioa_cb_bus_addr;
783 + dma_addr_t dma_handle;
784 +- u8 *sense_buffer;
785 +
786 + /* pointer to mid layer structure of SCSI commands */
787 + struct scsi_cmnd *scsi_cmd;
788 +diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c
789 +index 5d4a382..449256f 100644
790 +--- a/drivers/scsi/qla4xxx/ql4_nx.c
791 ++++ b/drivers/scsi/qla4xxx/ql4_nx.c
792 +@@ -5,6 +5,7 @@
793 + * See LICENSE.qla4xxx for copyright and licensing details.
794 + */
795 + #include <linux/delay.h>
796 ++#include <linux/io.h>
797 + #include <linux/pci.h>
798 + #include "ql4_def.h"
799 + #include "ql4_glbl.h"
800 +diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
801 +index ee02d38..71c4cf7 100644
802 +--- a/drivers/scsi/scsi_lib.c
803 ++++ b/drivers/scsi/scsi_lib.c
804 +@@ -2428,7 +2428,8 @@ scsi_internal_device_unblock(struct scsi_device *sdev)
805 + sdev->sdev_state = SDEV_RUNNING;
806 + else if (sdev->sdev_state == SDEV_CREATED_BLOCK)
807 + sdev->sdev_state = SDEV_CREATED;
808 +- else
809 ++ else if (sdev->sdev_state != SDEV_CANCEL &&
810 ++ sdev->sdev_state != SDEV_OFFLINE)
811 + return -EINVAL;
812 +
813 + spin_lock_irqsave(q->queue_lock, flags);
814 +diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
815 +index c3f6737..7a0ca6f 100644
816 +--- a/drivers/scsi/scsi_sysfs.c
817 ++++ b/drivers/scsi/scsi_sysfs.c
818 +@@ -962,10 +962,11 @@ static void __scsi_remove_target(struct scsi_target *starget)
819 + list_for_each_entry(sdev, &shost->__devices, siblings) {
820 + if (sdev->channel != starget->channel ||
821 + sdev->id != starget->id ||
822 +- sdev->sdev_state == SDEV_DEL)
823 ++ scsi_device_get(sdev))
824 + continue;
825 + spin_unlock_irqrestore(shost->host_lock, flags);
826 + scsi_remove_device(sdev);
827 ++ scsi_device_put(sdev);
828 + spin_lock_irqsave(shost->host_lock, flags);
829 + goto restart;
830 + }
831 +diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
832 +index ffa0689..0eb0af5 100644
833 +--- a/drivers/scsi/sd.c
834 ++++ b/drivers/scsi/sd.c
835 +@@ -2252,11 +2252,10 @@ static void sd_probe_async(void *data, async_cookie_t cookie)
836 + index = sdkp->index;
837 + dev = &sdp->sdev_gendev;
838 +
839 +- if (index < SD_MAX_DISKS) {
840 +- gd->major = sd_major((index & 0xf0) >> 4);
841 +- gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);
842 +- gd->minors = SD_MINORS;
843 +- }
844 ++ gd->major = sd_major((index & 0xf0) >> 4);
845 ++ gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);
846 ++ gd->minors = SD_MINORS;
847 ++
848 + gd->fops = &sd_fops;
849 + gd->private_data = &sdkp->driver;
850 + gd->queue = sdkp->device->request_queue;
851 +@@ -2346,6 +2345,12 @@ static int sd_probe(struct device *dev)
852 + if (error)
853 + goto out_put;
854 +
855 ++ if (index >= SD_MAX_DISKS) {
856 ++ error = -ENODEV;
857 ++ sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name space exhausted.\n");
858 ++ goto out_free_index;
859 ++ }
860 ++
861 + error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN);
862 + if (error)
863 + goto out_free_index;
864 +diff --git a/drivers/staging/phison/phison.c b/drivers/staging/phison/phison.c
865 +index 42783d7..6771520 100644
866 +--- a/drivers/staging/phison/phison.c
867 ++++ b/drivers/staging/phison/phison.c
868 +@@ -62,7 +62,7 @@ static int phison_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
869 + };
870 + const struct ata_port_info *ppi[] = { &info, NULL };
871 +
872 +- ret = ata_pci_sff_init_one(pdev, ppi, &phison_sht, NULL, 0);
873 ++ ret = ata_pci_bmdma_init_one(pdev, ppi, &phison_sht, NULL, 0);
874 +
875 + dev_dbg(&pdev->dev, "phison_init_one(), ret = %x\n", ret);
876 +
877 +diff --git a/drivers/staging/usbip/usbip_event.c b/drivers/staging/usbip/usbip_event.c
878 +index a2566f1..af3832b 100644
879 +--- a/drivers/staging/usbip/usbip_event.c
880 ++++ b/drivers/staging/usbip/usbip_event.c
881 +@@ -38,21 +38,13 @@ static int event_handler(struct usbip_device *ud)
882 + ud->eh_ops.shutdown(ud);
883 +
884 + ud->event &= ~USBIP_EH_SHUTDOWN;
885 +-
886 +- break;
887 + }
888 +
889 +- /* Stop the error handler. */
890 +- if (ud->event & USBIP_EH_BYE)
891 +- return -1;
892 +-
893 + /* Reset the device. */
894 + if (ud->event & USBIP_EH_RESET) {
895 + ud->eh_ops.reset(ud);
896 +
897 + ud->event &= ~USBIP_EH_RESET;
898 +-
899 +- break;
900 + }
901 +
902 + /* Mark the device as unusable. */
903 +@@ -60,13 +52,11 @@ static int event_handler(struct usbip_device *ud)
904 + ud->eh_ops.unusable(ud);
905 +
906 + ud->event &= ~USBIP_EH_UNUSABLE;
907 +-
908 +- break;
909 + }
910 +
911 +- /* NOTREACHED */
912 +- printk(KERN_ERR "%s: unknown event\n", __func__);
913 +- return -1;
914 ++ /* Stop the error handler. */
915 ++ if (ud->event & USBIP_EH_BYE)
916 ++ return -1;
917 + }
918 +
919 + return 0;
920 +diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
921 +index 0574d84..832608d 100644
922 +--- a/drivers/staging/usbip/vhci_hcd.c
923 ++++ b/drivers/staging/usbip/vhci_hcd.c
924 +@@ -164,6 +164,8 @@ void rh_port_disconnect(int rhport)
925 + * spin_unlock(&vdev->ud.lock); */
926 +
927 + spin_unlock_irqrestore(&the_controller->lock, flags);
928 ++
929 ++ usb_hcd_poll_rh_status(vhci_to_hcd(the_controller));
930 + }
931 +
932 +
933 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
934 +index 84c18971..566c183 100644
935 +--- a/drivers/usb/core/hub.c
936 ++++ b/drivers/usb/core/hub.c
937 +@@ -2860,13 +2860,16 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
938 + else
939 + i = udev->descriptor.bMaxPacketSize0;
940 + if (le16_to_cpu(udev->ep0.desc.wMaxPacketSize) != i) {
941 +- if (udev->speed != USB_SPEED_FULL ||
942 ++ if (udev->speed == USB_SPEED_LOW ||
943 + !(i == 8 || i == 16 || i == 32 || i == 64)) {
944 +- dev_err(&udev->dev, "ep0 maxpacket = %d\n", i);
945 ++ dev_err(&udev->dev, "Invalid ep0 maxpacket: %d\n", i);
946 + retval = -EMSGSIZE;
947 + goto fail;
948 + }
949 +- dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
950 ++ if (udev->speed == USB_SPEED_FULL)
951 ++ dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
952 ++ else
953 ++ dev_warn(&udev->dev, "Using ep0 maxpacket: %d\n", i);
954 + udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i);
955 + usb_ep0_reinit(udev);
956 + }
957 +diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
958 +index 9f0ce7d..d6e3e41 100644
959 +--- a/drivers/usb/core/message.c
960 ++++ b/drivers/usb/core/message.c
961 +@@ -1140,13 +1140,6 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
962 + {
963 + int i;
964 +
965 +- dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
966 +- skip_ep0 ? "non-ep0" : "all");
967 +- for (i = skip_ep0; i < 16; ++i) {
968 +- usb_disable_endpoint(dev, i, true);
969 +- usb_disable_endpoint(dev, i + USB_DIR_IN, true);
970 +- }
971 +-
972 + /* getting rid of interfaces will disconnect
973 + * any drivers bound to them (a key side effect)
974 + */
975 +@@ -1176,6 +1169,13 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
976 + if (dev->state == USB_STATE_CONFIGURED)
977 + usb_set_device_state(dev, USB_STATE_ADDRESS);
978 + }
979 ++
980 ++ dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
981 ++ skip_ep0 ? "non-ep0" : "all");
982 ++ for (i = skip_ep0; i < 16; ++i) {
983 ++ usb_disable_endpoint(dev, i, true);
984 ++ usb_disable_endpoint(dev, i + USB_DIR_IN, true);
985 ++ }
986 + }
987 +
988 + /**
989 +diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
990 +index d623c7b..959f062 100644
991 +--- a/drivers/usb/gadget/atmel_usba_udc.c
992 ++++ b/drivers/usb/gadget/atmel_usba_udc.c
993 +@@ -2014,6 +2014,9 @@ static int __init usba_udc_probe(struct platform_device *pdev)
994 + } else {
995 + disable_irq(gpio_to_irq(udc->vbus_pin));
996 + }
997 ++ } else {
998 ++ /* gpio_request fail so use -EINVAL for gpio_is_valid */
999 ++ ubc->vbus_pin = -EINVAL;
1000 + }
1001 + }
1002 +
1003 +diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
1004 +index 1160c55..9a98c38 100644
1005 +--- a/drivers/usb/gadget/composite.c
1006 ++++ b/drivers/usb/gadget/composite.c
1007 +@@ -901,7 +901,8 @@ unknown:
1008 + */
1009 + switch (ctrl->bRequestType & USB_RECIP_MASK) {
1010 + case USB_RECIP_INTERFACE:
1011 +- f = cdev->config->interface[intf];
1012 ++ if (cdev->config)
1013 ++ f = cdev->config->interface[intf];
1014 + break;
1015 +
1016 + case USB_RECIP_ENDPOINT:
1017 +diff --git a/drivers/usb/gadget/f_acm.c b/drivers/usb/gadget/f_acm.c
1018 +index d47a123..bd6226c 100644
1019 +--- a/drivers/usb/gadget/f_acm.c
1020 ++++ b/drivers/usb/gadget/f_acm.c
1021 +@@ -111,7 +111,7 @@ acm_iad_descriptor = {
1022 + .bInterfaceCount = 2, // control + data
1023 + .bFunctionClass = USB_CLASS_COMM,
1024 + .bFunctionSubClass = USB_CDC_SUBCLASS_ACM,
1025 +- .bFunctionProtocol = USB_CDC_PROTO_NONE,
1026 ++ .bFunctionProtocol = USB_CDC_ACM_PROTO_AT_V25TER,
1027 + /* .iFunction = DYNAMIC */
1028 + };
1029 +
1030 +diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c
1031 +index a9474f8..3c2f0a4 100644
1032 +--- a/drivers/usb/gadget/g_ffs.c
1033 ++++ b/drivers/usb/gadget/g_ffs.c
1034 +@@ -53,8 +53,8 @@ MODULE_AUTHOR("Michal Nazarewicz");
1035 + MODULE_LICENSE("GPL");
1036 +
1037 +
1038 +-static unsigned short gfs_vendor_id = 0x0525; /* XXX NetChip */
1039 +-static unsigned short gfs_product_id = 0xa4ac; /* XXX */
1040 ++static unsigned short gfs_vendor_id = 0x1d6b; /* Linux Foundation */
1041 ++static unsigned short gfs_product_id = 0x0105; /* FunctionFS Gadget */
1042 +
1043 + static struct usb_device_descriptor gfs_dev_desc = {
1044 + .bLength = sizeof gfs_dev_desc,
1045 +diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c
1046 +index 795d762..36d67a3 100644
1047 +--- a/drivers/usb/gadget/multi.c
1048 ++++ b/drivers/usb/gadget/multi.c
1049 +@@ -74,8 +74,8 @@ MODULE_LICENSE("GPL");
1050 +
1051 + /***************************** Device Descriptor ****************************/
1052 +
1053 +-#define MULTI_VENDOR_NUM 0x0525 /* XXX NetChip */
1054 +-#define MULTI_PRODUCT_NUM 0xa4ab /* XXX */
1055 ++#define MULTI_VENDOR_NUM 0x1d6b /* Linux Foundation */
1056 ++#define MULTI_PRODUCT_NUM 0x0104 /* Multifunction Composite Gadget */
1057 +
1058 +
1059 + enum {
1060 +diff --git a/drivers/usb/host/r8a66597.h b/drivers/usb/host/r8a66597.h
1061 +index 95d0f5a..25563e9 100644
1062 +--- a/drivers/usb/host/r8a66597.h
1063 ++++ b/drivers/usb/host/r8a66597.h
1064 +@@ -227,7 +227,7 @@ static inline void r8a66597_write_fifo(struct r8a66597 *r8a66597,
1065 + int odd = len & 0x0001;
1066 +
1067 + len = len / 2;
1068 +- ioread16_rep(fifoaddr, buf, len);
1069 ++ iowrite16_rep(fifoaddr, buf, len);
1070 + if (unlikely(odd)) {
1071 + buf = &buf[len];
1072 + iowrite8((unsigned char)*buf, fifoaddr);
1073 +diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
1074 +index b611420..611a9d2 100644
1075 +--- a/drivers/usb/musb/blackfin.c
1076 ++++ b/drivers/usb/musb/blackfin.c
1077 +@@ -342,8 +342,10 @@ int __init musb_platform_init(struct musb *musb, void *board_data)
1078 +
1079 + usb_nop_xceiv_register();
1080 + musb->xceiv = otg_get_transceiver();
1081 +- if (!musb->xceiv)
1082 ++ if (!musb->xceiv) {
1083 ++ gpio_free(musb->config->gpio_vrsel);
1084 + return -ENODEV;
1085 ++ }
1086 +
1087 + if (ANOMALY_05000346) {
1088 + bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value);
1089 +@@ -394,8 +396,9 @@ int __init musb_platform_init(struct musb *musb, void *board_data)
1090 +
1091 + int musb_platform_exit(struct musb *musb)
1092 + {
1093 +-
1094 + gpio_free(musb->config->gpio_vrsel);
1095 +
1096 ++ otg_put_transceiver(musb->xceiv);
1097 ++ usb_nop_xceiv_unregister();
1098 + return 0;
1099 + }
1100 +diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
1101 +index 5762436..6e67629 100644
1102 +--- a/drivers/usb/musb/davinci.c
1103 ++++ b/drivers/usb/musb/davinci.c
1104 +@@ -446,6 +446,7 @@ int __init musb_platform_init(struct musb *musb, void *board_data)
1105 + fail:
1106 + clk_disable(musb->clock);
1107 +
1108 ++ otg_put_transceiver(musb->xceiv);
1109 + usb_nop_xceiv_unregister();
1110 + return -ENODEV;
1111 + }
1112 +@@ -496,6 +497,7 @@ int musb_platform_exit(struct musb *musb)
1113 +
1114 + clk_disable(musb->clock);
1115 +
1116 ++ otg_put_transceiver(musb->xceiv);
1117 + usb_nop_xceiv_unregister();
1118 +
1119 + return 0;
1120 +diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
1121 +index 540c766..513d6bd 100644
1122 +--- a/drivers/usb/musb/musb_core.c
1123 ++++ b/drivers/usb/musb/musb_core.c
1124 +@@ -1921,10 +1921,6 @@ static void musb_free(struct musb *musb)
1125 + dma_controller_destroy(c);
1126 + }
1127 +
1128 +-#ifdef CONFIG_USB_MUSB_OTG
1129 +- put_device(musb->xceiv->dev);
1130 +-#endif
1131 +-
1132 + #ifdef CONFIG_USB_MUSB_HDRC_HCD
1133 + usb_put_hcd(musb_to_hcd(musb));
1134 + #else
1135 +diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
1136 +index 2111a24..ed618bd 100644
1137 +--- a/drivers/usb/musb/omap2430.c
1138 ++++ b/drivers/usb/musb/omap2430.c
1139 +@@ -320,5 +320,6 @@ int musb_platform_exit(struct musb *musb)
1140 +
1141 + musb_platform_suspend(musb);
1142 +
1143 ++ otg_put_transceiver(musb->xceiv);
1144 + return 0;
1145 + }
1146 +diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
1147 +index 3c48e77..bde40ef 100644
1148 +--- a/drivers/usb/musb/tusb6010.c
1149 ++++ b/drivers/usb/musb/tusb6010.c
1150 +@@ -1152,6 +1152,8 @@ done:
1151 + if (ret < 0) {
1152 + if (sync)
1153 + iounmap(sync);
1154 ++
1155 ++ otg_put_transceiver(musb->xceiv);
1156 + usb_nop_xceiv_unregister();
1157 + }
1158 + return ret;
1159 +@@ -1166,6 +1168,8 @@ int musb_platform_exit(struct musb *musb)
1160 + musb->board_set_power(0);
1161 +
1162 + iounmap(musb->sync_va);
1163 ++
1164 ++ otg_put_transceiver(musb->xceiv);
1165 + usb_nop_xceiv_unregister();
1166 + return 0;
1167 + }
1168 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
1169 +index 4f1744c..8d7731d 100644
1170 +--- a/drivers/usb/serial/cp210x.c
1171 ++++ b/drivers/usb/serial/cp210x.c
1172 +@@ -54,6 +54,7 @@ static int cp210x_carrier_raised(struct usb_serial_port *p);
1173 + static int debug;
1174 +
1175 + static const struct usb_device_id id_table[] = {
1176 ++ { USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */
1177 + { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */
1178 + { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
1179 + { USB_DEVICE(0x0489, 0xE003) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
1180 +@@ -132,6 +133,7 @@ static const struct usb_device_id id_table[] = {
1181 + { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
1182 + { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
1183 + { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
1184 ++ { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
1185 + { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
1186 + { } /* Terminating Entry */
1187 + };
1188 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1189 +index 97cc87d..01ba740 100644
1190 +--- a/drivers/usb/serial/ftdi_sio.c
1191 ++++ b/drivers/usb/serial/ftdi_sio.c
1192 +@@ -177,6 +177,7 @@ static struct usb_device_id id_table_combined [] = {
1193 + { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_SNIFFER_PID) },
1194 + { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) },
1195 + { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) },
1196 ++ { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) },
1197 + { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
1198 + { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
1199 + { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
1200 +@@ -674,7 +675,6 @@ static struct usb_device_id id_table_combined [] = {
1201 + { USB_DEVICE(FTDI_VID, FTDI_RRCIRKITS_LOCOBUFFER_PID) },
1202 + { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) },
1203 + { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) },
1204 +- { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
1205 + { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) },
1206 + { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) },
1207 + { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) },
1208 +@@ -715,8 +715,37 @@ static struct usb_device_id id_table_combined [] = {
1209 + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1210 + { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) },
1211 + { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },
1212 ++
1213 ++ /* Papouch devices based on FTDI chip */
1214 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_PID) },
1215 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_PID) },
1216 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_PID) },
1217 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485_2_PID) },
1218 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AP485_2_PID) },
1219 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB422_2_PID) },
1220 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485S_PID) },
1221 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB485C_PID) },
1222 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_LEC_PID) },
1223 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SB232_PID) },
1224 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) },
1225 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_IRAMP_PID) },
1226 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK5_PID) },
1227 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO8x8_PID) },
1228 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO4x4_PID) },
1229 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x2_PID) },
1230 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO10x1_PID) },
1231 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO30x3_PID) },
1232 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO60x3_PID) },
1233 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO2x16_PID) },
1234 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_QUIDO3x32_PID) },
1235 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_DRAK6_PID) },
1236 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_UPSUSB_PID) },
1237 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_MU_PID) },
1238 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_SIMUKEY_PID) },
1239 + { USB_DEVICE(PAPOUCH_VID, PAPOUCH_AD4USB_PID) },
1240 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMUX_PID) },
1241 ++ { USB_DEVICE(PAPOUCH_VID, PAPOUCH_GMSR_PID) },
1242 ++
1243 + { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DGQG_PID) },
1244 + { USB_DEVICE(FTDI_VID, FTDI_DOMINTELL_DUSB_PID) },
1245 + { USB_DEVICE(ALTI2_VID, ALTI2_N3_PID) },
1246 +@@ -751,6 +780,7 @@ static struct usb_device_id id_table_combined [] = {
1247 + { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID),
1248 + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1249 + { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) },
1250 ++ { USB_DEVICE(FTDI_VID, ACCESIO_COM4SM_PID) },
1251 + { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID),
1252 + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1253 + { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) },
1254 +@@ -761,6 +791,9 @@ static struct usb_device_id id_table_combined [] = {
1255 + { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) },
1256 + { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) },
1257 + { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) },
1258 ++ { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) },
1259 ++ { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) },
1260 ++ { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) },
1261 + { }, /* Optional parameter entry */
1262 + { } /* Terminating entry */
1263 + };
1264 +@@ -2028,8 +2061,6 @@ static void ftdi_set_termios(struct tty_struct *tty,
1265 + "urb failed to set to rts/cts flow control\n");
1266 + }
1267 +
1268 +- /* raise DTR/RTS */
1269 +- set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
1270 + } else {
1271 + /*
1272 + * Xon/Xoff code
1273 +@@ -2077,8 +2108,6 @@ static void ftdi_set_termios(struct tty_struct *tty,
1274 + }
1275 + }
1276 +
1277 +- /* lower DTR/RTS */
1278 +- clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
1279 + }
1280 + return;
1281 + }
1282 +diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1283 +index 15a4583..cf1aea1b 100644
1284 +--- a/drivers/usb/serial/ftdi_sio_ids.h
1285 ++++ b/drivers/usb/serial/ftdi_sio_ids.h
1286 +@@ -61,6 +61,7 @@
1287 + #define FTDI_OPENDCC_SNIFFER_PID 0xBFD9
1288 + #define FTDI_OPENDCC_THROTTLE_PID 0xBFDA
1289 + #define FTDI_OPENDCC_GATEWAY_PID 0xBFDB
1290 ++#define FTDI_OPENDCC_GBM_PID 0xBFDC
1291 +
1292 + /*
1293 + * RR-CirKits LocoBuffer USB (http://www.rr-cirkits.com)
1294 +@@ -1022,9 +1023,34 @@
1295 + */
1296 +
1297 + #define PAPOUCH_VID 0x5050 /* Vendor ID */
1298 ++#define PAPOUCH_SB485_PID 0x0100 /* Papouch SB485 USB-485/422 Converter */
1299 ++#define PAPOUCH_AP485_PID 0x0101 /* AP485 USB-RS485 Converter */
1300 ++#define PAPOUCH_SB422_PID 0x0102 /* Papouch SB422 USB-RS422 Converter */
1301 ++#define PAPOUCH_SB485_2_PID 0x0103 /* Papouch SB485 USB-485/422 Converter */
1302 ++#define PAPOUCH_AP485_2_PID 0x0104 /* AP485 USB-RS485 Converter */
1303 ++#define PAPOUCH_SB422_2_PID 0x0105 /* Papouch SB422 USB-RS422 Converter */
1304 ++#define PAPOUCH_SB485S_PID 0x0106 /* Papouch SB485S USB-485/422 Converter */
1305 ++#define PAPOUCH_SB485C_PID 0x0107 /* Papouch SB485C USB-485/422 Converter */
1306 ++#define PAPOUCH_LEC_PID 0x0300 /* LEC USB Converter */
1307 ++#define PAPOUCH_SB232_PID 0x0301 /* Papouch SB232 USB-RS232 Converter */
1308 + #define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */
1309 +-#define PAPOUCH_QUIDO4x4_PID 0x0900 /* Quido 4/4 Module */
1310 ++#define PAPOUCH_IRAMP_PID 0x0500 /* Papouch IRAmp Duplex */
1311 ++#define PAPOUCH_DRAK5_PID 0x0700 /* Papouch DRAK5 */
1312 ++#define PAPOUCH_QUIDO8x8_PID 0x0800 /* Papouch Quido 8/8 Module */
1313 ++#define PAPOUCH_QUIDO4x4_PID 0x0900 /* Papouch Quido 4/4 Module */
1314 ++#define PAPOUCH_QUIDO2x2_PID 0x0a00 /* Papouch Quido 2/2 Module */
1315 ++#define PAPOUCH_QUIDO10x1_PID 0x0b00 /* Papouch Quido 10/1 Module */
1316 ++#define PAPOUCH_QUIDO30x3_PID 0x0c00 /* Papouch Quido 30/3 Module */
1317 ++#define PAPOUCH_QUIDO60x3_PID 0x0d00 /* Papouch Quido 60(100)/3 Module */
1318 ++#define PAPOUCH_QUIDO2x16_PID 0x0e00 /* Papouch Quido 2/16 Module */
1319 ++#define PAPOUCH_QUIDO3x32_PID 0x0f00 /* Papouch Quido 3/32 Module */
1320 ++#define PAPOUCH_DRAK6_PID 0x1000 /* Papouch DRAK6 */
1321 ++#define PAPOUCH_UPSUSB_PID 0x8000 /* Papouch UPS-USB adapter */
1322 ++#define PAPOUCH_MU_PID 0x8001 /* MU controller */
1323 ++#define PAPOUCH_SIMUKEY_PID 0x8002 /* Papouch SimuKey */
1324 + #define PAPOUCH_AD4USB_PID 0x8003 /* AD4USB Measurement Module */
1325 ++#define PAPOUCH_GMUX_PID 0x8004 /* Papouch GOLIATH MUX */
1326 ++#define PAPOUCH_GMSR_PID 0x8005 /* Papouch GOLIATH MSR */
1327 +
1328 + /*
1329 + * Marvell SheevaPlug
1330 +@@ -1063,3 +1089,14 @@
1331 + * Submitted by John G. Rogers
1332 + */
1333 + #define SEGWAY_RMP200_PID 0xe729
1334 ++
1335 ++
1336 ++/*
1337 ++ * Accesio USB Data Acquisition products (http://www.accesio.com/)
1338 ++ */
1339 ++#define ACCESIO_COM4SM_PID 0xD578
1340 ++
1341 ++/* www.sciencescope.co.uk educational dataloggers */
1342 ++#define FTDI_SCIENCESCOPE_LOGBOOKML_PID 0xFF18
1343 ++#define FTDI_SCIENCESCOPE_LS_LOGBOOK_PID 0xFF1C
1344 ++#define FTDI_SCIENCESCOPE_HS_LOGBOOK_PID 0xFF1D
1345 +diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
1346 +index 7aa01b9..2849f8c 100644
1347 +--- a/drivers/usb/serial/mct_u232.c
1348 ++++ b/drivers/usb/serial/mct_u232.c
1349 +@@ -549,9 +549,12 @@ static void mct_u232_close(struct usb_serial_port *port)
1350 + {
1351 + dbg("%s port %d", __func__, port->number);
1352 +
1353 +- usb_serial_generic_close(port);
1354 +- if (port->serial->dev)
1355 ++ if (port->serial->dev) {
1356 ++ /* shutdown our urbs */
1357 ++ usb_kill_urb(port->write_urb);
1358 ++ usb_kill_urb(port->read_urb);
1359 + usb_kill_urb(port->interrupt_in_urb);
1360 ++ }
1361 + } /* mct_u232_close */
1362 +
1363 +
1364 +diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
1365 +index ed01f3b..9ff19c8 100644
1366 +--- a/drivers/usb/serial/opticon.c
1367 ++++ b/drivers/usb/serial/opticon.c
1368 +@@ -96,8 +96,8 @@ static void opticon_bulk_callback(struct urb *urb)
1369 + /* real data, send it to the tty layer */
1370 + tty = tty_port_tty_get(&port->port);
1371 + if (tty) {
1372 +- tty_insert_flip_string(tty, data,
1373 +- data_length);
1374 ++ tty_insert_flip_string(tty, data + 2,
1375 ++ data_length);
1376 + tty_flip_buffer_push(tty);
1377 + tty_kref_put(tty);
1378 + }
1379 +@@ -130,7 +130,7 @@ exit:
1380 + priv->bulk_address),
1381 + priv->bulk_in_buffer, priv->buffer_size,
1382 + opticon_bulk_callback, priv);
1383 +- result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
1384 ++ result = usb_submit_urb(priv->bulk_read_urb, GFP_ATOMIC);
1385 + if (result)
1386 + dev_err(&port->dev,
1387 + "%s - failed resubmitting read urb, error %d\n",
1388 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1389 +index c46911a..51de0dd 100644
1390 +--- a/drivers/usb/serial/option.c
1391 ++++ b/drivers/usb/serial/option.c
1392 +@@ -622,6 +622,7 @@ static const struct usb_device_id option_ids[] = {
1393 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0011, 0xff, 0xff, 0xff) },
1394 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff) },
1395 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) },
1396 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) },
1397 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) },
1398 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) },
1399 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff) },
1400 +@@ -633,38 +634,52 @@ static const struct usb_device_id option_ids[] = {
1401 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0023, 0xff, 0xff, 0xff) },
1402 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) },
1403 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff) },
1404 +- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) },
1405 ++ /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) }, */
1406 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) },
1407 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) },
1408 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) },
1409 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626, 0xff, 0xff, 0xff) },
1410 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0032, 0xff, 0xff, 0xff) },
1411 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0033, 0xff, 0xff, 0xff) },
1412 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0034, 0xff, 0xff, 0xff) },
1413 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0037, 0xff, 0xff, 0xff) },
1414 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0038, 0xff, 0xff, 0xff) },
1415 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0039, 0xff, 0xff, 0xff) },
1416 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0040, 0xff, 0xff, 0xff) },
1417 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0042, 0xff, 0xff, 0xff) },
1418 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0043, 0xff, 0xff, 0xff) },
1419 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0044, 0xff, 0xff, 0xff) },
1420 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0048, 0xff, 0xff, 0xff) },
1421 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0049, 0xff, 0xff, 0xff) },
1422 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0050, 0xff, 0xff, 0xff) },
1423 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) },
1424 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff) },
1425 ++ /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0053, 0xff, 0xff, 0xff) }, */
1426 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) },
1427 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff) },
1428 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0056, 0xff, 0xff, 0xff) },
1429 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) },
1430 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff) },
1431 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
1432 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) },
1433 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) },
1434 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff) },
1435 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0064, 0xff, 0xff, 0xff) },
1436 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0065, 0xff, 0xff, 0xff) },
1437 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) },
1438 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0067, 0xff, 0xff, 0xff) },
1439 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) },
1440 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
1441 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) },
1442 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0077, 0xff, 0xff, 0xff) },
1443 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) },
1444 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0079, 0xff, 0xff, 0xff) },
1445 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0082, 0xff, 0xff, 0xff) },
1446 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0083, 0xff, 0xff, 0xff) },
1447 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0086, 0xff, 0xff, 0xff) },
1448 +- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) },
1449 +- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
1450 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0087, 0xff, 0xff, 0xff) },
1451 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff) },
1452 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xff) },
1453 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0106, 0xff, 0xff, 0xff) },
1454 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0108, 0xff, 0xff, 0xff) },
1455 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0113, 0xff, 0xff, 0xff) },
1456 +@@ -880,6 +895,8 @@ static const struct usb_device_id option_ids[] = {
1457 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
1458 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) },
1459 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) },
1460 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) },
1461 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
1462 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
1463 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
1464 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
1465 +diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
1466 +index eb76aae..15a5d89 100644
1467 +--- a/drivers/usb/serial/visor.c
1468 ++++ b/drivers/usb/serial/visor.c
1469 +@@ -606,6 +606,10 @@ static int treo_attach(struct usb_serial *serial)
1470 +
1471 + static int clie_5_attach(struct usb_serial *serial)
1472 + {
1473 ++ struct usb_serial_port *port;
1474 ++ unsigned int pipe;
1475 ++ int j;
1476 ++
1477 + dbg("%s", __func__);
1478 +
1479 + /* TH55 registers 2 ports.
1480 +@@ -621,9 +625,14 @@ static int clie_5_attach(struct usb_serial *serial)
1481 + return -1;
1482 +
1483 + /* port 0 now uses the modified endpoint Address */
1484 +- serial->port[0]->bulk_out_endpointAddress =
1485 ++ port = serial->port[0];
1486 ++ port->bulk_out_endpointAddress =
1487 + serial->port[1]->bulk_out_endpointAddress;
1488 +
1489 ++ pipe = usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress);
1490 ++ for (j = 0; j < ARRAY_SIZE(port->write_urbs); ++j)
1491 ++ port->write_urbs[j]->pipe = pipe;
1492 ++
1493 + return 0;
1494 + }
1495 +
1496 +diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
1497 +index 1d60c65..f110e0e 100644
1498 +--- a/fs/cifs/cifsproto.h
1499 ++++ b/fs/cifs/cifsproto.h
1500 +@@ -107,7 +107,8 @@ extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time,
1501 +
1502 + extern struct cifsFileInfo *cifs_new_fileinfo(struct inode *newinode,
1503 + __u16 fileHandle, struct file *file,
1504 +- struct vfsmount *mnt, unsigned int oflags);
1505 ++ struct vfsmount *mnt, unsigned int oflags,
1506 ++ __u32 oplock);
1507 + extern int cifs_posix_open(char *full_path, struct inode **pinode,
1508 + struct super_block *sb,
1509 + int mode, int oflags,
1510 +diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
1511 +index f9ed075..0f947bf 100644
1512 +--- a/fs/cifs/dir.c
1513 ++++ b/fs/cifs/dir.c
1514 +@@ -132,9 +132,9 @@ cifs_bp_rename_retry:
1515 +
1516 + struct cifsFileInfo *
1517 + cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle,
1518 +- struct file *file, struct vfsmount *mnt, unsigned int oflags)
1519 ++ struct file *file, struct vfsmount *mnt, unsigned int oflags,
1520 ++ __u32 oplock)
1521 + {
1522 +- int oplock = 0;
1523 + struct cifsFileInfo *pCifsFile;
1524 + struct cifsInodeInfo *pCifsInode;
1525 + struct cifs_sb_info *cifs_sb = CIFS_SB(mnt->mnt_sb);
1526 +@@ -143,9 +143,6 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle,
1527 + if (pCifsFile == NULL)
1528 + return pCifsFile;
1529 +
1530 +- if (oplockEnabled)
1531 +- oplock = REQ_OPLOCK;
1532 +-
1533 + pCifsFile->netfid = fileHandle;
1534 + pCifsFile->pid = current->tgid;
1535 + pCifsFile->pInode = igrab(newinode);
1536 +@@ -468,7 +465,7 @@ cifs_create_set_dentry:
1537 + }
1538 +
1539 + pfile_info = cifs_new_fileinfo(newinode, fileHandle, filp,
1540 +- nd->path.mnt, oflags);
1541 ++ nd->path.mnt, oflags, oplock);
1542 + if (pfile_info == NULL) {
1543 + fput(filp);
1544 + CIFSSMBClose(xid, tcon, fileHandle);
1545 +@@ -729,7 +726,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
1546 +
1547 + cfile = cifs_new_fileinfo(newInode, fileHandle, filp,
1548 + nd->path.mnt,
1549 +- nd->intent.open.flags);
1550 ++ nd->intent.open.flags,
1551 ++ oplock);
1552 + if (cfile == NULL) {
1553 + fput(filp);
1554 + CIFSSMBClose(xid, pTcon, fileHandle);
1555 +diff --git a/fs/cifs/file.c b/fs/cifs/file.c
1556 +index de748c6..681761c 100644
1557 +--- a/fs/cifs/file.c
1558 ++++ b/fs/cifs/file.c
1559 +@@ -277,7 +277,7 @@ int cifs_open(struct inode *inode, struct file *file)
1560 +
1561 + pCifsFile = cifs_new_fileinfo(inode, netfid, file,
1562 + file->f_path.mnt,
1563 +- oflags);
1564 ++ oflags, oplock);
1565 + if (pCifsFile == NULL) {
1566 + CIFSSMBClose(xid, tcon, netfid);
1567 + rc = -ENOMEM;
1568 +@@ -370,7 +370,7 @@ int cifs_open(struct inode *inode, struct file *file)
1569 + goto out;
1570 +
1571 + pCifsFile = cifs_new_fileinfo(inode, netfid, file, file->f_path.mnt,
1572 +- file->f_flags);
1573 ++ file->f_flags, oplock);
1574 + if (pCifsFile == NULL) {
1575 + rc = -ENOMEM;
1576 + goto out;
1577 +diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
1578 +index 064a809..84d3c8b 100644
1579 +--- a/fs/nfs/direct.c
1580 ++++ b/fs/nfs/direct.c
1581 +@@ -873,7 +873,7 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov,
1582 + dreq->inode = inode;
1583 + dreq->ctx = get_nfs_open_context(nfs_file_open_context(iocb->ki_filp));
1584 + dreq->l_ctx = nfs_get_lock_context(dreq->ctx);
1585 +- if (dreq->l_ctx != NULL)
1586 ++ if (dreq->l_ctx == NULL)
1587 + goto out_release;
1588 + if (!is_sync_kiocb(iocb))
1589 + dreq->iocb = iocb;
1590 +diff --git a/fs/pipe.c b/fs/pipe.c
1591 +index 279eef9..37eb1eb 100644
1592 +--- a/fs/pipe.c
1593 ++++ b/fs/pipe.c
1594 +@@ -382,7 +382,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
1595 + error = ops->confirm(pipe, buf);
1596 + if (error) {
1597 + if (!ret)
1598 +- error = ret;
1599 ++ ret = error;
1600 + break;
1601 + }
1602 +
1603 +diff --git a/kernel/futex.c b/kernel/futex.c
1604 +index 6a3a5fa..e328f57 100644
1605 +--- a/kernel/futex.c
1606 ++++ b/kernel/futex.c
1607 +@@ -1363,7 +1363,6 @@ static inline struct futex_hash_bucket *queue_lock(struct futex_q *q)
1608 + {
1609 + struct futex_hash_bucket *hb;
1610 +
1611 +- get_futex_key_refs(&q->key);
1612 + hb = hash_futex(&q->key);
1613 + q->lock_ptr = &hb->lock;
1614 +
1615 +@@ -1375,7 +1374,6 @@ static inline void
1616 + queue_unlock(struct futex_q *q, struct futex_hash_bucket *hb)
1617 + {
1618 + spin_unlock(&hb->lock);
1619 +- drop_futex_key_refs(&q->key);
1620 + }
1621 +
1622 + /**
1623 +@@ -1480,8 +1478,6 @@ static void unqueue_me_pi(struct futex_q *q)
1624 + q->pi_state = NULL;
1625 +
1626 + spin_unlock(q->lock_ptr);
1627 +-
1628 +- drop_futex_key_refs(&q->key);
1629 + }
1630 +
1631 + /*
1632 +@@ -1812,7 +1808,10 @@ static int futex_wait(u32 __user *uaddr, int fshared,
1633 + }
1634 +
1635 + retry:
1636 +- /* Prepare to wait on uaddr. */
1637 ++ /*
1638 ++ * Prepare to wait on uaddr. On success, holds hb lock and increments
1639 ++ * q.key refs.
1640 ++ */
1641 + ret = futex_wait_setup(uaddr, val, fshared, &q, &hb);
1642 + if (ret)
1643 + goto out;
1644 +@@ -1822,24 +1821,23 @@ retry:
1645 +
1646 + /* If we were woken (and unqueued), we succeeded, whatever. */
1647 + ret = 0;
1648 ++ /* unqueue_me() drops q.key ref */
1649 + if (!unqueue_me(&q))
1650 +- goto out_put_key;
1651 ++ goto out;
1652 + ret = -ETIMEDOUT;
1653 + if (to && !to->task)
1654 +- goto out_put_key;
1655 ++ goto out;
1656 +
1657 + /*
1658 + * We expect signal_pending(current), but we might be the
1659 + * victim of a spurious wakeup as well.
1660 + */
1661 +- if (!signal_pending(current)) {
1662 +- put_futex_key(fshared, &q.key);
1663 ++ if (!signal_pending(current))
1664 + goto retry;
1665 +- }
1666 +
1667 + ret = -ERESTARTSYS;
1668 + if (!abs_time)
1669 +- goto out_put_key;
1670 ++ goto out;
1671 +
1672 + restart = &current_thread_info()->restart_block;
1673 + restart->fn = futex_wait_restart;
1674 +@@ -1856,8 +1854,6 @@ retry:
1675 +
1676 + ret = -ERESTART_RESTARTBLOCK;
1677 +
1678 +-out_put_key:
1679 +- put_futex_key(fshared, &q.key);
1680 + out:
1681 + if (to) {
1682 + hrtimer_cancel(&to->timer);
1683 +@@ -2236,7 +2232,10 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared,
1684 + q.rt_waiter = &rt_waiter;
1685 + q.requeue_pi_key = &key2;
1686 +
1687 +- /* Prepare to wait on uaddr. */
1688 ++ /*
1689 ++ * Prepare to wait on uaddr. On success, increments q.key (key1) ref
1690 ++ * count.
1691 ++ */
1692 + ret = futex_wait_setup(uaddr, val, fshared, &q, &hb);
1693 + if (ret)
1694 + goto out_key2;
1695 +@@ -2254,7 +2253,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared,
1696 + * In order for us to be here, we know our q.key == key2, and since
1697 + * we took the hb->lock above, we also know that futex_requeue() has
1698 + * completed and we no longer have to concern ourselves with a wakeup
1699 +- * race with the atomic proxy lock acquition by the requeue code.
1700 ++ * race with the atomic proxy lock acquisition by the requeue code. The
1701 ++ * futex_requeue dropped our key1 reference and incremented our key2
1702 ++ * reference count.
1703 + */
1704 +
1705 + /* Check if the requeue code acquired the second futex for us. */
1706 +diff --git a/kernel/perf_event.c b/kernel/perf_event.c
1707 +index b98bed3..03bb897 100644
1708 +--- a/kernel/perf_event.c
1709 ++++ b/kernel/perf_event.c
1710 +@@ -1773,7 +1773,13 @@ static u64 perf_event_read(struct perf_event *event)
1711 + unsigned long flags;
1712 +
1713 + raw_spin_lock_irqsave(&ctx->lock, flags);
1714 +- update_context_time(ctx);
1715 ++ /*
1716 ++ * may read while context is not active
1717 ++ * (e.g., thread is blocked), in that case
1718 ++ * we cannot update context time
1719 ++ */
1720 ++ if (ctx->is_active)
1721 ++ update_context_time(ctx);
1722 + update_event_times(event);
1723 + raw_spin_unlock_irqrestore(&ctx->lock, flags);
1724 + }
1725 +diff --git a/kernel/sched.c b/kernel/sched.c
1726 +index dc85ceb..3fd774c 100644
1727 +--- a/kernel/sched.c
1728 ++++ b/kernel/sched.c
1729 +@@ -723,7 +723,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
1730 + size_t cnt, loff_t *ppos)
1731 + {
1732 + char buf[64];
1733 +- char *cmp = buf;
1734 ++ char *cmp;
1735 + int neg = 0;
1736 + int i;
1737 +
1738 +@@ -734,6 +734,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
1739 + return -EFAULT;
1740 +
1741 + buf[cnt] = 0;
1742 ++ cmp = strstrip(buf);
1743 +
1744 + if (strncmp(buf, "NO_", 3) == 0) {
1745 + neg = 1;
1746 +@@ -741,9 +742,7 @@ sched_feat_write(struct file *filp, const char __user *ubuf,
1747 + }
1748 +
1749 + for (i = 0; sched_feat_names[i]; i++) {
1750 +- int len = strlen(sched_feat_names[i]);
1751 +-
1752 +- if (strncmp(cmp, sched_feat_names[i], len) == 0) {
1753 ++ if (strcmp(cmp, sched_feat_names[i]) == 0) {
1754 + if (neg)
1755 + sysctl_sched_features &= ~(1UL << i);
1756 + else
1757 +@@ -1858,12 +1857,6 @@ static void dec_nr_running(struct rq *rq)
1758 +
1759 + static void set_load_weight(struct task_struct *p)
1760 + {
1761 +- if (task_has_rt_policy(p)) {
1762 +- p->se.load.weight = 0;
1763 +- p->se.load.inv_weight = WMULT_CONST;
1764 +- return;
1765 +- }
1766 +-
1767 + /*
1768 + * SCHED_IDLE tasks get minimal weight:
1769 + */
1770 +diff --git a/mm/vmalloc.c b/mm/vmalloc.c
1771 +index 6b8889d..d8087f0 100644
1772 +--- a/mm/vmalloc.c
1773 ++++ b/mm/vmalloc.c
1774 +@@ -517,6 +517,15 @@ static atomic_t vmap_lazy_nr = ATOMIC_INIT(0);
1775 + static void purge_fragmented_blocks_allcpus(void);
1776 +
1777 + /*
1778 ++ * called before a call to iounmap() if the caller wants vm_area_struct's
1779 ++ * immediately freed.
1780 ++ */
1781 ++void set_iounmap_nonlazy(void)
1782 ++{
1783 ++ atomic_set(&vmap_lazy_nr, lazy_max_pages()+1);
1784 ++}
1785 ++
1786 ++/*
1787 + * Purges all lazily-freed vmap areas.
1788 + *
1789 + * If sync is 0 then don't purge if there is already a purge in progress.
1790 +diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
1791 +index 0b54b7d..dc60205 100644
1792 +--- a/net/bluetooth/l2cap.c
1793 ++++ b/net/bluetooth/l2cap.c
1794 +@@ -2891,7 +2891,7 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
1795 + struct l2cap_chan_list *list = &conn->chan_list;
1796 + struct l2cap_conn_req *req = (struct l2cap_conn_req *) data;
1797 + struct l2cap_conn_rsp rsp;
1798 +- struct sock *parent, *uninitialized_var(sk);
1799 ++ struct sock *parent, *sk = NULL;
1800 + int result, status = L2CAP_CS_NO_INFO;
1801 +
1802 + u16 dcid = 0, scid = __le16_to_cpu(req->scid);
1803 +@@ -3000,7 +3000,7 @@ sendresp:
1804 + L2CAP_INFO_REQ, sizeof(info), &info);
1805 + }
1806 +
1807 +- if (!(l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT) &&
1808 ++ if (sk && !(l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT) &&
1809 + result == L2CAP_CR_SUCCESS) {
1810 + u8 buf[128];
1811 + l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT;
1812 +diff --git a/net/netfilter/xt_SECMARK.c b/net/netfilter/xt_SECMARK.c
1813 +index 23b2d6c..364ad16 100644
1814 +--- a/net/netfilter/xt_SECMARK.c
1815 ++++ b/net/netfilter/xt_SECMARK.c
1816 +@@ -101,7 +101,7 @@ static int secmark_tg_check(const struct xt_tgchk_param *par)
1817 + switch (info->mode) {
1818 + case SECMARK_MODE_SEL:
1819 + err = checkentry_selinux(info);
1820 +- if (err <= 0)
1821 ++ if (err)
1822 + return err;
1823 + break;
1824 +
1825
1826 Deleted: genpatches-2.6/trunk/2.6.36/1800_automated-per-tty-task-groups.patch
1827 ===================================================================
1828 --- genpatches-2.6/trunk/2.6.36/1800_automated-per-tty-task-groups.patch 2010-11-21 00:34:02 UTC (rev 1827)
1829 +++ genpatches-2.6/trunk/2.6.36/1800_automated-per-tty-task-groups.patch 2010-11-22 22:45:50 UTC (rev 1828)
1830 @@ -1,533 +0,0 @@
1831 -Index: linux-2.6.36/include/linux/sched.h
1832 -===================================================================
1833 ---- linux-2.6.36.orig/include/linux/sched.h
1834 -+++ linux-2.6.36/include/linux/sched.h
1835 -@@ -506,6 +506,8 @@ struct thread_group_cputimer {
1836 - spinlock_t lock;
1837 - };
1838 -
1839 -+struct autogroup;
1840 -+
1841 - /*
1842 - * NOTE! "signal_struct" does not have it's own
1843 - * locking, because a shared signal_struct always
1844 -@@ -573,6 +575,9 @@ struct signal_struct {
1845 -
1846 - struct tty_struct *tty; /* NULL if no tty */
1847 -
1848 -+#ifdef CONFIG_SCHED_AUTOGROUP
1849 -+ struct autogroup *autogroup;
1850 -+#endif
1851 - /*
1852 - * Cumulative resource counters for dead threads in the group,
1853 - * and for reaped dead child processes forked by this group.
1854 -@@ -1900,6 +1905,20 @@ int sched_rt_handler(struct ctl_table *t
1855 -
1856 - extern unsigned int sysctl_sched_compat_yield;
1857 -
1858 -+#ifdef CONFIG_SCHED_AUTOGROUP
1859 -+extern unsigned int sysctl_sched_autogroup_enabled;
1860 -+
1861 -+extern void sched_autogroup_create_attach(struct task_struct *p);
1862 -+extern void sched_autogroup_detach(struct task_struct *p);
1863 -+extern void sched_autogroup_fork(struct signal_struct *sig);
1864 -+extern void sched_autogroup_exit(struct signal_struct *sig);
1865 -+#else
1866 -+static inline void sched_autogroup_create_attach(struct task_struct *p) { }
1867 -+static inline void sched_autogroup_detach(struct task_struct *p) { }
1868 -+static inline void sched_autogroup_fork(struct signal_struct *sig) { }
1869 -+static inline void sched_autogroup_exit(struct signal_struct *sig) { }
1870 -+#endif
1871 -+
1872 - #ifdef CONFIG_RT_MUTEXES
1873 - extern int rt_mutex_getprio(struct task_struct *p);
1874 - extern void rt_mutex_setprio(struct task_struct *p, int prio);
1875 -Index: linux-2.6.36/kernel/sched.c
1876 -===================================================================
1877 ---- linux-2.6.36.orig/kernel/sched.c
1878 -+++ linux-2.6.36/kernel/sched.c
1879 -@@ -78,6 +78,7 @@
1880 -
1881 - #include "sched_cpupri.h"
1882 - #include "workqueue_sched.h"
1883 -+#include "sched_autogroup.h"
1884 -
1885 - #define CREATE_TRACE_POINTS
1886 - #include <trace/events/sched.h>
1887 -@@ -268,6 +269,10 @@ struct task_group {
1888 - struct task_group *parent;
1889 - struct list_head siblings;
1890 - struct list_head children;
1891 -+
1892 -+#if defined(CONFIG_SCHED_AUTOGROUP)
1893 -+ struct autogroup *autogroup;
1894 -+#endif
1895 - };
1896 -
1897 - #define root_task_group init_task_group
1898 -@@ -612,11 +617,14 @@ static inline int cpu_of(struct rq *rq)
1899 - */
1900 - static inline struct task_group *task_group(struct task_struct *p)
1901 - {
1902 -+ struct task_group *tg;
1903 - struct cgroup_subsys_state *css;
1904 -
1905 - css = task_subsys_state_check(p, cpu_cgroup_subsys_id,
1906 - lockdep_is_held(&task_rq(p)->lock));
1907 -- return container_of(css, struct task_group, css);
1908 -+ tg = container_of(css, struct task_group, css);
1909 -+
1910 -+ return autogroup_task_group(p, tg);
1911 - }
1912 -
1913 - /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
1914 -@@ -1920,6 +1928,7 @@ static void deactivate_task(struct rq *r
1915 - #include "sched_idletask.c"
1916 - #include "sched_fair.c"
1917 - #include "sched_rt.c"
1918 -+#include "sched_autogroup.c"
1919 - #ifdef CONFIG_SCHED_DEBUG
1920 - # include "sched_debug.c"
1921 - #endif
1922 -@@ -7749,7 +7758,7 @@ void __init sched_init(void)
1923 - #ifdef CONFIG_CGROUP_SCHED
1924 - list_add(&init_task_group.list, &task_groups);
1925 - INIT_LIST_HEAD(&init_task_group.children);
1926 --
1927 -+ autogroup_init(&init_task);
1928 - #endif /* CONFIG_CGROUP_SCHED */
1929 -
1930 - #if defined CONFIG_FAIR_GROUP_SCHED && defined CONFIG_SMP
1931 -Index: linux-2.6.36/kernel/fork.c
1932 -===================================================================
1933 ---- linux-2.6.36.orig/kernel/fork.c
1934 -+++ linux-2.6.36/kernel/fork.c
1935 -@@ -173,8 +173,10 @@ static inline void free_signal_struct(st
1936 -
1937 - static inline void put_signal_struct(struct signal_struct *sig)
1938 - {
1939 -- if (atomic_dec_and_test(&sig->sigcnt))
1940 -+ if (atomic_dec_and_test(&sig->sigcnt)) {
1941 -+ sched_autogroup_exit(sig);
1942 - free_signal_struct(sig);
1943 -+ }
1944 - }
1945 -
1946 - void __put_task_struct(struct task_struct *tsk)
1947 -@@ -900,6 +902,7 @@ static int copy_signal(unsigned long clo
1948 - posix_cpu_timers_init_group(sig);
1949 -
1950 - tty_audit_fork(sig);
1951 -+ sched_autogroup_fork(sig);
1952 -
1953 - sig->oom_adj = current->signal->oom_adj;
1954 - sig->oom_score_adj = current->signal->oom_score_adj;
1955 -Index: linux-2.6.36/kernel/sys.c
1956 -===================================================================
1957 ---- linux-2.6.36.orig/kernel/sys.c
1958 -+++ linux-2.6.36/kernel/sys.c
1959 -@@ -1080,8 +1080,10 @@ SYSCALL_DEFINE0(setsid)
1960 - err = session;
1961 - out:
1962 - write_unlock_irq(&tasklist_lock);
1963 -- if (err > 0)
1964 -+ if (err > 0) {
1965 - proc_sid_connector(group_leader);
1966 -+ sched_autogroup_create_attach(group_leader);
1967 -+ }
1968 - return err;
1969 - }
1970 -
1971 -Index: linux-2.6.36/kernel/sched_debug.c
1972 -===================================================================
1973 ---- linux-2.6.36.orig/kernel/sched_debug.c
1974 -+++ linux-2.6.36/kernel/sched_debug.c
1975 -@@ -87,6 +87,20 @@ static void print_cfs_group_stats(struct
1976 - }
1977 - #endif
1978 -
1979 -+#if defined(CONFIG_CGROUP_SCHED) && \
1980 -+ (defined(CONFIG_FAIR_GROUP_SCHED) || defined(CONFIG_RT_GROUP_SCHED))
1981 -+static void task_group_path(struct task_group *tg, char *buf, int buflen)
1982 -+{
1983 -+ /* may be NULL if the underlying cgroup isn't fully-created yet */
1984 -+ if (!tg->css.cgroup) {
1985 -+ buf[0] = '\0';
1986 -+ autogroup_path(tg, buf, buflen);
1987 -+ return;
1988 -+ }
1989 -+ cgroup_path(tg->css.cgroup, buf, buflen);
1990 -+}
1991 -+#endif
1992 -+
1993 - static void
1994 - print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
1995 - {
1996 -@@ -115,7 +129,7 @@ print_task(struct seq_file *m, struct rq
1997 - char path[64];
1998 -
1999 - rcu_read_lock();
2000 -- cgroup_path(task_group(p)->css.cgroup, path, sizeof(path));
2001 -+ task_group_path(task_group(p), path, sizeof(path));
2002 - rcu_read_unlock();
2003 - SEQ_printf(m, " %s", path);
2004 - }
2005 -@@ -147,19 +161,6 @@ static void print_rq(struct seq_file *m,
2006 - read_unlock_irqrestore(&tasklist_lock, flags);
2007 - }
2008 -
2009 --#if defined(CONFIG_CGROUP_SCHED) && \
2010 -- (defined(CONFIG_FAIR_GROUP_SCHED) || defined(CONFIG_RT_GROUP_SCHED))
2011 --static void task_group_path(struct task_group *tg, char *buf, int buflen)
2012 --{
2013 -- /* may be NULL if the underlying cgroup isn't fully-created yet */
2014 -- if (!tg->css.cgroup) {
2015 -- buf[0] = '\0';
2016 -- return;
2017 -- }
2018 -- cgroup_path(tg->css.cgroup, buf, buflen);
2019 --}
2020 --#endif
2021 --
2022 - void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
2023 - {
2024 - s64 MIN_vruntime = -1, min_vruntime, max_vruntime = -1,
2025 -Index: linux-2.6.36/kernel/sched_autogroup.h
2026 -===================================================================
2027 ---- /dev/null
2028 -+++ linux-2.6.36/kernel/sched_autogroup.h
2029 -@@ -0,0 +1,23 @@
2030 -+#ifdef CONFIG_SCHED_AUTOGROUP
2031 -+
2032 -+static inline struct task_group *
2033 -+autogroup_task_group(struct task_struct *p, struct task_group *tg);
2034 -+
2035 -+#else /* !CONFIG_SCHED_AUTOGROUP */
2036 -+
2037 -+static inline void autogroup_init(struct task_struct *init_task) { }
2038 -+
2039 -+static inline struct task_group *
2040 -+autogroup_task_group(struct task_struct *p, struct task_group *tg)
2041 -+{
2042 -+ return tg;
2043 -+}
2044 -+
2045 -+#ifdef CONFIG_SCHED_DEBUG
2046 -+static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
2047 -+{
2048 -+ return 0;
2049 -+}
2050 -+#endif
2051 -+
2052 -+#endif /* CONFIG_SCHED_AUTOGROUP */
2053 -Index: linux-2.6.36/kernel/sched_autogroup.c
2054 -===================================================================
2055 ---- /dev/null
2056 -+++ linux-2.6.36/kernel/sched_autogroup.c
2057 -@@ -0,0 +1,170 @@
2058 -+#ifdef CONFIG_SCHED_AUTOGROUP
2059 -+
2060 -+unsigned int __read_mostly sysctl_sched_autogroup_enabled = 1;
2061 -+
2062 -+struct autogroup {
2063 -+ struct task_group *tg;
2064 -+ struct kref kref;
2065 -+ unsigned long id;
2066 -+};
2067 -+
2068 -+static struct autogroup autogroup_default;
2069 -+static atomic_t autogroup_seq_nr;
2070 -+
2071 -+static void autogroup_init(struct task_struct *init_task)
2072 -+{
2073 -+ autogroup_default.tg = &init_task_group;
2074 -+ autogroup_default.id = 0;
2075 -+ atomic_set(&autogroup_seq_nr, 1);
2076 -+ kref_init(&autogroup_default.kref);
2077 -+ init_task->signal->autogroup = &autogroup_default;
2078 -+}
2079 -+
2080 -+static inline void autogroup_destroy(struct kref *kref)
2081 -+{
2082 -+ struct autogroup *ag = container_of(kref, struct autogroup, kref);
2083 -+ struct task_group *tg = ag->tg;
2084 -+
2085 -+ kfree(ag);
2086 -+ sched_destroy_group(tg);
2087 -+}
2088 -+
2089 -+static inline void autogroup_kref_put(struct autogroup *ag)
2090 -+{
2091 -+ kref_put(&ag->kref, autogroup_destroy);
2092 -+}
2093 -+
2094 -+static inline struct autogroup *autogroup_kref_get(struct autogroup *ag)
2095 -+{
2096 -+ kref_get(&ag->kref);
2097 -+ return ag;
2098 -+}
2099 -+
2100 -+static inline struct autogroup *autogroup_create(void)
2101 -+{
2102 -+ struct autogroup *ag = kmalloc(sizeof(*ag), GFP_KERNEL);
2103 -+
2104 -+ if (!ag)
2105 -+ goto out_fail;
2106 -+
2107 -+ ag->tg = sched_create_group(&init_task_group);
2108 -+
2109 -+ if (IS_ERR(ag->tg))
2110 -+ goto out_fail;
2111 -+
2112 -+ kref_init(&ag->kref);
2113 -+ ag->tg->autogroup = ag;
2114 -+ ag->id = atomic_inc_return(&autogroup_seq_nr);
2115 -+
2116 -+ return ag;
2117 -+
2118 -+out_fail:
2119 -+ if (ag) {
2120 -+ kfree(ag);
2121 -+ WARN_ON(1);
2122 -+ } else
2123 -+ WARN_ON(1);
2124 -+
2125 -+ return autogroup_kref_get(&autogroup_default);
2126 -+}
2127 -+
2128 -+static inline bool
2129 -+task_wants_autogroup(struct task_struct *p, struct task_group *tg)
2130 -+{
2131 -+ if (tg != &root_task_group)
2132 -+ return false;
2133 -+
2134 -+ if (p->sched_class != &fair_sched_class)
2135 -+ return false;
2136 -+
2137 -+ if (p->flags & PF_EXITING)
2138 -+ return false;
2139 -+
2140 -+ return true;
2141 -+}
2142 -+
2143 -+static inline struct task_group *
2144 -+autogroup_task_group(struct task_struct *p, struct task_group *tg)
2145 -+{
2146 -+ int enabled = ACCESS_ONCE(sysctl_sched_autogroup_enabled);
2147 -+
2148 -+ if (enabled && task_wants_autogroup(p, tg))
2149 -+ return p->signal->autogroup->tg;
2150 -+
2151 -+ return tg;
2152 -+}
2153 -+
2154 -+static void
2155 -+autogroup_move_group(struct task_struct *p, struct autogroup *ag)
2156 -+{
2157 -+ struct autogroup *prev;
2158 -+ struct task_struct *t;
2159 -+
2160 -+ spin_lock(&p->sighand->siglock);
2161 -+
2162 -+ prev = p->signal->autogroup;
2163 -+ if (prev == ag) {
2164 -+ spin_unlock(&p->sighand->siglock);
2165 -+ return;
2166 -+ }
2167 -+
2168 -+ p->signal->autogroup = autogroup_kref_get(ag);
2169 -+ t = p;
2170 -+
2171 -+ do {
2172 -+ sched_move_task(p);
2173 -+ } while_each_thread(p, t);
2174 -+
2175 -+ spin_unlock(&p->sighand->siglock);
2176 -+
2177 -+ autogroup_kref_put(prev);
2178 -+}
2179 -+
2180 -+/* Allocates GFP_KERNEL, cannot be called under any spinlock */
2181 -+void sched_autogroup_create_attach(struct task_struct *p)
2182 -+{
2183 -+ struct autogroup *ag = autogroup_create();
2184 -+
2185 -+ autogroup_move_group(p, ag);
2186 -+ /* drop extra refrence added by autogroup_create() */
2187 -+ autogroup_kref_put(ag);
2188 -+}
2189 -+EXPORT_SYMBOL(sched_autogroup_create_attach);
2190 -+
2191 -+/* Cannot be called under siglock. Currently has no users */
2192 -+void sched_autogroup_detach(struct task_struct *p)
2193 -+{
2194 -+ autogroup_move_group(p, &autogroup_default);
2195 -+}
2196 -+EXPORT_SYMBOL(sched_autogroup_detach);
2197 -+
2198 -+void sched_autogroup_fork(struct signal_struct *sig)
2199 -+{
2200 -+ struct sighand_struct *sighand = current->sighand;
2201 -+
2202 -+ spin_lock(&sighand->siglock);
2203 -+ sig->autogroup = autogroup_kref_get(current->signal->autogroup);
2204 -+ spin_unlock(&sighand->siglock);
2205 -+}
2206 -+
2207 -+void sched_autogroup_exit(struct signal_struct *sig)
2208 -+{
2209 -+ autogroup_kref_put(sig->autogroup);
2210 -+}
2211 -+
2212 -+static int __init setup_autogroup(char *str)
2213 -+{
2214 -+ sysctl_sched_autogroup_enabled = 0;
2215 -+
2216 -+ return 1;
2217 -+}
2218 -+
2219 -+__setup("noautogroup", setup_autogroup);
2220 -+
2221 -+#ifdef CONFIG_SCHED_DEBUG
2222 -+static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
2223 -+{
2224 -+ return snprintf(buf, buflen, "%s-%ld", "autogroup", tg->autogroup->id);
2225 -+}
2226 -+#endif
2227 -+#endif /* CONFIG_SCHED_AUTOGROUP */
2228 -Index: linux-2.6.36/kernel/sysctl.c
2229 -===================================================================
2230 ---- linux-2.6.36.orig/kernel/sysctl.c
2231 -+++ linux-2.6.36/kernel/sysctl.c
2232 -@@ -384,6 +384,17 @@ static struct ctl_table kern_table[] = {
2233 - .mode = 0644,
2234 - .proc_handler = proc_dointvec,
2235 - },
2236 -+#ifdef CONFIG_SCHED_AUTOGROUP
2237 -+ {
2238 -+ .procname = "sched_autogroup_enabled",
2239 -+ .data = &sysctl_sched_autogroup_enabled,
2240 -+ .maxlen = sizeof(unsigned int),
2241 -+ .mode = 0644,
2242 -+ .proc_handler = proc_dointvec,
2243 -+ .extra1 = &zero,
2244 -+ .extra2 = &one,
2245 -+ },
2246 -+#endif
2247 - #ifdef CONFIG_PROVE_LOCKING
2248 - {
2249 - .procname = "prove_locking",
2250 -Index: linux-2.6.36/init/Kconfig
2251 -===================================================================
2252 ---- linux-2.6.36.orig/init/Kconfig
2253 -+++ linux-2.6.36/init/Kconfig
2254 -@@ -652,6 +652,18 @@ config DEBUG_BLK_CGROUP
2255 -
2256 - endif # CGROUPS
2257 -
2258 -+config SCHED_AUTOGROUP
2259 -+ bool "Automatic process group scheduling"
2260 -+ select CGROUPS
2261 -+ select CGROUP_SCHED
2262 -+ select FAIR_GROUP_SCHED
2263 -+ help
2264 -+ This option optimizes the scheduler for common desktop workloads by
2265 -+ automatically creating and populating task groups. This separation
2266 -+ of workloads isolates aggressive CPU burners (like build jobs) from
2267 -+ desktop applications. Task group autogeneration is currently based
2268 -+ upon task session.
2269 -+
2270 - config MM_OWNER
2271 - bool
2272 -
2273 -Index: linux-2.6.36/Documentation/kernel-parameters.txt
2274 -===================================================================
2275 ---- linux-2.6.36.orig/Documentation/kernel-parameters.txt
2276 -+++ linux-2.6.36/Documentation/kernel-parameters.txt
2277 -@@ -1610,6 +1610,8 @@ and is between 256 and 4096 characters.
2278 - noapic [SMP,APIC] Tells the kernel to not make use of any
2279 - IOAPICs that may be present in the system.
2280 -
2281 -+ noautogroup Disable scheduler automatic task group creation.
2282 -+
2283 - nobats [PPC] Do not use BATs for mapping kernel lowmem
2284 - on "Classic" PPC cores.
2285 -
2286 -Index: linux-2.6.36.git/kernel/sched.c
2287 -===================================================================
2288 ---- linux-2.6.36.git.orig/kernel/sched.c
2289 -+++ linux-2.6.36.git/kernel/sched.c
2290 -@@ -8297,12 +8297,12 @@ void sched_move_task(struct task_struct
2291 - if (unlikely(running))
2292 - tsk->sched_class->put_prev_task(rq, tsk);
2293 -
2294 -- set_task_rq(tsk, task_cpu(tsk));
2295 --
2296 - #ifdef CONFIG_FAIR_GROUP_SCHED
2297 -- if (tsk->sched_class->moved_group)
2298 -- tsk->sched_class->moved_group(tsk, on_rq);
2299 -+ if (tsk->sched_class->task_move_group)
2300 -+ tsk->sched_class->task_move_group(tsk, on_rq);
2301 -+ else
2302 - #endif
2303 -+ set_task_rq(tsk, task_cpu(tsk));
2304 -
2305 - if (unlikely(running))
2306 - tsk->sched_class->set_curr_task(rq);
2307 -Index: linux-2.6.36.git/include/linux/sched.h
2308 -===================================================================
2309 ---- linux-2.6.36.git.orig/include/linux/sched.h
2310 -+++ linux-2.6.36.git/include/linux/sched.h
2311 -@@ -1072,7 +1072,7 @@ struct sched_class {
2312 - struct task_struct *task);
2313 -
2314 - #ifdef CONFIG_FAIR_GROUP_SCHED
2315 -- void (*moved_group) (struct task_struct *p, int on_rq);
2316 -+ void (*task_move_group) (struct task_struct *p, int on_rq);
2317 - #endif
2318 - };
2319 -
2320 -Index: linux-2.6.36.git/kernel/sched_fair.c
2321 -===================================================================
2322 ---- linux-2.6.36.git.orig/kernel/sched_fair.c
2323 -+++ linux-2.6.36.git/kernel/sched_fair.c
2324 -@@ -3824,13 +3824,26 @@ static void set_curr_task_fair(struct rq
2325 - }
2326 -
2327 - #ifdef CONFIG_FAIR_GROUP_SCHED
2328 --static void moved_group_fair(struct task_struct *p, int on_rq)
2329 -+static void task_move_group_fair(struct task_struct *p, int on_rq)
2330 - {
2331 -- struct cfs_rq *cfs_rq = task_cfs_rq(p);
2332 --
2333 -- update_curr(cfs_rq);
2334 -+ /*
2335 -+ * If the task was not on the rq at the time of this cgroup movement
2336 -+ * it must have been asleep, sleeping tasks keep their ->vruntime
2337 -+ * absolute on their old rq until wakeup (needed for the fair sleeper
2338 -+ * bonus in place_entity()).
2339 -+ *
2340 -+ * If it was on the rq, we've just 'preempted' it, which does convert
2341 -+ * ->vruntime to a relative base.
2342 -+ *
2343 -+ * Make sure both cases convert their relative position when migrating
2344 -+ * to another cgroup's rq. This does somewhat interfere with the
2345 -+ * fair sleeper stuff for the first placement, but who cares.
2346 -+ */
2347 -+ if (!on_rq)
2348 -+ p->se.vruntime -= cfs_rq_of(&p->se)->min_vruntime;
2349 -+ set_task_rq(p, task_cpu(p));
2350 - if (!on_rq)
2351 -- place_entity(cfs_rq, &p->se, 1);
2352 -+ p->se.vruntime += cfs_rq_of(&p->se)->min_vruntime;
2353 - }
2354 - #endif
2355 -
2356 -@@ -3882,7 +3895,7 @@ static const struct sched_class fair_sch
2357 - .get_rr_interval = get_rr_interval_fair,
2358 -
2359 - #ifdef CONFIG_FAIR_GROUP_SCHED
2360 -- .moved_group = moved_group_fair,
2361 -+ .task_move_group = task_move_group_fair,
2362 - #endif
2363 - };