aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-08-31 20:14:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-08-31 20:14:39 -0400
commit26f8b7edc9eab56638274f5db90848a6df602081 (patch)
tree84280d9369b52c1c8db04bc89501f9afe4636e7f /arch
parentedc837da4b54a01ba6fa3c29b411e35d1a8430ca (diff)
parent9ca678d1dff610f7df6ac9b31fd9152c4426f815 (diff)
Merge tag 'pci-v4.3-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI updates from Bjorn Helgaas: "PCI changes for the v4.3 merge window: Enumeration: - Allocate ATS struct during enumeration (Bjorn Helgaas) - Embed ATS info directly into struct pci_dev (Bjorn Helgaas) - Reduce size of ATS structure elements (Bjorn Helgaas) - Stop caching ATS Invalidate Queue Depth (Bjorn Helgaas) - iommu/vt-d: Cache PCI ATS state and Invalidate Queue Depth (Bjorn Helgaas) - Move MPS configuration check to pci_configure_device() (Bjorn Helgaas) - Set MPS to match upstream bridge (Keith Busch) - ARM/PCI: Set MPS before pci_bus_add_devices() (Murali Karicheri) - Add pci_scan_root_bus_msi() (Lorenzo Pieralisi) - ARM/PCI, designware, xilinx: Use pci_scan_root_bus_msi() (Lorenzo Pieralisi) Resource management: - Call pci_read_bridge_bases() from core instead of arch code (Lorenzo Pieralisi) PCI device hotplug: - pciehp: Remove unused interrupt events (Bjorn Helgaas) - pciehp: Remove ignored MRL sensor interrupt events (Bjorn Helgaas) - pciehp: Handle invalid data when reading from non-existent devices (Jarod Wilson) - pciehp: Simplify pcie_poll_cmd() (Yijing Wang) - Use "slot" and "pci_slot" for struct hotplug_slot and struct pci_slot (Yijing Wang) - Protect pci_bus->slots with pci_slot_mutex, not pci_bus_sem (Yijing Wang) - Hold pci_slot_mutex while searching bus->slots list (Yijing Wang) Power management: - Disable async suspend/resume for JMicron multi-function SATA/AHCI (Zhang Rui) Virtualization: - Add ACS quirks for Intel I219-LM/V (Alex Williamson) - Restore ACS configuration as part of pci_restore_state() (Alexander Duyck) MSI: - Add pcibios_alloc_irq() and pcibios_free_irq() (Jiang Liu) - x86: Implement pcibios_alloc_irq() and pcibios_free_irq() (Jiang Liu) - Add helpers to manage pci_dev->irq and pci_dev->irq_managed (Jiang Liu) - Free legacy IRQ when enabling MSI/MSI-X (Jiang Liu) - ARM/PCI: Remove msi_controller from struct pci_sys_data (Lorenzo Pieralisi) - Remove unused pcibios_msi_controller() hook (Lorenzo Pieralisi) Generic host bridge driver: - Remove dependency on ARM-specific struct hw_pci (Jayachandran C) - Build setup-irq.o for arm64 (Jayachandran C) - Add arm64 support (Jayachandran C) APM X-Gene host bridge driver: - Add APM X-Gene PCIe 64-bit prefetchable window (Duc Dang) - Add support for a 64-bit prefetchable memory window (Duc Dang) - Drop owner assignment from platform_driver (Krzysztof Kozlowski) Broadcom iProc host bridge driver: - Allow BCMA bus driver to be built as module (Hauke Mehrtens) - Delete unnecessary checks before phy calls (Markus Elfring) - Add arm64 support (Ray Jui) Synopsys DesignWare host bridge driver: - Don't complain missing *config* reg space if va_cfg0 is set (Murali Karicheri) TI DRA7xx host bridge driver: - Disable pm_runtime on get_sync failure (Kishon Vijay Abraham I) - Add PM support (Kishon Vijay Abraham I) - Clear MSE bit during suspend so clocks will idle (Kishon Vijay Abraham I) - Add support to make GPIO drive PERST# line (Kishon Vijay Abraham I) Xilinx AXI host bridge driver: - Check for MSI interrupt flag before handling as INTx (Russell Joyce) Miscellaneous: - Fix Intersil/Techwell TW686[4589] AV capture class code (Krzysztof HaƂasa) - Use PCI_CLASS_SERIAL_USB instead of bare number (Bjorn Helgaas) - Fix generic NCR 53c810 class code quirk (Bjorn Helgaas) - Fix TI816X class code quirk (Bjorn Helgaas) - Remove unused "pci_probe" flags (Bjorn Helgaas) - Host bridge driver code simplifications (Fabio Estevam) - Add dev_flags bit to access VPD through function 0 (Mark Rustad) - Add VPD function 0 quirk for Intel Ethernet devices (Mark Rustad) - Kill off set_irq_flags() usage (Rob Herring) - Remove Intel Cherrytrail D3 delays (Srinidhi Kasagar) - Clean up pci_find_capability() (Wei Yang)" * tag 'pci-v4.3-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (72 commits) PCI: Disable async suspend/resume for JMicron multi-function SATA/AHCI PCI: Set MPS to match upstream bridge PCI: Move MPS configuration check to pci_configure_device() PCI: Drop references acquired by of_parse_phandle() PCI/MSI: Remove unused pcibios_msi_controller() hook ARM/PCI: Remove msi_controller from struct pci_sys_data ARM/PCI, designware, xilinx: Use pci_scan_root_bus_msi() PCI: Add pci_scan_root_bus_msi() ARM/PCI: Replace panic with WARN messages on failures PCI: generic: Add arm64 support PCI: Build setup-irq.o for arm64 PCI: generic: Remove dependency on ARM-specific struct hw_pci PCI: imx6: Simplify a trivial if-return sequence PCI: spear: Use BUG_ON() instead of condition followed by BUG() PCI: dra7xx: Remove unneeded use of IS_ERR_VALUE() PCI: Remove pci_ats_enabled() PCI: Stop caching ATS Invalidate Queue Depth PCI: Move ATS declarations to linux/pci.h so they're all together PCI: Clean up ATS error handling PCI: Use pci_physfn() rather than looking up physfn by hand ...
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/pci.c7
-rw-r--r--arch/arm/boot/dts/am57xx-beagle-x15.dts4
-rw-r--r--arch/arm/boot/dts/dra7.dtsi2
-rw-r--r--arch/arm/include/asm/mach/pci.h5
-rw-r--r--arch/arm/kernel/bios32.c45
-rw-r--r--arch/arm64/boot/dts/apm/apm-storm.dtsi23
-rw-r--r--arch/frv/mb93090-mb00/pci-frv.c8
-rw-r--r--arch/frv/mb93090-mb00/pci-frv.h8
-rw-r--r--arch/frv/mb93090-mb00/pci-vdk.c2
-rw-r--r--arch/ia64/pci/pci.c5
-rw-r--r--arch/microblaze/pci/pci-common.c9
-rw-r--r--arch/mips/pci/pci.c6
-rw-r--r--arch/mn10300/unit-asb2305/pci-asb2305.c22
-rw-r--r--arch/mn10300/unit-asb2305/pci-asb2305.h7
-rw-r--r--arch/mn10300/unit-asb2305/pci.c1
-rw-r--r--arch/powerpc/kernel/pci-common.c8
-rw-r--r--arch/powerpc/kernel/pci_of_scan.c6
-rw-r--r--arch/sh/drivers/pci/pci-sh4.h8
-rw-r--r--arch/sparc/kernel/pci.c6
-rw-r--r--arch/x86/include/asm/pci_x86.h2
-rw-r--r--arch/x86/pci/common.c21
-rw-r--r--arch/x86/pci/fixup.c13
-rw-r--r--arch/x86/pci/intel_mid_pci.c9
-rw-r--r--arch/x86/pci/irq.c23
-rw-r--r--arch/xtensa/kernel/pci.c4
25 files changed, 69 insertions, 185 deletions
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 82f738e5d54c..cded02c890aa 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -242,12 +242,7 @@ pci_restore_srm_config(void)
242 242
243void pcibios_fixup_bus(struct pci_bus *bus) 243void pcibios_fixup_bus(struct pci_bus *bus)
244{ 244{
245 struct pci_dev *dev = bus->self; 245 struct pci_dev *dev;
246
247 if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
248 (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
249 pci_read_bridge_bases(bus);
250 }
251 246
252 list_for_each_entry(dev, &bus->devices, bus_list) { 247 list_for_each_entry(dev, &bus->devices, bus_list) {
253 pdev_save_srm_config(dev); 248 pdev_save_srm_config(dev);
diff --git a/arch/arm/boot/dts/am57xx-beagle-x15.dts b/arch/arm/boot/dts/am57xx-beagle-x15.dts
index a63bf78191ea..f9a4b317ed2f 100644
--- a/arch/arm/boot/dts/am57xx-beagle-x15.dts
+++ b/arch/arm/boot/dts/am57xx-beagle-x15.dts
@@ -693,3 +693,7 @@
693 }; 693 };
694 }; 694 };
695}; 695};
696
697&pcie1 {
698 gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
699};
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index e60677e25d62..b058b3146874 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -211,7 +211,7 @@
211 #address-cells = <1>; 211 #address-cells = <1>;
212 ranges = <0x51000000 0x51000000 0x3000 212 ranges = <0x51000000 0x51000000 0x3000
213 0x0 0x20000000 0x10000000>; 213 0x0 0x20000000 0x10000000>;
214 pcie@51000000 { 214 pcie1: pcie@51000000 {
215 compatible = "ti,dra7-pcie"; 215 compatible = "ti,dra7-pcie";
216 reg = <0x51000000 0x2000>, <0x51002000 0x14c>, <0x1000 0x2000>; 216 reg = <0x51000000 0x2000>, <0x51002000 0x14c>, <0x1000 0x2000>;
217 reg-names = "rc_dbics", "ti_conf", "config"; 217 reg-names = "rc_dbics", "ti_conf", "config";
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h
index 28b9bb35949e..8857d2869a5f 100644
--- a/arch/arm/include/asm/mach/pci.h
+++ b/arch/arm/include/asm/mach/pci.h
@@ -19,9 +19,7 @@ struct pci_bus;
19struct device; 19struct device;
20 20
21struct hw_pci { 21struct hw_pci {
22#ifdef CONFIG_PCI_MSI
23 struct msi_controller *msi_ctrl; 22 struct msi_controller *msi_ctrl;
24#endif
25 struct pci_ops *ops; 23 struct pci_ops *ops;
26 int nr_controllers; 24 int nr_controllers;
27 void **private_data; 25 void **private_data;
@@ -42,9 +40,6 @@ struct hw_pci {
42 * Per-controller structure 40 * Per-controller structure
43 */ 41 */
44struct pci_sys_data { 42struct pci_sys_data {
45#ifdef CONFIG_PCI_MSI
46 struct msi_controller *msi_ctrl;
47#endif
48 struct list_head node; 43 struct list_head node;
49 int busnr; /* primary bus number */ 44 int busnr; /* primary bus number */
50 u64 mem_offset; /* bus->cpu memory mapping offset */ 45 u64 mem_offset; /* bus->cpu memory mapping offset */
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index fcbbbb1b9e95..874e1823f803 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -18,15 +18,6 @@
18 18
19static int debug_pci; 19static int debug_pci;
20 20
21#ifdef CONFIG_PCI_MSI
22struct msi_controller *pcibios_msi_controller(struct pci_dev *dev)
23{
24 struct pci_sys_data *sysdata = dev->bus->sysdata;
25
26 return sysdata->msi_ctrl;
27}
28#endif
29
30/* 21/*
31 * We can't use pci_get_device() here since we are 22 * We can't use pci_get_device() here since we are
32 * called from interrupt context. 23 * called from interrupt context.
@@ -459,12 +450,9 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
459 450
460 for (nr = busnr = 0; nr < hw->nr_controllers; nr++) { 451 for (nr = busnr = 0; nr < hw->nr_controllers; nr++) {
461 sys = kzalloc(sizeof(struct pci_sys_data), GFP_KERNEL); 452 sys = kzalloc(sizeof(struct pci_sys_data), GFP_KERNEL);
462 if (!sys) 453 if (WARN(!sys, "PCI: unable to allocate sys data!"))
463 panic("PCI: unable to allocate sys data!"); 454 break;
464 455
465#ifdef CONFIG_PCI_MSI
466 sys->msi_ctrl = hw->msi_ctrl;
467#endif
468 sys->busnr = busnr; 456 sys->busnr = busnr;
469 sys->swizzle = hw->swizzle; 457 sys->swizzle = hw->swizzle;
470 sys->map_irq = hw->map_irq; 458 sys->map_irq = hw->map_irq;
@@ -486,11 +474,14 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
486 if (hw->scan) 474 if (hw->scan)
487 sys->bus = hw->scan(nr, sys); 475 sys->bus = hw->scan(nr, sys);
488 else 476 else
489 sys->bus = pci_scan_root_bus(parent, sys->busnr, 477 sys->bus = pci_scan_root_bus_msi(parent,
490 hw->ops, sys, &sys->resources); 478 sys->busnr, hw->ops, sys,
479 &sys->resources, hw->msi_ctrl);
491 480
492 if (!sys->bus) 481 if (WARN(!sys->bus, "PCI: unable to scan bus!")) {
493 panic("PCI: unable to scan bus!"); 482 kfree(sys);
483 break;
484 }
494 485
495 busnr = sys->bus->busn_res.end + 1; 486 busnr = sys->bus->busn_res.end + 1;
496 487
@@ -521,6 +512,8 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
521 struct pci_bus *bus = sys->bus; 512 struct pci_bus *bus = sys->bus;
522 513
523 if (!pci_has_flag(PCI_PROBE_ONLY)) { 514 if (!pci_has_flag(PCI_PROBE_ONLY)) {
515 struct pci_bus *child;
516
524 /* 517 /*
525 * Size the bridge windows. 518 * Size the bridge windows.
526 */ 519 */
@@ -530,25 +523,15 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
530 * Assign resources. 523 * Assign resources.
531 */ 524 */
532 pci_bus_assign_resources(bus); 525 pci_bus_assign_resources(bus);
533 }
534 526
527 list_for_each_entry(child, &bus->children, node)
528 pcie_bus_configure_settings(child);
529 }
535 /* 530 /*
536 * Tell drivers about devices found. 531 * Tell drivers about devices found.
537 */ 532 */
538 pci_bus_add_devices(bus); 533 pci_bus_add_devices(bus);
539 } 534 }
540
541 list_for_each_entry(sys, &head, node) {
542 struct pci_bus *bus = sys->bus;
543
544 /* Configure PCI Express settings */
545 if (bus && !pci_has_flag(PCI_PROBE_ONLY)) {
546 struct pci_bus *child;
547
548 list_for_each_entry(child, &bus->children, node)
549 pcie_bus_configure_settings(child);
550 }
551 }
552} 535}
553 536
554#ifndef CONFIG_PCI_HOST_ITE8152 537#ifndef CONFIG_PCI_HOST_ITE8152
diff --git a/arch/arm64/boot/dts/apm/apm-storm.dtsi b/arch/arm64/boot/dts/apm/apm-storm.dtsi
index 58093edeea2e..d831bc2ac204 100644
--- a/arch/arm64/boot/dts/apm/apm-storm.dtsi
+++ b/arch/arm64/boot/dts/apm/apm-storm.dtsi
@@ -490,7 +490,8 @@
490 0xe0 0xd0000000 0x0 0x00040000>; /* PCI config space */ 490 0xe0 0xd0000000 0x0 0x00040000>; /* PCI config space */
491 reg-names = "csr", "cfg"; 491 reg-names = "csr", "cfg";
492 ranges = <0x01000000 0x00 0x00000000 0xe0 0x10000000 0x00 0x00010000 /* io */ 492 ranges = <0x01000000 0x00 0x00000000 0xe0 0x10000000 0x00 0x00010000 /* io */
493 0x02000000 0x00 0x80000000 0xe1 0x80000000 0x00 0x80000000>; /* mem */ 493 0x02000000 0x00 0x80000000 0xe1 0x80000000 0x00 0x80000000 /* mem */
494 0x43000000 0xf0 0x00000000 0xf0 0x00000000 0x10 0x00000000>; /* mem */
494 dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 495 dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
495 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; 496 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
496 interrupt-map-mask = <0x0 0x0 0x0 0x7>; 497 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
@@ -513,8 +514,9 @@
513 reg = < 0x00 0x1f2c0000 0x0 0x00010000 /* Controller registers */ 514 reg = < 0x00 0x1f2c0000 0x0 0x00010000 /* Controller registers */
514 0xd0 0xd0000000 0x0 0x00040000>; /* PCI config space */ 515 0xd0 0xd0000000 0x0 0x00040000>; /* PCI config space */
515 reg-names = "csr", "cfg"; 516 reg-names = "csr", "cfg";
516 ranges = <0x01000000 0x0 0x00000000 0xd0 0x10000000 0x00 0x00010000 /* io */ 517 ranges = <0x01000000 0x00 0x00000000 0xd0 0x10000000 0x00 0x00010000 /* io */
517 0x02000000 0x0 0x80000000 0xd1 0x80000000 0x00 0x80000000>; /* mem */ 518 0x02000000 0x00 0x80000000 0xd1 0x80000000 0x00 0x80000000 /* mem */
519 0x43000000 0xd8 0x00000000 0xd8 0x00000000 0x08 0x00000000>; /* mem */
518 dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 520 dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
519 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; 521 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
520 interrupt-map-mask = <0x0 0x0 0x0 0x7>; 522 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
@@ -537,8 +539,9 @@
537 reg = < 0x00 0x1f2d0000 0x0 0x00010000 /* Controller registers */ 539 reg = < 0x00 0x1f2d0000 0x0 0x00010000 /* Controller registers */
538 0x90 0xd0000000 0x0 0x00040000>; /* PCI config space */ 540 0x90 0xd0000000 0x0 0x00040000>; /* PCI config space */
539 reg-names = "csr", "cfg"; 541 reg-names = "csr", "cfg";
540 ranges = <0x01000000 0x0 0x00000000 0x90 0x10000000 0x0 0x00010000 /* io */ 542 ranges = <0x01000000 0x00 0x00000000 0x90 0x10000000 0x00 0x00010000 /* io */
541 0x02000000 0x0 0x80000000 0x91 0x80000000 0x0 0x80000000>; /* mem */ 543 0x02000000 0x00 0x80000000 0x91 0x80000000 0x00 0x80000000 /* mem */
544 0x43000000 0x94 0x00000000 0x94 0x00000000 0x04 0x00000000>; /* mem */
542 dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 545 dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
543 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; 546 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
544 interrupt-map-mask = <0x0 0x0 0x0 0x7>; 547 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
@@ -561,8 +564,9 @@
561 reg = < 0x00 0x1f500000 0x0 0x00010000 /* Controller registers */ 564 reg = < 0x00 0x1f500000 0x0 0x00010000 /* Controller registers */
562 0xa0 0xd0000000 0x0 0x00040000>; /* PCI config space */ 565 0xa0 0xd0000000 0x0 0x00040000>; /* PCI config space */
563 reg-names = "csr", "cfg"; 566 reg-names = "csr", "cfg";
564 ranges = <0x01000000 0x0 0x00000000 0xa0 0x10000000 0x0 0x00010000 /* io */ 567 ranges = <0x01000000 0x00 0x00000000 0xa0 0x10000000 0x00 0x00010000 /* io */
565 0x02000000 0x0 0x80000000 0xa1 0x80000000 0x0 0x80000000>; /* mem */ 568 0x02000000 0x00 0x80000000 0xa1 0x80000000 0x00 0x80000000 /* mem */
569 0x43000000 0xb0 0x00000000 0xb0 0x00000000 0x10 0x00000000>; /* mem */
566 dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 570 dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
567 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; 571 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
568 interrupt-map-mask = <0x0 0x0 0x0 0x7>; 572 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
@@ -585,8 +589,9 @@
585 reg = < 0x00 0x1f510000 0x0 0x00010000 /* Controller registers */ 589 reg = < 0x00 0x1f510000 0x0 0x00010000 /* Controller registers */
586 0xc0 0xd0000000 0x0 0x00200000>; /* PCI config space */ 590 0xc0 0xd0000000 0x0 0x00200000>; /* PCI config space */
587 reg-names = "csr", "cfg"; 591 reg-names = "csr", "cfg";
588 ranges = <0x01000000 0x0 0x00000000 0xc0 0x10000000 0x0 0x00010000 /* io */ 592 ranges = <0x01000000 0x00 0x00000000 0xc0 0x10000000 0x00 0x00010000 /* io */
589 0x02000000 0x0 0x80000000 0xc1 0x80000000 0x0 0x80000000>; /* mem */ 593 0x02000000 0x00 0x80000000 0xc1 0x80000000 0x00 0x80000000 /* mem */
594 0x43000000 0xc8 0x00000000 0xc8 0x00000000 0x08 0x00000000>; /* mem */
590 dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000 595 dma-ranges = <0x42000000 0x80 0x00000000 0x80 0x00000000 0x00 0x80000000
591 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>; 596 0x42000000 0x00 0x00000000 0x00 0x00000000 0x80 0x00000000>;
592 interrupt-map-mask = <0x0 0x0 0x0 0x7>; 597 interrupt-map-mask = <0x0 0x0 0x0 0x7>;
diff --git a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c
index 0635bd6c2af3..34bb4b13e079 100644
--- a/arch/frv/mb93090-mb00/pci-frv.c
+++ b/arch/frv/mb93090-mb00/pci-frv.c
@@ -175,14 +175,6 @@ static void __init pcibios_assign_resources(void)
175 if (!r->start && r->end) 175 if (!r->start && r->end)
176 pci_assign_resource(dev, idx); 176 pci_assign_resource(dev, idx);
177 } 177 }
178
179 if (pci_probe & PCI_ASSIGN_ROMS) {
180 r = &dev->resource[PCI_ROM_RESOURCE];
181 r->end -= r->start;
182 r->start = 0;
183 if (r->end)
184 pci_assign_resource(dev, PCI_ROM_RESOURCE);
185 }
186 } 178 }
187} 179}
188 180
diff --git a/arch/frv/mb93090-mb00/pci-frv.h b/arch/frv/mb93090-mb00/pci-frv.h
index a7e487fe76ed..d51992ff5a61 100644
--- a/arch/frv/mb93090-mb00/pci-frv.h
+++ b/arch/frv/mb93090-mb00/pci-frv.h
@@ -14,14 +14,6 @@
14#define DBG(x...) 14#define DBG(x...)
15#endif 15#endif
16 16
17#define PCI_PROBE_BIOS 0x0001
18#define PCI_PROBE_CONF1 0x0002
19#define PCI_PROBE_CONF2 0x0004
20#define PCI_NO_CHECKS 0x0400
21#define PCI_ASSIGN_ROMS 0x1000
22#define PCI_BIOS_IRQ_SCAN 0x2000
23#define PCI_ASSIGN_ALL_BUSSES 0x4000
24
25extern unsigned int __nongpreldata pci_probe; 17extern unsigned int __nongpreldata pci_probe;
26 18
27/* pci-frv.c */ 19/* pci-frv.c */
diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c
index f211839e2cae..f9c86c475bbd 100644
--- a/arch/frv/mb93090-mb00/pci-vdk.c
+++ b/arch/frv/mb93090-mb00/pci-vdk.c
@@ -294,8 +294,6 @@ void pcibios_fixup_bus(struct pci_bus *bus)
294 printk("### PCIBIOS_FIXUP_BUS(%d)\n",bus->number); 294 printk("### PCIBIOS_FIXUP_BUS(%d)\n",bus->number);
295#endif 295#endif
296 296
297 pci_read_bridge_bases(bus);
298
299 if (bus->number == 0) { 297 if (bus->number == 0) {
300 struct pci_dev *dev; 298 struct pci_dev *dev;
301 list_for_each_entry(dev, &bus->devices, bus_list) { 299 list_for_each_entry(dev, &bus->devices, bus_list) {
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 7cc3be9fa7c6..d89b6013c941 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -533,10 +533,9 @@ void pcibios_fixup_bus(struct pci_bus *b)
533{ 533{
534 struct pci_dev *dev; 534 struct pci_dev *dev;
535 535
536 if (b->self) { 536 if (b->self)
537 pci_read_bridge_bases(b);
538 pcibios_fixup_bridge_resources(b->self); 537 pcibios_fixup_bridge_resources(b->self);
539 } 538
540 list_for_each_entry(dev, &b->devices, bus_list) 539 list_for_each_entry(dev, &b->devices, bus_list)
541 pcibios_fixup_device_resources(dev); 540 pcibios_fixup_device_resources(dev);
542 platform_pci_fixup_bus(b); 541 platform_pci_fixup_bus(b);
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index ae838ed5fcf2..6b8b75266801 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -863,14 +863,7 @@ void pcibios_setup_bus_devices(struct pci_bus *bus)
863 863
864void pcibios_fixup_bus(struct pci_bus *bus) 864void pcibios_fixup_bus(struct pci_bus *bus)
865{ 865{
866 /* When called from the generic PCI probe, read PCI<->PCI bridge 866 /* Fixup the bus */
867 * bases. This is -not- called when generating the PCI tree from
868 * the OF device-tree.
869 */
870 if (bus->self != NULL)
871 pci_read_bridge_bases(bus);
872
873 /* Now fixup the bus bus */
874 pcibios_setup_bus_self(bus); 867 pcibios_setup_bus_self(bus);
875 868
876 /* Now fixup devices on that bus */ 869 /* Now fixup devices on that bus */
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index b8a0bf5766f2..c6996cf67a5c 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -311,12 +311,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
311 311
312void pcibios_fixup_bus(struct pci_bus *bus) 312void pcibios_fixup_bus(struct pci_bus *bus)
313{ 313{
314 struct pci_dev *dev = bus->self;
315
316 if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
317 (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
318 pci_read_bridge_bases(bus);
319 }
320} 314}
321 315
322EXPORT_SYMBOL(PCIBIOS_MIN_IO); 316EXPORT_SYMBOL(PCIBIOS_MIN_IO);
diff --git a/arch/mn10300/unit-asb2305/pci-asb2305.c b/arch/mn10300/unit-asb2305/pci-asb2305.c
index b5b036f64275..b7ab8378964c 100644
--- a/arch/mn10300/unit-asb2305/pci-asb2305.c
+++ b/arch/mn10300/unit-asb2305/pci-asb2305.c
@@ -183,18 +183,16 @@ static int __init pcibios_assign_resources(void)
183 struct pci_dev *dev = NULL; 183 struct pci_dev *dev = NULL;
184 struct resource *r; 184 struct resource *r;
185 185
186 if (!(pci_probe & PCI_ASSIGN_ROMS)) { 186 /* Try to use BIOS settings for ROMs, otherwise let
187 /* Try to use BIOS settings for ROMs, otherwise let 187 pci_assign_unassigned_resources() allocate the new
188 pci_assign_unassigned_resources() allocate the new 188 addresses. */
189 addresses. */ 189 for_each_pci_dev(dev) {
190 for_each_pci_dev(dev) { 190 r = &dev->resource[PCI_ROM_RESOURCE];
191 r = &dev->resource[PCI_ROM_RESOURCE]; 191 if (!r->flags || !r->start)
192 if (!r->flags || !r->start) 192 continue;
193 continue; 193 if (pci_claim_resource(dev, PCI_ROM_RESOURCE) < 0) {
194 if (pci_claim_resource(dev, PCI_ROM_RESOURCE) < 0) { 194 r->end -= r->start;
195 r->end -= r->start; 195 r->start = 0;
196 r->start = 0;
197 }
198 } 196 }
199 } 197 }
200 198
diff --git a/arch/mn10300/unit-asb2305/pci-asb2305.h b/arch/mn10300/unit-asb2305/pci-asb2305.h
index 9e17aca5a2a1..96c484b12226 100644
--- a/arch/mn10300/unit-asb2305/pci-asb2305.h
+++ b/arch/mn10300/unit-asb2305/pci-asb2305.h
@@ -20,13 +20,6 @@
20#define DBG(x...) 20#define DBG(x...)
21#endif 21#endif
22 22
23#define PCI_PROBE_BIOS 1
24#define PCI_PROBE_CONF1 2
25#define PCI_PROBE_CONF2 4
26#define PCI_NO_CHECKS 0x400
27#define PCI_ASSIGN_ROMS 0x1000
28#define PCI_BIOS_IRQ_SCAN 0x2000
29
30extern unsigned int pci_probe; 23extern unsigned int pci_probe;
31 24
32/* pci-asb2305.c */ 25/* pci-asb2305.c */
diff --git a/arch/mn10300/unit-asb2305/pci.c b/arch/mn10300/unit-asb2305/pci.c
index 3dfe2d31c67b..deaa893efba5 100644
--- a/arch/mn10300/unit-asb2305/pci.c
+++ b/arch/mn10300/unit-asb2305/pci.c
@@ -324,7 +324,6 @@ void pcibios_fixup_bus(struct pci_bus *bus)
324 struct pci_dev *dev; 324 struct pci_dev *dev;
325 325
326 if (bus->self) { 326 if (bus->self) {
327 pci_read_bridge_bases(bus);
328 pcibios_fixup_bridge_resources(bus->self); 327 pcibios_fixup_bridge_resources(bus->self);
329 } 328 }
330 329
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index b9de34d44fcb..02c1d5dcee4d 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1044,13 +1044,7 @@ void pcibios_set_master(struct pci_dev *dev)
1044 1044
1045void pcibios_fixup_bus(struct pci_bus *bus) 1045void pcibios_fixup_bus(struct pci_bus *bus)
1046{ 1046{
1047 /* When called from the generic PCI probe, read PCI<->PCI bridge 1047 /* Fixup the bus */
1048 * bases. This is -not- called when generating the PCI tree from
1049 * the OF device-tree.
1050 */
1051 pci_read_bridge_bases(bus);
1052
1053 /* Now fixup the bus bus */
1054 pcibios_setup_bus_self(bus); 1048 pcibios_setup_bus_self(bus);
1055 1049
1056 /* Now fixup devices on that bus */ 1050 /* Now fixup devices on that bus */
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index efc3fa54c90b..c8c62c7fc31c 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -126,7 +126,6 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
126{ 126{
127 struct pci_dev *dev; 127 struct pci_dev *dev;
128 const char *type; 128 const char *type;
129 struct pci_slot *slot;
130 129
131 dev = pci_alloc_dev(bus); 130 dev = pci_alloc_dev(bus);
132 if (!dev) 131 if (!dev)
@@ -145,10 +144,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node,
145 dev->needs_freset = 0; /* pcie fundamental reset required */ 144 dev->needs_freset = 0; /* pcie fundamental reset required */
146 set_pcie_port_type(dev); 145 set_pcie_port_type(dev);
147 146
148 list_for_each_entry(slot, &dev->bus->slots, list) 147 pci_dev_assign_slot(dev);
149 if (PCI_SLOT(dev->devfn) == slot->number)
150 dev->slot = slot;
151
152 dev->vendor = get_int_prop(node, "vendor-id", 0xffff); 148 dev->vendor = get_int_prop(node, "vendor-id", 0xffff);
153 dev->device = get_int_prop(node, "device-id", 0xffff); 149 dev->device = get_int_prop(node, "device-id", 0xffff);
154 dev->subsystem_vendor = get_int_prop(node, "subsystem-vendor-id", 0); 150 dev->subsystem_vendor = get_int_prop(node, "subsystem-vendor-id", 0);
diff --git a/arch/sh/drivers/pci/pci-sh4.h b/arch/sh/drivers/pci/pci-sh4.h
index cbf763b3015e..0288efc17ff3 100644
--- a/arch/sh/drivers/pci/pci-sh4.h
+++ b/arch/sh/drivers/pci/pci-sh4.h
@@ -11,14 +11,6 @@
11 11
12#include <asm/io.h> 12#include <asm/io.h>
13 13
14/* startup values */
15#define PCI_PROBE_BIOS 1
16#define PCI_PROBE_CONF1 2
17#define PCI_PROBE_CONF2 4
18#define PCI_NO_CHECKS 0x400
19#define PCI_ASSIGN_ROMS 0x1000
20#define PCI_BIOS_IRQ_SCAN 0x2000
21
22#define SH4_PCICR 0x100 /* PCI Control Register */ 14#define SH4_PCICR 0x100 /* PCI Control Register */
23 #define SH4_PCICR_PREFIX 0xA5000000 /* CR prefix for write */ 15 #define SH4_PCICR_PREFIX 0xA5000000 /* CR prefix for write */
24 #define SH4_PCICR_FTO 0x00000400 /* TRDY/IRDY Enable */ 16 #define SH4_PCICR_FTO 0x00000400 /* TRDY/IRDY Enable */
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index c928bc64b4ba..3a0e1a986bfe 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -249,7 +249,6 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
249 struct pci_bus *bus, int devfn) 249 struct pci_bus *bus, int devfn)
250{ 250{
251 struct dev_archdata *sd; 251 struct dev_archdata *sd;
252 struct pci_slot *slot;
253 struct platform_device *op; 252 struct platform_device *op;
254 struct pci_dev *dev; 253 struct pci_dev *dev;
255 const char *type; 254 const char *type;
@@ -290,10 +289,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
290 dev->multifunction = 0; /* maybe a lie? */ 289 dev->multifunction = 0; /* maybe a lie? */
291 set_pcie_port_type(dev); 290 set_pcie_port_type(dev);
292 291
293 list_for_each_entry(slot, &dev->bus->slots, list) 292 pci_dev_assign_slot(dev);
294 if (PCI_SLOT(dev->devfn) == slot->number)
295 dev->slot = slot;
296
297 dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff); 293 dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff);
298 dev->device = of_getintprop_default(node, "device-id", 0xffff); 294 dev->device = of_getintprop_default(node, "device-id", 0xffff);
299 dev->subsystem_vendor = 295 dev->subsystem_vendor =
diff --git a/arch/x86/include/asm/pci_x86.h b/arch/x86/include/asm/pci_x86.h
index 164e3f8d3c3d..fa1195dae425 100644
--- a/arch/x86/include/asm/pci_x86.h
+++ b/arch/x86/include/asm/pci_x86.h
@@ -93,8 +93,6 @@ extern raw_spinlock_t pci_config_lock;
93extern int (*pcibios_enable_irq)(struct pci_dev *dev); 93extern int (*pcibios_enable_irq)(struct pci_dev *dev);
94extern void (*pcibios_disable_irq)(struct pci_dev *dev); 94extern void (*pcibios_disable_irq)(struct pci_dev *dev);
95 95
96extern bool mp_should_keep_irq(struct device *dev);
97
98struct pci_raw_ops { 96struct pci_raw_ops {
99 int (*read)(unsigned int domain, unsigned int bus, unsigned int devfn, 97 int (*read)(unsigned int domain, unsigned int bus, unsigned int devfn,
100 int reg, int len, u32 *val); 98 int reg, int len, u32 *val);
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 8fd6f44aee83..09d3afc0a181 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -166,7 +166,6 @@ void pcibios_fixup_bus(struct pci_bus *b)
166{ 166{
167 struct pci_dev *dev; 167 struct pci_dev *dev;
168 168
169 pci_read_bridge_bases(b);
170 list_for_each_entry(dev, &b->devices, bus_list) 169 list_for_each_entry(dev, &b->devices, bus_list)
171 pcibios_fixup_device_resources(dev); 170 pcibios_fixup_device_resources(dev);
172} 171}
@@ -673,24 +672,22 @@ int pcibios_add_device(struct pci_dev *dev)
673 return 0; 672 return 0;
674} 673}
675 674
676int pcibios_enable_device(struct pci_dev *dev, int mask) 675int pcibios_alloc_irq(struct pci_dev *dev)
677{ 676{
678 int err; 677 return pcibios_enable_irq(dev);
679
680 if ((err = pci_enable_resources(dev, mask)) < 0)
681 return err;
682
683 if (!pci_dev_msi_enabled(dev))
684 return pcibios_enable_irq(dev);
685 return 0;
686} 678}
687 679
688void pcibios_disable_device (struct pci_dev *dev) 680void pcibios_free_irq(struct pci_dev *dev)
689{ 681{
690 if (!pci_dev_msi_enabled(dev) && pcibios_disable_irq) 682 if (pcibios_disable_irq)
691 pcibios_disable_irq(dev); 683 pcibios_disable_irq(dev);
692} 684}
693 685
686int pcibios_enable_device(struct pci_dev *dev, int mask)
687{
688 return pci_enable_resources(dev, mask);
689}
690
694int pci_ext_cfg_avail(void) 691int pci_ext_cfg_avail(void)
695{ 692{
696 if (raw_pci_ext_ops) 693 if (raw_pci_ext_ops)
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 9a2b7101ae8a..e58565556703 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -62,19 +62,6 @@ static void pci_fixup_umc_ide(struct pci_dev *d)
62} 62}
63DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, pci_fixup_umc_ide); 63DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, pci_fixup_umc_ide);
64 64
65static void pci_fixup_ncr53c810(struct pci_dev *d)
66{
67 /*
68 * NCR 53C810 returns class code 0 (at least on some systems).
69 * Fix class to be PCI_CLASS_STORAGE_SCSI
70 */
71 if (!d->class) {
72 dev_warn(&d->dev, "Fixing NCR 53C810 class code\n");
73 d->class = PCI_CLASS_STORAGE_SCSI << 8;
74 }
75}
76DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, pci_fixup_ncr53c810);
77
78static void pci_fixup_latency(struct pci_dev *d) 65static void pci_fixup_latency(struct pci_dev *d)
79{ 66{
80 /* 67 /*
diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c
index 27062303c881..22aaefb4f1ca 100644
--- a/arch/x86/pci/intel_mid_pci.c
+++ b/arch/x86/pci/intel_mid_pci.c
@@ -211,7 +211,7 @@ static int intel_mid_pci_irq_enable(struct pci_dev *dev)
211 struct irq_alloc_info info; 211 struct irq_alloc_info info;
212 int polarity; 212 int polarity;
213 213
214 if (dev->irq_managed && dev->irq > 0) 214 if (pci_has_managed_irq(dev))
215 return 0; 215 return 0;
216 216
217 if (intel_mid_identify_cpu() == INTEL_MID_CPU_CHIP_TANGIER) 217 if (intel_mid_identify_cpu() == INTEL_MID_CPU_CHIP_TANGIER)
@@ -234,10 +234,13 @@ static int intel_mid_pci_irq_enable(struct pci_dev *dev)
234 234
235static void intel_mid_pci_irq_disable(struct pci_dev *dev) 235static void intel_mid_pci_irq_disable(struct pci_dev *dev)
236{ 236{
237 if (!mp_should_keep_irq(&dev->dev) && dev->irq_managed && 237 if (pci_has_managed_irq(dev)) {
238 dev->irq > 0) {
239 mp_unmap_irq(dev->irq); 238 mp_unmap_irq(dev->irq);
240 dev->irq_managed = 0; 239 dev->irq_managed = 0;
240 /*
241 * Don't reset dev->irq here, otherwise
242 * intel_mid_pci_irq_enable() will fail on next call.
243 */
241 } 244 }
242} 245}
243 246
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index 9bd115484745..32e70343e6fd 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -1202,7 +1202,7 @@ static int pirq_enable_irq(struct pci_dev *dev)
1202 struct pci_dev *temp_dev; 1202 struct pci_dev *temp_dev;
1203 int irq; 1203 int irq;
1204 1204
1205 if (dev->irq_managed && dev->irq > 0) 1205 if (pci_has_managed_irq(dev))
1206 return 0; 1206 return 0;
1207 1207
1208 irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, 1208 irq = IO_APIC_get_PCI_irq_vector(dev->bus->number,
@@ -1230,8 +1230,7 @@ static int pirq_enable_irq(struct pci_dev *dev)
1230 } 1230 }
1231 dev = temp_dev; 1231 dev = temp_dev;
1232 if (irq >= 0) { 1232 if (irq >= 0) {
1233 dev->irq_managed = 1; 1233 pci_set_managed_irq(dev, irq);
1234 dev->irq = irq;
1235 dev_info(&dev->dev, "PCI->APIC IRQ transform: " 1234 dev_info(&dev->dev, "PCI->APIC IRQ transform: "
1236 "INT %c -> IRQ %d\n", 'A' + pin - 1, irq); 1235 "INT %c -> IRQ %d\n", 'A' + pin - 1, irq);
1237 return 0; 1236 return 0;
@@ -1257,24 +1256,10 @@ static int pirq_enable_irq(struct pci_dev *dev)
1257 return 0; 1256 return 0;
1258} 1257}
1259 1258
1260bool mp_should_keep_irq(struct device *dev)
1261{
1262 if (dev->power.is_prepared)
1263 return true;
1264#ifdef CONFIG_PM
1265 if (dev->power.runtime_status == RPM_SUSPENDING)
1266 return true;
1267#endif
1268
1269 return false;
1270}
1271
1272static void pirq_disable_irq(struct pci_dev *dev) 1259static void pirq_disable_irq(struct pci_dev *dev)
1273{ 1260{
1274 if (io_apic_assign_pci_irqs && !mp_should_keep_irq(&dev->dev) && 1261 if (io_apic_assign_pci_irqs && pci_has_managed_irq(dev)) {
1275 dev->irq_managed && dev->irq) {
1276 mp_unmap_irq(dev->irq); 1262 mp_unmap_irq(dev->irq);
1277 dev->irq = 0; 1263 pci_reset_managed_irq(dev);
1278 dev->irq_managed = 0;
1279 } 1264 }
1280} 1265}
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c
index b848cc3dc913..d27b4dcf221f 100644
--- a/arch/xtensa/kernel/pci.c
+++ b/arch/xtensa/kernel/pci.c
@@ -210,10 +210,6 @@ subsys_initcall(pcibios_init);
210 210
211void pcibios_fixup_bus(struct pci_bus *bus) 211void pcibios_fixup_bus(struct pci_bus *bus)
212{ 212{
213 if (bus->parent) {
214 /* This is a subordinate bridge */
215 pci_read_bridge_bases(bus);
216 }
217} 213}
218 214
219void pcibios_set_master(struct pci_dev *dev) 215void pcibios_set_master(struct pci_dev *dev)