summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorJubeom Kim <jubeomk@nvidia.com>2014-01-16 18:11:48 +0900
committerHiroshi Doyu <hdoyu@nvidia.com>2014-03-04 02:30:55 -0800
commit7734e84d5c7927e1cfc960e5e896c4010098ea14 (patch)
tree4c66ef0f6b0561de8059b2c0466482fd772e1a8e /drivers/iommu
parenta16537427fe374b8f702f0079373b7d55dfbbfc9 (diff)
iommu/tegra: smmu: remove release_mapping func
Even though arm_iommu_attach_device() is failed, we don't need arm_iommu_release_mapping() because we don't need kref_put() to decrease kref->refcount. arm_iommu_release_mapping() is needed by arm_iommu_create_mapping(). And, if smmu_clients remain when iommu domain is destroyed, next smmu_client should be stored in temporary variable before smmu_iommu_detach_dev(), because current smmu_client->list.next will be invalid. So, list_for_each_entry() needs to be replaced with list_for_each_entry_safe(). Bug 1437038 Change-Id: Id246711b74ad1983b4765415fa4674407f09fbcc Signed-off-by: Jubeom Kim <jubeomk@nvidia.com> Reviewed-on: http://git-master/r/356451 Reviewed-on: http://git-master/r/377057 Reviewed-by: Hiroshi Doyu <hdoyu@nvidia.com> Tested-by: Hiroshi Doyu <hdoyu@nvidia.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/tegra-smmu.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 89a96d057b28..2db35e983056 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -1484,10 +1484,13 @@ static void smmu_iommu_domain_destroy(struct iommu_domain *domain)
}
if (!list_empty(&as->client)) {
- struct smmu_client *c;
-
- list_for_each_entry(c, &as->client, list)
+ struct smmu_client *c, *tmp_c;
+ list_for_each_entry_safe(c, tmp_c, &as->client, list) {
+ dev_err(smmu->dev,
+ "detaching %s because iommu domain is destroyed!\n",
+ dev_name(c->dev));
smmu_iommu_detach_dev(domain, c->dev);
+ }
}
spin_unlock_irqrestore(&as->lock, flags);