aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/quirks.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r--drivers/pci/quirks.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index ed6f89b6efe5..e248a119f15a 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3028,6 +3028,41 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_REALTEK, 0x8169,
3028DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, PCI_ANY_ID, 3028DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, PCI_ANY_ID,
3029 quirk_broken_intx_masking); 3029 quirk_broken_intx_masking);
3030 3030
3031static void quirk_no_bus_reset(struct pci_dev *dev)
3032{
3033 dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET;
3034}
3035
3036/*
3037 * Atheros AR93xx chips do not behave after a bus reset. The device will
3038 * throw a Link Down error on AER-capable systems and regardless of AER,
3039 * config space of the device is never accessible again and typically
3040 * causes the system to hang or reset when access is attempted.
3041 * http://www.spinics.net/lists/linux-pci/msg34797.html
3042 */
3043DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0030, quirk_no_bus_reset);
3044
3045static void quirk_no_pm_reset(struct pci_dev *dev)
3046{
3047 /*
3048 * We can't do a bus reset on root bus devices, but an ineffective
3049 * PM reset may be better than nothing.
3050 */
3051 if (!pci_is_root_bus(dev->bus))
3052 dev->dev_flags |= PCI_DEV_FLAGS_NO_PM_RESET;
3053}
3054
3055/*
3056 * Some AMD/ATI GPUS (HD8570 - Oland) report that a D3hot->D0 transition
3057 * causes a reset (i.e., they advertise NoSoftRst-). This transition seems
3058 * to have no effect on the device: it retains the framebuffer contents and
3059 * monitor sync. Advertising this support makes other layers, like VFIO,
3060 * assume pci_reset_function() is viable for this device. Mark it as
3061 * unavailable to skip it when testing reset methods.
3062 */
3063DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_ATI, PCI_ANY_ID,
3064 PCI_CLASS_DISPLAY_VGA, 8, quirk_no_pm_reset);
3065
3031#ifdef CONFIG_ACPI 3066#ifdef CONFIG_ACPI
3032/* 3067/*
3033 * Apple: Shutdown Cactus Ridge Thunderbolt controller. 3068 * Apple: Shutdown Cactus Ridge Thunderbolt controller.
@@ -3528,6 +3563,44 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_JMICRON,
3528 quirk_dma_func1_alias); 3563 quirk_dma_func1_alias);
3529 3564
3530/* 3565/*
3566 * Some devices DMA with the wrong devfn, not just the wrong function.
3567 * quirk_fixed_dma_alias() uses this table to create fixed aliases, where
3568 * the alias is "fixed" and independent of the device devfn.
3569 *
3570 * For example, the Adaptec 3405 is a PCIe card with an Intel 80333 I/O
3571 * processor. To software, this appears as a PCIe-to-PCI/X bridge with a
3572 * single device on the secondary bus. In reality, the single exposed
3573 * device at 0e.0 is the Address Translation Unit (ATU) of the controller
3574 * that provides a bridge to the internal bus of the I/O processor. The
3575 * controller supports private devices, which can be hidden from PCI config
3576 * space. In the case of the Adaptec 3405, a private device at 01.0
3577 * appears to be the DMA engine, which therefore needs to become a DMA
3578 * alias for the device.
3579 */
3580static const struct pci_device_id fixed_dma_alias_tbl[] = {
3581 { PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x0285,
3582 PCI_VENDOR_ID_ADAPTEC2, 0x02bb), /* Adaptec 3405 */
3583 .driver_data = PCI_DEVFN(1, 0) },
3584 { 0 }
3585};
3586
3587static void quirk_fixed_dma_alias(struct pci_dev *dev)
3588{
3589 const struct pci_device_id *id;
3590
3591 id = pci_match_id(fixed_dma_alias_tbl, dev);
3592 if (id) {
3593 dev->dma_alias_devfn = id->driver_data;
3594 dev->dev_flags |= PCI_DEV_FLAGS_DMA_ALIAS_DEVFN;
3595 dev_info(&dev->dev, "Enabling fixed DMA alias to %02x.%d\n",
3596 PCI_SLOT(dev->dma_alias_devfn),
3597 PCI_FUNC(dev->dma_alias_devfn));
3598 }
3599}
3600
3601DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ADAPTEC2, 0x0285, quirk_fixed_dma_alias);
3602
3603/*
3531 * A few PCIe-to-PCI bridges fail to expose a PCIe capability, resulting in 3604 * A few PCIe-to-PCI bridges fail to expose a PCIe capability, resulting in
3532 * using the wrong DMA alias for the device. Some of these devices can be 3605 * using the wrong DMA alias for the device. Some of these devices can be
3533 * used as either forward or reverse bridges, so we need to test whether the 3606 * used as either forward or reverse bridges, so we need to test whether the
@@ -3630,6 +3703,9 @@ static const u16 pci_quirk_intel_pch_acs_ids[] = {
3630 0x9c98, 0x9c99, 0x9c9a, 0x9c9b, 3703 0x9c98, 0x9c99, 0x9c9a, 0x9c9b,
3631 /* Patsburg (X79) PCH */ 3704 /* Patsburg (X79) PCH */
3632 0x1d10, 0x1d12, 0x1d14, 0x1d16, 0x1d18, 0x1d1a, 0x1d1c, 0x1d1e, 3705 0x1d10, 0x1d12, 0x1d14, 0x1d16, 0x1d18, 0x1d1a, 0x1d1c, 0x1d1e,
3706 /* Wellsburg (X99) PCH */
3707 0x8d10, 0x8d11, 0x8d12, 0x8d13, 0x8d14, 0x8d15, 0x8d16, 0x8d17,
3708 0x8d18, 0x8d19, 0x8d1a, 0x8d1b, 0x8d1c, 0x8d1d, 0x8d1e,
3633}; 3709};
3634 3710
3635static bool pci_quirk_intel_pch_acs_match(struct pci_dev *dev) 3711static bool pci_quirk_intel_pch_acs_match(struct pci_dev *dev)
@@ -3713,6 +3789,8 @@ static const struct pci_dev_acs_enabled {
3713 { PCI_VENDOR_ID_INTEL, 0x1551, pci_quirk_mf_endpoint_acs }, 3789 { PCI_VENDOR_ID_INTEL, 0x1551, pci_quirk_mf_endpoint_acs },
3714 { PCI_VENDOR_ID_INTEL, 0x1558, pci_quirk_mf_endpoint_acs }, 3790 { PCI_VENDOR_ID_INTEL, 0x1558, pci_quirk_mf_endpoint_acs },
3715 { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_pch_acs }, 3791 { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_pch_acs },
3792 { 0x19a2, 0x710, pci_quirk_mf_endpoint_acs }, /* Emulex BE3-R */
3793 { 0x10df, 0x720, pci_quirk_mf_endpoint_acs }, /* Emulex Skyhawk-R */
3716 { 0 } 3794 { 0 }
3717}; 3795};
3718 3796