diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 15:05:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 15:05:36 -0400 |
commit | fdb2f9c2ebd4f07d7b11a3bc86d8c669eb841697 (patch) | |
tree | d85824518fc13a8c84b7399019fc11ad77aaa120 /arch | |
parent | 81f56e5375e84689b891e0e6c5a02ec12a1f18d9 (diff) | |
parent | 78c8f84302ce007aedcfa11912fd4aacf22727ab (diff) |
Merge tag 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI changes from Bjorn Helgaas:
"Host bridge hotplug
- Protect acpi_pci_drivers and acpi_pci_roots (Taku Izumi)
- Clear host bridge resource info to avoid issue when releasing
(Yinghai Lu)
- Notify acpi_pci_drivers when hot-plugging host bridges (Jiang Liu)
- Use standard list ops for acpi_pci_drivers (Jiang Liu)
Device hotplug
- Use pci_get_domain_bus_and_slot() to close hotplug races (Jiang
Liu)
- Remove fakephp driver (Bjorn Helgaas)
- Fix VGA ref count in hotplug remove path (Yinghai Lu)
- Allow acpiphp to handle PCIe ports without native hotplug (Jiang
Liu)
- Implement resume regardless of pciehp_force param (Oliver Neukum)
- Make pci_fixup_irqs() work after init (Thierry Reding)
Miscellaneous
- Add pci_pcie_type(dev) and remove pci_dev.pcie_type (Yijing Wang)
- Factor out PCI Express Capability accessors (Jiang Liu)
- Add pcibios_window_alignment() so powerpc EEH can use generic
resource assignment (Gavin Shan)
- Make pci_error_handlers const (Stephen Hemminger)
- Cleanup drivers/pci/remove.c (Bjorn Helgaas)
- Improve Vendor-Specific Extended Capability support (Bjorn
Helgaas)
- Use standard list ops for bus->devices (Bjorn Helgaas)
- Avoid kmalloc in pci_get_subsys() and pci_get_class() (Feng Tang)
- Reassign invalid bus number ranges (Intel DP43BF workaround)
(Yinghai Lu)"
* tag 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (102 commits)
PCI: acpiphp: Handle PCIe ports without native hotplug capability
PCI/ACPI: Use acpi_driver_data() rather than searching acpi_pci_roots
PCI/ACPI: Protect acpi_pci_roots list with mutex
PCI/ACPI: Use acpi_pci_root info rather than looking it up again
PCI/ACPI: Pass acpi_pci_root to acpi_pci_drivers' add/remove interface
PCI/ACPI: Protect acpi_pci_drivers list with mutex
PCI/ACPI: Notify acpi_pci_drivers when hot-plugging PCI root bridges
PCI/ACPI: Use normal list for struct acpi_pci_driver
PCI/ACPI: Use DEVICE_ACPI_HANDLE rather than searching acpi_pci_roots
PCI: Fix default vga ref_count
ia64/PCI: Clear host bridge aperture struct resource
x86/PCI: Clear host bridge aperture struct resource
PCI: Stop all children first, before removing all children
Revert "PCI: Use hotplug-safe pci_get_domain_bus_and_slot()"
PCI: Provide a default pcibios_update_irq()
PCI: Discard __init annotations for pci_fixup_irqs() and related functions
PCI: Use correct type when freeing bus resource list
PCI: Check P2P bridge for invalid secondary/subordinate range
PCI: Convert "new_id"/"remove_id" into generic pci_bus driver attributes
xen-pcifront: Use hotplug-safe pci_get_domain_bus_and_slot()
...
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/kernel/pci.c | 6 | ||||
-rw-r--r-- | arch/arm/kernel/bios32.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-tegra/pcie.c | 12 | ||||
-rw-r--r-- | arch/frv/mb93090-mb00/pci-vdk.c | 4 | ||||
-rw-r--r-- | arch/ia64/pci/pci.c | 11 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/io_common.c | 4 | ||||
-rw-r--r-- | arch/m68k/kernel/pcibios.c | 5 | ||||
-rw-r--r-- | arch/mips/pci/pci-octeon.c | 15 | ||||
-rw-r--r-- | arch/mips/pci/pci.c | 6 | ||||
-rw-r--r-- | arch/powerpc/include/asm/machdep.h | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 20 | ||||
-rw-r--r-- | arch/powerpc/platforms/powernv/pci-ioda.c | 41 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 5 | ||||
-rw-r--r-- | arch/sparc/kernel/leon_pci.c | 9 | ||||
-rw-r--r-- | arch/sparc/kernel/pci.c | 4 | ||||
-rw-r--r-- | arch/tile/kernel/pci.c | 34 | ||||
-rw-r--r-- | arch/tile/kernel/pci_gx.c | 8 | ||||
-rw-r--r-- | arch/unicore32/kernel/pci.c | 8 | ||||
-rw-r--r-- | arch/x86/pci/acpi.c | 3 | ||||
-rw-r--r-- | arch/x86/pci/visws.c | 5 | ||||
-rw-r--r-- | arch/xtensa/kernel/pci.c | 8 |
21 files changed, 79 insertions, 141 deletions
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 9816d5a4d176..ef757147cbf9 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c | |||
@@ -256,12 +256,6 @@ pcibios_fixup_bus(struct pci_bus *bus) | |||
256 | } | 256 | } |
257 | } | 257 | } |
258 | 258 | ||
259 | void __init | ||
260 | pcibios_update_irq(struct pci_dev *dev, int irq) | ||
261 | { | ||
262 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
263 | } | ||
264 | |||
265 | int | 259 | int |
266 | pcibios_enable_device(struct pci_dev *dev, int mask) | 260 | pcibios_enable_device(struct pci_dev *dev, int mask) |
267 | { | 261 | { |
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index 2b2f25e7fef5..9cf16b83bbb5 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
@@ -270,15 +270,6 @@ static void __devinit pci_fixup_it8152(struct pci_dev *dev) | |||
270 | } | 270 | } |
271 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8152, pci_fixup_it8152); | 271 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_8152, pci_fixup_it8152); |
272 | 272 | ||
273 | |||
274 | |||
275 | void __devinit pcibios_update_irq(struct pci_dev *dev, int irq) | ||
276 | { | ||
277 | if (debug_pci) | ||
278 | printk("PCI: Assigning IRQ %02d to %s\n", irq, pci_name(dev)); | ||
279 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
280 | } | ||
281 | |||
282 | /* | 273 | /* |
283 | * If the bus contains any of these devices, then we must not turn on | 274 | * If the bus contains any of these devices, then we must not turn on |
284 | * parity checking of any kind. Currently this is CyberPro 20x0 only. | 275 | * parity checking of any kind. Currently this is CyberPro 20x0 only. |
diff --git a/arch/arm/mach-tegra/pcie.c b/arch/arm/mach-tegra/pcie.c index d3ad5150d660..c25a2a4f2e3d 100644 --- a/arch/arm/mach-tegra/pcie.c +++ b/arch/arm/mach-tegra/pcie.c | |||
@@ -367,17 +367,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf1, tegra_pcie_fixup_class); | |||
367 | /* Tegra PCIE requires relaxed ordering */ | 367 | /* Tegra PCIE requires relaxed ordering */ |
368 | static void __devinit tegra_pcie_relax_enable(struct pci_dev *dev) | 368 | static void __devinit tegra_pcie_relax_enable(struct pci_dev *dev) |
369 | { | 369 | { |
370 | u16 val16; | 370 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_RELAX_EN); |
371 | int pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | ||
372 | |||
373 | if (pos <= 0) { | ||
374 | dev_err(&dev->dev, "skipping relaxed ordering fixup\n"); | ||
375 | return; | ||
376 | } | ||
377 | |||
378 | pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &val16); | ||
379 | val16 |= PCI_EXP_DEVCTL_RELAX_EN; | ||
380 | pci_write_config_word(dev, pos + PCI_EXP_DEVCTL, val16); | ||
381 | } | 371 | } |
382 | DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_relax_enable); | 372 | DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, tegra_pcie_relax_enable); |
383 | 373 | ||
diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c index d04ed14bbf0c..71e9bcf58105 100644 --- a/arch/frv/mb93090-mb00/pci-vdk.c +++ b/arch/frv/mb93090-mb00/pci-vdk.c | |||
@@ -330,10 +330,8 @@ void __init pcibios_fixup_bus(struct pci_bus *bus) | |||
330 | pci_read_bridge_bases(bus); | 330 | pci_read_bridge_bases(bus); |
331 | 331 | ||
332 | if (bus->number == 0) { | 332 | if (bus->number == 0) { |
333 | struct list_head *ln; | ||
334 | struct pci_dev *dev; | 333 | struct pci_dev *dev; |
335 | for (ln=bus->devices.next; ln != &bus->devices; ln=ln->next) { | 334 | list_for_each_entry(dev, &bus->devices, bus_list) { |
336 | dev = pci_dev_b(ln); | ||
337 | if (dev->devfn == 0) { | 335 | if (dev->devfn == 0) { |
338 | dev->resource[0].start = 0; | 336 | dev->resource[0].start = 0; |
339 | dev->resource[0].end = 0; | 337 | dev->resource[0].end = 0; |
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 81acc7a57f3e..5faa66c5c2a8 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -295,7 +295,6 @@ static __devinit acpi_status add_window(struct acpi_resource *res, void *data) | |||
295 | window->resource.flags = flags; | 295 | window->resource.flags = flags; |
296 | window->resource.start = addr.minimum + offset; | 296 | window->resource.start = addr.minimum + offset; |
297 | window->resource.end = window->resource.start + addr.address_length - 1; | 297 | window->resource.end = window->resource.start + addr.address_length - 1; |
298 | window->resource.child = NULL; | ||
299 | window->offset = offset; | 298 | window->offset = offset; |
300 | 299 | ||
301 | if (insert_resource(root, &window->resource)) { | 300 | if (insert_resource(root, &window->resource)) { |
@@ -357,7 +356,7 @@ pci_acpi_scan_root(struct acpi_pci_root *root) | |||
357 | &windows); | 356 | &windows); |
358 | if (windows) { | 357 | if (windows) { |
359 | controller->window = | 358 | controller->window = |
360 | kmalloc_node(sizeof(*controller->window) * windows, | 359 | kzalloc_node(sizeof(*controller->window) * windows, |
361 | GFP_KERNEL, controller->node); | 360 | GFP_KERNEL, controller->node); |
362 | if (!controller->window) | 361 | if (!controller->window) |
363 | goto out2; | 362 | goto out2; |
@@ -461,14 +460,6 @@ void pcibios_set_master (struct pci_dev *dev) | |||
461 | /* No special bus mastering setup handling */ | 460 | /* No special bus mastering setup handling */ |
462 | } | 461 | } |
463 | 462 | ||
464 | void __devinit | ||
465 | pcibios_update_irq (struct pci_dev *dev, int irq) | ||
466 | { | ||
467 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
468 | |||
469 | /* ??? FIXME -- record old value for shutdown. */ | ||
470 | } | ||
471 | |||
472 | int | 463 | int |
473 | pcibios_enable_device (struct pci_dev *dev, int mask) | 464 | pcibios_enable_device (struct pci_dev *dev, int mask) |
474 | { | 465 | { |
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c index fbb5f2f87eed..8630875e74b5 100644 --- a/arch/ia64/sn/kernel/io_common.c +++ b/arch/ia64/sn/kernel/io_common.c | |||
@@ -229,7 +229,6 @@ void sn_pci_fixup_slot(struct pci_dev *dev, struct pcidev_info *pcidev_info, | |||
229 | { | 229 | { |
230 | int segment = pci_domain_nr(dev->bus); | 230 | int segment = pci_domain_nr(dev->bus); |
231 | struct pcibus_bussoft *bs; | 231 | struct pcibus_bussoft *bs; |
232 | struct pci_bus *host_pci_bus; | ||
233 | struct pci_dev *host_pci_dev; | 232 | struct pci_dev *host_pci_dev; |
234 | unsigned int bus_no, devfn; | 233 | unsigned int bus_no, devfn; |
235 | 234 | ||
@@ -245,8 +244,7 @@ void sn_pci_fixup_slot(struct pci_dev *dev, struct pcidev_info *pcidev_info, | |||
245 | 244 | ||
246 | bus_no = (pcidev_info->pdi_slot_host_handle >> 32) & 0xff; | 245 | bus_no = (pcidev_info->pdi_slot_host_handle >> 32) & 0xff; |
247 | devfn = pcidev_info->pdi_slot_host_handle & 0xffffffff; | 246 | devfn = pcidev_info->pdi_slot_host_handle & 0xffffffff; |
248 | host_pci_bus = pci_find_bus(segment, bus_no); | 247 | host_pci_dev = pci_get_domain_bus_and_slot(segment, bus_no, devfn); |
249 | host_pci_dev = pci_get_slot(host_pci_bus, devfn); | ||
250 | 248 | ||
251 | pcidev_info->host_pci_dev = host_pci_dev; | 249 | pcidev_info->host_pci_dev = host_pci_dev; |
252 | pcidev_info->pdi_linux_pcidev = dev; | 250 | pcidev_info->pdi_linux_pcidev = dev; |
diff --git a/arch/m68k/kernel/pcibios.c b/arch/m68k/kernel/pcibios.c index b2988aa1840b..73fa0b56a06c 100644 --- a/arch/m68k/kernel/pcibios.c +++ b/arch/m68k/kernel/pcibios.c | |||
@@ -87,11 +87,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
87 | return 0; | 87 | return 0; |
88 | } | 88 | } |
89 | 89 | ||
90 | void pcibios_update_irq(struct pci_dev *dev, int irq) | ||
91 | { | ||
92 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
93 | } | ||
94 | |||
95 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) | 90 | void __devinit pcibios_fixup_bus(struct pci_bus *bus) |
96 | { | 91 | { |
97 | struct pci_dev *dev; | 92 | struct pci_dev *dev; |
diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c index 52a1ba70b3b6..c5dfb2c87d44 100644 --- a/arch/mips/pci/pci-octeon.c +++ b/arch/mips/pci/pci-octeon.c | |||
@@ -117,16 +117,11 @@ int pcibios_plat_dev_init(struct pci_dev *dev) | |||
117 | } | 117 | } |
118 | 118 | ||
119 | /* Enable the PCIe normal error reporting */ | 119 | /* Enable the PCIe normal error reporting */ |
120 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | 120 | config = PCI_EXP_DEVCTL_CERE; /* Correctable Error Reporting */ |
121 | if (pos) { | 121 | config |= PCI_EXP_DEVCTL_NFERE; /* Non-Fatal Error Reporting */ |
122 | /* Update Device Control */ | 122 | config |= PCI_EXP_DEVCTL_FERE; /* Fatal Error Reporting */ |
123 | pci_read_config_word(dev, pos + PCI_EXP_DEVCTL, &config); | 123 | config |= PCI_EXP_DEVCTL_URRE; /* Unsupported Request */ |
124 | config |= PCI_EXP_DEVCTL_CERE; /* Correctable Error Reporting */ | 124 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL, config); |
125 | config |= PCI_EXP_DEVCTL_NFERE; /* Non-Fatal Error Reporting */ | ||
126 | config |= PCI_EXP_DEVCTL_FERE; /* Fatal Error Reporting */ | ||
127 | config |= PCI_EXP_DEVCTL_URRE; /* Unsupported Request */ | ||
128 | pci_write_config_word(dev, pos + PCI_EXP_DEVCTL, config); | ||
129 | } | ||
130 | 125 | ||
131 | /* Find the Advanced Error Reporting capability */ | 126 | /* Find the Advanced Error Reporting capability */ |
132 | pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); | 127 | pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR); |
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index 690356808f8a..04e35bcde07c 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c | |||
@@ -313,12 +313,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) | |||
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | void __init | ||
317 | pcibios_update_irq(struct pci_dev *dev, int irq) | ||
318 | { | ||
319 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
320 | } | ||
321 | |||
322 | #ifdef CONFIG_HOTPLUG | 316 | #ifdef CONFIG_HOTPLUG |
323 | EXPORT_SYMBOL(PCIBIOS_MIN_IO); | 317 | EXPORT_SYMBOL(PCIBIOS_MIN_IO); |
324 | EXPORT_SYMBOL(PCIBIOS_MIN_MEM); | 318 | EXPORT_SYMBOL(PCIBIOS_MIN_MEM); |
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 42ce570812c1..f7706d722b39 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h | |||
@@ -214,6 +214,9 @@ struct machdep_calls { | |||
214 | /* Called after scan and before resource survey */ | 214 | /* Called after scan and before resource survey */ |
215 | void (*pcibios_fixup_phb)(struct pci_controller *hose); | 215 | void (*pcibios_fixup_phb)(struct pci_controller *hose); |
216 | 216 | ||
217 | /* Called during PCI resource reassignment */ | ||
218 | resource_size_t (*pcibios_window_alignment)(struct pci_bus *, unsigned long type); | ||
219 | |||
217 | /* Called to shutdown machine specific hardware not already controlled | 220 | /* Called to shutdown machine specific hardware not already controlled |
218 | * by other drivers. | 221 | * by other drivers. |
219 | */ | 222 | */ |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 2aa04f29e1de..43fea543d686 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -99,6 +99,26 @@ void pcibios_free_controller(struct pci_controller *phb) | |||
99 | kfree(phb); | 99 | kfree(phb); |
100 | } | 100 | } |
101 | 101 | ||
102 | /* | ||
103 | * The function is used to return the minimal alignment | ||
104 | * for memory or I/O windows of the associated P2P bridge. | ||
105 | * By default, 4KiB alignment for I/O windows and 1MiB for | ||
106 | * memory windows. | ||
107 | */ | ||
108 | resource_size_t pcibios_window_alignment(struct pci_bus *bus, | ||
109 | unsigned long type) | ||
110 | { | ||
111 | if (ppc_md.pcibios_window_alignment) | ||
112 | return ppc_md.pcibios_window_alignment(bus, type); | ||
113 | |||
114 | /* | ||
115 | * PCI core will figure out the default | ||
116 | * alignment: 4KiB for I/O and 1MiB for | ||
117 | * memory window. | ||
118 | */ | ||
119 | return 1; | ||
120 | } | ||
121 | |||
102 | static resource_size_t pcibios_io_size(const struct pci_controller *hose) | 122 | static resource_size_t pcibios_io_size(const struct pci_controller *hose) |
103 | { | 123 | { |
104 | #ifdef CONFIG_PPC64 | 124 | #ifdef CONFIG_PPC64 |
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 9cda6a1ad0cf..0e7eccc0f88d 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -855,7 +855,7 @@ static void __devinit pnv_ioda_setup_PEs(struct pci_bus *bus) | |||
855 | if (pe == NULL) | 855 | if (pe == NULL) |
856 | continue; | 856 | continue; |
857 | /* Leaving the PCIe domain ... single PE# */ | 857 | /* Leaving the PCIe domain ... single PE# */ |
858 | if (dev->pcie_type == PCI_EXP_TYPE_PCI_BRIDGE) | 858 | if (pci_pcie_type(dev) == PCI_EXP_TYPE_PCI_BRIDGE) |
859 | pnv_ioda_setup_bus_PE(dev, pe); | 859 | pnv_ioda_setup_bus_PE(dev, pe); |
860 | else if (dev->subordinate) | 860 | else if (dev->subordinate) |
861 | pnv_ioda_setup_PEs(dev->subordinate); | 861 | pnv_ioda_setup_PEs(dev->subordinate); |
@@ -1139,6 +1139,44 @@ static void __devinit pnv_pci_ioda_fixup_phb(struct pci_controller *hose) | |||
1139 | } | 1139 | } |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | /* | ||
1143 | * Returns the alignment for I/O or memory windows for P2P | ||
1144 | * bridges. That actually depends on how PEs are segmented. | ||
1145 | * For now, we return I/O or M32 segment size for PE sensitive | ||
1146 | * P2P bridges. Otherwise, the default values (4KiB for I/O, | ||
1147 | * 1MiB for memory) will be returned. | ||
1148 | * | ||
1149 | * The current PCI bus might be put into one PE, which was | ||
1150 | * create against the parent PCI bridge. For that case, we | ||
1151 | * needn't enlarge the alignment so that we can save some | ||
1152 | * resources. | ||
1153 | */ | ||
1154 | static resource_size_t pnv_pci_window_alignment(struct pci_bus *bus, | ||
1155 | unsigned long type) | ||
1156 | { | ||
1157 | struct pci_dev *bridge; | ||
1158 | struct pci_controller *hose = pci_bus_to_host(bus); | ||
1159 | struct pnv_phb *phb = hose->private_data; | ||
1160 | int num_pci_bridges = 0; | ||
1161 | |||
1162 | bridge = bus->self; | ||
1163 | while (bridge) { | ||
1164 | if (pci_pcie_type(bridge) == PCI_EXP_TYPE_PCI_BRIDGE) { | ||
1165 | num_pci_bridges++; | ||
1166 | if (num_pci_bridges >= 2) | ||
1167 | return 1; | ||
1168 | } | ||
1169 | |||
1170 | bridge = bridge->bus->self; | ||
1171 | } | ||
1172 | |||
1173 | /* We need support prefetchable memory window later */ | ||
1174 | if (type & IORESOURCE_MEM) | ||
1175 | return phb->ioda.m32_segsize; | ||
1176 | |||
1177 | return phb->ioda.io_segsize; | ||
1178 | } | ||
1179 | |||
1142 | /* Prevent enabling devices for which we couldn't properly | 1180 | /* Prevent enabling devices for which we couldn't properly |
1143 | * assign a PE | 1181 | * assign a PE |
1144 | */ | 1182 | */ |
@@ -1306,6 +1344,7 @@ void __init pnv_pci_init_ioda1_phb(struct device_node *np) | |||
1306 | */ | 1344 | */ |
1307 | ppc_md.pcibios_fixup_phb = pnv_pci_ioda_fixup_phb; | 1345 | ppc_md.pcibios_fixup_phb = pnv_pci_ioda_fixup_phb; |
1308 | ppc_md.pcibios_enable_device_hook = pnv_pci_enable_device_hook; | 1346 | ppc_md.pcibios_enable_device_hook = pnv_pci_enable_device_hook; |
1347 | ppc_md.pcibios_window_alignment = pnv_pci_window_alignment; | ||
1309 | pci_add_flags(PCI_PROBE_ONLY | PCI_REASSIGN_ALL_RSRC); | 1348 | pci_add_flags(PCI_PROBE_ONLY | PCI_REASSIGN_ALL_RSRC); |
1310 | 1349 | ||
1311 | /* Reset IODA tables to a clean state */ | 1350 | /* Reset IODA tables to a clean state */ |
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index 40db2d0aef3f..a7e078f2e2e4 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -192,11 +192,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
192 | return pci_enable_resources(dev, mask); | 192 | return pci_enable_resources(dev, mask); |
193 | } | 193 | } |
194 | 194 | ||
195 | void __init pcibios_update_irq(struct pci_dev *dev, int irq) | ||
196 | { | ||
197 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
198 | } | ||
199 | |||
200 | static void __init | 195 | static void __init |
201 | pcibios_bus_report_status_early(struct pci_channel *hose, | 196 | pcibios_bus_report_status_early(struct pci_channel *hose, |
202 | int top_bus, int current_bus, | 197 | int top_bus, int current_bus, |
diff --git a/arch/sparc/kernel/leon_pci.c b/arch/sparc/kernel/leon_pci.c index 21dcda75a520..fc0521161568 100644 --- a/arch/sparc/kernel/leon_pci.c +++ b/arch/sparc/kernel/leon_pci.c | |||
@@ -102,15 +102,6 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) | |||
102 | return pci_enable_resources(dev, mask); | 102 | return pci_enable_resources(dev, mask); |
103 | } | 103 | } |
104 | 104 | ||
105 | void __devinit pcibios_update_irq(struct pci_dev *dev, int irq) | ||
106 | { | ||
107 | #ifdef CONFIG_PCI_DEBUG | ||
108 | printk(KERN_DEBUG "LEONPCI: Assigning IRQ %02d to %s\n", irq, | ||
109 | pci_name(dev)); | ||
110 | #endif | ||
111 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
112 | } | ||
113 | |||
114 | /* in/out routines taken from pcic.c | 105 | /* in/out routines taken from pcic.c |
115 | * | 106 | * |
116 | * This probably belongs here rather than ioport.c because | 107 | * This probably belongs here rather than ioport.c because |
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 065b88c4f868..acc8c838ff72 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -622,10 +622,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *pbus) | |||
622 | { | 622 | { |
623 | } | 623 | } |
624 | 624 | ||
625 | void pcibios_update_irq(struct pci_dev *pdev, int irq) | ||
626 | { | ||
627 | } | ||
628 | |||
629 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, | 625 | resource_size_t pcibios_align_resource(void *data, const struct resource *res, |
630 | resource_size_t size, resource_size_t align) | 626 | resource_size_t size, resource_size_t align) |
631 | { | 627 | { |
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c index 33c10864d2f7..759822687e8f 100644 --- a/arch/tile/kernel/pci.c +++ b/arch/tile/kernel/pci.c | |||
@@ -246,16 +246,13 @@ static void __devinit fixup_read_and_payload_sizes(void) | |||
246 | 246 | ||
247 | /* Scan for the smallest maximum payload size. */ | 247 | /* Scan for the smallest maximum payload size. */ |
248 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | 248 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { |
249 | int pcie_caps_offset; | ||
250 | u32 devcap; | 249 | u32 devcap; |
251 | int max_payload; | 250 | int max_payload; |
252 | 251 | ||
253 | pcie_caps_offset = pci_find_capability(dev, PCI_CAP_ID_EXP); | 252 | if (!pci_is_pcie(dev)) |
254 | if (pcie_caps_offset == 0) | ||
255 | continue; | 253 | continue; |
256 | 254 | ||
257 | pci_read_config_dword(dev, pcie_caps_offset + PCI_EXP_DEVCAP, | 255 | pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &devcap); |
258 | &devcap); | ||
259 | max_payload = devcap & PCI_EXP_DEVCAP_PAYLOAD; | 256 | max_payload = devcap & PCI_EXP_DEVCAP_PAYLOAD; |
260 | if (max_payload < smallest_max_payload) | 257 | if (max_payload < smallest_max_payload) |
261 | smallest_max_payload = max_payload; | 258 | smallest_max_payload = max_payload; |
@@ -263,21 +260,10 @@ static void __devinit fixup_read_and_payload_sizes(void) | |||
263 | 260 | ||
264 | /* Now, set the max_payload_size for all devices to that value. */ | 261 | /* Now, set the max_payload_size for all devices to that value. */ |
265 | new_values = (max_read_size << 12) | (smallest_max_payload << 5); | 262 | new_values = (max_read_size << 12) | (smallest_max_payload << 5); |
266 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | 263 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) |
267 | int pcie_caps_offset; | 264 | pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL, |
268 | u16 devctl; | 265 | PCI_EXP_DEVCTL_PAYLOAD | PCI_EXP_DEVCTL_READRQ, |
269 | 266 | new_values); | |
270 | pcie_caps_offset = pci_find_capability(dev, PCI_CAP_ID_EXP); | ||
271 | if (pcie_caps_offset == 0) | ||
272 | continue; | ||
273 | |||
274 | pci_read_config_word(dev, pcie_caps_offset + PCI_EXP_DEVCTL, | ||
275 | &devctl); | ||
276 | devctl &= ~(PCI_EXP_DEVCTL_PAYLOAD | PCI_EXP_DEVCTL_READRQ); | ||
277 | devctl |= new_values; | ||
278 | pci_write_config_word(dev, pcie_caps_offset + PCI_EXP_DEVCTL, | ||
279 | devctl); | ||
280 | } | ||
281 | } | 267 | } |
282 | 268 | ||
283 | 269 | ||
@@ -404,14 +390,6 @@ void pcibios_set_master(struct pci_dev *dev) | |||
404 | } | 390 | } |
405 | 391 | ||
406 | /* | 392 | /* |
407 | * This is called from the generic Linux layer. | ||
408 | */ | ||
409 | void __devinit pcibios_update_irq(struct pci_dev *dev, int irq) | ||
410 | { | ||
411 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
412 | } | ||
413 | |||
414 | /* | ||
415 | * Enable memory and/or address decoding, as appropriate, for the | 393 | * Enable memory and/or address decoding, as appropriate, for the |
416 | * device described by the 'dev' struct. | 394 | * device described by the 'dev' struct. |
417 | * | 395 | * |
diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c index 0e213e35ffc3..2ba6d052f85d 100644 --- a/arch/tile/kernel/pci_gx.c +++ b/arch/tile/kernel/pci_gx.c | |||
@@ -1034,14 +1034,6 @@ char __devinit *pcibios_setup(char *str) | |||
1034 | } | 1034 | } |
1035 | 1035 | ||
1036 | /* | 1036 | /* |
1037 | * This is called from the generic Linux layer. | ||
1038 | */ | ||
1039 | void __devinit pcibios_update_irq(struct pci_dev *dev, int irq) | ||
1040 | { | ||
1041 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
1042 | } | ||
1043 | |||
1044 | /* | ||
1045 | * Enable memory address decoding, as appropriate, for the | 1037 | * Enable memory address decoding, as appropriate, for the |
1046 | * device described by the 'dev' struct. The I/O decoding | 1038 | * device described by the 'dev' struct. The I/O decoding |
1047 | * is disabled, though the TILE-Gx supports I/O addressing. | 1039 | * is disabled, though the TILE-Gx supports I/O addressing. |
diff --git a/arch/unicore32/kernel/pci.c b/arch/unicore32/kernel/pci.c index 46cb6c9de6c9..b0056f68d321 100644 --- a/arch/unicore32/kernel/pci.c +++ b/arch/unicore32/kernel/pci.c | |||
@@ -154,14 +154,6 @@ void __init puv3_pci_adjust_zones(unsigned long *zone_size, | |||
154 | zhole_size[0] = 0; | 154 | zhole_size[0] = 0; |
155 | } | 155 | } |
156 | 156 | ||
157 | void __devinit pcibios_update_irq(struct pci_dev *dev, int irq) | ||
158 | { | ||
159 | if (debug_pci) | ||
160 | printk(KERN_DEBUG "PCI: Assigning IRQ %02d to %s\n", | ||
161 | irq, pci_name(dev)); | ||
162 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
163 | } | ||
164 | |||
165 | /* | 157 | /* |
166 | * If the bus contains any of these devices, then we must not turn on | 158 | * If the bus contains any of these devices, then we must not turn on |
167 | * parity checking of any kind. | 159 | * parity checking of any kind. |
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 505acdd6d600..192397c98606 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -305,7 +305,6 @@ setup_resource(struct acpi_resource *acpi_res, void *data) | |||
305 | res->flags = flags; | 305 | res->flags = flags; |
306 | res->start = start; | 306 | res->start = start; |
307 | res->end = end; | 307 | res->end = end; |
308 | res->child = NULL; | ||
309 | 308 | ||
310 | if (!pci_use_crs) { | 309 | if (!pci_use_crs) { |
311 | dev_printk(KERN_DEBUG, &info->bridge->dev, | 310 | dev_printk(KERN_DEBUG, &info->bridge->dev, |
@@ -434,7 +433,7 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device, | |||
434 | 433 | ||
435 | size = sizeof(*info->res) * info->res_num; | 434 | size = sizeof(*info->res) * info->res_num; |
436 | info->res_num = 0; | 435 | info->res_num = 0; |
437 | info->res = kmalloc(size, GFP_KERNEL); | 436 | info->res = kzalloc(size, GFP_KERNEL); |
438 | if (!info->res) | 437 | if (!info->res) |
439 | return; | 438 | return; |
440 | 439 | ||
diff --git a/arch/x86/pci/visws.c b/arch/x86/pci/visws.c index 6f2f8eeed171..3e6d2a6db866 100644 --- a/arch/x86/pci/visws.c +++ b/arch/x86/pci/visws.c | |||
@@ -62,11 +62,6 @@ out: | |||
62 | return irq; | 62 | return irq; |
63 | } | 63 | } |
64 | 64 | ||
65 | void __init pcibios_update_irq(struct pci_dev *dev, int irq) | ||
66 | { | ||
67 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
68 | } | ||
69 | |||
70 | int __init pci_visws_init(void) | 65 | int __init pci_visws_init(void) |
71 | { | 66 | { |
72 | pcibios_enable_irq = &pci_visws_enable_irq; | 67 | pcibios_enable_irq = &pci_visws_enable_irq; |
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c index 69759e9cb3ea..54354de38a70 100644 --- a/arch/xtensa/kernel/pci.c +++ b/arch/xtensa/kernel/pci.c | |||
@@ -210,14 +210,6 @@ void pcibios_set_master(struct pci_dev *dev) | |||
210 | /* No special bus mastering setup handling */ | 210 | /* No special bus mastering setup handling */ |
211 | } | 211 | } |
212 | 212 | ||
213 | /* the next one is stolen from the alpha port... */ | ||
214 | |||
215 | void __init | ||
216 | pcibios_update_irq(struct pci_dev *dev, int irq) | ||
217 | { | ||
218 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | ||
219 | } | ||
220 | |||
221 | int pcibios_enable_device(struct pci_dev *dev, int mask) | 213 | int pcibios_enable_device(struct pci_dev *dev, int mask) |
222 | { | 214 | { |
223 | u16 cmd, old_cmd; | 215 | u16 cmd, old_cmd; |