aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-10-02 23:02:10 -0400
committerDavid S. Miller <davem@davemloft.net>2012-10-02 23:02:10 -0400
commit954f9ac43b87b44152b8c21163cefd466a87145e (patch)
tree31c4197f975c66c96976948663e6ce844900b41a /lib
parent1b62ca7bf5775bed048032b7e779561e1fe66aa0 (diff)
parent7fe0b14b725d6d09a1d9e1409bd465cb88b587f9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
There's a Niagara 2 memcpy fix in this tree and I have a Kconfig fix from Dave Jones which requires the sparc-next changes which went upstream yesterday. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug20
-rw-r--r--lib/bcd.c8
-rw-r--r--lib/dynamic_debug.c56
-rw-r--r--lib/flex_proportions.c2
-rw-r--r--lib/kobject_uevent.c5
-rw-r--r--lib/nlattr.c4
6 files changed, 72 insertions, 23 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 2403a63b5da5..35c4565ee8fa 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -452,7 +452,8 @@ config SLUB_STATS
452config DEBUG_KMEMLEAK 452config DEBUG_KMEMLEAK
453 bool "Kernel memory leak detector" 453 bool "Kernel memory leak detector"
454 depends on DEBUG_KERNEL && EXPERIMENTAL && \ 454 depends on DEBUG_KERNEL && EXPERIMENTAL && \
455 (X86 || ARM || PPC || MIPS || S390 || SPARC64 || SUPERH || MICROBLAZE || TILE) 455 (X86 || ARM || PPC || MIPS || S390 || SPARC64 || SUPERH || \
456 MICROBLAZE || TILE || ARM64)
456 457
457 select DEBUG_FS 458 select DEBUG_FS
458 select STACKTRACE if STACKTRACE_SUPPORT 459 select STACKTRACE if STACKTRACE_SUPPORT
@@ -629,6 +630,20 @@ config PROVE_RCU_REPEATEDLY
629 630
630 Say N if you are unsure. 631 Say N if you are unsure.
631 632
633config PROVE_RCU_DELAY
634 bool "RCU debugging: preemptible RCU race provocation"
635 depends on DEBUG_KERNEL && PREEMPT_RCU
636 default n
637 help
638 There is a class of races that involve an unlikely preemption
639 of __rcu_read_unlock() just after ->rcu_read_lock_nesting has
640 been set to INT_MIN. This feature inserts a delay at that
641 point to increase the probability of these races.
642
643 Say Y to increase probability of preemption of __rcu_read_unlock().
644
645 Say N if you are unsure.
646
632config SPARSE_RCU_POINTER 647config SPARSE_RCU_POINTER
633 bool "RCU debugging: sparse-based checks for pointer usage" 648 bool "RCU debugging: sparse-based checks for pointer usage"
634 default n 649 default n
@@ -739,7 +754,8 @@ config DEBUG_BUGVERBOSE
739 bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT 754 bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT
740 depends on BUG 755 depends on BUG
741 depends on ARM || AVR32 || M32R || M68K || SPARC32 || SPARC64 || \ 756 depends on ARM || AVR32 || M32R || M68K || SPARC32 || SPARC64 || \
742 FRV || SUPERH || GENERIC_BUG || BLACKFIN || MN10300 || TILE 757 FRV || SUPERH || GENERIC_BUG || BLACKFIN || MN10300 || \
758 TILE || ARM64
743 default y 759 default y
744 help 760 help
745 Say Y here to make BUG() panics output the file name and line number 761 Say Y here to make BUG() panics output the file name and line number
diff --git a/lib/bcd.c b/lib/bcd.c
index 55efaf742346..40d304efe272 100644
--- a/lib/bcd.c
+++ b/lib/bcd.c
@@ -1,14 +1,14 @@
1#include <linux/bcd.h> 1#include <linux/bcd.h>
2#include <linux/export.h> 2#include <linux/export.h>
3 3
4unsigned bcd2bin(unsigned char val) 4unsigned _bcd2bin(unsigned char val)
5{ 5{
6 return (val & 0x0f) + (val >> 4) * 10; 6 return (val & 0x0f) + (val >> 4) * 10;
7} 7}
8EXPORT_SYMBOL(bcd2bin); 8EXPORT_SYMBOL(_bcd2bin);
9 9
10unsigned char bin2bcd(unsigned val) 10unsigned char _bin2bcd(unsigned val)
11{ 11{
12 return ((val / 10) << 4) + val % 10; 12 return ((val / 10) << 4) + val % 10;
13} 13}
14EXPORT_SYMBOL(bin2bcd); 14EXPORT_SYMBOL(_bin2bcd);
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 7ca29a0a3019..e7f7d993357a 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -521,25 +521,25 @@ static char *dynamic_emit_prefix(const struct _ddebug *desc, char *buf)
521 int pos_after_tid; 521 int pos_after_tid;
522 int pos = 0; 522 int pos = 0;
523 523
524 pos += snprintf(buf + pos, remaining(pos), "%s", KERN_DEBUG); 524 *buf = '\0';
525
525 if (desc->flags & _DPRINTK_FLAGS_INCL_TID) { 526 if (desc->flags & _DPRINTK_FLAGS_INCL_TID) {
526 if (in_interrupt()) 527 if (in_interrupt())
527 pos += snprintf(buf + pos, remaining(pos), "%s ", 528 pos += snprintf(buf + pos, remaining(pos), "<intr> ");
528 "<intr>");
529 else 529 else
530 pos += snprintf(buf + pos, remaining(pos), "[%d] ", 530 pos += snprintf(buf + pos, remaining(pos), "[%d] ",
531 task_pid_vnr(current)); 531 task_pid_vnr(current));
532 } 532 }
533 pos_after_tid = pos; 533 pos_after_tid = pos;
534 if (desc->flags & _DPRINTK_FLAGS_INCL_MODNAME) 534 if (desc->flags & _DPRINTK_FLAGS_INCL_MODNAME)
535 pos += snprintf(buf + pos, remaining(pos), "%s:", 535 pos += snprintf(buf + pos, remaining(pos), "%s:",
536 desc->modname); 536 desc->modname);
537 if (desc->flags & _DPRINTK_FLAGS_INCL_FUNCNAME) 537 if (desc->flags & _DPRINTK_FLAGS_INCL_FUNCNAME)
538 pos += snprintf(buf + pos, remaining(pos), "%s:", 538 pos += snprintf(buf + pos, remaining(pos), "%s:",
539 desc->function); 539 desc->function);
540 if (desc->flags & _DPRINTK_FLAGS_INCL_LINENO) 540 if (desc->flags & _DPRINTK_FLAGS_INCL_LINENO)
541 pos += snprintf(buf + pos, remaining(pos), "%d:", 541 pos += snprintf(buf + pos, remaining(pos), "%d:",
542 desc->lineno); 542 desc->lineno);
543 if (pos - pos_after_tid) 543 if (pos - pos_after_tid)
544 pos += snprintf(buf + pos, remaining(pos), " "); 544 pos += snprintf(buf + pos, remaining(pos), " ");
545 if (pos >= PREFIX_SIZE) 545 if (pos >= PREFIX_SIZE)
@@ -559,9 +559,13 @@ int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
559 BUG_ON(!fmt); 559 BUG_ON(!fmt);
560 560
561 va_start(args, fmt); 561 va_start(args, fmt);
562
562 vaf.fmt = fmt; 563 vaf.fmt = fmt;
563 vaf.va = &args; 564 vaf.va = &args;
564 res = printk("%s%pV", dynamic_emit_prefix(descriptor, buf), &vaf); 565
566 res = printk(KERN_DEBUG "%s%pV",
567 dynamic_emit_prefix(descriptor, buf), &vaf);
568
565 va_end(args); 569 va_end(args);
566 570
567 return res; 571 return res;
@@ -574,15 +578,26 @@ int __dynamic_dev_dbg(struct _ddebug *descriptor,
574 struct va_format vaf; 578 struct va_format vaf;
575 va_list args; 579 va_list args;
576 int res; 580 int res;
577 char buf[PREFIX_SIZE];
578 581
579 BUG_ON(!descriptor); 582 BUG_ON(!descriptor);
580 BUG_ON(!fmt); 583 BUG_ON(!fmt);
581 584
582 va_start(args, fmt); 585 va_start(args, fmt);
586
583 vaf.fmt = fmt; 587 vaf.fmt = fmt;
584 vaf.va = &args; 588 vaf.va = &args;
585 res = __dev_printk(dynamic_emit_prefix(descriptor, buf), dev, &vaf); 589
590 if (!dev) {
591 res = printk(KERN_DEBUG "(NULL device *): %pV", &vaf);
592 } else {
593 char buf[PREFIX_SIZE];
594
595 res = dev_printk_emit(7, dev, "%s%s %s: %pV",
596 dynamic_emit_prefix(descriptor, buf),
597 dev_driver_string(dev), dev_name(dev),
598 &vaf);
599 }
600
586 va_end(args); 601 va_end(args);
587 602
588 return res; 603 return res;
@@ -592,20 +607,35 @@ EXPORT_SYMBOL(__dynamic_dev_dbg);
592#ifdef CONFIG_NET 607#ifdef CONFIG_NET
593 608
594int __dynamic_netdev_dbg(struct _ddebug *descriptor, 609int __dynamic_netdev_dbg(struct _ddebug *descriptor,
595 const struct net_device *dev, const char *fmt, ...) 610 const struct net_device *dev, const char *fmt, ...)
596{ 611{
597 struct va_format vaf; 612 struct va_format vaf;
598 va_list args; 613 va_list args;
599 int res; 614 int res;
600 char buf[PREFIX_SIZE];
601 615
602 BUG_ON(!descriptor); 616 BUG_ON(!descriptor);
603 BUG_ON(!fmt); 617 BUG_ON(!fmt);
604 618
605 va_start(args, fmt); 619 va_start(args, fmt);
620
606 vaf.fmt = fmt; 621 vaf.fmt = fmt;
607 vaf.va = &args; 622 vaf.va = &args;
608 res = __netdev_printk(dynamic_emit_prefix(descriptor, buf), dev, &vaf); 623
624 if (dev && dev->dev.parent) {
625 char buf[PREFIX_SIZE];
626
627 res = dev_printk_emit(7, dev->dev.parent,
628 "%s%s %s %s: %pV",
629 dynamic_emit_prefix(descriptor, buf),
630 dev_driver_string(dev->dev.parent),
631 dev_name(dev->dev.parent),
632 netdev_name(dev), &vaf);
633 } else if (dev) {
634 res = printk(KERN_DEBUG "%s: %pV", netdev_name(dev), &vaf);
635 } else {
636 res = printk(KERN_DEBUG "(NULL net_device): %pV", &vaf);
637 }
638
609 va_end(args); 639 va_end(args);
610 640
611 return res; 641 return res;
diff --git a/lib/flex_proportions.c b/lib/flex_proportions.c
index c785554f9523..ebf3bac460b0 100644
--- a/lib/flex_proportions.c
+++ b/lib/flex_proportions.c
@@ -62,7 +62,7 @@ void fprop_global_destroy(struct fprop_global *p)
62 */ 62 */
63bool fprop_new_period(struct fprop_global *p, int periods) 63bool fprop_new_period(struct fprop_global *p, int periods)
64{ 64{
65 u64 events; 65 s64 events;
66 unsigned long flags; 66 unsigned long flags;
67 67
68 local_irq_save(flags); 68 local_irq_save(flags);
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 0401d2916d9f..52e5abbc41db 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -375,14 +375,14 @@ static int uevent_net_init(struct net *net)
375 struct uevent_sock *ue_sk; 375 struct uevent_sock *ue_sk;
376 struct netlink_kernel_cfg cfg = { 376 struct netlink_kernel_cfg cfg = {
377 .groups = 1, 377 .groups = 1,
378 .flags = NL_CFG_F_NONROOT_RECV,
378 }; 379 };
379 380
380 ue_sk = kzalloc(sizeof(*ue_sk), GFP_KERNEL); 381 ue_sk = kzalloc(sizeof(*ue_sk), GFP_KERNEL);
381 if (!ue_sk) 382 if (!ue_sk)
382 return -ENOMEM; 383 return -ENOMEM;
383 384
384 ue_sk->sk = netlink_kernel_create(net, NETLINK_KOBJECT_UEVENT, 385 ue_sk->sk = netlink_kernel_create(net, NETLINK_KOBJECT_UEVENT, &cfg);
385 THIS_MODULE, &cfg);
386 if (!ue_sk->sk) { 386 if (!ue_sk->sk) {
387 printk(KERN_ERR 387 printk(KERN_ERR
388 "kobject_uevent: unable to create netlink socket!\n"); 388 "kobject_uevent: unable to create netlink socket!\n");
@@ -422,7 +422,6 @@ static struct pernet_operations uevent_net_ops = {
422 422
423static int __init kobject_uevent_init(void) 423static int __init kobject_uevent_init(void)
424{ 424{
425 netlink_set_nonroot(NETLINK_KOBJECT_UEVENT, NL_NONROOT_RECV);
426 return register_pernet_subsys(&uevent_net_ops); 425 return register_pernet_subsys(&uevent_net_ops);
427} 426}
428 427
diff --git a/lib/nlattr.c b/lib/nlattr.c
index 4226dfeb5178..18eca7809b08 100644
--- a/lib/nlattr.c
+++ b/lib/nlattr.c
@@ -22,6 +22,10 @@ static const u16 nla_attr_minlen[NLA_TYPE_MAX+1] = {
22 [NLA_U64] = sizeof(u64), 22 [NLA_U64] = sizeof(u64),
23 [NLA_MSECS] = sizeof(u64), 23 [NLA_MSECS] = sizeof(u64),
24 [NLA_NESTED] = NLA_HDRLEN, 24 [NLA_NESTED] = NLA_HDRLEN,
25 [NLA_S8] = sizeof(s8),
26 [NLA_S16] = sizeof(s16),
27 [NLA_S32] = sizeof(s32),
28 [NLA_S64] = sizeof(s64),
25}; 29};
26 30
27static int validate_nla(const struct nlattr *nla, int maxtype, 31static int validate_nla(const struct nlattr *nla, int maxtype,