aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/intel-iommu.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 360fb67a30d..c5f7c73cbb5 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2455,8 +2455,7 @@ static struct iova *intel_alloc_iova(struct device *dev,
2455 return iova; 2455 return iova;
2456} 2456}
2457 2457
2458static struct dmar_domain * 2458static struct dmar_domain *__get_valid_domain_for_dev(struct pci_dev *pdev)
2459get_valid_domain_for_dev(struct pci_dev *pdev)
2460{ 2459{
2461 struct dmar_domain *domain; 2460 struct dmar_domain *domain;
2462 int ret; 2461 int ret;
@@ -2484,6 +2483,18 @@ get_valid_domain_for_dev(struct pci_dev *pdev)
2484 return domain; 2483 return domain;
2485} 2484}
2486 2485
2486static inline struct dmar_domain *get_valid_domain_for_dev(struct pci_dev *dev)
2487{
2488 struct device_domain_info *info;
2489
2490 /* No lock here, assumes no domain exit in normal case */
2491 info = dev->dev.archdata.iommu;
2492 if (likely(info))
2493 return info->domain;
2494
2495 return __get_valid_domain_for_dev(dev);
2496}
2497
2487static int iommu_dummy(struct pci_dev *pdev) 2498static int iommu_dummy(struct pci_dev *pdev)
2488{ 2499{
2489 return pdev->dev.archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO; 2500 return pdev->dev.archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO;