diff options
author | David S. Miller <davem@davemloft.net> | 2010-04-07 02:53:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-07 02:53:30 -0400 |
commit | 4a35ecf8bf1c4b039503fa554100fe85c761de76 (patch) | |
tree | 9b75f5d5636004d9a9aa496924377379be09aa1f /arch/alpha/kernel/traps.c | |
parent | b4d562e3c3553ac58c7120555c4e4aefbb090a2a (diff) | |
parent | fb9e2d887243499b8d28efcf80821c4f6a092395 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/bonding/bond_main.c
drivers/net/via-velocity.c
drivers/net/wireless/iwlwifi/iwl-agn.c
Diffstat (limited to 'arch/alpha/kernel/traps.c')
-rw-r--r-- | arch/alpha/kernel/traps.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index 6ee7655b7568..b14f015008ad 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/kallsyms.h> | 19 | #include <linux/kallsyms.h> |
20 | #include <linux/ratelimit.h> | ||
20 | 21 | ||
21 | #include <asm/gentrap.h> | 22 | #include <asm/gentrap.h> |
22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
@@ -771,8 +772,7 @@ asmlinkage void | |||
771 | do_entUnaUser(void __user * va, unsigned long opcode, | 772 | do_entUnaUser(void __user * va, unsigned long opcode, |
772 | unsigned long reg, struct pt_regs *regs) | 773 | unsigned long reg, struct pt_regs *regs) |
773 | { | 774 | { |
774 | static int cnt = 0; | 775 | static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5); |
775 | static unsigned long last_time; | ||
776 | 776 | ||
777 | unsigned long tmp1, tmp2, tmp3, tmp4; | 777 | unsigned long tmp1, tmp2, tmp3, tmp4; |
778 | unsigned long fake_reg, *reg_addr = &fake_reg; | 778 | unsigned long fake_reg, *reg_addr = &fake_reg; |
@@ -783,15 +783,11 @@ do_entUnaUser(void __user * va, unsigned long opcode, | |||
783 | with the unaliged access. */ | 783 | with the unaliged access. */ |
784 | 784 | ||
785 | if (!test_thread_flag (TIF_UAC_NOPRINT)) { | 785 | if (!test_thread_flag (TIF_UAC_NOPRINT)) { |
786 | if (cnt >= 5 && time_after(jiffies, last_time + 5 * HZ)) { | 786 | if (__ratelimit(&ratelimit)) { |
787 | cnt = 0; | ||
788 | } | ||
789 | if (++cnt < 5) { | ||
790 | printk("%s(%d): unaligned trap at %016lx: %p %lx %ld\n", | 787 | printk("%s(%d): unaligned trap at %016lx: %p %lx %ld\n", |
791 | current->comm, task_pid_nr(current), | 788 | current->comm, task_pid_nr(current), |
792 | regs->pc - 4, va, opcode, reg); | 789 | regs->pc - 4, va, opcode, reg); |
793 | } | 790 | } |
794 | last_time = jiffies; | ||
795 | } | 791 | } |
796 | if (test_thread_flag (TIF_UAC_SIGBUS)) | 792 | if (test_thread_flag (TIF_UAC_SIGBUS)) |
797 | goto give_sigbus; | 793 | goto give_sigbus; |