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

Commit 8df61858 authored by Jigarkumar Zala's avatar Jigarkumar Zala Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: smmu: Update iommu api to upstream kernel change



Update iommu api change to allocate/free domain for iommu region to
accommodate upstream kernel change.

Change-Id: I32bcc3d567f6664dd103c44f6cc0cab39827902c
Signed-off-by: default avatarJigarkumar Zala <jzala@codeaurora.org>
parent 28ca9870
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -907,11 +907,6 @@ int cam_hw_cdm_probe(struct platform_device *pdev)
	cam_smmu_set_client_page_fault_handler(cdm_core->iommu_hdl.non_secure,
	cam_smmu_set_client_page_fault_handler(cdm_core->iommu_hdl.non_secure,
		cam_hw_cdm_iommu_fault_handler, cdm_hw);
		cam_hw_cdm_iommu_fault_handler, cdm_hw);


	rc = cam_smmu_ops(cdm_core->iommu_hdl.non_secure, CAM_SMMU_ATTACH);
	if (rc < 0) {
		CAM_ERR(CAM_CDM, "Attach iommu non secure handle failed");
		goto destroy_non_secure_hdl;
	}
	cdm_core->iommu_hdl.secure = -1;
	cdm_core->iommu_hdl.secure = -1;


	cdm_core->work_queue = alloc_workqueue(cdm_core->name,
	cdm_core->work_queue = alloc_workqueue(cdm_core->name,
+0 −9
Original line number Original line Diff line number Diff line
@@ -1721,7 +1721,6 @@ int cam_fd_hw_mgr_deinit(struct device_node *of_node)


	cam_req_mgr_workq_destroy(&g_fd_hw_mgr.work);
	cam_req_mgr_workq_destroy(&g_fd_hw_mgr.work);


	cam_smmu_ops(g_fd_hw_mgr.device_iommu.non_secure, CAM_SMMU_DETACH);
	cam_smmu_destroy_handle(g_fd_hw_mgr.device_iommu.non_secure);
	cam_smmu_destroy_handle(g_fd_hw_mgr.device_iommu.non_secure);
	g_fd_hw_mgr.device_iommu.non_secure = -1;
	g_fd_hw_mgr.device_iommu.non_secure = -1;


@@ -1839,12 +1838,6 @@ int cam_fd_hw_mgr_init(struct device_node *of_node,
		goto destroy_mutex;
		goto destroy_mutex;
	}
	}


	rc = cam_smmu_ops(g_fd_hw_mgr.device_iommu.non_secure, CAM_SMMU_ATTACH);
	if (rc) {
		CAM_ERR(CAM_FD, "FD attach iommu handle failed, rc=%d", rc);
		goto destroy_smmu;
	}

	rc = cam_cdm_get_iommu_handle("fd", &g_fd_hw_mgr.cdm_iommu);
	rc = cam_cdm_get_iommu_handle("fd", &g_fd_hw_mgr.cdm_iommu);
	if (rc)
	if (rc)
		CAM_DBG(CAM_FD, "Failed to acquire the CDM iommu handles");
		CAM_DBG(CAM_FD, "Failed to acquire the CDM iommu handles");
@@ -1923,8 +1916,6 @@ int cam_fd_hw_mgr_init(struct device_node *of_node,
	return rc;
	return rc;


detach_smmu:
detach_smmu:
	cam_smmu_ops(g_fd_hw_mgr.device_iommu.non_secure, CAM_SMMU_DETACH);
destroy_smmu:
	cam_smmu_destroy_handle(g_fd_hw_mgr.device_iommu.non_secure);
	cam_smmu_destroy_handle(g_fd_hw_mgr.device_iommu.non_secure);
	g_fd_hw_mgr.device_iommu.non_secure = -1;
	g_fd_hw_mgr.device_iommu.non_secure = -1;
destroy_mutex:
destroy_mutex:
+0 −8
Original line number Original line Diff line number Diff line
@@ -4665,12 +4665,6 @@ int cam_icp_hw_mgr_init(struct device_node *of_node, uint64_t *hw_mgr_hdl,
		goto icp_get_hdl_failed;
		goto icp_get_hdl_failed;
	}
	}


	rc = cam_smmu_ops(icp_hw_mgr.iommu_hdl, CAM_SMMU_ATTACH);
	if (rc) {
		CAM_ERR(CAM_ICP, "icp attach failed: %d", rc);
		goto icp_attach_failed;
	}

	rc = cam_smmu_get_handle("cam-secure", &icp_hw_mgr.iommu_sec_hdl);
	rc = cam_smmu_get_handle("cam-secure", &icp_hw_mgr.iommu_sec_hdl);
	if (rc) {
	if (rc) {
		CAM_ERR(CAM_ICP, "get secure mmu handle failed: %d", rc);
		CAM_ERR(CAM_ICP, "get secure mmu handle failed: %d", rc);
@@ -4691,8 +4685,6 @@ int cam_icp_hw_mgr_init(struct device_node *of_node, uint64_t *hw_mgr_hdl,
	cam_smmu_destroy_handle(icp_hw_mgr.iommu_sec_hdl);
	cam_smmu_destroy_handle(icp_hw_mgr.iommu_sec_hdl);
	icp_hw_mgr.iommu_sec_hdl = -1;
	icp_hw_mgr.iommu_sec_hdl = -1;
secure_hdl_failed:
secure_hdl_failed:
	cam_smmu_ops(icp_hw_mgr.iommu_hdl, CAM_SMMU_DETACH);
icp_attach_failed:
	cam_smmu_destroy_handle(icp_hw_mgr.iommu_hdl);
	cam_smmu_destroy_handle(icp_hw_mgr.iommu_hdl);
	icp_hw_mgr.iommu_hdl = -1;
	icp_hw_mgr.iommu_hdl = -1;
icp_get_hdl_failed:
icp_get_hdl_failed:
+0 −9
Original line number Original line Diff line number Diff line
@@ -4897,12 +4897,6 @@ int cam_ife_hw_mgr_init(struct cam_hw_mgr_intf *hw_mgr_intf, int *iommu_hdl)
		return -EINVAL;
		return -EINVAL;
	}
	}


	if (cam_smmu_ops(g_ife_hw_mgr.mgr_common.img_iommu_hdl,
		CAM_SMMU_ATTACH)) {
		CAM_ERR(CAM_ISP, "Attach iommu handle failed.");
		goto attach_fail;
	}

	if (cam_smmu_get_handle("cam-secure",
	if (cam_smmu_get_handle("cam-secure",
		&g_ife_hw_mgr.mgr_common.img_iommu_hdl_secure)) {
		&g_ife_hw_mgr.mgr_common.img_iommu_hdl_secure)) {
		CAM_ERR(CAM_ISP, "Failed to get secure iommu handle");
		CAM_ERR(CAM_ISP, "Failed to get secure iommu handle");
@@ -5016,9 +5010,6 @@ int cam_ife_hw_mgr_init(struct cam_hw_mgr_intf *hw_mgr_intf, int *iommu_hdl)
		g_ife_hw_mgr.mgr_common.img_iommu_hdl_secure);
		g_ife_hw_mgr.mgr_common.img_iommu_hdl_secure);
	g_ife_hw_mgr.mgr_common.img_iommu_hdl_secure = -1;
	g_ife_hw_mgr.mgr_common.img_iommu_hdl_secure = -1;
secure_fail:
secure_fail:
	cam_smmu_ops(g_ife_hw_mgr.mgr_common.img_iommu_hdl,
		CAM_SMMU_DETACH);
attach_fail:
	cam_smmu_destroy_handle(g_ife_hw_mgr.mgr_common.img_iommu_hdl);
	cam_smmu_destroy_handle(g_ife_hw_mgr.mgr_common.img_iommu_hdl);
	g_ife_hw_mgr.mgr_common.img_iommu_hdl = -1;
	g_ife_hw_mgr.mgr_common.img_iommu_hdl = -1;
	return rc;
	return rc;
+0 −7
Original line number Original line Diff line number Diff line
@@ -1545,11 +1545,6 @@ int cam_jpeg_hw_mgr_init(struct device_node *of_node, uint64_t *hw_mgr_hdl,
	}
	}


	CAM_DBG(CAM_JPEG, "mmu handle :%d", g_jpeg_hw_mgr.iommu_hdl);
	CAM_DBG(CAM_JPEG, "mmu handle :%d", g_jpeg_hw_mgr.iommu_hdl);
	rc = cam_smmu_ops(g_jpeg_hw_mgr.iommu_hdl, CAM_SMMU_ATTACH);
	if (rc) {
		CAM_ERR(CAM_JPEG, "jpeg attach failed: %d", rc);
		goto jpeg_attach_failed;
	}


	rc = cam_cdm_get_iommu_handle("jpegenc", &cdm_handles);
	rc = cam_cdm_get_iommu_handle("jpegenc", &cdm_handles);
	if (rc) {
	if (rc) {
@@ -1592,9 +1587,7 @@ int cam_jpeg_hw_mgr_init(struct device_node *of_node, uint64_t *hw_mgr_hdl,
	return rc;
	return rc;


cdm_iommu_failed:
cdm_iommu_failed:
	cam_smmu_ops(g_jpeg_hw_mgr.iommu_hdl, CAM_SMMU_DETACH);
	cam_smmu_destroy_handle(g_jpeg_hw_mgr.iommu_hdl);
	cam_smmu_destroy_handle(g_jpeg_hw_mgr.iommu_hdl);
jpeg_attach_failed:
	g_jpeg_hw_mgr.iommu_hdl = 0;
	g_jpeg_hw_mgr.iommu_hdl = 0;
smmu_get_failed:
smmu_get_failed:
	mutex_destroy(&g_jpeg_hw_mgr.hw_mgr_mutex);
	mutex_destroy(&g_jpeg_hw_mgr.hw_mgr_mutex);
Loading