diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 93cdc3e48a1b..c9c9ee5182d6 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -562,26 +562,14 @@ menuconfig IOMMU_DEBUG if IOMMU_DEBUG -config IOMMU_DEBUG_TRACKING - bool "Track key IOMMU events" - select IOMMU_API - help - Enables additional debug tracking in the IOMMU framework code. - Tracking information and tests can be accessed through various - debugfs files. - - Say Y here if you need to debug IOMMU issues and are okay with - the performance penalty of the tracking. - config IOMMU_TESTS bool "Interactive IOMMU performance/functional tests" select IOMMU_API select ARM64_PTDUMP_CORE help Enables a suite of IOMMU unit tests. The tests are runnable - through debugfs. Unlike the IOMMU_DEBUG_TRACKING option, the - impact of enabling this option to overal system performance - should be minimal. + through debugfs. The impact of enabling this option to overall + system performance should be minimal. endif # IOMMU_DEBUG diff --git a/drivers/iommu/iommu-debug.c b/drivers/iommu/iommu-debug.c index f1024003dac0..9628caa81055 100644 --- a/drivers/iommu/iommu-debug.c +++ b/drivers/iommu/iommu-debug.c @@ -32,7 +32,6 @@ #include #include #include -#include "iommu-debug.h" #ifdef CONFIG_ARM64_PTDUMP_CORE #include @@ -91,68 +90,6 @@ static const char *iommu_debug_attr_to_string(enum iommu_attr attr) } #endif -#ifdef CONFIG_IOMMU_DEBUG_TRACKING - -static DEFINE_MUTEX(iommu_debug_attachments_lock); -static LIST_HEAD(iommu_debug_attachments); - -/* - * Each group may have more than one domain; but each domain may - * only have one group. - * Used by debug tools to display the name of the device(s) associated - * with a particular domain. - */ -struct iommu_debug_attachment { - struct iommu_domain *domain; - struct iommu_group *group; - struct list_head list; -}; - -void iommu_debug_attach_device(struct iommu_domain *domain, - struct device *dev) -{ - struct iommu_debug_attachment *attach; - struct iommu_group *group; - - group = dev->iommu_group; - if (!group) - return; - - mutex_lock(&iommu_debug_attachments_lock); - list_for_each_entry(attach, &iommu_debug_attachments, list) - if ((attach->domain == domain) && (attach->group == group)) - goto out; - - attach = kzalloc(sizeof(*attach), GFP_KERNEL); - if (!attach) - goto out; - - attach->domain = domain; - attach->group = group; - INIT_LIST_HEAD(&attach->list); - - list_add(&attach->list, &iommu_debug_attachments); -out: - mutex_unlock(&iommu_debug_attachments_lock); -} - -void iommu_debug_domain_remove(struct iommu_domain *domain) -{ - struct iommu_debug_attachment *it, *tmp; - - mutex_lock(&iommu_debug_attachments_lock); - list_for_each_entry_safe(it, tmp, &iommu_debug_attachments, list) { - if (it->domain != domain) - continue; - list_del(&it->list); - kfree(it); - } - - mutex_unlock(&iommu_debug_attachments_lock); -} - -#endif - #ifdef CONFIG_IOMMU_TESTS #ifdef CONFIG_64BIT diff --git a/drivers/iommu/iommu-debug.h b/drivers/iommu/iommu-debug.h deleted file mode 100644 index fae4f96b44bc..000000000000 --- a/drivers/iommu/iommu-debug.h +++ /dev/null @@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. - */ - -#ifndef IOMMU_DEBUG_H -#define IOMMU_DEBUG_H - -#ifdef CONFIG_IOMMU_DEBUG_TRACKING - -void iommu_debug_attach_device(struct iommu_domain *domain, struct device *dev); -void iommu_debug_domain_remove(struct iommu_domain *domain); - -#else /* !CONFIG_IOMMU_DEBUG_TRACKING */ - -static inline void iommu_debug_attach_device(struct iommu_domain *domain, - struct device *dev) -{ -} - -static inline void iommu_debug_domain_remove(struct iommu_domain *domain) -{ -} - -#endif /* CONFIG_IOMMU_DEBUG_TRACKING */ - -#endif /* IOMMU_DEBUG_H */ diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index a93fc3334455..7ae19a647b5c 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -26,8 +26,6 @@ #include #include -#include "iommu-debug.h" - static struct kset *iommu_group_kset; static DEFINE_IDA(iommu_group_ida); @@ -1646,7 +1644,6 @@ EXPORT_SYMBOL_GPL(iommu_domain_alloc); void iommu_domain_free(struct iommu_domain *domain) { - iommu_debug_domain_remove(domain); domain->ops->domain_free(domain); } EXPORT_SYMBOL_GPL(iommu_domain_free); @@ -1663,10 +1660,8 @@ static int __iommu_attach_device(struct iommu_domain *domain, return -ENODEV; ret = domain->ops->attach_dev(domain, dev); - if (!ret) { + if (!ret) trace_attach_device_to_domain(dev); - iommu_debug_attach_device(domain, dev); - } return ret; }