summaryrefslogtreecommitdiff
path: root/drivers/tee
diff options
context:
space:
mode:
authorIgor Opaniuk <igor.opaniuk@linaro.org>2019-01-24 20:32:31 +0300
committerJens Wiklander <jens.wiklander@linaro.org>2019-02-28 15:49:29 +0300
commit4f062dc1b759299851939524ff755b20542d8fc1 (patch)
treeb54608b54650df3efd4d3c0c8fac484874da31fa /drivers/tee
parent5fe8b1cc6a03c46b3061e808256d39dcebd0d0f0 (diff)
downloadlinux-4f062dc1b759299851939524ff755b20542d8fc1.tar.xz
tee: add cancellation support to client interface
Add support of cancellation request to the TEE kernel internal client interface. Can be used by software TPM drivers, that leverage TEE under the hood (for instance TPM2.0 mobile profile), for requesting cancellation of time-consuming operations (RSA key-pair generation etc.). Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'drivers/tee')
-rw-r--r--drivers/tee/tee_core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c
index 25f3b9cc8908..ecffdd8a29b7 100644
--- a/drivers/tee/tee_core.c
+++ b/drivers/tee/tee_core.c
@@ -1039,6 +1039,15 @@ int tee_client_invoke_func(struct tee_context *ctx,
}
EXPORT_SYMBOL_GPL(tee_client_invoke_func);
+int tee_client_cancel_req(struct tee_context *ctx,
+ struct tee_ioctl_cancel_arg *arg)
+{
+ if (!ctx->teedev->desc->ops->cancel_req)
+ return -EINVAL;
+ return ctx->teedev->desc->ops->cancel_req(ctx, arg->cancel_id,
+ arg->session);
+}
+
static int tee_client_device_match(struct device *dev,
struct device_driver *drv)
{