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

Commit 9f07864f authored by Dany Rybnikov's avatar Dany Rybnikov Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: Remove exit on error conditions for smmu apis



The msm_camera_tz_set_mode is called for TA notification
and if the notification fails the flow should still proceed
without return.
This change prevents a fault caused by vfe remaining in
secure mode as the detach was not called in case of
notification failure.

CRs-Fixed: 2011627
Change-Id: Iefcfd72c8e2d96aba2daf2bed8d271edee0cc8c1
Signed-off-by: default avatarDany Rybnikov <danyr@codeaurora.org>
parent 51740526
Loading
Loading
Loading
Loading
+28 −8
Original line number Diff line number Diff line
@@ -894,8 +894,13 @@ static int cam_smmu_attach_sec_cpp(int idx)
	rc = msm_camera_tz_set_mode(MSM_CAMERA_TZ_MODE_SECURE,
		MSM_CAMERA_TZ_HW_BLOCK_CPP);
	if (rc != 0) {
		pr_err("fail to set secure mode for cpp, rc %d", rc);
		return rc;
		pr_err("secure mode TA notification for cpp unsuccessful, rc %d\n",
			rc);
		/*
		 * Although the TA notification failed, the flow should proceed
		 * without returning an error as at this point cpp had already
		 * entered the secure mode.
		 */
	}

	iommu_cb_set.cb_info[idx].state = CAM_SMMU_ATTACH;
@@ -910,8 +915,13 @@ static int cam_smmu_detach_sec_cpp(int idx)
	rc = msm_camera_tz_set_mode(MSM_CAMERA_TZ_MODE_NON_SECURE,
		MSM_CAMERA_TZ_HW_BLOCK_CPP);
	if (rc != 0) {
		pr_err("fail to switch to non secure mode for cpp, rc %d", rc);
		return rc;
		pr_err("secure mode TA notification for cpp unsuccessful, rc %d\n",
			rc);
		/*
		 * Although the TA notification failed, the flow should proceed
		 * without returning an error, as at this point cpp is in secure
		 * mode and should be switched to non-secure regardless
		 */
	}

	iommu_cb_set.cb_info[idx].state = CAM_SMMU_DETACH;
@@ -950,8 +960,13 @@ static int cam_smmu_attach_sec_vfe_ns_stats(int idx)
	rc = msm_camera_tz_set_mode(MSM_CAMERA_TZ_MODE_SECURE,
		MSM_CAMERA_TZ_HW_BLOCK_ISP);
	if (rc != 0) {
		pr_err("fail to set secure mode for vfe, rc %d", rc);
		return rc;
		pr_err("secure mode TA notification for vfe unsuccessful, rc %d\n",
			rc);
		/*
		 * Although the TA notification failed, the flow should proceed
		 * without returning an error as at this point vfe had already
		 * entered the secure mode
		 */
	}

	return 0;
@@ -964,8 +979,13 @@ static int cam_smmu_detach_sec_vfe_ns_stats(int idx)
	rc = msm_camera_tz_set_mode(MSM_CAMERA_TZ_MODE_NON_SECURE,
		MSM_CAMERA_TZ_HW_BLOCK_ISP);
	if (rc != 0) {
		pr_err("fail to switch to non secure mode for vfe, rc %d", rc);
		return rc;
		pr_err("secure mode TA notification for vfe unsuccessful, rc %d\n",
			rc);
		/*
		 * Although the TA notification failed, the flow should proceed
		 * without returning an error, as at this point vfe is in secure
		 * mode and should be switched to non-secure regardless
		 */
	}

	/*