diff options
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 82 |
1 files changed, 56 insertions, 26 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 673683660b5c..085fb787aa9e 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1685,6 +1685,29 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260a, quirk_intel_pcie_pm); | |||
1685 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); | 1685 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); |
1686 | 1686 | ||
1687 | #ifdef CONFIG_X86_IO_APIC | 1687 | #ifdef CONFIG_X86_IO_APIC |
1688 | static int dmi_disable_ioapicreroute(const struct dmi_system_id *d) | ||
1689 | { | ||
1690 | noioapicreroute = 1; | ||
1691 | pr_info("%s detected: disable boot interrupt reroute\n", d->ident); | ||
1692 | |||
1693 | return 0; | ||
1694 | } | ||
1695 | |||
1696 | static struct dmi_system_id boot_interrupt_dmi_table[] = { | ||
1697 | /* | ||
1698 | * Systems to exclude from boot interrupt reroute quirks | ||
1699 | */ | ||
1700 | { | ||
1701 | .callback = dmi_disable_ioapicreroute, | ||
1702 | .ident = "ASUSTek Computer INC. M2N-LR", | ||
1703 | .matches = { | ||
1704 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTek Computer INC."), | ||
1705 | DMI_MATCH(DMI_PRODUCT_NAME, "M2N-LR"), | ||
1706 | }, | ||
1707 | }, | ||
1708 | {} | ||
1709 | }; | ||
1710 | |||
1688 | /* | 1711 | /* |
1689 | * Boot interrupts on some chipsets cannot be turned off. For these chipsets, | 1712 | * Boot interrupts on some chipsets cannot be turned off. For these chipsets, |
1690 | * remap the original interrupt in the linux kernel to the boot interrupt, so | 1713 | * remap the original interrupt in the linux kernel to the boot interrupt, so |
@@ -1693,6 +1716,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x260b, quirk_intel_pcie_pm); | |||
1693 | */ | 1716 | */ |
1694 | static void quirk_reroute_to_boot_interrupts_intel(struct pci_dev *dev) | 1717 | static void quirk_reroute_to_boot_interrupts_intel(struct pci_dev *dev) |
1695 | { | 1718 | { |
1719 | dmi_check_system(boot_interrupt_dmi_table); | ||
1696 | if (noioapicquirk || noioapicreroute) | 1720 | if (noioapicquirk || noioapicreroute) |
1697 | return; | 1721 | return; |
1698 | 1722 | ||
@@ -3642,19 +3666,11 @@ static int reset_intel_82599_sfp_virtfn(struct pci_dev *dev, int probe) | |||
3642 | * | 3666 | * |
3643 | * The 82599 supports FLR on VFs, but FLR support is reported only | 3667 | * The 82599 supports FLR on VFs, but FLR support is reported only |
3644 | * in the PF DEVCAP (sec 9.3.10.4), not in the VF DEVCAP (sec 9.5). | 3668 | * in the PF DEVCAP (sec 9.3.10.4), not in the VF DEVCAP (sec 9.5). |
3645 | * Therefore, we can't use pcie_flr(), which checks the VF DEVCAP. | 3669 | * Thus we must call pcie_flr() directly without first checking if it is |
3670 | * supported. | ||
3646 | */ | 3671 | */ |
3647 | 3672 | if (!probe) | |
3648 | if (probe) | 3673 | pcie_flr(dev); |
3649 | return 0; | ||
3650 | |||
3651 | if (!pci_wait_for_pending_transaction(dev)) | ||
3652 | dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n"); | ||
3653 | |||
3654 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR); | ||
3655 | |||
3656 | msleep(100); | ||
3657 | |||
3658 | return 0; | 3674 | return 0; |
3659 | } | 3675 | } |
3660 | 3676 | ||
@@ -3759,20 +3775,7 @@ static int reset_chelsio_generic_dev(struct pci_dev *dev, int probe) | |||
3759 | PCI_MSIX_FLAGS_ENABLE | | 3775 | PCI_MSIX_FLAGS_ENABLE | |
3760 | PCI_MSIX_FLAGS_MASKALL); | 3776 | PCI_MSIX_FLAGS_MASKALL); |
3761 | 3777 | ||
3762 | /* | 3778 | pcie_flr(dev); |
3763 | * Start of pcie_flr() code sequence. This reset code is a copy of | ||
3764 | * the guts of pcie_flr() because that's not an exported function. | ||
3765 | */ | ||
3766 | |||
3767 | if (!pci_wait_for_pending_transaction(dev)) | ||
3768 | dev_err(&dev->dev, "transaction is not cleared; proceeding with reset anyway\n"); | ||
3769 | |||
3770 | pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR); | ||
3771 | msleep(100); | ||
3772 | |||
3773 | /* | ||
3774 | * End of pcie_flr() code sequence. | ||
3775 | */ | ||
3776 | 3779 | ||
3777 | /* | 3780 | /* |
3778 | * Restore the configuration information (BAR values, etc.) including | 3781 | * Restore the configuration information (BAR values, etc.) including |
@@ -3939,6 +3942,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ASMEDIA, 0x1080, | |||
3939 | DECLARE_PCI_FIXUP_HEADER(0x10e3, 0x8113, quirk_use_pcie_bridge_dma_alias); | 3942 | DECLARE_PCI_FIXUP_HEADER(0x10e3, 0x8113, quirk_use_pcie_bridge_dma_alias); |
3940 | /* ITE 8892, https://bugzilla.kernel.org/show_bug.cgi?id=73551 */ | 3943 | /* ITE 8892, https://bugzilla.kernel.org/show_bug.cgi?id=73551 */ |
3941 | DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8892, quirk_use_pcie_bridge_dma_alias); | 3944 | DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8892, quirk_use_pcie_bridge_dma_alias); |
3945 | /* ITE 8893 has the same problem as the 8892 */ | ||
3946 | DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8893, quirk_use_pcie_bridge_dma_alias); | ||
3942 | /* Intel 82801, https://bugzilla.kernel.org/show_bug.cgi?id=44881#c49 */ | 3947 | /* Intel 82801, https://bugzilla.kernel.org/show_bug.cgi?id=44881#c49 */ |
3943 | DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias); | 3948 | DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias); |
3944 | 3949 | ||
@@ -3958,6 +3963,20 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2260, quirk_mic_x200_dma_alias); | |||
3958 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2264, quirk_mic_x200_dma_alias); | 3963 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2264, quirk_mic_x200_dma_alias); |
3959 | 3964 | ||
3960 | /* | 3965 | /* |
3966 | * The IOMMU and interrupt controller on Broadcom Vulcan/Cavium ThunderX2 are | ||
3967 | * associated not at the root bus, but at a bridge below. This quirk avoids | ||
3968 | * generating invalid DMA aliases. | ||
3969 | */ | ||
3970 | static void quirk_bridge_cavm_thrx2_pcie_root(struct pci_dev *pdev) | ||
3971 | { | ||
3972 | pdev->dev_flags |= PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT; | ||
3973 | } | ||
3974 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9000, | ||
3975 | quirk_bridge_cavm_thrx2_pcie_root); | ||
3976 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084, | ||
3977 | quirk_bridge_cavm_thrx2_pcie_root); | ||
3978 | |||
3979 | /* | ||
3961 | * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero) | 3980 | * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero) |
3962 | * class code. Fix it. | 3981 | * class code. Fix it. |
3963 | */ | 3982 | */ |
@@ -4095,6 +4114,9 @@ static int pci_quirk_cavium_acs(struct pci_dev *dev, u16 acs_flags) | |||
4095 | acs_flags &= ~(PCI_ACS_SV | PCI_ACS_TB | PCI_ACS_RR | | 4114 | acs_flags &= ~(PCI_ACS_SV | PCI_ACS_TB | PCI_ACS_RR | |
4096 | PCI_ACS_CR | PCI_ACS_UF | PCI_ACS_DT); | 4115 | PCI_ACS_CR | PCI_ACS_UF | PCI_ACS_DT); |
4097 | 4116 | ||
4117 | if (!((dev->device >= 0xa000) && (dev->device <= 0xa0ff))) | ||
4118 | return -ENOTTY; | ||
4119 | |||
4098 | return acs_flags ? 0 : 1; | 4120 | return acs_flags ? 0 : 1; |
4099 | } | 4121 | } |
4100 | 4122 | ||
@@ -4634,3 +4656,11 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2030, quirk_no_aersid); | |||
4634 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2031, quirk_no_aersid); | 4656 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2031, quirk_no_aersid); |
4635 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2032, quirk_no_aersid); | 4657 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2032, quirk_no_aersid); |
4636 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2033, quirk_no_aersid); | 4658 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2033, quirk_no_aersid); |
4659 | |||
4660 | /* FLR may cause some 82579 devices to hang. */ | ||
4661 | static void quirk_intel_no_flr(struct pci_dev *dev) | ||
4662 | { | ||
4663 | dev->dev_flags |= PCI_DEV_FLAGS_NO_FLR_RESET; | ||
4664 | } | ||
4665 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1502, quirk_intel_no_flr); | ||
4666 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1503, quirk_intel_no_flr); | ||