aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/unaligned_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/unaligned_64.c')
-rw-r--r--arch/sparc/kernel/unaligned_64.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c
index 378ca82b9ccc..ebce43018c49 100644
--- a/arch/sparc/kernel/unaligned_64.c
+++ b/arch/sparc/kernel/unaligned_64.c
@@ -21,6 +21,7 @@
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/bitops.h> 22#include <linux/bitops.h>
23#include <linux/perf_event.h> 23#include <linux/perf_event.h>
24#include <linux/ratelimit.h>
24#include <asm/fpumacro.h> 25#include <asm/fpumacro.h>
25 26
26enum direction { 27enum direction {
@@ -274,13 +275,9 @@ static void kernel_mna_trap_fault(int fixup_tstate_asi)
274 275
275static void log_unaligned(struct pt_regs *regs) 276static void log_unaligned(struct pt_regs *regs)
276{ 277{
277 static unsigned long count, last_time; 278 static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5);
278 279
279 if (time_after(jiffies, last_time + 5 * HZ)) 280 if (__ratelimit(&ratelimit)) {
280 count = 0;
281 if (count < 5) {
282 last_time = jiffies;
283 count++;
284 printk("Kernel unaligned access at TPC[%lx] %pS\n", 281 printk("Kernel unaligned access at TPC[%lx] %pS\n",
285 regs->tpc, (void *) regs->tpc); 282 regs->tpc, (void *) regs->tpc);
286 } 283 }
@@ -636,7 +633,6 @@ daex:
636 return; 633 return;
637 } 634 }
638 advance(regs); 635 advance(regs);
639 return;
640} 636}
641 637
642void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr) 638void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr)
@@ -685,5 +681,4 @@ daex:
685 return; 681 return;
686 } 682 }
687 advance(regs); 683 advance(regs);
688 return;
689} 684}