aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2011-10-28 18:27:12 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2012-01-06 15:11:04 -0500
commit7590e500ad83d9ac1e55eed4720e053eff14b8e5 (patch)
tree51ced30298d09142f18aad42d47a0be507263771 /drivers/parisc
parentc4e06576282c5f91549b344fd0f516c421332b68 (diff)
parisc/PCI: dino: convert to pci_create_root_bus() for correct root bus resources
Supply root bus resources to pci_create_root_bus() so they're correct immediately. This fixes the problem of "early" and "header" quirks seeing incorrect root bus resources. CC: linux-parisc@vger.kernel.org Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/parisc')
-rw-r--r--drivers/parisc/dino.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index 90252c016a08..7ff10c1e8664 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -562,19 +562,6 @@ dino_fixup_bus(struct pci_bus *bus)
562 /* Firmware doesn't set up card-mode dino, so we have to */ 562 /* Firmware doesn't set up card-mode dino, so we have to */
563 if (is_card_dino(&dino_dev->hba.dev->id)) { 563 if (is_card_dino(&dino_dev->hba.dev->id)) {
564 dino_card_setup(bus, dino_dev->hba.base_addr); 564 dino_card_setup(bus, dino_dev->hba.base_addr);
565 } else if(bus->parent == NULL) {
566 /* must have a dino above it, reparent the resources
567 * into the dino window */
568 int i;
569 struct resource *res = &dino_dev->hba.lmmio_space;
570
571 bus->resource[0] = &(dino_dev->hba.io_space);
572 for(i = 0; i < DINO_MAX_LMMIO_RESOURCES; i++) {
573 if(res[i].flags == 0)
574 break;
575 bus->resource[i+1] = &res[i];
576 }
577
578 } else if (bus->parent) { 565 } else if (bus->parent) {
579 int i; 566 int i;
580 567
@@ -927,6 +914,7 @@ static int __init dino_probe(struct parisc_device *dev)
927 const char *version = "unknown"; 914 const char *version = "unknown";
928 char *name; 915 char *name;
929 int is_cujo = 0; 916 int is_cujo = 0;
917 LIST_HEAD(resources);
930 struct pci_bus *bus; 918 struct pci_bus *bus;
931 unsigned long hpa = dev->hpa.start; 919 unsigned long hpa = dev->hpa.start;
932 920
@@ -1003,15 +991,24 @@ static int __init dino_probe(struct parisc_device *dev)
1003 991
1004 dev->dev.platform_data = dino_dev; 992 dev->dev.platform_data = dino_dev;
1005 993
994 pci_add_resource(&resources, &dino_dev->hba.io_space);
995 if (dino_dev->hba.lmmio_space.flags)
996 pci_add_resource(&resources, &dino_dev->hba.lmmio_space);
997 if (dino_dev->hba.elmmio_space.flags)
998 pci_add_resource(&resources, &dino_dev->hba.elmmio_space);
999 if (dino_dev->hba.gmmio_space.flags)
1000 pci_add_resource(&resources, &dino_dev->hba.gmmio_space);
1001
1006 /* 1002 /*
1007 ** It's not used to avoid chicken/egg problems 1003 ** It's not used to avoid chicken/egg problems
1008 ** with configuration accessor functions. 1004 ** with configuration accessor functions.
1009 */ 1005 */
1010 dino_dev->hba.hba_bus = bus = pci_create_bus(&dev->dev, 1006 dino_dev->hba.hba_bus = bus = pci_create_root_bus(&dev->dev,
1011 dino_current_bus, &dino_cfg_ops, NULL); 1007 dino_current_bus, &dino_cfg_ops, NULL, &resources);
1012 if (!bus) { 1008 if (!bus) {
1013 printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (duplicate bus number %d?)\n", 1009 printk(KERN_ERR "ERROR: failed to scan PCI bus on %s (duplicate bus number %d?)\n",
1014 dev_name(&dev->dev), dino_current_bus); 1010 dev_name(&dev->dev), dino_current_bus);
1011 pci_free_resource_list(&resources);
1015 /* increment the bus number in case of duplicates */ 1012 /* increment the bus number in case of duplicates */
1016 dino_current_bus++; 1013 dino_current_bus++;
1017 return 0; 1014 return 0;