intel_iommu_debugfs_create_dev(info);
 
+       return &iommu->iommu;
+free_table:
+       intel_pasid_free_table(dev);
+clear_rbtree:
+       device_rbtree_remove(info);
+free:
+       kfree(info);
+
+       return ERR_PTR(ret);
+}
+
+static void intel_iommu_probe_finalize(struct device *dev)
+{
+       struct device_domain_info *info = dev_iommu_priv_get(dev);
+       struct intel_iommu *iommu = info->iommu;
+
        /*
         * The PCIe spec, in its wisdom, declares that the behaviour of the
         * device is undefined if you enable PASID support after ATS support.
         * we can't yet know if we're ever going to use it.
         */
        if (info->pasid_supported &&
-           !pci_enable_pasid(pdev, info->pasid_supported & ~1))
+           !pci_enable_pasid(to_pci_dev(dev), info->pasid_supported & ~1))
                info->pasid_enabled = 1;
 
-       if (sm_supported(iommu))
+       if (sm_supported(iommu) && !dev_is_real_dma_subdevice(dev))
                iommu_enable_pci_ats(info);
        iommu_enable_pci_pri(info);
-
-       return &iommu->iommu;
-free_table:
-       intel_pasid_free_table(dev);
-clear_rbtree:
-       device_rbtree_remove(info);
-free:
-       kfree(info);
-
-       return ERR_PTR(ret);
 }
 
 static void intel_iommu_release_device(struct device *dev)
        .domain_alloc_sva       = intel_svm_domain_alloc,
        .domain_alloc_nested    = intel_iommu_domain_alloc_nested,
        .probe_device           = intel_iommu_probe_device,
+       .probe_finalize         = intel_iommu_probe_finalize,
        .release_device         = intel_iommu_release_device,
        .get_resv_regions       = intel_iommu_get_resv_regions,
        .device_group           = intel_iommu_device_group,