aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-05-04 10:22:57 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-05-05 19:25:41 -0400
commita0b8e76facbb1f12e4b43a2b7b88bd5d18a3faf5 (patch)
tree1edfccd2c565c1e9ad91554745c4521268d51656 /arch/powerpc/kernel
parent4ea9008b75cdd6781207b73f4c01b6a877a0bb60 (diff)
powerpc/pci: Don't add bogus empty resources to PHBs
When converting to use the new pci_add_resource_offset() we didn't properly account for empty resources (0 flags) and add those bogons to the PHBs. The result is some annoying messages in the log. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/pci-common.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index d5811d8cc2c6..cf00588b0023 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1540,12 +1540,16 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose,
1540 res->flags = IORESOURCE_IO; 1540 res->flags = IORESOURCE_IO;
1541#endif /* CONFIG_PPC32 */ 1541#endif /* CONFIG_PPC32 */
1542 } 1542 }
1543 if (res->flags) {
1544 pr_debug("PCI: PHB IO resource = %016llx-%016llx [%lx]\n",
1545 (unsigned long long)res->start,
1546 (unsigned long long)res->end,
1547 (unsigned long)res->flags);
1548 pci_add_resource_offset(resources, res, pcibios_io_space_offset(hose));
1543 1549
1544 pr_debug("PCI: PHB IO resource = %016llx-%016llx [%lx]\n", 1550 pr_debug("PCI: PHB IO offset = %08lx\n",
1545 (unsigned long long)res->start, 1551 (unsigned long)hose->io_base_virt - _IO_BASE);
1546 (unsigned long long)res->end, 1552 }
1547 (unsigned long)res->flags);
1548 pci_add_resource_offset(resources, res, pcibios_io_space_offset(hose));
1549 1553
1550 /* Hookup PHB Memory resources */ 1554 /* Hookup PHB Memory resources */
1551 for (i = 0; i < 3; ++i) { 1555 for (i = 0; i < 3; ++i) {
@@ -1563,19 +1567,17 @@ static void pcibios_setup_phb_resources(struct pci_controller *hose,
1563 res->flags = IORESOURCE_MEM; 1567 res->flags = IORESOURCE_MEM;
1564#endif /* CONFIG_PPC32 */ 1568#endif /* CONFIG_PPC32 */
1565 } 1569 }
1566 1570 if (res->flags) {
1567 pr_debug("PCI: PHB MEM resource %d = %016llx-%016llx [%lx]\n", i, 1571 pr_debug("PCI: PHB MEM resource %d = %016llx-%016llx [%lx]\n", i,
1568 (unsigned long long)res->start, 1572 (unsigned long long)res->start,
1569 (unsigned long long)res->end, 1573 (unsigned long long)res->end,
1570 (unsigned long)res->flags); 1574 (unsigned long)res->flags);
1571 pci_add_resource_offset(resources, res, hose->pci_mem_offset); 1575 pci_add_resource_offset(resources, res, hose->pci_mem_offset);
1576 }
1572 } 1577 }
1573 1578
1574 pr_debug("PCI: PHB MEM offset = %016llx\n", 1579 pr_debug("PCI: PHB MEM offset = %016llx\n",
1575 (unsigned long long)hose->pci_mem_offset); 1580 (unsigned long long)hose->pci_mem_offset);
1576 pr_debug("PCI: PHB IO offset = %08lx\n",
1577 (unsigned long)hose->io_base_virt - _IO_BASE);
1578
1579} 1581}
1580 1582
1581/* 1583/*