From 8e15c568069246e3715d835998b9a46adb129754 Mon Sep 17 00:00:00 2001 From: Olav Haugan Date: Thu, 20 Mar 2014 15:53:07 -0700 Subject: iommu: msm: Move location of local iommu halt During iommu detach we do a local iommu halt to ensure certain registers are atomically updated. However, the local iommu halt is taken at a larger scope than needed. Reduce the scope of this halt. This will help with performance when detaching a context bank from an iommu that has another context bank in use. Change-Id: Id7630bd73a71d38ee987bd0f19cc8e06c725a7c1 Signed-off-by: Olav Haugan --- drivers/iommu/msm_iommu-v1.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/iommu') diff --git a/drivers/iommu/msm_iommu-v1.c b/drivers/iommu/msm_iommu-v1.c index 7f1f7bcd0e73..81fb615feead 100644 --- a/drivers/iommu/msm_iommu-v1.c +++ b/drivers/iommu/msm_iommu-v1.c @@ -899,16 +899,15 @@ static void msm_iommu_detach_dev(struct iommu_domain *domain, iommu_drvdata->asid[ctx_drvdata->asid - 1]--; ctx_drvdata->asid = -1; - iommu_halt(iommu_drvdata); - __reset_context(iommu_drvdata->cb_base, ctx_drvdata->num); /* * Only reset the M2V tables on the very last detach */ - if (!is_secure && iommu_drvdata->ctx_attach_count == 1) + if (!is_secure && iommu_drvdata->ctx_attach_count == 1) { + iommu_halt(iommu_drvdata); __release_smg(iommu_drvdata->base); - - iommu_resume(iommu_drvdata); + iommu_resume(iommu_drvdata); + } __disable_clocks(iommu_drvdata); -- cgit v1.2.3