Commit b918c62e086b2130a7bae44110ca516ef10bfe5a

Authored by Yinghai Lu
Committed by Bjorn Helgaas
1 parent 92f0243093

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>

Showing 31 changed files with 117 additions and 117 deletions Side-by-side Diff

arch/alpha/kernel/pci.c
... ... @@ -359,7 +359,7 @@
359 359 hose, &resources);
360 360 hose->bus = bus;
361 361 hose->need_domain_info = need_domain_info;
362   - next_busno = bus->subordinate + 1;
  362 + next_busno = bus->busn_res.end + 1;
363 363 /* Don't allow 8-bit bus number overflow inside the hose -
364 364 reserve some space for bridges. */
365 365 if (next_busno > 224) {
arch/arm/kernel/bios32.c
... ... @@ -461,7 +461,7 @@
461 461 if (!sys->bus)
462 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 466 list_add(&sys->node, head);
467 467 } else {
... ... @@ -384,7 +384,7 @@
384 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 388 return pbus;
389 389  
390 390 out3:
arch/microblaze/pci/pci-common.c
... ... @@ -1506,10 +1506,10 @@
1506 1506 pci_free_resource_list(&resources);
1507 1507 return;
1508 1508 }
1509   - bus->secondary = hose->first_busno;
  1509 + bus->busn_res.start = hose->first_busno;
1510 1510 hose->bus = bus;
1511 1511  
1512   - hose->last_busno = bus->subordinate;
  1512 + hose->last_busno = bus->busn_res.end;
