mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 03:45:24 -04:00
Fix instability issue during tbase load in Kernel 5.4
Tbase load was failing intermittently during fc_init() operation in __smc() with error: Trustonic TEE: ERROR -14 __smc: fc_init failed (4dee8000) The root cause has two components 1- qcom_scm_call() needs to be done atomically. Task reschedule was causing a failure. Thus changed to the atomic call qcom_scm_call_atomic(). 2- Qcom scm_call requires cache maintenance. API attests that any buffers that are expected to be accessed by the secure world must be flushed before invoking qcom_scm_call and invalidated in the cache immediately after qcom_scm_call returns. Cache invalidation was missing, hence add it. Change-Id: I83139fc5110eb3af536a30800c994c8e451df1fa Signed-off-by: quebs2 <quebs2@motorola.com> Reviewed-on: https://gerrit.mot.com/1899491 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Zhenxin Xi <xizx@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
731c495e28
commit
e81049289e
1 changed files with 6 additions and 5 deletions
|
|
@ -2394,7 +2394,8 @@ int __qcom_scm_invoke_smc(struct device *dev, phys_addr_t in_buf,
|
|||
|
||||
int __trustonic_smc_fastcall(void *fc_generic, size_t size)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
struct qcom_scm_desc desc = {
|
||||
.svc = SCM_SVC_MOBICORE,
|
||||
.cmd = SCM_CMD_MOBICORE,
|
||||
|
|
@ -2402,7 +2403,7 @@ int __trustonic_smc_fastcall(void *fc_generic, size_t size)
|
|||
};
|
||||
|
||||
void *scm_buf_va = NULL;
|
||||
phys_addr_t scm_buf_pa;
|
||||
phys_addr_t scm_buf_pa = 0;
|
||||
struct qtee_shm scm_shm = {0};
|
||||
|
||||
if (qtee_shmbridge_is_enabled()) {
|
||||
|
|
@ -2439,9 +2440,9 @@ 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(NULL, &desc);
|
||||
|
||||
qtee_shmbridge_flush_shm_buf(&scm_shm);
|
||||
ret = qcom_scm_call_atomic(NULL, &desc);
|
||||
qtee_shmbridge_inv_shm_buf(&scm_shm);
|
||||
memset(fc_generic, 0x00, size);
|
||||
memcpy(fc_generic, scm_buf_va, size);
|
||||
|
||||
if (qtee_shmbridge_is_enabled()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue