Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1273 - genpatches-2.6/trunk/2.6.24
Date: Tue, 25 Mar 2008 00:00:11
Message-Id: E1Jdwa9-0006O8-Az@stork.gentoo.org
1 Author: mpagano
2 Date: 2008-03-25 00:00:00 +0000 (Tue, 25 Mar 2008)
3 New Revision: 1273
4
5 Added:
6 genpatches-2.6/trunk/2.6.24/1003-linux-2.6.24.4.patch
7 Removed:
8 genpatches-2.6/trunk/2.6.24/1700_moduleparam.patch
9 genpatches-2.6/trunk/2.6.24/1705_x86-clear-df.patch
10 genpatches-2.6/trunk/2.6.24/2000_no-if-addrlabel.patch
11 genpatches-2.6/trunk/2.6.24/2300_pci-use-conf1.patch
12 genpatches-2.6/trunk/2.6.24/2400_e1000e-crc-stripping.patch
13 genpatches-2.6/trunk/2.6.24/2500_arcmsr-dma-coherent-warnings.patch
14 Modified:
15 genpatches-2.6/trunk/2.6.24/0000_README
16 Log:
17 Added 2.6.24.4 patch and removed patches that are included in this version bump.
18
19 Modified: genpatches-2.6/trunk/2.6.24/0000_README
20 ===================================================================
21 --- genpatches-2.6/trunk/2.6.24/0000_README 2008-03-22 18:40:03 UTC (rev 1272)
22 +++ genpatches-2.6/trunk/2.6.24/0000_README 2008-03-25 00:00:00 UTC (rev 1273)
23 @@ -47,22 +47,14 @@
24 From: http://www.kernel.org
25 Desc: Linux 2.6.24.2
26
27 -Patch: 1002_linux-2.6.24.2.patch
28 +Patch: 1002_linux-2.6.24.3.patch
29 From: http://www.kernel.org
30 Desc: Linux 2.6.24.3
31
32 -Patch: 1700_moduleparam.patch
33 -From: http://bugs.gentoo.org/187175
34 -Desc: Fix GCC 4.2 compile failure on alpha/ia64/ppc64
35 +Patch: 1002_linux-2.6.24.4.patch
36 +From: http://www.kernel.org
37 +Desc: Linux 2.6.24.4
38
39 -Patch: 1705_x86-clear-df.patch
40 -From: http://bugs.gentoo.org/213811
41 -Desc: Fix clearing of direction flag in signal handlers
42 -
43 -Patch: 2000_no-if-addrlabel.patch
44 -From: Linux kernel mailing list
45 -Desc: Remove bogus unifdef entry added in 2.6.24.3
46 -
47 Patch: 2100_sd-sr-medium-detection.patch
48 From: http://bugs.gentoo.org/196879
49 Desc: Add early medium-not-present detection in sr/sd drivers
50 @@ -75,26 +67,14 @@
51 From: http://bugs.gentoo.org/196879
52 Desc: Fix TEST_UNIT_READY for medium detection
53
54 -Patch: 2300_pci-use-conf1.patch
55 -From: http://bugs.gentoo.org/198810
56 -Desc: Fix boot hang on Intel Q35 chipset
57 -
58 Patch: 2305_bluetooth-suspend-oops.patch
59 From: http://bugs.gentoo.org/211179
60 Desc: Fix bluetooth rfcomm crash on suspend
61
62 -Patch: 2400_e1000e-crc-stripping.patch
63 -From: http://bugs.gentoo.org/209235
64 -Desc: Fix e1000e bridging issue
65 -
66 Patch: 2405_sis190-eeprom-mac.patch
67 From: http://bugs.gentoo.org/207706
68 Desc: Fix reading of MAC address in sis190 driver
69
70 -Patch: 2500_arcmsr-dma-coherent-warnings.patch
71 -From: http://bugs.gentoo.org/208493
72 -Desc: Fix warning flood when arcmsr is ran with archttp
73 -
74 Patch: 2505_usb-storage-motorola-rokr.patch
75 From: http://bugs.gentoo.org/212729
76 Desc: Fix usb-storage access to Motorola ROKR phone
77
78 Added: genpatches-2.6/trunk/2.6.24/1003-linux-2.6.24.4.patch
79 ===================================================================
80 --- genpatches-2.6/trunk/2.6.24/1003-linux-2.6.24.4.patch (rev 0)
81 +++ genpatches-2.6/trunk/2.6.24/1003-linux-2.6.24.4.patch 2008-03-25 00:00:00 UTC (rev 1273)
82 @@ -0,0 +1,3643 @@
83 +diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
84 +index 83ef5ec..df5ae27 100644
85 +--- a/arch/arm/mach-pxa/clock.c
86 ++++ b/arch/arm/mach-pxa/clock.c
87 +@@ -23,18 +23,27 @@ static LIST_HEAD(clocks);
88 + static DEFINE_MUTEX(clocks_mutex);
89 + static DEFINE_SPINLOCK(clocks_lock);
90 +
91 ++static struct clk *clk_lookup(struct device *dev, const char *id)
92 ++{
93 ++ struct clk *p;
94 ++
95 ++ list_for_each_entry(p, &clocks, node)
96 ++ if (strcmp(id, p->name) == 0 && p->dev == dev)
97 ++ return p;
98 ++
99 ++ return NULL;
100 ++}
101 ++
102 + struct clk *clk_get(struct device *dev, const char *id)
103 + {
104 + struct clk *p, *clk = ERR_PTR(-ENOENT);
105 +
106 + mutex_lock(&clocks_mutex);
107 +- list_for_each_entry(p, &clocks, node) {
108 +- if (strcmp(id, p->name) == 0 &&
109 +- (p->dev == NULL || p->dev == dev)) {
110 +- clk = p;
111 +- break;
112 +- }
113 +- }
114 ++ p = clk_lookup(dev, id);
115 ++ if (!p)
116 ++ p = clk_lookup(NULL, id);
117 ++ if (p)
118 ++ clk = p;
119 + mutex_unlock(&clocks_mutex);
120 +
121 + return clk;
122 +diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
123 +index 4710135..9158dd8 100644
124 +--- a/arch/mips/kernel/i8259.c
125 ++++ b/arch/mips/kernel/i8259.c
126 +@@ -338,8 +338,10 @@ void __init init_i8259_irqs(void)
127 +
128 + init_8259A(0);
129 +
130 +- for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++)
131 ++ for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++) {
132 + set_irq_chip_and_handler(i, &i8259A_chip, handle_level_irq);
133 ++ set_irq_probe(i);
134 ++ }
135 +
136 + setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2);
137 + }
138 +diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
139 +index d06e9c9..e3309ff 100644
140 +--- a/arch/mips/kernel/irq.c
141 ++++ b/arch/mips/kernel/irq.c
142 +@@ -145,6 +145,11 @@ __setup("nokgdb", nokgdb);
143 +
144 + void __init init_IRQ(void)
145 + {
146 ++ int i;
147 ++
148 ++ for (i = 0; i < NR_IRQS; i++)
149 ++ set_irq_noprobe(i);
150 ++
151 + arch_init_irq();
152 +
153 + #ifdef CONFIG_KGDB
154 +diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
155 +index 7e8efaa..5efdfe9 100644
156 +--- a/arch/s390/lib/uaccess_pt.c
157 ++++ b/arch/s390/lib/uaccess_pt.c
158 +@@ -406,6 +406,8 @@ int futex_atomic_cmpxchg_pt(int __user *uaddr, int oldval, int newval)
159 + {
160 + int ret;
161 +
162 ++ if (!current->mm)
163 ++ return -EFAULT;
164 + spin_lock(&current->mm->page_table_lock);
165 + uaddr = (int __user *) __dat_user_addr((unsigned long) uaddr);
166 + if (!uaddr) {
167 +diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
168 +index e795f28..bf1b15d 100644
169 +--- a/arch/sparc/kernel/Makefile
170 ++++ b/arch/sparc/kernel/Makefile
171 +@@ -1,4 +1,4 @@
172 +-# $Id: Makefile,v 1.62 2000/12/15 00:41:17 davem Exp $
173 ++#
174 + # Makefile for the linux kernel.
175 + #
176 +
177 +@@ -12,7 +12,8 @@ obj-y := entry.o wof.o wuf.o etrap.o rtrap.o traps.o $(IRQ_OBJS) \
178 + sys_sparc.o sunos_asm.o systbls.o \
179 + time.o windows.o cpu.o devices.o sclow.o \
180 + tadpole.o tick14.o ptrace.o sys_solaris.o \
181 +- unaligned.o muldiv.o semaphore.o prom.o of_device.o devres.o
182 ++ unaligned.o una_asm.o muldiv.o semaphore.o \
183 ++ prom.o of_device.o devres.o
184 +
185 + devres-y = ../../../kernel/irq/devres.o
186 +
187 +diff --git a/arch/sparc/kernel/una_asm.S b/arch/sparc/kernel/una_asm.S
188 +new file mode 100644
189 +index 0000000..8cc0345
190 +--- /dev/null
191 ++++ b/arch/sparc/kernel/una_asm.S
192 +@@ -0,0 +1,153 @@
193 ++/* una_asm.S: Kernel unaligned trap assembler helpers.
194 ++ *
195 ++ * Copyright (C) 1996,2005,2008 David S. Miller (davem@×××××××××.net)
196 ++ * Copyright (C) 1996,1997 Jakub Jelinek (jj@××××××××××××××××.cz)
197 ++ */
198 ++
199 ++#include <linux/errno.h>
200 ++
201 ++ .text
202 ++
203 ++retl_efault:
204 ++ retl
205 ++ mov -EFAULT, %o0
206 ++
207 ++ /* int __do_int_store(unsigned long *dst_addr, int size,
208 ++ * unsigned long *src_val)
209 ++ *
210 ++ * %o0 = dest_addr
211 ++ * %o1 = size
212 ++ * %o2 = src_val
213 ++ *
214 ++ * Return '0' on success, -EFAULT on failure.
215 ++ */
216 ++ .globl __do_int_store
217 ++__do_int_store:
218 ++ ld [%o2], %g1
219 ++ cmp %1, 2
220 ++ be 2f
221 ++ cmp %1, 4
222 ++ be 1f
223 ++ srl %g1, 24, %g2
224 ++ srl %g1, 16, %g7
225 ++4: stb %g2, [%o0]
226 ++ srl %g1, 8, %g2
227 ++5: stb %g7, [%o0 + 1]
228 ++ ld [%o2 + 4], %g7
229 ++6: stb %g2, [%o0 + 2]
230 ++ srl %g7, 24, %g2
231 ++7: stb %g1, [%o0 + 3]
232 ++ srl %g7, 16, %g1
233 ++8: stb %g2, [%o0 + 4]
234 ++ srl %g7, 8, %g2
235 ++9: stb %g1, [%o0 + 5]
236 ++10: stb %g2, [%o0 + 6]
237 ++ b 0f
238 ++11: stb %g7, [%o0 + 7]
239 ++1: srl %g1, 16, %g7
240 ++12: stb %g2, [%o0]
241 ++ srl %g1, 8, %g2
242 ++13: stb %g7, [%o0 + 1]
243 ++14: stb %g2, [%o0 + 2]
244 ++ b 0f
245 ++15: stb %g1, [%o0 + 3]
246 ++2: srl %g1, 8, %g2
247 ++16: stb %g2, [%o0]
248 ++17: stb %g1, [%o0 + 1]
249 ++0: retl
250 ++ mov 0, %o0
251 ++
252 ++ .section __ex_table,#alloc
253 ++ .word 4b, retl_efault
254 ++ .word 5b, retl_efault
255 ++ .word 6b, retl_efault
256 ++ .word 7b, retl_efault
257 ++ .word 8b, retl_efault
258 ++ .word 9b, retl_efault
259 ++ .word 10b, retl_efault
260 ++ .word 11b, retl_efault
261 ++ .word 12b, retl_efault
262 ++ .word 13b, retl_efault
263 ++ .word 14b, retl_efault
264 ++ .word 15b, retl_efault
265 ++ .word 16b, retl_efault
266 ++ .word 17b, retl_efault
267 ++ .previous
268 ++
269 ++ /* int do_int_load(unsigned long *dest_reg, int size,
270 ++ * unsigned long *saddr, int is_signed)
271 ++ *
272 ++ * %o0 = dest_reg
273 ++ * %o1 = size
274 ++ * %o2 = saddr
275 ++ * %o3 = is_signed
276 ++ *
277 ++ * Return '0' on success, -EFAULT on failure.
278 ++ */
279 ++ .globl do_int_load
280 ++do_int_load:
281 ++ cmp %o1, 8
282 ++ be 9f
283 ++ cmp %o1, 4
284 ++ be 6f
285 ++4: ldub [%o2], %g1
286 ++5: ldub [%o2 + 1], %g2
287 ++ sll %g1, 8, %g1
288 ++ tst %o3
289 ++ be 3f
290 ++ or %g1, %g2, %g1
291 ++ sll %g1, 16, %g1
292 ++ sra %g1, 16, %g1
293 ++3: b 0f
294 ++ st %g1, [%o0]
295 ++6: ldub [%o2 + 1], %g2
296 ++ sll %g1, 24, %g1
297 ++7: ldub [%o2 + 2], %g7
298 ++ sll %g2, 16, %g2
299 ++8: ldub [%o2 + 3], %g3
300 ++ sll %g7, 8, %g7
301 ++ or %g3, %g2, %g3
302 ++ or %g7, %g3, %g7
303 ++ or %g1, %g7, %g1
304 ++ b 0f
305 ++ st %g1, [%o0]
306 ++9: ldub [%o2], %g1
307 ++10: ldub [%o2 + 1], %g2
308 ++ sll %g1, 24, %g1
309 ++11: ldub [%o2 + 2], %g7
310 ++ sll %g2, 16, %g2
311 ++12: ldub [%o2 + 3], %g3
312 ++ sll %g7, 8, %g7
313 ++ or %g1, %g2, %g1
314 ++ or %g7, %g3, %g7
315 ++ or %g1, %g7, %g7
316 ++13: ldub [%o2 + 4], %g1
317 ++ st %g7, [%o0]
318 ++14: ldub [%o2 + 5], %g2
319 ++ sll %g1, 24, %g1
320 ++15: ldub [%o2 + 6], %g7
321 ++ sll %g2, 16, %g2
322 ++16: ldub [%o2 + 7], %g3
323 ++ sll %g7, 8, %g7
324 ++ or %g1, %g2, %g1
325 ++ or %g7, %g3, %g7
326 ++ or %g1, %g7, %g7
327 ++ st %g7, [%o0 + 4]
328 ++0: retl
329 ++ mov 0, %o0
330 ++
331 ++ .section __ex_table,#alloc
332 ++ .word 4b, retl_efault
333 ++ .word 5b, retl_efault
334 ++ .word 6b, retl_efault
335 ++ .word 7b, retl_efault
336 ++ .word 8b, retl_efault
337 ++ .word 9b, retl_efault
338 ++ .word 10b, retl_efault
339 ++ .word 11b, retl_efault
340 ++ .word 12b, retl_efault
341 ++ .word 13b, retl_efault
342 ++ .word 14b, retl_efault
343 ++ .word 15b, retl_efault
344 ++ .word 16b, retl_efault
345 ++ .previous
346 +diff --git a/arch/sparc/kernel/unaligned.c b/arch/sparc/kernel/unaligned.c
347 +index a6330fb..33857be 100644
348 +--- a/arch/sparc/kernel/unaligned.c
349 ++++ b/arch/sparc/kernel/unaligned.c
350 +@@ -175,157 +175,31 @@ static void unaligned_panic(char *str)
351 + panic(str);
352 + }
353 +
354 +-#define do_integer_load(dest_reg, size, saddr, is_signed, errh) ({ \
355 +-__asm__ __volatile__ ( \
356 +- "cmp %1, 8\n\t" \
357 +- "be 9f\n\t" \
358 +- " cmp %1, 4\n\t" \
359 +- "be 6f\n" \
360 +-"4:\t" " ldub [%2], %%l1\n" \
361 +-"5:\t" "ldub [%2 + 1], %%l2\n\t" \
362 +- "sll %%l1, 8, %%l1\n\t" \
363 +- "tst %3\n\t" \
364 +- "be 3f\n\t" \
365 +- " add %%l1, %%l2, %%l1\n\t" \
366 +- "sll %%l1, 16, %%l1\n\t" \
367 +- "sra %%l1, 16, %%l1\n" \
368 +-"3:\t" "b 0f\n\t" \
369 +- " st %%l1, [%0]\n" \
370 +-"6:\t" "ldub [%2 + 1], %%l2\n\t" \
371 +- "sll %%l1, 24, %%l1\n" \
372 +-"7:\t" "ldub [%2 + 2], %%g7\n\t" \
373 +- "sll %%l2, 16, %%l2\n" \
374 +-"8:\t" "ldub [%2 + 3], %%g1\n\t" \
375 +- "sll %%g7, 8, %%g7\n\t" \
376 +- "or %%l1, %%l2, %%l1\n\t" \
377 +- "or %%g7, %%g1, %%g7\n\t" \
378 +- "or %%l1, %%g7, %%l1\n\t" \
379 +- "b 0f\n\t" \
380 +- " st %%l1, [%0]\n" \
381 +-"9:\t" "ldub [%2], %%l1\n" \
382 +-"10:\t" "ldub [%2 + 1], %%l2\n\t" \
383 +- "sll %%l1, 24, %%l1\n" \
384 +-"11:\t" "ldub [%2 + 2], %%g7\n\t" \
385 +- "sll %%l2, 16, %%l2\n" \
386 +-"12:\t" "ldub [%2 + 3], %%g1\n\t" \
387 +- "sll %%g7, 8, %%g7\n\t" \
388 +- "or %%l1, %%l2, %%l1\n\t" \
389 +- "or %%g7, %%g1, %%g7\n\t" \
390 +- "or %%l1, %%g7, %%g7\n" \
391 +-"13:\t" "ldub [%2 + 4], %%l1\n\t" \
392 +- "st %%g7, [%0]\n" \
393 +-"14:\t" "ldub [%2 + 5], %%l2\n\t" \
394 +- "sll %%l1, 24, %%l1\n" \
395 +-"15:\t" "ldub [%2 + 6], %%g7\n\t" \
396 +- "sll %%l2, 16, %%l2\n" \
397 +-"16:\t" "ldub [%2 + 7], %%g1\n\t" \
398 +- "sll %%g7, 8, %%g7\n\t" \
399 +- "or %%l1, %%l2, %%l1\n\t" \
400 +- "or %%g7, %%g1, %%g7\n\t" \
401 +- "or %%l1, %%g7, %%g7\n\t" \
402 +- "st %%g7, [%0 + 4]\n" \
403 +-"0:\n\n\t" \
404 +- ".section __ex_table,#alloc\n\t" \
405 +- ".word 4b, " #errh "\n\t" \
406 +- ".word 5b, " #errh "\n\t" \
407 +- ".word 6b, " #errh "\n\t" \
408 +- ".word 7b, " #errh "\n\t" \
409 +- ".word 8b, " #errh "\n\t" \
410 +- ".word 9b, " #errh "\n\t" \
411 +- ".word 10b, " #errh "\n\t" \
412 +- ".word 11b, " #errh "\n\t" \
413 +- ".word 12b, " #errh "\n\t" \
414 +- ".word 13b, " #errh "\n\t" \
415 +- ".word 14b, " #errh "\n\t" \
416 +- ".word 15b, " #errh "\n\t" \
417 +- ".word 16b, " #errh "\n\n\t" \
418 +- ".previous\n\t" \
419 +- : : "r" (dest_reg), "r" (size), "r" (saddr), "r" (is_signed) \
420 +- : "l1", "l2", "g7", "g1", "cc"); \
421 +-})
422 +-
423 +-#define store_common(dst_addr, size, src_val, errh) ({ \
424 +-__asm__ __volatile__ ( \
425 +- "ld [%2], %%l1\n" \
426 +- "cmp %1, 2\n\t" \
427 +- "be 2f\n\t" \
428 +- " cmp %1, 4\n\t" \
429 +- "be 1f\n\t" \
430 +- " srl %%l1, 24, %%l2\n\t" \
431 +- "srl %%l1, 16, %%g7\n" \
432 +-"4:\t" "stb %%l2, [%0]\n\t" \
433 +- "srl %%l1, 8, %%l2\n" \
434 +-"5:\t" "stb %%g7, [%0 + 1]\n\t" \
435 +- "ld [%2 + 4], %%g7\n" \
436 +-"6:\t" "stb %%l2, [%0 + 2]\n\t" \
437 +- "srl %%g7, 24, %%l2\n" \
438 +-"7:\t" "stb %%l1, [%0 + 3]\n\t" \
439 +- "srl %%g7, 16, %%l1\n" \
440 +-"8:\t" "stb %%l2, [%0 + 4]\n\t" \
441 +- "srl %%g7, 8, %%l2\n" \
442 +-"9:\t" "stb %%l1, [%0 + 5]\n" \
443 +-"10:\t" "stb %%l2, [%0 + 6]\n\t" \
444 +- "b 0f\n" \
445 +-"11:\t" " stb %%g7, [%0 + 7]\n" \
446 +-"1:\t" "srl %%l1, 16, %%g7\n" \
447 +-"12:\t" "stb %%l2, [%0]\n\t" \
448 +- "srl %%l1, 8, %%l2\n" \
449 +-"13:\t" "stb %%g7, [%0 + 1]\n" \
450 +-"14:\t" "stb %%l2, [%0 + 2]\n\t" \
451 +- "b 0f\n" \
452 +-"15:\t" " stb %%l1, [%0 + 3]\n" \
453 +-"2:\t" "srl %%l1, 8, %%l2\n" \
454 +-"16:\t" "stb %%l2, [%0]\n" \
455 +-"17:\t" "stb %%l1, [%0 + 1]\n" \
456 +-"0:\n\n\t" \
457 +- ".section __ex_table,#alloc\n\t" \
458 +- ".word 4b, " #errh "\n\t" \
459 +- ".word 5b, " #errh "\n\t" \
460 +- ".word 6b, " #errh "\n\t" \
461 +- ".word 7b, " #errh "\n\t" \
462 +- ".word 8b, " #errh "\n\t" \
463 +- ".word 9b, " #errh "\n\t" \
464 +- ".word 10b, " #errh "\n\t" \
465 +- ".word 11b, " #errh "\n\t" \
466 +- ".word 12b, " #errh "\n\t" \
467 +- ".word 13b, " #errh "\n\t" \
468 +- ".word 14b, " #errh "\n\t" \
469 +- ".word 15b, " #errh "\n\t" \
470 +- ".word 16b, " #errh "\n\t" \
471 +- ".word 17b, " #errh "\n\n\t" \
472 +- ".previous\n\t" \
473 +- : : "r" (dst_addr), "r" (size), "r" (src_val) \
474 +- : "l1", "l2", "g7", "g1", "cc"); \
475 +-})
476 +-
477 +-#define do_integer_store(reg_num, size, dst_addr, regs, errh) ({ \
478 +- unsigned long *src_val; \
479 +- static unsigned long zero[2] = { 0, }; \
480 +- \
481 +- if (reg_num) src_val = fetch_reg_addr(reg_num, regs); \
482 +- else { \
483 +- src_val = &zero[0]; \
484 +- if (size == 8) \
485 +- zero[1] = fetch_reg(1, regs); \
486 +- } \
487 +- store_common(dst_addr, size, src_val, errh); \
488 +-})
489 ++/* una_asm.S */
490 ++extern int do_int_load(unsigned long *dest_reg, int size,
491 ++ unsigned long *saddr, int is_signed);
492 ++extern int __do_int_store(unsigned long *dst_addr, int size,
493 ++ unsigned long *src_val);
494 ++
495 ++static int do_int_store(int reg_num, int size, unsigned long *dst_addr,
496 ++ struct pt_regs *regs)
497 ++{
498 ++ unsigned long zero[2] = { 0, 0 };
499 ++ unsigned long *src_val;
500 ++
501 ++ if (reg_num)
502 ++ src_val = fetch_reg_addr(reg_num, regs);
503 ++ else {
504 ++ src_val = &zero[0];
505 ++ if (size == 8)
506 ++ zero[1] = fetch_reg(1, regs);
507 ++ }
508 ++ return __do_int_store(dst_addr, size, src_val);
509 ++}
510 +
511 + extern void smp_capture(void);
512 + extern void smp_release(void);
513 +
514 +-#define do_atomic(srcdest_reg, mem, errh) ({ \
515 +- unsigned long flags, tmp; \
516 +- \
517 +- smp_capture(); \
518 +- local_irq_save(flags); \
519 +- tmp = *srcdest_reg; \
520 +- do_integer_load(srcdest_reg, 4, mem, 0, errh); \
521 +- store_common(mem, 4, &tmp, errh); \
522 +- local_irq_restore(flags); \
523 +- smp_release(); \
524 +-})
525 +-
526 + static inline void advance(struct pt_regs *regs)
527 + {
528 + regs->pc = regs->npc;
529 +@@ -342,9 +216,7 @@ static inline int ok_for_kernel(unsigned int insn)
530 + return !floating_point_load_or_store_p(insn);
531 + }
532 +
533 +-void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("kernel_mna_trap_fault");
534 +-
535 +-void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
536 ++static void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
537 + {
538 + unsigned long g2 = regs->u_regs [UREG_G2];
539 + unsigned long fixup = search_extables_range(regs->pc, &g2);
540 +@@ -379,48 +251,34 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)
541 + printk("Unsupported unaligned load/store trap for kernel at <%08lx>.\n",
542 + regs->pc);
543 + unaligned_panic("Wheee. Kernel does fpu/atomic unaligned load/store.");
544 +-
545 +- __asm__ __volatile__ ("\n"
546 +-"kernel_unaligned_trap_fault:\n\t"
547 +- "mov %0, %%o0\n\t"
548 +- "call kernel_mna_trap_fault\n\t"
549 +- " mov %1, %%o1\n\t"
550 +- :
551 +- : "r" (regs), "r" (insn)
552 +- : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
553 +- "g1", "g2", "g3", "g4", "g5", "g7", "cc");
554 + } else {
555 + unsigned long addr = compute_effective_address(regs, insn);
556 ++ int err;
557 +
558 + #ifdef DEBUG_MNA
559 + printk("KMNA: pc=%08lx [dir=%s addr=%08lx size=%d] retpc[%08lx]\n",
560 + regs->pc, dirstrings[dir], addr, size, regs->u_regs[UREG_RETPC]);
561 + #endif
562 +- switch(dir) {
563 ++ switch (dir) {
564 + case load:
565 +- do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
566 +- size, (unsigned long *) addr,
567 +- decode_signedness(insn),
568 +- kernel_unaligned_trap_fault);
569 ++ err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),
570 ++ regs),
571 ++ size, (unsigned long *) addr,
572 ++ decode_signedness(insn));
573 + break;
574 +
575 + case store:
576 +- do_integer_store(((insn>>25)&0x1f), size,
577 +- (unsigned long *) addr, regs,
578 +- kernel_unaligned_trap_fault);
579 ++ err = do_int_store(((insn>>25)&0x1f), size,
580 ++ (unsigned long *) addr, regs);
581 + break;
582 +-#if 0 /* unsupported */
583 +- case both:
584 +- do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
585 +- (unsigned long *) addr,
586 +- kernel_unaligned_trap_fault);
587 +- break;
588 +-#endif
589 + default:
590 + panic("Impossible kernel unaligned trap.");
591 + /* Not reached... */
592 + }
593 +- advance(regs);
594 ++ if (err)
595 ++ kernel_mna_trap_fault(regs, insn);
596 ++ else
597 ++ advance(regs);
598 + }
599 + }
600 +
601 +@@ -459,9 +317,7 @@ static inline int ok_for_user(struct pt_regs *regs, unsigned int insn,
602 + return 0;
603 + }
604 +
605 +-void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn) __asm__ ("user_mna_trap_fault");
606 +-
607 +-void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
608 ++static void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
609 + {
610 + siginfo_t info;
611 +
612 +@@ -485,7 +341,7 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)
613 + if(!ok_for_user(regs, insn, dir)) {
614 + goto kill_user;
615 + } else {
616 +- int size = decode_access_size(insn);
617 ++ int err, size = decode_access_size(insn);
618 + unsigned long addr;
619 +
620 + if(floating_point_load_or_store_p(insn)) {
621 +@@ -496,48 +352,34 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)
622 + addr = compute_effective_address(regs, insn);
623 + switch(dir) {
624 + case load:
625 +- do_integer_load(fetch_reg_addr(((insn>>25)&0x1f), regs),
626 +- size, (unsigned long *) addr,
627 +- decode_signedness(insn),
628 +- user_unaligned_trap_fault);
629 ++ err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),
630 ++ regs),
631 ++ size, (unsigned long *) addr,
632 ++ decode_signedness(insn));
633 + break;
634 +
635 + case store:
636 +- do_integer_store(((insn>>25)&0x1f), size,
637 +- (unsigned long *) addr, regs,
638 +- user_unaligned_trap_fault);
639 ++ err = do_int_store(((insn>>25)&0x1f), size,
640 ++ (unsigned long *) addr, regs);
641 + break;
642 +
643 + case both:
644 +-#if 0 /* unsupported */
645 +- do_atomic(fetch_reg_addr(((insn>>25)&0x1f), regs),
646 +- (unsigned long *) addr,
647 +- user_unaligned_trap_fault);
648 +-#else
649 + /*
650 + * This was supported in 2.4. However, we question
651 + * the value of SWAP instruction across word boundaries.
652 + */
653 + printk("Unaligned SWAP unsupported.\n");
654 +- goto kill_user;
655 +-#endif
656 ++ err = -EFAULT;
657 + break;
658 +
659 + default:
660 + unaligned_panic("Impossible user unaligned trap.");
661 +-
662 +- __asm__ __volatile__ ("\n"
663 +-"user_unaligned_trap_fault:\n\t"
664 +- "mov %0, %%o0\n\t"
665 +- "call user_mna_trap_fault\n\t"
666 +- " mov %1, %%o1\n\t"
667 +- :
668 +- : "r" (regs), "r" (insn)
669 +- : "o0", "o1", "o2", "o3", "o4", "o5", "o7",
670 +- "g1", "g2", "g3", "g4", "g5", "g7", "cc");
671 + goto out;
672 + }
673 +- advance(regs);
674 ++ if (err)
675 ++ goto kill_user;
676 ++ else
677 ++ advance(regs);
678 + goto out;
679 + }
680 +
681 +diff --git a/arch/sparc64/mm/fault.c b/arch/sparc64/mm/fault.c
682 +index e2027f2..2650d0d 100644
683 +--- a/arch/sparc64/mm/fault.c
684 ++++ b/arch/sparc64/mm/fault.c
685 +@@ -244,16 +244,8 @@ static void do_kernel_fault(struct pt_regs *regs, int si_code, int fault_code,
686 + if (regs->tstate & TSTATE_PRIV) {
687 + const struct exception_table_entry *entry;
688 +
689 +- if (asi == ASI_P && (insn & 0xc0800000) == 0xc0800000) {
690 +- if (insn & 0x2000)
691 +- asi = (regs->tstate >> 24);
692 +- else
693 +- asi = (insn >> 5);
694 +- }
695 +-
696 +- /* Look in asi.h: All _S asis have LS bit set */
697 +- if ((asi & 0x1) &&
698 +- (entry = search_exception_tables(regs->tpc))) {
699 ++ entry = search_exception_tables(regs->tpc);
700 ++ if (entry) {
701 + regs->tpc = entry->fixup;
702 + regs->tnpc = regs->tpc + 4;
703 + return;
704 +@@ -294,7 +286,7 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
705 + unsigned long tpc = regs->tpc;
706 +
707 + /* Sanity check the PC. */
708 +- if ((tpc >= KERNBASE && tpc < (unsigned long) _etext) ||
709 ++ if ((tpc >= KERNBASE && tpc < (unsigned long) __init_end) ||
710 + (tpc >= MODULES_VADDR && tpc < MODULES_END)) {
711 + /* Valid, no problems... */
712 + } else {
713 +diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
714 +index 6ea19c2..4eaaf78 100644
715 +--- a/arch/x86/ia32/ia32_signal.c
716 ++++ b/arch/x86/ia32/ia32_signal.c
717 +@@ -494,7 +494,7 @@ int ia32_setup_frame(int sig, struct k_sigaction *ka,
718 + regs->ss = __USER32_DS;
719 +
720 + set_fs(USER_DS);
721 +- regs->eflags &= ~TF_MASK;
722 ++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
723 + if (test_thread_flag(TIF_SINGLESTEP))
724 + ptrace_notify(SIGTRAP);
725 +
726 +@@ -600,7 +600,7 @@ int ia32_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
727 + regs->ss = __USER32_DS;
728 +
729 + set_fs(USER_DS);
730 +- regs->eflags &= ~TF_MASK;
731 ++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
732 + if (test_thread_flag(TIF_SINGLESTEP))
733 + ptrace_notify(SIGTRAP);
734 +
735 +diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
736 +index edb5108..c48fbb1 100644
737 +--- a/arch/x86/kernel/apic_32.c
738 ++++ b/arch/x86/kernel/apic_32.c
739 +@@ -154,7 +154,7 @@ unsigned long safe_apic_wait_icr_idle(void)
740 + /**
741 + * enable_NMI_through_LVT0 - enable NMI through local vector table 0
742 + */
743 +-void enable_NMI_through_LVT0 (void * dummy)
744 ++void __cpuinit enable_NMI_through_LVT0(void)
745 + {
746 + unsigned int v = APIC_DM_NMI;
747 +
748 +diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c
749 +index f28ccb5..0173007 100644
750 +--- a/arch/x86/kernel/apic_64.c
751 ++++ b/arch/x86/kernel/apic_64.c
752 +@@ -151,7 +151,7 @@ unsigned int safe_apic_wait_icr_idle(void)
753 + return send_status;
754 + }
755 +
756 +-void enable_NMI_through_LVT0 (void * dummy)
757 ++void enable_NMI_through_LVT0(void)
758 + {
759 + unsigned int v;
760 +
761 +diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
762 +index a6b1490..232fdeb 100644
763 +--- a/arch/x86/kernel/io_apic_32.c
764 ++++ b/arch/x86/kernel/io_apic_32.c
765 +@@ -2080,7 +2080,7 @@ static struct irq_chip lapic_chip __read_mostly = {
766 + .eoi = ack_apic,
767 + };
768 +
769 +-static void setup_nmi (void)
770 ++static void __init setup_nmi(void)
771 + {
772 + /*
773 + * Dirty trick to enable the NMI watchdog ...
774 +@@ -2093,7 +2093,7 @@ static void setup_nmi (void)
775 + */
776 + apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ...");
777 +
778 +- on_each_cpu(enable_NMI_through_LVT0, NULL, 1, 1);
779 ++ enable_NMI_through_LVT0();
780 +
781 + apic_printk(APIC_VERBOSE, " done.\n");
782 + }
783 +diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c
784 +index cbac167..7119cb7 100644
785 +--- a/arch/x86/kernel/io_apic_64.c
786 ++++ b/arch/x86/kernel/io_apic_64.c
787 +@@ -1565,7 +1565,7 @@ static struct hw_interrupt_type lapic_irq_type __read_mostly = {
788 + .end = end_lapic_irq,
789 + };
790 +
791 +-static void setup_nmi (void)
792 ++static void __init setup_nmi(void)
793 + {
794 + /*
795 + * Dirty trick to enable the NMI watchdog ...
796 +@@ -1578,7 +1578,7 @@ static void setup_nmi (void)
797 + */
798 + printk(KERN_INFO "activating NMI Watchdog ...");
799 +
800 +- enable_NMI_through_LVT0(NULL);
801 ++ enable_NMI_through_LVT0();
802 +
803 + printk(" done.\n");
804 + }
805 +@@ -1654,7 +1654,7 @@ static inline void unlock_ExtINT_logic(void)
806 + *
807 + * FIXME: really need to revamp this for modern platforms only.
808 + */
809 +-static inline void check_timer(void)
810 ++static inline void __init check_timer(void)
811 + {
812 + struct irq_cfg *cfg = irq_cfg + 0;
813 + int apic1, pin1, apic2, pin2;
814 +diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
815 +index ab79e1d..d7f7132 100644
816 +--- a/arch/x86/kernel/process_64.c
817 ++++ b/arch/x86/kernel/process_64.c
818 +@@ -212,14 +212,13 @@ void cpu_idle (void)
819 + current_thread_info()->status |= TS_POLLING;
820 + /* endless idle loop with no priority at all */
821 + while (1) {
822 ++ tick_nohz_stop_sched_tick();
823 + while (!need_resched()) {
824 + void (*idle)(void);
825 +
826 + if (__get_cpu_var(cpu_idle_state))
827 + __get_cpu_var(cpu_idle_state) = 0;
828 +
829 +- tick_nohz_stop_sched_tick();
830 +-
831 + rmb();
832 + idle = pm_idle;
833 + if (!idle)
834 +diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c
835 +index 9bdd830..20056db 100644
836 +--- a/arch/x86/kernel/signal_32.c
837 ++++ b/arch/x86/kernel/signal_32.c
838 +@@ -396,7 +396,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
839 + * The tracer may want to single-step inside the
840 + * handler too.
841 + */
842 +- regs->eflags &= ~TF_MASK;
843 ++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
844 + if (test_thread_flag(TIF_SINGLESTEP))
845 + ptrace_notify(SIGTRAP);
846 +
847 +@@ -489,7 +489,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
848 + * The tracer may want to single-step inside the
849 + * handler too.
850 + */
851 +- regs->eflags &= ~TF_MASK;
852 ++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
853 + if (test_thread_flag(TIF_SINGLESTEP))
854 + ptrace_notify(SIGTRAP);
855 +
856 +diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c
857 +index ab086b0..62964c5 100644
858 +--- a/arch/x86/kernel/signal_64.c
859 ++++ b/arch/x86/kernel/signal_64.c
860 +@@ -295,7 +295,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
861 + see include/asm-x86_64/uaccess.h for details. */
862 + set_fs(USER_DS);
863 +
864 +- regs->eflags &= ~TF_MASK;
865 ++ regs->eflags &= ~(TF_MASK | X86_EFLAGS_DF);
866 + if (test_thread_flag(TIF_SINGLESTEP))
867 + ptrace_notify(SIGTRAP);
868 + #ifdef DEBUG_SIG
869 +diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c
870 +index 4ea80cb..fe200cf 100644
871 +--- a/arch/x86/kernel/smpboot_32.c
872 ++++ b/arch/x86/kernel/smpboot_32.c
873 +@@ -405,7 +405,7 @@ static void __cpuinit start_secondary(void *unused)
874 + setup_secondary_clock();
875 + if (nmi_watchdog == NMI_IO_APIC) {
876 + disable_8259A_irq(0);
877 +- enable_NMI_through_LVT0(NULL);
878 ++ enable_NMI_through_LVT0();
879 + enable_8259A_irq(0);
880 + }
881 + /*
882 +diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
883 +index aaf4e12..eca8026 100644
884 +--- a/arch/x86/kernel/smpboot_64.c
885 ++++ b/arch/x86/kernel/smpboot_64.c
886 +@@ -338,7 +338,7 @@ void __cpuinit start_secondary(void)
887 +
888 + if (nmi_watchdog == NMI_IO_APIC) {
889 + disable_8259A_irq(0);
890 +- enable_NMI_through_LVT0(NULL);
891 ++ enable_NMI_through_LVT0();
892 + enable_8259A_irq(0);
893 + }
894 +
895 +diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
896 +index 4df637e..6b521d3 100644
897 +--- a/arch/x86/pci/mmconfig-shared.c
898 ++++ b/arch/x86/pci/mmconfig-shared.c
899 +@@ -22,42 +22,9 @@
900 + #define MMCONFIG_APER_MIN (2 * 1024*1024)
901 + #define MMCONFIG_APER_MAX (256 * 1024*1024)
902 +
903 +-DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
904 +-
905 + /* Indicate if the mmcfg resources have been placed into the resource table. */
906 + static int __initdata pci_mmcfg_resources_inserted;
907 +
908 +-/* K8 systems have some devices (typically in the builtin northbridge)
909 +- that are only accessible using type1
910 +- Normally this can be expressed in the MCFG by not listing them
911 +- and assigning suitable _SEGs, but this isn't implemented in some BIOS.
912 +- Instead try to discover all devices on bus 0 that are unreachable using MM
913 +- and fallback for them. */
914 +-static void __init unreachable_devices(void)
915 +-{
916 +- int i, bus;
917 +- /* Use the max bus number from ACPI here? */
918 +- for (bus = 0; bus < PCI_MMCFG_MAX_CHECK_BUS; bus++) {
919 +- for (i = 0; i < 32; i++) {
920 +- unsigned int devfn = PCI_DEVFN(i, 0);
921 +- u32 val1, val2;
922 +-
923 +- pci_conf1_read(0, bus, devfn, 0, 4, &val1);
924 +- if (val1 == 0xffffffff)
925 +- continue;
926 +-
927 +- if (pci_mmcfg_arch_reachable(0, bus, devfn)) {
928 +- raw_pci_ops->read(0, bus, devfn, 0, 4, &val2);
929 +- if (val1 == val2)
930 +- continue;
931 +- }
932 +- set_bit(i + 32 * bus, pci_mmcfg_fallback_slots);
933 +- printk(KERN_NOTICE "PCI: No mmconfig possible on device"
934 +- " %02x:%02x\n", bus, i);
935 +- }
936 +- }
937 +-}
938 +-
939 + static const char __init *pci_mmcfg_e7520(void)
940 + {
941 + u32 win;
942 +@@ -270,8 +237,6 @@ void __init pci_mmcfg_init(int type)
943 + return;
944 +
945 + if (pci_mmcfg_arch_init()) {
946 +- if (type == 1)
947 +- unreachable_devices();
948 + if (known_bridge)
949 + pci_mmcfg_insert_resources(IORESOURCE_BUSY);
950 + pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
951 +diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c
952 +index 1bf5816..7b75e65 100644
953 +--- a/arch/x86/pci/mmconfig_32.c
954 ++++ b/arch/x86/pci/mmconfig_32.c
955 +@@ -30,10 +30,6 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
956 + struct acpi_mcfg_allocation *cfg;
957 + int cfg_num;
958 +
959 +- if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS &&
960 +- test_bit(PCI_SLOT(devfn) + 32*bus, pci_mmcfg_fallback_slots))
961 +- return 0;
962 +-
963 + for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) {
964 + cfg = &pci_mmcfg_config[cfg_num];
965 + if (cfg->pci_segment == seg &&
966 +@@ -68,13 +64,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
967 + u32 base;
968 +
969 + if ((bus > 255) || (devfn > 255) || (reg > 4095)) {
970 +- *value = -1;
971 ++err: *value = -1;
972 + return -EINVAL;
973 + }
974 +
975 ++ if (reg < 256)
976 ++ return pci_conf1_read(seg,bus,devfn,reg,len,value);
977 ++
978 + base = get_base_addr(seg, bus, devfn);
979 + if (!base)
980 +- return pci_conf1_read(seg,bus,devfn,reg,len,value);
981 ++ goto err;
982 +
983 + spin_lock_irqsave(&pci_config_lock, flags);
984 +
985 +@@ -105,9 +104,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
986 + if ((bus > 255) || (devfn > 255) || (reg > 4095))
987 + return -EINVAL;
988 +
989 ++ if (reg < 256)
990 ++ return pci_conf1_write(seg,bus,devfn,reg,len,value);
991 ++
992 + base = get_base_addr(seg, bus, devfn);
993 + if (!base)
994 +- return pci_conf1_write(seg,bus,devfn,reg,len,value);
995 ++ return -EINVAL;
996 +
997 + spin_lock_irqsave(&pci_config_lock, flags);
998 +
999 +@@ -134,12 +136,6 @@ static struct pci_raw_ops pci_mmcfg = {
1000 + .write = pci_mmcfg_write,
1001 + };
1002 +
1003 +-int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
1004 +- unsigned int devfn)
1005 +-{
1006 +- return get_base_addr(seg, bus, devfn) != 0;
1007 +-}
1008 +-
1009 + int __init pci_mmcfg_arch_init(void)
1010 + {
1011 + printk(KERN_INFO "PCI: Using MMCONFIG\n");
1012 +diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c
1013 +index 4095e4d..c4cf318 100644
1014 +--- a/arch/x86/pci/mmconfig_64.c
1015 ++++ b/arch/x86/pci/mmconfig_64.c
1016 +@@ -40,9 +40,7 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus)
1017 + static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
1018 + {
1019 + char __iomem *addr;
1020 +- if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS &&
1021 +- test_bit(32*bus + PCI_SLOT(devfn), pci_mmcfg_fallback_slots))
1022 +- return NULL;
1023 ++
1024 + addr = get_virt(seg, bus);
1025 + if (!addr)
1026 + return NULL;
1027 +@@ -56,13 +54,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
1028 +
1029 + /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
1030 + if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) {
1031 +- *value = -1;
1032 ++err: *value = -1;
1033 + return -EINVAL;
1034 + }
1035 +
1036 ++ if (reg < 256)
1037 ++ return pci_conf1_read(seg,bus,devfn,reg,len,value);
1038 ++
1039 + addr = pci_dev_base(seg, bus, devfn);
1040 + if (!addr)
1041 +- return pci_conf1_read(seg,bus,devfn,reg,len,value);
1042 ++ goto err;
1043 +
1044 + switch (len) {
1045 + case 1:
1046 +@@ -88,9 +89,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
1047 + if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
1048 + return -EINVAL;
1049 +
1050 ++ if (reg < 256)
1051 ++ return pci_conf1_write(seg,bus,devfn,reg,len,value);
1052 ++
1053 + addr = pci_dev_base(seg, bus, devfn);
1054 + if (!addr)
1055 +- return pci_conf1_write(seg,bus,devfn,reg,len,value);
1056 ++ return -EINVAL;
1057 +
1058 + switch (len) {
1059 + case 1:
1060 +@@ -126,12 +130,6 @@ static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg)
1061 + return addr;
1062 + }
1063 +
1064 +-int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
1065 +- unsigned int devfn)
1066 +-{
1067 +- return pci_dev_base(seg, bus, devfn) != NULL;
1068 +-}
1069 +-
1070 + int __init pci_mmcfg_arch_init(void)
1071 + {
1072 + int i;
1073 +diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
1074 +index ac56d39..36cb44c 100644
1075 +--- a/arch/x86/pci/pci.h
1076 ++++ b/arch/x86/pci/pci.h
1077 +@@ -98,13 +98,6 @@ extern void pcibios_sort(void);
1078 +
1079 + /* pci-mmconfig.c */
1080 +
1081 +-/* Verify the first 16 busses. We assume that systems with more busses
1082 +- get MCFG right. */
1083 +-#define PCI_MMCFG_MAX_CHECK_BUS 16
1084 +-extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
1085 +-
1086 +-extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
1087 +- unsigned int devfn);
1088 + extern int __init pci_mmcfg_arch_init(void);
1089 +
1090 + /*
1091 +diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
1092 +index 2575f67..5c579d2 100644
1093 +--- a/crypto/async_tx/async_xor.c
1094 ++++ b/crypto/async_tx/async_xor.c
1095 +@@ -264,7 +264,7 @@ async_xor_zero_sum(struct page *dest, struct page **src_list,
1096 +
1097 + BUG_ON(src_cnt <= 1);
1098 +
1099 +- if (tx) {
1100 ++ if (tx && src_cnt <= device->max_xor) {
1101 + dma_addr_t dma_addr;
1102 + enum dma_data_direction dir;
1103 +
1104 +diff --git a/crypto/xcbc.c b/crypto/xcbc.c
1105 +index ac68f3b..a957373 100644
1106 +--- a/crypto/xcbc.c
1107 ++++ b/crypto/xcbc.c
1108 +@@ -124,6 +124,11 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
1109 + unsigned int offset = sg[i].offset;
1110 + unsigned int slen = sg[i].length;
1111 +
1112 ++ if (unlikely(slen > nbytes))
1113 ++ slen = nbytes;
1114 ++
1115 ++ nbytes -= slen;
1116 ++
1117 + while (slen > 0) {
1118 + unsigned int len = min(slen, ((unsigned int)(PAGE_SIZE)) - offset);
1119 + char *p = crypto_kmap(pg, 0) + offset;
1120 +@@ -177,7 +182,6 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc,
1121 + offset = 0;
1122 + pg++;
1123 + }
1124 +- nbytes-=sg[i].length;
1125 + i++;
1126 + } while (nbytes>0);
1127 +
1128 +diff --git a/crypto/xts.c b/crypto/xts.c
1129 +index 8eb08bf..d87b0f3 100644
1130 +--- a/crypto/xts.c
1131 ++++ b/crypto/xts.c
1132 +@@ -77,16 +77,16 @@ static int setkey(struct crypto_tfm *parent, const u8 *key,
1133 + }
1134 +
1135 + struct sinfo {
1136 +- be128 t;
1137 ++ be128 *t;
1138 + struct crypto_tfm *tfm;
1139 + void (*fn)(struct crypto_tfm *, u8 *, const u8 *);
1140 + };
1141 +
1142 + static inline void xts_round(struct sinfo *s, void *dst, const void *src)
1143 + {
1144 +- be128_xor(dst, &s->t, src); /* PP <- T xor P */
1145 ++ be128_xor(dst, s->t, src); /* PP <- T xor P */
1146 + s->fn(s->tfm, dst, dst); /* CC <- E(Key1,PP) */
1147 +- be128_xor(dst, dst, &s->t); /* C <- T xor CC */
1148 ++ be128_xor(dst, dst, s->t); /* C <- T xor CC */
1149 + }
1150 +
1151 + static int crypt(struct blkcipher_desc *d,
1152 +@@ -101,7 +101,6 @@ static int crypt(struct blkcipher_desc *d,
1153 + .tfm = crypto_cipher_tfm(ctx->child),
1154 + .fn = fn
1155 + };
1156 +- be128 *iv;
1157 + u8 *wsrc;
1158 + u8 *wdst;
1159 +
1160 +@@ -109,20 +108,20 @@ static int crypt(struct blkcipher_desc *d,
1161 + if (!w->nbytes)
1162 + return err;
1163 +
1164 ++ s.t = (be128 *)w->iv;
1165 + avail = w->nbytes;
1166 +
1167 + wsrc = w->src.virt.addr;
1168 + wdst = w->dst.virt.addr;
1169 +
1170 + /* calculate first value of T */
1171 +- iv = (be128 *)w->iv;
1172 +- tw(crypto_cipher_tfm(ctx->tweak), (void *)&s.t, w->iv);
1173 ++ tw(crypto_cipher_tfm(ctx->tweak), w->iv, w->iv);
1174 +
1175 + goto first;
1176 +
1177 + for (;;) {
1178 + do {
1179 +- gf128mul_x_ble(&s.t, &s.t);
1180 ++ gf128mul_x_ble(s.t, s.t);
1181 +
1182 + first:
1183 + xts_round(&s, wdst, wsrc);
1184 +diff --git a/drivers/acorn/char/defkeymap-l7200.c b/drivers/acorn/char/defkeymap-l7200.c
1185 +index 28a5fbc..93d80a1 100644
1186 +--- a/drivers/acorn/char/defkeymap-l7200.c
1187 ++++ b/drivers/acorn/char/defkeymap-l7200.c
1188 +@@ -347,40 +347,40 @@ char *func_table[MAX_NR_FUNC] = {
1189 + };
1190 +
1191 + struct kbdiacruc accent_table[MAX_DIACR] = {
1192 +- {'`', 'A', '\300'}, {'`', 'a', '\340'},
1193 +- {'\'', 'A', '\301'}, {'\'', 'a', '\341'},
1194 +- {'^', 'A', '\302'}, {'^', 'a', '\342'},
1195 +- {'~', 'A', '\303'}, {'~', 'a', '\343'},
1196 +- {'"', 'A', '\304'}, {'"', 'a', '\344'},
1197 +- {'O', 'A', '\305'}, {'o', 'a', '\345'},
1198 +- {'0', 'A', '\305'}, {'0', 'a', '\345'},
1199 +- {'A', 'A', '\305'}, {'a', 'a', '\345'},
1200 +- {'A', 'E', '\306'}, {'a', 'e', '\346'},
1201 +- {',', 'C', '\307'}, {',', 'c', '\347'},
1202 +- {'`', 'E', '\310'}, {'`', 'e', '\350'},
1203 +- {'\'', 'E', '\311'}, {'\'', 'e', '\351'},
1204 +- {'^', 'E', '\312'}, {'^', 'e', '\352'},
1205 +- {'"', 'E', '\313'}, {'"', 'e', '\353'},
1206 +- {'`', 'I', '\314'}, {'`', 'i', '\354'},
1207 +- {'\'', 'I', '\315'}, {'\'', 'i', '\355'},
1208 +- {'^', 'I', '\316'}, {'^', 'i', '\356'},
1209 +- {'"', 'I', '\317'}, {'"', 'i', '\357'},
1210 +- {'-', 'D', '\320'}, {'-', 'd', '\360'},
1211 +- {'~', 'N', '\321'}, {'~', 'n', '\361'},
1212 +- {'`', 'O', '\322'}, {'`', 'o', '\362'},
1213 +- {'\'', 'O', '\323'}, {'\'', 'o', '\363'},
1214 +- {'^', 'O', '\324'}, {'^', 'o', '\364'},
1215 +- {'~', 'O', '\325'}, {'~', 'o', '\365'},
1216 +- {'"', 'O', '\326'}, {'"', 'o', '\366'},
1217 +- {'/', 'O', '\330'}, {'/', 'o', '\370'},
1218 +- {'`', 'U', '\331'}, {'`', 'u', '\371'},
1219 +- {'\'', 'U', '\332'}, {'\'', 'u', '\372'},
1220 +- {'^', 'U', '\333'}, {'^', 'u', '\373'},
1221 +- {'"', 'U', '\334'}, {'"', 'u', '\374'},
1222 +- {'\'', 'Y', '\335'}, {'\'', 'y', '\375'},
1223 +- {'T', 'H', '\336'}, {'t', 'h', '\376'},
1224 +- {'s', 's', '\337'}, {'"', 'y', '\377'},
1225 +- {'s', 'z', '\337'}, {'i', 'j', '\377'},
1226 ++ {'`', 'A', 0300}, {'`', 'a', 0340},
1227 ++ {'\'', 'A', 0301}, {'\'', 'a', 0341},
1228 ++ {'^', 'A', 0302}, {'^', 'a', 0342},
1229 ++ {'~', 'A', 0303}, {'~', 'a', 0343},
1230 ++ {'"', 'A', 0304}, {'"', 'a', 0344},
1231 ++ {'O', 'A', 0305}, {'o', 'a', 0345},
1232 ++ {'0', 'A', 0305}, {'0', 'a', 0345},
1233 ++ {'A', 'A', 0305}, {'a', 'a', 0345},
1234 ++ {'A', 'E', 0306}, {'a', 'e', 0346},
1235 ++ {',', 'C', 0307}, {',', 'c', 0347},
1236 ++ {'`', 'E', 0310}, {'`', 'e', 0350},
1237 ++ {'\'', 'E', 0311}, {'\'', 'e', 0351},
1238 ++ {'^', 'E', 0312}, {'^', 'e', 0352},
1239 ++ {'"', 'E', 0313}, {'"', 'e', 0353},
1240 ++ {'`', 'I', 0314}, {'`', 'i', 0354},
1241 ++ {'\'', 'I', 0315}, {'\'', 'i', 0355},
1242 ++ {'^', 'I', 0316}, {'^', 'i', 0356},
1243 ++ {'"', 'I', 0317}, {'"', 'i', 0357},
1244 ++ {'-', 'D', 0320}, {'-', 'd', 0360},
1245 ++ {'~', 'N', 0321}, {'~', 'n', 0361},
1246 ++ {'`', 'O', 0322}, {'`', 'o', 0362},
1247 ++ {'\'', 'O', 0323}, {'\'', 'o', 0363},
1248 ++ {'^', 'O', 0324}, {'^', 'o', 0364},
1249 ++ {'~', 'O', 0325}, {'~', 'o', 0365},
1250 ++ {'"', 'O', 0326}, {'"', 'o', 0366},
1251 ++ {'/', 'O', 0330}, {'/', 'o', 0370},
1252 ++ {'`', 'U', 0331}, {'`', 'u', 0371},
1253 ++ {'\'', 'U', 0332}, {'\'', 'u', 0372},
1254 ++ {'^', 'U', 0333}, {'^', 'u', 0373},
1255 ++ {'"', 'U', 0334}, {'"', 'u', 0374},
1256 ++ {'\'', 'Y', 0335}, {'\'', 'y', 0375},
1257 ++ {'T', 'H', 0336}, {'t', 'h', 0376},
1258 ++ {'s', 's', 0337}, {'"', 'y', 0377},
1259 ++ {'s', 'z', 0337}, {'i', 'j', 0377},
1260 + };
1261 +
1262 + unsigned int accent_table_size = 68;
1263 +diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
1264 +index 0713872..a742efa 100644
1265 +--- a/drivers/ata/pata_hpt366.c
1266 ++++ b/drivers/ata/pata_hpt366.c
1267 +@@ -27,7 +27,7 @@
1268 + #include <linux/libata.h>
1269 +
1270 + #define DRV_NAME "pata_hpt366"
1271 +-#define DRV_VERSION "0.6.1"
1272 ++#define DRV_VERSION "0.6.2"
1273 +
1274 + struct hpt_clock {
1275 + u8 xfer_speed;
1276 +@@ -180,9 +180,9 @@ static unsigned long hpt366_filter(struct ata_device *adev, unsigned long mask)
1277 + if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
1278 + mask &= ~ATA_MASK_UDMA;
1279 + if (hpt_dma_blacklisted(adev, "UDMA3", bad_ata66_3))
1280 +- mask &= ~(0x07 << ATA_SHIFT_UDMA);
1281 ++ mask &= ~(0xF8 << ATA_SHIFT_UDMA);
1282 + if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4))
1283 +- mask &= ~(0x0F << ATA_SHIFT_UDMA);
1284 ++ mask &= ~(0xF0 << ATA_SHIFT_UDMA);
1285 + }
1286 + return ata_pci_default_filter(adev, mask);
1287 + }
1288 +diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
1289 +index c79f066..eac6a2b 100644
1290 +--- a/drivers/ata/pata_hpt37x.c
1291 ++++ b/drivers/ata/pata_hpt37x.c
1292 +@@ -24,7 +24,7 @@
1293 + #include <linux/libata.h>
1294 +
1295 + #define DRV_NAME "pata_hpt37x"
1296 +-#define DRV_VERSION "0.6.9"
1297 ++#define DRV_VERSION "0.6.11"
1298 +
1299 + struct hpt_clock {
1300 + u8 xfer_speed;
1301 +@@ -281,7 +281,7 @@ static unsigned long hpt370_filter(struct ata_device *adev, unsigned long mask)
1302 + if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
1303 + mask &= ~ATA_MASK_UDMA;
1304 + if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
1305 +- mask &= ~(0x1F << ATA_SHIFT_UDMA);
1306 ++ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
1307 + }
1308 + return ata_pci_default_filter(adev, mask);
1309 + }
1310 +@@ -297,7 +297,7 @@ static unsigned long hpt370a_filter(struct ata_device *adev, unsigned long mask)
1311 + {
1312 + if (adev->class == ATA_DEV_ATA) {
1313 + if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
1314 +- mask &= ~ (0x1F << ATA_SHIFT_UDMA);
1315 ++ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
1316 + }
1317 + return ata_pci_default_filter(adev, mask);
1318 + }
1319 +diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
1320 +index 8bed888..004cac7 100644
1321 +--- a/drivers/ata/pata_serverworks.c
1322 ++++ b/drivers/ata/pata_serverworks.c
1323 +@@ -226,7 +226,7 @@ static unsigned long serverworks_csb_filter(struct ata_device *adev, unsigned lo
1324 +
1325 + for (i = 0; (p = csb_bad_ata100[i]) != NULL; i++) {
1326 + if (!strcmp(p, model_num))
1327 +- mask &= ~(0x1F << ATA_SHIFT_UDMA);
1328 ++ mask &= ~(0xE0 << ATA_SHIFT_UDMA);
1329 + }
1330 + return ata_pci_default_filter(adev, mask);
1331 + }
1332 +diff --git a/drivers/base/platform.c b/drivers/base/platform.c
1333 +index fb56092..39d8b7b 100644
1334 +--- a/drivers/base/platform.c
1335 ++++ b/drivers/base/platform.c
1336 +@@ -647,7 +647,7 @@ u64 dma_get_required_mask(struct device *dev)
1337 + high_totalram += high_totalram - 1;
1338 + mask = (((u64)high_totalram) << 32) + 0xffffffff;
1339 + }
1340 +- return mask & *dev->dma_mask;
1341 ++ return mask;
1342 + }
1343 + EXPORT_SYMBOL_GPL(dma_get_required_mask);
1344 + #endif
1345 +diff --git a/drivers/block/ub.c b/drivers/block/ub.c
1346 +index 08e909d..7aca466 100644
1347 +--- a/drivers/block/ub.c
1348 ++++ b/drivers/block/ub.c
1349 +@@ -657,7 +657,6 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
1350 + if ((cmd = ub_get_cmd(lun)) == NULL)
1351 + return -1;
1352 + memset(cmd, 0, sizeof(struct ub_scsi_cmd));
1353 +- sg_init_table(cmd->sgv, UB_MAX_REQ_SG);
1354 +
1355 + blkdev_dequeue_request(rq);
1356 +
1357 +@@ -668,6 +667,7 @@ static int ub_request_fn_1(struct ub_lun *lun, struct request *rq)
1358 + /*
1359 + * get scatterlist from block layer
1360 + */
1361 ++ sg_init_table(&urq->sgv[0], UB_MAX_REQ_SG);
1362 + n_elem = blk_rq_map_sg(lun->disk->queue, rq, &urq->sgv[0]);
1363 + if (n_elem < 0) {
1364 + /* Impossible, because blk_rq_map_sg should not hit ENOMEM. */
1365 +diff --git a/drivers/char/defkeymap.c_shipped b/drivers/char/defkeymap.c_shipped
1366 +index 0aa419a..d2208df 100644
1367 +--- a/drivers/char/defkeymap.c_shipped
1368 ++++ b/drivers/char/defkeymap.c_shipped
1369 +@@ -223,40 +223,40 @@ char *func_table[MAX_NR_FUNC] = {
1370 + };
1371 +
1372 + struct kbdiacruc accent_table[MAX_DIACR] = {
1373 +- {'`', 'A', '\300'}, {'`', 'a', '\340'},
1374 +- {'\'', 'A', '\301'}, {'\'', 'a', '\341'},
1375 +- {'^', 'A', '\302'}, {'^', 'a', '\342'},
1376 +- {'~', 'A', '\303'}, {'~', 'a', '\343'},
1377 +- {'"', 'A', '\304'}, {'"', 'a', '\344'},
1378 +- {'O', 'A', '\305'}, {'o', 'a', '\345'},
1379 +- {'0', 'A', '\305'}, {'0', 'a', '\345'},
1380 +- {'A', 'A', '\305'}, {'a', 'a', '\345'},
1381 +- {'A', 'E', '\306'}, {'a', 'e', '\346'},
1382 +- {',', 'C', '\307'}, {',', 'c', '\347'},
1383 +- {'`', 'E', '\310'}, {'`', 'e', '\350'},
1384 +- {'\'', 'E', '\311'}, {'\'', 'e', '\351'},
1385 +- {'^', 'E', '\312'}, {'^', 'e', '\352'},
1386 +- {'"', 'E', '\313'}, {'"', 'e', '\353'},
1387 +- {'`', 'I', '\314'}, {'`', 'i', '\354'},
1388 +- {'\'', 'I', '\315'}, {'\'', 'i', '\355'},
1389 +- {'^', 'I', '\316'}, {'^', 'i', '\356'},
1390 +- {'"', 'I', '\317'}, {'"', 'i', '\357'},
1391 +- {'-', 'D', '\320'}, {'-', 'd', '\360'},
1392 +- {'~', 'N', '\321'}, {'~', 'n', '\361'},
1393 +- {'`', 'O', '\322'}, {'`', 'o', '\362'},
1394 +- {'\'', 'O', '\323'}, {'\'', 'o', '\363'},
1395 +- {'^', 'O', '\324'}, {'^', 'o', '\364'},
1396 +- {'~', 'O', '\325'}, {'~', 'o', '\365'},
1397 +- {'"', 'O', '\326'}, {'"', 'o', '\366'},
1398 +- {'/', 'O', '\330'}, {'/', 'o', '\370'},
1399 +- {'`', 'U', '\331'}, {'`', 'u', '\371'},
1400 +- {'\'', 'U', '\332'}, {'\'', 'u', '\372'},
1401 +- {'^', 'U', '\333'}, {'^', 'u', '\373'},
1402 +- {'"', 'U', '\334'}, {'"', 'u', '\374'},
1403 +- {'\'', 'Y', '\335'}, {'\'', 'y', '\375'},
1404 +- {'T', 'H', '\336'}, {'t', 'h', '\376'},
1405 +- {'s', 's', '\337'}, {'"', 'y', '\377'},
1406 +- {'s', 'z', '\337'}, {'i', 'j', '\377'},
1407 ++ {'`', 'A', 0300}, {'`', 'a', 0340},
1408 ++ {'\'', 'A', 0301}, {'\'', 'a', 0341},
1409 ++ {'^', 'A', 0302}, {'^', 'a', 0342},
1410 ++ {'~', 'A', 0303}, {'~', 'a', 0343},
1411 ++ {'"', 'A', 0304}, {'"', 'a', 0344},
1412 ++ {'O', 'A', 0305}, {'o', 'a', 0345},
1413 ++ {'0', 'A', 0305}, {'0', 'a', 0345},
1414 ++ {'A', 'A', 0305}, {'a', 'a', 0345},
1415 ++ {'A', 'E', 0306}, {'a', 'e', 0346},
1416 ++ {',', 'C', 0307}, {',', 'c', 0347},
1417 ++ {'`', 'E', 0310}, {'`', 'e', 0350},
1418 ++ {'\'', 'E', 0311}, {'\'', 'e', 0351},
1419 ++ {'^', 'E', 0312}, {'^', 'e', 0352},
1420 ++ {'"', 'E', 0313}, {'"', 'e', 0353},
1421 ++ {'`', 'I', 0314}, {'`', 'i', 0354},
1422 ++ {'\'', 'I', 0315}, {'\'', 'i', 0355},
1423 ++ {'^', 'I', 0316}, {'^', 'i', 0356},
1424 ++ {'"', 'I', 0317}, {'"', 'i', 0357},
1425 ++ {'-', 'D', 0320}, {'-', 'd', 0360},
1426 ++ {'~', 'N', 0321}, {'~', 'n', 0361},
1427 ++ {'`', 'O', 0322}, {'`', 'o', 0362},
1428 ++ {'\'', 'O', 0323}, {'\'', 'o', 0363},
1429 ++ {'^', 'O', 0324}, {'^', 'o', 0364},
1430 ++ {'~', 'O', 0325}, {'~', 'o', 0365},
1431 ++ {'"', 'O', 0326}, {'"', 'o', 0366},
1432 ++ {'/', 'O', 0330}, {'/', 'o', 0370},
1433 ++ {'`', 'U', 0331}, {'`', 'u', 0371},
1434 ++ {'\'', 'U', 0332}, {'\'', 'u', 0372},
1435 ++ {'^', 'U', 0333}, {'^', 'u', 0373},
1436 ++ {'"', 'U', 0334}, {'"', 'u', 0374},
1437 ++ {'\'', 'Y', 0335}, {'\'', 'y', 0375},
1438 ++ {'T', 'H', 0336}, {'t', 'h', 0376},
1439 ++ {'s', 's', 0337}, {'"', 'y', 0377},
1440 ++ {'s', 'z', 0337}, {'i', 'j', 0377},
1441 + };
1442 +
1443 + unsigned int accent_table_size = 68;
1444 +diff --git a/drivers/char/vt.c b/drivers/char/vt.c
1445 +index 7a5badf..93cfe4a 100644
1446 +--- a/drivers/char/vt.c
1447 ++++ b/drivers/char/vt.c
1448 +@@ -702,6 +702,7 @@ void redraw_screen(struct vc_data *vc, int is_switch)
1449 + if (is_switch) {
1450 + set_leds();
1451 + compute_shiftstate();
1452 ++ notify_update(vc);
1453 + }
1454 + }
1455 +
1456 +diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
1457 +index 45e7b46..8cf542b 100644
1458 +--- a/drivers/dma/ioat_dma.c
1459 ++++ b/drivers/dma/ioat_dma.c
1460 +@@ -726,6 +726,7 @@ static struct dma_async_tx_descriptor *ioat1_dma_prep_memcpy(
1461 +
1462 + if (new) {
1463 + new->len = len;
1464 ++ new->async_tx.ack = 0;
1465 + return &new->async_tx;
1466 + } else
1467 + return NULL;
1468 +@@ -749,6 +750,7 @@ static struct dma_async_tx_descriptor *ioat2_dma_prep_memcpy(
1469 +
1470 + if (new) {
1471 + new->len = len;
1472 ++ new->async_tx.ack = 0;
1473 + return &new->async_tx;
1474 + } else
1475 + return NULL;
1476 +diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
1477 +index e4c94f9..c8d3ffb 100644
1478 +--- a/drivers/message/fusion/mptsas.c
1479 ++++ b/drivers/message/fusion/mptsas.c
1480 +@@ -1699,6 +1699,11 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info,
1481 + if (error)
1482 + goto out_free_consistent;
1483 +
1484 ++ if (!buffer->NumPhys) {
1485 ++ error = -ENODEV;
1486 ++ goto out_free_consistent;
1487 ++ }
1488 ++
1489 + /* save config data */
1490 + port_info->num_phys = buffer->NumPhys;
1491 + port_info->phy_info = kcalloc(port_info->num_phys,
1492 +diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
1493 +index 9cc5a6b..55584ee 100644
1494 +--- a/drivers/net/e1000e/netdev.c
1495 ++++ b/drivers/net/e1000e/netdev.c
1496 +@@ -1686,6 +1686,9 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
1497 + else
1498 + rctl |= E1000_RCTL_LPE;
1499 +
1500 ++ /* Enable hardware CRC frame stripping */
1501 ++ rctl |= E1000_RCTL_SECRC;
1502 ++
1503 + /* Setup buffer sizes */
1504 + rctl &= ~E1000_RCTL_SZ_4096;
1505 + rctl |= E1000_RCTL_BSEX;
1506 +@@ -1751,9 +1754,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
1507 +
1508 + /* Enable Packet split descriptors */
1509 + rctl |= E1000_RCTL_DTYP_PS;
1510 +-
1511 +- /* Enable hardware CRC frame stripping */
1512 +- rctl |= E1000_RCTL_SECRC;
1513 +
1514 + psrctl |= adapter->rx_ps_bsize0 >>
1515 + E1000_PSRCTL_BSIZE0_SHIFT;
1516 +diff --git a/drivers/net/macb.c b/drivers/net/macb.c
1517 +index e10528e..c796948 100644
1518 +--- a/drivers/net/macb.c
1519 ++++ b/drivers/net/macb.c
1520 +@@ -148,7 +148,7 @@ static void macb_handle_link_change(struct net_device *dev)
1521 +
1522 + if (phydev->duplex)
1523 + reg |= MACB_BIT(FD);
1524 +- if (phydev->speed)
1525 ++ if (phydev->speed == SPEED_100)
1526 + reg |= MACB_BIT(SPD);
1527 +
1528 + macb_writel(bp, NCFGR, reg);
1529 +diff --git a/drivers/net/niu.c b/drivers/net/niu.c
1530 +index 5f6beab..226dc54 100644
1531 +--- a/drivers/net/niu.c
1532 ++++ b/drivers/net/niu.c
1533 +@@ -33,8 +33,8 @@
1534 +
1535 + #define DRV_MODULE_NAME "niu"
1536 + #define PFX DRV_MODULE_NAME ": "
1537 +-#define DRV_MODULE_VERSION "0.6"
1538 +-#define DRV_MODULE_RELDATE "January 5, 2008"
1539 ++#define DRV_MODULE_VERSION "0.7"
1540 ++#define DRV_MODULE_RELDATE "February 18, 2008"
1541 +
1542 + static char version[] __devinitdata =
1543 + DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
1544 +@@ -1616,12 +1616,13 @@ static int niu_enable_alt_mac(struct niu *np, int index, int on)
1545 + if (index >= niu_num_alt_addr(np))
1546 + return -EINVAL;
1547 +
1548 +- if (np->flags & NIU_FLAGS_XMAC)
1549 ++ if (np->flags & NIU_FLAGS_XMAC) {
1550 + reg = XMAC_ADDR_CMPEN;
1551 +- else
1552 ++ mask = 1 << index;
1553 ++ } else {
1554 + reg = BMAC_ADDR_CMPEN;
1555 +-
1556 +- mask = 1 << index;
1557 ++ mask = 1 << (index + 1);
1558 ++ }
1559 +
1560 + val = nr64_mac(reg);
1561 + if (on)
1562 +@@ -5147,7 +5148,12 @@ static void niu_set_rx_mode(struct net_device *dev)
1563 + index++;
1564 + }
1565 + } else {
1566 +- for (i = 0; i < niu_num_alt_addr(np); i++) {
1567 ++ int alt_start;
1568 ++ if (np->flags & NIU_FLAGS_XMAC)
1569 ++ alt_start = 0;
1570 ++ else
1571 ++ alt_start = 1;
1572 ++ for (i = alt_start; i < niu_num_alt_addr(np); i++) {
1573 + err = niu_enable_alt_mac(np, i, 0);
1574 + if (err)
1575 + printk(KERN_WARNING PFX "%s: Error %d "
1576 +diff --git a/drivers/net/niu.h b/drivers/net/niu.h
1577 +index 0e8626a..59dc05f 100644
1578 +--- a/drivers/net/niu.h
1579 ++++ b/drivers/net/niu.h
1580 +@@ -499,7 +499,7 @@
1581 + #define BMAC_ADDR2 0x00110UL
1582 + #define BMAC_ADDR2_ADDR2 0x000000000000ffffULL
1583 +
1584 +-#define BMAC_NUM_ALT_ADDR 7
1585 ++#define BMAC_NUM_ALT_ADDR 6
1586 +
1587 + #define BMAC_ALT_ADDR0(NUM) (0x00118UL + (NUM)*0x18UL)
1588 + #define BMAC_ALT_ADDR0_ADDR0 0x000000000000ffffULL
1589 +diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
1590 +index 559a9a9..ddcc0c4 100644
1591 +--- a/drivers/net/wireless/b43/dma.c
1592 ++++ b/drivers/net/wireless/b43/dma.c
1593 +@@ -165,7 +165,7 @@ static void op64_fill_descriptor(struct b43_dmaring *ring,
1594 + addrhi = (((u64) dmaaddr >> 32) & ~SSB_DMA_TRANSLATION_MASK);
1595 + addrext = (((u64) dmaaddr >> 32) & SSB_DMA_TRANSLATION_MASK)
1596 + >> SSB_DMA_TRANSLATION_SHIFT;
1597 +- addrhi |= ssb_dma_translation(ring->dev->dev);
1598 ++ addrhi |= (ssb_dma_translation(ring->dev->dev) << 1);
1599 + if (slot == ring->nr_slots - 1)
1600 + ctl0 |= B43_DMA64_DCTL0_DTABLEEND;
1601 + if (start)
1602 +@@ -426,9 +426,21 @@ static inline
1603 + static int alloc_ringmemory(struct b43_dmaring *ring)
1604 + {
1605 + struct device *dev = ring->dev->dev->dev;
1606 +-
1607 ++ gfp_t flags = GFP_KERNEL;
1608 ++
1609 ++ /* The specs call for 4K buffers for 30- and 32-bit DMA with 4K
1610 ++ * alignment and 8K buffers for 64-bit DMA with 8K alignment. Testing
1611 ++ * has shown that 4K is sufficient for the latter as long as the buffer
1612 ++ * does not cross an 8K boundary.
1613 ++ *
1614 ++ * For unknown reasons - possibly a hardware error - the BCM4311 rev
1615 ++ * 02, which uses 64-bit DMA, needs the ring buffer in very low memory,
1616 ++ * which accounts for the GFP_DMA flag below.
1617 ++ */
1618 ++ if (ring->dma64)
1619 ++ flags |= GFP_DMA;
1620 + ring->descbase = dma_alloc_coherent(dev, B43_DMA_RINGMEMSIZE,
1621 +- &(ring->dmabase), GFP_KERNEL);
1622 ++ &(ring->dmabase), flags);
1623 + if (!ring->descbase) {
1624 + b43err(ring->dev->wl, "DMA ringmemory allocation failed\n");
1625 + return -ENOMEM;
1626 +@@ -483,7 +495,7 @@ int b43_dmacontroller_rx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
1627 + return 0;
1628 + }
1629 +
1630 +-/* Reset the RX DMA channel */
1631 ++/* Reset the TX DMA channel */
1632 + int b43_dmacontroller_tx_reset(struct b43_wldev *dev, u16 mmio_base, int dma64)
1633 + {
1634 + int i;
1635 +@@ -647,7 +659,7 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
1636 + b43_dma_write(ring, B43_DMA64_TXRINGHI,
1637 + ((ringbase >> 32) &
1638 + ~SSB_DMA_TRANSLATION_MASK)
1639 +- | trans);
1640 ++ | (trans << 1));
1641 + } else {
1642 + u32 ringbase = (u32) (ring->dmabase);
1643 +
1644 +@@ -680,8 +692,9 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
1645 + b43_dma_write(ring, B43_DMA64_RXRINGHI,
1646 + ((ringbase >> 32) &
1647 + ~SSB_DMA_TRANSLATION_MASK)
1648 +- | trans);
1649 +- b43_dma_write(ring, B43_DMA64_RXINDEX, 200);
1650 ++ | (trans << 1));
1651 ++ b43_dma_write(ring, B43_DMA64_RXINDEX, ring->nr_slots *
1652 ++ sizeof(struct b43_dmadesc64));
1653 + } else {
1654 + u32 ringbase = (u32) (ring->dmabase);
1655 +
1656 +@@ -695,11 +708,12 @@ static int dmacontroller_setup(struct b43_dmaring *ring)
1657 + b43_dma_write(ring, B43_DMA32_RXRING,
1658 + (ringbase & ~SSB_DMA_TRANSLATION_MASK)
1659 + | trans);
1660 +- b43_dma_write(ring, B43_DMA32_RXINDEX, 200);
1661 ++ b43_dma_write(ring, B43_DMA32_RXINDEX, ring->nr_slots *
1662 ++ sizeof(struct b43_dmadesc32));
1663 + }
1664 + }
1665 +
1666 +- out:
1667 ++out:
1668 + return err;
1669 + }
1670 +
1671 +diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
1672 +index 69795fd..36a1de2 100644
1673 +--- a/drivers/net/wireless/b43/main.c
1674 ++++ b/drivers/net/wireless/b43/main.c
1675 +@@ -101,6 +101,7 @@ static const struct ssb_device_id b43_ssb_tbl[] = {
1676 + SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 7),
1677 + SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 9),
1678 + SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 10),
1679 ++ SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 13),
1680 + SSB_DEVTABLE_END
1681 + };
1682 +
1683 +@@ -3079,7 +3080,7 @@ static int b43_phy_versioning(struct b43_wldev *dev)
1684 + unsupported = 1;
1685 + break;
1686 + case B43_PHYTYPE_G:
1687 +- if (phy_rev > 8)
1688 ++ if (phy_rev > 9)
1689 + unsupported = 1;
1690 + break;
1691 + default:
1692 +diff --git a/drivers/s390/char/defkeymap.c b/drivers/s390/char/defkeymap.c
1693 +index 389346c..07c7f31 100644
1694 +--- a/drivers/s390/char/defkeymap.c
1695 ++++ b/drivers/s390/char/defkeymap.c
1696 +@@ -151,8 +151,8 @@ char *func_table[MAX_NR_FUNC] = {
1697 + };
1698 +
1699 + struct kbdiacruc accent_table[MAX_DIACR] = {
1700 +- {'^', 'c', '\003'}, {'^', 'd', '\004'},
1701 +- {'^', 'z', '\032'}, {'^', '\012', '\000'},
1702 ++ {'^', 'c', 0003}, {'^', 'd', 0004},
1703 ++ {'^', 'z', 0032}, {'^', 0012, 0000},
1704 + };
1705 +
1706 + unsigned int accent_table_size = 4;
1707 +diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
1708 +index 38a1ee2..f40417b 100644
1709 +--- a/drivers/scsi/advansys.c
1710 ++++ b/drivers/scsi/advansys.c
1711 +@@ -566,7 +566,7 @@ typedef struct asc_dvc_var {
1712 + ASC_SCSI_BIT_ID_TYPE unit_not_ready;
1713 + ASC_SCSI_BIT_ID_TYPE queue_full_or_busy;
1714 + ASC_SCSI_BIT_ID_TYPE start_motor;
1715 +- uchar overrun_buf[ASC_OVERRUN_BSIZE] __aligned(8);
1716 ++ uchar *overrun_buf;
1717 + dma_addr_t overrun_dma;
1718 + uchar scsi_reset_wait;
1719 + uchar chip_no;
1720 +@@ -6439,7 +6439,7 @@ static int AdvLoadMicrocode(AdvPortAddr iop_base, unsigned char *buf, int size,
1721 + i += 2;
1722 + len += 2;
1723 + } else {
1724 +- unsigned char off = buf[i] * 2;
1725 ++ unsigned int off = buf[i] * 2;
1726 + unsigned short word = (buf[off + 1] << 8) | buf[off];
1727 + AdvWriteWordAutoIncLram(iop_base, word);
1728 + len += 2;
1729 +@@ -13833,6 +13833,12 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost,
1730 + */
1731 + if (ASC_NARROW_BOARD(boardp)) {
1732 + ASC_DBG(2, "AscInitAsc1000Driver()\n");
1733 ++
1734 ++ asc_dvc_varp->overrun_buf = kzalloc(ASC_OVERRUN_BSIZE, GFP_KERNEL);
1735 ++ if (!asc_dvc_varp->overrun_buf) {
1736 ++ ret = -ENOMEM;
1737 ++ goto err_free_wide_mem;
1738 ++ }
1739 + warn_code = AscInitAsc1000Driver(asc_dvc_varp);
1740 +
1741 + if (warn_code || asc_dvc_varp->err_code) {
1742 +@@ -13840,8 +13846,10 @@ static int __devinit advansys_board_found(struct Scsi_Host *shost,
1743 + "warn 0x%x, error 0x%x\n",
1744 + asc_dvc_varp->init_state, warn_code,
1745 + asc_dvc_varp->err_code);
1746 +- if (asc_dvc_varp->err_code)
1747 ++ if (asc_dvc_varp->err_code) {
1748 + ret = -ENODEV;
1749 ++ kfree(asc_dvc_varp->overrun_buf);
1750 ++ }
1751 + }
1752 + } else {
1753 + if (advansys_wide_init_chip(shost))
1754 +@@ -13894,6 +13902,7 @@ static int advansys_release(struct Scsi_Host *shost)
1755 + dma_unmap_single(board->dev,
1756 + board->dvc_var.asc_dvc_var.overrun_dma,
1757 + ASC_OVERRUN_BSIZE, DMA_FROM_DEVICE);
1758 ++ kfree(board->dvc_var.asc_dvc_var.overrun_buf);
1759 + } else {
1760 + iounmap(board->ioremap_addr);
1761 + advansys_wide_free_mem(board);
1762 +diff --git a/drivers/scsi/aic94xx/aic94xx_scb.c b/drivers/scsi/aic94xx/aic94xx_scb.c
1763 +index db6ab1a..eae2d97 100644
1764 +--- a/drivers/scsi/aic94xx/aic94xx_scb.c
1765 ++++ b/drivers/scsi/aic94xx/aic94xx_scb.c
1766 +@@ -458,13 +458,19 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
1767 + tc_abort = le16_to_cpu(tc_abort);
1768 +
1769 + list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
1770 +- struct sas_task *task = ascb->uldd_task;
1771 ++ struct sas_task *task = a->uldd_task;
1772 ++
1773 ++ if (a->tc_index != tc_abort)
1774 ++ continue;
1775 +
1776 +- if (task && a->tc_index == tc_abort) {
1777 ++ if (task) {
1778 + failed_dev = task->dev;
1779 + sas_task_abort(task);
1780 +- break;
1781 ++ } else {
1782 ++ ASD_DPRINTK("R_T_A for non TASK scb 0x%x\n",
1783 ++ a->scb->header.opcode);
1784 + }
1785 ++ break;
1786 + }
1787 +
1788 + if (!failed_dev) {
1789 +@@ -478,7 +484,7 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
1790 + * that the EH will wake up and do something.
1791 + */
1792 + list_for_each_entry_safe(a, b, &asd_ha->seq.pend_q, list) {
1793 +- struct sas_task *task = ascb->uldd_task;
1794 ++ struct sas_task *task = a->uldd_task;
1795 +
1796 + if (task &&
1797 + task->dev == failed_dev &&
1798 +diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
1799 +index d466a2d..dcd6c9a 100644
1800 +--- a/drivers/scsi/arcmsr/arcmsr_hba.c
1801 ++++ b/drivers/scsi/arcmsr/arcmsr_hba.c
1802 +@@ -1380,17 +1380,16 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
1803 + switch(controlcode) {
1804 +
1805 + case ARCMSR_MESSAGE_READ_RQBUFFER: {
1806 +- unsigned long *ver_addr;
1807 +- dma_addr_t buf_handle;
1808 ++ unsigned char *ver_addr;
1809 + uint8_t *pQbuffer, *ptmpQbuffer;
1810 + int32_t allxfer_len = 0;
1811 +
1812 +- ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
1813 ++ ver_addr = kmalloc(1032, GFP_ATOMIC);
1814 + if (!ver_addr) {
1815 + retvalue = ARCMSR_MESSAGE_FAIL;
1816 + goto message_out;
1817 + }
1818 +- ptmpQbuffer = (uint8_t *) ver_addr;
1819 ++ ptmpQbuffer = ver_addr;
1820 + while ((acb->rqbuf_firstindex != acb->rqbuf_lastindex)
1821 + && (allxfer_len < 1031)) {
1822 + pQbuffer = &acb->rqbuffer[acb->rqbuf_firstindex];
1823 +@@ -1419,25 +1418,24 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
1824 + }
1825 + arcmsr_iop_message_read(acb);
1826 + }
1827 +- memcpy(pcmdmessagefld->messagedatabuffer, (uint8_t *)ver_addr, allxfer_len);
1828 ++ memcpy(pcmdmessagefld->messagedatabuffer, ver_addr, allxfer_len);
1829 + pcmdmessagefld->cmdmessage.Length = allxfer_len;
1830 + pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK;
1831 +- pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
1832 ++ kfree(ver_addr);
1833 + }
1834 + break;
1835 +
1836 + case ARCMSR_MESSAGE_WRITE_WQBUFFER: {
1837 +- unsigned long *ver_addr;
1838 +- dma_addr_t buf_handle;
1839 ++ unsigned char *ver_addr;
1840 + int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex;
1841 + uint8_t *pQbuffer, *ptmpuserbuffer;
1842 +
1843 +- ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
1844 ++ ver_addr = kmalloc(1032, GFP_ATOMIC);
1845 + if (!ver_addr) {
1846 + retvalue = ARCMSR_MESSAGE_FAIL;
1847 + goto message_out;
1848 + }
1849 +- ptmpuserbuffer = (uint8_t *)ver_addr;
1850 ++ ptmpuserbuffer = ver_addr;
1851 + user_len = pcmdmessagefld->cmdmessage.Length;
1852 + memcpy(ptmpuserbuffer, pcmdmessagefld->messagedatabuffer, user_len);
1853 + wqbuf_lastindex = acb->wqbuf_lastindex;
1854 +@@ -1483,7 +1481,7 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \
1855 + retvalue = ARCMSR_MESSAGE_FAIL;
1856 + }
1857 + }
1858 +- pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
1859 ++ kfree(ver_addr);
1860 + }
1861 + break;
1862 +
1863 +diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
1864 +index 8eb78be..b8b67f6 100644
1865 +--- a/drivers/scsi/gdth.c
1866 ++++ b/drivers/scsi/gdth.c
1867 +@@ -160,7 +160,7 @@ static void gdth_readapp_event(gdth_ha_str *ha, unchar application,
1868 + static void gdth_clear_events(void);
1869 +
1870 + static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
1871 +- char *buffer, ushort count, int to_buffer);
1872 ++ char *buffer, ushort count);
1873 + static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp);
1874 + static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, ushort hdrive);
1875 +
1876 +@@ -183,7 +183,6 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
1877 + unsigned int cmd, unsigned long arg);
1878 +
1879 + static void gdth_flush(gdth_ha_str *ha);
1880 +-static int gdth_halt(struct notifier_block *nb, ulong event, void *buf);
1881 + static int gdth_queuecommand(Scsi_Cmnd *scp,void (*done)(Scsi_Cmnd *));
1882 + static int __gdth_queuecommand(gdth_ha_str *ha, struct scsi_cmnd *scp,
1883 + struct gdth_cmndinfo *cmndinfo);
1884 +@@ -418,12 +417,6 @@ static inline void gdth_set_sglist(struct scsi_cmnd *cmd,
1885 + #include "gdth_proc.h"
1886 + #include "gdth_proc.c"
1887 +
1888 +-/* notifier block to get a notify on system shutdown/halt/reboot */
1889 +-static struct notifier_block gdth_notifier = {
1890 +- gdth_halt, NULL, 0
1891 +-};
1892 +-static int notifier_disabled = 0;
1893 +-
1894 + static gdth_ha_str *gdth_find_ha(int hanum)
1895 + {
1896 + gdth_ha_str *ha;
1897 +@@ -446,8 +439,8 @@ static struct gdth_cmndinfo *gdth_get_cmndinfo(gdth_ha_str *ha)
1898 + for (i=0; i<GDTH_MAXCMDS; ++i) {
1899 + if (ha->cmndinfo[i].index == 0) {
1900 + priv = &ha->cmndinfo[i];
1901 +- priv->index = i+1;
1902 + memset(priv, 0, sizeof(*priv));
1903 ++ priv->index = i+1;
1904 + break;
1905 + }
1906 + }
1907 +@@ -494,7 +487,6 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
1908 + gdth_ha_str *ha = shost_priv(sdev->host);
1909 + Scsi_Cmnd *scp;
1910 + struct gdth_cmndinfo cmndinfo;
1911 +- struct scatterlist one_sg;
1912 + DECLARE_COMPLETION_ONSTACK(wait);
1913 + int rval;
1914 +
1915 +@@ -508,13 +500,10 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
1916 + /* use request field to save the ptr. to completion struct. */
1917 + scp->request = (struct request *)&wait;
1918 + scp->timeout_per_command = timeout*HZ;
1919 +- sg_init_one(&one_sg, gdtcmd, sizeof(*gdtcmd));
1920 +- gdth_set_sglist(scp, &one_sg);
1921 +- gdth_set_sg_count(scp, 1);
1922 +- gdth_set_bufflen(scp, sizeof(*gdtcmd));
1923 + scp->cmd_len = 12;
1924 + memcpy(scp->cmnd, cmnd, 12);
1925 + cmndinfo.priority = IOCTL_PRI;
1926 ++ cmndinfo.internal_cmd_str = gdtcmd;
1927 + cmndinfo.internal_command = 1;
1928 +
1929 + TRACE(("__gdth_execute() cmd 0x%x\n", scp->cmnd[0]));
1930 +@@ -2355,7 +2344,7 @@ static void gdth_next(gdth_ha_str *ha)
1931 + * buffers, kmap_atomic() as needed.
1932 + */
1933 + static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
1934 +- char *buffer, ushort count, int to_buffer)
1935 ++ char *buffer, ushort count)
1936 + {
1937 + ushort cpcount,i, max_sg = gdth_sg_count(scp);
1938 + ushort cpsum,cpnow;
1939 +@@ -2381,10 +2370,7 @@ static void gdth_copy_internal_data(gdth_ha_str *ha, Scsi_Cmnd *scp,
1940 + }
1941 + local_irq_save(flags);
1942 + address = kmap_atomic(sg_page(sl), KM_BIO_SRC_IRQ) + sl->offset;
1943 +- if (to_buffer)
1944 +- memcpy(buffer, address, cpnow);
1945 +- else
1946 +- memcpy(address, buffer, cpnow);
1947 ++ memcpy(address, buffer, cpnow);
1948 + flush_dcache_page(sg_page(sl));
1949 + kunmap_atomic(address, KM_BIO_SRC_IRQ);
1950 + local_irq_restore(flags);
1951 +@@ -2438,7 +2424,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1952 + strcpy(inq.vendor,ha->oem_name);
1953 + sprintf(inq.product,"Host Drive #%02d",t);
1954 + strcpy(inq.revision," ");
1955 +- gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data), 0);
1956 ++ gdth_copy_internal_data(ha, scp, (char*)&inq, sizeof(gdth_inq_data));
1957 + break;
1958 +
1959 + case REQUEST_SENSE:
1960 +@@ -2448,7 +2434,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1961 + sd.key = NO_SENSE;
1962 + sd.info = 0;
1963 + sd.add_length= 0;
1964 +- gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data), 0);
1965 ++ gdth_copy_internal_data(ha, scp, (char*)&sd, sizeof(gdth_sense_data));
1966 + break;
1967 +
1968 + case MODE_SENSE:
1969 +@@ -2460,7 +2446,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1970 + mpd.bd.block_length[0] = (SECTOR_SIZE & 0x00ff0000) >> 16;
1971 + mpd.bd.block_length[1] = (SECTOR_SIZE & 0x0000ff00) >> 8;
1972 + mpd.bd.block_length[2] = (SECTOR_SIZE & 0x000000ff);
1973 +- gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data), 0);
1974 ++ gdth_copy_internal_data(ha, scp, (char*)&mpd, sizeof(gdth_modep_data));
1975 + break;
1976 +
1977 + case READ_CAPACITY:
1978 +@@ -2470,7 +2456,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1979 + else
1980 + rdc.last_block_no = cpu_to_be32(ha->hdr[t].size-1);
1981 + rdc.block_length = cpu_to_be32(SECTOR_SIZE);
1982 +- gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data), 0);
1983 ++ gdth_copy_internal_data(ha, scp, (char*)&rdc, sizeof(gdth_rdcap_data));
1984 + break;
1985 +
1986 + case SERVICE_ACTION_IN:
1987 +@@ -2482,7 +2468,7 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1988 + rdc16.last_block_no = cpu_to_be64(ha->hdr[t].size-1);
1989 + rdc16.block_length = cpu_to_be32(SECTOR_SIZE);
1990 + gdth_copy_internal_data(ha, scp, (char*)&rdc16,
1991 +- sizeof(gdth_rdcap16_data), 0);
1992 ++ sizeof(gdth_rdcap16_data));
1993 + } else {
1994 + scp->result = DID_ABORT << 16;
1995 + }
1996 +@@ -2852,6 +2838,7 @@ static int gdth_fill_raw_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, unchar b)
1997 + static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
1998 + {
1999 + register gdth_cmd_str *cmdp;
2000 ++ struct gdth_cmndinfo *cmndinfo = gdth_cmnd_priv(scp);
2001 + int cmd_index;
2002 +
2003 + cmdp= ha->pccb;
2004 +@@ -2860,7 +2847,7 @@ static int gdth_special_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp)
2005 + if (ha->type==GDT_EISA && ha->cmd_cnt>0)
2006 + return 0;
2007 +
2008 +- gdth_copy_internal_data(ha, scp, (char *)cmdp, sizeof(gdth_cmd_str), 1);
2009 ++ *cmdp = *cmndinfo->internal_cmd_str;
2010 + cmdp->RequestBuffer = scp;
2011 +
2012 + /* search free command index */
2013 +@@ -3793,6 +3780,8 @@ static void gdth_timeout(ulong data)
2014 + gdth_ha_str *ha;
2015 + ulong flags;
2016 +
2017 ++ BUG_ON(list_empty(&gdth_instances));
2018 ++
2019 + ha = list_first_entry(&gdth_instances, gdth_ha_str, list);
2020 + spin_lock_irqsave(&ha->smp_lock, flags);
2021 +
2022 +@@ -4668,45 +4657,6 @@ static void gdth_flush(gdth_ha_str *ha)
2023 + }
2024 + }
2025 +
2026 +-/* shutdown routine */
2027 +-static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
2028 +-{
2029 +- gdth_ha_str *ha;
2030 +-#ifndef __alpha__
2031 +- gdth_cmd_str gdtcmd;
2032 +- char cmnd[MAX_COMMAND_SIZE];
2033 +-#endif
2034 +-
2035 +- if (notifier_disabled)
2036 +- return NOTIFY_OK;
2037 +-
2038 +- TRACE2(("gdth_halt() event %d\n",(int)event));
2039 +- if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
2040 +- return NOTIFY_DONE;
2041 +-
2042 +- notifier_disabled = 1;
2043 +- printk("GDT-HA: Flushing all host drives .. ");
2044 +- list_for_each_entry(ha, &gdth_instances, list) {
2045 +- gdth_flush(ha);
2046 +-
2047 +-#ifndef __alpha__
2048 +- /* controller reset */
2049 +- memset(cmnd, 0xff, MAX_COMMAND_SIZE);
2050 +- gdtcmd.BoardNode = LOCALBOARD;
2051 +- gdtcmd.Service = CACHESERVICE;
2052 +- gdtcmd.OpCode = GDT_RESET;
2053 +- TRACE2(("gdth_halt(): reset controller %d\n", ha->hanum));
2054 +- gdth_execute(ha->shost, &gdtcmd, cmnd, 10, NULL);
2055 +-#endif
2056 +- }
2057 +- printk("Done.\n");
2058 +-
2059 +-#ifdef GDTH_STATISTICS
2060 +- del_timer(&gdth_timer);
2061 +-#endif
2062 +- return NOTIFY_OK;
2063 +-}
2064 +-
2065 + /* configure lun */
2066 + static int gdth_slave_configure(struct scsi_device *sdev)
2067 + {
2068 +@@ -5141,13 +5091,13 @@ static void gdth_remove_one(gdth_ha_str *ha)
2069 +
2070 + scsi_remove_host(shp);
2071 +
2072 ++ gdth_flush(ha);
2073 ++
2074 + if (ha->sdev) {
2075 + scsi_free_host_dev(ha->sdev);
2076 + ha->sdev = NULL;
2077 + }
2078 +
2079 +- gdth_flush(ha);
2080 +-
2081 + if (shp->irq)
2082 + free_irq(shp->irq,ha);
2083 +
2084 +@@ -5173,6 +5123,24 @@ static void gdth_remove_one(gdth_ha_str *ha)
2085 + scsi_host_put(shp);
2086 + }
2087 +
2088 ++static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
2089 ++{
2090 ++ gdth_ha_str *ha;
2091 ++
2092 ++ TRACE2(("gdth_halt() event %d\n", (int)event));
2093 ++ if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
2094 ++ return NOTIFY_DONE;
2095 ++
2096 ++ list_for_each_entry(ha, &gdth_instances, list)
2097 ++ gdth_flush(ha);
2098 ++
2099 ++ return NOTIFY_OK;
2100 ++}
2101 ++
2102 ++static struct notifier_block gdth_notifier = {
2103 ++ gdth_halt, NULL, 0
2104 ++};
2105 ++
2106 + static int __init gdth_init(void)
2107 + {
2108 + if (disable) {
2109 +@@ -5235,7 +5203,6 @@ static int __init gdth_init(void)
2110 + add_timer(&gdth_timer);
2111 + #endif
2112 + major = register_chrdev(0,"gdth", &gdth_fops);
2113 +- notifier_disabled = 0;
2114 + register_reboot_notifier(&gdth_notifier);
2115 + gdth_polling = FALSE;
2116 + return 0;
2117 +@@ -5245,14 +5212,15 @@ static void __exit gdth_exit(void)
2118 + {
2119 + gdth_ha_str *ha;
2120 +
2121 +- list_for_each_entry(ha, &gdth_instances, list)
2122 +- gdth_remove_one(ha);
2123 ++ unregister_chrdev(major, "gdth");
2124 ++ unregister_reboot_notifier(&gdth_notifier);
2125 +
2126 + #ifdef GDTH_STATISTICS
2127 +- del_timer(&gdth_timer);
2128 ++ del_timer_sync(&gdth_timer);
2129 + #endif
2130 +- unregister_chrdev(major,"gdth");
2131 +- unregister_reboot_notifier(&gdth_notifier);
2132 ++
2133 ++ list_for_each_entry(ha, &gdth_instances, list)
2134 ++ gdth_remove_one(ha);
2135 + }
2136 +
2137 + module_init(gdth_init);
2138 +diff --git a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h
2139 +index 1434c6b..26e4e92 100644
2140 +--- a/drivers/scsi/gdth.h
2141 ++++ b/drivers/scsi/gdth.h
2142 +@@ -915,6 +915,7 @@ typedef struct {
2143 + struct gdth_cmndinfo { /* per-command private info */
2144 + int index;
2145 + int internal_command; /* don't call scsi_done */
2146 ++ gdth_cmd_str *internal_cmd_str; /* crier for internal messages*/
2147 + dma_addr_t sense_paddr; /* sense dma-addr */
2148 + unchar priority;
2149 + int timeout;
2150 +diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
2151 +index de57734..ce0228e 100644
2152 +--- a/drivers/scsi/gdth_proc.c
2153 ++++ b/drivers/scsi/gdth_proc.c
2154 +@@ -694,15 +694,13 @@ static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, ulong64 paddr)
2155 + {
2156 + ulong flags;
2157 +
2158 +- spin_lock_irqsave(&ha->smp_lock, flags);
2159 +-
2160 + if (buf == ha->pscratch) {
2161 ++ spin_lock_irqsave(&ha->smp_lock, flags);
2162 + ha->scratch_busy = FALSE;
2163 ++ spin_unlock_irqrestore(&ha->smp_lock, flags);
2164 + } else {
2165 + pci_free_consistent(ha->pdev, size, buf, paddr);
2166 + }
2167 +-
2168 +- spin_unlock_irqrestore(&ha->smp_lock, flags);
2169 + }
2170 +
2171 + #ifdef GDTH_IOCTL_PROC
2172 +diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
2173 +index 5c5a9b2..f4e9c8d 100644
2174 +--- a/drivers/scsi/ips.c
2175 ++++ b/drivers/scsi/ips.c
2176 +@@ -1580,7 +1580,7 @@ ips_make_passthru(ips_ha_t *ha, struct scsi_cmnd *SC, ips_scb_t *scb, int intr)
2177 + METHOD_TRACE("ips_make_passthru", 1);
2178 +
2179 + scsi_for_each_sg(SC, sg, scsi_sg_count(SC), i)
2180 +- length += sg[i].length;
2181 ++ length += sg->length;
2182 +
2183 + if (length < sizeof (ips_passthru_t)) {
2184 + /* wrong size */
2185 +@@ -6842,13 +6842,10 @@ ips_register_scsi(int index)
2186 + if (request_irq(ha->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) {
2187 + IPS_PRINTK(KERN_WARNING, ha->pcidev,
2188 + "Unable to install interrupt handler\n");
2189 +- scsi_host_put(sh);
2190 +- return -1;
2191 ++ goto err_out_sh;
2192 + }
2193 +
2194 + kfree(oldha);
2195 +- ips_sh[index] = sh;
2196 +- ips_ha[index] = ha;
2197 +
2198 + /* Store away needed values for later use */
2199 + sh->io_port = ha->io_addr;
2200 +@@ -6867,10 +6864,21 @@ ips_register_scsi(int index)
2201 + sh->max_channel = ha->nbus - 1;
2202 + sh->can_queue = ha->max_cmds - 1;
2203 +
2204 +- scsi_add_host(sh, NULL);
2205 ++ if (scsi_add_host(sh, &ha->pcidev->dev))
2206 ++ goto err_out;
2207 ++
2208 ++ ips_sh[index] = sh;
2209 ++ ips_ha[index] = ha;
2210 ++
2211 + scsi_scan_host(sh);
2212 +
2213 + return 0;
2214 ++
2215 ++err_out:
2216 ++ free_irq(ha->pcidev->irq, ha);
2217 ++err_out_sh:
2218 ++ scsi_host_put(sh);
2219 ++ return -1;
2220 + }
2221 +
2222 + /*---------------------------------------------------------------------------*/
2223 +diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
2224 +index a9ac5b1..273728e 100644
2225 +--- a/drivers/scsi/scsi_lib.c
2226 ++++ b/drivers/scsi/scsi_lib.c
2227 +@@ -298,7 +298,6 @@ static int scsi_req_map_sg(struct request *rq, struct scatterlist *sgl,
2228 + page = sg_page(sg);
2229 + off = sg->offset;
2230 + len = sg->length;
2231 +- data_len += len;
2232 +
2233 + while (len > 0 && data_len > 0) {
2234 + /*
2235 +diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
2236 +index ff10808..e9d7959 100644
2237 +--- a/drivers/spi/atmel_spi.c
2238 ++++ b/drivers/spi/atmel_spi.c
2239 +@@ -85,6 +85,16 @@ static void cs_activate(struct atmel_spi *as, struct spi_device *spi)
2240 + unsigned gpio = (unsigned) spi->controller_data;
2241 + unsigned active = spi->mode & SPI_CS_HIGH;
2242 + u32 mr;
2243 ++ int i;
2244 ++ u32 csr;
2245 ++ u32 cpol = (spi->mode & SPI_CPOL) ? SPI_BIT(CPOL) : 0;
2246 ++
2247 ++ /* Make sure clock polarity is correct */
2248 ++ for (i = 0; i < spi->master->num_chipselect; i++) {
2249 ++ csr = spi_readl(as, CSR0 + 4 * i);
2250 ++ if ((csr ^ cpol) & SPI_BIT(CPOL))
2251 ++ spi_writel(as, CSR0 + 4 * i, csr ^ SPI_BIT(CPOL));
2252 ++ }
2253 +
2254 + mr = spi_readl(as, MR);
2255 + mr = SPI_BFINS(PCS, ~(1 << spi->chip_select), mr);
2256 +diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
2257 +index 1c2ab54..840e682 100644
2258 +--- a/drivers/spi/pxa2xx_spi.c
2259 ++++ b/drivers/spi/pxa2xx_spi.c
2260 +@@ -48,13 +48,19 @@ MODULE_LICENSE("GPL");
2261 + #define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK)
2262 + #define IS_DMA_ALIGNED(x) (((u32)(x)&0x07)==0)
2263 +
2264 +-/* for testing SSCR1 changes that require SSP restart, basically
2265 +- * everything except the service and interrupt enables */
2266 +-#define SSCR1_CHANGE_MASK (SSCR1_TTELP | SSCR1_TTE | SSCR1_EBCEI | SSCR1_SCFR \
2267 ++/*
2268 ++ * for testing SSCR1 changes that require SSP restart, basically
2269 ++ * everything except the service and interrupt enables, the pxa270 developer
2270 ++ * manual says only SSCR1_SCFR, SSCR1_SPH, SSCR1_SPO need to be in this
2271 ++ * list, but the PXA255 dev man says all bits without really meaning the
2272 ++ * service and interrupt enables
2273 ++ */
2274 ++#define SSCR1_CHANGE_MASK (SSCR1_TTELP | SSCR1_TTE | SSCR1_SCFR \
2275 + | SSCR1_ECRA | SSCR1_ECRB | SSCR1_SCLKDIR \
2276 +- | SSCR1_RWOT | SSCR1_TRAIL | SSCR1_PINTE \
2277 +- | SSCR1_STRF | SSCR1_EFWR |SSCR1_RFT \
2278 +- | SSCR1_TFT | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM)
2279 ++ | SSCR1_SFRMDIR | SSCR1_RWOT | SSCR1_TRAIL \
2280 ++ | SSCR1_IFS | SSCR1_STRF | SSCR1_EFWR \
2281 ++ | SSCR1_RFT | SSCR1_TFT | SSCR1_MWDS \
2282 ++ | SSCR1_SPH | SSCR1_SPO | SSCR1_LBM)
2283 +
2284 + #define DEFINE_SSP_REG(reg, off) \
2285 + static inline u32 read_##reg(void *p) { return __raw_readl(p + (off)); } \
2286 +@@ -961,9 +967,6 @@ static void pump_transfers(unsigned long data)
2287 + if (drv_data->ssp_type == PXA25x_SSP)
2288 + DCMD(drv_data->tx_channel) |= DCMD_ENDIRQEN;
2289 +
2290 +- /* Fix me, need to handle cs polarity */
2291 +- drv_data->cs_control(PXA2XX_CS_ASSERT);
2292 +-
2293 + /* Clear status and start DMA engine */
2294 + cr1 = chip->cr1 | dma_thresh | drv_data->dma_cr1;
2295 + write_SSSR(drv_data->clear_sr, reg);
2296 +@@ -973,9 +976,6 @@ static void pump_transfers(unsigned long data)
2297 + /* Ensure we have the correct interrupt handler */
2298 + drv_data->transfer_handler = interrupt_transfer;
2299 +
2300 +- /* Fix me, need to handle cs polarity */
2301 +- drv_data->cs_control(PXA2XX_CS_ASSERT);
2302 +-
2303 + /* Clear status */
2304 + cr1 = chip->cr1 | chip->threshold | drv_data->int_cr1;
2305 + write_SSSR(drv_data->clear_sr, reg);
2306 +@@ -986,16 +986,29 @@ static void pump_transfers(unsigned long data)
2307 + || (read_SSCR1(reg) & SSCR1_CHANGE_MASK) !=
2308 + (cr1 & SSCR1_CHANGE_MASK)) {
2309 +
2310 ++ /* stop the SSP, and update the other bits */
2311 + write_SSCR0(cr0 & ~SSCR0_SSE, reg);
2312 + if (drv_data->ssp_type != PXA25x_SSP)
2313 + write_SSTO(chip->timeout, reg);
2314 +- write_SSCR1(cr1, reg);
2315 ++ /* first set CR1 without interrupt and service enables */
2316 ++ write_SSCR1(cr1 & SSCR1_CHANGE_MASK, reg);
2317 ++ /* restart the SSP */
2318 + write_SSCR0(cr0, reg);
2319 ++
2320 + } else {
2321 + if (drv_data->ssp_type != PXA25x_SSP)
2322 + write_SSTO(chip->timeout, reg);
2323 +- write_SSCR1(cr1, reg);
2324 + }
2325 ++
2326 ++ /* FIXME, need to handle cs polarity,
2327 ++ * this driver uses struct pxa2xx_spi_chip.cs_control to
2328 ++ * specify a CS handling function, and it ignores most
2329 ++ * struct spi_device.mode[s], including SPI_CS_HIGH */
2330 ++ drv_data->cs_control(PXA2XX_CS_ASSERT);
2331 ++
2332 ++ /* after chip select, release the data by enabling service
2333 ++ * requests and interrupts, without changing any mode bits */
2334 ++ write_SSCR1(cr1, reg);
2335 + }
2336 +
2337 + static void pump_messages(struct work_struct *work)
2338 +diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
2339 +index b10f39c..d1df9e9 100644
2340 +--- a/drivers/usb/host/ehci-q.c
2341 ++++ b/drivers/usb/host/ehci-q.c
2342 +@@ -315,10 +315,10 @@ qh_completions (struct ehci_hcd *ehci, struct ehci_qh *qh)
2343 + if (likely (last->urb != urb)) {
2344 + ehci_urb_done(ehci, last->urb, last_status);
2345 + count++;
2346 ++ last_status = -EINPROGRESS;
2347 + }
2348 + ehci_qtd_free (ehci, last);
2349 + last = NULL;
2350 +- last_status = -EINPROGRESS;
2351 + }
2352 +
2353 + /* ignore urbs submitted during completions we reported */
2354 +diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
2355 +index 1382af9..c04beac 100644
2356 +--- a/drivers/usb/serial/ftdi_sio.c
2357 ++++ b/drivers/usb/serial/ftdi_sio.c
2358 +@@ -310,6 +310,7 @@ struct ftdi_sio_quirk {
2359 + };
2360 +
2361 + static int ftdi_olimex_probe (struct usb_serial *serial);
2362 ++static int ftdi_mtxorb_hack_setup (struct usb_serial *serial);
2363 + static void ftdi_USB_UIRT_setup (struct ftdi_private *priv);
2364 + static void ftdi_HE_TIRA1_setup (struct ftdi_private *priv);
2365 +
2366 +@@ -317,6 +318,10 @@ static struct ftdi_sio_quirk ftdi_olimex_quirk = {
2367 + .probe = ftdi_olimex_probe,
2368 + };
2369 +
2370 ++static struct ftdi_sio_quirk ftdi_mtxorb_hack_quirk = {
2371 ++ .probe = ftdi_mtxorb_hack_setup,
2372 ++};
2373 ++
2374 + static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
2375 + .port_probe = ftdi_USB_UIRT_setup,
2376 + };
2377 +@@ -379,6 +384,8 @@ static struct usb_device_id id_table_combined [] = {
2378 + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) },
2379 + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) },
2380 + { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
2381 ++ { USB_DEVICE(MTXORB_VK_VID, MTXORB_VK_PID),
2382 ++ .driver_info = (kernel_ulong_t)&ftdi_mtxorb_hack_quirk },
2383 + { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
2384 + { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
2385 + { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
2386 +@@ -492,6 +499,7 @@ static struct usb_device_id id_table_combined [] = {
2387 + { USB_DEVICE(FTDI_VID, FTDI_ELV_FS20SIG_PID) },
2388 + { USB_DEVICE(FTDI_VID, FTDI_ELV_WS300PC_PID) },
2389 + { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1300PC_PID) },
2390 ++ { USB_DEVICE(FTDI_VID, FTDI_ELV_EM1010PC_PID) },
2391 + { USB_DEVICE(FTDI_VID, FTDI_ELV_WS500_PID) },
2392 + { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) },
2393 + { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) },
2394 +@@ -1301,6 +1309,23 @@ static int ftdi_olimex_probe(struct usb_serial *serial)
2395 + return 0;
2396 + }
2397 +
2398 ++/*
2399 ++ * The Matrix Orbital VK204-25-USB has an invalid IN endpoint.
2400 ++ * We have to correct it if we want to read from it.
2401 ++ */
2402 ++static int ftdi_mtxorb_hack_setup(struct usb_serial *serial)
2403 ++{
2404 ++ struct usb_host_endpoint *ep = serial->dev->ep_in[1];
2405 ++ struct usb_endpoint_descriptor *ep_desc = &ep->desc;
2406 ++
2407 ++ if (ep->enabled && ep_desc->wMaxPacketSize == 0) {
2408 ++ ep_desc->wMaxPacketSize = 0x40;
2409 ++ info("Fixing invalid wMaxPacketSize on read pipe");
2410 ++ }
2411 ++
2412 ++ return 0;
2413 ++}
2414 ++
2415 + /* ftdi_shutdown is called from usbserial:usb_serial_disconnect
2416 + * it is called when the usb device is disconnected
2417 + *
2418 +diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
2419 +index f6053da..893b429 100644
2420 +--- a/drivers/usb/serial/ftdi_sio.h
2421 ++++ b/drivers/usb/serial/ftdi_sio.h
2422 +@@ -98,6 +98,13 @@
2423 + #define FTDI_MTXORB_5_PID 0xFA05 /* Matrix Orbital Product Id */
2424 + #define FTDI_MTXORB_6_PID 0xFA06 /* Matrix Orbital Product Id */
2425 +
2426 ++/*
2427 ++ * The following are the values for the Matrix Orbital VK204-25-USB
2428 ++ * display, which use the FT232RL.
2429 ++ */
2430 ++#define MTXORB_VK_VID 0x1b3d
2431 ++#define MTXORB_VK_PID 0x0158
2432 ++
2433 + /* Interbiometrics USB I/O Board */
2434 + /* Developed for Interbiometrics by Rudolf Gugler */
2435 + #define INTERBIOMETRICS_VID 0x1209
2436 +diff --git a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c
2437 +index 889622b..45262f3 100644
2438 +--- a/drivers/usb/storage/protocol.c
2439 ++++ b/drivers/usb/storage/protocol.c
2440 +@@ -194,7 +194,7 @@ unsigned int usb_stor_access_xfer_buf(unsigned char *buffer,
2441 + * and the starting offset within the page, and update
2442 + * the *offset and *index values for the next loop. */
2443 + cnt = 0;
2444 +- while (cnt < buflen) {
2445 ++ while (cnt < buflen && sg) {
2446 + struct page *page = sg_page(sg) +
2447 + ((sg->offset + *offset) >> PAGE_SHIFT);
2448 + unsigned int poff =
2449 +@@ -249,7 +249,8 @@ void usb_stor_set_xfer_buf(unsigned char *buffer,
2450 + unsigned int offset = 0;
2451 + struct scatterlist *sg = NULL;
2452 +
2453 +- usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset,
2454 ++ buflen = min(buflen, srb->request_bufflen);
2455 ++ buflen = usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, &offset,
2456 + TO_XFER_BUF);
2457 + if (buflen < srb->request_bufflen)
2458 + srb->resid = srb->request_bufflen - buflen;
2459 +diff --git a/fs/aio.c b/fs/aio.c
2460 +index 9dec7d2..758f911 100644
2461 +--- a/fs/aio.c
2462 ++++ b/fs/aio.c
2463 +@@ -997,6 +997,14 @@ put_rq:
2464 + /* everything turned out well, dispose of the aiocb. */
2465 + ret = __aio_put_req(ctx, iocb);
2466 +
2467 ++ /*
2468 ++ * We have to order our ring_info tail store above and test
2469 ++ * of the wait list below outside the wait lock. This is
2470 ++ * like in wake_up_bit() where clearing a bit has to be
2471 ++ * ordered with the unlocked test.
2472 ++ */
2473 ++ smp_mb();
2474 ++
2475 + if (waitqueue_active(&ctx->wait))
2476 + wake_up(&ctx->wait);
2477 +
2478 +diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
2479 +index 32c5711..a985a8f 100644
2480 +--- a/fs/ecryptfs/mmap.c
2481 ++++ b/fs/ecryptfs/mmap.c
2482 +@@ -263,52 +263,102 @@ out:
2483 + return 0;
2484 + }
2485 +
2486 +-/* This function must zero any hole we create */
2487 ++/**
2488 ++ * ecryptfs_prepare_write
2489 ++ * @file: The eCryptfs file
2490 ++ * @page: The eCryptfs page
2491 ++ * @from: The start byte from which we will write
2492 ++ * @to: The end byte to which we will write
2493 ++ *
2494 ++ * This function must zero any hole we create
2495 ++ *
2496 ++ * Returns zero on success; non-zero otherwise
2497 ++ */
2498 + static int ecryptfs_prepare_write(struct file *file, struct page *page,
2499 + unsigned from, unsigned to)
2500 + {
2501 +- int rc = 0;
2502 + loff_t prev_page_end_size;
2503 ++ int rc = 0;
2504 +
2505 + if (!PageUptodate(page)) {
2506 +- rc = ecryptfs_read_lower_page_segment(page, page->index, 0,
2507 +- PAGE_CACHE_SIZE,
2508 +- page->mapping->host);
2509 +- if (rc) {
2510 +- printk(KERN_ERR "%s: Error attemping to read lower "
2511 +- "page segment; rc = [%d]\n", __FUNCTION__, rc);
2512 +- ClearPageUptodate(page);
2513 +- goto out;
2514 +- } else
2515 ++ struct ecryptfs_crypt_stat *crypt_stat =
2516 ++ &ecryptfs_inode_to_private(
2517 ++ file->f_path.dentry->d_inode)->crypt_stat;
2518 ++
2519 ++ if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)
2520 ++ || (crypt_stat->flags & ECRYPTFS_NEW_FILE)) {
2521 ++ rc = ecryptfs_read_lower_page_segment(
2522 ++ page, page->index, 0, PAGE_CACHE_SIZE,
2523 ++ page->mapping->host);
2524 ++ if (rc) {
2525 ++ printk(KERN_ERR "%s: Error attemping to read "
2526 ++ "lower page segment; rc = [%d]\n",
2527 ++ __FUNCTION__, rc);
2528 ++ ClearPageUptodate(page);
2529 ++ goto out;
2530 ++ } else
2531 ++ SetPageUptodate(page);
2532 ++ } else if (crypt_stat->flags & ECRYPTFS_VIEW_AS_ENCRYPTED) {
2533 ++ if (crypt_stat->flags & ECRYPTFS_METADATA_IN_XATTR) {
2534 ++ rc = ecryptfs_copy_up_encrypted_with_header(
2535 ++ page, crypt_stat);
2536 ++ if (rc) {
2537 ++ printk(KERN_ERR "%s: Error attempting "
2538 ++ "to copy the encrypted content "
2539 ++ "from the lower file whilst "
2540 ++ "inserting the metadata from "
2541 ++ "the xattr into the header; rc "
2542 ++ "= [%d]\n", __FUNCTION__, rc);
2543 ++ ClearPageUptodate(page);
2544 ++ goto out;
2545 ++ }
2546 ++ SetPageUptodate(page);
2547 ++ } else {
2548 ++ rc = ecryptfs_read_lower_page_segment(
2549 ++ page, page->index, 0, PAGE_CACHE_SIZE,
2550 ++ page->mapping->host);
2551 ++ if (rc) {
2552 ++ printk(KERN_ERR "%s: Error reading "
2553 ++ "page; rc = [%d]\n",
2554 ++ __FUNCTION__, rc);
2555 ++ ClearPageUptodate(page);
2556 ++ goto out;
2557 ++ }
2558 ++ SetPageUptodate(page);
2559 ++ }
2560 ++ } else {
2561 ++ rc = ecryptfs_decrypt_page(page);
2562 ++ if (rc) {
2563 ++ printk(KERN_ERR "%s: Error decrypting page "
2564 ++ "at index [%ld]; rc = [%d]\n",
2565 ++ __FUNCTION__, page->index, rc);
2566 ++ ClearPageUptodate(page);
2567 ++ goto out;
2568 ++ }
2569 + SetPageUptodate(page);
2570 ++ }
2571 + }
2572 +-
2573 + prev_page_end_size = ((loff_t)page->index << PAGE_CACHE_SHIFT);
2574 +-
2575 +- /*
2576 +- * If creating a page or more of holes, zero them out via truncate.
2577 +- * Note, this will increase i_size.
2578 +- */
2579 ++ /* If creating a page or more of holes, zero them out via truncate.
2580 ++ * Note, this will increase i_size. */
2581 + if (page->index != 0) {
2582 + if (prev_page_end_size > i_size_read(page->mapping->host)) {
2583 + rc = ecryptfs_truncate(file->f_path.dentry,
2584 + prev_page_end_size);
2585 + if (rc) {
2586 +- printk(KERN_ERR "Error on attempt to "
2587 ++ printk(KERN_ERR "%s: Error on attempt to "
2588 + "truncate to (higher) offset [%lld];"
2589 +- " rc = [%d]\n", prev_page_end_size, rc);
2590 ++ " rc = [%d]\n", __FUNCTION__,
2591 ++ prev_page_end_size, rc);
2592 + goto out;
2593 + }
2594 + }
2595 + }
2596 +- /*
2597 +- * Writing to a new page, and creating a small hole from start of page?
2598 +- * Zero it out.
2599 +- */
2600 +- if ((i_size_read(page->mapping->host) == prev_page_end_size) &&
2601 +- (from != 0)) {
2602 ++ /* Writing to a new page, and creating a small hole from start
2603 ++ * of page? Zero it out. */
2604 ++ if ((i_size_read(page->mapping->host) == prev_page_end_size)
2605 ++ && (from != 0))
2606 + zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
2607 +- }
2608 + out:
2609 + return rc;
2610 + }
2611 +diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
2612 +index 80d2f52..dcac591 100644
2613 +--- a/fs/fuse/dir.c
2614 ++++ b/fs/fuse/dir.c
2615 +@@ -905,7 +905,7 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd)
2616 + }
2617 +
2618 + if (fc->flags & FUSE_DEFAULT_PERMISSIONS) {
2619 +- int err = generic_permission(inode, mask, NULL);
2620 ++ err = generic_permission(inode, mask, NULL);
2621 +
2622 + /* If permission is denied, try to refresh file
2623 + attributes. This is also needed, because the root
2624 +diff --git a/fs/isofs/compress.c b/fs/isofs/compress.c
2625 +index 37dbd64..defb932 100644
2626 +--- a/fs/isofs/compress.c
2627 ++++ b/fs/isofs/compress.c
2628 +@@ -72,6 +72,17 @@ static int zisofs_readpage(struct file *file, struct page *page)
2629 + offset = index & ~zisofs_block_page_mask;
2630 + blockindex = offset >> zisofs_block_page_shift;
2631 + maxpage = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
2632 ++
2633 ++ /*
2634 ++ * If this page is wholly outside i_size we just return zero;
2635 ++ * do_generic_file_read() will handle this for us
2636 ++ */
2637 ++ if (page->index >= maxpage) {
2638 ++ SetPageUptodate(page);
2639 ++ unlock_page(page);
2640 ++ return 0;
2641 ++ }
2642 ++
2643 + maxpage = min(zisofs_block_pages, maxpage-offset);
2644 +
2645 + for ( i = 0 ; i < maxpage ; i++, offset++ ) {
2646 +diff --git a/fs/jbd/recovery.c b/fs/jbd/recovery.c
2647 +index c5d9694..9aaa4fa 100644
2648 +--- a/fs/jbd/recovery.c
2649 ++++ b/fs/jbd/recovery.c
2650 +@@ -478,7 +478,7 @@ static int do_one_pass(journal_t *journal,
2651 + memcpy(nbh->b_data, obh->b_data,
2652 + journal->j_blocksize);
2653 + if (flags & JFS_FLAG_ESCAPE) {
2654 +- *((__be32 *)bh->b_data) =
2655 ++ *((__be32 *)nbh->b_data) =
2656 + cpu_to_be32(JFS_MAGIC_NUMBER);
2657 + }
2658 +
2659 +diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
2660 +index d0ce627..fa0d4e9 100644
2661 +--- a/fs/jbd2/recovery.c
2662 ++++ b/fs/jbd2/recovery.c
2663 +@@ -488,7 +488,7 @@ static int do_one_pass(journal_t *journal,
2664 + memcpy(nbh->b_data, obh->b_data,
2665 + journal->j_blocksize);
2666 + if (flags & JBD2_FLAG_ESCAPE) {
2667 +- *((__be32 *)bh->b_data) =
2668 ++ *((__be32 *)nbh->b_data) =
2669 + cpu_to_be32(JBD2_MAGIC_NUMBER);
2670 + }
2671 +
2672 +diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
2673 +index 468f17a..429cec2 100644
2674 +--- a/fs/nfsd/nfsfh.c
2675 ++++ b/fs/nfsd/nfsfh.c
2676 +@@ -231,6 +231,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
2677 + fhp->fh_dentry = dentry;
2678 + fhp->fh_export = exp;
2679 + nfsd_nr_verified++;
2680 ++ cache_get(&exp->h);
2681 + } else {
2682 + /*
2683 + * just rechecking permissions
2684 +@@ -240,6 +241,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
2685 + dprintk("nfsd: fh_verify - just checking\n");
2686 + dentry = fhp->fh_dentry;
2687 + exp = fhp->fh_export;
2688 ++ cache_get(&exp->h);
2689 + /*
2690 + * Set user creds for this exportpoint; necessary even
2691 + * in the "just checking" case because this may be a
2692 +@@ -251,8 +253,6 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
2693 + if (error)
2694 + goto out;
2695 + }
2696 +- cache_get(&exp->h);
2697 +-
2698 +
2699 + error = nfsd_mode_check(rqstp, dentry->d_inode->i_mode, type);
2700 + if (error)
2701 +diff --git a/fs/ufs/util.h b/fs/ufs/util.h
2702 +index b26fc4d..23ceed8 100644
2703 +--- a/fs/ufs/util.h
2704 ++++ b/fs/ufs/util.h
2705 +@@ -58,7 +58,7 @@ ufs_set_fs_state(struct super_block *sb, struct ufs_super_block_first *usb1,
2706 + {
2707 + switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
2708 + case UFS_ST_SUNOS:
2709 +- if (fs32_to_cpu(sb, usb3->fs_postblformat == UFS_42POSTBLFMT)) {
2710 ++ if (fs32_to_cpu(sb, usb3->fs_postblformat) == UFS_42POSTBLFMT) {
2711 + usb1->fs_u0.fs_sun.fs_state = cpu_to_fs32(sb, value);
2712 + break;
2713 + }
2714 +diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
2715 +index 1bd398d..c12c294 100644
2716 +--- a/include/asm-arm/arch-pxa/pxa-regs.h
2717 ++++ b/include/asm-arm/arch-pxa/pxa-regs.h
2718 +@@ -1669,6 +1669,7 @@
2719 + #define SSCR1_RSRE (1 << 20) /* Receive Service Request Enable */
2720 + #define SSCR1_TINTE (1 << 19) /* Receiver Time-out Interrupt enable */
2721 + #define SSCR1_PINTE (1 << 18) /* Peripheral Trailing Byte Interupt Enable */
2722 ++#define SSCR1_IFS (1 << 16) /* Invert Frame Signal */
2723 + #define SSCR1_STRF (1 << 15) /* Select FIFO or EFWR */
2724 + #define SSCR1_EFWR (1 << 14) /* Enable FIFO Write/Read */
2725 +
2726 +diff --git a/include/asm-x86/apic_32.h b/include/asm-x86/apic_32.h
2727 +index be158b2..04fbe7f 100644
2728 +--- a/include/asm-x86/apic_32.h
2729 ++++ b/include/asm-x86/apic_32.h
2730 +@@ -109,7 +109,7 @@ extern void setup_boot_APIC_clock (void);
2731 + extern void setup_secondary_APIC_clock (void);
2732 + extern int APIC_init_uniprocessor (void);
2733 +
2734 +-extern void enable_NMI_through_LVT0 (void * dummy);
2735 ++extern void enable_NMI_through_LVT0(void);
2736 +
2737 + #define ARCH_APICTIMER_STOPS_ON_C3 1
2738 +
2739 +diff --git a/include/asm-x86/futex_32.h b/include/asm-x86/futex_32.h
2740 +index 438ef0e..80964fd 100644
2741 +--- a/include/asm-x86/futex_32.h
2742 ++++ b/include/asm-x86/futex_32.h
2743 +@@ -28,7 +28,7 @@
2744 + "1: movl %2, %0\n\
2745 + movl %0, %3\n" \
2746 + insn "\n" \
2747 +-"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\
2748 ++"2: lock ; cmpxchgl %3, %2\n\
2749 + jnz 1b\n\
2750 + 3: .section .fixup,\"ax\"\n\
2751 + 4: mov %5, %1\n\
2752 +@@ -68,7 +68,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
2753 + #endif
2754 + switch (op) {
2755 + case FUTEX_OP_ADD:
2756 +- __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret,
2757 ++ __futex_atomic_op1("lock ; xaddl %0, %2", ret,
2758 + oldval, uaddr, oparg);
2759 + break;
2760 + case FUTEX_OP_OR:
2761 +@@ -111,7 +111,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
2762 + return -EFAULT;
2763 +
2764 + __asm__ __volatile__(
2765 +- "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n"
2766 ++ "1: lock ; cmpxchgl %3, %1 \n"
2767 +
2768 + "2: .section .fixup, \"ax\" \n"
2769 + "3: mov %2, %0 \n"
2770 +diff --git a/include/asm-x86/futex_64.h b/include/asm-x86/futex_64.h
2771 +index 5cdfb08..423c051 100644
2772 +--- a/include/asm-x86/futex_64.h
2773 ++++ b/include/asm-x86/futex_64.h
2774 +@@ -27,7 +27,7 @@
2775 + "1: movl %2, %0\n\
2776 + movl %0, %3\n" \
2777 + insn "\n" \
2778 +-"2: " LOCK_PREFIX "cmpxchgl %3, %2\n\
2779 ++"2: lock ; cmpxchgl %3, %2\n\
2780 + jnz 1b\n\
2781 + 3: .section .fixup,\"ax\"\n\
2782 + 4: mov %5, %1\n\
2783 +@@ -62,7 +62,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
2784 + __futex_atomic_op1("xchgl %0, %2", ret, oldval, uaddr, oparg);
2785 + break;
2786 + case FUTEX_OP_ADD:
2787 +- __futex_atomic_op1(LOCK_PREFIX "xaddl %0, %2", ret, oldval,
2788 ++ __futex_atomic_op1("lock ; xaddl %0, %2", ret, oldval,
2789 + uaddr, oparg);
2790 + break;
2791 + case FUTEX_OP_OR:
2792 +@@ -101,7 +101,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
2793 + return -EFAULT;
2794 +
2795 + __asm__ __volatile__(
2796 +- "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n"
2797 ++ "1: lock ; cmpxchgl %3, %1 \n"
2798 +
2799 + "2: .section .fixup, \"ax\" \n"
2800 + "3: mov %2, %0 \n"
2801 +diff --git a/include/asm-x86/io_apic_64.h b/include/asm-x86/io_apic_64.h
2802 +index e2c1367..1913ad0 100644
2803 +--- a/include/asm-x86/io_apic_64.h
2804 ++++ b/include/asm-x86/io_apic_64.h
2805 +@@ -129,7 +129,7 @@ extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int);
2806 +
2807 + extern int sis_apic_bug; /* dummy */
2808 +
2809 +-void enable_NMI_through_LVT0 (void * dummy);
2810 ++void enable_NMI_through_LVT0(void);
2811 +
2812 + extern spinlock_t i8259A_lock;
2813 +
2814 +diff --git a/include/asm-x86/processor_32.h b/include/asm-x86/processor_32.h
2815 +index 13976b0..787ee2e 100644
2816 +--- a/include/asm-x86/processor_32.h
2817 ++++ b/include/asm-x86/processor_32.h
2818 +@@ -712,9 +712,10 @@ static inline unsigned int cpuid_edx(unsigned int op)
2819 + #define ASM_NOP6 K7_NOP6
2820 + #define ASM_NOP7 K7_NOP7
2821 + #define ASM_NOP8 K7_NOP8
2822 +-#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
2823 ++#elif (defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \
2824 + defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \
2825 +- defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)
2826 ++ defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4)) && \
2827 ++ !defined(CONFIG_X86_GENERIC)
2828 + #define ASM_NOP1 P6_NOP1
2829 + #define ASM_NOP2 P6_NOP2
2830 + #define ASM_NOP3 P6_NOP3
2831 +diff --git a/include/linux/Kbuild b/include/linux/Kbuild
2832 +index 4b32bb1..f30fa92 100644
2833 +--- a/include/linux/Kbuild
2834 ++++ b/include/linux/Kbuild
2835 +@@ -217,7 +217,6 @@ unifdef-y += i2o-dev.h
2836 + unifdef-y += icmp.h
2837 + unifdef-y += icmpv6.h
2838 + unifdef-y += if_addr.h
2839 +-unifdef-y += if_addrlabel.h
2840 + unifdef-y += if_arp.h
2841 + unifdef-y += if_bridge.h
2842 + unifdef-y += if_ec.h
2843 +diff --git a/include/linux/futex.h b/include/linux/futex.h
2844 +index 92d420f..e5f3b84 100644
2845 +--- a/include/linux/futex.h
2846 ++++ b/include/linux/futex.h
2847 +@@ -153,6 +153,7 @@ union futex_key {
2848 + #ifdef CONFIG_FUTEX
2849 + extern void exit_robust_list(struct task_struct *curr);
2850 + extern void exit_pi_state_list(struct task_struct *curr);
2851 ++extern int futex_cmpxchg_enabled;
2852 + #else
2853 + static inline void exit_robust_list(struct task_struct *curr)
2854 + {
2855 +diff --git a/include/linux/irq.h b/include/linux/irq.h
2856 +index 4669be0..1fc1cb8 100644
2857 +--- a/include/linux/irq.h
2858 ++++ b/include/linux/irq.h
2859 +@@ -367,6 +367,9 @@ set_irq_chained_handler(unsigned int irq,
2860 + __set_irq_handler(irq, handle, 1, NULL);
2861 + }
2862 +
2863 ++extern void set_irq_noprobe(unsigned int irq);
2864 ++extern void set_irq_probe(unsigned int irq);
2865 ++
2866 + /* Handle dynamic irq creation and destruction */
2867 + extern int create_irq(void);
2868 + extern void destroy_irq(unsigned int irq);
2869 +diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
2870 +index 13410b2..c1d64c2 100644
2871 +--- a/include/linux/moduleparam.h
2872 ++++ b/include/linux/moduleparam.h
2873 +@@ -62,6 +62,16 @@ struct kparam_array
2874 + void *elem;
2875 + };
2876 +
2877 ++/* On alpha, ia64 and ppc64 relocations to global data cannot go into
2878 ++ read-only sections (which is part of respective UNIX ABI on these
2879 ++ platforms). So 'const' makes no sense and even causes compile failures
2880 ++ with some compilers. */
2881 ++#if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64)
2882 ++#define __moduleparam_const
2883 ++#else
2884 ++#define __moduleparam_const const
2885 ++#endif
2886 ++
2887 + /* This is the fundamental function for registering boot/module
2888 + parameters. perm sets the visibility in sysfs: 000 means it's
2889 + not there, read bits mean it's readable, write bits mean it's
2890 +@@ -71,7 +81,7 @@ struct kparam_array
2891 + static int __param_perm_check_##name __attribute__((unused)) = \
2892 + BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \
2893 + static const char __param_str_##name[] = prefix #name; \
2894 +- static struct kernel_param const __param_##name \
2895 ++ static struct kernel_param __moduleparam_const __param_##name \
2896 + __attribute_used__ \
2897 + __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
2898 + = { __param_str_##name, perm, set, get, { arg } }
2899 +diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
2900 +index 70013c5..89cd011 100644
2901 +--- a/include/net/inet_sock.h
2902 ++++ b/include/net/inet_sock.h
2903 +@@ -175,7 +175,8 @@ extern void build_ehash_secret(void);
2904 + static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport,
2905 + const __be32 faddr, const __be16 fport)
2906 + {
2907 +- return jhash_2words((__force __u32) laddr ^ (__force __u32) faddr,
2908 ++ return jhash_3words((__force __u32) laddr,
2909 ++ (__force __u32) faddr,
2910 + ((__u32) lport) << 16 | (__force __u32)fport,
2911 + inet_ehash_secret);
2912 + }
2913 +diff --git a/kernel/futex.c b/kernel/futex.c
2914 +index 55d78b5..d166080 100644
2915 +--- a/kernel/futex.c
2916 ++++ b/kernel/futex.c
2917 +@@ -60,6 +60,8 @@
2918 +
2919 + #include "rtmutex_common.h"
2920 +
2921 ++int __read_mostly futex_cmpxchg_enabled;
2922 ++
2923 + #define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8)
2924 +
2925 + /*
2926 +@@ -466,6 +468,8 @@ void exit_pi_state_list(struct task_struct *curr)
2927 + struct futex_hash_bucket *hb;
2928 + union futex_key key;
2929 +
2930 ++ if (!futex_cmpxchg_enabled)
2931 ++ return;
2932 + /*
2933 + * We are a ZOMBIE and nobody can enqueue itself on
2934 + * pi_state_list anymore, but we have to be careful
2935 +@@ -1854,6 +1858,8 @@ asmlinkage long
2936 + sys_set_robust_list(struct robust_list_head __user *head,
2937 + size_t len)
2938 + {
2939 ++ if (!futex_cmpxchg_enabled)
2940 ++ return -ENOSYS;
2941 + /*
2942 + * The kernel knows only one size for now:
2943 + */
2944 +@@ -1878,6 +1884,9 @@ sys_get_robust_list(int pid, struct robust_list_head __user * __user *head_ptr,
2945 + struct robust_list_head __user *head;
2946 + unsigned long ret;
2947 +
2948 ++ if (!futex_cmpxchg_enabled)
2949 ++ return -ENOSYS;
2950 ++
2951 + if (!pid)
2952 + head = current->robust_list;
2953 + else {
2954 +@@ -1980,6 +1989,9 @@ void exit_robust_list(struct task_struct *curr)
2955 + unsigned long futex_offset;
2956 + int rc;
2957 +
2958 ++ if (!futex_cmpxchg_enabled)
2959 ++ return;
2960 ++
2961 + /*
2962 + * Fetch the list head (which was registered earlier, via
2963 + * sys_set_robust_list()):
2964 +@@ -2034,7 +2046,7 @@ void exit_robust_list(struct task_struct *curr)
2965 + long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
2966 + u32 __user *uaddr2, u32 val2, u32 val3)
2967 + {
2968 +- int ret;
2969 ++ int ret = -ENOSYS;
2970 + int cmd = op & FUTEX_CMD_MASK;
2971 + struct rw_semaphore *fshared = NULL;
2972 +
2973 +@@ -2062,13 +2074,16 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
2974 + ret = futex_wake_op(uaddr, fshared, uaddr2, val, val2, val3);
2975 + break;
2976 + case FUTEX_LOCK_PI:
2977 +- ret = futex_lock_pi(uaddr, fshared, val, timeout, 0);
2978 ++ if (futex_cmpxchg_enabled)
2979 ++ ret = futex_lock_pi(uaddr, fshared, val, timeout, 0);
2980 + break;
2981 + case FUTEX_UNLOCK_PI:
2982 +- ret = futex_unlock_pi(uaddr, fshared);
2983 ++ if (futex_cmpxchg_enabled)
2984 ++ ret = futex_unlock_pi(uaddr, fshared);
2985 + break;
2986 + case FUTEX_TRYLOCK_PI:
2987 +- ret = futex_lock_pi(uaddr, fshared, 0, timeout, 1);
2988 ++ if (futex_cmpxchg_enabled)
2989 ++ ret = futex_lock_pi(uaddr, fshared, 0, timeout, 1);
2990 + break;
2991 + default:
2992 + ret = -ENOSYS;
2993 +@@ -2123,8 +2138,29 @@ static struct file_system_type futex_fs_type = {
2994 +
2995 + static int __init init(void)
2996 + {
2997 +- int i = register_filesystem(&futex_fs_type);
2998 ++ u32 curval;
2999 ++ int i;
3000 ++
3001 ++ /*
3002 ++ * This will fail and we want it. Some arch implementations do
3003 ++ * runtime detection of the futex_atomic_cmpxchg_inatomic()
3004 ++ * functionality. We want to know that before we call in any
3005 ++ * of the complex code paths. Also we want to prevent
3006 ++ * registration of robust lists in that case. NULL is
3007 ++ * guaranteed to fault and we get -EFAULT on functional
3008 ++ * implementation, the non functional ones will return
3009 ++ * -ENOSYS.
3010 ++ */
3011 ++ curval = cmpxchg_futex_value_locked(NULL, 0, 0);
3012 ++ if (curval == -EFAULT)
3013 ++ futex_cmpxchg_enabled = 1;
3014 +
3015 ++ for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
3016 ++ plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
3017 ++ spin_lock_init(&futex_queues[i].lock);
3018 ++ }
3019 ++
3020 ++ i = register_filesystem(&futex_fs_type);
3021 + if (i)
3022 + return i;
3023 +
3024 +@@ -2134,10 +2170,6 @@ static int __init init(void)
3025 + return PTR_ERR(futex_mnt);
3026 + }
3027 +
3028 +- for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
3029 +- plist_head_init(&futex_queues[i].chain, &futex_queues[i].lock);
3030 +- spin_lock_init(&futex_queues[i].lock);
3031 +- }
3032 + return 0;
3033 + }
3034 + __initcall(init);
3035 +diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
3036 +index 8682c79..d95f79b 100644
3037 +--- a/kernel/futex_compat.c
3038 ++++ b/kernel/futex_compat.c
3039 +@@ -54,6 +54,9 @@ void compat_exit_robust_list(struct task_struct *curr)
3040 + compat_long_t futex_offset;
3041 + int rc;
3042 +
3043 ++ if (!futex_cmpxchg_enabled)
3044 ++ return;
3045 ++
3046 + /*
3047 + * Fetch the list head (which was registered earlier, via
3048 + * sys_set_robust_list()):
3049 +@@ -115,6 +118,9 @@ asmlinkage long
3050 + compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
3051 + compat_size_t len)
3052 + {
3053 ++ if (!futex_cmpxchg_enabled)
3054 ++ return -ENOSYS;
3055 ++
3056 + if (unlikely(len != sizeof(*head)))
3057 + return -EINVAL;
3058 +
3059 +@@ -130,6 +136,9 @@ compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
3060 + struct compat_robust_list_head __user *head;
3061 + unsigned long ret;
3062 +
3063 ++ if (!futex_cmpxchg_enabled)
3064 ++ return -ENOSYS;
3065 ++
3066 + if (!pid)
3067 + head = current->compat_robust_list;
3068 + else {
3069 +diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
3070 +index 465c69c..e4e1c99 100644
3071 +--- a/kernel/irq/chip.c
3072 ++++ b/kernel/irq/chip.c
3073 +@@ -607,3 +607,39 @@ set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
3074 + set_irq_chip(irq, chip);
3075 + __set_irq_handler(irq, handle, 0, name);
3076 + }
3077 ++
3078 ++void __init set_irq_noprobe(unsigned int irq)
3079 ++{
3080 ++ struct irq_desc *desc;
3081 ++ unsigned long flags;
3082 ++
3083 ++ if (irq >= NR_IRQS) {
3084 ++ printk(KERN_ERR "Trying to mark IRQ%d non-probeable\n", irq);
3085 ++
3086 ++ return;
3087 ++ }
3088 ++
3089 ++ desc = irq_desc + irq;
3090 ++
3091 ++ spin_lock_irqsave(&desc->lock, flags);
3092 ++ desc->status |= IRQ_NOPROBE;
3093 ++ spin_unlock_irqrestore(&desc->lock, flags);
3094 ++}
3095 ++
3096 ++void __init set_irq_probe(unsigned int irq)
3097 ++{
3098 ++ struct irq_desc *desc;
3099 ++ unsigned long flags;
3100 ++
3101 ++ if (irq >= NR_IRQS) {
3102 ++ printk(KERN_ERR "Trying to mark IRQ%d probeable\n", irq);
3103 ++
3104 ++ return;
3105 ++ }
3106 ++
3107 ++ desc = irq_desc + irq;
3108 ++
3109 ++ spin_lock_irqsave(&desc->lock, flags);
3110 ++ desc->status &= ~IRQ_NOPROBE;
3111 ++ spin_unlock_irqrestore(&desc->lock, flags);
3112 ++}
3113 +diff --git a/kernel/relay.c b/kernel/relay.c
3114 +index 7c03733..889102a 100644
3115 +--- a/kernel/relay.c
3116 ++++ b/kernel/relay.c
3117 +@@ -1072,7 +1072,7 @@ static int subbuf_splice_actor(struct file *in,
3118 + unsigned int flags,
3119 + int *nonpad_ret)
3120 + {
3121 +- unsigned int pidx, poff, total_len, subbuf_pages, ret;
3122 ++ unsigned int pidx, poff, total_len, subbuf_pages, nr_pages, ret;
3123 + struct rchan_buf *rbuf = in->private_data;
3124 + unsigned int subbuf_size = rbuf->chan->subbuf_size;
3125 + uint64_t pos = (uint64_t) *ppos;
3126 +@@ -1103,8 +1103,9 @@ static int subbuf_splice_actor(struct file *in,
3127 + subbuf_pages = rbuf->chan->alloc_size >> PAGE_SHIFT;
3128 + pidx = (read_start / PAGE_SIZE) % subbuf_pages;
3129 + poff = read_start & ~PAGE_MASK;
3130 ++ nr_pages = min_t(unsigned int, subbuf_pages, PIPE_BUFFERS);
3131 +
3132 +- for (total_len = 0; spd.nr_pages < subbuf_pages; spd.nr_pages++) {
3133 ++ for (total_len = 0; spd.nr_pages < nr_pages; spd.nr_pages++) {
3134 + unsigned int this_len, this_end, private;
3135 + unsigned int cur_pos = read_start + total_len;
3136 +
3137 +diff --git a/kernel/sched.c b/kernel/sched.c
3138 +index e76b11c..5ba5db9 100644
3139 +--- a/kernel/sched.c
3140 ++++ b/kernel/sched.c
3141 +@@ -4028,11 +4028,10 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
3142 + oldprio = p->prio;
3143 + on_rq = p->se.on_rq;
3144 + running = task_current(rq, p);
3145 +- if (on_rq) {
3146 ++ if (on_rq)
3147 + dequeue_task(rq, p, 0);
3148 +- if (running)
3149 +- p->sched_class->put_prev_task(rq, p);
3150 +- }
3151 ++ if (running)
3152 ++ p->sched_class->put_prev_task(rq, p);
3153 +
3154 + if (rt_prio(prio))
3155 + p->sched_class = &rt_sched_class;
3156 +@@ -4041,9 +4040,9 @@ void rt_mutex_setprio(struct task_struct *p, int prio)
3157 +
3158 + p->prio = prio;
3159 +
3160 ++ if (running)
3161 ++ p->sched_class->set_curr_task(rq);
3162 + if (on_rq) {
3163 +- if (running)
3164 +- p->sched_class->set_curr_task(rq);
3165 + enqueue_task(rq, p, 0);
3166 + /*
3167 + * Reschedule if we are currently running on this runqueue and
3168 +@@ -4339,18 +4338,17 @@ recheck:
3169 + update_rq_clock(rq);
3170 + on_rq = p->se.on_rq;
3171 + running = task_current(rq, p);
3172 +- if (on_rq) {
3173 ++ if (on_rq)
3174 + deactivate_task(rq, p, 0);
3175 +- if (running)
3176 +- p->sched_class->put_prev_task(rq, p);
3177 +- }
3178 ++ if (running)
3179 ++ p->sched_class->put_prev_task(rq, p);
3180 +
3181 + oldprio = p->prio;
3182 + __setscheduler(rq, p, policy, param->sched_priority);
3183 +
3184 ++ if (running)
3185 ++ p->sched_class->set_curr_task(rq);
3186 + if (on_rq) {
3187 +- if (running)
3188 +- p->sched_class->set_curr_task(rq);
3189 + activate_task(rq, p, 0);
3190 + /*
3191 + * Reschedule if we are currently running on this runqueue and
3192 +@@ -7110,19 +7108,17 @@ void sched_move_task(struct task_struct *tsk)
3193 + running = task_current(rq, tsk);
3194 + on_rq = tsk->se.on_rq;
3195 +
3196 +- if (on_rq) {
3197 ++ if (on_rq)
3198 + dequeue_task(rq, tsk, 0);
3199 +- if (unlikely(running))
3200 +- tsk->sched_class->put_prev_task(rq, tsk);
3201 +- }
3202 ++ if (unlikely(running))
3203 ++ tsk->sched_class->put_prev_task(rq, tsk);
3204 +
3205 + set_task_cfs_rq(tsk, task_cpu(tsk));
3206 +
3207 +- if (on_rq) {
3208 +- if (unlikely(running))
3209 +- tsk->sched_class->set_curr_task(rq);
3210 ++ if (unlikely(running))
3211 ++ tsk->sched_class->set_curr_task(rq);
3212 ++ if (on_rq)
3213 + enqueue_task(rq, tsk, 0);
3214 +- }
3215 +
3216 + done:
3217 + task_rq_unlock(rq, &flags);
3218 +diff --git a/kernel/sysctl.c b/kernel/sysctl.c
3219 +index e3e0ee3..397ff8c 100644
3220 +--- a/kernel/sysctl.c
3221 ++++ b/kernel/sysctl.c
3222 +@@ -306,7 +306,7 @@ static struct ctl_table kern_table[] = {
3223 + .procname = "sched_nr_migrate",
3224 + .data = &sysctl_sched_nr_migrate,
3225 + .maxlen = sizeof(unsigned int),
3226 +- .mode = 644,
3227 ++ .mode = 0644,
3228 + .proc_handler = &proc_dointvec,
3229 + },
3230 + #endif
3231 +diff --git a/mm/filemap.c b/mm/filemap.c
3232 +index 69430d2..76b036f 100644
3233 +--- a/mm/filemap.c
3234 ++++ b/mm/filemap.c
3235 +@@ -1725,21 +1725,27 @@ size_t iov_iter_copy_from_user(struct page *page,
3236 + }
3237 + EXPORT_SYMBOL(iov_iter_copy_from_user);
3238 +
3239 +-static void __iov_iter_advance_iov(struct iov_iter *i, size_t bytes)
3240 ++void iov_iter_advance(struct iov_iter *i, size_t bytes)
3241 + {
3242 ++ BUG_ON(i->count < bytes);
3243 ++
3244 + if (likely(i->nr_segs == 1)) {
3245 + i->iov_offset += bytes;
3246 ++ i->count -= bytes;
3247 + } else {
3248 + const struct iovec *iov = i->iov;
3249 + size_t base = i->iov_offset;
3250 +
3251 + /*
3252 + * The !iov->iov_len check ensures we skip over unlikely
3253 +- * zero-length segments.
3254 ++ * zero-length segments (without overruning the iovec).
3255 + */
3256 +- while (bytes || !iov->iov_len) {
3257 +- int copy = min(bytes, iov->iov_len - base);
3258 ++ while (bytes || unlikely(!iov->iov_len && i->count)) {
3259 ++ int copy;
3260 +
3261 ++ copy = min(bytes, iov->iov_len - base);
3262 ++ BUG_ON(!i->count || i->count < copy);
3263 ++ i->count -= copy;
3264 + bytes -= copy;
3265 + base += copy;
3266 + if (iov->iov_len == base) {
3267 +@@ -1751,14 +1757,6 @@ static void __iov_iter_advance_iov(struct iov_iter *i, size_t bytes)
3268 + i->iov_offset = base;
3269 + }
3270 + }
3271 +-
3272 +-void iov_iter_advance(struct iov_iter *i, size_t bytes)
3273 +-{
3274 +- BUG_ON(i->count < bytes);
3275 +-
3276 +- __iov_iter_advance_iov(i, bytes);
3277 +- i->count -= bytes;
3278 +-}
3279 + EXPORT_SYMBOL(iov_iter_advance);
3280 +
3281 + /*
3282 +diff --git a/mm/hugetlb.c b/mm/hugetlb.c
3283 +index 9c746cb..d95ce35 100644
3284 +--- a/mm/hugetlb.c
3285 ++++ b/mm/hugetlb.c
3286 +@@ -119,6 +119,7 @@ static void free_huge_page(struct page *page)
3287 + struct address_space *mapping;
3288 +
3289 + mapping = (struct address_space *) page_private(page);
3290 ++ set_page_private(page, 0);
3291 + BUG_ON(page_count(page));
3292 + INIT_LIST_HEAD(&page->lru);
3293 +
3294 +@@ -133,7 +134,6 @@ static void free_huge_page(struct page *page)
3295 + spin_unlock(&hugetlb_lock);
3296 + if (mapping)
3297 + hugetlb_put_quota(mapping, 1);
3298 +- set_page_private(page, 0);
3299 + }
3300 +
3301 + /*
3302 +diff --git a/mm/slab.c b/mm/slab.c
3303 +index ff31261..79c3be0 100644
3304 +--- a/mm/slab.c
3305 ++++ b/mm/slab.c
3306 +@@ -2961,11 +2961,10 @@ static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags)
3307 + struct array_cache *ac;
3308 + int node;
3309 +
3310 +- node = numa_node_id();
3311 +-
3312 ++retry:
3313 + check_irq_off();
3314 ++ node = numa_node_id();
3315 + ac = cpu_cache_get(cachep);
3316 +-retry:
3317 + batchcount = ac->batchcount;
3318 + if (!ac->touched && batchcount > BATCHREFILL_LIMIT) {
3319 + /*
3320 +diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
3321 +index 2726adc..e13cf5e 100644
3322 +--- a/net/bluetooth/hci_sysfs.c
3323 ++++ b/net/bluetooth/hci_sysfs.c
3324 +@@ -282,6 +282,7 @@ static void add_conn(struct work_struct *work)
3325 + int i;
3326 +
3327 + flush_workqueue(btdelconn);
3328 ++
3329 + if (device_add(&conn->dev) < 0) {
3330 + BT_ERR("Failed to register connection device");
3331 + return;
3332 +@@ -317,7 +318,6 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
3333 + INIT_WORK(&conn->work, add_conn);
3334 +
3335 + queue_work(btaddconn, &conn->work);
3336 +- schedule_work(&conn->work);
3337 + }
3338 +
3339 + static int __match_tty(struct device *dev, void *data)
3340 +@@ -354,7 +354,6 @@ void hci_conn_del_sysfs(struct hci_conn *conn)
3341 + INIT_WORK(&conn->work, del_conn);
3342 +
3343 + queue_work(btdelconn, &conn->work);
3344 +- schedule_work(&conn->work);
3345 + }
3346 +
3347 + int hci_register_sysfs(struct hci_dev *hdev)
3348 +@@ -408,6 +407,7 @@ int __init bt_sysfs_init(void)
3349 + err = -ENOMEM;
3350 + goto out;
3351 + }
3352 ++
3353 + btdelconn = create_singlethread_workqueue("btdelconn");
3354 + if (!btdelconn) {
3355 + err = -ENOMEM;
3356 +@@ -447,8 +447,12 @@ out:
3357 + void bt_sysfs_cleanup(void)
3358 + {
3359 + destroy_workqueue(btaddconn);
3360 ++
3361 + destroy_workqueue(btdelconn);
3362 ++
3363 + class_destroy(bt_class);
3364 ++
3365 + bus_unregister(&bt_bus);
3366 ++
3367 + platform_device_unregister(bt_platform);
3368 + }
3369 +diff --git a/net/bridge/netfilter/ebt_dnat.c b/net/bridge/netfilter/ebt_dnat.c
3370 +index 74262e9..1024511 100644
3371 +--- a/net/bridge/netfilter/ebt_dnat.c
3372 ++++ b/net/bridge/netfilter/ebt_dnat.c
3373 +@@ -20,8 +20,8 @@ static int ebt_target_dnat(struct sk_buff *skb, unsigned int hooknr,
3374 + {
3375 + struct ebt_nat_info *info = (struct ebt_nat_info *)data;
3376 +
3377 +- if (skb_make_writable(skb, 0))
3378 +- return NF_DROP;
3379 ++ if (!skb_make_writable(skb, 0))
3380 ++ return EBT_DROP;
3381 +
3382 + memcpy(eth_hdr(skb)->h_dest, info->mac, ETH_ALEN);
3383 + return info->target;
3384 +diff --git a/net/bridge/netfilter/ebt_redirect.c b/net/bridge/netfilter/ebt_redirect.c
3385 +index 422cb83..88afc34 100644
3386 +--- a/net/bridge/netfilter/ebt_redirect.c
3387 ++++ b/net/bridge/netfilter/ebt_redirect.c
3388 +@@ -21,8 +21,8 @@ static int ebt_target_redirect(struct sk_buff *skb, unsigned int hooknr,
3389 + {
3390 + struct ebt_redirect_info *info = (struct ebt_redirect_info *)data;
3391 +
3392 +- if (skb_make_writable(skb, 0))
3393 +- return NF_DROP;
3394 ++ if (!skb_make_writable(skb, 0))
3395 ++ return EBT_DROP;
3396 +
3397 + if (hooknr != NF_BR_BROUTING)
3398 + memcpy(eth_hdr(skb)->h_dest,
3399 +diff --git a/net/bridge/netfilter/ebt_snat.c b/net/bridge/netfilter/ebt_snat.c
3400 +index 425ac92..4c5a5a9 100644
3401 +--- a/net/bridge/netfilter/ebt_snat.c
3402 ++++ b/net/bridge/netfilter/ebt_snat.c
3403 +@@ -22,8 +22,8 @@ static int ebt_target_snat(struct sk_buff *skb, unsigned int hooknr,
3404 + {
3405 + struct ebt_nat_info *info = (struct ebt_nat_info *) data;
3406 +
3407 +- if (skb_make_writable(skb, 0))
3408 +- return NF_DROP;
3409 ++ if (!skb_make_writable(skb, 0))
3410 ++ return EBT_DROP;
3411 +
3412 + memcpy(eth_hdr(skb)->h_source, info->mac, ETH_ALEN);
3413 + if (!(info->target & NAT_ARP_BIT) &&
3414 +diff --git a/net/core/dev.c b/net/core/dev.c
3415 +index 0879f52..4d44372 100644
3416 +--- a/net/core/dev.c
3417 ++++ b/net/core/dev.c
3418 +@@ -1068,8 +1068,6 @@ int dev_close(struct net_device *dev)
3419 + */
3420 + call_netdevice_notifiers(NETDEV_GOING_DOWN, dev);
3421 +
3422 +- dev_deactivate(dev);
3423 +-
3424 + clear_bit(__LINK_STATE_START, &dev->state);
3425 +
3426 + /* Synchronize to scheduled poll. We cannot touch poll list,
3427 +@@ -1080,6 +1078,8 @@ int dev_close(struct net_device *dev)
3428 + */
3429 + smp_mb__after_clear_bit(); /* Commit netif_running(). */
3430 +
3431 ++ dev_deactivate(dev);
3432 ++
3433 + /*
3434 + * Call the device specific close. This cannot fail.
3435 + * Only if device is UP
3436 +@@ -2906,7 +2906,7 @@ int __dev_addr_add(struct dev_addr_list **list, int *count,
3437 + }
3438 + }
3439 +
3440 +- da = kmalloc(sizeof(*da), GFP_ATOMIC);
3441 ++ da = kzalloc(sizeof(*da), GFP_ATOMIC);
3442 + if (da == NULL)
3443 + return -ENOMEM;
3444 + memcpy(da->da_addr, addr, alen);
3445 +diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
3446 +index 82817e5..7794e17 100644
3447 +--- a/net/ipv4/ip_sockglue.c
3448 ++++ b/net/ipv4/ip_sockglue.c
3449 +@@ -514,11 +514,6 @@ static int do_ip_setsockopt(struct sock *sk, int level,
3450 + val &= ~3;
3451 + val |= inet->tos & 3;
3452 + }
3453 +- if (IPTOS_PREC(val) >= IPTOS_PREC_CRITIC_ECP &&
3454 +- !capable(CAP_NET_ADMIN)) {
3455 +- err = -EPERM;
3456 +- break;
3457 +- }
3458 + if (inet->tos != val) {
3459 + inet->tos = val;
3460 + sk->sk_priority = rt_tos2priority(val);
3461 +diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c
3462 +index 80cab8c..b284b4e 100644
3463 +--- a/net/ipv4/ipcomp.c
3464 ++++ b/net/ipv4/ipcomp.c
3465 +@@ -108,8 +108,11 @@ static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb)
3466 + const int cpu = get_cpu();
3467 + u8 *scratch = *per_cpu_ptr(ipcomp_scratches, cpu);
3468 + struct crypto_comp *tfm = *per_cpu_ptr(ipcd->tfms, cpu);
3469 +- int err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
3470 ++ int err;
3471 +
3472 ++ local_bh_disable();
3473 ++ err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
3474 ++ local_bh_enable();
3475 + if (err)
3476 + goto out;
3477 +
3478 +diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
3479 +index b8f7763..15dc11e 100644
3480 +--- a/net/ipv4/ipconfig.c
3481 ++++ b/net/ipv4/ipconfig.c
3482 +@@ -739,9 +739,9 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
3483 + printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
3484 + b->htype = dev->type; /* can cause undefined behavior */
3485 + }
3486 ++
3487 ++ /* server_ip and your_ip address are both already zero per RFC2131 */
3488 + b->hlen = dev->addr_len;
3489 +- b->your_ip = NONE;
3490 +- b->server_ip = NONE;
3491 + memcpy(b->hw_addr, dev->dev_addr, dev->addr_len);
3492 + b->secs = htons(jiffies_diff / HZ);
3493 + b->xid = d->xid;
3494 +diff --git a/net/ipv4/netfilter/arpt_mangle.c b/net/ipv4/netfilter/arpt_mangle.c
3495 +index 45fa4e2..3f4222b 100644
3496 +--- a/net/ipv4/netfilter/arpt_mangle.c
3497 ++++ b/net/ipv4/netfilter/arpt_mangle.c
3498 +@@ -19,7 +19,7 @@ target(struct sk_buff *skb,
3499 + unsigned char *arpptr;
3500 + int pln, hln;
3501 +
3502 +- if (skb_make_writable(skb, skb->len))
3503 ++ if (!skb_make_writable(skb, skb->len))
3504 + return NF_DROP;
3505 +
3506 + arp = arp_hdr(skb);
3507 +diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
3508 +index 14d64a3..16d0fb3 100644
3509 +--- a/net/ipv4/netfilter/ip_queue.c
3510 ++++ b/net/ipv4/netfilter/ip_queue.c
3511 +@@ -336,8 +336,8 @@ static int
3512 + ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
3513 + {
3514 + int diff;
3515 +- int err;
3516 + struct iphdr *user_iph = (struct iphdr *)v->payload;
3517 ++ struct sk_buff *nskb;
3518 +
3519 + if (v->data_len < sizeof(*user_iph))
3520 + return 0;
3521 +@@ -349,14 +349,16 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
3522 + if (v->data_len > 0xFFFF)
3523 + return -EINVAL;
3524 + if (diff > skb_tailroom(e->skb)) {
3525 +- err = pskb_expand_head(e->skb, 0,
3526 ++ nskb = skb_copy_expand(e->skb, 0,
3527 + diff - skb_tailroom(e->skb),
3528 + GFP_ATOMIC);
3529 +- if (err) {
3530 ++ if (!nskb) {
3531 + printk(KERN_WARNING "ip_queue: error "
3532 +- "in mangle, dropping packet: %d\n", -err);
3533 +- return err;
3534 ++ "in mangle, dropping packet\n");
3535 ++ return -ENOMEM;
3536 + }
3537 ++ kfree_skb(e->skb);
3538 ++ e->skb = nskb;
3539 + }
3540 + skb_put(e->skb, diff);
3541 + }
3542 +diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
3543 +index 2f59baa..5b4095b 100644
3544 +--- a/net/ipv6/ip6_output.c
3545 ++++ b/net/ipv6/ip6_output.c
3546 +@@ -593,7 +593,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
3547 + * or if the skb it not generated by a local socket. (This last
3548 + * check should be redundant, but it's free.)
3549 + */
3550 +- if (!np || np->pmtudisc >= IPV6_PMTUDISC_DO) {
3551 ++ if (!skb->local_df) {
3552 + skb->dev = skb->dst->dev;
3553 + icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
3554 + IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_FRAGFAILS);
3555 +@@ -1389,6 +1389,10 @@ int ip6_push_pending_frames(struct sock *sk)
3556 + tmp_skb->sk = NULL;
3557 + }
3558 +
3559 ++ /* Allow local fragmentation. */
3560 ++ if (np->pmtudisc < IPV6_PMTUDISC_DO)
3561 ++ skb->local_df = 1;
3562 ++
3563 + ipv6_addr_copy(final_dst, &fl->fl6_dst);
3564 + __skb_pull(skb, skb_network_header_len(skb));
3565 + if (opt && opt->opt_flen)
3566 +diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
3567 +index 5383b33..81941a1 100644
3568 +--- a/net/ipv6/ip6_tunnel.c
3569 ++++ b/net/ipv6/ip6_tunnel.c
3570 +@@ -550,6 +550,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
3571 + ip_rt_put(rt);
3572 + goto out;
3573 + }
3574 ++ skb2->dst = (struct dst_entry *)rt;
3575 + } else {
3576 + ip_rt_put(rt);
3577 + if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos,
3578 +diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
3579 +index 1c5b09f..f46c38f 100644
3580 +--- a/net/ipv6/ipcomp6.c
3581 ++++ b/net/ipv6/ipcomp6.c
3582 +@@ -146,7 +146,9 @@ static int ipcomp6_output(struct xfrm_state *x, struct sk_buff *skb)
3583 + scratch = *per_cpu_ptr(ipcomp6_scratches, cpu);
3584 + tfm = *per_cpu_ptr(ipcd->tfms, cpu);
3585 +
3586 ++ local_bh_disable();
3587 + err = crypto_comp_compress(tfm, start, plen, scratch, &dlen);
3588 ++ local_bh_enable();
3589 + if (err || (dlen + sizeof(*ipch)) >= plen) {
3590 + put_cpu();
3591 + goto out_ok;
3592 +diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
3593 +index e273605..710a04f 100644
3594 +--- a/net/ipv6/netfilter/ip6_queue.c
3595 ++++ b/net/ipv6/netfilter/ip6_queue.c
3596 +@@ -333,8 +333,8 @@ static int
3597 + ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
3598 + {
3599 + int diff;
3600 +- int err;
3601 + struct ipv6hdr *user_iph = (struct ipv6hdr *)v->payload;
3602 ++ struct sk_buff *nskb;
3603 +
3604 + if (v->data_len < sizeof(*user_iph))
3605 + return 0;
3606 +@@ -346,14 +346,16 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
3607 + if (v->data_len > 0xFFFF)
3608 + return -EINVAL;
3609 + if (diff > skb_tailroom(e->skb)) {
3610 +- err = pskb_expand_head(e->skb, 0,
3611 ++ nskb = skb_copy_expand(e->skb, 0,
3612 + diff - skb_tailroom(e->skb),
3613 + GFP_ATOMIC);
3614 +- if (err) {
3615 ++ if (!nskb) {
3616 + printk(KERN_WARNING "ip6_queue: OOM "
3617 + "in mangle, dropping packet\n");
3618 +- return err;
3619 ++ return -ENOMEM;
3620 + }
3621 ++ kfree_skb(e->skb);
3622 ++ e->skb = nskb;
3623 + }
3624 + skb_put(e->skb, diff);
3625 + }
3626 +diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
3627 +index 6569767..dc22909 100644
3628 +--- a/net/ipv6/xfrm6_output.c
3629 ++++ b/net/ipv6/xfrm6_output.c
3630 +@@ -34,7 +34,7 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb)
3631 + if (mtu < IPV6_MIN_MTU)
3632 + mtu = IPV6_MIN_MTU;
3633 +
3634 +- if (skb->len > mtu) {
3635 ++ if (!skb->local_df && skb->len > mtu) {
3636 + skb->dev = dst->dev;
3637 + icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
3638 + ret = -EMSGSIZE;
3639 +diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
3640 +index 2c7bd2e..dc43df1 100644
3641 +--- a/net/netfilter/nfnetlink_log.c
3642 ++++ b/net/netfilter/nfnetlink_log.c
3643 +@@ -594,7 +594,7 @@ nfulnl_log_packet(unsigned int pf,
3644 + /* FIXME: do we want to make the size calculation conditional based on
3645 + * what is actually present? way more branches and checks, but more
3646 + * memory efficient... */
3647 +- size = NLMSG_ALIGN(sizeof(struct nfgenmsg))
3648 ++ size = NLMSG_SPACE(sizeof(struct nfgenmsg))
3649 + + nla_total_size(sizeof(struct nfulnl_msg_packet_hdr))
3650 + + nla_total_size(sizeof(u_int32_t)) /* ifindex */
3651 + + nla_total_size(sizeof(u_int32_t)) /* ifindex */
3652 +diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
3653 +index 3ceeffc..7c3646c 100644
3654 +--- a/net/netfilter/nfnetlink_queue.c
3655 ++++ b/net/netfilter/nfnetlink_queue.c
3656 +@@ -353,7 +353,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
3657 +
3658 + QDEBUG("entered\n");
3659 +
3660 +- size = NLMSG_ALIGN(sizeof(struct nfgenmsg))
3661 ++ size = NLMSG_SPACE(sizeof(struct nfgenmsg))
3662 + + nla_total_size(sizeof(struct nfqnl_msg_packet_hdr))
3663 + + nla_total_size(sizeof(u_int32_t)) /* ifindex */
3664 + + nla_total_size(sizeof(u_int32_t)) /* ifindex */
3665 +@@ -616,8 +616,8 @@ err_out_put:
3666 + static int
3667 + nfqnl_mangle(void *data, int data_len, struct nfqnl_queue_entry *e)
3668 + {
3669 ++ struct sk_buff *nskb;
3670 + int diff;
3671 +- int err;
3672 +
3673 + diff = data_len - e->skb->len;
3674 + if (diff < 0) {
3675 +@@ -627,14 +627,16 @@ nfqnl_mangle(void *data, int data_len, struct nfqnl_queue_entry *e)
3676 + if (data_len > 0xFFFF)
3677 + return -EINVAL;
3678 + if (diff > skb_tailroom(e->skb)) {
3679 +- err = pskb_expand_head(e->skb, 0,
3680 ++ nskb = skb_copy_expand(e->skb, 0,
3681 + diff - skb_tailroom(e->skb),
3682 + GFP_ATOMIC);
3683 +- if (err) {
3684 ++ if (!nskb) {
3685 + printk(KERN_WARNING "nf_queue: OOM "
3686 + "in mangle, dropping packet\n");
3687 +- return err;
3688 ++ return -ENOMEM;
3689 + }
3690 ++ kfree_skb(e->skb);
3691 ++ e->skb = nskb;
3692 + }
3693 + skb_put(e->skb, diff);
3694 + }
3695 +diff --git a/net/netfilter/xt_time.c b/net/netfilter/xt_time.c
3696 +index f9c55dc..5222a97 100644
3697 +--- a/net/netfilter/xt_time.c
3698 ++++ b/net/netfilter/xt_time.c
3699 +@@ -95,8 +95,11 @@ static inline void localtime_2(struct xtm *r, time_t time)
3700 + */
3701 + r->dse = time / 86400;
3702 +
3703 +- /* 1970-01-01 (w=0) was a Thursday (4). */
3704 +- r->weekday = (4 + r->dse) % 7;
3705 ++ /*
3706 ++ * 1970-01-01 (w=0) was a Thursday (4).
3707 ++ * -1 and +1 map Sunday properly onto 7.
3708 ++ */
3709 ++ r->weekday = (4 + r->dse - 1) % 7 + 1;
3710 + }
3711 +
3712 + static void localtime_3(struct xtm *r, time_t time)
3713 +diff --git a/security/commoncap.c b/security/commoncap.c
3714 +index ea61bc7..e87422e 100644
3715 +--- a/security/commoncap.c
3716 ++++ b/security/commoncap.c
3717 +@@ -539,7 +539,7 @@ int cap_task_kill(struct task_struct *p, struct siginfo *info,
3718 + * allowed.
3719 + * We must preserve legacy signal behavior in this case.
3720 + */
3721 +- if (p->euid == 0 && p->uid == current->uid)
3722 ++ if (p->uid == current->uid)
3723 + return 0;
3724 +
3725 + /* sigcont is permitted within same session */
3726
3727 Deleted: genpatches-2.6/trunk/2.6.24/1700_moduleparam.patch
3728 ===================================================================
3729 --- genpatches-2.6/trunk/2.6.24/1700_moduleparam.patch 2008-03-22 18:40:03 UTC (rev 1272)
3730 +++ genpatches-2.6/trunk/2.6.24/1700_moduleparam.patch 2008-03-25 00:00:00 UTC (rev 1273)
3731 @@ -1,59 +0,0 @@
3732 -From: Ivan Kokshaysky <ink@×××××××××××××××××.ru>
3733 -Date: Wed, 13 Feb 2008 23:03:26 +0000 (-0800)
3734 -Subject: moduleparam: fix alpha, ia64 and ppc64 compile failures
3735 -X-Git-Tag: v2.6.25-rc2~57
3736 -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=91d35dd93e14c34539a8005183ea500f25caad02
3737 -
3738 -moduleparam: fix alpha, ia64 and ppc64 compile failures
3739 -
3740 -On alpha, ia64 and ppc64 only relocations to local data can go into
3741 -read-only sections. The vast majority of module parameters use the global
3742 -generic param_set_*/param_get_* functions, so the 'const' attribute for
3743 -struct kernel_param is not only useless, but it also causes compile
3744 -failures due to 'section type conflict' in those rare cases where
3745 -param_set/get are local functions.
3746 -
3747 -This fixes http://bugzilla.kernel.org/show_bug.cgi?id=8964
3748 -
3749 -Signed-off-by: Ivan Kokshaysky <ink@×××××××××××××××××.ru>
3750 -Cc: Richard Henderson <rth@×××××××.net>
3751 -Cc: "Luck, Tony" <tony.luck@×××××.com>
3752 -Cc: Anton Blanchard <anton@×××××.org>
3753 -Cc: Paul Mackerras <paulus@×××××.org>
3754 -Cc: Adrian Bunk <bunk@××××××.de>
3755 -Cc: Kamalesh Babulal <kamalesh@××××××××××××××.com>
3756 -Cc: Rusty Russell <rusty@××××××××××××.au>
3757 -Signed-off-by: Andrew Morton <akpm@××××××××××××××××.org>
3758 -Signed-off-by: Linus Torvalds <torvalds@××××××××××××××××.org>
3759 ----
3760 -
3761 -Index: linux-2.6.24-gentoo/include/linux/moduleparam.h
3762 -===================================================================
3763 ---- linux-2.6.24-gentoo.orig/include/linux/moduleparam.h
3764 -+++ linux-2.6.24-gentoo/include/linux/moduleparam.h
3765 -@@ -62,6 +62,16 @@ struct kparam_array
3766 - void *elem;
3767 - };
3768 -
3769 -+/* On alpha, ia64 and ppc64 relocations to global data cannot go into
3770 -+ read-only sections (which is part of respective UNIX ABI on these
3771 -+ platforms). So 'const' makes no sense and even causes compile failures
3772 -+ with some compilers. */
3773 -+#if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64)
3774 -+#define __moduleparam_const
3775 -+#else
3776 -+#define __moduleparam_const const
3777 -+#endif
3778 -+
3779 - /* This is the fundamental function for registering boot/module
3780 - parameters. perm sets the visibility in sysfs: 000 means it's
3781 - not there, read bits mean it's readable, write bits mean it's
3782 -@@ -71,7 +81,7 @@ struct kparam_array
3783 - static int __param_perm_check_##name __attribute__((unused)) = \
3784 - BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \
3785 - static const char __param_str_##name[] = prefix #name; \
3786 -- static struct kernel_param const __param_##name \
3787 -+ static struct kernel_param __moduleparam_const __param_##name \
3788 - __attribute_used__ \
3789 - __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
3790 - = { __param_str_##name, perm, set, get, { arg } }
3791
3792 Deleted: genpatches-2.6/trunk/2.6.24/1705_x86-clear-df.patch
3793 ===================================================================
3794 --- genpatches-2.6/trunk/2.6.24/1705_x86-clear-df.patch 2008-03-22 18:40:03 UTC (rev 1272)
3795 +++ genpatches-2.6/trunk/2.6.24/1705_x86-clear-df.patch 2008-03-25 00:00:00 UTC (rev 1273)
3796 @@ -1,13 +0,0 @@
3797 -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www/w3.porg/TR/html4/strict.dtd">
3798 -<!-- git web interface version 1.4.4.2.492.ga748, (C) 2005-2006, Kay Sievers <kay.sievers@××××.org>, Christian Gierke -->
3799 -<!-- git core binaries version 1.5.4.4 -->
3800 -<head>
3801 -<meta http-equiv="content-type" content="; charset=utf-8"/>
3802 -<meta name="generator" content="gitweb/1.4.4.2.492.ga748 git/1.5.4.4"/>
3803 -<meta name="robots" content="index, nofollow"/>
3804 -<meta http-equiv="refresh" content="0"/>
3805 -<title></title>
3806 -</head>
3807 -<body>
3808 -Generating...</body>
3809 -</html>
3810
3811 Deleted: genpatches-2.6/trunk/2.6.24/2000_no-if-addrlabel.patch
3812 ===================================================================
3813 --- genpatches-2.6/trunk/2.6.24/2000_no-if-addrlabel.patch 2008-03-22 18:40:03 UTC (rev 1272)
3814 +++ genpatches-2.6/trunk/2.6.24/2000_no-if-addrlabel.patch 2008-03-25 00:00:00 UTC (rev 1273)
3815 @@ -1,18 +0,0 @@
3816 -
3817 -From: Daniel Drake <dsd@g.o>
3818 -
3819 -2.6.24.3 added an unifdef entry for a header file that does not exist
3820 -in the 2.6.24 tree. Remove it.
3821 -
3822 -Index: linux-2.6.24-gentoo-r3/include/linux/Kbuild
3823 -===================================================================
3824 ---- linux-2.6.24-gentoo-r3.orig/include/linux/Kbuild
3825 -+++ linux-2.6.24-gentoo-r3/include/linux/Kbuild
3826 -@@ -217,7 +217,6 @@ unifdef-y += i2o-dev.h
3827 - unifdef-y += icmp.h
3828 - unifdef-y += icmpv6.h
3829 - unifdef-y += if_addr.h
3830 --unifdef-y += if_addrlabel.h
3831 - unifdef-y += if_arp.h
3832 - unifdef-y += if_bridge.h
3833 - unifdef-y += if_ec.h
3834
3835 Deleted: genpatches-2.6/trunk/2.6.24/2300_pci-use-conf1.patch
3836 ===================================================================
3837 --- genpatches-2.6/trunk/2.6.24/2300_pci-use-conf1.patch 2008-03-22 18:40:03 UTC (rev 1272)
3838 +++ genpatches-2.6/trunk/2.6.24/2300_pci-use-conf1.patch 2008-03-25 00:00:00 UTC (rev 1273)
3839 @@ -1,218 +0,0 @@
3840 -From: Ivan Kokshaysky <ink@×××××××××××××××××.ru>
3841 -Date: Mon, 14 Jan 2008 22:31:09 +0000 (-0500)
3842 -Subject: PCI x86: always use conf1 to access config space below 256 bytes
3843 -X-Git-Tag: v2.6.25-rc1~3
3844 -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=a0ca9909609470ad779b9b9cc68ce96e975afff7
3845 -
3846 -PCI x86: always use conf1 to access config space below 256 bytes
3847 -
3848 -Thanks to Loic Prylli <loic@××××.com>, who originally proposed
3849 -this idea.
3850 -
3851 -Always using legacy configuration mechanism for the legacy config space
3852 -and extended mechanism (mmconf) for the extended config space is
3853 -a simple and very logical approach. It's supposed to resolve all
3854 -known mmconf problems. It still allows per-device quirks (tweaking
3855 -dev->cfg_size). It also allows to get rid of mmconf fallback code.
3856 -
3857 -Signed-off-by: Ivan Kokshaysky <ink@×××××××××××××××××.ru>
3858 -Signed-off-by: Matthew Wilcox <willy@×××××××××××.com>
3859 -Signed-off-by: Linus Torvalds <torvalds@××××××××××××××××.org>
3860 ----
3861 -
3862 -diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
3863 -index 4df637e..6b521d3 100644
3864 ---- a/arch/x86/pci/mmconfig-shared.c
3865 -+++ b/arch/x86/pci/mmconfig-shared.c
3866 -@@ -22,42 +22,9 @@
3867 - #define MMCONFIG_APER_MIN (2 * 1024*1024)
3868 - #define MMCONFIG_APER_MAX (256 * 1024*1024)
3869 -
3870 --DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
3871 --
3872 - /* Indicate if the mmcfg resources have been placed into the resource table. */
3873 - static int __initdata pci_mmcfg_resources_inserted;
3874 -
3875 --/* K8 systems have some devices (typically in the builtin northbridge)
3876 -- that are only accessible using type1
3877 -- Normally this can be expressed in the MCFG by not listing them
3878 -- and assigning suitable _SEGs, but this isn't implemented in some BIOS.
3879 -- Instead try to discover all devices on bus 0 that are unreachable using MM
3880 -- and fallback for them. */
3881 --static void __init unreachable_devices(void)
3882 --{
3883 -- int i, bus;
3884 -- /* Use the max bus number from ACPI here? */
3885 -- for (bus = 0; bus < PCI_MMCFG_MAX_CHECK_BUS; bus++) {
3886 -- for (i = 0; i < 32; i++) {
3887 -- unsigned int devfn = PCI_DEVFN(i, 0);
3888 -- u32 val1, val2;
3889 --
3890 -- pci_conf1_read(0, bus, devfn, 0, 4, &val1);
3891 -- if (val1 == 0xffffffff)
3892 -- continue;
3893 --
3894 -- if (pci_mmcfg_arch_reachable(0, bus, devfn)) {
3895 -- raw_pci_ops->read(0, bus, devfn, 0, 4, &val2);
3896 -- if (val1 == val2)
3897 -- continue;
3898 -- }
3899 -- set_bit(i + 32 * bus, pci_mmcfg_fallback_slots);
3900 -- printk(KERN_NOTICE "PCI: No mmconfig possible on device"
3901 -- " %02x:%02x\n", bus, i);
3902 -- }
3903 -- }
3904 --}
3905 --
3906 - static const char __init *pci_mmcfg_e7520(void)
3907 - {
3908 - u32 win;
3909 -@@ -270,8 +237,6 @@ void __init pci_mmcfg_init(int type)
3910 - return;
3911 -
3912 - if (pci_mmcfg_arch_init()) {
3913 -- if (type == 1)
3914 -- unreachable_devices();
3915 - if (known_bridge)
3916 - pci_mmcfg_insert_resources(IORESOURCE_BUSY);
3917 - pci_probe = (pci_probe & ~PCI_PROBE_MASK) | PCI_PROBE_MMCONF;
3918 -diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c
3919 -index 1bf5816..7b75e65 100644
3920 ---- a/arch/x86/pci/mmconfig_32.c
3921 -+++ b/arch/x86/pci/mmconfig_32.c
3922 -@@ -30,10 +30,6 @@ static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn)
3923 - struct acpi_mcfg_allocation *cfg;
3924 - int cfg_num;
3925 -
3926 -- if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS &&
3927 -- test_bit(PCI_SLOT(devfn) + 32*bus, pci_mmcfg_fallback_slots))
3928 -- return 0;
3929 --
3930 - for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) {
3931 - cfg = &pci_mmcfg_config[cfg_num];
3932 - if (cfg->pci_segment == seg &&
3933 -@@ -68,13 +64,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
3934 - u32 base;
3935 -
3936 - if ((bus > 255) || (devfn > 255) || (reg > 4095)) {
3937 -- *value = -1;
3938 -+err: *value = -1;
3939 - return -EINVAL;
3940 - }
3941 -
3942 -+ if (reg < 256)
3943 -+ return pci_conf1_read(seg,bus,devfn,reg,len,value);
3944 -+
3945 - base = get_base_addr(seg, bus, devfn);
3946 - if (!base)
3947 -- return pci_conf1_read(seg,bus,devfn,reg,len,value);
3948 -+ goto err;
3949 -
3950 - spin_lock_irqsave(&pci_config_lock, flags);
3951 -
3952 -@@ -105,9 +104,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
3953 - if ((bus > 255) || (devfn > 255) || (reg > 4095))
3954 - return -EINVAL;
3955 -
3956 -+ if (reg < 256)
3957 -+ return pci_conf1_write(seg,bus,devfn,reg,len,value);
3958 -+
3959 - base = get_base_addr(seg, bus, devfn);
3960 - if (!base)
3961 -- return pci_conf1_write(seg,bus,devfn,reg,len,value);
3962 -+ return -EINVAL;
3963 -
3964 - spin_lock_irqsave(&pci_config_lock, flags);
3965 -
3966 -@@ -134,12 +136,6 @@ static struct pci_raw_ops pci_mmcfg = {
3967 - .write = pci_mmcfg_write,
3968 - };
3969 -
3970 --int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
3971 -- unsigned int devfn)
3972 --{
3973 -- return get_base_addr(seg, bus, devfn) != 0;
3974 --}
3975 --
3976 - int __init pci_mmcfg_arch_init(void)
3977 - {
3978 - printk(KERN_INFO "PCI: Using MMCONFIG\n");
3979 -diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c
3980 -index 4095e4d..c4cf318 100644
3981 ---- a/arch/x86/pci/mmconfig_64.c
3982 -+++ b/arch/x86/pci/mmconfig_64.c
3983 -@@ -40,9 +40,7 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus)
3984 - static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
3985 - {
3986 - char __iomem *addr;
3987 -- if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS &&
3988 -- test_bit(32*bus + PCI_SLOT(devfn), pci_mmcfg_fallback_slots))
3989 -- return NULL;
3990 -+
3991 - addr = get_virt(seg, bus);
3992 - if (!addr)
3993 - return NULL;
3994 -@@ -56,13 +54,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
3995 -
3996 - /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
3997 - if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) {
3998 -- *value = -1;
3999 -+err: *value = -1;
4000 - return -EINVAL;
4001 - }
4002 -
4003 -+ if (reg < 256)
4004 -+ return pci_conf1_read(seg,bus,devfn,reg,len,value);
4005 -+
4006 - addr = pci_dev_base(seg, bus, devfn);
4007 - if (!addr)
4008 -- return pci_conf1_read(seg,bus,devfn,reg,len,value);
4009 -+ goto err;
4010 -
4011 - switch (len) {
4012 - case 1:
4013 -@@ -88,9 +89,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
4014 - if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
4015 - return -EINVAL;
4016 -
4017 -+ if (reg < 256)
4018 -+ return pci_conf1_write(seg,bus,devfn,reg,len,value);
4019 -+
4020 - addr = pci_dev_base(seg, bus, devfn);
4021 - if (!addr)
4022 -- return pci_conf1_write(seg,bus,devfn,reg,len,value);
4023 -+ return -EINVAL;
4024 -
4025 - switch (len) {
4026 - case 1:
4027 -@@ -126,12 +130,6 @@ static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg)
4028 - return addr;
4029 - }
4030 -
4031 --int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
4032 -- unsigned int devfn)
4033 --{
4034 -- return pci_dev_base(seg, bus, devfn) != NULL;
4035 --}
4036 --
4037 - int __init pci_mmcfg_arch_init(void)
4038 - {
4039 - int i;
4040 -diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
4041 -index ac56d39..36cb44c 100644
4042 ---- a/arch/x86/pci/pci.h
4043 -+++ b/arch/x86/pci/pci.h
4044 -@@ -98,13 +98,6 @@ extern void pcibios_sort(void);
4045 -
4046 - /* pci-mmconfig.c */
4047 -
4048 --/* Verify the first 16 busses. We assume that systems with more busses
4049 -- get MCFG right. */
4050 --#define PCI_MMCFG_MAX_CHECK_BUS 16
4051 --extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS);
4052 --
4053 --extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus,
4054 -- unsigned int devfn);
4055 - extern int __init pci_mmcfg_arch_init(void);
4056 -
4057 - /*
4058
4059 Deleted: genpatches-2.6/trunk/2.6.24/2400_e1000e-crc-stripping.patch
4060 ===================================================================
4061 --- genpatches-2.6/trunk/2.6.24/2400_e1000e-crc-stripping.patch 2008-03-22 18:40:03 UTC (rev 1272)
4062 +++ genpatches-2.6/trunk/2.6.24/2400_e1000e-crc-stripping.patch 2008-03-25 00:00:00 UTC (rev 1273)
4063 @@ -1,41 +0,0 @@
4064 -From: Auke Kok <auke-jan.h.kok@×××××.com>
4065 -Date: Tue, 12 Feb 2008 23:20:24 +0000 (-0800)
4066 -Subject: e1000e: Fix CRC stripping in hardware context bug
4067 -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fjgarzik%2Fnetdev-2.6.git;a=commitdiff_plain;h=5918bd88effd0233a048983570ec5803f5f753dc
4068 -
4069 -e1000e: Fix CRC stripping in hardware context bug
4070 -
4071 -CRC stripping was only correctly enabled for packet split recieves
4072 -which is used when receiving jumbo frames. Correctly enable SECRC
4073 -also for normal buffer packet receives.
4074 -
4075 -Tested by Andy Gospodarek and Johan Andersson, see bugzilla #9940.
4076 -
4077 -Signed-off-by: Auke Kok <auke-jan.h.kok@×××××.com>
4078 -Signed-off-by: Jeff Garzik <jeff@××××××.org>
4079 ----
4080 -
4081 -diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
4082 -index b9b0d32..ea4ecc3 100644
4083 ---- a/drivers/net/e1000e/netdev.c
4084 -+++ b/drivers/net/e1000e/netdev.c
4085 -@@ -1690,6 +1690,9 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
4086 - else
4087 - rctl |= E1000_RCTL_LPE;
4088 -
4089 -+ /* Enable hardware CRC frame stripping */
4090 -+ rctl |= E1000_RCTL_SECRC;
4091 -+
4092 - /* Setup buffer sizes */
4093 - rctl &= ~E1000_RCTL_SZ_4096;
4094 - rctl |= E1000_RCTL_BSEX;
4095 -@@ -1755,9 +1758,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
4096 -
4097 - /* Enable Packet split descriptors */
4098 - rctl |= E1000_RCTL_DTYP_PS;
4099 --
4100 -- /* Enable hardware CRC frame stripping */
4101 -- rctl |= E1000_RCTL_SECRC;
4102 -
4103 - psrctl |= adapter->rx_ps_bsize0 >>
4104 - E1000_PSRCTL_BSIZE0_SHIFT;
4105
4106 Deleted: genpatches-2.6/trunk/2.6.24/2500_arcmsr-dma-coherent-warnings.patch
4107 ===================================================================
4108 --- genpatches-2.6/trunk/2.6.24/2500_arcmsr-dma-coherent-warnings.patch 2008-03-22 18:40:03 UTC (rev 1272)
4109 +++ genpatches-2.6/trunk/2.6.24/2500_arcmsr-dma-coherent-warnings.patch 2008-03-25 00:00:00 UTC (rev 1273)
4110 @@ -1,83 +0,0 @@
4111 -[PATCH] arcmsr: fix IRQs disabled warning spew
4112 -
4113 -As of 2.6.24, running the archttp passthrough daemon with the arcmsr
4114 -driver produces an endless spew of dma_free_coherent warnings:
4115 -
4116 - WARNING: at arch/x86/kernel/pci-dma_64.c:169 dma_free_coherent()
4117 -
4118 -It turns out that coherent memory is not needed, so commit 76d78300 by
4119 -Nick Cheng <nick.cheng@×××××××××.tw> switched it to kmalloc (as well as
4120 -making a lot of other changes which have not been included here).
4121 -
4122 -James Bottomley pointed out that the new kmalloc usage was also wrong,
4123 -I corrected this in commit 69e562c2.
4124 -
4125 -This patch combines both of the above for the purpose of fixing 2.6.24.
4126 -
4127 -Signed-off-by: Daniel Drake <dsd@g.o>
4128 -
4129 -Index: linux-2.6.24-gentoo/drivers/scsi/arcmsr/arcmsr_hba.c
4130 -===================================================================
4131 ---- linux-2.6.24-gentoo.orig/drivers/scsi/arcmsr/arcmsr_hba.c
4132 -+++ linux-2.6.24-gentoo/drivers/scsi/arcmsr/arcmsr_hba.c
4133 -@@ -1380,17 +1380,16 @@ static int arcmsr_iop_message_xfer(struc
4134 - switch(controlcode) {
4135 -
4136 - case ARCMSR_MESSAGE_READ_RQBUFFER: {
4137 -- unsigned long *ver_addr;
4138 -- dma_addr_t buf_handle;
4139 -+ unsigned char *ver_addr;
4140 - uint8_t *pQbuffer, *ptmpQbuffer;
4141 - int32_t allxfer_len = 0;
4142 -
4143 -- ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
4144 -+ ver_addr = kmalloc(1032, GFP_ATOMIC);
4145 - if (!ver_addr) {
4146 - retvalue = ARCMSR_MESSAGE_FAIL;
4147 - goto message_out;
4148 - }
4149 -- ptmpQbuffer = (uint8_t *) ver_addr;
4150 -+ ptmpQbuffer = ver_addr;
4151 - while ((acb->rqbuf_firstindex != acb->rqbuf_lastindex)
4152 - && (allxfer_len < 1031)) {
4153 - pQbuffer = &acb->rqbuffer[acb->rqbuf_firstindex];
4154 -@@ -1419,25 +1418,24 @@ static int arcmsr_iop_message_xfer(struc
4155 - }
4156 - arcmsr_iop_message_read(acb);
4157 - }
4158 -- memcpy(pcmdmessagefld->messagedatabuffer, (uint8_t *)ver_addr, allxfer_len);
4159 -+ memcpy(pcmdmessagefld->messagedatabuffer, ver_addr, allxfer_len);
4160 - pcmdmessagefld->cmdmessage.Length = allxfer_len;
4161 - pcmdmessagefld->cmdmessage.ReturnCode = ARCMSR_MESSAGE_RETURNCODE_OK;
4162 -- pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
4163 -+ kfree(ver_addr);
4164 - }
4165 - break;
4166 -
4167 - case ARCMSR_MESSAGE_WRITE_WQBUFFER: {
4168 -- unsigned long *ver_addr;
4169 -- dma_addr_t buf_handle;
4170 -+ unsigned char *ver_addr;
4171 - int32_t my_empty_len, user_len, wqbuf_firstindex, wqbuf_lastindex;
4172 - uint8_t *pQbuffer, *ptmpuserbuffer;
4173 -
4174 -- ver_addr = pci_alloc_consistent(acb->pdev, 1032, &buf_handle);
4175 -+ ver_addr = kmalloc(1032, GFP_ATOMIC);
4176 - if (!ver_addr) {
4177 - retvalue = ARCMSR_MESSAGE_FAIL;
4178 - goto message_out;
4179 - }
4180 -- ptmpuserbuffer = (uint8_t *)ver_addr;
4181 -+ ptmpuserbuffer = ver_addr;
4182 - user_len = pcmdmessagefld->cmdmessage.Length;
4183 - memcpy(ptmpuserbuffer, pcmdmessagefld->messagedatabuffer, user_len);
4184 - wqbuf_lastindex = acb->wqbuf_lastindex;
4185 -@@ -1483,7 +1481,7 @@ static int arcmsr_iop_message_xfer(struc
4186 - retvalue = ARCMSR_MESSAGE_FAIL;
4187 - }
4188 - }
4189 -- pci_free_consistent(acb->pdev, 1032, ver_addr, buf_handle);
4190 -+ kfree(ver_addr);
4191 - }
4192 - break;
4193 -
4194
4195 --
4196 gentoo-commits@l.g.o mailing list