diff options
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r-- | drivers/iommu/intel-iommu.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 5619f264862d..a27d6cb1a793 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -3865,8 +3865,7 @@ static int device_notifier(struct notifier_block *nb, | |||
3865 | if (iommu_dummy(dev)) | 3865 | if (iommu_dummy(dev)) |
3866 | return 0; | 3866 | return 0; |
3867 | 3867 | ||
3868 | if (action != BUS_NOTIFY_UNBOUND_DRIVER && | 3868 | if (action != BUS_NOTIFY_REMOVED_DEVICE) |
3869 | action != BUS_NOTIFY_DEL_DEVICE) | ||
3870 | return 0; | 3869 | return 0; |
3871 | 3870 | ||
3872 | /* | 3871 | /* |
@@ -4415,17 +4414,14 @@ static phys_addr_t intel_iommu_iova_to_phys(struct iommu_domain *domain, | |||
4415 | return phys; | 4414 | return phys; |
4416 | } | 4415 | } |
4417 | 4416 | ||
4418 | static int intel_iommu_domain_has_cap(struct iommu_domain *domain, | 4417 | static bool intel_iommu_capable(enum iommu_cap cap) |
4419 | unsigned long cap) | ||
4420 | { | 4418 | { |
4421 | struct dmar_domain *dmar_domain = domain->priv; | ||
4422 | |||
4423 | if (cap == IOMMU_CAP_CACHE_COHERENCY) | 4419 | if (cap == IOMMU_CAP_CACHE_COHERENCY) |
4424 | return dmar_domain->iommu_snooping; | 4420 | return domain_update_iommu_snooping(NULL) == 1; |
4425 | if (cap == IOMMU_CAP_INTR_REMAP) | 4421 | if (cap == IOMMU_CAP_INTR_REMAP) |
4426 | return irq_remapping_enabled; | 4422 | return irq_remapping_enabled == 1; |
4427 | 4423 | ||
4428 | return 0; | 4424 | return false; |
4429 | } | 4425 | } |
4430 | 4426 | ||
4431 | static int intel_iommu_add_device(struct device *dev) | 4427 | static int intel_iommu_add_device(struct device *dev) |
@@ -4464,6 +4460,7 @@ static void intel_iommu_remove_device(struct device *dev) | |||
4464 | } | 4460 | } |
4465 | 4461 | ||
4466 | static const struct iommu_ops intel_iommu_ops = { | 4462 | static const struct iommu_ops intel_iommu_ops = { |
4463 | .capable = intel_iommu_capable, | ||
4467 | .domain_init = intel_iommu_domain_init, | 4464 | .domain_init = intel_iommu_domain_init, |
4468 | .domain_destroy = intel_iommu_domain_destroy, | 4465 | .domain_destroy = intel_iommu_domain_destroy, |
4469 | .attach_dev = intel_iommu_attach_device, | 4466 | .attach_dev = intel_iommu_attach_device, |
@@ -4471,7 +4468,6 @@ static const struct iommu_ops intel_iommu_ops = { | |||
4471 | .map = intel_iommu_map, | 4468 | .map = intel_iommu_map, |
4472 | .unmap = intel_iommu_unmap, | 4469 | .unmap = intel_iommu_unmap, |
4473 | .iova_to_phys = intel_iommu_iova_to_phys, | 4470 | .iova_to_phys = intel_iommu_iova_to_phys, |
4474 | .domain_has_cap = intel_iommu_domain_has_cap, | ||
4475 | .add_device = intel_iommu_add_device, | 4471 | .add_device = intel_iommu_add_device, |
4476 | .remove_device = intel_iommu_remove_device, | 4472 | .remove_device = intel_iommu_remove_device, |
4477 | .pgsize_bitmap = INTEL_IOMMU_PGSIZES, | 4473 | .pgsize_bitmap = INTEL_IOMMU_PGSIZES, |