aboutsummaryrefslogtreecommitdiffstats
path: root/arch
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 /arch
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 'arch')
-rw-r--r--arch/alpha/kernel/pci.c2
-rw-r--r--arch/arm/kernel/bios32.c2
-rw-r--r--arch/ia64/pci/pci.c2
-rw-r--r--arch/microblaze/pci/pci-common.c4
-rw-r--r--arch/mips/pci/pci.c2
-rw-r--r--arch/powerpc/kernel/pci-common.c6
-rw-r--r--arch/powerpc/kernel/pci_64.c2
-rw-r--r--arch/powerpc/kernel/pci_of_scan.c2
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c8
-rw-r--r--arch/powerpc/platforms/pseries/pci_dlpar.c2
-rw-r--r--arch/sh/drivers/pci/pci.c2
-rw-r--r--arch/sparc/kernel/pci.c6
-rw-r--r--arch/tile/kernel/pci.c4
-rw-r--r--arch/x86/pci/acpi.c2
-rw-r--r--arch/xtensa/kernel/pci.c2
15 files changed, 24 insertions, 24 deletions
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 1a629636cc16..53229a496311 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -359,7 +359,7 @@ common_init_pci(void)
359 hose, &resources); 359 hose, &resources);
360 hose->bus = bus; 360 hose->bus = bus;
361 hose->need_domain_info = need_domain_info; 361 hose->need_domain_info = need_domain_info;
362 next_busno = bus->subordinate + 1; 362 next_busno = bus->busn_res.end + 1;
363 /* Don't allow 8-bit bus number overflow inside the hose - 363 /* Don't allow 8-bit bus number overflow inside the hose -
364 reserve some space for bridges. */ 364 reserve some space for bridges. */
365 if (next_busno > 224) { 365 if (next_busno > 224) {
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 25552508c3fd..f07710849b58 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -461,7 +461,7 @@ static void __init pcibios_init_hw(struct hw_pci *hw, struct list_head *head)
461 if (!sys->bus) 461 if (!sys->bus)
462 panic("PCI: unable to scan bus!"); 462 panic("PCI: unable to scan bus!");
463 463
464 busnr = sys->bus->subordinate + 1; 464 busnr = sys->bus->busn_res.end + 1;
465 465
466 list_add(&sys->node, head); 466 list_add(&sys->node, head);
467 } else { 467 } else {
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 524df4295c90..3ca9bed7dc50 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -384,7 +384,7 @@ pci_acpi_scan_root(struct acpi_pci_root *root)
384 return NULL; 384 return NULL;
385 } 385 }
386 386
387 pbus->subordinate = pci_scan_child_bus(pbus); 387 pbus->busn_res.end = pci_scan_child_bus(pbus);
388 return pbus; 388 return pbus;
389 389
390out3: 390out3:
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index ed22bfc5db14..9b32483cd0c0 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -1506,10 +1506,10 @@ static void __devinit pcibios_scan_phb(struct pci_controller *hose)
1506 pci_free_resource_list(&resources); 1506 pci_free_resource_list(&resources);
1507 return; 1507 return;
1508 } 1508 }
1509 bus->secondary = hose->first_busno; 1509 bus->busn_res.start = hose->first_busno;
1510 hose->bus = bus; 1510 hose->bus = bus;
1511 1511
1512 hose->last_busno = bus->subordinate; 1512 hose->last_busno = bus->busn_res.end;
1513} 1513}
1514 1514
1515static int __init pcibios_init(void) 1515static int __init pcibios_init(void)
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 271e8c4a54c7..0a9bf778edb5 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -102,7 +102,7 @@ static void __devinit pcibios_scanbus(struct pci_controller *hose)
102 need_domain_info = need_domain_info || hose->index; 102 need_domain_info = need_domain_info || hose->index;
103 hose->need_domain_info = need_domain_info; 103 hose->need_domain_info = need_domain_info;
104 if (bus) { 104 if (bus) {
105 next_busno = bus->subordinate + 1; 105 next_busno = bus->busn_res.end + 1;
106 /* Don't allow 8-bit bus number overflow inside the hose - 106 /* Don't allow 8-bit bus number overflow inside the hose -
107 reserve some space for bridges. */ 107 reserve some space for bridges. */
108 if (next_busno > 224) { 108 if (next_busno > 224) {
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 8e78e93c8185..3532b535698a 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1646,7 +1646,7 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
1646 pci_free_resource_list(&resources); 1646 pci_free_resource_list(&resources);
1647 return; 1647 return;
1648 } 1648 }
1649 bus->secondary = hose->first_busno; 1649 bus->busn_res.start = hose->first_busno;
1650 hose->bus = bus; 1650 hose->bus = bus;
1651 1651
1652 /* Get probe mode and perform scan */ 1652 /* Get probe mode and perform scan */
@@ -1655,12 +1655,12 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
1655 mode = ppc_md.pci_probe_mode(bus); 1655 mode = ppc_md.pci_probe_mode(bus);
1656 pr_debug(" probe mode: %d\n", mode); 1656 pr_debug(" probe mode: %d\n", mode);
1657 if (mode == PCI_PROBE_DEVTREE) { 1657 if (mode == PCI_PROBE_DEVTREE) {
1658 bus->subordinate = hose->last_busno; 1658 bus->busn_res.end = hose->last_busno;
1659 of_scan_bus(node, bus); 1659 of_scan_bus(node, bus);
1660 } 1660 }
1661 1661
1662 if (mode == PCI_PROBE_NORMAL) 1662 if (mode == PCI_PROBE_NORMAL)
1663 hose->last_busno = bus->subordinate = pci_scan_child_bus(bus); 1663 hose->last_busno = bus->busn_res.end = pci_scan_child_bus(bus);
1664 1664
1665 /* Platform gets a chance to do some global fixups before 1665 /* Platform gets a chance to do some global fixups before
1666 * we proceed to resource allocation 1666 * we proceed to resource allocation
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 94a54f61d341..4ff190ff24a0 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -236,7 +236,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
236 236
237 for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) { 237 for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
238 bus = pci_bus_b(ln); 238 bus = pci_bus_b(ln);
239 if (in_bus >= bus->number && in_bus <= bus->subordinate) 239 if (in_bus >= bus->number && in_bus <= bus->busn_res.end)
240 break; 240 break;
241 bus = NULL; 241 bus = NULL;
242 } 242 }
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 89dde171a6fa..a36281aa98f3 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -240,7 +240,7 @@ void __devinit of_scan_pci_bridge(struct pci_dev *dev)
240 } 240 }
241 241
242 bus->primary = dev->bus->number; 242 bus->primary = dev->bus->number;
243 bus->subordinate = busrange[1]; 243 bus->busn_res.end = busrange[1];
244 bus->bridge_ctl = 0; 244 bus->bridge_ctl = 0;
245 245
246 /* parse ranges property */ 246 /* parse ranges property */
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index fbdd74dac3ac..9cda6a1ad0cf 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -589,7 +589,7 @@ static int __devinit pnv_ioda_configure_pe(struct pnv_phb *phb,
589 dcomp = OPAL_IGNORE_RID_DEVICE_NUMBER; 589 dcomp = OPAL_IGNORE_RID_DEVICE_NUMBER;
590 fcomp = OPAL_IGNORE_RID_FUNCTION_NUMBER; 590 fcomp = OPAL_IGNORE_RID_FUNCTION_NUMBER;
591 parent = pe->pbus->self; 591 parent = pe->pbus->self;
592 count = pe->pbus->subordinate - pe->pbus->secondary + 1; 592 count = pe->pbus->busn_res.end - pe->pbus->busn_res.start + 1;
593 switch(count) { 593 switch(count) {
594 case 1: bcomp = OpalPciBusAll; break; 594 case 1: bcomp = OpalPciBusAll; break;
595 case 2: bcomp = OpalPciBus7Bits; break; 595 case 2: bcomp = OpalPciBus7Bits; break;
@@ -816,11 +816,11 @@ static void __devinit pnv_ioda_setup_bus_PE(struct pci_dev *dev,
816 pe->pdev = NULL; 816 pe->pdev = NULL;
817 pe->tce32_seg = -1; 817 pe->tce32_seg = -1;
818 pe->mve_number = -1; 818 pe->mve_number = -1;
819 pe->rid = bus->secondary << 8; 819 pe->rid = bus->busn_res.start << 8;
820 pe->dma_weight = 0; 820 pe->dma_weight = 0;
821 821
822 pe_info(pe, "Secondary busses %d..%d associated with PE\n", 822 pe_info(pe, "Secondary busses %pR associated with PE\n",
823 bus->secondary, bus->subordinate); 823 &bus->busn_res);
824 824
825 if (pnv_ioda_configure_pe(phb, pe)) { 825 if (pnv_ioda_configure_pe(phb, pe)) {
826 /* XXX What do we do here ? */ 826 /* XXX What do we do here ? */
diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c b/arch/powerpc/platforms/pseries/pci_dlpar.c
index 8b7bafa489c2..3ccebc83dc02 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -121,7 +121,7 @@ void pcibios_add_pci_devices(struct pci_bus * bus)
121 if (!num) 121 if (!num)
122 return; 122 return;
123 pcibios_setup_bus_devices(bus); 123 pcibios_setup_bus_devices(bus);
124 max = bus->secondary; 124 max = bus->busn_res.start;
125 for (pass=0; pass < 2; pass++) 125 for (pass=0; pass < 2; pass++)
126 list_for_each_entry(dev, &bus->devices, bus_list) { 126 list_for_each_entry(dev, &bus->devices, bus_list) {
127 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE || 127 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index 9d10a3cb8797..43068dcb451c 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -59,7 +59,7 @@ static void __devinit pcibios_scanbus(struct pci_channel *hose)
59 need_domain_info = need_domain_info || hose->index; 59 need_domain_info = need_domain_info || hose->index;
60 hose->need_domain_info = need_domain_info; 60 hose->need_domain_info = need_domain_info;
61 if (bus) { 61 if (bus) {
62 next_busno = bus->subordinate + 1; 62 next_busno = bus->busn_res.end + 1;
63 /* Don't allow 8-bit bus number overflow inside the hose - 63 /* Don't allow 8-bit bus number overflow inside the hose -
64 reserve some space for bridges. */ 64 reserve some space for bridges. */
65 if (next_busno > 224) { 65 if (next_busno > 224) {
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index fdaf21811670..c85bfd788f74 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -535,7 +535,7 @@ static void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm,
535 } 535 }
536 536
537 bus->primary = dev->bus->number; 537 bus->primary = dev->bus->number;
538 bus->subordinate = busrange[1]; 538 bus->busn_res.end = busrange[1];
539 bus->bridge_ctl = 0; 539 bus->bridge_ctl = 0;
540 540
541 /* parse ranges property, or cook one up by hand for Simba */ 541 /* parse ranges property, or cook one up by hand for Simba */
@@ -693,8 +693,8 @@ struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm,
693 pci_free_resource_list(&resources); 693 pci_free_resource_list(&resources);
694 return NULL; 694 return NULL;
695 } 695 }
696 bus->secondary = pbm->pci_first_busno; 696 bus->busn_res.start = pbm->pci_first_busno;
697 bus->subordinate = pbm->pci_last_busno; 697 bus->busn_res.end = pbm->pci_last_busno;
698 698
699 pci_of_scan_bus(pbm, node, bus); 699 pci_of_scan_bus(pbm, node, bus);
700 pci_bus_add_devices(bus); 700 pci_bus_add_devices(bus);
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c
index b56d12bf5900..54cc8d77c90c 100644
--- a/arch/tile/kernel/pci.c
+++ b/arch/tile/kernel/pci.c
@@ -329,7 +329,7 @@ int __init pcibios_init(void)
329 */ 329 */
330 bus = pci_scan_bus(0, controller->ops, controller); 330 bus = pci_scan_bus(0, controller->ops, controller);
331 controller->root_bus = bus; 331 controller->root_bus = bus;
332 controller->last_busno = bus->subordinate; 332 controller->last_busno = bus->busn_res.end;
333 } 333 }
334 } 334 }
335 335
@@ -366,7 +366,7 @@ int __init pcibios_init(void)
366 */ 366 */
367 if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && 367 if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI &&
368 (PCI_SLOT(dev->devfn) == 0)) { 368 (PCI_SLOT(dev->devfn) == 0)) {
369 next_bus = dev->subordinate; 369 next_bus = dev->busn_res.end;
370 controllers[i].mem_resources[0] = 370 controllers[i].mem_resources[0] =
371 *next_bus->resource[0]; 371 *next_bus->resource[0];
372 controllers[i].mem_resources[1] = 372 controllers[i].mem_resources[1] =
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index fc09c2754e08..350fe63c8a42 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -440,7 +440,7 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root)
440 bus = pci_create_root_bus(NULL, busnum, &pci_root_ops, sd, 440 bus = pci_create_root_bus(NULL, busnum, &pci_root_ops, sd,
441 &resources); 441 &resources);
442 if (bus) { 442 if (bus) {
443 bus->subordinate = pci_scan_child_bus(bus); 443 bus->busn_res.end = pci_scan_child_bus(bus);
444 pci_set_host_bridge_release( 444 pci_set_host_bridge_release(
445 to_pci_host_bridge(bus->bridge), 445 to_pci_host_bridge(bus->bridge),
446 release_pci_root_info, info); 446 release_pci_root_info, info);
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c
index eb30e356f5be..9c57c1e6870c 100644
--- a/arch/xtensa/kernel/pci.c
+++ b/arch/xtensa/kernel/pci.c
@@ -187,7 +187,7 @@ static int __init pcibios_init(void)
187 bus = pci_scan_root_bus(NULL, pci_ctrl->first_busno, 187 bus = pci_scan_root_bus(NULL, pci_ctrl->first_busno,
188 pci_ctrl->ops, pci_ctrl, &resources); 188 pci_ctrl->ops, pci_ctrl, &resources);
189 pci_ctrl->bus = bus; 189 pci_ctrl->bus = bus;
190 pci_ctrl->last_busno = bus->subordinate; 190 pci_ctrl->last_busno = bus->busn_res.end;
191 if (next_busno <= pci_ctrl->last_busno) 191 if (next_busno <= pci_ctrl->last_busno)
192 next_busno = pci_ctrl->last_busno+1; 192 next_busno = pci_ctrl->last_busno+1;
193 } 193 }