/[linux-patches]/genpatches-2.6/tags/2.6.32-15/1013_linux-2.6.32.14.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.32-15/1013_linux-2.6.32.14.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1735 - (show annotations) (download)
Wed Aug 4 11:25:09 2010 UTC (4 years, 4 months ago) by mpagano
File size: 43154 byte(s)
2.6.32-15 release
1 diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
2 index 2c48f94..5c86fe9 100644
3 --- a/Documentation/filesystems/proc.txt
4 +++ b/Documentation/filesystems/proc.txt
5 @@ -176,7 +176,6 @@ read the file /proc/PID/status:
6 CapBnd: ffffffffffffffff
7 voluntary_ctxt_switches: 0
8 nonvoluntary_ctxt_switches: 1
9 - Stack usage: 12 kB
10
11 This shows you nearly the same information you would get if you viewed it with
12 the ps command. In fact, ps uses the proc file system to obtain its
13 @@ -230,7 +229,6 @@ Table 1-2: Contents of the statm files (as of 2.6.30-rc7)
14 Mems_allowed_list Same as previous, but in "list format"
15 voluntary_ctxt_switches number of voluntary context switches
16 nonvoluntary_ctxt_switches number of non voluntary context switches
17 - Stack usage: stack usage high water mark (round up to page size)
18 ..............................................................................
19
20 Table 1-3: Contents of the statm files (as of 2.6.8-rc3)
21 @@ -309,7 +307,7 @@ address perms offset dev inode pathname
22 08049000-0804a000 rw-p 00001000 03:00 8312 /opt/test
23 0804a000-0806b000 rw-p 00000000 00:00 0 [heap]
24 a7cb1000-a7cb2000 ---p 00000000 00:00 0
25 -a7cb2000-a7eb2000 rw-p 00000000 00:00 0 [threadstack:001ff4b4]
26 +a7cb2000-a7eb2000 rw-p 00000000 00:00 0
27 a7eb2000-a7eb3000 ---p 00000000 00:00 0
28 a7eb3000-a7ed5000 rw-p 00000000 00:00 0
29 a7ed5000-a8008000 r-xp 00000000 03:00 4222 /lib/libc.so.6
30 @@ -345,7 +343,6 @@ is not associated with a file:
31 [stack] = the stack of the main process
32 [vdso] = the "virtual dynamic shared object",
33 the kernel system call handler
34 - [threadstack:xxxxxxxx] = the stack of the thread, xxxxxxxx is the stack size
35
36 or if empty, the mapping is anonymous.
37
38 diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
39 index 9e74bfe..f7064ab 100644
40 --- a/arch/parisc/kernel/pci.c
41 +++ b/arch/parisc/kernel/pci.c
42 @@ -18,6 +18,7 @@
43
44 #include <asm/io.h>
45 #include <asm/system.h>
46 +#include <asm/cache.h> /* for L1_CACHE_BYTES */
47 #include <asm/superio.h>
48
49 #define DEBUG_RESOURCES 0
50 @@ -122,10 +123,6 @@ static int __init pcibios_init(void)
51 } else {
52 printk(KERN_WARNING "pci_bios != NULL but init() is!\n");
53 }
54 -
55 - /* Set the CLS for PCI as early as possible. */
56 - pci_cache_line_size = pci_dfl_cache_line_size;
57 -
58 return 0;
59 }
60
61 @@ -174,7 +171,7 @@ void pcibios_set_master(struct pci_dev *dev)
62 ** upper byte is PCI_LATENCY_TIMER.
63 */
64 pci_write_config_word(dev, PCI_CACHE_LINE_SIZE,
65 - (0x80 << 8) | pci_cache_line_size);
66 + (0x80 << 8) | (L1_CACHE_BYTES / sizeof(u32)));
67 }
68
69
70 diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
71 index abbc2aa..c1de3c9 100644
72 --- a/arch/powerpc/include/asm/hw_irq.h
73 +++ b/arch/powerpc/include/asm/hw_irq.h
74 @@ -135,43 +135,5 @@ static inline int irqs_disabled_flags(unsigned long flags)
75 */
76 struct irq_chip;
77
78 -#ifdef CONFIG_PERF_EVENTS
79 -
80 -#ifdef CONFIG_PPC64
81 -static inline unsigned long test_perf_event_pending(void)
82 -{
83 - unsigned long x;
84 -
85 - asm volatile("lbz %0,%1(13)"
86 - : "=r" (x)
87 - : "i" (offsetof(struct paca_struct, perf_event_pending)));
88 - return x;
89 -}
90 -
91 -static inline void set_perf_event_pending(void)
92 -{
93 - asm volatile("stb %0,%1(13)" : :
94 - "r" (1),
95 - "i" (offsetof(struct paca_struct, perf_event_pending)));
96 -}
97 -
98 -static inline void clear_perf_event_pending(void)
99 -{
100 - asm volatile("stb %0,%1(13)" : :
101 - "r" (0),
102 - "i" (offsetof(struct paca_struct, perf_event_pending)));
103 -}
104 -#endif /* CONFIG_PPC64 */
105 -
106 -#else /* CONFIG_PERF_EVENTS */
107 -
108 -static inline unsigned long test_perf_event_pending(void)
109 -{
110 - return 0;
111 -}
112 -
113 -static inline void clear_perf_event_pending(void) {}
114 -#endif /* CONFIG_PERF_EVENTS */
115 -
116 #endif /* __KERNEL__ */
117 #endif /* _ASM_POWERPC_HW_IRQ_H */
118 diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
119 index 0812b0f..692c056 100644
120 --- a/arch/powerpc/kernel/asm-offsets.c
121 +++ b/arch/powerpc/kernel/asm-offsets.c
122 @@ -133,7 +133,6 @@ int main(void)
123 DEFINE(PACAKMSR, offsetof(struct paca_struct, kernel_msr));
124 DEFINE(PACASOFTIRQEN, offsetof(struct paca_struct, soft_enabled));
125 DEFINE(PACAHARDIRQEN, offsetof(struct paca_struct, hard_enabled));
126 - DEFINE(PACAPERFPEND, offsetof(struct paca_struct, perf_event_pending));
127 DEFINE(PACACONTEXTID, offsetof(struct paca_struct, context.id));
128 #ifdef CONFIG_PPC_MM_SLICES
129 DEFINE(PACALOWSLICESPSIZE, offsetof(struct paca_struct,
130 diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
131 index 9763267..917cebc 100644
132 --- a/arch/powerpc/kernel/entry_64.S
133 +++ b/arch/powerpc/kernel/entry_64.S
134 @@ -556,15 +556,6 @@ ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES)
135 2:
136 TRACE_AND_RESTORE_IRQ(r5);
137
138 -#ifdef CONFIG_PERF_EVENTS
139 - /* check paca->perf_event_pending if we're enabling ints */
140 - lbz r3,PACAPERFPEND(r13)
141 - and. r3,r3,r5
142 - beq 27f
143 - bl .perf_event_do_pending
144 -27:
145 -#endif /* CONFIG_PERF_EVENTS */
146 -
147 /* extract EE bit and use it to restore paca->hard_enabled */
148 ld r3,_MSR(r1)
149 rldicl r4,r3,49,63 /* r0 = (r3 >> 15) & 1 */
150 diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
151 index e5d1211..8564a41 100644
152 --- a/arch/powerpc/kernel/irq.c
153 +++ b/arch/powerpc/kernel/irq.c
154 @@ -53,7 +53,6 @@
155 #include <linux/bootmem.h>
156 #include <linux/pci.h>
157 #include <linux/debugfs.h>
158 -#include <linux/perf_event.h>
159
160 #include <asm/uaccess.h>
161 #include <asm/system.h>
162 @@ -138,11 +137,6 @@ notrace void raw_local_irq_restore(unsigned long en)
163 }
164 #endif /* CONFIG_PPC_STD_MMU_64 */
165
166 - if (test_perf_event_pending()) {
167 - clear_perf_event_pending();
168 - perf_event_do_pending();
169 - }
170 -
171 /*
172 * if (get_paca()->hard_enabled) return;
173 * But again we need to take care that gcc gets hard_enabled directly
174 diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
175 index a136a11..02aab7f 100644
176 --- a/arch/powerpc/kernel/time.c
177 +++ b/arch/powerpc/kernel/time.c
178 @@ -530,25 +530,60 @@ void __init iSeries_time_init_early(void)
179 }
180 #endif /* CONFIG_PPC_ISERIES */
181
182 -#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_PPC32)
183 -DEFINE_PER_CPU(u8, perf_event_pending);
184 +#ifdef CONFIG_PERF_EVENTS
185
186 -void set_perf_event_pending(void)
187 +/*
188 + * 64-bit uses a byte in the PACA, 32-bit uses a per-cpu variable...
189 + */
190 +#ifdef CONFIG_PPC64
191 +static inline unsigned long test_perf_event_pending(void)
192 {
193 - get_cpu_var(perf_event_pending) = 1;
194 - set_dec(1);
195 - put_cpu_var(perf_event_pending);
196 + unsigned long x;
197 +
198 + asm volatile("lbz %0,%1(13)"
199 + : "=r" (x)
200 + : "i" (offsetof(struct paca_struct, perf_event_pending)));
201 + return x;
202 }
203
204 +static inline void set_perf_event_pending_flag(void)
205 +{
206 + asm volatile("stb %0,%1(13)" : :
207 + "r" (1),
208 + "i" (offsetof(struct paca_struct, perf_event_pending)));
209 +}
210 +
211 +static inline void clear_perf_event_pending(void)
212 +{
213 + asm volatile("stb %0,%1(13)" : :
214 + "r" (0),
215 + "i" (offsetof(struct paca_struct, perf_event_pending)));
216 +}
217 +
218 +#else /* 32-bit */
219 +
220 +DEFINE_PER_CPU(u8, perf_event_pending);
221 +
222 +#define set_perf_event_pending_flag() __get_cpu_var(perf_event_pending) = 1
223 #define test_perf_event_pending() __get_cpu_var(perf_event_pending)
224 #define clear_perf_event_pending() __get_cpu_var(perf_event_pending) = 0
225
226 -#else /* CONFIG_PERF_EVENTS && CONFIG_PPC32 */
227 +#endif /* 32 vs 64 bit */
228 +
229 +void set_perf_event_pending(void)
230 +{
231 + preempt_disable();
232 + set_perf_event_pending_flag();
233 + set_dec(1);
234 + preempt_enable();
235 +}
236 +
237 +#else /* CONFIG_PERF_EVENTS */
238
239 #define test_perf_event_pending() 0
240 #define clear_perf_event_pending()
241
242 -#endif /* CONFIG_PERF_EVENTS && CONFIG_PPC32 */
243 +#endif /* CONFIG_PERF_EVENTS */
244
245 /*
246 * For iSeries shared processors, we have to let the hypervisor
247 @@ -576,10 +611,6 @@ void timer_interrupt(struct pt_regs * regs)
248 set_dec(DECREMENTER_MAX);
249
250 #ifdef CONFIG_PPC32
251 - if (test_perf_event_pending()) {
252 - clear_perf_event_pending();
253 - perf_event_do_pending();
254 - }
255 if (atomic_read(&ppc_n_lost_interrupts) != 0)
256 do_IRQ(regs);
257 #endif
258 @@ -597,6 +628,11 @@ void timer_interrupt(struct pt_regs * regs)
259
260 calculate_steal_time();
261
262 + if (test_perf_event_pending()) {
263 + clear_perf_event_pending();
264 + perf_event_do_pending();
265 + }
266 +
267 #ifdef CONFIG_PPC_ISERIES
268 if (firmware_has_feature(FW_FEATURE_ISERIES))
269 get_lppaca()->int_dword.fields.decr_int = 0;
270 diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
271 index 653c6a1..08f8838 100644
272 --- a/arch/s390/kernel/ptrace.c
273 +++ b/arch/s390/kernel/ptrace.c
274 @@ -632,7 +632,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
275
276 asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
277 {
278 - long ret;
279 + long ret = 0;
280
281 /* Do the secure computing check first. */
282 secure_computing(regs->gprs[2]);
283 @@ -641,7 +641,6 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
284 * The sysc_tracesys code in entry.S stored the system
285 * call number to gprs[2].
286 */
287 - ret = regs->gprs[2];
288 if (test_thread_flag(TIF_SYSCALL_TRACE) &&
289 (tracehook_report_syscall_entry(regs) ||
290 regs->gprs[2] >= NR_syscalls)) {
291 @@ -663,7 +662,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
292 regs->gprs[2], regs->orig_gpr2,
293 regs->gprs[3], regs->gprs[4],
294 regs->gprs[5]);
295 - return ret;
296 + return ret ?: regs->gprs[2];
297 }
298
299 asmlinkage void do_syscall_trace_exit(struct pt_regs *regs)
300 diff --git a/arch/x86/include/asm/k8.h b/arch/x86/include/asm/k8.h
301 index c2d1f3b..f0746f4 100644
302 --- a/arch/x86/include/asm/k8.h
303 +++ b/arch/x86/include/asm/k8.h
304 @@ -13,11 +13,16 @@ extern void k8_flush_garts(void);
305 extern int k8_scan_nodes(unsigned long start, unsigned long end);
306
307 #ifdef CONFIG_K8_NB
308 +extern int num_k8_northbridges;
309 +
310 static inline struct pci_dev *node_to_k8_nb_misc(int node)
311 {
312 return (node < num_k8_northbridges) ? k8_northbridges[node] : NULL;
313 }
314 +
315 #else
316 +#define num_k8_northbridges 0
317 +
318 static inline struct pci_dev *node_to_k8_nb_misc(int node)
319 {
320 return NULL;
321 diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
322 index b25b229..417990f 100644
323 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c
324 +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
325 @@ -338,6 +338,10 @@ amd_check_l3_disable(int index, struct _cpuid4_info_regs *this_leaf)
326 (boot_cpu_data.x86_mask < 0x1)))
327 return;
328
329 + /* not in virtualized environments */
330 + if (num_k8_northbridges == 0)
331 + return;
332 +
333 this_leaf->can_disable = true;
334 this_leaf->l3_indices = amd_calc_l3_indices();
335 }
336 diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
337 index d0ba107..5fd5b07 100644
338 --- a/arch/x86/kernel/process.c
339 +++ b/arch/x86/kernel/process.c
340 @@ -459,11 +459,13 @@ static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c)
341 * check OSVW bit for CPUs that are not affected
342 * by erratum #400
343 */
344 - rdmsrl(MSR_AMD64_OSVW_ID_LENGTH, val);
345 - if (val >= 2) {
346 - rdmsrl(MSR_AMD64_OSVW_STATUS, val);
347 - if (!(val & BIT(1)))
348 - goto no_c1e_idle;
349 + if (cpu_has(c, X86_FEATURE_OSVW)) {
350 + rdmsrl(MSR_AMD64_OSVW_ID_LENGTH, val);
351 + if (val >= 2) {
352 + rdmsrl(MSR_AMD64_OSVW_STATUS, val);
353 + if (!(val & BIT(1)))
354 + goto no_c1e_idle;
355 + }
356 }
357 return 1;
358 }
359 diff --git a/crypto/authenc.c b/crypto/authenc.c
360 index 4d6f49a..0d54de9 100644
361 --- a/crypto/authenc.c
362 +++ b/crypto/authenc.c
363 @@ -46,6 +46,12 @@ struct authenc_request_ctx {
364 char tail[];
365 };
366
367 +static void authenc_request_complete(struct aead_request *req, int err)
368 +{
369 + if (err != -EINPROGRESS)
370 + aead_request_complete(req, err);
371 +}
372 +
373 static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key,
374 unsigned int keylen)
375 {
376 @@ -142,7 +148,7 @@ static void authenc_geniv_ahash_update_done(struct crypto_async_request *areq,
377 crypto_aead_authsize(authenc), 1);
378
379 out:
380 - aead_request_complete(req, err);
381 + authenc_request_complete(req, err);
382 }
383
384 static void authenc_geniv_ahash_done(struct crypto_async_request *areq, int err)
385 @@ -208,7 +214,7 @@ static void authenc_verify_ahash_update_done(struct crypto_async_request *areq,
386 err = crypto_ablkcipher_decrypt(abreq);
387
388 out:
389 - aead_request_complete(req, err);
390 + authenc_request_complete(req, err);
391 }
392
393 static void authenc_verify_ahash_done(struct crypto_async_request *areq,
394 @@ -245,7 +251,7 @@ static void authenc_verify_ahash_done(struct crypto_async_request *areq,
395 err = crypto_ablkcipher_decrypt(abreq);
396
397 out:
398 - aead_request_complete(req, err);
399 + authenc_request_complete(req, err);
400 }
401
402 static u8 *crypto_authenc_ahash_fb(struct aead_request *req, unsigned int flags)
403 @@ -379,7 +385,7 @@ static void crypto_authenc_encrypt_done(struct crypto_async_request *req,
404 err = crypto_authenc_genicv(areq, iv, 0);
405 }
406
407 - aead_request_complete(areq, err);
408 + authenc_request_complete(areq, err);
409 }
410
411 static int crypto_authenc_encrypt(struct aead_request *req)
412 @@ -418,7 +424,7 @@ static void crypto_authenc_givencrypt_done(struct crypto_async_request *req,
413 err = crypto_authenc_genicv(areq, greq->giv, 0);
414 }
415
416 - aead_request_complete(areq, err);
417 + authenc_request_complete(areq, err);
418 }
419
420 static int crypto_authenc_givencrypt(struct aead_givcrypt_request *req)
421 diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
422 index 7c85265..9ed9292 100644
423 --- a/drivers/acpi/sleep.c
424 +++ b/drivers/acpi/sleep.c
425 @@ -475,101 +475,13 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
426 },
427 {
428 .callback = init_set_sci_en_on_resume,
429 - .ident = "Lenovo ThinkPad X201",
430 + .ident = "Lenovo ThinkPad X201[s]",
431 .matches = {
432 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
433 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"),
434 },
435 },
436 {
437 - .callback = init_set_sci_en_on_resume,
438 - .ident = "Lenovo ThinkPad X201",
439 - .matches = {
440 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
441 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"),
442 - },
443 - },
444 - {
445 - .callback = init_set_sci_en_on_resume,
446 - .ident = "Lenovo ThinkPad T410",
447 - .matches = {
448 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
449 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"),
450 - },
451 - },
452 - {
453 - .callback = init_set_sci_en_on_resume,
454 - .ident = "Lenovo ThinkPad T510",
455 - .matches = {
456 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
457 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"),
458 - },
459 - },
460 - {
461 - .callback = init_set_sci_en_on_resume,
462 - .ident = "Lenovo ThinkPad W510",
463 - .matches = {
464 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
465 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"),
466 - },
467 - },
468 - {
469 - .callback = init_set_sci_en_on_resume,
470 - .ident = "Lenovo ThinkPad X201",
471 - .matches = {
472 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
473 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"),
474 - },
475 - },
476 - {
477 - .callback = init_set_sci_en_on_resume,
478 - .ident = "Lenovo ThinkPad X201",
479 - .matches = {
480 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
481 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"),
482 - },
483 - },
484 - {
485 - .callback = init_set_sci_en_on_resume,
486 - .ident = "Lenovo ThinkPad T410",
487 - .matches = {
488 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
489 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"),
490 - },
491 - },
492 - {
493 - .callback = init_set_sci_en_on_resume,
494 - .ident = "Lenovo ThinkPad T510",
495 - .matches = {
496 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
497 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"),
498 - },
499 - },
500 - {
501 - .callback = init_set_sci_en_on_resume,
502 - .ident = "Lenovo ThinkPad W510",
503 - .matches = {
504 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
505 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"),
506 - },
507 - },
508 - {
509 - .callback = init_set_sci_en_on_resume,
510 - .ident = "Lenovo ThinkPad X201",
511 - .matches = {
512 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
513 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"),
514 - },
515 - },
516 - {
517 - .callback = init_set_sci_en_on_resume,
518 - .ident = "Lenovo ThinkPad X201",
519 - .matches = {
520 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
521 - DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201s"),
522 - },
523 - },
524 - {
525 .callback = init_old_suspend_ordering,
526 .ident = "Panasonic CF51-2L",
527 .matches = {
528 diff --git a/drivers/hwmon/hp_accel.c b/drivers/hwmon/hp_accel.c
529 index be475e8..f16d60f 100644
530 --- a/drivers/hwmon/hp_accel.c
531 +++ b/drivers/hwmon/hp_accel.c
532 @@ -324,8 +324,8 @@ static int lis3lv02d_remove(struct acpi_device *device, int type)
533 lis3lv02d_joystick_disable();
534 lis3lv02d_poweroff(&lis3_dev);
535
536 - flush_work(&hpled_led.work);
537 led_classdev_unregister(&hpled_led.led_classdev);
538 + flush_work(&hpled_led.work);
539
540 return lis3lv02d_remove_fs(&lis3_dev);
541 }
542 diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
543 index fc25586..8faa703 100644
544 --- a/drivers/mmc/host/atmel-mci.c
545 +++ b/drivers/mmc/host/atmel-mci.c
546 @@ -530,9 +530,10 @@ static void atmci_dma_cleanup(struct atmel_mci *host)
547 {
548 struct mmc_data *data = host->data;
549
550 - dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len,
551 - ((data->flags & MMC_DATA_WRITE)
552 - ? DMA_TO_DEVICE : DMA_FROM_DEVICE));
553 + if (data)
554 + dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len,
555 + ((data->flags & MMC_DATA_WRITE)
556 + ? DMA_TO_DEVICE : DMA_FROM_DEVICE));
557 }
558
559 static void atmci_stop_dma(struct atmel_mci *host)
560 @@ -1037,8 +1038,8 @@ static void atmci_command_complete(struct atmel_mci *host,
561 "command error: status=0x%08x\n", status);
562
563 if (cmd->data) {
564 - host->data = NULL;
565 atmci_stop_dma(host);
566 + host->data = NULL;
567 mci_writel(host, IDR, MCI_NOTBUSY
568 | MCI_TXRDY | MCI_RXRDY
569 | ATMCI_DATA_ERROR_FLAGS);
570 @@ -1229,6 +1230,7 @@ static void atmci_tasklet_func(unsigned long priv)
571 } else {
572 data->bytes_xfered = data->blocks * data->blksz;
573 data->error = 0;
574 + mci_writel(host, IDR, ATMCI_DATA_ERROR_FLAGS);
575 }
576
577 if (!data->stop) {
578 @@ -1669,13 +1671,13 @@ static int __init atmci_probe(struct platform_device *pdev)
579 ret = -ENODEV;
580 if (pdata->slot[0].bus_width) {
581 ret = atmci_init_slot(host, &pdata->slot[0],
582 - MCI_SDCSEL_SLOT_A, 0);
583 + 0, MCI_SDCSEL_SLOT_A);
584 if (!ret)
585 nr_slots++;
586 }
587 if (pdata->slot[1].bus_width) {
588 ret = atmci_init_slot(host, &pdata->slot[1],
589 - MCI_SDCSEL_SLOT_B, 1);
590 + 1, MCI_SDCSEL_SLOT_B);
591 if (!ret)
592 nr_slots++;
593 }
594 diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
595 index a232361..e499fb6 100644
596 --- a/drivers/net/wireless/ath/ath9k/xmit.c
597 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
598 @@ -2190,7 +2190,7 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an)
599 if (ATH_TXQ_SETUP(sc, i)) {
600 txq = &sc->tx.txq[i];
601
602 - spin_lock_bh(&txq->axq_lock);
603 + spin_lock(&txq->axq_lock);
604
605 list_for_each_entry_safe(ac,
606 ac_tmp, &txq->axq_acq, list) {
607 @@ -2211,7 +2211,7 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an)
608 }
609 }
610
611 - spin_unlock_bh(&txq->axq_lock);
612 + spin_unlock(&txq->axq_lock);
613 }
614 }
615 }
616 diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
617 index a5ed51a..585b8d4 100644
618 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c
619 +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
620 @@ -715,6 +715,11 @@ static int iwl4965_alive_notify(struct iwl_priv *priv)
621
622 iwl4965_set_wr_ptrs(priv, IWL_CMD_QUEUE_NUM, 0);
623
624 + /* make sure all queue are not stopped */
625 + memset(&priv->queue_stopped[0], 0, sizeof(priv->queue_stopped));
626 + for (i = 0; i < 4; i++)
627 + atomic_set(&priv->queue_stop_count[i], 0);
628 +
629 /* reset to 0 to enable all the queue first */
630 priv->txq_ctx_active_msk = 0;
631 /* Map each Tx/cmd queue to its corresponding fifo */
632 diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
633 index 2a8eb2f..d636639 100644
634 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c
635 +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
636 @@ -793,6 +793,11 @@ int iwl5000_alive_notify(struct iwl_priv *priv)
637
638 iwl5000_set_wr_ptrs(priv, IWL_CMD_QUEUE_NUM, 0);
639
640 + /* make sure all queue are not stopped */
641 + memset(&priv->queue_stopped[0], 0, sizeof(priv->queue_stopped));
642 + for (i = 0; i < 4; i++)
643 + atomic_set(&priv->queue_stop_count[i], 0);
644 +
645 /* reset to 0 to enable all the queue first */
646 priv->txq_ctx_active_msk = 0;
647 /* map qos queues to fifos one-to-one */
648 diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c
649 index 0efe67d..8e3818f 100644
650 --- a/drivers/net/wireless/p54/eeprom.c
651 +++ b/drivers/net/wireless/p54/eeprom.c
652 @@ -126,7 +126,7 @@ static int p54_generate_band(struct ieee80211_hw *dev,
653 int ret = -ENOMEM;
654
655 if ((!list->entries) || (!list->band_channel_num[band]))
656 - return 0;
657 + return -EINVAL;
658
659 tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
660 if (!tmp)
661 @@ -158,6 +158,7 @@ static int p54_generate_band(struct ieee80211_hw *dev,
662 (list->channels[i].data & CHAN_HAS_CURVE ? "" :
663 " [curve data]"),
664 list->channels[i].index, list->channels[i].freq);
665 + continue;
666 }
667
668 tmp->channels[j].band = list->channels[i].band;
669 @@ -165,7 +166,16 @@ static int p54_generate_band(struct ieee80211_hw *dev,
670 j++;
671 }
672
673 - tmp->n_channels = list->band_channel_num[band];
674 + if (j == 0) {
675 + printk(KERN_ERR "%s: Disabling totally damaged %s band.\n",
676 + wiphy_name(dev->wiphy), (band == IEEE80211_BAND_2GHZ) ?
677 + "2 GHz" : "5 GHz");
678 +
679 + ret = -ENODATA;
680 + goto err_out;
681 + }
682 +
683 + tmp->n_channels = j;
684 old = priv->band_table[band];
685 priv->band_table[band] = tmp;
686 if (old) {
687 @@ -228,13 +238,13 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev)
688 struct p54_common *priv = dev->priv;
689 struct p54_channel_list *list;
690 unsigned int i, j, max_channel_num;
691 - int ret = -ENOMEM;
692 + int ret = 0;
693 u16 freq;
694
695 if ((priv->iq_autocal_len != priv->curve_data->entries) ||
696 (priv->iq_autocal_len != priv->output_limit->entries))
697 - printk(KERN_ERR "%s: EEPROM is damaged... you may not be able"
698 - "to use all channels with this device.\n",
699 + printk(KERN_ERR "%s: Unsupported or damaged EEPROM detected. "
700 + "You may not be able to use all channels.\n",
701 wiphy_name(dev->wiphy));
702
703 max_channel_num = max_t(unsigned int, priv->output_limit->entries,
704 @@ -243,8 +253,10 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev)
705 priv->curve_data->entries);
706
707 list = kzalloc(sizeof(*list), GFP_KERNEL);
708 - if (!list)
709 + if (!list) {
710 + ret = -ENOMEM;
711 goto free;
712 + }
713
714 list->max_entries = max_channel_num;
715 list->channels = kzalloc(sizeof(struct p54_channel_entry) *
716 @@ -282,13 +294,8 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev)
717 p54_compare_channels, NULL);
718
719 for (i = 0, j = 0; i < IEEE80211_NUM_BANDS; i++) {
720 - if (list->band_channel_num[i]) {
721 - ret = p54_generate_band(dev, list, i);
722 - if (ret)
723 - goto free;
724 -
725 + if (p54_generate_band(dev, list, i) == 0)
726 j++;
727 - }
728 }
729 if (j == 0) {
730 /* no useable band available. */
731 diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
732 index 518712c..202fa0f 100644
733 --- a/drivers/scsi/megaraid/megaraid_sas.c
734 +++ b/drivers/scsi/megaraid/megaraid_sas.c
735 @@ -3282,6 +3282,7 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg)
736 compat_alloc_user_space(sizeof(struct megasas_iocpacket));
737 int i;
738 int error = 0;
739 + compat_uptr_t ptr;
740
741 if (clear_user(ioc, sizeof(*ioc)))
742 return -EFAULT;
743 @@ -3294,9 +3295,22 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg)
744 copy_in_user(&ioc->sge_count, &cioc->sge_count, sizeof(u32)))
745 return -EFAULT;
746
747 - for (i = 0; i < MAX_IOCTL_SGE; i++) {
748 - compat_uptr_t ptr;
749 + /*
750 + * The sense_ptr is used in megasas_mgmt_fw_ioctl only when
751 + * sense_len is not null, so prepare the 64bit value under
752 + * the same condition.
753 + */
754 + if (ioc->sense_len) {
755 + void __user **sense_ioc_ptr =
756 + (void __user **)(ioc->frame.raw + ioc->sense_off);
757 + compat_uptr_t *sense_cioc_ptr =
758 + (compat_uptr_t *)(cioc->frame.raw + cioc->sense_off);
759 + if (get_user(ptr, sense_cioc_ptr) ||
760 + put_user(compat_ptr(ptr), sense_ioc_ptr))
761 + return -EFAULT;
762 + }
763
764 + for (i = 0; i < MAX_IOCTL_SGE; i++) {
765 if (get_user(ptr, &cioc->sgl[i].iov_base) ||
766 put_user(compat_ptr(ptr), &ioc->sgl[i].iov_base) ||
767 copy_in_user(&ioc->sgl[i].iov_len,
768 diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
769 index 8c0dd13..2b55018 100644
770 --- a/drivers/serial/imx.c
771 +++ b/drivers/serial/imx.c
772 @@ -119,7 +119,8 @@
773 #define MX2_UCR3_RXDMUXSEL (1<<2) /* RXD Muxed Input Select, on mx2/mx3 */
774 #define UCR3_INVT (1<<1) /* Inverted Infrared transmission */
775 #define UCR3_BPEN (1<<0) /* Preset registers enable */
776 -#define UCR4_CTSTL_32 (32<<10) /* CTS trigger level (32 chars) */
777 +#define UCR4_CTSTL_SHF 10 /* CTS trigger level shift */
778 +#define UCR4_CTSTL_MASK 0x3F /* CTS trigger is 6 bits wide */
779 #define UCR4_INVR (1<<9) /* Inverted infrared reception */
780 #define UCR4_ENIRI (1<<8) /* Serial infrared interrupt enable */
781 #define UCR4_WKEN (1<<7) /* Wake interrupt enable */
782 @@ -590,6 +591,9 @@ static int imx_setup_ufcr(struct imx_port *sport, unsigned int mode)
783 return 0;
784 }
785
786 +/* half the RX buffer size */
787 +#define CTSTL 16
788 +
789 static int imx_startup(struct uart_port *port)
790 {
791 struct imx_port *sport = (struct imx_port *)port;
792 @@ -606,6 +610,10 @@ static int imx_startup(struct uart_port *port)
793 if (USE_IRDA(sport))
794 temp |= UCR4_IRSC;
795
796 + /* set the trigger level for CTS */
797 + temp &= ~(UCR4_CTSTL_MASK<< UCR4_CTSTL_SHF);
798 + temp |= CTSTL<< UCR4_CTSTL_SHF;
799 +
800 writel(temp & ~UCR4_DREN, sport->port.membase + UCR4);
801
802 if (USE_IRDA(sport)) {
803 diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c
804 index 5cc36cf..2c72a7c 100644
805 --- a/drivers/video/bfin-t350mcqb-fb.c
806 +++ b/drivers/video/bfin-t350mcqb-fb.c
807 @@ -515,9 +515,9 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
808 fbinfo->fbops = &bfin_t350mcqb_fb_ops;
809 fbinfo->flags = FBINFO_FLAG_DEFAULT;
810
811 - info->fb_buffer =
812 - dma_alloc_coherent(NULL, fbinfo->fix.smem_len, &info->dma_handle,
813 - GFP_KERNEL);
814 + info->fb_buffer = dma_alloc_coherent(NULL, fbinfo->fix.smem_len +
815 + ACTIVE_VIDEO_MEM_OFFSET,
816 + &info->dma_handle, GFP_KERNEL);
817
818 if (NULL == info->fb_buffer) {
819 printk(KERN_ERR DRIVER_NAME
820 @@ -587,8 +587,8 @@ out7:
821 out6:
822 fb_dealloc_cmap(&fbinfo->cmap);
823 out4:
824 - dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer,
825 - info->dma_handle);
826 + dma_free_coherent(NULL, fbinfo->fix.smem_len + ACTIVE_VIDEO_MEM_OFFSET,
827 + info->fb_buffer, info->dma_handle);
828 out3:
829 framebuffer_release(fbinfo);
830 out2:
831 @@ -611,8 +611,9 @@ static int __devexit bfin_t350mcqb_remove(struct platform_device *pdev)
832 free_irq(info->irq, info);
833
834 if (info->fb_buffer != NULL)
835 - dma_free_coherent(NULL, fbinfo->fix.smem_len, info->fb_buffer,
836 - info->dma_handle);
837 + dma_free_coherent(NULL, fbinfo->fix.smem_len +
838 + ACTIVE_VIDEO_MEM_OFFSET, info->fb_buffer,
839 + info->dma_handle);
840
841 fb_dealloc_cmap(&fbinfo->cmap);
842
843 diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
844 index cdbb054..64f6b2f 100644
845 --- a/fs/btrfs/ioctl.c
846 +++ b/fs/btrfs/ioctl.c
847 @@ -959,12 +959,17 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
848 ret = -EBADF;
849 goto out_drop_write;
850 }
851 +
852 src = src_file->f_dentry->d_inode;
853
854 ret = -EINVAL;
855 if (src == inode)
856 goto out_fput;
857
858 + /* the src must be open for reading */
859 + if (!(src_file->f_mode & FMODE_READ))
860 + goto out_fput;
861 +
862 ret = -EISDIR;
863 if (S_ISDIR(src->i_mode) || S_ISDIR(inode->i_mode))
864 goto out_fput;
865 diff --git a/fs/cachefiles/security.c b/fs/cachefiles/security.c
866 index b5808cd..039b501 100644
867 --- a/fs/cachefiles/security.c
868 +++ b/fs/cachefiles/security.c
869 @@ -77,6 +77,8 @@ static int cachefiles_check_cache_dir(struct cachefiles_cache *cache,
870 /*
871 * check the security details of the on-disk cache
872 * - must be called with security override in force
873 + * - must return with a security override in force - even in the case of an
874 + * error
875 */
876 int cachefiles_determine_cache_security(struct cachefiles_cache *cache,
877 struct dentry *root,
878 @@ -99,6 +101,8 @@ int cachefiles_determine_cache_security(struct cachefiles_cache *cache,
879 * which create files */
880 ret = set_create_files_as(new, root->d_inode);
881 if (ret < 0) {
882 + abort_creds(new);
883 + cachefiles_begin_secure(cache, _saved_cred);
884 _leave(" = %d [cfa]", ret);
885 return ret;
886 }
887 diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
888 index 5d0fde1..c4dbc63 100644
889 --- a/fs/cifs/cifsglob.h
890 +++ b/fs/cifs/cifsglob.h
891 @@ -499,6 +499,7 @@ struct dfs_info3_param {
892 #define CIFS_FATTR_DFS_REFERRAL 0x1
893 #define CIFS_FATTR_DELETE_PENDING 0x2
894 #define CIFS_FATTR_NEED_REVAL 0x4
895 +#define CIFS_FATTR_INO_COLLISION 0x8
896
897 struct cifs_fattr {
898 u32 cf_flags;
899 diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
900 index cababd8..a104ca3 100644
901 --- a/fs/cifs/inode.c
902 +++ b/fs/cifs/inode.c
903 @@ -610,6 +610,16 @@ cifs_find_inode(struct inode *inode, void *opaque)
904 if (CIFS_I(inode)->uniqueid != fattr->cf_uniqueid)
905 return 0;
906
907 + /*
908 + * uh oh -- it's a directory. We can't use it since hardlinked dirs are
909 + * verboten. Disable serverino and return it as if it were found, the
910 + * caller can discard it, generate a uniqueid and retry the find
911 + */
912 + if (S_ISDIR(inode->i_mode) && !list_empty(&inode->i_dentry)) {
913 + fattr->cf_flags |= CIFS_FATTR_INO_COLLISION;
914 + cifs_autodisable_serverino(CIFS_SB(inode->i_sb));
915 + }
916 +
917 return 1;
918 }
919
920 @@ -629,15 +639,22 @@ cifs_iget(struct super_block *sb, struct cifs_fattr *fattr)
921 unsigned long hash;
922 struct inode *inode;
923
924 +retry_iget5_locked:
925 cFYI(1, ("looking for uniqueid=%llu", fattr->cf_uniqueid));
926
927 /* hash down to 32-bits on 32-bit arch */
928 hash = cifs_uniqueid_to_ino_t(fattr->cf_uniqueid);
929
930 inode = iget5_locked(sb, hash, cifs_find_inode, cifs_init_inode, fattr);
931 -
932 - /* we have fattrs in hand, update the inode */
933 if (inode) {
934 + /* was there a problematic inode number collision? */
935 + if (fattr->cf_flags & CIFS_FATTR_INO_COLLISION) {
936 + iput(inode);
937 + fattr->cf_uniqueid = iunique(sb, ROOT_I);
938 + fattr->cf_flags &= ~CIFS_FATTR_INO_COLLISION;
939 + goto retry_iget5_locked;
940 + }
941 +
942 cifs_fattr_to_inode(inode, fattr);
943 if (sb->s_flags & MS_NOATIME)
944 inode->i_flags |= S_NOATIME | S_NOCMTIME;
945 diff --git a/fs/compat.c b/fs/compat.c
946 index 6c19040..d576b55 100644
947 --- a/fs/compat.c
948 +++ b/fs/compat.c
949 @@ -1532,8 +1532,6 @@ int compat_do_execve(char * filename,
950 if (retval < 0)
951 goto out;
952
953 - current->stack_start = current->mm->start_stack;
954 -
955 /* execve succeeded */
956 current->fs->in_exec = 0;
957 current->in_execve = 0;
958 diff --git a/fs/exec.c b/fs/exec.c
959 index a2a3944..56da15f 100644
960 --- a/fs/exec.c
961 +++ b/fs/exec.c
962 @@ -1379,8 +1379,6 @@ int do_execve(char * filename,
963 if (retval < 0)
964 goto out;
965
966 - current->stack_start = current->mm->start_stack;
967 -
968 /* execve succeeded */
969 current->fs->in_exec = 0;
970 current->in_execve = 0;
971 diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
972 index 644e667..63e7b10 100644
973 --- a/fs/nilfs2/super.c
974 +++ b/fs/nilfs2/super.c
975 @@ -781,6 +781,7 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent,
976 sb->s_export_op = &nilfs_export_ops;
977 sb->s_root = NULL;
978 sb->s_time_gran = 1;
979 + sb->s_bdi = nilfs->ns_bdi;
980
981 if (!nilfs_loaded(nilfs)) {
982 err = load_nilfs(nilfs, sbi);
983 diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c
984 index 1afb0a1..e27960c 100644
985 --- a/fs/notify/inotify/inotify_fsnotify.c
986 +++ b/fs/notify/inotify/inotify_fsnotify.c
987 @@ -28,6 +28,7 @@
988 #include <linux/path.h> /* struct path */
989 #include <linux/slab.h> /* kmem_* */
990 #include <linux/types.h>
991 +#include <linux/sched.h>
992
993 #include "inotify.h"
994
995 @@ -146,6 +147,7 @@ static void inotify_free_group_priv(struct fsnotify_group *group)
996 idr_for_each(&group->inotify_data.idr, idr_callback, group);
997 idr_remove_all(&group->inotify_data.idr);
998 idr_destroy(&group->inotify_data.idr);
999 + free_uid(group->inotify_data.user);
1000 }
1001
1002 void inotify_free_event_priv(struct fsnotify_event_private_data *fsn_event_priv)
1003 diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
1004 index ca44337..22ef16a 100644
1005 --- a/fs/notify/inotify/inotify_user.c
1006 +++ b/fs/notify/inotify/inotify_user.c
1007 @@ -556,21 +556,24 @@ retry:
1008 if (unlikely(!idr_pre_get(&group->inotify_data.idr, GFP_KERNEL)))
1009 goto out_err;
1010
1011 + /* we are putting the mark on the idr, take a reference */
1012 + fsnotify_get_mark(&tmp_ientry->fsn_entry);
1013 +
1014 spin_lock(&group->inotify_data.idr_lock);
1015 ret = idr_get_new_above(&group->inotify_data.idr, &tmp_ientry->fsn_entry,
1016 group->inotify_data.last_wd+1,
1017 &tmp_ientry->wd);
1018 spin_unlock(&group->inotify_data.idr_lock);
1019 if (ret) {
1020 + /* we didn't get on the idr, drop the idr reference */
1021 + fsnotify_put_mark(&tmp_ientry->fsn_entry);
1022 +
1023 /* idr was out of memory allocate and try again */
1024 if (ret == -EAGAIN)
1025 goto retry;
1026 goto out_err;
1027 }
1028
1029 - /* we put the mark on the idr, take a reference */
1030 - fsnotify_get_mark(&tmp_ientry->fsn_entry);
1031 -
1032 /* we are on the idr, now get on the inode */
1033 ret = fsnotify_add_mark(&tmp_ientry->fsn_entry, group, inode);
1034 if (ret) {
1035 diff --git a/fs/proc/array.c b/fs/proc/array.c
1036 index 822c2d5..725a650 100644
1037 --- a/fs/proc/array.c
1038 +++ b/fs/proc/array.c
1039 @@ -82,7 +82,6 @@
1040 #include <linux/pid_namespace.h>
1041 #include <linux/ptrace.h>
1042 #include <linux/tracehook.h>
1043 -#include <linux/swapops.h>
1044
1045 #include <asm/pgtable.h>
1046 #include <asm/processor.h>
1047 @@ -322,94 +321,6 @@ static inline void task_context_switch_counts(struct seq_file *m,
1048 p->nivcsw);
1049 }
1050
1051 -#ifdef CONFIG_MMU
1052 -
1053 -struct stack_stats {
1054 - struct vm_area_struct *vma;
1055 - unsigned long startpage;
1056 - unsigned long usage;
1057 -};
1058 -
1059 -static int stack_usage_pte_range(pmd_t *pmd, unsigned long addr,
1060 - unsigned long end, struct mm_walk *walk)
1061 -{
1062 - struct stack_stats *ss = walk->private;
1063 - struct vm_area_struct *vma = ss->vma;
1064 - pte_t *pte, ptent;
1065 - spinlock_t *ptl;
1066 - int ret = 0;
1067 -
1068 - pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
1069 - for (; addr != end; pte++, addr += PAGE_SIZE) {
1070 - ptent = *pte;
1071 -
1072 -#ifdef CONFIG_STACK_GROWSUP
1073 - if (pte_present(ptent) || is_swap_pte(ptent))
1074 - ss->usage = addr - ss->startpage + PAGE_SIZE;
1075 -#else
1076 - if (pte_present(ptent) || is_swap_pte(ptent)) {
1077 - ss->usage = ss->startpage - addr + PAGE_SIZE;
1078 - pte++;
1079 - ret = 1;
1080 - break;
1081 - }
1082 -#endif
1083 - }
1084 - pte_unmap_unlock(pte - 1, ptl);
1085 - cond_resched();
1086 - return ret;
1087 -}
1088 -
1089 -static inline unsigned long get_stack_usage_in_bytes(struct vm_area_struct *vma,
1090 - struct task_struct *task)
1091 -{
1092 - struct stack_stats ss;
1093 - struct mm_walk stack_walk = {
1094 - .pmd_entry = stack_usage_pte_range,
1095 - .mm = vma->vm_mm,
1096 - .private = &ss,
1097 - };
1098 -
1099 - if (!vma->vm_mm || is_vm_hugetlb_page(vma))
1100 - return 0;
1101 -
1102 - ss.vma = vma;
1103 - ss.startpage = task->stack_start & PAGE_MASK;
1104 - ss.usage = 0;
1105 -
1106 -#ifdef CONFIG_STACK_GROWSUP
1107 - walk_page_range(KSTK_ESP(task) & PAGE_MASK, vma->vm_end,
1108 - &stack_walk);
1109 -#else
1110 - walk_page_range(vma->vm_start, (KSTK_ESP(task) & PAGE_MASK) + PAGE_SIZE,
1111 - &stack_walk);
1112 -#endif
1113 - return ss.usage;
1114 -}
1115 -
1116 -static inline void task_show_stack_usage(struct seq_file *m,
1117 - struct task_struct *task)
1118 -{
1119 - struct vm_area_struct *vma;
1120 - struct mm_struct *mm = get_task_mm(task);
1121 -
1122 - if (mm) {
1123 - down_read(&mm->mmap_sem);
1124 - vma = find_vma(mm, task->stack_start);
1125 - if (vma)
1126 - seq_printf(m, "Stack usage:\t%lu kB\n",
1127 - get_stack_usage_in_bytes(vma, task) >> 10);
1128 -
1129 - up_read(&mm->mmap_sem);
1130 - mmput(mm);
1131 - }
1132 -}
1133 -#else
1134 -static void task_show_stack_usage(struct seq_file *m, struct task_struct *task)
1135 -{
1136 -}
1137 -#endif /* CONFIG_MMU */
1138 -
1139 int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
1140 struct pid *pid, struct task_struct *task)
1141 {
1142 @@ -429,7 +340,6 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,
1143 task_show_regs(m, task);
1144 #endif
1145 task_context_switch_counts(m, task);
1146 - task_show_stack_usage(m, task);
1147 return 0;
1148 }
1149
1150 @@ -571,7 +481,7 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
1151 rsslim,
1152 mm ? mm->start_code : 0,
1153 mm ? mm->end_code : 0,
1154 - (permitted && mm) ? task->stack_start : 0,
1155 + (permitted && mm) ? mm->start_stack : 0,
1156 esp,
1157 eip,
1158 /* The signal information here is obsolete.
1159 diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
1160 index 2a1bef9..366b101 100644
1161 --- a/fs/proc/task_mmu.c
1162 +++ b/fs/proc/task_mmu.c
1163 @@ -243,25 +243,6 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
1164 } else if (vma->vm_start <= mm->start_stack &&
1165 vma->vm_end >= mm->start_stack) {
1166 name = "[stack]";
1167 - } else {
1168 - unsigned long stack_start;
1169 - struct proc_maps_private *pmp;
1170 -
1171 - pmp = m->private;
1172 - stack_start = pmp->task->stack_start;
1173 -
1174 - if (vma->vm_start <= stack_start &&
1175 - vma->vm_end >= stack_start) {
1176 - pad_len_spaces(m, len);
1177 - seq_printf(m,
1178 - "[threadstack:%08lx]",
1179 -#ifdef CONFIG_STACK_GROWSUP
1180 - vma->vm_end - stack_start
1181 -#else
1182 - stack_start - vma->vm_start
1183 -#endif
1184 - );
1185 - }
1186 }
1187 } else {
1188 name = "[vdso]";
1189 diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
1190 index e694263..6920695 100644
1191 --- a/include/asm-generic/dma-mapping-common.h
1192 +++ b/include/asm-generic/dma-mapping-common.h
1193 @@ -131,7 +131,7 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
1194 debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir);
1195
1196 } else
1197 - dma_sync_single_for_cpu(dev, addr, size, dir);
1198 + dma_sync_single_for_cpu(dev, addr + offset, size, dir);
1199 }
1200
1201 static inline void dma_sync_single_range_for_device(struct device *dev,
1202 @@ -148,7 +148,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
1203 debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir);
1204
1205 } else
1206 - dma_sync_single_for_device(dev, addr, size, dir);
1207 + dma_sync_single_for_device(dev, addr + offset, size, dir);
1208 }
1209
1210 static inline void
1211 diff --git a/include/linux/module.h b/include/linux/module.h
1212 index 460df15..482efc8 100644
1213 --- a/include/linux/module.h
1214 +++ b/include/linux/module.h
1215 @@ -455,7 +455,7 @@ void symbol_put_addr(void *addr);
1216 static inline local_t *__module_ref_addr(struct module *mod, int cpu)
1217 {
1218 #ifdef CONFIG_SMP
1219 - return (local_t *) per_cpu_ptr(mod->refptr, cpu);
1220 + return (local_t *) (mod->refptr + per_cpu_offset(cpu));
1221 #else
1222 return &mod->ref;
1223 #endif
1224 diff --git a/include/linux/sched.h b/include/linux/sched.h
1225 index 70abfd3..b253434 100644
1226 --- a/include/linux/sched.h
1227 +++ b/include/linux/sched.h
1228 @@ -1541,7 +1541,6 @@ struct task_struct {
1229 /* bitmask of trace recursion */
1230 unsigned long trace_recursion;
1231 #endif /* CONFIG_TRACING */
1232 - unsigned long stack_start;
1233 };
1234
1235 /* Future-safe accessor for struct task_struct's cpus_allowed. */
1236 diff --git a/kernel/fork.c b/kernel/fork.c
1237 index 166b8c4..28b4874 100644
1238 --- a/kernel/fork.c
1239 +++ b/kernel/fork.c
1240 @@ -1123,8 +1123,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
1241
1242 p->bts = NULL;
1243
1244 - p->stack_start = stack_start;
1245 -
1246 /* Perform scheduler related setup. Assign this task to a CPU. */
1247 sched_fork(p, clone_flags);
1248
1249 diff --git a/kernel/profile.c b/kernel/profile.c
1250 index a55d3a3..dfadc5b 100644
1251 --- a/kernel/profile.c
1252 +++ b/kernel/profile.c
1253 @@ -127,8 +127,10 @@ int __ref profile_init(void)
1254 return 0;
1255
1256 prof_buffer = vmalloc(buffer_bytes);
1257 - if (prof_buffer)
1258 + if (prof_buffer) {
1259 + memset(prof_buffer, 0, buffer_bytes);
1260 return 0;
1261 + }
1262
1263 free_cpumask_var(prof_cpu_mask);
1264 return -ENOMEM;
1265 diff --git a/mm/hugetlb.c b/mm/hugetlb.c
1266 index 220c22a..b7b02ce 100644
1267 --- a/mm/hugetlb.c
1268 +++ b/mm/hugetlb.c
1269 @@ -1008,7 +1008,7 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma,
1270 page = alloc_buddy_huge_page(h, vma, addr);
1271 if (!page) {
1272 hugetlb_put_quota(inode->i_mapping, chg);
1273 - return ERR_PTR(-VM_FAULT_OOM);
1274 + return ERR_PTR(-VM_FAULT_SIGBUS);
1275 }
1276 }
1277
1278 diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
1279 index 0fa9f70..c322f44 100644
1280 --- a/net/ipv4/udp.c
1281 +++ b/net/ipv4/udp.c
1282 @@ -1292,6 +1292,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
1283
1284 uh = udp_hdr(skb);
1285 ulen = ntohs(uh->len);
1286 + saddr = ip_hdr(skb)->saddr;
1287 + daddr = ip_hdr(skb)->daddr;
1288 +
1289 if (ulen > skb->len)
1290 goto short_packet;
1291
1292 @@ -1305,9 +1308,6 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
1293 if (udp4_csum_init(skb, uh, proto))
1294 goto csum_error;
1295
1296 - saddr = ip_hdr(skb)->saddr;
1297 - daddr = ip_hdr(skb)->daddr;
1298 -
1299 if (rt->rt_flags & (RTCF_BROADCAST|RTCF_MULTICAST))
1300 return __udp4_lib_mcast_deliver(net, skb, uh,
1301 saddr, daddr, udptable);
1302 diff --git a/security/min_addr.c b/security/min_addr.c
1303 index fc43c9d..d9f9425 100644
1304 --- a/security/min_addr.c
1305 +++ b/security/min_addr.c
1306 @@ -33,7 +33,7 @@ int mmap_min_addr_handler(struct ctl_table *table, int write,
1307 {
1308 int ret;
1309
1310 - if (!capable(CAP_SYS_RAWIO))
1311 + if (write && !capable(CAP_SYS_RAWIO))
1312 return -EPERM;
1313
1314 ret = proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
1315 diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
1316 index cfb11c0..ebba28e 100644
1317 --- a/sound/pci/hda/hda_intel.c
1318 +++ b/sound/pci/hda/hda_intel.c
1319 @@ -2673,6 +2673,7 @@ static struct pci_device_id azx_ids[] = {
1320 { PCI_DEVICE(0x8086, 0x3a6e), .driver_data = AZX_DRIVER_ICH },
1321 /* PCH */
1322 { PCI_DEVICE(0x8086, 0x3b56), .driver_data = AZX_DRIVER_ICH },
1323 + { PCI_DEVICE(0x8086, 0x3b57), .driver_data = AZX_DRIVER_ICH },
1324 /* CPT */
1325 { PCI_DEVICE(0x8086, 0x1c20), .driver_data = AZX_DRIVER_PCH },
1326 /* SCH */
1327 diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
1328 index 3d2e8da..9d855f4 100644
1329 --- a/sound/pci/hda/patch_conexant.c
1330 +++ b/sound/pci/hda/patch_conexant.c
1331 @@ -1177,9 +1177,10 @@ static int patch_cxt5045(struct hda_codec *codec)
1332 case 0x103c:
1333 case 0x1631:
1334 case 0x1734:
1335 - /* HP, Packard Bell, & Fujitsu-Siemens laptops have really bad
1336 - * sound over 0dB on NID 0x17. Fix max PCM level to 0 dB
1337 - * (originally it has 0x2b steps with 0dB offset 0x14)
1338 + case 0x17aa:
1339 + /* HP, Packard Bell, Fujitsu-Siemens & Lenovo laptops have
1340 + * really bad sound over 0dB on NID 0x17. Fix max PCM level to
1341 + * 0 dB (originally it has 0x2b steps with 0dB offset 0x14)
1342 */
1343 snd_hda_override_amp_caps(codec, 0x17, HDA_INPUT,
1344 (0x14 << AC_AMPCAP_OFFSET_SHIFT) |
1345 diff --git a/sound/pci/ice1712/maya44.c b/sound/pci/ice1712/maya44.c
1346 index 3e1c20a..726fd4b 100644
1347 --- a/sound/pci/ice1712/maya44.c
1348 +++ b/sound/pci/ice1712/maya44.c
1349 @@ -347,7 +347,7 @@ static int maya_gpio_sw_put(struct snd_kcontrol *kcontrol,
1350
1351 /* known working input slots (0-4) */
1352 #define MAYA_LINE_IN 1 /* in-2 */
1353 -#define MAYA_MIC_IN 4 /* in-5 */
1354 +#define MAYA_MIC_IN 3 /* in-4 */
1355
1356 static void wm8776_select_input(struct snd_maya44 *chip, int idx, int line)
1357 {
1358 @@ -393,8 +393,8 @@ static int maya_rec_src_put(struct snd_kcontrol *kcontrol,
1359 int changed;
1360
1361 mutex_lock(&chip->mutex);
1362 - changed = maya_set_gpio_bits(chip->ice, GPIO_MIC_RELAY,
1363 - sel ? GPIO_MIC_RELAY : 0);
1364 + changed = maya_set_gpio_bits(chip->ice, 1 << GPIO_MIC_RELAY,
1365 + sel ? (1 << GPIO_MIC_RELAY) : 0);
1366 wm8776_select_input(chip, 0, sel ? MAYA_MIC_IN : MAYA_LINE_IN);
1367 mutex_unlock(&chip->mutex);
1368 return changed;

  ViewVC Help
Powered by ViewVC 1.1.20