aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/quirks.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 17:31:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 17:31:28 -0500
commitc08f8467939e7d2eebcba7cf2330242c4f53f2f7 (patch)
tree3430b9acdac374da5fda10d913b52f608494894c /drivers/pci/quirks.c
parentbdccc4edeb03ad68c55053b0260bdaaac547bbd9 (diff)
parentcb8e92d8e4d9f8562071b6ab39e1b837e9e7af39 (diff)
Merge tag 'pci-v3.20-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI changes from Bjorn Helgaas: "Enumeration - Move domain assignment from arm64 to generic code (Lorenzo Pieralisi) - ARM: Remove artificial dependency on pci_sys_data domain (Lorenzo Pieralisi) - ARM: Move to generic PCI domains (Lorenzo Pieralisi) - Generate uppercase hex for modalias var in uevent (Ricardo Ribalda Delgado) - Add and use generic config accessors on ARM, PowerPC (Rob Herring) Resource management - Free resources on failure in of_pci_get_host_bridge_resources() (Lorenzo Pieralisi) - Fix infinite loop with ROM image of size 0 (Michel Dänzer) PCI device hotplug - Handle surprise add even if surprise removal isn't supported (Bjorn Helgaas) Virtualization - Mark AMD/ATI VGA devices that don't reset on D3hot->D0 transition (Alex Williamson) - Add DMA alias quirk for Adaptec 3405 (Alex Williamson) - Add Wellsburg (X99) to Intel PCH root port ACS quirk (Alex Williamson) - Add ACS quirk for Emulex NICs (Vasundhara Volam) MSI - Fail MSI-X mappings if there's no space assigned to MSI-X BAR (Yijing Wang) Freescale Layerscape host bridge driver - Fix platform_no_drv_owner.cocci warnings (Julia Lawall) NVIDIA Tegra host bridge driver - Remove unnecessary tegra_pcie_fixup_bridge() (Lucas Stach) Renesas R-Car host bridge driver - Fix error handling of irq_of_parse_and_map() (Dmitry Torokhov) TI Keystone host bridge driver - Fix error handling of irq_of_parse_and_map() (Dmitry Torokhov) - Fix misspelling of current function in debug output (Julia Lawall) Xilinx AXI host bridge driver - Fix harmless format string warning (Arnd Bergmann) Miscellaneous - Use standard parsing functions for ASPM sysfs setters (Chris J Arges) - Add pci_device_to_OF_node() stub for !CONFIG_OF (Kevin Hao) - Delete unnecessary NULL pointer checks (Markus Elfring) - Add and use defines for PCIe Max_Read_Request_Size (Rafał Miłecki) - Include clk.h instead of clk-private.h (Stephen Boyd)" * tag 'pci-v3.20-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (48 commits) PCI: Add pci_device_to_OF_node() stub for !CONFIG_OF PCI: xilinx: Convert to use generic config accessors PCI: xgene: Convert to use generic config accessors PCI: tegra: Convert to use generic config accessors PCI: rcar: Convert to use generic config accessors PCI: generic: Convert to use generic config accessors powerpc/powermac: Convert PCI to use generic config accessors powerpc/fsl_pci: Convert PCI to use generic config accessors ARM: ks8695: Convert PCI to use generic config accessors ARM: sa1100: Convert PCI to use generic config accessors ARM: integrator: Convert PCI to use generic config accessors PCI: versatile: Add DT-based ARM Versatile PB PCIe host driver ARM: dts: versatile: add PCI controller binding of/pci: Free resources on failure in of_pci_get_host_bridge_resources() PCI: versatile: Add DT docs for ARM Versatile PB PCIe driver PCI: Fail MSI-X mappings if there's no space assigned to MSI-X BAR r8169: use PCI define for Max_Read_Request_Size [SCSI] esas2r: use PCI define for Max_Read_Request_Size tile: use PCI define for Max_Read_Request_Size rapidio/tsi721: use PCI define for Max_Read_Request_Size ...
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r--drivers/pci/quirks.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 903d5078b5ed..85f247e28a80 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3076,6 +3076,27 @@ static void quirk_no_bus_reset(struct pci_dev *dev)
3076 */ 3076 */
3077DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0030, quirk_no_bus_reset); 3077DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0030, quirk_no_bus_reset);
3078 3078
3079static void quirk_no_pm_reset(struct pci_dev *dev)
3080{
3081 /*
3082 * We can't do a bus reset on root bus devices, but an ineffective
3083 * PM reset may be better than nothing.
3084 */
3085 if (!pci_is_root_bus(dev->bus))
3086 dev->dev_flags |= PCI_DEV_FLAGS_NO_PM_RESET;
3087}
3088
3089/*
3090 * Some AMD/ATI GPUS (HD8570 - Oland) report that a D3hot->D0 transition
3091 * causes a reset (i.e., they advertise NoSoftRst-). This transition seems
3092 * to have no effect on the device: it retains the framebuffer contents and
3093 * monitor sync. Advertising this support makes other layers, like VFIO,
3094 * assume pci_reset_function() is viable for this device. Mark it as
3095 * unavailable to skip it when testing reset methods.
3096 */
3097DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_ATI, PCI_ANY_ID,
3098 PCI_CLASS_DISPLAY_VGA, 8, quirk_no_pm_reset);
3099
3079#ifdef CONFIG_ACPI 3100#ifdef CONFIG_ACPI
3080/* 3101/*
3081 * Apple: Shutdown Cactus Ridge Thunderbolt controller. 3102 * Apple: Shutdown Cactus Ridge Thunderbolt controller.
@@ -3576,6 +3597,44 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_JMICRON,
3576 quirk_dma_func1_alias); 3597 quirk_dma_func1_alias);
3577 3598
3578/* 3599/*
3600 * Some devices DMA with the wrong devfn, not just the wrong function.
3601 * quirk_fixed_dma_alias() uses this table to create fixed aliases, where
3602 * the alias is "fixed" and independent of the device devfn.
3603 *
3604 * For example, the Adaptec 3405 is a PCIe card with an Intel 80333 I/O
3605 * processor. To software, this appears as a PCIe-to-PCI/X bridge with a
3606 * single device on the secondary bus. In reality, the single exposed
3607 * device at 0e.0 is the Address Translation Unit (ATU) of the controller
3608 * that provides a bridge to the internal bus of the I/O processor. The
3609 * controller supports private devices, which can be hidden from PCI config
3610 * space. In the case of the Adaptec 3405, a private device at 01.0
3611 * appears to be the DMA engine, which therefore needs to become a DMA
3612 * alias for the device.
3613 */
3614static const struct pci_device_id fixed_dma_alias_tbl[] = {
3615 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x0285,
3616 PCI_VENDOR_ID_ADAPTEC2, 0x02bb), /* Adaptec 3405 */
3617 .driver_data = PCI_DEVFN(1, 0) },
3618 { 0 }
3619};
3620
3621static void quirk_fixed_dma_alias(struct pci_dev *dev)
3622{
3623 const struct pci_device_id *id;
3624
3625 id = pci_match_id(fixed_dma_alias_tbl, dev);
3626 if (id) {
3627 dev->dma_alias_devfn = id->driver_data;
3628 dev->dev_flags |= PCI_DEV_FLAGS_DMA_ALIAS_DEVFN;
3629 dev_info(&dev->dev, "Enabling fixed DMA alias to %02x.%d\n",
3630 PCI_SLOT(dev->dma_alias_devfn),
3631 PCI_FUNC(dev->dma_alias_devfn));
3632 }
3633}
3634
3635DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ADAPTEC2, 0x0285, quirk_fixed_dma_alias);
3636
3637/*
3579 * A few PCIe-to-PCI bridges fail to expose a PCIe capability, resulting in 3638 * A few PCIe-to-PCI bridges fail to expose a PCIe capability, resulting in
3580 * using the wrong DMA alias for the device. Some of these devices can be 3639 * using the wrong DMA alias for the device. Some of these devices can be
3581 * used as either forward or reverse bridges, so we need to test whether the 3640 * used as either forward or reverse bridges, so we need to test whether the
@@ -3678,6 +3737,9 @@ static const u16 pci_quirk_intel_pch_acs_ids[] = {
3678 0x9c98, 0x9c99, 0x9c9a, 0x9c9b, 3737 0x9c98, 0x9c99, 0x9c9a, 0x9c9b,
3679 /* Patsburg (X79) PCH */ 3738 /* Patsburg (X79) PCH */
3680 0x1d10, 0x1d12, 0x1d14, 0x1d16, 0x1d18, 0x1d1a, 0x1d1c, 0x1d1e, 3739 0x1d10, 0x1d12, 0x1d14, 0x1d16, 0x1d18, 0x1d1a, 0x1d1c, 0x1d1e,
3740 /* Wellsburg (X99) PCH */
3741 0x8d10, 0x8d11, 0x8d12, 0x8d13, 0x8d14, 0x8d15, 0x8d16, 0x8d17,
3742 0x8d18, 0x8d19, 0x8d1a, 0x8d1b, 0x8d1c, 0x8d1d, 0x8d1e,
3681}; 3743};
3682 3744
3683static bool pci_quirk_intel_pch_acs_match(struct pci_dev *dev) 3745static bool pci_quirk_intel_pch_acs_match(struct pci_dev *dev)
@@ -3761,6 +3823,8 @@ static const struct pci_dev_acs_enabled {
3761 { PCI_VENDOR_ID_INTEL, 0x1551, pci_quirk_mf_endpoint_acs }, 3823 { PCI_VENDOR_ID_INTEL, 0x1551, pci_quirk_mf_endpoint_acs },
3762 { PCI_VENDOR_ID_INTEL, 0x1558, pci_quirk_mf_endpoint_acs }, 3824 { PCI_VENDOR_ID_INTEL, 0x1558, pci_quirk_mf_endpoint_acs },
3763 { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_pch_acs }, 3825 { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_pch_acs },
3826 { 0x19a2, 0x710, pci_quirk_mf_endpoint_acs }, /* Emulex BE3-R */
3827 { 0x10df, 0x720, pci_quirk_mf_endpoint_acs }, /* Emulex Skyhawk-R */
3764 { 0 } 3828 { 0 }
3765}; 3829};
3766 3830