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

Commit 17d6e976 authored by Punit Soni's avatar Punit Soni Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: fix iommu deinit sequence in cpp



IOMMU memory needs to be unmapped and freed before device_detach and
iommu_destroy calls. This sequence needs to be fixed in cpp_close_node
call.

CRs-fixed: 639281
Change-Id: I65644cb83a42ebe508963eb48c130caa7f708ab8
Signed-off-by: default avatarPunit Soni <punits@codeaurora.org>
parent 77a1f98a
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1045,13 +1045,13 @@ static int cpp_close_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
			msm_camera_io_r(cpp_dev->cpp_hw_base + 0x8C));
			msm_camera_io_r(cpp_dev->cpp_hw_base + 0x8C));
		msm_camera_io_w(0x0, cpp_dev->base + MSM_CPP_MICRO_CLKEN_CTL);
		msm_camera_io_w(0x0, cpp_dev->base + MSM_CPP_MICRO_CLKEN_CTL);
		msm_cpp_clear_timer(cpp_dev);
		msm_cpp_clear_timer(cpp_dev);
		cpp_deinit_mem(cpp_dev);
		cpp_release_hardware(cpp_dev);
		if (cpp_dev->iommu_state == CPP_IOMMU_STATE_ATTACHED) {
		if (cpp_dev->iommu_state == CPP_IOMMU_STATE_ATTACHED) {
			iommu_detach_device(cpp_dev->domain,
			iommu_detach_device(cpp_dev->domain,
				cpp_dev->iommu_ctx);
				cpp_dev->iommu_ctx);
			cpp_dev->iommu_state = CPP_IOMMU_STATE_DETACHED;
			cpp_dev->iommu_state = CPP_IOMMU_STATE_DETACHED;
		}
		}
		cpp_release_hardware(cpp_dev);
		cpp_deinit_mem(cpp_dev);
		msm_cpp_empty_list(processing_q, list_frame);
		msm_cpp_empty_list(processing_q, list_frame);
		msm_cpp_empty_list(eventData_q, list_eventdata);
		msm_cpp_empty_list(eventData_q, list_eventdata);
		cpp_dev->state = CPP_STATE_OFF;
		cpp_dev->state = CPP_STATE_OFF;