aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2012-05-17 21:51:11 -0400
committerBjorn Helgaas <bhelgaas@google.com>2012-06-13 17:42:22 -0400
commitb918c62e086b2130a7bae44110ca516ef10bfe5a (patch)
treee4aee0e76da9a6ddd2d787de63f4ae7ad4d10e59 /drivers/pci/probe.c
parent92f02430934ca1c1e991a1ab3541880575042697 (diff)
PCI: replace struct pci_bus secondary/subordinate with busn_res
Replace the struct pci_bus secondary/subordinate members with the struct resource busn_res. Later we'll build a resource tree of these bus numbers. [bhelgaas: changelog] Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 658ac977cb56..651b096134dc 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -381,8 +381,8 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
381 if (pci_is_root_bus(child)) /* It's a host bus, nothing to read */ 381 if (pci_is_root_bus(child)) /* It's a host bus, nothing to read */
382 return; 382 return;
383 383
384 dev_info(&dev->dev, "PCI bridge to [bus %02x-%02x]%s\n", 384 dev_info(&dev->dev, "PCI bridge to %pR%s\n",
385 child->secondary, child->subordinate, 385 &child->busn_res,
386 dev->transparent ? " (subtractive decode)" : ""); 386 dev->transparent ? " (subtractive decode)" : "");
387 387
388 pci_bus_remove_resources(child); 388 pci_bus_remove_resources(child);
@@ -599,9 +599,9 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent,
599 * Set up the primary, secondary and subordinate 599 * Set up the primary, secondary and subordinate
600 * bus numbers. 600 * bus numbers.
601 */ 601 */
602 child->number = child->secondary = busnr; 602 child->number = child->busn_res.start = busnr;
603 child->primary = parent->secondary; 603 child->primary = parent->busn_res.start;
604 child->subordinate = 0xff; 604 child->busn_res.end = 0xff;
605 605
606 if (!bridge) 606 if (!bridge)
607 return child; 607 return child;
@@ -643,8 +643,8 @@ static void pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
643 if (!pcibios_assign_all_busses()) 643 if (!pcibios_assign_all_busses())
644 return; 644 return;
645 645
646 while (parent->parent && parent->subordinate < max) { 646 while (parent->parent && parent->busn_res.end < max) {
647 parent->subordinate = max; 647 parent->busn_res.end = max;
648 pci_write_config_byte(parent->self, PCI_SUBORDINATE_BUS, max); 648 pci_write_config_byte(parent->self, PCI_SUBORDINATE_BUS, max);
649 parent = parent->parent; 649 parent = parent->parent;
650 } 650 }
@@ -718,15 +718,15 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
718 if (!child) 718 if (!child)
719 goto out; 719 goto out;
720 child->primary = primary; 720 child->primary = primary;
721 child->subordinate = subordinate; 721 child->busn_res.end = subordinate;
722 child->bridge_ctl = bctl; 722 child->bridge_ctl = bctl;
723 } 723 }
724 724
725 cmax = pci_scan_child_bus(child); 725 cmax = pci_scan_child_bus(child);
726 if (cmax > max) 726 if (cmax > max)
727 max = cmax; 727 max = cmax;
728 if (child->subordinate > max) 728 if (child->busn_res.end > max)
729 max = child->subordinate; 729 max = child->busn_res.end;
730 } else { 730 } else {
731 /* 731 /*
732 * We need to assign a number to this bus which we always 732 * We need to assign a number to this bus which we always
@@ -759,8 +759,8 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
759 } 759 }
760 buses = (buses & 0xff000000) 760 buses = (buses & 0xff000000)
761 | ((unsigned int)(child->primary) << 0) 761 | ((unsigned int)(child->primary) << 0)
762 | ((unsigned int)(child->secondary) << 8) 762 | ((unsigned int)(child->busn_res.start) << 8)
763 | ((unsigned int)(child->subordinate) << 16); 763 | ((unsigned int)(child->busn_res.end) << 16);
764 764
765 /* 765 /*
766 * yenta.c forces a secondary latency timer of 176. 766 * yenta.c forces a secondary latency timer of 176.
@@ -805,8 +805,8 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
805 break; 805 break;
806 while (parent->parent) { 806 while (parent->parent) {
807 if ((!pcibios_assign_all_busses()) && 807 if ((!pcibios_assign_all_busses()) &&
808 (parent->subordinate > max) && 808 (parent->busn_res.end > max) &&
809 (parent->subordinate <= max+i)) { 809 (parent->busn_res.end <= max+i)) {
810 j = 1; 810 j = 1;
811 } 811 }
812 parent = parent->parent; 812 parent = parent->parent;
@@ -827,7 +827,7 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
827 /* 827 /*
828 * Set the subordinate bus number to its real value. 828 * Set the subordinate bus number to its real value.
829 */ 829 */
830 child->subordinate = max; 830 child->busn_res.end = max;
831 pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max); 831 pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max);
832 } 832 }
833 833
@@ -837,19 +837,19 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
837 837
838 /* Has only triggered on CardBus, fixup is in yenta_socket */ 838 /* Has only triggered on CardBus, fixup is in yenta_socket */
839 while (bus->parent) { 839 while (bus->parent) {
840 if ((child->subordinate > bus->subordinate) || 840 if ((child->busn_res.end > bus->busn_res.end) ||
841 (child->number > bus->subordinate) || 841 (child->number > bus->busn_res.end) ||
842 (child->number < bus->number) || 842 (child->number < bus->number) ||
843 (child->subordinate < bus->number)) { 843 (child->busn_res.end < bus->number)) {
844 dev_info(&child->dev, "[bus %02x-%02x] %s " 844 dev_info(&child->dev, "%pR %s "
845 "hidden behind%s bridge %s [bus %02x-%02x]\n", 845 "hidden behind%s bridge %s %pR\n",
846 child->number, child->subordinate, 846 &child->busn_res,
847 (bus->number > child->subordinate && 847 (bus->number > child->busn_res.end &&
848 bus->subordinate < child->number) ? 848 bus->busn_res.end < child->number) ?
849 "wholly" : "partially", 849 "wholly" : "partially",
850 bus->self->transparent ? " transparent" : "", 850 bus->self->transparent ? " transparent" : "",
851 dev_name(&bus->dev), 851 dev_name(&bus->dev),
852 bus->number, bus->subordinate); 852 &bus->busn_res);
853 } 853 }
854 bus = bus->parent; 854 bus = bus->parent;
855 } 855 }
@@ -1548,7 +1548,7 @@ EXPORT_SYMBOL_GPL(pcie_bus_configure_settings);
1548 1548
1549unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus) 1549unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
1550{ 1550{
1551 unsigned int devfn, pass, max = bus->secondary; 1551 unsigned int devfn, pass, max = bus->busn_res.start;
1552 struct pci_dev *dev; 1552 struct pci_dev *dev;
1553 1553
1554 dev_dbg(&bus->dev, "scanning bus\n"); 1554 dev_dbg(&bus->dev, "scanning bus\n");
@@ -1642,7 +1642,7 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
1642 /* Create legacy_io and legacy_mem files for this bus */ 1642 /* Create legacy_io and legacy_mem files for this bus */
1643 pci_create_legacy_files(b); 1643 pci_create_legacy_files(b);
1644 1644
1645 b->number = b->secondary = bus; 1645 b->number = b->busn_res.start = bus;
1646 1646
1647 if (parent) 1647 if (parent)
1648 dev_info(parent, "PCI host bridge to bus %s\n", dev_name(&b->dev)); 1648 dev_info(parent, "PCI host bridge to bus %s\n", dev_name(&b->dev));
@@ -1693,7 +1693,7 @@ struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
1693 if (!b) 1693 if (!b)
1694 return NULL; 1694 return NULL;
1695 1695
1696 b->subordinate = pci_scan_child_bus(b); 1696 b->busn_res.end = pci_scan_child_bus(b);
1697 pci_bus_add_devices(b); 1697 pci_bus_add_devices(b);
1698 return b; 1698 return b;
1699} 1699}
@@ -1710,7 +1710,7 @@ struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent,
1710 pci_add_resource(&resources, &iomem_resource); 1710 pci_add_resource(&resources, &iomem_resource);
1711 b = pci_create_root_bus(parent, bus, ops, sysdata, &resources); 1711 b = pci_create_root_bus(parent, bus, ops, sysdata, &resources);
1712 if (b) 1712 if (b)
1713 b->subordinate = pci_scan_child_bus(b); 1713 b->busn_res.end = pci_scan_child_bus(b);
1714 else 1714 else
1715 pci_free_resource_list(&resources); 1715 pci_free_resource_list(&resources);
1716 return b; 1716 return b;
@@ -1727,7 +1727,7 @@ struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops,
1727 pci_add_resource(&resources, &iomem_resource); 1727 pci_add_resource(&resources, &iomem_resource);
1728 b = pci_create_root_bus(NULL, bus, ops, sysdata, &resources); 1728 b = pci_create_root_bus(NULL, bus, ops, sysdata, &resources);
1729 if (b) { 1729 if (b) {
1730 b->subordinate = pci_scan_child_bus(b); 1730 b->busn_res.end = pci_scan_child_bus(b);
1731 pci_bus_add_devices(b); 1731 pci_bus_add_devices(b);
1732 } else { 1732 } else {
1733 pci_free_resource_list(&resources); 1733 pci_free_resource_list(&resources);