summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-iommu.c
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2019-05-25 01:41:35 -0400
committerJoerg Roedel <jroedel@suse.de>2019-05-28 04:19:13 -0400
commitb7297783c2bb6fa7bd557842657bed7e95220978 (patch)
tree65c7f12df8f6a36c1d123aeeadc53785e64bbf4e /drivers/iommu/intel-iommu.c
parent0e31a7266508487bd48bfc5507a3369b797300b1 (diff)
iommu/vt-d: Remove duplicated code for device hotplug
The iommu generic code has handled the device hotplug cases. Remove the duplicated code. Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r--drivers/iommu/intel-iommu.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index ff46227b3409..007aac554b37 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -4548,39 +4548,6 @@ int dmar_iommu_notify_scope_dev(struct dmar_pci_notify_info *info)
4548 return 0; 4548 return 0;
4549} 4549}
4550 4550
4551/*
4552 * Here we only respond to action of unbound device from driver.
4553 *
4554 * Added device is not attached to its DMAR domain here yet. That will happen
4555 * when mapping the device to iova.
4556 */
4557static int device_notifier(struct notifier_block *nb,
4558 unsigned long action, void *data)
4559{
4560 struct device *dev = data;
4561 struct dmar_domain *domain;
4562
4563 if (iommu_dummy(dev))
4564 return 0;
4565
4566 if (action == BUS_NOTIFY_REMOVED_DEVICE) {
4567 domain = find_domain(dev);
4568 if (!domain)
4569 return 0;
4570
4571 dmar_remove_one_dev_info(dev);
4572 } else if (action == BUS_NOTIFY_ADD_DEVICE) {
4573 if (iommu_should_identity_map(dev))
4574 domain_add_dev_info(si_domain, dev);
4575 }
4576
4577 return 0;
4578}
4579
4580static struct notifier_block device_nb = {
4581 .notifier_call = device_notifier,
4582};
4583
4584static int intel_iommu_memory_notifier(struct notifier_block *nb, 4551static int intel_iommu_memory_notifier(struct notifier_block *nb,
4585 unsigned long val, void *v) 4552 unsigned long val, void *v)
4586{ 4553{
@@ -4955,7 +4922,6 @@ int __init intel_iommu_init(void)
4955 } 4922 }
4956 4923
4957 bus_set_iommu(&pci_bus_type, &intel_iommu_ops); 4924 bus_set_iommu(&pci_bus_type, &intel_iommu_ops);
4958 bus_register_notifier(&pci_bus_type, &device_nb);
4959 if (si_domain && !hw_pass_through) 4925 if (si_domain && !hw_pass_through)
4960 register_memory_notifier(&intel_iommu_memory_nb); 4926 register_memory_notifier(&intel_iommu_memory_nb);
4961 cpuhp_setup_state(CPUHP_IOMMU_INTEL_DEAD, "iommu/intel:dead", NULL, 4927 cpuhp_setup_state(CPUHP_IOMMU_INTEL_DEAD, "iommu/intel:dead", NULL,