diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2011-10-28 18:27:27 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2012-01-06 15:11:07 -0500 |
commit | dc7dce280a26d069ad5a58bf3da86e5e83415c65 (patch) | |
tree | 181abbd6f6d35ce9391a3535fb6675a35ce9a473 /drivers/parisc | |
parent | 42605fa6665ea86bbbd4de61693a0b002830277b (diff) |
parisc/PCI: lba: 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/lba_pci.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index e5dfa25e2fd..d5f3d753a10 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c | |||
@@ -653,7 +653,7 @@ lba_fixup_bus(struct pci_bus *bus) | |||
653 | } | 653 | } |
654 | } else { | 654 | } else { |
655 | /* Host-PCI Bridge */ | 655 | /* Host-PCI Bridge */ |
656 | int err, i; | 656 | int err; |
657 | 657 | ||
658 | DBG("lba_fixup_bus() %s [%lx/%lx]/%lx\n", | 658 | DBG("lba_fixup_bus() %s [%lx/%lx]/%lx\n", |
659 | ldev->hba.io_space.name, | 659 | ldev->hba.io_space.name, |
@@ -669,9 +669,6 @@ lba_fixup_bus(struct pci_bus *bus) | |||
669 | lba_dump_res(&ioport_resource, 2); | 669 | lba_dump_res(&ioport_resource, 2); |
670 | BUG(); | 670 | BUG(); |
671 | } | 671 | } |
672 | /* advertize Host bridge resources to PCI bus */ | ||
673 | bus->resource[0] = &(ldev->hba.io_space); | ||
674 | i = 1; | ||
675 | 672 | ||
676 | if (ldev->hba.elmmio_space.start) { | 673 | if (ldev->hba.elmmio_space.start) { |
677 | err = request_resource(&iomem_resource, | 674 | err = request_resource(&iomem_resource, |
@@ -685,8 +682,7 @@ lba_fixup_bus(struct pci_bus *bus) | |||
685 | 682 | ||
686 | /* lba_dump_res(&iomem_resource, 2); */ | 683 | /* lba_dump_res(&iomem_resource, 2); */ |
687 | /* BUG(); */ | 684 | /* BUG(); */ |
688 | } else | 685 | } |
689 | bus->resource[i++] = &(ldev->hba.elmmio_space); | ||
690 | } | 686 | } |
691 | 687 | ||
692 | if (ldev->hba.lmmio_space.flags) { | 688 | if (ldev->hba.lmmio_space.flags) { |
@@ -696,8 +692,7 @@ lba_fixup_bus(struct pci_bus *bus) | |||
696 | "lmmio_space [%lx/%lx]\n", | 692 | "lmmio_space [%lx/%lx]\n", |
697 | (long)ldev->hba.lmmio_space.start, | 693 | (long)ldev->hba.lmmio_space.start, |
698 | (long)ldev->hba.lmmio_space.end); | 694 | (long)ldev->hba.lmmio_space.end); |
699 | } else | 695 | } |
700 | bus->resource[i++] = &(ldev->hba.lmmio_space); | ||
701 | } | 696 | } |
702 | 697 | ||
703 | #ifdef CONFIG_64BIT | 698 | #ifdef CONFIG_64BIT |
@@ -712,7 +707,6 @@ lba_fixup_bus(struct pci_bus *bus) | |||
712 | lba_dump_res(&iomem_resource, 2); | 707 | lba_dump_res(&iomem_resource, 2); |
713 | BUG(); | 708 | BUG(); |
714 | } | 709 | } |
715 | bus->resource[i++] = &(ldev->hba.gmmio_space); | ||
716 | } | 710 | } |
717 | #endif | 711 | #endif |
718 | 712 | ||
@@ -1388,6 +1382,7 @@ static int __init | |||
1388 | lba_driver_probe(struct parisc_device *dev) | 1382 | lba_driver_probe(struct parisc_device *dev) |
1389 | { | 1383 | { |
1390 | struct lba_device *lba_dev; | 1384 | struct lba_device *lba_dev; |
1385 | LIST_HEAD(resources); | ||
1391 | struct pci_bus *lba_bus; | 1386 | struct pci_bus *lba_bus; |
1392 | struct pci_ops *cfg_ops; | 1387 | struct pci_ops *cfg_ops; |
1393 | u32 func_class; | 1388 | u32 func_class; |
@@ -1519,12 +1514,22 @@ lba_driver_probe(struct parisc_device *dev) | |||
1519 | lba_dev->hba.lmmio_space.flags = 0; | 1514 | lba_dev->hba.lmmio_space.flags = 0; |
1520 | } | 1515 | } |
1521 | 1516 | ||
1517 | pci_add_resource(&resources, &lba_dev->hba.io_space); | ||
1518 | if (lba_dev->hba.elmmio_space.start) | ||
1519 | pci_add_resource(&resources, &lba_dev->hba.elmmio_space); | ||
1520 | if (lba_dev->hba.lmmio_space.flags) | ||
1521 | pci_add_resource(&resources, &lba_dev->hba.lmmio_space); | ||
1522 | if (lba_dev->hba.gmmio_space.flags) | ||
1523 | pci_add_resource(&resources, &lba_dev->hba.gmmio_space); | ||
1524 | |||
1522 | dev->dev.platform_data = lba_dev; | 1525 | dev->dev.platform_data = lba_dev; |
1523 | lba_bus = lba_dev->hba.hba_bus = | 1526 | lba_bus = lba_dev->hba.hba_bus = |
1524 | pci_create_bus(&dev->dev, lba_dev->hba.bus_num.start, | 1527 | pci_create_root_bus(&dev->dev, lba_dev->hba.bus_num.start, |
1525 | cfg_ops, NULL); | 1528 | cfg_ops, NULL, &resources); |
1526 | if (!lba_bus) | 1529 | if (!lba_bus) { |
1530 | pci_free_resource_list(&resources); | ||
1527 | return 0; | 1531 | return 0; |
1532 | } | ||
1528 | 1533 | ||
1529 | lba_bus->subordinate = pci_scan_child_bus(lba_bus); | 1534 | lba_bus->subordinate = pci_scan_child_bus(lba_bus); |
1530 | 1535 | ||