aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-11 21:50:26 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-11 21:50:26 -0500
commit7b67e751479d50b7f84d1a3cc5216eed5e534b66 (patch)
treea1a6746857cf65f04dde739fe271bf4143d55eaf /drivers/parisc
parent9f13a1fd452f11c18004ba2422a6384b424ec8a9 (diff)
parent76ccc297018d25d55b789bbd508861ef1e2cdb0c (diff)
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: (80 commits) x86/PCI: Expand the x86_msi_ops to have a restore MSIs. PCI: Increase resource array mask bit size in pcim_iomap_regions() PCI: DEVICE_COUNT_RESOURCE should be equal to PCI_NUM_RESOURCES PCI: pci_ids: add device ids for STA2X11 device (aka ConneXT) PNP: work around Dell 1536/1546 BIOS MMCONFIG bug that breaks USB x86/PCI: amd: factor out MMCONFIG discovery PCI: Enable ATS at the device state restore PCI: msi: fix imbalanced refcount of msi irq sysfs objects PCI: kconfig: English typo in pci/pcie/Kconfig PCI/PM/Runtime: make PCI traces quieter PCI: remove pci_create_bus() xtensa/PCI: convert to pci_scan_root_bus() for correct root bus resources x86/PCI: convert to pci_create_root_bus() and pci_scan_root_bus() x86/PCI: use pci_scan_bus() instead of pci_scan_bus_parented() x86/PCI: read Broadcom CNB20LE host bridge info before PCI scan sparc32, leon/PCI: convert to pci_scan_root_bus() for correct root bus resources sparc/PCI: convert to pci_create_root_bus() sh/PCI: convert to pci_scan_root_bus() for correct root bus resources powerpc/PCI: convert to pci_create_root_bus() powerpc/PCI: split PHB part out of pcibios_map_io_space() ... Fix up conflicts in drivers/pci/msi.c and include/linux/pci_regs.h due to the same patches being applied in other branches.
Diffstat (limited to 'drivers/parisc')
-rw-r--r--drivers/parisc/dino.c47
-rw-r--r--drivers/parisc/lba_pci.c72
2 files changed, 63 insertions, 56 deletions
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index bcd5d54b7d4d..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,26 +991,37 @@ 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_scan_bus_parented(&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 1008 if (!bus) {
1013 if(bus) {
1014 /* This code *depends* on scanning being single threaded
1015 * if it isn't, this global bus number count will fail
1016 */
1017 dino_current_bus = bus->subordinate + 1;
1018 pci_bus_assign_resources(bus);
1019 pci_bus_add_devices(bus);
1020 } else {
1021 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",
1022 dev_name(&dev->dev), dino_current_bus); 1010 dev_name(&dev->dev), dino_current_bus);
1011 pci_free_resource_list(&resources);
1023 /* increment the bus number in case of duplicates */ 1012 /* increment the bus number in case of duplicates */
1024 dino_current_bus++; 1013 dino_current_bus++;
1014 return 0;
1025 } 1015 }
1016
1017 bus->subordinate = pci_scan_child_bus(bus);
1018
1019 /* This code *depends* on scanning being single threaded
1020 * if it isn't, this global bus number count will fail
1021 */
1022 dino_current_bus = bus->subordinate + 1;
1023 pci_bus_assign_resources(bus);
1024 pci_bus_add_devices(bus);
1026 return 0; 1025 return 0;
1027} 1026}
1028 1027
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index 3aeb3279c92a..d5f3d753a108 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,35 +682,17 @@ 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 688 if (ldev->hba.lmmio_space.flags) {
693 /* Overlaps with elmmio can (and should) fail here.
694 * We will prune (or ignore) the distributed range.
695 *
696 * FIXME: SBA code should register all elmmio ranges first.
697 * that would take care of elmmio ranges routed
698 * to a different rope (already discovered) from
699 * getting registered *after* LBA code has already
700 * registered it's distributed lmmio range.
701 */
702 if (truncate_pat_collision(&iomem_resource,
703 &(ldev->hba.lmmio_space))) {
704
705 printk(KERN_WARNING "LBA: lmmio_space [%lx/%lx] duplicate!\n",
706 (long)ldev->hba.lmmio_space.start,
707 (long)ldev->hba.lmmio_space.end);
708 } else {
709 err = request_resource(&iomem_resource, &(ldev->hba.lmmio_space)); 689 err = request_resource(&iomem_resource, &(ldev->hba.lmmio_space));
710 if (err < 0) { 690 if (err < 0) {
711 printk(KERN_ERR "FAILED: lba_fixup_bus() request for " 691 printk(KERN_ERR "FAILED: lba_fixup_bus() request for "
712 "lmmio_space [%lx/%lx]\n", 692 "lmmio_space [%lx/%lx]\n",
713 (long)ldev->hba.lmmio_space.start, 693 (long)ldev->hba.lmmio_space.start,
714 (long)ldev->hba.lmmio_space.end); 694 (long)ldev->hba.lmmio_space.end);
715 } else 695 }
716 bus->resource[i++] = &(ldev->hba.lmmio_space);
717 } 696 }
718 697
719#ifdef CONFIG_64BIT 698#ifdef CONFIG_64BIT
@@ -728,7 +707,6 @@ lba_fixup_bus(struct pci_bus *bus)
728 lba_dump_res(&iomem_resource, 2); 707 lba_dump_res(&iomem_resource, 2);
729 BUG(); 708 BUG();
730 } 709 }
731 bus->resource[i++] = &(ldev->hba.gmmio_space);
732 } 710 }
733#endif 711#endif
734 712
@@ -1404,6 +1382,7 @@ static int __init
1404lba_driver_probe(struct parisc_device *dev) 1382lba_driver_probe(struct parisc_device *dev)
1405{ 1383{
1406 struct lba_device *lba_dev; 1384 struct lba_device *lba_dev;
1385 LIST_HEAD(resources);
1407 struct pci_bus *lba_bus; 1386 struct pci_bus *lba_bus;
1408 struct pci_ops *cfg_ops; 1387 struct pci_ops *cfg_ops;
1409 u32 func_class; 1388 u32 func_class;
@@ -1518,10 +1497,41 @@ lba_driver_probe(struct parisc_device *dev)
1518 if (lba_dev->hba.bus_num.start < lba_next_bus) 1497 if (lba_dev->hba.bus_num.start < lba_next_bus)
1519 lba_dev->hba.bus_num.start = lba_next_bus; 1498 lba_dev->hba.bus_num.start = lba_next_bus;
1520 1499
1500 /* Overlaps with elmmio can (and should) fail here.
1501 * We will prune (or ignore) the distributed range.
1502 *
1503 * FIXME: SBA code should register all elmmio ranges first.
1504 * that would take care of elmmio ranges routed
1505 * to a different rope (already discovered) from
1506 * getting registered *after* LBA code has already
1507 * registered it's distributed lmmio range.
1508 */
1509 if (truncate_pat_collision(&iomem_resource,
1510 &(lba_dev->hba.lmmio_space))) {
1511 printk(KERN_WARNING "LBA: lmmio_space [%lx/%lx] duplicate!\n",
1512 (long)lba_dev->hba.lmmio_space.start,
1513 (long)lba_dev->hba.lmmio_space.end);
1514 lba_dev->hba.lmmio_space.flags = 0;
1515 }
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
1521 dev->dev.platform_data = lba_dev; 1525 dev->dev.platform_data = lba_dev;
1522 lba_bus = lba_dev->hba.hba_bus = 1526 lba_bus = lba_dev->hba.hba_bus =
1523 pci_scan_bus_parented(&dev->dev, lba_dev->hba.bus_num.start, 1527 pci_create_root_bus(&dev->dev, lba_dev->hba.bus_num.start,
1524 cfg_ops, NULL); 1528 cfg_ops, NULL, &resources);
1529 if (!lba_bus) {
1530 pci_free_resource_list(&resources);
1531 return 0;
1532 }
1533
1534 lba_bus->subordinate = pci_scan_child_bus(lba_bus);
1525 1535
1526 /* This is in lieu of calling pci_assign_unassigned_resources() */ 1536 /* This is in lieu of calling pci_assign_unassigned_resources() */
1527 if (is_pdc_pat()) { 1537 if (is_pdc_pat()) {
@@ -1551,10 +1561,8 @@ lba_driver_probe(struct parisc_device *dev)
1551 lba_dev->flags |= LBA_FLAG_SKIP_PROBE; 1561 lba_dev->flags |= LBA_FLAG_SKIP_PROBE;
1552 } 1562 }
1553 1563
1554 if (lba_bus) { 1564 lba_next_bus = lba_bus->subordinate + 1;
1555 lba_next_bus = lba_bus->subordinate + 1; 1565 pci_bus_add_devices(lba_bus);
1556 pci_bus_add_devices(lba_bus);
1557 }
1558 1566
1559 /* Whew! Finally done! Tell services we got this one covered. */ 1567 /* Whew! Finally done! Tell services we got this one covered. */
1560 return 0; 1568 return 0;