diff options
author | Vadim Lomovtsev <Vadim.Lomovtsev@cavium.com> | 2017-10-17 08:47:39 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2017-10-19 14:28:16 -0400 |
commit | f2ddaf8dfd4a5071ad09074d2f95ab85d35c8a1e (patch) | |
tree | 286ada132179753cffa2d52bc145d6108818447a | |
parent | 7f342678634f16795892677204366e835e450dda (diff) |
PCI: Apply Cavium ThunderX ACS quirk to more Root Ports
Extend the Cavium ThunderX ACS quirk to cover more device IDs and restrict
it to only Root Ports.
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@cavium.com>
[bhelgaas: changelog, stable tag]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org # v4.12+
-rw-r--r-- | drivers/pci/quirks.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index c23650cfd5a1..0e22cce05742 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -4211,6 +4211,19 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags) | |||
4211 | #endif | 4211 | #endif |
4212 | } | 4212 | } |
4213 | 4213 | ||
4214 | static bool pci_quirk_cavium_acs_match(struct pci_dev *dev) | ||
4215 | { | ||
4216 | /* | ||
4217 | * Effectively selects all downstream ports for whole ThunderX 1 | ||
4218 | * family by 0xf800 mask (which represents 8 SoCs), while the lower | ||
4219 | * bits of device ID are used to indicate which subdevice is used | ||
4220 | * within the SoC. | ||
4221 | */ | ||
4222 | return (pci_is_pcie(dev) && | ||
4223 | (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT) && | ||
4224 | ((dev->device & 0xf800) == 0xa000)); | ||
4225 | } | ||
4226 | |||
4214 | static int pci_quirk_cavium_acs(struct pci_dev *dev, u16 acs_flags) | 4227 | static int pci_quirk_cavium_acs(struct pci_dev *dev, u16 acs_flags) |
4215 | { | 4228 | { |
4216 | /* | 4229 | /* |
@@ -4223,7 +4236,7 @@ static int pci_quirk_cavium_acs(struct pci_dev *dev, u16 acs_flags) | |||
4223 | */ | 4236 | */ |
4224 | acs_flags &= ~(PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_SV | PCI_ACS_UF); | 4237 | acs_flags &= ~(PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_SV | PCI_ACS_UF); |
4225 | 4238 | ||
4226 | if (!((dev->device >= 0xa000) && (dev->device <= 0xa0ff))) | 4239 | if (!pci_quirk_cavium_acs_match(dev)) |
4227 | return -ENOTTY; | 4240 | return -ENOTTY; |
4228 | 4241 | ||
4229 | return acs_flags ? 0 : 1; | 4242 | return acs_flags ? 0 : 1; |