From 3d90262b5899cac4188c67252df7ae983c4df4d7 Mon Sep 17 00:00:00 2001 From: quebs2 Date: Tue, 16 Mar 2021 15:29:40 +0800 Subject: [PATCH] qcom_scm: Retry T-Base smc call when TZ is busy. We cannot guarantee the Trustonic nq kthread is always uninterruptable, atomic and SMP safe, so that we will send the command to the SCM and wait for the command to finish processing from secure world in case the QSEE might be busy at that point. This can be used in pre-emptible context when the Trustonic fast call is invoked to run whereby the scm handler happens to be owned by other threads. Change-Id: I0aac105684c7b8b7bed7ab2146b8ef62dab42837 Signed-off-by: quebs2 Reviewed-on: https://gerrit.mot.com/1902496 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jefferson Rodrigo Capovilla Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- drivers/firmware/qcom_scm-smc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/qcom_scm-smc.c b/drivers/firmware/qcom_scm-smc.c index 11257612c487..46a64458e51b 100644 --- a/drivers/firmware/qcom_scm-smc.c +++ b/drivers/firmware/qcom_scm-smc.c @@ -2440,7 +2440,7 @@ int __trustonic_smc_fastcall(void *fc_generic, size_t size) desc.args[3] = (u32)size; desc.arginfo = QCOM_SCM_ARGS(4, QCOM_SCM_RW, QCOM_SCM_VAL, QCOM_SCM_RW, QCOM_SCM_VAL); - ret = qcom_scm_call_atomic(NULL, &desc); + ret = qcom_scm_call(NULL, &desc); qtee_shmbridge_inv_shm_buf(&scm_shm); memset(fc_generic, 0x00, size); memcpy(fc_generic, scm_buf_va, size);