From 9ec380c06bbd79493828fcc3c876d8a53fd3369f Mon Sep 17 00:00:00 2001 From: Iliya Varadzhakov Date: Fri, 13 Mar 2015 07:33:18 -0700 Subject: msm: cpp: Update iommu handling CPP has to check for stream state before operate iommu contexts. Change-Id: I69e6266e1ff2d1cd93e7191f2c43c887154abae0 Signed-off-by: Iliya Varadzhakov --- drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c b/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c index 784e882..96b1641 100644 --- a/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c +++ b/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c @@ -2662,7 +2662,8 @@ STREAM_BUFF_END: break; } case VIDIOC_MSM_CPP_IOMMU_DETACH: { - if (cpp_dev->iommu_state == CPP_IOMMU_STATE_ATTACHED) { + if ((cpp_dev->iommu_state == CPP_IOMMU_STATE_ATTACHED) && + (cpp_dev->stream_cnt == 0)) { iommu_detach_device(cpp_dev->domain, cpp_dev->iommu_ctx); cpp_dev->iommu_state = CPP_IOMMU_STATE_DETACHED; -- cgit v1.1