From 284a8e39b2034efb47f98297e1aeeef3ec07d45f Mon Sep 17 00:00:00 2001 From: Pranav Sanwal Date: Tue, 9 May 2023 16:29:18 +0530 Subject: [PATCH] msm: camera: ife: prevent scm calls for SAFE signalling problem: scm calls to enable/disable SAFE signal introduced due to HW limitation in some targets from ife causing overall system delay whenever camera starts and other HW components also making scm calls. solution: prevent redundant SCM calls for SAFE signal. CRs-Fixed: 3511194 Change-Id: Ib6692d599e9ec9e9182a9e6eb0aef52322cbfdef Signed-off-by: Pranav Sanwal --- drivers/cam_utils/cam_compat.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/cam_utils/cam_compat.c b/drivers/cam_utils/cam_compat.c index 7c5a739c9f..479be426c9 100644 --- a/drivers/cam_utils/cam_compat.c +++ b/drivers/cam_utils/cam_compat.c @@ -198,13 +198,15 @@ int cam_ife_notify_safe_lut_scm(bool safe_trigger) uint32_t camera_hw_version, rc = 0; rc = cam_cpas_get_cpas_hw_version(&camera_hw_version); - if (!rc && qcom_scm_smmu_notify_secure_lut(smmu_se_ife, safe_trigger)) { + if (!rc) { switch (camera_hw_version) { case CAM_CPAS_TITAN_170_V100: case CAM_CPAS_TITAN_170_V110: case CAM_CPAS_TITAN_175_V100: - CAM_ERR(CAM_ISP, "scm call to enable safe failed"); - rc = -EINVAL; + if (qcom_scm_smmu_notify_secure_lut(smmu_se_ife, safe_trigger)) { + CAM_ERR(CAM_ISP, "scm call to enable safe failed"); + rc = -EINVAL; + } break; default: break; @@ -265,13 +267,15 @@ int cam_ife_notify_safe_lut_scm(bool safe_trigger) }; rc = cam_cpas_get_cpas_hw_version(&camera_hw_version); - if (!rc && scm_call2(SCM_SIP_FNID(0x15, 0x3), &description)) { + if (!rc) { switch (camera_hw_version) { case CAM_CPAS_TITAN_170_V100: case CAM_CPAS_TITAN_170_V110: case CAM_CPAS_TITAN_175_V100: - CAM_ERR(CAM_ISP, "scm call to enable safe failed"); - rc = -EINVAL; + if (scm_call2(SCM_SIP_FNID(0x15, 0x3), &description)) { + CAM_ERR(CAM_ISP, "scm call to enable safe failed"); + rc = -EINVAL; + } break; default: break;