aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-14 00:02:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-14 00:02:00 -0500
commit2f466d33f5f60542d3d82c0477de5863b22c94b9 (patch)
tree839972958941d55852a9af270b04af09e3147116 /arch/x86/pci
parentf9300eaaac1ca300083ad41937923a90cc3a2394 (diff)
parenteaaeb1cb33310dea6c3fa45d8bfc63e5a1d0a846 (diff)
Merge tag 'pci-v3.13-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI changes from Bjorn Helgaas: "Resource management - Fix host bridge window coalescing (Alexey Neyman) - Pass type, width, and prefetchability for window alignment (Wei Yang) PCI device hotplug - Convert acpiphp, acpiphp_ibm to dynamic debug (Lan Tianyu) Power management - Remove pci_pm_complete() (Liu Chuansheng) MSI - Fail initialization if device is not in PCI_D0 (Yijing Wang) MPS (Max Payload Size) - Use pcie_get_mps() and pcie_set_mps() to simplify code (Yijing Wang) - Use pcie_set_readrq() to simplify code (Yijing Wang) - Use cached pci_dev->pcie_mpss to simplify code (Yijing Wang) SR-IOV - Enable upstream bridges even for VFs on virtual buses (Bjorn Helgaas) - Use pci_is_root_bus() to avoid catching virtual buses (Wei Yang) Virtualization - Add x86 MSI masking ops (Konrad Rzeszutek Wilk) Freescale i.MX6 - Support i.MX6 PCIe controller (Sean Cross) - Increase link startup timeout (Marek Vasut) - Probe PCIe in fs_initcall() (Marek Vasut) - Fix imprecise abort handler (Tim Harvey) - Remove redundant of_match_ptr (Sachin Kamat) Renesas R-Car - Support Gen2 internal PCIe controller (Valentine Barshak) Samsung Exynos - Add MSI support (Jingoo Han) - Turn off power when link fails (Jingoo Han) - Add Jingoo Han as maintainer (Jingoo Han) - Add clk_disable_unprepare() on error path (Wei Yongjun) - Remove redundant of_match_ptr (Sachin Kamat) Synopsys DesignWare - Add irq_create_mapping() (Pratyush Anand) - Add header guards (Seungwon Jeon) Miscellaneous - Enable native PCIe services by default on non-ACPI (Andrew Murray) - Cleanup _OSC usage and messages (Bjorn Helgaas) - Remove pcibios_last_bus boot option on non-x86 (Bjorn Helgaas) - Convert bus code to use bus_, drv_, and dev_groups (Greg Kroah-Hartman) - Remove unused pci_mem_start (Myron Stowe) - Make sysfs functions static (Sachin Kamat) - Warn on invalid return from driver probe (Stephen M. Cameron) - Remove Intel Haswell D3 delays (Todd E Brandt) - Call pci_set_master() in core if driver doesn't do it (Yinghai Lu) - Use pci_is_pcie() to simplify code (Yijing Wang) - Use PCIe capability accessors to simplify code (Yijing Wang) - Use cached pci_dev->pcie_cap to simplify code (Yijing Wang) - Removed unused "is_pcie" from struct pci_dev (Yijing Wang) - Simplify sysfs CPU affinity implementation (Yijing Wang)" * tag 'pci-v3.13-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (79 commits) PCI: Enable upstream bridges even for VFs on virtual buses PCI: Add pci_upstream_bridge() PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq() PCI: Warn on driver probe return value greater than zero PCI: Drop warning about drivers that don't use pci_set_master() PCI: Workaround missing pci_set_master in pci drivers powerpc/pci: Use pci_is_pcie() to simplify code [fix] PCI: Update pcie_ports 'auto' behavior for non-ACPI platforms PCI: imx6: Probe the PCIe in fs_initcall() PCI: Add R-Car Gen2 internal PCI support PCI: imx6: Remove redundant of_match_ptr PCI: Report pci_pme_active() kmalloc failure mn10300/PCI: Remove useless pcibios_last_bus frv/PCI: Remove pcibios_last_bus PCI: imx6: Increase link startup timeout PCI: exynos: Remove redundant of_match_ptr PCI: imx6: Fix imprecise abort handler PCI: Fail MSI/MSI-X initialization if device is not in PCI_D0 PCI: imx6: Remove redundant dev_err() in imx6_pcie_probe() x86/PCI: Coalesce multiple overlapping host bridge windows ...
Diffstat (limited to 'arch/x86/pci')
-rw-r--r--arch/x86/pci/acpi.c8
-rw-r--r--arch/x86/pci/fixup.c18
-rw-r--r--arch/x86/pci/xen.c13
3 files changed, 26 insertions, 13 deletions
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index b30e937689d6..7fb24e53d4c8 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -354,12 +354,12 @@ static void coalesce_windows(struct pci_root_info *info, unsigned long type)
354 * the kernel resource tree doesn't allow overlaps. 354 * the kernel resource tree doesn't allow overlaps.
355 */ 355 */
356 if (resource_overlaps(res1, res2)) { 356 if (resource_overlaps(res1, res2)) {
357 res1->start = min(res1->start, res2->start); 357 res2->start = min(res1->start, res2->start);
358 res1->end = max(res1->end, res2->end); 358 res2->end = max(res1->end, res2->end);
359 dev_info(&info->bridge->dev, 359 dev_info(&info->bridge->dev,
360 "host bridge window expanded to %pR; %pR ignored\n", 360 "host bridge window expanded to %pR; %pR ignored\n",
361 res1, res2); 361 res2, res1);
362 res2->flags = 0; 362 res1->flags = 0;
363 } 363 }
364 } 364 }
365 } 365 }
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index f5809fa2753e..b046e070e088 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -231,7 +231,7 @@ static int quirk_pcie_aspm_write(struct pci_bus *bus, unsigned int devfn, int wh
231 offset = quirk_aspm_offset[GET_INDEX(bus->self->device, devfn)]; 231 offset = quirk_aspm_offset[GET_INDEX(bus->self->device, devfn)];
232 232
233 if ((offset) && (where == offset)) 233 if ((offset) && (where == offset))
234 value = value & 0xfffffffc; 234 value = value & ~PCI_EXP_LNKCTL_ASPMC;
235 235
236 return raw_pci_write(pci_domain_nr(bus), bus->number, 236 return raw_pci_write(pci_domain_nr(bus), bus->number,
237 devfn, where, size, value); 237 devfn, where, size, value);
@@ -252,7 +252,7 @@ static struct pci_ops quirk_pcie_aspm_ops = {
252 */ 252 */
253static void pcie_rootport_aspm_quirk(struct pci_dev *pdev) 253static void pcie_rootport_aspm_quirk(struct pci_dev *pdev)
254{ 254{
255 int cap_base, i; 255 int i;
256 struct pci_bus *pbus; 256 struct pci_bus *pbus;
257 struct pci_dev *dev; 257 struct pci_dev *dev;
258 258
@@ -278,7 +278,7 @@ static void pcie_rootport_aspm_quirk(struct pci_dev *pdev)
278 for (i = GET_INDEX(pdev->device, 0); i <= GET_INDEX(pdev->device, 7); ++i) 278 for (i = GET_INDEX(pdev->device, 0); i <= GET_INDEX(pdev->device, 7); ++i)
279 quirk_aspm_offset[i] = 0; 279 quirk_aspm_offset[i] = 0;
280 280
281 pbus->ops = pbus->parent->ops; 281 pci_bus_set_ops(pbus, pbus->parent->ops);
282 } else { 282 } else {
283 /* 283 /*
284 * If devices are attached to the root port at power-up or 284 * If devices are attached to the root port at power-up or
@@ -286,13 +286,15 @@ static void pcie_rootport_aspm_quirk(struct pci_dev *pdev)
286 * each root port to save the register offsets and replace the 286 * each root port to save the register offsets and replace the
287 * bus ops. 287 * bus ops.
288 */ 288 */
289 list_for_each_entry(dev, &pbus->devices, bus_list) { 289 list_for_each_entry(dev, &pbus->devices, bus_list)
290 /* There are 0 to 8 devices attached to this bus */ 290 /* There are 0 to 8 devices attached to this bus */
291 cap_base = pci_find_capability(dev, PCI_CAP_ID_EXP); 291 quirk_aspm_offset[GET_INDEX(pdev->device, dev->devfn)] =
292 quirk_aspm_offset[GET_INDEX(pdev->device, dev->devfn)] = cap_base + 0x10; 292 dev->pcie_cap + PCI_EXP_LNKCTL;
293 } 293
294 pbus->ops = &quirk_pcie_aspm_ops; 294 pci_bus_set_ops(pbus, &quirk_pcie_aspm_ops);
295 dev_info(&pbus->dev, "writes to ASPM control bits will be ignored\n");
295 } 296 }
297
296} 298}
297DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PA, pcie_rootport_aspm_quirk); 299DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PA, pcie_rootport_aspm_quirk);
298DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PA1, pcie_rootport_aspm_quirk); 300DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MCH_PA1, pcie_rootport_aspm_quirk);
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
index 48e8461057ba..5eee4959785d 100644
--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -382,7 +382,14 @@ static void xen_teardown_msi_irq(unsigned int irq)
382{ 382{
383 xen_destroy_irq(irq); 383 xen_destroy_irq(irq);
384} 384}
385 385static u32 xen_nop_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag)
386{
387 return 0;
388}
389static u32 xen_nop_msix_mask_irq(struct msi_desc *desc, u32 flag)
390{
391 return 0;
392}
386#endif 393#endif
387 394
388int __init pci_xen_init(void) 395int __init pci_xen_init(void)
@@ -406,6 +413,8 @@ int __init pci_xen_init(void)
406 x86_msi.setup_msi_irqs = xen_setup_msi_irqs; 413 x86_msi.setup_msi_irqs = xen_setup_msi_irqs;
407 x86_msi.teardown_msi_irq = xen_teardown_msi_irq; 414 x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
408 x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs; 415 x86_msi.teardown_msi_irqs = xen_teardown_msi_irqs;
416 x86_msi.msi_mask_irq = xen_nop_msi_mask_irq;
417 x86_msi.msix_mask_irq = xen_nop_msix_mask_irq;
409#endif 418#endif
410 return 0; 419 return 0;
411} 420}
@@ -485,6 +494,8 @@ int __init pci_xen_initial_domain(void)
485 x86_msi.setup_msi_irqs = xen_initdom_setup_msi_irqs; 494 x86_msi.setup_msi_irqs = xen_initdom_setup_msi_irqs;
486 x86_msi.teardown_msi_irq = xen_teardown_msi_irq; 495 x86_msi.teardown_msi_irq = xen_teardown_msi_irq;
487 x86_msi.restore_msi_irqs = xen_initdom_restore_msi_irqs; 496 x86_msi.restore_msi_irqs = xen_initdom_restore_msi_irqs;
497 x86_msi.msi_mask_irq = xen_nop_msi_mask_irq;
498 x86_msi.msix_mask_irq = xen_nop_msix_mask_irq;
488#endif 499#endif
489 xen_setup_acpi_sci(); 500 xen_setup_acpi_sci();
490 __acpi_register_gsi = acpi_register_gsi_xen; 501 __acpi_register_gsi = acpi_register_gsi_xen;