1513 1513 }
1514 1514  
1515 1515 static int __init pcibios_init(void)
... ... @@ -102,7 +102,7 @@
102 102 need_domain_info = need_domain_info || hose->index;
103 103 hose->need_domain_info = need_domain_info;
104 104 if (bus) {
105   - next_busno = bus->subordinate + 1;
  105 + next_busno = bus->busn_res.end + 1;
106 106 /* Don't allow 8-bit bus number overflow inside the hose -
107 107 reserve some space for bridges. */
108 108 if (next_busno > 224) {
arch/powerpc/kernel/pci-common.c
... ... @@ -1646,7 +1646,7 @@
1646 1646 pci_free_resource_list(&resources);
1647 1647 return;
1648 1648 }
1649   - bus->secondary = hose->first_busno;
  1649 + bus->busn_res.start = hose->first_busno;
1650 1650 hose->bus = bus;
1651 1651  
1652 1652 /* Get probe mode and perform scan */
1653 1653  
... ... @@ -1655,12 +1655,12 @@
1655 1655 mode = ppc_md.pci_probe_mode(bus);
1656 1656 pr_debug(" probe mode: %d\n", mode);
1657 1657 if (mode == PCI_PROBE_DEVTREE) {
1658   - bus->subordinate = hose->last_busno;
  1658 + bus->busn_res.end = hose->last_busno;
1659 1659 of_scan_bus(node, bus);
1660 1660 }
1661 1661  
1662 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 1665 /* Platform gets a chance to do some global fixups before
1666 1666 * we proceed to resource allocation
arch/powerpc/kernel/pci_64.c
... ... @@ -236,7 +236,7 @@
236 236  
237 237 for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
238 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 240 break;
241 241 bus = NULL;
242 242 }
arch/powerpc/kernel/pci_of_scan.c
... ... @@ -240,7 +240,7 @@
240 240 }
241 241  
242 242 bus->primary = dev->bus->number;
243   - bus->subordinate = busrange[1];
  243 + bus->busn_res.end = busrange[1];
244 244 bus->bridge_ctl = 0;
245 245  
246 246 /* parse ranges property */
arch/powerpc/platforms/powernv/pci-ioda.c
... ... @@ -589,7 +589,7 @@
589 589 dcomp = OPAL_IGNORE_RID_DEVICE_NUMBER;
590 590 fcomp = OPAL_IGNORE_RID_FUNCTION_NUMBER;
591 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 593 switch(count) {
594 594 case 1: bcomp = OpalPciBusAll; break;
595 595 case 2: bcomp = OpalPciBus7Bits; break;
596 596  
... ... @@ -816,11 +816,11 @@
816 816 pe->pdev = NULL;
817 817 pe->tce32_seg = -1;
818 818 pe->mve_number = -1;
819   - pe->rid = bus->secondary << 8;
  819 + pe->rid = bus->busn_res.start << 8;
820 820 pe->dma_weight = 0;
821 821  
822   - pe_info(pe, "Secondary busses %d..%d associated with PE\n",
823   - bus->secondary, bus->subordinate);
  822 + pe_info(pe, "Secondary busses %pR associated with PE\n",
  823 + &bus->busn_res);
824 824  
825 825 if (pnv_ioda_configure_pe(phb, pe)) {
826 826 /* XXX What do we do here ? */
arch/powerpc/platforms/pseries/pci_dlpar.c
... ... @@ -121,7 +121,7 @@
121 121 if (!num)
122 122 return;
123 123 pcibios_setup_bus_devices(bus);
124   - max = bus->secondary;
  124 + max = bus->busn_res.start;
125 125 for (pass=0; pass < 2; pass++)
126 126 list_for_each_entry(dev, &bus->devices, bus_list) {
127 127 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
arch/sh/drivers/pci/pci.c
... ... @@ -59,7 +59,7 @@
59 59 need_domain_info = need_domain_info || hose->index;
60 60 hose->need_domain_info = need_domain_info;
61 61 if (bus) {
62   - next_busno = bus->subordinate + 1;
  62 + next_busno = bus->busn_res.end + 1;
63 63 /* Don't allow 8-bit bus number overflow inside the hose -
64 64 reserve some space for bridges. */
65 65 if (next_busno > 224) {
arch/sparc/kernel/pci.c
... ... @@ -535,7 +535,7 @@
535 535 }
536 536  
537 537 bus->primary = dev->bus->number;
538   - bus->subordinate = busrange[1];
  538 + bus->busn_res.end = busrange[1];
539 539 bus->bridge_ctl = 0;
540 540  
541 541 /* parse ranges property, or cook one up by hand for Simba */
... ... @@ -693,8 +693,8 @@
693 693 pci_free_resource_list(&resources);
694 694 return NULL;
695 695 }
696   - bus->secondary = pbm->pci_first_busno;
697   - bus->subordinate = pbm->pci_last_busno;
  696 + bus->busn_res.start = pbm->pci_first_busno;
  697 + bus->busn_res.end = pbm->pci_last_busno;
698 698  
699 699 pci_of_scan_bus(pbm, node, bus);
700 700 pci_bus_add_devices(bus);
arch/tile/kernel/pci.c
... ... @@ -329,7 +329,7 @@
329 329 */
330 330 bus = pci_scan_bus(0, controller->ops, controller);
331 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 @@
366 366 */
367 367 if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI &&
368 368 (PCI_SLOT(dev->devfn) == 0)) {
369   - next_bus = dev->subordinate;
  369 + next_bus = dev->busn_res.end;
370 370 controllers[i].mem_resources[0] =
371 371 *next_bus->resource[0];
372 372 controllers[i].mem_resources[1] =
... ... @@ -440,7 +440,7 @@
440 440 bus = pci_create_root_bus(NULL, busnum, &pci_root_ops, sd,
441 441 &resources);
442 442 if (bus) {
443   - bus->subordinate = pci_scan_child_bus(bus);
  443 + bus->busn_res.end = pci_scan_child_bus(bus);
444 444 pci_set_host_bridge_release(
445 445 to_pci_host_bridge(bus->bridge),
446 446 release_pci_root_info, info);
arch/xtensa/kernel/pci.c
... ... @@ -187,7 +187,7 @@
187 187 bus = pci_scan_root_bus(NULL, pci_ctrl->first_busno,
188 188 pci_ctrl->ops, pci_ctrl, &resources);
189 189 pci_ctrl->bus = bus;
190   - pci_ctrl->last_busno = bus->subordinate;
  190 + pci_ctrl->last_busno = bus->busn_res.end;
191 191 if (next_busno <= pci_ctrl->last_busno)
192 192 next_busno = pci_ctrl->last_busno+1;
193 193 }
drivers/iommu/intel-iommu.c
... ... @@ -661,7 +661,7 @@
661 661 if (drhd->devices[i] &&
662 662 drhd->devices[i]->subordinate &&
663 663 drhd->devices[i]->subordinate->number <= bus &&
664   - drhd->devices[i]->subordinate->subordinate >= bus)
  664 + drhd->devices[i]->subordinate->busn_res.end >= bus)
665 665 return drhd->iommu;
666 666 }
667 667  
drivers/net/ethernet/broadcom/tg3.c
... ... @@ -14168,7 +14168,7 @@
14168 14168 if (bridge->subordinate &&
14169 14169 (bridge->subordinate->number <=
14170 14170 tp->pdev->bus->number) &&
14171   - (bridge->subordinate->subordinate >=
  14171 + (bridge->subordinate->busn_res.end >=
14172 14172 tp->pdev->bus->number)) {
14173 14173 tg3_flag_set(tp, 5701_DMA_BUG);
14174 14174 pci_dev_put(bridge);
... ... @@ -14196,7 +14196,7 @@
14196 14196 if (bridge && bridge->subordinate &&
14197 14197 (bridge->subordinate->number <=
14198 14198 tp->pdev->bus->number) &&
14199   - (bridge->subordinate->subordinate >=
  14199 + (bridge->subordinate->busn_res.end >=
14200 14200 tp->pdev->bus->number)) {
14201 14201 tg3_flag_set(tp, 40BIT_DMA_BUG);
14202 14202 pci_dev_put(bridge);
drivers/parisc/dino.c
... ... @@ -174,7 +174,7 @@
174 174 int size, u32 *val)
175 175 {
176 176 struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->bridge));
177   - u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
  177 + u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start;
178 178 u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3);
179 179 void __iomem *base_addr = d->hba.base_addr;
180 180 unsigned long flags;
... ... @@ -209,7 +209,7 @@
209 209 int size, u32 val)
210 210 {
211 211 struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->bridge));
212   - u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
  212 + u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start;
213 213 u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3);
214 214 void __iomem *base_addr = d->hba.base_addr;
215 215 unsigned long flags;
... ... @@ -554,7 +554,7 @@
554 554 struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->bridge));
555 555  
556 556 DBG(KERN_WARNING "%s(0x%p) bus %d platform_data 0x%p\n",
557   - __func__, bus, bus->secondary,
  557 + __func__, bus, bus->busn_res.start,
558 558 bus->bridge->platform_data);
559 559  
560 560 /* Firmware doesn't set up card-mode dino, so we have to */
561 561  
... ... @@ -998,12 +998,12 @@
998 998 return 0;
999 999 }
1000 1000  
1001   - bus->subordinate = pci_scan_child_bus(bus);
  1001 + bus->busn_res.end = pci_scan_child_bus(bus);
1002 1002  
1003 1003 /* This code *depends* on scanning being single threaded
1004 1004 * if it isn't, this global bus number count will fail
1005 1005 */
1006   - dino_current_bus = bus->subordinate + 1;
  1006 + dino_current_bus = bus->busn_res.end + 1;
1007 1007 pci_bus_assign_resources(bus);
1008 1008 pci_bus_add_devices(bus);
1009 1009 return 0;
drivers/parisc/iosapic.c
... ... @@ -532,7 +532,7 @@
532 532 intr_slot = PCI_SLOT(pcidev->devfn);
533 533 }
534 534 DBG_IRT("iosapic_xlate_pin: bus %d slot %d pin %d\n",
535   - pcidev->bus->secondary, intr_slot, intr_pin);
  535 + pcidev->bus->busn_res.start, intr_slot, intr_pin);
536 536  
537 537 return irt_find_irqline(isi, intr_slot, intr_pin);
538 538 }
drivers/parisc/lba_pci.c
... ... @@ -189,8 +189,8 @@
189 189  
190 190 static int lba_device_present(u8 bus, u8 dfn, struct lba_device *d)
191 191 {
192   - u8 first_bus = d->hba.hba_bus->secondary;
193   - u8 last_sub_bus = d->hba.hba_bus->subordinate;
  192 + u8 first_bus = d->hba.hba_bus->busn_res.start;
  193 + u8 last_sub_bus = d->hba.hba_bus->busn_res.end;
194 194  
195 195 if ((bus < first_bus) ||
196 196 (bus > last_sub_bus) ||
... ... @@ -364,7 +364,7 @@
364 364 static int elroy_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data)
365 365 {
366 366 struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge));
367   - u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
  367 + u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start;
368 368 u32 tok = LBA_CFG_TOK(local_bus, devfn);
369 369 void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA;
370 370  
... ... @@ -380,7 +380,7 @@
380 380 return 0;
381 381 }
382 382  
383   - if (LBA_SKIP_PROBE(d) && !lba_device_present(bus->secondary, devfn, d)) {
  383 + if (LBA_SKIP_PROBE(d) && !lba_device_present(bus->busn_res.start, devfn, d)) {
384 384 DBG_CFG("%s(%x+%2x) -> -1 (b)\n", __func__, tok, pos);
385 385 /* either don't want to look or know device isn't present. */
386 386 *data = ~0U;
... ... @@ -431,7 +431,7 @@
431 431 static int elroy_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 data)
432 432 {
433 433 struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge));
434   - u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
  434 + u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start;
435 435 u32 tok = LBA_CFG_TOK(local_bus,devfn);
436 436  
437 437 if ((pos > 255) || (devfn > 255))
... ... @@ -444,7 +444,7 @@
444 444 return 0;
445 445 }
446 446  
447   - if (LBA_SKIP_PROBE(d) && (!lba_device_present(bus->secondary, devfn, d))) {
  447 + if (LBA_SKIP_PROBE(d) && (!lba_device_present(bus->busn_res.start, devfn, d))) {
448 448 DBG_CFG("%s(%x+%2x) = 0x%x (b)\n", __func__, tok, pos,data);
449 449 return 1; /* New Workaround */
450 450 }
... ... @@ -481,7 +481,7 @@
481 481 static int mercury_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data)
482 482 {
483 483 struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge));
484   - u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
  484 + u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start;
485 485 u32 tok = LBA_CFG_TOK(local_bus, devfn);
486 486 void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA;
487 487  
... ... @@ -514,7 +514,7 @@
514 514 {
515 515 struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge));
516 516 void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA;
517   - u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary;
  517 + u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start;
518 518 u32 tok = LBA_CFG_TOK(local_bus,devfn);
519 519  
520 520 if ((pos > 255) || (devfn > 255))
... ... @@ -636,7 +636,7 @@
636 636 struct lba_device *ldev = LBA_DEV(parisc_walk_tree(bus->bridge));
637 637  
638 638 DBG("lba_fixup_bus(0x%p) bus %d platform_data 0x%p\n",
639   - bus, bus->secondary, bus->bridge->platform_data);
  639 + bus, (int)bus->busn_res.start, bus->bridge->platform_data);
640 640  
641 641 /*
642 642 ** Properly Setup MMIO resources for this bus.
... ... @@ -1511,7 +1511,7 @@
1511 1511 return 0;
1512 1512 }
1513 1513  
1514   - lba_bus->subordinate = pci_scan_child_bus(lba_bus);
  1514 + lba_bus->busn_res.end = pci_scan_child_bus(lba_bus);
1515 1515  
1516 1516 /* This is in lieu of calling pci_assign_unassigned_resources() */
1517 1517 if (is_pdc_pat()) {
... ... @@ -1541,7 +1541,7 @@
1541 1541 lba_dev->flags |= LBA_FLAG_SKIP_PROBE;
1542 1542 }
1543 1543  
1544   - lba_next_bus = lba_bus->subordinate + 1;
  1544 + lba_next_bus = lba_res->busn_res.end + 1;
1545 1545 pci_bus_add_devices(lba_bus);
1546 1546  
1547 1547 /* Whew! Finally done! Tell services we got this one covered. */
drivers/pci/hotplug/acpiphp_glue.c
... ... @@ -100,11 +100,11 @@
100 100 PCI_PRIMARY_BUS,
101 101 &buses);
102 102  
103   - if (((buses >> 8) & 0xff) != bus->secondary) {
  103 + if (((buses >> 8) & 0xff) != bus->busn_res.start) {
104 104 buses = (buses & 0xff000000)
105 105 | ((unsigned int)(bus->primary) << 0)
106   - | ((unsigned int)(bus->secondary) << 8)
107   - | ((unsigned int)(bus->subordinate) << 16);
  106 + | ((unsigned int)(bus->busn_res.start) << 8)
  107 + | ((unsigned int)(bus->busn_res.end) << 16);
108 108 pci_write_config_dword(bus->self, PCI_PRIMARY_BUS, buses);
109 109 }
110 110 return NOTIFY_OK;
... ... @@ -692,7 +692,7 @@
692 692 * bus->subordinate value because it could have
693 693 * padding in it.
694 694 */
695   - max = bus->secondary;
  695 + max = bus->busn_res.start;
696 696  
697 697 list_for_each(tmp, &bus->children) {
698 698 n = pci_bus_max_busnr(pci_bus_b(tmp));
drivers/pci/hotplug/cpci_hotplug_pci.c
... ... @@ -292,8 +292,8 @@
292 292 (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) {
293 293 /* Find an unused bus number for the new bridge */
294 294 struct pci_bus *child;
295   - unsigned char busnr, start = parent->secondary;
296   - unsigned char end = parent->subordinate;
  295 + unsigned char busnr, start = parent->busn_res.start;
  296 + unsigned char end = parent->busn_res.end;
297 297  
298 298 for (busnr = start; busnr <= end; busnr++) {
299 299 if (!pci_find_bus(pci_domain_nr(parent),
... ... @@ -312,7 +312,7 @@
312 312 pci_dev_put(dev);
313 313 continue;
314 314 }
315   - child->subordinate = pci_do_scan_bus(child);
  315 + child->busn_res.end = pci_do_scan_bus(child);
316 316 pci_bus_size_bridges(child);
317 317 }
318 318 pci_dev_put(dev);
drivers/pci/hotplug/pciehp_pci.c
... ... @@ -37,8 +37,8 @@
37 37 static int __ref pciehp_add_bridge(struct pci_dev *dev)
38 38 {
39 39 struct pci_bus *parent = dev->bus;
40   - int pass, busnr, start = parent->secondary;
41   - int end = parent->subordinate;
  40 + int pass, busnr, start = parent->busn_res.start;
  41 + int end = parent->busn_res.end;
42 42  
43 43 for (busnr = start; busnr <= end; busnr++) {
44 44 if (!pci_find_bus(pci_domain_nr(parent), busnr))
drivers/pci/hotplug/shpchp_pci.c
... ... @@ -64,8 +64,8 @@
64 64 (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) {
65 65 /* Find an unused bus number for the new bridge */
66 66 struct pci_bus *child;
67   - unsigned char busnr, start = parent->secondary;
68   - unsigned char end = parent->subordinate;
  67 + unsigned char busnr, start = parent->busn_res.start;
  68 + unsigned char end = parent->busn_res.end;
69 69 for (busnr = start; busnr <= end; busnr++) {
70 70 if (!pci_find_bus(pci_domain_nr(parent),
71 71 busnr))
... ... @@ -84,7 +84,7 @@
84 84 pci_dev_put(dev);
85 85 continue;
86 86 }
87   - child->subordinate = pci_do_scan_bus(child);
  87 + child->busn_res.end = pci_do_scan_bus(child);
88 88 pci_bus_size_bridges(child);
89 89 }
90 90 pci_configure_slot(dev);
drivers/pci/hotplug/shpchp_sysfs.c
... ... @@ -73,13 +73,13 @@
73 73 }
74 74 }
75 75 out += sprintf(out, "Free resources: bus numbers\n");
76   - for (busnr = bus->secondary; busnr <= bus->subordinate; busnr++) {
  76 + for (busnr = bus->busn_res.start; busnr <= bus->busn_res.end; busnr++) {
77 77 if (!pci_find_bus(pci_domain_nr(bus), busnr))
78 78 break;
79 79 }
80   - if (busnr < bus->subordinate)
  80 + if (busnr < bus->busn_res.end)
81 81 out += sprintf(out, "start = %8.8x, length = %8.8x\n",
82   - busnr, (bus->subordinate - busnr));
  82 + busnr, (int)(bus->busn_res.end - busnr));
83 83  
84 84 return out - buf;
85 85 }
... ... @@ -47,7 +47,7 @@
47 47 if (!child)
48 48 return NULL;
49 49  
50   - child->subordinate = busnr;
  50 + child->busn_res.end = busnr;
51 51 child->dev.parent = bus->bridge;
52 52 rc = pci_bus_add_child(child);
53 53 if (rc) {
... ... @@ -327,7 +327,7 @@
327 327 iov->offset = offset;
328 328 iov->stride = stride;
329 329  
330   - if (virtfn_bus(dev, nr_virtfn - 1) > dev->bus->subordinate) {
  330 + if (virtfn_bus(dev, nr_virtfn - 1) > dev->bus->busn_res.end) {
331 331 dev_err(&dev->dev, "SR-IOV: bus number out of range\n");
332 332 return -ENOMEM;
333 333 }
... ... @@ -110,7 +110,7 @@
110 110 struct list_head *tmp;
111 111 unsigned char max, n;
112 112  
113   - max = bus->subordinate;
  113 + max = bus->busn_res.end;
114 114 list_for_each(tmp, &bus->children) {
115 115 n = pci_bus_max_busnr(pci_bus_b(tmp));
116 116 if(n > max)
... ... @@ -381,8 +381,8 @@
381 381 if (pci_is_root_bus(child)) /* It's a host bus, nothing to read */
382 382 return;
383 383  
384   - dev_info(&dev->dev, "PCI bridge to [bus %02x-%02x]%s\n",
385   - child->secondary, child->subordinate,
  384 + dev_info(&dev->dev, "PCI bridge to %pR%s\n",
  385 + &child->busn_res,
386 386 dev->transparent ? " (subtractive decode)" : "");
387 387  
388 388 pci_bus_remove_resources(child);
... ... @@ -599,9 +599,9 @@
599 599 * Set up the primary, secondary and subordinate
600 600 * bus numbers.
601 601 */
602   - child->number = child->secondary = busnr;
603   - child->primary = parent->secondary;
604   - child->subordinate = 0xff;
  602 + child->number = child->busn_res.start = busnr;
  603 + child->primary = parent->busn_res.start;
  604 + child->busn_res.end = 0xff;
605 605  
606 606 if (!bridge)
607 607 return child;
... ... @@ -643,8 +643,8 @@
643 643 if (!pcibios_assign_all_busses())
644 644 return;
645 645  
646   - while (parent->parent && parent->subordinate < max) {
647   - parent->subordinate = max;
  646 + while (parent->parent && parent->busn_res.end < max) {
  647 + parent->busn_res.end = max;
648 648 pci_write_config_byte(parent->self, PCI_SUBORDINATE_BUS, max);
649 649 parent = parent->parent;
650 650 }
651 651  
... ... @@ -718,15 +718,15 @@
718 718 if (!child)
719 719 goto out;
720 720 child->primary = primary;
721   - child->subordinate = subordinate;
  721 + child->busn_res.end = subordinate;
722 722 child->bridge_ctl = bctl;
723 723 }
724 724  
725 725 cmax = pci_scan_child_bus(child);
726 726 if (cmax > max)
727 727 max = cmax;
728   - if (child->subordinate > max)
729   - max = child->subordinate;
  728 + if (child->busn_res.end > max)
  729 + max = child->busn_res.end;
730 730 } else {
731 731 /*
732 732 * We need to assign a number to this bus which we always
... ... @@ -759,8 +759,8 @@
759 759 }
760 760 buses = (buses & 0xff000000)
761 761 | ((unsigned int)(child->primary) << 0)
762   - | ((unsigned int)(child->secondary) << 8)
763   - | ((unsigned int)(child->subordinate) << 16);
  762 + | ((unsigned int)(child->busn_res.start) << 8)
  763 + | ((unsigned int)(child->busn_res.end) << 16);
764 764  
765 765 /*
766 766 * yenta.c forces a secondary latency timer of 176.
... ... @@ -805,8 +805,8 @@
805 805 break;
806 806 while (parent->parent) {
807 807 if ((!pcibios_assign_all_busses()) &&
808   - (parent->subordinate > max) &&
809   - (parent->subordinate <= max+i)) {
  808 + (parent->busn_res.end > max) &&
  809 + (parent->busn_res.end <= max+i)) {
810 810 j = 1;
811 811 }
812 812 parent = parent->parent;
... ... @@ -827,7 +827,7 @@
827 827 /*
828 828 * Set the subordinate bus number to its real value.
829 829 */
830   - child->subordinate = max;
  830 + child->busn_res.end = max;
831 831 pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max);
832 832 }
833 833  
834 834  
835 835  
... ... @@ -837,19 +837,19 @@
837 837  
838 838 /* Has only triggered on CardBus, fixup is in yenta_socket */
839 839 while (bus->parent) {
840   - if ((child->subordinate > bus->subordinate) ||
841   - (child->number > bus->subordinate) ||
  840 + if ((child->busn_res.end > bus->busn_res.end) ||
  841 + (child->number > bus->busn_res.end) ||
842 842 (child->number < bus->number) ||
843   - (child->subordinate < bus->number)) {
844   - dev_info(&child->dev, "[bus %02x-%02x] %s "
845   - "hidden behind%s bridge %s [bus %02x-%02x]\n",
846   - child->number, child->subordinate,
847   - (bus->number > child->subordinate &&
848   - bus->subordinate < child->number) ?
  843 + (child->busn_res.end < bus->number)) {
  844 + dev_info(&child->dev, "%pR %s "
  845 + "hidden behind%s bridge %s %pR\n",
  846 + &child->busn_res,
  847 + (bus->number > child->busn_res.end &&
  848 + bus->busn_res.end < child->number) ?
849 849 "wholly" : "partially",
850 850 bus->self->transparent ? " transparent" : "",
851 851 dev_name(&bus->dev),
852   - bus->number, bus->subordinate);
  852 + &bus->busn_res);
853 853 }
854 854 bus = bus->parent;
855 855 }
... ... @@ -1548,7 +1548,7 @@
1548 1548  
1549 1549 unsigned 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 1552 struct pci_dev *dev;
1553 1553  
1554 1554 dev_dbg(&bus->dev, "scanning bus\n");
... ... @@ -1642,7 +1642,7 @@
1642 1642 /* Create legacy_io and legacy_mem files for this bus */
1643 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 1647 if (parent)
1648 1648 dev_info(parent, "PCI host bridge to bus %s\n", dev_name(&b->dev));
... ... @@ -1693,7 +1693,7 @@
1693 1693 if (!b)
1694 1694 return NULL;
1695 1695  
1696   - b->subordinate = pci_scan_child_bus(b);
  1696 + b->busn_res.end = pci_scan_child_bus(b);
1697 1697 pci_bus_add_devices(b);
1698 1698 return b;
1699 1699 }
... ... @@ -1710,7 +1710,7 @@
1710 1710 pci_add_resource(&resources, &iomem_resource);
1711 1711 b = pci_create_root_bus(parent, bus, ops, sysdata, &resources);
1712 1712 if (b)
1713   - b->subordinate = pci_scan_child_bus(b);
  1713 + b->busn_res.end = pci_scan_child_bus(b);
1714 1714 else
1715 1715 pci_free_resource_list(&resources);
1716 1716 return b;
... ... @@ -1727,7 +1727,7 @@
1727 1727 pci_add_resource(&resources, &iomem_resource);
1728 1728 b = pci_create_root_bus(NULL, bus, ops, sysdata, &resources);
1729 1729 if (b) {
1730   - b->subordinate = pci_scan_child_bus(b);
  1730 + b->busn_res.end = pci_scan_child_bus(b);
1731 1731 pci_bus_add_devices(b);
1732 1732 } else {
1733 1733 pci_free_resource_list(&resources);
drivers/pci/setup-bus.c
... ... @@ -404,8 +404,8 @@
404 404 struct resource *res;
405 405 struct pci_bus_region region;
406 406  
407   - dev_info(&bridge->dev, "CardBus bridge to [bus %02x-%02x]\n",
408   - bus->secondary, bus->subordinate);
  407 + dev_info(&bridge->dev, "CardBus bridge to %pR\n",
  408 + &bus->busn_res);
409 409  
410 410 res = bus->resource[0];
411 411 pcibios_resource_to_bus(bridge, &region, res);
... ... @@ -553,8 +553,8 @@
553 553 {
554 554 struct pci_dev *bridge = bus->self;
555 555  
556   - dev_info(&bridge->dev, "PCI bridge to [bus %02x-%02x]\n",
557   - bus->secondary, bus->subordinate);
  556 + dev_info(&bridge->dev, "PCI bridge to %pR\n",
  557 + &bus->busn_res);
558 558  
559 559 if (type & IORESOURCE_IO)
560 560 pci_setup_bridge_io(bus);
... ... @@ -745,8 +745,8 @@
745 745 if (!size0 && !size1) {
746 746 if (b_res->start || b_res->end)
747 747 dev_info(&bus->self->dev, "disabling bridge window "
748   - "%pR to [bus %02x-%02x] (unused)\n", b_res,
749   - bus->secondary, bus->subordinate);
  748 + "%pR to %pR (unused)\n", b_res,
  749 + &bus->busn_res);
750 750 b_res->flags = 0;
751 751 return;
752 752 }
... ... @@ -757,8 +757,8 @@
757 757 if (size1 > size0 && realloc_head) {
758 758 add_to_list(realloc_head, bus->self, b_res, size1-size0, 4096);
759 759 dev_printk(KERN_DEBUG, &bus->self->dev, "bridge window "
760   - "%pR to [bus %02x-%02x] add_size %lx\n", b_res,
761   - bus->secondary, bus->subordinate, size1-size0);
  760 + "%pR to %pR add_size %lx\n", b_res,
  761 + &bus->busn_res, size1-size0);
762 762 }
763 763 }
764 764  
... ... @@ -863,8 +863,8 @@
863 863 if (!size0 && !size1) {
864 864 if (b_res->start || b_res->end)
865 865 dev_info(&bus->self->dev, "disabling bridge window "
866   - "%pR to [bus %02x-%02x] (unused)\n", b_res,
867   - bus->secondary, bus->subordinate);
  866 + "%pR to %pR (unused)\n", b_res,
  867 + &bus->busn_res);
868 868 b_res->flags = 0;
869 869 return 1;
870 870 }
... ... @@ -874,8 +874,8 @@
874 874 if (size1 > size0 && realloc_head) {
875 875 add_to_list(realloc_head, bus->self, b_res, size1-size0, min_align);
876 876 dev_printk(KERN_DEBUG, &bus->self->dev, "bridge window "
877   - "%pR to [bus %02x-%02x] add_size %llx\n", b_res,
878   - bus->secondary, bus->subordinate, (unsigned long long)size1-size0);
  877 + "%pR to %pR add_size %llx\n", b_res,
  878 + &bus->busn_res, (unsigned long long)size1-size0);
879 879 }
880 880 return 1;
881 881 }
drivers/pcmcia/cardbus.c
... ... @@ -73,7 +73,7 @@
73 73 s->functions = pci_scan_slot(bus, PCI_DEVFN(0, 0));
74 74 pci_fixup_cardbus(bus);
75 75  
76   - max = bus->secondary;
  76 + max = bus->busn_res.start;
77 77 for (pass = 0; pass < 2; pass++)
78 78 list_for_each_entry(dev, &bus->devices, bus_list)
79 79 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
drivers/pcmcia/yenta_socket.c
... ... @@ -1048,8 +1048,8 @@
1048 1048 config_writeb(socket, PCI_LATENCY_TIMER, 168);
1049 1049 config_writel(socket, PCI_PRIMARY_BUS,
1050 1050 (176 << 24) | /* sec. latency timer */
1051   - (dev->subordinate->subordinate << 16) | /* subordinate bus */
1052   - (dev->subordinate->secondary << 8) | /* secondary bus */
  1051 + ((unsigned int)dev->subordinate->busn_res.end << 16) | /* subordinate bus */
  1052 + ((unsigned int)dev->subordinate->busn_res.start << 8) | /* secondary bus */
1053 1053 dev->subordinate->primary); /* primary bus */
1054 1054  
1055 1055 /*
1056 1056  
... ... @@ -1086,14 +1086,14 @@
1086 1086 struct pci_bus *bridge_to_fix = cardbus_bridge->parent;
1087 1087  
1088 1088 /* Check bus numbers are already set up correctly: */
1089   - if (bridge_to_fix->subordinate >= cardbus_bridge->subordinate)
  1089 + if (bridge_to_fix->busn_res.end >= cardbus_bridge->busn_res.end)
1090 1090 return; /* The subordinate number is ok, nothing to do */
1091 1091  
1092 1092 if (!bridge_to_fix->parent)
1093 1093 return; /* Root bridges are ok */
1094 1094  
1095 1095 /* stay within the limits of the bus range of the parent: */
1096   - upper_limit = bridge_to_fix->parent->subordinate;
  1096 + upper_limit = bridge_to_fix->parent->busn_res.end;
1097 1097  
1098 1098 /* check the bus ranges of all silbling bridges to prevent overlap */
1099 1099 list_for_each(tmp, &bridge_to_fix->parent->children) {
1100 1100  
1101 1101  
1102 1102  
1103 1103  
1104 1104  
1105 1105  
... ... @@ -1104,36 +1104,36 @@
1104 1104 * current upper limit, set the new upper limit to
1105 1105 * the bus number below the silbling's range:
1106 1106 */
1107   - if (silbling->secondary > bridge_to_fix->subordinate
1108   - && silbling->secondary <= upper_limit)
1109   - upper_limit = silbling->secondary - 1;
  1107 + if (silbling->busn_res.start > bridge_to_fix->busn_res.end
  1108 + && silbling->busn_res.start <= upper_limit)
  1109 + upper_limit = silbling->busn_res.start - 1;
1110 1110 }
1111 1111  
1112 1112 /* Show that the wanted subordinate number is not possible: */
1113   - if (cardbus_bridge->subordinate > upper_limit)
  1113 + if (cardbus_bridge->busn_res.end > upper_limit)
1114 1114 dev_printk(KERN_WARNING, &cardbus_bridge->dev,
1115 1115 "Upper limit for fixing this "
1116 1116 "bridge's parent bridge: #%02x\n", upper_limit);
1117 1117  
1118 1118 /* If we have room to increase the bridge's subordinate number, */
1119   - if (bridge_to_fix->subordinate < upper_limit) {
  1119 + if (bridge_to_fix->busn_res.end < upper_limit) {
1120 1120  
1121 1121 /* use the highest number of the hidden bus, within limits */
1122 1122 unsigned char subordinate_to_assign =
1123   - min(cardbus_bridge->subordinate, upper_limit);
  1123 + min_t(int, cardbus_bridge->busn_res.end, upper_limit);
1124 1124  
1125 1125 dev_printk(KERN_INFO, &bridge_to_fix->dev,
1126 1126 "Raising subordinate bus# of parent "
1127 1127 "bus (#%02x) from #%02x to #%02x\n",
1128 1128 bridge_to_fix->number,
1129   - bridge_to_fix->subordinate, subordinate_to_assign);
  1129 + (int)bridge_to_fix->busn_res.end, subordinate_to_assign);
1130 1130  
1131 1131 /* Save the new subordinate in the bus struct of the bridge */
1132   - bridge_to_fix->subordinate = subordinate_to_assign;
  1132 + bridge_to_fix->busn_res.end = subordinate_to_assign;
1133 1133  
1134 1134 /* and update the PCI config space with the new subordinate */
1135 1135 pci_write_config_byte(bridge_to_fix->self,
1136   - PCI_SUBORDINATE_BUS, bridge_to_fix->subordinate);
  1136 + PCI_SUBORDINATE_BUS, bridge_to_fix->busn_res.end);
1137 1137 }
1138 1138 }
1139 1139