mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
Merge "qseecom: retry scm call if app is busy"
This commit is contained in:
commit
67951e4d8e
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