aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 19:17:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 19:17:07 -0400
commit6dd53aa4563a2c69e80a24d2cc68d484b5ea2891 (patch)
tree0cca9f65984b524527910960d972fc6ef85fac88 /drivers/parisc
parentf14121ab35912e3d2e57ac9a4ce1f9d4b7baeffb (diff)
parent63b96f7baeba71966c723912c3f8f0274577f877 (diff)
Merge tag 'for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI changes from Bjorn Helgaas: "Host bridge hotplug: - Add MMCONFIG support for hot-added host bridges (Jiang Liu) Device hotplug: - Move fixups from __init to __devinit (Sebastian Andrzej Siewior) - Call FINAL fixups for hot-added devices, too (Myron Stowe) - Factor out generic code for P2P bridge hot-add (Yinghai Lu) - Remove all functions in a slot, not just those with _EJx (Amos Kong) Dynamic resource management: - Track bus number allocation (struct resource tree per domain) (Yinghai Lu) - Make P2P bridge 1K I/O windows work with resource reassignment (Bjorn Helgaas, Yinghai Lu) - Disable decoding while updating 64-bit BARs (Bjorn Helgaas) Power management: - Add PCIe runtime D3cold support (Huang Ying) Virtualization: - Add VFIO infrastructure (ACS, DMA source ID quirks) (Alex Williamson) - Add quirks for devices with broken INTx masking (Jan Kiszka) Miscellaneous: - Fix some PCI Express capability version issues (Myron Stowe) - Factor out some arch code with a weak, generic, pcibios_setup() (Myron Stowe)" * tag 'for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (122 commits) PCI: hotplug: ensure a consistent return value in error case PCI: fix undefined reference to 'pci_fixup_final_inited' PCI: build resource code for M68K architecture PCI: pciehp: remove unused pciehp_get_max_lnk_width(), pciehp_get_cur_lnk_width() PCI: reorder __pci_assign_resource() (no change) PCI: fix truncation of resource size to 32 bits PCI: acpiphp: merge acpiphp_debug and debug PCI: acpiphp: remove unused res_lock sparc/PCI: replace pci_cfg_fake_ranges() with pci_read_bridge_bases() PCI: call final fixups hot-added devices PCI: move final fixups from __init to __devinit x86/PCI: move final fixups from __init to __devinit MIPS/PCI: move final fixups from __init to __devinit PCI: support sizing P2P bridge I/O windows with 1K granularity PCI: reimplement P2P bridge 1K I/O windows (Intel P64H2) PCI: disable MEM decoding while updating 64-bit MEM BARs PCI: leave MEM and IO decoding disabled during 64-bit BAR sizing, too PCI: never discard enable/suspend/resume_early/resume fixups PCI: release temporary reference in __nv_msi_ht_cap_quirk() PCI: restructure 'pci_do_fixups()' ...
Diffstat (limited to 'drivers/parisc')
-rw-r--r--drivers/parisc/dino.c16
-rw-r--r--drivers/parisc/iosapic.c2
-rw-r--r--drivers/parisc/lba_pci.c26
3 files changed, 27 insertions, 17 deletions
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index 432d4bbcc62a..ffddc4f64268 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -174,7 +174,7 @@ static int dino_cfg_read(struct pci_bus *bus, unsigned int devfn, int where,
174 int size, u32 *val) 174 int size, u32 *val)
175{ 175{
176 struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->bridge)); 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 u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3); 178 u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3);
179 void __iomem *base_addr = d->hba.base_addr; 179 void __iomem *base_addr = d->hba.base_addr;
180 unsigned long flags; 180 unsigned long flags;
@@ -209,7 +209,7 @@ static int dino_cfg_write(struct pci_bus *bus, unsigned int devfn, int where,
209 int size, u32 val) 209 int size, u32 val)
210{ 210{
211 struct dino_device *d = DINO_DEV(parisc_walk_tree(bus->bridge)); 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 u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3); 213 u32 v = DINO_CFG_TOK(local_bus, devfn, where & ~3);
214 void __iomem *base_addr = d->hba.base_addr; 214 void __iomem *base_addr = d->hba.base_addr;
215 unsigned long flags; 215 unsigned long flags;
@@ -554,7 +554,7 @@ dino_fixup_bus(struct pci_bus *bus)
554 struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->bridge)); 554 struct dino_device *dino_dev = DINO_DEV(parisc_walk_tree(bus->bridge));
555 555
556 DBG(KERN_WARNING "%s(0x%p) bus %d platform_data 0x%p\n", 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 bus->bridge->platform_data); 558 bus->bridge->platform_data);
559 559
560 /* Firmware doesn't set up card-mode dino, so we have to */ 560 /* Firmware doesn't set up card-mode dino, so we have to */
@@ -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->subordinate = 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->subordinate + 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/iosapic.c b/drivers/parisc/iosapic.c
index 69ff60832b09..9544cdc0d1af 100644
--- a/drivers/parisc/iosapic.c
+++ b/drivers/parisc/iosapic.c
@@ -532,7 +532,7 @@ iosapic_xlate_pin(struct iosapic_info *isi, struct pci_dev *pcidev)
532 intr_slot = PCI_SLOT(pcidev->devfn); 532 intr_slot = PCI_SLOT(pcidev->devfn);
533 } 533 }
534 DBG_IRT("iosapic_xlate_pin: bus %d slot %d pin %d\n", 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 return irt_find_irqline(isi, intr_slot, intr_pin); 537 return irt_find_irqline(isi, intr_slot, intr_pin);
538} 538}
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index 052fa230bc77..4f9cf2456f4e 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -189,8 +189,8 @@ lba_dump_res(struct resource *r, int d)
189 189
190static int lba_device_present(u8 bus, u8 dfn, struct lba_device *d) 190static int lba_device_present(u8 bus, u8 dfn, struct lba_device *d)
191{ 191{
192 u8 first_bus = d->hba.hba_bus->secondary; 192 u8 first_bus = d->hba.hba_bus->busn_res.start;
193 u8 last_sub_bus = d->hba.hba_bus->subordinate; 193 u8 last_sub_bus = d->hba.hba_bus->busn_res.end;
194 194
195 if ((bus < first_bus) || 195 if ((bus < first_bus) ||
196 (bus > last_sub_bus) || 196 (bus > last_sub_bus) ||
@@ -364,7 +364,7 @@ lba_rd_cfg(struct lba_device *d, u32 tok, u8 reg, u32 size)
364static int elroy_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data) 364static int elroy_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data)
365{ 365{
366 struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); 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 u32 tok = LBA_CFG_TOK(local_bus, devfn); 368 u32 tok = LBA_CFG_TOK(local_bus, devfn);
369 void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA; 369 void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA;
370 370
@@ -380,7 +380,7 @@ static int elroy_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int
380 return 0; 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 DBG_CFG("%s(%x+%2x) -> -1 (b)\n", __func__, tok, pos); 384 DBG_CFG("%s(%x+%2x) -> -1 (b)\n", __func__, tok, pos);
385 /* either don't want to look or know device isn't present. */ 385 /* either don't want to look or know device isn't present. */
386 *data = ~0U; 386 *data = ~0U;
@@ -431,7 +431,7 @@ lba_wr_cfg(struct lba_device *d, u32 tok, u8 reg, u32 data, u32 size)
431static int elroy_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 data) 431static int elroy_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 data)
432{ 432{
433 struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); 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 u32 tok = LBA_CFG_TOK(local_bus,devfn); 435 u32 tok = LBA_CFG_TOK(local_bus,devfn);
436 436
437 if ((pos > 255) || (devfn > 255)) 437 if ((pos > 255) || (devfn > 255))
@@ -444,7 +444,7 @@ static int elroy_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int
444 return 0; 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 DBG_CFG("%s(%x+%2x) = 0x%x (b)\n", __func__, tok, pos,data); 448 DBG_CFG("%s(%x+%2x) = 0x%x (b)\n", __func__, tok, pos,data);
449 return 1; /* New Workaround */ 449 return 1; /* New Workaround */
450 } 450 }
@@ -481,7 +481,7 @@ static struct pci_ops elroy_cfg_ops = {
481static int mercury_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data) 481static int mercury_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data)
482{ 482{
483 struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); 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 u32 tok = LBA_CFG_TOK(local_bus, devfn); 485 u32 tok = LBA_CFG_TOK(local_bus, devfn);
486 void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA; 486 void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA;
487 487
@@ -514,7 +514,7 @@ static int mercury_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, i
514{ 514{
515 struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); 515 struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge));
516 void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA; 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 u32 tok = LBA_CFG_TOK(local_bus,devfn); 518 u32 tok = LBA_CFG_TOK(local_bus,devfn);
519 519
520 if ((pos > 255) || (devfn > 255)) 520 if ((pos > 255) || (devfn > 255))
@@ -636,7 +636,7 @@ lba_fixup_bus(struct pci_bus *bus)
636 struct lba_device *ldev = LBA_DEV(parisc_walk_tree(bus->bridge)); 636 struct lba_device *ldev = LBA_DEV(parisc_walk_tree(bus->bridge));
637 637
638 DBG("lba_fixup_bus(0x%p) bus %d platform_data 0x%p\n", 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 ** Properly Setup MMIO resources for this bus. 642 ** Properly Setup MMIO resources for this bus.
@@ -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->subordinate = 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_bus->subordinate + 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. */