diff options
author | Jon Derrick <jonathan.derrick@intel.com> | 2020-01-21 06:37:47 -0700 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2020-01-24 14:55:26 -0600 |
commit | 2856ba6020fc5cbf051d5a75b2abb3046072c144 (patch) | |
tree | 0f93f7ebde7349949dcb9b711ba9537dc8c51b95 /arch/x86/pci | |
parent | 34067c56fa177d3582695da8e3e162ef78cd0371 (diff) | |
download | linux-2856ba6020fc5cbf051d5a75b2abb3046072c144.tar.bz2 |
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')
-rw-r--r-- | arch/x86/pci/common.c | 10 |
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 |