Merge tag 'pci-v5.6-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
[linux-2.6-microblaze.git] / drivers / iommu / intel-iommu.c
index 932267f..35a4a3a 100644 (file)
@@ -774,13 +774,7 @@ static struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devf
        if (dev_is_pci(dev)) {
                struct pci_dev *pf_pdev;
 
-               pdev = to_pci_dev(dev);
-
-#ifdef CONFIG_X86
-               /* VMD child devices currently cannot be handled individually */
-               if (is_vmd(pdev->bus))
-                       return NULL;
-#endif
+               pdev = pci_real_dma_dev(to_pci_dev(dev));
 
                /* VFs aren't listed in scope tables; we need to look up
                 * the PF instead to find the IOMMU. */
@@ -2428,6 +2422,9 @@ static struct dmar_domain *find_domain(struct device *dev)
                     dev->archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO))
                return NULL;
 
+       if (dev_is_pci(dev))
+               dev = &pci_real_dma_dev(to_pci_dev(dev))->dev;
+
        /* No lock here, assumes no domain exit in normal case */
        info = dev->archdata.iommu;
        if (likely(info))