summaryrefslogtreecommitdiff
path: root/drivers/tee/optee/smc_abi.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2023-12-22 13:43:18 +0300
committerArnd Bergmann <arnd@arndb.de>2023-12-22 13:43:19 +0300
commit95c1e57a384be88431ac031560cc2ae50d021d2d (patch)
treee2112ab62d485d00e673b3d3249d5f2fa8d1fc8f /drivers/tee/optee/smc_abi.c
parent9d0e3c5a3d89bbd77c671a84301c38e0a71bfa14 (diff)
parentd0476a59de064205f4aaa8f7c6d6f32bc28a44d4 (diff)
downloadlinux-95c1e57a384be88431ac031560cc2ae50d021d2d.tar.xz
Merge tag 'ffa-notif-for-v6.8' of https://git.linaro.org/people/jens.wiklander/linux-tee into soc/drivers
OP-TEE: asynchronous notifications with FF-A Add support for asynchronous notifications in the OP-TEE FF-A driver. This is the FF-A counterpart to the asynchronous notifications already available in the OP-TEE SMC ABI. * tag 'ffa-notif-for-v6.8' of https://git.linaro.org/people/jens.wiklander/linux-tee: optee: ffa_abi: add asynchronous notifications optee: provide optee_do_bottom_half() as a common function Link: https://lore.kernel.org/r/20231211105249.GA587253@rayden Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/tee/optee/smc_abi.c')
-rw-r--r--drivers/tee/optee/smc_abi.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c
index 3b60acc15cf0..e158f3136c26 100644
--- a/drivers/tee/optee/smc_abi.c
+++ b/drivers/tee/optee/smc_abi.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
- * Copyright (c) 2015-2021, Linaro Limited
+ * Copyright (c) 2015-2021, 2023 Linaro Limited
* Copyright (c) 2016, EPAM Systems
*/
@@ -967,34 +967,6 @@ static int optee_smc_do_call_with_arg(struct tee_context *ctx,
return rc;
}
-static int simple_call_with_arg(struct tee_context *ctx, u32 cmd)
-{
- struct optee_shm_arg_entry *entry;
- struct optee_msg_arg *msg_arg;
- struct tee_shm *shm;
- u_int offs;
-
- msg_arg = optee_get_msg_arg(ctx, 0, &entry, &shm, &offs);
- if (IS_ERR(msg_arg))
- return PTR_ERR(msg_arg);
-
- msg_arg->cmd = cmd;
- optee_smc_do_call_with_arg(ctx, shm, offs, false);
-
- optee_free_msg_arg(ctx, entry, offs);
- return 0;
-}
-
-static int optee_smc_do_bottom_half(struct tee_context *ctx)
-{
- return simple_call_with_arg(ctx, OPTEE_MSG_CMD_DO_BOTTOM_HALF);
-}
-
-static int optee_smc_stop_async_notif(struct tee_context *ctx)
-{
- return simple_call_with_arg(ctx, OPTEE_MSG_CMD_STOP_ASYNC_NOTIF);
-}
-
/*
* 5. Asynchronous notification
*/
@@ -1050,7 +1022,7 @@ static irqreturn_t notif_irq_thread_fn(int irq, void *dev_id)
{
struct optee *optee = dev_id;
- optee_smc_do_bottom_half(optee->ctx);
+ optee_do_bottom_half(optee->ctx);
return IRQ_HANDLED;
}
@@ -1088,7 +1060,7 @@ static void notif_pcpu_irq_work_fn(struct work_struct *work)
notif_pcpu_work);
struct optee *optee = container_of(optee_smc, struct optee, smc);
- optee_smc_do_bottom_half(optee->ctx);
+ optee_do_bottom_half(optee->ctx);
}
static int init_pcpu_irq(struct optee *optee, u_int irq)
@@ -1160,7 +1132,7 @@ static void uninit_pcpu_irq(struct optee *optee)
static void optee_smc_notif_uninit_irq(struct optee *optee)
{
if (optee->smc.sec_caps & OPTEE_SMC_SEC_CAP_ASYNC_NOTIF) {
- optee_smc_stop_async_notif(optee->ctx);
+ optee_stop_async_notif(optee->ctx);
if (optee->smc.notif_irq) {
if (irq_is_percpu_devid(optee->smc.notif_irq))
uninit_pcpu_irq(optee);