Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1720 - genpatches-2.6/trunk/2.6.32
Date: Mon, 05 Jul 2010 22:42:50
Message-Id: 20100705224236.8B6962CF3A@corvid.gentoo.org
1 Author: mpagano
2 Date: 2010-07-05 22:42:35 +0000 (Mon, 05 Jul 2010)
3 New Revision: 1720
4
5 Added:
6 genpatches-2.6/trunk/2.6.32/1015_linux-2.6.32.16.patch
7 Log:
8 Linux patch 2.6.32.16
9
10 Added: genpatches-2.6/trunk/2.6.32/1015_linux-2.6.32.16.patch
11 ===================================================================
12 --- genpatches-2.6/trunk/2.6.32/1015_linux-2.6.32.16.patch (rev 0)
13 +++ genpatches-2.6/trunk/2.6.32/1015_linux-2.6.32.16.patch 2010-07-05 22:42:35 UTC (rev 1720)
14 @@ -0,0 +1,4688 @@
15 +diff --git a/Documentation/hwmon/ltc4245 b/Documentation/hwmon/ltc4245
16 +index 02838a4..86b5880 100644
17 +--- a/Documentation/hwmon/ltc4245
18 ++++ b/Documentation/hwmon/ltc4245
19 +@@ -72,9 +72,7 @@ in6_min_alarm 5v output undervoltage alarm
20 + in7_min_alarm 3v output undervoltage alarm
21 + in8_min_alarm Vee (-12v) output undervoltage alarm
22 +
23 +-in9_input GPIO #1 voltage data
24 +-in10_input GPIO #2 voltage data
25 +-in11_input GPIO #3 voltage data
26 ++in9_input GPIO voltage data
27 +
28 + power1_input 12v power usage (mW)
29 + power2_input 5v power usage (mW)
30 +diff --git a/Documentation/networking/3c509.txt b/Documentation/networking/3c509.txt
31 +index 0643e3b..3c45d5d 100644
32 +--- a/Documentation/networking/3c509.txt
33 ++++ b/Documentation/networking/3c509.txt
34 +@@ -48,11 +48,11 @@ for LILO parameters for doing this:
35 + This configures the first found 3c509 card for IRQ 10, base I/O 0x310, and
36 + transceiver type 3 (10base2). The flag "0x3c509" must be set to avoid conflicts
37 + with other card types when overriding the I/O address. When the driver is
38 +-loaded as a module, only the IRQ and transceiver setting may be overridden.
39 +-For example, setting two cards to 10base2/IRQ10 and AUI/IRQ11 is done by using
40 +-the xcvr and irq module options:
41 ++loaded as a module, only the IRQ may be overridden. For example,
42 ++setting two cards to IRQ10 and IRQ11 is done by using the irq module
43 ++option:
44 +
45 +- options 3c509 xcvr=3,1 irq=10,11
46 ++ options 3c509 irq=10,11
47 +
48 +
49 + (2) Full-duplex mode
50 +@@ -77,6 +77,8 @@ operation.
51 + itself full-duplex capable. This is almost certainly one of two things: a full-
52 + duplex-capable Ethernet switch (*not* a hub), or a full-duplex-capable NIC on
53 + another system that's connected directly to the 3c509B via a crossover cable.
54 ++
55 ++Full-duplex mode can be enabled using 'ethtool'.
56 +
57 + /////Extremely important caution concerning full-duplex mode/////
58 + Understand that the 3c509B's hardware's full-duplex support is much more
59 +@@ -113,6 +115,8 @@ This insured that merely upgrading the driver from an earlier version would
60 + never automatically enable full-duplex mode in an existing installation;
61 + it must always be explicitly enabled via one of these code in order to be
62 + activated.
63 ++
64 ++The transceiver type can be changed using 'ethtool'.
65 +
66 +
67 + (4a) Interpretation of error messages and common problems
68 +diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
69 +index 8ba7044..b07bfee 100644
70 +--- a/arch/arm/common/sa1111.c
71 ++++ b/arch/arm/common/sa1111.c
72 +@@ -887,8 +887,6 @@ static int sa1111_resume(struct platform_device *dev)
73 + if (!save)
74 + return 0;
75 +
76 +- spin_lock_irqsave(&sachip->lock, flags);
77 +-
78 + /*
79 + * Ensure that the SA1111 is still here.
80 + * FIXME: shouldn't do this here.
81 +@@ -905,6 +903,13 @@ static int sa1111_resume(struct platform_device *dev)
82 + * First of all, wake up the chip.
83 + */
84 + sa1111_wake(sachip);
85 ++
86 ++ /*
87 ++ * Only lock for write ops. Also, sa1111_wake must be called with
88 ++ * released spinlock!
89 ++ */
90 ++ spin_lock_irqsave(&sachip->lock, flags);
91 ++
92 + sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN0);
93 + sa1111_writel(0, sachip->base + SA1111_INTC + SA1111_INTEN1);
94 +
95 +diff --git a/arch/arm/mm/copypage-feroceon.c b/arch/arm/mm/copypage-feroceon.c
96 +index 70997d5..dd9598b 100644
97 +--- a/arch/arm/mm/copypage-feroceon.c
98 ++++ b/arch/arm/mm/copypage-feroceon.c
99 +@@ -18,7 +18,7 @@ feroceon_copy_user_page(void *kto, const void *kfrom)
100 + {
101 + asm("\
102 + stmfd sp!, {r4-r9, lr} \n\
103 +- mov ip, %0 \n\
104 ++ mov ip, %2 \n\
105 + 1: mov lr, r1 \n\
106 + ldmia r1!, {r2 - r9} \n\
107 + pld [lr, #32] \n\
108 +@@ -64,7 +64,7 @@ feroceon_copy_user_page(void *kto, const void *kfrom)
109 + mcr p15, 0, ip, c7, c10, 4 @ drain WB\n\
110 + ldmfd sp!, {r4-r9, pc}"
111 + :
112 +- : "I" (PAGE_SIZE));
113 ++ : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE));
114 + }
115 +
116 + void feroceon_copy_user_highpage(struct page *to, struct page *from,
117 +diff --git a/arch/arm/mm/copypage-v4wb.c b/arch/arm/mm/copypage-v4wb.c
118 +index 9ab0984..7bc0ac7 100644
119 +--- a/arch/arm/mm/copypage-v4wb.c
120 ++++ b/arch/arm/mm/copypage-v4wb.c
121 +@@ -27,7 +27,7 @@ v4wb_copy_user_page(void *kto, const void *kfrom)
122 + {
123 + asm("\
124 + stmfd sp!, {r4, lr} @ 2\n\
125 +- mov r2, %0 @ 1\n\
126 ++ mov r2, %2 @ 1\n\
127 + ldmia r1!, {r3, r4, ip, lr} @ 4\n\
128 + 1: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\
129 + stmia r0!, {r3, r4, ip, lr} @ 4\n\
130 +@@ -44,7 +44,7 @@ v4wb_copy_user_page(void *kto, const void *kfrom)
131 + mcr p15, 0, r1, c7, c10, 4 @ 1 drain WB\n\
132 + ldmfd sp!, {r4, pc} @ 3"
133 + :
134 +- : "I" (PAGE_SIZE / 64));
135 ++ : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64));
136 + }
137 +
138 + void v4wb_copy_user_highpage(struct page *to, struct page *from,
139 +diff --git a/arch/arm/mm/copypage-v4wt.c b/arch/arm/mm/copypage-v4wt.c
140 +index 300efaf..35bf609 100644
141 +--- a/arch/arm/mm/copypage-v4wt.c
142 ++++ b/arch/arm/mm/copypage-v4wt.c
143 +@@ -25,7 +25,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom)
144 + {
145 + asm("\
146 + stmfd sp!, {r4, lr} @ 2\n\
147 +- mov r2, %0 @ 1\n\
148 ++ mov r2, %2 @ 1\n\
149 + ldmia r1!, {r3, r4, ip, lr} @ 4\n\
150 + 1: stmia r0!, {r3, r4, ip, lr} @ 4\n\
151 + ldmia r1!, {r3, r4, ip, lr} @ 4+1\n\
152 +@@ -40,7 +40,7 @@ v4wt_copy_user_page(void *kto, const void *kfrom)
153 + mcr p15, 0, r2, c7, c7, 0 @ flush ID cache\n\
154 + ldmfd sp!, {r4, pc} @ 3"
155 + :
156 +- : "I" (PAGE_SIZE / 64));
157 ++ : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64));
158 + }
159 +
160 + void v4wt_copy_user_highpage(struct page *to, struct page *from,
161 +diff --git a/arch/arm/mm/copypage-xsc3.c b/arch/arm/mm/copypage-xsc3.c
162 +index bc4525f..27dc363 100644
163 +--- a/arch/arm/mm/copypage-xsc3.c
164 ++++ b/arch/arm/mm/copypage-xsc3.c
165 +@@ -34,7 +34,7 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom)
166 + {
167 + asm("\
168 + stmfd sp!, {r4, r5, lr} \n\
169 +- mov lr, %0 \n\
170 ++ mov lr, %2 \n\
171 + \n\
172 + pld [r1, #0] \n\
173 + pld [r1, #32] \n\
174 +@@ -67,7 +67,7 @@ xsc3_mc_copy_user_page(void *kto, const void *kfrom)
175 + \n\
176 + ldmfd sp!, {r4, r5, pc}"
177 + :
178 +- : "I" (PAGE_SIZE / 64 - 1));
179 ++ : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64 - 1));
180 + }
181 +
182 + void xsc3_mc_copy_user_highpage(struct page *to, struct page *from,
183 +diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
184 +index 10e0680..3191cd6 100644
185 +--- a/arch/arm/mm/fault.c
186 ++++ b/arch/arm/mm/fault.c
187 +@@ -386,6 +386,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
188 + if (addr < TASK_SIZE)
189 + return do_page_fault(addr, fsr, regs);
190 +
191 ++ if (user_mode(regs))
192 ++ goto bad_area;
193 ++
194 + index = pgd_index(addr);
195 +
196 + /*
197 +diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
198 +index 52c40d1..94945db 100644
199 +--- a/arch/arm/mm/init.c
200 ++++ b/arch/arm/mm/init.c
201 +@@ -632,10 +632,10 @@ void __init mem_init(void)
202 + void free_initmem(void)
203 + {
204 + #ifdef CONFIG_HAVE_TCM
205 +- extern char *__tcm_start, *__tcm_end;
206 ++ extern char __tcm_start, __tcm_end;
207 +
208 +- totalram_pages += free_area(__phys_to_pfn(__pa(__tcm_start)),
209 +- __phys_to_pfn(__pa(__tcm_end)),
210 ++ totalram_pages += free_area(__phys_to_pfn(__pa(&__tcm_start)),
211 ++ __phys_to_pfn(__pa(&__tcm_end)),
212 + "TCM link");
213 + #endif
214 +
215 +diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
216 +index 66dc2d0..d66cead 100644
217 +--- a/arch/arm/vfp/vfphw.S
218 ++++ b/arch/arm/vfp/vfphw.S
219 +@@ -277,7 +277,7 @@ ENTRY(vfp_put_double)
220 + #ifdef CONFIG_VFPv3
221 + @ d16 - d31 registers
222 + .irp dr,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
223 +-1: mcrr p11, 3, r1, r2, c\dr @ fmdrr r1, r2, d\dr
224 ++1: mcrr p11, 3, r0, r1, c\dr @ fmdrr r0, r1, d\dr
225 + mov pc, lr
226 + .org 1b + 8
227 + .endr
228 +diff --git a/arch/blackfin/include/asm/cache.h b/arch/blackfin/include/asm/cache.h
229 +index 8542bc3..93f6c63 100644
230 +--- a/arch/blackfin/include/asm/cache.h
231 ++++ b/arch/blackfin/include/asm/cache.h
232 +@@ -15,6 +15,8 @@
233 + #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
234 + #define SMP_CACHE_BYTES L1_CACHE_BYTES
235 +
236 ++#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
237 ++
238 + #ifdef CONFIG_SMP
239 + #define __cacheline_aligned
240 + #else
241 +diff --git a/arch/frv/include/asm/cache.h b/arch/frv/include/asm/cache.h
242 +index 2797163..7dc0f0f 100644
243 +--- a/arch/frv/include/asm/cache.h
244 ++++ b/arch/frv/include/asm/cache.h
245 +@@ -17,6 +17,8 @@
246 + #define L1_CACHE_SHIFT (CONFIG_FRV_L1_CACHE_SHIFT)
247 + #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
248 +
249 ++#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
250 ++
251 + #define __cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES)))
252 + #define ____cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES)))
253 +
254 +diff --git a/arch/m68k/include/asm/cache.h b/arch/m68k/include/asm/cache.h
255 +index fed3fd3..ecafbe1 100644
256 +--- a/arch/m68k/include/asm/cache.h
257 ++++ b/arch/m68k/include/asm/cache.h
258 +@@ -8,4 +8,6 @@
259 + #define L1_CACHE_SHIFT 4
260 + #define L1_CACHE_BYTES (1<< L1_CACHE_SHIFT)
261 +
262 ++#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
263 ++
264 + #endif
265 +diff --git a/arch/mn10300/include/asm/cache.h b/arch/mn10300/include/asm/cache.h
266 +index e03cfa2..6e2fe28 100644
267 +--- a/arch/mn10300/include/asm/cache.h
268 ++++ b/arch/mn10300/include/asm/cache.h
269 +@@ -21,6 +21,8 @@
270 + #define L1_CACHE_DISPARITY L1_CACHE_NENTRIES * L1_CACHE_BYTES
271 + #endif
272 +
273 ++#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
274 ++
275 + /* data cache purge registers
276 + * - read from the register to unconditionally purge that cache line
277 + * - write address & 0xffffff00 to conditionally purge that cache line
278 +diff --git a/arch/parisc/math-emu/decode_exc.c b/arch/parisc/math-emu/decode_exc.c
279 +index 3ca1c61..27a7492 100644
280 +--- a/arch/parisc/math-emu/decode_exc.c
281 ++++ b/arch/parisc/math-emu/decode_exc.c
282 +@@ -342,6 +342,7 @@ decode_fpu(unsigned int Fpu_register[], unsigned int trap_counts[])
283 + return SIGNALCODE(SIGFPE, FPE_FLTINV);
284 + case DIVISIONBYZEROEXCEPTION:
285 + update_trap_counts(Fpu_register, aflags, bflags, trap_counts);
286 ++ Clear_excp_register(exception_index);
287 + return SIGNALCODE(SIGFPE, FPE_FLTDIV);
288 + case INEXACTEXCEPTION:
289 + update_trap_counts(Fpu_register, aflags, bflags, trap_counts);
290 +diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
291 +index 2a4551f..ff184f4 100644
292 +--- a/arch/powerpc/kvm/powerpc.c
293 ++++ b/arch/powerpc/kvm/powerpc.c
294 +@@ -176,7 +176,8 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
295 + {
296 + struct kvm_vcpu *vcpu;
297 + vcpu = kvmppc_core_vcpu_create(kvm, id);
298 +- kvmppc_create_vcpu_debugfs(vcpu, id);
299 ++ if (!IS_ERR(vcpu))
300 ++ kvmppc_create_vcpu_debugfs(vcpu, id);
301 + return vcpu;
302 + }
303 +
304 +diff --git a/arch/powerpc/lib/string.S b/arch/powerpc/lib/string.S
305 +index 64e2e49..3ac0cd3 100644
306 +--- a/arch/powerpc/lib/string.S
307 ++++ b/arch/powerpc/lib/string.S
308 +@@ -71,7 +71,7 @@ _GLOBAL(strcmp)
309 +
310 + _GLOBAL(strncmp)
311 + PPC_LCMPI r5,0
312 +- beqlr
313 ++ ble- 2f
314 + mtctr r5
315 + addi r5,r3,-1
316 + addi r4,r4,-1
317 +@@ -82,6 +82,8 @@ _GLOBAL(strncmp)
318 + beqlr 1
319 + bdnzt eq,1b
320 + blr
321 ++2: li r3,0
322 ++ blr
323 +
324 + _GLOBAL(strlen)
325 + addi r4,r3,-1
326 +diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c
327 +index ae06c62..c8fc4dc 100644
328 +--- a/arch/powerpc/oprofile/op_model_cell.c
329 ++++ b/arch/powerpc/oprofile/op_model_cell.c
330 +@@ -1077,7 +1077,7 @@ static int calculate_lfsr(int n)
331 + index = ENTRIES-1;
332 +
333 + /* make sure index is valid */
334 +- if ((index > ENTRIES) || (index < 0))
335 ++ if ((index >= ENTRIES) || (index < 0))
336 + index = ENTRIES-1;
337 +
338 + return initial_lfsr[index];
339 +diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
340 +index ebff6d9..c2c1720 100644
341 +--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
342 ++++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
343 +@@ -66,30 +66,6 @@ static void pseries_mach_cpu_die(void)
344 + for(;;);
345 + }
346 +
347 +-static int qcss_tok; /* query-cpu-stopped-state token */
348 +-
349 +-/* Get state of physical CPU.
350 +- * Return codes:
351 +- * 0 - The processor is in the RTAS stopped state
352 +- * 1 - stop-self is in progress
353 +- * 2 - The processor is not in the RTAS stopped state
354 +- * -1 - Hardware Error
355 +- * -2 - Hardware Busy, Try again later.
356 +- */
357 +-static int query_cpu_stopped(unsigned int pcpu)
358 +-{
359 +- int cpu_status, status;
360 +-
361 +- status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu);
362 +- if (status != 0) {
363 +- printk(KERN_ERR
364 +- "RTAS query-cpu-stopped-state failed: %i\n", status);
365 +- return status;
366 +- }
367 +-
368 +- return cpu_status;
369 +-}
370 +-
371 + static int pseries_cpu_disable(void)
372 + {
373 + int cpu = smp_processor_id();
374 +@@ -113,8 +89,9 @@ static void pseries_cpu_die(unsigned int cpu)
375 + unsigned int pcpu = get_hard_smp_processor_id(cpu);
376 +
377 + for (tries = 0; tries < 25; tries++) {
378 +- cpu_status = query_cpu_stopped(pcpu);
379 +- if (cpu_status == 0 || cpu_status == -1)
380 ++ cpu_status = smp_query_cpu_stopped(pcpu);
381 ++ if (cpu_status == QCSS_STOPPED ||
382 ++ cpu_status == QCSS_HARDWARE_ERROR)
383 + break;
384 + cpu_relax();
385 + }
386 +@@ -256,6 +233,7 @@ static int __init pseries_cpu_hotplug_init(void)
387 + {
388 + struct device_node *np;
389 + const char *typep;
390 ++ int qcss_tok;
391 +
392 + for_each_node_by_name(np, "interrupt-controller") {
393 + typep = of_get_property(np, "compatible", NULL);
394 +diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h
395 +index a24a6b2..45f634c 100644
396 +--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
397 ++++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
398 +@@ -4,6 +4,14 @@
399 + #include <asm/hvcall.h>
400 + #include <asm/page.h>
401 +
402 ++/* Get state of physical CPU from query_cpu_stopped */
403 ++int smp_query_cpu_stopped(unsigned int pcpu);
404 ++#define QCSS_STOPPED 0
405 ++#define QCSS_STOPPING 1
406 ++#define QCSS_NOT_STOPPED 2
407 ++#define QCSS_HARDWARE_ERROR -1
408 ++#define QCSS_HARDWARE_BUSY -2
409 ++
410 + static inline long poll_pending(void)
411 + {
412 + return plpar_hcall_norets(H_POLL_PENDING);
413 +diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
414 +index 440000c..3afa079 100644
415 +--- a/arch/powerpc/platforms/pseries/smp.c
416 ++++ b/arch/powerpc/platforms/pseries/smp.c
417 +@@ -56,6 +56,28 @@
418 + */
419 + static cpumask_t of_spin_map;
420 +
421 ++/* Query where a cpu is now. Return codes #defined in plpar_wrappers.h */
422 ++int smp_query_cpu_stopped(unsigned int pcpu)
423 ++{
424 ++ int cpu_status, status;
425 ++ int qcss_tok = rtas_token("query-cpu-stopped-state");
426 ++
427 ++ if (qcss_tok == RTAS_UNKNOWN_SERVICE) {
428 ++ printk(KERN_INFO "Firmware doesn't support "
429 ++ "query-cpu-stopped-state\n");
430 ++ return QCSS_HARDWARE_ERROR;
431 ++ }
432 ++
433 ++ status = rtas_call(qcss_tok, 1, 2, &cpu_status, pcpu);
434 ++ if (status != 0) {
435 ++ printk(KERN_ERR
436 ++ "RTAS query-cpu-stopped-state failed: %i\n", status);
437 ++ return status;
438 ++ }
439 ++
440 ++ return cpu_status;
441 ++}
442 ++
443 + /**
444 + * smp_startup_cpu() - start the given cpu
445 + *
446 +@@ -81,6 +103,12 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu)
447 +
448 + pcpu = get_hard_smp_processor_id(lcpu);
449 +
450 ++ /* Check to see if the CPU out of FW already for kexec */
451 ++ if (smp_query_cpu_stopped(pcpu) == QCSS_NOT_STOPPED){
452 ++ cpu_set(lcpu, of_spin_map);
453 ++ return 1;
454 ++ }
455 ++
456 + /* Fixup atomic count: it exited inside IRQ handler. */
457 + task_thread_info(paca[lcpu].__current)->preempt_count = 0;
458 +
459 +diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
460 +index ca2d312..75fbf19 100644
461 +--- a/arch/s390/kvm/kvm-s390.c
462 ++++ b/arch/s390/kvm/kvm-s390.c
463 +@@ -338,11 +338,13 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
464 +
465 + rc = kvm_vcpu_init(vcpu, kvm, id);
466 + if (rc)
467 +- goto out_free_cpu;
468 ++ goto out_free_sie_block;
469 + VM_EVENT(kvm, 3, "create cpu %d at %p, sie block at %p", id, vcpu,
470 + vcpu->arch.sie_block);
471 +
472 + return vcpu;
473 ++out_free_sie_block:
474 ++ free_page((unsigned long)(vcpu->arch.sie_block));
475 + out_free_cpu:
476 + kfree(vcpu);
477 + out_nomem:
478 +diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
479 +index 6ead43e..9113954 100644
480 +--- a/arch/x86/include/asm/kvm_host.h
481 ++++ b/arch/x86/include/asm/kvm_host.h
482 +@@ -193,6 +193,7 @@ union kvm_mmu_page_role {
483 + unsigned invalid:1;
484 + unsigned cr4_pge:1;
485 + unsigned nxe:1;
486 ++ unsigned cr0_wp:1;
487 + };
488 + };
489 +
490 +diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
491 +index 7825b0c..a7881c7 100644
492 +--- a/arch/x86/include/asm/msr-index.h
493 ++++ b/arch/x86/include/asm/msr-index.h
494 +@@ -198,8 +198,9 @@
495 + #define MSR_IA32_EBL_CR_POWERON 0x0000002a
496 + #define MSR_IA32_FEATURE_CONTROL 0x0000003a
497 +
498 +-#define FEATURE_CONTROL_LOCKED (1<<0)
499 +-#define FEATURE_CONTROL_VMXON_ENABLED (1<<2)
500 ++#define FEATURE_CONTROL_LOCKED (1<<0)
501 ++#define FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX (1<<1)
502 ++#define FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX (1<<2)
503 +
504 + #define MSR_IA32_APICBASE 0x0000001b
505 + #define MSR_IA32_APICBASE_BSP (1<<8)
506 +diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
507 +index c0ebc63..f0fa7a1 100644
508 +--- a/arch/x86/kernel/amd_iommu.c
509 ++++ b/arch/x86/kernel/amd_iommu.c
510 +@@ -544,7 +544,7 @@ static void flush_devices_by_domain(struct protection_domain *domain)
511 +
512 + for (i = 0; i <= amd_iommu_last_bdf; ++i) {
513 + if ((domain == NULL && amd_iommu_pd_table[i] == NULL) ||
514 +- (amd_iommu_pd_table[i] != domain))
515 ++ (domain != NULL && amd_iommu_pd_table[i] != domain))
516 + continue;
517 +
518 + iommu = amd_iommu_rlookup_table[i];
519 +diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
520 +index efea222..0ff02ca 100644
521 +--- a/arch/x86/kernel/cpu/perf_event.c
522 ++++ b/arch/x86/kernel/cpu/perf_event.c
523 +@@ -1005,8 +1005,11 @@ static int __hw_perf_event_init(struct perf_event *event)
524 + if (atomic_read(&active_events) == 0) {
525 + if (!reserve_pmc_hardware())
526 + err = -EBUSY;
527 +- else
528 ++ else {
529 + err = reserve_bts_hardware();
530 ++ if (err)
531 ++ release_pmc_hardware();
532 ++ }
533 + }
534 + if (!err)
535 + atomic_inc(&active_events);
536 +diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
537 +index 03801f2..dfdfe46 100644
538 +--- a/arch/x86/kernel/pvclock.c
539 ++++ b/arch/x86/kernel/pvclock.c
540 +@@ -109,11 +109,14 @@ unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src)
541 + return pv_tsc_khz;
542 + }
543 +
544 ++static atomic64_t last_value = ATOMIC64_INIT(0);
545 ++
546 + cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
547 + {
548 + struct pvclock_shadow_time shadow;
549 + unsigned version;
550 + cycle_t ret, offset;
551 ++ u64 last;
552 +
553 + do {
554 + version = pvclock_get_time_values(&shadow, src);
555 +@@ -123,6 +126,27 @@ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
556 + barrier();
557 + } while (version != src->version);
558 +
559 ++ /*
560 ++ * Assumption here is that last_value, a global accumulator, always goes
561 ++ * forward. If we are less than that, we should not be much smaller.
562 ++ * We assume there is an error marging we're inside, and then the correction
563 ++ * does not sacrifice accuracy.
564 ++ *
565 ++ * For reads: global may have changed between test and return,
566 ++ * but this means someone else updated poked the clock at a later time.
567 ++ * We just need to make sure we are not seeing a backwards event.
568 ++ *
569 ++ * For updates: last_value = ret is not enough, since two vcpus could be
570 ++ * updating at the same time, and one of them could be slightly behind,
571 ++ * making the assumption that last_value always go forward fail to hold.
572 ++ */
573 ++ last = atomic64_read(&last_value);
574 ++ do {
575 ++ if (ret < last)
576 ++ return last;
577 ++ last = atomic64_cmpxchg(&last_value, last, ret);
578 ++ } while (unlikely(last != ret));
579 ++
580 + return ret;
581 + }
582 +
583 +diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
584 +index 8425f7e..d7a0888 100644
585 +--- a/arch/x86/kernel/setup.c
586 ++++ b/arch/x86/kernel/setup.c
587 +@@ -688,6 +688,17 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
588 + DMI_MATCH(DMI_BOARD_NAME, "DG45FC"),
589 + },
590 + },
591 ++ /*
592 ++ * The Dell Inspiron Mini 1012 has DMI_BIOS_VENDOR = "Dell Inc.", so
593 ++ * match on the product name.
594 ++ */
595 ++ {
596 ++ .callback = dmi_low_memory_corruption,
597 ++ .ident = "Phoenix BIOS",
598 ++ .matches = {
599 ++ DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
600 ++ },
601 ++ },
602 + #endif
603 + {}
604 + };
605 +diff --git a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
606 +index 86c9f91..46b8277 100644
607 +--- a/arch/x86/kernel/tboot.c
608 ++++ b/arch/x86/kernel/tboot.c
609 +@@ -46,6 +46,7 @@
610 +
611 + /* Global pointer to shared data; NULL means no measured launch. */
612 + struct tboot *tboot __read_mostly;
613 ++EXPORT_SYMBOL(tboot);
614 +
615 + /* timeout for APs (in secs) to enter wait-for-SIPI state during shutdown */
616 + #define AP_WAIT_TIMEOUT 1
617 +diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
618 +index 762efc2..a265626 100644
619 +--- a/arch/x86/kvm/mmu.c
620 ++++ b/arch/x86/kvm/mmu.c
621 +@@ -221,7 +221,7 @@ void kvm_mmu_set_mask_ptes(u64 user_mask, u64 accessed_mask,
622 + }
623 + EXPORT_SYMBOL_GPL(kvm_mmu_set_mask_ptes);
624 +
625 +-static int is_write_protection(struct kvm_vcpu *vcpu)
626 ++static bool is_write_protection(struct kvm_vcpu *vcpu)
627 + {
628 + return vcpu->arch.cr0 & X86_CR0_WP;
629 + }
630 +@@ -2091,11 +2091,13 @@ static int mmu_alloc_roots(struct kvm_vcpu *vcpu)
631 + direct = 1;
632 + if (mmu_check_root(vcpu, root_gfn))
633 + return 1;
634 ++ spin_lock(&vcpu->kvm->mmu_lock);
635 + sp = kvm_mmu_get_page(vcpu, root_gfn, 0,
636 + PT64_ROOT_LEVEL, direct,
637 + ACC_ALL, NULL);
638 + root = __pa(sp->spt);
639 + ++sp->root_count;
640 ++ spin_unlock(&vcpu->kvm->mmu_lock);
641 + vcpu->arch.mmu.root_hpa = root;
642 + return 0;
643 + }
644 +@@ -2117,11 +2119,14 @@ static int mmu_alloc_roots(struct kvm_vcpu *vcpu)
645 + root_gfn = 0;
646 + if (mmu_check_root(vcpu, root_gfn))
647 + return 1;
648 ++ spin_lock(&vcpu->kvm->mmu_lock);
649 + sp = kvm_mmu_get_page(vcpu, root_gfn, i << 30,
650 + PT32_ROOT_LEVEL, direct,
651 + ACC_ALL, NULL);
652 + root = __pa(sp->spt);
653 + ++sp->root_count;
654 ++ spin_unlock(&vcpu->kvm->mmu_lock);
655 ++
656 + vcpu->arch.mmu.pae_root[i] = root | PT_PRESENT_MASK;
657 + }
658 + vcpu->arch.mmu.root_hpa = __pa(vcpu->arch.mmu.pae_root);
659 +@@ -2445,6 +2450,7 @@ static int init_kvm_softmmu(struct kvm_vcpu *vcpu)
660 + r = paging32_init_context(vcpu);
661 +
662 + vcpu->arch.mmu.base_role.glevels = vcpu->arch.mmu.root_level;
663 ++ vcpu->arch.mmu.base_role.cr0_wp = is_write_protection(vcpu);
664 +
665 + return r;
666 + }
667 +@@ -2484,7 +2490,9 @@ int kvm_mmu_load(struct kvm_vcpu *vcpu)
668 + goto out;
669 + spin_lock(&vcpu->kvm->mmu_lock);
670 + kvm_mmu_free_some_pages(vcpu);
671 ++ spin_unlock(&vcpu->kvm->mmu_lock);
672 + r = mmu_alloc_roots(vcpu);
673 ++ spin_lock(&vcpu->kvm->mmu_lock);
674 + mmu_sync_roots(vcpu);
675 + spin_unlock(&vcpu->kvm->mmu_lock);
676 + if (r)
677 +diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
678 +index fa297d6..6a28d5d 100644
679 +--- a/arch/x86/kvm/vmx.c
680 ++++ b/arch/x86/kvm/vmx.c
681 +@@ -26,6 +26,7 @@
682 + #include <linux/sched.h>
683 + #include <linux/moduleparam.h>
684 + #include <linux/ftrace_event.h>
685 ++#include <linux/tboot.h>
686 + #include "kvm_cache_regs.h"
687 + #include "x86.h"
688 +
689 +@@ -1140,9 +1141,16 @@ static __init int vmx_disabled_by_bios(void)
690 + u64 msr;
691 +
692 + rdmsrl(MSR_IA32_FEATURE_CONTROL, msr);
693 +- return (msr & (FEATURE_CONTROL_LOCKED |
694 +- FEATURE_CONTROL_VMXON_ENABLED))
695 +- == FEATURE_CONTROL_LOCKED;
696 ++ if (msr & FEATURE_CONTROL_LOCKED) {
697 ++ if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX)
698 ++ && tboot_enabled())
699 ++ return 1;
700 ++ if (!(msr & FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX)
701 ++ && !tboot_enabled())
702 ++ return 1;
703 ++ }
704 ++
705 ++ return 0;
706 + /* locked but not enabled */
707 + }
708 +
709 +@@ -1150,18 +1158,20 @@ static void hardware_enable(void *garbage)
710 + {
711 + int cpu = raw_smp_processor_id();
712 + u64 phys_addr = __pa(per_cpu(vmxarea, cpu));
713 +- u64 old;
714 ++ u64 old, test_bits;
715 +
716 + INIT_LIST_HEAD(&per_cpu(vcpus_on_cpu, cpu));
717 + rdmsrl(MSR_IA32_FEATURE_CONTROL, old);
718 +- if ((old & (FEATURE_CONTROL_LOCKED |
719 +- FEATURE_CONTROL_VMXON_ENABLED))
720 +- != (FEATURE_CONTROL_LOCKED |
721 +- FEATURE_CONTROL_VMXON_ENABLED))
722 ++
723 ++ test_bits = FEATURE_CONTROL_LOCKED;
724 ++ test_bits |= FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX;
725 ++ if (tboot_enabled())
726 ++ test_bits |= FEATURE_CONTROL_VMXON_ENABLED_INSIDE_SMX;
727 ++
728 ++ if ((old & test_bits) != test_bits) {
729 + /* enable and lock */
730 +- wrmsrl(MSR_IA32_FEATURE_CONTROL, old |
731 +- FEATURE_CONTROL_LOCKED |
732 +- FEATURE_CONTROL_VMXON_ENABLED);
733 ++ wrmsrl(MSR_IA32_FEATURE_CONTROL, old | test_bits);
734 ++ }
735 + write_cr4(read_cr4() | X86_CR4_VMXE); /* FIXME: not cpu hotplug safe */
736 + asm volatile (ASM_VMX_VMXON_RAX
737 + : : "a"(&phys_addr), "m"(phys_addr)
738 +diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
739 +index 2782509..281ac63 100644
740 +--- a/arch/x86/kvm/x86.c
741 ++++ b/arch/x86/kvm/x86.c
742 +@@ -345,7 +345,7 @@ EXPORT_SYMBOL_GPL(kvm_set_cr0);
743 +
744 + void kvm_lmsw(struct kvm_vcpu *vcpu, unsigned long msw)
745 + {
746 +- kvm_set_cr0(vcpu, (vcpu->arch.cr0 & ~0x0ful) | (msw & 0x0f));
747 ++ kvm_set_cr0(vcpu, (vcpu->arch.cr0 & ~0x0eul) | (msw & 0x0f));
748 + }
749 + EXPORT_SYMBOL_GPL(kvm_lmsw);
750 +
751 +@@ -483,48 +483,42 @@ static u32 emulated_msrs[] = {
752 + MSR_IA32_MISC_ENABLE,
753 + };
754 +
755 +-static void set_efer(struct kvm_vcpu *vcpu, u64 efer)
756 ++static int set_efer(struct kvm_vcpu *vcpu, u64 efer)
757 + {
758 +- if (efer & efer_reserved_bits) {
759 +- kvm_inject_gp(vcpu, 0);
760 +- return;
761 +- }
762 ++ if (efer & efer_reserved_bits)
763 ++ return 1;
764 +
765 + if (is_paging(vcpu)
766 +- && (vcpu->arch.shadow_efer & EFER_LME) != (efer & EFER_LME)) {
767 +- kvm_inject_gp(vcpu, 0);
768 +- return;
769 +- }
770 ++ && (vcpu->arch.shadow_efer & EFER_LME) != (efer & EFER_LME))
771 ++ return 1;
772 +
773 + if (efer & EFER_FFXSR) {
774 + struct kvm_cpuid_entry2 *feat;
775 +
776 + feat = kvm_find_cpuid_entry(vcpu, 0x80000001, 0);
777 +- if (!feat || !(feat->edx & bit(X86_FEATURE_FXSR_OPT))) {
778 +- kvm_inject_gp(vcpu, 0);
779 +- return;
780 +- }
781 ++ if (!feat || !(feat->edx & bit(X86_FEATURE_FXSR_OPT)))
782 ++ return 1;
783 + }
784 +
785 + if (efer & EFER_SVME) {
786 + struct kvm_cpuid_entry2 *feat;
787 +
788 + feat = kvm_find_cpuid_entry(vcpu, 0x80000001, 0);
789 +- if (!feat || !(feat->ecx & bit(X86_FEATURE_SVM))) {
790 +- kvm_inject_gp(vcpu, 0);
791 +- return;
792 +- }
793 ++ if (!feat || !(feat->ecx & bit(X86_FEATURE_SVM)))
794 ++ return 1;
795 + }
796 +
797 +- kvm_x86_ops->set_efer(vcpu, efer);
798 +-
799 + efer &= ~EFER_LMA;
800 + efer |= vcpu->arch.shadow_efer & EFER_LMA;
801 +
802 ++ kvm_x86_ops->set_efer(vcpu, efer);
803 ++
804 + vcpu->arch.shadow_efer = efer;
805 +
806 + vcpu->arch.mmu.base_role.nxe = (efer & EFER_NX) && !tdp_enabled;
807 + kvm_mmu_reset_context(vcpu);
808 ++
809 ++ return 0;
810 + }
811 +
812 + void kvm_enable_efer_bits(u64 mask)
813 +@@ -554,14 +548,22 @@ static int do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data)
814 +
815 + static void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock)
816 + {
817 +- static int version;
818 ++ int version;
819 ++ int r;
820 + struct pvclock_wall_clock wc;
821 + struct timespec boot;
822 +
823 + if (!wall_clock)
824 + return;
825 +
826 +- version++;
827 ++ r = kvm_read_guest(kvm, wall_clock, &version, sizeof(version));
828 ++ if (r)
829 ++ return;
830 ++
831 ++ if (version & 1)
832 ++ ++version; /* first time write, random junk */
833 ++
834 ++ ++version;
835 +
836 + kvm_write_guest(kvm, wall_clock, &version, sizeof(version));
837 +
838 +@@ -819,8 +821,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
839 + {
840 + switch (msr) {
841 + case MSR_EFER:
842 +- set_efer(vcpu, data);
843 +- break;
844 ++ return set_efer(vcpu, data);
845 + case MSR_K7_HWCR:
846 + data &= ~(u64)0x40; /* ignore flush filter disable */
847 + if (data != 0) {
848 +@@ -1412,6 +1413,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
849 + {
850 + int r;
851 +
852 ++ vcpu_load(vcpu);
853 + r = -E2BIG;
854 + if (cpuid->nent < vcpu->arch.cpuid_nent)
855 + goto out;
856 +@@ -1423,6 +1425,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
857 +
858 + out:
859 + cpuid->nent = vcpu->arch.cpuid_nent;
860 ++ vcpu_put(vcpu);
861 + return r;
862 + }
863 +
864 +@@ -1672,6 +1675,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
865 + int r;
866 + unsigned bank_num = mcg_cap & 0xff, bank;
867 +
868 ++ vcpu_load(vcpu);
869 + r = -EINVAL;
870 + if (!bank_num || bank_num >= KVM_MAX_MCE_BANKS)
871 + goto out;
872 +@@ -1686,6 +1690,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
873 + for (bank = 0; bank < bank_num; bank++)
874 + vcpu->arch.mce_banks[bank*4] = ~(u64)0;
875 + out:
876 ++ vcpu_put(vcpu);
877 + return r;
878 + }
879 +
880 +@@ -1888,7 +1893,9 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
881 + r = -EFAULT;
882 + if (copy_from_user(&mce, argp, sizeof mce))
883 + goto out;
884 ++ vcpu_load(vcpu);
885 + r = kvm_vcpu_ioctl_x86_set_mce(vcpu, &mce);
886 ++ vcpu_put(vcpu);
887 + break;
888 + }
889 + default:
890 +diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
891 +index 2c505ee..f1fb411 100644
892 +--- a/arch/x86/oprofile/nmi_int.c
893 ++++ b/arch/x86/oprofile/nmi_int.c
894 +@@ -95,7 +95,10 @@ static void nmi_cpu_save_registers(struct op_msrs *msrs)
895 + static void nmi_cpu_start(void *dummy)
896 + {
897 + struct op_msrs const *msrs = &__get_cpu_var(cpu_msrs);
898 +- model->start(msrs);
899 ++ if (!msrs->controls)
900 ++ WARN_ON_ONCE(1);
901 ++ else
902 ++ model->start(msrs);
903 + }
904 +
905 + static int nmi_start(void)
906 +@@ -107,7 +110,10 @@ static int nmi_start(void)
907 + static void nmi_cpu_stop(void *dummy)
908 + {
909 + struct op_msrs const *msrs = &__get_cpu_var(cpu_msrs);
910 +- model->stop(msrs);
911 ++ if (!msrs->controls)
912 ++ WARN_ON_ONCE(1);
913 ++ else
914 ++ model->stop(msrs);
915 + }
916 +
917 + static void nmi_stop(void)
918 +diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
919 +index 987267f..a9c6611 100644
920 +--- a/arch/x86/xen/suspend.c
921 ++++ b/arch/x86/xen/suspend.c
922 +@@ -60,6 +60,6 @@ static void xen_vcpu_notify_restore(void *data)
923 +
924 + void xen_arch_resume(void)
925 + {
926 +- smp_call_function(xen_vcpu_notify_restore,
927 +- (void *)CLOCK_EVT_NOTIFY_RESUME, 1);
928 ++ on_each_cpu(xen_vcpu_notify_restore,
929 ++ (void *)CLOCK_EVT_NOTIFY_RESUME, 1);
930 + }
931 +diff --git a/arch/xtensa/include/asm/cache.h b/arch/xtensa/include/asm/cache.h
932 +index f04c989..ed8cd3c 100644
933 +--- a/arch/xtensa/include/asm/cache.h
934 ++++ b/arch/xtensa/include/asm/cache.h
935 +@@ -29,5 +29,6 @@
936 + # define CACHE_WAY_SIZE ICACHE_WAY_SIZE
937 + #endif
938 +
939 ++#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
940 +
941 + #endif /* _XTENSA_CACHE_H */
942 +diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
943 +index 575593a..e7b9606 100644
944 +--- a/drivers/acpi/video_detect.c
945 ++++ b/drivers/acpi/video_detect.c
946 +@@ -250,7 +250,7 @@ static int __init acpi_backlight(char *str)
947 + ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR;
948 + if (!strcmp("video", str))
949 + acpi_video_support |=
950 +- ACPI_VIDEO_OUTPUT_SWITCHING_FORCE_VIDEO;
951 ++ ACPI_VIDEO_BACKLIGHT_FORCE_VIDEO;
952 + }
953 + return 1;
954 + }
955 +diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
956 +index 3b09e83..6a96da6 100644
957 +--- a/drivers/ata/libata-core.c
958 ++++ b/drivers/ata/libata-core.c
959 +@@ -159,6 +159,10 @@ int libata_allow_tpm = 0;
960 + module_param_named(allow_tpm, libata_allow_tpm, int, 0444);
961 + MODULE_PARM_DESC(allow_tpm, "Permit the use of TPM commands (0=off [default], 1=on)");
962 +
963 ++static int atapi_an;
964 ++module_param(atapi_an, int, 0444);
965 ++MODULE_PARM_DESC(atapi_an, "Enable ATAPI AN media presence notification (0=0ff [default], 1=on)");
966 ++
967 + MODULE_AUTHOR("Jeff Garzik");
968 + MODULE_DESCRIPTION("Library module for ATA devices");
969 + MODULE_LICENSE("GPL");
970 +@@ -2570,7 +2574,8 @@ int ata_dev_configure(struct ata_device *dev)
971 + * to enable ATAPI AN to discern between PHY status
972 + * changed notifications and ATAPI ANs.
973 + */
974 +- if ((ap->flags & ATA_FLAG_AN) && ata_id_has_atapi_AN(id) &&
975 ++ if (atapi_an &&
976 ++ (ap->flags & ATA_FLAG_AN) && ata_id_has_atapi_AN(id) &&
977 + (!sata_pmp_attached(ap) ||
978 + sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf) == 0)) {
979 + unsigned int err_mask;
980 +diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
981 +index 2ae15c3..776a895 100644
982 +--- a/drivers/ata/libata-sff.c
983 ++++ b/drivers/ata/libata-sff.c
984 +@@ -893,7 +893,7 @@ static void ata_pio_sector(struct ata_queued_cmd *qc)
985 + do_write);
986 + }
987 +
988 +- if (!do_write)
989 ++ if (!do_write && !PageSlab(page))
990 + flush_dcache_page(page);
991 +
992 + qc->curbytes += qc->sect_size;
993 +diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
994 +index 1eb4e02..ae2297c 100644
995 +--- a/drivers/ata/sata_nv.c
996 ++++ b/drivers/ata/sata_nv.c
997 +@@ -1673,7 +1673,6 @@ static void nv_mcp55_freeze(struct ata_port *ap)
998 + mask = readl(mmio_base + NV_INT_ENABLE_MCP55);
999 + mask &= ~(NV_INT_ALL_MCP55 << shift);
1000 + writel(mask, mmio_base + NV_INT_ENABLE_MCP55);
1001 +- ata_sff_freeze(ap);
1002 + }
1003 +
1004 + static void nv_mcp55_thaw(struct ata_port *ap)
1005 +@@ -1687,7 +1686,6 @@ static void nv_mcp55_thaw(struct ata_port *ap)
1006 + mask = readl(mmio_base + NV_INT_ENABLE_MCP55);
1007 + mask |= (NV_INT_MASK_MCP55 << shift);
1008 + writel(mask, mmio_base + NV_INT_ENABLE_MCP55);
1009 +- ata_sff_thaw(ap);
1010 + }
1011 +
1012 + static void nv_adma_error_handler(struct ata_port *ap)
1013 +@@ -2478,8 +2476,7 @@ static int nv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1014 + }
1015 +
1016 + pci_set_master(pdev);
1017 +- return ata_host_activate(host, pdev->irq, ipriv->irq_handler,
1018 +- IRQF_SHARED, ipriv->sht);
1019 ++ return ata_pci_sff_activate_host(host, ipriv->irq_handler, ipriv->sht);
1020 + }
1021 +
1022 + #ifdef CONFIG_PM
1023 +diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
1024 +index 02efd9a..e35596b 100644
1025 +--- a/drivers/ata/sata_via.c
1026 ++++ b/drivers/ata/sata_via.c
1027 +@@ -558,6 +558,19 @@ static void svia_configure(struct pci_dev *pdev)
1028 + tmp8 |= NATIVE_MODE_ALL;
1029 + pci_write_config_byte(pdev, SATA_NATIVE_MODE, tmp8);
1030 + }
1031 ++
1032 ++ /*
1033 ++ * vt6421 has problems talking to some drives. The following
1034 ++ * is the magic fix from Joseph Chan <JosephChan@×××××××.tw>.
1035 ++ * Please add proper documentation if possible.
1036 ++ *
1037 ++ * https://bugzilla.kernel.org/show_bug.cgi?id=15173
1038 ++ */
1039 ++ if (pdev->device == 0x3249) {
1040 ++ pci_read_config_byte(pdev, 0x52, &tmp8);
1041 ++ tmp8 |= 1 << 2;
1042 ++ pci_write_config_byte(pdev, 0x52, tmp8);
1043 ++ }
1044 + }
1045 +
1046 + static int svia_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1047 +diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
1048 +index e62a4cc..1e2196f 100644
1049 +--- a/drivers/base/cpu.c
1050 ++++ b/drivers/base/cpu.c
1051 +@@ -149,7 +149,7 @@ static ssize_t print_cpus_offline(struct sysdev_class *class, char *buf)
1052 + /* display offline cpus < nr_cpu_ids */
1053 + if (!alloc_cpumask_var(&offline, GFP_KERNEL))
1054 + return -ENOMEM;
1055 +- cpumask_complement(offline, cpu_online_mask);
1056 ++ cpumask_andnot(offline, cpu_possible_mask, cpu_online_mask);
1057 + n = cpulist_scnprintf(buf, len, offline);
1058 + free_cpumask_var(offline);
1059 +
1060 +diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
1061 +index d2e6980..abae8c9 100644
1062 +--- a/drivers/char/ipmi/ipmi_si_intf.c
1063 ++++ b/drivers/char/ipmi/ipmi_si_intf.c
1064 +@@ -310,9 +310,14 @@ static void deliver_recv_msg(struct smi_info *smi_info,
1065 + {
1066 + /* Deliver the message to the upper layer with the lock
1067 + released. */
1068 +- spin_unlock(&(smi_info->si_lock));
1069 +- ipmi_smi_msg_received(smi_info->intf, msg);
1070 +- spin_lock(&(smi_info->si_lock));
1071 ++
1072 ++ if (smi_info->run_to_completion) {
1073 ++ ipmi_smi_msg_received(smi_info->intf, msg);
1074 ++ } else {
1075 ++ spin_unlock(&(smi_info->si_lock));
1076 ++ ipmi_smi_msg_received(smi_info->intf, msg);
1077 ++ spin_lock(&(smi_info->si_lock));
1078 ++ }
1079 + }
1080 +
1081 + static void return_hosed_msg(struct smi_info *smi_info, int cCode)
1082 +diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
1083 +index 6fe4f77..234d9f6 100644
1084 +--- a/drivers/clocksource/sh_cmt.c
1085 ++++ b/drivers/clocksource/sh_cmt.c
1086 +@@ -413,18 +413,10 @@ static cycle_t sh_cmt_clocksource_read(struct clocksource *cs)
1087 + static int sh_cmt_clocksource_enable(struct clocksource *cs)
1088 + {
1089 + struct sh_cmt_priv *p = cs_to_sh_cmt(cs);
1090 +- int ret;
1091 +
1092 + p->total_cycles = 0;
1093 +
1094 +- ret = sh_cmt_start(p, FLAG_CLOCKSOURCE);
1095 +- if (ret)
1096 +- return ret;
1097 +-
1098 +- /* TODO: calculate good shift from rate and counter bit width */
1099 +- cs->shift = 0;
1100 +- cs->mult = clocksource_hz2mult(p->rate, cs->shift);
1101 +- return 0;
1102 ++ return sh_cmt_start(p, FLAG_CLOCKSOURCE);
1103 + }
1104 +
1105 + static void sh_cmt_clocksource_disable(struct clocksource *cs)
1106 +@@ -444,7 +436,18 @@ static int sh_cmt_register_clocksource(struct sh_cmt_priv *p,
1107 + cs->disable = sh_cmt_clocksource_disable;
1108 + cs->mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8);
1109 + cs->flags = CLOCK_SOURCE_IS_CONTINUOUS;
1110 ++
1111 ++ /* clk_get_rate() needs an enabled clock */
1112 ++ clk_enable(p->clk);
1113 ++ p->rate = clk_get_rate(p->clk) / (p->width == 16) ? 512 : 8;
1114 ++ clk_disable(p->clk);
1115 ++
1116 ++ /* TODO: calculate good shift from rate and counter bit width */
1117 ++ cs->shift = 10;
1118 ++ cs->mult = clocksource_hz2mult(p->rate, cs->shift);
1119 ++
1120 + pr_info("sh_cmt: %s used as clock source\n", cs->name);
1121 ++
1122 + clocksource_register(cs);
1123 + return 0;
1124 + }
1125 +diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
1126 +index ed635ae..3fc2ceb 100644
1127 +--- a/drivers/firewire/core-card.c
1128 ++++ b/drivers/firewire/core-card.c
1129 +@@ -239,7 +239,7 @@ void fw_schedule_bm_work(struct fw_card *card, unsigned long delay)
1130 + static void fw_card_bm_work(struct work_struct *work)
1131 + {
1132 + struct fw_card *card = container_of(work, struct fw_card, work.work);
1133 +- struct fw_device *root_device;
1134 ++ struct fw_device *root_device, *irm_device;
1135 + struct fw_node *root_node;
1136 + unsigned long flags;
1137 + int root_id, new_root_id, irm_id, local_id;
1138 +@@ -247,6 +247,7 @@ static void fw_card_bm_work(struct work_struct *work)
1139 + bool do_reset = false;
1140 + bool root_device_is_running;
1141 + bool root_device_is_cmc;
1142 ++ bool irm_is_1394_1995_only;
1143 +
1144 + spin_lock_irqsave(&card->lock, flags);
1145 +
1146 +@@ -256,12 +257,18 @@ static void fw_card_bm_work(struct work_struct *work)
1147 + }
1148 +
1149 + generation = card->generation;
1150 ++
1151 + root_node = card->root_node;
1152 + fw_node_get(root_node);
1153 + root_device = root_node->data;
1154 + root_device_is_running = root_device &&
1155 + atomic_read(&root_device->state) == FW_DEVICE_RUNNING;
1156 + root_device_is_cmc = root_device && root_device->cmc;
1157 ++
1158 ++ irm_device = card->irm_node->data;
1159 ++ irm_is_1394_1995_only = irm_device && irm_device->config_rom &&
1160 ++ (irm_device->config_rom[2] & 0x000000f0) == 0;
1161 ++
1162 + root_id = root_node->node_id;
1163 + irm_id = card->irm_node->node_id;
1164 + local_id = card->local_node->node_id;
1165 +@@ -284,8 +291,15 @@ static void fw_card_bm_work(struct work_struct *work)
1166 +
1167 + if (!card->irm_node->link_on) {
1168 + new_root_id = local_id;
1169 +- fw_notify("IRM has link off, making local node (%02x) root.\n",
1170 +- new_root_id);
1171 ++ fw_notify("%s, making local node (%02x) root.\n",
1172 ++ "IRM has link off", new_root_id);
1173 ++ goto pick_me;
1174 ++ }
1175 ++
1176 ++ if (irm_is_1394_1995_only) {
1177 ++ new_root_id = local_id;
1178 ++ fw_notify("%s, making local node (%02x) root.\n",
1179 ++ "IRM is not 1394a compliant", new_root_id);
1180 + goto pick_me;
1181 + }
1182 +
1183 +@@ -324,8 +338,8 @@ static void fw_card_bm_work(struct work_struct *work)
1184 + * root, and thus, IRM.
1185 + */
1186 + new_root_id = local_id;
1187 +- fw_notify("BM lock failed, making local node (%02x) root.\n",
1188 +- new_root_id);
1189 ++ fw_notify("%s, making local node (%02x) root.\n",
1190 ++ "BM lock failed", new_root_id);
1191 + goto pick_me;
1192 + }
1193 + } else if (card->bm_generation != generation) {
1194 +diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
1195 +index 8fb1346..259ec21 100644
1196 +--- a/drivers/gpu/drm/drm_edid.c
1197 ++++ b/drivers/gpu/drm/drm_edid.c
1198 +@@ -324,7 +324,7 @@ static struct drm_display_mode drm_dmt_modes[] = {
1199 + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
1200 + /* 1024x768@85Hz */
1201 + { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 94500, 1024, 1072,
1202 +- 1072, 1376, 0, 768, 769, 772, 808, 0,
1203 ++ 1168, 1376, 0, 768, 769, 772, 808, 0,
1204 + DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC) },
1205 + /* 1152x864@75Hz */
1206 + { DRM_MODE("1152x864", DRM_MODE_TYPE_DRIVER, 108000, 1152, 1216,
1207 +diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
1208 +index aa8a4e9..df6f7c9 100644
1209 +--- a/drivers/gpu/drm/i915/i915_gem.c
1210 ++++ b/drivers/gpu/drm/i915/i915_gem.c
1211 +@@ -2615,6 +2615,14 @@ i915_gem_object_bind_to_gtt(struct drm_gem_object *obj, unsigned alignment)
1212 + return -EINVAL;
1213 + }
1214 +
1215 ++ /* If the object is bigger than the entire aperture, reject it early
1216 ++ * before evicting everything in a vain attempt to find space.
1217 ++ */
1218 ++ if (obj->size > dev->gtt_total) {
1219 ++ DRM_ERROR("Attempting to bind an object larger than the aperture\n");
1220 ++ return -E2BIG;
1221 ++ }
1222 ++
1223 + search_free:
1224 + free_space = drm_mm_search_free(&dev_priv->mm.gtt_space,
1225 + obj->size, alignment, 0);
1226 +@@ -3939,6 +3947,17 @@ i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment)
1227 + int ret;
1228 +
1229 + i915_verify_inactive(dev, __FILE__, __LINE__);
1230 ++
1231 ++ if (obj_priv->gtt_space != NULL) {
1232 ++ if (alignment == 0)
1233 ++ alignment = i915_gem_get_gtt_alignment(obj);
1234 ++ if (obj_priv->gtt_offset & (alignment - 1)) {
1235 ++ ret = i915_gem_object_unbind(obj);
1236 ++ if (ret)
1237 ++ return ret;
1238 ++ }
1239 ++ }
1240 ++
1241 + if (obj_priv->gtt_space == NULL) {
1242 + ret = i915_gem_object_bind_to_gtt(obj, alignment);
1243 + if (ret)
1244 +diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
1245 +index 4a85aa3..bf05762 100644
1246 +--- a/drivers/gpu/drm/i915/intel_lvds.c
1247 ++++ b/drivers/gpu/drm/i915/intel_lvds.c
1248 +@@ -648,8 +648,12 @@ static const struct dmi_system_id bad_lid_status[] = {
1249 + */
1250 + static enum drm_connector_status intel_lvds_detect(struct drm_connector *connector)
1251 + {
1252 ++ struct drm_device *dev = connector->dev;
1253 + enum drm_connector_status status = connector_status_connected;
1254 +
1255 ++ if (IS_I8XX(dev))
1256 ++ return connector_status_connected;
1257 ++
1258 + if (!acpi_lid_open() && !dmi_check_system(bad_lid_status))
1259 + status = connector_status_disconnected;
1260 +
1261 +diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
1262 +index 969502a..a4813c6 100644
1263 +--- a/drivers/gpu/drm/radeon/radeon_atombios.c
1264 ++++ b/drivers/gpu/drm/radeon/radeon_atombios.c
1265 +@@ -942,7 +942,7 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct
1266 + lvds->native_mode.vtotal = lvds->native_mode.vdisplay +
1267 + le16_to_cpu(lvds_info->info.sLCDTiming.usVBlanking_Time);
1268 + lvds->native_mode.vsync_start = lvds->native_mode.vdisplay +
1269 +- le16_to_cpu(lvds_info->info.sLCDTiming.usVSyncWidth);
1270 ++ le16_to_cpu(lvds_info->info.sLCDTiming.usVSyncOffset);
1271 + lvds->native_mode.vsync_end = lvds->native_mode.vsync_start +
1272 + le16_to_cpu(lvds_info->info.sLCDTiming.usVSyncWidth);
1273 + lvds->panel_pwr_delay =
1274 +diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c
1275 +index 1c46848..c7236f4 100644
1276 +--- a/drivers/gpu/drm/radeon/radeon_cp.c
1277 ++++ b/drivers/gpu/drm/radeon/radeon_cp.c
1278 +@@ -1646,6 +1646,7 @@ static int radeon_do_resume_cp(struct drm_device *dev, struct drm_file *file_pri
1279 + radeon_cp_load_microcode(dev_priv);
1280 + radeon_cp_init_ring_buffer(dev, dev_priv, file_priv);
1281 +
1282 ++ dev_priv->have_z_offset = 0;
1283 + radeon_do_engine_reset(dev);
1284 + radeon_irq_set_state(dev, RADEON_SW_INT_ENABLE, 1);
1285 +
1286 +diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h
1287 +index 350962e..76e4070 100644
1288 +--- a/drivers/gpu/drm/radeon/radeon_drv.h
1289 ++++ b/drivers/gpu/drm/radeon/radeon_drv.h
1290 +@@ -267,6 +267,8 @@ typedef struct drm_radeon_private {
1291 +
1292 + u32 scratch_ages[5];
1293 +
1294 ++ int have_z_offset;
1295 ++
1296 + /* starting from here on, data is preserved accross an open */
1297 + uint32_t flags; /* see radeon_chip_flags */
1298 + resource_size_t fb_aper_offset;
1299 +diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c
1300 +index 38537d9..4747910 100644
1301 +--- a/drivers/gpu/drm/radeon/radeon_state.c
1302 ++++ b/drivers/gpu/drm/radeon/radeon_state.c
1303 +@@ -101,6 +101,7 @@ static __inline__ int radeon_check_and_fixup_packets(drm_radeon_private_t *
1304 + DRM_ERROR("Invalid depth buffer offset\n");
1305 + return -EINVAL;
1306 + }
1307 ++ dev_priv->have_z_offset = 1;
1308 + break;
1309 +
1310 + case RADEON_EMIT_PP_CNTL:
1311 +@@ -876,6 +877,12 @@ static void radeon_cp_dispatch_clear(struct drm_device * dev,
1312 + if (tmp & RADEON_BACK)
1313 + flags |= RADEON_FRONT;
1314 + }
1315 ++ if (flags & (RADEON_DEPTH|RADEON_STENCIL)) {
1316 ++ if (!dev_priv->have_z_offset) {
1317 ++ printk_once(KERN_ERR "radeon: illegal depth clear request. Buggy mesa detected - please update.\n");
1318 ++ flags &= ~(RADEON_DEPTH | RADEON_STENCIL);
1319 ++ }
1320 ++ }
1321 +
1322 + if (flags & (RADEON_FRONT | RADEON_BACK)) {
1323 +
1324 +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
1325 +index 668604b..1597863 100644
1326 +--- a/drivers/hid/hid-core.c
1327 ++++ b/drivers/hid/hid-core.c
1328 +@@ -1306,6 +1306,7 @@ static const struct hid_device_id hid_blacklist[] = {
1329 + { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0012) },
1330 + { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) },
1331 + { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) },
1332 ++ { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
1333 + { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
1334 + { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
1335 + { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
1336 +diff --git a/drivers/hid/hid-gyration.c b/drivers/hid/hid-gyration.c
1337 +index 62416e6..3975e03 100644
1338 +--- a/drivers/hid/hid-gyration.c
1339 ++++ b/drivers/hid/hid-gyration.c
1340 +@@ -73,6 +73,7 @@ static int gyration_event(struct hid_device *hdev, struct hid_field *field,
1341 + static const struct hid_device_id gyration_devices[] = {
1342 + { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) },
1343 + { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) },
1344 ++ { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
1345 + { }
1346 + };
1347 + MODULE_DEVICE_TABLE(hid, gyration_devices);
1348 +diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
1349 +index 9831c3a..252853d 100644
1350 +--- a/drivers/hid/hid-ids.h
1351 ++++ b/drivers/hid/hid-ids.h
1352 +@@ -251,6 +251,7 @@
1353 + #define USB_VENDOR_ID_GYRATION 0x0c16
1354 + #define USB_DEVICE_ID_GYRATION_REMOTE 0x0002
1355 + #define USB_DEVICE_ID_GYRATION_REMOTE_2 0x0003
1356 ++#define USB_DEVICE_ID_GYRATION_REMOTE_3 0x0008
1357 +
1358 + #define USB_VENDOR_ID_HAPP 0x078b
1359 + #define USB_DEVICE_ID_UGCI_DRIVING 0x0010
1360 +diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
1361 +index 65c232a..21d201b 100644
1362 +--- a/drivers/hwmon/ltc4245.c
1363 ++++ b/drivers/hwmon/ltc4245.c
1364 +@@ -45,9 +45,7 @@ enum ltc4245_cmd {
1365 + LTC4245_VEEIN = 0x19,
1366 + LTC4245_VEESENSE = 0x1a,
1367 + LTC4245_VEEOUT = 0x1b,
1368 +- LTC4245_GPIOADC1 = 0x1c,
1369 +- LTC4245_GPIOADC2 = 0x1d,
1370 +- LTC4245_GPIOADC3 = 0x1e,
1371 ++ LTC4245_GPIOADC = 0x1c,
1372 + };
1373 +
1374 + struct ltc4245_data {
1375 +@@ -61,7 +59,7 @@ struct ltc4245_data {
1376 + u8 cregs[0x08];
1377 +
1378 + /* Voltage registers */
1379 +- u8 vregs[0x0f];
1380 ++ u8 vregs[0x0d];
1381 + };
1382 +
1383 + static struct ltc4245_data *ltc4245_update_device(struct device *dev)
1384 +@@ -86,7 +84,7 @@ static struct ltc4245_data *ltc4245_update_device(struct device *dev)
1385 + data->cregs[i] = val;
1386 + }
1387 +
1388 +- /* Read voltage registers -- 0x10 to 0x1f */
1389 ++ /* Read voltage registers -- 0x10 to 0x1c */
1390 + for (i = 0; i < ARRAY_SIZE(data->vregs); i++) {
1391 + val = i2c_smbus_read_byte_data(client, i+0x10);
1392 + if (unlikely(val < 0))
1393 +@@ -128,9 +126,7 @@ static int ltc4245_get_voltage(struct device *dev, u8 reg)
1394 + case LTC4245_VEEOUT:
1395 + voltage = regval * -55;
1396 + break;
1397 +- case LTC4245_GPIOADC1:
1398 +- case LTC4245_GPIOADC2:
1399 +- case LTC4245_GPIOADC3:
1400 ++ case LTC4245_GPIOADC:
1401 + voltage = regval * 10;
1402 + break;
1403 + default:
1404 +@@ -297,9 +293,7 @@ LTC4245_ALARM(in7_min_alarm, (1 << 2), LTC4245_FAULT2);
1405 + LTC4245_ALARM(in8_min_alarm, (1 << 3), LTC4245_FAULT2);
1406 +
1407 + /* GPIO voltages */
1408 +-LTC4245_VOLTAGE(in9_input, LTC4245_GPIOADC1);
1409 +-LTC4245_VOLTAGE(in10_input, LTC4245_GPIOADC2);
1410 +-LTC4245_VOLTAGE(in11_input, LTC4245_GPIOADC3);
1411 ++LTC4245_VOLTAGE(in9_input, LTC4245_GPIOADC);
1412 +
1413 + /* Power Consumption (virtual) */
1414 + LTC4245_POWER(power1_input, LTC4245_12VSENSE);
1415 +@@ -342,8 +336,6 @@ static struct attribute *ltc4245_attributes[] = {
1416 + &sensor_dev_attr_in8_min_alarm.dev_attr.attr,
1417 +
1418 + &sensor_dev_attr_in9_input.dev_attr.attr,
1419 +- &sensor_dev_attr_in10_input.dev_attr.attr,
1420 +- &sensor_dev_attr_in11_input.dev_attr.attr,
1421 +
1422 + &sensor_dev_attr_power1_input.dev_attr.attr,
1423 + &sensor_dev_attr_power2_input.dev_attr.attr,
1424 +diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
1425 +index 0876d82..9451e28 100644
1426 +--- a/drivers/input/mouse/psmouse-base.c
1427 ++++ b/drivers/input/mouse/psmouse-base.c
1428 +@@ -1349,6 +1349,7 @@ static int psmouse_reconnect(struct serio *serio)
1429 + struct psmouse *psmouse = serio_get_drvdata(serio);
1430 + struct psmouse *parent = NULL;
1431 + struct serio_driver *drv = serio->drv;
1432 ++ unsigned char type;
1433 + int rc = -1;
1434 +
1435 + if (!drv || !psmouse) {
1436 +@@ -1368,10 +1369,15 @@ static int psmouse_reconnect(struct serio *serio)
1437 + if (psmouse->reconnect) {
1438 + if (psmouse->reconnect(psmouse))
1439 + goto out;
1440 +- } else if (psmouse_probe(psmouse) < 0 ||
1441 +- psmouse->type != psmouse_extensions(psmouse,
1442 +- psmouse_max_proto, false)) {
1443 +- goto out;
1444 ++ } else {
1445 ++ psmouse_reset(psmouse);
1446 ++
1447 ++ if (psmouse_probe(psmouse) < 0)
1448 ++ goto out;
1449 ++
1450 ++ type = psmouse_extensions(psmouse, psmouse_max_proto, false);
1451 ++ if (psmouse->type != type)
1452 ++ goto out;
1453 + }
1454 +
1455 + /* ok, the device type (and capabilities) match the old one,
1456 +diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h
1457 +index 8a223a4..5f9315b 100644
1458 +--- a/drivers/md/dm-exception-store.h
1459 ++++ b/drivers/md/dm-exception-store.h
1460 +@@ -162,7 +162,7 @@ static inline sector_t get_dev_size(struct block_device *bdev)
1461 + static inline chunk_t sector_to_chunk(struct dm_exception_store *store,
1462 + sector_t sector)
1463 + {
1464 +- return (sector & ~store->chunk_mask) >> store->chunk_shift;
1465 ++ return sector >> store->chunk_shift;
1466 + }
1467 +
1468 + int dm_exception_store_type_register(struct dm_exception_store_type *type);
1469 +diff --git a/drivers/md/md.c b/drivers/md/md.c
1470 +index f2e719d..0147079 100644
1471 +--- a/drivers/md/md.c
1472 ++++ b/drivers/md/md.c
1473 +@@ -5334,6 +5334,7 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
1474 + int err = 0;
1475 + void __user *argp = (void __user *)arg;
1476 + mddev_t *mddev = NULL;
1477 ++ int ro;
1478 +
1479 + if (!capable(CAP_SYS_ADMIN))
1480 + return -EACCES;
1481 +@@ -5469,6 +5470,34 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
1482 + err = do_md_stop(mddev, 1, 1);
1483 + goto done_unlock;
1484 +
1485 ++ case BLKROSET:
1486 ++ if (get_user(ro, (int __user *)(arg))) {
1487 ++ err = -EFAULT;
1488 ++ goto done_unlock;
1489 ++ }
1490 ++ err = -EINVAL;
1491 ++
1492 ++ /* if the bdev is going readonly the value of mddev->ro
1493 ++ * does not matter, no writes are coming
1494 ++ */
1495 ++ if (ro)
1496 ++ goto done_unlock;
1497 ++
1498 ++ /* are we are already prepared for writes? */
1499 ++ if (mddev->ro != 1)
1500 ++ goto done_unlock;
1501 ++
1502 ++ /* transitioning to readauto need only happen for
1503 ++ * arrays that call md_write_start
1504 ++ */
1505 ++ if (mddev->pers) {
1506 ++ err = restart_array(mddev);
1507 ++ if (err == 0) {
1508 ++ mddev->ro = 2;
1509 ++ set_disk_ro(mddev->gendisk, 0);
1510 ++ }
1511 ++ }
1512 ++ goto done_unlock;
1513 + }
1514 +
1515 + /*
1516 +diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
1517 +index e07ce2e..5ccad28 100644
1518 +--- a/drivers/md/raid1.c
1519 ++++ b/drivers/md/raid1.c
1520 +@@ -417,7 +417,7 @@ static void raid1_end_write_request(struct bio *bio, int error)
1521 + */
1522 + static int read_balance(conf_t *conf, r1bio_t *r1_bio)
1523 + {
1524 +- const unsigned long this_sector = r1_bio->sector;
1525 ++ const sector_t this_sector = r1_bio->sector;
1526 + int new_disk = conf->last_used, disk = new_disk;
1527 + int wonly_disk = -1;
1528 + const int sectors = r1_bio->sectors;
1529 +@@ -433,7 +433,7 @@ static int read_balance(conf_t *conf, r1bio_t *r1_bio)
1530 + retry:
1531 + if (conf->mddev->recovery_cp < MaxSector &&
1532 + (this_sector + sectors >= conf->next_resync)) {
1533 +- /* Choose the first operation device, for consistancy */
1534 ++ /* Choose the first operational device, for consistancy */
1535 + new_disk = 0;
1536 +
1537 + for (rdev = rcu_dereference(conf->mirrors[new_disk].rdev);
1538 +@@ -891,9 +891,10 @@ static int make_request(struct request_queue *q, struct bio * bio)
1539 + if (test_bit(Faulty, &rdev->flags)) {
1540 + rdev_dec_pending(rdev, mddev);
1541 + r1_bio->bios[i] = NULL;
1542 +- } else
1543 ++ } else {
1544 + r1_bio->bios[i] = bio;
1545 +- targets++;
1546 ++ targets++;
1547 ++ }
1548 + } else
1549 + r1_bio->bios[i] = NULL;
1550 + }
1551 +diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
1552 +index 3860ac7..6c2a35b 100644
1553 +--- a/drivers/md/raid10.c
1554 ++++ b/drivers/md/raid10.c
1555 +@@ -493,7 +493,7 @@ static int raid10_mergeable_bvec(struct request_queue *q,
1556 + */
1557 + static int read_balance(conf_t *conf, r10bio_t *r10_bio)
1558 + {
1559 +- const unsigned long this_sector = r10_bio->sector;
1560 ++ const sector_t this_sector = r10_bio->sector;
1561 + int disk, slot, nslot;
1562 + const int sectors = r10_bio->sectors;
1563 + sector_t new_distance, current_distance;
1564 +diff --git a/drivers/media/video/gspca/stv06xx/stv06xx.c b/drivers/media/video/gspca/stv06xx/stv06xx.c
1565 +index bfae63f..7878182 100644
1566 +--- a/drivers/media/video/gspca/stv06xx/stv06xx.c
1567 ++++ b/drivers/media/video/gspca/stv06xx/stv06xx.c
1568 +@@ -497,8 +497,6 @@ static const __devinitdata struct usb_device_id device_table[] = {
1569 + {USB_DEVICE(0x046D, 0x08F5), .driver_info = BRIDGE_ST6422 },
1570 + /* QuickCam Messenger (new) */
1571 + {USB_DEVICE(0x046D, 0x08F6), .driver_info = BRIDGE_ST6422 },
1572 +- /* QuickCam Messenger (new) */
1573 +- {USB_DEVICE(0x046D, 0x08DA), .driver_info = BRIDGE_ST6422 },
1574 + {}
1575 + };
1576 + MODULE_DEVICE_TABLE(usb, device_table);
1577 +diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
1578 +index dbf4de3..69698e5 100644
1579 +--- a/drivers/net/arcnet/com20020-pci.c
1580 ++++ b/drivers/net/arcnet/com20020-pci.c
1581 +@@ -165,8 +165,8 @@ static struct pci_device_id com20020pci_id_table[] = {
1582 + { 0x1571, 0xa204, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
1583 + { 0x1571, 0xa205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
1584 + { 0x1571, 0xa206, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
1585 +- { 0x10B5, 0x9030, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
1586 +- { 0x10B5, 0x9050, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
1587 ++ { 0x10B5, 0x9030, 0x10B5, 0x2978, 0, 0, ARC_CAN_10MBIT },
1588 ++ { 0x10B5, 0x9050, 0x10B5, 0x2273, 0, 0, ARC_CAN_10MBIT },
1589 + { 0x14BA, 0x6000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
1590 + { 0x10B5, 0x2200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ARC_CAN_10MBIT },
1591 + {0,}
1592 +diff --git a/drivers/net/atl1e/atl1e_ethtool.c b/drivers/net/atl1e/atl1e_ethtool.c
1593 +index 60edb9f..b0fb725 100644
1594 +--- a/drivers/net/atl1e/atl1e_ethtool.c
1595 ++++ b/drivers/net/atl1e/atl1e_ethtool.c
1596 +@@ -394,11 +394,13 @@ static const struct ethtool_ops atl1e_ethtool_ops = {
1597 + .get_eeprom = atl1e_get_eeprom,
1598 + .set_eeprom = atl1e_set_eeprom,
1599 + .get_tx_csum = atl1e_get_tx_csum,
1600 ++ .set_tx_csum = ethtool_op_set_tx_hw_csum,
1601 + .get_sg = ethtool_op_get_sg,
1602 + .set_sg = ethtool_op_set_sg,
1603 + #ifdef NETIF_F_TSO
1604 + .get_tso = ethtool_op_get_tso,
1605 + #endif
1606 ++ .set_tso = ethtool_op_set_tso,
1607 + };
1608 +
1609 + void atl1e_set_ethtool_ops(struct net_device *netdev)
1610 +diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
1611 +index 16d2ecd..9463e5d 100644
1612 +--- a/drivers/net/can/sja1000/sja1000.c
1613 ++++ b/drivers/net/can/sja1000/sja1000.c
1614 +@@ -84,6 +84,20 @@ static struct can_bittiming_const sja1000_bittiming_const = {
1615 + .brp_inc = 1,
1616 + };
1617 +
1618 ++static void sja1000_write_cmdreg(struct sja1000_priv *priv, u8 val)
1619 ++{
1620 ++ unsigned long flags;
1621 ++
1622 ++ /*
1623 ++ * The command register needs some locking and time to settle
1624 ++ * the write_reg() operation - especially on SMP systems.
1625 ++ */
1626 ++ spin_lock_irqsave(&priv->cmdreg_lock, flags);
1627 ++ priv->write_reg(priv, REG_CMR, val);
1628 ++ priv->read_reg(priv, REG_SR);
1629 ++ spin_unlock_irqrestore(&priv->cmdreg_lock, flags);
1630 ++}
1631 ++
1632 + static int sja1000_probe_chip(struct net_device *dev)
1633 + {
1634 + struct sja1000_priv *priv = netdev_priv(dev);
1635 +@@ -279,7 +293,7 @@ static netdev_tx_t sja1000_start_xmit(struct sk_buff *skb,
1636 +
1637 + can_put_echo_skb(skb, dev, 0);
1638 +
1639 +- priv->write_reg(priv, REG_CMR, CMD_TR);
1640 ++ sja1000_write_cmdreg(priv, CMD_TR);
1641 +
1642 + return NETDEV_TX_OK;
1643 + }
1644 +@@ -334,7 +348,7 @@ static void sja1000_rx(struct net_device *dev)
1645 + cf->data[i++] = 0;
1646 +
1647 + /* release receive buffer */
1648 +- priv->write_reg(priv, REG_CMR, CMD_RRB);
1649 ++ sja1000_write_cmdreg(priv, CMD_RRB);
1650 +
1651 + netif_rx(skb);
1652 +
1653 +@@ -368,7 +382,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
1654 + cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
1655 + stats->rx_over_errors++;
1656 + stats->rx_errors++;
1657 +- priv->write_reg(priv, REG_CMR, CMD_CDO); /* clear bit */
1658 ++ sja1000_write_cmdreg(priv, CMD_CDO); /* clear bit */
1659 + }
1660 +
1661 + if (isrc & IRQ_EI) {
1662 +diff --git a/drivers/net/can/sja1000/sja1000.h b/drivers/net/can/sja1000/sja1000.h
1663 +index 302d2c7..cfd3f57 100644
1664 +--- a/drivers/net/can/sja1000/sja1000.h
1665 ++++ b/drivers/net/can/sja1000/sja1000.h
1666 +@@ -165,6 +165,7 @@ struct sja1000_priv {
1667 +
1668 + void __iomem *reg_base; /* ioremap'ed address to registers */
1669 + unsigned long irq_flags; /* for request_irq() */
1670 ++ spinlock_t cmdreg_lock; /* lock for concurrent cmd register writes */
1671 +
1672 + u16 flags; /* custom mode flags */
1673 + u8 ocr; /* output control register */
1674 +diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
1675 +index 6339d65..a873c5d 100644
1676 +--- a/drivers/net/ixgbe/ixgbe_main.c
1677 ++++ b/drivers/net/ixgbe/ixgbe_main.c
1678 +@@ -5241,9 +5241,13 @@ static int ixgbe_maybe_stop_tx(struct net_device *netdev,
1679 + static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb)
1680 + {
1681 + struct ixgbe_adapter *adapter = netdev_priv(dev);
1682 ++ int txq = smp_processor_id();
1683 +
1684 +- if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE)
1685 +- return smp_processor_id();
1686 ++ if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) {
1687 ++ while (unlikely(txq >= dev->real_num_tx_queues))
1688 ++ txq -= dev->real_num_tx_queues;
1689 ++ return txq;
1690 ++ }
1691 +
1692 + if (adapter->flags & IXGBE_FLAG_DCB_ENABLED)
1693 + return (skb->vlan_tci & IXGBE_TX_FLAGS_VLAN_PRIO_MASK) >> 13;
1694 +diff --git a/drivers/net/mlx4/icm.c b/drivers/net/mlx4/icm.c
1695 +index 04b382f..83eef8e 100644
1696 +--- a/drivers/net/mlx4/icm.c
1697 ++++ b/drivers/net/mlx4/icm.c
1698 +@@ -174,9 +174,10 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages,
1699 +
1700 + if (chunk->nsg <= 0)
1701 + goto fail;
1702 ++ }
1703 +
1704 ++ if (chunk->npages == MLX4_ICM_CHUNK_LEN)
1705 + chunk = NULL;
1706 +- }
1707 +
1708 + npages -= 1 << cur_order;
1709 + } else {
1710 +diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
1711 +index 5910df6..b724d7f 100644
1712 +--- a/drivers/net/pppol2tp.c
1713 ++++ b/drivers/net/pppol2tp.c
1714 +@@ -1178,7 +1178,8 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
1715 + /* Calculate UDP checksum if configured to do so */
1716 + if (sk_tun->sk_no_check == UDP_CSUM_NOXMIT)
1717 + skb->ip_summed = CHECKSUM_NONE;
1718 +- else if (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM)) {
1719 ++ else if ((skb_dst(skb) && skb_dst(skb)->dev) &&
1720 ++ (!(skb_dst(skb)->dev->features & NETIF_F_V4_CSUM))) {
1721 + skb->ip_summed = CHECKSUM_COMPLETE;
1722 + csum = skb_checksum(skb, 0, udp_len, 0);
1723 + uh->check = csum_tcpudp_magic(inet->saddr, inet->daddr,
1724 +diff --git a/drivers/net/tulip/Kconfig b/drivers/net/tulip/Kconfig
1725 +index 1cc8cf4..516713f 100644
1726 +--- a/drivers/net/tulip/Kconfig
1727 ++++ b/drivers/net/tulip/Kconfig
1728 +@@ -101,6 +101,10 @@ config TULIP_NAPI_HW_MITIGATION
1729 +
1730 + If in doubt, say Y.
1731 +
1732 ++config TULIP_DM910X
1733 ++ def_bool y
1734 ++ depends on TULIP && SPARC
1735 ++
1736 + config DE4X5
1737 + tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA"
1738 + depends on PCI || EISA
1739 +diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
1740 +index a45ded0..b94370f 100644
1741 +--- a/drivers/net/tulip/dmfe.c
1742 ++++ b/drivers/net/tulip/dmfe.c
1743 +@@ -92,6 +92,10 @@
1744 + #include <asm/uaccess.h>
1745 + #include <asm/irq.h>
1746 +
1747 ++#ifdef CONFIG_TULIP_DM910X
1748 ++#include <linux/of.h>
1749 ++#endif
1750 ++
1751 +
1752 + /* Board/System/Debug information/definition ---------------- */
1753 + #define PCI_DM9132_ID 0x91321282 /* Davicom DM9132 ID */
1754 +@@ -377,6 +381,23 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
1755 + if (!printed_version++)
1756 + printk(version);
1757 +
1758 ++ /*
1759 ++ * SPARC on-board DM910x chips should be handled by the main
1760 ++ * tulip driver, except for early DM9100s.
1761 ++ */
1762 ++#ifdef CONFIG_TULIP_DM910X
1763 ++ if ((ent->driver_data == PCI_DM9100_ID && pdev->revision >= 0x30) ||
1764 ++ ent->driver_data == PCI_DM9102_ID) {
1765 ++ struct device_node *dp = pci_device_to_OF_node(pdev);
1766 ++
1767 ++ if (dp && of_get_property(dp, "local-mac-address", NULL)) {
1768 ++ printk(KERN_INFO DRV_NAME
1769 ++ ": skipping on-board DM910x (use tulip)\n");
1770 ++ return -ENODEV;
1771 ++ }
1772 ++ }
1773 ++#endif
1774 ++
1775 + /* Init network device */
1776 + dev = alloc_etherdev(sizeof(*db));
1777 + if (dev == NULL)
1778 +diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
1779 +index 6b2330e..88bf54f 100644
1780 +--- a/drivers/net/tulip/tulip_core.c
1781 ++++ b/drivers/net/tulip/tulip_core.c
1782 +@@ -196,9 +196,13 @@ struct tulip_chip_table tulip_tbl[] = {
1783 + | HAS_NWAY | HAS_PCI_MWI, tulip_timer, tulip_media_task },
1784 +
1785 + /* DM910X */
1786 ++#ifdef CONFIG_TULIP_DM910X
1787 + { "Davicom DM9102/DM9102A", 128, 0x0001ebef,
1788 + HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_ACPI,
1789 + tulip_timer, tulip_media_task },
1790 ++#else
1791 ++ { NULL },
1792 ++#endif
1793 +
1794 + /* RS7112 */
1795 + { "Conexant LANfinity", 256, 0x0001ebef,
1796 +@@ -228,8 +232,10 @@ static struct pci_device_id tulip_pci_tbl[] = {
1797 + { 0x1259, 0xa120, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
1798 + { 0x11F6, 0x9881, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMPEX9881 },
1799 + { 0x8086, 0x0039, PCI_ANY_ID, PCI_ANY_ID, 0, 0, I21145 },
1800 ++#ifdef CONFIG_TULIP_DM910X
1801 + { 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X },
1802 + { 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X },
1803 ++#endif
1804 + { 0x1113, 0x1216, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
1805 + { 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 },
1806 + { 0x1113, 0x9511, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
1807 +@@ -1299,18 +1305,30 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1808 + }
1809 +
1810 + /*
1811 +- * Early DM9100's need software CRC and the DMFE driver
1812 ++ * DM910x chips should be handled by the dmfe driver, except
1813 ++ * on-board chips on SPARC systems. Also, early DM9100s need
1814 ++ * software CRC which only the dmfe driver supports.
1815 + */
1816 +
1817 +- if (pdev->vendor == 0x1282 && pdev->device == 0x9100)
1818 +- {
1819 +- /* Read Chip revision */
1820 +- if (pdev->revision < 0x30)
1821 +- {
1822 +- printk(KERN_ERR PFX "skipping early DM9100 with Crc bug (use dmfe)\n");
1823 ++#ifdef CONFIG_TULIP_DM910X
1824 ++ if (chip_idx == DM910X) {
1825 ++ struct device_node *dp;
1826 ++
1827 ++ if (pdev->vendor == 0x1282 && pdev->device == 0x9100 &&
1828 ++ pdev->revision < 0x30) {
1829 ++ printk(KERN_INFO PFX
1830 ++ "skipping early DM9100 with Crc bug (use dmfe)\n");
1831 ++ return -ENODEV;
1832 ++ }
1833 ++
1834 ++ dp = pci_device_to_OF_node(pdev);
1835 ++ if (!(dp && of_get_property(dp, "local-mac-address", NULL))) {
1836 ++ printk(KERN_INFO PFX
1837 ++ "skipping DM910x expansion card (use dmfe)\n");
1838 + return -ENODEV;
1839 + }
1840 + }
1841 ++#endif
1842 +
1843 + /*
1844 + * Looks for early PCI chipsets where people report hangs
1845 +diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
1846 +index 4469f24..b4b25ff 100644
1847 +--- a/drivers/net/ucc_geth.c
1848 ++++ b/drivers/net/ucc_geth.c
1849 +@@ -1563,7 +1563,10 @@ static int ugeth_disable(struct ucc_geth_private *ugeth, enum comm_dir mode)
1850 +
1851 + static void ugeth_quiesce(struct ucc_geth_private *ugeth)
1852 + {
1853 +- /* Wait for and prevent any further xmits. */
1854 ++ /* Prevent any further xmits, plus detach the device. */
1855 ++ netif_device_detach(ugeth->ndev);
1856 ++
1857 ++ /* Wait for any current xmits to finish. */
1858 + netif_tx_disable(ugeth->ndev);
1859 +
1860 + /* Disable the interrupt to avoid NAPI rescheduling. */
1861 +@@ -1577,7 +1580,7 @@ static void ugeth_activate(struct ucc_geth_private *ugeth)
1862 + {
1863 + napi_enable(&ugeth->napi);
1864 + enable_irq(ugeth->ug_info->uf_info.irq);
1865 +- netif_tx_wake_all_queues(ugeth->ndev);
1866 ++ netif_device_attach(ugeth->ndev);
1867 + }
1868 +
1869 + /* Called every time the controller might need to be made
1870 +@@ -3273,13 +3276,12 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ)
1871 + /* Handle the transmitted buffer and release */
1872 + /* the BD to be used with the current frame */
1873 +
1874 +- if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0))
1875 ++ skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
1876 ++ if (!skb)
1877 + break;
1878 +
1879 + dev->stats.tx_packets++;
1880 +
1881 +- skb = ugeth->tx_skbuff[txQ][ugeth->skb_dirtytx[txQ]];
1882 +-
1883 + if (skb_queue_len(&ugeth->rx_recycle) < RX_BD_RING_LEN &&
1884 + skb_recycle_check(skb,
1885 + ugeth->ug_info->uf_info.max_rx_buf_length +
1886 +diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
1887 +index e04e5be..74b9d7d 100644
1888 +--- a/drivers/net/via-velocity.c
1889 ++++ b/drivers/net/via-velocity.c
1890 +@@ -2186,8 +2186,6 @@ static int velocity_open(struct net_device *dev)
1891 + /* Ensure chip is running */
1892 + pci_set_power_state(vptr->pdev, PCI_D0);
1893 +
1894 +- velocity_give_many_rx_descs(vptr);
1895 +-
1896 + velocity_init_registers(vptr, VELOCITY_INIT_COLD);
1897 +
1898 + ret = request_irq(vptr->pdev->irq, &velocity_intr, IRQF_SHARED,
1899 +@@ -2199,6 +2197,8 @@ static int velocity_open(struct net_device *dev)
1900 + goto out;
1901 + }
1902 +
1903 ++ velocity_give_many_rx_descs(vptr);
1904 ++
1905 + mac_enable_int(vptr->mac_regs);
1906 + netif_start_queue(dev);
1907 + vptr->flags |= VELOCITY_FLAGS_OPENED;
1908 +@@ -2287,10 +2287,10 @@ static int velocity_change_mtu(struct net_device *dev, int new_mtu)
1909 +
1910 + dev->mtu = new_mtu;
1911 +
1912 +- velocity_give_many_rx_descs(vptr);
1913 +-
1914 + velocity_init_registers(vptr, VELOCITY_INIT_COLD);
1915 +
1916 ++ velocity_give_many_rx_descs(vptr);
1917 ++
1918 + mac_enable_int(vptr->mac_regs);
1919 + netif_start_queue(dev);
1920 +
1921 +diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
1922 +index b9e002f..7e3788d 100644
1923 +--- a/drivers/net/virtio_net.c
1924 ++++ b/drivers/net/virtio_net.c
1925 +@@ -398,8 +398,7 @@ static void refill_work(struct work_struct *work)
1926 +
1927 + vi = container_of(work, struct virtnet_info, refill.work);
1928 + napi_disable(&vi->napi);
1929 +- try_fill_recv(vi, GFP_KERNEL);
1930 +- still_empty = (vi->num == 0);
1931 ++ still_empty = !try_fill_recv(vi, GFP_KERNEL);
1932 + napi_enable(&vi->napi);
1933 +
1934 + /* In theory, this can happen: if we don't get any buffers in
1935 +diff --git a/drivers/net/wireless/ath/ar9170/hw.h b/drivers/net/wireless/ath/ar9170/hw.h
1936 +index 6cbfb2f..3931181 100644
1937 +--- a/drivers/net/wireless/ath/ar9170/hw.h
1938 ++++ b/drivers/net/wireless/ath/ar9170/hw.h
1939 +@@ -422,5 +422,6 @@ enum ar9170_txq {
1940 +
1941 + #define AR9170_TXQ_DEPTH 32
1942 + #define AR9170_TX_MAX_PENDING 128
1943 ++#define AR9170_RX_STREAM_MAX_SIZE 65535
1944 +
1945 + #endif /* __AR9170_HW_H */
1946 +diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
1947 +index c1f8c69..3e547b5 100644
1948 +--- a/drivers/net/wireless/ath/ar9170/main.c
1949 ++++ b/drivers/net/wireless/ath/ar9170/main.c
1950 +@@ -2526,7 +2526,7 @@ void *ar9170_alloc(size_t priv_size)
1951 + * tends to split the streams into seperate rx descriptors.
1952 + */
1953 +
1954 +- skb = __dev_alloc_skb(AR9170_MAX_RX_BUFFER_SIZE, GFP_KERNEL);
1955 ++ skb = __dev_alloc_skb(AR9170_RX_STREAM_MAX_SIZE, GFP_KERNEL);
1956 + if (!skb)
1957 + goto err_nomem;
1958 +
1959 +diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
1960 +index 6c70481..dbcb729 100644
1961 +--- a/drivers/net/wireless/ath/ar9170/usb.c
1962 ++++ b/drivers/net/wireless/ath/ar9170/usb.c
1963 +@@ -66,18 +66,28 @@ static struct usb_device_id ar9170_usb_ids[] = {
1964 + { USB_DEVICE(0x0cf3, 0x1001) },
1965 + /* TP-Link TL-WN821N v2 */
1966 + { USB_DEVICE(0x0cf3, 0x1002) },
1967 ++ /* 3Com Dual Band 802.11n USB Adapter */
1968 ++ { USB_DEVICE(0x0cf3, 0x1010) },
1969 ++ /* H3C Dual Band 802.11n USB Adapter */
1970 ++ { USB_DEVICE(0x0cf3, 0x1011) },
1971 + /* Cace Airpcap NX */
1972 + { USB_DEVICE(0xcace, 0x0300) },
1973 + /* D-Link DWA 160 A1 */
1974 + { USB_DEVICE(0x07d1, 0x3c10) },
1975 + /* D-Link DWA 160 A2 */
1976 + { USB_DEVICE(0x07d1, 0x3a09) },
1977 ++ /* Netgear WNA1000 */
1978 ++ { USB_DEVICE(0x0846, 0x9040) },
1979 + /* Netgear WNDA3100 */
1980 + { USB_DEVICE(0x0846, 0x9010) },
1981 + /* Netgear WN111 v2 */
1982 + { USB_DEVICE(0x0846, 0x9001) },
1983 + /* Zydas ZD1221 */
1984 + { USB_DEVICE(0x0ace, 0x1221) },
1985 ++ /* Proxim ORiNOCO 802.11n USB */
1986 ++ { USB_DEVICE(0x1435, 0x0804) },
1987 ++ /* WNC Generic 11n USB Dongle */
1988 ++ { USB_DEVICE(0x1435, 0x0326) },
1989 + /* ZyXEL NWD271N */
1990 + { USB_DEVICE(0x0586, 0x3417) },
1991 + /* Z-Com UB81 BG */
1992 +diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
1993 +index 6313788..cefbfb9 100644
1994 +--- a/drivers/net/wireless/ath/ath5k/base.c
1995 ++++ b/drivers/net/wireless/ath/ath5k/base.c
1996 +@@ -2975,13 +2975,15 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
1997 +
1998 + if (changed_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) {
1999 + if (*new_flags & FIF_PROMISC_IN_BSS) {
2000 +- rfilt |= AR5K_RX_FILTER_PROM;
2001 + __set_bit(ATH_STAT_PROMISC, sc->status);
2002 + } else {
2003 + __clear_bit(ATH_STAT_PROMISC, sc->status);
2004 + }
2005 + }
2006 +
2007 ++ if (test_bit(ATH_STAT_PROMISC, sc->status))
2008 ++ rfilt |= AR5K_RX_FILTER_PROM;
2009 ++
2010 + /* Note, AR5K_RX_FILTER_MCAST is already enabled */
2011 + if (*new_flags & FIF_ALLMULTI) {
2012 + mfilt[0] = ~0;
2013 +diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
2014 +index f735a96..2185f97 100644
2015 +--- a/drivers/net/wireless/ath/ath9k/hw.c
2016 ++++ b/drivers/net/wireless/ath/ath9k/hw.c
2017 +@@ -398,7 +398,6 @@ static void ath9k_hw_init_config(struct ath_hw *ah)
2018 + ah->config.pcie_clock_req = 0;
2019 + ah->config.pcie_waen = 0;
2020 + ah->config.analog_shiftreg = 1;
2021 +- ah->config.ht_enable = 1;
2022 + ah->config.ofdm_trig_low = 200;
2023 + ah->config.ofdm_trig_high = 500;
2024 + ah->config.cck_trig_high = 200;
2025 +@@ -412,6 +411,11 @@ static void ath9k_hw_init_config(struct ath_hw *ah)
2026 + ah->config.spurchans[i][1] = AR_NO_SPUR;
2027 + }
2028 +
2029 ++ if (ah->hw_version.devid != AR2427_DEVID_PCIE)
2030 ++ ah->config.ht_enable = 1;
2031 ++ else
2032 ++ ah->config.ht_enable = 0;
2033 ++
2034 + ah->config.intr_mitigation = true;
2035 +
2036 + /*
2037 +@@ -617,6 +621,7 @@ static bool ath9k_hw_devid_supported(u16 devid)
2038 + case AR9285_DEVID_PCIE:
2039 + case AR5416_DEVID_AR9287_PCI:
2040 + case AR5416_DEVID_AR9287_PCIE:
2041 ++ case AR2427_DEVID_PCIE:
2042 + return true;
2043 + default:
2044 + break;
2045 +diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
2046 +index ff4383b..262556a 100644
2047 +--- a/drivers/net/wireless/ath/ath9k/hw.h
2048 ++++ b/drivers/net/wireless/ath/ath9k/hw.h
2049 +@@ -37,6 +37,7 @@
2050 + #define AR9280_DEVID_PCI 0x0029
2051 + #define AR9280_DEVID_PCIE 0x002a
2052 + #define AR9285_DEVID_PCIE 0x002b
2053 ++#define AR2427_DEVID_PCIE 0x002c
2054 + #define AR5416_AR9100_DEVID 0x000b
2055 + #define AR_SUBVENDOR_ID_NOG 0x0e11
2056 + #define AR_SUBVENDOR_ID_NEW_A 0x7065
2057 +diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
2058 +index 15eb245..087b7e5 100644
2059 +--- a/drivers/net/wireless/ath/ath9k/main.c
2060 ++++ b/drivers/net/wireless/ath/ath9k/main.c
2061 +@@ -1541,12 +1541,14 @@ void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
2062 + hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
2063 + IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |
2064 + IEEE80211_HW_SIGNAL_DBM |
2065 +- IEEE80211_HW_AMPDU_AGGREGATION |
2066 + IEEE80211_HW_SUPPORTS_PS |
2067 + IEEE80211_HW_PS_NULLFUNC_STACK |
2068 + IEEE80211_HW_REPORTS_TX_ACK_STATUS |
2069 + IEEE80211_HW_SPECTRUM_MGMT;
2070 +
2071 ++ if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
2072 ++ hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
2073 ++
2074 + if (AR_SREV_9160_10_OR_LATER(sc->sc_ah) || modparam_nohwcrypt)
2075 + hw->flags |= IEEE80211_HW_MFP_CAPABLE;
2076 +
2077 +diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
2078 +index 903dd8a..14cf3fe 100644
2079 +--- a/drivers/net/wireless/ath/ath9k/pci.c
2080 ++++ b/drivers/net/wireless/ath/ath9k/pci.c
2081 +@@ -25,6 +25,7 @@ static struct pci_device_id ath_pci_id_table[] __devinitdata = {
2082 + { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */
2083 + { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */
2084 + { PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */
2085 ++ { PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */
2086 + { PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI */
2087 + { PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */
2088 + { 0 }
2089 +diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
2090 +index d636639..1f423f2 100644
2091 +--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
2092 ++++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
2093 +@@ -1674,12 +1674,12 @@ struct iwl_cfg iwl5300_agn_cfg = {
2094 + .use_rts_for_ht = true, /* use rts/cts protection */
2095 + };
2096 +
2097 +-struct iwl_cfg iwl5100_bg_cfg = {
2098 +- .name = "5100BG",
2099 ++struct iwl_cfg iwl5100_bgn_cfg = {
2100 ++ .name = "5100BGN",
2101 + .fw_name_pre = IWL5000_FW_PRE,
2102 + .ucode_api_max = IWL5000_UCODE_API_MAX,
2103 + .ucode_api_min = IWL5000_UCODE_API_MIN,
2104 +- .sku = IWL_SKU_G,
2105 ++ .sku = IWL_SKU_G|IWL_SKU_N,
2106 + .ops = &iwl5000_ops,
2107 + .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
2108 + .eeprom_ver = EEPROM_5000_EEPROM_VERSION,
2109 +@@ -1705,7 +1705,6 @@ struct iwl_cfg iwl5100_abg_cfg = {
2110 + .valid_tx_ant = ANT_B,
2111 + .valid_rx_ant = ANT_AB,
2112 + .need_pll_cfg = true,
2113 +- .ht_greenfield_support = true,
2114 + };
2115 +
2116 + struct iwl_cfg iwl5100_agn_cfg = {
2117 +@@ -1762,6 +1761,22 @@ struct iwl_cfg iwl5150_agn_cfg = {
2118 + .use_rts_for_ht = true, /* use rts/cts protection */
2119 + };
2120 +
2121 ++struct iwl_cfg iwl5150_abg_cfg = {
2122 ++ .name = "5150ABG",
2123 ++ .fw_name_pre = IWL5150_FW_PRE,
2124 ++ .ucode_api_max = IWL5150_UCODE_API_MAX,
2125 ++ .ucode_api_min = IWL5150_UCODE_API_MIN,
2126 ++ .sku = IWL_SKU_A|IWL_SKU_G,
2127 ++ .ops = &iwl5150_ops,
2128 ++ .eeprom_size = IWL_5000_EEPROM_IMG_SIZE,
2129 ++ .eeprom_ver = EEPROM_5050_EEPROM_VERSION,
2130 ++ .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION,
2131 ++ .mod_params = &iwl50_mod_params,
2132 ++ .valid_tx_ant = ANT_A,
2133 ++ .valid_rx_ant = ANT_AB,
2134 ++ .need_pll_cfg = true,
2135 ++};
2136 ++
2137 + MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
2138 + MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));
2139 +
2140 +diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
2141 +index 0eb2591..1a3dfa2 100644
2142 +--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
2143 ++++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
2144 +@@ -402,10 +402,23 @@ static void rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv,
2145 + struct iwl_lq_sta *lq_data, u8 tid,
2146 + struct ieee80211_sta *sta)
2147 + {
2148 ++ int ret;
2149 ++
2150 + if (rs_tl_get_load(lq_data, tid) > IWL_AGG_LOAD_THRESHOLD) {
2151 + IWL_DEBUG_HT(priv, "Starting Tx agg: STA: %pM tid: %d\n",
2152 + sta->addr, tid);
2153 +- ieee80211_start_tx_ba_session(priv->hw, sta->addr, tid);
2154 ++ ret = ieee80211_start_tx_ba_session(priv->hw, sta->addr, tid);
2155 ++ if (ret == -EAGAIN) {
2156 ++ /*
2157 ++ * driver and mac80211 is out of sync
2158 ++ * this might be cause by reloading firmware
2159 ++ * stop the tx ba session here
2160 ++ */
2161 ++ IWL_DEBUG_HT(priv, "Fail start Tx agg on tid: %d\n",
2162 ++ tid);
2163 ++ ret = ieee80211_stop_tx_ba_session(priv->hw, sta->addr, tid,
2164 ++ WLAN_BACK_INITIATOR);
2165 ++ }
2166 + }
2167 + }
2168 +
2169 +@@ -2180,9 +2193,12 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
2170 +
2171 + /* Else we have enough samples; calculate estimate of
2172 + * actual average throughput */
2173 +-
2174 +- BUG_ON(window->average_tpt != ((window->success_ratio *
2175 +- tbl->expected_tpt[index] + 64) / 128));
2176 ++ if (window->average_tpt != ((window->success_ratio *
2177 ++ tbl->expected_tpt[index] + 64) / 128)) {
2178 ++ IWL_ERR(priv, "expected_tpt should have been calculated by now\n");
2179 ++ window->average_tpt = ((window->success_ratio *
2180 ++ tbl->expected_tpt[index] + 64) / 128);
2181 ++ }
2182 +
2183 + /* If we are searching for better modulation mode, check success. */
2184 + if (lq_sta->search_better_tbl &&
2185 +diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
2186 +index 921dc4a..166bedd 100644
2187 +--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
2188 ++++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
2189 +@@ -3203,23 +3203,63 @@ static struct pci_device_id iwl_hw_card_ids[] = {
2190 + {IWL_PCI_DEVICE(0x4230, PCI_ANY_ID, iwl4965_agn_cfg)},
2191 + #endif /* CONFIG_IWL4965 */
2192 + #ifdef CONFIG_IWL5000
2193 +- {IWL_PCI_DEVICE(0x4232, 0x1205, iwl5100_bg_cfg)},
2194 +- {IWL_PCI_DEVICE(0x4232, 0x1305, iwl5100_bg_cfg)},
2195 +- {IWL_PCI_DEVICE(0x4232, 0x1206, iwl5100_abg_cfg)},
2196 +- {IWL_PCI_DEVICE(0x4232, 0x1306, iwl5100_abg_cfg)},
2197 +- {IWL_PCI_DEVICE(0x4232, 0x1326, iwl5100_abg_cfg)},
2198 +- {IWL_PCI_DEVICE(0x4237, 0x1216, iwl5100_abg_cfg)},
2199 +- {IWL_PCI_DEVICE(0x4232, PCI_ANY_ID, iwl5100_agn_cfg)},
2200 +- {IWL_PCI_DEVICE(0x4235, PCI_ANY_ID, iwl5300_agn_cfg)},
2201 +- {IWL_PCI_DEVICE(0x4236, PCI_ANY_ID, iwl5300_agn_cfg)},
2202 +- {IWL_PCI_DEVICE(0x4237, PCI_ANY_ID, iwl5100_agn_cfg)},
2203 +-/* 5350 WiFi/WiMax */
2204 +- {IWL_PCI_DEVICE(0x423A, 0x1001, iwl5350_agn_cfg)},
2205 +- {IWL_PCI_DEVICE(0x423A, 0x1021, iwl5350_agn_cfg)},
2206 +- {IWL_PCI_DEVICE(0x423B, 0x1011, iwl5350_agn_cfg)},
2207 +-/* 5150 Wifi/WiMax */
2208 +- {IWL_PCI_DEVICE(0x423C, PCI_ANY_ID, iwl5150_agn_cfg)},
2209 +- {IWL_PCI_DEVICE(0x423D, PCI_ANY_ID, iwl5150_agn_cfg)},
2210 ++/* 5100 Series WiFi */
2211 ++ {IWL_PCI_DEVICE(0x4232, 0x1201, iwl5100_agn_cfg)}, /* Mini Card */
2212 ++ {IWL_PCI_DEVICE(0x4232, 0x1301, iwl5100_agn_cfg)}, /* Half Mini Card */
2213 ++ {IWL_PCI_DEVICE(0x4232, 0x1204, iwl5100_agn_cfg)}, /* Mini Card */
2214 ++ {IWL_PCI_DEVICE(0x4232, 0x1304, iwl5100_agn_cfg)}, /* Half Mini Card */
2215 ++ {IWL_PCI_DEVICE(0x4232, 0x1205, iwl5100_bgn_cfg)}, /* Mini Card */
2216 ++ {IWL_PCI_DEVICE(0x4232, 0x1305, iwl5100_bgn_cfg)}, /* Half Mini Card */
2217 ++ {IWL_PCI_DEVICE(0x4232, 0x1206, iwl5100_abg_cfg)}, /* Mini Card */
2218 ++ {IWL_PCI_DEVICE(0x4232, 0x1306, iwl5100_abg_cfg)}, /* Half Mini Card */
2219 ++ {IWL_PCI_DEVICE(0x4232, 0x1221, iwl5100_agn_cfg)}, /* Mini Card */
2220 ++ {IWL_PCI_DEVICE(0x4232, 0x1321, iwl5100_agn_cfg)}, /* Half Mini Card */
2221 ++ {IWL_PCI_DEVICE(0x4232, 0x1224, iwl5100_agn_cfg)}, /* Mini Card */
2222 ++ {IWL_PCI_DEVICE(0x4232, 0x1324, iwl5100_agn_cfg)}, /* Half Mini Card */
2223 ++ {IWL_PCI_DEVICE(0x4232, 0x1225, iwl5100_bgn_cfg)}, /* Mini Card */
2224 ++ {IWL_PCI_DEVICE(0x4232, 0x1325, iwl5100_bgn_cfg)}, /* Half Mini Card */
2225 ++ {IWL_PCI_DEVICE(0x4232, 0x1226, iwl5100_abg_cfg)}, /* Mini Card */
2226 ++ {IWL_PCI_DEVICE(0x4232, 0x1326, iwl5100_abg_cfg)}, /* Half Mini Card */
2227 ++ {IWL_PCI_DEVICE(0x4237, 0x1211, iwl5100_agn_cfg)}, /* Mini Card */
2228 ++ {IWL_PCI_DEVICE(0x4237, 0x1311, iwl5100_agn_cfg)}, /* Half Mini Card */
2229 ++ {IWL_PCI_DEVICE(0x4237, 0x1214, iwl5100_agn_cfg)}, /* Mini Card */
2230 ++ {IWL_PCI_DEVICE(0x4237, 0x1314, iwl5100_agn_cfg)}, /* Half Mini Card */
2231 ++ {IWL_PCI_DEVICE(0x4237, 0x1215, iwl5100_bgn_cfg)}, /* Mini Card */
2232 ++ {IWL_PCI_DEVICE(0x4237, 0x1315, iwl5100_bgn_cfg)}, /* Half Mini Card */
2233 ++ {IWL_PCI_DEVICE(0x4237, 0x1216, iwl5100_abg_cfg)}, /* Mini Card */
2234 ++ {IWL_PCI_DEVICE(0x4237, 0x1316, iwl5100_abg_cfg)}, /* Half Mini Card */
2235 ++
2236 ++/* 5300 Series WiFi */
2237 ++ {IWL_PCI_DEVICE(0x4235, 0x1021, iwl5300_agn_cfg)}, /* Mini Card */
2238 ++ {IWL_PCI_DEVICE(0x4235, 0x1121, iwl5300_agn_cfg)}, /* Half Mini Card */
2239 ++ {IWL_PCI_DEVICE(0x4235, 0x1024, iwl5300_agn_cfg)}, /* Mini Card */
2240 ++ {IWL_PCI_DEVICE(0x4235, 0x1124, iwl5300_agn_cfg)}, /* Half Mini Card */
2241 ++ {IWL_PCI_DEVICE(0x4235, 0x1001, iwl5300_agn_cfg)}, /* Mini Card */
2242 ++ {IWL_PCI_DEVICE(0x4235, 0x1101, iwl5300_agn_cfg)}, /* Half Mini Card */
2243 ++ {IWL_PCI_DEVICE(0x4235, 0x1004, iwl5300_agn_cfg)}, /* Mini Card */
2244 ++ {IWL_PCI_DEVICE(0x4235, 0x1104, iwl5300_agn_cfg)}, /* Half Mini Card */
2245 ++ {IWL_PCI_DEVICE(0x4236, 0x1011, iwl5300_agn_cfg)}, /* Mini Card */
2246 ++ {IWL_PCI_DEVICE(0x4236, 0x1111, iwl5300_agn_cfg)}, /* Half Mini Card */
2247 ++ {IWL_PCI_DEVICE(0x4236, 0x1014, iwl5300_agn_cfg)}, /* Mini Card */
2248 ++ {IWL_PCI_DEVICE(0x4236, 0x1114, iwl5300_agn_cfg)}, /* Half Mini Card */
2249 ++
2250 ++/* 5350 Series WiFi/WiMax */
2251 ++ {IWL_PCI_DEVICE(0x423A, 0x1001, iwl5350_agn_cfg)}, /* Mini Card */
2252 ++ {IWL_PCI_DEVICE(0x423A, 0x1021, iwl5350_agn_cfg)}, /* Mini Card */
2253 ++ {IWL_PCI_DEVICE(0x423B, 0x1011, iwl5350_agn_cfg)}, /* Mini Card */
2254 ++
2255 ++/* 5150 Series Wifi/WiMax */
2256 ++ {IWL_PCI_DEVICE(0x423C, 0x1201, iwl5150_agn_cfg)}, /* Mini Card */
2257 ++ {IWL_PCI_DEVICE(0x423C, 0x1301, iwl5150_agn_cfg)}, /* Half Mini Card */
2258 ++ {IWL_PCI_DEVICE(0x423C, 0x1206, iwl5150_abg_cfg)}, /* Mini Card */
2259 ++ {IWL_PCI_DEVICE(0x423C, 0x1306, iwl5150_abg_cfg)}, /* Half Mini Card */
2260 ++ {IWL_PCI_DEVICE(0x423C, 0x1221, iwl5150_agn_cfg)}, /* Mini Card */
2261 ++ {IWL_PCI_DEVICE(0x423C, 0x1321, iwl5150_agn_cfg)}, /* Half Mini Card */
2262 ++
2263 ++ {IWL_PCI_DEVICE(0x423D, 0x1211, iwl5150_agn_cfg)}, /* Mini Card */
2264 ++ {IWL_PCI_DEVICE(0x423D, 0x1311, iwl5150_agn_cfg)}, /* Half Mini Card */
2265 ++ {IWL_PCI_DEVICE(0x423D, 0x1216, iwl5150_abg_cfg)}, /* Mini Card */
2266 ++ {IWL_PCI_DEVICE(0x423D, 0x1316, iwl5150_abg_cfg)}, /* Half Mini Card */
2267 + /* 6000/6050 Series */
2268 + {IWL_PCI_DEVICE(0x008D, PCI_ANY_ID, iwl6000h_2agn_cfg)},
2269 + {IWL_PCI_DEVICE(0x008E, PCI_ANY_ID, iwl6000h_2agn_cfg)},
2270 +diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
2271 +index cea2ee2..3539ea4 100644
2272 +--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
2273 ++++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
2274 +@@ -53,9 +53,10 @@ extern struct iwl_cfg iwl4965_agn_cfg;
2275 + extern struct iwl_cfg iwl5300_agn_cfg;
2276 + extern struct iwl_cfg iwl5100_agn_cfg;
2277 + extern struct iwl_cfg iwl5350_agn_cfg;
2278 +-extern struct iwl_cfg iwl5100_bg_cfg;
2279 ++extern struct iwl_cfg iwl5100_bgn_cfg;
2280 + extern struct iwl_cfg iwl5100_abg_cfg;
2281 + extern struct iwl_cfg iwl5150_agn_cfg;
2282 ++extern struct iwl_cfg iwl5150_abg_cfg;
2283 + extern struct iwl_cfg iwl6000h_2agn_cfg;
2284 + extern struct iwl_cfg iwl6000i_2agn_cfg;
2285 + extern struct iwl_cfg iwl6000_3agn_cfg;
2286 +diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
2287 +index cc96d13..7f15b7e 100644
2288 +--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
2289 ++++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
2290 +@@ -791,8 +791,10 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
2291 + hdr->seq_ctrl |= cpu_to_le16(seq_number);
2292 + seq_number += 0x10;
2293 + /* aggregation is on for this <sta,tid> */
2294 +- if (info->flags & IEEE80211_TX_CTL_AMPDU)
2295 ++ if (info->flags & IEEE80211_TX_CTL_AMPDU &&
2296 ++ priv->stations[sta_id].tid[tid].agg.state == IWL_AGG_ON) {
2297 + txq_id = priv->stations[sta_id].tid[tid].agg.txq_id;
2298 ++ }
2299 + }
2300 +
2301 + txq = &priv->txq[txq_id];
2302 +@@ -1273,7 +1275,7 @@ int iwl_tx_agg_stop(struct iwl_priv *priv , const u8 *ra, u16 tid)
2303 + {
2304 + int tx_fifo_id, txq_id, sta_id, ssn = -1;
2305 + struct iwl_tid_data *tid_data;
2306 +- int ret, write_ptr, read_ptr;
2307 ++ int write_ptr, read_ptr;
2308 + unsigned long flags;
2309 +
2310 + if (!ra) {
2311 +@@ -1325,13 +1327,17 @@ int iwl_tx_agg_stop(struct iwl_priv *priv , const u8 *ra, u16 tid)
2312 + priv->stations[sta_id].tid[tid].agg.state = IWL_AGG_OFF;
2313 +
2314 + spin_lock_irqsave(&priv->lock, flags);
2315 +- ret = priv->cfg->ops->lib->txq_agg_disable(priv, txq_id, ssn,
2316 ++ /*
2317 ++ * the only reason this call can fail is queue number out of range,
2318 ++ * which can happen if uCode is reloaded and all the station
2319 ++ * information are lost. if it is outside the range, there is no need
2320 ++ * to deactivate the uCode queue, just return "success" to allow
2321 ++ * mac80211 to clean up it own data.
2322 ++ */
2323 ++ priv->cfg->ops->lib->txq_agg_disable(priv, txq_id, ssn,
2324 + tx_fifo_id);
2325 + spin_unlock_irqrestore(&priv->lock, flags);
2326 +
2327 +- if (ret)
2328 +- return ret;
2329 +-
2330 + ieee80211_stop_tx_ba_cb_irqsafe(priv->hw, ra, tid);
2331 +
2332 + return 0;
2333 +diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
2334 +index b3c4fbd..805284d 100644
2335 +--- a/drivers/net/wireless/p54/p54usb.c
2336 ++++ b/drivers/net/wireless/p54/p54usb.c
2337 +@@ -78,6 +78,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
2338 + {USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */
2339 + {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
2340 + {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */
2341 ++ {USB_DEVICE(0x413c, 0x5513)}, /* Dell WLA3310 USB Wireless Adapter */
2342 + {USB_DEVICE(0x413c, 0x8102)}, /* Spinnaker DUT */
2343 + {USB_DEVICE(0x413c, 0x8104)}, /* Cohiba Proto board */
2344 + {}
2345 +diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c
2346 +index 16429c4..c6ca7ee 100644
2347 +--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
2348 ++++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
2349 +@@ -190,6 +190,7 @@ static void rtl8180_handle_tx(struct ieee80211_hw *dev, unsigned int prio)
2350 + info->flags |= IEEE80211_TX_STAT_ACK;
2351 +
2352 + info->status.rates[0].count = (flags & 0xFF) + 1;
2353 ++ info->status.rates[1].idx = -1;
2354 +
2355 + ieee80211_tx_status_irqsafe(dev, skb);
2356 + if (ring->entries - skb_queue_len(&ring->queue) == 2)
2357 +diff --git a/drivers/net/wireless/wl12xx/wl1251_sdio.c b/drivers/net/wireless/wl12xx/wl1251_sdio.c
2358 +index 9423f22..d74b89b 100644
2359 +--- a/drivers/net/wireless/wl12xx/wl1251_sdio.c
2360 ++++ b/drivers/net/wireless/wl12xx/wl1251_sdio.c
2361 +@@ -160,6 +160,7 @@ disable:
2362 + sdio_disable_func(func);
2363 + release:
2364 + sdio_release_host(func);
2365 ++ wl1251_free_hw(wl);
2366 + return ret;
2367 + }
2368 +
2369 +diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c
2370 +index a7aae24..1f1f5a8 100644
2371 +--- a/drivers/oprofile/cpu_buffer.c
2372 ++++ b/drivers/oprofile/cpu_buffer.c
2373 +@@ -30,23 +30,7 @@
2374 +
2375 + #define OP_BUFFER_FLAGS 0
2376 +
2377 +-/*
2378 +- * Read and write access is using spin locking. Thus, writing to the
2379 +- * buffer by NMI handler (x86) could occur also during critical
2380 +- * sections when reading the buffer. To avoid this, there are 2
2381 +- * buffers for independent read and write access. Read access is in
2382 +- * process context only, write access only in the NMI handler. If the
2383 +- * read buffer runs empty, both buffers are swapped atomically. There
2384 +- * is potentially a small window during swapping where the buffers are
2385 +- * disabled and samples could be lost.
2386 +- *
2387 +- * Using 2 buffers is a little bit overhead, but the solution is clear
2388 +- * and does not require changes in the ring buffer implementation. It
2389 +- * can be changed to a single buffer solution when the ring buffer
2390 +- * access is implemented as non-locking atomic code.
2391 +- */
2392 +-static struct ring_buffer *op_ring_buffer_read;
2393 +-static struct ring_buffer *op_ring_buffer_write;
2394 ++static struct ring_buffer *op_ring_buffer;
2395 + DEFINE_PER_CPU(struct oprofile_cpu_buffer, cpu_buffer);
2396 +
2397 + static void wq_sync_buffer(struct work_struct *work);
2398 +@@ -69,12 +53,9 @@ void oprofile_cpu_buffer_inc_smpl_lost(void)
2399 +
2400 + void free_cpu_buffers(void)
2401 + {
2402 +- if (op_ring_buffer_read)
2403 +- ring_buffer_free(op_ring_buffer_read);
2404 +- op_ring_buffer_read = NULL;
2405 +- if (op_ring_buffer_write)
2406 +- ring_buffer_free(op_ring_buffer_write);
2407 +- op_ring_buffer_write = NULL;
2408 ++ if (op_ring_buffer)
2409 ++ ring_buffer_free(op_ring_buffer);
2410 ++ op_ring_buffer = NULL;
2411 + }
2412 +
2413 + #define RB_EVENT_HDR_SIZE 4
2414 +@@ -87,11 +68,8 @@ int alloc_cpu_buffers(void)
2415 + unsigned long byte_size = buffer_size * (sizeof(struct op_sample) +
2416 + RB_EVENT_HDR_SIZE);
2417 +
2418 +- op_ring_buffer_read = ring_buffer_alloc(byte_size, OP_BUFFER_FLAGS);
2419 +- if (!op_ring_buffer_read)
2420 +- goto fail;
2421 +- op_ring_buffer_write = ring_buffer_alloc(byte_size, OP_BUFFER_FLAGS);
2422 +- if (!op_ring_buffer_write)
2423 ++ op_ring_buffer = ring_buffer_alloc(byte_size, OP_BUFFER_FLAGS);
2424 ++ if (!op_ring_buffer)
2425 + goto fail;
2426 +
2427 + for_each_possible_cpu(i) {
2428 +@@ -163,16 +141,11 @@ struct op_sample
2429 + *op_cpu_buffer_write_reserve(struct op_entry *entry, unsigned long size)
2430 + {
2431 + entry->event = ring_buffer_lock_reserve
2432 +- (op_ring_buffer_write, sizeof(struct op_sample) +
2433 ++ (op_ring_buffer, sizeof(struct op_sample) +
2434 + size * sizeof(entry->sample->data[0]));
2435 +- if (entry->event)
2436 +- entry->sample = ring_buffer_event_data(entry->event);
2437 +- else
2438 +- entry->sample = NULL;
2439 +-
2440 +- if (!entry->sample)
2441 ++ if (!entry->event)
2442 + return NULL;
2443 +-
2444 ++ entry->sample = ring_buffer_event_data(entry->event);
2445 + entry->size = size;
2446 + entry->data = entry->sample->data;
2447 +
2448 +@@ -181,25 +154,16 @@ struct op_sample
2449 +
2450 + int op_cpu_buffer_write_commit(struct op_entry *entry)
2451 + {
2452 +- return ring_buffer_unlock_commit(op_ring_buffer_write, entry->event);
2453 ++ return ring_buffer_unlock_commit(op_ring_buffer, entry->event);
2454 + }
2455 +
2456 + struct op_sample *op_cpu_buffer_read_entry(struct op_entry *entry, int cpu)
2457 + {
2458 + struct ring_buffer_event *e;
2459 +- e = ring_buffer_consume(op_ring_buffer_read, cpu, NULL);
2460 +- if (e)
2461 +- goto event;
2462 +- if (ring_buffer_swap_cpu(op_ring_buffer_read,
2463 +- op_ring_buffer_write,
2464 +- cpu))
2465 ++ e = ring_buffer_consume(op_ring_buffer, cpu, NULL);
2466 ++ if (!e)
2467 + return NULL;
2468 +- e = ring_buffer_consume(op_ring_buffer_read, cpu, NULL);
2469 +- if (e)
2470 +- goto event;
2471 +- return NULL;
2472 +
2473 +-event:
2474 + entry->event = e;
2475 + entry->sample = ring_buffer_event_data(e);
2476 + entry->size = (ring_buffer_event_length(e) - sizeof(struct op_sample))
2477 +@@ -210,8 +174,7 @@ event:
2478 +
2479 + unsigned long op_cpu_buffer_entries(int cpu)
2480 + {
2481 +- return ring_buffer_entries_cpu(op_ring_buffer_read, cpu)
2482 +- + ring_buffer_entries_cpu(op_ring_buffer_write, cpu);
2483 ++ return ring_buffer_entries_cpu(op_ring_buffer, cpu);
2484 + }
2485 +
2486 + static int
2487 +diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
2488 +index e2641cd..c0de0b9 100644
2489 +--- a/drivers/pci/quirks.c
2490 ++++ b/drivers/pci/quirks.c
2491 +@@ -1444,7 +1444,8 @@ static void quirk_jmicron_ata(struct pci_dev *pdev)
2492 + conf5 &= ~(1 << 24); /* Clear bit 24 */
2493 +
2494 + switch (pdev->device) {
2495 +- case PCI_DEVICE_ID_JMICRON_JMB360:
2496 ++ case PCI_DEVICE_ID_JMICRON_JMB360: /* SATA single port */
2497 ++ case PCI_DEVICE_ID_JMICRON_JMB362: /* SATA dual ports */
2498 + /* The controller should be in single function ahci mode */
2499 + conf1 |= 0x0002A100; /* Set 8, 13, 15, 17 */
2500 + break;
2501 +@@ -1480,12 +1481,14 @@ static void quirk_jmicron_ata(struct pci_dev *pdev)
2502 + }
2503 + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata);
2504 + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);
2505 ++DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata);
2506 + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata);
2507 + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata);
2508 + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata);
2509 + DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, quirk_jmicron_ata);
2510 + DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB360, quirk_jmicron_ata);
2511 + DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, quirk_jmicron_ata);
2512 ++DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB362, quirk_jmicron_ata);
2513 + DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, quirk_jmicron_ata);
2514 + DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, quirk_jmicron_ata);
2515 + DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, quirk_jmicron_ata);
2516 +@@ -2092,6 +2095,8 @@ static void __devinit quirk_disable_msi(struct pci_dev *dev)
2517 + }
2518 + }
2519 + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_msi);
2520 ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, 0xa238, quirk_disable_msi);
2521 ++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x5a3f, quirk_disable_msi);
2522 +
2523 + /* Go through the list of Hypertransport capabilities and
2524 + * return 1 if a HT MSI capability is found and enabled */
2525 +@@ -2183,15 +2188,16 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS,
2526 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE,
2527 + ht_enable_msi_mapping);
2528 +
2529 +-/* The P5N32-SLI Premium motherboard from Asus has a problem with msi
2530 ++/* The P5N32-SLI motherboards from Asus have a problem with msi
2531 + * for the MCP55 NIC. It is not yet determined whether the msi problem
2532 + * also affects other devices. As for now, turn off msi for this device.
2533 + */
2534 + static void __devinit nvenet_msi_disable(struct pci_dev *dev)
2535 + {
2536 +- if (dmi_name_in_vendors("P5N32-SLI PREMIUM")) {
2537 ++ if (dmi_name_in_vendors("P5N32-SLI PREMIUM") ||
2538 ++ dmi_name_in_vendors("P5N32-E SLI")) {
2539 + dev_info(&dev->dev,
2540 +- "Disabling msi for MCP55 NIC on P5N32-SLI Premium\n");
2541 ++ "Disabling msi for MCP55 NIC on P5N32-SLI\n");
2542 + dev->no_msi = 1;
2543 + }
2544 + }
2545 +diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
2546 +index 473e5f2..66c2d6a 100644
2547 +--- a/drivers/rtc/rtc-cmos.c
2548 ++++ b/drivers/rtc/rtc-cmos.c
2549 +@@ -723,6 +723,9 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
2550 + }
2551 + }
2552 +
2553 ++ cmos_rtc.dev = dev;
2554 ++ dev_set_drvdata(dev, &cmos_rtc);
2555 ++
2556 + cmos_rtc.rtc = rtc_device_register(driver_name, dev,
2557 + &cmos_rtc_ops, THIS_MODULE);
2558 + if (IS_ERR(cmos_rtc.rtc)) {
2559 +@@ -730,8 +733,6 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
2560 + goto cleanup0;
2561 + }
2562 +
2563 +- cmos_rtc.dev = dev;
2564 +- dev_set_drvdata(dev, &cmos_rtc);
2565 + rename_region(ports, dev_name(&cmos_rtc.rtc->dev));
2566 +
2567 + spin_lock_irq(&rtc_lock);
2568 +diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
2569 +index e0d7b99..43bfffe 100644
2570 +--- a/drivers/rtc/rtc-s3c.c
2571 ++++ b/drivers/rtc/rtc-s3c.c
2572 +@@ -456,8 +456,6 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
2573 + pr_debug("s3c2410_rtc: RTCCON=%02x\n",
2574 + readb(s3c_rtc_base + S3C2410_RTCCON));
2575 +
2576 +- s3c_rtc_setfreq(&pdev->dev, 1);
2577 +-
2578 + device_init_wakeup(&pdev->dev, 1);
2579 +
2580 + /* register RTC and exit */
2581 +@@ -474,6 +472,9 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
2582 + rtc->max_user_freq = 128;
2583 +
2584 + platform_set_drvdata(pdev, rtc);
2585 ++
2586 ++ s3c_rtc_setfreq(&pdev->dev, 1);
2587 ++
2588 + return 0;
2589 +
2590 + err_nortc:
2591 +diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
2592 +index 799bd75..f3e5e30 100644
2593 +--- a/drivers/scsi/qla2xxx/qla_isr.c
2594 ++++ b/drivers/scsi/qla2xxx/qla_isr.c
2595 +@@ -2240,30 +2240,28 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
2596 +
2597 + /* If possible, enable MSI-X. */
2598 + if (!IS_QLA2432(ha) && !IS_QLA2532(ha) &&
2599 +- !IS_QLA8432(ha) && !IS_QLA8001(ha))
2600 +- goto skip_msix;
2601 ++ !IS_QLA8432(ha) && !IS_QLA8001(ha))
2602 ++ goto skip_msi;
2603 ++
2604 ++ if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_HP &&
2605 ++ (ha->pdev->subsystem_device == 0x7040 ||
2606 ++ ha->pdev->subsystem_device == 0x7041 ||
2607 ++ ha->pdev->subsystem_device == 0x1705)) {
2608 ++ DEBUG2(qla_printk(KERN_WARNING, ha,
2609 ++ "MSI-X: Unsupported ISP2432 SSVID/SSDID (0x%X,0x%X).\n",
2610 ++ ha->pdev->subsystem_vendor,
2611 ++ ha->pdev->subsystem_device));
2612 ++ goto skip_msi;
2613 ++ }
2614 +
2615 + if (IS_QLA2432(ha) && (ha->pdev->revision < QLA_MSIX_CHIP_REV_24XX ||
2616 + !QLA_MSIX_FW_MODE_1(ha->fw_attributes))) {
2617 + DEBUG2(qla_printk(KERN_WARNING, ha,
2618 + "MSI-X: Unsupported ISP2432 (0x%X, 0x%X).\n",
2619 + ha->pdev->revision, ha->fw_attributes));
2620 +-
2621 + goto skip_msix;
2622 + }
2623 +
2624 +- if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_HP &&
2625 +- (ha->pdev->subsystem_device == 0x7040 ||
2626 +- ha->pdev->subsystem_device == 0x7041 ||
2627 +- ha->pdev->subsystem_device == 0x1705)) {
2628 +- DEBUG2(qla_printk(KERN_WARNING, ha,
2629 +- "MSI-X: Unsupported ISP2432 SSVID/SSDID (0x%X, 0x%X).\n",
2630 +- ha->pdev->subsystem_vendor,
2631 +- ha->pdev->subsystem_device));
2632 +-
2633 +- goto skip_msi;
2634 +- }
2635 +-
2636 + ret = qla24xx_enable_msix(ha, rsp);
2637 + if (!ret) {
2638 + DEBUG2(qla_printk(KERN_INFO, ha,
2639 +diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c
2640 +index 9aef87f..27829e7 100644
2641 +--- a/drivers/staging/comedi/drivers/ni_mio_cs.c
2642 ++++ b/drivers/staging/comedi/drivers/ni_mio_cs.c
2643 +@@ -123,7 +123,7 @@ static const struct ni_board_struct ni_boards[] = {
2644 + .adbits = 12,
2645 + .ai_fifo_depth = 1024,
2646 + .alwaysdither = 0,
2647 +- .gainlkup = ai_gain_16,
2648 ++ .gainlkup = ai_gain_4,
2649 + .ai_speed = 5000,
2650 + .n_aochan = 2,
2651 + .aobits = 12,
2652 +diff --git a/drivers/staging/rtl8192su/r8192U_core.c b/drivers/staging/rtl8192su/r8192U_core.c
2653 +index 66274d7..88644ef 100644
2654 +--- a/drivers/staging/rtl8192su/r8192U_core.c
2655 ++++ b/drivers/staging/rtl8192su/r8192U_core.c
2656 +@@ -120,6 +120,7 @@ static struct usb_device_id rtl8192_usb_id_tbl[] = {
2657 + {USB_DEVICE(0x050d, 0x805E)},
2658 + /* Sitecom */
2659 + {USB_DEVICE(0x0df6, 0x0031)},
2660 ++ {USB_DEVICE(0x0df6, 0x004b)}, /* WL-349 */
2661 + /* EnGenius */
2662 + {USB_DEVICE(0x1740, 0x9201)},
2663 + /* Dlink */
2664 +diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
2665 +index 53450b4..269d1e2 100644
2666 +--- a/drivers/staging/vt6655/device_main.c
2667 ++++ b/drivers/staging/vt6655/device_main.c
2668 +@@ -1089,11 +1089,13 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
2669 + }
2670 + //2008-07-21-01<Add>by MikeLiu
2671 + //register wpadev
2672 ++#if 0
2673 + if(wpa_set_wpadev(pDevice, 1)!=0) {
2674 + printk("Fail to Register WPADEV?\n");
2675 + unregister_netdev(pDevice->dev);
2676 + free_netdev(dev);
2677 + }
2678 ++#endif
2679 + device_print_info(pDevice);
2680 + pci_set_drvdata(pcid, pDevice);
2681 + return 0;
2682 +diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
2683 +index e6119ed..0e64037 100644
2684 +--- a/drivers/usb/class/cdc-acm.c
2685 ++++ b/drivers/usb/class/cdc-acm.c
2686 +@@ -1201,7 +1201,7 @@ made_compressed_probe:
2687 + if (rcv->urb == NULL) {
2688 + dev_dbg(&intf->dev,
2689 + "out of memory (read urbs usb_alloc_urb)\n");
2690 +- goto alloc_fail7;
2691 ++ goto alloc_fail6;
2692 + }
2693 +
2694 + rcv->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
2695 +@@ -1225,7 +1225,7 @@ made_compressed_probe:
2696 + if (snd->urb == NULL) {
2697 + dev_dbg(&intf->dev,
2698 + "out of memory (write urbs usb_alloc_urb)");
2699 +- goto alloc_fail7;
2700 ++ goto alloc_fail8;
2701 + }
2702 +
2703 + if (usb_endpoint_xfer_int(epwrite))
2704 +@@ -1264,6 +1264,7 @@ made_compressed_probe:
2705 + i = device_create_file(&intf->dev,
2706 + &dev_attr_iCountryCodeRelDate);
2707 + if (i < 0) {
2708 ++ device_remove_file(&intf->dev, &dev_attr_wCountryCodes);
2709 + kfree(acm->country_codes);
2710 + goto skip_countries;
2711 + }
2712 +@@ -1300,6 +1301,7 @@ alloc_fail8:
2713 + usb_free_urb(acm->wb[i].urb);
2714 + alloc_fail7:
2715 + acm_read_buffers_free(acm);
2716 ++alloc_fail6:
2717 + for (i = 0; i < num_rx_buf; i++)
2718 + usb_free_urb(acm->ru[i].urb);
2719 + usb_free_urb(acm->ctrlurb);
2720 +diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
2721 +index fa3d142..08a9a62 100644
2722 +--- a/drivers/usb/gadget/fsl_udc_core.c
2723 ++++ b/drivers/usb/gadget/fsl_udc_core.c
2724 +@@ -489,7 +489,7 @@ static int fsl_ep_enable(struct usb_ep *_ep,
2725 + case USB_ENDPOINT_XFER_ISOC:
2726 + /* Calculate transactions needed for high bandwidth iso */
2727 + mult = (unsigned char)(1 + ((max >> 11) & 0x03));
2728 +- max = max & 0x8ff; /* bit 0~10 */
2729 ++ max = max & 0x7ff; /* bit 0~10 */
2730 + /* 3 transactions at most */
2731 + if (mult > 3)
2732 + goto en_done;
2733 +diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
2734 +index 698f461..6ac3976 100644
2735 +--- a/drivers/usb/host/ehci-hub.c
2736 ++++ b/drivers/usb/host/ehci-hub.c
2737 +@@ -292,6 +292,16 @@ static int ehci_bus_resume (struct usb_hcd *hcd)
2738 + /* manually resume the ports we suspended during bus_suspend() */
2739 + i = HCS_N_PORTS (ehci->hcs_params);
2740 + while (i--) {
2741 ++ /* clear phy low power mode before resume */
2742 ++ if (ehci->has_hostpc) {
2743 ++ u32 __iomem *hostpc_reg =
2744 ++ (u32 __iomem *)((u8 *)ehci->regs
2745 ++ + HOSTPC0 + 4 * (i & 0xff));
2746 ++ temp = ehci_readl(ehci, hostpc_reg);
2747 ++ ehci_writel(ehci, temp & ~HOSTPC_PHCD,
2748 ++ hostpc_reg);
2749 ++ mdelay(5);
2750 ++ }
2751 + temp = ehci_readl(ehci, &ehci->regs->port_status [i]);
2752 + temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
2753 + if (test_bit(i, &ehci->bus_suspended) &&
2754 +@@ -676,6 +686,13 @@ static int ehci_hub_control (
2755 + if (temp & PORT_SUSPEND) {
2756 + if ((temp & PORT_PE) == 0)
2757 + goto error;
2758 ++ /* clear phy low power mode before resume */
2759 ++ if (hostpc_reg) {
2760 ++ temp1 = ehci_readl(ehci, hostpc_reg);
2761 ++ ehci_writel(ehci, temp1 & ~HOSTPC_PHCD,
2762 ++ hostpc_reg);
2763 ++ mdelay(5);
2764 ++ }
2765 + /* resume signaling for 20 msec */
2766 + temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
2767 + ehci_writel(ehci, temp | PORT_RESUME,
2768 +diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c
2769 +index 9974f32..a24a92f 100644
2770 +--- a/drivers/usb/host/xhci-hcd.c
2771 ++++ b/drivers/usb/host/xhci-hcd.c
2772 +@@ -97,6 +97,33 @@ int xhci_halt(struct xhci_hcd *xhci)
2773 + }
2774 +
2775 + /*
2776 ++ * Set the run bit and wait for the host to be running.
2777 ++ */
2778 ++int xhci_start(struct xhci_hcd *xhci)
2779 ++{
2780 ++ u32 temp;
2781 ++ int ret;
2782 ++
2783 ++ temp = xhci_readl(xhci, &xhci->op_regs->command);
2784 ++ temp |= (CMD_RUN);
2785 ++ xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n",
2786 ++ temp);
2787 ++ xhci_writel(xhci, temp, &xhci->op_regs->command);
2788 ++
2789 ++ /*
2790 ++ * Wait for the HCHalted Status bit to be 0 to indicate the host is
2791 ++ * running.
2792 ++ */
2793 ++ ret = handshake(xhci, &xhci->op_regs->status,
2794 ++ STS_HALT, 0, XHCI_MAX_HALT_USEC);
2795 ++ if (ret == -ETIMEDOUT)
2796 ++ xhci_err(xhci, "Host took too long to start, "
2797 ++ "waited %u microseconds.\n",
2798 ++ XHCI_MAX_HALT_USEC);
2799 ++ return ret;
2800 ++}
2801 ++
2802 ++/*
2803 + * Reset a halted HC, and set the internal HC state to HC_STATE_HALT.
2804 + *
2805 + * This resets pipelines, timers, counters, state machines, etc.
2806 +@@ -107,6 +134,7 @@ int xhci_reset(struct xhci_hcd *xhci)
2807 + {
2808 + u32 command;
2809 + u32 state;
2810 ++ int ret;
2811 +
2812 + state = xhci_readl(xhci, &xhci->op_regs->status);
2813 + if ((state & STS_HALT) == 0) {
2814 +@@ -121,7 +149,17 @@ int xhci_reset(struct xhci_hcd *xhci)
2815 + /* XXX: Why does EHCI set this here? Shouldn't other code do this? */
2816 + xhci_to_hcd(xhci)->state = HC_STATE_HALT;
2817 +
2818 +- return handshake(xhci, &xhci->op_regs->command, CMD_RESET, 0, 250 * 1000);
2819 ++ ret = handshake(xhci, &xhci->op_regs->command,
2820 ++ CMD_RESET, 0, 250 * 1000);
2821 ++ if (ret)
2822 ++ return ret;
2823 ++
2824 ++ xhci_dbg(xhci, "Wait for controller to be ready for doorbell rings\n");
2825 ++ /*
2826 ++ * xHCI cannot write to any doorbells or operational registers other
2827 ++ * than status until the "Controller Not Ready" flag is cleared.
2828 ++ */
2829 ++ return handshake(xhci, &xhci->op_regs->status, STS_CNR, 0, 250 * 1000);
2830 + }
2831 +
2832 + /*
2833 +@@ -460,13 +498,11 @@ int xhci_run(struct usb_hcd *hcd)
2834 + if (NUM_TEST_NOOPS > 0)
2835 + doorbell = xhci_setup_one_noop(xhci);
2836 +
2837 +- temp = xhci_readl(xhci, &xhci->op_regs->command);
2838 +- temp |= (CMD_RUN);
2839 +- xhci_dbg(xhci, "// Turn on HC, cmd = 0x%x.\n",
2840 +- temp);
2841 +- xhci_writel(xhci, temp, &xhci->op_regs->command);
2842 +- /* Flush PCI posted writes */
2843 +- temp = xhci_readl(xhci, &xhci->op_regs->command);
2844 ++ if (xhci_start(xhci)) {
2845 ++ xhci_halt(xhci);
2846 ++ return -ENODEV;
2847 ++ }
2848 ++
2849 + xhci_dbg(xhci, "// @%p = 0x%x\n", &xhci->op_regs->command, temp);
2850 + if (doorbell)
2851 + (*doorbell)(xhci);
2852 +@@ -1414,6 +1450,8 @@ void xhci_endpoint_reset(struct usb_hcd *hcd,
2853 + kfree(virt_ep->stopped_td);
2854 + xhci_ring_cmd_db(xhci);
2855 + }
2856 ++ virt_ep->stopped_td = NULL;
2857 ++ virt_ep->stopped_trb = NULL;
2858 + spin_unlock_irqrestore(&xhci->lock, flags);
2859 +
2860 + if (ret)
2861 +diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
2862 +index 821b7b4..317e8dc 100644
2863 +--- a/drivers/usb/host/xhci-ring.c
2864 ++++ b/drivers/usb/host/xhci-ring.c
2865 +@@ -241,10 +241,27 @@ static int room_on_ring(struct xhci_hcd *xhci, struct xhci_ring *ring,
2866 + int i;
2867 + union xhci_trb *enq = ring->enqueue;
2868 + struct xhci_segment *enq_seg = ring->enq_seg;
2869 ++ struct xhci_segment *cur_seg;
2870 ++ unsigned int left_on_ring;
2871 +
2872 + /* Check if ring is empty */
2873 +- if (enq == ring->dequeue)
2874 ++ if (enq == ring->dequeue) {
2875 ++ /* Can't use link trbs */
2876 ++ left_on_ring = TRBS_PER_SEGMENT - 1;
2877 ++ for (cur_seg = enq_seg->next; cur_seg != enq_seg;
2878 ++ cur_seg = cur_seg->next)
2879 ++ left_on_ring += TRBS_PER_SEGMENT - 1;
2880 ++
2881 ++ /* Always need one TRB free in the ring. */
2882 ++ left_on_ring -= 1;
2883 ++ if (num_trbs > left_on_ring) {
2884 ++ xhci_warn(xhci, "Not enough room on ring; "
2885 ++ "need %u TRBs, %u TRBs left\n",
2886 ++ num_trbs, left_on_ring);
2887 ++ return 0;
2888 ++ }
2889 + return 1;
2890 ++ }
2891 + /* Make sure there's an extra empty TRB available */
2892 + for (i = 0; i <= num_trbs; ++i) {
2893 + if (enq == ring->dequeue)
2894 +@@ -333,7 +350,8 @@ static struct xhci_segment *find_trb_seg(
2895 + while (cur_seg->trbs > trb ||
2896 + &cur_seg->trbs[TRBS_PER_SEGMENT - 1] < trb) {
2897 + generic_trb = &cur_seg->trbs[TRBS_PER_SEGMENT - 1].generic;
2898 +- if (TRB_TYPE(generic_trb->field[3]) == TRB_LINK &&
2899 ++ if ((generic_trb->field[3] & TRB_TYPE_BITMASK) ==
2900 ++ TRB_TYPE(TRB_LINK) &&
2901 + (generic_trb->field[3] & LINK_TOGGLE))
2902 + *cycle_state = ~(*cycle_state) & 0x1;
2903 + cur_seg = cur_seg->next;
2904 +@@ -389,7 +407,7 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
2905 + BUG();
2906 +
2907 + trb = &state->new_deq_ptr->generic;
2908 +- if (TRB_TYPE(trb->field[3]) == TRB_LINK &&
2909 ++ if ((trb->field[3] & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK) &&
2910 + (trb->field[3] & LINK_TOGGLE))
2911 + state->new_cycle_state = ~(state->new_cycle_state) & 0x1;
2912 + next_trb(xhci, ep_ring, &state->new_deq_seg, &state->new_deq_ptr);
2913 +@@ -548,6 +566,8 @@ static void handle_stopped_endpoint(struct xhci_hcd *xhci,
2914 + /* Otherwise just ring the doorbell to restart the ring */
2915 + ring_ep_doorbell(xhci, slot_id, ep_index);
2916 + }
2917 ++ ep->stopped_td = NULL;
2918 ++ ep->stopped_trb = NULL;
2919 +
2920 + /*
2921 + * Drop the lock and complete the URBs in the cancelled TD list.
2922 +@@ -1065,8 +1085,13 @@ static int handle_tx_event(struct xhci_hcd *xhci,
2923 +
2924 + ep->stopped_td = td;
2925 + ep->stopped_trb = event_trb;
2926 ++
2927 + xhci_queue_reset_ep(xhci, slot_id, ep_index);
2928 + xhci_cleanup_stalled_ring(xhci, td->urb->dev, ep_index);
2929 ++
2930 ++ ep->stopped_td = NULL;
2931 ++ ep->stopped_trb = NULL;
2932 ++
2933 + xhci_ring_cmd_db(xhci);
2934 + goto td_cleanup;
2935 + default:
2936 +@@ -1186,8 +1211,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
2937 + for (cur_trb = ep_ring->dequeue, cur_seg = ep_ring->deq_seg;
2938 + cur_trb != event_trb;
2939 + next_trb(xhci, ep_ring, &cur_seg, &cur_trb)) {
2940 +- if (TRB_TYPE(cur_trb->generic.field[3]) != TRB_TR_NOOP &&
2941 +- TRB_TYPE(cur_trb->generic.field[3]) != TRB_LINK)
2942 ++ if ((cur_trb->generic.field[3] &
2943 ++ TRB_TYPE_BITMASK) != TRB_TYPE(TRB_TR_NOOP) &&
2944 ++ (cur_trb->generic.field[3] &
2945 ++ TRB_TYPE_BITMASK) != TRB_TYPE(TRB_LINK))
2946 + td->urb->actual_length +=
2947 + TRB_LEN(cur_trb->generic.field[2]);
2948 + }
2949 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
2950 +index 7d920f2..e3e087e 100644
2951 +--- a/drivers/usb/serial/cp210x.c
2952 ++++ b/drivers/usb/serial/cp210x.c
2953 +@@ -61,6 +61,8 @@ static struct usb_device_id id_table [] = {
2954 + { USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */
2955 + { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
2956 + { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */
2957 ++ { USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */
2958 ++ { USB_DEVICE(0x0BED, 0x1101) }, /* MEI series 2000 Combo Acceptor */
2959 + { USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */
2960 + { USB_DEVICE(0x0FCF, 0x1004) }, /* Dynastream ANT2USB */
2961 + { USB_DEVICE(0x0FCF, 0x1006) }, /* Dynastream ANT development board */
2962 +@@ -72,9 +74,12 @@ static struct usb_device_id id_table [] = {
2963 + { USB_DEVICE(0x10C4, 0x1601) }, /* Arkham Technology DS101 Adapter */
2964 + { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */
2965 + { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */
2966 ++ { USB_DEVICE(0x10C4, 0x8044) }, /* Cygnal Debug Adapter */
2967 ++ { USB_DEVICE(0x10C4, 0x804E) }, /* Software Bisque Paramount ME build-in converter */
2968 + { USB_DEVICE(0x10C4, 0x8053) }, /* Enfora EDG1228 */
2969 + { USB_DEVICE(0x10C4, 0x8054) }, /* Enfora GSM2228 */
2970 + { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */
2971 ++ { USB_DEVICE(0x10C4, 0x806F) }, /* IMS USB to RS422 Converter Cable */
2972 + { USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */
2973 + { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */
2974 + { USB_DEVICE(0x10C4, 0x80DD) }, /* Tracient RFID */
2975 +@@ -82,12 +87,15 @@ static struct usb_device_id id_table [] = {
2976 + { USB_DEVICE(0x10C4, 0x8115) }, /* Arygon NFC/Mifare Reader */
2977 + { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */
2978 + { USB_DEVICE(0x10C4, 0x813F) }, /* Tams Master Easy Control */
2979 ++ { USB_DEVICE(0x10C4, 0x8149) }, /* West Mountain Radio Computerized Battery Analyzer */
2980 + { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
2981 + { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
2982 + { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
2983 ++ { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */
2984 + { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */
2985 + { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */
2986 + { USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */
2987 ++ { USB_DEVICE(0x10C4, 0x81AD) }, /* INSYS USB Modem */
2988 + { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
2989 + { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
2990 + { USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */
2991 +@@ -105,6 +113,7 @@ static struct usb_device_id id_table [] = {
2992 + { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */
2993 + { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
2994 + { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
2995 ++ { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */
2996 + { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */
2997 + { USB_DEVICE(0x10C4, 0xF002) }, /* Elan Digital Systems USBwave12 */
2998 + { USB_DEVICE(0x10C4, 0xF003) }, /* Elan Digital Systems USBpulse100 */
2999 +@@ -115,6 +124,8 @@ static struct usb_device_id id_table [] = {
3000 + { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */
3001 + { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */
3002 + { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */
3003 ++ { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
3004 ++ { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
3005 + { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
3006 + { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
3007 + { } /* Terminating Entry */
3008 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
3009 +index 9cf4652..bf56be1 100644
3010 +--- a/drivers/usb/serial/ftdi_sio.c
3011 ++++ b/drivers/usb/serial/ftdi_sio.c
3012 +@@ -2306,6 +2306,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
3013 + "urb failed to set to rts/cts flow control\n");
3014 + }
3015 +
3016 ++ /* raise DTR/RTS */
3017 ++ set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
3018 + } else {
3019 + /*
3020 + * Xon/Xoff code
3021 +@@ -2353,6 +2355,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
3022 + }
3023 + }
3024 +
3025 ++ /* lower DTR/RTS */
3026 ++ clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
3027 + }
3028 + return;
3029 + }
3030 +diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
3031 +index 95d8d26..2e0497b 100644
3032 +--- a/drivers/usb/serial/ir-usb.c
3033 ++++ b/drivers/usb/serial/ir-usb.c
3034 +@@ -312,6 +312,7 @@ static int ir_open(struct tty_struct *tty, struct usb_serial_port *port)
3035 + kfree(port->read_urb->transfer_buffer);
3036 + port->read_urb->transfer_buffer = buffer;
3037 + port->read_urb->transfer_buffer_length = buffer_size;
3038 ++ port->bulk_in_buffer = buffer;
3039 +
3040 + buffer = kmalloc(buffer_size, GFP_KERNEL);
3041 + if (!buffer) {
3042 +@@ -321,6 +322,7 @@ static int ir_open(struct tty_struct *tty, struct usb_serial_port *port)
3043 + kfree(port->write_urb->transfer_buffer);
3044 + port->write_urb->transfer_buffer = buffer;
3045 + port->write_urb->transfer_buffer_length = buffer_size;
3046 ++ port->bulk_out_buffer = buffer;
3047 + port->bulk_out_size = buffer_size;
3048 + }
3049 +
3050 +diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
3051 +index 3a78738..6825082 100644
3052 +--- a/drivers/usb/serial/kl5kusb105.c
3053 ++++ b/drivers/usb/serial/kl5kusb105.c
3054 +@@ -310,6 +310,7 @@ err_cleanup:
3055 + usb_free_urb(priv->write_urb_pool[j]);
3056 + }
3057 + }
3058 ++ kfree(priv);
3059 + usb_set_serial_port_data(serial->port[i], NULL);
3060 + }
3061 + return -ENOMEM;
3062 +diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
3063 +index 45ea694..9d99e68 100644
3064 +--- a/drivers/usb/serial/kobil_sct.c
3065 ++++ b/drivers/usb/serial/kobil_sct.c
3066 +@@ -345,7 +345,8 @@ static void kobil_close(struct usb_serial_port *port)
3067 +
3068 + /* FIXME: Add rts/dtr methods */
3069 + if (port->write_urb) {
3070 +- usb_kill_urb(port->write_urb);
3071 ++ usb_poison_urb(port->write_urb);
3072 ++ kfree(port->write_urb->transfer_buffer);
3073 + usb_free_urb(port->write_urb);
3074 + port->write_urb = NULL;
3075 + }
3076 +diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
3077 +index 485fa9c..a861cd2 100644
3078 +--- a/drivers/usb/serial/mos7840.c
3079 ++++ b/drivers/usb/serial/mos7840.c
3080 +@@ -714,7 +714,6 @@ static void mos7840_bulk_in_callback(struct urb *urb)
3081 + mos7840_port = urb->context;
3082 + if (!mos7840_port) {
3083 + dbg("%s", "NULL mos7840_port pointer");
3084 +- mos7840_port->read_urb_busy = false;
3085 + return;
3086 + }
3087 +
3088 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
3089 +index fcf56f9..fac0732 100644
3090 +--- a/drivers/usb/serial/option.c
3091 ++++ b/drivers/usb/serial/option.c
3092 +@@ -334,6 +334,24 @@ static int option_resume(struct usb_serial *serial);
3093 + #define ALCATEL_VENDOR_ID 0x1bbb
3094 + #define ALCATEL_PRODUCT_X060S 0x0000
3095 +
3096 ++#define PIRELLI_VENDOR_ID 0x1266
3097 ++#define PIRELLI_PRODUCT_C100_1 0x1002
3098 ++#define PIRELLI_PRODUCT_C100_2 0x1003
3099 ++#define PIRELLI_PRODUCT_1004 0x1004
3100 ++#define PIRELLI_PRODUCT_1005 0x1005
3101 ++#define PIRELLI_PRODUCT_1006 0x1006
3102 ++#define PIRELLI_PRODUCT_1007 0x1007
3103 ++#define PIRELLI_PRODUCT_1008 0x1008
3104 ++#define PIRELLI_PRODUCT_1009 0x1009
3105 ++#define PIRELLI_PRODUCT_100A 0x100a
3106 ++#define PIRELLI_PRODUCT_100B 0x100b
3107 ++#define PIRELLI_PRODUCT_100C 0x100c
3108 ++#define PIRELLI_PRODUCT_100D 0x100d
3109 ++#define PIRELLI_PRODUCT_100E 0x100e
3110 ++#define PIRELLI_PRODUCT_100F 0x100f
3111 ++#define PIRELLI_PRODUCT_1011 0x1011
3112 ++#define PIRELLI_PRODUCT_1012 0x1012
3113 ++
3114 + /* Airplus products */
3115 + #define AIRPLUS_VENDOR_ID 0x1011
3116 + #define AIRPLUS_PRODUCT_MCD650 0x3198
3117 +@@ -346,6 +364,12 @@ static int option_resume(struct usb_serial *serial);
3118 + #define HAIER_VENDOR_ID 0x201e
3119 + #define HAIER_PRODUCT_CE100 0x2009
3120 +
3121 ++#define CINTERION_VENDOR_ID 0x0681
3122 ++
3123 ++/* Olivetti products */
3124 ++#define OLIVETTI_VENDOR_ID 0x0b3c
3125 ++#define OLIVETTI_PRODUCT_OLICARD100 0xc000
3126 ++
3127 + static struct usb_device_id option_ids[] = {
3128 + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
3129 + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
3130 +@@ -621,6 +645,180 @@ static struct usb_device_id option_ids[] = {
3131 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0160, 0xff, 0xff, 0xff) },
3132 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) },
3133 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) },
3134 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff) },
3135 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff) },
3136 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) },
3137 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) },
3138 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1058, 0xff, 0xff, 0xff) },
3139 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1059, 0xff, 0xff, 0xff) },
3140 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1060, 0xff, 0xff, 0xff) },
3141 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1061, 0xff, 0xff, 0xff) },
3142 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1062, 0xff, 0xff, 0xff) },
3143 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1063, 0xff, 0xff, 0xff) },
3144 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1064, 0xff, 0xff, 0xff) },
3145 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1065, 0xff, 0xff, 0xff) },
3146 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1066, 0xff, 0xff, 0xff) },
3147 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1067, 0xff, 0xff, 0xff) },
3148 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1068, 0xff, 0xff, 0xff) },
3149 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1069, 0xff, 0xff, 0xff) },
3150 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1070, 0xff, 0xff, 0xff) },
3151 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1071, 0xff, 0xff, 0xff) },
3152 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1072, 0xff, 0xff, 0xff) },
3153 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1073, 0xff, 0xff, 0xff) },
3154 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1074, 0xff, 0xff, 0xff) },
3155 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1075, 0xff, 0xff, 0xff) },
3156 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1076, 0xff, 0xff, 0xff) },
3157 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1077, 0xff, 0xff, 0xff) },
3158 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1078, 0xff, 0xff, 0xff) },
3159 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1079, 0xff, 0xff, 0xff) },
3160 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1080, 0xff, 0xff, 0xff) },
3161 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1081, 0xff, 0xff, 0xff) },
3162 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1082, 0xff, 0xff, 0xff) },
3163 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1083, 0xff, 0xff, 0xff) },
3164 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1084, 0xff, 0xff, 0xff) },
3165 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1085, 0xff, 0xff, 0xff) },
3166 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1086, 0xff, 0xff, 0xff) },
3167 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1087, 0xff, 0xff, 0xff) },
3168 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1088, 0xff, 0xff, 0xff) },
3169 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1089, 0xff, 0xff, 0xff) },
3170 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1090, 0xff, 0xff, 0xff) },
3171 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1091, 0xff, 0xff, 0xff) },
3172 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1092, 0xff, 0xff, 0xff) },
3173 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1093, 0xff, 0xff, 0xff) },
3174 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1094, 0xff, 0xff, 0xff) },
3175 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1095, 0xff, 0xff, 0xff) },
3176 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1096, 0xff, 0xff, 0xff) },
3177 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1097, 0xff, 0xff, 0xff) },
3178 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1098, 0xff, 0xff, 0xff) },
3179 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1099, 0xff, 0xff, 0xff) },
3180 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1100, 0xff, 0xff, 0xff) },
3181 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1101, 0xff, 0xff, 0xff) },
3182 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1102, 0xff, 0xff, 0xff) },
3183 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1103, 0xff, 0xff, 0xff) },
3184 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1104, 0xff, 0xff, 0xff) },
3185 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1105, 0xff, 0xff, 0xff) },
3186 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1106, 0xff, 0xff, 0xff) },
3187 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1107, 0xff, 0xff, 0xff) },
3188 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1108, 0xff, 0xff, 0xff) },
3189 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1109, 0xff, 0xff, 0xff) },
3190 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1110, 0xff, 0xff, 0xff) },
3191 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1111, 0xff, 0xff, 0xff) },
3192 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1112, 0xff, 0xff, 0xff) },
3193 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1113, 0xff, 0xff, 0xff) },
3194 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1114, 0xff, 0xff, 0xff) },
3195 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1115, 0xff, 0xff, 0xff) },
3196 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1116, 0xff, 0xff, 0xff) },
3197 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1117, 0xff, 0xff, 0xff) },
3198 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1118, 0xff, 0xff, 0xff) },
3199 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1119, 0xff, 0xff, 0xff) },
3200 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1120, 0xff, 0xff, 0xff) },
3201 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1121, 0xff, 0xff, 0xff) },
3202 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1122, 0xff, 0xff, 0xff) },
3203 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1123, 0xff, 0xff, 0xff) },
3204 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1124, 0xff, 0xff, 0xff) },
3205 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1125, 0xff, 0xff, 0xff) },
3206 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1126, 0xff, 0xff, 0xff) },
3207 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1127, 0xff, 0xff, 0xff) },
3208 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1128, 0xff, 0xff, 0xff) },
3209 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1129, 0xff, 0xff, 0xff) },
3210 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1130, 0xff, 0xff, 0xff) },
3211 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1131, 0xff, 0xff, 0xff) },
3212 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1132, 0xff, 0xff, 0xff) },
3213 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1133, 0xff, 0xff, 0xff) },
3214 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1134, 0xff, 0xff, 0xff) },
3215 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1135, 0xff, 0xff, 0xff) },
3216 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1136, 0xff, 0xff, 0xff) },
3217 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1137, 0xff, 0xff, 0xff) },
3218 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1138, 0xff, 0xff, 0xff) },
3219 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1139, 0xff, 0xff, 0xff) },
3220 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1140, 0xff, 0xff, 0xff) },
3221 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1141, 0xff, 0xff, 0xff) },
3222 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1142, 0xff, 0xff, 0xff) },
3223 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1143, 0xff, 0xff, 0xff) },
3224 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1144, 0xff, 0xff, 0xff) },
3225 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1145, 0xff, 0xff, 0xff) },
3226 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1146, 0xff, 0xff, 0xff) },
3227 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1147, 0xff, 0xff, 0xff) },
3228 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1148, 0xff, 0xff, 0xff) },
3229 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1149, 0xff, 0xff, 0xff) },
3230 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1150, 0xff, 0xff, 0xff) },
3231 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1151, 0xff, 0xff, 0xff) },
3232 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1152, 0xff, 0xff, 0xff) },
3233 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1153, 0xff, 0xff, 0xff) },
3234 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1154, 0xff, 0xff, 0xff) },
3235 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1155, 0xff, 0xff, 0xff) },
3236 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1156, 0xff, 0xff, 0xff) },
3237 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1157, 0xff, 0xff, 0xff) },
3238 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1158, 0xff, 0xff, 0xff) },
3239 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1159, 0xff, 0xff, 0xff) },
3240 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1160, 0xff, 0xff, 0xff) },
3241 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1161, 0xff, 0xff, 0xff) },
3242 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1162, 0xff, 0xff, 0xff) },
3243 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1163, 0xff, 0xff, 0xff) },
3244 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1164, 0xff, 0xff, 0xff) },
3245 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1165, 0xff, 0xff, 0xff) },
3246 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1166, 0xff, 0xff, 0xff) },
3247 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1167, 0xff, 0xff, 0xff) },
3248 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1168, 0xff, 0xff, 0xff) },
3249 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1169, 0xff, 0xff, 0xff) },
3250 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1170, 0xff, 0xff, 0xff) },
3251 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1244, 0xff, 0xff, 0xff) },
3252 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1245, 0xff, 0xff, 0xff) },
3253 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1246, 0xff, 0xff, 0xff) },
3254 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1247, 0xff, 0xff, 0xff) },
3255 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1248, 0xff, 0xff, 0xff) },
3256 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1249, 0xff, 0xff, 0xff) },
3257 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1250, 0xff, 0xff, 0xff) },
3258 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1251, 0xff, 0xff, 0xff) },
3259 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1252, 0xff, 0xff, 0xff) },
3260 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1253, 0xff, 0xff, 0xff) },
3261 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1254, 0xff, 0xff, 0xff) },
3262 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1255, 0xff, 0xff, 0xff) },
3263 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1256, 0xff, 0xff, 0xff) },
3264 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1257, 0xff, 0xff, 0xff) },
3265 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1258, 0xff, 0xff, 0xff) },
3266 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1259, 0xff, 0xff, 0xff) },
3267 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1260, 0xff, 0xff, 0xff) },
3268 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1261, 0xff, 0xff, 0xff) },
3269 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1262, 0xff, 0xff, 0xff) },
3270 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1263, 0xff, 0xff, 0xff) },
3271 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1264, 0xff, 0xff, 0xff) },
3272 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1265, 0xff, 0xff, 0xff) },
3273 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1266, 0xff, 0xff, 0xff) },
3274 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1267, 0xff, 0xff, 0xff) },
3275 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1268, 0xff, 0xff, 0xff) },
3276 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1269, 0xff, 0xff, 0xff) },
3277 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff) },
3278 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1271, 0xff, 0xff, 0xff) },
3279 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1272, 0xff, 0xff, 0xff) },
3280 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1273, 0xff, 0xff, 0xff) },
3281 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1274, 0xff, 0xff, 0xff) },
3282 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1275, 0xff, 0xff, 0xff) },
3283 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1276, 0xff, 0xff, 0xff) },
3284 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1277, 0xff, 0xff, 0xff) },
3285 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1278, 0xff, 0xff, 0xff) },
3286 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1279, 0xff, 0xff, 0xff) },
3287 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1280, 0xff, 0xff, 0xff) },
3288 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1281, 0xff, 0xff, 0xff) },
3289 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1282, 0xff, 0xff, 0xff) },
3290 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1283, 0xff, 0xff, 0xff) },
3291 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1284, 0xff, 0xff, 0xff) },
3292 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1285, 0xff, 0xff, 0xff) },
3293 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1286, 0xff, 0xff, 0xff) },
3294 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1287, 0xff, 0xff, 0xff) },
3295 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1288, 0xff, 0xff, 0xff) },
3296 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1289, 0xff, 0xff, 0xff) },
3297 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1290, 0xff, 0xff, 0xff) },
3298 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1291, 0xff, 0xff, 0xff) },
3299 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1292, 0xff, 0xff, 0xff) },
3300 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1293, 0xff, 0xff, 0xff) },
3301 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1294, 0xff, 0xff, 0xff) },
3302 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1295, 0xff, 0xff, 0xff) },
3303 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1296, 0xff, 0xff, 0xff) },
3304 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1297, 0xff, 0xff, 0xff) },
3305 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) },
3306 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) },
3307 ++ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) },
3308 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */
3309 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) },
3310 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
3311 +@@ -649,6 +847,27 @@ static struct usb_device_id option_ids[] = {
3312 + { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
3313 + { USB_DEVICE(FOUR_G_SYSTEMS_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14) },
3314 + { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
3315 ++ /* Pirelli */
3316 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)},
3317 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_2)},
3318 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1004)},
3319 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1005)},
3320 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1006)},
3321 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1007)},
3322 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1008)},
3323 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1009)},
3324 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100A)},
3325 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100B) },
3326 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100C) },
3327 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100D) },
3328 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100E) },
3329 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) },
3330 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)},
3331 ++ { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)},
3332 ++
3333 ++ { USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) },
3334 ++
3335 ++ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) },
3336 + { } /* Terminating entry */
3337 + };
3338 + MODULE_DEVICE_TABLE(usb, option_ids);
3339 +@@ -771,12 +990,19 @@ static int option_probe(struct usb_serial *serial,
3340 + const struct usb_device_id *id)
3341 + {
3342 + struct option_intf_private *data;
3343 ++
3344 + /* D-Link DWM 652 still exposes CD-Rom emulation interface in modem mode */
3345 + if (serial->dev->descriptor.idVendor == DLINK_VENDOR_ID &&
3346 + serial->dev->descriptor.idProduct == DLINK_PRODUCT_DWM_652 &&
3347 + serial->interface->cur_altsetting->desc.bInterfaceClass == 0x8)
3348 + return -ENODEV;
3349 +
3350 ++ /* Bandrich modem and AT command interface is 0xff */
3351 ++ if ((serial->dev->descriptor.idVendor == BANDRICH_VENDOR_ID ||
3352 ++ serial->dev->descriptor.idVendor == PIRELLI_VENDOR_ID) &&
3353 ++ serial->interface->cur_altsetting->desc.bInterfaceClass != 0xff)
3354 ++ return -ENODEV;
3355 ++
3356 + data = serial->private = kzalloc(sizeof(struct option_intf_private), GFP_KERNEL);
3357 + if (!data)
3358 + return -ENOMEM;
3359 +diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
3360 +index ad1f923..c140870 100644
3361 +--- a/drivers/usb/serial/visor.c
3362 ++++ b/drivers/usb/serial/visor.c
3363 +@@ -249,6 +249,7 @@ static struct usb_serial_driver clie_3_5_device = {
3364 + .throttle = visor_throttle,
3365 + .unthrottle = visor_unthrottle,
3366 + .attach = clie_3_5_startup,
3367 ++ .release = visor_release,
3368 + .write = visor_write,
3369 + .write_room = visor_write_room,
3370 + .write_bulk_callback = visor_write_bulk_callback,
3371 +diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
3372 +index 4d0a208..7215002 100644
3373 +--- a/drivers/usb/storage/unusual_devs.h
3374 ++++ b/drivers/usb/storage/unusual_devs.h
3375 +@@ -1858,6 +1858,21 @@ UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x0201,
3376 + US_SC_DEVICE, US_PR_DEVICE, NULL,
3377 + US_FL_IGNORE_RESIDUE ),
3378 +
3379 ++/* Reported by Hans de Goede <hdegoede@××××××.com>
3380 ++ * These Appotech controllers are found in Picture Frames, they provide a
3381 ++ * (buggy) emulation of a cdrom drive which contains the windows software
3382 ++ * Uploading of pictures happens over the corresponding /dev/sg device. */
3383 ++UNUSUAL_DEV( 0x1908, 0x1315, 0x0000, 0x0000,
3384 ++ "BUILDWIN",
3385 ++ "Photo Frame",
3386 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
3387 ++ US_FL_BAD_SENSE ),
3388 ++UNUSUAL_DEV( 0x1908, 0x1320, 0x0000, 0x0000,
3389 ++ "BUILDWIN",
3390 ++ "Photo Frame",
3391 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
3392 ++ US_FL_BAD_SENSE ),
3393 ++
3394 + UNUSUAL_DEV( 0x2116, 0x0320, 0x0001, 0x0001,
3395 + "ST",
3396 + "2A",
3397 +diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c
3398 +index eab33f1..7b547f5 100644
3399 +--- a/drivers/xen/xenbus/xenbus_xs.c
3400 ++++ b/drivers/xen/xenbus/xenbus_xs.c
3401 +@@ -499,7 +499,7 @@ int xenbus_printf(struct xenbus_transaction t,
3402 + #define PRINTF_BUFFER_SIZE 4096
3403 + char *printf_buffer;
3404 +
3405 +- printf_buffer = kmalloc(PRINTF_BUFFER_SIZE, GFP_KERNEL);
3406 ++ printf_buffer = kmalloc(PRINTF_BUFFER_SIZE, GFP_NOIO | __GFP_HIGH);
3407 + if (printf_buffer == NULL)
3408 + return -ENOMEM;
3409 +
3410 +diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
3411 +index 3616042..38ebe78 100644
3412 +--- a/fs/btrfs/acl.c
3413 ++++ b/fs/btrfs/acl.c
3414 +@@ -157,6 +157,9 @@ static int btrfs_xattr_set_acl(struct inode *inode, int type,
3415 + int ret = 0;
3416 + struct posix_acl *acl = NULL;
3417 +
3418 ++ if (!is_owner_or_cap(inode))
3419 ++ return -EPERM;
3420 ++
3421 + if (value) {
3422 + acl = posix_acl_from_xattr(value, size);
3423 + if (acl == NULL) {
3424 +diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
3425 +index 5646727..05a9b77 100644
3426 +--- a/fs/cifs/cifsproto.h
3427 ++++ b/fs/cifs/cifsproto.h
3428 +@@ -95,8 +95,10 @@ extern struct cifsFileInfo *cifs_new_fileinfo(struct inode *newinode,
3429 + __u16 fileHandle, struct file *file,
3430 + struct vfsmount *mnt, unsigned int oflags);
3431 + extern int cifs_posix_open(char *full_path, struct inode **pinode,
3432 +- struct vfsmount *mnt, int mode, int oflags,
3433 +- __u32 *poplock, __u16 *pnetfid, int xid);
3434 ++ struct vfsmount *mnt,
3435 ++ struct super_block *sb,
3436 ++ int mode, int oflags,
3437 ++ __u32 *poplock, __u16 *pnetfid, int xid);
3438 + extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr,
3439 + FILE_UNIX_BASIC_INFO *info,
3440 + struct cifs_sb_info *cifs_sb);
3441 +diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
3442 +index 1f42f77..c3d6182 100644
3443 +--- a/fs/cifs/dir.c
3444 ++++ b/fs/cifs/dir.c
3445 +@@ -183,13 +183,14 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle,
3446 + }
3447 +
3448 + int cifs_posix_open(char *full_path, struct inode **pinode,
3449 +- struct vfsmount *mnt, int mode, int oflags,
3450 +- __u32 *poplock, __u16 *pnetfid, int xid)
3451 ++ struct vfsmount *mnt, struct super_block *sb,
3452 ++ int mode, int oflags,
3453 ++ __u32 *poplock, __u16 *pnetfid, int xid)
3454 + {
3455 + int rc;
3456 + FILE_UNIX_BASIC_INFO *presp_data;
3457 + __u32 posix_flags = 0;
3458 +- struct cifs_sb_info *cifs_sb = CIFS_SB(mnt->mnt_sb);
3459 ++ struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
3460 + struct cifs_fattr fattr;
3461 +
3462 + cFYI(1, ("posix open %s", full_path));
3463 +@@ -241,7 +242,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
3464 +
3465 + /* get new inode and set it up */
3466 + if (*pinode == NULL) {
3467 +- *pinode = cifs_iget(mnt->mnt_sb, &fattr);
3468 ++ *pinode = cifs_iget(sb, &fattr);
3469 + if (!*pinode) {
3470 + rc = -ENOMEM;
3471 + goto posix_open_ret;
3472 +@@ -250,7 +251,8 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
3473 + cifs_fattr_to_inode(*pinode, &fattr);
3474 + }
3475 +
3476 +- cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, oflags);
3477 ++ if (mnt)
3478 ++ cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, oflags);
3479 +
3480 + posix_open_ret:
3481 + kfree(presp_data);
3482 +@@ -314,13 +316,14 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
3483 + if (nd && (nd->flags & LOOKUP_OPEN))
3484 + oflags = nd->intent.open.flags;
3485 + else
3486 +- oflags = FMODE_READ;
3487 ++ oflags = FMODE_READ | SMB_O_CREAT;
3488 +
3489 + if (tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) &&
3490 + (CIFS_UNIX_POSIX_PATH_OPS_CAP &
3491 + le64_to_cpu(tcon->fsUnixInfo.Capability))) {
3492 +- rc = cifs_posix_open(full_path, &newinode, nd->path.mnt,
3493 +- mode, oflags, &oplock, &fileHandle, xid);
3494 ++ rc = cifs_posix_open(full_path, &newinode,
3495 ++ nd ? nd->path.mnt : NULL,
3496 ++ inode->i_sb, mode, oflags, &oplock, &fileHandle, xid);
3497 + /* EIO could indicate that (posix open) operation is not
3498 + supported, despite what server claimed in capability
3499 + negotation. EREMOTE indicates DFS junction, which is not
3500 +@@ -677,6 +680,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
3501 + (nd->flags & LOOKUP_OPEN) && !pTcon->broken_posix_open &&
3502 + (nd->intent.open.flags & O_CREAT)) {
3503 + rc = cifs_posix_open(full_path, &newInode, nd->path.mnt,
3504 ++ parent_dir_inode->i_sb,
3505 + nd->intent.open.create_mode,
3506 + nd->intent.open.flags, &oplock,
3507 + &fileHandle, xid);
3508 +diff --git a/fs/cifs/file.c b/fs/cifs/file.c
3509 +index 429337e..5d1099a 100644
3510 +--- a/fs/cifs/file.c
3511 ++++ b/fs/cifs/file.c
3512 +@@ -295,10 +295,12 @@ int cifs_open(struct inode *inode, struct file *file)
3513 + (CIFS_UNIX_POSIX_PATH_OPS_CAP &
3514 + le64_to_cpu(tcon->fsUnixInfo.Capability))) {
3515 + int oflags = (int) cifs_posix_convert_flags(file->f_flags);
3516 ++ oflags |= SMB_O_CREAT;
3517 + /* can not refresh inode info since size could be stale */
3518 + rc = cifs_posix_open(full_path, &inode, file->f_path.mnt,
3519 +- cifs_sb->mnt_file_mode /* ignored */,
3520 +- oflags, &oplock, &netfid, xid);
3521 ++ inode->i_sb,
3522 ++ cifs_sb->mnt_file_mode /* ignored */,
3523 ++ oflags, &oplock, &netfid, xid);
3524 + if (rc == 0) {
3525 + cFYI(1, ("posix open succeeded"));
3526 + /* no need for special case handling of setting mode
3527 +@@ -510,8 +512,9 @@ reopen_error_exit:
3528 + int oflags = (int) cifs_posix_convert_flags(file->f_flags);
3529 + /* can not refresh inode info since size could be stale */
3530 + rc = cifs_posix_open(full_path, NULL, file->f_path.mnt,
3531 +- cifs_sb->mnt_file_mode /* ignored */,
3532 +- oflags, &oplock, &netfid, xid);
3533 ++ inode->i_sb,
3534 ++ cifs_sb->mnt_file_mode /* ignored */,
3535 ++ oflags, &oplock, &netfid, xid);
3536 + if (rc == 0) {
3537 + cFYI(1, ("posix reopen succeeded"));
3538 + goto reopen_success;
3539 +diff --git a/fs/exofs/dir.c b/fs/exofs/dir.c
3540 +index 4cfab1c..d91e9d8 100644
3541 +--- a/fs/exofs/dir.c
3542 ++++ b/fs/exofs/dir.c
3543 +@@ -608,7 +608,7 @@ int exofs_make_empty(struct inode *inode, struct inode *parent)
3544 + de->inode_no = cpu_to_le64(parent->i_ino);
3545 + memcpy(de->name, PARENT_DIR, sizeof(PARENT_DIR));
3546 + exofs_set_de_type(de, inode);
3547 +- kunmap_atomic(page, KM_USER0);
3548 ++ kunmap_atomic(kaddr, KM_USER0);
3549 + err = exofs_commit_chunk(page, 0, chunk_size);
3550 + fail:
3551 + page_cache_release(page);
3552 +diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
3553 +index bff5f77..ef2acd2 100644
3554 +--- a/fs/fs-writeback.c
3555 ++++ b/fs/fs-writeback.c
3556 +@@ -859,6 +859,12 @@ static long wb_check_old_data_flush(struct bdi_writeback *wb)
3557 + unsigned long expired;
3558 + long nr_pages;
3559 +
3560 ++ /*
3561 ++ * When set to zero, disable periodic writeback
3562 ++ */
3563 ++ if (!dirty_writeback_interval)
3564 ++ return 0;
3565 ++
3566 + expired = wb->last_old_flush +
3567 + msecs_to_jiffies(dirty_writeback_interval * 10);
3568 + if (time_before(jiffies, expired))
3569 +@@ -954,8 +960,12 @@ int bdi_writeback_task(struct bdi_writeback *wb)
3570 + break;
3571 + }
3572 +
3573 +- wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
3574 +- schedule_timeout_interruptible(wait_jiffies);
3575 ++ if (dirty_writeback_interval) {
3576 ++ wait_jiffies = msecs_to_jiffies(dirty_writeback_interval * 10);
3577 ++ schedule_timeout_interruptible(wait_jiffies);
3578 ++ } else
3579 ++ schedule();
3580 ++
3581 + try_to_freeze();
3582 + }
3583 +
3584 +diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
3585 +index a32bcd7..b3fd1d8 100644
3586 +--- a/fs/gfs2/file.c
3587 ++++ b/fs/gfs2/file.c
3588 +@@ -218,6 +218,11 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask)
3589 + if (error)
3590 + goto out_drop_write;
3591 +
3592 ++ error = -EACCES;
3593 ++ if (!is_owner_or_cap(inode))
3594 ++ goto out;
3595 ++
3596 ++ error = 0;
3597 + flags = ip->i_diskflags;
3598 + new_flags = (flags & ~mask) | (reqflags & mask);
3599 + if ((new_flags ^ flags) == 0)
3600 +@@ -275,8 +280,10 @@ static int gfs2_set_flags(struct file *filp, u32 __user *ptr)
3601 + {
3602 + struct inode *inode = filp->f_path.dentry->d_inode;
3603 + u32 fsflags, gfsflags;
3604 ++
3605 + if (get_user(fsflags, ptr))
3606 + return -EFAULT;
3607 ++
3608 + gfsflags = fsflags_cvt(fsflags_to_gfs2, fsflags);
3609 + if (!S_ISDIR(inode->i_mode)) {
3610 + if (gfsflags & GFS2_DIF_INHERIT_JDATA)
3611 +diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
3612 +index 4160afa..bd224ee 100644
3613 +--- a/fs/jbd/journal.c
3614 ++++ b/fs/jbd/journal.c
3615 +@@ -1913,7 +1913,7 @@ static void __init jbd_create_debugfs_entry(void)
3616 + {
3617 + jbd_debugfs_dir = debugfs_create_dir("jbd", NULL);
3618 + if (jbd_debugfs_dir)
3619 +- jbd_debug = debugfs_create_u8("jbd-debug", S_IRUGO,
3620 ++ jbd_debug = debugfs_create_u8("jbd-debug", S_IRUGO | S_IWUSR,
3621 + jbd_debugfs_dir,
3622 + &journal_enable_debug);
3623 + }
3624 +diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
3625 +index b7ca3a9..17af879 100644
3626 +--- a/fs/jbd2/journal.c
3627 ++++ b/fs/jbd2/journal.c
3628 +@@ -2115,7 +2115,8 @@ static void __init jbd2_create_debugfs_entry(void)
3629 + {
3630 + jbd2_debugfs_dir = debugfs_create_dir("jbd2", NULL);
3631 + if (jbd2_debugfs_dir)
3632 +- jbd2_debug = debugfs_create_u8(JBD2_DEBUG_NAME, S_IRUGO,
3633 ++ jbd2_debug = debugfs_create_u8(JBD2_DEBUG_NAME,
3634 ++ S_IRUGO | S_IWUSR,
3635 + jbd2_debugfs_dir,
3636 + &jbd2_journal_enable_debug);
3637 + }
3638 +diff --git a/fs/libfs.c b/fs/libfs.c
3639 +index 219576c..ba36e93 100644
3640 +--- a/fs/libfs.c
3641 ++++ b/fs/libfs.c
3642 +@@ -415,7 +415,8 @@ int simple_write_end(struct file *file, struct address_space *mapping,
3643 + * unique inode values later for this filesystem, then you must take care
3644 + * to pass it an appropriate max_reserved value to avoid collisions.
3645 + */
3646 +-int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files)
3647 ++int simple_fill_super(struct super_block *s, unsigned long magic,
3648 ++ struct tree_descr *files)
3649 + {
3650 + struct inode *inode;
3651 + struct dentry *root;
3652 +diff --git a/fs/namespace.c b/fs/namespace.c
3653 +index bdc3cb4..2beb0fb 100644
3654 +--- a/fs/namespace.c
3655 ++++ b/fs/namespace.c
3656 +@@ -1119,8 +1119,15 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
3657 + {
3658 + struct path path;
3659 + int retval;
3660 ++ int lookup_flags = 0;
3661 +
3662 +- retval = user_path(name, &path);
3663 ++ if (flags & ~(MNT_FORCE | MNT_DETACH | MNT_EXPIRE | UMOUNT_NOFOLLOW))
3664 ++ return -EINVAL;
3665 ++
3666 ++ if (!(flags & UMOUNT_NOFOLLOW))
3667 ++ lookup_flags |= LOOKUP_FOLLOW;
3668 ++
3669 ++ retval = user_path_at(AT_FDCWD, name, lookup_flags, &path);
3670 + if (retval)
3671 + goto out;
3672 + retval = -EINVAL;
3673 +diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
3674 +index 67ea83e..4d4e2d0 100644
3675 +--- a/fs/nfsd/nfssvc.c
3676 ++++ b/fs/nfsd/nfssvc.c
3677 +@@ -136,7 +136,7 @@ u32 nfsd_supported_minorversion;
3678 + int nfsd_vers(int vers, enum vers_op change)
3679 + {
3680 + if (vers < NFSD_MINVERS || vers >= NFSD_NRVERS)
3681 +- return -1;
3682 ++ return 0;
3683 + switch(change) {
3684 + case NFSD_SET:
3685 + nfsd_versions[vers] = nfsd_version[vers];
3686 +diff --git a/include/linux/fs.h b/include/linux/fs.h
3687 +index 9b67805..b6a5622 100644
3688 +--- a/include/linux/fs.h
3689 ++++ b/include/linux/fs.h
3690 +@@ -1310,6 +1310,8 @@ extern int send_sigurg(struct fown_struct *fown);
3691 + #define MNT_FORCE 0x00000001 /* Attempt to forcibily umount */
3692 + #define MNT_DETACH 0x00000002 /* Just detach from the tree */
3693 + #define MNT_EXPIRE 0x00000004 /* Mark for expiry */
3694 ++#define UMOUNT_NOFOLLOW 0x00000008 /* Don't follow symlink on umount */
3695 ++#define UMOUNT_UNUSED 0x80000000 /* Flag guaranteed to be unused */
3696 +
3697 + extern struct list_head super_blocks;
3698 + extern spinlock_t sb_lock;
3699 +@@ -2376,7 +2378,7 @@ extern const struct file_operations simple_dir_operations;
3700 + extern const struct inode_operations simple_dir_inode_operations;
3701 + struct tree_descr { char *name; const struct file_operations *ops; int mode; };
3702 + struct dentry *d_alloc_name(struct dentry *, const char *);
3703 +-extern int simple_fill_super(struct super_block *, int, struct tree_descr *);
3704 ++extern int simple_fill_super(struct super_block *, unsigned long, struct tree_descr *);
3705 + extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
3706 + extern void simple_release_fs(struct vfsmount **mount, int *count);
3707 +
3708 +diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
3709 +index 63adefe..67325bf 100644
3710 +--- a/include/linux/pci_ids.h
3711 ++++ b/include/linux/pci_ids.h
3712 +@@ -2317,6 +2317,7 @@
3713 + #define PCI_VENDOR_ID_JMICRON 0x197B
3714 + #define PCI_DEVICE_ID_JMICRON_JMB360 0x2360
3715 + #define PCI_DEVICE_ID_JMICRON_JMB361 0x2361
3716 ++#define PCI_DEVICE_ID_JMICRON_JMB362 0x2362
3717 + #define PCI_DEVICE_ID_JMICRON_JMB363 0x2363
3718 + #define PCI_DEVICE_ID_JMICRON_JMB365 0x2365
3719 + #define PCI_DEVICE_ID_JMICRON_JMB366 0x2366
3720 +diff --git a/include/linux/swap.h b/include/linux/swap.h
3721 +index 4ec9001..977d150 100644
3722 +--- a/include/linux/swap.h
3723 ++++ b/include/linux/swap.h
3724 +@@ -218,21 +218,11 @@ static inline void lru_cache_add_anon(struct page *page)
3725 + __lru_cache_add(page, LRU_INACTIVE_ANON);
3726 + }
3727 +
3728 +-static inline void lru_cache_add_active_anon(struct page *page)
3729 +-{
3730 +- __lru_cache_add(page, LRU_ACTIVE_ANON);
3731 +-}
3732 +-
3733 + static inline void lru_cache_add_file(struct page *page)
3734 + {
3735 + __lru_cache_add(page, LRU_INACTIVE_FILE);
3736 + }
3737 +
3738 +-static inline void lru_cache_add_active_file(struct page *page)
3739 +-{
3740 +- __lru_cache_add(page, LRU_ACTIVE_FILE);
3741 +-}
3742 +-
3743 + /* linux/mm/vmscan.c */
3744 + extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
3745 + gfp_t gfp_mask, nodemask_t *mask);
3746 +diff --git a/include/linux/tboot.h b/include/linux/tboot.h
3747 +index bf2a0c7..1dba6ee 100644
3748 +--- a/include/linux/tboot.h
3749 ++++ b/include/linux/tboot.h
3750 +@@ -150,6 +150,7 @@ extern int tboot_force_iommu(void);
3751 +
3752 + #else
3753 +
3754 ++#define tboot_enabled() 0
3755 + #define tboot_probe() do { } while (0)
3756 + #define tboot_shutdown(shutdown_type) do { } while (0)
3757 + #define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \
3758 +diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
3759 +index 0a47456..89e54e9 100644
3760 +--- a/include/net/sctp/structs.h
3761 ++++ b/include/net/sctp/structs.h
3762 +@@ -772,6 +772,7 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
3763 + struct iovec *data);
3764 + void sctp_chunk_free(struct sctp_chunk *);
3765 + void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
3766 ++void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data);
3767 + struct sctp_chunk *sctp_chunkify(struct sk_buff *,
3768 + const struct sctp_association *,
3769 + struct sock *);
3770 +diff --git a/kernel/compat.c b/kernel/compat.c
3771 +index f6c204f..180d188 100644
3772 +--- a/kernel/compat.c
3773 ++++ b/kernel/compat.c
3774 +@@ -494,29 +494,26 @@ asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
3775 + {
3776 + int ret;
3777 + cpumask_var_t mask;
3778 +- unsigned long *k;
3779 +- unsigned int min_length = cpumask_size();
3780 +-
3781 +- if (nr_cpu_ids <= BITS_PER_COMPAT_LONG)
3782 +- min_length = sizeof(compat_ulong_t);
3783 +
3784 +- if (len < min_length)
3785 ++ if ((len * BITS_PER_BYTE) < nr_cpu_ids)
3786 ++ return -EINVAL;
3787 ++ if (len & (sizeof(compat_ulong_t)-1))
3788 + return -EINVAL;
3789 +
3790 + if (!alloc_cpumask_var(&mask, GFP_KERNEL))
3791 + return -ENOMEM;
3792 +
3793 + ret = sched_getaffinity(pid, mask);
3794 +- if (ret < 0)
3795 +- goto out;
3796 ++ if (ret == 0) {
3797 ++ size_t retlen = min_t(size_t, len, cpumask_size());
3798 +
3799 +- k = cpumask_bits(mask);
3800 +- ret = compat_put_bitmap(user_mask_ptr, k, min_length * 8);
3801 +- if (ret == 0)
3802 +- ret = min_length;
3803 +-
3804 +-out:
3805 ++ if (compat_put_bitmap(user_mask_ptr, cpumask_bits(mask), retlen * 8))
3806 ++ ret = -EFAULT;
3807 ++ else
3808 ++ ret = retlen;
3809 ++ }
3810 + free_cpumask_var(mask);
3811 ++
3812 + return ret;
3813 + }
3814 +
3815 +diff --git a/kernel/mutex.c b/kernel/mutex.c
3816 +index 947b3ad..f85644c 100644
3817 +--- a/kernel/mutex.c
3818 ++++ b/kernel/mutex.c
3819 +@@ -172,6 +172,13 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
3820 + struct thread_info *owner;
3821 +
3822 + /*
3823 ++ * If we own the BKL, then don't spin. The owner of
3824 ++ * the mutex might be waiting on us to release the BKL.
3825 ++ */
3826 ++ if (unlikely(current->lock_depth >= 0))
3827 ++ break;
3828 ++
3829 ++ /*
3830 + * If there's an owner, wait for it to either
3831 + * release the lock or go to sleep.
3832 + */
3833 +diff --git a/kernel/perf_event.c b/kernel/perf_event.c
3834 +index 72df1eb..183d437 100644
3835 +--- a/kernel/perf_event.c
3836 ++++ b/kernel/perf_event.c
3837 +@@ -4510,8 +4510,8 @@ SYSCALL_DEFINE5(perf_event_open,
3838 + struct perf_event_context *ctx;
3839 + struct file *event_file = NULL;
3840 + struct file *group_file = NULL;
3841 ++ int event_fd;
3842 + int fput_needed = 0;
3843 +- int fput_needed2 = 0;
3844 + int err;
3845 +
3846 + /* for future expandability... */
3847 +@@ -4532,12 +4532,18 @@ SYSCALL_DEFINE5(perf_event_open,
3848 + return -EINVAL;
3849 + }
3850 +
3851 ++ event_fd = get_unused_fd_flags(O_RDWR);
3852 ++ if (event_fd < 0)
3853 ++ return event_fd;
3854 ++
3855 + /*
3856 + * Get the target context (task or percpu):
3857 + */
3858 + ctx = find_get_context(pid, cpu);
3859 +- if (IS_ERR(ctx))
3860 +- return PTR_ERR(ctx);
3861 ++ if (IS_ERR(ctx)) {
3862 ++ err = PTR_ERR(ctx);
3863 ++ goto err_fd;
3864 ++ }
3865 +
3866 + /*
3867 + * Look up the group leader (we will attach this event to it):
3868 +@@ -4577,13 +4583,11 @@ SYSCALL_DEFINE5(perf_event_open,
3869 + if (IS_ERR(event))
3870 + goto err_put_context;
3871 +
3872 +- err = anon_inode_getfd("[perf_event]", &perf_fops, event, 0);
3873 +- if (err < 0)
3874 +- goto err_free_put_context;
3875 +-
3876 +- event_file = fget_light(err, &fput_needed2);
3877 +- if (!event_file)
3878 ++ event_file = anon_inode_getfile("[perf_event]", &perf_fops, event, O_RDWR);
3879 ++ if (IS_ERR(event_file)) {
3880 ++ err = PTR_ERR(event_file);
3881 + goto err_free_put_context;
3882 ++ }
3883 +
3884 + if (flags & PERF_FLAG_FD_OUTPUT) {
3885 + err = perf_event_set_output(event, group_fd);
3886 +@@ -4604,19 +4608,19 @@ SYSCALL_DEFINE5(perf_event_open,
3887 + list_add_tail(&event->owner_entry, &current->perf_event_list);
3888 + mutex_unlock(&current->perf_event_mutex);
3889 +
3890 +-err_fput_free_put_context:
3891 +- fput_light(event_file, fput_needed2);
3892 ++ fput_light(group_file, fput_needed);
3893 ++ fd_install(event_fd, event_file);
3894 ++ return event_fd;
3895 +
3896 ++err_fput_free_put_context:
3897 ++ fput(event_file);
3898 + err_free_put_context:
3899 +- if (err < 0)
3900 +- free_event(event);
3901 +-
3902 ++ free_event(event);
3903 + err_put_context:
3904 +- if (err < 0)
3905 +- put_ctx(ctx);
3906 +-
3907 + fput_light(group_file, fput_needed);
3908 +-
3909 ++ put_ctx(ctx);
3910 ++err_fd:
3911 ++ put_unused_fd(event_fd);
3912 + return err;
3913 + }
3914 +
3915 +diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
3916 +index 4954407..5e76d22 100644
3917 +--- a/kernel/posix-timers.c
3918 ++++ b/kernel/posix-timers.c
3919 +@@ -559,14 +559,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
3920 + new_timer->it_id = (timer_t) new_timer_id;
3921 + new_timer->it_clock = which_clock;
3922 + new_timer->it_overrun = -1;
3923 +- error = CLOCK_DISPATCH(which_clock, timer_create, (new_timer));
3924 +- if (error)
3925 +- goto out;
3926 +
3927 +- /*
3928 +- * return the timer_id now. The next step is hard to
3929 +- * back out if there is an error.
3930 +- */
3931 + if (copy_to_user(created_timer_id,
3932 + &new_timer_id, sizeof (new_timer_id))) {
3933 + error = -EFAULT;
3934 +@@ -597,6 +590,10 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
3935 + new_timer->sigq->info.si_tid = new_timer->it_id;
3936 + new_timer->sigq->info.si_code = SI_TIMER;
3937 +
3938 ++ error = CLOCK_DISPATCH(which_clock, timer_create, (new_timer));
3939 ++ if (error)
3940 ++ goto out;
3941 ++
3942 + spin_lock_irq(&current->sighand->siglock);
3943 + new_timer->it_signal = current->signal;
3944 + list_add(&new_timer->list, &current->signal->posix_timers);
3945 +diff --git a/kernel/signal.c b/kernel/signal.c
3946 +index 4d0658d..423655a 100644
3947 +--- a/kernel/signal.c
3948 ++++ b/kernel/signal.c
3949 +@@ -591,7 +591,7 @@ static int rm_from_queue(unsigned long mask, struct sigpending *s)
3950 + static int check_kill_permission(int sig, struct siginfo *info,
3951 + struct task_struct *t)
3952 + {
3953 +- const struct cred *cred = current_cred(), *tcred;
3954 ++ const struct cred *cred, *tcred;
3955 + struct pid *sid;
3956 + int error;
3957 +
3958 +@@ -605,8 +605,10 @@ static int check_kill_permission(int sig, struct siginfo *info,
3959 + if (error)
3960 + return error;
3961 +
3962 ++ cred = current_cred();
3963 + tcred = __task_cred(t);
3964 +- if ((cred->euid ^ tcred->suid) &&
3965 ++ if (!same_thread_group(current, t) &&
3966 ++ (cred->euid ^ tcred->suid) &&
3967 + (cred->euid ^ tcred->uid) &&
3968 + (cred->uid ^ tcred->suid) &&
3969 + (cred->uid ^ tcred->uid) &&
3970 +diff --git a/mm/filemap.c b/mm/filemap.c
3971 +index 8e96c90..46e3f8a 100644
3972 +--- a/mm/filemap.c
3973 ++++ b/mm/filemap.c
3974 +@@ -462,7 +462,7 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
3975 + /*
3976 + * Splice_read and readahead add shmem/tmpfs pages into the page cache
3977 + * before shmem_readpage has a chance to mark them as SwapBacked: they
3978 +- * need to go on the active_anon lru below, and mem_cgroup_cache_charge
3979 ++ * need to go on the anon lru below, and mem_cgroup_cache_charge
3980 + * (called in add_to_page_cache) needs to know where they're going too.
3981 + */
3982 + if (mapping_cap_swap_backed(mapping))
3983 +@@ -473,7 +473,7 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
3984 + if (page_is_file_cache(page))
3985 + lru_cache_add_file(page);
3986 + else
3987 +- lru_cache_add_active_anon(page);
3988 ++ lru_cache_add_anon(page);
3989 + }
3990 + return ret;
3991 + }
3992 +@@ -1120,6 +1120,12 @@ page_not_up_to_date_locked:
3993 + }
3994 +
3995 + readpage:
3996 ++ /*
3997 ++ * A previous I/O error may have been due to temporary
3998 ++ * failures, eg. multipath errors.
3999 ++ * PG_error will be set again if readpage fails.
4000 ++ */
4001 ++ ClearPageError(page);
4002 + /* Start the actual read. The read will unlock the page. */
4003 + error = mapping->a_ops->readpage(filp, page);
4004 +
4005 +diff --git a/mm/hugetlb.c b/mm/hugetlb.c
4006 +index b7b02ce..f5a106e 100644
4007 +--- a/mm/hugetlb.c
4008 ++++ b/mm/hugetlb.c
4009 +@@ -401,7 +401,7 @@ static void clear_huge_page(struct page *page,
4010 + {
4011 + int i;
4012 +
4013 +- if (unlikely(sz > MAX_ORDER_NR_PAGES)) {
4014 ++ if (unlikely(sz/PAGE_SIZE > MAX_ORDER_NR_PAGES)) {
4015 + clear_gigantic_page(page, addr, sz);
4016 + return;
4017 + }
4018 +diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
4019 +index 4d5543a..ea367cf 100644
4020 +--- a/net/mac80211/Kconfig
4021 ++++ b/net/mac80211/Kconfig
4022 +@@ -15,8 +15,12 @@ comment "CFG80211 needs to be enabled for MAC80211"
4023 +
4024 + if MAC80211 != n
4025 +
4026 ++config MAC80211_HAS_RC
4027 ++ def_bool n
4028 ++
4029 + config MAC80211_RC_PID
4030 + bool "PID controller based rate control algorithm" if EMBEDDED
4031 ++ select MAC80211_HAS_RC
4032 + ---help---
4033 + This option enables a TX rate control algorithm for
4034 + mac80211 that uses a PID controller to select the TX
4035 +@@ -24,12 +28,14 @@ config MAC80211_RC_PID
4036 +
4037 + config MAC80211_RC_MINSTREL
4038 + bool "Minstrel" if EMBEDDED
4039 ++ select MAC80211_HAS_RC
4040 + default y
4041 + ---help---
4042 + This option enables the 'minstrel' TX rate control algorithm
4043 +
4044 + choice
4045 + prompt "Default rate control algorithm"
4046 ++ depends on MAC80211_HAS_RC
4047 + default MAC80211_RC_DEFAULT_MINSTREL
4048 + ---help---
4049 + This option selects the default rate control algorithm
4050 +@@ -62,6 +68,9 @@ config MAC80211_RC_DEFAULT
4051 +
4052 + endif
4053 +
4054 ++comment "Some wireless drivers require a rate control algorithm"
4055 ++ depends on MAC80211_HAS_RC=n
4056 ++
4057 + config MAC80211_MESH
4058 + bool "Enable mac80211 mesh networking (pre-802.11s) support"
4059 + depends on MAC80211 && EXPERIMENTAL
4060 +diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
4061 +index 538a7d7..3ee3cb8 100644
4062 +--- a/net/mac80211/rx.c
4063 ++++ b/net/mac80211/rx.c
4064 +@@ -1220,7 +1220,8 @@ ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc)
4065 + (rx->key || rx->sdata->drop_unencrypted)))
4066 + return -EACCES;
4067 + if (rx->sta && test_sta_flags(rx->sta, WLAN_STA_MFP)) {
4068 +- if (unlikely(ieee80211_is_unicast_robust_mgmt_frame(rx->skb) &&
4069 ++ if (unlikely(!ieee80211_has_protected(fc) &&
4070 ++ ieee80211_is_unicast_robust_mgmt_frame(rx->skb) &&
4071 + rx->key))
4072 + return -EACCES;
4073 + /* BIP does not use Protected field, so need to check MMIE */
4074 +diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
4075 +index d3efff2..b1d7904 100644
4076 +--- a/net/mac80211/tx.c
4077 ++++ b/net/mac80211/tx.c
4078 +@@ -496,7 +496,8 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
4079 + struct ieee80211_hdr *hdr = (void *)tx->skb->data;
4080 + struct ieee80211_supported_band *sband;
4081 + struct ieee80211_rate *rate;
4082 +- int i, len;
4083 ++ int i;
4084 ++ u32 len;
4085 + bool inval = false, rts = false, short_preamble = false;
4086 + struct ieee80211_tx_rate_control txrc;
4087 + u32 sta_flags;
4088 +@@ -505,7 +506,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
4089 +
4090 + sband = tx->local->hw.wiphy->bands[tx->channel->band];
4091 +
4092 +- len = min_t(int, tx->skb->len + FCS_LEN,
4093 ++ len = min_t(u32, tx->skb->len + FCS_LEN,
4094 + tx->local->hw.wiphy->frag_threshold);
4095 +
4096 + /* set up the tx rate control struct we give the RC algo */
4097 +diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
4098 +index 9d881a6..8579b4f 100644
4099 +--- a/net/sctp/sm_make_chunk.c
4100 ++++ b/net/sctp/sm_make_chunk.c
4101 +@@ -107,7 +107,7 @@ static const struct sctp_paramhdr prsctp_param = {
4102 + cpu_to_be16(sizeof(struct sctp_paramhdr)),
4103 + };
4104 +
4105 +-/* A helper to initialize to initialize an op error inside a
4106 ++/* A helper to initialize an op error inside a
4107 + * provided chunk, as most cause codes will be embedded inside an
4108 + * abort chunk.
4109 + */
4110 +@@ -124,6 +124,29 @@ void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code,
4111 + chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err);
4112 + }
4113 +
4114 ++/* A helper to initialize an op error inside a
4115 ++ * provided chunk, as most cause codes will be embedded inside an
4116 ++ * abort chunk. Differs from sctp_init_cause in that it won't oops
4117 ++ * if there isn't enough space in the op error chunk
4118 ++ */
4119 ++int sctp_init_cause_fixed(struct sctp_chunk *chunk, __be16 cause_code,
4120 ++ size_t paylen)
4121 ++{
4122 ++ sctp_errhdr_t err;
4123 ++ __u16 len;
4124 ++
4125 ++ /* Cause code constants are now defined in network order. */
4126 ++ err.cause = cause_code;
4127 ++ len = sizeof(sctp_errhdr_t) + paylen;
4128 ++ err.length = htons(len);
4129 ++
4130 ++ if (skb_tailroom(chunk->skb) < len)
4131 ++ return -ENOSPC;
4132 ++ chunk->subh.err_hdr = sctp_addto_chunk_fixed(chunk,
4133 ++ sizeof(sctp_errhdr_t),
4134 ++ &err);
4135 ++ return 0;
4136 ++}
4137 + /* 3.3.2 Initiation (INIT) (1)
4138 + *
4139 + * This chunk is used to initiate a SCTP association between two
4140 +@@ -1125,6 +1148,24 @@ nodata:
4141 + return retval;
4142 + }
4143 +
4144 ++/* Create an Operation Error chunk of a fixed size,
4145 ++ * specifically, max(asoc->pathmtu, SCTP_DEFAULT_MAXSEGMENT)
4146 ++ * This is a helper function to allocate an error chunk for
4147 ++ * for those invalid parameter codes in which we may not want
4148 ++ * to report all the errors, if the incomming chunk is large
4149 ++ */
4150 ++static inline struct sctp_chunk *sctp_make_op_error_fixed(
4151 ++ const struct sctp_association *asoc,
4152 ++ const struct sctp_chunk *chunk)
4153 ++{
4154 ++ size_t size = asoc ? asoc->pathmtu : 0;
4155 ++
4156 ++ if (!size)
4157 ++ size = SCTP_DEFAULT_MAXSEGMENT;
4158 ++
4159 ++ return sctp_make_op_error_space(asoc, chunk, size);
4160 ++}
4161 ++
4162 + /* Create an Operation Error chunk. */
4163 + struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc,
4164 + const struct sctp_chunk *chunk,
4165 +@@ -1365,6 +1406,18 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
4166 + return target;
4167 + }
4168 +
4169 ++/* Append bytes to the end of a chunk. Returns NULL if there isn't sufficient
4170 ++ * space in the chunk
4171 ++ */
4172 ++void *sctp_addto_chunk_fixed(struct sctp_chunk *chunk,
4173 ++ int len, const void *data)
4174 ++{
4175 ++ if (skb_tailroom(chunk->skb) >= len)
4176 ++ return sctp_addto_chunk(chunk, len, data);
4177 ++ else
4178 ++ return NULL;
4179 ++}
4180 ++
4181 + /* Append bytes from user space to the end of a chunk. Will panic if
4182 + * chunk is not big enough.
4183 + * Returns a kernel err value.
4184 +@@ -1968,13 +2021,12 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc,
4185 + * returning multiple unknown parameters.
4186 + */
4187 + if (NULL == *errp)
4188 +- *errp = sctp_make_op_error_space(asoc, chunk,
4189 +- ntohs(chunk->chunk_hdr->length));
4190 ++ *errp = sctp_make_op_error_fixed(asoc, chunk);
4191 +
4192 + if (*errp) {
4193 +- sctp_init_cause(*errp, SCTP_ERROR_UNKNOWN_PARAM,
4194 ++ sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM,
4195 + WORD_ROUND(ntohs(param.p->length)));
4196 +- sctp_addto_chunk(*errp,
4197 ++ sctp_addto_chunk_fixed(*errp,
4198 + WORD_ROUND(ntohs(param.p->length)),
4199 + param.v);
4200 + } else {
4201 +diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
4202 +index 327011f..7809137 100644
4203 +--- a/net/tipc/bearer.c
4204 ++++ b/net/tipc/bearer.c
4205 +@@ -45,10 +45,10 @@
4206 +
4207 + #define MAX_ADDR_STR 32
4208 +
4209 +-static struct media *media_list = NULL;
4210 ++static struct media media_list[MAX_MEDIA];
4211 + static u32 media_count = 0;
4212 +
4213 +-struct bearer *tipc_bearers = NULL;
4214 ++struct bearer tipc_bearers[MAX_BEARERS];
4215 +
4216 + /**
4217 + * media_name_valid - validate media name
4218 +@@ -108,9 +108,11 @@ int tipc_register_media(u32 media_type,
4219 + int res = -EINVAL;
4220 +
4221 + write_lock_bh(&tipc_net_lock);
4222 +- if (!media_list)
4223 +- goto exit;
4224 +
4225 ++ if (tipc_mode != TIPC_NET_MODE) {
4226 ++ warn("Media <%s> rejected, not in networked mode yet\n", name);
4227 ++ goto exit;
4228 ++ }
4229 + if (!media_name_valid(name)) {
4230 + warn("Media <%s> rejected, illegal name\n", name);
4231 + goto exit;
4232 +@@ -660,33 +662,10 @@ int tipc_disable_bearer(const char *name)
4233 +
4234 +
4235 +
4236 +-int tipc_bearer_init(void)
4237 +-{
4238 +- int res;
4239 +-
4240 +- write_lock_bh(&tipc_net_lock);
4241 +- tipc_bearers = kcalloc(MAX_BEARERS, sizeof(struct bearer), GFP_ATOMIC);
4242 +- media_list = kcalloc(MAX_MEDIA, sizeof(struct media), GFP_ATOMIC);
4243 +- if (tipc_bearers && media_list) {
4244 +- res = 0;
4245 +- } else {
4246 +- kfree(tipc_bearers);
4247 +- kfree(media_list);
4248 +- tipc_bearers = NULL;
4249 +- media_list = NULL;
4250 +- res = -ENOMEM;
4251 +- }
4252 +- write_unlock_bh(&tipc_net_lock);
4253 +- return res;
4254 +-}
4255 +-
4256 + void tipc_bearer_stop(void)
4257 + {
4258 + u32 i;
4259 +
4260 +- if (!tipc_bearers)
4261 +- return;
4262 +-
4263 + for (i = 0; i < MAX_BEARERS; i++) {
4264 + if (tipc_bearers[i].active)
4265 + tipc_bearers[i].publ.blocked = 1;
4266 +@@ -695,10 +674,6 @@ void tipc_bearer_stop(void)
4267 + if (tipc_bearers[i].active)
4268 + bearer_disable(tipc_bearers[i].publ.name);
4269 + }
4270 +- kfree(tipc_bearers);
4271 +- kfree(media_list);
4272 +- tipc_bearers = NULL;
4273 +- media_list = NULL;
4274 + media_count = 0;
4275 + }
4276 +
4277 +diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
4278 +index ca57348..000228e 100644
4279 +--- a/net/tipc/bearer.h
4280 ++++ b/net/tipc/bearer.h
4281 +@@ -114,7 +114,7 @@ struct bearer_name {
4282 +
4283 + struct link;
4284 +
4285 +-extern struct bearer *tipc_bearers;
4286 ++extern struct bearer tipc_bearers[];
4287 +
4288 + void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a);
4289 + struct sk_buff *tipc_media_get_names(void);
4290 +diff --git a/net/tipc/net.c b/net/tipc/net.c
4291 +index 7906608..f25b1cd 100644
4292 +--- a/net/tipc/net.c
4293 ++++ b/net/tipc/net.c
4294 +@@ -116,7 +116,8 @@
4295 + */
4296 +
4297 + DEFINE_RWLOCK(tipc_net_lock);
4298 +-struct network tipc_net = { NULL };
4299 ++struct _zone *tipc_zones[256] = { NULL, };
4300 ++struct network tipc_net = { tipc_zones };
4301 +
4302 + struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref)
4303 + {
4304 +@@ -158,28 +159,12 @@ void tipc_net_send_external_routes(u32 dest)
4305 + }
4306 + }
4307 +
4308 +-static int net_init(void)
4309 +-{
4310 +- memset(&tipc_net, 0, sizeof(tipc_net));
4311 +- tipc_net.zones = kcalloc(tipc_max_zones + 1, sizeof(struct _zone *), GFP_ATOMIC);
4312 +- if (!tipc_net.zones) {
4313 +- return -ENOMEM;
4314 +- }
4315 +- return 0;
4316 +-}
4317 +-
4318 + static void net_stop(void)
4319 + {
4320 + u32 z_num;
4321 +
4322 +- if (!tipc_net.zones)
4323 +- return;
4324 +-
4325 +- for (z_num = 1; z_num <= tipc_max_zones; z_num++) {
4326 ++ for (z_num = 1; z_num <= tipc_max_zones; z_num++)
4327 + tipc_zone_delete(tipc_net.zones[z_num]);
4328 +- }
4329 +- kfree(tipc_net.zones);
4330 +- tipc_net.zones = NULL;
4331 + }
4332 +
4333 + static void net_route_named_msg(struct sk_buff *buf)
4334 +@@ -282,9 +267,7 @@ int tipc_net_start(u32 addr)
4335 + tipc_named_reinit();
4336 + tipc_port_reinit();
4337 +
4338 +- if ((res = tipc_bearer_init()) ||
4339 +- (res = net_init()) ||
4340 +- (res = tipc_cltr_init()) ||
4341 ++ if ((res = tipc_cltr_init()) ||
4342 + (res = tipc_bclink_init())) {
4343 + return res;
4344 + }
4345 +diff --git a/net/wireless/core.h b/net/wireless/core.h
4346 +index 68b3219..376798f 100644
4347 +--- a/net/wireless/core.h
4348 ++++ b/net/wireless/core.h
4349 +@@ -385,6 +385,8 @@ int rdev_set_freq(struct cfg80211_registered_device *rdev,
4350 + struct wireless_dev *for_wdev,
4351 + int freq, enum nl80211_channel_type channel_type);
4352 +
4353 ++u16 cfg80211_calculate_bitrate(struct rate_info *rate);
4354 ++
4355 + #ifdef CONFIG_CFG80211_DEVELOPER_WARNINGS
4356 + #define CFG80211_DEV_WARN_ON(cond) WARN_ON(cond)
4357 + #else
4358 +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
4359 +index ca3c92a..b75e718 100644
4360 +--- a/net/wireless/nl80211.c
4361 ++++ b/net/wireless/nl80211.c
4362 +@@ -1562,39 +1562,6 @@ static int parse_station_flags(struct genl_info *info,
4363 + return 0;
4364 + }
4365 +
4366 +-static u16 nl80211_calculate_bitrate(struct rate_info *rate)
4367 +-{
4368 +- int modulation, streams, bitrate;
4369 +-
4370 +- if (!(rate->flags & RATE_INFO_FLAGS_MCS))
4371 +- return rate->legacy;
4372 +-
4373 +- /* the formula below does only work for MCS values smaller than 32 */
4374 +- if (rate->mcs >= 32)
4375 +- return 0;
4376 +-
4377 +- modulation = rate->mcs & 7;
4378 +- streams = (rate->mcs >> 3) + 1;
4379 +-
4380 +- bitrate = (rate->flags & RATE_INFO_FLAGS_40_MHZ_WIDTH) ?
4381 +- 13500000 : 6500000;
4382 +-
4383 +- if (modulation < 4)
4384 +- bitrate *= (modulation + 1);
4385 +- else if (modulation == 4)
4386 +- bitrate *= (modulation + 2);
4387 +- else
4388 +- bitrate *= (modulation + 3);
4389 +-
4390 +- bitrate *= streams;
4391 +-
4392 +- if (rate->flags & RATE_INFO_FLAGS_SHORT_GI)
4393 +- bitrate = (bitrate / 9) * 10;
4394 +-
4395 +- /* do NOT round down here */
4396 +- return (bitrate + 50000) / 100000;
4397 +-}
4398 +-
4399 + static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
4400 + int flags, struct net_device *dev,
4401 + u8 *mac_addr, struct station_info *sinfo)
4402 +@@ -1641,8 +1608,8 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
4403 + if (!txrate)
4404 + goto nla_put_failure;
4405 +
4406 +- /* nl80211_calculate_bitrate will return 0 for mcs >= 32 */
4407 +- bitrate = nl80211_calculate_bitrate(&sinfo->txrate);
4408 ++ /* cfg80211_calculate_bitrate will return 0 for mcs >= 32 */
4409 ++ bitrate = cfg80211_calculate_bitrate(&sinfo->txrate);
4410 + if (bitrate > 0)
4411 + NLA_PUT_U16(msg, NL80211_RATE_INFO_BITRATE, bitrate);
4412 +
4413 +diff --git a/net/wireless/util.c b/net/wireless/util.c
4414 +index 3fc2df8..a6a38b1 100644
4415 +--- a/net/wireless/util.c
4416 ++++ b/net/wireless/util.c
4417 +@@ -682,3 +682,36 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
4418 +
4419 + return err;
4420 + }
4421 ++
4422 ++u16 cfg80211_calculate_bitrate(struct rate_info *rate)
4423 ++{
4424 ++ int modulation, streams, bitrate;
4425 ++
4426 ++ if (!(rate->flags & RATE_INFO_FLAGS_MCS))
4427 ++ return rate->legacy;
4428 ++
4429 ++ /* the formula below does only work for MCS values smaller than 32 */
4430 ++ if (rate->mcs >= 32)
4431 ++ return 0;
4432 ++
4433 ++ modulation = rate->mcs & 7;
4434 ++ streams = (rate->mcs >> 3) + 1;
4435 ++
4436 ++ bitrate = (rate->flags & RATE_INFO_FLAGS_40_MHZ_WIDTH) ?
4437 ++ 13500000 : 6500000;
4438 ++
4439 ++ if (modulation < 4)
4440 ++ bitrate *= (modulation + 1);
4441 ++ else if (modulation == 4)
4442 ++ bitrate *= (modulation + 2);
4443 ++ else
4444 ++ bitrate *= (modulation + 3);
4445 ++
4446 ++ bitrate *= streams;
4447 ++
4448 ++ if (rate->flags & RATE_INFO_FLAGS_SHORT_GI)
4449 ++ bitrate = (bitrate / 9) * 10;
4450 ++
4451 ++ /* do NOT round down here */
4452 ++ return (bitrate + 50000) / 100000;
4453 ++}
4454 +diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
4455 +index 561a45c..6a60c5a 100644
4456 +--- a/net/wireless/wext-compat.c
4457 ++++ b/net/wireless/wext-compat.c
4458 +@@ -1227,10 +1227,7 @@ int cfg80211_wext_giwrate(struct net_device *dev,
4459 + if (!(sinfo.filled & STATION_INFO_TX_BITRATE))
4460 + return -EOPNOTSUPP;
4461 +
4462 +- rate->value = 0;
4463 +-
4464 +- if (!(sinfo.txrate.flags & RATE_INFO_FLAGS_MCS))
4465 +- rate->value = 100000 * sinfo.txrate.legacy;
4466 ++ rate->value = 100000 * cfg80211_calculate_bitrate(&sinfo.txrate);
4467 +
4468 + return 0;
4469 + }
4470 +diff --git a/security/keys/keyring.c b/security/keys/keyring.c
4471 +index 8ec0274..e031952 100644
4472 +--- a/security/keys/keyring.c
4473 ++++ b/security/keys/keyring.c
4474 +@@ -524,9 +524,8 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check)
4475 + struct key *keyring;
4476 + int bucket;
4477 +
4478 +- keyring = ERR_PTR(-EINVAL);
4479 + if (!name)
4480 +- goto error;
4481 ++ return ERR_PTR(-EINVAL);
4482 +
4483 + bucket = keyring_hash(name);
4484 +
4485 +@@ -553,17 +552,18 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check)
4486 + KEY_SEARCH) < 0)
4487 + continue;
4488 +
4489 +- /* we've got a match */
4490 +- atomic_inc(&keyring->usage);
4491 +- read_unlock(&keyring_name_lock);
4492 +- goto error;
4493 ++ /* we've got a match but we might end up racing with
4494 ++ * key_cleanup() if the keyring is currently 'dead'
4495 ++ * (ie. it has a zero usage count) */
4496 ++ if (!atomic_inc_not_zero(&keyring->usage))
4497 ++ continue;
4498 ++ goto out;
4499 + }
4500 + }
4501 +
4502 +- read_unlock(&keyring_name_lock);
4503 + keyring = ERR_PTR(-ENOKEY);
4504 +-
4505 +- error:
4506 ++out:
4507 ++ read_unlock(&keyring_name_lock);
4508 + return keyring;
4509 +
4510 + } /* end find_keyring_by_name() */
4511 +diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
4512 +index 5c23afb..931cfda 100644
4513 +--- a/security/keys/process_keys.c
4514 ++++ b/security/keys/process_keys.c
4515 +@@ -509,7 +509,7 @@ try_again:
4516 +
4517 + ret = install_thread_keyring();
4518 + if (ret < 0) {
4519 +- key = ERR_PTR(ret);
4520 ++ key_ref = ERR_PTR(ret);
4521 + goto error;
4522 + }
4523 + goto reget_creds;
4524 +@@ -527,7 +527,7 @@ try_again:
4525 +
4526 + ret = install_process_keyring();
4527 + if (ret < 0) {
4528 +- key = ERR_PTR(ret);
4529 ++ key_ref = ERR_PTR(ret);
4530 + goto error;
4531 + }
4532 + goto reget_creds;
4533 +@@ -586,7 +586,7 @@ try_again:
4534 +
4535 + case KEY_SPEC_GROUP_KEYRING:
4536 + /* group keyrings are not yet supported */
4537 +- key = ERR_PTR(-EINVAL);
4538 ++ key_ref = ERR_PTR(-EINVAL);
4539 + goto error;
4540 +
4541 + case KEY_SPEC_REQKEY_AUTH_KEY:
4542 +diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
4543 +index ebba28e..cc2a5a2 100644
4544 +--- a/sound/pci/hda/hda_intel.c
4545 ++++ b/sound/pci/hda/hda_intel.c
4546 +@@ -2226,16 +2226,23 @@ static int azx_dev_free(struct snd_device *device)
4547 + * white/black-listing for position_fix
4548 + */
4549 + static struct snd_pci_quirk position_fix_list[] __devinitdata = {
4550 ++ SND_PCI_QUIRK(0x1025, 0x009f, "Acer Aspire 5110", POS_FIX_LPIB),
4551 + SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB),
4552 + SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB),
4553 + SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB),
4554 +- SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),
4555 +- SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
4556 + SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB),
4557 ++ SND_PCI_QUIRK(0x1043, 0x813d, "ASUS P5AD2", POS_FIX_LPIB),
4558 ++ SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS", POS_FIX_LPIB),
4559 ++ SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS M2V", POS_FIX_LPIB),
4560 ++ SND_PCI_QUIRK(0x104d, 0x9069, "Sony VPCS11V9E", POS_FIX_LPIB),
4561 ++ SND_PCI_QUIRK(0x1106, 0x3288, "ASUS M2V-MX SE", POS_FIX_LPIB),
4562 ++ SND_PCI_QUIRK(0x1179, 0xff10, "Toshiba A100-259", POS_FIX_LPIB),
4563 ++ SND_PCI_QUIRK(0x1297, 0x3166, "Shuttle", POS_FIX_LPIB),
4564 + SND_PCI_QUIRK(0x1458, 0xa022, "ga-ma770-ud3", POS_FIX_LPIB),
4565 + SND_PCI_QUIRK(0x1462, 0x1002, "MSI Wind U115", POS_FIX_LPIB),
4566 + SND_PCI_QUIRK(0x1565, 0x820f, "Biostar Microtech", POS_FIX_LPIB),
4567 + SND_PCI_QUIRK(0x1565, 0x8218, "Biostar Microtech", POS_FIX_LPIB),
4568 ++ SND_PCI_QUIRK(0x1849, 0x0888, "775Dual-VSTA", POS_FIX_LPIB),
4569 + SND_PCI_QUIRK(0x8086, 0x2503, "DG965OT AAD63733-203", POS_FIX_LPIB),
4570 + SND_PCI_QUIRK(0x8086, 0xd601, "eMachines T5212", POS_FIX_LPIB),
4571 + {}
4572 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
4573 +index a9bdccc..82a53d9 100644
4574 +--- a/sound/pci/hda/patch_realtek.c
4575 ++++ b/sound/pci/hda/patch_realtek.c
4576 +@@ -8937,6 +8937,7 @@ static struct snd_pci_quirk alc882_ssid_cfg_tbl[] = {
4577 + SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_IMAC24),
4578 + SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_IMAC24),
4579 + SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC885_MBP3),
4580 ++ SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889A_MB31),
4581 + SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889A_MB31),
4582 + SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC885_MBP3),
4583 + SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_IMAC24),
4584 +diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
4585 +index a519a72..fee411b 100644
4586 +--- a/sound/pci/hda/patch_sigmatel.c
4587 ++++ b/sound/pci/hda/patch_sigmatel.c
4588 +@@ -2059,12 +2059,12 @@ static struct snd_pci_quirk stac927x_cfg_tbl[] = {
4589 + SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_INTEL, 0xff00, 0x2000,
4590 + "Intel D965", STAC_D965_3ST),
4591 + /* Dell 3 stack systems */
4592 +- SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f7, "Dell XPS M1730", STAC_DELL_3ST),
4593 + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01dd, "Dell Dimension E520", STAC_DELL_3ST),
4594 + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01ed, "Dell ", STAC_DELL_3ST),
4595 + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f4, "Dell ", STAC_DELL_3ST),
4596 + /* Dell 3 stack systems with verb table in BIOS */
4597 + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f3, "Dell Inspiron 1420", STAC_DELL_BIOS),
4598 ++ SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x01f7, "Dell XPS M1730", STAC_DELL_BIOS),
4599 + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0227, "Dell Vostro 1400 ", STAC_DELL_BIOS),
4600 + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022e, "Dell ", STAC_DELL_BIOS),
4601 + SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x022f, "Dell Inspiron 1525", STAC_DELL_BIOS),
4602 +diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
4603 +index 2089fe7..9f9bcd8 100644
4604 +--- a/sound/soc/codecs/wm8350.c
4605 ++++ b/sound/soc/codecs/wm8350.c
4606 +@@ -423,8 +423,8 @@ static const struct soc_enum wm8350_enum[] = {
4607 + SOC_ENUM_SINGLE(WM8350_INPUT_MIXER_VOLUME, 15, 2, wm8350_lr),
4608 + };
4609 +
4610 +-static DECLARE_TLV_DB_LINEAR(pre_amp_tlv, -1200, 3525);
4611 +-static DECLARE_TLV_DB_LINEAR(out_pga_tlv, -5700, 600);
4612 ++static DECLARE_TLV_DB_SCALE(pre_amp_tlv, -1200, 3525, 0);
4613 ++static DECLARE_TLV_DB_SCALE(out_pga_tlv, -5700, 600, 0);
4614 + static DECLARE_TLV_DB_SCALE(dac_pcm_tlv, -7163, 36, 1);
4615 + static DECLARE_TLV_DB_SCALE(adc_pcm_tlv, -12700, 50, 1);
4616 + static DECLARE_TLV_DB_SCALE(out_mix_tlv, -1500, 300, 1);
4617 +diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
4618 +index b9ef4d9..775195b 100644
4619 +--- a/sound/soc/codecs/wm8400.c
4620 ++++ b/sound/soc/codecs/wm8400.c
4621 +@@ -106,21 +106,21 @@ static void wm8400_codec_reset(struct snd_soc_codec *codec)
4622 + wm8400_reset_codec_reg_cache(wm8400->wm8400);
4623 + }
4624 +
4625 +-static const DECLARE_TLV_DB_LINEAR(rec_mix_tlv, -1500, 600);
4626 ++static const DECLARE_TLV_DB_SCALE(rec_mix_tlv, -1500, 600, 0);
4627 +
4628 +-static const DECLARE_TLV_DB_LINEAR(in_pga_tlv, -1650, 3000);
4629 ++static const DECLARE_TLV_DB_SCALE(in_pga_tlv, -1650, 3000, 0);
4630 +
4631 +-static const DECLARE_TLV_DB_LINEAR(out_mix_tlv, -2100, 0);
4632 ++static const DECLARE_TLV_DB_SCALE(out_mix_tlv, -2100, 0, 0);
4633 +
4634 +-static const DECLARE_TLV_DB_LINEAR(out_pga_tlv, -7300, 600);
4635 ++static const DECLARE_TLV_DB_SCALE(out_pga_tlv, -7300, 600, 0);
4636 +
4637 +-static const DECLARE_TLV_DB_LINEAR(out_omix_tlv, -600, 0);
4638 ++static const DECLARE_TLV_DB_SCALE(out_omix_tlv, -600, 0, 0);
4639 +
4640 +-static const DECLARE_TLV_DB_LINEAR(out_dac_tlv, -7163, 0);
4641 ++static const DECLARE_TLV_DB_SCALE(out_dac_tlv, -7163, 0, 0);
4642 +
4643 +-static const DECLARE_TLV_DB_LINEAR(in_adc_tlv, -7163, 1763);
4644 ++static const DECLARE_TLV_DB_SCALE(in_adc_tlv, -7163, 1763, 0);
4645 +
4646 +-static const DECLARE_TLV_DB_LINEAR(out_sidetone_tlv, -3600, 0);
4647 ++static const DECLARE_TLV_DB_SCALE(out_sidetone_tlv, -3600, 0, 0);
4648 +
4649 + static int wm8400_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
4650 + struct snd_ctl_elem_value *ucontrol)
4651 +@@ -439,7 +439,7 @@ static int outmixer_event (struct snd_soc_dapm_widget *w,
4652 + /* INMIX dB values */
4653 + static const unsigned int in_mix_tlv[] = {
4654 + TLV_DB_RANGE_HEAD(1),
4655 +- 0,7, TLV_DB_LINEAR_ITEM(-1200, 600),
4656 ++ 0,7, TLV_DB_SCALE_ITEM(-1200, 600, 0),
4657 + };
4658 +
4659 + /* Left In PGA Connections */
4660 +diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
4661 +index 2d702db..253159c 100644
4662 +--- a/sound/soc/codecs/wm8990.c
4663 ++++ b/sound/soc/codecs/wm8990.c
4664 +@@ -110,21 +110,21 @@ static const u16 wm8990_reg[] = {
4665 +
4666 + #define wm8990_reset(c) snd_soc_write(c, WM8990_RESET, 0)
4667 +
4668 +-static const DECLARE_TLV_DB_LINEAR(rec_mix_tlv, -1500, 600);
4669 ++static const DECLARE_TLV_DB_SCALE(rec_mix_tlv, -1500, 600, 0);
4670 +
4671 +-static const DECLARE_TLV_DB_LINEAR(in_pga_tlv, -1650, 3000);
4672 ++static const DECLARE_TLV_DB_SCALE(in_pga_tlv, -1650, 3000, 0);
4673 +
4674 +-static const DECLARE_TLV_DB_LINEAR(out_mix_tlv, 0, -2100);
4675 ++static const DECLARE_TLV_DB_SCALE(out_mix_tlv, 0, -2100, 0);
4676 +
4677 +-static const DECLARE_TLV_DB_LINEAR(out_pga_tlv, -7300, 600);
4678 ++static const DECLARE_TLV_DB_SCALE(out_pga_tlv, -7300, 600, 0);
4679 +
4680 +-static const DECLARE_TLV_DB_LINEAR(out_omix_tlv, -600, 0);
4681 ++static const DECLARE_TLV_DB_SCALE(out_omix_tlv, -600, 0, 0);
4682 +
4683 +-static const DECLARE_TLV_DB_LINEAR(out_dac_tlv, -7163, 0);
4684 ++static const DECLARE_TLV_DB_SCALE(out_dac_tlv, -7163, 0, 0);
4685 +
4686 +-static const DECLARE_TLV_DB_LINEAR(in_adc_tlv, -7163, 1763);
4687 ++static const DECLARE_TLV_DB_SCALE(in_adc_tlv, -7163, 1763, 0);
4688 +
4689 +-static const DECLARE_TLV_DB_LINEAR(out_sidetone_tlv, -3600, 0);
4690 ++static const DECLARE_TLV_DB_SCALE(out_sidetone_tlv, -3600, 0, 0);
4691 +
4692 + static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
4693 + struct snd_ctl_elem_value *ucontrol)
4694 +@@ -450,7 +450,7 @@ static int outmixer_event(struct snd_soc_dapm_widget *w,
4695 + /* INMIX dB values */
4696 + static const unsigned int in_mix_tlv[] = {
4697 + TLV_DB_RANGE_HEAD(1),
4698 +- 0, 7, TLV_DB_LINEAR_ITEM(-1200, 600),
4699 ++ 0, 7, TLV_DB_SCALE_ITEM(-1200, 600, 0),
4700 + };
4701 +
4702 + /* Left In PGA Connections */