aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2018-08-09 18:09:17 -0400
committerBjorn Helgaas <bhelgaas@google.com>2018-08-09 18:59:07 -0400
commit10dbc9fedcf151ab794f5e22d4f34f1eff01a08f (patch)
tree6061ec8d2ba6aa99c351c28535b10467657ead32
parent73c47ddef29b5869a2221e93cefdb56fd8263718 (diff)
PCI: Add ACS Redirect disable quirk for Intel Sunrise Point
Intel Sunrise Point PCH hardware has an implementation of the ACS bits that does not comply with the PCIe standard. Add a device-specific quirk, pci_quirk_disable_intel_spt_pch_acs_redir() to disable ACS Redirection on this system. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> [bhelgaas: changelog, split to separate patch] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
-rw-r--r--drivers/pci/quirks.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 4f79631159eb..dc2ee0de3c6b 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4553,6 +4553,30 @@ static int pci_quirk_enable_intel_spt_pch_acs(struct pci_dev *dev)
4553 return 0; 4553 return 0;
4554} 4554}
4555 4555
4556static int pci_quirk_disable_intel_spt_pch_acs_redir(struct pci_dev *dev)
4557{
4558 int pos;
4559 u32 cap, ctrl;
4560
4561 if (!pci_quirk_intel_spt_pch_acs_match(dev))
4562 return -ENOTTY;
4563
4564 pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ACS);
4565 if (!pos)
4566 return -ENOTTY;
4567
4568 pci_read_config_dword(dev, pos + PCI_ACS_CAP, &cap);
4569 pci_read_config_dword(dev, pos + INTEL_SPT_ACS_CTRL, &ctrl);
4570
4571 ctrl &= ~(PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_EC);
4572
4573 pci_write_config_dword(dev, pos + INTEL_SPT_ACS_CTRL, ctrl);
4574
4575 pci_info(dev, "Intel SPT PCH root port workaround: disabled ACS redirect\n");
4576
4577 return 0;
4578}
4579
4556static const struct pci_dev_acs_ops { 4580static const struct pci_dev_acs_ops {
4557 u16 vendor; 4581 u16 vendor;
4558 u16 device; 4582 u16 device;
@@ -4564,6 +4588,7 @@ static const struct pci_dev_acs_ops {
4564 }, 4588 },
4565 { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, 4589 { PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
4566 .enable_acs = pci_quirk_enable_intel_spt_pch_acs, 4590 .enable_acs = pci_quirk_enable_intel_spt_pch_acs,
4591 .disable_acs_redir = pci_quirk_disable_intel_spt_pch_acs_redir,
4567 }, 4592 },
4568}; 4593};
4569 4594