From 5b4fd8b686ce1ec4ea9f723457895efa913fe49b Mon Sep 17 00:00:00 2001 From: Nitesh Gupta Date: Fri, 22 Apr 2022 16:38:45 +0530 Subject: [PATCH] smcinvoke: Add explicit cache flush during CB req from TZ Change: During Callback request from TZ, out and in buffers needed explicit cache coherency to be performed. Change-Id: I2b2aee7dce3d75dc07576079f4b0d268488c5951 Signed-off-by: Nitesh Gupta --- drivers/soc/qcom/smcinvoke.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/soc/qcom/smcinvoke.c b/drivers/soc/qcom/smcinvoke.c index 6397e5a963a1..fcd929143a39 100644 --- a/drivers/soc/qcom/smcinvoke.c +++ b/drivers/soc/qcom/smcinvoke.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #define pr_fmt(fmt) "smcinvoke: %s: " fmt, __func__ @@ -1042,8 +1043,14 @@ static int invoke_cmd_handler(int cmd, phys_addr_t in_paddr, size_t in_buf_len, break; case SMCINVOKE_CB_RSP_CMD: + if (legacy_smc_call) + qtee_shmbridge_flush_shm_buf(out_shm); ret = qcom_scm_invoke_callback_response(virt_to_phys(out_buf), out_buf_len, result, response_type, data); + if (legacy_smc_call) { + qtee_shmbridge_inv_shm_buf(in_shm); + qtee_shmbridge_inv_shm_buf(out_shm); + } break; default: