aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2012-05-17 21:51:12 -0400
committerBjorn Helgaas <bhelgaas@google.com>2012-06-13 17:42:24 -0400
commit30aa80da43a5f23728eae1516e3a1aad40e808dd (patch)
treef60ac025d7648e5b4b0960480e08d11d698b22cc
parentbe8e60d8bed118b19bd7038ac2f6ac6688d072d9 (diff)
parisc/PCI: register busn_res for root buses
Add the host bridge bus number aperture to the resource list. Like the MMIO and I/O port apertures, this is used when assigning resources to hot-added devices or in the case of conflicts. [bhelgaas: changelog, set flags directly, at LBA bus_num init] CC: Kyle McMartin <kyle@mcmartin.ca> CC: Helge Deller <deller@gmx.de> CC: linux-parisc@vger.kernel.org Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--drivers/parisc/dino.c10
-rw-r--r--drivers/parisc/lba_pci.c8
2 files changed, 14 insertions, 4 deletions
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index 70517b0f94e6..ffddc4f64268 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -898,6 +898,7 @@ static int __init dino_probe(struct parisc_device *dev)
898 LIST_HEAD(resources); 898 LIST_HEAD(resources);
899 struct pci_bus *bus; 899 struct pci_bus *bus;
900 unsigned long hpa = dev->hpa.start; 900 unsigned long hpa = dev->hpa.start;
901 int max;
901 902
902 name = "Dino"; 903 name = "Dino";
903 if (is_card_dino(&dev->id)) { 904 if (is_card_dino(&dev->id)) {
@@ -983,6 +984,10 @@ static int __init dino_probe(struct parisc_device *dev)
983 if (dino_dev->hba.gmmio_space.flags) 984 if (dino_dev->hba.gmmio_space.flags)
984 pci_add_resource(&resources, &dino_dev->hba.gmmio_space); 985 pci_add_resource(&resources, &dino_dev->hba.gmmio_space);
985 986
987 dino_dev->hba.bus_num.start = dino_current_bus;
988 dino_dev->hba.bus_num.end = 255;
989 dino_dev->hba.bus_num.flags = IORESOURCE_BUS;
990 pci_add_resource(&resources, &dino_dev->hba.bus_num);
986 /* 991 /*
987 ** It's not used to avoid chicken/egg problems 992 ** It's not used to avoid chicken/egg problems
988 ** with configuration accessor functions. 993 ** with configuration accessor functions.
@@ -998,12 +1003,13 @@ static int __init dino_probe(struct parisc_device *dev)
998 return 0; 1003 return 0;
999 } 1004 }
1000 1005
1001 bus->busn_res.end = pci_scan_child_bus(bus); 1006 max = pci_scan_child_bus(bus);
1007 pci_bus_update_busn_res_end(bus, max);
1002 1008
1003 /* This code *depends* on scanning being single threaded 1009 /* This code *depends* on scanning being single threaded
1004 * if it isn't, this global bus number count will fail 1010 * if it isn't, this global bus number count will fail
1005 */ 1011 */
1006 dino_current_bus = bus->busn_res.end + 1; 1012 dino_current_bus = max + 1;
1007 pci_bus_assign_resources(bus); 1013 pci_bus_assign_resources(bus);
1008 pci_bus_add_devices(bus); 1014 pci_bus_add_devices(bus);
1009 return 0; 1015 return 0;
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index cd8f9ce8720f..4f9cf2456f4e 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -989,6 +989,7 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev)
989 case PAT_PBNUM: 989 case PAT_PBNUM:
990 lba_dev->hba.bus_num.start = p->start; 990 lba_dev->hba.bus_num.start = p->start;
991 lba_dev->hba.bus_num.end = p->end; 991 lba_dev->hba.bus_num.end = p->end;
992 lba_dev->hba.bus_num.flags = IORESOURCE_BUS;
992 break; 993 break;
993 994
994 case PAT_LMMIO: 995 case PAT_LMMIO:
@@ -1366,6 +1367,7 @@ lba_driver_probe(struct parisc_device *dev)
1366 void *tmp_obj; 1367 void *tmp_obj;
1367 char *version; 1368 char *version;
1368 void __iomem *addr = ioremap_nocache(dev->hpa.start, 4096); 1369 void __iomem *addr = ioremap_nocache(dev->hpa.start, 4096);
1370 int max;
1369 1371
1370 /* Read HW Rev First */ 1372 /* Read HW Rev First */
1371 func_class = READ_REG32(addr + LBA_FCLASS); 1373 func_class = READ_REG32(addr + LBA_FCLASS);
@@ -1502,6 +1504,8 @@ lba_driver_probe(struct parisc_device *dev)
1502 if (lba_dev->hba.gmmio_space.flags) 1504 if (lba_dev->hba.gmmio_space.flags)
1503 pci_add_resource(&resources, &lba_dev->hba.gmmio_space); 1505 pci_add_resource(&resources, &lba_dev->hba.gmmio_space);
1504 1506
1507 pci_add_resource(&resources, &lba_dev->hba.bus_num);
1508
1505 dev->dev.platform_data = lba_dev; 1509 dev->dev.platform_data = lba_dev;
1506 lba_bus = lba_dev->hba.hba_bus = 1510 lba_bus = lba_dev->hba.hba_bus =
1507 pci_create_root_bus(&dev->dev, lba_dev->hba.bus_num.start, 1511 pci_create_root_bus(&dev->dev, lba_dev->hba.bus_num.start,
@@ -1511,7 +1515,7 @@ lba_driver_probe(struct parisc_device *dev)
1511 return 0; 1515 return 0;
1512 } 1516 }
1513 1517
1514 lba_bus->busn_res.end = pci_scan_child_bus(lba_bus); 1518 max = pci_scan_child_bus(lba_bus);
1515 1519
1516 /* This is in lieu of calling pci_assign_unassigned_resources() */ 1520 /* This is in lieu of calling pci_assign_unassigned_resources() */
1517 if (is_pdc_pat()) { 1521 if (is_pdc_pat()) {
@@ -1541,7 +1545,7 @@ lba_driver_probe(struct parisc_device *dev)
1541 lba_dev->flags |= LBA_FLAG_SKIP_PROBE; 1545 lba_dev->flags |= LBA_FLAG_SKIP_PROBE;
1542 } 1546 }
1543 1547
1544 lba_next_bus = lba_res->busn_res.end + 1; 1548 lba_next_bus = max + 1;
1545 pci_bus_add_devices(lba_bus); 1549 pci_bus_add_devices(lba_bus);
1546 1550
1547 /* Whew! Finally done! Tell services we got this one covered. */ 1551 /* Whew! Finally done! Tell services we got this one covered. */