From 09ab1c8a4ab2f7747068c8e8ba087e054e59d576 Mon Sep 17 00:00:00 2001 From: Krishna Chaitanya Devarakonda Date: Fri, 19 May 2017 19:35:31 +0530 Subject: msm: sde: Reset the iommu_attached flag after detach When the secure camera starts, we detach the secure CB. We don't reset the iommu_attached flag to avoid iommu attach during the secure session. The improper flag value is causing imbalance in the clock voting, and is causing crashes when secure camera use cases are run back to back with device suspend/resume. The sde_smmu_attach function already takes care of avoiding attach during secure session. So, we can reset the flag to avoid imbalance in the clock voting. Change-Id: Ie57e930031800a0edc8e4a511451d6d8a2290eec Signed-off-by: Krishna Chaitanya Devarakonda --- drivers/media/platform/msm/sde/rotator/sde_rotator_smmu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/msm/sde/rotator/sde_rotator_smmu.c b/drivers/media/platform/msm/sde/rotator/sde_rotator_smmu.c index 58cb160f118e..9273c0e95230 100644 --- a/drivers/media/platform/msm/sde/rotator/sde_rotator_smmu.c +++ b/drivers/media/platform/msm/sde/rotator/sde_rotator_smmu.c @@ -486,11 +486,8 @@ int sde_smmu_secure_ctrl(int enable) mdata->iommu_attached = true; } else { rc = sde_smmu_detach(mdata); - /* - * keep iommu_attached equal to true, - * so that driver does not attemp to attach - * while in secure state - */ + if (!rc) + mdata->iommu_attached = false; } mutex_unlock(&sde_smmu_ref_cnt_lock); -- cgit v1.2.3