mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
qseecom: retry scm call if app is busy
When KeyMaster (KM) app is occupied by Identity Credential (IC) app and any client requests some functionality from KM app then scm call failure is observed with response code indicating KM app is busy. In this case same scm call should be retried few more times to check if app can serve it. Bail out with failure if retry count expires. Change-Id: Icb092ff0a6b3b313197cf6a21f74caeaf6c576a1 Signed-off-by: sumikush <sumikush@codeaurora.org>
This commit is contained in:
parent
f04a23f264
commit
de5f115df0
1 changed files with 4 additions and 2 deletions
|
|
@ -470,6 +470,8 @@ static void __qseecom_free_coherent_buf(uint32_t size,
|
|||
#define QSEECOM_SCM_EBUSY_WAIT_MS 30
|
||||
#define QSEECOM_SCM_EBUSY_MAX_RETRY 67
|
||||
|
||||
#define QSEE_RESULT_FAIL_APP_BUSY 315
|
||||
|
||||
static int __qseecom_scm_call2_locked(uint32_t smc_id, struct scm_desc *desc)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
@ -477,14 +479,14 @@ static int __qseecom_scm_call2_locked(uint32_t smc_id, struct scm_desc *desc)
|
|||
|
||||
do {
|
||||
ret = qcom_scm_qseecom_call_noretry(smc_id, desc);
|
||||
if (ret == -EBUSY) {
|
||||
if ((ret == -EBUSY) || (desc && (desc->ret[0] == -QSEE_RESULT_FAIL_APP_BUSY))) {
|
||||
mutex_unlock(&app_access_lock);
|
||||
msleep(QSEECOM_SCM_EBUSY_WAIT_MS);
|
||||
mutex_lock(&app_access_lock);
|
||||
}
|
||||
if (retry_count == 33)
|
||||
pr_warn("secure world has been busy for 1 second!\n");
|
||||
} while (ret == -EBUSY &&
|
||||
} while (((ret == -EBUSY) || (desc && (desc->ret[0] == -QSEE_RESULT_FAIL_APP_BUSY))) &&
|
||||
(retry_count++ < QSEECOM_SCM_EBUSY_MAX_RETRY));
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue