Gentoo Archives: gentoo-commits

From: "Daniel Drake (dsd)" <dsd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1296 - genpatches-2.6/trunk/2.6.24
Date: Sat, 19 Apr 2008 09:58:44
Message-Id: E1Jn9pz-0005vH-O2@stork.gentoo.org
1 Author: dsd
2 Date: 2008-04-19 09:58:26 +0000 (Sat, 19 Apr 2008)
3 New Revision: 1296
4
5 Added:
6 genpatches-2.6/trunk/2.6.24/1003_linux-2.6.24.4.patch
7 genpatches-2.6/trunk/2.6.24/1004_linux-2.6.24.5.patch
8 Removed:
9 genpatches-2.6/trunk/2.6.24/1003-linux-2.6.24.4.patch
10 genpatches-2.6/trunk/2.6.24/1400_prevent-gcc43-optimization-udivdi3.patch
11 genpatches-2.6/trunk/2.6.24/1700-futex_cmpxchg_inatomic_impl_check.patch
12 genpatches-2.6/trunk/2.6.24/2103_ata-assume-no-device-attached.patch
13 genpatches-2.6/trunk/2.6.24/2200_ppc32-apm-export-fix.patch
14 genpatches-2.6/trunk/2.6.24/2305_bluetooth-suspend-oops.patch
15 genpatches-2.6/trunk/2.6.24/2405_sis190-eeprom-mac.patch
16 genpatches-2.6/trunk/2.6.24/2505_usb-storage-motorola-rokr.patch
17 Modified:
18 genpatches-2.6/trunk/2.6.24/0000_README
19 Log:
20 Linux 2.6.24.5
21
22 Modified: genpatches-2.6/trunk/2.6.24/0000_README
23 ===================================================================
24 --- genpatches-2.6/trunk/2.6.24/0000_README 2008-04-18 19:34:38 UTC (rev 1295)
25 +++ genpatches-2.6/trunk/2.6.24/0000_README 2008-04-19 09:58:26 UTC (rev 1296)
26 @@ -55,14 +55,10 @@
27 From: http://www.kernel.org
28 Desc: Linux 2.6.24.4
29
30 -Patch: 1400_prevent-gcc43-optimization-udivdi3.patch
31 -From: http://bugs.gentoo.org/show_bug.cgi?id=214654
32 -Desc: Prevent gcc udivdi3 optimizations due to some unsupported archs.
33 +Patch: 1004_linux-2.6.24.5.patch
34 +From: http://www.kernel.org
35 +Desc: Linux 2.6.24.5
36
37 -Patch: 1700_futex-cmpxchg-inatomic-impl-check.patch
38 -From: http://bugs.gentoo.org/show_bug.cgi?id=217030
39 -Desc: Detect whether futex_atomic_cmpxchg_inatomic was implemented at run time
40 -
41 Patch: 2100_sd-sr-medium-detection.patch
42 From: http://bugs.gentoo.org/196879
43 Desc: Add early medium-not-present detection in sr/sd drivers
44 @@ -75,30 +71,10 @@
45 From: http://bugs.gentoo.org/196879
46 Desc: Fix TEST_UNIT_READY for medium detection
47
48 -Patch: 2103_ata-assume-no-device-attached.patch
49 -From: http://bugs.gentoo.org/211369
50 -Desc: Fix for device attached to pata_sis as secondary master
51 -
52 -Patch: 2200_ppc32-apm-export-fix.patch
53 -From: http://bugs.gentoo.org/217629
54 -Desc: Fix build of modular drivers/macintosh/apm_emu.c
55 -
56 -Patch: 2305_bluetooth-suspend-oops.patch
57 -From: http://bugs.gentoo.org/211179
58 -Desc: Fix bluetooth rfcomm crash on suspend
59 -
60 Patch: 2400_ipw2200-radiotap-addr.patch
61 From: http://bugs.gentoo.org/215714
62 Desc: Fix IPW2200 radiotap interface
63
64 -Patch: 2405_sis190-eeprom-mac.patch
65 -From: http://bugs.gentoo.org/207706
66 -Desc: Fix reading of MAC address in sis190 driver
67 -
68 -Patch: 2505_usb-storage-motorola-rokr.patch
69 -From: http://bugs.gentoo.org/212729
70 -Desc: Fix usb-storage access to Motorola ROKR phone
71 -
72 Patch: 2510_ricoh-handle-susp-resum-disab.patch
73 From: http://bugs.gentoo.org/185581
74 Desc: Handle suspend/resume in Ricoh MMC disabler
75
76 Deleted: genpatches-2.6/trunk/2.6.24/1003-linux-2.6.24.4.patch
77 ===================================================================
78 --- genpatches-2.6/trunk/2.6.24/1003-linux-2.6.24.4.patch 2008-04-18 19:34:38 UTC (rev 1295)
79 +++ genpatches-2.6/trunk/2.6.24/1003-linux-2.6.24.4.patch 2008-04-19 09:58:26 UTC (rev 1296)
80 @@ -1,3643 +0,0 @@
81 -diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
82 -index 83ef5ec..df5ae27 100644
83 ---- a/arch/arm/mach-pxa/clock.c
84 -+++ b/arch/arm/mach-pxa/clock.c
85 -@@ -23,18 +23,27 @@ static LIST_HEAD(clocks);
86 - static DEFINE_MUTEX(clocks_mutex);
87 - static DEFINE_SPINLOCK(clocks_lock);
88 -
89 -+static struct clk *clk_lookup(struct device *dev, const char *id)
90 -+{
91 -+ struct clk *p;
92 -+
93 -+ list_for_each_entry(p, &clocks, node)
94 -+ if (strcmp(id, p->name) == 0 && p->dev == dev)
95 -+ return p;
96 -+
97 -+ return NULL;
98 -+}
99 -+
100 - struct clk *clk_get(struct device *dev, const char *id)
101 - {
102 - struct clk *p, *clk = ERR_PTR(-ENOENT);
103 -
104 - mutex_lock(&clocks_mutex);
105 -- list_for_each_entry(p, &clocks, node) {
106 -- if (strcmp(id, p->name) == 0 &&
107 -- (p->dev == NULL || p->dev == dev)) {
108 -- clk = p;
109 -- break;
110 -- }
111 -- }
112 -+ p = clk_lookup(dev, id);
113 -+ if (!p)
114 -+ p = clk_lookup(NULL, id);
115 -+ if (p)
116 -+ clk = p;
117 - mutex_unlock(&clocks_mutex);
118 -
119 - return clk;
120 -diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
121 -index 4710135..9158dd8 100644
122 ---- a/arch/mips/kernel/i8259.c
123 -+++ b/arch/mips/kernel/i8259.c
124 -@@ -338,8 +338,10 @@ void __init init_i8259_irqs(void)
125 -
126 - init_8259A(0);
127 -
128 -- for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++)
129 -+ for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++) {
130 - set_irq_chip_and_handler(i, &i8259A_chip, handle_level_irq);
131 -+ set_irq_probe(i);
132 -+ }
133 -
134 - setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2);
135 - }
136 -diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
137 -index d06e9c9..e3309ff 100644
138 ---- a/arch/mips/kernel/irq.c
139 -+++ b/arch/mips/kernel/irq.c
140 -@@ -145,6 +145,11 @@ __setup("nokgdb", nokgdb);
141 -
142 - void __init init_IRQ(void)
143 - {
144 -+ int i;
145 -+
146 -+ for (i = 0; i < NR_IRQS; i++)
147 -+ set_irq_noprobe(i);
148 -+
149 - arch_init_irq();
150 -
151 - #ifdef CONFIG_KGDB
152 -diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
153 -index 7e8efaa..5efdfe9 100644
154 ---- a/arch/s390/lib/uaccess_pt.c
155 -+++ b/arch/s390/lib/uaccess_pt.c
156 -@@ -406,6 +406,8 @@ int futex_atomic_cmpxchg_pt(int __user *uaddr, int oldval, int newval)
157 - {
158 - int ret;
159 -
160 -+ if (!current->mm)
161 -+ return -EFAULT;
162 - spin_lock(&current->mm->page_table_lock);
163 - uaddr = (int __user *) __dat_user_addr((unsigned long) uaddr);
164 - if (!uaddr) {
165 -diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
166 -index e795f28..bf1b15d 100644
167 ---- a/arch/sparc/kernel/Makefile
168 -+++ b/arch/sparc/kernel/Makefile
169 -@@ -1,4 +1,4 @@
170 --# $Id: Makefile,v 1.62 2000/12/15 00:41:17 davem Exp $
171 -+#
172 - # Makefile for the linux kernel.
173 - #
174 -
175 -@@ -12,7 +12,8 @@ obj-y := entry.o wof.o wuf.o etrap.o rtrap.o traps.o $(IRQ_OBJS) \
176 - sys_sparc.o sunos_asm.o systbls.o \
177 - time.o windows.o cpu.o devices.o sclow.o \
178 - tadpole.o tick14.o ptrace.o sys_solaris.o \
179 -- unaligned.o muldiv.o semaphore.o prom.o of_device.o devres.o
180 -+ unaligned.o una_asm.o muldiv.o semaphore.o \
181 -+ prom.o of_device.o devres.o
182 -
183 - devres-y = ../../../kernel/irq/devres.o
184 -
185 -diff --git a/arch/sparc/kernel/una_asm.S b/arch/sparc/kernel/una_asm.S
186 -new file mode 100644
187 -index 0000000..8cc0345
188 ---- /dev/null
189 -+++ b/arch/sparc/kernel/una_asm.S
190 -@@ -0,0 +1,153 @@
191 -+/* una_asm.S: Kernel unaligned trap assembler helpers.
192 -+ *
193 -+ * Copyright (C) 1996,2005,2008 David S. Miller (davem@×××××××××.net)
194 -+ * Copyright (C) 1996,1997 Jakub Jelinek (jj@××××××××××××××××.cz)
195 -+ */
196 -+
197 -+#include <linux/errno.h>
198 -+
199 -+ .text
200 -+
201 -+retl_efault:
202 -+ retl
203 -+ mov -EFAULT, %o0
204 -+
205 -+ /* int __do_int_store(unsigned long *dst_addr, int size,
206 -+ * unsigned long *src_val)
207 -+ *
208 -+ * %o0 = dest_addr
209 -+ * %o1 = size
210 -+ * %o2 = src_val
211 -+ *
212 -+ * Return '0' on success, -EFAULT on failure.
213 -+ */
214 -+ .globl __do_int_store
215 -+__do_int_store:
216 -+ ld [%o2], %g1
217 -+ cmp %1, 2
218 -+ be 2f
219 -+ cmp %1, 4
220 -+ be 1f
221 -+ srl %g1, 24, %g2
222 -+ srl %g1, 16, %g7
223 -+4: stb %g2, [%o0]
224 -+ srl %g1, 8, %g2
225 -+5: stb %g7, [%o0 + 1]
226 -+ ld [%o2 + 4], %g7
227 -+6: stb %g2, [%o0 + 2]
228 -+ srl %g7, 24, %g2
229 -+7: stb %g1, [%o0 + 3]
230 -+ srl %g7, 16, %g1
231 -+8: stb %g2, [%o0 + 4]
232 -+ srl %g7, 8, %g2
233 -+9: stb %g1, [%o0 + 5]
234 -+10: stb %g2, [%o0 + 6]
235 -+ b 0f
236 -+11: stb %g7, [%o0 + 7]
237 -+1: srl %g1, 16, %g7
238 -+12: stb %g2, [%o0]
239 -+ srl %g1, 8, %g2
240 -+13: stb %g7, [%o0 + 1]
241 -+14: stb %g2, [%o0 + 2]
242 -+ b 0f
243 -+15: stb %g1, [%o0 + 3]
244 -+2: srl %g1, 8, %g2
245 -+16: stb %g2, [%o0]
246 -+17: stb %g1, [%o0 + 1]
247 -+0: retl
248 -+ mov 0, %o0
249 -+
250 -+ .section __ex_table,#alloc
251 -+ .word 4b, retl_efault
252 -+ .word 5b, retl_efault
253 -+ .word 6b, retl_efault
254 -+ .word 7b, retl_efault
255 -+ .word 8b, retl_efault
256 -+ .word 9b, retl_efault
257 -+ .word 10b, retl_efault
258 -+ .word 11b, retl_efault
259 -+ .word 12b, retl_efault
260 -+ .word 13b, retl_efault
261 -+ .word 14b, retl_efault
262 -+ .word 15b, retl_efault
263 -+ .word 16b, retl_efault
264 -+ .word 17b, retl_efault
265 -+ .previous
266 -+
267 -+ /* int do_int_load(unsigned long *dest_reg, int size,
268 -+ * unsigned long *saddr, int is_signed)
269 -+ *
270 -+ * %o0 = dest_reg
271 -+ * %o1 = size
272 -+ * %o2 = saddr
273 -+ * %o3 = is_signed
274 -+ *
275 -+ * Return '0' on success, -EFAULT on failure.
276 -+ */
277 -+ .globl do_int_load
278 -+do_int_load:
279 -+ cmp %o1, 8
280 -+ be 9f
281 -+ cmp %o1, 4
282 -+ be 6f
283 -+4: ldub [%o2], %g1
284 -+5: ldub [%o2 + 1], %g2
285 -+ sll %g1, 8, %g1
286 -+ tst %o3
287 -+ be 3f
288 -+ or %g1, %g2, %g1
289 -+ sll %g1, 16, %g1
290 -+ sra %g1, 16, %g1
291 -+3: b 0f
292 -+ st %g1, [%o0]
293 -+6: ldub [%o2 + 1], %g2
294 -+ sll %g1, 24, %g1
295 -+7: ldub [%o2 + 2], %g7
296 -+ sll %g2, 16, %g2
297 -+8: ldub [%o2 + 3], %g3
298 -+ sll %g7, 8, %g7
299 -+ or %g3, %g2, %g3
300 -+ or %g7, %g3, %g7
301 -+ or %g1, %g7, %g1
302 -+ b 0f
303 -+ st %g1, [%o0]
304 -+9: ldub [%o2], %g1
305 -+10: ldub [%o2 + 1], %g2
306 -+ sll %g1, 24, %g1
307 -+11: ldub [%o2 + 2], %g7
308 -+ sll %g2, 16, %g2
309 -+12: ldub [%o2 + 3], %g3
310 -+ sll %g7, 8, %g7
311 -+ or %g1, %g2, %g1
312 -+ or %g7, %g3, %g7
313 -+ or %g1, %g7, %g7
314 -+13: ldub [%o2 + 4], %g1
315 -+ st %g7, [%o0]
316 -+14: ldub [%o2 + 5], %g2
317 -+ sll %g1, 24, %g1
318 -+15: ldub [%o2 + 6], %g7
319 -+ sll %g2, 16, %g2
320 -+16: ldub [%o2 + 7], %g3
321 -+ sll %g7, 8, %g7
322 -+ or %g1, %g2, %g1
323 -+ or %g7, %g3, %g7
324 -+ or %g1, %g7, %g7
325 -+ st %g7, [%o0 + 4]
326 -+0: retl
327 -+ mov 0, %o0
328 -+
329 -+ .section __ex_table,#alloc
330 -+ .word 4b, retl_efault
331 -+ .word 5b, retl_efault
332 -+ .word 6b, retl_efault
333 -+ .word 7b, retl_efault
334 -+ .word 8b, retl_efault
335 -+ .word 9b, retl_efault
336 -+ .word 10b, retl_efault
337 -+ .word 11b, retl_efault
338 -+ .word 12b, retl_efault
339 -+ .word 13b, retl_efault
340 -+ .word 14b, retl_efault
341 -+ .word 15b, retl_efault
342 -+ .word 16b, retl_efault
343 -+ .previous
344 -diff --git a/arch/sparc/kernel/unaligned.c b/arch/sparc/kernel/unaligned.c
345 -index a6330fb..33857be 100644
346 ---- a/arch/sparc/kernel/unaligned.c
347 -+++ b/arch/sparc/kernel/unaligned.c
348 -@@ -175,157 +175,31 @@ static void unaligned_panic(char *str)
349 - panic(str);
350 - }
351 -
352 --#define do_integer_load(dest_reg, size, saddr, is_signed, errh) ({ \
353 --__asm__ __volatile__ ( \
354 -- "cmp %1, 8\n\t" \
355 -- "be 9f\n\t" \
356 -- " cmp %1, 4\n\t" \
357 -- "be 6f\n" \
358 --"4:\t" " ldub [%2], %%l1\n" \
359 --"5:\t" "ldub [%2 + 1], %%l2\n\t" \
360 -- "sll %%l1, 8, %%l1\n\t" \
361 -- "tst %3\n\t" \
362 -- "be 3f\n\t" \
363 -- " add %%l1, %%l2, %%l1\n\t" \
364 -- "sll %%l1, 16, %%l1\n\t" \
365 -- "sra %%l1, 16, %%l1\n" \
366 --"3:\t" "b 0f\n\t" \
367 -- " st %%l1, [%0]\n" \
368 --"6:\t" "ldub [%2 + 1], %%l2\n\t" \
369 -- "sll %%l1, 24, %%l1\n" \
370 --"7:\t" "ldub [%2 + 2], %%g7\n\t" \
371 -- "sll %%l2, 16, %%l2\n" \
372 --"8:\t" "ldub [%2 + 3], %%g1\n\t" \
373 -- "sll %%g7, 8, %%g7\n\t" \
374 -- "or %%l1, %%l2, %%l1\n\t" \
375 -- "or %%g7, %%g1, %%g7\n\t" \
376 -- "or %%l1, %%g7, %%l1\n\t" \
377 -- "b 0f\n\t" \
378 -- " st %%l1, [%0]\n" \
379 --"9:\t" "ldub [%2], %%l1\n" \
380 --"10:\t" "ldub [%2 + 1], %%l2\n\t" \
381 -- "sll %%l1, 24, %%l1\n" \
382 --"11:\t" "ldub [%2 + 2], %%g7\n\t" \
383 -- "sll %%l2, 16, %%l2\n" \
384 --"12:\t" "ldub [%2 + 3], %%g1\n\t" \
385 -- "sll %%g7, 8, %%g7\n\t" \
386 -- "or %%l1, %%l2, %%l1\n\t" \
387 -- "or %%g7, %%g1, %%g7\n\t" \
388 -- "or %%l1, %%g7, %%g7\n" \
389 --"13:\t" "ldub [%2 + 4], %%l1\n\t" \
390 -- "st %%g7, [%0]\n" \
391 --"14:\t" "ldub [%2 + 5], %%l2\n\t" \
392 -- "sll %%l1, 24, %%l1\n" \
393 --"15:\t" "ldub [%2 + 6], %%g7\n\t" \
394 -- "sll %%l2, 16, %%l2\n" \
395 --"16:\t" "ldub [%2 + 7], %%g1\n\t" \
396 -- "sll %%g7, 8, %%g7\n\t" \
397 -- "or %%l1, %%l2, %%l1\n\t" \
398 -- "or %%g7, %%g1, %%g7\n\t" \
399 -- "or %%l1, %%g7, %%g7\n\t" \
400 -- "st %%g7, [%0 + 4]\n" \
401 --"0:\n\n\t" \
402 -- ".section __ex_table,#alloc\n\t" \
403 -- ".word 4b, " #errh "\n\t" \
404 -- ".word 5b, " #errh "\n\t" \
405 -- ".word 6b, " #errh "\n\t" \
406 -- ".word 7b, " #errh "\n\t" \
407 -- ".word 8b, " #errh "\n\t" \
408 -- ".word 9b, " #errh "\n\t" \
409 -- ".word 10b, " #errh "\n\t" \
410 -- ".word 11b, " #errh "\n\t" \
411 -- ".word 12b, " #errh "\n\t" \
412 -- ".word 13b, " #errh "\n\t" \
413 -- ".word 14b, " #errh "\n\t" \
414 -- ".word 15b, " #errh "\n\t" \
415 -- ".word 16b, " #errh "\n\n\t" \
416 -- ".previous\n\t" \
417 -- : : "r" (dest_reg), "r" (size), "r" (saddr), "r" (is_signed) \
418 -- : "l1", "l2", "g7", "g1", "cc"); \
419 --})
420 --
421 --#define store_common(dst_addr, size, src_val, errh) ({ \
422 --__asm__ __volatile__ ( \
423 -- "ld [%2], %%l1\n" \
424 -- "cmp %1, 2\n\t" \
425 -- "be 2f\n\t" \
426 -- " cmp %1, 4\n\t" \
427 -- "be 1f\n\t" \
428 -- " srl %%l1, 24, %%l2\n\t" \
429 -- "srl %%l1, 16, %%g7\n" \
430 --"4:\t" "stb %%l2, [%0]\n\t" \
431 -- "srl %%l1, 8, %%l2\n" \
432 --"5:\t" "stb %%g7, [%0 + 1]\n\t" \
433 -- "ld [%2 + 4], %%g7\n" \
434 --"6:\t" "stb %%l2, [%0 + 2]\n\t" \
435 -- "srl %%g7, 24, %%l2\n" \
436 --"7:\t" "stb %%l1, [%0 + 3]\n\t" \
437 -- "srl %%g7, 16, %%l1\n" \
438 --"8:\t" "stb %%l2, [%0 + 4]\n\t" \
439 -- "srl %%g7, 8, %%l2\n" \
440 --"9:\t" "stb %%l1, [%0 + 5]\n" \
441 --"10:\t" "stb %%l2, [%0 + 6]\n\t" \
442 -- "b 0f\n" \
443 --"11:\t" " stb %%g7, [%0 + 7]\n" \
444 --"1:\t" "srl %%l1, 16, %%g7\n" \
445 --"12:\t" "stb %%l2, [%0]\n\t" \
446 -- "srl %%l1, 8, %%l2\n" \
447 --"13:\t" "stb %%g7, [%0 + 1]\n" \
448 --"14:\t" "stb %%l2, [%0 + 2]\n\t" \
449 -- "b 0f\n" \
450 --"15:\t" " stb %%l1, [%0 + 3]\n" \
451 --"2:\t" "srl %%l1, 8, %%l2\n" \
452 --"16:\t" "stb %%l2, [%0]\n" \
453 --"17:\t" "stb %%l1, [%0 + 1]\n" \
454 --"0:\n\n\t" \
455 -- ".section __ex_table,#alloc\n\t" \
456 -- ".word 4b, " #errh "\n\t" \
457 -- ".word 5b, " #errh "\n\t" \
458 -- ".word 6b, " #errh "\n\t" \
459 -- ".word 7b, " #errh "\n\t" \
460 -- ".word 8b, " #errh "\n\t" \
461 -- ".word 9b, " #errh "\n\t" \
462 -- ".word 10b, " #errh "\n\t" \
463 -- ".word 11b, " #errh "\n\t" \
464 -- ".word 12b, " #errh "\n\t" \
465 -- ".word 13b, " #errh "\n\t" \
466 -- ".word 14b, " #errh "\n\t" \
467 -- ".word 15b, " #errh "\n\t" \
468 -- ".word 16b, " #errh "\n\t" \
469 -- ".word 17b, " #errh "\n\n\t" \
470 -- ".previous\n\t" \
471 -- : : "r" (dst_addr), "r" (size), "r" (src_val) \
472 -- : "l1", "l2", "g7", "g1", "cc"); \
473 --})
474 --
475 --#define do_integer_store(reg_num, size, dst_addr, regs, errh) ({ \
476 -- unsigned long *src_val; \
477 -- static unsigned long zero[2] = { 0, }; \
478 -- \
479 -- if (reg_num) src_val = fetch_reg_addr(reg_num, regs); \
480 -- else { \
481 -- src_val = &zero[0]; \
482 -- if (size == 8) \
483 -- zero[1] = fetch_reg(1, regs); \
484 -- } \
485 -- store_common(dst_addr, size, src_val, errh); \
486 --})
487 -+/* una_asm.S */
488 -+extern int do_int_load(unsigned long *dest_reg, int size,
489 -+ unsigned long *saddr, int is_signed);
490 -+extern int __do_int_store(unsigned long *dst_addr, int size,
491 -+ unsigned long *src_val);
492 -+
493 -+static int do_int_store(int reg_num, int size, unsigned long *dst_addr,
494 -+ struct pt_regs *regs)
495 -+{
496 -+ unsigned long zero[2] = { 0, 0 };
497 -+ unsigned long *src_val;
498 -+
499 -+ if (reg_num)
500 -+ src_val = fetch_reg_addr(reg_num, regs);
501 -+ else {
502 -+ src_val = &zero[0];
503 -+ if (size == 8)
504 -+ zero[1] = fetch_reg(1, regs);
505 -+ }
506 -+ return __do_int_store(dst_addr, size, src_val);
507 -+}
508 -
509 - extern void smp_capture(void);
510 - extern void smp_release(void);
511 -
512 --#define do_atomic(srcdest_reg, mem, errh) ({ \
513 -- unsigned long flags, tmp; \
514 -- \
515 -- smp_capture(); \
516 -- local_irq_save(flags); \
517 -- tmp = *srcdest_reg; \
518 -- do_integer_load(srcdest_reg, 4, mem, 0, errh); \
519 -- store_common(mem, 4, &tmp, errh); \
520 -- local_irq_restore(flags); \
521 -- smp_release(); \
522 --})
523 --
524 - static inline void advance(struct pt_regs *regs)
525 - {
526 - regs->pc = regs->npc;
527 -@@ -342,9 +216,7 @@ static inline int ok_for_kernel(unsigned int insn)
528 - return !floating_point_load_or_store_p(insn);
529 - }
530 -
531 --void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("kernel_mna_trap_fault");
532 --
533 --void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
534 -+static void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
535 - {
536 - unsigned long g2 = regs->u_regs [UREG_G2];
537 - unsigned long fixup = search_extables_range(regs->pc, &g2);
538 -@@ -379,48 +251,34 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)
539 - printk("Unsupported unaligned load/store trap for kernel at <%08lx>.\n",
540 - regs->pc);
541 - unaligned_panic("Wheee. Kernel does fpu/atomic unaligned load/store.");
542 --
543 -- __asm__ __volatile__ ("\n"
544 --"kernel_unaligned_trap_fault:\n\t"
545 -- "mov %0, %%o0\n\t"
546 -- "call kernel_mna_trap_fault\n\t"
547 -- " mov %1, %%o1\n\t"
548 -- :
549 -- : "r" (regs), "r" (insn)
550 -- : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
551 -- "g1", "g2", "g3", "g4", "g5", "g7", "cc");
552 - } else {
553 - unsigned long addr = compute_effective_address(regs, insn);
554 -+ int err;
555 -
556 - #ifdef DEBUG_MNA
557 - printk("KMNA: pc=%08lx [dir=%s addr=%08lx size=%d] retpc[%08lx]\n",
558 - regs->pc, dirstrings[dir], addr, size, regs->u_regs[UREG_RETPC]);
559 - #endif
560 -- switch(dir) {
561 -+ switch (dir) {
562 - case load:
563 -- do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
564 -- size, (unsigned long *) addr,
565 -- decode_signedness(insn),
566 -- kernel_unaligned_trap_fault);
567 -+ err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),
568 -+ regs),
569 -+ size, (unsigned long *) addr,
570 -+ decode_signedness(insn));
571 - break;
572 -
573 - case store:
574 -- do_integer_store(((insn>>25)&0x1f), size,
575 -- (unsigned long *) addr, regs,
576 -- kernel_unaligned_trap_fault);
577 -+ err = do_int_store(((insn>>25)&0x1f), size,
578 -+ (unsigned long *) addr, regs);
579 - break;
580 --#if 0 /* unsupported */
581 -- case both:
582 -- do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
583 -- (unsigned long *) addr,
584 -- kernel_unaligned_trap_fault);
585 -- break;
586 --#endif
587 - default:
588 - panic("Impossible kernel unaligned trap.");
589 - /* Not reached... */
590 - }
591 -- advance(regs);
592 -+ if (err)
593 -+ kernel_mna_trap_fault(regs, insn);
594 -+ else
595 -+ advance(regs);
596 - }
597 - }
598 -
599 -@@ -459,9 +317,7 @@ static inline int ok_for_user(struct pt_regs *regs, unsigned int insn,
600 - return 0;
601 - }
602 -
603 --void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("user_mna_trap_fault");
604 --
605 --void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
606 -+static void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
607 - {
608 - siginfo_t info;
609 -
610 -@@ -485,7 +341,7 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)
611 - if(!ok_for_user(regs, insn, dir)) {
612 - goto kill_user;
613 - } else {
614 -- int size = decode_access_size(insn);
615 -+ int err, size = decode_access_size(insn);
616 - unsigned long addr;
617 -
618 - if(floating_point_load_or_store_p(insn)) {
619 -@@ -496,48 +352,34 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)
620 - addr = compute_effective_address(regs, insn);
621 - switch(dir) {
622 - case load:
623 -- do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
624 -- size, (unsigned long *) addr,
625 -- decode_signedness(insn),
626 -- user_unaligned_trap_fault);
627 -+ err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),
628 -+ regs),
629 -+ size, (unsigned long *) addr,
630 -+ decode_signedness(insn));
631 - break;
632 -
633 - case store:
634 -- do_integer_store(((insn>>25)&0x1f), size,
635 -- (unsigned long *) addr, regs,
636 -- user_unaligned_trap_fault);
637 -+ err = do_int_store(((insn>>25)&0x1f), size,
638 -+ (unsigned long *) addr, regs);
639 - break;
640 -
641 - case both:
642 --#if 0 /* unsupported */
643 -- do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
644 -- (unsigned long *) addr,
645 -- user_unaligned_trap_fault);
646 --#else
647 - /*
648 - * This was supported in 2.4. However, we question
649 - * the value of SWAP instruction across word boundaries.
650 - */
651 - printk("Unaligned SWAP unsupported.\n");
652 -- goto kill_user;
653 --#endif
654 -+ err = -EFAULT;
655 - break;
656 -
657 - default:
658 - unaligned_panic("Impossible user unaligned trap.");
659 --
660 -- __asm__ __volatile__ ("\n"
661 --"user_unaligned_trap_fault:\n\t"
662 -- "mov %0, %%o0\n\t"
663 -- "call user_mna_trap_fault\n\t"
664 -- " mov %1, %%o1\n\t"
665 -- :
666 -- : "r" (regs), "r" (insn)
667 -- : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
668 -- "g1", "g2", "g3", "g4", "g5", "g7", "cc");
669 - goto out;
670 - }
671 -- advance(regs);
672 -+ if (err)
673 -+ goto kill_user;
674 -+ else
675 -+ advance(regs);
676 - goto out;
677 - }
678 -
679 -diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
680 -index e2027f2..2650d0d 100644
681 ---- a/arch/sparc64/mm/fault.c
682 -+++ b/arch/sparc64/mm/fault.c
683 -@@ -244,16 +244,8 @@ static void do_kernel_fault(struct pt_regs *regs, int si_code, int fault_code,
684 - if (regs->tstate & TSTATE_PRIV) {
685 - const struct exception_table_entry *entry;
686 -
687 -- if (asi == ASI_P && (insn & 0xc0800000) == 0xc0800000) {
688 -- if (insn & 0x2000)
689 -- asi = (regs->tstate >> 24);
690 -- else
691 -- asi = (insn >> 5);
692 -- }
693 --
694 -- /* Look in asi.h: All _S asis have LS bit set */
695 -- if ((asi & 0x1) &&
696 -- (entry = search_exception_tables(regs->tpc))) {
697 -+ entry = search_exception_tables(regs->tpc);
698 -+ if (entry) {
699 - regs->tpc = entry->fixup;
700 - regs->tnpc = regs->tpc + 4;
701 - return;
702 -@@ -294,7 +286,7 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
703 - unsigned long tpc = regs->tpc;
704 -
705 - /* Sanity check the PC. */
706 -- if ((tpc >= KERNBASE && tpc < (unsigned long) _etext) ||
707 -+ if ((tpc >= KERNBASE && tpc < (unsigned long) __init_end) ||
708 - (tpc >= MODULES_VADDR && tpc < MODULES_END)) {
709 - /* Valid, no problems... */
710 - } else {
711 -diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
712 -index 6ea19c2..4eaaf78 100644
713 ---- a/arch/x86/ia32/ia32_signal.c
714 -+++ b/arch/x86/ia32/ia32_signal.c
715 -@@ -494,7 +494,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
716 - regs->ss = __USER32_DS;
717 -
718 - set_fs(USER_DS);
719 -- regs->eflags &= ~TF_MASK;
720 -+ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
721 - if (test_thread_flag(TIF_SINGLESTEP))
722 - ptrace_notify(SIGTRAP);
723 -
724 -@@ -600,7 +600,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
725 - regs->ss = __USER32_DS;
726 -
727 - set_fs(USER_DS);
728 -- regs->eflags &= ~TF_MASK;
729 -+ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
730 - if (test_thread_flag(TIF_SINGLESTEP))
731 - ptrace_notify(SIGTRAP);
732 -
733 -diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
734 -index edb5108..c48fbb1 100644
735 ---- a/arch/x86/kernel/apic_32.c
736 -+++ b/arch/x86/kernel/apic_32.c
737 -@@ -154,7 +154,7 @@ unsigned long safe_apic_wait_icr_idle(void)
738 - /**
739 - * enable_NMI_through_LVT0 - enable NMI through local vector table 0
740 - */
741 --void enable_NMI_through_LVT0 (void * dummy)
742 -+void __cpuinit enable_NMI_through_LVT0(void)
743 - {
744 - unsigned int v = APIC_DM_NMI;
745 -
746 -diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
747 -index f28ccb5..0173007 100644
748 ---- a/arch/x86/kernel/apic_64.c
749 -+++ b/arch/x86/kernel/apic_64.c
750 -@@ -151,7 +151,7 @@ unsigned int safe_apic_wait_icr_idle(void)
751 - return send_status;
752 - }
753 -
754 --void enable_NMI_through_LVT0 (void * dummy)
755 -+void enable_NMI_through_LVT0(void)
756 - {
757 - unsigned int v;
758 -
759 -diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
760 -index a6b1490..232fdeb 100644
761 ---- a/arch/x86/kernel/io_apic_32.c
762 -+++ b/arch/x86/kernel/io_apic_32.c
763 -@@ -2080,7 +2080,7 @@ static struct irq_chip lapic_chip __read_mostly = {
764 - .eoi = ack_apic,
765 - };
766 -
767 --static void setup_nmi (void)
768 -+static void __init setup_nmi(void)
769 - {
770 - /*
771 - * Dirty trick to enable the NMI watchdog ...
772 -@@ -2093,7 +2093,7 @@ static void setup_nmi (void)
773 - */
774 - apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ...");
775 -
776 -- on_each_cpu(enable_NMI_through_LVT0, NULL, 1, 1);
777 -+ enable_NMI_through_LVT0();
778 -
779 - apic_printk(APIC_VERBOSE, " done.\n");
780 - }
781 -diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c
782 -index cbac167..7119cb7 100644
783 ---- a/arch/x86/kernel/io_apic_64.c
784 -+++ b/arch/x86/kernel/io_apic_64.c
785 -@@ -1565,7 +1565,7 @@ static struct hw_interrupt_type lapic_irq_type __read_mostly = {
786 - .end = end_lapic_irq,
787 - };
788 -
789 --static void setup_nmi (void)
790 -+static void __init setup_nmi(void)
791 - {
792 - /*
793 - * Dirty trick to enable the NMI watchdog ...
794 -@@ -1578,7 +1578,7 @@ static void setup_nmi (void)
795 - */
796 - printk(KERN_INFO "activating NMI Watchdog ...");
797 -
798 -- enable_NMI_through_LVT0(NULL);
799 -+ enable_NMI_through_LVT0();
800 -
801 - printk(" done.\n");
802 - }
803 -@@ -1654,7 +1654,7 @@ static inline void unlock_ExtINT_logic(void)
804 - *
805 - * FIXME: really need to revamp this for modern platforms only.
806 - */
807 --static inline void check_timer(void)
808 -+static inline void __init check_timer(void)
809 - {
810 - struct irq_cfg *cfg = irq_cfg + 0;
811 - int apic1, pin1, apic2, pin2;
812 -diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
813 -index ab79e1d..d7f7132 100644
814 ---- a/arch/x86/kernel/process_64.c
815 -+++ b/arch/x86/kernel/process_64.c
816 -@@ -212,14 +212,13 @@ void cpu_idle (void)
817 - current_thread_info()->status |= TS_POLLING;
818 - /* endless idle loop with no priority at all */
819 - while (1) {
820 -+ tick_nohz_stop_sched_tick();
821 - while (!need_resched()) {
822 - void (*idle)(void);
823 -
824 - if (__get_cpu_var(cpu_idle_state))
825 - __get_cpu_var(cpu_idle_state) = 0;
826 -
827 -- tick_nohz_stop_sched_tick();
828 --
829 - rmb();
830 - idle = pm_idle;
831 - if (!idle)
832 -diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
833 -index 9bdd830..20056db 100644
834 ---- a/arch/x86/kernel/signal_32.c
835 -+++ b/arch/x86/kernel/signal_32.c
836 -@@ -396,7 +396,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
837 - * The tracer may want to single-step inside the
838 - * handler too.
839 - */
840 -- regs->eflags &= ~TF_MASK;
841 -+ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
842 - if (test_thread_flag(TIF_SINGLESTEP))
843 - ptrace_notify(SIGTRAP);
844 -
845 -@@ -489,7 +489,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
846 - * The tracer may want to single-step inside the
847 - * handler too.
848 - */
849 -- regs->eflags &= ~TF_MASK;
850 -+ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
851 - if (test_thread_flag(TIF_SINGLESTEP))
852 - ptrace_notify(SIGTRAP);
853 -
854 -diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
855 -index ab086b0..62964c5 100644
856 ---- a/arch/x86/kernel/signal_64.c
857 -+++ b/arch/x86/kernel/signal_64.c
858 -@@ -295,7 +295,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
859 - see include/asm-x86_64/uaccess.h for details. */
860 - set_fs(USER_DS);
861 -
862 -- regs->eflags &= ~TF_MASK;
863 -+ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
864 - if (test_thread_flag(TIF_SINGLESTEP))
865 - ptrace_notify(SIGTRAP);
866 - #ifdef DEBUG_SIG
867 -diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c
868 -index 4ea80cb..fe200cf 100644
869 ---- a/arch/x86/kernel/smpboot_32.c
870 -+++ b/arch/x86/kernel/smpboot_32.c
871 -@@ -405,7 +405,7 @@ static void __cpuinit start_secondary(void *unused)
872 - setup_secondary_clock();
873 - if (nmi_watchdog == NMI_IO_APIC) {
874 - disable_8259A_irq(0);
875 -- enable_NMI_through_LVT0(NULL);
876 -+ enable_NMI_through_LVT0();
877 - enable_8259A_irq(0);
878 - }
879 - /*
880 -diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
881 -index aaf4e12..eca8026 100644
882 ---- a/arch/x86/kernel/smpboot_64.c
883 -+++ b/arch/x86/kernel/smpboot_64.c
884 -@@ -338,7 +338,7 @@ void __cpuinit start_secondary(void)
885 -
886 - if (nmi_watchdog == NMI_IO_APIC) {
887 - disable_8259A_irq(0);
888 -- enable_NMI_through_LVT0(NULL);
889 -+ enable_NMI_through_LVT0();
890 - enable_8259A_irq(0);
891 - }
892 -
893 -diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
894 -index 4df637e..6b521d3 100644
895 ---- a/arch/x86/pci/mmconfig-shared.c
896 -+++ b/arch/x86/pci/mmconfig-shared.c
897 -@@ -22,42 +22,9 @@
898 - #define MMCONFIG_APER_MIN (2 * 1024*1024)
899 - #define MMCONFIG_APER_MAX (256 * 1024*1024)
900 -
901 --DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
902 --
903 - /* Indicate if the mmcfg resources have been placed into the resource table. */
904 - static int __initdata pci_mmcfg_resources_inserted;
905 -
906 --/* K8 systems have some devices (typically in the builtin northbridge)
907 -- that are only accessible using type1
908 -- Normally this can be expressed in the MCFG by not listing them
909 -- and assigning suitable _SEGs, but this isn't implemented in some BIOS.
910 -- Instead try to discover all devices on bus 0 that are unreachable using MM
911 -- and fallback for them. */
912 --static void __init unreachable_devices(void)
913 --{
914 -- int i, bus;
915 -- /* Use the max bus number from ACPI here? */
916 -- for (bus = 0; bus < PCI_MMCFG_MAX_CHECK_BUS; bus++) {
917 -- for (i = 0; i < 32; i++) {
918 -- unsigned int devfn = PCI_DEVFN(i, 0);
919 -- u32 val1, val2;
920 --
921 -- pci_conf1_read(0, bus, devfn, 0, 4, &val1);
922 -- if (val1 == 0xffffffff)
923 -- continue;
924 --
925 -- if (pci_mmcfg_arch_reachable(0, bus, devfn)) {
926 -- raw_pci_ops->read(0, bus, devfn, 0, 4, &val2);
927 -- if (val1 == val2)
928 -- continue;
929 -- }
930 -- set_bit(i + 32 * bus, pci_mmcfg_fallback_slots);
931 -- printk(KERN_NOTICE "PCI: No mmconfig possible on device"
932 -- " %02x:%02x\n", bus, i);
933 -- }
934 -- }
935 --}
936 --
937 - static const char __init *pci_mmcfg_e7520(void)
938 - {
939 - u32 win;
940 -@@ -270,8 +237,6 @@ void __init pci_mmcfg_init(int type)
941 - return;
942 -
943 - if (pci_mmcfg_arch_init()) {
944 -- if (type == 1)
945 -- unreachable_devices();
946 - if (known_bridge)
947 - pci_mmcfg_insert_resources(IORESOURCE_BUSY);
948 - pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
949 -diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c
950 -index 1bf5816..7b75e65 100644
951 ---- a/arch/x86/pci/mmconfig_32.c
952 -+++ b/arch/x86/pci/mmconfig_32.c
953 -@@ -30,10 +30,6 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
954 - struct acpi_mcfg_allocation *cfg;
955 - int cfg_num;
956 -
957 -- if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS &&
958 -- test_bit(PCI_SLOT(devfn) + 32*bus, pci_mmcfg_fallback_slots))
959 -- return 0;
960 --
961 - for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) {
962 - cfg = &pci_mmcfg_config[cfg_num];
963 - if (cfg->pci_segment == seg &&
964 -@@ -68,13 +64,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
965 - u32 base;
966 -
967 - if ((bus > 255) || (devfn > 255) || (reg > 4095)) {
968 -- *value = -1;
969 -+err: *value = -1;
970 - return -EINVAL;
971 - }
972 -
973 -+ if (reg < 256)
974 -+ return pci_conf1_read(seg,bus,devfn,reg,len,value);
975 -+
976 - base = get_base_addr(seg, bus, devfn);
977 - if (!base)
978 -- return pci_conf1_read(seg,bus,devfn,reg,len,value);
979 -+ goto err;
980 -
981 - spin_lock_irqsave(&pci_config_lock, flags);
982 -
983 -@@ -105,9 +104,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
984 - if ((bus > 255) || (devfn > 255) || (reg > 4095))
985 - return -EINVAL;
986 -
987 -+ if (reg < 256)
988 -+ return pci_conf1_write(seg,bus,devfn,reg,len,value);
989 -+
990 - base = get_base_addr(seg, bus, devfn);
991 - if (!base)
992 -- return pci_conf1_write(seg,bus,devfn,reg,len,value);
993 -+ return -EINVAL;
994 -
995 - spin_lock_irqsave(&pci_config_lock, flags);
996 -
997 -@@ -134,12 +136,6 @@ static struct pci_raw_ops pci_mmcfg = {
998 - .write = pci_mmcfg_write,
999 - };
1000 -
1001 --int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
1002 -- unsigned int devfn)
1003 --{
1004 -- return get_base_addr(seg, bus, devfn) != 0;
1005 --}
1006 --
1007 - int __init pci_mmcfg_arch_init(void)
1008 - {
1009 - printk(KERN_INFO "PCI: Using MMCONFIG\n");
1010 -diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c
1011 -index 4095e4d..c4cf318 100644
1012 ---- a/arch/x86/pci/mmconfig_64.c
1013 -+++ b/arch/x86/pci/mmconfig_64.c
1014 -@@ -40,9 +40,7 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus)
1015 - static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
1016 - {
1017 - char __iomem *addr;
1018 -- if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS &&
1019 -- test_bit(32*bus + PCI_SLOT(devfn), pci_mmcfg_fallback_slots))
1020 -- return NULL;
1021 -+
1022 - addr = get_virt(seg, bus);
1023 - if (!addr)
1024 - return NULL;
1025 -@@ -56,13 +54,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
1026 -
1027 - /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
1028 - if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) {
1029 -- *value = -1;
1030 -+err: *value = -1;
1031 - return -EINVAL;
1032 - }
1033 -
1034 -+ if (reg < 256)
1035 -+ return pci_conf1_read(seg,bus,devfn,reg,len,value);
1036 -+
1037 - addr = pci_dev_base(seg, bus, devfn);
1038 - if (!addr)
1039 -- return pci_conf1_read(seg,bus,devfn,reg,len,value);
1040 -+ goto err;
1041 -
1042 - switch (len) {
1043 - case 1:
1044 -@@ -88,9 +89,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
1045 - if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
1046 - return -EINVAL;
1047 -
1048 -+ if (reg < 256)
1049 -+ return pci_conf1_write(seg,bus,devfn,reg,len,value);
1050 -+
1051 - addr = pci_dev_base(seg, bus, devfn);
1052 - if (!addr)
1053 -- return pci_conf1_write(seg,bus,devfn,reg,len,value);
1054 -+ return -EINVAL;
1055 -
1056 - switch (len) {
1057 - case 1:
1058 -@@ -126,12 +130,6 @@ static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg)
1059 - return addr;
1060 - }
1061 -
1062 --int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
1063 -- unsigned int devfn)
1064 --{
1065 -- return pci_dev_base(seg, bus, devfn) != NULL;
1066 --}
1067 --
1068 - int __init pci_mmcfg_arch_init(void)
1069 - {
1070 - int i;
1071 -diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
1072 -index ac56d39..36cb44c 100644
1073 ---- a/arch/x86/pci/pci.h
1074 -+++ b/arch/x86/pci/pci.h
1075 -@@ -98,13 +98,6 @@ extern void pcibios_sort(void);
1076 -
1077 - /* pci-mmconfig.c */
1078 -
1079 --/* Verify the first 16 busses. We assume that systems with more busses
1080 -- get MCFG right. */
1081 --#define PCI_MMCFG_MAX_CHECK_BUS 16
1082 --extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
1083 --
1084 --extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
1085 -- unsigned int devfn);
1086 - extern int __init pci_mmcfg_arch_init(void);
1087 -
1088 - /*
1089 -diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
1090 -index 2575f67..5c579d2 100644
1091 ---- a/crypto/async_tx/async_xor.c
1092 -+++ b/crypto/async_tx/async_xor.c
1093 -@@ -264,7 +264,7 @@ async_xor_zero_sum(struct page *dest, struct page **src_list,
1094 -
1095 - BUG_ON(src_cnt <= 1);
1096 -
1097 -- if (tx) {
1098 -+ if (tx && src_cnt <= device->max_xor) {
1099 - dma_addr_t dma_addr;
1100 - enum dma_data_direction dir;
1101 -
1102 -diff --git a/crypto/xcbc.c b/crypto/xcbc.c
1103 -index ac68f3b..a957373 100644
1104 ---- a/crypto/xcbc.c
1105 -+++ b/crypto/xcbc.c
1106 -@@ -124,6 +124,11 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
1107 - unsigned int offset = sg[i].offset;
1108 - unsigned int slen = sg[i].length;
1109 -
1110 -+ if (unlikely(slen > nbytes))
1111 -+ slen = nbytes;
1112 -+
1113 -+ nbytes -= slen;
1114 -+
1115 - while (slen > 0) {
1116 - unsigned int len = min(slen, ((unsigned int)(PAGE_SIZE)) - offset);
1117 - char *p = crypto_kmap(pg, 0) + offset;
1118 -@@ -177,7 +182,6 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
1119 - offset = 0;
1120 - pg++;
1121 - }
1122 -- nbytes-=sg[i].length;
1123 - i++;
1124 - } while (nbytes>0);
1125 -
1126 -diff --git a/crypto/xts.c b/crypto/xts.c
1127 -index 8eb08bf..d87b0f3 100644
1128 ---- a/crypto/xts.c
1129 -+++ b/crypto/xts.c
1130 -@@ -77,16 +77,16 @@ static int setkey(struct crypto_tfm *parent, const u8 *key,
1131 - }
1132 -
1133 - struct sinfo {
1134 -- be128 t;
1135 -+ be128 *t;
1136 - struct crypto_tfm *tfm;
1137 - void (*fn)(struct crypto_tfm *, u8 *, const u8 *);
1138 - };
1139 -
1140 - static inline void xts_round(struct sinfo *s, void *dst, const void *src)
1141 - {
1142 -- be128_xor(dst, &s->t, src); /* PP <- T xor P */
1143 -+ be128_xor(dst, s->t, src); /* PP <- T xor P */
1144 - s->fn(s->tfm, dst, dst); /* CC <- E(Key1,PP) */
1145 -- be128_xor(dst, dst, &s->t); /* C <- T xor CC */
1146 -+ be128_xor(dst, dst, s->t); /* C <- T xor CC */
1147 - }
1148 -
1149 - static int crypt(struct blkcipher_desc *d,
1150 -@@ -101,7 +101,6 @@ static int crypt(struct blkcipher_desc *d,
1151 - .tfm = crypto_cipher_tfm(ctx->child),
1152 - .fn = fn
1153 - };
1154 -- be128 *iv;
1155 - u8 *wsrc;
1156 - u8 *wdst;
1157 -
1158 -@@ -109,20 +108,20 @@ static int crypt(struct blkcipher_desc *d,
1159 - if (!w->nbytes)
1160 - return err;
1161 -
1162 -+ s.t = (be128 *)w->iv;
1163 - avail = w->nbytes;
1164 -
1165 - wsrc = w->src.virt.addr;
1166 - wdst = w->dst.virt.addr;
1167 -
1168 - /* calculate first value of T */
1169 -- iv = (be128 *)w->iv;
1170 -- tw(crypto_cipher_tfm(ctx->tweak), (void *)&s.t, w->iv);
1171 -+ tw(crypto_cipher_tfm(ctx->tweak), w->iv, w->iv);
1172 -
1173 - goto first;
1174 -
1175 - for (;;) {
1176 - do {
1177 -- gf128mul_x_ble(&s.t, &s.t);
1178 -+ gf128mul_x_ble(s.t, s.t);
1179 -
1180 - first:
1181 - xts_round(&s, wdst, wsrc);
1182 -diff --git a/drivers/acorn/char/defkeymap-l7200.c b/drivers/acorn/char/defkeymap-l7200.c
1183 -index 28a5fbc..93d80a1 100644
1184 ---- a/drivers/acorn/char/defkeymap-l7200.c
1185 -+++ b/drivers/acorn/char/defkeymap-l7200.c
1186 -@@ -347,40 +347,40 @@ char *func_table[MAX_NR_FUNC] = {
1187 - };
1188 -
1189 - struct kbdiacruc accent_table[MAX_DIACR] = {
1190 -- {'`', 'A', '\300'}, {'`', 'a', '\340'},
1191 -- {'\'', 'A', '\301'}, {'\'', 'a', '\341'},
1192 -- {'^', 'A', '\302'}, {'^', 'a', '\342'},
1193 -- {'~', 'A', '\303'}, {'~', 'a', '\343'},
1194 -- {'"', 'A', '\304'}, {'"', 'a', '\344'},
1195 -- {'O', 'A', '\305'}, {'o', 'a', '\345'},
1196 -- {'0', 'A', '\305'}, {'0', 'a', '\345'},
1197 -- {'A', 'A', '\305'}, {'a', 'a', '\345'},
1198 -- {'A', 'E', '\306'}, {'a', 'e', '\346'},
1199 -- {',', 'C', '\307'}, {',', 'c', '\347'},
1200 -- {'`', 'E', '\310'}, {'`', 'e', '\350'},
1201 -- {'\'', 'E', '\311'}, {'\'', 'e', '\351'},
1202 -- {'^', 'E', '\312'}, {'^', 'e', '\352'},
1203 -- {'"', 'E', '\313'}, {'"', 'e', '\353'},
1204 -- {'`', 'I', '\314'}, {'`', 'i', '\354'},
1205 -- {'\'', 'I', '\315'}, {'\'', 'i', '\355'},
1206 -- {'^', 'I', '\316'}, {'^', 'i', '\356'},
1207 -- {'"', 'I', '\317'}, {'"', 'i', '\357'},
1208 -- {'-', 'D', '\320'}, {'-', 'd', '\360'},
1209 -- {'~', 'N', '\321'}, {'~', 'n', '\361'},
1210 -- {'`', 'O', '\322'}, {'`', 'o', '\362'},
1211 -- {'\'', 'O', '\323'}, {'\'', 'o', '\363'},
1212 -- {'^', 'O', '\324'}, {'^', 'o', '\364'},
1213 -- {'~', 'O', '\325'}, {'~', 'o', '\365'},
1214 -- {'"', 'O', '\326'}, {'"', 'o', '\366'},
1215 -- {'/', 'O', '\330'}, {'/', 'o', '\370'},
1216 -- {'`', 'U', '\331'}, {'`', 'u', '\371'},
1217 -- {'\'', 'U', '\332'}, {'\'', 'u', '\372'},
1218 -- {'^', 'U', '\333'}, {'^', 'u', '\373'},
1219 -- {'"', 'U', '\334'}, {'"', 'u', '\374'},
1220 -- {'\'', 'Y', '\335'}, {'\'', 'y', '\375'},
1221 -- {'T', 'H', '\336'}, {'t', 'h', '\376'},
1222 -- {'s', 's', '\337'}, {'"', 'y', '\377'},
1223 -- {'s', 'z', '\337'}, {'i', 'j', '\377'},
1224 -+ {'`', 'A', 0300}, {'`', 'a', 0340},
1225 -+ {'\'', 'A', 0301}, {'\'', 'a', 0341},
1226 -+ {'^', 'A', 0302}, {'^', 'a', 0342},
1227 -+ {'~', 'A', 0303}, {'~', 'a', 0343},
1228 -+ {'"', 'A', 0304}, {'"', 'a', 0344},
1229 -+ {'O', 'A', 0305}, {'o', 'a', 0345},
1230 -+ {'0', 'A', 0305}, {'0', 'a', 0345},
1231 -+ {'A', 'A', 0305}, {'a', 'a', 0345},
1232 -+ {'A', 'E', 0306}, {'a', 'e', 0346},
1233 -+ {',', 'C', 0307}, {',', 'c', 0347},
1234 -+ {'`', 'E', 0310}, {'`', 'e', 0350},
1235 -+ {'\'', 'E', 0311}, {'\'', 'e', 0351},
1236 -+ {'^', 'E', 0312}, {'^', 'e', 0352},
1237 -+ {'"', 'E', 0313}, {'"', 'e', 0353},
1238 -+ {'`', 'I', 0314}, {'`', 'i', 0354},
1239 -+ {'\'', 'I', 0315}, {'\'', 'i', 0355},
1240 -+ {'^', 'I', 0316}, {'^', 'i', 0356},
1241 -+ {'"', 'I', 0317}, {'"', 'i', 0357},
1242 -+ {'-', 'D', 0320}, {'-', 'd', 0360},
1243 -+ {'~', 'N', 0321}, {'~', 'n', 0361},
1244 -+ {'`', 'O', 0322}, {'`', 'o', 0362},
1245 -+ {'\'', 'O', 0323}, {'\'', 'o', 0363},
1246 -+ {'^', 'O', 0324}, {'^', 'o', 0364},
1247 -+ {'~', 'O', 0325}, {'~', 'o', 0365},
1248 -+ {'"', 'O', 0326}, {'"', 'o', 0366},
1249 -+ {'/', 'O', 0330}, {'/', 'o', 0370},
1250 -+ {'`', 'U', 0331}, {'`', 'u', 0371},
1251 -+ {'\'', 'U', 0332}, {'\'', 'u', 0372},
1252 -+ {'^', 'U', 0333}, {'^', 'u', 0373},
1253 -+ {'"', 'U', 0334}, {'"', 'u', 0374},
1254 -+ {'\'', 'Y', 0335}, {'\'', 'y', 0375},
1255 -+ {'T', 'H', 0336}, {'t', 'h', 0376},
1256 -+ {'s', 's', 0337}, {'"', 'y', 0377},
1257 -+ {'s', 'z', 0337}, {'i', 'j', 0377},
1258 - };
1259 -
1260 - unsigned int accent_table_size = 68;
1261 -diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
1262 -index 0713872..a742efa 100644
1263 ---- a/drivers/ata/pata_hpt366.c
1264 -+++ b/drivers/ata/pata_hpt366.c
1265 -@@ -27,7 +27,7 @@
1266 - #include <linux/libata.h>
1267 -
1268 - #define DRV_NAME "pata_hpt366"
1269 --#define DRV_VERSION "0.6.1"
1270 -+#define DRV_VERSION "0.6.2"
1271 -
1272 - struct hpt_clock {
1273 - u8 xfer_speed;
1274 -@@ -180,9 +180,9 @@ static unsigned long hpt366_filter(struct ata_device *adev, unsigned long mask)
1275 - if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
1276 - mask &= ~ATA_MASK_UDMA;
1277 - if (hpt_dma_blacklisted(adev, "UDMA3", bad_ata66_3))
1278 -- mask &= ~(0x07 << ATA_SHIFT_UDMA);
1279 -+ mask &= ~(0xF8 << ATA_SHIFT_UDMA);
1280 - if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4))
1281 -- mask &= ~(0x0F << ATA_SHIFT_UDMA);
1282 -+ mask &= ~(0xF0 << ATA_SHIFT_UDMA);
1283 - }
1284 - return ata_pci_default_filter(adev, mask);
1285 - }
1286 -diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
1287 -index c79f066..eac6a2b 100644
1288 ---- a/drivers/ata/pata_hpt37x.c
1289 -+++ b/drivers/ata/pata_hpt37x.c
1290 -@@ -24,7 +24,7 @@
1291 - #include <linux/libata.h>
1292 -
1293 - #define DRV_NAME "pata_hpt37x"
1294 --#define DRV_VERSION "0.6.9"
1295 -+#define DRV_VERSION "0.6.11"
1296 -
1297 - struct hpt_clock {
1298 - u8 xfer_speed;
1299 -@@ -281,7 +281,7 @@ static unsigned long hpt370_filter(struct ata_device *adev, unsigned long mask)
1300 - if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
1301 - mask &= ~ATA_MASK_UDMA;
1302 - if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
1303 -- mask &= ~(0x1F << ATA_SHIFT_UDMA);
1304 -+ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
1305 - }
1306 - return ata_pci_default_filter(adev, mask);
1307 - }
1308 -@@ -297,7 +297,7 @@ static unsigned long hpt370a_filter(struct ata_device *adev, unsigned long mask)
1309 - {
1310 - if (adev->class == ATA_DEV_ATA) {
1311 - if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
1312 -- mask &= ~ (0x1F << ATA_SHIFT_UDMA);
1313 -+ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
1314 - }
1315 - return ata_pci_default_filter(adev, mask);
1316 - }
1317 -diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
1318 -index 8bed888..004cac7 100644
1319 ---- a/drivers/ata/pata_serverworks.c
1320 -+++ b/drivers/ata/pata_serverworks.c
1321 -@@ -226,7 +226,7 @@ static unsigned long serverworks_csb_filter(struct ata_device *adev, unsigned lo
1322 -
1323 - for (i = 0; (p = csb_bad_ata100[i]) != NULL; i++) {
1324 - if (!strcmp(p, model_num))
1325 -- mask &= ~(0x1F << ATA_SHIFT_UDMA);
1326 -+ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
1327 - }
1328 - return ata_pci_default_filter(adev, mask);
1329 - }
1330 -diff --git a/drivers/base/platform.c b/drivers/base/platform.c
1331 -index fb56092..39d8b7b 100644
1332 ---- a/drivers/base/platform.c
1333 -+++ b/drivers/base/platform.c
1334 -@@ -647,7 +647,7 @@ u64 dma_get_required_mask(struct device *dev)
1335 - high_totalram += high_totalram - 1;
1336 - mask = (((u64)high_totalram) << 32) + 0xffffffff;
1337 - }
1338 -- return mask & *dev->dma_mask;
1339 -+ return mask;
1340 - }
1341 - EXPORT_SYMBOL_GPL(dma_get_required_mask);
1342 - #endif
1343 -diff --git a/drivers/block/ub.c b/drivers/block/ub.c
1344 -index 08e909d..7aca466 100644
1345 ---- a/drivers/block/ub.c
1346 -+++ b/drivers/block/ub.c
1347 -@@ -657,7 +657,6 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
1348 - if ((cmd = ub_get_cmd(lun)) == NULL)
1349 - return -1;
1350 - memset(cmd, 0, sizeof(struct ub_scsi_cmd));
1351 -- sg_init_table(cmd->sgv, UB_MAX_REQ_SG);
1352 -
1353 - blkdev_dequeue_request(rq);
1354 -
1355 -@@ -668,6 +667,7 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
1356 - /*
1357 - * get scatterlist from block layer
1358 - */
1359 -+ sg_init_table(&urq->sgv[0], UB_MAX_REQ_SG);
1360 - n_elem = blk_rq_map_sg(lun->disk->queue, rq, &urq->sgv[0]);
1361 - if (n_elem < 0) {
1362 - /* Impossible, because blk_rq_map_sg should not hit ENOMEM. */
1363 -diff --git a/drivers/char/defkeymap.c_shipped b/drivers/char/defkeymap.c_shipped
1364 -index 0aa419a..d2208df 100644
1365 ---- a/drivers/char/defkeymap.c_shipped
1366 -+++ b/drivers/char/defkeymap.c_shipped
1367 -@@ -223,40 +223,40 @@ char *func_table[MAX_NR_FUNC] = {
1368 - };
1369 -
1370 - struct kbdiacruc accent_table[MAX_DIACR] = {
1371 -- {'`', 'A', '\300'}, {'`', 'a', '\340'},
1372 -- {'\'', 'A', '\301'}, {'\'', 'a', '\341'},
1373 -- {'^', 'A', '\302'}, {'^', 'a', '\342'},
1374 -- {'~', 'A', '\303'}, {'~', 'a', '\343'},
1375 -- {'"', 'A', '\304'}, {'"', 'a', '\344'},
1376 -- {'O', 'A', '\305'}, {'o', 'a', '\345'},
1377 -- {'0', 'A', '\305'}, {'0', 'a', '\345'},
1378 -- {'A', 'A', '\305'}, {'a', 'a', '\345'},
1379 -- {'A', 'E', '\306'}, {'a', 'e', '\346'},
1380 -- {',', 'C', '\307'}, {',', 'c', '\347'},
1381 -- {'`', 'E', '\310'}, {'`', 'e', '\350'},
1382 -- {'\'', 'E', '\311'}, {'\'', 'e', '\351'},
1383 -- {'^', 'E', '\312'}, {'^', 'e', '\352'},
1384 -- {'"', 'E', '\313'}, {'"', 'e', '\353'},
1385 -- {'`', 'I', '\314'}, {'`', 'i', '\354'},
1386 -- {'\'', 'I', '\315'}, {'\'', 'i', '\355'},
1387 -- {'^', 'I', '\316'}, {'^', 'i', '\356'},
1388 -- {'"', 'I', '\317'}, {'"', 'i', '\357'},
1389 -- {'-', 'D', '\320'}, {'-', 'd', '\360'},
1390 -- {'~', 'N', '\321'}, {'~', 'n', '\361'},
1391 -- {'`', 'O', '\322'}, {'`', 'o', '\362'},
1392 -- {'\'', 'O', '\323'}, {'\'', 'o', '\363'},
1393 -- {'^', 'O', '\324'}, {'^', 'o', '\364'},
1394 -- {'~', 'O', '\325'}, {'~', 'o', '\365'},
1395 -- {'"', 'O', '\326'}, {'"', 'o', '\366'},
1396 -- {'/', 'O', '\330'}, {'/', 'o', '\370'},
1397 -- {'`', 'U', '\331'}, {'`', 'u', '\371'},
1398 -- {'\'', 'U', '\332'}, {'\'', 'u', '\372'},
1399 -- {'^', 'U', '\333'}, {'^', 'u', '\373'},
1400 -- {'"', 'U', '\334'}, {'"', 'u', '\374'},
1401 -- {'\'', 'Y', '\335'}, {'\'', 'y', '\375'},
1402 -- {'T', 'H', '\336'}, {'t', 'h', '\376'},
1403 -- {'s', 's', '\337'}, {'"', 'y', '\377'},
1404 -- {'s', 'z', '\337'}, {'i', 'j', '\377'},
1405 -+ {'`', 'A', 0300}, {'`', 'a', 0340},
1406 -+ {'\'', 'A', 0301}, {'\'', 'a', 0341},
1407 -+ {'^', 'A', 0302}, {'^', 'a', 0342},
1408 -+ {'~', 'A', 0303}, {'~', 'a', 0343},
1409 -+ {'"', 'A', 0304}, {'"', 'a', 0344},
1410 -+ {'O', 'A', 0305}, {'o', 'a', 0345},
1411 -+ {'0', 'A', 0305}, {'0', 'a', 0345},
1412 -+ {'A', 'A', 0305}, {'a', 'a', 0345},
1413 -+ {'A', 'E', 0306}, {'a', 'e', 0346},
1414 -+ {',', 'C', 0307}, {',', 'c', 0347},
1415 -+ {'`', 'E', 0310}, {'`', 'e', 0350},
1416 -+ {'\'', 'E', 0311}, {'\'', 'e', 0351},
1417 -+ {'^', 'E', 0312}, {'^', 'e', 0352},
1418 -+ {'"', 'E', 0313}, {'"', 'e', 0353},
1419 -+ {'`', 'I', 0314}, {'`', 'i', 0354},
1420 -+ {'\'', 'I', 0315}, {'\'', 'i', 0355},
1421 -+ {'^', 'I', 0316}, {'^', 'i', 0356},
1422 -+ {'"', 'I', 0317}, {'"', 'i', 0357},
1423 -+ {'-', 'D', 0320}, {'-', 'd', 0360},
1424 -+ {'~', 'N', 0321}, {'~', 'n', 0361},
1425 -+ {'`', 'O', 0322}, {'`', 'o', 0362},
1426 -+ {'\'', 'O', 0323}, {'\'', 'o', 0363},
1427 -+ {'^', 'O', 0324}, {'^', 'o', 0364},
1428 -+ {'~', 'O', 0325}, {'~', 'o', 0365},
1429 -+ {'"', 'O', 0326}, {'"', 'o', 0366},
1430 -+ {'/', 'O', 0330}, {'/', 'o', 0370},
1431 -+ {'`', 'U', 0331}, {'`', 'u', 0371},
1432 -+ {'\'', 'U', 0332}, {'\'', 'u', 0372},
1433 -+ {'^', 'U', 0333}, {'^', 'u', 0373},
1434 -+ {'"', 'U', 0334}, {'"', 'u', 0374},
1435 -+ {'\'', 'Y', 0335}, {'\'', 'y', 0375},
1436 -+ {'T', 'H', 0336}, {'t', 'h', 0376},
1437 -+ {'s', 's', 0337}, {'"', 'y', 0377},
1438 -+ {'s', 'z', 0337}, {'i', 'j', 0377},
1439 - };
1440 -
1441 - unsigned int accent_table_size = 68;
1442 -diff --git a/drivers/char/vt.c b/drivers/char/vt.c
1443 -index 7a5badf..93cfe4a 100644
1444 ---- a/drivers/char/vt.c
1445 -+++ b/drivers/char/vt.c
1446 -@@ -702,6 +702,7 @@ void redraw_screen(struct vc_data *vc, int is_switch)
1447 - if (is_switch) {
1448 - set_leds();
1449 - compute_shiftstate();
1450 -+ notify_update(vc);
1451 - }
1452 - }
1453 -
1454 -diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
1455 -index 45e7b46..8cf542b 100644
1456 ---- a/drivers/dma/ioat_dma.c
1457 -+++ b/drivers/dma/ioat_dma.c
1458 -@@ -726,6 +726,7 @@ static struct dma_async_tx_descriptor *ioat1_dma_prep_memcpy(
1459 -
1460 - if (new) {
1461 - new->len = len;
1462 -+ new->async_tx.ack = 0;
1463 - return &new->async_tx;
1464 - } else
1465 - return NULL;
1466 -@@ -749,6 +750,7 @@ static struct dma_async_tx_descriptor *ioat2_dma_prep_memcpy(
1467 -
1468 - if (new) {
1469 - new->len = len;
1470 -+ new->async_tx.ack = 0;
1471 - return &new->async_tx;
1472 - } else
1473 - return NULL;
1474 -diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
1475 -index e4c94f9..c8d3ffb 100644
1476 ---- a/drivers/message/fusion/mptsas.c
1477 -+++ b/drivers/message/fusion/mptsas.c
1478 -@@ -1699,6 +1699,11 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info,
1479 - if (error)
1480 - goto out_free_consistent;
1481 -
1482 -+ if (!buffer->NumPhys) {
1483 -+ error = -ENODEV;
1484 -+ goto out_free_consistent;
1485 -+ }
1486 -+
1487 - /* save config data */
1488 - port_info->num_phys = buffer->NumPhys;
1489 - port_info->phy_info = kcalloc(port_info->num_phys,
1490 -diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
1491 -index 9cc5a6b..55584ee 100644
1492 ---- a/drivers/net/e1000e/netdev.c
1493 -+++ b/drivers/net/e1000e/netdev.c
1494 -@@ -1686,6 +1686,9 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
1495 - else
1496 - rctl |= E1000_RCTL_LPE;
1497 -
1498 -+ /* Enable hardware CRC frame stripping */
1499 -+ rctl |= E1000_RCTL_SECRC;
1500 -+
1501 - /* Setup buffer sizes */
1502 - rctl &= ~E1000_RCTL_SZ_4096;
1503 - rctl |= E1000_RCTL_BSEX;
1504 -@@ -1751,9 +1754,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
1505 -
1506 - /* Enable Packet split descriptors */
1507 - rctl |= E1000_RCTL_DTYP_PS;
1508 --
1509 -- /* Enable hardware CRC frame stripping */
1510 -- rctl |= E1000_RCTL_SECRC;
1511 -
1512 - psrctl |= adapter->rx_ps_bsize0 >>
1513 - E1000_PSRCTL_BSIZE0_SHIFT;
1514 -diff --git a/drivers/net/macb.c b/drivers/net/macb.c
1515 -index e10528e..c796948 100644
1516 ---- a/drivers/net/macb.c
1517 -+++ b/drivers/net/macb.c
1518 -@@ -148,7 +148,7 @@ static void macb_handle_link_change(struct net_device *dev)
1519 -
1520 - if (phydev->duplex)
1521 - reg |= MACB_BIT(FD);
1522 -- if (phydev->speed)
1523 -+ if (phydev->speed == SPEED_100)
1524 - reg |= MACB_BIT(SPD);
1525 -
1526 - macb_writel(bp, NCFGR, reg);
1527 -diff --git a/drivers/net/niu.c b/drivers/net/niu.c
1528 -index 5f6beab..226dc54 100644
1529 ---- a/drivers/net/niu.c
1530 -+++ b/drivers/net/niu.c
1531 -@@ -33,8 +33,8 @@
1532 -
1533 - #define DRV_MODULE_NAME "niu"
1534 - #define PFX DRV_MODULE_NAME ": "
1535 --#define DRV_MODULE_VERSION "0.6"
1536 --#define DRV_MODULE_RELDATE "January 5, 2008"
1537 -+#define DRV_MODULE_VERSION "0.7"
1538 -+#define DRV_MODULE_RELDATE "February 18, 2008"
1539 -
1540 - static char version[] __devinitdata =
1541 - DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
1542 -@@ -1616,12 +1616,13 @@ static int niu_enable_alt_mac(struct niu *np, int index, int on)
1543 - if (index >= niu_num_alt_addr(np))
1544 - return -EINVAL;
1545 -
1546 -- if (np->flags & NIU_FLAGS_XMAC)
1547 -+ if (np->flags & NIU_FLAGS_XMAC) {
1548 - reg = XMAC_ADDR_CMPEN;
1549 -- else
1550 -+ mask = 1 << index;
1551 -+ } else {
1552 - reg = BMAC_ADDR_CMPEN;
1553 --
1554 -- mask = 1 << index;
1555 -+ mask = 1 << (index + 1);
1556 -+ }
1557 -
1558 - val = nr64_mac(reg);
1559 - if (on)
1560 -@@ -5147,7 +5148,12 @@ static void niu_set_rx_mode(struct net_device *dev)
1561 - index++;
1562 - }
1563 - } else {
1564 -- for (i = 0; i < niu_num_alt_addr(np); i++) {
1565 -+ int alt_start;
1566 -+ if (np->flags & NIU_FLAGS_XMAC)
1567 -+ alt_start = 0;
1568 -+ else
1569 -+ alt_start = 1;
1570 -+ for (i = alt_start; i < niu_num_alt_addr(np); i++) {
1571 - err = niu_enable_alt_mac(np, i, 0);
1572 - if (err)
1573 - printk(KERN_WARNING PFX "%s: Error %d "
1574 -diff --git a/drivers/net/niu.h b/drivers/net/niu.h
1575 -index 0e8626a..59dc05f 100644
1576 ---- a/drivers/net/niu.h
1577 -+++ b/drivers/net/niu.h
1578 -@@ -499,7 +499,7 @@
1579 - #define BMAC_ADDR2 0x00110UL
1580 - #define BMAC_ADDR2_ADDR2 0x000000000000ffffULL
1581 -
1582 --#define BMAC_NUM_ALT_ADDR 7
1583 -+#define BMAC_NUM_ALT_ADDR 6
1584 -
1585 - #define BMAC_ALT_ADDR0(NUM) (0x00118UL + (NUM)*0x18UL)
1586 - #define BMAC_ALT_ADDR0_ADDR0 0x000000000000ffffULL
1587 -diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
1588 -index 559a9a9..ddcc0c4 100644
1589 ---- a/drivers/net/wireless/b43/dma.c
1590 -+++ b/drivers/net/wireless/b43/dma.c
1591 -@@ -165,7 +165,7 @@ static void op64_fill_descriptor(struct b43_dmaring *ring,
1592 - addrhi = (((u64) dmaaddr >> 32) & ~SSB_DMA_TRANSLATION_MASK);
1593 - addrext = (((u64) dmaaddr >> 32) & SSB_DMA_TRANSLATION_MASK)
1594 - >> SSB_DMA_TRANSLATION_SHIFT;
1595 -- addrhi |= ssb_dma_translation(ring->dev->dev);
1596 -+ addrhi |= (ssb_dma_translation(ring->dev->dev) << 1);
1597 - if (slot == ring->nr_slots - 1)
1598 - ctl0 |= B43_DMA64_DCTL0_DTABLEEND;
1599 - if (start)
1600 -@@ -426,9 +426,21 @@ static inline
1601 - static int alloc_ringmemory(struct b43_dmaring *ring)
1602 - {
1603 - struct device *dev = ring->dev->dev->dev;
1604 --
1605 -+ gfp_t flags = GFP_KERNEL;
1606 -+
1607 -+ /* The specs call for 4K buffers for 30- and 32-bit DMA with 4K
1608 -+ * alignment and 8K buffers for 64-bit DMA with 8K alignment. Testing
1609 -+ * has shown that 4K is sufficient for the latter as long as the buffer
1610 -+ * does not cross an 8K boundary.
1611 -+ *
1612 -+ * For unknown reasons - possibly a hardware error - the BCM4311 rev
1613 -+ * 02, which uses 64-bit DMA, needs the ring buffer in very low memory,
1614 -+ * which accounts for the GFP_DMA flag below.
1615 -+ */
1616 -+ if (ring->dma64)
1617 -+ flags |= GFP_DMA;
1618 - ring->descbase = dma_alloc_coherent(dev, B43_DMA_RINGMEMSIZE,
1619 -- &(ring->dmabase), GFP_KERNEL);
1620 -+ &(ring->dmabase), flags);
1621 - if (!ring->descbase) {
1622 - b43err(ring->dev->wl, "DMA ringmemory allocation failed\n");
1623 - return -ENOMEM;
1624 -@@ -483,7 +495,7 @@ int b43_dmacontroller_rx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
1625 - return 0;
1626 - }
1627 -
1628 --/* Reset the RX DMA channel */
1629 -+/* Reset the TX DMA channel */
1630 - int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
1631 - {
1632 - int i;
1633 -@@ -647,7 +659,7 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
1634 - b43_dma_write(ring, B43_DMA64_TXRINGHI,
1635 - ((ringbase >> 32) &
1636 - ~SSB_DMA_TRANSLATION_MASK)
1637 -- | trans);
1638 -+ | (trans << 1));
1639 - } else {
1640 - u32 ringbase = (u32) (ring->dmabase);
1641 -
1642 -@@ -680,8 +692,9 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
1643 - b43_dma_write(ring, B43_DMA64_RXRINGHI,
1644 - ((ringbase >> 32) &
1645 - ~SSB_DMA_TRANSLATION_MASK)
1646 -- | trans);
1647 -- b43_dma_write(ring, B43_DMA64_RXINDEX, 200);
1648 -+ | (trans << 1));
1649 -+ b43_dma_write(ring, B43_DMA64_RXINDEX, ring->nr_slots *
1650 -+ sizeof(struct b43_dmadesc64));
1651 - } else {
1652 - u32 ringbase = (u32) (ring->dmabase);
1653 -
1654 -@@ -695,11 +708,12 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
1655 - b43_dma_write(ring, B43_DMA32_RXRING,
1656 - (ringbase & ~SSB_DMA_TRANSLATION_MASK)
1657 - | trans);
1658 -- b43_dma_write(ring, B43_DMA32_RXINDEX, 200);
1659 -+ b43_dma_write(ring, B43_DMA32_RXINDEX, ring->nr_slots *
1660 -+ sizeof(struct b43_dmadesc32));
1661 - }
1662 - }
1663 -
1664 -- out:
1665 -+out:
1666 - return err;
1667 - }
1668 -
1669 -diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
1670 -index 69795fd..36a1de2 100644
1671 ---- a/drivers/net/wireless/b43/main.c
1672 -+++ b/drivers/net/wireless/b43/main.c
1673 -@@ -101,6 +101,7 @@ static const struct ssb_device_id b43_ssb_tbl[] = {
1674 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 7),
1675 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 9),
1676 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 10),
1677 -+ SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 13),
1678 - SSB_DEVTABLE_END
1679 - };
1680 -
1681 -@@ -3079,7 +3080,7 @@ static int b43_phy_versioning(struct b43_wldev *dev)
1682 - unsupported = 1;
1683 - break;
1684 - case B43_PHYTYPE_G:
1685 -- if (phy_rev > 8)
1686 -+ if (phy_rev > 9)
1687 - unsupported = 1;
1688 - break;
1689 - default:
1690 -diff --git a/drivers/s390/char/defkeymap.c b/drivers/s390/char/defkeymap.c
1691 -index 389346c..07c7f31 100644
1692 ---- a/drivers/s390/char/defkeymap.c
1693 -+++ b/drivers/s390/char/defkeymap.c
1694 -@@ -151,8 +151,8 @@ char *func_table[MAX_NR_FUNC] = {
1695 - };
1696 -
1697 - struct kbdiacruc accent_table[MAX_DIACR] = {
1698 -- {'^', 'c', '\003'}, {'^', 'd', '\004'},
1699 -- {'^', 'z', '\032'}, {'^', '\012', '\000'},
1700 -+ {'^', 'c', 0003}, {'^', 'd', 0004},
1701 -+ {'^', 'z', 0032}, {'^', 0012, 0000},
1702 - };
1703 -
1704 - unsigned int accent_table_size = 4;
1705 -diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
1706 -index 38a1ee2..f40417b 100644
1707 ---- a/drivers/scsi/advansys.c
1708 -+++ b/drivers/scsi/advansys.c
1709 -@@ -566,7 +566,7 @@ typedef struct asc_dvc_var {
1710 - ASC_SCSI_BIT_ID_TYPE unit_not_ready;
1711 - ASC_SCSI_BIT_ID_TYPE queue_full_or_busy;
1712 - ASC_SCSI_BIT_ID_TYPE start_motor;
1713 -- uchar overrun_buf[ASC_OVERRUN_BSIZE] __aligned(8);
1714 -+ uchar *overrun_buf;
1715 - dma_addr_t overrun_dma;
1716 - uchar scsi_reset_wait;
1717 - uchar chip_no;
1718 -@@ -6439,7 +6439,7 @@ static int AdvLoadMicrocode(AdvPortAddr iop_base, unsigned char *buf, int size,
1719 - i += 2;
1720 - len += 2;
1721 - } else {
1722 -- unsigned char off = buf[i] * 2;
1723 -+ unsigned int off = buf[i] * 2;
1724 - unsigned short word = (buf[off + 1] << 8) | buf[off];
1725 - AdvWriteWordAutoIncLram(iop_base, word);
1726 - len += 2;
1727 -@@ -13833,6 +13833,12 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost,
1728 - */
1729 - if (ASC_NARROW_BOARD(boardp)) {
1730 - ASC_DBG(2, "AscInitAsc1000Driver()\n");
1731 -+
1732 -+ asc_dvc_varp->overrun_buf = kzalloc(ASC_OVERRUN_BSIZE, GFP_KERNEL);
1733 -+ if (!asc_dvc_varp->overrun_buf) {
1734 -+ ret = -ENOMEM;
1735 -+ goto err_free_wide_mem;
1736 -+ }
1737 - warn_code = AscInitAsc1000Driver(asc_dvc_varp);
1738 -
1739 - if (warn_code || asc_dvc_varp->err_code) {
1740 -@@ -13840,8 +13846,10 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost,
1741 - "warn 0x%x, error 0x%x\n",
1742 - asc_dvc_varp->init_state, warn_code,
1743 - asc_dvc_varp->err_code);
1744 -- if (asc_dvc_varp->err_code)
1745 -+ if (asc_dvc_varp->err_code) {
1746 - ret = -ENODEV;
1747 -+ kfree(asc_dvc_varp->overrun_buf);
1748 -+ }
1749 - }
1750 - } else {
1751 - if (advansys_wide_init_chip(shost))
1752 -@@ -13894,6 +13902,7 @@ static int advansys_release(struct Scsi_Host *shost)
1753 - dma_unmap_single(board->dev,
1754 - board->dvc_var.asc_dvc_var.overrun_dma,
1755 - ASC_OVERRUN_BSIZE, DMA_FROM_DEVICE);
1756 -+ kfree(board->dvc_var.asc_dvc_var.overrun_buf);
1757 - } else {
1758 - iounmap(board->ioremap_addr);
1759 - advansys_wide_free_mem(board);
1760 -diff --git a/drivers/scsi/aic94xx/aic94xx_scb.c b/drivers/scsi/aic94xx/aic94xx_scb.c
1761 -index db6ab1a..eae2d97 100644
1762 ---- a/drivers/scsi/aic94xx/aic94xx_scb.c
1763 -+++ b/drivers/scsi/aic94xx/aic94xx_scb.c
1764 -@@ -458,13 +458,19 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
1765 - tc_abort = le16_to_cpu(tc_abort);
1766 -
1767 - list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
1768 -- struct sas_task *task = ascb->uldd_task;
1769 -+ struct sas_task *task = a->uldd_task;
1770 -+
1771 -+ if (a->tc_index != tc_abort)
1772 -+ continue;
1773 -
1774 -- if (task && a->tc_index == tc_abort) {
1775 -+ if (task) {
1776 - failed_dev = task->dev;
1777 - sas_task_abort(task);
1778 -- break;
1779 -+ } else {
1780 -+ ASD_DPRINTK("R_T_A for non TASK scb 0x%x\n",
1781 -+ a->scb->header.opcode);
1782 - }
1783 -+ break;
1784 - }
1785 -
1786 - if (!failed_dev) {
1787 -@@ -478,7 +484,7 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
1788 - * that the EH will wake up and do something.
1789 - */
1790 - list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
1791 -- struct sas_task *task = ascb->uldd_task;
1792 -+ struct sas_task *task = a->uldd_task;
1793 -
1794 - if (task &&
1795 - task->dev == failed_dev &&
1796 -diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
1797 -index d466a2d..dcd6c9a 100644
1798 ---- a/drivers/scsi/arcmsr/arcmsr_hba.c
1799 -+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
1800 -@@ -1380,17 +1380,16 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
1801 - switch(controlcode) {
1802 -
1803 - case ARCMSR_MESSAGE_READ_RQBUFFER: {
1804 -- unsigned long *ver_addr;
1805 -- dma_addr_t buf_handle;
1806 -+ unsigned char *ver_addr;
1807 - uint8_t *pQbuffer, *ptmpQbuffer;
1808 - int32_t allxfer_len = 0;
1809 -
1810 -- ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
1811 -+ ver_addr = kmalloc(1032, GFP_ATOMIC);
1812 - if (!ver_addr) {
1813 - retvalue = ARCMSR_MESSAGE_FAIL;
1814 - goto message_out;
1815 - }
1816 -- ptmpQbuffer = (uint8_t *) ver_addr;
1817 -+ ptmpQbuffer = ver_addr;
1818 - while ((acb->rqbuf_firstindex != acb->rqbuf_lastindex)
1819 - && (allxfer_len < 1031)) {
1820 - pQbuffer = &acb->rqbuffer[acb->rqbuf_firstindex];
1821 -@@ -1419,25 +1418,24 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
1822 - }
1823 - arcmsr_iop_message_read(acb);
1824 - }
1825 -- memcpy(pcmdmessagefld->messagedatabuffer, (uint8_t *)ver_addr, allxfer_len);
1826 -+ memcpy(pcmdmessagefld->messagedatabuffer, ver_addr, allxfer_len);
1827 - pcmdmessagefld->cmdmessage.Length = allxfer_len;
1828 - pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK;
1829 -- pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
1830 -+ kfree(ver_addr);
1831 - }
1832 - break;
1833 -
1834 - case ARCMSR_MESSAGE_WRITE_WQBUFFER: {
1835 -- unsigned long *ver_addr;
1836 -- dma_addr_t buf_handle;
1837 -+ unsigned char *ver_addr;
1838 - int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex;
1839 - uint8_t *pQbuffer, *ptmpuserbuffer;
1840 -
1841 -- ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
1842 -+ ver_addr = kmalloc(1032, GFP_ATOMIC);
1843 - if (!ver_addr) {
1844 - retvalue = ARCMSR_MESSAGE_FAIL;
1845 - goto message_out;
1846 - }
1847 -- ptmpuserbuffer = (uint8_t *)ver_addr;
1848 -+ ptmpuserbuffer = ver_addr;
1849 - user_len = pcmdmessagefld->cmdmessage.Length;
1850 - memcpy(ptmpuserbuffer, pcmdmessagefld->messagedatabuffer, user_len);
1851 - wqbuf_lastindex = acb->wqbuf_lastindex;
1852 -@@ -1483,7 +1481,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
1853 - retvalue = ARCMSR_MESSAGE_FAIL;
1854 - }
1855 - }
1856 -- pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
1857 -+ kfree(ver_addr);
1858 - }
1859 - break;
1860 -
1861 -diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
1862 -index 8eb78be..b8b67f6 100644
1863 ---- a/drivers/scsi/gdth.c
1864 -+++ b/drivers/scsi/gdth.c
1865 -@@ -160,7 +160,7 @@ static void gdth_readapp_event(gdth_ha_str *ha, unchar application,
1866 - static void gdth_clear_events(void);
1867 -
1868 - static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
1869 -- char *buffer, ushort count, int to_buffer);
1870 -+ char *buffer, ushort count);
1871 - static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp);
1872 - static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, ushort hdrive);
1873 -
1874 -@@ -183,7 +183,6 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
1875 - unsigned int cmd, unsigned long arg);
1876 -
1877 - static void gdth_flush(gdth_ha_str *ha);
1878 --static int gdth_halt(struct notifier_block *nb, ulong event, void *buf);
1879 - static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *));
1880 - static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,
1881 - struct gdth_cmndinfo *cmndinfo);
1882 -@@ -418,12 +417,6 @@ static inline void gdth_set_sglist(struct scsi_cmnd *cmd,
1883 - #include "gdth_proc.h"
1884 - #include "gdth_proc.c"
1885 -
1886 --/* notifier block to get a notify on system shutdown/halt/reboot */
1887 --static struct notifier_block gdth_notifier = {
1888 -- gdth_halt, NULL, 0
1889 --};
1890 --static int notifier_disabled = 0;
1891 --
1892 - static gdth_ha_str *gdth_find_ha(int hanum)
1893 - {
1894 - gdth_ha_str *ha;
1895 -@@ -446,8 +439,8 @@ static struct gdth_cmndinfo *gdth_get_cmndinfo(gdth_ha_str *ha)
1896 - for (i=0; i<GDTH_MAXCMDS; ++i) {
1897 - if (ha->cmndinfo[i].index == 0) {
1898 - priv = &ha->cmndinfo[i];
1899 -- priv->index = i+1;
1900 - memset(priv, 0, sizeof(*priv));
1901 -+ priv->index = i+1;
1902 - break;
1903 - }
1904 - }
1905 -@@ -494,7 +487,6 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
1906 - gdth_ha_str *ha = shost_priv(sdev->host);
1907 - Scsi_Cmnd *scp;
1908 - struct gdth_cmndinfo cmndinfo;
1909 -- struct scatterlist one_sg;
1910 - DECLARE_COMPLETION_ONSTACK(wait);
1911 - int rval;
1912 -
1913 -@@ -508,13 +500,10 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
1914 - /* use request field to save the ptr. to completion struct. */
1915 - scp->request = (struct request *)&wait;
1916 - scp->timeout_per_command = timeout*HZ;
1917 -- sg_init_one(&one_sg, gdtcmd, sizeof(*gdtcmd));
1918 -- gdth_set_sglist(scp, &one_sg);
1919 -- gdth_set_sg_count(scp, 1);
1920 -- gdth_set_bufflen(scp, sizeof(*gdtcmd));
1921 - scp->cmd_len = 12;
1922 - memcpy(scp->cmnd, cmnd, 12);
1923 - cmndinfo.priority = IOCTL_PRI;
1924 -+ cmndinfo.internal_cmd_str = gdtcmd;
1925 - cmndinfo.internal_command = 1;
1926 -
1927 - TRACE(("__gdth_execute() cmd 0x%x\n", scp->cmnd[0]));
1928 -@@ -2355,7 +2344,7 @@ static void gdth_next(gdth_ha_str *ha)
1929 - * buffers, kmap_atomic() as needed.
1930 - */
1931 - static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
1932 -- char *buffer, ushort count, int to_buffer)
1933 -+ char *buffer, ushort count)
1934 - {
1935 - ushort cpcount,i, max_sg = gdth_sg_count(scp);
1936 - ushort cpsum,cpnow;
1937 -@@ -2381,10 +2370,7 @@ static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
1938 - }
1939 - local_irq_save(flags);
1940 - address = kmap_atomic(sg_page(sl), KM_BIO_SRC_IRQ) + sl->offset;
1941 -- if (to_buffer)
1942 -- memcpy(buffer, address, cpnow);
1943 -- else
1944 -- memcpy(address, buffer, cpnow);
1945 -+ memcpy(address, buffer, cpnow);
1946 - flush_dcache_page(sg_page(sl));
1947 - kunmap_atomic(address, KM_BIO_SRC_IRQ);
1948 - local_irq_restore(flags);
1949 -@@ -2438,7 +2424,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1950 - strcpy(inq.vendor,ha->oem_name);
1951 - sprintf(inq.product,"Host Drive #%02d",t);
1952 - strcpy(inq.revision," ");
1953 -- gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data), 0);
1954 -+ gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data));
1955 - break;
1956 -
1957 - case REQUEST_SENSE:
1958 -@@ -2448,7 +2434,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1959 - sd.key = NO_SENSE;
1960 - sd.info = 0;
1961 - sd.add_length= 0;
1962 -- gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data), 0);
1963 -+ gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data));
1964 - break;
1965 -
1966 - case MODE_SENSE:
1967 -@@ -2460,7 +2446,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1968 - mpd.bd.block_length[0] = (SECTOR_SIZE & 0x00ff0000) >> 16;
1969 - mpd.bd.block_length[1] = (SECTOR_SIZE & 0x0000ff00) >> 8;
1970 - mpd.bd.block_length[2] = (SECTOR_SIZE & 0x000000ff);
1971 -- gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data), 0);
1972 -+ gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data));
1973 - break;
1974 -
1975 - case READ_CAPACITY:
1976 -@@ -2470,7 +2456,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1977 - else
1978 - rdc.last_block_no = cpu_to_be32(ha->hdr[t].size-1);
1979 - rdc.block_length = cpu_to_be32(SECTOR_SIZE);
1980 -- gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data), 0);
1981 -+ gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data));
1982 - break;
1983 -
1984 - case SERVICE_ACTION_IN:
1985 -@@ -2482,7 +2468,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1986 - rdc16.last_block_no = cpu_to_be64(ha->hdr[t].size-1);
1987 - rdc16.block_length = cpu_to_be32(SECTOR_SIZE);
1988 - gdth_copy_internal_data(ha, scp, (char*)&rdc16,
1989 -- sizeof(gdth_rdcap16_data), 0);
1990 -+ sizeof(gdth_rdcap16_data));
1991 - } else {
1992 - scp->result = DID_ABORT << 16;
1993 - }
1994 -@@ -2852,6 +2838,7 @@ static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b)
1995 - static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1996 - {
1997 - register gdth_cmd_str *cmdp;
1998 -+ struct gdth_cmndinfo *cmndinfo = gdth_cmnd_priv(scp);
1999 - int cmd_index;
2000 -
2001 - cmdp= ha->pccb;
2002 -@@ -2860,7 +2847,7 @@ static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
2003 - if (ha->type==GDT_EISA && ha->cmd_cnt>0)
2004 - return 0;
2005 -
2006 -- gdth_copy_internal_data(ha, scp, (char *)cmdp, sizeof(gdth_cmd_str), 1);
2007 -+ *cmdp = *cmndinfo->internal_cmd_str;
2008 - cmdp->RequestBuffer = scp;
2009 -
2010 - /* search free command index */
2011 -@@ -3793,6 +3780,8 @@ static void gdth_timeout(ulong data)
2012 - gdth_ha_str *ha;
2013 - ulong flags;
2014 -
2015 -+ BUG_ON(list_empty(&gdth_instances));
2016 -+
2017 - ha = list_first_entry(&gdth_instances, gdth_ha_str, list);
2018 - spin_lock_irqsave(&ha->smp_lock, flags);
2019 -
2020 -@@ -4668,45 +4657,6 @@ static void gdth_flush(gdth_ha_str *ha)
2021 - }
2022 - }
2023 -
2024 --/* shutdown routine */
2025 --static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
2026 --{
2027 -- gdth_ha_str *ha;
2028 --#ifndef __alpha__
2029 -- gdth_cmd_str gdtcmd;
2030 -- char cmnd[MAX_COMMAND_SIZE];
2031 --#endif
2032 --
2033 -- if (notifier_disabled)
2034 -- return NOTIFY_OK;
2035 --
2036 -- TRACE2(("gdth_halt() event %d\n",(int)event));
2037 -- if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
2038 -- return NOTIFY_DONE;
2039 --
2040 -- notifier_disabled = 1;
2041 -- printk("GDT-HA: Flushing all host drives .. ");
2042 -- list_for_each_entry(ha, &gdth_instances, list) {
2043 -- gdth_flush(ha);
2044 --
2045 --#ifndef __alpha__
2046 -- /* controller reset */
2047 -- memset(cmnd, 0xff, MAX_COMMAND_SIZE);
2048 -- gdtcmd.BoardNode = LOCALBOARD;
2049 -- gdtcmd.Service = CACHESERVICE;
2050 -- gdtcmd.OpCode = GDT_RESET;
2051 -- TRACE2(("gdth_halt(): reset controller %d\n", ha->hanum));
2052 -- gdth_execute(ha->shost, &gdtcmd, cmnd, 10, NULL);
2053 --#endif
2054 -- }
2055 -- printk("Done.\n");
2056 --
2057 --#ifdef GDTH_STATISTICS
2058 -- del_timer(&gdth_timer);
2059 --#endif
2060 -- return NOTIFY_OK;
2061 --}
2062 --
2063 - /* configure lun */
2064 - static int gdth_slave_configure(struct scsi_device *sdev)
2065 - {
2066 -@@ -5141,13 +5091,13 @@ static void gdth_remove_one(gdth_ha_str *ha)
2067 -
2068 - scsi_remove_host(shp);
2069 -
2070 -+ gdth_flush(ha);
2071 -+
2072 - if (ha->sdev) {
2073 - scsi_free_host_dev(ha->sdev);
2074 - ha->sdev = NULL;
2075 - }
2076 -
2077 -- gdth_flush(ha);
2078 --
2079 - if (shp->irq)
2080 - free_irq(shp->irq,ha);
2081 -
2082 -@@ -5173,6 +5123,24 @@ static void gdth_remove_one(gdth_ha_str *ha)
2083 - scsi_host_put(shp);
2084 - }
2085 -
2086 -+static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
2087 -+{
2088 -+ gdth_ha_str *ha;
2089 -+
2090 -+ TRACE2(("gdth_halt() event %d\n", (int)event));
2091 -+ if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
2092 -+ return NOTIFY_DONE;
2093 -+
2094 -+ list_for_each_entry(ha, &gdth_instances, list)
2095 -+ gdth_flush(ha);
2096 -+
2097 -+ return NOTIFY_OK;
2098 -+}
2099 -+
2100 -+static struct notifier_block gdth_notifier = {
2101 -+ gdth_halt, NULL, 0
2102 -+};
2103 -+
2104 - static int __init gdth_init(void)
2105 - {
2106 - if (disable) {
2107 -@@ -5235,7 +5203,6 @@ static int __init gdth_init(void)
2108 - add_timer(&gdth_timer);
2109 - #endif
2110 - major = register_chrdev(0,"gdth", &gdth_fops);
2111 -- notifier_disabled = 0;
2112 - register_reboot_notifier(&gdth_notifier);
2113 - gdth_polling = FALSE;
2114 - return 0;
2115 -@@ -5245,14 +5212,15 @@ static void __exit gdth_exit(void)
2116 - {
2117 - gdth_ha_str *ha;
2118 -
2119 -- list_for_each_entry(ha, &gdth_instances, list)
2120 -- gdth_remove_one(ha);
2121 -+ unregister_chrdev(major, "gdth");
2122 -+ unregister_reboot_notifier(&gdth_notifier);
2123 -
2124 - #ifdef GDTH_STATISTICS
2125 -- del_timer(&gdth_timer);
2126 -+ del_timer_sync(&gdth_timer);
2127 - #endif
2128 -- unregister_chrdev(major,"gdth");
2129 -- unregister_reboot_notifier(&gdth_notifier);
2130 -+
2131 -+ list_for_each_entry(ha, &gdth_instances, list)
2132 -+ gdth_remove_one(ha);
2133 - }
2134 -
2135 - module_init(gdth_init);
2136 -diff --git a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h
2137 -index 1434c6b..26e4e92 100644
2138 ---- a/drivers/scsi/gdth.h
2139 -+++ b/drivers/scsi/gdth.h
2140 -@@ -915,6 +915,7 @@ typedef struct {
2141 - struct gdth_cmndinfo { /* per-command private info */
2142 - int index;
2143 - int internal_command; /* don't call scsi_done */
2144 -+ gdth_cmd_str *internal_cmd_str; /* crier for internal messages*/
2145 - dma_addr_t sense_paddr; /* sense dma-addr */
2146 - unchar priority;
2147 - int timeout;
2148 -diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
2149 -index de57734..ce0228e 100644
2150 ---- a/drivers/scsi/gdth_proc.c
2151 -+++ b/drivers/scsi/gdth_proc.c
2152 -@@ -694,15 +694,13 @@ static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, ulong64 paddr)
2153 - {
2154 - ulong flags;
2155 -
2156 -- spin_lock_irqsave(&ha->smp_lock, flags);
2157 --
2158 - if (buf == ha->pscratch) {
2159 -+ spin_lock_irqsave(&ha->smp_lock, flags);
2160 - ha->scratch_busy = FALSE;
2161 -+ spin_unlock_irqrestore(&ha->smp_lock, flags);
2162 - } else {
2163 - pci_free_consistent(ha->pdev, size, buf, paddr);
2164 - }
2165 --
2166 -- spin_unlock_irqrestore(&ha->smp_lock, flags);
2167 - }
2168 -
2169 - #ifdef GDTH_IOCTL_PROC
2170 -diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
2171 -index 5c5a9b2..f4e9c8d 100644
2172 ---- a/drivers/scsi/ips.c
2173 -+++ b/drivers/scsi/ips.c
2174 -@@ -1580,7 +1580,7 @@ ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr)
2175 - METHOD_TRACE("ips_make_passthru", 1);
2176 -
2177 - scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i)
2178 -- length += sg[i].length;
2179 -+ length += sg->length;
2180 -
2181 - if (length < sizeof (ips_passthru_t)) {
2182 - /* wrong size */
2183 -@@ -6842,13 +6842,10 @@ ips_register_scsi(int index)
2184 - if (request_irq(ha->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) {
2185 - IPS_PRINTK(KERN_WARNING, ha->pcidev,
2186 - "Unable to install interrupt handler\n");
2187 -- scsi_host_put(sh);
2188 -- return -1;
2189 -+ goto err_out_sh;
2190 - }
2191 -
2192 - kfree(oldha);
2193 -- ips_sh[index] = sh;
2194 -- ips_ha[index] = ha;
2195 -
2196 - /* Store away needed values for later use */
2197 - sh->io_port = ha->io_addr;
2198 -@@ -6867,10 +6864,21 @@ ips_register_scsi(int index)
2199 - sh->max_channel = ha->nbus - 1;
2200 - sh->can_queue = ha->max_cmds - 1;
2201 -
2202 -- scsi_add_host(sh, NULL);
2203 -+ if (scsi_add_host(sh, &ha->pcidev->dev))
2204 -+ goto err_out;
2205 -+
2206 -+ ips_sh[index] = sh;
2207 -+ ips_ha[index] = ha;
2208 -+
2209 - scsi_scan_host(sh);
2210 -
2211 - return 0;
2212 -+
2213 -+err_out:
2214 -+ free_irq(ha->pcidev->irq, ha);
2215 -+err_out_sh:
2216 -+ scsi_host_put(sh);
2217 -+ return -1;
2218 - }
2219 -
2220 - /*---------------------------------------------------------------------------*/
2221 -diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
2222 -index a9ac5b1..273728e 100644
2223 ---- a/drivers/scsi/scsi_lib.c
2224 -+++ b/drivers/scsi/scsi_lib.c
2225 -@@ -298,7 +298,6 @@ static int scsi_req_map_sg(struct request *rq, struct scatterlist *sgl,
2226 - page = sg_page(sg);
2227 - off = sg->offset;
2228 - len = sg->length;
2229 -- data_len += len;
2230 -
2231 - while (len > 0 && data_len > 0) {
2232 - /*
2233 -diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
2234 -index ff10808..e9d7959 100644
2235 ---- a/drivers/spi/atmel_spi.c
2236 -+++ b/drivers/spi/atmel_spi.c
2237 -@@ -85,6 +85,16 @@ static void cs_activate(struct atmel_spi *as, struct spi_device *spi)
2238 - unsigned gpio = (unsigned) spi->controller_data;
2239 - unsigned active = spi->mode & SPI_CS_HIGH;
2240 - u32 mr;
2241 -+ int i;
2242 -+ u32 csr;
2243 -+ u32 cpol = (spi->mode & SPI_CPOL) ? SPI_BIT(CPOL) : 0;
2244 -+
2245 -+ /* Make sure clock polarity is correct */
2246 -+ for (i = 0; i < spi->master->num_chipselect; i++) {
2247 -+ csr = spi_readl(as, CSR0 + 4 * i);
2248 -+ if ((csr ^ cpol) & SPI_BIT(CPOL))
2249 -+ spi_writel(as, CSR0 + 4 * i, csr ^ SPI_BIT(CPOL));
2250 -+ }
2251 -
2252 - mr = spi_readl(as, MR);
2253 - mr = SPI_BFINS(PCS, ~(1 << spi->chip_select), mr);
2254 -diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
2255 -index 1c2ab54..840e682 100644
2256 ---- a/drivers/spi/pxa2xx_spi.c
2257 -+++ b/drivers/spi/pxa2xx_spi.c
2258 -@@ -48,13 +48,19 @@ MODULE_LICENSE("GPL");
2259 - #define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK)
2260 - #define IS_DMA_ALIGNED(x) (((u32)(x)&0x07)==0)
2261 -
2262 --/* for testing SSCR1 changes that require SSP restart, basically
2263 -- * everything except the service and interrupt enables */
2264 --#define SSCR1_CHANGE_MASK (SSCR1_TTELP | SSCR1_TTE | SSCR1_EBCEI | SSCR1_SCFR \
2265 -+/*
2266 -+ * for testing SSCR1 changes that require SSP restart, basically
2267 -+ * everything except the service and interrupt enables, the pxa270 developer
2268 -+ * manual says only SSCR1_SCFR, SSCR1_SPH, SSCR1_SPO need to be in this
2269 -+ * list, but the PXA255 dev man says all bits without really meaning the
2270 -+ * service and interrupt enables
2271 -+ */
2272 -+#define SSCR1_CHANGE_MASK (SSCR1_TTELP | SSCR1_TTE | SSCR1_SCFR \
2273 - | SSCR1_ECRA | SSCR1_ECRB | SSCR1_SCLKDIR \
2274 -- | SSCR1_RWOT | SSCR1_TRAIL | SSCR1_PINTE \
2275 -- | SSCR1_STRF | SSCR1_EFWR |SSCR1_RFT \
2276 -- | SSCR1_TFT | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM)
2277 -+ | SSCR1_SFRMDIR | SSCR1_RWOT | SSCR1_TRAIL \
2278 -+ | SSCR1_IFS | SSCR1_STRF | SSCR1_EFWR \
2279 -+ | SSCR1_RFT | SSCR1_TFT | SSCR1_MWDS \
2280 -+ | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM)
2281 -
2282 - #define DEFINE_SSP_REG(reg, off) \
2283 - static inline u32 read_##reg(void *p) { return __raw_readl(p + (off)); } \
2284 -@@ -961,9 +967,6 @@ static void pump_transfers(unsigned long data)
2285 - if (drv_data->ssp_type == PXA25x_SSP)
2286 - DCMD(drv_data->tx_channel) |= DCMD_ENDIRQEN;
2287 -
2288 -- /* Fix me, need to handle cs polarity */
2289 -- drv_data->cs_control(PXA2XX_CS_ASSERT);
2290 --
2291 - /* Clear status and start DMA engine */
2292 - cr1 = chip->cr1 | dma_thresh | drv_data->dma_cr1;
2293 - write_SSSR(drv_data->clear_sr, reg);
2294 -@@ -973,9 +976,6 @@ static void pump_transfers(unsigned long data)
2295 - /* Ensure we have the correct interrupt handler */
2296 - drv_data->transfer_handler = interrupt_transfer;
2297 -
2298 -- /* Fix me, need to handle cs polarity */
2299 -- drv_data->cs_control(PXA2XX_CS_ASSERT);
2300 --
2301 - /* Clear status */
2302 - cr1 = chip->cr1 | chip->threshold | drv_data->int_cr1;
2303 - write_SSSR(drv_data->clear_sr, reg);
2304 -@@ -986,16 +986,29 @@ static void pump_transfers(unsigned long data)
2305 - || (read_SSCR1(reg) & SSCR1_CHANGE_MASK) !=
2306 - (cr1 & SSCR1_CHANGE_MASK)) {
2307 -
2308 -+ /* stop the SSP, and update the other bits */
2309 - write_SSCR0(cr0 & ~SSCR0_SSE, reg);
2310 - if (drv_data->ssp_type != PXA25x_SSP)
2311 - write_SSTO(chip->timeout, reg);
2312 -- write_SSCR1(cr1, reg);
2313 -+ /* first set CR1 without interrupt and service enables */
2314 -+ write_SSCR1(cr1 & SSCR1_CHANGE_MASK, reg);
2315 -+ /* restart the SSP */
2316 - write_SSCR0(cr0, reg);
2317 -+
2318 - } else {
2319 - if (drv_data->ssp_type != PXA25x_SSP)
2320 - write_SSTO(chip->timeout, reg);
2321 -- write_SSCR1(cr1, reg);
2322 - }
2323 -+
2324 -+ /* FIXME, need to handle cs polarity,
2325 -+ * this driver uses struct pxa2xx_spi_chip.cs_control to
2326 -+ * specify a CS handling function, and it ignores most
2327 -+ * struct spi_device.mode[s], including SPI_CS_HIGH */
2328 -+ drv_data->cs_control(PXA2XX_CS_ASSERT);
2329 -+
2330 -+ /* after chip select, release the data by enabling service
2331 -+ * requests and interrupts, without changing any mode bits */
2332 -+ write_SSCR1(cr1, reg);
2333 - }
2334 -
2335 - static void pump_messages(struct work_struct *work)
2336 -diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
2337 -index b10f39c..d1df9e9 100644
2338 ---- a/drivers/usb/host/ehci-q.c
2339 -+++ b/drivers/usb/host/ehci-q.c
2340 -@@ -315,10 +315,10 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
2341 - if (likely (last->urb != urb)) {
2342 - ehci_urb_done(ehci, last->urb, last_status);
2343 - count++;
2344 -+ last_status = -EINPROGRESS;
2345 - }
2346 - ehci_qtd_free (ehci, last);
2347 - last = NULL;
2348 -- last_status = -EINPROGRESS;
2349 - }
2350 -
2351 - /* ignore urbs submitted during completions we reported */
2352 -diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
2353 -index 1382af9..c04beac 100644
2354 ---- a/drivers/usb/serial/ftdi_sio.c
2355 -+++ b/drivers/usb/serial/ftdi_sio.c
2356 -@@ -310,6 +310,7 @@ struct ftdi_sio_quirk {
2357 - };
2358 -
2359 - static int ftdi_olimex_probe (struct usb_serial *serial);
2360 -+static int ftdi_mtxorb_hack_setup (struct usb_serial *serial);
2361 - static void ftdi_USB_UIRT_setup (struct ftdi_private *priv);
2362 - static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv);
2363 -
2364 -@@ -317,6 +318,10 @@ static struct ftdi_sio_quirk ftdi_olimex_quirk = {
2365 - .probe = ftdi_olimex_probe,
2366 - };
2367 -
2368 -+static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = {
2369 -+ .probe = ftdi_mtxorb_hack_setup,
2370 -+};
2371 -+
2372 - static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
2373 - .port_probe = ftdi_USB_UIRT_setup,
2374 - };
2375 -@@ -379,6 +384,8 @@ static struct usb_device_id id_table_combined [] = {
2376 - { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) },
2377 - { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) },
2378 - { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
2379 -+ { USB_DEVICE(MTXORB_VK_VID, MTXORB_VK_PID),
2380 -+ .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
2381 - { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
2382 - { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
2383 - { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
2384 -@@ -492,6 +499,7 @@ static struct usb_device_id id_table_combined [] = {
2385 - { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) },
2386 - { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) },
2387 - { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) },
2388 -+ { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) },
2389 - { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) },
2390 - { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) },
2391 - { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) },
2392 -@@ -1301,6 +1309,23 @@ static int ftdi_olimex_probe(struct usb_serial *serial)
2393 - return 0;
2394 - }
2395 -
2396 -+/*
2397 -+ * The Matrix Orbital VK204-25-USB has an invalid IN endpoint.
2398 -+ * We have to correct it if we want to read from it.
2399 -+ */
2400 -+static int ftdi_mtxorb_hack_setup(struct usb_serial *serial)
2401 -+{
2402 -+ struct usb_host_endpoint *ep = serial->dev->ep_in[1];
2403 -+ struct usb_endpoint_descriptor *ep_desc = &ep->desc;
2404 -+
2405 -+ if (ep->enabled && ep_desc->wMaxPacketSize == 0) {
2406 -+ ep_desc->wMaxPacketSize = 0x40;
2407 -+ info("Fixing invalid wMaxPacketSize on read pipe");
2408 -+ }
2409 -+
2410 -+ return 0;
2411 -+}
2412 -+
2413 - /* ftdi_shutdown is called from usbserial:usb_serial_disconnect
2414 - * it is called when the usb device is disconnected
2415 - *
2416 -diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
2417 -index f6053da..893b429 100644
2418 ---- a/drivers/usb/serial/ftdi_sio.h
2419 -+++ b/drivers/usb/serial/ftdi_sio.h
2420 -@@ -98,6 +98,13 @@
2421 - #define FTDI_MTXORB_5_PID 0xFA05 /* Matrix Orbital Product Id */
2422 - #define FTDI_MTXORB_6_PID 0xFA06 /* Matrix Orbital Product Id */
2423 -
2424 -+/*
2425 -+ * The following are the values for the Matrix Orbital VK204-25-USB
2426 -+ * display, which use the FT232RL.
2427 -+ */
2428 -+#define MTXORB_VK_VID 0x1b3d
2429 -+#define MTXORB_VK_PID 0x0158
2430 -+
2431 - /* Interbiometrics USB I/O Board */
2432 - /* Developed for Interbiometrics by Rudolf Gugler */
2433 - #define INTERBIOMETRICS_VID 0x1209
2434 -diff --git a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c
2435 -index 889622b..45262f3 100644
2436 ---- a/drivers/usb/storage/protocol.c
2437 -+++ b/drivers/usb/storage/protocol.c
2438 -@@ -194,7 +194,7 @@ unsigned int usb_stor_access_xfer_buf(unsigned char *buffer,
2439 - * and the starting offset within the page, and update
2440 - * the *offset and *index values for the next loop. */
2441 - cnt = 0;
2442 -- while (cnt < buflen) {
2443 -+ while (cnt < buflen && sg) {
2444 - struct page *page = sg_page(sg) +
2445 - ((sg->offset + *offset) >> PAGE_SHIFT);
2446 - unsigned int poff =
2447 -@@ -249,7 +249,8 @@ void usb_stor_set_xfer_buf(unsigned char *buffer,
2448 - unsigned int offset = 0;
2449 - struct scatterlist *sg = NULL;
2450 -
2451 -- usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset,
2452 -+ buflen = min(buflen, srb->request_bufflen);
2453 -+ buflen = usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset,
2454 - TO_XFER_BUF);
2455 - if (buflen < srb->request_bufflen)
2456 - srb->resid = srb->request_bufflen - buflen;
2457 -diff --git a/fs/aio.c b/fs/aio.c
2458 -index 9dec7d2..758f911 100644
2459 ---- a/fs/aio.c
2460 -+++ b/fs/aio.c
2461 -@@ -997,6 +997,14 @@ put_rq:
2462 - /* everything turned out well, dispose of the aiocb. */
2463 - ret = __aio_put_req(ctx, iocb);
2464 -
2465 -+ /*
2466 -+ * We have to order our ring_info tail store above and test
2467 -+ * of the wait list below outside the wait lock. This is
2468 -+ * like in wake_up_bit() where clearing a bit has to be
2469 -+ * ordered with the unlocked test.
2470 -+ */
2471 -+ smp_mb();
2472 -+
2473 - if (waitqueue_active(&ctx->wait))
2474 - wake_up(&ctx->wait);
2475 -
2476 -diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
2477 -index 32c5711..a985a8f 100644
2478 ---- a/fs/ecryptfs/mmap.c
2479 -+++ b/fs/ecryptfs/mmap.c
2480 -@@ -263,52 +263,102 @@ out:
2481 - return 0;
2482 - }
2483 -
2484 --/* This function must zero any hole we create */
2485 -+/**
2486 -+ * ecryptfs_prepare_write
2487 -+ * @file: The eCryptfs file
2488 -+ * @page: The eCryptfs page
2489 -+ * @from: The start byte from which we will write
2490 -+ * @to: The end byte to which we will write
2491 -+ *
2492 -+ * This function must zero any hole we create
2493 -+ *
2494 -+ * Returns zero on success; non-zero otherwise
2495 -+ */
2496 - static int ecryptfs_prepare_write(struct file *file, struct page *page,
2497 - unsigned from, unsigned to)
2498 - {
2499 -- int rc = 0;
2500 - loff_t prev_page_end_size;
2501 -+ int rc = 0;
2502 -
2503 - if (!PageUptodate(page)) {
2504 -- rc = ecryptfs_read_lower_page_segment(page, page->index, 0,
2505 -- PAGE_CACHE_SIZE,
2506 -- page->mapping->host);
2507 -- if (rc) {
2508 -- printk(KERN_ERR "%s: Error attemping to read lower "
2509 -- "page segment; rc = [%d]\n", __FUNCTION__, rc);
2510 -- ClearPageUptodate(page);
2511 -- goto out;
2512 -- } else
2513 -+ struct ecryptfs_crypt_stat *crypt_stat =
2514 -+ &ecryptfs_inode_to_private(
2515 -+ file->f_path.dentry->d_inode)->crypt_stat;
2516 -+
2517 -+ if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)
2518 -+ || (crypt_stat->flags & ECRYPTFS_NEW_FILE)) {
2519 -+ rc = ecryptfs_read_lower_page_segment(
2520 -+ page, page->index, 0, PAGE_CACHE_SIZE,
2521 -+ page->mapping->host);
2522 -+ if (rc) {
2523 -+ printk(KERN_ERR "%s: Error attemping to read "
2524 -+ "lower page segment; rc = [%d]\n",
2525 -+ __FUNCTION__, rc);
2526 -+ ClearPageUptodate(page);
2527 -+ goto out;
2528 -+ } else
2529 -+ SetPageUptodate(page);
2530 -+ } else if (crypt_stat->flags & ECRYPTFS_VIEW_AS_ENCRYPTED) {
2531 -+ if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) {
2532 -+ rc = ecryptfs_copy_up_encrypted_with_header(
2533 -+ page, crypt_stat);
2534 -+ if (rc) {
2535 -+ printk(KERN_ERR "%s: Error attempting "
2536 -+ "to copy the encrypted content "
2537 -+ "from the lower file whilst "
2538 -+ "inserting the metadata from "
2539 -+ "the xattr into the header; rc "
2540 -+ "= [%d]\n", __FUNCTION__, rc);
2541 -+ ClearPageUptodate(page);
2542 -+ goto out;
2543 -+ }
2544 -+ SetPageUptodate(page);
2545 -+ } else {
2546 -+ rc = ecryptfs_read_lower_page_segment(
2547 -+ page, page->index, 0, PAGE_CACHE_SIZE,
2548 -+ page->mapping->host);
2549 -+ if (rc) {
2550 -+ printk(KERN_ERR "%s: Error reading "
2551 -+ "page; rc = [%d]\n",
2552 -+ __FUNCTION__, rc);
2553 -+ ClearPageUptodate(page);
2554 -+ goto out;
2555 -+ }
2556 -+ SetPageUptodate(page);
2557 -+ }
2558 -+ } else {
2559 -+ rc = ecryptfs_decrypt_page(page);
2560 -+ if (rc) {
2561 -+ printk(KERN_ERR "%s: Error decrypting page "
2562 -+ "at index [%ld]; rc = [%d]\n",
2563 -+ __FUNCTION__, page->index, rc);
2564 -+ ClearPageUptodate(page);
2565 -+ goto out;
2566 -+ }
2567 - SetPageUptodate(page);
2568 -+ }
2569 - }
2570 --
2571 - prev_page_end_size = ((loff_t)page->index << PAGE_CACHE_SHIFT);
2572 --
2573 -- /*
2574 -- * If creating a page or more of holes, zero them out via truncate.
2575 -- * Note, this will increase i_size.
2576 -- */
2577 -+ /* If creating a page or more of holes, zero them out via truncate.
2578 -+ * Note, this will increase i_size. */
2579 - if (page->index != 0) {
2580 - if (prev_page_end_size > i_size_read(page->mapping->host)) {
2581 - rc = ecryptfs_truncate(file->f_path.dentry,
2582 - prev_page_end_size);
2583 - if (rc) {
2584 -- printk(KERN_ERR "Error on attempt to "
2585 -+ printk(KERN_ERR "%s: Error on attempt to "
2586 - "truncate to (higher) offset [%lld];"
2587 -- " rc = [%d]\n", prev_page_end_size, rc);
2588 -+ " rc = [%d]\n", __FUNCTION__,
2589 -+ prev_page_end_size, rc);
2590 - goto out;
2591 - }
2592 - }
2593 - }
2594 -- /*
2595 -- * Writing to a new page, and creating a small hole from start of page?
2596 -- * Zero it out.
2597 -- */
2598 -- if ((i_size_read(page->mapping->host) == prev_page_end_size) &&
2599 -- (from != 0)) {
2600 -+ /* Writing to a new page, and creating a small hole from start
2601 -+ * of page? Zero it out. */
2602 -+ if ((i_size_read(page->mapping->host) == prev_page_end_size)
2603 -+ && (from != 0))
2604 - zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
2605 -- }
2606 - out:
2607 - return rc;
2608 - }
2609 -diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
2610 -index 80d2f52..dcac591 100644
2611 ---- a/fs/fuse/dir.c
2612 -+++ b/fs/fuse/dir.c
2613 -@@ -905,7 +905,7 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd)
2614 - }
2615 -
2616 - if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {
2617 -- int err = generic_permission(inode, mask, NULL);
2618 -+ err = generic_permission(inode, mask, NULL);
2619 -
2620 - /* If permission is denied, try to refresh file
2621 - attributes. This is also needed, because the root
2622 -diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c
2623 -index 37dbd64..defb932 100644
2624 ---- a/fs/isofs/compress.c
2625 -+++ b/fs/isofs/compress.c
2626 -@@ -72,6 +72,17 @@ static int zisofs_readpage(struct file *file, struct page *page)
2627 - offset = index & ~zisofs_block_page_mask;
2628 - blockindex = offset >> zisofs_block_page_shift;
2629 - maxpage = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
2630 -+
2631 -+ /*
2632 -+ * If this page is wholly outside i_size we just return zero;
2633 -+ * do_generic_file_read() will handle this for us
2634 -+ */
2635 -+ if (page->index >= maxpage) {
2636 -+ SetPageUptodate(page);
2637 -+ unlock_page(page);
2638 -+ return 0;
2639 -+ }
2640 -+
2641 - maxpage = min(zisofs_block_pages, maxpage-offset);
2642 -
2643 - for ( i = 0 ; i < maxpage ; i++, offset++ ) {
2644 -diff --git a/fs/jbd/recovery.c b/fs/jbd/recovery.c
2645 -index c5d9694..9aaa4fa 100644
2646 ---- a/fs/jbd/recovery.c
2647 -+++ b/fs/jbd/recovery.c
2648 -@@ -478,7 +478,7 @@ static int do_one_pass(journal_t *journal,
2649 - memcpy(nbh->b_data, obh->b_data,
2650 - journal->j_blocksize);
2651 - if (flags & JFS_FLAG_ESCAPE) {
2652 -- *((__be32 *)bh->b_data) =
2653 -+ *((__be32 *)nbh->b_data) =
2654 - cpu_to_be32(JFS_MAGIC_NUMBER);
2655 - }
2656 -
2657 -diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
2658 -index d0ce627..fa0d4e9 100644
2659 ---- a/fs/jbd2/recovery.c
2660 -+++ b/fs/jbd2/recovery.c
2661 -@@ -488,7 +488,7 @@ static int do_one_pass(journal_t *journal,
2662 - memcpy(nbh->b_data, obh->b_data,
2663 - journal->j_blocksize);
2664 - if (flags & JBD2_FLAG_ESCAPE) {
2665 -- *((__be32 *)bh->b_data) =
2666 -+ *((__be32 *)nbh->b_data) =
2667 - cpu_to_be32(JBD2_MAGIC_NUMBER);
2668 - }
2669 -
2670 -diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
2671 -index 468f17a..429cec2 100644
2672 ---- a/fs/nfsd/nfsfh.c
2673 -+++ b/fs/nfsd/nfsfh.c
2674 -@@ -231,6 +231,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
2675 - fhp->fh_dentry = dentry;
2676 - fhp->fh_export = exp;
2677 - nfsd_nr_verified++;
2678 -+ cache_get(&exp->h);
2679 - } else {
2680 - /*
2681 - * just rechecking permissions
2682 -@@ -240,6 +241,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
2683 - dprintk("nfsd: fh_verify - just checking\n");
2684 - dentry = fhp->fh_dentry;
2685 - exp = fhp->fh_export;
2686 -+ cache_get(&exp->h);
2687 - /*
2688 - * Set user creds for this exportpoint; necessary even
2689 - * in the "just checking" case because this may be a
2690 -@@ -251,8 +253,6 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
2691 - if (error)
2692 - goto out;
2693 - }
2694 -- cache_get(&exp->h);
2695 --
2696 -
2697 - error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type);
2698 - if (error)
2699 -diff --git a/fs/ufs/util.h b/fs/ufs/util.h
2700 -index b26fc4d..23ceed8 100644
2701 ---- a/fs/ufs/util.h
2702 -+++ b/fs/ufs/util.h
2703 -@@ -58,7 +58,7 @@ ufs_set_fs_state(struct super_block *sb, struct ufs_super_block_first *usb1,
2704 - {
2705 - switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
2706 - case UFS_ST_SUNOS:
2707 -- if (fs32_to_cpu(sb, usb3->fs_postblformat == UFS_42POSTBLFMT)) {
2708 -+ if (fs32_to_cpu(sb, usb3->fs_postblformat) == UFS_42POSTBLFMT) {
2709 - usb1->fs_u0.fs_sun.fs_state = cpu_to_fs32(sb, value);
2710 - break;
2711 - }
2712 -diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
2713 -index 1bd398d..c12c294 100644
2714 ---- a/include/asm-arm/arch-pxa/pxa-regs.h
2715 -+++ b/include/asm-arm/arch-pxa/pxa-regs.h
2716 -@@ -1669,6 +1669,7 @@
2717 - #define SSCR1_RSRE (1 << 20) /* Receive Service Request Enable */
2718 - #define SSCR1_TINTE (1 << 19) /* Receiver Time-out Interrupt enable */
2719 - #define SSCR1_PINTE (1 << 18) /* Peripheral Trailing Byte Interupt Enable */
2720 -+#define SSCR1_IFS (1 << 16) /* Invert Frame Signal */
2721 - #define SSCR1_STRF (1 << 15) /* Select FIFO or EFWR */
2722 - #define SSCR1_EFWR (1 << 14) /* Enable FIFO Write/Read */
2723 -
2724 -diff --git a/include/asm-x86/apic_32.h b/include/asm-x86/apic_32.h
2725 -index be158b2..04fbe7f 100644
2726 ---- a/include/asm-x86/apic_32.h
2727 -+++ b/include/asm-x86/apic_32.h
2728 -@@ -109,7 +109,7 @@ extern void setup_boot_APIC_clock (void);
2729 - extern void setup_secondary_APIC_clock (void);
2730 - extern int APIC_init_uniprocessor (void);
2731 -
2732 --extern void enable_NMI_through_LVT0 (void * dummy);
2733 -+extern void enable_NMI_through_LVT0(void);
2734 -
2735 - #define ARCH_APICTIMER_STOPS_ON_C3 1
2736 -
2737 -diff --git a/include/asm-x86/futex_32.h b/include/asm-x86/futex_32.h
2738 -index 438ef0e..80964fd 100644
2739 ---- a/include/asm-x86/futex_32.h
2740 -+++ b/include/asm-x86/futex_32.h
2741 -@@ -28,7 +28,7 @@
2742 - "1: movl %2, %0\n\
2743 - movl %0, %3\n" \
2744 - insn "\n" \
2745 --"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\
2746 -+"2: lock ; cmpxchgl %3, %2\n\
2747 - jnz 1b\n\
2748 - 3: .section .fixup,\"ax\"\n\
2749 - 4: mov %5, %1\n\
2750 -@@ -68,7 +68,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
2751 - #endif
2752 - switch (op) {
2753 - case FUTEX_OP_ADD:
2754 -- __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret,
2755 -+ __futex_atomic_op1("lock ; xaddl %0, %2", ret,
2756 - oldval, uaddr, oparg);
2757 - break;
2758 - case FUTEX_OP_OR:
2759 -@@ -111,7 +111,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
2760 - return -EFAULT;
2761 -
2762 - __asm__ __volatile__(
2763 -- "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n"
2764 -+ "1: lock ; cmpxchgl %3, %1 \n"
2765 -
2766 - "2: .section .fixup, \"ax\" \n"
2767 - "3: mov %2, %0 \n"
2768 -diff --git a/include/asm-x86/futex_64.h b/include/asm-x86/futex_64.h
2769 -index 5cdfb08..423c051 100644
2770 ---- a/include/asm-x86/futex_64.h
2771 -+++ b/include/asm-x86/futex_64.h
2772 -@@ -27,7 +27,7 @@
2773 - "1: movl %2, %0\n\
2774 - movl %0, %3\n" \
2775 - insn "\n" \
2776 --"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\
2777 -+"2: lock ; cmpxchgl %3, %2\n\
2778 - jnz 1b\n\
2779 - 3: .section .fixup,\"ax\"\n\
2780 - 4: mov %5, %1\n\
2781 -@@ -62,7 +62,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
2782 - __futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg);
2783 - break;
2784 - case FUTEX_OP_ADD:
2785 -- __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, oldval,
2786 -+ __futex_atomic_op1("lock ; xaddl %0, %2", ret, oldval,
2787 - uaddr, oparg);
2788 - break;
2789 - case FUTEX_OP_OR:
2790 -@@ -101,7 +101,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
2791 - return -EFAULT;
2792 -
2793 - __asm__ __volatile__(
2794 -- "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n"
2795 -+ "1: lock ; cmpxchgl %3, %1 \n"
2796 -
2797 - "2: .section .fixup, \"ax\" \n"
2798 - "3: mov %2, %0 \n"
2799 -diff --git a/include/asm-x86/io_apic_64.h b/include/asm-x86/io_apic_64.h
2800 -index e2c1367..1913ad0 100644
2801 ---- a/include/asm-x86/io_apic_64.h
2802 -+++ b/include/asm-x86/io_apic_64.h
2803 -@@ -129,7 +129,7 @@ extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int);
2804 -
2805 - extern int sis_apic_bug; /* dummy */
2806 -
2807 --void enable_NMI_through_LVT0 (void * dummy);
2808 -+void enable_NMI_through_LVT0(void);
2809 -
2810 - extern spinlock_t i8259A_lock;
2811 -
2812 -diff --git a/include/asm-x86/processor_32.h b/include/asm-x86/processor_32.h
2813 -index 13976b0..787ee2e 100644
2814 ---- a/include/asm-x86/processor_32.h
2815 -+++ b/include/asm-x86/processor_32.h
2816 -@@ -712,9 +712,10 @@ static inline unsigned int cpuid_edx(unsigned int op)
2817 - #define ASM_NOP6 K7_NOP6
2818 - #define ASM_NOP7 K7_NOP7
2819 - #define ASM_NOP8 K7_NOP8
2820 --#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
2821 -+#elif (defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
2822 - defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \
2823 -- defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)
2824 -+ defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)) && \
2825 -+ !defined(CONFIG_X86_GENERIC)
2826 - #define ASM_NOP1 P6_NOP1
2827 - #define ASM_NOP2 P6_NOP2
2828 - #define ASM_NOP3 P6_NOP3
2829 -diff --git a/include/linux/Kbuild b/include/linux/Kbuild
2830 -index 4b32bb1..f30fa92 100644
2831 ---- a/include/linux/Kbuild
2832 -+++ b/include/linux/Kbuild
2833 -@@ -217,7 +217,6 @@ unifdef-y += i2o-dev.h
2834 - unifdef-y += icmp.h
2835 - unifdef-y += icmpv6.h
2836 - unifdef-y += if_addr.h
2837 --unifdef-y += if_addrlabel.h
2838 - unifdef-y += if_arp.h
2839 - unifdef-y += if_bridge.h
2840 - unifdef-y += if_ec.h
2841 -diff --git a/include/linux/futex.h b/include/linux/futex.h
2842 -index 92d420f..e5f3b84 100644
2843 ---- a/include/linux/futex.h
2844 -+++ b/include/linux/futex.h
2845 -@@ -153,6 +153,7 @@ union futex_key {
2846 - #ifdef CONFIG_FUTEX
2847 - extern void exit_robust_list(struct task_struct *curr);
2848 - extern void exit_pi_state_list(struct task_struct *curr);
2849 -+extern int futex_cmpxchg_enabled;
2850 - #else
2851 - static inline void exit_robust_list(struct task_struct *curr)
2852 - {
2853 -diff --git a/include/linux/irq.h b/include/linux/irq.h
2854 -index 4669be0..1fc1cb8 100644
2855 ---- a/include/linux/irq.h
2856 -+++ b/include/linux/irq.h
2857 -@@ -367,6 +367,9 @@ set_irq_chained_handler(unsigned int irq,
2858 - __set_irq_handler(irq, handle, 1, NULL);
2859 - }
2860 -
2861 -+extern void set_irq_noprobe(unsigned int irq);
2862 -+extern void set_irq_probe(unsigned int irq);
2863 -+
2864 - /* Handle dynamic irq creation and destruction */
2865 - extern int create_irq(void);
2866 - extern void destroy_irq(unsigned int irq);
2867 -diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
2868 -index 13410b2..c1d64c2 100644
2869 ---- a/include/linux/moduleparam.h
2870 -+++ b/include/linux/moduleparam.h
2871 -@@ -62,6 +62,16 @@ struct kparam_array
2872 - void *elem;
2873 - };
2874 -
2875 -+/* On alpha, ia64 and ppc64 relocations to global data cannot go into
2876 -+ read-only sections (which is part of respective UNIX ABI on these
2877 -+ platforms). So 'const' makes no sense and even causes compile failures
2878 -+ with some compilers. */
2879 -+#if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64)
2880 -+#define __moduleparam_const
2881 -+#else
2882 -+#define __moduleparam_const const
2883 -+#endif
2884 -+
2885 - /* This is the fundamental function for registering boot/module
2886 - parameters. perm sets the visibility in sysfs: 000 means it's
2887 - not there, read bits mean it's readable, write bits mean it's
2888 -@@ -71,7 +81,7 @@ struct kparam_array
2889 - static int __param_perm_check_##name __attribute__((unused)) = \
2890 - BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \
2891 - static const char __param_str_##name[] = prefix #name; \
2892 -- static struct kernel_param const __param_##name \
2893 -+ static struct kernel_param __moduleparam_const __param_##name \
2894 - __attribute_used__ \
2895 - __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
2896 - = { __param_str_##name, perm, set, get, { arg } }
2897 -diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
2898 -index 70013c5..89cd011 100644
2899 ---- a/include/net/inet_sock.h
2900 -+++ b/include/net/inet_sock.h
2901 -@@ -175,7 +175,8 @@ extern void build_ehash_secret(void);
2902 - static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport,
2903 - const __be32 faddr, const __be16 fport)
2904 - {
2905 -- return jhash_2words((__force __u32) laddr ^ (__force __u32) faddr,
2906 -+ return jhash_3words((__force __u32) laddr,
2907 -+ (__force __u32) faddr,
2908 - ((__u32) lport) << 16 | (__force __u32)fport,
2909 - inet_ehash_secret);
2910 - }
2911 -diff --git a/kernel/futex.c b/kernel/futex.c
2912 -index 55d78b5..d166080 100644
2913 ---- a/kernel/futex.c
2914 -+++ b/kernel/futex.c
2915 -@@ -60,6 +60,8 @@
2916 -
2917 - #include "rtmutex_common.h"
2918 -
2919 -+int __read_mostly futex_cmpxchg_enabled;
2920 -+
2921 - #define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8)
2922 -
2923 - /*
2924 -@@ -466,6 +468,8 @@ void exit_pi_state_list(struct task_struct *curr)
2925 - struct futex_hash_bucket *hb;
2926 - union futex_key key;
2927 -
2928 -+ if (!futex_cmpxchg_enabled)
2929 -+ return;
2930 - /*
2931 - * We are a ZOMBIE and nobody can enqueue itself on
2932 - * pi_state_list anymore, but we have to be careful
2933 -@@ -1854,6 +1858,8 @@ asmlinkage long
2934 - sys_set_robust_list(struct robust_list_head __user *head,
2935 - size_t len)
2936 - {
2937 -+ if (!futex_cmpxchg_enabled)
2938 -+ return -ENOSYS;
2939 - /*
2940 - * The kernel knows only one size for now:
2941 - */
2942 -@@ -1878,6 +1884,9 @@ sys_get_robust_list(int pid, struct robust_list_head __user * __user *head_ptr,
2943 - struct robust_list_head __user *head;
2944 - unsigned long ret;
2945 -
2946 -+ if (!futex_cmpxchg_enabled)
2947 -+ return -ENOSYS;
2948 -+
2949 - if (!pid)
2950 - head = current->robust_list;
2951 - else {
2952 -@@ -1980,6 +1989,9 @@ void exit_robust_list(struct task_struct *curr)
2953 - unsigned long futex_offset;
2954 - int rc;
2955 -
2956 -+ if (!futex_cmpxchg_enabled)
2957 -+ return;
2958 -+
2959 - /*
2960 - * Fetch the list head (which was registered earlier, via
2961 - * sys_set_robust_list()):
2962 -@@ -2034,7 +2046,7 @@ void exit_robust_list(struct task_struct *curr)
2963 - long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
2964 - u32 __user *uaddr2, u32 val2, u32 val3)
2965 - {
2966 -- int ret;
2967 -+ int ret = -ENOSYS;
2968 - int cmd = op & FUTEX_CMD_MASK;
2969 - struct rw_semaphore *fshared = NULL;
2970 -
2971 -@@ -2062,13 +2074,16 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
2972 - ret = futex_wake_op(uaddr, fshared, uaddr2, val, val2, val3);
2973 - break;
2974 - case FUTEX_LOCK_PI:
2975 -- ret = futex_lock_pi(uaddr, fshared, val, timeout, 0);
2976 -+ if (futex_cmpxchg_enabled)
2977 -+ ret = futex_lock_pi(uaddr, fshared, val, timeout, 0);
2978 - break;
2979 - case FUTEX_UNLOCK_PI:
2980 -- ret = futex_unlock_pi(uaddr, fshared);
2981 -+ if (futex_cmpxchg_enabled)
2982 -+ ret = futex_unlock_pi(uaddr, fshared);
2983 - break;
2984 - case FUTEX_TRYLOCK_PI:
2985 -- ret = futex_lock_pi(uaddr, fshared, 0, timeout, 1);
2986 -+ if (futex_cmpxchg_enabled)
2987 -+ ret = futex_lock_pi(uaddr, fshared, 0, timeout, 1);
2988 - break;
2989 - default:
2990 - ret = -ENOSYS;
2991 -@@ -2123,8 +2138,29 @@ static struct file_system_type futex_fs_type = {
2992 -
2993 - static int __init init(void)
2994 - {
2995 -- int i = register_filesystem(&futex_fs_type);
2996 -+ u32 curval;
2997 -+ int i;
2998 -+
2999 -+ /*
3000 -+ * This will fail and we want it. Some arch implementations do
3001 -+ * runtime detection of the futex_atomic_cmpxchg_inatomic()
3002 -+ * functionality. We want to know that before we call in any
3003 -+ * of the complex code paths. Also we want to prevent
3004 -+ * registration of robust lists in that case. NULL is
3005 -+ * guaranteed to fault and we get -EFAULT on functional
3006 -+ * implementation, the non functional ones will return
3007 -+ * -ENOSYS.
3008 -+ */
3009 -+ curval = cmpxchg_futex_value_locked(NULL, 0, 0);
3010 -+ if (curval == -EFAULT)
3011 -+ futex_cmpxchg_enabled = 1;
3012 -
3013 -+ for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
3014 -+ plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
3015 -+ spin_lock_init(&futex_queues[i].lock);
3016 -+ }
3017 -+
3018 -+ i = register_filesystem(&futex_fs_type);
3019 - if (i)
3020 - return i;
3021 -
3022 -@@ -2134,10 +2170,6 @@ static int __init init(void)
3023 - return PTR_ERR(futex_mnt);
3024 - }
3025 -
3026 -- for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
3027 -- plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
3028 -- spin_lock_init(&futex_queues[i].lock);
3029 -- }
3030 - return 0;
3031 - }
3032 - __initcall(init);
3033 -diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
3034 -index 8682c79..d95f79b 100644
3035 ---- a/kernel/futex_compat.c
3036 -+++ b/kernel/futex_compat.c
3037 -@@ -54,6 +54,9 @@ void compat_exit_robust_list(struct task_struct *curr)
3038 - compat_long_t futex_offset;
3039 - int rc;
3040 -
3041 -+ if (!futex_cmpxchg_enabled)
3042 -+ return;
3043 -+
3044 - /*
3045 - * Fetch the list head (which was registered earlier, via
3046 - * sys_set_robust_list()):
3047 -@@ -115,6 +118,9 @@ asmlinkage long
3048 - compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
3049 - compat_size_t len)
3050 - {
3051 -+ if (!futex_cmpxchg_enabled)
3052 -+ return -ENOSYS;
3053 -+
3054 - if (unlikely(len != sizeof(*head)))
3055 - return -EINVAL;
3056 -
3057 -@@ -130,6 +136,9 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
3058 - struct compat_robust_list_head __user *head;
3059 - unsigned long ret;
3060 -
3061 -+ if (!futex_cmpxchg_enabled)
3062 -+ return -ENOSYS;
3063 -+
3064 - if (!pid)
3065 - head = current->compat_robust_list;
3066 - else {
3067 -diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
3068 -index 465c69c..e4e1c99 100644
3069 ---- a/kernel/irq/chip.c
3070 -+++ b/kernel/irq/chip.c
3071 -@@ -607,3 +607,39 @@ set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
3072 - set_irq_chip(irq, chip);
3073 - __set_irq_handler(irq, handle, 0, name);
3074 - }
3075 -+
3076 -+void __init set_irq_noprobe(unsigned int irq)
3077 -+{
3078 -+ struct irq_desc *desc;
3079 -+ unsigned long flags;
3080 -+
3081 -+ if (irq >= NR_IRQS) {
3082 -+ printk(KERN_ERR "Trying to mark IRQ%d non-probeable\n", irq);
3083 -+
3084 -+ return;
3085 -+ }
3086 -+
3087 -+ desc = irq_desc + irq;
3088 -+
3089 -+ spin_lock_irqsave(&desc->lock, flags);
3090 -+ desc->status |= IRQ_NOPROBE;
3091 -+ spin_unlock_irqrestore(&desc->lock, flags);
3092 -+}
3093 -+
3094 -+void __init set_irq_probe(unsigned int irq)
3095 -+{
3096 -+ struct irq_desc *desc;
3097 -+ unsigned long flags;
3098 -+
3099 -+ if (irq >= NR_IRQS) {
3100 -+ printk(KERN_ERR "Trying to mark IRQ%d probeable\n", irq);
3101 -+
3102 -+ return;
3103 -+ }
3104 -+
3105 -+ desc = irq_desc + irq;
3106 -+
3107 -+ spin_lock_irqsave(&desc->lock, flags);
3108 -+ desc->status &= ~IRQ_NOPROBE;
3109 -+ spin_unlock_irqrestore(&desc->lock, flags);
3110 -+}
3111 -diff --git a/kernel/relay.c b/kernel/relay.c
3112 -index 7c03733..889102a 100644
3113 ---- a/kernel/relay.c
3114 -+++ b/kernel/relay.c
3115 -@@ -1072,7 +1072,7 @@ static int subbuf_splice_actor(struct file *in,
3116 - unsigned int flags,
3117 - int *nonpad_ret)
3118 - {
3119 -- unsigned int pidx, poff, total_len, subbuf_pages, ret;
3120 -+ unsigned int pidx, poff, total_len, subbuf_pages, nr_pages, ret;
3121 - struct rchan_buf *rbuf = in->private_data;
3122 - unsigned int subbuf_size = rbuf->chan->subbuf_size;
3123 - uint64_t pos = (uint64_t) *ppos;
3124 -@@ -1103,8 +1103,9 @@ static int subbuf_splice_actor(struct file *in,
3125 - subbuf_pages = rbuf->chan->alloc_size >> PAGE_SHIFT;
3126 - pidx = (read_start / PAGE_SIZE) % subbuf_pages;
3127 - poff = read_start & ~PAGE_MASK;
3128 -+ nr_pages = min_t(unsigned int, subbuf_pages, PIPE_BUFFERS);
3129 -
3130 -- for (total_len = 0; spd.nr_pages < subbuf_pages; spd.nr_pages++) {
3131 -+ for (total_len = 0; spd.nr_pages < nr_pages; spd.nr_pages++) {
3132 - unsigned int this_len, this_end, private;
3133 - unsigned int cur_pos = read_start + total_len;
3134 -
3135 -diff --git a/kernel/sched.c b/kernel/sched.c
3136 -index e76b11c..5ba5db9 100644
3137 ---- a/kernel/sched.c
3138 -+++ b/kernel/sched.c
3139 -@@ -4028,11 +4028,10 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
3140 - oldprio = p->prio;
3141 - on_rq = p->se.on_rq;
3142 - running = task_current(rq, p);
3143 -- if (on_rq) {
3144 -+ if (on_rq)
3145 - dequeue_task(rq, p, 0);
3146 -- if (running)
3147 -- p->sched_class->put_prev_task(rq, p);
3148 -- }
3149 -+ if (running)
3150 -+ p->sched_class->put_prev_task(rq, p);
3151 -
3152 - if (rt_prio(prio))
3153 - p->sched_class = &rt_sched_class;
3154 -@@ -4041,9 +4040,9 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
3155 -
3156 - p->prio = prio;
3157 -
3158 -+ if (running)
3159 -+ p->sched_class->set_curr_task(rq);
3160 - if (on_rq) {
3161 -- if (running)
3162 -- p->sched_class->set_curr_task(rq);
3163 - enqueue_task(rq, p, 0);
3164 - /*
3165 - * Reschedule if we are currently running on this runqueue and
3166 -@@ -4339,18 +4338,17 @@ recheck:
3167 - update_rq_clock(rq);
3168 - on_rq = p->se.on_rq;
3169 - running = task_current(rq, p);
3170 -- if (on_rq) {
3171 -+ if (on_rq)
3172 - deactivate_task(rq, p, 0);
3173 -- if (running)
3174 -- p->sched_class->put_prev_task(rq, p);
3175 -- }
3176 -+ if (running)
3177 -+ p->sched_class->put_prev_task(rq, p);
3178 -
3179 - oldprio = p->prio;
3180 - __setscheduler(rq, p, policy, param->sched_priority);
3181 -
3182 -+ if (running)
3183 -+ p->sched_class->set_curr_task(rq);
3184 - if (on_rq) {
3185 -- if (running)
3186 -- p->sched_class->set_curr_task(rq);
3187 - activate_task(rq, p, 0);
3188 - /*
3189 - * Reschedule if we are currently running on this runqueue and
3190 -@@ -7110,19 +7108,17 @@ void sched_move_task(struct task_struct *tsk)
3191 - running = task_current(rq, tsk);
3192 - on_rq = tsk->se.on_rq;
3193 -
3194 -- if (on_rq) {
3195 -+ if (on_rq)
3196 - dequeue_task(rq, tsk, 0);
3197 -- if (unlikely(running))
3198 -- tsk->sched_class->put_prev_task(rq, tsk);
3199 -- }
3200 -+ if (unlikely(running))
3201 -+ tsk->sched_class->put_prev_task(rq, tsk);
3202 -
3203 - set_task_cfs_rq(tsk, task_cpu(tsk));
3204 -
3205 -- if (on_rq) {
3206 -- if (unlikely(running))
3207 -- tsk->sched_class->set_curr_task(rq);
3208 -+ if (unlikely(running))
3209 -+ tsk->sched_class->set_curr_task(rq);
3210 -+ if (on_rq)
3211 - enqueue_task(rq, tsk, 0);
3212 -- }
3213 -
3214 - done:
3215 - task_rq_unlock(rq, &flags);
3216 -diff --git a/kernel/sysctl.c b/kernel/sysctl.c
3217 -index e3e0ee3..397ff8c 100644
3218 ---- a/kernel/sysctl.c
3219 -+++ b/kernel/sysctl.c
3220 -@@ -306,7 +306,7 @@ static struct ctl_table kern_table[] = {
3221 - .procname = "sched_nr_migrate",
3222 - .data = &sysctl_sched_nr_migrate,
3223 - .maxlen = sizeof(unsigned int),
3224 -- .mode = 644,
3225 -+ .mode = 0644,
3226 - .proc_handler = &proc_dointvec,
3227 - },
3228 - #endif
3229 -diff --git a/mm/filemap.c b/mm/filemap.c
3230 -index 69430d2..76b036f 100644
3231 ---- a/mm/filemap.c
3232 -+++ b/mm/filemap.c
3233 -@@ -1725,21 +1725,27 @@ size_t iov_iter_copy_from_user(struct page *page,
3234 - }
3235 - EXPORT_SYMBOL(iov_iter_copy_from_user);
3236 -
3237 --static void __iov_iter_advance_iov(struct iov_iter *i, size_t bytes)
3238 -+void iov_iter_advance(struct iov_iter *i, size_t bytes)
3239 - {
3240 -+ BUG_ON(i->count < bytes);
3241 -+
3242 - if (likely(i->nr_segs == 1)) {
3243 - i->iov_offset += bytes;
3244 -+ i->count -= bytes;
3245 - } else {
3246 - const struct iovec *iov = i->iov;
3247 - size_t base = i->iov_offset;
3248 -
3249 - /*
3250 - * The !iov->iov_len check ensures we skip over unlikely
3251 -- * zero-length segments.
3252 -+ * zero-length segments (without overruning the iovec).
3253 - */
3254 -- while (bytes || !iov->iov_len) {
3255 -- int copy = min(bytes, iov->iov_len - base);
3256 -+ while (bytes || unlikely(!iov->iov_len && i->count)) {
3257 -+ int copy;
3258 -
3259 -+ copy = min(bytes, iov->iov_len - base);
3260 -+ BUG_ON(!i->count || i->count < copy);
3261 -+ i->count -= copy;
3262 - bytes -= copy;
3263 - base += copy;
3264 - if (iov->iov_len == base) {
3265 -@@ -1751,14 +1757,6 @@ static void __iov_iter_advance_iov(struct iov_iter *i, size_t bytes)
3266 - i->iov_offset = base;
3267 - }
3268 - }
3269 --
3270 --void iov_iter_advance(struct iov_iter *i, size_t bytes)
3271 --{
3272 -- BUG_ON(i->count < bytes);
3273 --
3274 -- __iov_iter_advance_iov(i, bytes);
3275 -- i->count -= bytes;
3276 --}
3277 - EXPORT_SYMBOL(iov_iter_advance);
3278 -
3279 - /*
3280 -diff --git a/mm/hugetlb.c b/mm/hugetlb.c
3281 -index 9c746cb..d95ce35 100644
3282 ---- a/mm/hugetlb.c
3283 -+++ b/mm/hugetlb.c
3284 -@@ -119,6 +119,7 @@ static void free_huge_page(struct page *page)
3285 - struct address_space *mapping;
3286 -
3287 - mapping = (struct address_space *) page_private(page);
3288 -+ set_page_private(page, 0);
3289 - BUG_ON(page_count(page));
3290 - INIT_LIST_HEAD(&page->lru);
3291 -
3292 -@@ -133,7 +134,6 @@ static void free_huge_page(struct page *page)
3293 - spin_unlock(&hugetlb_lock);
3294 - if (mapping)
3295 - hugetlb_put_quota(mapping, 1);
3296 -- set_page_private(page, 0);
3297 - }
3298 -
3299 - /*
3300 -diff --git a/mm/slab.c b/mm/slab.c
3301 -index ff31261..79c3be0 100644
3302 ---- a/mm/slab.c
3303 -+++ b/mm/slab.c
3304 -@@ -2961,11 +2961,10 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags)
3305 - struct array_cache *ac;
3306 - int node;
3307 -
3308 -- node = numa_node_id();
3309 --
3310 -+retry:
3311 - check_irq_off();
3312 -+ node = numa_node_id();
3313 - ac = cpu_cache_get(cachep);
3314 --retry:
3315 - batchcount = ac->batchcount;
3316 - if (!ac->touched && batchcount > BATCHREFILL_LIMIT) {
3317 - /*
3318 -diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
3319 -index 2726adc..e13cf5e 100644
3320 ---- a/net/bluetooth/hci_sysfs.c
3321 -+++ b/net/bluetooth/hci_sysfs.c
3322 -@@ -282,6 +282,7 @@ static void add_conn(struct work_struct *work)
3323 - int i;
3324 -
3325 - flush_workqueue(btdelconn);
3326 -+
3327 - if (device_add(&conn->dev) < 0) {
3328 - BT_ERR("Failed to register connection device");
3329 - return;
3330 -@@ -317,7 +318,6 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
3331 - INIT_WORK(&conn->work, add_conn);
3332 -
3333 - queue_work(btaddconn, &conn->work);
3334 -- schedule_work(&conn->work);
3335 - }
3336 -
3337 - static int __match_tty(struct device *dev, void *data)
3338 -@@ -354,7 +354,6 @@ void hci_conn_del_sysfs(struct hci_conn *conn)
3339 - INIT_WORK(&conn->work, del_conn);
3340 -
3341 - queue_work(btdelconn, &conn->work);
3342 -- schedule_work(&conn->work);
3343 - }
3344 -
3345 - int hci_register_sysfs(struct hci_dev *hdev)
3346 -@@ -408,6 +407,7 @@ int __init bt_sysfs_init(void)
3347 - err = -ENOMEM;
3348 - goto out;
3349 - }
3350 -+
3351 - btdelconn = create_singlethread_workqueue("btdelconn");
3352 - if (!btdelconn) {
3353 - err = -ENOMEM;
3354 -@@ -447,8 +447,12 @@ out:
3355 - void bt_sysfs_cleanup(void)
3356 - {
3357 - destroy_workqueue(btaddconn);
3358 -+
3359 - destroy_workqueue(btdelconn);
3360 -+
3361 - class_destroy(bt_class);
3362 -+
3363 - bus_unregister(&bt_bus);
3364 -+
3365 - platform_device_unregister(bt_platform);
3366 - }
3367 -diff --git a/net/bridge/netfilter/ebt_dnat.c b/net/bridge/netfilter/ebt_dnat.c
3368 -index 74262e9..1024511 100644
3369 ---- a/net/bridge/netfilter/ebt_dnat.c
3370 -+++ b/net/bridge/netfilter/ebt_dnat.c
3371 -@@ -20,8 +20,8 @@ static int ebt_target_dnat(struct sk_buff *skb, unsigned int hooknr,
3372 - {
3373 - struct ebt_nat_info *info = (struct ebt_nat_info *)data;
3374 -
3375 -- if (skb_make_writable(skb, 0))
3376 -- return NF_DROP;
3377 -+ if (!skb_make_writable(skb, 0))
3378 -+ return EBT_DROP;
3379 -
3380 - memcpy(eth_hdr(skb)->h_dest, info->mac, ETH_ALEN);
3381 - return info->target;
3382 -diff --git a/net/bridge/netfilter/ebt_redirect.c b/net/bridge/netfilter/ebt_redirect.c
3383 -index 422cb83..88afc34 100644
3384 ---- a/net/bridge/netfilter/ebt_redirect.c
3385 -+++ b/net/bridge/netfilter/ebt_redirect.c
3386 -@@ -21,8 +21,8 @@ static int ebt_target_redirect(struct sk_buff *skb, unsigned int hooknr,
3387 - {
3388 - struct ebt_redirect_info *info = (struct ebt_redirect_info *)data;
3389 -
3390 -- if (skb_make_writable(skb, 0))
3391 -- return NF_DROP;
3392 -+ if (!skb_make_writable(skb, 0))
3393 -+ return EBT_DROP;
3394 -
3395 - if (hooknr != NF_BR_BROUTING)
3396 - memcpy(eth_hdr(skb)->h_dest,
3397 -diff --git a/net/bridge/netfilter/ebt_snat.c b/net/bridge/netfilter/ebt_snat.c
3398 -index 425ac92..4c5a5a9 100644
3399 ---- a/net/bridge/netfilter/ebt_snat.c
3400 -+++ b/net/bridge/netfilter/ebt_snat.c
3401 -@@ -22,8 +22,8 @@ static int ebt_target_snat(struct sk_buff *skb, unsigned int hooknr,
3402 - {
3403 - struct ebt_nat_info *info = (struct ebt_nat_info *) data;
3404 -
3405 -- if (skb_make_writable(skb, 0))
3406 -- return NF_DROP;
3407 -+ if (!skb_make_writable(skb, 0))
3408 -+ return EBT_DROP;
3409 -
3410 - memcpy(eth_hdr(skb)->h_source, info->mac, ETH_ALEN);
3411 - if (!(info->target & NAT_ARP_BIT) &&
3412 -diff --git a/net/core/dev.c b/net/core/dev.c
3413 -index 0879f52..4d44372 100644
3414 ---- a/net/core/dev.c
3415 -+++ b/net/core/dev.c
3416 -@@ -1068,8 +1068,6 @@ int dev_close(struct net_device *dev)
3417 - */
3418 - call_netdevice_notifiers(NETDEV_GOING_DOWN, dev);
3419 -
3420 -- dev_deactivate(dev);
3421 --
3422 - clear_bit(__LINK_STATE_START, &dev->state);
3423 -
3424 - /* Synchronize to scheduled poll. We cannot touch poll list,
3425 -@@ -1080,6 +1078,8 @@ int dev_close(struct net_device *dev)
3426 - */
3427 - smp_mb__after_clear_bit(); /* Commit netif_running(). */
3428 -
3429 -+ dev_deactivate(dev);
3430 -+
3431 - /*
3432 - * Call the device specific close. This cannot fail.
3433 - * Only if device is UP
3434 -@@ -2906,7 +2906,7 @@ int __dev_addr_add(struct dev_addr_list **list, int *count,
3435 - }
3436 - }
3437 -
3438 -- da = kmalloc(sizeof(*da), GFP_ATOMIC);
3439 -+ da = kzalloc(sizeof(*da), GFP_ATOMIC);
3440 - if (da == NULL)
3441 - return -ENOMEM;
3442 - memcpy(da->da_addr, addr, alen);
3443 -diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
3444 -index 82817e5..7794e17 100644
3445 ---- a/net/ipv4/ip_sockglue.c
3446 -+++ b/net/ipv4/ip_sockglue.c
3447 -@@ -514,11 +514,6 @@ static int do_ip_setsockopt(struct sock *sk, int level,
3448 - val &= ~3;
3449 - val |= inet->tos & 3;
3450 - }
3451 -- if (IPTOS_PREC(val) >= IPTOS_PREC_CRITIC_ECP &&
3452 -- !capable(CAP_NET_ADMIN)) {
3453 -- err = -EPERM;
3454 -- break;
3455 -- }
3456 - if (inet->tos != val) {
3457 - inet->tos = val;
3458 - sk->sk_priority = rt_tos2priority(val);
3459 -diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
3460 -index 80cab8c..b284b4e 100644
3461 ---- a/net/ipv4/ipcomp.c
3462 -+++ b/net/ipv4/ipcomp.c
3463 -@@ -108,8 +108,11 @@ static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb)
3464 - const int cpu = get_cpu();
3465 - u8 *scratch = *per_cpu_ptr(ipcomp_scratches, cpu);
3466 - struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu);
3467 -- int err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
3468 -+ int err;
3469 -
3470 -+ local_bh_disable();
3471 -+ err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
3472 -+ local_bh_enable();
3473 - if (err)
3474 - goto out;
3475 -
3476 -diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
3477 -index b8f7763..15dc11e 100644
3478 ---- a/net/ipv4/ipconfig.c
3479 -+++ b/net/ipv4/ipconfig.c
3480 -@@ -739,9 +739,9 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
3481 - printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
3482 - b->htype = dev->type; /* can cause undefined behavior */
3483 - }
3484 -+
3485 -+ /* server_ip and your_ip address are both already zero per RFC2131 */
3486 - b->hlen = dev->addr_len;
3487 -- b->your_ip = NONE;
3488 -- b->server_ip = NONE;
3489 - memcpy(b->hw_addr, dev->dev_addr, dev->addr_len);
3490 - b->secs = htons(jiffies_diff / HZ);
3491 - b->xid = d->xid;
3492 -diff --git a/net/ipv4/netfilter/arpt_mangle.c b/net/ipv4/netfilter/arpt_mangle.c
3493 -index 45fa4e2..3f4222b 100644
3494 ---- a/net/ipv4/netfilter/arpt_mangle.c
3495 -+++ b/net/ipv4/netfilter/arpt_mangle.c
3496 -@@ -19,7 +19,7 @@ target(struct sk_buff *skb,
3497 - unsigned char *arpptr;
3498 - int pln, hln;
3499 -
3500 -- if (skb_make_writable(skb, skb->len))
3501 -+ if (!skb_make_writable(skb, skb->len))
3502 - return NF_DROP;
3503 -
3504 - arp = arp_hdr(skb);
3505 -diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
3506 -index 14d64a3..16d0fb3 100644
3507 ---- a/net/ipv4/netfilter/ip_queue.c
3508 -+++ b/net/ipv4/netfilter/ip_queue.c
3509 -@@ -336,8 +336,8 @@ static int
3510 - ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
3511 - {
3512 - int diff;
3513 -- int err;
3514 - struct iphdr *user_iph = (struct iphdr *)v->payload;
3515 -+ struct sk_buff *nskb;
3516 -
3517 - if (v->data_len < sizeof(*user_iph))
3518 - return 0;
3519 -@@ -349,14 +349,16 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
3520 - if (v->data_len > 0xFFFF)
3521 - return -EINVAL;
3522 - if (diff > skb_tailroom(e->skb)) {
3523 -- err = pskb_expand_head(e->skb, 0,
3524 -+ nskb = skb_copy_expand(e->skb, 0,
3525 - diff - skb_tailroom(e->skb),
3526 - GFP_ATOMIC);
3527 -- if (err) {
3528 -+ if (!nskb) {
3529 - printk(KERN_WARNING "ip_queue: error "
3530 -- "in mangle, dropping packet: %d\n", -err);
3531 -- return err;
3532 -+ "in mangle, dropping packet\n");
3533 -+ return -ENOMEM;
3534 - }
3535 -+ kfree_skb(e->skb);
3536 -+ e->skb = nskb;
3537 - }
3538 - skb_put(e->skb, diff);
3539 - }
3540 -diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
3541 -index 2f59baa..5b4095b 100644
3542 ---- a/net/ipv6/ip6_output.c
3543 -+++ b/net/ipv6/ip6_output.c
3544 -@@ -593,7 +593,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
3545 - * or if the skb it not generated by a local socket. (This last
3546 - * check should be redundant, but it's free.)
3547 - */
3548 -- if (!np || np->pmtudisc >= IPV6_PMTUDISC_DO) {
3549 -+ if (!skb->local_df) {
3550 - skb->dev = skb->dst->dev;
3551 - icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
3552 - IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_FRAGFAILS);
3553 -@@ -1389,6 +1389,10 @@ int ip6_push_pending_frames(struct sock *sk)
3554 - tmp_skb->sk = NULL;
3555 - }
3556 -
3557 -+ /* Allow local fragmentation. */
3558 -+ if (np->pmtudisc < IPV6_PMTUDISC_DO)
3559 -+ skb->local_df = 1;
3560 -+
3561 - ipv6_addr_copy(final_dst, &fl->fl6_dst);
3562 - __skb_pull(skb, skb_network_header_len(skb));
3563 - if (opt && opt->opt_flen)
3564 -diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
3565 -index 5383b33..81941a1 100644
3566 ---- a/net/ipv6/ip6_tunnel.c
3567 -+++ b/net/ipv6/ip6_tunnel.c
3568 -@@ -550,6 +550,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
3569 - ip_rt_put(rt);
3570 - goto out;
3571 - }
3572 -+ skb2->dst = (struct dst_entry *)rt;
3573 - } else {
3574 - ip_rt_put(rt);
3575 - if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos,
3576 -diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
3577 -index 1c5b09f..f46c38f 100644
3578 ---- a/net/ipv6/ipcomp6.c
3579 -+++ b/net/ipv6/ipcomp6.c
3580 -@@ -146,7 +146,9 @@ static int ipcomp6_output(struct xfrm_state *x, struct sk_buff *skb)
3581 - scratch = *per_cpu_ptr(ipcomp6_scratches, cpu);
3582 - tfm = *per_cpu_ptr(ipcd->tfms, cpu);
3583 -
3584 -+ local_bh_disable();
3585 - err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
3586 -+ local_bh_enable();
3587 - if (err || (dlen + sizeof(*ipch)) >= plen) {
3588 - put_cpu();
3589 - goto out_ok;
3590 -diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
3591 -index e273605..710a04f 100644
3592 ---- a/net/ipv6/netfilter/ip6_queue.c
3593 -+++ b/net/ipv6/netfilter/ip6_queue.c
3594 -@@ -333,8 +333,8 @@ static int
3595 - ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
3596 - {
3597 - int diff;
3598 -- int err;
3599 - struct ipv6hdr *user_iph = (struct ipv6hdr *)v->payload;
3600 -+ struct sk_buff *nskb;
3601 -
3602 - if (v->data_len < sizeof(*user_iph))
3603 - return 0;
3604 -@@ -346,14 +346,16 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
3605 - if (v->data_len > 0xFFFF)
3606 - return -EINVAL;
3607 - if (diff > skb_tailroom(e->skb)) {
3608 -- err = pskb_expand_head(e->skb, 0,
3609 -+ nskb = skb_copy_expand(e->skb, 0,
3610 - diff - skb_tailroom(e->skb),
3611 - GFP_ATOMIC);
3612 -- if (err) {
3613 -+ if (!nskb) {
3614 - printk(KERN_WARNING "ip6_queue: OOM "
3615 - "in mangle, dropping packet\n");
3616 -- return err;
3617 -+ return -ENOMEM;
3618 - }
3619 -+ kfree_skb(e->skb);
3620 -+ e->skb = nskb;
3621 - }
3622 - skb_put(e->skb, diff);
3623 - }
3624 -diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
3625 -index 6569767..dc22909 100644
3626 ---- a/net/ipv6/xfrm6_output.c
3627 -+++ b/net/ipv6/xfrm6_output.c
3628 -@@ -34,7 +34,7 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb)
3629 - if (mtu < IPV6_MIN_MTU)
3630 - mtu = IPV6_MIN_MTU;
3631 -
3632 -- if (skb->len > mtu) {
3633 -+ if (!skb->local_df && skb->len > mtu) {
3634 - skb->dev = dst->dev;
3635 - icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
3636 - ret = -EMSGSIZE;
3637 -diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
3638 -index 2c7bd2e..dc43df1 100644
3639 ---- a/net/netfilter/nfnetlink_log.c
3640 -+++ b/net/netfilter/nfnetlink_log.c
3641 -@@ -594,7 +594,7 @@ nfulnl_log_packet(unsigned int pf,
3642 - /* FIXME: do we want to make the size calculation conditional based on
3643 - * what is actually present? way more branches and checks, but more
3644 - * memory efficient... */
3645 -- size = NLMSG_ALIGN(sizeof(struct nfgenmsg))
3646 -+ size = NLMSG_SPACE(sizeof(struct nfgenmsg))
3647 - + nla_total_size(sizeof(struct nfulnl_msg_packet_hdr))
3648 - + nla_total_size(sizeof(u_int32_t)) /* ifindex */
3649 - + nla_total_size(sizeof(u_int32_t)) /* ifindex */
3650 -diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
3651 -index 3ceeffc..7c3646c 100644
3652 ---- a/net/netfilter/nfnetlink_queue.c
3653 -+++ b/net/netfilter/nfnetlink_queue.c
3654 -@@ -353,7 +353,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
3655 -
3656 - QDEBUG("entered\n");
3657 -
3658 -- size = NLMSG_ALIGN(sizeof(struct nfgenmsg))
3659 -+ size = NLMSG_SPACE(sizeof(struct nfgenmsg))
3660 - + nla_total_size(sizeof(struct nfqnl_msg_packet_hdr))
3661 - + nla_total_size(sizeof(u_int32_t)) /* ifindex */
3662 - + nla_total_size(sizeof(u_int32_t)) /* ifindex */
3663 -@@ -616,8 +616,8 @@ err_out_put:
3664 - static int
3665 - nfqnl_mangle(void *data, int data_len, struct nfqnl_queue_entry *e)
3666 - {
3667 -+ struct sk_buff *nskb;
3668 - int diff;
3669 -- int err;
3670 -
3671 - diff = data_len - e->skb->len;
3672 - if (diff < 0) {
3673 -@@ -627,14 +627,16 @@ nfqnl_mangle(void *data, int data_len, struct nfqnl_queue_entry *e)
3674 - if (data_len > 0xFFFF)
3675 - return -EINVAL;
3676 - if (diff > skb_tailroom(e->skb)) {
3677 -- err = pskb_expand_head(e->skb, 0,
3678 -+ nskb = skb_copy_expand(e->skb, 0,
3679 - diff - skb_tailroom(e->skb),
3680 - GFP_ATOMIC);
3681 -- if (err) {
3682 -+ if (!nskb) {
3683 - printk(KERN_WARNING "nf_queue: OOM "
3684 - "in mangle, dropping packet\n");
3685 -- return err;
3686 -+ return -ENOMEM;
3687 - }
3688 -+ kfree_skb(e->skb);
3689 -+ e->skb = nskb;
3690 - }
3691 - skb_put(e->skb, diff);
3692 - }
3693 -diff --git a/net/netfilter/xt_time.c b/net/netfilter/xt_time.c
3694 -index f9c55dc..5222a97 100644
3695 ---- a/net/netfilter/xt_time.c
3696 -+++ b/net/netfilter/xt_time.c
3697 -@@ -95,8 +95,11 @@ static inline void localtime_2(struct xtm *r, time_t time)
3698 - */
3699 - r->dse = time / 86400;
3700 -
3701 -- /* 1970-01-01 (w=0) was a Thursday (4). */
3702 -- r->weekday = (4 + r->dse) % 7;
3703 -+ /*
3704 -+ * 1970-01-01 (w=0) was a Thursday (4).
3705 -+ * -1 and +1 map Sunday properly onto 7.
3706 -+ */
3707 -+ r->weekday = (4 + r->dse - 1) % 7 + 1;
3708 - }
3709 -
3710 - static void localtime_3(struct xtm *r, time_t time)
3711 -diff --git a/security/commoncap.c b/security/commoncap.c
3712 -index ea61bc7..e87422e 100644
3713 ---- a/security/commoncap.c
3714 -+++ b/security/commoncap.c
3715 -@@ -539,7 +539,7 @@ int cap_task_kill(struct task_struct *p, struct siginfo *info,
3716 - * allowed.
3717 - * We must preserve legacy signal behavior in this case.
3718 - */
3719 -- if (p->euid == 0 && p->uid == current->uid)
3720 -+ if (p->uid == current->uid)
3721 - return 0;
3722 -
3723 - /* sigcont is permitted within same session */
3724
3725 Copied: genpatches-2.6/trunk/2.6.24/1003_linux-2.6.24.4.patch (from rev 1291, genpatches-2.6/trunk/2.6.24/1003-linux-2.6.24.4.patch)
3726 ===================================================================
3727 --- genpatches-2.6/trunk/2.6.24/1003_linux-2.6.24.4.patch (rev 0)
3728 +++ genpatches-2.6/trunk/2.6.24/1003_linux-2.6.24.4.patch 2008-04-19 09:58:26 UTC (rev 1296)
3729 @@ -0,0 +1,3643 @@
3730 +diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
3731 +index 83ef5ec..df5ae27 100644
3732 +--- a/arch/arm/mach-pxa/clock.c
3733 ++++ b/arch/arm/mach-pxa/clock.c
3734 +@@ -23,18 +23,27 @@ static LIST_HEAD(clocks);
3735 + static DEFINE_MUTEX(clocks_mutex);
3736 + static DEFINE_SPINLOCK(clocks_lock);
3737 +
3738 ++static struct clk *clk_lookup(struct device *dev, const char *id)
3739 ++{
3740 ++ struct clk *p;
3741 ++
3742 ++ list_for_each_entry(p, &clocks, node)
3743 ++ if (strcmp(id, p->name) == 0 && p->dev == dev)
3744 ++ return p;
3745 ++
3746 ++ return NULL;
3747 ++}
3748 ++
3749 + struct clk *clk_get(struct device *dev, const char *id)
3750 + {
3751 + struct clk *p, *clk = ERR_PTR(-ENOENT);
3752 +
3753 + mutex_lock(&clocks_mutex);
3754 +- list_for_each_entry(p, &clocks, node) {
3755 +- if (strcmp(id, p->name) == 0 &&
3756 +- (p->dev == NULL || p->dev == dev)) {
3757 +- clk = p;
3758 +- break;
3759 +- }
3760 +- }
3761 ++ p = clk_lookup(dev, id);
3762 ++ if (!p)
3763 ++ p = clk_lookup(NULL, id);
3764 ++ if (p)
3765 ++ clk = p;
3766 + mutex_unlock(&clocks_mutex);
3767 +
3768 + return clk;
3769 +diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
3770 +index 4710135..9158dd8 100644
3771 +--- a/arch/mips/kernel/i8259.c
3772 ++++ b/arch/mips/kernel/i8259.c
3773 +@@ -338,8 +338,10 @@ void __init init_i8259_irqs(void)
3774 +
3775 + init_8259A(0);
3776 +
3777 +- for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++)
3778 ++ for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++) {
3779 + set_irq_chip_and_handler(i, &i8259A_chip, handle_level_irq);
3780 ++ set_irq_probe(i);
3781 ++ }
3782 +
3783 + setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2);
3784 + }
3785 +diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
3786 +index d06e9c9..e3309ff 100644
3787 +--- a/arch/mips/kernel/irq.c
3788 ++++ b/arch/mips/kernel/irq.c
3789 +@@ -145,6 +145,11 @@ __setup("nokgdb", nokgdb);
3790 +
3791 + void __init init_IRQ(void)
3792 + {
3793 ++ int i;
3794 ++
3795 ++ for (i = 0; i < NR_IRQS; i++)
3796 ++ set_irq_noprobe(i);
3797 ++
3798 + arch_init_irq();
3799 +
3800 + #ifdef CONFIG_KGDB
3801 +diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
3802 +index 7e8efaa..5efdfe9 100644
3803 +--- a/arch/s390/lib/uaccess_pt.c
3804 ++++ b/arch/s390/lib/uaccess_pt.c
3805 +@@ -406,6 +406,8 @@ int futex_atomic_cmpxchg_pt(int __user *uaddr, int oldval, int newval)
3806 + {
3807 + int ret;
3808 +
3809 ++ if (!current->mm)
3810 ++ return -EFAULT;
3811 + spin_lock(&current->mm->page_table_lock);
3812 + uaddr = (int __user *) __dat_user_addr((unsigned long) uaddr);
3813 + if (!uaddr) {
3814 +diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
3815 +index e795f28..bf1b15d 100644
3816 +--- a/arch/sparc/kernel/Makefile
3817 ++++ b/arch/sparc/kernel/Makefile
3818 +@@ -1,4 +1,4 @@
3819 +-# $Id: Makefile,v 1.62 2000/12/15 00:41:17 davem Exp $
3820 ++#
3821 + # Makefile for the linux kernel.
3822 + #
3823 +
3824 +@@ -12,7 +12,8 @@ obj-y := entry.o wof.o wuf.o etrap.o rtrap.o traps.o $(IRQ_OBJS) \
3825 + sys_sparc.o sunos_asm.o systbls.o \
3826 + time.o windows.o cpu.o devices.o sclow.o \
3827 + tadpole.o tick14.o ptrace.o sys_solaris.o \
3828 +- unaligned.o muldiv.o semaphore.o prom.o of_device.o devres.o
3829 ++ unaligned.o una_asm.o muldiv.o semaphore.o \
3830 ++ prom.o of_device.o devres.o
3831 +
3832 + devres-y = ../../../kernel/irq/devres.o
3833 +
3834 +diff --git a/arch/sparc/kernel/una_asm.S b/arch/sparc/kernel/una_asm.S
3835 +new file mode 100644
3836 +index 0000000..8cc0345
3837 +--- /dev/null
3838 ++++ b/arch/sparc/kernel/una_asm.S
3839 +@@ -0,0 +1,153 @@
3840 ++/* una_asm.S: Kernel unaligned trap assembler helpers.
3841 ++ *
3842 ++ * Copyright (C) 1996,2005,2008 David S. Miller (davem@×××××××××.net)
3843 ++ * Copyright (C) 1996,1997 Jakub Jelinek (jj@××××××××××××××××.cz)
3844 ++ */
3845 ++
3846 ++#include <linux/errno.h>
3847 ++
3848 ++ .text
3849 ++
3850 ++retl_efault:
3851 ++ retl
3852 ++ mov -EFAULT, %o0
3853 ++
3854 ++ /* int __do_int_store(unsigned long *dst_addr, int size,
3855 ++ * unsigned long *src_val)
3856 ++ *
3857 ++ * %o0 = dest_addr
3858 ++ * %o1 = size
3859 ++ * %o2 = src_val
3860 ++ *
3861 ++ * Return '0' on success, -EFAULT on failure.
3862 ++ */
3863 ++ .globl __do_int_store
3864 ++__do_int_store:
3865 ++ ld [%o2], %g1
3866 ++ cmp %1, 2
3867 ++ be 2f
3868 ++ cmp %1, 4
3869 ++ be 1f
3870 ++ srl %g1, 24, %g2
3871 ++ srl %g1, 16, %g7
3872 ++4: stb %g2, [%o0]
3873 ++ srl %g1, 8, %g2
3874 ++5: stb %g7, [%o0 + 1]
3875 ++ ld [%o2 + 4], %g7
3876 ++6: stb %g2, [%o0 + 2]
3877 ++ srl %g7, 24, %g2
3878 ++7: stb %g1, [%o0 + 3]
3879 ++ srl %g7, 16, %g1
3880 ++8: stb %g2, [%o0 + 4]
3881 ++ srl %g7, 8, %g2
3882 ++9: stb %g1, [%o0 + 5]
3883 ++10: stb %g2, [%o0 + 6]
3884 ++ b 0f
3885 ++11: stb %g7, [%o0 + 7]
3886 ++1: srl %g1, 16, %g7
3887 ++12: stb %g2, [%o0]
3888 ++ srl %g1, 8, %g2
3889 ++13: stb %g7, [%o0 + 1]
3890 ++14: stb %g2, [%o0 + 2]
3891 ++ b 0f
3892 ++15: stb %g1, [%o0 + 3]
3893 ++2: srl %g1, 8, %g2
3894 ++16: stb %g2, [%o0]
3895 ++17: stb %g1, [%o0 + 1]
3896 ++0: retl
3897 ++ mov 0, %o0
3898 ++
3899 ++ .section __ex_table,#alloc
3900 ++ .word 4b, retl_efault
3901 ++ .word 5b, retl_efault
3902 ++ .word 6b, retl_efault
3903 ++ .word 7b, retl_efault
3904 ++ .word 8b, retl_efault
3905 ++ .word 9b, retl_efault
3906 ++ .word 10b, retl_efault
3907 ++ .word 11b, retl_efault
3908 ++ .word 12b, retl_efault
3909 ++ .word 13b, retl_efault
3910 ++ .word 14b, retl_efault
3911 ++ .word 15b, retl_efault
3912 ++ .word 16b, retl_efault
3913 ++ .word 17b, retl_efault
3914 ++ .previous
3915 ++
3916 ++ /* int do_int_load(unsigned long *dest_reg, int size,
3917 ++ * unsigned long *saddr, int is_signed)
3918 ++ *
3919 ++ * %o0 = dest_reg
3920 ++ * %o1 = size
3921 ++ * %o2 = saddr
3922 ++ * %o3 = is_signed
3923 ++ *
3924 ++ * Return '0' on success, -EFAULT on failure.
3925 ++ */
3926 ++ .globl do_int_load
3927 ++do_int_load:
3928 ++ cmp %o1, 8
3929 ++ be 9f
3930 ++ cmp %o1, 4
3931 ++ be 6f
3932 ++4: ldub [%o2], %g1
3933 ++5: ldub [%o2 + 1], %g2
3934 ++ sll %g1, 8, %g1
3935 ++ tst %o3
3936 ++ be 3f
3937 ++ or %g1, %g2, %g1
3938 ++ sll %g1, 16, %g1
3939 ++ sra %g1, 16, %g1
3940 ++3: b 0f
3941 ++ st %g1, [%o0]
3942 ++6: ldub [%o2 + 1], %g2
3943 ++ sll %g1, 24, %g1
3944 ++7: ldub [%o2 + 2], %g7
3945 ++ sll %g2, 16, %g2
3946 ++8: ldub [%o2 + 3], %g3
3947 ++ sll %g7, 8, %g7
3948 ++ or %g3, %g2, %g3
3949 ++ or %g7, %g3, %g7
3950 ++ or %g1, %g7, %g1
3951 ++ b 0f
3952 ++ st %g1, [%o0]
3953 ++9: ldub [%o2], %g1
3954 ++10: ldub [%o2 + 1], %g2
3955 ++ sll %g1, 24, %g1
3956 ++11: ldub [%o2 + 2], %g7
3957 ++ sll %g2, 16, %g2
3958 ++12: ldub [%o2 + 3], %g3
3959 ++ sll %g7, 8, %g7
3960 ++ or %g1, %g2, %g1
3961 ++ or %g7, %g3, %g7
3962 ++ or %g1, %g7, %g7
3963 ++13: ldub [%o2 + 4], %g1
3964 ++ st %g7, [%o0]
3965 ++14: ldub [%o2 + 5], %g2
3966 ++ sll %g1, 24, %g1
3967 ++15: ldub [%o2 + 6], %g7
3968 ++ sll %g2, 16, %g2
3969 ++16: ldub [%o2 + 7], %g3
3970 ++ sll %g7, 8, %g7
3971 ++ or %g1, %g2, %g1
3972 ++ or %g7, %g3, %g7
3973 ++ or %g1, %g7, %g7
3974 ++ st %g7, [%o0 + 4]
3975 ++0: retl
3976 ++ mov 0, %o0
3977 ++
3978 ++ .section __ex_table,#alloc
3979 ++ .word 4b, retl_efault
3980 ++ .word 5b, retl_efault
3981 ++ .word 6b, retl_efault
3982 ++ .word 7b, retl_efault
3983 ++ .word 8b, retl_efault
3984 ++ .word 9b, retl_efault
3985 ++ .word 10b, retl_efault
3986 ++ .word 11b, retl_efault
3987 ++ .word 12b, retl_efault
3988 ++ .word 13b, retl_efault
3989 ++ .word 14b, retl_efault
3990 ++ .word 15b, retl_efault
3991 ++ .word 16b, retl_efault
3992 ++ .previous
3993 +diff --git a/arch/sparc/kernel/unaligned.c b/arch/sparc/kernel/unaligned.c
3994 +index a6330fb..33857be 100644
3995 +--- a/arch/sparc/kernel/unaligned.c
3996 ++++ b/arch/sparc/kernel/unaligned.c
3997 +@@ -175,157 +175,31 @@ static void unaligned_panic(char *str)
3998 + panic(str);
3999 + }
4000 +
4001 +-#define do_integer_load(dest_reg, size, saddr, is_signed, errh) ({ \
4002 +-__asm__ __volatile__ ( \
4003 +- "cmp %1, 8\n\t" \
4004 +- "be 9f\n\t" \
4005 +- " cmp %1, 4\n\t" \
4006 +- "be 6f\n" \
4007 +-"4:\t" " ldub [%2], %%l1\n" \
4008 +-"5:\t" "ldub [%2 + 1], %%l2\n\t" \
4009 +- "sll %%l1, 8, %%l1\n\t" \
4010 +- "tst %3\n\t" \
4011 +- "be 3f\n\t" \
4012 +- " add %%l1, %%l2, %%l1\n\t" \
4013 +- "sll %%l1, 16, %%l1\n\t" \
4014 +- "sra %%l1, 16, %%l1\n" \
4015 +-"3:\t" "b 0f\n\t" \
4016 +- " st %%l1, [%0]\n" \
4017 +-"6:\t" "ldub [%2 + 1], %%l2\n\t" \
4018 +- "sll %%l1, 24, %%l1\n" \
4019 +-"7:\t" "ldub [%2 + 2], %%g7\n\t" \
4020 +- "sll %%l2, 16, %%l2\n" \
4021 +-"8:\t" "ldub [%2 + 3], %%g1\n\t" \
4022 +- "sll %%g7, 8, %%g7\n\t" \
4023 +- "or %%l1, %%l2, %%l1\n\t" \
4024 +- "or %%g7, %%g1, %%g7\n\t" \
4025 +- "or %%l1, %%g7, %%l1\n\t" \
4026 +- "b 0f\n\t" \
4027 +- " st %%l1, [%0]\n" \
4028 +-"9:\t" "ldub [%2], %%l1\n" \
4029 +-"10:\t" "ldub [%2 + 1], %%l2\n\t" \
4030 +- "sll %%l1, 24, %%l1\n" \
4031 +-"11:\t" "ldub [%2 + 2], %%g7\n\t" \
4032 +- "sll %%l2, 16, %%l2\n" \
4033 +-"12:\t" "ldub [%2 + 3], %%g1\n\t" \
4034 +- "sll %%g7, 8, %%g7\n\t" \
4035 +- "or %%l1, %%l2, %%l1\n\t" \
4036 +- "or %%g7, %%g1, %%g7\n\t" \
4037 +- "or %%l1, %%g7, %%g7\n" \
4038 +-"13:\t" "ldub [%2 + 4], %%l1\n\t" \
4039 +- "st %%g7, [%0]\n" \
4040 +-"14:\t" "ldub [%2 + 5], %%l2\n\t" \
4041 +- "sll %%l1, 24, %%l1\n" \
4042 +-"15:\t" "ldub [%2 + 6], %%g7\n\t" \
4043 +- "sll %%l2, 16, %%l2\n" \
4044 +-"16:\t" "ldub [%2 + 7], %%g1\n\t" \
4045 +- "sll %%g7, 8, %%g7\n\t" \
4046 +- "or %%l1, %%l2, %%l1\n\t" \
4047 +- "or %%g7, %%g1, %%g7\n\t" \
4048 +- "or %%l1, %%g7, %%g7\n\t" \
4049 +- "st %%g7, [%0 + 4]\n" \
4050 +-"0:\n\n\t" \
4051 +- ".section __ex_table,#alloc\n\t" \
4052 +- ".word 4b, " #errh "\n\t" \
4053 +- ".word 5b, " #errh "\n\t" \
4054 +- ".word 6b, " #errh "\n\t" \
4055 +- ".word 7b, " #errh "\n\t" \
4056 +- ".word 8b, " #errh "\n\t" \
4057 +- ".word 9b, " #errh "\n\t" \
4058 +- ".word 10b, " #errh "\n\t" \
4059 +- ".word 11b, " #errh "\n\t" \
4060 +- ".word 12b, " #errh "\n\t" \
4061 +- ".word 13b, " #errh "\n\t" \
4062 +- ".word 14b, " #errh "\n\t" \
4063 +- ".word 15b, " #errh "\n\t" \
4064 +- ".word 16b, " #errh "\n\n\t" \
4065 +- ".previous\n\t" \
4066 +- : : "r" (dest_reg), "r" (size), "r" (saddr), "r" (is_signed) \
4067 +- : "l1", "l2", "g7", "g1", "cc"); \
4068 +-})
4069 +-
4070 +-#define store_common(dst_addr, size, src_val, errh) ({ \
4071 +-__asm__ __volatile__ ( \
4072 +- "ld [%2], %%l1\n" \
4073 +- "cmp %1, 2\n\t" \
4074 +- "be 2f\n\t" \
4075 +- " cmp %1, 4\n\t" \
4076 +- "be 1f\n\t" \
4077 +- " srl %%l1, 24, %%l2\n\t" \
4078 +- "srl %%l1, 16, %%g7\n" \
4079 +-"4:\t" "stb %%l2, [%0]\n\t" \
4080 +- "srl %%l1, 8, %%l2\n" \
4081 +-"5:\t" "stb %%g7, [%0 + 1]\n\t" \
4082 +- "ld [%2 + 4], %%g7\n" \
4083 +-"6:\t" "stb %%l2, [%0 + 2]\n\t" \
4084 +- "srl %%g7, 24, %%l2\n" \
4085 +-"7:\t" "stb %%l1, [%0 + 3]\n\t" \
4086 +- "srl %%g7, 16, %%l1\n" \
4087 +-"8:\t" "stb %%l2, [%0 + 4]\n\t" \
4088 +- "srl %%g7, 8, %%l2\n" \
4089 +-"9:\t" "stb %%l1, [%0 + 5]\n" \
4090 +-"10:\t" "stb %%l2, [%0 + 6]\n\t" \
4091 +- "b 0f\n" \
4092 +-"11:\t" " stb %%g7, [%0 + 7]\n" \
4093 +-"1:\t" "srl %%l1, 16, %%g7\n" \
4094 +-"12:\t" "stb %%l2, [%0]\n\t" \
4095 +- "srl %%l1, 8, %%l2\n" \
4096 +-"13:\t" "stb %%g7, [%0 + 1]\n" \
4097 +-"14:\t" "stb %%l2, [%0 + 2]\n\t" \
4098 +- "b 0f\n" \
4099 +-"15:\t" " stb %%l1, [%0 + 3]\n" \
4100 +-"2:\t" "srl %%l1, 8, %%l2\n" \
4101 +-"16:\t" "stb %%l2, [%0]\n" \
4102 +-"17:\t" "stb %%l1, [%0 + 1]\n" \
4103 +-"0:\n\n\t" \
4104 +- ".section __ex_table,#alloc\n\t" \
4105 +- ".word 4b, " #errh "\n\t" \
4106 +- ".word 5b, " #errh "\n\t" \
4107 +- ".word 6b, " #errh "\n\t" \
4108 +- ".word 7b, " #errh "\n\t" \
4109 +- ".word 8b, " #errh "\n\t" \
4110 +- ".word 9b, " #errh "\n\t" \
4111 +- ".word 10b, " #errh "\n\t" \
4112 +- ".word 11b, " #errh "\n\t" \
4113 +- ".word 12b, " #errh "\n\t" \
4114 +- ".word 13b, " #errh "\n\t" \
4115 +- ".word 14b, " #errh "\n\t" \
4116 +- ".word 15b, " #errh "\n\t" \
4117 +- ".word 16b, " #errh "\n\t" \
4118 +- ".word 17b, " #errh "\n\n\t" \
4119 +- ".previous\n\t" \
4120 +- : : "r" (dst_addr), "r" (size), "r" (src_val) \
4121 +- : "l1", "l2", "g7", "g1", "cc"); \
4122 +-})
4123 +-
4124 +-#define do_integer_store(reg_num, size, dst_addr, regs, errh) ({ \
4125 +- unsigned long *src_val; \
4126 +- static unsigned long zero[2] = { 0, }; \
4127 +- \
4128 +- if (reg_num) src_val = fetch_reg_addr(reg_num, regs); \
4129 +- else { \
4130 +- src_val = &zero[0]; \
4131 +- if (size == 8) \
4132 +- zero[1] = fetch_reg(1, regs); \
4133 +- } \
4134 +- store_common(dst_addr, size, src_val, errh); \
4135 +-})
4136 ++/* una_asm.S */
4137 ++extern int do_int_load(unsigned long *dest_reg, int size,
4138 ++ unsigned long *saddr, int is_signed);
4139 ++extern int __do_int_store(unsigned long *dst_addr, int size,
4140 ++ unsigned long *src_val);
4141 ++
4142 ++static int do_int_store(int reg_num, int size, unsigned long *dst_addr,
4143 ++ struct pt_regs *regs)
4144 ++{
4145 ++ unsigned long zero[2] = { 0, 0 };
4146 ++ unsigned long *src_val;
4147 ++
4148 ++ if (reg_num)
4149 ++ src_val = fetch_reg_addr(reg_num, regs);
4150 ++ else {
4151 ++ src_val = &zero[0];
4152 ++ if (size == 8)
4153 ++ zero[1] = fetch_reg(1, regs);
4154 ++ }
4155 ++ return __do_int_store(dst_addr, size, src_val);
4156 ++}
4157 +
4158 + extern void smp_capture(void);
4159 + extern void smp_release(void);
4160 +
4161 +-#define do_atomic(srcdest_reg, mem, errh) ({ \
4162 +- unsigned long flags, tmp; \
4163 +- \
4164 +- smp_capture(); \
4165 +- local_irq_save(flags); \
4166 +- tmp = *srcdest_reg; \
4167 +- do_integer_load(srcdest_reg, 4, mem, 0, errh); \
4168 +- store_common(mem, 4, &tmp, errh); \
4169 +- local_irq_restore(flags); \
4170 +- smp_release(); \
4171 +-})
4172 +-
4173 + static inline void advance(struct pt_regs *regs)
4174 + {
4175 + regs->pc = regs->npc;
4176 +@@ -342,9 +216,7 @@ static inline int ok_for_kernel(unsigned int insn)
4177 + return !floating_point_load_or_store_p(insn);
4178 + }
4179 +
4180 +-void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("kernel_mna_trap_fault");
4181 +-
4182 +-void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
4183 ++static void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
4184 + {
4185 + unsigned long g2 = regs->u_regs [UREG_G2];
4186 + unsigned long fixup = search_extables_range(regs->pc, &g2);
4187 +@@ -379,48 +251,34 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)
4188 + printk("Unsupported unaligned load/store trap for kernel at <%08lx>.\n",
4189 + regs->pc);
4190 + unaligned_panic("Wheee. Kernel does fpu/atomic unaligned load/store.");
4191 +-
4192 +- __asm__ __volatile__ ("\n"
4193 +-"kernel_unaligned_trap_fault:\n\t"
4194 +- "mov %0, %%o0\n\t"
4195 +- "call kernel_mna_trap_fault\n\t"
4196 +- " mov %1, %%o1\n\t"
4197 +- :
4198 +- : "r" (regs), "r" (insn)
4199 +- : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
4200 +- "g1", "g2", "g3", "g4", "g5", "g7", "cc");
4201 + } else {
4202 + unsigned long addr = compute_effective_address(regs, insn);
4203 ++ int err;
4204 +
4205 + #ifdef DEBUG_MNA
4206 + printk("KMNA: pc=%08lx [dir=%s addr=%08lx size=%d] retpc[%08lx]\n",
4207 + regs->pc, dirstrings[dir], addr, size, regs->u_regs[UREG_RETPC]);
4208 + #endif
4209 +- switch(dir) {
4210 ++ switch (dir) {
4211 + case load:
4212 +- do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
4213 +- size, (unsigned long *) addr,
4214 +- decode_signedness(insn),
4215 +- kernel_unaligned_trap_fault);
4216 ++ err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),
4217 ++ regs),
4218 ++ size, (unsigned long *) addr,
4219 ++ decode_signedness(insn));
4220 + break;
4221 +
4222 + case store:
4223 +- do_integer_store(((insn>>25)&0x1f), size,
4224 +- (unsigned long *) addr, regs,
4225 +- kernel_unaligned_trap_fault);
4226 ++ err = do_int_store(((insn>>25)&0x1f), size,
4227 ++ (unsigned long *) addr, regs);
4228 + break;
4229 +-#if 0 /* unsupported */
4230 +- case both:
4231 +- do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
4232 +- (unsigned long *) addr,
4233 +- kernel_unaligned_trap_fault);
4234 +- break;
4235 +-#endif
4236 + default:
4237 + panic("Impossible kernel unaligned trap.");
4238 + /* Not reached... */
4239 + }
4240 +- advance(regs);
4241 ++ if (err)
4242 ++ kernel_mna_trap_fault(regs, insn);
4243 ++ else
4244 ++ advance(regs);
4245 + }
4246 + }
4247 +
4248 +@@ -459,9 +317,7 @@ static inline int ok_for_user(struct pt_regs *regs, unsigned int insn,
4249 + return 0;
4250 + }
4251 +
4252 +-void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("user_mna_trap_fault");
4253 +-
4254 +-void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
4255 ++static void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
4256 + {
4257 + siginfo_t info;
4258 +
4259 +@@ -485,7 +341,7 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)
4260 + if(!ok_for_user(regs, insn, dir)) {
4261 + goto kill_user;
4262 + } else {
4263 +- int size = decode_access_size(insn);
4264 ++ int err, size = decode_access_size(insn);
4265 + unsigned long addr;
4266 +
4267 + if(floating_point_load_or_store_p(insn)) {
4268 +@@ -496,48 +352,34 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)
4269 + addr = compute_effective_address(regs, insn);
4270 + switch(dir) {
4271 + case load:
4272 +- do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
4273 +- size, (unsigned long *) addr,
4274 +- decode_signedness(insn),
4275 +- user_unaligned_trap_fault);
4276 ++ err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),
4277 ++ regs),
4278 ++ size, (unsigned long *) addr,
4279 ++ decode_signedness(insn));
4280 + break;
4281 +
4282 + case store:
4283 +- do_integer_store(((insn>>25)&0x1f), size,
4284 +- (unsigned long *) addr, regs,
4285 +- user_unaligned_trap_fault);
4286 ++ err = do_int_store(((insn>>25)&0x1f), size,
4287 ++ (unsigned long *) addr, regs);
4288 + break;
4289 +
4290 + case both:
4291 +-#if 0 /* unsupported */
4292 +- do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
4293 +- (unsigned long *) addr,
4294 +- user_unaligned_trap_fault);
4295 +-#else
4296 + /*
4297 + * This was supported in 2.4. However, we question
4298 + * the value of SWAP instruction across word boundaries.
4299 + */
4300 + printk("Unaligned SWAP unsupported.\n");
4301 +- goto kill_user;
4302 +-#endif
4303 ++ err = -EFAULT;
4304 + break;
4305 +
4306 + default:
4307 + unaligned_panic("Impossible user unaligned trap.");
4308 +-
4309 +- __asm__ __volatile__ ("\n"
4310 +-"user_unaligned_trap_fault:\n\t"
4311 +- "mov %0, %%o0\n\t"
4312 +- "call user_mna_trap_fault\n\t"
4313 +- " mov %1, %%o1\n\t"
4314 +- :
4315 +- : "r" (regs), "r" (insn)
4316 +- : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
4317 +- "g1", "g2", "g3", "g4", "g5", "g7", "cc");
4318 + goto out;
4319 + }
4320 +- advance(regs);
4321 ++ if (err)
4322 ++ goto kill_user;
4323 ++ else
4324 ++ advance(regs);
4325 + goto out;
4326 + }
4327 +
4328 +diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
4329 +index e2027f2..2650d0d 100644
4330 +--- a/arch/sparc64/mm/fault.c
4331 ++++ b/arch/sparc64/mm/fault.c
4332 +@@ -244,16 +244,8 @@ static void do_kernel_fault(struct pt_regs *regs, int si_code, int fault_code,
4333 + if (regs->tstate & TSTATE_PRIV) {
4334 + const struct exception_table_entry *entry;
4335 +
4336 +- if (asi == ASI_P && (insn & 0xc0800000) == 0xc0800000) {
4337 +- if (insn & 0x2000)
4338 +- asi = (regs->tstate >> 24);
4339 +- else
4340 +- asi = (insn >> 5);
4341 +- }
4342 +-
4343 +- /* Look in asi.h: All _S asis have LS bit set */
4344 +- if ((asi & 0x1) &&
4345 +- (entry = search_exception_tables(regs->tpc))) {
4346 ++ entry = search_exception_tables(regs->tpc);
4347 ++ if (entry) {
4348 + regs->tpc = entry->fixup;
4349 + regs->tnpc = regs->tpc + 4;
4350 + return;
4351 +@@ -294,7 +286,7 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
4352 + unsigned long tpc = regs->tpc;
4353 +
4354 + /* Sanity check the PC. */
4355 +- if ((tpc >= KERNBASE && tpc < (unsigned long) _etext) ||
4356 ++ if ((tpc >= KERNBASE && tpc < (unsigned long) __init_end) ||
4357 + (tpc >= MODULES_VADDR && tpc < MODULES_END)) {
4358 + /* Valid, no problems... */
4359 + } else {
4360 +diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
4361 +index 6ea19c2..4eaaf78 100644
4362 +--- a/arch/x86/ia32/ia32_signal.c
4363 ++++ b/arch/x86/ia32/ia32_signal.c
4364 +@@ -494,7 +494,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
4365 + regs->ss = __USER32_DS;
4366 +
4367 + set_fs(USER_DS);
4368 +- regs->eflags &= ~TF_MASK;
4369 ++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
4370 + if (test_thread_flag(TIF_SINGLESTEP))
4371 + ptrace_notify(SIGTRAP);
4372 +
4373 +@@ -600,7 +600,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
4374 + regs->ss = __USER32_DS;
4375 +
4376 + set_fs(USER_DS);
4377 +- regs->eflags &= ~TF_MASK;
4378 ++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
4379 + if (test_thread_flag(TIF_SINGLESTEP))
4380 + ptrace_notify(SIGTRAP);
4381 +
4382 +diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
4383 +index edb5108..c48fbb1 100644
4384 +--- a/arch/x86/kernel/apic_32.c
4385 ++++ b/arch/x86/kernel/apic_32.c
4386 +@@ -154,7 +154,7 @@ unsigned long safe_apic_wait_icr_idle(void)
4387 + /**
4388 + * enable_NMI_through_LVT0 - enable NMI through local vector table 0
4389 + */
4390 +-void enable_NMI_through_LVT0 (void * dummy)
4391 ++void __cpuinit enable_NMI_through_LVT0(void)
4392 + {
4393 + unsigned int v = APIC_DM_NMI;
4394 +
4395 +diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
4396 +index f28ccb5..0173007 100644
4397 +--- a/arch/x86/kernel/apic_64.c
4398 ++++ b/arch/x86/kernel/apic_64.c
4399 +@@ -151,7 +151,7 @@ unsigned int safe_apic_wait_icr_idle(void)
4400 + return send_status;
4401 + }
4402 +
4403 +-void enable_NMI_through_LVT0 (void * dummy)
4404 ++void enable_NMI_through_LVT0(void)
4405 + {
4406 + unsigned int v;
4407 +
4408 +diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
4409 +index a6b1490..232fdeb 100644
4410 +--- a/arch/x86/kernel/io_apic_32.c
4411 ++++ b/arch/x86/kernel/io_apic_32.c
4412 +@@ -2080,7 +2080,7 @@ static struct irq_chip lapic_chip __read_mostly = {
4413 + .eoi = ack_apic,
4414 + };
4415 +
4416 +-static void setup_nmi (void)
4417 ++static void __init setup_nmi(void)
4418 + {
4419 + /*
4420 + * Dirty trick to enable the NMI watchdog ...
4421 +@@ -2093,7 +2093,7 @@ static void setup_nmi (void)
4422 + */
4423 + apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ...");
4424 +
4425 +- on_each_cpu(enable_NMI_through_LVT0, NULL, 1, 1);
4426 ++ enable_NMI_through_LVT0();
4427 +
4428 + apic_printk(APIC_VERBOSE, " done.\n");
4429 + }
4430 +diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c
4431 +index cbac167..7119cb7 100644
4432 +--- a/arch/x86/kernel/io_apic_64.c
4433 ++++ b/arch/x86/kernel/io_apic_64.c
4434 +@@ -1565,7 +1565,7 @@ static struct hw_interrupt_type lapic_irq_type __read_mostly = {
4435 + .end = end_lapic_irq,
4436 + };
4437 +
4438 +-static void setup_nmi (void)
4439 ++static void __init setup_nmi(void)
4440 + {
4441 + /*
4442 + * Dirty trick to enable the NMI watchdog ...
4443 +@@ -1578,7 +1578,7 @@ static void setup_nmi (void)
4444 + */
4445 + printk(KERN_INFO "activating NMI Watchdog ...");
4446 +
4447 +- enable_NMI_through_LVT0(NULL);
4448 ++ enable_NMI_through_LVT0();
4449 +
4450 + printk(" done.\n");
4451 + }
4452 +@@ -1654,7 +1654,7 @@ static inline void unlock_ExtINT_logic(void)
4453 + *
4454 + * FIXME: really need to revamp this for modern platforms only.
4455 + */
4456 +-static inline void check_timer(void)
4457 ++static inline void __init check_timer(void)
4458 + {
4459 + struct irq_cfg *cfg = irq_cfg + 0;
4460 + int apic1, pin1, apic2, pin2;
4461 +diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
4462 +index ab79e1d..d7f7132 100644
4463 +--- a/arch/x86/kernel/process_64.c
4464 ++++ b/arch/x86/kernel/process_64.c
4465 +@@ -212,14 +212,13 @@ void cpu_idle (void)
4466 + current_thread_info()->status |= TS_POLLING;
4467 + /* endless idle loop with no priority at all */
4468 + while (1) {
4469 ++ tick_nohz_stop_sched_tick();
4470 + while (!need_resched()) {
4471 + void (*idle)(void);
4472 +
4473 + if (__get_cpu_var(cpu_idle_state))
4474 + __get_cpu_var(cpu_idle_state) = 0;
4475 +
4476 +- tick_nohz_stop_sched_tick();
4477 +-
4478 + rmb();
4479 + idle = pm_idle;
4480 + if (!idle)
4481 +diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
4482 +index 9bdd830..20056db 100644
4483 +--- a/arch/x86/kernel/signal_32.c
4484 ++++ b/arch/x86/kernel/signal_32.c
4485 +@@ -396,7 +396,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
4486 + * The tracer may want to single-step inside the
4487 + * handler too.
4488 + */
4489 +- regs->eflags &= ~TF_MASK;
4490 ++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
4491 + if (test_thread_flag(TIF_SINGLESTEP))
4492 + ptrace_notify(SIGTRAP);
4493 +
4494 +@@ -489,7 +489,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
4495 + * The tracer may want to single-step inside the
4496 + * handler too.
4497 + */
4498 +- regs->eflags &= ~TF_MASK;
4499 ++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
4500 + if (test_thread_flag(TIF_SINGLESTEP))
4501 + ptrace_notify(SIGTRAP);
4502 +
4503 +diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
4504 +index ab086b0..62964c5 100644
4505 +--- a/arch/x86/kernel/signal_64.c
4506 ++++ b/arch/x86/kernel/signal_64.c
4507 +@@ -295,7 +295,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
4508 + see include/asm-x86_64/uaccess.h for details. */
4509 + set_fs(USER_DS);
4510 +
4511 +- regs->eflags &= ~TF_MASK;
4512 ++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
4513 + if (test_thread_flag(TIF_SINGLESTEP))
4514 + ptrace_notify(SIGTRAP);
4515 + #ifdef DEBUG_SIG
4516 +diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c
4517 +index 4ea80cb..fe200cf 100644
4518 +--- a/arch/x86/kernel/smpboot_32.c
4519 ++++ b/arch/x86/kernel/smpboot_32.c
4520 +@@ -405,7 +405,7 @@ static void __cpuinit start_secondary(void *unused)
4521 + setup_secondary_clock();
4522 + if (nmi_watchdog == NMI_IO_APIC) {
4523 + disable_8259A_irq(0);
4524 +- enable_NMI_through_LVT0(NULL);
4525 ++ enable_NMI_through_LVT0();
4526 + enable_8259A_irq(0);
4527 + }
4528 + /*
4529 +diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
4530 +index aaf4e12..eca8026 100644
4531 +--- a/arch/x86/kernel/smpboot_64.c
4532 ++++ b/arch/x86/kernel/smpboot_64.c
4533 +@@ -338,7 +338,7 @@ void __cpuinit start_secondary(void)
4534 +
4535 + if (nmi_watchdog == NMI_IO_APIC) {
4536 + disable_8259A_irq(0);
4537 +- enable_NMI_through_LVT0(NULL);
4538 ++ enable_NMI_through_LVT0();
4539 + enable_8259A_irq(0);
4540 + }
4541 +
4542 +diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
4543 +index 4df637e..6b521d3 100644
4544 +--- a/arch/x86/pci/mmconfig-shared.c
4545 ++++ b/arch/x86/pci/mmconfig-shared.c
4546 +@@ -22,42 +22,9 @@
4547 + #define MMCONFIG_APER_MIN (2 * 1024*1024)
4548 + #define MMCONFIG_APER_MAX (256 * 1024*1024)
4549 +
4550 +-DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
4551 +-
4552 + /* Indicate if the mmcfg resources have been placed into the resource table. */
4553 + static int __initdata pci_mmcfg_resources_inserted;
4554 +
4555 +-/* K8 systems have some devices (typically in the builtin northbridge)
4556 +- that are only accessible using type1
4557 +- Normally this can be expressed in the MCFG by not listing them
4558 +- and assigning suitable _SEGs, but this isn't implemented in some BIOS.
4559 +- Instead try to discover all devices on bus 0 that are unreachable using MM
4560 +- and fallback for them. */
4561 +-static void __init unreachable_devices(void)
4562 +-{
4563 +- int i, bus;
4564 +- /* Use the max bus number from ACPI here? */
4565 +- for (bus = 0; bus < PCI_MMCFG_MAX_CHECK_BUS; bus++) {
4566 +- for (i = 0; i < 32; i++) {
4567 +- unsigned int devfn = PCI_DEVFN(i, 0);
4568 +- u32 val1, val2;
4569 +-
4570 +- pci_conf1_read(0, bus, devfn, 0, 4, &val1);
4571 +- if (val1 == 0xffffffff)
4572 +- continue;
4573 +-
4574 +- if (pci_mmcfg_arch_reachable(0, bus, devfn)) {
4575 +- raw_pci_ops->read(0, bus, devfn, 0, 4, &val2);
4576 +- if (val1 == val2)
4577 +- continue;
4578 +- }
4579 +- set_bit(i + 32 * bus, pci_mmcfg_fallback_slots);
4580 +- printk(KERN_NOTICE "PCI: No mmconfig possible on device"
4581 +- " %02x:%02x\n", bus, i);
4582 +- }
4583 +- }
4584 +-}
4585 +-
4586 + static const char __init *pci_mmcfg_e7520(void)
4587 + {
4588 + u32 win;
4589 +@@ -270,8 +237,6 @@ void __init pci_mmcfg_init(int type)
4590 + return;
4591 +
4592 + if (pci_mmcfg_arch_init()) {
4593 +- if (type == 1)
4594 +- unreachable_devices();
4595 + if (known_bridge)
4596 + pci_mmcfg_insert_resources(IORESOURCE_BUSY);
4597 + pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
4598 +diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c
4599 +index 1bf5816..7b75e65 100644
4600 +--- a/arch/x86/pci/mmconfig_32.c
4601 ++++ b/arch/x86/pci/mmconfig_32.c
4602 +@@ -30,10 +30,6 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
4603 + struct acpi_mcfg_allocation *cfg;
4604 + int cfg_num;
4605 +
4606 +- if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS &&
4607 +- test_bit(PCI_SLOT(devfn) + 32*bus, pci_mmcfg_fallback_slots))
4608 +- return 0;
4609 +-
4610 + for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) {
4611 + cfg = &pci_mmcfg_config[cfg_num];
4612 + if (cfg->pci_segment == seg &&
4613 +@@ -68,13 +64,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
4614 + u32 base;
4615 +
4616 + if ((bus > 255) || (devfn > 255) || (reg > 4095)) {
4617 +- *value = -1;
4618 ++err: *value = -1;
4619 + return -EINVAL;
4620 + }
4621 +
4622 ++ if (reg < 256)
4623 ++ return pci_conf1_read(seg,bus,devfn,reg,len,value);
4624 ++
4625 + base = get_base_addr(seg, bus, devfn);
4626 + if (!base)
4627 +- return pci_conf1_read(seg,bus,devfn,reg,len,value);
4628 ++ goto err;
4629 +
4630 + spin_lock_irqsave(&pci_config_lock, flags);
4631 +
4632 +@@ -105,9 +104,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
4633 + if ((bus > 255) || (devfn > 255) || (reg > 4095))
4634 + return -EINVAL;
4635 +
4636 ++ if (reg < 256)
4637 ++ return pci_conf1_write(seg,bus,devfn,reg,len,value);
4638 ++
4639 + base = get_base_addr(seg, bus, devfn);
4640 + if (!base)
4641 +- return pci_conf1_write(seg,bus,devfn,reg,len,value);
4642 ++ return -EINVAL;
4643 +
4644 + spin_lock_irqsave(&pci_config_lock, flags);
4645 +
4646 +@@ -134,12 +136,6 @@ static struct pci_raw_ops pci_mmcfg = {
4647 + .write = pci_mmcfg_write,
4648 + };
4649 +
4650 +-int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
4651 +- unsigned int devfn)
4652 +-{
4653 +- return get_base_addr(seg, bus, devfn) != 0;
4654 +-}
4655 +-
4656 + int __init pci_mmcfg_arch_init(void)
4657 + {
4658 + printk(KERN_INFO "PCI: Using MMCONFIG\n");
4659 +diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c
4660 +index 4095e4d..c4cf318 100644
4661 +--- a/arch/x86/pci/mmconfig_64.c
4662 ++++ b/arch/x86/pci/mmconfig_64.c
4663 +@@ -40,9 +40,7 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus)
4664 + static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
4665 + {
4666 + char __iomem *addr;
4667 +- if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS &&
4668 +- test_bit(32*bus + PCI_SLOT(devfn), pci_mmcfg_fallback_slots))
4669 +- return NULL;
4670 ++
4671 + addr = get_virt(seg, bus);
4672 + if (!addr)
4673 + return NULL;
4674 +@@ -56,13 +54,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
4675 +
4676 + /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
4677 + if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) {
4678 +- *value = -1;
4679 ++err: *value = -1;
4680 + return -EINVAL;
4681 + }
4682 +
4683 ++ if (reg < 256)
4684 ++ return pci_conf1_read(seg,bus,devfn,reg,len,value);
4685 ++
4686 + addr = pci_dev_base(seg, bus, devfn);
4687 + if (!addr)
4688 +- return pci_conf1_read(seg,bus,devfn,reg,len,value);
4689 ++ goto err;
4690 +
4691 + switch (len) {
4692 + case 1:
4693 +@@ -88,9 +89,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
4694 + if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
4695 + return -EINVAL;
4696 +
4697 ++ if (reg < 256)
4698 ++ return pci_conf1_write(seg,bus,devfn,reg,len,value);
4699 ++
4700 + addr = pci_dev_base(seg, bus, devfn);
4701 + if (!addr)
4702 +- return pci_conf1_write(seg,bus,devfn,reg,len,value);
4703 ++ return -EINVAL;
4704 +
4705 + switch (len) {
4706 + case 1:
4707 +@@ -126,12 +130,6 @@ static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg)
4708 + return addr;
4709 + }
4710 +
4711 +-int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
4712 +- unsigned int devfn)
4713 +-{
4714 +- return pci_dev_base(seg, bus, devfn) != NULL;
4715 +-}
4716 +-
4717 + int __init pci_mmcfg_arch_init(void)
4718 + {
4719 + int i;
4720 +diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
4721 +index ac56d39..36cb44c 100644
4722 +--- a/arch/x86/pci/pci.h
4723 ++++ b/arch/x86/pci/pci.h
4724 +@@ -98,13 +98,6 @@ extern void pcibios_sort(void);
4725 +
4726 + /* pci-mmconfig.c */
4727 +
4728 +-/* Verify the first 16 busses. We assume that systems with more busses
4729 +- get MCFG right. */
4730 +-#define PCI_MMCFG_MAX_CHECK_BUS 16
4731 +-extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
4732 +-
4733 +-extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
4734 +- unsigned int devfn);
4735 + extern int __init pci_mmcfg_arch_init(void);
4736 +
4737 + /*
4738 +diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
4739 +index 2575f67..5c579d2 100644
4740 +--- a/crypto/async_tx/async_xor.c
4741 ++++ b/crypto/async_tx/async_xor.c
4742 +@@ -264,7 +264,7 @@ async_xor_zero_sum(struct page *dest, struct page **src_list,
4743 +
4744 + BUG_ON(src_cnt <= 1);
4745 +
4746 +- if (tx) {
4747 ++ if (tx && src_cnt <= device->max_xor) {
4748 + dma_addr_t dma_addr;
4749 + enum dma_data_direction dir;
4750 +
4751 +diff --git a/crypto/xcbc.c b/crypto/xcbc.c
4752 +index ac68f3b..a957373 100644
4753 +--- a/crypto/xcbc.c
4754 ++++ b/crypto/xcbc.c
4755 +@@ -124,6 +124,11 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
4756 + unsigned int offset = sg[i].offset;
4757 + unsigned int slen = sg[i].length;
4758 +
4759 ++ if (unlikely(slen > nbytes))
4760 ++ slen = nbytes;
4761 ++
4762 ++ nbytes -= slen;
4763 ++
4764 + while (slen > 0) {
4765 + unsigned int len = min(slen, ((unsigned int)(PAGE_SIZE)) - offset);
4766 + char *p = crypto_kmap(pg, 0) + offset;
4767 +@@ -177,7 +182,6 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
4768 + offset = 0;
4769 + pg++;
4770 + }
4771 +- nbytes-=sg[i].length;
4772 + i++;
4773 + } while (nbytes>0);
4774 +
4775 +diff --git a/crypto/xts.c b/crypto/xts.c
4776 +index 8eb08bf..d87b0f3 100644
4777 +--- a/crypto/xts.c
4778 ++++ b/crypto/xts.c
4779 +@@ -77,16 +77,16 @@ static int setkey(struct crypto_tfm *parent, const u8 *key,
4780 + }
4781 +
4782 + struct sinfo {
4783 +- be128 t;
4784 ++ be128 *t;
4785 + struct crypto_tfm *tfm;
4786 + void (*fn)(struct crypto_tfm *, u8 *, const u8 *);
4787 + };
4788 +
4789 + static inline void xts_round(struct sinfo *s, void *dst, const void *src)
4790 + {
4791 +- be128_xor(dst, &s->t, src); /* PP <- T xor P */
4792 ++ be128_xor(dst, s->t, src); /* PP <- T xor P */
4793 + s->fn(s->tfm, dst, dst); /* CC <- E(Key1,PP) */
4794 +- be128_xor(dst, dst, &s->t); /* C <- T xor CC */
4795 ++ be128_xor(dst, dst, s->t); /* C <- T xor CC */
4796 + }
4797 +
4798 + static int crypt(struct blkcipher_desc *d,
4799 +@@ -101,7 +101,6 @@ static int crypt(struct blkcipher_desc *d,
4800 + .tfm = crypto_cipher_tfm(ctx->child),
4801 + .fn = fn
4802 + };
4803 +- be128 *iv;
4804 + u8 *wsrc;
4805 + u8 *wdst;
4806 +
4807 +@@ -109,20 +108,20 @@ static int crypt(struct blkcipher_desc *d,
4808 + if (!w->nbytes)
4809 + return err;
4810 +
4811 ++ s.t = (be128 *)w->iv;
4812 + avail = w->nbytes;
4813 +
4814 + wsrc = w->src.virt.addr;
4815 + wdst = w->dst.virt.addr;
4816 +
4817 + /* calculate first value of T */
4818 +- iv = (be128 *)w->iv;
4819 +- tw(crypto_cipher_tfm(ctx->tweak), (void *)&s.t, w->iv);
4820 ++ tw(crypto_cipher_tfm(ctx->tweak), w->iv, w->iv);
4821 +
4822 + goto first;
4823 +
4824 + for (;;) {
4825 + do {
4826 +- gf128mul_x_ble(&s.t, &s.t);
4827 ++ gf128mul_x_ble(s.t, s.t);
4828 +
4829 + first:
4830 + xts_round(&s, wdst, wsrc);
4831 +diff --git a/drivers/acorn/char/defkeymap-l7200.c b/drivers/acorn/char/defkeymap-l7200.c
4832 +index 28a5fbc..93d80a1 100644
4833 +--- a/drivers/acorn/char/defkeymap-l7200.c
4834 ++++ b/drivers/acorn/char/defkeymap-l7200.c
4835 +@@ -347,40 +347,40 @@ char *func_table[MAX_NR_FUNC] = {
4836 + };
4837 +
4838 + struct kbdiacruc accent_table[MAX_DIACR] = {
4839 +- {'`', 'A', '\300'}, {'`', 'a', '\340'},
4840 +- {'\'', 'A', '\301'}, {'\'', 'a', '\341'},
4841 +- {'^', 'A', '\302'}, {'^', 'a', '\342'},
4842 +- {'~', 'A', '\303'}, {'~', 'a', '\343'},
4843 +- {'"', 'A', '\304'}, {'"', 'a', '\344'},
4844 +- {'O', 'A', '\305'}, {'o', 'a', '\345'},
4845 +- {'0', 'A', '\305'}, {'0', 'a', '\345'},
4846 +- {'A', 'A', '\305'}, {'a', 'a', '\345'},
4847 +- {'A', 'E', '\306'}, {'a', 'e', '\346'},
4848 +- {',', 'C', '\307'}, {',', 'c', '\347'},
4849 +- {'`', 'E', '\310'}, {'`', 'e', '\350'},
4850 +- {'\'', 'E', '\311'}, {'\'', 'e', '\351'},
4851 +- {'^', 'E', '\312'}, {'^', 'e', '\352'},
4852 +- {'"', 'E', '\313'}, {'"', 'e', '\353'},
4853 +- {'`', 'I', '\314'}, {'`', 'i', '\354'},
4854 +- {'\'', 'I', '\315'}, {'\'', 'i', '\355'},
4855 +- {'^', 'I', '\316'}, {'^', 'i', '\356'},
4856 +- {'"', 'I', '\317'}, {'"', 'i', '\357'},
4857 +- {'-', 'D', '\320'}, {'-', 'd', '\360'},
4858 +- {'~', 'N', '\321'}, {'~', 'n', '\361'},
4859 +- {'`', 'O', '\322'}, {'`', 'o', '\362'},
4860 +- {'\'', 'O', '\323'}, {'\'', 'o', '\363'},
4861 +- {'^', 'O', '\324'}, {'^', 'o', '\364'},
4862 +- {'~', 'O', '\325'}, {'~', 'o', '\365'},
4863 +- {'"', 'O', '\326'}, {'"', 'o', '\366'},
4864 +- {'/', 'O', '\330'}, {'/', 'o', '\370'},
4865 +- {'`', 'U', '\331'}, {'`', 'u', '\371'},
4866 +- {'\'', 'U', '\332'}, {'\'', 'u', '\372'},
4867 +- {'^', 'U', '\333'}, {'^', 'u', '\373'},
4868 +- {'"', 'U', '\334'}, {'"', 'u', '\374'},
4869 +- {'\'', 'Y', '\335'}, {'\'', 'y', '\375'},
4870 +- {'T', 'H', '\336'}, {'t', 'h', '\376'},
4871 +- {'s', 's', '\337'}, {'"', 'y', '\377'},
4872 +- {'s', 'z', '\337'}, {'i', 'j', '\377'},
4873 ++ {'`', 'A', 0300}, {'`', 'a', 0340},
4874 ++ {'\'', 'A', 0301}, {'\'', 'a', 0341},
4875 ++ {'^', 'A', 0302}, {'^', 'a', 0342},
4876 ++ {'~', 'A', 0303}, {'~', 'a', 0343},
4877 ++ {'"', 'A', 0304}, {'"', 'a', 0344},
4878 ++ {'O', 'A', 0305}, {'o', 'a', 0345},
4879 ++ {'0', 'A', 0305}, {'0', 'a', 0345},
4880 ++ {'A', 'A', 0305}, {'a', 'a', 0345},
4881 ++ {'A', 'E', 0306}, {'a', 'e', 0346},
4882 ++ {',', 'C', 0307}, {',', 'c', 0347},
4883 ++ {'`', 'E', 0310}, {'`', 'e', 0350},
4884 ++ {'\'', 'E', 0311}, {'\'', 'e', 0351},
4885 ++ {'^', 'E', 0312}, {'^', 'e', 0352},
4886 ++ {'"', 'E', 0313}, {'"', 'e', 0353},
4887 ++ {'`', 'I', 0314}, {'`', 'i', 0354},
4888 ++ {'\'', 'I', 0315}, {'\'', 'i', 0355},
4889 ++ {'^', 'I', 0316}, {'^', 'i', 0356},
4890 ++ {'"', 'I', 0317}, {'"', 'i', 0357},
4891 ++ {'-', 'D', 0320}, {'-', 'd', 0360},
4892 ++ {'~', 'N', 0321}, {'~', 'n', 0361},
4893 ++ {'`', 'O', 0322}, {'`', 'o', 0362},
4894 ++ {'\'', 'O', 0323}, {'\'', 'o', 0363},
4895 ++ {'^', 'O', 0324}, {'^', 'o', 0364},
4896 ++ {'~', 'O', 0325}, {'~', 'o', 0365},
4897 ++ {'"', 'O', 0326}, {'"', 'o', 0366},
4898 ++ {'/', 'O', 0330}, {'/', 'o', 0370},
4899 ++ {'`', 'U', 0331}, {'`', 'u', 0371},
4900 ++ {'\'', 'U', 0332}, {'\'', 'u', 0372},
4901 ++ {'^', 'U', 0333}, {'^', 'u', 0373},
4902 ++ {'"', 'U', 0334}, {'"', 'u', 0374},
4903 ++ {'\'', 'Y', 0335}, {'\'', 'y', 0375},
4904 ++ {'T', 'H', 0336}, {'t', 'h', 0376},
4905 ++ {'s', 's', 0337}, {'"', 'y', 0377},
4906 ++ {'s', 'z', 0337}, {'i', 'j', 0377},
4907 + };
4908 +
4909 + unsigned int accent_table_size = 68;
4910 +diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
4911 +index 0713872..a742efa 100644
4912 +--- a/drivers/ata/pata_hpt366.c
4913 ++++ b/drivers/ata/pata_hpt366.c
4914 +@@ -27,7 +27,7 @@
4915 + #include <linux/libata.h>
4916 +
4917 + #define DRV_NAME "pata_hpt366"
4918 +-#define DRV_VERSION "0.6.1"
4919 ++#define DRV_VERSION "0.6.2"
4920 +
4921 + struct hpt_clock {
4922 + u8 xfer_speed;
4923 +@@ -180,9 +180,9 @@ static unsigned long hpt366_filter(struct ata_device *adev, unsigned long mask)
4924 + if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
4925 + mask &= ~ATA_MASK_UDMA;
4926 + if (hpt_dma_blacklisted(adev, "UDMA3", bad_ata66_3))
4927 +- mask &= ~(0x07 << ATA_SHIFT_UDMA);
4928 ++ mask &= ~(0xF8 << ATA_SHIFT_UDMA);
4929 + if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4))
4930 +- mask &= ~(0x0F << ATA_SHIFT_UDMA);
4931 ++ mask &= ~(0xF0 << ATA_SHIFT_UDMA);
4932 + }
4933 + return ata_pci_default_filter(adev, mask);
4934 + }
4935 +diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
4936 +index c79f066..eac6a2b 100644
4937 +--- a/drivers/ata/pata_hpt37x.c
4938 ++++ b/drivers/ata/pata_hpt37x.c
4939 +@@ -24,7 +24,7 @@
4940 + #include <linux/libata.h>
4941 +
4942 + #define DRV_NAME "pata_hpt37x"
4943 +-#define DRV_VERSION "0.6.9"
4944 ++#define DRV_VERSION "0.6.11"
4945 +
4946 + struct hpt_clock {
4947 + u8 xfer_speed;
4948 +@@ -281,7 +281,7 @@ static unsigned long hpt370_filter(struct ata_device *adev, unsigned long mask)
4949 + if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
4950 + mask &= ~ATA_MASK_UDMA;
4951 + if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
4952 +- mask &= ~(0x1F << ATA_SHIFT_UDMA);
4953 ++ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
4954 + }
4955 + return ata_pci_default_filter(adev, mask);
4956 + }
4957 +@@ -297,7 +297,7 @@ static unsigned long hpt370a_filter(struct ata_device *adev, unsigned long mask)
4958 + {
4959 + if (adev->class == ATA_DEV_ATA) {
4960 + if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
4961 +- mask &= ~ (0x1F << ATA_SHIFT_UDMA);
4962 ++ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
4963 + }
4964 + return ata_pci_default_filter(adev, mask);
4965 + }
4966 +diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
4967 +index 8bed888..004cac7 100644
4968 +--- a/drivers/ata/pata_serverworks.c
4969 ++++ b/drivers/ata/pata_serverworks.c
4970 +@@ -226,7 +226,7 @@ static unsigned long serverworks_csb_filter(struct ata_device *adev, unsigned lo
4971 +
4972 + for (i = 0; (p = csb_bad_ata100[i]) != NULL; i++) {
4973 + if (!strcmp(p, model_num))
4974 +- mask &= ~(0x1F << ATA_SHIFT_UDMA);
4975 ++ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
4976 + }
4977 + return ata_pci_default_filter(adev, mask);
4978 + }
4979 +diff --git a/drivers/base/platform.c b/drivers/base/platform.c
4980 +index fb56092..39d8b7b 100644
4981 +--- a/drivers/base/platform.c
4982 ++++ b/drivers/base/platform.c
4983 +@@ -647,7 +647,7 @@ u64 dma_get_required_mask(struct device *dev)
4984 + high_totalram += high_totalram - 1;
4985 + mask = (((u64)high_totalram) << 32) + 0xffffffff;
4986 + }
4987 +- return mask & *dev->dma_mask;
4988 ++ return mask;
4989 + }
4990 + EXPORT_SYMBOL_GPL(dma_get_required_mask);
4991 + #endif
4992 +diff --git a/drivers/block/ub.c b/drivers/block/ub.c
4993 +index 08e909d..7aca466 100644
4994 +--- a/drivers/block/ub.c
4995 ++++ b/drivers/block/ub.c
4996 +@@ -657,7 +657,6 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
4997 + if ((cmd = ub_get_cmd(lun)) == NULL)
4998 + return -1;
4999 + memset(cmd, 0, sizeof(struct ub_scsi_cmd));
5000 +- sg_init_table(cmd->sgv, UB_MAX_REQ_SG);
5001 +
5002 + blkdev_dequeue_request(rq);
5003 +
5004 +@@ -668,6 +667,7 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
5005 + /*
5006 + * get scatterlist from block layer
5007 + */
5008 ++ sg_init_table(&urq->sgv[0], UB_MAX_REQ_SG);
5009 + n_elem = blk_rq_map_sg(lun->disk->queue, rq, &urq->sgv[0]);
5010 + if (n_elem < 0) {
5011 + /* Impossible, because blk_rq_map_sg should not hit ENOMEM. */
5012 +diff --git a/drivers/char/defkeymap.c_shipped b/drivers/char/defkeymap.c_shipped
5013 +index 0aa419a..d2208df 100644
5014 +--- a/drivers/char/defkeymap.c_shipped
5015 ++++ b/drivers/char/defkeymap.c_shipped
5016 +@@ -223,40 +223,40 @@ char *func_table[MAX_NR_FUNC] = {
5017 + };
5018 +
5019 + struct kbdiacruc accent_table[MAX_DIACR] = {
5020 +- {'`', 'A', '\300'}, {'`', 'a', '\340'},
5021 +- {'\'', 'A', '\301'}, {'\'', 'a', '\341'},
5022 +- {'^', 'A', '\302'}, {'^', 'a', '\342'},
5023 +- {'~', 'A', '\303'}, {'~', 'a', '\343'},
5024 +- {'"', 'A', '\304'}, {'"', 'a', '\344'},
5025 +- {'O', 'A', '\305'}, {'o', 'a', '\345'},
5026 +- {'0', 'A', '\305'}, {'0', 'a', '\345'},
5027 +- {'A', 'A', '\305'}, {'a', 'a', '\345'},
5028 +- {'A', 'E', '\306'}, {'a', 'e', '\346'},
5029 +- {',', 'C', '\307'}, {',', 'c', '\347'},
5030 +- {'`', 'E', '\310'}, {'`', 'e', '\350'},
5031 +- {'\'', 'E', '\311'}, {'\'', 'e', '\351'},
5032 +- {'^', 'E', '\312'}, {'^', 'e', '\352'},
5033 +- {'"', 'E', '\313'}, {'"', 'e', '\353'},
5034 +- {'`', 'I', '\314'}, {'`', 'i', '\354'},
5035 +- {'\'', 'I', '\315'}, {'\'', 'i', '\355'},
5036 +- {'^', 'I', '\316'}, {'^', 'i', '\356'},
5037 +- {'"', 'I', '\317'}, {'"', 'i', '\357'},
5038 +- {'-', 'D', '\320'}, {'-', 'd', '\360'},
5039 +- {'~', 'N', '\321'}, {'~', 'n', '\361'},
5040 +- {'`', 'O', '\322'}, {'`', 'o', '\362'},
5041 +- {'\'', 'O', '\323'}, {'\'', 'o', '\363'},
5042 +- {'^', 'O', '\324'}, {'^', 'o', '\364'},
5043 +- {'~', 'O', '\325'}, {'~', 'o', '\365'},
5044 +- {'"', 'O', '\326'}, {'"', 'o', '\366'},
5045 +- {'/', 'O', '\330'}, {'/', 'o', '\370'},
5046 +- {'`', 'U', '\331'}, {'`', 'u', '\371'},
5047 +- {'\'', 'U', '\332'}, {'\'', 'u', '\372'},
5048 +- {'^', 'U', '\333'}, {'^', 'u', '\373'},
5049 +- {'"', 'U', '\334'}, {'"', 'u', '\374'},
5050 +- {'\'', 'Y', '\335'}, {'\'', 'y', '\375'},
5051 +- {'T', 'H', '\336'}, {'t', 'h', '\376'},
5052 +- {'s', 's', '\337'}, {'"', 'y', '\377'},
5053 +- {'s', 'z', '\337'}, {'i', 'j', '\377'},
5054 ++ {'`', 'A', 0300}, {'`', 'a', 0340},
5055 ++ {'\'', 'A', 0301}, {'\'', 'a', 0341},
5056 ++ {'^', 'A', 0302}, {'^', 'a', 0342},
5057 ++ {'~', 'A', 0303}, {'~', 'a', 0343},
5058 ++ {'"', 'A', 0304}, {'"', 'a', 0344},
5059 ++ {'O', 'A', 0305}, {'o', 'a', 0345},
5060 ++ {'0', 'A', 0305}, {'0', 'a', 0345},
5061 ++ {'A', 'A', 0305}, {'a', 'a', 0345},
5062 ++ {'A', 'E', 0306}, {'a', 'e', 0346},
5063 ++ {',', 'C', 0307}, {',', 'c', 0347},
5064 ++ {'`', 'E', 0310}, {'`', 'e', 0350},
5065 ++ {'\'', 'E', 0311}, {'\'', 'e', 0351},
5066 ++ {'^', 'E', 0312}, {'^', 'e', 0352},
5067 ++ {'"', 'E', 0313}, {'"', 'e', 0353},
5068 ++ {'`', 'I', 0314}, {'`', 'i', 0354},
5069 ++ {'\'', 'I', 0315}, {'\'', 'i', 0355},
5070 ++ {'^', 'I', 0316}, {'^', 'i', 0356},
5071 ++ {'"', 'I', 0317}, {'"', 'i', 0357},
5072 ++ {'-', 'D', 0320}, {'-', 'd', 0360},
5073 ++ {'~', 'N', 0321}, {'~', 'n', 0361},
5074 ++ {'`', 'O', 0322}, {'`', 'o', 0362},
5075 ++ {'\'', 'O', 0323}, {'\'', 'o', 0363},
5076 ++ {'^', 'O', 0324}, {'^', 'o', 0364},
5077 ++ {'~', 'O', 0325}, {'~', 'o', 0365},
5078 ++ {'"', 'O', 0326}, {'"', 'o', 0366},
5079 ++ {'/', 'O', 0330}, {'/', 'o', 0370},
5080 ++ {'`', 'U', 0331}, {'`', 'u', 0371},
5081 ++ {'\'', 'U', 0332}, {'\'', 'u', 0372},
5082 ++ {'^', 'U', 0333}, {'^', 'u', 0373},
5083 ++ {'"', 'U', 0334}, {'"', 'u', 0374},
5084 ++ {'\'', 'Y', 0335}, {'\'', 'y', 0375},
5085 ++ {'T', 'H', 0336}, {'t', 'h', 0376},
5086 ++ {'s', 's', 0337}, {'"', 'y', 0377},
5087 ++ {'s', 'z', 0337}, {'i', 'j', 0377},
5088 + };
5089 +
5090 + unsigned int accent_table_size = 68;
5091 +diff --git a/drivers/char/vt.c b/drivers/char/vt.c
5092 +index 7a5badf..93cfe4a 100644
5093 +--- a/drivers/char/vt.c
5094 ++++ b/drivers/char/vt.c
5095 +@@ -702,6 +702,7 @@ void redraw_screen(struct vc_data *vc, int is_switch)
5096 + if (is_switch) {
5097 + set_leds();
5098 + compute_shiftstate();
5099 ++ notify_update(vc);
5100 + }
5101 + }
5102 +
5103 +diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
5104 +index 45e7b46..8cf542b 100644
5105 +--- a/drivers/dma/ioat_dma.c
5106 ++++ b/drivers/dma/ioat_dma.c
5107 +@@ -726,6 +726,7 @@ static struct dma_async_tx_descriptor *ioat1_dma_prep_memcpy(
5108 +
5109 + if (new) {
5110 + new->len = len;
5111 ++ new->async_tx.ack = 0;
5112 + return &new->async_tx;
5113 + } else
5114 + return NULL;
5115 +@@ -749,6 +750,7 @@ static struct dma_async_tx_descriptor *ioat2_dma_prep_memcpy(
5116 +
5117 + if (new) {
5118 + new->len = len;
5119 ++ new->async_tx.ack = 0;
5120 + return &new->async_tx;
5121 + } else
5122 + return NULL;
5123 +diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
5124 +index e4c94f9..c8d3ffb 100644
5125 +--- a/drivers/message/fusion/mptsas.c
5126 ++++ b/drivers/message/fusion/mptsas.c
5127 +@@ -1699,6 +1699,11 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info,
5128 + if (error)
5129 + goto out_free_consistent;
5130 +
5131 ++ if (!buffer->NumPhys) {
5132 ++ error = -ENODEV;
5133 ++ goto out_free_consistent;
5134 ++ }
5135 ++
5136 + /* save config data */
5137 + port_info->num_phys = buffer->NumPhys;
5138 + port_info->phy_info = kcalloc(port_info->num_phys,
5139 +diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
5140 +index 9cc5a6b..55584ee 100644
5141 +--- a/drivers/net/e1000e/netdev.c
5142 ++++ b/drivers/net/e1000e/netdev.c
5143 +@@ -1686,6 +1686,9 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
5144 + else
5145 + rctl |= E1000_RCTL_LPE;
5146 +
5147 ++ /* Enable hardware CRC frame stripping */
5148 ++ rctl |= E1000_RCTL_SECRC;
5149 ++
5150 + /* Setup buffer sizes */
5151 + rctl &= ~E1000_RCTL_SZ_4096;
5152 + rctl |= E1000_RCTL_BSEX;
5153 +@@ -1751,9 +1754,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
5154 +
5155 + /* Enable Packet split descriptors */
5156 + rctl |= E1000_RCTL_DTYP_PS;
5157 +-
5158 +- /* Enable hardware CRC frame stripping */
5159 +- rctl |= E1000_RCTL_SECRC;
5160 +
5161 + psrctl |= adapter->rx_ps_bsize0 >>
5162 + E1000_PSRCTL_BSIZE0_SHIFT;
5163 +diff --git a/drivers/net/macb.c b/drivers/net/macb.c
5164 +index e10528e..c796948 100644
5165 +--- a/drivers/net/macb.c
5166 ++++ b/drivers/net/macb.c
5167 +@@ -148,7 +148,7 @@ static void macb_handle_link_change(struct net_device *dev)
5168 +
5169 + if (phydev->duplex)
5170 + reg |= MACB_BIT(FD);
5171 +- if (phydev->speed)
5172 ++ if (phydev->speed == SPEED_100)
5173 + reg |= MACB_BIT(SPD);
5174 +
5175 + macb_writel(bp, NCFGR, reg);
5176 +diff --git a/drivers/net/niu.c b/drivers/net/niu.c
5177 +index 5f6beab..226dc54 100644
5178 +--- a/drivers/net/niu.c
5179 ++++ b/drivers/net/niu.c
5180 +@@ -33,8 +33,8 @@
5181 +
5182 + #define DRV_MODULE_NAME "niu"
5183 + #define PFX DRV_MODULE_NAME ": "
5184 +-#define DRV_MODULE_VERSION "0.6"
5185 +-#define DRV_MODULE_RELDATE "January 5, 2008"
5186 ++#define DRV_MODULE_VERSION "0.7"
5187 ++#define DRV_MODULE_RELDATE "February 18, 2008"
5188 +
5189 + static char version[] __devinitdata =
5190 + DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
5191 +@@ -1616,12 +1616,13 @@ static int niu_enable_alt_mac(struct niu *np, int index, int on)
5192 + if (index >= niu_num_alt_addr(np))
5193 + return -EINVAL;
5194 +
5195 +- if (np->flags & NIU_FLAGS_XMAC)
5196 ++ if (np->flags & NIU_FLAGS_XMAC) {
5197 + reg = XMAC_ADDR_CMPEN;
5198 +- else
5199 ++ mask = 1 << index;
5200 ++ } else {
5201 + reg = BMAC_ADDR_CMPEN;
5202 +-
5203 +- mask = 1 << index;
5204 ++ mask = 1 << (index + 1);
5205 ++ }
5206 +
5207 + val = nr64_mac(reg);
5208 + if (on)
5209 +@@ -5147,7 +5148,12 @@ static void niu_set_rx_mode(struct net_device *dev)
5210 + index++;
5211 + }
5212 + } else {
5213 +- for (i = 0; i < niu_num_alt_addr(np); i++) {
5214 ++ int alt_start;
5215 ++ if (np->flags & NIU_FLAGS_XMAC)
5216 ++ alt_start = 0;
5217 ++ else
5218 ++ alt_start = 1;
5219 ++ for (i = alt_start; i < niu_num_alt_addr(np); i++) {
5220 + err = niu_enable_alt_mac(np, i, 0);
5221 + if (err)
5222 + printk(KERN_WARNING PFX "%s: Error %d "
5223 +diff --git a/drivers/net/niu.h b/drivers/net/niu.h
5224 +index 0e8626a..59dc05f 100644
5225 +--- a/drivers/net/niu.h
5226 ++++ b/drivers/net/niu.h
5227 +@@ -499,7 +499,7 @@
5228 + #define BMAC_ADDR2 0x00110UL
5229 + #define BMAC_ADDR2_ADDR2 0x000000000000ffffULL
5230 +
5231 +-#define BMAC_NUM_ALT_ADDR 7
5232 ++#define BMAC_NUM_ALT_ADDR 6
5233 +
5234 + #define BMAC_ALT_ADDR0(NUM) (0x00118UL + (NUM)*0x18UL)
5235 + #define BMAC_ALT_ADDR0_ADDR0 0x000000000000ffffULL
5236 +diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
5237 +index 559a9a9..ddcc0c4 100644
5238 +--- a/drivers/net/wireless/b43/dma.c
5239 ++++ b/drivers/net/wireless/b43/dma.c
5240 +@@ -165,7 +165,7 @@ static void op64_fill_descriptor(struct b43_dmaring *ring,
5241 + addrhi = (((u64) dmaaddr >> 32) & ~SSB_DMA_TRANSLATION_MASK);
5242 + addrext = (((u64) dmaaddr >> 32) & SSB_DMA_TRANSLATION_MASK)
5243 + >> SSB_DMA_TRANSLATION_SHIFT;
5244 +- addrhi |= ssb_dma_translation(ring->dev->dev);
5245 ++ addrhi |= (ssb_dma_translation(ring->dev->dev) << 1);
5246 + if (slot == ring->nr_slots - 1)
5247 + ctl0 |= B43_DMA64_DCTL0_DTABLEEND;
5248 + if (start)
5249 +@@ -426,9 +426,21 @@ static inline
5250 + static int alloc_ringmemory(struct b43_dmaring *ring)
5251 + {
5252 + struct device *dev = ring->dev->dev->dev;
5253 +-
5254 ++ gfp_t flags = GFP_KERNEL;
5255 ++
5256 ++ /* The specs call for 4K buffers for 30- and 32-bit DMA with 4K
5257 ++ * alignment and 8K buffers for 64-bit DMA with 8K alignment. Testing
5258 ++ * has shown that 4K is sufficient for the latter as long as the buffer
5259 ++ * does not cross an 8K boundary.
5260 ++ *
5261 ++ * For unknown reasons - possibly a hardware error - the BCM4311 rev
5262 ++ * 02, which uses 64-bit DMA, needs the ring buffer in very low memory,
5263 ++ * which accounts for the GFP_DMA flag below.
5264 ++ */
5265 ++ if (ring->dma64)
5266 ++ flags |= GFP_DMA;
5267 + ring->descbase = dma_alloc_coherent(dev, B43_DMA_RINGMEMSIZE,
5268 +- &(ring->dmabase), GFP_KERNEL);
5269 ++ &(ring->dmabase), flags);
5270 + if (!ring->descbase) {
5271 + b43err(ring->dev->wl, "DMA ringmemory allocation failed\n");
5272 + return -ENOMEM;
5273 +@@ -483,7 +495,7 @@ int b43_dmacontroller_rx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
5274 + return 0;
5275 + }
5276 +
5277 +-/* Reset the RX DMA channel */
5278 ++/* Reset the TX DMA channel */
5279 + int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
5280 + {
5281 + int i;
5282 +@@ -647,7 +659,7 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
5283 + b43_dma_write(ring, B43_DMA64_TXRINGHI,
5284 + ((ringbase >> 32) &
5285 + ~SSB_DMA_TRANSLATION_MASK)
5286 +- | trans);
5287 ++ | (trans << 1));
5288 + } else {
5289 + u32 ringbase = (u32) (ring->dmabase);
5290 +
5291 +@@ -680,8 +692,9 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
5292 + b43_dma_write(ring, B43_DMA64_RXRINGHI,
5293 + ((ringbase >> 32) &
5294 + ~SSB_DMA_TRANSLATION_MASK)
5295 +- | trans);
5296 +- b43_dma_write(ring, B43_DMA64_RXINDEX, 200);
5297 ++ | (trans << 1));
5298 ++ b43_dma_write(ring, B43_DMA64_RXINDEX, ring->nr_slots *
5299 ++ sizeof(struct b43_dmadesc64));
5300 + } else {
5301 + u32 ringbase = (u32) (ring->dmabase);
5302 +
5303 +@@ -695,11 +708,12 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
5304 + b43_dma_write(ring, B43_DMA32_RXRING,
5305 + (ringbase & ~SSB_DMA_TRANSLATION_MASK)
5306 + | trans);
5307 +- b43_dma_write(ring, B43_DMA32_RXINDEX, 200);
5308 ++ b43_dma_write(ring, B43_DMA32_RXINDEX, ring->nr_slots *
5309 ++ sizeof(struct b43_dmadesc32));
5310 + }
5311 + }
5312 +
5313 +- out:
5314 ++out:
5315 + return err;
5316 + }
5317 +
5318 +diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
5319 +index 69795fd..36a1de2 100644
5320 +--- a/drivers/net/wireless/b43/main.c
5321 ++++ b/drivers/net/wireless/b43/main.c
5322 +@@ -101,6 +101,7 @@ static const struct ssb_device_id b43_ssb_tbl[] = {
5323 + SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 7),
5324 + SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 9),
5325 + SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 10),
5326 ++ SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 13),
5327 + SSB_DEVTABLE_END
5328 + };
5329 +
5330 +@@ -3079,7 +3080,7 @@ static int b43_phy_versioning(struct b43_wldev *dev)
5331 + unsupported = 1;
5332 + break;
5333 + case B43_PHYTYPE_G:
5334 +- if (phy_rev > 8)
5335 ++ if (phy_rev > 9)
5336 + unsupported = 1;
5337 + break;
5338 + default:
5339 +diff --git a/drivers/s390/char/defkeymap.c b/drivers/s390/char/defkeymap.c
5340 +index 389346c..07c7f31 100644
5341 +--- a/drivers/s390/char/defkeymap.c
5342 ++++ b/drivers/s390/char/defkeymap.c
5343 +@@ -151,8 +151,8 @@ char *func_table[MAX_NR_FUNC] = {
5344 + };
5345 +
5346 + struct kbdiacruc accent_table[MAX_DIACR] = {
5347 +- {'^', 'c', '\003'}, {'^', 'd', '\004'},
5348 +- {'^', 'z', '\032'}, {'^', '\012', '\000'},
5349 ++ {'^', 'c', 0003}, {'^', 'd', 0004},
5350 ++ {'^', 'z', 0032}, {'^', 0012, 0000},
5351 + };
5352 +
5353 + unsigned int accent_table_size = 4;
5354 +diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
5355 +index 38a1ee2..f40417b 100644
5356 +--- a/drivers/scsi/advansys.c
5357 ++++ b/drivers/scsi/advansys.c
5358 +@@ -566,7 +566,7 @@ typedef struct asc_dvc_var {
5359 + ASC_SCSI_BIT_ID_TYPE unit_not_ready;
5360 + ASC_SCSI_BIT_ID_TYPE queue_full_or_busy;
5361 + ASC_SCSI_BIT_ID_TYPE start_motor;
5362 +- uchar overrun_buf[ASC_OVERRUN_BSIZE] __aligned(8);
5363 ++ uchar *overrun_buf;
5364 + dma_addr_t overrun_dma;
5365 + uchar scsi_reset_wait;
5366 + uchar chip_no;
5367 +@@ -6439,7 +6439,7 @@ static int AdvLoadMicrocode(AdvPortAddr iop_base, unsigned char *buf, int size,
5368 + i += 2;
5369 + len += 2;
5370 + } else {
5371 +- unsigned char off = buf[i] * 2;
5372 ++ unsigned int off = buf[i] * 2;
5373 + unsigned short word = (buf[off + 1] << 8) | buf[off];
5374 + AdvWriteWordAutoIncLram(iop_base, word);
5375 + len += 2;
5376 +@@ -13833,6 +13833,12 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost,
5377 + */
5378 + if (ASC_NARROW_BOARD(boardp)) {
5379 + ASC_DBG(2, "AscInitAsc1000Driver()\n");
5380 ++
5381 ++ asc_dvc_varp->overrun_buf = kzalloc(ASC_OVERRUN_BSIZE, GFP_KERNEL);
5382 ++ if (!asc_dvc_varp->overrun_buf) {
5383 ++ ret = -ENOMEM;
5384 ++ goto err_free_wide_mem;
5385 ++ }
5386 + warn_code = AscInitAsc1000Driver(asc_dvc_varp);
5387 +
5388 + if (warn_code || asc_dvc_varp->err_code) {
5389 +@@ -13840,8 +13846,10 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost,
5390 + "warn 0x%x, error 0x%x\n",
5391 + asc_dvc_varp->init_state, warn_code,
5392 + asc_dvc_varp->err_code);
5393 +- if (asc_dvc_varp->err_code)
5394 ++ if (asc_dvc_varp->err_code) {
5395 + ret = -ENODEV;
5396 ++ kfree(asc_dvc_varp->overrun_buf);
5397 ++ }
5398 + }
5399 + } else {
5400 + if (advansys_wide_init_chip(shost))
5401 +@@ -13894,6 +13902,7 @@ static int advansys_release(struct Scsi_Host *shost)
5402 + dma_unmap_single(board->dev,
5403 + board->dvc_var.asc_dvc_var.overrun_dma,
5404 + ASC_OVERRUN_BSIZE, DMA_FROM_DEVICE);
5405 ++ kfree(board->dvc_var.asc_dvc_var.overrun_buf);
5406 + } else {
5407 + iounmap(board->ioremap_addr);
5408 + advansys_wide_free_mem(board);
5409 +diff --git a/drivers/scsi/aic94xx/aic94xx_scb.c b/drivers/scsi/aic94xx/aic94xx_scb.c
5410 +index db6ab1a..eae2d97 100644
5411 +--- a/drivers/scsi/aic94xx/aic94xx_scb.c
5412 ++++ b/drivers/scsi/aic94xx/aic94xx_scb.c
5413 +@@ -458,13 +458,19 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
5414 + tc_abort = le16_to_cpu(tc_abort);
5415 +
5416 + list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
5417 +- struct sas_task *task = ascb->uldd_task;
5418 ++ struct sas_task *task = a->uldd_task;
5419 ++
5420 ++ if (a->tc_index != tc_abort)
5421 ++ continue;
5422 +
5423 +- if (task && a->tc_index == tc_abort) {
5424 ++ if (task) {
5425 + failed_dev = task->dev;
5426 + sas_task_abort(task);
5427 +- break;
5428 ++ } else {
5429 ++ ASD_DPRINTK("R_T_A for non TASK scb 0x%x\n",
5430 ++ a->scb->header.opcode);
5431 + }
5432 ++ break;
5433 + }
5434 +
5435 + if (!failed_dev) {
5436 +@@ -478,7 +484,7 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
5437 + * that the EH will wake up and do something.
5438 + */
5439 + list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
5440 +- struct sas_task *task = ascb->uldd_task;
5441 ++ struct sas_task *task = a->uldd_task;
5442 +
5443 + if (task &&
5444 + task->dev == failed_dev &&
5445 +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
5446 +index d466a2d..dcd6c9a 100644
5447 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c
5448 ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c
5449 +@@ -1380,17 +1380,16 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
5450 + switch(controlcode) {
5451 +
5452 + case ARCMSR_MESSAGE_READ_RQBUFFER: {
5453 +- unsigned long *ver_addr;
5454 +- dma_addr_t buf_handle;
5455 ++ unsigned char *ver_addr;
5456 + uint8_t *pQbuffer, *ptmpQbuffer;
5457 + int32_t allxfer_len = 0;
5458 +
5459 +- ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
5460 ++ ver_addr = kmalloc(1032, GFP_ATOMIC);
5461 + if (!ver_addr) {
5462 + retvalue = ARCMSR_MESSAGE_FAIL;
5463 + goto message_out;
5464 + }
5465 +- ptmpQbuffer = (uint8_t *) ver_addr;
5466 ++ ptmpQbuffer = ver_addr;
5467 + while ((acb->rqbuf_firstindex != acb->rqbuf_lastindex)
5468 + && (allxfer_len < 1031)) {
5469 + pQbuffer = &acb->rqbuffer[acb->rqbuf_firstindex];
5470 +@@ -1419,25 +1418,24 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
5471 + }
5472 + arcmsr_iop_message_read(acb);
5473 + }
5474 +- memcpy(pcmdmessagefld->messagedatabuffer, (uint8_t *)ver_addr, allxfer_len);
5475 ++ memcpy(pcmdmessagefld->messagedatabuffer, ver_addr, allxfer_len);
5476 + pcmdmessagefld->cmdmessage.Length = allxfer_len;
5477 + pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK;
5478 +- pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
5479 ++ kfree(ver_addr);
5480 + }
5481 + break;
5482 +
5483 + case ARCMSR_MESSAGE_WRITE_WQBUFFER: {
5484 +- unsigned long *ver_addr;
5485 +- dma_addr_t buf_handle;
5486 ++ unsigned char *ver_addr;
5487 + int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex;
5488 + uint8_t *pQbuffer, *ptmpuserbuffer;
5489 +
5490 +- ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
5491 ++ ver_addr = kmalloc(1032, GFP_ATOMIC);
5492 + if (!ver_addr) {
5493 + retvalue = ARCMSR_MESSAGE_FAIL;
5494 + goto message_out;
5495 + }
5496 +- ptmpuserbuffer = (uint8_t *)ver_addr;
5497 ++ ptmpuserbuffer = ver_addr;
5498 + user_len = pcmdmessagefld->cmdmessage.Length;
5499 + memcpy(ptmpuserbuffer, pcmdmessagefld->messagedatabuffer, user_len);
5500 + wqbuf_lastindex = acb->wqbuf_lastindex;
5501 +@@ -1483,7 +1481,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
5502 + retvalue = ARCMSR_MESSAGE_FAIL;
5503 + }
5504 + }
5505 +- pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
5506 ++ kfree(ver_addr);
5507 + }
5508 + break;
5509 +
5510 +diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
5511 +index 8eb78be..b8b67f6 100644
5512 +--- a/drivers/scsi/gdth.c
5513 ++++ b/drivers/scsi/gdth.c
5514 +@@ -160,7 +160,7 @@ static void gdth_readapp_event(gdth_ha_str *ha, unchar application,
5515 + static void gdth_clear_events(void);
5516 +
5517 + static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
5518 +- char *buffer, ushort count, int to_buffer);
5519 ++ char *buffer, ushort count);
5520 + static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp);
5521 + static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, ushort hdrive);
5522 +
5523 +@@ -183,7 +183,6 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
5524 + unsigned int cmd, unsigned long arg);
5525 +
5526 + static void gdth_flush(gdth_ha_str *ha);
5527 +-static int gdth_halt(struct notifier_block *nb, ulong event, void *buf);
5528 + static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *));
5529 + static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,
5530 + struct gdth_cmndinfo *cmndinfo);
5531 +@@ -418,12 +417,6 @@ static inline void gdth_set_sglist(struct scsi_cmnd *cmd,
5532 + #include "gdth_proc.h"
5533 + #include "gdth_proc.c"
5534 +
5535 +-/* notifier block to get a notify on system shutdown/halt/reboot */
5536 +-static struct notifier_block gdth_notifier = {
5537 +- gdth_halt, NULL, 0
5538 +-};
5539 +-static int notifier_disabled = 0;
5540 +-
5541 + static gdth_ha_str *gdth_find_ha(int hanum)
5542 + {
5543 + gdth_ha_str *ha;
5544 +@@ -446,8 +439,8 @@ static struct gdth_cmndinfo *gdth_get_cmndinfo(gdth_ha_str *ha)
5545 + for (i=0; i<GDTH_MAXCMDS; ++i) {
5546 + if (ha->cmndinfo[i].index == 0) {
5547 + priv = &ha->cmndinfo[i];
5548 +- priv->index = i+1;
5549 + memset(priv, 0, sizeof(*priv));
5550 ++ priv->index = i+1;
5551 + break;
5552 + }
5553 + }
5554 +@@ -494,7 +487,6 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
5555 + gdth_ha_str *ha = shost_priv(sdev->host);
5556 + Scsi_Cmnd *scp;
5557 + struct gdth_cmndinfo cmndinfo;
5558 +- struct scatterlist one_sg;
5559 + DECLARE_COMPLETION_ONSTACK(wait);
5560 + int rval;
5561 +
5562 +@@ -508,13 +500,10 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
5563 + /* use request field to save the ptr. to completion struct. */
5564 + scp->request = (struct request *)&wait;
5565 + scp->timeout_per_command = timeout*HZ;
5566 +- sg_init_one(&one_sg, gdtcmd, sizeof(*gdtcmd));
5567 +- gdth_set_sglist(scp, &one_sg);
5568 +- gdth_set_sg_count(scp, 1);
5569 +- gdth_set_bufflen(scp, sizeof(*gdtcmd));
5570 + scp->cmd_len = 12;
5571 + memcpy(scp->cmnd, cmnd, 12);
5572 + cmndinfo.priority = IOCTL_PRI;
5573 ++ cmndinfo.internal_cmd_str = gdtcmd;
5574 + cmndinfo.internal_command = 1;
5575 +
5576 + TRACE(("__gdth_execute() cmd 0x%x\n", scp->cmnd[0]));
5577 +@@ -2355,7 +2344,7 @@ static void gdth_next(gdth_ha_str *ha)
5578 + * buffers, kmap_atomic() as needed.
5579 + */
5580 + static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
5581 +- char *buffer, ushort count, int to_buffer)
5582 ++ char *buffer, ushort count)
5583 + {
5584 + ushort cpcount,i, max_sg = gdth_sg_count(scp);
5585 + ushort cpsum,cpnow;
5586 +@@ -2381,10 +2370,7 @@ static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
5587 + }
5588 + local_irq_save(flags);
5589 + address = kmap_atomic(sg_page(sl), KM_BIO_SRC_IRQ) + sl->offset;
5590 +- if (to_buffer)
5591 +- memcpy(buffer, address, cpnow);
5592 +- else
5593 +- memcpy(address, buffer, cpnow);
5594 ++ memcpy(address, buffer, cpnow);
5595 + flush_dcache_page(sg_page(sl));
5596 + kunmap_atomic(address, KM_BIO_SRC_IRQ);
5597 + local_irq_restore(flags);
5598 +@@ -2438,7 +2424,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
5599 + strcpy(inq.vendor,ha->oem_name);
5600 + sprintf(inq.product,"Host Drive #%02d",t);
5601 + strcpy(inq.revision," ");
5602 +- gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data), 0);
5603 ++ gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data));
5604 + break;
5605 +
5606 + case REQUEST_SENSE:
5607 +@@ -2448,7 +2434,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
5608 + sd.key = NO_SENSE;
5609 + sd.info = 0;
5610 + sd.add_length= 0;
5611 +- gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data), 0);
5612 ++ gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data));
5613 + break;
5614 +
5615 + case MODE_SENSE:
5616 +@@ -2460,7 +2446,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
5617 + mpd.bd.block_length[0] = (SECTOR_SIZE & 0x00ff0000) >> 16;
5618 + mpd.bd.block_length[1] = (SECTOR_SIZE & 0x0000ff00) >> 8;
5619 + mpd.bd.block_length[2] = (SECTOR_SIZE & 0x000000ff);
5620 +- gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data), 0);
5621 ++ gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data));
5622 + break;
5623 +
5624 + case READ_CAPACITY:
5625 +@@ -2470,7 +2456,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
5626 + else
5627 + rdc.last_block_no = cpu_to_be32(ha->hdr[t].size-1);
5628 + rdc.block_length = cpu_to_be32(SECTOR_SIZE);
5629 +- gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data), 0);
5630 ++ gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data));
5631 + break;
5632 +
5633 + case SERVICE_ACTION_IN:
5634 +@@ -2482,7 +2468,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
5635 + rdc16.last_block_no = cpu_to_be64(ha->hdr[t].size-1);
5636 + rdc16.block_length = cpu_to_be32(SECTOR_SIZE);
5637 + gdth_copy_internal_data(ha, scp, (char*)&rdc16,
5638 +- sizeof(gdth_rdcap16_data), 0);
5639 ++ sizeof(gdth_rdcap16_data));
5640 + } else {
5641 + scp->result = DID_ABORT << 16;
5642 + }
5643 +@@ -2852,6 +2838,7 @@ static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b)
5644 + static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
5645 + {
5646 + register gdth_cmd_str *cmdp;
5647 ++ struct gdth_cmndinfo *cmndinfo = gdth_cmnd_priv(scp);
5648 + int cmd_index;
5649 +
5650 + cmdp= ha->pccb;
5651 +@@ -2860,7 +2847,7 @@ static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
5652 + if (ha->type==GDT_EISA && ha->cmd_cnt>0)
5653 + return 0;
5654 +
5655 +- gdth_copy_internal_data(ha, scp, (char *)cmdp, sizeof(gdth_cmd_str), 1);
5656 ++ *cmdp = *cmndinfo->internal_cmd_str;
5657 + cmdp->RequestBuffer = scp;
5658 +
5659 + /* search free command index */
5660 +@@ -3793,6 +3780,8 @@ static void gdth_timeout(ulong data)
5661 + gdth_ha_str *ha;
5662 + ulong flags;
5663 +
5664 ++ BUG_ON(list_empty(&gdth_instances));
5665 ++
5666 + ha = list_first_entry(&gdth_instances, gdth_ha_str, list);
5667 + spin_lock_irqsave(&ha->smp_lock, flags);
5668 +
5669 +@@ -4668,45 +4657,6 @@ static void gdth_flush(gdth_ha_str *ha)
5670 + }
5671 + }
5672 +
5673 +-/* shutdown routine */
5674 +-static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
5675 +-{
5676 +- gdth_ha_str *ha;
5677 +-#ifndef __alpha__
5678 +- gdth_cmd_str gdtcmd;
5679 +- char cmnd[MAX_COMMAND_SIZE];
5680 +-#endif
5681 +-
5682 +- if (notifier_disabled)
5683 +- return NOTIFY_OK;
5684 +-
5685 +- TRACE2(("gdth_halt() event %d\n",(int)event));
5686 +- if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
5687 +- return NOTIFY_DONE;
5688 +-
5689 +- notifier_disabled = 1;
5690 +- printk("GDT-HA: Flushing all host drives .. ");
5691 +- list_for_each_entry(ha, &gdth_instances, list) {
5692 +- gdth_flush(ha);
5693 +-
5694 +-#ifndef __alpha__
5695 +- /* controller reset */
5696 +- memset(cmnd, 0xff, MAX_COMMAND_SIZE);
5697 +- gdtcmd.BoardNode = LOCALBOARD;
5698 +- gdtcmd.Service = CACHESERVICE;
5699 +- gdtcmd.OpCode = GDT_RESET;
5700 +- TRACE2(("gdth_halt(): reset controller %d\n", ha->hanum));
5701 +- gdth_execute(ha->shost, &gdtcmd, cmnd, 10, NULL);
5702 +-#endif
5703 +- }
5704 +- printk("Done.\n");
5705 +-
5706 +-#ifdef GDTH_STATISTICS
5707 +- del_timer(&gdth_timer);
5708 +-#endif
5709 +- return NOTIFY_OK;
5710 +-}
5711 +-
5712 + /* configure lun */
5713 + static int gdth_slave_configure(struct scsi_device *sdev)
5714 + {
5715 +@@ -5141,13 +5091,13 @@ static void gdth_remove_one(gdth_ha_str *ha)
5716 +
5717 + scsi_remove_host(shp);
5718 +
5719 ++ gdth_flush(ha);
5720 ++
5721 + if (ha->sdev) {
5722 + scsi_free_host_dev(ha->sdev);
5723 + ha->sdev = NULL;
5724 + }
5725 +
5726 +- gdth_flush(ha);
5727 +-
5728 + if (shp->irq)
5729 + free_irq(shp->irq,ha);
5730 +
5731 +@@ -5173,6 +5123,24 @@ static void gdth_remove_one(gdth_ha_str *ha)
5732 + scsi_host_put(shp);
5733 + }
5734 +
5735 ++static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
5736 ++{
5737 ++ gdth_ha_str *ha;
5738 ++
5739 ++ TRACE2(("gdth_halt() event %d\n", (int)event));
5740 ++ if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
5741 ++ return NOTIFY_DONE;
5742 ++
5743 ++ list_for_each_entry(ha, &gdth_instances, list)
5744 ++ gdth_flush(ha);
5745 ++
5746 ++ return NOTIFY_OK;
5747 ++}
5748 ++
5749 ++static struct notifier_block gdth_notifier = {
5750 ++ gdth_halt, NULL, 0
5751 ++};
5752 ++
5753 + static int __init gdth_init(void)
5754 + {
5755 + if (disable) {
5756 +@@ -5235,7 +5203,6 @@ static int __init gdth_init(void)
5757 + add_timer(&gdth_timer);
5758 + #endif
5759 + major = register_chrdev(0,"gdth", &gdth_fops);
5760 +- notifier_disabled = 0;
5761 + register_reboot_notifier(&gdth_notifier);
5762 + gdth_polling = FALSE;
5763 + return 0;
5764 +@@ -5245,14 +5212,15 @@ static void __exit gdth_exit(void)
5765 + {
5766 + gdth_ha_str *ha;
5767 +
5768 +- list_for_each_entry(ha, &gdth_instances, list)
5769 +- gdth_remove_one(ha);
5770 ++ unregister_chrdev(major, "gdth");
5771 ++ unregister_reboot_notifier(&gdth_notifier);
5772 +
5773 + #ifdef GDTH_STATISTICS
5774 +- del_timer(&gdth_timer);
5775 ++ del_timer_sync(&gdth_timer);
5776 + #endif
5777 +- unregister_chrdev(major,"gdth");
5778 +- unregister_reboot_notifier(&gdth_notifier);
5779 ++
5780 ++ list_for_each_entry(ha, &gdth_instances, list)
5781 ++ gdth_remove_one(ha);
5782 + }
5783 +
5784 + module_init(gdth_init);
5785 +diff --git a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h
5786 +index 1434c6b..26e4e92 100644
5787 +--- a/drivers/scsi/gdth.h
5788 ++++ b/drivers/scsi/gdth.h
5789 +@@ -915,6 +915,7 @@ typedef struct {
5790 + struct gdth_cmndinfo { /* per-command private info */
5791 + int index;
5792 + int internal_command; /* don't call scsi_done */
5793 ++ gdth_cmd_str *internal_cmd_str; /* crier for internal messages*/
5794 + dma_addr_t sense_paddr; /* sense dma-addr */
5795 + unchar priority;
5796 + int timeout;
5797 +diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
5798 +index de57734..ce0228e 100644
5799 +--- a/drivers/scsi/gdth_proc.c
5800 ++++ b/drivers/scsi/gdth_proc.c
5801 +@@ -694,15 +694,13 @@ static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, ulong64 paddr)
5802 + {
5803 + ulong flags;
5804 +
5805 +- spin_lock_irqsave(&ha->smp_lock, flags);
5806 +-
5807 + if (buf == ha->pscratch) {
5808 ++ spin_lock_irqsave(&ha->smp_lock, flags);
5809 + ha->scratch_busy = FALSE;
5810 ++ spin_unlock_irqrestore(&ha->smp_lock, flags);
5811 + } else {
5812 + pci_free_consistent(ha->pdev, size, buf, paddr);
5813 + }
5814 +-
5815 +- spin_unlock_irqrestore(&ha->smp_lock, flags);
5816 + }
5817 +
5818 + #ifdef GDTH_IOCTL_PROC
5819 +diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
5820 +index 5c5a9b2..f4e9c8d 100644
5821 +--- a/drivers/scsi/ips.c
5822 ++++ b/drivers/scsi/ips.c
5823 +@@ -1580,7 +1580,7 @@ ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr)
5824 + METHOD_TRACE("ips_make_passthru", 1);
5825 +
5826 + scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i)
5827 +- length += sg[i].length;
5828 ++ length += sg->length;
5829 +
5830 + if (length < sizeof (ips_passthru_t)) {
5831 + /* wrong size */
5832 +@@ -6842,13 +6842,10 @@ ips_register_scsi(int index)
5833 + if (request_irq(ha->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) {
5834 + IPS_PRINTK(KERN_WARNING, ha->pcidev,
5835 + "Unable to install interrupt handler\n");
5836 +- scsi_host_put(sh);
5837 +- return -1;
5838 ++ goto err_out_sh;
5839 + }
5840 +
5841 + kfree(oldha);
5842 +- ips_sh[index] = sh;
5843 +- ips_ha[index] = ha;
5844 +
5845 + /* Store away needed values for later use */
5846 + sh->io_port = ha->io_addr;
5847 +@@ -6867,10 +6864,21 @@ ips_register_scsi(int index)
5848 + sh->max_channel = ha->nbus - 1;
5849 + sh->can_queue = ha->max_cmds - 1;
5850 +
5851 +- scsi_add_host(sh, NULL);
5852 ++ if (scsi_add_host(sh, &ha->pcidev->dev))
5853 ++ goto err_out;
5854 ++
5855 ++ ips_sh[index] = sh;
5856 ++ ips_ha[index] = ha;
5857 ++
5858 + scsi_scan_host(sh);
5859 +
5860 + return 0;
5861 ++
5862 ++err_out:
5863 ++ free_irq(ha->pcidev->irq, ha);
5864 ++err_out_sh:
5865 ++ scsi_host_put(sh);
5866 ++ return -1;
5867 + }
5868 +
5869 + /*---------------------------------------------------------------------------*/
5870 +diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
5871 +index a9ac5b1..273728e 100644
5872 +--- a/drivers/scsi/scsi_lib.c
5873 ++++ b/drivers/scsi/scsi_lib.c
5874 +@@ -298,7 +298,6 @@ static int scsi_req_map_sg(struct request *rq, struct scatterlist *sgl,
5875 + page = sg_page(sg);
5876 + off = sg->offset;
5877 + len = sg->length;
5878 +- data_len += len;
5879 +
5880 + while (len > 0 && data_len > 0) {
5881 + /*
5882 +diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
5883 +index ff10808..e9d7959 100644
5884 +--- a/drivers/spi/atmel_spi.c
5885 ++++ b/drivers/spi/atmel_spi.c
5886 +@@ -85,6 +85,16 @@ static void cs_activate(struct atmel_spi *as, struct spi_device *spi)
5887 + unsigned gpio = (unsigned) spi->controller_data;
5888 + unsigned active = spi->mode & SPI_CS_HIGH;
5889 + u32 mr;
5890 ++ int i;
5891 ++ u32 csr;
5892 ++ u32 cpol = (spi->mode & SPI_CPOL) ? SPI_BIT(CPOL) : 0;
5893 ++
5894 ++ /* Make sure clock polarity is correct */
5895 ++ for (i = 0; i < spi->master->num_chipselect; i++) {
5896 ++ csr = spi_readl(as, CSR0 + 4 * i);
5897 ++ if ((csr ^ cpol) & SPI_BIT(CPOL))
5898 ++ spi_writel(as, CSR0 + 4 * i, csr ^ SPI_BIT(CPOL));
5899 ++ }
5900 +
5901 + mr = spi_readl(as, MR);
5902 + mr = SPI_BFINS(PCS, ~(1 << spi->chip_select), mr);
5903 +diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
5904 +index 1c2ab54..840e682 100644
5905 +--- a/drivers/spi/pxa2xx_spi.c
5906 ++++ b/drivers/spi/pxa2xx_spi.c
5907 +@@ -48,13 +48,19 @@ MODULE_LICENSE("GPL");
5908 + #define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK)
5909 + #define IS_DMA_ALIGNED(x) (((u32)(x)&0x07)==0)
5910 +
5911 +-/* for testing SSCR1 changes that require SSP restart, basically
5912 +- * everything except the service and interrupt enables */
5913 +-#define SSCR1_CHANGE_MASK (SSCR1_TTELP | SSCR1_TTE | SSCR1_EBCEI | SSCR1_SCFR \
5914 ++/*
5915 ++ * for testing SSCR1 changes that require SSP restart, basically
5916 ++ * everything except the service and interrupt enables, the pxa270 developer
5917 ++ * manual says only SSCR1_SCFR, SSCR1_SPH, SSCR1_SPO need to be in this
5918 ++ * list, but the PXA255 dev man says all bits without really meaning the
5919 ++ * service and interrupt enables
5920 ++ */
5921 ++#define SSCR1_CHANGE_MASK (SSCR1_TTELP | SSCR1_TTE | SSCR1_SCFR \
5922 + | SSCR1_ECRA | SSCR1_ECRB | SSCR1_SCLKDIR \
5923 +- | SSCR1_RWOT | SSCR1_TRAIL | SSCR1_PINTE \
5924 +- | SSCR1_STRF | SSCR1_EFWR |SSCR1_RFT \
5925 +- | SSCR1_TFT | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM)
5926 ++ | SSCR1_SFRMDIR | SSCR1_RWOT | SSCR1_TRAIL \
5927 ++ | SSCR1_IFS | SSCR1_STRF | SSCR1_EFWR \
5928 ++ | SSCR1_RFT | SSCR1_TFT | SSCR1_MWDS \
5929 ++ | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM)
5930 +
5931 + #define DEFINE_SSP_REG(reg, off) \
5932 + static inline u32 read_##reg(void *p) { return __raw_readl(p + (off)); } \
5933 +@@ -961,9 +967,6 @@ static void pump_transfers(unsigned long data)
5934 + if (drv_data->ssp_type == PXA25x_SSP)
5935 + DCMD(drv_data->tx_channel) |= DCMD_ENDIRQEN;
5936 +
5937 +- /* Fix me, need to handle cs polarity */
5938 +- drv_data->cs_control(PXA2XX_CS_ASSERT);
5939 +-
5940 + /* Clear status and start DMA engine */
5941 + cr1 = chip->cr1 | dma_thresh | drv_data->dma_cr1;
5942 + write_SSSR(drv_data->clear_sr, reg);
5943 +@@ -973,9 +976,6 @@ static void pump_transfers(unsigned long data)
5944 + /* Ensure we have the correct interrupt handler */
5945 + drv_data->transfer_handler = interrupt_transfer;
5946 +
5947 +- /* Fix me, need to handle cs polarity */
5948 +- drv_data->cs_control(PXA2XX_CS_ASSERT);
5949 +-
5950 + /* Clear status */
5951 + cr1 = chip->cr1 | chip->threshold | drv_data->int_cr1;
5952 + write_SSSR(drv_data->clear_sr, reg);
5953 +@@ -986,16 +986,29 @@ static void pump_transfers(unsigned long data)
5954 + || (read_SSCR1(reg) & SSCR1_CHANGE_MASK) !=
5955 + (cr1 & SSCR1_CHANGE_MASK)) {
5956 +
5957 ++ /* stop the SSP, and update the other bits */
5958 + write_SSCR0(cr0 & ~SSCR0_SSE, reg);
5959 + if (drv_data->ssp_type != PXA25x_SSP)
5960 + write_SSTO(chip->timeout, reg);
5961 +- write_SSCR1(cr1, reg);
5962 ++ /* first set CR1 without interrupt and service enables */
5963 ++ write_SSCR1(cr1 & SSCR1_CHANGE_MASK, reg);
5964 ++ /* restart the SSP */
5965 + write_SSCR0(cr0, reg);
5966 ++
5967 + } else {
5968 + if (drv_data->ssp_type != PXA25x_SSP)
5969 + write_SSTO(chip->timeout, reg);
5970 +- write_SSCR1(cr1, reg);
5971 + }
5972 ++
5973 ++ /* FIXME, need to handle cs polarity,
5974 ++ * this driver uses struct pxa2xx_spi_chip.cs_control to
5975 ++ * specify a CS handling function, and it ignores most
5976 ++ * struct spi_device.mode[s], including SPI_CS_HIGH */
5977 ++ drv_data->cs_control(PXA2XX_CS_ASSERT);
5978 ++
5979 ++ /* after chip select, release the data by enabling service
5980 ++ * requests and interrupts, without changing any mode bits */
5981 ++ write_SSCR1(cr1, reg);
5982 + }
5983 +
5984 + static void pump_messages(struct work_struct *work)
5985 +diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
5986 +index b10f39c..d1df9e9 100644
5987 +--- a/drivers/usb/host/ehci-q.c
5988 ++++ b/drivers/usb/host/ehci-q.c
5989 +@@ -315,10 +315,10 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
5990 + if (likely (last->urb != urb)) {
5991 + ehci_urb_done(ehci, last->urb, last_status);
5992 + count++;
5993 ++ last_status = -EINPROGRESS;
5994 + }
5995 + ehci_qtd_free (ehci, last);
5996 + last = NULL;
5997 +- last_status = -EINPROGRESS;
5998 + }
5999 +
6000 + /* ignore urbs submitted during completions we reported */
6001 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
6002 +index 1382af9..c04beac 100644
6003 +--- a/drivers/usb/serial/ftdi_sio.c
6004 ++++ b/drivers/usb/serial/ftdi_sio.c
6005 +@@ -310,6 +310,7 @@ struct ftdi_sio_quirk {
6006 + };
6007 +
6008 + static int ftdi_olimex_probe (struct usb_serial *serial);
6009 ++static int ftdi_mtxorb_hack_setup (struct usb_serial *serial);
6010 + static void ftdi_USB_UIRT_setup (struct ftdi_private *priv);
6011 + static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv);
6012 +
6013 +@@ -317,6 +318,10 @@ static struct ftdi_sio_quirk ftdi_olimex_quirk = {
6014 + .probe = ftdi_olimex_probe,
6015 + };
6016 +
6017 ++static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = {
6018 ++ .probe = ftdi_mtxorb_hack_setup,
6019 ++};
6020 ++
6021 + static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
6022 + .port_probe = ftdi_USB_UIRT_setup,
6023 + };
6024 +@@ -379,6 +384,8 @@ static struct usb_device_id id_table_combined [] = {
6025 + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) },
6026 + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) },
6027 + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
6028 ++ { USB_DEVICE(MTXORB_VK_VID, MTXORB_VK_PID),
6029 ++ .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
6030 + { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
6031 + { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
6032 + { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
6033 +@@ -492,6 +499,7 @@ static struct usb_device_id id_table_combined [] = {
6034 + { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) },
6035 + { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) },
6036 + { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) },
6037 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) },
6038 + { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) },
6039 + { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) },
6040 + { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) },
6041 +@@ -1301,6 +1309,23 @@ static int ftdi_olimex_probe(struct usb_serial *serial)
6042 + return 0;
6043 + }
6044 +
6045 ++/*
6046 ++ * The Matrix Orbital VK204-25-USB has an invalid IN endpoint.
6047 ++ * We have to correct it if we want to read from it.
6048 ++ */
6049 ++static int ftdi_mtxorb_hack_setup(struct usb_serial *serial)
6050 ++{
6051 ++ struct usb_host_endpoint *ep = serial->dev->ep_in[1];
6052 ++ struct usb_endpoint_descriptor *ep_desc = &ep->desc;
6053 ++
6054 ++ if (ep->enabled && ep_desc->wMaxPacketSize == 0) {
6055 ++ ep_desc->wMaxPacketSize = 0x40;
6056 ++ info("Fixing invalid wMaxPacketSize on read pipe");
6057 ++ }
6058 ++
6059 ++ return 0;
6060 ++}
6061 ++
6062 + /* ftdi_shutdown is called from usbserial:usb_serial_disconnect
6063 + * it is called when the usb device is disconnected
6064 + *
6065 +diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
6066 +index f6053da..893b429 100644
6067 +--- a/drivers/usb/serial/ftdi_sio.h
6068 ++++ b/drivers/usb/serial/ftdi_sio.h
6069 +@@ -98,6 +98,13 @@
6070 + #define FTDI_MTXORB_5_PID 0xFA05 /* Matrix Orbital Product Id */
6071 + #define FTDI_MTXORB_6_PID 0xFA06 /* Matrix Orbital Product Id */
6072 +
6073 ++/*
6074 ++ * The following are the values for the Matrix Orbital VK204-25-USB
6075 ++ * display, which use the FT232RL.
6076 ++ */
6077 ++#define MTXORB_VK_VID 0x1b3d
6078 ++#define MTXORB_VK_PID 0x0158
6079 ++
6080 + /* Interbiometrics USB I/O Board */
6081 + /* Developed for Interbiometrics by Rudolf Gugler */
6082 + #define INTERBIOMETRICS_VID 0x1209
6083 +diff --git a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c
6084 +index 889622b..45262f3 100644
6085 +--- a/drivers/usb/storage/protocol.c
6086 ++++ b/drivers/usb/storage/protocol.c
6087 +@@ -194,7 +194,7 @@ unsigned int usb_stor_access_xfer_buf(unsigned char *buffer,
6088 + * and the starting offset within the page, and update
6089 + * the *offset and *index values for the next loop. */
6090 + cnt = 0;
6091 +- while (cnt < buflen) {
6092 ++ while (cnt < buflen && sg) {
6093 + struct page *page = sg_page(sg) +
6094 + ((sg->offset + *offset) >> PAGE_SHIFT);
6095 + unsigned int poff =
6096 +@@ -249,7 +249,8 @@ void usb_stor_set_xfer_buf(unsigned char *buffer,
6097 + unsigned int offset = 0;
6098 + struct scatterlist *sg = NULL;
6099 +
6100 +- usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset,
6101 ++ buflen = min(buflen, srb->request_bufflen);
6102 ++ buflen = usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset,
6103 + TO_XFER_BUF);
6104 + if (buflen < srb->request_bufflen)
6105 + srb->resid = srb->request_bufflen - buflen;
6106 +diff --git a/fs/aio.c b/fs/aio.c
6107 +index 9dec7d2..758f911 100644
6108 +--- a/fs/aio.c
6109 ++++ b/fs/aio.c
6110 +@@ -997,6 +997,14 @@ put_rq:
6111 + /* everything turned out well, dispose of the aiocb. */
6112 + ret = __aio_put_req(ctx, iocb);
6113 +
6114 ++ /*
6115 ++ * We have to order our ring_info tail store above and test
6116 ++ * of the wait list below outside the wait lock. This is
6117 ++ * like in wake_up_bit() where clearing a bit has to be
6118 ++ * ordered with the unlocked test.
6119 ++ */
6120 ++ smp_mb();
6121 ++
6122 + if (waitqueue_active(&ctx->wait))
6123 + wake_up(&ctx->wait);
6124 +
6125 +diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
6126 +index 32c5711..a985a8f 100644
6127 +--- a/fs/ecryptfs/mmap.c
6128 ++++ b/fs/ecryptfs/mmap.c
6129 +@@ -263,52 +263,102 @@ out:
6130 + return 0;
6131 + }
6132 +
6133 +-/* This function must zero any hole we create */
6134 ++/**
6135 ++ * ecryptfs_prepare_write
6136 ++ * @file: The eCryptfs file
6137 ++ * @page: The eCryptfs page
6138 ++ * @from: The start byte from which we will write
6139 ++ * @to: The end byte to which we will write
6140 ++ *
6141 ++ * This function must zero any hole we create
6142 ++ *
6143 ++ * Returns zero on success; non-zero otherwise
6144 ++ */
6145 + static int ecryptfs_prepare_write(struct file *file, struct page *page,
6146 + unsigned from, unsigned to)
6147 + {
6148 +- int rc = 0;
6149 + loff_t prev_page_end_size;
6150 ++ int rc = 0;
6151 +
6152 + if (!PageUptodate(page)) {
6153 +- rc = ecryptfs_read_lower_page_segment(page, page->index, 0,
6154 +- PAGE_CACHE_SIZE,
6155 +- page->mapping->host);
6156 +- if (rc) {
6157 +- printk(KERN_ERR "%s: Error attemping to read lower "
6158 +- "page segment; rc = [%d]\n", __FUNCTION__, rc);
6159 +- ClearPageUptodate(page);
6160 +- goto out;
6161 +- } else
6162 ++ struct ecryptfs_crypt_stat *crypt_stat =
6163 ++ &ecryptfs_inode_to_private(
6164 ++ file->f_path.dentry->d_inode)->crypt_stat;
6165 ++
6166 ++ if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)
6167 ++ || (crypt_stat->flags & ECRYPTFS_NEW_FILE)) {
6168 ++ rc = ecryptfs_read_lower_page_segment(
6169 ++ page, page->index, 0, PAGE_CACHE_SIZE,
6170 ++ page->mapping->host);
6171 ++ if (rc) {
6172 ++ printk(KERN_ERR "%s: Error attemping to read "
6173 ++ "lower page segment; rc = [%d]\n",
6174 ++ __FUNCTION__, rc);
6175 ++ ClearPageUptodate(page);
6176 ++ goto out;
6177 ++ } else
6178 ++ SetPageUptodate(page);
6179 ++ } else if (crypt_stat->flags & ECRYPTFS_VIEW_AS_ENCRYPTED) {
6180 ++ if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) {
6181 ++ rc = ecryptfs_copy_up_encrypted_with_header(
6182 ++ page, crypt_stat);
6183 ++ if (rc) {
6184 ++ printk(KERN_ERR "%s: Error attempting "
6185 ++ "to copy the encrypted content "
6186 ++ "from the lower file whilst "
6187 ++ "inserting the metadata from "
6188 ++ "the xattr into the header; rc "
6189 ++ "= [%d]\n", __FUNCTION__, rc);
6190 ++ ClearPageUptodate(page);
6191 ++ goto out;
6192 ++ }
6193 ++ SetPageUptodate(page);
6194 ++ } else {
6195 ++ rc = ecryptfs_read_lower_page_segment(
6196 ++ page, page->index, 0, PAGE_CACHE_SIZE,
6197 ++ page->mapping->host);
6198 ++ if (rc) {
6199 ++ printk(KERN_ERR "%s: Error reading "
6200 ++ "page; rc = [%d]\n",
6201 ++ __FUNCTION__, rc);
6202 ++ ClearPageUptodate(page);
6203 ++ goto out;
6204 ++ }
6205 ++ SetPageUptodate(page);
6206 ++ }
6207 ++ } else {
6208 ++ rc = ecryptfs_decrypt_page(page);
6209 ++ if (rc) {
6210 ++ printk(KERN_ERR "%s: Error decrypting page "
6211 ++ "at index [%ld]; rc = [%d]\n",
6212 ++ __FUNCTION__, page->index, rc);
6213 ++ ClearPageUptodate(page);
6214 ++ goto out;
6215 ++ }
6216 + SetPageUptodate(page);
6217 ++ }
6218 + }
6219 +-
6220 + prev_page_end_size = ((loff_t)page->index << PAGE_CACHE_SHIFT);
6221 +-
6222 +- /*
6223 +- * If creating a page or more of holes, zero them out via truncate.
6224 +- * Note, this will increase i_size.
6225 +- */
6226 ++ /* If creating a page or more of holes, zero them out via truncate.
6227 ++ * Note, this will increase i_size. */
6228 + if (page->index != 0) {
6229 + if (prev_page_end_size > i_size_read(page->mapping->host)) {
6230 + rc = ecryptfs_truncate(file->f_path.dentry,
6231 + prev_page_end_size);
6232 + if (rc) {
6233 +- printk(KERN_ERR "Error on attempt to "
6234 ++ printk(KERN_ERR "%s: Error on attempt to "
6235 + "truncate to (higher) offset [%lld];"
6236 +- " rc = [%d]\n", prev_page_end_size, rc);
6237 ++ " rc = [%d]\n", __FUNCTION__,
6238 ++ prev_page_end_size, rc);
6239 + goto out;
6240 + }
6241 + }
6242 + }
6243 +- /*
6244 +- * Writing to a new page, and creating a small hole from start of page?
6245 +- * Zero it out.
6246 +- */
6247 +- if ((i_size_read(page->mapping->host) == prev_page_end_size) &&
6248 +- (from != 0)) {
6249 ++ /* Writing to a new page, and creating a small hole from start
6250 ++ * of page? Zero it out. */
6251 ++ if ((i_size_read(page->mapping->host) == prev_page_end_size)
6252 ++ && (from != 0))
6253 + zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
6254 +- }
6255 + out:
6256 + return rc;
6257 + }
6258 +diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
6259 +index 80d2f52..dcac591 100644
6260 +--- a/fs/fuse/dir.c
6261 ++++ b/fs/fuse/dir.c
6262 +@@ -905,7 +905,7 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd)
6263 + }
6264 +
6265 + if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {
6266 +- int err = generic_permission(inode, mask, NULL);
6267 ++ err = generic_permission(inode, mask, NULL);
6268 +
6269 + /* If permission is denied, try to refresh file
6270 + attributes. This is also needed, because the root
6271 +diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c
6272 +index 37dbd64..defb932 100644
6273 +--- a/fs/isofs/compress.c
6274 ++++ b/fs/isofs/compress.c
6275 +@@ -72,6 +72,17 @@ static int zisofs_readpage(struct file *file, struct page *page)
6276 + offset = index & ~zisofs_block_page_mask;
6277 + blockindex = offset >> zisofs_block_page_shift;
6278 + maxpage = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
6279 ++
6280 ++ /*
6281 ++ * If this page is wholly outside i_size we just return zero;
6282 ++ * do_generic_file_read() will handle this for us
6283 ++ */
6284 ++ if (page->index >= maxpage) {
6285 ++ SetPageUptodate(page);
6286 ++ unlock_page(page);
6287 ++ return 0;
6288 ++ }
6289 ++
6290 + maxpage = min(zisofs_block_pages, maxpage-offset);
6291 +
6292 + for ( i = 0 ; i < maxpage ; i++, offset++ ) {
6293 +diff --git a/fs/jbd/recovery.c b/fs/jbd/recovery.c
6294 +index c5d9694..9aaa4fa 100644
6295 +--- a/fs/jbd/recovery.c
6296 ++++ b/fs/jbd/recovery.c
6297 +@@ -478,7 +478,7 @@ static int do_one_pass(journal_t *journal,
6298 + memcpy(nbh->b_data, obh->b_data,
6299 + journal->j_blocksize);
6300 + if (flags & JFS_FLAG_ESCAPE) {
6301 +- *((__be32 *)bh->b_data) =
6302 ++ *((__be32 *)nbh->b_data) =
6303 + cpu_to_be32(JFS_MAGIC_NUMBER);
6304 + }
6305 +
6306 +diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
6307 +index d0ce627..fa0d4e9 100644
6308 +--- a/fs/jbd2/recovery.c
6309 ++++ b/fs/jbd2/recovery.c
6310 +@@ -488,7 +488,7 @@ static int do_one_pass(journal_t *journal,
6311 + memcpy(nbh->b_data, obh->b_data,
6312 + journal->j_blocksize);
6313 + if (flags & JBD2_FLAG_ESCAPE) {
6314 +- *((__be32 *)bh->b_data) =
6315 ++ *((__be32 *)nbh->b_data) =
6316 + cpu_to_be32(JBD2_MAGIC_NUMBER);
6317 + }
6318 +
6319 +diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
6320 +index 468f17a..429cec2 100644
6321 +--- a/fs/nfsd/nfsfh.c
6322 ++++ b/fs/nfsd/nfsfh.c
6323 +@@ -231,6 +231,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
6324 + fhp->fh_dentry = dentry;
6325 + fhp->fh_export = exp;
6326 + nfsd_nr_verified++;
6327 ++ cache_get(&exp->h);
6328 + } else {
6329 + /*
6330 + * just rechecking permissions
6331 +@@ -240,6 +241,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
6332 + dprintk("nfsd: fh_verify - just checking\n");
6333 + dentry = fhp->fh_dentry;
6334 + exp = fhp->fh_export;
6335 ++ cache_get(&exp->h);
6336 + /*
6337 + * Set user creds for this exportpoint; necessary even
6338 + * in the "just checking" case because this may be a
6339 +@@ -251,8 +253,6 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
6340 + if (error)
6341 + goto out;
6342 + }
6343 +- cache_get(&exp->h);
6344 +-
6345 +
6346 + error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type);
6347 + if (error)
6348 +diff --git a/fs/ufs/util.h b/fs/ufs/util.h
6349 +index b26fc4d..23ceed8 100644
6350 +--- a/fs/ufs/util.h
6351 ++++ b/fs/ufs/util.h
6352 +@@ -58,7 +58,7 @@ ufs_set_fs_state(struct super_block *sb, struct ufs_super_block_first *usb1,
6353 + {
6354 + switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
6355 + case UFS_ST_SUNOS:
6356 +- if (fs32_to_cpu(sb, usb3->fs_postblformat == UFS_42POSTBLFMT)) {
6357 ++ if (fs32_to_cpu(sb, usb3->fs_postblformat) == UFS_42POSTBLFMT) {
6358 + usb1->fs_u0.fs_sun.fs_state = cpu_to_fs32(sb, value);
6359 + break;
6360 + }
6361 +diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
6362 +index 1bd398d..c12c294 100644
6363 +--- a/include/asm-arm/arch-pxa/pxa-regs.h
6364 ++++ b/include/asm-arm/arch-pxa/pxa-regs.h
6365 +@@ -1669,6 +1669,7 @@
6366 + #define SSCR1_RSRE (1 << 20) /* Receive Service Request Enable */
6367 + #define SSCR1_TINTE (1 << 19) /* Receiver Time-out Interrupt enable */
6368 + #define SSCR1_PINTE (1 << 18) /* Peripheral Trailing Byte Interupt Enable */
6369 ++#define SSCR1_IFS (1 << 16) /* Invert Frame Signal */
6370 + #define SSCR1_STRF (1 << 15) /* Select FIFO or EFWR */
6371 + #define SSCR1_EFWR (1 << 14) /* Enable FIFO Write/Read */
6372 +
6373 +diff --git a/include/asm-x86/apic_32.h b/include/asm-x86/apic_32.h
6374 +index be158b2..04fbe7f 100644
6375 +--- a/include/asm-x86/apic_32.h
6376 ++++ b/include/asm-x86/apic_32.h
6377 +@@ -109,7 +109,7 @@ extern void setup_boot_APIC_clock (void);
6378 + extern void setup_secondary_APIC_clock (void);
6379 + extern int APIC_init_uniprocessor (void);
6380 +
6381 +-extern void enable_NMI_through_LVT0 (void * dummy);
6382 ++extern void enable_NMI_through_LVT0(void);
6383 +
6384 + #define ARCH_APICTIMER_STOPS_ON_C3 1
6385 +
6386 +diff --git a/include/asm-x86/futex_32.h b/include/asm-x86/futex_32.h
6387 +index 438ef0e..80964fd 100644
6388 +--- a/include/asm-x86/futex_32.h
6389 ++++ b/include/asm-x86/futex_32.h
6390 +@@ -28,7 +28,7 @@
6391 + "1: movl %2, %0\n\
6392 + movl %0, %3\n" \
6393 + insn "\n" \
6394 +-"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\
6395 ++"2: lock ; cmpxchgl %3, %2\n\
6396 + jnz 1b\n\
6397 + 3: .section .fixup,\"ax\"\n\
6398 + 4: mov %5, %1\n\
6399 +@@ -68,7 +68,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
6400 + #endif
6401 + switch (op) {
6402 + case FUTEX_OP_ADD:
6403 +- __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret,
6404 ++ __futex_atomic_op1("lock ; xaddl %0, %2", ret,
6405 + oldval, uaddr, oparg);
6406 + break;
6407 + case FUTEX_OP_OR:
6408 +@@ -111,7 +111,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
6409 + return -EFAULT;
6410 +
6411 + __asm__ __volatile__(
6412 +- "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n"
6413 ++ "1: lock ; cmpxchgl %3, %1 \n"
6414 +
6415 + "2: .section .fixup, \"ax\" \n"
6416 + "3: mov %2, %0 \n"
6417 +diff --git a/include/asm-x86/futex_64.h b/include/asm-x86/futex_64.h
6418 +index 5cdfb08..423c051 100644
6419 +--- a/include/asm-x86/futex_64.h
6420 ++++ b/include/asm-x86/futex_64.h
6421 +@@ -27,7 +27,7 @@
6422 + "1: movl %2, %0\n\
6423 + movl %0, %3\n" \
6424 + insn "\n" \
6425 +-"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\
6426 ++"2: lock ; cmpxchgl %3, %2\n\
6427 + jnz 1b\n\
6428 + 3: .section .fixup,\"ax\"\n\
6429 + 4: mov %5, %1\n\
6430 +@@ -62,7 +62,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
6431 + __futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg);
6432 + break;
6433 + case FUTEX_OP_ADD:
6434 +- __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, oldval,
6435 ++ __futex_atomic_op1("lock ; xaddl %0, %2", ret, oldval,
6436 + uaddr, oparg);
6437 + break;
6438 + case FUTEX_OP_OR:
6439 +@@ -101,7 +101,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
6440 + return -EFAULT;
6441 +
6442 + __asm__ __volatile__(
6443 +- "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n"
6444 ++ "1: lock ; cmpxchgl %3, %1 \n"
6445 +
6446 + "2: .section .fixup, \"ax\" \n"
6447 + "3: mov %2, %0 \n"
6448 +diff --git a/include/asm-x86/io_apic_64.h b/include/asm-x86/io_apic_64.h
6449 +index e2c1367..1913ad0 100644
6450 +--- a/include/asm-x86/io_apic_64.h
6451 ++++ b/include/asm-x86/io_apic_64.h
6452 +@@ -129,7 +129,7 @@ extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int);
6453 +
6454 + extern int sis_apic_bug; /* dummy */
6455 +
6456 +-void enable_NMI_through_LVT0 (void * dummy);
6457 ++void enable_NMI_through_LVT0(void);
6458 +
6459 + extern spinlock_t i8259A_lock;
6460 +
6461 +diff --git a/include/asm-x86/processor_32.h b/include/asm-x86/processor_32.h
6462 +index 13976b0..787ee2e 100644
6463 +--- a/include/asm-x86/processor_32.h
6464 ++++ b/include/asm-x86/processor_32.h
6465 +@@ -712,9 +712,10 @@ static inline unsigned int cpuid_edx(unsigned int op)
6466 + #define ASM_NOP6 K7_NOP6
6467 + #define ASM_NOP7 K7_NOP7
6468 + #define ASM_NOP8 K7_NOP8
6469 +-#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
6470 ++#elif (defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
6471 + defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \
6472 +- defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)
6473 ++ defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)) && \
6474 ++ !defined(CONFIG_X86_GENERIC)
6475 + #define ASM_NOP1 P6_NOP1
6476 + #define ASM_NOP2 P6_NOP2
6477 + #define ASM_NOP3 P6_NOP3
6478 +diff --git a/include/linux/Kbuild b/include/linux/Kbuild
6479 +index 4b32bb1..f30fa92 100644
6480 +--- a/include/linux/Kbuild
6481 ++++ b/include/linux/Kbuild
6482 +@@ -217,7 +217,6 @@ unifdef-y += i2o-dev.h
6483 + unifdef-y += icmp.h
6484 + unifdef-y += icmpv6.h
6485 + unifdef-y += if_addr.h
6486 +-unifdef-y += if_addrlabel.h
6487 + unifdef-y += if_arp.h
6488 + unifdef-y += if_bridge.h
6489 + unifdef-y += if_ec.h
6490 +diff --git a/include/linux/futex.h b/include/linux/futex.h
6491 +index 92d420f..e5f3b84 100644
6492 +--- a/include/linux/futex.h
6493 ++++ b/include/linux/futex.h
6494 +@@ -153,6 +153,7 @@ union futex_key {
6495 + #ifdef CONFIG_FUTEX
6496 + extern void exit_robust_list(struct task_struct *curr);
6497 + extern void exit_pi_state_list(struct task_struct *curr);
6498 ++extern int futex_cmpxchg_enabled;
6499 + #else
6500 + static inline void exit_robust_list(struct task_struct *curr)
6501 + {
6502 +diff --git a/include/linux/irq.h b/include/linux/irq.h
6503 +index 4669be0..1fc1cb8 100644
6504 +--- a/include/linux/irq.h
6505 ++++ b/include/linux/irq.h
6506 +@@ -367,6 +367,9 @@ set_irq_chained_handler(unsigned int irq,
6507 + __set_irq_handler(irq, handle, 1, NULL);
6508 + }
6509 +
6510 ++extern void set_irq_noprobe(unsigned int irq);
6511 ++extern void set_irq_probe(unsigned int irq);
6512 ++
6513 + /* Handle dynamic irq creation and destruction */
6514 + extern int create_irq(void);
6515 + extern void destroy_irq(unsigned int irq);
6516 +diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
6517 +index 13410b2..c1d64c2 100644
6518 +--- a/include/linux/moduleparam.h
6519 ++++ b/include/linux/moduleparam.h
6520 +@@ -62,6 +62,16 @@ struct kparam_array
6521 + void *elem;
6522 + };
6523 +
6524 ++/* On alpha, ia64 and ppc64 relocations to global data cannot go into
6525 ++ read-only sections (which is part of respective UNIX ABI on these
6526 ++ platforms). So 'const' makes no sense and even causes compile failures
6527 ++ with some compilers. */
6528 ++#if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64)
6529 ++#define __moduleparam_const
6530 ++#else
6531 ++#define __moduleparam_const const
6532 ++#endif
6533 ++
6534 + /* This is the fundamental function for registering boot/module
6535 + parameters. perm sets the visibility in sysfs: 000 means it's
6536 + not there, read bits mean it's readable, write bits mean it's
6537 +@@ -71,7 +81,7 @@ struct kparam_array
6538 + static int __param_perm_check_##name __attribute__((unused)) = \
6539 + BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \
6540 + static const char __param_str_##name[] = prefix #name; \
6541 +- static struct kernel_param const __param_##name \
6542 ++ static struct kernel_param __moduleparam_const __param_##name \
6543 + __attribute_used__ \
6544 + __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
6545 + = { __param_str_##name, perm, set, get, { arg } }
6546 +diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
6547 +index 70013c5..89cd011 100644
6548 +--- a/include/net/inet_sock.h
6549 ++++ b/include/net/inet_sock.h
6550 +@@ -175,7 +175,8 @@ extern void build_ehash_secret(void);
6551 + static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport,
6552 + const __be32 faddr, const __be16 fport)
6553 + {
6554 +- return jhash_2words((__force __u32) laddr ^ (__force __u32) faddr,
6555 ++ return jhash_3words((__force __u32) laddr,
6556 ++ (__force __u32) faddr,
6557 + ((__u32) lport) << 16 | (__force __u32)fport,
6558 + inet_ehash_secret);
6559 + }
6560 +diff --git a/kernel/futex.c b/kernel/futex.c
6561 +index 55d78b5..d166080 100644
6562 +--- a/kernel/futex.c
6563 ++++ b/kernel/futex.c
6564 +@@ -60,6 +60,8 @@
6565 +
6566 + #include "rtmutex_common.h"
6567 +
6568 ++int __read_mostly futex_cmpxchg_enabled;
6569 ++
6570 + #define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8)
6571 +
6572 + /*
6573 +@@ -466,6 +468,8 @@ void exit_pi_state_list(struct task_struct *curr)
6574 + struct futex_hash_bucket *hb;
6575 + union futex_key key;
6576 +
6577 ++ if (!futex_cmpxchg_enabled)
6578 ++ return;
6579 + /*
6580 + * We are a ZOMBIE and nobody can enqueue itself on
6581 + * pi_state_list anymore, but we have to be careful
6582 +@@ -1854,6 +1858,8 @@ asmlinkage long
6583 + sys_set_robust_list(struct robust_list_head __user *head,
6584 + size_t len)
6585 + {
6586 ++ if (!futex_cmpxchg_enabled)
6587 ++ return -ENOSYS;
6588 + /*
6589 + * The kernel knows only one size for now:
6590 + */
6591 +@@ -1878,6 +1884,9 @@ sys_get_robust_list(int pid, struct robust_list_head __user * __user *head_ptr,
6592 + struct robust_list_head __user *head;
6593 + unsigned long ret;
6594 +
6595 ++ if (!futex_cmpxchg_enabled)
6596 ++ return -ENOSYS;
6597 ++
6598 + if (!pid)
6599 + head = current->robust_list;
6600 + else {
6601 +@@ -1980,6 +1989,9 @@ void exit_robust_list(struct task_struct *curr)
6602 + unsigned long futex_offset;
6603 + int rc;
6604 +
6605 ++ if (!futex_cmpxchg_enabled)
6606 ++ return;
6607 ++
6608 + /*
6609 + * Fetch the list head (which was registered earlier, via
6610 + * sys_set_robust_list()):
6611 +@@ -2034,7 +2046,7 @@ void exit_robust_list(struct task_struct *curr)
6612 + long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
6613 + u32 __user *uaddr2, u32 val2, u32 val3)
6614 + {
6615 +- int ret;
6616 ++ int ret = -ENOSYS;
6617 + int cmd = op & FUTEX_CMD_MASK;
6618 + struct rw_semaphore *fshared = NULL;
6619 +
6620 +@@ -2062,13 +2074,16 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
6621 + ret = futex_wake_op(uaddr, fshared, uaddr2, val, val2, val3);
6622 + break;
6623 + case FUTEX_LOCK_PI:
6624 +- ret = futex_lock_pi(uaddr, fshared, val, timeout, 0);
6625 ++ if (futex_cmpxchg_enabled)
6626 ++ ret = futex_lock_pi(uaddr, fshared, val, timeout, 0);
6627 + break;
6628 + case FUTEX_UNLOCK_PI:
6629 +- ret = futex_unlock_pi(uaddr, fshared);
6630 ++ if (futex_cmpxchg_enabled)
6631 ++ ret = futex_unlock_pi(uaddr, fshared);
6632 + break;
6633 + case FUTEX_TRYLOCK_PI:
6634 +- ret = futex_lock_pi(uaddr, fshared, 0, timeout, 1);
6635 ++ if (futex_cmpxchg_enabled)
6636 ++ ret = futex_lock_pi(uaddr, fshared, 0, timeout, 1);
6637 + break;
6638 + default:
6639 + ret = -ENOSYS;
6640 +@@ -2123,8 +2138,29 @@ static struct file_system_type futex_fs_type = {
6641 +
6642 + static int __init init(void)
6643 + {
6644 +- int i = register_filesystem(&futex_fs_type);
6645 ++ u32 curval;
6646 ++ int i;
6647 ++
6648 ++ /*
6649 ++ * This will fail and we want it. Some arch implementations do
6650 ++ * runtime detection of the futex_atomic_cmpxchg_inatomic()
6651 ++ * functionality. We want to know that before we call in any
6652 ++ * of the complex code paths. Also we want to prevent
6653 ++ * registration of robust lists in that case. NULL is
6654 ++ * guaranteed to fault and we get -EFAULT on functional
6655 ++ * implementation, the non functional ones will return
6656 ++ * -ENOSYS.
6657 ++ */
6658 ++ curval = cmpxchg_futex_value_locked(NULL, 0, 0);
6659 ++ if (curval == -EFAULT)
6660 ++ futex_cmpxchg_enabled = 1;
6661 +
6662 ++ for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
6663 ++ plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
6664 ++ spin_lock_init(&futex_queues[i].lock);
6665 ++ }
6666 ++
6667 ++ i = register_filesystem(&futex_fs_type);
6668 + if (i)
6669 + return i;
6670 +
6671 +@@ -2134,10 +2170,6 @@ static int __init init(void)
6672 + return PTR_ERR(futex_mnt);
6673 + }
6674 +
6675 +- for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
6676 +- plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
6677 +- spin_lock_init(&futex_queues[i].lock);
6678 +- }
6679 + return 0;
6680 + }
6681 + __initcall(init);
6682 +diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
6683 +index 8682c79..d95f79b 100644
6684 +--- a/kernel/futex_compat.c
6685 ++++ b/kernel/futex_compat.c
6686 +@@ -54,6 +54,9 @@ void compat_exit_robust_list(struct task_struct *curr)
6687 + compat_long_t futex_offset;
6688 + int rc;
6689 +
6690 ++ if (!futex_cmpxchg_enabled)
6691 ++ return;
6692 ++
6693 + /*
6694 + * Fetch the list head (which was registered earlier, via
6695 + * sys_set_robust_list()):
6696 +@@ -115,6 +118,9 @@ asmlinkage long
6697 + compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
6698 + compat_size_t len)
6699 + {
6700 ++ if (!futex_cmpxchg_enabled)
6701 ++ return -ENOSYS;
6702 ++
6703 + if (unlikely(len != sizeof(*head)))
6704 + return -EINVAL;
6705 +
6706 +@@ -130,6 +136,9 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
6707 + struct compat_robust_list_head __user *head;
6708 + unsigned long ret;
6709 +
6710 ++ if (!futex_cmpxchg_enabled)
6711 ++ return -ENOSYS;
6712 ++
6713 + if (!pid)
6714 + head = current->compat_robust_list;
6715 + else {
6716 +diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
6717 +index 465c69c..e4e1c99 100644
6718 +--- a/kernel/irq/chip.c
6719 ++++ b/kernel/irq/chip.c
6720 +@@ -607,3 +607,39 @@ set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
6721 + set_irq_chip(irq, chip);
6722 + __set_irq_handler(irq, handle, 0, name);
6723 + }
6724 ++
6725 ++void __init set_irq_noprobe(unsigned int irq)
6726 ++{
6727 ++ struct irq_desc *desc;
6728 ++ unsigned long flags;
6729 ++
6730 ++ if (irq >= NR_IRQS) {
6731 ++ printk(KERN_ERR "Trying to mark IRQ%d non-probeable\n", irq);
6732 ++
6733 ++ return;
6734 ++ }
6735 ++
6736 ++ desc = irq_desc + irq;
6737 ++
6738 ++ spin_lock_irqsave(&desc->lock, flags);
6739 ++ desc->status |= IRQ_NOPROBE;
6740 ++ spin_unlock_irqrestore(&desc->lock, flags);
6741 ++}
6742 ++
6743 ++void __init set_irq_probe(unsigned int irq)
6744 ++{
6745 ++ struct irq_desc *desc;
6746 ++ unsigned long flags;
6747 ++
6748 ++ if (irq >= NR_IRQS) {
6749 ++ printk(KERN_ERR "Trying to mark IRQ%d probeable\n", irq);
6750 ++
6751 ++ return;
6752 ++ }
6753 ++
6754 ++ desc = irq_desc + irq;
6755 ++
6756 ++ spin_lock_irqsave(&desc->lock, flags);
6757 ++ desc->status &= ~IRQ_NOPROBE;
6758 ++ spin_unlock_irqrestore(&desc->lock, flags);
6759 ++}
6760 +diff --git a/kernel/relay.c b/kernel/relay.c
6761 +index 7c03733..889102a 100644
6762 +--- a/kernel/relay.c
6763 ++++ b/kernel/relay.c
6764 +@@ -1072,7 +1072,7 @@ static int subbuf_splice_actor(struct file *in,
6765 + unsigned int flags,
6766 + int *nonpad_ret)
6767 + {
6768 +- unsigned int pidx, poff, total_len, subbuf_pages, ret;
6769 ++ unsigned int pidx, poff, total_len, subbuf_pages, nr_pages, ret;
6770 + struct rchan_buf *rbuf = in->private_data;
6771 + unsigned int subbuf_size = rbuf->chan->subbuf_size;
6772 + uint64_t pos = (uint64_t) *ppos;
6773 +@@ -1103,8 +1103,9 @@ static int subbuf_splice_actor(struct file *in,
6774 + subbuf_pages = rbuf->chan->alloc_size >> PAGE_SHIFT;
6775 + pidx = (read_start / PAGE_SIZE) % subbuf_pages;
6776 + poff = read_start & ~PAGE_MASK;
6777 ++ nr_pages = min_t(unsigned int, subbuf_pages, PIPE_BUFFERS);
6778 +
6779 +- for (total_len = 0; spd.nr_pages < subbuf_pages; spd.nr_pages++) {
6780 ++ for (total_len = 0; spd.nr_pages < nr_pages; spd.nr_pages++) {
6781 + unsigned int this_len, this_end, private;
6782 + unsigned int cur_pos = read_start + total_len;
6783 +
6784 +diff --git a/kernel/sched.c b/kernel/sched.c
6785 +index e76b11c..5ba5db9 100644
6786 +--- a/kernel/sched.c
6787 ++++ b/kernel/sched.c
6788 +@@ -4028,11 +4028,10 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
6789 + oldprio = p->prio;
6790 + on_rq = p->se.on_rq;
6791 + running = task_current(rq, p);
6792 +- if (on_rq) {
6793 ++ if (on_rq)
6794 + dequeue_task(rq, p, 0);
6795 +- if (running)
6796 +- p->sched_class->put_prev_task(rq, p);
6797 +- }
6798 ++ if (running)
6799 ++ p->sched_class->put_prev_task(rq, p);
6800 +
6801 + if (rt_prio(prio))
6802 + p->sched_class = &rt_sched_class;
6803 +@@ -4041,9 +4040,9 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
6804 +
6805 + p->prio = prio;
6806 +
6807 ++ if (running)
6808 ++ p->sched_class->set_curr_task(rq);
6809 + if (on_rq) {
6810 +- if (running)
6811 +- p->sched_class->set_curr_task(rq);
6812 + enqueue_task(rq, p, 0);
6813 + /*
6814 + * Reschedule if we are currently running on this runqueue and
6815 +@@ -4339,18 +4338,17 @@ recheck:
6816 + update_rq_clock(rq);
6817 + on_rq = p->se.on_rq;
6818 + running = task_current(rq, p);
6819 +- if (on_rq) {
6820 ++ if (on_rq)
6821 + deactivate_task(rq, p, 0);
6822 +- if (running)
6823 +- p->sched_class->put_prev_task(rq, p);
6824 +- }
6825 ++ if (running)
6826 ++ p->sched_class->put_prev_task(rq, p);
6827 +
6828 + oldprio = p->prio;
6829 + __setscheduler(rq, p, policy, param->sched_priority);
6830 +
6831 ++ if (running)
6832 ++ p->sched_class->set_curr_task(rq);
6833 + if (on_rq) {
6834 +- if (running)
6835 +- p->sched_class->set_curr_task(rq);
6836 + activate_task(rq, p, 0);
6837 + /*
6838 + * Reschedule if we are currently running on this runqueue and
6839 +@@ -7110,19 +7108,17 @@ void sched_move_task(struct task_struct *tsk)
6840 + running = task_current(rq, tsk);
6841 + on_rq = tsk->se.on_rq;
6842 +
6843 +- if (on_rq) {
6844 ++ if (on_rq)
6845 + dequeue_task(rq, tsk, 0);
6846 +- if (unlikely(running))
6847 +- tsk->sched_class->put_prev_task(rq, tsk);
6848 +- }
6849 ++ if (unlikely(running))
6850 ++ tsk->sched_class->put_prev_task(rq, tsk);
6851 +
6852 + set_task_cfs_rq(tsk, task_cpu(tsk));
6853 +
6854 +- if (on_rq) {
6855 +- if (unlikely(running))
6856 +- tsk->sched_class->set_curr_task(rq);
6857 ++ if (unlikely(running))
6858 ++ tsk->sched_class->set_curr_task(rq);
6859 ++ if (on_rq)
6860 + enqueue_task(rq, tsk, 0);
6861 +- }
6862 +
6863 + done:
6864 + task_rq_unlock(rq, &flags);
6865 +diff --git a/kernel/sysctl.c b/kernel/sysctl.c
6866 +index e3e0ee3..397ff8c 100644
6867 +--- a/kernel/sysctl.c
6868 ++++ b/kernel/sysctl.c
6869 +@@ -306,7 +306,7 @@ static struct ctl_table kern_table[] = {
6870 + .procname = "sched_nr_migrate",
6871 + .data = &sysctl_sched_nr_migrate,
6872 + .maxlen = sizeof(unsigned int),
6873 +- .mode = 644,
6874 ++ .mode = 0644,
6875 + .proc_handler = &proc_dointvec,
6876 + },
6877 + #endif
6878 +diff --git a/mm/filemap.c b/mm/filemap.c
6879 +index 69430d2..76b036f 100644
6880 +--- a/mm/filemap.c
6881 ++++ b/mm/filemap.c
6882 +@@ -1725,21 +1725,27 @@ size_t iov_iter_copy_from_user(struct page *page,
6883 + }
6884 + EXPORT_SYMBOL(iov_iter_copy_from_user);
6885 +
6886 +-static void __iov_iter_advance_iov(struct iov_iter *i, size_t bytes)
6887 ++void iov_iter_advance(struct iov_iter *i, size_t bytes)
6888 + {
6889 ++ BUG_ON(i->count < bytes);
6890 ++
6891 + if (likely(i->nr_segs == 1)) {
6892 + i->iov_offset += bytes;
6893 ++ i->count -= bytes;
6894 + } else {
6895 + const struct iovec *iov = i->iov;
6896 + size_t base = i->iov_offset;
6897 +
6898 + /*
6899 + * The !iov->iov_len check ensures we skip over unlikely
6900 +- * zero-length segments.
6901 ++ * zero-length segments (without overruning the iovec).
6902 + */
6903 +- while (bytes || !iov->iov_len) {
6904 +- int copy = min(bytes, iov->iov_len - base);
6905 ++ while (bytes || unlikely(!iov->iov_len && i->count)) {
6906 ++ int copy;
6907 +
6908 ++ copy = min(bytes, iov->iov_len - base);
6909 ++ BUG_ON(!i->count || i->count < copy);
6910 ++ i->count -= copy;
6911 + bytes -= copy;
6912 + base += copy;
6913 + if (iov->iov_len == base) {
6914 +@@ -1751,14 +1757,6 @@ static void __iov_iter_advance_iov(struct iov_iter *i, size_t bytes)
6915 + i->iov_offset = base;
6916 + }
6917 + }
6918 +-
6919 +-void iov_iter_advance(struct iov_iter *i, size_t bytes)
6920 +-{
6921 +- BUG_ON(i->count < bytes);
6922 +-
6923 +- __iov_iter_advance_iov(i, bytes);
6924 +- i->count -= bytes;
6925 +-}
6926 + EXPORT_SYMBOL(iov_iter_advance);
6927 +
6928 + /*
6929 +diff --git a/mm/hugetlb.c b/mm/hugetlb.c
6930 +index 9c746cb..d95ce35 100644
6931 +--- a/mm/hugetlb.c
6932 ++++ b/mm/hugetlb.c
6933 +@@ -119,6 +119,7 @@ static void free_huge_page(struct page *page)
6934 + struct address_space *mapping;
6935 +
6936 + mapping = (struct address_space *) page_private(page);
6937 ++ set_page_private(page, 0);
6938 + BUG_ON(page_count(page));
6939 + INIT_LIST_HEAD(&page->lru);
6940 +
6941 +@@ -133,7 +134,6 @@ static void free_huge_page(struct page *page)
6942 + spin_unlock(&hugetlb_lock);
6943 + if (mapping)
6944 + hugetlb_put_quota(mapping, 1);
6945 +- set_page_private(page, 0);
6946 + }
6947 +
6948 + /*
6949 +diff --git a/mm/slab.c b/mm/slab.c
6950 +index ff31261..79c3be0 100644
6951 +--- a/mm/slab.c
6952 ++++ b/mm/slab.c
6953 +@@ -2961,11 +2961,10 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags)
6954 + struct array_cache *ac;
6955 + int node;
6956 +
6957 +- node = numa_node_id();
6958 +-
6959 ++retry:
6960 + check_irq_off();
6961 ++ node = numa_node_id();
6962 + ac = cpu_cache_get(cachep);
6963 +-retry:
6964 + batchcount = ac->batchcount;
6965 + if (!ac->touched && batchcount > BATCHREFILL_LIMIT) {
6966 + /*
6967 +diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
6968 +index 2726adc..e13cf5e 100644
6969 +--- a/net/bluetooth/hci_sysfs.c
6970 ++++ b/net/bluetooth/hci_sysfs.c
6971 +@@ -282,6 +282,7 @@ static void add_conn(struct work_struct *work)
6972 + int i;
6973 +
6974 + flush_workqueue(btdelconn);
6975 ++
6976 + if (device_add(&conn->dev) < 0) {
6977 + BT_ERR("Failed to register connection device");
6978 + return;
6979 +@@ -317,7 +318,6 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
6980 + INIT_WORK(&conn->work, add_conn);
6981 +
6982 + queue_work(btaddconn, &conn->work);
6983 +- schedule_work(&conn->work);
6984 + }
6985 +
6986 + static int __match_tty(struct device *dev, void *data)
6987 +@@ -354,7 +354,6 @@ void hci_conn_del_sysfs(struct hci_conn *conn)
6988 + INIT_WORK(&conn->work, del_conn);
6989 +
6990 + queue_work(btdelconn, &conn->work);
6991 +- schedule_work(&conn->work);
6992 + }
6993 +
6994 + int hci_register_sysfs(struct hci_dev *hdev)
6995 +@@ -408,6 +407,7 @@ int __init bt_sysfs_init(void)
6996 + err = -ENOMEM;
6997 + goto out;
6998 + }
6999 ++
7000 + btdelconn = create_singlethread_workqueue("btdelconn");
7001 + if (!btdelconn) {
7002 + err = -ENOMEM;
7003 +@@ -447,8 +447,12 @@ out:
7004 + void bt_sysfs_cleanup(void)
7005 + {
7006 + destroy_workqueue(btaddconn);
7007 ++
7008 + destroy_workqueue(btdelconn);
7009 ++
7010 + class_destroy(bt_class);
7011 ++
7012 + bus_unregister(&bt_bus);
7013 ++
7014 + platform_device_unregister(bt_platform);
7015 + }
7016 +diff --git a/net/bridge/netfilter/ebt_dnat.c b/net/bridge/netfilter/ebt_dnat.c
7017 +index 74262e9..1024511 100644
7018 +--- a/net/bridge/netfilter/ebt_dnat.c
7019 ++++ b/net/bridge/netfilter/ebt_dnat.c
7020 +@@ -20,8 +20,8 @@ static int ebt_target_dnat(struct sk_buff *skb, unsigned int hooknr,
7021 + {
7022 + struct ebt_nat_info *info = (struct ebt_nat_info *)data;
7023 +
7024 +- if (skb_make_writable(skb, 0))
7025 +- return NF_DROP;
7026 ++ if (!skb_make_writable(skb, 0))
7027 ++ return EBT_DROP;
7028 +
7029 + memcpy(eth_hdr(skb)->h_dest, info->mac, ETH_ALEN);
7030 + return info->target;
7031 +diff --git a/net/bridge/netfilter/ebt_redirect.c b/net/bridge/netfilter/ebt_redirect.c
7032 +index 422cb83..88afc34 100644
7033 +--- a/net/bridge/netfilter/ebt_redirect.c
7034 ++++ b/net/bridge/netfilter/ebt_redirect.c
7035 +@@ -21,8 +21,8 @@ static int ebt_target_redirect(struct sk_buff *skb, unsigned int hooknr,
7036 + {
7037 + struct ebt_redirect_info *info = (struct ebt_redirect_info *)data;
7038 +
7039 +- if (skb_make_writable(skb, 0))
7040 +- return NF_DROP;
7041 ++ if (!skb_make_writable(skb, 0))
7042 ++ return EBT_DROP;
7043 +
7044 + if (hooknr != NF_BR_BROUTING)
7045 + memcpy(eth_hdr(skb)->h_dest,
7046 +diff --git a/net/bridge/netfilter/ebt_snat.c b/net/bridge/netfilter/ebt_snat.c
7047 +index 425ac92..4c5a5a9 100644
7048 +--- a/net/bridge/netfilter/ebt_snat.c
7049 ++++ b/net/bridge/netfilter/ebt_snat.c
7050 +@@ -22,8 +22,8 @@ static int ebt_target_snat(struct sk_buff *skb, unsigned int hooknr,
7051 + {
7052 + struct ebt_nat_info *info = (struct ebt_nat_info *) data;
7053 +
7054 +- if (skb_make_writable(skb, 0))
7055 +- return NF_DROP;
7056 ++ if (!skb_make_writable(skb, 0))
7057 ++ return EBT_DROP;
7058 +
7059 + memcpy(eth_hdr(skb)->h_source, info->mac, ETH_ALEN);
7060 + if (!(info->target & NAT_ARP_BIT) &&
7061 +diff --git a/net/core/dev.c b/net/core/dev.c
7062 +index 0879f52..4d44372 100644
7063 +--- a/net/core/dev.c
7064 ++++ b/net/core/dev.c
7065 +@@ -1068,8 +1068,6 @@ int dev_close(struct net_device *dev)
7066 + */
7067 + call_netdevice_notifiers(NETDEV_GOING_DOWN, dev);
7068 +
7069 +- dev_deactivate(dev);
7070 +-
7071 + clear_bit(__LINK_STATE_START, &dev->state);
7072 +
7073 + /* Synchronize to scheduled poll. We cannot touch poll list,
7074 +@@ -1080,6 +1078,8 @@ int dev_close(struct net_device *dev)
7075 + */
7076 + smp_mb__after_clear_bit(); /* Commit netif_running(). */
7077 +
7078 ++ dev_deactivate(dev);
7079 ++
7080 + /*
7081 + * Call the device specific close. This cannot fail.
7082 + * Only if device is UP
7083 +@@ -2906,7 +2906,7 @@ int __dev_addr_add(struct dev_addr_list **list, int *count,
7084 + }
7085 + }
7086 +
7087 +- da = kmalloc(sizeof(*da), GFP_ATOMIC);
7088 ++ da = kzalloc(sizeof(*da), GFP_ATOMIC);
7089 + if (da == NULL)
7090 + return -ENOMEM;
7091 + memcpy(da->da_addr, addr, alen);
7092 +diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
7093 +index 82817e5..7794e17 100644
7094 +--- a/net/ipv4/ip_sockglue.c
7095 ++++ b/net/ipv4/ip_sockglue.c
7096 +@@ -514,11 +514,6 @@ static int do_ip_setsockopt(struct sock *sk, int level,
7097 + val &= ~3;
7098 + val |= inet->tos & 3;
7099 + }
7100 +- if (IPTOS_PREC(val) >= IPTOS_PREC_CRITIC_ECP &&
7101 +- !capable(CAP_NET_ADMIN)) {
7102 +- err = -EPERM;
7103 +- break;
7104 +- }
7105 + if (inet->tos != val) {
7106 + inet->tos = val;
7107 + sk->sk_priority = rt_tos2priority(val);
7108 +diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
7109 +index 80cab8c..b284b4e 100644
7110 +--- a/net/ipv4/ipcomp.c
7111 ++++ b/net/ipv4/ipcomp.c
7112 +@@ -108,8 +108,11 @@ static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb)
7113 + const int cpu = get_cpu();
7114 + u8 *scratch = *per_cpu_ptr(ipcomp_scratches, cpu);
7115 + struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu);
7116 +- int err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
7117 ++ int err;
7118 +
7119 ++ local_bh_disable();
7120 ++ err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
7121 ++ local_bh_enable();
7122 + if (err)
7123 + goto out;
7124 +
7125 +diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
7126 +index b8f7763..15dc11e 100644
7127 +--- a/net/ipv4/ipconfig.c
7128 ++++ b/net/ipv4/ipconfig.c
7129 +@@ -739,9 +739,9 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
7130 + printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
7131 + b->htype = dev->type; /* can cause undefined behavior */
7132 + }
7133 ++
7134 ++ /* server_ip and your_ip address are both already zero per RFC2131 */
7135 + b->hlen = dev->addr_len;
7136 +- b->your_ip = NONE;
7137 +- b->server_ip = NONE;
7138 + memcpy(b->hw_addr, dev->dev_addr, dev->addr_len);
7139 + b->secs = htons(jiffies_diff / HZ);
7140 + b->xid = d->xid;
7141 +diff --git a/net/ipv4/netfilter/arpt_mangle.c b/net/ipv4/netfilter/arpt_mangle.c
7142 +index 45fa4e2..3f4222b 100644
7143 +--- a/net/ipv4/netfilter/arpt_mangle.c
7144 ++++ b/net/ipv4/netfilter/arpt_mangle.c
7145 +@@ -19,7 +19,7 @@ target(struct sk_buff *skb,
7146 + unsigned char *arpptr;
7147 + int pln, hln;
7148 +
7149 +- if (skb_make_writable(skb, skb->len))
7150 ++ if (!skb_make_writable(skb, skb->len))
7151 + return NF_DROP;
7152 +
7153 + arp = arp_hdr(skb);
7154 +diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
7155 +index 14d64a3..16d0fb3 100644
7156 +--- a/net/ipv4/netfilter/ip_queue.c
7157 ++++ b/net/ipv4/netfilter/ip_queue.c
7158 +@@ -336,8 +336,8 @@ static int
7159 + ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
7160 + {
7161 + int diff;
7162 +- int err;
7163 + struct iphdr *user_iph = (struct iphdr *)v->payload;
7164 ++ struct sk_buff *nskb;
7165 +
7166 + if (v->data_len < sizeof(*user_iph))
7167 + return 0;
7168 +@@ -349,14 +349,16 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
7169 + if (v->data_len > 0xFFFF)
7170 + return -EINVAL;
7171 + if (diff > skb_tailroom(e->skb)) {
7172 +- err = pskb_expand_head(e->skb, 0,
7173 ++ nskb = skb_copy_expand(e->skb, 0,
7174 + diff - skb_tailroom(e->skb),
7175 + GFP_ATOMIC);
7176 +- if (err) {
7177 ++ if (!nskb) {
7178 + printk(KERN_WARNING "ip_queue: error "
7179 +- "in mangle, dropping packet: %d\n", -err);
7180 +- return err;
7181 ++ "in mangle, dropping packet\n");
7182 ++ return -ENOMEM;
7183 + }
7184 ++ kfree_skb(e->skb);
7185 ++ e->skb = nskb;
7186 + }
7187 + skb_put(e->skb, diff);
7188 + }
7189 +diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
7190 +index 2f59baa..5b4095b 100644
7191 +--- a/net/ipv6/ip6_output.c
7192 ++++ b/net/ipv6/ip6_output.c
7193 +@@ -593,7 +593,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
7194 + * or if the skb it not generated by a local socket. (This last
7195 + * check should be redundant, but it's free.)
7196 + */
7197 +- if (!np || np->pmtudisc >= IPV6_PMTUDISC_DO) {
7198 ++ if (!skb->local_df) {
7199 + skb->dev = skb->dst->dev;
7200 + icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
7201 + IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_FRAGFAILS);
7202 +@@ -1389,6 +1389,10 @@ int ip6_push_pending_frames(struct sock *sk)
7203 + tmp_skb->sk = NULL;
7204 + }
7205 +
7206 ++ /* Allow local fragmentation. */
7207 ++ if (np->pmtudisc < IPV6_PMTUDISC_DO)
7208 ++ skb->local_df = 1;
7209 ++
7210 + ipv6_addr_copy(final_dst, &fl->fl6_dst);
7211 + __skb_pull(skb, skb_network_header_len(skb));
7212 + if (opt && opt->opt_flen)
7213 +diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
7214 +index 5383b33..81941a1 100644
7215 +--- a/net/ipv6/ip6_tunnel.c
7216 ++++ b/net/ipv6/ip6_tunnel.c
7217 +@@ -550,6 +550,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
7218 + ip_rt_put(rt);
7219 + goto out;
7220 + }
7221 ++ skb2->dst = (struct dst_entry *)rt;
7222 + } else {
7223 + ip_rt_put(rt);
7224 + if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos,
7225 +diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
7226 +index 1c5b09f..f46c38f 100644
7227 +--- a/net/ipv6/ipcomp6.c
7228 ++++ b/net/ipv6/ipcomp6.c
7229 +@@ -146,7 +146,9 @@ static int ipcomp6_output(struct xfrm_state *x, struct sk_buff *skb)
7230 + scratch = *per_cpu_ptr(ipcomp6_scratches, cpu);
7231 + tfm = *per_cpu_ptr(ipcd->tfms, cpu);
7232 +
7233 ++ local_bh_disable();
7234 + err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
7235 ++ local_bh_enable();
7236 + if (err || (dlen + sizeof(*ipch)) >= plen) {
7237 + put_cpu();
7238 + goto out_ok;
7239 +diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
7240 +index e273605..710a04f 100644
7241 +--- a/net/ipv6/netfilter/ip6_queue.c
7242 ++++ b/net/ipv6/netfilter/ip6_queue.c
7243 +@@ -333,8 +333,8 @@ static int
7244 + ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
7245 + {
7246 + int diff;
7247 +- int err;
7248 + struct ipv6hdr *user_iph = (struct ipv6hdr *)v->payload;
7249 ++ struct sk_buff *nskb;
7250 +
7251 + if (v->data_len < sizeof(*user_iph))
7252 + return 0;
7253 +@@ -346,14 +346,16 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
7254 + if (v->data_len > 0xFFFF)
7255 + return -EINVAL;
7256 + if (diff > skb_tailroom(e->skb)) {
7257 +- err = pskb_expand_head(e->skb, 0,
7258 ++ nskb = skb_copy_expand(e->skb, 0,
7259 + diff - skb_tailroom(e->skb),
7260 + GFP_ATOMIC);
7261 +- if (err) {
7262 ++ if (!nskb) {
7263 + printk(KERN_WARNING "ip6_queue: OOM "
7264 + "in mangle, dropping packet\n");
7265 +- return err;
7266 ++ return -ENOMEM;
7267 + }
7268 ++ kfree_skb(e->skb);
7269 ++ e->skb = nskb;
7270 + }
7271 + skb_put(e->skb, diff);
7272 + }
7273 +diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
7274 +index 6569767..dc22909 100644
7275 +--- a/net/ipv6/xfrm6_output.c
7276 ++++ b/net/ipv6/xfrm6_output.c
7277 +@@ -34,7 +34,7 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb)
7278 + if (mtu < IPV6_MIN_MTU)
7279 + mtu = IPV6_MIN_MTU;
7280 +
7281 +- if (skb->len > mtu) {
7282 ++ if (!skb->local_df && skb->len > mtu) {
7283 + skb->dev = dst->dev;
7284 + icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
7285 + ret = -EMSGSIZE;
7286 +diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
7287 +index 2c7bd2e..dc43df1 100644
7288 +--- a/net/netfilter/nfnetlink_log.c
7289 ++++ b/net/netfilter/nfnetlink_log.c
7290 +@@ -594,7 +594,7 @@ nfulnl_log_packet(unsigned int pf,
7291 + /* FIXME: do we want to make the size calculation conditional based on
7292 + * what is actually present? way more branches and checks, but more
7293 + * memory efficient... */
7294 +- size = NLMSG_ALIGN(sizeof(struct nfgenmsg))
7295 ++ size = NLMSG_SPACE(sizeof(struct nfgenmsg))
7296 + + nla_total_size(sizeof(struct nfulnl_msg_packet_hdr))
7297 + + nla_total_size(sizeof(u_int32_t)) /* ifindex */
7298 + + nla_total_size(sizeof(u_int32_t)) /* ifindex */
7299 +diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
7300 +index 3ceeffc..7c3646c 100644
7301 +--- a/net/netfilter/nfnetlink_queue.c
7302 ++++ b/net/netfilter/nfnetlink_queue.c
7303 +@@ -353,7 +353,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
7304 +
7305 + QDEBUG("entered\n");
7306 +
7307 +- size = NLMSG_ALIGN(sizeof(struct nfgenmsg))
7308 ++ size = NLMSG_SPACE(sizeof(struct nfgenmsg))
7309 + + nla_total_size(sizeof(struct nfqnl_msg_packet_hdr))
7310 + + nla_total_size(sizeof(u_int32_t)) /* ifindex */
7311 + + nla_total_size(sizeof(u_int32_t)) /* ifindex */
7312 +@@ -616,8 +616,8 @@ err_out_put:
7313 + static int
7314 + nfqnl_mangle(void *data, int data_len, struct nfqnl_queue_entry *e)
7315 + {
7316 ++ struct sk_buff *nskb;
7317 + int diff;
7318 +- int err;
7319 +
7320 + diff = data_len - e->skb->len;
7321 + if (diff < 0) {
7322 +@@ -627,14 +627,16 @@ nfqnl_mangle(void *data, int data_len, struct nfqnl_queue_entry *e)
7323 + if (data_len > 0xFFFF)
7324 + return -EINVAL;
7325 + if (diff > skb_tailroom(e->skb)) {
7326 +- err = pskb_expand_head(e->skb, 0,
7327 ++ nskb = skb_copy_expand(e->skb, 0,
7328 + diff - skb_tailroom(e->skb),
7329 + GFP_ATOMIC);
7330 +- if (err) {
7331 ++ if (!nskb) {
7332 + printk(KERN_WARNING "nf_queue: OOM "
7333 + "in mangle, dropping packet\n");
7334 +- return err;
7335 ++ return -ENOMEM;
7336 + }
7337 ++ kfree_skb(e->skb);
7338 ++ e->skb = nskb;
7339 + }
7340 + skb_put(e->skb, diff);
7341 + }
7342 +diff --git a/net/netfilter/xt_time.c b/net/netfilter/xt_time.c
7343 +index f9c55dc..5222a97 100644
7344 +--- a/net/netfilter/xt_time.c
7345 ++++ b/net/netfilter/xt_time.c
7346 +@@ -95,8 +95,11 @@ static inline void localtime_2(struct xtm *r, time_t time)
7347 + */
7348 + r->dse = time / 86400;
7349 +
7350 +- /* 1970-01-01 (w=0) was a Thursday (4). */
7351 +- r->weekday = (4 + r->dse) % 7;
7352 ++ /*
7353 ++ * 1970-01-01 (w=0) was a Thursday (4).
7354 ++ * -1 and +1 map Sunday properly onto 7.
7355 ++ */
7356 ++ r->weekday = (4 + r->dse - 1) % 7 + 1;
7357 + }
7358 +
7359 + static void localtime_3(struct xtm *r, time_t time)
7360 +diff --git a/security/commoncap.c b/security/commoncap.c
7361 +index ea61bc7..e87422e 100644
7362 +--- a/security/commoncap.c
7363 ++++ b/security/commoncap.c
7364 +@@ -539,7 +539,7 @@ int cap_task_kill(struct task_struct *p, struct siginfo *info,
7365 + * allowed.
7366 + * We must preserve legacy signal behavior in this case.
7367 + */
7368 +- if (p->euid == 0 && p->uid == current->uid)
7369 ++ if (p->uid == current->uid)
7370 + return 0;
7371 +
7372 + /* sigcont is permitted within same session */
7373
7374 Added: genpatches-2.6/trunk/2.6.24/1004_linux-2.6.24.5.patch
7375 ===================================================================
7376 --- genpatches-2.6/trunk/2.6.24/1004_linux-2.6.24.5.patch (rev 0)
7377 +++ genpatches-2.6/trunk/2.6.24/1004_linux-2.6.24.5.patch 2008-04-19 09:58:26 UTC (rev 1296)
7378 @@ -0,0 +1,2396 @@
7379 +diff --git a/Makefile b/Makefile
7380 +index 254de79..822d1ba 100644
7381 +--- a/Makefile
7382 ++++ b/Makefile
7383 +@@ -189,7 +189,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
7384 + # Alternatively CROSS_COMPILE can be set in the environment.
7385 + # Default value for CROSS_COMPILE is not to prefix executables
7386 + # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
7387 +-
7388 ++export KBUILD_BUILDHOST := $(SUBARCH)
7389 + ARCH ?= $(SUBARCH)
7390 + CROSS_COMPILE ?=
7391 +
7392 +diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
7393 +index 4ab83d5..7177a6c 100644
7394 +--- a/arch/parisc/kernel/firmware.c
7395 ++++ b/arch/parisc/kernel/firmware.c
7396 +@@ -1080,6 +1080,9 @@ void pdc_io_reset_devices(void)
7397 + spin_unlock_irqrestore(&pdc_lock, flags);
7398 + }
7399 +
7400 ++/* locked by pdc_console_lock */
7401 ++static int __attribute__((aligned(8))) iodc_retbuf[32];
7402 ++static char __attribute__((aligned(64))) iodc_dbuf[4096];
7403 +
7404 + /**
7405 + * pdc_iodc_print - Console print using IODC.
7406 +@@ -1091,24 +1094,20 @@ void pdc_io_reset_devices(void)
7407 + * Since the HP console requires CR+LF to perform a 'newline', we translate
7408 + * "\n" to "\r\n".
7409 + */
7410 +-int pdc_iodc_print(unsigned char *str, unsigned count)
7411 ++int pdc_iodc_print(const unsigned char *str, unsigned count)
7412 + {
7413 +- /* XXX Should we spinlock posx usage */
7414 + static int posx; /* for simple TAB-Simulation... */
7415 +- int __attribute__((aligned(8))) iodc_retbuf[32];
7416 +- char __attribute__((aligned(64))) iodc_dbuf[4096];
7417 + unsigned int i;
7418 + unsigned long flags;
7419 +
7420 +- memset(iodc_dbuf, 0, 4096);
7421 +- for (i = 0; i < count && i < 2048;) {
7422 ++ for (i = 0; i < count && i < 79;) {
7423 + switch(str[i]) {
7424 + case '\n':
7425 + iodc_dbuf[i+0] = '\r';
7426 + iodc_dbuf[i+1] = '\n';
7427 + i += 2;
7428 + posx = 0;
7429 +- break;
7430 ++ goto print;
7431 + case '\t':
7432 + while (posx & 7) {
7433 + iodc_dbuf[i] = ' ';
7434 +@@ -1124,6 +1123,16 @@ int pdc_iodc_print(unsigned char *str, unsigned count)
7435 + }
7436 + }
7437 +
7438 ++ /* if we're at the end of line, and not already inserting a newline,
7439 ++ * insert one anyway. iodc console doesn't claim to support >79 char
7440 ++ * lines. don't account for this in the return value.
7441 ++ */
7442 ++ if (i == 79 && iodc_dbuf[i-1] != '\n') {
7443 ++ iodc_dbuf[i+0] = '\r';
7444 ++ iodc_dbuf[i+1] = '\n';
7445 ++ }
7446 ++
7447 ++print:
7448 + spin_lock_irqsave(&pdc_lock, flags);
7449 + real32_call(PAGE0->mem_cons.iodc_io,
7450 + (unsigned long)PAGE0->mem_cons.hpa, ENTRY_IO_COUT,
7451 +@@ -1142,11 +1151,9 @@ int pdc_iodc_print(unsigned char *str, unsigned count)
7452 + */
7453 + int pdc_iodc_getc(void)
7454 + {
7455 +- unsigned long flags;
7456 +- static int __attribute__((aligned(8))) iodc_retbuf[32];
7457 +- static char __attribute__((aligned(64))) iodc_dbuf[4096];
7458 + int ch;
7459 + int status;
7460 ++ unsigned long flags;
7461 +
7462 + /* Bail if no console input device. */
7463 + if (!PAGE0->mem_kbd.iodc_io)
7464 +diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
7465 +index 33b1f84..7f471a4 100644
7466 +--- a/arch/parisc/kernel/pdc_cons.c
7467 ++++ b/arch/parisc/kernel/pdc_cons.c
7468 +@@ -52,10 +52,18 @@
7469 + #include <linux/tty.h>
7470 + #include <asm/pdc.h> /* for iodc_call() proto and friends */
7471 +
7472 ++static spinlock_t pdc_console_lock = SPIN_LOCK_UNLOCKED;
7473 +
7474 + static void pdc_console_write(struct console *co, const char *s, unsigned count)
7475 + {
7476 +- pdc_iodc_print(s, count);
7477 ++ int i = 0;
7478 ++ unsigned long flags;
7479 ++
7480 ++ spin_lock_irqsave(&pdc_console_lock, flags);
7481 ++ do {
7482 ++ i += pdc_iodc_print(s + i, count - i);
7483 ++ } while (i < count);
7484 ++ spin_unlock_irqrestore(&pdc_console_lock, flags);
7485 + }
7486 +
7487 + void pdc_printf(const char *fmt, ...)
7488 +@@ -73,7 +81,14 @@ void pdc_printf(const char *fmt, ...)
7489 +
7490 + int pdc_console_poll_key(struct console *co)
7491 + {
7492 +- return pdc_iodc_getc();
7493 ++ int c;
7494 ++ unsigned long flags;
7495 ++
7496 ++ spin_lock_irqsave(&pdc_console_lock, flags);
7497 ++ c = pdc_iodc_getc();
7498 ++ spin_unlock_irqrestore(&pdc_console_lock, flags);
7499 ++
7500 ++ return c;
7501 + }
7502 +
7503 + static int pdc_console_setup(struct console *co, char *options)
7504 +diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c
7505 +index 2ce3806..e060d26 100644
7506 +--- a/arch/parisc/kernel/signal.c
7507 ++++ b/arch/parisc/kernel/signal.c
7508 +@@ -534,7 +534,8 @@ insert_restart_trampoline(struct pt_regs *regs)
7509 + * Flushing one cacheline is cheap.
7510 + * "sync" on bigger (> 4 way) boxes is not.
7511 + */
7512 +- flush_icache_range(regs->gr[30], regs->gr[30] + 4);
7513 ++ flush_user_dcache_range(regs->gr[30], regs->gr[30] + 4);
7514 ++ flush_user_icache_range(regs->gr[30], regs->gr[30] + 4);
7515 +
7516 + regs->gr[31] = regs->gr[30] + 8;
7517 + /* Preserve original r28. */
7518 +diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c
7519 +index 81111a1..d4af131 100644
7520 +--- a/arch/sparc64/kernel/ptrace.c
7521 ++++ b/arch/sparc64/kernel/ptrace.c
7522 +@@ -127,6 +127,8 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
7523 + if (tlb_type == hypervisor)
7524 + return;
7525 +
7526 ++ preempt_disable();
7527 ++
7528 + #ifdef DCACHE_ALIASING_POSSIBLE
7529 + /* If bit 13 of the kernel address we used to access the
7530 + * user page is the same as the virtual address that page
7531 +@@ -165,6 +167,8 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
7532 + for (; start < end; start += icache_line_size)
7533 + flushi(start);
7534 + }
7535 ++
7536 ++ preempt_enable();
7537 + }
7538 +
7539 + asmlinkage void do_ptrace(struct pt_regs *regs)
7540 +diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
7541 +index fb13775..48afa08 100644
7542 +--- a/arch/sparc64/kernel/signal.c
7543 ++++ b/arch/sparc64/kernel/signal.c
7544 +@@ -354,7 +354,7 @@ static int invalid_frame_pointer(void __user *fp, int fplen)
7545 + static inline int
7546 + save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu)
7547 + {
7548 +- unsigned long *fpregs = (unsigned long *)(regs+1);
7549 ++ unsigned long *fpregs = current_thread_info()->fpregs;
7550 + unsigned long fprs;
7551 + int err = 0;
7552 +
7553 +diff --git a/arch/sparc64/mm/tlb.c b/arch/sparc64/mm/tlb.c
7554 +index 3f10fc9..a0f000b 100644
7555 +--- a/arch/sparc64/mm/tlb.c
7556 ++++ b/arch/sparc64/mm/tlb.c
7557 +@@ -23,10 +23,11 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers) = { 0, };
7558 +
7559 + void flush_tlb_pending(void)
7560 + {
7561 +- struct mmu_gather *mp = &__get_cpu_var(mmu_gathers);
7562 ++ struct mmu_gather *mp;
7563 +
7564 + preempt_disable();
7565 +
7566 ++ mp = &__get_cpu_var(mmu_gathers);
7567 + if (mp->tlb_nr) {
7568 + flush_tsb_user(mp);
7569 +
7570 +diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
7571 +index aa3d2c8..1f09cd9 100644
7572 +--- a/arch/x86/kernel/machine_kexec_64.c
7573 ++++ b/arch/x86/kernel/machine_kexec_64.c
7574 +@@ -233,6 +233,7 @@ NORET_TYPE void machine_kexec(struct kimage *image)
7575 +
7576 + void arch_crash_save_vmcoreinfo(void)
7577 + {
7578 ++ VMCOREINFO_SYMBOL(phys_base);
7579 + VMCOREINFO_SYMBOL(init_level4_pgt);
7580 +
7581 + #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE
7582 +diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
7583 +index 79ad152..f177f86 100644
7584 +--- a/arch/x86/xen/enlighten.c
7585 ++++ b/arch/x86/xen/enlighten.c
7586 +@@ -95,7 +95,7 @@ struct shared_info *HYPERVISOR_shared_info = (void *)&dummy_shared_info;
7587 + *
7588 + * 0: not available, 1: available
7589 + */
7590 +-static int have_vcpu_info_placement = 0;
7591 ++static int have_vcpu_info_placement = 1;
7592 +
7593 + static void __init xen_vcpu_setup(int cpu)
7594 + {
7595 +@@ -103,6 +103,7 @@ static void __init xen_vcpu_setup(int cpu)
7596 + int err;
7597 + struct vcpu_info *vcpup;
7598 +
7599 ++ BUG_ON(HYPERVISOR_shared_info == &dummy_shared_info);
7600 + per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
7601 +
7602 + if (!have_vcpu_info_placement)
7603 +@@ -153,6 +154,7 @@ static void xen_cpuid(unsigned int *eax, unsigned int *ebx,
7604 + if (*eax == 1)
7605 + maskedx = ~((1 << X86_FEATURE_APIC) | /* disable APIC */
7606 + (1 << X86_FEATURE_ACPI) | /* disable ACPI */
7607 ++ (1 << X86_FEATURE_SEP) | /* disable SEP */
7608 + (1 << X86_FEATURE_ACC)); /* thermal monitoring */
7609 +
7610 + asm(XEN_EMULATE_PREFIX "cpuid"
7611 +@@ -791,30 +793,40 @@ static __init void xen_pagetable_setup_start(pgd_t *base)
7612 + xen_write_cr3(__pa(base));
7613 + }
7614 +
7615 +-static __init void xen_pagetable_setup_done(pgd_t *base)
7616 ++static __init void setup_shared_info(void)
7617 + {
7618 +- /* This will work as long as patching hasn't happened yet
7619 +- (which it hasn't) */
7620 +- pv_mmu_ops.alloc_pt = xen_alloc_pt;
7621 +- pv_mmu_ops.set_pte = xen_set_pte;
7622 +-
7623 + if (!xen_feature(XENFEAT_auto_translated_physmap)) {
7624 ++ unsigned long addr = fix_to_virt(FIX_PARAVIRT_BOOTMAP);
7625 ++
7626 + /*
7627 + * Create a mapping for the shared info page.
7628 + * Should be set_fixmap(), but shared_info is a machine
7629 + * address with no corresponding pseudo-phys address.
7630 + */
7631 +- set_pte_mfn(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
7632 ++ set_pte_mfn(addr,
7633 + PFN_DOWN(xen_start_info->shared_info),
7634 + PAGE_KERNEL);
7635 +
7636 +- HYPERVISOR_shared_info =
7637 +- (struct shared_info *)fix_to_virt(FIX_PARAVIRT_BOOTMAP);
7638 +-
7639 ++ HYPERVISOR_shared_info = (struct shared_info *)addr;
7640 + } else
7641 + HYPERVISOR_shared_info =
7642 + (struct shared_info *)__va(xen_start_info->shared_info);
7643 +
7644 ++#ifndef CONFIG_SMP
7645 ++ /* In UP this is as good a place as any to set up shared info */
7646 ++ xen_setup_vcpu_info_placement();
7647 ++#endif
7648 ++}
7649 ++
7650 ++static __init void xen_pagetable_setup_done(pgd_t *base)
7651 ++{
7652 ++ /* This will work as long as patching hasn't happened yet
7653 ++ (which it hasn't) */
7654 ++ pv_mmu_ops.alloc_pt = xen_alloc_pt;
7655 ++ pv_mmu_ops.set_pte = xen_set_pte;
7656 ++
7657 ++ setup_shared_info();
7658 ++
7659 + /* Actually pin the pagetable down, but we can't set PG_pinned
7660 + yet because the page structures don't exist yet. */
7661 + {
7662 +@@ -1165,15 +1177,9 @@ asmlinkage void __init xen_start_kernel(void)
7663 + x86_write_percpu(xen_cr3, __pa(pgd));
7664 + x86_write_percpu(xen_current_cr3, __pa(pgd));
7665 +
7666 +-#ifdef CONFIG_SMP
7667 + /* Don't do the full vcpu_info placement stuff until we have a
7668 +- possible map. */
7669 ++ possible map and a non-dummy shared_info. */
7670 + per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
7671 +-#else
7672 +- /* May as well do it now, since there's no good time to call
7673 +- it later on UP. */
7674 +- xen_setup_vcpu_info_placement();
7675 +-#endif
7676 +
7677 + pv_info.kernel_rpl = 1;
7678 + if (xen_feature(XENFEAT_supervisor_mode_kernel))
7679 +diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S
7680 +index 1a43b60..6b71904 100644
7681 +--- a/arch/x86/xen/xen-asm.S
7682 ++++ b/arch/x86/xen/xen-asm.S
7683 +@@ -33,12 +33,17 @@
7684 + events, then enter the hypervisor to get them handled.
7685 + */
7686 + ENTRY(xen_irq_enable_direct)
7687 +- /* Clear mask and test pending */
7688 +- andw $0x00ff, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_pending
7689 ++ /* Unmask events */
7690 ++ movb $0, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_mask
7691 ++
7692 + /* Preempt here doesn't matter because that will deal with
7693 + any pending interrupts. The pending check may end up being
7694 + run on the wrong CPU, but that doesn't hurt. */
7695 ++
7696 ++ /* Test for pending */
7697 ++ testb $0xff, PER_CPU_VAR(xen_vcpu_info)+XEN_vcpu_info_pending
7698 + jz 1f
7699 ++
7700 + 2: call check_events
7701 + 1:
7702 + ENDPATCH(xen_irq_enable_direct)
7703 +diff --git a/crypto/xcbc.c b/crypto/xcbc.c
7704 +index a957373..25a1537 100644
7705 +--- a/crypto/xcbc.c
7706 ++++ b/crypto/xcbc.c
7707 +@@ -116,13 +116,11 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
7708 + struct crypto_xcbc_ctx *ctx = crypto_hash_ctx_aligned(parent);
7709 + struct crypto_cipher *tfm = ctx->child;
7710 + int bs = crypto_hash_blocksize(parent);
7711 +- unsigned int i = 0;
7712 +
7713 +- do {
7714 +-
7715 +- struct page *pg = sg_page(&sg[i]);
7716 +- unsigned int offset = sg[i].offset;
7717 +- unsigned int slen = sg[i].length;
7718 ++ for (;;) {
7719 ++ struct page *pg = sg_page(sg);
7720 ++ unsigned int offset = sg->offset;
7721 ++ unsigned int slen = sg->length;
7722 +
7723 + if (unlikely(slen > nbytes))
7724 + slen = nbytes;
7725 +@@ -182,8 +180,11 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
7726 + offset = 0;
7727 + pg++;
7728 + }
7729 +- i++;
7730 +- } while (nbytes>0);
7731 ++
7732 ++ if (!nbytes)
7733 ++ break;
7734 ++ sg = sg_next(sg);
7735 ++ }
7736 +
7737 + return 0;
7738 + }
7739 +diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
7740 +index f4487c3..3401e2c 100644
7741 +--- a/drivers/acpi/bus.c
7742 ++++ b/drivers/acpi/bus.c
7743 +@@ -350,10 +350,11 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
7744 + }
7745 +
7746 + spin_lock_irqsave(&acpi_bus_event_lock, flags);
7747 +- entry =
7748 +- list_entry(acpi_bus_event_list.next, struct acpi_bus_event, node);
7749 +- if (entry)
7750 ++ if (!list_empty(&acpi_bus_event_list)) {
7751 ++ entry = list_entry(acpi_bus_event_list.next,
7752 ++ struct acpi_bus_event, node);
7753 + list_del(&entry->node);
7754 ++ }
7755 + spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
7756 +
7757 + if (!entry)
7758 +diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
7759 +index e48ee4f..021153f 100644
7760 +--- a/drivers/acpi/processor_core.c
7761 ++++ b/drivers/acpi/processor_core.c
7762 +@@ -792,7 +792,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
7763 + acpi_processor_remove_fs(device);
7764 +
7765 + processors[pr->id] = NULL;
7766 +-
7767 ++ processor_device_array[pr->id] = NULL;
7768 + kfree(pr);
7769 +
7770 + return 0;
7771 +diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
7772 +index 6380726..455a98c 100644
7773 +--- a/drivers/ata/libata-core.c
7774 ++++ b/drivers/ata/libata-core.c
7775 +@@ -1936,24 +1936,34 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
7776 + id, sizeof(id[0]) * ATA_ID_WORDS, 0);
7777 + if (err_mask) {
7778 + if (err_mask & AC_ERR_NODEV_HINT) {
7779 +- DPRINTK("ata%u.%d: NODEV after polling detection\n",
7780 +- ap->print_id, dev->devno);
7781 ++ ata_dev_printk(dev, KERN_DEBUG,
7782 ++ "NODEV after polling detection\n");
7783 + return -ENOENT;
7784 + }
7785 +
7786 +- /* Device or controller might have reported the wrong
7787 +- * device class. Give a shot at the other IDENTIFY if
7788 +- * the current one is aborted by the device.
7789 +- */
7790 +- if (may_fallback &&
7791 +- (err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) {
7792 +- may_fallback = 0;
7793 ++ if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) {
7794 ++ /* Device or controller might have reported
7795 ++ * the wrong device class. Give a shot at the
7796 ++ * other IDENTIFY if the current one is
7797 ++ * aborted by the device.
7798 ++ */
7799 ++ if (may_fallback) {
7800 ++ may_fallback = 0;
7801 +
7802 +- if (class == ATA_DEV_ATA)
7803 +- class = ATA_DEV_ATAPI;
7804 +- else
7805 +- class = ATA_DEV_ATA;
7806 +- goto retry;
7807 ++ if (class == ATA_DEV_ATA)
7808 ++ class = ATA_DEV_ATAPI;
7809 ++ else
7810 ++ class = ATA_DEV_ATA;
7811 ++ goto retry;
7812 ++ }
7813 ++
7814 ++ /* Control reaches here iff the device aborted
7815 ++ * both flavors of IDENTIFYs which happens
7816 ++ * sometimes with phantom devices.
7817 ++ */
7818 ++ ata_dev_printk(dev, KERN_DEBUG,
7819 ++ "both IDENTIFYs aborted, assuming NODEV\n");
7820 ++ return -ENOENT;
7821 + }
7822 +
7823 + rc = -EIO;
7824 +diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
7825 +index b2fb6ba..1c6440b 100644
7826 +--- a/drivers/firmware/dmi_scan.c
7827 ++++ b/drivers/firmware/dmi_scan.c
7828 +@@ -219,7 +219,7 @@ static void __init dmi_save_ipmi_device(const struct dmi_header *dm)
7829 + dev->name = "IPMI controller";
7830 + dev->device_data = data;
7831 +
7832 +- list_add(&dev->list, &dmi_devices);
7833 ++ list_add_tail(&dev->list, &dmi_devices);
7834 + }
7835 +
7836 + /*
7837 +diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
7838 +index e0fa752..92c0a7f 100644
7839 +--- a/drivers/hwmon/w83781d.c
7840 ++++ b/drivers/hwmon/w83781d.c
7841 +@@ -1380,7 +1380,8 @@ w83781d_isa_probe(struct platform_device *pdev)
7842 +
7843 + /* Reserve the ISA region */
7844 + res = platform_get_resource(pdev, IORESOURCE_IO, 0);
7845 +- if (!request_region(res->start, W83781D_EXTENT, "w83781d")) {
7846 ++ if (!request_region(res->start + W83781D_ADDR_REG_OFFSET, 2,
7847 ++ "w83781d")) {
7848 + err = -EBUSY;
7849 + goto exit;
7850 + }
7851 +@@ -1432,7 +1433,7 @@ w83781d_isa_probe(struct platform_device *pdev)
7852 + device_remove_file(&pdev->dev, &dev_attr_name);
7853 + kfree(data);
7854 + exit_release_region:
7855 +- release_region(res->start, W83781D_EXTENT);
7856 ++ release_region(res->start + W83781D_ADDR_REG_OFFSET, 2);
7857 + exit:
7858 + return err;
7859 + }
7860 +@@ -1446,7 +1447,7 @@ w83781d_isa_remove(struct platform_device *pdev)
7861 + sysfs_remove_group(&pdev->dev.kobj, &w83781d_group);
7862 + sysfs_remove_group(&pdev->dev.kobj, &w83781d_group_opt);
7863 + device_remove_file(&pdev->dev, &dev_attr_name);
7864 +- release_region(data->client.addr, W83781D_EXTENT);
7865 ++ release_region(data->client.addr + W83781D_ADDR_REG_OFFSET, 2);
7866 + kfree(data);
7867 +
7868 + return 0;
7869 +@@ -1820,8 +1821,17 @@ w83781d_isa_found(unsigned short address)
7870 + {
7871 + int val, save, found = 0;
7872 +
7873 +- if (!request_region(address, W83781D_EXTENT, "w83781d"))
7874 ++ /* We have to request the region in two parts because some
7875 ++ boards declare base+4 to base+7 as a PNP device */
7876 ++ if (!request_region(address, 4, "w83781d")) {
7877 ++ pr_debug("w83781d: Failed to request low part of region\n");
7878 + return 0;
7879 ++ }
7880 ++ if (!request_region(address + 4, 4, "w83781d")) {
7881 ++ pr_debug("w83781d: Failed to request high part of region\n");
7882 ++ release_region(address, 4);
7883 ++ return 0;
7884 ++ }
7885 +
7886 + #define REALLY_SLOW_IO
7887 + /* We need the timeouts for at least some W83781D-like
7888 +@@ -1896,7 +1906,8 @@ w83781d_isa_found(unsigned short address)
7889 + val == 0x30 ? "W83782D" : "W83781D", (int)address);
7890 +
7891 + release:
7892 +- release_region(address, W83781D_EXTENT);
7893 ++ release_region(address + 4, 4);
7894 ++ release_region(address, 4);
7895 + return found;
7896 + }
7897 +
7898 +diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
7899 +index 6123c70..8932906 100644
7900 +--- a/drivers/macintosh/via-pmu.c
7901 ++++ b/drivers/macintosh/via-pmu.c
7902 +@@ -2842,7 +2842,7 @@ EXPORT_SYMBOL(pmu_wait_complete);
7903 + EXPORT_SYMBOL(pmu_suspend);
7904 + EXPORT_SYMBOL(pmu_resume);
7905 + EXPORT_SYMBOL(pmu_unlock);
7906 +-#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
7907 ++#if defined(CONFIG_PPC32)
7908 + EXPORT_SYMBOL(pmu_enable_irled);
7909 + EXPORT_SYMBOL(pmu_battery_count);
7910 + EXPORT_SYMBOL(pmu_batteries);
7911 +diff --git a/drivers/md/md.c b/drivers/md/md.c
7912 +index cef9ebd..5113e8d 100644
7913 +--- a/drivers/md/md.c
7914 ++++ b/drivers/md/md.c
7915 +@@ -1847,17 +1847,6 @@ static struct rdev_sysfs_entry rdev_state =
7916 + __ATTR(state, S_IRUGO|S_IWUSR, state_show, state_store);
7917 +
7918 + static ssize_t
7919 +-super_show(mdk_rdev_t *rdev, char *page)
7920 +-{
7921 +- if (rdev->sb_loaded && rdev->sb_size) {
7922 +- memcpy(page, page_address(rdev->sb_page), rdev->sb_size);
7923 +- return rdev->sb_size;
7924 +- } else
7925 +- return 0;
7926 +-}
7927 +-static struct rdev_sysfs_entry rdev_super = __ATTR_RO(super);
7928 +-
7929 +-static ssize_t
7930 + errors_show(mdk_rdev_t *rdev, char *page)
7931 + {
7932 + return sprintf(page, "%d\n", atomic_read(&rdev->corrected_errors));
7933 +@@ -1959,7 +1948,6 @@ __ATTR(size, S_IRUGO|S_IWUSR, rdev_size_show, rdev_size_store);
7934 +
7935 + static struct attribute *rdev_default_attrs[] = {
7936 + &rdev_state.attr,
7937 +- &rdev_super.attr,
7938 + &rdev_errors.attr,
7939 + &rdev_slot.attr,
7940 + &rdev_offset.attr,
7941 +diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
7942 +index e8c8157..032e36d 100644
7943 +--- a/drivers/md/raid5.c
7944 ++++ b/drivers/md/raid5.c
7945 +@@ -2348,25 +2348,15 @@ static void handle_issuing_new_write_requests6(raid5_conf_t *conf,
7946 + static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh,
7947 + struct stripe_head_state *s, int disks)
7948 + {
7949 ++ int canceled_check = 0;
7950 ++
7951 + set_bit(STRIPE_HANDLE, &sh->state);
7952 +- /* Take one of the following actions:
7953 +- * 1/ start a check parity operation if (uptodate == disks)
7954 +- * 2/ finish a check parity operation and act on the result
7955 +- * 3/ skip to the writeback section if we previously
7956 +- * initiated a recovery operation
7957 +- */
7958 +- if (s->failed == 0 &&
7959 +- !test_bit(STRIPE_OP_MOD_REPAIR_PD, &sh->ops.pending)) {
7960 +- if (!test_and_set_bit(STRIPE_OP_CHECK, &sh->ops.pending)) {
7961 +- BUG_ON(s->uptodate != disks);
7962 +- clear_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags);
7963 +- sh->ops.count++;
7964 +- s->uptodate--;
7965 +- } else if (
7966 +- test_and_clear_bit(STRIPE_OP_CHECK, &sh->ops.complete)) {
7967 +- clear_bit(STRIPE_OP_CHECK, &sh->ops.ack);
7968 +- clear_bit(STRIPE_OP_CHECK, &sh->ops.pending);
7969 +
7970 ++ /* complete a check operation */
7971 ++ if (test_and_clear_bit(STRIPE_OP_CHECK, &sh->ops.complete)) {
7972 ++ clear_bit(STRIPE_OP_CHECK, &sh->ops.ack);
7973 ++ clear_bit(STRIPE_OP_CHECK, &sh->ops.pending);
7974 ++ if (s->failed == 0) {
7975 + if (sh->ops.zero_sum_result == 0)
7976 + /* parity is correct (on disc,
7977 + * not in buffer any more)
7978 +@@ -2391,7 +2381,8 @@ static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh,
7979 + s->uptodate++;
7980 + }
7981 + }
7982 +- }
7983 ++ } else
7984 ++ canceled_check = 1; /* STRIPE_INSYNC is not set */
7985 + }
7986 +
7987 + /* check if we can clear a parity disk reconstruct */
7988 +@@ -2404,12 +2395,28 @@ static void handle_parity_checks5(raid5_conf_t *conf, struct stripe_head *sh,
7989 + clear_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending);
7990 + }
7991 +
7992 ++ /* start a new check operation if there are no failures, the stripe is
7993 ++ * not insync, and a repair is not in flight
7994 ++ */
7995 ++ if (s->failed == 0 &&
7996 ++ !test_bit(STRIPE_INSYNC, &sh->state) &&
7997 ++ !test_bit(STRIPE_OP_MOD_REPAIR_PD, &sh->ops.pending)) {
7998 ++ if (!test_and_set_bit(STRIPE_OP_CHECK, &sh->ops.pending)) {
7999 ++ BUG_ON(s->uptodate != disks);
8000 ++ clear_bit(R5_UPTODATE, &sh->dev[sh->pd_idx].flags);
8001 ++ sh->ops.count++;
8002 ++ s->uptodate--;
8003 ++ }
8004 ++ }
8005 ++
8006 + /* Wait for check parity and compute block operations to complete
8007 +- * before write-back
8008 ++ * before write-back. If a failure occurred while the check operation
8009 ++ * was in flight we need to cycle this stripe through handle_stripe
8010 ++ * since the parity block may not be uptodate
8011 + */
8012 +- if (!test_bit(STRIPE_INSYNC, &sh->state) &&
8013 +- !test_bit(STRIPE_OP_CHECK, &sh->ops.pending) &&
8014 +- !test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending)) {
8015 ++ if (!canceled_check && !test_bit(STRIPE_INSYNC, &sh->state) &&
8016 ++ !test_bit(STRIPE_OP_CHECK, &sh->ops.pending) &&
8017 ++ !test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending)) {
8018 + struct r5dev *dev;
8019 + /* either failed parity check, or recovery is happening */
8020 + if (s->failed == 0)
8021 +diff --git a/drivers/media/dvb/dvb-usb/ttusb2.c b/drivers/media/dvb/dvb-usb/ttusb2.c
8022 +index 88dc436..3b9da9c 100644
8023 +--- a/drivers/media/dvb/dvb-usb/ttusb2.c
8024 ++++ b/drivers/media/dvb/dvb-usb/ttusb2.c
8025 +@@ -144,6 +144,7 @@ static int ttusb2_power_ctrl(struct dvb_usb_device *d, int onoff)
8026 + static struct tda10086_config tda10086_config = {
8027 + .demod_address = 0x0e,
8028 + .invert = 0,
8029 ++ .diseqc_tone = 1,
8030 + };
8031 +
8032 + static int ttusb2_frontend_attach(struct dvb_usb_adapter *adap)
8033 +diff --git a/drivers/media/dvb/frontends/tda10086.c b/drivers/media/dvb/frontends/tda10086.c
8034 +index 9d26ace..0d2b69a 100644
8035 +--- a/drivers/media/dvb/frontends/tda10086.c
8036 ++++ b/drivers/media/dvb/frontends/tda10086.c
8037 +@@ -106,9 +106,12 @@ static int tda10086_write_mask(struct tda10086_state *state, int reg, int mask,
8038 + static int tda10086_init(struct dvb_frontend* fe)
8039 + {
8040 + struct tda10086_state* state = fe->demodulator_priv;
8041 ++ u8 t22k_off = 0x80;
8042 +
8043 + dprintk ("%s\n", __FUNCTION__);
8044 +
8045 ++ if (state->config->diseqc_tone)
8046 ++ t22k_off = 0;
8047 + // reset
8048 + tda10086_write_byte(state, 0x00, 0x00);
8049 + msleep(10);
8050 +@@ -158,7 +161,7 @@ static int tda10086_init(struct dvb_frontend* fe)
8051 + tda10086_write_byte(state, 0x3d, 0x80);
8052 +
8053 + // setup SEC
8054 +- tda10086_write_byte(state, 0x36, 0x80); // all SEC off, no 22k tone
8055 ++ tda10086_write_byte(state, 0x36, t22k_off); // all SEC off, 22k tone
8056 + tda10086_write_byte(state, 0x34, (((1<<19) * (22000/1000)) / (SACLK/1000))); // } tone frequency
8057 + tda10086_write_byte(state, 0x35, (((1<<19) * (22000/1000)) / (SACLK/1000)) >> 8); // }
8058 +
8059 +@@ -180,16 +183,20 @@ static void tda10086_diseqc_wait(struct tda10086_state *state)
8060 + static int tda10086_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
8061 + {
8062 + struct tda10086_state* state = fe->demodulator_priv;
8063 ++ u8 t22k_off = 0x80;
8064 +
8065 + dprintk ("%s\n", __FUNCTION__);
8066 +
8067 ++ if (state->config->diseqc_tone)
8068 ++ t22k_off = 0;
8069 ++
8070 + switch (tone) {
8071 + case SEC_TONE_OFF:
8072 +- tda10086_write_byte(state, 0x36, 0x80);
8073 ++ tda10086_write_byte(state, 0x36, t22k_off);
8074 + break;
8075 +
8076 + case SEC_TONE_ON:
8077 +- tda10086_write_byte(state, 0x36, 0x81);
8078 ++ tda10086_write_byte(state, 0x36, 0x01 + t22k_off);
8079 + break;
8080 + }
8081 +
8082 +@@ -202,9 +209,13 @@ static int tda10086_send_master_cmd (struct dvb_frontend* fe,
8083 + struct tda10086_state* state = fe->demodulator_priv;
8084 + int i;
8085 + u8 oldval;
8086 ++ u8 t22k_off = 0x80;
8087 +
8088 + dprintk ("%s\n", __FUNCTION__);
8089 +
8090 ++ if (state->config->diseqc_tone)
8091 ++ t22k_off = 0;
8092 ++
8093 + if (cmd->msg_len > 6)
8094 + return -EINVAL;
8095 + oldval = tda10086_read_byte(state, 0x36);
8096 +@@ -212,7 +223,8 @@ static int tda10086_send_master_cmd (struct dvb_frontend* fe,
8097 + for(i=0; i< cmd->msg_len; i++) {
8098 + tda10086_write_byte(state, 0x48+i, cmd->msg[i]);
8099 + }
8100 +- tda10086_write_byte(state, 0x36, 0x88 | ((cmd->msg_len - 1) << 4));
8101 ++ tda10086_write_byte(state, 0x36, (0x08 + t22k_off)
8102 ++ | ((cmd->msg_len - 1) << 4));
8103 +
8104 + tda10086_diseqc_wait(state);
8105 +
8106 +@@ -225,16 +237,20 @@ static int tda10086_send_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t minic
8107 + {
8108 + struct tda10086_state* state = fe->demodulator_priv;
8109 + u8 oldval = tda10086_read_byte(state, 0x36);
8110 ++ u8 t22k_off = 0x80;
8111 +
8112 + dprintk ("%s\n", __FUNCTION__);
8113 +
8114 ++ if (state->config->diseqc_tone)
8115 ++ t22k_off = 0;
8116 ++
8117 + switch(minicmd) {
8118 + case SEC_MINI_A:
8119 +- tda10086_write_byte(state, 0x36, 0x84);
8120 ++ tda10086_write_byte(state, 0x36, 0x04 + t22k_off);
8121 + break;
8122 +
8123 + case SEC_MINI_B:
8124 +- tda10086_write_byte(state, 0x36, 0x86);
8125 ++ tda10086_write_byte(state, 0x36, 0x06 + t22k_off);
8126 + break;
8127 + }
8128 +
8129 +diff --git a/drivers/media/dvb/frontends/tda10086.h b/drivers/media/dvb/frontends/tda10086.h
8130 +index ed584a8..eeceaee 100644
8131 +--- a/drivers/media/dvb/frontends/tda10086.h
8132 ++++ b/drivers/media/dvb/frontends/tda10086.h
8133 +@@ -33,6 +33,9 @@ struct tda10086_config
8134 +
8135 + /* does the "inversion" need inverted? */
8136 + u8 invert;
8137 ++
8138 ++ /* do we need the diseqc signal with carrier? */
8139 ++ u8 diseqc_tone;
8140 + };
8141 +
8142 + #if defined(CONFIG_DVB_TDA10086) || (defined(CONFIG_DVB_TDA10086_MODULE) && defined(MODULE))
8143 +diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
8144 +index 9268a82..14b00f5 100644
8145 +--- a/drivers/media/dvb/ttpci/budget.c
8146 ++++ b/drivers/media/dvb/ttpci/budget.c
8147 +@@ -351,6 +351,7 @@ static struct s5h1420_config s5h1420_config = {
8148 + static struct tda10086_config tda10086_config = {
8149 + .demod_address = 0x0e,
8150 + .invert = 0,
8151 ++ .diseqc_tone = 1,
8152 + };
8153 +
8154 + static u8 read_pwm(struct budget* budget)
8155 +diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
8156 +index 6d2dd87..9aa5b14 100644
8157 +--- a/drivers/media/video/ivtv/ivtv-driver.c
8158 ++++ b/drivers/media/video/ivtv/ivtv-driver.c
8159 +@@ -687,6 +687,9 @@ static int __devinit ivtv_init_struct1(struct ivtv *itv)
8160 + itv->vbi.in.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
8161 + itv->vbi.sliced_in = &itv->vbi.in.fmt.sliced;
8162 +
8163 ++ /* Init the sg table for osd/yuv output */
8164 ++ sg_init_table(itv->udma.SGlist, IVTV_DMA_SG_OSD_ENT);
8165 ++
8166 + /* OSD */
8167 + itv->osd_global_alpha_state = 1;
8168 + itv->osd_global_alpha = 255;
8169 +diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
8170 +index e1ab099..e204773 100644
8171 +--- a/drivers/media/video/saa7134/saa7134-dvb.c
8172 ++++ b/drivers/media/video/saa7134/saa7134-dvb.c
8173 +@@ -826,6 +826,7 @@ static struct tda1004x_config ads_tech_duo_config = {
8174 + static struct tda10086_config flydvbs = {
8175 + .demod_address = 0x0e,
8176 + .invert = 0,
8177 ++ .diseqc_tone = 0,
8178 + };
8179 +
8180 + /* ==================================================================
8181 +diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
8182 +index 1707f98..dbbe9a7 100644
8183 +--- a/drivers/mtd/chips/cfi_cmdset_0001.c
8184 ++++ b/drivers/mtd/chips/cfi_cmdset_0001.c
8185 +@@ -669,7 +669,7 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
8186 + /* Someone else might have been playing with it. */
8187 + return -EAGAIN;
8188 + }
8189 +-
8190 ++ /* Fall through */
8191 + case FL_READY:
8192 + case FL_CFI_QUERY:
8193 + case FL_JEDEC_QUERY:
8194 +@@ -729,14 +729,14 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long
8195 + chip->state = FL_READY;
8196 + return 0;
8197 +
8198 ++ case FL_SHUTDOWN:
8199 ++ /* The machine is rebooting now,so no one can get chip anymore */
8200 ++ return -EIO;
8201 + case FL_POINT:
8202 + /* Only if there's no operation suspended... */
8203 + if (mode == FL_READY && chip->oldstate == FL_READY)
8204 + return 0;
8205 +-
8206 +- case FL_SHUTDOWN:
8207 +- /* The machine is rebooting now,so no one can get chip anymore */
8208 +- return -EIO;
8209 ++ /* Fall through */
8210 + default:
8211 + sleep:
8212 + set_current_state(TASK_UNINTERRUPTIBLE);
8213 +diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
8214 +index be4b994..84038ca 100644
8215 +--- a/drivers/mtd/devices/block2mtd.c
8216 ++++ b/drivers/mtd/devices/block2mtd.c
8217 +@@ -408,7 +408,6 @@ static int block2mtd_setup2(const char *val)
8218 + if (token[1]) {
8219 + ret = parse_num(&erase_size, token[1]);
8220 + if (ret) {
8221 +- kfree(name);
8222 + parse_err("illegal erase size");
8223 + }
8224 + }
8225 +diff --git a/drivers/net/macb.c b/drivers/net/macb.c
8226 +index c796948..20838f9 100644
8227 +--- a/drivers/net/macb.c
8228 ++++ b/drivers/net/macb.c
8229 +@@ -1257,6 +1257,8 @@ static int __devexit macb_remove(struct platform_device *pdev)
8230 +
8231 + if (dev) {
8232 + bp = netdev_priv(dev);
8233 ++ if (bp->phy_dev)
8234 ++ phy_disconnect(bp->phy_dev);
8235 + mdiobus_unregister(&bp->mii_bus);
8236 + kfree(bp->mii_bus.irq);
8237 + unregister_netdev(dev);
8238 +diff --git a/drivers/net/plip.c b/drivers/net/plip.c
8239 +index 57c9866..0f40c00 100644
8240 +--- a/drivers/net/plip.c
8241 ++++ b/drivers/net/plip.c
8242 +@@ -903,17 +903,18 @@ plip_interrupt(void *dev_id)
8243 + struct net_local *nl;
8244 + struct plip_local *rcv;
8245 + unsigned char c0;
8246 ++ unsigned long flags;
8247 +
8248 + nl = netdev_priv(dev);
8249 + rcv = &nl->rcv_data;
8250 +
8251 +- spin_lock_irq (&nl->lock);
8252 ++ spin_lock_irqsave (&nl->lock, flags);
8253 +
8254 + c0 = read_status(dev);
8255 + if ((c0 & 0xf8) != 0xc0) {
8256 + if ((dev->irq != -1) && (net_debug > 1))
8257 + printk(KERN_DEBUG "%s: spurious interrupt\n", dev->name);
8258 +- spin_unlock_irq (&nl->lock);
8259 ++ spin_unlock_irqrestore (&nl->lock, flags);
8260 + return;
8261 + }
8262 +
8263 +@@ -942,7 +943,7 @@ plip_interrupt(void *dev_id)
8264 + break;
8265 + }
8266 +
8267 +- spin_unlock_irq(&nl->lock);
8268 ++ spin_unlock_irqrestore(&nl->lock, flags);
8269 + }
8270 +
8271 + static int
8272 +diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
8273 +index a7556cd..88a7e4e 100644
8274 +--- a/drivers/net/pppol2tp.c
8275 ++++ b/drivers/net/pppol2tp.c
8276 +@@ -302,14 +302,14 @@ pppol2tp_session_find(struct pppol2tp_tunnel *tunnel, u16 session_id)
8277 + struct pppol2tp_session *session;
8278 + struct hlist_node *walk;
8279 +
8280 +- read_lock(&tunnel->hlist_lock);
8281 ++ read_lock_bh(&tunnel->hlist_lock);
8282 + hlist_for_each_entry(session, walk, session_list, hlist) {
8283 + if (session->tunnel_addr.s_session == session_id) {
8284 +- read_unlock(&tunnel->hlist_lock);
8285 ++ read_unlock_bh(&tunnel->hlist_lock);
8286 + return session;
8287 + }
8288 + }
8289 +- read_unlock(&tunnel->hlist_lock);
8290 ++ read_unlock_bh(&tunnel->hlist_lock);
8291 +
8292 + return NULL;
8293 + }
8294 +@@ -320,14 +320,14 @@ static struct pppol2tp_tunnel *pppol2tp_tunnel_find(u16 tunnel_id)
8295 + {
8296 + struct pppol2tp_tunnel *tunnel = NULL;
8297 +
8298 +- read_lock(&pppol2tp_tunnel_list_lock);
8299 ++ read_lock_bh(&pppol2tp_tunnel_list_lock);
8300 + list_for_each_entry(tunnel, &pppol2tp_tunnel_list, list) {
8301 + if (tunnel->stats.tunnel_id == tunnel_id) {
8302 +- read_unlock(&pppol2tp_tunnel_list_lock);
8303 ++ read_unlock_bh(&pppol2tp_tunnel_list_lock);
8304 + return tunnel;
8305 + }
8306 + }
8307 +- read_unlock(&pppol2tp_tunnel_list_lock);
8308 ++ read_unlock_bh(&pppol2tp_tunnel_list_lock);
8309 +
8310 + return NULL;
8311 + }
8312 +@@ -342,10 +342,11 @@ static struct pppol2tp_tunnel *pppol2tp_tunnel_find(u16 tunnel_id)
8313 + static void pppol2tp_recv_queue_skb(struct pppol2tp_session *session, struct sk_buff *skb)
8314 + {
8315 + struct sk_buff *skbp;
8316 ++ struct sk_buff *tmp;
8317 + u16 ns = PPPOL2TP_SKB_CB(skb)->ns;
8318 +
8319 +- spin_lock(&session->reorder_q.lock);
8320 +- skb_queue_walk(&session->reorder_q, skbp) {
8321 ++ spin_lock_bh(&session->reorder_q.lock);
8322 ++ skb_queue_walk_safe(&session->reorder_q, skbp, tmp) {
8323 + if (PPPOL2TP_SKB_CB(skbp)->ns > ns) {
8324 + __skb_insert(skb, skbp->prev, skbp, &session->reorder_q);
8325 + PRINTK(session->debug, PPPOL2TP_MSG_SEQ, KERN_DEBUG,
8326 +@@ -360,7 +361,7 @@ static void pppol2tp_recv_queue_skb(struct pppol2tp_session *session, struct sk_
8327 + __skb_queue_tail(&session->reorder_q, skb);
8328 +
8329 + out:
8330 +- spin_unlock(&session->reorder_q.lock);
8331 ++ spin_unlock_bh(&session->reorder_q.lock);
8332 + }
8333 +
8334 + /* Dequeue a single skb.
8335 +@@ -371,10 +372,9 @@ static void pppol2tp_recv_dequeue_skb(struct pppol2tp_session *session, struct s
8336 + int length = PPPOL2TP_SKB_CB(skb)->length;
8337 + struct sock *session_sock = NULL;
8338 +
8339 +- /* We're about to requeue the skb, so unlink it and return resources
8340 ++ /* We're about to requeue the skb, so return resources
8341 + * to its current owner (a socket receive buffer).
8342 + */
8343 +- skb_unlink(skb, &session->reorder_q);
8344 + skb_orphan(skb);
8345 +
8346 + tunnel->stats.rx_packets++;
8347 +@@ -442,7 +442,7 @@ static void pppol2tp_recv_dequeue(struct pppol2tp_session *session)
8348 + * expect to send up next, dequeue it and any other
8349 + * in-sequence packets behind it.
8350 + */
8351 +- spin_lock(&session->reorder_q.lock);
8352 ++ spin_lock_bh(&session->reorder_q.lock);
8353 + skb_queue_walk_safe(&session->reorder_q, skb, tmp) {
8354 + if (time_after(jiffies, PPPOL2TP_SKB_CB(skb)->expires)) {
8355 + session->stats.rx_seq_discards++;
8356 +@@ -469,13 +469,18 @@ static void pppol2tp_recv_dequeue(struct pppol2tp_session *session)
8357 + goto out;
8358 + }
8359 + }
8360 +- spin_unlock(&session->reorder_q.lock);
8361 ++ __skb_unlink(skb, &session->reorder_q);
8362 ++
8363 ++ /* Process the skb. We release the queue lock while we
8364 ++ * do so to let other contexts process the queue.
8365 ++ */
8366 ++ spin_unlock_bh(&session->reorder_q.lock);
8367 + pppol2tp_recv_dequeue_skb(session, skb);
8368 +- spin_lock(&session->reorder_q.lock);
8369 ++ spin_lock_bh(&session->reorder_q.lock);
8370 + }
8371 +
8372 + out:
8373 +- spin_unlock(&session->reorder_q.lock);
8374 ++ spin_unlock_bh(&session->reorder_q.lock);
8375 + }
8376 +
8377 + /* Internal receive frame. Do the real work of receiving an L2TP data frame
8378 +@@ -1058,7 +1063,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
8379 +
8380 + /* Get routing info from the tunnel socket */
8381 + dst_release(skb->dst);
8382 +- skb->dst = sk_dst_get(sk_tun);
8383 ++ skb->dst = dst_clone(__sk_dst_get(sk_tun));
8384 + skb_orphan(skb);
8385 + skb->sk = sk_tun;
8386 +
8387 +@@ -1106,7 +1111,7 @@ static void pppol2tp_tunnel_closeall(struct pppol2tp_tunnel *tunnel)
8388 + PRINTK(tunnel->debug, PPPOL2TP_MSG_CONTROL, KERN_INFO,
8389 + "%s: closing all sessions...\n", tunnel->name);
8390 +
8391 +- write_lock(&tunnel->hlist_lock);
8392 ++ write_lock_bh(&tunnel->hlist_lock);
8393 + for (hash = 0; hash < PPPOL2TP_HASH_SIZE; hash++) {
8394 + again:
8395 + hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) {
8396 +@@ -1126,7 +1131,7 @@ again:
8397 + * disappear as we're jumping between locks.
8398 + */
8399 + sock_hold(sk);
8400 +- write_unlock(&tunnel->hlist_lock);
8401 ++ write_unlock_bh(&tunnel->hlist_lock);
8402 + lock_sock(sk);
8403 +
8404 + if (sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) {
8405 +@@ -1148,11 +1153,11 @@ again:
8406 + * list so we are guaranteed to make forward
8407 + * progress.
8408 + */
8409 +- write_lock(&tunnel->hlist_lock);
8410 ++ write_lock_bh(&tunnel->hlist_lock);
8411 + goto again;
8412 + }
8413 + }
8414 +- write_unlock(&tunnel->hlist_lock);
8415 ++ write_unlock_bh(&tunnel->hlist_lock);
8416 + }
8417 +
8418 + /* Really kill the tunnel.
8419 +@@ -1161,9 +1166,9 @@ again:
8420 + static void pppol2tp_tunnel_free(struct pppol2tp_tunnel *tunnel)
8421 + {
8422 + /* Remove from socket list */
8423 +- write_lock(&pppol2tp_tunnel_list_lock);
8424 ++ write_lock_bh(&pppol2tp_tunnel_list_lock);
8425 + list_del_init(&tunnel->list);
8426 +- write_unlock(&pppol2tp_tunnel_list_lock);
8427 ++ write_unlock_bh(&pppol2tp_tunnel_list_lock);
8428 +
8429 + atomic_dec(&pppol2tp_tunnel_count);
8430 + kfree(tunnel);
8431 +@@ -1239,9 +1244,9 @@ static void pppol2tp_session_destruct(struct sock *sk)
8432 + /* Delete the session socket from the
8433 + * hash
8434 + */
8435 +- write_lock(&tunnel->hlist_lock);
8436 ++ write_lock_bh(&tunnel->hlist_lock);
8437 + hlist_del_init(&session->hlist);
8438 +- write_unlock(&tunnel->hlist_lock);
8439 ++ write_unlock_bh(&tunnel->hlist_lock);
8440 +
8441 + atomic_dec(&pppol2tp_session_count);
8442 + }
8443 +@@ -1386,9 +1391,9 @@ static struct sock *pppol2tp_prepare_tunnel_socket(int fd, u16 tunnel_id,
8444 +
8445 + /* Add tunnel to our list */
8446 + INIT_LIST_HEAD(&tunnel->list);
8447 +- write_lock(&pppol2tp_tunnel_list_lock);
8448 ++ write_lock_bh(&pppol2tp_tunnel_list_lock);
8449 + list_add(&tunnel->list, &pppol2tp_tunnel_list);
8450 +- write_unlock(&pppol2tp_tunnel_list_lock);
8451 ++ write_unlock_bh(&pppol2tp_tunnel_list_lock);
8452 + atomic_inc(&pppol2tp_tunnel_count);
8453 +
8454 + /* Bump the reference count. The tunnel context is deleted
8455 +@@ -1593,11 +1598,11 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
8456 + sk->sk_user_data = session;
8457 +
8458 + /* Add session to the tunnel's hash list */
8459 +- write_lock(&tunnel->hlist_lock);
8460 ++ write_lock_bh(&tunnel->hlist_lock);
8461 + hlist_add_head(&session->hlist,
8462 + pppol2tp_session_id_hash(tunnel,
8463 + session->tunnel_addr.s_session));
8464 +- write_unlock(&tunnel->hlist_lock);
8465 ++ write_unlock_bh(&tunnel->hlist_lock);
8466 +
8467 + atomic_inc(&pppol2tp_session_count);
8468 +
8469 +@@ -2199,7 +2204,7 @@ static struct pppol2tp_session *next_session(struct pppol2tp_tunnel *tunnel, str
8470 + int next = 0;
8471 + int i;
8472 +
8473 +- read_lock(&tunnel->hlist_lock);
8474 ++ read_lock_bh(&tunnel->hlist_lock);
8475 + for (i = 0; i < PPPOL2TP_HASH_SIZE; i++) {
8476 + hlist_for_each_entry(session, walk, &tunnel->session_hlist[i], hlist) {
8477 + if (curr == NULL) {
8478 +@@ -2217,7 +2222,7 @@ static struct pppol2tp_session *next_session(struct pppol2tp_tunnel *tunnel, str
8479 + }
8480 + }
8481 + out:
8482 +- read_unlock(&tunnel->hlist_lock);
8483 ++ read_unlock_bh(&tunnel->hlist_lock);
8484 + if (!found)
8485 + session = NULL;
8486 +
8487 +@@ -2228,13 +2233,13 @@ static struct pppol2tp_tunnel *next_tunnel(struct pppol2tp_tunnel *curr)
8488 + {
8489 + struct pppol2tp_tunnel *tunnel = NULL;
8490 +
8491 +- read_lock(&pppol2tp_tunnel_list_lock);
8492 ++ read_lock_bh(&pppol2tp_tunnel_list_lock);
8493 + if (list_is_last(&curr->list, &pppol2tp_tunnel_list)) {
8494 + goto out;
8495 + }
8496 + tunnel = list_entry(curr->list.next, struct pppol2tp_tunnel, list);
8497 + out:
8498 +- read_unlock(&pppol2tp_tunnel_list_lock);
8499 ++ read_unlock_bh(&pppol2tp_tunnel_list_lock);
8500 +
8501 + return tunnel;
8502 + }
8503 +diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
8504 +index b570402..053eab6 100644
8505 +--- a/drivers/net/sis190.c
8506 ++++ b/drivers/net/sis190.c
8507 +@@ -1632,13 +1632,18 @@ static inline void sis190_init_rxfilter(struct net_device *dev)
8508 +
8509 + static int sis190_get_mac_addr(struct pci_dev *pdev, struct net_device *dev)
8510 + {
8511 +- u8 from;
8512 ++ int rc;
8513 ++
8514 ++ rc = sis190_get_mac_addr_from_eeprom(pdev, dev);
8515 ++ if (rc < 0) {
8516 ++ u8 reg;
8517 +
8518 +- pci_read_config_byte(pdev, 0x73, &from);
8519 ++ pci_read_config_byte(pdev, 0x73, &reg);
8520 +
8521 +- return (from & 0x00000001) ?
8522 +- sis190_get_mac_addr_from_apc(pdev, dev) :
8523 +- sis190_get_mac_addr_from_eeprom(pdev, dev);
8524 ++ if (reg & 0x00000001)
8525 ++ rc = sis190_get_mac_addr_from_apc(pdev, dev);
8526 ++ }
8527 ++ return rc;
8528 + }
8529 +
8530 + static void sis190_set_speed_auto(struct net_device *dev)
8531 +diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
8532 +index 6887214..6fac216 100644
8533 +--- a/drivers/net/sungem.c
8534 ++++ b/drivers/net/sungem.c
8535 +@@ -910,7 +910,7 @@ static int gem_poll(struct napi_struct *napi, int budget)
8536 + * rx ring - must call napi_disable(), which
8537 + * schedule_timeout()'s if polling is already disabled.
8538 + */
8539 +- work_done += gem_rx(gp, budget);
8540 ++ work_done += gem_rx(gp, budget - work_done);
8541 +
8542 + if (work_done >= budget)
8543 + return work_done;
8544 +diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
8545 +index 72e0bd5..05cdda9 100644
8546 +--- a/drivers/pci/quirks.c
8547 ++++ b/drivers/pci/quirks.c
8548 +@@ -950,6 +950,12 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82375, quirk_e
8549 + * accesses to the SMBus registers, with potentially bad effects. Thus you
8550 + * should be very careful when adding new entries: if SMM is accessing the
8551 + * Intel SMBus, this is a very good reason to leave it hidden.
8552 ++ *
8553 ++ * Likewise, many recent laptops use ACPI for thermal management. If the
8554 ++ * ACPI DSDT code accesses the SMBus, then Linux should not access it
8555 ++ * natively, and keeping the SMBus hidden is the right thing to do. If you
8556 ++ * are about to add an entry in the table below, please first disassemble
8557 ++ * the DSDT and double-check that there is no code accessing the SMBus.
8558 + */
8559 + static int asus_hides_smbus;
8560 +
8561 +@@ -1022,11 +1028,6 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev)
8562 + case 0x12bd: /* HP D530 */
8563 + asus_hides_smbus = 1;
8564 + }
8565 +- else if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB)
8566 +- switch (dev->subsystem_device) {
8567 +- case 0x099c: /* HP Compaq nx6110 */
8568 +- asus_hides_smbus = 1;
8569 +- }
8570 + } else if (unlikely(dev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG)) {
8571 + if (dev->device == PCI_DEVICE_ID_INTEL_82855PM_HB)
8572 + switch(dev->subsystem_device) {
8573 +diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
8574 +index 6b9840c..be22d23 100644
8575 +--- a/drivers/pnp/pnpacpi/rsparser.c
8576 ++++ b/drivers/pnp/pnpacpi/rsparser.c
8577 +@@ -85,7 +85,7 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
8578 + i < PNP_MAX_IRQ)
8579 + i++;
8580 + if (i >= PNP_MAX_IRQ && !warned) {
8581 +- printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ "
8582 ++ printk(KERN_WARNING "pnpacpi: exceeded the max number of IRQ "
8583 + "resources: %d \n", PNP_MAX_IRQ);
8584 + warned = 1;
8585 + return;
8586 +@@ -187,7 +187,7 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
8587 + res->dma_resource[i].start = dma;
8588 + res->dma_resource[i].end = dma;
8589 + } else if (!warned) {
8590 +- printk(KERN_ERR "pnpacpi: exceeded the max number of DMA "
8591 ++ printk(KERN_WARNING "pnpacpi: exceeded the max number of DMA "
8592 + "resources: %d \n", PNP_MAX_DMA);
8593 + warned = 1;
8594 + }
8595 +@@ -213,7 +213,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
8596 + res->port_resource[i].start = io;
8597 + res->port_resource[i].end = io + len - 1;
8598 + } else if (!warned) {
8599 +- printk(KERN_ERR "pnpacpi: exceeded the max number of IO "
8600 ++ printk(KERN_WARNING "pnpacpi: exceeded the max number of IO "
8601 + "resources: %d \n", PNP_MAX_PORT);
8602 + warned = 1;
8603 + }
8604 +@@ -241,7 +241,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
8605 + res->mem_resource[i].start = mem;
8606 + res->mem_resource[i].end = mem + len - 1;
8607 + } else if (!warned) {
8608 +- printk(KERN_ERR "pnpacpi: exceeded the max number of mem "
8609 ++ printk(KERN_WARNING "pnpacpi: exceeded the max number of mem "
8610 + "resources: %d\n", PNP_MAX_MEM);
8611 + warned = 1;
8612 + }
8613 +diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
8614 +index 865f32b..b4e1022 100644
8615 +--- a/drivers/uio/uio.c
8616 ++++ b/drivers/uio/uio.c
8617 +@@ -447,6 +447,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
8618 +
8619 + vma->vm_flags |= VM_IO | VM_RESERVED;
8620 +
8621 ++ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
8622 ++
8623 + return remap_pfn_range(vma,
8624 + vma->vm_start,
8625 + idev->info->mem[mi].addr >> PAGE_SHIFT,
8626 +diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
8627 +index fcd40ec..d864239 100644
8628 +--- a/drivers/usb/core/message.c
8629 ++++ b/drivers/usb/core/message.c
8630 +@@ -1189,7 +1189,10 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
8631 + return -EINVAL;
8632 + }
8633 +
8634 +- ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
8635 ++ if (dev->quirks & USB_QUIRK_NO_SET_INTF)
8636 ++ ret = -EPIPE;
8637 ++ else
8638 ++ ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
8639 + USB_REQ_SET_INTERFACE, USB_RECIP_INTERFACE,
8640 + alternate, interface, NULL, 0, 5000);
8641 +
8642 +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
8643 +index d42c561..fb552d7 100644
8644 +--- a/drivers/usb/core/quirks.c
8645 ++++ b/drivers/usb/core/quirks.c
8646 +@@ -39,6 +39,9 @@ static const struct usb_device_id usb_quirk_list[] = {
8647 + /* M-Systems Flash Disk Pioneers */
8648 + { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
8649 +
8650 ++ /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */
8651 ++ { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
8652 ++
8653 + /* Philips PSC805 audio device */
8654 + { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
8655 +
8656 +diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h
8657 +index 8a0d174..74ce8bc 100644
8658 +--- a/drivers/usb/serial/keyspan.h
8659 ++++ b/drivers/usb/serial/keyspan.h
8660 +@@ -637,6 +637,7 @@ static struct usb_serial_driver keyspan_pre_device = {
8661 + .description = "Keyspan - (without firmware)",
8662 + .id_table = keyspan_pre_ids,
8663 + .num_interrupt_in = NUM_DONT_CARE,
8664 ++ .num_interrupt_out = NUM_DONT_CARE,
8665 + .num_bulk_in = NUM_DONT_CARE,
8666 + .num_bulk_out = NUM_DONT_CARE,
8667 + .num_ports = 1,
8668 +@@ -651,6 +652,7 @@ static struct usb_serial_driver keyspan_1port_device = {
8669 + .description = "Keyspan 1 port adapter",
8670 + .id_table = keyspan_1port_ids,
8671 + .num_interrupt_in = NUM_DONT_CARE,
8672 ++ .num_interrupt_out = NUM_DONT_CARE,
8673 + .num_bulk_in = NUM_DONT_CARE,
8674 + .num_bulk_out = NUM_DONT_CARE,
8675 + .num_ports = 1,
8676 +@@ -678,6 +680,7 @@ static struct usb_serial_driver keyspan_2port_device = {
8677 + .description = "Keyspan 2 port adapter",
8678 + .id_table = keyspan_2port_ids,
8679 + .num_interrupt_in = NUM_DONT_CARE,
8680 ++ .num_interrupt_out = NUM_DONT_CARE,
8681 + .num_bulk_in = NUM_DONT_CARE,
8682 + .num_bulk_out = NUM_DONT_CARE,
8683 + .num_ports = 2,
8684 +@@ -705,6 +708,7 @@ static struct usb_serial_driver keyspan_4port_device = {
8685 + .description = "Keyspan 4 port adapter",
8686 + .id_table = keyspan_4port_ids,
8687 + .num_interrupt_in = NUM_DONT_CARE,
8688 ++ .num_interrupt_out = NUM_DONT_CARE,
8689 + .num_bulk_in = NUM_DONT_CARE,
8690 + .num_bulk_out = NUM_DONT_CARE,
8691 + .num_ports = 4,
8692 +diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
8693 +index 1f01494..337f5ce 100644
8694 +--- a/drivers/usb/serial/ti_usb_3410_5052.c
8695 ++++ b/drivers/usb/serial/ti_usb_3410_5052.c
8696 +@@ -264,8 +264,8 @@ static struct usb_serial_driver ti_1port_device = {
8697 + .description = "TI USB 3410 1 port adapter",
8698 + .usb_driver = &ti_usb_driver,
8699 + .id_table = ti_id_table_3410,
8700 +- .num_interrupt_in = 1,
8701 +- .num_bulk_in = 1,
8702 ++ .num_interrupt_in = NUM_DONT_CARE,
8703 ++ .num_bulk_in = NUM_DONT_CARE,
8704 + .num_bulk_out = 1,
8705 + .num_ports = 1,
8706 + .attach = ti_startup,
8707 +diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
8708 +index 7ee087f..762fb04 100644
8709 +--- a/drivers/usb/serial/visor.c
8710 ++++ b/drivers/usb/serial/visor.c
8711 +@@ -191,7 +191,7 @@ static struct usb_serial_driver handspring_device = {
8712 + .id_table = id_table,
8713 + .num_interrupt_in = NUM_DONT_CARE,
8714 + .num_bulk_in = 2,
8715 +- .num_bulk_out = 2,
8716 ++ .num_bulk_out = NUM_DONT_CARE,
8717 + .num_ports = 2,
8718 + .open = visor_open,
8719 + .close = visor_close,
8720 +diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
8721 +index c646750..ec3641e 100644
8722 +--- a/drivers/usb/storage/transport.c
8723 ++++ b/drivers/usb/storage/transport.c
8724 +@@ -1010,7 +1010,8 @@ int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us)
8725 + US_DEBUGP("Bulk Status S 0x%x T 0x%x R %u Stat 0x%x\n",
8726 + le32_to_cpu(bcs->Signature), bcs->Tag,
8727 + residue, bcs->Status);
8728 +- if (bcs->Tag != us->tag || bcs->Status > US_BULK_STAT_PHASE) {
8729 ++ if (!(bcs->Tag == us->tag || (us->flags & US_FL_BULK_IGNORE_TAG)) ||
8730 ++ bcs->Status > US_BULK_STAT_PHASE) {
8731 + US_DEBUGP("Bulk logical error\n");
8732 + return USB_STOR_TRANSPORT_ERROR;
8733 + }
8734 +diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
8735 +index fe12737..054f53c 100644
8736 +--- a/drivers/usb/storage/unusual_devs.h
8737 ++++ b/drivers/usb/storage/unusual_devs.h
8738 +@@ -1557,6 +1557,17 @@ UNUSUAL_DEV( 0x22b8, 0x4810, 0x0001, 0x0001,
8739 + US_SC_DEVICE, US_PR_DEVICE, NULL,
8740 + US_FL_FIX_CAPACITY),
8741 +
8742 ++/*
8743 ++ * Patch by Constantin Baranov <const@×××××.ru>
8744 ++ * Report by Andreas Koenecke.
8745 ++ * Motorola ROKR Z6.
8746 ++ */
8747 ++UNUSUAL_DEV( 0x22b8, 0x6426, 0x0101, 0x0101,
8748 ++ "Motorola",
8749 ++ "MSnc.",
8750 ++ US_SC_DEVICE, US_PR_DEVICE, NULL,
8751 ++ US_FL_FIX_INQUIRY | US_FL_FIX_CAPACITY | US_FL_BULK_IGNORE_TAG),
8752 ++
8753 + /* Reported by Radovan Garabik <garabik@×××××××××××××××××××××.sk> */
8754 + UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999,
8755 + "MPIO",
8756 +diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
8757 +index 1194f5e..01072f4 100644
8758 +--- a/drivers/video/fbmem.c
8759 ++++ b/drivers/video/fbmem.c
8760 +@@ -1521,6 +1521,7 @@ module_init(fbmem_init);
8761 + static void __exit
8762 + fbmem_exit(void)
8763 + {
8764 ++ remove_proc_entry("fb", NULL);
8765 + class_destroy(fb_class);
8766 + unregister_chrdev(FB_MAJOR, "fb");
8767 + }
8768 +diff --git a/fs/buffer.c b/fs/buffer.c
8769 +index 7249e01..5bb5ffc 100644
8770 +--- a/fs/buffer.c
8771 ++++ b/fs/buffer.c
8772 +@@ -2565,14 +2565,13 @@ int nobh_write_end(struct file *file, struct address_space *mapping,
8773 + struct inode *inode = page->mapping->host;
8774 + struct buffer_head *head = fsdata;
8775 + struct buffer_head *bh;
8776 ++ BUG_ON(fsdata != NULL && page_has_buffers(page));
8777 +
8778 +- if (!PageMappedToDisk(page)) {
8779 +- if (unlikely(copied < len) && !page_has_buffers(page))
8780 +- attach_nobh_buffers(page, head);
8781 +- if (page_has_buffers(page))
8782 +- return generic_write_end(file, mapping, pos, len,
8783 +- copied, page, fsdata);
8784 +- }
8785 ++ if (unlikely(copied < len) && !page_has_buffers(page))
8786 ++ attach_nobh_buffers(page, head);
8787 ++ if (page_has_buffers(page))
8788 ++ return generic_write_end(file, mapping, pos, len,
8789 ++ copied, page, fsdata);
8790 +
8791 + SetPageUptodate(page);
8792 + set_page_dirty(page);
8793 +diff --git a/fs/dcache.c b/fs/dcache.c
8794 +index d9ca1e5..c369bf9 100644
8795 +--- a/fs/dcache.c
8796 ++++ b/fs/dcache.c
8797 +@@ -1408,9 +1408,6 @@ void d_delete(struct dentry * dentry)
8798 + if (atomic_read(&dentry->d_count) == 1) {
8799 + dentry_iput(dentry);
8800 + fsnotify_nameremove(dentry, isdir);
8801 +-
8802 +- /* remove this and other inotify debug checks after 2.6.18 */
8803 +- dentry->d_flags &= ~DCACHE_INOTIFY_PARENT_WATCHED;
8804 + return;
8805 + }
8806 +
8807 +diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
8808 +index 1955ee6..078684f 100644
8809 +--- a/fs/hfsplus/dir.c
8810 ++++ b/fs/hfsplus/dir.c
8811 +@@ -340,16 +340,23 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry)
8812 +
8813 + if (inode->i_nlink > 0)
8814 + drop_nlink(inode);
8815 +- hfsplus_delete_inode(inode);
8816 +- if (inode->i_ino != cnid && !inode->i_nlink) {
8817 +- if (!atomic_read(&HFSPLUS_I(inode).opencnt)) {
8818 +- res = hfsplus_delete_cat(inode->i_ino, HFSPLUS_SB(sb).hidden_dir, NULL);
8819 +- if (!res)
8820 +- hfsplus_delete_inode(inode);
8821 ++ if (inode->i_ino == cnid)
8822 ++ clear_nlink(inode);
8823 ++ if (!inode->i_nlink) {
8824 ++ if (inode->i_ino != cnid) {
8825 ++ HFSPLUS_SB(sb).file_count--;
8826 ++ if (!atomic_read(&HFSPLUS_I(inode).opencnt)) {
8827 ++ res = hfsplus_delete_cat(inode->i_ino,
8828 ++ HFSPLUS_SB(sb).hidden_dir,
8829 ++ NULL);
8830 ++ if (!res)
8831 ++ hfsplus_delete_inode(inode);
8832 ++ } else
8833 ++ inode->i_flags |= S_DEAD;
8834 + } else
8835 +- inode->i_flags |= S_DEAD;
8836 ++ hfsplus_delete_inode(inode);
8837 + } else
8838 +- clear_nlink(inode);
8839 ++ HFSPLUS_SB(sb).file_count--;
8840 + inode->i_ctime = CURRENT_TIME_SEC;
8841 + mark_inode_dirty(inode);
8842 +
8843 +diff --git a/fs/inotify.c b/fs/inotify.c
8844 +index 2c5b921..690e725 100644
8845 +--- a/fs/inotify.c
8846 ++++ b/fs/inotify.c
8847 +@@ -168,20 +168,14 @@ static void set_dentry_child_flags(struct inode *inode, int watched)
8848 + struct dentry *child;
8849 +
8850 + list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) {
8851 +- if (!child->d_inode) {
8852 +- WARN_ON(child->d_flags & DCACHE_INOTIFY_PARENT_WATCHED);
8853 ++ if (!child->d_inode)
8854 + continue;
8855 +- }
8856 ++
8857 + spin_lock(&child->d_lock);
8858 +- if (watched) {
8859 +- WARN_ON(child->d_flags &
8860 +- DCACHE_INOTIFY_PARENT_WATCHED);
8861 ++ if (watched)
8862 + child->d_flags |= DCACHE_INOTIFY_PARENT_WATCHED;
8863 +- } else {
8864 +- WARN_ON(!(child->d_flags &
8865 +- DCACHE_INOTIFY_PARENT_WATCHED));
8866 +- child->d_flags&=~DCACHE_INOTIFY_PARENT_WATCHED;
8867 +- }
8868 ++ else
8869 ++ child->d_flags &=~DCACHE_INOTIFY_PARENT_WATCHED;
8870 + spin_unlock(&child->d_lock);
8871 + }
8872 + }
8873 +@@ -253,7 +247,6 @@ void inotify_d_instantiate(struct dentry *entry, struct inode *inode)
8874 + if (!inode)
8875 + return;
8876 +
8877 +- WARN_ON(entry->d_flags & DCACHE_INOTIFY_PARENT_WATCHED);
8878 + spin_lock(&entry->d_lock);
8879 + parent = entry->d_parent;
8880 + if (parent->d_inode && inotify_inode_watched(parent->d_inode))
8881 +@@ -627,6 +620,7 @@ s32 inotify_add_watch(struct inotify_handle *ih, struct inotify_watch *watch,
8882 + struct inode *inode, u32 mask)
8883 + {
8884 + int ret = 0;
8885 ++ int newly_watched;
8886 +
8887 + /* don't allow invalid bits: we don't want flags set */
8888 + mask &= IN_ALL_EVENTS | IN_ONESHOT;
8889 +@@ -653,12 +647,18 @@ s32 inotify_add_watch(struct inotify_handle *ih, struct inotify_watch *watch,
8890 + */
8891 + watch->inode = igrab(inode);
8892 +
8893 +- if (!inotify_inode_watched(inode))
8894 +- set_dentry_child_flags(inode, 1);
8895 +-
8896 + /* Add the watch to the handle's and the inode's list */
8897 ++ newly_watched = !inotify_inode_watched(inode);
8898 + list_add(&watch->h_list, &ih->watches);
8899 + list_add(&watch->i_list, &inode->inotify_watches);
8900 ++ /*
8901 ++ * Set child flags _after_ adding the watch, so there is no race
8902 ++ * windows where newly instantiated children could miss their parent's
8903 ++ * watched flag.
8904 ++ */
8905 ++ if (newly_watched)
8906 ++ set_dentry_child_flags(inode, 1);
8907 ++
8908 + out:
8909 + mutex_unlock(&ih->mutex);
8910 + mutex_unlock(&inode->inotify_mutex);
8911 +diff --git a/fs/locks.c b/fs/locks.c
8912 +index 8b8388e..2fd29d9 100644
8913 +--- a/fs/locks.c
8914 ++++ b/fs/locks.c
8915 +@@ -1805,17 +1805,21 @@ again:
8916 + if (error)
8917 + goto out;
8918 +
8919 +- for (;;) {
8920 +- error = vfs_lock_file(filp, cmd, file_lock, NULL);
8921 +- if (error != -EAGAIN || cmd == F_SETLK)
8922 +- break;
8923 +- error = wait_event_interruptible(file_lock->fl_wait,
8924 +- !file_lock->fl_next);
8925 +- if (!error)
8926 +- continue;
8927 ++ if (filp->f_op && filp->f_op->lock != NULL)
8928 ++ error = filp->f_op->lock(filp, cmd, file_lock);
8929 ++ else {
8930 ++ for (;;) {
8931 ++ error = posix_lock_file(filp, file_lock, NULL);
8932 ++ if (error != -EAGAIN || cmd == F_SETLK)
8933 ++ break;
8934 ++ error = wait_event_interruptible(file_lock->fl_wait,
8935 ++ !file_lock->fl_next);
8936 ++ if (!error)
8937 ++ continue;
8938 +
8939 +- locks_delete_block(file_lock);
8940 +- break;
8941 ++ locks_delete_block(file_lock);
8942 ++ break;
8943 ++ }
8944 + }
8945 +
8946 + /*
8947 +@@ -1929,17 +1933,21 @@ again:
8948 + if (error)
8949 + goto out;
8950 +
8951 +- for (;;) {
8952 +- error = vfs_lock_file(filp, cmd, file_lock, NULL);
8953 +- if (error != -EAGAIN || cmd == F_SETLK64)
8954 +- break;
8955 +- error = wait_event_interruptible(file_lock->fl_wait,
8956 +- !file_lock->fl_next);
8957 +- if (!error)
8958 +- continue;
8959 ++ if (filp->f_op && filp->f_op->lock != NULL)
8960 ++ error = filp->f_op->lock(filp, cmd, file_lock);
8961 ++ else {
8962 ++ for (;;) {
8963 ++ error = posix_lock_file(filp, file_lock, NULL);
8964 ++ if (error != -EAGAIN || cmd == F_SETLK64)
8965 ++ break;
8966 ++ error = wait_event_interruptible(file_lock->fl_wait,
8967 ++ !file_lock->fl_next);
8968 ++ if (!error)
8969 ++ continue;
8970 +
8971 +- locks_delete_block(file_lock);
8972 +- break;
8973 ++ locks_delete_block(file_lock);
8974 ++ break;
8975 ++ }
8976 + }
8977 +
8978 + /*
8979 +diff --git a/fs/signalfd.c b/fs/signalfd.c
8980 +index fb7f7e8..1b414ef 100644
8981 +--- a/fs/signalfd.c
8982 ++++ b/fs/signalfd.c
8983 +@@ -110,9 +110,14 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
8984 + err |= __put_user(kinfo->si_uid, &uinfo->ssi_uid);
8985 + err |= __put_user((long) kinfo->si_ptr, &uinfo->ssi_ptr);
8986 + break;
8987 +- default: /* this is just in case for now ... */
8988 ++ default:
8989 ++ /*
8990 ++ * This case catches also the signals queued by sigqueue().
8991 ++ */
8992 + err |= __put_user(kinfo->si_pid, &uinfo->ssi_pid);
8993 + err |= __put_user(kinfo->si_uid, &uinfo->ssi_uid);
8994 ++ err |= __put_user((long) kinfo->si_ptr, &uinfo->ssi_ptr);
8995 ++ err |= __put_user(kinfo->si_int, &uinfo->ssi_int);
8996 + break;
8997 + }
8998 +
8999 +diff --git a/include/asm-parisc/futex.h b/include/asm-parisc/futex.h
9000 +index dbee6e6..fdc6d05 100644
9001 +--- a/include/asm-parisc/futex.h
9002 ++++ b/include/asm-parisc/futex.h
9003 +@@ -56,6 +56,12 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
9004 + int err = 0;
9005 + int uval;
9006 +
9007 ++ /* futex.c wants to do a cmpxchg_inatomic on kernel NULL, which is
9008 ++ * our gateway page, and causes no end of trouble...
9009 ++ */
9010 ++ if (segment_eq(KERNEL_DS, get_fs()) && !uaddr)
9011 ++ return -EFAULT;
9012 ++
9013 + if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
9014 + return -EFAULT;
9015 +
9016 +@@ -67,5 +73,5 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
9017 + return uval;
9018 + }
9019 +
9020 +-#endif
9021 +-#endif
9022 ++#endif /*__KERNEL__*/
9023 ++#endif /*_ASM_PARISC_FUTEX_H*/
9024 +diff --git a/include/asm-parisc/pdc.h b/include/asm-parisc/pdc.h
9025 +index deda8c3..9eaa794 100644
9026 +--- a/include/asm-parisc/pdc.h
9027 ++++ b/include/asm-parisc/pdc.h
9028 +@@ -645,8 +645,7 @@ int pdc_soft_power_button(int sw_control);
9029 + void pdc_io_reset(void);
9030 + void pdc_io_reset_devices(void);
9031 + int pdc_iodc_getc(void);
9032 +-int pdc_iodc_print(unsigned char *str, unsigned count);
9033 +-void pdc_printf(const char *fmt, ...);
9034 ++int pdc_iodc_print(const unsigned char *str, unsigned count);
9035 +
9036 + void pdc_emergency_unlock(void);
9037 + int pdc_sti_call(unsigned long func, unsigned long flags,
9038 +diff --git a/include/asm-sparc64/backoff.h b/include/asm-sparc64/backoff.h
9039 +index dadd6c3..fa1fdf6 100644
9040 +--- a/include/asm-sparc64/backoff.h
9041 ++++ b/include/asm-sparc64/backoff.h
9042 +@@ -12,7 +12,8 @@
9043 + mov reg, tmp; \
9044 + 88: brnz,pt tmp, 88b; \
9045 + sub tmp, 1, tmp; \
9046 +- cmp reg, BACKOFF_LIMIT; \
9047 ++ set BACKOFF_LIMIT, tmp; \
9048 ++ cmp reg, tmp; \
9049 + bg,pn %xcc, label; \
9050 + nop; \
9051 + ba,pt %xcc, label; \
9052 +diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
9053 +index 71d4ada..3e6b68f 100644
9054 +--- a/include/linux/ethtool.h
9055 ++++ b/include/linux/ethtool.h
9056 +@@ -12,6 +12,7 @@
9057 + #ifndef _LINUX_ETHTOOL_H
9058 + #define _LINUX_ETHTOOL_H
9059 +
9060 ++#include <linux/types.h>
9061 +
9062 + /* This should work for both 32 and 64 bit userland. */
9063 + struct ethtool_cmd {
9064 +diff --git a/include/linux/percpu.h b/include/linux/percpu.h
9065 +index 926adaa..1702ab5 100644
9066 +--- a/include/linux/percpu.h
9067 ++++ b/include/linux/percpu.h
9068 +@@ -34,7 +34,7 @@
9069 + #ifdef CONFIG_SMP
9070 +
9071 + struct percpu_data {
9072 +- void *ptrs[NR_CPUS];
9073 ++ void *ptrs[1];
9074 + };
9075 +
9076 + #define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata)
9077 +diff --git a/include/linux/sched.h b/include/linux/sched.h
9078 +index cc14656..59e00df 100644
9079 +--- a/include/linux/sched.h
9080 ++++ b/include/linux/sched.h
9081 +@@ -1449,6 +1449,12 @@ static inline void idle_task_exit(void) {}
9082 +
9083 + extern void sched_idle_next(void);
9084 +
9085 ++#if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)
9086 ++extern void wake_up_idle_cpu(int cpu);
9087 ++#else
9088 ++static inline void wake_up_idle_cpu(int cpu) { }
9089 ++#endif
9090 ++
9091 + #ifdef CONFIG_SCHED_DEBUG
9092 + extern unsigned int sysctl_sched_latency;
9093 + extern unsigned int sysctl_sched_min_granularity;
9094 +diff --git a/include/linux/security.h b/include/linux/security.h
9095 +index ac05083..d842ee3 100644
9096 +--- a/include/linux/security.h
9097 ++++ b/include/linux/security.h
9098 +@@ -62,7 +62,6 @@ extern int cap_inode_need_killpriv(struct dentry *dentry);
9099 + extern int cap_inode_killpriv(struct dentry *dentry);
9100 + extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags);
9101 + extern void cap_task_reparent_to_init (struct task_struct *p);
9102 +-extern int cap_task_kill(struct task_struct *p, struct siginfo *info, int sig, u32 secid);
9103 + extern int cap_task_setscheduler (struct task_struct *p, int policy, struct sched_param *lp);
9104 + extern int cap_task_setioprio (struct task_struct *p, int ioprio);
9105 + extern int cap_task_setnice (struct task_struct *p, int nice);
9106 +@@ -2112,7 +2111,7 @@ static inline int security_task_kill (struct task_struct *p,
9107 + struct siginfo *info, int sig,
9108 + u32 secid)
9109 + {
9110 +- return cap_task_kill(p, info, sig, secid);
9111 ++ return 0;
9112 + }
9113 +
9114 + static inline int security_task_wait (struct task_struct *p)
9115 +diff --git a/include/linux/time.h b/include/linux/time.h
9116 +index b04136d..3e8fd9e 100644
9117 +--- a/include/linux/time.h
9118 ++++ b/include/linux/time.h
9119 +@@ -173,6 +173,10 @@ static inline void timespec_add_ns(struct timespec *a, u64 ns)
9120 + {
9121 + ns += a->tv_nsec;
9122 + while(unlikely(ns >= NSEC_PER_SEC)) {
9123 ++ /* The following asm() prevents the compiler from
9124 ++ * optimising this loop into a modulo operation. */
9125 ++ asm("" : "+r"(ns));
9126 ++
9127 + ns -= NSEC_PER_SEC;
9128 + a->tv_sec++;
9129 + }
9130 +diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
9131 +index 2692ec9..1f999ec 100644
9132 +--- a/include/linux/usb/quirks.h
9133 ++++ b/include/linux/usb/quirks.h
9134 +@@ -9,3 +9,6 @@
9135 +
9136 + /* device can't resume correctly so reset it instead */
9137 + #define USB_QUIRK_RESET_RESUME 0x00000002
9138 ++
9139 ++/* device can't handle Set-Interface requests */
9140 ++#define USB_QUIRK_NO_SET_INTF 0x00000004
9141 +diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
9142 +index a417b09..e3380e3 100644
9143 +--- a/include/linux/usb_usual.h
9144 ++++ b/include/linux/usb_usual.h
9145 +@@ -50,7 +50,9 @@
9146 + US_FLAG(CAPACITY_HEURISTICS, 0x00001000) \
9147 + /* sometimes sizes is too big */ \
9148 + US_FLAG(MAX_SECTORS_MIN,0x00002000) \
9149 +- /* Sets max_sectors to arch min */
9150 ++ /* Sets max_sectors to arch min */ \
9151 ++ US_FLAG(BULK_IGNORE_TAG,0x00004000) \
9152 ++ /* Ignore tag mismatch in bulk operations */
9153 +
9154 +
9155 + #define US_FLAG(name, value) US_FL_##name = value ,
9156 +diff --git a/kernel/sched.c b/kernel/sched.c
9157 +index 5ba5db9..f8dc213 100644
9158 +--- a/kernel/sched.c
9159 ++++ b/kernel/sched.c
9160 +@@ -727,6 +727,49 @@ static void resched_cpu(int cpu)
9161 + resched_task(cpu_curr(cpu));
9162 + spin_unlock_irqrestore(&rq->lock, flags);
9163 + }
9164 ++
9165 ++#ifdef CONFIG_NO_HZ
9166 ++/*
9167 ++ * When add_timer_on() enqueues a timer into the timer wheel of an
9168 ++ * idle CPU then this timer might expire before the next timer event
9169 ++ * which is scheduled to wake up that CPU. In case of a completely
9170 ++ * idle system the next event might even be infinite time into the
9171 ++ * future. wake_up_idle_cpu() ensures that the CPU is woken up and
9172 ++ * leaves the inner idle loop so the newly added timer is taken into
9173 ++ * account when the CPU goes back to idle and evaluates the timer
9174 ++ * wheel for the next timer event.
9175 ++ */
9176 ++void wake_up_idle_cpu(int cpu)
9177 ++{
9178 ++ struct rq *rq = cpu_rq(cpu);
9179 ++
9180 ++ if (cpu == smp_processor_id())
9181 ++ return;
9182 ++
9183 ++ /*
9184 ++ * This is safe, as this function is called with the timer
9185 ++ * wheel base lock of (cpu) held. When the CPU is on the way
9186 ++ * to idle and has not yet set rq->curr to idle then it will
9187 ++ * be serialized on the timer wheel base lock and take the new
9188 ++ * timer into account automatically.
9189 ++ */
9190 ++ if (rq->curr != rq->idle)
9191 ++ return;
9192 ++
9193 ++ /*
9194 ++ * We can set TIF_RESCHED on the idle task of the other CPU
9195 ++ * lockless. The worst case is that the other CPU runs the
9196 ++ * idle task through an additional NOOP schedule()
9197 ++ */
9198 ++ set_tsk_thread_flag(rq->idle, TIF_NEED_RESCHED);
9199 ++
9200 ++ /* NEED_RESCHED must be visible before we test polling */
9201 ++ smp_mb();
9202 ++ if (!tsk_is_polling(rq->idle))
9203 ++ smp_send_reschedule(cpu);
9204 ++}
9205 ++#endif
9206 ++
9207 + #else
9208 + static inline void resched_task(struct task_struct *p)
9209 + {
9210 +diff --git a/kernel/timer.c b/kernel/timer.c
9211 +index 2a00c22..4ee4f89 100644
9212 +--- a/kernel/timer.c
9213 ++++ b/kernel/timer.c
9214 +@@ -453,10 +453,18 @@ void add_timer_on(struct timer_list *timer, int cpu)
9215 + spin_lock_irqsave(&base->lock, flags);
9216 + timer_set_base(timer, base);
9217 + internal_add_timer(base, timer);
9218 ++ /*
9219 ++ * Check whether the other CPU is idle and needs to be
9220 ++ * triggered to reevaluate the timer wheel when nohz is
9221 ++ * active. We are protected against the other CPU fiddling
9222 ++ * with the timer by holding the timer base lock. This also
9223 ++ * makes sure that a CPU on the way to idle can not evaluate
9224 ++ * the timer wheel.
9225 ++ */
9226 ++ wake_up_idle_cpu(cpu);
9227 + spin_unlock_irqrestore(&base->lock, flags);
9228 + }
9229 +
9230 +-
9231 + /**
9232 + * mod_timer - modify a timer's timeout
9233 + * @timer: the timer to be modified
9234 +diff --git a/mm/allocpercpu.c b/mm/allocpercpu.c
9235 +index 00b0262..b0012e2 100644
9236 +--- a/mm/allocpercpu.c
9237 ++++ b/mm/allocpercpu.c
9238 +@@ -6,6 +6,10 @@
9239 + #include <linux/mm.h>
9240 + #include <linux/module.h>
9241 +
9242 ++#ifndef cache_line_size
9243 ++#define cache_line_size() L1_CACHE_BYTES
9244 ++#endif
9245 ++
9246 + /**
9247 + * percpu_depopulate - depopulate per-cpu data for given cpu
9248 + * @__pdata: per-cpu data to depopulate
9249 +@@ -52,6 +56,11 @@ void *percpu_populate(void *__pdata, size_t size, gfp_t gfp, int cpu)
9250 + struct percpu_data *pdata = __percpu_disguise(__pdata);
9251 + int node = cpu_to_node(cpu);
9252 +
9253 ++ /*
9254 ++ * We should make sure each CPU gets private memory.
9255 ++ */
9256 ++ size = roundup(size, cache_line_size());
9257 ++
9258 + BUG_ON(pdata->ptrs[cpu]);
9259 + if (node_online(node))
9260 + pdata->ptrs[cpu] = kmalloc_node(size, gfp|__GFP_ZERO, node);
9261 +@@ -98,7 +107,11 @@ EXPORT_SYMBOL_GPL(__percpu_populate_mask);
9262 + */
9263 + void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask)
9264 + {
9265 +- void *pdata = kzalloc(sizeof(struct percpu_data), gfp);
9266 ++ /*
9267 ++ * We allocate whole cache lines to avoid false sharing
9268 ++ */
9269 ++ size_t sz = roundup(nr_cpu_ids * sizeof(void *), cache_line_size());
9270 ++ void *pdata = kzalloc(sz, gfp);
9271 + void *__pdata = __percpu_disguise(pdata);
9272 +
9273 + if (unlikely(!pdata))
9274 +diff --git a/mm/slab.c b/mm/slab.c
9275 +index 79c3be0..8323e7d 100644
9276 +--- a/mm/slab.c
9277 ++++ b/mm/slab.c
9278 +@@ -1484,7 +1484,7 @@ void __init kmem_cache_init(void)
9279 + list_add(&cache_cache.next, &cache_chain);
9280 + cache_cache.colour_off = cache_line_size();
9281 + cache_cache.array[smp_processor_id()] = &initarray_cache.cache;
9282 +- cache_cache.nodelists[node] = &initkmem_list3[CACHE_CACHE];
9283 ++ cache_cache.nodelists[node] = &initkmem_list3[CACHE_CACHE + node];
9284 +
9285 + /*
9286 + * struct kmem_cache size depends on nr_node_ids, which
9287 +@@ -1605,7 +1605,7 @@ void __init kmem_cache_init(void)
9288 + int nid;
9289 +
9290 + for_each_online_node(nid) {
9291 +- init_list(&cache_cache, &initkmem_list3[CACHE_CACHE], nid);
9292 ++ init_list(&cache_cache, &initkmem_list3[CACHE_CACHE + nid], nid);
9293 +
9294 + init_list(malloc_sizes[INDEX_AC].cs_cachep,
9295 + &initkmem_list3[SIZE_AC + nid], nid);
9296 +diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
9297 +index 032bf44..156ad38 100644
9298 +--- a/net/8021q/vlan.c
9299 ++++ b/net/8021q/vlan.c
9300 +@@ -326,7 +326,7 @@ static int vlan_dev_init(struct net_device *dev)
9301 + int subclass = 0;
9302 +
9303 + /* IFF_BROADCAST|IFF_MULTICAST; ??? */
9304 +- dev->flags = real_dev->flags & ~IFF_UP;
9305 ++ dev->flags = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI);
9306 + dev->iflink = real_dev->ifindex;
9307 + dev->state = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) |
9308 + (1<<__LINK_STATE_DORMANT))) |
9309 +diff --git a/net/ax25/ax25_out.c b/net/ax25/ax25_out.c
9310 +index 92b517a..bf706f8 100644
9311 +--- a/net/ax25/ax25_out.c
9312 ++++ b/net/ax25/ax25_out.c
9313 +@@ -117,6 +117,12 @@ void ax25_output(ax25_cb *ax25, int paclen, struct sk_buff *skb)
9314 + unsigned char *p;
9315 + int frontlen, len, fragno, ka9qfrag, first = 1;
9316 +
9317 ++ if (paclen < 16) {
9318 ++ WARN_ON_ONCE(1);
9319 ++ kfree_skb(skb);
9320 ++ return;
9321 ++ }
9322 ++
9323 + if ((skb->len - 1) > paclen) {
9324 + if (*skb->data == AX25_P_TEXT) {
9325 + skb_pull(skb, 1); /* skip PID */
9326 +@@ -251,8 +257,6 @@ void ax25_kick(ax25_cb *ax25)
9327 + if (start == end)
9328 + return;
9329 +
9330 +- ax25->vs = start;
9331 +-
9332 + /*
9333 + * Transmit data until either we're out of data to send or
9334 + * the window is full. Send a poll on the final I frame if
9335 +@@ -261,8 +265,13 @@ void ax25_kick(ax25_cb *ax25)
9336 +
9337 + /*
9338 + * Dequeue the frame and copy it.
9339 ++ * Check for race with ax25_clear_queues().
9340 + */
9341 + skb = skb_dequeue(&ax25->write_queue);
9342 ++ if (!skb)
9343 ++ return;
9344 ++
9345 ++ ax25->vs = start;
9346 +
9347 + do {
9348 + if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) {
9349 +diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
9350 +index 372b0d3..76f5f6f 100644
9351 +--- a/net/bluetooth/hci_core.c
9352 ++++ b/net/bluetooth/hci_core.c
9353 +@@ -901,8 +901,6 @@ int hci_unregister_dev(struct hci_dev *hdev)
9354 +
9355 + BT_DBG("%p name %s type %d", hdev, hdev->name, hdev->type);
9356 +
9357 +- hci_unregister_sysfs(hdev);
9358 +-
9359 + write_lock_bh(&hci_dev_list_lock);
9360 + list_del(&hdev->list);
9361 + write_unlock_bh(&hci_dev_list_lock);
9362 +@@ -914,6 +912,8 @@ int hci_unregister_dev(struct hci_dev *hdev)
9363 +
9364 + hci_notify(hdev, HCI_DEV_UNREG);
9365 +
9366 ++ hci_unregister_sysfs(hdev);
9367 ++
9368 + __hci_dev_put(hdev);
9369 +
9370 + return 0;
9371 +diff --git a/net/core/dev.c b/net/core/dev.c
9372 +index 4d44372..82f77ef 100644
9373 +--- a/net/core/dev.c
9374 ++++ b/net/core/dev.c
9375 +@@ -3240,7 +3240,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)
9376 + return -EOPNOTSUPP;
9377 +
9378 + case SIOCADDMULTI:
9379 +- if (!dev->set_multicast_list ||
9380 ++ if ((!dev->set_multicast_list && !dev->set_rx_mode) ||
9381 + ifr->ifr_hwaddr.sa_family != AF_UNSPEC)
9382 + return -EINVAL;
9383 + if (!netif_device_present(dev))
9384 +@@ -3249,7 +3249,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)
9385 + dev->addr_len, 1);
9386 +
9387 + case SIOCDELMULTI:
9388 +- if (!dev->set_multicast_list ||
9389 ++ if ((!dev->set_multicast_list && !dev->set_rx_mode) ||
9390 + ifr->ifr_hwaddr.sa_family != AF_UNSPEC)
9391 + return -EINVAL;
9392 + if (!netif_device_present(dev))
9393 +diff --git a/net/core/netpoll.c b/net/core/netpoll.c
9394 +index c499b5c..2386c5e 100644
9395 +--- a/net/core/netpoll.c
9396 ++++ b/net/core/netpoll.c
9397 +@@ -219,10 +219,12 @@ static void zap_completion_queue(void)
9398 + while (clist != NULL) {
9399 + struct sk_buff *skb = clist;
9400 + clist = clist->next;
9401 +- if (skb->destructor)
9402 ++ if (skb->destructor) {
9403 ++ atomic_inc(&skb->users);
9404 + dev_kfree_skb_any(skb); /* put this one back */
9405 +- else
9406 ++ } else {
9407 + __kfree_skb(skb);
9408 ++ }
9409 + }
9410 + }
9411 +
9412 +diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
9413 +index 8e65182..4305154 100644
9414 +--- a/net/ipv4/tcp.c
9415 ++++ b/net/ipv4/tcp.c
9416 +@@ -583,7 +583,7 @@ new_segment:
9417 + if (!(psize -= copy))
9418 + goto out;
9419 +
9420 +- if (skb->len < mss_now || (flags & MSG_OOB))
9421 ++ if (skb->len < size_goal || (flags & MSG_OOB))
9422 + continue;
9423 +
9424 + if (forced_push(tp)) {
9425 +@@ -829,7 +829,7 @@ new_segment:
9426 + if ((seglen -= copy) == 0 && iovlen == 0)
9427 + goto out;
9428 +
9429 +- if (skb->len < mss_now || (flags & MSG_OOB))
9430 ++ if (skb->len < size_goal || (flags & MSG_OOB))
9431 + continue;
9432 +
9433 + if (forced_push(tp)) {
9434 +diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
9435 +index f4c1eef..52931e8 100644
9436 +--- a/net/ipv4/tcp_output.c
9437 ++++ b/net/ipv4/tcp_output.c
9438 +@@ -258,7 +258,7 @@ static u16 tcp_select_window(struct sock *sk)
9439 + *
9440 + * Relax Will Robinson.
9441 + */
9442 +- new_win = cur_win;
9443 ++ new_win = ALIGN(cur_win, 1 << tp->rx_opt.rcv_wscale);
9444 + }
9445 + tp->rcv_wnd = new_win;
9446 + tp->rcv_wup = tp->rcv_nxt;
9447 +diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
9448 +index e170c67..89f95f9 100644
9449 +--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
9450 ++++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
9451 +@@ -147,7 +147,9 @@ static __inline__ void fq_kill(struct nf_ct_frag6_queue *fq)
9452 +
9453 + static void nf_ct_frag6_evictor(void)
9454 + {
9455 ++ local_bh_disable();
9456 + inet_frag_evictor(&nf_frags);
9457 ++ local_bh_enable();
9458 + }
9459 +
9460 + static void nf_ct_frag6_expire(unsigned long data)
9461 +diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
9462 +index 46cf962..8c50eb4 100644
9463 +--- a/net/llc/af_llc.c
9464 ++++ b/net/llc/af_llc.c
9465 +@@ -155,6 +155,9 @@ static int llc_ui_create(struct net *net, struct socket *sock, int protocol)
9466 + struct sock *sk;
9467 + int rc = -ESOCKTNOSUPPORT;
9468 +
9469 ++ if (!capable(CAP_NET_RAW))
9470 ++ return -EPERM;
9471 ++
9472 + if (net != &init_net)
9473 + return -EAFNOSUPPORT;
9474 +
9475 +diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
9476 +index e595e65..7888955 100644
9477 +--- a/net/sched/sch_generic.c
9478 ++++ b/net/sched/sch_generic.c
9479 +@@ -178,10 +178,22 @@ static inline int qdisc_restart(struct net_device *dev)
9480 +
9481 + void __qdisc_run(struct net_device *dev)
9482 + {
9483 +- do {
9484 +- if (!qdisc_restart(dev))
9485 ++ unsigned long start_time = jiffies;
9486 ++
9487 ++ while (qdisc_restart(dev)) {
9488 ++ if (netif_queue_stopped(dev))
9489 ++ break;
9490 ++
9491 ++ /*
9492 ++ * Postpone processing if
9493 ++ * 1. another process needs the CPU;
9494 ++ * 2. we've been doing it for too long.
9495 ++ */
9496 ++ if (need_resched() || jiffies != start_time) {
9497 ++ netif_schedule(dev);
9498 + break;
9499 +- } while (!netif_queue_stopped(dev));
9500 ++ }
9501 ++ }
9502 +
9503 + clear_bit(__LINK_STATE_QDISC_RUNNING, &dev->state);
9504 + }
9505 +diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
9506 +index 5e608a6..88860dd 100644
9507 +--- a/net/sched/sch_htb.c
9508 ++++ b/net/sched/sch_htb.c
9509 +@@ -708,9 +708,11 @@ static void htb_charge_class(struct htb_sched *q, struct htb_class *cl,
9510 + */
9511 + static psched_time_t htb_do_events(struct htb_sched *q, int level)
9512 + {
9513 +- int i;
9514 +-
9515 +- for (i = 0; i < 500; i++) {
9516 ++ /* don't run for longer than 2 jiffies; 2 is used instead of
9517 ++ 1 to simplify things when jiffy is going to be incremented
9518 ++ too soon */
9519 ++ unsigned long stop_at = jiffies + 2;
9520 ++ while (time_before(jiffies, stop_at)) {
9521 + struct htb_class *cl;
9522 + long diff;
9523 + struct rb_node *p = rb_first(&q->wait_pq[level]);
9524 +@@ -728,9 +730,8 @@ static psched_time_t htb_do_events(struct htb_sched *q, int level)
9525 + if (cl->cmode != HTB_CAN_SEND)
9526 + htb_add_to_wait_tree(q, cl, diff);
9527 + }
9528 +- if (net_ratelimit())
9529 +- printk(KERN_WARNING "htb: too many events !\n");
9530 +- return q->now + PSCHED_TICKS_PER_SEC / 10;
9531 ++ /* too much load - let's continue on next jiffie */
9532 ++ return q->now + PSCHED_TICKS_PER_SEC / HZ;
9533 + }
9534 +
9535 + /* Returns class->node+prio from id-tree where classe's id is >= id. NULL
9536 +diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
9537 +index 6a7d010..a98c003 100644
9538 +--- a/net/sctp/bind_addr.c
9539 ++++ b/net/sctp/bind_addr.c
9540 +@@ -209,6 +209,7 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new,
9541 + int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
9542 + {
9543 + struct sctp_sockaddr_entry *addr, *temp;
9544 ++ int found = 0;
9545 +
9546 + /* We hold the socket lock when calling this function,
9547 + * and that acts as a writer synchronizing lock.
9548 +@@ -216,13 +217,14 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
9549 + list_for_each_entry_safe(addr, temp, &bp->address_list, list) {
9550 + if (sctp_cmp_addr_exact(&addr->a, del_addr)) {
9551 + /* Found the exact match. */
9552 ++ found = 1;
9553 + addr->valid = 0;
9554 + list_del_rcu(&addr->list);
9555 + break;
9556 + }
9557 + }
9558 +
9559 +- if (addr && !addr->valid) {
9560 ++ if (found) {
9561 + call_rcu(&addr->rcu, sctp_local_addr_free);
9562 + SCTP_DBG_OBJCNT_DEC(addr);
9563 + return 0;
9564 +diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
9565 +index 7f31ff6..1eaa1b5 100644
9566 +--- a/net/sctp/ipv6.c
9567 ++++ b/net/sctp/ipv6.c
9568 +@@ -89,6 +89,7 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
9569 + struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
9570 + struct sctp_sockaddr_entry *addr = NULL;
9571 + struct sctp_sockaddr_entry *temp;
9572 ++ int found = 0;
9573 +
9574 + switch (ev) {
9575 + case NETDEV_UP:
9576 +@@ -111,13 +112,14 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
9577 + &sctp_local_addr_list, list) {
9578 + if (ipv6_addr_equal(&addr->a.v6.sin6_addr,
9579 + &ifa->addr)) {
9580 ++ found = 1;
9581 + addr->valid = 0;
9582 + list_del_rcu(&addr->list);
9583 + break;
9584 + }
9585 + }
9586 + spin_unlock_bh(&sctp_local_addr_lock);
9587 +- if (addr && !addr->valid)
9588 ++ if (found)
9589 + call_rcu(&addr->rcu, sctp_local_addr_free);
9590 + break;
9591 + }
9592 +diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
9593 +index d50f610..022adbd 100644
9594 +--- a/net/sctp/protocol.c
9595 ++++ b/net/sctp/protocol.c
9596 +@@ -626,6 +626,7 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
9597 + struct in_ifaddr *ifa = (struct in_ifaddr *)ptr;
9598 + struct sctp_sockaddr_entry *addr = NULL;
9599 + struct sctp_sockaddr_entry *temp;
9600 ++ int found = 0;
9601 +
9602 + switch (ev) {
9603 + case NETDEV_UP:
9604 +@@ -645,13 +646,14 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
9605 + list_for_each_entry_safe(addr, temp,
9606 + &sctp_local_addr_list, list) {
9607 + if (addr->a.v4.sin_addr.s_addr == ifa->ifa_local) {
9608 ++ found = 1;
9609 + addr->valid = 0;
9610 + list_del_rcu(&addr->list);
9611 + break;
9612 + }
9613 + }
9614 + spin_unlock_bh(&sctp_local_addr_lock);
9615 +- if (addr && !addr->valid)
9616 ++ if (found)
9617 + call_rcu(&addr->rcu, sctp_local_addr_free);
9618 + break;
9619 + }
9620 +diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
9621 +index d988f5d..f6b332c 100644
9622 +--- a/scripts/Makefile.modpost
9623 ++++ b/scripts/Makefile.modpost
9624 +@@ -53,6 +53,9 @@ modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))
9625 + # Stop after building .o files if NOFINAL is set. Makes compile tests quicker
9626 + _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))
9627 +
9628 ++ifneq ($(KBUILD_BUILDHOST),$(ARCH))
9629 ++ cross_build := 1
9630 ++endif
9631 +
9632 + # Step 2), invoke modpost
9633 + # Includes step 3,4
9634 +@@ -62,7 +65,8 @@ modpost = scripts/mod/modpost \
9635 + $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
9636 + $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
9637 + $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
9638 +- $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
9639 ++ $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \
9640 ++ $(if $(cross_build),-c)
9641 +
9642 + quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
9643 + cmd_modpost = $(modpost) -s
9644 +diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
9645 +index 9ddf944..348d868 100644
9646 +--- a/scripts/mod/file2alias.c
9647 ++++ b/scripts/mod/file2alias.c
9648 +@@ -51,11 +51,13 @@ do { \
9649 + sprintf(str + strlen(str), "*"); \
9650 + } while(0)
9651 +
9652 ++unsigned int cross_build = 0;
9653 + /**
9654 + * Check that sizeof(device_id type) are consistent with size of section
9655 + * in .o file. If in-consistent then userspace and kernel does not agree
9656 + * on actual size which is a bug.
9657 + * Also verify that the final entry in the table is all zeros.
9658 ++ * Ignore both checks if build host differ from target host and size differs.
9659 + **/
9660 + static void device_id_check(const char *modname, const char *device_id,
9661 + unsigned long size, unsigned long id_size,
9662 +@@ -64,6 +66,8 @@ static void device_id_check(const char *modname, const char *device_id,
9663 + int i;
9664 +
9665 + if (size % id_size || size < id_size) {
9666 ++ if (cross_build != 0)
9667 ++ return;
9668 + fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
9669 + "of the size of section __mod_%s_device_table=%lu.\n"
9670 + "Fix definition of struct %s_device_id "
9671 +diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
9672 +index 93ac52a..a990011 100644
9673 +--- a/scripts/mod/modpost.c
9674 ++++ b/scripts/mod/modpost.c
9675 +@@ -1659,7 +1659,7 @@ int main(int argc, char **argv)
9676 + int opt;
9677 + int err;
9678 +
9679 +- while ((opt = getopt(argc, argv, "i:I:mso:aw")) != -1) {
9680 ++ while ((opt = getopt(argc, argv, "i:I:cmso:aw")) != -1) {
9681 + switch(opt) {
9682 + case 'i':
9683 + kernel_read = optarg;
9684 +@@ -1668,6 +1668,9 @@ int main(int argc, char **argv)
9685 + module_read = optarg;
9686 + external_module = 1;
9687 + break;
9688 ++ case 'c':
9689 ++ cross_build = 1;
9690 ++ break;
9691 + case 'm':
9692 + modversions = 1;
9693 + break;
9694 +diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h
9695 +index 0ffed17..b50e3c9 100644
9696 +--- a/scripts/mod/modpost.h
9697 ++++ b/scripts/mod/modpost.h
9698 +@@ -130,6 +130,7 @@ struct elf_info {
9699 + };
9700 +
9701 + /* file2alias.c */
9702 ++extern unsigned int cross_build;
9703 + void handle_moddevtable(struct module *mod, struct elf_info *info,
9704 + Elf_Sym *sym, const char *symname);
9705 + void add_moddevtable(struct buffer *buf, struct module *mod);
9706 +diff --git a/security/capability.c b/security/capability.c
9707 +index 9e99f36..2c6e06d 100644
9708 +--- a/security/capability.c
9709 ++++ b/security/capability.c
9710 +@@ -40,7 +40,6 @@ static struct security_operations capability_ops = {
9711 + .inode_need_killpriv = cap_inode_need_killpriv,
9712 + .inode_killpriv = cap_inode_killpriv,
9713 +
9714 +- .task_kill = cap_task_kill,
9715 + .task_setscheduler = cap_task_setscheduler,
9716 + .task_setioprio = cap_task_setioprio,
9717 + .task_setnice = cap_task_setnice,
9718 +diff --git a/security/commoncap.c b/security/commoncap.c
9719 +index e87422e..6e9065c 100644
9720 +--- a/security/commoncap.c
9721 ++++ b/security/commoncap.c
9722 +@@ -527,40 +527,6 @@ int cap_task_setnice (struct task_struct *p, int nice)
9723 + return cap_safe_nice(p);
9724 + }
9725 +
9726 +-int cap_task_kill(struct task_struct *p, struct siginfo *info,
9727 +- int sig, u32 secid)
9728 +-{
9729 +- if (info != SEND_SIG_NOINFO && (is_si_special(info) || SI_FROMKERNEL(info)))
9730 +- return 0;
9731 +-
9732 +- /*
9733 +- * Running a setuid root program raises your capabilities.
9734 +- * Killing your own setuid root processes was previously
9735 +- * allowed.
9736 +- * We must preserve legacy signal behavior in this case.
9737 +- */
9738 +- if (p->uid == current->uid)
9739 +- return 0;
9740 +-
9741 +- /* sigcont is permitted within same session */
9742 +- if (sig == SIGCONT && (task_session_nr(current) == task_session_nr(p)))
9743 +- return 0;
9744 +-
9745 +- if (secid)
9746 +- /*
9747 +- * Signal sent as a particular user.
9748 +- * Capabilities are ignored. May be wrong, but it's the
9749 +- * only thing we can do at the moment.
9750 +- * Used only by usb drivers?
9751 +- */
9752 +- return 0;
9753 +- if (cap_issubset(p->cap_permitted, current->cap_permitted))
9754 +- return 0;
9755 +- if (capable(CAP_KILL))
9756 +- return 0;
9757 +-
9758 +- return -EPERM;
9759 +-}
9760 + #else
9761 + int cap_task_setscheduler (struct task_struct *p, int policy,
9762 + struct sched_param *lp)
9763 +@@ -575,11 +541,6 @@ int cap_task_setnice (struct task_struct *p, int nice)
9764 + {
9765 + return 0;
9766 + }
9767 +-int cap_task_kill(struct task_struct *p, struct siginfo *info,
9768 +- int sig, u32 secid)
9769 +-{
9770 +- return 0;
9771 +-}
9772 + #endif
9773 +
9774 + void cap_task_reparent_to_init (struct task_struct *p)
9775
9776 Deleted: genpatches-2.6/trunk/2.6.24/1400_prevent-gcc43-optimization-udivdi3.patch
9777 ===================================================================
9778 --- genpatches-2.6/trunk/2.6.24/1400_prevent-gcc43-optimization-udivdi3.patch 2008-04-18 19:34:38 UTC (rev 1295)
9779 +++ genpatches-2.6/trunk/2.6.24/1400_prevent-gcc43-optimization-udivdi3.patch 2008-04-19 09:58:26 UTC (rev 1296)
9780 @@ -1,33 +0,0 @@
9781 -From 38332cb98772f5ea757e6486bed7ed0381cb5f98 Mon Sep 17 00:00:00 2001
9782 -From: Segher Boessenkool <segher@×××××××××××××××.org>
9783 -Date: Tue, 4 Mar 2008 14:59:54 -0800
9784 -Message-ID: <2d0a357f0803241147o351f9434y696cb33841ffe834@××××××××××.com>
9785 -Subject: time: prevent the loop in timespec_add_ns() from being optimised away
9786 -
9787 -Since some architectures don't support __udivdi3().
9788 -
9789 -Signed-off-by: Segher Boessenkool <segher@×××××××××××××××.org>
9790 -Cc: john stultz <johnstul@××××××.com>
9791 -Cc: Ingo Molnar <mingo@××××.hu>
9792 -Signed-off-by: Andrew Morton <akpm@××××××××××××××××.org>
9793 -Signed-off-by: Thomas Gleixner <tglx@××××××××××.de>
9794 -Cc: Sedat Dilek <sedat.dilek@××××××××××.com>
9795 -Signed-off-by: Chris Wright <chrisw@××××××××.org>
9796 ----
9797 - include/linux/time.h | 4 ++++
9798 - 1 file changed, 4 insertions(+)
9799 -
9800 ---- a/include/linux/time.h
9801 -+++ b/include/linux/time.h
9802 -@@ -173,6 +173,10 @@ static inline void timespec_add_ns(struc
9803 - {
9804 - ns += a->tv_nsec;
9805 - while(unlikely(ns >= NSEC_PER_SEC)) {
9806 -+ /* The following asm() prevents the compiler from
9807 -+ * optimising this loop into a modulo operation. */
9808 -+ asm("" : "+r"(ns));
9809 -+
9810 - ns -= NSEC_PER_SEC;
9811 - a->tv_sec++;
9812 - }
9813 -
9814
9815 Deleted: genpatches-2.6/trunk/2.6.24/1700-futex_cmpxchg_inatomic_impl_check.patch
9816 ===================================================================
9817 --- genpatches-2.6/trunk/2.6.24/1700-futex_cmpxchg_inatomic_impl_check.patch 2008-04-18 19:34:38 UTC (rev 1295)
9818 +++ genpatches-2.6/trunk/2.6.24/1700-futex_cmpxchg_inatomic_impl_check.patch 2008-04-19 09:58:26 UTC (rev 1296)
9819 @@ -1,29 +0,0 @@
9820 -c20a84c91048c76c1379011c96b1a5cee5c7d9a0
9821 - include/asm-parisc/futex.h | 10 ++++++++--
9822 - 1 files changed, 8 insertions(+), 2 deletions(-)
9823 -
9824 -diff --git a/include/asm-parisc/futex.h b/include/asm-parisc/futex.h
9825 -index dbee6e6..fdc6d05 100644
9826 ---- a/include/asm-parisc/futex.h
9827 -+++ b/include/asm-parisc/futex.h
9828 -@@ -56,6 +56,12 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
9829 - int err = 0;
9830 - int uval;
9831 -
9832 -+ /* futex.c wants to do a cmpxchg_inatomic on kernel NULL, which is
9833 -+ * our gateway page, and causes no end of trouble...
9834 -+ */
9835 -+ if (segment_eq(KERNEL_DS, get_fs()) && !uaddr)
9836 -+ return -EFAULT;
9837 -+
9838 - if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
9839 - return -EFAULT;
9840 -
9841 -@@ -67,5 +73,5 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
9842 - return uval;
9843 - }
9844 -
9845 --#endif
9846 --#endif
9847 -+#endif /*__KERNEL__*/
9848 -+#endif /*_ASM_PARISC_FUTEX_H*/
9849
9850 Deleted: genpatches-2.6/trunk/2.6.24/2103_ata-assume-no-device-attached.patch
9851 ===================================================================
9852 --- genpatches-2.6/trunk/2.6.24/2103_ata-assume-no-device-attached.patch 2008-04-18 19:34:38 UTC (rev 1295)
9853 +++ genpatches-2.6/trunk/2.6.24/2103_ata-assume-no-device-attached.patch 2008-04-19 09:58:26 UTC (rev 1296)
9854 @@ -1,83 +0,0 @@
9855 -From: Tejun Heo <htejun@×××××.com>
9856 -Date: Sun, 23 Mar 2008 06:16:53 +0000 (+0900)
9857 -Subject: libata: assume no device is attached if both IDENTIFYs are aborted
9858 -X-Git-Tag: v2.6.25-rc7~10^2~3
9859 -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=1ffc151fcddf524d0c76709d7e7a2af0255acb6b
9860 -
9861 -libata: assume no device is attached if both IDENTIFYs are aborted
9862 -
9863 -This is to fix bugzilla #10254. QSI cdrom attached to pata_sis as
9864 -secondary master appears as phantom device for the slave.
9865 -Interestingly, instead of not setting DRQ after IDENTIFY which
9866 -triggers NODEV_HINT, it aborts both IDENTIFY and IDENTIFY PACKET which
9867 -makes EH retry.
9868 -
9869 -Modify EH such that it assumes no device is attached if both flavors
9870 -of IDENTIFY are aborted by the device. There really isn't much point
9871 -in retrying when the device actively aborts the commands.
9872 -
9873 -While at it, convert NODEV detection message to ata_dev_printk() to
9874 -help debugging obscure detection problems.
9875 -
9876 -This problem was reported by Jan Bücken.
9877 -
9878 -Signed-off-by: Tejun Heo <htejun@×××××.com>
9879 -Cc: Jan Bücken <jb.faq@×××.de>
9880 -Acked-by: Alan Cox <alan@××××××.com>
9881 -Signed-off-by: Jeff Garzik <jeff@××××××.org>
9882 ----
9883 -
9884 -diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
9885 -index 4bbe31f..c9c5280 100644
9886 ---- a/drivers/ata/libata-core.c
9887 -+++ b/drivers/ata/libata-core.c
9888 -@@ -2092,24 +2092,34 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
9889 - id, sizeof(id[0]) * ATA_ID_WORDS, 0);
9890 - if (err_mask) {
9891 - if (err_mask & AC_ERR_NODEV_HINT) {
9892 -- DPRINTK("ata%u.%d: NODEV after polling detection\n",
9893 -- ap->print_id, dev->devno);
9894 -+ ata_dev_printk(dev, KERN_DEBUG,
9895 -+ "NODEV after polling detection\n");
9896 - return -ENOENT;
9897 - }
9898 -
9899 -- /* Device or controller might have reported the wrong
9900 -- * device class. Give a shot at the other IDENTIFY if
9901 -- * the current one is aborted by the device.
9902 -- */
9903 -- if (may_fallback &&
9904 -- (err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) {
9905 -- may_fallback = 0;
9906 -+ if ((err_mask == AC_ERR_DEV) && (tf.feature & ATA_ABORTED)) {
9907 -+ /* Device or controller might have reported
9908 -+ * the wrong device class. Give a shot at the
9909 -+ * other IDENTIFY if the current one is
9910 -+ * aborted by the device.
9911 -+ */
9912 -+ if (may_fallback) {
9913 -+ may_fallback = 0;
9914 -
9915 -- if (class == ATA_DEV_ATA)
9916 -- class = ATA_DEV_ATAPI;
9917 -- else
9918 -- class = ATA_DEV_ATA;
9919 -- goto retry;
9920 -+ if (class == ATA_DEV_ATA)
9921 -+ class = ATA_DEV_ATAPI;
9922 -+ else
9923 -+ class = ATA_DEV_ATA;
9924 -+ goto retry;
9925 -+ }
9926 -+
9927 -+ /* Control reaches here iff the device aborted
9928 -+ * both flavors of IDENTIFYs which happens
9929 -+ * sometimes with phantom devices.
9930 -+ */
9931 -+ ata_dev_printk(dev, KERN_DEBUG,
9932 -+ "both IDENTIFYs aborted, assuming NODEV\n");
9933 -+ return -ENOENT;
9934 - }
9935 -
9936 - rc = -EIO;
9937 -
9938
9939 Deleted: genpatches-2.6/trunk/2.6.24/2200_ppc32-apm-export-fix.patch
9940 ===================================================================
9941 --- genpatches-2.6/trunk/2.6.24/2200_ppc32-apm-export-fix.patch 2008-04-18 19:34:38 UTC (rev 1295)
9942 +++ genpatches-2.6/trunk/2.6.24/2200_ppc32-apm-export-fix.patch 2008-04-19 09:58:26 UTC (rev 1296)
9943 @@ -1,11 +0,0 @@
9944 ---- a/drivers/macintosh/via-pmu.c.orig 2008-04-14 10:45:01.000000000 -0400
9945 -+++ a/drivers/macintosh/via-pmu.c 2008-04-14 10:49:39.000000000 -0400
9946 -@@ -2842,7 +2842,7 @@ EXPORT_SYMBOL(pmu_wait_complete);
9947 - EXPORT_SYMBOL(pmu_suspend);
9948 - EXPORT_SYMBOL(pmu_resume);
9949 - EXPORT_SYMBOL(pmu_unlock);
9950 --#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
9951 -+#if defined(CONFIG_PPC32)
9952 - EXPORT_SYMBOL(pmu_enable_irled);
9953 - EXPORT_SYMBOL(pmu_battery_count);
9954 - EXPORT_SYMBOL(pmu_batteries);
9955
9956 Deleted: genpatches-2.6/trunk/2.6.24/2305_bluetooth-suspend-oops.patch
9957 ===================================================================
9958 --- genpatches-2.6/trunk/2.6.24/2305_bluetooth-suspend-oops.patch 2008-04-18 19:34:38 UTC (rev 1295)
9959 +++ genpatches-2.6/trunk/2.6.24/2305_bluetooth-suspend-oops.patch 2008-04-19 09:58:26 UTC (rev 1296)
9960 @@ -1,108 +0,0 @@
9961 -From: Dave Young <hidave.darkstar@×××××.com>
9962 -Date: Thu, 6 Mar 2008 02:45:59 +0000 (-0800)
9963 -Subject: bluetooth: hci_core: defer hci_unregister_sysfs()
9964 -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fdavem%2Fnet-2.6.git;a=commitdiff_plain;h=147e2d59833e994cc99341806a88b9e59be41391
9965 -
9966 -bluetooth: hci_core: defer hci_unregister_sysfs()
9967 -
9968 -Alon Bar-Lev reports:
9969 -
9970 - Feb 16 23:41:33 alon1 usb 3-1: configuration #1 chosen from 1 choice
9971 -Feb 16 23:41:33 alon1 BUG: unable to handle kernel NULL pointer
9972 -dereference at virtual address 00000008
9973 -Feb 16 23:41:33 alon1 printing eip: c01b2db6 *pde = 00000000
9974 -Feb 16 23:41:33 alon1 Oops: 0000 [#1] PREEMPT
9975 -Feb 16 23:41:33 alon1 Modules linked in: ppp_deflate zlib_deflate
9976 -zlib_inflate bsd_comp ppp_async rfcomm l2cap hci_usb vmnet(P)
9977 -vmmon(P) tun radeon drm autofs4 ipv6 aes_generic crypto_algapi
9978 -ieee80211_crypt_ccmp nf_nat_irc nf_nat_ftp nf_conntrack_irc
9979 -nf_conntrack_ftp ipt_MASQUERADE iptable_nat nf_nat ipt_REJECT
9980 -xt_tcpudp ipt_LOG xt_limit xt_state nf_conntrack_ipv4 nf_conntrack
9981 -iptable_filter ip_tables x_tables snd_pcm_oss snd_mixer_oss
9982 -snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device
9983 -bluetooth ppp_generic slhc ioatdma dca cfq_iosched cpufreq_powersave
9984 -cpufreq_ondemand cpufreq_conservative acpi_cpufreq freq_table uinput
9985 -fan af_packet nls_cp1255 nls_iso8859_1 nls_utf8 nls_base pcmcia
9986 -snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm nsc_ircc snd_timer
9987 -ipw2200 thinkpad_acpi irda snd ehci_hcd yenta_socket uhci_hcd
9988 -psmouse ieee80211 soundcore intel_agp hwmon rsrc_nonstatic pcspkr
9989 -e1000 crc_ccitt snd_page_alloc i2c_i801 ieee80211_crypt pcmcia_core
9990 -agpgart thermal bat!
9991 -tery nvram rtc sr_mod ac sg firmware_class button processor cdrom
9992 -unix usbcore evdev ext3 jbd ext2 mbcache loop ata_piix libata sd_mod
9993 -scsi_mod
9994 -Feb 16 23:41:33 alon1
9995 -Feb 16 23:41:33 alon1 Pid: 4, comm: events/0 Tainted: P
9996 -(2.6.24-gentoo-r2 #1)
9997 -Feb 16 23:41:33 alon1 EIP: 0060:[<c01b2db6>] EFLAGS: 00010282 CPU: 0
9998 -Feb 16 23:41:33 alon1 EIP is at sysfs_get_dentry+0x26/0x80
9999 -Feb 16 23:41:33 alon1 EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX:
10000 -f48a2210
10001 -Feb 16 23:41:33 alon1 ESI: f72eb900 EDI: f4803ae0 EBP: f4803ae0 ESP:
10002 -f7c49efc
10003 -Feb 16 23:41:33 alon1 hcid[7004]: HCI dev 0 registered
10004 -Feb 16 23:41:33 alon1 DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
10005 -Feb 16 23:41:33 alon1 Process events/0 (pid: 4, ti=f7c48000
10006 -task=f7c3efc0 task.ti=f7c48000)
10007 -Feb 16 23:41:33 alon1 Stack: f7cb6140 f4822668 f7e71e10 c01b304d
10008 -ffffffff ffffffff fffffffe c030ba9c
10009 -Feb 16 23:41:33 alon1 f7cb6140 f4822668 f6da6720 f7cb6140 f4822668
10010 -f6da6720 c030ba8e c01ce20b
10011 -Feb 16 23:41:33 alon1 f6e9dd00 c030ba8e f6da6720 f6e9dd00 f6e9dd00
10012 -00000000 f4822600 00000000
10013 -Feb 16 23:41:33 alon1 Call Trace:
10014 -Feb 16 23:41:33 alon1 [<c01b304d>] sysfs_move_dir+0x3d/0x1f0
10015 -Feb 16 23:41:33 alon1 [<c01ce20b>] kobject_move+0x9b/0x120
10016 -Feb 16 23:41:33 alon1 [<c0241711>] device_move+0x51/0x110
10017 -Feb 16 23:41:33 alon1 [<f9aaed80>] del_conn+0x0/0x70 [bluetooth]
10018 -Feb 16 23:41:33 alon1 [<f9aaed99>] del_conn+0x19/0x70 [bluetooth]
10019 -Feb 16 23:41:33 alon1 [<c012c1a1>] run_workqueue+0x81/0x140
10020 -Feb 16 23:41:33 alon1 [<c02c0c88>] schedule+0x168/0x2e0
10021 -Feb 16 23:41:33 alon1 [<c012fc70>] autoremove_wake_function+0x0/0x50
10022 -Feb 16 23:41:33 alon1 [<c012c9cb>] worker_thread+0x9b/0xf0
10023 -Feb 16 23:41:33 alon1 [<c012fc70>] autoremove_wake_function+0x0/0x50
10024 -Feb 16 23:41:33 alon1 [<c012c930>] worker_thread+0x0/0xf0
10025 -Feb 16 23:41:33 alon1 [<c012f962>] kthread+0x42/0x70
10026 -Feb 16 23:41:33 alon1 [<c012f920>] kthread+0x0/0x70
10027 -Feb 16 23:41:33 alon1 [<c0104c2f>] kernel_thread_helper+0x7/0x18
10028 -Feb 16 23:41:33 alon1 =======================
10029 -Feb 16 23:41:33 alon1 Code: 26 00 00 00 00 57 89 c7 a1 50 1b 3a c0
10030 -56 53 8b 70 38 85 f6 74 08 8b 0e 85 c9 74 58 ff 06 8b 56 50 39 fa 74
10031 -47 89 fb eb 02 89 c3 <8b> 43 08 39 c2 75 f7 8b 46 08 83 c0 68 e8 98
10032 -e7 10 00 8b 43 10
10033 -Feb 16 23:41:33 alon1 EIP: [<c01b2db6>] sysfs_get_dentry+0x26/0x80
10034 -SS:ESP 0068:f7c49efc
10035 -Feb 16 23:41:33 alon1 ---[ end trace aae864e9592acc1d ]---
10036 -
10037 -Defer hci_unregister_sysfs because hci device could be destructed
10038 -while hci conn devices still there.
10039 -
10040 -Signed-off-by: Dave Young <hidave.darkstar@×××××.com>
10041 -Tested-by: Stefan Seyfried <seife@××××.de>
10042 -Acked-by: Alon Bar-Lev <alon.barlev@×××××.com>
10043 -Signed-off-by: Andrew Morton <akpm@××××××××××××××××.org>
10044 -Acked-by: Marcel Holtmann <marcel@××××××××.org>
10045 ----
10046 -
10047 -diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
10048 -index 930b58e..aec6929 100644
10049 ---- a/net/bluetooth/hci_core.c
10050 -+++ b/net/bluetooth/hci_core.c
10051 -@@ -902,8 +902,6 @@ int hci_unregister_dev(struct hci_dev *hdev)
10052 -
10053 - BT_DBG("%p name %s type %d", hdev, hdev->name, hdev->type);
10054 -
10055 -- hci_unregister_sysfs(hdev);
10056 --
10057 - write_lock_bh(&hci_dev_list_lock);
10058 - list_del(&hdev->list);
10059 - write_unlock_bh(&hci_dev_list_lock);
10060 -@@ -915,6 +913,8 @@ int hci_unregister_dev(struct hci_dev *hdev)
10061 -
10062 - hci_notify(hdev, HCI_DEV_UNREG);
10063 -
10064 -+ hci_unregister_sysfs(hdev);
10065 -+
10066 - __hci_dev_put(hdev);
10067 -
10068 - return 0;
10069
10070 Deleted: genpatches-2.6/trunk/2.6.24/2405_sis190-eeprom-mac.patch
10071 ===================================================================
10072 --- genpatches-2.6/trunk/2.6.24/2405_sis190-eeprom-mac.patch 2008-04-18 19:34:38 UTC (rev 1295)
10073 +++ genpatches-2.6/trunk/2.6.24/2405_sis190-eeprom-mac.patch 2008-04-19 09:58:26 UTC (rev 1296)
10074 @@ -1,45 +0,0 @@
10075 -From: Francois Romieu <romieu@×××××××××.com>
10076 -Date: Mon, 18 Feb 2008 20:20:32 +0000 (+0100)
10077 -Subject: sis190: read the mac address from the eeprom first
10078 -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fjgarzik%2Fnetdev-2.6.git;a=commitdiff_plain;h=563e0ae06ff18f0b280f11cf706ba0172255ce52
10079 -
10080 -sis190: read the mac address from the eeprom first
10081 -
10082 -Reading a serie of zero from the cmos sram area do not work
10083 -well with is_valid_ether_addr(). Let's read the mac address
10084 -from the eeprom first as it seems more reliable.
10085 -
10086 -Fix for http://bugzilla.kernel.org/show_bug.cgi?id=9831
10087 -
10088 -Signed-off-by: Francois Romieu <romieu@×××××××××.com>
10089 -Signed-off-by: Jeff Garzik <jeff@××××××.org>
10090 ----
10091 -
10092 -diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
10093 -index 202fdf3..20745fd 100644
10094 ---- a/drivers/net/sis190.c
10095 -+++ b/drivers/net/sis190.c
10096 -@@ -1633,13 +1633,18 @@ static inline void sis190_init_rxfilter(struct net_device *dev)
10097 - static int __devinit sis190_get_mac_addr(struct pci_dev *pdev,
10098 - struct net_device *dev)
10099 - {
10100 -- u8 from;
10101 -+ int rc;
10102 -+
10103 -+ rc = sis190_get_mac_addr_from_eeprom(pdev, dev);
10104 -+ if (rc < 0) {
10105 -+ u8 reg;
10106 -
10107 -- pci_read_config_byte(pdev, 0x73, &from);
10108 -+ pci_read_config_byte(pdev, 0x73, &reg);
10109 -
10110 -- return (from & 0x00000001) ?
10111 -- sis190_get_mac_addr_from_apc(pdev, dev) :
10112 -- sis190_get_mac_addr_from_eeprom(pdev, dev);
10113 -+ if (reg & 0x00000001)
10114 -+ rc = sis190_get_mac_addr_from_apc(pdev, dev);
10115 -+ }
10116 -+ return rc;
10117 - }
10118 -
10119 - static void sis190_set_speed_auto(struct net_device *dev)
10120
10121 Deleted: genpatches-2.6/trunk/2.6.24/2505_usb-storage-motorola-rokr.patch
10122 ===================================================================
10123 --- genpatches-2.6/trunk/2.6.24/2505_usb-storage-motorola-rokr.patch 2008-04-18 19:34:38 UTC (rev 1295)
10124 +++ genpatches-2.6/trunk/2.6.24/2505_usb-storage-motorola-rokr.patch 2008-04-19 09:58:26 UTC (rev 1296)
10125 @@ -1,78 +0,0 @@
10126 -[PATCH fixed] usb: add support for Motorola ROKR Z6 cellphone in mass storage mode
10127 -
10128 -From: Constantin Baranov <const@×××××.ru>
10129 -
10130 -Motorola ROKR Z6 cellphone has bugs in its USB, so it is impossible to use
10131 -it as mass storage. Patch describes new "unusual" USB device for it with
10132 -FIX_INQUIRY and FIX_CAPACITY flags and new BULK_IGNORE_TAG flag.
10133 -Last flag relaxes check for equality of bcs->Tag and us->tag in
10134 -usb_stor_Bulk_transport routine.
10135 -
10136 -Signed-off-by: Constantin Baranov <const@×××××.ru>
10137 -Signed-off-by: Matthew Dharm <mdharm-usb@××××××××××××××.net>
10138 -Signed-off-by: Daniel Drake <dsd@g.o>
10139 ----
10140 -
10141 -This patch was previously submitted by Constantin but it was line wrapped
10142 -and hence does not apply. Here's a fixed version (no changes to the actual
10143 -patch itself)
10144 -
10145 - drivers/usb/storage/transport.c | 3 ++-
10146 - drivers/usb/storage/unusual_devs.h | 11 +++++++++++
10147 - include/linux/usb_usual.h | 4 +++-
10148 - 3 files changed, 16 insertions(+), 2 deletions(-)
10149 -
10150 -diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
10151 -index 5780ed1..bdd4334 100644
10152 ---- a/drivers/usb/storage/transport.c
10153 -+++ b/drivers/usb/storage/transport.c
10154 -@@ -1009,7 +1009,8 @@ int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us)
10155 - US_DEBUGP("Bulk Status S 0x%x T 0x%x R %u Stat 0x%x\n",
10156 - le32_to_cpu(bcs->Signature), bcs->Tag,
10157 - residue, bcs->Status);
10158 -- if (bcs->Tag != us->tag || bcs->Status > US_BULK_STAT_PHASE) {
10159 -+ if (!(bcs->Tag == us->tag || (us->flags & US_FL_BULK_IGNORE_TAG)) ||
10160 -+ bcs->Status > US_BULK_STAT_PHASE) {
10161 - US_DEBUGP("Bulk logical error\n");
10162 - return USB_STOR_TRANSPORT_ERROR;
10163 - }
10164 -diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
10165 -index 99679a8..e5219a5 100644
10166 ---- a/drivers/usb/storage/unusual_devs.h
10167 -+++ b/drivers/usb/storage/unusual_devs.h
10168 -@@ -1589,6 +1589,17 @@ UNUSUAL_DEV( 0x22b8, 0x4810, 0x0001, 0x0001,
10169 - US_SC_DEVICE, US_PR_DEVICE, NULL,
10170 - US_FL_FIX_CAPACITY),
10171 -
10172 -+/*
10173 -+ * Patch by Constantin Baranov <const@×××××.ru>
10174 -+ * Report by Andreas Koenecke.
10175 -+ * Motorola ROKR Z6.
10176 -+ */
10177 -+UNUSUAL_DEV( 0x22b8, 0x6426, 0x0101, 0x0101,
10178 -+ "Motorola",
10179 -+ "MSnc.",
10180 -+ US_SC_DEVICE, US_PR_DEVICE, NULL,
10181 -+ US_FL_FIX_INQUIRY | US_FL_FIX_CAPACITY | US_FL_BULK_IGNORE_TAG),
10182 -+
10183 - /* Reported by Radovan Garabik <garabik@×××××××××××××××××××××.sk> */
10184 - UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999,
10185 - "MPIO",
10186 -diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
10187 -index cee0623..0a40dfa 100644
10188 ---- a/include/linux/usb_usual.h
10189 -+++ b/include/linux/usb_usual.h
10190 -@@ -50,7 +50,9 @@
10191 - US_FLAG(CAPACITY_HEURISTICS, 0x00001000) \
10192 - /* sometimes sizes is too big */ \
10193 - US_FLAG(MAX_SECTORS_MIN,0x00002000) \
10194 -- /* Sets max_sectors to arch min */
10195 -+ /* Sets max_sectors to arch min */ \
10196 -+ US_FLAG(BULK_IGNORE_TAG,0x00004000) \
10197 -+ /* Ignore tag mismatch in bulk operations */
10198 -
10199 -
10200 - #define US_FLAG(name, value) US_FL_##name = value ,
10201 ---
10202 -1.5.4.3
10203 -
10204
10205 --
10206 gentoo-commits@l.g.o mailing list