aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/iseries/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/iseries/pci.c')
-rw-r--r--arch/powerpc/platforms/iseries/pci.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c
index 175aac8ca7e5..ab3962b0d246 100644
--- a/arch/powerpc/platforms/iseries/pci.c
+++ b/arch/powerpc/platforms/iseries/pci.c
@@ -27,10 +27,12 @@
27#include <linux/kernel.h> 27#include <linux/kernel.h>
28#include <linux/list.h> 28#include <linux/list.h>
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/slab.h>
30#include <linux/init.h> 31#include <linux/init.h>
31#include <linux/module.h> 32#include <linux/module.h>
32#include <linux/pci.h> 33#include <linux/pci.h>
33#include <linux/of.h> 34#include <linux/of.h>
35#include <linux/ratelimit.h>
34 36
35#include <asm/types.h> 37#include <asm/types.h>
36#include <asm/io.h> 38#include <asm/io.h>
@@ -443,7 +445,11 @@ void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
443 } 445 }
444 446
445 allocate_device_bars(pdev); 447 allocate_device_bars(pdev);
446 iseries_device_information(pdev, bus, *sub_bus); 448 if (likely(sub_bus))
449 iseries_device_information(pdev, bus, *sub_bus);
450 else
451 printk(KERN_ERR "PCI: Device node %s has missing or invalid "
452 "linux,subbus property\n", node->full_name);
447} 453}
448 454
449/* 455/*
@@ -583,14 +589,9 @@ static inline struct device_node *xlate_iomm_address(
583 589
584 orig_addr = (unsigned long __force)addr; 590 orig_addr = (unsigned long __force)addr;
585 if ((orig_addr < BASE_IO_MEMORY) || (orig_addr >= max_io_memory)) { 591 if ((orig_addr < BASE_IO_MEMORY) || (orig_addr >= max_io_memory)) {
586 static unsigned long last_jiffies; 592 static DEFINE_RATELIMIT_STATE(ratelimit, 60 * HZ, 10);
587 static int num_printed;
588 593
589 if (time_after(jiffies, last_jiffies + 60 * HZ)) { 594 if (__ratelimit(&ratelimit))
590 last_jiffies = jiffies;
591 num_printed = 0;
592 }
593 if (num_printed++ < 10)
594 printk(KERN_ERR 595 printk(KERN_ERR
595 "iSeries_%s: invalid access at IO address %p\n", 596 "iSeries_%s: invalid access at IO address %p\n",
596 func, addr); 597 func, addr);