Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b54db778 authored by Shuah Khan's avatar Shuah Khan Committed by Joerg Roedel
Browse files

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: default avatarShuah Khan <shuah.kh@samsung.com>
Signed-off-by: default avatarJoerg Roedel <joro@8bytes.org>
parent 2e757086
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -685,10 +685,14 @@ EXPORT_SYMBOL_GPL(iommu_domain_free);


int iommu_attach_device(struct iommu_domain *domain, struct device *dev)
int iommu_attach_device(struct iommu_domain *domain, struct device *dev)
{
{
	int ret;
	if (unlikely(domain->ops->attach_dev == NULL))
	if (unlikely(domain->ops->attach_dev == NULL))
		return -ENODEV;
		return -ENODEV;


	return domain->ops->attach_dev(domain, dev);
	ret = domain->ops->attach_dev(domain, dev);
	if (!ret)
		trace_attach_device_to_domain(dev);
	return ret;
}
}
EXPORT_SYMBOL_GPL(iommu_attach_device);
EXPORT_SYMBOL_GPL(iommu_attach_device);