smcinvoke: Add a new error code in driver

Add a new error code to support the case when the
callback object times out. This error propagates
back to TZ and makes sure that the secure side responds
accordingly.

Change-Id: Ib604696c7af3d704c54950ec0d5909bcec3f53d6
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
This commit is contained in:
Anmolpreet Kaur 2021-03-09 23:33:07 +05:30
commit 2bd921b011
2 changed files with 3 additions and 2 deletions

View file

@ -1116,7 +1116,7 @@ out:
hash_del(&cb_txn->hash);
if (ret == 0) {
pr_err("CBObj timed out! No more retries\n");
cb_req->result = OBJECT_ERROR_ABORT;
cb_req->result = Object_ERROR_TIMEOUT;
} else if (ret == -ERESTARTSYS) {
pr_err("wait event interruped, ret: %d\n", ret);
cb_req->result = OBJECT_ERROR_ABORT;

View file

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
*/
#ifndef __SMCINVOKE_OBJECT_H
#define __SMCINVOKE_OBJECT_H
@ -79,5 +79,6 @@
#define OBJECT_ERROR_KMEM -97 /* kernel out of memory */
#define OBJECT_ERROR_REMOTE -98 /* local method sent to remote object */
#define OBJECT_ERROR_BUSY -99 /* Object is busy */
#define Object_ERROR_TIMEOUT -103 /* Call Back Object invocation timed out. */
#endif /* __SMCINVOKE_OBJECT_H */