diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2014-03-09 16:33:06 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2014-03-24 10:06:53 -0400 |
commit | 7c7faa11ecf3eec17699ae73fc6e336cbf993081 (patch) | |
tree | 90c0580cad81a195482314f263b6647f8e07e3cc /drivers/iommu | |
parent | 8bbc4410129c0919e5943012489427c5e050a63e (diff) |
iommu/vt-d: Remove device_to_iommu() call from domain_remove_dev_info()
This was problematic because it works by domain/bus/devfn and we want
to make device_to_iommu() use only a struct device * (for handling non-PCI
devices). Now that the iommu pointer is reliably stored in the
device_domain_info, we don't need to look it up.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/intel-iommu.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index dc322d0238a0..aa8548c8a915 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -2084,7 +2084,6 @@ static void domain_remove_dev_info(struct dmar_domain *domain) | |||
2084 | { | 2084 | { |
2085 | struct device_domain_info *info; | 2085 | struct device_domain_info *info; |
2086 | unsigned long flags, flags2; | 2086 | unsigned long flags, flags2; |
2087 | struct intel_iommu *iommu; | ||
2088 | 2087 | ||
2089 | spin_lock_irqsave(&device_domain_lock, flags); | 2088 | spin_lock_irqsave(&device_domain_lock, flags); |
2090 | while (!list_empty(&domain->devices)) { | 2089 | while (!list_empty(&domain->devices)) { |
@@ -2094,16 +2093,15 @@ static void domain_remove_dev_info(struct dmar_domain *domain) | |||
2094 | spin_unlock_irqrestore(&device_domain_lock, flags); | 2093 | spin_unlock_irqrestore(&device_domain_lock, flags); |
2095 | 2094 | ||
2096 | iommu_disable_dev_iotlb(info); | 2095 | iommu_disable_dev_iotlb(info); |
2097 | iommu = device_to_iommu(info->segment, info->bus, info->devfn); | 2096 | iommu_detach_dev(info->iommu, info->bus, info->devfn); |
2098 | iommu_detach_dev(iommu, info->bus, info->devfn); | ||
2099 | 2097 | ||
2100 | if (domain->flags & DOMAIN_FLAG_VIRTUAL_MACHINE) { | 2098 | if (domain->flags & DOMAIN_FLAG_VIRTUAL_MACHINE) { |
2101 | iommu_detach_dependent_devices(iommu, info->dev); | 2099 | iommu_detach_dependent_devices(info->iommu, info->dev); |
2102 | /* clear this iommu in iommu_bmp, update iommu count | 2100 | /* clear this iommu in iommu_bmp, update iommu count |
2103 | * and capabilities | 2101 | * and capabilities |
2104 | */ | 2102 | */ |
2105 | spin_lock_irqsave(&domain->iommu_lock, flags2); | 2103 | spin_lock_irqsave(&domain->iommu_lock, flags2); |
2106 | if (test_and_clear_bit(iommu->seq_id, | 2104 | if (test_and_clear_bit(info->iommu->seq_id, |
2107 | domain->iommu_bmp)) { | 2105 | domain->iommu_bmp)) { |
2108 | domain->iommu_count--; | 2106 | domain->iommu_count--; |
2109 | domain_update_iommu_cap(domain); | 2107 | domain_update_iommu_cap(domain); |