aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorShuah Khan <shuah.kh@samsung.com>2013-08-15 13:59:26 -0400
committerJoerg Roedel <joro@8bytes.org>2013-09-24 06:35:25 -0400
commitb54db778858bc83f9231e5b358cb978f559f7016 (patch)
tree8eb88b179a4dbafc6821b8f7c3660e2a26a03c06 /drivers/iommu
parent2e757086bdfdc9450dc2e4a5d2ec5431520a02c8 (diff)
iommu: Change iommu driver to call attach_device_to_domain trace event
Change iommu driver to call attach_device_to_domain trace event. This iommu_device class event can be enabled to trigger when devices are attached to a domain. Trace information includes device name. Testing: Added trace calls to iommu_prepare_identity_map() for testing some of the conditions that are hard to trigger. Here is the trace from the testing: swapper/0-1 [003] .... 1.854102: attach_device_to_domain: IOMMU: device=0000:00:02.0 Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/iommu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 278055bd0715..74c371c53ee4 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -685,10 +685,14 @@ EXPORT_SYMBOL_GPL(iommu_domain_free);
685 685
686int iommu_attach_device(struct iommu_domain *domain, struct device *dev) 686int iommu_attach_device(struct iommu_domain *domain, struct device *dev)
687{ 687{
688 int ret;
688 if (unlikely(domain->ops->attach_dev == NULL)) 689 if (unlikely(domain->ops->attach_dev == NULL))
689 return -ENODEV; 690 return -ENODEV;
690 691
691 return domain->ops->attach_dev(domain, dev); 692 ret = domain->ops->attach_dev(domain, dev);
693 if (!ret)
694 trace_attach_device_to_domain(dev);
695 return ret;
692} 696}
693EXPORT_SYMBOL_GPL(iommu_attach_device); 697EXPORT_SYMBOL_GPL(iommu_attach_device);
694 698