Skip to content

Commit f2ddaf8

Browse files
Vadim Lomovtsevbjorn-helgaas
authored andcommitted
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+
1 parent 7f34267 commit f2ddaf8

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎drivers/pci/quirks.c‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4211,6 +4211,19 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)
42114211
#endif
42124212
}
42134213

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+
42144227
static int pci_quirk_cavium_acs(struct pci_dev *dev, u16 acs_flags)
42154228
{
42164229
/*
@@ -4223,7 +4236,7 @@ static int pci_quirk_cavium_acs(struct pci_dev *dev, u16 acs_flags)
42234236
*/
42244237
acs_flags &= ~(PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_SV | PCI_ACS_UF);
42254238

4226-
if (!((dev->device >= 0xa000) && (dev->device <= 0xa0ff)))
4239+
if (!pci_quirk_cavium_acs_match(dev))
42274240
return -ENOTTY;
42284241

42294242
return acs_flags ? 0 : 1;

0 commit comments

Comments
 (0)