From 2bd921b011887879531b4435c5a35aad76a9ceec Mon Sep 17 00:00:00 2001 From: Anmolpreet Kaur Date: Tue, 9 Mar 2021 23:33:07 +0530 Subject: [PATCH] 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 --- drivers/soc/qcom/smcinvoke.c | 2 +- drivers/soc/qcom/smcinvoke_object.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/smcinvoke.c b/drivers/soc/qcom/smcinvoke.c index 3cbf9e359f2a..8b1ea0152ef6 100644 --- a/drivers/soc/qcom/smcinvoke.c +++ b/drivers/soc/qcom/smcinvoke.c @@ -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; diff --git a/drivers/soc/qcom/smcinvoke_object.h b/drivers/soc/qcom/smcinvoke_object.h index 09972e43067c..6f82e8a6ba4c 100644 --- a/drivers/soc/qcom/smcinvoke_object.h +++ b/drivers/soc/qcom/smcinvoke_object.h @@ -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 */