aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/search.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 /drivers/pci/search.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 'drivers/pci/search.c')
-rw-r--r--drivers/pci/search.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index bade14002fd8..efdb8b56035f 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -32,6 +32,12 @@ int pci_for_each_dma_alias(struct pci_dev *pdev,
struct pci_bus *bus;
int ret;
+ /*
+ * The device may have an explicit alias requester ID for DMA where the
+ * requester is on another PCI bus.
+ */
+ pdev = pci_real_dma_dev(pdev);
+
ret = fn(pdev, pci_dev_id(pdev), data);
if (ret)
return ret;