aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/common.c
diff options
context:
space:
mode:
authorJon Derrick <jonathan.derrick@intel.com>2020-01-21 06:37:47 -0700
committerBjorn Helgaas <bhelgaas@google.com>2020-01-24 14:55:26 -0600
commit2856ba6020fc5cbf051d5a75b2abb3046072c144 (patch)
tree0f93f7ebde7349949dcb9b711ba9537dc8c51b95 /arch/x86/pci/common.c
parentx86/PCI: Expose VMD's pci_dev in struct pci_sysdata (diff)
downloadlinux-dev-2856ba6020fc5cbf051d5a75b2abb3046072c144.tar.xz
linux-dev-2856ba6020fc5cbf051d5a75b2abb3046072c144.zip
PCI: Introduce pci_real_dma_dev()
The current DMA alias implementation requires the aliased device be on the same PCI bus as the requester ID. Add an arch-specific mechanism to point to another PCI device when doing mapping and PCI DMA alias search. The default case returns the actual device. Link: https://lore.kernel.org/r/1579613871-301529-4-git-send-email-jonathan.derrick@intel.com Signed-off-by: Jon Derrick <jonathan.derrick@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'arch/x86/pci/common.c')
-rw-r--r--arch/x86/pci/common.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index 1e59df041456..fe21a5c557e6 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -736,3 +736,13 @@ int pci_ext_cfg_avail(void)
else
return 0;
}
+
+#if IS_ENABLED(CONFIG_VMD)
+struct pci_dev *pci_real_dma_dev(struct pci_dev *dev)
+{
+ if (is_vmd(dev->bus))
+ return to_pci_sysdata(dev->bus)->vmd_dev;
+
+ return dev;
+}
+#endif