smcinvoke: ADCI changes for SMCInvoke Driver
Change consists creation of ADCI thread at SMCInvoke driver initialization Change consists creation of ADCI thread at SMCInvoke driver initialization Following scenario have been tested for this change (1) ADCI thread creation and QTEE invocation during driver initialization (2) Backward Compatibility - IF ADCI feature is not supported (OBJECT_ERROR_INVALID) then exit the ADCI thread gracefully after cleaning up all the resources (3) Leak Test: All the resources held by ADCI thread should be released if ADCI feature is not supported by QTEE (i) adci task_struct state and exit state: state = TASK_RUNNING , exit_state = 0 (While ADCI thread execution) state = TASK_DEAD , exit_state = EXIT_DEAD (During ADCI thread termination) (ii) adci task_struct = NULL (fetched based on adci thread_id) which make sure task_struct has been deallocated (4) SMCInvoke related Test: All the internal(suuported),memobj and cbo testing has been performed. Change-Id: I2916ce260fae293b88fbc8b9d24baccdee1ea89f Signed-off-by: Pawan Rai <quic_pawarai@quicinc.com>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
4ed6950035
commit
ef2c3ba718
@@ -7,6 +7,7 @@
|
||||
#include <linux/fs.h>
|
||||
#include <linux/fdtable.h>
|
||||
#include <linux/anon_inodes.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
@@ -295,6 +296,7 @@ static int get_root_obj(struct Object *rootObj)
|
||||
int32_t get_client_env_object(struct Object *clientEnvObj)
|
||||
{
|
||||
int32_t ret = OBJECT_ERROR;
|
||||
int retry_count = 0;
|
||||
struct Object rootObj = Object_NULL;
|
||||
|
||||
/* get rootObj */
|
||||
@@ -305,8 +307,15 @@ int32_t get_client_env_object(struct Object *clientEnvObj)
|
||||
}
|
||||
|
||||
/* get client env */
|
||||
ret = IClientEnv_registerWithCredentials(rootObj,
|
||||
do {
|
||||
ret = IClientEnv_registerWithCredentials(rootObj,
|
||||
Object_NULL, clientEnvObj);
|
||||
if (ret == OBJECT_ERROR_BUSY) {
|
||||
pr_err("Secure side is busy,will retry after 5 ms, retry_count = %d",retry_count);
|
||||
msleep(5);
|
||||
}
|
||||
} while ((ret == OBJECT_ERROR_BUSY) && (retry_count++ < SMCINVOKE_INTERFACE_MAX_RETRY));
|
||||
|
||||
if (ret)
|
||||
pr_err("Failed to get ClientEnvObject, ret = %d\n", ret);
|
||||
Object_release(rootObj);
|
||||
|
Reference in New Issue
Block a user