Skip to content

Commit 56b4cd4

Browse files
spawlowsbjorn-helgaas
authored andcommitted
PCI: Add DMA alias quirk for Intel VCA NTB
Intel Visual Compute Accelerator (VCA) is a family of PCIe add-in devices exposing computational units via Non Transparent Bridges (NTB, PEX 87xx). Similarly to MIC x200, we need to add DMA aliases to allow buffer access when IOMMU is enabled. Add aliases to allow computational unit access to host memory. These aliases mark the whole VCA device as one IOMMU group. All possible slot numbers (0x20) are used, since we are unable to tell what slot is used on other side. This quirk is intended for both host and computational unit sides. The VCA devices have up to five functions: four for DMA channels and one additional. Link: https://lore.kernel.org/r/5683A335CC8BE1438C3C30C49DCC38DF637CED8E@IRSMSX102.ger.corp.intel.com Signed-off-by: Slawomir Pawlowski <[email protected]> Signed-off-by: Przemek Kitszel <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent d8558ac commit 56b4cd4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

drivers/pci/quirks.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4080,6 +4080,40 @@ static void quirk_mic_x200_dma_alias(struct pci_dev *pdev)
40804080
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2260, quirk_mic_x200_dma_alias);
40814081
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2264, quirk_mic_x200_dma_alias);
40824082

4083+
/*
4084+
* Intel Visual Compute Accelerator (VCA) is a family of PCIe add-in devices
4085+
* exposing computational units via Non Transparent Bridges (NTB, PEX 87xx).
4086+
*
4087+
* Similarly to MIC x200, we need to add DMA aliases to allow buffer access
4088+
* when IOMMU is enabled. These aliases allow computational unit access to
4089+
* host memory. These aliases mark the whole VCA device as one IOMMU
4090+
* group.
4091+
*
4092+
* All possible slot numbers (0x20) are used, since we are unable to tell
4093+
* what slot is used on other side. This quirk is intended for both host
4094+
* and computational unit sides. The VCA devices have up to five functions
4095+
* (four for DMA channels and one additional).
4096+
*/
4097+
static void quirk_pex_vca_alias(struct pci_dev *pdev)
4098+
{
4099+
const unsigned int num_pci_slots = 0x20;
4100+
unsigned int slot;
4101+
4102+
for (slot = 0; slot < num_pci_slots; slot++) {
4103+
pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x0));
4104+
pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x1));
4105+
pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x2));
4106+
pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x3));
4107+
pci_add_dma_alias(pdev, PCI_DEVFN(slot, 0x4));
4108+
}
4109+
}
4110+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2954, quirk_pex_vca_alias);
4111+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2955, quirk_pex_vca_alias);
4112+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2956, quirk_pex_vca_alias);
4113+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2958, quirk_pex_vca_alias);
4114+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2959, quirk_pex_vca_alias);
4115+
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x295A, quirk_pex_vca_alias);
4116+
40834117
/*
40844118
* The IOMMU and interrupt controller on Broadcom Vulcan/Cavium ThunderX2 are
40854119
* associated not at the root bus, but at a bridge below. This quirk avoids

0 commit comments

Comments
 (0)