pci: quirks: Add ACS quirk for Solarflare SFC9120 & SFC9140
PATCH 1/1 pci: quirks: Add ACS quirk for Solarflare SFC9120 & SFC9140
Solarflare confirms that these devices do not allow peer-to-peer between functions. Quirk them to allow IOMMU grouping to expose this isolation.
Signed-off-by Alex Williamson <[email protected]>
Cc Robert Stonehouse <[email protected]>
---
drivers/pci/quirks.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/pci/quirks.c +17 -0
@@ -3664,6 +3664,21 @@ static int pci_quirk_intel_pch_acs(struct pci_dev *dev, u16 acs_flags)return acs_flags & ~flags ?0 :1 ; } +static int pci_quirk_solarflare_acs (struct pci_dev *dev,u16 acs_flags) +{ +/* +* SV, TB, and UF are not relevant to multifunction endpoints. +* +* Solarflare indicates that peer-to-peer between functions is not +* possible, therefore RR, CR, and DT are not implemented. Mask +* these out as if they were clear in the ACS capabilities register. +*/ + acs_flags &= ~(PCI_ACS_SV |PCI_ACS_TB |PCI_ACS_RR | +PCI_ACS_CR |PCI_ACS_UF |PCI_ACS_DT ); + +return acs_flags ?0 :1 ; +} + static const struct pci_dev_acs_enabled { u16 vendor; u16 device;
@@ -3675,6 +3690,8 @@ static const struct pci_dev_acs_enabled { { PCI_VENDOR_ID_ATI, 0x439d, pci_quirk_amd_sb_acs }, { PCI_VENDOR_ID_ATI, 0x4384, pci_quirk_amd_sb_acs }, { PCI_VENDOR_ID_ATI, 0x4399, pci_quirk_amd_sb_acs }, + { PCI_VENDOR_ID_SOLARFLARE, 0x0903, pci_quirk_solarflare_acs }, + { PCI_VENDOR_ID_SOLARFLARE, 0x0923, pci_quirk_solarflare_acs }, { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_pch_acs }, { 0 } };
Quoted 6 lines · Alex Williamson
Solarflare confirms that these devices do not allow peer-to-peer between functions. Quirk them to allow IOMMU grouping to expose this isolation.
Signed-off-by Alex Williamson <[email protected]>Cc Robert Stonehouse <[email protected]>
Bjorn Helgaas
maintainerQuoted 6 lines · Alex Williamson
Solarflare confirms that these devices do not allow peer-to-peer between functions. Quirk them to allow IOMMU grouping to expose this isolation.
Signed-off-by Alex Williamson <[email protected]>Cc Robert Stonehouse <[email protected]>
Applied with Robert's ack to pci/virtualization for v3.18, thanks!
Quoted 41 lines
---
drivers/pci/quirks.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)drivers/pci/quirks.c +17
-0@@ -3664,6 +3664,21 @@ static int pci_quirk_intel_pch_acs(struct pci_dev *dev, u16 acs_flags)return acs_flags & ~flags ?0 :1 ; } +static int pci_quirk_solarflare_acs (struct pci_dev *dev,u16 acs_flags) +{ +/* +* SV, TB, and UF are not relevant to multifunction endpoints. +* +* Solarflare indicates that peer-to-peer between functions is not +* possible, therefore RR, CR, and DT are not implemented. Mask +* these out as if they were clear in the ACS capabilities register. +*/ + acs_flags &= ~(PCI_ACS_SV |PCI_ACS_TB |PCI_ACS_RR | +PCI_ACS_CR |PCI_ACS_UF |PCI_ACS_DT ); + +return acs_flags ?0 :1 ; +} + static const struct pci_dev_acs_enabled { u16 vendor; u16 device;@@ -3675,6 +3690,8 @@ static const struct pci_dev_acs_enabled { { PCI_VENDOR_ID_ATI, 0x439d, pci_quirk_amd_sb_acs }, { PCI_VENDOR_ID_ATI, 0x4384, pci_quirk_amd_sb_acs }, { PCI_VENDOR_ID_ATI, 0x4399, pci_quirk_amd_sb_acs }, + { PCI_VENDOR_ID_SOLARFLARE, 0x0903, pci_quirk_solarflare_acs }, + { PCI_VENDOR_ID_SOLARFLARE, 0x0923, pci_quirk_solarflare_acs }, { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pci_quirk_intel_pch_acs }, { 0 } };