aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu/iommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iommu/iommu.c')
-rw-r--r--drivers/iommu/iommu.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index b9df1411c894..829b5e981217 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -660,8 +660,8 @@ static struct iommu_group *get_pci_function_alias_group(struct pci_dev *pdev,
660} 660}
661 661
662/* 662/*
663 * Look for aliases to or from the given device for exisiting groups. The 663 * Look for aliases to or from the given device for existing groups. DMA
664 * dma_alias_devfn only supports aliases on the same bus, therefore the search 664 * aliases are only supported on the same bus, therefore the search
665 * space is quite small (especially since we're really only looking at pcie 665 * space is quite small (especially since we're really only looking at pcie
666 * device, and therefore only expect multiple slots on the root complex or 666 * device, and therefore only expect multiple slots on the root complex or
667 * downstream switch ports). It's conceivable though that a pair of 667 * downstream switch ports). It's conceivable though that a pair of
@@ -686,11 +686,7 @@ static struct iommu_group *get_pci_alias_group(struct pci_dev *pdev,
686 continue; 686 continue;
687 687
688 /* We alias them or they alias us */ 688 /* We alias them or they alias us */
689 if (((pdev->dev_flags & PCI_DEV_FLAGS_DMA_ALIAS_DEVFN) && 689 if (pci_devs_are_dma_aliases(pdev, tmp)) {
690 pdev->dma_alias_devfn == tmp->devfn) ||
691 ((tmp->dev_flags & PCI_DEV_FLAGS_DMA_ALIAS_DEVFN) &&
692 tmp->dma_alias_devfn == pdev->devfn)) {
693
694 group = get_pci_alias_group(tmp, devfns); 690 group = get_pci_alias_group(tmp, devfns);
695 if (group) { 691 if (group) {
696 pci_dev_put(tmp); 692 pci_dev_put(tmp);