Skip to content

Commit 3473b71

Browse files
committed
Merge tag 'tee-misc-for-v5.1' of https://git.linaro.org/people/jens.wiklander/linux-tee into arm/drivers
OP-TEE driver - dual license for optee_msg.h and optee_smc.h Generic - add cancellation support to client interface * tag 'tee-misc-for-v5.1' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: update optee_msg.h and optee_smc.h to dual license tee: add cancellation support to client interface Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 4f64020 + 32356d3 commit 3473b71

File tree

4 files changed

+25
-48
lines changed

4 files changed

+25
-48
lines changed

drivers/tee/optee/optee_msg.h

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,6 @@
1+
/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
12
/*
2-
* Copyright (c) 2015-2016, Linaro Limited
3-
* All rights reserved.
4-
*
5-
* Redistribution and use in source and binary forms, with or without
6-
* modification, are permitted provided that the following conditions are met:
7-
*
8-
* 1. Redistributions of source code must retain the above copyright notice,
9-
* this list of conditions and the following disclaimer.
10-
*
11-
* 2. Redistributions in binary form must reproduce the above copyright notice,
12-
* this list of conditions and the following disclaimer in the documentation
13-
* and/or other materials provided with the distribution.
14-
*
15-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18-
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19-
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20-
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21-
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22-
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23-
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24-
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25-
* POSSIBILITY OF SUCH DAMAGE.
3+
* Copyright (c) 2015-2019, Linaro Limited
264
*/
275
#ifndef _OPTEE_MSG_H
286
#define _OPTEE_MSG_H

drivers/tee/optee/optee_smc.h

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,6 @@
1+
/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */
12
/*
2-
* Copyright (c) 2015-2016, Linaro Limited
3-
* All rights reserved.
4-
*
5-
* Redistribution and use in source and binary forms, with or without
6-
* modification, are permitted provided that the following conditions are met:
7-
*
8-
* 1. Redistributions of source code must retain the above copyright notice,
9-
* this list of conditions and the following disclaimer.
10-
*
11-
* 2. Redistributions in binary form must reproduce the above copyright notice,
12-
* this list of conditions and the following disclaimer in the documentation
13-
* and/or other materials provided with the distribution.
14-
*
15-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18-
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
19-
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20-
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21-
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22-
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23-
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24-
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25-
* POSSIBILITY OF SUCH DAMAGE.
3+
* Copyright (c) 2015-2019, Linaro Limited
264
*/
275
#ifndef OPTEE_SMC_H
286
#define OPTEE_SMC_H

drivers/tee/tee_core.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,15 @@ int tee_client_invoke_func(struct tee_context *ctx,
10411041
}
10421042
EXPORT_SYMBOL_GPL(tee_client_invoke_func);
10431043

1044+
int tee_client_cancel_req(struct tee_context *ctx,
1045+
struct tee_ioctl_cancel_arg *arg)
1046+
{
1047+
if (!ctx->teedev->desc->ops->cancel_req)
1048+
return -EINVAL;
1049+
return ctx->teedev->desc->ops->cancel_req(ctx, arg->cancel_id,
1050+
arg->session);
1051+
}
1052+
10441053
static int tee_client_device_match(struct device *dev,
10451054
struct device_driver *drv)
10461055
{

include/linux/tee_drv.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,18 @@ int tee_client_invoke_func(struct tee_context *ctx,
535535
struct tee_ioctl_invoke_arg *arg,
536536
struct tee_param *param);
537537

538+
/**
539+
* tee_client_cancel_req() - Request cancellation of the previous open-session
540+
* or invoke-command operations in a Trusted Application
541+
* @ctx: TEE Context
542+
* @arg: Cancellation arguments, see description of
543+
* struct tee_ioctl_cancel_arg
544+
*
545+
* Returns < 0 on error else 0 if the cancellation was successfully requested.
546+
*/
547+
int tee_client_cancel_req(struct tee_context *ctx,
548+
struct tee_ioctl_cancel_arg *arg);
549+
538550
static inline bool tee_param_is_memref(struct tee_param *param)
539551
{
540552
switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {

0 commit comments

Comments
 (0)