From: "Ilias Apalodimas" <ilias.apalodimas@linaro.org>
To: "Jan Kiszka" <jan.kiszka@siemens.com>,
"U-Boot Mailing List" <u-boot@lists.u-boot-project.org>
Cc: "Jens Wiklander" <jens.wiklander@oss.qualcomm.com>,
"Sai Sree Kartheek Adivi" <s-adivi@ti.com>,
"Alexander Heinisch" <alexander.heinisch@siemens.com>,
"Tanmay Kathpalia" <tanmay.kathpalia@altera.com>
Subject: Re: [PATCH v2 1/5] tee: optee: Factor out service enumeration and binding functions
Date: Tue, 08 Sep 2026 10:08:22 +0300 [thread overview]
Message-ID: <DL9QV3I7AB7A.3R0777LUCF562@linaro.org> (raw)
In-Reply-To: <70c9bcf676e253ed8c86699237c74e41c86eb34a.1787514446.git.jan.kiszka@siemens.com>
Hi Jan
On Sun Aug 23, 2026 at 10:47 PM EEST, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This already avoids code duplication between the different enumeration
> commands. It will furthermore allow to implement a third one for
> services with RPMB needs.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> drivers/tee/optee/core.c | 33 +++++++++++++++++--------------
> drivers/tee/optee/optee_private.h | 3 +++
> 2 files changed, 21 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c
> index 4d67c948ec1..2871760a7b7 100644
> --- a/drivers/tee/optee/core.c
> +++ b/drivers/tee/optee/core.c
> @@ -156,7 +156,7 @@ static int enum_services(struct udevice *dev, struct tee_shm **shm, size_t *coun
> return ret;
> }
>
> -static int open_enum_session(struct udevice *dev, u32 *tee_sess)
> +int optee_open_enum_session(struct udevice *dev, u32 *tee_sess)
> {
> const struct tee_optee_ta_uuid pta_uuid = PTA_DEVICE_ENUM;
> struct tee_open_session_arg arg = { };
> @@ -176,31 +176,34 @@ static int open_enum_session(struct udevice *dev, u32 *tee_sess)
> return 0;
> }
>
> -static int bind_service_drivers(struct udevice *dev)
> +int optee_bind_services(struct udevice *dev, u32 tee_sess,
> + unsigned int pta_cmd)
> {
> struct tee_shm *service_list = NULL;
> size_t service_count;
> - u32 tee_sess;
> - int ret, ret2;
> -
> - ret = open_enum_session(dev, &tee_sess);
> - if (ret)
> - return ret;
> + int ret;
>
> ret = enum_services(dev, &service_list, &service_count, tee_sess,
> - PTA_CMD_GET_DEVICES);
> + pta_cmd);
> if (!ret && service_count)
> ret = bind_service_list(dev, service_list, service_count);
>
> tee_shm_free(service_list);
> - service_list = NULL;
>
> - ret2 = enum_services(dev, &service_list, &service_count, tee_sess,
> - PTA_CMD_GET_DEVICES_SUPP);
> - if (!ret2 && service_count)
> - ret2 = bind_service_list(dev, service_list, service_count);
> + return ret;
> +}
> +
> +static int bind_service_drivers(struct udevice *dev)
> +{
> + u32 tee_sess;
> + int ret, ret2;
>
> - tee_shm_free(service_list);
> + ret = optee_open_enum_session(dev, &tee_sess);
> + if (ret)
> + return ret;
> +
> + ret = optee_bind_services(dev, tee_sess, PTA_CMD_GET_DEVICES);
Any reason we aren't exiting immediately here?
> + ret2 = optee_bind_services(dev, tee_sess, PTA_CMD_GET_DEVICES_SUPP);
>
> tee_close_session(dev, tee_sess);
>
> diff --git a/drivers/tee/optee/optee_private.h b/drivers/tee/optee/optee_private.h
> index 1f07a27ee4b..25b6b3c3218 100644
> --- a/drivers/tee/optee/optee_private.h
> +++ b/drivers/tee/optee/optee_private.h
> @@ -27,6 +27,9 @@ struct optee_msg_arg;
>
> void optee_suppl_cmd(struct udevice *dev, struct tee_shm *shm_arg,
> void **page_list);
> +int optee_open_enum_session(struct udevice *dev, u32 *tee_sess);
> +int optee_bind_services(struct udevice *dev, u32 tee_sess,
> + unsigned int pta_cmd);
>
> #ifdef CONFIG_SUPPORT_EMMC_RPMB
> /**
Cheers
/Ilias
next prev parent reply other threads:[~2026-09-08 7:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-23 19:47 [PATCH v2 0/5] optee: Add support for enumerating RPMB-dependent services Jan Kiszka
2026-08-23 19:47 ` [PATCH v2 1/5] tee: optee: Factor out service enumeration and binding functions Jan Kiszka
2026-09-08 7:08 ` Ilias Apalodimas [this message]
2026-09-08 9:47 ` Jan Kiszka
2026-09-08 9:53 ` Jan Kiszka
2026-09-08 10:34 ` Ilias Apalodimas
2026-08-23 19:47 ` [PATCH v2 2/5] tee: optee: Add support for enumerating services that only need RPMB Jan Kiszka
2026-09-08 7:25 ` Ilias Apalodimas
2026-09-08 10:55 ` Jan Kiszka
2026-09-08 11:55 ` Ilias Apalodimas
2026-08-23 19:47 ` [PATCH v2 3/5] tee: optee: Do not warn about TEE_ERROR_STORAGE_NOT_AVAILABLE Jan Kiszka
2026-09-08 7:15 ` Ilias Apalodimas
2026-09-08 11:01 ` Jan Kiszka
2026-09-08 11:54 ` Ilias Apalodimas
2026-08-23 19:47 ` [PATCH v2 4/5] mmc: Call back to optee after a successful mmc_init Jan Kiszka
2026-08-26 8:44 ` Peng Fan
2026-08-26 10:10 ` Kathpalia, Tanmay
2026-08-23 19:47 ` [PATCH v2 5/5] mmc: Make "MMC Device not found" a debug output Jan Kiszka
2026-08-26 8:44 ` Peng Fan
2026-08-26 10:10 ` Kathpalia, Tanmay
2026-09-08 7:12 ` Ilias Apalodimas
2026-09-08 7:43 ` Kathpalia, Tanmay
2026-09-08 9:36 ` [PATCH v2 0/5] optee: Add support for enumerating RPMB-dependent services Ilias Apalodimas
2026-09-08 9:43 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DL9QV3I7AB7A.3R0777LUCF562@linaro.org \
--to=ilias.apalodimas@linaro.org \
--cc=alexander.heinisch@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=jens.wiklander@oss.qualcomm.com \
--cc=s-adivi@ti.com \
--cc=tanmay.kathpalia@altera.com \
--cc=u-boot@lists.u-boot-project.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.