diff options
Diffstat (limited to 'arch/powerpc/platforms/iseries/pci.c')
-rw-r--r-- | arch/powerpc/platforms/iseries/pci.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index b841c9a9db87..3fc2e6494b8b 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
33 | #include <linux/pci.h> | 33 | #include <linux/pci.h> |
34 | #include <linux/of.h> | 34 | #include <linux/of.h> |
35 | #include <linux/ratelimit.h> | ||
35 | 36 | ||
36 | #include <asm/types.h> | 37 | #include <asm/types.h> |
37 | #include <asm/io.h> | 38 | #include <asm/io.h> |
@@ -584,14 +585,9 @@ static inline struct device_node *xlate_iomm_address( | |||
584 | 585 | ||
585 | orig_addr = (unsigned long __force)addr; | 586 | orig_addr = (unsigned long __force)addr; |
586 | if ((orig_addr < BASE_IO_MEMORY) || (orig_addr >= max_io_memory)) { | 587 | if ((orig_addr < BASE_IO_MEMORY) || (orig_addr >= max_io_memory)) { |
587 | static unsigned long last_jiffies; | 588 | static DEFINE_RATELIMIT_STATE(ratelimit, 60 * HZ, 10); |
588 | static int num_printed; | ||
589 | 589 | ||
590 | if (time_after(jiffies, last_jiffies + 60 * HZ)) { | 590 | if (__ratelimit(&ratelimit)) |
591 | last_jiffies = jiffies; | ||
592 | num_printed = 0; | ||
593 | } | ||
594 | if (num_printed++ < 10) | ||
595 | printk(KERN_ERR | 591 | printk(KERN_ERR |
596 | "iSeries_%s: invalid access at IO address %p\n", | 592 | "iSeries_%s: invalid access at IO address %p\n", |
597 | func, addr); | 593 | func, addr); |