aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-05-11 08:44:27 -0400
committerIngo Molnar <mingo@elte.hu>2009-05-11 08:44:31 -0400
commit41fb454ebe6024f5c1e3b3cbc0abc0da762e7b51 (patch)
tree51c50bcb67a5039448ddfa1869d7948cab1217e9 /lib
parent19c1a6f5764d787113fa323ffb18be7991208f82 (diff)
parent091bf7624d1c90cec9e578a18529f615213ff847 (diff)
Merge commit 'v2.6.30-rc5' into core/iommu
Merge reason: core/iommu was on an .30-rc1 base, update it to .30-rc5 to refresh. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug8
-rw-r--r--lib/Makefile2
-rw-r--r--lib/debug_locks.c2
-rw-r--r--lib/dma-debug.c53
-rw-r--r--lib/kobject.c3
-rw-r--r--lib/kobject_uevent.c4
-rw-r--r--lib/scatterlist.c9
-rw-r--r--lib/vsprintf.c16
8 files changed, 18 insertions, 79 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index c6e854f215fa..812c28207baf 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -440,7 +440,7 @@ config LOCKDEP
440 bool 440 bool
441 depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT 441 depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
442 select STACKTRACE 442 select STACKTRACE
443 select FRAME_POINTER if !X86 && !MIPS && !PPC && !ARM_UNWIND 443 select FRAME_POINTER if !X86 && !MIPS && !PPC && !ARM_UNWIND && !S390
444 select KALLSYMS 444 select KALLSYMS
445 select KALLSYMS_ALL 445 select KALLSYMS_ALL
446 446
@@ -620,7 +620,7 @@ config ARCH_WANT_FRAME_POINTERS
620config FRAME_POINTER 620config FRAME_POINTER
621 bool "Compile the kernel with frame pointers" 621 bool "Compile the kernel with frame pointers"
622 depends on DEBUG_KERNEL && \ 622 depends on DEBUG_KERNEL && \
623 (CRIS || M68K || M68KNOMMU || FRV || UML || S390 || \ 623 (CRIS || M68K || M68KNOMMU || FRV || UML || \
624 AVR32 || SUPERH || BLACKFIN || MN10300) || \ 624 AVR32 || SUPERH || BLACKFIN || MN10300) || \
625 ARCH_WANT_FRAME_POINTERS 625 ARCH_WANT_FRAME_POINTERS
626 default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS 626 default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
@@ -809,13 +809,13 @@ config FAULT_INJECTION_STACKTRACE_FILTER
809 depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT 809 depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
810 depends on !X86_64 810 depends on !X86_64
811 select STACKTRACE 811 select STACKTRACE
812 select FRAME_POINTER if !PPC 812 select FRAME_POINTER if !PPC && !S390
813 help 813 help
814 Provide stacktrace filter for fault-injection capabilities 814 Provide stacktrace filter for fault-injection capabilities
815 815
816config LATENCYTOP 816config LATENCYTOP
817 bool "Latency measuring infrastructure" 817 bool "Latency measuring infrastructure"
818 select FRAME_POINTER if !MIPS && !PPC 818 select FRAME_POINTER if !MIPS && !PPC && !S390
819 select KALLSYMS 819 select KALLSYMS
820 select KALLSYMS_ALL 820 select KALLSYMS_ALL
821 select STACKTRACE 821 select STACKTRACE
diff --git a/lib/Makefile b/lib/Makefile
index d6edd6753f40..33a40e40e3ee 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -38,7 +38,7 @@ lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
38lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o 38lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
39lib-$(CONFIG_GENERIC_FIND_FIRST_BIT) += find_next_bit.o 39lib-$(CONFIG_GENERIC_FIND_FIRST_BIT) += find_next_bit.o
40lib-$(CONFIG_GENERIC_FIND_NEXT_BIT) += find_next_bit.o 40lib-$(CONFIG_GENERIC_FIND_NEXT_BIT) += find_next_bit.o
41lib-$(CONFIG_GENERIC_FIND_LAST_BIT) += find_last_bit.o 41obj-$(CONFIG_GENERIC_FIND_LAST_BIT) += find_last_bit.o
42obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o 42obj-$(CONFIG_GENERIC_HWEIGHT) += hweight.o
43obj-$(CONFIG_LOCK_KERNEL) += kernel_lock.o 43obj-$(CONFIG_LOCK_KERNEL) += kernel_lock.o
44obj-$(CONFIG_DEBUG_PREEMPT) += smp_processor_id.o 44obj-$(CONFIG_DEBUG_PREEMPT) += smp_processor_id.o
diff --git a/lib/debug_locks.c b/lib/debug_locks.c
index 0218b4693dd8..bc3b11731b9c 100644
--- a/lib/debug_locks.c
+++ b/lib/debug_locks.c
@@ -36,7 +36,7 @@ int debug_locks_silent;
36 */ 36 */
37int debug_locks_off(void) 37int debug_locks_off(void)
38{ 38{
39 if (xchg(&debug_locks, 0)) { 39 if (__debug_locks_off()) {
40 if (!debug_locks_silent) { 40 if (!debug_locks_silent) {
41 oops_in_progress = 1; 41 oops_in_progress = 1;
42 console_verbose(); 42 console_verbose();
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 5d61019330cd..cdd205d6bf7c 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -458,60 +458,9 @@ out_err:
458 return -ENOMEM; 458 return -ENOMEM;
459} 459}
460 460
461static int device_dma_allocations(struct device *dev)
462{
463 struct dma_debug_entry *entry;
464 unsigned long flags;
465 int count = 0, i;
466
467 for (i = 0; i < HASH_SIZE; ++i) {
468 spin_lock_irqsave(&dma_entry_hash[i].lock, flags);
469 list_for_each_entry(entry, &dma_entry_hash[i].list, list) {
470 if (entry->dev == dev)
471 count += 1;
472 }
473 spin_unlock_irqrestore(&dma_entry_hash[i].lock, flags);
474 }
475
476 return count;
477}
478
479static int dma_debug_device_change(struct notifier_block *nb,
480 unsigned long action, void *data)
481{
482 struct device *dev = data;
483 int count;
484
485
486 switch (action) {
487 case BUS_NOTIFY_UNBIND_DRIVER:
488 count = device_dma_allocations(dev);
489 if (count == 0)
490 break;
491 err_printk(dev, NULL, "DMA-API: device driver has pending "
492 "DMA allocations while released from device "
493 "[count=%d]\n", count);
494 break;
495 default:
496 break;
497 }
498
499 return 0;
500}
501
502void dma_debug_add_bus(struct bus_type *bus) 461void dma_debug_add_bus(struct bus_type *bus)
503{ 462{
504 struct notifier_block *nb; 463 /* FIXME: register notifier */
505
506 nb = kzalloc(sizeof(struct notifier_block), GFP_KERNEL);
507 if (nb == NULL) {
508 printk(KERN_ERR "dma_debug_add_bus: out of memory\n");
509 return;
510 }
511
512 nb->notifier_call = dma_debug_device_change;
513
514 bus_register_notifier(bus, nb);
515} 464}
516 465
517/* 466/*
diff --git a/lib/kobject.c b/lib/kobject.c
index a6dec32f2ddd..bacf6fe4f7a0 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -218,6 +218,9 @@ int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
218 const char *old_name = kobj->name; 218 const char *old_name = kobj->name;
219 char *s; 219 char *s;
220 220
221 if (kobj->name && !fmt)
222 return 0;
223
221 kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs); 224 kobj->name = kvasprintf(GFP_KERNEL, fmt, vargs);
222 if (!kobj->name) 225 if (!kobj->name)
223 return -ENOMEM; 226 return -ENOMEM;
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 97a777ad4f59..920a3ca6e259 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -258,7 +258,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
258 goto exit; 258 goto exit;
259 259
260 retval = call_usermodehelper(argv[0], argv, 260 retval = call_usermodehelper(argv[0], argv,
261 env->envp, UMH_NO_WAIT); 261 env->envp, UMH_WAIT_EXEC);
262 } 262 }
263 263
264exit: 264exit:
@@ -328,7 +328,7 @@ static int __init kobject_uevent_init(void)
328 "kobject_uevent: unable to create netlink socket!\n"); 328 "kobject_uevent: unable to create netlink socket!\n");
329 return -ENODEV; 329 return -ENODEV;
330 } 330 }
331 331 netlink_set_nonroot(NETLINK_KOBJECT_UEVENT, NL_NONROOT_RECV);
332 return 0; 332 return 0;
333} 333}
334 334
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index b7b449dafbe5..a295e404e908 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -347,9 +347,12 @@ bool sg_miter_next(struct sg_mapping_iter *miter)
347 sg_miter_stop(miter); 347 sg_miter_stop(miter);
348 348
349 /* get to the next sg if necessary. __offset is adjusted by stop */ 349 /* get to the next sg if necessary. __offset is adjusted by stop */
350 if (miter->__offset == miter->__sg->length && --miter->__nents) { 350 while (miter->__offset == miter->__sg->length) {
351 miter->__sg = sg_next(miter->__sg); 351 if (--miter->__nents) {
352 miter->__offset = 0; 352 miter->__sg = sg_next(miter->__sg);
353 miter->__offset = 0;
354 } else
355 return false;
353 } 356 }
354 357
355 /* map the next page */ 358 /* map the next page */
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index be3001f912e4..7536acea135b 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1051,13 +1051,6 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
1051 if (str < end) 1051 if (str < end)
1052 *str = '%'; 1052 *str = '%';
1053 ++str; 1053 ++str;
1054 if (*fmt) {
1055 if (str < end)
1056 *str = *fmt;
1057 ++str;
1058 } else {
1059 --fmt;
1060 }
1061 break; 1054 break;
1062 1055
1063 case FORMAT_TYPE_NRCHARS: { 1056 case FORMAT_TYPE_NRCHARS: {
@@ -1339,8 +1332,6 @@ do { \
1339 break; 1332 break;
1340 1333
1341 case FORMAT_TYPE_INVALID: 1334 case FORMAT_TYPE_INVALID:
1342 if (!*fmt)
1343 --fmt;
1344 break; 1335 break;
1345 1336
1346 case FORMAT_TYPE_NRCHARS: { 1337 case FORMAT_TYPE_NRCHARS: {
@@ -1523,13 +1514,6 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
1523 if (str < end) 1514 if (str < end)
1524 *str = '%'; 1515 *str = '%';
1525 ++str; 1516 ++str;
1526 if (*fmt) {
1527 if (str < end)
1528 *str = *fmt;
1529 ++str;
1530 } else {
1531 --fmt;
1532 }
1533 break; 1517 break;
1534 1518
1535 case FORMAT_TYPE_NRCHARS: 1519 case FORMAT_TYPE_NRCHARS: